From: support
Date: Thu, 4 May 2023 13:33:23 +0000 (+0000)
Subject: Built motion from commit 0d14f64c.|2.6.34
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=a02990eaa0730b2ca540b4b0a0ff875949192676;p=motion2.git
Built motion from commit 0d14f64c.|2.6.34
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index cd84a2d..eff039b 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-04-18T14:08:07.326Z",
+ "time": "2023-05-04T13:23:07.638Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 41ce622..3702cb0 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-04-18T14:08:07.326Z",
+ "time": "2023-05-04T13:23:07.638Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 61697b5..8f3b435 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 _0x5d96=['jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','STRING','integration'];(function(_0x3174d2,_0x4dbb8a){var _0x28519a=function(_0x4e0fb9){while(--_0x4e0fb9){_0x3174d2['push'](_0x3174d2['shift']());}};_0x28519a(++_0x4dbb8a);}(_0x5d96,0xdf));var _0x65d9=function(_0x414584,_0x1a1da6){_0x414584=_0x414584-0x0;var _0x50b255=_0x5d96[_0x414584];return _0x50b255;};'use strict';var Sequelize=require('sequelize');module[_0x65d9('0x0')]={'name':{'type':Sequelize[_0x65d9('0x1')],'get':function(_0x464f34){return this[_0x65d9('0x2')]('action');}},'action':{'type':Sequelize[_0x65d9('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x65d9('0x4'),'motionbar',_0x65d9('0x5'),_0x65d9('0x6'),_0x65d9('0x7'),_0x65d9('0x8'),_0x65d9('0x9')]],'msg':_0x65d9('0xa')}},'comment':_0x65d9('0xa')},'data1':{'type':Sequelize[_0x65d9('0x3')](0x1000),'comment':_0x65d9('0xb')},'data2':{'type':Sequelize[_0x65d9('0x3')](0x1000),'comment':_0x65d9('0xc')},'data3':{'type':Sequelize[_0x65d9('0x3')](0x1000),'comment':_0x65d9('0xd')},'data4':{'type':Sequelize[_0x65d9('0x3')](0x1000),'comments':_0x65d9('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x65d9('0xf')},'data6':{'type':Sequelize[_0x65d9('0x3')],'comments':_0x65d9('0x10')},'data7':{'type':Sequelize[_0x65d9('0x11')],'comments':_0x65d9('0x12')}};
\ No newline at end of file
+var _0xaf50=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot'];(function(_0x208e19,_0x2696aa){var _0x42f5eb=function(_0x3e1644){while(--_0x3e1644){_0x208e19['push'](_0x208e19['shift']());}};_0x42f5eb(++_0x2696aa);}(_0xaf50,0x186));var _0x0af5=function(_0x24373c,_0x88fa8e){_0x24373c=_0x24373c-0x0;var _0x15ef73=_0xaf50[_0x24373c];return _0x15ef73;};'use strict';var Sequelize=require('sequelize');module[_0x0af5('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3de0ad){return this[_0x0af5('0x1')](_0x0af5('0x2'));}},'action':{'type':Sequelize[_0x0af5('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0af5('0x4'),_0x0af5('0x5'),_0x0af5('0x6'),_0x0af5('0x7'),_0x0af5('0x8'),'browser',_0x0af5('0x9'),'script']],'msg':_0x0af5('0xa')}},'comment':_0x0af5('0xa')},'data1':{'type':Sequelize[_0x0af5('0x3')](0x1000),'comment':_0x0af5('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x0af5('0xc')},'data3':{'type':Sequelize[_0x0af5('0x3')](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[_0x0af5('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x0af5('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x0af5('0x3')],'comments':_0x0af5('0xd')},'data7':{'type':Sequelize[_0x0af5('0xe')],'comments':_0x0af5('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 1b36ba9..9a0edba 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 _0x1dd3=['undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','body','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset'];(function(_0x4c0544,_0x1fa6bc){var _0xf979f2=function(_0x379992){while(--_0x379992){_0x4c0544['push'](_0x4c0544['shift']());}};_0xf979f2(++_0x1fa6bc);}(_0x1dd3,0x102));var _0x31dd=function(_0x17ca23,_0x11c7d3){_0x17ca23=_0x17ca23-0x0;var _0x385e5c=_0x1dd3[_0x17ca23];return _0x385e5c;};'use strict';var emlformat=require(_0x31dd('0x0'));var rimraf=require(_0x31dd('0x1'));var zipdir=require(_0x31dd('0x2'));var jsonpatch=require(_0x31dd('0x3'));var rp=require(_0x31dd('0x4'));var moment=require('moment');var BPromise=require(_0x31dd('0x5'));var Mustache=require('mustache');var util=require(_0x31dd('0x6'));var path=require(_0x31dd('0x7'));var sox=require(_0x31dd('0x8'));var csv=require(_0x31dd('0x9'));var ejs=require(_0x31dd('0xa'));var fs=require('fs');var fs_extra=require(_0x31dd('0xb'));var _=require(_0x31dd('0xc'));var squel=require(_0x31dd('0xd'));var crypto=require(_0x31dd('0xe'));var jsforce=require(_0x31dd('0xf'));var deskjs=require(_0x31dd('0x10'));var toCsv=require(_0x31dd('0x9'));var querystring=require(_0x31dd('0x11'));var Papa=require(_0x31dd('0x12'));var Redis=require(_0x31dd('0x13'));var authService=require(_0x31dd('0x14'));var qs=require(_0x31dd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31dd('0x16'));var logger=require('../../config/logger')(_0x31dd('0x17'));var utils=require(_0x31dd('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b037e,_0x3db4b1){_0x3db4b1=_0x3db4b1||0xcc;return function(_0x243109){if(_0x243109){return _0x4b037e[_0x31dd('0x19')](_0x3db4b1);}return _0x4b037e[_0x31dd('0x1a')](_0x3db4b1)[_0x31dd('0x1b')]();};}function respondWithResult(_0x19b40c,_0x4da1ce){_0x4da1ce=_0x4da1ce||0xc8;return function(_0x49862e){if(_0x49862e){return _0x19b40c[_0x31dd('0x1a')](_0x4da1ce)[_0x31dd('0x1c')](_0x49862e);}};}function respondWithFilteredResult(_0x40c1f4,_0x4d08ff){return function(_0x3933cb){if(_0x3933cb){var _0x12cf31=typeof _0x4d08ff[_0x31dd('0x1d')]===_0x31dd('0x1e')&&typeof _0x4d08ff[_0x31dd('0x1f')]===_0x31dd('0x1e');var _0x254c19=_0x3933cb[_0x31dd('0x20')];var _0x12f1f4=_0x12cf31?0x0:_0x4d08ff[_0x31dd('0x1d')];var _0x5cd67a=_0x12cf31?_0x3933cb['count']:_0x4d08ff[_0x31dd('0x1d')]+_0x4d08ff[_0x31dd('0x1f')];var _0x3ccd84;if(_0x5cd67a>=_0x254c19){_0x5cd67a=_0x254c19;_0x3ccd84=0xc8;}else{_0x3ccd84=0xce;}_0x40c1f4[_0x31dd('0x1a')](_0x3ccd84);return _0x40c1f4[_0x31dd('0x21')]('Content-Range',_0x12f1f4+'-'+_0x5cd67a+'/'+_0x254c19)[_0x31dd('0x1c')](_0x3933cb);}return null;};}function patchUpdates(_0x4f3bf4){return function(_0x19c381){try{jsonpatch[_0x31dd('0x22')](_0x19c381,_0x4f3bf4,!![]);}catch(_0xfbed2f){return BPromise[_0x31dd('0x23')](_0xfbed2f);}return _0x19c381[_0x31dd('0x24')]();};}function saveUpdates(_0x69c67a,_0x17db2c){return function(_0x18ef82){if(_0x18ef82){return _0x18ef82[_0x31dd('0x25')](_0x69c67a)[_0x31dd('0x26')](function(_0x3a7bed){return _0x3a7bed;});}return null;};}function removeEntity(_0x4f66c5,_0x3901d1){return function(_0x4d423d){if(_0x4d423d){return _0x4d423d[_0x31dd('0x27')]()[_0x31dd('0x26')](function(){_0x4f66c5[_0x31dd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38568c,_0x145589){return function(_0x14ffd9){if(!_0x14ffd9){_0x38568c[_0x31dd('0x19')](0x194);}return _0x14ffd9;};}function handleError(_0x5aaf48,_0x4beb9a){_0x4beb9a=_0x4beb9a||0x1f4;return function(_0x3628d2){logger[_0x31dd('0x28')](_0x3628d2[_0x31dd('0x29')]);if(_0x3628d2[_0x31dd('0x2a')]){delete _0x3628d2['name'];}_0x5aaf48[_0x31dd('0x1a')](_0x4beb9a)[_0x31dd('0x2b')](_0x3628d2);};}exports[_0x31dd('0x25')]=function(_0x25f0f4,_0x4cd58e){if(_0x25f0f4['body']['id']){delete _0x25f0f4[_0x31dd('0x2c')]['id'];}return db['Action'][_0x31dd('0x2d')]({'where':{'id':_0x25f0f4[_0x31dd('0x2e')]['id']}})[_0x31dd('0x26')](handleEntityNotFound(_0x4cd58e,null))[_0x31dd('0x26')](saveUpdates(_0x25f0f4[_0x31dd('0x2c')],null))['then'](respondWithResult(_0x4cd58e,null))['catch'](handleError(_0x4cd58e,null));};exports[_0x31dd('0x27')]=function(_0x45baa9,_0x590138){return db['Action']['find']({'where':{'id':_0x45baa9['params']['id']}})[_0x31dd('0x26')](handleEntityNotFound(_0x590138,null))['then'](removeEntity(_0x590138,null))[_0x31dd('0x2f')](handleError(_0x590138,null));};
\ No newline at end of file
+var _0xda24=['../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','update','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api'];(function(_0x14db0a,_0xea5e2c){var _0x1eae4d=function(_0x395612){while(--_0x395612){_0x14db0a['push'](_0x14db0a['shift']());}};_0x1eae4d(++_0xea5e2c);}(_0xda24,0x1ac));var _0x4da2=function(_0x5e5ad9,_0x18845f){_0x5e5ad9=_0x5e5ad9-0x0;var _0x396036=_0xda24[_0x5e5ad9];return _0x396036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4da2('0x0'));var zipdir=require(_0x4da2('0x1'));var jsonpatch=require(_0x4da2('0x2'));var rp=require(_0x4da2('0x3'));var moment=require(_0x4da2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4da2('0x5'));var util=require(_0x4da2('0x6'));var path=require('path');var sox=require(_0x4da2('0x7'));var csv=require(_0x4da2('0x8'));var ejs=require(_0x4da2('0x9'));var fs=require('fs');var fs_extra=require(_0x4da2('0xa'));var _=require(_0x4da2('0xb'));var squel=require(_0x4da2('0xc'));var crypto=require(_0x4da2('0xd'));var jsforce=require(_0x4da2('0xe'));var deskjs=require(_0x4da2('0xf'));var toCsv=require(_0x4da2('0x8'));var querystring=require(_0x4da2('0x10'));var Papa=require(_0x4da2('0x11'));var Redis=require(_0x4da2('0x12'));var authService=require(_0x4da2('0x13'));var qs=require(_0x4da2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4da2('0x15'));var utils=require(_0x4da2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2547e7,_0xe653fa){_0xe653fa=_0xe653fa||0xcc;return function(_0x5955a5){if(_0x5955a5){return _0x2547e7[_0x4da2('0x17')](_0xe653fa);}return _0x2547e7[_0x4da2('0x18')](_0xe653fa)[_0x4da2('0x19')]();};}function respondWithResult(_0x50c848,_0x487144){_0x487144=_0x487144||0xc8;return function(_0x4168c5){if(_0x4168c5){return _0x50c848[_0x4da2('0x18')](_0x487144)[_0x4da2('0x1a')](_0x4168c5);}};}function respondWithFilteredResult(_0x453ac0,_0x4aedf1){return function(_0x878eb0){if(_0x878eb0){var _0x3ec2e7=typeof _0x4aedf1[_0x4da2('0x1b')]===_0x4da2('0x1c')&&typeof _0x4aedf1[_0x4da2('0x1d')]===_0x4da2('0x1c');var _0x6024cc=_0x878eb0[_0x4da2('0x1e')];var _0x53c7ae=_0x3ec2e7?0x0:_0x4aedf1[_0x4da2('0x1b')];var _0x3bd46f=_0x3ec2e7?_0x878eb0[_0x4da2('0x1e')]:_0x4aedf1[_0x4da2('0x1b')]+_0x4aedf1['limit'];var _0x2e21e5;if(_0x3bd46f>=_0x6024cc){_0x3bd46f=_0x6024cc;_0x2e21e5=0xc8;}else{_0x2e21e5=0xce;}_0x453ac0[_0x4da2('0x18')](_0x2e21e5);return _0x453ac0[_0x4da2('0x1f')](_0x4da2('0x20'),_0x53c7ae+'-'+_0x3bd46f+'/'+_0x6024cc)['json'](_0x878eb0);}return null;};}function patchUpdates(_0x1e329f){return function(_0x649f7a){try{jsonpatch['apply'](_0x649f7a,_0x1e329f,!![]);}catch(_0x51db90){return BPromise['reject'](_0x51db90);}return _0x649f7a[_0x4da2('0x21')]();};}function saveUpdates(_0x1d3dfa,_0x52ef96){return function(_0x47ec2d){if(_0x47ec2d){return _0x47ec2d['update'](_0x1d3dfa)[_0x4da2('0x22')](function(_0x3563ae){return _0x3563ae;});}return null;};}function removeEntity(_0x40f5ad,_0x18c754){return function(_0x1888de){if(_0x1888de){return _0x1888de[_0x4da2('0x23')]()[_0x4da2('0x22')](function(){_0x40f5ad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2672fb,_0x59442e){return function(_0x279c8b){if(!_0x279c8b){_0x2672fb[_0x4da2('0x17')](0x194);}return _0x279c8b;};}function handleError(_0x157335,_0x1dff39){_0x1dff39=_0x1dff39||0x1f4;return function(_0x330670){logger[_0x4da2('0x24')](_0x330670[_0x4da2('0x25')]);if(_0x330670[_0x4da2('0x26')]){delete _0x330670[_0x4da2('0x26')];}_0x157335['status'](_0x1dff39)['send'](_0x330670);};}exports[_0x4da2('0x27')]=function(_0x53edf2,_0x1345b6){if(_0x53edf2[_0x4da2('0x28')]['id']){delete _0x53edf2[_0x4da2('0x28')]['id'];}return db[_0x4da2('0x29')][_0x4da2('0x2a')]({'where':{'id':_0x53edf2[_0x4da2('0x2b')]['id']}})[_0x4da2('0x22')](handleEntityNotFound(_0x1345b6,null))[_0x4da2('0x22')](saveUpdates(_0x53edf2[_0x4da2('0x28')],null))[_0x4da2('0x22')](respondWithResult(_0x1345b6,null))[_0x4da2('0x2c')](handleError(_0x1345b6,null));};exports[_0x4da2('0x23')]=function(_0x2eb25e,_0x24de9b){return db[_0x4da2('0x29')]['find']({'where':{'id':_0x2eb25e[_0x4da2('0x2b')]['id']}})[_0x4da2('0x22')](handleEntityNotFound(_0x24de9b,null))[_0x4da2('0x22')](removeEntity(_0x24de9b,null))[_0x4da2('0x2c')](handleError(_0x24de9b,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 80d2ef7..1f0c5a9 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 _0x8b89=['moment','bluebird','request-promise','path','rimraf','./action.attributes','exports','define','Action','lodash','util','../../config/logger','api'];(function(_0x47b074,_0x18252c){var _0x5d3a9d=function(_0x5c6076){while(--_0x5c6076){_0x47b074['push'](_0x47b074['shift']());}};_0x5d3a9d(++_0x18252c);}(_0x8b89,0x7e));var _0x98b8=function(_0x2dfac5,_0x37514a){_0x2dfac5=_0x2dfac5-0x0;var _0x5f2cf2=_0x8b89[_0x2dfac5];return _0x5f2cf2;};'use strict';var _=require(_0x98b8('0x0'));var util=require(_0x98b8('0x1'));var logger=require(_0x98b8('0x2'))(_0x98b8('0x3'));var moment=require(_0x98b8('0x4'));var BPromise=require(_0x98b8('0x5'));var rp=require(_0x98b8('0x6'));var fs=require('fs');var path=require(_0x98b8('0x7'));var rimraf=require(_0x98b8('0x8'));var config=require('../../config/environment');var attributes=require(_0x98b8('0x9'));module[_0x98b8('0xa')]=function(_0x41fa2f,_0x48868c){return _0x41fa2f[_0x98b8('0xb')](_0x98b8('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ec1=['../../config/logger','api','request-promise','rimraf','../../config/environment','./action.attributes','Action','lodash'];(function(_0x1875cf,_0x1c26e5){var _0x133ea2=function(_0x502bea){while(--_0x502bea){_0x1875cf['push'](_0x1875cf['shift']());}};_0x133ea2(++_0x1c26e5);}(_0x9ec1,0xe7));var _0x19ec=function(_0x2ae2cd,_0xb42c96){_0x2ae2cd=_0x2ae2cd-0x0;var _0xc52725=_0x9ec1[_0x2ae2cd];return _0xc52725;};'use strict';var _=require(_0x19ec('0x0'));var util=require('util');var logger=require(_0x19ec('0x1'))(_0x19ec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x19ec('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19ec('0x4'));var config=require(_0x19ec('0x5'));var attributes=require(_0x19ec('0x6'));module['exports']=function(_0x1035ba,_0xba0219){return _0x1035ba['define'](_0x19ec('0x7'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 4da5f70..d8eac64 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b6909,_0xe6c49d){var _0x41475f=function(_0x3340ee){while(--_0x3340ee){_0x5b6909['push'](_0x5b6909['shift']());}};_0x41475f(++_0xe6c49d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5650b4,_0x2723ba){_0x5650b4=_0x5650b4-0x0;var _0x297a62=_0x7fbe[_0x5650b4];return _0x297a62;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2a0c8f,_0x512b1a){var _0x2bdadc=function(_0x605443){while(--_0x605443){_0x2a0c8f['push'](_0x2a0c8f['shift']());}};_0x2bdadc(++_0x512b1a);}(_0x326f,0xd1));var _0xf326=function(_0x22e3a8,_0x2eb8e8){_0x22e3a8=_0x22e3a8-0x0;var _0x56e9b4=_0x326f[_0x22e3a8];return _0x56e9b4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 35330b0..39a4301 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 _0x63cb=['isAuthenticated','delete','exports','multer','path','connect-timeout','Router','../../config/environment','./action.controller','put','/:id'];(function(_0x547b59,_0x3e8d99){var _0x255e97=function(_0x27c866){while(--_0x27c866){_0x547b59['push'](_0x547b59['shift']());}};_0x255e97(++_0x3e8d99);}(_0x63cb,0x19a));var _0xb63c=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x63cb[_0x166d93];return _0xba708;};'use strict';var multer=require(_0xb63c('0x0'));var util=require('util');var path=require(_0xb63c('0x1'));var timeout=require(_0xb63c('0x2'));var express=require('express');var router=express[_0xb63c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb63c('0x4'));var controller=require(_0xb63c('0x5'));router[_0xb63c('0x6')](_0xb63c('0x7'),auth[_0xb63c('0x8')](),controller['update']);router[_0xb63c('0x9')](_0xb63c('0x7'),auth[_0xb63c('0x8')](),controller['destroy']);module[_0xb63c('0xa')]=router;
\ No newline at end of file
+var _0xca25=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','isAuthenticated','destroy','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xca25,0x14f));var _0x5ca2=function(_0x3c6c1b,_0x82a1e4){_0x3c6c1b=_0x3c6c1b-0x0;var _0x15170e=_0xca25[_0x3c6c1b];return _0x15170e;};'use strict';var multer=require(_0x5ca2('0x0'));var util=require('util');var path=require(_0x5ca2('0x1'));var timeout=require(_0x5ca2('0x2'));var express=require(_0x5ca2('0x3'));var router=express[_0x5ca2('0x4')]();var fs_extra=require(_0x5ca2('0x5'));var auth=require(_0x5ca2('0x6'));var interaction=require(_0x5ca2('0x7'));var config=require(_0x5ca2('0x8'));var controller=require(_0x5ca2('0x9'));router[_0x5ca2('0xa')](_0x5ca2('0xb'),auth['isAuthenticated'](),controller[_0x5ca2('0xc')]);router['delete']('/:id',auth[_0x5ca2('0xd')](),controller[_0x5ca2('0xe')]);module[_0x5ca2('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index c24c2e0..d9d573a 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x58b472,_0x28dceb){var _0x35f78b=function(_0x5ea4bb){while(--_0x5ea4bb){_0x58b472['push'](_0x58b472['shift']());}};_0x35f78b(++_0x28dceb);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xda19=['exports','STRING','TEXT'];(function(_0x124fb0,_0x4addf2){var _0x2265d6=function(_0xd03631){while(--_0xd03631){_0x124fb0['push'](_0x124fb0['shift']());}};_0x2265d6(++_0x4addf2);}(_0xda19,0xd5));var _0x9da1=function(_0x5b25f1,_0x21d1ee){_0x5b25f1=_0x5b25f1-0x0;var _0x5a269f=_0xda19[_0x5b25f1];return _0x5a269f;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index e27ef04..f7ada88 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 _0x5c57=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','table','MetricId','metric','replace','function','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','format','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(%s)','MAX(%s)','MIN(%s)','SEC_TO_TIME(%s)','HOUR(%s)','operator','AnalyticMetric','from','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','CustomReports','UserProfileResource','then','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x4b5cec,_0x2df8a8){var _0x20681b=function(_0x2fd072){while(--_0x2fd072){_0x4b5cec['push'](_0x4b5cec['shift']());}};_0x20681b(++_0x2df8a8);}(_0x5c57,0x116));var _0x75c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c57[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x75c5('0x0'));var rimraf=require(_0x75c5('0x1'));var zipdir=require(_0x75c5('0x2'));var jsonpatch=require(_0x75c5('0x3'));var rp=require(_0x75c5('0x4'));var moment=require(_0x75c5('0x5'));var BPromise=require(_0x75c5('0x6'));var Mustache=require('mustache');var util=require(_0x75c5('0x7'));var path=require('path');var sox=require(_0x75c5('0x8'));var csv=require('to-csv');var ejs=require(_0x75c5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x75c5('0xa'));var jsforce=require(_0x75c5('0xb'));var deskjs=require(_0x75c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x75c5('0xd'));var Papa=require(_0x75c5('0xe'));var Redis=require(_0x75c5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x75c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x75c5('0x11'));var logger=require(_0x75c5('0x12'))('api');var utils=require(_0x75c5('0x13'));var config=require(_0x75c5('0x14'));var licenseUtil=require(_0x75c5('0x15'));var db=require(_0x75c5('0x16'))['db'];var dbH=require(_0x75c5('0x16'))[_0x75c5('0x17')];function respondWithStatusCode(_0x4f3588,_0x4ff62b){_0x4ff62b=_0x4ff62b||0xcc;return function(_0x1b7b5a){if(_0x1b7b5a){return _0x4f3588[_0x75c5('0x18')](_0x4ff62b);}return _0x4f3588['status'](_0x4ff62b)[_0x75c5('0x19')]();};}function respondWithResult(_0x5be150,_0x43bf34){_0x43bf34=_0x43bf34||0xc8;return function(_0x25379c){if(_0x25379c){return _0x5be150[_0x75c5('0x1a')](_0x43bf34)[_0x75c5('0x1b')](_0x25379c);}};}function respondWithFilteredResult(_0x411bfd,_0x3fcd7d){return function(_0x1145f6){if(_0x1145f6){var _0x32fdec=typeof _0x3fcd7d['offset']==='undefined'&&typeof _0x3fcd7d[_0x75c5('0x1c')]===_0x75c5('0x1d');var _0x234914=_0x1145f6[_0x75c5('0x1e')];var _0x405b66=_0x32fdec?0x0:_0x3fcd7d[_0x75c5('0x1f')];var _0x558596=_0x32fdec?_0x1145f6[_0x75c5('0x1e')]:_0x3fcd7d[_0x75c5('0x1f')]+_0x3fcd7d[_0x75c5('0x1c')];var _0x3e018d;if(_0x558596>=_0x234914){_0x558596=_0x234914;_0x3e018d=0xc8;}else{_0x3e018d=0xce;}_0x411bfd[_0x75c5('0x1a')](_0x3e018d);return _0x411bfd[_0x75c5('0x20')](_0x75c5('0x21'),_0x405b66+'-'+_0x558596+'/'+_0x234914)[_0x75c5('0x1b')](_0x1145f6);}return null;};}function patchUpdates(_0x1a8c30){return function(_0x21fbcb){try{jsonpatch[_0x75c5('0x22')](_0x21fbcb,_0x1a8c30,!![]);}catch(_0x577a29){return BPromise[_0x75c5('0x23')](_0x577a29);}return _0x21fbcb[_0x75c5('0x24')]();};}function saveUpdates(_0x5a3de7,_0xfc9f1a){return function(_0x470ef5){if(_0x470ef5){return _0x470ef5[_0x75c5('0x25')](_0x5a3de7)['then'](function(_0x23941f){return _0x23941f;});}return null;};}function removeEntity(_0x263cbc,_0x4d4cbe){return function(_0x361864){if(_0x361864){return _0x361864[_0x75c5('0x26')]()['then'](function(){var _0x4eb28d=_0x361864['get']({'plain':!![]});var _0x34d965=_0x75c5('0x27');return db[_0x75c5('0x28')][_0x75c5('0x26')]({'where':{'type':_0x34d965,'resourceId':_0x4eb28d['id']}})[_0x75c5('0x29')](function(){return _0x361864;});})['then'](function(){_0x263cbc[_0x75c5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22498b,_0x1db692){return function(_0x1353c5){if(!_0x1353c5){_0x22498b[_0x75c5('0x18')](0x194);}return _0x1353c5;};}function handleError(_0x322f23,_0x4c2510){_0x4c2510=_0x4c2510||0x1f4;return function(_0x56a12b){logger[_0x75c5('0x2a')](_0x56a12b[_0x75c5('0x2b')]);if(_0x56a12b[_0x75c5('0x2c')]){delete _0x56a12b[_0x75c5('0x2c')];}_0x322f23[_0x75c5('0x1a')](_0x4c2510)[_0x75c5('0x2d')](_0x56a12b);};}exports['index']=function(_0x4921ac,_0x607cd5){var _0xfa864d={},_0x5b432c={},_0x3f9260={'count':0x0,'rows':[]};var _0x1cd722=_[_0x75c5('0x2e')](db[_0x75c5('0x2f')][_0x75c5('0x30')],function(_0x151f14){return{'name':_0x151f14[_0x75c5('0x31')],'type':_0x151f14[_0x75c5('0x32')][_0x75c5('0x33')]};});_0x5b432c[_0x75c5('0x34')]=_['map'](_0x1cd722,'name');_0x5b432c[_0x75c5('0x35')]=_['keys'](_0x4921ac[_0x75c5('0x35')]);_0x5b432c[_0x75c5('0x36')]=_[_0x75c5('0x37')](_0x5b432c['model'],_0x5b432c[_0x75c5('0x35')]);_0xfa864d[_0x75c5('0x38')]=_[_0x75c5('0x37')](_0x5b432c[_0x75c5('0x34')],qs[_0x75c5('0x39')](_0x4921ac['query'][_0x75c5('0x39')]));_0xfa864d[_0x75c5('0x38')]=_0xfa864d[_0x75c5('0x38')][_0x75c5('0x3a')]?_0xfa864d[_0x75c5('0x38')]:_0x5b432c[_0x75c5('0x34')];if(!_0x4921ac['query'][_0x75c5('0x3b')](_0x75c5('0x3c'))){_0xfa864d[_0x75c5('0x1c')]=qs[_0x75c5('0x1c')](_0x4921ac[_0x75c5('0x35')][_0x75c5('0x1c')]);_0xfa864d[_0x75c5('0x1f')]=qs['offset'](_0x4921ac[_0x75c5('0x35')]['offset']);}_0xfa864d[_0x75c5('0x3d')]=qs[_0x75c5('0x3e')](_0x4921ac[_0x75c5('0x35')][_0x75c5('0x3e')]);_0xfa864d[_0x75c5('0x3f')]=qs[_0x75c5('0x36')](_[_0x75c5('0x40')](_0x4921ac[_0x75c5('0x35')],_0x5b432c['filters']),_0x1cd722);if(_0x4921ac[_0x75c5('0x35')]['filter']){_0xfa864d['where']=_[_0x75c5('0x41')](_0xfa864d[_0x75c5('0x3f')],{'$or':_[_0x75c5('0x2e')](_0x1cd722,function(_0x27527b){if(_0x27527b[_0x75c5('0x32')]!==_0x75c5('0x42')){var _0x1e216e={};_0x1e216e[_0x27527b[_0x75c5('0x2c')]]={'$like':'%'+_0x4921ac[_0x75c5('0x35')][_0x75c5('0x43')]+'%'};return _0x1e216e;}})});}_0xfa864d=_['merge']({},_0xfa864d,_0x4921ac[_0x75c5('0x44')]);var _0x52905c={'where':_0xfa864d[_0x75c5('0x3f')]};return db[_0x75c5('0x2f')]['count'](_0x52905c)['then'](function(_0x11119c){_0x3f9260[_0x75c5('0x1e')]=_0x11119c;if(_0x4921ac[_0x75c5('0x35')][_0x75c5('0x45')]){_0xfa864d[_0x75c5('0x46')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x75c5('0x47')](_0xfa864d);})[_0x75c5('0x29')](function(_0x43e64c){_0x3f9260['rows']=_0x43e64c;return _0x3f9260;})['then'](respondWithFilteredResult(_0x607cd5,_0xfa864d))[_0x75c5('0x48')](handleError(_0x607cd5,null));};exports[_0x75c5('0x49')]=function(_0x1818b7,_0x4dfe42){var _0x279e6f={'raw':![],'where':{'id':_0x1818b7[_0x75c5('0x4a')]['id']}},_0x138bf0={};_0x138bf0['model']=_['keys'](db['AnalyticCustomReport'][_0x75c5('0x30')]);_0x138bf0[_0x75c5('0x35')]=_[_0x75c5('0x4b')](_0x1818b7['query']);_0x138bf0[_0x75c5('0x36')]=_['intersection'](_0x138bf0[_0x75c5('0x34')],_0x138bf0[_0x75c5('0x35')]);_0x279e6f['attributes']=_['intersection'](_0x138bf0[_0x75c5('0x34')],qs[_0x75c5('0x39')](_0x1818b7[_0x75c5('0x35')][_0x75c5('0x39')]));_0x279e6f[_0x75c5('0x38')]=_0x279e6f[_0x75c5('0x38')][_0x75c5('0x3a')]?_0x279e6f[_0x75c5('0x38')]:_0x138bf0[_0x75c5('0x34')];if(_0x1818b7[_0x75c5('0x35')][_0x75c5('0x45')]){_0x279e6f['include']=[{'all':!![]}];}_0x279e6f=_[_0x75c5('0x41')]({},_0x279e6f,_0x1818b7[_0x75c5('0x44')]);return db[_0x75c5('0x2f')]['find'](_0x279e6f)[_0x75c5('0x29')](handleEntityNotFound(_0x4dfe42,null))['then'](respondWithResult(_0x4dfe42,null))[_0x75c5('0x48')](handleError(_0x4dfe42,null));};exports[_0x75c5('0x4c')]=function(_0x1aff2c,_0x243cd1){return db[_0x75c5('0x2f')]['create'](_0x1aff2c[_0x75c5('0x4d')],{})[_0x75c5('0x29')](function(_0x236027){var _0x77bb0a=_0x1aff2c[_0x75c5('0x4e')][_0x75c5('0x4f')]({'plain':!![]});if(!_0x77bb0a)throw new Error(_0x75c5('0x50'));if(_0x77bb0a[_0x75c5('0x51')]==='user'){var _0x35d1eb=_0x236027[_0x75c5('0x4f')]({'plain':!![]});var _0x47f3e7=_0x75c5('0x52');return db['UserProfileSection'][_0x75c5('0x53')]({'where':{'name':_0x47f3e7,'userProfileId':_0x77bb0a[_0x75c5('0x54')]},'raw':!![]})[_0x75c5('0x29')](function(_0xad2a8e){if(_0xad2a8e&&_0xad2a8e['autoAssociation']===0x0){return db[_0x75c5('0x28')][_0x75c5('0x4c')]({'name':_0x35d1eb[_0x75c5('0x2c')],'resourceId':_0x35d1eb['id'],'type':'CustomReports','sectionId':_0xad2a8e['id']},{})[_0x75c5('0x29')](function(){return _0x236027;});}else{return _0x236027;}})[_0x75c5('0x48')](function(_0x50e202){logger[_0x75c5('0x2a')](_0x75c5('0x55'),_0x50e202);throw _0x50e202;});}return _0x236027;})[_0x75c5('0x29')](respondWithResult(_0x243cd1,0xc9))[_0x75c5('0x48')](handleError(_0x243cd1,null));};exports[_0x75c5('0x25')]=function(_0x2abe8f,_0x21df14){if(_0x2abe8f['body']['id']){delete _0x2abe8f[_0x75c5('0x4d')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x2abe8f[_0x75c5('0x4a')]['id']}})[_0x75c5('0x29')](handleEntityNotFound(_0x21df14,null))['then'](saveUpdates(_0x2abe8f[_0x75c5('0x4d')],null))[_0x75c5('0x29')](respondWithResult(_0x21df14,null))[_0x75c5('0x48')](handleError(_0x21df14,null));};exports['destroy']=function(_0x2d1c2a,_0x4445ec){return db['AnalyticCustomReport'][_0x75c5('0x53')]({'where':{'id':_0x2d1c2a[_0x75c5('0x4a')]['id']}})[_0x75c5('0x29')](handleEntityNotFound(_0x4445ec,null))['then'](removeEntity(_0x4445ec,null))[_0x75c5('0x48')](handleError(_0x4445ec,null));};exports['preview']=function(_0x455bd4,_0x3254ed){var _0xf297d6=0xa;var _0x1d5ecd=[_0x75c5('0x56'),_0x75c5('0x57'),_0x75c5('0x58'),_0x75c5('0x59')];var _0xdb2bed={'SUM':_0x75c5('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x75c5('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x75c5('0x5c'),'GROUP_CONCAT':_0x75c5('0x5d'),'GROUP_CONCAT ASC':_0x75c5('0x5e'),'GROUP_CONCAT DESC':_0x75c5('0x5f')};var _0x44452c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x75c5('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x75c5('0x61'),'UNIX_TIMESTAMP':_0x75c5('0x62')};var _0x36e2b1=function(_0x584695){return!_[_0x75c5('0x63')]([_0x75c5('0x64'),_0x75c5('0x65'),'IS\x20EMPTY',_0x75c5('0x66')],_0x584695);};var _0x569561=function(_0x5b210f){if(!_0x5b210f||!_0x5b210f[_0x75c5('0x67')]['length']){return'';}for(var _0xe71071='(',_0x57f356=0x0;_0x57f356<_0x5b210f['rules'][_0x75c5('0x3a')];_0x57f356+=0x1){_0x57f356>0x0&&(_0xe71071+='\x20'+_0x5b210f['operator']+'\x20');_0xe71071+=_0x5b210f[_0x75c5('0x67')][_0x57f356][_0x75c5('0x68')]?_0x569561(_0x5b210f[_0x75c5('0x67')][_0x57f356][_0x75c5('0x68')]):_0x5b210f['rules'][_0x57f356][_0x75c5('0x69')]+'\x20'+_0x5b210f[_0x75c5('0x67')][_0x57f356][_0x75c5('0x6a')]+(_0x36e2b1(_0x5b210f[_0x75c5('0x67')][_0x57f356][_0x75c5('0x6a')])?'\x20'+_0x5b210f[_0x75c5('0x67')][_0x57f356][_0x75c5('0x6b')]:'');}return _0xe71071+')';};var _0x2d2850={'where':{'id':_0x455bd4[_0x75c5('0x4a')]['id']}},_0x2e3ef3,_0x87fa6e,_0x4fee83,_0x277aae,_0x54c8dc;_0x2d2850=_[_0x75c5('0x41')]({},_0x2d2850,_0x455bd4[_0x75c5('0x44')]);return db[_0x75c5('0x2f')][_0x75c5('0x53')](_0x2d2850)[_0x75c5('0x29')](function(_0x59afe7){if(_0x59afe7){_0x2e3ef3=_0x59afe7;return _0x59afe7[_0x75c5('0x6c')]();}return null;})[_0x75c5('0x29')](function(_0x1a41b7){if(_0x1a41b7){if(!_0x1a41b7[_0x75c5('0x3a')]){throw new db[(_0x75c5('0x6d'))][(_0x75c5('0x6e'))](_0x75c5('0x6f'),0x193);}_0x87fa6e=_0x1a41b7;return db['AnalyticMetric'][_0x75c5('0x47')]({'raw':!![]});}return null;})['then'](function(_0x198c71){if(_0x198c71){_0x4fee83=_[_0x75c5('0x70')](_0x198c71,'id');var _0x706962;var _0x5bd733=squel[_0x75c5('0x71')]();_0x5bd733['from'](_0x2e3ef3[_0x75c5('0x72')]);for(var _0x39d724=0x0;_0x39d724<_0x87fa6e['length'];_0x39d724+=0x1){_0x706962=_0x87fa6e[_0x39d724][_0x75c5('0x73')]?_0x4fee83[_0x87fa6e[_0x39d724][_0x75c5('0x73')]][_0x75c5('0x74')]:_0x87fa6e[_0x39d724][_0x75c5('0x69')];_0x706962=_0x87fa6e[_0x39d724]['function']?_[_0x75c5('0x75')](_0xdb2bed[_0x87fa6e[_0x39d724][_0x75c5('0x76')]],'%s',_0x706962):_0x706962;_0x706962=_0x87fa6e[_0x39d724]['format']?_[_0x75c5('0x75')](_0x44452c[_0x87fa6e[_0x39d724]['format']],'%s',_0x706962):_0x706962;if(_0x87fa6e[_0x39d724][_0x75c5('0x77')]){_0x5bd733[_0x75c5('0x68')](_0x706962);}_0x87fa6e[_0x39d724][_0x75c5('0x78')]&&_0x5bd733[_0x75c5('0x3d')](_0x706962,_0x87fa6e[_0x39d724]['orderBy']===_0x75c5('0x79')?![]:!![]);_0x5bd733['field'](_0x706962,_0x87fa6e[_0x39d724][_0x75c5('0x7a')]||_0x706962);}if(_0x2e3ef3[_0x75c5('0x7b')]){_0x2e3ef3[_0x75c5('0x7b')]=JSON[_0x75c5('0x7c')](_0x2e3ef3[_0x75c5('0x7b')]);for(var _0x5e552a=0x0;_0x5e552a<_0x2e3ef3[_0x75c5('0x7b')][_0x75c5('0x3a')];_0x5e552a+=0x1){if(_0x2e3ef3['joins'][_0x5e552a]['type']&&_[_0x75c5('0x63')](_0x1d5ecd,_0x2e3ef3['joins'][_0x5e552a][_0x75c5('0x32')])&&_0x2e3ef3[_0x75c5('0x7b')][_0x5e552a][_0x75c5('0x7d')]&&_0x2e3ef3['joins'][_0x5e552a][_0x75c5('0x7e')]&&_0x2e3ef3[_0x75c5('0x7b')][_0x5e552a]['foreignKey']){_0x5bd733[_0x2e3ef3[_0x75c5('0x7b')][_0x5e552a][_0x75c5('0x32')]](_0x2e3ef3[_0x75c5('0x7b')][_0x5e552a][_0x75c5('0x7e')],null,util[_0x75c5('0x7f')](_0x75c5('0x80'),_0x2e3ef3[_0x75c5('0x72')],_0x2e3ef3[_0x75c5('0x7b')][_0x5e552a][_0x75c5('0x7d')],_0x2e3ef3['joins'][_0x5e552a][_0x75c5('0x7e')],_0x2e3ef3[_0x75c5('0x7b')][_0x5e552a][_0x75c5('0x81')]));}}}if(_0x2e3ef3['conditions']){_0x2e3ef3[_0x75c5('0x82')]=JSON['parse'](_0x2e3ef3[_0x75c5('0x82')]);_0x5bd733['where'](_0x569561(_0x2e3ef3[_0x75c5('0x82')][_0x75c5('0x68')]));}_0x54c8dc=_0x5bd733[_0x75c5('0x83')]();_0x5bd733[_0x75c5('0x1c')](_0xf297d6);_0x5bd733[_0x75c5('0x1f')](0x0);logger[_0x75c5('0x84')](_0x75c5('0x85'),_0x5bd733['toString']());return dbH[_0x75c5('0x86')][_0x75c5('0x35')](_0x5bd733[_0x75c5('0x87')](),{'type':dbH[_0x75c5('0x86')][_0x75c5('0x88')]['SELECT']});}})[_0x75c5('0x29')](respondWithResult(_0x3254ed,null))['catch'](handleError(_0x3254ed,null));};function runReport(_0x2d3f6f,_0x380182,_0x4da75f){var _0x5181f0=_0x380182[_0x75c5('0x2c')];var _0x488e67=0xa;var _0x1ab574=['join','left_join',_0x75c5('0x58'),_0x75c5('0x59')];var _0x593eb0={'SUM':_0x75c5('0x5a'),'COUNT':_0x75c5('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x75c5('0x8a'),'MIN':_0x75c5('0x8b'),'AVG':_0x75c5('0x5c'),'GROUP_CONCAT':_0x75c5('0x5d'),'GROUP_CONCAT ASC':_0x75c5('0x5e'),'GROUP_CONCAT DESC':_0x75c5('0x5f')};var _0x1b3be4={'SEC_TO_TIME':_0x75c5('0x8c'),'DATE':_0x75c5('0x60'),'HOUR':_0x75c5('0x8d'),'ROUND':_0x75c5('0x61'),'UNIX_TIMESTAMP':_0x75c5('0x62')};var _0x28f5d8=function(_0x269102){return!_['includes'](['IS\x20NULL',_0x75c5('0x65'),'IS\x20EMPTY',_0x75c5('0x66')],_0x269102);};var _0x4c378d=function(_0x1f39db){if(!_0x1f39db||!_0x1f39db[_0x75c5('0x67')][_0x75c5('0x3a')]){return'';}for(var _0x29414c='(',_0x29ac54=0x0;_0x29ac54<_0x1f39db[_0x75c5('0x67')]['length'];_0x29ac54+=0x1){_0x29ac54>0x0&&(_0x29414c+='\x20'+_0x1f39db[_0x75c5('0x8e')]+'\x20');_0x29414c+=_0x1f39db[_0x75c5('0x67')][_0x29ac54][_0x75c5('0x68')]?_0x4c378d(_0x1f39db['rules'][_0x29ac54]['group']):_0x1f39db[_0x75c5('0x67')][_0x29ac54][_0x75c5('0x69')]+'\x20'+_0x1f39db[_0x75c5('0x67')][_0x29ac54]['condition']+(_0x28f5d8(_0x1f39db[_0x75c5('0x67')][_0x29ac54]['condition'])?'\x20'+_0x1f39db[_0x75c5('0x67')][_0x29ac54][_0x75c5('0x6b')]:'');}return _0x29414c+')';};var _0x46f56d={'where':{'id':_0x2d3f6f['id']}},_0xe8dc14,_0x3ce61b,_0x4605de,_0x4557c8,_0x25245a;_0x46f56d=_[_0x75c5('0x41')]({},_0x46f56d,_0x4da75f);return db[_0x75c5('0x2f')][_0x75c5('0x53')](_0x46f56d)['then'](function(_0x92080e){if(_0x92080e){_0xe8dc14=_0x92080e;return _0x92080e[_0x75c5('0x6c')]();}return null;})[_0x75c5('0x29')](function(_0x4400d8){if(_0x4400d8){if(!_0x4400d8['length']){throw new db['Sequelize'][(_0x75c5('0x6e'))](_0x75c5('0x6f'),0x193);}_0x3ce61b=_0x4400d8;return db[_0x75c5('0x8f')][_0x75c5('0x47')]({'raw':!![]});}return null;})[_0x75c5('0x29')](function(_0x375e2c){if(_0x375e2c){_0x4605de=_[_0x75c5('0x70')](_0x375e2c,'id');var _0x250d08;var _0x1a2662=squel['select']();_0x1a2662[_0x75c5('0x90')](_0xe8dc14['table']);for(var _0x19a282=0x0;_0x19a282<_0x3ce61b[_0x75c5('0x3a')];_0x19a282+=0x1){_0x250d08=_0x3ce61b[_0x19a282][_0x75c5('0x73')]?_0x4605de[_0x3ce61b[_0x19a282][_0x75c5('0x73')]][_0x75c5('0x74')]:_0x3ce61b[_0x19a282][_0x75c5('0x69')];_0x250d08=_0x3ce61b[_0x19a282]['function']?_['replace'](_0x593eb0[_0x3ce61b[_0x19a282][_0x75c5('0x76')]],'%s',_0x250d08):_0x250d08;_0x250d08=_0x3ce61b[_0x19a282][_0x75c5('0x7f')]?_[_0x75c5('0x75')](_0x1b3be4[_0x3ce61b[_0x19a282][_0x75c5('0x7f')]],'%s',_0x250d08):_0x250d08;if(_0x3ce61b[_0x19a282][_0x75c5('0x77')]){_0x1a2662['group'](_0x250d08);}_0x3ce61b[_0x19a282]['orderBy']&&_0x1a2662['order'](_0x250d08,_0x3ce61b[_0x19a282][_0x75c5('0x78')]===_0x75c5('0x79')?![]:!![]);_0x1a2662['field'](_0x250d08,_0x3ce61b[_0x19a282][_0x75c5('0x7a')]||_0x250d08);}if(_0xe8dc14['joins']){_0xe8dc14[_0x75c5('0x7b')]=JSON['parse'](_0xe8dc14[_0x75c5('0x7b')]);for(var _0x3fe894=0x0;_0x3fe894<_0xe8dc14['joins'][_0x75c5('0x3a')];_0x3fe894+=0x1){if(_0xe8dc14['joins'][_0x3fe894][_0x75c5('0x32')]&&_[_0x75c5('0x63')](_0x1ab574,_0xe8dc14[_0x75c5('0x7b')][_0x3fe894][_0x75c5('0x32')])&&_0xe8dc14[_0x75c5('0x7b')][_0x3fe894][_0x75c5('0x7d')]&&_0xe8dc14[_0x75c5('0x7b')][_0x3fe894][_0x75c5('0x7e')]&&_0xe8dc14[_0x75c5('0x7b')][_0x3fe894][_0x75c5('0x81')]){_0x1a2662[_0xe8dc14[_0x75c5('0x7b')][_0x3fe894][_0x75c5('0x32')]](_0xe8dc14['joins'][_0x3fe894][_0x75c5('0x7e')],null,util[_0x75c5('0x7f')](_0x75c5('0x80'),_0xe8dc14[_0x75c5('0x72')],_0xe8dc14[_0x75c5('0x7b')][_0x3fe894][_0x75c5('0x7d')],_0xe8dc14[_0x75c5('0x7b')][_0x3fe894][_0x75c5('0x7e')],_0xe8dc14[_0x75c5('0x7b')][_0x3fe894]['foreignKey']));}}}if(_0xe8dc14[_0x75c5('0x82')]){_0xe8dc14[_0x75c5('0x82')]=JSON[_0x75c5('0x7c')](_0xe8dc14[_0x75c5('0x82')]);_0x1a2662[_0x75c5('0x3f')](_0x4c378d(_0xe8dc14['conditions'][_0x75c5('0x68')]));}_0x25245a=_0x1a2662[_0x75c5('0x83')]();_0x1a2662[_0x75c5('0x1c')](_0x488e67);_0x1a2662[_0x75c5('0x1f')](0x0);return;}})['then'](function(){if(_0x380182['output']===_0x75c5('0x91')){return null;}var _0x4bfa96=_['merge'](_0x380182,{'name':_0x380182[_0x75c5('0x92')]||_0x380182[_0x75c5('0x2c')]||_0xe8dc14['name'],'basename':_0x5181f0,'savename':util[_0x75c5('0x7f')](_0x75c5('0x93'),_0x380182[_0x75c5('0x2c')]||_0xe8dc14['name'],require(_0x75c5('0x94'))[_0x75c5('0x95')](0x4),_0x380182[_0x75c5('0x96')]||_0x75c5('0x97')),'reportId':_0xe8dc14['id'],'reportType':_0x75c5('0x98')});return db[_0x75c5('0x99')][_0x75c5('0x4c')](_0x4bfa96,{'raw':!![]});})[_0x75c5('0x29')](function(_0x10f22b){if(_0xe8dc14[_0x75c5('0x72')]===_0x75c5('0x9a')){_0x25245a['where'](_0xe8dc14[_0x75c5('0x72')]+_0x75c5('0x9b'),_0x380182[_0x75c5('0x9c')],_0x380182[_0x75c5('0x9d')]);}else{_0x25245a[_0x75c5('0x3f')](_0xe8dc14['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x380182['startDate'],_0x380182['endDate']);}if(_0x10f22b){logger[_0x75c5('0x9e')]('Run\x20Query:',_0x25245a['toString']());require(_0x75c5('0x9f'))['fork'](path[_0x75c5('0x56')](__dirname,_0x75c5('0xa0'),_0x10f22b['output']),[_0x10f22b['id'],_0x25245a[_0x75c5('0x87')](),path[_0x75c5('0x56')](__dirname,_0x75c5('0xa1'),_0x10f22b[_0x75c5('0xa2')]),_0x5181f0]);return _0x10f22b;}else{var _0x4e06c8=squel[_0x75c5('0x71')]();_0x4e06c8[_0x75c5('0x90')]('('+_0x25245a['toString']()+')',_0x75c5('0xa3'));_0x4e06c8[_0x75c5('0x69')](_0x75c5('0xa4'),_0x75c5('0x1e'));_0x25245a[_0x75c5('0x1c')](_0x380182['limit']||_0x488e67);_0x25245a[_0x75c5('0x1f')](_0x380182['offset']||0x0);return dbH[_0x75c5('0x86')]['query'](_0x4e06c8[_0x75c5('0x87')](),{'type':dbH['sequelize'][_0x75c5('0x88')]['SELECT']})[_0x75c5('0x29')](function(_0x3fde54){if(!_0x3fde54[_0x75c5('0x3a')]){_0x4557c8=0x0;}else{_0x4557c8=_0x3fde54[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x25245a['toString'](),{'type':dbH[_0x75c5('0x86')][_0x75c5('0x88')][_0x75c5('0xa5')]});})[_0x75c5('0x29')](function(_0x27ea5f){return{'rows':_0x27ea5f||[],'count':_0x4557c8};});}});}exports[_0x75c5('0xa6')]=function(_0x5b08fe,_0x205097){return runReport(_0x5b08fe['params'],_0x5b08fe[_0x75c5('0x35')],_0x5b08fe[_0x75c5('0x44')])[_0x75c5('0x29')](respondWithResult(_0x205097,null))[_0x75c5('0x48')](handleError(_0x205097,null));};exports['runReport']=runReport;exports[_0x75c5('0x35')]=function(_0xf8a985,_0x5cc756){var _0x14697d=0xa;var _0x116f0c=['join','left_join','right_join',_0x75c5('0x59')];var _0x41f126={'SUM':'SUM(%s)','COUNT':_0x75c5('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x75c5('0x8a'),'MIN':_0x75c5('0x8b'),'AVG':_0x75c5('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x75c5('0x5f')};var _0x2ab2a8={'SEC_TO_TIME':_0x75c5('0x8c'),'DATE':_0x75c5('0x60'),'HOUR':_0x75c5('0x8d'),'ROUND':_0x75c5('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1910b9=function(_0x172eb0){return!_['includes']([_0x75c5('0x64'),_0x75c5('0x65'),_0x75c5('0xa7'),_0x75c5('0x66')],_0x172eb0);};var _0x3e8d54=function(_0x242683){if(!_0x242683||!_0x242683[_0x75c5('0x67')][_0x75c5('0x3a')]){return'';}for(var _0xa30da4='(',_0x51718d=0x0;_0x51718d<_0x242683[_0x75c5('0x67')][_0x75c5('0x3a')];_0x51718d+=0x1){_0x51718d>0x0&&(_0xa30da4+='\x20'+_0x242683[_0x75c5('0x8e')]+'\x20');_0xa30da4+=_0x242683[_0x75c5('0x67')][_0x51718d][_0x75c5('0x68')]?_0x3e8d54(_0x242683[_0x75c5('0x67')][_0x51718d][_0x75c5('0x68')]):_0x242683['rules'][_0x51718d][_0x75c5('0x69')]+'\x20'+_0x242683[_0x75c5('0x67')][_0x51718d][_0x75c5('0x6a')]+(_0x1910b9(_0x242683[_0x75c5('0x67')][_0x51718d]['condition'])?'\x20'+_0x242683['rules'][_0x51718d]['value']:'');}return _0xa30da4+')';};var _0x4e53aa={'where':{'id':_0xf8a985['params']['id']}},_0x447008,_0x48ba61,_0x49c9dc,_0x36a907,_0x14847a;_0x4e53aa=_[_0x75c5('0x41')]({},_0x4e53aa,_0xf8a985['options']);return db[_0x75c5('0x2f')][_0x75c5('0x53')](_0x4e53aa)[_0x75c5('0x29')](function(_0x5f0000){if(_0x5f0000){_0x447008=_0x5f0000;return _0x5f0000['getFields']();}return null;})[_0x75c5('0x29')](function(_0x259bd2){if(_0x259bd2){if(!_0x259bd2[_0x75c5('0x3a')]){throw new db['Sequelize'][(_0x75c5('0x6e'))](_0x75c5('0x6f'),0x193);}_0x48ba61=_0x259bd2;return db[_0x75c5('0x8f')][_0x75c5('0x47')]({'raw':!![]});}return null;})[_0x75c5('0x29')](function(_0x81b61f){if(_0x81b61f){_0x49c9dc=_[_0x75c5('0x70')](_0x81b61f,'id');var _0x79e9ad;var _0xf47670=squel['select']();_0xf47670['from'](_0x447008[_0x75c5('0x72')]);for(var _0x3a7f43=0x0;_0x3a7f43<_0x48ba61[_0x75c5('0x3a')];_0x3a7f43+=0x1){_0x79e9ad=_0x48ba61[_0x3a7f43]['MetricId']?_0x49c9dc[_0x48ba61[_0x3a7f43][_0x75c5('0x73')]][_0x75c5('0x74')]:_0x48ba61[_0x3a7f43][_0x75c5('0x69')];_0x79e9ad=_0x48ba61[_0x3a7f43]['function']?_[_0x75c5('0x75')](_0x41f126[_0x48ba61[_0x3a7f43][_0x75c5('0x76')]],'%s',_0x79e9ad):_0x79e9ad;_0x79e9ad=_0x48ba61[_0x3a7f43][_0x75c5('0x7f')]?_['replace'](_0x2ab2a8[_0x48ba61[_0x3a7f43][_0x75c5('0x7f')]],'%s',_0x79e9ad):_0x79e9ad;if(_0x48ba61[_0x3a7f43][_0x75c5('0x77')]){_0xf47670[_0x75c5('0x68')](_0x79e9ad);}_0x48ba61[_0x3a7f43][_0x75c5('0x78')]&&_0xf47670['order'](_0x79e9ad,_0x48ba61[_0x3a7f43]['orderBy']===_0x75c5('0x79')?![]:!![]);_0xf47670['field'](_0x79e9ad,_0x48ba61[_0x3a7f43][_0x75c5('0x7a')]||_0x79e9ad);}if(_0x447008[_0x75c5('0x7b')]){_0x447008[_0x75c5('0x7b')]=JSON[_0x75c5('0x7c')](_0x447008[_0x75c5('0x7b')]);for(var _0x1caa80=0x0;_0x1caa80<_0x447008[_0x75c5('0x7b')][_0x75c5('0x3a')];_0x1caa80+=0x1){if(_0x447008[_0x75c5('0x7b')][_0x1caa80][_0x75c5('0x32')]&&_[_0x75c5('0x63')](_0x116f0c,_0x447008[_0x75c5('0x7b')][_0x1caa80]['type'])&&_0x447008['joins'][_0x1caa80][_0x75c5('0x7d')]&&_0x447008[_0x75c5('0x7b')][_0x1caa80][_0x75c5('0x7e')]&&_0x447008[_0x75c5('0x7b')][_0x1caa80][_0x75c5('0x81')]){_0xf47670[_0x447008[_0x75c5('0x7b')][_0x1caa80]['type']](_0x447008[_0x75c5('0x7b')][_0x1caa80][_0x75c5('0x7e')],null,util[_0x75c5('0x7f')](_0x75c5('0x80'),_0x447008[_0x75c5('0x72')],_0x447008[_0x75c5('0x7b')][_0x1caa80][_0x75c5('0x7d')],_0x447008['joins'][_0x1caa80][_0x75c5('0x7e')],_0x447008[_0x75c5('0x7b')][_0x1caa80][_0x75c5('0x81')]));}}}if(_0x447008[_0x75c5('0x82')]){_0x447008[_0x75c5('0x82')]=JSON['parse'](_0x447008['conditions']);_0xf47670[_0x75c5('0x3f')](_0x3e8d54(_0x447008[_0x75c5('0x82')][_0x75c5('0x68')]));}_0x14847a=_0xf47670['clone']();_0xf47670['limit'](_0x14697d);_0xf47670[_0x75c5('0x1f')](0x0);logger[_0x75c5('0x84')](_0x75c5('0x85'),_0xf47670[_0x75c5('0x87')]());return dbH[_0x75c5('0x86')][_0x75c5('0x35')](_0xf47670[_0x75c5('0x87')](),{'type':dbH[_0x75c5('0x86')][_0x75c5('0x88')][_0x75c5('0xa5')]});}})['then'](function(){return{'sql':_0x14847a[_0x75c5('0x87')]()};})['then'](respondWithResult(_0x5cc756,null))['catch'](handleError(_0x5cc756,null));};
\ No newline at end of file
+var _0x6890=['body','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','MAX(%s)','AVG(%s)','DATE(%s)','IS\x20EMPTY','getFields','from','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','join','../../components/export/','savename','countTable','COUNT(*)','run','clone','SELECT','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','findAll','rows','catch','params','length','include','find','create','user','get','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x5b7ef6,_0x3e5212){var _0x27d038=function(_0x3db34e){while(--_0x3db34e){_0x5b7ef6['push'](_0x5b7ef6['shift']());}};_0x27d038(++_0x3e5212);}(_0x6890,0xf7));var _0x0689=function(_0x3482da,_0x347b50){_0x3482da=_0x3482da-0x0;var _0x27adfe=_0x6890[_0x3482da];return _0x27adfe;};'use strict';var emlformat=require(_0x0689('0x0'));var rimraf=require(_0x0689('0x1'));var zipdir=require(_0x0689('0x2'));var jsonpatch=require(_0x0689('0x3'));var rp=require('request-promise');var moment=require(_0x0689('0x4'));var BPromise=require(_0x0689('0x5'));var Mustache=require(_0x0689('0x6'));var util=require(_0x0689('0x7'));var path=require('path');var sox=require(_0x0689('0x8'));var csv=require(_0x0689('0x9'));var ejs=require(_0x0689('0xa'));var fs=require('fs');var fs_extra=require(_0x0689('0xb'));var _=require(_0x0689('0xc'));var squel=require(_0x0689('0xd'));var crypto=require(_0x0689('0xe'));var jsforce=require(_0x0689('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0689('0x9'));var querystring=require(_0x0689('0x10'));var Papa=require(_0x0689('0x11'));var Redis=require(_0x0689('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0689('0x13'));var as=require(_0x0689('0x14'));var hardwareService=require(_0x0689('0x15'));var logger=require('../../config/logger')(_0x0689('0x16'));var utils=require(_0x0689('0x17'));var config=require(_0x0689('0x18'));var licenseUtil=require(_0x0689('0x19'));var db=require(_0x0689('0x1a'))['db'];var dbH=require(_0x0689('0x1a'))[_0x0689('0x1b')];function respondWithStatusCode(_0x51b527,_0x17bef7){_0x17bef7=_0x17bef7||0xcc;return function(_0x491cbb){if(_0x491cbb){return _0x51b527[_0x0689('0x1c')](_0x17bef7);}return _0x51b527[_0x0689('0x1d')](_0x17bef7)[_0x0689('0x1e')]();};}function respondWithResult(_0x3ffc37,_0x433d17){_0x433d17=_0x433d17||0xc8;return function(_0x49a1d5){if(_0x49a1d5){return _0x3ffc37[_0x0689('0x1d')](_0x433d17)[_0x0689('0x1f')](_0x49a1d5);}};}function respondWithFilteredResult(_0x14eed3,_0x1d1de6){return function(_0x48f2f1){if(_0x48f2f1){var _0x391897=typeof _0x1d1de6[_0x0689('0x20')]===_0x0689('0x21')&&typeof _0x1d1de6[_0x0689('0x22')]==='undefined';var _0x25a124=_0x48f2f1['count'];var _0x376b66=_0x391897?0x0:_0x1d1de6[_0x0689('0x20')];var _0x87b6a0=_0x391897?_0x48f2f1[_0x0689('0x23')]:_0x1d1de6[_0x0689('0x20')]+_0x1d1de6['limit'];var _0x258e63;if(_0x87b6a0>=_0x25a124){_0x87b6a0=_0x25a124;_0x258e63=0xc8;}else{_0x258e63=0xce;}_0x14eed3[_0x0689('0x1d')](_0x258e63);return _0x14eed3['set'](_0x0689('0x24'),_0x376b66+'-'+_0x87b6a0+'/'+_0x25a124)[_0x0689('0x1f')](_0x48f2f1);}return null;};}function patchUpdates(_0x2431ab){return function(_0x11b668){try{jsonpatch[_0x0689('0x25')](_0x11b668,_0x2431ab,!![]);}catch(_0x11623d){return BPromise[_0x0689('0x26')](_0x11623d);}return _0x11b668['save']();};}function saveUpdates(_0x414a5f,_0x341978){return function(_0x58846f){if(_0x58846f){return _0x58846f[_0x0689('0x27')](_0x414a5f)['then'](function(_0x25765c){return _0x25765c;});}return null;};}function removeEntity(_0x3926d8,_0x3c648f){return function(_0x73113e){if(_0x73113e){return _0x73113e[_0x0689('0x28')]()[_0x0689('0x29')](function(){var _0x3e5c95=_0x73113e['get']({'plain':!![]});var _0x4bdf11=_0x0689('0x2a');return db[_0x0689('0x2b')][_0x0689('0x28')]({'where':{'type':_0x4bdf11,'resourceId':_0x3e5c95['id']}})[_0x0689('0x29')](function(){return _0x73113e;});})[_0x0689('0x29')](function(){_0x3926d8[_0x0689('0x1d')](0xcc)[_0x0689('0x1e')]();});}};}function handleEntityNotFound(_0x16f459,_0x47c840){return function(_0x34a21f){if(!_0x34a21f){_0x16f459['sendStatus'](0x194);}return _0x34a21f;};}function handleError(_0x5381f7,_0x4acef0){_0x4acef0=_0x4acef0||0x1f4;return function(_0x417b9e){logger[_0x0689('0x2c')](_0x417b9e[_0x0689('0x2d')]);if(_0x417b9e[_0x0689('0x2e')]){delete _0x417b9e[_0x0689('0x2e')];}_0x5381f7[_0x0689('0x1d')](_0x4acef0)[_0x0689('0x2f')](_0x417b9e);};}exports[_0x0689('0x30')]=function(_0x4a7be4,_0x1e2208){var _0x436327={},_0xa8a557={},_0x5a4e0a={'count':0x0,'rows':[]};var _0x3dbe57=_[_0x0689('0x31')](db['AnalyticCustomReport'][_0x0689('0x32')],function(_0x23cca4){return{'name':_0x23cca4[_0x0689('0x33')],'type':_0x23cca4[_0x0689('0x34')][_0x0689('0x35')]};});_0xa8a557[_0x0689('0x36')]=_[_0x0689('0x31')](_0x3dbe57,_0x0689('0x2e'));_0xa8a557[_0x0689('0x37')]=_[_0x0689('0x38')](_0x4a7be4[_0x0689('0x37')]);_0xa8a557['filters']=_[_0x0689('0x39')](_0xa8a557[_0x0689('0x36')],_0xa8a557[_0x0689('0x37')]);_0x436327[_0x0689('0x3a')]=_[_0x0689('0x39')](_0xa8a557[_0x0689('0x36')],qs[_0x0689('0x3b')](_0x4a7be4[_0x0689('0x37')][_0x0689('0x3b')]));_0x436327[_0x0689('0x3a')]=_0x436327[_0x0689('0x3a')]['length']?_0x436327[_0x0689('0x3a')]:_0xa8a557[_0x0689('0x36')];if(!_0x4a7be4['query'][_0x0689('0x3c')](_0x0689('0x3d'))){_0x436327[_0x0689('0x22')]=qs[_0x0689('0x22')](_0x4a7be4[_0x0689('0x37')][_0x0689('0x22')]);_0x436327['offset']=qs[_0x0689('0x20')](_0x4a7be4[_0x0689('0x37')][_0x0689('0x20')]);}_0x436327['order']=qs[_0x0689('0x3e')](_0x4a7be4[_0x0689('0x37')][_0x0689('0x3e')]);_0x436327['where']=qs[_0x0689('0x3f')](_[_0x0689('0x40')](_0x4a7be4[_0x0689('0x37')],_0xa8a557['filters']),_0x3dbe57);if(_0x4a7be4[_0x0689('0x37')][_0x0689('0x41')]){_0x436327[_0x0689('0x42')]=_[_0x0689('0x43')](_0x436327[_0x0689('0x42')],{'$or':_['map'](_0x3dbe57,function(_0x32e27c){if(_0x32e27c[_0x0689('0x34')]!==_0x0689('0x44')){var _0xac3ddb={};_0xac3ddb[_0x32e27c[_0x0689('0x2e')]]={'$like':'%'+_0x4a7be4[_0x0689('0x37')][_0x0689('0x41')]+'%'};return _0xac3ddb;}})});}_0x436327=_[_0x0689('0x43')]({},_0x436327,_0x4a7be4[_0x0689('0x45')]);var _0x6f56b0={'where':_0x436327[_0x0689('0x42')]};return db[_0x0689('0x46')][_0x0689('0x23')](_0x6f56b0)[_0x0689('0x29')](function(_0xd7116d){_0x5a4e0a['count']=_0xd7116d;if(_0x4a7be4['query'][_0x0689('0x47')]){_0x436327['include']=[{'all':!![]}];}return db[_0x0689('0x46')][_0x0689('0x48')](_0x436327);})['then'](function(_0x1ece44){_0x5a4e0a[_0x0689('0x49')]=_0x1ece44;return _0x5a4e0a;})[_0x0689('0x29')](respondWithFilteredResult(_0x1e2208,_0x436327))[_0x0689('0x4a')](handleError(_0x1e2208,null));};exports['show']=function(_0x116897,_0x108267){var _0x4bf869={'raw':![],'where':{'id':_0x116897[_0x0689('0x4b')]['id']}},_0x56990c={};_0x56990c[_0x0689('0x36')]=_[_0x0689('0x38')](db[_0x0689('0x46')]['rawAttributes']);_0x56990c[_0x0689('0x37')]=_[_0x0689('0x38')](_0x116897[_0x0689('0x37')]);_0x56990c[_0x0689('0x3f')]=_['intersection'](_0x56990c[_0x0689('0x36')],_0x56990c['query']);_0x4bf869[_0x0689('0x3a')]=_[_0x0689('0x39')](_0x56990c[_0x0689('0x36')],qs[_0x0689('0x3b')](_0x116897[_0x0689('0x37')][_0x0689('0x3b')]));_0x4bf869['attributes']=_0x4bf869[_0x0689('0x3a')][_0x0689('0x4c')]?_0x4bf869['attributes']:_0x56990c[_0x0689('0x36')];if(_0x116897['query'][_0x0689('0x47')]){_0x4bf869[_0x0689('0x4d')]=[{'all':!![]}];}_0x4bf869=_[_0x0689('0x43')]({},_0x4bf869,_0x116897['options']);return db[_0x0689('0x46')][_0x0689('0x4e')](_0x4bf869)[_0x0689('0x29')](handleEntityNotFound(_0x108267,null))[_0x0689('0x29')](respondWithResult(_0x108267,null))['catch'](handleError(_0x108267,null));};exports[_0x0689('0x4f')]=function(_0x2c36bf,_0x200195){return db[_0x0689('0x46')][_0x0689('0x4f')](_0x2c36bf['body'],{})[_0x0689('0x29')](function(_0x3d2c64){var _0x456f36=_0x2c36bf[_0x0689('0x50')][_0x0689('0x51')]({'plain':!![]});if(!_0x456f36)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x456f36[_0x0689('0x52')]===_0x0689('0x50')){var _0x1808a3=_0x3d2c64[_0x0689('0x51')]({'plain':!![]});var _0x2ee3e5=_0x0689('0x53');return db[_0x0689('0x54')][_0x0689('0x4e')]({'where':{'name':_0x2ee3e5,'userProfileId':_0x456f36[_0x0689('0x55')]},'raw':!![]})[_0x0689('0x29')](function(_0x9155af){if(_0x9155af&&_0x9155af['autoAssociation']===0x0){return db[_0x0689('0x2b')]['create']({'name':_0x1808a3[_0x0689('0x2e')],'resourceId':_0x1808a3['id'],'type':'CustomReports','sectionId':_0x9155af['id']},{})[_0x0689('0x29')](function(){return _0x3d2c64;});}else{return _0x3d2c64;}})['catch'](function(_0x34a7eb){logger['error'](_0x0689('0x56'),_0x34a7eb);throw _0x34a7eb;});}return _0x3d2c64;})[_0x0689('0x29')](respondWithResult(_0x200195,0xc9))[_0x0689('0x4a')](handleError(_0x200195,null));};exports[_0x0689('0x27')]=function(_0x2fb8fa,_0xf666c7){if(_0x2fb8fa[_0x0689('0x57')]['id']){delete _0x2fb8fa['body']['id'];}return db['AnalyticCustomReport'][_0x0689('0x4e')]({'where':{'id':_0x2fb8fa[_0x0689('0x4b')]['id']}})[_0x0689('0x29')](handleEntityNotFound(_0xf666c7,null))[_0x0689('0x29')](saveUpdates(_0x2fb8fa[_0x0689('0x57')],null))[_0x0689('0x29')](respondWithResult(_0xf666c7,null))[_0x0689('0x4a')](handleError(_0xf666c7,null));};exports[_0x0689('0x28')]=function(_0x42543b,_0x3ca834){return db['AnalyticCustomReport'][_0x0689('0x4e')]({'where':{'id':_0x42543b[_0x0689('0x4b')]['id']}})[_0x0689('0x29')](handleEntityNotFound(_0x3ca834,null))['then'](removeEntity(_0x3ca834,null))[_0x0689('0x4a')](handleError(_0x3ca834,null));};exports['preview']=function(_0x8412ed,_0x3caec0){var _0x5a7884=0xa;var _0x196a1d=['join',_0x0689('0x58'),_0x0689('0x59'),_0x0689('0x5a')];var _0xb66604={'SUM':_0x0689('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0689('0x5c'),'MAX':'MAX(%s)','MIN':_0x0689('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0689('0x5e'),'GROUP_CONCAT ASC':_0x0689('0x5f'),'GROUP_CONCAT DESC':_0x0689('0x60')};var _0x4b4723={'SEC_TO_TIME':_0x0689('0x61'),'DATE':'DATE(%s)','HOUR':_0x0689('0x62'),'ROUND':_0x0689('0x63'),'UNIX_TIMESTAMP':_0x0689('0x64')};var _0x3e3f32=function(_0x6a5f5a){return!_[_0x0689('0x65')]([_0x0689('0x66'),_0x0689('0x67'),'IS\x20EMPTY',_0x0689('0x68')],_0x6a5f5a);};var _0x5489eb=function(_0x3db2c1){if(!_0x3db2c1||!_0x3db2c1[_0x0689('0x69')][_0x0689('0x4c')]){return'';}for(var _0x58b3eb='(',_0x90ca1f=0x0;_0x90ca1f<_0x3db2c1['rules']['length'];_0x90ca1f+=0x1){_0x90ca1f>0x0&&(_0x58b3eb+='\x20'+_0x3db2c1[_0x0689('0x6a')]+'\x20');_0x58b3eb+=_0x3db2c1[_0x0689('0x69')][_0x90ca1f][_0x0689('0x6b')]?_0x5489eb(_0x3db2c1['rules'][_0x90ca1f][_0x0689('0x6b')]):_0x3db2c1['rules'][_0x90ca1f][_0x0689('0x6c')]+'\x20'+_0x3db2c1[_0x0689('0x69')][_0x90ca1f][_0x0689('0x6d')]+(_0x3e3f32(_0x3db2c1[_0x0689('0x69')][_0x90ca1f][_0x0689('0x6d')])?'\x20'+_0x3db2c1[_0x0689('0x69')][_0x90ca1f][_0x0689('0x6e')]:'');}return _0x58b3eb+')';};var _0x56cad={'where':{'id':_0x8412ed[_0x0689('0x4b')]['id']}},_0x9bddef,_0x4492e5,_0x58bd66,_0x210fe9,_0x3439a8;_0x56cad=_[_0x0689('0x43')]({},_0x56cad,_0x8412ed['options']);return db[_0x0689('0x46')][_0x0689('0x4e')](_0x56cad)['then'](function(_0xa55db9){if(_0xa55db9){_0x9bddef=_0xa55db9;return _0xa55db9['getFields']();}return null;})['then'](function(_0x4b070b){if(_0x4b070b){if(!_0x4b070b[_0x0689('0x4c')]){throw new db['Sequelize'][(_0x0689('0x6f'))](_0x0689('0x70'),0x193);}_0x4492e5=_0x4b070b;return db[_0x0689('0x71')][_0x0689('0x48')]({'raw':!![]});}return null;})[_0x0689('0x29')](function(_0x3e8a69){if(_0x3e8a69){_0x58bd66=_[_0x0689('0x72')](_0x3e8a69,'id');var _0x2c0694;var _0x93d21e=squel[_0x0689('0x73')]();_0x93d21e['from'](_0x9bddef[_0x0689('0x74')]);for(var _0x23de56=0x0;_0x23de56<_0x4492e5[_0x0689('0x4c')];_0x23de56+=0x1){_0x2c0694=_0x4492e5[_0x23de56]['MetricId']?_0x58bd66[_0x4492e5[_0x23de56][_0x0689('0x75')]][_0x0689('0x76')]:_0x4492e5[_0x23de56][_0x0689('0x6c')];_0x2c0694=_0x4492e5[_0x23de56][_0x0689('0x77')]?_['replace'](_0xb66604[_0x4492e5[_0x23de56]['function']],'%s',_0x2c0694):_0x2c0694;_0x2c0694=_0x4492e5[_0x23de56][_0x0689('0x78')]?_[_0x0689('0x79')](_0x4b4723[_0x4492e5[_0x23de56][_0x0689('0x78')]],'%s',_0x2c0694):_0x2c0694;if(_0x4492e5[_0x23de56][_0x0689('0x7a')]){_0x93d21e['group'](_0x2c0694);}_0x4492e5[_0x23de56][_0x0689('0x7b')]&&_0x93d21e[_0x0689('0x7c')](_0x2c0694,_0x4492e5[_0x23de56][_0x0689('0x7b')]===_0x0689('0x7d')?![]:!![]);_0x93d21e[_0x0689('0x6c')](_0x2c0694,_0x4492e5[_0x23de56][_0x0689('0x7e')]||_0x2c0694);}if(_0x9bddef['joins']){_0x9bddef[_0x0689('0x7f')]=JSON[_0x0689('0x80')](_0x9bddef[_0x0689('0x7f')]);for(var _0x46eff7=0x0;_0x46eff7<_0x9bddef['joins'][_0x0689('0x4c')];_0x46eff7+=0x1){if(_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x34')]&&_[_0x0689('0x65')](_0x196a1d,_0x9bddef['joins'][_0x46eff7][_0x0689('0x34')])&&_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x81')]&&_0x9bddef[_0x0689('0x7f')][_0x46eff7]['foreignTable']&&_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x82')]){_0x93d21e[_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x34')]](_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x83')],null,util[_0x0689('0x78')](_0x0689('0x84'),_0x9bddef[_0x0689('0x74')],_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x81')],_0x9bddef[_0x0689('0x7f')][_0x46eff7][_0x0689('0x83')],_0x9bddef['joins'][_0x46eff7]['foreignKey']));}}}if(_0x9bddef['conditions']){_0x9bddef[_0x0689('0x85')]=JSON[_0x0689('0x80')](_0x9bddef['conditions']);_0x93d21e['where'](_0x5489eb(_0x9bddef[_0x0689('0x85')][_0x0689('0x6b')]));}_0x3439a8=_0x93d21e['clone']();_0x93d21e[_0x0689('0x22')](_0x5a7884);_0x93d21e[_0x0689('0x20')](0x0);logger[_0x0689('0x86')](_0x0689('0x87'),_0x93d21e[_0x0689('0x88')]());return dbH[_0x0689('0x89')][_0x0689('0x37')](_0x93d21e[_0x0689('0x88')](),{'type':dbH['sequelize'][_0x0689('0x8a')]['SELECT']});}})[_0x0689('0x29')](respondWithResult(_0x3caec0,null))[_0x0689('0x4a')](handleError(_0x3caec0,null));};function runReport(_0x2c68d7,_0x39ffcb,_0x30af2c){var _0x1823f5=_0x39ffcb[_0x0689('0x2e')];var _0x369bb3=0xa;var _0x108596=['join',_0x0689('0x58'),'right_join',_0x0689('0x5a')];var _0x1a368e={'SUM':_0x0689('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0689('0x5c'),'MAX':_0x0689('0x8b'),'MIN':_0x0689('0x5d'),'AVG':_0x0689('0x8c'),'GROUP_CONCAT':_0x0689('0x5e'),'GROUP_CONCAT ASC':_0x0689('0x5f'),'GROUP_CONCAT DESC':_0x0689('0x60')};var _0x5d4245={'SEC_TO_TIME':_0x0689('0x61'),'DATE':_0x0689('0x8d'),'HOUR':_0x0689('0x62'),'ROUND':_0x0689('0x63'),'UNIX_TIMESTAMP':_0x0689('0x64')};var _0x230388=function(_0x3fcf08){return!_['includes']([_0x0689('0x66'),_0x0689('0x67'),_0x0689('0x8e'),_0x0689('0x68')],_0x3fcf08);};var _0x1932d9=function(_0x12fb77){if(!_0x12fb77||!_0x12fb77['rules'][_0x0689('0x4c')]){return'';}for(var _0x13995d='(',_0x2d8285=0x0;_0x2d8285<_0x12fb77[_0x0689('0x69')][_0x0689('0x4c')];_0x2d8285+=0x1){_0x2d8285>0x0&&(_0x13995d+='\x20'+_0x12fb77['operator']+'\x20');_0x13995d+=_0x12fb77[_0x0689('0x69')][_0x2d8285]['group']?_0x1932d9(_0x12fb77[_0x0689('0x69')][_0x2d8285][_0x0689('0x6b')]):_0x12fb77[_0x0689('0x69')][_0x2d8285]['field']+'\x20'+_0x12fb77[_0x0689('0x69')][_0x2d8285]['condition']+(_0x230388(_0x12fb77[_0x0689('0x69')][_0x2d8285]['condition'])?'\x20'+_0x12fb77['rules'][_0x2d8285][_0x0689('0x6e')]:'');}return _0x13995d+')';};var _0x55a112={'where':{'id':_0x2c68d7['id']}},_0x5dc22c,_0x4a5f01,_0x180184,_0x2f7678,_0x39ff2f;_0x55a112=_['merge']({},_0x55a112,_0x30af2c);return db[_0x0689('0x46')][_0x0689('0x4e')](_0x55a112)[_0x0689('0x29')](function(_0x4f264a){if(_0x4f264a){_0x5dc22c=_0x4f264a;return _0x4f264a[_0x0689('0x8f')]();}return null;})['then'](function(_0x366c61){if(_0x366c61){if(!_0x366c61[_0x0689('0x4c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0689('0x70'),0x193);}_0x4a5f01=_0x366c61;return db[_0x0689('0x71')][_0x0689('0x48')]({'raw':!![]});}return null;})[_0x0689('0x29')](function(_0x44ea35){if(_0x44ea35){_0x180184=_[_0x0689('0x72')](_0x44ea35,'id');var _0x342404;var _0x6331dc=squel[_0x0689('0x73')]();_0x6331dc[_0x0689('0x90')](_0x5dc22c[_0x0689('0x74')]);for(var _0x10d9a6=0x0;_0x10d9a6<_0x4a5f01[_0x0689('0x4c')];_0x10d9a6+=0x1){_0x342404=_0x4a5f01[_0x10d9a6][_0x0689('0x75')]?_0x180184[_0x4a5f01[_0x10d9a6][_0x0689('0x75')]][_0x0689('0x76')]:_0x4a5f01[_0x10d9a6][_0x0689('0x6c')];_0x342404=_0x4a5f01[_0x10d9a6][_0x0689('0x77')]?_[_0x0689('0x79')](_0x1a368e[_0x4a5f01[_0x10d9a6]['function']],'%s',_0x342404):_0x342404;_0x342404=_0x4a5f01[_0x10d9a6][_0x0689('0x78')]?_['replace'](_0x5d4245[_0x4a5f01[_0x10d9a6][_0x0689('0x78')]],'%s',_0x342404):_0x342404;if(_0x4a5f01[_0x10d9a6][_0x0689('0x7a')]){_0x6331dc[_0x0689('0x6b')](_0x342404);}_0x4a5f01[_0x10d9a6][_0x0689('0x7b')]&&_0x6331dc[_0x0689('0x7c')](_0x342404,_0x4a5f01[_0x10d9a6][_0x0689('0x7b')]===_0x0689('0x7d')?![]:!![]);_0x6331dc[_0x0689('0x6c')](_0x342404,_0x4a5f01[_0x10d9a6][_0x0689('0x7e')]||_0x342404);}if(_0x5dc22c[_0x0689('0x7f')]){_0x5dc22c[_0x0689('0x7f')]=JSON['parse'](_0x5dc22c[_0x0689('0x7f')]);for(var _0x4c77fd=0x0;_0x4c77fd<_0x5dc22c['joins'][_0x0689('0x4c')];_0x4c77fd+=0x1){if(_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x34')]&&_['includes'](_0x108596,_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x34')])&&_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x81')]&&_0x5dc22c[_0x0689('0x7f')][_0x4c77fd]['foreignTable']&&_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x82')]){_0x6331dc[_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x34')]](_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x83')],null,util[_0x0689('0x78')](_0x0689('0x84'),_0x5dc22c[_0x0689('0x74')],_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x81')],_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x83')],_0x5dc22c[_0x0689('0x7f')][_0x4c77fd][_0x0689('0x82')]));}}}if(_0x5dc22c[_0x0689('0x85')]){_0x5dc22c['conditions']=JSON[_0x0689('0x80')](_0x5dc22c[_0x0689('0x85')]);_0x6331dc[_0x0689('0x42')](_0x1932d9(_0x5dc22c['conditions']['group']));}_0x39ff2f=_0x6331dc['clone']();_0x6331dc[_0x0689('0x22')](_0x369bb3);_0x6331dc[_0x0689('0x20')](0x0);return;}})[_0x0689('0x29')](function(){if(_0x39ffcb[_0x0689('0x91')]===_0x0689('0x92')){return null;}var _0x5f4fc0=_['merge'](_0x39ffcb,{'name':_0x39ffcb[_0x0689('0x93')]||_0x39ffcb[_0x0689('0x2e')]||_0x5dc22c[_0x0689('0x2e')],'basename':_0x1823f5,'savename':util[_0x0689('0x78')](_0x0689('0x94'),_0x39ffcb['name']||_0x5dc22c[_0x0689('0x2e')],require(_0x0689('0x95'))[_0x0689('0x96')](0x4),_0x39ffcb['output']||'csv'),'reportId':_0x5dc22c['id'],'reportType':_0x0689('0x97')});return db[_0x0689('0x98')][_0x0689('0x4f')](_0x5f4fc0,{'raw':!![]});})[_0x0689('0x29')](function(_0x4f20fe){if(_0x5dc22c[_0x0689('0x74')]==='cdr'){_0x39ff2f[_0x0689('0x42')](_0x5dc22c[_0x0689('0x74')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x39ffcb[_0x0689('0x99')],_0x39ffcb[_0x0689('0x9a')]);}else{_0x39ff2f[_0x0689('0x42')](_0x5dc22c[_0x0689('0x74')]+_0x0689('0x9b'),_0x39ffcb[_0x0689('0x99')],_0x39ffcb[_0x0689('0x9a')]);}if(_0x4f20fe){logger[_0x0689('0x9c')](_0x0689('0x9d'),_0x39ff2f[_0x0689('0x88')]());require(_0x0689('0x9e'))['fork'](path[_0x0689('0x9f')](__dirname,_0x0689('0xa0'),_0x4f20fe['output']),[_0x4f20fe['id'],_0x39ff2f[_0x0689('0x88')](),path[_0x0689('0x9f')](__dirname,'../../files/reports',_0x4f20fe[_0x0689('0xa1')]),_0x1823f5]);return _0x4f20fe;}else{var _0x4d3847=squel['select']();_0x4d3847[_0x0689('0x90')]('('+_0x39ff2f['toString']()+')',_0x0689('0xa2'));_0x4d3847['field'](_0x0689('0xa3'),'count');_0x39ff2f['limit'](_0x39ffcb['limit']||_0x369bb3);_0x39ff2f[_0x0689('0x20')](_0x39ffcb['offset']||0x0);return dbH[_0x0689('0x89')][_0x0689('0x37')](_0x4d3847[_0x0689('0x88')](),{'type':dbH[_0x0689('0x89')][_0x0689('0x8a')]['SELECT']})['then'](function(_0x2c263b){if(!_0x2c263b[_0x0689('0x4c')]){_0x2f7678=0x0;}else{_0x2f7678=_0x2c263b[0x0][_0x0689('0x23')]||0x0;}return dbH[_0x0689('0x89')]['query'](_0x39ff2f['toString'](),{'type':dbH['sequelize'][_0x0689('0x8a')]['SELECT']});})[_0x0689('0x29')](function(_0x5914dc){return{'rows':_0x5914dc||[],'count':_0x2f7678};});}});}exports[_0x0689('0xa4')]=function(_0x1c17a5,_0x57009f){return runReport(_0x1c17a5['params'],_0x1c17a5[_0x0689('0x37')],_0x1c17a5[_0x0689('0x45')])[_0x0689('0x29')](respondWithResult(_0x57009f,null))[_0x0689('0x4a')](handleError(_0x57009f,null));};exports['runReport']=runReport;exports[_0x0689('0x37')]=function(_0x3d3333,_0x4dd34){var _0x459b51=0xa;var _0x505499=[_0x0689('0x9f'),_0x0689('0x58'),'right_join',_0x0689('0x5a')];var _0x203e84={'SUM':_0x0689('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0689('0x5c'),'MAX':_0x0689('0x8b'),'MIN':_0x0689('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0689('0x5e'),'GROUP_CONCAT ASC':_0x0689('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xef506b={'SEC_TO_TIME':_0x0689('0x61'),'DATE':_0x0689('0x8d'),'HOUR':_0x0689('0x62'),'ROUND':_0x0689('0x63'),'UNIX_TIMESTAMP':_0x0689('0x64')};var _0x12d0a6=function(_0x44e7d0){return!_['includes']([_0x0689('0x66'),_0x0689('0x67'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x44e7d0);};var _0x4702b8=function(_0x333441){if(!_0x333441||!_0x333441[_0x0689('0x69')][_0x0689('0x4c')]){return'';}for(var _0x5d7128='(',_0x29c2ac=0x0;_0x29c2ac<_0x333441[_0x0689('0x69')][_0x0689('0x4c')];_0x29c2ac+=0x1){_0x29c2ac>0x0&&(_0x5d7128+='\x20'+_0x333441[_0x0689('0x6a')]+'\x20');_0x5d7128+=_0x333441['rules'][_0x29c2ac][_0x0689('0x6b')]?_0x4702b8(_0x333441[_0x0689('0x69')][_0x29c2ac][_0x0689('0x6b')]):_0x333441[_0x0689('0x69')][_0x29c2ac][_0x0689('0x6c')]+'\x20'+_0x333441[_0x0689('0x69')][_0x29c2ac][_0x0689('0x6d')]+(_0x12d0a6(_0x333441[_0x0689('0x69')][_0x29c2ac][_0x0689('0x6d')])?'\x20'+_0x333441[_0x0689('0x69')][_0x29c2ac]['value']:'');}return _0x5d7128+')';};var _0x47d1c6={'where':{'id':_0x3d3333[_0x0689('0x4b')]['id']}},_0x5d70b8,_0x290f1a,_0xda2413,_0x86943a,_0x2619e2;_0x47d1c6=_['merge']({},_0x47d1c6,_0x3d3333[_0x0689('0x45')]);return db[_0x0689('0x46')]['find'](_0x47d1c6)[_0x0689('0x29')](function(_0x57b80f){if(_0x57b80f){_0x5d70b8=_0x57b80f;return _0x57b80f['getFields']();}return null;})[_0x0689('0x29')](function(_0x1a8e34){if(_0x1a8e34){if(!_0x1a8e34[_0x0689('0x4c')]){throw new db['Sequelize'][(_0x0689('0x6f'))](_0x0689('0x70'),0x193);}_0x290f1a=_0x1a8e34;return db[_0x0689('0x71')][_0x0689('0x48')]({'raw':!![]});}return null;})[_0x0689('0x29')](function(_0x3fd0fe){if(_0x3fd0fe){_0xda2413=_[_0x0689('0x72')](_0x3fd0fe,'id');var _0x1121fb;var _0xbebfe5=squel[_0x0689('0x73')]();_0xbebfe5[_0x0689('0x90')](_0x5d70b8[_0x0689('0x74')]);for(var _0x13f589=0x0;_0x13f589<_0x290f1a['length'];_0x13f589+=0x1){_0x1121fb=_0x290f1a[_0x13f589][_0x0689('0x75')]?_0xda2413[_0x290f1a[_0x13f589]['MetricId']][_0x0689('0x76')]:_0x290f1a[_0x13f589][_0x0689('0x6c')];_0x1121fb=_0x290f1a[_0x13f589]['function']?_[_0x0689('0x79')](_0x203e84[_0x290f1a[_0x13f589][_0x0689('0x77')]],'%s',_0x1121fb):_0x1121fb;_0x1121fb=_0x290f1a[_0x13f589][_0x0689('0x78')]?_[_0x0689('0x79')](_0xef506b[_0x290f1a[_0x13f589]['format']],'%s',_0x1121fb):_0x1121fb;if(_0x290f1a[_0x13f589]['groupBy']){_0xbebfe5['group'](_0x1121fb);}_0x290f1a[_0x13f589][_0x0689('0x7b')]&&_0xbebfe5[_0x0689('0x7c')](_0x1121fb,_0x290f1a[_0x13f589][_0x0689('0x7b')]===_0x0689('0x7d')?![]:!![]);_0xbebfe5[_0x0689('0x6c')](_0x1121fb,_0x290f1a[_0x13f589][_0x0689('0x7e')]||_0x1121fb);}if(_0x5d70b8[_0x0689('0x7f')]){_0x5d70b8[_0x0689('0x7f')]=JSON[_0x0689('0x80')](_0x5d70b8[_0x0689('0x7f')]);for(var _0x1e95cb=0x0;_0x1e95cb<_0x5d70b8[_0x0689('0x7f')]['length'];_0x1e95cb+=0x1){if(_0x5d70b8['joins'][_0x1e95cb][_0x0689('0x34')]&&_[_0x0689('0x65')](_0x505499,_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x34')])&&_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x81')]&&_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x83')]&&_0x5d70b8[_0x0689('0x7f')][_0x1e95cb]['foreignKey']){_0xbebfe5[_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x34')]](_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x83')],null,util[_0x0689('0x78')](_0x0689('0x84'),_0x5d70b8[_0x0689('0x74')],_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x81')],_0x5d70b8[_0x0689('0x7f')][_0x1e95cb][_0x0689('0x83')],_0x5d70b8['joins'][_0x1e95cb][_0x0689('0x82')]));}}}if(_0x5d70b8[_0x0689('0x85')]){_0x5d70b8[_0x0689('0x85')]=JSON[_0x0689('0x80')](_0x5d70b8[_0x0689('0x85')]);_0xbebfe5['where'](_0x4702b8(_0x5d70b8[_0x0689('0x85')][_0x0689('0x6b')]));}_0x2619e2=_0xbebfe5[_0x0689('0xa5')]();_0xbebfe5[_0x0689('0x22')](_0x459b51);_0xbebfe5['offset'](0x0);logger['debug'](_0x0689('0x87'),_0xbebfe5[_0x0689('0x88')]());return dbH[_0x0689('0x89')][_0x0689('0x37')](_0xbebfe5[_0x0689('0x88')](),{'type':dbH[_0x0689('0x89')][_0x0689('0x8a')][_0x0689('0xa6')]});}})[_0x0689('0x29')](function(){return{'sql':_0x2619e2['toString']()};})['then'](respondWithResult(_0x4dd34,null))[_0x0689('0x4a')](handleError(_0x4dd34,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5244a8e..f41ab07 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 _0x6856=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6856,0x1cb));var _0x6685=function(_0x14e486,_0x1d52ec){_0x14e486=_0x14e486-0x0;var _0x36a23f=_0x6856[_0x14e486];return _0x36a23f;};'use strict';var _=require(_0x6685('0x0'));var util=require(_0x6685('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6685('0x2'));var BPromise=require('bluebird');var rp=require(_0x6685('0x3'));var fs=require('fs');var path=require(_0x6685('0x4'));var rimraf=require(_0x6685('0x5'));var config=require(_0x6685('0x6'));var attributes=require(_0x6685('0x7'));module[_0x6685('0x8')]=function(_0x1a6108,_0x4f073e){return _0x1a6108[_0x6685('0x9')](_0x6685('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa72b=['request-promise','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment'];(function(_0x40030f,_0x97cd95){var _0x31d4c5=function(_0xe9eef1){while(--_0xe9eef1){_0x40030f['push'](_0x40030f['shift']());}};_0x31d4c5(++_0x97cd95);}(_0xa72b,0xce));var _0xba72=function(_0x1f5763,_0x3ed2c8){_0x1f5763=_0x1f5763-0x0;var _0x221aa4=_0xa72b[_0x1f5763];return _0x221aa4;};'use strict';var _=require(_0xba72('0x0'));var util=require(_0xba72('0x1'));var logger=require('../../config/logger')(_0xba72('0x2'));var moment=require(_0xba72('0x3'));var BPromise=require('bluebird');var rp=require(_0xba72('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba72('0x5'));var attributes=require(_0xba72('0x6'));module['exports']=function(_0x179bf3,_0x342769){return _0x179bf3[_0xba72('0x7')](_0xba72('0x8'),attributes,{'tableName':_0xba72('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index cff7876..3f55c0a 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 _0x368b=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x59b83a,_0x3af449){var _0x4eeefc=function(_0x52efb0){while(--_0x52efb0){_0x59b83a['push'](_0x59b83a['shift']());}};_0x4eeefc(++_0x3af449);}(_0x368b,0x1dd));var _0xb368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb368('0x0'));var util=require(_0xb368('0x1'));var moment=require(_0xb368('0x2'));var BPromise=require(_0xb368('0x3'));var rs=require(_0xb368('0x4'));var fs=require('fs');var Redis=require(_0xb368('0x5'));var db=require(_0xb368('0x6'))['db'];var utils=require(_0xb368('0x7'));var logger=require(_0xb368('0x8'))(_0xb368('0x9'));var config=require('../../config/environment');var jayson=require(_0xb368('0xa'));var client=jayson[_0xb368('0xb')][_0xb368('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e87f3,_0x3a2f33,_0xd0ec98){return new BPromise(function(_0x5c375e,_0x278c82){return client[_0xb368('0xd')](_0x5e87f3,_0xd0ec98)[_0xb368('0xe')](function(_0x30ef5f){logger[_0xb368('0xf')](_0xb368('0x10'),_0x3a2f33,_0xb368('0x11'));logger[_0xb368('0x12')](_0xb368('0x13'),_0x3a2f33,_0xb368('0x11'),JSON[_0xb368('0x14')](_0x30ef5f));if(_0x30ef5f[_0xb368('0x15')]){if(_0x30ef5f['error'][_0xb368('0x16')]===0x1f4){logger[_0xb368('0x15')](_0xb368('0x10'),_0x3a2f33,_0x30ef5f[_0xb368('0x15')][_0xb368('0x17')]);return _0x278c82(_0x30ef5f[_0xb368('0x15')][_0xb368('0x17')]);}logger[_0xb368('0x15')](_0xb368('0x10'),_0x3a2f33,_0x30ef5f[_0xb368('0x15')][_0xb368('0x17')]);return _0x5c375e(_0x30ef5f['error'][_0xb368('0x17')]);}else{logger[_0xb368('0xf')](_0xb368('0x10'),_0x3a2f33,'request\x20sent');_0x5c375e(_0x30ef5f['result'][_0xb368('0x17')]);}})[_0xb368('0x18')](function(_0xd48825){logger['error'](_0xb368('0x10'),_0x3a2f33,_0xd48825);_0x278c82(_0xd48825);});});}
\ No newline at end of file
+var _0x5add=['../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4f5b11,_0x41741e){var _0x2ec258=function(_0x523247){while(--_0x523247){_0x4f5b11['push'](_0x4f5b11['shift']());}};_0x2ec258(++_0x41741e);}(_0x5add,0x1e8));var _0xd5ad=function(_0x634b8e,_0x4840e9){_0x634b8e=_0x634b8e-0x0;var _0x35f155=_0x5add[_0x634b8e];return _0x35f155;};'use strict';var _=require(_0xd5ad('0x0'));var util=require('util');var moment=require(_0xd5ad('0x1'));var BPromise=require(_0xd5ad('0x2'));var rs=require(_0xd5ad('0x3'));var fs=require('fs');var Redis=require(_0xd5ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5ad('0x5'));var logger=require(_0xd5ad('0x6'))(_0xd5ad('0x7'));var config=require('../../config/environment');var jayson=require(_0xd5ad('0x8'));var client=jayson[_0xd5ad('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38f717,_0x5c33c8,_0x171f16){return new BPromise(function(_0xf3796d,_0x4903a8){return client[_0xd5ad('0xa')](_0x38f717,_0x171f16)[_0xd5ad('0xb')](function(_0x2eb269){logger[_0xd5ad('0xc')](_0xd5ad('0xd'),_0x5c33c8,_0xd5ad('0xe'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5c33c8,_0xd5ad('0xe'),JSON[_0xd5ad('0xf')](_0x2eb269));if(_0x2eb269[_0xd5ad('0x10')]){if(_0x2eb269[_0xd5ad('0x10')][_0xd5ad('0x11')]===0x1f4){logger[_0xd5ad('0x10')](_0xd5ad('0xd'),_0x5c33c8,_0x2eb269['error']['message']);return _0x4903a8(_0x2eb269[_0xd5ad('0x10')][_0xd5ad('0x12')]);}logger[_0xd5ad('0x10')](_0xd5ad('0xd'),_0x5c33c8,_0x2eb269[_0xd5ad('0x10')][_0xd5ad('0x12')]);return _0xf3796d(_0x2eb269[_0xd5ad('0x10')][_0xd5ad('0x12')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x5c33c8,_0xd5ad('0xe'));_0xf3796d(_0x2eb269['result'][_0xd5ad('0x12')]);}})['catch'](function(_0x2ca78d){logger[_0xd5ad('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5c33c8,_0x2ca78d);_0x4903a8(_0x2ca78d);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 2423b24..eeabd2d 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 _0x380c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','destroy'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0x380c,0x91));var _0xc380=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x380c[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xc380('0x0'));var util=require(_0xc380('0x1'));var path=require(_0xc380('0x2'));var timeout=require(_0xc380('0x3'));var express=require(_0xc380('0x4'));var router=express['Router']();var fs_extra=require(_0xc380('0x5'));var auth=require(_0xc380('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc380('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xc380('0x8')]('/',auth[_0xc380('0x9')](),controller[_0xc380('0xa')]);router[_0xc380('0x8')](_0xc380('0xb'),auth[_0xc380('0x9')](),controller[_0xc380('0xc')]);router['get'](_0xc380('0xd'),auth['isAuthenticated'](),controller[_0xc380('0xe')]);router[_0xc380('0x8')](_0xc380('0xf'),auth['isAuthenticated'](),controller[_0xc380('0x10')]);router[_0xc380('0x8')](_0xc380('0x11'),auth[_0xc380('0x9')](),controller[_0xc380('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc380('0x13')]);router[_0xc380('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc380('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc380('0x16')]);module[_0xc380('0x17')]=router;
\ No newline at end of file
+var _0xa092=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','delete','destroy'];(function(_0x1cb0dc,_0x264c1d){var _0x42db69=function(_0x503cf7){while(--_0x503cf7){_0x1cb0dc['push'](_0x1cb0dc['shift']());}};_0x42db69(++_0x264c1d);}(_0xa092,0x79));var _0x2a09=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0xa092[_0x1b1365];return _0x5edfd8;};'use strict';var multer=require('multer');var util=require(_0x2a09('0x0'));var path=require(_0x2a09('0x1'));var timeout=require(_0x2a09('0x2'));var express=require(_0x2a09('0x3'));var router=express[_0x2a09('0x4')]();var fs_extra=require(_0x2a09('0x5'));var auth=require(_0x2a09('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a09('0x7'));var controller=require(_0x2a09('0x8'));router[_0x2a09('0x9')]('/',auth[_0x2a09('0xa')](),controller[_0x2a09('0xb')]);router[_0x2a09('0x9')](_0x2a09('0xc'),auth[_0x2a09('0xa')](),controller[_0x2a09('0xd')]);router[_0x2a09('0x9')](_0x2a09('0xe'),auth[_0x2a09('0xa')](),controller[_0x2a09('0xf')]);router[_0x2a09('0x9')](_0x2a09('0x10'),auth[_0x2a09('0xa')](),controller[_0x2a09('0x11')]);router[_0x2a09('0x9')](_0x2a09('0x12'),auth['isAuthenticated'](),controller[_0x2a09('0x13')]);router[_0x2a09('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x2a09('0xc'),auth[_0x2a09('0xa')](),controller['update']);router[_0x2a09('0x15')]('/:id',auth[_0x2a09('0xa')](),controller[_0x2a09('0x16')]);module[_0x2a09('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 44700df..63b5f33 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 _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x5fd1,0x155));var _0x15fd=function(_0x45b7ea,_0x3f5bc7){_0x45b7ea=_0x45b7ea-0x0;var _0x3a8ca3=_0x5fd1[_0x45b7ea];return _0x3a8ca3;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x27999e,_0x1cbbd2){var _0x19498d=function(_0x2bd9ab){while(--_0x2bd9ab){_0x27999e['push'](_0x27999e['shift']());}};_0x19498d(++_0x1cbbd2);}(_0x24ca,0x1bc));var _0xa24c=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x24ca[_0x22431e];return _0xd978e9;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index f36e51e..30db908 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x44335d,_0x22b2d5){var _0x205412=function(_0x26db0f){while(--_0x26db0f){_0x44335d['push'](_0x44335d['shift']());}};_0x205412(++_0x22b2d5);}(_0x1967,0x173));var _0x7196=function(_0x527a1e,_0x1d5b7e){_0x527a1e=_0x527a1e-0x0;var _0x377b45=_0x1967[_0x527a1e];return _0x377b45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x3d7562,_0x36eb1e){var _0x276c53=function(_0x376feb){while(--_0x376feb){_0x3d7562['push'](_0x3d7562['shift']());}};_0x276c53(++_0x36eb1e);}(_0x53ec,0x192));var _0xc53e=function(_0x641f18,_0x2919e8){_0x641f18=_0x641f18-0x0;var _0x16eefe=_0x53ec[_0x641f18];return _0x16eefe;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 54a482b..599306f 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 _0x206b=['request-promise','path','rimraf','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x6fc393,_0x5c5a66){var _0x4c198f=function(_0x4fcd32){while(--_0x4fcd32){_0x6fc393['push'](_0x6fc393['shift']());}};_0x4c198f(++_0x5c5a66);}(_0x206b,0x166));var _0xb206=function(_0x4b19e3,_0x2b63c3){_0x4b19e3=_0x4b19e3-0x0;var _0x2ce22a=_0x206b[_0x4b19e3];return _0x2ce22a;};'use strict';var _=require(_0xb206('0x0'));var util=require(_0xb206('0x1'));var logger=require(_0xb206('0x2'))(_0xb206('0x3'));var moment=require(_0xb206('0x4'));var BPromise=require(_0xb206('0x5'));var rp=require(_0xb206('0x6'));var fs=require('fs');var path=require(_0xb206('0x7'));var rimraf=require(_0xb206('0x8'));var config=require(_0xb206('0x9'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x4ba0a6,_0x17a957){return _0x4ba0a6[_0xb206('0xa')](_0xb206('0xb'),attributes,{'tableName':_0xb206('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14f=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x503641,_0x33a3cf){var _0x17757d=function(_0xc2ba4e){while(--_0xc2ba4e){_0x503641['push'](_0x503641['shift']());}};_0x17757d(++_0x33a3cf);}(_0xe14f,0x160));var _0xfe14=function(_0x517da2,_0x3be777){_0x517da2=_0x517da2-0x0;var _0x2c1acc=_0xe14f[_0x517da2];return _0x2c1acc;};'use strict';var _=require(_0xfe14('0x0'));var util=require(_0xfe14('0x1'));var logger=require(_0xfe14('0x2'))(_0xfe14('0x3'));var moment=require(_0xfe14('0x4'));var BPromise=require('bluebird');var rp=require(_0xfe14('0x5'));var fs=require('fs');var path=require(_0xfe14('0x6'));var rimraf=require('rimraf');var config=require(_0xfe14('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0xca5420,_0x38c228){return _0xca5420[_0xfe14('0x8')](_0xfe14('0x9'),attributes,{'tableName':_0xfe14('0xa'),'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 7117661..65e1463 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 _0xd82d=['randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird'];(function(_0x5b49b5,_0xe5b574){var _0x2c87d1=function(_0x3253a6){while(--_0x3253a6){_0x5b49b5['push'](_0x5b49b5['shift']());}};_0x2c87d1(++_0xe5b574);}(_0xd82d,0x1a0));var _0xdd82=function(_0x49242f,_0x469aa1){_0x49242f=_0x49242f-0x0;var _0x395478=_0xd82d[_0x49242f];return _0x395478;};'use strict';var _=require(_0xdd82('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdd82('0x1'));var rs=require(_0xdd82('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdd82('0x3'))(_0xdd82('0x4'));var config=require(_0xdd82('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xdd82('0x6')][_0xdd82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x350c78,_0x31fefa,_0x140118){return new BPromise(function(_0xa2852f,_0x523d8b){return client[_0xdd82('0x8')](_0x350c78,_0x140118)[_0xdd82('0x9')](function(_0x4e64ef){logger[_0xdd82('0xa')](_0xdd82('0xb'),_0x31fefa,_0xdd82('0xc'));logger['debug'](_0xdd82('0xd'),_0x31fefa,_0xdd82('0xc'),JSON[_0xdd82('0xe')](_0x4e64ef));if(_0x4e64ef[_0xdd82('0xf')]){if(_0x4e64ef[_0xdd82('0xf')]['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x31fefa,_0x4e64ef[_0xdd82('0xf')][_0xdd82('0x10')]);return _0x523d8b(_0x4e64ef[_0xdd82('0xf')]['message']);}logger[_0xdd82('0xf')](_0xdd82('0xb'),_0x31fefa,_0x4e64ef[_0xdd82('0xf')][_0xdd82('0x10')]);return _0xa2852f(_0x4e64ef[_0xdd82('0xf')][_0xdd82('0x10')]);}else{logger[_0xdd82('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x31fefa,_0xdd82('0xc'));_0xa2852f(_0x4e64ef[_0xdd82('0x11')]['message']);}})[_0xdd82('0x12')](function(_0x12226f){logger['error'](_0xdd82('0xb'),_0x31fefa,_0x12226f);_0x523d8b(_0x12226f);});});}
\ No newline at end of file
+var _0x96d7=['http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x355103,_0x4a0357){var _0x85c59f=function(_0x4fa6ec){while(--_0x4fa6ec){_0x355103['push'](_0x355103['shift']());}};_0x85c59f(++_0x4a0357);}(_0x96d7,0x97));var _0x796d=function(_0x46e9f8,_0x890cc9){_0x46e9f8=_0x46e9f8-0x0;var _0x70660b=_0x96d7[_0x46e9f8];return _0x70660b;};'use strict';var _=require(_0x796d('0x0'));var util=require(_0x796d('0x1'));var moment=require('moment');var BPromise=require(_0x796d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x796d('0x3'));var db=require(_0x796d('0x4'))['db'];var utils=require(_0x796d('0x5'));var logger=require(_0x796d('0x6'))(_0x796d('0x7'));var config=require(_0x796d('0x8'));var jayson=require(_0x796d('0x9'));var client=jayson['client'][_0x796d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33ca77,_0x4de054,_0x29d977){return new BPromise(function(_0x39cb8a,_0x176880){return client[_0x796d('0xb')](_0x33ca77,_0x29d977)[_0x796d('0xc')](function(_0x526f87){logger[_0x796d('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4de054,_0x796d('0xe'));logger[_0x796d('0xf')](_0x796d('0x10'),_0x4de054,_0x796d('0xe'),JSON[_0x796d('0x11')](_0x526f87));if(_0x526f87[_0x796d('0x12')]){if(_0x526f87[_0x796d('0x12')][_0x796d('0x13')]===0x1f4){logger[_0x796d('0x12')](_0x796d('0x14'),_0x4de054,_0x526f87[_0x796d('0x12')][_0x796d('0x15')]);return _0x176880(_0x526f87[_0x796d('0x12')]['message']);}logger[_0x796d('0x12')](_0x796d('0x14'),_0x4de054,_0x526f87[_0x796d('0x12')][_0x796d('0x15')]);return _0x39cb8a(_0x526f87[_0x796d('0x12')]['message']);}else{logger[_0x796d('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4de054,_0x796d('0xe'));_0x39cb8a(_0x526f87['result'][_0x796d('0x15')]);}})[_0x796d('0x16')](function(_0xb61624){logger[_0x796d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4de054,_0xb61624);_0x176880(_0xb61624);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 3028edf..4674dc6 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 _0xea7e=['exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','query','post','create','put','delete','destroy'];(function(_0x1e003b,_0x3e4ded){var _0x268789=function(_0x559062){while(--_0x559062){_0x1e003b['push'](_0x1e003b['shift']());}};_0x268789(++_0x3e4ded);}(_0xea7e,0x143));var _0xeea7=function(_0x2c0911,_0x2175a3){_0x2c0911=_0x2c0911-0x0;var _0x23adb2=_0xea7e[_0x2c0911];return _0x23adb2;};'use strict';var multer=require('multer');var util=require(_0xeea7('0x0'));var path=require(_0xeea7('0x1'));var timeout=require('connect-timeout');var express=require(_0xeea7('0x2'));var router=express[_0xeea7('0x3')]();var fs_extra=require(_0xeea7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeea7('0x5'));var config=require(_0xeea7('0x6'));var controller=require(_0xeea7('0x7'));router[_0xeea7('0x8')]('/',auth[_0xeea7('0x9')](),controller[_0xeea7('0xa')]);router[_0xeea7('0x8')](_0xeea7('0xb'),auth[_0xeea7('0x9')](),controller[_0xeea7('0xc')]);router[_0xeea7('0x8')]('/:id/preview',auth[_0xeea7('0x9')](),controller[_0xeea7('0xd')]);router[_0xeea7('0x8')]('/:id/run',auth[_0xeea7('0x9')](),controller[_0xeea7('0xe')]);router['get'](_0xeea7('0xf'),auth[_0xeea7('0x9')](),controller[_0xeea7('0x10')]);router[_0xeea7('0x11')]('/',auth[_0xeea7('0x9')](),controller[_0xeea7('0x12')]);router[_0xeea7('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xeea7('0x14')](_0xeea7('0xb'),auth['isAuthenticated'](),controller[_0xeea7('0x15')]);module[_0xeea7('0x16')]=router;
\ No newline at end of file
+var _0x242e=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','index','get','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','create','put','/:id','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x425a95,_0x2743b6){var _0x270c10=function(_0x5a18ed){while(--_0x5a18ed){_0x425a95['push'](_0x425a95['shift']());}};_0x270c10(++_0x2743b6);}(_0x242e,0x12f));var _0xe242=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x242e[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xe242('0x0'));var util=require('util');var path=require(_0xe242('0x1'));var timeout=require(_0xe242('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe242('0x3'));var auth=require(_0xe242('0x4'));var interaction=require(_0xe242('0x5'));var config=require(_0xe242('0x6'));var controller=require(_0xe242('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe242('0x8')]);router[_0xe242('0x9')]('/:id',auth[_0xe242('0xa')](),controller[_0xe242('0xb')]);router[_0xe242('0x9')](_0xe242('0xc'),auth[_0xe242('0xa')](),controller['preview']);router[_0xe242('0x9')](_0xe242('0xd'),auth[_0xe242('0xa')](),controller[_0xe242('0xe')]);router[_0xe242('0x9')](_0xe242('0xf'),auth[_0xe242('0xa')](),controller[_0xe242('0x10')]);router['post']('/',auth[_0xe242('0xa')](),controller[_0xe242('0x11')]);router[_0xe242('0x12')](_0xe242('0x13'),auth[_0xe242('0xa')](),controller['update']);router[_0xe242('0x14')](_0xe242('0x13'),auth[_0xe242('0xa')](),controller[_0xe242('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index a4d0762..0126f7b 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 _0x0e10=['manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','xlsx','DATE','Loading'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0e10,0x7c));var _0x00e1=function(_0x561070,_0x5ea1ad){_0x561070=_0x561070-0x0;var _0x5a85f0=_0x0e10[_0x561070];return _0x5a85f0;};'use strict';var Sequelize=require(_0x00e1('0x0'));var moment=require(_0x00e1('0x1'));module['exports']={'name':{'type':Sequelize[_0x00e1('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x00e1('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x00e1('0x3')](_0x00e1('0x4'),'pdf',_0x00e1('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x00e1('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x00e1('0x6')]},'endDate':{'type':Sequelize[_0x00e1('0x6')]},'status':{'type':Sequelize[_0x00e1('0x2')],'defaultValue':_0x00e1('0x7')},'type':{'type':Sequelize[_0x00e1('0x3')](_0x00e1('0x8'),_0x00e1('0x9')),'allowNull':![],'defaultValue':_0x00e1('0x8')},'reportId':{'type':Sequelize[_0x00e1('0xa')](0xb)[_0x00e1('0xb')]},'reportType':{'type':Sequelize[_0x00e1('0x2')]}};
\ No newline at end of file
+var _0xe278=['pdf','xlsx','DATE','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0xe278,0x156));var _0x8e27=function(_0x4c4287,_0x3ab735){_0x4c4287=_0x4c4287-0x0;var _0x561a27=_0xe278[_0x4c4287];return _0x561a27;};'use strict';var Sequelize=require(_0x8e27('0x0'));var moment=require(_0x8e27('0x1'));module[_0x8e27('0x2')]={'name':{'type':Sequelize[_0x8e27('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8e27('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8e27('0x4')](_0x8e27('0x5'),_0x8e27('0x6'),_0x8e27('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8e27('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8e27('0x8')]},'endDate':{'type':Sequelize[_0x8e27('0x8')]},'status':{'type':Sequelize[_0x8e27('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x8e27('0x4')](_0x8e27('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x8e27('0x9')},'reportId':{'type':Sequelize[_0x8e27('0xa')](0xb)[_0x8e27('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index da2a24e..f2aecbe 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 _0xea88=['update','then','destroy','get','ExtractedReports','UserProfileResource','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','AnalyticExtractedReport','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','params','basename','savename','output','existsSync','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','sendStatus','download','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set'];(function(_0x305117,_0x289f1a){var _0x184cb7=function(_0x48887c){while(--_0x48887c){_0x305117['push'](_0x305117['shift']());}};_0x184cb7(++_0x289f1a);}(_0xea88,0x14c));var _0x8ea8=function(_0x4e228a,_0x145d30){_0x4e228a=_0x4e228a-0x0;var _0x274e4c=_0xea88[_0x4e228a];return _0x274e4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ea8('0x0'));var zipdir=require(_0x8ea8('0x1'));var jsonpatch=require(_0x8ea8('0x2'));var rp=require(_0x8ea8('0x3'));var moment=require('moment');var BPromise=require(_0x8ea8('0x4'));var Mustache=require(_0x8ea8('0x5'));var util=require(_0x8ea8('0x6'));var path=require('path');var sox=require(_0x8ea8('0x7'));var csv=require(_0x8ea8('0x8'));var ejs=require(_0x8ea8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ea8('0xa'));var squel=require('squel');var crypto=require(_0x8ea8('0xb'));var jsforce=require(_0x8ea8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8ea8('0x8'));var querystring=require(_0x8ea8('0xd'));var Papa=require(_0x8ea8('0xe'));var Redis=require('ioredis');var authService=require(_0x8ea8('0xf'));var qs=require(_0x8ea8('0x10'));var as=require(_0x8ea8('0x11'));var hardwareService=require(_0x8ea8('0x12'));var logger=require(_0x8ea8('0x13'))(_0x8ea8('0x14'));var utils=require(_0x8ea8('0x15'));var config=require(_0x8ea8('0x16'));var licenseUtil=require(_0x8ea8('0x17'));var db=require(_0x8ea8('0x18'))['db'];function respondWithStatusCode(_0x192b50,_0x43b27d){_0x43b27d=_0x43b27d||0xcc;return function(_0x266576){if(_0x266576){return _0x192b50['sendStatus'](_0x43b27d);}return _0x192b50['status'](_0x43b27d)[_0x8ea8('0x19')]();};}function respondWithResult(_0x2b7b53,_0xfa6cb0){_0xfa6cb0=_0xfa6cb0||0xc8;return function(_0x269f23){if(_0x269f23){return _0x2b7b53[_0x8ea8('0x1a')](_0xfa6cb0)[_0x8ea8('0x1b')](_0x269f23);}};}function respondWithFilteredResult(_0xc4544d,_0x3fbeb1){return function(_0x583207){if(_0x583207){var _0x461612=typeof _0x3fbeb1[_0x8ea8('0x1c')]==='undefined'&&typeof _0x3fbeb1[_0x8ea8('0x1d')]==='undefined';var _0x5bfd72=_0x583207['count'];var _0x49a7ec=_0x461612?0x0:_0x3fbeb1[_0x8ea8('0x1c')];var _0x1a7ee5=_0x461612?_0x583207[_0x8ea8('0x1e')]:_0x3fbeb1[_0x8ea8('0x1c')]+_0x3fbeb1[_0x8ea8('0x1d')];var _0x16763c;if(_0x1a7ee5>=_0x5bfd72){_0x1a7ee5=_0x5bfd72;_0x16763c=0xc8;}else{_0x16763c=0xce;}_0xc4544d[_0x8ea8('0x1a')](_0x16763c);return _0xc4544d[_0x8ea8('0x1f')]('Content-Range',_0x49a7ec+'-'+_0x1a7ee5+'/'+_0x5bfd72)['json'](_0x583207);}return null;};}function patchUpdates(_0x101a5f){return function(_0x5c33bb){try{jsonpatch['apply'](_0x5c33bb,_0x101a5f,!![]);}catch(_0x18f989){return BPromise['reject'](_0x18f989);}return _0x5c33bb['save']();};}function saveUpdates(_0x411305,_0x2235be){return function(_0x4df1a2){if(_0x4df1a2){return _0x4df1a2[_0x8ea8('0x20')](_0x411305)[_0x8ea8('0x21')](function(_0x5a18e2){return _0x5a18e2;});}return null;};}function removeEntity(_0x28d88a,_0x5725b4){return function(_0x56a743){if(_0x56a743){return _0x56a743[_0x8ea8('0x22')]()[_0x8ea8('0x21')](function(){var _0x41001d=_0x56a743[_0x8ea8('0x23')]({'plain':!![]});var _0x1f9451=_0x8ea8('0x24');return db[_0x8ea8('0x25')][_0x8ea8('0x22')]({'where':{'type':_0x1f9451,'resourceId':_0x41001d['id']}})['then'](function(){return _0x56a743;});})[_0x8ea8('0x21')](function(){_0x28d88a['status'](0xcc)[_0x8ea8('0x19')]();});}};}function handleEntityNotFound(_0x1ea1e1,_0xdca11b){return function(_0x5a2d8e){if(!_0x5a2d8e){_0x1ea1e1['sendStatus'](0x194);}return _0x5a2d8e;};}function handleError(_0x158708,_0x5c100f){_0x5c100f=_0x5c100f||0x1f4;return function(_0x195509){logger['error'](_0x195509[_0x8ea8('0x26')]);if(_0x195509['name']){delete _0x195509['name'];}_0x158708[_0x8ea8('0x1a')](_0x5c100f)[_0x8ea8('0x27')](_0x195509);};}exports['index']=function(_0x35481b,_0x25aa78){var _0x9fd70a={},_0x1ac2cb={},_0x1375be={'count':0x0,'rows':[]};var _0x258d45=_[_0x8ea8('0x28')](db['AnalyticExtractedReport'][_0x8ea8('0x29')],function(_0x124ac1){return{'name':_0x124ac1[_0x8ea8('0x2a')],'type':_0x124ac1[_0x8ea8('0x2b')][_0x8ea8('0x2c')]};});_0x1ac2cb[_0x8ea8('0x2d')]=_[_0x8ea8('0x28')](_0x258d45,_0x8ea8('0x2e'));_0x1ac2cb['query']=_['keys'](_0x35481b['query']);_0x1ac2cb[_0x8ea8('0x2f')]=_[_0x8ea8('0x30')](_0x1ac2cb['model'],_0x1ac2cb[_0x8ea8('0x31')]);_0x9fd70a['attributes']=_['intersection'](_0x1ac2cb['model'],qs[_0x8ea8('0x32')](_0x35481b[_0x8ea8('0x31')]['fields']));_0x9fd70a[_0x8ea8('0x33')]=_0x9fd70a[_0x8ea8('0x33')][_0x8ea8('0x34')]?_0x9fd70a[_0x8ea8('0x33')]:_0x1ac2cb[_0x8ea8('0x2d')];if(!_0x35481b[_0x8ea8('0x31')][_0x8ea8('0x35')](_0x8ea8('0x36'))){_0x9fd70a['limit']=qs[_0x8ea8('0x1d')](_0x35481b['query'][_0x8ea8('0x1d')]);_0x9fd70a[_0x8ea8('0x1c')]=qs[_0x8ea8('0x1c')](_0x35481b['query']['offset']);}_0x9fd70a[_0x8ea8('0x37')]=qs[_0x8ea8('0x38')](_0x35481b[_0x8ea8('0x31')][_0x8ea8('0x38')]);_0x9fd70a[_0x8ea8('0x39')]=qs[_0x8ea8('0x2f')](_[_0x8ea8('0x3a')](_0x35481b['query'],_0x1ac2cb[_0x8ea8('0x2f')]),_0x258d45);if(_0x35481b[_0x8ea8('0x31')][_0x8ea8('0x3b')]){_0x9fd70a[_0x8ea8('0x39')]=_[_0x8ea8('0x3c')](_0x9fd70a['where'],{'$or':_[_0x8ea8('0x28')](_0x258d45,function(_0x37948c){if(_0x37948c[_0x8ea8('0x2b')]!=='VIRTUAL'){var _0x3012c6={};_0x3012c6[_0x37948c[_0x8ea8('0x2e')]]={'$like':'%'+_0x35481b[_0x8ea8('0x31')][_0x8ea8('0x3b')]+'%'};return _0x3012c6;}})});}_0x9fd70a=_[_0x8ea8('0x3c')]({},_0x9fd70a,_0x35481b[_0x8ea8('0x3d')]);var _0x5e8d15={'where':_0x9fd70a[_0x8ea8('0x39')]};return db['AnalyticExtractedReport']['count'](_0x5e8d15)[_0x8ea8('0x21')](function(_0x104d8a){_0x1375be[_0x8ea8('0x1e')]=_0x104d8a;if(_0x35481b[_0x8ea8('0x31')][_0x8ea8('0x3e')]){_0x9fd70a[_0x8ea8('0x3f')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8ea8('0x40')](_0x9fd70a);})[_0x8ea8('0x21')](function(_0x518ef4){_0x1375be[_0x8ea8('0x41')]=_0x518ef4;return _0x1375be;})['then'](respondWithFilteredResult(_0x25aa78,_0x9fd70a))[_0x8ea8('0x42')](handleError(_0x25aa78,null));};exports[_0x8ea8('0x43')]=function(_0x580f24,_0xc090d3){var _0x3b5f71={'raw':!![],'where':{'id':_0x580f24['params']['id']}},_0x187d1e={};_0x187d1e[_0x8ea8('0x2d')]=_['keys'](db[_0x8ea8('0x44')][_0x8ea8('0x29')]);_0x187d1e[_0x8ea8('0x31')]=_[_0x8ea8('0x45')](_0x580f24[_0x8ea8('0x31')]);_0x187d1e[_0x8ea8('0x2f')]=_[_0x8ea8('0x30')](_0x187d1e[_0x8ea8('0x2d')],_0x187d1e['query']);_0x3b5f71[_0x8ea8('0x33')]=_['intersection'](_0x187d1e['model'],qs['fields'](_0x580f24['query']['fields']));_0x3b5f71[_0x8ea8('0x33')]=_0x3b5f71[_0x8ea8('0x33')]['length']?_0x3b5f71[_0x8ea8('0x33')]:_0x187d1e['model'];if(_0x580f24[_0x8ea8('0x31')][_0x8ea8('0x3e')]){_0x3b5f71[_0x8ea8('0x3f')]=[{'all':!![]}];}_0x3b5f71=_[_0x8ea8('0x3c')]({},_0x3b5f71,_0x580f24[_0x8ea8('0x3d')]);return db[_0x8ea8('0x44')][_0x8ea8('0x46')](_0x3b5f71)['then'](handleEntityNotFound(_0xc090d3,null))[_0x8ea8('0x21')](respondWithResult(_0xc090d3,null))[_0x8ea8('0x42')](handleError(_0xc090d3,null));};exports[_0x8ea8('0x47')]=function(_0xaf85bd,_0x3434b0){return db[_0x8ea8('0x44')]['create'](_0xaf85bd[_0x8ea8('0x48')],{})[_0x8ea8('0x21')](function(_0x1ecabb){var _0x1dd961=_0xaf85bd[_0x8ea8('0x49')][_0x8ea8('0x23')]({'plain':!![]});if(!_0x1dd961)throw new Error(_0x8ea8('0x4a'));if(_0x1dd961[_0x8ea8('0x4b')]===_0x8ea8('0x49')){var _0x3b1a67=_0x1ecabb[_0x8ea8('0x23')]({'plain':!![]});var _0x2003f5=_0x8ea8('0x24');return db[_0x8ea8('0x4c')]['find']({'where':{'name':_0x2003f5,'userProfileId':_0x1dd961[_0x8ea8('0x4d')]},'raw':!![]})['then'](function(_0x239a4e){if(_0x239a4e&&_0x239a4e['autoAssociation']===0x0){return db[_0x8ea8('0x25')]['create']({'name':_0x3b1a67[_0x8ea8('0x2e')],'resourceId':_0x3b1a67['id'],'type':_0x239a4e[_0x8ea8('0x2e')],'sectionId':_0x239a4e['id']},{})[_0x8ea8('0x21')](function(){return _0x1ecabb;});}else{return _0x1ecabb;}})[_0x8ea8('0x42')](function(_0x2f9569){logger[_0x8ea8('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f9569);throw _0x2f9569;});}return _0x1ecabb;})[_0x8ea8('0x21')](respondWithResult(_0x3434b0,0xc9))['catch'](handleError(_0x3434b0,null));};exports[_0x8ea8('0x20')]=function(_0x17a0ac,_0x5aa11b){if(_0x17a0ac['body']['id']){delete _0x17a0ac['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x17a0ac[_0x8ea8('0x4f')]['id']}})[_0x8ea8('0x21')](handleEntityNotFound(_0x5aa11b,null))[_0x8ea8('0x21')](saveUpdates(_0x17a0ac[_0x8ea8('0x48')],null))[_0x8ea8('0x21')](respondWithResult(_0x5aa11b,null))[_0x8ea8('0x42')](handleError(_0x5aa11b,null));};exports[_0x8ea8('0x22')]=function(_0x28400c,_0x500290){return db[_0x8ea8('0x44')]['find']({'where':{'id':_0x28400c['params']['id']}})[_0x8ea8('0x21')](handleEntityNotFound(_0x500290,null))['then'](removeEntity(_0x500290,null))[_0x8ea8('0x42')](handleError(_0x500290,null));};exports['download']=function(_0x266ea7,_0x5e7874,_0x32d161){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x266ea7['params']['id']},'attributes':[_0x8ea8('0x2e'),_0x8ea8('0x50'),_0x8ea8('0x51'),_0x8ea8('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x5e7874,null))[_0x8ea8('0x21')](function(_0x186608){if(_0x186608){if(!fs[_0x8ea8('0x53')](path[_0x8ea8('0x54')](config[_0x8ea8('0x55')],_0x8ea8('0x56'),_0x186608['savename']))){throw new db['Sequelize']['ValidationError'](_0x8ea8('0x57'));}if(_0x266ea7[_0x8ea8('0x31')]['exists']){return _0x5e7874[_0x8ea8('0x58')](0xc8);}return _0x5e7874[_0x8ea8('0x59')](path[_0x8ea8('0x54')](config[_0x8ea8('0x55')],_0x8ea8('0x56'),_0x186608[_0x8ea8('0x51')]),util['format']('%s.%s',_0x186608[_0x8ea8('0x50')]||_0x186608['name'],_0x186608[_0x8ea8('0x52')][_0x8ea8('0x5a')]()));}})[_0x8ea8('0x42')](handleError(_0x5e7874,null));};
\ No newline at end of file
+var _0xb806=['path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','include','findAll','catch','show','params','keys','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x517fa8,_0x3adce0){var _0x5409f4=function(_0x501e80){while(--_0x501e80){_0x517fa8['push'](_0x517fa8['shift']());}};_0x5409f4(++_0x3adce0);}(_0xb806,0x1e7));var _0x6b80=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xb806[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0x6b80('0x0'));var rimraf=require(_0x6b80('0x1'));var zipdir=require(_0x6b80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b80('0x3'));var moment=require(_0x6b80('0x4'));var BPromise=require(_0x6b80('0x5'));var Mustache=require(_0x6b80('0x6'));var util=require(_0x6b80('0x7'));var path=require(_0x6b80('0x8'));var sox=require(_0x6b80('0x9'));var csv=require('to-csv');var ejs=require(_0x6b80('0xa'));var fs=require('fs');var fs_extra=require(_0x6b80('0xb'));var _=require('lodash');var squel=require(_0x6b80('0xc'));var crypto=require(_0x6b80('0xd'));var jsforce=require(_0x6b80('0xe'));var deskjs=require(_0x6b80('0xf'));var toCsv=require(_0x6b80('0x10'));var querystring=require(_0x6b80('0x11'));var Papa=require('papaparse');var Redis=require(_0x6b80('0x12'));var authService=require(_0x6b80('0x13'));var qs=require(_0x6b80('0x14'));var as=require(_0x6b80('0x15'));var hardwareService=require(_0x6b80('0x16'));var logger=require(_0x6b80('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x6b80('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b80('0x19'))['db'];function respondWithStatusCode(_0x5d4acc,_0x24ba8b){_0x24ba8b=_0x24ba8b||0xcc;return function(_0xa2ff66){if(_0xa2ff66){return _0x5d4acc[_0x6b80('0x1a')](_0x24ba8b);}return _0x5d4acc[_0x6b80('0x1b')](_0x24ba8b)[_0x6b80('0x1c')]();};}function respondWithResult(_0x29aa5e,_0x3d0714){_0x3d0714=_0x3d0714||0xc8;return function(_0x2fbc14){if(_0x2fbc14){return _0x29aa5e[_0x6b80('0x1b')](_0x3d0714)[_0x6b80('0x1d')](_0x2fbc14);}};}function respondWithFilteredResult(_0xe7bb1c,_0x2b935f){return function(_0x520a5a){if(_0x520a5a){var _0x100504=typeof _0x2b935f[_0x6b80('0x1e')]===_0x6b80('0x1f')&&typeof _0x2b935f['limit']===_0x6b80('0x1f');var _0x1779ed=_0x520a5a[_0x6b80('0x20')];var _0x2c0bda=_0x100504?0x0:_0x2b935f['offset'];var _0x568fc0=_0x100504?_0x520a5a[_0x6b80('0x20')]:_0x2b935f[_0x6b80('0x1e')]+_0x2b935f[_0x6b80('0x21')];var _0x1b8a80;if(_0x568fc0>=_0x1779ed){_0x568fc0=_0x1779ed;_0x1b8a80=0xc8;}else{_0x1b8a80=0xce;}_0xe7bb1c[_0x6b80('0x1b')](_0x1b8a80);return _0xe7bb1c[_0x6b80('0x22')](_0x6b80('0x23'),_0x2c0bda+'-'+_0x568fc0+'/'+_0x1779ed)[_0x6b80('0x1d')](_0x520a5a);}return null;};}function patchUpdates(_0x326f10){return function(_0x409663){try{jsonpatch[_0x6b80('0x24')](_0x409663,_0x326f10,!![]);}catch(_0x103f62){return BPromise[_0x6b80('0x25')](_0x103f62);}return _0x409663[_0x6b80('0x26')]();};}function saveUpdates(_0x2d0086,_0x4b31a4){return function(_0x12045c){if(_0x12045c){return _0x12045c[_0x6b80('0x27')](_0x2d0086)[_0x6b80('0x28')](function(_0x4eae3a){return _0x4eae3a;});}return null;};}function removeEntity(_0x50637e,_0x46e3a0){return function(_0x47d59e){if(_0x47d59e){return _0x47d59e[_0x6b80('0x29')]()[_0x6b80('0x28')](function(){var _0x21b694=_0x47d59e[_0x6b80('0x2a')]({'plain':!![]});var _0x3f85df=_0x6b80('0x2b');return db[_0x6b80('0x2c')]['destroy']({'where':{'type':_0x3f85df,'resourceId':_0x21b694['id']}})[_0x6b80('0x28')](function(){return _0x47d59e;});})[_0x6b80('0x28')](function(){_0x50637e['status'](0xcc)[_0x6b80('0x1c')]();});}};}function handleEntityNotFound(_0x1e066d,_0x21f2ee){return function(_0x471809){if(!_0x471809){_0x1e066d[_0x6b80('0x1a')](0x194);}return _0x471809;};}function handleError(_0x5aa160,_0x41d737){_0x41d737=_0x41d737||0x1f4;return function(_0x3d6724){logger[_0x6b80('0x2d')](_0x3d6724[_0x6b80('0x2e')]);if(_0x3d6724[_0x6b80('0x2f')]){delete _0x3d6724[_0x6b80('0x2f')];}_0x5aa160[_0x6b80('0x1b')](_0x41d737)[_0x6b80('0x30')](_0x3d6724);};}exports['index']=function(_0x3932c7,_0x2e4859){var _0x4364b5={},_0x2f205b={},_0x4785ed={'count':0x0,'rows':[]};var _0x18143d=_[_0x6b80('0x31')](db['AnalyticExtractedReport'][_0x6b80('0x32')],function(_0x275a6f){return{'name':_0x275a6f[_0x6b80('0x33')],'type':_0x275a6f[_0x6b80('0x34')]['key']};});_0x2f205b['model']=_[_0x6b80('0x31')](_0x18143d,_0x6b80('0x2f'));_0x2f205b[_0x6b80('0x35')]=_['keys'](_0x3932c7[_0x6b80('0x35')]);_0x2f205b[_0x6b80('0x36')]=_[_0x6b80('0x37')](_0x2f205b[_0x6b80('0x38')],_0x2f205b[_0x6b80('0x35')]);_0x4364b5[_0x6b80('0x39')]=_['intersection'](_0x2f205b[_0x6b80('0x38')],qs[_0x6b80('0x3a')](_0x3932c7['query']['fields']));_0x4364b5[_0x6b80('0x39')]=_0x4364b5[_0x6b80('0x39')]['length']?_0x4364b5[_0x6b80('0x39')]:_0x2f205b[_0x6b80('0x38')];if(!_0x3932c7[_0x6b80('0x35')][_0x6b80('0x3b')](_0x6b80('0x3c'))){_0x4364b5[_0x6b80('0x21')]=qs[_0x6b80('0x21')](_0x3932c7[_0x6b80('0x35')]['limit']);_0x4364b5[_0x6b80('0x1e')]=qs[_0x6b80('0x1e')](_0x3932c7[_0x6b80('0x35')][_0x6b80('0x1e')]);}_0x4364b5[_0x6b80('0x3d')]=qs['sort'](_0x3932c7['query'][_0x6b80('0x3e')]);_0x4364b5[_0x6b80('0x3f')]=qs[_0x6b80('0x36')](_[_0x6b80('0x40')](_0x3932c7[_0x6b80('0x35')],_0x2f205b[_0x6b80('0x36')]),_0x18143d);if(_0x3932c7[_0x6b80('0x35')][_0x6b80('0x41')]){_0x4364b5[_0x6b80('0x3f')]=_[_0x6b80('0x42')](_0x4364b5[_0x6b80('0x3f')],{'$or':_['map'](_0x18143d,function(_0x27b768){if(_0x27b768[_0x6b80('0x34')]!==_0x6b80('0x43')){var _0x2d82bb={};_0x2d82bb[_0x27b768[_0x6b80('0x2f')]]={'$like':'%'+_0x3932c7[_0x6b80('0x35')][_0x6b80('0x41')]+'%'};return _0x2d82bb;}})});}_0x4364b5=_[_0x6b80('0x42')]({},_0x4364b5,_0x3932c7[_0x6b80('0x44')]);var _0x631fc0={'where':_0x4364b5['where']};return db[_0x6b80('0x45')][_0x6b80('0x20')](_0x631fc0)[_0x6b80('0x28')](function(_0x1065da){_0x4785ed[_0x6b80('0x20')]=_0x1065da;if(_0x3932c7[_0x6b80('0x35')]['includeAll']){_0x4364b5[_0x6b80('0x46')]=[{'all':!![]}];}return db[_0x6b80('0x45')][_0x6b80('0x47')](_0x4364b5);})[_0x6b80('0x28')](function(_0x435471){_0x4785ed['rows']=_0x435471;return _0x4785ed;})[_0x6b80('0x28')](respondWithFilteredResult(_0x2e4859,_0x4364b5))[_0x6b80('0x48')](handleError(_0x2e4859,null));};exports[_0x6b80('0x49')]=function(_0x58e11f,_0x1e1cb0){var _0x777d11={'raw':!![],'where':{'id':_0x58e11f[_0x6b80('0x4a')]['id']}},_0x47894b={};_0x47894b[_0x6b80('0x38')]=_['keys'](db[_0x6b80('0x45')]['rawAttributes']);_0x47894b['query']=_[_0x6b80('0x4b')](_0x58e11f[_0x6b80('0x35')]);_0x47894b[_0x6b80('0x36')]=_['intersection'](_0x47894b[_0x6b80('0x38')],_0x47894b[_0x6b80('0x35')]);_0x777d11[_0x6b80('0x39')]=_[_0x6b80('0x37')](_0x47894b[_0x6b80('0x38')],qs[_0x6b80('0x3a')](_0x58e11f[_0x6b80('0x35')][_0x6b80('0x3a')]));_0x777d11[_0x6b80('0x39')]=_0x777d11[_0x6b80('0x39')][_0x6b80('0x4c')]?_0x777d11[_0x6b80('0x39')]:_0x47894b['model'];if(_0x58e11f[_0x6b80('0x35')][_0x6b80('0x4d')]){_0x777d11[_0x6b80('0x46')]=[{'all':!![]}];}_0x777d11=_[_0x6b80('0x42')]({},_0x777d11,_0x58e11f[_0x6b80('0x44')]);return db['AnalyticExtractedReport'][_0x6b80('0x4e')](_0x777d11)[_0x6b80('0x28')](handleEntityNotFound(_0x1e1cb0,null))[_0x6b80('0x28')](respondWithResult(_0x1e1cb0,null))[_0x6b80('0x48')](handleError(_0x1e1cb0,null));};exports[_0x6b80('0x4f')]=function(_0x1dba91,_0x1ee506){return db[_0x6b80('0x45')][_0x6b80('0x4f')](_0x1dba91['body'],{})[_0x6b80('0x28')](function(_0x40069b){var _0x12e10c=_0x1dba91[_0x6b80('0x50')][_0x6b80('0x2a')]({'plain':!![]});if(!_0x12e10c)throw new Error(_0x6b80('0x51'));if(_0x12e10c['role']===_0x6b80('0x50')){var _0x5edd98=_0x40069b[_0x6b80('0x2a')]({'plain':!![]});var _0x236c81=_0x6b80('0x2b');return db[_0x6b80('0x52')][_0x6b80('0x4e')]({'where':{'name':_0x236c81,'userProfileId':_0x12e10c[_0x6b80('0x53')]},'raw':!![]})[_0x6b80('0x28')](function(_0x4aa8b1){if(_0x4aa8b1&&_0x4aa8b1[_0x6b80('0x54')]===0x0){return db[_0x6b80('0x2c')][_0x6b80('0x4f')]({'name':_0x5edd98[_0x6b80('0x2f')],'resourceId':_0x5edd98['id'],'type':_0x4aa8b1[_0x6b80('0x2f')],'sectionId':_0x4aa8b1['id']},{})['then'](function(){return _0x40069b;});}else{return _0x40069b;}})['catch'](function(_0x162399){logger['error'](_0x6b80('0x55'),_0x162399);throw _0x162399;});}return _0x40069b;})[_0x6b80('0x28')](respondWithResult(_0x1ee506,0xc9))[_0x6b80('0x48')](handleError(_0x1ee506,null));};exports[_0x6b80('0x27')]=function(_0x55f499,_0x391405){if(_0x55f499[_0x6b80('0x56')]['id']){delete _0x55f499[_0x6b80('0x56')]['id'];}return db[_0x6b80('0x45')]['find']({'where':{'id':_0x55f499[_0x6b80('0x4a')]['id']}})[_0x6b80('0x28')](handleEntityNotFound(_0x391405,null))['then'](saveUpdates(_0x55f499[_0x6b80('0x56')],null))[_0x6b80('0x28')](respondWithResult(_0x391405,null))[_0x6b80('0x48')](handleError(_0x391405,null));};exports['destroy']=function(_0x3f19ea,_0x36ac28){return db[_0x6b80('0x45')][_0x6b80('0x4e')]({'where':{'id':_0x3f19ea[_0x6b80('0x4a')]['id']}})['then'](handleEntityNotFound(_0x36ac28,null))[_0x6b80('0x28')](removeEntity(_0x36ac28,null))[_0x6b80('0x48')](handleError(_0x36ac28,null));};exports['download']=function(_0xa9806b,_0x27ad1d,_0x3b43d8){return db[_0x6b80('0x45')][_0x6b80('0x4e')]({'where':{'id':_0xa9806b[_0x6b80('0x4a')]['id']},'attributes':['name',_0x6b80('0x57'),_0x6b80('0x58'),_0x6b80('0x59')],'raw':!![]})['then'](handleEntityNotFound(_0x27ad1d,null))[_0x6b80('0x28')](function(_0x413c9b){if(_0x413c9b){if(!fs['existsSync'](path[_0x6b80('0x5a')](config[_0x6b80('0x5b')],_0x6b80('0x5c'),_0x413c9b['savename']))){throw new db[(_0x6b80('0x5d'))][(_0x6b80('0x5e'))](_0x6b80('0x5f'));}if(_0xa9806b[_0x6b80('0x35')][_0x6b80('0x60')]){return _0x27ad1d['sendStatus'](0xc8);}return _0x27ad1d['download'](path[_0x6b80('0x5a')](config[_0x6b80('0x5b')],_0x6b80('0x5c'),_0x413c9b['savename']),util['format'](_0x6b80('0x61'),_0x413c9b['basename']||_0x413c9b[_0x6b80('0x2f')],_0x413c9b[_0x6b80('0x59')][_0x6b80('0x62')]()));}})[_0x6b80('0x48')](handleError(_0x27ad1d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b5d3a1f..c680b5f 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 _0x5bac=['define','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0xa29e3f,_0x477875){var _0x588233=function(_0x186ead){while(--_0x186ead){_0xa29e3f['push'](_0xa29e3f['shift']());}};_0x588233(++_0x477875);}(_0x5bac,0x1a7));var _0xc5ba=function(_0x3741a8,_0x5a39b2){_0x3741a8=_0x3741a8-0x0;var _0xd552a4=_0x5bac[_0x3741a8];return _0xd552a4;};'use strict';var _=require('lodash');var util=require(_0xc5ba('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc5ba('0x1'));var BPromise=require(_0xc5ba('0x2'));var rp=require(_0xc5ba('0x3'));var fs=require('fs');var path=require(_0xc5ba('0x4'));var rimraf=require(_0xc5ba('0x5'));var config=require(_0xc5ba('0x6'));var attributes=require(_0xc5ba('0x7'));module[_0xc5ba('0x8')]=function(_0x4b290d,_0x45a251){return _0x4b290d[_0xc5ba('0x9')](_0xc5ba('0xa'),attributes,{'tableName':_0xc5ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb57=['api','moment','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0xcb57,0x148));var _0x7cb5=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xcb57[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x7cb5('0x0'));var util=require('util');var logger=require(_0x7cb5('0x1'))(_0x7cb5('0x2'));var moment=require(_0x7cb5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cb5('0x4'));var rimraf=require(_0x7cb5('0x5'));var config=require('../../config/environment');var attributes=require(_0x7cb5('0x6'));module[_0x7cb5('0x7')]=function(_0x145556,_0x364005){return _0x145556[_0x7cb5('0x8')](_0x7cb5('0x9'),attributes,{'tableName':_0x7cb5('0xa'),'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 ed79588..bd2c982 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 _0x579a=['../../config/utils','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x4ef200,_0x5f0422){var _0x5ac761=function(_0x15488b){while(--_0x15488b){_0x4ef200['push'](_0x4ef200['shift']());}};_0x5ac761(++_0x5f0422);}(_0x579a,0x9d));var _0xa579=function(_0x592188,_0x565c67){_0x592188=_0x592188-0x0;var _0x535ae3=_0x579a[_0x592188];return _0x535ae3;};'use strict';var _=require(_0xa579('0x0'));var util=require(_0xa579('0x1'));var moment=require(_0xa579('0x2'));var BPromise=require(_0xa579('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa579('0x4'))['db'];var utils=require(_0xa579('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa579('0x6'));var client=jayson['client'][_0xa579('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14a544,_0x770152,_0x2aeb20){return new BPromise(function(_0x27e490,_0x4418fd){return client[_0xa579('0x8')](_0x14a544,_0x2aeb20)[_0xa579('0x9')](function(_0x51f0a0){logger[_0xa579('0xa')](_0xa579('0xb'),_0x770152,_0xa579('0xc'));logger[_0xa579('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x770152,_0xa579('0xc'),JSON[_0xa579('0xe')](_0x51f0a0));if(_0x51f0a0[_0xa579('0xf')]){if(_0x51f0a0[_0xa579('0xf')]['code']===0x1f4){logger[_0xa579('0xf')](_0xa579('0xb'),_0x770152,_0x51f0a0[_0xa579('0xf')][_0xa579('0x10')]);return _0x4418fd(_0x51f0a0[_0xa579('0xf')][_0xa579('0x10')]);}logger['error'](_0xa579('0xb'),_0x770152,_0x51f0a0['error'][_0xa579('0x10')]);return _0x27e490(_0x51f0a0[_0xa579('0xf')][_0xa579('0x10')]);}else{logger[_0xa579('0xa')](_0xa579('0xb'),_0x770152,_0xa579('0xc'));_0x27e490(_0x51f0a0[_0xa579('0x11')][_0xa579('0x10')]);}})['catch'](function(_0x567224){logger['error'](_0xa579('0xb'),_0x770152,_0x567224);_0x4418fd(_0x567224);});});}
\ No newline at end of file
+var _0x61c7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird'];(function(_0x51ee4b,_0x1a1bed){var _0x57904d=function(_0x34602){while(--_0x34602){_0x51ee4b['push'](_0x51ee4b['shift']());}};_0x57904d(++_0x1a1bed);}(_0x61c7,0x127));var _0x761c=function(_0x2edb70,_0x12a185){_0x2edb70=_0x2edb70-0x0;var _0x36ebd4=_0x61c7[_0x2edb70];return _0x36ebd4;};'use strict';var _=require(_0x761c('0x0'));var util=require(_0x761c('0x1'));var moment=require(_0x761c('0x2'));var BPromise=require(_0x761c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x761c('0x4'));var db=require(_0x761c('0x5'))['db'];var utils=require(_0x761c('0x6'));var logger=require(_0x761c('0x7'))(_0x761c('0x8'));var config=require(_0x761c('0x9'));var jayson=require(_0x761c('0xa'));var client=jayson[_0x761c('0xb')][_0x761c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12db27,_0x46d11e,_0x534de7){return new BPromise(function(_0x3211b7,_0x399d57){return client[_0x761c('0xd')](_0x12db27,_0x534de7)['then'](function(_0x47f1f6){logger[_0x761c('0xe')](_0x761c('0xf'),_0x46d11e,'request\x20sent');logger[_0x761c('0x10')](_0x761c('0x11'),_0x46d11e,_0x761c('0x12'),JSON[_0x761c('0x13')](_0x47f1f6));if(_0x47f1f6[_0x761c('0x14')]){if(_0x47f1f6[_0x761c('0x14')][_0x761c('0x15')]===0x1f4){logger[_0x761c('0x14')](_0x761c('0xf'),_0x46d11e,_0x47f1f6[_0x761c('0x14')][_0x761c('0x16')]);return _0x399d57(_0x47f1f6[_0x761c('0x14')][_0x761c('0x16')]);}logger[_0x761c('0x14')](_0x761c('0xf'),_0x46d11e,_0x47f1f6[_0x761c('0x14')][_0x761c('0x16')]);return _0x3211b7(_0x47f1f6[_0x761c('0x14')][_0x761c('0x16')]);}else{logger[_0x761c('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x46d11e,'request\x20sent');_0x3211b7(_0x47f1f6['result'][_0x761c('0x16')]);}})['catch'](function(_0x3e19ed){logger['error'](_0x761c('0xf'),_0x46d11e,_0x3e19ed);_0x399d57(_0x3e19ed);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 2dacc3e..d7989c8 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 _0x3095=['./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x3095,0x14c));var _0x5309=function(_0x2d2f1a,_0x57b966){_0x2d2f1a=_0x2d2f1a-0x0;var _0x55d9db=_0x3095[_0x2d2f1a];return _0x55d9db;};'use strict';var multer=require(_0x5309('0x0'));var util=require(_0x5309('0x1'));var path=require('path');var timeout=require(_0x5309('0x2'));var express=require(_0x5309('0x3'));var router=express[_0x5309('0x4')]();var fs_extra=require(_0x5309('0x5'));var auth=require(_0x5309('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5309('0x7'));var controller=require(_0x5309('0x8'));router[_0x5309('0x9')]('/',auth[_0x5309('0xa')](),controller[_0x5309('0xb')]);router[_0x5309('0x9')](_0x5309('0xc'),auth[_0x5309('0xa')](),controller[_0x5309('0xd')]);router[_0x5309('0x9')](_0x5309('0xe'),auth[_0x5309('0xa')](),controller[_0x5309('0xf')]);router[_0x5309('0x10')]('/',auth[_0x5309('0xa')](),controller[_0x5309('0x11')]);router['put'](_0x5309('0xc'),auth[_0x5309('0xa')](),controller[_0x5309('0x12')]);router[_0x5309('0x13')](_0x5309('0xc'),auth[_0x5309('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6880=['index','/:id','show','get','/:id/download','download','post','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x2bb5b3,_0x29373f){var _0x1e0d91=function(_0x5bcb7d){while(--_0x5bcb7d){_0x2bb5b3['push'](_0x2bb5b3['shift']());}};_0x1e0d91(++_0x29373f);}(_0x6880,0x8a));var _0x0688=function(_0x5adc07,_0x326d9e){_0x5adc07=_0x5adc07-0x0;var _0x4e677e=_0x6880[_0x5adc07];return _0x4e677e;};'use strict';var multer=require('multer');var util=require(_0x0688('0x0'));var path=require(_0x0688('0x1'));var timeout=require(_0x0688('0x2'));var express=require(_0x0688('0x3'));var router=express['Router']();var fs_extra=require(_0x0688('0x4'));var auth=require(_0x0688('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0688('0x6'));var controller=require(_0x0688('0x7'));router['get']('/',auth[_0x0688('0x8')](),controller[_0x0688('0x9')]);router['get'](_0x0688('0xa'),auth['isAuthenticated'](),controller[_0x0688('0xb')]);router[_0x0688('0xc')](_0x0688('0xd'),auth['isAuthenticated'](),controller[_0x0688('0xe')]);router[_0x0688('0xf')]('/',auth['isAuthenticated'](),controller[_0x0688('0x10')]);router[_0x0688('0x11')](_0x0688('0xa'),auth['isAuthenticated'](),controller[_0x0688('0x12')]);router['delete'](_0x0688('0xa'),auth['isAuthenticated'](),controller[_0x0688('0x13')]);module[_0x0688('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index ab7ce6f..9b783ad 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 _0xb5cd=['TEXT','STRING'];(function(_0x3eff4a,_0x409014){var _0x2b68d9=function(_0x14e638){while(--_0x14e638){_0x3eff4a['push'](_0x3eff4a['shift']());}};_0x2b68d9(++_0x409014);}(_0xb5cd,0x1ca));var _0xdb5c=function(_0x64789b,_0x142eb0){_0x64789b=_0x64789b-0x0;var _0x2ddd86=_0xb5cd[_0x64789b];return _0x2ddd86;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0xdb5c('0x0')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xdb5c('0x1')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xd560=['BOOLEAN','STRING'];(function(_0x5a7242,_0x5bc9e7){var _0x15d862=function(_0x30ea0a){while(--_0x30ea0a){_0x5a7242['push'](_0x5a7242['shift']());}};_0x15d862(++_0x5bc9e7);}(_0xd560,0x69));var _0x0d56=function(_0x34105a,_0xb17783){_0x34105a=_0x34105a-0x0;var _0x3c53f9=_0xd560[_0x34105a];return _0x3c53f9;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0d56('0x0')]},'function':{'type':Sequelize[_0x0d56('0x0')]},'format':{'type':Sequelize[_0x0d56('0x0')]},'groupBy':{'type':Sequelize[_0x0d56('0x1')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x0d56('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index b71985d..ba30db7 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 _0x98d4=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','update','then','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticFieldReport','includeAll','include','catch','show','params','rawAttributes','keys','intersection','length','find','create','body','bulkCreate','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','CustomReportId','findAll','eml-format','rimraf','fast-json-patch'];(function(_0x12410c,_0x4d5d6b){var _0x3e3320=function(_0x494107){while(--_0x494107){_0x12410c['push'](_0x12410c['shift']());}};_0x3e3320(++_0x4d5d6b);}(_0x98d4,0xf6));var _0x498d=function(_0x4cc1ac,_0x4a1520){_0x4cc1ac=_0x4cc1ac-0x0;var _0x5494d8=_0x98d4[_0x4cc1ac];return _0x5494d8;};'use strict';var emlformat=require(_0x498d('0x0'));var rimraf=require(_0x498d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x498d('0x2'));var rp=require(_0x498d('0x3'));var moment=require(_0x498d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x498d('0x5'));var util=require(_0x498d('0x6'));var path=require(_0x498d('0x7'));var sox=require(_0x498d('0x8'));var csv=require(_0x498d('0x9'));var ejs=require(_0x498d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x498d('0xb'));var squel=require(_0x498d('0xc'));var crypto=require(_0x498d('0xd'));var jsforce=require(_0x498d('0xe'));var deskjs=require(_0x498d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x498d('0x10'));var Papa=require(_0x498d('0x11'));var Redis=require(_0x498d('0x12'));var authService=require(_0x498d('0x13'));var qs=require(_0x498d('0x14'));var as=require(_0x498d('0x15'));var hardwareService=require(_0x498d('0x16'));var logger=require(_0x498d('0x17'))(_0x498d('0x18'));var utils=require(_0x498d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x498d('0x1a'));var db=require(_0x498d('0x1b'))['db'];function respondWithStatusCode(_0x238ff9,_0x327af8){_0x327af8=_0x327af8||0xcc;return function(_0x1100a2){if(_0x1100a2){return _0x238ff9['sendStatus'](_0x327af8);}return _0x238ff9[_0x498d('0x1c')](_0x327af8)['end']();};}function respondWithResult(_0x1104a8,_0xe902cb){_0xe902cb=_0xe902cb||0xc8;return function(_0x5a08b5){if(_0x5a08b5){return _0x1104a8[_0x498d('0x1c')](_0xe902cb)[_0x498d('0x1d')](_0x5a08b5);}};}function respondWithFilteredResult(_0x3825b4,_0x412407){return function(_0x3c06c6){if(_0x3c06c6){var _0x4b6787=typeof _0x412407[_0x498d('0x1e')]===_0x498d('0x1f')&&typeof _0x412407[_0x498d('0x20')]===_0x498d('0x1f');var _0x3e9d45=_0x3c06c6['count'];var _0x3b6e2b=_0x4b6787?0x0:_0x412407[_0x498d('0x1e')];var _0x53882f=_0x4b6787?_0x3c06c6[_0x498d('0x21')]:_0x412407['offset']+_0x412407[_0x498d('0x20')];var _0x1b815d;if(_0x53882f>=_0x3e9d45){_0x53882f=_0x3e9d45;_0x1b815d=0xc8;}else{_0x1b815d=0xce;}_0x3825b4['status'](_0x1b815d);return _0x3825b4[_0x498d('0x22')]('Content-Range',_0x3b6e2b+'-'+_0x53882f+'/'+_0x3e9d45)[_0x498d('0x1d')](_0x3c06c6);}return null;};}function patchUpdates(_0xaa318a){return function(_0x5841db){try{jsonpatch[_0x498d('0x23')](_0x5841db,_0xaa318a,!![]);}catch(_0x28582f){return BPromise[_0x498d('0x24')](_0x28582f);}return _0x5841db['save']();};}function saveUpdates(_0x16a81c,_0x4f2144){return function(_0x4f341f){if(_0x4f341f){return _0x4f341f[_0x498d('0x25')](_0x16a81c)[_0x498d('0x26')](function(_0x5f48aa){return _0x5f48aa;});}return null;};}function removeEntity(_0xa0d462,_0x5dcea5){return function(_0x27c32e){if(_0x27c32e){return _0x27c32e['destroy']()[_0x498d('0x26')](function(){_0xa0d462[_0x498d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b4c29,_0x2a618a){return function(_0x5eca3c){if(!_0x5eca3c){_0x9b4c29[_0x498d('0x27')](0x194);}return _0x5eca3c;};}function handleError(_0x4015cb,_0x2cc1bd){_0x2cc1bd=_0x2cc1bd||0x1f4;return function(_0x1d659f){logger['error'](_0x1d659f[_0x498d('0x28')]);if(_0x1d659f[_0x498d('0x29')]){delete _0x1d659f['name'];}_0x4015cb[_0x498d('0x1c')](_0x2cc1bd)[_0x498d('0x2a')](_0x1d659f);};}exports[_0x498d('0x2b')]=function(_0x3fd2bc,_0x5412ce){var _0x246e07={},_0x19c37b={},_0x47b9c5={'count':0x0,'rows':[]};var _0x47b8ce=_[_0x498d('0x2c')](db['AnalyticFieldReport']['rawAttributes'],function(_0x1edfca){return{'name':_0x1edfca[_0x498d('0x2d')],'type':_0x1edfca[_0x498d('0x2e')][_0x498d('0x2f')]};});_0x19c37b[_0x498d('0x30')]=_['map'](_0x47b8ce,_0x498d('0x29'));_0x19c37b[_0x498d('0x31')]=_['keys'](_0x3fd2bc[_0x498d('0x31')]);_0x19c37b[_0x498d('0x32')]=_['intersection'](_0x19c37b[_0x498d('0x30')],_0x19c37b[_0x498d('0x31')]);_0x246e07[_0x498d('0x33')]=_['intersection'](_0x19c37b['model'],qs['fields'](_0x3fd2bc[_0x498d('0x31')][_0x498d('0x34')]));_0x246e07['attributes']=_0x246e07[_0x498d('0x33')]['length']?_0x246e07[_0x498d('0x33')]:_0x19c37b['model'];if(!_0x3fd2bc['query'][_0x498d('0x35')](_0x498d('0x36'))){_0x246e07[_0x498d('0x20')]=qs['limit'](_0x3fd2bc['query'][_0x498d('0x20')]);_0x246e07[_0x498d('0x1e')]=qs[_0x498d('0x1e')](_0x3fd2bc[_0x498d('0x31')][_0x498d('0x1e')]);}_0x246e07['order']=qs[_0x498d('0x37')](_0x3fd2bc['query'][_0x498d('0x37')]);_0x246e07[_0x498d('0x38')]=qs[_0x498d('0x32')](_[_0x498d('0x39')](_0x3fd2bc[_0x498d('0x31')],_0x19c37b[_0x498d('0x32')]),_0x47b8ce);if(_0x3fd2bc[_0x498d('0x31')]['filter']){_0x246e07['where']=_[_0x498d('0x3a')](_0x246e07[_0x498d('0x38')],{'$or':_[_0x498d('0x2c')](_0x47b8ce,function(_0x227169){if(_0x227169[_0x498d('0x2e')]!==_0x498d('0x3b')){var _0x28c14f={};_0x28c14f[_0x227169[_0x498d('0x29')]]={'$like':'%'+_0x3fd2bc['query'][_0x498d('0x3c')]+'%'};return _0x28c14f;}})});}_0x246e07=_[_0x498d('0x3a')]({},_0x246e07,_0x3fd2bc[_0x498d('0x3d')]);var _0x57ef37={'where':_0x246e07[_0x498d('0x38')]};return db[_0x498d('0x3e')][_0x498d('0x21')](_0x57ef37)['then'](function(_0x10e8ad){_0x47b9c5[_0x498d('0x21')]=_0x10e8ad;if(_0x3fd2bc[_0x498d('0x31')][_0x498d('0x3f')]){_0x246e07[_0x498d('0x40')]=[{'all':!![]}];}return db[_0x498d('0x3e')]['findAll'](_0x246e07);})[_0x498d('0x26')](function(_0x25d513){_0x47b9c5['rows']=_0x25d513;return _0x47b9c5;})[_0x498d('0x26')](respondWithFilteredResult(_0x5412ce,_0x246e07))[_0x498d('0x41')](handleError(_0x5412ce,null));};exports[_0x498d('0x42')]=function(_0x3ba881,_0x2471f8){var _0x210fac={'raw':![],'where':{'id':_0x3ba881[_0x498d('0x43')]['id']}},_0x23d050={};_0x23d050[_0x498d('0x30')]=_['keys'](db[_0x498d('0x3e')][_0x498d('0x44')]);_0x23d050[_0x498d('0x31')]=_[_0x498d('0x45')](_0x3ba881['query']);_0x23d050[_0x498d('0x32')]=_[_0x498d('0x46')](_0x23d050['model'],_0x23d050[_0x498d('0x31')]);_0x210fac[_0x498d('0x33')]=_['intersection'](_0x23d050[_0x498d('0x30')],qs['fields'](_0x3ba881[_0x498d('0x31')][_0x498d('0x34')]));_0x210fac['attributes']=_0x210fac[_0x498d('0x33')][_0x498d('0x47')]?_0x210fac['attributes']:_0x23d050[_0x498d('0x30')];if(_0x3ba881['query'][_0x498d('0x3f')]){_0x210fac[_0x498d('0x40')]=[{'all':!![]}];}_0x210fac=_['merge']({},_0x210fac,_0x3ba881[_0x498d('0x3d')]);return db['AnalyticFieldReport'][_0x498d('0x48')](_0x210fac)[_0x498d('0x26')](handleEntityNotFound(_0x2471f8,null))[_0x498d('0x26')](respondWithResult(_0x2471f8,null))[_0x498d('0x41')](handleError(_0x2471f8,null));};exports[_0x498d('0x49')]=function(_0x11d8e5,_0x2ec9ff){return db[_0x498d('0x3e')][_0x498d('0x49')](_0x11d8e5[_0x498d('0x4a')],{})[_0x498d('0x26')](respondWithResult(_0x2ec9ff,0xc9))[_0x498d('0x41')](handleError(_0x2ec9ff,null));};exports['bulkCreate']=function(_0x5376c7,_0x5f24da){return db[_0x498d('0x3e')][_0x498d('0x4b')](_0x5376c7[_0x498d('0x4a')],{'raw':![],'individualHooks':!![]})[_0x498d('0x26')](respondWithResult(_0x5f24da,0xc9))['catch'](handleError(_0x5f24da,null));};exports[_0x498d('0x25')]=function(_0x291acf,_0x2fdfbd){if(_0x291acf['body']['id']){delete _0x291acf[_0x498d('0x4a')]['id'];}return db[_0x498d('0x3e')][_0x498d('0x48')]({'where':{'id':_0x291acf[_0x498d('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fdfbd,null))[_0x498d('0x26')](saveUpdates(_0x291acf[_0x498d('0x4a')],null))['then'](respondWithResult(_0x2fdfbd,null))['catch'](handleError(_0x2fdfbd,null));};exports['destroy']=function(_0x1c3d90,_0x14cfdd){return db[_0x498d('0x3e')][_0x498d('0x48')]({'where':{'id':_0x1c3d90[_0x498d('0x43')]['id']}})['then'](handleEntityNotFound(_0x14cfdd,null))['then'](removeEntity(_0x14cfdd,null))['catch'](handleError(_0x14cfdd,null));};exports[_0x498d('0x4c')]=function(_0x4e7671,_0x240ae3){return db[_0x498d('0x3e')][_0x498d('0x4d')]({'where':{'id':_0x4e7671[_0x498d('0x31')][_0x498d('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x498d('0x26')](respondWithResult(_0x240ae3,0xcc))[_0x498d('0x41')](handleError(_0x240ae3,null));};exports[_0x498d('0x4f')]=function(_0x29e8e9,_0x94c0af,_0x5ecd55){return db[_0x498d('0x50')]['findOne']({'where':{'id':_0x29e8e9['params']['id']}})[_0x498d('0x26')](handleEntityNotFound(_0x94c0af,null))['then'](function(_0x2ca35a){if(_0x2ca35a){return db['sequelize']['transaction'](function(_0x157087){return db[_0x498d('0x3e')]['destroy']({'where':{'CustomReportId':_0x29e8e9[_0x498d('0x43')]['id']},'transaction':_0x157087})[_0x498d('0x26')](function(_0x2e2191){var _0x4b9982=_['map'](_0x29e8e9['body'],function(_0x598d89){delete _0x598d89['id'];_0x598d89[_0x498d('0x51')]=_0x29e8e9['params']['id'];return _0x598d89;});return db[_0x498d('0x3e')][_0x498d('0x4b')](_0x4b9982,{'transaction':_0x157087});});})[_0x498d('0x26')](function(){return db['AnalyticFieldReport'][_0x498d('0x52')]({'where':{'CustomReportId':_0x29e8e9[_0x498d('0x43')]['id']}});});}})[_0x498d('0x26')](respondWithResult(_0x94c0af,null))[_0x498d('0x41')](handleError(_0x94c0af,null));};
\ No newline at end of file
+var _0x5d6c=['mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','Content-Range','json','apply','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','filter','merge','VIRTUAL','options','where','AnalyticFieldReport','include','findAll','rows','show','params','length','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x458ff5,_0x3584f1){var _0x535703=function(_0x5a961e){while(--_0x5a961e){_0x458ff5['push'](_0x458ff5['shift']());}};_0x535703(++_0x3584f1);}(_0x5d6c,0x184));var _0xc5d6=function(_0x2bcbc3,_0x5b509e){_0x2bcbc3=_0x2bcbc3-0x0;var _0x5c1c86=_0x5d6c[_0x2bcbc3];return _0x5c1c86;};'use strict';var emlformat=require(_0xc5d6('0x0'));var rimraf=require(_0xc5d6('0x1'));var zipdir=require(_0xc5d6('0x2'));var jsonpatch=require(_0xc5d6('0x3'));var rp=require(_0xc5d6('0x4'));var moment=require(_0xc5d6('0x5'));var BPromise=require(_0xc5d6('0x6'));var Mustache=require(_0xc5d6('0x7'));var util=require(_0xc5d6('0x8'));var path=require(_0xc5d6('0x9'));var sox=require(_0xc5d6('0xa'));var csv=require(_0xc5d6('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5d6('0xc'));var _=require('lodash');var squel=require(_0xc5d6('0xd'));var crypto=require(_0xc5d6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5d6('0xb'));var querystring=require(_0xc5d6('0xf'));var Papa=require(_0xc5d6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5d6('0x11'));var hardwareService=require(_0xc5d6('0x12'));var logger=require(_0xc5d6('0x13'))('api');var utils=require(_0xc5d6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc5d6('0x15'));var db=require(_0xc5d6('0x16'))['db'];function respondWithStatusCode(_0xbbc447,_0x1b500e){_0x1b500e=_0x1b500e||0xcc;return function(_0x2e34e9){if(_0x2e34e9){return _0xbbc447[_0xc5d6('0x17')](_0x1b500e);}return _0xbbc447['status'](_0x1b500e)[_0xc5d6('0x18')]();};}function respondWithResult(_0x2365cc,_0x28ced0){_0x28ced0=_0x28ced0||0xc8;return function(_0x27c824){if(_0x27c824){return _0x2365cc[_0xc5d6('0x19')](_0x28ced0)['json'](_0x27c824);}};}function respondWithFilteredResult(_0x19c654,_0x4b1a94){return function(_0x3d7a5c){if(_0x3d7a5c){var _0x3ce415=typeof _0x4b1a94[_0xc5d6('0x1a')]==='undefined'&&typeof _0x4b1a94[_0xc5d6('0x1b')]==='undefined';var _0x204d41=_0x3d7a5c[_0xc5d6('0x1c')];var _0x3cff82=_0x3ce415?0x0:_0x4b1a94[_0xc5d6('0x1a')];var _0x3e0c57=_0x3ce415?_0x3d7a5c[_0xc5d6('0x1c')]:_0x4b1a94[_0xc5d6('0x1a')]+_0x4b1a94['limit'];var _0x3d332c;if(_0x3e0c57>=_0x204d41){_0x3e0c57=_0x204d41;_0x3d332c=0xc8;}else{_0x3d332c=0xce;}_0x19c654[_0xc5d6('0x19')](_0x3d332c);return _0x19c654['set'](_0xc5d6('0x1d'),_0x3cff82+'-'+_0x3e0c57+'/'+_0x204d41)[_0xc5d6('0x1e')](_0x3d7a5c);}return null;};}function patchUpdates(_0x323edf){return function(_0x3e8e96){try{jsonpatch[_0xc5d6('0x1f')](_0x3e8e96,_0x323edf,!![]);}catch(_0x109287){return BPromise['reject'](_0x109287);}return _0x3e8e96[_0xc5d6('0x20')]();};}function saveUpdates(_0x138fc5,_0x2f3587){return function(_0x266eb8){if(_0x266eb8){return _0x266eb8['update'](_0x138fc5)[_0xc5d6('0x21')](function(_0x1f7beb){return _0x1f7beb;});}return null;};}function removeEntity(_0x268b76,_0x2de5ee){return function(_0x2b6dc6){if(_0x2b6dc6){return _0x2b6dc6[_0xc5d6('0x22')]()['then'](function(){_0x268b76[_0xc5d6('0x19')](0xcc)[_0xc5d6('0x18')]();});}};}function handleEntityNotFound(_0x2f7055,_0x371e51){return function(_0x3e2328){if(!_0x3e2328){_0x2f7055[_0xc5d6('0x17')](0x194);}return _0x3e2328;};}function handleError(_0x541bff,_0x2758ba){_0x2758ba=_0x2758ba||0x1f4;return function(_0x5aa726){logger['error'](_0x5aa726[_0xc5d6('0x23')]);if(_0x5aa726['name']){delete _0x5aa726[_0xc5d6('0x24')];}_0x541bff[_0xc5d6('0x19')](_0x2758ba)[_0xc5d6('0x25')](_0x5aa726);};}exports[_0xc5d6('0x26')]=function(_0x40cb75,_0x303247){var _0x5695a4={},_0x325ac7={},_0x4c2b51={'count':0x0,'rows':[]};var _0x5b048f=_[_0xc5d6('0x27')](db['AnalyticFieldReport'][_0xc5d6('0x28')],function(_0x2178c4){return{'name':_0x2178c4[_0xc5d6('0x29')],'type':_0x2178c4[_0xc5d6('0x2a')][_0xc5d6('0x2b')]};});_0x325ac7[_0xc5d6('0x2c')]=_[_0xc5d6('0x27')](_0x5b048f,_0xc5d6('0x24'));_0x325ac7[_0xc5d6('0x2d')]=_[_0xc5d6('0x2e')](_0x40cb75['query']);_0x325ac7['filters']=_[_0xc5d6('0x2f')](_0x325ac7['model'],_0x325ac7[_0xc5d6('0x2d')]);_0x5695a4[_0xc5d6('0x30')]=_[_0xc5d6('0x2f')](_0x325ac7[_0xc5d6('0x2c')],qs[_0xc5d6('0x31')](_0x40cb75['query'][_0xc5d6('0x31')]));_0x5695a4[_0xc5d6('0x30')]=_0x5695a4['attributes']['length']?_0x5695a4[_0xc5d6('0x30')]:_0x325ac7[_0xc5d6('0x2c')];if(!_0x40cb75['query']['hasOwnProperty'](_0xc5d6('0x32'))){_0x5695a4['limit']=qs[_0xc5d6('0x1b')](_0x40cb75[_0xc5d6('0x2d')][_0xc5d6('0x1b')]);_0x5695a4['offset']=qs[_0xc5d6('0x1a')](_0x40cb75['query'][_0xc5d6('0x1a')]);}_0x5695a4[_0xc5d6('0x33')]=qs['sort'](_0x40cb75[_0xc5d6('0x2d')][_0xc5d6('0x34')]);_0x5695a4['where']=qs['filters'](_['pick'](_0x40cb75[_0xc5d6('0x2d')],_0x325ac7[_0xc5d6('0x35')]),_0x5b048f);if(_0x40cb75[_0xc5d6('0x2d')][_0xc5d6('0x36')]){_0x5695a4['where']=_[_0xc5d6('0x37')](_0x5695a4['where'],{'$or':_['map'](_0x5b048f,function(_0x390ca9){if(_0x390ca9[_0xc5d6('0x2a')]!==_0xc5d6('0x38')){var _0x57cb4b={};_0x57cb4b[_0x390ca9[_0xc5d6('0x24')]]={'$like':'%'+_0x40cb75[_0xc5d6('0x2d')][_0xc5d6('0x36')]+'%'};return _0x57cb4b;}})});}_0x5695a4=_[_0xc5d6('0x37')]({},_0x5695a4,_0x40cb75[_0xc5d6('0x39')]);var _0x25ae1e={'where':_0x5695a4[_0xc5d6('0x3a')]};return db[_0xc5d6('0x3b')][_0xc5d6('0x1c')](_0x25ae1e)['then'](function(_0x5b101f){_0x4c2b51['count']=_0x5b101f;if(_0x40cb75[_0xc5d6('0x2d')]['includeAll']){_0x5695a4[_0xc5d6('0x3c')]=[{'all':!![]}];}return db[_0xc5d6('0x3b')][_0xc5d6('0x3d')](_0x5695a4);})[_0xc5d6('0x21')](function(_0x1f785c){_0x4c2b51[_0xc5d6('0x3e')]=_0x1f785c;return _0x4c2b51;})[_0xc5d6('0x21')](respondWithFilteredResult(_0x303247,_0x5695a4))['catch'](handleError(_0x303247,null));};exports[_0xc5d6('0x3f')]=function(_0x5e8a28,_0x5d510d){var _0x295f77={'raw':![],'where':{'id':_0x5e8a28[_0xc5d6('0x40')]['id']}},_0x135c97={};_0x135c97[_0xc5d6('0x2c')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x135c97[_0xc5d6('0x2d')]=_[_0xc5d6('0x2e')](_0x5e8a28[_0xc5d6('0x2d')]);_0x135c97['filters']=_['intersection'](_0x135c97['model'],_0x135c97[_0xc5d6('0x2d')]);_0x295f77[_0xc5d6('0x30')]=_['intersection'](_0x135c97[_0xc5d6('0x2c')],qs[_0xc5d6('0x31')](_0x5e8a28[_0xc5d6('0x2d')][_0xc5d6('0x31')]));_0x295f77['attributes']=_0x295f77[_0xc5d6('0x30')][_0xc5d6('0x41')]?_0x295f77[_0xc5d6('0x30')]:_0x135c97['model'];if(_0x5e8a28[_0xc5d6('0x2d')]['includeAll']){_0x295f77[_0xc5d6('0x3c')]=[{'all':!![]}];}_0x295f77=_[_0xc5d6('0x37')]({},_0x295f77,_0x5e8a28[_0xc5d6('0x39')]);return db['AnalyticFieldReport'][_0xc5d6('0x42')](_0x295f77)[_0xc5d6('0x21')](handleEntityNotFound(_0x5d510d,null))[_0xc5d6('0x21')](respondWithResult(_0x5d510d,null))[_0xc5d6('0x43')](handleError(_0x5d510d,null));};exports['create']=function(_0x1eab83,_0xc80268){return db[_0xc5d6('0x3b')][_0xc5d6('0x44')](_0x1eab83[_0xc5d6('0x45')],{})[_0xc5d6('0x21')](respondWithResult(_0xc80268,0xc9))[_0xc5d6('0x43')](handleError(_0xc80268,null));};exports[_0xc5d6('0x46')]=function(_0x361bca,_0x6e2550){return db[_0xc5d6('0x3b')][_0xc5d6('0x46')](_0x361bca[_0xc5d6('0x45')],{'raw':![],'individualHooks':!![]})[_0xc5d6('0x21')](respondWithResult(_0x6e2550,0xc9))[_0xc5d6('0x43')](handleError(_0x6e2550,null));};exports[_0xc5d6('0x47')]=function(_0x3a7c85,_0xe14025){if(_0x3a7c85['body']['id']){delete _0x3a7c85[_0xc5d6('0x45')]['id'];}return db[_0xc5d6('0x3b')][_0xc5d6('0x42')]({'where':{'id':_0x3a7c85[_0xc5d6('0x40')]['id']}})[_0xc5d6('0x21')](handleEntityNotFound(_0xe14025,null))[_0xc5d6('0x21')](saveUpdates(_0x3a7c85[_0xc5d6('0x45')],null))[_0xc5d6('0x21')](respondWithResult(_0xe14025,null))[_0xc5d6('0x43')](handleError(_0xe14025,null));};exports[_0xc5d6('0x22')]=function(_0x2c5e3d,_0x31526b){return db[_0xc5d6('0x3b')][_0xc5d6('0x42')]({'where':{'id':_0x2c5e3d[_0xc5d6('0x40')]['id']}})[_0xc5d6('0x21')](handleEntityNotFound(_0x31526b,null))[_0xc5d6('0x21')](removeEntity(_0x31526b,null))['catch'](handleError(_0x31526b,null));};exports[_0xc5d6('0x48')]=function(_0x472368,_0x3f05ac){return db['AnalyticFieldReport'][_0xc5d6('0x22')]({'where':{'id':_0x472368['query'][_0xc5d6('0x49')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3f05ac,0xcc))[_0xc5d6('0x43')](handleError(_0x3f05ac,null));};exports[_0xc5d6('0x4a')]=function(_0x4bcd03,_0xa5da21,_0x4e5d7e){return db[_0xc5d6('0x4b')]['findOne']({'where':{'id':_0x4bcd03[_0xc5d6('0x40')]['id']}})[_0xc5d6('0x21')](handleEntityNotFound(_0xa5da21,null))[_0xc5d6('0x21')](function(_0xf9070a){if(_0xf9070a){return db[_0xc5d6('0x4c')][_0xc5d6('0x4d')](function(_0x3808e4){return db[_0xc5d6('0x3b')]['destroy']({'where':{'CustomReportId':_0x4bcd03[_0xc5d6('0x40')]['id']},'transaction':_0x3808e4})[_0xc5d6('0x21')](function(_0x45cbd){var _0x43a07c=_[_0xc5d6('0x27')](_0x4bcd03[_0xc5d6('0x45')],function(_0x17f5bd){delete _0x17f5bd['id'];_0x17f5bd[_0xc5d6('0x4e')]=_0x4bcd03[_0xc5d6('0x40')]['id'];return _0x17f5bd;});return db[_0xc5d6('0x3b')][_0xc5d6('0x46')](_0x43a07c,{'transaction':_0x3808e4});});})[_0xc5d6('0x21')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x4bcd03[_0xc5d6('0x40')]['id']}});});}})[_0xc5d6('0x21')](respondWithResult(_0xa5da21,null))['catch'](handleError(_0xa5da21,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 9046f8a..668f8a3 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 _0x2866=['moment','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','lodash','api'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x2866,0xce));var _0x6286=function(_0x4b33d1,_0x2414e1){_0x4b33d1=_0x4b33d1-0x0;var _0x9e7221=_0x2866[_0x4b33d1];return _0x9e7221;};'use strict';var _=require(_0x6286('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6286('0x1'));var moment=require(_0x6286('0x2'));var BPromise=require(_0x6286('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6286('0x4'));var config=require(_0x6286('0x5'));var attributes=require(_0x6286('0x6'));module['exports']=function(_0xacb9b9,_0x445f04){return _0xacb9b9['define'](_0x6286('0x7'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x67ba=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x67ba,0xf0));var _0xa67b=function(_0x112fc4,_0x9381f0){_0x112fc4=_0x112fc4-0x0;var _0x36cd0d=_0x67ba[_0x112fc4];return _0x36cd0d;};'use strict';var _=require(_0xa67b('0x0'));var util=require('util');var logger=require(_0xa67b('0x1'))(_0xa67b('0x2'));var moment=require(_0xa67b('0x3'));var BPromise=require(_0xa67b('0x4'));var rp=require(_0xa67b('0x5'));var fs=require('fs');var path=require(_0xa67b('0x6'));var rimraf=require(_0xa67b('0x7'));var config=require(_0xa67b('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xa67b('0x9')]=function(_0x30b83e,_0x3c41ac){return _0x30b83e[_0xa67b('0xa')](_0xa67b('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index bb78497..a7b357e 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 _0x20a6=['error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x207061,_0xe38cda){var _0x4a2833=function(_0x16906e){while(--_0x16906e){_0x207061['push'](_0x207061['shift']());}};_0x4a2833(++_0xe38cda);}(_0x20a6,0x158));var _0x620a=function(_0x211e5e,_0x53c06b){_0x211e5e=_0x211e5e-0x0;var _0x1f297b=_0x20a6[_0x211e5e];return _0x1f297b;};'use strict';var _=require(_0x620a('0x0'));var util=require(_0x620a('0x1'));var moment=require(_0x620a('0x2'));var BPromise=require(_0x620a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x620a('0x4'));var db=require(_0x620a('0x5'))['db'];var utils=require(_0x620a('0x6'));var logger=require('../../config/logger')(_0x620a('0x7'));var config=require('../../config/environment');var jayson=require(_0x620a('0x8'));var client=jayson['client'][_0x620a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33b63f,_0x4f8ee5,_0x4e8562){return new BPromise(function(_0xce1ceb,_0x2d1728){return client[_0x620a('0xa')](_0x33b63f,_0x4e8562)['then'](function(_0x47c930){logger[_0x620a('0xb')](_0x620a('0xc'),_0x4f8ee5,_0x620a('0xd'));logger[_0x620a('0xe')](_0x620a('0xf'),_0x4f8ee5,_0x620a('0xd'),JSON[_0x620a('0x10')](_0x47c930));if(_0x47c930[_0x620a('0x11')]){if(_0x47c930[_0x620a('0x11')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4f8ee5,_0x47c930[_0x620a('0x11')][_0x620a('0x12')]);return _0x2d1728(_0x47c930['error'][_0x620a('0x12')]);}logger['error'](_0x620a('0xc'),_0x4f8ee5,_0x47c930[_0x620a('0x11')]['message']);return _0xce1ceb(_0x47c930[_0x620a('0x11')][_0x620a('0x12')]);}else{logger['info'](_0x620a('0xc'),_0x4f8ee5,_0x620a('0xd'));_0xce1ceb(_0x47c930['result'][_0x620a('0x12')]);}})['catch'](function(_0x3b4379){logger[_0x620a('0x11')](_0x620a('0xc'),_0x4f8ee5,_0x3b4379);_0x2d1728(_0x3b4379);});});}
\ No newline at end of file
+var _0x249e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x249e,0x140));var _0xe249=function(_0x3d16a5,_0x1e4c3c){_0x3d16a5=_0x3d16a5-0x0;var _0x558613=_0x249e[_0x3d16a5];return _0x558613;};'use strict';var _=require(_0xe249('0x0'));var util=require(_0xe249('0x1'));var moment=require(_0xe249('0x2'));var BPromise=require('bluebird');var rs=require(_0xe249('0x3'));var fs=require('fs');var Redis=require(_0xe249('0x4'));var db=require(_0xe249('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe249('0x6'))('rpc');var config=require(_0xe249('0x7'));var jayson=require(_0xe249('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2abb96,_0x2b8647,_0x5bf29f){return new BPromise(function(_0x3c674c,_0xd1ca7d){return client['request'](_0x2abb96,_0x5bf29f)[_0xe249('0x9')](function(_0x31adcd){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b8647,_0xe249('0xa'));logger[_0xe249('0xb')](_0xe249('0xc'),_0x2b8647,_0xe249('0xa'),JSON[_0xe249('0xd')](_0x31adcd));if(_0x31adcd[_0xe249('0xe')]){if(_0x31adcd[_0xe249('0xe')][_0xe249('0xf')]===0x1f4){logger[_0xe249('0xe')](_0xe249('0x10'),_0x2b8647,_0x31adcd[_0xe249('0xe')]['message']);return _0xd1ca7d(_0x31adcd[_0xe249('0xe')][_0xe249('0x11')]);}logger[_0xe249('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2b8647,_0x31adcd[_0xe249('0xe')][_0xe249('0x11')]);return _0x3c674c(_0x31adcd[_0xe249('0xe')]['message']);}else{logger['info'](_0xe249('0x10'),_0x2b8647,_0xe249('0xa'));_0x3c674c(_0x31adcd[_0xe249('0x12')][_0xe249('0x11')]);}})[_0xe249('0x13')](function(_0xc49e62){logger[_0xe249('0xe')](_0xe249('0x10'),_0x2b8647,_0xc49e62);_0xd1ca7d(_0xc49e62);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index e8df023..137b692 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(_0x1d5a62,_0x416319){var _0x59f074=function(_0x375fd4){while(--_0x375fd4){_0x1d5a62['push'](_0x1d5a62['shift']());}};_0x59f074(++_0x416319);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x4b3fe3,_0x194dad){var _0x476091=function(_0x5cf290){while(--_0x5cf290){_0x4b3fe3['push'](_0x4b3fe3['shift']());}};_0x476091(++_0x194dad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 6919aaf..92af735 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 _0xfaa4=['exports','STRING','name','TEXT','sequelize'];(function(_0x1627dd,_0x51eb83){var _0x22a654=function(_0x11234b){while(--_0x11234b){_0x1627dd['push'](_0x1627dd['shift']());}};_0x22a654(++_0x51eb83);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x8b0bbb,_0x3b17ea){_0x8b0bbb=_0x8b0bbb-0x0;var _0x43c308=_0xfaa4[_0x8b0bbb];return _0x43c308;};'use strict';var Sequelize=require(_0x4faa('0x0'));module[_0x4faa('0x1')]={'name':{'type':Sequelize[_0x4faa('0x2')],'allowNull':![],'unique':_0x4faa('0x3')},'table':{'type':Sequelize[_0x4faa('0x2')]},'metric':{'type':Sequelize[_0x4faa('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2746=['TEXT','STRING','name'];(function(_0x30b53a,_0x5ebc30){var _0x51c395=function(_0x527bba){while(--_0x527bba){_0x30b53a['push'](_0x30b53a['shift']());}};_0x51c395(++_0x5ebc30);}(_0x2746,0x19c));var _0x6274=function(_0x970579,_0x515788){_0x970579=_0x970579-0x0;var _0x1dcc78=_0x2746[_0x970579];return _0x1dcc78;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6274('0x0')],'allowNull':![],'unique':_0x6274('0x1')},'table':{'type':Sequelize[_0x6274('0x0')]},'metric':{'type':Sequelize[_0x6274('0x2')]},'description':{'type':Sequelize[_0x6274('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 5269e3b..c1a2d29 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x1ca5a3,_0x40b024){var _0xc8acbf=function(_0x5b50df){while(--_0x5b50df){_0x1ca5a3['push'](_0x1ca5a3['shift']());}};_0xc8acbf(++_0x40b024);}(_0x008c,0x188));var _0xc008=function(_0x462150,_0x48ac37){_0x462150=_0x462150-0x0;var _0x28a15c=_0x008c[_0x462150];return _0x28a15c;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x3ac1f3,_0x8ba690){var _0x1f96ca=function(_0x16b072){while(--_0x16b072){_0x3ac1f3['push'](_0x3ac1f3['shift']());}};_0x1f96ca(++_0x8ba690);}(_0xe5b3,0x133));var _0x3e5b=function(_0x243c94,_0x156778){_0x243c94=_0x243c94-0x0;var _0x33624f=_0xe5b3[_0x243c94];return _0x33624f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index dae1235..a1365f2 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 _0xbdb9=['analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','exports','AnalyticMetric'];(function(_0x272e18,_0x75e43c){var _0x572ca9=function(_0xf2b51a){while(--_0xf2b51a){_0x272e18['push'](_0x272e18['shift']());}};_0x572ca9(++_0x75e43c);}(_0xbdb9,0xac));var _0x9bdb=function(_0x2ecb35,_0xcba482){_0x2ecb35=_0x2ecb35-0x0;var _0x2f0e95=_0xbdb9[_0x2ecb35];return _0x2f0e95;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var logger=require(_0x9bdb('0x2'))(_0x9bdb('0x3'));var moment=require(_0x9bdb('0x4'));var BPromise=require('bluebird');var rp=require(_0x9bdb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x9bdb('0x6')]=function(_0x4f9fbe,_0x225a66){return _0x4f9fbe['define'](_0x9bdb('0x7'),attributes,{'tableName':_0x9bdb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2f1=['path','./analyticMetric.attributes','exports','analytics_metrics','lodash','util','api','moment','request-promise'];(function(_0x1ced88,_0x477e93){var _0x4eafbd=function(_0xc92d8e){while(--_0xc92d8e){_0x1ced88['push'](_0x1ced88['shift']());}};_0x4eafbd(++_0x477e93);}(_0xb2f1,0xee));var _0x1b2f=function(_0xbcb777,_0xb0960){_0xbcb777=_0xbcb777-0x0;var _0x5aafed=_0xb2f1[_0xbcb777];return _0x5aafed;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var logger=require('../../config/logger')(_0x1b2f('0x2'));var moment=require(_0x1b2f('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b2f('0x4'));var fs=require('fs');var path=require(_0x1b2f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b2f('0x6'));module[_0x1b2f('0x7')]=function(_0xad728b,_0x4326ba){return _0xad728b['define']('AnalyticMetric',attributes,{'tableName':_0x1b2f('0x8'),'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 b38a92c..1fc786e 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 _0x0351=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x408d56,_0x417b8f){var _0x3a0769=function(_0x489380){while(--_0x489380){_0x408d56['push'](_0x408d56['shift']());}};_0x3a0769(++_0x417b8f);}(_0x0351,0xe2));var _0x1035=function(_0x373441,_0x546ec5){_0x373441=_0x373441-0x0;var _0x478ec1=_0x0351[_0x373441];return _0x478ec1;};'use strict';var _=require(_0x1035('0x0'));var util=require(_0x1035('0x1'));var moment=require(_0x1035('0x2'));var BPromise=require(_0x1035('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1035('0x4'));var db=require(_0x1035('0x5'))['db'];var utils=require(_0x1035('0x6'));var logger=require(_0x1035('0x7'))(_0x1035('0x8'));var config=require(_0x1035('0x9'));var jayson=require(_0x1035('0xa'));var client=jayson[_0x1035('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b6e74,_0x3cf5f4,_0x12db6a){return new BPromise(function(_0x5b5c9a,_0x8bf34b){return client['request'](_0x3b6e74,_0x12db6a)[_0x1035('0xc')](function(_0x579581){logger[_0x1035('0xd')](_0x1035('0xe'),_0x3cf5f4,_0x1035('0xf'));logger[_0x1035('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x3cf5f4,_0x1035('0xf'),JSON[_0x1035('0x11')](_0x579581));if(_0x579581['error']){if(_0x579581['error'][_0x1035('0x12')]===0x1f4){logger[_0x1035('0x13')](_0x1035('0xe'),_0x3cf5f4,_0x579581[_0x1035('0x13')]['message']);return _0x8bf34b(_0x579581[_0x1035('0x13')][_0x1035('0x14')]);}logger[_0x1035('0x13')](_0x1035('0xe'),_0x3cf5f4,_0x579581[_0x1035('0x13')][_0x1035('0x14')]);return _0x5b5c9a(_0x579581[_0x1035('0x13')][_0x1035('0x14')]);}else{logger[_0x1035('0xd')](_0x1035('0xe'),_0x3cf5f4,_0x1035('0xf'));_0x5b5c9a(_0x579581[_0x1035('0x15')]['message']);}})[_0x1035('0x16')](function(_0x4736f4){logger[_0x1035('0x13')](_0x1035('0xe'),_0x3cf5f4,_0x4736f4);_0x8bf34b(_0x4736f4);});});}
\ No newline at end of file
+var _0xff86=['result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticMetric,\x20%s,\x20%s','message'];(function(_0x386306,_0x1363c9){var _0xcb23d=function(_0x1fc525){while(--_0x1fc525){_0x386306['push'](_0x386306['shift']());}};_0xcb23d(++_0x1363c9);}(_0xff86,0x151));var _0x6ff8=function(_0x187324,_0x284da5){_0x187324=_0x187324-0x0;var _0x2c2081=_0xff86[_0x187324];return _0x2c2081;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6ff8('0x0'));var BPromise=require(_0x6ff8('0x1'));var rs=require(_0x6ff8('0x2'));var fs=require('fs');var Redis=require(_0x6ff8('0x3'));var db=require(_0x6ff8('0x4'))['db'];var utils=require(_0x6ff8('0x5'));var logger=require('../../config/logger')(_0x6ff8('0x6'));var config=require(_0x6ff8('0x7'));var jayson=require(_0x6ff8('0x8'));var client=jayson[_0x6ff8('0x9')][_0x6ff8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10d902,_0x508e92,_0x750a03){return new BPromise(function(_0x32e62e,_0x452d1b){return client[_0x6ff8('0xb')](_0x10d902,_0x750a03)['then'](function(_0x581549){logger[_0x6ff8('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x508e92,'request\x20sent');logger[_0x6ff8('0xd')](_0x6ff8('0xe'),_0x508e92,_0x6ff8('0xf'),JSON['stringify'](_0x581549));if(_0x581549[_0x6ff8('0x10')]){if(_0x581549['error'][_0x6ff8('0x11')]===0x1f4){logger[_0x6ff8('0x10')](_0x6ff8('0x12'),_0x508e92,_0x581549['error'][_0x6ff8('0x13')]);return _0x452d1b(_0x581549[_0x6ff8('0x10')]['message']);}logger[_0x6ff8('0x10')](_0x6ff8('0x12'),_0x508e92,_0x581549[_0x6ff8('0x10')][_0x6ff8('0x13')]);return _0x32e62e(_0x581549[_0x6ff8('0x10')][_0x6ff8('0x13')]);}else{logger[_0x6ff8('0xc')](_0x6ff8('0x12'),_0x508e92,'request\x20sent');_0x32e62e(_0x581549[_0x6ff8('0x14')][_0x6ff8('0x13')]);}})['catch'](function(_0x3b5c79){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x508e92,_0x3b5c79);_0x452d1b(_0x3b5c79);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 793a66d..61f1b91 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 _0x723e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','put','delete','exports','util','path','connect-timeout'];(function(_0x2ba4fa,_0x7dec3e){var _0x2cab3d=function(_0x28682e){while(--_0x28682e){_0x2ba4fa['push'](_0x2ba4fa['shift']());}};_0x2cab3d(++_0x7dec3e);}(_0x723e,0x179));var _0xe723=function(_0x15e634,_0x28558e){_0x15e634=_0x15e634-0x0;var _0x4d5d95=_0x723e[_0x15e634];return _0x4d5d95;};'use strict';var multer=require('multer');var util=require(_0xe723('0x0'));var path=require(_0xe723('0x1'));var timeout=require(_0xe723('0x2'));var express=require(_0xe723('0x3'));var router=express[_0xe723('0x4')]();var fs_extra=require(_0xe723('0x5'));var auth=require(_0xe723('0x6'));var interaction=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var controller=require(_0xe723('0x9'));router['get']('/',auth[_0xe723('0xa')](),controller[_0xe723('0xb')]);router[_0xe723('0xc')](_0xe723('0xd'),auth[_0xe723('0xa')](),controller[_0xe723('0xe')]);router[_0xe723('0xf')]('/',auth[_0xe723('0xa')](),controller['create']);router[_0xe723('0x10')](_0xe723('0xd'),auth[_0xe723('0xa')](),controller['update']);router[_0xe723('0x11')](_0xe723('0xd'),auth[_0xe723('0xa')](),controller['destroy']);module[_0xe723('0x12')]=router;
\ No newline at end of file
+var _0x1dcc=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','put','update'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x34e0db,_0x6be33b){_0x34e0db=_0x34e0db-0x0;var _0x1202d8=_0x1dcc[_0x34e0db];return _0x1202d8;};'use strict';var multer=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var path=require(_0xc1dc('0x2'));var timeout=require(_0xc1dc('0x3'));var express=require('express');var router=express[_0xc1dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1dc('0x5'));var interaction=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x9')]);router[_0xc1dc('0xa')]('/:id',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xb')]);router['post']('/',auth[_0xc1dc('0x8')](),controller['create']);router[_0xc1dc('0xc')]('/:id',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xd')]);router[_0xc1dc('0xe')](_0xc1dc('0xf'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x10')]);module[_0xc1dc('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 32b68ef..f05079c 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 _0xd41f=['TEXT','exports'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xd41f,0xf1));var _0xfd41=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd41f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xfd41('0x0')]={'tree':{'type':Sequelize[_0xfd41('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x8835=['exports','TEXT'];(function(_0x3ab4c8,_0x1e05a4){var _0x59f1e2=function(_0x51afc0){while(--_0x51afc0){_0x3ab4c8['push'](_0x3ab4c8['shift']());}};_0x59f1e2(++_0x1e05a4);}(_0x8835,0xc0));var _0x5883=function(_0xdfa37a,_0x5ac389){_0xdfa37a=_0xdfa37a-0x0;var _0x440926=_0x8835[_0xdfa37a];return _0x440926;};'use strict';var Sequelize=require('sequelize');module[_0x5883('0x0')]={'tree':{'type':Sequelize[_0x5883('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 931d2a4..320f80f 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 _0x613d=['name','map','AnalyticTreeReport','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x613d,0x199));var _0xd613=function(_0x132887,_0x8a429e){_0x132887=_0x132887-0x0;var _0x4edd79=_0x613d[_0x132887];return _0x4edd79;};'use strict';var emlformat=require(_0xd613('0x0'));var rimraf=require(_0xd613('0x1'));var zipdir=require(_0xd613('0x2'));var jsonpatch=require(_0xd613('0x3'));var rp=require(_0xd613('0x4'));var moment=require(_0xd613('0x5'));var BPromise=require(_0xd613('0x6'));var Mustache=require('mustache');var util=require(_0xd613('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd613('0x8'));var fs=require('fs');var fs_extra=require(_0xd613('0x9'));var _=require('lodash');var squel=require(_0xd613('0xa'));var crypto=require(_0xd613('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd613('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd613('0xd'));var authService=require(_0xd613('0xe'));var qs=require(_0xd613('0xf'));var as=require(_0xd613('0x10'));var hardwareService=require(_0xd613('0x11'));var logger=require(_0xd613('0x12'))(_0xd613('0x13'));var utils=require(_0xd613('0x14'));var config=require(_0xd613('0x15'));var licenseUtil=require(_0xd613('0x16'));var db=require(_0xd613('0x17'))['db'];function respondWithStatusCode(_0x9ddf63,_0x398027){_0x398027=_0x398027||0xcc;return function(_0x14299d){if(_0x14299d){return _0x9ddf63['sendStatus'](_0x398027);}return _0x9ddf63[_0xd613('0x18')](_0x398027)[_0xd613('0x19')]();};}function respondWithResult(_0x1197a8,_0x355c18){_0x355c18=_0x355c18||0xc8;return function(_0x307843){if(_0x307843){return _0x1197a8[_0xd613('0x18')](_0x355c18)['json'](_0x307843);}};}function respondWithFilteredResult(_0x103975,_0x1edc1d){return function(_0x5c5cf9){if(_0x5c5cf9){var _0x5dda47=typeof _0x1edc1d['offset']===_0xd613('0x1a')&&typeof _0x1edc1d['limit']===_0xd613('0x1a');var _0x480ab3=_0x5c5cf9[_0xd613('0x1b')];var _0x73b210=_0x5dda47?0x0:_0x1edc1d[_0xd613('0x1c')];var _0x4a7f7d=_0x5dda47?_0x5c5cf9[_0xd613('0x1b')]:_0x1edc1d[_0xd613('0x1c')]+_0x1edc1d[_0xd613('0x1d')];var _0x35b19a;if(_0x4a7f7d>=_0x480ab3){_0x4a7f7d=_0x480ab3;_0x35b19a=0xc8;}else{_0x35b19a=0xce;}_0x103975[_0xd613('0x18')](_0x35b19a);return _0x103975[_0xd613('0x1e')](_0xd613('0x1f'),_0x73b210+'-'+_0x4a7f7d+'/'+_0x480ab3)[_0xd613('0x20')](_0x5c5cf9);}return null;};}function patchUpdates(_0x1e267c){return function(_0x48c307){try{jsonpatch[_0xd613('0x21')](_0x48c307,_0x1e267c,!![]);}catch(_0xc7d001){return BPromise[_0xd613('0x22')](_0xc7d001);}return _0x48c307[_0xd613('0x23')]();};}function saveUpdates(_0x3648ab,_0x2de7f8){return function(_0x3774b3){if(_0x3774b3){return _0x3774b3['update'](_0x3648ab)[_0xd613('0x24')](function(_0x4e7570){return _0x4e7570;});}return null;};}function removeEntity(_0x1f60a3,_0x1435b5){return function(_0x3f146f){if(_0x3f146f){return _0x3f146f[_0xd613('0x25')]()['then'](function(){_0x1f60a3['status'](0xcc)[_0xd613('0x19')]();});}};}function handleEntityNotFound(_0x3ea747,_0x836f72){return function(_0x268ec4){if(!_0x268ec4){_0x3ea747[_0xd613('0x26')](0x194);}return _0x268ec4;};}function handleError(_0x1a6060,_0x189258){_0x189258=_0x189258||0x1f4;return function(_0x565d1f){logger[_0xd613('0x27')](_0x565d1f[_0xd613('0x28')]);if(_0x565d1f[_0xd613('0x29')]){delete _0x565d1f['name'];}_0x1a6060[_0xd613('0x18')](_0x189258)['send'](_0x565d1f);};}exports['index']=function(_0xe916ca,_0x212961){var _0x295532={},_0x11ec8d={},_0x1fd7a8={'count':0x0,'rows':[]};var _0x53144a=_[_0xd613('0x2a')](db[_0xd613('0x2b')]['rawAttributes'],function(_0xe5c34e){return{'name':_0xe5c34e[_0xd613('0x2c')],'type':_0xe5c34e['type']['key']};});_0x11ec8d[_0xd613('0x2d')]=_[_0xd613('0x2a')](_0x53144a,_0xd613('0x29'));_0x11ec8d[_0xd613('0x2e')]=_['keys'](_0xe916ca['query']);_0x11ec8d[_0xd613('0x2f')]=_[_0xd613('0x30')](_0x11ec8d[_0xd613('0x2d')],_0x11ec8d[_0xd613('0x2e')]);_0x295532[_0xd613('0x31')]=_['intersection'](_0x11ec8d[_0xd613('0x2d')],qs[_0xd613('0x32')](_0xe916ca[_0xd613('0x2e')][_0xd613('0x32')]));_0x295532['attributes']=_0x295532['attributes']['length']?_0x295532[_0xd613('0x31')]:_0x11ec8d[_0xd613('0x2d')];if(!_0xe916ca[_0xd613('0x2e')][_0xd613('0x33')]('nolimit')){_0x295532[_0xd613('0x1d')]=qs[_0xd613('0x1d')](_0xe916ca['query'][_0xd613('0x1d')]);_0x295532['offset']=qs['offset'](_0xe916ca[_0xd613('0x2e')][_0xd613('0x1c')]);}_0x295532[_0xd613('0x34')]=qs['sort'](_0xe916ca['query'][_0xd613('0x35')]);_0x295532[_0xd613('0x36')]=qs['filters'](_[_0xd613('0x37')](_0xe916ca['query'],_0x11ec8d[_0xd613('0x2f')]),_0x53144a);if(_0xe916ca[_0xd613('0x2e')][_0xd613('0x38')]){_0x295532[_0xd613('0x36')]=_[_0xd613('0x39')](_0x295532[_0xd613('0x36')],{'$or':_['map'](_0x53144a,function(_0x4e10c9){if(_0x4e10c9[_0xd613('0x3a')]!==_0xd613('0x3b')){var _0x1842de={};_0x1842de[_0x4e10c9[_0xd613('0x29')]]={'$like':'%'+_0xe916ca[_0xd613('0x2e')]['filter']+'%'};return _0x1842de;}})});}_0x295532=_[_0xd613('0x39')]({},_0x295532,_0xe916ca[_0xd613('0x3c')]);var _0x1ba2dd={'where':_0x295532['where']};return db[_0xd613('0x2b')][_0xd613('0x1b')](_0x1ba2dd)[_0xd613('0x24')](function(_0x55db9e){_0x1fd7a8[_0xd613('0x1b')]=_0x55db9e;if(_0xe916ca['query'][_0xd613('0x3d')]){_0x295532[_0xd613('0x3e')]=[{'all':!![]}];}return db[_0xd613('0x2b')][_0xd613('0x3f')](_0x295532);})['then'](function(_0x7f3255){_0x1fd7a8[_0xd613('0x40')]=_0x7f3255;return _0x1fd7a8;})['then'](respondWithFilteredResult(_0x212961,_0x295532))[_0xd613('0x41')](handleError(_0x212961,null));};exports[_0xd613('0x42')]=function(_0x423762,_0x496783){var _0x56e613={'raw':!![],'where':{'id':_0x423762['params']['id']}},_0x3deeff={};_0x3deeff[_0xd613('0x2d')]=_[_0xd613('0x43')](db[_0xd613('0x2b')][_0xd613('0x44')]);_0x3deeff[_0xd613('0x2e')]=_['keys'](_0x423762[_0xd613('0x2e')]);_0x3deeff['filters']=_[_0xd613('0x30')](_0x3deeff[_0xd613('0x2d')],_0x3deeff['query']);_0x56e613[_0xd613('0x31')]=_[_0xd613('0x30')](_0x3deeff[_0xd613('0x2d')],qs[_0xd613('0x32')](_0x423762['query'][_0xd613('0x32')]));_0x56e613[_0xd613('0x31')]=_0x56e613['attributes'][_0xd613('0x45')]?_0x56e613[_0xd613('0x31')]:_0x3deeff[_0xd613('0x2d')];if(_0x423762[_0xd613('0x2e')][_0xd613('0x3d')]){_0x56e613[_0xd613('0x3e')]=[{'all':!![]}];}_0x56e613=_[_0xd613('0x39')]({},_0x56e613,_0x423762[_0xd613('0x3c')]);return db['AnalyticTreeReport'][_0xd613('0x46')](_0x56e613)['then'](handleEntityNotFound(_0x496783,null))[_0xd613('0x24')](respondWithResult(_0x496783,null))[_0xd613('0x41')](handleError(_0x496783,null));};exports[_0xd613('0x47')]=function(_0x16fb04,_0x3643ca){return db['AnalyticTreeReport'][_0xd613('0x47')](_0x16fb04[_0xd613('0x48')],{})[_0xd613('0x24')](respondWithResult(_0x3643ca,0xc9))[_0xd613('0x41')](handleError(_0x3643ca,null));};exports[_0xd613('0x49')]=function(_0x51892e,_0xa0e5fb){if(_0x51892e[_0xd613('0x48')]['id']){delete _0x51892e[_0xd613('0x48')]['id'];}return db['AnalyticTreeReport'][_0xd613('0x46')]({'where':{'id':_0x51892e[_0xd613('0x4a')]['id']}})[_0xd613('0x24')](handleEntityNotFound(_0xa0e5fb,null))['then'](saveUpdates(_0x51892e[_0xd613('0x48')],null))[_0xd613('0x24')](respondWithResult(_0xa0e5fb,null))[_0xd613('0x41')](handleError(_0xa0e5fb,null));};exports[_0xd613('0x25')]=function(_0x3bb593,_0x54fbff){return db['AnalyticTreeReport']['find']({'where':{'id':_0x3bb593['params']['id']}})[_0xd613('0x24')](handleEntityNotFound(_0x54fbff,null))[_0xd613('0x24')](removeEntity(_0x54fbff,null))['catch'](handleError(_0x54fbff,null));};
\ No newline at end of file
+var _0x94b3=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','AnalyticTreeReport','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','params','keys','include','create','body','find','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x94b3,0x1f2));var _0x394b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x94b3[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x394b('0x0'));var rp=require(_0x394b('0x1'));var moment=require(_0x394b('0x2'));var BPromise=require(_0x394b('0x3'));var Mustache=require(_0x394b('0x4'));var util=require(_0x394b('0x5'));var path=require(_0x394b('0x6'));var sox=require(_0x394b('0x7'));var csv=require(_0x394b('0x8'));var ejs=require(_0x394b('0x9'));var fs=require('fs');var fs_extra=require(_0x394b('0xa'));var _=require(_0x394b('0xb'));var squel=require(_0x394b('0xc'));var crypto=require(_0x394b('0xd'));var jsforce=require(_0x394b('0xe'));var deskjs=require(_0x394b('0xf'));var toCsv=require(_0x394b('0x8'));var querystring=require('querystring');var Papa=require(_0x394b('0x10'));var Redis=require(_0x394b('0x11'));var authService=require(_0x394b('0x12'));var qs=require(_0x394b('0x13'));var as=require(_0x394b('0x14'));var hardwareService=require(_0x394b('0x15'));var logger=require('../../config/logger')(_0x394b('0x16'));var utils=require('../../config/utils');var config=require(_0x394b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13832b,_0x5de9cf){_0x5de9cf=_0x5de9cf||0xcc;return function(_0x206429){if(_0x206429){return _0x13832b['sendStatus'](_0x5de9cf);}return _0x13832b[_0x394b('0x18')](_0x5de9cf)['end']();};}function respondWithResult(_0x582bc2,_0x29ed86){_0x29ed86=_0x29ed86||0xc8;return function(_0x3ec1d1){if(_0x3ec1d1){return _0x582bc2[_0x394b('0x18')](_0x29ed86)[_0x394b('0x19')](_0x3ec1d1);}};}function respondWithFilteredResult(_0x37d056,_0x50a984){return function(_0x4dc0e9){if(_0x4dc0e9){var _0x4dd99f=typeof _0x50a984[_0x394b('0x1a')]===_0x394b('0x1b')&&typeof _0x50a984['limit']==='undefined';var _0x5cbb7a=_0x4dc0e9[_0x394b('0x1c')];var _0x26f694=_0x4dd99f?0x0:_0x50a984[_0x394b('0x1a')];var _0x1e2fa2=_0x4dd99f?_0x4dc0e9['count']:_0x50a984[_0x394b('0x1a')]+_0x50a984[_0x394b('0x1d')];var _0x578062;if(_0x1e2fa2>=_0x5cbb7a){_0x1e2fa2=_0x5cbb7a;_0x578062=0xc8;}else{_0x578062=0xce;}_0x37d056[_0x394b('0x18')](_0x578062);return _0x37d056['set'](_0x394b('0x1e'),_0x26f694+'-'+_0x1e2fa2+'/'+_0x5cbb7a)[_0x394b('0x19')](_0x4dc0e9);}return null;};}function patchUpdates(_0x148ab3){return function(_0x13ba7c){try{jsonpatch[_0x394b('0x1f')](_0x13ba7c,_0x148ab3,!![]);}catch(_0x56db78){return BPromise[_0x394b('0x20')](_0x56db78);}return _0x13ba7c['save']();};}function saveUpdates(_0x32bd6a,_0x15e91c){return function(_0x22cbf2){if(_0x22cbf2){return _0x22cbf2[_0x394b('0x21')](_0x32bd6a)['then'](function(_0x1a8b3b){return _0x1a8b3b;});}return null;};}function removeEntity(_0x2c434b,_0xf336fa){return function(_0x2d3770){if(_0x2d3770){return _0x2d3770[_0x394b('0x22')]()[_0x394b('0x23')](function(){_0x2c434b[_0x394b('0x18')](0xcc)[_0x394b('0x24')]();});}};}function handleEntityNotFound(_0x13d66f,_0x4f78ca){return function(_0x2a2e94){if(!_0x2a2e94){_0x13d66f['sendStatus'](0x194);}return _0x2a2e94;};}function handleError(_0x5699da,_0x4c9272){_0x4c9272=_0x4c9272||0x1f4;return function(_0x4282a7){logger[_0x394b('0x25')](_0x4282a7[_0x394b('0x26')]);if(_0x4282a7[_0x394b('0x27')]){delete _0x4282a7['name'];}_0x5699da[_0x394b('0x18')](_0x4c9272)[_0x394b('0x28')](_0x4282a7);};}exports[_0x394b('0x29')]=function(_0x19212a,_0x2c5bcd){var _0x556396={},_0x3223b3={},_0x3b06ab={'count':0x0,'rows':[]};var _0x353160=_['map'](db[_0x394b('0x2a')]['rawAttributes'],function(_0x8de99d){return{'name':_0x8de99d[_0x394b('0x2b')],'type':_0x8de99d[_0x394b('0x2c')]['key']};});_0x3223b3[_0x394b('0x2d')]=_[_0x394b('0x2e')](_0x353160,_0x394b('0x27'));_0x3223b3['query']=_['keys'](_0x19212a[_0x394b('0x2f')]);_0x3223b3[_0x394b('0x30')]=_[_0x394b('0x31')](_0x3223b3[_0x394b('0x2d')],_0x3223b3[_0x394b('0x2f')]);_0x556396[_0x394b('0x32')]=_[_0x394b('0x31')](_0x3223b3['model'],qs['fields'](_0x19212a[_0x394b('0x2f')][_0x394b('0x33')]));_0x556396['attributes']=_0x556396[_0x394b('0x32')][_0x394b('0x34')]?_0x556396[_0x394b('0x32')]:_0x3223b3['model'];if(!_0x19212a[_0x394b('0x2f')][_0x394b('0x35')](_0x394b('0x36'))){_0x556396[_0x394b('0x1d')]=qs[_0x394b('0x1d')](_0x19212a['query']['limit']);_0x556396[_0x394b('0x1a')]=qs['offset'](_0x19212a['query'][_0x394b('0x1a')]);}_0x556396[_0x394b('0x37')]=qs[_0x394b('0x38')](_0x19212a['query'][_0x394b('0x38')]);_0x556396[_0x394b('0x39')]=qs[_0x394b('0x30')](_[_0x394b('0x3a')](_0x19212a['query'],_0x3223b3[_0x394b('0x30')]),_0x353160);if(_0x19212a[_0x394b('0x2f')][_0x394b('0x3b')]){_0x556396[_0x394b('0x39')]=_['merge'](_0x556396['where'],{'$or':_[_0x394b('0x2e')](_0x353160,function(_0x5cfe5b){if(_0x5cfe5b[_0x394b('0x2c')]!==_0x394b('0x3c')){var _0x297a7e={};_0x297a7e[_0x5cfe5b['name']]={'$like':'%'+_0x19212a[_0x394b('0x2f')][_0x394b('0x3b')]+'%'};return _0x297a7e;}})});}_0x556396=_[_0x394b('0x3d')]({},_0x556396,_0x19212a[_0x394b('0x3e')]);var _0x2c4eca={'where':_0x556396[_0x394b('0x39')]};return db[_0x394b('0x2a')]['count'](_0x2c4eca)[_0x394b('0x23')](function(_0x1eaf33){_0x3b06ab['count']=_0x1eaf33;if(_0x19212a['query'][_0x394b('0x3f')]){_0x556396['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x394b('0x40')](_0x556396);})[_0x394b('0x23')](function(_0x3f714f){_0x3b06ab['rows']=_0x3f714f;return _0x3b06ab;})[_0x394b('0x23')](respondWithFilteredResult(_0x2c5bcd,_0x556396))[_0x394b('0x41')](handleError(_0x2c5bcd,null));};exports['show']=function(_0xeb489b,_0x41c992){var _0x11b43e={'raw':!![],'where':{'id':_0xeb489b[_0x394b('0x42')]['id']}},_0x23b3bb={};_0x23b3bb['model']=_[_0x394b('0x43')](db[_0x394b('0x2a')]['rawAttributes']);_0x23b3bb[_0x394b('0x2f')]=_[_0x394b('0x43')](_0xeb489b[_0x394b('0x2f')]);_0x23b3bb['filters']=_['intersection'](_0x23b3bb[_0x394b('0x2d')],_0x23b3bb['query']);_0x11b43e[_0x394b('0x32')]=_[_0x394b('0x31')](_0x23b3bb['model'],qs[_0x394b('0x33')](_0xeb489b['query']['fields']));_0x11b43e[_0x394b('0x32')]=_0x11b43e[_0x394b('0x32')][_0x394b('0x34')]?_0x11b43e[_0x394b('0x32')]:_0x23b3bb[_0x394b('0x2d')];if(_0xeb489b['query'][_0x394b('0x3f')]){_0x11b43e[_0x394b('0x44')]=[{'all':!![]}];}_0x11b43e=_[_0x394b('0x3d')]({},_0x11b43e,_0xeb489b[_0x394b('0x3e')]);return db[_0x394b('0x2a')]['find'](_0x11b43e)[_0x394b('0x23')](handleEntityNotFound(_0x41c992,null))[_0x394b('0x23')](respondWithResult(_0x41c992,null))['catch'](handleError(_0x41c992,null));};exports['create']=function(_0x23162f,_0x244086){return db[_0x394b('0x2a')][_0x394b('0x45')](_0x23162f[_0x394b('0x46')],{})[_0x394b('0x23')](respondWithResult(_0x244086,0xc9))[_0x394b('0x41')](handleError(_0x244086,null));};exports[_0x394b('0x21')]=function(_0x121932,_0x4c84f3){if(_0x121932[_0x394b('0x46')]['id']){delete _0x121932['body']['id'];}return db[_0x394b('0x2a')][_0x394b('0x47')]({'where':{'id':_0x121932[_0x394b('0x42')]['id']}})[_0x394b('0x23')](handleEntityNotFound(_0x4c84f3,null))[_0x394b('0x23')](saveUpdates(_0x121932['body'],null))[_0x394b('0x23')](respondWithResult(_0x4c84f3,null))[_0x394b('0x41')](handleError(_0x4c84f3,null));};exports[_0x394b('0x22')]=function(_0xa6d49,_0x3fdcdb){return db[_0x394b('0x2a')][_0x394b('0x47')]({'where':{'id':_0xa6d49[_0x394b('0x42')]['id']}})[_0x394b('0x23')](handleEntityNotFound(_0x3fdcdb,null))[_0x394b('0x23')](removeEntity(_0x3fdcdb,null))[_0x394b('0x41')](handleError(_0x3fdcdb,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 322c5b7..2c88be3 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 _0x8f3a=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x8f3a,0xf4));var _0xa8f3=function(_0x2e35db,_0x5d79b5){_0x2e35db=_0x2e35db-0x0;var _0xd37845=_0x8f3a[_0x2e35db];return _0xd37845;};'use strict';var _=require(_0xa8f3('0x0'));var util=require('util');var logger=require(_0xa8f3('0x1'))(_0xa8f3('0x2'));var moment=require(_0xa8f3('0x3'));var BPromise=require(_0xa8f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8f3('0x5'));var rimraf=require(_0xa8f3('0x6'));var config=require(_0xa8f3('0x7'));var attributes=require(_0xa8f3('0x8'));module[_0xa8f3('0x9')]=function(_0x2716ee,_0x99cfd0){return _0x2716ee[_0xa8f3('0xa')](_0xa8f3('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3831=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x108a63,_0x350742){var _0x4d4254=function(_0x1427de){while(--_0x1427de){_0x108a63['push'](_0x108a63['shift']());}};_0x4d4254(++_0x350742);}(_0x3831,0xc3));var _0x1383=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x3831[_0x45ee03];return _0x13d535;};'use strict';var _=require(_0x1383('0x0'));var util=require(_0x1383('0x1'));var logger=require(_0x1383('0x2'))(_0x1383('0x3'));var moment=require(_0x1383('0x4'));var BPromise=require(_0x1383('0x5'));var rp=require(_0x1383('0x6'));var fs=require('fs');var path=require(_0x1383('0x7'));var rimraf=require(_0x1383('0x8'));var config=require(_0x1383('0x9'));var attributes=require(_0x1383('0xa'));module[_0x1383('0xb')]=function(_0x1d9c52,_0x586289){return _0x1d9c52[_0x1383('0xc')](_0x1383('0xd'),attributes,{'tableName':_0x1383('0xe'),'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 1508aef..ecde24c 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x1ba131,_0x161afe){_0x1ba131=_0x1ba131-0x0;var _0x481c61=_0x7a54[_0x1ba131];return _0x481c61;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _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(_0x558a6b,_0x43532e){var _0x35e4c2=function(_0x40a747){while(--_0x40a747){_0x558a6b['push'](_0x558a6b['shift']());}};_0x35e4c2(++_0x43532e);}(_0x1261,0x144));var _0x1126=function(_0x28089e,_0x530f8a){_0x28089e=_0x28089e-0x0;var _0x46a73c=_0x1261[_0x28089e];return _0x46a73c;};'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 40f1b36..74d00c3 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 _0x6249=['put','exports','util','path','connect-timeout','Router','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5a08a2,_0x355b94){var _0x1944cd=function(_0x4b4b8d){while(--_0x4b4b8d){_0x5a08a2['push'](_0x5a08a2['shift']());}};_0x1944cd(++_0x355b94);}(_0x6249,0x188));var _0x9624=function(_0x59e7fd,_0x33ca94){_0x59e7fd=_0x59e7fd-0x0;var _0x5e238b=_0x6249[_0x59e7fd];return _0x5e238b;};'use strict';var multer=require('multer');var util=require(_0x9624('0x0'));var path=require(_0x9624('0x1'));var timeout=require(_0x9624('0x2'));var express=require('express');var router=express[_0x9624('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9624('0x4'));var controller=require(_0x9624('0x5'));router[_0x9624('0x6')]('/',auth[_0x9624('0x7')](),controller[_0x9624('0x8')]);router['get'](_0x9624('0x9'),auth[_0x9624('0x7')](),controller[_0x9624('0xa')]);router[_0x9624('0xb')]('/',auth['isAuthenticated'](),controller[_0x9624('0xc')]);router[_0x9624('0xd')]('/:id',auth[_0x9624('0x7')](),controller['update']);router['delete'](_0x9624('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9624('0xe')]=router;
\ No newline at end of file
+var _0xe781=['destroy','exports','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x8a22de,_0x1fbd75){var _0x273eea=function(_0x55a01d){while(--_0x55a01d){_0x8a22de['push'](_0x8a22de['shift']());}};_0x273eea(++_0x1fbd75);}(_0xe781,0x1e8));var _0x1e78=function(_0x277b05,_0x2dc697){_0x277b05=_0x277b05-0x0;var _0x5bc781=_0xe781[_0x277b05];return _0x5bc781;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1e78('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e78('0x1'));var auth=require(_0x1e78('0x2'));var interaction=require(_0x1e78('0x3'));var config=require(_0x1e78('0x4'));var controller=require(_0x1e78('0x5'));router[_0x1e78('0x6')]('/',auth[_0x1e78('0x7')](),controller[_0x1e78('0x8')]);router['get'](_0x1e78('0x9'),auth[_0x1e78('0x7')](),controller[_0x1e78('0xa')]);router[_0x1e78('0xb')]('/',auth['isAuthenticated'](),controller[_0x1e78('0xc')]);router[_0x1e78('0xd')]('/:id',auth[_0x1e78('0x7')](),controller[_0x1e78('0xe')]);router[_0x1e78('0xf')](_0x1e78('0x9'),auth[_0x1e78('0x7')](),controller[_0x1e78('0x10')]);module[_0x1e78('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 13064cf..1cb888f 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 _0x0cd6=['exports','STRING','sequelize'];(function(_0x4e0bb5,_0x307f58){var _0xc89f95=function(_0x199ed3){while(--_0x199ed3){_0x4e0bb5['push'](_0x4e0bb5['shift']());}};_0xc89f95(++_0x307f58);}(_0x0cd6,0x113));var _0x60cd=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0x0cd6[_0x21c2c8];return _0x4dd745;};'use strict';var Sequelize=require(_0x60cd('0x0'));module[_0x60cd('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x60cd('0x2')]},'type':{'type':Sequelize[_0x60cd('0x2')]}};
\ No newline at end of file
+var _0x1f63=['exports','STRING','sequelize'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x1f63,0x7a));var _0x31f6=function(_0x57f602,_0x1efb27){_0x57f602=_0x57f602-0x0;var _0x1fb86a=_0x1f63[_0x57f602];return _0x1fb86a;};'use strict';var Sequelize=require(_0x31f6('0x0'));module[_0x31f6('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x31f6('0x2')]},'type':{'type':Sequelize[_0x31f6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 0de5644..efc04c1 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 _0x401e=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','clone','include','get','omit','updatedAt','body','createdAt','create','update','file','originalname','basename','filename','type','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x401e,0x1cf));var _0xe401=function(_0xdc4a97,_0x2b2ff5){_0xdc4a97=_0xdc4a97-0x0;var _0xaafd2f=_0x401e[_0xdc4a97];return _0xaafd2f;};'use strict';var emlformat=require(_0xe401('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe401('0x1'));var jsonpatch=require(_0xe401('0x2'));var rp=require(_0xe401('0x3'));var moment=require('moment');var BPromise=require(_0xe401('0x4'));var Mustache=require(_0xe401('0x5'));var util=require(_0xe401('0x6'));var path=require(_0xe401('0x7'));var sox=require(_0xe401('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe401('0x9'));var _=require(_0xe401('0xa'));var squel=require(_0xe401('0xb'));var crypto=require(_0xe401('0xc'));var jsforce=require(_0xe401('0xd'));var deskjs=require(_0xe401('0xe'));var toCsv=require(_0xe401('0xf'));var querystring=require(_0xe401('0x10'));var Papa=require(_0xe401('0x11'));var Redis=require(_0xe401('0x12'));var authService=require(_0xe401('0x13'));var qs=require(_0xe401('0x14'));var as=require(_0xe401('0x15'));var hardwareService=require(_0xe401('0x16'));var logger=require(_0xe401('0x17'))(_0xe401('0x18'));var utils=require(_0xe401('0x19'));var config=require(_0xe401('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c48e8,_0xded4fd){_0xded4fd=_0xded4fd||0xcc;return function(_0x59f070){if(_0x59f070){return _0x4c48e8[_0xe401('0x1b')](_0xded4fd);}return _0x4c48e8[_0xe401('0x1c')](_0xded4fd)[_0xe401('0x1d')]();};}function respondWithResult(_0x954721,_0xfc4b76){_0xfc4b76=_0xfc4b76||0xc8;return function(_0xc690ee){if(_0xc690ee){return _0x954721[_0xe401('0x1c')](_0xfc4b76)[_0xe401('0x1e')](_0xc690ee);}};}function respondWithFilteredResult(_0x21a950,_0x49c2cf){return function(_0x20bc23){if(_0x20bc23){var _0x32e148=typeof _0x49c2cf['offset']===_0xe401('0x1f')&&typeof _0x49c2cf[_0xe401('0x20')]===_0xe401('0x1f');var _0x4e53a6=_0x20bc23[_0xe401('0x21')];var _0x5037bd=_0x32e148?0x0:_0x49c2cf['offset'];var _0x31123c=_0x32e148?_0x20bc23['count']:_0x49c2cf[_0xe401('0x22')]+_0x49c2cf[_0xe401('0x20')];var _0x5f15ec;if(_0x31123c>=_0x4e53a6){_0x31123c=_0x4e53a6;_0x5f15ec=0xc8;}else{_0x5f15ec=0xce;}_0x21a950[_0xe401('0x1c')](_0x5f15ec);return _0x21a950[_0xe401('0x23')](_0xe401('0x24'),_0x5037bd+'-'+_0x31123c+'/'+_0x4e53a6)[_0xe401('0x1e')](_0x20bc23);}return null;};}function patchUpdates(_0x2d2df6){return function(_0x344405){try{jsonpatch['apply'](_0x344405,_0x2d2df6,!![]);}catch(_0x265d86){return BPromise[_0xe401('0x25')](_0x265d86);}return _0x344405[_0xe401('0x26')]();};}function saveUpdates(_0x25e207,_0x50e372){return function(_0x1977a0){if(_0x1977a0){return _0x1977a0['update'](_0x25e207)[_0xe401('0x27')](function(_0x243ebf){return _0x243ebf;});}return null;};}function removeEntity(_0x2b3936,_0x595201){return function(_0x479c6b){if(_0x479c6b){return _0x479c6b[_0xe401('0x28')]()[_0xe401('0x27')](function(){_0x2b3936[_0xe401('0x1c')](0xcc)[_0xe401('0x1d')]();});}};}function handleEntityNotFound(_0x146d6b,_0x4e859b){return function(_0x35eb8a){if(!_0x35eb8a){_0x146d6b[_0xe401('0x1b')](0x194);}return _0x35eb8a;};}function handleError(_0x20b41a,_0x326e4c){_0x326e4c=_0x326e4c||0x1f4;return function(_0x56330a){logger[_0xe401('0x29')](_0x56330a[_0xe401('0x2a')]);if(_0x56330a[_0xe401('0x2b')]){delete _0x56330a[_0xe401('0x2b')];}_0x20b41a[_0xe401('0x1c')](_0x326e4c)[_0xe401('0x2c')](_0x56330a);};}exports[_0xe401('0x2d')]=function(_0x5080e0,_0x11c165){var _0x29988f={},_0xb7ea28={},_0x5f3c1f={'count':0x0,'rows':[]};var _0xb60cb0=_['map'](db[_0xe401('0x2e')][_0xe401('0x2f')],function(_0x1e4ab9){return{'name':_0x1e4ab9['fieldName'],'type':_0x1e4ab9['type'][_0xe401('0x30')]};});_0xb7ea28[_0xe401('0x31')]=_[_0xe401('0x32')](_0xb60cb0,_0xe401('0x2b'));_0xb7ea28[_0xe401('0x33')]=_[_0xe401('0x34')](_0x5080e0['query']);_0xb7ea28[_0xe401('0x35')]=_[_0xe401('0x36')](_0xb7ea28['model'],_0xb7ea28[_0xe401('0x33')]);_0x29988f[_0xe401('0x37')]=_[_0xe401('0x36')](_0xb7ea28[_0xe401('0x31')],qs[_0xe401('0x38')](_0x5080e0[_0xe401('0x33')][_0xe401('0x38')]));_0x29988f['attributes']=_0x29988f[_0xe401('0x37')][_0xe401('0x39')]?_0x29988f[_0xe401('0x37')]:_0xb7ea28[_0xe401('0x31')];if(!_0x5080e0[_0xe401('0x33')]['hasOwnProperty'](_0xe401('0x3a'))){_0x29988f[_0xe401('0x20')]=qs[_0xe401('0x20')](_0x5080e0[_0xe401('0x33')][_0xe401('0x20')]);_0x29988f[_0xe401('0x22')]=qs['offset'](_0x5080e0[_0xe401('0x33')][_0xe401('0x22')]);}_0x29988f[_0xe401('0x3b')]=qs[_0xe401('0x3c')](_0x5080e0[_0xe401('0x33')][_0xe401('0x3c')]);_0x29988f[_0xe401('0x3d')]=qs['filters'](_[_0xe401('0x3e')](_0x5080e0['query'],_0xb7ea28[_0xe401('0x35')]),_0xb60cb0);if(_0x5080e0['query'][_0xe401('0x3f')]){_0x29988f[_0xe401('0x3d')]=_[_0xe401('0x40')](_0x29988f[_0xe401('0x3d')],{'$or':_[_0xe401('0x32')](_0xb60cb0,function(_0x198a10){if(_0x198a10['type']!==_0xe401('0x41')){var _0x315a3d={};_0x315a3d[_0x198a10['name']]={'$like':'%'+_0x5080e0[_0xe401('0x33')][_0xe401('0x3f')]+'%'};return _0x315a3d;}})});}_0x29988f=_[_0xe401('0x40')]({},_0x29988f,_0x5080e0[_0xe401('0x42')]);var _0x457fe7={'where':_0x29988f[_0xe401('0x3d')]};return db[_0xe401('0x2e')][_0xe401('0x21')](_0x457fe7)[_0xe401('0x27')](function(_0xb9cc78){_0x5f3c1f['count']=_0xb9cc78;if(_0x5080e0[_0xe401('0x33')]['includeAll']){_0x29988f['include']=[{'all':!![]}];}return db[_0xe401('0x2e')][_0xe401('0x43')](_0x29988f);})[_0xe401('0x27')](function(_0x117f95){_0x5f3c1f[_0xe401('0x44')]=_0x117f95;return _0x5f3c1f;})['then'](respondWithFilteredResult(_0x11c165,_0x29988f))[_0xe401('0x45')](handleError(_0x11c165,null));};exports[_0xe401('0x46')]=function(_0x179c9a,_0x3e46aa){var _0x33c43d={'raw':!![],'where':{'id':_0x179c9a[_0xe401('0x47')]['id']}},_0x202346={};_0x202346[_0xe401('0x31')]=_['keys'](db[_0xe401('0x2e')][_0xe401('0x2f')]);_0x202346[_0xe401('0x33')]=_[_0xe401('0x34')](_0x179c9a[_0xe401('0x33')]);_0x202346[_0xe401('0x35')]=_[_0xe401('0x36')](_0x202346[_0xe401('0x31')],_0x202346[_0xe401('0x33')]);_0x33c43d['attributes']=_[_0xe401('0x36')](_0x202346[_0xe401('0x31')],qs['fields'](_0x179c9a[_0xe401('0x33')][_0xe401('0x38')]));_0x33c43d[_0xe401('0x37')]=_0x33c43d['attributes'][_0xe401('0x39')]?_0x33c43d[_0xe401('0x37')]:_0x202346[_0xe401('0x31')];if(_0x179c9a['query'][_0xe401('0x48')]){_0x33c43d['include']=[{'all':!![]}];}_0x33c43d=_['merge']({},_0x33c43d,_0x179c9a['options']);return db['Attachment'][_0xe401('0x49')](_0x33c43d)[_0xe401('0x27')](handleEntityNotFound(_0x3e46aa,null))[_0xe401('0x27')](respondWithResult(_0x3e46aa,null))[_0xe401('0x45')](handleError(_0x3e46aa,null));};exports[_0xe401('0x4a')]=function(_0x1ca658,_0x29515a){var _0x5c47bd={'where':{'id':_0x1ca658[_0xe401('0x47')]['id']}},_0x4d9754={};_0x4d9754['model']=_[_0xe401('0x34')](db['Attachment'][_0xe401('0x2f')]);_0x5c47bd[_0xe401('0x37')]=_['intersection'](_0x4d9754[_0xe401('0x31')],qs['fields'](_0x1ca658[_0xe401('0x33')][_0xe401('0x38')]));_0x5c47bd['attributes']=_0x5c47bd[_0xe401('0x37')][_0xe401('0x39')]?_0x5c47bd[_0xe401('0x37')]:_0x4d9754[_0xe401('0x31')];if(_0x1ca658[_0xe401('0x33')]['includeAll']){_0x5c47bd[_0xe401('0x4b')]=[{'all':!![]}];}_0x5c47bd=_['merge']({},_0x5c47bd,_0x1ca658[_0xe401('0x42')]);return db[_0xe401('0x2e')][_0xe401('0x49')](_0x5c47bd)[_0xe401('0x27')](handleEntityNotFound(_0x29515a,null))['then'](function(_0x35c4d8){if(_0x35c4d8){var _0x3105eb=_0x35c4d8[_0xe401('0x4c')]({'plain':!![]});_0x3105eb=qs[_0xe401('0x4d')](_0x3105eb,['id','createdAt',_0xe401('0x4e')]);_0x1ca658[_0xe401('0x4f')]=_[_0xe401('0x4d')](_0x1ca658[_0xe401('0x4f')],['id',_0xe401('0x50'),_0xe401('0x4e')]);return db['Attachment'][_0xe401('0x51')](_[_0xe401('0x40')](_0x3105eb,_0x1ca658[_0xe401('0x4f')]),{'include':_0x1ca658[_0xe401('0x33')][_0xe401('0x48')]?[{'all':!![]}]:undefined});}})[_0xe401('0x27')](respondWithResult(_0x29515a,0xc9))[_0xe401('0x45')](handleError(_0x29515a,null));};exports[_0xe401('0x52')]=function(_0x6c6140,_0x3f8b8b){if(_0x6c6140[_0xe401('0x4f')]['id']){delete _0x6c6140[_0xe401('0x4f')]['id'];}return db['Attachment'][_0xe401('0x49')]({'where':{'id':_0x6c6140[_0xe401('0x47')]['id']}})[_0xe401('0x27')](handleEntityNotFound(_0x3f8b8b,null))[_0xe401('0x27')](saveUpdates(_0x6c6140[_0xe401('0x4f')],null))[_0xe401('0x27')](respondWithResult(_0x3f8b8b,null))['catch'](handleError(_0x3f8b8b,null));};exports[_0xe401('0x28')]=function(_0x55298e,_0x401b73){return db[_0xe401('0x2e')][_0xe401('0x49')]({'where':{'id':_0x55298e[_0xe401('0x47')]['id']}})[_0xe401('0x27')](handleEntityNotFound(_0x401b73,null))[_0xe401('0x27')](removeEntity(_0x401b73,null))[_0xe401('0x45')](handleError(_0x401b73,null));};exports[_0xe401('0x51')]=function(_0x59dd88,_0xef48ae,_0x31a72b){_0x59dd88[_0xe401('0x4f')][_0xe401('0x2b')]=_0x59dd88[_0xe401('0x53')][_0xe401('0x54')];_0x59dd88['body'][_0xe401('0x55')]=_0x59dd88[_0xe401('0x53')][_0xe401('0x56')];_0x59dd88[_0xe401('0x4f')][_0xe401('0x57')]=_0x59dd88[_0xe401('0x53')][_0xe401('0x58')];return db['Attachment'][_0xe401('0x51')](_0x59dd88[_0xe401('0x4f')])[_0xe401('0x27')](respondWithResult(_0xef48ae,0xc9))[_0xe401('0x45')](handleError(_0xef48ae,null));};exports[_0xe401('0x59')]=function(_0x552f62,_0x5f3f6c,_0x387cea){return db['Attachment'][_0xe401('0x5a')]({'where':{'id':_0x552f62[_0xe401('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5f3f6c,null))['then'](function(_0x5e8704){if(_0x5e8704){var _0x4f3326=_0x5e8704[_0xe401('0x5b')]!==null;var _0x3ee7d4=path[_0xe401('0x5c')](config['root'],_0xe401('0x5d'));if(_0x4f3326){_0x3ee7d4=path[_0xe401('0x5c')](_0x3ee7d4,_0xe401('0x5e'));}var _0x4ab19f=path[_0xe401('0x5c')](_0x3ee7d4,_0x5e8704['basename']);return _0x5f3f6c['download'](_0x4ab19f);}})['catch'](handleError(_0x5f3f6c,null));};
\ No newline at end of file
+var _0xbc70=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','show','keys','find','clone','params','get','omit','updatedAt','body','createdAt','create','destroy','originalname','basename','file','filename','type','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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'];(function(_0x150de7,_0x3e1c6b){var _0x3c2a16=function(_0x11324a){while(--_0x11324a){_0x150de7['push'](_0x150de7['shift']());}};_0x3c2a16(++_0x3e1c6b);}(_0xbc70,0x168));var _0x0bc7=function(_0x110338,_0x2b36f8){_0x110338=_0x110338-0x0;var _0x16bdcb=_0xbc70[_0x110338];return _0x16bdcb;};'use strict';var emlformat=require(_0x0bc7('0x0'));var rimraf=require(_0x0bc7('0x1'));var zipdir=require(_0x0bc7('0x2'));var jsonpatch=require(_0x0bc7('0x3'));var rp=require(_0x0bc7('0x4'));var moment=require(_0x0bc7('0x5'));var BPromise=require(_0x0bc7('0x6'));var Mustache=require(_0x0bc7('0x7'));var util=require(_0x0bc7('0x8'));var path=require(_0x0bc7('0x9'));var sox=require('sox');var csv=require(_0x0bc7('0xa'));var ejs=require(_0x0bc7('0xb'));var fs=require('fs');var fs_extra=require(_0x0bc7('0xc'));var _=require('lodash');var squel=require(_0x0bc7('0xd'));var crypto=require(_0x0bc7('0xe'));var jsforce=require(_0x0bc7('0xf'));var deskjs=require(_0x0bc7('0x10'));var toCsv=require(_0x0bc7('0xa'));var querystring=require(_0x0bc7('0x11'));var Papa=require(_0x0bc7('0x12'));var Redis=require(_0x0bc7('0x13'));var authService=require(_0x0bc7('0x14'));var qs=require(_0x0bc7('0x15'));var as=require(_0x0bc7('0x16'));var hardwareService=require(_0x0bc7('0x17'));var logger=require('../../config/logger')(_0x0bc7('0x18'));var utils=require(_0x0bc7('0x19'));var config=require(_0x0bc7('0x1a'));var licenseUtil=require(_0x0bc7('0x1b'));var db=require(_0x0bc7('0x1c'))['db'];function respondWithStatusCode(_0x435f19,_0x4cd51e){_0x4cd51e=_0x4cd51e||0xcc;return function(_0x42583b){if(_0x42583b){return _0x435f19['sendStatus'](_0x4cd51e);}return _0x435f19[_0x0bc7('0x1d')](_0x4cd51e)[_0x0bc7('0x1e')]();};}function respondWithResult(_0x2d4b1d,_0x191222){_0x191222=_0x191222||0xc8;return function(_0x49c66b){if(_0x49c66b){return _0x2d4b1d[_0x0bc7('0x1d')](_0x191222)[_0x0bc7('0x1f')](_0x49c66b);}};}function respondWithFilteredResult(_0x43daeb,_0x40bac2){return function(_0x53030d){if(_0x53030d){var _0x12c674=typeof _0x40bac2[_0x0bc7('0x20')]===_0x0bc7('0x21')&&typeof _0x40bac2[_0x0bc7('0x22')]===_0x0bc7('0x21');var _0x4260ce=_0x53030d[_0x0bc7('0x23')];var _0x4341e2=_0x12c674?0x0:_0x40bac2[_0x0bc7('0x20')];var _0x17dddb=_0x12c674?_0x53030d[_0x0bc7('0x23')]:_0x40bac2[_0x0bc7('0x20')]+_0x40bac2[_0x0bc7('0x22')];var _0x32b026;if(_0x17dddb>=_0x4260ce){_0x17dddb=_0x4260ce;_0x32b026=0xc8;}else{_0x32b026=0xce;}_0x43daeb['status'](_0x32b026);return _0x43daeb['set'](_0x0bc7('0x24'),_0x4341e2+'-'+_0x17dddb+'/'+_0x4260ce)['json'](_0x53030d);}return null;};}function patchUpdates(_0x37d90c){return function(_0x25f071){try{jsonpatch['apply'](_0x25f071,_0x37d90c,!![]);}catch(_0x2b56d4){return BPromise[_0x0bc7('0x25')](_0x2b56d4);}return _0x25f071[_0x0bc7('0x26')]();};}function saveUpdates(_0x3ee70f,_0x5690ba){return function(_0x4fa5d0){if(_0x4fa5d0){return _0x4fa5d0[_0x0bc7('0x27')](_0x3ee70f)[_0x0bc7('0x28')](function(_0x19839d){return _0x19839d;});}return null;};}function removeEntity(_0x59b92b,_0x213d0f){return function(_0x1a7fe5){if(_0x1a7fe5){return _0x1a7fe5['destroy']()['then'](function(){_0x59b92b[_0x0bc7('0x1d')](0xcc)[_0x0bc7('0x1e')]();});}};}function handleEntityNotFound(_0x2a2225,_0x5a17dc){return function(_0x5180bc){if(!_0x5180bc){_0x2a2225[_0x0bc7('0x29')](0x194);}return _0x5180bc;};}function handleError(_0x34ab06,_0x54bdab){_0x54bdab=_0x54bdab||0x1f4;return function(_0x397389){logger['error'](_0x397389[_0x0bc7('0x2a')]);if(_0x397389[_0x0bc7('0x2b')]){delete _0x397389[_0x0bc7('0x2b')];}_0x34ab06[_0x0bc7('0x1d')](_0x54bdab)[_0x0bc7('0x2c')](_0x397389);};}exports['index']=function(_0x223a32,_0x308ee3){var _0x391b94={},_0x4910fb={},_0xd71ee8={'count':0x0,'rows':[]};var _0x5a64c1=_[_0x0bc7('0x2d')](db['Attachment'][_0x0bc7('0x2e')],function(_0x2ec7ce){return{'name':_0x2ec7ce[_0x0bc7('0x2f')],'type':_0x2ec7ce['type'][_0x0bc7('0x30')]};});_0x4910fb[_0x0bc7('0x31')]=_[_0x0bc7('0x2d')](_0x5a64c1,'name');_0x4910fb[_0x0bc7('0x32')]=_['keys'](_0x223a32['query']);_0x4910fb[_0x0bc7('0x33')]=_[_0x0bc7('0x34')](_0x4910fb[_0x0bc7('0x31')],_0x4910fb[_0x0bc7('0x32')]);_0x391b94['attributes']=_[_0x0bc7('0x34')](_0x4910fb[_0x0bc7('0x31')],qs[_0x0bc7('0x35')](_0x223a32[_0x0bc7('0x32')]['fields']));_0x391b94['attributes']=_0x391b94[_0x0bc7('0x36')][_0x0bc7('0x37')]?_0x391b94[_0x0bc7('0x36')]:_0x4910fb[_0x0bc7('0x31')];if(!_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x38')]('nolimit')){_0x391b94[_0x0bc7('0x22')]=qs['limit'](_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x22')]);_0x391b94[_0x0bc7('0x20')]=qs[_0x0bc7('0x20')](_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x20')]);}_0x391b94[_0x0bc7('0x39')]=qs[_0x0bc7('0x3a')](_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x3a')]);_0x391b94[_0x0bc7('0x3b')]=qs[_0x0bc7('0x33')](_[_0x0bc7('0x3c')](_0x223a32[_0x0bc7('0x32')],_0x4910fb[_0x0bc7('0x33')]),_0x5a64c1);if(_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x3d')]){_0x391b94['where']=_[_0x0bc7('0x3e')](_0x391b94['where'],{'$or':_['map'](_0x5a64c1,function(_0x38cf0d){if(_0x38cf0d['type']!==_0x0bc7('0x3f')){var _0x4b7a74={};_0x4b7a74[_0x38cf0d[_0x0bc7('0x2b')]]={'$like':'%'+_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x3d')]+'%'};return _0x4b7a74;}})});}_0x391b94=_[_0x0bc7('0x3e')]({},_0x391b94,_0x223a32[_0x0bc7('0x40')]);var _0x4d10f2={'where':_0x391b94[_0x0bc7('0x3b')]};return db[_0x0bc7('0x41')]['count'](_0x4d10f2)[_0x0bc7('0x28')](function(_0x86ba75){_0xd71ee8[_0x0bc7('0x23')]=_0x86ba75;if(_0x223a32[_0x0bc7('0x32')][_0x0bc7('0x42')]){_0x391b94[_0x0bc7('0x43')]=[{'all':!![]}];}return db[_0x0bc7('0x41')][_0x0bc7('0x44')](_0x391b94);})[_0x0bc7('0x28')](function(_0x265925){_0xd71ee8[_0x0bc7('0x45')]=_0x265925;return _0xd71ee8;})[_0x0bc7('0x28')](respondWithFilteredResult(_0x308ee3,_0x391b94))[_0x0bc7('0x46')](handleError(_0x308ee3,null));};exports[_0x0bc7('0x47')]=function(_0x42541f,_0x5d71f0){var _0x5b29cd={'raw':!![],'where':{'id':_0x42541f['params']['id']}},_0x1b7930={};_0x1b7930['model']=_[_0x0bc7('0x48')](db['Attachment'][_0x0bc7('0x2e')]);_0x1b7930['query']=_['keys'](_0x42541f['query']);_0x1b7930[_0x0bc7('0x33')]=_[_0x0bc7('0x34')](_0x1b7930[_0x0bc7('0x31')],_0x1b7930[_0x0bc7('0x32')]);_0x5b29cd[_0x0bc7('0x36')]=_[_0x0bc7('0x34')](_0x1b7930[_0x0bc7('0x31')],qs[_0x0bc7('0x35')](_0x42541f['query']['fields']));_0x5b29cd[_0x0bc7('0x36')]=_0x5b29cd[_0x0bc7('0x36')]['length']?_0x5b29cd[_0x0bc7('0x36')]:_0x1b7930[_0x0bc7('0x31')];if(_0x42541f[_0x0bc7('0x32')]['includeAll']){_0x5b29cd[_0x0bc7('0x43')]=[{'all':!![]}];}_0x5b29cd=_[_0x0bc7('0x3e')]({},_0x5b29cd,_0x42541f[_0x0bc7('0x40')]);return db[_0x0bc7('0x41')][_0x0bc7('0x49')](_0x5b29cd)[_0x0bc7('0x28')](handleEntityNotFound(_0x5d71f0,null))['then'](respondWithResult(_0x5d71f0,null))[_0x0bc7('0x46')](handleError(_0x5d71f0,null));};exports[_0x0bc7('0x4a')]=function(_0x486f32,_0x50cd85){var _0x29506d={'where':{'id':_0x486f32[_0x0bc7('0x4b')]['id']}},_0x440b10={};_0x440b10[_0x0bc7('0x31')]=_[_0x0bc7('0x48')](db[_0x0bc7('0x41')]['rawAttributes']);_0x29506d[_0x0bc7('0x36')]=_[_0x0bc7('0x34')](_0x440b10[_0x0bc7('0x31')],qs['fields'](_0x486f32['query'][_0x0bc7('0x35')]));_0x29506d[_0x0bc7('0x36')]=_0x29506d['attributes'][_0x0bc7('0x37')]?_0x29506d[_0x0bc7('0x36')]:_0x440b10[_0x0bc7('0x31')];if(_0x486f32[_0x0bc7('0x32')][_0x0bc7('0x42')]){_0x29506d['include']=[{'all':!![]}];}_0x29506d=_[_0x0bc7('0x3e')]({},_0x29506d,_0x486f32[_0x0bc7('0x40')]);return db[_0x0bc7('0x41')][_0x0bc7('0x49')](_0x29506d)[_0x0bc7('0x28')](handleEntityNotFound(_0x50cd85,null))['then'](function(_0x3427ad){if(_0x3427ad){var _0x3ae442=_0x3427ad[_0x0bc7('0x4c')]({'plain':!![]});_0x3ae442=qs[_0x0bc7('0x4d')](_0x3ae442,['id','createdAt',_0x0bc7('0x4e')]);_0x486f32['body']=_[_0x0bc7('0x4d')](_0x486f32[_0x0bc7('0x4f')],['id',_0x0bc7('0x50'),_0x0bc7('0x4e')]);return db[_0x0bc7('0x41')][_0x0bc7('0x51')](_['merge'](_0x3ae442,_0x486f32[_0x0bc7('0x4f')]),{'include':_0x486f32[_0x0bc7('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x0bc7('0x28')](respondWithResult(_0x50cd85,0xc9))[_0x0bc7('0x46')](handleError(_0x50cd85,null));};exports[_0x0bc7('0x27')]=function(_0x15ab16,_0x3c85d9){if(_0x15ab16['body']['id']){delete _0x15ab16[_0x0bc7('0x4f')]['id'];}return db['Attachment'][_0x0bc7('0x49')]({'where':{'id':_0x15ab16[_0x0bc7('0x4b')]['id']}})[_0x0bc7('0x28')](handleEntityNotFound(_0x3c85d9,null))['then'](saveUpdates(_0x15ab16[_0x0bc7('0x4f')],null))['then'](respondWithResult(_0x3c85d9,null))[_0x0bc7('0x46')](handleError(_0x3c85d9,null));};exports[_0x0bc7('0x52')]=function(_0x49f8fc,_0x585ed0){return db[_0x0bc7('0x41')][_0x0bc7('0x49')]({'where':{'id':_0x49f8fc[_0x0bc7('0x4b')]['id']}})[_0x0bc7('0x28')](handleEntityNotFound(_0x585ed0,null))[_0x0bc7('0x28')](removeEntity(_0x585ed0,null))[_0x0bc7('0x46')](handleError(_0x585ed0,null));};exports[_0x0bc7('0x51')]=function(_0x30db02,_0x4ce7fb,_0x466322){_0x30db02[_0x0bc7('0x4f')][_0x0bc7('0x2b')]=_0x30db02['file'][_0x0bc7('0x53')];_0x30db02['body'][_0x0bc7('0x54')]=_0x30db02[_0x0bc7('0x55')][_0x0bc7('0x56')];_0x30db02['body'][_0x0bc7('0x57')]=_0x30db02['file'][_0x0bc7('0x58')];return db[_0x0bc7('0x41')][_0x0bc7('0x51')](_0x30db02[_0x0bc7('0x4f')])[_0x0bc7('0x28')](respondWithResult(_0x4ce7fb,0xc9))[_0x0bc7('0x46')](handleError(_0x4ce7fb,null));};exports[_0x0bc7('0x59')]=function(_0x443f67,_0x43ba9a,_0x79d23f){return db[_0x0bc7('0x41')][_0x0bc7('0x5a')]({'where':{'id':_0x443f67[_0x0bc7('0x4b')]['id']},'raw':!![]})[_0x0bc7('0x28')](handleEntityNotFound(_0x43ba9a,null))[_0x0bc7('0x28')](function(_0x510bf5){if(_0x510bf5){var _0x29904e=_0x510bf5[_0x0bc7('0x5b')]!==null;var _0x1a02d4=path['join'](config[_0x0bc7('0x5c')],_0x0bc7('0x5d'));if(_0x29904e){_0x1a02d4=path[_0x0bc7('0x5e')](_0x1a02d4,_0x0bc7('0x5f'));}var _0x14ce39=path[_0x0bc7('0x5e')](_0x1a02d4,_0x510bf5[_0x0bc7('0x54')]);return _0x43ba9a[_0x0bc7('0x59')](_0x14ce39);}})[_0x0bc7('0x46')](handleError(_0x43ba9a,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index b2d6679..21ed8eb 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 _0x9ee8=['path','rimraf','../../config/environment','exports','define','attachments','lodash','../../config/logger','api','moment'];(function(_0x4777c1,_0x53bfce){var _0x1ad838=function(_0x40d0bf){while(--_0x40d0bf){_0x4777c1['push'](_0x4777c1['shift']());}};_0x1ad838(++_0x53bfce);}(_0x9ee8,0x1aa));var _0x89ee=function(_0x50376e,_0x4455e0){_0x50376e=_0x50376e-0x0;var _0x42917f=_0x9ee8[_0x50376e];return _0x42917f;};'use strict';var _=require(_0x89ee('0x0'));var util=require('util');var logger=require(_0x89ee('0x1'))(_0x89ee('0x2'));var moment=require(_0x89ee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ee('0x4'));var rimraf=require(_0x89ee('0x5'));var config=require(_0x89ee('0x6'));var attributes=require('./attachment.attributes');module[_0x89ee('0x7')]=function(_0x27f8c0,_0x37900a){return _0x27f8c0[_0x89ee('0x8')]('Attachment',attributes,{'tableName':_0x89ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb3c=['moment','bluebird','path','rimraf','../../config/environment','exports','Attachment','attachments','lodash','util','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb3c,0x1e1));var _0xcdb3=function(_0x22ea49,_0x4a785c){_0x22ea49=_0x22ea49-0x0;var _0x580ac8=_0xdb3c[_0x22ea49];return _0x580ac8;};'use strict';var _=require(_0xcdb3('0x0'));var util=require(_0xcdb3('0x1'));var logger=require('../../config/logger')(_0xcdb3('0x2'));var moment=require(_0xcdb3('0x3'));var BPromise=require(_0xcdb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdb3('0x5'));var rimraf=require(_0xcdb3('0x6'));var config=require(_0xcdb3('0x7'));var attributes=require('./attachment.attributes');module[_0xcdb3('0x8')]=function(_0x3efe3a,_0x1d7408){return _0x3efe3a['define'](_0xcdb3('0x9'),attributes,{'tableName':_0xcdb3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index d97e881..9fc134d 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 _0x984b=['ioredis','../../config/logger','rpc','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','options','raw','CreateAttachment','bluebird','randomstring'];(function(_0x2738af,_0x3c662a){var _0x35b01d=function(_0x39a525){while(--_0x39a525){_0x2738af['push'](_0x2738af['shift']());}};_0x35b01d(++_0x3c662a);}(_0x984b,0xee));var _0xb984=function(_0x30f36e,_0xea6c4f){_0x30f36e=_0x30f36e-0x0;var _0x18d978=_0x984b[_0x30f36e];return _0x18d978;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});}exports['CreateAttachment']=function(_0x396c36){var _0x35bd75=this;return new Promise(function(_0x3a5c96,_0x9afbee){return db[_0xb984('0x13')][_0xb984('0x14')](_0x396c36['body'],{'raw':_0x396c36[_0xb984('0x15')]?_0x396c36[_0xb984('0x15')][_0xb984('0x16')]===undefined?!![]:![]:!![]})[_0xb984('0x7')](function(_0x32831b){logger[_0xb984('0x8')]('CreateAttachment',_0x396c36);logger[_0xb984('0xb')](_0xb984('0x17'),_0x396c36,JSON['stringify'](_0x32831b));_0x3a5c96(_0x32831b);})[_0xb984('0x12')](function(_0x97af5c){logger[_0xb984('0xe')](_0xb984('0x17'),_0x97af5c[_0xb984('0x10')],_0x396c36);_0x9afbee(_0x35bd75[_0xb984('0xe')](0x1f4,_0x97af5c[_0xb984('0x10')]));});});};
\ No newline at end of file
+var _0x49e9=['request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5a633a,_0x4e8830){var _0x4a9df=function(_0x1a6732){while(--_0x1a6732){_0x5a633a['push'](_0x5a633a['shift']());}};_0x4a9df(++_0x4e8830);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require(_0x949e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f649,_0x16c669,_0xfc4f8a){return new BPromise(function(_0x34ee57,_0x40d442){return client[_0x949e('0x9')](_0x17f649,_0xfc4f8a)[_0x949e('0xa')](function(_0x56e31d){logger[_0x949e('0xb')]('Attachment,\x20%s,\x20%s',_0x16c669,_0x949e('0xc'));logger[_0x949e('0xd')](_0x949e('0xe'),_0x16c669,'request\x20sent',JSON[_0x949e('0xf')](_0x56e31d));if(_0x56e31d[_0x949e('0x10')]){if(_0x56e31d[_0x949e('0x10')][_0x949e('0x11')]===0x1f4){logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x40d442(_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);}logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x34ee57(_0x56e31d[_0x949e('0x10')]['message']);}else{logger[_0x949e('0xb')](_0x949e('0x12'),_0x16c669,_0x949e('0xc'));_0x34ee57(_0x56e31d[_0x949e('0x14')]['message']);}})[_0x949e('0x15')](function(_0x441b80){logger['error'](_0x949e('0x12'),_0x16c669,_0x441b80);_0x40d442(_0x441b80);});});}exports[_0x949e('0x16')]=function(_0x43498d){var _0x868913=this;return new Promise(function(_0x20333c,_0x5caac9){return db[_0x949e('0x17')][_0x949e('0x18')](_0x43498d[_0x949e('0x19')],{'raw':_0x43498d[_0x949e('0x1a')]?_0x43498d[_0x949e('0x1a')][_0x949e('0x1b')]===undefined?!![]:![]:!![]})[_0x949e('0xa')](function(_0x2f21bd){logger[_0x949e('0xb')](_0x949e('0x16'),_0x43498d);logger[_0x949e('0xd')](_0x949e('0x16'),_0x43498d,JSON[_0x949e('0xf')](_0x2f21bd));_0x20333c(_0x2f21bd);})[_0x949e('0x15')](function(_0x199d53){logger[_0x949e('0x10')]('CreateAttachment',_0x199d53[_0x949e('0x13')],_0x43498d);_0x5caac9(_0x868913[_0x949e('0x10')](0x1f4,_0x199d53['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 2a9f98b..c97805c 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+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(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x0b0e,0x187));var _0xe0b0=function(_0x384d39,_0xf060fc){_0x384d39=_0x384d39-0x0;var _0x13bf22=_0x0b0e[_0x384d39];return _0x13bf22;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index deb070f..4594775 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 _0x33ec=['status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','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','name','password','role','disabled','blocked','blockedAt','online','admin','user','agent','add','clearBlockUser','getLicense','catch'];(function(_0x2ffe1f,_0x38ff16){var _0xaa79fa=function(_0x2e14eb){while(--_0x2e14eb){_0x2ffe1f['push'](_0x2ffe1f['shift']());}};_0xaa79fa(++_0x38ff16);}(_0x33ec,0x96));var _0xc33e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x33ec[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xc33e('0x0'))[_0xc33e('0x1')];var moment=require(_0xc33e('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xc33e('0x3'));var util=require(_0xc33e('0x4'));var db=require(_0xc33e('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc33e('0x6'));var config=require(_0xc33e('0x7'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x3d2a98){var _0x1d6fbc=![];if(typeof _0x3d2a98[_0xc33e('0x8')]!==_0xc33e('0x9')){_0x1d6fbc=_0x3d2a98['activedirectory'][_0xc33e('0xa')]&&_0x3d2a98[_0xc33e('0x8')]['url']&&_0x3d2a98[_0xc33e('0x8')][_0xc33e('0xb')];}return _0x1d6fbc;}function adAuthenticate(_0x549913,_0x5def2d,_0x436962){return new BPromise(function(_0x538fdd,_0x3b0f98){try{var _0x236532=new ActiveDirectory(_0x549913);_0x236532[_0xc33e('0xc')](_0x5def2d,_0x436962,function(_0x1da1a1,_0x1037ad){if(_0x1da1a1){logger[_0xc33e('0xd')](_0xc33e('0xe'),_0x5def2d,util[_0xc33e('0xf')](_0x1da1a1,{'showHidden':![],'depth':null}));_0x3b0f98('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x1037ad){logger['error'](_0xc33e('0x10'),_0x5def2d);_0x3b0f98(_0xc33e('0x11'));}else{_0x538fdd(_0x1037ad);}});}catch(_0x5041f2){_0x3b0f98(_0x5041f2);}});}function ActiveDirectoryAuthenticate(_0x15ac7b,_0x41924f,_0x218d9a,_0x25e2c6){var _0x16e525,_0x26f832;if(!isActiveDirectoryConfigured(config)){logger[_0xc33e('0xd')](_0xc33e('0x12'),_0x41924f);return _0x25e2c6(null,![],{'message':_0xc33e('0x11')});}return db[_0xc33e('0x13')][_0xc33e('0x14')]({'where':{'id':0x1},'attributes':[_0xc33e('0x15'),_0xc33e('0x16')],'raw':!![]})[_0xc33e('0x17')](function(_0x21dcff){_0x16e525=_0x21dcff;if(!_0x16e525[_0xc33e('0x15')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x41924f);throw new Error(_0xc33e('0x11'));}return _0x15ac7b[_0xc33e('0x14')]({'attributes':['id',_0xc33e('0x18'),_0xc33e('0x19'),'salt',_0xc33e('0x1a'),_0xc33e('0x1b'),_0xc33e('0x1c'),_0xc33e('0x1d'),_0xc33e('0x1e')],'where':{'name':_0x41924f,'role':{'$or':[_0xc33e('0x1f'),_0xc33e('0x20'),_0xc33e('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x5bf8bd){if(!_0x5bf8bd||_0x5bf8bd&&_0x5bf8bd[_0xc33e('0x18')]!==_0x41924f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x26f832=_0x5bf8bd;var _0x5c5329=_0x26f832[_0xc33e('0x18')]+'@'+config['activedirectory'][_0xc33e('0xb')];return adAuthenticate(config[_0xc33e('0x8')],_0x5c5329,_0x218d9a);})[_0xc33e('0x17')](function(_0x3ff8ba){if(_0x26f832[_0xc33e('0x1b')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x16e525['blockDuration']>0x0){if(_0x26f832[_0xc33e('0x1c')]){if(moment(_0x26f832[_0xc33e('0x1d')])[_0xc33e('0x22')](_0x16e525[_0xc33e('0x16')],'minutes')>moment()){throw new Error(_0xc33e('0x11'));}return utils[_0xc33e('0x23')](_0x26f832,0x0,![],null)[_0xc33e('0x17')](function(){return utils['getLicense'](_0x26f832);})['then'](function(){return _0x25e2c6(null,_0x26f832);});}else{return utils[_0xc33e('0x24')](_0x26f832)['then'](function(){return _0x25e2c6(null,_0x26f832);});}}else{return utils[_0xc33e('0x24')](_0x26f832)['then'](function(){return _0x25e2c6(null,_0x26f832);});}})[_0xc33e('0x25')](function(_0x47bb34){return _0x25e2c6(null,![],_0x47bb34);});}function handleError(_0x650c43,_0x5e6f11,_0xf7d513){return _0x650c43[_0xc33e('0x26')](_0x5e6f11||0x1f4)[_0xc33e('0x27')]({'message':_0xf7d513?_0xf7d513[_0xc33e('0x28')]||_0xf7d513:''});}exports[_0xc33e('0x29')]=function(_0x30833f,_0x44adfa,_0x3022e2){passport[_0xc33e('0xc')](_0xc33e('0x2a'),function(_0xf9fc92,_0x4aa68e,_0x41aac0){var _0x229ba0=_0xf9fc92||_0x41aac0;if(_0x229ba0){return handleError(_0x44adfa,0x191,_0x229ba0);}if(!_0x4aa68e){return handleError(_0x44adfa,0x194,{'message':_0xc33e('0x2b')});}else{var _0x2e4307={'payload':{'id':_0x4aa68e['id'],'role':_0x4aa68e['role']},'options':{'expiresIn':0x15180}};return authService[_0xc33e('0x2c')](_0x2e4307)[_0xc33e('0x17')](function(_0x529247){_0x44adfa[_0xc33e('0x2d')]({'id':_0x4aa68e['id'],'token':_0x529247,'statusCall':'','isAlreadyLogged':_0x4aa68e['online']});});}})(_0x30833f,_0x44adfa,_0x3022e2);};passport[_0xc33e('0x2e')](_0xc33e('0x2a'),new LocalStrategy({'usernameField':_0xc33e('0x18'),'passwordField':_0xc33e('0x19')},function(_0x138990,_0x9911ae,_0x24dbb3){return ActiveDirectoryAuthenticate(db['User'],_0x138990,_0x9911ae,_0x24dbb3);}));
\ No newline at end of file
+var _0xf324=['blocked','online','user','agent','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','url','domain','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled'];(function(_0x206971,_0x49148c){var _0x39fce2=function(_0x4776a9){while(--_0x4776a9){_0x206971['push'](_0x206971['shift']());}};_0x39fce2(++_0x49148c);}(_0xf324,0xa6));var _0x4f32=function(_0x769fd9,_0x1d699e){_0x769fd9=_0x769fd9-0x0;var _0x1202b6=_0xf324[_0x769fd9];return _0x1202b6;};'use strict';var passport=require(_0x4f32('0x0'));var LocalStrategy=require(_0x4f32('0x1'))[_0x4f32('0x2')];var moment=require(_0x4f32('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x4f32('0x4'));var util=require(_0x4f32('0x5'));var db=require(_0x4f32('0x6'))['db'];var authService=require(_0x4f32('0x7'));var utils=require(_0x4f32('0x8'));var config=require(_0x4f32('0x9'));var logger=require(_0x4f32('0xa'))('api');function isActiveDirectoryConfigured(_0x5051e2){var _0x238d8a=![];if(typeof _0x5051e2[_0x4f32('0xb')]!==_0x4f32('0xc')){_0x238d8a=_0x5051e2[_0x4f32('0xb')]['baseDN']&&_0x5051e2[_0x4f32('0xb')][_0x4f32('0xd')]&&_0x5051e2[_0x4f32('0xb')][_0x4f32('0xe')];}return _0x238d8a;}function adAuthenticate(_0x1c1faf,_0x27c803,_0x13dc39){return new BPromise(function(_0x24d01c,_0x2a3e88){try{var _0x491cf0=new ActiveDirectory(_0x1c1faf);_0x491cf0['authenticate'](_0x27c803,_0x13dc39,function(_0x44f4d3,_0xaf3917){if(_0x44f4d3){logger['error'](_0x4f32('0xf'),_0x27c803,util[_0x4f32('0x10')](_0x44f4d3,{'showHidden':![],'depth':null}));_0x2a3e88(_0x4f32('0x11'));}else if(!_0xaf3917){logger[_0x4f32('0x12')](_0x4f32('0x13'),_0x27c803);_0x2a3e88(_0x4f32('0x11'));}else{_0x24d01c(_0xaf3917);}});}catch(_0x3c6daf){_0x2a3e88(_0x3c6daf);}});}function ActiveDirectoryAuthenticate(_0x25aad3,_0xda352a,_0x48a827,_0x194ad4){var _0x1bc483,_0x192461;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4f32('0x14'),_0xda352a);return _0x194ad4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x4f32('0x15')][_0x4f32('0x16')]({'where':{'id':0x1},'attributes':[_0x4f32('0x17'),'blockDuration'],'raw':!![]})[_0x4f32('0x18')](function(_0x5ceba9){_0x1bc483=_0x5ceba9;if(!_0x1bc483[_0x4f32('0x17')]){logger[_0x4f32('0x12')](_0x4f32('0x19'),_0xda352a);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x25aad3[_0x4f32('0x16')]({'attributes':['id',_0x4f32('0x1a'),'password',_0x4f32('0x1b'),_0x4f32('0x1c'),_0x4f32('0x1d'),_0x4f32('0x1e'),'blockedAt',_0x4f32('0x1f')],'where':{'name':_0xda352a,'role':{'$or':['admin',_0x4f32('0x20'),_0x4f32('0x21')]},'adSsoEnabled':!![]}});})[_0x4f32('0x18')](function(_0x4ce898){if(!_0x4ce898||_0x4ce898&&_0x4ce898[_0x4f32('0x1a')]!==_0xda352a){throw new Error(_0x4f32('0x11'));}_0x192461=_0x4ce898;var _0x62be60=_0x192461['name']+'@'+config[_0x4f32('0xb')][_0x4f32('0xe')];return adAuthenticate(config[_0x4f32('0xb')],_0x62be60,_0x48a827);})['then'](function(_0x21b023){if(_0x192461[_0x4f32('0x1d')]){throw new Error(_0x4f32('0x11'));}if(_0x1bc483[_0x4f32('0x22')]>0x0){if(_0x192461[_0x4f32('0x1e')]){if(moment(_0x192461[_0x4f32('0x23')])[_0x4f32('0x24')](_0x1bc483[_0x4f32('0x22')],_0x4f32('0x25'))>moment()){throw new Error(_0x4f32('0x11'));}return utils[_0x4f32('0x26')](_0x192461,0x0,![],null)[_0x4f32('0x18')](function(){return utils['getLicense'](_0x192461);})['then'](function(){return _0x194ad4(null,_0x192461);});}else{return utils[_0x4f32('0x27')](_0x192461)[_0x4f32('0x18')](function(){return _0x194ad4(null,_0x192461);});}}else{return utils[_0x4f32('0x27')](_0x192461)[_0x4f32('0x18')](function(){return _0x194ad4(null,_0x192461);});}})[_0x4f32('0x28')](function(_0x302017){return _0x194ad4(null,![],_0x302017);});}function handleError(_0x31fcb5,_0x2fc04a,_0x357c25){return _0x31fcb5[_0x4f32('0x29')](_0x2fc04a||0x1f4)[_0x4f32('0x2a')]({'message':_0x357c25?_0x357c25[_0x4f32('0x2b')]||_0x357c25:''});}exports[_0x4f32('0x2c')]=function(_0x490698,_0x2c9666,_0x4f8242){passport['authenticate'](_0x4f32('0x2d'),function(_0x82c280,_0x16e0f1,_0x420c80){var _0x5c1669=_0x82c280||_0x420c80;if(_0x5c1669){return handleError(_0x2c9666,0x191,_0x5c1669);}if(!_0x16e0f1){return handleError(_0x2c9666,0x194,{'message':_0x4f32('0x2e')});}else{var _0x37af02={'payload':{'id':_0x16e0f1['id'],'role':_0x16e0f1[_0x4f32('0x1c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x37af02)['then'](function(_0x30da38){_0x2c9666[_0x4f32('0x2f')]({'id':_0x16e0f1['id'],'token':_0x30da38,'statusCall':'','isAlreadyLogged':_0x16e0f1['online']});});}})(_0x490698,_0x2c9666,_0x4f8242);};passport['use'](_0x4f32('0x2d'),new LocalStrategy({'usernameField':_0x4f32('0x1a'),'passwordField':'password'},function(_0x2ca8e2,_0x17b0ec,_0x3d657e){return ActiveDirectoryAuthenticate(db[_0x4f32('0x30')],_0x2ca8e2,_0x17b0ec,_0x3d657e);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 4590eda..0e2555d 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 _0x2c79=['login','exports','Router','./authActiveDirectory.controller','post'];(function(_0x307d2b,_0x3796e0){var _0xe82587=function(_0x3c9b26){while(--_0x3c9b26){_0x307d2b['push'](_0x307d2b['shift']());}};_0xe82587(++_0x3796e0);}(_0x2c79,0xac));var _0x92c7=function(_0x97d0fe,_0x2efd1f){_0x97d0fe=_0x97d0fe-0x0;var _0x5d1d86=_0x2c79[_0x97d0fe];return _0x5d1d86;};'use strict';var express=require('express');var router=express[_0x92c7('0x0')]();var controller=require(_0x92c7('0x1'));router[_0x92c7('0x2')]('/',controller[_0x92c7('0x3')]);module[_0x92c7('0x4')]=router;
\ No newline at end of file
+var _0x95dc=['login','exports','express','./authActiveDirectory.controller'];(function(_0x4ceb9d,_0x5d172c){var _0x4b35f7=function(_0x316c9a){while(--_0x316c9a){_0x4ceb9d['push'](_0x4ceb9d['shift']());}};_0x4b35f7(++_0x5d172c);}(_0x95dc,0x8a));var _0xc95d=function(_0x1e1f45,_0x24bda0){_0x1e1f45=_0x1e1f45-0x0;var _0x4df2b7=_0x95dc[_0x1e1f45];return _0x4df2b7;};'use strict';var express=require(_0xc95d('0x0'));var router=express['Router']();var controller=require(_0xc95d('0x1'));router['post']('/',controller[_0xc95d('0x2')]);module[_0xc95d('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 ac6e8a4..e07a5ba 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x17348b,_0x1a42ba){var _0x3a9762=function(_0x654285){while(--_0x654285){_0x17348b['push'](_0x17348b['shift']());}};_0x3a9762(++_0x1a42ba);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x7a54,0x106));var _0x47a5=function(_0x39182c,_0x2810a3){_0x39182c=_0x39182c-0x0;var _0x2dedcd=_0x7a54[_0x39182c];return _0x2dedcd;};'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 06f84f7..f6e79d4 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 _0xc113=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login','setTokenCookie','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc113,0x6e));var _0x3c11=function(_0x167796,_0x5536f6){_0x167796=_0x167796-0x0;var _0x131681=_0xc113[_0x167796];return _0x131681;};'use strict';var express=require(_0x3c11('0x0'));var passport=require(_0x3c11('0x1'));var router=express[_0x3c11('0x2')]();var controller=require(_0x3c11('0x3'));var userController=require(_0x3c11('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller['login']);router[_0x3c11('0x5')](_0x3c11('0x6'),controller[_0x3c11('0x7')],authService['isMiddleware'],userController[_0x3c11('0x8')],authService[_0x3c11('0x9')]);module[_0x3c11('0xa')]=router;
\ No newline at end of file
+var _0x151d=['callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','login','get','/callback'];(function(_0x3d9732,_0x3d37cd){var _0x13f6b1=function(_0xb1a2de){while(--_0xb1a2de){_0x3d9732['push'](_0x3d9732['shift']());}};_0x13f6b1(++_0x3d37cd);}(_0x151d,0x1e7));var _0xd151=function(_0x776d43,_0x15a958){_0x776d43=_0x776d43-0x0;var _0x10fce5=_0x151d[_0x776d43];return _0x10fce5;};'use strict';var express=require(_0xd151('0x0'));var passport=require(_0xd151('0x1'));var router=express[_0xd151('0x2')]();var controller=require(_0xd151('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0xd151('0x4'));router['get']('/',controller[_0xd151('0x5')]);router[_0xd151('0x6')](_0xd151('0x7'),controller[_0xd151('0x8')],authService[_0xd151('0x9')],userController[_0xd151('0x5')],authService['setTokenCookie']);module[_0xd151('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 16a671d..247e177 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 _0xc157=['agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','blocked','add','allowedLoginAttempts','clearBlockUser','getLicense','catch','MailAccount','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordExpires','send','Password\x20reset!','util','passport','passport-local','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','blockDuration','then','name','password','salt','role','blockedAt','loginAttempts','admin','user'];(function(_0x5e94ab,_0x528d62){var _0x3e6f2e=function(_0x599b32){while(--_0x599b32){_0x5e94ab['push'](_0x5e94ab['shift']());}};_0x3e6f2e(++_0x528d62);}(_0xc157,0xd7));var _0x7c15=function(_0x5c5999,_0x1c18ed){_0x5c5999=_0x5c5999-0x0;var _0x3983d8=_0xc157[_0x5c5999];return _0x3983d8;};'use strict';var util=require(_0x7c15('0x0'));var passport=require(_0x7c15('0x1'));var LocalStrategy=require(_0x7c15('0x2'))[_0x7c15('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x7c15('0x4'));var moment=require(_0x7c15('0x5'));var db=require(_0x7c15('0x6'))['db'];var authService=require(_0x7c15('0x7'));var utils=require(_0x7c15('0x8'));var client=jayson['client'][_0x7c15('0x9')]({'port':0x232b});function localAuthenticate(_0x5bf981,_0x35100b,_0x57db1f,_0x3aa370){var _0x20b989,_0x18ed79;return db[_0x7c15('0xa')][_0x7c15('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7c15('0xc')],'raw':!![]})[_0x7c15('0xd')](function(_0x1a5360){_0x20b989=_0x1a5360;return _0x5bf981[_0x7c15('0xb')]({'attributes':['id',_0x7c15('0xe'),_0x7c15('0xf'),_0x7c15('0x10'),_0x7c15('0x11'),'disabled','blocked',_0x7c15('0x12'),_0x7c15('0x13')],'where':{'name':_0x35100b,'role':{'$or':[_0x7c15('0x14'),_0x7c15('0x15'),_0x7c15('0x16')]}}});})[_0x7c15('0xd')](function(_0x404709){if(!_0x404709||_0x404709&&_0x404709[_0x7c15('0xe')]!==_0x35100b){throw new Error(_0x7c15('0x17'));}else{_0x18ed79=_0x404709;return _0x18ed79;}})[_0x7c15('0xd')](function(){_0x18ed79['authenticate'](_0x57db1f,function(_0x36d947,_0x190d55){var _0x1c120d=_0x18ed79['loginAttempts']+0x1;if(_0x36d947){return _0x3aa370(_0x36d947);}else if(!_0x190d55){if(_0x18ed79[_0x7c15('0x18')]){return _0x3aa370(null,![],{'message':_0x7c15('0x17')});}else if(_0x20b989['allowedLoginAttempts']>0x0){if(_0x18ed79[_0x7c15('0x19')]){if(_0x20b989[_0x7c15('0xc')]>0x0){if(moment(_0x18ed79['blockedAt'])[_0x7c15('0x1a')](_0x20b989[_0x7c15('0xc')],'minutes')>moment()){return _0x3aa370(null,![],{'message':_0x7c15('0x17')});}else{return utils['clearBlockUser'](_0x18ed79,_0x1c120d,![],null)[_0x7c15('0xd')](function(){return _0x3aa370(null,![],{'message':_0x7c15('0x17')});});}}else{return _0x3aa370(null,![],{'message':_0x7c15('0x17')});}}else{if(_0x1c120d>=_0x20b989[_0x7c15('0x1b')]){return utils['clearBlockUser'](_0x18ed79,0x0,!![],moment())['then'](function(){return _0x3aa370(null,![],{'message':_0x7c15('0x17')});});}else{return utils['clearBlockUser'](_0x18ed79,_0x1c120d,![],null)[_0x7c15('0xd')](function(){return _0x3aa370(null,![],{'message':_0x7c15('0x17')});});}}}else{return _0x3aa370(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x18ed79[_0x7c15('0x18')]){return _0x3aa370(null,![],{'message':_0x7c15('0x17')});}else if(_0x20b989[_0x7c15('0x1b')]>0x0){if(_0x18ed79['blocked']){if(_0x20b989[_0x7c15('0xc')]>0x0){if(moment(_0x18ed79[_0x7c15('0x12')])['add'](_0x20b989[_0x7c15('0xc')],'minutes')>moment()){return _0x3aa370(null,![],{'message':_0x7c15('0x17')});}else{return utils[_0x7c15('0x1c')](_0x18ed79,0x0,![],null)[_0x7c15('0xd')](function(){return utils[_0x7c15('0x1d')](_0x18ed79);})[_0x7c15('0xd')](function(){return _0x3aa370(null,_0x18ed79);});}}else{return _0x3aa370(null,![],{'message':_0x7c15('0x17')});}}else{return utils[_0x7c15('0x1c')](_0x18ed79,0x0,![],null)[_0x7c15('0xd')](function(){return utils[_0x7c15('0x1d')](_0x18ed79);})['then'](function(){return _0x3aa370(null,_0x18ed79);})[_0x7c15('0x1e')](function(_0x14675f){return _0x3aa370(null,![],_0x14675f);});}}else{if(_0x18ed79['blocked']){return _0x3aa370(null,![],{'message':_0x7c15('0x17')});}else{return utils['getLicense'](_0x18ed79)[_0x7c15('0xd')](function(){return _0x3aa370(null,_0x18ed79);});}}}});})[_0x7c15('0x1e')](function(_0x178580){return _0x3aa370(null,![],_0x178580);});}function sendServiceMail(_0xbde0a5){return db[_0x7c15('0x1f')][_0x7c15('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x7c15('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x7c15('0x22')],'as':'CloudProvider'}]}]})[_0x7c15('0xd')](function(_0x2d351b){if(!_0x2d351b){throw new Error(_0x7c15('0x23'));}var _0x51378b=_0x2d351b[_0x7c15('0x24')]();var _0x1ebb88={'account':_0x51378b,'message':_['merge']({'from':util[_0x7c15('0x25')](_0x7c15('0x26'),_0x2d351b['name'],_0x2d351b[_0x7c15('0x21')]||_0x2d351b['Smtp'][_0x7c15('0x15')])},_0xbde0a5)};return client[_0x7c15('0x27')]('SendMail',_0x1ebb88);})[_0x7c15('0xd')](function(_0x2d0f74){if(_0x2d0f74[_0x7c15('0x28')]){throw new Error(util[_0x7c15('0x25')](_0x7c15('0x29'),_0x2d0f74['error'][_0x7c15('0x2a')]||JSON[_0x7c15('0x2b')](_0x2d0f74[_0x7c15('0x28')])));}return!![];});}function handleError(_0x3709b7,_0x1b0c5a,_0x3a8499){return _0x3709b7[_0x7c15('0x2c')](_0x1b0c5a||0x1f4)['send']({'message':_0x3a8499?_0x3a8499[_0x7c15('0x2a')]||_0x3a8499:''});}exports[_0x7c15('0x2d')]=function(_0xd710d0,_0x535233,_0xdd1582){passport[_0x7c15('0x2e')](_0x7c15('0x2f'),function(_0x27d3de,_0x48e441,_0x463102){var _0x940f9d=_0x27d3de||_0x463102;if(_0x940f9d){return handleError(_0x535233,0x191,_0x940f9d);}if(!_0x48e441){return handleError(_0x535233,0x194,{'message':_0x7c15('0x30')});}else{var _0x601f72={'payload':{'id':_0x48e441['id'],'role':_0x48e441[_0x7c15('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x7c15('0x31')](_0x601f72)[_0x7c15('0xd')](function(_0x47c5dd){_0x535233[_0x7c15('0x32')]({'id':_0x48e441['id'],'token':_0x47c5dd,'statusCall':'','isAlreadyLogged':_0x48e441['online']});});}})(_0xd710d0,_0x535233,_0xdd1582);};exports['forgot']=function(_0x1b0daf,_0x2dc8a4){if(!_0x1b0daf[_0x7c15('0x33')][_0x7c15('0x21')]){return handleError(_0x2dc8a4,0x1f4,{'message':_0x7c15('0x34')});}var _0x4c8a6a=rs[_0x7c15('0x35')]();_0x1b0daf[_0x7c15('0x33')]['email']=_0x1b0daf[_0x7c15('0x33')][_0x7c15('0x21')][_0x7c15('0x36')]()[_0x7c15('0x37')]();var _0x5f491f;return db[_0x7c15('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x7c15('0x1b'),_0x7c15('0xc')],'raw':!![]})[_0x7c15('0xd')](function(_0x44f0e1){_0x5f491f=_0x44f0e1;return db[_0x7c15('0x38')][_0x7c15('0x20')]({'where':{'email':_0x1b0daf[_0x7c15('0x33')][_0x7c15('0x21')]}});})[_0x7c15('0xd')](function(_0x290b7e){if(!_0x290b7e){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x290b7e[_0x7c15('0x18')]){throw new Error(_0x7c15('0x39'));}if(_0x290b7e[_0x7c15('0x19')]){if(moment(_0x290b7e['blockedAt'])[_0x7c15('0x1a')](_0x5f491f['blockDuration'],_0x7c15('0x3a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x290b7e[_0x7c15('0x19')]=![];_0x290b7e[_0x7c15('0x12')]=null;}}_0x290b7e[_0x7c15('0x3b')]=_0x4c8a6a;_0x290b7e['resetPasswordExpires']=Date[_0x7c15('0x3c')]()+0x36ee80;return _0x290b7e[_0x7c15('0x3d')]();})[_0x7c15('0xd')](function(){return sendServiceMail({'to':_0x1b0daf[_0x7c15('0x33')]['email'],'subject':_0x7c15('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x7c15('0x3f')+_0x7c15('0x40')+_0x1b0daf['headers']['host']+_0x7c15('0x41')+_0x4c8a6a+'\x0a\x0a'+_0x7c15('0x42')});})[_0x7c15('0xd')](function(){_0x2dc8a4[_0x7c15('0x2c')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x7c15('0x1e')](function(_0x342572){return handleError(_0x2dc8a4,0x1f4,_0x342572);});};exports[_0x7c15('0x43')]=function(_0x24a0f2,_0x180a15){return db[_0x7c15('0x38')][_0x7c15('0x20')]({'where':{'resetPasswordToken':_0x24a0f2[_0x7c15('0x44')]['token'],'resetPasswordExpires':{'$gt':Date[_0x7c15('0x3c')]()}}})[_0x7c15('0xd')](function(_0x52f0db){if(!_0x52f0db){throw new Error(_0x7c15('0x45'));}return db[_0x7c15('0xa')][_0x7c15('0xb')]({'attributes':['id',_0x7c15('0x46'),_0x7c15('0x47'),_0x7c15('0x48')]})[_0x7c15('0xd')](function(_0x35d53e){if(_0x35d53e[_0x7c15('0x46')])authService[_0x7c15('0x49')](_0x24a0f2[_0x7c15('0x33')][_0x7c15('0xf')]);if(!_0x35d53e[_0x7c15('0x47')]||!_0x52f0db['previousPasswords'])return _0x52f0db;authService[_0x7c15('0x4a')](_0x24a0f2['body'][_0x7c15('0xf')],_0x52f0db[_0x7c15('0x4b')],_0x35d53e[_0x7c15('0x48')]);return _0x52f0db;})[_0x7c15('0xd')](function(){_0x52f0db[_0x7c15('0xf')]=_0x24a0f2['body'][_0x7c15('0xf')];_0x52f0db[_0x7c15('0x3b')]=null;_0x52f0db[_0x7c15('0x4c')]=null;return _0x52f0db['save']();});})[_0x7c15('0xd')](function(){_0x180a15[_0x7c15('0x2c')](0xc8)[_0x7c15('0x4d')]({'message':_0x7c15('0x4e')});})[_0x7c15('0x1e')](function(_0x27a2d7){return handleError(_0x180a15,0x1f4,_0x27a2d7);});};passport['use'](_0x7c15('0x2f'),new LocalStrategy({'usernameField':_0x7c15('0xe'),'passwordField':_0x7c15('0xf')},function(_0x5d3c1d,_0x4a1956,_0x10de64){return localAuthenticate(db[_0x7c15('0x38')],_0x5d3c1d,_0x4a1956,_0x10de64);}));
\ No newline at end of file
+var _0x1270=['signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','disabled','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockedAt','minutes','clearBlockUser','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1270,0x1b4));var _0x0127=function(_0x5a0cd1,_0x3f524f){_0x5a0cd1=_0x5a0cd1-0x0;var _0x2d1564=_0x1270[_0x5a0cd1];return _0x2d1564;};'use strict';var util=require('util');var passport=require(_0x0127('0x0'));var LocalStrategy=require(_0x0127('0x1'))[_0x0127('0x2')];var jayson=require(_0x0127('0x3'));var _=require(_0x0127('0x4'));var rs=require(_0x0127('0x5'));var moment=require('moment');var db=require(_0x0127('0x6'))['db'];var authService=require(_0x0127('0x7'));var utils=require(_0x0127('0x8'));var client=jayson['client'][_0x0127('0x9')]({'port':0x232b});function localAuthenticate(_0x35bf63,_0x351b23,_0x4f3608,_0x308183){var _0x291989,_0x4d0b29;return db[_0x0127('0xa')][_0x0127('0xb')]({'where':{'id':0x1},'attributes':[_0x0127('0xc'),_0x0127('0xd')],'raw':!![]})['then'](function(_0x393d74){_0x291989=_0x393d74;return _0x35bf63[_0x0127('0xb')]({'attributes':['id',_0x0127('0xe'),_0x0127('0xf'),'salt','role',_0x0127('0x10'),'blocked','blockedAt',_0x0127('0x11')],'where':{'name':_0x351b23,'role':{'$or':[_0x0127('0x12'),_0x0127('0x13'),_0x0127('0x14')]}}});})[_0x0127('0x15')](function(_0x3ded0d){if(!_0x3ded0d||_0x3ded0d&&_0x3ded0d['name']!==_0x351b23){throw new Error(_0x0127('0x16'));}else{_0x4d0b29=_0x3ded0d;return _0x4d0b29;}})[_0x0127('0x15')](function(){_0x4d0b29[_0x0127('0x17')](_0x4f3608,function(_0x3f633a,_0x31e56c){var _0x5c2f7d=_0x4d0b29[_0x0127('0x11')]+0x1;if(_0x3f633a){return _0x308183(_0x3f633a);}else if(!_0x31e56c){if(_0x4d0b29['disabled']){return _0x308183(null,![],{'message':_0x0127('0x16')});}else if(_0x291989[_0x0127('0xc')]>0x0){if(_0x4d0b29[_0x0127('0x18')]){if(_0x291989[_0x0127('0xd')]>0x0){if(moment(_0x4d0b29[_0x0127('0x19')])['add'](_0x291989[_0x0127('0xd')],_0x0127('0x1a'))>moment()){return _0x308183(null,![],{'message':_0x0127('0x16')});}else{return utils[_0x0127('0x1b')](_0x4d0b29,_0x5c2f7d,![],null)[_0x0127('0x15')](function(){return _0x308183(null,![],{'message':_0x0127('0x16')});});}}else{return _0x308183(null,![],{'message':_0x0127('0x16')});}}else{if(_0x5c2f7d>=_0x291989['allowedLoginAttempts']){return utils[_0x0127('0x1b')](_0x4d0b29,0x0,!![],moment())['then'](function(){return _0x308183(null,![],{'message':_0x0127('0x16')});});}else{return utils[_0x0127('0x1b')](_0x4d0b29,_0x5c2f7d,![],null)[_0x0127('0x15')](function(){return _0x308183(null,![],{'message':_0x0127('0x16')});});}}}else{return _0x308183(null,![],{'message':_0x0127('0x16')});}}else{if(_0x4d0b29[_0x0127('0x10')]){return _0x308183(null,![],{'message':_0x0127('0x16')});}else if(_0x291989[_0x0127('0xc')]>0x0){if(_0x4d0b29[_0x0127('0x18')]){if(_0x291989['blockDuration']>0x0){if(moment(_0x4d0b29[_0x0127('0x19')])[_0x0127('0x1c')](_0x291989[_0x0127('0xd')],'minutes')>moment()){return _0x308183(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0127('0x1b')](_0x4d0b29,0x0,![],null)[_0x0127('0x15')](function(){return utils['getLicense'](_0x4d0b29);})[_0x0127('0x15')](function(){return _0x308183(null,_0x4d0b29);});}}else{return _0x308183(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0127('0x1b')](_0x4d0b29,0x0,![],null)[_0x0127('0x15')](function(){return utils[_0x0127('0x1d')](_0x4d0b29);})[_0x0127('0x15')](function(){return _0x308183(null,_0x4d0b29);})['catch'](function(_0x2b2450){return _0x308183(null,![],_0x2b2450);});}}else{if(_0x4d0b29['blocked']){return _0x308183(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x4d0b29)[_0x0127('0x15')](function(){return _0x308183(null,_0x4d0b29);});}}}});})[_0x0127('0x1e')](function(_0x3042be){return _0x308183(null,![],_0x3042be);});}function sendServiceMail(_0x55dd87){return db['MailAccount'][_0x0127('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x0127('0xe'),_0x0127('0x20')],'include':[{'model':db[_0x0127('0x21')],'as':_0x0127('0x22'),'include':[{'model':db[_0x0127('0x23')],'as':_0x0127('0x23')}]}]})[_0x0127('0x15')](function(_0x46c199){if(!_0x46c199){throw new Error(_0x0127('0x24'));}var _0x506f0d=_0x46c199['getSmtpOptions']();var _0x51118e={'account':_0x506f0d,'message':_[_0x0127('0x25')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x46c199[_0x0127('0xe')],_0x46c199['email']||_0x46c199[_0x0127('0x22')][_0x0127('0x13')])},_0x55dd87)};return client['request'](_0x0127('0x26'),_0x51118e);})[_0x0127('0x15')](function(_0xf2ebfd){if(_0xf2ebfd[_0x0127('0x27')]){throw new Error(util[_0x0127('0x28')](_0x0127('0x29'),_0xf2ebfd['error'][_0x0127('0x2a')]||JSON[_0x0127('0x2b')](_0xf2ebfd[_0x0127('0x27')])));}return!![];});}function handleError(_0x439030,_0x5d26a1,_0x42866b){return _0x439030[_0x0127('0x2c')](_0x5d26a1||0x1f4)[_0x0127('0x2d')]({'message':_0x42866b?_0x42866b[_0x0127('0x2a')]||_0x42866b:''});}exports[_0x0127('0x2e')]=function(_0x1b9771,_0x190f32,_0x307dfc){passport[_0x0127('0x17')](_0x0127('0x2f'),function(_0x370fac,_0x1bffd7,_0x124f28){var _0x294a35=_0x370fac||_0x124f28;if(_0x294a35){return handleError(_0x190f32,0x191,_0x294a35);}if(!_0x1bffd7){return handleError(_0x190f32,0x194,{'message':_0x0127('0x30')});}else{var _0x5933a1={'payload':{'id':_0x1bffd7['id'],'role':_0x1bffd7[_0x0127('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x0127('0x32')](_0x5933a1)[_0x0127('0x15')](function(_0x279d68){_0x190f32[_0x0127('0x33')]({'id':_0x1bffd7['id'],'token':_0x279d68,'statusCall':'','isAlreadyLogged':_0x1bffd7['online']});});}})(_0x1b9771,_0x190f32,_0x307dfc);};exports[_0x0127('0x34')]=function(_0x4ffaf3,_0xe97016){if(!_0x4ffaf3[_0x0127('0x35')][_0x0127('0x20')]){return handleError(_0xe97016,0x1f4,{'message':_0x0127('0x36')});}var _0x4f6fc3=rs[_0x0127('0x37')]();_0x4ffaf3[_0x0127('0x35')][_0x0127('0x20')]=_0x4ffaf3[_0x0127('0x35')]['email'][_0x0127('0x38')]()[_0x0127('0x39')]();var _0x3ece2c;return db[_0x0127('0xa')][_0x0127('0xb')]({'where':{'id':0x1},'attributes':[_0x0127('0xc'),_0x0127('0xd')],'raw':!![]})[_0x0127('0x15')](function(_0x22286d){_0x3ece2c=_0x22286d;return db[_0x0127('0x3a')][_0x0127('0x1f')]({'where':{'email':_0x4ffaf3[_0x0127('0x35')]['email']}});})[_0x0127('0x15')](function(_0xcf51c2){if(!_0xcf51c2){throw new Error(_0x0127('0x3b'));}if(_0xcf51c2['disabled']){throw new Error(_0x0127('0x3c'));}if(_0xcf51c2['blocked']){if(moment(_0xcf51c2['blockedAt'])[_0x0127('0x1c')](_0x3ece2c['blockDuration'],_0x0127('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xcf51c2[_0x0127('0x18')]=![];_0xcf51c2[_0x0127('0x19')]=null;}}_0xcf51c2[_0x0127('0x3d')]=_0x4f6fc3;_0xcf51c2[_0x0127('0x3e')]=Date[_0x0127('0x3f')]()+0x36ee80;return _0xcf51c2[_0x0127('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x4ffaf3['body']['email'],'subject':_0x0127('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x0127('0x42')+_0x0127('0x43')+_0x4ffaf3[_0x0127('0x44')]['host']+_0x0127('0x45')+_0x4f6fc3+'\x0a\x0a'+_0x0127('0x46')});})[_0x0127('0x15')](function(){_0xe97016['status'](0xc8)[_0x0127('0x2d')]({'message':_0x0127('0x47')});})[_0x0127('0x1e')](function(_0x472e2b){return handleError(_0xe97016,0x1f4,_0x472e2b);});};exports[_0x0127('0x48')]=function(_0x5754da,_0x305c9d){return db[_0x0127('0x3a')][_0x0127('0x1f')]({'where':{'resetPasswordToken':_0x5754da[_0x0127('0x49')][_0x0127('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x0127('0x3f')]()}}})[_0x0127('0x15')](function(_0x44fff7){if(!_0x44fff7){throw new Error(_0x0127('0x4b'));}return db[_0x0127('0xa')][_0x0127('0xb')]({'attributes':['id',_0x0127('0x4c'),_0x0127('0x4d'),_0x0127('0x4e')]})[_0x0127('0x15')](function(_0x580603){if(_0x580603['securePassword'])authService['validatePasswordPattern'](_0x5754da['body'][_0x0127('0xf')]);if(!_0x580603[_0x0127('0x4d')]||!_0x44fff7[_0x0127('0x4f')])return _0x44fff7;authService['validatePasswordHistory'](_0x5754da[_0x0127('0x35')][_0x0127('0xf')],_0x44fff7[_0x0127('0x4f')],_0x580603['passwordHistoryLimit']);return _0x44fff7;})['then'](function(){_0x44fff7[_0x0127('0xf')]=_0x5754da[_0x0127('0x35')][_0x0127('0xf')];_0x44fff7[_0x0127('0x3d')]=null;_0x44fff7['resetPasswordExpires']=null;return _0x44fff7['save']();});})[_0x0127('0x15')](function(){_0x305c9d[_0x0127('0x2c')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x0127('0x1e')](function(_0x4fdf1d){return handleError(_0x305c9d,0x1f4,_0x4fdf1d);});};passport[_0x0127('0x50')](_0x0127('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x0127('0xf')},function(_0x13d023,_0x265ad1,_0x75c844){return localAuthenticate(db['User'],_0x13d023,_0x265ad1,_0x75c844);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index bac304b..0d54a41 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 _0x9034=['exports','express','Router','post','login','/forgot','forgot','/reset/:token'];(function(_0x59f7ce,_0x5b3bd3){var _0x2e9cce=function(_0xad5439){while(--_0xad5439){_0x59f7ce['push'](_0x59f7ce['shift']());}};_0x2e9cce(++_0x5b3bd3);}(_0x9034,0x1c1));var _0x4903=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9034[_0x397e5f];return _0x5302b8;};'use strict';var express=require(_0x4903('0x0'));var router=express[_0x4903('0x1')]();var controller=require('./authLocal.controller');router[_0x4903('0x2')]('/',controller[_0x4903('0x3')]);router[_0x4903('0x2')](_0x4903('0x4'),controller[_0x4903('0x5')]);router[_0x4903('0x2')](_0x4903('0x6'),controller['reset']);module[_0x4903('0x7')]=router;
\ No newline at end of file
+var _0xbf4b=['post','login','forgot','express','Router','./authLocal.controller'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbf4b,0xe1));var _0xbbf4=function(_0xf9e76,_0x2e6b9a){_0xf9e76=_0xf9e76-0x0;var _0x119a9b=_0xbf4b[_0xf9e76];return _0x119a9b;};'use strict';var express=require(_0xbbf4('0x0'));var router=express[_0xbbf4('0x1')]();var controller=require(_0xbbf4('0x2'));router[_0xbbf4('0x3')]('/',controller[_0xbbf4('0x4')]);router[_0xbbf4('0x3')]('/forgot',controller[_0xbbf4('0x5')]);router[_0xbbf4('0x3')]('/reset/:token',controller['reset']);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 e88969c..5ab52a4 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 _0xbe17=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x2959ad,_0x472e27){var _0x50df2c=function(_0x35c0c1){while(--_0x35c0c1){_0x2959ad['push'](_0x2959ad['shift']());}};_0x50df2c(++_0x472e27);}(_0xbe17,0x10c));var _0x7be1=function(_0x595e2a,_0xb0a923){_0x595e2a=_0x595e2a-0x0;var _0x122421=_0xbe17[_0x595e2a];return _0x122421;};'use strict';var Sequelize=require('sequelize');module[_0x7be1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x7be1('0x1')]},'description':{'type':Sequelize[_0x7be1('0x1')]},'status':{'type':Sequelize[_0x7be1('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7be1('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0ce6=['INTEGER','exports','STRING'];(function(_0x434969,_0x3ef4fe){var _0xac29d7=function(_0x30ef6c){while(--_0x30ef6c){_0x434969['push'](_0x434969['shift']());}};_0xac29d7(++_0x3ef4fe);}(_0x0ce6,0x100));var _0x60ce=function(_0x272e68,_0x49f8c4){_0x272e68=_0x272e68-0x0;var _0x532fc7=_0x0ce6[_0x272e68];return _0x532fc7;};'use strict';var Sequelize=require('sequelize');module[_0x60ce('0x0')]={'name':{'type':Sequelize[_0x60ce('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x60ce('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x60ce('0x2')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 4cd2c60..b285e56 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 _0xc219=['index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','Automation','includeAll','catch','show','include','find','create','body','params','addConditions','Condition','ids','findOne','order','pick','getConditions','Action','addActions','getActions','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xc219,0x1c7));var _0x9c21=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0xc219[_0x5f1617];return _0x3af5da;};'use strict';var emlformat=require(_0x9c21('0x0'));var rimraf=require(_0x9c21('0x1'));var zipdir=require(_0x9c21('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9c21('0x3'));var BPromise=require(_0x9c21('0x4'));var Mustache=require('mustache');var util=require(_0x9c21('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x9c21('0x6'));var ejs=require(_0x9c21('0x7'));var fs=require('fs');var fs_extra=require(_0x9c21('0x8'));var _=require('lodash');var squel=require(_0x9c21('0x9'));var crypto=require(_0x9c21('0xa'));var jsforce=require(_0x9c21('0xb'));var deskjs=require(_0x9c21('0xc'));var toCsv=require(_0x9c21('0x6'));var querystring=require(_0x9c21('0xd'));var Papa=require(_0x9c21('0xe'));var Redis=require(_0x9c21('0xf'));var authService=require(_0x9c21('0x10'));var qs=require(_0x9c21('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9c21('0x12'));var utils=require(_0x9c21('0x13'));var config=require(_0x9c21('0x14'));var licenseUtil=require(_0x9c21('0x15'));var db=require(_0x9c21('0x16'))['db'];function respondWithStatusCode(_0x255497,_0x554f8e){_0x554f8e=_0x554f8e||0xcc;return function(_0x432ad9){if(_0x432ad9){return _0x255497['sendStatus'](_0x554f8e);}return _0x255497[_0x9c21('0x17')](_0x554f8e)[_0x9c21('0x18')]();};}function respondWithResult(_0x4b4501,_0x5267ff){_0x5267ff=_0x5267ff||0xc8;return function(_0x5403a6){if(_0x5403a6){return _0x4b4501[_0x9c21('0x17')](_0x5267ff)[_0x9c21('0x19')](_0x5403a6);}};}function respondWithFilteredResult(_0x1cffda,_0x3d074c){return function(_0x38df70){if(_0x38df70){var _0x282dba=typeof _0x3d074c[_0x9c21('0x1a')]===_0x9c21('0x1b')&&typeof _0x3d074c['limit']===_0x9c21('0x1b');var _0x18df58=_0x38df70['count'];var _0x4a45a4=_0x282dba?0x0:_0x3d074c['offset'];var _0x3f401b=_0x282dba?_0x38df70[_0x9c21('0x1c')]:_0x3d074c[_0x9c21('0x1a')]+_0x3d074c[_0x9c21('0x1d')];var _0x354ea3;if(_0x3f401b>=_0x18df58){_0x3f401b=_0x18df58;_0x354ea3=0xc8;}else{_0x354ea3=0xce;}_0x1cffda[_0x9c21('0x17')](_0x354ea3);return _0x1cffda[_0x9c21('0x1e')](_0x9c21('0x1f'),_0x4a45a4+'-'+_0x3f401b+'/'+_0x18df58)[_0x9c21('0x19')](_0x38df70);}return null;};}function patchUpdates(_0x27d655){return function(_0x477cab){try{jsonpatch[_0x9c21('0x20')](_0x477cab,_0x27d655,!![]);}catch(_0x127833){return BPromise[_0x9c21('0x21')](_0x127833);}return _0x477cab[_0x9c21('0x22')]();};}function saveUpdates(_0x359765,_0x3dedc7){return function(_0xd162fd){if(_0xd162fd){return _0xd162fd[_0x9c21('0x23')](_0x359765)[_0x9c21('0x24')](function(_0x2e43de){return _0x2e43de;});}return null;};}function removeEntity(_0x29830e,_0x4a002b){return function(_0x4db19e){if(_0x4db19e){return _0x4db19e[_0x9c21('0x25')]()[_0x9c21('0x24')](function(){_0x29830e[_0x9c21('0x17')](0xcc)[_0x9c21('0x18')]();});}};}function handleEntityNotFound(_0x3c38ec,_0x4ebcae){return function(_0x26d41d){if(!_0x26d41d){_0x3c38ec[_0x9c21('0x26')](0x194);}return _0x26d41d;};}function handleError(_0x20fdb2,_0x57beb5){_0x57beb5=_0x57beb5||0x1f4;return function(_0x2362fe){logger[_0x9c21('0x27')](_0x2362fe[_0x9c21('0x28')]);if(_0x2362fe[_0x9c21('0x29')]){delete _0x2362fe['name'];}_0x20fdb2[_0x9c21('0x17')](_0x57beb5)[_0x9c21('0x2a')](_0x2362fe);};}exports[_0x9c21('0x2b')]=function(_0x1593f7,_0xaf2ebc){var _0xe379d0={},_0x1f79f4={},_0x43fea1={'count':0x0,'rows':[]};var _0x37c617=_[_0x9c21('0x2c')](db['Automation'][_0x9c21('0x2d')],function(_0x4dd440){return{'name':_0x4dd440[_0x9c21('0x2e')],'type':_0x4dd440[_0x9c21('0x2f')]['key']};});_0x1f79f4['model']=_[_0x9c21('0x2c')](_0x37c617,_0x9c21('0x29'));_0x1f79f4[_0x9c21('0x30')]=_[_0x9c21('0x31')](_0x1593f7['query']);_0x1f79f4[_0x9c21('0x32')]=_[_0x9c21('0x33')](_0x1f79f4['model'],_0x1f79f4['query']);_0xe379d0['attributes']=_[_0x9c21('0x33')](_0x1f79f4[_0x9c21('0x34')],qs[_0x9c21('0x35')](_0x1593f7[_0x9c21('0x30')][_0x9c21('0x35')]));_0xe379d0[_0x9c21('0x36')]=_0xe379d0[_0x9c21('0x36')][_0x9c21('0x37')]?_0xe379d0[_0x9c21('0x36')]:_0x1f79f4['model'];if(!_0x1593f7[_0x9c21('0x30')][_0x9c21('0x38')](_0x9c21('0x39'))){_0xe379d0[_0x9c21('0x1d')]=qs[_0x9c21('0x1d')](_0x1593f7[_0x9c21('0x30')][_0x9c21('0x1d')]);_0xe379d0[_0x9c21('0x1a')]=qs[_0x9c21('0x1a')](_0x1593f7[_0x9c21('0x30')]['offset']);}_0xe379d0['order']=qs[_0x9c21('0x3a')](_0x1593f7['query']['sort']);_0xe379d0[_0x9c21('0x3b')]=qs[_0x9c21('0x32')](_['pick'](_0x1593f7[_0x9c21('0x30')],_0x1f79f4[_0x9c21('0x32')]),_0x37c617);if(_0x1593f7[_0x9c21('0x30')]['filter']){_0xe379d0[_0x9c21('0x3b')]=_[_0x9c21('0x3c')](_0xe379d0[_0x9c21('0x3b')],{'$or':_['map'](_0x37c617,function(_0x39475d){if(_0x39475d[_0x9c21('0x2f')]!==_0x9c21('0x3d')){var _0x59cb8d={};_0x59cb8d[_0x39475d[_0x9c21('0x29')]]={'$like':'%'+_0x1593f7[_0x9c21('0x30')][_0x9c21('0x3e')]+'%'};return _0x59cb8d;}})});}_0xe379d0=_[_0x9c21('0x3c')]({},_0xe379d0,_0x1593f7[_0x9c21('0x3f')]);var _0x47173a={'where':_0xe379d0[_0x9c21('0x3b')]};return db[_0x9c21('0x40')][_0x9c21('0x1c')](_0x47173a)[_0x9c21('0x24')](function(_0x1bf52a){_0x43fea1[_0x9c21('0x1c')]=_0x1bf52a;if(_0x1593f7[_0x9c21('0x30')][_0x9c21('0x41')]){_0xe379d0['include']=[{'all':!![]}];}return db[_0x9c21('0x40')]['findAll'](_0xe379d0);})['then'](function(_0x3d638b){_0x43fea1['rows']=_0x3d638b;return _0x43fea1;})['then'](respondWithFilteredResult(_0xaf2ebc,_0xe379d0))[_0x9c21('0x42')](handleError(_0xaf2ebc,null));};exports[_0x9c21('0x43')]=function(_0x119663,_0x35faf3){var _0x15499e={'raw':![],'where':{'id':_0x119663['params']['id']}},_0x5f4df2={};_0x5f4df2[_0x9c21('0x34')]=_['keys'](db[_0x9c21('0x40')][_0x9c21('0x2d')]);_0x5f4df2[_0x9c21('0x30')]=_['keys'](_0x119663['query']);_0x5f4df2['filters']=_[_0x9c21('0x33')](_0x5f4df2[_0x9c21('0x34')],_0x5f4df2[_0x9c21('0x30')]);_0x15499e['attributes']=_[_0x9c21('0x33')](_0x5f4df2[_0x9c21('0x34')],qs[_0x9c21('0x35')](_0x119663['query'][_0x9c21('0x35')]));_0x15499e['attributes']=_0x15499e[_0x9c21('0x36')][_0x9c21('0x37')]?_0x15499e[_0x9c21('0x36')]:_0x5f4df2['model'];if(_0x119663[_0x9c21('0x30')][_0x9c21('0x41')]){_0x15499e[_0x9c21('0x44')]=[{'all':!![]}];}_0x15499e=_[_0x9c21('0x3c')]({},_0x15499e,_0x119663[_0x9c21('0x3f')]);return db[_0x9c21('0x40')][_0x9c21('0x45')](_0x15499e)[_0x9c21('0x24')](handleEntityNotFound(_0x35faf3,null))['then'](respondWithResult(_0x35faf3,null))['catch'](handleError(_0x35faf3,null));};exports[_0x9c21('0x46')]=function(_0x53e106,_0x366a25){return db['Automation'][_0x9c21('0x46')](_0x53e106['body'],{})['then'](respondWithResult(_0x366a25,0xc9))[_0x9c21('0x42')](handleError(_0x366a25,null));};exports[_0x9c21('0x23')]=function(_0x1616fb,_0x54836b){if(_0x1616fb[_0x9c21('0x47')]['id']){delete _0x1616fb[_0x9c21('0x47')]['id'];}return db[_0x9c21('0x40')][_0x9c21('0x45')]({'where':{'id':_0x1616fb['params']['id']}})['then'](handleEntityNotFound(_0x54836b,null))[_0x9c21('0x24')](saveUpdates(_0x1616fb[_0x9c21('0x47')],null))[_0x9c21('0x24')](respondWithResult(_0x54836b,null))['catch'](handleError(_0x54836b,null));};exports[_0x9c21('0x25')]=function(_0x4470d2,_0x5d7109){return db['Automation']['find']({'where':{'id':_0x4470d2[_0x9c21('0x48')]['id']}})[_0x9c21('0x24')](handleEntityNotFound(_0x5d7109,null))[_0x9c21('0x24')](removeEntity(_0x5d7109,null))[_0x9c21('0x42')](handleError(_0x5d7109,null));};exports[_0x9c21('0x49')]=function(_0x45edef,_0x3282b6,_0x2926f3){return db[_0x9c21('0x4a')][_0x9c21('0x45')]({'where':{'id':_0x45edef[_0x9c21('0x48')]['id']}})['then'](handleEntityNotFound(_0x3282b6,null))[_0x9c21('0x24')](function(_0x457431){if(_0x457431){return _0x457431['addConditions'](_0x45edef[_0x9c21('0x47')][_0x9c21('0x4b')],_['omit'](_0x45edef[_0x9c21('0x47')],['ids','id'])||{});}})[_0x9c21('0x24')](respondWithResult(_0x3282b6,null))['catch'](handleError(_0x3282b6,null));};exports['getConditions']=function(_0x68c090,_0x28c5bd,_0x4ff085){var _0x4b53f1={};var _0x2f9703={};var _0x18fcf4;var _0x209c5e;return db[_0x9c21('0x40')][_0x9c21('0x4c')]({'where':{'id':_0x68c090['params']['id']}})[_0x9c21('0x24')](handleEntityNotFound(_0x28c5bd,null))[_0x9c21('0x24')](function(_0x214eee){if(_0x214eee){_0x18fcf4=_0x214eee;_0x2f9703[_0x9c21('0x34')]=_[_0x9c21('0x31')](db[_0x9c21('0x4a')][_0x9c21('0x2d')]);_0x2f9703[_0x9c21('0x30')]=_[_0x9c21('0x31')](_0x68c090[_0x9c21('0x30')]);_0x2f9703[_0x9c21('0x32')]=_[_0x9c21('0x33')](_0x2f9703[_0x9c21('0x34')],_0x2f9703[_0x9c21('0x30')]);_0x4b53f1[_0x9c21('0x36')]=_[_0x9c21('0x33')](_0x2f9703['model'],qs[_0x9c21('0x35')](_0x68c090[_0x9c21('0x30')][_0x9c21('0x35')]));_0x4b53f1[_0x9c21('0x36')]=_0x4b53f1['attributes'][_0x9c21('0x37')]?_0x4b53f1[_0x9c21('0x36')]:_0x2f9703['model'];_0x4b53f1[_0x9c21('0x4d')]=qs[_0x9c21('0x3a')](_0x68c090[_0x9c21('0x30')]['sort']);_0x4b53f1['where']=qs[_0x9c21('0x32')](_[_0x9c21('0x4e')](_0x68c090[_0x9c21('0x30')],_0x2f9703[_0x9c21('0x32')]));if(_0x68c090[_0x9c21('0x30')][_0x9c21('0x3e')]){_0x4b53f1['where']=_[_0x9c21('0x3c')](_0x4b53f1[_0x9c21('0x3b')],{'$or':_[_0x9c21('0x2c')](_0x4b53f1[_0x9c21('0x36')],function(_0x3d23ea){var _0x4fc2c1={};_0x4fc2c1[_0x3d23ea]={'$like':'%'+_0x68c090[_0x9c21('0x30')]['filter']+'%'};return _0x4fc2c1;})});}_0x4b53f1=_[_0x9c21('0x3c')]({},_0x4b53f1,_0x68c090[_0x9c21('0x3f')]);return _0x18fcf4[_0x9c21('0x4f')](_0x4b53f1);}})['then'](function(_0x31068c){if(_0x31068c){_0x209c5e=_0x31068c[_0x9c21('0x37')];if(!_0x68c090['query']['hasOwnProperty']('nolimit')){_0x4b53f1[_0x9c21('0x1d')]=qs[_0x9c21('0x1d')](_0x68c090[_0x9c21('0x30')]['limit']);_0x4b53f1[_0x9c21('0x1a')]=qs[_0x9c21('0x1a')](_0x68c090[_0x9c21('0x30')][_0x9c21('0x1a')]);}return _0x18fcf4['getConditions'](_0x4b53f1);}})[_0x9c21('0x24')](function(_0xa07490){if(_0xa07490){return _0xa07490?{'count':_0x209c5e,'rows':_0xa07490}:null;}})['then'](respondWithResult(_0x28c5bd,null))[_0x9c21('0x42')](handleError(_0x28c5bd,null));};exports['addActions']=function(_0x1cbb6d,_0x1e7dcd,_0x212e2c){return db[_0x9c21('0x50')][_0x9c21('0x45')]({'where':{'id':_0x1cbb6d['params']['id']}})[_0x9c21('0x24')](handleEntityNotFound(_0x1e7dcd,null))[_0x9c21('0x24')](function(_0x4dfc2f){if(_0x4dfc2f){return _0x4dfc2f[_0x9c21('0x51')](_0x1cbb6d[_0x9c21('0x47')]['ids'],_['omit'](_0x1cbb6d[_0x9c21('0x47')],[_0x9c21('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x1e7dcd,null))[_0x9c21('0x42')](handleError(_0x1e7dcd,null));};exports[_0x9c21('0x52')]=function(_0x3871a4,_0x350130,_0x54a8a3){var _0x215f93={};var _0x3dff64={};var _0x26fc83;var _0x600dc1;return db[_0x9c21('0x40')]['findOne']({'where':{'id':_0x3871a4[_0x9c21('0x48')]['id']}})[_0x9c21('0x24')](handleEntityNotFound(_0x350130,null))[_0x9c21('0x24')](function(_0x31a7c0){if(_0x31a7c0){_0x26fc83=_0x31a7c0;_0x3dff64[_0x9c21('0x34')]=_[_0x9c21('0x31')](db[_0x9c21('0x50')][_0x9c21('0x2d')]);_0x3dff64['query']=_[_0x9c21('0x31')](_0x3871a4[_0x9c21('0x30')]);_0x3dff64['filters']=_[_0x9c21('0x33')](_0x3dff64['model'],_0x3dff64[_0x9c21('0x30')]);_0x215f93[_0x9c21('0x36')]=_[_0x9c21('0x33')](_0x3dff64[_0x9c21('0x34')],qs[_0x9c21('0x35')](_0x3871a4[_0x9c21('0x30')][_0x9c21('0x35')]));_0x215f93[_0x9c21('0x36')]=_0x215f93[_0x9c21('0x36')][_0x9c21('0x37')]?_0x215f93[_0x9c21('0x36')]:_0x3dff64[_0x9c21('0x34')];_0x215f93['order']=qs[_0x9c21('0x3a')](_0x3871a4[_0x9c21('0x30')][_0x9c21('0x3a')]);_0x215f93[_0x9c21('0x3b')]=qs[_0x9c21('0x32')](_[_0x9c21('0x4e')](_0x3871a4[_0x9c21('0x30')],_0x3dff64[_0x9c21('0x32')]));if(_0x3871a4['query'][_0x9c21('0x3e')]){_0x215f93[_0x9c21('0x3b')]=_[_0x9c21('0x3c')](_0x215f93[_0x9c21('0x3b')],{'$or':_[_0x9c21('0x2c')](_0x215f93[_0x9c21('0x36')],function(_0x5a451f){var _0x5e5a47={};_0x5e5a47[_0x5a451f]={'$like':'%'+_0x3871a4[_0x9c21('0x30')][_0x9c21('0x3e')]+'%'};return _0x5e5a47;})});}_0x215f93=_['merge']({},_0x215f93,_0x3871a4['options']);return _0x26fc83[_0x9c21('0x52')](_0x215f93);}})[_0x9c21('0x24')](function(_0x336282){if(_0x336282){_0x600dc1=_0x336282[_0x9c21('0x37')];if(!_0x3871a4[_0x9c21('0x30')]['hasOwnProperty'](_0x9c21('0x39'))){_0x215f93['limit']=qs[_0x9c21('0x1d')](_0x3871a4['query'][_0x9c21('0x1d')]);_0x215f93[_0x9c21('0x1a')]=qs[_0x9c21('0x1a')](_0x3871a4[_0x9c21('0x30')]['offset']);}return _0x26fc83['getActions'](_0x215f93);}})['then'](function(_0x522705){if(_0x522705){return _0x522705?{'count':_0x600dc1,'rows':_0x522705}:null;}})[_0x9c21('0x24')](respondWithResult(_0x350130,null))[_0x9c21('0x42')](handleError(_0x350130,null));};
\ No newline at end of file
+var _0x2787=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','end','sendStatus','stack','name','map','Automation','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','fields','find','create','body','update','addConditions','omit','ids','getConditions','Condition','nolimit','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x2787,0x18a));var _0x7278=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2787[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7278('0x0'));var rimraf=require(_0x7278('0x1'));var zipdir=require(_0x7278('0x2'));var jsonpatch=require(_0x7278('0x3'));var rp=require('request-promise');var moment=require(_0x7278('0x4'));var BPromise=require(_0x7278('0x5'));var Mustache=require(_0x7278('0x6'));var util=require('util');var path=require(_0x7278('0x7'));var sox=require(_0x7278('0x8'));var csv=require(_0x7278('0x9'));var ejs=require(_0x7278('0xa'));var fs=require('fs');var fs_extra=require(_0x7278('0xb'));var _=require(_0x7278('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7278('0xd'));var deskjs=require(_0x7278('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7278('0xf'));var Papa=require(_0x7278('0x10'));var Redis=require(_0x7278('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7278('0x12'));var as=require(_0x7278('0x13'));var hardwareService=require(_0x7278('0x14'));var logger=require('../../config/logger')(_0x7278('0x15'));var utils=require('../../config/utils');var config=require(_0x7278('0x16'));var licenseUtil=require(_0x7278('0x17'));var db=require(_0x7278('0x18'))['db'];function respondWithStatusCode(_0x404b51,_0x424548){_0x424548=_0x424548||0xcc;return function(_0x4788a4){if(_0x4788a4){return _0x404b51['sendStatus'](_0x424548);}return _0x404b51[_0x7278('0x19')](_0x424548)['end']();};}function respondWithResult(_0x21b9ea,_0x4c431b){_0x4c431b=_0x4c431b||0xc8;return function(_0x4b5356){if(_0x4b5356){return _0x21b9ea[_0x7278('0x19')](_0x4c431b)[_0x7278('0x1a')](_0x4b5356);}};}function respondWithFilteredResult(_0x3c10ae,_0x44f6b8){return function(_0x3c55c9){if(_0x3c55c9){var _0x368641=typeof _0x44f6b8['offset']===_0x7278('0x1b')&&typeof _0x44f6b8[_0x7278('0x1c')]===_0x7278('0x1b');var _0x5283f4=_0x3c55c9[_0x7278('0x1d')];var _0x919d62=_0x368641?0x0:_0x44f6b8['offset'];var _0x4188ff=_0x368641?_0x3c55c9[_0x7278('0x1d')]:_0x44f6b8[_0x7278('0x1e')]+_0x44f6b8[_0x7278('0x1c')];var _0x5d7b85;if(_0x4188ff>=_0x5283f4){_0x4188ff=_0x5283f4;_0x5d7b85=0xc8;}else{_0x5d7b85=0xce;}_0x3c10ae[_0x7278('0x19')](_0x5d7b85);return _0x3c10ae[_0x7278('0x1f')](_0x7278('0x20'),_0x919d62+'-'+_0x4188ff+'/'+_0x5283f4)[_0x7278('0x1a')](_0x3c55c9);}return null;};}function patchUpdates(_0x258853){return function(_0x595b6b){try{jsonpatch[_0x7278('0x21')](_0x595b6b,_0x258853,!![]);}catch(_0x380a35){return BPromise[_0x7278('0x22')](_0x380a35);}return _0x595b6b[_0x7278('0x23')]();};}function saveUpdates(_0x4fc0d4,_0x3ea92a){return function(_0x4289eb){if(_0x4289eb){return _0x4289eb['update'](_0x4fc0d4)['then'](function(_0x4daa96){return _0x4daa96;});}return null;};}function removeEntity(_0x982ae2,_0x9f3a3a){return function(_0x31be59){if(_0x31be59){return _0x31be59[_0x7278('0x24')]()['then'](function(){_0x982ae2[_0x7278('0x19')](0xcc)[_0x7278('0x25')]();});}};}function handleEntityNotFound(_0x57bcb1,_0x2f6804){return function(_0x1f9213){if(!_0x1f9213){_0x57bcb1[_0x7278('0x26')](0x194);}return _0x1f9213;};}function handleError(_0x13ffc4,_0x161a9f){_0x161a9f=_0x161a9f||0x1f4;return function(_0x2c3403){logger['error'](_0x2c3403[_0x7278('0x27')]);if(_0x2c3403[_0x7278('0x28')]){delete _0x2c3403['name'];}_0x13ffc4[_0x7278('0x19')](_0x161a9f)['send'](_0x2c3403);};}exports['index']=function(_0x4309b6,_0x10f11d){var _0x32f534={},_0x2e94bd={},_0x1cca94={'count':0x0,'rows':[]};var _0x2d0b18=_[_0x7278('0x29')](db[_0x7278('0x2a')][_0x7278('0x2b')],function(_0x10604e){return{'name':_0x10604e[_0x7278('0x2c')],'type':_0x10604e['type']['key']};});_0x2e94bd[_0x7278('0x2d')]=_[_0x7278('0x29')](_0x2d0b18,'name');_0x2e94bd[_0x7278('0x2e')]=_[_0x7278('0x2f')](_0x4309b6[_0x7278('0x2e')]);_0x2e94bd[_0x7278('0x30')]=_[_0x7278('0x31')](_0x2e94bd[_0x7278('0x2d')],_0x2e94bd['query']);_0x32f534['attributes']=_['intersection'](_0x2e94bd[_0x7278('0x2d')],qs['fields'](_0x4309b6[_0x7278('0x2e')]['fields']));_0x32f534[_0x7278('0x32')]=_0x32f534[_0x7278('0x32')][_0x7278('0x33')]?_0x32f534['attributes']:_0x2e94bd['model'];if(!_0x4309b6['query'][_0x7278('0x34')]('nolimit')){_0x32f534[_0x7278('0x1c')]=qs[_0x7278('0x1c')](_0x4309b6[_0x7278('0x2e')][_0x7278('0x1c')]);_0x32f534[_0x7278('0x1e')]=qs[_0x7278('0x1e')](_0x4309b6[_0x7278('0x2e')][_0x7278('0x1e')]);}_0x32f534[_0x7278('0x35')]=qs[_0x7278('0x36')](_0x4309b6[_0x7278('0x2e')][_0x7278('0x36')]);_0x32f534[_0x7278('0x37')]=qs[_0x7278('0x30')](_[_0x7278('0x38')](_0x4309b6[_0x7278('0x2e')],_0x2e94bd['filters']),_0x2d0b18);if(_0x4309b6['query'][_0x7278('0x39')]){_0x32f534[_0x7278('0x37')]=_[_0x7278('0x3a')](_0x32f534[_0x7278('0x37')],{'$or':_['map'](_0x2d0b18,function(_0x3f6621){if(_0x3f6621[_0x7278('0x3b')]!==_0x7278('0x3c')){var _0x530a92={};_0x530a92[_0x3f6621['name']]={'$like':'%'+_0x4309b6[_0x7278('0x2e')]['filter']+'%'};return _0x530a92;}})});}_0x32f534=_[_0x7278('0x3a')]({},_0x32f534,_0x4309b6[_0x7278('0x3d')]);var _0x4250dc={'where':_0x32f534[_0x7278('0x37')]};return db[_0x7278('0x2a')][_0x7278('0x1d')](_0x4250dc)[_0x7278('0x3e')](function(_0x2b5e26){_0x1cca94['count']=_0x2b5e26;if(_0x4309b6[_0x7278('0x2e')][_0x7278('0x3f')]){_0x32f534[_0x7278('0x40')]=[{'all':!![]}];}return db[_0x7278('0x2a')][_0x7278('0x41')](_0x32f534);})[_0x7278('0x3e')](function(_0xfa247a){_0x1cca94[_0x7278('0x42')]=_0xfa247a;return _0x1cca94;})['then'](respondWithFilteredResult(_0x10f11d,_0x32f534))[_0x7278('0x43')](handleError(_0x10f11d,null));};exports['show']=function(_0x363aca,_0x4caea1){var _0x58d882={'raw':![],'where':{'id':_0x363aca[_0x7278('0x44')]['id']}},_0x202faa={};_0x202faa[_0x7278('0x2d')]=_[_0x7278('0x2f')](db['Automation'][_0x7278('0x2b')]);_0x202faa[_0x7278('0x2e')]=_[_0x7278('0x2f')](_0x363aca[_0x7278('0x2e')]);_0x202faa[_0x7278('0x30')]=_[_0x7278('0x31')](_0x202faa[_0x7278('0x2d')],_0x202faa[_0x7278('0x2e')]);_0x58d882[_0x7278('0x32')]=_[_0x7278('0x31')](_0x202faa[_0x7278('0x2d')],qs[_0x7278('0x45')](_0x363aca[_0x7278('0x2e')][_0x7278('0x45')]));_0x58d882[_0x7278('0x32')]=_0x58d882['attributes'][_0x7278('0x33')]?_0x58d882[_0x7278('0x32')]:_0x202faa[_0x7278('0x2d')];if(_0x363aca[_0x7278('0x2e')][_0x7278('0x3f')]){_0x58d882['include']=[{'all':!![]}];}_0x58d882=_[_0x7278('0x3a')]({},_0x58d882,_0x363aca[_0x7278('0x3d')]);return db[_0x7278('0x2a')][_0x7278('0x46')](_0x58d882)['then'](handleEntityNotFound(_0x4caea1,null))[_0x7278('0x3e')](respondWithResult(_0x4caea1,null))[_0x7278('0x43')](handleError(_0x4caea1,null));};exports[_0x7278('0x47')]=function(_0x226a41,_0x2a50da){return db[_0x7278('0x2a')][_0x7278('0x47')](_0x226a41[_0x7278('0x48')],{})[_0x7278('0x3e')](respondWithResult(_0x2a50da,0xc9))['catch'](handleError(_0x2a50da,null));};exports[_0x7278('0x49')]=function(_0x515457,_0x2aaee5){if(_0x515457[_0x7278('0x48')]['id']){delete _0x515457['body']['id'];}return db[_0x7278('0x2a')][_0x7278('0x46')]({'where':{'id':_0x515457['params']['id']}})[_0x7278('0x3e')](handleEntityNotFound(_0x2aaee5,null))['then'](saveUpdates(_0x515457['body'],null))[_0x7278('0x3e')](respondWithResult(_0x2aaee5,null))['catch'](handleError(_0x2aaee5,null));};exports['destroy']=function(_0x1b3655,_0x146f9a){return db[_0x7278('0x2a')]['find']({'where':{'id':_0x1b3655[_0x7278('0x44')]['id']}})['then'](handleEntityNotFound(_0x146f9a,null))[_0x7278('0x3e')](removeEntity(_0x146f9a,null))[_0x7278('0x43')](handleError(_0x146f9a,null));};exports[_0x7278('0x4a')]=function(_0xf62cfe,_0x2c011b,_0x373af0){return db['Condition'][_0x7278('0x46')]({'where':{'id':_0xf62cfe['params']['id']}})[_0x7278('0x3e')](handleEntityNotFound(_0x2c011b,null))['then'](function(_0xe480c2){if(_0xe480c2){return _0xe480c2[_0x7278('0x4a')](_0xf62cfe[_0x7278('0x48')]['ids'],_[_0x7278('0x4b')](_0xf62cfe[_0x7278('0x48')],[_0x7278('0x4c'),'id'])||{});}})[_0x7278('0x3e')](respondWithResult(_0x2c011b,null))[_0x7278('0x43')](handleError(_0x2c011b,null));};exports[_0x7278('0x4d')]=function(_0x16913c,_0x339501,_0x59f7a4){var _0x2f85ca={};var _0x1ba7b4={};var _0xf93bc7;var _0x310ad3;return db[_0x7278('0x2a')]['findOne']({'where':{'id':_0x16913c[_0x7278('0x44')]['id']}})[_0x7278('0x3e')](handleEntityNotFound(_0x339501,null))['then'](function(_0x28b84e){if(_0x28b84e){_0xf93bc7=_0x28b84e;_0x1ba7b4[_0x7278('0x2d')]=_[_0x7278('0x2f')](db[_0x7278('0x4e')]['rawAttributes']);_0x1ba7b4['query']=_[_0x7278('0x2f')](_0x16913c['query']);_0x1ba7b4[_0x7278('0x30')]=_[_0x7278('0x31')](_0x1ba7b4[_0x7278('0x2d')],_0x1ba7b4['query']);_0x2f85ca[_0x7278('0x32')]=_[_0x7278('0x31')](_0x1ba7b4['model'],qs[_0x7278('0x45')](_0x16913c[_0x7278('0x2e')][_0x7278('0x45')]));_0x2f85ca[_0x7278('0x32')]=_0x2f85ca[_0x7278('0x32')][_0x7278('0x33')]?_0x2f85ca[_0x7278('0x32')]:_0x1ba7b4[_0x7278('0x2d')];_0x2f85ca[_0x7278('0x35')]=qs[_0x7278('0x36')](_0x16913c[_0x7278('0x2e')][_0x7278('0x36')]);_0x2f85ca[_0x7278('0x37')]=qs[_0x7278('0x30')](_[_0x7278('0x38')](_0x16913c['query'],_0x1ba7b4[_0x7278('0x30')]));if(_0x16913c[_0x7278('0x2e')][_0x7278('0x39')]){_0x2f85ca['where']=_[_0x7278('0x3a')](_0x2f85ca[_0x7278('0x37')],{'$or':_[_0x7278('0x29')](_0x2f85ca[_0x7278('0x32')],function(_0xabe7e9){var _0x3c22e4={};_0x3c22e4[_0xabe7e9]={'$like':'%'+_0x16913c[_0x7278('0x2e')][_0x7278('0x39')]+'%'};return _0x3c22e4;})});}_0x2f85ca=_[_0x7278('0x3a')]({},_0x2f85ca,_0x16913c['options']);return _0xf93bc7['getConditions'](_0x2f85ca);}})['then'](function(_0x358486){if(_0x358486){_0x310ad3=_0x358486[_0x7278('0x33')];if(!_0x16913c[_0x7278('0x2e')]['hasOwnProperty'](_0x7278('0x4f'))){_0x2f85ca[_0x7278('0x1c')]=qs[_0x7278('0x1c')](_0x16913c['query']['limit']);_0x2f85ca[_0x7278('0x1e')]=qs[_0x7278('0x1e')](_0x16913c['query'][_0x7278('0x1e')]);}return _0xf93bc7[_0x7278('0x4d')](_0x2f85ca);}})[_0x7278('0x3e')](function(_0xf1945){if(_0xf1945){return _0xf1945?{'count':_0x310ad3,'rows':_0xf1945}:null;}})['then'](respondWithResult(_0x339501,null))[_0x7278('0x43')](handleError(_0x339501,null));};exports[_0x7278('0x50')]=function(_0x2bc5b1,_0x1cc45e,_0x30e527){return db[_0x7278('0x51')][_0x7278('0x46')]({'where':{'id':_0x2bc5b1[_0x7278('0x44')]['id']}})[_0x7278('0x3e')](handleEntityNotFound(_0x1cc45e,null))[_0x7278('0x3e')](function(_0x41b79d){if(_0x41b79d){return _0x41b79d[_0x7278('0x50')](_0x2bc5b1[_0x7278('0x48')][_0x7278('0x4c')],_[_0x7278('0x4b')](_0x2bc5b1[_0x7278('0x48')],[_0x7278('0x4c'),'id'])||{});}})[_0x7278('0x3e')](respondWithResult(_0x1cc45e,null))[_0x7278('0x43')](handleError(_0x1cc45e,null));};exports[_0x7278('0x52')]=function(_0x5318ac,_0x1fc564,_0x24bb5a){var _0x32cf55={};var _0x4999fe={};var _0x34695e;var _0x18c740;return db[_0x7278('0x2a')][_0x7278('0x53')]({'where':{'id':_0x5318ac[_0x7278('0x44')]['id']}})['then'](handleEntityNotFound(_0x1fc564,null))[_0x7278('0x3e')](function(_0x2c1217){if(_0x2c1217){_0x34695e=_0x2c1217;_0x4999fe[_0x7278('0x2d')]=_['keys'](db[_0x7278('0x51')]['rawAttributes']);_0x4999fe['query']=_['keys'](_0x5318ac[_0x7278('0x2e')]);_0x4999fe[_0x7278('0x30')]=_[_0x7278('0x31')](_0x4999fe['model'],_0x4999fe[_0x7278('0x2e')]);_0x32cf55['attributes']=_[_0x7278('0x31')](_0x4999fe[_0x7278('0x2d')],qs[_0x7278('0x45')](_0x5318ac[_0x7278('0x2e')][_0x7278('0x45')]));_0x32cf55[_0x7278('0x32')]=_0x32cf55[_0x7278('0x32')][_0x7278('0x33')]?_0x32cf55[_0x7278('0x32')]:_0x4999fe['model'];_0x32cf55['order']=qs[_0x7278('0x36')](_0x5318ac[_0x7278('0x2e')][_0x7278('0x36')]);_0x32cf55[_0x7278('0x37')]=qs[_0x7278('0x30')](_['pick'](_0x5318ac[_0x7278('0x2e')],_0x4999fe[_0x7278('0x30')]));if(_0x5318ac[_0x7278('0x2e')][_0x7278('0x39')]){_0x32cf55[_0x7278('0x37')]=_['merge'](_0x32cf55['where'],{'$or':_[_0x7278('0x29')](_0x32cf55['attributes'],function(_0x58ec93){var _0x1a4d63={};_0x1a4d63[_0x58ec93]={'$like':'%'+_0x5318ac[_0x7278('0x2e')][_0x7278('0x39')]+'%'};return _0x1a4d63;})});}_0x32cf55=_[_0x7278('0x3a')]({},_0x32cf55,_0x5318ac[_0x7278('0x3d')]);return _0x34695e[_0x7278('0x52')](_0x32cf55);}})[_0x7278('0x3e')](function(_0x5ab7af){if(_0x5ab7af){_0x18c740=_0x5ab7af['length'];if(!_0x5318ac['query'][_0x7278('0x34')](_0x7278('0x4f'))){_0x32cf55[_0x7278('0x1c')]=qs[_0x7278('0x1c')](_0x5318ac[_0x7278('0x2e')]['limit']);_0x32cf55[_0x7278('0x1e')]=qs[_0x7278('0x1e')](_0x5318ac[_0x7278('0x2e')][_0x7278('0x1e')]);}return _0x34695e['getActions'](_0x32cf55);}})[_0x7278('0x3e')](function(_0x3d6693){if(_0x3d6693){return _0x3d6693?{'count':_0x18c740,'rows':_0x3d6693}:null;}})[_0x7278('0x3e')](respondWithResult(_0x1fc564,null))[_0x7278('0x43')](handleError(_0x1fc564,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 499d299..57c2682 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 _0xbe9d=['request-promise','path','./automation.attributes','exports','define','Automation','lodash','util','../../config/logger'];(function(_0x12b580,_0xb50037){var _0x2b7809=function(_0x306334){while(--_0x306334){_0x12b580['push'](_0x12b580['shift']());}};_0x2b7809(++_0xb50037);}(_0xbe9d,0x1da));var _0xdbe9=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xbe9d[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xdbe9('0x0'));var util=require(_0xdbe9('0x1'));var logger=require(_0xdbe9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdbe9('0x3'));var fs=require('fs');var path=require(_0xdbe9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdbe9('0x5'));module[_0xdbe9('0x6')]=function(_0x174735,_0x5145ce){return _0x174735[_0xdbe9('0x7')](_0xdbe9('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb37a=['exports','define','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes'];(function(_0x35bf7c,_0x3b27bc){var _0x2c9413=function(_0x547185){while(--_0x547185){_0x35bf7c['push'](_0x35bf7c['shift']());}};_0x2c9413(++_0x3b27bc);}(_0xb37a,0x12f));var _0xab37=function(_0x2a8811,_0x281afa){_0x2a8811=_0x2a8811-0x0;var _0x312324=_0xb37a[_0x2a8811];return _0x312324;};'use strict';var _=require(_0xab37('0x0'));var util=require(_0xab37('0x1'));var logger=require('../../config/logger')(_0xab37('0x2'));var moment=require(_0xab37('0x3'));var BPromise=require(_0xab37('0x4'));var rp=require(_0xab37('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab37('0x6'));var config=require(_0xab37('0x7'));var attributes=require(_0xab37('0x8'));module[_0xab37('0x9')]=function(_0x212896,_0x1e3df6){return _0x212896[_0xab37('0xa')](_0xab37('0xb'),attributes,{'tableName':_0xab37('0xc'),'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 5d7b46e..f4341be 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 _0x6302=['moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util'];(function(_0x263cb4,_0x53ce57){var _0x32a04b=function(_0x31e87b){while(--_0x31e87b){_0x263cb4['push'](_0x263cb4['shift']());}};_0x32a04b(++_0x53ce57);}(_0x6302,0x109));var _0x2630=function(_0x3cfd46,_0x51c2eb){_0x3cfd46=_0x3cfd46-0x0;var _0x2e182c=_0x6302[_0x3cfd46];return _0x2e182c;};'use strict';var _=require('lodash');var util=require(_0x2630('0x0'));var moment=require(_0x2630('0x1'));var BPromise=require(_0x2630('0x2'));var rs=require(_0x2630('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2630('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2630('0x5'));var jayson=require(_0x2630('0x6'));var client=jayson[_0x2630('0x7')][_0x2630('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2867f8,_0x19231a,_0x2e1867){return new BPromise(function(_0x353f73,_0x581f4d){return client['request'](_0x2867f8,_0x2e1867)[_0x2630('0x9')](function(_0x10ffdf){logger['info'](_0x2630('0xa'),_0x19231a,'request\x20sent');logger[_0x2630('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x19231a,_0x2630('0xc'),JSON[_0x2630('0xd')](_0x10ffdf));if(_0x10ffdf[_0x2630('0xe')]){if(_0x10ffdf[_0x2630('0xe')][_0x2630('0xf')]===0x1f4){logger[_0x2630('0xe')]('Automation,\x20%s,\x20%s',_0x19231a,_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);return _0x581f4d(_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);}logger['error'](_0x2630('0xa'),_0x19231a,_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);return _0x353f73(_0x10ffdf['error'][_0x2630('0x10')]);}else{logger['info'](_0x2630('0xa'),_0x19231a,_0x2630('0xc'));_0x353f73(_0x10ffdf[_0x2630('0x11')][_0x2630('0x10')]);}})[_0x2630('0x12')](function(_0x18b2b0){logger[_0x2630('0xe')](_0x2630('0xa'),_0x19231a,_0x18b2b0);_0x581f4d(_0x18b2b0);});});}
\ No newline at end of file
+var _0x866a=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x278e39,_0x379ba4){var _0x211e88=function(_0x38bdfa){while(--_0x38bdfa){_0x278e39['push'](_0x278e39['shift']());}};_0x211e88(++_0x379ba4);}(_0x866a,0x156));var _0xa866=function(_0x1b3a9e,_0x3b6e29){_0x1b3a9e=_0x1b3a9e-0x0;var _0x53cdc2=_0x866a[_0x1b3a9e];return _0x53cdc2;};'use strict';var _=require('lodash');var util=require(_0xa866('0x0'));var moment=require(_0xa866('0x1'));var BPromise=require(_0xa866('0x2'));var rs=require(_0xa866('0x3'));var fs=require('fs');var Redis=require(_0xa866('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa866('0x5'));var logger=require(_0xa866('0x6'))(_0xa866('0x7'));var config=require('../../config/environment');var jayson=require(_0xa866('0x8'));var client=jayson[_0xa866('0x9')][_0xa866('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288582,_0x3d1380,_0x2c7278){return new BPromise(function(_0x41a92a,_0x208625){return client[_0xa866('0xb')](_0x288582,_0x2c7278)[_0xa866('0xc')](function(_0x525ce6){logger[_0xa866('0xd')](_0xa866('0xe'),_0x3d1380,_0xa866('0xf'));logger['debug'](_0xa866('0x10'),_0x3d1380,_0xa866('0xf'),JSON[_0xa866('0x11')](_0x525ce6));if(_0x525ce6[_0xa866('0x12')]){if(_0x525ce6[_0xa866('0x12')][_0xa866('0x13')]===0x1f4){logger['error'](_0xa866('0xe'),_0x3d1380,_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);return _0x208625(_0x525ce6[_0xa866('0x12')]['message']);}logger[_0xa866('0x12')]('Automation,\x20%s,\x20%s',_0x3d1380,_0x525ce6[_0xa866('0x12')]['message']);return _0x41a92a(_0x525ce6[_0xa866('0x12')][_0xa866('0x14')]);}else{logger[_0xa866('0xd')]('Automation,\x20%s,\x20%s',_0x3d1380,_0xa866('0xf'));_0x41a92a(_0x525ce6[_0xa866('0x15')][_0xa866('0x14')]);}})[_0xa866('0x16')](function(_0x1e2211){logger[_0xa866('0x12')](_0xa866('0xe'),_0x3d1380,_0x1e2211);_0x208625(_0x1e2211);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 0702503..dbdb30f 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 _0x1a6b=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions','put','delete','/:id'];(function(_0x54128a,_0x128d4d){var _0x6b9354=function(_0x21e0b8){while(--_0x21e0b8){_0x54128a['push'](_0x54128a['shift']());}};_0x6b9354(++_0x128d4d);}(_0x1a6b,0x94));var _0xb1a6=function(_0x2d6cf6,_0xb6ac1f){_0x2d6cf6=_0x2d6cf6-0x0;var _0x50078e=_0x1a6b[_0x2d6cf6];return _0x50078e;};'use strict';var multer=require(_0xb1a6('0x0'));var util=require(_0xb1a6('0x1'));var path=require(_0xb1a6('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1a6('0x3'));var router=express[_0xb1a6('0x4')]();var fs_extra=require(_0xb1a6('0x5'));var auth=require(_0xb1a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb1a6('0x7'));var controller=require('./automation.controller');router[_0xb1a6('0x8')]('/',auth[_0xb1a6('0x9')](),controller['index']);router[_0xb1a6('0x8')]('/:id',auth[_0xb1a6('0x9')](),controller[_0xb1a6('0xa')]);router['get'](_0xb1a6('0xb'),auth[_0xb1a6('0x9')](),controller[_0xb1a6('0xc')]);router[_0xb1a6('0x8')]('/:id/actions',auth[_0xb1a6('0x9')](),controller[_0xb1a6('0xd')]);router[_0xb1a6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/conditions',auth[_0xb1a6('0x9')](),controller[_0xb1a6('0xf')]);router['post'](_0xb1a6('0x10'),auth['isAuthenticated'](),controller['addActions']);router[_0xb1a6('0x11')]('/:id',auth[_0xb1a6('0x9')](),controller['update']);router[_0xb1a6('0x12')](_0xb1a6('0x13'),auth[_0xb1a6('0x9')](),controller['destroy']);module[_0xb1a6('0x14')]=router;
\ No newline at end of file
+var _0xd730=['get','/:id/actions','post','create','/:id/conditions','addConditions','addActions','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','/:id','show'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0xd730,0xfd));var _0x0d73=function(_0x26a846,_0x261438){_0x26a846=_0x26a846-0x0;var _0x286a31=_0xd730[_0x26a846];return _0x286a31;};'use strict';var multer=require('multer');var util=require(_0x0d73('0x0'));var path=require('path');var timeout=require(_0x0d73('0x1'));var express=require('express');var router=express[_0x0d73('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0d73('0x3'));var interaction=require(_0x0d73('0x4'));var config=require(_0x0d73('0x5'));var controller=require(_0x0d73('0x6'));router['get']('/',auth[_0x0d73('0x7')](),controller[_0x0d73('0x8')]);router['get'](_0x0d73('0x9'),auth['isAuthenticated'](),controller[_0x0d73('0xa')]);router['get']('/:id/conditions',auth[_0x0d73('0x7')](),controller['getConditions']);router[_0x0d73('0xb')](_0x0d73('0xc'),auth[_0x0d73('0x7')](),controller['getActions']);router[_0x0d73('0xd')]('/',auth['isAuthenticated'](),controller[_0x0d73('0xe')]);router[_0x0d73('0xd')](_0x0d73('0xf'),auth[_0x0d73('0x7')](),controller[_0x0d73('0x10')]);router[_0x0d73('0xd')](_0x0d73('0xc'),auth[_0x0d73('0x7')](),controller[_0x0d73('0x11')]);router[_0x0d73('0x12')](_0x0d73('0x9'),auth[_0x0d73('0x7')](),controller[_0x0d73('0x13')]);router['delete'](_0x0d73('0x9'),auth[_0x0d73('0x7')](),controller[_0x0d73('0x14')]);module[_0x0d73('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index b3d332a..e44c451 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 _0x353f=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','name','ENUM','ivr','STRING','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0x353f,0x1d7));var _0xf353=function(_0xe5742c,_0x11503e){_0xe5742c=_0xe5742c-0x0;var _0x3db329=_0x353f[_0xe5742c];return _0x3db329;};'use strict';var Sequelize=require('sequelize');module[_0xf353('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf353('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf353('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xf353('0x3')},'description':{'type':Sequelize[_0xf353('0x4')]},'active':{'type':Sequelize[_0xf353('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xf353('0x6')](0x4)[_0xf353('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf353('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xf353('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf353('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf353('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf353('0x6')](0x5)[_0xf353('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf353('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf353('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf353('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf353('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf353('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf353('0x6')](0x3)[_0xf353('0x7')],'defaultValue':0x3,'comment':_0xf353('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf353('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf353('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf353('0x6')](0x3)[_0xf353('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf353('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf353('0x4')],'defaultValue':_0xf353('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xf353('0x2')](_0xf353('0x10'),_0xf353('0x11'),_0xf353('0x12')),'defaultValue':_0xf353('0x10')},'dialAMDActive':{'type':Sequelize[_0xf353('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf353('0x6')](0x9)[_0xf353('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf353('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xf353('0x6')](0x9)[_0xf353('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf353('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf353('0x6')](0x9)[_0xf353('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf353('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf353('0x6')](0x9)[_0xf353('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xf353('0x6')](0x9)[_0xf353('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf353('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf353('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf353('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf353('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xf353('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf353('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf353('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xf353('0x19'),_0xf353('0x1a')),'defaultValue':_0xf353('0x19')},'dialPrefix':{'type':Sequelize[_0xf353('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf353('0x6')](0x3)[_0xf353('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf353('0x1b')},'dialCutDigit':{'type':Sequelize[_0xf353('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf353('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf353('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf353('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf353('0x6')](0x5)[_0xf353('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf353('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xf353('0x6')](0x5)[_0xf353('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf353('0x6')](0x3)[_0xf353('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf353('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf353('0x6')](0x5)[_0xf353('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf353('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xf353('0x6')](0x3)[_0xf353('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf353('0x6')](0x5)[_0xf353('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf353('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf353('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf353('0x6')](0x5)[_0xf353('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf353('0x22')}};
\ No newline at end of file
+var _0x1071=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0xb113d7,_0x2fc306){var _0xd5a08d=function(_0x873634){while(--_0x873634){_0xb113d7['push'](_0xb113d7['shift']());}};_0xd5a08d(++_0x2fc306);}(_0x1071,0xde));var _0x1107=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1071[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x1107('0x0')]={'name':{'type':Sequelize[_0x1107('0x1')],'unique':_0x1107('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1107('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x1107('0x4')},'description':{'type':Sequelize[_0x1107('0x1')]},'active':{'type':Sequelize[_0x1107('0x5')],'defaultValue':0x0,'comment':_0x1107('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1107('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1107('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1107('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1107('0x9')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'defaultValue':0x3,'comment':_0x1107('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1107('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1107('0x1')],'defaultValue':_0x1107('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x1107('0x3')](_0x1107('0xf'),_0x1107('0x10'),_0x1107('0x11')),'defaultValue':_0x1107('0xf')},'dialAMDActive':{'type':Sequelize[_0x1107('0x5')],'defaultValue':0x0,'comment':_0x1107('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x1107('0x9')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1107('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x1107('0x9')](0x9)[_0x1107('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1107('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1107('0x9')](0x9)[_0x1107('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1107('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1107('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x1107('0x9')](0x9)[_0x1107('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1107('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1107('0x9')](0x9)[_0x1107('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1107('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1107('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1107('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1107('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1107('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1107('0x3')](_0x1107('0x1b'),_0x1107('0x1c')),'defaultValue':_0x1107('0x1b')},'dialPrefix':{'type':Sequelize[_0x1107('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1107('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1107('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1107('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1107('0x9')](0x3)[_0x1107('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1107('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1107('0x9')](0x5)[_0x1107('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1107('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index c141de8..bbe467c 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 _0x173d=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','name','send','index','map','Campaign','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','type','VIRTUAL','options','include','findAll','rows','catch','params','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','updatedAt','createdAt','user','UserProfileSection','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','onlyIfOpen','ContactId','COALESCE(phone,\x27\x27)','phone\x20IS\x20NOT\x20NULL','cmHopperId','ci.OrderBY','OrderBy','cm_contact_has_items','h.ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3418cf,_0x24b5b9){var _0x323adc=function(_0x92fe0b){while(--_0x92fe0b){_0x3418cf['push'](_0x3418cf['shift']());}};_0x323adc(++_0x24b5b9);}(_0x173d,0x108));var _0xd173=function(_0x3c54e4,_0x20a60d){_0x3c54e4=_0x3c54e4-0x0;var _0x207495=_0x173d[_0x3c54e4];return _0x207495;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd173('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd173('0x1'));var moment=require('moment');var BPromise=require(_0xd173('0x2'));var Mustache=require(_0xd173('0x3'));var util=require(_0xd173('0x4'));var path=require(_0xd173('0x5'));var sox=require(_0xd173('0x6'));var csv=require('to-csv');var ejs=require(_0xd173('0x7'));var fs=require('fs');var fs_extra=require(_0xd173('0x8'));var _=require(_0xd173('0x9'));var squel=require('squel');var crypto=require(_0xd173('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd173('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd173('0xc'));var Redis=require(_0xd173('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd173('0xe'));var as=require(_0xd173('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd173('0x10'))(_0xd173('0x11'));var utils=require(_0xd173('0x12'));var config=require(_0xd173('0x13'));var licenseUtil=require(_0xd173('0x14'));var db=require(_0xd173('0x15'))['db'];function respondWithStatusCode(_0x2a7c1d,_0x37b65a){_0x37b65a=_0x37b65a||0xcc;return function(_0x371826){if(_0x371826){return _0x2a7c1d[_0xd173('0x16')](_0x37b65a);}return _0x2a7c1d[_0xd173('0x17')](_0x37b65a)[_0xd173('0x18')]();};}function respondWithResult(_0x57d8f7,_0x29ddae){_0x29ddae=_0x29ddae||0xc8;return function(_0x5e4a79){if(_0x5e4a79){return _0x57d8f7[_0xd173('0x17')](_0x29ddae)[_0xd173('0x19')](_0x5e4a79);}};}function respondWithFilteredResult(_0x5cf801,_0x1093dc){return function(_0x26859a){if(_0x26859a){var _0x100602=typeof _0x1093dc[_0xd173('0x1a')]==='undefined'&&typeof _0x1093dc['limit']===_0xd173('0x1b');var _0x18a0c6=_0x26859a[_0xd173('0x1c')];var _0x58d7d8=_0x100602?0x0:_0x1093dc[_0xd173('0x1a')];var _0x352d17=_0x100602?_0x26859a[_0xd173('0x1c')]:_0x1093dc[_0xd173('0x1a')]+_0x1093dc['limit'];var _0x4aef50;if(_0x352d17>=_0x18a0c6){_0x352d17=_0x18a0c6;_0x4aef50=0xc8;}else{_0x4aef50=0xce;}_0x5cf801[_0xd173('0x17')](_0x4aef50);return _0x5cf801[_0xd173('0x1d')](_0xd173('0x1e'),_0x58d7d8+'-'+_0x352d17+'/'+_0x18a0c6)[_0xd173('0x19')](_0x26859a);}return null;};}function patchUpdates(_0x58e9ff){return function(_0x55727c){try{jsonpatch[_0xd173('0x1f')](_0x55727c,_0x58e9ff,!![]);}catch(_0xbe4fb4){return BPromise['reject'](_0xbe4fb4);}return _0x55727c[_0xd173('0x20')]();};}function saveUpdates(_0x3b30f7,_0x5164c2){return function(_0xb729d9){if(_0xb729d9){return _0xb729d9[_0xd173('0x21')](_0x3b30f7)['then'](function(_0xc23357){return _0xc23357;});}return null;};}function removeEntity(_0x115975,_0x564127){return function(_0x4396ad){if(_0x4396ad){return _0x4396ad[_0xd173('0x22')]()[_0xd173('0x23')](function(){var _0x42d140=_0x4396ad[_0xd173('0x24')]({'plain':!![]});var _0x10e966='IvrCampaigns';return db['UserProfileResource'][_0xd173('0x22')]({'where':{'type':_0x10e966,'resourceId':_0x42d140['id']}})[_0xd173('0x23')](function(){return _0x4396ad;});})[_0xd173('0x23')](function(){_0x115975[_0xd173('0x17')](0xcc)[_0xd173('0x18')]();});}};}function handleEntityNotFound(_0x378a07,_0x240e01){return function(_0x4191e2){if(!_0x4191e2){_0x378a07['sendStatus'](0x194);}return _0x4191e2;};}function handleError(_0x54ab40,_0xffaa27){_0xffaa27=_0xffaa27||0x1f4;return function(_0x15035c){logger['error'](_0x15035c['stack']);if(_0x15035c[_0xd173('0x25')]){delete _0x15035c[_0xd173('0x25')];}_0x54ab40[_0xd173('0x17')](_0xffaa27)[_0xd173('0x26')](_0x15035c);};}exports[_0xd173('0x27')]=function(_0x9bd71a,_0x5172be){var _0x5a56e0={},_0x142273={},_0x3b034b={'count':0x0,'rows':[]};var _0x49c73b=_[_0xd173('0x28')](db[_0xd173('0x29')][_0xd173('0x2a')],function(_0x2705e7){return{'name':_0x2705e7[_0xd173('0x2b')],'type':_0x2705e7['type'][_0xd173('0x2c')]};});_0x142273['model']=_[_0xd173('0x28')](_0x49c73b,_0xd173('0x25'));_0x142273['query']=_[_0xd173('0x2d')](_0x9bd71a[_0xd173('0x2e')]);_0x142273[_0xd173('0x2f')]=_[_0xd173('0x30')](_0x142273[_0xd173('0x31')],_0x142273['query']);_0x5a56e0[_0xd173('0x32')]=_[_0xd173('0x30')](_0x142273[_0xd173('0x31')],qs[_0xd173('0x33')](_0x9bd71a[_0xd173('0x2e')][_0xd173('0x33')]));_0x5a56e0['attributes']=_0x5a56e0[_0xd173('0x32')][_0xd173('0x34')]?_0x5a56e0[_0xd173('0x32')]:_0x142273['model'];if(!_0x9bd71a['query'][_0xd173('0x35')](_0xd173('0x36'))){_0x5a56e0[_0xd173('0x37')]=qs['limit'](_0x9bd71a[_0xd173('0x2e')][_0xd173('0x37')]);_0x5a56e0[_0xd173('0x1a')]=qs[_0xd173('0x1a')](_0x9bd71a[_0xd173('0x2e')]['offset']);}_0x5a56e0[_0xd173('0x38')]=qs['sort'](_0x9bd71a[_0xd173('0x2e')][_0xd173('0x39')]);_0x5a56e0[_0xd173('0x3a')]=qs['filters'](_['pick'](_0x9bd71a[_0xd173('0x2e')],_0x142273['filters']),_0x49c73b);if(_0x9bd71a[_0xd173('0x2e')][_0xd173('0x3b')]){_0x5a56e0['where']=_['merge'](_0x5a56e0[_0xd173('0x3a')],{'$or':_[_0xd173('0x28')](_0x49c73b,function(_0x3d469a){if(_0x3d469a[_0xd173('0x3c')]!==_0xd173('0x3d')){var _0x17696a={};_0x17696a[_0x3d469a[_0xd173('0x25')]]={'$like':'%'+_0x9bd71a[_0xd173('0x2e')][_0xd173('0x3b')]+'%'};return _0x17696a;}})});}_0x5a56e0=_['merge']({},_0x5a56e0,_0x9bd71a[_0xd173('0x3e')]);var _0x563dd9={'where':_0x5a56e0[_0xd173('0x3a')]};return db[_0xd173('0x29')][_0xd173('0x1c')](_0x563dd9)[_0xd173('0x23')](function(_0x4610ad){_0x3b034b['count']=_0x4610ad;if(_0x9bd71a['query']['includeAll']){_0x5a56e0[_0xd173('0x3f')]=[{'all':!![]}];}return db[_0xd173('0x29')][_0xd173('0x40')](_0x5a56e0);})[_0xd173('0x23')](function(_0x38907d){_0x3b034b[_0xd173('0x41')]=_0x38907d;return _0x3b034b;})[_0xd173('0x23')](respondWithFilteredResult(_0x5172be,_0x5a56e0))[_0xd173('0x42')](handleError(_0x5172be,null));};exports['show']=function(_0x47fe20,_0x2716cb){var _0x240c47={'raw':![],'where':{'id':_0x47fe20[_0xd173('0x43')]['id']}},_0x2c1421={};_0x2c1421[_0xd173('0x31')]=_[_0xd173('0x2d')](db[_0xd173('0x29')][_0xd173('0x2a')]);_0x2c1421['query']=_[_0xd173('0x2d')](_0x47fe20['query']);_0x2c1421[_0xd173('0x2f')]=_['intersection'](_0x2c1421[_0xd173('0x31')],_0x2c1421[_0xd173('0x2e')]);_0x240c47['attributes']=_[_0xd173('0x30')](_0x2c1421[_0xd173('0x31')],qs[_0xd173('0x33')](_0x47fe20[_0xd173('0x2e')][_0xd173('0x33')]));_0x240c47[_0xd173('0x32')]=_0x240c47[_0xd173('0x32')]['length']?_0x240c47['attributes']:_0x2c1421[_0xd173('0x31')];if(_0x47fe20[_0xd173('0x2e')]['includeAll']){_0x240c47[_0xd173('0x3f')]=[{'all':!![]}];}_0x240c47=_[_0xd173('0x44')]({},_0x240c47,_0x47fe20[_0xd173('0x3e')]);return db[_0xd173('0x29')][_0xd173('0x45')](_0x240c47)['then'](handleEntityNotFound(_0x2716cb,null))[_0xd173('0x23')](respondWithResult(_0x2716cb,null))[_0xd173('0x42')](handleError(_0x2716cb,null));};exports[_0xd173('0x46')]=function(_0xdf7c4f,_0x350944){return db['Campaign'][_0xd173('0x46')](_0xdf7c4f[_0xd173('0x47')],{})['then'](function(_0x385c91){var _0x45338a=_0xdf7c4f['user'][_0xd173('0x24')]({'plain':!![]});if(!_0x45338a)throw new Error(_0xd173('0x48'));if(_0x45338a[_0xd173('0x49')]==='user'){var _0x26f369=_0x385c91[_0xd173('0x24')]({'plain':!![]});var _0x4c871c=_0xd173('0x4a');return db['UserProfileSection'][_0xd173('0x45')]({'where':{'name':_0x4c871c,'userProfileId':_0x45338a[_0xd173('0x4b')]},'raw':!![]})[_0xd173('0x23')](function(_0x472b57){if(_0x472b57&&_0x472b57[_0xd173('0x4c')]===0x0){return db[_0xd173('0x4d')][_0xd173('0x46')]({'name':_0x26f369[_0xd173('0x25')],'resourceId':_0x26f369['id'],'type':_0x472b57[_0xd173('0x25')],'sectionId':_0x472b57['id']},{})[_0xd173('0x23')](function(){return _0x385c91;});}else{return _0x385c91;}})[_0xd173('0x42')](function(_0x29988b){logger[_0xd173('0x4e')](_0xd173('0x4f'),_0x29988b);throw _0x29988b;});}return _0x385c91;})[_0xd173('0x23')](respondWithResult(_0x350944,0xc9))[_0xd173('0x42')](handleError(_0x350944,null));};exports[_0xd173('0x50')]=function(_0x30e863,_0x1c5be7){var _0x3861a4={'where':{'id':_0x30e863[_0xd173('0x43')]['id']}},_0x401ac5={};_0x401ac5[_0xd173('0x31')]=_['keys'](db[_0xd173('0x29')][_0xd173('0x2a')]);_0x3861a4['attributes']=_[_0xd173('0x30')](_0x401ac5['model'],qs[_0xd173('0x33')](_0x30e863[_0xd173('0x2e')][_0xd173('0x33')]));_0x3861a4[_0xd173('0x32')]=_0x3861a4[_0xd173('0x32')][_0xd173('0x34')]?_0x3861a4[_0xd173('0x32')]:_0x401ac5['model'];if(_0x30e863['query'][_0xd173('0x51')]){_0x3861a4[_0xd173('0x3f')]=[{'all':!![]}];}_0x3861a4=_[_0xd173('0x44')]({},_0x3861a4,_0x30e863['options']);return db[_0xd173('0x29')][_0xd173('0x45')](_0x3861a4)[_0xd173('0x23')](handleEntityNotFound(_0x1c5be7,null))[_0xd173('0x23')](function(_0x3789b8){if(_0x3789b8){var _0x36b2a8=_0x3789b8[_0xd173('0x24')]({'plain':!![]});_0x36b2a8=qs[_0xd173('0x52')](_0x36b2a8,['id','createdAt',_0xd173('0x53')]);_0x30e863[_0xd173('0x47')]=_[_0xd173('0x52')](_0x30e863[_0xd173('0x47')],['id',_0xd173('0x54'),_0xd173('0x53')]);return db[_0xd173('0x29')]['create'](_[_0xd173('0x44')](_0x36b2a8,_0x30e863[_0xd173('0x47')]),{'include':_0x30e863[_0xd173('0x2e')][_0xd173('0x51')]?[{'all':!![]}]:undefined})[_0xd173('0x23')](function(_0x1b7b77){var _0x13ad8b=_0x30e863[_0xd173('0x55')]['get']({'plain':!![]});if(!_0x13ad8b)throw new Error(_0xd173('0x48'));if(_0x13ad8b['role']===_0xd173('0x55')){var _0x23c8c3=_0x1b7b77[_0xd173('0x24')]({'plain':!![]});var _0x49cfb4=_0xd173('0x4a');return db[_0xd173('0x56')][_0xd173('0x45')]({'where':{'name':_0x49cfb4,'userProfileId':_0x13ad8b[_0xd173('0x4b')]},'raw':!![]})[_0xd173('0x23')](function(_0x3336aa){if(_0x3336aa&&_0x3336aa['autoAssociation']===0x0){return db[_0xd173('0x4d')][_0xd173('0x46')]({'name':_0x23c8c3[_0xd173('0x25')],'resourceId':_0x23c8c3['id'],'type':_0x3336aa[_0xd173('0x25')],'sectionId':_0x3336aa['id']},{})['then'](function(){return _0x1b7b77;});}else{return _0x1b7b77;}})[_0xd173('0x42')](function(_0xecdf04){logger[_0xd173('0x4e')](_0xd173('0x4f'),_0xecdf04);throw _0xecdf04;});}return _0x1b7b77;});}})[_0xd173('0x23')](respondWithResult(_0x1c5be7,0xc9))[_0xd173('0x42')](handleError(_0x1c5be7,null));};exports[_0xd173('0x21')]=function(_0x521421,_0x4256aa){if(_0x521421[_0xd173('0x47')]['id']){delete _0x521421[_0xd173('0x47')]['id'];}return db[_0xd173('0x29')][_0xd173('0x45')]({'where':{'id':_0x521421[_0xd173('0x43')]['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x4256aa,null))[_0xd173('0x23')](saveUpdates(_0x521421['body'],null))[_0xd173('0x23')](respondWithResult(_0x4256aa,null))['catch'](handleError(_0x4256aa,null));};exports['destroy']=function(_0x49faac,_0x345cb3){return db[_0xd173('0x29')][_0xd173('0x45')]({'where':{'id':_0x49faac[_0xd173('0x43')]['id']}})['then'](handleEntityNotFound(_0x345cb3,null))['then'](removeEntity(_0x345cb3,null))[_0xd173('0x42')](handleError(_0x345cb3,null));};exports['getHoppers']=function(_0x3d6111,_0x393cb8,_0x502d0b){var _0x21902b={'raw':!![],'where':{}};var _0xf70f06={};var _0x1d06d4={'count':0x0,'rows':[]};return db[_0xd173('0x29')][_0xd173('0x57')]({'where':{'id':_0x3d6111[_0xd173('0x43')]['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x393cb8,null))[_0xd173('0x23')](function(_0x3a0126){if(_0x3a0126){_0xf70f06[_0xd173('0x31')]=_[_0xd173('0x2d')](db[_0xd173('0x58')][_0xd173('0x2a')]);_0xf70f06[_0xd173('0x2e')]=_[_0xd173('0x2d')](_0x3d6111[_0xd173('0x2e')]);_0xf70f06[_0xd173('0x2f')]=_[_0xd173('0x30')](_0xf70f06[_0xd173('0x31')],_0xf70f06[_0xd173('0x2e')]);_0x21902b[_0xd173('0x32')]=_[_0xd173('0x30')](_0xf70f06[_0xd173('0x31')],qs['fields'](_0x3d6111[_0xd173('0x2e')][_0xd173('0x33')]));_0x21902b[_0xd173('0x32')]=_0x21902b[_0xd173('0x32')]['length']?_0x21902b[_0xd173('0x32')]:_0xf70f06[_0xd173('0x31')];if(!_0x3d6111[_0xd173('0x2e')]['hasOwnProperty']('nolimit')){_0x21902b['limit']=qs[_0xd173('0x37')](_0x3d6111[_0xd173('0x2e')][_0xd173('0x37')]);_0x21902b[_0xd173('0x1a')]=qs[_0xd173('0x1a')](_0x3d6111['query'][_0xd173('0x1a')]);}_0x21902b[_0xd173('0x38')]=qs[_0xd173('0x39')](_0x3d6111[_0xd173('0x2e')][_0xd173('0x39')]);_0x21902b[_0xd173('0x3a')]=qs[_0xd173('0x2f')](_[_0xd173('0x59')](_0x3d6111[_0xd173('0x2e')],_0xf70f06[_0xd173('0x2f')]));_0x21902b[_0xd173('0x3a')][_0xd173('0x5a')]=_0x3a0126['id'];if(_0x3d6111['query'][_0xd173('0x3b')]){_0x21902b[_0xd173('0x3a')]=_[_0xd173('0x44')](_0x21902b[_0xd173('0x3a')],{'$or':_['map'](_0x21902b[_0xd173('0x32')],function(_0x11a019){var _0x2fbd96={};_0x2fbd96[_0x11a019]={'$like':'%'+_0x3d6111[_0xd173('0x2e')][_0xd173('0x3b')]+'%'};return _0x2fbd96;})});}_0x21902b=_['merge']({},_0x21902b,_0x3d6111[_0xd173('0x3e')]);return db[_0xd173('0x58')][_0xd173('0x1c')]({'where':_0x21902b['where']})['then'](function(_0x45388f){_0x1d06d4[_0xd173('0x1c')]=_0x45388f;if(_0x3d6111[_0xd173('0x2e')]['includeAll']){_0x21902b[_0xd173('0x3f')]=[{'all':!![]}];}return db[_0xd173('0x58')][_0xd173('0x40')](_0x21902b);})[_0xd173('0x23')](function(_0x33d9c6){_0x1d06d4['rows']=_0x33d9c6;return _0x1d06d4;});}})[_0xd173('0x23')](respondWithFilteredResult(_0x393cb8,_0x21902b))[_0xd173('0x42')](handleError(_0x393cb8,null));};exports[_0xd173('0x5b')]=function(_0xa4e543,_0x6667ed,_0x287536){var _0x50c957={'raw':!![],'where':{}};var _0x38c3ad={};var _0x386c51={'count':0x0,'rows':[]};return db[_0xd173('0x29')][_0xd173('0x57')]({'where':{'id':_0xa4e543[_0xd173('0x43')]['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x6667ed,null))['then'](function(_0x2733a3){if(_0x2733a3){_0x38c3ad['model']=_[_0xd173('0x2d')](db[_0xd173('0x5c')][_0xd173('0x2a')]);_0x38c3ad['query']=_['keys'](_0xa4e543[_0xd173('0x2e')]);_0x38c3ad['filters']=_['intersection'](_0x38c3ad['model'],_0x38c3ad[_0xd173('0x2e')]);_0x50c957[_0xd173('0x32')]=_[_0xd173('0x30')](_0x38c3ad[_0xd173('0x31')],qs[_0xd173('0x33')](_0xa4e543['query'][_0xd173('0x33')]));_0x50c957['attributes']=_0x50c957[_0xd173('0x32')][_0xd173('0x34')]?_0x50c957[_0xd173('0x32')]:_0x38c3ad[_0xd173('0x31')];if(!_0xa4e543[_0xd173('0x2e')][_0xd173('0x35')](_0xd173('0x36'))){_0x50c957['limit']=qs[_0xd173('0x37')](_0xa4e543[_0xd173('0x2e')][_0xd173('0x37')]);_0x50c957[_0xd173('0x1a')]=qs['offset'](_0xa4e543['query'][_0xd173('0x1a')]);}_0x50c957[_0xd173('0x38')]=qs['sort'](_0xa4e543[_0xd173('0x2e')][_0xd173('0x39')]);_0x50c957[_0xd173('0x3a')]=qs['filters'](_['pick'](_0xa4e543[_0xd173('0x2e')],_0x38c3ad[_0xd173('0x2f')]));_0x50c957[_0xd173('0x3a')]['CampaignId']=_0x2733a3['id'];if(_0xa4e543[_0xd173('0x2e')][_0xd173('0x3b')]){_0x50c957[_0xd173('0x3a')]=_[_0xd173('0x44')](_0x50c957[_0xd173('0x3a')],{'$or':_[_0xd173('0x28')](_0x50c957[_0xd173('0x32')],function(_0x55625a){var _0x352616={};_0x352616[_0x55625a]={'$like':'%'+_0xa4e543[_0xd173('0x2e')][_0xd173('0x3b')]+'%'};return _0x352616;})});}_0x50c957=_[_0xd173('0x44')]({},_0x50c957,_0xa4e543['options']);return db[_0xd173('0x5c')][_0xd173('0x1c')]({'where':_0x50c957['where']})['then'](function(_0x7e300f){_0x386c51[_0xd173('0x1c')]=_0x7e300f;if(_0xa4e543[_0xd173('0x2e')][_0xd173('0x51')]){_0x50c957['include']=[{'all':!![]}];}return db[_0xd173('0x5c')][_0xd173('0x40')](_0x50c957);})[_0xd173('0x23')](function(_0x50e22c){_0x386c51[_0xd173('0x41')]=_0x50e22c;return _0x386c51;});}})[_0xd173('0x23')](respondWithFilteredResult(_0x6667ed,_0x50c957))[_0xd173('0x42')](handleError(_0x6667ed,null));};exports[_0xd173('0x5d')]=function(_0x2b805a,_0x83f733,_0x267f3c){var _0x556b5a={'raw':!![],'where':{}};var _0x3548e6={};var _0x3a2da9={'count':0x0,'rows':[]};return db[_0xd173('0x29')][_0xd173('0x57')]({'where':{'id':_0x2b805a['params']['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x83f733,null))['then'](function(_0x56f610){if(_0x56f610){_0x3548e6[_0xd173('0x31')]=_['keys'](db['CmHopperFinal'][_0xd173('0x2a')]);_0x3548e6['query']=_[_0xd173('0x2d')](_0x2b805a[_0xd173('0x2e')]);_0x3548e6[_0xd173('0x2f')]=_['intersection'](_0x3548e6[_0xd173('0x31')],_0x3548e6[_0xd173('0x2e')]);_0x556b5a[_0xd173('0x32')]=_[_0xd173('0x30')](_0x3548e6[_0xd173('0x31')],qs[_0xd173('0x33')](_0x2b805a[_0xd173('0x2e')][_0xd173('0x33')]));_0x556b5a[_0xd173('0x32')]=_0x556b5a[_0xd173('0x32')][_0xd173('0x34')]?_0x556b5a[_0xd173('0x32')]:_0x3548e6['model'];if(!_0x2b805a[_0xd173('0x2e')][_0xd173('0x35')](_0xd173('0x36'))){_0x556b5a[_0xd173('0x37')]=qs['limit'](_0x2b805a['query'][_0xd173('0x37')]);_0x556b5a[_0xd173('0x1a')]=qs[_0xd173('0x1a')](_0x2b805a[_0xd173('0x2e')][_0xd173('0x1a')]);}_0x556b5a[_0xd173('0x38')]=qs[_0xd173('0x39')](_0x2b805a['query']['sort']);_0x556b5a['where']=qs[_0xd173('0x2f')](_[_0xd173('0x59')](_0x2b805a[_0xd173('0x2e')],_0x3548e6[_0xd173('0x2f')]));_0x556b5a[_0xd173('0x3a')]['CampaignId']=_0x56f610['id'];if(_0x2b805a[_0xd173('0x2e')][_0xd173('0x3b')]){_0x556b5a[_0xd173('0x3a')]=_[_0xd173('0x44')](_0x556b5a['where'],{'$or':_['map'](_0x556b5a[_0xd173('0x32')],function(_0x3648c4){var _0x511f2f={};_0x511f2f[_0x3648c4]={'$like':'%'+_0x2b805a[_0xd173('0x2e')][_0xd173('0x3b')]+'%'};return _0x511f2f;})});}_0x556b5a=_[_0xd173('0x44')]({},_0x556b5a,_0x2b805a[_0xd173('0x3e')]);return db[_0xd173('0x5e')][_0xd173('0x1c')]({'where':_0x556b5a['where']})[_0xd173('0x23')](function(_0x3c1dac){_0x3a2da9['count']=_0x3c1dac;if(_0x2b805a[_0xd173('0x2e')][_0xd173('0x51')]){_0x556b5a[_0xd173('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd173('0x40')](_0x556b5a);})[_0xd173('0x23')](function(_0x2766e9){_0x3a2da9[_0xd173('0x41')]=_0x2766e9;return _0x3a2da9;});}})['then'](respondWithFilteredResult(_0x83f733,_0x556b5a))[_0xd173('0x42')](handleError(_0x83f733,null));};exports[_0xd173('0x5f')]=function(_0x3a4837,_0x578986,_0x3dcbd3){var _0xaed917={'raw':!![],'where':{}};var _0x2993d6={};var _0x6b3212={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3a4837['params']['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x578986,null))['then'](function(_0x5dc71d){if(_0x5dc71d){_0x2993d6[_0xd173('0x31')]=_[_0xd173('0x2d')](db[_0xd173('0x60')][_0xd173('0x2a')]);_0x2993d6[_0xd173('0x2e')]=_['keys'](_0x3a4837[_0xd173('0x2e')]);_0x2993d6['filters']=_['intersection'](_0x2993d6[_0xd173('0x31')],_0x2993d6[_0xd173('0x2e')]);_0xaed917['attributes']=_[_0xd173('0x30')](_0x2993d6[_0xd173('0x31')],qs[_0xd173('0x33')](_0x3a4837[_0xd173('0x2e')]['fields']));_0xaed917[_0xd173('0x32')]=_0xaed917['attributes']['length']?_0xaed917['attributes']:_0x2993d6[_0xd173('0x31')];if(!_0x3a4837[_0xd173('0x2e')][_0xd173('0x35')]('nolimit')){_0xaed917[_0xd173('0x37')]=qs[_0xd173('0x37')](_0x3a4837[_0xd173('0x2e')][_0xd173('0x37')]);_0xaed917[_0xd173('0x1a')]=qs[_0xd173('0x1a')](_0x3a4837[_0xd173('0x2e')][_0xd173('0x1a')]);}_0xaed917[_0xd173('0x38')]=qs[_0xd173('0x39')](_0x3a4837['query']['sort']);_0xaed917[_0xd173('0x3a')]=qs[_0xd173('0x2f')](_[_0xd173('0x59')](_0x3a4837[_0xd173('0x2e')],_0x2993d6[_0xd173('0x2f')]));_0xaed917[_0xd173('0x3a')][_0xd173('0x5a')]=_0x5dc71d['id'];if(_0x3a4837[_0xd173('0x2e')][_0xd173('0x3b')]){_0xaed917[_0xd173('0x3a')]=_[_0xd173('0x44')](_0xaed917['where'],{'$or':_[_0xd173('0x28')](_0xaed917[_0xd173('0x32')],function(_0x213f10){var _0x48f92f={};_0x48f92f[_0x213f10]={'$like':'%'+_0x3a4837['query'][_0xd173('0x3b')]+'%'};return _0x48f92f;})});}_0xaed917=_[_0xd173('0x44')]({},_0xaed917,_0x3a4837[_0xd173('0x3e')]);return db[_0xd173('0x60')]['count']({'where':_0xaed917[_0xd173('0x3a')]})[_0xd173('0x23')](function(_0x4e6927){_0x6b3212['count']=_0x4e6927;if(_0x3a4837[_0xd173('0x2e')]['includeAll']){_0xaed917[_0xd173('0x3f')]=[{'all':!![]}];}return db[_0xd173('0x60')][_0xd173('0x40')](_0xaed917);})[_0xd173('0x23')](function(_0x49d7f2){_0x6b3212[_0xd173('0x41')]=_0x49d7f2;return _0x6b3212;});}})['then'](respondWithFilteredResult(_0x578986,_0xaed917))[_0xd173('0x42')](handleError(_0x578986,null));};exports[_0xd173('0x61')]=function(_0x52e42f,_0x1bd35e,_0xec4aac){var _0x116b04={};var _0xd86a9e={};var _0x5ca7a8;var _0x50052c;return db[_0xd173('0x29')]['findOne']({'where':{'id':_0x52e42f[_0xd173('0x43')]['id']}})['then'](handleEntityNotFound(_0x1bd35e,null))['then'](function(_0x4115e8){if(_0x4115e8){_0x5ca7a8=_0x4115e8;_0xd86a9e['model']=_[_0xd173('0x2d')](db[_0xd173('0x62')][_0xd173('0x2a')]);_0xd86a9e[_0xd173('0x2e')]=_[_0xd173('0x2d')](_0x52e42f[_0xd173('0x2e')]);_0xd86a9e['filters']=_[_0xd173('0x30')](_0xd86a9e[_0xd173('0x31')],_0xd86a9e['query']);_0x116b04['attributes']=_[_0xd173('0x30')](_0xd86a9e[_0xd173('0x31')],qs[_0xd173('0x33')](_0x52e42f[_0xd173('0x2e')][_0xd173('0x33')]));_0x116b04[_0xd173('0x32')]=_0x116b04['attributes']['length']?_0x116b04[_0xd173('0x32')]:_0xd86a9e['model'];_0x116b04[_0xd173('0x38')]=qs['sort'](_0x52e42f[_0xd173('0x2e')][_0xd173('0x39')]);_0x116b04['where']=qs[_0xd173('0x2f')](_[_0xd173('0x59')](_0x52e42f[_0xd173('0x2e')],_0xd86a9e[_0xd173('0x2f')]));if(_0x52e42f[_0xd173('0x2e')]['filter']){_0x116b04[_0xd173('0x3a')]=_[_0xd173('0x44')](_0x116b04[_0xd173('0x3a')],{'$or':_['map'](_0x116b04[_0xd173('0x32')],function(_0x2b9388){var _0x536d02={};_0x536d02[_0x2b9388]={'$like':'%'+_0x52e42f[_0xd173('0x2e')][_0xd173('0x3b')]+'%'};return _0x536d02;})});}_0x116b04=_[_0xd173('0x44')]({},_0x116b04,_0x52e42f[_0xd173('0x3e')]);return _0x5ca7a8['getLists'](_0x116b04);}})[_0xd173('0x23')](function(_0xc51e6e){if(_0xc51e6e){_0x50052c=_0xc51e6e['length'];if(!_0x52e42f[_0xd173('0x2e')][_0xd173('0x35')](_0xd173('0x36'))){_0x116b04['limit']=qs['limit'](_0x52e42f['query']['limit']);_0x116b04['offset']=qs[_0xd173('0x1a')](_0x52e42f[_0xd173('0x2e')][_0xd173('0x1a')]);}return _0x5ca7a8[_0xd173('0x61')](_0x116b04);}})[_0xd173('0x23')](function(_0x5d2618){if(_0x5d2618){return _0x5d2618?{'count':_0x50052c,'rows':_0x5d2618}:null;}})[_0xd173('0x23')](respondWithResult(_0x1bd35e,null))[_0xd173('0x42')](handleError(_0x1bd35e,null));};exports[_0xd173('0x63')]=function(_0x45d8b9,_0x240548,_0x2a62f9){var _0x4e9d6c,_0x11174f;var _0x36eb9d=[];var _0x3e606a=moment()[_0xd173('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xd173('0x29')][_0xd173('0x45')]({'where':{'id':_0x45d8b9['params']['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x240548,null))[_0xd173('0x23')](function(_0x2dbd81){if(_0x2dbd81){_0x11174f=_0x2dbd81;return _0x2dbd81[_0xd173('0x63')](_0x45d8b9[_0xd173('0x47')][_0xd173('0x65')],_[_0xd173('0x52')](_0x45d8b9[_0xd173('0x47')],['ids','id'])||{});}return null;})[_0xd173('0x66')](function(_0x7a5119){var _0x1e5165;var _0x406930;_0x4e9d6c=_0x7a5119||[];var _0x36f4a5=[];if(_0x7a5119){for(var _0x2e7763=0x0;_0x2e7763<_0x7a5119[_0xd173('0x34')];_0x2e7763+=0x1){var _0x67eab9=_0x7a5119[_0x2e7763][_0xd173('0x24')]({'plain':!![]});_0x11174f[_0xd173('0x67')]=_0x45d8b9[_0xd173('0x47')][_0xd173('0x67')]?_0x45d8b9[_0xd173('0x47')][_0xd173('0x67')]:_0x11174f[_0xd173('0x67')];switch(_0x11174f[_0xd173('0x67')]){case _0xd173('0x68'):_0x1e5165=squel[_0xd173('0x69')]()[_0xd173('0x6a')](_0xd173('0x6b'))[_0xd173('0x6c')]([_0xd173('0x6d'),'scheduledAt','ContactId',_0xd173('0x6e'),_0xd173('0x5a'),_0xd173('0x54'),_0xd173('0x53')],squel[_0xd173('0x6f')]()[_0xd173('0x70')]('phone',_0xd173('0x6d'))[_0xd173('0x70')](_0xd173('0x71'),_0xd173('0x72'))[_0xd173('0x70')]('id','ContactId')[_0xd173('0x70')](_0x67eab9['CmListId'][_0xd173('0x73')](),_0xd173('0x6e'))['field'](_0x45d8b9['params']['id'][_0xd173('0x73')](),_0xd173('0x5a'))[_0xd173('0x70')]('\x27'+_0x3e606a+'\x27','createdAt')[_0xd173('0x70')]('\x27'+_0x3e606a+'\x27','updatedAt')['from'](_0xd173('0x74'))[_0xd173('0x3a')](_0xd173('0x75'))[_0xd173('0x3a')](_0xd173('0x76'),_0x67eab9[_0xd173('0x77')][_0xd173('0x73')]())[_0xd173('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xd173('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd173('0x6f')]()[_0xd173('0x70')](_0xd173('0x78'))['from'](_0xd173('0x79'))[_0xd173('0x3a')](_0xd173('0x7a'),_0x45d8b9['params']['id'][_0xd173('0x73')]()))[_0xd173('0x3a')](_0xd173('0x7b'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xd173('0x7c')](_0xd173('0x6b'))['where']('CampaignId\x20=\x20?',_0x45d8b9[_0xd173('0x43')]['id'][_0xd173('0x73')]())))[_0xd173('0x73')]();break;case _0xd173('0x7d'):_0x1e5165=squel['insert']()['into'](_0xd173('0x6b'))[_0xd173('0x6c')]([_0xd173('0x6d'),'scheduledAt',_0xd173('0x7e'),_0xd173('0x6e'),_0xd173('0x5a'),_0xd173('0x54'),_0xd173('0x53')],squel[_0xd173('0x6f')]()[_0xd173('0x70')]('phone',_0xd173('0x6d'))['field']('NOW()',_0xd173('0x72'))['field']('id','ContactId')['field'](_0x67eab9[_0xd173('0x77')]['toString'](),_0xd173('0x6e'))[_0xd173('0x70')](_0x45d8b9[_0xd173('0x43')]['id'][_0xd173('0x73')](),'CampaignId')['field']('\x27'+_0x3e606a+'\x27',_0xd173('0x54'))['field']('\x27'+_0x3e606a+'\x27',_0xd173('0x53'))[_0xd173('0x7c')](_0xd173('0x74'))[_0xd173('0x3a')](_0xd173('0x75'))['where'](_0xd173('0x76'),_0x67eab9[_0xd173('0x77')]['toString']())[_0xd173('0x3a')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd173('0x7b'),squel[_0xd173('0x6f')]()[_0xd173('0x70')](_0xd173('0x7f'))[_0xd173('0x7c')](_0xd173('0x6b'))[_0xd173('0x3a')](_0xd173('0x7a'),_0x45d8b9[_0xd173('0x43')]['id'][_0xd173('0x73')]())))[_0xd173('0x73')]();break;default:_0x1e5165=squel[_0xd173('0x69')]()[_0xd173('0x6a')](_0xd173('0x6b'))[_0xd173('0x6c')]([_0xd173('0x6d'),_0xd173('0x72'),_0xd173('0x7e'),_0xd173('0x6e'),_0xd173('0x5a'),_0xd173('0x54'),_0xd173('0x53')],squel[_0xd173('0x6f')]()[_0xd173('0x70')](_0xd173('0x6d'),_0xd173('0x6d'))[_0xd173('0x70')]('NOW()','scheduledAt')[_0xd173('0x70')]('id',_0xd173('0x7e'))[_0xd173('0x70')](_0x67eab9[_0xd173('0x77')][_0xd173('0x73')](),_0xd173('0x6e'))['field'](_0x45d8b9[_0xd173('0x43')]['id'][_0xd173('0x73')](),_0xd173('0x5a'))['field']('\x27'+_0x3e606a+'\x27',_0xd173('0x54'))[_0xd173('0x70')]('\x27'+_0x3e606a+'\x27',_0xd173('0x53'))['from'](_0xd173('0x74'))[_0xd173('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0xd173('0x76'),_0x67eab9[_0xd173('0x77')][_0xd173('0x73')]())[_0xd173('0x3a')](_0xd173('0x80')))['toString']();}_0x406930=squel[_0xd173('0x69')]()[_0xd173('0x6a')]('cm_hopper_additional_phones')['fromQuery']([_0xd173('0x81'),'scheduledAt','phone','OrderBy',_0xd173('0x54'),_0xd173('0x53')],squel[_0xd173('0x6f')]()[_0xd173('0x70')]('h.id','id')['field'](_0xd173('0x71'),_0xd173('0x72'))['field']('ci.item','phone')[_0xd173('0x70')](_0xd173('0x82'),_0xd173('0x83'))[_0xd173('0x70')]('\x27'+_0x3e606a+'\x27','createdAt')[_0xd173('0x70')]('\x27'+_0x3e606a+'\x27',_0xd173('0x53'))[_0xd173('0x7c')](_0xd173('0x84'),'ci')['join'](_0xd173('0x6b'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0xd173('0x85'),_0x67eab9[_0xd173('0x77')][_0xd173('0x73')]())[_0xd173('0x3a')]('h.CampaignId=?',_0x45d8b9[_0xd173('0x43')]['id']['toString']())[_0xd173('0x3a')]('h.createdAt\x20=\x20?',_0x3e606a))[_0xd173('0x73')]();_0x36f4a5[_0xd173('0x86')](db[_0xd173('0x87')][_0xd173('0x2e')](_0x1e5165));_0x36eb9d[_0xd173('0x86')](db[_0xd173('0x87')][_0xd173('0x2e')](_0x406930));}return BPromise[_0xd173('0x88')](_0x36f4a5);}})[_0xd173('0x23')](function(){return BPromise[_0xd173('0x88')](_0x36eb9d);})['then'](function(){return _0x4e9d6c;})[_0xd173('0x23')](respondWithResult(_0x240548,null))[_0xd173('0x42')](handleError(_0x240548,null));};exports[_0xd173('0x89')]=function(_0x3bf455,_0x10c8a7,_0x48e5e5){return db[_0xd173('0x29')][_0xd173('0x45')]({'where':{'id':_0x3bf455[_0xd173('0x43')]['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x10c8a7,null))[_0xd173('0x23')](function(_0x256161){if(_0x256161){return _0x256161[_0xd173('0x89')](_0x3bf455[_0xd173('0x2e')][_0xd173('0x65')]);}})[_0xd173('0x23')](function(_0x341d39){if(_0x341d39){return db['CmHopper'][_0xd173('0x22')]({'where':{'ListId':_0x3bf455[_0xd173('0x2e')][_0xd173('0x65')],'CampaignId':_0x3bf455[_0xd173('0x43')]['id']}})[_0xd173('0x23')](function(){return _0x341d39;});}})[_0xd173('0x23')](respondWithStatusCode(_0x10c8a7,null))[_0xd173('0x42')](handleError(_0x10c8a7,null));};exports[_0xd173('0x8a')]=function(_0x377fee,_0x1a7f5f,_0x587b1c){var _0x495447={};var _0x51eb57={};var _0x1fc6ee;var _0x29d938;return db[_0xd173('0x29')]['findOne']({'where':{'id':_0x377fee['params']['id']}})['then'](handleEntityNotFound(_0x1a7f5f,null))[_0xd173('0x23')](function(_0x4397c4){if(_0x4397c4){_0x1fc6ee=_0x4397c4;_0x51eb57[_0xd173('0x31')]=_['keys'](db['CmList'][_0xd173('0x2a')]);_0x51eb57[_0xd173('0x2e')]=_['keys'](_0x377fee['query']);_0x51eb57[_0xd173('0x2f')]=_[_0xd173('0x30')](_0x51eb57['model'],_0x51eb57[_0xd173('0x2e')]);_0x495447[_0xd173('0x32')]=_[_0xd173('0x30')](_0x51eb57['model'],qs['fields'](_0x377fee[_0xd173('0x2e')][_0xd173('0x33')]));_0x495447[_0xd173('0x32')]=_0x495447[_0xd173('0x32')]['length']?_0x495447[_0xd173('0x32')]:_0x51eb57['model'];_0x495447[_0xd173('0x38')]=qs['sort'](_0x377fee[_0xd173('0x2e')]['sort']);_0x495447[_0xd173('0x3a')]=qs[_0xd173('0x2f')](_[_0xd173('0x59')](_0x377fee[_0xd173('0x2e')],_0x51eb57[_0xd173('0x2f')]));if(_0x377fee[_0xd173('0x2e')][_0xd173('0x3b')]){_0x495447[_0xd173('0x3a')]=_[_0xd173('0x44')](_0x495447[_0xd173('0x3a')],{'$or':_[_0xd173('0x28')](_0x495447[_0xd173('0x32')],function(_0x17d9d5){var _0x429cd5={};_0x429cd5[_0x17d9d5]={'$like':'%'+_0x377fee[_0xd173('0x2e')]['filter']+'%'};return _0x429cd5;})});}_0x495447=_[_0xd173('0x44')]({},_0x495447,_0x377fee[_0xd173('0x3e')]);return _0x1fc6ee[_0xd173('0x8a')](_0x495447);}})[_0xd173('0x23')](function(_0x2aca2d){if(_0x2aca2d){_0x29d938=_0x2aca2d[_0xd173('0x34')];if(!_0x377fee[_0xd173('0x2e')][_0xd173('0x35')]('nolimit')){_0x495447[_0xd173('0x37')]=qs[_0xd173('0x37')](_0x377fee[_0xd173('0x2e')][_0xd173('0x37')]);_0x495447[_0xd173('0x1a')]=qs[_0xd173('0x1a')](_0x377fee['query'][_0xd173('0x1a')]);}return _0x1fc6ee[_0xd173('0x8a')](_0x495447);}})[_0xd173('0x23')](function(_0x4b59d5){if(_0x4b59d5){return _0x4b59d5?{'count':_0x29d938,'rows':_0x4b59d5}:null;}})['then'](respondWithResult(_0x1a7f5f,null))[_0xd173('0x42')](handleError(_0x1a7f5f,null));};exports['addBlackLists']=function(_0x1e4ee3,_0x4754f5,_0x20d1b8){var _0x1b2c08,_0xc0187b;var _0x46506a=[];var _0x2e8d97=moment()[_0xd173('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xd173('0x29')]['find']({'where':{'id':_0x1e4ee3['params']['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x4754f5,null))['then'](function(_0x21b3bf){if(_0x21b3bf){_0xc0187b=_0x21b3bf;return _0x21b3bf[_0xd173('0x8b')](_0x1e4ee3[_0xd173('0x47')]['ids'],_[_0xd173('0x52')](_0x1e4ee3[_0xd173('0x47')],[_0xd173('0x65'),'id'])||{});}return null;})['spread'](function(_0x40e44a){var _0x4c74f4;var _0x5f1f5a;_0x1b2c08=_0x40e44a||[];var _0x371be8=[];if(_0x40e44a){for(var _0x20e84f=0x0;_0x20e84f<_0x40e44a[_0xd173('0x34')];_0x20e84f+=0x1){var _0xe28dd6=_0x40e44a[_0x20e84f][_0xd173('0x24')]({'plain':!![]});_0x4c74f4=squel[_0xd173('0x69')]()[_0xd173('0x6a')](_0xd173('0x8c'))[_0xd173('0x6c')]([_0xd173('0x6d'),'ContactId',_0xd173('0x6e'),_0xd173('0x5a'),_0xd173('0x54'),_0xd173('0x53')],squel['select']()[_0xd173('0x70')](_0xd173('0x6d'),'phone')[_0xd173('0x70')]('id','ContactId')[_0xd173('0x70')](_0xe28dd6[_0xd173('0x77')][_0xd173('0x73')](),_0xd173('0x6e'))['field'](_0x1e4ee3[_0xd173('0x43')]['id'][_0xd173('0x73')](),_0xd173('0x5a'))['field'](_0xd173('0x71'),_0xd173('0x54'))['field'](_0xd173('0x71'),_0xd173('0x53'))[_0xd173('0x7c')](_0xd173('0x74'))[_0xd173('0x3a')]('deletedAt\x20IS\x20NULL')[_0xd173('0x3a')](_0xd173('0x76'),_0xe28dd6[_0xd173('0x77')]['toString']())[_0xd173('0x3a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x371be8[_0xd173('0x86')](db[_0xd173('0x87')][_0xd173('0x2e')](_0x4c74f4));}return BPromise[_0xd173('0x88')](_0x371be8);}})['then'](function(){return _0x1b2c08;})['then'](respondWithResult(_0x4754f5,null))[_0xd173('0x42')](handleError(_0x4754f5,null));};exports[_0xd173('0x8d')]=function(_0xbe68cb,_0x565273,_0x8d6249){return db['Campaign'][_0xd173('0x45')]({'where':{'id':_0xbe68cb[_0xd173('0x43')]['id']}})[_0xd173('0x23')](handleEntityNotFound(_0x565273,null))[_0xd173('0x23')](function(_0x3347bd){if(_0x3347bd){return _0x3347bd['removeBlackLists'](_0xbe68cb['query']['ids']);}})[_0xd173('0x23')](function(_0x3101fa){if(_0x3101fa){return db[_0xd173('0x60')][_0xd173('0x22')]({'where':{'ListId':_0xbe68cb['query'][_0xd173('0x65')],'CampaignId':_0xbe68cb[_0xd173('0x43')]['id']}})[_0xd173('0x23')](function(){return _0x3101fa;});}})[_0xd173('0x23')](respondWithStatusCode(_0x565273,null))[_0xd173('0x42')](handleError(_0x565273,null));};
\ No newline at end of file
+var _0x58c4=['field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','CampaignId\x20=\x20?','cm_hopper_additional_phones','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','options','Campaign','rows','catch','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','userProfileId','error','includeAll','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','nolimit','order','pick','findAll','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x58c4,0x135));var _0x458c=function(_0x32eb00,_0x428dc0){_0x32eb00=_0x32eb00-0x0;var _0x4447ce=_0x58c4[_0x32eb00];return _0x4447ce;};'use strict';var emlformat=require(_0x458c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x458c('0x1'));var jsonpatch=require(_0x458c('0x2'));var rp=require(_0x458c('0x3'));var moment=require(_0x458c('0x4'));var BPromise=require(_0x458c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x458c('0x6'));var sox=require(_0x458c('0x7'));var csv=require(_0x458c('0x8'));var ejs=require(_0x458c('0x9'));var fs=require('fs');var fs_extra=require(_0x458c('0xa'));var _=require(_0x458c('0xb'));var squel=require(_0x458c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x458c('0xd'));var toCsv=require(_0x458c('0x8'));var querystring=require(_0x458c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x458c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x458c('0x10'))(_0x458c('0x11'));var utils=require(_0x458c('0x12'));var config=require(_0x458c('0x13'));var licenseUtil=require(_0x458c('0x14'));var db=require(_0x458c('0x15'))['db'];function respondWithStatusCode(_0xdbfe9e,_0x5ea16d){_0x5ea16d=_0x5ea16d||0xcc;return function(_0x13249c){if(_0x13249c){return _0xdbfe9e[_0x458c('0x16')](_0x5ea16d);}return _0xdbfe9e['status'](_0x5ea16d)[_0x458c('0x17')]();};}function respondWithResult(_0x385e15,_0x4dd1bb){_0x4dd1bb=_0x4dd1bb||0xc8;return function(_0x4096fb){if(_0x4096fb){return _0x385e15[_0x458c('0x18')](_0x4dd1bb)[_0x458c('0x19')](_0x4096fb);}};}function respondWithFilteredResult(_0x4ab110,_0x4d85bf){return function(_0x586048){if(_0x586048){var _0x54cc0c=typeof _0x4d85bf['offset']==='undefined'&&typeof _0x4d85bf[_0x458c('0x1a')]==='undefined';var _0x108b97=_0x586048[_0x458c('0x1b')];var _0x2aac1b=_0x54cc0c?0x0:_0x4d85bf['offset'];var _0x52674a=_0x54cc0c?_0x586048[_0x458c('0x1b')]:_0x4d85bf[_0x458c('0x1c')]+_0x4d85bf[_0x458c('0x1a')];var _0x484804;if(_0x52674a>=_0x108b97){_0x52674a=_0x108b97;_0x484804=0xc8;}else{_0x484804=0xce;}_0x4ab110[_0x458c('0x18')](_0x484804);return _0x4ab110[_0x458c('0x1d')](_0x458c('0x1e'),_0x2aac1b+'-'+_0x52674a+'/'+_0x108b97)['json'](_0x586048);}return null;};}function patchUpdates(_0x7b4338){return function(_0x1e88ee){try{jsonpatch[_0x458c('0x1f')](_0x1e88ee,_0x7b4338,!![]);}catch(_0x13fcd6){return BPromise[_0x458c('0x20')](_0x13fcd6);}return _0x1e88ee[_0x458c('0x21')]();};}function saveUpdates(_0x1adc6b,_0x5d325d){return function(_0x4f0ac){if(_0x4f0ac){return _0x4f0ac['update'](_0x1adc6b)[_0x458c('0x22')](function(_0x24da99){return _0x24da99;});}return null;};}function removeEntity(_0x4e0572,_0x311496){return function(_0x55c116){if(_0x55c116){return _0x55c116[_0x458c('0x23')]()[_0x458c('0x22')](function(){var _0x2039fc=_0x55c116[_0x458c('0x24')]({'plain':!![]});var _0x26d037='IvrCampaigns';return db[_0x458c('0x25')][_0x458c('0x23')]({'where':{'type':_0x26d037,'resourceId':_0x2039fc['id']}})[_0x458c('0x22')](function(){return _0x55c116;});})[_0x458c('0x22')](function(){_0x4e0572[_0x458c('0x18')](0xcc)[_0x458c('0x17')]();});}};}function handleEntityNotFound(_0xb3135e,_0x125eff){return function(_0x33ec76){if(!_0x33ec76){_0xb3135e[_0x458c('0x16')](0x194);}return _0x33ec76;};}function handleError(_0x4841ba,_0x2403fd){_0x2403fd=_0x2403fd||0x1f4;return function(_0x25a965){logger['error'](_0x25a965['stack']);if(_0x25a965[_0x458c('0x26')]){delete _0x25a965[_0x458c('0x26')];}_0x4841ba[_0x458c('0x18')](_0x2403fd)[_0x458c('0x27')](_0x25a965);};}exports[_0x458c('0x28')]=function(_0x579630,_0x360fd0){var _0x43093e={},_0xf7a600={},_0x485faa={'count':0x0,'rows':[]};var _0x4b1de4=_['map'](db['Campaign'][_0x458c('0x29')],function(_0x12f4f0){return{'name':_0x12f4f0[_0x458c('0x2a')],'type':_0x12f4f0['type'][_0x458c('0x2b')]};});_0xf7a600['model']=_[_0x458c('0x2c')](_0x4b1de4,'name');_0xf7a600[_0x458c('0x2d')]=_[_0x458c('0x2e')](_0x579630[_0x458c('0x2d')]);_0xf7a600[_0x458c('0x2f')]=_[_0x458c('0x30')](_0xf7a600[_0x458c('0x31')],_0xf7a600[_0x458c('0x2d')]);_0x43093e[_0x458c('0x32')]=_['intersection'](_0xf7a600['model'],qs[_0x458c('0x33')](_0x579630[_0x458c('0x2d')][_0x458c('0x33')]));_0x43093e['attributes']=_0x43093e[_0x458c('0x32')]['length']?_0x43093e[_0x458c('0x32')]:_0xf7a600[_0x458c('0x31')];if(!_0x579630['query'][_0x458c('0x34')]('nolimit')){_0x43093e[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x579630['query'][_0x458c('0x1a')]);_0x43093e[_0x458c('0x1c')]=qs['offset'](_0x579630[_0x458c('0x2d')]['offset']);}_0x43093e['order']=qs[_0x458c('0x35')](_0x579630[_0x458c('0x2d')][_0x458c('0x35')]);_0x43093e[_0x458c('0x36')]=qs[_0x458c('0x2f')](_['pick'](_0x579630[_0x458c('0x2d')],_0xf7a600[_0x458c('0x2f')]),_0x4b1de4);if(_0x579630[_0x458c('0x2d')][_0x458c('0x37')]){_0x43093e['where']=_[_0x458c('0x38')](_0x43093e[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x4b1de4,function(_0x2125ad){if(_0x2125ad['type']!=='VIRTUAL'){var _0x31066b={};_0x31066b[_0x2125ad[_0x458c('0x26')]]={'$like':'%'+_0x579630['query'][_0x458c('0x37')]+'%'};return _0x31066b;}})});}_0x43093e=_[_0x458c('0x38')]({},_0x43093e,_0x579630[_0x458c('0x39')]);var _0x1e1aa3={'where':_0x43093e[_0x458c('0x36')]};return db[_0x458c('0x3a')]['count'](_0x1e1aa3)[_0x458c('0x22')](function(_0x1992b0){_0x485faa['count']=_0x1992b0;if(_0x579630[_0x458c('0x2d')]['includeAll']){_0x43093e['include']=[{'all':!![]}];}return db['Campaign']['findAll'](_0x43093e);})['then'](function(_0x2e9ebd){_0x485faa[_0x458c('0x3b')]=_0x2e9ebd;return _0x485faa;})[_0x458c('0x22')](respondWithFilteredResult(_0x360fd0,_0x43093e))[_0x458c('0x3c')](handleError(_0x360fd0,null));};exports['show']=function(_0x3b856c,_0x237348){var _0x25ca5c={'raw':![],'where':{'id':_0x3b856c[_0x458c('0x3d')]['id']}},_0x2ce446={};_0x2ce446['model']=_[_0x458c('0x2e')](db['Campaign'][_0x458c('0x29')]);_0x2ce446[_0x458c('0x2d')]=_[_0x458c('0x2e')](_0x3b856c['query']);_0x2ce446[_0x458c('0x2f')]=_[_0x458c('0x30')](_0x2ce446[_0x458c('0x31')],_0x2ce446[_0x458c('0x2d')]);_0x25ca5c[_0x458c('0x32')]=_['intersection'](_0x2ce446['model'],qs[_0x458c('0x33')](_0x3b856c[_0x458c('0x2d')][_0x458c('0x33')]));_0x25ca5c[_0x458c('0x32')]=_0x25ca5c[_0x458c('0x32')][_0x458c('0x3e')]?_0x25ca5c[_0x458c('0x32')]:_0x2ce446[_0x458c('0x31')];if(_0x3b856c[_0x458c('0x2d')]['includeAll']){_0x25ca5c[_0x458c('0x3f')]=[{'all':!![]}];}_0x25ca5c=_[_0x458c('0x38')]({},_0x25ca5c,_0x3b856c[_0x458c('0x39')]);return db[_0x458c('0x3a')][_0x458c('0x40')](_0x25ca5c)[_0x458c('0x22')](handleEntityNotFound(_0x237348,null))['then'](respondWithResult(_0x237348,null))['catch'](handleError(_0x237348,null));};exports['create']=function(_0x365903,_0x45f949){return db['Campaign'][_0x458c('0x41')](_0x365903[_0x458c('0x42')],{})[_0x458c('0x22')](function(_0x3637bd){var _0x5bc35c=_0x365903['user'][_0x458c('0x24')]({'plain':!![]});if(!_0x5bc35c)throw new Error(_0x458c('0x43'));if(_0x5bc35c[_0x458c('0x44')]===_0x458c('0x45')){var _0x3cee04=_0x3637bd['get']({'plain':!![]});var _0x36a25e=_0x458c('0x46');return db['UserProfileSection']['find']({'where':{'name':_0x36a25e,'userProfileId':_0x5bc35c[_0x458c('0x47')]},'raw':!![]})[_0x458c('0x22')](function(_0x30f82e){if(_0x30f82e&&_0x30f82e['autoAssociation']===0x0){return db['UserProfileResource'][_0x458c('0x41')]({'name':_0x3cee04[_0x458c('0x26')],'resourceId':_0x3cee04['id'],'type':_0x30f82e[_0x458c('0x26')],'sectionId':_0x30f82e['id']},{})[_0x458c('0x22')](function(){return _0x3637bd;});}else{return _0x3637bd;}})[_0x458c('0x3c')](function(_0x3a0105){logger[_0x458c('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a0105);throw _0x3a0105;});}return _0x3637bd;})[_0x458c('0x22')](respondWithResult(_0x45f949,0xc9))[_0x458c('0x3c')](handleError(_0x45f949,null));};exports['clone']=function(_0x4f8b67,_0x28eef2){var _0x66760={'where':{'id':_0x4f8b67[_0x458c('0x3d')]['id']}},_0x30d7ec={};_0x30d7ec[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x3a')]['rawAttributes']);_0x66760[_0x458c('0x32')]=_['intersection'](_0x30d7ec[_0x458c('0x31')],qs['fields'](_0x4f8b67[_0x458c('0x2d')][_0x458c('0x33')]));_0x66760[_0x458c('0x32')]=_0x66760['attributes']['length']?_0x66760[_0x458c('0x32')]:_0x30d7ec[_0x458c('0x31')];if(_0x4f8b67[_0x458c('0x2d')][_0x458c('0x49')]){_0x66760[_0x458c('0x3f')]=[{'all':!![]}];}_0x66760=_[_0x458c('0x38')]({},_0x66760,_0x4f8b67['options']);return db['Campaign'][_0x458c('0x40')](_0x66760)[_0x458c('0x22')](handleEntityNotFound(_0x28eef2,null))[_0x458c('0x22')](function(_0xc99888){if(_0xc99888){var _0x57311c=_0xc99888[_0x458c('0x24')]({'plain':!![]});_0x57311c=qs[_0x458c('0x4a')](_0x57311c,['id',_0x458c('0x4b'),'updatedAt']);_0x4f8b67['body']=_[_0x458c('0x4a')](_0x4f8b67[_0x458c('0x42')],['id','createdAt',_0x458c('0x4c')]);return db['Campaign'][_0x458c('0x41')](_['merge'](_0x57311c,_0x4f8b67['body']),{'include':_0x4f8b67['query'][_0x458c('0x49')]?[{'all':!![]}]:undefined})[_0x458c('0x22')](function(_0x3ce854){var _0x35d6f1=_0x4f8b67[_0x458c('0x45')][_0x458c('0x24')]({'plain':!![]});if(!_0x35d6f1)throw new Error(_0x458c('0x43'));if(_0x35d6f1[_0x458c('0x44')]===_0x458c('0x45')){var _0x3e183e=_0x3ce854[_0x458c('0x24')]({'plain':!![]});var _0x569099=_0x458c('0x46');return db[_0x458c('0x4d')][_0x458c('0x40')]({'where':{'name':_0x569099,'userProfileId':_0x35d6f1['userProfileId']},'raw':!![]})[_0x458c('0x22')](function(_0x3fec3c){if(_0x3fec3c&&_0x3fec3c[_0x458c('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x3e183e[_0x458c('0x26')],'resourceId':_0x3e183e['id'],'type':_0x3fec3c['name'],'sectionId':_0x3fec3c['id']},{})[_0x458c('0x22')](function(){return _0x3ce854;});}else{return _0x3ce854;}})[_0x458c('0x3c')](function(_0x51248c){logger['error'](_0x458c('0x4f'),_0x51248c);throw _0x51248c;});}return _0x3ce854;});}})[_0x458c('0x22')](respondWithResult(_0x28eef2,0xc9))[_0x458c('0x3c')](handleError(_0x28eef2,null));};exports[_0x458c('0x50')]=function(_0x26a68d,_0x5b746c){if(_0x26a68d['body']['id']){delete _0x26a68d['body']['id'];}return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x26a68d[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x5b746c,null))['then'](saveUpdates(_0x26a68d[_0x458c('0x42')],null))[_0x458c('0x22')](respondWithResult(_0x5b746c,null))[_0x458c('0x3c')](handleError(_0x5b746c,null));};exports[_0x458c('0x23')]=function(_0x53c4e0,_0x290a65){return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x53c4e0[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x290a65,null))[_0x458c('0x22')](removeEntity(_0x290a65,null))[_0x458c('0x3c')](handleError(_0x290a65,null));};exports['getHoppers']=function(_0x2b8a61,_0x212dba,_0x3b9df2){var _0x1a2123={'raw':!![],'where':{}};var _0xb07f74={};var _0x52025c={'count':0x0,'rows':[]};return db[_0x458c('0x3a')][_0x458c('0x51')]({'where':{'id':_0x2b8a61[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x212dba,null))['then'](function(_0x282c5e){if(_0x282c5e){_0xb07f74[_0x458c('0x31')]=_['keys'](db[_0x458c('0x52')]['rawAttributes']);_0xb07f74[_0x458c('0x2d')]=_['keys'](_0x2b8a61[_0x458c('0x2d')]);_0xb07f74['filters']=_[_0x458c('0x30')](_0xb07f74[_0x458c('0x31')],_0xb07f74[_0x458c('0x2d')]);_0x1a2123[_0x458c('0x32')]=_[_0x458c('0x30')](_0xb07f74[_0x458c('0x31')],qs[_0x458c('0x33')](_0x2b8a61[_0x458c('0x2d')][_0x458c('0x33')]));_0x1a2123['attributes']=_0x1a2123[_0x458c('0x32')][_0x458c('0x3e')]?_0x1a2123[_0x458c('0x32')]:_0xb07f74[_0x458c('0x31')];if(!_0x2b8a61[_0x458c('0x2d')][_0x458c('0x34')](_0x458c('0x53'))){_0x1a2123[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x2b8a61[_0x458c('0x2d')][_0x458c('0x1a')]);_0x1a2123[_0x458c('0x1c')]=qs['offset'](_0x2b8a61[_0x458c('0x2d')][_0x458c('0x1c')]);}_0x1a2123[_0x458c('0x54')]=qs[_0x458c('0x35')](_0x2b8a61[_0x458c('0x2d')]['sort']);_0x1a2123['where']=qs[_0x458c('0x2f')](_[_0x458c('0x55')](_0x2b8a61[_0x458c('0x2d')],_0xb07f74['filters']));_0x1a2123[_0x458c('0x36')]['CampaignId']=_0x282c5e['id'];if(_0x2b8a61[_0x458c('0x2d')][_0x458c('0x37')]){_0x1a2123[_0x458c('0x36')]=_[_0x458c('0x38')](_0x1a2123[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x1a2123[_0x458c('0x32')],function(_0x4ddece){var _0x348535={};_0x348535[_0x4ddece]={'$like':'%'+_0x2b8a61[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x348535;})});}_0x1a2123=_['merge']({},_0x1a2123,_0x2b8a61[_0x458c('0x39')]);return db[_0x458c('0x52')][_0x458c('0x1b')]({'where':_0x1a2123[_0x458c('0x36')]})['then'](function(_0x2b7f63){_0x52025c[_0x458c('0x1b')]=_0x2b7f63;if(_0x2b8a61[_0x458c('0x2d')][_0x458c('0x49')]){_0x1a2123[_0x458c('0x3f')]=[{'all':!![]}];}return db[_0x458c('0x52')][_0x458c('0x56')](_0x1a2123);})[_0x458c('0x22')](function(_0x1471c1){_0x52025c[_0x458c('0x3b')]=_0x1471c1;return _0x52025c;});}})[_0x458c('0x22')](respondWithFilteredResult(_0x212dba,_0x1a2123))['catch'](handleError(_0x212dba,null));};exports['getHopperHistories']=function(_0x9b0359,_0x23070a,_0x24837d){var _0x55bd9e={'raw':!![],'where':{}};var _0x24856e={};var _0x1f0aa3={'count':0x0,'rows':[]};return db[_0x458c('0x3a')][_0x458c('0x51')]({'where':{'id':_0x9b0359['params']['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x23070a,null))[_0x458c('0x22')](function(_0x4ff8cb){if(_0x4ff8cb){_0x24856e[_0x458c('0x31')]=_[_0x458c('0x2e')](db['CmHopperHistory'][_0x458c('0x29')]);_0x24856e[_0x458c('0x2d')]=_[_0x458c('0x2e')](_0x9b0359['query']);_0x24856e['filters']=_[_0x458c('0x30')](_0x24856e[_0x458c('0x31')],_0x24856e['query']);_0x55bd9e['attributes']=_[_0x458c('0x30')](_0x24856e[_0x458c('0x31')],qs[_0x458c('0x33')](_0x9b0359['query']['fields']));_0x55bd9e[_0x458c('0x32')]=_0x55bd9e[_0x458c('0x32')]['length']?_0x55bd9e[_0x458c('0x32')]:_0x24856e[_0x458c('0x31')];if(!_0x9b0359[_0x458c('0x2d')][_0x458c('0x34')]('nolimit')){_0x55bd9e[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x9b0359[_0x458c('0x2d')][_0x458c('0x1a')]);_0x55bd9e[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0x9b0359[_0x458c('0x2d')][_0x458c('0x1c')]);}_0x55bd9e['order']=qs[_0x458c('0x35')](_0x9b0359[_0x458c('0x2d')]['sort']);_0x55bd9e['where']=qs[_0x458c('0x2f')](_['pick'](_0x9b0359[_0x458c('0x2d')],_0x24856e['filters']));_0x55bd9e[_0x458c('0x36')][_0x458c('0x57')]=_0x4ff8cb['id'];if(_0x9b0359[_0x458c('0x2d')][_0x458c('0x37')]){_0x55bd9e[_0x458c('0x36')]=_[_0x458c('0x38')](_0x55bd9e[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x55bd9e[_0x458c('0x32')],function(_0x2a0105){var _0x4b5dbd={};_0x4b5dbd[_0x2a0105]={'$like':'%'+_0x9b0359[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x4b5dbd;})});}_0x55bd9e=_[_0x458c('0x38')]({},_0x55bd9e,_0x9b0359[_0x458c('0x39')]);return db[_0x458c('0x58')]['count']({'where':_0x55bd9e['where']})['then'](function(_0x1b7b07){_0x1f0aa3['count']=_0x1b7b07;if(_0x9b0359[_0x458c('0x2d')]['includeAll']){_0x55bd9e[_0x458c('0x3f')]=[{'all':!![]}];}return db[_0x458c('0x58')][_0x458c('0x56')](_0x55bd9e);})[_0x458c('0x22')](function(_0x140f29){_0x1f0aa3[_0x458c('0x3b')]=_0x140f29;return _0x1f0aa3;});}})[_0x458c('0x22')](respondWithFilteredResult(_0x23070a,_0x55bd9e))[_0x458c('0x3c')](handleError(_0x23070a,null));};exports[_0x458c('0x59')]=function(_0x5cfbc5,_0x400d44,_0x5143b3){var _0x2c70c3={'raw':!![],'where':{}};var _0x2a4e96={};var _0x5297a9={'count':0x0,'rows':[]};return db[_0x458c('0x3a')][_0x458c('0x51')]({'where':{'id':_0x5cfbc5[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x400d44,null))['then'](function(_0x3af8dc){if(_0x3af8dc){_0x2a4e96[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x5a')][_0x458c('0x29')]);_0x2a4e96[_0x458c('0x2d')]=_['keys'](_0x5cfbc5[_0x458c('0x2d')]);_0x2a4e96[_0x458c('0x2f')]=_[_0x458c('0x30')](_0x2a4e96[_0x458c('0x31')],_0x2a4e96[_0x458c('0x2d')]);_0x2c70c3[_0x458c('0x32')]=_['intersection'](_0x2a4e96[_0x458c('0x31')],qs[_0x458c('0x33')](_0x5cfbc5['query']['fields']));_0x2c70c3[_0x458c('0x32')]=_0x2c70c3[_0x458c('0x32')]['length']?_0x2c70c3[_0x458c('0x32')]:_0x2a4e96[_0x458c('0x31')];if(!_0x5cfbc5['query'][_0x458c('0x34')](_0x458c('0x53'))){_0x2c70c3['limit']=qs[_0x458c('0x1a')](_0x5cfbc5[_0x458c('0x2d')][_0x458c('0x1a')]);_0x2c70c3[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0x5cfbc5[_0x458c('0x2d')][_0x458c('0x1c')]);}_0x2c70c3['order']=qs[_0x458c('0x35')](_0x5cfbc5[_0x458c('0x2d')]['sort']);_0x2c70c3['where']=qs[_0x458c('0x2f')](_['pick'](_0x5cfbc5['query'],_0x2a4e96[_0x458c('0x2f')]));_0x2c70c3[_0x458c('0x36')]['CampaignId']=_0x3af8dc['id'];if(_0x5cfbc5[_0x458c('0x2d')]['filter']){_0x2c70c3[_0x458c('0x36')]=_[_0x458c('0x38')](_0x2c70c3[_0x458c('0x36')],{'$or':_['map'](_0x2c70c3['attributes'],function(_0x2dd9c2){var _0x31fc1c={};_0x31fc1c[_0x2dd9c2]={'$like':'%'+_0x5cfbc5[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x31fc1c;})});}_0x2c70c3=_['merge']({},_0x2c70c3,_0x5cfbc5[_0x458c('0x39')]);return db[_0x458c('0x5a')][_0x458c('0x1b')]({'where':_0x2c70c3[_0x458c('0x36')]})[_0x458c('0x22')](function(_0x5ba396){_0x5297a9[_0x458c('0x1b')]=_0x5ba396;if(_0x5cfbc5['query']['includeAll']){_0x2c70c3[_0x458c('0x3f')]=[{'all':!![]}];}return db[_0x458c('0x5a')][_0x458c('0x56')](_0x2c70c3);})['then'](function(_0x8b4e9d){_0x5297a9[_0x458c('0x3b')]=_0x8b4e9d;return _0x5297a9;});}})['then'](respondWithFilteredResult(_0x400d44,_0x2c70c3))['catch'](handleError(_0x400d44,null));};exports[_0x458c('0x5b')]=function(_0x184494,_0x456a61,_0x2f679c){var _0x4c8d43={'raw':!![],'where':{}};var _0x5a6fcd={};var _0x1c7023={'count':0x0,'rows':[]};return db[_0x458c('0x3a')][_0x458c('0x51')]({'where':{'id':_0x184494[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x456a61,null))[_0x458c('0x22')](function(_0x57d2db){if(_0x57d2db){_0x5a6fcd[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x5c')][_0x458c('0x29')]);_0x5a6fcd[_0x458c('0x2d')]=_['keys'](_0x184494[_0x458c('0x2d')]);_0x5a6fcd['filters']=_[_0x458c('0x30')](_0x5a6fcd[_0x458c('0x31')],_0x5a6fcd[_0x458c('0x2d')]);_0x4c8d43[_0x458c('0x32')]=_[_0x458c('0x30')](_0x5a6fcd[_0x458c('0x31')],qs[_0x458c('0x33')](_0x184494[_0x458c('0x2d')]['fields']));_0x4c8d43[_0x458c('0x32')]=_0x4c8d43['attributes'][_0x458c('0x3e')]?_0x4c8d43[_0x458c('0x32')]:_0x5a6fcd[_0x458c('0x31')];if(!_0x184494[_0x458c('0x2d')][_0x458c('0x34')]('nolimit')){_0x4c8d43[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x184494[_0x458c('0x2d')][_0x458c('0x1a')]);_0x4c8d43[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0x184494[_0x458c('0x2d')][_0x458c('0x1c')]);}_0x4c8d43[_0x458c('0x54')]=qs[_0x458c('0x35')](_0x184494[_0x458c('0x2d')][_0x458c('0x35')]);_0x4c8d43['where']=qs['filters'](_[_0x458c('0x55')](_0x184494[_0x458c('0x2d')],_0x5a6fcd['filters']));_0x4c8d43[_0x458c('0x36')][_0x458c('0x57')]=_0x57d2db['id'];if(_0x184494[_0x458c('0x2d')][_0x458c('0x37')]){_0x4c8d43['where']=_[_0x458c('0x38')](_0x4c8d43[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x4c8d43[_0x458c('0x32')],function(_0x532758){var _0x389ed0={};_0x389ed0[_0x532758]={'$like':'%'+_0x184494[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x389ed0;})});}_0x4c8d43=_[_0x458c('0x38')]({},_0x4c8d43,_0x184494[_0x458c('0x39')]);return db['CmHopperBlack'][_0x458c('0x1b')]({'where':_0x4c8d43[_0x458c('0x36')]})[_0x458c('0x22')](function(_0x4dd870){_0x1c7023['count']=_0x4dd870;if(_0x184494['query'][_0x458c('0x49')]){_0x4c8d43[_0x458c('0x3f')]=[{'all':!![]}];}return db[_0x458c('0x5c')][_0x458c('0x56')](_0x4c8d43);})[_0x458c('0x22')](function(_0xadcbc1){_0x1c7023[_0x458c('0x3b')]=_0xadcbc1;return _0x1c7023;});}})[_0x458c('0x22')](respondWithFilteredResult(_0x456a61,_0x4c8d43))[_0x458c('0x3c')](handleError(_0x456a61,null));};exports[_0x458c('0x5d')]=function(_0xd3e523,_0x3efc5c,_0x5c17f4){var _0x227fc5={};var _0x2e4bc4={};var _0x2c5822;var _0x1c3b95;return db[_0x458c('0x3a')]['findOne']({'where':{'id':_0xd3e523[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x3efc5c,null))[_0x458c('0x22')](function(_0x51d4e1){if(_0x51d4e1){_0x2c5822=_0x51d4e1;_0x2e4bc4[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x5e')][_0x458c('0x29')]);_0x2e4bc4['query']=_[_0x458c('0x2e')](_0xd3e523['query']);_0x2e4bc4[_0x458c('0x2f')]=_[_0x458c('0x30')](_0x2e4bc4['model'],_0x2e4bc4[_0x458c('0x2d')]);_0x227fc5[_0x458c('0x32')]=_[_0x458c('0x30')](_0x2e4bc4['model'],qs['fields'](_0xd3e523[_0x458c('0x2d')][_0x458c('0x33')]));_0x227fc5[_0x458c('0x32')]=_0x227fc5['attributes'][_0x458c('0x3e')]?_0x227fc5[_0x458c('0x32')]:_0x2e4bc4[_0x458c('0x31')];_0x227fc5[_0x458c('0x54')]=qs['sort'](_0xd3e523['query'][_0x458c('0x35')]);_0x227fc5[_0x458c('0x36')]=qs[_0x458c('0x2f')](_[_0x458c('0x55')](_0xd3e523[_0x458c('0x2d')],_0x2e4bc4[_0x458c('0x2f')]));if(_0xd3e523['query'][_0x458c('0x37')]){_0x227fc5[_0x458c('0x36')]=_[_0x458c('0x38')](_0x227fc5[_0x458c('0x36')],{'$or':_[_0x458c('0x2c')](_0x227fc5[_0x458c('0x32')],function(_0x98206f){var _0x2955ef={};_0x2955ef[_0x98206f]={'$like':'%'+_0xd3e523[_0x458c('0x2d')][_0x458c('0x37')]+'%'};return _0x2955ef;})});}_0x227fc5=_[_0x458c('0x38')]({},_0x227fc5,_0xd3e523['options']);return _0x2c5822[_0x458c('0x5d')](_0x227fc5);}})['then'](function(_0x5664b6){if(_0x5664b6){_0x1c3b95=_0x5664b6['length'];if(!_0xd3e523[_0x458c('0x2d')][_0x458c('0x34')](_0x458c('0x53'))){_0x227fc5[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0xd3e523['query'][_0x458c('0x1a')]);_0x227fc5[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0xd3e523[_0x458c('0x2d')][_0x458c('0x1c')]);}return _0x2c5822[_0x458c('0x5d')](_0x227fc5);}})[_0x458c('0x22')](function(_0x478a51){if(_0x478a51){return _0x478a51?{'count':_0x1c3b95,'rows':_0x478a51}:null;}})[_0x458c('0x22')](respondWithResult(_0x3efc5c,null))[_0x458c('0x3c')](handleError(_0x3efc5c,null));};exports[_0x458c('0x5f')]=function(_0x3e7910,_0x14336c,_0x4765eb){var _0x386b1a,_0x518898;var _0x4a895d=[];var _0x31087c=moment()[_0x458c('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x3e7910['params']['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x14336c,null))[_0x458c('0x22')](function(_0x21269d){if(_0x21269d){_0x518898=_0x21269d;return _0x21269d[_0x458c('0x5f')](_0x3e7910[_0x458c('0x42')][_0x458c('0x61')],_[_0x458c('0x4a')](_0x3e7910[_0x458c('0x42')],[_0x458c('0x61'),'id'])||{});}return null;})[_0x458c('0x62')](function(_0xef131e){var _0x46ad33;var _0x529e04;_0x386b1a=_0xef131e||[];var _0x3d03fa=[];if(_0xef131e){for(var _0x200187=0x0;_0x200187<_0xef131e['length'];_0x200187+=0x1){var _0x563921=_0xef131e[_0x200187]['get']({'plain':!![]});_0x518898[_0x458c('0x63')]=_0x3e7910[_0x458c('0x42')][_0x458c('0x63')]?_0x3e7910['body'][_0x458c('0x63')]:_0x518898[_0x458c('0x63')];switch(_0x518898[_0x458c('0x63')]){case _0x458c('0x64'):_0x46ad33=squel[_0x458c('0x65')]()['into'](_0x458c('0x66'))[_0x458c('0x67')]([_0x458c('0x68'),_0x458c('0x69'),_0x458c('0x6a'),_0x458c('0x6b'),_0x458c('0x57'),_0x458c('0x4b'),_0x458c('0x4c')],squel['select']()[_0x458c('0x6c')](_0x458c('0x68'),'phone')['field'](_0x458c('0x6d'),_0x458c('0x69'))[_0x458c('0x6c')]('id',_0x458c('0x6a'))[_0x458c('0x6c')](_0x563921[_0x458c('0x6e')][_0x458c('0x6f')](),_0x458c('0x6b'))['field'](_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')](),_0x458c('0x57'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4b'))[_0x458c('0x6c')]('\x27'+_0x31087c+'\x27',_0x458c('0x4c'))[_0x458c('0x70')](_0x458c('0x71'))[_0x458c('0x36')](_0x458c('0x72'))['where'](_0x458c('0x73'),_0x563921['CmListId']['toString']())[_0x458c('0x36')](_0x458c('0x74'))[_0x458c('0x36')](_0x458c('0x75'),squel[_0x458c('0x76')]()[_0x458c('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x458c('0x70')](_0x458c('0x77'))['where']('CampaignId\x20=\x20?',_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')]()))[_0x458c('0x36')](_0x458c('0x75'),squel[_0x458c('0x76')]()['field'](_0x458c('0x78'))[_0x458c('0x70')](_0x458c('0x66'))['where']('CampaignId\x20=\x20?',_0x3e7910[_0x458c('0x3d')]['id']['toString']())))[_0x458c('0x6f')]();break;case _0x458c('0x79'):_0x46ad33=squel[_0x458c('0x65')]()[_0x458c('0x7a')](_0x458c('0x66'))[_0x458c('0x67')]([_0x458c('0x68'),_0x458c('0x69'),'ContactId',_0x458c('0x6b'),_0x458c('0x57'),'createdAt','updatedAt'],squel['select']()['field'](_0x458c('0x68'),_0x458c('0x68'))['field'](_0x458c('0x6d'),_0x458c('0x69'))[_0x458c('0x6c')]('id',_0x458c('0x6a'))[_0x458c('0x6c')](_0x563921[_0x458c('0x6e')]['toString'](),'ListId')[_0x458c('0x6c')](_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')](),'CampaignId')[_0x458c('0x6c')]('\x27'+_0x31087c+'\x27',_0x458c('0x4b'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4c'))[_0x458c('0x70')]('cm_contacts')['where'](_0x458c('0x72'))[_0x458c('0x36')]('ListId\x20=\x20?',_0x563921[_0x458c('0x6e')][_0x458c('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x458c('0x36')](_0x458c('0x75'),squel[_0x458c('0x76')]()[_0x458c('0x6c')](_0x458c('0x78'))['from'](_0x458c('0x66'))[_0x458c('0x36')](_0x458c('0x7b'),_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')]())))[_0x458c('0x6f')]();break;default:_0x46ad33=squel[_0x458c('0x65')]()['into']('cm_hopper')[_0x458c('0x67')]([_0x458c('0x68'),_0x458c('0x69'),_0x458c('0x6a'),'ListId','CampaignId',_0x458c('0x4b'),_0x458c('0x4c')],squel[_0x458c('0x76')]()[_0x458c('0x6c')](_0x458c('0x68'),_0x458c('0x68'))[_0x458c('0x6c')](_0x458c('0x6d'),_0x458c('0x69'))[_0x458c('0x6c')]('id','ContactId')[_0x458c('0x6c')](_0x563921[_0x458c('0x6e')][_0x458c('0x6f')](),'ListId')[_0x458c('0x6c')](_0x3e7910['params']['id'][_0x458c('0x6f')](),_0x458c('0x57'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4b'))[_0x458c('0x6c')]('\x27'+_0x31087c+'\x27',_0x458c('0x4c'))[_0x458c('0x70')](_0x458c('0x71'))[_0x458c('0x36')]('deletedAt\x20IS\x20NULL')[_0x458c('0x36')](_0x458c('0x73'),_0x563921[_0x458c('0x6e')]['toString']())[_0x458c('0x36')](_0x458c('0x74')))[_0x458c('0x6f')]();}_0x529e04=squel['insert']()['into'](_0x458c('0x7c'))['fromQuery'](['cmHopperId',_0x458c('0x69'),_0x458c('0x68'),_0x458c('0x7d'),_0x458c('0x4b'),_0x458c('0x4c')],squel[_0x458c('0x76')]()[_0x458c('0x6c')]('h.id','id')[_0x458c('0x6c')](_0x458c('0x6d'),'scheduledAt')[_0x458c('0x6c')](_0x458c('0x7e'),_0x458c('0x68'))['field']('ci.OrderBY',_0x458c('0x7d'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4b'))['field']('\x27'+_0x31087c+'\x27',_0x458c('0x4c'))[_0x458c('0x70')](_0x458c('0x7f'),'ci')['join'](_0x458c('0x66'),'h',_0x458c('0x80'))[_0x458c('0x36')]('h.ListId\x20=\x20?',_0x563921[_0x458c('0x6e')]['toString']())['where']('h.CampaignId=?',_0x3e7910[_0x458c('0x3d')]['id'][_0x458c('0x6f')]())[_0x458c('0x36')](_0x458c('0x81'),_0x31087c))[_0x458c('0x6f')]();_0x3d03fa[_0x458c('0x82')](db[_0x458c('0x83')]['query'](_0x46ad33));_0x4a895d['push'](db['sequelize'][_0x458c('0x2d')](_0x529e04));}return BPromise[_0x458c('0x84')](_0x3d03fa);}})[_0x458c('0x22')](function(){return BPromise[_0x458c('0x84')](_0x4a895d);})['then'](function(){return _0x386b1a;})[_0x458c('0x22')](respondWithResult(_0x14336c,null))[_0x458c('0x3c')](handleError(_0x14336c,null));};exports['removeLists']=function(_0x3029c2,_0x5414a4,_0x2fa7b3){return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x3029c2[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x5414a4,null))[_0x458c('0x22')](function(_0x4cf5d5){if(_0x4cf5d5){return _0x4cf5d5[_0x458c('0x85')](_0x3029c2['query'][_0x458c('0x61')]);}})['then'](function(_0xba9d38){if(_0xba9d38){return db[_0x458c('0x52')][_0x458c('0x23')]({'where':{'ListId':_0x3029c2['query']['ids'],'CampaignId':_0x3029c2[_0x458c('0x3d')]['id']}})['then'](function(){return _0xba9d38;});}})[_0x458c('0x22')](respondWithStatusCode(_0x5414a4,null))['catch'](handleError(_0x5414a4,null));};exports['getBlackLists']=function(_0x496fed,_0x4f6924,_0x31f215){var _0x42067f={};var _0x140bca={};var _0x2386a8;var _0x438edd;return db['Campaign'][_0x458c('0x51')]({'where':{'id':_0x496fed[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x4f6924,null))['then'](function(_0x3320fc){if(_0x3320fc){_0x2386a8=_0x3320fc;_0x140bca[_0x458c('0x31')]=_[_0x458c('0x2e')](db[_0x458c('0x5e')][_0x458c('0x29')]);_0x140bca[_0x458c('0x2d')]=_[_0x458c('0x2e')](_0x496fed[_0x458c('0x2d')]);_0x140bca[_0x458c('0x2f')]=_[_0x458c('0x30')](_0x140bca['model'],_0x140bca[_0x458c('0x2d')]);_0x42067f[_0x458c('0x32')]=_[_0x458c('0x30')](_0x140bca[_0x458c('0x31')],qs[_0x458c('0x33')](_0x496fed['query'][_0x458c('0x33')]));_0x42067f[_0x458c('0x32')]=_0x42067f[_0x458c('0x32')][_0x458c('0x3e')]?_0x42067f['attributes']:_0x140bca['model'];_0x42067f['order']=qs[_0x458c('0x35')](_0x496fed[_0x458c('0x2d')][_0x458c('0x35')]);_0x42067f['where']=qs[_0x458c('0x2f')](_[_0x458c('0x55')](_0x496fed['query'],_0x140bca[_0x458c('0x2f')]));if(_0x496fed['query'][_0x458c('0x37')]){_0x42067f[_0x458c('0x36')]=_['merge'](_0x42067f[_0x458c('0x36')],{'$or':_['map'](_0x42067f['attributes'],function(_0x13fcff){var _0x55fcf7={};_0x55fcf7[_0x13fcff]={'$like':'%'+_0x496fed['query'][_0x458c('0x37')]+'%'};return _0x55fcf7;})});}_0x42067f=_[_0x458c('0x38')]({},_0x42067f,_0x496fed['options']);return _0x2386a8[_0x458c('0x86')](_0x42067f);}})[_0x458c('0x22')](function(_0x8914b){if(_0x8914b){_0x438edd=_0x8914b['length'];if(!_0x496fed['query'][_0x458c('0x34')]('nolimit')){_0x42067f[_0x458c('0x1a')]=qs[_0x458c('0x1a')](_0x496fed[_0x458c('0x2d')]['limit']);_0x42067f[_0x458c('0x1c')]=qs[_0x458c('0x1c')](_0x496fed[_0x458c('0x2d')][_0x458c('0x1c')]);}return _0x2386a8['getBlackLists'](_0x42067f);}})[_0x458c('0x22')](function(_0x574380){if(_0x574380){return _0x574380?{'count':_0x438edd,'rows':_0x574380}:null;}})[_0x458c('0x22')](respondWithResult(_0x4f6924,null))[_0x458c('0x3c')](handleError(_0x4f6924,null));};exports[_0x458c('0x87')]=function(_0x5b9701,_0x59bc3a,_0x1244d1){var _0x4ff89f,_0x4f009b;var _0x576ba1=[];var _0x4ccdd6=moment()[_0x458c('0x60')](_0x458c('0x88'));return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x5b9701[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0x59bc3a,null))[_0x458c('0x22')](function(_0xd0ab84){if(_0xd0ab84){_0x4f009b=_0xd0ab84;return _0xd0ab84[_0x458c('0x87')](_0x5b9701[_0x458c('0x42')]['ids'],_['omit'](_0x5b9701[_0x458c('0x42')],[_0x458c('0x61'),'id'])||{});}return null;})['spread'](function(_0x4a88fd){var _0x39a128;var _0x429ba2;_0x4ff89f=_0x4a88fd||[];var _0x5e06dd=[];if(_0x4a88fd){for(var _0x146162=0x0;_0x146162<_0x4a88fd[_0x458c('0x3e')];_0x146162+=0x1){var _0x4c45df=_0x4a88fd[_0x146162][_0x458c('0x24')]({'plain':!![]});_0x39a128=squel['insert']()[_0x458c('0x7a')](_0x458c('0x89'))[_0x458c('0x67')](['phone','ContactId',_0x458c('0x6b'),_0x458c('0x57'),_0x458c('0x4b'),_0x458c('0x4c')],squel[_0x458c('0x76')]()['field']('phone',_0x458c('0x68'))[_0x458c('0x6c')]('id',_0x458c('0x6a'))[_0x458c('0x6c')](_0x4c45df[_0x458c('0x6e')]['toString'](),'ListId')['field'](_0x5b9701[_0x458c('0x3d')]['id'][_0x458c('0x6f')](),_0x458c('0x57'))[_0x458c('0x6c')](_0x458c('0x6d'),'createdAt')['field']('NOW()',_0x458c('0x4c'))[_0x458c('0x70')](_0x458c('0x71'))[_0x458c('0x36')](_0x458c('0x72'))['where'](_0x458c('0x73'),_0x4c45df['CmListId'][_0x458c('0x6f')]())[_0x458c('0x36')](_0x458c('0x74')))['toString']();_0x5e06dd[_0x458c('0x82')](db['sequelize'][_0x458c('0x2d')](_0x39a128));}return BPromise[_0x458c('0x84')](_0x5e06dd);}})['then'](function(){return _0x4ff89f;})[_0x458c('0x22')](respondWithResult(_0x59bc3a,null))[_0x458c('0x3c')](handleError(_0x59bc3a,null));};exports['removeBlackLists']=function(_0x45d7bc,_0xbf348,_0x11c432){return db[_0x458c('0x3a')][_0x458c('0x40')]({'where':{'id':_0x45d7bc[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](handleEntityNotFound(_0xbf348,null))[_0x458c('0x22')](function(_0x43dc50){if(_0x43dc50){return _0x43dc50[_0x458c('0x8a')](_0x45d7bc[_0x458c('0x2d')][_0x458c('0x61')]);}})[_0x458c('0x22')](function(_0x561ee0){if(_0x561ee0){return db[_0x458c('0x5c')][_0x458c('0x23')]({'where':{'ListId':_0x45d7bc['query']['ids'],'CampaignId':_0x45d7bc[_0x458c('0x3d')]['id']}})[_0x458c('0x22')](function(){return _0x561ee0;});}})['then'](respondWithStatusCode(_0xbf348,null))[_0x458c('0x3c')](handleError(_0xbf348,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index fd3958d..378243e 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2ce447,_0x2b3f3b){var _0x564b8b=function(_0x49a3ef){while(--_0x49a3ef){_0x2ce447['push'](_0x2ce447['shift']());}};_0x564b8b(++_0x2b3f3b);}(_0x7a54,0x106));var _0x47a5=function(_0xadfdc9,_0x526eb5){_0xadfdc9=_0xadfdc9-0x0;var _0xc49bad=_0x7a54[_0xadfdc9];return _0xc49bad;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 febf351..dfb82ab 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 _0xc524=['message','info','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xc524,0x1bf));var _0x4c52=function(_0x4b8f15,_0x2ac633){_0x4b8f15=_0x4b8f15-0x0;var _0x5b554c=_0xc524[_0x4b8f15];return _0x5b554c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c52('0x0'));var BPromise=require(_0x4c52('0x1'));var rs=require(_0x4c52('0x2'));var fs=require('fs');var Redis=require(_0x4c52('0x3'));var db=require(_0x4c52('0x4'))['db'];var utils=require(_0x4c52('0x5'));var logger=require(_0x4c52('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4c52('0x7'));var client=jayson[_0x4c52('0x8')][_0x4c52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4756e3,_0x5378d3,_0x4ea85e){return new BPromise(function(_0x39591b,_0x212216){return client['request'](_0x4756e3,_0x4ea85e)[_0x4c52('0xa')](function(_0x231cda){logger['info'](_0x4c52('0xb'),_0x5378d3,_0x4c52('0xc'));logger[_0x4c52('0xd')](_0x4c52('0xe'),_0x5378d3,_0x4c52('0xc'),JSON[_0x4c52('0xf')](_0x231cda));if(_0x231cda[_0x4c52('0x10')]){if(_0x231cda[_0x4c52('0x10')][_0x4c52('0x11')]===0x1f4){logger['error'](_0x4c52('0xb'),_0x5378d3,_0x231cda[_0x4c52('0x10')][_0x4c52('0x12')]);return _0x212216(_0x231cda['error']['message']);}logger[_0x4c52('0x10')]('Campaign,\x20%s,\x20%s',_0x5378d3,_0x231cda[_0x4c52('0x10')][_0x4c52('0x12')]);return _0x39591b(_0x231cda['error'][_0x4c52('0x12')]);}else{logger[_0x4c52('0x13')](_0x4c52('0xb'),_0x5378d3,_0x4c52('0xc'));_0x39591b(_0x231cda[_0x4c52('0x14')][_0x4c52('0x12')]);}})[_0x4c52('0x15')](function(_0x1dabe0){logger[_0x4c52('0x10')](_0x4c52('0xb'),_0x5378d3,_0x1dabe0);_0x212216(_0x1dabe0);});});}exports[_0x4c52('0x16')]=function(_0x1f036c){var _0x35cffb=this;return new Promise(function(_0x2a498c,_0x146c35){return db[_0x4c52('0x17')]['findAll']({'raw':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')][_0x4c52('0x19')]===undefined?!![]:![]:!![],'where':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')][_0x4c52('0x1a')]||null:null,'attributes':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')][_0x4c52('0x1b')]||null:null,'limit':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')][_0x4c52('0x1c')]||null:null,'include':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')]['include']?_['map'](_0x1f036c[_0x4c52('0x18')][_0x4c52('0x1d')],function(_0x13cf34){return{'model':db[_0x13cf34[_0x4c52('0x1e')]],'as':_0x13cf34['as'],'attributes':_0x13cf34[_0x4c52('0x1b')],'include':_0x13cf34[_0x4c52('0x1d')]?_['map'](_0x13cf34[_0x4c52('0x1d')],function(_0x19e4b9){return{'model':db[_0x19e4b9['model']],'as':_0x19e4b9['as'],'attributes':_0x19e4b9[_0x4c52('0x1b')],'include':_0x19e4b9[_0x4c52('0x1d')]?_['map'](_0x19e4b9[_0x4c52('0x1d')],function(_0x2385a9){return{'model':db[_0x2385a9[_0x4c52('0x1e')]],'as':_0x2385a9['as'],'attributes':_0x2385a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c52('0xa')](function(_0x3500aa){logger[_0x4c52('0x13')](_0x4c52('0x16'),_0x1f036c);logger[_0x4c52('0xd')](_0x4c52('0x16'),_0x1f036c,JSON[_0x4c52('0xf')](_0x3500aa));_0x2a498c(_0x3500aa);})[_0x4c52('0x15')](function(_0x74eae1){logger[_0x4c52('0x10')]('GetCampaign',_0x74eae1[_0x4c52('0x12')],_0x1f036c);_0x146c35(_0x35cffb[_0x4c52('0x10')](0x1f4,_0x74eae1[_0x4c52('0x12')]));});});};
\ No newline at end of file
+var _0xf6fb=['map','model','debug','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','attributes','limit','include'];(function(_0x271b53,_0x48386e){var _0x8660ef=function(_0x3f8886){while(--_0x3f8886){_0x271b53['push'](_0x271b53['shift']());}};_0x8660ef(++_0x48386e);}(_0xf6fb,0x111));var _0xbf6f=function(_0x3d62c4,_0x134b8c){_0x3d62c4=_0x3d62c4-0x0;var _0x114fef=_0xf6fb[_0x3d62c4];return _0x114fef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf6f('0x0'));var BPromise=require(_0xbf6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf6f('0x2'));var db=require(_0xbf6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf6f('0x4'))('rpc');var config=require(_0xbf6f('0x5'));var jayson=require(_0xbf6f('0x6'));var client=jayson[_0xbf6f('0x7')][_0xbf6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d8ecf,_0x26bc7b,_0x9d0c63){return new BPromise(function(_0x43d56b,_0x5948cf){return client[_0xbf6f('0x9')](_0x3d8ecf,_0x9d0c63)[_0xbf6f('0xa')](function(_0x2ac2f8){logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,'request\x20sent');logger['debug'](_0xbf6f('0xd'),_0x26bc7b,_0xbf6f('0xe'),JSON[_0xbf6f('0xf')](_0x2ac2f8));if(_0x2ac2f8['error']){if(_0x2ac2f8[_0xbf6f('0x10')]['code']===0x1f4){logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')]['message']);return _0x5948cf(_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);}logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);return _0x43d56b(_0x2ac2f8['error'][_0xbf6f('0x11')]);}else{logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,_0xbf6f('0xe'));_0x43d56b(_0x2ac2f8[_0xbf6f('0x12')][_0xbf6f('0x11')]);}})[_0xbf6f('0x13')](function(_0x586f33){logger['error'](_0xbf6f('0xc'),_0x26bc7b,_0x586f33);_0x5948cf(_0x586f33);});});}exports[_0xbf6f('0x14')]=function(_0x21b485){var _0x4b3c33=this;return new Promise(function(_0x56b4da,_0x2a0537){return db[_0xbf6f('0x15')][_0xbf6f('0x16')]({'raw':_0x21b485[_0xbf6f('0x17')]?_0x21b485[_0xbf6f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x21b485['options']?_0x21b485[_0xbf6f('0x17')]['where']||null:null,'attributes':_0x21b485[_0xbf6f('0x17')]?_0x21b485[_0xbf6f('0x17')][_0xbf6f('0x18')]||null:null,'limit':_0x21b485['options']?_0x21b485[_0xbf6f('0x17')][_0xbf6f('0x19')]||null:null,'include':_0x21b485[_0xbf6f('0x17')]?_0x21b485['options'][_0xbf6f('0x1a')]?_['map'](_0x21b485[_0xbf6f('0x17')][_0xbf6f('0x1a')],function(_0xba4b6a){return{'model':db[_0xba4b6a['model']],'as':_0xba4b6a['as'],'attributes':_0xba4b6a[_0xbf6f('0x18')],'include':_0xba4b6a[_0xbf6f('0x1a')]?_[_0xbf6f('0x1b')](_0xba4b6a[_0xbf6f('0x1a')],function(_0x44d47f){return{'model':db[_0x44d47f[_0xbf6f('0x1c')]],'as':_0x44d47f['as'],'attributes':_0x44d47f['attributes'],'include':_0x44d47f[_0xbf6f('0x1a')]?_[_0xbf6f('0x1b')](_0x44d47f['include'],function(_0x506302){return{'model':db[_0x506302['model']],'as':_0x506302['as'],'attributes':_0x506302[_0xbf6f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3588c0){logger[_0xbf6f('0xb')](_0xbf6f('0x14'),_0x21b485);logger[_0xbf6f('0x1d')](_0xbf6f('0x14'),_0x21b485,JSON[_0xbf6f('0xf')](_0x3588c0));_0x56b4da(_0x3588c0);})[_0xbf6f('0x13')](function(_0x58c120){logger['error'](_0xbf6f('0x14'),_0x58c120[_0xbf6f('0x11')],_0x21b485);_0x2a0537(_0x4b3c33['error'](0x1f4,_0x58c120[_0xbf6f('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index e2d7d95..43d9e87 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 _0xaf85=['isAuthenticated','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','clone','addLists','put','update','removeLists','removeBlackLists','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','/:id','show','get','/:id/hoppers'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0xaf85,0x1e3));var _0x5af8=function(_0x5568ed,_0x61f3be){_0x5568ed=_0x5568ed-0x0;var _0x406c98=_0xaf85[_0x5568ed];return _0x406c98;};'use strict';var multer=require('multer');var util=require(_0x5af8('0x0'));var path=require('path');var timeout=require(_0x5af8('0x1'));var express=require(_0x5af8('0x2'));var router=express[_0x5af8('0x3')]();var fs_extra=require(_0x5af8('0x4'));var auth=require(_0x5af8('0x5'));var interaction=require(_0x5af8('0x6'));var config=require(_0x5af8('0x7'));var controller=require(_0x5af8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5af8('0x9'),auth['isAuthenticated'](),controller[_0x5af8('0xa')]);router[_0x5af8('0xb')](_0x5af8('0xc'),auth[_0x5af8('0xd')](),controller[_0x5af8('0xe')]);router[_0x5af8('0xb')]('/:id/hopper_histories',auth[_0x5af8('0xd')](),controller['getHopperHistories']);router[_0x5af8('0xb')](_0x5af8('0xf'),auth['isAuthenticated'](),controller[_0x5af8('0x10')]);router['get'](_0x5af8('0x11'),auth[_0x5af8('0xd')](),controller[_0x5af8('0x12')]);router[_0x5af8('0xb')](_0x5af8('0x13'),auth[_0x5af8('0xd')](),controller[_0x5af8('0x14')]);router[_0x5af8('0xb')](_0x5af8('0x15'),auth[_0x5af8('0xd')](),controller['getBlackLists']);router[_0x5af8('0x16')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5af8('0x17'),auth[_0x5af8('0xd')](),controller[_0x5af8('0x18')]);router[_0x5af8('0x16')](_0x5af8('0x13'),auth[_0x5af8('0xd')](),controller[_0x5af8('0x19')]);router[_0x5af8('0x16')](_0x5af8('0x15'),auth[_0x5af8('0xd')](),controller['addBlackLists']);router[_0x5af8('0x1a')](_0x5af8('0x9'),auth[_0x5af8('0xd')](),controller[_0x5af8('0x1b')]);router['delete']('/:id',auth[_0x5af8('0xd')](),controller['destroy']);router['delete'](_0x5af8('0x13'),auth[_0x5af8('0xd')](),controller[_0x5af8('0x1c')]);router['delete'](_0x5af8('0x15'),auth[_0x5af8('0xd')](),controller[_0x5af8('0x1d')]);module[_0x5af8('0x1e')]=router;
\ No newline at end of file
+var _0xf07a=['connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x2d2029,_0x30582b){var _0x575839=function(_0x5ed7de){while(--_0x5ed7de){_0x2d2029['push'](_0x2d2029['shift']());}};_0x575839(++_0x30582b);}(_0xf07a,0x86));var _0xaf07=function(_0x11fe8d,_0x19aba4){_0x11fe8d=_0x11fe8d-0x0;var _0x356099=_0xf07a[_0x11fe8d];return _0x356099;};'use strict';var multer=require(_0xaf07('0x0'));var util=require(_0xaf07('0x1'));var path=require('path');var timeout=require(_0xaf07('0x2'));var express=require(_0xaf07('0x3'));var router=express[_0xaf07('0x4')]();var fs_extra=require(_0xaf07('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf07('0x6'));var controller=require('./campaign.controller');router[_0xaf07('0x7')]('/',auth['isAuthenticated'](),controller[_0xaf07('0x8')]);router['get'](_0xaf07('0x9'),auth[_0xaf07('0xa')](),controller[_0xaf07('0xb')]);router[_0xaf07('0x7')](_0xaf07('0xc'),auth[_0xaf07('0xa')](),controller['getHoppers']);router[_0xaf07('0x7')](_0xaf07('0xd'),auth[_0xaf07('0xa')](),controller[_0xaf07('0xe')]);router[_0xaf07('0x7')]('/:id/hopper_finals',auth[_0xaf07('0xa')](),controller[_0xaf07('0xf')]);router[_0xaf07('0x7')](_0xaf07('0x10'),auth[_0xaf07('0xa')](),controller[_0xaf07('0x11')]);router['get']('/:id/lists',auth[_0xaf07('0xa')](),controller[_0xaf07('0x12')]);router['get']('/:id/blacklists',auth[_0xaf07('0xa')](),controller[_0xaf07('0x13')]);router[_0xaf07('0x14')]('/',auth[_0xaf07('0xa')](),controller[_0xaf07('0x15')]);router[_0xaf07('0x14')]('/:id/clone',auth[_0xaf07('0xa')](),controller[_0xaf07('0x16')]);router[_0xaf07('0x14')](_0xaf07('0x17'),auth['isAuthenticated'](),controller[_0xaf07('0x18')]);router['post'](_0xaf07('0x19'),auth['isAuthenticated'](),controller[_0xaf07('0x1a')]);router[_0xaf07('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xaf07('0x1c')]);router[_0xaf07('0x1d')](_0xaf07('0x9'),auth[_0xaf07('0xa')](),controller[_0xaf07('0x1e')]);router[_0xaf07('0x1d')](_0xaf07('0x17'),auth[_0xaf07('0xa')](),controller[_0xaf07('0x1f')]);router[_0xaf07('0x1d')](_0xaf07('0x19'),auth[_0xaf07('0xa')](),controller[_0xaf07('0x20')]);module[_0xaf07('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index cd4a3a4..c9765fa 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 _0xc287=['sequelize','exports','STRING','medium','VIRTUAL','getDataValue','key'];(function(_0x9cd801,_0x3bc478){var _0x10a3f8=function(_0x4bba52){while(--_0x4bba52){_0x9cd801['push'](_0x9cd801['shift']());}};_0x10a3f8(++_0x3bc478);}(_0xc287,0xe0));var _0x7c28=function(_0x334578,_0x4f68f1){_0x334578=_0x334578-0x0;var _0x11d272=_0xc287[_0x334578];return _0x11d272;};'use strict';var Sequelize=require(_0x7c28('0x0'));module[_0x7c28('0x1')]={'key':{'type':Sequelize[_0x7c28('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x7c28('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7c28('0x4')],'get':function(){return this[_0x7c28('0x5')](_0x7c28('0x6'));}}};
\ No newline at end of file
+var _0x1a31=['exports','STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x15fef7,_0xbc02c5){var _0x13bb57=function(_0x488ce0){while(--_0x488ce0){_0x15fef7['push'](_0x15fef7['shift']());}};_0x13bb57(++_0xbc02c5);}(_0x1a31,0x16f));var _0x11a3=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x1a31[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0x11a3('0x0'));module[_0x11a3('0x1')]={'key':{'type':Sequelize[_0x11a3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x11a3('0x3')],'length':_0x11a3('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x11a3('0x5')],'get':function(){return this[_0x11a3('0x6')](_0x11a3('0x7'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 2597cc9..13869f1 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 _0x47d4=['sort','where','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47d4,0x17e));var _0x447d=function(_0x451e65,_0x4efdd8){_0x451e65=_0x451e65-0x0;var _0x45fbec=_0x47d4[_0x451e65];return _0x45fbec;};'use strict';var emlformat=require(_0x447d('0x0'));var rimraf=require(_0x447d('0x1'));var zipdir=require(_0x447d('0x2'));var jsonpatch=require(_0x447d('0x3'));var rp=require(_0x447d('0x4'));var moment=require(_0x447d('0x5'));var BPromise=require(_0x447d('0x6'));var Mustache=require('mustache');var util=require(_0x447d('0x7'));var path=require(_0x447d('0x8'));var sox=require('sox');var csv=require(_0x447d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x447d('0xa'));var _=require(_0x447d('0xb'));var squel=require(_0x447d('0xc'));var crypto=require('crypto');var jsforce=require(_0x447d('0xd'));var deskjs=require(_0x447d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x447d('0xf'));var Papa=require(_0x447d('0x10'));var Redis=require(_0x447d('0x11'));var authService=require(_0x447d('0x12'));var qs=require(_0x447d('0x13'));var as=require(_0x447d('0x14'));var hardwareService=require(_0x447d('0x15'));var logger=require('../../config/logger')(_0x447d('0x16'));var utils=require(_0x447d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x447d('0x18'));var db=require(_0x447d('0x19'))['db'];function respondWithStatusCode(_0x1a9970,_0x1d50d9){_0x1d50d9=_0x1d50d9||0xcc;return function(_0x5c661d){if(_0x5c661d){return _0x1a9970[_0x447d('0x1a')](_0x1d50d9);}return _0x1a9970[_0x447d('0x1b')](_0x1d50d9)[_0x447d('0x1c')]();};}function respondWithResult(_0x3e31be,_0x203997){_0x203997=_0x203997||0xc8;return function(_0x3fd43f){if(_0x3fd43f){return _0x3e31be['status'](_0x203997)[_0x447d('0x1d')](_0x3fd43f);}};}function respondWithFilteredResult(_0x510aa7,_0x36439f){return function(_0x18a407){if(_0x18a407){var _0x3e6c26=typeof _0x36439f[_0x447d('0x1e')]===_0x447d('0x1f')&&typeof _0x36439f[_0x447d('0x20')]===_0x447d('0x1f');var _0x2fde2c=_0x18a407[_0x447d('0x21')];var _0x79f191=_0x3e6c26?0x0:_0x36439f[_0x447d('0x1e')];var _0x1260c2=_0x3e6c26?_0x18a407['count']:_0x36439f[_0x447d('0x1e')]+_0x36439f[_0x447d('0x20')];var _0x17025e;if(_0x1260c2>=_0x2fde2c){_0x1260c2=_0x2fde2c;_0x17025e=0xc8;}else{_0x17025e=0xce;}_0x510aa7[_0x447d('0x1b')](_0x17025e);return _0x510aa7[_0x447d('0x22')](_0x447d('0x23'),_0x79f191+'-'+_0x1260c2+'/'+_0x2fde2c)[_0x447d('0x1d')](_0x18a407);}return null;};}function patchUpdates(_0x2c2d69){return function(_0x35775a){try{jsonpatch[_0x447d('0x24')](_0x35775a,_0x2c2d69,!![]);}catch(_0x3c34f0){return BPromise['reject'](_0x3c34f0);}return _0x35775a[_0x447d('0x25')]();};}function saveUpdates(_0x2b48a4,_0x582420){return function(_0x4f681c){if(_0x4f681c){return _0x4f681c[_0x447d('0x26')](_0x2b48a4)[_0x447d('0x27')](function(_0x387252){return _0x387252;});}return null;};}function removeEntity(_0x5a8c8f,_0x1d4560){return function(_0x523be0){if(_0x523be0){return _0x523be0[_0x447d('0x28')]()[_0x447d('0x27')](function(){var _0x3f203e=_0x523be0[_0x447d('0x29')]({'plain':!![]});var _0x236a29='CannedAnswers';return db[_0x447d('0x2a')][_0x447d('0x28')]({'where':{'type':_0x236a29,'resourceId':_0x3f203e['id']}})[_0x447d('0x27')](function(){return _0x523be0;});})[_0x447d('0x27')](function(){_0x5a8c8f[_0x447d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a0783,_0x4c5f3b){return function(_0x12b5f6){if(!_0x12b5f6){_0x5a0783[_0x447d('0x1a')](0x194);}return _0x12b5f6;};}function handleError(_0x583e2c,_0x4bea99){_0x4bea99=_0x4bea99||0x1f4;return function(_0x32d87b){logger[_0x447d('0x2b')](_0x32d87b['stack']);if(_0x32d87b[_0x447d('0x2c')]){delete _0x32d87b[_0x447d('0x2c')];}_0x583e2c[_0x447d('0x1b')](_0x4bea99)[_0x447d('0x2d')](_0x32d87b);};}exports[_0x447d('0x2e')]=function(_0x3fddf2,_0x2fe076){var _0x3173a0={},_0xabf36e={},_0x2bfe83={'count':0x0,'rows':[]};var _0x15cfc1=_[_0x447d('0x2f')](db[_0x447d('0x30')][_0x447d('0x31')],function(_0x418ade){return{'name':_0x418ade[_0x447d('0x32')],'type':_0x418ade[_0x447d('0x33')][_0x447d('0x34')]};});_0xabf36e[_0x447d('0x35')]=_[_0x447d('0x2f')](_0x15cfc1,_0x447d('0x2c'));_0xabf36e[_0x447d('0x36')]=_[_0x447d('0x37')](_0x3fddf2['query']);_0xabf36e[_0x447d('0x38')]=_[_0x447d('0x39')](_0xabf36e[_0x447d('0x35')],_0xabf36e[_0x447d('0x36')]);_0x3173a0['attributes']=_[_0x447d('0x39')](_0xabf36e[_0x447d('0x35')],qs[_0x447d('0x3a')](_0x3fddf2[_0x447d('0x36')]['fields']));_0x3173a0[_0x447d('0x3b')]=_0x3173a0['attributes'][_0x447d('0x3c')]?_0x3173a0[_0x447d('0x3b')]:_0xabf36e[_0x447d('0x35')];if(!_0x3fddf2['query'][_0x447d('0x3d')](_0x447d('0x3e'))){_0x3173a0[_0x447d('0x20')]=qs[_0x447d('0x20')](_0x3fddf2[_0x447d('0x36')]['limit']);_0x3173a0[_0x447d('0x1e')]=qs[_0x447d('0x1e')](_0x3fddf2[_0x447d('0x36')]['offset']);}_0x3173a0['order']=qs[_0x447d('0x3f')](_0x3fddf2['query'][_0x447d('0x3f')]);_0x3173a0[_0x447d('0x40')]=qs[_0x447d('0x38')](_['pick'](_0x3fddf2[_0x447d('0x36')],_0xabf36e[_0x447d('0x38')]),_0x15cfc1);if(_0x3fddf2[_0x447d('0x36')][_0x447d('0x41')]){_0x3173a0[_0x447d('0x40')]=_[_0x447d('0x42')](_0x3173a0[_0x447d('0x40')],{'$or':[{'key':{'$like':'%'+_0x3fddf2[_0x447d('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x3fddf2[_0x447d('0x36')][_0x447d('0x41')]+'%'}}]});}_0x3173a0=_['merge']({},_0x3173a0,_0x3fddf2[_0x447d('0x43')]);var _0x485a13={'where':_0x3173a0[_0x447d('0x40')]};return db[_0x447d('0x30')][_0x447d('0x21')](_0x485a13)[_0x447d('0x27')](function(_0x2b8968){_0x2bfe83[_0x447d('0x21')]=_0x2b8968;if(_0x3fddf2[_0x447d('0x36')][_0x447d('0x44')]){_0x3173a0[_0x447d('0x45')]=[{'all':!![]}];}return db[_0x447d('0x30')][_0x447d('0x46')](_0x3173a0);})[_0x447d('0x27')](function(_0x4367e4){_0x2bfe83['rows']=_0x4367e4;return _0x2bfe83;})[_0x447d('0x27')](respondWithFilteredResult(_0x2fe076,_0x3173a0))[_0x447d('0x47')](handleError(_0x2fe076,null));};exports['show']=function(_0x5bc2dc,_0x2ad35d){var _0x70d493={'raw':!![],'where':{'id':_0x5bc2dc[_0x447d('0x48')]['id']}},_0x5ca593={};_0x5ca593[_0x447d('0x35')]=_['keys'](db[_0x447d('0x30')][_0x447d('0x31')]);_0x5ca593[_0x447d('0x36')]=_['keys'](_0x5bc2dc[_0x447d('0x36')]);_0x5ca593['filters']=_[_0x447d('0x39')](_0x5ca593[_0x447d('0x35')],_0x5ca593[_0x447d('0x36')]);_0x70d493[_0x447d('0x3b')]=_[_0x447d('0x39')](_0x5ca593['model'],qs[_0x447d('0x3a')](_0x5bc2dc[_0x447d('0x36')][_0x447d('0x3a')]));_0x70d493['attributes']=_0x70d493['attributes'][_0x447d('0x3c')]?_0x70d493[_0x447d('0x3b')]:_0x5ca593[_0x447d('0x35')];if(_0x5bc2dc[_0x447d('0x36')][_0x447d('0x44')]){_0x70d493[_0x447d('0x45')]=[{'all':!![]}];}_0x70d493=_[_0x447d('0x42')]({},_0x70d493,_0x5bc2dc['options']);return db[_0x447d('0x30')][_0x447d('0x49')](_0x70d493)[_0x447d('0x27')](handleEntityNotFound(_0x2ad35d,null))[_0x447d('0x27')](respondWithResult(_0x2ad35d,null))[_0x447d('0x47')](handleError(_0x2ad35d,null));};exports[_0x447d('0x26')]=function(_0x36cf8a,_0xb65c09){if(_0x36cf8a['body']['id']){delete _0x36cf8a['body']['id'];}return db[_0x447d('0x30')][_0x447d('0x49')]({'where':{'id':_0x36cf8a[_0x447d('0x48')]['id']}})[_0x447d('0x27')](handleEntityNotFound(_0xb65c09,null))[_0x447d('0x27')](saveUpdates(_0x36cf8a['body'],null))['then'](respondWithResult(_0xb65c09,null))[_0x447d('0x47')](handleError(_0xb65c09,null));};exports[_0x447d('0x28')]=function(_0x2eb5a2,_0x48d62e){return db[_0x447d('0x30')][_0x447d('0x49')]({'where':{'id':_0x2eb5a2[_0x447d('0x48')]['id']}})['then'](handleEntityNotFound(_0x48d62e,null))[_0x447d('0x27')](removeEntity(_0x48d62e,null))[_0x447d('0x47')](handleError(_0x48d62e,null));};exports[_0x447d('0x4a')]=function(_0x313f26,_0x43ee42){var _0x273ef3={'key':_0x313f26[_0x447d('0x4b')][_0x447d('0x34')]};if(_0x313f26[_0x447d('0x4b')]['MailAccountId']){_0x273ef3[_0x447d('0x4c')]=_0x313f26[_0x447d('0x4b')]['MailAccountId'];}else if(_0x313f26['body'][_0x447d('0x4d')]){_0x273ef3[_0x447d('0x4d')]=_0x313f26[_0x447d('0x4b')][_0x447d('0x4d')];}else if(_0x313f26[_0x447d('0x4b')][_0x447d('0x4e')]){_0x273ef3[_0x447d('0x4e')]=_0x313f26[_0x447d('0x4b')][_0x447d('0x4e')];}else if(_0x313f26[_0x447d('0x4b')][_0x447d('0x4f')]){_0x273ef3[_0x447d('0x4f')]=_0x313f26[_0x447d('0x4b')][_0x447d('0x4f')];}return db[_0x447d('0x30')][_0x447d('0x49')]({'where':_0x273ef3})[_0x447d('0x27')](function(_0x1cddf7){if(_0x1cddf7){throw new db['Sequelize'][(_0x447d('0x50'))](_0x447d('0x51'));}return db[_0x447d('0x30')][_0x447d('0x4a')](_0x313f26[_0x447d('0x4b')]);})['then'](function(_0x26d642){var _0x33de39=_0x313f26[_0x447d('0x52')][_0x447d('0x29')]({'plain':!![]});if(!_0x33de39)throw new Error(_0x447d('0x53'));if(_0x33de39[_0x447d('0x54')]==='user'){var _0x323091=_0x26d642[_0x447d('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x447d('0x49')]({'where':{'name':_0x447d('0x55'),'userProfileId':_0x33de39[_0x447d('0x56')]},'raw':!![]})['then'](function(_0x320f53){if(_0x320f53&&_0x320f53[_0x447d('0x57')]===0x0){return db[_0x447d('0x2a')][_0x447d('0x4a')]({'name':_0x323091['name'],'resourceId':_0x323091['id'],'type':_0x320f53[_0x447d('0x2c')],'sectionId':_0x320f53['id']},{})['then'](function(){return _0x26d642;});}else{return _0x26d642;}})['catch'](function(_0x2ec3ba){logger[_0x447d('0x2b')](_0x447d('0x58'),_0x2ec3ba);throw _0x2ec3ba;});}return _0x26d642;})[_0x447d('0x27')](respondWithResult(_0x43ee42,0xc9))[_0x447d('0x47')](handleError(_0x43ee42,null));};
\ No newline at end of file
+var _0xb875=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x180b9b,_0x2121e2){var _0x1dae04=function(_0xbe5c27){while(--_0xbe5c27){_0x180b9b['push'](_0x180b9b['shift']());}};_0x1dae04(++_0x2121e2);}(_0xb875,0xf4));var _0x5b87=function(_0x4be53d,_0x1f1c6e){_0x4be53d=_0x4be53d-0x0;var _0x1ae3dd=_0xb875[_0x4be53d];return _0x1ae3dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5b87('0x0'));var jsonpatch=require(_0x5b87('0x1'));var rp=require('request-promise');var moment=require(_0x5b87('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5b87('0x3'));var util=require(_0x5b87('0x4'));var path=require('path');var sox=require(_0x5b87('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b87('0x6'));var _=require(_0x5b87('0x7'));var squel=require(_0x5b87('0x8'));var crypto=require('crypto');var jsforce=require(_0x5b87('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5b87('0xa'));var querystring=require(_0x5b87('0xb'));var Papa=require(_0x5b87('0xc'));var Redis=require(_0x5b87('0xd'));var authService=require(_0x5b87('0xe'));var qs=require(_0x5b87('0xf'));var as=require(_0x5b87('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b87('0x11'))(_0x5b87('0x12'));var utils=require('../../config/utils');var config=require(_0x5b87('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b87('0x14'))['db'];function respondWithStatusCode(_0x384d77,_0x203279){_0x203279=_0x203279||0xcc;return function(_0x58638f){if(_0x58638f){return _0x384d77[_0x5b87('0x15')](_0x203279);}return _0x384d77['status'](_0x203279)['end']();};}function respondWithResult(_0x38750a,_0xcd3bc0){_0xcd3bc0=_0xcd3bc0||0xc8;return function(_0xb6d39d){if(_0xb6d39d){return _0x38750a[_0x5b87('0x16')](_0xcd3bc0)[_0x5b87('0x17')](_0xb6d39d);}};}function respondWithFilteredResult(_0x10f9d4,_0x328fb1){return function(_0x2c6032){if(_0x2c6032){var _0x563b1c=typeof _0x328fb1[_0x5b87('0x18')]===_0x5b87('0x19')&&typeof _0x328fb1[_0x5b87('0x1a')]===_0x5b87('0x19');var _0x558d0a=_0x2c6032[_0x5b87('0x1b')];var _0x475804=_0x563b1c?0x0:_0x328fb1[_0x5b87('0x18')];var _0x2af69d=_0x563b1c?_0x2c6032['count']:_0x328fb1[_0x5b87('0x18')]+_0x328fb1[_0x5b87('0x1a')];var _0x42a8c6;if(_0x2af69d>=_0x558d0a){_0x2af69d=_0x558d0a;_0x42a8c6=0xc8;}else{_0x42a8c6=0xce;}_0x10f9d4[_0x5b87('0x16')](_0x42a8c6);return _0x10f9d4['set'](_0x5b87('0x1c'),_0x475804+'-'+_0x2af69d+'/'+_0x558d0a)['json'](_0x2c6032);}return null;};}function patchUpdates(_0x581a2f){return function(_0x4ae8d5){try{jsonpatch[_0x5b87('0x1d')](_0x4ae8d5,_0x581a2f,!![]);}catch(_0x417deb){return BPromise[_0x5b87('0x1e')](_0x417deb);}return _0x4ae8d5[_0x5b87('0x1f')]();};}function saveUpdates(_0x493814,_0x14dc58){return function(_0x10e4cc){if(_0x10e4cc){return _0x10e4cc['update'](_0x493814)[_0x5b87('0x20')](function(_0x5d6d72){return _0x5d6d72;});}return null;};}function removeEntity(_0xf3d360,_0x75fcb9){return function(_0x129b40){if(_0x129b40){return _0x129b40[_0x5b87('0x21')]()[_0x5b87('0x20')](function(){var _0x488986=_0x129b40[_0x5b87('0x22')]({'plain':!![]});var _0x1170b8=_0x5b87('0x23');return db[_0x5b87('0x24')][_0x5b87('0x21')]({'where':{'type':_0x1170b8,'resourceId':_0x488986['id']}})[_0x5b87('0x20')](function(){return _0x129b40;});})[_0x5b87('0x20')](function(){_0xf3d360[_0x5b87('0x16')](0xcc)[_0x5b87('0x25')]();});}};}function handleEntityNotFound(_0x524ad8,_0x3c3c65){return function(_0x3e3616){if(!_0x3e3616){_0x524ad8[_0x5b87('0x15')](0x194);}return _0x3e3616;};}function handleError(_0x3c1095,_0x181615){_0x181615=_0x181615||0x1f4;return function(_0x31b619){logger[_0x5b87('0x26')](_0x31b619['stack']);if(_0x31b619['name']){delete _0x31b619[_0x5b87('0x27')];}_0x3c1095[_0x5b87('0x16')](_0x181615)[_0x5b87('0x28')](_0x31b619);};}exports[_0x5b87('0x29')]=function(_0x5d46de,_0x474c91){var _0x39d825={},_0x17a1bb={},_0x4c519a={'count':0x0,'rows':[]};var _0x3a63df=_[_0x5b87('0x2a')](db[_0x5b87('0x2b')]['rawAttributes'],function(_0x375d37){return{'name':_0x375d37[_0x5b87('0x2c')],'type':_0x375d37[_0x5b87('0x2d')][_0x5b87('0x2e')]};});_0x17a1bb[_0x5b87('0x2f')]=_['map'](_0x3a63df,_0x5b87('0x27'));_0x17a1bb[_0x5b87('0x30')]=_['keys'](_0x5d46de[_0x5b87('0x30')]);_0x17a1bb[_0x5b87('0x31')]=_[_0x5b87('0x32')](_0x17a1bb[_0x5b87('0x2f')],_0x17a1bb[_0x5b87('0x30')]);_0x39d825['attributes']=_[_0x5b87('0x32')](_0x17a1bb[_0x5b87('0x2f')],qs[_0x5b87('0x33')](_0x5d46de[_0x5b87('0x30')][_0x5b87('0x33')]));_0x39d825[_0x5b87('0x34')]=_0x39d825[_0x5b87('0x34')]['length']?_0x39d825[_0x5b87('0x34')]:_0x17a1bb[_0x5b87('0x2f')];if(!_0x5d46de[_0x5b87('0x30')]['hasOwnProperty'](_0x5b87('0x35'))){_0x39d825[_0x5b87('0x1a')]=qs[_0x5b87('0x1a')](_0x5d46de[_0x5b87('0x30')][_0x5b87('0x1a')]);_0x39d825['offset']=qs[_0x5b87('0x18')](_0x5d46de[_0x5b87('0x30')][_0x5b87('0x18')]);}_0x39d825[_0x5b87('0x36')]=qs[_0x5b87('0x37')](_0x5d46de['query']['sort']);_0x39d825[_0x5b87('0x38')]=qs[_0x5b87('0x31')](_[_0x5b87('0x39')](_0x5d46de['query'],_0x17a1bb[_0x5b87('0x31')]),_0x3a63df);if(_0x5d46de[_0x5b87('0x30')][_0x5b87('0x3a')]){_0x39d825[_0x5b87('0x38')]=_[_0x5b87('0x3b')](_0x39d825[_0x5b87('0x38')],{'$or':[{'key':{'$like':'%'+_0x5d46de[_0x5b87('0x30')][_0x5b87('0x3a')]+'%'}},{'value':{'$like':'%'+_0x5d46de[_0x5b87('0x30')][_0x5b87('0x3a')]+'%'}}]});}_0x39d825=_['merge']({},_0x39d825,_0x5d46de['options']);var _0x405833={'where':_0x39d825[_0x5b87('0x38')]};return db[_0x5b87('0x2b')][_0x5b87('0x1b')](_0x405833)['then'](function(_0x420950){_0x4c519a['count']=_0x420950;if(_0x5d46de['query'][_0x5b87('0x3c')]){_0x39d825[_0x5b87('0x3d')]=[{'all':!![]}];}return db[_0x5b87('0x2b')][_0x5b87('0x3e')](_0x39d825);})[_0x5b87('0x20')](function(_0x152d5e){_0x4c519a[_0x5b87('0x3f')]=_0x152d5e;return _0x4c519a;})['then'](respondWithFilteredResult(_0x474c91,_0x39d825))[_0x5b87('0x40')](handleError(_0x474c91,null));};exports[_0x5b87('0x41')]=function(_0x5b0bc2,_0x1c8e57){var _0x361bcd={'raw':!![],'where':{'id':_0x5b0bc2[_0x5b87('0x42')]['id']}},_0x2f7c94={};_0x2f7c94[_0x5b87('0x2f')]=_['keys'](db[_0x5b87('0x2b')][_0x5b87('0x43')]);_0x2f7c94['query']=_['keys'](_0x5b0bc2['query']);_0x2f7c94[_0x5b87('0x31')]=_[_0x5b87('0x32')](_0x2f7c94['model'],_0x2f7c94[_0x5b87('0x30')]);_0x361bcd['attributes']=_[_0x5b87('0x32')](_0x2f7c94[_0x5b87('0x2f')],qs['fields'](_0x5b0bc2[_0x5b87('0x30')]['fields']));_0x361bcd['attributes']=_0x361bcd['attributes'][_0x5b87('0x44')]?_0x361bcd[_0x5b87('0x34')]:_0x2f7c94['model'];if(_0x5b0bc2['query'][_0x5b87('0x3c')]){_0x361bcd[_0x5b87('0x3d')]=[{'all':!![]}];}_0x361bcd=_['merge']({},_0x361bcd,_0x5b0bc2[_0x5b87('0x45')]);return db['CannedAnswer'][_0x5b87('0x46')](_0x361bcd)['then'](handleEntityNotFound(_0x1c8e57,null))[_0x5b87('0x20')](respondWithResult(_0x1c8e57,null))[_0x5b87('0x40')](handleError(_0x1c8e57,null));};exports[_0x5b87('0x47')]=function(_0x297371,_0x1bd417){if(_0x297371[_0x5b87('0x48')]['id']){delete _0x297371[_0x5b87('0x48')]['id'];}return db['CannedAnswer'][_0x5b87('0x46')]({'where':{'id':_0x297371['params']['id']}})[_0x5b87('0x20')](handleEntityNotFound(_0x1bd417,null))[_0x5b87('0x20')](saveUpdates(_0x297371[_0x5b87('0x48')],null))['then'](respondWithResult(_0x1bd417,null))[_0x5b87('0x40')](handleError(_0x1bd417,null));};exports['destroy']=function(_0x3a0791,_0x2f9197){return db[_0x5b87('0x2b')]['find']({'where':{'id':_0x3a0791[_0x5b87('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f9197,null))[_0x5b87('0x20')](removeEntity(_0x2f9197,null))['catch'](handleError(_0x2f9197,null));};exports[_0x5b87('0x49')]=function(_0x3da522,_0x2ffb55){var _0x3b6b6b={'key':_0x3da522[_0x5b87('0x48')][_0x5b87('0x2e')]};if(_0x3da522[_0x5b87('0x48')][_0x5b87('0x4a')]){_0x3b6b6b[_0x5b87('0x4a')]=_0x3da522[_0x5b87('0x48')][_0x5b87('0x4a')];}else if(_0x3da522[_0x5b87('0x48')][_0x5b87('0x4b')]){_0x3b6b6b[_0x5b87('0x4b')]=_0x3da522['body']['SmsAccountId'];}else if(_0x3da522[_0x5b87('0x48')][_0x5b87('0x4c')]){_0x3b6b6b[_0x5b87('0x4c')]=_0x3da522[_0x5b87('0x48')]['OpenchannelAccountId'];}else if(_0x3da522[_0x5b87('0x48')][_0x5b87('0x4d')]){_0x3b6b6b[_0x5b87('0x4d')]=_0x3da522['body'][_0x5b87('0x4d')];}return db[_0x5b87('0x2b')][_0x5b87('0x46')]({'where':_0x3b6b6b})[_0x5b87('0x20')](function(_0x23ae71){if(_0x23ae71){throw new db[(_0x5b87('0x4e'))][(_0x5b87('0x4f'))](_0x5b87('0x50'));}return db['CannedAnswer'][_0x5b87('0x49')](_0x3da522[_0x5b87('0x48')]);})['then'](function(_0x533d13){var _0xe45281=_0x3da522[_0x5b87('0x51')][_0x5b87('0x22')]({'plain':!![]});if(!_0xe45281)throw new Error(_0x5b87('0x52'));if(_0xe45281[_0x5b87('0x53')]===_0x5b87('0x51')){var _0x3d563b=_0x533d13[_0x5b87('0x22')]({'plain':!![]});return db[_0x5b87('0x54')][_0x5b87('0x46')]({'where':{'name':_0x5b87('0x23'),'userProfileId':_0xe45281[_0x5b87('0x55')]},'raw':!![]})['then'](function(_0x23fe18){if(_0x23fe18&&_0x23fe18[_0x5b87('0x56')]===0x0){return db[_0x5b87('0x24')][_0x5b87('0x49')]({'name':_0x3d563b['name'],'resourceId':_0x3d563b['id'],'type':_0x23fe18[_0x5b87('0x27')],'sectionId':_0x23fe18['id']},{})[_0x5b87('0x20')](function(){return _0x533d13;});}else{return _0x533d13;}})[_0x5b87('0x40')](function(_0x12e2d7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12e2d7);throw _0x12e2d7;});}return _0x533d13;})[_0x5b87('0x20')](respondWithResult(_0x2ffb55,0xc9))[_0x5b87('0x40')](handleError(_0x2ffb55,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 271f80d..b17230f 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 _0x13ba=['request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','lodash','../../config/logger','moment','bluebird'];(function(_0x1c8c2f,_0x1d99fe){var _0x24fa67=function(_0x15fd50){while(--_0x15fd50){_0x1c8c2f['push'](_0x1c8c2f['shift']());}};_0x24fa67(++_0x1d99fe);}(_0x13ba,0x1bf));var _0xa13b=function(_0x1d0764,_0x2beb7c){_0x1d0764=_0x1d0764-0x0;var _0x423f49=_0x13ba[_0x1d0764];return _0x423f49;};'use strict';var _=require(_0xa13b('0x0'));var util=require('util');var logger=require(_0xa13b('0x1'))('api');var moment=require(_0xa13b('0x2'));var BPromise=require(_0xa13b('0x3'));var rp=require(_0xa13b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa13b('0x5'));var config=require('../../config/environment');var attributes=require(_0xa13b('0x6'));module[_0xa13b('0x7')]=function(_0x491ba3,_0x3875c5){return _0x491ba3[_0xa13b('0x8')](_0xa13b('0x9'),attributes,{'tableName':_0xa13b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7728=['define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x17953f,_0x115870){var _0x4e3a07=function(_0x482004){while(--_0x482004){_0x17953f['push'](_0x17953f['shift']());}};_0x4e3a07(++_0x115870);}(_0x7728,0xd5));var _0x8772=function(_0x2f8000,_0x37c02b){_0x2f8000=_0x2f8000-0x0;var _0x25cfee=_0x7728[_0x2f8000];return _0x25cfee;};'use strict';var _=require('lodash');var util=require(_0x8772('0x0'));var logger=require(_0x8772('0x1'))(_0x8772('0x2'));var moment=require(_0x8772('0x3'));var BPromise=require(_0x8772('0x4'));var rp=require(_0x8772('0x5'));var fs=require('fs');var path=require(_0x8772('0x6'));var rimraf=require(_0x8772('0x7'));var config=require(_0x8772('0x8'));var attributes=require(_0x8772('0x9'));module[_0x8772('0xa')]=function(_0x1897a2,_0x1b10e8){return _0x1897a2[_0x8772('0xb')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8772('0xc'),'collate':_0x8772('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 59d8efc..8fc2cf7 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(_0x35ac5c,_0x378842){var _0x15ef45=function(_0x1aed4b){while(--_0x1aed4b){_0x35ac5c['push'](_0x35ac5c['shift']());}};_0x15ef45(++_0x378842);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x26a6c7,_0x3a9b26){var _0xbbb3c2=function(_0x3eaf2d){while(--_0x3eaf2d){_0x26a6c7['push'](_0x26a6c7['shift']());}};_0xbbb3c2(++_0x3a9b26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 c17b0f7..f1060f1 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 _0x774e=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2bb46a,_0x9d01d8){var _0x5ae321=function(_0x8c3a1e){while(--_0x8c3a1e){_0x2bb46a['push'](_0x2bb46a['shift']());}};_0x5ae321(++_0x9d01d8);}(_0x774e,0x1a6));var _0xe774=function(_0x5c3f97,_0x2ae323){_0x5c3f97=_0x5c3f97-0x0;var _0x48f58a=_0x774e[_0x5c3f97];return _0x48f58a;};'use strict';var multer=require(_0xe774('0x0'));var util=require(_0xe774('0x1'));var path=require(_0xe774('0x2'));var timeout=require(_0xe774('0x3'));var express=require(_0xe774('0x4'));var router=express[_0xe774('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe774('0x6'));var interaction=require(_0xe774('0x7'));var config=require(_0xe774('0x8'));var controller=require(_0xe774('0x9'));router[_0xe774('0xa')]('/',auth[_0xe774('0xb')](),controller[_0xe774('0xc')]);router[_0xe774('0xa')](_0xe774('0xd'),auth[_0xe774('0xb')](),controller[_0xe774('0xe')]);router[_0xe774('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe774('0x10')](_0xe774('0xd'),auth[_0xe774('0xb')](),controller[_0xe774('0x11')]);router[_0xe774('0x12')](_0xe774('0xd'),auth[_0xe774('0xb')](),controller[_0xe774('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x8cf0=['isAuthenticated','index','show','post','create','put','/:id','delete','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x205abb,_0x130e47){var _0x390baa=function(_0x309536){while(--_0x309536){_0x205abb['push'](_0x205abb['shift']());}};_0x390baa(++_0x130e47);}(_0x8cf0,0x1a7));var _0x08cf=function(_0x4f6e90,_0x1f15e0){_0x4f6e90=_0x4f6e90-0x0;var _0x11cc0c=_0x8cf0[_0x4f6e90];return _0x11cc0c;};'use strict';var multer=require(_0x08cf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x08cf('0x1'));var router=express[_0x08cf('0x2')]();var fs_extra=require(_0x08cf('0x3'));var auth=require(_0x08cf('0x4'));var interaction=require(_0x08cf('0x5'));var config=require(_0x08cf('0x6'));var controller=require(_0x08cf('0x7'));router[_0x08cf('0x8')]('/',auth[_0x08cf('0x9')](),controller[_0x08cf('0xa')]);router['get']('/:id',auth[_0x08cf('0x9')](),controller[_0x08cf('0xb')]);router[_0x08cf('0xc')]('/',auth[_0x08cf('0x9')](),controller[_0x08cf('0xd')]);router[_0x08cf('0xe')](_0x08cf('0xf'),auth[_0x08cf('0x9')](),controller['update']);router[_0x08cf('0x10')](_0x08cf('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x08cf('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index d26601c..e191e2a 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 _0xed8a=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x430241,_0x46f153){var _0x5db5b3=function(_0x56880d){while(--_0x56880d){_0x430241['push'](_0x430241['shift']());}};_0x5db5b3(++_0x46f153);}(_0xed8a,0xc5));var _0xaed8=function(_0x5f25a4,_0x529f81){_0x5f25a4=_0x5f25a4-0x0;var _0xeb455=_0xed8a[_0x5f25a4];return _0xeb455;};'use strict';var Sequelize=require(_0xaed8('0x0'));module[_0xaed8('0x1')]={'calldate':{'type':Sequelize[_0xaed8('0x2')],'allowNull':![],'defaultValue':_0xaed8('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xaed8('0x4')]},'dst':{'type':Sequelize[_0xaed8('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaed8('0x4')]},'dstchannel':{'type':Sequelize[_0xaed8('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xaed8('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xaed8('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaed8('0x4')]},'amaflags':{'type':Sequelize[_0xaed8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaed8('0x4')]},'userfield':{'type':Sequelize[_0xaed8('0x4')]},'uniqueid':{'type':Sequelize[_0xaed8('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xaed8('0x4')]},'peeraccount':{'type':Sequelize[_0xaed8('0x4')]},'type':{'type':Sequelize[_0xaed8('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3cb3=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2273ad,_0x4effd6){var _0x3f6622=function(_0x5d8df9){while(--_0x5d8df9){_0x2273ad['push'](_0x2273ad['shift']());}};_0x3f6622(++_0x4effd6);}(_0x3cb3,0x156));var _0x33cb=function(_0x872e48,_0x21c55f){_0x872e48=_0x872e48-0x0;var _0x4cb0ff=_0x3cb3[_0x872e48];return _0x4cb0ff;};'use strict';var Sequelize=require(_0x33cb('0x0'));module[_0x33cb('0x1')]={'calldate':{'type':Sequelize[_0x33cb('0x2')],'allowNull':![],'defaultValue':_0x33cb('0x3')},'clid':{'type':Sequelize[_0x33cb('0x4')]},'src':{'type':Sequelize[_0x33cb('0x4')]},'dst':{'type':Sequelize[_0x33cb('0x4')]},'dcontext':{'type':Sequelize[_0x33cb('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x33cb('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x33cb('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x33cb('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x33cb('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x33cb('0x4')]},'linkedid':{'type':Sequelize[_0x33cb('0x4')]},'sequence':{'type':Sequelize[_0x33cb('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x33cb('0x4')]},'tag':{'type':Sequelize[_0x33cb('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index e227bd0..63a1b5c 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 _0x4b84=['save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','includeAll','include','findAll','catch','show','find','create','body','params','describe','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4b84,0x1cc));var _0x44b8=function(_0xed5f9c,_0x5a25cd){_0xed5f9c=_0xed5f9c-0x0;var _0x3a1c43=_0x4b84[_0xed5f9c];return _0x3a1c43;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(!_0x230a3d){_0x25a0c1['sendStatus'](0x194);}return _0x230a3d;};}function handleError(_0x474f01,_0x502acf){_0x502acf=_0x502acf||0x1f4;return function(_0x41d673){logger[_0x44b8('0x22')](_0x41d673['stack']);if(_0x41d673[_0x44b8('0x23')]){delete _0x41d673[_0x44b8('0x23')];}_0x474f01[_0x44b8('0x14')](_0x502acf)['send'](_0x41d673);};}exports[_0x44b8('0x24')]=function(_0x242342,_0x53d9c7){var _0x2e0174={},_0x4a182d={},_0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['Cdr'][_0x44b8('0x25')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x26')],'type':_0x29b18d[_0x44b8('0x27')][_0x44b8('0x28')]};});_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x2a')](_0x5a544c,_0x44b8('0x23'));_0x4a182d[_0x44b8('0x2b')]=_[_0x44b8('0x2c')](_0x242342[_0x44b8('0x2b')]);_0x4a182d[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x4a182d['model'],_0x4a182d[_0x44b8('0x2b')]);_0x2e0174['attributes']=_[_0x44b8('0x2e')](_0x4a182d[_0x44b8('0x29')],qs[_0x44b8('0x2f')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x2f')]));_0x2e0174['attributes']=_0x2e0174[_0x44b8('0x30')][_0x44b8('0x31')]?_0x2e0174[_0x44b8('0x30')]:_0x4a182d[_0x44b8('0x29')];if(!_0x242342[_0x44b8('0x2b')]['hasOwnProperty'](_0x44b8('0x32'))){_0x2e0174[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x17')]);_0x2e0174[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x19')]);}_0x2e0174[_0x44b8('0x33')]=qs[_0x44b8('0x34')](_0x242342[_0x44b8('0x2b')][_0x44b8('0x34')]);_0x2e0174[_0x44b8('0x35')]=qs[_0x44b8('0x2d')](_[_0x44b8('0x36')](_0x242342[_0x44b8('0x2b')],_0x4a182d[_0x44b8('0x2d')]),_0x5a544c);if(_0x242342[_0x44b8('0x2b')][_0x44b8('0x37')]){_0x2e0174[_0x44b8('0x35')]=_[_0x44b8('0x38')](_0x2e0174['where'],{'$or':_[_0x44b8('0x2a')](_0x5a544c,function(_0xd61f14){if(_0xd61f14['type']!==_0x44b8('0x39')){var _0x2b9139={};_0x2b9139[_0xd61f14[_0x44b8('0x23')]]={'$like':'%'+_0x242342[_0x44b8('0x2b')]['filter']+'%'};return _0x2b9139;}})});}_0x2e0174=_[_0x44b8('0x38')]({},_0x2e0174,_0x242342[_0x44b8('0x3a')]);var _0x3611b4={'where':_0x2e0174[_0x44b8('0x35')]};return db[_0x44b8('0x3b')][_0x44b8('0x18')](_0x3611b4)[_0x44b8('0x20')](function(_0x3581b8){_0xfb0028[_0x44b8('0x18')]=_0x3581b8;if(_0x242342[_0x44b8('0x2b')][_0x44b8('0x3c')]){_0x2e0174[_0x44b8('0x3d')]=[{'all':!![]}];}return db[_0x44b8('0x3b')][_0x44b8('0x3e')](_0x2e0174);})[_0x44b8('0x20')](function(_0x29b43f){_0xfb0028['rows']=_0x29b43f;return _0xfb0028;})[_0x44b8('0x20')](respondWithFilteredResult(_0x53d9c7,_0x2e0174))[_0x44b8('0x3f')](handleError(_0x53d9c7,null));};exports[_0x44b8('0x40')]=function(_0x57f3b9,_0xd424f8){var _0x1054c5={'raw':!![],'where':{'id':_0x57f3b9['params']['id']}},_0x229cc9={};_0x229cc9[_0x44b8('0x29')]=_[_0x44b8('0x2c')](db[_0x44b8('0x3b')][_0x44b8('0x25')]);_0x229cc9[_0x44b8('0x2b')]=_['keys'](_0x57f3b9['query']);_0x229cc9[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x229cc9[_0x44b8('0x29')],_0x229cc9[_0x44b8('0x2b')]);_0x1054c5[_0x44b8('0x30')]=_[_0x44b8('0x2e')](_0x229cc9[_0x44b8('0x29')],qs[_0x44b8('0x2f')](_0x57f3b9[_0x44b8('0x2b')][_0x44b8('0x2f')]));_0x1054c5[_0x44b8('0x30')]=_0x1054c5[_0x44b8('0x30')][_0x44b8('0x31')]?_0x1054c5[_0x44b8('0x30')]:_0x229cc9[_0x44b8('0x29')];if(_0x57f3b9[_0x44b8('0x2b')][_0x44b8('0x3c')]){_0x1054c5[_0x44b8('0x3d')]=[{'all':!![]}];}_0x1054c5=_[_0x44b8('0x38')]({},_0x1054c5,_0x57f3b9['options']);return db['Cdr'][_0x44b8('0x41')](_0x1054c5)[_0x44b8('0x20')](handleEntityNotFound(_0xd424f8,null))[_0x44b8('0x20')](respondWithResult(_0xd424f8,null))[_0x44b8('0x3f')](handleError(_0xd424f8,null));};exports[_0x44b8('0x42')]=function(_0x1bbf1e,_0x411ed6){return db['Cdr'][_0x44b8('0x42')](_0x1bbf1e['body'],{})[_0x44b8('0x20')](respondWithResult(_0x411ed6,0xc9))[_0x44b8('0x3f')](handleError(_0x411ed6,null));};exports[_0x44b8('0x1f')]=function(_0x9207bf,_0x103d57){if(_0x9207bf[_0x44b8('0x43')]['id']){delete _0x9207bf['body']['id'];}return db[_0x44b8('0x3b')][_0x44b8('0x41')]({'where':{'id':_0x9207bf[_0x44b8('0x44')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x103d57,null))['then'](saveUpdates(_0x9207bf[_0x44b8('0x43')],null))[_0x44b8('0x20')](respondWithResult(_0x103d57,null))[_0x44b8('0x3f')](handleError(_0x103d57,null));};exports[_0x44b8('0x21')]=function(_0x44ec23,_0x470ebb){return db['Cdr'][_0x44b8('0x41')]({'where':{'id':_0x44ec23[_0x44b8('0x44')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x470ebb,null))[_0x44b8('0x20')](removeEntity(_0x470ebb,null))[_0x44b8('0x3f')](handleError(_0x470ebb,null));};exports['describe']=function(_0x493840,_0x2516fc){return db['Cdr'][_0x44b8('0x45')]()['then'](respondWithResult(_0x2516fc,null))[_0x44b8('0x3f')](handleError(_0x2516fc,null));};
\ No newline at end of file
+var _0xca9e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','fields','find','create','body','describe','eml-format','rimraf'];(function(_0x3db102,_0x281787){var _0x3be7da=function(_0x3ca143){while(--_0x3ca143){_0x3db102['push'](_0x3db102['shift']());}};_0x3be7da(++_0x281787);}(_0xca9e,0x136));var _0xeca9=function(_0x3d99d8,_0x32e0c5){_0x3d99d8=_0x3d99d8-0x0;var _0x46f0b1=_0xca9e[_0x3d99d8];return _0x46f0b1;};'use strict';var emlformat=require(_0xeca9('0x0'));var rimraf=require(_0xeca9('0x1'));var zipdir=require(_0xeca9('0x2'));var jsonpatch=require(_0xeca9('0x3'));var rp=require(_0xeca9('0x4'));var moment=require(_0xeca9('0x5'));var BPromise=require(_0xeca9('0x6'));var Mustache=require(_0xeca9('0x7'));var util=require(_0xeca9('0x8'));var path=require(_0xeca9('0x9'));var sox=require(_0xeca9('0xa'));var csv=require(_0xeca9('0xb'));var ejs=require(_0xeca9('0xc'));var fs=require('fs');var fs_extra=require(_0xeca9('0xd'));var _=require('lodash');var squel=require(_0xeca9('0xe'));var crypto=require(_0xeca9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeca9('0xb'));var querystring=require(_0xeca9('0x10'));var Papa=require(_0xeca9('0x11'));var Redis=require('ioredis');var authService=require(_0xeca9('0x12'));var qs=require(_0xeca9('0x13'));var as=require(_0xeca9('0x14'));var hardwareService=require(_0xeca9('0x15'));var logger=require(_0xeca9('0x16'))(_0xeca9('0x17'));var utils=require('../../config/utils');var config=require(_0xeca9('0x18'));var licenseUtil=require(_0xeca9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ca6f,_0x4b2ae1){_0x4b2ae1=_0x4b2ae1||0xcc;return function(_0x3c6cc7){if(_0x3c6cc7){return _0x27ca6f[_0xeca9('0x1a')](_0x4b2ae1);}return _0x27ca6f['status'](_0x4b2ae1)[_0xeca9('0x1b')]();};}function respondWithResult(_0x384ae2,_0x1ba9e9){_0x1ba9e9=_0x1ba9e9||0xc8;return function(_0x4d65ee){if(_0x4d65ee){return _0x384ae2[_0xeca9('0x1c')](_0x1ba9e9)[_0xeca9('0x1d')](_0x4d65ee);}};}function respondWithFilteredResult(_0x910814,_0x6e9fd4){return function(_0x551393){if(_0x551393){var _0x520411=typeof _0x6e9fd4[_0xeca9('0x1e')]===_0xeca9('0x1f')&&typeof _0x6e9fd4['limit']===_0xeca9('0x1f');var _0x11bf78=_0x551393['count'];var _0x517060=_0x520411?0x0:_0x6e9fd4['offset'];var _0x132008=_0x520411?_0x551393[_0xeca9('0x20')]:_0x6e9fd4[_0xeca9('0x1e')]+_0x6e9fd4['limit'];var _0xf1ef9f;if(_0x132008>=_0x11bf78){_0x132008=_0x11bf78;_0xf1ef9f=0xc8;}else{_0xf1ef9f=0xce;}_0x910814['status'](_0xf1ef9f);return _0x910814['set'](_0xeca9('0x21'),_0x517060+'-'+_0x132008+'/'+_0x11bf78)['json'](_0x551393);}return null;};}function patchUpdates(_0x31720b){return function(_0x1c4dd6){try{jsonpatch['apply'](_0x1c4dd6,_0x31720b,!![]);}catch(_0x5a2cca){return BPromise[_0xeca9('0x22')](_0x5a2cca);}return _0x1c4dd6['save']();};}function saveUpdates(_0x3647ed,_0x5279d0){return function(_0x3a3608){if(_0x3a3608){return _0x3a3608[_0xeca9('0x23')](_0x3647ed)[_0xeca9('0x24')](function(_0x5c3495){return _0x5c3495;});}return null;};}function removeEntity(_0x3fcfb8,_0x466883){return function(_0x515e63){if(_0x515e63){return _0x515e63[_0xeca9('0x25')]()[_0xeca9('0x24')](function(){_0x3fcfb8[_0xeca9('0x1c')](0xcc)[_0xeca9('0x1b')]();});}};}function handleEntityNotFound(_0x498f4a,_0x32699b){return function(_0x57e190){if(!_0x57e190){_0x498f4a[_0xeca9('0x1a')](0x194);}return _0x57e190;};}function handleError(_0x251ce4,_0x1702fb){_0x1702fb=_0x1702fb||0x1f4;return function(_0x3e41df){logger[_0xeca9('0x26')](_0x3e41df[_0xeca9('0x27')]);if(_0x3e41df[_0xeca9('0x28')]){delete _0x3e41df[_0xeca9('0x28')];}_0x251ce4[_0xeca9('0x1c')](_0x1702fb)[_0xeca9('0x29')](_0x3e41df);};}exports[_0xeca9('0x2a')]=function(_0x3b0aab,_0x424f7b){var _0x1436d0={},_0x8d9a8d={},_0x4910a3={'count':0x0,'rows':[]};var _0x4db3e2=_['map'](db[_0xeca9('0x2b')]['rawAttributes'],function(_0x2ca943){return{'name':_0x2ca943[_0xeca9('0x2c')],'type':_0x2ca943[_0xeca9('0x2d')][_0xeca9('0x2e')]};});_0x8d9a8d[_0xeca9('0x2f')]=_[_0xeca9('0x30')](_0x4db3e2,'name');_0x8d9a8d[_0xeca9('0x31')]=_['keys'](_0x3b0aab[_0xeca9('0x31')]);_0x8d9a8d[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x8d9a8d['model'],_0x8d9a8d[_0xeca9('0x31')]);_0x1436d0[_0xeca9('0x34')]=_[_0xeca9('0x33')](_0x8d9a8d[_0xeca9('0x2f')],qs['fields'](_0x3b0aab[_0xeca9('0x31')]['fields']));_0x1436d0[_0xeca9('0x34')]=_0x1436d0[_0xeca9('0x34')][_0xeca9('0x35')]?_0x1436d0[_0xeca9('0x34')]:_0x8d9a8d[_0xeca9('0x2f')];if(!_0x3b0aab[_0xeca9('0x31')]['hasOwnProperty'](_0xeca9('0x36'))){_0x1436d0[_0xeca9('0x37')]=qs[_0xeca9('0x37')](_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x37')]);_0x1436d0[_0xeca9('0x1e')]=qs[_0xeca9('0x1e')](_0x3b0aab['query'][_0xeca9('0x1e')]);}_0x1436d0[_0xeca9('0x38')]=qs[_0xeca9('0x39')](_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x39')]);_0x1436d0[_0xeca9('0x3a')]=qs['filters'](_[_0xeca9('0x3b')](_0x3b0aab['query'],_0x8d9a8d[_0xeca9('0x32')]),_0x4db3e2);if(_0x3b0aab['query'][_0xeca9('0x3c')]){_0x1436d0[_0xeca9('0x3a')]=_['merge'](_0x1436d0[_0xeca9('0x3a')],{'$or':_['map'](_0x4db3e2,function(_0x2a249b){if(_0x2a249b['type']!==_0xeca9('0x3d')){var _0x5aa0b1={};_0x5aa0b1[_0x2a249b[_0xeca9('0x28')]]={'$like':'%'+_0x3b0aab[_0xeca9('0x31')]['filter']+'%'};return _0x5aa0b1;}})});}_0x1436d0=_[_0xeca9('0x3e')]({},_0x1436d0,_0x3b0aab[_0xeca9('0x3f')]);var _0x4e8080={'where':_0x1436d0[_0xeca9('0x3a')]};return db[_0xeca9('0x2b')][_0xeca9('0x20')](_0x4e8080)[_0xeca9('0x24')](function(_0xb1f2fc){_0x4910a3[_0xeca9('0x20')]=_0xb1f2fc;if(_0x3b0aab[_0xeca9('0x31')][_0xeca9('0x40')]){_0x1436d0[_0xeca9('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xeca9('0x42')](_0x1436d0);})[_0xeca9('0x24')](function(_0x15ef4e){_0x4910a3[_0xeca9('0x43')]=_0x15ef4e;return _0x4910a3;})[_0xeca9('0x24')](respondWithFilteredResult(_0x424f7b,_0x1436d0))[_0xeca9('0x44')](handleError(_0x424f7b,null));};exports[_0xeca9('0x45')]=function(_0x5cb0d1,_0x1d3338){var _0x388943={'raw':!![],'where':{'id':_0x5cb0d1[_0xeca9('0x46')]['id']}},_0x188ebc={};_0x188ebc[_0xeca9('0x2f')]=_['keys'](db[_0xeca9('0x2b')][_0xeca9('0x47')]);_0x188ebc[_0xeca9('0x31')]=_[_0xeca9('0x48')](_0x5cb0d1['query']);_0x188ebc[_0xeca9('0x32')]=_[_0xeca9('0x33')](_0x188ebc['model'],_0x188ebc[_0xeca9('0x31')]);_0x388943[_0xeca9('0x34')]=_[_0xeca9('0x33')](_0x188ebc[_0xeca9('0x2f')],qs[_0xeca9('0x49')](_0x5cb0d1[_0xeca9('0x31')][_0xeca9('0x49')]));_0x388943[_0xeca9('0x34')]=_0x388943[_0xeca9('0x34')][_0xeca9('0x35')]?_0x388943[_0xeca9('0x34')]:_0x188ebc[_0xeca9('0x2f')];if(_0x5cb0d1[_0xeca9('0x31')][_0xeca9('0x40')]){_0x388943[_0xeca9('0x41')]=[{'all':!![]}];}_0x388943=_['merge']({},_0x388943,_0x5cb0d1[_0xeca9('0x3f')]);return db[_0xeca9('0x2b')][_0xeca9('0x4a')](_0x388943)[_0xeca9('0x24')](handleEntityNotFound(_0x1d3338,null))['then'](respondWithResult(_0x1d3338,null))[_0xeca9('0x44')](handleError(_0x1d3338,null));};exports[_0xeca9('0x4b')]=function(_0x548fab,_0x5e6dc2){return db[_0xeca9('0x2b')][_0xeca9('0x4b')](_0x548fab[_0xeca9('0x4c')],{})[_0xeca9('0x24')](respondWithResult(_0x5e6dc2,0xc9))['catch'](handleError(_0x5e6dc2,null));};exports[_0xeca9('0x23')]=function(_0xa4faf9,_0x346c62){if(_0xa4faf9[_0xeca9('0x4c')]['id']){delete _0xa4faf9[_0xeca9('0x4c')]['id'];}return db[_0xeca9('0x2b')][_0xeca9('0x4a')]({'where':{'id':_0xa4faf9[_0xeca9('0x46')]['id']}})[_0xeca9('0x24')](handleEntityNotFound(_0x346c62,null))['then'](saveUpdates(_0xa4faf9['body'],null))[_0xeca9('0x24')](respondWithResult(_0x346c62,null))[_0xeca9('0x44')](handleError(_0x346c62,null));};exports['destroy']=function(_0x283d2d,_0x315f54){return db[_0xeca9('0x2b')][_0xeca9('0x4a')]({'where':{'id':_0x283d2d[_0xeca9('0x46')]['id']}})[_0xeca9('0x24')](handleEntityNotFound(_0x315f54,null))[_0xeca9('0x24')](removeEntity(_0x315f54,null))[_0xeca9('0x44')](handleError(_0x315f54,null));};exports[_0xeca9('0x4d')]=function(_0x56a212,_0x5cd84d){return db['Cdr']['describe']()[_0xeca9('0x24')](respondWithResult(_0x5cd84d,null))['catch'](handleError(_0x5cd84d,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index ee0e085..662f6e6 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3dba51,_0x16fc4c){var _0x2d7352=function(_0x21a91a){while(--_0x21a91a){_0x3dba51['push'](_0x3dba51['shift']());}};_0x2d7352(++_0x16fc4c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4b84df,_0x21d1ce){var _0x4d31fe=function(_0xbf78dc){while(--_0xbf78dc){_0x4b84df['push'](_0x4b84df['shift']());}};_0x4d31fe(++_0x21d1ce);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 092fc1f..3392427 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 _0x30e2=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s'];(function(_0x3dcef0,_0x3d3a95){var _0x194d53=function(_0x5743e2){while(--_0x5743e2){_0x3dcef0['push'](_0x3dcef0['shift']());}};_0x194d53(++_0x3d3a95);}(_0x30e2,0x198));var _0x230e=function(_0x3261db,_0x5ca0a){_0x3261db=_0x3261db-0x0;var _0x8c0bf3=_0x30e2[_0x3261db];return _0x8c0bf3;};'use strict';var _=require(_0x230e('0x0'));var util=require(_0x230e('0x1'));var moment=require(_0x230e('0x2'));var BPromise=require('bluebird');var rs=require(_0x230e('0x3'));var fs=require('fs');var Redis=require(_0x230e('0x4'));var db=require(_0x230e('0x5'))['db'];var utils=require(_0x230e('0x6'));var logger=require(_0x230e('0x7'))(_0x230e('0x8'));var config=require(_0x230e('0x9'));var jayson=require(_0x230e('0xa'));var client=jayson[_0x230e('0xb')][_0x230e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52a0e6,_0x546f90,_0x3e71b1){return new BPromise(function(_0x332d35,_0xde786c){return client[_0x230e('0xd')](_0x52a0e6,_0x3e71b1)[_0x230e('0xe')](function(_0x2b44ea){logger[_0x230e('0xf')](_0x230e('0x10'),_0x546f90,'request\x20sent');logger['debug'](_0x230e('0x11'),_0x546f90,'request\x20sent',JSON[_0x230e('0x12')](_0x2b44ea));if(_0x2b44ea[_0x230e('0x13')]){if(_0x2b44ea['error'][_0x230e('0x14')]===0x1f4){logger[_0x230e('0x13')](_0x230e('0x10'),_0x546f90,_0x2b44ea['error'][_0x230e('0x15')]);return _0xde786c(_0x2b44ea[_0x230e('0x13')][_0x230e('0x15')]);}logger[_0x230e('0x13')](_0x230e('0x10'),_0x546f90,_0x2b44ea['error'][_0x230e('0x15')]);return _0x332d35(_0x2b44ea[_0x230e('0x13')][_0x230e('0x15')]);}else{logger[_0x230e('0xf')]('Cdr,\x20%s,\x20%s',_0x546f90,_0x230e('0x16'));_0x332d35(_0x2b44ea[_0x230e('0x17')][_0x230e('0x15')]);}})[_0x230e('0x18')](function(_0x135e9b){logger[_0x230e('0x13')](_0x230e('0x10'),_0x546f90,_0x135e9b);_0xde786c(_0x135e9b);});});}
\ No newline at end of file
+var _0x7732=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Cdr,\x20%s,\x20%s'];(function(_0x10aec2,_0x1b346f){var _0x5b69ab=function(_0xe8505a){while(--_0xe8505a){_0x10aec2['push'](_0x10aec2['shift']());}};_0x5b69ab(++_0x1b346f);}(_0x7732,0x173));var _0x2773=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x7732[_0x595013];return _0x2a29e3;};'use strict';var _=require(_0x2773('0x0'));var util=require('util');var moment=require(_0x2773('0x1'));var BPromise=require(_0x2773('0x2'));var rs=require(_0x2773('0x3'));var fs=require('fs');var Redis=require(_0x2773('0x4'));var db=require(_0x2773('0x5'))['db'];var utils=require(_0x2773('0x6'));var logger=require('../../config/logger')(_0x2773('0x7'));var config=require(_0x2773('0x8'));var jayson=require(_0x2773('0x9'));var client=jayson['client'][_0x2773('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x440dac,_0xd3e2b9,_0x1134c7){return new BPromise(function(_0x2bb392,_0x5c8256){return client[_0x2773('0xb')](_0x440dac,_0x1134c7)[_0x2773('0xc')](function(_0x211ae5){logger[_0x2773('0xd')]('Cdr,\x20%s,\x20%s',_0xd3e2b9,'request\x20sent');logger[_0x2773('0xe')](_0x2773('0xf'),_0xd3e2b9,_0x2773('0x10'),JSON['stringify'](_0x211ae5));if(_0x211ae5['error']){if(_0x211ae5[_0x2773('0x11')][_0x2773('0x12')]===0x1f4){logger['error'](_0x2773('0x13'),_0xd3e2b9,_0x211ae5[_0x2773('0x11')][_0x2773('0x14')]);return _0x5c8256(_0x211ae5[_0x2773('0x11')][_0x2773('0x14')]);}logger[_0x2773('0x11')](_0x2773('0x13'),_0xd3e2b9,_0x211ae5[_0x2773('0x11')][_0x2773('0x14')]);return _0x2bb392(_0x211ae5[_0x2773('0x11')][_0x2773('0x14')]);}else{logger[_0x2773('0xd')]('Cdr,\x20%s,\x20%s',_0xd3e2b9,'request\x20sent');_0x2bb392(_0x211ae5[_0x2773('0x15')][_0x2773('0x14')]);}})[_0x2773('0x16')](function(_0x1f5ce3){logger[_0x2773('0x11')](_0x2773('0x13'),_0xd3e2b9,_0x1f5ce3);_0x5c8256(_0x1f5ce3);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 87bd6a0..39399ec 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xa20971,_0x1bf32c){var _0x4f4271=function(_0x299c14){while(--_0x299c14){_0xa20971['push'](_0xa20971['shift']());}};_0x4f4271(++_0x1bf32c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+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(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 0bd85f2..f050dec 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 _0xa226=['STRING','sequelize','exports','INTEGER','noop'];(function(_0x670775,_0x3e8bbd){var _0x2fc8c8=function(_0x2f163e){while(--_0x2f163e){_0x670775['push'](_0x670775['shift']());}};_0x2fc8c8(++_0x3e8bbd);}(_0xa226,0x169));var _0x6a22=function(_0x5eb5fd,_0x1807d7){_0x5eb5fd=_0x5eb5fd-0x0;var _0x49db91=_0xa226[_0x5eb5fd];return _0x49db91;};'use strict';var Sequelize=require(_0x6a22('0x0'));module[_0x6a22('0x1')]={'priority':{'type':Sequelize[_0x6a22('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6a22('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6a22('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x1bf0=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1bf0,0x116));var _0x01bf=function(_0x248c1e,_0x3468f6){_0x248c1e=_0x248c1e-0x0;var _0x330688=_0x1bf0[_0x248c1e];return _0x330688;};'use strict';var Sequelize=require(_0x01bf('0x0'));module[_0x01bf('0x1')]={'priority':{'type':Sequelize[_0x01bf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x01bf('0x3')],'allowNull':![],'defaultValue':_0x01bf('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x01bf('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x01bf('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index a37b0d0..10f6be2 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 _0x1339=['rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','show','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','include','merge','find','body','catch','params','eml-format'];(function(_0x45bd84,_0x4a61bb){var _0x551b62=function(_0x3b03cf){while(--_0x3b03cf){_0x45bd84['push'](_0x45bd84['shift']());}};_0x551b62(++_0x4a61bb);}(_0x1339,0x1bf));var _0x9133=function(_0x21d046,_0xf4fba9){_0x21d046=_0x21d046-0x0;var _0x477fe1=_0x1339[_0x21d046];return _0x477fe1;};'use strict';var emlformat=require(_0x9133('0x0'));var rimraf=require(_0x9133('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9133('0x2'));var rp=require(_0x9133('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9133('0x4'));var util=require(_0x9133('0x5'));var path=require('path');var sox=require(_0x9133('0x6'));var csv=require(_0x9133('0x7'));var ejs=require(_0x9133('0x8'));var fs=require('fs');var fs_extra=require(_0x9133('0x9'));var _=require(_0x9133('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9133('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9133('0x7'));var querystring=require('querystring');var Papa=require(_0x9133('0xc'));var Redis=require('ioredis');var authService=require(_0x9133('0xd'));var qs=require(_0x9133('0xe'));var as=require(_0x9133('0xf'));var hardwareService=require(_0x9133('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9133('0x11'));var licenseUtil=require(_0x9133('0x12'));var db=require(_0x9133('0x13'))['db'];function respondWithStatusCode(_0x54bfc7,_0x3048a5){_0x3048a5=_0x3048a5||0xcc;return function(_0x177239){if(_0x177239){return _0x54bfc7[_0x9133('0x14')](_0x3048a5);}return _0x54bfc7[_0x9133('0x15')](_0x3048a5)[_0x9133('0x16')]();};}function respondWithResult(_0x35edae,_0x8e9362){_0x8e9362=_0x8e9362||0xc8;return function(_0xb05b1c){if(_0xb05b1c){return _0x35edae[_0x9133('0x15')](_0x8e9362)['json'](_0xb05b1c);}};}function respondWithFilteredResult(_0x18c203,_0x57f4d9){return function(_0x555651){if(_0x555651){var _0x8e3461=typeof _0x57f4d9[_0x9133('0x17')]===_0x9133('0x18')&&typeof _0x57f4d9[_0x9133('0x19')]===_0x9133('0x18');var _0x26b12a=_0x555651[_0x9133('0x1a')];var _0x4aa4be=_0x8e3461?0x0:_0x57f4d9['offset'];var _0x3d5506=_0x8e3461?_0x555651[_0x9133('0x1a')]:_0x57f4d9[_0x9133('0x17')]+_0x57f4d9['limit'];var _0x5f4d4d;if(_0x3d5506>=_0x26b12a){_0x3d5506=_0x26b12a;_0x5f4d4d=0xc8;}else{_0x5f4d4d=0xce;}_0x18c203[_0x9133('0x15')](_0x5f4d4d);return _0x18c203[_0x9133('0x1b')](_0x9133('0x1c'),_0x4aa4be+'-'+_0x3d5506+'/'+_0x26b12a)[_0x9133('0x1d')](_0x555651);}return null;};}function patchUpdates(_0x307671){return function(_0x21720){try{jsonpatch[_0x9133('0x1e')](_0x21720,_0x307671,!![]);}catch(_0x24cce0){return BPromise[_0x9133('0x1f')](_0x24cce0);}return _0x21720[_0x9133('0x20')]();};}function saveUpdates(_0x2f5e77,_0x2219d7){return function(_0xeb79c1){if(_0xeb79c1){return _0xeb79c1[_0x9133('0x21')](_0x2f5e77)['then'](function(_0xdb994d){return _0xdb994d;});}return null;};}function removeEntity(_0xdc20d9,_0x4bf1ed){return function(_0x4f6c6a){if(_0x4f6c6a){return _0x4f6c6a[_0x9133('0x22')]()[_0x9133('0x23')](function(){_0xdc20d9[_0x9133('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc4f92,_0x3a7c70){return function(_0x50d1da){if(!_0x50d1da){_0xbc4f92[_0x9133('0x14')](0x194);}return _0x50d1da;};}function handleError(_0x58907c,_0x552011){_0x552011=_0x552011||0x1f4;return function(_0x5a83e0){logger[_0x9133('0x24')](_0x5a83e0[_0x9133('0x25')]);if(_0x5a83e0['name']){delete _0x5a83e0[_0x9133('0x26')];}_0x58907c[_0x9133('0x15')](_0x552011)[_0x9133('0x27')](_0x5a83e0);};}exports[_0x9133('0x28')]=function(_0x52d0af,_0x276583){var _0x3f8b9b={'raw':!![],'where':{'id':_0x52d0af['params']['id']}},_0x3c8081={};_0x3c8081[_0x9133('0x29')]=_[_0x9133('0x2a')](db[_0x9133('0x2b')][_0x9133('0x2c')]);_0x3c8081[_0x9133('0x2d')]=_['keys'](_0x52d0af[_0x9133('0x2d')]);_0x3c8081['filters']=_[_0x9133('0x2e')](_0x3c8081[_0x9133('0x29')],_0x3c8081[_0x9133('0x2d')]);_0x3f8b9b[_0x9133('0x2f')]=_['intersection'](_0x3c8081[_0x9133('0x29')],qs[_0x9133('0x30')](_0x52d0af[_0x9133('0x2d')][_0x9133('0x30')]));_0x3f8b9b['attributes']=_0x3f8b9b[_0x9133('0x2f')][_0x9133('0x31')]?_0x3f8b9b[_0x9133('0x2f')]:_0x3c8081[_0x9133('0x29')];if(_0x52d0af[_0x9133('0x2d')]['includeAll']){_0x3f8b9b[_0x9133('0x32')]=[{'all':!![]}];}_0x3f8b9b=_[_0x9133('0x33')]({},_0x3f8b9b,_0x52d0af['options']);return db[_0x9133('0x2b')][_0x9133('0x34')](_0x3f8b9b)[_0x9133('0x23')](handleEntityNotFound(_0x276583,null))[_0x9133('0x23')](respondWithResult(_0x276583,null))['catch'](handleError(_0x276583,null));};exports[_0x9133('0x21')]=function(_0x55a860,_0x70d666){if(_0x55a860[_0x9133('0x35')]['id']){delete _0x55a860['body']['id'];}return db[_0x9133('0x2b')][_0x9133('0x34')]({'where':{'id':_0x55a860['params']['id']}})[_0x9133('0x23')](handleEntityNotFound(_0x70d666,null))[_0x9133('0x23')](saveUpdates(_0x55a860['body'],null))['then'](respondWithResult(_0x70d666,null))[_0x9133('0x36')](handleError(_0x70d666,null));};exports['destroy']=function(_0x31331b,_0x3f52ea){return db['ChatApplication'][_0x9133('0x34')]({'where':{'id':_0x31331b[_0x9133('0x37')]['id']}})['then'](handleEntityNotFound(_0x3f52ea,null))[_0x9133('0x23')](removeEntity(_0x3f52ea,null))[_0x9133('0x36')](handleError(_0x3f52ea,null));};
\ No newline at end of file
+var _0x7229=['zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','params','keys','ChatApplication','query','filters','intersection','model','fields','attributes','length','include','merge','options','find','catch','body','eml-format','rimraf'];(function(_0x1f07a8,_0x407446){var _0x23cabd=function(_0x357c38){while(--_0x357c38){_0x1f07a8['push'](_0x1f07a8['shift']());}};_0x23cabd(++_0x407446);}(_0x7229,0x76));var _0x9722=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7229[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x9722('0x0'));var rimraf=require(_0x9722('0x1'));var zipdir=require(_0x9722('0x2'));var jsonpatch=require(_0x9722('0x3'));var rp=require(_0x9722('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9722('0x5'));var util=require(_0x9722('0x6'));var path=require(_0x9722('0x7'));var sox=require(_0x9722('0x8'));var csv=require(_0x9722('0x9'));var ejs=require(_0x9722('0xa'));var fs=require('fs');var fs_extra=require(_0x9722('0xb'));var _=require('lodash');var squel=require(_0x9722('0xc'));var crypto=require('crypto');var jsforce=require(_0x9722('0xd'));var deskjs=require(_0x9722('0xe'));var toCsv=require(_0x9722('0x9'));var querystring=require(_0x9722('0xf'));var Papa=require(_0x9722('0x10'));var Redis=require(_0x9722('0x11'));var authService=require(_0x9722('0x12'));var qs=require(_0x9722('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9722('0x14'))(_0x9722('0x15'));var utils=require(_0x9722('0x16'));var config=require(_0x9722('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9722('0x18'))['db'];function respondWithStatusCode(_0x32fd25,_0x11942f){_0x11942f=_0x11942f||0xcc;return function(_0x124bfc){if(_0x124bfc){return _0x32fd25['sendStatus'](_0x11942f);}return _0x32fd25[_0x9722('0x19')](_0x11942f)[_0x9722('0x1a')]();};}function respondWithResult(_0x256348,_0x248bdf){_0x248bdf=_0x248bdf||0xc8;return function(_0x2f1c3b){if(_0x2f1c3b){return _0x256348['status'](_0x248bdf)[_0x9722('0x1b')](_0x2f1c3b);}};}function respondWithFilteredResult(_0x203db5,_0x2f2f96){return function(_0x482ad4){if(_0x482ad4){var _0xc802f7=typeof _0x2f2f96[_0x9722('0x1c')]==='undefined'&&typeof _0x2f2f96[_0x9722('0x1d')]===_0x9722('0x1e');var _0x38e179=_0x482ad4['count'];var _0x43b3fa=_0xc802f7?0x0:_0x2f2f96[_0x9722('0x1c')];var _0x38112a=_0xc802f7?_0x482ad4[_0x9722('0x1f')]:_0x2f2f96[_0x9722('0x1c')]+_0x2f2f96[_0x9722('0x1d')];var _0x2481f5;if(_0x38112a>=_0x38e179){_0x38112a=_0x38e179;_0x2481f5=0xc8;}else{_0x2481f5=0xce;}_0x203db5[_0x9722('0x19')](_0x2481f5);return _0x203db5[_0x9722('0x20')](_0x9722('0x21'),_0x43b3fa+'-'+_0x38112a+'/'+_0x38e179)[_0x9722('0x1b')](_0x482ad4);}return null;};}function patchUpdates(_0x23e9d0){return function(_0x451ce8){try{jsonpatch[_0x9722('0x22')](_0x451ce8,_0x23e9d0,!![]);}catch(_0x3b094d){return BPromise[_0x9722('0x23')](_0x3b094d);}return _0x451ce8['save']();};}function saveUpdates(_0x22a3e2,_0x3ab4d4){return function(_0x3abf4b){if(_0x3abf4b){return _0x3abf4b[_0x9722('0x24')](_0x22a3e2)[_0x9722('0x25')](function(_0x392d59){return _0x392d59;});}return null;};}function removeEntity(_0x4aeea7,_0x73c303){return function(_0x1aff40){if(_0x1aff40){return _0x1aff40[_0x9722('0x26')]()[_0x9722('0x25')](function(){_0x4aeea7[_0x9722('0x19')](0xcc)[_0x9722('0x1a')]();});}};}function handleEntityNotFound(_0x3b3ce9,_0x1f2ad8){return function(_0x4aab4e){if(!_0x4aab4e){_0x3b3ce9[_0x9722('0x27')](0x194);}return _0x4aab4e;};}function handleError(_0x5bf6f2,_0x141c7d){_0x141c7d=_0x141c7d||0x1f4;return function(_0x19a7b6){logger[_0x9722('0x28')](_0x19a7b6[_0x9722('0x29')]);if(_0x19a7b6[_0x9722('0x2a')]){delete _0x19a7b6[_0x9722('0x2a')];}_0x5bf6f2[_0x9722('0x19')](_0x141c7d)[_0x9722('0x2b')](_0x19a7b6);};}exports['show']=function(_0x19ffa8,_0x4805be){var _0x568ddc={'raw':!![],'where':{'id':_0x19ffa8[_0x9722('0x2c')]['id']}},_0x18fa43={};_0x18fa43['model']=_[_0x9722('0x2d')](db[_0x9722('0x2e')]['rawAttributes']);_0x18fa43['query']=_[_0x9722('0x2d')](_0x19ffa8[_0x9722('0x2f')]);_0x18fa43[_0x9722('0x30')]=_[_0x9722('0x31')](_0x18fa43[_0x9722('0x32')],_0x18fa43[_0x9722('0x2f')]);_0x568ddc['attributes']=_[_0x9722('0x31')](_0x18fa43[_0x9722('0x32')],qs[_0x9722('0x33')](_0x19ffa8[_0x9722('0x2f')]['fields']));_0x568ddc[_0x9722('0x34')]=_0x568ddc[_0x9722('0x34')][_0x9722('0x35')]?_0x568ddc['attributes']:_0x18fa43['model'];if(_0x19ffa8[_0x9722('0x2f')]['includeAll']){_0x568ddc[_0x9722('0x36')]=[{'all':!![]}];}_0x568ddc=_[_0x9722('0x37')]({},_0x568ddc,_0x19ffa8[_0x9722('0x38')]);return db[_0x9722('0x2e')][_0x9722('0x39')](_0x568ddc)[_0x9722('0x25')](handleEntityNotFound(_0x4805be,null))[_0x9722('0x25')](respondWithResult(_0x4805be,null))[_0x9722('0x3a')](handleError(_0x4805be,null));};exports[_0x9722('0x24')]=function(_0x463dd8,_0x427244){if(_0x463dd8[_0x9722('0x3b')]['id']){delete _0x463dd8['body']['id'];}return db['ChatApplication'][_0x9722('0x39')]({'where':{'id':_0x463dd8[_0x9722('0x2c')]['id']}})[_0x9722('0x25')](handleEntityNotFound(_0x427244,null))[_0x9722('0x25')](saveUpdates(_0x463dd8[_0x9722('0x3b')],null))[_0x9722('0x25')](respondWithResult(_0x427244,null))[_0x9722('0x3a')](handleError(_0x427244,null));};exports[_0x9722('0x26')]=function(_0x519368,_0x44b9f4){return db['ChatApplication']['find']({'where':{'id':_0x519368[_0x9722('0x2c')]['id']}})[_0x9722('0x25')](handleEntityNotFound(_0x44b9f4,null))[_0x9722('0x25')](removeEntity(_0x44b9f4,null))['catch'](handleError(_0x44b9f4,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 2b7479c..9fca96e 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 _0x3f91=['api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger'];(function(_0x1ae379,_0x5b581e){var _0x57ad43=function(_0x100a97){while(--_0x100a97){_0x1ae379['push'](_0x1ae379['shift']());}};_0x57ad43(++_0x5b581e);}(_0x3f91,0x99));var _0x13f9=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x3f91[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13f9('0x0'))(_0x13f9('0x1'));var moment=require(_0x13f9('0x2'));var BPromise=require('bluebird');var rp=require(_0x13f9('0x3'));var fs=require('fs');var path=require(_0x13f9('0x4'));var rimraf=require(_0x13f9('0x5'));var config=require(_0x13f9('0x6'));var attributes=require(_0x13f9('0x7'));module[_0x13f9('0x8')]=function(_0x5b6ad9,_0x537190){return _0x5b6ad9[_0x13f9('0x9')](_0x13f9('0xa'),attributes,{'tableName':_0x13f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x13f9('0xc'),'collate':_0x13f9('0xd')});};
\ No newline at end of file
+var _0xdb6e=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','lodash'];(function(_0x2ae255,_0x41e53a){var _0x43e3f8=function(_0x1943ff){while(--_0x1943ff){_0x2ae255['push'](_0x2ae255['shift']());}};_0x43e3f8(++_0x41e53a);}(_0xdb6e,0x179));var _0xedb6=function(_0x54f072,_0x39e1fd){_0x54f072=_0x54f072-0x0;var _0x42e317=_0xdb6e[_0x54f072];return _0x42e317;};'use strict';var _=require(_0xedb6('0x0'));var util=require(_0xedb6('0x1'));var logger=require(_0xedb6('0x2'))(_0xedb6('0x3'));var moment=require(_0xedb6('0x4'));var BPromise=require(_0xedb6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedb6('0x6'));var rimraf=require(_0xedb6('0x7'));var config=require(_0xedb6('0x8'));var attributes=require(_0xedb6('0x9'));module[_0xedb6('0xa')]=function(_0x30de0d,_0x35f987){return _0x30de0d['define'](_0xedb6('0xb'),attributes,{'tableName':_0xedb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedb6('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 8eb2060..39a8af2 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 _0x9cdf=['then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x2d32ab,_0x5da037){var _0x4ee4f4=function(_0x4f916c){while(--_0x4f916c){_0x2d32ab['push'](_0x2d32ab['shift']());}};_0x4ee4f4(++_0x5da037);}(_0x9cdf,0x9e));var _0xf9cd=function(_0xafab2c,_0x5e7eee){_0xafab2c=_0xafab2c-0x0;var _0x2c16f1=_0x9cdf[_0xafab2c];return _0x2c16f1;};'use strict';var _=require('lodash');var util=require(_0xf9cd('0x0'));var moment=require(_0xf9cd('0x1'));var BPromise=require(_0xf9cd('0x2'));var rs=require(_0xf9cd('0x3'));var fs=require('fs');var Redis=require(_0xf9cd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf9cd('0x5'));var logger=require('../../config/logger')(_0xf9cd('0x6'));var config=require('../../config/environment');var jayson=require(_0xf9cd('0x7'));var client=jayson['client'][_0xf9cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36c1d1,_0x2cafe2,_0x498122){return new BPromise(function(_0x1b51b1,_0x2d468e){return client[_0xf9cd('0x9')](_0x36c1d1,_0x498122)[_0xf9cd('0xa')](function(_0x3929af){logger['info'](_0xf9cd('0xb'),_0x2cafe2,_0xf9cd('0xc'));logger['debug'](_0xf9cd('0xd'),_0x2cafe2,_0xf9cd('0xc'),JSON[_0xf9cd('0xe')](_0x3929af));if(_0x3929af['error']){if(_0x3929af['error'][_0xf9cd('0xf')]===0x1f4){logger['error'](_0xf9cd('0xb'),_0x2cafe2,_0x3929af[_0xf9cd('0x10')]['message']);return _0x2d468e(_0x3929af[_0xf9cd('0x10')][_0xf9cd('0x11')]);}logger[_0xf9cd('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2cafe2,_0x3929af['error'][_0xf9cd('0x11')]);return _0x1b51b1(_0x3929af[_0xf9cd('0x10')]['message']);}else{logger[_0xf9cd('0x12')](_0xf9cd('0xb'),_0x2cafe2,_0xf9cd('0xc'));_0x1b51b1(_0x3929af[_0xf9cd('0x13')][_0xf9cd('0x11')]);}})[_0xf9cd('0x14')](function(_0x29a9e9){logger[_0xf9cd('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2cafe2,_0x29a9e9);_0x2d468e(_0x29a9e9);});});}
\ No newline at end of file
+var _0x4142=['stringify','error','code','message','ChatApplication,\x20%s,\x20%s','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4142,0x1f4));var _0x2414=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4142[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2414('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2414('0x1'));var db=require(_0x2414('0x2'))['db'];var utils=require(_0x2414('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x2414('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2414('0x5')][_0x2414('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x58895f,_0x321050,_0x50c5ad){return new BPromise(function(_0x43a54f,_0x36e886){return client[_0x2414('0x7')](_0x58895f,_0x50c5ad)[_0x2414('0x8')](function(_0x3d6b06){logger[_0x2414('0x9')]('ChatApplication,\x20%s,\x20%s',_0x321050,_0x2414('0xa'));logger[_0x2414('0xb')](_0x2414('0xc'),_0x321050,'request\x20sent',JSON[_0x2414('0xd')](_0x3d6b06));if(_0x3d6b06[_0x2414('0xe')]){if(_0x3d6b06[_0x2414('0xe')][_0x2414('0xf')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x321050,_0x3d6b06[_0x2414('0xe')][_0x2414('0x10')]);return _0x36e886(_0x3d6b06[_0x2414('0xe')]['message']);}logger[_0x2414('0xe')]('ChatApplication,\x20%s,\x20%s',_0x321050,_0x3d6b06[_0x2414('0xe')]['message']);return _0x43a54f(_0x3d6b06['error'][_0x2414('0x10')]);}else{logger[_0x2414('0x9')](_0x2414('0x11'),_0x321050,'request\x20sent');_0x43a54f(_0x3d6b06['result']['message']);}})[_0x2414('0x12')](function(_0x8cca88){logger['error'](_0x2414('0x11'),_0x321050,_0x8cca88);_0x36e886(_0x8cca88);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 4fb509f..dd3f83f 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 _0xc629=['get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller'];(function(_0x40bfd6,_0x22e7f9){var _0x17dcbe=function(_0x18e394){while(--_0x18e394){_0x40bfd6['push'](_0x40bfd6['shift']());}};_0x17dcbe(++_0x22e7f9);}(_0xc629,0x128));var _0x9c62=function(_0x154094,_0x7f9ace){_0x154094=_0x154094-0x0;var _0x4907b2=_0xc629[_0x154094];return _0x4907b2;};'use strict';var multer=require(_0x9c62('0x0'));var util=require(_0x9c62('0x1'));var path=require(_0x9c62('0x2'));var timeout=require(_0x9c62('0x3'));var express=require(_0x9c62('0x4'));var router=express[_0x9c62('0x5')]();var fs_extra=require(_0x9c62('0x6'));var auth=require(_0x9c62('0x7'));var interaction=require(_0x9c62('0x8'));var config=require('../../config/environment');var controller=require(_0x9c62('0x9'));router[_0x9c62('0xa')](_0x9c62('0xb'),auth[_0x9c62('0xc')](),controller['show']);router[_0x9c62('0xd')](_0x9c62('0xb'),auth[_0x9c62('0xc')](),controller[_0x9c62('0xe')]);router[_0x9c62('0xf')]('/:id',auth[_0x9c62('0xc')](),controller[_0x9c62('0x10')]);module[_0x9c62('0x11')]=router;
\ No newline at end of file
+var _0x33b5=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0x33b5,0x1e1));var _0x533b=function(_0x4d57a6,_0x4555ec){_0x4d57a6=_0x4d57a6-0x0;var _0x250376=_0x33b5[_0x4d57a6];return _0x250376;};'use strict';var multer=require(_0x533b('0x0'));var util=require(_0x533b('0x1'));var path=require(_0x533b('0x2'));var timeout=require(_0x533b('0x3'));var express=require(_0x533b('0x4'));var router=express[_0x533b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x533b('0x6'));var interaction=require(_0x533b('0x7'));var config=require('../../config/environment');var controller=require(_0x533b('0x8'));router[_0x533b('0x9')](_0x533b('0xa'),auth[_0x533b('0xb')](),controller['show']);router[_0x533b('0xc')](_0x533b('0xa'),auth['isAuthenticated'](),controller[_0x533b('0xd')]);router[_0x533b('0xe')](_0x533b('0xa'),auth[_0x533b('0xb')](),controller[_0x533b('0xf')]);module[_0x533b('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index e684c92..4101069 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 _0x1caa=['STRING','BOOLEAN','sequelize'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1caa,0xbf));var _0xa1ca=function(_0x3d56f5,_0x2d51a7){_0x3d56f5=_0x3d56f5-0x0;var _0x3ad5c5=_0x1caa[_0x3d56f5];return _0x3ad5c5;};'use strict';var Sequelize=require(_0xa1ca('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1ca('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xa1ca('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6fb2=['sequelize','exports','STRING'];(function(_0x1dabba,_0xde90f7){var _0x368044=function(_0x4404d3){while(--_0x4404d3){_0x1dabba['push'](_0x1dabba['shift']());}};_0x368044(++_0xde90f7);}(_0x6fb2,0x1ef));var _0x26fb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6fb2[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x26fb('0x0'));module[_0x26fb('0x1')]={'name':{'type':Sequelize[_0x26fb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x26fb('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 47781f9..72ea61e 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 _0x7d1d=['params','rawAttributes','filters','includeAll','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','options','removeMembers','getMessages','$gte','split','format','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','findAll','catch'];(function(_0x586c13,_0xf074ed){var _0x1c955f=function(_0x3255a6){while(--_0x3255a6){_0x586c13['push'](_0x586c13['shift']());}};_0x1c955f(++_0xf074ed);}(_0x7d1d,0xe1));var _0xd7d1=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7d1d[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0xd7d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7d1('0x1'));var jsonpatch=require(_0xd7d1('0x2'));var rp=require(_0xd7d1('0x3'));var moment=require('moment');var BPromise=require(_0xd7d1('0x4'));var Mustache=require(_0xd7d1('0x5'));var util=require(_0xd7d1('0x6'));var path=require(_0xd7d1('0x7'));var sox=require(_0xd7d1('0x8'));var csv=require(_0xd7d1('0x9'));var ejs=require(_0xd7d1('0xa'));var fs=require('fs');var fs_extra=require(_0xd7d1('0xb'));var _=require(_0xd7d1('0xc'));var squel=require('squel');var crypto=require(_0xd7d1('0xd'));var jsforce=require(_0xd7d1('0xe'));var deskjs=require(_0xd7d1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd7d1('0x10'));var Papa=require(_0xd7d1('0x11'));var Redis=require(_0xd7d1('0x12'));var authService=require(_0xd7d1('0x13'));var qs=require(_0xd7d1('0x14'));var as=require(_0xd7d1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7d1('0x16'))(_0xd7d1('0x17'));var utils=require(_0xd7d1('0x18'));var config=require(_0xd7d1('0x19'));var licenseUtil=require(_0xd7d1('0x1a'));var db=require('../../mysqldb')['db'];config[_0xd7d1('0x1b')]=_[_0xd7d1('0x1c')](config[_0xd7d1('0x1b')],{'host':_0xd7d1('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd7d1('0x1b')]));require(_0xd7d1('0x1e'))[_0xd7d1('0x1f')](socket);function respondWithStatusCode(_0x512a2d,_0x548f4f){_0x548f4f=_0x548f4f||0xcc;return function(_0x18addb){if(_0x18addb){return _0x512a2d[_0xd7d1('0x20')](_0x548f4f);}return _0x512a2d[_0xd7d1('0x21')](_0x548f4f)['end']();};}function respondWithResult(_0x3f345e,_0x569e86){_0x569e86=_0x569e86||0xc8;return function(_0x349439){if(_0x349439){return _0x3f345e['status'](_0x569e86)[_0xd7d1('0x22')](_0x349439);}};}function respondWithFilteredResult(_0x588eab,_0x55f0e4){return function(_0x42dc59){if(_0x42dc59){var _0x4055ff=typeof _0x55f0e4[_0xd7d1('0x23')]===_0xd7d1('0x24')&&typeof _0x55f0e4[_0xd7d1('0x25')]===_0xd7d1('0x24');var _0x3ae1d0=_0x42dc59[_0xd7d1('0x26')];var _0x2560ac=_0x4055ff?0x0:_0x55f0e4[_0xd7d1('0x23')];var _0x3858e0=_0x4055ff?_0x42dc59[_0xd7d1('0x26')]:_0x55f0e4[_0xd7d1('0x23')]+_0x55f0e4['limit'];var _0x5536af;if(_0x3858e0>=_0x3ae1d0){_0x3858e0=_0x3ae1d0;_0x5536af=0xc8;}else{_0x5536af=0xce;}_0x588eab[_0xd7d1('0x21')](_0x5536af);return _0x588eab[_0xd7d1('0x27')](_0xd7d1('0x28'),_0x2560ac+'-'+_0x3858e0+'/'+_0x3ae1d0)[_0xd7d1('0x22')](_0x42dc59);}return null;};}function patchUpdates(_0x447769){return function(_0x370e98){try{jsonpatch[_0xd7d1('0x29')](_0x370e98,_0x447769,!![]);}catch(_0x2ecbb1){return BPromise[_0xd7d1('0x2a')](_0x2ecbb1);}return _0x370e98[_0xd7d1('0x2b')]();};}function saveUpdates(_0x4e0553,_0xe89fb1){return function(_0x385139){if(_0x385139){return _0x385139[_0xd7d1('0x2c')](_0x4e0553)['then'](function(_0x4e1c1b){return _0x4e1c1b;});}return null;};}function removeEntity(_0x22b223,_0x57c1a0){return function(_0x599c5d){if(_0x599c5d){return _0x599c5d[_0xd7d1('0x2d')]()[_0xd7d1('0x2e')](function(){_0x22b223[_0xd7d1('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x525ab7,_0x284046){return function(_0x4bdfc8){if(!_0x4bdfc8){_0x525ab7['sendStatus'](0x194);}return _0x4bdfc8;};}function handleError(_0x2d411d,_0x37bda9){_0x37bda9=_0x37bda9||0x1f4;return function(_0x2c4502){logger[_0xd7d1('0x2f')](_0x2c4502[_0xd7d1('0x30')]);if(_0x2c4502[_0xd7d1('0x31')]){delete _0x2c4502['name'];}_0x2d411d['status'](_0x37bda9)[_0xd7d1('0x32')](_0x2c4502);};}exports[_0xd7d1('0x33')]=function(_0x3a33a8,_0x386aa5){var _0x9714b4={},_0x9dec38={},_0x1a17e={'count':0x0,'rows':[]};var _0x589588=_[_0xd7d1('0x34')](db[_0xd7d1('0x35')]['rawAttributes'],function(_0x1b7a2e){return{'name':_0x1b7a2e[_0xd7d1('0x36')],'type':_0x1b7a2e[_0xd7d1('0x37')][_0xd7d1('0x38')]};});_0x9dec38[_0xd7d1('0x39')]=_[_0xd7d1('0x34')](_0x589588,_0xd7d1('0x31'));_0x9dec38['query']=_[_0xd7d1('0x3a')](_0x3a33a8[_0xd7d1('0x3b')]);_0x9dec38['filters']=_[_0xd7d1('0x3c')](_0x9dec38[_0xd7d1('0x39')],_0x9dec38[_0xd7d1('0x3b')]);_0x9714b4[_0xd7d1('0x3d')]=_[_0xd7d1('0x3c')](_0x9dec38['model'],qs[_0xd7d1('0x3e')](_0x3a33a8[_0xd7d1('0x3b')][_0xd7d1('0x3e')]));_0x9714b4[_0xd7d1('0x3d')]=_0x9714b4['attributes'][_0xd7d1('0x3f')]?_0x9714b4[_0xd7d1('0x3d')]:_0x9dec38[_0xd7d1('0x39')];if(!_0x3a33a8[_0xd7d1('0x3b')][_0xd7d1('0x40')](_0xd7d1('0x41'))){_0x9714b4[_0xd7d1('0x25')]=qs[_0xd7d1('0x25')](_0x3a33a8[_0xd7d1('0x3b')][_0xd7d1('0x25')]);_0x9714b4[_0xd7d1('0x23')]=qs[_0xd7d1('0x23')](_0x3a33a8[_0xd7d1('0x3b')][_0xd7d1('0x23')]);}_0x9714b4[_0xd7d1('0x42')]=qs[_0xd7d1('0x43')](_0x3a33a8[_0xd7d1('0x3b')][_0xd7d1('0x43')]);_0x9714b4['where']=qs['filters'](_[_0xd7d1('0x44')](_0x3a33a8[_0xd7d1('0x3b')],_0x9dec38['filters']),_0x589588);if(_0x3a33a8['query'][_0xd7d1('0x45')]){_0x9714b4[_0xd7d1('0x46')]=_[_0xd7d1('0x47')](_0x9714b4[_0xd7d1('0x46')],{'$or':_[_0xd7d1('0x34')](_0x589588,function(_0x456f43){if(_0x456f43['type']!==_0xd7d1('0x48')){var _0x219d8a={};_0x219d8a[_0x456f43['name']]={'$like':'%'+_0x3a33a8[_0xd7d1('0x3b')][_0xd7d1('0x45')]+'%'};return _0x219d8a;}})});}_0x9714b4=_[_0xd7d1('0x47')]({},_0x9714b4,_0x3a33a8['options']);var _0x5717cb={'where':_0x9714b4[_0xd7d1('0x46')]};return db[_0xd7d1('0x35')][_0xd7d1('0x26')](_0x5717cb)[_0xd7d1('0x2e')](function(_0x33c3d0){_0x1a17e['count']=_0x33c3d0;if(_0x3a33a8[_0xd7d1('0x3b')]['includeAll']){_0x9714b4['include']=[{'all':!![]}];}return db[_0xd7d1('0x35')][_0xd7d1('0x49')](_0x9714b4);})[_0xd7d1('0x2e')](function(_0x403ed3){_0x1a17e['rows']=_0x403ed3;return _0x1a17e;})[_0xd7d1('0x2e')](respondWithFilteredResult(_0x386aa5,_0x9714b4))[_0xd7d1('0x4a')](handleError(_0x386aa5,null));};exports['show']=function(_0x5cd39d,_0x5e9573){var _0x447d69={'raw':!![],'where':{'id':_0x5cd39d[_0xd7d1('0x4b')]['id']}},_0x5b5aee={};_0x5b5aee[_0xd7d1('0x39')]=_[_0xd7d1('0x3a')](db[_0xd7d1('0x35')][_0xd7d1('0x4c')]);_0x5b5aee['query']=_[_0xd7d1('0x3a')](_0x5cd39d[_0xd7d1('0x3b')]);_0x5b5aee[_0xd7d1('0x4d')]=_['intersection'](_0x5b5aee[_0xd7d1('0x39')],_0x5b5aee['query']);_0x447d69['attributes']=_[_0xd7d1('0x3c')](_0x5b5aee['model'],qs['fields'](_0x5cd39d['query'][_0xd7d1('0x3e')]));_0x447d69['attributes']=_0x447d69['attributes'][_0xd7d1('0x3f')]?_0x447d69[_0xd7d1('0x3d')]:_0x5b5aee[_0xd7d1('0x39')];if(_0x5cd39d[_0xd7d1('0x3b')][_0xd7d1('0x4e')]){_0x447d69[_0xd7d1('0x4f')]=[{'all':!![]}];}_0x447d69=_[_0xd7d1('0x47')]({},_0x447d69,_0x5cd39d['options']);return db[_0xd7d1('0x35')][_0xd7d1('0x50')](_0x447d69)[_0xd7d1('0x2e')](handleEntityNotFound(_0x5e9573,null))[_0xd7d1('0x2e')](respondWithResult(_0x5e9573,null))[_0xd7d1('0x4a')](handleError(_0x5e9573,null));};exports[_0xd7d1('0x51')]=function(_0x5ca6c3,_0x2e8001){return db[_0xd7d1('0x35')]['create'](_0x5ca6c3[_0xd7d1('0x52')],{})[_0xd7d1('0x2e')](respondWithResult(_0x2e8001,0xc9))[_0xd7d1('0x4a')](handleError(_0x2e8001,null));};exports[_0xd7d1('0x2c')]=function(_0x2f1443,_0x25eedf){if(_0x2f1443['body']['id']){delete _0x2f1443[_0xd7d1('0x52')]['id'];}return db[_0xd7d1('0x35')][_0xd7d1('0x50')]({'where':{'id':_0x2f1443[_0xd7d1('0x4b')]['id']}})[_0xd7d1('0x2e')](handleEntityNotFound(_0x25eedf,null))[_0xd7d1('0x2e')](saveUpdates(_0x2f1443[_0xd7d1('0x52')],null))[_0xd7d1('0x2e')](respondWithResult(_0x25eedf,null))[_0xd7d1('0x4a')](handleError(_0x25eedf,null));};exports[_0xd7d1('0x2d')]=function(_0x321f45,_0x5d58fa){return db['ChatGroup'][_0xd7d1('0x50')]({'where':{'id':_0x321f45[_0xd7d1('0x4b')]['id']}})[_0xd7d1('0x2e')](handleEntityNotFound(_0x5d58fa,null))[_0xd7d1('0x2e')](removeEntity(_0x5d58fa,null))['catch'](handleError(_0x5d58fa,null));};exports[_0xd7d1('0x53')]=function(_0x54a7d7,_0x49b826){return db[_0xd7d1('0x35')][_0xd7d1('0x53')]()[_0xd7d1('0x2e')](respondWithResult(_0x49b826,null))['catch'](handleError(_0x49b826,null));};exports[_0xd7d1('0x54')]=function(_0x1c632e,_0x2e7641,_0x114666){return db[_0xd7d1('0x55')][_0xd7d1('0x26')]({'where':{'ChatGroupId':_0x1c632e['params']['id'],'ToId':_0x1c632e[_0xd7d1('0x56')]['id'],'read':![]}})[_0xd7d1('0x2e')](function(_0x5f16ef){return{'id':_[_0xd7d1('0x57')](_0x1c632e['params']['id']),'count':_0x5f16ef};})[_0xd7d1('0x2e')](respondWithResult(_0x2e7641,null))['catch'](handleError(_0x2e7641,null));};exports[_0xd7d1('0x58')]=function(_0x38cc46,_0x2670d6,_0x356fd2){return db['ChatGroup'][_0xd7d1('0x50')]({'where':{'id':_0x38cc46[_0xd7d1('0x4b')]['id']}})[_0xd7d1('0x2e')](handleEntityNotFound(_0x2670d6,null))[_0xd7d1('0x2e')](function(_0x516f07){if(_0x516f07){return _0x516f07[_0xd7d1('0x58')](_0x38cc46[_0xd7d1('0x52')][_0xd7d1('0x59')],_[_0xd7d1('0x5a')](_0x38cc46['body'],['ids','id'])||{});}})[_0xd7d1('0x2e')](respondWithResult(_0x2670d6,null))[_0xd7d1('0x4a')](handleError(_0x2670d6,null));};exports[_0xd7d1('0x5b')]=function(_0x1f488d,_0x4d571e,_0xbcd39a){var _0x50f265={};var _0x24b3b6={};var _0x85cc71;var _0x3a81ac;return db[_0xd7d1('0x35')][_0xd7d1('0x5c')]({'where':{'id':_0x1f488d[_0xd7d1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4d571e,null))[_0xd7d1('0x2e')](function(_0x15b1e5){if(_0x15b1e5){_0x85cc71=_0x15b1e5;_0x24b3b6[_0xd7d1('0x39')]=_['keys'](db[_0xd7d1('0x5d')][_0xd7d1('0x4c')]);_0x24b3b6['query']=_[_0xd7d1('0x3a')](_0x1f488d[_0xd7d1('0x3b')]);_0x24b3b6[_0xd7d1('0x4d')]=_[_0xd7d1('0x3c')](_0x24b3b6[_0xd7d1('0x39')],_0x24b3b6[_0xd7d1('0x3b')]);_0x50f265['attributes']=_[_0xd7d1('0x3c')](_0x24b3b6[_0xd7d1('0x39')],qs[_0xd7d1('0x3e')](_0x1f488d[_0xd7d1('0x3b')][_0xd7d1('0x3e')]));_0x50f265[_0xd7d1('0x3d')]=_0x50f265['attributes'][_0xd7d1('0x3f')]?_0x50f265[_0xd7d1('0x3d')]:_0x24b3b6['model'];_0x50f265[_0xd7d1('0x42')]=qs['sort'](_0x1f488d[_0xd7d1('0x3b')][_0xd7d1('0x43')]);_0x50f265[_0xd7d1('0x46')]=qs['filters'](_[_0xd7d1('0x44')](_0x1f488d[_0xd7d1('0x3b')],_0x24b3b6['filters']));if(_0x1f488d[_0xd7d1('0x3b')][_0xd7d1('0x45')]){_0x50f265['where']=_[_0xd7d1('0x47')](_0x50f265[_0xd7d1('0x46')],{'$or':_[_0xd7d1('0x34')](_0x50f265[_0xd7d1('0x3d')],function(_0xd03a67){var _0x511f44={};_0x511f44[_0xd03a67]={'$like':'%'+_0x1f488d[_0xd7d1('0x3b')][_0xd7d1('0x45')]+'%'};return _0x511f44;})});}_0x50f265=_[_0xd7d1('0x47')]({},_0x50f265,_0x1f488d[_0xd7d1('0x5e')]);return _0x85cc71['getMembers'](_0x50f265);}})[_0xd7d1('0x2e')](function(_0x341418){if(_0x341418){_0x3a81ac=_0x341418[_0xd7d1('0x3f')];if(!_0x1f488d[_0xd7d1('0x3b')][_0xd7d1('0x40')](_0xd7d1('0x41'))){_0x50f265['limit']=qs['limit'](_0x1f488d[_0xd7d1('0x3b')][_0xd7d1('0x25')]);_0x50f265[_0xd7d1('0x23')]=qs[_0xd7d1('0x23')](_0x1f488d[_0xd7d1('0x3b')][_0xd7d1('0x23')]);}return _0x85cc71[_0xd7d1('0x5b')](_0x50f265);}})[_0xd7d1('0x2e')](function(_0x1a5a7a){if(_0x1a5a7a){return _0x1a5a7a?{'count':_0x3a81ac,'rows':_0x1a5a7a}:null;}})[_0xd7d1('0x2e')](respondWithResult(_0x4d571e,null))[_0xd7d1('0x4a')](handleError(_0x4d571e,null));};exports[_0xd7d1('0x5f')]=function(_0x12162a,_0x5990e0,_0x5b592a){return db[_0xd7d1('0x35')][_0xd7d1('0x50')]({'where':{'id':_0x12162a[_0xd7d1('0x4b')]['id']}})[_0xd7d1('0x2e')](handleEntityNotFound(_0x5990e0,null))[_0xd7d1('0x2e')](function(_0x15d358){if(_0x15d358){return _0x15d358[_0xd7d1('0x5f')](_0x12162a[_0xd7d1('0x3b')][_0xd7d1('0x59')]);}})[_0xd7d1('0x2e')](respondWithStatusCode(_0x5990e0,null))[_0xd7d1('0x4a')](handleError(_0x5990e0,null));};exports['addMessage']=function(_0x1651f8,_0x4741c7,_0x45ae8d){if(_0x1651f8[_0xd7d1('0x52')]['id']){delete _0x1651f8['body']['id'];}return db[_0xd7d1('0x35')][_0xd7d1('0x50')]({'where':{'id':_0x1651f8[_0xd7d1('0x4b')]['id']}})[_0xd7d1('0x2e')](handleEntityNotFound(_0x4741c7,null))[_0xd7d1('0x2e')](function(_0x14dcc5){if(_0x14dcc5){_0x1651f8['body']['ChatGroupId']=_0x14dcc5['id'];return db[_0xd7d1('0x55')][_0xd7d1('0x51')](_0x1651f8[_0xd7d1('0x52')]);}})['then'](respondWithResult(_0x4741c7,null))['catch'](handleError(_0x4741c7,null));};exports[_0xd7d1('0x60')]=function(_0x4967aa,_0x217001,_0x5f55dd){var _0x49cb48={};var _0x135781={};var _0x205d94;var _0x2c1d11;return db['ChatGroup'][_0xd7d1('0x5c')]({'where':{'id':_0x4967aa['params']['id']}})[_0xd7d1('0x2e')](handleEntityNotFound(_0x217001,null))['then'](function(_0x4e991e){if(_0x4e991e){_0x205d94=_0x4e991e;_0x135781[_0xd7d1('0x39')]=_[_0xd7d1('0x3a')](db[_0xd7d1('0x55')][_0xd7d1('0x4c')]);_0x135781[_0xd7d1('0x3b')]=_[_0xd7d1('0x3a')](_0x4967aa[_0xd7d1('0x3b')]);_0x135781[_0xd7d1('0x4d')]=_[_0xd7d1('0x3c')](_0x135781[_0xd7d1('0x39')],_0x135781[_0xd7d1('0x3b')]);_0x49cb48[_0xd7d1('0x3d')]=_['intersection'](_0x135781[_0xd7d1('0x39')],qs['fields'](_0x4967aa[_0xd7d1('0x3b')][_0xd7d1('0x3e')]));_0x49cb48[_0xd7d1('0x3d')]=_0x49cb48[_0xd7d1('0x3d')][_0xd7d1('0x3f')]?_0x49cb48[_0xd7d1('0x3d')]:_0x135781['model'];_0x49cb48[_0xd7d1('0x42')]=qs[_0xd7d1('0x43')](_0x4967aa[_0xd7d1('0x3b')]['sort']);_0x49cb48[_0xd7d1('0x46')]=qs['filters'](_[_0xd7d1('0x44')](_0x4967aa[_0xd7d1('0x3b')],_0x135781[_0xd7d1('0x4d')]));if(_0x4967aa[_0xd7d1('0x3b')][_0xd7d1('0x45')]){_0x49cb48[_0xd7d1('0x46')]=_[_0xd7d1('0x47')](_0x49cb48['where'],{'$or':_[_0xd7d1('0x34')](_0x49cb48['attributes'],function(_0xfb1671){var _0x40afa6={};_0x40afa6[_0xfb1671]={'$like':'%'+_0x4967aa[_0xd7d1('0x3b')][_0xd7d1('0x45')]+'%'};return _0x40afa6;})});}if(_0x4967aa[_0xd7d1('0x3b')][_0xd7d1('0x61')]){var _0x40b050=_0x4967aa['query'][_0xd7d1('0x61')][_0xd7d1('0x62')](',');var _0x271f20={};_0x271f20[_0x40b050[0x0]]={'$gte':moment(_0x40b050[0x1])[_0xd7d1('0x63')]('YYYY-MM-DD\x20HH:mm:ss')};_0x49cb48['where']=_[_0xd7d1('0x47')](_0x49cb48[_0xd7d1('0x46')],_0x271f20);}_0x49cb48=_[_0xd7d1('0x47')]({},_0x49cb48,_0x4967aa['options']);return _0x205d94['getMessages'](_0x49cb48);}})[_0xd7d1('0x2e')](function(_0x515108){if(_0x515108){_0x2c1d11=_0x515108[_0xd7d1('0x3f')];if(!_0x4967aa['query'][_0xd7d1('0x40')](_0xd7d1('0x41'))){_0x49cb48[_0xd7d1('0x25')]=qs[_0xd7d1('0x25')](_0x4967aa[_0xd7d1('0x3b')][_0xd7d1('0x25')]);_0x49cb48[_0xd7d1('0x23')]=qs[_0xd7d1('0x23')](_0x4967aa[_0xd7d1('0x3b')][_0xd7d1('0x23')]);}return _0x205d94[_0xd7d1('0x60')](_0x49cb48);}})['then'](function(_0x3b1fb0){if(_0x3b1fb0){return _0x3b1fb0?{'count':_0x2c1d11,'rows':_0x3b1fb0}:null;}})[_0xd7d1('0x2e')](respondWithResult(_0x217001,null))[_0xd7d1('0x4a')](handleError(_0x217001,null));};
\ No newline at end of file
+var _0xee72=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','name','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','then','rows','catch','show','params','keys','includeAll','include','options','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','ChatGroupId','getMessages','length','$gte','split','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x51f1e7,_0x175572){var _0x2956bd=function(_0x3cd085){while(--_0x3cd085){_0x51f1e7['push'](_0x51f1e7['shift']());}};_0x2956bd(++_0x175572);}(_0xee72,0x1c6));var _0x2ee7=function(_0xe6f10a,_0x3ecd25){_0xe6f10a=_0xe6f10a-0x0;var _0x132c5f=_0xee72[_0xe6f10a];return _0x132c5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ee7('0x0'));var zipdir=require(_0x2ee7('0x1'));var jsonpatch=require(_0x2ee7('0x2'));var rp=require(_0x2ee7('0x3'));var moment=require('moment');var BPromise=require(_0x2ee7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2ee7('0x5'));var csv=require(_0x2ee7('0x6'));var ejs=require(_0x2ee7('0x7'));var fs=require('fs');var fs_extra=require(_0x2ee7('0x8'));var _=require(_0x2ee7('0x9'));var squel=require('squel');var crypto=require(_0x2ee7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2ee7('0xb'));var toCsv=require(_0x2ee7('0x6'));var querystring=require(_0x2ee7('0xc'));var Papa=require(_0x2ee7('0xd'));var Redis=require(_0x2ee7('0xe'));var authService=require(_0x2ee7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2ee7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ee7('0x11'))(_0x2ee7('0x12'));var utils=require(_0x2ee7('0x13'));var config=require(_0x2ee7('0x14'));var licenseUtil=require(_0x2ee7('0x15'));var db=require(_0x2ee7('0x16'))['db'];config[_0x2ee7('0x17')]=_[_0x2ee7('0x18')](config[_0x2ee7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ee7('0x19'))(new Redis(config[_0x2ee7('0x17')]));require(_0x2ee7('0x1a'))[_0x2ee7('0x1b')](socket);function respondWithStatusCode(_0x320a83,_0x22c4fb){_0x22c4fb=_0x22c4fb||0xcc;return function(_0x19f03f){if(_0x19f03f){return _0x320a83[_0x2ee7('0x1c')](_0x22c4fb);}return _0x320a83[_0x2ee7('0x1d')](_0x22c4fb)[_0x2ee7('0x1e')]();};}function respondWithResult(_0x44c043,_0x3b8b37){_0x3b8b37=_0x3b8b37||0xc8;return function(_0x4f817a){if(_0x4f817a){return _0x44c043['status'](_0x3b8b37)[_0x2ee7('0x1f')](_0x4f817a);}};}function respondWithFilteredResult(_0xc8eab9,_0x23b21d){return function(_0x21e53f){if(_0x21e53f){var _0x240bbb=typeof _0x23b21d['offset']===_0x2ee7('0x20')&&typeof _0x23b21d[_0x2ee7('0x21')]===_0x2ee7('0x20');var _0x1cb9ef=_0x21e53f[_0x2ee7('0x22')];var _0x35d5b7=_0x240bbb?0x0:_0x23b21d['offset'];var _0x4beae8=_0x240bbb?_0x21e53f['count']:_0x23b21d[_0x2ee7('0x23')]+_0x23b21d['limit'];var _0x12392c;if(_0x4beae8>=_0x1cb9ef){_0x4beae8=_0x1cb9ef;_0x12392c=0xc8;}else{_0x12392c=0xce;}_0xc8eab9[_0x2ee7('0x1d')](_0x12392c);return _0xc8eab9[_0x2ee7('0x24')](_0x2ee7('0x25'),_0x35d5b7+'-'+_0x4beae8+'/'+_0x1cb9ef)[_0x2ee7('0x1f')](_0x21e53f);}return null;};}function patchUpdates(_0x4957da){return function(_0x1ef7f6){try{jsonpatch[_0x2ee7('0x26')](_0x1ef7f6,_0x4957da,!![]);}catch(_0x207f05){return BPromise['reject'](_0x207f05);}return _0x1ef7f6[_0x2ee7('0x27')]();};}function saveUpdates(_0x122b90,_0x39d2da){return function(_0x4dc04e){if(_0x4dc04e){return _0x4dc04e['update'](_0x122b90)['then'](function(_0x23f713){return _0x23f713;});}return null;};}function removeEntity(_0x315264,_0x2398f7){return function(_0x8d1230){if(_0x8d1230){return _0x8d1230[_0x2ee7('0x28')]()['then'](function(){_0x315264[_0x2ee7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509eda,_0xa8147f){return function(_0x2809c9){if(!_0x2809c9){_0x509eda[_0x2ee7('0x1c')](0x194);}return _0x2809c9;};}function handleError(_0x4a45f1,_0x487475){_0x487475=_0x487475||0x1f4;return function(_0x5b99b4){logger['error'](_0x5b99b4['stack']);if(_0x5b99b4['name']){delete _0x5b99b4[_0x2ee7('0x29')];}_0x4a45f1['status'](_0x487475)['send'](_0x5b99b4);};}exports[_0x2ee7('0x2a')]=function(_0x2c1724,_0x2732de){var _0x52c2aa={},_0x26ed96={},_0x2afc84={'count':0x0,'rows':[]};var _0x5029d5=_['map'](db[_0x2ee7('0x2b')][_0x2ee7('0x2c')],function(_0x53bf6a){return{'name':_0x53bf6a[_0x2ee7('0x2d')],'type':_0x53bf6a[_0x2ee7('0x2e')][_0x2ee7('0x2f')]};});_0x26ed96[_0x2ee7('0x30')]=_[_0x2ee7('0x31')](_0x5029d5,_0x2ee7('0x29'));_0x26ed96[_0x2ee7('0x32')]=_['keys'](_0x2c1724[_0x2ee7('0x32')]);_0x26ed96[_0x2ee7('0x33')]=_[_0x2ee7('0x34')](_0x26ed96[_0x2ee7('0x30')],_0x26ed96[_0x2ee7('0x32')]);_0x52c2aa['attributes']=_[_0x2ee7('0x34')](_0x26ed96[_0x2ee7('0x30')],qs['fields'](_0x2c1724['query'][_0x2ee7('0x35')]));_0x52c2aa['attributes']=_0x52c2aa['attributes']['length']?_0x52c2aa[_0x2ee7('0x36')]:_0x26ed96[_0x2ee7('0x30')];if(!_0x2c1724['query'][_0x2ee7('0x37')](_0x2ee7('0x38'))){_0x52c2aa[_0x2ee7('0x21')]=qs['limit'](_0x2c1724[_0x2ee7('0x32')]['limit']);_0x52c2aa[_0x2ee7('0x23')]=qs[_0x2ee7('0x23')](_0x2c1724[_0x2ee7('0x32')][_0x2ee7('0x23')]);}_0x52c2aa[_0x2ee7('0x39')]=qs[_0x2ee7('0x3a')](_0x2c1724[_0x2ee7('0x32')]['sort']);_0x52c2aa[_0x2ee7('0x3b')]=qs['filters'](_[_0x2ee7('0x3c')](_0x2c1724[_0x2ee7('0x32')],_0x26ed96[_0x2ee7('0x33')]),_0x5029d5);if(_0x2c1724[_0x2ee7('0x32')][_0x2ee7('0x3d')]){_0x52c2aa['where']=_['merge'](_0x52c2aa[_0x2ee7('0x3b')],{'$or':_[_0x2ee7('0x31')](_0x5029d5,function(_0x563349){if(_0x563349[_0x2ee7('0x2e')]!==_0x2ee7('0x3e')){var _0x2b4bc={};_0x2b4bc[_0x563349[_0x2ee7('0x29')]]={'$like':'%'+_0x2c1724[_0x2ee7('0x32')][_0x2ee7('0x3d')]+'%'};return _0x2b4bc;}})});}_0x52c2aa=_[_0x2ee7('0x3f')]({},_0x52c2aa,_0x2c1724['options']);var _0x5c42a0={'where':_0x52c2aa['where']};return db[_0x2ee7('0x2b')][_0x2ee7('0x22')](_0x5c42a0)[_0x2ee7('0x40')](function(_0x403096){_0x2afc84[_0x2ee7('0x22')]=_0x403096;if(_0x2c1724[_0x2ee7('0x32')]['includeAll']){_0x52c2aa['include']=[{'all':!![]}];}return db[_0x2ee7('0x2b')]['findAll'](_0x52c2aa);})[_0x2ee7('0x40')](function(_0x4885f6){_0x2afc84[_0x2ee7('0x41')]=_0x4885f6;return _0x2afc84;})[_0x2ee7('0x40')](respondWithFilteredResult(_0x2732de,_0x52c2aa))[_0x2ee7('0x42')](handleError(_0x2732de,null));};exports[_0x2ee7('0x43')]=function(_0xe8b30f,_0x491022){var _0x212344={'raw':!![],'where':{'id':_0xe8b30f[_0x2ee7('0x44')]['id']}},_0x3bf096={};_0x3bf096[_0x2ee7('0x30')]=_['keys'](db['ChatGroup'][_0x2ee7('0x2c')]);_0x3bf096['query']=_[_0x2ee7('0x45')](_0xe8b30f['query']);_0x3bf096[_0x2ee7('0x33')]=_[_0x2ee7('0x34')](_0x3bf096[_0x2ee7('0x30')],_0x3bf096[_0x2ee7('0x32')]);_0x212344['attributes']=_['intersection'](_0x3bf096[_0x2ee7('0x30')],qs[_0x2ee7('0x35')](_0xe8b30f[_0x2ee7('0x32')][_0x2ee7('0x35')]));_0x212344[_0x2ee7('0x36')]=_0x212344['attributes']['length']?_0x212344['attributes']:_0x3bf096[_0x2ee7('0x30')];if(_0xe8b30f[_0x2ee7('0x32')][_0x2ee7('0x46')]){_0x212344[_0x2ee7('0x47')]=[{'all':!![]}];}_0x212344=_[_0x2ee7('0x3f')]({},_0x212344,_0xe8b30f[_0x2ee7('0x48')]);return db['ChatGroup']['find'](_0x212344)['then'](handleEntityNotFound(_0x491022,null))[_0x2ee7('0x40')](respondWithResult(_0x491022,null))[_0x2ee7('0x42')](handleError(_0x491022,null));};exports['create']=function(_0x51954a,_0x58d45b){return db['ChatGroup'][_0x2ee7('0x49')](_0x51954a['body'],{})['then'](respondWithResult(_0x58d45b,0xc9))[_0x2ee7('0x42')](handleError(_0x58d45b,null));};exports['update']=function(_0x20db02,_0x3b8812){if(_0x20db02[_0x2ee7('0x4a')]['id']){delete _0x20db02[_0x2ee7('0x4a')]['id'];}return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x20db02['params']['id']}})[_0x2ee7('0x40')](handleEntityNotFound(_0x3b8812,null))[_0x2ee7('0x40')](saveUpdates(_0x20db02[_0x2ee7('0x4a')],null))[_0x2ee7('0x40')](respondWithResult(_0x3b8812,null))[_0x2ee7('0x42')](handleError(_0x3b8812,null));};exports[_0x2ee7('0x28')]=function(_0x2aac2b,_0x5a21c4){return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x2aac2b[_0x2ee7('0x44')]['id']}})[_0x2ee7('0x40')](handleEntityNotFound(_0x5a21c4,null))[_0x2ee7('0x40')](removeEntity(_0x5a21c4,null))['catch'](handleError(_0x5a21c4,null));};exports['describe']=function(_0x30dc96,_0x18c911){return db[_0x2ee7('0x2b')][_0x2ee7('0x4c')]()[_0x2ee7('0x40')](respondWithResult(_0x18c911,null))[_0x2ee7('0x42')](handleError(_0x18c911,null));};exports[_0x2ee7('0x4d')]=function(_0x1724ec,_0x515e1e,_0x304652){return db[_0x2ee7('0x4e')][_0x2ee7('0x22')]({'where':{'ChatGroupId':_0x1724ec[_0x2ee7('0x44')]['id'],'ToId':_0x1724ec[_0x2ee7('0x4f')]['id'],'read':![]}})[_0x2ee7('0x40')](function(_0x48ef3d){return{'id':_[_0x2ee7('0x50')](_0x1724ec[_0x2ee7('0x44')]['id']),'count':_0x48ef3d};})[_0x2ee7('0x40')](respondWithResult(_0x515e1e,null))[_0x2ee7('0x42')](handleError(_0x515e1e,null));};exports[_0x2ee7('0x51')]=function(_0x4f439a,_0x1c6264,_0x58c387){return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x4f439a[_0x2ee7('0x44')]['id']}})[_0x2ee7('0x40')](handleEntityNotFound(_0x1c6264,null))['then'](function(_0x432638){if(_0x432638){return _0x432638[_0x2ee7('0x51')](_0x4f439a[_0x2ee7('0x4a')]['ids'],_[_0x2ee7('0x52')](_0x4f439a[_0x2ee7('0x4a')],[_0x2ee7('0x53'),'id'])||{});}})['then'](respondWithResult(_0x1c6264,null))['catch'](handleError(_0x1c6264,null));};exports[_0x2ee7('0x54')]=function(_0x16bc48,_0x990264,_0x1e974f){var _0x5c76a4={};var _0x47295a={};var _0x206126;var _0x361a0e;return db[_0x2ee7('0x2b')][_0x2ee7('0x55')]({'where':{'id':_0x16bc48[_0x2ee7('0x44')]['id']}})['then'](handleEntityNotFound(_0x990264,null))[_0x2ee7('0x40')](function(_0x29787f){if(_0x29787f){_0x206126=_0x29787f;_0x47295a[_0x2ee7('0x30')]=_[_0x2ee7('0x45')](db[_0x2ee7('0x56')][_0x2ee7('0x2c')]);_0x47295a[_0x2ee7('0x32')]=_[_0x2ee7('0x45')](_0x16bc48['query']);_0x47295a['filters']=_['intersection'](_0x47295a[_0x2ee7('0x30')],_0x47295a['query']);_0x5c76a4['attributes']=_[_0x2ee7('0x34')](_0x47295a[_0x2ee7('0x30')],qs[_0x2ee7('0x35')](_0x16bc48[_0x2ee7('0x32')][_0x2ee7('0x35')]));_0x5c76a4[_0x2ee7('0x36')]=_0x5c76a4[_0x2ee7('0x36')]['length']?_0x5c76a4['attributes']:_0x47295a[_0x2ee7('0x30')];_0x5c76a4[_0x2ee7('0x39')]=qs[_0x2ee7('0x3a')](_0x16bc48[_0x2ee7('0x32')][_0x2ee7('0x3a')]);_0x5c76a4[_0x2ee7('0x3b')]=qs['filters'](_[_0x2ee7('0x3c')](_0x16bc48['query'],_0x47295a[_0x2ee7('0x33')]));if(_0x16bc48['query'][_0x2ee7('0x3d')]){_0x5c76a4[_0x2ee7('0x3b')]=_[_0x2ee7('0x3f')](_0x5c76a4[_0x2ee7('0x3b')],{'$or':_['map'](_0x5c76a4[_0x2ee7('0x36')],function(_0x30d239){var _0x58f4ac={};_0x58f4ac[_0x30d239]={'$like':'%'+_0x16bc48[_0x2ee7('0x32')]['filter']+'%'};return _0x58f4ac;})});}_0x5c76a4=_[_0x2ee7('0x3f')]({},_0x5c76a4,_0x16bc48[_0x2ee7('0x48')]);return _0x206126[_0x2ee7('0x54')](_0x5c76a4);}})[_0x2ee7('0x40')](function(_0xb12692){if(_0xb12692){_0x361a0e=_0xb12692['length'];if(!_0x16bc48['query']['hasOwnProperty'](_0x2ee7('0x38'))){_0x5c76a4['limit']=qs[_0x2ee7('0x21')](_0x16bc48[_0x2ee7('0x32')][_0x2ee7('0x21')]);_0x5c76a4[_0x2ee7('0x23')]=qs[_0x2ee7('0x23')](_0x16bc48[_0x2ee7('0x32')][_0x2ee7('0x23')]);}return _0x206126['getMembers'](_0x5c76a4);}})['then'](function(_0x3231b5){if(_0x3231b5){return _0x3231b5?{'count':_0x361a0e,'rows':_0x3231b5}:null;}})[_0x2ee7('0x40')](respondWithResult(_0x990264,null))['catch'](handleError(_0x990264,null));};exports[_0x2ee7('0x57')]=function(_0x39d5fb,_0x4b7e08,_0x1feb6f){return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x39d5fb[_0x2ee7('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b7e08,null))['then'](function(_0x5cd504){if(_0x5cd504){return _0x5cd504['removeMembers'](_0x39d5fb[_0x2ee7('0x32')][_0x2ee7('0x53')]);}})[_0x2ee7('0x40')](respondWithStatusCode(_0x4b7e08,null))[_0x2ee7('0x42')](handleError(_0x4b7e08,null));};exports['addMessage']=function(_0x361705,_0x190b85,_0x40d065){if(_0x361705['body']['id']){delete _0x361705[_0x2ee7('0x4a')]['id'];}return db[_0x2ee7('0x2b')][_0x2ee7('0x4b')]({'where':{'id':_0x361705[_0x2ee7('0x44')]['id']}})[_0x2ee7('0x40')](handleEntityNotFound(_0x190b85,null))['then'](function(_0x3eb5c1){if(_0x3eb5c1){_0x361705[_0x2ee7('0x4a')][_0x2ee7('0x58')]=_0x3eb5c1['id'];return db[_0x2ee7('0x4e')][_0x2ee7('0x49')](_0x361705[_0x2ee7('0x4a')]);}})[_0x2ee7('0x40')](respondWithResult(_0x190b85,null))[_0x2ee7('0x42')](handleError(_0x190b85,null));};exports[_0x2ee7('0x59')]=function(_0x13e50b,_0x292a4c,_0x1817d5){var _0x257fc0={};var _0x5876fb={};var _0x1e0936;var _0x309631;return db['ChatGroup'][_0x2ee7('0x55')]({'where':{'id':_0x13e50b[_0x2ee7('0x44')]['id']}})['then'](handleEntityNotFound(_0x292a4c,null))[_0x2ee7('0x40')](function(_0x4e8c89){if(_0x4e8c89){_0x1e0936=_0x4e8c89;_0x5876fb['model']=_[_0x2ee7('0x45')](db[_0x2ee7('0x4e')][_0x2ee7('0x2c')]);_0x5876fb[_0x2ee7('0x32')]=_[_0x2ee7('0x45')](_0x13e50b['query']);_0x5876fb['filters']=_['intersection'](_0x5876fb['model'],_0x5876fb['query']);_0x257fc0[_0x2ee7('0x36')]=_[_0x2ee7('0x34')](_0x5876fb[_0x2ee7('0x30')],qs[_0x2ee7('0x35')](_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x35')]));_0x257fc0[_0x2ee7('0x36')]=_0x257fc0[_0x2ee7('0x36')][_0x2ee7('0x5a')]?_0x257fc0['attributes']:_0x5876fb[_0x2ee7('0x30')];_0x257fc0[_0x2ee7('0x39')]=qs[_0x2ee7('0x3a')](_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x3a')]);_0x257fc0[_0x2ee7('0x3b')]=qs['filters'](_['pick'](_0x13e50b['query'],_0x5876fb['filters']));if(_0x13e50b['query'][_0x2ee7('0x3d')]){_0x257fc0[_0x2ee7('0x3b')]=_[_0x2ee7('0x3f')](_0x257fc0[_0x2ee7('0x3b')],{'$or':_['map'](_0x257fc0[_0x2ee7('0x36')],function(_0x214108){var _0x3c2a5b={};_0x3c2a5b[_0x214108]={'$like':'%'+_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x3d')]+'%'};return _0x3c2a5b;})});}if(_0x13e50b['query'][_0x2ee7('0x5b')]){var _0x2bd11e=_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x5b')][_0x2ee7('0x5c')](',');var _0x38e560={};_0x38e560[_0x2bd11e[0x0]]={'$gte':moment(_0x2bd11e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x257fc0[_0x2ee7('0x3b')]=_[_0x2ee7('0x3f')](_0x257fc0[_0x2ee7('0x3b')],_0x38e560);}_0x257fc0=_[_0x2ee7('0x3f')]({},_0x257fc0,_0x13e50b['options']);return _0x1e0936[_0x2ee7('0x59')](_0x257fc0);}})[_0x2ee7('0x40')](function(_0x54f7a3){if(_0x54f7a3){_0x309631=_0x54f7a3[_0x2ee7('0x5a')];if(!_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x37')]('nolimit')){_0x257fc0['limit']=qs[_0x2ee7('0x21')](_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x21')]);_0x257fc0[_0x2ee7('0x23')]=qs[_0x2ee7('0x23')](_0x13e50b[_0x2ee7('0x32')][_0x2ee7('0x23')]);}return _0x1e0936['getMessages'](_0x257fc0);}})[_0x2ee7('0x40')](function(_0x5b8f70){if(_0x5b8f70){return _0x5b8f70?{'count':_0x309631,'rows':_0x5b8f70}:null;}})[_0x2ee7('0x40')](respondWithResult(_0x292a4c,null))[_0x2ee7('0x42')](handleError(_0x292a4c,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 6741bbb..a5c1178 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 _0xeab3=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xeab3,0x143));var _0x3eab=function(_0x1644e5,_0x31ac5f){_0x1644e5=_0x1644e5-0x0;var _0x5bc914=_0xeab3[_0x1644e5];return _0x5bc914;};'use strict';var EventEmitter=require(_0x3eab('0x0'));var ChatGroup=require(_0x3eab('0x1'))['db'][_0x3eab('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3eab('0x3')](0x0);var events={'afterCreate':_0x3eab('0x4'),'afterUpdate':_0x3eab('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d3c53){return function(_0x417520,_0x44addd,_0x13ba56){ChatGroupEvents['emit'](_0x4d3c53+':'+_0x417520['id'],_0x417520);ChatGroupEvents['emit'](_0x4d3c53,_0x417520);_0x13ba56(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x3eab('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x83d4=['hasOwnProperty','hook','exports','events','setMaxListeners','update','emit'];(function(_0x20115d,_0x1a193f){var _0x49958b=function(_0x14b604){while(--_0x14b604){_0x20115d['push'](_0x20115d['shift']());}};_0x49958b(++_0x1a193f);}(_0x83d4,0xf1));var _0x483d=function(_0x4f92eb,_0x1237a4){_0x4f92eb=_0x4f92eb-0x0;var _0x2e7f4f=_0x83d4[_0x4f92eb];return _0x2e7f4f;};'use strict';var EventEmitter=require(_0x483d('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x483d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x483d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x838b4c){return function(_0x447f73,_0x224829,_0x1e1c37){ChatGroupEvents[_0x483d('0x3')](_0x838b4c+':'+_0x447f73['id'],_0x447f73);ChatGroupEvents['emit'](_0x838b4c,_0x447f73);_0x1e1c37(null);};}for(var e in events){if(events[_0x483d('0x4')](e)){var event=events[e];ChatGroup[_0x483d('0x5')](e,emitEvent(event));}}module[_0x483d('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 7d299ed..c19b10c 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 _0xe057=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup'];(function(_0x4074ff,_0x16e982){var _0x525d72=function(_0x41d69f){while(--_0x41d69f){_0x4074ff['push'](_0x4074ff['shift']());}};_0x525d72(++_0x16e982);}(_0xe057,0xf2));var _0x7e05=function(_0x900331,_0x17212b){_0x900331=_0x900331-0x0;var _0x557c3b=_0xe057[_0x900331];return _0x557c3b;};'use strict';var _=require(_0x7e05('0x0'));var util=require('util');var logger=require(_0x7e05('0x1'))(_0x7e05('0x2'));var moment=require(_0x7e05('0x3'));var BPromise=require(_0x7e05('0x4'));var rp=require(_0x7e05('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e05('0x6'));var config=require(_0x7e05('0x7'));var attributes=require(_0x7e05('0x8'));module[_0x7e05('0x9')]=function(_0x4c138a,_0x5e167d){return _0x4c138a['define'](_0x7e05('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7918=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define','ChatGroup'];(function(_0x5bee28,_0x1dc7e2){var _0x395d1d=function(_0x33af90){while(--_0x33af90){_0x5bee28['push'](_0x5bee28['shift']());}};_0x395d1d(++_0x1dc7e2);}(_0x7918,0x11e));var _0x8791=function(_0x10bc04,_0x669fa5){_0x10bc04=_0x10bc04-0x0;var _0x1fd6de=_0x7918[_0x10bc04];return _0x1fd6de;};'use strict';var _=require(_0x8791('0x0'));var util=require(_0x8791('0x1'));var logger=require('../../config/logger')(_0x8791('0x2'));var moment=require(_0x8791('0x3'));var BPromise=require(_0x8791('0x4'));var rp=require(_0x8791('0x5'));var fs=require('fs');var path=require(_0x8791('0x6'));var rimraf=require(_0x8791('0x7'));var config=require('../../config/environment');var attributes=require(_0x8791('0x8'));module['exports']=function(_0x354f76,_0x81d64){return _0x354f76[_0x8791('0x9')](_0x8791('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 53cf9c3..3c206ef 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 _0x8ebc=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','bluebird','ioredis'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x8ebc,0x18c));var _0xc8eb=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0x8ebc[_0xf04c6d];return _0x4a804e;};'use strict';var _=require(_0xc8eb('0x0'));var util=require('util');var moment=require(_0xc8eb('0x1'));var BPromise=require(_0xc8eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8eb('0x3'));var db=require(_0xc8eb('0x4'))['db'];var utils=require(_0xc8eb('0x5'));var logger=require(_0xc8eb('0x6'))('rpc');var config=require(_0xc8eb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc8eb('0x8')][_0xc8eb('0x9')]({'port':0x232a});config['redis']=_[_0xc8eb('0xa')](config[_0xc8eb('0xb')],{'host':_0xc8eb('0xc'),'port':0x18eb});var socket=require(_0xc8eb('0xd'))(new Redis(config[_0xc8eb('0xb')]));require('./chatGroup.socket')[_0xc8eb('0xe')](socket);function respondWithRpcPromise(_0xcceb64,_0x29564c,_0x108ad1){return new BPromise(function(_0xd91865,_0x54348e){return client[_0xc8eb('0xf')](_0xcceb64,_0x108ad1)['then'](function(_0x32aec8){logger['info'](_0xc8eb('0x10'),_0x29564c,_0xc8eb('0x11'));logger[_0xc8eb('0x12')](_0xc8eb('0x13'),_0x29564c,_0xc8eb('0x11'),JSON[_0xc8eb('0x14')](_0x32aec8));if(_0x32aec8[_0xc8eb('0x15')]){if(_0x32aec8[_0xc8eb('0x15')]['code']===0x1f4){logger['error'](_0xc8eb('0x10'),_0x29564c,_0x32aec8[_0xc8eb('0x15')][_0xc8eb('0x16')]);return _0x54348e(_0x32aec8[_0xc8eb('0x15')][_0xc8eb('0x16')]);}logger['error'](_0xc8eb('0x10'),_0x29564c,_0x32aec8[_0xc8eb('0x15')][_0xc8eb('0x16')]);return _0xd91865(_0x32aec8['error']['message']);}else{logger[_0xc8eb('0x17')](_0xc8eb('0x10'),_0x29564c,_0xc8eb('0x11'));_0xd91865(_0x32aec8[_0xc8eb('0x18')]['message']);}})['catch'](function(_0x4c001a){logger['error'](_0xc8eb('0x10'),_0x29564c,_0x4c001a);_0x54348e(_0x4c001a);});});}
\ No newline at end of file
+var _0x1134=['./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x3bba57,_0x440aad){var _0x1f13b7=function(_0x8ec7f6){while(--_0x8ec7f6){_0x3bba57['push'](_0x3bba57['shift']());}};_0x1f13b7(++_0x440aad);}(_0x1134,0x19c));var _0x4113=function(_0x342386,_0x369070){_0x342386=_0x342386-0x0;var _0x29616c=_0x1134[_0x342386];return _0x29616c;};'use strict';var _=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var moment=require('moment');var BPromise=require(_0x4113('0x2'));var rs=require(_0x4113('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4113('0x4'))['db'];var utils=require(_0x4113('0x5'));var logger=require('../../config/logger')(_0x4113('0x6'));var config=require('../../config/environment');var jayson=require(_0x4113('0x7'));var client=jayson['client'][_0x4113('0x8')]({'port':0x232a});config['redis']=_[_0x4113('0x9')](config[_0x4113('0xa')],{'host':_0x4113('0xb'),'port':0x18eb});var socket=require(_0x4113('0xc'))(new Redis(config[_0x4113('0xa')]));require(_0x4113('0xd'))[_0x4113('0xe')](socket);function respondWithRpcPromise(_0x19b6f2,_0x5e635c,_0x85a9dd){return new BPromise(function(_0x207442,_0x29c7f9){return client[_0x4113('0xf')](_0x19b6f2,_0x85a9dd)[_0x4113('0x10')](function(_0x30f02a){logger[_0x4113('0x11')](_0x4113('0x12'),_0x5e635c,_0x4113('0x13'));logger[_0x4113('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5e635c,'request\x20sent',JSON['stringify'](_0x30f02a));if(_0x30f02a[_0x4113('0x15')]){if(_0x30f02a[_0x4113('0x15')]['code']===0x1f4){logger['error'](_0x4113('0x12'),_0x5e635c,_0x30f02a['error'][_0x4113('0x16')]);return _0x29c7f9(_0x30f02a['error']['message']);}logger[_0x4113('0x15')](_0x4113('0x12'),_0x5e635c,_0x30f02a[_0x4113('0x15')][_0x4113('0x16')]);return _0x207442(_0x30f02a[_0x4113('0x15')][_0x4113('0x16')]);}else{logger[_0x4113('0x11')](_0x4113('0x12'),_0x5e635c,_0x4113('0x13'));_0x207442(_0x30f02a[_0x4113('0x17')]['message']);}})[_0x4113('0x18')](function(_0x287efd){logger[_0x4113('0x15')](_0x4113('0x12'),_0x5e635c,_0x287efd);_0x29c7f9(_0x287efd);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 6f51f91..487832d 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 _0x0433=['length','chatGroup:','remove','update','removeListener','register'];(function(_0x502036,_0x502686){var _0x485247=function(_0x135ee3){while(--_0x135ee3){_0x502036['push'](_0x502036['shift']());}};_0x485247(++_0x502686);}(_0x0433,0x15e));var _0x3043=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x0433[_0x51020b];return _0x371e47;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x3043('0x0'),_0x3043('0x1')];function createListener(_0x3bd562,_0x3b5072){return function(_0x4d2175){_0x3b5072['emit'](_0x3bd562,_0x4d2175);};}function removeListener(_0x558c89,_0x8f816c){return function(){ChatGroupEvents[_0x3043('0x2')](_0x558c89,_0x8f816c);};}exports[_0x3043('0x3')]=function(_0x24818b){for(var _0x21baff=0x0,_0x2acbbd=events[_0x3043('0x4')];_0x21baff<_0x2acbbd;_0x21baff++){var _0x216d11=events[_0x21baff];var _0x57a698=createListener(_0x3043('0x5')+_0x216d11,_0x24818b);ChatGroupEvents['on'](_0x216d11,_0x57a698);}};
\ No newline at end of file
+var _0x7581=['./chatGroup.events','remove','update','emit','removeListener','length','chatGroup:'];(function(_0x34368f,_0x27ca25){var _0x3ffc70=function(_0x5c27c5){while(--_0x5c27c5){_0x34368f['push'](_0x34368f['shift']());}};_0x3ffc70(++_0x27ca25);}(_0x7581,0x1ce));var _0x1758=function(_0x24a819,_0x33eb25){_0x24a819=_0x24a819-0x0;var _0xbd47fd=_0x7581[_0x24a819];return _0xbd47fd;};'use strict';var ChatGroupEvents=require(_0x1758('0x0'));var events=['save',_0x1758('0x1'),_0x1758('0x2')];function createListener(_0x556d20,_0x2fe42f){return function(_0x5433b9){_0x2fe42f[_0x1758('0x3')](_0x556d20,_0x5433b9);};}function removeListener(_0x3d7937,_0xb78f3f){return function(){ChatGroupEvents[_0x1758('0x4')](_0x3d7937,_0xb78f3f);};}exports['register']=function(_0x3f329d){for(var _0x4fb467=0x0,_0x1f9dd3=events[_0x1758('0x5')];_0x4fb467<_0x1f9dd3;_0x4fb467++){var _0x311198=events[_0x4fb467];var _0x672a73=createListener(_0x1758('0x6')+_0x311198,_0x3f329d);ChatGroupEvents['on'](_0x311198,_0x672a73);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 5a2f3dd..40e4a0d 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 _0x96c8=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','destroy','exports','multer'];(function(_0x2cc817,_0x35a8cb){var _0x5f2e1b=function(_0x1d6182){while(--_0x1d6182){_0x2cc817['push'](_0x2cc817['shift']());}};_0x5f2e1b(++_0x35a8cb);}(_0x96c8,0xa7));var _0x896c=function(_0x27cbbb,_0x3d3b3a){_0x27cbbb=_0x27cbbb-0x0;var _0xc29985=_0x96c8[_0x27cbbb];return _0xc29985;};'use strict';var multer=require(_0x896c('0x0'));var util=require('util');var path=require(_0x896c('0x1'));var timeout=require(_0x896c('0x2'));var express=require('express');var router=express[_0x896c('0x3')]();var fs_extra=require(_0x896c('0x4'));var auth=require(_0x896c('0x5'));var interaction=require(_0x896c('0x6'));var config=require('../../config/environment');var controller=require(_0x896c('0x7'));router['get']('/',auth[_0x896c('0x8')](),controller[_0x896c('0x9')]);router[_0x896c('0xa')]('/describe',auth[_0x896c('0x8')](),controller[_0x896c('0xb')]);router['get'](_0x896c('0xc'),auth['isAuthenticated'](),controller[_0x896c('0xd')]);router[_0x896c('0xa')](_0x896c('0xe'),auth[_0x896c('0x8')](),controller[_0x896c('0xf')]);router[_0x896c('0xa')](_0x896c('0x10'),auth[_0x896c('0x8')](),controller[_0x896c('0x11')]);router[_0x896c('0xa')](_0x896c('0x12'),auth[_0x896c('0x8')](),controller[_0x896c('0x13')]);router[_0x896c('0x14')]('/',auth['isAuthenticated'](),controller[_0x896c('0x15')]);router[_0x896c('0x14')](_0x896c('0x10'),auth[_0x896c('0x8')](),controller[_0x896c('0x16')]);router[_0x896c('0x14')](_0x896c('0x12'),auth[_0x896c('0x8')](),controller[_0x896c('0x17')]);router[_0x896c('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x896c('0x19')](_0x896c('0xc'),auth[_0x896c('0x8')](),controller[_0x896c('0x1a')]);router['delete'](_0x896c('0x10'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x896c('0x1b')]=router;
\ No newline at end of file
+var _0xe729=['isAuthenticated','/:id','show','/:id/unread','/:id/members','/:id/messages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe729,0x160));var _0x9e72=function(_0xb65eb5,_0x5601db){_0xb65eb5=_0xb65eb5-0x0;var _0x41359b=_0xe729[_0xb65eb5];return _0x41359b;};'use strict';var multer=require(_0x9e72('0x0'));var util=require(_0x9e72('0x1'));var path=require(_0x9e72('0x2'));var timeout=require(_0x9e72('0x3'));var express=require(_0x9e72('0x4'));var router=express['Router']();var fs_extra=require(_0x9e72('0x5'));var auth=require(_0x9e72('0x6'));var interaction=require(_0x9e72('0x7'));var config=require(_0x9e72('0x8'));var controller=require(_0x9e72('0x9'));router[_0x9e72('0xa')]('/',auth['isAuthenticated'](),controller[_0x9e72('0xb')]);router[_0x9e72('0xa')]('/describe',auth[_0x9e72('0xc')](),controller['describe']);router[_0x9e72('0xa')](_0x9e72('0xd'),auth[_0x9e72('0xc')](),controller[_0x9e72('0xe')]);router[_0x9e72('0xa')](_0x9e72('0xf'),auth[_0x9e72('0xc')](),controller['getUnread']);router[_0x9e72('0xa')](_0x9e72('0x10'),auth[_0x9e72('0xc')](),controller['getMembers']);router[_0x9e72('0xa')](_0x9e72('0x11'),auth[_0x9e72('0xc')](),controller['getMessages']);router[_0x9e72('0x12')]('/',auth[_0x9e72('0xc')](),controller[_0x9e72('0x13')]);router[_0x9e72('0x12')]('/:id/members',auth[_0x9e72('0xc')](),controller[_0x9e72('0x14')]);router['post'](_0x9e72('0x11'),auth[_0x9e72('0xc')](),controller[_0x9e72('0x15')]);router[_0x9e72('0x16')]('/:id',auth[_0x9e72('0xc')](),controller['update']);router[_0x9e72('0x17')](_0x9e72('0xd'),auth[_0x9e72('0xc')](),controller['destroy']);router['delete'](_0x9e72('0x10'),auth[_0x9e72('0xc')](),controller[_0x9e72('0x18')]);module[_0x9e72('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 242c6dd..43da563 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 _0xd02a=['out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x451659,_0xbe141d){var _0x5565ef=function(_0xcd388c){while(--_0xcd388c){_0x451659['push'](_0x451659['shift']());}};_0x5565ef(++_0xbe141d);}(_0xd02a,0x123));var _0xad02=function(_0xd4a5,_0x12a607){_0xd4a5=_0xd4a5-0x0;var _0x4c99f6=_0xd02a[_0xd4a5];return _0x4c99f6;};'use strict';var Sequelize=require(_0xad02('0x0'));module[_0xad02('0x1')]={'closed':{'type':Sequelize[_0xad02('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xad02('0x3')](_0xad02('0x4'),_0xad02('0x5')),'defaultValue':_0xad02('0x4')},'ratingMessage':{'type':Sequelize[_0xad02('0x6')]},'pathTranscript':{'type':Sequelize[_0xad02('0x6')]},'mailTranscript':{'type':Sequelize[_0xad02('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xad02('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xad02('0x7')]},'thirdDisposition':{'type':Sequelize[_0xad02('0x7')]},'note':{'type':Sequelize[_0xad02('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xad02('0x7')]},'osVersion':{'type':Sequelize[_0xad02('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xad02('0x7')]},'referer':{'type':Sequelize[_0xad02('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xad02('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xad02('0x8')]},'lastMsgAt':{'type':Sequelize[_0xad02('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xad02('0x3')]('in',_0xad02('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xad02('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xad02('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xad02('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x12e5=['star','TEXT','DATE','STRING','long','out','exports','BOOLEAN','INTEGER','ENUM'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x12e5,0x100));var _0x512e=function(_0x45212,_0xa6803){_0x45212=_0x45212-0x0;var _0x42437a=_0x12e5[_0x45212];return _0x42437a;};'use strict';var Sequelize=require('sequelize');module[_0x512e('0x0')]={'closed':{'type':Sequelize[_0x512e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x512e('0x2')]},'ratingType':{'type':Sequelize[_0x512e('0x3')]('star','thumb'),'defaultValue':_0x512e('0x4')},'ratingMessage':{'type':Sequelize[_0x512e('0x5')]},'pathTranscript':{'type':Sequelize[_0x512e('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x512e('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x512e('0x7')]},'thirdDisposition':{'type':Sequelize[_0x512e('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x512e('0x7')]},'browserVersion':{'type':Sequelize[_0x512e('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x512e('0x7')]},'deviceModel':{'type':Sequelize[_0x512e('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x512e('0x7')]},'referer':{'type':Sequelize[_0x512e('0x5')]},'customerIp':{'type':Sequelize[_0x512e('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x512e('0x8'))},'read1stAt':{'type':Sequelize[_0x512e('0x6')]},'lastMsgAt':{'type':Sequelize[_0x512e('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x512e('0x3')]('in',_0x512e('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x512e('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x512e('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x512e('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x512e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 515bf1a..84c4d4f 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 _0xc38d=['Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','length','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','ids','omit','getMessages','hasOwnProperty','nolimit','limit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','push','Tag','color','emit','unix','toString','root','server','tmp','files','transcript-%d-%s.zip','lastName','attachments','read','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','out','firstName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','info','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','update','destroy','then','stack','name','send','render','merge','body','contact','agent','interaction','map','ChatInteraction','fieldName','key','getOptions','findAll','chat','query','user','params','model','rawAttributes','keys','filters','intersection','attributes','fields','includeAll','include','options','find','create','describe','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0xc38d,0x76));var _0xdc38=function(_0x412279,_0x4eaa84){_0x412279=_0x412279-0x0;var _0x5a0443=_0xc38d[_0x412279];return _0x5a0443;};'use strict';var rimraf=require(_0xdc38('0x0'));var zipdir=require(_0xdc38('0x1'));var rp=require(_0xdc38('0x2'));var moment=require(_0xdc38('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdc38('0x4'));var util=require(_0xdc38('0x5'));var path=require('path');var ejs=require(_0xdc38('0x6'));var fs=require('fs');var _=require(_0xdc38('0x7'));var Redis=require(_0xdc38('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xdc38('0x9'));var pdf=require(_0xdc38('0xa'));var logger=require('../../config/logger')(_0xdc38('0xb'));var config=require(_0xdc38('0xc'));var db=require('../../mysqldb')['db'];config[_0xdc38('0xd')]=_['defaults'](config[_0xdc38('0xd')],{'host':_0xdc38('0xe'),'port':0x18eb});var socket=require(_0xdc38('0xf'))(new Redis(config[_0xdc38('0xd')]));require(_0xdc38('0x10'))[_0xdc38('0x11')](socket);var jayson=require(_0xdc38('0x12'));var client=jayson['client'][_0xdc38('0x13')]({'port':0x232b});var client9004=jayson[_0xdc38('0x14')][_0xdc38('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x4ff884,_0x26a517,_0x874454,_0x3e6486){return new BPromise(function(_0x433e81,_0x24b341){var _0x501477=_0x3e6486||client;return _0x501477[_0xdc38('0x15')](_0x4ff884,_0x874454)['then'](function(_0x5d201e){logger[_0xdc38('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x26a517,'request\x20sent');logger['debug'](_0xdc38('0x17'),_0x26a517,_0xdc38('0x18'),JSON[_0xdc38('0x19')](_0x5d201e));if(_0x5d201e[_0xdc38('0x1a')]){if(_0x5d201e[_0xdc38('0x1a')]['code']===0x1f4){logger[_0xdc38('0x1a')](_0xdc38('0x1b'),_0x26a517,_0x5d201e[_0xdc38('0x1a')]['message']);return _0x24b341(_0x5d201e['error'][_0xdc38('0x1c')]);}logger[_0xdc38('0x1a')](_0xdc38('0x1b'),_0x26a517,_0x5d201e[_0xdc38('0x1a')][_0xdc38('0x1c')]);return _0x433e81(_0x5d201e[_0xdc38('0x1a')]['message']);}else{logger[_0xdc38('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x26a517,_0xdc38('0x18'));_0x433e81(_0x5d201e[_0xdc38('0x1d')]['message']);}})[_0xdc38('0x1e')](function(_0x32e86e){logger[_0xdc38('0x1a')](_0xdc38('0x1b'),_0x26a517,_0x32e86e);_0x24b341(_0x32e86e);});});}function respondWithStatusCode(_0xbbea48,_0x43f977){_0x43f977=_0x43f977||0xcc;return function(_0x2904ac){if(_0x2904ac){return _0xbbea48[_0xdc38('0x1f')](_0x43f977);}return _0xbbea48[_0xdc38('0x20')](_0x43f977)[_0xdc38('0x21')]();};}function respondWithResult(_0x59cdc4,_0x4240cd){_0x4240cd=_0x4240cd||0xc8;return function(_0x5de647){if(_0x5de647){return _0x59cdc4[_0xdc38('0x20')](_0x4240cd)['json'](_0x5de647);}};}function respondWithFilteredResult(_0x5416ba,_0x29938c){return function(_0x1cefb5){if(_0x1cefb5){var _0x4646f0=typeof _0x29938c[_0xdc38('0x22')]===_0xdc38('0x23')&&typeof _0x29938c['limit']===_0xdc38('0x23');var _0x3e90a7=_0x1cefb5['count'];var _0x41a920=_0x4646f0?0x0:_0x29938c[_0xdc38('0x22')];var _0x4c5a36=_0x4646f0?_0x1cefb5[_0xdc38('0x24')]:_0x29938c[_0xdc38('0x22')]+_0x29938c['limit'];var _0x340428;if(_0x4c5a36>=_0x3e90a7){_0x4c5a36=_0x3e90a7;_0x340428=0xc8;}else{_0x340428=0xce;}_0x5416ba[_0xdc38('0x20')](_0x340428);return _0x5416ba[_0xdc38('0x25')](_0xdc38('0x26'),_0x41a920+'-'+_0x4c5a36+'/'+_0x3e90a7)[_0xdc38('0x27')](_0x1cefb5);}return null;};}function saveUpdates(_0x154bd9){return function(_0x59ef49){if(_0x59ef49){return _0x59ef49[_0xdc38('0x28')](_0x154bd9)['then'](function(_0x3714e6){return _0x3714e6;});}return null;};}function removeEntity(_0x20a6cd){return function(_0x3e8610){if(_0x3e8610){return _0x3e8610[_0xdc38('0x29')]()[_0xdc38('0x2a')](function(){_0x20a6cd[_0xdc38('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ea3cf){return function(_0x149110){if(!_0x149110){_0x5ea3cf[_0xdc38('0x1f')](0x194);}return _0x149110;};}function handleError(_0x18da20,_0x166093){_0x166093=_0x166093||0x1f4;return function(_0x251f68){logger[_0xdc38('0x1a')](_0x251f68[_0xdc38('0x2b')]);if(_0x251f68[_0xdc38('0x2c')]){delete _0x251f68[_0xdc38('0x2c')];}_0x18da20[_0xdc38('0x20')](_0x166093)[_0xdc38('0x2d')](_0x251f68);};}function getMustacheRender(_0x25d9f9,_0xbf4d13){return Mustache[_0xdc38('0x2e')](_0x25d9f9,_[_0xdc38('0x2f')](_0xbf4d13[_0xdc38('0x30')],{'contact':_0xbf4d13[_0xdc38('0x31')],'message':_0xbf4d13[_0xdc38('0x1c')],'agent':_0xbf4d13[_0xdc38('0x32')],'interaction':_0xbf4d13[_0xdc38('0x33')],'account':_0xbf4d13['account']}))||'';}exports['index']=function(_0x17adae,_0x4e85a2){var _0x4886c8={};var _0x30c5c4=_[_0xdc38('0x34')](db[_0xdc38('0x35')]['rawAttributes'],function(_0x3c8307){return{'name':_0x3c8307[_0xdc38('0x36')],'type':_0x3c8307['type'][_0xdc38('0x37')]};});_0x4886c8=qs[_0xdc38('0x38')](_0x30c5c4,_0x17adae);return interaction[_0xdc38('0x39')](_0xdc38('0x3a'),_0x17adae[_0xdc38('0x3b')],_0x17adae[_0xdc38('0x3c')],_0x4886c8,_0x30c5c4)[_0xdc38('0x2a')](respondWithFilteredResult(_0x4e85a2,_0x4886c8))[_0xdc38('0x1e')](handleError(_0x4e85a2,null));};exports['show']=function(_0x5b0b38,_0x5dc65a){var _0x3f9994={'raw':![],'where':{'id':_0x5b0b38[_0xdc38('0x3d')]['id']}},_0x137436={};_0x137436[_0xdc38('0x3e')]=_['keys'](db[_0xdc38('0x35')][_0xdc38('0x3f')]);_0x137436[_0xdc38('0x3b')]=_[_0xdc38('0x40')](_0x5b0b38[_0xdc38('0x3b')]);_0x137436[_0xdc38('0x41')]=_[_0xdc38('0x42')](_0x137436[_0xdc38('0x3e')],_0x137436['query']);_0x3f9994[_0xdc38('0x43')]=_[_0xdc38('0x42')](_0x137436[_0xdc38('0x3e')],qs[_0xdc38('0x44')](_0x5b0b38[_0xdc38('0x3b')][_0xdc38('0x44')]));_0x3f9994[_0xdc38('0x43')]=_0x3f9994['attributes']['length']?_0x3f9994['attributes']:_0x137436[_0xdc38('0x3e')];if(_0x5b0b38[_0xdc38('0x3b')][_0xdc38('0x45')]){_0x3f9994[_0xdc38('0x46')]=[{'all':!![]}];}_0x3f9994=_[_0xdc38('0x2f')]({},_0x3f9994,_0x5b0b38[_0xdc38('0x47')]);return db[_0xdc38('0x35')][_0xdc38('0x48')](_0x3f9994)['then'](handleEntityNotFound(_0x5dc65a,null))[_0xdc38('0x2a')](respondWithResult(_0x5dc65a,null))['catch'](handleError(_0x5dc65a,null));};exports[_0xdc38('0x49')]=function(_0x3be6f7,_0x1fff33){return db['ChatInteraction'][_0xdc38('0x49')](_0x3be6f7[_0xdc38('0x30')],{})[_0xdc38('0x2a')](respondWithResult(_0x1fff33,0xc9))['catch'](handleError(_0x1fff33,null));};exports['update']=function(_0x548c95,_0x1dd44e){if(_0x548c95[_0xdc38('0x30')]['id']){delete _0x548c95[_0xdc38('0x30')]['id'];}return db[_0xdc38('0x35')][_0xdc38('0x48')]({'where':{'id':_0x548c95[_0xdc38('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1dd44e,null))[_0xdc38('0x2a')](saveUpdates(_0x548c95[_0xdc38('0x30')],null))[_0xdc38('0x2a')](respondWithResult(_0x1dd44e,null))[_0xdc38('0x1e')](handleError(_0x1dd44e,null));};exports[_0xdc38('0x29')]=function(_0x1c40a4,_0x5df30b){return db[_0xdc38('0x35')][_0xdc38('0x48')]({'where':{'id':_0x1c40a4[_0xdc38('0x3d')]['id']}})[_0xdc38('0x2a')](handleEntityNotFound(_0x5df30b,null))['then'](removeEntity(_0x5df30b,null))['catch'](handleError(_0x5df30b,null));};exports[_0xdc38('0x4a')]=function(_0x40c45d,_0x275c57){return db[_0xdc38('0x35')][_0xdc38('0x4a')]()['then'](respondWithResult(_0x275c57,null))[_0xdc38('0x1e')](handleError(_0x275c57,null));};exports['createVidaooSession']=function(_0x6dbbc4,_0x4f274c){var _0xb7e1a2=_0x6dbbc4[_0xdc38('0x3d')]['id'];var _0x4545bd;var _0x37c7fe;var _0xd47e33;return db[_0xdc38('0x35')][_0xdc38('0x4b')]({'where':{'id':_0xb7e1a2}})['then'](function(_0xf55b09){_0x4545bd=_0xf55b09;return db[_0xdc38('0x4c')][_0xdc38('0x4b')]({'where':{'id':_0xf55b09['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xdc38('0x4d'),_0xdc38('0x4e'),_0xdc38('0x4f'),_0xdc38('0x50')],'raw':!![]});})['then'](function(_0x1ddea8){if(_0x1ddea8&&_0x1ddea8[_0xdc38('0x51')]&&_0x1ddea8[_0xdc38('0x4d')]){_0x37c7fe=_0x1ddea8;var _0x1feb91={'interaction':{'id':_0xb7e1a2},'agent':{'id':_0x6dbbc4[_0xdc38('0x3c')]['id'],'name':_0x6dbbc4[_0xdc38('0x3c')]['name'],'fullname':_0x6dbbc4['user']['fullname'],'email':_0x6dbbc4['user'][_0xdc38('0x52')]},'contact':_0x6dbbc4[_0xdc38('0x30')][_0xdc38('0x31')],'account':_0x6dbbc4['body']['account']};var _0x2e7331={'rejectUnauthorized':![],'method':'POST','url':_0xdc38('0x53'),'headers':{'X-APIKEY':_0x1ddea8[_0xdc38('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x6dbbc4['user'][_0xdc38('0x52')]],'buttons':null,'topic':_0x37c7fe[_0xdc38('0x4e')],'note':_[_0xdc38('0x54')](_0x37c7fe[_0xdc38('0x4f')])?null:getMustacheRender(_0x37c7fe[_0xdc38('0x4f')],_0x1feb91),'metadata':null},'redirect':_0xdc38('0x55'),'json':!![]};try{if(!_[_0xdc38('0x54')](_0x37c7fe[_0xdc38('0x50')])){var _0x4ed460=getMustacheRender(_0x37c7fe[_0xdc38('0x50')],_0x1feb91);var _0x351dc2=JSON['parse'](_0x4ed460);_0x2e7331[_0xdc38('0x30')][_0xdc38('0x56')]=_0x351dc2;}}catch(_0x3cdf9c){throw new db[(_0xdc38('0x57'))][(_0xdc38('0x58'))](_0xdc38('0x59'));}return rp(_0x2e7331);}else{throw new db['Sequelize'][(_0xdc38('0x58'))](_0xdc38('0x5a'));}})['then'](function(_0x4425e9){_0xd47e33=_0x4425e9;if(_0xd47e33['id']){var _0x3fb42c={'body':_0xd47e33[_0xdc38('0x5b')],'ChatWebsiteId':_0x37c7fe['id'],'ChatInteractionId':_0x4545bd['id'],'direction':'out','UserId':_0x6dbbc4[_0xdc38('0x3c')]['id']};return db[_0xdc38('0x5c')]['create'](_0x3fb42c,{});}else{throw new db['Sequelize'][(_0xdc38('0x58'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xdc38('0x2a')](function(){return _0x4545bd[_0xdc38('0x5d')]({'vidaooSessionId':_0xd47e33['id']});})[_0xdc38('0x2a')](respondWithResult(_0x4f274c,null))[_0xdc38('0x1e')](handleError(_0x4f274c,null));};exports['customUpdate']=function(_0x1c6bac,_0x13f51f){if(_0x1c6bac['body']['id']){delete _0x1c6bac[_0xdc38('0x30')]['id'];}return db['ChatInteraction'][_0xdc38('0x48')]({'where':{'id':_0x1c6bac[_0xdc38('0x3d')]['id']},'include':[{'model':db[_0xdc38('0x5e')],'as':_0xdc38('0x5f')}]})[_0xdc38('0x2a')](handleEntityNotFound(_0x13f51f,null))[_0xdc38('0x2a')](saveUpdates(_0x1c6bac[_0xdc38('0x30')],null))[_0xdc38('0x2a')](respondWithResult(_0x13f51f,null))['catch'](handleError(_0x13f51f,null));};exports['abandon']=function(_0xc7b6e5,_0x426835){if(_0xc7b6e5[_0xdc38('0x30')]['id']){delete _0xc7b6e5[_0xdc38('0x30')]['id'];}return db[_0xdc38('0x35')][_0xdc38('0x48')]({'where':{'id':_0xc7b6e5[_0xdc38('0x3d')]['id']}})[_0xdc38('0x2a')](function(_0x6e721b){if(!_0x6e721b){logger['error'](_0xdc38('0x60'),_0xdc38('0x61'),0x194,'entity\x20not\x20found');_0x426835[_0xdc38('0x1f')](0x194);}else{if(_0x6e721b[_0xdc38('0x62')]){throw new db[(_0xdc38('0x57'))]['ValidationError'](_0xdc38('0x63'));}}return _0x6e721b;})[_0xdc38('0x2a')](function(_0x5f29c1){if(_0x5f29c1){return _0x5f29c1[_0xdc38('0x28')]({'closed':_0xc7b6e5[_0xdc38('0x30')][_0xdc38('0x64')],'disposition':_0xc7b6e5[_0xdc38('0x30')]['disposition']})['then'](function(_0x171972){return _0x171972;});}})['then'](function(){return respondWithRpcPromise(_0xdc38('0x65'),'abandon',_0xc7b6e5[_0xdc38('0x30')],client9004);})[_0xdc38('0x2a')](respondWithResult(_0x426835,null))[_0xdc38('0x1e')](handleError(_0x426835,null));};exports[_0xdc38('0x66')]=function(_0x5acc35,_0x2d0039){_0x5acc35[_0xdc38('0x30')][_0xdc38('0x2c')]=_0x5acc35[_0xdc38('0x67')][_0xdc38('0x68')];_0x5acc35[_0xdc38('0x30')][_0xdc38('0x69')]=_0x5acc35[_0xdc38('0x67')][_0xdc38('0x6a')];_0x5acc35[_0xdc38('0x30')][_0xdc38('0x6b')]=_0x5acc35[_0xdc38('0x67')][_0xdc38('0x6c')];return db['Attachment']['create'](_0x5acc35[_0xdc38('0x30')])['then'](respondWithResult(_0x2d0039,0xc9))[_0xdc38('0x1e')](handleError(_0x2d0039,null));};exports[_0xdc38('0x6d')]=function(_0x4cbdb5,_0x562665){return db['ChatInteraction'][_0xdc38('0x4b')]({'where':{'id':_0x4cbdb5['params']['id']},'raw':!![]})[_0xdc38('0x2a')](handleEntityNotFound(_0x562665,null))['then'](function(_0x22f3b2){if(_0x22f3b2){if(_0x22f3b2[_0xdc38('0x64')]){return _0x562665[_0xdc38('0x20')](0x193)[_0xdc38('0x27')]({'status':0x193,'message':_0xdc38('0x6e')});}return db[_0xdc38('0x6f')]['findOne']({'where':{'id':_0x4cbdb5[_0xdc38('0x3b')][_0xdc38('0x70')]},'raw':!![]})[_0xdc38('0x2a')](handleEntityNotFound(_0x562665,null));}})[_0xdc38('0x2a')](function(_0x5a1023){if(_0x5a1023){var _0x52519a=_0x5a1023[_0xdc38('0x71')]!==null;var _0x3a7c0a=path[_0xdc38('0x72')](config['root'],_0xdc38('0x73'));if(_0x52519a){_0x3a7c0a=path[_0xdc38('0x72')](_0x3a7c0a,_0xdc38('0x74'));}var _0x2a8e01=path[_0xdc38('0x72')](_0x3a7c0a,_0x5a1023[_0xdc38('0x69')]);return _0x562665[_0xdc38('0x75')](_0x2a8e01);}})[_0xdc38('0x1e')](handleError(_0x562665,null));};exports['close']=function(_0x4a9f25,_0x26bbaf){var _0x127677=null;var _0x3d8ea7=null;var _0x51f96b=null;if(_0x4a9f25[_0xdc38('0x30')]['id']){delete _0x4a9f25[_0xdc38('0x30')]['id'];}if(_0x4a9f25['body'][_0xdc38('0x76')]){_0x51f96b=path[_0xdc38('0x72')](config['root'],_0xdc38('0x77'),util[_0xdc38('0x78')](_0xdc38('0x79'),Date[_0xdc38('0x7a')]()));_0x4a9f25[_0xdc38('0x30')][_0xdc38('0x7b')]=_0x51f96b;}return db[_0xdc38('0x35')][_0xdc38('0x48')]({'where':{'id':_0x4a9f25[_0xdc38('0x3d')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xdc38('0x7c'),'include':[{'model':db[_0xdc38('0x7d')],'as':'User'}]}]})[_0xdc38('0x2a')](handleEntityNotFound(_0x26bbaf,null))[_0xdc38('0x2a')](saveUpdates(_0x4a9f25[_0xdc38('0x30')],null))[_0xdc38('0x2a')](function(_0x289966){if(_0x289966){_0x127677=_0x289966;return db[_0xdc38('0x4c')][_0xdc38('0x48')]({'where':{'id':_0x127677['ChatWebsiteId']}});}})[_0xdc38('0x2a')](function(_0x1b43bb){if(_0x1b43bb){_0x3d8ea7=_0x1b43bb;return db[_0xdc38('0x5e')]['find']({'where':{'id':_0x127677[_0xdc38('0x7e')]}});}})['then'](function(_0x30ccc8){if(_0x30ccc8){if(_0x51f96b){var _0x4a90ea=null;for(var _0xa5f772=0x1;_0xa5f772<_0x127677[_0xdc38('0x7c')][_0xdc38('0x7f')];++_0xa5f772){_0x4a90ea=_0x127677[_0xdc38('0x7c')][_0xa5f772];var _0x3f5e73=_0x4a90ea[_0xdc38('0x62')]?util['format'](_0xdc38('0x80'),_0x3d8ea7[_0xdc38('0x81')],_0x4a90ea[_0xdc38('0x62')]):_0xdc38('0x82');var _0x520d04=_0x4a9f25[_0xdc38('0x30')][_0xdc38('0x83')]||util[_0xdc38('0x78')](_0xdc38('0x80'),_0xdc38('0x84'),_0x4a90ea['ContactId']);switch(_0x3d8ea7[_0xdc38('0x85')]){case _0xdc38('0x86'):_0x3f5e73=_0x4a90ea[_0xdc38('0x62')]?util[_0xdc38('0x78')](_0xdc38('0x80'),_0x3d8ea7[_0xdc38('0x81')],_0x4a90ea['UserId']):_0xdc38('0x82');break;case _0xdc38('0x87'):_0x3f5e73=_0x4a90ea[_0xdc38('0x62')]?_0x4a90ea['User'][_0xdc38('0x88')]||_0x4a90ea[_0xdc38('0x7d')][_0xdc38('0x89')]:_0xdc38('0x82');break;case'agent_fullname':_0x3f5e73=_0x4a90ea[_0xdc38('0x62')]?_0x4a90ea[_0xdc38('0x7d')][_0xdc38('0x89')]:_0xdc38('0x82');break;default:_0x3f5e73=_0x4a90ea[_0xdc38('0x62')]?util['format']('%s%d',_0x3d8ea7[_0xdc38('0x81')],_0x4a90ea[_0xdc38('0x62')]):_0xdc38('0x82');}var _0x765978=util[_0xdc38('0x78')](_0xdc38('0x8a'),moment(_0x4a90ea[_0xdc38('0x8b')])[_0xdc38('0x78')](_0xdc38('0x8c')),_0x4a90ea[_0xdc38('0x8d')]==='in'?_0x520d04:_0x3f5e73,_0x4a90ea[_0xdc38('0x30')]);if(!_0x4a90ea[_0xdc38('0x8e')]){fs[_0xdc38('0x8f')](_0x51f96b,_0x765978);}}return db['MailAccount'][_0xdc38('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0xdc38('0x90')],'as':_0xdc38('0x91'),'raw':!![],'include':[{'model':db[_0xdc38('0x92')],'as':_0xdc38('0x92'),'raw':!![]}]}]});}}})[_0xdc38('0x2a')](function(_0x556dbf){if(!_0x556dbf||!_0x556dbf[_0xdc38('0x91')]||!_0x4a9f25[_0xdc38('0x30')])return _0x127677;var _0x59e52e=_0x556dbf[_0xdc38('0x93')]();return respondWithRpcPromise(_0xdc38('0x94'),'sendMail',{'account':_0x59e52e,'message':{'from':util[_0xdc38('0x78')](_0xdc38('0x95'),_0x556dbf['name'],_0x556dbf[_0xdc38('0x52')]||_0x556dbf[_0xdc38('0x91')][_0xdc38('0x3c')]),'to':_0x4a9f25['body'][_0xdc38('0x76')],'subject':_0xdc38('0x96'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4a9f25['body'][_0xdc38('0x76')]),'attachments':[{'path':_0x51f96b}]}})[_0xdc38('0x2a')](function(){return _0x127677;})[_0xdc38('0x1e')](function(_0x54f98f){logger[_0xdc38('0x1a')](_0x54f98f);});})[_0xdc38('0x2a')](respondWithStatusCode(_0x26bbaf,0xc8))[_0xdc38('0x1e')](handleError(_0x26bbaf,null));};exports['addMessage']=function(_0x5c8873,_0x279192){return db['ChatMessage'][_0xdc38('0x48')]({'where':{'id':_0x5c8873[_0xdc38('0x3d')]['id']}})[_0xdc38('0x2a')](handleEntityNotFound(_0x279192,null))[_0xdc38('0x2a')](function(_0x1c1c54){if(_0x1c1c54){return _0x1c1c54['addMessage'](_0x5c8873['body'][_0xdc38('0x97')],_[_0xdc38('0x98')](_0x5c8873[_0xdc38('0x30')],[_0xdc38('0x97'),'id'])||{});}})['then'](respondWithResult(_0x279192,null))[_0xdc38('0x1e')](handleError(_0x279192,null));};exports[_0xdc38('0x99')]=function(_0x2b2685,_0x3f5c15){var _0x379b69={'raw':![],'where':{}};var _0x4fcb5f={};var _0x347ebc={'count':0x0,'rows':[]};return db[_0xdc38('0x35')][_0xdc38('0x4b')]({'where':{'id':_0x2b2685[_0xdc38('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3f5c15,null))[_0xdc38('0x2a')](function(_0x344f87){if(_0x344f87){_0x4fcb5f['model']=_[_0xdc38('0x40')](db[_0xdc38('0x5c')]['rawAttributes']);_0x4fcb5f[_0xdc38('0x3b')]=_['keys'](_0x2b2685[_0xdc38('0x3b')]);_0x4fcb5f[_0xdc38('0x41')]=_[_0xdc38('0x42')](_0x4fcb5f[_0xdc38('0x3e')],_0x4fcb5f[_0xdc38('0x3b')]);_0x379b69['attributes']=_['intersection'](_0x4fcb5f['model'],qs[_0xdc38('0x44')](_0x2b2685['query'][_0xdc38('0x44')]));_0x379b69[_0xdc38('0x43')]=_0x379b69[_0xdc38('0x43')][_0xdc38('0x7f')]?_0x379b69[_0xdc38('0x43')]:_0x4fcb5f['model'];if(!_0x2b2685[_0xdc38('0x3b')][_0xdc38('0x9a')](_0xdc38('0x9b'))){_0x379b69[_0xdc38('0x9c')]=qs[_0xdc38('0x9c')](_0x2b2685['query'][_0xdc38('0x9c')]);_0x379b69[_0xdc38('0x22')]=qs['offset'](_0x2b2685['query'][_0xdc38('0x22')]);}_0x379b69[_0xdc38('0x9d')]=qs[_0xdc38('0x9e')](_0x2b2685[_0xdc38('0x3b')][_0xdc38('0x9e')]);_0x379b69[_0xdc38('0x9f')]=qs['filters'](_[_0xdc38('0xa0')](_0x2b2685[_0xdc38('0x3b')],_0x4fcb5f[_0xdc38('0x41')]));_0x379b69[_0xdc38('0x9f')][_0xdc38('0xa1')]=_0x344f87['id'];if(_0x2b2685['query'][_0xdc38('0xa2')]){_0x379b69['where']=_['merge'](_0x379b69['where'],{'$or':_[_0xdc38('0x34')](_0x379b69[_0xdc38('0x43')],function(_0x11d089){var _0x38da3d={};_0x38da3d[_0x11d089]={'$like':'%'+_0x2b2685['query'][_0xdc38('0xa2')]+'%'};return _0x38da3d;})});}if(_0x2b2685['query'][_0xdc38('0xa3')]){var _0x4ffe29=_0x2b2685['query'][_0xdc38('0xa3')][_0xdc38('0xa4')](',');var _0x1c7f49={};_0x1c7f49[_0x4ffe29[0x0]]={'$gte':moment(_0x4ffe29[0x1])[_0xdc38('0x78')](_0xdc38('0xa5'))};_0x379b69[_0xdc38('0x9f')]=_[_0xdc38('0x2f')](_0x379b69[_0xdc38('0x9f')],_0x1c7f49);}_0x379b69=_['merge']({},_0x379b69,_0x2b2685[_0xdc38('0x47')]);return db[_0xdc38('0x5c')]['count']({'where':_0x379b69[_0xdc38('0x9f')]})[_0xdc38('0x2a')](function(_0x157865){_0x347ebc['count']=_0x157865;if(_0x2b2685[_0xdc38('0x3b')][_0xdc38('0x45')]){_0x379b69[_0xdc38('0x46')]=[{'all':!![]}];}return db[_0xdc38('0x5c')]['findAll'](_0x379b69);})['then'](function(_0x11556b){_0x347ebc[_0xdc38('0xa6')]=_0x11556b;return _0x347ebc;});}})[_0xdc38('0x2a')](respondWithFilteredResult(_0x3f5c15,_0x379b69))[_0xdc38('0x1e')](handleError(_0x3f5c15,null));};exports[_0xdc38('0xa7')]=function(_0x355b9f,_0x954cb7){var _0x15880f={'where':{}},_0x1802f1={},_0x3a8f80={'count':0x0,'rows':[]};return db[_0xdc38('0x35')]['findOne']({'where':{'id':_0x355b9f[_0xdc38('0x3d')]['id']}})[_0xdc38('0x2a')](handleEntityNotFound(_0x954cb7,null))[_0xdc38('0x2a')](function(_0x24a908){if(_0x24a908){_0x1802f1['model']=_[_0xdc38('0x40')](db['ChatMessage']['rawAttributes']);_0x1802f1['query']=_[_0xdc38('0x40')](_0x355b9f[_0xdc38('0x3b')]);_0x1802f1[_0xdc38('0x41')]=_[_0xdc38('0x42')](_0x1802f1['model'],_0x1802f1['query']);_0x15880f[_0xdc38('0x43')]=_[_0xdc38('0x42')](_0x1802f1[_0xdc38('0x3e')],qs[_0xdc38('0x44')](_0x355b9f[_0xdc38('0x3b')][_0xdc38('0x44')]));_0x15880f[_0xdc38('0x43')]=_0x15880f[_0xdc38('0x43')][_0xdc38('0x7f')]?_0x15880f[_0xdc38('0x43')]:_0x1802f1[_0xdc38('0x3e')];if(!_0x355b9f['query'][_0xdc38('0x9a')](_0xdc38('0x9b'))){_0x15880f['limit']=qs[_0xdc38('0x9c')](_0x355b9f[_0xdc38('0x3b')][_0xdc38('0x9c')]);_0x15880f[_0xdc38('0x22')]=qs['offset'](_0x355b9f[_0xdc38('0x3b')][_0xdc38('0x22')]);}_0x15880f[_0xdc38('0x9d')]=qs[_0xdc38('0x9e')](_0x355b9f[_0xdc38('0x3b')][_0xdc38('0x9e')]);_0x15880f['where']=qs['filters'](_[_0xdc38('0xa0')](_0x355b9f['query'],_0x1802f1['filters']));_0x15880f[_0xdc38('0x9f')][_0xdc38('0xa1')]=_0x24a908['id'];if(_0x355b9f['query'][_0xdc38('0xa2')]){_0x15880f[_0xdc38('0x9f')]=_[_0xdc38('0x2f')](_0x15880f[_0xdc38('0x9f')],{'$or':_[_0xdc38('0x34')](_0x15880f[_0xdc38('0x43')],function(_0x2a817a){var _0x57b586={};_0x57b586[_0x2a817a]={'$like':'%'+_0x355b9f[_0xdc38('0x3b')]['filter']+'%'};return _0x57b586;})});}_0x15880f[_0xdc38('0x9f')][_0xdc38('0x8e')]=![];if(_0x355b9f['query']['id']){_0x15880f[_0xdc38('0x9f')]['id']={'$gt':_0x355b9f[_0xdc38('0x3b')]['id']};}_0x15880f=_['merge']({},_0x15880f,_0x355b9f[_0xdc38('0x47')]);return db[_0xdc38('0x5c')][_0xdc38('0x24')]({'where':_0x15880f[_0xdc38('0x9f')]})[_0xdc38('0x2a')](function(_0x2f93ed){_0x3a8f80['count']=_0x2f93ed;_0x15880f[_0xdc38('0x46')]=[];if(_0x355b9f[_0xdc38('0x3b')][_0xdc38('0xa8')]){_0x15880f['include'][_0xdc38('0xa9')]({'model':db[_0xdc38('0x7d')],'as':'User','attributes':['id',_0xdc38('0x89'),'alias']});}if(_0x355b9f['query'][_0xdc38('0x45')]){_0x15880f['include']=[{'all':!![]}];}return db[_0xdc38('0x5c')][_0xdc38('0x39')](_0x15880f);})[_0xdc38('0x2a')](function(_0x3c2d21){_0x3a8f80[_0xdc38('0xa6')]=_0x3c2d21;return _0x3a8f80;});}})[_0xdc38('0x2a')](respondWithFilteredResult(_0x954cb7,_0x15880f))[_0xdc38('0x1e')](handleError(_0x954cb7,null));};exports['addTags']=function(_0x3ac46f,_0x1a5d87){return db['ChatInteraction'][_0xdc38('0x48')]({'where':{'id':_0x3ac46f[_0xdc38('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1a5d87,null))[_0xdc38('0x2a')](function(_0x29f146){if(_0x29f146){return _0x29f146['setTags'](_0x3ac46f[_0xdc38('0x30')]['ids'],_[_0xdc38('0x98')](_0x3ac46f[_0xdc38('0x30')],[_0xdc38('0x97'),'id'])||{})['spread'](function(){return db[_0xdc38('0xaa')][_0xdc38('0x39')]({'attributes':['id',_0xdc38('0x2c'),_0xdc38('0xab')],'where':{'id':_0x3ac46f[_0xdc38('0x30')][_0xdc38('0x97')]}});})[_0xdc38('0x2a')](function(_0xda8e30){socket[_0xdc38('0xac')]('chatInteractionTags:save',{'id':Number(_0x3ac46f[_0xdc38('0x3d')]['id']),'tags':_0xda8e30||[]});return{'id':Number(_0x3ac46f[_0xdc38('0x3d')]['id']),'tags':_0xda8e30||[]};});}})[_0xdc38('0x2a')](respondWithResult(_0x1a5d87,null))['catch'](handleError(_0x1a5d87,null));};exports['removeTags']=function(_0x18ebf3,_0x3c11ae){return db[_0xdc38('0x35')]['find']({'where':{'id':_0x18ebf3['params']['id']}})[_0xdc38('0x2a')](handleEntityNotFound(_0x3c11ae,null))[_0xdc38('0x2a')](function(_0x2e0eed){if(_0x2e0eed){return _0x2e0eed['removeTags'](_0x18ebf3[_0xdc38('0x3b')][_0xdc38('0x97')]);}})[_0xdc38('0x2a')](respondWithStatusCode(_0x3c11ae,null))[_0xdc38('0x1e')](handleError(_0x3c11ae,null));};exports[_0xdc38('0x75')]=function(_0x338a7f,_0x4ee8d2){var _0x46271b=moment()[_0xdc38('0xad')]()[_0xdc38('0xae')]();var _0x5c98c6=path[_0xdc38('0x72')](config[_0xdc38('0xaf')],_0xdc38('0xb0'),'files',_0xdc38('0xb1'));var _0x2dfccb=path[_0xdc38('0x72')](config[_0xdc38('0xaf')],_0xdc38('0xb0'),_0xdc38('0xb2'),'attachments');var _0x5631fd=path[_0xdc38('0x72')](_0x5c98c6,_0x46271b);var _0x330e44=util[_0xdc38('0x78')](_0xdc38('0xb3'),_0x338a7f[_0xdc38('0x3d')]['id'],_0x46271b);var _0x1f7d79=path[_0xdc38('0x72')](_0x5c98c6,_0x330e44);var _0x437e14=[];_0x437e14['push']({'model':db[_0xdc38('0x7d')],'as':_0xdc38('0x7d'),'attributes':['id',_0xdc38('0x89')],'raw':!![]});_0x437e14[_0xdc38('0xa9')]({'model':db[_0xdc38('0x5e')],'as':_0xdc38('0x5f'),'attributes':['id','firstName',_0xdc38('0xb4')],'raw':!![]});if(_0x338a7f[_0xdc38('0x3b')][_0xdc38('0xb5')]){_0x437e14['push']({'model':db[_0xdc38('0x6f')],'as':_0xdc38('0x6f'),'raw':!![]});}var _0x18f37b=[{'model':db[_0xdc38('0x5c')],'as':'Messages','attributes':['id',_0xdc38('0x30'),_0xdc38('0x8b'),'direction',_0xdc38('0x8e'),_0xdc38('0xb6')],'include':_0x437e14}];_0x18f37b[_0xdc38('0xa9')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xdc38('0x2c')]});_0x18f37b[_0xdc38('0xa9')]({'model':db[_0xdc38('0x7d')],'as':_0xdc38('0xb7'),'attributes':['id',_0xdc38('0x89')]});return db[_0xdc38('0x35')][_0xdc38('0x48')]({'where':{'id':_0x338a7f[_0xdc38('0x3d')]['id']},'include':_0x18f37b})[_0xdc38('0x2a')](handleEntityNotFound(_0x4ee8d2,null))['then'](function(_0x5a7e3b){if(_0x5a7e3b){var _0x13a09f=_0x5a7e3b[_0xdc38('0xb8')]({'plain':!![]});fs[_0xdc38('0xb9')](_0x5631fd);var _0x5a2c73={'channel':_0xdc38('0xba'),'account':_0x13a09f['Account'][_0xdc38('0x2c')],'agent':_0x13a09f[_0xdc38('0xb7')]?_0x13a09f[_0xdc38('0xb7')]['fullname']:_0xdc38('0xbb'),'createdAt':moment(_0x13a09f[_0xdc38('0x8b')])[_0xdc38('0x78')](_0xdc38('0xa5'))[_0xdc38('0xae')](),'closedAt':_0x13a09f['closed']?moment(_0x13a09f[_0xdc38('0xbc')])[_0xdc38('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdc38('0xae')]():'','disposition':_0x13a09f[_0xdc38('0xbd')],'chatInfo':{'browser':_0x13a09f[_0xdc38('0xbe')],'os':_0x13a09f[_0xdc38('0xbf')],'referer':_0x13a09f[_0xdc38('0xc0')],'customerIp':_0x13a09f[_0xdc38('0xc1')],'customerPort':_0x13a09f[_0xdc38('0xc2')]?_0x13a09f[_0xdc38('0xc2')]:'N.A.'},'messages':_(_0x13a09f[_0xdc38('0x7c')])[_0xdc38('0xc3')]()[_0xdc38('0xa2')]({'secret':![]})['map'](function(_0xc0c555){if(_0xc0c555[_0xdc38('0x6f')]){var _0x255e57=path[_0xdc38('0x72')](_0x2dfccb,_0xc0c555[_0xdc38('0x6f')][_0xdc38('0x69')]);if(fs['existsSync'](_0x255e57)){fs[_0xdc38('0xc4')](_0x255e57)[_0xdc38('0xc5')](fs[_0xdc38('0xc6')](path[_0xdc38('0x72')](_0x5631fd,_0xc0c555[_0xdc38('0x6f')][_0xdc38('0x69')])));}}return{'date':moment(_0xc0c555[_0xdc38('0x8b')])[_0xdc38('0x78')](_0xdc38('0xa5'))[_0xdc38('0xae')](),'sender':_0xc0c555[_0xdc38('0x8d')]===_0xdc38('0xc7')?_0xc0c555[_0xdc38('0x7d')]?_0xc0c555['User'][_0xdc38('0x89')]:'System':_0xc0c555[_0xdc38('0x5f')][_0xdc38('0xc8')]+(_0xc0c555[_0xdc38('0x5f')][_0xdc38('0xb4')]?'\x20'+_0xc0c555[_0xdc38('0x5f')][_0xdc38('0xb4')]:''),'body':_0xc0c555[_0xdc38('0x6f')]?_0xc0c555[_0xdc38('0x6f')][_0xdc38('0x69')]:_0xc0c555[_0xdc38('0x30')],'direction':_0xc0c555[_0xdc38('0x8d')]===_0xdc38('0xc7')?'A':'C','secret':_0xc0c555[_0xdc38('0x8e')],'read':_0xc0c555['read'],'attachment':_0xc0c555[_0xdc38('0x6f')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xdc38('0xaf')],_0xdc38('0xb0'),_0xdc38('0xc9'),_0xdc38('0xca')),{'interaction':_0x5a2c73})[_0xdc38('0x2a')](function(_0x14f966){var _0x426a78=path['join'](_0x5631fd,_0xdc38('0xcb')+_0x13a09f['id']+'-'+_0x46271b+_0xdc38('0xcc'));var _0x4eb343={'path':_0x426a78,'channel':_0xdc38('0xba'),'interactionId':_0x13a09f['id']};return pdf[_0xdc38('0xcd')](_0x14f966,_0x4eb343);})[_0xdc38('0x2a')](function(){return new Promise(function(_0x1ad245,_0x3befce){zipdir(_0x5631fd,{'saveTo':_0x1f7d79},function(_0x151113,_0x130f4a){if(_0x151113)return _0x3befce(_0x151113);return _0x1ad245(_0x130f4a);});})[_0xdc38('0x2a')](function(){return new BPromise(function(_0x330601,_0x407ac3){rimraf(_0x5631fd,function(_0x20156d){if(_0x20156d)_0x407ac3(_0x20156d);return _0x330601();});});})[_0xdc38('0x2a')](function(){return _0x4ee8d2[_0xdc38('0x75')](_0x1f7d79,_0x330e44,function(_0x25f5f3){if(_0x25f5f3){logger['error'](_0xdc38('0xce'),_0x25f5f3);}else{fs[_0xdc38('0xcf')](_0x1f7d79);}});});});}else{return _0x4ee8d2[_0xdc38('0x1f')](0xc8);}})[_0xdc38('0x1e')](handleError(_0x4ee8d2,null));};
\ No newline at end of file
+var _0x2e9b=['query','model','keys','filters','intersection','fields','attributes','length','find','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','pathTranscript','Messages','User','UserId','format','%s%d','agentAlias','Visitor','ContactId','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','hasOwnProperty','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','nolimit','include','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','firstName','lastName','secret','read','Account','get','mkdirSync','Chat','Owner','N.A.','disposition','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','chat'];(function(_0x36765e,_0x14ed23){var _0x5e33b8=function(_0x3a84d3){while(--_0x3a84d3){_0x36765e['push'](_0x36765e['shift']());}};_0x5e33b8(++_0x14ed23);}(_0x2e9b,0x167));var _0xb2e9=function(_0x37a7e9,_0x4bb5aa){_0x37a7e9=_0x37a7e9-0x0;var _0x50e838=_0x2e9b[_0x37a7e9];return _0x50e838;};'use strict';var rimraf=require(_0xb2e9('0x0'));var zipdir=require(_0xb2e9('0x1'));var rp=require('request-promise');var moment=require(_0xb2e9('0x2'));var BPromise=require(_0xb2e9('0x3'));var Mustache=require(_0xb2e9('0x4'));var util=require(_0xb2e9('0x5'));var path=require(_0xb2e9('0x6'));var ejs=require(_0xb2e9('0x7'));var fs=require('fs');var _=require(_0xb2e9('0x8'));var Redis=require(_0xb2e9('0x9'));var interaction=require('../../components/interaction/service');var qs=require(_0xb2e9('0xa'));var pdf=require(_0xb2e9('0xb'));var logger=require(_0xb2e9('0xc'))('api');var config=require(_0xb2e9('0xd'));var db=require(_0xb2e9('0xe'))['db'];config[_0xb2e9('0xf')]=_[_0xb2e9('0x10')](config[_0xb2e9('0xf')],{'host':_0xb2e9('0x11'),'port':0x18eb});var socket=require(_0xb2e9('0x12'))(new Redis(config[_0xb2e9('0xf')]));require(_0xb2e9('0x13'))[_0xb2e9('0x14')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb2e9('0x15')]({'port':0x232b});var client9004=jayson[_0xb2e9('0x16')][_0xb2e9('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x97e466,_0xce9ee3,_0x1fc6ef,_0x5801ca){return new BPromise(function(_0x472c35,_0x3ee37a){var _0x235ba9=_0x5801ca||client;return _0x235ba9[_0xb2e9('0x17')](_0x97e466,_0x1fc6ef)[_0xb2e9('0x18')](function(_0x25c06f){logger[_0xb2e9('0x19')](_0xb2e9('0x1a'),_0xce9ee3,'request\x20sent');logger[_0xb2e9('0x1b')](_0xb2e9('0x1c'),_0xce9ee3,_0xb2e9('0x1d'),JSON[_0xb2e9('0x1e')](_0x25c06f));if(_0x25c06f[_0xb2e9('0x1f')]){if(_0x25c06f['error'][_0xb2e9('0x20')]===0x1f4){logger[_0xb2e9('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0xce9ee3,_0x25c06f['error'][_0xb2e9('0x21')]);return _0x3ee37a(_0x25c06f[_0xb2e9('0x1f')]['message']);}logger[_0xb2e9('0x1f')](_0xb2e9('0x1a'),_0xce9ee3,_0x25c06f[_0xb2e9('0x1f')][_0xb2e9('0x21')]);return _0x472c35(_0x25c06f[_0xb2e9('0x1f')][_0xb2e9('0x21')]);}else{logger['info'](_0xb2e9('0x1a'),_0xce9ee3,_0xb2e9('0x1d'));_0x472c35(_0x25c06f[_0xb2e9('0x22')][_0xb2e9('0x21')]);}})[_0xb2e9('0x23')](function(_0x33dd15){logger['error'](_0xb2e9('0x1a'),_0xce9ee3,_0x33dd15);_0x3ee37a(_0x33dd15);});});}function respondWithStatusCode(_0x4c165b,_0x2e5980){_0x2e5980=_0x2e5980||0xcc;return function(_0x2290d9){if(_0x2290d9){return _0x4c165b[_0xb2e9('0x24')](_0x2e5980);}return _0x4c165b[_0xb2e9('0x25')](_0x2e5980)['end']();};}function respondWithResult(_0x4b683d,_0x5e3db7){_0x5e3db7=_0x5e3db7||0xc8;return function(_0x546717){if(_0x546717){return _0x4b683d['status'](_0x5e3db7)[_0xb2e9('0x26')](_0x546717);}};}function respondWithFilteredResult(_0x3268e9,_0x3056bd){return function(_0x43b51c){if(_0x43b51c){var _0x59d56e=typeof _0x3056bd[_0xb2e9('0x27')]===_0xb2e9('0x28')&&typeof _0x3056bd[_0xb2e9('0x29')]===_0xb2e9('0x28');var _0x588b30=_0x43b51c[_0xb2e9('0x2a')];var _0x36c836=_0x59d56e?0x0:_0x3056bd['offset'];var _0x2c11f3=_0x59d56e?_0x43b51c['count']:_0x3056bd['offset']+_0x3056bd[_0xb2e9('0x29')];var _0x38e55e;if(_0x2c11f3>=_0x588b30){_0x2c11f3=_0x588b30;_0x38e55e=0xc8;}else{_0x38e55e=0xce;}_0x3268e9['status'](_0x38e55e);return _0x3268e9[_0xb2e9('0x2b')](_0xb2e9('0x2c'),_0x36c836+'-'+_0x2c11f3+'/'+_0x588b30)[_0xb2e9('0x26')](_0x43b51c);}return null;};}function saveUpdates(_0x2b1813){return function(_0x3b8562){if(_0x3b8562){return _0x3b8562[_0xb2e9('0x2d')](_0x2b1813)[_0xb2e9('0x18')](function(_0x1a3421){return _0x1a3421;});}return null;};}function removeEntity(_0x1c5b55){return function(_0x5677b2){if(_0x5677b2){return _0x5677b2[_0xb2e9('0x2e')]()['then'](function(){_0x1c5b55['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f0fb4){return function(_0x362d4f){if(!_0x362d4f){_0x5f0fb4['sendStatus'](0x194);}return _0x362d4f;};}function handleError(_0x1a7dea,_0x59ca76){_0x59ca76=_0x59ca76||0x1f4;return function(_0x3e8f3f){logger[_0xb2e9('0x1f')](_0x3e8f3f[_0xb2e9('0x2f')]);if(_0x3e8f3f[_0xb2e9('0x30')]){delete _0x3e8f3f[_0xb2e9('0x30')];}_0x1a7dea[_0xb2e9('0x25')](_0x59ca76)[_0xb2e9('0x31')](_0x3e8f3f);};}function getMustacheRender(_0x585a53,_0xf3c192){return Mustache[_0xb2e9('0x32')](_0x585a53,_[_0xb2e9('0x33')](_0xf3c192[_0xb2e9('0x34')],{'contact':_0xf3c192[_0xb2e9('0x35')],'message':_0xf3c192[_0xb2e9('0x21')],'agent':_0xf3c192[_0xb2e9('0x36')],'interaction':_0xf3c192['interaction'],'account':_0xf3c192['account']}))||'';}exports[_0xb2e9('0x37')]=function(_0x9faa4d,_0x6b25f7){var _0x400c47={};var _0x4ac7f3=_[_0xb2e9('0x38')](db[_0xb2e9('0x39')][_0xb2e9('0x3a')],function(_0x5b4e0f){return{'name':_0x5b4e0f['fieldName'],'type':_0x5b4e0f[_0xb2e9('0x3b')]['key']};});_0x400c47=qs[_0xb2e9('0x3c')](_0x4ac7f3,_0x9faa4d);return interaction[_0xb2e9('0x3d')](_0xb2e9('0x3e'),_0x9faa4d[_0xb2e9('0x3f')],_0x9faa4d['user'],_0x400c47,_0x4ac7f3)['then'](respondWithFilteredResult(_0x6b25f7,_0x400c47))['catch'](handleError(_0x6b25f7,null));};exports['show']=function(_0xb6a505,_0x8b7807){var _0x2a8dbc={'raw':![],'where':{'id':_0xb6a505['params']['id']}},_0x4f5164={};_0x4f5164[_0xb2e9('0x40')]=_[_0xb2e9('0x41')](db[_0xb2e9('0x39')][_0xb2e9('0x3a')]);_0x4f5164[_0xb2e9('0x3f')]=_['keys'](_0xb6a505[_0xb2e9('0x3f')]);_0x4f5164[_0xb2e9('0x42')]=_['intersection'](_0x4f5164[_0xb2e9('0x40')],_0x4f5164[_0xb2e9('0x3f')]);_0x2a8dbc['attributes']=_[_0xb2e9('0x43')](_0x4f5164[_0xb2e9('0x40')],qs[_0xb2e9('0x44')](_0xb6a505[_0xb2e9('0x3f')][_0xb2e9('0x44')]));_0x2a8dbc[_0xb2e9('0x45')]=_0x2a8dbc[_0xb2e9('0x45')][_0xb2e9('0x46')]?_0x2a8dbc['attributes']:_0x4f5164[_0xb2e9('0x40')];if(_0xb6a505[_0xb2e9('0x3f')]['includeAll']){_0x2a8dbc['include']=[{'all':!![]}];}_0x2a8dbc=_[_0xb2e9('0x33')]({},_0x2a8dbc,_0xb6a505['options']);return db[_0xb2e9('0x39')][_0xb2e9('0x47')](_0x2a8dbc)['then'](handleEntityNotFound(_0x8b7807,null))[_0xb2e9('0x18')](respondWithResult(_0x8b7807,null))['catch'](handleError(_0x8b7807,null));};exports[_0xb2e9('0x48')]=function(_0x13b005,_0x4c12b9){return db[_0xb2e9('0x39')][_0xb2e9('0x48')](_0x13b005[_0xb2e9('0x34')],{})[_0xb2e9('0x18')](respondWithResult(_0x4c12b9,0xc9))[_0xb2e9('0x23')](handleError(_0x4c12b9,null));};exports[_0xb2e9('0x2d')]=function(_0x4f2f66,_0x2ea643){if(_0x4f2f66[_0xb2e9('0x34')]['id']){delete _0x4f2f66[_0xb2e9('0x34')]['id'];}return db['ChatInteraction'][_0xb2e9('0x47')]({'where':{'id':_0x4f2f66['params']['id']}})['then'](handleEntityNotFound(_0x2ea643,null))[_0xb2e9('0x18')](saveUpdates(_0x4f2f66['body'],null))[_0xb2e9('0x18')](respondWithResult(_0x2ea643,null))[_0xb2e9('0x23')](handleError(_0x2ea643,null));};exports[_0xb2e9('0x2e')]=function(_0x567068,_0x1de1b4){return db['ChatInteraction'][_0xb2e9('0x47')]({'where':{'id':_0x567068[_0xb2e9('0x49')]['id']}})[_0xb2e9('0x18')](handleEntityNotFound(_0x1de1b4,null))[_0xb2e9('0x18')](removeEntity(_0x1de1b4,null))['catch'](handleError(_0x1de1b4,null));};exports[_0xb2e9('0x4a')]=function(_0x55617b,_0x11ec59){return db[_0xb2e9('0x39')]['describe']()[_0xb2e9('0x18')](respondWithResult(_0x11ec59,null))[_0xb2e9('0x23')](handleError(_0x11ec59,null));};exports[_0xb2e9('0x4b')]=function(_0x34a111,_0x39e289){var _0x3244e5=_0x34a111['params']['id'];var _0xfd36ae;var _0x7b0d00;var _0x459cc6;return db[_0xb2e9('0x39')][_0xb2e9('0x4c')]({'where':{'id':_0x3244e5}})[_0xb2e9('0x18')](function(_0xfbcb2b){_0xfd36ae=_0xfbcb2b;return db[_0xb2e9('0x4d')][_0xb2e9('0x4c')]({'where':{'id':_0xfbcb2b['ChatWebsiteId']},'attributes':['id',_0xb2e9('0x4e'),_0xb2e9('0x4f'),_0xb2e9('0x50'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xb2e9('0x18')](function(_0x3accb8){if(_0x3accb8&&_0x3accb8['vidaooApiKey']&&_0x3accb8[_0xb2e9('0x4f')]){_0x7b0d00=_0x3accb8;var _0x5b3b7d={'interaction':{'id':_0x3244e5},'agent':{'id':_0x34a111['user']['id'],'name':_0x34a111[_0xb2e9('0x51')][_0xb2e9('0x30')],'fullname':_0x34a111['user'][_0xb2e9('0x52')],'email':_0x34a111[_0xb2e9('0x51')][_0xb2e9('0x53')]},'contact':_0x34a111[_0xb2e9('0x34')][_0xb2e9('0x35')],'account':_0x34a111[_0xb2e9('0x34')][_0xb2e9('0x54')]};var _0x35dbcb={'rejectUnauthorized':![],'method':_0xb2e9('0x55'),'url':_0xb2e9('0x56'),'headers':{'X-APIKEY':_0x3accb8[_0xb2e9('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x34a111[_0xb2e9('0x51')]['email']],'buttons':null,'topic':_0x7b0d00[_0xb2e9('0x50')],'note':_[_0xb2e9('0x57')](_0x7b0d00[_0xb2e9('0x58')])?null:getMustacheRender(_0x7b0d00[_0xb2e9('0x58')],_0x5b3b7d),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xb2e9('0x57')](_0x7b0d00[_0xb2e9('0x59')])){var _0xaa2a2e=getMustacheRender(_0x7b0d00['vidaooMetadata'],_0x5b3b7d);var _0x199d4a=JSON[_0xb2e9('0x5a')](_0xaa2a2e);_0x35dbcb[_0xb2e9('0x34')][_0xb2e9('0x5b')]=_0x199d4a;}}catch(_0x642bf4){throw new db[(_0xb2e9('0x5c'))][(_0xb2e9('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35dbcb);}else{throw new db[(_0xb2e9('0x5c'))][(_0xb2e9('0x5d'))](_0xb2e9('0x5e'));}})[_0xb2e9('0x18')](function(_0x558ad0){_0x459cc6=_0x558ad0;if(_0x459cc6['id']){var _0x326f89={'body':_0x459cc6[_0xb2e9('0x5f')],'ChatWebsiteId':_0x7b0d00['id'],'ChatInteractionId':_0xfd36ae['id'],'direction':_0xb2e9('0x60'),'UserId':_0x34a111[_0xb2e9('0x51')]['id']};return db[_0xb2e9('0x61')][_0xb2e9('0x48')](_0x326f89,{});}else{throw new db[(_0xb2e9('0x5c'))]['ValidationError'](_0xb2e9('0x62'));}})['then'](function(){return _0xfd36ae[_0xb2e9('0x63')]({'vidaooSessionId':_0x459cc6['id']});})[_0xb2e9('0x18')](respondWithResult(_0x39e289,null))[_0xb2e9('0x23')](handleError(_0x39e289,null));};exports[_0xb2e9('0x64')]=function(_0x352e92,_0xd1e6c0){if(_0x352e92[_0xb2e9('0x34')]['id']){delete _0x352e92[_0xb2e9('0x34')]['id'];}return db[_0xb2e9('0x39')][_0xb2e9('0x47')]({'where':{'id':_0x352e92['params']['id']},'include':[{'model':db[_0xb2e9('0x65')],'as':_0xb2e9('0x66')}]})[_0xb2e9('0x18')](handleEntityNotFound(_0xd1e6c0,null))[_0xb2e9('0x18')](saveUpdates(_0x352e92[_0xb2e9('0x34')],null))['then'](respondWithResult(_0xd1e6c0,null))[_0xb2e9('0x23')](handleError(_0xd1e6c0,null));};exports['abandon']=function(_0x801a87,_0x373cdc){if(_0x801a87['body']['id']){delete _0x801a87[_0xb2e9('0x34')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x801a87[_0xb2e9('0x49')]['id']}})[_0xb2e9('0x18')](function(_0x344939){if(!_0x344939){logger[_0xb2e9('0x1f')](_0xb2e9('0x67'),_0xb2e9('0x68'),0x194,'entity\x20not\x20found');_0x373cdc[_0xb2e9('0x24')](0x194);}else{if(_0x344939['UserId']){throw new db[(_0xb2e9('0x5c'))][(_0xb2e9('0x5d'))]('Interaction\x20already\x20assigned');}}return _0x344939;})[_0xb2e9('0x18')](function(_0x3ec097){if(_0x3ec097){return _0x3ec097[_0xb2e9('0x2d')]({'closed':_0x801a87[_0xb2e9('0x34')][_0xb2e9('0x69')],'disposition':_0x801a87[_0xb2e9('0x34')]['disposition']})[_0xb2e9('0x18')](function(_0x41420d){return _0x41420d;});}})[_0xb2e9('0x18')](function(){return respondWithRpcPromise(_0xb2e9('0x6a'),_0xb2e9('0x68'),_0x801a87[_0xb2e9('0x34')],client9004);})[_0xb2e9('0x18')](respondWithResult(_0x373cdc,null))[_0xb2e9('0x23')](handleError(_0x373cdc,null));};exports[_0xb2e9('0x6b')]=function(_0x43dc11,_0x4219c0){_0x43dc11['body'][_0xb2e9('0x30')]=_0x43dc11[_0xb2e9('0x6c')][_0xb2e9('0x6d')];_0x43dc11['body'][_0xb2e9('0x6e')]=_0x43dc11[_0xb2e9('0x6c')][_0xb2e9('0x6f')];_0x43dc11[_0xb2e9('0x34')][_0xb2e9('0x3b')]=_0x43dc11['file'][_0xb2e9('0x70')];return db['Attachment'][_0xb2e9('0x48')](_0x43dc11[_0xb2e9('0x34')])[_0xb2e9('0x18')](respondWithResult(_0x4219c0,0xc9))['catch'](handleError(_0x4219c0,null));};exports[_0xb2e9('0x71')]=function(_0x3649d0,_0x3d93c9){return db[_0xb2e9('0x39')][_0xb2e9('0x4c')]({'where':{'id':_0x3649d0[_0xb2e9('0x49')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3d93c9,null))['then'](function(_0x2ce906){if(_0x2ce906){if(_0x2ce906[_0xb2e9('0x69')]){return _0x3d93c9[_0xb2e9('0x25')](0x193)[_0xb2e9('0x26')]({'status':0x193,'message':_0xb2e9('0x72')});}return db[_0xb2e9('0x73')][_0xb2e9('0x4c')]({'where':{'id':_0x3649d0[_0xb2e9('0x3f')][_0xb2e9('0x74')]},'raw':!![]})['then'](handleEntityNotFound(_0x3d93c9,null));}})[_0xb2e9('0x18')](function(_0x4555cc){if(_0x4555cc){var _0x228f63=_0x4555cc['ChatOfflineMessageId']!==null;var _0x6c3b20=path[_0xb2e9('0x75')](config[_0xb2e9('0x76')],_0xb2e9('0x77'));if(_0x228f63){_0x6c3b20=path[_0xb2e9('0x75')](_0x6c3b20,_0xb2e9('0x78'));}var _0x4fd5e1=path['join'](_0x6c3b20,_0x4555cc[_0xb2e9('0x6e')]);return _0x3d93c9[_0xb2e9('0x79')](_0x4fd5e1);}})['catch'](handleError(_0x3d93c9,null));};exports[_0xb2e9('0x7a')]=function(_0x49fac9,_0x9a3c3a){var _0x1b75a4=null;var _0x163ff7=null;var _0x294a34=null;if(_0x49fac9[_0xb2e9('0x34')]['id']){delete _0x49fac9[_0xb2e9('0x34')]['id'];}if(_0x49fac9[_0xb2e9('0x34')][_0xb2e9('0x7b')]){_0x294a34=path[_0xb2e9('0x75')](config['root'],'server/files/chat/upload/',util['format'](_0xb2e9('0x7c'),Date[_0xb2e9('0x7d')]()));_0x49fac9[_0xb2e9('0x34')][_0xb2e9('0x7e')]=_0x294a34;}return db['ChatInteraction'][_0xb2e9('0x47')]({'where':{'id':_0x49fac9['params']['id']},'include':[{'model':db[_0xb2e9('0x61')],'as':_0xb2e9('0x7f'),'include':[{'model':db[_0xb2e9('0x80')],'as':_0xb2e9('0x80')}]}]})[_0xb2e9('0x18')](handleEntityNotFound(_0x9a3c3a,null))[_0xb2e9('0x18')](saveUpdates(_0x49fac9[_0xb2e9('0x34')],null))[_0xb2e9('0x18')](function(_0x3cd648){if(_0x3cd648){_0x1b75a4=_0x3cd648;return db['ChatWebsite'][_0xb2e9('0x47')]({'where':{'id':_0x1b75a4['ChatWebsiteId']}});}})[_0xb2e9('0x18')](function(_0x4ad4b6){if(_0x4ad4b6){_0x163ff7=_0x4ad4b6;return db['CmContact'][_0xb2e9('0x47')]({'where':{'id':_0x1b75a4['ContactId']}});}})[_0xb2e9('0x18')](function(_0x1bc550){if(_0x1bc550){if(_0x294a34){var _0x457cc7=null;for(var _0x463cc5=0x1;_0x463cc5<_0x1b75a4[_0xb2e9('0x7f')][_0xb2e9('0x46')];++_0x463cc5){_0x457cc7=_0x1b75a4[_0xb2e9('0x7f')][_0x463cc5];var _0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?util[_0xb2e9('0x82')](_0xb2e9('0x83'),_0x163ff7[_0xb2e9('0x84')],_0x457cc7['UserId']):'System';var _0x24bff2=_0x49fac9[_0xb2e9('0x34')]['customer']||util['format'](_0xb2e9('0x83'),_0xb2e9('0x85'),_0x457cc7[_0xb2e9('0x86')]);switch(_0x163ff7[_0xb2e9('0x87')]){case _0xb2e9('0x88'):_0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?util[_0xb2e9('0x82')](_0xb2e9('0x83'),_0x163ff7[_0xb2e9('0x84')],_0x457cc7[_0xb2e9('0x81')]):_0xb2e9('0x89');break;case _0xb2e9('0x8a'):_0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?_0x457cc7[_0xb2e9('0x80')][_0xb2e9('0x8b')]||_0x457cc7['User'][_0xb2e9('0x52')]:_0xb2e9('0x89');break;case'agent_fullname':_0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?_0x457cc7['User'][_0xb2e9('0x52')]:_0xb2e9('0x89');break;default:_0x18ba3a=_0x457cc7[_0xb2e9('0x81')]?util[_0xb2e9('0x82')]('%s%d',_0x163ff7[_0xb2e9('0x84')],_0x457cc7['UserId']):_0xb2e9('0x89');}var _0x5e0b7f=util[_0xb2e9('0x82')](_0xb2e9('0x8c'),moment(_0x457cc7[_0xb2e9('0x8d')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x457cc7[_0xb2e9('0x8e')]==='in'?_0x24bff2:_0x18ba3a,_0x457cc7[_0xb2e9('0x34')]);if(!_0x457cc7['secret']){fs[_0xb2e9('0x8f')](_0x294a34,_0x5e0b7f);}}return db[_0xb2e9('0x90')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xb2e9('0x91'),'raw':!![],'include':[{'model':db[_0xb2e9('0x92')],'as':_0xb2e9('0x92'),'raw':!![]}]}]});}}})[_0xb2e9('0x18')](function(_0x30b2b6){if(!_0x30b2b6||!_0x30b2b6[_0xb2e9('0x91')]||!_0x49fac9[_0xb2e9('0x34')])return _0x1b75a4;var _0x2151af=_0x30b2b6[_0xb2e9('0x93')]();return respondWithRpcPromise('SendMail',_0xb2e9('0x94'),{'account':_0x2151af,'message':{'from':util[_0xb2e9('0x82')](_0xb2e9('0x95'),_0x30b2b6[_0xb2e9('0x30')],_0x30b2b6[_0xb2e9('0x53')]||_0x30b2b6[_0xb2e9('0x91')]['user']),'to':_0x49fac9[_0xb2e9('0x34')]['mailTranscript'],'subject':_0xb2e9('0x96'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x49fac9['body'][_0xb2e9('0x7b')]),'attachments':[{'path':_0x294a34}]}})[_0xb2e9('0x18')](function(){return _0x1b75a4;})['catch'](function(_0xb3f0ee){logger['error'](_0xb3f0ee);});})[_0xb2e9('0x18')](respondWithStatusCode(_0x9a3c3a,0xc8))[_0xb2e9('0x23')](handleError(_0x9a3c3a,null));};exports['addMessage']=function(_0x3d455a,_0x28701c){return db[_0xb2e9('0x61')][_0xb2e9('0x47')]({'where':{'id':_0x3d455a[_0xb2e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x28701c,null))[_0xb2e9('0x18')](function(_0x6a34a6){if(_0x6a34a6){return _0x6a34a6[_0xb2e9('0x97')](_0x3d455a['body'][_0xb2e9('0x98')],_[_0xb2e9('0x99')](_0x3d455a[_0xb2e9('0x34')],['ids','id'])||{});}})[_0xb2e9('0x18')](respondWithResult(_0x28701c,null))[_0xb2e9('0x23')](handleError(_0x28701c,null));};exports['getMessages']=function(_0x22bf3e,_0x3b815f){var _0x2f62a3={'raw':![],'where':{}};var _0x5d2e8f={};var _0x56ac35={'count':0x0,'rows':[]};return db[_0xb2e9('0x39')][_0xb2e9('0x4c')]({'where':{'id':_0x22bf3e[_0xb2e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b815f,null))[_0xb2e9('0x18')](function(_0x38741e){if(_0x38741e){_0x5d2e8f['model']=_[_0xb2e9('0x41')](db[_0xb2e9('0x61')][_0xb2e9('0x3a')]);_0x5d2e8f[_0xb2e9('0x3f')]=_[_0xb2e9('0x41')](_0x22bf3e[_0xb2e9('0x3f')]);_0x5d2e8f[_0xb2e9('0x42')]=_[_0xb2e9('0x43')](_0x5d2e8f[_0xb2e9('0x40')],_0x5d2e8f['query']);_0x2f62a3['attributes']=_[_0xb2e9('0x43')](_0x5d2e8f['model'],qs[_0xb2e9('0x44')](_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0x44')]));_0x2f62a3[_0xb2e9('0x45')]=_0x2f62a3['attributes']['length']?_0x2f62a3[_0xb2e9('0x45')]:_0x5d2e8f[_0xb2e9('0x40')];if(!_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0x9a')]('nolimit')){_0x2f62a3[_0xb2e9('0x29')]=qs[_0xb2e9('0x29')](_0x22bf3e[_0xb2e9('0x3f')]['limit']);_0x2f62a3[_0xb2e9('0x27')]=qs['offset'](_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0x27')]);}_0x2f62a3[_0xb2e9('0x9b')]=qs[_0xb2e9('0x9c')](_0x22bf3e[_0xb2e9('0x3f')]['sort']);_0x2f62a3['where']=qs[_0xb2e9('0x42')](_[_0xb2e9('0x9d')](_0x22bf3e['query'],_0x5d2e8f[_0xb2e9('0x42')]));_0x2f62a3[_0xb2e9('0x9e')][_0xb2e9('0x9f')]=_0x38741e['id'];if(_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0xa0')]){_0x2f62a3[_0xb2e9('0x9e')]=_[_0xb2e9('0x33')](_0x2f62a3[_0xb2e9('0x9e')],{'$or':_['map'](_0x2f62a3[_0xb2e9('0x45')],function(_0x314bc1){var _0x11f231={};_0x11f231[_0x314bc1]={'$like':'%'+_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0xa0')]+'%'};return _0x11f231;})});}if(_0x22bf3e['query'][_0xb2e9('0xa1')]){var _0x575132=_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0xa1')][_0xb2e9('0xa2')](',');var _0x34f032={};_0x34f032[_0x575132[0x0]]={'$gte':moment(_0x575132[0x1])[_0xb2e9('0x82')](_0xb2e9('0xa3'))};_0x2f62a3[_0xb2e9('0x9e')]=_[_0xb2e9('0x33')](_0x2f62a3[_0xb2e9('0x9e')],_0x34f032);}_0x2f62a3=_[_0xb2e9('0x33')]({},_0x2f62a3,_0x22bf3e[_0xb2e9('0xa4')]);return db[_0xb2e9('0x61')][_0xb2e9('0x2a')]({'where':_0x2f62a3[_0xb2e9('0x9e')]})[_0xb2e9('0x18')](function(_0x3767ca){_0x56ac35[_0xb2e9('0x2a')]=_0x3767ca;if(_0x22bf3e[_0xb2e9('0x3f')][_0xb2e9('0xa5')]){_0x2f62a3['include']=[{'all':!![]}];}return db[_0xb2e9('0x61')]['findAll'](_0x2f62a3);})['then'](function(_0xf74c0){_0x56ac35['rows']=_0xf74c0;return _0x56ac35;});}})[_0xb2e9('0x18')](respondWithFilteredResult(_0x3b815f,_0x2f62a3))[_0xb2e9('0x23')](handleError(_0x3b815f,null));};exports['getMyMessages']=function(_0x5ddaa6,_0x59bed0){var _0x399b5a={'where':{}},_0x11b7a1={},_0x1cd41a={'count':0x0,'rows':[]};return db[_0xb2e9('0x39')][_0xb2e9('0x4c')]({'where':{'id':_0x5ddaa6[_0xb2e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x59bed0,null))[_0xb2e9('0x18')](function(_0x259588){if(_0x259588){_0x11b7a1[_0xb2e9('0x40')]=_[_0xb2e9('0x41')](db[_0xb2e9('0x61')][_0xb2e9('0x3a')]);_0x11b7a1['query']=_[_0xb2e9('0x41')](_0x5ddaa6[_0xb2e9('0x3f')]);_0x11b7a1[_0xb2e9('0x42')]=_[_0xb2e9('0x43')](_0x11b7a1['model'],_0x11b7a1[_0xb2e9('0x3f')]);_0x399b5a[_0xb2e9('0x45')]=_[_0xb2e9('0x43')](_0x11b7a1[_0xb2e9('0x40')],qs['fields'](_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0x44')]));_0x399b5a['attributes']=_0x399b5a[_0xb2e9('0x45')][_0xb2e9('0x46')]?_0x399b5a[_0xb2e9('0x45')]:_0x11b7a1['model'];if(!_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0x9a')](_0xb2e9('0xa6'))){_0x399b5a[_0xb2e9('0x29')]=qs[_0xb2e9('0x29')](_0x5ddaa6['query'][_0xb2e9('0x29')]);_0x399b5a['offset']=qs[_0xb2e9('0x27')](_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0x27')]);}_0x399b5a[_0xb2e9('0x9b')]=qs[_0xb2e9('0x9c')](_0x5ddaa6['query']['sort']);_0x399b5a['where']=qs[_0xb2e9('0x42')](_['pick'](_0x5ddaa6[_0xb2e9('0x3f')],_0x11b7a1[_0xb2e9('0x42')]));_0x399b5a[_0xb2e9('0x9e')][_0xb2e9('0x9f')]=_0x259588['id'];if(_0x5ddaa6['query'][_0xb2e9('0xa0')]){_0x399b5a[_0xb2e9('0x9e')]=_[_0xb2e9('0x33')](_0x399b5a[_0xb2e9('0x9e')],{'$or':_[_0xb2e9('0x38')](_0x399b5a['attributes'],function(_0x240d39){var _0x4af753={};_0x4af753[_0x240d39]={'$like':'%'+_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0xa0')]+'%'};return _0x4af753;})});}_0x399b5a[_0xb2e9('0x9e')]['secret']=![];if(_0x5ddaa6[_0xb2e9('0x3f')]['id']){_0x399b5a[_0xb2e9('0x9e')]['id']={'$gt':_0x5ddaa6[_0xb2e9('0x3f')]['id']};}_0x399b5a=_['merge']({},_0x399b5a,_0x5ddaa6['options']);return db[_0xb2e9('0x61')][_0xb2e9('0x2a')]({'where':_0x399b5a[_0xb2e9('0x9e')]})['then'](function(_0x2a29bb){_0x1cd41a['count']=_0x2a29bb;_0x399b5a[_0xb2e9('0xa7')]=[];if(_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0xa8')]){_0x399b5a[_0xb2e9('0xa7')][_0xb2e9('0xa9')]({'model':db[_0xb2e9('0x80')],'as':_0xb2e9('0x80'),'attributes':['id','fullname',_0xb2e9('0x8b')]});}if(_0x5ddaa6[_0xb2e9('0x3f')][_0xb2e9('0xa5')]){_0x399b5a[_0xb2e9('0xa7')]=[{'all':!![]}];}return db['ChatMessage'][_0xb2e9('0x3d')](_0x399b5a);})['then'](function(_0x2f6394){_0x1cd41a[_0xb2e9('0xaa')]=_0x2f6394;return _0x1cd41a;});}})[_0xb2e9('0x18')](respondWithFilteredResult(_0x59bed0,_0x399b5a))[_0xb2e9('0x23')](handleError(_0x59bed0,null));};exports[_0xb2e9('0xab')]=function(_0x170022,_0x22c476){return db[_0xb2e9('0x39')]['find']({'where':{'id':_0x170022['params']['id']}})[_0xb2e9('0x18')](handleEntityNotFound(_0x22c476,null))[_0xb2e9('0x18')](function(_0x55923c){if(_0x55923c){return _0x55923c[_0xb2e9('0xac')](_0x170022[_0xb2e9('0x34')][_0xb2e9('0x98')],_['omit'](_0x170022[_0xb2e9('0x34')],[_0xb2e9('0x98'),'id'])||{})[_0xb2e9('0xad')](function(){return db[_0xb2e9('0xae')][_0xb2e9('0x3d')]({'attributes':['id',_0xb2e9('0x30'),_0xb2e9('0xaf')],'where':{'id':_0x170022[_0xb2e9('0x34')]['ids']}});})[_0xb2e9('0x18')](function(_0x302114){socket[_0xb2e9('0xb0')](_0xb2e9('0xb1'),{'id':Number(_0x170022[_0xb2e9('0x49')]['id']),'tags':_0x302114||[]});return{'id':Number(_0x170022['params']['id']),'tags':_0x302114||[]};});}})[_0xb2e9('0x18')](respondWithResult(_0x22c476,null))[_0xb2e9('0x23')](handleError(_0x22c476,null));};exports[_0xb2e9('0xb2')]=function(_0x552e8a,_0x950e56){return db[_0xb2e9('0x39')][_0xb2e9('0x47')]({'where':{'id':_0x552e8a[_0xb2e9('0x49')]['id']}})[_0xb2e9('0x18')](handleEntityNotFound(_0x950e56,null))['then'](function(_0xc09714){if(_0xc09714){return _0xc09714[_0xb2e9('0xb2')](_0x552e8a[_0xb2e9('0x3f')][_0xb2e9('0x98')]);}})[_0xb2e9('0x18')](respondWithStatusCode(_0x950e56,null))[_0xb2e9('0x23')](handleError(_0x950e56,null));};exports[_0xb2e9('0x79')]=function(_0x24b5dd,_0x4e4bf3){var _0x174740=moment()[_0xb2e9('0xb3')]()[_0xb2e9('0xb4')]();var _0x13178a=path[_0xb2e9('0x75')](config[_0xb2e9('0x76')],_0xb2e9('0xb5'),_0xb2e9('0xb6'),_0xb2e9('0xb7'));var _0x2bbcb9=path[_0xb2e9('0x75')](config[_0xb2e9('0x76')],_0xb2e9('0xb5'),_0xb2e9('0xb6'),_0xb2e9('0xb8'));var _0xec07ae=path[_0xb2e9('0x75')](_0x13178a,_0x174740);var _0x4f763b=util[_0xb2e9('0x82')]('transcript-%d-%s.zip',_0x24b5dd[_0xb2e9('0x49')]['id'],_0x174740);var _0x12b98=path[_0xb2e9('0x75')](_0x13178a,_0x4f763b);var _0x114401=[];_0x114401['push']({'model':db[_0xb2e9('0x80')],'as':_0xb2e9('0x80'),'attributes':['id',_0xb2e9('0x52')],'raw':!![]});_0x114401[_0xb2e9('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xb2e9('0xb9'),_0xb2e9('0xba')],'raw':!![]});if(_0x24b5dd[_0xb2e9('0x3f')][_0xb2e9('0xb8')]){_0x114401['push']({'model':db[_0xb2e9('0x73')],'as':'Attachment','raw':!![]});}var _0x318619=[{'model':db[_0xb2e9('0x61')],'as':'Messages','attributes':['id',_0xb2e9('0x34'),_0xb2e9('0x8d'),_0xb2e9('0x8e'),_0xb2e9('0xbb'),_0xb2e9('0xbc')],'include':_0x114401}];_0x318619[_0xb2e9('0xa9')]({'model':db[_0xb2e9('0x4d')],'as':_0xb2e9('0xbd'),'attributes':['id',_0xb2e9('0x30')]});_0x318619[_0xb2e9('0xa9')]({'model':db[_0xb2e9('0x80')],'as':'Owner','attributes':['id',_0xb2e9('0x52')]});return db[_0xb2e9('0x39')]['find']({'where':{'id':_0x24b5dd[_0xb2e9('0x49')]['id']},'include':_0x318619})[_0xb2e9('0x18')](handleEntityNotFound(_0x4e4bf3,null))[_0xb2e9('0x18')](function(_0x23455b){if(_0x23455b){var _0x283c89=_0x23455b[_0xb2e9('0xbe')]({'plain':!![]});fs[_0xb2e9('0xbf')](_0xec07ae);var _0xdc8a07={'channel':_0xb2e9('0xc0'),'account':_0x283c89[_0xb2e9('0xbd')][_0xb2e9('0x30')],'agent':_0x283c89[_0xb2e9('0xc1')]?_0x283c89[_0xb2e9('0xc1')][_0xb2e9('0x52')]:_0xb2e9('0xc2'),'createdAt':moment(_0x283c89[_0xb2e9('0x8d')])[_0xb2e9('0x82')](_0xb2e9('0xa3'))['toString'](),'closedAt':_0x283c89[_0xb2e9('0x69')]?moment(_0x283c89['closedAt'])[_0xb2e9('0x82')](_0xb2e9('0xa3'))[_0xb2e9('0xb4')]():'','disposition':_0x283c89[_0xb2e9('0xc3')],'chatInfo':{'browser':_0x283c89[_0xb2e9('0xc4')],'os':_0x283c89['osName'],'referer':_0x283c89[_0xb2e9('0xc5')],'customerIp':_0x283c89[_0xb2e9('0xc6')],'customerPort':_0x283c89['customerPort']?_0x283c89[_0xb2e9('0xc7')]:_0xb2e9('0xc2')},'messages':_(_0x283c89[_0xb2e9('0x7f')])[_0xb2e9('0xc8')]()[_0xb2e9('0xa0')]({'secret':![]})[_0xb2e9('0x38')](function(_0x750ada){if(_0x750ada['Attachment']){var _0x173c39=path[_0xb2e9('0x75')](_0x2bbcb9,_0x750ada[_0xb2e9('0x73')]['basename']);if(fs[_0xb2e9('0xc9')](_0x173c39)){fs[_0xb2e9('0xca')](_0x173c39)[_0xb2e9('0xcb')](fs['createWriteStream'](path[_0xb2e9('0x75')](_0xec07ae,_0x750ada[_0xb2e9('0x73')][_0xb2e9('0x6e')])));}}return{'date':moment(_0x750ada[_0xb2e9('0x8d')])[_0xb2e9('0x82')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb2e9('0xb4')](),'sender':_0x750ada['direction']==='out'?_0x750ada[_0xb2e9('0x80')]?_0x750ada[_0xb2e9('0x80')][_0xb2e9('0x52')]:_0xb2e9('0x89'):_0x750ada[_0xb2e9('0x66')][_0xb2e9('0xb9')]+(_0x750ada[_0xb2e9('0x66')][_0xb2e9('0xba')]?'\x20'+_0x750ada[_0xb2e9('0x66')][_0xb2e9('0xba')]:''),'body':_0x750ada['Attachment']?_0x750ada['Attachment'][_0xb2e9('0x6e')]:_0x750ada['body'],'direction':_0x750ada[_0xb2e9('0x8e')]===_0xb2e9('0x60')?'A':'C','secret':_0x750ada[_0xb2e9('0xbb')],'read':_0x750ada['read'],'attachment':_0x750ada['Attachment']};})['value']()};return ejs[_0xb2e9('0xcc')](path[_0xb2e9('0x75')](config[_0xb2e9('0x76')],_0xb2e9('0xb5'),_0xb2e9('0xcd'),_0xb2e9('0xce')),{'interaction':_0xdc8a07})[_0xb2e9('0x18')](function(_0x425ccc){var _0x268102=path[_0xb2e9('0x75')](_0xec07ae,_0xb2e9('0xcf')+_0x283c89['id']+'-'+_0x174740+_0xb2e9('0xd0'));var _0x954165={'path':_0x268102,'channel':_0xb2e9('0xc0'),'interactionId':_0x283c89['id']};return pdf[_0xb2e9('0xd1')](_0x425ccc,_0x954165);})[_0xb2e9('0x18')](function(){return new Promise(function(_0xfbea79,_0x2d9b98){zipdir(_0xec07ae,{'saveTo':_0x12b98},function(_0x3d7ba1,_0x358925){if(_0x3d7ba1)return _0x2d9b98(_0x3d7ba1);return _0xfbea79(_0x358925);});})[_0xb2e9('0x18')](function(){return new BPromise(function(_0x299d57,_0x454325){rimraf(_0xec07ae,function(_0x4841be){if(_0x4841be)_0x454325(_0x4841be);return _0x299d57();});});})[_0xb2e9('0x18')](function(){return _0x4e4bf3[_0xb2e9('0x79')](_0x12b98,_0x4f763b,function(_0x2e9e7c){if(_0x2e9e7c){logger[_0xb2e9('0x1f')](_0xb2e9('0xd2'),_0x2e9e7c);}else{fs['unlinkSync'](_0x12b98);}});});});}else{return _0x4e4bf3[_0xb2e9('0x24')](0xc8);}})[_0xb2e9('0x23')](handleError(_0x4e4bf3,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 01d2b30..deab900 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 _0x61f6=['update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0x61f6,0x10b));var _0x661f=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x61f6[_0x307bf6];return _0x2878fc;};'use strict';var EventEmitter=require(_0x661f('0x0'));var ChatInteraction=require(_0x661f('0x1'))['db'][_0x661f('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x661f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x661f('0x4'),'afterUpdate':_0x661f('0x5'),'afterDestroy':_0x661f('0x6')};function emitEvent(_0xf53fa3){return function(_0x17af9d,_0x479257,_0x4b8bf4){_0x17af9d[_0x661f('0x7')]({'attributes':['id'],'raw':!![]})[_0x661f('0x8')](function(_0x11bc95){_0x17af9d[_0x661f('0x9')]('Users',_0x11bc95[_0x661f('0xa')](function(_0x182136){return{'id':_0x182136['id']};}));return ChatMessage[_0x661f('0xb')]({'where':{'ChatInteractionId':_0x17af9d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x661f('0x8')](function(_0x1c0881){_0x17af9d[_0x661f('0x9')](_0x661f('0xc'),_0x1c0881['length']);ChatInteractionEvents[_0x661f('0xd')](_0xf53fa3+':'+_0x17af9d['id'],_0x17af9d);ChatInteractionEvents[_0x661f('0xd')](_0xf53fa3,_0x17af9d);_0x4b8bf4(null);})[_0x661f('0xe')](_0x4b8bf4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x661f('0xf')](e,emitEvent(event));}}module[_0x661f('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x8a9d=['hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','then','setDataValue','findAll','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a9d,0x162));var _0xd8a9=function(_0x4250b4,_0x3fd543){_0x4250b4=_0x4250b4-0x0;var _0x8a4807=_0x8a9d[_0x4250b4];return _0x8a4807;};'use strict';var EventEmitter=require(_0xd8a9('0x0'));var ChatInteraction=require(_0xd8a9('0x1'))['db'][_0xd8a9('0x2')];var ChatMessage=require(_0xd8a9('0x1'))['db'][_0xd8a9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xd8a9('0x4')](0x0);var events={'afterCreate':_0xd8a9('0x5'),'afterUpdate':'update','afterDestroy':_0xd8a9('0x6')};function emitEvent(_0x2b0e2a){return function(_0x153529,_0x3d24b7,_0x18d4eb){_0x153529['getUsers']({'attributes':['id'],'raw':!![]})[_0xd8a9('0x7')](function(_0x14351d){_0x153529[_0xd8a9('0x8')]('Users',_0x14351d['map'](function(_0x311012){return{'id':_0x311012['id']};}));return ChatMessage[_0xd8a9('0x9')]({'where':{'ChatInteractionId':_0x153529['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd8a9('0x7')](function(_0x3294dd){_0x153529[_0xd8a9('0x8')](_0xd8a9('0xa'),_0x3294dd['length']);ChatInteractionEvents[_0xd8a9('0xb')](_0x2b0e2a+':'+_0x153529['id'],_0x153529);ChatInteractionEvents[_0xd8a9('0xb')](_0x2b0e2a,_0x153529);_0x18d4eb(null);})[_0xd8a9('0xc')](_0x18d4eb(null));};}for(var e in events){if(events[_0xd8a9('0xd')](e)){var event=events[e];ChatInteraction[_0xd8a9('0xe')](e,emitEvent(event));}}module[_0xd8a9('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c41deda..4846e76 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 _0x0463=['../../config/environment','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1fe7bf,_0x24493f){var _0x340e1f=function(_0x4e13df){while(--_0x4e13df){_0x1fe7bf['push'](_0x1fe7bf['shift']());}};_0x340e1f(++_0x24493f);}(_0x0463,0x114));var _0x3046=function(_0x4ff41b,_0x434fa6){_0x4ff41b=_0x4ff41b-0x0;var _0x188ea0=_0x0463[_0x4ff41b];return _0x188ea0;};'use strict';var _=require(_0x3046('0x0'));var util=require(_0x3046('0x1'));var logger=require(_0x3046('0x2'))(_0x3046('0x3'));var moment=require(_0x3046('0x4'));var BPromise=require(_0x3046('0x5'));var rp=require(_0x3046('0x6'));var fs=require('fs');var path=require(_0x3046('0x7'));var rimraf=require(_0x3046('0x8'));var config=require(_0x3046('0x9'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0xdb6961,_0x814e58){return _0xdb6961['define'](_0x3046('0xa'),attributes,{'tableName':_0x3046('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x18a418,_0x123c4e,_0x27405d){if(_0x18a418[_0x3046('0xc')](_0x3046('0xd'))){_0x18a418[_0x3046('0xe')]=moment()[_0x3046('0xf')](_0x3046('0x10'));}_0x27405d(null,_0x18a418);}},'charset':_0x3046('0x11'),'collate':_0x3046('0x12')});};
\ No newline at end of file
+var _0xbb38=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4'];(function(_0x22b0cb,_0x5a764a){var _0x444178=function(_0x5aed3d){while(--_0x5aed3d){_0x22b0cb['push'](_0x22b0cb['shift']());}};_0x444178(++_0x5a764a);}(_0xbb38,0x177));var _0x8bb3=function(_0x1c8c07,_0x2579af){_0x1c8c07=_0x1c8c07-0x0;var _0x4aa88f=_0xbb38[_0x1c8c07];return _0x4aa88f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8bb3('0x0'));var BPromise=require(_0x8bb3('0x1'));var rp=require(_0x8bb3('0x2'));var fs=require('fs');var path=require(_0x8bb3('0x3'));var rimraf=require(_0x8bb3('0x4'));var config=require(_0x8bb3('0x5'));var attributes=require(_0x8bb3('0x6'));module['exports']=function(_0x3bfa50,_0x5efe7e){return _0x3bfa50[_0x8bb3('0x7')](_0x8bb3('0x8'),attributes,{'tableName':_0x8bb3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50c67d,_0x2acbe3,_0x31547b){if(_0x50c67d[_0x8bb3('0xa')](_0x8bb3('0xb'))){_0x50c67d[_0x8bb3('0xc')]=moment()[_0x8bb3('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31547b(null,_0x50c67d);}},'charset':_0x8bb3('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 80fb47b..d5cc615 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 _0xa720=['../../config/environment','client','http','redis','defaults','socket.io-emitter','register','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','UpdateChatInteraction','update','body','options','raw','where','limit','catch','AddTagsToChatInteraction','find','addTags','omit','ids','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0xa720,0x122));var _0x0a72=function(_0x49d3f0,_0x1391d0){_0x49d3f0=_0x49d3f0-0x0;var _0x2539b7=_0xa720[_0x49d3f0];return _0x2539b7;};'use strict';var _=require(_0x0a72('0x0'));var util=require(_0x0a72('0x1'));var moment=require(_0x0a72('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a72('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a72('0x4'))['db'];var utils=require(_0x0a72('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a72('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0a72('0x7')][_0x0a72('0x8')]({'port':0x232a});config[_0x0a72('0x9')]=_[_0x0a72('0xa')](config[_0x0a72('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a72('0xb'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x0a72('0xc')](socket);function respondWithRpcPromise(_0x16a420,_0x447b1f,_0x1f0609){return new BPromise(function(_0x2615f2,_0x13ea23){return client['request'](_0x16a420,_0x1f0609)[_0x0a72('0xd')](function(_0x47afa5){logger[_0x0a72('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x447b1f,'request\x20sent');logger[_0x0a72('0xf')](_0x0a72('0x10'),_0x447b1f,_0x0a72('0x11'),JSON[_0x0a72('0x12')](_0x47afa5));if(_0x47afa5['error']){if(_0x47afa5[_0x0a72('0x13')][_0x0a72('0x14')]===0x1f4){logger[_0x0a72('0x13')](_0x0a72('0x15'),_0x447b1f,_0x47afa5['error']['message']);return _0x13ea23(_0x47afa5[_0x0a72('0x13')][_0x0a72('0x16')]);}logger['error'](_0x0a72('0x15'),_0x447b1f,_0x47afa5[_0x0a72('0x13')][_0x0a72('0x16')]);return _0x2615f2(_0x47afa5[_0x0a72('0x13')][_0x0a72('0x16')]);}else{logger['info'](_0x0a72('0x15'),_0x447b1f,_0x0a72('0x11'));_0x2615f2(_0x47afa5['result']['message']);}})['catch'](function(_0x4e6740){logger['error'](_0x0a72('0x15'),_0x447b1f,_0x4e6740);_0x13ea23(_0x4e6740);});});}exports[_0x0a72('0x17')]=function(_0x2930ce){var _0x53afa4=this;return new Promise(function(_0x24f9a9,_0x4a957c){return db['ChatInteraction'][_0x0a72('0x18')](_0x2930ce[_0x0a72('0x19')],{'raw':_0x2930ce['options']?_0x2930ce[_0x0a72('0x1a')][_0x0a72('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2930ce['options']?_0x2930ce['options'][_0x0a72('0x1c')]||null:null,'attributes':_0x2930ce[_0x0a72('0x1a')]?_0x2930ce['options']['attributes']||null:null,'limit':_0x2930ce['options']?_0x2930ce['options'][_0x0a72('0x1d')]||null:null})[_0x0a72('0xd')](function(_0xca99a7){logger[_0x0a72('0xe')](_0x0a72('0x17'),_0x2930ce);logger[_0x0a72('0xf')](_0x0a72('0x17'),_0x2930ce,JSON[_0x0a72('0x12')](_0xca99a7));_0x24f9a9(_0xca99a7);})[_0x0a72('0x1e')](function(_0x4e8f23){logger[_0x0a72('0x13')](_0x0a72('0x17'),_0x4e8f23[_0x0a72('0x16')],_0x2930ce);_0x4a957c(_0x53afa4['error'](0x1f4,_0x4e8f23[_0x0a72('0x16')]));});});};exports[_0x0a72('0x1f')]=function(_0x548773){return new Promise(function(_0x5ded43,_0x5627a4){return db['ChatInteraction'][_0x0a72('0x20')]({'where':_0x548773[_0x0a72('0x1a')]?_0x548773[_0x0a72('0x1a')][_0x0a72('0x1c')]||null:null})[_0x0a72('0xd')](function(_0x1f128c){if(_0x1f128c){return _0x1f128c[_0x0a72('0x21')](_0x548773[_0x0a72('0x19')]['ids'],_[_0x0a72('0x22')](_0x548773['body'],[_0x0a72('0x23'),'id'])||{});}})['spread'](function(_0x23530f){logger[_0x0a72('0xe')](_0x0a72('0x24'),_0x548773);logger[_0x0a72('0xf')](_0x0a72('0x24'),_0x548773,JSON[_0x0a72('0x12')](_0x23530f));_0x5ded43(_0x23530f);})[_0x0a72('0x1e')](function(_0x6c3d66){logger[_0x0a72('0x13')](_0x0a72('0x24'),_0x6c3d66['message'],_0x548773);_0x5627a4(_this[_0x0a72('0x13')](0x1f4,_0x6c3d66[_0x0a72('0x16')]));});});};
\ No newline at end of file
+var _0x786f=['info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then'];(function(_0x2b74c8,_0x82f97f){var _0x339692=function(_0x5d07f4){while(--_0x5d07f4){_0x2b74c8['push'](_0x2b74c8['shift']());}};_0x339692(++_0x82f97f);}(_0x786f,0x9c));var _0xf786=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x786f[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0xf786('0x0'));var util=require(_0xf786('0x1'));var moment=require(_0xf786('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf786('0x3'));var db=require(_0xf786('0x4'))['db'];var utils=require(_0xf786('0x5'));var logger=require(_0xf786('0x6'))(_0xf786('0x7'));var config=require(_0xf786('0x8'));var jayson=require(_0xf786('0x9'));var client=jayson[_0xf786('0xa')][_0xf786('0xb')]({'port':0x232a});config[_0xf786('0xc')]=_[_0xf786('0xd')](config[_0xf786('0xc')],{'host':_0xf786('0xe'),'port':0x18eb});var socket=require(_0xf786('0xf'))(new Redis(config[_0xf786('0xc')]));require(_0xf786('0x10'))[_0xf786('0x11')](socket);function respondWithRpcPromise(_0x4340c2,_0xbd312,_0x48d823){return new BPromise(function(_0x444796,_0x2ec530){return client[_0xf786('0x12')](_0x4340c2,_0x48d823)[_0xf786('0x13')](function(_0x2c3b55){logger[_0xf786('0x14')](_0xf786('0x15'),_0xbd312,'request\x20sent');logger[_0xf786('0x16')](_0xf786('0x17'),_0xbd312,'request\x20sent',JSON[_0xf786('0x18')](_0x2c3b55));if(_0x2c3b55[_0xf786('0x19')]){if(_0x2c3b55[_0xf786('0x19')]['code']===0x1f4){logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x2c3b55[_0xf786('0x19')]['message']);return _0x2ec530(_0x2c3b55[_0xf786('0x19')][_0xf786('0x1a')]);}logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x2c3b55[_0xf786('0x19')]['message']);return _0x444796(_0x2c3b55[_0xf786('0x19')]['message']);}else{logger[_0xf786('0x14')](_0xf786('0x15'),_0xbd312,'request\x20sent');_0x444796(_0x2c3b55['result'][_0xf786('0x1a')]);}})['catch'](function(_0x12bd62){logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x12bd62);_0x2ec530(_0x12bd62);});});}exports[_0xf786('0x1b')]=function(_0x47d546){var _0x126d59=this;return new Promise(function(_0x34bd2f,_0x1345ee){return db[_0xf786('0x1c')][_0xf786('0x1d')](_0x47d546[_0xf786('0x1e')],{'raw':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x21')]||null:null,'attributes':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x22')]||null:null,'limit':_0x47d546[_0xf786('0x1f')]?_0x47d546[_0xf786('0x1f')][_0xf786('0x23')]||null:null})[_0xf786('0x13')](function(_0x3dfb89){logger[_0xf786('0x14')](_0xf786('0x1b'),_0x47d546);logger['debug'](_0xf786('0x1b'),_0x47d546,JSON[_0xf786('0x18')](_0x3dfb89));_0x34bd2f(_0x3dfb89);})[_0xf786('0x24')](function(_0x4c19b9){logger['error'](_0xf786('0x1b'),_0x4c19b9[_0xf786('0x1a')],_0x47d546);_0x1345ee(_0x126d59['error'](0x1f4,_0x4c19b9[_0xf786('0x1a')]));});});};exports[_0xf786('0x25')]=function(_0x1dae8d){return new Promise(function(_0x525e8f,_0x4d6f69){return db['ChatInteraction'][_0xf786('0x26')]({'where':_0x1dae8d['options']?_0x1dae8d[_0xf786('0x1f')][_0xf786('0x21')]||null:null})[_0xf786('0x13')](function(_0x564d11){if(_0x564d11){return _0x564d11[_0xf786('0x27')](_0x1dae8d[_0xf786('0x1e')][_0xf786('0x28')],_[_0xf786('0x29')](_0x1dae8d[_0xf786('0x1e')],['ids','id'])||{});}})[_0xf786('0x2a')](function(_0x24146c){logger['info'](_0xf786('0x2b'),_0x1dae8d);logger[_0xf786('0x16')](_0xf786('0x2b'),_0x1dae8d,JSON[_0xf786('0x18')](_0x24146c));_0x525e8f(_0x24146c);})[_0xf786('0x24')](function(_0x21eafb){logger[_0xf786('0x19')](_0xf786('0x2b'),_0x21eafb[_0xf786('0x1a')],_0x1dae8d);_0x4d6f69(_this[_0xf786('0x19')](0x1f4,_0x21eafb['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 14ce563..2110e44 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 _0x6732=['./chatInteraction.events','save','remove','update','length','chatInteraction:'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x2673('0x0'));var events=[_0x2673('0x1'),_0x2673('0x2'),_0x2673('0x3')];function createListener(_0x56629a,_0x3b698e){return function(_0x36e1ba){_0x3b698e['emit'](_0x56629a,_0x36e1ba);};}function removeListener(_0xfef746,_0x3ac2c4){return function(){ChatInteractionEvents['removeListener'](_0xfef746,_0x3ac2c4);};}exports['register']=function(_0x90d6e5){for(var _0x2ec408=0x0,_0x513795=events[_0x2673('0x4')];_0x2ec408<_0x513795;_0x2ec408++){var _0x5fe50=events[_0x2ec408];var _0xc1ed83=createListener(_0x2673('0x5')+_0x5fe50,_0x90d6e5);ChatInteractionEvents['on'](_0x5fe50,_0xc1ed83);}};
\ No newline at end of file
+var _0x8388=['update','emit','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x8388,0x18d));var _0x8838=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x8388[_0x1057a3];return _0x131cdb;};'use strict';var ChatInteractionEvents=require(_0x8838('0x0'));var events=[_0x8838('0x1'),_0x8838('0x2'),_0x8838('0x3')];function createListener(_0x5307bd,_0x140ee6){return function(_0x3dbcd4){_0x140ee6[_0x8838('0x4')](_0x5307bd,_0x3dbcd4);};}function removeListener(_0x20a813,_0xd474f2){return function(){ChatInteractionEvents['removeListener'](_0x20a813,_0xd474f2);};}exports[_0x8838('0x5')]=function(_0x471568){for(var _0x49cac2=0x0,_0xca2d0f=events[_0x8838('0x6')];_0x49cac2<_0xca2d0f;_0x49cac2++){var _0x27707c=events[_0x49cac2];var _0x56596f=createListener(_0x8838('0x7')+_0x27707c,_0x471568);ChatInteractionEvents['on'](_0x27707c,_0x56596f);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 780d8d4..44f4111 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 _0x736d=['attachmentUpload','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file'];(function(_0x1f26fe,_0x7a66b8){var _0x14a6b3=function(_0x1c5e15){while(--_0x1c5e15){_0x1f26fe['push'](_0x1f26fe['shift']());}};_0x14a6b3(++_0x7a66b8);}(_0x736d,0x7b));var _0xd736=function(_0x2db472,_0x491e06){_0x2db472=_0x2db472-0x0;var _0x54c245=_0x736d[_0x2db472];return _0x54c245;};'use strict';var multer=require(_0xd736('0x0'));var util=require(_0xd736('0x1'));var path=require(_0xd736('0x2'));var timeout=require(_0xd736('0x3'));var express=require(_0xd736('0x4'));var router=express[_0xd736('0x5')]();var fs_extra=require(_0xd736('0x6'));var auth=require(_0xd736('0x7'));var interaction=require(_0xd736('0x8'));var config=require(_0xd736('0x9'));var controller=require(_0xd736('0xa'));router[_0xd736('0xb')]('/',auth[_0xd736('0xc')](),controller[_0xd736('0xd')]);router[_0xd736('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xd736('0xe')]);router[_0xd736('0xb')](_0xd736('0xf'),auth[_0xd736('0x10')](),controller['show']);router[_0xd736('0xb')]('/:id/attachment_download',auth[_0xd736('0x10')](),controller[_0xd736('0x11')]);router['get'](_0xd736('0x12'),auth['isAuthenticated'](),controller[_0xd736('0x13')]);router[_0xd736('0xb')]('/:id/my_messages',auth[_0xd736('0x10')](),controller['getMyMessages']);router[_0xd736('0xb')](_0xd736('0x14'),auth[_0xd736('0xc')](),controller[_0xd736('0x15')]);router[_0xd736('0x16')]('/',auth[_0xd736('0xc')](),controller[_0xd736('0x17')]);router['post'](_0xd736('0x18'),auth['isAuthenticated'](),controller[_0xd736('0x19')]);var upload=multer({'storage':multer[_0xd736('0x1a')]({'destination':function(_0x2fccd4,_0x7f6cb4,_0x46ba24){_0x46ba24(null,path[_0xd736('0x1b')](config['root'],'server/files/attachments/'));},'filename':function(_0x2b610a,_0x3cd6bd,_0x446249){_0x446249(null,util[_0xd736('0x1c')](_0xd736('0x1d'),Date[_0xd736('0x1e')](),_0x3cd6bd[_0xd736('0x1f')][_0xd736('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xd736('0x21'),upload[_0xd736('0x22')](_0xd736('0x23')),controller[_0xd736('0x24')]);router['post'](_0xd736('0x12'),auth[_0xd736('0x10')](),controller['addMessage']);router[_0xd736('0x16')]('/:id/tags',auth[_0xd736('0xc')](),interaction[_0xd736('0x25')](_0xd736('0x26'),_0xd736('0x27')),controller['addTags']);router[_0xd736('0x28')](_0xd736('0xf'),auth[_0xd736('0xc')](),interaction[_0xd736('0x25')](_0xd736('0x26'),_0xd736('0x29')),controller[_0xd736('0x2a')]);router['put'](_0xd736('0x2b'),controller[_0xd736('0x2c')]);router[_0xd736('0x28')]('/:id/abandon',auth[_0xd736('0x10')](),controller[_0xd736('0x2d')]);router[_0xd736('0x28')](_0xd736('0x2e'),controller[_0xd736('0x2f')]);router['delete']('/:id',auth[_0xd736('0xc')](),interaction[_0xd736('0x25')](_0xd736('0x26'),_0xd736('0x30')),controller[_0xd736('0x31')]);router[_0xd736('0x32')](_0xd736('0x33'),auth[_0xd736('0xc')](),controller[_0xd736('0x34')]);module['exports']=router;
\ No newline at end of file
+var _0x0c99=['diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','create','post','/:id/vidaoo','createVidaooSession'];(function(_0x2529a6,_0x45598a){var _0x515326=function(_0xf5824b){while(--_0xf5824b){_0x2529a6['push'](_0x2529a6['shift']());}};_0x515326(++_0x45598a);}(_0x0c99,0x8a));var _0x90c9=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0x0c99[_0x5951e8];return _0x20a1f5;};'use strict';var multer=require(_0x90c9('0x0'));var util=require(_0x90c9('0x1'));var path=require(_0x90c9('0x2'));var timeout=require(_0x90c9('0x3'));var express=require(_0x90c9('0x4'));var router=express[_0x90c9('0x5')]();var fs_extra=require(_0x90c9('0x6'));var auth=require(_0x90c9('0x7'));var interaction=require(_0x90c9('0x8'));var config=require(_0x90c9('0x9'));var controller=require('./chatInteraction.controller');router[_0x90c9('0xa')]('/',auth[_0x90c9('0xb')](),controller[_0x90c9('0xc')]);router[_0x90c9('0xa')](_0x90c9('0xd'),auth[_0x90c9('0xb')](),controller['describe']);router[_0x90c9('0xa')](_0x90c9('0xe'),auth[_0x90c9('0xf')](),controller[_0x90c9('0x10')]);router[_0x90c9('0xa')](_0x90c9('0x11'),auth[_0x90c9('0xf')](),controller[_0x90c9('0x12')]);router[_0x90c9('0xa')](_0x90c9('0x13'),auth[_0x90c9('0xb')](),controller[_0x90c9('0x14')]);router['get']('/:id/my_messages',auth[_0x90c9('0xf')](),controller[_0x90c9('0x15')]);router[_0x90c9('0xa')](_0x90c9('0x16'),auth[_0x90c9('0xb')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x90c9('0x17')]);router[_0x90c9('0x18')](_0x90c9('0x19'),auth['isAuthenticated'](),controller[_0x90c9('0x1a')]);var upload=multer({'storage':multer[_0x90c9('0x1b')]({'destination':function(_0x1c8faa,_0x44f184,_0x40aa87){_0x40aa87(null,path[_0x90c9('0x1c')](config['root'],_0x90c9('0x1d')));},'filename':function(_0xddd9f1,_0x410920,_0x16fb6f){_0x16fb6f(null,util[_0x90c9('0x1e')](_0x90c9('0x1f'),Date[_0x90c9('0x20')](),_0x410920[_0x90c9('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x90c9('0x18')](_0x90c9('0x22'),upload[_0x90c9('0x23')]('file'),controller[_0x90c9('0x24')]);router[_0x90c9('0x18')](_0x90c9('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x90c9('0x25')]);router[_0x90c9('0x18')]('/:id/tags',auth[_0x90c9('0xb')](),interaction[_0x90c9('0x26')](_0x90c9('0x27'),_0x90c9('0x28')),controller['addTags']);router[_0x90c9('0x29')]('/:id',auth['isAuthenticated'](),interaction[_0x90c9('0x26')](_0x90c9('0x27'),_0x90c9('0x2a')),controller[_0x90c9('0x2b')]);router[_0x90c9('0x29')]('/:id/custom_update',controller[_0x90c9('0x2c')]);router[_0x90c9('0x29')](_0x90c9('0x2d'),auth[_0x90c9('0xf')](),controller[_0x90c9('0x2e')]);router[_0x90c9('0x29')](_0x90c9('0x2f'),controller[_0x90c9('0x30')]);router[_0x90c9('0x31')](_0x90c9('0xe'),auth[_0x90c9('0xb')](),interaction['tracked'](_0x90c9('0x27'),_0x90c9('0x32')),controller[_0x90c9('0x33')]);router[_0x90c9('0x31')](_0x90c9('0x34'),auth[_0x90c9('0xb')](),controller[_0x90c9('0x35')]);module[_0x90c9('0x36')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 52d4095..0d9d6c4 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 _0x3b70=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x3b70,0x1bb));var _0x03b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3b70[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x03b7('0x0'));module[_0x03b7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x03b7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x03b7('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x03b7('0x4')]}};
\ No newline at end of file
+var _0x6866=['BOOLEAN','sequelize','medium'];(function(_0x5e92b6,_0x23219a){var _0x487171=function(_0x1ac1dc){while(--_0x1ac1dc){_0x5e92b6['push'](_0x5e92b6['shift']());}};_0x487171(++_0x23219a);}(_0x6866,0x14e));var _0x6686=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x6866[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x6686('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x6686('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6686('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 50a9000..b8605df 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 _0x86a0=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','destroy','find','describe','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','length','resourceId','push','messages','FromId','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x3f0db3,_0x601ff9){var _0x3e10b7=function(_0x158db9){while(--_0x158db9){_0x3f0db3['push'](_0x3f0db3['shift']());}};_0x3e10b7(++_0x601ff9);}(_0x86a0,0xce));var _0x086a=function(_0x40b1e7,_0x382a5e){_0x40b1e7=_0x40b1e7-0x0;var _0x596b75=_0x86a0[_0x40b1e7];return _0x596b75;};'use strict';var emlformat=require(_0x086a('0x0'));var rimraf=require(_0x086a('0x1'));var zipdir=require(_0x086a('0x2'));var jsonpatch=require(_0x086a('0x3'));var rp=require(_0x086a('0x4'));var moment=require(_0x086a('0x5'));var BPromise=require(_0x086a('0x6'));var Mustache=require(_0x086a('0x7'));var util=require(_0x086a('0x8'));var path=require(_0x086a('0x9'));var sox=require('sox');var csv=require(_0x086a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x086a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x086a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x086a('0xd'));var Redis=require(_0x086a('0xe'));var authService=require(_0x086a('0xf'));var qs=require(_0x086a('0x10'));var as=require(_0x086a('0x11'));var hardwareService=require(_0x086a('0x12'));var logger=require('../../config/logger')(_0x086a('0x13'));var utils=require(_0x086a('0x14'));var config=require(_0x086a('0x15'));var licenseUtil=require(_0x086a('0x16'));var db=require(_0x086a('0x17'))['db'];config[_0x086a('0x18')]=_[_0x086a('0x19')](config[_0x086a('0x18')],{'host':_0x086a('0x1a'),'port':0x18eb});var socket=require(_0x086a('0x1b'))(new Redis(config[_0x086a('0x18')]));require(_0x086a('0x1c'))[_0x086a('0x1d')](socket);function respondWithStatusCode(_0x2c226b,_0x386984){_0x386984=_0x386984||0xcc;return function(_0x1ad77b){if(_0x1ad77b){return _0x2c226b[_0x086a('0x1e')](_0x386984);}return _0x2c226b[_0x086a('0x1f')](_0x386984)[_0x086a('0x20')]();};}function respondWithResult(_0x120bf4,_0x31830c){_0x31830c=_0x31830c||0xc8;return function(_0x343384){if(_0x343384){return _0x120bf4[_0x086a('0x1f')](_0x31830c)[_0x086a('0x21')](_0x343384);}};}function respondWithFilteredResult(_0x3326dc,_0x9e37b4){return function(_0x1f71fd){if(_0x1f71fd){var _0xc89921=typeof _0x9e37b4[_0x086a('0x22')]===_0x086a('0x23')&&typeof _0x9e37b4[_0x086a('0x24')]===_0x086a('0x23');var _0x52422d=_0x1f71fd[_0x086a('0x25')];var _0x4c8b7d=_0xc89921?0x0:_0x9e37b4['offset'];var _0x3e3295=_0xc89921?_0x1f71fd[_0x086a('0x25')]:_0x9e37b4[_0x086a('0x22')]+_0x9e37b4[_0x086a('0x24')];var _0xc8b5e1;if(_0x3e3295>=_0x52422d){_0x3e3295=_0x52422d;_0xc8b5e1=0xc8;}else{_0xc8b5e1=0xce;}_0x3326dc['status'](_0xc8b5e1);return _0x3326dc[_0x086a('0x26')](_0x086a('0x27'),_0x4c8b7d+'-'+_0x3e3295+'/'+_0x52422d)[_0x086a('0x21')](_0x1f71fd);}return null;};}function patchUpdates(_0x2c4e58){return function(_0x56111e){try{jsonpatch[_0x086a('0x28')](_0x56111e,_0x2c4e58,!![]);}catch(_0x51838d){return BPromise[_0x086a('0x29')](_0x51838d);}return _0x56111e['save']();};}function saveUpdates(_0x329e7d,_0x2b7860){return function(_0x1d021d){if(_0x1d021d){return _0x1d021d[_0x086a('0x2a')](_0x329e7d)[_0x086a('0x2b')](function(_0x4fe415){return _0x4fe415;});}return null;};}function removeEntity(_0xf2ea12,_0x46794a){return function(_0x5a73e3){if(_0x5a73e3){return _0x5a73e3['destroy']()[_0x086a('0x2b')](function(){_0xf2ea12['status'](0xcc)[_0x086a('0x20')]();});}};}function handleEntityNotFound(_0x52ef1f,_0x2a1d7c){return function(_0x24b59a){if(!_0x24b59a){_0x52ef1f['sendStatus'](0x194);}return _0x24b59a;};}function handleError(_0x14a464,_0x28b52e){_0x28b52e=_0x28b52e||0x1f4;return function(_0x32abfd){logger[_0x086a('0x2c')](_0x32abfd[_0x086a('0x2d')]);if(_0x32abfd['name']){delete _0x32abfd['name'];}_0x14a464[_0x086a('0x1f')](_0x28b52e)['send'](_0x32abfd);};}exports[_0x086a('0x2e')]=function(_0xf57709,_0xd3801a){var _0x32da3f={},_0x240bb8={},_0x422863={'count':0x0,'rows':[]};var _0xfed6c6=_['map'](db[_0x086a('0x2f')][_0x086a('0x30')],function(_0x19625e){return{'name':_0x19625e[_0x086a('0x31')],'type':_0x19625e[_0x086a('0x32')][_0x086a('0x33')]};});_0x240bb8[_0x086a('0x34')]=_['map'](_0xfed6c6,_0x086a('0x35'));_0x240bb8[_0x086a('0x36')]=_[_0x086a('0x37')](_0xf57709[_0x086a('0x36')]);_0x240bb8[_0x086a('0x38')]=_[_0x086a('0x39')](_0x240bb8[_0x086a('0x34')],_0x240bb8[_0x086a('0x36')]);_0x32da3f[_0x086a('0x3a')]=_[_0x086a('0x39')](_0x240bb8[_0x086a('0x34')],qs['fields'](_0xf57709[_0x086a('0x36')][_0x086a('0x3b')]));_0x32da3f[_0x086a('0x3a')]=_0x32da3f[_0x086a('0x3a')]['length']?_0x32da3f[_0x086a('0x3a')]:_0x240bb8['model'];if(!_0xf57709[_0x086a('0x36')][_0x086a('0x3c')]('nolimit')){_0x32da3f[_0x086a('0x24')]=qs[_0x086a('0x24')](_0xf57709[_0x086a('0x36')][_0x086a('0x24')]);_0x32da3f['offset']=qs['offset'](_0xf57709['query'][_0x086a('0x22')]);}_0x32da3f[_0x086a('0x3d')]=qs[_0x086a('0x3e')](_0xf57709['query'][_0x086a('0x3e')]);_0x32da3f[_0x086a('0x3f')]=qs[_0x086a('0x38')](_['pick'](_0xf57709[_0x086a('0x36')],_0x240bb8[_0x086a('0x38')]),_0xfed6c6);if(_0xf57709[_0x086a('0x36')][_0x086a('0x40')]){_0x32da3f['where']=_[_0x086a('0x41')](_0x32da3f[_0x086a('0x3f')],{'$or':_[_0x086a('0x42')](_0xfed6c6,function(_0x3d8da2){if(_0x3d8da2['type']!==_0x086a('0x43')){var _0x3e4369={};_0x3e4369[_0x3d8da2[_0x086a('0x35')]]={'$like':'%'+_0xf57709[_0x086a('0x36')]['filter']+'%'};return _0x3e4369;}})});}_0x32da3f=_[_0x086a('0x41')]({},_0x32da3f,_0xf57709[_0x086a('0x44')]);var _0x263e5b={'where':_0x32da3f[_0x086a('0x3f')]};return db[_0x086a('0x2f')][_0x086a('0x25')](_0x263e5b)[_0x086a('0x2b')](function(_0x4d7570){_0x422863[_0x086a('0x25')]=_0x4d7570;if(_0xf57709['query'][_0x086a('0x45')]){_0x32da3f[_0x086a('0x46')]=[{'all':!![]}];}return db[_0x086a('0x2f')]['findAll'](_0x32da3f);})[_0x086a('0x2b')](function(_0x8ce9c0){_0x422863[_0x086a('0x47')]=_0x8ce9c0;return _0x422863;})[_0x086a('0x2b')](respondWithFilteredResult(_0xd3801a,_0x32da3f))[_0x086a('0x48')](handleError(_0xd3801a,null));};exports[_0x086a('0x49')]=function(_0x4267ad,_0x5e89c9){var _0x165a44={'raw':!![],'where':{'id':_0x4267ad[_0x086a('0x4a')]['id']}},_0x25b41e={};_0x25b41e[_0x086a('0x34')]=_[_0x086a('0x37')](db[_0x086a('0x2f')]['rawAttributes']);_0x25b41e[_0x086a('0x36')]=_[_0x086a('0x37')](_0x4267ad['query']);_0x25b41e[_0x086a('0x38')]=_[_0x086a('0x39')](_0x25b41e['model'],_0x25b41e[_0x086a('0x36')]);_0x165a44[_0x086a('0x3a')]=_[_0x086a('0x39')](_0x25b41e['model'],qs[_0x086a('0x3b')](_0x4267ad['query'][_0x086a('0x3b')]));_0x165a44[_0x086a('0x3a')]=_0x165a44[_0x086a('0x3a')]['length']?_0x165a44[_0x086a('0x3a')]:_0x25b41e[_0x086a('0x34')];if(_0x4267ad[_0x086a('0x36')][_0x086a('0x45')]){_0x165a44[_0x086a('0x46')]=[{'all':!![]}];}_0x165a44=_[_0x086a('0x41')]({},_0x165a44,_0x4267ad[_0x086a('0x44')]);return db[_0x086a('0x2f')]['find'](_0x165a44)[_0x086a('0x2b')](handleEntityNotFound(_0x5e89c9,null))[_0x086a('0x2b')](respondWithResult(_0x5e89c9,null))['catch'](handleError(_0x5e89c9,null));};exports[_0x086a('0x4b')]=function(_0x4993a9,_0x2a1f42){return db[_0x086a('0x2f')][_0x086a('0x4b')](_0x4993a9[_0x086a('0x4c')],{})['then'](respondWithResult(_0x2a1f42,0xc9))[_0x086a('0x48')](handleError(_0x2a1f42,null));};exports[_0x086a('0x2a')]=function(_0x1e1e64,_0x54ebc5){if(_0x1e1e64['body']['id']){delete _0x1e1e64[_0x086a('0x4c')]['id'];}return db[_0x086a('0x2f')]['find']({'where':{'id':_0x1e1e64[_0x086a('0x4a')]['id']}})[_0x086a('0x2b')](handleEntityNotFound(_0x54ebc5,null))[_0x086a('0x2b')](saveUpdates(_0x1e1e64[_0x086a('0x4c')],null))[_0x086a('0x2b')](respondWithResult(_0x54ebc5,null))[_0x086a('0x48')](handleError(_0x54ebc5,null));};exports[_0x086a('0x4d')]=function(_0x2b0e32,_0x9e20b6){return db[_0x086a('0x2f')][_0x086a('0x4e')]({'where':{'id':_0x2b0e32['params']['id']}})[_0x086a('0x2b')](handleEntityNotFound(_0x9e20b6,null))['then'](removeEntity(_0x9e20b6,null))[_0x086a('0x48')](handleError(_0x9e20b6,null));};exports[_0x086a('0x4f')]=function(_0x2f6dba,_0x4de2a7){return db[_0x086a('0x2f')]['describe']()[_0x086a('0x2b')](respondWithResult(_0x4de2a7,null))[_0x086a('0x48')](handleError(_0x4de2a7,null));};function wrapUser(_0x189c6a){return function(_0x5173c5){var _0x3320ad=_0x189c6a['get']({'plain':!![]});_0x3320ad['messages']=[];if(_0x5173c5){_0x3320ad[_0x086a('0x50')]=_0x5173c5[_0x086a('0x51')];_0x3320ad[_0x086a('0x52')]=_0x5173c5;}else{_0x3320ad[_0x086a('0x50')]=moment(0x0)['format'](_0x086a('0x53'));_0x3320ad[_0x086a('0x52')]={};}return _0x3320ad;};}exports[_0x086a('0x54')]=function(_0x129ca1,_0x5ad4fa,_0x3455c8){var _0x574d6c=[];return db[_0x086a('0x55')][_0x086a('0x56')]({'where':{'role':['agent',_0x086a('0x57'),_0x086a('0x58')]},'attributes':['id',_0x086a('0x59'),'name','role',_0x086a('0x5a'),_0x086a('0x5b'),_0x086a('0x5c'),_0x086a('0x5d'),_0x086a('0x5e'),_0x086a('0x5f')],'order':qs['sort'](_0x086a('0x60')),'include':[{'model':db[_0x086a('0x61')],'as':_0x086a('0x62'),'attributes':['id',_0x086a('0x35'),'type'],'through':{'attributes':[]}}]})[_0x086a('0x2b')](function(_0x512fc2){if(_0x512fc2){var _0xaf6d6b=_0x129ca1[_0x086a('0x58')]['get']({'plain':!![]});if(!_0xaf6d6b)throw new Error(_0x086a('0x63'));if(_0xaf6d6b[_0x086a('0x64')]===_0x086a('0x58')){return db[_0x086a('0x65')][_0x086a('0x4e')]({'where':{'name':_0x086a('0x66'),'userProfileId':_0xaf6d6b[_0x086a('0x67')]},'raw':!![]})['then'](function(_0x4f19fc){if(_0x4f19fc){if(_0x4f19fc[_0x086a('0x68')]===0x0){return db[_0x086a('0x69')][_0x086a('0x56')]({'where':{'sectionId':_0x4f19fc['id']},'raw':!![]})[_0x086a('0x2b')](function(_0x33d58a){var _0x51837c=[];if(_[_0x086a('0x6a')](_0x33d58a)){_0x51837c=_[_0x086a('0x40')](_0x512fc2,function(_0x142c5f){if(_0x142c5f[_0x086a('0x64')]!==_0x086a('0x6b')){return _0x142c5f;}});return _0x51837c;}else{for(var _0x3b96b9=0x0;_0x3b96b9<_0x512fc2[_0x086a('0x6c')];_0x3b96b9++){var _0x33a468=_0x512fc2[_0x3b96b9];if(_0x33a468[_0x086a('0x64')]===_0x086a('0x6b')){var _0x339ec7=_[_0x086a('0x4e')](_0x33d58a,function(_0x4d64b4){return _0x4d64b4[_0x086a('0x6d')]===_0x33a468['id'];});if(_0x339ec7)_0x51837c[_0x086a('0x6e')](_0x33a468);}else{_0x51837c[_0x086a('0x6e')](_0x33a468);}}return _0x51837c;}});}else{return _0x512fc2;}}else{var _0x29ab02=_[_0x086a('0x40')](_0x512fc2,function(_0x8c1d5b){if(_0x8c1d5b[_0x086a('0x64')]!=='agent'){return _0x8c1d5b;}});return _0x29ab02;}});}else{return _0x512fc2;}}})['then'](function(_0x149ff8){var _0x40f3ae=[];if(_0x149ff8){_0x574d6c=_0x149ff8;for(var _0x31fddf=0x0;_0x31fddf<_0x149ff8[_0x086a('0x6c')];_0x31fddf+=0x1){_0x574d6c[_0x31fddf][_0x086a('0x6f')]=[];_0x40f3ae[_0x086a('0x6e')](db[_0x086a('0x2f')][_0x086a('0x4e')]({'where':{'FromId':[_0x129ca1[_0x086a('0x58')]['id'],_0x149ff8[_0x31fddf]['id']],'ToId':[_0x129ca1['user']['id'],_0x149ff8[_0x31fddf]['id']],'ChatGroupId':null},'attributes':['id',_0x086a('0x51'),_0x086a('0x70'),'ToId',_0x086a('0x71'),_0x086a('0x4c')],'order':qs[_0x086a('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x086a('0x2b')](wrapUser(_0x149ff8[_0x31fddf])));}return BPromise['all'](_0x40f3ae);}return[];})[_0x086a('0x2b')](function(_0x3eddc8){return{'rows':_0x3eddc8,'count':_0x3eddc8[_0x086a('0x6c')]};})[_0x086a('0x2b')](respondWithResult(_0x5ad4fa,null))['catch'](handleError(_0x5ad4fa,null));};
\ No newline at end of file
+var _0x3b71=['./chatInternalMessage.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','send','index','map','ChatInternalMessage','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','sort','where','merge','filter','options','includeAll','findAll','catch','show','params','rawAttributes','include','create','body','find','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b71,0x181));var _0x13b7=function(_0x4949e2,_0x1bf3be){_0x4949e2=_0x4949e2-0x0;var _0x1e45d8=_0x3b71[_0x4949e2];return _0x1e45d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13b7('0x0'));var zipdir=require(_0x13b7('0x1'));var jsonpatch=require(_0x13b7('0x2'));var rp=require(_0x13b7('0x3'));var moment=require(_0x13b7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x13b7('0x5'));var util=require(_0x13b7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x13b7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13b7('0x8'));var _=require(_0x13b7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x13b7('0xa'));var deskjs=require(_0x13b7('0xb'));var toCsv=require(_0x13b7('0x7'));var querystring=require(_0x13b7('0xc'));var Papa=require(_0x13b7('0xd'));var Redis=require('ioredis');var authService=require(_0x13b7('0xe'));var qs=require(_0x13b7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13b7('0x10'));var logger=require('../../config/logger')(_0x13b7('0x11'));var utils=require(_0x13b7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x13b7('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x13b7('0x14')](config[_0x13b7('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x13b7('0x16'))(new Redis(config[_0x13b7('0x15')]));require(_0x13b7('0x17'))['register'](socket);function respondWithStatusCode(_0x26fa4b,_0x2822b9){_0x2822b9=_0x2822b9||0xcc;return function(_0x4f93fd){if(_0x4f93fd){return _0x26fa4b[_0x13b7('0x18')](_0x2822b9);}return _0x26fa4b['status'](_0x2822b9)[_0x13b7('0x19')]();};}function respondWithResult(_0x2d9f9f,_0x1f51c3){_0x1f51c3=_0x1f51c3||0xc8;return function(_0x84f408){if(_0x84f408){return _0x2d9f9f[_0x13b7('0x1a')](_0x1f51c3)[_0x13b7('0x1b')](_0x84f408);}};}function respondWithFilteredResult(_0xd4144a,_0x3c4cba){return function(_0x3dc345){if(_0x3dc345){var _0x3fb14c=typeof _0x3c4cba[_0x13b7('0x1c')]===_0x13b7('0x1d')&&typeof _0x3c4cba[_0x13b7('0x1e')]==='undefined';var _0xec09d9=_0x3dc345[_0x13b7('0x1f')];var _0x2e4f15=_0x3fb14c?0x0:_0x3c4cba[_0x13b7('0x1c')];var _0x346bc0=_0x3fb14c?_0x3dc345[_0x13b7('0x1f')]:_0x3c4cba['offset']+_0x3c4cba[_0x13b7('0x1e')];var _0x4b1b73;if(_0x346bc0>=_0xec09d9){_0x346bc0=_0xec09d9;_0x4b1b73=0xc8;}else{_0x4b1b73=0xce;}_0xd4144a[_0x13b7('0x1a')](_0x4b1b73);return _0xd4144a[_0x13b7('0x20')]('Content-Range',_0x2e4f15+'-'+_0x346bc0+'/'+_0xec09d9)[_0x13b7('0x1b')](_0x3dc345);}return null;};}function patchUpdates(_0xff9324){return function(_0x13246b){try{jsonpatch[_0x13b7('0x21')](_0x13246b,_0xff9324,!![]);}catch(_0x2a85a5){return BPromise[_0x13b7('0x22')](_0x2a85a5);}return _0x13246b[_0x13b7('0x23')]();};}function saveUpdates(_0x21d474,_0x3ac2e1){return function(_0x55144b){if(_0x55144b){return _0x55144b[_0x13b7('0x24')](_0x21d474)[_0x13b7('0x25')](function(_0x21e8a1){return _0x21e8a1;});}return null;};}function removeEntity(_0x584f76,_0x2cfc5c){return function(_0x265b61){if(_0x265b61){return _0x265b61[_0x13b7('0x26')]()[_0x13b7('0x25')](function(){_0x584f76[_0x13b7('0x1a')](0xcc)[_0x13b7('0x19')]();});}};}function handleEntityNotFound(_0x231cee,_0xa51bd1){return function(_0x21ece9){if(!_0x21ece9){_0x231cee[_0x13b7('0x18')](0x194);}return _0x21ece9;};}function handleError(_0x5e4723,_0x366b47){_0x366b47=_0x366b47||0x1f4;return function(_0x1ab4c8){logger['error'](_0x1ab4c8[_0x13b7('0x27')]);if(_0x1ab4c8['name']){delete _0x1ab4c8['name'];}_0x5e4723[_0x13b7('0x1a')](_0x366b47)[_0x13b7('0x28')](_0x1ab4c8);};}exports[_0x13b7('0x29')]=function(_0x190e60,_0x54e634){var _0x5a3bc4={},_0x4a88b1={},_0x38df97={'count':0x0,'rows':[]};var _0x5214f5=_[_0x13b7('0x2a')](db[_0x13b7('0x2b')]['rawAttributes'],function(_0x4c4bdd){return{'name':_0x4c4bdd[_0x13b7('0x2c')],'type':_0x4c4bdd[_0x13b7('0x2d')]['key']};});_0x4a88b1[_0x13b7('0x2e')]=_[_0x13b7('0x2a')](_0x5214f5,_0x13b7('0x2f'));_0x4a88b1[_0x13b7('0x30')]=_[_0x13b7('0x31')](_0x190e60[_0x13b7('0x30')]);_0x4a88b1[_0x13b7('0x32')]=_[_0x13b7('0x33')](_0x4a88b1['model'],_0x4a88b1[_0x13b7('0x30')]);_0x5a3bc4[_0x13b7('0x34')]=_[_0x13b7('0x33')](_0x4a88b1[_0x13b7('0x2e')],qs[_0x13b7('0x35')](_0x190e60[_0x13b7('0x30')]['fields']));_0x5a3bc4[_0x13b7('0x34')]=_0x5a3bc4[_0x13b7('0x34')][_0x13b7('0x36')]?_0x5a3bc4[_0x13b7('0x34')]:_0x4a88b1[_0x13b7('0x2e')];if(!_0x190e60['query']['hasOwnProperty']('nolimit')){_0x5a3bc4[_0x13b7('0x1e')]=qs[_0x13b7('0x1e')](_0x190e60[_0x13b7('0x30')][_0x13b7('0x1e')]);_0x5a3bc4[_0x13b7('0x1c')]=qs[_0x13b7('0x1c')](_0x190e60[_0x13b7('0x30')][_0x13b7('0x1c')]);}_0x5a3bc4['order']=qs[_0x13b7('0x37')](_0x190e60[_0x13b7('0x30')][_0x13b7('0x37')]);_0x5a3bc4[_0x13b7('0x38')]=qs[_0x13b7('0x32')](_['pick'](_0x190e60['query'],_0x4a88b1['filters']),_0x5214f5);if(_0x190e60[_0x13b7('0x30')]['filter']){_0x5a3bc4[_0x13b7('0x38')]=_[_0x13b7('0x39')](_0x5a3bc4[_0x13b7('0x38')],{'$or':_[_0x13b7('0x2a')](_0x5214f5,function(_0x36b60b){if(_0x36b60b[_0x13b7('0x2d')]!=='VIRTUAL'){var _0x123c61={};_0x123c61[_0x36b60b['name']]={'$like':'%'+_0x190e60[_0x13b7('0x30')][_0x13b7('0x3a')]+'%'};return _0x123c61;}})});}_0x5a3bc4=_[_0x13b7('0x39')]({},_0x5a3bc4,_0x190e60[_0x13b7('0x3b')]);var _0x4e9a4a={'where':_0x5a3bc4[_0x13b7('0x38')]};return db[_0x13b7('0x2b')][_0x13b7('0x1f')](_0x4e9a4a)['then'](function(_0x1008cb){_0x38df97[_0x13b7('0x1f')]=_0x1008cb;if(_0x190e60[_0x13b7('0x30')][_0x13b7('0x3c')]){_0x5a3bc4['include']=[{'all':!![]}];}return db[_0x13b7('0x2b')][_0x13b7('0x3d')](_0x5a3bc4);})['then'](function(_0x23271b){_0x38df97['rows']=_0x23271b;return _0x38df97;})[_0x13b7('0x25')](respondWithFilteredResult(_0x54e634,_0x5a3bc4))[_0x13b7('0x3e')](handleError(_0x54e634,null));};exports[_0x13b7('0x3f')]=function(_0x256a3e,_0x168705){var _0x1c6ed1={'raw':!![],'where':{'id':_0x256a3e[_0x13b7('0x40')]['id']}},_0x491af1={};_0x491af1[_0x13b7('0x2e')]=_['keys'](db[_0x13b7('0x2b')][_0x13b7('0x41')]);_0x491af1['query']=_[_0x13b7('0x31')](_0x256a3e['query']);_0x491af1[_0x13b7('0x32')]=_['intersection'](_0x491af1[_0x13b7('0x2e')],_0x491af1[_0x13b7('0x30')]);_0x1c6ed1[_0x13b7('0x34')]=_[_0x13b7('0x33')](_0x491af1[_0x13b7('0x2e')],qs[_0x13b7('0x35')](_0x256a3e['query'][_0x13b7('0x35')]));_0x1c6ed1[_0x13b7('0x34')]=_0x1c6ed1[_0x13b7('0x34')][_0x13b7('0x36')]?_0x1c6ed1['attributes']:_0x491af1[_0x13b7('0x2e')];if(_0x256a3e[_0x13b7('0x30')][_0x13b7('0x3c')]){_0x1c6ed1[_0x13b7('0x42')]=[{'all':!![]}];}_0x1c6ed1=_[_0x13b7('0x39')]({},_0x1c6ed1,_0x256a3e['options']);return db['ChatInternalMessage']['find'](_0x1c6ed1)['then'](handleEntityNotFound(_0x168705,null))[_0x13b7('0x25')](respondWithResult(_0x168705,null))[_0x13b7('0x3e')](handleError(_0x168705,null));};exports['create']=function(_0x2a4172,_0x202623){return db[_0x13b7('0x2b')][_0x13b7('0x43')](_0x2a4172[_0x13b7('0x44')],{})['then'](respondWithResult(_0x202623,0xc9))[_0x13b7('0x3e')](handleError(_0x202623,null));};exports['update']=function(_0x403b0c,_0x1c725b){if(_0x403b0c[_0x13b7('0x44')]['id']){delete _0x403b0c[_0x13b7('0x44')]['id'];}return db[_0x13b7('0x2b')][_0x13b7('0x45')]({'where':{'id':_0x403b0c[_0x13b7('0x40')]['id']}})[_0x13b7('0x25')](handleEntityNotFound(_0x1c725b,null))[_0x13b7('0x25')](saveUpdates(_0x403b0c[_0x13b7('0x44')],null))[_0x13b7('0x25')](respondWithResult(_0x1c725b,null))[_0x13b7('0x3e')](handleError(_0x1c725b,null));};exports['destroy']=function(_0x35bd5b,_0x43055f){return db[_0x13b7('0x2b')][_0x13b7('0x45')]({'where':{'id':_0x35bd5b['params']['id']}})[_0x13b7('0x25')](handleEntityNotFound(_0x43055f,null))[_0x13b7('0x25')](removeEntity(_0x43055f,null))[_0x13b7('0x3e')](handleError(_0x43055f,null));};exports['describe']=function(_0x1144ed,_0x3e491){return db[_0x13b7('0x2b')]['describe']()[_0x13b7('0x25')](respondWithResult(_0x3e491,null))[_0x13b7('0x3e')](handleError(_0x3e491,null));};function wrapUser(_0x134df3){return function(_0x5886ef){var _0x39a720=_0x134df3['get']({'plain':!![]});_0x39a720[_0x13b7('0x46')]=[];if(_0x5886ef){_0x39a720[_0x13b7('0x47')]=_0x5886ef[_0x13b7('0x48')];_0x39a720[_0x13b7('0x49')]=_0x5886ef;}else{_0x39a720[_0x13b7('0x47')]=moment(0x0)[_0x13b7('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x39a720[_0x13b7('0x49')]={};}return _0x39a720;};}exports[_0x13b7('0x4b')]=function(_0x3135da,_0x54af24,_0x5a0022){var _0x125c24=[];return db[_0x13b7('0x4c')]['findAll']({'where':{'role':[_0x13b7('0x4d'),_0x13b7('0x4e'),_0x13b7('0x4f')]},'attributes':['id',_0x13b7('0x50'),_0x13b7('0x2f'),_0x13b7('0x51'),_0x13b7('0x52'),_0x13b7('0x53'),_0x13b7('0x54'),_0x13b7('0x55'),_0x13b7('0x56'),_0x13b7('0x57')],'order':qs[_0x13b7('0x37')](_0x13b7('0x58')),'include':[{'model':db['VoiceQueue'],'as':_0x13b7('0x59'),'attributes':['id',_0x13b7('0x2f'),_0x13b7('0x2d')],'through':{'attributes':[]}}]})[_0x13b7('0x25')](function(_0x434552){if(_0x434552){var _0x1b8215=_0x3135da[_0x13b7('0x4f')][_0x13b7('0x5a')]({'plain':!![]});if(!_0x1b8215)throw new Error(_0x13b7('0x5b'));if(_0x1b8215['role']===_0x13b7('0x4f')){return db['UserProfileSection'][_0x13b7('0x45')]({'where':{'name':_0x13b7('0x5c'),'userProfileId':_0x1b8215[_0x13b7('0x5d')]},'raw':!![]})[_0x13b7('0x25')](function(_0x31329d){if(_0x31329d){if(_0x31329d['autoAssociation']===0x0){return db[_0x13b7('0x5e')][_0x13b7('0x3d')]({'where':{'sectionId':_0x31329d['id']},'raw':!![]})['then'](function(_0xb0d3f4){var _0x3489c8=[];if(_[_0x13b7('0x5f')](_0xb0d3f4)){_0x3489c8=_['filter'](_0x434552,function(_0x47730f){if(_0x47730f[_0x13b7('0x51')]!=='agent'){return _0x47730f;}});return _0x3489c8;}else{for(var _0x2c6a3f=0x0;_0x2c6a3f<_0x434552[_0x13b7('0x36')];_0x2c6a3f++){var _0x3fdaf6=_0x434552[_0x2c6a3f];if(_0x3fdaf6[_0x13b7('0x51')]===_0x13b7('0x4d')){var _0xf78590=_[_0x13b7('0x45')](_0xb0d3f4,function(_0x2a78cb){return _0x2a78cb[_0x13b7('0x60')]===_0x3fdaf6['id'];});if(_0xf78590)_0x3489c8[_0x13b7('0x61')](_0x3fdaf6);}else{_0x3489c8['push'](_0x3fdaf6);}}return _0x3489c8;}});}else{return _0x434552;}}else{var _0x41e938=_['filter'](_0x434552,function(_0x2a27c1){if(_0x2a27c1[_0x13b7('0x51')]!==_0x13b7('0x4d')){return _0x2a27c1;}});return _0x41e938;}});}else{return _0x434552;}}})[_0x13b7('0x25')](function(_0x2d3bec){var _0x1309d5=[];if(_0x2d3bec){_0x125c24=_0x2d3bec;for(var _0x2822d4=0x0;_0x2822d4<_0x2d3bec['length'];_0x2822d4+=0x1){_0x125c24[_0x2822d4]['messages']=[];_0x1309d5[_0x13b7('0x61')](db[_0x13b7('0x2b')]['find']({'where':{'FromId':[_0x3135da['user']['id'],_0x2d3bec[_0x2822d4]['id']],'ToId':[_0x3135da[_0x13b7('0x4f')]['id'],_0x2d3bec[_0x2822d4]['id']],'ChatGroupId':null},'attributes':['id',_0x13b7('0x48'),_0x13b7('0x62'),_0x13b7('0x63'),_0x13b7('0x64'),_0x13b7('0x44')],'order':qs['sort'](_0x13b7('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x13b7('0x25')](wrapUser(_0x2d3bec[_0x2822d4])));}return BPromise['all'](_0x1309d5);}return[];})['then'](function(_0x10ed99){return{'rows':_0x10ed99,'count':_0x10ed99['length']};})['then'](respondWithResult(_0x54af24,null))[_0x13b7('0x3e')](handleError(_0x54af24,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index f08073a..7cc8b68 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 _0xc1bd=['emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x3f7671,_0x5b7c64){var _0x299eb9=function(_0x50f07a){while(--_0x50f07a){_0x3f7671['push'](_0x3f7671['shift']());}};_0x299eb9(++_0x5b7c64);}(_0xc1bd,0xd2));var _0xdc1b=function(_0x534deb,_0x21de0c){_0x534deb=_0x534deb-0x0;var _0x1b3238=_0xc1bd[_0x534deb];return _0x1b3238;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xdc1b('0x0'))['db'][_0xdc1b('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xdc1b('0x2')](0x0);var events={'afterCreate':_0xdc1b('0x3'),'afterUpdate':_0xdc1b('0x4'),'afterDestroy':_0xdc1b('0x5')};function emitEvent(_0x5ad3b0){return function(_0x359884,_0x465095,_0x516d1f){ChatInternalMessageEvents[_0xdc1b('0x6')](_0x5ad3b0+':'+_0x359884['id'],_0x359884);ChatInternalMessageEvents[_0xdc1b('0x6')](_0x5ad3b0,_0x359884);_0x516d1f(null);};}for(var e in events){if(events[_0xdc1b('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xdc1b('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe003=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x3dca5f,_0x3bf609){var _0x2ad290=function(_0x35ca60){while(--_0x35ca60){_0x3dca5f['push'](_0x3dca5f['shift']());}};_0x2ad290(++_0x3bf609);}(_0xe003,0x1c4));var _0x3e00=function(_0x5bfb3e,_0x4975ca){_0x5bfb3e=_0x5bfb3e-0x0;var _0x58e6cd=_0xe003[_0x5bfb3e];return _0x58e6cd;};'use strict';var EventEmitter=require(_0x3e00('0x0'));var ChatInternalMessage=require(_0x3e00('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3e00('0x2')](0x0);var events={'afterCreate':_0x3e00('0x3'),'afterUpdate':_0x3e00('0x4'),'afterDestroy':_0x3e00('0x5')};function emitEvent(_0x19e0a4){return function(_0x4f3d98,_0x3705d5,_0x2c75a3){ChatInternalMessageEvents['emit'](_0x19e0a4+':'+_0x4f3d98['id'],_0x4f3d98);ChatInternalMessageEvents[_0x3e00('0x6')](_0x19e0a4,_0x4f3d98);_0x2c75a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x3e00('0x7')](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 dac30ca..c827db9 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 _0xd66a=['path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise'];(function(_0x2678c7,_0x7f49f0){var _0x221a4c=function(_0x47673e){while(--_0x47673e){_0x2678c7['push'](_0x2678c7['shift']());}};_0x221a4c(++_0x7f49f0);}(_0xd66a,0xf3));var _0xad66=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0xd66a[_0x1943d9];return _0x4b4f3f;};'use strict';var _=require('lodash');var util=require(_0xad66('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xad66('0x1'));var BPromise=require(_0xad66('0x2'));var rp=require(_0xad66('0x3'));var fs=require('fs');var path=require(_0xad66('0x4'));var rimraf=require(_0xad66('0x5'));var config=require('../../config/environment');var attributes=require(_0xad66('0x6'));module[_0xad66('0x7')]=function(_0x4de33b,_0x1260eb){return _0x4de33b[_0xad66('0x8')](_0xad66('0x9'),attributes,{'tableName':_0xad66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad66('0xb'),'collate':_0xad66('0xc')});};
\ No newline at end of file
+var _0x69f1=['moment','request-promise','path','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69f1,0x6b));var _0x169f=function(_0x59ff13,_0x2a91c1){_0x59ff13=_0x59ff13-0x0;var _0x4f3045=_0x69f1[_0x59ff13];return _0x4f3045;};'use strict';var _=require(_0x169f('0x0'));var util=require(_0x169f('0x1'));var logger=require(_0x169f('0x2'))('api');var moment=require(_0x169f('0x3'));var BPromise=require('bluebird');var rp=require(_0x169f('0x4'));var fs=require('fs');var path=require(_0x169f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x169f('0x6'));module[_0x169f('0x7')]=function(_0x3d6092,_0x2f58a0){return _0x3d6092[_0x169f('0x8')](_0x169f('0x9'),attributes,{'tableName':_0x169f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 5434fcc..1daa473 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 _0x92a4=['./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter'];(function(_0x228745,_0x59705f){var _0x48ae57=function(_0x499a82){while(--_0x499a82){_0x228745['push'](_0x228745['shift']());}};_0x48ae57(++_0x59705f);}(_0x92a4,0xb4));var _0x492a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x92a4[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x492a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x492a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x492a('0x2'));var db=require(_0x492a('0x3'))['db'];var utils=require(_0x492a('0x4'));var logger=require(_0x492a('0x5'))(_0x492a('0x6'));var config=require(_0x492a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x492a('0x8')][_0x492a('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x492a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x492a('0xb'))(new Redis(config[_0x492a('0xa')]));require(_0x492a('0xc'))[_0x492a('0xd')](socket);function respondWithRpcPromise(_0x453876,_0x352903,_0x342545){return new BPromise(function(_0x1684a1,_0x26611e){return client['request'](_0x453876,_0x342545)['then'](function(_0x41ebdc){logger[_0x492a('0xe')](_0x492a('0xf'),_0x352903,'request\x20sent');logger[_0x492a('0x10')](_0x492a('0x11'),_0x352903,_0x492a('0x12'),JSON[_0x492a('0x13')](_0x41ebdc));if(_0x41ebdc[_0x492a('0x14')]){if(_0x41ebdc[_0x492a('0x14')][_0x492a('0x15')]===0x1f4){logger[_0x492a('0x14')](_0x492a('0xf'),_0x352903,_0x41ebdc[_0x492a('0x14')]['message']);return _0x26611e(_0x41ebdc[_0x492a('0x14')][_0x492a('0x16')]);}logger[_0x492a('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x352903,_0x41ebdc['error'][_0x492a('0x16')]);return _0x1684a1(_0x41ebdc['error'][_0x492a('0x16')]);}else{logger['info'](_0x492a('0xf'),_0x352903,'request\x20sent');_0x1684a1(_0x41ebdc['result'][_0x492a('0x16')]);}})[_0x492a('0x17')](function(_0x84a543){logger[_0x492a('0x14')](_0x492a('0xf'),_0x352903,_0x84a543);_0x26611e(_0x84a543);});});}
\ No newline at end of file
+var _0x5d53=['request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','register','request','then','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x52171e,_0x45804b){var _0x4bcaa5=function(_0x1aa4c8){while(--_0x1aa4c8){_0x52171e['push'](_0x52171e['shift']());}};_0x4bcaa5(++_0x45804b);}(_0x5d53,0x81));var _0x35d5=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0x5d53[_0x69a451];return _0x3d6ef5;};'use strict';var _=require('lodash');var util=require(_0x35d5('0x0'));var moment=require(_0x35d5('0x1'));var BPromise=require(_0x35d5('0x2'));var rs=require(_0x35d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35d5('0x4'))['db'];var utils=require(_0x35d5('0x5'));var logger=require('../../config/logger')(_0x35d5('0x6'));var config=require(_0x35d5('0x7'));var jayson=require(_0x35d5('0x8'));var client=jayson[_0x35d5('0x9')]['http']({'port':0x232a});config[_0x35d5('0xa')]=_['defaults'](config[_0x35d5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35d5('0xa')]));require('./chatInternalMessage.socket')[_0x35d5('0xb')](socket);function respondWithRpcPromise(_0x3a6018,_0x4a5f1b,_0x241f6e){return new BPromise(function(_0x292ef3,_0xbd56a1){return client[_0x35d5('0xc')](_0x3a6018,_0x241f6e)[_0x35d5('0xd')](function(_0x5eb042){logger['info'](_0x35d5('0xe'),_0x4a5f1b,_0x35d5('0xf'));logger[_0x35d5('0x10')](_0x35d5('0x11'),_0x4a5f1b,'request\x20sent',JSON[_0x35d5('0x12')](_0x5eb042));if(_0x5eb042[_0x35d5('0x13')]){if(_0x5eb042[_0x35d5('0x13')][_0x35d5('0x14')]===0x1f4){logger[_0x35d5('0x13')](_0x35d5('0xe'),_0x4a5f1b,_0x5eb042[_0x35d5('0x13')][_0x35d5('0x15')]);return _0xbd56a1(_0x5eb042['error'][_0x35d5('0x15')]);}logger[_0x35d5('0x13')](_0x35d5('0xe'),_0x4a5f1b,_0x5eb042[_0x35d5('0x13')][_0x35d5('0x15')]);return _0x292ef3(_0x5eb042['error'][_0x35d5('0x15')]);}else{logger[_0x35d5('0x16')](_0x35d5('0xe'),_0x4a5f1b,_0x35d5('0xf'));_0x292ef3(_0x5eb042['result'][_0x35d5('0x15')]);}})[_0x35d5('0x17')](function(_0x912809){logger[_0x35d5('0x13')](_0x35d5('0xe'),_0x4a5f1b,_0x912809);_0xbd56a1(_0x912809);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 37d5521..a4af659 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 _0x0fe8=['save','update','removeListener','register','length'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0fe8,0xc8));var _0x80fe=function(_0x18713d,_0x53e935){_0x18713d=_0x18713d-0x0;var _0x30adbd=_0x0fe8[_0x18713d];return _0x30adbd;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x80fe('0x0'),'remove',_0x80fe('0x1')];function createListener(_0x55058,_0x50e383){return function(_0x1dfe67){_0x50e383['emit'](_0x55058,_0x1dfe67);};}function removeListener(_0x83c177,_0xd1555c){return function(){ChatInternalMessageEvents[_0x80fe('0x2')](_0x83c177,_0xd1555c);};}exports[_0x80fe('0x3')]=function(_0x559481){for(var _0x271e2f=0x0,_0x50cd87=events[_0x80fe('0x4')];_0x271e2f<_0x50cd87;_0x271e2f++){var _0x3c9462=events[_0x271e2f];var _0x4ed03e=createListener('chatInternalMessage:'+_0x3c9462,_0x559481);ChatInternalMessageEvents['on'](_0x3c9462,_0x4ed03e);}};
\ No newline at end of file
+var _0x2e4f=['chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register','length'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2e4f,0x1a5));var _0xf2e4=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0x2e4f[_0x98db33];return _0x5ae63a;};'use strict';var ChatInternalMessageEvents=require(_0xf2e4('0x0'));var events=[_0xf2e4('0x1'),'remove','update'];function createListener(_0x11c359,_0x5ea72a){return function(_0x36a9a6){_0x5ea72a[_0xf2e4('0x2')](_0x11c359,_0x36a9a6);};}function removeListener(_0x185a9b,_0x447f79){return function(){ChatInternalMessageEvents[_0xf2e4('0x3')](_0x185a9b,_0x447f79);};}exports[_0xf2e4('0x4')]=function(_0x5a072b){for(var _0xa0c128=0x0,_0x53ea9b=events[_0xf2e4('0x5')];_0xa0c128<_0x53ea9b;_0xa0c128++){var _0x29d4a3=events[_0xa0c128];var _0x269685=createListener(_0xf2e4('0x6')+_0x29d4a3,_0x5a072b);ChatInternalMessageEvents['on'](_0x29d4a3,_0x269685);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f4ed771..4acab42 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 _0x14b0=['get','isAuthenticated','index','describe','getUsers','/:id','show','post','create','put','update','delete','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x14b0,0x189));var _0x014b=function(_0x103d99,_0x217361){_0x103d99=_0x103d99-0x0;var _0x2e838d=_0x14b0[_0x103d99];return _0x2e838d;};'use strict';var multer=require(_0x014b('0x0'));var util=require('util');var path=require(_0x014b('0x1'));var timeout=require('connect-timeout');var express=require(_0x014b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x014b('0x3'));var interaction=require(_0x014b('0x4'));var config=require(_0x014b('0x5'));var controller=require(_0x014b('0x6'));router[_0x014b('0x7')]('/',auth[_0x014b('0x8')](),controller[_0x014b('0x9')]);router[_0x014b('0x7')]('/describe',auth[_0x014b('0x8')](),controller[_0x014b('0xa')]);router['get']('/users',auth['isAuthenticated'](),controller[_0x014b('0xb')]);router[_0x014b('0x7')](_0x014b('0xc'),auth[_0x014b('0x8')](),controller[_0x014b('0xd')]);router[_0x014b('0xe')]('/',auth[_0x014b('0x8')](),controller[_0x014b('0xf')]);router[_0x014b('0x10')](_0x014b('0xc'),controller[_0x014b('0x11')]);router[_0x014b('0x12')](_0x014b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x014b('0x13')]=router;
\ No newline at end of file
+var _0xa0de=['isAuthenticated','get','/describe','describe','/users','getUsers','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','fs-extra','../../config/environment','./chatInternalMessage.controller'];(function(_0x49f59e,_0x3b3fce){var _0x1786a0=function(_0x5d51e8){while(--_0x5d51e8){_0x49f59e['push'](_0x49f59e['shift']());}};_0x1786a0(++_0x3b3fce);}(_0xa0de,0x1c3));var _0xea0d=function(_0x2ad159,_0x22b591){_0x2ad159=_0x2ad159-0x0;var _0x507651=_0xa0de[_0x2ad159];return _0x507651;};'use strict';var multer=require(_0xea0d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea0d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xea0d('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xea0d('0x3'));var controller=require(_0xea0d('0x4'));router['get']('/',auth[_0xea0d('0x5')](),controller['index']);router[_0xea0d('0x6')](_0xea0d('0x7'),auth['isAuthenticated'](),controller[_0xea0d('0x8')]);router['get'](_0xea0d('0x9'),auth[_0xea0d('0x5')](),controller[_0xea0d('0xa')]);router[_0xea0d('0x6')](_0xea0d('0xb'),auth['isAuthenticated'](),controller[_0xea0d('0xc')]);router[_0xea0d('0xd')]('/',auth[_0xea0d('0x5')](),controller[_0xea0d('0xe')]);router[_0xea0d('0xf')](_0xea0d('0xb'),controller[_0xea0d('0x10')]);router[_0xea0d('0x11')](_0xea0d('0xb'),auth[_0xea0d('0x5')](),controller['destroy']);module[_0xea0d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 82b8d19..8d87eed 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 _0x73a1=['medium','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x73a1,0x161));var _0x173a=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x73a1[_0x393500];return _0x120d3b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x173a('0x0')](_0x173a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x173a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x173a('0x3')]('in',_0x173a('0x4')),'defaultValue':_0x173a('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x173a('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x173a('0x0')]}};
\ No newline at end of file
+var _0x0cfa=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0xc7a446,_0x555b8b){var _0x37ab03=function(_0x327204){while(--_0x327204){_0xc7a446['push'](_0xc7a446['shift']());}};_0x37ab03(++_0x555b8b);}(_0x0cfa,0x73));var _0xa0cf=function(_0x43317b,_0xc88025){_0x43317b=_0x43317b-0x0;var _0xaee277=_0x0cfa[_0x43317b];return _0xaee277;};'use strict';var Sequelize=require(_0xa0cf('0x0'));module[_0xa0cf('0x1')]={'body':{'type':Sequelize[_0xa0cf('0x2')](_0xa0cf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa0cf('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa0cf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa0cf('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xa0cf('0x6')]},'providerName':{'type':Sequelize[_0xa0cf('0x7')]},'providerResponse':{'type':Sequelize[_0xa0cf('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6747f3a..3ab387c 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 _0x37a8=['motionChannel','event','EventManager','rejectmessage','formData','ioredis','../../components/parsers/qs','api','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','../../config/logger','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','status','json','offset','undefined','limit','count','set','update','destroy','end','sendStatus','stack','name','send','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','order','where','pick','merge','VIRTUAL','filter','options','ChatMessage','rows','rawAttributes','length','include','catch','create','body','find','params','describe','acceptMessage','reject','chat','UserId','user','get','ChatInteraction','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','User','agent','email','interface','channel'];(function(_0x20e72d,_0x4519f9){var _0x5504d1=function(_0x122e2a){while(--_0x122e2a){_0x20e72d['push'](_0x20e72d['shift']());}};_0x5504d1(++_0x4519f9);}(_0x37a8,0x1d6));var _0x837a=function(_0x397127,_0x31429d){_0x397127=_0x397127-0x0;var _0x1d5516=_0x37a8[_0x397127];return _0x1d5516;};'use strict';var util=require('util');var _=require('lodash');var Redis=require(_0x837a('0x0'));var interactionService=require('../../components/interaction/service');var qs=require(_0x837a('0x1'));var logger=require('../../config/logger')(_0x837a('0x2'));var config=require('../../config/environment');var db=require(_0x837a('0x3'))['db'];config['redis']=_[_0x837a('0x4')](config[_0x837a('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x837a('0x6'))(new Redis(config['redis']));require(_0x837a('0x7'))[_0x837a('0x8')](socket);var jayson=require(_0x837a('0x9'));var client=jayson[_0x837a('0xa')][_0x837a('0xb')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var interaction_log=require(_0x837a('0xc'))('chat-interactions');function respondWithRpcPromise(_0x46b4c3,_0x1d618d,_0x56a3d8,_0x5ed626){return new Promise(function(_0x29c649,_0x34a97e){var _0x886de7=_0x5ed626||client;return _0x886de7[_0x837a('0xd')](_0x46b4c3,_0x56a3d8)[_0x837a('0xe')](function(_0x226d0b){logger[_0x837a('0xf')]('ChatMessage,\x20%s,\x20%s',_0x1d618d,_0x837a('0x10'));logger[_0x837a('0x11')](_0x837a('0x12'),_0x1d618d,_0x837a('0x10'),JSON['stringify'](_0x226d0b));if(_0x226d0b[_0x837a('0x13')]){if(_0x226d0b[_0x837a('0x13')][_0x837a('0x14')]===0x1f4){logger[_0x837a('0x13')](_0x837a('0x15'),_0x1d618d,_0x226d0b['error'][_0x837a('0x16')]);return _0x34a97e(_0x226d0b[_0x837a('0x13')][_0x837a('0x16')]);}logger[_0x837a('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1d618d,_0x226d0b[_0x837a('0x13')][_0x837a('0x16')]);return _0x29c649(_0x226d0b[_0x837a('0x13')][_0x837a('0x16')]);}else{logger['info'](_0x837a('0x15'),_0x1d618d,_0x837a('0x10'));_0x29c649(_0x226d0b[_0x837a('0x17')]['message']);}})['catch'](function(_0x1cdad4){logger[_0x837a('0x13')](_0x837a('0x15'),_0x1d618d,_0x1cdad4);_0x34a97e(_0x1cdad4);});});}function respondWithResult(_0x26aeee,_0x4f3233){_0x4f3233=_0x4f3233||0xc8;return function(_0x4c57ac){if(_0x4c57ac){return _0x26aeee[_0x837a('0x18')](_0x4f3233)[_0x837a('0x19')](_0x4c57ac);}};}function respondWithFilteredResult(_0x567b79,_0x897b37){return function(_0x506ed0){if(_0x506ed0){var _0x1d666c=typeof _0x897b37[_0x837a('0x1a')]===_0x837a('0x1b')&&typeof _0x897b37[_0x837a('0x1c')]===_0x837a('0x1b');var _0x5a7212=_0x506ed0[_0x837a('0x1d')];var _0x513344=_0x1d666c?0x0:_0x897b37[_0x837a('0x1a')];var _0x3051d2=_0x1d666c?_0x506ed0['count']:_0x897b37[_0x837a('0x1a')]+_0x897b37['limit'];var _0x3bf6f4;if(_0x3051d2>=_0x5a7212){_0x3051d2=_0x5a7212;_0x3bf6f4=0xc8;}else{_0x3bf6f4=0xce;}_0x567b79[_0x837a('0x18')](_0x3bf6f4);return _0x567b79[_0x837a('0x1e')]('Content-Range',_0x513344+'-'+_0x3051d2+'/'+_0x5a7212)[_0x837a('0x19')](_0x506ed0);}return null;};}function saveUpdates(_0xf6dfdd){return function(_0x478768){if(_0x478768){return _0x478768[_0x837a('0x1f')](_0xf6dfdd)[_0x837a('0xe')](function(_0x49ac47){return _0x49ac47;});}return null;};}function removeEntity(_0x2884ec){return function(_0x272679){if(_0x272679){return _0x272679[_0x837a('0x20')]()['then'](function(){_0x2884ec[_0x837a('0x18')](0xcc)[_0x837a('0x21')]();});}};}function handleEntityNotFound(_0x174695){return function(_0x367896){if(!_0x367896){_0x174695[_0x837a('0x22')](0x194);}return _0x367896;};}function handleError(_0x5e7ca6,_0x3c0977){_0x3c0977=_0x3c0977||0x1f4;return function(_0x357f09){logger[_0x837a('0x13')](_0x357f09[_0x837a('0x23')]);if(_0x357f09['name']){delete _0x357f09[_0x837a('0x24')];}_0x5e7ca6[_0x837a('0x18')](_0x3c0977)[_0x837a('0x25')](_0x357f09);};}exports['index']=function(_0x193489,_0x5d8ce1){var _0x5860df={},_0x3481bc={},_0x27325d={'count':0x0,'rows':[]};var _0x2ed694=_[_0x837a('0x26')](db['ChatMessage']['rawAttributes'],function(_0x391714){return{'name':_0x391714[_0x837a('0x27')],'type':_0x391714[_0x837a('0x28')]['key']};});_0x3481bc['model']=_[_0x837a('0x26')](_0x2ed694,_0x837a('0x24'));_0x3481bc[_0x837a('0x29')]=_[_0x837a('0x2a')](_0x193489['query']);_0x3481bc[_0x837a('0x2b')]=_[_0x837a('0x2c')](_0x3481bc[_0x837a('0x2d')],_0x3481bc[_0x837a('0x29')]);_0x5860df[_0x837a('0x2e')]=_[_0x837a('0x2c')](_0x3481bc[_0x837a('0x2d')],qs[_0x837a('0x2f')](_0x193489[_0x837a('0x29')]['fields']));_0x5860df[_0x837a('0x2e')]=_0x5860df['attributes']['length']?_0x5860df[_0x837a('0x2e')]:_0x3481bc['model'];if(!_0x193489[_0x837a('0x29')]['hasOwnProperty']('nolimit')){_0x5860df[_0x837a('0x1c')]=qs[_0x837a('0x1c')](_0x193489['query'][_0x837a('0x1c')]);_0x5860df[_0x837a('0x1a')]=qs[_0x837a('0x1a')](_0x193489[_0x837a('0x29')][_0x837a('0x1a')]);}_0x5860df[_0x837a('0x30')]=qs['sort'](_0x193489[_0x837a('0x29')]['sort']);_0x5860df[_0x837a('0x31')]=qs[_0x837a('0x2b')](_[_0x837a('0x32')](_0x193489[_0x837a('0x29')],_0x3481bc['filters']),_0x2ed694);if(_0x193489['query']['filter']){_0x5860df[_0x837a('0x31')]=_[_0x837a('0x33')](_0x5860df[_0x837a('0x31')],{'$or':_['map'](_0x2ed694,function(_0x197755){if(_0x197755[_0x837a('0x28')]!==_0x837a('0x34')){var _0x57f556={};_0x57f556[_0x197755['name']]={'$like':'%'+_0x193489[_0x837a('0x29')][_0x837a('0x35')]+'%'};return _0x57f556;}})});}_0x5860df=_['merge']({},_0x5860df,_0x193489[_0x837a('0x36')]);var _0x4106e2={'where':_0x5860df['where']};return db[_0x837a('0x37')][_0x837a('0x1d')](_0x4106e2)[_0x837a('0xe')](function(_0x2c3808){_0x27325d['count']=_0x2c3808;if(_0x193489[_0x837a('0x29')]['includeAll']){_0x5860df['include']=[{'all':!![]}];}return db[_0x837a('0x37')]['findAll'](_0x5860df);})[_0x837a('0xe')](function(_0x100da6){_0x27325d[_0x837a('0x38')]=_0x100da6;return _0x27325d;})[_0x837a('0xe')](respondWithFilteredResult(_0x5d8ce1,_0x5860df))['catch'](handleError(_0x5d8ce1,null));};exports['show']=function(_0x5a2066,_0x18064b){var _0x49df49={'raw':!![],'where':{'id':_0x5a2066['params']['id']}},_0x19b8d4={};_0x19b8d4['model']=_[_0x837a('0x2a')](db[_0x837a('0x37')][_0x837a('0x39')]);_0x19b8d4[_0x837a('0x29')]=_[_0x837a('0x2a')](_0x5a2066[_0x837a('0x29')]);_0x19b8d4[_0x837a('0x2b')]=_[_0x837a('0x2c')](_0x19b8d4[_0x837a('0x2d')],_0x19b8d4[_0x837a('0x29')]);_0x49df49[_0x837a('0x2e')]=_[_0x837a('0x2c')](_0x19b8d4[_0x837a('0x2d')],qs[_0x837a('0x2f')](_0x5a2066['query'][_0x837a('0x2f')]));_0x49df49[_0x837a('0x2e')]=_0x49df49['attributes'][_0x837a('0x3a')]?_0x49df49[_0x837a('0x2e')]:_0x19b8d4[_0x837a('0x2d')];if(_0x5a2066[_0x837a('0x29')]['includeAll']){_0x49df49[_0x837a('0x3b')]=[{'all':!![]}];}_0x49df49=_['merge']({},_0x49df49,_0x5a2066['options']);return db[_0x837a('0x37')]['find'](_0x49df49)[_0x837a('0xe')](handleEntityNotFound(_0x18064b,null))[_0x837a('0xe')](respondWithResult(_0x18064b,null))[_0x837a('0x3c')](handleError(_0x18064b,null));};exports['create']=function(_0x26ce49,_0x36b654){return db[_0x837a('0x37')][_0x837a('0x3d')](_0x26ce49[_0x837a('0x3e')],{})['then'](respondWithResult(_0x36b654,0xc9))[_0x837a('0x3c')](handleError(_0x36b654,null));};exports['update']=function(_0x198cc6,_0x627a04){if(_0x198cc6[_0x837a('0x3e')]['id']){delete _0x198cc6['body']['id'];}return db['ChatMessage'][_0x837a('0x3f')]({'where':{'id':_0x198cc6[_0x837a('0x40')]['id']}})[_0x837a('0xe')](handleEntityNotFound(_0x627a04,null))[_0x837a('0xe')](saveUpdates(_0x198cc6[_0x837a('0x3e')],null))[_0x837a('0xe')](respondWithResult(_0x627a04,null))[_0x837a('0x3c')](handleError(_0x627a04,null));};exports[_0x837a('0x20')]=function(_0x1365d6,_0x443b9c){return db[_0x837a('0x37')][_0x837a('0x3f')]({'where':{'id':_0x1365d6[_0x837a('0x40')]['id']}})[_0x837a('0xe')](handleEntityNotFound(_0x443b9c,null))[_0x837a('0xe')](removeEntity(_0x443b9c,null))[_0x837a('0x3c')](handleError(_0x443b9c,null));};exports['describe']=function(_0x3e6fcf,_0x5f411d){return db[_0x837a('0x37')][_0x837a('0x41')]()[_0x837a('0xe')](respondWithResult(_0x5f411d,null))['catch'](handleError(_0x5f411d,null));};exports['accept']=function(_0x5702ab,_0x460e7e){var _0x4052dd='chat';return interactionService[_0x837a('0x42')](_0x5702ab,_0x4052dd)['then'](respondWithResult(_0x460e7e,null))['catch'](handleError(_0x460e7e,null));};exports[_0x837a('0x43')]=function(_0x293b71,_0x5deca4){var _0x4da61f={'agent':{},'channel':_0x837a('0x44')};if(_0x293b71[_0x837a('0x3e')]['id']){delete _0x293b71[_0x837a('0x3e')]['id'];}_0x293b71['body']['UserId']=_0x293b71[_0x837a('0x3e')][_0x837a('0x45')]||_0x293b71[_0x837a('0x46')]['id'];_0x4da61f['agent']['id']=_0x293b71[_0x837a('0x3e')][_0x837a('0x45')];return db['ChatMessage']['find']({'where':{'id':_0x293b71[_0x837a('0x40')]['id'],'UserId':null}})[_0x837a('0xe')](handleEntityNotFound(_0x5deca4,null))['then'](function(_0x5421c1){if(_0x5421c1){_0x4da61f[_0x837a('0x16')]=_0x5421c1[_0x837a('0x47')]({'plain':!![]});return db[_0x837a('0x48')][_0x837a('0x3f')]({'where':{'id':_0x5421c1['ChatInteractionId']}});}return null;})[_0x837a('0xe')](handleEntityNotFound(_0x5deca4,null))['then'](function(_0x215b91){if(_0x215b91){_0x4da61f[_0x837a('0x49')]=_0x215b91[_0x837a('0x47')]({'plain':!![]});interaction_log[_0x837a('0xf')](_0x837a('0x4a'),_0x293b71[_0x837a('0x46')]['id'],_0x293b71['user'][_0x837a('0x24')],_0x293b71['user'][_0x837a('0x4b')],_0x4da61f['interaction']['id'],_0x293b71[_0x837a('0x3e')]?JSON[_0x837a('0x4c')](_0x293b71['body']):'null');return respondWithRpcPromise(_0x837a('0x4d'),_0x837a('0x4e'),_0x4da61f);}return null;})[_0x837a('0xe')](function(_0x1123c5){var _0x5544d3=_0x837a('0x4f')+_0x1123c5[_0x837a('0x16')]['ContactId'];return db['sequelize']['query'](_0x5544d3,{'type':db[_0x837a('0x50')]['QueryTypes'][_0x837a('0x51')],'raw':!![]})[_0x837a('0xe')](function(_0x29982e){return _0x29982e;});})['then'](function(_0x46ed40){if(_0x46ed40){_0x4da61f['message'][_0x837a('0x52')]=_0x46ed40[0x0];if(!_0x293b71[_0x837a('0x3e')][_0x837a('0x45')])return;return db[_0x837a('0x53')][_0x837a('0x3f')]({'where':{'id':_0x293b71[_0x837a('0x3e')][_0x837a('0x45')],'role':_0x837a('0x54')},'attributes':['id',_0x837a('0x24'),'fullname',_0x837a('0x55'),'internal'],'raw':!![]});}return null;})[_0x837a('0xe')](function(_0x472be4){if(!_0x472be4)return null;_0x4da61f[_0x837a('0x16')][_0x837a('0x54')]=_0x472be4;return _0x4da61f;})[_0x837a('0xe')](function(_0xfdf6f6){if(_0xfdf6f6){_0xfdf6f6[_0x837a('0x16')][_0x837a('0x56')]=util['format']('SIP/%s',_0x293b71[_0x837a('0x46')][_0x837a('0x24')]);_0xfdf6f6[_0x837a('0x16')]['channel']=_0x4da61f[_0x837a('0x57')];_0xfdf6f6[_0x837a('0x16')][_0x837a('0x58')]=_0x4da61f['channel'];_0xfdf6f6[_0x837a('0x16')][_0x837a('0x59')]=_0x837a('0x43');respondWithRpcPromise(_0x837a('0x5a'),_0x837a('0x5a'),{'event':_0x837a('0x5b'),'message':_[_0x837a('0x33')](_0x4da61f[_0x837a('0x16')],JSON['parse'](_0x4da61f['interaction'][_0x837a('0x5c')]))},client9002);return _0x4da61f;}return null;})[_0x837a('0xe')](respondWithResult(_0x5deca4,null))['catch'](handleError(_0x5deca4,null));};
\ No newline at end of file
+var _0x8e74=['fullname','email','internal','interface','channel','motionChannel','event','EventManager','formData','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','limit','update','destroy','end','sendStatus','stack','name','index','ChatMessage','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','describe','accept','chat','reject','UserId','user','agent','get','ChatInteractionId','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8e74,0x189));var _0x48e7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e74[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0x48e7('0x0'));var Redis=require(_0x48e7('0x1'));var interactionService=require('../../components/interaction/service');var qs=require(_0x48e7('0x2'));var logger=require(_0x48e7('0x3'))('api');var config=require(_0x48e7('0x4'));var db=require(_0x48e7('0x5'))['db'];config[_0x48e7('0x6')]=_['defaults'](config[_0x48e7('0x6')],{'host':_0x48e7('0x7'),'port':0x18eb});var socket=require(_0x48e7('0x8'))(new Redis(config[_0x48e7('0x6')]));require(_0x48e7('0x9'))[_0x48e7('0xa')](socket);var jayson=require(_0x48e7('0xb'));var client=jayson[_0x48e7('0xc')][_0x48e7('0xd')]({'port':0x232c});var client9002=jayson[_0x48e7('0xc')][_0x48e7('0xd')]({'port':0x232a});var interaction_log=require(_0x48e7('0x3'))('chat-interactions');function respondWithRpcPromise(_0x3b0136,_0x4a7240,_0x48f10e,_0x279cba){return new Promise(function(_0x2ed224,_0x528b51){var _0x5ce0f8=_0x279cba||client;return _0x5ce0f8[_0x48e7('0xe')](_0x3b0136,_0x48f10e)[_0x48e7('0xf')](function(_0x3b0610){logger[_0x48e7('0x10')]('ChatMessage,\x20%s,\x20%s',_0x4a7240,_0x48e7('0x11'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4a7240,'request\x20sent',JSON['stringify'](_0x3b0610));if(_0x3b0610[_0x48e7('0x12')]){if(_0x3b0610[_0x48e7('0x12')][_0x48e7('0x13')]===0x1f4){logger[_0x48e7('0x12')](_0x48e7('0x14'),_0x4a7240,_0x3b0610[_0x48e7('0x12')][_0x48e7('0x15')]);return _0x528b51(_0x3b0610[_0x48e7('0x12')][_0x48e7('0x15')]);}logger[_0x48e7('0x12')](_0x48e7('0x14'),_0x4a7240,_0x3b0610[_0x48e7('0x12')][_0x48e7('0x15')]);return _0x2ed224(_0x3b0610[_0x48e7('0x12')][_0x48e7('0x15')]);}else{logger['info'](_0x48e7('0x14'),_0x4a7240,'request\x20sent');_0x2ed224(_0x3b0610[_0x48e7('0x16')][_0x48e7('0x15')]);}})[_0x48e7('0x17')](function(_0x3a2bb3){logger[_0x48e7('0x12')](_0x48e7('0x14'),_0x4a7240,_0x3a2bb3);_0x528b51(_0x3a2bb3);});});}function respondWithResult(_0x7cae1f,_0x38f21c){_0x38f21c=_0x38f21c||0xc8;return function(_0x59649f){if(_0x59649f){return _0x7cae1f[_0x48e7('0x18')](_0x38f21c)[_0x48e7('0x19')](_0x59649f);}};}function respondWithFilteredResult(_0x4d05ed,_0x472eea){return function(_0xbee7b4){if(_0xbee7b4){var _0x89b571=typeof _0x472eea[_0x48e7('0x1a')]===_0x48e7('0x1b')&&typeof _0x472eea['limit']==='undefined';var _0x445d0e=_0xbee7b4[_0x48e7('0x1c')];var _0x26da01=_0x89b571?0x0:_0x472eea[_0x48e7('0x1a')];var _0x513a3f=_0x89b571?_0xbee7b4[_0x48e7('0x1c')]:_0x472eea[_0x48e7('0x1a')]+_0x472eea[_0x48e7('0x1d')];var _0x2421c2;if(_0x513a3f>=_0x445d0e){_0x513a3f=_0x445d0e;_0x2421c2=0xc8;}else{_0x2421c2=0xce;}_0x4d05ed[_0x48e7('0x18')](_0x2421c2);return _0x4d05ed['set']('Content-Range',_0x26da01+'-'+_0x513a3f+'/'+_0x445d0e)[_0x48e7('0x19')](_0xbee7b4);}return null;};}function saveUpdates(_0x2f35e8){return function(_0x5b6b51){if(_0x5b6b51){return _0x5b6b51[_0x48e7('0x1e')](_0x2f35e8)['then'](function(_0x2cdf75){return _0x2cdf75;});}return null;};}function removeEntity(_0xf1b55b){return function(_0x6a7a7f){if(_0x6a7a7f){return _0x6a7a7f[_0x48e7('0x1f')]()[_0x48e7('0xf')](function(){_0xf1b55b[_0x48e7('0x18')](0xcc)[_0x48e7('0x20')]();});}};}function handleEntityNotFound(_0x1a6591){return function(_0x3ca412){if(!_0x3ca412){_0x1a6591[_0x48e7('0x21')](0x194);}return _0x3ca412;};}function handleError(_0x197274,_0x763e05){_0x763e05=_0x763e05||0x1f4;return function(_0x4acec0){logger['error'](_0x4acec0[_0x48e7('0x22')]);if(_0x4acec0['name']){delete _0x4acec0[_0x48e7('0x23')];}_0x197274['status'](_0x763e05)['send'](_0x4acec0);};}exports[_0x48e7('0x24')]=function(_0x5ffc66,_0x339a56){var _0x505923={},_0xb98a10={},_0x38a495={'count':0x0,'rows':[]};var _0x552061=_['map'](db[_0x48e7('0x25')]['rawAttributes'],function(_0x561e38){return{'name':_0x561e38[_0x48e7('0x26')],'type':_0x561e38[_0x48e7('0x27')][_0x48e7('0x28')]};});_0xb98a10[_0x48e7('0x29')]=_[_0x48e7('0x2a')](_0x552061,_0x48e7('0x23'));_0xb98a10[_0x48e7('0x2b')]=_[_0x48e7('0x2c')](_0x5ffc66['query']);_0xb98a10[_0x48e7('0x2d')]=_[_0x48e7('0x2e')](_0xb98a10[_0x48e7('0x29')],_0xb98a10[_0x48e7('0x2b')]);_0x505923[_0x48e7('0x2f')]=_[_0x48e7('0x2e')](_0xb98a10[_0x48e7('0x29')],qs[_0x48e7('0x30')](_0x5ffc66['query'][_0x48e7('0x30')]));_0x505923[_0x48e7('0x2f')]=_0x505923[_0x48e7('0x2f')]['length']?_0x505923[_0x48e7('0x2f')]:_0xb98a10['model'];if(!_0x5ffc66[_0x48e7('0x2b')]['hasOwnProperty'](_0x48e7('0x31'))){_0x505923['limit']=qs['limit'](_0x5ffc66[_0x48e7('0x2b')][_0x48e7('0x1d')]);_0x505923[_0x48e7('0x1a')]=qs[_0x48e7('0x1a')](_0x5ffc66[_0x48e7('0x2b')][_0x48e7('0x1a')]);}_0x505923[_0x48e7('0x32')]=qs[_0x48e7('0x33')](_0x5ffc66['query'][_0x48e7('0x33')]);_0x505923[_0x48e7('0x34')]=qs[_0x48e7('0x2d')](_[_0x48e7('0x35')](_0x5ffc66['query'],_0xb98a10[_0x48e7('0x2d')]),_0x552061);if(_0x5ffc66['query'][_0x48e7('0x36')]){_0x505923[_0x48e7('0x34')]=_[_0x48e7('0x37')](_0x505923[_0x48e7('0x34')],{'$or':_[_0x48e7('0x2a')](_0x552061,function(_0x395dad){if(_0x395dad[_0x48e7('0x27')]!=='VIRTUAL'){var _0x59b2b2={};_0x59b2b2[_0x395dad[_0x48e7('0x23')]]={'$like':'%'+_0x5ffc66[_0x48e7('0x2b')][_0x48e7('0x36')]+'%'};return _0x59b2b2;}})});}_0x505923=_['merge']({},_0x505923,_0x5ffc66['options']);var _0x52117d={'where':_0x505923['where']};return db['ChatMessage'][_0x48e7('0x1c')](_0x52117d)[_0x48e7('0xf')](function(_0x3a7128){_0x38a495[_0x48e7('0x1c')]=_0x3a7128;if(_0x5ffc66[_0x48e7('0x2b')][_0x48e7('0x38')]){_0x505923[_0x48e7('0x39')]=[{'all':!![]}];}return db['ChatMessage'][_0x48e7('0x3a')](_0x505923);})[_0x48e7('0xf')](function(_0x561876){_0x38a495[_0x48e7('0x3b')]=_0x561876;return _0x38a495;})[_0x48e7('0xf')](respondWithFilteredResult(_0x339a56,_0x505923))[_0x48e7('0x17')](handleError(_0x339a56,null));};exports[_0x48e7('0x3c')]=function(_0x412f3f,_0x3c8219){var _0xe0bddb={'raw':!![],'where':{'id':_0x412f3f['params']['id']}},_0x5120e7={};_0x5120e7[_0x48e7('0x29')]=_[_0x48e7('0x2c')](db[_0x48e7('0x25')][_0x48e7('0x3d')]);_0x5120e7['query']=_['keys'](_0x412f3f[_0x48e7('0x2b')]);_0x5120e7['filters']=_[_0x48e7('0x2e')](_0x5120e7[_0x48e7('0x29')],_0x5120e7[_0x48e7('0x2b')]);_0xe0bddb[_0x48e7('0x2f')]=_[_0x48e7('0x2e')](_0x5120e7['model'],qs[_0x48e7('0x30')](_0x412f3f[_0x48e7('0x2b')]['fields']));_0xe0bddb[_0x48e7('0x2f')]=_0xe0bddb['attributes']['length']?_0xe0bddb[_0x48e7('0x2f')]:_0x5120e7[_0x48e7('0x29')];if(_0x412f3f[_0x48e7('0x2b')][_0x48e7('0x38')]){_0xe0bddb[_0x48e7('0x39')]=[{'all':!![]}];}_0xe0bddb=_[_0x48e7('0x37')]({},_0xe0bddb,_0x412f3f['options']);return db[_0x48e7('0x25')][_0x48e7('0x3e')](_0xe0bddb)['then'](handleEntityNotFound(_0x3c8219,null))[_0x48e7('0xf')](respondWithResult(_0x3c8219,null))[_0x48e7('0x17')](handleError(_0x3c8219,null));};exports[_0x48e7('0x3f')]=function(_0x31bfd7,_0x2e4eb0){return db[_0x48e7('0x25')][_0x48e7('0x3f')](_0x31bfd7['body'],{})[_0x48e7('0xf')](respondWithResult(_0x2e4eb0,0xc9))['catch'](handleError(_0x2e4eb0,null));};exports[_0x48e7('0x1e')]=function(_0x21e58d,_0x4a1ab0){if(_0x21e58d[_0x48e7('0x40')]['id']){delete _0x21e58d[_0x48e7('0x40')]['id'];}return db['ChatMessage'][_0x48e7('0x3e')]({'where':{'id':_0x21e58d[_0x48e7('0x41')]['id']}})[_0x48e7('0xf')](handleEntityNotFound(_0x4a1ab0,null))[_0x48e7('0xf')](saveUpdates(_0x21e58d[_0x48e7('0x40')],null))[_0x48e7('0xf')](respondWithResult(_0x4a1ab0,null))[_0x48e7('0x17')](handleError(_0x4a1ab0,null));};exports[_0x48e7('0x1f')]=function(_0x3a6aa0,_0x599fd3){return db['ChatMessage'][_0x48e7('0x3e')]({'where':{'id':_0x3a6aa0[_0x48e7('0x41')]['id']}})[_0x48e7('0xf')](handleEntityNotFound(_0x599fd3,null))[_0x48e7('0xf')](removeEntity(_0x599fd3,null))['catch'](handleError(_0x599fd3,null));};exports[_0x48e7('0x42')]=function(_0x28859e,_0x2a9e03){return db[_0x48e7('0x25')][_0x48e7('0x42')]()['then'](respondWithResult(_0x2a9e03,null))['catch'](handleError(_0x2a9e03,null));};exports[_0x48e7('0x43')]=function(_0x473a16,_0x3ca4c9){var _0x4191c9=_0x48e7('0x44');return interactionService['acceptMessage'](_0x473a16,_0x4191c9)[_0x48e7('0xf')](respondWithResult(_0x3ca4c9,null))[_0x48e7('0x17')](handleError(_0x3ca4c9,null));};exports[_0x48e7('0x45')]=function(_0x4eeeee,_0x596ffd){var _0x26dfc7={'agent':{},'channel':_0x48e7('0x44')};if(_0x4eeeee[_0x48e7('0x40')]['id']){delete _0x4eeeee[_0x48e7('0x40')]['id'];}_0x4eeeee[_0x48e7('0x40')][_0x48e7('0x46')]=_0x4eeeee[_0x48e7('0x40')]['UserId']||_0x4eeeee[_0x48e7('0x47')]['id'];_0x26dfc7[_0x48e7('0x48')]['id']=_0x4eeeee[_0x48e7('0x40')][_0x48e7('0x46')];return db['ChatMessage'][_0x48e7('0x3e')]({'where':{'id':_0x4eeeee[_0x48e7('0x41')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x596ffd,null))['then'](function(_0x4d7a55){if(_0x4d7a55){_0x26dfc7[_0x48e7('0x15')]=_0x4d7a55[_0x48e7('0x49')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4d7a55[_0x48e7('0x4a')]}});}return null;})['then'](handleEntityNotFound(_0x596ffd,null))[_0x48e7('0xf')](function(_0x3e818b){if(_0x3e818b){_0x26dfc7[_0x48e7('0x4b')]=_0x3e818b['get']({'plain':!![]});interaction_log[_0x48e7('0x10')](_0x48e7('0x4c'),_0x4eeeee[_0x48e7('0x47')]['id'],_0x4eeeee[_0x48e7('0x47')][_0x48e7('0x23')],_0x4eeeee['user'][_0x48e7('0x4d')],_0x26dfc7[_0x48e7('0x4b')]['id'],_0x4eeeee[_0x48e7('0x40')]?JSON[_0x48e7('0x4e')](_0x4eeeee[_0x48e7('0x40')]):'null');return respondWithRpcPromise(_0x48e7('0x4f'),_0x48e7('0x50'),_0x26dfc7);}return null;})[_0x48e7('0xf')](function(_0x5b91b8){var _0x5a95a8=_0x48e7('0x51')+_0x5b91b8[_0x48e7('0x15')][_0x48e7('0x52')];return db[_0x48e7('0x53')][_0x48e7('0x2b')](_0x5a95a8,{'type':db['Sequelize'][_0x48e7('0x54')][_0x48e7('0x55')],'raw':!![]})['then'](function(_0x2b7913){return _0x2b7913;});})[_0x48e7('0xf')](function(_0x23b6b8){if(_0x23b6b8){_0x26dfc7[_0x48e7('0x15')]['contact']=_0x23b6b8[0x0];if(!_0x4eeeee[_0x48e7('0x40')]['UserId'])return;return db[_0x48e7('0x56')][_0x48e7('0x3e')]({'where':{'id':_0x4eeeee[_0x48e7('0x40')][_0x48e7('0x46')],'role':_0x48e7('0x48')},'attributes':['id','name',_0x48e7('0x57'),_0x48e7('0x58'),_0x48e7('0x59')],'raw':!![]});}return null;})[_0x48e7('0xf')](function(_0x30a8c7){if(!_0x30a8c7)return null;_0x26dfc7['message'][_0x48e7('0x48')]=_0x30a8c7;return _0x26dfc7;})[_0x48e7('0xf')](function(_0x1625b1){if(_0x1625b1){_0x1625b1['message'][_0x48e7('0x5a')]=util['format']('SIP/%s',_0x4eeeee[_0x48e7('0x47')][_0x48e7('0x23')]);_0x1625b1['message'][_0x48e7('0x5b')]=_0x26dfc7[_0x48e7('0x5b')];_0x1625b1[_0x48e7('0x15')][_0x48e7('0x5c')]=_0x26dfc7['channel'];_0x1625b1[_0x48e7('0x15')][_0x48e7('0x5d')]=_0x48e7('0x45');respondWithRpcPromise(_0x48e7('0x5e'),'EventManager',{'event':'rejectmessage','message':_[_0x48e7('0x37')](_0x26dfc7[_0x48e7('0x15')],JSON['parse'](_0x26dfc7['interaction'][_0x48e7('0x5f')]))},client9002);return _0x26dfc7;}return null;})[_0x48e7('0xf')](respondWithResult(_0x596ffd,null))[_0x48e7('0x17')](handleError(_0x596ffd,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 458046f..fc04452 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 _0x1525=['events','ChatMessage','save','emit','hasOwnProperty','exports'];(function(_0x916a95,_0x3655d2){var _0x5b94b0=function(_0x49055e){while(--_0x49055e){_0x916a95['push'](_0x916a95['shift']());}};_0x5b94b0(++_0x3655d2);}(_0x1525,0x96));var _0x5152=function(_0x23b8ff,_0x1866d0){_0x23b8ff=_0x23b8ff-0x0;var _0x5c6247=_0x1525[_0x23b8ff];return _0x5c6247;};'use strict';var EventEmitter=require(_0x5152('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x5152('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5152('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4157aa){return function(_0x254f30,_0x4e63f8,_0x5e9f96){ChatMessageEvents[_0x5152('0x3')](_0x4157aa+':'+_0x254f30['id'],_0x254f30);ChatMessageEvents[_0x5152('0x3')](_0x4157aa,_0x254f30);_0x5e9f96(null);};}for(var e in events){if(events[_0x5152('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5152('0x5')]=ChatMessageEvents;
\ No newline at end of file
+var _0x0769=['hook','exports','events','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0769,0xda));var _0x9076=function(_0x204587,_0x3e40c2){_0x204587=_0x204587-0x0;var _0x224eb0=_0x0769[_0x204587];return _0x224eb0;};'use strict';var EventEmitter=require(_0x9076('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x9076('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9076('0x2')](0x0);var events={'afterCreate':_0x9076('0x3'),'afterUpdate':_0x9076('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e3b88){return function(_0x55b70b,_0x4215e4,_0x2c435a){ChatMessageEvents[_0x9076('0x5')](_0x2e3b88+':'+_0x55b70b['id'],_0x55b70b);ChatMessageEvents[_0x9076('0x5')](_0x2e3b88,_0x55b70b);_0x2c435a(null);};}for(var e in events){if(events[_0x9076('0x6')](e)){var event=events[e];ChatMessage[_0x9076('0x7')](e,emitEvent(event));}}module[_0x9076('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 9209438..005794c 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 _0x02ef=['models','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','catch','utf8mb4','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT'];(function(_0x5ebb4d,_0x3180ec){var _0x7e1980=function(_0x1ec1dd){while(--_0x1ec1dd){_0x5ebb4d['push'](_0x5ebb4d['shift']());}};_0x7e1980(++_0x3180ec);}(_0x02ef,0x11a));var _0xf02e=function(_0x3cef2a,_0x48bc9d){_0x3cef2a=_0x3cef2a-0x0;var _0x4a303b=_0x02ef[_0x3cef2a];return _0x4a303b;};'use strict';var _=require(_0xf02e('0x0'));var util=require('util');var logger=require(_0xf02e('0x1'))('api');var moment=require(_0xf02e('0x2'));var BPromise=require(_0xf02e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf02e('0x4'));var rimraf=require(_0xf02e('0x5'));var config=require(_0xf02e('0x6'));var attributes=require(_0xf02e('0x7'));module[_0xf02e('0x8')]=function(_0x511257,_0x332c29){return _0x511257[_0xf02e('0x9')](_0xf02e('0xa'),attributes,{'tableName':_0xf02e('0xb'),'paranoid':![],'indexes':[{'name':_0xf02e('0xc'),'fields':[_0xf02e('0xd')],'type':_0xf02e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x277f1f,_0x22a384,_0x338043){var _0x29d81c=_0x511257[_0xf02e('0xf')];var _0x58f9ec=_0x277f1f['get']({'plain':!![]});if(_0x58f9ec[_0xf02e('0x10')][_0xf02e('0x11')]()==='in'||_0x58f9ec['direction']['toLowerCase']()==='out'&&!_0x58f9ec[_0xf02e('0x12')]&&!_[_0xf02e('0x13')](_0x58f9ec[_0xf02e('0x14')])){_0x29d81c[_0xf02e('0x15')][_0xf02e('0x16')]({'where':{'id':_0x58f9ec[_0xf02e('0x17')]}})['then'](function(_0x46f22b){if(_0x46f22b){_0x46f22b['update']({'lastMsgAt':_0x58f9ec[_0xf02e('0x18')],'lastMsgDirection':_0x58f9ec[_0xf02e('0x10')]['toLowerCase']()});}})[_0xf02e('0x19')](function(_0x322e2a){console['error'](_0x322e2a);});}_0x338043();}},'charset':_0xf02e('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd772=['../../config/logger','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','util'];(function(_0x4b7c2a,_0x3de9a8){var _0x405fe6=function(_0x56a583){while(--_0x56a583){_0x4b7c2a['push'](_0x4b7c2a['shift']());}};_0x405fe6(++_0x3de9a8);}(_0xd772,0xd7));var _0x2d77=function(_0x4f0853,_0x13791a){_0x4f0853=_0x4f0853-0x0;var _0x59c809=_0xd772[_0x4f0853];return _0x59c809;};'use strict';var _=require('lodash');var util=require(_0x2d77('0x0'));var logger=require(_0x2d77('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2d77('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d77('0x3'));var rimraf=require(_0x2d77('0x4'));var config=require(_0x2d77('0x5'));var attributes=require(_0x2d77('0x6'));module['exports']=function(_0x2a7860,_0x1ad986){return _0x2a7860[_0x2d77('0x7')]('ChatMessage',attributes,{'tableName':_0x2d77('0x8'),'paranoid':![],'indexes':[{'name':_0x2d77('0x9'),'fields':['body'],'type':_0x2d77('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20f8ad,_0x27f698,_0x1b798a){var _0x559bbc=_0x2a7860[_0x2d77('0xb')];var _0x4b78c=_0x20f8ad[_0x2d77('0xc')]({'plain':!![]});if(_0x4b78c[_0x2d77('0xd')][_0x2d77('0xe')]()==='in'||_0x4b78c[_0x2d77('0xd')][_0x2d77('0xe')]()===_0x2d77('0xf')&&!_0x4b78c['secret']&&!_[_0x2d77('0x10')](_0x4b78c[_0x2d77('0x11')])){_0x559bbc[_0x2d77('0x12')][_0x2d77('0x13')]({'where':{'id':_0x4b78c[_0x2d77('0x14')]}})[_0x2d77('0x15')](function(_0x431d5c){if(_0x431d5c){_0x431d5c[_0x2d77('0x16')]({'lastMsgAt':_0x4b78c[_0x2d77('0x17')],'lastMsgDirection':_0x4b78c[_0x2d77('0xd')][_0x2d77('0xe')]()});}})[_0x2d77('0x18')](function(_0x29d308){console[_0x2d77('0x19')](_0x29d308);});}_0x1b798a();}},'charset':_0x2d77('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 17871c6..7c9b380 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 _0x3c54=['raw','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','message','result','CreateChatMessage','ChatMessage','create','body','options'];(function(_0x54a229,_0x479dd1){var _0x36232e=function(_0x48a4d3){while(--_0x48a4d3){_0x54a229['push'](_0x54a229['shift']());}};_0x36232e(++_0x479dd1);}(_0x3c54,0x14d));var _0x43c5=function(_0x3c253c,_0x4c67ff){_0x3c253c=_0x3c253c-0x0;var _0x34c520=_0x3c54[_0x3c253c];return _0x34c520;};'use strict';var _=require(_0x43c5('0x0'));var util=require(_0x43c5('0x1'));var moment=require(_0x43c5('0x2'));var BPromise=require(_0x43c5('0x3'));var rs=require(_0x43c5('0x4'));var fs=require('fs');var Redis=require(_0x43c5('0x5'));var db=require(_0x43c5('0x6'))['db'];var utils=require(_0x43c5('0x7'));var logger=require(_0x43c5('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x43c5('0x9'));var client=jayson['client'][_0x43c5('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x43c5('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43c5('0xb')]));require(_0x43c5('0xc'))[_0x43c5('0xd')](socket);function respondWithRpcPromise(_0x3b40bd,_0x15d246,_0x11c36c){return new BPromise(function(_0x4d485e,_0x1ccca8){return client[_0x43c5('0xe')](_0x3b40bd,_0x11c36c)[_0x43c5('0xf')](function(_0x4b5b67){logger[_0x43c5('0x10')](_0x43c5('0x11'),_0x15d246,_0x43c5('0x12'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x15d246,_0x43c5('0x12'),JSON['stringify'](_0x4b5b67));if(_0x4b5b67[_0x43c5('0x13')]){if(_0x4b5b67[_0x43c5('0x13')]['code']===0x1f4){logger[_0x43c5('0x13')]('ChatMessage,\x20%s,\x20%s',_0x15d246,_0x4b5b67[_0x43c5('0x13')]['message']);return _0x1ccca8(_0x4b5b67['error'][_0x43c5('0x14')]);}logger[_0x43c5('0x13')](_0x43c5('0x11'),_0x15d246,_0x4b5b67[_0x43c5('0x13')][_0x43c5('0x14')]);return _0x4d485e(_0x4b5b67[_0x43c5('0x13')][_0x43c5('0x14')]);}else{logger['info'](_0x43c5('0x11'),_0x15d246,'request\x20sent');_0x4d485e(_0x4b5b67[_0x43c5('0x15')][_0x43c5('0x14')]);}})['catch'](function(_0x503d2b){logger[_0x43c5('0x13')](_0x43c5('0x11'),_0x15d246,_0x503d2b);_0x1ccca8(_0x503d2b);});});}exports[_0x43c5('0x16')]=function(_0x3f5378){var _0x30a435=this;return new Promise(function(_0x1859fd,_0x1bb433){return db[_0x43c5('0x17')][_0x43c5('0x18')](_0x3f5378[_0x43c5('0x19')],{'raw':_0x3f5378[_0x43c5('0x1a')]?_0x3f5378[_0x43c5('0x1a')][_0x43c5('0x1b')]===undefined?!![]:![]:!![]})[_0x43c5('0xf')](function(_0x4ff391){logger['info'](_0x43c5('0x16'),_0x3f5378);logger[_0x43c5('0x1c')](_0x43c5('0x16'),_0x3f5378,JSON[_0x43c5('0x1d')](_0x4ff391));_0x1859fd(_0x4ff391);})['catch'](function(_0x1684c5){logger[_0x43c5('0x13')]('CreateChatMessage',_0x1684c5[_0x43c5('0x14')],_0x3f5378);_0x1bb433(_0x30a435[_0x43c5('0x13')](0x1f4,_0x1684c5[_0x43c5('0x14')]));});});};
\ No newline at end of file
+var _0x18e9=['http','defaults','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','create','body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x59747c,_0x4de5fc){var _0x5b7e3a=function(_0x58741c){while(--_0x58741c){_0x59747c['push'](_0x59747c['shift']());}};_0x5b7e3a(++_0x4de5fc);}(_0x18e9,0x1e5));var _0x918e=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0x18e9[_0x3a3c17];return _0xd07f21;};'use strict';var _=require(_0x918e('0x0'));var util=require(_0x918e('0x1'));var moment=require(_0x918e('0x2'));var BPromise=require(_0x918e('0x3'));var rs=require(_0x918e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x918e('0x5'))['db'];var utils=require(_0x918e('0x6'));var logger=require('../../config/logger')(_0x918e('0x7'));var config=require('../../config/environment');var jayson=require(_0x918e('0x8'));var client=jayson[_0x918e('0x9')][_0x918e('0xa')]({'port':0x232a});config['redis']=_[_0x918e('0xb')](config[_0x918e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x918e('0xd'))(new Redis(config[_0x918e('0xc')]));require(_0x918e('0xe'))[_0x918e('0xf')](socket);function respondWithRpcPromise(_0x2a7a5a,_0x335f8b,_0x403dd2){return new BPromise(function(_0x11510a,_0x545ed1){return client[_0x918e('0x10')](_0x2a7a5a,_0x403dd2)[_0x918e('0x11')](function(_0x5a8390){logger[_0x918e('0x12')]('ChatMessage,\x20%s,\x20%s',_0x335f8b,_0x918e('0x13'));logger[_0x918e('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x335f8b,_0x918e('0x13'),JSON[_0x918e('0x15')](_0x5a8390));if(_0x5a8390[_0x918e('0x16')]){if(_0x5a8390[_0x918e('0x16')][_0x918e('0x17')]===0x1f4){logger[_0x918e('0x16')](_0x918e('0x18'),_0x335f8b,_0x5a8390['error']['message']);return _0x545ed1(_0x5a8390[_0x918e('0x16')][_0x918e('0x19')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x335f8b,_0x5a8390[_0x918e('0x16')][_0x918e('0x19')]);return _0x11510a(_0x5a8390[_0x918e('0x16')]['message']);}else{logger[_0x918e('0x12')](_0x918e('0x18'),_0x335f8b,'request\x20sent');_0x11510a(_0x5a8390[_0x918e('0x1a')]['message']);}})[_0x918e('0x1b')](function(_0x38a621){logger[_0x918e('0x16')](_0x918e('0x18'),_0x335f8b,_0x38a621);_0x545ed1(_0x38a621);});});}exports['CreateChatMessage']=function(_0x2aa152){var _0x218862=this;return new Promise(function(_0x6f2728,_0x1d8777){return db['ChatMessage'][_0x918e('0x1c')](_0x2aa152[_0x918e('0x1d')],{'raw':_0x2aa152[_0x918e('0x1e')]?_0x2aa152[_0x918e('0x1e')][_0x918e('0x1f')]===undefined?!![]:![]:!![]})[_0x918e('0x11')](function(_0x41968e){logger[_0x918e('0x12')](_0x918e('0x20'),_0x2aa152);logger[_0x918e('0x14')](_0x918e('0x20'),_0x2aa152,JSON[_0x918e('0x15')](_0x41968e));_0x6f2728(_0x41968e);})[_0x918e('0x1b')](function(_0x3b7e92){logger[_0x918e('0x16')](_0x918e('0x20'),_0x3b7e92[_0x918e('0x19')],_0x2aa152);_0x1d8777(_0x218862[_0x918e('0x16')](0x1f4,_0x3b7e92[_0x918e('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 8eb8cb0..d96d231 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 _0x0faf=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','remove'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0x0faf,0x132));var _0xf0fa=function(_0x177cc9,_0x3f6fdd){_0x177cc9=_0x177cc9-0x0;var _0x2fe577=_0x0faf[_0x177cc9];return _0x2fe577;};'use strict';var ChatMessageEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatMessageEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatMessageEvents['on'](_0x2db1d9,_0x587865);}};
\ No newline at end of file
+var _0x1c3b=['removeListener','./chatMessage.events','save','remove','emit'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x1c3b,0xab));var _0xb1c3=function(_0x514c64,_0x29a704){_0x514c64=_0x514c64-0x0;var _0x5b0287=_0x1c3b[_0x514c64];return _0x5b0287;};'use strict';var ChatMessageEvents=require(_0xb1c3('0x0'));var events=[_0xb1c3('0x1'),_0xb1c3('0x2'),'update'];function createListener(_0x4eeac2,_0x28a375){return function(_0x89ce0b){_0x28a375[_0xb1c3('0x3')](_0x4eeac2,_0x89ce0b);};}function removeListener(_0x34dbb5,_0x24d4c0){return function(){ChatMessageEvents[_0xb1c3('0x4')](_0x34dbb5,_0x24d4c0);};}exports['register']=function(_0x472813){for(var _0x62da34=0x0,_0x211254=events['length'];_0x62da34<_0x211254;_0x62da34++){var _0x504fc9=events[_0x62da34];var _0x4ed6cf=createListener('chatMessage:'+_0x504fc9,_0x472813);ChatMessageEvents['on'](_0x504fc9,_0x4ed6cf);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ab035d6..013c146 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 _0x4192=['../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','delete','exports','util','path','../../components/interaction/service'];(function(_0x41f720,_0x32db46){var _0x582237=function(_0x371ba3){while(--_0x371ba3){_0x41f720['push'](_0x41f720['shift']());}};_0x582237(++_0x32db46);}(_0x4192,0x97));var _0x2419=function(_0x11a287,_0x57df55){_0x11a287=_0x11a287-0x0;var _0x111e64=_0x4192[_0x11a287];return _0x111e64;};'use strict';var multer=require('multer');var util=require(_0x2419('0x0'));var path=require(_0x2419('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2419('0x2'));var config=require(_0x2419('0x3'));var controller=require(_0x2419('0x4'));router[_0x2419('0x5')]('/',auth[_0x2419('0x6')](),controller[_0x2419('0x7')]);router['get'](_0x2419('0x8'),auth[_0x2419('0x6')](),controller[_0x2419('0x9')]);router[_0x2419('0x5')](_0x2419('0xa'),auth[_0x2419('0x6')](),controller[_0x2419('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x2419('0xc')](_0x2419('0xd'),_0x2419('0xe')),controller['create']);router[_0x2419('0xf')](_0x2419('0xa'),controller[_0x2419('0x10')]);router[_0x2419('0xf')](_0x2419('0x11'),auth[_0x2419('0x6')](),controller[_0x2419('0x12')]);router[_0x2419('0xf')](_0x2419('0x13'),auth[_0x2419('0x6')](),controller['reject']);router[_0x2419('0x14')](_0x2419('0xa'),auth[_0x2419('0x6')](),controller['destroy']);module[_0x2419('0x15')]=router;
\ No newline at end of file
+var _0x57a6=['../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','reject','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x310ab4,_0x525c3e){var _0x28dfbb=function(_0x18820a){while(--_0x18820a){_0x310ab4['push'](_0x310ab4['shift']());}};_0x28dfbb(++_0x525c3e);}(_0x57a6,0x172));var _0x657a=function(_0x2ba9aa,_0x2cdb8f){_0x2ba9aa=_0x2ba9aa-0x0;var _0x4b753b=_0x57a6[_0x2ba9aa];return _0x4b753b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x657a('0x0'));var express=require(_0x657a('0x1'));var router=express[_0x657a('0x2')]();var fs_extra=require(_0x657a('0x3'));var auth=require(_0x657a('0x4'));var interaction=require(_0x657a('0x5'));var config=require(_0x657a('0x6'));var controller=require(_0x657a('0x7'));router['get']('/',auth[_0x657a('0x8')](),controller[_0x657a('0x9')]);router[_0x657a('0xa')](_0x657a('0xb'),auth['isAuthenticated'](),controller[_0x657a('0xc')]);router[_0x657a('0xa')](_0x657a('0xd'),auth[_0x657a('0x8')](),controller[_0x657a('0xe')]);router['post']('/',auth[_0x657a('0x8')](),interaction[_0x657a('0xf')](_0x657a('0x10'),_0x657a('0x11')),controller['create']);router[_0x657a('0x12')](_0x657a('0xd'),controller[_0x657a('0x13')]);router[_0x657a('0x12')](_0x657a('0x14'),auth[_0x657a('0x8')](),controller[_0x657a('0x15')]);router[_0x657a('0x12')]('/:id/reject',auth[_0x657a('0x8')](),controller[_0x657a('0x16')]);router[_0x657a('0x17')](_0x657a('0xd'),auth[_0x657a('0x8')](),controller[_0x657a('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b15b234..1b27ca6 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['medium','exports','TEXT'];(function(_0x2554b6,_0x22e703){var _0x4b23b9=function(_0x1b025c){while(--_0x1b025c){_0x2554b6['push'](_0x2554b6['shift']());}};_0x4b23b9(++_0x22e703);}(_0x2032,0xd9));var _0x2203=function(_0x279944,_0x34ad4c){_0x279944=_0x279944-0x0;var _0x16ae3c=_0x2032[_0x279944];return _0x16ae3c;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x267bc6,_0x1843a7){var _0x14856c=function(_0x37e51f){while(--_0x37e51f){_0x267bc6['push'](_0x267bc6['shift']());}};_0x14856c(++_0x1843a7);}(_0xdb28,0x106));var _0x8db2=function(_0x294136,_0xf5c874){_0x294136=_0x294136-0x0;var _0x1498a4=_0xdb28[_0x294136];return _0x1498a4;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 27e3319..55c88d1 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3cb6f4,_0x48578e){var _0x45d68c=function(_0xc3f49f){while(--_0xc3f49f){_0x3cb6f4['push'](_0x3cb6f4['shift']());}};_0x45d68c(++_0x48578e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x27e8c4,_0x1b4f89){var _0x519f5a=function(_0x34d70b){while(--_0x34d70b){_0x27e8c4['push'](_0x27e8c4['shift']());}};_0x519f5a(++_0x1b4f89);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 7d49a99..7a5c352 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 _0xa527=['exports','../../mysqldb','ChatOfflineMessage','update','remove','hasOwnProperty','hook'];(function(_0x18a529,_0x2bea53){var _0x216fb8=function(_0x537d25){while(--_0x537d25){_0x18a529['push'](_0x18a529['shift']());}};_0x216fb8(++_0x2bea53);}(_0xa527,0x182));var _0x7a52=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xa527[_0x456fb1];return _0x4083d6;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x7a52('0x0'))['db'][_0x7a52('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7a52('0x2'),'afterDestroy':_0x7a52('0x3')};function emitEvent(_0x2a02cb){return function(_0x4ca128,_0x53b7bf,_0x57db35){ChatOfflineMessageEvents['emit'](_0x2a02cb+':'+_0x4ca128['id'],_0x4ca128);ChatOfflineMessageEvents['emit'](_0x2a02cb,_0x4ca128);_0x57db35(null);};}for(var e in events){if(events[_0x7a52('0x4')](e)){var event=events[e];ChatOfflineMessage[_0x7a52('0x5')](e,emitEvent(event));}}module[_0x7a52('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x26e9=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','save'];(function(_0xa84996,_0x16c698){var _0x1b9325=function(_0x4f2a31){while(--_0x4f2a31){_0xa84996['push'](_0xa84996['shift']());}};_0x1b9325(++_0x16c698);}(_0x26e9,0x1a2));var _0x926e=function(_0x3113b1,_0x42646c){_0x3113b1=_0x3113b1-0x0;var _0x4d45a8=_0x26e9[_0x3113b1];return _0x4d45a8;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x926e('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x926e('0x1'),'afterUpdate':_0x926e('0x2'),'afterDestroy':'remove'};function emitEvent(_0x37c0ca){return function(_0x2308af,_0x1e2798,_0x554f3a){ChatOfflineMessageEvents[_0x926e('0x3')](_0x37c0ca+':'+_0x2308af['id'],_0x2308af);ChatOfflineMessageEvents[_0x926e('0x3')](_0x37c0ca,_0x2308af);_0x554f3a(null);};}for(var e in events){if(events[_0x926e('0x4')](e)){var event=events[e];ChatOfflineMessage[_0x926e('0x5')](e,emitEvent(event));}}module[_0x926e('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 28804ed..394a0fe 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 _0x0d3b=['utf8mb4','utf8mb4_unicode_ci','ChatOfflineMessage','chat_offline_messages'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0d3b,0x9a));var _0xb0d3=function(_0x19d845,_0x5e7bf1){_0x19d845=_0x19d845-0x0;var _0x34651e=_0x0d3b[_0x19d845];return _0x34651e;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x3a2c31){return _0x3a2c31['define'](_0xb0d3('0x0'),attributes,{'tableName':_0xb0d3('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb0d3('0x2'),'collate':_0xb0d3('0x3')});};
\ No newline at end of file
+var _0x8099=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x487eeb,_0x120b41){var _0x34917b=function(_0x4d0ab0){while(--_0x4d0ab0){_0x487eeb['push'](_0x487eeb['shift']());}};_0x34917b(++_0x120b41);}(_0x8099,0x91));var _0x9809=function(_0x2e010c,_0x1819a2){_0x2e010c=_0x2e010c-0x0;var _0x1b19d9=_0x8099[_0x2e010c];return _0x1b19d9;};'use strict';var attributes=require(_0x9809('0x0'));module[_0x9809('0x1')]=function(_0x29969e){return _0x29969e['define'](_0x9809('0x2'),attributes,{'tableName':_0x9809('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9809('0x4'),'collate':_0x9809('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 58ad043..7710cc1 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 _0x0c34=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug'];(function(_0x789179,_0x455e5f){var _0x10878f=function(_0x450629){while(--_0x450629){_0x789179['push'](_0x789179['shift']());}};_0x10878f(++_0x455e5f);}(_0x0c34,0x153));var _0x40c3=function(_0x2da87b,_0x569fcd){_0x2da87b=_0x2da87b-0x0;var _0x1931e4=_0x0c34[_0x2da87b];return _0x1931e4;};'use strict';var _=require('lodash');var util=require(_0x40c3('0x0'));var moment=require('moment');var BPromise=require(_0x40c3('0x1'));var rs=require(_0x40c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40c3('0x3'))['db'];var utils=require(_0x40c3('0x4'));var logger=require(_0x40c3('0x5'))(_0x40c3('0x6'));var config=require(_0x40c3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x40c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x216fe1,_0x95df97,_0x361b3b){return new BPromise(function(_0x45ad06,_0x12f26a){return client[_0x40c3('0x9')](_0x216fe1,_0x361b3b)[_0x40c3('0xa')](function(_0x513d7d){logger['info'](_0x40c3('0xb'),_0x95df97,'request\x20sent');logger[_0x40c3('0xc')](_0x40c3('0xd'),_0x95df97,_0x40c3('0xe'),JSON[_0x40c3('0xf')](_0x513d7d));if(_0x513d7d[_0x40c3('0x10')]){if(_0x513d7d['error'][_0x40c3('0x11')]===0x1f4){logger['error'](_0x40c3('0xb'),_0x95df97,_0x513d7d['error'][_0x40c3('0x12')]);return _0x12f26a(_0x513d7d[_0x40c3('0x10')]['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x95df97,_0x513d7d['error'][_0x40c3('0x12')]);return _0x45ad06(_0x513d7d[_0x40c3('0x10')][_0x40c3('0x12')]);}else{logger[_0x40c3('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x95df97,_0x40c3('0xe'));_0x45ad06(_0x513d7d[_0x40c3('0x14')][_0x40c3('0x12')]);}})[_0x40c3('0x15')](function(_0x331fc5){logger[_0x40c3('0x10')](_0x40c3('0xb'),_0x95df97,_0x331fc5);_0x12f26a(_0x331fc5);});});}
\ No newline at end of file
+var _0x39c7=['stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x39c7,0x85));var _0x739c=function(_0xb5b557,_0x4a4eae){_0xb5b557=_0xb5b557-0x0;var _0x4a1090=_0x39c7[_0xb5b557];return _0x4a1090;};'use strict';var _=require('lodash');var util=require(_0x739c('0x0'));var moment=require(_0x739c('0x1'));var BPromise=require(_0x739c('0x2'));var rs=require(_0x739c('0x3'));var fs=require('fs');var Redis=require(_0x739c('0x4'));var db=require(_0x739c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x739c('0x6'))(_0x739c('0x7'));var config=require(_0x739c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x739c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c0af1,_0x5df5d3,_0x480159){return new BPromise(function(_0x27c5a4,_0x3475f2){return client['request'](_0x3c0af1,_0x480159)[_0x739c('0xa')](function(_0x277f61){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5df5d3,_0x739c('0xb'));logger[_0x739c('0xc')](_0x739c('0xd'),_0x5df5d3,_0x739c('0xb'),JSON[_0x739c('0xe')](_0x277f61));if(_0x277f61[_0x739c('0xf')]){if(_0x277f61[_0x739c('0xf')][_0x739c('0x10')]===0x1f4){logger[_0x739c('0xf')](_0x739c('0x11'),_0x5df5d3,_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);return _0x3475f2(_0x277f61['error'][_0x739c('0x12')]);}logger[_0x739c('0xf')](_0x739c('0x11'),_0x5df5d3,_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);return _0x27c5a4(_0x277f61[_0x739c('0xf')][_0x739c('0x12')]);}else{logger[_0x739c('0x13')](_0x739c('0x11'),_0x5df5d3,_0x739c('0xb'));_0x27c5a4(_0x277f61['result']['message']);}})[_0x739c('0x14')](function(_0x23888d){logger[_0x739c('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5df5d3,_0x23888d);_0x3475f2(_0x23888d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 404a5d0..cde7695 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 _0x8438=['get','index','isAuthenticated','show','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0x2c9d6c,_0xd79778){var _0x2d0e58=function(_0x2fd3a1){while(--_0x2fd3a1){_0x2c9d6c['push'](_0x2c9d6c['shift']());}};_0x2d0e58(++_0xd79778);}(_0x8438,0x1bf));var _0x8843=function(_0x4c859a,_0xc09b66){_0x4c859a=_0x4c859a-0x0;var _0x23cd47=_0x8438[_0x4c859a];return _0x23cd47;};'use strict';var multer=require(_0x8843('0x0'));var util=require(_0x8843('0x1'));var path=require(_0x8843('0x2'));var timeout=require(_0x8843('0x3'));var express=require(_0x8843('0x4'));var router=express['Router']();var fs_extra=require(_0x8843('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8843('0x6'));var config=require(_0x8843('0x7'));var controller=require(_0x8843('0x8'));router[_0x8843('0x9')]('/',auth['isAuthenticated'](),controller[_0x8843('0xa')]);router[_0x8843('0x9')]('/describe',auth[_0x8843('0xb')](),controller['describe']);router['get']('/:id',auth[_0x8843('0xb')](),controller[_0x8843('0xc')]);router[_0x8843('0xd')]('/',auth[_0x8843('0xb')](),controller[_0x8843('0xe')]);router[_0x8843('0xf')](_0x8843('0x10'),auth[_0x8843('0xb')](),controller['update']);router[_0x8843('0x11')](_0x8843('0x10'),auth[_0x8843('0xb')](),controller[_0x8843('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x0274=['delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update'];(function(_0x577247,_0x269bff){var _0x5e07d2=function(_0x625269){while(--_0x625269){_0x577247['push'](_0x577247['shift']());}};_0x5e07d2(++_0x269bff);}(_0x0274,0x10c));var _0x4027=function(_0x1c924c,_0x425bb3){_0x1c924c=_0x1c924c-0x0;var _0x30909d=_0x0274[_0x1c924c];return _0x30909d;};'use strict';var multer=require(_0x4027('0x0'));var util=require('util');var path=require(_0x4027('0x1'));var timeout=require(_0x4027('0x2'));var express=require('express');var router=express[_0x4027('0x3')]();var fs_extra=require(_0x4027('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4027('0x5'));var config=require(_0x4027('0x6'));var controller=require(_0x4027('0x7'));router[_0x4027('0x8')]('/',auth[_0x4027('0x9')](),controller[_0x4027('0xa')]);router[_0x4027('0x8')](_0x4027('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4027('0xc'),auth[_0x4027('0x9')](),controller[_0x4027('0xd')]);router[_0x4027('0xe')]('/',auth[_0x4027('0x9')](),controller['create']);router[_0x4027('0xf')]('/:id',auth[_0x4027('0x9')](),controller[_0x4027('0x10')]);router[_0x4027('0x11')](_0x4027('0xc'),auth[_0x4027('0x9')](),controller[_0x4027('0x12')]);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 1dd7d76..5160aa8 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 _0x244c=['ENUM','mouseOver','timeout','sequelize','exports','STRING'];(function(_0x11d883,_0x3f04e1){var _0xb4ad6a=function(_0x41be5c){while(--_0x41be5c){_0x11d883['push'](_0x11d883['shift']());}};_0xb4ad6a(++_0x3f04e1);}(_0x244c,0xb7));var _0xc244=function(_0x37b9e7,_0x2bfa2e){_0x37b9e7=_0x37b9e7-0x0;var _0x451f9c=_0x244c[_0x37b9e7];return _0x451f9c;};'use strict';var Sequelize=require(_0xc244('0x0'));module[_0xc244('0x1')]={'name':{'type':Sequelize[_0xc244('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc244('0x3')](_0xc244('0x4'),_0xc244('0x5')),'defaultValue':_0xc244('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdeb8=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0xbbc40e,_0x4297ea){var _0x2abd33=function(_0x4f7ea5){while(--_0x4f7ea5){_0xbbc40e['push'](_0xbbc40e['shift']());}};_0x2abd33(++_0x4297ea);}(_0xdeb8,0xef));var _0x8deb=function(_0x5632d3,_0x2eed0b){_0x5632d3=_0x5632d3-0x0;var _0x2c4ba8=_0xdeb8[_0x5632d3];return _0x2c4ba8;};'use strict';var Sequelize=require(_0x8deb('0x0'));module[_0x8deb('0x1')]={'name':{'type':Sequelize[_0x8deb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8deb('0x3')](_0x8deb('0x4'),_0x8deb('0x5')),'defaultValue':_0x8deb('0x4')},'selector':{'type':Sequelize[_0x8deb('0x2')]},'timeout':{'type':Sequelize[_0x8deb('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 683b172..44b6930 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 _0xb91a=['find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','includeAll','merge','options'];(function(_0x473199,_0x17bb65){var _0xf740c4=function(_0x259a1b){while(--_0x259a1b){_0x473199['push'](_0x473199['shift']());}};_0xf740c4(++_0x17bb65);}(_0xb91a,0xf4));var _0xab91=function(_0x50a180,_0x3b8ce3){_0x50a180=_0x50a180-0x0;var _0x53511c=_0xb91a[_0x50a180];return _0x53511c;};'use strict';var emlformat=require(_0xab91('0x0'));var rimraf=require(_0xab91('0x1'));var zipdir=require(_0xab91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab91('0x3'));var BPromise=require(_0xab91('0x4'));var Mustache=require(_0xab91('0x5'));var util=require(_0xab91('0x6'));var path=require(_0xab91('0x7'));var sox=require(_0xab91('0x8'));var csv=require(_0xab91('0x9'));var ejs=require(_0xab91('0xa'));var fs=require('fs');var fs_extra=require(_0xab91('0xb'));var _=require(_0xab91('0xc'));var squel=require('squel');var crypto=require(_0xab91('0xd'));var jsforce=require(_0xab91('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab91('0xf'));var Redis=require(_0xab91('0x10'));var authService=require(_0xab91('0x11'));var qs=require(_0xab91('0x12'));var as=require(_0xab91('0x13'));var hardwareService=require(_0xab91('0x14'));var logger=require(_0xab91('0x15'))(_0xab91('0x16'));var utils=require(_0xab91('0x17'));var config=require(_0xab91('0x18'));var licenseUtil=require(_0xab91('0x19'));var db=require(_0xab91('0x1a'))['db'];function respondWithStatusCode(_0x283c91,_0x542d3f){_0x542d3f=_0x542d3f||0xcc;return function(_0x4f2af6){if(_0x4f2af6){return _0x283c91[_0xab91('0x1b')](_0x542d3f);}return _0x283c91[_0xab91('0x1c')](_0x542d3f)[_0xab91('0x1d')]();};}function respondWithResult(_0x14bded,_0x14b304){_0x14b304=_0x14b304||0xc8;return function(_0xaa6e77){if(_0xaa6e77){return _0x14bded['status'](_0x14b304)['json'](_0xaa6e77);}};}function respondWithFilteredResult(_0x3c102a,_0x3565c0){return function(_0x1b0d61){if(_0x1b0d61){var _0x2d2699=typeof _0x3565c0[_0xab91('0x1e')]===_0xab91('0x1f')&&typeof _0x3565c0[_0xab91('0x20')]===_0xab91('0x1f');var _0x499daf=_0x1b0d61['count'];var _0x1a0b66=_0x2d2699?0x0:_0x3565c0['offset'];var _0x609b8c=_0x2d2699?_0x1b0d61[_0xab91('0x21')]:_0x3565c0[_0xab91('0x1e')]+_0x3565c0['limit'];var _0xe80258;if(_0x609b8c>=_0x499daf){_0x609b8c=_0x499daf;_0xe80258=0xc8;}else{_0xe80258=0xce;}_0x3c102a['status'](_0xe80258);return _0x3c102a[_0xab91('0x22')]('Content-Range',_0x1a0b66+'-'+_0x609b8c+'/'+_0x499daf)['json'](_0x1b0d61);}return null;};}function patchUpdates(_0x13f065){return function(_0x4c5595){try{jsonpatch[_0xab91('0x23')](_0x4c5595,_0x13f065,!![]);}catch(_0x1f5def){return BPromise[_0xab91('0x24')](_0x1f5def);}return _0x4c5595['save']();};}function saveUpdates(_0x49f4d5,_0x40d29a){return function(_0xdedffe){if(_0xdedffe){return _0xdedffe[_0xab91('0x25')](_0x49f4d5)[_0xab91('0x26')](function(_0x1518e4){return _0x1518e4;});}return null;};}function removeEntity(_0xf8db06,_0x57a7e9){return function(_0x5eca53){if(_0x5eca53){return _0x5eca53[_0xab91('0x27')]()['then'](function(){_0xf8db06['status'](0xcc)[_0xab91('0x1d')]();});}};}function handleEntityNotFound(_0x1a0bc2,_0x5586cd){return function(_0x425d39){if(!_0x425d39){_0x1a0bc2['sendStatus'](0x194);}return _0x425d39;};}function handleError(_0x3fe2fc,_0x400134){_0x400134=_0x400134||0x1f4;return function(_0x5a3c05){logger[_0xab91('0x28')](_0x5a3c05[_0xab91('0x29')]);if(_0x5a3c05[_0xab91('0x2a')]){delete _0x5a3c05[_0xab91('0x2a')];}_0x3fe2fc[_0xab91('0x1c')](_0x400134)[_0xab91('0x2b')](_0x5a3c05);};}exports['show']=function(_0x281ede,_0x4c7a87){var _0x152c51={'raw':!![],'where':{'id':_0x281ede[_0xab91('0x2c')]['id']}},_0x197d0c={};_0x197d0c[_0xab91('0x2d')]=_[_0xab91('0x2e')](db[_0xab91('0x2f')]['rawAttributes']);_0x197d0c[_0xab91('0x30')]=_[_0xab91('0x2e')](_0x281ede[_0xab91('0x30')]);_0x197d0c[_0xab91('0x31')]=_[_0xab91('0x32')](_0x197d0c[_0xab91('0x2d')],_0x197d0c['query']);_0x152c51[_0xab91('0x33')]=_[_0xab91('0x32')](_0x197d0c[_0xab91('0x2d')],qs[_0xab91('0x34')](_0x281ede['query'][_0xab91('0x34')]));_0x152c51[_0xab91('0x33')]=_0x152c51[_0xab91('0x33')]['length']?_0x152c51[_0xab91('0x33')]:_0x197d0c['model'];if(_0x281ede[_0xab91('0x30')][_0xab91('0x35')]){_0x152c51['include']=[{'all':!![]}];}_0x152c51=_[_0xab91('0x36')]({},_0x152c51,_0x281ede[_0xab91('0x37')]);return db[_0xab91('0x2f')][_0xab91('0x38')](_0x152c51)[_0xab91('0x26')](handleEntityNotFound(_0x4c7a87,null))[_0xab91('0x26')](respondWithResult(_0x4c7a87,null))[_0xab91('0x39')](handleError(_0x4c7a87,null));};exports['create']=function(_0x584702,_0x17e5bd){return db[_0xab91('0x2f')][_0xab91('0x3a')](_0x584702[_0xab91('0x3b')],{})[_0xab91('0x26')](respondWithResult(_0x17e5bd,0xc9))[_0xab91('0x39')](handleError(_0x17e5bd,null));};exports[_0xab91('0x25')]=function(_0x6ad869,_0x4787f0){if(_0x6ad869[_0xab91('0x3b')]['id']){delete _0x6ad869[_0xab91('0x3b')]['id'];}return db['ChatProactiveAction'][_0xab91('0x38')]({'where':{'id':_0x6ad869['params']['id']}})[_0xab91('0x26')](handleEntityNotFound(_0x4787f0,null))[_0xab91('0x26')](saveUpdates(_0x6ad869[_0xab91('0x3b')],null))[_0xab91('0x26')](respondWithResult(_0x4787f0,null))['catch'](handleError(_0x4787f0,null));};exports['destroy']=function(_0x4de946,_0x427f27){return db[_0xab91('0x2f')]['find']({'where':{'id':_0x4de946[_0xab91('0x2c')]['id']}})[_0xab91('0x26')](handleEntityNotFound(_0x427f27,null))[_0xab91('0x26')](removeEntity(_0x427f27,null))[_0xab91('0x39')](handleError(_0x427f27,null));};
\ No newline at end of file
+var _0x3d9f=['undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','show','params','keys','rawAttributes','filters','intersection','model','attributes','fields','query','length','includeAll','include','merge','find','catch','create','body','ChatProactiveAction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset'];(function(_0x28bef9,_0x28e8d6){var _0x45db81=function(_0x269033){while(--_0x269033){_0x28bef9['push'](_0x28bef9['shift']());}};_0x45db81(++_0x28e8d6);}(_0x3d9f,0xd2));var _0xf3d9=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x3d9f[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0xf3d9('0x0'));var rimraf=require(_0xf3d9('0x1'));var zipdir=require(_0xf3d9('0x2'));var jsonpatch=require(_0xf3d9('0x3'));var rp=require(_0xf3d9('0x4'));var moment=require(_0xf3d9('0x5'));var BPromise=require(_0xf3d9('0x6'));var Mustache=require(_0xf3d9('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf3d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3d9('0x9'));var _=require(_0xf3d9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf3d9('0xb'));var deskjs=require(_0xf3d9('0xc'));var toCsv=require(_0xf3d9('0x8'));var querystring=require(_0xf3d9('0xd'));var Papa=require(_0xf3d9('0xe'));var Redis=require(_0xf3d9('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf3d9('0x10'));var hardwareService=require(_0xf3d9('0x11'));var logger=require(_0xf3d9('0x12'))(_0xf3d9('0x13'));var utils=require(_0xf3d9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf3d9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b08c8,_0x2eb42c){_0x2eb42c=_0x2eb42c||0xcc;return function(_0x5b91a7){if(_0x5b91a7){return _0x1b08c8['sendStatus'](_0x2eb42c);}return _0x1b08c8[_0xf3d9('0x16')](_0x2eb42c)[_0xf3d9('0x17')]();};}function respondWithResult(_0x898431,_0x15a74e){_0x15a74e=_0x15a74e||0xc8;return function(_0x55e310){if(_0x55e310){return _0x898431[_0xf3d9('0x16')](_0x15a74e)[_0xf3d9('0x18')](_0x55e310);}};}function respondWithFilteredResult(_0x1f3f9b,_0x4a8e70){return function(_0x4033a6){if(_0x4033a6){var _0x1508f2=typeof _0x4a8e70[_0xf3d9('0x19')]===_0xf3d9('0x1a')&&typeof _0x4a8e70[_0xf3d9('0x1b')]==='undefined';var _0x18393a=_0x4033a6[_0xf3d9('0x1c')];var _0x3e2206=_0x1508f2?0x0:_0x4a8e70[_0xf3d9('0x19')];var _0x3386cb=_0x1508f2?_0x4033a6[_0xf3d9('0x1c')]:_0x4a8e70[_0xf3d9('0x19')]+_0x4a8e70[_0xf3d9('0x1b')];var _0x473085;if(_0x3386cb>=_0x18393a){_0x3386cb=_0x18393a;_0x473085=0xc8;}else{_0x473085=0xce;}_0x1f3f9b[_0xf3d9('0x16')](_0x473085);return _0x1f3f9b[_0xf3d9('0x1d')]('Content-Range',_0x3e2206+'-'+_0x3386cb+'/'+_0x18393a)['json'](_0x4033a6);}return null;};}function patchUpdates(_0x3d4945){return function(_0x2145b3){try{jsonpatch[_0xf3d9('0x1e')](_0x2145b3,_0x3d4945,!![]);}catch(_0x22d2f6){return BPromise[_0xf3d9('0x1f')](_0x22d2f6);}return _0x2145b3[_0xf3d9('0x20')]();};}function saveUpdates(_0x207cea,_0x269890){return function(_0x7770dc){if(_0x7770dc){return _0x7770dc[_0xf3d9('0x21')](_0x207cea)[_0xf3d9('0x22')](function(_0x36e868){return _0x36e868;});}return null;};}function removeEntity(_0x3aeec9,_0x5aecca){return function(_0x168ca6){if(_0x168ca6){return _0x168ca6[_0xf3d9('0x23')]()[_0xf3d9('0x22')](function(){_0x3aeec9['status'](0xcc)[_0xf3d9('0x17')]();});}};}function handleEntityNotFound(_0x289d62,_0x26f206){return function(_0x21c846){if(!_0x21c846){_0x289d62[_0xf3d9('0x24')](0x194);}return _0x21c846;};}function handleError(_0x3e1c4d,_0x41a6ac){_0x41a6ac=_0x41a6ac||0x1f4;return function(_0x240c44){logger[_0xf3d9('0x25')](_0x240c44['stack']);if(_0x240c44[_0xf3d9('0x26')]){delete _0x240c44['name'];}_0x3e1c4d[_0xf3d9('0x16')](_0x41a6ac)[_0xf3d9('0x27')](_0x240c44);};}exports[_0xf3d9('0x28')]=function(_0x3d9c23,_0x4e336a){var _0x1d51ce={'raw':!![],'where':{'id':_0x3d9c23[_0xf3d9('0x29')]['id']}},_0x367b60={};_0x367b60['model']=_[_0xf3d9('0x2a')](db['ChatProactiveAction'][_0xf3d9('0x2b')]);_0x367b60['query']=_[_0xf3d9('0x2a')](_0x3d9c23['query']);_0x367b60[_0xf3d9('0x2c')]=_[_0xf3d9('0x2d')](_0x367b60[_0xf3d9('0x2e')],_0x367b60['query']);_0x1d51ce[_0xf3d9('0x2f')]=_['intersection'](_0x367b60[_0xf3d9('0x2e')],qs[_0xf3d9('0x30')](_0x3d9c23[_0xf3d9('0x31')][_0xf3d9('0x30')]));_0x1d51ce[_0xf3d9('0x2f')]=_0x1d51ce[_0xf3d9('0x2f')][_0xf3d9('0x32')]?_0x1d51ce[_0xf3d9('0x2f')]:_0x367b60[_0xf3d9('0x2e')];if(_0x3d9c23[_0xf3d9('0x31')][_0xf3d9('0x33')]){_0x1d51ce[_0xf3d9('0x34')]=[{'all':!![]}];}_0x1d51ce=_[_0xf3d9('0x35')]({},_0x1d51ce,_0x3d9c23['options']);return db['ChatProactiveAction'][_0xf3d9('0x36')](_0x1d51ce)[_0xf3d9('0x22')](handleEntityNotFound(_0x4e336a,null))[_0xf3d9('0x22')](respondWithResult(_0x4e336a,null))[_0xf3d9('0x37')](handleError(_0x4e336a,null));};exports[_0xf3d9('0x38')]=function(_0x3b98b5,_0x14fa3c){return db['ChatProactiveAction'][_0xf3d9('0x38')](_0x3b98b5[_0xf3d9('0x39')],{})['then'](respondWithResult(_0x14fa3c,0xc9))[_0xf3d9('0x37')](handleError(_0x14fa3c,null));};exports['update']=function(_0x25ef2d,_0x164c27){if(_0x25ef2d[_0xf3d9('0x39')]['id']){delete _0x25ef2d[_0xf3d9('0x39')]['id'];}return db[_0xf3d9('0x3a')]['find']({'where':{'id':_0x25ef2d[_0xf3d9('0x29')]['id']}})[_0xf3d9('0x22')](handleEntityNotFound(_0x164c27,null))[_0xf3d9('0x22')](saveUpdates(_0x25ef2d[_0xf3d9('0x39')],null))['then'](respondWithResult(_0x164c27,null))[_0xf3d9('0x37')](handleError(_0x164c27,null));};exports[_0xf3d9('0x23')]=function(_0x3f6b21,_0x43d598){return db['ChatProactiveAction'][_0xf3d9('0x36')]({'where':{'id':_0x3f6b21['params']['id']}})[_0xf3d9('0x22')](handleEntityNotFound(_0x43d598,null))[_0xf3d9('0x22')](removeEntity(_0x43d598,null))[_0xf3d9('0x37')](handleError(_0x43d598,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 70b0d70..bd913f9 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 _0x444e=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x444e,0x113));var _0xe444=function(_0x11487c,_0x3bc8bd){_0x11487c=_0x11487c-0x0;var _0x400d0a=_0x444e[_0x11487c];return _0x400d0a;};'use strict';var _=require(_0xe444('0x0'));var util=require(_0xe444('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe444('0x2'));var BPromise=require(_0xe444('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe444('0x4'));var rimraf=require(_0xe444('0x5'));var config=require(_0xe444('0x6'));var attributes=require(_0xe444('0x7'));module[_0xe444('0x8')]=function(_0x59b39e,_0x54dbcd){return _0x59b39e['define'](_0xe444('0x9'),attributes,{'tableName':_0xe444('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd447=['chat_proactive_actions','util','../../config/logger','api','moment','bluebird','path','./chatProactiveAction.attributes','exports','define'];(function(_0x41b4e9,_0x51a253){var _0x36d5ca=function(_0x5db9d0){while(--_0x5db9d0){_0x41b4e9['push'](_0x41b4e9['shift']());}};_0x36d5ca(++_0x51a253);}(_0xd447,0x1e1));var _0x7d44=function(_0x41a12c,_0x362888){_0x41a12c=_0x41a12c-0x0;var _0x13d8d0=_0xd447[_0x41a12c];return _0x13d8d0;};'use strict';var _=require('lodash');var util=require(_0x7d44('0x0'));var logger=require(_0x7d44('0x1'))(_0x7d44('0x2'));var moment=require(_0x7d44('0x3'));var BPromise=require(_0x7d44('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d44('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7d44('0x6'));module[_0x7d44('0x7')]=function(_0x4b7b6d,_0x2fed56){return _0x4b7b6d[_0x7d44('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x7d44('0x9'),'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 c97ca95..2ed3127 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 _0xb65a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error','message','lodash','util','bluebird','randomstring'];(function(_0x284807,_0x4be925){var _0x50c774=function(_0xf56cf7){while(--_0xf56cf7){_0x284807['push'](_0x284807['shift']());}};_0x50c774(++_0x4be925);}(_0xb65a,0xce));var _0xab65=function(_0x206aca,_0x13b8c0){_0x206aca=_0x206aca-0x0;var _0x55a3d8=_0xb65a[_0x206aca];return _0x55a3d8;};'use strict';var _=require(_0xab65('0x0'));var util=require(_0xab65('0x1'));var moment=require('moment');var BPromise=require(_0xab65('0x2'));var rs=require(_0xab65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab65('0x4'))['db'];var utils=require(_0xab65('0x5'));var logger=require(_0xab65('0x6'))(_0xab65('0x7'));var config=require(_0xab65('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xab65('0x9')][_0xab65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57cd52,_0x2d77c5,_0x29b3cc){return new BPromise(function(_0x254f09,_0x10b225){return client[_0xab65('0xb')](_0x57cd52,_0x29b3cc)[_0xab65('0xc')](function(_0x51c602){logger[_0xab65('0xd')](_0xab65('0xe'),_0x2d77c5,_0xab65('0xf'));logger[_0xab65('0x10')](_0xab65('0x11'),_0x2d77c5,_0xab65('0xf'),JSON['stringify'](_0x51c602));if(_0x51c602['error']){if(_0x51c602['error'][_0xab65('0x12')]===0x1f4){logger[_0xab65('0x13')](_0xab65('0xe'),_0x2d77c5,_0x51c602[_0xab65('0x13')][_0xab65('0x14')]);return _0x10b225(_0x51c602['error'][_0xab65('0x14')]);}logger[_0xab65('0x13')](_0xab65('0xe'),_0x2d77c5,_0x51c602[_0xab65('0x13')][_0xab65('0x14')]);return _0x254f09(_0x51c602[_0xab65('0x13')][_0xab65('0x14')]);}else{logger[_0xab65('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d77c5,_0xab65('0xf'));_0x254f09(_0x51c602['result'][_0xab65('0x14')]);}})['catch'](function(_0x5dd672){logger[_0xab65('0x13')](_0xab65('0xe'),_0x2d77c5,_0x5dd672);_0x10b225(_0x5dd672);});});}
\ No newline at end of file
+var _0x1e50=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x5076e9,_0x22454a){var _0x2a0de1=function(_0x5b6895){while(--_0x5b6895){_0x5076e9['push'](_0x5076e9['shift']());}};_0x2a0de1(++_0x22454a);}(_0x1e50,0x1d4));var _0x01e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x01e5('0x0'));var util=require(_0x01e5('0x1'));var moment=require(_0x01e5('0x2'));var BPromise=require(_0x01e5('0x3'));var rs=require(_0x01e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01e5('0x6'))('rpc');var config=require(_0x01e5('0x7'));var jayson=require(_0x01e5('0x8'));var client=jayson[_0x01e5('0x9')][_0x01e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43284e,_0x32d502,_0x19af63){return new BPromise(function(_0x5860cd,_0x5257f5){return client[_0x01e5('0xb')](_0x43284e,_0x19af63)[_0x01e5('0xc')](function(_0x511973){logger[_0x01e5('0xd')](_0x01e5('0xe'),_0x32d502,_0x01e5('0xf'));logger[_0x01e5('0x10')](_0x01e5('0x11'),_0x32d502,_0x01e5('0xf'),JSON['stringify'](_0x511973));if(_0x511973[_0x01e5('0x12')]){if(_0x511973[_0x01e5('0x12')][_0x01e5('0x13')]===0x1f4){logger[_0x01e5('0x12')](_0x01e5('0xe'),_0x32d502,_0x511973[_0x01e5('0x12')][_0x01e5('0x14')]);return _0x5257f5(_0x511973[_0x01e5('0x12')][_0x01e5('0x14')]);}logger['error'](_0x01e5('0xe'),_0x32d502,_0x511973[_0x01e5('0x12')][_0x01e5('0x14')]);return _0x5860cd(_0x511973[_0x01e5('0x12')]['message']);}else{logger['info'](_0x01e5('0xe'),_0x32d502,_0x01e5('0xf'));_0x5860cd(_0x511973[_0x01e5('0x15')][_0x01e5('0x14')]);}})['catch'](function(_0x494cf7){logger[_0x01e5('0x12')](_0x01e5('0xe'),_0x32d502,_0x494cf7);_0x5257f5(_0x494cf7);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 81a2c99..917b28c 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 _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x506c19,_0x349cac){var _0x2b6cd6=function(_0x3734a2){while(--_0x3734a2){_0x506c19['push'](_0x506c19['shift']());}};_0x2b6cd6(++_0x349cac);}(_0x53ec,0x192));var _0xc53e=function(_0x1daaa4,_0x2a13f8){_0x1daaa4=_0x1daaa4-0x0;var _0x4d6a11=_0x53ec[_0x1daaa4];return _0x4d6a11;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x179c19,_0x43a64a){var _0x3cdfa0=function(_0x5d40d4){while(--_0x5d40d4){_0x179c19['push'](_0x179c19['shift']());}};_0x3cdfa0(++_0x43a64a);}(_0x032e,0x124));var _0xe032=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x032e[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 51d6aae..95e9fa2 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 _0x0875=['exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x2f54e5,_0x217602){var _0x5dc4ff=function(_0x4db1d4){while(--_0x4db1d4){_0x2f54e5['push'](_0x2f54e5['shift']());}};_0x5dc4ff(++_0x217602);}(_0x0875,0x1a4));var _0x5087=function(_0x53c746,_0x6fd40a){_0x53c746=_0x53c746-0x0;var _0x313923=_0x0875[_0x53c746];return _0x313923;};'use strict';var Sequelize=require('sequelize');module[_0x5087('0x0')]={'name':{'type':Sequelize[_0x5087('0x1')],'unique':_0x5087('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5087('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5087('0x3')](_0x5087('0x4'),_0x5087('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0xe611=['INTEGER','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x353627,_0xf01069){var _0x426c5b=function(_0x3d1428){while(--_0x3d1428){_0x353627['push'](_0x353627['shift']());}};_0x426c5b(++_0xf01069);}(_0xe611,0x135));var _0x1e61=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe611[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x1e61('0x0'));module[_0x1e61('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1e61('0x2')]},'timeout':{'type':Sequelize[_0x1e61('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1e61('0x4'),_0x1e61('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 22017eb..d052e5d 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 _0xebcf=['removeTeams','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','bluebird','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','update','then','destroy','get','ChatQueues','UserProfileResource','end','name','send','map','rawAttributes','fieldName','key','getOptions','ChatQueue','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','where','ChatQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','chatPause','getTeams','Team','pick','ids','Agents','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','transaction'];(function(_0x245f27,_0x5ba472){var _0x3b33df=function(_0x5a10ca){while(--_0x5a10ca){_0x245f27['push'](_0x245f27['shift']());}};_0x3b33df(++_0x5ba472);}(_0xebcf,0x17c));var _0xfebc=function(_0x5066c9,_0x15bd53){_0x5066c9=_0x5066c9-0x0;var _0x581f44=_0xebcf[_0x5066c9];return _0x581f44;};'use strict';var BPromise=require(_0xfebc('0x0'));var util=require('util');var _=require(_0xfebc('0x1'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0xfebc('0x2'));var logger=require(_0xfebc('0x3'))(_0xfebc('0x4'));var config=require(_0xfebc('0x5'));var db=require(_0xfebc('0x6'))['db'];config['redis']=_['defaults'](config[_0xfebc('0x7')],{'host':_0xfebc('0x8'),'port':0x18eb});var socket=require(_0xfebc('0x9'))(new Redis(config['redis']));require(_0xfebc('0xa'))[_0xfebc('0xb')](socket);function respondWithStatusCode(_0x48b8f8,_0x8aad22){_0x8aad22=_0x8aad22||0xcc;return function(_0x341351){if(_0x341351){return _0x48b8f8[_0xfebc('0xc')](_0x8aad22);}return _0x48b8f8[_0xfebc('0xd')](_0x8aad22)['end']();};}function respondWithResult(_0x52a4f9,_0x43585e){_0x43585e=_0x43585e||0xc8;return function(_0x23b27f){if(_0x23b27f){return _0x52a4f9['status'](_0x43585e)[_0xfebc('0xe')](_0x23b27f);}};}function respondWithFilteredResult(_0x54b18c,_0x3f9c1c){return function(_0x1430b2){if(_0x1430b2){var _0x22a034=typeof _0x3f9c1c[_0xfebc('0xf')]==='undefined'&&typeof _0x3f9c1c[_0xfebc('0x10')]===_0xfebc('0x11');var _0x1aa068=_0x1430b2[_0xfebc('0x12')];var _0x224ef1=_0x22a034?0x0:_0x3f9c1c[_0xfebc('0xf')];var _0x45ec32=_0x22a034?_0x1430b2[_0xfebc('0x12')]:_0x3f9c1c[_0xfebc('0xf')]+_0x3f9c1c['limit'];var _0x5e28c3;if(_0x45ec32>=_0x1aa068){_0x45ec32=_0x1aa068;_0x5e28c3=0xc8;}else{_0x5e28c3=0xce;}_0x54b18c['status'](_0x5e28c3);return _0x54b18c[_0xfebc('0x13')]('Content-Range',_0x224ef1+'-'+_0x45ec32+'/'+_0x1aa068)[_0xfebc('0xe')](_0x1430b2);}return null;};}function saveUpdates(_0xae898){return function(_0x1b4923){if(_0x1b4923){return _0x1b4923[_0xfebc('0x14')](_0xae898)[_0xfebc('0x15')](function(_0x218ade){return _0x218ade;});}return null;};}function removeEntity(_0x4f0ad5){return function(_0x8030fa){if(_0x8030fa){return _0x8030fa[_0xfebc('0x16')]()[_0xfebc('0x15')](function(){var _0x5e78fc=_0x8030fa[_0xfebc('0x17')]({'plain':!![]});var _0xd91267=_0xfebc('0x18');return db[_0xfebc('0x19')][_0xfebc('0x16')]({'where':{'type':_0xd91267,'resourceId':_0x5e78fc['id']}})[_0xfebc('0x15')](function(){return _0x8030fa;});})[_0xfebc('0x15')](function(){_0x4f0ad5[_0xfebc('0xd')](0xcc)[_0xfebc('0x1a')]();});}};}function handleEntityNotFound(_0x5d2cfb){return function(_0x8772f3){if(!_0x8772f3){_0x5d2cfb['sendStatus'](0x194);}return _0x8772f3;};}function handleError(_0x47ff13,_0x4fe36e){_0x4fe36e=_0x4fe36e||0x1f4;return function(_0xfecb79){logger['error'](_0xfecb79['stack']);if(_0xfecb79[_0xfebc('0x1b')]){delete _0xfecb79[_0xfebc('0x1b')];}_0x47ff13[_0xfebc('0xd')](_0x4fe36e)[_0xfebc('0x1c')](_0xfecb79);};}exports['index']=function(_0xfe0a39,_0x499233){var _0x27df3e={};var _0xb1b884={'count':0x0,'rows':[]};var _0x33094e=_[_0xfebc('0x1d')](db['ChatQueue'][_0xfebc('0x1e')],function(_0x239f29){return{'name':_0x239f29[_0xfebc('0x1f')],'type':_0x239f29['type'][_0xfebc('0x20')]};});_0x27df3e=qs[_0xfebc('0x21')](_0x33094e,_0xfe0a39);var _0x5202cd={'where':_0x27df3e['where']};return db[_0xfebc('0x22')][_0xfebc('0x12')](_0x5202cd)['then'](function(_0x2fb864){_0xb1b884[_0xfebc('0x12')]=_0x2fb864;_0x27df3e[_0xfebc('0x23')]=qs[_0xfebc('0x23')](_0xfe0a39[_0xfebc('0x24')]);return db['ChatQueue'][_0xfebc('0x25')](_0x27df3e);})[_0xfebc('0x15')](function(_0x37ee43){_0xb1b884[_0xfebc('0x26')]=_0x37ee43;return _0xb1b884;})[_0xfebc('0x15')](respondWithFilteredResult(_0x499233,_0x27df3e))[_0xfebc('0x27')](handleError(_0x499233,null));};exports[_0xfebc('0x28')]=function(_0x1e4f16,_0x2aaf25){var _0x215335={'raw':!![],'where':{'id':_0x1e4f16[_0xfebc('0x29')]['id']}},_0x327562={};_0x327562['model']=_['keys'](db['ChatQueue']['rawAttributes']);_0x327562['query']=_[_0xfebc('0x2a')](_0x1e4f16[_0xfebc('0x24')]);_0x327562[_0xfebc('0x2b')]=_[_0xfebc('0x2c')](_0x327562[_0xfebc('0x2d')],_0x327562[_0xfebc('0x24')]);_0x215335[_0xfebc('0x2e')]=_[_0xfebc('0x2c')](_0x327562['model'],qs[_0xfebc('0x2f')](_0x1e4f16['query']['fields']));_0x215335['attributes']=_0x215335['attributes'][_0xfebc('0x30')]?_0x215335[_0xfebc('0x2e')]:_0x327562[_0xfebc('0x2d')];if(_0x1e4f16['query'][_0xfebc('0x31')]){_0x215335[_0xfebc('0x23')]=[{'all':!![]}];}_0x215335=_[_0xfebc('0x32')]({},_0x215335,_0x1e4f16[_0xfebc('0x33')]);return db[_0xfebc('0x22')][_0xfebc('0x34')](_0x215335)['then'](handleEntityNotFound(_0x2aaf25,null))[_0xfebc('0x15')](respondWithResult(_0x2aaf25,null))[_0xfebc('0x27')](handleError(_0x2aaf25,null));};exports[_0xfebc('0x35')]=function(_0x3f183c,_0x58cc8b){return db[_0xfebc('0x22')]['create'](_0x3f183c[_0xfebc('0x36')],{})[_0xfebc('0x15')](function(_0x3bc30e){var _0x4197cc=_0x3f183c['user'][_0xfebc('0x17')]({'plain':!![]});if(!_0x4197cc)throw new Error(_0xfebc('0x37'));if(_0x4197cc[_0xfebc('0x38')]==='user'){var _0x2e97ed=_0x3bc30e[_0xfebc('0x17')]({'plain':!![]});var _0x2c77f7=_0xfebc('0x18');return db['UserProfileSection'][_0xfebc('0x34')]({'where':{'name':_0x2c77f7,'userProfileId':_0x4197cc[_0xfebc('0x39')]},'raw':!![]})[_0xfebc('0x15')](function(_0x8a8078){if(_0x8a8078&&_0x8a8078[_0xfebc('0x3a')]===0x0){return db[_0xfebc('0x19')][_0xfebc('0x35')]({'name':_0x2e97ed['name'],'resourceId':_0x2e97ed['id'],'type':_0x8a8078[_0xfebc('0x1b')],'sectionId':_0x8a8078['id']},{})[_0xfebc('0x15')](function(){return _0x3bc30e;});}else{return _0x3bc30e;}})['catch'](function(_0x17bbdc){logger[_0xfebc('0x3b')](_0xfebc('0x3c'),_0x17bbdc);throw _0x17bbdc;});}return _0x3bc30e;})[_0xfebc('0x15')](respondWithResult(_0x58cc8b,0xc9))[_0xfebc('0x27')](handleError(_0x58cc8b,null));};exports[_0xfebc('0x14')]=function(_0x4fa230,_0x56c255){if(_0x4fa230[_0xfebc('0x36')]['id']){delete _0x4fa230[_0xfebc('0x36')]['id'];}return db[_0xfebc('0x22')][_0xfebc('0x34')]({'where':{'id':_0x4fa230[_0xfebc('0x29')]['id']}})['then'](handleEntityNotFound(_0x56c255,null))[_0xfebc('0x15')](saveUpdates(_0x4fa230[_0xfebc('0x36')],null))[_0xfebc('0x15')](respondWithResult(_0x56c255,null))[_0xfebc('0x27')](handleError(_0x56c255,null));};exports[_0xfebc('0x16')]=function(_0x23d911,_0x38a0e5){return db['ChatQueue'][_0xfebc('0x34')]({'where':{'id':_0x23d911['params']['id']}})['then'](handleEntityNotFound(_0x38a0e5,null))[_0xfebc('0x15')](removeEntity(_0x38a0e5,null))[_0xfebc('0x27')](handleError(_0x38a0e5,null));};exports[_0xfebc('0x3d')]=function(_0x187792,_0x320084){return db['ChatQueue'][_0xfebc('0x3d')]()[_0xfebc('0x15')](respondWithResult(_0x320084,null))['catch'](handleError(_0x320084,null));};exports[_0xfebc('0x3e')]=function(_0x447881,_0x4fc550){var _0x601c83={'raw':!![],'where':{}},_0x5cc1b0={},_0x2d06be;return db[_0xfebc('0x22')][_0xfebc('0x3f')]({'where':{'id':_0x447881[_0xfebc('0x29')]['id']}})[_0xfebc('0x15')](handleEntityNotFound(_0x4fc550,null))[_0xfebc('0x15')](function(_0x10a83b){if(_0x10a83b){_0x2d06be=_0x10a83b[_0xfebc('0x17')]({'plain':!![]});_0x5cc1b0[_0xfebc('0x2d')]=_[_0xfebc('0x2a')](db[_0xfebc('0x40')]['rawAttributes']);_0x5cc1b0[_0xfebc('0x24')]=_[_0xfebc('0x2a')](_0x447881[_0xfebc('0x24')]);_0x5cc1b0['filters']=_[_0xfebc('0x2c')](_0x5cc1b0[_0xfebc('0x2d')],_0x5cc1b0[_0xfebc('0x24')]);_0x601c83['attributes']=_['intersection'](_0x5cc1b0[_0xfebc('0x2d')],qs[_0xfebc('0x2f')](_0x447881[_0xfebc('0x24')][_0xfebc('0x2f')]));_0x601c83[_0xfebc('0x2e')]=_0x601c83[_0xfebc('0x2e')]['length']?_0x601c83[_0xfebc('0x2e')]:_0x5cc1b0[_0xfebc('0x2d')];if(!_0x447881[_0xfebc('0x24')][_0xfebc('0x41')](_0xfebc('0x42'))){_0x601c83[_0xfebc('0x10')]=qs[_0xfebc('0x10')](_0x447881['query']['limit']);_0x601c83[_0xfebc('0xf')]=qs[_0xfebc('0xf')](_0x447881[_0xfebc('0x24')]['offset']);}_0x601c83[_0xfebc('0x43')]=qs[_0xfebc('0x44')](_0x447881[_0xfebc('0x24')]['sort']);_0x601c83[_0xfebc('0x45')]=qs['filters'](_['pick'](_0x447881['query'],_0x5cc1b0['filters']));_0x601c83['where'][_0xfebc('0x46')]=_0x10a83b['id'];if(_0x447881[_0xfebc('0x24')][_0xfebc('0x47')]){_0x601c83[_0xfebc('0x45')]=_['merge'](_0x601c83['where'],{'$or':_[_0xfebc('0x1d')](_0x601c83['attributes'],function(_0xdfd2af){var _0x3d11ac={};_0x3d11ac[_0xdfd2af]={'$like':'%'+_0x447881['query'][_0xfebc('0x47')]+'%'};return _0x3d11ac;})});}_0x601c83=_[_0xfebc('0x32')]({},_0x601c83,_0x447881[_0xfebc('0x33')]);return db['UserChatQueue'][_0xfebc('0x25')](_0x601c83);}})[_0xfebc('0x15')](function(_0x343878){if(_0x343878){return db[_0xfebc('0x48')][_0xfebc('0x49')]({'where':{'id':_[_0xfebc('0x1d')](_0x343878,_0xfebc('0x4a')),'role':_0xfebc('0x4b')},'attributes':['id',_0xfebc('0x1b'),'chatPause',_0xfebc('0x4c'),_0xfebc('0x4d')]});}})[_0xfebc('0x15')](function(_0x135550){if(_0x135550){return{'count':_0x135550['count'],'rows':_[_0xfebc('0x1d')](_0x135550[_0xfebc('0x26')],function(_0x374846){return{'membername':_0x374846[_0xfebc('0x1b')],'UserId':_0x374846['id'],'queue_name':_0x2d06be[_0xfebc('0x1b')],'ChatQueueId':_0x2d06be['id'],'interface':util['format'](_0xfebc('0x4e'),_0xfebc('0x4f'),_0x374846[_0xfebc('0x1b')]),'penalty':0x0,'paused':_0x374846[_0xfebc('0x50')],'createdAt':_0x374846[_0xfebc('0x4d')],'updatedAt':_0x374846['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4fc550,_0x601c83))[_0xfebc('0x27')](handleError(_0x4fc550,null));};exports[_0xfebc('0x51')]=function(_0x5a7dbc,_0x360e04){var _0x44f1db={};var _0x50ef82={};var _0xe4bf50;var _0x5652a0;return db[_0xfebc('0x22')][_0xfebc('0x3f')]({'where':{'id':_0x5a7dbc[_0xfebc('0x29')]['id']}})['then'](handleEntityNotFound(_0x360e04,null))[_0xfebc('0x15')](function(_0x3250d8){if(_0x3250d8){_0xe4bf50=_0x3250d8;_0x50ef82[_0xfebc('0x2d')]=_['keys'](db[_0xfebc('0x52')][_0xfebc('0x1e')]);_0x50ef82[_0xfebc('0x24')]=_[_0xfebc('0x2a')](_0x5a7dbc['query']);_0x50ef82[_0xfebc('0x2b')]=_[_0xfebc('0x2c')](_0x50ef82[_0xfebc('0x2d')],_0x50ef82['query']);_0x44f1db[_0xfebc('0x2e')]=_['intersection'](_0x50ef82[_0xfebc('0x2d')],qs['fields'](_0x5a7dbc[_0xfebc('0x24')][_0xfebc('0x2f')]));_0x44f1db[_0xfebc('0x2e')]=_0x44f1db[_0xfebc('0x2e')][_0xfebc('0x30')]?_0x44f1db['attributes']:_0x50ef82['model'];_0x44f1db['order']=qs[_0xfebc('0x44')](_0x5a7dbc[_0xfebc('0x24')][_0xfebc('0x44')]);_0x44f1db[_0xfebc('0x45')]=qs[_0xfebc('0x2b')](_[_0xfebc('0x53')](_0x5a7dbc[_0xfebc('0x24')],_0x50ef82[_0xfebc('0x2b')]));if(_0x5a7dbc[_0xfebc('0x24')][_0xfebc('0x47')]){_0x44f1db[_0xfebc('0x45')]=_[_0xfebc('0x32')](_0x44f1db[_0xfebc('0x45')],{'$or':_[_0xfebc('0x1d')](_0x44f1db['attributes'],function(_0x2932ca){var _0x1a72fd={};_0x1a72fd[_0x2932ca]={'$like':'%'+_0x5a7dbc[_0xfebc('0x24')][_0xfebc('0x47')]+'%'};return _0x1a72fd;})});}_0x44f1db=_[_0xfebc('0x32')]({},_0x44f1db,_0x5a7dbc[_0xfebc('0x33')]);return _0xe4bf50[_0xfebc('0x51')](_0x44f1db);}})[_0xfebc('0x15')](function(_0x530c6d){if(_0x530c6d){_0x5652a0=_0x530c6d[_0xfebc('0x30')];if(!_0x5a7dbc[_0xfebc('0x24')]['hasOwnProperty'](_0xfebc('0x42'))){_0x44f1db['limit']=qs[_0xfebc('0x10')](_0x5a7dbc[_0xfebc('0x24')][_0xfebc('0x10')]);_0x44f1db['offset']=qs[_0xfebc('0xf')](_0x5a7dbc['query'][_0xfebc('0xf')]);}return _0xe4bf50[_0xfebc('0x51')](_0x44f1db);}})[_0xfebc('0x15')](function(_0x191812){if(_0x191812){return _0x191812?{'count':_0x5652a0,'rows':_0x191812}:null;}})['then'](respondWithResult(_0x360e04,null))[_0xfebc('0x27')](handleError(_0x360e04,null));};exports['addTeams']=function(_0x2a9309,_0x3df1a5){var _0x4d12a0=_0x2a9309['body'][_0xfebc('0x54')];return db['Team'][_0xfebc('0x25')]({'where':{'id':_0x4d12a0},'attributes':['id'],'include':[{'model':db[_0xfebc('0x48')],'as':_0xfebc('0x55'),'attributes':['id',_0xfebc('0x1b'),'online',_0xfebc('0x56'),_0xfebc('0x57')],'raw':!![]}]})[_0xfebc('0x15')](function(_0x2c5726){if(_0x2c5726){var _0x288ed5=_[_0xfebc('0x58')](_0x2c5726,function(_0x2c4a9f){var _0x4ee7e4=_0x2c4a9f[_0xfebc('0x17')]({'plain':!![]});return _0x4ee7e4['Agents'];});return db[_0xfebc('0x22')][_0xfebc('0x34')]({'where':{'id':_0x2a9309[_0xfebc('0x29')]['id']}})[_0xfebc('0x15')](function(_0x3f3e31){return db[_0xfebc('0x59')]['transaction'](function(_0x43542a){return _0x3f3e31[_0xfebc('0x5a')](_0x4d12a0,{'transaction':_0x43542a})[_0xfebc('0x15')](function(){return BPromise[_0xfebc('0x5b')](_0x288ed5,function(_0x3e46c1){return db['UserChatQueue'][_0xfebc('0x5c')]({'where':{'UserId':_0x3e46c1['id'],'ChatQueueId':_0x2a9309[_0xfebc('0x29')]['id']},'transaction':_0x43542a});});})[_0xfebc('0x15')](function(){_0x288ed5[_0xfebc('0x5d')](function(_0x5da2e9){socket[_0xfebc('0x5e')](_0xfebc('0x5f'),{'UserId':_0x5da2e9['id'],'ChatQueueId':_0x3f3e31['id']});});});});});}})['then'](respondWithStatusCode(_0x3df1a5,null))['catch'](handleError(_0x3df1a5,null));};exports['removeTeams']=function(_0x17f13a,_0x3ec549){return db[_0xfebc('0x52')]['findAll']({'where':{'id':_0x17f13a[_0xfebc('0x24')][_0xfebc('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfebc('0x55'),'attributes':['id'],'raw':!![]}]})[_0xfebc('0x15')](handleEntityNotFound(_0x3ec549,null))[_0xfebc('0x15')](function(_0x3e2958){var _0x5d66cd=_[_0xfebc('0x1d')](_0x3e2958,'id');var _0x106b5d=[];var _0x28a836=[];var _0x508aef=squel[_0xfebc('0x60')]();_0x508aef[_0xfebc('0x61')](_0xfebc('0x62'))['from'](_0xfebc('0x63'),'tq')[_0xfebc('0x64')](_0xfebc('0x65'),'ut',_0xfebc('0x66'))[_0xfebc('0x45')](_0xfebc('0x67'),_0x17f13a[_0xfebc('0x29')]['id']);for(var _0x246c21=0x0;_0x246c21<_0x3e2958['length'];_0x246c21+=0x1){let _0x49d54c=_0x3e2958[_0x246c21];for(var _0x39a03a=0x0;_0x39a03a<_0x49d54c[_0xfebc('0x55')][_0xfebc('0x30')];_0x39a03a+=0x1){let _0x202f8e=_0x49d54c['Agents'][_0x39a03a];var _0x5b7fff=_0x508aef[_0xfebc('0x68')]();_0x5b7fff[_0xfebc('0x45')](_0xfebc('0x69'),_0x202f8e['id']);_0x28a836[_0xfebc('0x6a')](db[_0xfebc('0x59')][_0xfebc('0x24')](_0x5b7fff['toString'](),{'type':db[_0xfebc('0x59')][_0xfebc('0x6b')][_0xfebc('0x6c')]})[_0xfebc('0x15')](function(_0x89fcca){if(_0x89fcca[_0xfebc('0x30')]===0x1){return _0x202f8e['id'];}else{var _0xff9c22=_[_0xfebc('0x6d')](_['map'](_0x89fcca,_0xfebc('0x6e')),function(_0xc79ba9){return _[_0xfebc('0x6f')](_0x5d66cd,_0xc79ba9);});if(_0xff9c22){return _0x202f8e['id'];}}}));}}return BPromise['all'](_0x28a836)[_0xfebc('0x15')](function(_0x14c099){_0x106b5d=_(_0x106b5d)[_0xfebc('0x70')](_0x14c099)[_0xfebc('0x71')]()[_0xfebc('0x72')]();return db[_0xfebc('0x22')][_0xfebc('0x34')]({'where':{'id':_0x17f13a[_0xfebc('0x29')]['id']}})[_0xfebc('0x15')](function(_0x5996b6){return db[_0xfebc('0x59')][_0xfebc('0x73')](function(_0x5ba916){return _0x5996b6[_0xfebc('0x74')](_0x17f13a['query'][_0xfebc('0x54')],{'transaction':_0x5ba916})[_0xfebc('0x15')](function(){if(!_['isEmpty'](_0x106b5d)){return _0x5996b6['removeAgents'](_0x106b5d,{'transaction':_0x5ba916});}})['then'](function(){_0x106b5d['forEach'](function(_0x5a323c){socket[_0xfebc('0x5e')]('userChatQueue:remove',{'UserId':_0x5a323c,'ChatQueueId':_0x5996b6['id']});});});});});});})[_0xfebc('0x15')](respondWithStatusCode(_0x3ec549,null))[_0xfebc('0x27')](handleError(_0x3ec549,null));};exports[_0xfebc('0x75')]=function(_0x35e7c4,_0x57140a){return db[_0xfebc('0x22')][_0xfebc('0x34')]({'where':{'id':_0x35e7c4[_0xfebc('0x29')]['id']}})[_0xfebc('0x15')](handleEntityNotFound(_0x57140a,null))[_0xfebc('0x15')](function(_0x5b3a3f){if(_0x5b3a3f){return _0x5b3a3f['addAgents'](_0x35e7c4['body'][_0xfebc('0x54')],_[_0xfebc('0x76')](_0x35e7c4[_0xfebc('0x36')],[_0xfebc('0x54'),'id'])||{})[_0xfebc('0x77')](function(_0x5f30d5){for(var _0x462be2=0x0;_0x462be2<_0x35e7c4['body']['ids']['length'];_0x462be2+=0x1){socket['emit'](_0xfebc('0x5f'),{'UserId':Number(_0x35e7c4[_0xfebc('0x36')][_0xfebc('0x54')][_0x462be2]),'ChatQueueId':Number(_0x35e7c4[_0xfebc('0x29')]['id'])});}return _0x5f30d5;});}})['then'](respondWithResult(_0x57140a,null))[_0xfebc('0x27')](handleError(_0x57140a,null));};exports[_0xfebc('0x78')]=function(_0x4b0a7b,_0x42c894){return db[_0xfebc('0x22')][_0xfebc('0x34')]({'where':{'id':_0x4b0a7b[_0xfebc('0x29')]['id']}})['then'](handleEntityNotFound(_0x42c894,null))[_0xfebc('0x15')](function(_0x4e54f0){if(_0x4e54f0){return _0x4e54f0[_0xfebc('0x78')](_0x4b0a7b[_0xfebc('0x24')][_0xfebc('0x54')])[_0xfebc('0x15')](function(){if(_[_0xfebc('0x79')](_0x4b0a7b[_0xfebc('0x24')][_0xfebc('0x54')])){for(var _0x4c3de3=0x0;_0x4c3de3<_0x4b0a7b[_0xfebc('0x24')]['ids'][_0xfebc('0x30')];_0x4c3de3+=0x1){socket[_0xfebc('0x5e')](_0xfebc('0x7a'),{'UserId':Number(_0x4b0a7b[_0xfebc('0x24')]['ids'][_0x4c3de3]),'ChatQueueId':Number(_0x4b0a7b[_0xfebc('0x29')]['id'])});}}else{socket[_0xfebc('0x5e')](_0xfebc('0x7a'),{'UserId':Number(_0x4b0a7b['query'][_0xfebc('0x54')]),'ChatQueueId':Number(_0x4b0a7b[_0xfebc('0x29')]['id'])});}});}})[_0xfebc('0x15')](respondWithStatusCode(_0x42c894,null))[_0xfebc('0x27')](handleError(_0x42c894,null));};exports[_0xfebc('0x7b')]=function(_0x59a2c1,_0x2ffb46){var _0x81d0ac={};var _0xde0ed2={};var _0x3a0bac;var _0xe98918;return db[_0xfebc('0x22')][_0xfebc('0x3f')]({'where':{'id':_0x59a2c1['params']['id']}})[_0xfebc('0x15')](handleEntityNotFound(_0x2ffb46,null))[_0xfebc('0x15')](function(_0x34496d){if(_0x34496d){_0x3a0bac=_0x34496d;_0xde0ed2[_0xfebc('0x2d')]=_['keys'](db[_0xfebc('0x48')][_0xfebc('0x1e')]);_0xde0ed2[_0xfebc('0x24')]=_[_0xfebc('0x2a')](_0x59a2c1[_0xfebc('0x24')]);_0xde0ed2[_0xfebc('0x2b')]=_[_0xfebc('0x2c')](_0xde0ed2[_0xfebc('0x2d')],_0xde0ed2[_0xfebc('0x24')]);_0x81d0ac[_0xfebc('0x2e')]=_['intersection'](_0xde0ed2['model'],qs[_0xfebc('0x2f')](_0x59a2c1[_0xfebc('0x24')][_0xfebc('0x2f')]));_0x81d0ac[_0xfebc('0x2e')]=_0x81d0ac[_0xfebc('0x2e')][_0xfebc('0x30')]?_0x81d0ac['attributes']:_0xde0ed2[_0xfebc('0x2d')];_0x81d0ac[_0xfebc('0x43')]=qs['sort'](_0x59a2c1[_0xfebc('0x24')]['sort']);_0x81d0ac[_0xfebc('0x45')]=qs[_0xfebc('0x2b')](_[_0xfebc('0x53')](_0x59a2c1[_0xfebc('0x24')],_0xde0ed2[_0xfebc('0x2b')]));if(_0x59a2c1['query']['filter']){_0x81d0ac[_0xfebc('0x45')]=_[_0xfebc('0x32')](_0x81d0ac['where'],{'$or':_['map'](_0x81d0ac[_0xfebc('0x2e')],function(_0x1fa1c2){var _0x39ad36={};_0x39ad36[_0x1fa1c2]={'$like':'%'+_0x59a2c1['query'][_0xfebc('0x47')]+'%'};return _0x39ad36;})});}_0x81d0ac=_[_0xfebc('0x32')]({},_0x81d0ac,_0x59a2c1[_0xfebc('0x33')]);return _0x3a0bac[_0xfebc('0x7b')](_0x81d0ac);}})['then'](function(_0x527d18){if(_0x527d18){_0xe98918=_0x527d18['length'];if(!_0x59a2c1['query'][_0xfebc('0x41')](_0xfebc('0x42'))){_0x81d0ac[_0xfebc('0x10')]=qs[_0xfebc('0x10')](_0x59a2c1[_0xfebc('0x24')][_0xfebc('0x10')]);_0x81d0ac[_0xfebc('0xf')]=qs['offset'](_0x59a2c1[_0xfebc('0x24')][_0xfebc('0xf')]);}return _0x3a0bac['getAgents'](_0x81d0ac);}})[_0xfebc('0x15')](function(_0x49f43c){if(_0x49f43c){return _0x49f43c?{'count':_0xe98918,'rows':_0x49f43c}:null;}})[_0xfebc('0x15')](respondWithResult(_0x2ffb46,null))[_0xfebc('0x27')](handleError(_0x2ffb46,null));};
\ No newline at end of file
+var _0x289a=['params','model','keys','filters','attributes','intersection','fields','includeAll','merge','options','find','create','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','length','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','findAndCountAll','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./chatQueue.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','then','destroy','get','ChatQueues','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x289a,0x156));var _0xa289=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x289a[_0x3c22e0];return _0x215811;};'use strict';var BPromise=require('bluebird');var util=require(_0xa289('0x0'));var _=require(_0xa289('0x1'));var squel=require(_0xa289('0x2'));var Redis=require(_0xa289('0x3'));var qs=require(_0xa289('0x4'));var logger=require(_0xa289('0x5'))(_0xa289('0x6'));var config=require(_0xa289('0x7'));var db=require(_0xa289('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa289('0x9'))(new Redis(config[_0xa289('0xa')]));require(_0xa289('0xb'))[_0xa289('0xc')](socket);function respondWithStatusCode(_0x451c6f,_0x475932){_0x475932=_0x475932||0xcc;return function(_0x57b220){if(_0x57b220){return _0x451c6f[_0xa289('0xd')](_0x475932);}return _0x451c6f[_0xa289('0xe')](_0x475932)[_0xa289('0xf')]();};}function respondWithResult(_0x3bc67a,_0x2512ef){_0x2512ef=_0x2512ef||0xc8;return function(_0x4bcfaa){if(_0x4bcfaa){return _0x3bc67a[_0xa289('0xe')](_0x2512ef)['json'](_0x4bcfaa);}};}function respondWithFilteredResult(_0x34fc45,_0x53a3f1){return function(_0x1e75e5){if(_0x1e75e5){var _0x3c9556=typeof _0x53a3f1['offset']===_0xa289('0x10')&&typeof _0x53a3f1['limit']===_0xa289('0x10');var _0x397e8b=_0x1e75e5[_0xa289('0x11')];var _0x569d8b=_0x3c9556?0x0:_0x53a3f1[_0xa289('0x12')];var _0x5ed4dd=_0x3c9556?_0x1e75e5[_0xa289('0x11')]:_0x53a3f1[_0xa289('0x12')]+_0x53a3f1[_0xa289('0x13')];var _0x107610;if(_0x5ed4dd>=_0x397e8b){_0x5ed4dd=_0x397e8b;_0x107610=0xc8;}else{_0x107610=0xce;}_0x34fc45['status'](_0x107610);return _0x34fc45[_0xa289('0x14')](_0xa289('0x15'),_0x569d8b+'-'+_0x5ed4dd+'/'+_0x397e8b)[_0xa289('0x16')](_0x1e75e5);}return null;};}function saveUpdates(_0xd96b86){return function(_0x45ff1b){if(_0x45ff1b){return _0x45ff1b[_0xa289('0x17')](_0xd96b86)[_0xa289('0x18')](function(_0x3e738e){return _0x3e738e;});}return null;};}function removeEntity(_0x536e01){return function(_0x5a1d20){if(_0x5a1d20){return _0x5a1d20[_0xa289('0x19')]()['then'](function(){var _0x50d32e=_0x5a1d20[_0xa289('0x1a')]({'plain':!![]});var _0x365897=_0xa289('0x1b');return db['UserProfileResource']['destroy']({'where':{'type':_0x365897,'resourceId':_0x50d32e['id']}})[_0xa289('0x18')](function(){return _0x5a1d20;});})[_0xa289('0x18')](function(){_0x536e01[_0xa289('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7a8c20){return function(_0x75bf34){if(!_0x75bf34){_0x7a8c20['sendStatus'](0x194);}return _0x75bf34;};}function handleError(_0x965927,_0x440689){_0x440689=_0x440689||0x1f4;return function(_0x3f0a7f){logger[_0xa289('0x1c')](_0x3f0a7f['stack']);if(_0x3f0a7f[_0xa289('0x1d')]){delete _0x3f0a7f[_0xa289('0x1d')];}_0x965927[_0xa289('0xe')](_0x440689)[_0xa289('0x1e')](_0x3f0a7f);};}exports[_0xa289('0x1f')]=function(_0x3cec16,_0x159645){var _0x48036d={};var _0x3defa8={'count':0x0,'rows':[]};var _0xe677d9=_[_0xa289('0x20')](db[_0xa289('0x21')][_0xa289('0x22')],function(_0x107440){return{'name':_0x107440[_0xa289('0x23')],'type':_0x107440[_0xa289('0x24')][_0xa289('0x25')]};});_0x48036d=qs[_0xa289('0x26')](_0xe677d9,_0x3cec16);var _0x23cc3d={'where':_0x48036d[_0xa289('0x27')]};return db['ChatQueue'][_0xa289('0x11')](_0x23cc3d)[_0xa289('0x18')](function(_0x40b19c){_0x3defa8['count']=_0x40b19c;_0x48036d[_0xa289('0x28')]=qs[_0xa289('0x28')](_0x3cec16[_0xa289('0x29')]);return db['ChatQueue'][_0xa289('0x2a')](_0x48036d);})['then'](function(_0x2b5f4b){_0x3defa8[_0xa289('0x2b')]=_0x2b5f4b;return _0x3defa8;})['then'](respondWithFilteredResult(_0x159645,_0x48036d))[_0xa289('0x2c')](handleError(_0x159645,null));};exports['show']=function(_0x227988,_0x1b4fb0){var _0x357f5c={'raw':!![],'where':{'id':_0x227988[_0xa289('0x2d')]['id']}},_0x727adf={};_0x727adf[_0xa289('0x2e')]=_[_0xa289('0x2f')](db[_0xa289('0x21')][_0xa289('0x22')]);_0x727adf['query']=_[_0xa289('0x2f')](_0x227988[_0xa289('0x29')]);_0x727adf[_0xa289('0x30')]=_['intersection'](_0x727adf[_0xa289('0x2e')],_0x727adf[_0xa289('0x29')]);_0x357f5c[_0xa289('0x31')]=_[_0xa289('0x32')](_0x727adf['model'],qs[_0xa289('0x33')](_0x227988[_0xa289('0x29')][_0xa289('0x33')]));_0x357f5c[_0xa289('0x31')]=_0x357f5c[_0xa289('0x31')]['length']?_0x357f5c[_0xa289('0x31')]:_0x727adf[_0xa289('0x2e')];if(_0x227988[_0xa289('0x29')][_0xa289('0x34')]){_0x357f5c['include']=[{'all':!![]}];}_0x357f5c=_[_0xa289('0x35')]({},_0x357f5c,_0x227988[_0xa289('0x36')]);return db['ChatQueue'][_0xa289('0x37')](_0x357f5c)[_0xa289('0x18')](handleEntityNotFound(_0x1b4fb0,null))[_0xa289('0x18')](respondWithResult(_0x1b4fb0,null))[_0xa289('0x2c')](handleError(_0x1b4fb0,null));};exports[_0xa289('0x38')]=function(_0x3bbc47,_0x5b0c35){return db['ChatQueue'][_0xa289('0x38')](_0x3bbc47['body'],{})['then'](function(_0x247b54){var _0x5d7c66=_0x3bbc47[_0xa289('0x39')][_0xa289('0x1a')]({'plain':!![]});if(!_0x5d7c66)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d7c66[_0xa289('0x3a')]===_0xa289('0x39')){var _0x388c7b=_0x247b54['get']({'plain':!![]});var _0x3a521c=_0xa289('0x1b');return db[_0xa289('0x3b')][_0xa289('0x37')]({'where':{'name':_0x3a521c,'userProfileId':_0x5d7c66['userProfileId']},'raw':!![]})[_0xa289('0x18')](function(_0x485b11){if(_0x485b11&&_0x485b11[_0xa289('0x3c')]===0x0){return db[_0xa289('0x3d')][_0xa289('0x38')]({'name':_0x388c7b[_0xa289('0x1d')],'resourceId':_0x388c7b['id'],'type':_0x485b11[_0xa289('0x1d')],'sectionId':_0x485b11['id']},{})[_0xa289('0x18')](function(){return _0x247b54;});}else{return _0x247b54;}})['catch'](function(_0x4e809b){logger[_0xa289('0x1c')](_0xa289('0x3e'),_0x4e809b);throw _0x4e809b;});}return _0x247b54;})[_0xa289('0x18')](respondWithResult(_0x5b0c35,0xc9))['catch'](handleError(_0x5b0c35,null));};exports[_0xa289('0x17')]=function(_0x183be3,_0xb47c14){if(_0x183be3['body']['id']){delete _0x183be3['body']['id'];}return db[_0xa289('0x21')]['find']({'where':{'id':_0x183be3[_0xa289('0x2d')]['id']}})['then'](handleEntityNotFound(_0xb47c14,null))[_0xa289('0x18')](saveUpdates(_0x183be3[_0xa289('0x3f')],null))[_0xa289('0x18')](respondWithResult(_0xb47c14,null))[_0xa289('0x2c')](handleError(_0xb47c14,null));};exports['destroy']=function(_0x3e2f0a,_0x4d0633){return db[_0xa289('0x21')][_0xa289('0x37')]({'where':{'id':_0x3e2f0a[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x4d0633,null))[_0xa289('0x18')](removeEntity(_0x4d0633,null))[_0xa289('0x2c')](handleError(_0x4d0633,null));};exports[_0xa289('0x40')]=function(_0x1eda3c,_0x582e99){return db[_0xa289('0x21')][_0xa289('0x40')]()['then'](respondWithResult(_0x582e99,null))[_0xa289('0x2c')](handleError(_0x582e99,null));};exports[_0xa289('0x41')]=function(_0x3cafc4,_0x5b950e){var _0x20a443={'raw':!![],'where':{}},_0x48aff1={},_0x37b2c4;return db[_0xa289('0x21')][_0xa289('0x42')]({'where':{'id':_0x3cafc4[_0xa289('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5b950e,null))[_0xa289('0x18')](function(_0x50a1aa){if(_0x50a1aa){_0x37b2c4=_0x50a1aa['get']({'plain':!![]});_0x48aff1['model']=_[_0xa289('0x2f')](db[_0xa289('0x43')]['rawAttributes']);_0x48aff1[_0xa289('0x29')]=_[_0xa289('0x2f')](_0x3cafc4[_0xa289('0x29')]);_0x48aff1['filters']=_[_0xa289('0x32')](_0x48aff1['model'],_0x48aff1[_0xa289('0x29')]);_0x20a443['attributes']=_[_0xa289('0x32')](_0x48aff1[_0xa289('0x2e')],qs[_0xa289('0x33')](_0x3cafc4[_0xa289('0x29')]['fields']));_0x20a443[_0xa289('0x31')]=_0x20a443[_0xa289('0x31')][_0xa289('0x44')]?_0x20a443['attributes']:_0x48aff1['model'];if(!_0x3cafc4[_0xa289('0x29')][_0xa289('0x45')](_0xa289('0x46'))){_0x20a443[_0xa289('0x13')]=qs[_0xa289('0x13')](_0x3cafc4[_0xa289('0x29')]['limit']);_0x20a443['offset']=qs[_0xa289('0x12')](_0x3cafc4['query']['offset']);}_0x20a443[_0xa289('0x47')]=qs[_0xa289('0x48')](_0x3cafc4[_0xa289('0x29')][_0xa289('0x48')]);_0x20a443[_0xa289('0x27')]=qs[_0xa289('0x30')](_[_0xa289('0x49')](_0x3cafc4['query'],_0x48aff1[_0xa289('0x30')]));_0x20a443[_0xa289('0x27')][_0xa289('0x4a')]=_0x50a1aa['id'];if(_0x3cafc4['query']['filter']){_0x20a443['where']=_[_0xa289('0x35')](_0x20a443['where'],{'$or':_['map'](_0x20a443[_0xa289('0x31')],function(_0x2da4c6){var _0x5d9cef={};_0x5d9cef[_0x2da4c6]={'$like':'%'+_0x3cafc4[_0xa289('0x29')][_0xa289('0x4b')]+'%'};return _0x5d9cef;})});}_0x20a443=_[_0xa289('0x35')]({},_0x20a443,_0x3cafc4[_0xa289('0x36')]);return db[_0xa289('0x43')]['findAll'](_0x20a443);}})['then'](function(_0xb779c9){if(_0xb779c9){return db['User'][_0xa289('0x4c')]({'where':{'id':_[_0xa289('0x20')](_0xb779c9,'UserId'),'role':_0xa289('0x4d')},'attributes':['id','name',_0xa289('0x4e'),_0xa289('0x4f'),'createdAt']});}})[_0xa289('0x18')](function(_0xd4562f){if(_0xd4562f){return{'count':_0xd4562f['count'],'rows':_[_0xa289('0x20')](_0xd4562f[_0xa289('0x2b')],function(_0x5952da){return{'membername':_0x5952da[_0xa289('0x1d')],'UserId':_0x5952da['id'],'queue_name':_0x37b2c4[_0xa289('0x1d')],'ChatQueueId':_0x37b2c4['id'],'interface':util[_0xa289('0x50')](_0xa289('0x51'),_0xa289('0x52'),_0x5952da['name']),'penalty':0x0,'paused':_0x5952da[_0xa289('0x4e')],'createdAt':_0x5952da[_0xa289('0x53')],'updatedAt':_0x5952da['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa289('0x18')](respondWithFilteredResult(_0x5b950e,_0x20a443))[_0xa289('0x2c')](handleError(_0x5b950e,null));};exports['getTeams']=function(_0x53ca40,_0x5d24b6){var _0x20a94f={};var _0x38d015={};var _0xf4e0aa;var _0xb41e4c;return db[_0xa289('0x21')][_0xa289('0x42')]({'where':{'id':_0x53ca40[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x5d24b6,null))[_0xa289('0x18')](function(_0x4622b7){if(_0x4622b7){_0xf4e0aa=_0x4622b7;_0x38d015[_0xa289('0x2e')]=_['keys'](db[_0xa289('0x54')]['rawAttributes']);_0x38d015[_0xa289('0x29')]=_[_0xa289('0x2f')](_0x53ca40[_0xa289('0x29')]);_0x38d015[_0xa289('0x30')]=_['intersection'](_0x38d015[_0xa289('0x2e')],_0x38d015[_0xa289('0x29')]);_0x20a94f[_0xa289('0x31')]=_['intersection'](_0x38d015[_0xa289('0x2e')],qs[_0xa289('0x33')](_0x53ca40[_0xa289('0x29')][_0xa289('0x33')]));_0x20a94f[_0xa289('0x31')]=_0x20a94f[_0xa289('0x31')][_0xa289('0x44')]?_0x20a94f[_0xa289('0x31')]:_0x38d015[_0xa289('0x2e')];_0x20a94f[_0xa289('0x47')]=qs[_0xa289('0x48')](_0x53ca40[_0xa289('0x29')][_0xa289('0x48')]);_0x20a94f[_0xa289('0x27')]=qs['filters'](_[_0xa289('0x49')](_0x53ca40[_0xa289('0x29')],_0x38d015['filters']));if(_0x53ca40[_0xa289('0x29')]['filter']){_0x20a94f[_0xa289('0x27')]=_[_0xa289('0x35')](_0x20a94f[_0xa289('0x27')],{'$or':_[_0xa289('0x20')](_0x20a94f[_0xa289('0x31')],function(_0x4bd070){var _0x4051fe={};_0x4051fe[_0x4bd070]={'$like':'%'+_0x53ca40[_0xa289('0x29')][_0xa289('0x4b')]+'%'};return _0x4051fe;})});}_0x20a94f=_[_0xa289('0x35')]({},_0x20a94f,_0x53ca40[_0xa289('0x36')]);return _0xf4e0aa['getTeams'](_0x20a94f);}})[_0xa289('0x18')](function(_0x3ad149){if(_0x3ad149){_0xb41e4c=_0x3ad149[_0xa289('0x44')];if(!_0x53ca40['query'][_0xa289('0x45')](_0xa289('0x46'))){_0x20a94f[_0xa289('0x13')]=qs[_0xa289('0x13')](_0x53ca40[_0xa289('0x29')][_0xa289('0x13')]);_0x20a94f[_0xa289('0x12')]=qs[_0xa289('0x12')](_0x53ca40[_0xa289('0x29')][_0xa289('0x12')]);}return _0xf4e0aa[_0xa289('0x55')](_0x20a94f);}})['then'](function(_0x44b164){if(_0x44b164){return _0x44b164?{'count':_0xb41e4c,'rows':_0x44b164}:null;}})['then'](respondWithResult(_0x5d24b6,null))['catch'](handleError(_0x5d24b6,null));};exports[_0xa289('0x56')]=function(_0x22cd62,_0x5a0151){var _0x316c60=_0x22cd62[_0xa289('0x3f')][_0xa289('0x57')];return db[_0xa289('0x54')][_0xa289('0x2a')]({'where':{'id':_0x316c60},'attributes':['id'],'include':[{'model':db[_0xa289('0x58')],'as':_0xa289('0x59'),'attributes':['id',_0xa289('0x1d'),_0xa289('0x5a'),_0xa289('0x5b'),_0xa289('0x5c')],'raw':!![]}]})[_0xa289('0x18')](function(_0x48716c){if(_0x48716c){var _0x40ae46=_[_0xa289('0x5d')](_0x48716c,function(_0x4f3b4d){var _0x32370c=_0x4f3b4d['get']({'plain':!![]});return _0x32370c[_0xa289('0x59')];});return db[_0xa289('0x21')][_0xa289('0x37')]({'where':{'id':_0x22cd62['params']['id']}})[_0xa289('0x18')](function(_0x4b0eb1){return db[_0xa289('0x5e')][_0xa289('0x5f')](function(_0x519969){return _0x4b0eb1[_0xa289('0x56')](_0x316c60,{'transaction':_0x519969})[_0xa289('0x18')](function(){return BPromise[_0xa289('0x60')](_0x40ae46,function(_0x79151d){return db['UserChatQueue'][_0xa289('0x61')]({'where':{'UserId':_0x79151d['id'],'ChatQueueId':_0x22cd62[_0xa289('0x2d')]['id']},'transaction':_0x519969});});})[_0xa289('0x18')](function(){_0x40ae46[_0xa289('0x62')](function(_0x4514e2){socket['emit'](_0xa289('0x63'),{'UserId':_0x4514e2['id'],'ChatQueueId':_0x4b0eb1['id']});});});});});}})[_0xa289('0x18')](respondWithStatusCode(_0x5a0151,null))[_0xa289('0x2c')](handleError(_0x5a0151,null));};exports[_0xa289('0x64')]=function(_0x363ec7,_0x2ba687){return db[_0xa289('0x54')][_0xa289('0x2a')]({'where':{'id':_0x363ec7[_0xa289('0x29')][_0xa289('0x57')]},'attributes':['id'],'include':[{'model':db[_0xa289('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2ba687,null))['then'](function(_0x2dbd1b){var _0x43a7ef=_[_0xa289('0x20')](_0x2dbd1b,'id');var _0x3adf86=[];var _0x563b8f=[];var _0x1aaaad=squel[_0xa289('0x65')]();_0x1aaaad['field'](_0xa289('0x66'))[_0xa289('0x67')](_0xa289('0x68'),'tq')[_0xa289('0x69')](_0xa289('0x6a'),'ut',_0xa289('0x6b'))[_0xa289('0x27')](_0xa289('0x6c'),_0x363ec7[_0xa289('0x2d')]['id']);for(var _0x1458f7=0x0;_0x1458f7<_0x2dbd1b[_0xa289('0x44')];_0x1458f7+=0x1){let _0x389831=_0x2dbd1b[_0x1458f7];for(var _0x572403=0x0;_0x572403<_0x389831[_0xa289('0x59')][_0xa289('0x44')];_0x572403+=0x1){let _0x4521fe=_0x389831['Agents'][_0x572403];var _0x31124b=_0x1aaaad[_0xa289('0x6d')]();_0x31124b[_0xa289('0x27')](_0xa289('0x6e'),_0x4521fe['id']);_0x563b8f[_0xa289('0x6f')](db[_0xa289('0x5e')][_0xa289('0x29')](_0x31124b[_0xa289('0x70')](),{'type':db[_0xa289('0x5e')][_0xa289('0x71')]['SELECT']})[_0xa289('0x18')](function(_0x413c22){if(_0x413c22[_0xa289('0x44')]===0x1){return _0x4521fe['id'];}else{var _0x2a539c=_[_0xa289('0x72')](_[_0xa289('0x20')](_0x413c22,_0xa289('0x73')),function(_0x4a95d9){return _[_0xa289('0x74')](_0x43a7ef,_0x4a95d9);});if(_0x2a539c){return _0x4521fe['id'];}}}));}}return BPromise[_0xa289('0x75')](_0x563b8f)[_0xa289('0x18')](function(_0x50c32a){_0x3adf86=_(_0x3adf86)['union'](_0x50c32a)[_0xa289('0x76')]()[_0xa289('0x77')]();return db['ChatQueue'][_0xa289('0x37')]({'where':{'id':_0x363ec7[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](function(_0x3430ce){return db[_0xa289('0x5e')]['transaction'](function(_0x331cf8){return _0x3430ce[_0xa289('0x64')](_0x363ec7['query'][_0xa289('0x57')],{'transaction':_0x331cf8})[_0xa289('0x18')](function(){if(!_[_0xa289('0x78')](_0x3adf86)){return _0x3430ce[_0xa289('0x79')](_0x3adf86,{'transaction':_0x331cf8});}})[_0xa289('0x18')](function(){_0x3adf86['forEach'](function(_0x2c9ad3){socket[_0xa289('0x7a')](_0xa289('0x7b'),{'UserId':_0x2c9ad3,'ChatQueueId':_0x3430ce['id']});});});});});});})[_0xa289('0x18')](respondWithStatusCode(_0x2ba687,null))[_0xa289('0x2c')](handleError(_0x2ba687,null));};exports[_0xa289('0x7c')]=function(_0x3b6d46,_0x5d4f64){return db[_0xa289('0x21')][_0xa289('0x37')]({'where':{'id':_0x3b6d46[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x5d4f64,null))['then'](function(_0x1d003f){if(_0x1d003f){return _0x1d003f[_0xa289('0x7c')](_0x3b6d46[_0xa289('0x3f')]['ids'],_[_0xa289('0x7d')](_0x3b6d46[_0xa289('0x3f')],[_0xa289('0x57'),'id'])||{})[_0xa289('0x7e')](function(_0x251f37){for(var _0x412fc5=0x0;_0x412fc5<_0x3b6d46[_0xa289('0x3f')]['ids'][_0xa289('0x44')];_0x412fc5+=0x1){socket[_0xa289('0x7a')](_0xa289('0x63'),{'UserId':Number(_0x3b6d46[_0xa289('0x3f')][_0xa289('0x57')][_0x412fc5]),'ChatQueueId':Number(_0x3b6d46[_0xa289('0x2d')]['id'])});}return _0x251f37;});}})[_0xa289('0x18')](respondWithResult(_0x5d4f64,null))[_0xa289('0x2c')](handleError(_0x5d4f64,null));};exports[_0xa289('0x79')]=function(_0x100916,_0x586472){return db['ChatQueue'][_0xa289('0x37')]({'where':{'id':_0x100916[_0xa289('0x2d')]['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x586472,null))[_0xa289('0x18')](function(_0x373442){if(_0x373442){return _0x373442[_0xa289('0x79')](_0x100916[_0xa289('0x29')]['ids'])['then'](function(){if(_[_0xa289('0x7f')](_0x100916[_0xa289('0x29')][_0xa289('0x57')])){for(var _0x20791c=0x0;_0x20791c<_0x100916[_0xa289('0x29')][_0xa289('0x57')]['length'];_0x20791c+=0x1){socket['emit'](_0xa289('0x7b'),{'UserId':Number(_0x100916[_0xa289('0x29')]['ids'][_0x20791c]),'ChatQueueId':Number(_0x100916[_0xa289('0x2d')]['id'])});}}else{socket[_0xa289('0x7a')](_0xa289('0x7b'),{'UserId':Number(_0x100916[_0xa289('0x29')][_0xa289('0x57')]),'ChatQueueId':Number(_0x100916[_0xa289('0x2d')]['id'])});}});}})[_0xa289('0x18')](respondWithStatusCode(_0x586472,null))[_0xa289('0x2c')](handleError(_0x586472,null));};exports[_0xa289('0x80')]=function(_0x8d57fc,_0x2b2f0a){var _0x41a758={};var _0x3006e3={};var _0x92294d;var _0x3eef5f;return db[_0xa289('0x21')][_0xa289('0x42')]({'where':{'id':_0x8d57fc['params']['id']}})[_0xa289('0x18')](handleEntityNotFound(_0x2b2f0a,null))[_0xa289('0x18')](function(_0x484d00){if(_0x484d00){_0x92294d=_0x484d00;_0x3006e3[_0xa289('0x2e')]=_['keys'](db[_0xa289('0x58')]['rawAttributes']);_0x3006e3['query']=_[_0xa289('0x2f')](_0x8d57fc['query']);_0x3006e3[_0xa289('0x30')]=_[_0xa289('0x32')](_0x3006e3['model'],_0x3006e3['query']);_0x41a758['attributes']=_[_0xa289('0x32')](_0x3006e3[_0xa289('0x2e')],qs[_0xa289('0x33')](_0x8d57fc[_0xa289('0x29')]['fields']));_0x41a758[_0xa289('0x31')]=_0x41a758[_0xa289('0x31')]['length']?_0x41a758[_0xa289('0x31')]:_0x3006e3['model'];_0x41a758['order']=qs[_0xa289('0x48')](_0x8d57fc['query'][_0xa289('0x48')]);_0x41a758[_0xa289('0x27')]=qs[_0xa289('0x30')](_[_0xa289('0x49')](_0x8d57fc[_0xa289('0x29')],_0x3006e3[_0xa289('0x30')]));if(_0x8d57fc[_0xa289('0x29')][_0xa289('0x4b')]){_0x41a758[_0xa289('0x27')]=_[_0xa289('0x35')](_0x41a758[_0xa289('0x27')],{'$or':_[_0xa289('0x20')](_0x41a758[_0xa289('0x31')],function(_0x41425f){var _0x1f72e7={};_0x1f72e7[_0x41425f]={'$like':'%'+_0x8d57fc['query'][_0xa289('0x4b')]+'%'};return _0x1f72e7;})});}_0x41a758=_['merge']({},_0x41a758,_0x8d57fc['options']);return _0x92294d[_0xa289('0x80')](_0x41a758);}})['then'](function(_0xa86769){if(_0xa86769){_0x3eef5f=_0xa86769[_0xa289('0x44')];if(!_0x8d57fc['query'][_0xa289('0x45')](_0xa289('0x46'))){_0x41a758[_0xa289('0x13')]=qs['limit'](_0x8d57fc[_0xa289('0x29')]['limit']);_0x41a758[_0xa289('0x12')]=qs['offset'](_0x8d57fc[_0xa289('0x29')][_0xa289('0x12')]);}return _0x92294d[_0xa289('0x80')](_0x41a758);}})[_0xa289('0x18')](function(_0x3ea82c){if(_0x3ea82c){return _0x3ea82c?{'count':_0x3eef5f,'rows':_0x3ea82c}:null;}})[_0xa289('0x18')](respondWithResult(_0x2b2f0a,null))['catch'](handleError(_0x2b2f0a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 1387c30..de4a0ae 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 _0xe678=['hasOwnProperty','hook','exports','events','ChatQueue','setMaxListeners','emit'];(function(_0x53973c,_0x1f910a){var _0x2fe204=function(_0x4f4817){while(--_0x4f4817){_0x53973c['push'](_0x53973c['shift']());}};_0x2fe204(++_0x1f910a);}(_0xe678,0x13e));var _0x8e67=function(_0x22a3b7,_0xac8090){_0x22a3b7=_0x22a3b7-0x0;var _0x30845c=_0xe678[_0x22a3b7];return _0x30845c;};'use strict';var EventEmitter=require(_0x8e67('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x8e67('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8e67('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x504f83){return function(_0x3cffb6,_0xd08dd0,_0x53cf8e){ChatQueueEvents['emit'](_0x504f83+':'+_0x3cffb6['id'],_0x3cffb6);ChatQueueEvents[_0x8e67('0x3')](_0x504f83,_0x3cffb6);_0x53cf8e(null);};}for(var e in events){if(events[_0x8e67('0x4')](e)){var event=events[e];ChatQueue[_0x8e67('0x5')](e,emitEvent(event));}}module[_0x8e67('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x6108=['ChatQueue','setMaxListeners','save','emit','hasOwnProperty','hook','events'];(function(_0x4b0733,_0x2324ed){var _0x1d5fdc=function(_0x2fb672){while(--_0x2fb672){_0x4b0733['push'](_0x4b0733['shift']());}};_0x1d5fdc(++_0x2324ed);}(_0x6108,0xbc));var _0x8610=function(_0x3fc430,_0x17dcdf){_0x3fc430=_0x3fc430-0x0;var _0x59a28d=_0x6108[_0x3fc430];return _0x59a28d;};'use strict';var EventEmitter=require(_0x8610('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x8610('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8610('0x2')](0x0);var events={'afterCreate':_0x8610('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x142cb5){return function(_0x42741d,_0x54802f,_0x4aa00f){ChatQueueEvents[_0x8610('0x4')](_0x142cb5+':'+_0x42741d['id'],_0x42741d);ChatQueueEvents[_0x8610('0x4')](_0x142cb5,_0x42741d);_0x4aa00f(null);};}for(var e in events){if(events[_0x8610('0x5')](e)){var event=events[e];ChatQueue[_0x8610('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 264e22c..869899e 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 _0x9992=['api','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x4d37b5,_0x57ed54){var _0x53d9fa=function(_0x1841ff){while(--_0x1841ff){_0x4d37b5['push'](_0x4d37b5['shift']());}};_0x53d9fa(++_0x57ed54);}(_0x9992,0x19d));var _0x2999=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x9992[_0x3c6dce];return _0x1450e9;};'use strict';var _=require(_0x2999('0x0'));var util=require(_0x2999('0x1'));var logger=require(_0x2999('0x2'))(_0x2999('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2999('0x4'));var fs=require('fs');var path=require(_0x2999('0x5'));var rimraf=require(_0x2999('0x6'));var config=require(_0x2999('0x7'));var attributes=require(_0x2999('0x8'));module[_0x2999('0x9')]=function(_0x455af9,_0xff07c8){return _0x455af9[_0x2999('0xa')](_0x2999('0xb'),attributes,{'tableName':_0x2999('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2a6=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x241ec1,_0x2fac9e){var _0x3de936=function(_0x5f3ce5){while(--_0x5f3ce5){_0x241ec1['push'](_0x241ec1['shift']());}};_0x3de936(++_0x2fac9e);}(_0xe2a6,0xcb));var _0x6e2a=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0xe2a6[_0x1f6f84];return _0x177f40;};'use strict';var _=require(_0x6e2a('0x0'));var util=require(_0x6e2a('0x1'));var logger=require(_0x6e2a('0x2'))('api');var moment=require(_0x6e2a('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e2a('0x4'));var fs=require('fs');var path=require(_0x6e2a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e2a('0x6'));module[_0x6e2a('0x7')]=function(_0x21c8c9,_0x5a7340){return _0x21c8c9[_0x6e2a('0x8')](_0x6e2a('0x9'),attributes,{'tableName':_0x6e2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 8876221..dabf809 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 _0x129f=['client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','findAll','raw','options','where','attributes','limit','map','include','model','catch','ShowChatQueue','ChatQueue','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2567c9,_0x473e4b){var _0x486b55=function(_0x43a6ed){while(--_0x43a6ed){_0x2567c9['push'](_0x2567c9['shift']());}};_0x486b55(++_0x473e4b);}(_0x129f,0x13f));var _0xf129=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x129f[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xf129('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf129('0x1'));var rs=require(_0xf129('0x2'));var fs=require('fs');var Redis=require(_0xf129('0x3'));var db=require(_0xf129('0x4'))['db'];var utils=require(_0xf129('0x5'));var logger=require(_0xf129('0x6'))(_0xf129('0x7'));var config=require(_0xf129('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf129('0x9')][_0xf129('0xa')]({'port':0x232a});config[_0xf129('0xb')]=_[_0xf129('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf129('0xd'))(new Redis(config['redis']));require(_0xf129('0xe'))[_0xf129('0xf')](socket);function respondWithRpcPromise(_0x31f877,_0x200e06,_0x6171ed){return new BPromise(function(_0x4fed21,_0x3e5859){return client[_0xf129('0x10')](_0x31f877,_0x6171ed)[_0xf129('0x11')](function(_0x5d721f){logger[_0xf129('0x12')](_0xf129('0x13'),_0x200e06,_0xf129('0x14'));logger['debug'](_0xf129('0x15'),_0x200e06,_0xf129('0x14'),JSON[_0xf129('0x16')](_0x5d721f));if(_0x5d721f['error']){if(_0x5d721f[_0xf129('0x17')][_0xf129('0x18')]===0x1f4){logger['error'](_0xf129('0x13'),_0x200e06,_0x5d721f['error'][_0xf129('0x19')]);return _0x3e5859(_0x5d721f[_0xf129('0x17')]['message']);}logger['error'](_0xf129('0x13'),_0x200e06,_0x5d721f[_0xf129('0x17')]['message']);return _0x4fed21(_0x5d721f[_0xf129('0x17')][_0xf129('0x19')]);}else{logger['info'](_0xf129('0x13'),_0x200e06,_0xf129('0x14'));_0x4fed21(_0x5d721f[_0xf129('0x1a')][_0xf129('0x19')]);}})['catch'](function(_0x54f122){logger[_0xf129('0x17')](_0xf129('0x13'),_0x200e06,_0x54f122);_0x3e5859(_0x54f122);});});}exports[_0xf129('0x1b')]=function(_0xbaa68c){var _0x3620b9=this;return new Promise(function(_0x336dbc,_0xbd9489){return db['ChatQueue'][_0xf129('0x1c')]({'raw':_0xbaa68c['options']?_0xbaa68c['options'][_0xf129('0x1d')]===undefined?!![]:![]:!![],'where':_0xbaa68c[_0xf129('0x1e')]?_0xbaa68c[_0xf129('0x1e')][_0xf129('0x1f')]||null:null,'attributes':_0xbaa68c[_0xf129('0x1e')]?_0xbaa68c[_0xf129('0x1e')][_0xf129('0x20')]||null:null,'limit':_0xbaa68c[_0xf129('0x1e')]?_0xbaa68c['options'][_0xf129('0x21')]||null:null,'include':_0xbaa68c[_0xf129('0x1e')]?_0xbaa68c[_0xf129('0x1e')]['include']?_[_0xf129('0x22')](_0xbaa68c[_0xf129('0x1e')][_0xf129('0x23')],function(_0x4ec979){return{'model':db[_0x4ec979[_0xf129('0x24')]],'as':_0x4ec979['as'],'attributes':_0x4ec979['attributes'],'include':_0x4ec979['include']?_[_0xf129('0x22')](_0x4ec979[_0xf129('0x23')],function(_0x259555){return{'model':db[_0x259555[_0xf129('0x24')]],'as':_0x259555['as'],'attributes':_0x259555[_0xf129('0x20')],'include':_0x259555[_0xf129('0x23')]?_[_0xf129('0x22')](_0x259555[_0xf129('0x23')],function(_0x3aa38f){return{'model':db[_0x3aa38f[_0xf129('0x24')]],'as':_0x3aa38f['as'],'attributes':_0x3aa38f[_0xf129('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf129('0x11')](function(_0xaf4806){logger[_0xf129('0x12')]('GetChatQueue',_0xbaa68c);logger['debug'](_0xf129('0x1b'),_0xbaa68c,JSON['stringify'](_0xaf4806));_0x336dbc(_0xaf4806);})[_0xf129('0x25')](function(_0x5978e2){logger[_0xf129('0x17')](_0xf129('0x1b'),_0x5978e2[_0xf129('0x19')],_0xbaa68c);_0xbd9489(_0x3620b9[_0xf129('0x17')](0x1f4,_0x5978e2[_0xf129('0x19')]));});});};exports[_0xf129('0x26')]=function(_0x3c591d){var _0x2a6c6d=this;return new Promise(function(_0x3defbc,_0x54ea04){return db[_0xf129('0x27')]['find']({'raw':_0x3c591d[_0xf129('0x1e')]?_0x3c591d[_0xf129('0x1e')][_0xf129('0x1d')]===undefined?!![]:![]:!![],'where':_0x3c591d['options']?_0x3c591d[_0xf129('0x1e')][_0xf129('0x1f')]||null:null,'attributes':_0x3c591d[_0xf129('0x1e')]?_0x3c591d[_0xf129('0x1e')]['attributes']||null:null,'include':_0x3c591d['options']?_0x3c591d['options'][_0xf129('0x23')]?_['map'](_0x3c591d[_0xf129('0x1e')][_0xf129('0x23')],function(_0x16e89d){return{'model':db[_0x16e89d[_0xf129('0x24')]],'as':_0x16e89d['as'],'attributes':_0x16e89d[_0xf129('0x20')],'include':_0x16e89d[_0xf129('0x23')]?_['map'](_0x16e89d['include'],function(_0x41ca80){return{'model':db[_0x41ca80['model']],'as':_0x41ca80['as'],'attributes':_0x41ca80[_0xf129('0x20')],'include':_0x41ca80[_0xf129('0x23')]?_['map'](_0x41ca80[_0xf129('0x23')],function(_0x18ca15){return{'model':db[_0x18ca15[_0xf129('0x24')]],'as':_0x18ca15['as'],'attributes':_0x18ca15[_0xf129('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf129('0x11')](function(_0x58494a){logger[_0xf129('0x12')](_0xf129('0x26'),_0x3c591d);logger[_0xf129('0x28')](_0xf129('0x26'),_0x3c591d,JSON[_0xf129('0x16')](_0x58494a));_0x3defbc(_0x58494a);})[_0xf129('0x25')](function(_0x869ff5){logger[_0xf129('0x17')](_0xf129('0x26'),_0x869ff5[_0xf129('0x19')],_0x3c591d);_0x54ea04(_0x2a6c6d[_0xf129('0x17')](0x1f4,_0x869ff5[_0xf129('0x19')]));});});};
\ No newline at end of file
+var _0xafcd=['then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','map','include','model','stringify','ShowChatQueue'];(function(_0x9bcc0b,_0x120f6c){var _0x195399=function(_0x5be8b9){while(--_0x5be8b9){_0x9bcc0b['push'](_0x9bcc0b['shift']());}};_0x195399(++_0x120f6c);}(_0xafcd,0x157));var _0xdafc=function(_0x292380,_0x2c9565){_0x292380=_0x292380-0x0;var _0x148f5d=_0xafcd[_0x292380];return _0x148f5d;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var moment=require(_0xdafc('0x2'));var BPromise=require(_0xdafc('0x3'));var rs=require(_0xdafc('0x4'));var fs=require('fs');var Redis=require(_0xdafc('0x5'));var db=require(_0xdafc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdafc('0x7'))(_0xdafc('0x8'));var config=require(_0xdafc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdafc('0xa')][_0xdafc('0xb')]({'port':0x232a});config[_0xdafc('0xc')]=_['defaults'](config[_0xdafc('0xc')],{'host':_0xdafc('0xd'),'port':0x18eb});var socket=require(_0xdafc('0xe'))(new Redis(config[_0xdafc('0xc')]));require(_0xdafc('0xf'))[_0xdafc('0x10')](socket);function respondWithRpcPromise(_0x3df5fb,_0x312e69,_0x1f87c5){return new BPromise(function(_0x2fdc39,_0x39561b){return client['request'](_0x3df5fb,_0x1f87c5)['then'](function(_0x2a1a6b){logger[_0xdafc('0x11')](_0xdafc('0x12'),_0x312e69,_0xdafc('0x13'));logger[_0xdafc('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x312e69,'request\x20sent',JSON['stringify'](_0x2a1a6b));if(_0x2a1a6b[_0xdafc('0x15')]){if(_0x2a1a6b['error'][_0xdafc('0x16')]===0x1f4){logger['error'](_0xdafc('0x12'),_0x312e69,_0x2a1a6b[_0xdafc('0x15')][_0xdafc('0x17')]);return _0x39561b(_0x2a1a6b[_0xdafc('0x15')]['message']);}logger['error'](_0xdafc('0x12'),_0x312e69,_0x2a1a6b[_0xdafc('0x15')][_0xdafc('0x17')]);return _0x2fdc39(_0x2a1a6b['error']['message']);}else{logger[_0xdafc('0x11')](_0xdafc('0x12'),_0x312e69,_0xdafc('0x13'));_0x2fdc39(_0x2a1a6b[_0xdafc('0x18')][_0xdafc('0x17')]);}})[_0xdafc('0x19')](function(_0x1ff505){logger[_0xdafc('0x15')]('ChatQueue,\x20%s,\x20%s',_0x312e69,_0x1ff505);_0x39561b(_0x1ff505);});});}exports[_0xdafc('0x1a')]=function(_0x10258f){var _0x5f4d1d=this;return new Promise(function(_0x239908,_0xb825df){return db[_0xdafc('0x1b')][_0xdafc('0x1c')]({'raw':_0x10258f[_0xdafc('0x1d')]?_0x10258f[_0xdafc('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x10258f['options']?_0x10258f['options'][_0xdafc('0x1e')]||null:null,'attributes':_0x10258f['options']?_0x10258f[_0xdafc('0x1d')][_0xdafc('0x1f')]||null:null,'limit':_0x10258f[_0xdafc('0x1d')]?_0x10258f[_0xdafc('0x1d')]['limit']||null:null,'include':_0x10258f[_0xdafc('0x1d')]?_0x10258f[_0xdafc('0x1d')]['include']?_[_0xdafc('0x20')](_0x10258f[_0xdafc('0x1d')][_0xdafc('0x21')],function(_0x3d3f06){return{'model':db[_0x3d3f06[_0xdafc('0x22')]],'as':_0x3d3f06['as'],'attributes':_0x3d3f06[_0xdafc('0x1f')],'include':_0x3d3f06[_0xdafc('0x21')]?_['map'](_0x3d3f06[_0xdafc('0x21')],function(_0x2d8bb0){return{'model':db[_0x2d8bb0['model']],'as':_0x2d8bb0['as'],'attributes':_0x2d8bb0[_0xdafc('0x1f')],'include':_0x2d8bb0['include']?_['map'](_0x2d8bb0[_0xdafc('0x21')],function(_0x56a820){return{'model':db[_0x56a820[_0xdafc('0x22')]],'as':_0x56a820['as'],'attributes':_0x56a820[_0xdafc('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2752bd){logger['info']('GetChatQueue',_0x10258f);logger['debug'](_0xdafc('0x1a'),_0x10258f,JSON[_0xdafc('0x23')](_0x2752bd));_0x239908(_0x2752bd);})[_0xdafc('0x19')](function(_0x219e1e){logger[_0xdafc('0x15')](_0xdafc('0x1a'),_0x219e1e[_0xdafc('0x17')],_0x10258f);_0xb825df(_0x5f4d1d['error'](0x1f4,_0x219e1e[_0xdafc('0x17')]));});});};exports[_0xdafc('0x24')]=function(_0x51f59f){var _0x5e1f4c=this;return new Promise(function(_0x3d91b5,_0x727050){return db['ChatQueue']['find']({'raw':_0x51f59f[_0xdafc('0x1d')]?_0x51f59f[_0xdafc('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x51f59f['options']?_0x51f59f['options']['where']||null:null,'attributes':_0x51f59f[_0xdafc('0x1d')]?_0x51f59f['options'][_0xdafc('0x1f')]||null:null,'include':_0x51f59f[_0xdafc('0x1d')]?_0x51f59f[_0xdafc('0x1d')][_0xdafc('0x21')]?_['map'](_0x51f59f[_0xdafc('0x1d')][_0xdafc('0x21')],function(_0x25ee4c){return{'model':db[_0x25ee4c[_0xdafc('0x22')]],'as':_0x25ee4c['as'],'attributes':_0x25ee4c[_0xdafc('0x1f')],'include':_0x25ee4c[_0xdafc('0x21')]?_['map'](_0x25ee4c[_0xdafc('0x21')],function(_0x413862){return{'model':db[_0x413862[_0xdafc('0x22')]],'as':_0x413862['as'],'attributes':_0x413862['attributes'],'include':_0x413862[_0xdafc('0x21')]?_['map'](_0x413862[_0xdafc('0x21')],function(_0x4a1591){return{'model':db[_0x4a1591[_0xdafc('0x22')]],'as':_0x4a1591['as'],'attributes':_0x4a1591[_0xdafc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdafc('0x25')](function(_0x52ff5b){logger[_0xdafc('0x11')](_0xdafc('0x24'),_0x51f59f);logger[_0xdafc('0x14')]('ShowChatQueue',_0x51f59f,JSON[_0xdafc('0x23')](_0x52ff5b));_0x3d91b5(_0x52ff5b);})['catch'](function(_0x13fc41){logger[_0xdafc('0x15')](_0xdafc('0x24'),_0x13fc41['message'],_0x51f59f);_0x727050(_0x5e1f4c['error'](0x1f4,_0x13fc41[_0xdafc('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 0f3ac7a..6f4bb2c 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 _0xb4e6=['removeListener','register','./chatQueue.events','remove','update','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0xb4e6[_0x3dc68d];return _0xdf7f94;};'use strict';var ChatQueueEvents=require(_0x6b4e('0x0'));var events=['save',_0x6b4e('0x1'),_0x6b4e('0x2')];function createListener(_0x365912,_0x25ffcb){return function(_0x44e781){_0x25ffcb[_0x6b4e('0x3')](_0x365912,_0x44e781);};}function removeListener(_0x1929b8,_0x52313b){return function(){ChatQueueEvents[_0x6b4e('0x4')](_0x1929b8,_0x52313b);};}exports[_0x6b4e('0x5')]=function(_0x1f67a2){for(var _0x49de51=0x0,_0xd3138f=events['length'];_0x49de51<_0xd3138f;_0x49de51++){var _0x4f00be=events[_0x49de51];var _0x2311d9=createListener('chatQueue:'+_0x4f00be,_0x1f67a2);ChatQueueEvents['on'](_0x4f00be,_0x2311d9);}};
\ No newline at end of file
+var _0x04de=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x04de,0x107));var _0xe04d=function(_0x376ca9,_0x3754dd){_0x376ca9=_0x376ca9-0x0;var _0xeda94=_0x04de[_0x376ca9];return _0xeda94;};'use strict';var ChatQueueEvents=require(_0xe04d('0x0'));var events=[_0xe04d('0x1'),_0xe04d('0x2'),_0xe04d('0x3')];function createListener(_0x1e650d,_0x28f63f){return function(_0x1113af){_0x28f63f[_0xe04d('0x4')](_0x1e650d,_0x1113af);};}function removeListener(_0x2593a4,_0x70ead0){return function(){ChatQueueEvents[_0xe04d('0x5')](_0x2593a4,_0x70ead0);};}exports['register']=function(_0x4bb925){for(var _0x4f7637=0x0,_0x531688=events[_0xe04d('0x6')];_0x4f7637<_0x531688;_0x4f7637++){var _0x210e93=events[_0x4f7637];var _0x72b1ce=createListener(_0xe04d('0x7')+_0x210e93,_0x4bb925);ChatQueueEvents['on'](_0x210e93,_0x72b1ce);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index f9775d7..e895da3 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5b8aa9,_0xf9e326){var _0x4afc73=function(_0x9b90fe){while(--_0x9b90fe){_0x5b8aa9['push'](_0x5b8aa9['shift']());}};_0x4afc73(++_0xf9e326);}(_0xe14b,0x93));var _0xbe14=function(_0x1121bc,_0x438708){_0x1121bc=_0x1121bc-0x0;var _0x2d9d34=_0xe14b[_0x1121bc];return _0x2d9d34;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x3d6fb8,_0x1cb6e5){var _0xf21d8a=function(_0x1f9429){while(--_0x1f9429){_0x3d6fb8['push'](_0x3d6fb8['shift']());}};_0xf21d8a(++_0x1cb6e5);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 84e6f78..710ef8d 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 _0x5793=['STRING','DATE','moment','sequelize','exports'];(function(_0x305416,_0x160423){var _0x2254a4=function(_0x1ad48b){while(--_0x1ad48b){_0x305416['push'](_0x305416['shift']());}};_0x2254a4(++_0x160423);}(_0x5793,0xb1));var _0x3579=function(_0x544f2b,_0x2ffa89){_0x544f2b=_0x544f2b-0x0;var _0x51a440=_0x5793[_0x544f2b];return _0x51a440;};'use strict';var moment=require(_0x3579('0x0'));var Sequelize=require(_0x3579('0x1'));module[_0x3579('0x2')]={'uniqueid':{'type':Sequelize[_0x3579('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3579('0x4')]},'exitAt':{'type':Sequelize[_0x3579('0x4')]},'reason':{'type':Sequelize[_0x3579('0x3')]}};
\ No newline at end of file
+var _0x3739=['DATE','moment','exports','STRING'];(function(_0x177135,_0x156a57){var _0x356eee=function(_0x59a61f){while(--_0x59a61f){_0x177135['push'](_0x177135['shift']());}};_0x356eee(++_0x156a57);}(_0x3739,0x1f1));var _0x9373=function(_0x415ac5,_0x663a59){_0x415ac5=_0x415ac5-0x0;var _0x2fb770=_0x3739[_0x415ac5];return _0x2fb770;};'use strict';var moment=require(_0x9373('0x0'));var Sequelize=require('sequelize');module[_0x9373('0x1')]={'uniqueid':{'type':Sequelize[_0x9373('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9373('0x2')]},'joinAt':{'type':Sequelize[_0x9373('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9373('0x3')]},'reason':{'type':Sequelize[_0x9373('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index eee0be3..d39a477 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 _0x8b8e=['json','apply','reject','save','update','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','then','rows','params','includeAll','catch','create','body','find','describe','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x40b0b7,_0xf53ae5){var _0x5dfb0b=function(_0x5a9c9e){while(--_0x5a9c9e){_0x40b0b7['push'](_0x40b0b7['shift']());}};_0x5dfb0b(++_0xf53ae5);}(_0x8b8e,0x108));var _0xe8b8=function(_0x4ae4a0,_0x24585e){_0x4ae4a0=_0x4ae4a0-0x0;var _0x34fdc9=_0x8b8e[_0x4ae4a0];return _0x34fdc9;};'use strict';var emlformat=require(_0xe8b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe8b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe8b8('0x3'));var util=require(_0xe8b8('0x4'));var path=require(_0xe8b8('0x5'));var sox=require(_0xe8b8('0x6'));var csv=require(_0xe8b8('0x7'));var ejs=require(_0xe8b8('0x8'));var fs=require('fs');var fs_extra=require(_0xe8b8('0x9'));var _=require(_0xe8b8('0xa'));var squel=require(_0xe8b8('0xb'));var crypto=require(_0xe8b8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe8b8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe8b8('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe8b8('0xf'));var qs=require(_0xe8b8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8b8('0x11'))(_0xe8b8('0x12'));var utils=require(_0xe8b8('0x13'));var config=require(_0xe8b8('0x14'));var licenseUtil=require(_0xe8b8('0x15'));var db=require(_0xe8b8('0x16'))['db'];function respondWithStatusCode(_0x3de76b,_0x11fb1a){_0x11fb1a=_0x11fb1a||0xcc;return function(_0x151e09){if(_0x151e09){return _0x3de76b[_0xe8b8('0x17')](_0x11fb1a);}return _0x3de76b[_0xe8b8('0x18')](_0x11fb1a)[_0xe8b8('0x19')]();};}function respondWithResult(_0x30bfc7,_0x43698d){_0x43698d=_0x43698d||0xc8;return function(_0x4a3e9f){if(_0x4a3e9f){return _0x30bfc7[_0xe8b8('0x18')](_0x43698d)['json'](_0x4a3e9f);}};}function respondWithFilteredResult(_0x282ea8,_0x290c30){return function(_0x288699){if(_0x288699){var _0x36df40=typeof _0x290c30[_0xe8b8('0x1a')]===_0xe8b8('0x1b')&&typeof _0x290c30[_0xe8b8('0x1c')]===_0xe8b8('0x1b');var _0x4110b6=_0x288699[_0xe8b8('0x1d')];var _0x504738=_0x36df40?0x0:_0x290c30[_0xe8b8('0x1a')];var _0xaba717=_0x36df40?_0x288699['count']:_0x290c30[_0xe8b8('0x1a')]+_0x290c30[_0xe8b8('0x1c')];var _0x2b2b80;if(_0xaba717>=_0x4110b6){_0xaba717=_0x4110b6;_0x2b2b80=0xc8;}else{_0x2b2b80=0xce;}_0x282ea8[_0xe8b8('0x18')](_0x2b2b80);return _0x282ea8[_0xe8b8('0x1e')](_0xe8b8('0x1f'),_0x504738+'-'+_0xaba717+'/'+_0x4110b6)[_0xe8b8('0x20')](_0x288699);}return null;};}function patchUpdates(_0x36c273){return function(_0x29e96){try{jsonpatch[_0xe8b8('0x21')](_0x29e96,_0x36c273,!![]);}catch(_0x3fdc80){return BPromise[_0xe8b8('0x22')](_0x3fdc80);}return _0x29e96[_0xe8b8('0x23')]();};}function saveUpdates(_0x15abeb,_0x35dc1d){return function(_0x838cd4){if(_0x838cd4){return _0x838cd4[_0xe8b8('0x24')](_0x15abeb)['then'](function(_0x57faf7){return _0x57faf7;});}return null;};}function removeEntity(_0x566721,_0x4769fe){return function(_0x51297e){if(_0x51297e){return _0x51297e[_0xe8b8('0x25')]()['then'](function(){_0x566721[_0xe8b8('0x18')](0xcc)[_0xe8b8('0x19')]();});}};}function handleEntityNotFound(_0x5e3fa2,_0x5ac435){return function(_0x19f7b3){if(!_0x19f7b3){_0x5e3fa2[_0xe8b8('0x17')](0x194);}return _0x19f7b3;};}function handleError(_0x56f459,_0x3ce9b2){_0x3ce9b2=_0x3ce9b2||0x1f4;return function(_0x32141f){logger[_0xe8b8('0x26')](_0x32141f[_0xe8b8('0x27')]);if(_0x32141f[_0xe8b8('0x28')]){delete _0x32141f['name'];}_0x56f459[_0xe8b8('0x18')](_0x3ce9b2)['send'](_0x32141f);};}exports[_0xe8b8('0x29')]=function(_0x402e6c,_0x28d703){var _0x390154={},_0x589877={},_0x50c1f6={'count':0x0,'rows':[]};var _0xc98ea8=_[_0xe8b8('0x2a')](db[_0xe8b8('0x2b')][_0xe8b8('0x2c')],function(_0x2f92a5){return{'name':_0x2f92a5['fieldName'],'type':_0x2f92a5[_0xe8b8('0x2d')][_0xe8b8('0x2e')]};});_0x589877[_0xe8b8('0x2f')]=_[_0xe8b8('0x2a')](_0xc98ea8,_0xe8b8('0x28'));_0x589877[_0xe8b8('0x30')]=_[_0xe8b8('0x31')](_0x402e6c[_0xe8b8('0x30')]);_0x589877[_0xe8b8('0x32')]=_[_0xe8b8('0x33')](_0x589877[_0xe8b8('0x2f')],_0x589877['query']);_0x390154[_0xe8b8('0x34')]=_[_0xe8b8('0x33')](_0x589877[_0xe8b8('0x2f')],qs['fields'](_0x402e6c[_0xe8b8('0x30')][_0xe8b8('0x35')]));_0x390154[_0xe8b8('0x34')]=_0x390154[_0xe8b8('0x34')][_0xe8b8('0x36')]?_0x390154[_0xe8b8('0x34')]:_0x589877[_0xe8b8('0x2f')];if(!_0x402e6c[_0xe8b8('0x30')][_0xe8b8('0x37')]('nolimit')){_0x390154[_0xe8b8('0x1c')]=qs[_0xe8b8('0x1c')](_0x402e6c['query'][_0xe8b8('0x1c')]);_0x390154[_0xe8b8('0x1a')]=qs[_0xe8b8('0x1a')](_0x402e6c[_0xe8b8('0x30')][_0xe8b8('0x1a')]);}_0x390154['order']=qs[_0xe8b8('0x38')](_0x402e6c[_0xe8b8('0x30')][_0xe8b8('0x38')]);_0x390154[_0xe8b8('0x39')]=qs[_0xe8b8('0x32')](_[_0xe8b8('0x3a')](_0x402e6c['query'],_0x589877[_0xe8b8('0x32')]),_0xc98ea8);if(_0x402e6c['query'][_0xe8b8('0x3b')]){_0x390154[_0xe8b8('0x39')]=_['merge'](_0x390154['where'],{'$or':_[_0xe8b8('0x2a')](_0xc98ea8,function(_0x1ae916){if(_0x1ae916[_0xe8b8('0x2d')]!==_0xe8b8('0x3c')){var _0x53a18d={};_0x53a18d[_0x1ae916[_0xe8b8('0x28')]]={'$like':'%'+_0x402e6c[_0xe8b8('0x30')][_0xe8b8('0x3b')]+'%'};return _0x53a18d;}})});}_0x390154=_[_0xe8b8('0x3d')]({},_0x390154,_0x402e6c[_0xe8b8('0x3e')]);var _0xecddc8={'where':_0x390154[_0xe8b8('0x39')]};return db[_0xe8b8('0x2b')]['count'](_0xecddc8)['then'](function(_0x2086fa){_0x50c1f6[_0xe8b8('0x1d')]=_0x2086fa;if(_0x402e6c[_0xe8b8('0x30')]['includeAll']){_0x390154[_0xe8b8('0x3f')]=[{'all':!![]}];}return db[_0xe8b8('0x2b')][_0xe8b8('0x40')](_0x390154);})[_0xe8b8('0x41')](function(_0x3fa8b2){_0x50c1f6[_0xe8b8('0x42')]=_0x3fa8b2;return _0x50c1f6;})[_0xe8b8('0x41')](respondWithFilteredResult(_0x28d703,_0x390154))['catch'](handleError(_0x28d703,null));};exports['show']=function(_0x4a851f,_0x16480b){var _0x1b553e={'raw':!![],'where':{'id':_0x4a851f[_0xe8b8('0x43')]['id']}},_0x1068eb={};_0x1068eb['model']=_[_0xe8b8('0x31')](db[_0xe8b8('0x2b')][_0xe8b8('0x2c')]);_0x1068eb[_0xe8b8('0x30')]=_['keys'](_0x4a851f['query']);_0x1068eb[_0xe8b8('0x32')]=_[_0xe8b8('0x33')](_0x1068eb[_0xe8b8('0x2f')],_0x1068eb['query']);_0x1b553e[_0xe8b8('0x34')]=_[_0xe8b8('0x33')](_0x1068eb[_0xe8b8('0x2f')],qs[_0xe8b8('0x35')](_0x4a851f['query'][_0xe8b8('0x35')]));_0x1b553e[_0xe8b8('0x34')]=_0x1b553e[_0xe8b8('0x34')][_0xe8b8('0x36')]?_0x1b553e[_0xe8b8('0x34')]:_0x1068eb[_0xe8b8('0x2f')];if(_0x4a851f[_0xe8b8('0x30')][_0xe8b8('0x44')]){_0x1b553e[_0xe8b8('0x3f')]=[{'all':!![]}];}_0x1b553e=_[_0xe8b8('0x3d')]({},_0x1b553e,_0x4a851f[_0xe8b8('0x3e')]);return db[_0xe8b8('0x2b')]['find'](_0x1b553e)['then'](handleEntityNotFound(_0x16480b,null))[_0xe8b8('0x41')](respondWithResult(_0x16480b,null))[_0xe8b8('0x45')](handleError(_0x16480b,null));};exports[_0xe8b8('0x46')]=function(_0x340880,_0xb78cdb){return db[_0xe8b8('0x2b')][_0xe8b8('0x46')](_0x340880['body'],{})['then'](respondWithResult(_0xb78cdb,0xc9))[_0xe8b8('0x45')](handleError(_0xb78cdb,null));};exports[_0xe8b8('0x24')]=function(_0x5f1e0c,_0x41a1d1){if(_0x5f1e0c[_0xe8b8('0x47')]['id']){delete _0x5f1e0c[_0xe8b8('0x47')]['id'];}return db[_0xe8b8('0x2b')][_0xe8b8('0x48')]({'where':{'id':_0x5f1e0c[_0xe8b8('0x43')]['id']}})[_0xe8b8('0x41')](handleEntityNotFound(_0x41a1d1,null))[_0xe8b8('0x41')](saveUpdates(_0x5f1e0c[_0xe8b8('0x47')],null))[_0xe8b8('0x41')](respondWithResult(_0x41a1d1,null))[_0xe8b8('0x45')](handleError(_0x41a1d1,null));};exports[_0xe8b8('0x25')]=function(_0x5a5322,_0x39f11e){return db['ChatQueueReport'][_0xe8b8('0x48')]({'where':{'id':_0x5a5322[_0xe8b8('0x43')]['id']}})[_0xe8b8('0x41')](handleEntityNotFound(_0x39f11e,null))[_0xe8b8('0x41')](removeEntity(_0x39f11e,null))['catch'](handleError(_0x39f11e,null));};exports[_0xe8b8('0x49')]=function(_0x250a2c,_0x536908){return db[_0xe8b8('0x2b')][_0xe8b8('0x49')]()[_0xe8b8('0x41')](respondWithResult(_0x536908,null))[_0xe8b8('0x45')](handleError(_0x536908,null));};
\ No newline at end of file
+var _0xc677=['ChatQueueReport','includeAll','include','catch','show','params','filters','intersection','find','create','update','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','then','end','name','send','index','map','rawAttributes','type','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options'];(function(_0x4c7e96,_0xc2c958){var _0x1a021c=function(_0x1b693c){while(--_0x1b693c){_0x4c7e96['push'](_0x4c7e96['shift']());}};_0x1a021c(++_0xc2c958);}(_0xc677,0x16c));var _0x7c67=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc677[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c67('0x0'));var zipdir=require(_0x7c67('0x1'));var jsonpatch=require(_0x7c67('0x2'));var rp=require(_0x7c67('0x3'));var moment=require(_0x7c67('0x4'));var BPromise=require(_0x7c67('0x5'));var Mustache=require(_0x7c67('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c67('0x7'));var fs=require('fs');var fs_extra=require(_0x7c67('0x8'));var _=require('lodash');var squel=require(_0x7c67('0x9'));var crypto=require('crypto');var jsforce=require(_0x7c67('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7c67('0xb'));var querystring=require(_0x7c67('0xc'));var Papa=require(_0x7c67('0xd'));var Redis=require(_0x7c67('0xe'));var authService=require(_0x7c67('0xf'));var qs=require(_0x7c67('0x10'));var as=require(_0x7c67('0x11'));var hardwareService=require(_0x7c67('0x12'));var logger=require(_0x7c67('0x13'))(_0x7c67('0x14'));var utils=require(_0x7c67('0x15'));var config=require(_0x7c67('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c67('0x17'))['db'];function respondWithStatusCode(_0x449661,_0x26fa55){_0x26fa55=_0x26fa55||0xcc;return function(_0x52f65b){if(_0x52f65b){return _0x449661[_0x7c67('0x18')](_0x26fa55);}return _0x449661['status'](_0x26fa55)['end']();};}function respondWithResult(_0x31355e,_0x2935eb){_0x2935eb=_0x2935eb||0xc8;return function(_0x3bf387){if(_0x3bf387){return _0x31355e[_0x7c67('0x19')](_0x2935eb)[_0x7c67('0x1a')](_0x3bf387);}};}function respondWithFilteredResult(_0x3c21c9,_0xd9743c){return function(_0x3a01ad){if(_0x3a01ad){var _0x336bb3=typeof _0xd9743c[_0x7c67('0x1b')]==='undefined'&&typeof _0xd9743c[_0x7c67('0x1c')]===_0x7c67('0x1d');var _0x2a4936=_0x3a01ad[_0x7c67('0x1e')];var _0x35d227=_0x336bb3?0x0:_0xd9743c[_0x7c67('0x1b')];var _0x197de0=_0x336bb3?_0x3a01ad[_0x7c67('0x1e')]:_0xd9743c[_0x7c67('0x1b')]+_0xd9743c[_0x7c67('0x1c')];var _0x30ed2c;if(_0x197de0>=_0x2a4936){_0x197de0=_0x2a4936;_0x30ed2c=0xc8;}else{_0x30ed2c=0xce;}_0x3c21c9[_0x7c67('0x19')](_0x30ed2c);return _0x3c21c9[_0x7c67('0x1f')](_0x7c67('0x20'),_0x35d227+'-'+_0x197de0+'/'+_0x2a4936)[_0x7c67('0x1a')](_0x3a01ad);}return null;};}function patchUpdates(_0x271f4e){return function(_0x307bd0){try{jsonpatch['apply'](_0x307bd0,_0x271f4e,!![]);}catch(_0x17d523){return BPromise['reject'](_0x17d523);}return _0x307bd0[_0x7c67('0x21')]();};}function saveUpdates(_0x1a05aa,_0x2af1fd){return function(_0x3f19ce){if(_0x3f19ce){return _0x3f19ce['update'](_0x1a05aa)['then'](function(_0x35b9c8){return _0x35b9c8;});}return null;};}function removeEntity(_0x11170e,_0x42a3d3){return function(_0x5ebfaf){if(_0x5ebfaf){return _0x5ebfaf['destroy']()[_0x7c67('0x22')](function(){_0x11170e[_0x7c67('0x19')](0xcc)[_0x7c67('0x23')]();});}};}function handleEntityNotFound(_0x670d50,_0xe1863a){return function(_0xf09e83){if(!_0xf09e83){_0x670d50['sendStatus'](0x194);}return _0xf09e83;};}function handleError(_0x250848,_0x11dd8d){_0x11dd8d=_0x11dd8d||0x1f4;return function(_0x52bc2b){logger['error'](_0x52bc2b['stack']);if(_0x52bc2b['name']){delete _0x52bc2b[_0x7c67('0x24')];}_0x250848['status'](_0x11dd8d)[_0x7c67('0x25')](_0x52bc2b);};}exports[_0x7c67('0x26')]=function(_0x2d67d5,_0x42ed09){var _0x2d03ef={},_0x51b48f={},_0x20e77c={'count':0x0,'rows':[]};var _0x42926d=_[_0x7c67('0x27')](db['ChatQueueReport'][_0x7c67('0x28')],function(_0x207846){return{'name':_0x207846['fieldName'],'type':_0x207846[_0x7c67('0x29')][_0x7c67('0x2a')]};});_0x51b48f['model']=_['map'](_0x42926d,_0x7c67('0x24'));_0x51b48f[_0x7c67('0x2b')]=_[_0x7c67('0x2c')](_0x2d67d5[_0x7c67('0x2b')]);_0x51b48f['filters']=_['intersection'](_0x51b48f[_0x7c67('0x2d')],_0x51b48f[_0x7c67('0x2b')]);_0x2d03ef[_0x7c67('0x2e')]=_['intersection'](_0x51b48f[_0x7c67('0x2d')],qs[_0x7c67('0x2f')](_0x2d67d5['query'][_0x7c67('0x2f')]));_0x2d03ef[_0x7c67('0x2e')]=_0x2d03ef[_0x7c67('0x2e')]['length']?_0x2d03ef[_0x7c67('0x2e')]:_0x51b48f[_0x7c67('0x2d')];if(!_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x30')](_0x7c67('0x31'))){_0x2d03ef[_0x7c67('0x1c')]=qs[_0x7c67('0x1c')](_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x1c')]);_0x2d03ef['offset']=qs[_0x7c67('0x1b')](_0x2d67d5['query'][_0x7c67('0x1b')]);}_0x2d03ef[_0x7c67('0x32')]=qs['sort'](_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x33')]);_0x2d03ef[_0x7c67('0x34')]=qs['filters'](_['pick'](_0x2d67d5[_0x7c67('0x2b')],_0x51b48f['filters']),_0x42926d);if(_0x2d67d5[_0x7c67('0x2b')]['filter']){_0x2d03ef[_0x7c67('0x34')]=_['merge'](_0x2d03ef[_0x7c67('0x34')],{'$or':_[_0x7c67('0x27')](_0x42926d,function(_0x30543d){if(_0x30543d['type']!==_0x7c67('0x35')){var _0x378006={};_0x378006[_0x30543d['name']]={'$like':'%'+_0x2d67d5[_0x7c67('0x2b')]['filter']+'%'};return _0x378006;}})});}_0x2d03ef=_[_0x7c67('0x36')]({},_0x2d03ef,_0x2d67d5[_0x7c67('0x37')]);var _0x2f7f28={'where':_0x2d03ef['where']};return db[_0x7c67('0x38')][_0x7c67('0x1e')](_0x2f7f28)['then'](function(_0x45245b){_0x20e77c['count']=_0x45245b;if(_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x39')]){_0x2d03ef[_0x7c67('0x3a')]=[{'all':!![]}];}return db[_0x7c67('0x38')]['findAll'](_0x2d03ef);})[_0x7c67('0x22')](function(_0x36d344){_0x20e77c['rows']=_0x36d344;return _0x20e77c;})[_0x7c67('0x22')](respondWithFilteredResult(_0x42ed09,_0x2d03ef))[_0x7c67('0x3b')](handleError(_0x42ed09,null));};exports[_0x7c67('0x3c')]=function(_0x3ee63c,_0x3aaa82){var _0x2695c8={'raw':!![],'where':{'id':_0x3ee63c[_0x7c67('0x3d')]['id']}},_0x45da99={};_0x45da99[_0x7c67('0x2d')]=_[_0x7c67('0x2c')](db[_0x7c67('0x38')][_0x7c67('0x28')]);_0x45da99[_0x7c67('0x2b')]=_['keys'](_0x3ee63c[_0x7c67('0x2b')]);_0x45da99[_0x7c67('0x3e')]=_[_0x7c67('0x3f')](_0x45da99[_0x7c67('0x2d')],_0x45da99['query']);_0x2695c8[_0x7c67('0x2e')]=_[_0x7c67('0x3f')](_0x45da99['model'],qs[_0x7c67('0x2f')](_0x3ee63c[_0x7c67('0x2b')][_0x7c67('0x2f')]));_0x2695c8[_0x7c67('0x2e')]=_0x2695c8[_0x7c67('0x2e')]['length']?_0x2695c8['attributes']:_0x45da99['model'];if(_0x3ee63c[_0x7c67('0x2b')][_0x7c67('0x39')]){_0x2695c8[_0x7c67('0x3a')]=[{'all':!![]}];}_0x2695c8=_[_0x7c67('0x36')]({},_0x2695c8,_0x3ee63c['options']);return db[_0x7c67('0x38')][_0x7c67('0x40')](_0x2695c8)[_0x7c67('0x22')](handleEntityNotFound(_0x3aaa82,null))[_0x7c67('0x22')](respondWithResult(_0x3aaa82,null))['catch'](handleError(_0x3aaa82,null));};exports[_0x7c67('0x41')]=function(_0x3840b5,_0x20428e){return db[_0x7c67('0x38')][_0x7c67('0x41')](_0x3840b5['body'],{})[_0x7c67('0x22')](respondWithResult(_0x20428e,0xc9))[_0x7c67('0x3b')](handleError(_0x20428e,null));};exports[_0x7c67('0x42')]=function(_0x1e07bf,_0x26e374){if(_0x1e07bf[_0x7c67('0x43')]['id']){delete _0x1e07bf[_0x7c67('0x43')]['id'];}return db[_0x7c67('0x38')]['find']({'where':{'id':_0x1e07bf[_0x7c67('0x3d')]['id']}})[_0x7c67('0x22')](handleEntityNotFound(_0x26e374,null))[_0x7c67('0x22')](saveUpdates(_0x1e07bf['body'],null))[_0x7c67('0x22')](respondWithResult(_0x26e374,null))[_0x7c67('0x3b')](handleError(_0x26e374,null));};exports[_0x7c67('0x44')]=function(_0x1b766d,_0x156c5a){return db[_0x7c67('0x38')]['find']({'where':{'id':_0x1b766d['params']['id']}})[_0x7c67('0x22')](handleEntityNotFound(_0x156c5a,null))['then'](removeEntity(_0x156c5a,null))[_0x7c67('0x3b')](handleError(_0x156c5a,null));};exports['describe']=function(_0x12c471,_0x23883f){return db[_0x7c67('0x38')][_0x7c67('0x45')]()['then'](respondWithResult(_0x23883f,null))['catch'](handleError(_0x23883f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index a7226e8..598970b 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4dc3c6,_0x541ba2){var _0x1f4f81=function(_0x1206e4){while(--_0x1206e4){_0x4dc3c6['push'](_0x4dc3c6['shift']());}};_0x1f4f81(++_0x541ba2);}(_0x757a,0xde));var _0xa757=function(_0x1ad8bc,_0x3fe383){_0x1ad8bc=_0x1ad8bc-0x0;var _0x2a30c7=_0x757a[_0x1ad8bc];return _0x2a30c7;};'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 8a347c6..eb80812 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 _0x27c0=['then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','body','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2cee59,_0x10c76e){var _0x216c09=function(_0x3242c9){while(--_0x3242c9){_0x2cee59['push'](_0x2cee59['shift']());}};_0x216c09(++_0x10c76e);}(_0x27c0,0xad));var _0x027c=function(_0x33f742,_0x36bf03){_0x33f742=_0x33f742-0x0;var _0x15e17e=_0x27c0[_0x33f742];return _0x15e17e;};'use strict';var _=require(_0x027c('0x0'));var util=require(_0x027c('0x1'));var moment=require(_0x027c('0x2'));var BPromise=require(_0x027c('0x3'));var rs=require(_0x027c('0x4'));var fs=require('fs');var Redis=require(_0x027c('0x5'));var db=require(_0x027c('0x6'))['db'];var utils=require(_0x027c('0x7'));var logger=require(_0x027c('0x8'))(_0x027c('0x9'));var config=require('../../config/environment');var jayson=require(_0x027c('0xa'));var client=jayson[_0x027c('0xb')][_0x027c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x414dda,_0x2c5dc1,_0x1a48bd){return new BPromise(function(_0x1de467,_0x5ea5a1){return client['request'](_0x414dda,_0x1a48bd)[_0x027c('0xd')](function(_0x114c0e){logger[_0x027c('0xe')](_0x027c('0xf'),_0x2c5dc1,'request\x20sent');logger[_0x027c('0x10')](_0x027c('0x11'),_0x2c5dc1,'request\x20sent',JSON[_0x027c('0x12')](_0x114c0e));if(_0x114c0e[_0x027c('0x13')]){if(_0x114c0e['error']['code']===0x1f4){logger[_0x027c('0x13')](_0x027c('0xf'),_0x2c5dc1,_0x114c0e[_0x027c('0x13')][_0x027c('0x14')]);return _0x5ea5a1(_0x114c0e['error'][_0x027c('0x14')]);}logger[_0x027c('0x13')](_0x027c('0xf'),_0x2c5dc1,_0x114c0e[_0x027c('0x13')][_0x027c('0x14')]);return _0x1de467(_0x114c0e['error'][_0x027c('0x14')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x2c5dc1,'request\x20sent');_0x1de467(_0x114c0e['result'][_0x027c('0x14')]);}})[_0x027c('0x15')](function(_0x5ed0f0){logger[_0x027c('0x13')](_0x027c('0xf'),_0x2c5dc1,_0x5ed0f0);_0x5ea5a1(_0x5ed0f0);});});}exports['CreateChatQueueReport']=function(_0x5d0907){var _0x1f084a=this;return new Promise(function(_0x19fe48,_0x5dd503){return db[_0x027c('0x16')][_0x027c('0x17')](_0x5d0907['body'],{'raw':_0x5d0907[_0x027c('0x18')]?_0x5d0907[_0x027c('0x18')][_0x027c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x282f3f){logger[_0x027c('0xe')](_0x027c('0x1a'),_0x5d0907);logger[_0x027c('0x10')](_0x027c('0x1a'),_0x5d0907,JSON[_0x027c('0x12')](_0x282f3f));_0x19fe48(_0x282f3f);})[_0x027c('0x15')](function(_0x471569){logger[_0x027c('0x13')](_0x027c('0x1a'),_0x471569[_0x027c('0x14')],_0x5d0907);_0x5dd503(_0x1f084a[_0x027c('0x13')](0x1f4,_0x471569[_0x027c('0x14')]));});});};exports[_0x027c('0x1b')]=function(_0x5c85f5){var _0x2e55a6=this;return new Promise(function(_0x14d30c,_0x408463){return db[_0x027c('0x16')][_0x027c('0x1c')](_0x5c85f5[_0x027c('0x1d')],{'raw':_0x5c85f5[_0x027c('0x18')]?_0x5c85f5[_0x027c('0x18')][_0x027c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c85f5['options']?_0x5c85f5[_0x027c('0x18')]['where']||null:null,'attributes':_0x5c85f5[_0x027c('0x18')]?_0x5c85f5[_0x027c('0x18')]['attributes']||null:null,'limit':_0x5c85f5[_0x027c('0x18')]?_0x5c85f5[_0x027c('0x18')][_0x027c('0x1e')]||null:null})['then'](function(_0x3a2d21){logger[_0x027c('0xe')](_0x027c('0x1b'),_0x5c85f5);logger[_0x027c('0x10')]('UpdateChatQueueReport',_0x5c85f5,JSON[_0x027c('0x12')](_0x3a2d21));_0x14d30c(_0x3a2d21);})[_0x027c('0x15')](function(_0x17e9ba){logger[_0x027c('0x13')](_0x027c('0x1b'),_0x17e9ba[_0x027c('0x14')],_0x5c85f5);_0x408463(_0x2e55a6[_0x027c('0x13')](0x1f4,_0x17e9ba['message']));});});};
\ No newline at end of file
+var _0xe021=['ChatQueueReport','create','options','raw','debug','body','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','http','then','info','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport'];(function(_0xecdf7,_0x29ecda){var _0x25c15c=function(_0x1cef05){while(--_0x1cef05){_0xecdf7['push'](_0xecdf7['shift']());}};_0x25c15c(++_0x29ecda);}(_0xe021,0x10e));var _0x1e02=function(_0x407b70,_0x5f254c){_0x407b70=_0x407b70-0x0;var _0x5b7a85=_0xe021[_0x407b70];return _0x5b7a85;};'use strict';var _=require(_0x1e02('0x0'));var util=require(_0x1e02('0x1'));var moment=require(_0x1e02('0x2'));var BPromise=require(_0x1e02('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1e02('0x4'));var logger=require('../../config/logger')(_0x1e02('0x5'));var config=require(_0x1e02('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e02('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6f4c4c,_0x49be38,_0x198301){return new BPromise(function(_0x3b960e,_0x1ebc80){return client['request'](_0x6f4c4c,_0x198301)[_0x1e02('0x8')](function(_0x3d1db1){logger[_0x1e02('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x49be38,'request\x20sent');logger['debug'](_0x1e02('0xa'),_0x49be38,_0x1e02('0xb'),JSON[_0x1e02('0xc')](_0x3d1db1));if(_0x3d1db1[_0x1e02('0xd')]){if(_0x3d1db1[_0x1e02('0xd')][_0x1e02('0xe')]===0x1f4){logger[_0x1e02('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x49be38,_0x3d1db1[_0x1e02('0xd')][_0x1e02('0xf')]);return _0x1ebc80(_0x3d1db1[_0x1e02('0xd')][_0x1e02('0xf')]);}logger[_0x1e02('0xd')](_0x1e02('0x10'),_0x49be38,_0x3d1db1['error'][_0x1e02('0xf')]);return _0x3b960e(_0x3d1db1['error'][_0x1e02('0xf')]);}else{logger[_0x1e02('0x9')](_0x1e02('0x10'),_0x49be38,_0x1e02('0xb'));_0x3b960e(_0x3d1db1[_0x1e02('0x11')][_0x1e02('0xf')]);}})[_0x1e02('0x12')](function(_0x4bc062){logger[_0x1e02('0xd')](_0x1e02('0x10'),_0x49be38,_0x4bc062);_0x1ebc80(_0x4bc062);});});}exports[_0x1e02('0x13')]=function(_0x31f37f){var _0x426ea2=this;return new Promise(function(_0x432b5d,_0x5b009f){return db[_0x1e02('0x14')][_0x1e02('0x15')](_0x31f37f['body'],{'raw':_0x31f37f[_0x1e02('0x16')]?_0x31f37f[_0x1e02('0x16')][_0x1e02('0x17')]===undefined?!![]:![]:!![]})[_0x1e02('0x8')](function(_0xe36577){logger[_0x1e02('0x9')](_0x1e02('0x13'),_0x31f37f);logger[_0x1e02('0x18')](_0x1e02('0x13'),_0x31f37f,JSON['stringify'](_0xe36577));_0x432b5d(_0xe36577);})[_0x1e02('0x12')](function(_0x3b222b){logger[_0x1e02('0xd')](_0x1e02('0x13'),_0x3b222b[_0x1e02('0xf')],_0x31f37f);_0x5b009f(_0x426ea2['error'](0x1f4,_0x3b222b[_0x1e02('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x149764){var _0x5df68a=this;return new Promise(function(_0x3d4ff8,_0x2b6d80){return db[_0x1e02('0x14')]['update'](_0x149764[_0x1e02('0x19')],{'raw':_0x149764['options']?_0x149764[_0x1e02('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149764[_0x1e02('0x16')]?_0x149764[_0x1e02('0x16')]['where']||null:null,'attributes':_0x149764['options']?_0x149764[_0x1e02('0x16')][_0x1e02('0x1a')]||null:null,'limit':_0x149764['options']?_0x149764[_0x1e02('0x16')][_0x1e02('0x1b')]||null:null})[_0x1e02('0x8')](function(_0x199c15){logger['info'](_0x1e02('0x1c'),_0x149764);logger['debug'](_0x1e02('0x1c'),_0x149764,JSON['stringify'](_0x199c15));_0x3d4ff8(_0x199c15);})[_0x1e02('0x12')](function(_0x587aa9){logger[_0x1e02('0xd')](_0x1e02('0x1c'),_0x587aa9[_0x1e02('0xf')],_0x149764);_0x2b6d80(_0x5df68a[_0x1e02('0xd')](0x1f4,_0x587aa9[_0x1e02('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 8f92b94..4618398 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 _0xe2b8=['multer','util','path','express','fs-extra','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/:id','post','create','update','destroy'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xe2b8,0x168));var _0x8e2b=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xe2b8[_0x1ae4a9];return _0x54d0b0;};'use strict';var multer=require(_0x8e2b('0x0'));var util=require(_0x8e2b('0x1'));var path=require(_0x8e2b('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e2b('0x3'));var router=express['Router']();var fs_extra=require(_0x8e2b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8e2b('0x5'));var config=require('../../config/environment');var controller=require(_0x8e2b('0x6'));router[_0x8e2b('0x7')]('/',auth[_0x8e2b('0x8')](),controller[_0x8e2b('0x9')]);router['get']('/describe',auth[_0x8e2b('0x8')](),controller['describe']);router[_0x8e2b('0x7')](_0x8e2b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8e2b('0xb')]('/',auth['isAuthenticated'](),controller[_0x8e2b('0xc')]);router['put'](_0x8e2b('0xa'),auth[_0x8e2b('0x8')](),controller[_0x8e2b('0xd')]);router['delete']('/:id',auth[_0x8e2b('0x8')](),controller[_0x8e2b('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x0871=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xf74f46,_0x1a49d4){var _0x5ea729=function(_0x73e853){while(--_0x73e853){_0xf74f46['push'](_0xf74f46['shift']());}};_0x5ea729(++_0x1a49d4);}(_0x0871,0xdc));var _0x1087=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x0871[_0x2b7764];return _0x848dcb;};'use strict';var multer=require(_0x1087('0x0'));var util=require(_0x1087('0x1'));var path=require(_0x1087('0x2'));var timeout=require(_0x1087('0x3'));var express=require(_0x1087('0x4'));var router=express[_0x1087('0x5')]();var fs_extra=require(_0x1087('0x6'));var auth=require(_0x1087('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1087('0x8'));var controller=require('./chatQueueReport.controller');router[_0x1087('0x9')]('/',auth[_0x1087('0xa')](),controller[_0x1087('0xb')]);router[_0x1087('0x9')]('/describe',auth[_0x1087('0xa')](),controller[_0x1087('0xc')]);router[_0x1087('0x9')](_0x1087('0xd'),auth[_0x1087('0xa')](),controller[_0x1087('0xe')]);router['post']('/',auth[_0x1087('0xa')](),controller['create']);router[_0x1087('0xf')]('/:id',auth[_0x1087('0xa')](),controller[_0x1087('0x10')]);router['delete'](_0x1087('0xd'),auth['isAuthenticated'](),controller[_0x1087('0x11')]);module[_0x1087('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 9d7de56..3aded91 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3db50e,_0x452e95){var _0x372396=function(_0x428b18){while(--_0x428b18){_0x3db50e['push'](_0x3db50e['shift']());}};_0x372396(++_0x452e95);}(_0xedd9,0xfc));var _0x9edd=function(_0x66495,_0x40446c){_0x66495=_0x66495-0x0;var _0x9cfe81=_0xedd9[_0x66495];return _0x9cfe81;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x48f038,_0x2bde84){var _0x2edc62=function(_0x1e6cc8){while(--_0x1e6cc8){_0x48f038['push'](_0x48f038['shift']());}};_0x2edc62(++_0x2bde84);}(_0x54ef,0x112));var _0xf54e=function(_0x23013,_0x55eaa7){_0x23013=_0x23013-0x0;var _0x52479a=_0x54ef[_0x23013];return _0x52479a;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 6b71385..38350a5 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 _0x0af9=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','error','stack','name','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','destroy','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xcef3a,_0x55454b){var _0x3e573a=function(_0x2de0a8){while(--_0x2de0a8){_0xcef3a['push'](_0xcef3a['shift']());}};_0x3e573a(++_0x55454b);}(_0x0af9,0x161));var _0x90af=function(_0x97a0fd,_0x54c22e){_0x97a0fd=_0x97a0fd-0x0;var _0x542f59=_0x0af9[_0x97a0fd];return _0x542f59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x90af('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90af('0x1'));var moment=require(_0x90af('0x2'));var BPromise=require(_0x90af('0x3'));var Mustache=require(_0x90af('0x4'));var util=require(_0x90af('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x90af('0x6'));var ejs=require(_0x90af('0x7'));var fs=require('fs');var fs_extra=require(_0x90af('0x8'));var _=require(_0x90af('0x9'));var squel=require(_0x90af('0xa'));var crypto=require(_0x90af('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x90af('0x6'));var querystring=require(_0x90af('0xc'));var Papa=require(_0x90af('0xd'));var Redis=require('ioredis');var authService=require(_0x90af('0xe'));var qs=require(_0x90af('0xf'));var as=require(_0x90af('0x10'));var hardwareService=require(_0x90af('0x11'));var logger=require(_0x90af('0x12'))(_0x90af('0x13'));var utils=require('../../config/utils');var config=require(_0x90af('0x14'));var licenseUtil=require(_0x90af('0x15'));var db=require(_0x90af('0x16'))['db'];function respondWithStatusCode(_0x4ddeb4,_0x189f7b){_0x189f7b=_0x189f7b||0xcc;return function(_0x7c41c0){if(_0x7c41c0){return _0x4ddeb4[_0x90af('0x17')](_0x189f7b);}return _0x4ddeb4[_0x90af('0x18')](_0x189f7b)[_0x90af('0x19')]();};}function respondWithResult(_0x1f9a88,_0xb9d109){_0xb9d109=_0xb9d109||0xc8;return function(_0x3e9b6b){if(_0x3e9b6b){return _0x1f9a88['status'](_0xb9d109)['json'](_0x3e9b6b);}};}function respondWithFilteredResult(_0x5703cb,_0x3a797f){return function(_0x37e3fa){if(_0x37e3fa){var _0x18c881=typeof _0x3a797f[_0x90af('0x1a')]===_0x90af('0x1b')&&typeof _0x3a797f[_0x90af('0x1c')]===_0x90af('0x1b');var _0x9efb5c=_0x37e3fa[_0x90af('0x1d')];var _0x2663ff=_0x18c881?0x0:_0x3a797f[_0x90af('0x1a')];var _0x41e631=_0x18c881?_0x37e3fa[_0x90af('0x1d')]:_0x3a797f['offset']+_0x3a797f[_0x90af('0x1c')];var _0x535bc9;if(_0x41e631>=_0x9efb5c){_0x41e631=_0x9efb5c;_0x535bc9=0xc8;}else{_0x535bc9=0xce;}_0x5703cb[_0x90af('0x18')](_0x535bc9);return _0x5703cb['set'](_0x90af('0x1e'),_0x2663ff+'-'+_0x41e631+'/'+_0x9efb5c)[_0x90af('0x1f')](_0x37e3fa);}return null;};}function patchUpdates(_0x269f4b){return function(_0x2f1a81){try{jsonpatch[_0x90af('0x20')](_0x2f1a81,_0x269f4b,!![]);}catch(_0x46eeae){return BPromise[_0x90af('0x21')](_0x46eeae);}return _0x2f1a81[_0x90af('0x22')]();};}function saveUpdates(_0x5816a0,_0x169b15){return function(_0x33b887){if(_0x33b887){return _0x33b887[_0x90af('0x23')](_0x5816a0)['then'](function(_0x4be6d8){return _0x4be6d8;});}return null;};}function removeEntity(_0x20089e,_0x415483){return function(_0x5242ec){if(_0x5242ec){return _0x5242ec['destroy']()['then'](function(){_0x20089e['status'](0xcc)[_0x90af('0x19')]();});}};}function handleEntityNotFound(_0x2cd914,_0x171ca2){return function(_0x48da1d){if(!_0x48da1d){_0x2cd914[_0x90af('0x17')](0x194);}return _0x48da1d;};}function handleError(_0x2927ff,_0x8b7246){_0x8b7246=_0x8b7246||0x1f4;return function(_0x53b2e2){logger[_0x90af('0x24')](_0x53b2e2[_0x90af('0x25')]);if(_0x53b2e2['name']){delete _0x53b2e2[_0x90af('0x26')];}_0x2927ff[_0x90af('0x18')](_0x8b7246)['send'](_0x53b2e2);};}exports['index']=function(_0x5bbce6,_0x4c6876){var _0x4a2180={},_0x4d685a={},_0x4f4078={'count':0x0,'rows':[]};var _0x12f236=_[_0x90af('0x27')](db[_0x90af('0x28')][_0x90af('0x29')],function(_0x101bcf){return{'name':_0x101bcf[_0x90af('0x2a')],'type':_0x101bcf[_0x90af('0x2b')][_0x90af('0x2c')]};});_0x4d685a[_0x90af('0x2d')]=_[_0x90af('0x27')](_0x12f236,_0x90af('0x26'));_0x4d685a[_0x90af('0x2e')]=_[_0x90af('0x2f')](_0x5bbce6['query']);_0x4d685a[_0x90af('0x30')]=_[_0x90af('0x31')](_0x4d685a[_0x90af('0x2d')],_0x4d685a['query']);_0x4a2180[_0x90af('0x32')]=_['intersection'](_0x4d685a['model'],qs['fields'](_0x5bbce6[_0x90af('0x2e')][_0x90af('0x33')]));_0x4a2180[_0x90af('0x32')]=_0x4a2180[_0x90af('0x32')][_0x90af('0x34')]?_0x4a2180[_0x90af('0x32')]:_0x4d685a[_0x90af('0x2d')];if(!_0x5bbce6[_0x90af('0x2e')][_0x90af('0x35')]('nolimit')){_0x4a2180[_0x90af('0x1c')]=qs[_0x90af('0x1c')](_0x5bbce6[_0x90af('0x2e')][_0x90af('0x1c')]);_0x4a2180[_0x90af('0x1a')]=qs[_0x90af('0x1a')](_0x5bbce6[_0x90af('0x2e')]['offset']);}_0x4a2180[_0x90af('0x36')]=qs[_0x90af('0x37')](_0x5bbce6[_0x90af('0x2e')][_0x90af('0x37')]);_0x4a2180[_0x90af('0x38')]=qs[_0x90af('0x30')](_[_0x90af('0x39')](_0x5bbce6[_0x90af('0x2e')],_0x4d685a[_0x90af('0x30')]),_0x12f236);if(_0x5bbce6['query'][_0x90af('0x3a')]){_0x4a2180[_0x90af('0x38')]=_['merge'](_0x4a2180[_0x90af('0x38')],{'$or':_[_0x90af('0x27')](_0x12f236,function(_0x3c35fe){if(_0x3c35fe['type']!==_0x90af('0x3b')){var _0x29dfff={};_0x29dfff[_0x3c35fe['name']]={'$like':'%'+_0x5bbce6['query']['filter']+'%'};return _0x29dfff;}})});}_0x4a2180=_['merge']({},_0x4a2180,_0x5bbce6[_0x90af('0x3c')]);var _0x5d6fa5={'where':_0x4a2180['where']};return db['ChatTransferReport'][_0x90af('0x1d')](_0x5d6fa5)[_0x90af('0x3d')](function(_0x134f46){_0x4f4078[_0x90af('0x1d')]=_0x134f46;if(_0x5bbce6[_0x90af('0x2e')][_0x90af('0x3e')]){_0x4a2180['include']=[{'all':!![]}];}return db[_0x90af('0x28')][_0x90af('0x3f')](_0x4a2180);})[_0x90af('0x3d')](function(_0x15caae){_0x4f4078[_0x90af('0x40')]=_0x15caae;return _0x4f4078;})['then'](respondWithFilteredResult(_0x4c6876,_0x4a2180))[_0x90af('0x41')](handleError(_0x4c6876,null));};exports[_0x90af('0x42')]=function(_0x261f0f,_0x5cd7fb){var _0x5212de={'raw':!![],'where':{'id':_0x261f0f[_0x90af('0x43')]['id']}},_0x6f4d9b={};_0x6f4d9b['model']=_[_0x90af('0x2f')](db[_0x90af('0x28')][_0x90af('0x29')]);_0x6f4d9b[_0x90af('0x2e')]=_['keys'](_0x261f0f[_0x90af('0x2e')]);_0x6f4d9b[_0x90af('0x30')]=_[_0x90af('0x31')](_0x6f4d9b[_0x90af('0x2d')],_0x6f4d9b[_0x90af('0x2e')]);_0x5212de[_0x90af('0x32')]=_[_0x90af('0x31')](_0x6f4d9b[_0x90af('0x2d')],qs[_0x90af('0x33')](_0x261f0f['query'][_0x90af('0x33')]));_0x5212de['attributes']=_0x5212de['attributes'][_0x90af('0x34')]?_0x5212de[_0x90af('0x32')]:_0x6f4d9b[_0x90af('0x2d')];if(_0x261f0f[_0x90af('0x2e')]['includeAll']){_0x5212de[_0x90af('0x44')]=[{'all':!![]}];}_0x5212de=_[_0x90af('0x45')]({},_0x5212de,_0x261f0f[_0x90af('0x3c')]);return db[_0x90af('0x28')][_0x90af('0x46')](_0x5212de)[_0x90af('0x3d')](handleEntityNotFound(_0x5cd7fb,null))[_0x90af('0x3d')](respondWithResult(_0x5cd7fb,null))[_0x90af('0x41')](handleError(_0x5cd7fb,null));};exports[_0x90af('0x47')]=function(_0x57c482,_0x27a9ed){return db['ChatTransferReport'][_0x90af('0x47')](_0x57c482[_0x90af('0x48')],{})[_0x90af('0x3d')](respondWithResult(_0x27a9ed,0xc9))[_0x90af('0x41')](handleError(_0x27a9ed,null));};exports[_0x90af('0x23')]=function(_0x584268,_0x16cffc){if(_0x584268[_0x90af('0x48')]['id']){delete _0x584268[_0x90af('0x48')]['id'];}return db[_0x90af('0x28')][_0x90af('0x46')]({'where':{'id':_0x584268[_0x90af('0x43')]['id']}})[_0x90af('0x3d')](handleEntityNotFound(_0x16cffc,null))[_0x90af('0x3d')](saveUpdates(_0x584268['body'],null))[_0x90af('0x3d')](respondWithResult(_0x16cffc,null))[_0x90af('0x41')](handleError(_0x16cffc,null));};exports[_0x90af('0x49')]=function(_0x25eb0a,_0x9e0080){return db['ChatTransferReport']['find']({'where':{'id':_0x25eb0a[_0x90af('0x43')]['id']}})['then'](handleEntityNotFound(_0x9e0080,null))[_0x90af('0x3d')](removeEntity(_0x9e0080,null))[_0x90af('0x41')](handleError(_0x9e0080,null));};exports['describe']=function(_0x30c0ad,_0x359912){return db['ChatTransferReport']['describe']()[_0x90af('0x3d')](respondWithResult(_0x359912,null))[_0x90af('0x41')](handleError(_0x359912,null));};
\ No newline at end of file
+var _0x1826=['../../mysqldb','end','status','json','offset','undefined','limit','count','set','save','update','then','sendStatus','error','name','index','map','ChatTransferReport','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','rawAttributes','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x51ffc3,_0x5f03b2){var _0x14da54=function(_0x36eb4a){while(--_0x36eb4a){_0x51ffc3['push'](_0x51ffc3['shift']());}};_0x14da54(++_0x5f03b2);}(_0x1826,0x1da));var _0x6182=function(_0x46dc29,_0x18c45a){_0x46dc29=_0x46dc29-0x0;var _0x4bbb8d=_0x1826[_0x46dc29];return _0x4bbb8d;};'use strict';var emlformat=require(_0x6182('0x0'));var rimraf=require(_0x6182('0x1'));var zipdir=require(_0x6182('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6182('0x3'));var moment=require('moment');var BPromise=require(_0x6182('0x4'));var Mustache=require(_0x6182('0x5'));var util=require(_0x6182('0x6'));var path=require('path');var sox=require(_0x6182('0x7'));var csv=require(_0x6182('0x8'));var ejs=require(_0x6182('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6182('0xa'));var squel=require(_0x6182('0xb'));var crypto=require(_0x6182('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6182('0xd'));var toCsv=require(_0x6182('0x8'));var querystring=require('querystring');var Papa=require(_0x6182('0xe'));var Redis=require(_0x6182('0xf'));var authService=require(_0x6182('0x10'));var qs=require(_0x6182('0x11'));var as=require(_0x6182('0x12'));var hardwareService=require(_0x6182('0x13'));var logger=require(_0x6182('0x14'))(_0x6182('0x15'));var utils=require('../../config/utils');var config=require(_0x6182('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6182('0x17'))['db'];function respondWithStatusCode(_0xc5959e,_0x72f907){_0x72f907=_0x72f907||0xcc;return function(_0x3a8a0e){if(_0x3a8a0e){return _0xc5959e['sendStatus'](_0x72f907);}return _0xc5959e['status'](_0x72f907)[_0x6182('0x18')]();};}function respondWithResult(_0x4ca7a5,_0x16a30d){_0x16a30d=_0x16a30d||0xc8;return function(_0x5ef8f9){if(_0x5ef8f9){return _0x4ca7a5[_0x6182('0x19')](_0x16a30d)[_0x6182('0x1a')](_0x5ef8f9);}};}function respondWithFilteredResult(_0x3db03c,_0x53d456){return function(_0x3eb0f8){if(_0x3eb0f8){var _0x464c54=typeof _0x53d456[_0x6182('0x1b')]===_0x6182('0x1c')&&typeof _0x53d456[_0x6182('0x1d')]===_0x6182('0x1c');var _0x3a961e=_0x3eb0f8[_0x6182('0x1e')];var _0x3bd4f8=_0x464c54?0x0:_0x53d456[_0x6182('0x1b')];var _0x3876e5=_0x464c54?_0x3eb0f8['count']:_0x53d456[_0x6182('0x1b')]+_0x53d456['limit'];var _0x4c48f2;if(_0x3876e5>=_0x3a961e){_0x3876e5=_0x3a961e;_0x4c48f2=0xc8;}else{_0x4c48f2=0xce;}_0x3db03c[_0x6182('0x19')](_0x4c48f2);return _0x3db03c[_0x6182('0x1f')]('Content-Range',_0x3bd4f8+'-'+_0x3876e5+'/'+_0x3a961e)['json'](_0x3eb0f8);}return null;};}function patchUpdates(_0x2230cd){return function(_0x2995ee){try{jsonpatch['apply'](_0x2995ee,_0x2230cd,!![]);}catch(_0x2b92ad){return BPromise['reject'](_0x2b92ad);}return _0x2995ee[_0x6182('0x20')]();};}function saveUpdates(_0x373df2,_0xd722cb){return function(_0x5251ae){if(_0x5251ae){return _0x5251ae[_0x6182('0x21')](_0x373df2)[_0x6182('0x22')](function(_0x1e3e23){return _0x1e3e23;});}return null;};}function removeEntity(_0x1ab12f,_0x43c2be){return function(_0x94c7d0){if(_0x94c7d0){return _0x94c7d0['destroy']()['then'](function(){_0x1ab12f[_0x6182('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f84ce,_0xe29c0c){return function(_0x1fc60d){if(!_0x1fc60d){_0x1f84ce[_0x6182('0x23')](0x194);}return _0x1fc60d;};}function handleError(_0xb3656e,_0x34e2ae){_0x34e2ae=_0x34e2ae||0x1f4;return function(_0x282b36){logger[_0x6182('0x24')](_0x282b36['stack']);if(_0x282b36[_0x6182('0x25')]){delete _0x282b36[_0x6182('0x25')];}_0xb3656e[_0x6182('0x19')](_0x34e2ae)['send'](_0x282b36);};}exports[_0x6182('0x26')]=function(_0x3bf9c9,_0x340ba3){var _0x4dcae9={},_0x52ddea={},_0x479cb9={'count':0x0,'rows':[]};var _0x5ed5f2=_[_0x6182('0x27')](db[_0x6182('0x28')]['rawAttributes'],function(_0x418ba7){return{'name':_0x418ba7[_0x6182('0x29')],'type':_0x418ba7[_0x6182('0x2a')][_0x6182('0x2b')]};});_0x52ddea[_0x6182('0x2c')]=_[_0x6182('0x27')](_0x5ed5f2,_0x6182('0x25'));_0x52ddea['query']=_[_0x6182('0x2d')](_0x3bf9c9[_0x6182('0x2e')]);_0x52ddea[_0x6182('0x2f')]=_['intersection'](_0x52ddea[_0x6182('0x2c')],_0x52ddea['query']);_0x4dcae9['attributes']=_[_0x6182('0x30')](_0x52ddea[_0x6182('0x2c')],qs[_0x6182('0x31')](_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x31')]));_0x4dcae9['attributes']=_0x4dcae9['attributes'][_0x6182('0x32')]?_0x4dcae9[_0x6182('0x33')]:_0x52ddea[_0x6182('0x2c')];if(!_0x3bf9c9[_0x6182('0x2e')]['hasOwnProperty'](_0x6182('0x34'))){_0x4dcae9['limit']=qs[_0x6182('0x1d')](_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x1d')]);_0x4dcae9['offset']=qs[_0x6182('0x1b')](_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x1b')]);}_0x4dcae9[_0x6182('0x35')]=qs[_0x6182('0x36')](_0x3bf9c9[_0x6182('0x2e')]['sort']);_0x4dcae9[_0x6182('0x37')]=qs[_0x6182('0x2f')](_[_0x6182('0x38')](_0x3bf9c9[_0x6182('0x2e')],_0x52ddea[_0x6182('0x2f')]),_0x5ed5f2);if(_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x39')]){_0x4dcae9[_0x6182('0x37')]=_[_0x6182('0x3a')](_0x4dcae9[_0x6182('0x37')],{'$or':_['map'](_0x5ed5f2,function(_0x296a12){if(_0x296a12[_0x6182('0x2a')]!==_0x6182('0x3b')){var _0xbce622={};_0xbce622[_0x296a12[_0x6182('0x25')]]={'$like':'%'+_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x39')]+'%'};return _0xbce622;}})});}_0x4dcae9=_[_0x6182('0x3a')]({},_0x4dcae9,_0x3bf9c9['options']);var _0xa0bc8d={'where':_0x4dcae9[_0x6182('0x37')]};return db[_0x6182('0x28')][_0x6182('0x1e')](_0xa0bc8d)[_0x6182('0x22')](function(_0x37c5ad){_0x479cb9[_0x6182('0x1e')]=_0x37c5ad;if(_0x3bf9c9[_0x6182('0x2e')][_0x6182('0x3c')]){_0x4dcae9[_0x6182('0x3d')]=[{'all':!![]}];}return db[_0x6182('0x28')][_0x6182('0x3e')](_0x4dcae9);})[_0x6182('0x22')](function(_0x131bb8){_0x479cb9[_0x6182('0x3f')]=_0x131bb8;return _0x479cb9;})['then'](respondWithFilteredResult(_0x340ba3,_0x4dcae9))['catch'](handleError(_0x340ba3,null));};exports['show']=function(_0x235ff6,_0x5f5ba1){var _0x1b9e08={'raw':!![],'where':{'id':_0x235ff6['params']['id']}},_0x258797={};_0x258797[_0x6182('0x2c')]=_[_0x6182('0x2d')](db['ChatTransferReport'][_0x6182('0x40')]);_0x258797[_0x6182('0x2e')]=_[_0x6182('0x2d')](_0x235ff6[_0x6182('0x2e')]);_0x258797[_0x6182('0x2f')]=_['intersection'](_0x258797[_0x6182('0x2c')],_0x258797['query']);_0x1b9e08[_0x6182('0x33')]=_['intersection'](_0x258797[_0x6182('0x2c')],qs['fields'](_0x235ff6[_0x6182('0x2e')]['fields']));_0x1b9e08[_0x6182('0x33')]=_0x1b9e08[_0x6182('0x33')][_0x6182('0x32')]?_0x1b9e08[_0x6182('0x33')]:_0x258797[_0x6182('0x2c')];if(_0x235ff6[_0x6182('0x2e')]['includeAll']){_0x1b9e08[_0x6182('0x3d')]=[{'all':!![]}];}_0x1b9e08=_[_0x6182('0x3a')]({},_0x1b9e08,_0x235ff6['options']);return db['ChatTransferReport'][_0x6182('0x41')](_0x1b9e08)[_0x6182('0x22')](handleEntityNotFound(_0x5f5ba1,null))[_0x6182('0x22')](respondWithResult(_0x5f5ba1,null))[_0x6182('0x42')](handleError(_0x5f5ba1,null));};exports['create']=function(_0x15315b,_0x5b8ab6){return db[_0x6182('0x28')][_0x6182('0x43')](_0x15315b[_0x6182('0x44')],{})[_0x6182('0x22')](respondWithResult(_0x5b8ab6,0xc9))[_0x6182('0x42')](handleError(_0x5b8ab6,null));};exports[_0x6182('0x21')]=function(_0x12e5c9,_0x49c251){if(_0x12e5c9['body']['id']){delete _0x12e5c9[_0x6182('0x44')]['id'];}return db['ChatTransferReport'][_0x6182('0x41')]({'where':{'id':_0x12e5c9[_0x6182('0x45')]['id']}})[_0x6182('0x22')](handleEntityNotFound(_0x49c251,null))[_0x6182('0x22')](saveUpdates(_0x12e5c9['body'],null))[_0x6182('0x22')](respondWithResult(_0x49c251,null))[_0x6182('0x42')](handleError(_0x49c251,null));};exports['destroy']=function(_0x298228,_0x18eaf4){return db['ChatTransferReport']['find']({'where':{'id':_0x298228[_0x6182('0x45')]['id']}})['then'](handleEntityNotFound(_0x18eaf4,null))[_0x6182('0x22')](removeEntity(_0x18eaf4,null))[_0x6182('0x42')](handleError(_0x18eaf4,null));};exports['describe']=function(_0x218246,_0x2ef36e){return db[_0x6182('0x28')][_0x6182('0x46')]()[_0x6182('0x22')](respondWithResult(_0x2ef36e,null))[_0x6182('0x42')](handleError(_0x2ef36e,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index a5b150e..401b278 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 _0x2124=['ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x136d07,_0x5327b9){var _0x221820=function(_0x20979c){while(--_0x20979c){_0x136d07['push'](_0x136d07['shift']());}};_0x221820(++_0x5327b9);}(_0x2124,0x1ed));var _0x4212=function(_0x586a84,_0x473acb){_0x586a84=_0x586a84-0x0;var _0xc936a1=_0x2124[_0x586a84];return _0xc936a1;};'use strict';var _=require('lodash');var util=require(_0x4212('0x0'));var logger=require(_0x4212('0x1'))(_0x4212('0x2'));var moment=require(_0x4212('0x3'));var BPromise=require('bluebird');var rp=require(_0x4212('0x4'));var fs=require('fs');var path=require(_0x4212('0x5'));var rimraf=require(_0x4212('0x6'));var config=require(_0x4212('0x7'));var attributes=require(_0x4212('0x8'));module[_0x4212('0x9')]=function(_0x1ac6c8,_0x1fd0a4){return _0x1ac6c8[_0x4212('0xa')](_0x4212('0xb'),attributes,{'tableName':_0x4212('0xc'),'paranoid':![],'indexes':[{'name':_0x4212('0xd'),'fields':[_0x4212('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c7d=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c7d,0x186));var _0xd8c7=function(_0x1a94a9,_0x61a77d){_0x1a94a9=_0x1a94a9-0x0;var _0x2118f2=_0x8c7d[_0x1a94a9];return _0x2118f2;};'use strict';var _=require(_0xd8c7('0x0'));var util=require(_0xd8c7('0x1'));var logger=require(_0xd8c7('0x2'))(_0xd8c7('0x3'));var moment=require(_0xd8c7('0x4'));var BPromise=require(_0xd8c7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8c7('0x6'));var rimraf=require(_0xd8c7('0x7'));var config=require(_0xd8c7('0x8'));var attributes=require(_0xd8c7('0x9'));module['exports']=function(_0x1e77c6,_0x1eeba3){return _0x1e77c6[_0xd8c7('0xa')](_0xd8c7('0xb'),attributes,{'tableName':_0xd8c7('0xc'),'paranoid':![],'indexes':[{'name':_0xd8c7('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index abd8a8e..e934727 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 _0x24db=['http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x867d54,_0x5ce02d){var _0x57daa1=function(_0x190199){while(--_0x190199){_0x867d54['push'](_0x867d54['shift']());}};_0x57daa1(++_0x5ce02d);}(_0x24db,0x195));var _0xb24d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24db[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb24d('0x0'));var util=require(_0xb24d('0x1'));var moment=require(_0xb24d('0x2'));var BPromise=require('bluebird');var rs=require(_0xb24d('0x3'));var fs=require('fs');var Redis=require(_0xb24d('0x4'));var db=require(_0xb24d('0x5'))['db'];var utils=require(_0xb24d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb24d('0x7'));var jayson=require(_0xb24d('0x8'));var client=jayson['client'][_0xb24d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf29342,_0x775165,_0x289872){return new BPromise(function(_0x10d755,_0x432428){return client[_0xb24d('0xa')](_0xf29342,_0x289872)[_0xb24d('0xb')](function(_0x36a2c5){logger[_0xb24d('0xc')](_0xb24d('0xd'),_0x775165,'request\x20sent');logger[_0xb24d('0xe')](_0xb24d('0xf'),_0x775165,_0xb24d('0x10'),JSON[_0xb24d('0x11')](_0x36a2c5));if(_0x36a2c5['error']){if(_0x36a2c5[_0xb24d('0x12')][_0xb24d('0x13')]===0x1f4){logger[_0xb24d('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x775165,_0x36a2c5['error'][_0xb24d('0x14')]);return _0x432428(_0x36a2c5[_0xb24d('0x12')][_0xb24d('0x14')]);}logger[_0xb24d('0x12')](_0xb24d('0xd'),_0x775165,_0x36a2c5[_0xb24d('0x12')][_0xb24d('0x14')]);return _0x10d755(_0x36a2c5[_0xb24d('0x12')][_0xb24d('0x14')]);}else{logger[_0xb24d('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x775165,_0xb24d('0x10'));_0x10d755(_0x36a2c5[_0xb24d('0x15')][_0xb24d('0x14')]);}})[_0xb24d('0x16')](function(_0x31b192){logger[_0xb24d('0x12')](_0xb24d('0xd'),_0x775165,_0x31b192);_0x432428(_0x31b192);});});}
\ No newline at end of file
+var _0xcbd8=['request\x20sent','debug','error','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcbd8,0x1c7));var _0x8cbd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xcbd8[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x8cbd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8cbd('0x1'));var fs=require('fs');var Redis=require(_0x8cbd('0x2'));var db=require(_0x8cbd('0x3'))['db'];var utils=require(_0x8cbd('0x4'));var logger=require(_0x8cbd('0x5'))(_0x8cbd('0x6'));var config=require(_0x8cbd('0x7'));var jayson=require(_0x8cbd('0x8'));var client=jayson['client'][_0x8cbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238fa5,_0x32f493,_0x2d6267){return new BPromise(function(_0x4f1194,_0x48726a){return client[_0x8cbd('0xa')](_0x238fa5,_0x2d6267)['then'](function(_0x5864cb){logger[_0x8cbd('0xb')](_0x8cbd('0xc'),_0x32f493,_0x8cbd('0xd'));logger[_0x8cbd('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x32f493,'request\x20sent',JSON['stringify'](_0x5864cb));if(_0x5864cb['error']){if(_0x5864cb[_0x8cbd('0xf')]['code']===0x1f4){logger['error'](_0x8cbd('0xc'),_0x32f493,_0x5864cb['error']['message']);return _0x48726a(_0x5864cb[_0x8cbd('0xf')][_0x8cbd('0x10')]);}logger['error'](_0x8cbd('0xc'),_0x32f493,_0x5864cb[_0x8cbd('0xf')][_0x8cbd('0x10')]);return _0x4f1194(_0x5864cb[_0x8cbd('0xf')][_0x8cbd('0x10')]);}else{logger[_0x8cbd('0xb')](_0x8cbd('0xc'),_0x32f493,_0x8cbd('0xd'));_0x4f1194(_0x5864cb['result']['message']);}})[_0x8cbd('0x11')](function(_0x4eef43){logger[_0x8cbd('0xf')](_0x8cbd('0xc'),_0x32f493,_0x4eef43);_0x48726a(_0x4eef43);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index fcb4740..bb8c8d0 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 _0xd224=['/describe','isAuthenticated','show','create','put','/:id','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','index'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xd224,0x68));var _0x4d22=function(_0x6c849e,_0xa46b3e){_0x6c849e=_0x6c849e-0x0;var _0x350b9e=_0xd224[_0x6c849e];return _0x350b9e;};'use strict';var multer=require(_0x4d22('0x0'));var util=require(_0x4d22('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d22('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4d22('0x3'));var interaction=require(_0x4d22('0x4'));var config=require('../../config/environment');var controller=require(_0x4d22('0x5'));router[_0x4d22('0x6')]('/',auth['isAuthenticated'](),controller[_0x4d22('0x7')]);router[_0x4d22('0x6')](_0x4d22('0x8'),auth[_0x4d22('0x9')](),controller['describe']);router[_0x4d22('0x6')]('/:id',auth[_0x4d22('0x9')](),controller[_0x4d22('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4d22('0xb')]);router[_0x4d22('0xc')](_0x4d22('0xd'),auth[_0x4d22('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4d22('0xe')]);module[_0x4d22('0xf')]=router;
\ No newline at end of file
+var _0xf583=['express','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','isAuthenticated','show','put','/:id','update','exports','multer','util'];(function(_0x325dee,_0xb67e1f){var _0xc05924=function(_0x41ef66){while(--_0x41ef66){_0x325dee['push'](_0x325dee['shift']());}};_0xc05924(++_0xb67e1f);}(_0xf583,0x12a));var _0x3f58=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xf583[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x3f58('0x0'));var util=require(_0x3f58('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3f58('0x2'));var router=express['Router']();var fs_extra=require(_0x3f58('0x3'));var auth=require(_0x3f58('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3f58('0x5'));var controller=require(_0x3f58('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3f58('0x7')]);router[_0x3f58('0x8')]('/describe',auth[_0x3f58('0x9')](),controller['describe']);router['get']('/:id',auth[_0x3f58('0x9')](),controller[_0x3f58('0xa')]);router['post']('/',auth[_0x3f58('0x9')](),controller['create']);router[_0x3f58('0xb')](_0x3f58('0xc'),auth['isAuthenticated'](),controller[_0x3f58('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3f58('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 78b2902..9c51e61 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 _0x7d2a=['rounded','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','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','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x7d2a,0x1d5));var _0xa7d2=function(_0x508b30,_0x3c7062){_0x508b30=_0x508b30-0x0;var _0x636427=_0x7d2a[_0x508b30];return _0x636427;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa7d2('0x0'));module[_0xa7d2('0x1')]={'name':{'type':Sequelize[_0xa7d2('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xa7d2('0x2')],'allowNull':![],'unique':_0xa7d2('0x3')},'description':{'type':Sequelize[_0xa7d2('0x2')]},'mapKey':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x4')},'key':{'type':Sequelize[_0xa7d2('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa7d2('0x5')},'customerAlias':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa7d2('0x2')],'allowNull':![],'defaultValue':_0xa7d2('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa7d2('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa7d2('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa7d2('0x2')],'allowNull':![],'defaultValue':_0xa7d2('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa7d2('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa7d2('0x2')]},'animation':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa7d2('0xa')]('rounded','squared'),'defaultValue':_0xa7d2('0xb')},'header_online':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0xc')},'header_offline':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0xd')},'download_transcript':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa7d2('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa7d2('0xf')]},'closingQuestion':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa7d2('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa7d2('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x14')},'conditionAgreement':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0xa7d2('0x16'),_0xa7d2('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa7d2('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa7d2('0x18'),'variable':null,'config':{'placeholder':_0xa7d2('0x19'),'type':_0xa7d2('0x1a'),'required':!![]},'props':{'title':_0xa7d2('0x19'),'helpText':''}},{'type':_0xa7d2('0x18'),'props':{'title':_0xa7d2('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa7d2('0x4'),'type':_0xa7d2('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa7d2('0x1b')](_0xa7d2('0x1c'))?JSON[_0xa7d2('0x1d')](this['getDataValue'](_0xa7d2('0x1c'))):{};},'set':function(_0x2c15b9){return this[_0xa7d2('0x1e')](_0xa7d2('0x1c'),JSON[_0xa7d2('0x1f')](_0x2c15b9));}},'offlineForm':{'type':Sequelize[_0xa7d2('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa7d2('0x18'),'props':{'title':_0xa7d2('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa7d2('0x4')},'variable':null},{'type':_0xa7d2('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0xa7d2('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xa7d2('0x22'))?JSON[_0xa7d2('0x1d')](this['getDataValue'](_0xa7d2('0x22'))):{};},'set':function(_0x48b587){return this[_0xa7d2('0x1e')](_0xa7d2('0x22'),JSON['stringify'](_0x48b587));}},'token':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':function(){return rs[_0xa7d2('0x23')]();}},'autoclose':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa7d2('0x2')]},'waitingTitle':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x24')},'waitingMessage':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x26')},'offlineMessageBody':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x27')},'skipUnmanaged':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xa7d2('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa7d2('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa7d2('0x28');}},'notificationSound':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa7d2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa7d2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':_0xa7d2('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xa7d2('0x2a')},'defaultTitle':{'type':Sequelize[_0xa7d2('0x2')]},'customerAvatar':{'type':Sequelize[_0xa7d2('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa7d2('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa7d2('0x2')],'allowNull':![],'defaultValue':_0xa7d2('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa7d2('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xa7d2('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa7d2('0x8')],'comment':_0xa7d2('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4b6b40){if(!_0x4b6b40)this[_0xa7d2('0x1e')](_0xa7d2('0x2d'),null);this[_0xa7d2('0x1e')](_0xa7d2('0x2e'),_0x4b6b40);}},'vidaooEscalation':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa7d2('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa7d2('0x2')],'allowNull':![],'defaultValue':_0xa7d2('0x2f')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa7d2('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa7d2('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa7d2('0xf')]}};
\ No newline at end of file
+var _0xab74=['Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','INTEGER','stringify','input','text','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!'];(function(_0x48ed9a,_0x3ebf20){var _0x69bc41=function(_0x2b7208){while(--_0x2b7208){_0x48ed9a['push'](_0x48ed9a['shift']());}};_0x69bc41(++_0x3ebf20);}(_0xab74,0x85));var _0x4ab7=function(_0x3bebeb,_0x3d9919){_0x3bebeb=_0x3bebeb-0x0;var _0x3e81c4=_0xab74[_0x3bebeb];return _0x3e81c4;};'use strict';var Sequelize=require(_0x4ab7('0x0'));var rs=require(_0x4ab7('0x1'));module['exports']={'name':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'unique':_0x4ab7('0x3')},'description':{'type':Sequelize[_0x4ab7('0x2')]},'mapKey':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x4')},'mapKeyOffline':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x4')},'key':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':_0x4ab7('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':_0x4ab7('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4ab7('0x2')]},'animation':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4ab7('0x7')](_0x4ab7('0x8'),_0x4ab7('0x9')),'defaultValue':_0x4ab7('0x8')},'header_online':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xa')},'start_chat_button':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xb')},'offline_chat_button':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xc')},'header_offline':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4ab7('0xf')]},'closingQuestion':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x10')},'placeholderMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x11')},'closingMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x12')},'closingMessageButton':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xc')},'skipMessageButton':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4ab7('0x13')},'ratingType':{'type':Sequelize[_0x4ab7('0x7')]('star','thumb'),'defaultValue':_0x4ab7('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x4ab7('0x15')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4ab7('0xf')],'defaultValue':function(){return JSON[_0x4ab7('0x16')]({'items':[{'type':_0x4ab7('0x17'),'variable':null,'config':{'placeholder':'name','type':_0x4ab7('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x4ab7('0x17'),'props':{'title':_0x4ab7('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x4ab7('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4ab7('0x19')](_0x4ab7('0x1a'))?JSON['parse'](this['getDataValue'](_0x4ab7('0x1a'))):{};},'set':function(_0xb71604){return this['setDataValue'](_0x4ab7('0x1a'),JSON[_0x4ab7('0x16')](_0xb71604));}},'offlineForm':{'type':Sequelize[_0x4ab7('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x4ab7('0x17'),'props':{'title':_0x4ab7('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4ab7('0x4'),'type':'email'},'variable':null},{'type':_0x4ab7('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':_0x4ab7('0x1c'),'helpText':_0x4ab7('0x1d')}}],'fromKey':0x0});},'get':function(){return this[_0x4ab7('0x19')](_0x4ab7('0x1e'))?JSON[_0x4ab7('0x1f')](this['getDataValue'](_0x4ab7('0x1e'))):{};},'set':function(_0x3c6570){return this[_0x4ab7('0x20')](_0x4ab7('0x1e'),JSON[_0x4ab7('0x16')](_0x3c6570));}},'token':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':function(){return rs[_0x4ab7('0x21')]();}},'autoclose':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4ab7('0x2')]},'forwardOffline':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4ab7('0x2')]},'waitingTitle':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x22')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x23')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x24')},'sendUnmanaged':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4ab7('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4ab7('0xf')],'defaultValue':function(){return _0x4ab7('0x25');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x4ab7('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4ab7('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x4ab7('0x15')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x27')},'messagesAlignment':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x28')},'defaultTitle':{'type':Sequelize[_0x4ab7('0x2')]},'customerAvatar':{'type':Sequelize[_0x4ab7('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4ab7('0x15')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4ab7('0x2')],'allowNull':![],'defaultValue':_0x4ab7('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4ab7('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4ab7('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4ab7('0x2')],'defaultValue':_0x4ab7('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4ab7('0x15')],'comment':_0x4ab7('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![],'comment':_0x4ab7('0x2c'),'set':function(_0x533e52){if(!_0x533e52)this['setDataValue'](_0x4ab7('0x2d'),null);this[_0x4ab7('0x20')](_0x4ab7('0x2e'),_0x533e52);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x4ab7('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x4ab7('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4ab7('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 0e060e8..c9e24fc 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 _0x81bd=['autoclose','close','*,*,*,*','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','ValidationError','no\x20available\x20attributes','difference','CompanyId','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','List','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','Smtp','mimetype','subjectOffline','mapValues','offlineMessageSubject','Chat','MailAccountId','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','virtual','custom','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','headers','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','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','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','destroy','UserProfileResource','name','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','params','Pause','options','find','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findAll','rows','removeDispositions','ids','ChatWebsiteId','CannedAnswer','getAnswers','findOne','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','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','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','createdAt','includes','updatedAt','ListId','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','priority','asc','list','contact','threadId','closed','externalUrl','ContactId','interaction','ChatInteraction','Writing\x20on\x20closed\x20interaction','messageId','created'];(function(_0x4a7486,_0x52ad56){var _0xf7db41=function(_0x40a0bd){while(--_0x40a0bd){_0x4a7486['push'](_0x4a7486['shift']());}};_0xf7db41(++_0x52ad56);}(_0x81bd,0x7c));var _0xd81b=function(_0x49258d,_0x5bcf0e){_0x49258d=_0x49258d-0x0;var _0x2a9044=_0x81bd[_0x49258d];return _0x2a9044;};'use strict';var Mustache=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var ejs=require(_0xd81b('0x3'));var fs=require('fs');var fs_extra=require(_0xd81b('0x4'));var _=require(_0xd81b('0x5'));var querystring=require(_0xd81b('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0xd81b('0x7'));var jayson=require(_0xd81b('0x8'));var qs=require(_0xd81b('0x9'));var logger=require('../../config/logger')(_0xd81b('0xa'));var config=require(_0xd81b('0xb'));var APIBadRequestError=require(_0xd81b('0xc'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xd81b('0xd')];var APIOutOfIntervalError=require('../../errors/api')[_0xd81b('0xe')];var APIHandleError=require(_0xd81b('0xc'))[_0xd81b('0xf')];var APIConflictError=require(_0xd81b('0xc'))[_0xd81b('0x10')];var wildcardUtils=require(_0xd81b('0x11'));var URL=require(_0xd81b('0x12'))[_0xd81b('0x13')];var db=require(_0xd81b('0x14'))['db'];config[_0xd81b('0x15')]=_[_0xd81b('0x16')](config[_0xd81b('0x15')],{'host':_0xd81b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0x15')]));require('./chatWebsite.socket')[_0xd81b('0x18')](socket);var client=jayson[_0xd81b('0x19')]['http']({'port':0x232c});var client9002=jayson[_0xd81b('0x19')]['http']({'port':0x232a});var client9003=jayson[_0xd81b('0x19')][_0xd81b('0x1a')]({'port':0x232b});var client9001=jayson[_0xd81b('0x19')][_0xd81b('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x128162,_0x552215,_0x1c620d,_0x27b7a0){return new Promise(function(_0x5c2863,_0x2abef4){var _0x26df61=_0x27b7a0||client;return _0x26df61[_0xd81b('0x1b')](_0x128162,_0x1c620d)[_0xd81b('0x1c')](function(_0x5f7db6){logger[_0xd81b('0x1d')](_0xd81b('0x1e'),_0x552215,_0xd81b('0x1f'));logger[_0xd81b('0x20')](_0xd81b('0x21'),_0x552215,_0xd81b('0x1f'),JSON[_0xd81b('0x22')](_0x5f7db6));if(_0x5f7db6[_0xd81b('0x23')]){if(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x24')]===0x1f4){logger[_0xd81b('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x552215,_0x5f7db6['error'][_0xd81b('0x25')]);return _0x2abef4(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x25')]);}logger['error'](_0xd81b('0x1e'),_0x552215,_0x5f7db6[_0xd81b('0x23')]['message']);return _0x5c2863(_0x5f7db6[_0xd81b('0x23')][_0xd81b('0x25')]);}else{logger[_0xd81b('0x1d')](_0xd81b('0x1e'),_0x552215,_0xd81b('0x1f'));_0x5c2863(_0x5f7db6[_0xd81b('0x26')][_0xd81b('0x25')]);}})[_0xd81b('0x27')](function(_0x341aec){logger[_0xd81b('0x23')](_0xd81b('0x1e'),_0x552215,_0x341aec);_0x2abef4(_0x341aec);});});}function respondWithStatusCode(_0x1bf351,_0x596389){_0x596389=_0x596389||0xcc;return function(_0x28768f){if(_0x28768f){return _0x1bf351[_0xd81b('0x28')](_0x596389);}return _0x1bf351[_0xd81b('0x29')](_0x596389)[_0xd81b('0x2a')]();};}function respondWithResult(_0x3266c2,_0x2d0d02){_0x2d0d02=_0x2d0d02||0xc8;return function(_0x3e28dd){if(_0x3e28dd){return _0x3266c2[_0xd81b('0x29')](_0x2d0d02)[_0xd81b('0x2b')](_0x3e28dd);}};}function respondWithFilteredResult(_0x483a3d,_0x469cc4){return function(_0x4e2eff){if(_0x4e2eff){var _0x5c8aee=typeof _0x469cc4[_0xd81b('0x2c')]===_0xd81b('0x2d')&&typeof _0x469cc4['limit']==='undefined';var _0x4093c8=_0x4e2eff[_0xd81b('0x2e')];var _0x1b1434=_0x5c8aee?0x0:_0x469cc4[_0xd81b('0x2c')];var _0x1a1572=_0x5c8aee?_0x4e2eff[_0xd81b('0x2e')]:_0x469cc4['offset']+_0x469cc4[_0xd81b('0x2f')];var _0x26f629;if(_0x1a1572>=_0x4093c8){_0x1a1572=_0x4093c8;_0x26f629=0xc8;}else{_0x26f629=0xce;}_0x483a3d['status'](_0x26f629);return _0x483a3d['set'](_0xd81b('0x30'),_0x1b1434+'-'+_0x1a1572+'/'+_0x4093c8)[_0xd81b('0x2b')](_0x4e2eff);}return null;};}function saveUpdates(_0x50472a){return function(_0x50ce25){if(_0x50ce25){return _0x50ce25['update'](_0x50472a)[_0xd81b('0x1c')](function(_0x3ead68){return _0x3ead68;});}return null;};}function removeEntity(_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x31')]()[_0xd81b('0x1c')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='ChatWebsites';return db[_0xd81b('0x32')][_0xd81b('0x31')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1c')](function(){return _0x1c4cf7;});})[_0xd81b('0x1c')](function(){_0x1d2f46[_0xd81b('0x29')](0xcc)[_0xd81b('0x2a')]();});}};}function handleEntityNotFound(_0x1c20d3){return function(_0x2d23b9){if(!_0x2d23b9){_0x1c20d3[_0xd81b('0x28')](0x194);}return _0x2d23b9;};}function handleError(_0xe88a33,_0x1be4e2){_0x1be4e2=_0x1be4e2||0x1f4;return function(_0x3c8371){logger[_0xd81b('0x23')](_0x3c8371['stack']);if(_0x3c8371['name']){delete _0x3c8371[_0xd81b('0x33')];}_0xe88a33[_0xd81b('0x29')](_0x1be4e2)[_0xd81b('0x34')](_0x3c8371);};}function createInteractionObject(_0x59c066,_0x362ebc,_0x37ba34,_0x5a236a){var _0x46f058=require(_0xd81b('0x35'));var _0x512e39=new _0x46f058();var _0xed5272=_0x512e39['setUA'](_0x37ba34[_0xd81b('0x36')])[_0xd81b('0x37')]();var _0x203365=_0x362ebc[_0xd81b('0x38')];if(_0x37ba34['cf-connecting-ip']){_0x203365=_0x37ba34[_0xd81b('0x39')];}else if(_0x37ba34[_0xd81b('0x3a')]){_0x203365=_[_0xd81b('0x3b')](_0x37ba34[_0xd81b('0x3a')][_0xd81b('0x3c')](','));}return{'ContactId':_0x5a236a['id'],'ChatWebsiteId':_0x59c066,'from':(_0x5a236a[_0xd81b('0x3d')]||'')+'\x20'+(_0x5a236a[_0xd81b('0x3e')]||''),'customerIp':_0x203365,'customerPort':_0x37ba34['x-real-port']?_0x37ba34[_0xd81b('0x3f')]:null,'referer':_0x362ebc[_0xd81b('0x40')],'browserName':_0xed5272[_0xd81b('0x41')]['name']&&_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]?util[_0xd81b('0x43')](_0xd81b('0x44'),_0xed5272[_0xd81b('0x41')]['name'],_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]):_0xd81b('0x45'),'browserVersion':_0xed5272[_0xd81b('0x41')][_0xd81b('0x42')]||_0xd81b('0x45'),'osName':util[_0xd81b('0x43')](_0xd81b('0x44'),_0xed5272['os'][_0xd81b('0x33')],_0xed5272['os'][_0xd81b('0x42')]),'osVersion':_0xed5272['os'][_0xd81b('0x42')],'deviceModel':_0xed5272['device'][_0xd81b('0x46')]&&_0xed5272[_0xd81b('0x47')][_0xd81b('0x48')]?util[_0xd81b('0x43')](_0xd81b('0x49'),_0xed5272[_0xd81b('0x47')][_0xd81b('0x46')],_0xed5272[_0xd81b('0x47')]['vendor'],_0xed5272['device'][_0xd81b('0x4a')]):null,'deviceVendor':_0xed5272[_0xd81b('0x47')][_0xd81b('0x48')],'deviceType':_0xed5272[_0xd81b('0x47')][_0xd81b('0x4a')],'formData':JSON[_0xd81b('0x22')](_0x362ebc)};}exports[_0xd81b('0x4b')]=function(_0x2e44f3,_0x2fa588){var _0xcfbbc2={'include':[{'model':db['Pause'],'as':_0xd81b('0x4c')}]},_0x41e2e6={},_0x38e436={'count':0x0,'rows':[]};var _0x2b61fc=_[_0xd81b('0x4d')](db[_0xd81b('0x4e')][_0xd81b('0x4f')],function(_0x410ef3){return{'name':_0x410ef3[_0xd81b('0x50')],'type':_0x410ef3[_0xd81b('0x4a')][_0xd81b('0x51')]};});_0x41e2e6['model']=_[_0xd81b('0x4d')](_0x2b61fc,_0xd81b('0x33'));_0x41e2e6[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x2e44f3['query']);_0x41e2e6[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x41e2e6[_0xd81b('0x46')],_0x41e2e6[_0xd81b('0x52')]);_0xcfbbc2[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x41e2e6[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x2e44f3[_0xd81b('0x52')]['fields']));_0xcfbbc2['attributes']=_0xcfbbc2[_0xd81b('0x56')][_0xd81b('0x58')]?_0xcfbbc2[_0xd81b('0x56')]:_0x41e2e6[_0xd81b('0x46')];if(!_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0xcfbbc2[_0xd81b('0x2f')]=qs['limit'](_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x2f')]);_0xcfbbc2[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x2e44f3[_0xd81b('0x52')]['offset']);}_0xcfbbc2[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x2e44f3['query'][_0xd81b('0x5c')]);_0xcfbbc2[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x2e44f3[_0xd81b('0x52')],_0x41e2e6[_0xd81b('0x54')]),_0x2b61fc);if(_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x5f')]){_0xcfbbc2[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0xcfbbc2[_0xd81b('0x5d')],{'$or':_['map'](_0x2b61fc,function(_0x285e82){if(_0x285e82['type']!==_0xd81b('0x61')){var _0x7b438c={};_0x7b438c[_0x285e82[_0xd81b('0x33')]]={'$like':'%'+_0x2e44f3[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x7b438c;}})});}_0xcfbbc2=_[_0xd81b('0x60')]({},_0xcfbbc2,_0x2e44f3['options']);var _0x2d978d={'where':_0xcfbbc2[_0xd81b('0x5d')]};return db['ChatWebsite']['count'](_0x2d978d)[_0xd81b('0x1c')](function(_0x59e018){_0x38e436[_0xd81b('0x2e')]=_0x59e018;if(_0x2e44f3['query'][_0xd81b('0x62')]){_0xcfbbc2[_0xd81b('0x63')]=[{'all':!![]}];}return db[_0xd81b('0x4e')]['findAll'](_0xcfbbc2);})[_0xd81b('0x1c')](function(_0x10ed99){_0x38e436['rows']=_0x10ed99;return _0x38e436;})[_0xd81b('0x1c')](respondWithFilteredResult(_0x2fa588,_0xcfbbc2))[_0xd81b('0x27')](handleError(_0x2fa588,null));};exports['show']=function(_0x1ba5d6,_0x5e1cd7){var _0x3c9264={'raw':![],'where':{'id':_0x1ba5d6[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x65')],'as':_0xd81b('0x4c')}]},_0x31553e={};_0x31553e[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0x4e')][_0xd81b('0x4f')]);_0x31553e[_0xd81b('0x52')]=_['keys'](_0x1ba5d6[_0xd81b('0x52')]);_0x31553e[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x31553e[_0xd81b('0x46')],_0x31553e[_0xd81b('0x52')]);_0x3c9264[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x31553e['model'],qs['fields'](_0x1ba5d6['query'][_0xd81b('0x57')]));_0x3c9264[_0xd81b('0x56')]=_0x3c9264[_0xd81b('0x56')][_0xd81b('0x58')]?_0x3c9264[_0xd81b('0x56')]:_0x31553e[_0xd81b('0x46')];if(_0x1ba5d6[_0xd81b('0x52')]['includeAll']){_0x3c9264[_0xd81b('0x63')]=[{'all':!![]}];}_0x3c9264=_[_0xd81b('0x60')]({},_0x3c9264,_0x1ba5d6[_0xd81b('0x66')]);return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x3c9264)[_0xd81b('0x1c')](handleEntityNotFound(_0x5e1cd7,null))[_0xd81b('0x1c')](respondWithResult(_0x5e1cd7,null))['catch'](handleError(_0x5e1cd7,null));};exports[_0xd81b('0x68')]=function(_0x15f003,_0x12b2a7){var _0x8cf25d=null;_0x15f003[_0xd81b('0x69')][_0xd81b('0x6a')][_0xd81b('0x3c')](',')[_0xd81b('0x6b')](_0x8fa8cd=>{if(_0x8fa8cd[_0xd81b('0x6c')]()!==''&&!wildcardUtils[_0xd81b('0x6d')](_0x8fa8cd[_0xd81b('0x6c')]())){_0x8cf25d=new APIBadRequestError('\x22'+_0x8fa8cd['trim']()+_0xd81b('0x6e'));}});if(_0x8cf25d){return handleError(_0x12b2a7,null)(_0x8cf25d);}return db['ChatWebsite'][_0xd81b('0x68')](_0x15f003[_0xd81b('0x69')],{})[_0xd81b('0x1c')](function(_0xc3c117){var _0xb94a69=_0x15f003[_0xd81b('0x6f')][_0xd81b('0x70')]({'plain':!![]});if(!_0xb94a69)throw new Error(_0xd81b('0x71'));if(_0xb94a69[_0xd81b('0x72')]===_0xd81b('0x6f')){var _0x5bcfd7=_0xc3c117[_0xd81b('0x70')]({'plain':!![]});var _0x344c32=_0xd81b('0x73');return db[_0xd81b('0x74')][_0xd81b('0x67')]({'where':{'name':_0x344c32,'userProfileId':_0xb94a69['userProfileId']},'raw':!![]})['then'](function(_0x3274d2){if(_0x3274d2&&_0x3274d2[_0xd81b('0x75')]===0x0){return db[_0xd81b('0x32')][_0xd81b('0x68')]({'name':_0x5bcfd7[_0xd81b('0x33')],'resourceId':_0x5bcfd7['id'],'type':_0x3274d2[_0xd81b('0x33')],'sectionId':_0x3274d2['id']},{})[_0xd81b('0x1c')](function(){return _0xc3c117;});}else{return _0xc3c117;}})['catch'](function(_0x2190df){logger[_0xd81b('0x23')](_0xd81b('0x76'),_0x2190df);throw _0x2190df;});}return _0xc3c117;})[_0xd81b('0x1c')](respondWithResult(_0x12b2a7,0xc9))[_0xd81b('0x27')](handleError(_0x12b2a7,null));};exports[_0xd81b('0x77')]=function(_0x1e0da3,_0x185f28){var _0x2315db=null;_0x1e0da3['body'][_0xd81b('0x6a')][_0xd81b('0x3c')](',')[_0xd81b('0x6b')](_0x9c30e7=>{if(_0x9c30e7[_0xd81b('0x6c')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x9c30e7[_0xd81b('0x6c')]())){_0x2315db=new APIBadRequestError('\x22'+_0x9c30e7[_0xd81b('0x6c')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x2315db){return handleError(_0x185f28,null)(_0x2315db);}if(_0x1e0da3[_0xd81b('0x69')]['id']){delete _0x1e0da3[_0xd81b('0x69')]['id'];}return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x1e0da3[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x65')],'as':'mandatoryDispositionPause'}]})[_0xd81b('0x1c')](handleEntityNotFound(_0x185f28,null))[_0xd81b('0x1c')](saveUpdates(_0x1e0da3[_0xd81b('0x69')],null))['then'](respondWithResult(_0x185f28,null))['catch'](handleError(_0x185f28,null));};exports[_0xd81b('0x31')]=function(_0x950cc3,_0x36c694){return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x950cc3[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x36c694,null))[_0xd81b('0x1c')](removeEntity(_0x36c694,null))['catch'](handleError(_0x36c694,null));};exports['describe']=function(_0x42ae01,_0x256696){return db[_0xd81b('0x4e')][_0xd81b('0x78')]()['then'](respondWithResult(_0x256696,null))[_0xd81b('0x27')](handleError(_0x256696,null));};exports[_0xd81b('0x79')]=function(_0x4b8294,_0x46e36b){if(_0x4b8294['body']['id']){delete _0x4b8294[_0xd81b('0x69')]['id'];}return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x4b8294[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x46e36b,null))[_0xd81b('0x1c')](function(_0x2490f1){if(_0x2490f1){_0x4b8294[_0xd81b('0x69')]['ChatWebsiteId']=_0x2490f1['id'];return db[_0xd81b('0x7a')][_0xd81b('0x68')](_0x4b8294[_0xd81b('0x69')]);}})[_0xd81b('0x1c')](respondWithResult(_0x46e36b,null))[_0xd81b('0x27')](handleError(_0x46e36b,null));};exports[_0xd81b('0x7b')]=function(_0x579052,_0x5c8ea0){var _0x31509d={'raw':![],'where':{}};var _0x3023d9={};var _0x97bd3e={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')]['findOne']({'where':{'id':_0x579052[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x5c8ea0,null))[_0xd81b('0x1c')](function(_0x195f1c){if(_0x195f1c){_0x3023d9[_0xd81b('0x46')]=_['keys'](db[_0xd81b('0x7a')][_0xd81b('0x4f')]);_0x3023d9[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x579052[_0xd81b('0x52')]);_0x3023d9[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x3023d9['model'],_0x3023d9[_0xd81b('0x52')]);_0x31509d[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x3023d9[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x579052[_0xd81b('0x52')]['fields']));_0x31509d[_0xd81b('0x56')]=_0x31509d['attributes'][_0xd81b('0x58')]?_0x31509d[_0xd81b('0x56')]:_0x3023d9[_0xd81b('0x46')];if(!_0x579052['query'][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x31509d[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x579052[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x31509d['offset']=qs[_0xd81b('0x2c')](_0x579052['query']['offset']);}_0x31509d[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x579052[_0xd81b('0x52')]['sort']);_0x31509d[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x579052[_0xd81b('0x52')],_0x3023d9[_0xd81b('0x54')]));_0x31509d[_0xd81b('0x5d')]['ChatWebsiteId']=_0x195f1c['id'];if(_0x579052[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x31509d[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x31509d[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x31509d[_0xd81b('0x56')],function(_0x270d82){var _0x380951={};_0x380951[_0x270d82]={'$like':'%'+_0x579052[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x380951;})});}_0x31509d=_[_0xd81b('0x60')]({},_0x31509d,_0x579052[_0xd81b('0x66')]);return db[_0xd81b('0x7a')][_0xd81b('0x2e')]({'where':_0x31509d['where']})[_0xd81b('0x1c')](function(_0x47f90e){_0x97bd3e[_0xd81b('0x2e')]=_0x47f90e;if(_0x579052[_0xd81b('0x52')][_0xd81b('0x62')]){_0x31509d[_0xd81b('0x63')]=[{'all':!![]}];}return db[_0xd81b('0x7a')][_0xd81b('0x7c')](_0x31509d);})['then'](function(_0x3a41e6){_0x97bd3e[_0xd81b('0x7d')]=_0x3a41e6;return _0x97bd3e;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x5c8ea0,_0x31509d))[_0xd81b('0x27')](handleError(_0x5c8ea0,null));};exports[_0xd81b('0x7e')]=function(_0x6e4c25,_0x2481e9){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x6e4c25[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x2481e9,null))[_0xd81b('0x1c')](function(_0x5a02f7){if(_0x5a02f7){return _0x5a02f7[_0xd81b('0x7e')](_0x6e4c25[_0xd81b('0x52')][_0xd81b('0x7f')]);}})[_0xd81b('0x1c')](respondWithStatusCode(_0x2481e9,null))[_0xd81b('0x27')](handleError(_0x2481e9,null));};exports['addAnswer']=function(_0x421c2b,_0x1e61d8){if(_0x421c2b[_0xd81b('0x69')]['id']){delete _0x421c2b[_0xd81b('0x69')]['id'];}return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x421c2b['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x1e61d8,null))['then'](function(_0x4461f3){if(_0x4461f3){_0x421c2b[_0xd81b('0x69')][_0xd81b('0x80')]=_0x4461f3['id'];return db[_0xd81b('0x81')]['create'](_0x421c2b[_0xd81b('0x69')]);}})[_0xd81b('0x1c')](respondWithResult(_0x1e61d8,null))['catch'](handleError(_0x1e61d8,null));};exports[_0xd81b('0x82')]=function(_0x142d78,_0x2c1a0e){var _0x1c6291={'raw':![],'where':{}};var _0x2f9a9f={};var _0x4c8925={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd81b('0x83')]({'where':{'id':_0x142d78['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x2c1a0e,null))['then'](function(_0x509001){if(_0x509001){_0x2f9a9f[_0xd81b('0x46')]=_[_0xd81b('0x53')](db['CannedAnswer']['rawAttributes']);_0x2f9a9f[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x142d78['query']);_0x2f9a9f[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x2f9a9f[_0xd81b('0x46')],_0x2f9a9f[_0xd81b('0x52')]);_0x1c6291['attributes']=_[_0xd81b('0x55')](_0x2f9a9f[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x142d78['query']['fields']));_0x1c6291[_0xd81b('0x56')]=_0x1c6291[_0xd81b('0x56')][_0xd81b('0x58')]?_0x1c6291[_0xd81b('0x56')]:_0x2f9a9f[_0xd81b('0x46')];if(!_0x142d78['query']['hasOwnProperty'](_0xd81b('0x5a'))){_0x1c6291[_0xd81b('0x2f')]=qs['limit'](_0x142d78['query'][_0xd81b('0x2f')]);_0x1c6291[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x142d78[_0xd81b('0x52')][_0xd81b('0x2c')]);}_0x1c6291[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x142d78[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x1c6291[_0xd81b('0x5d')]=qs['filters'](_['pick'](_0x142d78[_0xd81b('0x52')],_0x2f9a9f[_0xd81b('0x54')]));_0x1c6291[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x509001['id'];if(_0x142d78[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x1c6291[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x1c6291[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x1c6291[_0xd81b('0x56')],function(_0x32e484){var _0x30fb62={};_0x30fb62[_0x32e484]={'$like':'%'+_0x142d78[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x30fb62;})});}_0x1c6291=_['merge']({},_0x1c6291,_0x142d78[_0xd81b('0x66')]);return db[_0xd81b('0x81')][_0xd81b('0x2e')]({'where':_0x1c6291['where']})[_0xd81b('0x1c')](function(_0x3bd28c){_0x4c8925[_0xd81b('0x2e')]=_0x3bd28c;if(_0x142d78[_0xd81b('0x52')][_0xd81b('0x62')]){_0x1c6291['include']=[{'all':!![]}];}return db[_0xd81b('0x81')][_0xd81b('0x7c')](_0x1c6291);})[_0xd81b('0x1c')](function(_0x30fe56){_0x4c8925[_0xd81b('0x7d')]=_0x30fe56;return _0x4c8925;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x2c1a0e,_0x1c6291))[_0xd81b('0x27')](handleError(_0x2c1a0e,null));};exports[_0xd81b('0x84')]=function(_0x1c3ea4,_0x282e83){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x1c3ea4['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x282e83,null))[_0xd81b('0x1c')](function(_0x15d52d){if(_0x15d52d){return _0x15d52d['removeAnswers'](_0x1c3ea4[_0xd81b('0x52')][_0xd81b('0x7f')]);}})[_0xd81b('0x1c')](respondWithStatusCode(_0x282e83,null))[_0xd81b('0x27')](handleError(_0x282e83,null));};exports['addLogo']=function(_0x1e5f94,_0x4e037b){_0x1e5f94['body'][_0xd81b('0x85')]=_0x1e5f94[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x1e5f94['params']['id']}})['then'](handleEntityNotFound(_0x4e037b,null))[_0xd81b('0x1c')](saveUpdates(_0x1e5f94[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x4e037b,null))[_0xd81b('0x27')](handleError(_0x4e037b,null));};exports[_0xd81b('0x88')]=function(_0x36611b,_0x368fc6){_0x36611b[_0xd81b('0x69')][_0xd81b('0x89')]=_0x36611b[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x36611b[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x368fc6,null))[_0xd81b('0x1c')](saveUpdates(_0x36611b[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x368fc6,null))[_0xd81b('0x27')](handleError(_0x368fc6,null));};exports[_0xd81b('0x8a')]=function(_0x4c6848,_0x1162c0){_0x4c6848[_0xd81b('0x69')][_0xd81b('0x8b')]=_0x4c6848[_0xd81b('0x86')][_0xd81b('0x87')];return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x4c6848[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x1162c0,null))[_0xd81b('0x1c')](saveUpdates(_0x4c6848[_0xd81b('0x69')],null))[_0xd81b('0x1c')](respondWithResult(_0x1162c0,null))[_0xd81b('0x27')](handleError(_0x1162c0,null));};exports[_0xd81b('0x8c')]=function(_0x11b49d,_0x22e808){_0x11b49d[_0xd81b('0x69')][_0xd81b('0x8d')]=_0x11b49d[_0xd81b('0x86')][_0xd81b('0x87')];return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x11b49d[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x22e808,null))[_0xd81b('0x1c')](saveUpdates(_0x11b49d['body'],null))[_0xd81b('0x1c')](respondWithResult(_0x22e808,null))[_0xd81b('0x27')](handleError(_0x22e808,null));};exports[_0xd81b('0x8e')]=function(_0x478b92,_0xf13081){var _0x3069d1=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/logos/default_logo.svg');var _0x2a6dcb={'where':{'id':_0x478b92[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x85')],'raw':!![]};var _0xf2e1b5=![];return require(_0xd81b('0x91'))[_0xd81b('0x92')]()[_0xd81b('0x1c')](function(_0x55384e){if(_0x55384e){_0xf2e1b5=_0x55384e['custom'];}})[_0xd81b('0x1c')](function(){return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x2a6dcb);})['then'](handleEntityNotFound(_0xf13081,null))[_0xd81b('0x1c')](function(_0x5189b8){if(_0x5189b8){if(!_[_0xd81b('0x93')](_0x5189b8[_0xd81b('0x85')])){if(fs[_0xd81b('0x94')](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x95'),_0x5189b8[_0xd81b('0x85')]))&&_0xf2e1b5){_0x3069d1=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/logos/',_0x5189b8[_0xd81b('0x85')]);}}return _0xf13081[_0xd81b('0x96')](_0x3069d1);}})[_0xd81b('0x27')](handleError(_0xf13081,null));};exports['getAvatar']=function(_0x4b2b45,_0x4d44d7){var _0x3c5ea6=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x97'));var _0x175d02={'where':{'id':_0x4b2b45[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd81b('0x67')](_0x175d02)[_0xd81b('0x1c')](handleEntityNotFound(_0x4d44d7,null))[_0xd81b('0x1c')](function(_0x361d5a){if(_0x361d5a){if(!_['isNil'](_0x361d5a[_0xd81b('0x89')])){if(fs['existsSync'](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x98'),_0x361d5a['agentAvatar']))){_0x3c5ea6=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0x361d5a[_0xd81b('0x89')]);}}return _0x4d44d7['download'](_0x3c5ea6);}})[_0xd81b('0x27')](handleError(_0x4d44d7,null));};exports[_0xd81b('0x99')]=function(_0x10449f,_0x539668){var _0x277379=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x9a'));var _0x1e2612={'where':{'id':_0x10449f[_0xd81b('0x64')]['id']},'attributes':['id','customerAvatar',_0xd81b('0x9b')],'raw':!![]};return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x1e2612)['then'](handleEntityNotFound(_0x539668,null))[_0xd81b('0x1c')](function(_0xc9bdfe){if(_0xc9bdfe){if(!_[_0xd81b('0x93')](_0xc9bdfe[_0xd81b('0x8b')])){if(fs[_0xd81b('0x94')](path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0xc9bdfe['customerAvatar']))&&_0xc9bdfe['showCustomerAvatar']){_0x277379=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],'server/files/images/avatars/',_0xc9bdfe[_0xd81b('0x8b')]);}}return _0x539668['download'](_0x277379);}})['catch'](handleError(_0x539668,null));};exports[_0xd81b('0x9c')]=function(_0x397d26,_0x335713){var _0x1b18ef=path[_0xd81b('0x8f')](config[_0xd81b('0x90')],_0xd81b('0x9d'));var _0x13e25f={'where':{'id':_0x397d26[_0xd81b('0x64')]['id']},'attributes':['id',_0xd81b('0x8d')],'raw':!![]};return db[_0xd81b('0x4e')][_0xd81b('0x67')](_0x13e25f)[_0xd81b('0x1c')](handleEntityNotFound(_0x335713,null))[_0xd81b('0x1c')](function(_0x4283bd){if(_0x4283bd){if(!_['isNil'](_0x4283bd[_0xd81b('0x8d')])){if(fs[_0xd81b('0x94')](path['join'](config[_0xd81b('0x90')],'server/files/images/avatars/',_0x4283bd[_0xd81b('0x8d')]))){_0x1b18ef=path['join'](config[_0xd81b('0x90')],_0xd81b('0x98'),_0x4283bd[_0xd81b('0x8d')]);}}return _0x335713[_0xd81b('0x96')](_0x1b18ef);}})[_0xd81b('0x27')](handleError(_0x335713,null));};function checkWebsiteInterval(_0x2164d4){var _0x7e3d22=_0x2164d4[_0xd81b('0x9e')];if(!_0x7e3d22){return Promise[_0xd81b('0x9f')](_0x2164d4);}var _0x1b0156=_0x2164d4[_0xd81b('0xa0')]||undefined;return _0x7e3d22[_0xd81b('0xa1')](_0x1b0156)['then'](function(_0x8cda4b){if(!_0x8cda4b){throw new APIOutOfIntervalError();}return _0x2164d4;});}exports[_0xd81b('0xa2')]=function(_0x22dd20,_0x2ea321){var _0x305014={'body':_0x22dd20[_0xd81b('0x69')],'channel':_0xd81b('0xa3')};var _0x10382d=[];var _0x282942=[];var _0x24a88b={};var _0x48e6ba=![];if(_0x22dd20[_0xd81b('0x69')]['id']){delete _0x22dd20[_0xd81b('0x69')]['id'];}if(_['isNil'](_0x22dd20[_0xd81b('0x69')]['from'])){throw new APIBadRequestError(_0xd81b('0xa4'));}if(_[_0xd81b('0x93')](_0x22dd20['body'][_0xd81b('0xa5')])){throw new APIBadRequestError(_0xd81b('0xa6'));}if(_[_0xd81b('0xa7')](_0x22dd20[_0xd81b('0x69')]['body'])){throw new APIBadRequestError(_0xd81b('0xa8'));}var _0x3a248d=_0x22dd20[_0xd81b('0x69')][_0xd81b('0x38')]&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0x40')];return db['CmContact'][_0xd81b('0x78')]()[_0xd81b('0x1c')](function(_0x14a219){if(!_0x14a219){throw new Error('No\x20available\x20attributes');}_0x10382d=Object['keys'](_0x14a219)[_0xd81b('0x5f')](function(_0x322771){return![_0xd81b('0xa9'),'updatedAt'][_0xd81b('0xaa')](_0x322771);});_0x282942=Object[_0xd81b('0x53')](_0x14a219)[_0xd81b('0x5f')](function(_0x4719f3){return![_0xd81b('0xa9'),_0xd81b('0xab'),'CompanyId',_0xd81b('0xac')][_0xd81b('0xaa')](_0x4719f3);});if(!_['includes'](_0x282942,_0x22dd20[_0xd81b('0x69')][_0xd81b('0xa5')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x282942[_0xd81b('0x8f')](',\x20'));}_0x24a88b[_0x22dd20[_0xd81b('0x69')][_0xd81b('0xa5')]]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xad')];})[_0xd81b('0x1c')](function(){return db[_0xd81b('0x4e')]['find']({'where':{'id':_0x22dd20[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0xae')],'as':'List','include':[{'model':db[_0xd81b('0xaf')],'as':_0xd81b('0xb0'),'where':_0x24a88b,'limit':0x1,'order':[['updatedAt',_0xd81b('0xb1')]]}]},{'model':db[_0xd81b('0xb2')],'as':_0xd81b('0xb3')},{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0x9e'),'include':[{'model':db['Interval'],'as':_0xd81b('0xb4'),'attributes':['id',_0xd81b('0xb5')],'raw':!![]}]}]});})[_0xd81b('0x1c')](function(_0x9658e){if(!_0x9658e){throw new APINotFoundError(util[_0xd81b('0x43')](_0xd81b('0xb6'),_0x22dd20[_0xd81b('0x64')]['id']));}if(_0x3a248d){return checkWebsiteInterval(_0x9658e);}return _0x9658e;})[_0xd81b('0x1c')](function(_0x44d405){_0x305014[_0xd81b('0xb7')]=_0x44d405;_0x305014[_0xd81b('0xb8')]=_['orderBy'](_0x44d405['Applications'],[_0xd81b('0xb9')],[_0xd81b('0xba')]);if(_0x305014[_0xd81b('0xb7')]['Applications']){delete _0x305014[_0xd81b('0xb7')][_0xd81b('0xb3')];}_0x305014[_0xd81b('0xbb')]=_0x44d405['List']||{'id':_0x44d405[_0xd81b('0xac')]};if(_0x305014[_0xd81b('0xbb')]&&_0x305014['list'][_0xd81b('0xb0')][_0xd81b('0x58')]){return _0x305014[_0xd81b('0xbb')][_0xd81b('0xb0')][0x0];}var _0x8026d7=_[_0xd81b('0x16')](_0x22dd20[_0xd81b('0x69')],{'firstName':_0x22dd20['body'][_0xd81b('0xad')],'ListId':_0x44d405[_0xd81b('0xac')]});_0x8026d7[_0x22dd20['body'][_0xd81b('0xa5')]]=_0x22dd20['body'][_0xd81b('0xad')];return db[_0xd81b('0xaf')][_0xd81b('0x68')](_0x8026d7,{'fields':_0x10382d,'raw':!![]});})[_0xd81b('0x1c')](function(_0x3a6e15){_0x305014[_0xd81b('0xbc')]=_0x3a6e15;var _0x87b315=createInteractionObject(_0x22dd20['params']['id'],_0x22dd20[_0xd81b('0x69')],_0x22dd20['headers'],_0x3a6e15);var _0x48073b={'ChatWebsiteId':_0x22dd20[_0xd81b('0x64')]['id']};if(_0x22dd20['body'][_0xd81b('0xbd')]){_0x48073b[_0xd81b('0xbd')]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')];_0x48073b['closed']=![];return db['ChatInteraction'][_0xd81b('0x67')]({'where':_0x48073b})[_0xd81b('0x1c')](function(_0x50529b){var _0x2ec729=_0x22dd20[_0xd81b('0x69')][_0xd81b('0x38')]&&_0x22dd20['body'][_0xd81b('0x40')];if(_0x50529b){_0x48e6ba=!![];return _0x50529b;}else if(!_0x2ec729&&_0x50529b&&_0x50529b[_0xd81b('0xbe')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x87b315[_0xd81b('0xbd')]=_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')];_0x87b315[_0xd81b('0xbf')]=_0x22dd20[_0xd81b('0x69')]['externalUrl'];return db['ChatInteraction'][_0xd81b('0x68')](_0x87b315);});}_0x48073b[_0xd81b('0xc0')]=_0x3a6e15['id'];if(_0x22dd20[_0xd81b('0x69')][_0xd81b('0xc1')]&&_0x22dd20['body'][_0xd81b('0xc1')]['id']){_0x48073b['id']=_0x22dd20['body'][_0xd81b('0xc1')]['id'];return db[_0xd81b('0xc2')]['find']({'where':_0x48073b})[_0xd81b('0x1c')](function(_0x264d72){var _0x1d5dac=_0x22dd20['body'][_0xd81b('0x38')]&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0x40')];if(!_0x1d5dac&&_0x264d72&&_0x264d72['closed']){throw new APIConflictError(_0xd81b('0xc3'));}else if(_0x264d72){_0x48e6ba=!![];return _0x264d72;}else{return db[_0xd81b('0xc2')][_0xd81b('0x68')](_0x87b315);}});}return db[_0xd81b('0xc2')][_0xd81b('0x68')](_0x87b315);})['then'](function(_0x5c3dce){if(!_0x48e6ba){return _0x5c3dce;}var _0x105735={'from':(_0x305014[_0xd81b('0xbc')][_0xd81b('0x3d')]||'')+'\x20'+(_0x305014[_0xd81b('0xbc')]['lastName']||'')};if(_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')]&&_0x22dd20[_0xd81b('0x69')]['messageId']&&_0x22dd20[_0xd81b('0x69')][_0xd81b('0xbd')]!=_0x22dd20[_0xd81b('0x69')]['messageId']){_0x105735['threadId']=_0x22dd20['body'][_0xd81b('0xc4')];}return _0x5c3dce['update'](_0x105735);})[_0xd81b('0x1c')](function(_0x3d7a57){_0x305014[_0xd81b('0xc1')]=_0x3d7a57['get']({'plain':!![]});_0x305014['interaction'][_0xd81b('0xc5')]=!_0x48e6ba;if(_0x305014['interaction'][_0xd81b('0xc5')]){if(_0x305014[_0xd81b('0xb7')][_0xd81b('0xc6')]){_0x305014[_0xd81b('0xb8')]['push']({'id':0x0,'priority':_0x305014[_0xd81b('0xb8')][_0xd81b('0x58')]+0x1,'app':_0xd81b('0xc7'),'appdata':'unmanaged','interval':_0xd81b('0xc8')});}}return db['ChatMessage'][_0xd81b('0x68')]({'body':_0x22dd20[_0xd81b('0x69')]['body'],'ChatWebsiteId':_0x22dd20[_0xd81b('0x64')]['id'],'ChatInteractionId':_0x3d7a57['id'],'direction':'in','ContactId':_0x305014[_0xd81b('0xbc')]['id'],'AttachmentId':_0x22dd20[_0xd81b('0x69')]['AttachmentId']});})['then'](function(_0x1c10da){_0x305014[_0xd81b('0x25')]=_0x1c10da;if(!_0x305014[_0xd81b('0xc1')][_0xd81b('0xc9')]){return;}return db[_0xd81b('0xca')][_0xd81b('0x67')]({'attributes':['id',_0xd81b('0x33')],'where':{'id':_0x305014['interaction']['UserId']}});})[_0xd81b('0x1c')](function(_0x10f27c){if(_0x10f27c){_0x305014[_0xd81b('0xb8')][_0xd81b('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x10f27c[_0xd81b('0x33')]+','+(_0x305014[_0xd81b('0xb7')][_0xd81b('0xcc')]||0xa),'interval':_0xd81b('0xc8')});_0x305014[_0xd81b('0xcd')]=!![];}if(!_0x305014['interaction']['queueId']){return;}return db[_0xd81b('0xce')][_0xd81b('0x67')]({'attributes':['id',_0xd81b('0x33')],'where':{'id':_0x305014[_0xd81b('0xc1')][_0xd81b('0xcf')]}});})['then'](function(_0x49e5dd){if(_0x49e5dd){_0x305014[_0xd81b('0xb8')]['unshift']({'id':0x0,'priority':0x1,'app':_0xd81b('0xd0'),'appdata':_0x49e5dd[_0xd81b('0x33')]+','+(_0x305014[_0xd81b('0xb7')][_0xd81b('0xd1')]||0x12c),'interval':_0xd81b('0xc8')});}return respondWithRpcPromise(_0xd81b('0xd2'),_0xd81b('0xd3'),_0x305014);})[_0xd81b('0x1c')](function(_0x538cc2){respondWithRpcPromise(_0xd81b('0xd4'),_0xd81b('0xd4'),{'event':_0xd81b('0xa2'),'message':_0x538cc2},client9002);return _0x538cc2;})[_0xd81b('0x1c')](respondWithResult(_0x2ea321,null))[_0xd81b('0x27')](APIHandleError(_0x2ea321));};exports[_0xd81b('0xd5')]=function(_0x2f4b2b,_0x59779e){var _0x1e184c,_0x5d6b18,_0x19eef8;var _0x520762=[];var _0x36650d={};var _0x1c5923=_0x2f4b2b['files']||[];var _0x16865b=[];var _0x522616;return db[_0xd81b('0xaf')][_0xd81b('0x78')]()['then'](function(_0x98f92e){if(!_0x98f92e){throw new db['Sequelize'][(_0xd81b('0xd6'))](_0xd81b('0xd7'));}_0x520762=_[_0xd81b('0xd8')](_[_0xd81b('0x53')](_0x98f92e),[_0xd81b('0xa9'),_0xd81b('0xab'),_0xd81b('0xd9'),_0xd81b('0xac')]);if(_0x2f4b2b[_0xd81b('0x69')]['id']){delete _0x2f4b2b[_0xd81b('0x69')]['id'];}if(_[_0xd81b('0x93')](_0x2f4b2b[_0xd81b('0x69')]['from'])){throw _0x59779e[_0xd81b('0x29')](0x1f4)['send'](new db[(_0xd81b('0xda'))][(_0xd81b('0xd6'))](_0xd81b('0xdb')));}if(_[_0xd81b('0x93')](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0x69')])||_0x2f4b2b[_0xd81b('0x69')]['body']===''){throw _0x59779e[_0xd81b('0x29')](0x1f4)['send'](new db[(_0xd81b('0xda'))]['ValidationError'](_0xd81b('0xdc')));}if(_['isNil'](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0xdd')])){throw _0x59779e[_0xd81b('0x29')](0x1f4)[_0xd81b('0x34')](new db['Sequelize'][(_0xd81b('0xd6'))](_0xd81b('0xde')+_0x520762));}if(!_['includes'](_0x520762,_0x2f4b2b['body']['mapKeyOffline'])){throw _0x59779e[_0xd81b('0x29')](0x1f4)[_0xd81b('0x34')](new db[(_0xd81b('0xda'))][(_0xd81b('0xd6'))](_0xd81b('0xdf')+_0x520762));}_0x36650d[_0x2f4b2b[_0xd81b('0x69')]['mapKeyOffline']]=_0x2f4b2b['body'][_0xd81b('0xad')];})['then'](function(){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x2f4b2b[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0xae')],'as':_0xd81b('0xe0')},{'model':db[_0xd81b('0xe1')],'as':_0xd81b('0xe1')}]});})[_0xd81b('0x1c')](handleEntityNotFound(_0x59779e,null))[_0xd81b('0x1c')](function(_0x28cbe7){if(_0x28cbe7&&_0x28cbe7[_0xd81b('0xe0')]){_0x5d6b18=_0x28cbe7;var _0x30abaf=_[_0xd81b('0x16')](_0x2f4b2b[_0xd81b('0x69')],{'firstName':_0x2f4b2b['body'][_0xd81b('0xad')],'phone':_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0xad')],'ListId':_0x28cbe7[_0xd81b('0xac')]});_0x30abaf[_0x2f4b2b[_0xd81b('0x69')]['mapKeyOffline']]=_0x2f4b2b[_0xd81b('0x69')]['from'];return db['CmContact'][_0xd81b('0xe2')]({'where':_0x36650d,'defaults':_0x30abaf});}})['spread'](function(_0x126aaa){if(_0x126aaa){_0x19eef8=_0x126aaa;var _0x3e8623=fs[_0xd81b('0xe3')](path['join'](config[_0xd81b('0x90')],_0xd81b('0xe4')),_0xd81b('0xe5'));var _0x576d9d=ejs[_0xd81b('0xe6')](_0x3e8623,{'body':_[_0xd81b('0xe7')](_0x2f4b2b[_0xd81b('0x69')][_0xd81b('0x69')]),'bodyTitle':_0x5d6b18[_0xd81b('0xe8')]});return db[_0xd81b('0xe9')]['create']({'body':_0x576d9d,'plainBody':htmlToText[_0xd81b('0xea')](_0x576d9d),'ContactId':_0x126aaa['id'],'ChatWebsiteId':_0x5d6b18['id']});}})[_0xd81b('0x1c')](function(_0x3b6ed5){_0x522616=_0x3b6ed5;if(_0x1c5923[_0xd81b('0x58')]){var _0x11b997=_0x1c5923[_0xd81b('0x4d')](function(_0x3ec25d){return{'name':_0x3ec25d[_0xd81b('0xeb')],'basename':_0x3ec25d[_0xd81b('0x87')],'type':_0x3ec25d['mimetype'],'ChatOfflineMessageId':_0x3b6ed5['id']};});_0x16865b=_0x11b997[_0xd81b('0x4d')](_0x10a82f=>{var _0x255f26={'filename':_0x10a82f[_0xd81b('0x33')],'path':path['join'](config[_0xd81b('0x90')],_0xd81b('0xec'),_0xd81b('0xed'),'attachments',_0xd81b('0xee'),_0x10a82f[_0xd81b('0xef')])};return _0x255f26;});if(!_0x5d6b18[_0xd81b('0xf0')]){return db[_0xd81b('0xf1')][_0xd81b('0xf2')](function(_0x4f1d2b){return db[_0xd81b('0xf3')][_0xd81b('0xf4')](_0x11b997,{'transaction':_0x4f1d2b});});}}})[_0xd81b('0x1c')](function(){if(_0x522616){_0x1e184c=_0x522616;return db['MailAccount'][_0xd81b('0x83')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd81b('0xf5')],'as':_0xd81b('0xf5'),'raw':!![]}]}]});}})['then'](function(_0x2e4523){if(_0x2e4523&&_0x2e4523['Smtp']&&_0x5d6b18[_0xd81b('0xf6')]&&_0x5d6b18[_0xd81b('0xf7')]){var _0x3a10ac=_0x2e4523[_0xd81b('0xf8')]();return respondWithRpcPromise('SendMail',_0xd81b('0xf9'),{'account':_0x3a10ac,'message':{'from':util[_0xd81b('0x43')](_0xd81b('0xfa'),_0x2e4523[_0xd81b('0x33')],_0x2e4523[_0xd81b('0xfb')]||_0x2e4523[_0xd81b('0xfc')]['user']),'to':_0x5d6b18[_0xd81b('0xf7')],'subject':_0x5d6b18['offlineMessageSubject'],'html':_0x1e184c['body'],'attachments':_0x16865b}},client9003)[_0xd81b('0x1c')](function(){return _0x1e184c;})[_0xd81b('0x27')](function(_0xb2d684){logger['error'](_0xb2d684);});}})[_0xd81b('0x1c')](function(){if(_0x5d6b18&&_0x5d6b18[_0xd81b('0xf0')]&&_0x5d6b18['MailAccountId']){var _0x50fbfd=[];if(_0x1c5923[_0xd81b('0x58')]){_0x50fbfd=_0x1c5923[_0xd81b('0x4d')](function(_0x44e2a8){return{'name':_0x44e2a8[_0xd81b('0xeb')],'basename':_0x44e2a8[_0xd81b('0x87')],'type':_0x44e2a8[_0xd81b('0xfd')],'ChatOfflineMessageId':_0x522616['id']};});}var _0x462925;if(!_[_0xd81b('0x93')](_0x5d6b18[_0xd81b('0xfe')])){var _0x41d12a=_[_0xd81b('0x4d')](_0x2f4b2b[_0xd81b('0x69')],function(_0x2f3170){return _0x2f3170;});var _0xfc4221=_['toPairsIn'](_0x41d12a)[0x0];var _0x25939f=_[_0xd81b('0xff')](_0xfc4221,function(_0x5a7cb8){return _0x5a7cb8;});_0x462925=_0x25939f[0x1][_0x5d6b18[_0xd81b('0xfe')]];}var _0x250cd7={'from':_0x19eef8[_0xd81b('0xfb')],'firstName':_0x19eef8[_0xd81b('0x3d')],'lastName':_0x19eef8['lastName'],'mapKey':_0xd81b('0xfb'),'message':{'from':_0x19eef8[_0xd81b('0xfb')],'to':_0x5d6b18[_0xd81b('0xe1')][_0xd81b('0xfb')],'cc':'','subject':_[_0xd81b('0x93')](_0x462925)?_0x5d6b18[_0xd81b('0x100')]:_0x462925,'messageId':'','sentAt':new Date(),'attach':_0x50fbfd['length'],'attachments':_0x50fbfd,'originChannel':_0xd81b('0x101'),'ChatWebsiteId':_0x5d6b18['id'],'ChatOfflineMessageId':_0x1e184c['id'],'originTo':_0x5d6b18[_0xd81b('0xe1')][_0xd81b('0xfb')]},'body':_0x1e184c[_0xd81b('0x69')]};var _0x35320d={'account':{'id':_0x5d6b18[_0xd81b('0x102')]},'body':_0x250cd7,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xd81b('0x103'),_0x35320d,client9001)[_0xd81b('0x1c')](function(){return _0x1e184c;})[_0xd81b('0x27')](function(_0x3c329e){logger['error'](_0x3c329e);});}return;})[_0xd81b('0x1c')](function(){if(_0x1e184c){return _0x1e184c;}})[_0xd81b('0x1c')](respondWithResult(_0x59779e,null))[_0xd81b('0x27')](function(){for(var _0x468794 of _0x1c5923){var _0x1c3473=path['join'](config[_0xd81b('0x90')],'server',_0xd81b('0xed'),_0xd81b('0x104'),'offline-chat',_0x468794['filename']);fs_extra[_0xd81b('0x105')](_0x1c3473)['catch'](function(_0x5f1c6b){logger[_0xd81b('0x23')](_0xd81b('0x106'),_0x1c3473,_0x5f1c6b);});}});};exports[_0xd81b('0x107')]=function(_0x56195b,_0x584698){return db[_0xd81b('0xc2')][_0xd81b('0x67')]({'where':{'id':_0x56195b[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x584698,null))[_0xd81b('0x1c')](function(_0xae9cb8){if(_0xae9cb8){return _0xae9cb8['addInteraction'](_0x56195b['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x56195b[_0xd81b('0x69')],['ids','id'])||{});}})[_0xd81b('0x1c')](respondWithResult(_0x584698,null))[_0xd81b('0x27')](handleError(_0x584698,null));};exports['getInteractions']=function(_0x22e159,_0x3d3ee1){var _0x31e7f7={'raw':![],'where':{}};var _0x4850d8={};var _0x51c975={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0x22e159[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x3d3ee1,null))[_0xd81b('0x1c')](function(_0x525220){if(_0x525220){_0x4850d8[_0xd81b('0x46')]=_[_0xd81b('0x53')](db['ChatInteraction'][_0xd81b('0x4f')]);_0x4850d8[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0x22e159['query']);_0x4850d8[_0xd81b('0x54')]=_['intersection'](_0x4850d8[_0xd81b('0x46')],_0x4850d8['query']);_0x31e7f7[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x4850d8[_0xd81b('0x46')],qs[_0xd81b('0x57')](_0x22e159[_0xd81b('0x52')][_0xd81b('0x57')]));_0x31e7f7['attributes']=_0x31e7f7['attributes'][_0xd81b('0x58')]?_0x31e7f7[_0xd81b('0x56')]:_0x4850d8[_0xd81b('0x46')];if(!_0x22e159[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x31e7f7[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x22e159['query'][_0xd81b('0x2f')]);_0x31e7f7[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x22e159[_0xd81b('0x52')]['offset']);}_0x31e7f7[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x22e159[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x31e7f7['where']=qs[_0xd81b('0x54')](_['pick'](_0x22e159['query'],_0x4850d8[_0xd81b('0x54')]));_0x31e7f7[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x525220['id'];if(_0x22e159[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x31e7f7[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x31e7f7['where'],{'$or':_[_0xd81b('0x4d')](_0x31e7f7[_0xd81b('0x56')],function(_0x16ef58){var _0x3b4240={};_0x3b4240[_0x16ef58]={'$like':'%'+_0x22e159['query'][_0xd81b('0x5f')]+'%'};return _0x3b4240;})});}_0x31e7f7=_[_0xd81b('0x60')]({},_0x31e7f7,_0x22e159['options']);return db[_0xd81b('0xc2')]['count']({'where':_0x31e7f7[_0xd81b('0x5d')]})['then'](function(_0x54062e){_0x51c975[_0xd81b('0x2e')]=_0x54062e;if(_0x22e159[_0xd81b('0x52')][_0xd81b('0x62')]){_0x31e7f7[_0xd81b('0x63')]=[{'model':db['CmContact'],'as':_0xd81b('0x109'),'required':![]},{'model':db['User'],'as':_0xd81b('0x10a'),'attributes':[_0xd81b('0x33'),_0xd81b('0x10b'),_0xd81b('0x10c')],'required':![]},{'model':db[_0xd81b('0x10d')],'as':_0xd81b('0x10e'),'attributes':['id',_0xd81b('0x33'),_0xd81b('0x10f')],'where':_0x22e159[_0xd81b('0x52')]['tag']?{'id':_0x22e159[_0xd81b('0x52')][_0xd81b('0x110')]}:undefined,'required':_0x22e159[_0xd81b('0x52')][_0xd81b('0x110')]?!![]:![]}];}return db[_0xd81b('0xc2')][_0xd81b('0x7c')](_0x31e7f7);})[_0xd81b('0x1c')](function(_0x23139c){_0x51c975[_0xd81b('0x7d')]=_0x23139c;return _0x51c975;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x3d3ee1,_0x31e7f7))['catch'](handleError(_0x3d3ee1,null));};exports[_0xd81b('0x111')]=function(_0x432b04,_0x2ff8f6){var _0x30a57a=0x0;var _0x25f776=0x0;var _0x1313da=![];var _0x115026;var _0x202316;return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x432b04[_0xd81b('0x64')]['id']},'include':[{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0x9e'),'include':[{'model':db[_0xd81b('0x9e')],'as':_0xd81b('0xb4'),'attributes':['id',_0xd81b('0xb5')]}]}]})[_0xd81b('0x1c')](handleEntityNotFound(_0x2ff8f6,null))['then'](function(_0x16ccac){if(_0x16ccac){_0x115026=_0x16ccac;return _0x16ccac['getProactiveActions']({'raw':!![]});}})[_0xd81b('0x1c')](function(_0x1c3879){if(_0x115026){if(_0x1c3879){_0x202316=_0x1c3879;}}return require(_0xd81b('0x91'))[_0xd81b('0x92')]();})[_0xd81b('0x1c')](function(_0x4e6c6d){if(_0x4e6c6d){_0x25f776=_0x4e6c6d[_0xd81b('0x112')];_0x1313da=_0x4e6c6d[_0xd81b('0x113')];}})[_0xd81b('0x1c')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xd81b('0x1c')](function(_0x366808){_0x30a57a=_0x366808;if(_0x25f776&&_0x366808>_0x25f776){return db['License'][_0xd81b('0x83')]({'where':{'id':0x1}})[_0xd81b('0x1c')](function(_0x2ac7d3){if(_0x2ac7d3){_0x2ac7d3[_0xd81b('0x114')](_0xd81b('0x115'));}});}})[_0xd81b('0x1c')](function(){var _0x203fbe=_0x115026[_0xd81b('0x9e')];var _0xf1f6f2=_0x115026[_0xd81b('0xa0')]||undefined;return _0x203fbe?_0x203fbe[_0xd81b('0xa1')](_0xf1f6f2):!![];})[_0xd81b('0x1c')](function(_0xe0b626){var _0x5a187a=fs[_0xd81b('0xe3')](path['join'](config[_0xd81b('0x90')],_0xd81b('0x116')),_0xd81b('0xe5'));var _0x4cb573=_0xd81b('0x117');var _0x53d707=![];var _0x480fab,_0x1685e6;if(_0x432b04[_0xd81b('0x118')]['referer']){_0x480fab=new URL(_0x432b04['headers'][_0xd81b('0x40')])[_0xd81b('0x119')];}else if(_0x432b04[_0xd81b('0x118')][_0xd81b('0x119')]){_0x480fab=new URL(_0x432b04[_0xd81b('0x118')]['origin'])[_0xd81b('0x119')];}else{_0x480fab=_0xd81b('0x11a');}_0x1685e6=typeof _0x115026[_0xd81b('0x6a')][_0xd81b('0x3c')](',')['find'](function(_0x549d83){return wildcardUtils[_0xd81b('0x11b')](_0x549d83,_0x480fab);})!==_0xd81b('0x2d');var _0x39eb20={'chatVersion':_0x4cb573,'chatWebsiteAddressOrigin':_0x1685e6?_0x480fab:_0x115026[_0xd81b('0x6a')],'remote':_0x115026[_0xd81b('0x11c')],'query':querystring[_0xd81b('0x22')](_['merge'](_0x115026[_0xd81b('0x70')]({'plain':!![]}),{'customerIp':_0x432b04[_0xd81b('0x118')]['x-forwarded-for']||_0x432b04[_0xd81b('0x118')][_0xd81b('0x11d')]||_0x432b04[_0xd81b('0x11e')][_0xd81b('0x11f')]||_0x432b04['ip'],'referer':_0x432b04['headers'][_0xd81b('0x40')],'openedInteractions':_0x30a57a,'maxInteractions':_0x25f776,'virtual':_0x1313da[_0xd81b('0x112')],'online':_0xe0b626,'custom':_0x1313da,'address':_0x1685e6?_0x480fab:null}))[_0xd81b('0x120')](/'/g,'\x5c\x27')};_0x2ff8f6[_0xd81b('0x34')](ejs[_0xd81b('0xe6')](Mustache[_0xd81b('0xe6')](_0x5a187a,_0x39eb20),{'proactiveActions':_0x202316,'alignment':_0x115026[_0xd81b('0x121')],'verticalAlignment':_0x115026[_0xd81b('0x122')],'div_color':_0x115026[_0xd81b('0x10f')],'labelText':_0x115026[_0xd81b('0x123')],'text_color':_0x115026[_0xd81b('0x124')],'text_button_color':_0x115026['textButtonColor'],'button_color':_0x115026[_0xd81b('0x125')],'background_color':_0x115026[_0xd81b('0x126')],'hideWhenOffline':_0x115026[_0xd81b('0x127')],'intervalId':_0x115026[_0xd81b('0x128')],'isDevelopment':_0x53d707,'chatVersion':_0x4cb573}));})[_0xd81b('0x27')](handleError(_0x2ff8f6,null));};exports[_0xd81b('0x129')]=function(_0x2eefbd,_0x2883fe){var _0x34cf85=_0x2eefbd[_0xd81b('0x64')]['id'];var _0x4eae4a=_0x2eefbd[_0xd81b('0x69')];var _0x388752=0xc8;var _0x580b1f=null;return db[_0xd81b('0xf1')][_0xd81b('0xf2')]({'isolationLevel':db[_0xd81b('0xf1')][_0xd81b('0x12a')]['ISOLATION_LEVELS'][_0xd81b('0x12b')]},function(_0x33d580){return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0x34cf85},'transaction':_0x33d580})[_0xd81b('0x1c')](function(_0x386b39){if(_0x386b39){return db[_0xd81b('0xb2')][_0xd81b('0x31')]({'where':{'ChatWebsiteId':_0x34cf85},'transaction':_0x33d580})[_0xd81b('0x1c')](function(){var _0x3c839c=_[_0xd81b('0x4d')](_0x4eae4a,function(_0x9bbfea){_0x9bbfea[_0xd81b('0x80')]=_0x34cf85;return _0x9bbfea;});return db[_0xd81b('0xb2')][_0xd81b('0xf4')](_0x3c839c,{'transaction':_0x33d580});});}else{_0x388752=0x194;_0x580b1f=[];}});})['then'](function(){if(_0x388752!==0x194){return db[_0xd81b('0xb2')][_0xd81b('0x12c')]({'where':{'ChatWebsiteId':_0x34cf85},'order':_0xd81b('0xb9')})['then'](function(_0x5ae954){_0x580b1f=_0x5ae954;});}})[_0xd81b('0x27')](function(_0x5ab098){_0x388752=0x1f4;logger[_0xd81b('0x23')](_0x5ab098['stack']);if(_0x5ab098[_0xd81b('0x33')]){delete _0x5ab098[_0xd81b('0x33')];}_0x580b1f=_0x5ab098;})[_0xd81b('0x12d')](function(){if(_0x580b1f===null){_0x2883fe[_0xd81b('0x28')](_0x388752);}else{if(_0x388752===0x1f4){_0x2883fe['status'](_0x388752)['send'](_0x580b1f);}else{_0x2883fe[_0xd81b('0x29')](_0x388752)[_0xd81b('0x2b')](_0x580b1f);}}});};exports[_0xd81b('0x12e')]=function(_0x1e841d,_0x6121cf){var _0x15ce6c={};var _0x29e6d9={};var _0x57ef3b;var _0xf7cefc;return db['ChatWebsite']['findOne']({'where':{'id':_0x1e841d[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x6121cf,null))['then'](function(_0x28e08c){if(_0x28e08c){_0x57ef3b=_0x28e08c;_0x29e6d9[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0xb2')][_0xd81b('0x4f')]);_0x29e6d9[_0xd81b('0x52')]=_['keys'](_0x1e841d['query']);_0x29e6d9[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x29e6d9['model'],_0x29e6d9['query']);_0x15ce6c[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x29e6d9['model'],qs[_0xd81b('0x57')](_0x1e841d[_0xd81b('0x52')]['fields']));_0x15ce6c[_0xd81b('0x56')]=_0x15ce6c[_0xd81b('0x56')][_0xd81b('0x58')]?_0x15ce6c['attributes']:_0x29e6d9[_0xd81b('0x46')];_0x15ce6c[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x15ce6c['where']=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0x1e841d[_0xd81b('0x52')],_0x29e6d9[_0xd81b('0x54')]));if(_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x15ce6c[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x15ce6c[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x15ce6c['attributes'],function(_0x407136){var _0x3b5455={};_0x3b5455[_0x407136]={'$like':'%'+_0x1e841d[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x3b5455;})});}_0x15ce6c=_[_0xd81b('0x60')]({},_0x15ce6c,_0x1e841d[_0xd81b('0x66')]);return _0x57ef3b[_0xd81b('0x12e')](_0x15ce6c);}})['then'](function(_0x5b1898){if(_0x5b1898){_0xf7cefc=_0x5b1898[_0xd81b('0x58')];if(!_0x1e841d[_0xd81b('0x52')][_0xd81b('0x59')]('nolimit')){_0x15ce6c[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x15ce6c[_0xd81b('0x2c')]=qs['offset'](_0x1e841d[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x57ef3b[_0xd81b('0x12e')](_0x15ce6c);}})[_0xd81b('0x1c')](function(_0x89764a){if(_0x89764a){return _0x89764a?{'count':_0xf7cefc,'rows':_0x89764a}:null;}})[_0xd81b('0x1c')](respondWithResult(_0x6121cf,null))[_0xd81b('0x27')](handleError(_0x6121cf,null));};exports['addProactiveActions']=function(_0x5a8445,_0x47a903){return db['chatProactiveAction']['find']({'where':{'id':_0x5a8445[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x47a903,null))[_0xd81b('0x1c')](function(_0x4d4feb){if(_0x4d4feb){return _0x4d4feb[_0xd81b('0x12f')](_0x5a8445['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x5a8445[_0xd81b('0x69')],['ids','id'])||{});}})[_0xd81b('0x1c')](respondWithResult(_0x47a903,null))[_0xd81b('0x27')](handleError(_0x47a903,null));};exports[_0xd81b('0x130')]=function(_0xd09d12,_0x251bf4){var _0x3682e4={};var _0x49f9d1={};var _0x5c97b9;var _0x1e4634;return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0xd09d12[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x251bf4,null))[_0xd81b('0x1c')](function(_0x4e3323){if(_0x4e3323){_0x5c97b9=_0x4e3323;_0x49f9d1[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0x131')][_0xd81b('0x4f')]);_0x49f9d1['query']=_['keys'](_0xd09d12[_0xd81b('0x52')]);_0x49f9d1[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0x49f9d1[_0xd81b('0x46')],_0x49f9d1[_0xd81b('0x52')]);_0x3682e4[_0xd81b('0x56')]=_[_0xd81b('0x55')](_0x49f9d1['model'],qs[_0xd81b('0x57')](_0xd09d12['query']['fields']));_0x3682e4['attributes']=_0x3682e4[_0xd81b('0x56')][_0xd81b('0x58')]?_0x3682e4[_0xd81b('0x56')]:_0x49f9d1[_0xd81b('0x46')];_0x3682e4[_0xd81b('0x5b')]=qs['sort'](_0xd09d12[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x3682e4[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_['pick'](_0xd09d12['query'],_0x49f9d1[_0xd81b('0x54')]));if(_0xd09d12[_0xd81b('0x52')]['filter']){_0x3682e4[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x3682e4[_0xd81b('0x5d')],{'$or':_[_0xd81b('0x4d')](_0x3682e4[_0xd81b('0x56')],function(_0x111dd0){var _0x37301b={};_0x37301b[_0x111dd0]={'$like':'%'+_0xd09d12['query']['filter']+'%'};return _0x37301b;})});}_0x3682e4=_[_0xd81b('0x60')]({},_0x3682e4,_0xd09d12['options']);return _0x5c97b9[_0xd81b('0x130')](_0x3682e4);}})['then'](function(_0x222acd){if(_0x222acd){_0x1e4634=_0x222acd[_0xd81b('0x58')];if(!_0xd09d12[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x3682e4[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0xd09d12[_0xd81b('0x52')]['limit']);_0x3682e4[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0xd09d12[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x5c97b9[_0xd81b('0x130')](_0x3682e4);}})['then'](function(_0x3c96d4){if(_0x3c96d4){return _0x3c96d4?{'count':_0x1e4634,'rows':_0x3c96d4}:null;}})['then'](respondWithResult(_0x251bf4,null))[_0xd81b('0x27')](handleError(_0x251bf4,null));};exports[_0xd81b('0x132')]=function(_0x4387a7,_0x24fc43){var _0x498cc0=_0x4387a7[_0xd81b('0x52')][_0xd81b('0x133')]===_0xd81b('0x134')?_0xd81b('0x135'):_0xd81b('0x136');return db[_0xd81b('0x4e')]['find']({'attributes':['id',_0x498cc0],'where':{'id':_0x4387a7[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x24fc43,null))[_0xd81b('0x1c')](function(_0x597c54){if(_0x597c54){var _0x4e792e=_0x597c54[_0x498cc0];var _0x58e782=_0x4e792e&&_0x4e792e[_0xd81b('0x137')]?_0x4e792e['items']:[];_0x24fc43[_0xd81b('0x34')]({'fromKey':_[_0xd81b('0x93')](_0x4e792e['fromKey'])?undefined:_0x4e792e[_0xd81b('0x138')],'count':_0x58e782[_0xd81b('0x58')],'rows':_0x58e782});}})[_0xd81b('0x27')](handleError(_0x24fc43,null));};exports['getOfflineMessages']=function(_0x5f10b0,_0x19ff30){var _0x398e61={'raw':![],'where':{}};var _0xcb2433={};var _0x32573b={'count':0x0,'rows':[]};return db[_0xd81b('0x4e')]['findOne']({'where':{'id':_0x5f10b0['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x19ff30,null))[_0xd81b('0x1c')](function(_0x1eea94){if(_0x1eea94){_0xcb2433[_0xd81b('0x46')]=_[_0xd81b('0x53')](db[_0xd81b('0xe9')]['rawAttributes']);_0xcb2433['query']=_[_0xd81b('0x53')](_0x5f10b0[_0xd81b('0x52')]);_0xcb2433[_0xd81b('0x54')]=_[_0xd81b('0x55')](_0xcb2433['model'],_0xcb2433[_0xd81b('0x52')]);_0x398e61['attributes']=_[_0xd81b('0x55')](_0xcb2433['model'],qs[_0xd81b('0x57')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x57')]));_0x398e61['attributes']=_0x398e61[_0xd81b('0x56')][_0xd81b('0x58')]?_0x398e61[_0xd81b('0x56')]:_0xcb2433[_0xd81b('0x46')];if(!_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x59')](_0xd81b('0x5a'))){_0x398e61[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x5f10b0['query'][_0xd81b('0x2f')]);_0x398e61[_0xd81b('0x2c')]=qs[_0xd81b('0x2c')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x2c')]);}_0x398e61[_0xd81b('0x5b')]=qs[_0xd81b('0x5c')](_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x398e61[_0xd81b('0x5d')]=qs['filters'](_[_0xd81b('0x5e')](_0x5f10b0[_0xd81b('0x52')],_0xcb2433[_0xd81b('0x54')]));_0x398e61[_0xd81b('0x5d')][_0xd81b('0x80')]=_0x1eea94['id'];if(_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x398e61[_0xd81b('0x5d')]=_[_0xd81b('0x60')](_0x398e61['where'],{'$or':_['map'](_0x398e61[_0xd81b('0x56')],function(_0x56f4c8){var _0xa5dd60={};_0xa5dd60[_0x56f4c8]={'$like':'%'+_0x5f10b0[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0xa5dd60;})});}_0x398e61=_[_0xd81b('0x60')]({},_0x398e61,_0x5f10b0[_0xd81b('0x66')]);return db[_0xd81b('0xe9')][_0xd81b('0x2e')]({'where':_0x398e61[_0xd81b('0x5d')]})['then'](function(_0x443a17){_0x32573b[_0xd81b('0x2e')]=_0x443a17;if(_0x5f10b0['query'][_0xd81b('0x62')]){_0x398e61[_0xd81b('0x63')]=[{'all':!![]}];}else{_0x398e61['include']=[{'model':db['CmContact'],'as':_0xd81b('0x109'),'required':![]},{'model':db[_0xd81b('0xf3')],'as':_0xd81b('0x139'),'required':![]}];}return db[_0xd81b('0xe9')][_0xd81b('0x7c')](_0x398e61);})[_0xd81b('0x1c')](function(_0x57da47){_0x32573b[_0xd81b('0x7d')]=_0x57da47;return _0x32573b;});}})[_0xd81b('0x1c')](respondWithFilteredResult(_0x19ff30,_0x398e61))['catch'](handleError(_0x19ff30,null));};exports[_0xd81b('0x13a')]=function(_0x207681,_0x212f03){return db[_0xd81b('0x4e')][_0xd81b('0x67')]({'where':{'id':_0x207681[_0xd81b('0x64')]['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x212f03,null))[_0xd81b('0x1c')](function(_0x3ea155){if(_0x3ea155){return _0x3ea155[_0xd81b('0x13a')](_0x207681['body'][_0xd81b('0x7f')],_[_0xd81b('0x108')](_0x207681[_0xd81b('0x69')],[_0xd81b('0x7f'),'id'])||{})[_0xd81b('0x13b')](function(_0x3b393b){for(var _0xd6d130=0x0;_0xd6d130<_0x207681['body'][_0xd81b('0x7f')][_0xd81b('0x58')];_0xd6d130+=0x1){socket[_0xd81b('0x13c')](_0xd81b('0x13d'),{'UserId':Number(_0x207681['body'][_0xd81b('0x7f')][_0xd6d130]),'ChatWebsiteId':Number(_0x207681[_0xd81b('0x64')]['id'])});}return _0x3b393b;});}})['then'](respondWithResult(_0x212f03,null))['catch'](handleError(_0x212f03,null));};exports[_0xd81b('0x13e')]=function(_0x44a9e1,_0x26d2c2){return db['ChatWebsite'][_0xd81b('0x67')]({'where':{'id':_0x44a9e1['params']['id']}})[_0xd81b('0x1c')](handleEntityNotFound(_0x26d2c2,null))[_0xd81b('0x1c')](function(_0x4c684a){if(_0x4c684a){return _0x4c684a[_0xd81b('0x13e')](_0x44a9e1['query'][_0xd81b('0x7f')])['then'](function(){if(_[_0xd81b('0x13f')](_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')])){for(var _0x56d986=0x0;_0x56d986<_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')][_0xd81b('0x58')];_0x56d986+=0x1){socket[_0xd81b('0x13c')](_0xd81b('0x140'),{'UserId':Number(_0x44a9e1[_0xd81b('0x52')][_0xd81b('0x7f')][_0x56d986]),'ChatWebsiteId':Number(_0x44a9e1['params']['id'])});}}else{socket[_0xd81b('0x13c')](_0xd81b('0x140'),{'UserId':Number(_0x44a9e1['query']['ids']),'ChatWebsiteId':Number(_0x44a9e1['params']['id'])});}});}})[_0xd81b('0x1c')](respondWithStatusCode(_0x26d2c2,null))[_0xd81b('0x27')](handleError(_0x26d2c2,null));};exports[_0xd81b('0x141')]=function(_0xb7102c,_0x2b1519){var _0x1c5a61={};var _0x4c1201={};var _0x1f76aa;var _0x36fa37;return db[_0xd81b('0x4e')][_0xd81b('0x83')]({'where':{'id':_0xb7102c[_0xd81b('0x64')]['id']}})['then'](handleEntityNotFound(_0x2b1519,null))[_0xd81b('0x1c')](function(_0x4fc360){if(_0x4fc360){_0x1f76aa=_0x4fc360;_0x4c1201[_0xd81b('0x46')]=_['keys'](db[_0xd81b('0xca')]['rawAttributes']);_0x4c1201[_0xd81b('0x52')]=_[_0xd81b('0x53')](_0xb7102c[_0xd81b('0x52')]);_0x4c1201['filters']=_[_0xd81b('0x55')](_0x4c1201[_0xd81b('0x46')],_0x4c1201[_0xd81b('0x52')]);_0x1c5a61['attributes']=_[_0xd81b('0x55')](_0x4c1201['model'],qs[_0xd81b('0x57')](_0xb7102c['query'][_0xd81b('0x57')]));_0x1c5a61[_0xd81b('0x56')]=_0x1c5a61[_0xd81b('0x56')][_0xd81b('0x58')]?_0x1c5a61[_0xd81b('0x56')]:_0x4c1201[_0xd81b('0x46')];_0x1c5a61['order']=qs[_0xd81b('0x5c')](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5c')]);_0x1c5a61[_0xd81b('0x5d')]=qs[_0xd81b('0x54')](_[_0xd81b('0x5e')](_0xb7102c[_0xd81b('0x52')],_0x4c1201[_0xd81b('0x54')]));if(_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5f')]){_0x1c5a61['where']=_[_0xd81b('0x60')](_0x1c5a61['where'],{'$or':_[_0xd81b('0x4d')](_0x1c5a61['attributes'],function(_0x45bf7e){var _0x29464b={};_0x29464b[_0x45bf7e]={'$like':'%'+_0xb7102c[_0xd81b('0x52')][_0xd81b('0x5f')]+'%'};return _0x29464b;})});}_0x1c5a61=_[_0xd81b('0x60')]({},_0x1c5a61,_0xb7102c[_0xd81b('0x66')]);return _0x1f76aa[_0xd81b('0x141')](_0x1c5a61);}})['then'](function(_0xec700e){if(_0xec700e){_0x36fa37=_0xec700e[_0xd81b('0x58')];if(!_0xb7102c[_0xd81b('0x52')][_0xd81b('0x59')]('nolimit')){_0x1c5a61[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x2f')]);_0x1c5a61['offset']=qs['offset'](_0xb7102c[_0xd81b('0x52')][_0xd81b('0x2c')]);}return _0x1f76aa[_0xd81b('0x141')](_0x1c5a61);}})[_0xd81b('0x1c')](function(_0x450634){if(_0x450634){return _0x450634?{'count':_0x36fa37,'rows':_0x450634}:null;}})[_0xd81b('0x1c')](respondWithResult(_0x2b1519,null))[_0xd81b('0x27')](handleError(_0x2b1519,null));};
\ No newline at end of file
+var _0xf3cd=['split','firstName','lastName','x-real-port','referer','browser','name','version','format','unknown','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','length','find','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','create','update','addDisposition','Disposition','pick','ChatWebsiteId','options','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','list','ListId','contact','headers','threadId','closed','ChatInteraction','customerIp','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','applications','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','ChatQueue','Start','startRouting','EventManager','offline','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','server','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','Tag','color','tag','getProactiveActions','virtual','License','chatLicenseExceeded','timezone','3.13.0','origin','http://localhost:9000','testWebsiteWithWildcard','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','transaction','Transaction','bulkCreate','findAndCountAll','priority','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','handleError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','get','UserProfileResource','destroy','stack','user-agent-parser','setUA','getResult','cf-connecting-ip','x-forwarded-for'];(function(_0x148cab,_0xe10466){var _0x4df904=function(_0x53d14d){while(--_0x53d14d){_0x148cab['push'](_0x148cab['shift']());}};_0x4df904(++_0xe10466);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0xf3cd[_0x5da0d9];return _0x4b6d2f;};'use strict';var Mustache=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var ejs=require(_0xdf3c('0x3'));var fs=require('fs');var fs_extra=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var querystring=require('querystring');var htmlToText=require(_0xdf3c('0x6'));var Redis=require(_0xdf3c('0x7'));var jayson=require(_0xdf3c('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0xdf3c('0x9'))(_0xdf3c('0xa'));var config=require(_0xdf3c('0xb'));var APIBadRequestError=require(_0xdf3c('0xc'))[_0xdf3c('0xd')];var APINotFoundError=require(_0xdf3c('0xc'))['APINotFoundError'];var APIOutOfIntervalError=require(_0xdf3c('0xc'))['APIOutOfIntervalError'];var APIHandleError=require('../../errors/api')[_0xdf3c('0xe')];var APIConflictError=require(_0xdf3c('0xc'))['APIConflictError'];var wildcardUtils=require(_0xdf3c('0xf'));var URL=require(_0xdf3c('0x10'))[_0xdf3c('0x11')];var db=require(_0xdf3c('0x12'))['db'];config[_0xdf3c('0x13')]=_[_0xdf3c('0x14')](config[_0xdf3c('0x13')],{'host':_0xdf3c('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf3c('0x13')]));require(_0xdf3c('0x16'))[_0xdf3c('0x17')](socket);var client=jayson[_0xdf3c('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xdf3c('0x18')][_0xdf3c('0x19')]({'port':0x232a});var client9003=jayson[_0xdf3c('0x18')]['http']({'port':0x232b});var client9001=jayson[_0xdf3c('0x18')][_0xdf3c('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x173041,_0x4274fd,_0x21e587,_0x1a7a5a){return new Promise(function(_0x305ea5,_0x92008b){var _0x2986d0=_0x1a7a5a||client;return _0x2986d0[_0xdf3c('0x1a')](_0x173041,_0x21e587)['then'](function(_0x13b0e6){logger[_0xdf3c('0x1b')](_0xdf3c('0x1c'),_0x4274fd,_0xdf3c('0x1d'));logger[_0xdf3c('0x1e')](_0xdf3c('0x1f'),_0x4274fd,_0xdf3c('0x1d'),JSON[_0xdf3c('0x20')](_0x13b0e6));if(_0x13b0e6[_0xdf3c('0x21')]){if(_0x13b0e6[_0xdf3c('0x21')][_0xdf3c('0x22')]===0x1f4){logger[_0xdf3c('0x21')](_0xdf3c('0x1c'),_0x4274fd,_0x13b0e6['error']['message']);return _0x92008b(_0x13b0e6[_0xdf3c('0x21')]['message']);}logger[_0xdf3c('0x21')](_0xdf3c('0x1c'),_0x4274fd,_0x13b0e6[_0xdf3c('0x21')][_0xdf3c('0x23')]);return _0x305ea5(_0x13b0e6[_0xdf3c('0x21')][_0xdf3c('0x23')]);}else{logger['info'](_0xdf3c('0x1c'),_0x4274fd,_0xdf3c('0x1d'));_0x305ea5(_0x13b0e6[_0xdf3c('0x24')][_0xdf3c('0x23')]);}})[_0xdf3c('0x25')](function(_0x3b5371){logger[_0xdf3c('0x21')](_0xdf3c('0x1c'),_0x4274fd,_0x3b5371);_0x92008b(_0x3b5371);});});}function respondWithStatusCode(_0x18cb46,_0x1adee4){_0x1adee4=_0x1adee4||0xcc;return function(_0x4c076c){if(_0x4c076c){return _0x18cb46[_0xdf3c('0x26')](_0x1adee4);}return _0x18cb46[_0xdf3c('0x27')](_0x1adee4)['end']();};}function respondWithResult(_0xdc8962,_0x59659e){_0x59659e=_0x59659e||0xc8;return function(_0x4eaced){if(_0x4eaced){return _0xdc8962['status'](_0x59659e)[_0xdf3c('0x28')](_0x4eaced);}};}function respondWithFilteredResult(_0x186bba,_0x52b8f6){return function(_0x5c3b5a){if(_0x5c3b5a){var _0x37ecfd=typeof _0x52b8f6[_0xdf3c('0x29')]===_0xdf3c('0x2a')&&typeof _0x52b8f6[_0xdf3c('0x2b')]==='undefined';var _0x43ce06=_0x5c3b5a[_0xdf3c('0x2c')];var _0x5386bf=_0x37ecfd?0x0:_0x52b8f6['offset'];var _0x1f1d8a=_0x37ecfd?_0x5c3b5a[_0xdf3c('0x2c')]:_0x52b8f6[_0xdf3c('0x29')]+_0x52b8f6['limit'];var _0x2355f6;if(_0x1f1d8a>=_0x43ce06){_0x1f1d8a=_0x43ce06;_0x2355f6=0xc8;}else{_0x2355f6=0xce;}_0x186bba[_0xdf3c('0x27')](_0x2355f6);return _0x186bba[_0xdf3c('0x2d')](_0xdf3c('0x2e'),_0x5386bf+'-'+_0x1f1d8a+'/'+_0x43ce06)['json'](_0x5c3b5a);}return null;};}function saveUpdates(_0xda0de0){return function(_0x46b445){if(_0x46b445){return _0x46b445['update'](_0xda0de0)[_0xdf3c('0x2f')](function(_0x3daeda){return _0x3daeda;});}return null;};}function removeEntity(_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x2f')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x30')]({'plain':!![]});var _0x3b9ce8='ChatWebsites';return db[_0xdf3c('0x31')][_0xdf3c('0x32')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x217a65[_0xdf3c('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115){return function(_0x5e8130){if(!_0x5e8130){_0x216115['sendStatus'](0x194);}return _0x5e8130;};}function handleError(_0x52f0c3,_0x44a478){_0x44a478=_0x44a478||0x1f4;return function(_0x2ee9ad){logger[_0xdf3c('0x21')](_0x2ee9ad[_0xdf3c('0x33')]);if(_0x2ee9ad['name']){delete _0x2ee9ad['name'];}_0x52f0c3[_0xdf3c('0x27')](_0x44a478)['send'](_0x2ee9ad);};}function createInteractionObject(_0x46e40f,_0x17b502,_0x3628ae,_0xcdd731){var _0x1004e9=require(_0xdf3c('0x34'));var _0x1c7335=new _0x1004e9();var _0x809f3d=_0x1c7335[_0xdf3c('0x35')](_0x3628ae['user-agent'])[_0xdf3c('0x36')]();var _0x54e689=_0x17b502['customerIp'];if(_0x3628ae[_0xdf3c('0x37')]){_0x54e689=_0x3628ae['cf-connecting-ip'];}else if(_0x3628ae[_0xdf3c('0x38')]){_0x54e689=_['first'](_0x3628ae[_0xdf3c('0x38')][_0xdf3c('0x39')](','));}return{'ContactId':_0xcdd731['id'],'ChatWebsiteId':_0x46e40f,'from':(_0xcdd731[_0xdf3c('0x3a')]||'')+'\x20'+(_0xcdd731[_0xdf3c('0x3b')]||''),'customerIp':_0x54e689,'customerPort':_0x3628ae[_0xdf3c('0x3c')]?_0x3628ae[_0xdf3c('0x3c')]:null,'referer':_0x17b502[_0xdf3c('0x3d')],'browserName':_0x809f3d[_0xdf3c('0x3e')][_0xdf3c('0x3f')]&&_0x809f3d[_0xdf3c('0x3e')][_0xdf3c('0x40')]?util[_0xdf3c('0x41')]('%s\x20%s',_0x809f3d['browser'][_0xdf3c('0x3f')],_0x809f3d['browser'][_0xdf3c('0x40')]):_0xdf3c('0x42'),'browserVersion':_0x809f3d[_0xdf3c('0x3e')][_0xdf3c('0x40')]||'unknown','osName':util['format'](_0xdf3c('0x43'),_0x809f3d['os'][_0xdf3c('0x3f')],_0x809f3d['os'][_0xdf3c('0x40')]),'osVersion':_0x809f3d['os']['version'],'deviceModel':_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x45')]&&_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x46')]?util['format'](_0xdf3c('0x47'),_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x45')],_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x46')],_0x809f3d['device'][_0xdf3c('0x48')]):null,'deviceVendor':_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x46')],'deviceType':_0x809f3d[_0xdf3c('0x44')][_0xdf3c('0x48')],'formData':JSON[_0xdf3c('0x20')](_0x17b502)};}exports['index']=function(_0x4d6349,_0x2c6c6d){var _0x2be86d={'include':[{'model':db[_0xdf3c('0x49')],'as':_0xdf3c('0x4a')}]},_0x5a4443={},_0x5c9885={'count':0x0,'rows':[]};var _0x46b2bd=_[_0xdf3c('0x4b')](db[_0xdf3c('0x4c')][_0xdf3c('0x4d')],function(_0x466ea1){return{'name':_0x466ea1[_0xdf3c('0x4e')],'type':_0x466ea1[_0xdf3c('0x48')]['key']};});_0x5a4443[_0xdf3c('0x45')]=_[_0xdf3c('0x4b')](_0x46b2bd,_0xdf3c('0x3f'));_0x5a4443[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x4d6349[_0xdf3c('0x4f')]);_0x5a4443[_0xdf3c('0x51')]=_['intersection'](_0x5a4443[_0xdf3c('0x45')],_0x5a4443['query']);_0x2be86d[_0xdf3c('0x52')]=_['intersection'](_0x5a4443[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x4d6349[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x2be86d['attributes']=_0x2be86d['attributes']['length']?_0x2be86d[_0xdf3c('0x52')]:_0x5a4443['model'];if(!_0x4d6349[_0xdf3c('0x4f')][_0xdf3c('0x54')](_0xdf3c('0x55'))){_0x2be86d[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x4d6349['query']['limit']);_0x2be86d[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x4d6349['query'][_0xdf3c('0x29')]);}_0x2be86d[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x4d6349[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0x2be86d[_0xdf3c('0x58')]=qs[_0xdf3c('0x51')](_['pick'](_0x4d6349['query'],_0x5a4443[_0xdf3c('0x51')]),_0x46b2bd);if(_0x4d6349[_0xdf3c('0x4f')][_0xdf3c('0x59')]){_0x2be86d[_0xdf3c('0x58')]=_[_0xdf3c('0x5a')](_0x2be86d[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x46b2bd,function(_0x2aace4){if(_0x2aace4[_0xdf3c('0x48')]!==_0xdf3c('0x5b')){var _0x393ad2={};_0x393ad2[_0x2aace4['name']]={'$like':'%'+_0x4d6349[_0xdf3c('0x4f')]['filter']+'%'};return _0x393ad2;}})});}_0x2be86d=_['merge']({},_0x2be86d,_0x4d6349['options']);var _0x58fcbf={'where':_0x2be86d['where']};return db[_0xdf3c('0x4c')][_0xdf3c('0x2c')](_0x58fcbf)['then'](function(_0x4257c4){_0x5c9885[_0xdf3c('0x2c')]=_0x4257c4;if(_0x4d6349['query'][_0xdf3c('0x5c')]){_0x2be86d[_0xdf3c('0x5d')]=[{'all':!![]}];}return db[_0xdf3c('0x4c')][_0xdf3c('0x5e')](_0x2be86d);})[_0xdf3c('0x2f')](function(_0x28f387){_0x5c9885[_0xdf3c('0x5f')]=_0x28f387;return _0x5c9885;})[_0xdf3c('0x2f')](respondWithFilteredResult(_0x2c6c6d,_0x2be86d))[_0xdf3c('0x25')](handleError(_0x2c6c6d,null));};exports[_0xdf3c('0x60')]=function(_0x55e29b,_0x503d94){var _0x1ed898={'raw':![],'where':{'id':_0x55e29b[_0xdf3c('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0xdf3c('0x4a')}]},_0x158932={};_0x158932[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db['ChatWebsite'][_0xdf3c('0x4d')]);_0x158932[_0xdf3c('0x4f')]=_['keys'](_0x55e29b[_0xdf3c('0x4f')]);_0x158932['filters']=_[_0xdf3c('0x62')](_0x158932[_0xdf3c('0x45')],_0x158932[_0xdf3c('0x4f')]);_0x1ed898[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0x158932[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x55e29b[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x1ed898[_0xdf3c('0x52')]=_0x1ed898[_0xdf3c('0x52')][_0xdf3c('0x63')]?_0x1ed898[_0xdf3c('0x52')]:_0x158932[_0xdf3c('0x45')];if(_0x55e29b[_0xdf3c('0x4f')][_0xdf3c('0x5c')]){_0x1ed898[_0xdf3c('0x5d')]=[{'all':!![]}];}_0x1ed898=_['merge']({},_0x1ed898,_0x55e29b['options']);return db[_0xdf3c('0x4c')][_0xdf3c('0x64')](_0x1ed898)[_0xdf3c('0x2f')](handleEntityNotFound(_0x503d94,null))['then'](respondWithResult(_0x503d94,null))[_0xdf3c('0x25')](handleError(_0x503d94,null));};exports['create']=function(_0x574852,_0x184952){var _0x399db6=null;_0x574852[_0xdf3c('0x65')][_0xdf3c('0x66')][_0xdf3c('0x39')](',')[_0xdf3c('0x67')](_0x1a31d7=>{if(_0x1a31d7[_0xdf3c('0x68')]()!==''&&!wildcardUtils[_0xdf3c('0x69')](_0x1a31d7[_0xdf3c('0x68')]())){_0x399db6=new APIBadRequestError('\x22'+_0x1a31d7[_0xdf3c('0x68')]()+_0xdf3c('0x6a'));}});if(_0x399db6){return handleError(_0x184952,null)(_0x399db6);}return db[_0xdf3c('0x4c')]['create'](_0x574852[_0xdf3c('0x65')],{})[_0xdf3c('0x2f')](function(_0x149cd5){var _0x16d6ea=_0x574852[_0xdf3c('0x6b')]['get']({'plain':!![]});if(!_0x16d6ea)throw new Error(_0xdf3c('0x6c'));if(_0x16d6ea[_0xdf3c('0x6d')]===_0xdf3c('0x6b')){var _0x12d791=_0x149cd5[_0xdf3c('0x30')]({'plain':!![]});var _0x50805c=_0xdf3c('0x6e');return db[_0xdf3c('0x6f')][_0xdf3c('0x64')]({'where':{'name':_0x50805c,'userProfileId':_0x16d6ea[_0xdf3c('0x70')]},'raw':!![]})['then'](function(_0xb867a1){if(_0xb867a1&&_0xb867a1[_0xdf3c('0x71')]===0x0){return db[_0xdf3c('0x31')][_0xdf3c('0x72')]({'name':_0x12d791[_0xdf3c('0x3f')],'resourceId':_0x12d791['id'],'type':_0xb867a1[_0xdf3c('0x3f')],'sectionId':_0xb867a1['id']},{})[_0xdf3c('0x2f')](function(){return _0x149cd5;});}else{return _0x149cd5;}})['catch'](function(_0x2b6069){logger[_0xdf3c('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b6069);throw _0x2b6069;});}return _0x149cd5;})['then'](respondWithResult(_0x184952,0xc9))[_0xdf3c('0x25')](handleError(_0x184952,null));};exports[_0xdf3c('0x73')]=function(_0x3064de,_0x1e6529){var _0x87f730=null;_0x3064de[_0xdf3c('0x65')][_0xdf3c('0x66')][_0xdf3c('0x39')](',')['forEach'](_0x14cd72=>{if(_0x14cd72[_0xdf3c('0x68')]()!==''&&!wildcardUtils[_0xdf3c('0x69')](_0x14cd72['trim']())){_0x87f730=new APIBadRequestError('\x22'+_0x14cd72[_0xdf3c('0x68')]()+_0xdf3c('0x6a'));}});if(_0x87f730){return handleError(_0x1e6529,null)(_0x87f730);}if(_0x3064de[_0xdf3c('0x65')]['id']){delete _0x3064de['body']['id'];}return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x3064de[_0xdf3c('0x61')]['id']},'include':[{'model':db[_0xdf3c('0x49')],'as':_0xdf3c('0x4a')}]})[_0xdf3c('0x2f')](handleEntityNotFound(_0x1e6529,null))['then'](saveUpdates(_0x3064de['body'],null))['then'](respondWithResult(_0x1e6529,null))['catch'](handleError(_0x1e6529,null));};exports['destroy']=function(_0x2a4e4c,_0x3f43a0){return db[_0xdf3c('0x4c')]['find']({'where':{'id':_0x2a4e4c[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x3f43a0,null))[_0xdf3c('0x2f')](removeEntity(_0x3f43a0,null))['catch'](handleError(_0x3f43a0,null));};exports['describe']=function(_0x233718,_0x4e3517){return db[_0xdf3c('0x4c')]['describe']()[_0xdf3c('0x2f')](respondWithResult(_0x4e3517,null))[_0xdf3c('0x25')](handleError(_0x4e3517,null));};exports[_0xdf3c('0x74')]=function(_0x31f023,_0x5316ef){if(_0x31f023['body']['id']){delete _0x31f023[_0xdf3c('0x65')]['id'];}return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x31f023[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x5316ef,null))[_0xdf3c('0x2f')](function(_0x4eb295){if(_0x4eb295){_0x31f023[_0xdf3c('0x65')]['ChatWebsiteId']=_0x4eb295['id'];return db[_0xdf3c('0x75')][_0xdf3c('0x72')](_0x31f023[_0xdf3c('0x65')]);}})[_0xdf3c('0x2f')](respondWithResult(_0x5316ef,null))[_0xdf3c('0x25')](handleError(_0x5316ef,null));};exports['getDispositions']=function(_0x45e4e0,_0x5c27cc){var _0x332041={'raw':![],'where':{}};var _0x4fabda={};var _0x591578={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x45e4e0[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x5c27cc,null))[_0xdf3c('0x2f')](function(_0x391042){if(_0x391042){_0x4fabda[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db['Disposition'][_0xdf3c('0x4d')]);_0x4fabda['query']=_[_0xdf3c('0x50')](_0x45e4e0[_0xdf3c('0x4f')]);_0x4fabda[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0x4fabda[_0xdf3c('0x45')],_0x4fabda[_0xdf3c('0x4f')]);_0x332041[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0x4fabda[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x332041[_0xdf3c('0x52')]=_0x332041[_0xdf3c('0x52')]['length']?_0x332041[_0xdf3c('0x52')]:_0x4fabda[_0xdf3c('0x45')];if(!_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x54')]('nolimit')){_0x332041[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x45e4e0['query']['limit']);_0x332041[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x29')]);}_0x332041[_0xdf3c('0x56')]=qs['sort'](_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0x332041[_0xdf3c('0x58')]=qs[_0xdf3c('0x51')](_[_0xdf3c('0x76')](_0x45e4e0[_0xdf3c('0x4f')],_0x4fabda['filters']));_0x332041[_0xdf3c('0x58')][_0xdf3c('0x77')]=_0x391042['id'];if(_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x59')]){_0x332041[_0xdf3c('0x58')]=_['merge'](_0x332041['where'],{'$or':_['map'](_0x332041[_0xdf3c('0x52')],function(_0x2cdc6d){var _0x2d4ece={};_0x2d4ece[_0x2cdc6d]={'$like':'%'+_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x2d4ece;})});}_0x332041=_[_0xdf3c('0x5a')]({},_0x332041,_0x45e4e0[_0xdf3c('0x78')]);return db[_0xdf3c('0x75')]['count']({'where':_0x332041[_0xdf3c('0x58')]})[_0xdf3c('0x2f')](function(_0x1cb9fd){_0x591578[_0xdf3c('0x2c')]=_0x1cb9fd;if(_0x45e4e0[_0xdf3c('0x4f')][_0xdf3c('0x5c')]){_0x332041['include']=[{'all':!![]}];}return db[_0xdf3c('0x75')][_0xdf3c('0x5e')](_0x332041);})['then'](function(_0x5115ea){_0x591578[_0xdf3c('0x5f')]=_0x5115ea;return _0x591578;});}})['then'](respondWithFilteredResult(_0x5c27cc,_0x332041))[_0xdf3c('0x25')](handleError(_0x5c27cc,null));};exports[_0xdf3c('0x79')]=function(_0x4e917f,_0x2b4084){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x4e917f[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x2b4084,null))[_0xdf3c('0x2f')](function(_0x498882){if(_0x498882){return _0x498882[_0xdf3c('0x79')](_0x4e917f[_0xdf3c('0x4f')][_0xdf3c('0x7a')]);}})[_0xdf3c('0x2f')](respondWithStatusCode(_0x2b4084,null))[_0xdf3c('0x25')](handleError(_0x2b4084,null));};exports[_0xdf3c('0x7b')]=function(_0x3deacb,_0x48b892){if(_0x3deacb['body']['id']){delete _0x3deacb[_0xdf3c('0x65')]['id'];}return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x3deacb['params']['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x48b892,null))['then'](function(_0x56a655){if(_0x56a655){_0x3deacb[_0xdf3c('0x65')][_0xdf3c('0x77')]=_0x56a655['id'];return db['CannedAnswer'][_0xdf3c('0x72')](_0x3deacb['body']);}})[_0xdf3c('0x2f')](respondWithResult(_0x48b892,null))['catch'](handleError(_0x48b892,null));};exports[_0xdf3c('0x7c')]=function(_0x3676a2,_0x284635){var _0xb91d51={'raw':![],'where':{}};var _0x8da8b8={};var _0x87e942={'count':0x0,'rows':[]};return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x3676a2[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x284635,null))[_0xdf3c('0x2f')](function(_0x404761){if(_0x404761){_0x8da8b8[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db['CannedAnswer'][_0xdf3c('0x4d')]);_0x8da8b8[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x3676a2['query']);_0x8da8b8[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0x8da8b8[_0xdf3c('0x45')],_0x8da8b8[_0xdf3c('0x4f')]);_0xb91d51[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0x8da8b8[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0xb91d51[_0xdf3c('0x52')]=_0xb91d51['attributes'][_0xdf3c('0x63')]?_0xb91d51[_0xdf3c('0x52')]:_0x8da8b8[_0xdf3c('0x45')];if(!_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x54')](_0xdf3c('0x55'))){_0xb91d51[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x2b')]);_0xb91d51[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x3676a2['query'][_0xdf3c('0x29')]);}_0xb91d51[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0xb91d51[_0xdf3c('0x58')]=qs[_0xdf3c('0x51')](_['pick'](_0x3676a2[_0xdf3c('0x4f')],_0x8da8b8[_0xdf3c('0x51')]));_0xb91d51[_0xdf3c('0x58')][_0xdf3c('0x77')]=_0x404761['id'];if(_0x3676a2['query'][_0xdf3c('0x59')]){_0xb91d51[_0xdf3c('0x58')]=_['merge'](_0xb91d51[_0xdf3c('0x58')],{'$or':_['map'](_0xb91d51[_0xdf3c('0x52')],function(_0x1b2363){var _0x5e6cc1={};_0x5e6cc1[_0x1b2363]={'$like':'%'+_0x3676a2[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x5e6cc1;})});}_0xb91d51=_[_0xdf3c('0x5a')]({},_0xb91d51,_0x3676a2['options']);return db['CannedAnswer'][_0xdf3c('0x2c')]({'where':_0xb91d51['where']})[_0xdf3c('0x2f')](function(_0x82225d){_0x87e942[_0xdf3c('0x2c')]=_0x82225d;if(_0x3676a2[_0xdf3c('0x4f')]['includeAll']){_0xb91d51[_0xdf3c('0x5d')]=[{'all':!![]}];}return db[_0xdf3c('0x7e')]['findAll'](_0xb91d51);})[_0xdf3c('0x2f')](function(_0x545e1c){_0x87e942[_0xdf3c('0x5f')]=_0x545e1c;return _0x87e942;});}})[_0xdf3c('0x2f')](respondWithFilteredResult(_0x284635,_0xb91d51))['catch'](handleError(_0x284635,null));};exports['removeAnswers']=function(_0x243fbf,_0x4e01ca){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x243fbf[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x4e01ca,null))[_0xdf3c('0x2f')](function(_0x12bd07){if(_0x12bd07){return _0x12bd07[_0xdf3c('0x7f')](_0x243fbf[_0xdf3c('0x4f')][_0xdf3c('0x7a')]);}})[_0xdf3c('0x2f')](respondWithStatusCode(_0x4e01ca,null))[_0xdf3c('0x25')](handleError(_0x4e01ca,null));};exports['addLogo']=function(_0x4299d1,_0x132c27){_0x4299d1['body'][_0xdf3c('0x80')]=_0x4299d1[_0xdf3c('0x81')][_0xdf3c('0x82')];return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x4299d1[_0xdf3c('0x61')]['id']}})['then'](handleEntityNotFound(_0x132c27,null))[_0xdf3c('0x2f')](saveUpdates(_0x4299d1['body'],null))[_0xdf3c('0x2f')](respondWithResult(_0x132c27,null))[_0xdf3c('0x25')](handleError(_0x132c27,null));};exports[_0xdf3c('0x83')]=function(_0x2dafff,_0x2a934a){_0x2dafff[_0xdf3c('0x65')]['agentAvatar']=_0x2dafff[_0xdf3c('0x81')][_0xdf3c('0x82')];return db['ChatWebsite'][_0xdf3c('0x64')]({'where':{'id':_0x2dafff[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x2a934a,null))[_0xdf3c('0x2f')](saveUpdates(_0x2dafff[_0xdf3c('0x65')],null))[_0xdf3c('0x2f')](respondWithResult(_0x2a934a,null))[_0xdf3c('0x25')](handleError(_0x2a934a,null));};exports[_0xdf3c('0x84')]=function(_0x59cfce,_0x50b470){_0x59cfce[_0xdf3c('0x65')][_0xdf3c('0x85')]=_0x59cfce[_0xdf3c('0x81')][_0xdf3c('0x82')];return db['ChatWebsite']['find']({'where':{'id':_0x59cfce[_0xdf3c('0x61')]['id']}})['then'](handleEntityNotFound(_0x50b470,null))[_0xdf3c('0x2f')](saveUpdates(_0x59cfce['body'],null))[_0xdf3c('0x2f')](respondWithResult(_0x50b470,null))[_0xdf3c('0x25')](handleError(_0x50b470,null));};exports[_0xdf3c('0x86')]=function(_0x53555a,_0x292798){_0x53555a[_0xdf3c('0x65')]['systemAvatar']=_0x53555a['file'][_0xdf3c('0x82')];return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x53555a[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x292798,null))[_0xdf3c('0x2f')](saveUpdates(_0x53555a[_0xdf3c('0x65')],null))['then'](respondWithResult(_0x292798,null))['catch'](handleError(_0x292798,null));};exports[_0xdf3c('0x87')]=function(_0x39c993,_0x2efe5b){var _0x140e5e=path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x8a'));var _0x828c9c={'where':{'id':_0x39c993[_0xdf3c('0x61')]['id']},'attributes':['id',_0xdf3c('0x80')],'raw':!![]};var _0x3e4a0e=![];return require(_0xdf3c('0x8b'))[_0xdf3c('0x8c')]()[_0xdf3c('0x2f')](function(_0x434b1b){if(_0x434b1b){_0x3e4a0e=_0x434b1b[_0xdf3c('0x8d')];}})[_0xdf3c('0x2f')](function(){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')](_0x828c9c);})['then'](handleEntityNotFound(_0x2efe5b,null))['then'](function(_0x7cf0de){if(_0x7cf0de){if(!_['isNil'](_0x7cf0de['sitepic'])){if(fs[_0xdf3c('0x8e')](path['join'](config[_0xdf3c('0x89')],_0xdf3c('0x8f'),_0x7cf0de['sitepic']))&&_0x3e4a0e){_0x140e5e=path['join'](config['root'],_0xdf3c('0x8f'),_0x7cf0de[_0xdf3c('0x80')]);}}return _0x2efe5b[_0xdf3c('0x90')](_0x140e5e);}})['catch'](handleError(_0x2efe5b,null));};exports[_0xdf3c('0x91')]=function(_0x51f4b6,_0x37b921){var _0x4ba88f=path['join'](config[_0xdf3c('0x89')],_0xdf3c('0x92'));var _0x3ff959={'where':{'id':_0x51f4b6[_0xdf3c('0x61')]['id']},'attributes':['id',_0xdf3c('0x93')],'raw':!![]};return db[_0xdf3c('0x4c')]['find'](_0x3ff959)['then'](handleEntityNotFound(_0x37b921,null))[_0xdf3c('0x2f')](function(_0x57484a){if(_0x57484a){if(!_[_0xdf3c('0x94')](_0x57484a[_0xdf3c('0x93')])){if(fs[_0xdf3c('0x8e')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x95'),_0x57484a[_0xdf3c('0x93')]))){_0x4ba88f=path['join'](config['root'],_0xdf3c('0x95'),_0x57484a[_0xdf3c('0x93')]);}}return _0x37b921[_0xdf3c('0x90')](_0x4ba88f);}})[_0xdf3c('0x25')](handleError(_0x37b921,null));};exports['getCustomerAvatar']=function(_0xe14463,_0x364b5e){var _0x32ec3c=path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x96'));var _0x524482={'where':{'id':_0xe14463[_0xdf3c('0x61')]['id']},'attributes':['id',_0xdf3c('0x85'),'showCustomerAvatar'],'raw':!![]};return db[_0xdf3c('0x4c')][_0xdf3c('0x64')](_0x524482)[_0xdf3c('0x2f')](handleEntityNotFound(_0x364b5e,null))['then'](function(_0x87ec92){if(_0x87ec92){if(!_[_0xdf3c('0x94')](_0x87ec92[_0xdf3c('0x85')])){if(fs[_0xdf3c('0x8e')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x95'),_0x87ec92[_0xdf3c('0x85')]))&&_0x87ec92[_0xdf3c('0x97')]){_0x32ec3c=path['join'](config[_0xdf3c('0x89')],'server/files/images/avatars/',_0x87ec92[_0xdf3c('0x85')]);}}return _0x364b5e[_0xdf3c('0x90')](_0x32ec3c);}})[_0xdf3c('0x25')](handleError(_0x364b5e,null));};exports[_0xdf3c('0x98')]=function(_0x90c66,_0x34344b){var _0x1e2f88=path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x99'));var _0x3a90f4={'where':{'id':_0x90c66['params']['id']},'attributes':['id',_0xdf3c('0x9a')],'raw':!![]};return db[_0xdf3c('0x4c')]['find'](_0x3a90f4)[_0xdf3c('0x2f')](handleEntityNotFound(_0x34344b,null))[_0xdf3c('0x2f')](function(_0x367cd3){if(_0x367cd3){if(!_[_0xdf3c('0x94')](_0x367cd3['systemAvatar'])){if(fs[_0xdf3c('0x8e')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],'server/files/images/avatars/',_0x367cd3['systemAvatar']))){_0x1e2f88=path['join'](config[_0xdf3c('0x89')],_0xdf3c('0x95'),_0x367cd3[_0xdf3c('0x9a')]);}}return _0x34344b[_0xdf3c('0x90')](_0x1e2f88);}})[_0xdf3c('0x25')](handleError(_0x34344b,null));};function checkWebsiteInterval(_0x33132b){var _0x18a7ac=_0x33132b[_0xdf3c('0x9b')];if(!_0x18a7ac){return Promise['resolve'](_0x33132b);}var _0x1a0613=_0x33132b['timezone']||undefined;return _0x18a7ac[_0xdf3c('0x9c')](_0x1a0613)[_0xdf3c('0x2f')](function(_0x1b2e93){if(!_0x1b2e93){throw new APIOutOfIntervalError();}return _0x33132b;});}exports[_0xdf3c('0x9d')]=function(_0x3cb8a7,_0x440c7c){var _0x4e5569={'body':_0x3cb8a7[_0xdf3c('0x65')],'channel':_0xdf3c('0x9e')};var _0x4d3059=[];var _0x28337a=[];var _0x270353={};var _0x5926b6=![];if(_0x3cb8a7[_0xdf3c('0x65')]['id']){delete _0x3cb8a7['body']['id'];}if(_[_0xdf3c('0x94')](_0x3cb8a7['body'][_0xdf3c('0x9f')])){throw new APIBadRequestError(_0xdf3c('0xa0'));}if(_[_0xdf3c('0x94')](_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xa1')])){throw new APIBadRequestError(_0xdf3c('0xa2'));}if(_['isEmpty'](_0x3cb8a7['body']['body'])){throw new APIBadRequestError(_0xdf3c('0xa3'));}var _0x18f52c=_0x3cb8a7['body']['customerIp']&&_0x3cb8a7[_0xdf3c('0x65')]['referer'];return db['CmContact']['describe']()[_0xdf3c('0x2f')](function(_0x242b95){if(!_0x242b95){throw new Error(_0xdf3c('0xa4'));}_0x4d3059=Object['keys'](_0x242b95)[_0xdf3c('0x59')](function(_0x51d880){return![_0xdf3c('0xa5'),_0xdf3c('0xa6')][_0xdf3c('0xa7')](_0x51d880);});_0x28337a=Object[_0xdf3c('0x50')](_0x242b95)[_0xdf3c('0x59')](function(_0x467090){return![_0xdf3c('0xa5'),_0xdf3c('0xa6'),_0xdf3c('0xa8'),'ListId'][_0xdf3c('0xa7')](_0x467090);});if(!_[_0xdf3c('0xa7')](_0x28337a,_0x3cb8a7['body'][_0xdf3c('0xa1')])){throw new APIBadRequestError(_0xdf3c('0xa9')+_0x28337a['join'](',\x20'));}_0x270353[_0x3cb8a7[_0xdf3c('0x65')]['mapKey']]=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0x9f')];})[_0xdf3c('0x2f')](function(){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x3cb8a7[_0xdf3c('0x61')]['id']},'include':[{'model':db[_0xdf3c('0xaa')],'as':_0xdf3c('0xab'),'include':[{'model':db[_0xdf3c('0xac')],'as':_0xdf3c('0xad'),'where':_0x270353,'limit':0x1,'order':[[_0xdf3c('0xa6'),_0xdf3c('0xae')]]}]},{'model':db[_0xdf3c('0xaf')],'as':_0xdf3c('0xb0')},{'model':db[_0xdf3c('0x9b')],'as':_0xdf3c('0x9b'),'include':[{'model':db['Interval'],'as':_0xdf3c('0xb1'),'attributes':['id',_0xdf3c('0xb2')],'raw':!![]}]}]});})['then'](function(_0x518292){if(!_0x518292){throw new APINotFoundError(util[_0xdf3c('0x41')](_0xdf3c('0xb3'),_0x3cb8a7[_0xdf3c('0x61')]['id']));}if(_0x18f52c){return checkWebsiteInterval(_0x518292);}return _0x518292;})['then'](function(_0x5c3767){_0x4e5569[_0xdf3c('0xb4')]=_0x5c3767;_0x4e5569['applications']=_[_0xdf3c('0xb5')](_0x5c3767[_0xdf3c('0xb0')],['priority'],['asc']);if(_0x4e5569[_0xdf3c('0xb4')][_0xdf3c('0xb0')]){delete _0x4e5569[_0xdf3c('0xb4')]['Applications'];}_0x4e5569[_0xdf3c('0xb6')]=_0x5c3767['List']||{'id':_0x5c3767[_0xdf3c('0xb7')]};if(_0x4e5569[_0xdf3c('0xb6')]&&_0x4e5569[_0xdf3c('0xb6')][_0xdf3c('0xad')][_0xdf3c('0x63')]){return _0x4e5569[_0xdf3c('0xb6')]['Contacts'][0x0];}var _0x16ae87=_['defaults'](_0x3cb8a7[_0xdf3c('0x65')],{'firstName':_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0x9f')],'ListId':_0x5c3767['ListId']});_0x16ae87[_0x3cb8a7[_0xdf3c('0x65')]['mapKey']]=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0x9f')];return db['CmContact'][_0xdf3c('0x72')](_0x16ae87,{'fields':_0x4d3059,'raw':!![]});})[_0xdf3c('0x2f')](function(_0x2c3655){_0x4e5569[_0xdf3c('0xb8')]=_0x2c3655;var _0x55969c=createInteractionObject(_0x3cb8a7[_0xdf3c('0x61')]['id'],_0x3cb8a7[_0xdf3c('0x65')],_0x3cb8a7[_0xdf3c('0xb9')],_0x2c3655);var _0x393d06={'ChatWebsiteId':_0x3cb8a7[_0xdf3c('0x61')]['id']};if(_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xba')]){_0x393d06['threadId']=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xba')];_0x393d06[_0xdf3c('0xbb')]=![];return db[_0xdf3c('0xbc')][_0xdf3c('0x64')]({'where':_0x393d06})[_0xdf3c('0x2f')](function(_0x282f44){var _0x6e0498=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xbd')]&&_0x3cb8a7[_0xdf3c('0x65')]['referer'];if(_0x282f44){_0x5926b6=!![];return _0x282f44;}else if(!_0x6e0498&&_0x282f44&&_0x282f44[_0xdf3c('0xbb')]){throw new APIConflictError(_0xdf3c('0xbe'));}_0x55969c[_0xdf3c('0xba')]=_0x3cb8a7['body'][_0xdf3c('0xba')];_0x55969c[_0xdf3c('0xbf')]=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xbf')];return db[_0xdf3c('0xbc')]['create'](_0x55969c);});}_0x393d06[_0xdf3c('0xc0')]=_0x2c3655['id'];if(_0x3cb8a7[_0xdf3c('0x65')]['interaction']&&_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xc1')]['id']){_0x393d06['id']=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xc1')]['id'];return db[_0xdf3c('0xbc')][_0xdf3c('0x64')]({'where':_0x393d06})[_0xdf3c('0x2f')](function(_0x3d9041){var _0x16564c=_0x3cb8a7['body'][_0xdf3c('0xbd')]&&_0x3cb8a7[_0xdf3c('0x65')]['referer'];if(!_0x16564c&&_0x3d9041&&_0x3d9041[_0xdf3c('0xbb')]){throw new APIConflictError(_0xdf3c('0xbe'));}else if(_0x3d9041){_0x5926b6=!![];return _0x3d9041;}else{return db['ChatInteraction']['create'](_0x55969c);}});}return db[_0xdf3c('0xbc')][_0xdf3c('0x72')](_0x55969c);})[_0xdf3c('0x2f')](function(_0x2bf92d){if(!_0x5926b6){return _0x2bf92d;}var _0x1f5c1b={'from':(_0x4e5569[_0xdf3c('0xb8')][_0xdf3c('0x3a')]||'')+'\x20'+(_0x4e5569[_0xdf3c('0xb8')]['lastName']||'')};if(_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xba')]&&_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xc2')]&&_0x3cb8a7['body'][_0xdf3c('0xba')]!=_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xc2')]){_0x1f5c1b[_0xdf3c('0xba')]=_0x3cb8a7['body'][_0xdf3c('0xc2')];}return _0x2bf92d[_0xdf3c('0x73')](_0x1f5c1b);})[_0xdf3c('0x2f')](function(_0x58bc3a){_0x4e5569['interaction']=_0x58bc3a[_0xdf3c('0x30')]({'plain':!![]});_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xc3')]=!_0x5926b6;if(_0x4e5569['interaction'][_0xdf3c('0xc3')]){if(_0x4e5569[_0xdf3c('0xb4')][_0xdf3c('0xc4')]){_0x4e5569[_0xdf3c('0xc5')][_0xdf3c('0xc6')]({'id':0x0,'priority':_0x4e5569['applications']['length']+0x1,'app':_0xdf3c('0xc7'),'appdata':'unmanaged','interval':_0xdf3c('0xc8')});}}return db[_0xdf3c('0xc9')][_0xdf3c('0x72')]({'body':_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0x65')],'ChatWebsiteId':_0x3cb8a7[_0xdf3c('0x61')]['id'],'ChatInteractionId':_0x58bc3a['id'],'direction':'in','ContactId':_0x4e5569['contact']['id'],'AttachmentId':_0x3cb8a7[_0xdf3c('0x65')][_0xdf3c('0xca')]});})[_0xdf3c('0x2f')](function(_0x5fcc1){_0x4e5569['message']=_0x5fcc1;if(!_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xcb')]){return;}return db[_0xdf3c('0xcc')]['find']({'attributes':['id','name'],'where':{'id':_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xcb')]}});})['then'](function(_0x20af56){if(_0x20af56){_0x4e5569['applications'][_0xdf3c('0xcd')]({'id':0x0,'priority':0x0,'app':_0xdf3c('0xce'),'appdata':_0x20af56[_0xdf3c('0x3f')]+','+(_0x4e5569[_0xdf3c('0xb4')][_0xdf3c('0xcf')]||0xa),'interval':_0xdf3c('0xc8')});_0x4e5569['forcedOwnership']=!![];}if(!_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xd0')]){return;}return db[_0xdf3c('0xd1')][_0xdf3c('0x64')]({'attributes':['id',_0xdf3c('0x3f')],'where':{'id':_0x4e5569[_0xdf3c('0xc1')][_0xdf3c('0xd0')]}});})[_0xdf3c('0x2f')](function(_0x43ce1f){if(_0x43ce1f){_0x4e5569[_0xdf3c('0xc5')][_0xdf3c('0xcd')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x43ce1f[_0xdf3c('0x3f')]+','+(_0x4e5569[_0xdf3c('0xb4')]['waitForTheAssignedQueue']||0x12c),'interval':_0xdf3c('0xc8')});}return respondWithRpcPromise(_0xdf3c('0xd2'),_0xdf3c('0xd3'),_0x4e5569);})[_0xdf3c('0x2f')](function(_0xa316ce){respondWithRpcPromise('EventManager',_0xdf3c('0xd4'),{'event':_0xdf3c('0x9d'),'message':_0xa316ce},client9002);return _0xa316ce;})[_0xdf3c('0x2f')](respondWithResult(_0x440c7c,null))[_0xdf3c('0x25')](APIHandleError(_0x440c7c));};exports[_0xdf3c('0xd5')]=function(_0x31391d,_0x158c75){var _0x7554e2,_0xdc8438,_0x4727f2;var _0x299dc3=[];var _0x4c3c70={};var _0x352c54=_0x31391d['files']||[];var _0x40c59b=[];var _0x11a887;return db['CmContact'][_0xdf3c('0xd6')]()[_0xdf3c('0x2f')](function(_0x44388c){if(!_0x44388c){throw new db[(_0xdf3c('0xd7'))][(_0xdf3c('0xd8'))](_0xdf3c('0xd9'));}_0x299dc3=_[_0xdf3c('0xda')](_[_0xdf3c('0x50')](_0x44388c),[_0xdf3c('0xa5'),_0xdf3c('0xa6'),'CompanyId',_0xdf3c('0xb7')]);if(_0x31391d[_0xdf3c('0x65')]['id']){delete _0x31391d['body']['id'];}if(_[_0xdf3c('0x94')](_0x31391d['body'][_0xdf3c('0x9f')])){throw _0x158c75['status'](0x1f4)[_0xdf3c('0xdb')](new db['Sequelize'][(_0xdf3c('0xd8'))](_0xdf3c('0xdc')));}if(_[_0xdf3c('0x94')](_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x65')])||_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x65')]===''){throw _0x158c75[_0xdf3c('0x27')](0x1f4)['send'](new db[(_0xdf3c('0xd7'))][(_0xdf3c('0xd8'))](_0xdf3c('0xdd')));}if(_['isNil'](_0x31391d[_0xdf3c('0x65')][_0xdf3c('0xde')])){throw _0x158c75[_0xdf3c('0x27')](0x1f4)[_0xdf3c('0xdb')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x299dc3));}if(!_['includes'](_0x299dc3,_0x31391d[_0xdf3c('0x65')][_0xdf3c('0xde')])){throw _0x158c75[_0xdf3c('0x27')](0x1f4)[_0xdf3c('0xdb')](new db[(_0xdf3c('0xd7'))][(_0xdf3c('0xd8'))](_0xdf3c('0xdf')+_0x299dc3));}_0x4c3c70[_0x31391d['body'][_0xdf3c('0xde')]]=_0x31391d['body'][_0xdf3c('0x9f')];})[_0xdf3c('0x2f')](function(){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x31391d[_0xdf3c('0x61')]['id']},'include':[{'model':db[_0xdf3c('0xaa')],'as':_0xdf3c('0xab')},{'model':db[_0xdf3c('0xe0')],'as':'MailAccount'}]});})[_0xdf3c('0x2f')](handleEntityNotFound(_0x158c75,null))[_0xdf3c('0x2f')](function(_0x474e78){if(_0x474e78&&_0x474e78[_0xdf3c('0xab')]){_0xdc8438=_0x474e78;var _0x25bc5a=_['defaults'](_0x31391d['body'],{'firstName':_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x9f')],'phone':_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x9f')],'ListId':_0x474e78[_0xdf3c('0xb7')]});_0x25bc5a[_0x31391d[_0xdf3c('0x65')][_0xdf3c('0xde')]]=_0x31391d[_0xdf3c('0x65')][_0xdf3c('0x9f')];return db[_0xdf3c('0xac')][_0xdf3c('0xe1')]({'where':_0x4c3c70,'defaults':_0x25bc5a});}})['spread'](function(_0x345a7b){if(_0x345a7b){_0x4727f2=_0x345a7b;var _0x14a995=fs[_0xdf3c('0xe2')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0xe3')),_0xdf3c('0xe4'));var _0x4e8ad8=ejs[_0xdf3c('0xe5')](_0x14a995,{'body':_['toPairs'](_0x31391d[_0xdf3c('0x65')]['body']),'bodyTitle':_0xdc8438[_0xdf3c('0xe6')]});return db[_0xdf3c('0xe7')]['create']({'body':_0x4e8ad8,'plainBody':htmlToText['fromString'](_0x4e8ad8),'ContactId':_0x345a7b['id'],'ChatWebsiteId':_0xdc8438['id']});}})[_0xdf3c('0x2f')](function(_0x10b2d9){_0x11a887=_0x10b2d9;if(_0x352c54[_0xdf3c('0x63')]){var _0x31d7d7=_0x352c54[_0xdf3c('0x4b')](function(_0x50e6e7){return{'name':_0x50e6e7[_0xdf3c('0xe8')],'basename':_0x50e6e7[_0xdf3c('0x82')],'type':_0x50e6e7[_0xdf3c('0xe9')],'ChatOfflineMessageId':_0x10b2d9['id']};});_0x40c59b=_0x31d7d7[_0xdf3c('0x4b')](_0x40944d=>{var _0x5b6c9a={'filename':_0x40944d[_0xdf3c('0x3f')],'path':path['join'](config[_0xdf3c('0x89')],'server','files',_0xdf3c('0xea'),_0xdf3c('0xeb'),_0x40944d[_0xdf3c('0xec')])};return _0x5b6c9a;});if(!_0xdc8438[_0xdf3c('0xed')]){return db[_0xdf3c('0xee')]['transaction'](function(_0xd3d760){return db[_0xdf3c('0xef')]['bulkCreate'](_0x31d7d7,{'transaction':_0xd3d760});});}}})[_0xdf3c('0x2f')](function(){if(_0x11a887){_0x7554e2=_0x11a887;return db[_0xdf3c('0xe0')][_0xdf3c('0x7d')]({'where':{'service':!![]},'include':[{'model':db[_0xdf3c('0xf0')],'as':_0xdf3c('0xf1'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xdf3c('0xf2'),'raw':!![]}]}]});}})[_0xdf3c('0x2f')](function(_0x25ed77){if(_0x25ed77&&_0x25ed77[_0xdf3c('0xf1')]&&_0xdc8438[_0xdf3c('0xf3')]&&_0xdc8438['forwardOfflineAddress']){var _0x2cf46=_0x25ed77[_0xdf3c('0xf4')]();return respondWithRpcPromise(_0xdf3c('0xf5'),_0xdf3c('0xf6'),{'account':_0x2cf46,'message':{'from':util[_0xdf3c('0x41')](_0xdf3c('0xf7'),_0x25ed77[_0xdf3c('0x3f')],_0x25ed77[_0xdf3c('0xf8')]||_0x25ed77[_0xdf3c('0xf1')][_0xdf3c('0x6b')]),'to':_0xdc8438[_0xdf3c('0xf9')],'subject':_0xdc8438[_0xdf3c('0xfa')],'html':_0x7554e2[_0xdf3c('0x65')],'attachments':_0x40c59b}},client9003)[_0xdf3c('0x2f')](function(){return _0x7554e2;})[_0xdf3c('0x25')](function(_0x2be6c7){logger[_0xdf3c('0x21')](_0x2be6c7);});}})[_0xdf3c('0x2f')](function(){if(_0xdc8438&&_0xdc8438['openNewInteraction']&&_0xdc8438[_0xdf3c('0xfb')]){var _0x350e07=[];if(_0x352c54[_0xdf3c('0x63')]){_0x350e07=_0x352c54['map'](function(_0xb9f71c){return{'name':_0xb9f71c['originalname'],'basename':_0xb9f71c[_0xdf3c('0x82')],'type':_0xb9f71c['mimetype'],'ChatOfflineMessageId':_0x11a887['id']};});}var _0x425ddb;if(!_[_0xdf3c('0x94')](_0xdc8438[_0xdf3c('0xfc')])){var _0xd9aaa5=_[_0xdf3c('0x4b')](_0x31391d[_0xdf3c('0x65')],function(_0xd8be1){return _0xd8be1;});var _0x4642ca=_[_0xdf3c('0xfd')](_0xd9aaa5)[0x0];var _0x4e3a41=_[_0xdf3c('0xfe')](_0x4642ca,function(_0x3e3d63){return _0x3e3d63;});_0x425ddb=_0x4e3a41[0x1][_0xdc8438[_0xdf3c('0xfc')]];}var _0x2964ed={'from':_0x4727f2['email'],'firstName':_0x4727f2['firstName'],'lastName':_0x4727f2[_0xdf3c('0x3b')],'mapKey':_0xdf3c('0xf8'),'message':{'from':_0x4727f2[_0xdf3c('0xf8')],'to':_0xdc8438[_0xdf3c('0xe0')]['email'],'cc':'','subject':_[_0xdf3c('0x94')](_0x425ddb)?_0xdc8438['offlineMessageSubject']:_0x425ddb,'messageId':'','sentAt':new Date(),'attach':_0x350e07['length'],'attachments':_0x350e07,'originChannel':_0xdf3c('0xff'),'ChatWebsiteId':_0xdc8438['id'],'ChatOfflineMessageId':_0x7554e2['id'],'originTo':_0xdc8438[_0xdf3c('0xe0')]['email']},'body':_0x7554e2[_0xdf3c('0x65')]};var _0x19024e={'account':{'id':_0xdc8438['MailAccountId']},'body':_0x2964ed,'log':_0xdf3c('0x100')};return respondWithRpcPromise(_0xdf3c('0x100'),'notifyMail',_0x19024e,client9001)[_0xdf3c('0x2f')](function(){return _0x7554e2;})[_0xdf3c('0x25')](function(_0x119524){logger[_0xdf3c('0x21')](_0x119524);});}return;})[_0xdf3c('0x2f')](function(){if(_0x7554e2){return _0x7554e2;}})[_0xdf3c('0x2f')](respondWithResult(_0x158c75,null))['catch'](function(){for(var _0x5291d8 of _0x352c54){var _0x1a79a1=path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],_0xdf3c('0x101'),_0xdf3c('0x102'),_0xdf3c('0xea'),'offline-chat',_0x5291d8[_0xdf3c('0x82')]);fs_extra[_0xdf3c('0x103')](_0x1a79a1)[_0xdf3c('0x25')](function(_0xb25239){logger['error'](_0xdf3c('0x104'),_0x1a79a1,_0xb25239);});}});};exports[_0xdf3c('0x105')]=function(_0x50d59a,_0x112e4){return db[_0xdf3c('0xbc')][_0xdf3c('0x64')]({'where':{'id':_0x50d59a[_0xdf3c('0x61')]['id']}})['then'](handleEntityNotFound(_0x112e4,null))[_0xdf3c('0x2f')](function(_0xcb362a){if(_0xcb362a){return _0xcb362a[_0xdf3c('0x105')](_0x50d59a[_0xdf3c('0x65')]['ids'],_['omit'](_0x50d59a[_0xdf3c('0x65')],[_0xdf3c('0x7a'),'id'])||{});}})[_0xdf3c('0x2f')](respondWithResult(_0x112e4,null))[_0xdf3c('0x25')](handleError(_0x112e4,null));};exports[_0xdf3c('0x106')]=function(_0x3eb7b2,_0x3fec35){var _0x2fefc1={'raw':![],'where':{}};var _0x5b8dc4={};var _0x375d8d={'count':0x0,'rows':[]};return db[_0xdf3c('0x4c')]['findOne']({'where':{'id':_0x3eb7b2[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x3fec35,null))['then'](function(_0x3d497d){if(_0x3d497d){_0x5b8dc4['model']=_[_0xdf3c('0x50')](db[_0xdf3c('0xbc')][_0xdf3c('0x4d')]);_0x5b8dc4[_0xdf3c('0x4f')]=_['keys'](_0x3eb7b2['query']);_0x5b8dc4['filters']=_[_0xdf3c('0x62')](_0x5b8dc4[_0xdf3c('0x45')],_0x5b8dc4[_0xdf3c('0x4f')]);_0x2fefc1[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0x5b8dc4[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x3eb7b2['query'][_0xdf3c('0x53')]));_0x2fefc1[_0xdf3c('0x52')]=_0x2fefc1['attributes'][_0xdf3c('0x63')]?_0x2fefc1['attributes']:_0x5b8dc4[_0xdf3c('0x45')];if(!_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x54')]('nolimit')){_0x2fefc1[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x2b')]);_0x2fefc1[_0xdf3c('0x29')]=qs['offset'](_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x29')]);}_0x2fefc1[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0x2fefc1[_0xdf3c('0x58')]=qs['filters'](_[_0xdf3c('0x76')](_0x3eb7b2[_0xdf3c('0x4f')],_0x5b8dc4[_0xdf3c('0x51')]));_0x2fefc1['where'][_0xdf3c('0x77')]=_0x3d497d['id'];if(_0x3eb7b2['query'][_0xdf3c('0x59')]){_0x2fefc1[_0xdf3c('0x58')]=_['merge'](_0x2fefc1[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x2fefc1[_0xdf3c('0x52')],function(_0x27a534){var _0x45a467={};_0x45a467[_0x27a534]={'$like':'%'+_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x45a467;})});}_0x2fefc1=_[_0xdf3c('0x5a')]({},_0x2fefc1,_0x3eb7b2[_0xdf3c('0x78')]);return db[_0xdf3c('0xbc')][_0xdf3c('0x2c')]({'where':_0x2fefc1[_0xdf3c('0x58')]})['then'](function(_0x2888e3){_0x375d8d['count']=_0x2888e3;if(_0x3eb7b2['query']['includeAll']){_0x2fefc1['include']=[{'model':db[_0xdf3c('0xac')],'as':_0xdf3c('0x107'),'required':![]},{'model':db[_0xdf3c('0xcc')],'as':_0xdf3c('0x108'),'attributes':[_0xdf3c('0x3f'),_0xdf3c('0x109'),'internal'],'required':![]},{'model':db[_0xdf3c('0x10a')],'as':'Tags','attributes':['id',_0xdf3c('0x3f'),_0xdf3c('0x10b')],'where':_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x10c')]?{'id':_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x10c')]}:undefined,'required':_0x3eb7b2[_0xdf3c('0x4f')][_0xdf3c('0x10c')]?!![]:![]}];}return db[_0xdf3c('0xbc')]['findAll'](_0x2fefc1);})[_0xdf3c('0x2f')](function(_0x258b2d){_0x375d8d[_0xdf3c('0x5f')]=_0x258b2d;return _0x375d8d;});}})[_0xdf3c('0x2f')](respondWithFilteredResult(_0x3fec35,_0x2fefc1))['catch'](handleError(_0x3fec35,null));};exports['getSnippet']=function(_0x1a1ac0,_0x22d16f){var _0x427a90=0x0;var _0x5f557c=0x0;var _0x559e83=![];var _0x2fc1d8;var _0x2c2775;return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x1a1ac0[_0xdf3c('0x61')]['id']},'include':[{'model':db[_0xdf3c('0x9b')],'as':_0xdf3c('0x9b'),'include':[{'model':db['Interval'],'as':_0xdf3c('0xb1'),'attributes':['id',_0xdf3c('0xb2')]}]}]})[_0xdf3c('0x2f')](handleEntityNotFound(_0x22d16f,null))[_0xdf3c('0x2f')](function(_0x367df9){if(_0x367df9){_0x2fc1d8=_0x367df9;return _0x367df9[_0xdf3c('0x10d')]({'raw':!![]});}})['then'](function(_0x4cfc67){if(_0x2fc1d8){if(_0x4cfc67){_0x2c2775=_0x4cfc67;}}return require(_0xdf3c('0x8b'))[_0xdf3c('0x8c')]();})[_0xdf3c('0x2f')](function(_0x1b2961){if(_0x1b2961){_0x5f557c=_0x1b2961[_0xdf3c('0x10e')];_0x559e83=_0x1b2961['custom'];}})[_0xdf3c('0x2f')](function(){return db[_0xdf3c('0xbc')][_0xdf3c('0x2c')]({'where':{'closed':![]}});})[_0xdf3c('0x2f')](function(_0x2cab31){_0x427a90=_0x2cab31;if(_0x5f557c&&_0x2cab31>_0x5f557c){return db[_0xdf3c('0x10f')]['findOne']({'where':{'id':0x1}})[_0xdf3c('0x2f')](function(_0x462195){if(_0x462195){_0x462195['increment'](_0xdf3c('0x110'));}});}})['then'](function(){var _0x32c476=_0x2fc1d8[_0xdf3c('0x9b')];var _0xa6fa19=_0x2fc1d8[_0xdf3c('0x111')]||undefined;return _0x32c476?_0x32c476['ifTime'](_0xa6fa19):!![];})['then'](function(_0xa523c8){var _0x52ae27=fs[_0xdf3c('0xe2')](path[_0xdf3c('0x88')](config[_0xdf3c('0x89')],'server/files/chat/iframe.ejs'),_0xdf3c('0xe4'));var _0x148785=_0xdf3c('0x112');var _0x2b0e64=![];var _0x479252,_0x5696dd;if(_0x1a1ac0[_0xdf3c('0xb9')]['referer']){_0x479252=new URL(_0x1a1ac0[_0xdf3c('0xb9')][_0xdf3c('0x3d')])[_0xdf3c('0x113')];}else if(_0x1a1ac0[_0xdf3c('0xb9')][_0xdf3c('0x113')]){_0x479252=new URL(_0x1a1ac0['headers'][_0xdf3c('0x113')])[_0xdf3c('0x113')];}else{_0x479252=_0xdf3c('0x114');}_0x5696dd=typeof _0x2fc1d8['address'][_0xdf3c('0x39')](',')[_0xdf3c('0x64')](function(_0x8f769e){return wildcardUtils[_0xdf3c('0x115')](_0x8f769e,_0x479252);})!==_0xdf3c('0x2a');var _0xc2306c={'chatVersion':_0x148785,'chatWebsiteAddressOrigin':_0x5696dd?_0x479252:_0x2fc1d8[_0xdf3c('0x66')],'remote':_0x2fc1d8['remote'],'query':querystring['stringify'](_[_0xdf3c('0x5a')](_0x2fc1d8['get']({'plain':!![]}),{'customerIp':_0x1a1ac0[_0xdf3c('0xb9')][_0xdf3c('0x38')]||_0x1a1ac0[_0xdf3c('0xb9')][_0xdf3c('0x116')]||_0x1a1ac0['connection'][_0xdf3c('0x117')]||_0x1a1ac0['ip'],'referer':_0x1a1ac0['headers'][_0xdf3c('0x3d')],'openedInteractions':_0x427a90,'maxInteractions':_0x5f557c,'virtual':_0x559e83['virtual'],'online':_0xa523c8,'custom':_0x559e83,'address':_0x5696dd?_0x479252:null}))[_0xdf3c('0x118')](/'/g,'\x5c\x27')};_0x22d16f[_0xdf3c('0xdb')](ejs[_0xdf3c('0xe5')](Mustache[_0xdf3c('0xe5')](_0x52ae27,_0xc2306c),{'proactiveActions':_0x2c2775,'alignment':_0x2fc1d8[_0xdf3c('0x119')],'verticalAlignment':_0x2fc1d8[_0xdf3c('0x11a')],'div_color':_0x2fc1d8[_0xdf3c('0x10b')],'labelText':_0x2fc1d8['labelText'],'text_color':_0x2fc1d8[_0xdf3c('0x11b')],'text_button_color':_0x2fc1d8[_0xdf3c('0x11c')],'button_color':_0x2fc1d8[_0xdf3c('0x11d')],'background_color':_0x2fc1d8[_0xdf3c('0x11e')],'hideWhenOffline':_0x2fc1d8['hideWhenOffline'],'intervalId':_0x2fc1d8[_0xdf3c('0x11f')],'isDevelopment':_0x2b0e64,'chatVersion':_0x148785}));})[_0xdf3c('0x25')](handleError(_0x22d16f,null));};exports[_0xdf3c('0x120')]=function(_0x2ac5c7,_0x361143){var _0x526533=_0x2ac5c7['params']['id'];var _0x54a06b=_0x2ac5c7[_0xdf3c('0x65')];var _0x47bef6=0xc8;var _0x3ff664=null;return db['sequelize'][_0xdf3c('0x121')]({'isolationLevel':db[_0xdf3c('0xee')][_0xdf3c('0x122')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4dd133){return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x526533},'transaction':_0x4dd133})['then'](function(_0x3819cd){if(_0x3819cd){return db[_0xdf3c('0xaf')][_0xdf3c('0x32')]({'where':{'ChatWebsiteId':_0x526533},'transaction':_0x4dd133})[_0xdf3c('0x2f')](function(){var _0xa729d1=_[_0xdf3c('0x4b')](_0x54a06b,function(_0x2e0bf3){_0x2e0bf3[_0xdf3c('0x77')]=_0x526533;return _0x2e0bf3;});return db['ChatApplication'][_0xdf3c('0x123')](_0xa729d1,{'transaction':_0x4dd133});});}else{_0x47bef6=0x194;_0x3ff664=[];}});})[_0xdf3c('0x2f')](function(){if(_0x47bef6!==0x194){return db[_0xdf3c('0xaf')][_0xdf3c('0x124')]({'where':{'ChatWebsiteId':_0x526533},'order':_0xdf3c('0x125')})['then'](function(_0x461212){_0x3ff664=_0x461212;});}})[_0xdf3c('0x25')](function(_0x41f47a){_0x47bef6=0x1f4;logger[_0xdf3c('0x21')](_0x41f47a[_0xdf3c('0x33')]);if(_0x41f47a[_0xdf3c('0x3f')]){delete _0x41f47a['name'];}_0x3ff664=_0x41f47a;})[_0xdf3c('0x126')](function(){if(_0x3ff664===null){_0x361143['sendStatus'](_0x47bef6);}else{if(_0x47bef6===0x1f4){_0x361143[_0xdf3c('0x27')](_0x47bef6)[_0xdf3c('0xdb')](_0x3ff664);}else{_0x361143[_0xdf3c('0x27')](_0x47bef6)[_0xdf3c('0x28')](_0x3ff664);}}});};exports[_0xdf3c('0x127')]=function(_0x2724b6,_0x3c1a8a){var _0x3b0c07={};var _0x40506e={};var _0x4b46cf;var _0x31cdad;return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x2724b6['params']['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x3c1a8a,null))['then'](function(_0xddf03e){if(_0xddf03e){_0x4b46cf=_0xddf03e;_0x40506e[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db[_0xdf3c('0xaf')][_0xdf3c('0x4d')]);_0x40506e[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x2724b6[_0xdf3c('0x4f')]);_0x40506e[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0x40506e[_0xdf3c('0x45')],_0x40506e[_0xdf3c('0x4f')]);_0x3b0c07['attributes']=_['intersection'](_0x40506e['model'],qs[_0xdf3c('0x53')](_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x3b0c07[_0xdf3c('0x52')]=_0x3b0c07[_0xdf3c('0x52')][_0xdf3c('0x63')]?_0x3b0c07[_0xdf3c('0x52')]:_0x40506e[_0xdf3c('0x45')];_0x3b0c07[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x57')]);_0x3b0c07[_0xdf3c('0x58')]=qs['filters'](_['pick'](_0x2724b6[_0xdf3c('0x4f')],_0x40506e[_0xdf3c('0x51')]));if(_0x2724b6[_0xdf3c('0x4f')]['filter']){_0x3b0c07[_0xdf3c('0x58')]=_['merge'](_0x3b0c07[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x3b0c07['attributes'],function(_0xabf05c){var _0x2e4a90={};_0x2e4a90[_0xabf05c]={'$like':'%'+_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x2e4a90;})});}_0x3b0c07=_[_0xdf3c('0x5a')]({},_0x3b0c07,_0x2724b6[_0xdf3c('0x78')]);return _0x4b46cf[_0xdf3c('0x127')](_0x3b0c07);}})[_0xdf3c('0x2f')](function(_0x5e6a87){if(_0x5e6a87){_0x31cdad=_0x5e6a87[_0xdf3c('0x63')];if(!_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x54')](_0xdf3c('0x55'))){_0x3b0c07['limit']=qs['limit'](_0x2724b6[_0xdf3c('0x4f')][_0xdf3c('0x2b')]);_0x3b0c07[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x2724b6['query']['offset']);}return _0x4b46cf[_0xdf3c('0x127')](_0x3b0c07);}})[_0xdf3c('0x2f')](function(_0x381d88){if(_0x381d88){return _0x381d88?{'count':_0x31cdad,'rows':_0x381d88}:null;}})['then'](respondWithResult(_0x3c1a8a,null))[_0xdf3c('0x25')](handleError(_0x3c1a8a,null));};exports['addProactiveActions']=function(_0x10bdce,_0x3cb78b){return db[_0xdf3c('0x128')]['find']({'where':{'id':_0x10bdce['params']['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x3cb78b,null))[_0xdf3c('0x2f')](function(_0x3c0d93){if(_0x3c0d93){return _0x3c0d93['addProactiveActions'](_0x10bdce[_0xdf3c('0x65')][_0xdf3c('0x7a')],_['omit'](_0x10bdce[_0xdf3c('0x65')],[_0xdf3c('0x7a'),'id'])||{});}})[_0xdf3c('0x2f')](respondWithResult(_0x3cb78b,null))[_0xdf3c('0x25')](handleError(_0x3cb78b,null));};exports[_0xdf3c('0x10d')]=function(_0x3e8060,_0x1d61c5){var _0x7d5fda={};var _0x9f1875={};var _0x21e823;var _0xd66ea7;return db['ChatWebsite'][_0xdf3c('0x7d')]({'where':{'id':_0x3e8060[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x1d61c5,null))['then'](function(_0x6cce5f){if(_0x6cce5f){_0x21e823=_0x6cce5f;_0x9f1875[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db[_0xdf3c('0x129')]['rawAttributes']);_0x9f1875[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x3e8060[_0xdf3c('0x4f')]);_0x9f1875[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0x9f1875[_0xdf3c('0x45')],_0x9f1875['query']);_0x7d5fda[_0xdf3c('0x52')]=_['intersection'](_0x9f1875[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x3e8060[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x7d5fda[_0xdf3c('0x52')]=_0x7d5fda[_0xdf3c('0x52')][_0xdf3c('0x63')]?_0x7d5fda[_0xdf3c('0x52')]:_0x9f1875['model'];_0x7d5fda[_0xdf3c('0x56')]=qs['sort'](_0x3e8060[_0xdf3c('0x4f')]['sort']);_0x7d5fda['where']=qs[_0xdf3c('0x51')](_[_0xdf3c('0x76')](_0x3e8060['query'],_0x9f1875[_0xdf3c('0x51')]));if(_0x3e8060['query']['filter']){_0x7d5fda[_0xdf3c('0x58')]=_[_0xdf3c('0x5a')](_0x7d5fda[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x7d5fda[_0xdf3c('0x52')],function(_0x4280ac){var _0x2a2447={};_0x2a2447[_0x4280ac]={'$like':'%'+_0x3e8060[_0xdf3c('0x4f')]['filter']+'%'};return _0x2a2447;})});}_0x7d5fda=_[_0xdf3c('0x5a')]({},_0x7d5fda,_0x3e8060[_0xdf3c('0x78')]);return _0x21e823[_0xdf3c('0x10d')](_0x7d5fda);}})[_0xdf3c('0x2f')](function(_0x69233c){if(_0x69233c){_0xd66ea7=_0x69233c[_0xdf3c('0x63')];if(!_0x3e8060['query'][_0xdf3c('0x54')](_0xdf3c('0x55'))){_0x7d5fda[_0xdf3c('0x2b')]=qs[_0xdf3c('0x2b')](_0x3e8060['query']['limit']);_0x7d5fda[_0xdf3c('0x29')]=qs['offset'](_0x3e8060[_0xdf3c('0x4f')]['offset']);}return _0x21e823[_0xdf3c('0x10d')](_0x7d5fda);}})[_0xdf3c('0x2f')](function(_0x58d739){if(_0x58d739){return _0x58d739?{'count':_0xd66ea7,'rows':_0x58d739}:null;}})[_0xdf3c('0x2f')](respondWithResult(_0x1d61c5,null))[_0xdf3c('0x25')](handleError(_0x1d61c5,null));};exports[_0xdf3c('0x12a')]=function(_0x346270,_0x2c732e){var _0x396f50=_0x346270['query']['online']===_0xdf3c('0x12b')?'offlineForm':_0xdf3c('0x12c');return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'attributes':['id',_0x396f50],'where':{'id':_0x346270[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x2c732e,null))[_0xdf3c('0x2f')](function(_0x5ef7a6){if(_0x5ef7a6){var _0x54acce=_0x5ef7a6[_0x396f50];var _0x58a7b7=_0x54acce&&_0x54acce[_0xdf3c('0x12d')]?_0x54acce['items']:[];_0x2c732e[_0xdf3c('0xdb')]({'fromKey':_[_0xdf3c('0x94')](_0x54acce['fromKey'])?undefined:_0x54acce[_0xdf3c('0x12e')],'count':_0x58a7b7[_0xdf3c('0x63')],'rows':_0x58a7b7});}})[_0xdf3c('0x25')](handleError(_0x2c732e,null));};exports[_0xdf3c('0x12f')]=function(_0x2beff1,_0x4264e6){var _0x26dbe6={'raw':![],'where':{}};var _0xdb9eb4={};var _0x5adb7b={'count':0x0,'rows':[]};return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x2beff1[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x4264e6,null))[_0xdf3c('0x2f')](function(_0x120f66){if(_0x120f66){_0xdb9eb4[_0xdf3c('0x45')]=_[_0xdf3c('0x50')](db[_0xdf3c('0xe7')][_0xdf3c('0x4d')]);_0xdb9eb4[_0xdf3c('0x4f')]=_[_0xdf3c('0x50')](_0x2beff1[_0xdf3c('0x4f')]);_0xdb9eb4[_0xdf3c('0x51')]=_[_0xdf3c('0x62')](_0xdb9eb4['model'],_0xdb9eb4[_0xdf3c('0x4f')]);_0x26dbe6['attributes']=_[_0xdf3c('0x62')](_0xdb9eb4[_0xdf3c('0x45')],qs['fields'](_0x2beff1[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x26dbe6['attributes']=_0x26dbe6[_0xdf3c('0x52')][_0xdf3c('0x63')]?_0x26dbe6[_0xdf3c('0x52')]:_0xdb9eb4[_0xdf3c('0x45')];if(!_0x2beff1['query']['hasOwnProperty'](_0xdf3c('0x55'))){_0x26dbe6[_0xdf3c('0x2b')]=qs['limit'](_0x2beff1[_0xdf3c('0x4f')][_0xdf3c('0x2b')]);_0x26dbe6[_0xdf3c('0x29')]=qs[_0xdf3c('0x29')](_0x2beff1[_0xdf3c('0x4f')][_0xdf3c('0x29')]);}_0x26dbe6[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x2beff1['query'][_0xdf3c('0x57')]);_0x26dbe6[_0xdf3c('0x58')]=qs[_0xdf3c('0x51')](_[_0xdf3c('0x76')](_0x2beff1[_0xdf3c('0x4f')],_0xdb9eb4[_0xdf3c('0x51')]));_0x26dbe6[_0xdf3c('0x58')]['ChatWebsiteId']=_0x120f66['id'];if(_0x2beff1[_0xdf3c('0x4f')][_0xdf3c('0x59')]){_0x26dbe6[_0xdf3c('0x58')]=_[_0xdf3c('0x5a')](_0x26dbe6[_0xdf3c('0x58')],{'$or':_[_0xdf3c('0x4b')](_0x26dbe6[_0xdf3c('0x52')],function(_0x14d34d){var _0x367cf0={};_0x367cf0[_0x14d34d]={'$like':'%'+_0x2beff1[_0xdf3c('0x4f')]['filter']+'%'};return _0x367cf0;})});}_0x26dbe6=_[_0xdf3c('0x5a')]({},_0x26dbe6,_0x2beff1[_0xdf3c('0x78')]);return db[_0xdf3c('0xe7')][_0xdf3c('0x2c')]({'where':_0x26dbe6[_0xdf3c('0x58')]})[_0xdf3c('0x2f')](function(_0x82b7ee){_0x5adb7b[_0xdf3c('0x2c')]=_0x82b7ee;if(_0x2beff1['query']['includeAll']){_0x26dbe6[_0xdf3c('0x5d')]=[{'all':!![]}];}else{_0x26dbe6['include']=[{'model':db[_0xdf3c('0xac')],'as':_0xdf3c('0x107'),'required':![]},{'model':db[_0xdf3c('0xef')],'as':_0xdf3c('0x130'),'required':![]}];}return db[_0xdf3c('0xe7')]['findAll'](_0x26dbe6);})[_0xdf3c('0x2f')](function(_0xf864e2){_0x5adb7b[_0xdf3c('0x5f')]=_0xf864e2;return _0x5adb7b;});}})[_0xdf3c('0x2f')](respondWithFilteredResult(_0x4264e6,_0x26dbe6))[_0xdf3c('0x25')](handleError(_0x4264e6,null));};exports['addAgents']=function(_0x4fcf64,_0x471f69){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x4fcf64[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x471f69,null))[_0xdf3c('0x2f')](function(_0x4fe59c){if(_0x4fe59c){return _0x4fe59c[_0xdf3c('0x131')](_0x4fcf64[_0xdf3c('0x65')][_0xdf3c('0x7a')],_['omit'](_0x4fcf64['body'],[_0xdf3c('0x7a'),'id'])||{})['spread'](function(_0x4dc604){for(var _0x136935=0x0;_0x136935<_0x4fcf64[_0xdf3c('0x65')]['ids'][_0xdf3c('0x63')];_0x136935+=0x1){socket[_0xdf3c('0x132')](_0xdf3c('0x133'),{'UserId':Number(_0x4fcf64[_0xdf3c('0x65')][_0xdf3c('0x7a')][_0x136935]),'ChatWebsiteId':Number(_0x4fcf64[_0xdf3c('0x61')]['id'])});}return _0x4dc604;});}})[_0xdf3c('0x2f')](respondWithResult(_0x471f69,null))['catch'](handleError(_0x471f69,null));};exports['removeAgents']=function(_0x3dc2da,_0x413aa3){return db[_0xdf3c('0x4c')][_0xdf3c('0x64')]({'where':{'id':_0x3dc2da[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x413aa3,null))[_0xdf3c('0x2f')](function(_0x20e6b0){if(_0x20e6b0){return _0x20e6b0[_0xdf3c('0x134')](_0x3dc2da[_0xdf3c('0x4f')][_0xdf3c('0x7a')])[_0xdf3c('0x2f')](function(){if(_['isArray'](_0x3dc2da[_0xdf3c('0x4f')][_0xdf3c('0x7a')])){for(var _0x20d58c=0x0;_0x20d58c<_0x3dc2da[_0xdf3c('0x4f')][_0xdf3c('0x7a')][_0xdf3c('0x63')];_0x20d58c+=0x1){socket[_0xdf3c('0x132')](_0xdf3c('0x135'),{'UserId':Number(_0x3dc2da[_0xdf3c('0x4f')][_0xdf3c('0x7a')][_0x20d58c]),'ChatWebsiteId':Number(_0x3dc2da['params']['id'])});}}else{socket[_0xdf3c('0x132')](_0xdf3c('0x135'),{'UserId':Number(_0x3dc2da[_0xdf3c('0x4f')]['ids']),'ChatWebsiteId':Number(_0x3dc2da[_0xdf3c('0x61')]['id'])});}});}})[_0xdf3c('0x2f')](respondWithStatusCode(_0x413aa3,null))[_0xdf3c('0x25')](handleError(_0x413aa3,null));};exports[_0xdf3c('0x136')]=function(_0x5226da,_0x1c9417){var _0x5e7070={};var _0xd096c7={};var _0x2af066;var _0x4a9157;return db[_0xdf3c('0x4c')][_0xdf3c('0x7d')]({'where':{'id':_0x5226da[_0xdf3c('0x61')]['id']}})[_0xdf3c('0x2f')](handleEntityNotFound(_0x1c9417,null))['then'](function(_0x5b59e6){if(_0x5b59e6){_0x2af066=_0x5b59e6;_0xd096c7[_0xdf3c('0x45')]=_['keys'](db[_0xdf3c('0xcc')]['rawAttributes']);_0xd096c7[_0xdf3c('0x4f')]=_['keys'](_0x5226da[_0xdf3c('0x4f')]);_0xd096c7[_0xdf3c('0x51')]=_['intersection'](_0xd096c7[_0xdf3c('0x45')],_0xd096c7['query']);_0x5e7070[_0xdf3c('0x52')]=_[_0xdf3c('0x62')](_0xd096c7[_0xdf3c('0x45')],qs[_0xdf3c('0x53')](_0x5226da[_0xdf3c('0x4f')][_0xdf3c('0x53')]));_0x5e7070['attributes']=_0x5e7070['attributes'][_0xdf3c('0x63')]?_0x5e7070['attributes']:_0xd096c7[_0xdf3c('0x45')];_0x5e7070[_0xdf3c('0x56')]=qs[_0xdf3c('0x57')](_0x5226da['query'][_0xdf3c('0x57')]);_0x5e7070[_0xdf3c('0x58')]=qs['filters'](_['pick'](_0x5226da[_0xdf3c('0x4f')],_0xd096c7['filters']));if(_0x5226da[_0xdf3c('0x4f')][_0xdf3c('0x59')]){_0x5e7070[_0xdf3c('0x58')]=_[_0xdf3c('0x5a')](_0x5e7070['where'],{'$or':_['map'](_0x5e7070[_0xdf3c('0x52')],function(_0xc5ad19){var _0x275ac3={};_0x275ac3[_0xc5ad19]={'$like':'%'+_0x5226da[_0xdf3c('0x4f')][_0xdf3c('0x59')]+'%'};return _0x275ac3;})});}_0x5e7070=_['merge']({},_0x5e7070,_0x5226da[_0xdf3c('0x78')]);return _0x2af066[_0xdf3c('0x136')](_0x5e7070);}})[_0xdf3c('0x2f')](function(_0x17a760){if(_0x17a760){_0x4a9157=_0x17a760[_0xdf3c('0x63')];if(!_0x5226da[_0xdf3c('0x4f')]['hasOwnProperty'](_0xdf3c('0x55'))){_0x5e7070['limit']=qs[_0xdf3c('0x2b')](_0x5226da['query'][_0xdf3c('0x2b')]);_0x5e7070[_0xdf3c('0x29')]=qs['offset'](_0x5226da[_0xdf3c('0x4f')]['offset']);}return _0x2af066[_0xdf3c('0x136')](_0x5e7070);}})[_0xdf3c('0x2f')](function(_0x241f9d){if(_0x241f9d){return _0x241f9d?{'count':_0x4a9157,'rows':_0x241f9d}:null;}})[_0xdf3c('0x2f')](respondWithResult(_0x1c9417,null))[_0xdf3c('0x25')](handleError(_0x1c9417,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 539a5c4..3e250b6 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 _0x1159=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2a9d67,_0x57758f){var _0x30ed3f=function(_0x55f792){while(--_0x55f792){_0x2a9d67['push'](_0x2a9d67['shift']());}};_0x30ed3f(++_0x57758f);}(_0x1159,0xf3));var _0x9115=function(_0x352a71,_0x1041d4){_0x352a71=_0x352a71-0x0;var _0xb43935=_0x1159[_0x352a71];return _0xb43935;};'use strict';var EventEmitter=require(_0x9115('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9115('0x1')](0x0);var events={'afterCreate':_0x9115('0x2'),'afterUpdate':_0x9115('0x3'),'afterDestroy':_0x9115('0x4')};function emitEvent(_0x4554f6){return function(_0x4661fc,_0xe754b3,_0x45234e){ChatWebsiteEvents['emit'](_0x4554f6+':'+_0x4661fc['id'],_0x4661fc);ChatWebsiteEvents[_0x9115('0x5')](_0x4554f6,_0x4661fc);_0x45234e(null);};}for(var e in events){if(events[_0x9115('0x6')](e)){var event=events[e];ChatWebsite[_0x9115('0x7')](e,emitEvent(event));}}module[_0x9115('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x87df=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x12813f,_0x38ae10){var _0x313ce3=function(_0x4006fe){while(--_0x4006fe){_0x12813f['push'](_0x12813f['shift']());}};_0x313ce3(++_0x38ae10);}(_0x87df,0x167));var _0xf87d=function(_0x3fc287,_0x5c3f36){_0x3fc287=_0x3fc287-0x0;var _0x33af9f=_0x87df[_0x3fc287];return _0x33af9f;};'use strict';var EventEmitter=require(_0xf87d('0x0'));var ChatWebsite=require(_0xf87d('0x1'))['db'][_0xf87d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf87d('0x3')](0x0);var events={'afterCreate':_0xf87d('0x4'),'afterUpdate':_0xf87d('0x5'),'afterDestroy':_0xf87d('0x6')};function emitEvent(_0xb0fb5a){return function(_0x25290a,_0x1d4ff6,_0x4fbca2){ChatWebsiteEvents['emit'](_0xb0fb5a+':'+_0x25290a['id'],_0x25290a);ChatWebsiteEvents[_0xf87d('0x7')](_0xb0fb5a,_0x25290a);_0x4fbca2(null);};}for(var e in events){if(events[_0xf87d('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xf87d('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 130aa5f..7ea285b 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 _0x2b92=['rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x2b92,0x1a6));var _0x22b9=function(_0x5e6c8f,_0x16b75f){_0x5e6c8f=_0x5e6c8f-0x0;var _0x2f27ee=_0x2b92[_0x5e6c8f];return _0x2f27ee;};'use strict';var _=require(_0x22b9('0x0'));var util=require(_0x22b9('0x1'));var logger=require(_0x22b9('0x2'))(_0x22b9('0x3'));var moment=require(_0x22b9('0x4'));var BPromise=require(_0x22b9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22b9('0x6'));var rimraf=require(_0x22b9('0x7'));var config=require(_0x22b9('0x8'));var attributes=require(_0x22b9('0x9'));module[_0x22b9('0xa')]=function(_0x1590bc,_0x3aa4f4){return _0x1590bc['define'](_0x22b9('0xb'),attributes,{'tableName':_0x22b9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa9e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xaa9e,0xa8));var _0xeaa9=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xaa9e[_0x45f951];return _0x24756c;};'use strict';var _=require(_0xeaa9('0x0'));var util=require('util');var logger=require(_0xeaa9('0x1'))(_0xeaa9('0x2'));var moment=require(_0xeaa9('0x3'));var BPromise=require(_0xeaa9('0x4'));var rp=require(_0xeaa9('0x5'));var fs=require('fs');var path=require(_0xeaa9('0x6'));var rimraf=require(_0xeaa9('0x7'));var config=require(_0xeaa9('0x8'));var attributes=require(_0xeaa9('0x9'));module[_0xeaa9('0xa')]=function(_0x5cb17c,_0x3d2e78){return _0x5cb17c[_0xeaa9('0xb')](_0xeaa9('0xc'),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 53a23bd..b32b52f 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 _0x91bd=['then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x91bd,0x1a2));var _0xd91b=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x91bd[_0x1ee0a1];return _0x1d2d5b;};'use strict';var _=require(_0xd91b('0x0'));var util=require(_0xd91b('0x1'));var moment=require(_0xd91b('0x2'));var BPromise=require(_0xd91b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd91b('0x4'));var db=require(_0xd91b('0x5'))['db'];var utils=require(_0xd91b('0x6'));var logger=require(_0xd91b('0x7'))(_0xd91b('0x8'));var config=require(_0xd91b('0x9'));var jayson=require(_0xd91b('0xa'));var client=jayson['client'][_0xd91b('0xb')]({'port':0x232a});config[_0xd91b('0xc')]=_[_0xd91b('0xd')](config[_0xd91b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd91b('0xe'))(new Redis(config['redis']));require(_0xd91b('0xf'))[_0xd91b('0x10')](socket);function respondWithRpcPromise(_0x523173,_0x22f9c4,_0x975551){return new BPromise(function(_0xe06605,_0x190334){return client['request'](_0x523173,_0x975551)[_0xd91b('0x11')](function(_0x5171f7){logger[_0xd91b('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x22f9c4,_0xd91b('0x13'));logger[_0xd91b('0x14')](_0xd91b('0x15'),_0x22f9c4,_0xd91b('0x13'),JSON[_0xd91b('0x16')](_0x5171f7));if(_0x5171f7[_0xd91b('0x17')]){if(_0x5171f7['error'][_0xd91b('0x18')]===0x1f4){logger[_0xd91b('0x17')](_0xd91b('0x19'),_0x22f9c4,_0x5171f7[_0xd91b('0x17')][_0xd91b('0x1a')]);return _0x190334(_0x5171f7[_0xd91b('0x17')]['message']);}logger[_0xd91b('0x17')](_0xd91b('0x19'),_0x22f9c4,_0x5171f7[_0xd91b('0x17')]['message']);return _0xe06605(_0x5171f7['error'][_0xd91b('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x22f9c4,_0xd91b('0x13'));_0xe06605(_0x5171f7[_0xd91b('0x1b')]['message']);}})[_0xd91b('0x1c')](function(_0xb1450d){logger[_0xd91b('0x17')](_0xd91b('0x19'),_0x22f9c4,_0xb1450d);_0x190334(_0xb1450d);});});}
\ No newline at end of file
+var _0x32e0=['stringify','error','ChatWebsite,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x32e0,0xc5));var _0x032e=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x32e0[_0x39ffd1];return _0x31267e;};'use strict';var _=require('lodash');var util=require(_0x032e('0x0'));var moment=require(_0x032e('0x1'));var BPromise=require(_0x032e('0x2'));var rs=require(_0x032e('0x3'));var fs=require('fs');var Redis=require(_0x032e('0x4'));var db=require(_0x032e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x032e('0x6'));var config=require(_0x032e('0x7'));var jayson=require(_0x032e('0x8'));var client=jayson[_0x032e('0x9')][_0x032e('0xa')]({'port':0x232a});config[_0x032e('0xb')]=_['defaults'](config[_0x032e('0xb')],{'host':_0x032e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x032e('0xb')]));require('./chatWebsite.socket')[_0x032e('0xd')](socket);function respondWithRpcPromise(_0x1d2214,_0x1a7922,_0x175402){return new BPromise(function(_0xefcdf1,_0x34e439){return client[_0x032e('0xe')](_0x1d2214,_0x175402)['then'](function(_0xabef99){logger[_0x032e('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x1a7922,_0x032e('0x10'));logger[_0x032e('0x11')](_0x032e('0x12'),_0x1a7922,'request\x20sent',JSON[_0x032e('0x13')](_0xabef99));if(_0xabef99[_0x032e('0x14')]){if(_0xabef99['error']['code']===0x1f4){logger[_0x032e('0x14')](_0x032e('0x15'),_0x1a7922,_0xabef99['error']['message']);return _0x34e439(_0xabef99[_0x032e('0x14')][_0x032e('0x16')]);}logger[_0x032e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1a7922,_0xabef99['error'][_0x032e('0x16')]);return _0xefcdf1(_0xabef99[_0x032e('0x14')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1a7922,_0x032e('0x10'));_0xefcdf1(_0xabef99['result'][_0x032e('0x16')]);}})[_0x032e('0x17')](function(_0x529d96){logger[_0x032e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1a7922,_0x529d96);_0x34e439(_0x529d96);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e1bdc11..de3c021 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 _0xcb12=['removeListener','register','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0x3a79ac,_0x48bcad){var _0x226927=function(_0x58f337){while(--_0x58f337){_0x3a79ac['push'](_0x3a79ac['shift']());}};_0x226927(++_0x48bcad);}(_0xcb12,0x137));var _0x2cb1=function(_0x3359d2,_0x58da40){_0x3359d2=_0x3359d2-0x0;var _0x56c09c=_0xcb12[_0x3359d2];return _0x56c09c;};'use strict';var ChatWebsiteEvents=require(_0x2cb1('0x0'));var events=[_0x2cb1('0x1'),'remove',_0x2cb1('0x2')];function createListener(_0x5f3645,_0x93eae1){return function(_0x5e31d6){_0x93eae1[_0x2cb1('0x3')](_0x5f3645,_0x5e31d6);};}function removeListener(_0x3176da,_0x31f776){return function(){ChatWebsiteEvents[_0x2cb1('0x4')](_0x3176da,_0x31f776);};}exports[_0x2cb1('0x5')]=function(_0x3405ab){for(var _0x21fbda=0x0,_0xead3ca=events['length'];_0x21fbda<_0xead3ca;_0x21fbda++){var _0x308c81=events[_0x21fbda];var _0x3297f3=createListener(_0x2cb1('0x6')+_0x308c81,_0x3405ab);ChatWebsiteEvents['on'](_0x308c81,_0x3297f3);}};
\ No newline at end of file
+var _0x13d9=['removeListener','register','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0x4b9a64,_0x3c3a2a){var _0xdb31de=function(_0x35d4f5){while(--_0x35d4f5){_0x4b9a64['push'](_0x4b9a64['shift']());}};_0xdb31de(++_0x3c3a2a);}(_0x13d9,0xa4));var _0x913d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13d9[_0x14add3];return _0x4a174f;};'use strict';var ChatWebsiteEvents=require(_0x913d('0x0'));var events=[_0x913d('0x1'),'remove',_0x913d('0x2')];function createListener(_0x5136a7,_0x13e669){return function(_0x106c03){_0x13e669[_0x913d('0x3')](_0x5136a7,_0x106c03);};}function removeListener(_0x332464,_0x295b1e){return function(){ChatWebsiteEvents[_0x913d('0x4')](_0x332464,_0x295b1e);};}exports[_0x913d('0x5')]=function(_0x3c1e0d){for(var _0x33dee8=0x0,_0x15bcc3=events['length'];_0x33dee8<_0x15bcc3;_0x33dee8++){var _0x5606dd=events[_0x33dee8];var _0x38257e=createListener(_0x913d('0x6')+_0x5606dd,_0x3c1e0d);ChatWebsiteEvents['on'](_0x5606dd,_0x38257e);}};
\ 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 9161cd2..81e2755 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 _0xba37=['test','exports','../../../utils/misc','url','replace','localhost'];(function(_0x12f5f7,_0xa58b52){var _0x345c1b=function(_0x306035){while(--_0x306035){_0x12f5f7['push'](_0x12f5f7['shift']());}};_0x345c1b(++_0xa58b52);}(_0xba37,0xb6));var _0x7ba3=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xba37[_0x2dadb9];return _0x2f0097;};var escapeRegExp=require(_0x7ba3('0x0'))['escapeRegExp'];var URL=require(_0x7ba3('0x1'))['URL'];function testWildcardValidity(_0x13791e){var _0x4fba12=!![];try{new URL(_0x13791e[_0x7ba3('0x2')]('*',_0x7ba3('0x3')));}catch(_0x318802){_0x4fba12=![];}return _0x4fba12&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x7ba3('0x4')](_0x13791e);}function testWebsiteWithWildcard(_0x1ad964,_0x58b96a){var _0x401c33;var _0x47b38c=escapeRegExp(_0x1ad964['trim']()[_0x7ba3('0x2')](/\/$/,''))[_0x7ba3('0x2')]('\x5c*','([\x5cw]+)');try{new URL(_0x1ad964[_0x7ba3('0x2')]('\x5c*',_0x7ba3('0x3')));_0x401c33=new RegExp(_0x47b38c)[_0x7ba3('0x4')](_0x58b96a);}catch(_0x108326){_0x401c33=![];}return _0x401c33;}module[_0x7ba3('0x5')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x66fa=['escapeRegExp','URL','replace','localhost','test','trim','exports','../../../utils/misc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x66fa,0x117));var _0xa66f=function(_0x152330,_0x2c86d1){_0x152330=_0x152330-0x0;var _0xc44ae3=_0x66fa[_0x152330];return _0xc44ae3;};var escapeRegExp=require(_0xa66f('0x0'))[_0xa66f('0x1')];var URL=require('url')[_0xa66f('0x2')];function testWildcardValidity(_0x2dcf24){var _0x234f2d=!![];try{new URL(_0x2dcf24[_0xa66f('0x3')]('*',_0xa66f('0x4')));}catch(_0x2a2abf){_0x234f2d=![];}return _0x234f2d&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xa66f('0x5')](_0x2dcf24);}function testWebsiteWithWildcard(_0x5ebea5,_0x4fd9d0){var _0x2239d3;var _0x20a150=escapeRegExp(_0x5ebea5[_0xa66f('0x6')]()[_0xa66f('0x3')](/\/$/,''))[_0xa66f('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x5ebea5[_0xa66f('0x3')]('\x5c*','localhost'));_0x2239d3=new RegExp(_0x20a150)[_0xa66f('0x5')](_0x4fd9d0);}catch(_0x597c7c){_0x2239d3=![];}return _0x2239d3;}module[_0xa66f('0x7')]={'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 1b8e4af..cfbdf0c 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 _0x61ad=['addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAgents','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','index','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','extname','/:id/offline','any','offline','addApplications'];(function(_0x153595,_0x31e73d){var _0x50db91=function(_0x3fabea){while(--_0x3fabea){_0x153595['push'](_0x153595['shift']());}};_0x50db91(++_0x31e73d);}(_0x61ad,0x1dc));var _0xd61a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x61ad[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd61a('0x0'));var util=require(_0xd61a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd61a('0x2')]();var fs_extra=require(_0xd61a('0x3'));var auth=require(_0xd61a('0x4'));var interaction=require(_0xd61a('0x5'));var config=require('../../config/environment');var controller=require(_0xd61a('0x6'));router[_0xd61a('0x7')]('/',auth['isAuthenticated'](),controller[_0xd61a('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd61a('0x9')]);router['get'](_0xd61a('0xa'),auth[_0xd61a('0xb')](),controller[_0xd61a('0xc')]);router[_0xd61a('0x7')](_0xd61a('0xd'),auth['isAuthenticated'](),controller[_0xd61a('0xe')]);router[_0xd61a('0x7')](_0xd61a('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xd61a('0x7')](_0xd61a('0x10'),controller['getLogo']);router[_0xd61a('0x7')](_0xd61a('0x11'),controller['getAvatar']);router['get'](_0xd61a('0x12'),controller[_0xd61a('0x13')]);router[_0xd61a('0x7')](_0xd61a('0x14'),controller[_0xd61a('0x15')]);router[_0xd61a('0x7')](_0xd61a('0x16'),auth[_0xd61a('0xb')](),controller[_0xd61a('0x17')]);router[_0xd61a('0x7')]('/:id/snippet',controller['getSnippet']);router[_0xd61a('0x7')](_0xd61a('0x18'),auth['isAuthenticated'](),controller[_0xd61a('0x19')]);router[_0xd61a('0x7')](_0xd61a('0x1a'),auth[_0xd61a('0xb')](),controller['getProactiveActions']);router[_0xd61a('0x7')](_0xd61a('0x1b'),controller[_0xd61a('0x1c')]);router[_0xd61a('0x7')](_0xd61a('0x1d'),auth[_0xd61a('0xb')](),controller['getOfflineMessages']);router['get'](_0xd61a('0x1e'),auth['isAuthenticated'](),controller[_0xd61a('0x1f')]);router[_0xd61a('0x20')]('/',auth[_0xd61a('0xb')](),controller[_0xd61a('0x21')]);router[_0xd61a('0x20')](_0xd61a('0xd'),auth['isAuthenticated'](),controller[_0xd61a('0x22')]);router['post']('/:id/canned_answers',auth[_0xd61a('0xb')](),controller[_0xd61a('0x23')]);var upload=multer({'storage':multer[_0xd61a('0x24')]({'destination':function(_0x17aef1,_0x24eb0a,_0x2d68b0){_0x2d68b0(null,path[_0xd61a('0x25')](config[_0xd61a('0x26')],'server/files/images/logos/'));},'filename':function(_0x3e69c0,_0x4e9cff,_0x45eeb4){_0x45eeb4(null,util[_0xd61a('0x27')]('%s-%s',Date[_0xd61a('0x28')](),_0x4e9cff[_0xd61a('0x29')]));}})});router[_0xd61a('0x20')]('/:id/logo',upload[_0xd61a('0x2a')](_0xd61a('0x2b')),controller[_0xd61a('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e4a44,_0x13ceba,_0x4c02ef){_0x4c02ef(null,path[_0xd61a('0x25')](config[_0xd61a('0x26')],_0xd61a('0x2d')));},'filename':function(_0x2c3703,_0x4fcd1a,_0x2a8ef3){_0x2a8ef3(null,util[_0xd61a('0x27')](_0xd61a('0x2e'),Date[_0xd61a('0x28')](),_0x4fcd1a[_0xd61a('0x29')]));}})});router[_0xd61a('0x20')](_0xd61a('0x11'),upload[_0xd61a('0x2a')](_0xd61a('0x2b')),controller[_0xd61a('0x2f')]);var upload=multer({'storage':multer[_0xd61a('0x24')]({'destination':function(_0x30b3b1,_0x393423,_0x1407c5){_0x1407c5(null,path['join'](config[_0xd61a('0x26')],_0xd61a('0x2d')));},'filename':function(_0x21565b,_0x157cb2,_0x28b182){_0x28b182(null,util['format'](_0xd61a('0x2e'),Date[_0xd61a('0x28')](),_0x157cb2[_0xd61a('0x29')]));}})});router[_0xd61a('0x20')](_0xd61a('0x12'),upload[_0xd61a('0x2a')]('file'),controller[_0xd61a('0x30')]);var upload=multer({'storage':multer[_0xd61a('0x24')]({'destination':function(_0x109190,_0x4f7a33,_0x4fb904){_0x4fb904(null,path[_0xd61a('0x25')](config[_0xd61a('0x26')],_0xd61a('0x2d')));},'filename':function(_0x2a12cb,_0x185c9,_0x1b257e){_0x1b257e(null,util[_0xd61a('0x27')](_0xd61a('0x2e'),Date['now'](),_0x185c9[_0xd61a('0x29')]));}})});router[_0xd61a('0x20')]('/:id/system_avatar',upload['single'](_0xd61a('0x2b')),controller[_0xd61a('0x31')]);router[_0xd61a('0x20')](_0xd61a('0x32'),controller[_0xd61a('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x55761f,_0x224289,_0x611a1a){const _0xa16b3b=path[_0xd61a('0x25')](config['root'],_0xd61a('0x34'),_0xd61a('0x35'),_0xd61a('0x36'));fs_extra['ensureDir'](_0xa16b3b,function(){_0x611a1a(null,_0xa16b3b);});},'filename':function(_0x3f4b71,_0xd30f32,_0x13b0b3){const _0x4f38c4=_0xd30f32[_0xd61a('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x37c8ba=path[_0xd61a('0x37')](_0x4f38c4);const _0x340905=Date[_0xd61a('0x28')]()+'-'+_0x4f38c4['replace'](_0x37c8ba,'')+_0x37c8ba;_0x13b0b3(null,_0x340905);}})});router[_0xd61a('0x20')](_0xd61a('0x38'),offlineUploadMulter[_0xd61a('0x39')](),controller[_0xd61a('0x3a')]);router['post'](_0xd61a('0x16'),auth[_0xd61a('0xb')](),controller['addInteraction']);router[_0xd61a('0x20')](_0xd61a('0x18'),auth[_0xd61a('0xb')](),controller[_0xd61a('0x3b')]);router['post'](_0xd61a('0x1a'),auth['isAuthenticated'](),controller[_0xd61a('0x3c')]);router[_0xd61a('0x20')](_0xd61a('0x1e'),auth[_0xd61a('0xb')](),controller[_0xd61a('0x3d')]);router[_0xd61a('0x3e')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd61a('0x3f')](_0xd61a('0xa'),auth[_0xd61a('0xb')](),controller[_0xd61a('0x40')]);router['delete'](_0xd61a('0xd'),auth[_0xd61a('0xb')](),controller[_0xd61a('0x41')]);router[_0xd61a('0x3f')]('/:id/canned_answers',auth[_0xd61a('0xb')](),controller['removeAnswers']);router[_0xd61a('0x3f')](_0xd61a('0x1e'),auth[_0xd61a('0xb')](),controller[_0xd61a('0x42')]);module['exports']=router;
\ No newline at end of file
+var _0x8fe9=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/fields','getFields','/:id/users','post','diskStorage','join','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','root','server/files/images/avatars/','/:id/avatar','addAvatar','/:id/customer_avatar','addCustomerAvatar','originalname','addSystemAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','/:id/applications','addAgents','put','update','delete','destroy','removeDispositions','exports','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x522c1a,_0x1299ed){var _0x5807ee=function(_0x4e5601){while(--_0x4e5601){_0x522c1a['push'](_0x522c1a['shift']());}};_0x5807ee(++_0x1299ed);}(_0x8fe9,0x122));var _0x98fe=function(_0xd1a252,_0x16396f){_0xd1a252=_0xd1a252-0x0;var _0x560ee1=_0x8fe9[_0xd1a252];return _0x560ee1;};'use strict';var multer=require('multer');var util=require(_0x98fe('0x0'));var path=require(_0x98fe('0x1'));var timeout=require(_0x98fe('0x2'));var express=require(_0x98fe('0x3'));var router=express[_0x98fe('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98fe('0x5'));var controller=require('./chatWebsite.controller');router[_0x98fe('0x6')]('/',auth[_0x98fe('0x7')](),controller['index']);router[_0x98fe('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x98fe('0x6')](_0x98fe('0x8'),auth['isAuthenticated'](),controller[_0x98fe('0x9')]);router['get'](_0x98fe('0xa'),auth[_0x98fe('0x7')](),controller[_0x98fe('0xb')]);router[_0x98fe('0x6')](_0x98fe('0xc'),auth[_0x98fe('0x7')](),controller[_0x98fe('0xd')]);router['get'](_0x98fe('0xe'),controller['getLogo']);router[_0x98fe('0x6')]('/:id/avatar',controller[_0x98fe('0xf')]);router[_0x98fe('0x6')]('/:id/customer_avatar',controller[_0x98fe('0x10')]);router[_0x98fe('0x6')](_0x98fe('0x11'),controller['getSystemAvatar']);router['get'](_0x98fe('0x12'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x98fe('0x6')](_0x98fe('0x13'),controller[_0x98fe('0x14')]);router[_0x98fe('0x6')]('/:id/applications',auth[_0x98fe('0x7')](),controller[_0x98fe('0x15')]);router[_0x98fe('0x6')]('/:id/proactive_actions',auth[_0x98fe('0x7')](),controller['getProactiveActions']);router[_0x98fe('0x6')](_0x98fe('0x16'),controller[_0x98fe('0x17')]);router[_0x98fe('0x6')]('/:id/offline_messages',auth[_0x98fe('0x7')](),controller['getOfflineMessages']);router['get'](_0x98fe('0x18'),auth[_0x98fe('0x7')](),controller['getAgents']);router[_0x98fe('0x19')]('/',auth[_0x98fe('0x7')](),controller['create']);router[_0x98fe('0x19')](_0x98fe('0xa'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x98fe('0x19')](_0x98fe('0xc'),auth[_0x98fe('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x98fe('0x1a')]({'destination':function(_0x521f99,_0x486414,_0xbcbff0){_0xbcbff0(null,path[_0x98fe('0x1b')](config['root'],_0x98fe('0x1c')));},'filename':function(_0x1d1090,_0x472f9e,_0x44dacf){_0x44dacf(null,util[_0x98fe('0x1d')](_0x98fe('0x1e'),Date[_0x98fe('0x1f')](),_0x472f9e['originalname']));}})});router[_0x98fe('0x19')]('/:id/logo',upload[_0x98fe('0x20')](_0x98fe('0x21')),controller[_0x98fe('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb9789e,_0x1d502e,_0x1ec6c){_0x1ec6c(null,path[_0x98fe('0x1b')](config[_0x98fe('0x23')],_0x98fe('0x24')));},'filename':function(_0x9ae7d4,_0x216259,_0xefd76){_0xefd76(null,util[_0x98fe('0x1d')](_0x98fe('0x1e'),Date['now'](),_0x216259['originalname']));}})});router[_0x98fe('0x19')](_0x98fe('0x25'),upload['single'](_0x98fe('0x21')),controller[_0x98fe('0x26')]);var upload=multer({'storage':multer[_0x98fe('0x1a')]({'destination':function(_0x1e3cb6,_0x6f1275,_0x131193){_0x131193(null,path[_0x98fe('0x1b')](config[_0x98fe('0x23')],_0x98fe('0x24')));},'filename':function(_0x399684,_0x40af93,_0x5bf1b3){_0x5bf1b3(null,util[_0x98fe('0x1d')](_0x98fe('0x1e'),Date[_0x98fe('0x1f')](),_0x40af93['originalname']));}})});router[_0x98fe('0x19')](_0x98fe('0x27'),upload[_0x98fe('0x20')](_0x98fe('0x21')),controller[_0x98fe('0x28')]);var upload=multer({'storage':multer[_0x98fe('0x1a')]({'destination':function(_0x5ab2b1,_0x49530a,_0x34b923){_0x34b923(null,path[_0x98fe('0x1b')](config[_0x98fe('0x23')],_0x98fe('0x24')));},'filename':function(_0x2b0690,_0x44b513,_0xfc29ed){_0xfc29ed(null,util[_0x98fe('0x1d')](_0x98fe('0x1e'),Date['now'](),_0x44b513[_0x98fe('0x29')]));}})});router[_0x98fe('0x19')](_0x98fe('0x11'),upload[_0x98fe('0x20')]('file'),controller[_0x98fe('0x2a')]);router[_0x98fe('0x19')](_0x98fe('0x2b'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x41ab90,_0x2dd6ee,_0xe1d93f){const _0x1a2a56=path[_0x98fe('0x1b')](config[_0x98fe('0x23')],_0x98fe('0x2c'),'attachments',_0x98fe('0x2d'));fs_extra[_0x98fe('0x2e')](_0x1a2a56,function(){_0xe1d93f(null,_0x1a2a56);});},'filename':function(_0x5b4f24,_0x7f0023,_0x519bad){const _0x3bb170=_0x7f0023[_0x98fe('0x29')][_0x98fe('0x2f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3bd8ca=path[_0x98fe('0x30')](_0x3bb170);const _0xf85f0=Date[_0x98fe('0x1f')]()+'-'+_0x3bb170['replace'](_0x3bd8ca,'')+_0x3bd8ca;_0x519bad(null,_0xf85f0);}})});router['post']('/:id/offline',offlineUploadMulter[_0x98fe('0x31')](),controller[_0x98fe('0x32')]);router['post']('/:id/interactions',auth[_0x98fe('0x7')](),controller[_0x98fe('0x33')]);router[_0x98fe('0x19')](_0x98fe('0x34'),auth[_0x98fe('0x7')](),controller['addApplications']);router[_0x98fe('0x19')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x98fe('0x19')](_0x98fe('0x18'),auth[_0x98fe('0x7')](),controller[_0x98fe('0x35')]);router[_0x98fe('0x36')](_0x98fe('0x8'),auth['isAuthenticated'](),controller[_0x98fe('0x37')]);router[_0x98fe('0x38')](_0x98fe('0x8'),auth[_0x98fe('0x7')](),controller[_0x98fe('0x39')]);router[_0x98fe('0x38')](_0x98fe('0xa'),auth['isAuthenticated'](),controller[_0x98fe('0x3a')]);router[_0x98fe('0x38')]('/:id/canned_answers',auth[_0x98fe('0x7')](),controller['removeAnswers']);router[_0x98fe('0x38')](_0x98fe('0x18'),auth[_0x98fe('0x7')](),controller['removeAgents']);module[_0x98fe('0x3b')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c8ef81d..11bbcd0 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 _0x4a38=['Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','app','client-side-logger'];(function(_0x57ef0c,_0x3b1843){var _0x487929=function(_0x5dcd97){while(--_0x5dcd97){_0x57ef0c['push'](_0x57ef0c['shift']());}};_0x487929(++_0x3b1843);}(_0x4a38,0x1de));var _0x84a3=function(_0x5a2161,_0x249604){_0x5a2161=_0x5a2161-0x0;var _0x5378da=_0x4a38[_0x5a2161];return _0x5378da;};var beaverLogger=require(_0x84a3('0x0'));var express=require(_0x84a3('0x1'));var auth=require('../components/auth/service');var config=require(_0x84a3('0x2'));var router=express['Router']();var isProduction=config[_0x84a3('0x3')]==='production'||![];function clientSideLogs(_0x2e01c7,_0x34b981,_0x4d4b98){var _0x383779=_0x2e01c7[_0x84a3('0x4')]['get'](_0x84a3('0x5'));if(!_0x383779){throw new Error(_0x84a3('0x6'));}return beaverLogger['expressEndpoint']({'uri':_0x84a3('0x7'),'logger':_0x383779,'enableCors':!isProduction})(_0x2e01c7,_0x34b981,_0x4d4b98);}router[_0x84a3('0x8')](auth[_0x84a3('0x9')](),clientSideLogs);module[_0x84a3('0xa')]=router;
\ No newline at end of file
+var _0x9c00=['/client-logs','isAuthenticated','exports','beaver-logger/server','../components/auth/service','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x368590,_0x48ad74){var _0x5ceb60=function(_0x322b8e){while(--_0x322b8e){_0x368590['push'](_0x368590['shift']());}};_0x5ceb60(++_0x48ad74);}(_0x9c00,0x13b));var _0x09c0=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c00[_0x3511d3];return _0x5d6321;};var beaverLogger=require(_0x09c0('0x0'));var express=require('express');var auth=require(_0x09c0('0x1'));var config=require('../config/environment');var router=express[_0x09c0('0x2')]();var isProduction=config[_0x09c0('0x3')]===_0x09c0('0x4')||![];function clientSideLogs(_0x927b75,_0x456dbc,_0x433146){var _0x1838a5=_0x927b75[_0x09c0('0x5')]['get'](_0x09c0('0x6'));if(!_0x1838a5){throw new Error(_0x09c0('0x7'));}return beaverLogger[_0x09c0('0x8')]({'uri':_0x09c0('0x9'),'logger':_0x1838a5,'enableCors':!isProduction})(_0x927b75,_0x456dbc,_0x433146);}router['use'](auth[_0x09c0('0xa')](),clientSideLogs);module[_0x09c0('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 9223f17..e45ef78 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 _0x9d3e=['STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365'];(function(_0x17df36,_0x583870){var _0x31ac82=function(_0x52c660){while(--_0x52c660){_0x17df36['push'](_0x17df36['shift']());}};_0x31ac82(++_0x583870);}(_0x9d3e,0xf1));var _0xe9d3=function(_0x18b1c5,_0x345a75){_0x18b1c5=_0x18b1c5-0x0;var _0x44bd52=_0x9d3e[_0x18b1c5];return _0x44bd52;};'use strict';var Sequelize=require('sequelize');module[_0xe9d3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe9d3('0x1')](_0xe9d3('0x2'),_0xe9d3('0x3'),_0xe9d3('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe9d3('0x1')]('Outlook365',_0xe9d3('0x5'))},'data1':{'type':Sequelize[_0xe9d3('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xe9d3('0x6')],'comment':_0xe9d3('0x7')},'data3':{'type':Sequelize[_0xe9d3('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xe9d3('0x6')],'comment':_0xe9d3('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':_0xe9d3('0x9')},'data6':{'type':Sequelize[_0xe9d3('0xa')],'comment':_0xe9d3('0xb')},'data7':{'type':Sequelize[_0xe9d3('0xa')],'comment':_0xe9d3('0xc')}};
\ No newline at end of file
+var _0x6c9f=['STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x20dbe8,_0x3998af){var _0x2c06c6=function(_0x4d6b02){while(--_0x4d6b02){_0x20dbe8['push'](_0x20dbe8['shift']());}};_0x2c06c6(++_0x3998af);}(_0x6c9f,0xe8));var _0xf6c9=function(_0x3aa2d3,_0x550bbe){_0x3aa2d3=_0x3aa2d3-0x0;var _0x3daba8=_0x6c9f[_0x3aa2d3];return _0x3daba8;};'use strict';var Sequelize=require(_0xf6c9('0x0'));module[_0xf6c9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf6c9('0x2')](_0xf6c9('0x3'),_0xf6c9('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf6c9('0x2')](_0xf6c9('0x5'),_0xf6c9('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xf6c9('0x7')},'data2':{'type':Sequelize[_0xf6c9('0x8')],'comment':_0xf6c9('0x9')},'data3':{'type':Sequelize[_0xf6c9('0x8')],'comment':_0xf6c9('0xa')},'data4':{'type':Sequelize[_0xf6c9('0x8')],'comment':_0xf6c9('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xf6c9('0xc')},'data6':{'type':Sequelize[_0xf6c9('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf6c9('0xd')],'comment':_0xf6c9('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 7995498..b2b88a6 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 _0x2b18=['filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','find','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','parse','from','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','access_token','data6','refresh_token','data5','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','CloudProvider','rawAttributes','key','model','keys'];(function(_0x22d487,_0x4cb4dd){var _0x391c06=function(_0x30034c){while(--_0x30034c){_0x22d487['push'](_0x22d487['shift']());}};_0x391c06(++_0x4cb4dd);}(_0x2b18,0x157));var _0x82b1=function(_0x11c3ca,_0x18c151){_0x11c3ca=_0x11c3ca-0x0;var _0x8133bc=_0x2b18[_0x11c3ca];return _0x8133bc;};'use strict';var _=require(_0x82b1('0x0'));var Redis=require(_0x82b1('0x1'));var qs=require(_0x82b1('0x2'));var encryptor=require(_0x82b1('0x3'));var config=require(_0x82b1('0x4'));var logger=require(_0x82b1('0x5'))(_0x82b1('0x6'));var db=require(_0x82b1('0x7'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x82b1('0x8')]=_[_0x82b1('0x9')](config[_0x82b1('0x8')],{'host':_0x82b1('0xa'),'port':0x18eb});var socket=require(_0x82b1('0xb'))(new Redis(config[_0x82b1('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x49ba6b,_0x4d2b7a){_0x4d2b7a=_0x4d2b7a||0xcc;return function(_0x30de07){if(_0x30de07){return _0x49ba6b[_0x82b1('0xc')](_0x4d2b7a);}return _0x49ba6b[_0x82b1('0xd')](_0x4d2b7a)[_0x82b1('0xe')]();};}function respondWithResult(_0x563339,_0x46b2f2){_0x46b2f2=_0x46b2f2||0xc8;return function(_0x13a82e){if(_0x13a82e){return _0x563339[_0x82b1('0xd')](_0x46b2f2)[_0x82b1('0xf')](_0x13a82e);}};}function respondWithFilteredResult(_0x3a1126,_0x51b30e){return function(_0x2e5ac4){if(_0x2e5ac4){var _0x15da2f=typeof _0x51b30e[_0x82b1('0x10')]===_0x82b1('0x11')&&typeof _0x51b30e[_0x82b1('0x12')]===_0x82b1('0x11');var _0x58b045=_0x2e5ac4[_0x82b1('0x13')];var _0x1f3f88=_0x15da2f?0x0:_0x51b30e[_0x82b1('0x10')];var _0xad2c8c=_0x15da2f?_0x2e5ac4[_0x82b1('0x13')]:_0x51b30e[_0x82b1('0x10')]+_0x51b30e['limit'];var _0x3f55a5;if(_0xad2c8c>=_0x58b045){_0xad2c8c=_0x58b045;_0x3f55a5=0xc8;}else{_0x3f55a5=0xce;}_0x3a1126[_0x82b1('0xd')](_0x3f55a5);return _0x3a1126[_0x82b1('0x14')](_0x82b1('0x15'),_0x1f3f88+'-'+_0xad2c8c+'/'+_0x58b045)[_0x82b1('0xf')](_0x2e5ac4);}return null;};}function saveUpdates(_0x4424e0){return function(_0x408602){if(_0x408602){return _0x408602[_0x82b1('0x16')](_0x4424e0)['then'](function(_0x2f2ddb){return _0x2f2ddb;});}return null;};}function removeEntity(_0x182a2b){return function(_0x1b73c2){if(_0x1b73c2){return _0x1b73c2['destroy']()[_0x82b1('0x17')](function(){_0x182a2b['status'](0xcc)[_0x82b1('0xe')]();});}};}function handleEntityNotFound(_0x3f8586){return function(_0x2101ad){if(!_0x2101ad){_0x3f8586[_0x82b1('0xc')](0x194);}return _0x2101ad;};}function handleError(_0x53d411,_0x2a5a60){_0x2a5a60=_0x2a5a60||0x1f4;return function(_0x3e5225){logger[_0x82b1('0x18')](_0x3e5225[_0x82b1('0x19')]);if(_0x3e5225[_0x82b1('0x1a')]){delete _0x3e5225['name'];}_0x53d411[_0x82b1('0xd')](_0x2a5a60)[_0x82b1('0x1b')](_0x3e5225);};}function maskClientSecret(_0x3354cb){return _['padEnd'](_0x3354cb['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x3a8505,_0x5d35c9){var _0x26c624={},_0x4f414c={},_0x3b61f2={'count':0x0,'rows':[]};var _0x111716=_['map'](db[_0x82b1('0x1c')][_0x82b1('0x1d')],function(_0x1b8e97){return{'name':_0x1b8e97['fieldName'],'type':_0x1b8e97['type'][_0x82b1('0x1e')]};});_0x4f414c[_0x82b1('0x1f')]=_['map'](_0x111716,_0x82b1('0x1a'));_0x4f414c['query']=_[_0x82b1('0x20')](_0x3a8505['query']);_0x4f414c[_0x82b1('0x21')]=_['intersection'](_0x4f414c[_0x82b1('0x1f')],_0x4f414c[_0x82b1('0x22')]);_0x26c624['attributes']=_[_0x82b1('0x23')](_0x4f414c[_0x82b1('0x1f')],qs[_0x82b1('0x24')](_0x3a8505[_0x82b1('0x22')][_0x82b1('0x24')]));_0x26c624[_0x82b1('0x25')]=_0x26c624['attributes'][_0x82b1('0x26')]?_0x26c624['attributes']:_0x4f414c[_0x82b1('0x1f')];if(!_0x3a8505[_0x82b1('0x22')][_0x82b1('0x27')](_0x82b1('0x28'))){_0x26c624[_0x82b1('0x12')]=qs[_0x82b1('0x12')](_0x3a8505[_0x82b1('0x22')][_0x82b1('0x12')]);_0x26c624[_0x82b1('0x10')]=qs[_0x82b1('0x10')](_0x3a8505[_0x82b1('0x22')]['offset']);}_0x26c624[_0x82b1('0x29')]=qs[_0x82b1('0x2a')](_0x3a8505[_0x82b1('0x22')]['sort']);_0x26c624['where']=qs[_0x82b1('0x21')](_[_0x82b1('0x2b')](_0x3a8505['query'],_0x4f414c[_0x82b1('0x21')]),_0x111716);if(_0x3a8505['query'][_0x82b1('0x2c')]){_0x26c624[_0x82b1('0x2d')]=_[_0x82b1('0x2e')](_0x26c624[_0x82b1('0x2d')],{'$or':_[_0x82b1('0x2f')](_0x111716,function(_0x13f299){if(_0x13f299['type']!=='VIRTUAL'){var _0x10336a={};_0x10336a[_0x13f299[_0x82b1('0x1a')]]={'$like':'%'+_0x3a8505[_0x82b1('0x22')]['filter']+'%'};return _0x10336a;}})});}_0x26c624=_[_0x82b1('0x2e')]({},_0x26c624,_0x3a8505[_0x82b1('0x30')]);var _0x515205={'where':_0x26c624[_0x82b1('0x2d')]};return db['CloudProvider'][_0x82b1('0x13')](_0x515205)[_0x82b1('0x17')](function(_0x3f731c){_0x3b61f2[_0x82b1('0x13')]=_0x3f731c;if(_0x3a8505[_0x82b1('0x22')][_0x82b1('0x31')]){_0x26c624[_0x82b1('0x32')]=[{'all':!![]}];}return db[_0x82b1('0x1c')]['findAll'](_0x26c624);})[_0x82b1('0x17')](function(_0x1a4eba){_0x3b61f2[_0x82b1('0x33')]=_[_0x82b1('0x2f')](_0x1a4eba,function(_0x36ff08){if(_0x36ff08[_0x82b1('0x34')]===_0x82b1('0x35')){var _0x36a89c=encryptor[_0x82b1('0x36')](_0x36ff08[_0x82b1('0x37')]);_0x36ff08[_0x82b1('0x37')]=maskClientSecret(_0x36a89c);}return _0x36ff08;});return _0x3b61f2;})[_0x82b1('0x17')](respondWithFilteredResult(_0x5d35c9,_0x26c624))[_0x82b1('0x38')](handleError(_0x5d35c9,null));};exports[_0x82b1('0x39')]=function(_0x3db5bf,_0x437e2d){var _0x11ce20={'raw':!![],'where':{'id':_0x3db5bf['params']['id']}},_0x32c6b7={};_0x32c6b7[_0x82b1('0x1f')]=_['keys'](db['CloudProvider'][_0x82b1('0x1d')]);_0x32c6b7['query']=_[_0x82b1('0x20')](_0x3db5bf[_0x82b1('0x22')]);_0x32c6b7['filters']=_[_0x82b1('0x23')](_0x32c6b7[_0x82b1('0x1f')],_0x32c6b7[_0x82b1('0x22')]);_0x11ce20[_0x82b1('0x25')]=_[_0x82b1('0x23')](_0x32c6b7['model'],qs['fields'](_0x3db5bf[_0x82b1('0x22')]['fields']));_0x11ce20['attributes']=_0x11ce20['attributes'][_0x82b1('0x26')]?_0x11ce20[_0x82b1('0x25')]:_0x32c6b7[_0x82b1('0x1f')];if(_0x3db5bf[_0x82b1('0x22')][_0x82b1('0x31')]){_0x11ce20[_0x82b1('0x32')]=[{'all':!![]}];}_0x11ce20=_[_0x82b1('0x2e')]({},_0x11ce20,_0x3db5bf[_0x82b1('0x30')]);return db[_0x82b1('0x1c')][_0x82b1('0x3a')](_0x11ce20)[_0x82b1('0x17')](handleEntityNotFound(_0x437e2d,null))['then'](function(_0x391065){if(_0x391065[_0x82b1('0x34')]==='MicrosoftAzure'){var _0x2045cc=encryptor[_0x82b1('0x36')](_0x391065['data3']);_0x391065[_0x82b1('0x37')]=maskClientSecret(_0x2045cc);}return _0x391065;})[_0x82b1('0x17')](respondWithResult(_0x437e2d,null))[_0x82b1('0x38')](handleError(_0x437e2d,null));};exports[_0x82b1('0x3b')]=function(_0x5798c2,_0x158939){if(!_0x5798c2['body'][_0x82b1('0x1a')])throw new Error(_0x82b1('0x3c'));if(!_0x5798c2[_0x82b1('0x3d')][_0x82b1('0x34')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x38f3be=db[_0x82b1('0x1c')]['rawAttributes']['service'][_0x82b1('0x3e')];if(!_0x38f3be[_0x82b1('0x3f')](_0x5798c2[_0x82b1('0x3d')]['service']))throw new Error(_0x82b1('0x40')+_0x38f3be['join'](',\x20'));if(_0x5798c2[_0x82b1('0x3d')][_0x82b1('0x34')]===_0x82b1('0x35')&&_0x5798c2[_0x82b1('0x3d')][_0x82b1('0x37')]){_0x5798c2[_0x82b1('0x3d')][_0x82b1('0x37')]=encryptor[_0x82b1('0x41')](_0x5798c2['body'][_0x82b1('0x37')]);}return db[_0x82b1('0x1c')][_0x82b1('0x3b')](_0x5798c2['body'],{})[_0x82b1('0x17')](respondWithResult(_0x158939,0xc9))['catch'](handleError(_0x158939,null));};exports['update']=function(_0x1f7d7b,_0x20f4d9){if(_0x1f7d7b[_0x82b1('0x3d')]['id']){delete _0x1f7d7b['body']['id'];}return db[_0x82b1('0x1c')]['find']({'where':{'id':_0x1f7d7b[_0x82b1('0x42')]['id']}})[_0x82b1('0x17')](handleEntityNotFound(_0x20f4d9,null))['then'](function(_0x53b628){if(_0x53b628[_0x82b1('0x34')]===_0x82b1('0x35')&&_0x1f7d7b[_0x82b1('0x3d')][_0x82b1('0x37')]){_0x1f7d7b[_0x82b1('0x3d')][_0x82b1('0x37')]=encryptor[_0x82b1('0x41')](_0x1f7d7b[_0x82b1('0x3d')]['data3']);}return _0x53b628;})[_0x82b1('0x17')](saveUpdates(_0x1f7d7b['body'],null))[_0x82b1('0x17')](respondWithResult(_0x20f4d9,null))[_0x82b1('0x38')](handleError(_0x20f4d9,null));};exports[_0x82b1('0x43')]=function(_0x5aeee1,_0x4ab75f){return db['CloudProvider']['find']({'where':{'id':_0x5aeee1[_0x82b1('0x42')]['id']}})[_0x82b1('0x17')](handleEntityNotFound(_0x4ab75f,null))[_0x82b1('0x17')](removeEntity(_0x4ab75f,null))[_0x82b1('0x38')](handleError(_0x4ab75f,null));};exports[_0x82b1('0x44')]=function(_0x456ed5,_0x604ac1){return db[_0x82b1('0x1c')][_0x82b1('0x45')]({'where':{'id':_0x456ed5['params']['id']},'raw':!![]})['then'](function(_0x4f0e07){if(!_0x4f0e07)return _0x604ac1[_0x82b1('0xc')](0x194);return{'url':oauth[_0x82b1('0x46')](_0x4f0e07,_0x456ed5[_0x82b1('0x47')]['id'])};})[_0x82b1('0x17')](respondWithResult(_0x604ac1,null))['catch'](handleError(_0x604ac1,null));};exports[_0x82b1('0x48')]=function(_0x2c66ec,_0x38eda4){var _0x67fe69=_0x2c66ec['body'];var _0x224d45;var _0x107d50;if(_0x67fe69[_0x82b1('0x18')])throw _0x67fe69;redis[_0x82b1('0x49')](_0x67fe69[_0x82b1('0x4a')])[_0x82b1('0x17')](function(_0x521d81){if(!_0x521d81)throw new Error('Invalid\x20state\x20parameter');_0x224d45=JSON[_0x82b1('0x4b')](_0x521d81);var _0x300d67=Buffer[_0x82b1('0x4c')](_0x67fe69['state'],_0x82b1('0x4d'))[_0x82b1('0x4e')](_0x82b1('0x4f'));_0x107d50=JSON[_0x82b1('0x4b')](_0x300d67);if(!oauth['isValidIdToken'](_0x67fe69[_0x82b1('0x50')],_0x224d45[_0x82b1('0x51')]))throw new Error(_0x82b1('0x52'));redis['del'](_0x67fe69['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x67fe69['code'],_0x224d45);})[_0x82b1('0x17')](function(_0x37a00c){_0x224d45['data5']=_0x37a00c[_0x82b1('0x53')];_0x224d45[_0x82b1('0x54')]=_0x37a00c[_0x82b1('0x55')];return db[_0x82b1('0x1c')]['update']({'data5':_0x224d45[_0x82b1('0x56')],'data6':_0x224d45[_0x82b1('0x54')]},{'where':{'id':_0x224d45['id']}});})[_0x82b1('0x17')](function(){oauth[_0x82b1('0x57')](_0x224d45);socket['emit'](_0x82b1('0x58'),{'id':_0x107d50['id']});return;})[_0x82b1('0x17')](respondWithStatusCode(_0x38eda4,null))['catch'](function(_0x2b5ccd){if(_0x107d50){socket[_0x82b1('0x59')](_0x82b1('0x5a'),{'id':_0x107d50['id']});}if(!_0x224d45){logger[_0x82b1('0x18')]('Invalid\x20authentication\x20state\x20parameter',_0x2b5ccd);return _0x38eda4[_0x82b1('0xd')](0x1f4)[_0x82b1('0x1b')](_0x2b5ccd[_0x82b1('0x5b')]);}logger[_0x82b1('0x18')](_0x82b1('0x5c'),_0x224d45['id'],JSON[_0x82b1('0x5d')](_0x2b5ccd));});};
\ No newline at end of file
+var _0x80fd=['create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','catch','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','from','base64','toString','ascii','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','set','json','update','then','destroy','end','stack','name','padEnd','slice','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','CloudProvider','includeAll','find'];(function(_0x1d4481,_0x305c65){var _0x1f3cc6=function(_0x33c5cf){while(--_0x33c5cf){_0x1d4481['push'](_0x1d4481['shift']());}};_0x1f3cc6(++_0x305c65);}(_0x80fd,0xde));var _0xd80f=function(_0x4fccaf,_0x139397){_0x4fccaf=_0x4fccaf-0x0;var _0x2256b0=_0x80fd[_0x4fccaf];return _0x2256b0;};'use strict';var _=require(_0xd80f('0x0'));var Redis=require(_0xd80f('0x1'));var qs=require(_0xd80f('0x2'));var encryptor=require(_0xd80f('0x3'));var config=require(_0xd80f('0x4'));var logger=require(_0xd80f('0x5'))('api');var db=require(_0xd80f('0x6'))['db'];var oauth=require(_0xd80f('0x7'));config[_0xd80f('0x8')]=_[_0xd80f('0x9')](config[_0xd80f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd80f('0xa'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1d5bb7,_0x48a3e2){_0x48a3e2=_0x48a3e2||0xcc;return function(_0x16ba71){if(_0x16ba71){return _0x1d5bb7[_0xd80f('0xb')](_0x48a3e2);}return _0x1d5bb7[_0xd80f('0xc')](_0x48a3e2)['end']();};}function respondWithResult(_0x2004be,_0x1857b6){_0x1857b6=_0x1857b6||0xc8;return function(_0x49e315){if(_0x49e315){return _0x2004be['status'](_0x1857b6)['json'](_0x49e315);}};}function respondWithFilteredResult(_0x34840a,_0x5349d6){return function(_0x22620b){if(_0x22620b){var _0x568395=typeof _0x5349d6[_0xd80f('0xd')]===_0xd80f('0xe')&&typeof _0x5349d6[_0xd80f('0xf')]===_0xd80f('0xe');var _0x134546=_0x22620b['count'];var _0x29603f=_0x568395?0x0:_0x5349d6[_0xd80f('0xd')];var _0x5f57d2=_0x568395?_0x22620b[_0xd80f('0x10')]:_0x5349d6['offset']+_0x5349d6[_0xd80f('0xf')];var _0x213987;if(_0x5f57d2>=_0x134546){_0x5f57d2=_0x134546;_0x213987=0xc8;}else{_0x213987=0xce;}_0x34840a[_0xd80f('0xc')](_0x213987);return _0x34840a[_0xd80f('0x11')]('Content-Range',_0x29603f+'-'+_0x5f57d2+'/'+_0x134546)[_0xd80f('0x12')](_0x22620b);}return null;};}function saveUpdates(_0x545269){return function(_0x206185){if(_0x206185){return _0x206185[_0xd80f('0x13')](_0x545269)[_0xd80f('0x14')](function(_0x5740f5){return _0x5740f5;});}return null;};}function removeEntity(_0x523421){return function(_0x47fe4a){if(_0x47fe4a){return _0x47fe4a[_0xd80f('0x15')]()[_0xd80f('0x14')](function(){_0x523421['status'](0xcc)[_0xd80f('0x16')]();});}};}function handleEntityNotFound(_0x1d53e0){return function(_0x59dac2){if(!_0x59dac2){_0x1d53e0['sendStatus'](0x194);}return _0x59dac2;};}function handleError(_0x5b0b31,_0x345f31){_0x345f31=_0x345f31||0x1f4;return function(_0x311465){logger['error'](_0x311465[_0xd80f('0x17')]);if(_0x311465[_0xd80f('0x18')]){delete _0x311465[_0xd80f('0x18')];}_0x5b0b31['status'](_0x345f31)['send'](_0x311465);};}function maskClientSecret(_0x9f45a9){return _[_0xd80f('0x19')](_0x9f45a9[_0xd80f('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0x54ca50,_0x38283b){var _0x1f9e67={},_0x1b2eb3={},_0x19f852={'count':0x0,'rows':[]};var _0x19465c=_[_0xd80f('0x1b')](db['CloudProvider'][_0xd80f('0x1c')],function(_0x4ea83d){return{'name':_0x4ea83d[_0xd80f('0x1d')],'type':_0x4ea83d[_0xd80f('0x1e')][_0xd80f('0x1f')]};});_0x1b2eb3['model']=_['map'](_0x19465c,_0xd80f('0x18'));_0x1b2eb3[_0xd80f('0x20')]=_['keys'](_0x54ca50[_0xd80f('0x20')]);_0x1b2eb3[_0xd80f('0x21')]=_[_0xd80f('0x22')](_0x1b2eb3[_0xd80f('0x23')],_0x1b2eb3[_0xd80f('0x20')]);_0x1f9e67[_0xd80f('0x24')]=_[_0xd80f('0x22')](_0x1b2eb3[_0xd80f('0x23')],qs[_0xd80f('0x25')](_0x54ca50[_0xd80f('0x20')][_0xd80f('0x25')]));_0x1f9e67[_0xd80f('0x24')]=_0x1f9e67[_0xd80f('0x24')][_0xd80f('0x26')]?_0x1f9e67[_0xd80f('0x24')]:_0x1b2eb3[_0xd80f('0x23')];if(!_0x54ca50[_0xd80f('0x20')][_0xd80f('0x27')](_0xd80f('0x28'))){_0x1f9e67[_0xd80f('0xf')]=qs[_0xd80f('0xf')](_0x54ca50[_0xd80f('0x20')][_0xd80f('0xf')]);_0x1f9e67[_0xd80f('0xd')]=qs[_0xd80f('0xd')](_0x54ca50['query'][_0xd80f('0xd')]);}_0x1f9e67[_0xd80f('0x29')]=qs[_0xd80f('0x2a')](_0x54ca50[_0xd80f('0x20')][_0xd80f('0x2a')]);_0x1f9e67['where']=qs['filters'](_[_0xd80f('0x2b')](_0x54ca50[_0xd80f('0x20')],_0x1b2eb3[_0xd80f('0x21')]),_0x19465c);if(_0x54ca50[_0xd80f('0x20')]['filter']){_0x1f9e67[_0xd80f('0x2c')]=_['merge'](_0x1f9e67['where'],{'$or':_[_0xd80f('0x1b')](_0x19465c,function(_0x38bfb8){if(_0x38bfb8[_0xd80f('0x1e')]!=='VIRTUAL'){var _0x22e845={};_0x22e845[_0x38bfb8['name']]={'$like':'%'+_0x54ca50[_0xd80f('0x20')][_0xd80f('0x2d')]+'%'};return _0x22e845;}})});}_0x1f9e67=_[_0xd80f('0x2e')]({},_0x1f9e67,_0x54ca50[_0xd80f('0x2f')]);var _0x175baf={'where':_0x1f9e67[_0xd80f('0x2c')]};return db['CloudProvider'][_0xd80f('0x10')](_0x175baf)[_0xd80f('0x14')](function(_0x800f98){_0x19f852[_0xd80f('0x10')]=_0x800f98;if(_0x54ca50[_0xd80f('0x20')]['includeAll']){_0x1f9e67[_0xd80f('0x30')]=[{'all':!![]}];}return db['CloudProvider'][_0xd80f('0x31')](_0x1f9e67);})[_0xd80f('0x14')](function(_0x5bacde){_0x19f852[_0xd80f('0x32')]=_[_0xd80f('0x1b')](_0x5bacde,function(_0x1a4cc0){if(_0x1a4cc0[_0xd80f('0x33')]===_0xd80f('0x34')){var _0x5b7cbb=encryptor[_0xd80f('0x35')](_0x1a4cc0[_0xd80f('0x36')]);_0x1a4cc0[_0xd80f('0x36')]=maskClientSecret(_0x5b7cbb);}return _0x1a4cc0;});return _0x19f852;})[_0xd80f('0x14')](respondWithFilteredResult(_0x38283b,_0x1f9e67))['catch'](handleError(_0x38283b,null));};exports[_0xd80f('0x37')]=function(_0x70fe41,_0x1dceda){var _0x403c0f={'raw':!![],'where':{'id':_0x70fe41[_0xd80f('0x38')]['id']}},_0x398f70={};_0x398f70[_0xd80f('0x23')]=_['keys'](db[_0xd80f('0x39')][_0xd80f('0x1c')]);_0x398f70[_0xd80f('0x20')]=_['keys'](_0x70fe41[_0xd80f('0x20')]);_0x398f70[_0xd80f('0x21')]=_[_0xd80f('0x22')](_0x398f70[_0xd80f('0x23')],_0x398f70['query']);_0x403c0f['attributes']=_[_0xd80f('0x22')](_0x398f70[_0xd80f('0x23')],qs[_0xd80f('0x25')](_0x70fe41[_0xd80f('0x20')][_0xd80f('0x25')]));_0x403c0f[_0xd80f('0x24')]=_0x403c0f[_0xd80f('0x24')][_0xd80f('0x26')]?_0x403c0f[_0xd80f('0x24')]:_0x398f70[_0xd80f('0x23')];if(_0x70fe41[_0xd80f('0x20')][_0xd80f('0x3a')]){_0x403c0f['include']=[{'all':!![]}];}_0x403c0f=_[_0xd80f('0x2e')]({},_0x403c0f,_0x70fe41[_0xd80f('0x2f')]);return db[_0xd80f('0x39')][_0xd80f('0x3b')](_0x403c0f)['then'](handleEntityNotFound(_0x1dceda,null))[_0xd80f('0x14')](function(_0x10dd7f){if(_0x10dd7f[_0xd80f('0x33')]===_0xd80f('0x34')){var _0x42cc90=encryptor['decryptString'](_0x10dd7f['data3']);_0x10dd7f[_0xd80f('0x36')]=maskClientSecret(_0x42cc90);}return _0x10dd7f;})[_0xd80f('0x14')](respondWithResult(_0x1dceda,null))['catch'](handleError(_0x1dceda,null));};exports[_0xd80f('0x3c')]=function(_0xeb33bf,_0x2abed9){if(!_0xeb33bf[_0xd80f('0x3d')][_0xd80f('0x18')])throw new Error(_0xd80f('0x3e'));if(!_0xeb33bf[_0xd80f('0x3d')][_0xd80f('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x277f98=db[_0xd80f('0x39')]['rawAttributes'][_0xd80f('0x33')]['values'];if(!_0x277f98[_0xd80f('0x3f')](_0xeb33bf['body'][_0xd80f('0x33')]))throw new Error(_0xd80f('0x40')+_0x277f98[_0xd80f('0x41')](',\x20'));if(_0xeb33bf['body'][_0xd80f('0x33')]===_0xd80f('0x34')&&_0xeb33bf['body'][_0xd80f('0x36')]){_0xeb33bf[_0xd80f('0x3d')]['data3']=encryptor['encryptString'](_0xeb33bf[_0xd80f('0x3d')]['data3']);}return db[_0xd80f('0x39')][_0xd80f('0x3c')](_0xeb33bf['body'],{})[_0xd80f('0x14')](respondWithResult(_0x2abed9,0xc9))['catch'](handleError(_0x2abed9,null));};exports[_0xd80f('0x13')]=function(_0x36ae4f,_0x24caa4){if(_0x36ae4f[_0xd80f('0x3d')]['id']){delete _0x36ae4f[_0xd80f('0x3d')]['id'];}return db[_0xd80f('0x39')][_0xd80f('0x3b')]({'where':{'id':_0x36ae4f[_0xd80f('0x38')]['id']}})[_0xd80f('0x14')](handleEntityNotFound(_0x24caa4,null))[_0xd80f('0x14')](function(_0x4f2e10){if(_0x4f2e10[_0xd80f('0x33')]===_0xd80f('0x34')&&_0x36ae4f[_0xd80f('0x3d')]['data3']){_0x36ae4f[_0xd80f('0x3d')][_0xd80f('0x36')]=encryptor['encryptString'](_0x36ae4f[_0xd80f('0x3d')]['data3']);}return _0x4f2e10;})[_0xd80f('0x14')](saveUpdates(_0x36ae4f[_0xd80f('0x3d')],null))[_0xd80f('0x14')](respondWithResult(_0x24caa4,null))[_0xd80f('0x42')](handleError(_0x24caa4,null));};exports['destroy']=function(_0x1999b2,_0x5d8f32){return db[_0xd80f('0x39')][_0xd80f('0x3b')]({'where':{'id':_0x1999b2[_0xd80f('0x38')]['id']}})[_0xd80f('0x14')](handleEntityNotFound(_0x5d8f32,null))[_0xd80f('0x14')](removeEntity(_0x5d8f32,null))['catch'](handleError(_0x5d8f32,null));};exports[_0xd80f('0x43')]=function(_0x3ea796,_0x413b65){return db[_0xd80f('0x39')][_0xd80f('0x44')]({'where':{'id':_0x3ea796[_0xd80f('0x38')]['id']},'raw':!![]})['then'](function(_0x23a38f){if(!_0x23a38f)return _0x413b65[_0xd80f('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x23a38f,_0x3ea796[_0xd80f('0x45')]['id'])};})['then'](respondWithResult(_0x413b65,null))[_0xd80f('0x42')](handleError(_0x413b65,null));};exports[_0xd80f('0x46')]=function(_0x801a33,_0x546a70){var _0x2ba6f5=_0x801a33[_0xd80f('0x3d')];var _0x3835ca;var _0x4e5a27;if(_0x2ba6f5['error'])throw _0x2ba6f5;redis[_0xd80f('0x47')](_0x2ba6f5[_0xd80f('0x48')])[_0xd80f('0x14')](function(_0x418b9c){if(!_0x418b9c)throw new Error('Invalid\x20state\x20parameter');_0x3835ca=JSON['parse'](_0x418b9c);var _0x21c4fc=Buffer[_0xd80f('0x49')](_0x2ba6f5[_0xd80f('0x48')],_0xd80f('0x4a'))[_0xd80f('0x4b')](_0xd80f('0x4c'));_0x4e5a27=JSON['parse'](_0x21c4fc);if(!oauth['isValidIdToken'](_0x2ba6f5[_0xd80f('0x4d')],_0x3835ca[_0xd80f('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xd80f('0x4f')](_0x2ba6f5[_0xd80f('0x48')]);return oauth[_0xd80f('0x50')](_0x2ba6f5[_0xd80f('0x51')],_0x3835ca);})[_0xd80f('0x14')](function(_0x462ee5){_0x3835ca[_0xd80f('0x52')]=_0x462ee5['access_token'];_0x3835ca[_0xd80f('0x53')]=_0x462ee5[_0xd80f('0x54')];return db[_0xd80f('0x39')][_0xd80f('0x13')]({'data5':_0x3835ca[_0xd80f('0x52')],'data6':_0x3835ca[_0xd80f('0x53')]},{'where':{'id':_0x3835ca['id']}});})[_0xd80f('0x14')](function(){oauth[_0xd80f('0x55')](_0x3835ca);socket[_0xd80f('0x56')](_0xd80f('0x57'),{'id':_0x4e5a27['id']});return;})[_0xd80f('0x14')](respondWithStatusCode(_0x546a70,null))['catch'](function(_0x3f9b70){if(_0x4e5a27){socket[_0xd80f('0x56')](_0xd80f('0x58'),{'id':_0x4e5a27['id']});}if(!_0x3835ca){logger[_0xd80f('0x59')](_0xd80f('0x5a'),_0x3f9b70);return _0x546a70[_0xd80f('0xc')](0x1f4)[_0xd80f('0x5b')](_0x3f9b70['message']);}logger[_0xd80f('0x59')](_0xd80f('0x5c'),_0x3835ca['id'],JSON[_0xd80f('0x5d')](_0x3f9b70));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 04af9e1..2fad96f 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 _0xa916=['bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','lodash','moment'];(function(_0x486dbe,_0x1f86b9){var _0x38f1c8=function(_0x5f7ac6){while(--_0x5f7ac6){_0x486dbe['push'](_0x486dbe['shift']());}};_0x38f1c8(++_0x1f86b9);}(_0xa916,0xf1));var _0x6a91=function(_0x5626d2,_0x380970){_0x5626d2=_0x5626d2-0x0;var _0x4213a0=_0xa916[_0x5626d2];return _0x4213a0;};'use strict';var _=require(_0x6a91('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6a91('0x1'));var BPromise=require(_0x6a91('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a91('0x3'));var rimraf=require(_0x6a91('0x4'));var config=require(_0x6a91('0x5'));var attributes=require(_0x6a91('0x6'));module[_0x6a91('0x7')]=function(_0x3098b5,_0x1ebbe2){return _0x3098b5['define'](_0x6a91('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x944b=['rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','lodash','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x944b,0x191));var _0xb944=function(_0x3e69cd,_0x4d3233){_0x3e69cd=_0x3e69cd-0x0;var _0x209c12=_0x944b[_0x3e69cd];return _0x209c12;};'use strict';var _=require(_0xb944('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb944('0x1'));var moment=require('moment');var BPromise=require(_0xb944('0x2'));var rp=require(_0xb944('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb944('0x4'));var config=require(_0xb944('0x5'));var attributes=require(_0xb944('0x6'));module['exports']=function(_0x268bce,_0x4c17ae){return _0x268bce[_0xb944('0x7')](_0xb944('0x8'),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 d5d53a6..28aa472 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 _0xd4a9=['https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','push','/.default','join','Outlook365','Dynamics365','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','client_id','response_mode','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','decode','payload','issuer','audience','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','data4','decryptString','POST','{TENANT_ID}','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data1','intervals','bind','all','inspect','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0xd4a9,0x179));var _0x9d4a=function(_0x2cd72a,_0x5d2754){_0x2cd72a=_0x2cd72a-0x0;var _0x5e19bd=_0xd4a9[_0x2cd72a];return _0x5e19bd;};'use strict';var _=require(_0x9d4a('0x0'));var crypto=require(_0x9d4a('0x1'));var jwt=require(_0x9d4a('0x2'));var moment=require('moment');var Redis=require(_0x9d4a('0x3'));var rp=require(_0x9d4a('0x4'));var util=require(_0x9d4a('0x5'));var encryptor=require(_0x9d4a('0x6'));var config=require(_0x9d4a('0x7'));var logger=require('../../config/logger')(_0x9d4a('0x8'));var schedule=require(_0x9d4a('0x9'));var db=require(_0x9d4a('0xa'))['db'];config['redis']=_[_0x9d4a('0xb')](config[_0x9d4a('0xc')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x9d4a('0xc')]);var MICROSOFT_AUTH_URL=_0x9d4a('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x9d4a('0xe'),_0x9d4a('0xf'),_0x9d4a('0x10'),_0x9d4a('0x11'),_0x9d4a('0x12')],'Dynamics365':[_0x9d4a('0x13'),_0x9d4a('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x9d4a('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x9d4a('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d31fb){var _0x4aead1=_[_0x9d4a('0x16')](AZURE_AUTH_SCOPES[_0x2d31fb[_0x9d4a('0x17')]]);if(_0x2d31fb[_0x9d4a('0x17')]==='Dynamics365')_0x4aead1[_0x9d4a('0x18')](_0x2d31fb['data7']+_0x9d4a('0x19'));return _0x4aead1[_0x9d4a('0x1a')]('\x20');}function getAccessTokenScope(_0x328aa6){if(_0x328aa6[_0x9d4a('0x17')]===_0x9d4a('0x1b'))return _0x9d4a('0x10');if(_0x328aa6[_0x9d4a('0x17')]===_0x9d4a('0x1c'))return _0x328aa6['data7']+_0x9d4a('0x19');}function generateMicrosoftAuthorizationUrl(_0x28d7a6,_0x31aaf0){var _0x372171=MICROSOFT_AUTH_URL[_0x9d4a('0x1d')]('{TENANT_ID}',_0x28d7a6[_0x9d4a('0x1e')]);var _0x1c0f24=[_0x9d4a('0x1f'),_0x9d4a('0x20')];var _0xf7f3ed=Buffer[_0x9d4a('0x21')](JSON[_0x9d4a('0x22')]({'id':_0x31aaf0}))[_0x9d4a('0x23')](_0x9d4a('0x24'));var _0x3c0686=crypto[_0x9d4a('0x25')](0x10)[_0x9d4a('0x23')]('hex');var _0x3c073d=getAuthorizationScopes(_0x28d7a6);var _0x289963=[{'key':_0x9d4a('0x26'),'value':_0x28d7a6['data1']},{'key':'response_type','value':encodeURIComponent(_0x1c0f24['join']('\x20'))},{'key':'redirect_uri','value':_0x28d7a6['data4']},{'key':_0x9d4a('0x27'),'value':'form_post'},{'key':_0x9d4a('0x28'),'value':encodeURIComponent(_0x3c073d)},{'key':_0x9d4a('0x29'),'value':_0xf7f3ed},{'key':_0x9d4a('0x2a'),'value':_0x3c0686},{'key':_0x9d4a('0x2b'),'value':_0x9d4a('0x2c')}];var _0x5a54a5=_0x372171+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x289963,function(_0x307f86){return _0x307f86[_0x9d4a('0x2d')]+'='+_0x307f86[_0x9d4a('0x2e')];})[_0x9d4a('0x1a')]('&');_0x28d7a6[_0x9d4a('0x2f')]={'issuer':_0x372171[_0x9d4a('0x1d')](_0x9d4a('0x30'),''),'audience':_0x28d7a6['data1'],'state':_0xf7f3ed,'nonce':_0x3c0686};redis[_0x9d4a('0x31')](_0xf7f3ed,JSON[_0x9d4a('0x22')](_0x28d7a6));return _0x5a54a5;}function isValidIdToken(_0x32b6f8,_0x156fb1){try{var _0x39c8f1=jwt[_0x9d4a('0x32')](_0x32b6f8,{'complete':!![]});var _0x590513=_0x39c8f1[_0x9d4a('0x33')];if(_0x590513['iss']!==_0x156fb1[_0x9d4a('0x34')])return![];if(_0x590513['aud']!==_0x156fb1[_0x9d4a('0x35')])return![];if(_0x590513[_0x9d4a('0x2a')]!==_0x156fb1[_0x9d4a('0x2a')])return![];if(moment()[_0x9d4a('0x36')](moment[_0x9d4a('0x37')](_0x590513[_0x9d4a('0x38')])))return![];return!![];}catch(_0x3d0179){throw _0x3d0179;}}function refreshOauth2MicrosoftAccessToken(_0x3b726c){return Promise[_0x9d4a('0x39')]()['then'](function(){if(_0x3b726c[_0x9d4a('0x3a')])return _0x3b726c;return db[_0x9d4a('0x3b')][_0x9d4a('0x3c')]({'where':{'id':_0x3b726c['id']},'raw':!![]});})[_0x9d4a('0x3d')](function(_0x256e80){var _0x28e03f={'grant_type':_0x9d4a('0x3e'),'refresh_token':_0x256e80[_0x9d4a('0x3f')],'scope':getAccessTokenScope(_0x256e80),'redirect_uri':_0x256e80[_0x9d4a('0x40')],'client_id':_0x256e80['data1'],'client_secret':encryptor[_0x9d4a('0x41')](_0x256e80[_0x9d4a('0x3a')])};var _0x21a2dc={'method':_0x9d4a('0x42'),'uri':MICROSOFT_AUTH_URL[_0x9d4a('0x1d')](_0x9d4a('0x43'),_0x256e80[_0x9d4a('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28e03f,'json':!![]};return rp(_0x21a2dc);})[_0x9d4a('0x3d')](function(_0x50e104){_0x3b726c[_0x9d4a('0x44')]=_0x50e104[_0x9d4a('0x45')];_0x3b726c[_0x9d4a('0x3f')]=_0x50e104[_0x9d4a('0x3e')];return db['CloudProvider'][_0x9d4a('0x46')]({'data5':_0x3b726c[_0x9d4a('0x44')],'data6':_0x3b726c['data6']},{'where':{'id':_0x3b726c['id']}});})[_0x9d4a('0x3d')](function(){return _0x3b726c;})[_0x9d4a('0x47')](function(_0x522522){logger[_0x9d4a('0x48')](_0x9d4a('0x49'),_0x3b726c['id'],_0x522522);});}function getOauth2MicrosoftAccessToken(_0x29211c,_0x14b3cf){var _0x22972f={'grant_type':'authorization_code','code':_0x29211c,'scope':getAccessTokenScope(_0x14b3cf),'redirect_uri':_0x14b3cf[_0x9d4a('0x40')],'client_id':_0x14b3cf[_0x9d4a('0x4a')],'client_secret':encryptor[_0x9d4a('0x41')](_0x14b3cf[_0x9d4a('0x3a')])};var _0x5dcdb3={'method':_0x9d4a('0x42'),'uri':MICROSOFT_AUTH_URL[_0x9d4a('0x1d')](_0x9d4a('0x43'),_0x14b3cf[_0x9d4a('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x22972f,'json':!![]};return rp(_0x5dcdb3);}function startRefreshInterval(_0x3df5e5){var _0x375ae0=schedule[_0x9d4a('0x4b')];if(_0x375ae0[_0x3df5e5['id']])clearInterval(_0x375ae0[_0x3df5e5['id']]);_0x375ae0[_0x3df5e5['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9d4a('0x4c')](this,{'id':_0x3df5e5['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x375ae0;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9d4a('0x3d')](function(_0x44971c){var _0x47e548=_0x44971c['map'](function(_0x558268){return refreshOauth2MicrosoftAccessToken(_0x558268)[_0x9d4a('0x3d')](function(_0x3aec08){startRefreshInterval(_0x3aec08);});});return Promise[_0x9d4a('0x4d')](_0x47e548);})[_0x9d4a('0x47')](function(_0x2f3962){var _0x4d7c8e=_0x2f3962?util[_0x9d4a('0x4e')](_0x2f3962,{'showHidden':![],'depth':null}):'';logger[_0x9d4a('0x48')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4d7c8e);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x4c2a=['code','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','set','decode','iss','issuer','aud','isAfter','exp','resolve','findOne','then','refresh_token','data6','data4','decryptString','data3','POST','access_token','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','bind','intervals','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/logger','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','type','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','{TENANT_ID}','data2'];(function(_0x214330,_0x266cac){var _0x4d408f=function(_0x49e5be){while(--_0x49e5be){_0x214330['push'](_0x214330['shift']());}};_0x4d408f(++_0x266cac);}(_0x4c2a,0x11c));var _0xa4c2=function(_0x367ede,_0x834347){_0x367ede=_0x367ede-0x0;var _0x3d0da0=_0x4c2a[_0x367ede];return _0x3d0da0;};'use strict';var _=require(_0xa4c2('0x0'));var crypto=require('crypto');var jwt=require(_0xa4c2('0x1'));var moment=require(_0xa4c2('0x2'));var Redis=require('ioredis');var rp=require(_0xa4c2('0x3'));var util=require(_0xa4c2('0x4'));var encryptor=require(_0xa4c2('0x5'));var config=require('../../config/environment');var logger=require(_0xa4c2('0x6'))(_0xa4c2('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xa4c2('0x8')]=_[_0xa4c2('0x9')](config[_0xa4c2('0x8')],{'host':_0xa4c2('0xa'),'port':0x18eb});var redis=new Redis(config[_0xa4c2('0x8')]);var MICROSOFT_AUTH_URL=_0xa4c2('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa4c2('0xc'),'profile',_0xa4c2('0xd'),_0xa4c2('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xa4c2('0xf'),_0xa4c2('0x10')],'Dynamics365':[_0xa4c2('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xa4c2('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5e907f){var _0x389fdd=_['map'](AZURE_AUTH_SCOPES[_0x5e907f['type']]);if(_0x5e907f[_0xa4c2('0x12')]==='Dynamics365')_0x389fdd[_0xa4c2('0x13')](_0x5e907f[_0xa4c2('0x14')]+_0xa4c2('0x15'));return _0x389fdd[_0xa4c2('0x16')]('\x20');}function getAccessTokenScope(_0x19cbce){if(_0x19cbce[_0xa4c2('0x12')]===_0xa4c2('0x17'))return _0xa4c2('0x18');if(_0x19cbce[_0xa4c2('0x12')]===_0xa4c2('0x19'))return _0x19cbce[_0xa4c2('0x14')]+_0xa4c2('0x15');}function generateMicrosoftAuthorizationUrl(_0x5e3833,_0x12316e){var _0x58fc26=MICROSOFT_AUTH_URL['replace'](_0xa4c2('0x1a'),_0x5e3833[_0xa4c2('0x1b')]);var _0x5a2c4a=[_0xa4c2('0x1c'),'id_token'];var _0x5ab07f=Buffer['from'](JSON[_0xa4c2('0x1d')]({'id':_0x12316e}))[_0xa4c2('0x1e')]('base64');var _0x5855=crypto[_0xa4c2('0x1f')](0x10)['toString'](_0xa4c2('0x20'));var _0x207a79=getAuthorizationScopes(_0x5e3833);var _0x59cd50=[{'key':_0xa4c2('0x21'),'value':_0x5e3833[_0xa4c2('0x22')]},{'key':_0xa4c2('0x23'),'value':encodeURIComponent(_0x5a2c4a[_0xa4c2('0x16')]('\x20'))},{'key':_0xa4c2('0x24'),'value':_0x5e3833['data4']},{'key':_0xa4c2('0x25'),'value':_0xa4c2('0x26')},{'key':_0xa4c2('0x27'),'value':encodeURIComponent(_0x207a79)},{'key':_0xa4c2('0x28'),'value':_0x5ab07f},{'key':_0xa4c2('0x29'),'value':_0x5855},{'key':_0xa4c2('0x2a'),'value':_0xa4c2('0x2b')}];var _0x1c17dc=_0x58fc26+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x59cd50,function(_0x152757){return _0x152757[_0xa4c2('0x2c')]+'='+_0x152757[_0xa4c2('0x2d')];})['join']('&');_0x5e3833[_0xa4c2('0x2e')]={'issuer':_0x58fc26[_0xa4c2('0x2f')](_0xa4c2('0x30'),''),'audience':_0x5e3833[_0xa4c2('0x22')],'state':_0x5ab07f,'nonce':_0x5855};redis[_0xa4c2('0x31')](_0x5ab07f,JSON[_0xa4c2('0x1d')](_0x5e3833));return _0x1c17dc;}function isValidIdToken(_0x4a7156,_0x3dfa21){try{var _0x45aaeb=jwt[_0xa4c2('0x32')](_0x4a7156,{'complete':!![]});var _0x183ba0=_0x45aaeb['payload'];if(_0x183ba0[_0xa4c2('0x33')]!==_0x3dfa21[_0xa4c2('0x34')])return![];if(_0x183ba0[_0xa4c2('0x35')]!==_0x3dfa21['audience'])return![];if(_0x183ba0[_0xa4c2('0x29')]!==_0x3dfa21[_0xa4c2('0x29')])return![];if(moment()[_0xa4c2('0x36')](moment['unix'](_0x183ba0[_0xa4c2('0x37')])))return![];return!![];}catch(_0x436c0f){throw _0x436c0f;}}function refreshOauth2MicrosoftAccessToken(_0x55fd68){return Promise[_0xa4c2('0x38')]()['then'](function(){if(_0x55fd68['data3'])return _0x55fd68;return db['CloudProvider'][_0xa4c2('0x39')]({'where':{'id':_0x55fd68['id']},'raw':!![]});})[_0xa4c2('0x3a')](function(_0x1ac8d2){var _0x1bf55f={'grant_type':_0xa4c2('0x3b'),'refresh_token':_0x1ac8d2[_0xa4c2('0x3c')],'scope':getAccessTokenScope(_0x1ac8d2),'redirect_uri':_0x1ac8d2[_0xa4c2('0x3d')],'client_id':_0x1ac8d2[_0xa4c2('0x22')],'client_secret':encryptor[_0xa4c2('0x3e')](_0x1ac8d2[_0xa4c2('0x3f')])};var _0x1d856d={'method':_0xa4c2('0x40'),'uri':MICROSOFT_AUTH_URL[_0xa4c2('0x2f')](_0xa4c2('0x1a'),_0x1ac8d2[_0xa4c2('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1bf55f,'json':!![]};return rp(_0x1d856d);})[_0xa4c2('0x3a')](function(_0x4d634b){_0x55fd68['data5']=_0x4d634b[_0xa4c2('0x41')];_0x55fd68[_0xa4c2('0x3c')]=_0x4d634b['refresh_token'];return db[_0xa4c2('0x42')][_0xa4c2('0x43')]({'data5':_0x55fd68['data5'],'data6':_0x55fd68[_0xa4c2('0x3c')]},{'where':{'id':_0x55fd68['id']}});})[_0xa4c2('0x3a')](function(){return _0x55fd68;})[_0xa4c2('0x44')](function(_0xe0ac77){logger[_0xa4c2('0x45')](_0xa4c2('0x46'),_0x55fd68['id'],_0xe0ac77);});}function getOauth2MicrosoftAccessToken(_0x21f4ed,_0x494d66){var _0x438bac={'grant_type':_0xa4c2('0x47'),'code':_0x21f4ed,'scope':getAccessTokenScope(_0x494d66),'redirect_uri':_0x494d66[_0xa4c2('0x3d')],'client_id':_0x494d66['data1'],'client_secret':encryptor[_0xa4c2('0x3e')](_0x494d66[_0xa4c2('0x3f')])};var _0x5587ee={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa4c2('0x2f')]('{TENANT_ID}',_0x494d66[_0xa4c2('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x438bac,'json':!![]};return rp(_0x5587ee);}function startRefreshInterval(_0xc902d3){var _0x5a4a6d=schedule['intervals'];if(_0x5a4a6d[_0xc902d3['id']])clearInterval(_0x5a4a6d[_0xc902d3['id']]);_0x5a4a6d[_0xc902d3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa4c2('0x48')](this,{'id':_0xc902d3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa4c2('0x49')]=_0x5a4a6d;}function startAllRefreshIntervals(){return db[_0xa4c2('0x42')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa4c2('0x3a')](function(_0x143f2b){var _0x5f0849=_0x143f2b['map'](function(_0x3f1b56){return refreshOauth2MicrosoftAccessToken(_0x3f1b56)[_0xa4c2('0x3a')](function(_0x162d47){startRefreshInterval(_0x162d47);});});return Promise[_0xa4c2('0x4a')](_0x5f0849);})[_0xa4c2('0x44')](function(_0x37efd6){var _0x46bc14=_0x37efd6?util[_0xa4c2('0x4b')](_0x37efd6,{'showHidden':![],'depth':null}):'';logger['error'](_0xa4c2('0x4c'),_0x46bc14);});}module[_0xa4c2('0x4d')]={'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 dc681b2..71d0be8 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 _0x543b=['http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x21e696,_0x4a67b0){var _0x2c5b3f=function(_0x450162){while(--_0x450162){_0x21e696['push'](_0x21e696['shift']());}};_0x2c5b3f(++_0x4a67b0);}(_0x543b,0x18d));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb543('0x0'));var util=require(_0xb543('0x1'));var moment=require(_0xb543('0x2'));var BPromise=require('bluebird');var rs=require(_0xb543('0x3'));var fs=require('fs');var Redis=require(_0xb543('0x4'));var db=require(_0xb543('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb543('0x6'))(_0xb543('0x7'));var config=require(_0xb543('0x8'));var jayson=require(_0xb543('0x9'));var client=jayson[_0xb543('0xa')][_0xb543('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208c95,_0x338142,_0x21bb48){return new BPromise(function(_0x307a74,_0x2a2c1f){return client[_0xb543('0xc')](_0x208c95,_0x21bb48)['then'](function(_0xa94776){logger['info'](_0xb543('0xd'),_0x338142,_0xb543('0xe'));logger[_0xb543('0xf')](_0xb543('0x10'),_0x338142,_0xb543('0xe'),JSON[_0xb543('0x11')](_0xa94776));if(_0xa94776['error']){if(_0xa94776[_0xb543('0x12')][_0xb543('0x13')]===0x1f4){logger[_0xb543('0x12')]('CloudProvider,\x20%s,\x20%s',_0x338142,_0xa94776[_0xb543('0x12')][_0xb543('0x14')]);return _0x2a2c1f(_0xa94776[_0xb543('0x12')]['message']);}logger['error'](_0xb543('0xd'),_0x338142,_0xa94776[_0xb543('0x12')][_0xb543('0x14')]);return _0x307a74(_0xa94776[_0xb543('0x12')]['message']);}else{logger[_0xb543('0x15')](_0xb543('0xd'),_0x338142,_0xb543('0xe'));_0x307a74(_0xa94776[_0xb543('0x16')]['message']);}})[_0xb543('0x17')](function(_0x5230df){logger[_0xb543('0x12')](_0xb543('0xd'),_0x338142,_0x5230df);_0x2a2c1f(_0x5230df);});});}
\ No newline at end of file
+var _0x4813=['lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x431360,_0x436708){var _0x561365=function(_0x10796c){while(--_0x10796c){_0x431360['push'](_0x431360['shift']());}};_0x561365(++_0x436708);}(_0x4813,0xdc));var _0x3481=function(_0x494322,_0x1e6e02){_0x494322=_0x494322-0x0;var _0x2cc75d=_0x4813[_0x494322];return _0x2cc75d;};'use strict';var _=require(_0x3481('0x0'));var util=require('util');var moment=require(_0x3481('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3481('0x2'));var db=require(_0x3481('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3481('0x4'))(_0x3481('0x5'));var config=require(_0x3481('0x6'));var jayson=require(_0x3481('0x7'));var client=jayson[_0x3481('0x8')][_0x3481('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x369c3b,_0x54a2c8,_0x4d23ef){return new BPromise(function(_0x41592f,_0x527c3c){return client[_0x3481('0xa')](_0x369c3b,_0x4d23ef)[_0x3481('0xb')](function(_0x39b6c4){logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));logger[_0x3481('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x54a2c8,'request\x20sent',JSON[_0x3481('0x10')](_0x39b6c4));if(_0x39b6c4[_0x3481('0x11')]){if(_0x39b6c4[_0x3481('0x11')][_0x3481('0x12')]===0x1f4){logger[_0x3481('0x11')]('CloudProvider,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);return _0x527c3c(_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);}logger[_0x3481('0x11')]('CloudProvider,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4['error'][_0x3481('0x13')]);return _0x41592f(_0x39b6c4[_0x3481('0x11')]['message']);}else{logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));_0x41592f(_0x39b6c4[_0x3481('0x14')][_0x3481('0x13')]);}})[_0x3481('0x15')](function(_0x2a3981){logger['error'](_0x3481('0xd'),_0x54a2c8,_0x2a3981);_0x527c3c(_0x2a3981);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6044a3d..7088e67 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x2b94e9,_0x36e1d2){var _0xb4473d=function(_0x365db2){while(--_0x365db2){_0x2b94e9['push'](_0x2b94e9['shift']());}};_0xb4473d(++_0x36e1d2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+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(_0x3cbada,_0x41fa40){var _0x3e31e5=function(_0x30d7bc){while(--_0x30d7bc){_0x3cbada['push'](_0x3cbada['shift']());}};_0x3e31e5(++_0x41fa40);}(_0xdb28,0x106));var _0x8db2=function(_0x150ff2,_0x30f506){_0x150ff2=_0x150ff2-0x0;var _0xba3f80=_0xdb28[_0x150ff2];return _0xba3f80;};'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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 44e4ea9..816f9f2 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 _0x9fbb=['STRING','sequelize'];(function(_0xfca425,_0x2950d6){var _0x44ea89=function(_0x5c0db6){while(--_0x5c0db6){_0xfca425['push'](_0xfca425['shift']());}};_0x44ea89(++_0x2950d6);}(_0x9fbb,0x1eb));var _0xb9fb=function(_0x19c348,_0x372110){_0x19c348=_0x19c348-0x0;var _0x3f0f8b=_0x9fbb[_0x19c348];return _0x3f0f8b;};'use strict';var Sequelize=require(_0xb9fb('0x0'));module['exports']={'name':{'type':Sequelize[_0xb9fb('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb9fb('0x1')]},'companyId':{'type':Sequelize[_0xb9fb('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb9fb('0x1')]},'fax':{'type':Sequelize[_0xb9fb('0x1')]},'type':{'type':Sequelize[_0xb9fb('0x1')]},'street':{'type':Sequelize[_0xb9fb('0x1')]},'postalCode':{'type':Sequelize[_0xb9fb('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xb9fb('0x1')]},'email':{'type':Sequelize[_0xb9fb('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xb9fb('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xb9fb('0x1')]},'description':{'type':Sequelize[_0xb9fb('0x1')]}};
\ No newline at end of file
+var _0x2b68=['STRING','exports'];(function(_0x261992,_0x31cfbb){var _0x356f3b=function(_0x5ce0d7){while(--_0x5ce0d7){_0x261992['push'](_0x261992['shift']());}};_0x356f3b(++_0x31cfbb);}(_0x2b68,0x99));var _0x82b6=function(_0x237fd6,_0x59d931){_0x237fd6=_0x237fd6-0x0;var _0x253f77=_0x2b68[_0x237fd6];return _0x253f77;};'use strict';var Sequelize=require('sequelize');module[_0x82b6('0x0')]={'name':{'type':Sequelize[_0x82b6('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x82b6('0x1')]},'companyId':{'type':Sequelize[_0x82b6('0x1')]},'website':{'type':Sequelize[_0x82b6('0x1')]},'phone':{'type':Sequelize[_0x82b6('0x1')]},'fax':{'type':Sequelize[_0x82b6('0x1')]},'type':{'type':Sequelize[_0x82b6('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x82b6('0x1')]},'city':{'type':Sequelize[_0x82b6('0x1')]},'country':{'type':Sequelize[_0x82b6('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x82b6('0x1')]},'sPostalCode':{'type':Sequelize[_0x82b6('0x1')]},'sCity':{'type':Sequelize[_0x82b6('0x1')]},'sCountry':{'type':Sequelize[_0x82b6('0x1')]},'description':{'type':Sequelize[_0x82b6('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 1f826d2..f0e49f2 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 _0xae75=['status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addContacts','ids','omit','findOne','CmContact','sort','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4be563,_0x371f7d){var _0xa7d890=function(_0xe80d67){while(--_0xe80d67){_0x4be563['push'](_0x4be563['shift']());}};_0xa7d890(++_0x371f7d);}(_0xae75,0x9a));var _0x5ae7=function(_0x1a1e6e,_0x2155cc){_0x1a1e6e=_0x1a1e6e-0x0;var _0x311ad6=_0xae75[_0x1a1e6e];return _0x311ad6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ae7('0x0'));var zipdir=require(_0x5ae7('0x1'));var jsonpatch=require(_0x5ae7('0x2'));var rp=require(_0x5ae7('0x3'));var moment=require(_0x5ae7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ae7('0x5'));var util=require(_0x5ae7('0x6'));var path=require(_0x5ae7('0x7'));var sox=require(_0x5ae7('0x8'));var csv=require('to-csv');var ejs=require(_0x5ae7('0x9'));var fs=require('fs');var fs_extra=require(_0x5ae7('0xa'));var _=require('lodash');var squel=require(_0x5ae7('0xb'));var crypto=require(_0x5ae7('0xc'));var jsforce=require(_0x5ae7('0xd'));var deskjs=require(_0x5ae7('0xe'));var toCsv=require(_0x5ae7('0xf'));var querystring=require('querystring');var Papa=require(_0x5ae7('0x10'));var Redis=require(_0x5ae7('0x11'));var authService=require(_0x5ae7('0x12'));var qs=require(_0x5ae7('0x13'));var as=require(_0x5ae7('0x14'));var hardwareService=require(_0x5ae7('0x15'));var logger=require(_0x5ae7('0x16'))(_0x5ae7('0x17'));var utils=require('../../config/utils');var config=require(_0x5ae7('0x18'));var licenseUtil=require(_0x5ae7('0x19'));var db=require(_0x5ae7('0x1a'))['db'];function respondWithStatusCode(_0x1ad294,_0x3cb10a){_0x3cb10a=_0x3cb10a||0xcc;return function(_0x3ec136){if(_0x3ec136){return _0x1ad294[_0x5ae7('0x1b')](_0x3cb10a);}return _0x1ad294[_0x5ae7('0x1c')](_0x3cb10a)[_0x5ae7('0x1d')]();};}function respondWithResult(_0x34ebd4,_0x2c6ef8){_0x2c6ef8=_0x2c6ef8||0xc8;return function(_0x52b4db){if(_0x52b4db){return _0x34ebd4[_0x5ae7('0x1c')](_0x2c6ef8)[_0x5ae7('0x1e')](_0x52b4db);}};}function respondWithFilteredResult(_0x20ff4a,_0x306398){return function(_0x7558e7){if(_0x7558e7){var _0x31909e=typeof _0x306398[_0x5ae7('0x1f')]===_0x5ae7('0x20')&&typeof _0x306398[_0x5ae7('0x21')]===_0x5ae7('0x20');var _0xd82adf=_0x7558e7[_0x5ae7('0x22')];var _0x220e87=_0x31909e?0x0:_0x306398[_0x5ae7('0x1f')];var _0x15ab8a=_0x31909e?_0x7558e7[_0x5ae7('0x22')]:_0x306398['offset']+_0x306398[_0x5ae7('0x21')];var _0x4a2043;if(_0x15ab8a>=_0xd82adf){_0x15ab8a=_0xd82adf;_0x4a2043=0xc8;}else{_0x4a2043=0xce;}_0x20ff4a[_0x5ae7('0x1c')](_0x4a2043);return _0x20ff4a['set'](_0x5ae7('0x23'),_0x220e87+'-'+_0x15ab8a+'/'+_0xd82adf)[_0x5ae7('0x1e')](_0x7558e7);}return null;};}function patchUpdates(_0x24ab52){return function(_0x10ed99){try{jsonpatch[_0x5ae7('0x24')](_0x10ed99,_0x24ab52,!![]);}catch(_0x1da844){return BPromise['reject'](_0x1da844);}return _0x10ed99[_0x5ae7('0x25')]();};}function saveUpdates(_0x795410,_0x2334d5){return function(_0x4857b9){if(_0x4857b9){return _0x4857b9[_0x5ae7('0x26')](_0x795410)[_0x5ae7('0x27')](function(_0x15e142){return _0x15e142;});}return null;};}function removeEntity(_0x57f9fd,_0x20b89c){return function(_0x4623bb){if(_0x4623bb){return _0x4623bb[_0x5ae7('0x28')]()[_0x5ae7('0x27')](function(){var _0xd614ca=_0x4623bb[_0x5ae7('0x29')]({'plain':!![]});var _0x2db3c1=_0x5ae7('0x2a');return db[_0x5ae7('0x2b')][_0x5ae7('0x28')]({'where':{'type':_0x2db3c1,'resourceId':_0xd614ca['id']}})[_0x5ae7('0x27')](function(){return _0x4623bb;});})[_0x5ae7('0x27')](function(){_0x57f9fd[_0x5ae7('0x1c')](0xcc)[_0x5ae7('0x1d')]();});}};}function handleEntityNotFound(_0x22d679,_0xa5b870){return function(_0x250494){if(!_0x250494){_0x22d679[_0x5ae7('0x1b')](0x194);}return _0x250494;};}function handleError(_0x192aec,_0x4881fe){_0x4881fe=_0x4881fe||0x1f4;return function(_0x2463f1){logger[_0x5ae7('0x2c')](_0x2463f1[_0x5ae7('0x2d')]);if(_0x2463f1[_0x5ae7('0x2e')]){delete _0x2463f1['name'];}_0x192aec['status'](_0x4881fe)[_0x5ae7('0x2f')](_0x2463f1);};}exports['index']=function(_0x59a2ae,_0x2c6f35){var _0x4391a7={},_0x1ee3c7={},_0x4a3b79={'count':0x0,'rows':[]};return db[_0x5ae7('0x30')]['describe']()[_0x5ae7('0x27')](function(_0x2c1cd5){_0x1ee3c7['model']=_[_0x5ae7('0x31')](_0x2c1cd5);_0x1ee3c7['query']=_['keys'](_0x59a2ae[_0x5ae7('0x32')]);_0x1ee3c7[_0x5ae7('0x33')]=_[_0x5ae7('0x34')](_0x1ee3c7[_0x5ae7('0x35')],_0x1ee3c7[_0x5ae7('0x32')]);_0x4391a7[_0x5ae7('0x36')]=_[_0x5ae7('0x34')](_0x1ee3c7[_0x5ae7('0x35')],qs[_0x5ae7('0x37')](_0x59a2ae[_0x5ae7('0x32')][_0x5ae7('0x37')]));_0x4391a7[_0x5ae7('0x36')]=_0x4391a7[_0x5ae7('0x36')][_0x5ae7('0x38')]?_0x4391a7['attributes']:_0x1ee3c7[_0x5ae7('0x35')];if(!_0x59a2ae['query'][_0x5ae7('0x39')](_0x5ae7('0x3a'))){_0x4391a7['limit']=qs[_0x5ae7('0x21')](_0x59a2ae[_0x5ae7('0x32')]['limit']);_0x4391a7[_0x5ae7('0x1f')]=qs[_0x5ae7('0x1f')](_0x59a2ae[_0x5ae7('0x32')][_0x5ae7('0x1f')]);}_0x4391a7[_0x5ae7('0x3b')]=qs['sort'](_0x59a2ae['query']['sort']);_0x4391a7['where']=qs['filters'](_[_0x5ae7('0x3c')](_0x59a2ae[_0x5ae7('0x32')],_0x1ee3c7['filters']),_0x2c1cd5);if(_0x59a2ae['query'][_0x5ae7('0x3d')]){_0x4391a7[_0x5ae7('0x3e')]=_[_0x5ae7('0x3f')](_0x4391a7['where'],{'$or':_[_0x5ae7('0x40')](_0x4391a7[_0x5ae7('0x36')],function(_0x57574f){var _0x52b273={};_0x52b273[_0x57574f]={'$like':'%'+_0x59a2ae[_0x5ae7('0x32')][_0x5ae7('0x3d')]+'%'};return _0x52b273;})});}_0x4391a7=_[_0x5ae7('0x3f')]({},_0x4391a7,_0x59a2ae[_0x5ae7('0x41')]);var _0x5959ec={'where':_0x4391a7[_0x5ae7('0x3e')]};return db[_0x5ae7('0x30')][_0x5ae7('0x22')](_0x5959ec)[_0x5ae7('0x27')](function(_0x5db497){_0x4a3b79[_0x5ae7('0x22')]=_0x5db497;if(_0x59a2ae['query'][_0x5ae7('0x42')]){_0x4391a7['include']=[{'all':!![]}];}return db[_0x5ae7('0x30')][_0x5ae7('0x43')](_0x4391a7);})['then'](function(_0x5a865a){_0x4a3b79[_0x5ae7('0x44')]=_0x5a865a;return _0x4a3b79;})[_0x5ae7('0x27')](respondWithFilteredResult(_0x2c6f35,_0x4391a7))[_0x5ae7('0x45')](handleError(_0x2c6f35,null));})[_0x5ae7('0x45')](handleError(_0x2c6f35,null));};exports[_0x5ae7('0x46')]=function(_0x3ad393,_0x1dd75c){var _0x14fe38={'raw':![],'where':{'id':_0x3ad393[_0x5ae7('0x47')]['id']}},_0x539864={};_0x539864[_0x5ae7('0x35')]=_[_0x5ae7('0x31')](db['CmCompany'][_0x5ae7('0x48')]);_0x539864[_0x5ae7('0x32')]=_['keys'](_0x3ad393['query']);_0x539864[_0x5ae7('0x33')]=_[_0x5ae7('0x34')](_0x539864[_0x5ae7('0x35')],_0x539864[_0x5ae7('0x32')]);_0x14fe38[_0x5ae7('0x36')]=_[_0x5ae7('0x34')](_0x539864[_0x5ae7('0x35')],qs['fields'](_0x3ad393[_0x5ae7('0x32')][_0x5ae7('0x37')]));_0x14fe38['attributes']=_0x14fe38[_0x5ae7('0x36')][_0x5ae7('0x38')]?_0x14fe38['attributes']:_0x539864[_0x5ae7('0x35')];if(_0x3ad393[_0x5ae7('0x32')][_0x5ae7('0x42')]){_0x14fe38[_0x5ae7('0x49')]=[{'all':!![]}];}_0x14fe38=_[_0x5ae7('0x3f')]({},_0x14fe38,_0x3ad393['options']);return db[_0x5ae7('0x30')][_0x5ae7('0x4a')](_0x14fe38)[_0x5ae7('0x27')](handleEntityNotFound(_0x1dd75c,null))['then'](respondWithResult(_0x1dd75c,null))[_0x5ae7('0x45')](handleError(_0x1dd75c,null));};exports[_0x5ae7('0x4b')]=function(_0x3f36a0,_0x2819c5){return db['CmCompany'][_0x5ae7('0x4b')](_0x3f36a0[_0x5ae7('0x4c')],{})[_0x5ae7('0x27')](function(_0x31d9d2){var _0x5c0c05=_0x3f36a0[_0x5ae7('0x4d')][_0x5ae7('0x29')]({'plain':!![]});if(!_0x5c0c05)throw new Error(_0x5ae7('0x4e'));if(_0x5c0c05[_0x5ae7('0x4f')]===_0x5ae7('0x4d')){var _0x5ddb9d=_0x31d9d2[_0x5ae7('0x29')]({'plain':!![]});var _0x77a3c2='Companies';return db[_0x5ae7('0x50')]['find']({'where':{'name':_0x77a3c2,'userProfileId':_0x5c0c05[_0x5ae7('0x51')]},'raw':!![]})['then'](function(_0x30a75c){if(_0x30a75c&&_0x30a75c[_0x5ae7('0x52')]===0x0){return db[_0x5ae7('0x2b')][_0x5ae7('0x4b')]({'name':_0x5ddb9d[_0x5ae7('0x2e')],'resourceId':_0x5ddb9d['id'],'type':_0x30a75c['name'],'sectionId':_0x30a75c['id']},{})[_0x5ae7('0x27')](function(){return _0x31d9d2;});}else{return _0x31d9d2;}})['catch'](function(_0x1e9dc0){logger[_0x5ae7('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e9dc0);throw _0x1e9dc0;});}return _0x31d9d2;})[_0x5ae7('0x27')](respondWithResult(_0x2819c5,0xc9))[_0x5ae7('0x45')](handleError(_0x2819c5,null));};exports['update']=function(_0x63fda8,_0x587dd3){if(_0x63fda8[_0x5ae7('0x4c')]['id']){delete _0x63fda8[_0x5ae7('0x4c')]['id'];}return db['CmCompany'][_0x5ae7('0x4a')]({'where':{'id':_0x63fda8[_0x5ae7('0x47')]['id']}})['then'](handleEntityNotFound(_0x587dd3,null))[_0x5ae7('0x27')](saveUpdates(_0x63fda8[_0x5ae7('0x4c')],null))[_0x5ae7('0x27')](respondWithResult(_0x587dd3,null))[_0x5ae7('0x45')](handleError(_0x587dd3,null));};exports[_0x5ae7('0x28')]=function(_0x5a7479,_0x43b4a9){return db[_0x5ae7('0x30')][_0x5ae7('0x4a')]({'where':{'id':_0x5a7479[_0x5ae7('0x47')]['id']}})[_0x5ae7('0x27')](handleEntityNotFound(_0x43b4a9,null))[_0x5ae7('0x27')](removeEntity(_0x43b4a9,null))[_0x5ae7('0x45')](handleError(_0x43b4a9,null));};exports['describe']=function(_0x50dcbd,_0x527fd5){return db[_0x5ae7('0x30')][_0x5ae7('0x53')]()[_0x5ae7('0x27')](respondWithResult(_0x527fd5,null))[_0x5ae7('0x45')](handleError(_0x527fd5,null));};exports[_0x5ae7('0x54')]=function(_0x12a85b,_0x2719d2,_0x9c8283){return db['CmContact'][_0x5ae7('0x4a')]({'where':{'id':_0x12a85b[_0x5ae7('0x47')]['id']}})[_0x5ae7('0x27')](handleEntityNotFound(_0x2719d2,null))['then'](function(_0xf4a92a){if(_0xf4a92a){return _0xf4a92a[_0x5ae7('0x54')](_0x12a85b[_0x5ae7('0x4c')][_0x5ae7('0x55')],_[_0x5ae7('0x56')](_0x12a85b[_0x5ae7('0x4c')],[_0x5ae7('0x55'),'id'])||{});}})['then'](respondWithResult(_0x2719d2,null))['catch'](handleError(_0x2719d2,null));};exports['getContacts']=function(_0x360b16,_0xeae609,_0x3969ac){var _0x47bc4e={};var _0x3b1326={};var _0x144163;var _0x3a9211;return db[_0x5ae7('0x30')][_0x5ae7('0x57')]({'where':{'id':_0x360b16['params']['id']}})['then'](handleEntityNotFound(_0xeae609,null))[_0x5ae7('0x27')](function(_0x489eaf){if(_0x489eaf){_0x144163=_0x489eaf;_0x3b1326[_0x5ae7('0x35')]=_['keys'](db[_0x5ae7('0x58')][_0x5ae7('0x48')]);_0x3b1326[_0x5ae7('0x32')]=_[_0x5ae7('0x31')](_0x360b16[_0x5ae7('0x32')]);_0x3b1326[_0x5ae7('0x33')]=_['intersection'](_0x3b1326[_0x5ae7('0x35')],_0x3b1326[_0x5ae7('0x32')]);_0x47bc4e['attributes']=_['intersection'](_0x3b1326[_0x5ae7('0x35')],qs[_0x5ae7('0x37')](_0x360b16[_0x5ae7('0x32')][_0x5ae7('0x37')]));_0x47bc4e[_0x5ae7('0x36')]=_0x47bc4e[_0x5ae7('0x36')][_0x5ae7('0x38')]?_0x47bc4e[_0x5ae7('0x36')]:_0x3b1326[_0x5ae7('0x35')];_0x47bc4e[_0x5ae7('0x3b')]=qs[_0x5ae7('0x59')](_0x360b16[_0x5ae7('0x32')][_0x5ae7('0x59')]);_0x47bc4e['where']=qs['filters'](_[_0x5ae7('0x3c')](_0x360b16['query'],_0x3b1326[_0x5ae7('0x33')]));if(_0x360b16[_0x5ae7('0x32')][_0x5ae7('0x3d')]){_0x47bc4e[_0x5ae7('0x3e')]=_[_0x5ae7('0x3f')](_0x47bc4e[_0x5ae7('0x3e')],{'$or':_[_0x5ae7('0x40')](_0x47bc4e[_0x5ae7('0x36')],function(_0x41315e){var _0x127e92={};_0x127e92[_0x41315e]={'$like':'%'+_0x360b16[_0x5ae7('0x32')][_0x5ae7('0x3d')]+'%'};return _0x127e92;})});}_0x47bc4e=_[_0x5ae7('0x3f')]({},_0x47bc4e,_0x360b16[_0x5ae7('0x41')]);return _0x144163[_0x5ae7('0x5a')](_0x47bc4e);}})[_0x5ae7('0x27')](function(_0x5b98f4){if(_0x5b98f4){_0x3a9211=_0x5b98f4[_0x5ae7('0x38')];if(!_0x360b16[_0x5ae7('0x32')][_0x5ae7('0x39')](_0x5ae7('0x3a'))){_0x47bc4e[_0x5ae7('0x21')]=qs[_0x5ae7('0x21')](_0x360b16['query']['limit']);_0x47bc4e[_0x5ae7('0x1f')]=qs[_0x5ae7('0x1f')](_0x360b16[_0x5ae7('0x32')][_0x5ae7('0x1f')]);}return _0x144163['getContacts'](_0x47bc4e);}})[_0x5ae7('0x27')](function(_0x1f8894){if(_0x1f8894){return _0x1f8894?{'count':_0x3a9211,'rows':_0x1f8894}:null;}})[_0x5ae7('0x27')](respondWithResult(_0xeae609,null))['catch'](handleError(_0xeae609,null));};
\ No newline at end of file
+var _0x274f=['pick','getContacts','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','update','then','destroy','get','Companies','UserProfileResource','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','filter','merge','map','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','name','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','findOne'];(function(_0x584da3,_0x388a44){var _0x37aeb9=function(_0x1f5b77){while(--_0x1f5b77){_0x584da3['push'](_0x584da3['shift']());}};_0x37aeb9(++_0x388a44);}(_0x274f,0x102));var _0xf274=function(_0x745c75,_0x3ddc96){_0x745c75=_0x745c75-0x0;var _0x15d6c2=_0x274f[_0x745c75];return _0x15d6c2;};'use strict';var emlformat=require(_0xf274('0x0'));var rimraf=require(_0xf274('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf274('0x2'));var rp=require(_0xf274('0x3'));var moment=require(_0xf274('0x4'));var BPromise=require(_0xf274('0x5'));var Mustache=require(_0xf274('0x6'));var util=require(_0xf274('0x7'));var path=require('path');var sox=require(_0xf274('0x8'));var csv=require(_0xf274('0x9'));var ejs=require(_0xf274('0xa'));var fs=require('fs');var fs_extra=require(_0xf274('0xb'));var _=require(_0xf274('0xc'));var squel=require(_0xf274('0xd'));var crypto=require(_0xf274('0xe'));var jsforce=require(_0xf274('0xf'));var deskjs=require(_0xf274('0x10'));var toCsv=require(_0xf274('0x9'));var querystring=require(_0xf274('0x11'));var Papa=require('papaparse');var Redis=require(_0xf274('0x12'));var authService=require(_0xf274('0x13'));var qs=require(_0xf274('0x14'));var as=require(_0xf274('0x15'));var hardwareService=require(_0xf274('0x16'));var logger=require(_0xf274('0x17'))(_0xf274('0x18'));var utils=require(_0xf274('0x19'));var config=require(_0xf274('0x1a'));var licenseUtil=require(_0xf274('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f773b,_0x2e9fd7){_0x2e9fd7=_0x2e9fd7||0xcc;return function(_0x515974){if(_0x515974){return _0x2f773b[_0xf274('0x1c')](_0x2e9fd7);}return _0x2f773b[_0xf274('0x1d')](_0x2e9fd7)[_0xf274('0x1e')]();};}function respondWithResult(_0x3ff324,_0x3d8dfb){_0x3d8dfb=_0x3d8dfb||0xc8;return function(_0x1c2178){if(_0x1c2178){return _0x3ff324['status'](_0x3d8dfb)[_0xf274('0x1f')](_0x1c2178);}};}function respondWithFilteredResult(_0x5248cb,_0x3cabeb){return function(_0x30cb68){if(_0x30cb68){var _0x556594=typeof _0x3cabeb[_0xf274('0x20')]===_0xf274('0x21')&&typeof _0x3cabeb['limit']===_0xf274('0x21');var _0x34de73=_0x30cb68[_0xf274('0x22')];var _0xf246ed=_0x556594?0x0:_0x3cabeb[_0xf274('0x20')];var _0x3522fd=_0x556594?_0x30cb68[_0xf274('0x22')]:_0x3cabeb[_0xf274('0x20')]+_0x3cabeb['limit'];var _0x3f48a5;if(_0x3522fd>=_0x34de73){_0x3522fd=_0x34de73;_0x3f48a5=0xc8;}else{_0x3f48a5=0xce;}_0x5248cb[_0xf274('0x1d')](_0x3f48a5);return _0x5248cb['set'](_0xf274('0x23'),_0xf246ed+'-'+_0x3522fd+'/'+_0x34de73)['json'](_0x30cb68);}return null;};}function patchUpdates(_0x3fdbd5){return function(_0x554b4e){try{jsonpatch['apply'](_0x554b4e,_0x3fdbd5,!![]);}catch(_0x147dbe){return BPromise[_0xf274('0x24')](_0x147dbe);}return _0x554b4e['save']();};}function saveUpdates(_0x85c31a,_0x14087e){return function(_0x1b62f9){if(_0x1b62f9){return _0x1b62f9[_0xf274('0x25')](_0x85c31a)[_0xf274('0x26')](function(_0x35cec0){return _0x35cec0;});}return null;};}function removeEntity(_0x3b0ae4,_0x22cc8b){return function(_0x1e8b12){if(_0x1e8b12){return _0x1e8b12[_0xf274('0x27')]()[_0xf274('0x26')](function(){var _0x137cbc=_0x1e8b12[_0xf274('0x28')]({'plain':!![]});var _0x3f93f4=_0xf274('0x29');return db[_0xf274('0x2a')]['destroy']({'where':{'type':_0x3f93f4,'resourceId':_0x137cbc['id']}})['then'](function(){return _0x1e8b12;});})[_0xf274('0x26')](function(){_0x3b0ae4[_0xf274('0x1d')](0xcc)[_0xf274('0x1e')]();});}};}function handleEntityNotFound(_0x5ead3d,_0x423d89){return function(_0x6f3fe0){if(!_0x6f3fe0){_0x5ead3d[_0xf274('0x1c')](0x194);}return _0x6f3fe0;};}function handleError(_0x39898a,_0x4fd345){_0x4fd345=_0x4fd345||0x1f4;return function(_0x6f706d){logger['error'](_0x6f706d['stack']);if(_0x6f706d['name']){delete _0x6f706d['name'];}_0x39898a[_0xf274('0x1d')](_0x4fd345)['send'](_0x6f706d);};}exports['index']=function(_0x44ecaf,_0x263d00){var _0x5809f1={},_0x31a470={},_0x455637={'count':0x0,'rows':[]};return db[_0xf274('0x2b')][_0xf274('0x2c')]()[_0xf274('0x26')](function(_0xfc6bf5){_0x31a470[_0xf274('0x2d')]=_[_0xf274('0x2e')](_0xfc6bf5);_0x31a470[_0xf274('0x2f')]=_[_0xf274('0x2e')](_0x44ecaf[_0xf274('0x2f')]);_0x31a470['filters']=_[_0xf274('0x30')](_0x31a470[_0xf274('0x2d')],_0x31a470[_0xf274('0x2f')]);_0x5809f1[_0xf274('0x31')]=_[_0xf274('0x30')](_0x31a470[_0xf274('0x2d')],qs[_0xf274('0x32')](_0x44ecaf['query'][_0xf274('0x32')]));_0x5809f1['attributes']=_0x5809f1[_0xf274('0x31')][_0xf274('0x33')]?_0x5809f1[_0xf274('0x31')]:_0x31a470[_0xf274('0x2d')];if(!_0x44ecaf[_0xf274('0x2f')]['hasOwnProperty'](_0xf274('0x34'))){_0x5809f1[_0xf274('0x35')]=qs[_0xf274('0x35')](_0x44ecaf[_0xf274('0x2f')]['limit']);_0x5809f1[_0xf274('0x20')]=qs[_0xf274('0x20')](_0x44ecaf['query'][_0xf274('0x20')]);}_0x5809f1[_0xf274('0x36')]=qs[_0xf274('0x37')](_0x44ecaf[_0xf274('0x2f')][_0xf274('0x37')]);_0x5809f1[_0xf274('0x38')]=qs[_0xf274('0x39')](_['pick'](_0x44ecaf[_0xf274('0x2f')],_0x31a470[_0xf274('0x39')]),_0xfc6bf5);if(_0x44ecaf[_0xf274('0x2f')][_0xf274('0x3a')]){_0x5809f1[_0xf274('0x38')]=_[_0xf274('0x3b')](_0x5809f1[_0xf274('0x38')],{'$or':_[_0xf274('0x3c')](_0x5809f1['attributes'],function(_0xfe6ab8){var _0x1ad012={};_0x1ad012[_0xfe6ab8]={'$like':'%'+_0x44ecaf[_0xf274('0x2f')][_0xf274('0x3a')]+'%'};return _0x1ad012;})});}_0x5809f1=_[_0xf274('0x3b')]({},_0x5809f1,_0x44ecaf[_0xf274('0x3d')]);var _0x13496c={'where':_0x5809f1[_0xf274('0x38')]};return db[_0xf274('0x2b')][_0xf274('0x22')](_0x13496c)['then'](function(_0xe8e622){_0x455637[_0xf274('0x22')]=_0xe8e622;if(_0x44ecaf[_0xf274('0x2f')][_0xf274('0x3e')]){_0x5809f1[_0xf274('0x3f')]=[{'all':!![]}];}return db[_0xf274('0x2b')][_0xf274('0x40')](_0x5809f1);})[_0xf274('0x26')](function(_0x3b6faa){_0x455637[_0xf274('0x41')]=_0x3b6faa;return _0x455637;})[_0xf274('0x26')](respondWithFilteredResult(_0x263d00,_0x5809f1))['catch'](handleError(_0x263d00,null));})['catch'](handleError(_0x263d00,null));};exports['show']=function(_0x2c26fd,_0x1f3416){var _0x420219={'raw':![],'where':{'id':_0x2c26fd[_0xf274('0x42')]['id']}},_0x43b17f={};_0x43b17f[_0xf274('0x2d')]=_[_0xf274('0x2e')](db[_0xf274('0x2b')][_0xf274('0x43')]);_0x43b17f[_0xf274('0x2f')]=_['keys'](_0x2c26fd[_0xf274('0x2f')]);_0x43b17f['filters']=_[_0xf274('0x30')](_0x43b17f[_0xf274('0x2d')],_0x43b17f[_0xf274('0x2f')]);_0x420219['attributes']=_[_0xf274('0x30')](_0x43b17f['model'],qs[_0xf274('0x32')](_0x2c26fd[_0xf274('0x2f')]['fields']));_0x420219[_0xf274('0x31')]=_0x420219[_0xf274('0x31')][_0xf274('0x33')]?_0x420219[_0xf274('0x31')]:_0x43b17f[_0xf274('0x2d')];if(_0x2c26fd['query']['includeAll']){_0x420219[_0xf274('0x3f')]=[{'all':!![]}];}_0x420219=_['merge']({},_0x420219,_0x2c26fd[_0xf274('0x3d')]);return db['CmCompany'][_0xf274('0x44')](_0x420219)[_0xf274('0x26')](handleEntityNotFound(_0x1f3416,null))['then'](respondWithResult(_0x1f3416,null))['catch'](handleError(_0x1f3416,null));};exports[_0xf274('0x45')]=function(_0x181594,_0x1904a7){return db['CmCompany']['create'](_0x181594[_0xf274('0x46')],{})[_0xf274('0x26')](function(_0x2b230a){var _0x1616c8=_0x181594['user'][_0xf274('0x28')]({'plain':!![]});if(!_0x1616c8)throw new Error(_0xf274('0x47'));if(_0x1616c8['role']===_0xf274('0x48')){var _0x34e0c8=_0x2b230a[_0xf274('0x28')]({'plain':!![]});var _0x4b68ae=_0xf274('0x29');return db[_0xf274('0x49')][_0xf274('0x44')]({'where':{'name':_0x4b68ae,'userProfileId':_0x1616c8['userProfileId']},'raw':!![]})[_0xf274('0x26')](function(_0x24f4bf){if(_0x24f4bf&&_0x24f4bf[_0xf274('0x4a')]===0x0){return db['UserProfileResource'][_0xf274('0x45')]({'name':_0x34e0c8[_0xf274('0x4b')],'resourceId':_0x34e0c8['id'],'type':_0x24f4bf[_0xf274('0x4b')],'sectionId':_0x24f4bf['id']},{})[_0xf274('0x26')](function(){return _0x2b230a;});}else{return _0x2b230a;}})[_0xf274('0x4c')](function(_0x2711a5){logger['error'](_0xf274('0x4d'),_0x2711a5);throw _0x2711a5;});}return _0x2b230a;})[_0xf274('0x26')](respondWithResult(_0x1904a7,0xc9))[_0xf274('0x4c')](handleError(_0x1904a7,null));};exports[_0xf274('0x25')]=function(_0xad1e2f,_0x31b06a){if(_0xad1e2f[_0xf274('0x46')]['id']){delete _0xad1e2f[_0xf274('0x46')]['id'];}return db[_0xf274('0x2b')][_0xf274('0x44')]({'where':{'id':_0xad1e2f[_0xf274('0x42')]['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x31b06a,null))[_0xf274('0x26')](saveUpdates(_0xad1e2f[_0xf274('0x46')],null))[_0xf274('0x26')](respondWithResult(_0x31b06a,null))[_0xf274('0x4c')](handleError(_0x31b06a,null));};exports['destroy']=function(_0x53a4ae,_0x343ff7){return db[_0xf274('0x2b')][_0xf274('0x44')]({'where':{'id':_0x53a4ae['params']['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x343ff7,null))['then'](removeEntity(_0x343ff7,null))[_0xf274('0x4c')](handleError(_0x343ff7,null));};exports[_0xf274('0x2c')]=function(_0x4f6f8b,_0xd9b1a7){return db[_0xf274('0x2b')]['describe']()[_0xf274('0x26')](respondWithResult(_0xd9b1a7,null))[_0xf274('0x4c')](handleError(_0xd9b1a7,null));};exports[_0xf274('0x4e')]=function(_0x57c003,_0x5bf5ce,_0x4e4cf6){return db[_0xf274('0x4f')][_0xf274('0x44')]({'where':{'id':_0x57c003[_0xf274('0x42')]['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x5bf5ce,null))[_0xf274('0x26')](function(_0x590764){if(_0x590764){return _0x590764[_0xf274('0x4e')](_0x57c003[_0xf274('0x46')]['ids'],_['omit'](_0x57c003[_0xf274('0x46')],[_0xf274('0x50'),'id'])||{});}})[_0xf274('0x26')](respondWithResult(_0x5bf5ce,null))[_0xf274('0x4c')](handleError(_0x5bf5ce,null));};exports['getContacts']=function(_0x45e3a5,_0x2b8626,_0x6ef802){var _0x4fe88f={};var _0x4473e5={};var _0x4a9d1e;var _0x1e86a5;return db[_0xf274('0x2b')][_0xf274('0x51')]({'where':{'id':_0x45e3a5[_0xf274('0x42')]['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x2b8626,null))[_0xf274('0x26')](function(_0x1c423b){if(_0x1c423b){_0x4a9d1e=_0x1c423b;_0x4473e5[_0xf274('0x2d')]=_[_0xf274('0x2e')](db['CmContact'][_0xf274('0x43')]);_0x4473e5[_0xf274('0x2f')]=_[_0xf274('0x2e')](_0x45e3a5['query']);_0x4473e5[_0xf274('0x39')]=_[_0xf274('0x30')](_0x4473e5['model'],_0x4473e5[_0xf274('0x2f')]);_0x4fe88f[_0xf274('0x31')]=_[_0xf274('0x30')](_0x4473e5[_0xf274('0x2d')],qs[_0xf274('0x32')](_0x45e3a5[_0xf274('0x2f')][_0xf274('0x32')]));_0x4fe88f[_0xf274('0x31')]=_0x4fe88f[_0xf274('0x31')]['length']?_0x4fe88f[_0xf274('0x31')]:_0x4473e5['model'];_0x4fe88f['order']=qs[_0xf274('0x37')](_0x45e3a5[_0xf274('0x2f')][_0xf274('0x37')]);_0x4fe88f[_0xf274('0x38')]=qs[_0xf274('0x39')](_[_0xf274('0x52')](_0x45e3a5[_0xf274('0x2f')],_0x4473e5['filters']));if(_0x45e3a5[_0xf274('0x2f')]['filter']){_0x4fe88f[_0xf274('0x38')]=_[_0xf274('0x3b')](_0x4fe88f['where'],{'$or':_['map'](_0x4fe88f['attributes'],function(_0x25ed71){var _0x4f4a00={};_0x4f4a00[_0x25ed71]={'$like':'%'+_0x45e3a5[_0xf274('0x2f')]['filter']+'%'};return _0x4f4a00;})});}_0x4fe88f=_[_0xf274('0x3b')]({},_0x4fe88f,_0x45e3a5[_0xf274('0x3d')]);return _0x4a9d1e[_0xf274('0x53')](_0x4fe88f);}})[_0xf274('0x26')](function(_0x5976bc){if(_0x5976bc){_0x1e86a5=_0x5976bc[_0xf274('0x33')];if(!_0x45e3a5['query'][_0xf274('0x54')](_0xf274('0x34'))){_0x4fe88f[_0xf274('0x35')]=qs[_0xf274('0x35')](_0x45e3a5[_0xf274('0x2f')]['limit']);_0x4fe88f[_0xf274('0x20')]=qs[_0xf274('0x20')](_0x45e3a5[_0xf274('0x2f')][_0xf274('0x20')]);}return _0x4a9d1e[_0xf274('0x53')](_0x4fe88f);}})[_0xf274('0x26')](function(_0x383f37){if(_0x383f37){return _0x383f37?{'count':_0x1e86a5,'rows':_0x383f37}:null;}})[_0xf274('0x26')](respondWithResult(_0x2b8626,null))[_0xf274('0x4c')](handleError(_0x2b8626,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index d34ed6a..a604de5 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 _0xab3f=['../../config/environment','./cmCompany.attributes','CmCompany','cm_companies','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xeb80c9,_0x3fe888){var _0x259c37=function(_0x49478c){while(--_0x49478c){_0xeb80c9['push'](_0xeb80c9['shift']());}};_0x259c37(++_0x3fe888);}(_0xab3f,0x11c));var _0xfab3=function(_0x4537c0,_0x4c1f04){_0x4537c0=_0x4537c0-0x0;var _0x13e9f8=_0xab3f[_0x4537c0];return _0x13e9f8;};'use strict';var _=require(_0xfab3('0x0'));var util=require('util');var logger=require(_0xfab3('0x1'))('api');var moment=require(_0xfab3('0x2'));var BPromise=require(_0xfab3('0x3'));var rp=require(_0xfab3('0x4'));var fs=require('fs');var path=require(_0xfab3('0x5'));var rimraf=require('rimraf');var config=require(_0xfab3('0x6'));var attributes=require(_0xfab3('0x7'));module['exports']=function(_0xf4555a,_0x431c6d){return _0xf4555a['define'](_0xfab3('0x8'),attributes,{'tableName':_0xfab3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c89=['request-promise','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','util','api','moment','bluebird'];(function(_0x4d2aea,_0x4a8f11){var _0x1715b8=function(_0x50aadc){while(--_0x50aadc){_0x4d2aea['push'](_0x4d2aea['shift']());}};_0x1715b8(++_0x4a8f11);}(_0x2c89,0x193));var _0x92c8=function(_0x578eb4,_0x657262){_0x578eb4=_0x578eb4-0x0;var _0x49eca8=_0x2c89[_0x578eb4];return _0x49eca8;};'use strict';var _=require('lodash');var util=require(_0x92c8('0x0'));var logger=require('../../config/logger')(_0x92c8('0x1'));var moment=require(_0x92c8('0x2'));var BPromise=require(_0x92c8('0x3'));var rp=require(_0x92c8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92c8('0x5'));var config=require(_0x92c8('0x6'));var attributes=require('./cmCompany.attributes');module[_0x92c8('0x7')]=function(_0x5c7cdc,_0x522f04){return _0x5c7cdc[_0x92c8('0x8')](_0x92c8('0x9'),attributes,{'tableName':_0x92c8('0xa'),'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 59b793f..f4f8bf3 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 _0xadd0=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x551d47,_0x1e545a){var _0x4e5066=function(_0x4b989d){while(--_0x4b989d){_0x551d47['push'](_0x551d47['shift']());}};_0x4e5066(++_0x1e545a);}(_0xadd0,0x178));var _0x0add=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xadd0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0add('0x0'));var util=require(_0x0add('0x1'));var moment=require(_0x0add('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0add('0x3'));var db=require(_0x0add('0x4'))['db'];var utils=require(_0x0add('0x5'));var logger=require(_0x0add('0x6'))(_0x0add('0x7'));var config=require('../../config/environment');var jayson=require(_0x0add('0x8'));var client=jayson[_0x0add('0x9')][_0x0add('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x500f3e,_0x15f724,_0xedbccb){return new BPromise(function(_0x3919b0,_0x152322){return client[_0x0add('0xb')](_0x500f3e,_0xedbccb)['then'](function(_0x4e1f0d){logger[_0x0add('0xc')](_0x0add('0xd'),_0x15f724,'request\x20sent');logger['debug'](_0x0add('0xe'),_0x15f724,_0x0add('0xf'),JSON[_0x0add('0x10')](_0x4e1f0d));if(_0x4e1f0d[_0x0add('0x11')]){if(_0x4e1f0d[_0x0add('0x11')][_0x0add('0x12')]===0x1f4){logger['error'](_0x0add('0xd'),_0x15f724,_0x4e1f0d['error'][_0x0add('0x13')]);return _0x152322(_0x4e1f0d[_0x0add('0x11')][_0x0add('0x13')]);}logger['error'](_0x0add('0xd'),_0x15f724,_0x4e1f0d[_0x0add('0x11')][_0x0add('0x13')]);return _0x3919b0(_0x4e1f0d[_0x0add('0x11')][_0x0add('0x13')]);}else{logger[_0x0add('0xc')]('CmCompany,\x20%s,\x20%s',_0x15f724,_0x0add('0xf'));_0x3919b0(_0x4e1f0d[_0x0add('0x14')][_0x0add('0x13')]);}})['catch'](function(_0x1f57a5){logger['error']('CmCompany,\x20%s,\x20%s',_0x15f724,_0x1f57a5);_0x152322(_0x1f57a5);});});}
\ No newline at end of file
+var _0xadf6=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xadf6,0xb0));var _0x6adf=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xadf6[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x6adf('0x0'));var util=require(_0x6adf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6adf('0x2'));var fs=require('fs');var Redis=require(_0x6adf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6adf('0x4'));var logger=require(_0x6adf('0x5'))(_0x6adf('0x6'));var config=require(_0x6adf('0x7'));var jayson=require(_0x6adf('0x8'));var client=jayson[_0x6adf('0x9')][_0x6adf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6ccce7,_0x4bfb5f,_0x194109){return new BPromise(function(_0x3d61c7,_0x51cc1b){return client[_0x6adf('0xb')](_0x6ccce7,_0x194109)[_0x6adf('0xc')](function(_0x52351c){logger[_0x6adf('0xd')](_0x6adf('0xe'),_0x4bfb5f,_0x6adf('0xf'));logger[_0x6adf('0x10')](_0x6adf('0x11'),_0x4bfb5f,_0x6adf('0xf'),JSON[_0x6adf('0x12')](_0x52351c));if(_0x52351c[_0x6adf('0x13')]){if(_0x52351c[_0x6adf('0x13')][_0x6adf('0x14')]===0x1f4){logger['error'](_0x6adf('0xe'),_0x4bfb5f,_0x52351c[_0x6adf('0x13')][_0x6adf('0x15')]);return _0x51cc1b(_0x52351c[_0x6adf('0x13')]['message']);}logger[_0x6adf('0x13')]('CmCompany,\x20%s,\x20%s',_0x4bfb5f,_0x52351c[_0x6adf('0x13')][_0x6adf('0x15')]);return _0x3d61c7(_0x52351c[_0x6adf('0x13')][_0x6adf('0x15')]);}else{logger[_0x6adf('0xd')](_0x6adf('0xe'),_0x4bfb5f,_0x6adf('0xf'));_0x3d61c7(_0x52351c[_0x6adf('0x16')][_0x6adf('0x15')]);}})[_0x6adf('0x17')](function(_0x425dcb){logger['error'](_0x6adf('0xe'),_0x4bfb5f,_0x425dcb);_0x51cc1b(_0x425dcb);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 8316f94..5d75bb0 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 _0xbc06=['describe','/:id','show','/:id/contacts','create','addContacts','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xbc06,0x16d));var _0x6bc0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc06[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6bc0('0x0'));var path=require(_0x6bc0('0x1'));var timeout=require(_0x6bc0('0x2'));var express=require(_0x6bc0('0x3'));var router=express[_0x6bc0('0x4')]();var fs_extra=require(_0x6bc0('0x5'));var auth=require(_0x6bc0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6bc0('0x7'));var controller=require(_0x6bc0('0x8'));router[_0x6bc0('0x9')]('/',auth[_0x6bc0('0xa')](),controller[_0x6bc0('0xb')]);router[_0x6bc0('0x9')](_0x6bc0('0xc'),auth[_0x6bc0('0xa')](),controller[_0x6bc0('0xd')]);router[_0x6bc0('0x9')](_0x6bc0('0xe'),auth[_0x6bc0('0xa')](),controller[_0x6bc0('0xf')]);router[_0x6bc0('0x9')](_0x6bc0('0x10'),auth['isAuthenticated'](),controller['getContacts']);router['post']('/',auth[_0x6bc0('0xa')](),controller[_0x6bc0('0x11')]);router['post'](_0x6bc0('0x10'),auth[_0x6bc0('0xa')](),controller[_0x6bc0('0x12')]);router['put'](_0x6bc0('0xe'),auth[_0x6bc0('0xa')](),controller['update']);router[_0x6bc0('0x13')](_0x6bc0('0xe'),auth[_0x6bc0('0xa')](),controller[_0x6bc0('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa5ff=['put','/:id','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','getContacts','post','create','/:id/contacts','addContacts'];(function(_0x5ef3cf,_0x334435){var _0x126707=function(_0x363908){while(--_0x363908){_0x5ef3cf['push'](_0x5ef3cf['shift']());}};_0x126707(++_0x334435);}(_0xa5ff,0xa4));var _0xfa5f=function(_0x1fa463,_0x460713){_0x1fa463=_0x1fa463-0x0;var _0x1ec77b=_0xa5ff[_0x1fa463];return _0x1ec77b;};'use strict';var multer=require(_0xfa5f('0x0'));var util=require(_0xfa5f('0x1'));var path=require(_0xfa5f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa5f('0x3')]();var fs_extra=require(_0xfa5f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfa5f('0x5'));var config=require(_0xfa5f('0x6'));var controller=require('./cmCompany.controller');router[_0xfa5f('0x7')]('/',auth['isAuthenticated'](),controller[_0xfa5f('0x8')]);router[_0xfa5f('0x7')]('/describe',auth[_0xfa5f('0x9')](),controller[_0xfa5f('0xa')]);router[_0xfa5f('0x7')]('/:id',auth[_0xfa5f('0x9')](),controller['show']);router[_0xfa5f('0x7')]('/:id/contacts',auth[_0xfa5f('0x9')](),controller[_0xfa5f('0xb')]);router[_0xfa5f('0xc')]('/',auth[_0xfa5f('0x9')](),controller[_0xfa5f('0xd')]);router[_0xfa5f('0xc')](_0xfa5f('0xe'),auth[_0xfa5f('0x9')](),controller[_0xfa5f('0xf')]);router[_0xfa5f('0x10')](_0xfa5f('0x11'),auth[_0xfa5f('0x9')](),controller['update']);router[_0xfa5f('0x12')](_0xfa5f('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xfa5f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 9c10637..b6423ec 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 _0xdadd=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x458012,_0x4049a3){var _0x2ed3e4=function(_0x3cbbb7){while(--_0x3cbbb7){_0x458012['push'](_0x458012['shift']());}};_0x2ed3e4(++_0x4049a3);}(_0xdadd,0xc2));var _0xddad=function(_0x4618da,_0x27c024){_0x4618da=_0x4618da-0x0;var _0xede04a=_0xdadd[_0x4618da];return _0xede04a;};'use strict';var _=require(_0xddad('0x0'));var Sequelize=require(_0xddad('0x1'));module[_0xddad('0x2')]={'firstName':{'type':Sequelize[_0xddad('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xddad('0x3')]},'street':{'type':Sequelize[_0xddad('0x3')]},'postalCode':{'type':Sequelize[_0xddad('0x3')]},'city':{'type':Sequelize[_0xddad('0x3')]},'country':{'type':Sequelize[_0xddad('0x3')]},'dateOfBirth':{'type':Sequelize[_0xddad('0x3')]},'description':{'type':Sequelize[_0xddad('0x4')]},'phone':{'type':Sequelize[_0xddad('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xddad('0x3')]},'email':{'type':Sequelize[_0xddad('0x3')]},'url':{'type':Sequelize[_0xddad('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xddad('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xddad('0x3')]},'teams':{'type':Sequelize[_0xddad('0x3')]},'viber':{'type':Sequelize[_0xddad('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xddad('0x3')]},'telegram':{'type':Sequelize[_0xddad('0x3')]},'UserId':{'type':Sequelize[_0xddad('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xddad('0x3')]},'priority':{'type':Sequelize[_0xddad('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xddad('0x6')],'defaultValue':Sequelize[_0xddad('0x7')]},'dialTimezone':{'type':Sequelize[_0xddad('0x3')]},'utcOffset':{'type':Sequelize[_0xddad('0x5')]}};
\ No newline at end of file
+var _0x6d26=['DATE','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0x2dda1a,_0x1d9ba8){var _0x33dacb=function(_0x333139){while(--_0x333139){_0x2dda1a['push'](_0x2dda1a['shift']());}};_0x33dacb(++_0x1d9ba8);}(_0x6d26,0xa3));var _0x66d2=function(_0x3db4d2,_0x4a7632){_0x3db4d2=_0x3db4d2-0x0;var _0x53dbbb=_0x6d26[_0x3db4d2];return _0x53dbbb;};'use strict';var _=require(_0x66d2('0x0'));var Sequelize=require(_0x66d2('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x66d2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x66d2('0x2')]},'street':{'type':Sequelize[_0x66d2('0x2')]},'postalCode':{'type':Sequelize[_0x66d2('0x2')]},'city':{'type':Sequelize[_0x66d2('0x2')]},'country':{'type':Sequelize[_0x66d2('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x66d2('0x3')]},'phone':{'type':Sequelize[_0x66d2('0x2')]},'mobile':{'type':Sequelize[_0x66d2('0x2')]},'fax':{'type':Sequelize[_0x66d2('0x2')]},'email':{'type':Sequelize[_0x66d2('0x2')]},'url':{'type':Sequelize[_0x66d2('0x2')]},'facebook':{'type':Sequelize[_0x66d2('0x2')]},'fb_data':{'type':Sequelize[_0x66d2('0x2')]},'twitter':{'type':Sequelize[_0x66d2('0x2')]},'skype':{'type':Sequelize[_0x66d2('0x2')]},'teams':{'type':Sequelize[_0x66d2('0x2')]},'viber':{'type':Sequelize[_0x66d2('0x2')]},'line':{'type':Sequelize[_0x66d2('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x66d2('0x2')]},'UserId':{'type':Sequelize[_0x66d2('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x66d2('0x2')]},'priority':{'type':Sequelize[_0x66d2('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x66d2('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x66d2('0x2')]},'utcOffset':{'type':Sequelize[_0x66d2('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 56a60c8..d566c24 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 _0x55ad=['isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','WhatsappMessage','create','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','push','ListId','findOrCreate','contact','all','show','Tag','Tags','color','Phones','ContactItemType','sequelize','literal','Phones.OrderBy','where','$and','map','format','omit','pickBy','cf_%d','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','values','phone','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','sort','pick','filter','nolimit','limit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','order','ContactId','options','include','rows','getHopperHistories','includeAll','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','pid','send','createReadStream','parse','meta','import','User','agent','binding','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','start\x20child\x20process\x20correctly!','getJourney','sms','openchannel','fax','voice','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','startCase','chat','Website','Account','closed','closedAt','disposition','secondDisposition','DESC','browserName','customerPort','osName','ratingMessage','ratingValue','subject','substatus','externalUrl','Interaction','Owner','sortBy','reverse','value','slice','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','count','set','Content-Range','json','then','destroy','end','error','stack','name','describe','getOptions','findAll','query','catch','CmContact','find','params','tags','keys','length','startsWith','cf_','columnName','analytics','CmCustomField','displayName','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0x55ad,0x1cd));var _0xd55a=function(_0x554096,_0x397ac1){_0x554096=_0x554096-0x0;var _0xcd02bb=_0x55ad[_0x554096];return _0xcd02bb;};'use strict';var moment=require('moment');var BPromise=require(_0xd55a('0x0'));var util=require(_0xd55a('0x1'));var path=require(_0xd55a('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd55a('0x3'));var Papa=require(_0xd55a('0x4'));var Redis=require(_0xd55a('0x5'));var contacts=require('../../components/contacts');var qs=require(_0xd55a('0x6'));var logger=require(_0xd55a('0x7'))(_0xd55a('0x8'));var config=require(_0xd55a('0x9'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0xd55a('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd55a('0xb'))(new Redis(config['redis']));require(_0xd55a('0xc'))[_0xd55a('0xd')](socket);function respondWithResult(_0xd0f68c,_0x41bcd4){_0x41bcd4=_0x41bcd4||0xc8;return function(_0x22152d){if(_0x22152d){return _0xd0f68c[_0xd55a('0xe')](_0x41bcd4)['json'](_0x22152d);}};}function respondWithFilteredResult(_0x14d53c,_0x5997a9){return function(_0x226521){if(_0x226521){var _0x27d8da=typeof _0x5997a9[_0xd55a('0xf')]===_0xd55a('0x10')&&typeof _0x5997a9['limit']===_0xd55a('0x10');var _0x1d5c32=_0x226521[_0xd55a('0x11')];var _0x315a16=_0x27d8da?0x0:_0x5997a9[_0xd55a('0xf')];var _0x102cec=_0x27d8da?_0x226521[_0xd55a('0x11')]:_0x5997a9[_0xd55a('0xf')]+_0x5997a9['limit'];var _0x3b0800;if(_0x102cec>=_0x1d5c32){_0x102cec=_0x1d5c32;_0x3b0800=0xc8;}else{_0x3b0800=0xce;}_0x14d53c[_0xd55a('0xe')](_0x3b0800);return _0x14d53c[_0xd55a('0x12')](_0xd55a('0x13'),_0x315a16+'-'+_0x102cec+'/'+_0x1d5c32)[_0xd55a('0x14')](_0x226521);}return null;};}function saveUpdates(_0x23474c){return function(_0x5a27a6){if(_0x5a27a6){return _0x5a27a6['update'](_0x23474c)[_0xd55a('0x15')](function(_0x1e68af){return _0x1e68af;});}return null;};}function removeEntity(_0x446c6c){return function(_0x219a98){if(_0x219a98){return _0x219a98[_0xd55a('0x16')]()[_0xd55a('0x15')](function(){_0x446c6c[_0xd55a('0xe')](0xcc)[_0xd55a('0x17')]();});}};}function handleEntityNotFound(_0x50206c){return function(_0x395b95){if(!_0x395b95){_0x50206c['sendStatus'](0x194);}return _0x395b95;};}function handleError(_0x892b10,_0x179817){_0x179817=_0x179817||0x1f4;return function(_0x21759d){logger[_0xd55a('0x18')](_0x21759d[_0xd55a('0x19')]);if(_0x21759d['name']){delete _0x21759d[_0xd55a('0x1a')];}_0x892b10[_0xd55a('0xe')](_0x179817)['send'](_0x21759d);};}exports['index']=function(_0x2d6850,_0x467e21){var _0x4fe87b={};return contacts[_0xd55a('0x1b')]()[_0xd55a('0x15')](function(_0x5599b8){_0x4fe87b=qs[_0xd55a('0x1c')](_0x5599b8,_0x2d6850);return contacts[_0xd55a('0x1d')](_0x2d6850[_0xd55a('0x1e')],_0x2d6850['user'],_0x4fe87b,_0x5599b8);})[_0xd55a('0x15')](respondWithFilteredResult(_0x467e21,_0x4fe87b))[_0xd55a('0x1f')](handleError(_0x467e21,null));};exports[_0xd55a('0x16')]=function(_0x2d0cab,_0x4ce29b){return db[_0xd55a('0x20')][_0xd55a('0x21')]({'where':{'id':_0x2d0cab[_0xd55a('0x22')]['id']}})[_0xd55a('0x15')](handleEntityNotFound(_0x4ce29b,null))[_0xd55a('0x15')](removeEntity(_0x4ce29b,null))[_0xd55a('0x1f')](handleError(_0x4ce29b,null));};exports[_0xd55a('0x1b')]=function(_0x5f1bcf,_0x499c49){return db[_0xd55a('0x20')]['describe']()[_0xd55a('0x15')](function(_0x591842){delete _0x591842[_0xd55a('0x23')];for(var _0xf7df9a=0x0;_0xf7df9a
','Attachments','Title','Data','generateXOAuth2Token','user=','toString','lodash','path','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ab9,0xfb));var _0x97ab=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x7ab9[_0x191154];return _0x3dcd73;};'use strict';var _=require(_0x97ab('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x97ab('0x1'));var util=require('util');var tnef=require(_0x97ab('0x2'));var logger=require(_0x97ab('0x3'))(_0x97ab('0x4'));var config=require('../../../config/environment');function getAddress(_0xde0a10){var _0x89edfb=_[_0x97ab('0x5')](_0xde0a10[_0x97ab('0x6')]);return _0x89edfb&&_0x89edfb[_0x97ab('0x7')]?_0x89edfb['address']:_0x97ab('0x8')+random[_0x97ab('0x9')](0x6)+_0x97ab('0xa');}function getFirstName(_0x38e084){var _0x54da4d=_[_0x97ab('0x5')](_0x38e084[_0x97ab('0x6')]);if(_0x54da4d&&_0x54da4d[_0x97ab('0xb')]){if(_0x54da4d[_0x97ab('0xb')]==_0x54da4d[_0x97ab('0x7')]){return _0x54da4d[_0x97ab('0xb')][_0x97ab('0xc')](0x0,_0x54da4d['name'][_0x97ab('0xd')]('@'));}var _0x3c1f7d=_0x54da4d[_0x97ab('0xb')][_0x97ab('0xe')](/\s+/);return _0x3c1f7d[_0x97ab('0xf')]>0x1?_0x3c1f7d[_0x97ab('0x10')](0x0,-0x1)[_0x97ab('0x11')]('\x20'):_0x54da4d['name'];}return'Anonymous';}function getLastName(_0x3973da){var _0x58a994=_[_0x97ab('0x5')](_0x3973da[_0x97ab('0x6')]);if(_0x58a994&&_0x58a994['name']){var _0x14d689=_0x58a994[_0x97ab('0xb')][_0x97ab('0xe')](/\s+/);return _0x14d689['length']>0x1?_0x14d689[_0x97ab('0x12')]():'';}return'';}function getMails(_0x5b5052,_0x41e008){var _0x243598='';for(var _0x3d27ba=0x0;_0x3d27ba<_0x41e008[_0x97ab('0x6')]['length'];_0x3d27ba+=0x1){if(_0x41e008['value'][_0x3d27ba][_0x97ab('0x7')]!==_0x5b5052){if(!_[_0x97ab('0x13')](_0x243598)){_0x243598+=',';}_0x243598+=_0x41e008[_0x97ab('0x6')][_0x3d27ba][_0x97ab('0xb')]||_0x41e008[_0x97ab('0x6')][_0x3d27ba][_0x97ab('0x7')]||'';_0x243598+='\x20<';_0x243598+=_0x41e008[_0x97ab('0x6')][_0x3d27ba][_0x97ab('0x7')]?_0x41e008[_0x97ab('0x6')][_0x3d27ba]['address']:_0x97ab('0x8')+random['generate'](0x6)+_0x97ab('0xa');_0x243598+='>';}}return _0x243598;}function parseEmail(_0x400a16,_0x2ba5,_0x461048){if(_0x2ba5[_0x97ab('0x14')]){var _0x51bc77=/