From: support
Date: Tue, 5 Jul 2022 11:51:58 +0000 (+0000)
Subject: Built motion from commit 8b4dd4e9.|2.6.12
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=fe34ad61d4b5ab5c7a095da95027f3813bdc90e6;p=motion2.git
Built motion from commit 8b4dd4e9.|2.6.12
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 254e9d3..bd8e76e 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-05T08:23:27.507Z",
+ "time": "2022-07-05T11:44:08.197Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index c5859e2..130d032 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-05T08:23:27.507Z",
+ "time": "2022-07-05T11:44:08.197Z",
"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 92986e9..baeccd1 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 _0x5ede=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','sequelize','getDataValue','STRING','contactManager','integration','motionbar','jscripty','script'];(function(_0x273e48,_0x4b4339){var _0x3b8e3f=function(_0x4ec17e){while(--_0x4ec17e){_0x273e48['push'](_0x273e48['shift']());}};_0x3b8e3f(++_0x4b4339);}(_0x5ede,0x13a));var _0xe5ed=function(_0x4386bb,_0x31bdd4){_0x4386bb=_0x4386bb-0x0;var _0xe5e733=_0x5ede[_0x4386bb];return _0xe5e733;};'use strict';var Sequelize=require(_0xe5ed('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2df64a){return this[_0xe5ed('0x1')]('action');}},'action':{'type':Sequelize[_0xe5ed('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe5ed('0x3'),_0xe5ed('0x4'),_0xe5ed('0x5'),_0xe5ed('0x6'),'urlForward','browser','bot',_0xe5ed('0x7')]],'msg':_0xe5ed('0x8')}},'comment':_0xe5ed('0x8')},'data1':{'type':Sequelize[_0xe5ed('0x2')](0x1000),'comment':_0xe5ed('0x9')},'data2':{'type':Sequelize[_0xe5ed('0x2')](0x1000),'comment':_0xe5ed('0xa')},'data3':{'type':Sequelize[_0xe5ed('0x2')](0x1000),'comment':_0xe5ed('0xb')},'data4':{'type':Sequelize[_0xe5ed('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xe5ed('0xc')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xe5ed('0xd')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x5e83=['integration','motionbar','jscripty','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]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x57a352,_0xbd7532){var _0x5cd613=function(_0x2e51c4){while(--_0x2e51c4){_0x57a352['push'](_0x57a352['shift']());}};_0x5cd613(++_0xbd7532);}(_0x5e83,0x111));var _0x35e8=function(_0xd3db70,_0x95661c){_0xd3db70=_0xd3db70-0x0;var _0x56707a=_0x5e83[_0xd3db70];return _0x56707a;};'use strict';var Sequelize=require(_0x35e8('0x0'));module[_0x35e8('0x1')]={'name':{'type':Sequelize[_0x35e8('0x2')],'get':function(_0x3db920){return this[_0x35e8('0x3')](_0x35e8('0x4'));}},'action':{'type':Sequelize[_0x35e8('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x35e8('0x6'),_0x35e8('0x7'),_0x35e8('0x8'),_0x35e8('0x9'),'urlForward',_0x35e8('0xa'),_0x35e8('0xb'),_0x35e8('0xc')]],'msg':_0x35e8('0xd')}},'comment':_0x35e8('0xd')},'data1':{'type':Sequelize[_0x35e8('0x5')](0x1000),'comment':_0x35e8('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x35e8('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x35e8('0x5')](0x1000),'comments':_0x35e8('0x10')},'data6':{'type':Sequelize[_0x35e8('0x5')],'comments':_0x35e8('0x11')},'data7':{'type':Sequelize[_0x35e8('0x12')],'comments':_0x35e8('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 9e86ea1..95c82ac 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 _0xee95=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','send','update','body','Action','find','catch','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xee95,0x150));var _0x5ee9=function(_0x2d1341,_0x36dce5){_0x2d1341=_0x2d1341-0x0;var _0x112b70=_0xee95[_0x2d1341];return _0x112b70;};'use strict';var emlformat=require(_0x5ee9('0x0'));var rimraf=require(_0x5ee9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ee9('0x2'));var rp=require(_0x5ee9('0x3'));var moment=require(_0x5ee9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ee9('0x5'));var util=require(_0x5ee9('0x6'));var path=require('path');var sox=require(_0x5ee9('0x7'));var csv=require('to-csv');var ejs=require(_0x5ee9('0x8'));var fs=require('fs');var fs_extra=require(_0x5ee9('0x9'));var _=require(_0x5ee9('0xa'));var squel=require('squel');var crypto=require(_0x5ee9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5ee9('0xc'));var toCsv=require(_0x5ee9('0xd'));var querystring=require('querystring');var Papa=require(_0x5ee9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ee9('0xf'));var as=require(_0x5ee9('0x10'));var hardwareService=require(_0x5ee9('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5ee9('0x12'));var config=require(_0x5ee9('0x13'));var licenseUtil=require(_0x5ee9('0x14'));var db=require(_0x5ee9('0x15'))['db'];function respondWithStatusCode(_0x58c6ff,_0x37abd2){_0x37abd2=_0x37abd2||0xcc;return function(_0x16e720){if(_0x16e720){return _0x58c6ff[_0x5ee9('0x16')](_0x37abd2);}return _0x58c6ff['status'](_0x37abd2)[_0x5ee9('0x17')]();};}function respondWithResult(_0x1c9362,_0xea5588){_0xea5588=_0xea5588||0xc8;return function(_0xc15afb){if(_0xc15afb){return _0x1c9362[_0x5ee9('0x18')](_0xea5588)[_0x5ee9('0x19')](_0xc15afb);}};}function respondWithFilteredResult(_0xb073fa,_0x58f01d){return function(_0x53622a){if(_0x53622a){var _0x5d6a0d=typeof _0x58f01d[_0x5ee9('0x1a')]===_0x5ee9('0x1b')&&typeof _0x58f01d[_0x5ee9('0x1c')]===_0x5ee9('0x1b');var _0x1ce21b=_0x53622a[_0x5ee9('0x1d')];var _0xa93d5f=_0x5d6a0d?0x0:_0x58f01d[_0x5ee9('0x1a')];var _0x4e8b4a=_0x5d6a0d?_0x53622a['count']:_0x58f01d[_0x5ee9('0x1a')]+_0x58f01d[_0x5ee9('0x1c')];var _0x117caa;if(_0x4e8b4a>=_0x1ce21b){_0x4e8b4a=_0x1ce21b;_0x117caa=0xc8;}else{_0x117caa=0xce;}_0xb073fa[_0x5ee9('0x18')](_0x117caa);return _0xb073fa['set'](_0x5ee9('0x1e'),_0xa93d5f+'-'+_0x4e8b4a+'/'+_0x1ce21b)['json'](_0x53622a);}return null;};}function patchUpdates(_0xc5d143){return function(_0x1e7ec1){try{jsonpatch[_0x5ee9('0x1f')](_0x1e7ec1,_0xc5d143,!![]);}catch(_0x5d13b4){return BPromise[_0x5ee9('0x20')](_0x5d13b4);}return _0x1e7ec1[_0x5ee9('0x21')]();};}function saveUpdates(_0x3eff2a,_0x1cea79){return function(_0x1ba592){if(_0x1ba592){return _0x1ba592['update'](_0x3eff2a)[_0x5ee9('0x22')](function(_0xc43a7b){return _0xc43a7b;});}return null;};}function removeEntity(_0x2545ff,_0x3a8bb9){return function(_0x5c6a4b){if(_0x5c6a4b){return _0x5c6a4b[_0x5ee9('0x23')]()[_0x5ee9('0x22')](function(){_0x2545ff['status'](0xcc)[_0x5ee9('0x17')]();});}};}function handleEntityNotFound(_0x57fc0c,_0x13e6ab){return function(_0x29ca92){if(!_0x29ca92){_0x57fc0c[_0x5ee9('0x16')](0x194);}return _0x29ca92;};}function handleError(_0x16ab6b,_0x1e2dc5){_0x1e2dc5=_0x1e2dc5||0x1f4;return function(_0x515640){logger[_0x5ee9('0x24')](_0x515640['stack']);if(_0x515640[_0x5ee9('0x25')]){delete _0x515640[_0x5ee9('0x25')];}_0x16ab6b[_0x5ee9('0x18')](_0x1e2dc5)[_0x5ee9('0x26')](_0x515640);};}exports[_0x5ee9('0x27')]=function(_0x3626a5,_0x56c29d){if(_0x3626a5[_0x5ee9('0x28')]['id']){delete _0x3626a5[_0x5ee9('0x28')]['id'];}return db[_0x5ee9('0x29')][_0x5ee9('0x2a')]({'where':{'id':_0x3626a5['params']['id']}})[_0x5ee9('0x22')](handleEntityNotFound(_0x56c29d,null))[_0x5ee9('0x22')](saveUpdates(_0x3626a5[_0x5ee9('0x28')],null))[_0x5ee9('0x22')](respondWithResult(_0x56c29d,null))[_0x5ee9('0x2b')](handleError(_0x56c29d,null));};exports[_0x5ee9('0x23')]=function(_0x124702,_0x1bab97){return db[_0x5ee9('0x29')][_0x5ee9('0x2a')]({'where':{'id':_0x124702[_0x5ee9('0x2c')]['id']}})[_0x5ee9('0x22')](handleEntityNotFound(_0x1bab97,null))['then'](removeEntity(_0x1bab97,null))['catch'](handleError(_0x1bab97,null));};
\ No newline at end of file
+var _0xdeea=['body','Action','find','params','catch','rimraf','zip-dir','request-promise','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','stack','name','send','update'];(function(_0x54096a,_0x5cb699){var _0x4b5bd0=function(_0x361d0c){while(--_0x361d0c){_0x54096a['push'](_0x54096a['shift']());}};_0x4b5bd0(++_0x5cb699);}(_0xdeea,0xef));var _0xadee=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xdeea[_0x13b02f];return _0x12e9a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xadee('0x0'));var zipdir=require(_0xadee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadee('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xadee('0x3'));var sox=require('sox');var csv=require(_0xadee('0x4'));var ejs=require(_0xadee('0x5'));var fs=require('fs');var fs_extra=require(_0xadee('0x6'));var _=require(_0xadee('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xadee('0x8'));var deskjs=require(_0xadee('0x9'));var toCsv=require(_0xadee('0x4'));var querystring=require('querystring');var Papa=require(_0xadee('0xa'));var Redis=require(_0xadee('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xadee('0xc'));var hardwareService=require(_0xadee('0xd'));var logger=require('../../config/logger')('api');var utils=require(_0xadee('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0xadee('0xf'));var db=require(_0xadee('0x10'))['db'];function respondWithStatusCode(_0x407dc1,_0x1522b7){_0x1522b7=_0x1522b7||0xcc;return function(_0x1b633b){if(_0x1b633b){return _0x407dc1[_0xadee('0x11')](_0x1522b7);}return _0x407dc1[_0xadee('0x12')](_0x1522b7)[_0xadee('0x13')]();};}function respondWithResult(_0x4b2dfd,_0xb74fe2){_0xb74fe2=_0xb74fe2||0xc8;return function(_0x40e043){if(_0x40e043){return _0x4b2dfd[_0xadee('0x12')](_0xb74fe2)[_0xadee('0x14')](_0x40e043);}};}function respondWithFilteredResult(_0x2b0c3f,_0x4c9e9f){return function(_0x39bac3){if(_0x39bac3){var _0x4082e8=typeof _0x4c9e9f[_0xadee('0x15')]==='undefined'&&typeof _0x4c9e9f['limit']===_0xadee('0x16');var _0x439c13=_0x39bac3[_0xadee('0x17')];var _0xe6ceeb=_0x4082e8?0x0:_0x4c9e9f[_0xadee('0x15')];var _0x19081b=_0x4082e8?_0x39bac3[_0xadee('0x17')]:_0x4c9e9f['offset']+_0x4c9e9f[_0xadee('0x18')];var _0x4506bf;if(_0x19081b>=_0x439c13){_0x19081b=_0x439c13;_0x4506bf=0xc8;}else{_0x4506bf=0xce;}_0x2b0c3f[_0xadee('0x12')](_0x4506bf);return _0x2b0c3f[_0xadee('0x19')](_0xadee('0x1a'),_0xe6ceeb+'-'+_0x19081b+'/'+_0x439c13)[_0xadee('0x14')](_0x39bac3);}return null;};}function patchUpdates(_0x581bad){return function(_0x59c0e8){try{jsonpatch['apply'](_0x59c0e8,_0x581bad,!![]);}catch(_0x4d07fa){return BPromise['reject'](_0x4d07fa);}return _0x59c0e8[_0xadee('0x1b')]();};}function saveUpdates(_0x1b9136,_0x3f3b73){return function(_0x586ad1){if(_0x586ad1){return _0x586ad1['update'](_0x1b9136)['then'](function(_0x16f2a1){return _0x16f2a1;});}return null;};}function removeEntity(_0x1678ea,_0x3f4504){return function(_0x27fa76){if(_0x27fa76){return _0x27fa76[_0xadee('0x1c')]()[_0xadee('0x1d')](function(){_0x1678ea['status'](0xcc)[_0xadee('0x13')]();});}};}function handleEntityNotFound(_0x392a01,_0x12f583){return function(_0x26aec3){if(!_0x26aec3){_0x392a01[_0xadee('0x11')](0x194);}return _0x26aec3;};}function handleError(_0x25499d,_0x18e897){_0x18e897=_0x18e897||0x1f4;return function(_0xfd6d20){logger['error'](_0xfd6d20[_0xadee('0x1e')]);if(_0xfd6d20['name']){delete _0xfd6d20[_0xadee('0x1f')];}_0x25499d[_0xadee('0x12')](_0x18e897)[_0xadee('0x20')](_0xfd6d20);};}exports[_0xadee('0x21')]=function(_0x34dbd7,_0x51e0d1){if(_0x34dbd7[_0xadee('0x22')]['id']){delete _0x34dbd7[_0xadee('0x22')]['id'];}return db[_0xadee('0x23')][_0xadee('0x24')]({'where':{'id':_0x34dbd7[_0xadee('0x25')]['id']}})[_0xadee('0x1d')](handleEntityNotFound(_0x51e0d1,null))[_0xadee('0x1d')](saveUpdates(_0x34dbd7[_0xadee('0x22')],null))[_0xadee('0x1d')](respondWithResult(_0x51e0d1,null))['catch'](handleError(_0x51e0d1,null));};exports[_0xadee('0x1c')]=function(_0xeac7d,_0x5a49a6){return db[_0xadee('0x23')][_0xadee('0x24')]({'where':{'id':_0xeac7d['params']['id']}})['then'](handleEntityNotFound(_0x5a49a6,null))['then'](removeEntity(_0x5a49a6,null))[_0xadee('0x26')](handleError(_0x5a49a6,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index c6ce16e..a8b47a8 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 _0x537a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','util'];(function(_0x153d48,_0x13d8bd){var _0x1954cc=function(_0x3152bd){while(--_0x3152bd){_0x153d48['push'](_0x153d48['shift']());}};_0x1954cc(++_0x13d8bd);}(_0x537a,0x1ac));var _0xa537=function(_0x58e35f,_0x105022){_0x58e35f=_0x58e35f-0x0;var _0x475308=_0x537a[_0x58e35f];return _0x475308;};'use strict';var _=require('lodash');var util=require(_0xa537('0x0'));var logger=require(_0xa537('0x1'))(_0xa537('0x2'));var moment=require(_0xa537('0x3'));var BPromise=require(_0xa537('0x4'));var rp=require(_0xa537('0x5'));var fs=require('fs');var path=require(_0xa537('0x6'));var rimraf=require(_0xa537('0x7'));var config=require(_0xa537('0x8'));var attributes=require(_0xa537('0x9'));module[_0xa537('0xa')]=function(_0x5e7487,_0x1f8c26){return _0x5e7487['define'](_0xa537('0xb'),attributes,{'tableName':_0xa537('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4708=['Action','tools_actions','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x421ead,_0x379f09){var _0x19de8f=function(_0x22ebf4){while(--_0x22ebf4){_0x421ead['push'](_0x421ead['shift']());}};_0x19de8f(++_0x379f09);}(_0x4708,0xa7));var _0x8470=function(_0x46b4e2,_0x22fb1d){_0x46b4e2=_0x46b4e2-0x0;var _0x5b48fc=_0x4708[_0x46b4e2];return _0x5b48fc;};'use strict';var _=require(_0x8470('0x0'));var util=require(_0x8470('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8470('0x2'));var rp=require(_0x8470('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8470('0x4'));var config=require(_0x8470('0x5'));var attributes=require(_0x8470('0x6'));module[_0x8470('0x7')]=function(_0x310710,_0x45206e){return _0x310710[_0x8470('0x8')](_0x8470('0x9'),attributes,{'tableName':_0x8470('0xa'),'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 5a99baf..6e0d954 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x53ec,0x192));var _0xc53e=function(_0x3f0b2a,_0x52f963){_0x3f0b2a=_0x3f0b2a-0x0;var _0x23bd63=_0x53ec[_0x3f0b2a];return _0x23bd63;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x814b,0x1a2));var _0xb814=function(_0x4ca796,_0x10dc47){_0x4ca796=_0x4ca796-0x0;var _0x171f87=_0x814b[_0x4ca796];return _0x171f87;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index a5a2a79..40defa3 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 _0x77ba=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','update'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x77ba,0x154));var _0xa77b=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x77ba[_0x207a02];return _0xd995c3;};'use strict';var multer=require(_0xa77b('0x0'));var util=require(_0xa77b('0x1'));var path=require(_0xa77b('0x2'));var timeout=require(_0xa77b('0x3'));var express=require('express');var router=express[_0xa77b('0x4')]();var fs_extra=require(_0xa77b('0x5'));var auth=require(_0xa77b('0x6'));var interaction=require(_0xa77b('0x7'));var config=require(_0xa77b('0x8'));var controller=require('./action.controller');router[_0xa77b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa77b('0xa')]);router[_0xa77b('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xa77b('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0xc884=['/:id','isAuthenticated','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put'];(function(_0x19b4fe,_0x829daa){var _0x6bbb1f=function(_0x420788){while(--_0x420788){_0x19b4fe['push'](_0x19b4fe['shift']());}};_0x6bbb1f(++_0x829daa);}(_0xc884,0x171));var _0x4c88=function(_0x363270,_0x1214ca){_0x363270=_0x363270-0x0;var _0x428f76=_0xc884[_0x363270];return _0x428f76;};'use strict';var multer=require('multer');var util=require(_0x4c88('0x0'));var path=require(_0x4c88('0x1'));var timeout=require(_0x4c88('0x2'));var express=require('express');var router=express[_0x4c88('0x3')]();var fs_extra=require(_0x4c88('0x4'));var auth=require(_0x4c88('0x5'));var interaction=require(_0x4c88('0x6'));var config=require(_0x4c88('0x7'));var controller=require('./action.controller');router[_0x4c88('0x8')](_0x4c88('0x9'),auth[_0x4c88('0xa')](),controller['update']);router[_0x4c88('0xb')](_0x4c88('0x9'),auth[_0x4c88('0xa')](),controller[_0x4c88('0xc')]);module[_0x4c88('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 1a8243e..4ff6757 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x2675,0x75));var _0x5267=function(_0x303f87,_0x1e0f6b){_0x303f87=_0x303f87-0x0;var _0x3c3226=_0x2675[_0x303f87];return _0x3c3226;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x4c99c2,_0x25e58d){var _0x59bf59=function(_0x1d662f){while(--_0x1d662f){_0x4c99c2['push'](_0x4c99c2['shift']());}};_0x59bf59(++_0x25e58d);}(_0xeff8,0x186));var _0x8eff=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xeff8[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index afe0c40..80f910a 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 _0xb2ed=['CustomReports','UserProfileResource','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','filters','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','params','include','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','keyBy','select','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../files/reports','savename','COUNT(*)','runReport','Limited\x20Query:','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','get'];(function(_0x46f647,_0x33ee02){var _0x4e1af9=function(_0x25f7d7){while(--_0x25f7d7){_0x46f647['push'](_0x46f647['shift']());}};_0x4e1af9(++_0x33ee02);}(_0xb2ed,0x120));var _0xdb2e=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xb2ed[_0xe0b81f];return _0x290e5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb2e('0x1'));var rp=require(_0xdb2e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdb2e('0x3'));var util=require(_0xdb2e('0x4'));var path=require(_0xdb2e('0x5'));var sox=require(_0xdb2e('0x6'));var csv=require(_0xdb2e('0x7'));var ejs=require(_0xdb2e('0x8'));var fs=require('fs');var fs_extra=require(_0xdb2e('0x9'));var _=require(_0xdb2e('0xa'));var squel=require(_0xdb2e('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb2e('0xc'));var deskjs=require(_0xdb2e('0xd'));var toCsv=require(_0xdb2e('0x7'));var querystring=require(_0xdb2e('0xe'));var Papa=require(_0xdb2e('0xf'));var Redis=require(_0xdb2e('0x10'));var authService=require(_0xdb2e('0x11'));var qs=require(_0xdb2e('0x12'));var as=require(_0xdb2e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb2e('0x14'))(_0xdb2e('0x15'));var utils=require(_0xdb2e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdb2e('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0xdb2e('0x18'))[_0xdb2e('0x19')];function respondWithStatusCode(_0x247337,_0x74bdc4){_0x74bdc4=_0x74bdc4||0xcc;return function(_0x3ef2a0){if(_0x3ef2a0){return _0x247337[_0xdb2e('0x1a')](_0x74bdc4);}return _0x247337[_0xdb2e('0x1b')](_0x74bdc4)[_0xdb2e('0x1c')]();};}function respondWithResult(_0x2131c5,_0x9ffbbc){_0x9ffbbc=_0x9ffbbc||0xc8;return function(_0x487e85){if(_0x487e85){return _0x2131c5[_0xdb2e('0x1b')](_0x9ffbbc)[_0xdb2e('0x1d')](_0x487e85);}};}function respondWithFilteredResult(_0x4fa14b,_0x16e416){return function(_0x5a4f4d){if(_0x5a4f4d){var _0x25de74=typeof _0x16e416[_0xdb2e('0x1e')]==='undefined'&&typeof _0x16e416['limit']===_0xdb2e('0x1f');var _0x1eaa89=_0x5a4f4d[_0xdb2e('0x20')];var _0x4e1e9e=_0x25de74?0x0:_0x16e416[_0xdb2e('0x1e')];var _0x37cfe8=_0x25de74?_0x5a4f4d['count']:_0x16e416['offset']+_0x16e416['limit'];var _0x96841a;if(_0x37cfe8>=_0x1eaa89){_0x37cfe8=_0x1eaa89;_0x96841a=0xc8;}else{_0x96841a=0xce;}_0x4fa14b[_0xdb2e('0x1b')](_0x96841a);return _0x4fa14b[_0xdb2e('0x21')](_0xdb2e('0x22'),_0x4e1e9e+'-'+_0x37cfe8+'/'+_0x1eaa89)[_0xdb2e('0x1d')](_0x5a4f4d);}return null;};}function patchUpdates(_0x2b3c08){return function(_0x22256c){try{jsonpatch[_0xdb2e('0x23')](_0x22256c,_0x2b3c08,!![]);}catch(_0x37b042){return BPromise[_0xdb2e('0x24')](_0x37b042);}return _0x22256c['save']();};}function saveUpdates(_0x523262,_0x49d314){return function(_0x4a7ab6){if(_0x4a7ab6){return _0x4a7ab6['update'](_0x523262)[_0xdb2e('0x25')](function(_0x67c853){return _0x67c853;});}return null;};}function removeEntity(_0x22f932,_0x4e99bd){return function(_0x3e8c5f){if(_0x3e8c5f){return _0x3e8c5f[_0xdb2e('0x26')]()[_0xdb2e('0x25')](function(){var _0x5ba45c=_0x3e8c5f[_0xdb2e('0x27')]({'plain':!![]});var _0x40cf5a=_0xdb2e('0x28');return db[_0xdb2e('0x29')][_0xdb2e('0x26')]({'where':{'type':_0x40cf5a,'resourceId':_0x5ba45c['id']}})[_0xdb2e('0x25')](function(){return _0x3e8c5f;});})[_0xdb2e('0x25')](function(){_0x22f932[_0xdb2e('0x1b')](0xcc)[_0xdb2e('0x1c')]();});}};}function handleEntityNotFound(_0x4a5ee1,_0x4274f5){return function(_0x3b393b){if(!_0x3b393b){_0x4a5ee1[_0xdb2e('0x1a')](0x194);}return _0x3b393b;};}function handleError(_0x354c16,_0xaf4631){_0xaf4631=_0xaf4631||0x1f4;return function(_0xa5a88e){logger['error'](_0xa5a88e[_0xdb2e('0x2a')]);if(_0xa5a88e[_0xdb2e('0x2b')]){delete _0xa5a88e[_0xdb2e('0x2b')];}_0x354c16[_0xdb2e('0x1b')](_0xaf4631)['send'](_0xa5a88e);};}exports[_0xdb2e('0x2c')]=function(_0x4c05bd,_0x25ae45){var _0x55c8ac={},_0x9f5b4={},_0x1384a4={'count':0x0,'rows':[]};var _0x5454b0=_[_0xdb2e('0x2d')](db[_0xdb2e('0x2e')][_0xdb2e('0x2f')],function(_0x389f35){return{'name':_0x389f35[_0xdb2e('0x30')],'type':_0x389f35['type'][_0xdb2e('0x31')]};});_0x9f5b4['model']=_[_0xdb2e('0x2d')](_0x5454b0,_0xdb2e('0x2b'));_0x9f5b4['query']=_['keys'](_0x4c05bd['query']);_0x9f5b4[_0xdb2e('0x32')]=_['intersection'](_0x9f5b4[_0xdb2e('0x33')],_0x9f5b4['query']);_0x55c8ac['attributes']=_[_0xdb2e('0x34')](_0x9f5b4[_0xdb2e('0x33')],qs['fields'](_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x36')]));_0x55c8ac[_0xdb2e('0x37')]=_0x55c8ac['attributes'][_0xdb2e('0x38')]?_0x55c8ac['attributes']:_0x9f5b4[_0xdb2e('0x33')];if(!_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x39')](_0xdb2e('0x3a'))){_0x55c8ac['limit']=qs[_0xdb2e('0x3b')](_0x4c05bd['query'][_0xdb2e('0x3b')]);_0x55c8ac[_0xdb2e('0x1e')]=qs[_0xdb2e('0x1e')](_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x1e')]);}_0x55c8ac['order']=qs[_0xdb2e('0x3c')](_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x3c')]);_0x55c8ac[_0xdb2e('0x3d')]=qs[_0xdb2e('0x32')](_[_0xdb2e('0x3e')](_0x4c05bd[_0xdb2e('0x35')],_0x9f5b4[_0xdb2e('0x32')]),_0x5454b0);if(_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x3f')]){_0x55c8ac[_0xdb2e('0x3d')]=_[_0xdb2e('0x40')](_0x55c8ac['where'],{'$or':_[_0xdb2e('0x2d')](_0x5454b0,function(_0x954a4e){if(_0x954a4e[_0xdb2e('0x41')]!==_0xdb2e('0x42')){var _0x13d0f7={};_0x13d0f7[_0x954a4e[_0xdb2e('0x2b')]]={'$like':'%'+_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x3f')]+'%'};return _0x13d0f7;}})});}_0x55c8ac=_[_0xdb2e('0x40')]({},_0x55c8ac,_0x4c05bd[_0xdb2e('0x43')]);var _0x2d13ab={'where':_0x55c8ac[_0xdb2e('0x3d')]};return db['AnalyticCustomReport'][_0xdb2e('0x20')](_0x2d13ab)[_0xdb2e('0x25')](function(_0x3437a0){_0x1384a4[_0xdb2e('0x20')]=_0x3437a0;if(_0x4c05bd['query'][_0xdb2e('0x44')]){_0x55c8ac['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x55c8ac);})[_0xdb2e('0x25')](function(_0x13f2fe){_0x1384a4[_0xdb2e('0x45')]=_0x13f2fe;return _0x1384a4;})[_0xdb2e('0x25')](respondWithFilteredResult(_0x25ae45,_0x55c8ac))['catch'](handleError(_0x25ae45,null));};exports['show']=function(_0x111f08,_0x3fc088){var _0x1d99a0={'raw':![],'where':{'id':_0x111f08[_0xdb2e('0x46')]['id']}},_0x552401={};_0x552401[_0xdb2e('0x33')]=_['keys'](db[_0xdb2e('0x2e')][_0xdb2e('0x2f')]);_0x552401['query']=_['keys'](_0x111f08[_0xdb2e('0x35')]);_0x552401['filters']=_[_0xdb2e('0x34')](_0x552401[_0xdb2e('0x33')],_0x552401[_0xdb2e('0x35')]);_0x1d99a0[_0xdb2e('0x37')]=_[_0xdb2e('0x34')](_0x552401[_0xdb2e('0x33')],qs[_0xdb2e('0x36')](_0x111f08[_0xdb2e('0x35')][_0xdb2e('0x36')]));_0x1d99a0[_0xdb2e('0x37')]=_0x1d99a0[_0xdb2e('0x37')][_0xdb2e('0x38')]?_0x1d99a0['attributes']:_0x552401['model'];if(_0x111f08[_0xdb2e('0x35')][_0xdb2e('0x44')]){_0x1d99a0[_0xdb2e('0x47')]=[{'all':!![]}];}_0x1d99a0=_[_0xdb2e('0x40')]({},_0x1d99a0,_0x111f08[_0xdb2e('0x43')]);return db[_0xdb2e('0x2e')][_0xdb2e('0x48')](_0x1d99a0)[_0xdb2e('0x25')](handleEntityNotFound(_0x3fc088,null))[_0xdb2e('0x25')](respondWithResult(_0x3fc088,null))[_0xdb2e('0x49')](handleError(_0x3fc088,null));};exports[_0xdb2e('0x4a')]=function(_0x4ae62a,_0xbbaf63){return db[_0xdb2e('0x2e')]['create'](_0x4ae62a[_0xdb2e('0x4b')],{})[_0xdb2e('0x25')](function(_0x43ba10){var _0x5152e8=_0x4ae62a['user'][_0xdb2e('0x27')]({'plain':!![]});if(!_0x5152e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5152e8['role']===_0xdb2e('0x4c')){var _0x136203=_0x43ba10[_0xdb2e('0x27')]({'plain':!![]});var _0x50a7e5='Reports';return db[_0xdb2e('0x4d')][_0xdb2e('0x48')]({'where':{'name':_0x50a7e5,'userProfileId':_0x5152e8[_0xdb2e('0x4e')]},'raw':!![]})[_0xdb2e('0x25')](function(_0x654a03){if(_0x654a03&&_0x654a03[_0xdb2e('0x4f')]===0x0){return db[_0xdb2e('0x29')][_0xdb2e('0x4a')]({'name':_0x136203['name'],'resourceId':_0x136203['id'],'type':_0xdb2e('0x28'),'sectionId':_0x654a03['id']},{})[_0xdb2e('0x25')](function(){return _0x43ba10;});}else{return _0x43ba10;}})[_0xdb2e('0x49')](function(_0x543e7e){logger[_0xdb2e('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x543e7e);throw _0x543e7e;});}return _0x43ba10;})[_0xdb2e('0x25')](respondWithResult(_0xbbaf63,0xc9))['catch'](handleError(_0xbbaf63,null));};exports['update']=function(_0x6935bc,_0xbbcbeb){if(_0x6935bc[_0xdb2e('0x4b')]['id']){delete _0x6935bc['body']['id'];}return db['AnalyticCustomReport'][_0xdb2e('0x48')]({'where':{'id':_0x6935bc[_0xdb2e('0x46')]['id']}})[_0xdb2e('0x25')](handleEntityNotFound(_0xbbcbeb,null))[_0xdb2e('0x25')](saveUpdates(_0x6935bc['body'],null))['then'](respondWithResult(_0xbbcbeb,null))['catch'](handleError(_0xbbcbeb,null));};exports[_0xdb2e('0x26')]=function(_0x1b876a,_0x9accb6){return db[_0xdb2e('0x2e')]['find']({'where':{'id':_0x1b876a[_0xdb2e('0x46')]['id']}})[_0xdb2e('0x25')](handleEntityNotFound(_0x9accb6,null))[_0xdb2e('0x25')](removeEntity(_0x9accb6,null))[_0xdb2e('0x49')](handleError(_0x9accb6,null));};exports['preview']=function(_0x3d9df1,_0x4e1c83){var _0x296ec2=0xa;var _0x54d8b8=[_0xdb2e('0x51'),_0xdb2e('0x52'),'right_join',_0xdb2e('0x53')];var _0x194672={'SUM':_0xdb2e('0x54'),'COUNT':_0xdb2e('0x55'),'COUNT DISTINCT':_0xdb2e('0x56'),'MAX':_0xdb2e('0x57'),'MIN':'MIN(%s)','AVG':_0xdb2e('0x58'),'GROUP_CONCAT':_0xdb2e('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdb2e('0x5a')};var _0x584168={'SEC_TO_TIME':_0xdb2e('0x5b'),'DATE':_0xdb2e('0x5c'),'HOUR':_0xdb2e('0x5d'),'ROUND':_0xdb2e('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4ade26=function(_0x4af46d){return!_['includes']([_0xdb2e('0x5f'),'IS\x20NOT\x20NULL',_0xdb2e('0x60'),'IS\x20NOT\x20EMPTY'],_0x4af46d);};var _0x2a3936=function(_0x4c8699){if(!_0x4c8699||!_0x4c8699[_0xdb2e('0x61')]['length']){return'';}for(var _0x4cd4f2='(',_0x3a3c9c=0x0;_0x3a3c9c<_0x4c8699[_0xdb2e('0x61')][_0xdb2e('0x38')];_0x3a3c9c+=0x1){_0x3a3c9c>0x0&&(_0x4cd4f2+='\x20'+_0x4c8699[_0xdb2e('0x62')]+'\x20');_0x4cd4f2+=_0x4c8699['rules'][_0x3a3c9c][_0xdb2e('0x63')]?_0x2a3936(_0x4c8699[_0xdb2e('0x61')][_0x3a3c9c][_0xdb2e('0x63')]):_0x4c8699[_0xdb2e('0x61')][_0x3a3c9c][_0xdb2e('0x64')]+'\x20'+_0x4c8699['rules'][_0x3a3c9c][_0xdb2e('0x65')]+(_0x4ade26(_0x4c8699['rules'][_0x3a3c9c]['condition'])?'\x20'+_0x4c8699['rules'][_0x3a3c9c][_0xdb2e('0x66')]:'');}return _0x4cd4f2+')';};var _0x3aef1c={'where':{'id':_0x3d9df1[_0xdb2e('0x46')]['id']}},_0x55d5b6,_0xcd07be,_0x4ae7bf,_0x37410b,_0xf52371;_0x3aef1c=_[_0xdb2e('0x40')]({},_0x3aef1c,_0x3d9df1['options']);return db['AnalyticCustomReport']['find'](_0x3aef1c)[_0xdb2e('0x25')](function(_0x18e31e){if(_0x18e31e){_0x55d5b6=_0x18e31e;return _0x18e31e[_0xdb2e('0x67')]();}return null;})['then'](function(_0x4ef15a){if(_0x4ef15a){if(!_0x4ef15a[_0xdb2e('0x38')]){throw new db[(_0xdb2e('0x68'))][(_0xdb2e('0x69'))](_0xdb2e('0x6a'),0x193);}_0xcd07be=_0x4ef15a;return db[_0xdb2e('0x6b')][_0xdb2e('0x6c')]({'raw':!![]});}return null;})[_0xdb2e('0x25')](function(_0x410137){if(_0x410137){_0x4ae7bf=_['keyBy'](_0x410137,'id');var _0x2e70fb;var _0x39af88=squel['select']();_0x39af88[_0xdb2e('0x6d')](_0x55d5b6[_0xdb2e('0x6e')]);for(var _0x1e95fa=0x0;_0x1e95fa<_0xcd07be[_0xdb2e('0x38')];_0x1e95fa+=0x1){_0x2e70fb=_0xcd07be[_0x1e95fa][_0xdb2e('0x6f')]?_0x4ae7bf[_0xcd07be[_0x1e95fa][_0xdb2e('0x6f')]][_0xdb2e('0x70')]:_0xcd07be[_0x1e95fa]['field'];_0x2e70fb=_0xcd07be[_0x1e95fa][_0xdb2e('0x71')]?_[_0xdb2e('0x72')](_0x194672[_0xcd07be[_0x1e95fa][_0xdb2e('0x71')]],'%s',_0x2e70fb):_0x2e70fb;_0x2e70fb=_0xcd07be[_0x1e95fa][_0xdb2e('0x73')]?_[_0xdb2e('0x72')](_0x584168[_0xcd07be[_0x1e95fa]['format']],'%s',_0x2e70fb):_0x2e70fb;if(_0xcd07be[_0x1e95fa][_0xdb2e('0x74')]){_0x39af88[_0xdb2e('0x63')](_0x2e70fb);}_0xcd07be[_0x1e95fa][_0xdb2e('0x75')]&&_0x39af88[_0xdb2e('0x76')](_0x2e70fb,_0xcd07be[_0x1e95fa][_0xdb2e('0x75')]===_0xdb2e('0x77')?![]:!![]);_0x39af88[_0xdb2e('0x64')](_0x2e70fb,_0xcd07be[_0x1e95fa][_0xdb2e('0x78')]||_0x2e70fb);}if(_0x55d5b6[_0xdb2e('0x79')]){_0x55d5b6['joins']=JSON['parse'](_0x55d5b6[_0xdb2e('0x79')]);for(var _0x5dd40a=0x0;_0x5dd40a<_0x55d5b6[_0xdb2e('0x79')][_0xdb2e('0x38')];_0x5dd40a+=0x1){if(_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x41')]&&_['includes'](_0x54d8b8,_0x55d5b6['joins'][_0x5dd40a][_0xdb2e('0x41')])&&_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7a')]&&_0x55d5b6['joins'][_0x5dd40a][_0xdb2e('0x7b')]&&_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7c')]){_0x39af88[_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x41')]](_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7b')],null,util[_0xdb2e('0x73')](_0xdb2e('0x7d'),_0x55d5b6[_0xdb2e('0x6e')],_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7a')],_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7b')],_0x55d5b6['joins'][_0x5dd40a][_0xdb2e('0x7c')]));}}}if(_0x55d5b6['conditions']){_0x55d5b6[_0xdb2e('0x7e')]=JSON[_0xdb2e('0x7f')](_0x55d5b6[_0xdb2e('0x7e')]);_0x39af88[_0xdb2e('0x3d')](_0x2a3936(_0x55d5b6[_0xdb2e('0x7e')][_0xdb2e('0x63')]));}_0xf52371=_0x39af88[_0xdb2e('0x80')]();_0x39af88[_0xdb2e('0x3b')](_0x296ec2);_0x39af88[_0xdb2e('0x1e')](0x0);logger[_0xdb2e('0x81')]('Limited\x20Query:',_0x39af88[_0xdb2e('0x82')]());return dbH[_0xdb2e('0x83')][_0xdb2e('0x35')](_0x39af88['toString'](),{'type':dbH['sequelize'][_0xdb2e('0x84')][_0xdb2e('0x85')]});}})[_0xdb2e('0x25')](respondWithResult(_0x4e1c83,null))[_0xdb2e('0x49')](handleError(_0x4e1c83,null));};function runReport(_0x383a6b,_0x4f5de4,_0x627b45){var _0xc8aaf1=_0x4f5de4[_0xdb2e('0x2b')];var _0x3f8e5a=0xa;var _0x27df56=[_0xdb2e('0x51'),'left_join',_0xdb2e('0x86'),_0xdb2e('0x53')];var _0x570777={'SUM':_0xdb2e('0x54'),'COUNT':_0xdb2e('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdb2e('0x57'),'MIN':_0xdb2e('0x87'),'AVG':_0xdb2e('0x58'),'GROUP_CONCAT':_0xdb2e('0x59'),'GROUP_CONCAT ASC':_0xdb2e('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x485d3d={'SEC_TO_TIME':_0xdb2e('0x5b'),'DATE':_0xdb2e('0x5c'),'HOUR':_0xdb2e('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdb2e('0x89')};var _0x3f005a=function(_0x3e7129){return!_[_0xdb2e('0x8a')]([_0xdb2e('0x5f'),_0xdb2e('0x8b'),'IS\x20EMPTY',_0xdb2e('0x8c')],_0x3e7129);};var _0x5dc883=function(_0x3ea83e){if(!_0x3ea83e||!_0x3ea83e[_0xdb2e('0x61')]['length']){return'';}for(var _0x5f2011='(',_0x313267=0x0;_0x313267<_0x3ea83e['rules'][_0xdb2e('0x38')];_0x313267+=0x1){_0x313267>0x0&&(_0x5f2011+='\x20'+_0x3ea83e[_0xdb2e('0x62')]+'\x20');_0x5f2011+=_0x3ea83e['rules'][_0x313267][_0xdb2e('0x63')]?_0x5dc883(_0x3ea83e[_0xdb2e('0x61')][_0x313267][_0xdb2e('0x63')]):_0x3ea83e['rules'][_0x313267][_0xdb2e('0x64')]+'\x20'+_0x3ea83e['rules'][_0x313267]['condition']+(_0x3f005a(_0x3ea83e[_0xdb2e('0x61')][_0x313267][_0xdb2e('0x65')])?'\x20'+_0x3ea83e[_0xdb2e('0x61')][_0x313267][_0xdb2e('0x66')]:'');}return _0x5f2011+')';};var _0x2ab1e1={'where':{'id':_0x383a6b['id']}},_0x2648f6,_0x56b2f6,_0x5041d0,_0x19f61a,_0x13c5d7;_0x2ab1e1=_['merge']({},_0x2ab1e1,_0x627b45);return db[_0xdb2e('0x2e')][_0xdb2e('0x48')](_0x2ab1e1)[_0xdb2e('0x25')](function(_0x2166c3){if(_0x2166c3){_0x2648f6=_0x2166c3;return _0x2166c3[_0xdb2e('0x67')]();}return null;})[_0xdb2e('0x25')](function(_0x5eb83f){if(_0x5eb83f){if(!_0x5eb83f[_0xdb2e('0x38')]){throw new db[(_0xdb2e('0x68'))][(_0xdb2e('0x69'))](_0xdb2e('0x6a'),0x193);}_0x56b2f6=_0x5eb83f;return db[_0xdb2e('0x6b')][_0xdb2e('0x6c')]({'raw':!![]});}return null;})[_0xdb2e('0x25')](function(_0x215b57){if(_0x215b57){_0x5041d0=_[_0xdb2e('0x8d')](_0x215b57,'id');var _0x11d9bb;var _0x4ac2e3=squel[_0xdb2e('0x8e')]();_0x4ac2e3['from'](_0x2648f6[_0xdb2e('0x6e')]);for(var _0x132c8f=0x0;_0x132c8f<_0x56b2f6[_0xdb2e('0x38')];_0x132c8f+=0x1){_0x11d9bb=_0x56b2f6[_0x132c8f][_0xdb2e('0x6f')]?_0x5041d0[_0x56b2f6[_0x132c8f][_0xdb2e('0x6f')]]['metric']:_0x56b2f6[_0x132c8f]['field'];_0x11d9bb=_0x56b2f6[_0x132c8f][_0xdb2e('0x71')]?_[_0xdb2e('0x72')](_0x570777[_0x56b2f6[_0x132c8f][_0xdb2e('0x71')]],'%s',_0x11d9bb):_0x11d9bb;_0x11d9bb=_0x56b2f6[_0x132c8f][_0xdb2e('0x73')]?_[_0xdb2e('0x72')](_0x485d3d[_0x56b2f6[_0x132c8f][_0xdb2e('0x73')]],'%s',_0x11d9bb):_0x11d9bb;if(_0x56b2f6[_0x132c8f][_0xdb2e('0x74')]){_0x4ac2e3['group'](_0x11d9bb);}_0x56b2f6[_0x132c8f][_0xdb2e('0x75')]&&_0x4ac2e3[_0xdb2e('0x76')](_0x11d9bb,_0x56b2f6[_0x132c8f][_0xdb2e('0x75')]==='DESC'?![]:!![]);_0x4ac2e3[_0xdb2e('0x64')](_0x11d9bb,_0x56b2f6[_0x132c8f][_0xdb2e('0x78')]||_0x11d9bb);}if(_0x2648f6['joins']){_0x2648f6[_0xdb2e('0x79')]=JSON[_0xdb2e('0x7f')](_0x2648f6[_0xdb2e('0x79')]);for(var _0x314cf2=0x0;_0x314cf2<_0x2648f6[_0xdb2e('0x79')][_0xdb2e('0x38')];_0x314cf2+=0x1){if(_0x2648f6['joins'][_0x314cf2]['type']&&_[_0xdb2e('0x8a')](_0x27df56,_0x2648f6[_0xdb2e('0x79')][_0x314cf2]['type'])&&_0x2648f6[_0xdb2e('0x79')][_0x314cf2]['parentKey']&&_0x2648f6[_0xdb2e('0x79')][_0x314cf2][_0xdb2e('0x7b')]&&_0x2648f6[_0xdb2e('0x79')][_0x314cf2]['foreignKey']){_0x4ac2e3[_0x2648f6['joins'][_0x314cf2][_0xdb2e('0x41')]](_0x2648f6[_0xdb2e('0x79')][_0x314cf2]['foreignTable'],null,util[_0xdb2e('0x73')](_0xdb2e('0x7d'),_0x2648f6[_0xdb2e('0x6e')],_0x2648f6[_0xdb2e('0x79')][_0x314cf2][_0xdb2e('0x7a')],_0x2648f6['joins'][_0x314cf2]['foreignTable'],_0x2648f6[_0xdb2e('0x79')][_0x314cf2][_0xdb2e('0x7c')]));}}}if(_0x2648f6[_0xdb2e('0x7e')]){_0x2648f6[_0xdb2e('0x7e')]=JSON[_0xdb2e('0x7f')](_0x2648f6[_0xdb2e('0x7e')]);_0x4ac2e3[_0xdb2e('0x3d')](_0x5dc883(_0x2648f6[_0xdb2e('0x7e')][_0xdb2e('0x63')]));}_0x13c5d7=_0x4ac2e3[_0xdb2e('0x80')]();_0x4ac2e3[_0xdb2e('0x3b')](_0x3f8e5a);_0x4ac2e3['offset'](0x0);return;}})[_0xdb2e('0x25')](function(){if(_0x4f5de4[_0xdb2e('0x8f')]===_0xdb2e('0x90')){return null;}var _0x18f6c4=_[_0xdb2e('0x40')](_0x4f5de4,{'name':_0x4f5de4[_0xdb2e('0x91')]||_0x4f5de4[_0xdb2e('0x2b')]||_0x2648f6['name'],'basename':_0xc8aaf1,'savename':util['format'](_0xdb2e('0x92'),_0x4f5de4[_0xdb2e('0x2b')]||_0x2648f6[_0xdb2e('0x2b')],require(_0xdb2e('0x93'))['generate'](0x4),_0x4f5de4['output']||_0xdb2e('0x94')),'reportId':_0x2648f6['id'],'reportType':_0xdb2e('0x95')});return db[_0xdb2e('0x96')][_0xdb2e('0x4a')](_0x18f6c4,{'raw':!![]});})[_0xdb2e('0x25')](function(_0x35a6cd){if(_0x2648f6[_0xdb2e('0x6e')]===_0xdb2e('0x97')){_0x13c5d7[_0xdb2e('0x3d')](_0x2648f6[_0xdb2e('0x6e')]+_0xdb2e('0x98'),_0x4f5de4['startDate'],_0x4f5de4[_0xdb2e('0x99')]);}else{_0x13c5d7[_0xdb2e('0x3d')](_0x2648f6[_0xdb2e('0x6e')]+_0xdb2e('0x9a'),_0x4f5de4[_0xdb2e('0x9b')],_0x4f5de4[_0xdb2e('0x99')]);}if(_0x35a6cd){logger[_0xdb2e('0x9c')](_0xdb2e('0x9d'),_0x13c5d7[_0xdb2e('0x82')]());require(_0xdb2e('0x9e'))['fork'](path[_0xdb2e('0x51')](__dirname,'../../components/export/',_0x35a6cd[_0xdb2e('0x8f')]),[_0x35a6cd['id'],_0x13c5d7[_0xdb2e('0x82')](),path[_0xdb2e('0x51')](__dirname,_0xdb2e('0x9f'),_0x35a6cd[_0xdb2e('0xa0')]),_0xc8aaf1]);return _0x35a6cd;}else{var _0x3796eb=squel[_0xdb2e('0x8e')]();_0x3796eb['from']('('+_0x13c5d7[_0xdb2e('0x82')]()+')','countTable');_0x3796eb[_0xdb2e('0x64')](_0xdb2e('0xa1'),'count');_0x13c5d7[_0xdb2e('0x3b')](_0x4f5de4['limit']||_0x3f8e5a);_0x13c5d7[_0xdb2e('0x1e')](_0x4f5de4['offset']||0x0);return dbH['sequelize'][_0xdb2e('0x35')](_0x3796eb['toString'](),{'type':dbH['sequelize'][_0xdb2e('0x84')][_0xdb2e('0x85')]})['then'](function(_0x52f959){if(!_0x52f959[_0xdb2e('0x38')]){_0x19f61a=0x0;}else{_0x19f61a=_0x52f959[0x0][_0xdb2e('0x20')]||0x0;}return dbH[_0xdb2e('0x83')][_0xdb2e('0x35')](_0x13c5d7['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xdb2e('0x85')]});})[_0xdb2e('0x25')](function(_0x14e7c9){return{'rows':_0x14e7c9||[],'count':_0x19f61a};});}});}exports['run']=function(_0x18b044,_0x561a71){return runReport(_0x18b044['params'],_0x18b044[_0xdb2e('0x35')],_0x18b044[_0xdb2e('0x43')])['then'](respondWithResult(_0x561a71,null))[_0xdb2e('0x49')](handleError(_0x561a71,null));};exports[_0xdb2e('0xa2')]=runReport;exports[_0xdb2e('0x35')]=function(_0x45f862,_0x482d19){var _0x5027c4=0xa;var _0xf30a64=[_0xdb2e('0x51'),_0xdb2e('0x52'),'right_join',_0xdb2e('0x53')];var _0x12cbdb={'SUM':_0xdb2e('0x54'),'COUNT':_0xdb2e('0x55'),'COUNT DISTINCT':_0xdb2e('0x56'),'MAX':_0xdb2e('0x57'),'MIN':_0xdb2e('0x87'),'AVG':_0xdb2e('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xdb2e('0x88'),'GROUP_CONCAT DESC':_0xdb2e('0x5a')};var _0x35679c={'SEC_TO_TIME':_0xdb2e('0x5b'),'DATE':_0xdb2e('0x5c'),'HOUR':_0xdb2e('0x5d'),'ROUND':_0xdb2e('0x5e'),'UNIX_TIMESTAMP':_0xdb2e('0x89')};var _0x415b46=function(_0x1efd55){return!_[_0xdb2e('0x8a')]([_0xdb2e('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xdb2e('0x8c')],_0x1efd55);};var _0x357939=function(_0x35db1a){if(!_0x35db1a||!_0x35db1a[_0xdb2e('0x61')][_0xdb2e('0x38')]){return'';}for(var _0x455a00='(',_0x56d13c=0x0;_0x56d13c<_0x35db1a['rules'][_0xdb2e('0x38')];_0x56d13c+=0x1){_0x56d13c>0x0&&(_0x455a00+='\x20'+_0x35db1a[_0xdb2e('0x62')]+'\x20');_0x455a00+=_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x63')]?_0x357939(_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x63')]):_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x64')]+'\x20'+_0x35db1a[_0xdb2e('0x61')][_0x56d13c]['condition']+(_0x415b46(_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x65')])?'\x20'+_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x66')]:'');}return _0x455a00+')';};var _0x24b78e={'where':{'id':_0x45f862[_0xdb2e('0x46')]['id']}},_0x967c55,_0x11db14,_0x2cb682,_0x2adaed,_0x96c187;_0x24b78e=_[_0xdb2e('0x40')]({},_0x24b78e,_0x45f862['options']);return db['AnalyticCustomReport']['find'](_0x24b78e)[_0xdb2e('0x25')](function(_0xd0a841){if(_0xd0a841){_0x967c55=_0xd0a841;return _0xd0a841[_0xdb2e('0x67')]();}return null;})[_0xdb2e('0x25')](function(_0x3588dc){if(_0x3588dc){if(!_0x3588dc['length']){throw new db[(_0xdb2e('0x68'))][(_0xdb2e('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x11db14=_0x3588dc;return db[_0xdb2e('0x6b')][_0xdb2e('0x6c')]({'raw':!![]});}return null;})['then'](function(_0x4a992b){if(_0x4a992b){_0x2cb682=_[_0xdb2e('0x8d')](_0x4a992b,'id');var _0x54988b;var _0x127531=squel['select']();_0x127531[_0xdb2e('0x6d')](_0x967c55[_0xdb2e('0x6e')]);for(var _0x402c85=0x0;_0x402c85<_0x11db14[_0xdb2e('0x38')];_0x402c85+=0x1){_0x54988b=_0x11db14[_0x402c85][_0xdb2e('0x6f')]?_0x2cb682[_0x11db14[_0x402c85][_0xdb2e('0x6f')]][_0xdb2e('0x70')]:_0x11db14[_0x402c85][_0xdb2e('0x64')];_0x54988b=_0x11db14[_0x402c85][_0xdb2e('0x71')]?_[_0xdb2e('0x72')](_0x12cbdb[_0x11db14[_0x402c85][_0xdb2e('0x71')]],'%s',_0x54988b):_0x54988b;_0x54988b=_0x11db14[_0x402c85][_0xdb2e('0x73')]?_[_0xdb2e('0x72')](_0x35679c[_0x11db14[_0x402c85][_0xdb2e('0x73')]],'%s',_0x54988b):_0x54988b;if(_0x11db14[_0x402c85]['groupBy']){_0x127531[_0xdb2e('0x63')](_0x54988b);}_0x11db14[_0x402c85]['orderBy']&&_0x127531[_0xdb2e('0x76')](_0x54988b,_0x11db14[_0x402c85]['orderBy']===_0xdb2e('0x77')?![]:!![]);_0x127531[_0xdb2e('0x64')](_0x54988b,_0x11db14[_0x402c85]['alias']||_0x54988b);}if(_0x967c55['joins']){_0x967c55[_0xdb2e('0x79')]=JSON['parse'](_0x967c55[_0xdb2e('0x79')]);for(var _0x341715=0x0;_0x341715<_0x967c55[_0xdb2e('0x79')][_0xdb2e('0x38')];_0x341715+=0x1){if(_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x41')]&&_['includes'](_0xf30a64,_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x41')])&&_0x967c55['joins'][_0x341715]['parentKey']&&_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x7b')]&&_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x7c')]){_0x127531[_0x967c55['joins'][_0x341715]['type']](_0x967c55[_0xdb2e('0x79')][_0x341715]['foreignTable'],null,util[_0xdb2e('0x73')](_0xdb2e('0x7d'),_0x967c55[_0xdb2e('0x6e')],_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x7a')],_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x7b')],_0x967c55['joins'][_0x341715][_0xdb2e('0x7c')]));}}}if(_0x967c55[_0xdb2e('0x7e')]){_0x967c55[_0xdb2e('0x7e')]=JSON[_0xdb2e('0x7f')](_0x967c55[_0xdb2e('0x7e')]);_0x127531[_0xdb2e('0x3d')](_0x357939(_0x967c55[_0xdb2e('0x7e')]['group']));}_0x96c187=_0x127531[_0xdb2e('0x80')]();_0x127531[_0xdb2e('0x3b')](_0x5027c4);_0x127531[_0xdb2e('0x1e')](0x0);logger['debug'](_0xdb2e('0xa3'),_0x127531[_0xdb2e('0x82')]());return dbH['sequelize'][_0xdb2e('0x35')](_0x127531[_0xdb2e('0x82')](),{'type':dbH[_0xdb2e('0x83')][_0xdb2e('0x84')]['SELECT']});}})[_0xdb2e('0x25')](function(){return{'sql':_0x96c187['toString']()};})[_0xdb2e('0x25')](respondWithResult(_0x482d19,null))['catch'](handleError(_0x482d19,null));};
\ No newline at end of file
+var _0x5e11=['Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','toString','QueryTypes','SELECT','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','UNIX_TIMESTAMP(%s)','getFields','ValidationErrorItem','DESC','web','fullPath','%s-%s.%s','randomstring','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','sequelize','run','runReport','right_join','alias','Limited\x20Query:','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','error','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','create','body'];(function(_0x409a9e,_0x269849){var _0xffa2e=function(_0xcda550){while(--_0xcda550){_0x409a9e['push'](_0x409a9e['shift']());}};_0xffa2e(++_0x269849);}(_0x5e11,0x1a6));var _0x15e1=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x5e11[_0x20cf8a];return _0x54e165;};'use strict';var emlformat=require(_0x15e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15e1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15e1('0x2'));var moment=require(_0x15e1('0x3'));var BPromise=require(_0x15e1('0x4'));var Mustache=require(_0x15e1('0x5'));var util=require(_0x15e1('0x6'));var path=require(_0x15e1('0x7'));var sox=require(_0x15e1('0x8'));var csv=require('to-csv');var ejs=require(_0x15e1('0x9'));var fs=require('fs');var fs_extra=require(_0x15e1('0xa'));var _=require(_0x15e1('0xb'));var squel=require('squel');var crypto=require(_0x15e1('0xc'));var jsforce=require(_0x15e1('0xd'));var deskjs=require(_0x15e1('0xe'));var toCsv=require(_0x15e1('0xf'));var querystring=require('querystring');var Papa=require(_0x15e1('0x10'));var Redis=require('ioredis');var authService=require(_0x15e1('0x11'));var qs=require(_0x15e1('0x12'));var as=require(_0x15e1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15e1('0x14'))(_0x15e1('0x15'));var utils=require(_0x15e1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x15e1('0x17'));var db=require(_0x15e1('0x18'))['db'];var dbH=require('../../mysqldb')[_0x15e1('0x19')];function respondWithStatusCode(_0x2e6cbc,_0x5746f9){_0x5746f9=_0x5746f9||0xcc;return function(_0x2b180f){if(_0x2b180f){return _0x2e6cbc[_0x15e1('0x1a')](_0x5746f9);}return _0x2e6cbc[_0x15e1('0x1b')](_0x5746f9)[_0x15e1('0x1c')]();};}function respondWithResult(_0xbb69d0,_0x207d1a){_0x207d1a=_0x207d1a||0xc8;return function(_0x344787){if(_0x344787){return _0xbb69d0[_0x15e1('0x1b')](_0x207d1a)['json'](_0x344787);}};}function respondWithFilteredResult(_0x2f35ca,_0x27978b){return function(_0xa7e863){if(_0xa7e863){var _0x4aa16c=typeof _0x27978b[_0x15e1('0x1d')]===_0x15e1('0x1e')&&typeof _0x27978b[_0x15e1('0x1f')]===_0x15e1('0x1e');var _0x5b53d4=_0xa7e863['count'];var _0x4a1fdd=_0x4aa16c?0x0:_0x27978b[_0x15e1('0x1d')];var _0x2555e7=_0x4aa16c?_0xa7e863[_0x15e1('0x20')]:_0x27978b[_0x15e1('0x1d')]+_0x27978b[_0x15e1('0x1f')];var _0x387671;if(_0x2555e7>=_0x5b53d4){_0x2555e7=_0x5b53d4;_0x387671=0xc8;}else{_0x387671=0xce;}_0x2f35ca[_0x15e1('0x1b')](_0x387671);return _0x2f35ca[_0x15e1('0x21')](_0x15e1('0x22'),_0x4a1fdd+'-'+_0x2555e7+'/'+_0x5b53d4)[_0x15e1('0x23')](_0xa7e863);}return null;};}function patchUpdates(_0x4f5e23){return function(_0x1f4487){try{jsonpatch[_0x15e1('0x24')](_0x1f4487,_0x4f5e23,!![]);}catch(_0x5b4718){return BPromise[_0x15e1('0x25')](_0x5b4718);}return _0x1f4487[_0x15e1('0x26')]();};}function saveUpdates(_0x292fae,_0x5d2f57){return function(_0x228a63){if(_0x228a63){return _0x228a63[_0x15e1('0x27')](_0x292fae)[_0x15e1('0x28')](function(_0x297c67){return _0x297c67;});}return null;};}function removeEntity(_0x54b108,_0x4874b4){return function(_0x389ea2){if(_0x389ea2){return _0x389ea2[_0x15e1('0x29')]()[_0x15e1('0x28')](function(){var _0x1271aa=_0x389ea2[_0x15e1('0x2a')]({'plain':!![]});var _0x3b0793='CustomReports';return db['UserProfileResource'][_0x15e1('0x29')]({'where':{'type':_0x3b0793,'resourceId':_0x1271aa['id']}})[_0x15e1('0x28')](function(){return _0x389ea2;});})[_0x15e1('0x28')](function(){_0x54b108[_0x15e1('0x1b')](0xcc)[_0x15e1('0x1c')]();});}};}function handleEntityNotFound(_0x95cf29,_0x52cd79){return function(_0x4b8d7c){if(!_0x4b8d7c){_0x95cf29[_0x15e1('0x1a')](0x194);}return _0x4b8d7c;};}function handleError(_0x3a6757,_0x5196a9){_0x5196a9=_0x5196a9||0x1f4;return function(_0x447828){logger[_0x15e1('0x2b')](_0x447828['stack']);if(_0x447828[_0x15e1('0x2c')]){delete _0x447828['name'];}_0x3a6757[_0x15e1('0x1b')](_0x5196a9)[_0x15e1('0x2d')](_0x447828);};}exports['index']=function(_0x390ffa,_0x10bf08){var _0x583b49={},_0xd8f259={},_0x1a9a1d={'count':0x0,'rows':[]};var _0x129dbb=_['map'](db[_0x15e1('0x2e')][_0x15e1('0x2f')],function(_0xe29a55){return{'name':_0xe29a55[_0x15e1('0x30')],'type':_0xe29a55[_0x15e1('0x31')]['key']};});_0xd8f259[_0x15e1('0x32')]=_[_0x15e1('0x33')](_0x129dbb,'name');_0xd8f259[_0x15e1('0x34')]=_[_0x15e1('0x35')](_0x390ffa['query']);_0xd8f259['filters']=_[_0x15e1('0x36')](_0xd8f259[_0x15e1('0x32')],_0xd8f259['query']);_0x583b49['attributes']=_[_0x15e1('0x36')](_0xd8f259['model'],qs[_0x15e1('0x37')](_0x390ffa[_0x15e1('0x34')]['fields']));_0x583b49[_0x15e1('0x38')]=_0x583b49['attributes'][_0x15e1('0x39')]?_0x583b49['attributes']:_0xd8f259['model'];if(!_0x390ffa['query'][_0x15e1('0x3a')](_0x15e1('0x3b'))){_0x583b49['limit']=qs[_0x15e1('0x1f')](_0x390ffa['query']['limit']);_0x583b49['offset']=qs['offset'](_0x390ffa[_0x15e1('0x34')][_0x15e1('0x1d')]);}_0x583b49[_0x15e1('0x3c')]=qs[_0x15e1('0x3d')](_0x390ffa[_0x15e1('0x34')][_0x15e1('0x3d')]);_0x583b49[_0x15e1('0x3e')]=qs[_0x15e1('0x3f')](_[_0x15e1('0x40')](_0x390ffa[_0x15e1('0x34')],_0xd8f259[_0x15e1('0x3f')]),_0x129dbb);if(_0x390ffa['query']['filter']){_0x583b49[_0x15e1('0x3e')]=_[_0x15e1('0x41')](_0x583b49[_0x15e1('0x3e')],{'$or':_[_0x15e1('0x33')](_0x129dbb,function(_0x5363e7){if(_0x5363e7[_0x15e1('0x31')]!=='VIRTUAL'){var _0x1962f3={};_0x1962f3[_0x5363e7[_0x15e1('0x2c')]]={'$like':'%'+_0x390ffa[_0x15e1('0x34')][_0x15e1('0x42')]+'%'};return _0x1962f3;}})});}_0x583b49=_[_0x15e1('0x41')]({},_0x583b49,_0x390ffa[_0x15e1('0x43')]);var _0x21d5d0={'where':_0x583b49[_0x15e1('0x3e')]};return db[_0x15e1('0x2e')][_0x15e1('0x20')](_0x21d5d0)[_0x15e1('0x28')](function(_0x8e3585){_0x1a9a1d[_0x15e1('0x20')]=_0x8e3585;if(_0x390ffa[_0x15e1('0x34')][_0x15e1('0x44')]){_0x583b49[_0x15e1('0x45')]=[{'all':!![]}];}return db[_0x15e1('0x2e')][_0x15e1('0x46')](_0x583b49);})[_0x15e1('0x28')](function(_0x466edf){_0x1a9a1d[_0x15e1('0x47')]=_0x466edf;return _0x1a9a1d;})[_0x15e1('0x28')](respondWithFilteredResult(_0x10bf08,_0x583b49))[_0x15e1('0x48')](handleError(_0x10bf08,null));};exports['show']=function(_0x2a3a67,_0xaeca2e){var _0x45fdb5={'raw':![],'where':{'id':_0x2a3a67[_0x15e1('0x49')]['id']}},_0x3bfa74={};_0x3bfa74[_0x15e1('0x32')]=_[_0x15e1('0x35')](db[_0x15e1('0x2e')]['rawAttributes']);_0x3bfa74[_0x15e1('0x34')]=_[_0x15e1('0x35')](_0x2a3a67[_0x15e1('0x34')]);_0x3bfa74[_0x15e1('0x3f')]=_['intersection'](_0x3bfa74[_0x15e1('0x32')],_0x3bfa74[_0x15e1('0x34')]);_0x45fdb5[_0x15e1('0x38')]=_['intersection'](_0x3bfa74['model'],qs[_0x15e1('0x37')](_0x2a3a67[_0x15e1('0x34')]['fields']));_0x45fdb5['attributes']=_0x45fdb5['attributes'][_0x15e1('0x39')]?_0x45fdb5[_0x15e1('0x38')]:_0x3bfa74[_0x15e1('0x32')];if(_0x2a3a67[_0x15e1('0x34')][_0x15e1('0x44')]){_0x45fdb5[_0x15e1('0x45')]=[{'all':!![]}];}_0x45fdb5=_[_0x15e1('0x41')]({},_0x45fdb5,_0x2a3a67[_0x15e1('0x43')]);return db[_0x15e1('0x2e')]['find'](_0x45fdb5)[_0x15e1('0x28')](handleEntityNotFound(_0xaeca2e,null))[_0x15e1('0x28')](respondWithResult(_0xaeca2e,null))[_0x15e1('0x48')](handleError(_0xaeca2e,null));};exports[_0x15e1('0x4a')]=function(_0x381e4b,_0x309520){return db[_0x15e1('0x2e')][_0x15e1('0x4a')](_0x381e4b[_0x15e1('0x4b')],{})[_0x15e1('0x28')](function(_0x351582){var _0x3ee90b=_0x381e4b['user'][_0x15e1('0x2a')]({'plain':!![]});if(!_0x3ee90b)throw new Error(_0x15e1('0x4c'));if(_0x3ee90b['role']===_0x15e1('0x4d')){var _0xa4c3ef=_0x351582['get']({'plain':!![]});var _0x1bb451='Reports';return db['UserProfileSection'][_0x15e1('0x4e')]({'where':{'name':_0x1bb451,'userProfileId':_0x3ee90b[_0x15e1('0x4f')]},'raw':!![]})[_0x15e1('0x28')](function(_0x57c9a4){if(_0x57c9a4&&_0x57c9a4[_0x15e1('0x50')]===0x0){return db[_0x15e1('0x51')][_0x15e1('0x4a')]({'name':_0xa4c3ef[_0x15e1('0x2c')],'resourceId':_0xa4c3ef['id'],'type':_0x15e1('0x52'),'sectionId':_0x57c9a4['id']},{})[_0x15e1('0x28')](function(){return _0x351582;});}else{return _0x351582;}})['catch'](function(_0x223e34){logger[_0x15e1('0x2b')](_0x15e1('0x53'),_0x223e34);throw _0x223e34;});}return _0x351582;})[_0x15e1('0x28')](respondWithResult(_0x309520,0xc9))['catch'](handleError(_0x309520,null));};exports['update']=function(_0x581b22,_0x3cd6af){if(_0x581b22['body']['id']){delete _0x581b22[_0x15e1('0x4b')]['id'];}return db[_0x15e1('0x2e')][_0x15e1('0x4e')]({'where':{'id':_0x581b22[_0x15e1('0x49')]['id']}})['then'](handleEntityNotFound(_0x3cd6af,null))[_0x15e1('0x28')](saveUpdates(_0x581b22[_0x15e1('0x4b')],null))[_0x15e1('0x28')](respondWithResult(_0x3cd6af,null))[_0x15e1('0x48')](handleError(_0x3cd6af,null));};exports['destroy']=function(_0x385f4e,_0x3b1980){return db[_0x15e1('0x2e')][_0x15e1('0x4e')]({'where':{'id':_0x385f4e[_0x15e1('0x49')]['id']}})[_0x15e1('0x28')](handleEntityNotFound(_0x3b1980,null))['then'](removeEntity(_0x3b1980,null))[_0x15e1('0x48')](handleError(_0x3b1980,null));};exports['preview']=function(_0x2cc615,_0x2188be){var _0x3b125d=0xa;var _0x594a59=['join',_0x15e1('0x54'),'right_join',_0x15e1('0x55')];var _0xac4b3f={'SUM':_0x15e1('0x56'),'COUNT':_0x15e1('0x57'),'COUNT DISTINCT':_0x15e1('0x58'),'MAX':_0x15e1('0x59'),'MIN':_0x15e1('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x15e1('0x5b'),'GROUP_CONCAT ASC':_0x15e1('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x574fcf={'SEC_TO_TIME':_0x15e1('0x5d'),'DATE':'DATE(%s)','HOUR':_0x15e1('0x5e'),'ROUND':_0x15e1('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x167835=function(_0x1369ff){return!_[_0x15e1('0x60')]([_0x15e1('0x61'),_0x15e1('0x62'),_0x15e1('0x63'),_0x15e1('0x64')],_0x1369ff);};var _0x4762a4=function(_0x3908b2){if(!_0x3908b2||!_0x3908b2[_0x15e1('0x65')][_0x15e1('0x39')]){return'';}for(var _0xd35ed='(',_0x4002c3=0x0;_0x4002c3<_0x3908b2[_0x15e1('0x65')][_0x15e1('0x39')];_0x4002c3+=0x1){_0x4002c3>0x0&&(_0xd35ed+='\x20'+_0x3908b2[_0x15e1('0x66')]+'\x20');_0xd35ed+=_0x3908b2[_0x15e1('0x65')][_0x4002c3]['group']?_0x4762a4(_0x3908b2[_0x15e1('0x65')][_0x4002c3][_0x15e1('0x67')]):_0x3908b2['rules'][_0x4002c3][_0x15e1('0x68')]+'\x20'+_0x3908b2[_0x15e1('0x65')][_0x4002c3][_0x15e1('0x69')]+(_0x167835(_0x3908b2[_0x15e1('0x65')][_0x4002c3]['condition'])?'\x20'+_0x3908b2[_0x15e1('0x65')][_0x4002c3][_0x15e1('0x6a')]:'');}return _0xd35ed+')';};var _0x4aae02={'where':{'id':_0x2cc615['params']['id']}},_0x59c17e,_0x306df3,_0x3dbd01,_0x196234,_0x4db560;_0x4aae02=_['merge']({},_0x4aae02,_0x2cc615[_0x15e1('0x43')]);return db[_0x15e1('0x2e')]['find'](_0x4aae02)[_0x15e1('0x28')](function(_0x22f298){if(_0x22f298){_0x59c17e=_0x22f298;return _0x22f298['getFields']();}return null;})[_0x15e1('0x28')](function(_0x33a0ff){if(_0x33a0ff){if(!_0x33a0ff[_0x15e1('0x39')]){throw new db[(_0x15e1('0x6b'))]['ValidationErrorItem'](_0x15e1('0x6c'),0x193);}_0x306df3=_0x33a0ff;return db[_0x15e1('0x6d')][_0x15e1('0x46')]({'raw':!![]});}return null;})[_0x15e1('0x28')](function(_0x47d028){if(_0x47d028){_0x3dbd01=_[_0x15e1('0x6e')](_0x47d028,'id');var _0x4c094b;var _0x55f426=squel[_0x15e1('0x6f')]();_0x55f426[_0x15e1('0x70')](_0x59c17e[_0x15e1('0x71')]);for(var _0xd1517d=0x0;_0xd1517d<_0x306df3[_0x15e1('0x39')];_0xd1517d+=0x1){_0x4c094b=_0x306df3[_0xd1517d]['MetricId']?_0x3dbd01[_0x306df3[_0xd1517d][_0x15e1('0x72')]][_0x15e1('0x73')]:_0x306df3[_0xd1517d][_0x15e1('0x68')];_0x4c094b=_0x306df3[_0xd1517d][_0x15e1('0x74')]?_[_0x15e1('0x75')](_0xac4b3f[_0x306df3[_0xd1517d][_0x15e1('0x74')]],'%s',_0x4c094b):_0x4c094b;_0x4c094b=_0x306df3[_0xd1517d]['format']?_['replace'](_0x574fcf[_0x306df3[_0xd1517d][_0x15e1('0x76')]],'%s',_0x4c094b):_0x4c094b;if(_0x306df3[_0xd1517d][_0x15e1('0x77')]){_0x55f426[_0x15e1('0x67')](_0x4c094b);}_0x306df3[_0xd1517d]['orderBy']&&_0x55f426[_0x15e1('0x3c')](_0x4c094b,_0x306df3[_0xd1517d][_0x15e1('0x78')]==='DESC'?![]:!![]);_0x55f426['field'](_0x4c094b,_0x306df3[_0xd1517d]['alias']||_0x4c094b);}if(_0x59c17e[_0x15e1('0x79')]){_0x59c17e[_0x15e1('0x79')]=JSON[_0x15e1('0x7a')](_0x59c17e[_0x15e1('0x79')]);for(var _0x318124=0x0;_0x318124<_0x59c17e['joins'][_0x15e1('0x39')];_0x318124+=0x1){if(_0x59c17e[_0x15e1('0x79')][_0x318124][_0x15e1('0x31')]&&_[_0x15e1('0x60')](_0x594a59,_0x59c17e[_0x15e1('0x79')][_0x318124]['type'])&&_0x59c17e[_0x15e1('0x79')][_0x318124][_0x15e1('0x7b')]&&_0x59c17e['joins'][_0x318124][_0x15e1('0x7c')]&&_0x59c17e['joins'][_0x318124][_0x15e1('0x7d')]){_0x55f426[_0x59c17e['joins'][_0x318124][_0x15e1('0x31')]](_0x59c17e[_0x15e1('0x79')][_0x318124][_0x15e1('0x7c')],null,util[_0x15e1('0x76')](_0x15e1('0x7e'),_0x59c17e[_0x15e1('0x71')],_0x59c17e[_0x15e1('0x79')][_0x318124][_0x15e1('0x7b')],_0x59c17e[_0x15e1('0x79')][_0x318124][_0x15e1('0x7c')],_0x59c17e[_0x15e1('0x79')][_0x318124][_0x15e1('0x7d')]));}}}if(_0x59c17e[_0x15e1('0x7f')]){_0x59c17e[_0x15e1('0x7f')]=JSON[_0x15e1('0x7a')](_0x59c17e[_0x15e1('0x7f')]);_0x55f426[_0x15e1('0x3e')](_0x4762a4(_0x59c17e['conditions'][_0x15e1('0x67')]));}_0x4db560=_0x55f426['clone']();_0x55f426[_0x15e1('0x1f')](_0x3b125d);_0x55f426['offset'](0x0);logger[_0x15e1('0x80')]('Limited\x20Query:',_0x55f426[_0x15e1('0x81')]());return dbH['sequelize'][_0x15e1('0x34')](_0x55f426[_0x15e1('0x81')](),{'type':dbH['sequelize'][_0x15e1('0x82')][_0x15e1('0x83')]});}})[_0x15e1('0x28')](respondWithResult(_0x2188be,null))[_0x15e1('0x48')](handleError(_0x2188be,null));};function runReport(_0x4eb287,_0xab0db0,_0x45d9fa){var _0x486848=_0xab0db0[_0x15e1('0x2c')];var _0x11057b=0xa;var _0x4e5eff=['join',_0x15e1('0x54'),'right_join',_0x15e1('0x55')];var _0x2fa990={'SUM':_0x15e1('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x15e1('0x59'),'MIN':'MIN(%s)','AVG':_0x15e1('0x84'),'GROUP_CONCAT':_0x15e1('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x15e1('0x85')};var _0x1bfef0={'SEC_TO_TIME':_0x15e1('0x5d'),'DATE':_0x15e1('0x86'),'HOUR':_0x15e1('0x5e'),'ROUND':_0x15e1('0x5f'),'UNIX_TIMESTAMP':_0x15e1('0x87')};var _0x46b446=function(_0x4ecdf8){return!_[_0x15e1('0x60')]([_0x15e1('0x61'),_0x15e1('0x62'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4ecdf8);};var _0x582dbb=function(_0x3ad29f){if(!_0x3ad29f||!_0x3ad29f['rules']['length']){return'';}for(var _0x26bfbe='(',_0x36c127=0x0;_0x36c127<_0x3ad29f[_0x15e1('0x65')][_0x15e1('0x39')];_0x36c127+=0x1){_0x36c127>0x0&&(_0x26bfbe+='\x20'+_0x3ad29f[_0x15e1('0x66')]+'\x20');_0x26bfbe+=_0x3ad29f[_0x15e1('0x65')][_0x36c127][_0x15e1('0x67')]?_0x582dbb(_0x3ad29f[_0x15e1('0x65')][_0x36c127][_0x15e1('0x67')]):_0x3ad29f['rules'][_0x36c127][_0x15e1('0x68')]+'\x20'+_0x3ad29f[_0x15e1('0x65')][_0x36c127][_0x15e1('0x69')]+(_0x46b446(_0x3ad29f[_0x15e1('0x65')][_0x36c127]['condition'])?'\x20'+_0x3ad29f[_0x15e1('0x65')][_0x36c127]['value']:'');}return _0x26bfbe+')';};var _0x1324d4={'where':{'id':_0x4eb287['id']}},_0x1d21a5,_0x304e7d,_0x294aac,_0x1d644c,_0x2a268a;_0x1324d4=_[_0x15e1('0x41')]({},_0x1324d4,_0x45d9fa);return db[_0x15e1('0x2e')]['find'](_0x1324d4)['then'](function(_0x5f19ac){if(_0x5f19ac){_0x1d21a5=_0x5f19ac;return _0x5f19ac[_0x15e1('0x88')]();}return null;})['then'](function(_0x110fd4){if(_0x110fd4){if(!_0x110fd4['length']){throw new db[(_0x15e1('0x6b'))][(_0x15e1('0x89'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x304e7d=_0x110fd4;return db[_0x15e1('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x15e1('0x28')](function(_0x44af13){if(_0x44af13){_0x294aac=_[_0x15e1('0x6e')](_0x44af13,'id');var _0x58ef97;var _0x20a607=squel[_0x15e1('0x6f')]();_0x20a607['from'](_0x1d21a5[_0x15e1('0x71')]);for(var _0x25acb7=0x0;_0x25acb7<_0x304e7d['length'];_0x25acb7+=0x1){_0x58ef97=_0x304e7d[_0x25acb7][_0x15e1('0x72')]?_0x294aac[_0x304e7d[_0x25acb7][_0x15e1('0x72')]][_0x15e1('0x73')]:_0x304e7d[_0x25acb7][_0x15e1('0x68')];_0x58ef97=_0x304e7d[_0x25acb7][_0x15e1('0x74')]?_[_0x15e1('0x75')](_0x2fa990[_0x304e7d[_0x25acb7][_0x15e1('0x74')]],'%s',_0x58ef97):_0x58ef97;_0x58ef97=_0x304e7d[_0x25acb7][_0x15e1('0x76')]?_[_0x15e1('0x75')](_0x1bfef0[_0x304e7d[_0x25acb7][_0x15e1('0x76')]],'%s',_0x58ef97):_0x58ef97;if(_0x304e7d[_0x25acb7][_0x15e1('0x77')]){_0x20a607[_0x15e1('0x67')](_0x58ef97);}_0x304e7d[_0x25acb7][_0x15e1('0x78')]&&_0x20a607['order'](_0x58ef97,_0x304e7d[_0x25acb7][_0x15e1('0x78')]===_0x15e1('0x8a')?![]:!![]);_0x20a607['field'](_0x58ef97,_0x304e7d[_0x25acb7]['alias']||_0x58ef97);}if(_0x1d21a5[_0x15e1('0x79')]){_0x1d21a5[_0x15e1('0x79')]=JSON[_0x15e1('0x7a')](_0x1d21a5['joins']);for(var _0x33cf94=0x0;_0x33cf94<_0x1d21a5[_0x15e1('0x79')]['length'];_0x33cf94+=0x1){if(_0x1d21a5[_0x15e1('0x79')][_0x33cf94]['type']&&_[_0x15e1('0x60')](_0x4e5eff,_0x1d21a5['joins'][_0x33cf94][_0x15e1('0x31')])&&_0x1d21a5[_0x15e1('0x79')][_0x33cf94][_0x15e1('0x7b')]&&_0x1d21a5[_0x15e1('0x79')][_0x33cf94][_0x15e1('0x7c')]&&_0x1d21a5['joins'][_0x33cf94][_0x15e1('0x7d')]){_0x20a607[_0x1d21a5[_0x15e1('0x79')][_0x33cf94][_0x15e1('0x31')]](_0x1d21a5[_0x15e1('0x79')][_0x33cf94]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1d21a5[_0x15e1('0x71')],_0x1d21a5['joins'][_0x33cf94][_0x15e1('0x7b')],_0x1d21a5[_0x15e1('0x79')][_0x33cf94][_0x15e1('0x7c')],_0x1d21a5[_0x15e1('0x79')][_0x33cf94][_0x15e1('0x7d')]));}}}if(_0x1d21a5[_0x15e1('0x7f')]){_0x1d21a5[_0x15e1('0x7f')]=JSON['parse'](_0x1d21a5[_0x15e1('0x7f')]);_0x20a607['where'](_0x582dbb(_0x1d21a5[_0x15e1('0x7f')][_0x15e1('0x67')]));}_0x2a268a=_0x20a607['clone']();_0x20a607[_0x15e1('0x1f')](_0x11057b);_0x20a607['offset'](0x0);return;}})[_0x15e1('0x28')](function(){if(_0xab0db0['output']===_0x15e1('0x8b')){return null;}var _0x417fa6=_[_0x15e1('0x41')](_0xab0db0,{'name':_0xab0db0[_0x15e1('0x8c')]||_0xab0db0[_0x15e1('0x2c')]||_0x1d21a5[_0x15e1('0x2c')],'basename':_0x486848,'savename':util[_0x15e1('0x76')](_0x15e1('0x8d'),_0xab0db0['name']||_0x1d21a5[_0x15e1('0x2c')],require(_0x15e1('0x8e'))['generate'](0x4),_0xab0db0[_0x15e1('0x8f')]||_0x15e1('0x90')),'reportId':_0x1d21a5['id'],'reportType':_0x15e1('0x91')});return db[_0x15e1('0x92')][_0x15e1('0x4a')](_0x417fa6,{'raw':!![]});})[_0x15e1('0x28')](function(_0x282d48){if(_0x1d21a5[_0x15e1('0x71')]===_0x15e1('0x93')){_0x2a268a[_0x15e1('0x3e')](_0x1d21a5[_0x15e1('0x71')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xab0db0[_0x15e1('0x94')],_0xab0db0[_0x15e1('0x95')]);}else{_0x2a268a[_0x15e1('0x3e')](_0x1d21a5[_0x15e1('0x71')]+_0x15e1('0x96'),_0xab0db0[_0x15e1('0x94')],_0xab0db0['endDate']);}if(_0x282d48){logger[_0x15e1('0x97')](_0x15e1('0x98'),_0x2a268a[_0x15e1('0x81')]());require(_0x15e1('0x99'))[_0x15e1('0x9a')](path[_0x15e1('0x9b')](__dirname,'../../components/export/',_0x282d48['output']),[_0x282d48['id'],_0x2a268a['toString'](),path[_0x15e1('0x9b')](__dirname,_0x15e1('0x9c'),_0x282d48[_0x15e1('0x9d')]),_0x486848]);return _0x282d48;}else{var _0x3f14c7=squel[_0x15e1('0x6f')]();_0x3f14c7[_0x15e1('0x70')]('('+_0x2a268a[_0x15e1('0x81')]()+')',_0x15e1('0x9e'));_0x3f14c7[_0x15e1('0x68')](_0x15e1('0x9f'),'count');_0x2a268a[_0x15e1('0x1f')](_0xab0db0['limit']||_0x11057b);_0x2a268a[_0x15e1('0x1d')](_0xab0db0[_0x15e1('0x1d')]||0x0);return dbH[_0x15e1('0xa0')]['query'](_0x3f14c7[_0x15e1('0x81')](),{'type':dbH[_0x15e1('0xa0')]['QueryTypes'][_0x15e1('0x83')]})[_0x15e1('0x28')](function(_0x19b76f){if(!_0x19b76f[_0x15e1('0x39')]){_0x1d644c=0x0;}else{_0x1d644c=_0x19b76f[0x0][_0x15e1('0x20')]||0x0;}return dbH['sequelize'][_0x15e1('0x34')](_0x2a268a[_0x15e1('0x81')](),{'type':dbH['sequelize']['QueryTypes'][_0x15e1('0x83')]});})['then'](function(_0x353694){return{'rows':_0x353694||[],'count':_0x1d644c};});}});}exports[_0x15e1('0xa1')]=function(_0x3e19fb,_0x11fcf9){return runReport(_0x3e19fb[_0x15e1('0x49')],_0x3e19fb[_0x15e1('0x34')],_0x3e19fb[_0x15e1('0x43')])[_0x15e1('0x28')](respondWithResult(_0x11fcf9,null))[_0x15e1('0x48')](handleError(_0x11fcf9,null));};exports[_0x15e1('0xa2')]=runReport;exports[_0x15e1('0x34')]=function(_0x5e314c,_0x94c33){var _0x2b0d63=0xa;var _0x463fc3=[_0x15e1('0x9b'),'left_join',_0x15e1('0xa3'),_0x15e1('0x55')];var _0x2fa4ac={'SUM':_0x15e1('0x56'),'COUNT':_0x15e1('0x57'),'COUNT DISTINCT':_0x15e1('0x58'),'MAX':_0x15e1('0x59'),'MIN':_0x15e1('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x15e1('0x5c'),'GROUP_CONCAT DESC':_0x15e1('0x85')};var _0x9fa5f0={'SEC_TO_TIME':_0x15e1('0x5d'),'DATE':_0x15e1('0x86'),'HOUR':_0x15e1('0x5e'),'ROUND':_0x15e1('0x5f'),'UNIX_TIMESTAMP':_0x15e1('0x87')};var _0x378229=function(_0x56e2ed){return!_[_0x15e1('0x60')](['IS\x20NULL',_0x15e1('0x62'),_0x15e1('0x63'),_0x15e1('0x64')],_0x56e2ed);};var _0x274a2a=function(_0x5d580e){if(!_0x5d580e||!_0x5d580e[_0x15e1('0x65')][_0x15e1('0x39')]){return'';}for(var _0x3d5c51='(',_0x16fb87=0x0;_0x16fb87<_0x5d580e[_0x15e1('0x65')][_0x15e1('0x39')];_0x16fb87+=0x1){_0x16fb87>0x0&&(_0x3d5c51+='\x20'+_0x5d580e['operator']+'\x20');_0x3d5c51+=_0x5d580e[_0x15e1('0x65')][_0x16fb87]['group']?_0x274a2a(_0x5d580e[_0x15e1('0x65')][_0x16fb87][_0x15e1('0x67')]):_0x5d580e[_0x15e1('0x65')][_0x16fb87]['field']+'\x20'+_0x5d580e['rules'][_0x16fb87][_0x15e1('0x69')]+(_0x378229(_0x5d580e[_0x15e1('0x65')][_0x16fb87][_0x15e1('0x69')])?'\x20'+_0x5d580e[_0x15e1('0x65')][_0x16fb87][_0x15e1('0x6a')]:'');}return _0x3d5c51+')';};var _0x19d4f4={'where':{'id':_0x5e314c[_0x15e1('0x49')]['id']}},_0x238c92,_0x34f79e,_0x9e7769,_0x1d9698,_0x3e402a;_0x19d4f4=_[_0x15e1('0x41')]({},_0x19d4f4,_0x5e314c[_0x15e1('0x43')]);return db['AnalyticCustomReport'][_0x15e1('0x4e')](_0x19d4f4)[_0x15e1('0x28')](function(_0x34370e){if(_0x34370e){_0x238c92=_0x34370e;return _0x34370e[_0x15e1('0x88')]();}return null;})[_0x15e1('0x28')](function(_0x3f15fa){if(_0x3f15fa){if(!_0x3f15fa['length']){throw new db['Sequelize'][(_0x15e1('0x89'))](_0x15e1('0x6c'),0x193);}_0x34f79e=_0x3f15fa;return db[_0x15e1('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x15e1('0x28')](function(_0x2eb0b5){if(_0x2eb0b5){_0x9e7769=_[_0x15e1('0x6e')](_0x2eb0b5,'id');var _0x8117cb;var _0x4a0b84=squel[_0x15e1('0x6f')]();_0x4a0b84[_0x15e1('0x70')](_0x238c92['table']);for(var _0x4fb91e=0x0;_0x4fb91e<_0x34f79e[_0x15e1('0x39')];_0x4fb91e+=0x1){_0x8117cb=_0x34f79e[_0x4fb91e]['MetricId']?_0x9e7769[_0x34f79e[_0x4fb91e][_0x15e1('0x72')]]['metric']:_0x34f79e[_0x4fb91e][_0x15e1('0x68')];_0x8117cb=_0x34f79e[_0x4fb91e]['function']?_[_0x15e1('0x75')](_0x2fa4ac[_0x34f79e[_0x4fb91e][_0x15e1('0x74')]],'%s',_0x8117cb):_0x8117cb;_0x8117cb=_0x34f79e[_0x4fb91e][_0x15e1('0x76')]?_[_0x15e1('0x75')](_0x9fa5f0[_0x34f79e[_0x4fb91e][_0x15e1('0x76')]],'%s',_0x8117cb):_0x8117cb;if(_0x34f79e[_0x4fb91e]['groupBy']){_0x4a0b84[_0x15e1('0x67')](_0x8117cb);}_0x34f79e[_0x4fb91e][_0x15e1('0x78')]&&_0x4a0b84[_0x15e1('0x3c')](_0x8117cb,_0x34f79e[_0x4fb91e][_0x15e1('0x78')]===_0x15e1('0x8a')?![]:!![]);_0x4a0b84[_0x15e1('0x68')](_0x8117cb,_0x34f79e[_0x4fb91e][_0x15e1('0xa4')]||_0x8117cb);}if(_0x238c92['joins']){_0x238c92[_0x15e1('0x79')]=JSON[_0x15e1('0x7a')](_0x238c92[_0x15e1('0x79')]);for(var _0x27afbf=0x0;_0x27afbf<_0x238c92[_0x15e1('0x79')][_0x15e1('0x39')];_0x27afbf+=0x1){if(_0x238c92[_0x15e1('0x79')][_0x27afbf][_0x15e1('0x31')]&&_['includes'](_0x463fc3,_0x238c92[_0x15e1('0x79')][_0x27afbf]['type'])&&_0x238c92['joins'][_0x27afbf][_0x15e1('0x7b')]&&_0x238c92[_0x15e1('0x79')][_0x27afbf]['foreignTable']&&_0x238c92[_0x15e1('0x79')][_0x27afbf][_0x15e1('0x7d')]){_0x4a0b84[_0x238c92['joins'][_0x27afbf]['type']](_0x238c92[_0x15e1('0x79')][_0x27afbf][_0x15e1('0x7c')],null,util[_0x15e1('0x76')](_0x15e1('0x7e'),_0x238c92['table'],_0x238c92[_0x15e1('0x79')][_0x27afbf][_0x15e1('0x7b')],_0x238c92[_0x15e1('0x79')][_0x27afbf][_0x15e1('0x7c')],_0x238c92['joins'][_0x27afbf][_0x15e1('0x7d')]));}}}if(_0x238c92['conditions']){_0x238c92['conditions']=JSON['parse'](_0x238c92['conditions']);_0x4a0b84['where'](_0x274a2a(_0x238c92[_0x15e1('0x7f')][_0x15e1('0x67')]));}_0x3e402a=_0x4a0b84['clone']();_0x4a0b84[_0x15e1('0x1f')](_0x2b0d63);_0x4a0b84[_0x15e1('0x1d')](0x0);logger[_0x15e1('0x80')](_0x15e1('0xa5'),_0x4a0b84[_0x15e1('0x81')]());return dbH['sequelize'][_0x15e1('0x34')](_0x4a0b84[_0x15e1('0x81')](),{'type':dbH[_0x15e1('0xa0')][_0x15e1('0x82')][_0x15e1('0x83')]});}})[_0x15e1('0x28')](function(){return{'sql':_0x3e402a[_0x15e1('0x81')]()};})['then'](respondWithResult(_0x94c33,null))['catch'](handleError(_0x94c33,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 2b0b420..86a4ede 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 _0x9e06=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util'];(function(_0x473155,_0x2f4730){var _0x57525a=function(_0x14a8f2){while(--_0x14a8f2){_0x473155['push'](_0x473155['shift']());}};_0x57525a(++_0x2f4730);}(_0x9e06,0x106));var _0x69e0=function(_0x422d30,_0x5ec4b1){_0x422d30=_0x422d30-0x0;var _0x236072=_0x9e06[_0x422d30];return _0x236072;};'use strict';var _=require(_0x69e0('0x0'));var util=require(_0x69e0('0x1'));var logger=require(_0x69e0('0x2'))(_0x69e0('0x3'));var moment=require(_0x69e0('0x4'));var BPromise=require('bluebird');var rp=require(_0x69e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x69e0('0x6'));var config=require(_0x69e0('0x7'));var attributes=require(_0x69e0('0x8'));module[_0x69e0('0x9')]=function(_0x47d2aa,_0x308873){return _0x47d2aa[_0x69e0('0xa')](_0x69e0('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x784f=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','api','moment','bluebird','path','rimraf'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0x784f,0xb5));var _0xf784=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x784f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf784('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf784('0x1'));var moment=require(_0xf784('0x2'));var BPromise=require(_0xf784('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf784('0x4'));var rimraf=require(_0xf784('0x5'));var config=require(_0xf784('0x6'));var attributes=require(_0xf784('0x7'));module[_0xf784('0x8')]=function(_0x1a5ca1,_0x2bf767){return _0x1a5ca1[_0xf784('0x9')](_0xf784('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index edafa04..a0c8200 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 _0xefe6=['rpc','../../config/environment','jayson/promise','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefe6,0x8c));var _0x6efe=function(_0x58e09b,_0x6ef44c){_0x58e09b=_0x58e09b-0x0;var _0x243038=_0xefe6[_0x58e09b];return _0x243038;};'use strict';var _=require('lodash');var util=require(_0x6efe('0x0'));var moment=require(_0x6efe('0x1'));var BPromise=require(_0x6efe('0x2'));var rs=require(_0x6efe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6efe('0x4'))['db'];var utils=require(_0x6efe('0x5'));var logger=require(_0x6efe('0x6'))(_0x6efe('0x7'));var config=require(_0x6efe('0x8'));var jayson=require(_0x6efe('0x9'));var client=jayson['client'][_0x6efe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28e0ae,_0xc70024,_0x4f71ee){return new BPromise(function(_0x2cc472,_0x102471){return client['request'](_0x28e0ae,_0x4f71ee)['then'](function(_0x1c383f){logger[_0x6efe('0xb')](_0x6efe('0xc'),_0xc70024,_0x6efe('0xd'));logger[_0x6efe('0xe')](_0x6efe('0xf'),_0xc70024,_0x6efe('0xd'),JSON[_0x6efe('0x10')](_0x1c383f));if(_0x1c383f[_0x6efe('0x11')]){if(_0x1c383f[_0x6efe('0x11')]['code']===0x1f4){logger[_0x6efe('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc70024,_0x1c383f['error'][_0x6efe('0x12')]);return _0x102471(_0x1c383f['error'][_0x6efe('0x12')]);}logger[_0x6efe('0x11')](_0x6efe('0xc'),_0xc70024,_0x1c383f[_0x6efe('0x11')][_0x6efe('0x12')]);return _0x2cc472(_0x1c383f[_0x6efe('0x11')][_0x6efe('0x12')]);}else{logger[_0x6efe('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc70024,_0x6efe('0xd'));_0x2cc472(_0x1c383f[_0x6efe('0x13')][_0x6efe('0x12')]);}})[_0x6efe('0x14')](function(_0x2f9c19){logger[_0x6efe('0x11')](_0x6efe('0xc'),_0xc70024,_0x2f9c19);_0x102471(_0x2f9c19);});});}
\ No newline at end of file
+var _0xd84e=['message','info','request\x20sent','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','stringify','error'];(function(_0x2b1fdc,_0x3bb6da){var _0x41a285=function(_0x210fd0){while(--_0x210fd0){_0x2b1fdc['push'](_0x2b1fdc['shift']());}};_0x41a285(++_0x3bb6da);}(_0xd84e,0x83));var _0xed84=function(_0x3e7d44,_0x5685fd){_0x3e7d44=_0x3e7d44-0x0;var _0x43ab1f=_0xd84e[_0x3e7d44];return _0x43ab1f;};'use strict';var _=require('lodash');var util=require(_0xed84('0x0'));var moment=require('moment');var BPromise=require(_0xed84('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed84('0x2'));var db=require(_0xed84('0x3'))['db'];var utils=require(_0xed84('0x4'));var logger=require(_0xed84('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xed84('0x6'));var client=jayson[_0xed84('0x7')][_0xed84('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ff88a,_0x245d05,_0x5f456d){return new BPromise(function(_0x3d6e78,_0x329282){return client[_0xed84('0x9')](_0x1ff88a,_0x5f456d)['then'](function(_0x54a67d){logger['info'](_0xed84('0xa'),_0x245d05,'request\x20sent');logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x245d05,'request\x20sent',JSON[_0xed84('0xb')](_0x54a67d));if(_0x54a67d[_0xed84('0xc')]){if(_0x54a67d['error']['code']===0x1f4){logger['error'](_0xed84('0xa'),_0x245d05,_0x54a67d[_0xed84('0xc')][_0xed84('0xd')]);return _0x329282(_0x54a67d[_0xed84('0xc')][_0xed84('0xd')]);}logger[_0xed84('0xc')](_0xed84('0xa'),_0x245d05,_0x54a67d['error'][_0xed84('0xd')]);return _0x3d6e78(_0x54a67d['error']['message']);}else{logger[_0xed84('0xe')](_0xed84('0xa'),_0x245d05,_0xed84('0xf'));_0x3d6e78(_0x54a67d[_0xed84('0x10')][_0xed84('0xd')]);}})[_0xed84('0x11')](function(_0x34155e){logger[_0xed84('0xc')](_0xed84('0xa'),_0x245d05,_0x34155e);_0x329282(_0x34155e);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a49aa23..f6226bc 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 _0x0211=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','preview','/:id/run','/:id/query','isAuthenticated','query','post','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x23a6c3,_0xcbb1d3){var _0x30c897=function(_0x19168b){while(--_0x19168b){_0x23a6c3['push'](_0x23a6c3['shift']());}};_0x30c897(++_0xcbb1d3);}(_0x0211,0x1b6));var _0x1021=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0211[_0x31e29a];return _0x32d892;};'use strict';var multer=require('multer');var util=require(_0x1021('0x0'));var path=require(_0x1021('0x1'));var timeout=require(_0x1021('0x2'));var express=require(_0x1021('0x3'));var router=express[_0x1021('0x4')]();var fs_extra=require(_0x1021('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1021('0x6'));var config=require(_0x1021('0x7'));var controller=require(_0x1021('0x8'));router[_0x1021('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1021('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1021('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0x1021('0xa')]);router[_0x1021('0x9')](_0x1021('0xb'),auth['isAuthenticated'](),controller['run']);router[_0x1021('0x9')](_0x1021('0xc'),auth[_0x1021('0xd')](),controller[_0x1021('0xe')]);router[_0x1021('0xf')]('/',auth[_0x1021('0xd')](),controller['create']);router['put'](_0x1021('0x10'),auth[_0x1021('0xd')](),controller[_0x1021('0x11')]);router[_0x1021('0x12')](_0x1021('0x10'),auth[_0x1021('0xd')](),controller[_0x1021('0x13')]);module[_0x1021('0x14')]=router;
\ No newline at end of file
+var _0xad18=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','query','post','create','update','delete','destroy'];(function(_0x4502fb,_0x23865f){var _0x1b4664=function(_0x58f705){while(--_0x58f705){_0x4502fb['push'](_0x4502fb['shift']());}};_0x1b4664(++_0x23865f);}(_0xad18,0xfb));var _0x8ad1=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0xad18[_0x367a3d];return _0x460539;};'use strict';var multer=require(_0x8ad1('0x0'));var util=require(_0x8ad1('0x1'));var path=require(_0x8ad1('0x2'));var timeout=require(_0x8ad1('0x3'));var express=require('express');var router=express[_0x8ad1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8ad1('0x5'));var interaction=require(_0x8ad1('0x6'));var config=require(_0x8ad1('0x7'));var controller=require(_0x8ad1('0x8'));router[_0x8ad1('0x9')]('/',auth['isAuthenticated'](),controller[_0x8ad1('0xa')]);router[_0x8ad1('0x9')](_0x8ad1('0xb'),auth[_0x8ad1('0xc')](),controller[_0x8ad1('0xd')]);router[_0x8ad1('0x9')](_0x8ad1('0xe'),auth['isAuthenticated'](),controller[_0x8ad1('0xf')]);router[_0x8ad1('0x9')](_0x8ad1('0x10'),auth[_0x8ad1('0xc')](),controller[_0x8ad1('0x11')]);router[_0x8ad1('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0x8ad1('0x12')]);router[_0x8ad1('0x13')]('/',auth[_0x8ad1('0xc')](),controller[_0x8ad1('0x14')]);router['put'](_0x8ad1('0xb'),auth[_0x8ad1('0xc')](),controller[_0x8ad1('0x15')]);router[_0x8ad1('0x16')](_0x8ad1('0xb'),auth[_0x8ad1('0xc')](),controller[_0x8ad1('0x17')]);module[_0x8ad1('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 8b58f09..0931d7c 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 _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x339301,_0x4d9089){_0x339301=_0x339301-0x0;var _0x25a96f=_0xb4c7[_0x339301];return _0x25a96f;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
+var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x36888f,_0x3b541e){var _0x1f79ea=function(_0x460d8d){while(--_0x460d8d){_0x36888f['push'](_0x36888f['shift']());}};_0x1f79ea(++_0x3b541e);}(_0xabce,0x103));var _0xeabc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xabce[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index e841ae7..ed11253 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 _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0x14a));var _0xb687=function(_0x2efe4f,_0x35b3d9){_0x2efe4f=_0x2efe4f-0x0;var _0x251e7e=_0x687b[_0x2efe4f];return _0x251e7e;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));};
\ No newline at end of file
+var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x4ff681,_0x30ba0f){var _0x2465d0=function(_0x19e7a5){while(--_0x19e7a5){_0x4ff681['push'](_0x4ff681['shift']());}};_0x2465d0(++_0x30ba0f);}(_0x46ed,0x168));var _0xd46e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x46ed[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a7d7566..57173e1 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 _0xc6f5=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xc6f5,0x197));var _0x5c6f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc6f5[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x5c6f('0x0'));var util=require(_0x5c6f('0x1'));var logger=require(_0x5c6f('0x2'))('api');var moment=require(_0x5c6f('0x3'));var BPromise=require(_0x5c6f('0x4'));var rp=require(_0x5c6f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5c6f('0x6'));var config=require(_0x5c6f('0x7'));var attributes=require(_0x5c6f('0x8'));module[_0x5c6f('0x9')]=function(_0xb1212c,_0x20564b){return _0xb1212c[_0x5c6f('0xa')](_0x5c6f('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc87=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x203c0c,_0x12e4fb){var _0x1a6c4b=function(_0x19b7e8){while(--_0x19b7e8){_0x203c0c['push'](_0x203c0c['shift']());}};_0x1a6c4b(++_0x12e4fb);}(_0xfc87,0x68));var _0x7fc8=function(_0x5d94e7,_0x57a0cc){_0x5d94e7=_0x5d94e7-0x0;var _0x47d432=_0xfc87[_0x5d94e7];return _0x47d432;};'use strict';var _=require(_0x7fc8('0x0'));var util=require(_0x7fc8('0x1'));var logger=require(_0x7fc8('0x2'))(_0x7fc8('0x3'));var moment=require(_0x7fc8('0x4'));var BPromise=require(_0x7fc8('0x5'));var rp=require(_0x7fc8('0x6'));var fs=require('fs');var path=require(_0x7fc8('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7fc8('0x8'));module[_0x7fc8('0x9')]=function(_0x561956,_0x595f6f){return _0x561956[_0x7fc8('0xa')](_0x7fc8('0xb'),attributes,{'tableName':_0x7fc8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 2183b2c..b288252 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 _0x942a=['debug','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x445a84,_0x311a44){var _0x5e3a6e=function(_0x326ca3){while(--_0x326ca3){_0x445a84['push'](_0x445a84['shift']());}};_0x5e3a6e(++_0x311a44);}(_0x942a,0x171));var _0xa942=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x942a[_0x151381];return _0x2afab6;};'use strict';var _=require('lodash');var util=require(_0xa942('0x0'));var moment=require('moment');var BPromise=require(_0xa942('0x1'));var rs=require(_0xa942('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa942('0x3'));var logger=require(_0xa942('0x4'))('rpc');var config=require(_0xa942('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa942('0x6')][_0xa942('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4dd053,_0x3af71a,_0x99a6df){return new BPromise(function(_0x490d8d,_0x2a367a){return client[_0xa942('0x8')](_0x4dd053,_0x99a6df)[_0xa942('0x9')](function(_0x435806){logger[_0xa942('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3af71a,'request\x20sent');logger[_0xa942('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3af71a,_0xa942('0xc'),JSON[_0xa942('0xd')](_0x435806));if(_0x435806[_0xa942('0xe')]){if(_0x435806[_0xa942('0xe')][_0xa942('0xf')]===0x1f4){logger[_0xa942('0xe')](_0xa942('0x10'),_0x3af71a,_0x435806[_0xa942('0xe')][_0xa942('0x11')]);return _0x2a367a(_0x435806[_0xa942('0xe')][_0xa942('0x11')]);}logger[_0xa942('0xe')](_0xa942('0x10'),_0x3af71a,_0x435806[_0xa942('0xe')][_0xa942('0x11')]);return _0x490d8d(_0x435806['error'][_0xa942('0x11')]);}else{logger[_0xa942('0xa')](_0xa942('0x10'),_0x3af71a,_0xa942('0xc'));_0x490d8d(_0x435806[_0xa942('0x12')][_0xa942('0x11')]);}})[_0xa942('0x13')](function(_0x30771a){logger['error'](_0xa942('0x10'),_0x3af71a,_0x30771a);_0x2a367a(_0x30771a);});});}
\ No newline at end of file
+var _0x31ce=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x31ce,0x117));var _0xe31c=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0x31ce[_0x33fcbb];return _0x2efe40;};'use strict';var _=require(_0xe31c('0x0'));var util=require('util');var moment=require(_0xe31c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe31c('0x2'));var db=require(_0xe31c('0x3'))['db'];var utils=require(_0xe31c('0x4'));var logger=require(_0xe31c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe31c('0x6')][_0xe31c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22c081,_0x3c8126,_0x4cf64c){return new BPromise(function(_0x9a93b,_0x4aa9f9){return client[_0xe31c('0x8')](_0x22c081,_0x4cf64c)[_0xe31c('0x9')](function(_0x4f0895){logger[_0xe31c('0xa')](_0xe31c('0xb'),_0x3c8126,'request\x20sent');logger[_0xe31c('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3c8126,_0xe31c('0xd'),JSON[_0xe31c('0xe')](_0x4f0895));if(_0x4f0895[_0xe31c('0xf')]){if(_0x4f0895[_0xe31c('0xf')]['code']===0x1f4){logger[_0xe31c('0xf')](_0xe31c('0xb'),_0x3c8126,_0x4f0895['error'][_0xe31c('0x10')]);return _0x4aa9f9(_0x4f0895['error'][_0xe31c('0x10')]);}logger['error'](_0xe31c('0xb'),_0x3c8126,_0x4f0895[_0xe31c('0xf')]['message']);return _0x9a93b(_0x4f0895['error']['message']);}else{logger[_0xe31c('0xa')](_0xe31c('0xb'),_0x3c8126,_0xe31c('0xd'));_0x9a93b(_0x4f0895[_0xe31c('0x11')][_0xe31c('0x10')]);}})['catch'](function(_0x2e660a){logger[_0xe31c('0xf')](_0xe31c('0xb'),_0x3c8126,_0x2e660a);_0x4aa9f9(_0x2e660a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 2eb3f04..e42c433 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 _0x8ffd=['multer','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x6d205c,_0x305498){var _0x3b5e06=function(_0x112835){while(--_0x112835){_0x6d205c['push'](_0x6d205c['shift']());}};_0x3b5e06(++_0x305498);}(_0x8ffd,0x18c));var _0xd8ff=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x8ffd[_0x34d275];return _0x1379cc;};'use strict';var multer=require(_0xd8ff('0x0'));var util=require('util');var path=require(_0xd8ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8ff('0x2'));var router=express[_0xd8ff('0x3')]();var fs_extra=require(_0xd8ff('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8ff('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0xd8ff('0x6')]('/',auth[_0xd8ff('0x7')](),controller['index']);router[_0xd8ff('0x6')](_0xd8ff('0x8'),auth[_0xd8ff('0x7')](),controller[_0xd8ff('0x9')]);router[_0xd8ff('0x6')](_0xd8ff('0xa'),auth[_0xd8ff('0x7')](),controller['preview']);router[_0xd8ff('0x6')](_0xd8ff('0xb'),auth[_0xd8ff('0x7')](),controller[_0xd8ff('0xc')]);router[_0xd8ff('0x6')](_0xd8ff('0xd'),auth['isAuthenticated'](),controller[_0xd8ff('0xe')]);router[_0xd8ff('0xf')]('/',auth[_0xd8ff('0x7')](),controller[_0xd8ff('0x10')]);router[_0xd8ff('0x11')](_0xd8ff('0x8'),auth[_0xd8ff('0x7')](),controller[_0xd8ff('0x12')]);router[_0xd8ff('0x13')](_0xd8ff('0x8'),auth['isAuthenticated'](),controller[_0xd8ff('0x14')]);module[_0xd8ff('0x15')]=router;
\ No newline at end of file
+var _0x26e9=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','post','create','put','update','delete'];(function(_0x11831c,_0x226c32){var _0x317d0e=function(_0x16ef92){while(--_0x16ef92){_0x11831c['push'](_0x11831c['shift']());}};_0x317d0e(++_0x226c32);}(_0x26e9,0x1a2));var _0x926e=function(_0xfc5a04,_0xb77332){_0xfc5a04=_0xfc5a04-0x0;var _0x24b690=_0x26e9[_0xfc5a04];return _0x24b690;};'use strict';var multer=require('multer');var util=require(_0x926e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x926e('0x1'));var router=express[_0x926e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x926e('0x3'));var interaction=require(_0x926e('0x4'));var config=require(_0x926e('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0x926e('0x6')]('/',auth[_0x926e('0x7')](),controller[_0x926e('0x8')]);router[_0x926e('0x6')](_0x926e('0x9'),auth[_0x926e('0x7')](),controller[_0x926e('0xa')]);router[_0x926e('0x6')]('/:id/preview',auth['isAuthenticated'](),controller[_0x926e('0xb')]);router['get']('/:id/run',auth[_0x926e('0x7')](),controller[_0x926e('0xc')]);router['get'](_0x926e('0xd'),auth['isAuthenticated'](),controller['query']);router[_0x926e('0xe')]('/',auth[_0x926e('0x7')](),controller[_0x926e('0xf')]);router[_0x926e('0x10')](_0x926e('0x9'),auth[_0x926e('0x7')](),controller[_0x926e('0x11')]);router[_0x926e('0x12')](_0x926e('0x9'),auth[_0x926e('0x7')](),controller['destroy']);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 c6e3b42..fa4f1eb 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 _0xecd9=['csv','pdf','DATE','Loading','scheduled','manual','UNSIGNED','sequelize','moment','STRING','ENUM'];(function(_0x2d4c1b,_0x1e282c){var _0x2039c5=function(_0x3c40db){while(--_0x3c40db){_0x2d4c1b['push'](_0x2d4c1b['shift']());}};_0x2039c5(++_0x1e282c);}(_0xecd9,0x19e));var _0x9ecd=function(_0x42d560,_0x195f36){_0x42d560=_0x42d560-0x0;var _0x3d236e=_0xecd9[_0x42d560];return _0x3d236e;};'use strict';var Sequelize=require(_0x9ecd('0x0'));var moment=require(_0x9ecd('0x1'));module['exports']={'name':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x9ecd('0x3')](_0x9ecd('0x4'),_0x9ecd('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x9ecd('0x4')},'savename':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9ecd('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':_0x9ecd('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0x9ecd('0x8')),'allowNull':![],'defaultValue':_0x9ecd('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x9ecd('0xa')]},'reportType':{'type':Sequelize[_0x9ecd('0x2')]}};
\ No newline at end of file
+var _0x04d5=['STRING','ENUM','csv','pdf','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports'];(function(_0x5abb0d,_0xb39231){var _0x30db9d=function(_0x40bf01){while(--_0x40bf01){_0x5abb0d['push'](_0x5abb0d['shift']());}};_0x30db9d(++_0xb39231);}(_0x04d5,0x1dd));var _0x504d=function(_0x41d419,_0x30fe84){_0x41d419=_0x41d419-0x0;var _0x233a5e=_0x04d5[_0x41d419];return _0x233a5e;};'use strict';var Sequelize=require(_0x504d('0x0'));var moment=require(_0x504d('0x1'));module[_0x504d('0x2')]={'name':{'type':Sequelize[_0x504d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x504d('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x504d('0x4')](_0x504d('0x5'),_0x504d('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x504d('0x7')]},'endDate':{'type':Sequelize[_0x504d('0x7')]},'status':{'type':Sequelize[_0x504d('0x3')],'defaultValue':_0x504d('0x8')},'type':{'type':Sequelize[_0x504d('0x4')](_0x504d('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x504d('0xa')](0xb)[_0x504d('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 58c800b..d92362a 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 _0x84a4=['request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','send','map','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','VIRTUAL','filter','merge','AnalyticExtractedReport','rows','catch','show','rawAttributes','includeAll','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','body','params','basename','savename','output','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','server/files/reports','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch'];(function(_0x43a954,_0x1d73d7){var _0x1973f6=function(_0x3de96c){while(--_0x3de96c){_0x43a954['push'](_0x43a954['shift']());}};_0x1973f6(++_0x1d73d7);}(_0x84a4,0xab));var _0x484a=function(_0x3411a4,_0x60d585){_0x3411a4=_0x3411a4-0x0;var _0x4eb325=_0x84a4[_0x3411a4];return _0x4eb325;};'use strict';var emlformat=require(_0x484a('0x0'));var rimraf=require(_0x484a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x484a('0x2'));var rp=require(_0x484a('0x3'));var moment=require(_0x484a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x484a('0x5'));var util=require(_0x484a('0x6'));var path=require(_0x484a('0x7'));var sox=require('sox');var csv=require(_0x484a('0x8'));var ejs=require(_0x484a('0x9'));var fs=require('fs');var fs_extra=require(_0x484a('0xa'));var _=require(_0x484a('0xb'));var squel=require(_0x484a('0xc'));var crypto=require(_0x484a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x484a('0xe'));var Papa=require(_0x484a('0xf'));var Redis=require('ioredis');var authService=require(_0x484a('0x10'));var qs=require(_0x484a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x484a('0x12'))('api');var utils=require(_0x484a('0x13'));var config=require(_0x484a('0x14'));var licenseUtil=require(_0x484a('0x15'));var db=require(_0x484a('0x16'))['db'];function respondWithStatusCode(_0x45adb7,_0x108f33){_0x108f33=_0x108f33||0xcc;return function(_0x162e93){if(_0x162e93){return _0x45adb7['sendStatus'](_0x108f33);}return _0x45adb7[_0x484a('0x17')](_0x108f33)['end']();};}function respondWithResult(_0x412718,_0x4ce308){_0x4ce308=_0x4ce308||0xc8;return function(_0x1bee5e){if(_0x1bee5e){return _0x412718[_0x484a('0x17')](_0x4ce308)['json'](_0x1bee5e);}};}function respondWithFilteredResult(_0xb40d8c,_0x298c16){return function(_0x41dbf9){if(_0x41dbf9){var _0x2fc281=typeof _0x298c16[_0x484a('0x18')]===_0x484a('0x19')&&typeof _0x298c16['limit']===_0x484a('0x19');var _0x361783=_0x41dbf9['count'];var _0x1e07a5=_0x2fc281?0x0:_0x298c16['offset'];var _0x3886da=_0x2fc281?_0x41dbf9[_0x484a('0x1a')]:_0x298c16[_0x484a('0x18')]+_0x298c16['limit'];var _0x4fbc5f;if(_0x3886da>=_0x361783){_0x3886da=_0x361783;_0x4fbc5f=0xc8;}else{_0x4fbc5f=0xce;}_0xb40d8c[_0x484a('0x17')](_0x4fbc5f);return _0xb40d8c[_0x484a('0x1b')](_0x484a('0x1c'),_0x1e07a5+'-'+_0x3886da+'/'+_0x361783)[_0x484a('0x1d')](_0x41dbf9);}return null;};}function patchUpdates(_0x675651){return function(_0x54c4f2){try{jsonpatch[_0x484a('0x1e')](_0x54c4f2,_0x675651,!![]);}catch(_0x438268){return BPromise[_0x484a('0x1f')](_0x438268);}return _0x54c4f2[_0x484a('0x20')]();};}function saveUpdates(_0x71fd0e,_0x249187){return function(_0x116fe5){if(_0x116fe5){return _0x116fe5[_0x484a('0x21')](_0x71fd0e)[_0x484a('0x22')](function(_0x4beede){return _0x4beede;});}return null;};}function removeEntity(_0x25fbfc,_0x11a042){return function(_0x22237f){if(_0x22237f){return _0x22237f[_0x484a('0x23')]()[_0x484a('0x22')](function(){var _0x2e65cf=_0x22237f[_0x484a('0x24')]({'plain':!![]});var _0x2a0809='ExtractedReports';return db[_0x484a('0x25')]['destroy']({'where':{'type':_0x2a0809,'resourceId':_0x2e65cf['id']}})['then'](function(){return _0x22237f;});})[_0x484a('0x22')](function(){_0x25fbfc[_0x484a('0x17')](0xcc)[_0x484a('0x26')]();});}};}function handleEntityNotFound(_0x9d67ec,_0x2751c1){return function(_0x397830){if(!_0x397830){_0x9d67ec['sendStatus'](0x194);}return _0x397830;};}function handleError(_0x129bdc,_0x2aa596){_0x2aa596=_0x2aa596||0x1f4;return function(_0x1f86cc){logger[_0x484a('0x27')](_0x1f86cc['stack']);if(_0x1f86cc['name']){delete _0x1f86cc[_0x484a('0x28')];}_0x129bdc[_0x484a('0x17')](_0x2aa596)[_0x484a('0x29')](_0x1f86cc);};}exports['index']=function(_0x186264,_0x694567){var _0x3e3350={},_0x288093={},_0x136560={'count':0x0,'rows':[]};var _0xaebc60=_[_0x484a('0x2a')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x8f3c4d){return{'name':_0x8f3c4d['fieldName'],'type':_0x8f3c4d[_0x484a('0x2b')]['key']};});_0x288093['model']=_[_0x484a('0x2a')](_0xaebc60,_0x484a('0x28'));_0x288093['query']=_[_0x484a('0x2c')](_0x186264[_0x484a('0x2d')]);_0x288093[_0x484a('0x2e')]=_[_0x484a('0x2f')](_0x288093[_0x484a('0x30')],_0x288093[_0x484a('0x2d')]);_0x3e3350['attributes']=_[_0x484a('0x2f')](_0x288093[_0x484a('0x30')],qs['fields'](_0x186264['query'][_0x484a('0x31')]));_0x3e3350[_0x484a('0x32')]=_0x3e3350[_0x484a('0x32')][_0x484a('0x33')]?_0x3e3350[_0x484a('0x32')]:_0x288093['model'];if(!_0x186264[_0x484a('0x2d')][_0x484a('0x34')](_0x484a('0x35'))){_0x3e3350[_0x484a('0x36')]=qs['limit'](_0x186264[_0x484a('0x2d')]['limit']);_0x3e3350[_0x484a('0x18')]=qs[_0x484a('0x18')](_0x186264[_0x484a('0x2d')][_0x484a('0x18')]);}_0x3e3350['order']=qs[_0x484a('0x37')](_0x186264[_0x484a('0x2d')]['sort']);_0x3e3350[_0x484a('0x38')]=qs['filters'](_['pick'](_0x186264[_0x484a('0x2d')],_0x288093[_0x484a('0x2e')]),_0xaebc60);if(_0x186264[_0x484a('0x2d')]['filter']){_0x3e3350[_0x484a('0x38')]=_['merge'](_0x3e3350[_0x484a('0x38')],{'$or':_[_0x484a('0x2a')](_0xaebc60,function(_0x3ff0c0){if(_0x3ff0c0[_0x484a('0x2b')]!==_0x484a('0x39')){var _0x5e6b4f={};_0x5e6b4f[_0x3ff0c0[_0x484a('0x28')]]={'$like':'%'+_0x186264[_0x484a('0x2d')][_0x484a('0x3a')]+'%'};return _0x5e6b4f;}})});}_0x3e3350=_[_0x484a('0x3b')]({},_0x3e3350,_0x186264['options']);var _0x2a8c68={'where':_0x3e3350['where']};return db[_0x484a('0x3c')][_0x484a('0x1a')](_0x2a8c68)['then'](function(_0x3a05f1){_0x136560[_0x484a('0x1a')]=_0x3a05f1;if(_0x186264[_0x484a('0x2d')]['includeAll']){_0x3e3350['include']=[{'all':!![]}];}return db[_0x484a('0x3c')]['findAll'](_0x3e3350);})[_0x484a('0x22')](function(_0x219bff){_0x136560[_0x484a('0x3d')]=_0x219bff;return _0x136560;})[_0x484a('0x22')](respondWithFilteredResult(_0x694567,_0x3e3350))[_0x484a('0x3e')](handleError(_0x694567,null));};exports[_0x484a('0x3f')]=function(_0x6fe4a,_0x5c1ffa){var _0x526400={'raw':!![],'where':{'id':_0x6fe4a['params']['id']}},_0x660453={};_0x660453[_0x484a('0x30')]=_[_0x484a('0x2c')](db[_0x484a('0x3c')][_0x484a('0x40')]);_0x660453['query']=_[_0x484a('0x2c')](_0x6fe4a[_0x484a('0x2d')]);_0x660453[_0x484a('0x2e')]=_[_0x484a('0x2f')](_0x660453[_0x484a('0x30')],_0x660453[_0x484a('0x2d')]);_0x526400['attributes']=_[_0x484a('0x2f')](_0x660453[_0x484a('0x30')],qs[_0x484a('0x31')](_0x6fe4a[_0x484a('0x2d')]['fields']));_0x526400[_0x484a('0x32')]=_0x526400[_0x484a('0x32')]['length']?_0x526400[_0x484a('0x32')]:_0x660453[_0x484a('0x30')];if(_0x6fe4a[_0x484a('0x2d')][_0x484a('0x41')]){_0x526400[_0x484a('0x42')]=[{'all':!![]}];}_0x526400=_[_0x484a('0x3b')]({},_0x526400,_0x6fe4a[_0x484a('0x43')]);return db[_0x484a('0x3c')][_0x484a('0x44')](_0x526400)[_0x484a('0x22')](handleEntityNotFound(_0x5c1ffa,null))['then'](respondWithResult(_0x5c1ffa,null))[_0x484a('0x3e')](handleError(_0x5c1ffa,null));};exports[_0x484a('0x45')]=function(_0x5b4f2c,_0xe03d74){return db[_0x484a('0x3c')]['create'](_0x5b4f2c['body'],{})[_0x484a('0x22')](function(_0x28d0b0){var _0x363d3d=_0x5b4f2c['user']['get']({'plain':!![]});if(!_0x363d3d)throw new Error(_0x484a('0x46'));if(_0x363d3d[_0x484a('0x47')]===_0x484a('0x48')){var _0x2ad4a5=_0x28d0b0[_0x484a('0x24')]({'plain':!![]});var _0x149c73=_0x484a('0x49');return db[_0x484a('0x4a')][_0x484a('0x44')]({'where':{'name':_0x149c73,'userProfileId':_0x363d3d['userProfileId']},'raw':!![]})[_0x484a('0x22')](function(_0x4b5603){if(_0x4b5603&&_0x4b5603['autoAssociation']===0x0){return db['UserProfileResource'][_0x484a('0x45')]({'name':_0x2ad4a5['name'],'resourceId':_0x2ad4a5['id'],'type':_0x4b5603[_0x484a('0x28')],'sectionId':_0x4b5603['id']},{})[_0x484a('0x22')](function(){return _0x28d0b0;});}else{return _0x28d0b0;}})['catch'](function(_0x22239b){logger[_0x484a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22239b);throw _0x22239b;});}return _0x28d0b0;})[_0x484a('0x22')](respondWithResult(_0xe03d74,0xc9))[_0x484a('0x3e')](handleError(_0xe03d74,null));};exports[_0x484a('0x21')]=function(_0x4f8f8d,_0x36203c){if(_0x4f8f8d[_0x484a('0x4b')]['id']){delete _0x4f8f8d[_0x484a('0x4b')]['id'];}return db[_0x484a('0x3c')][_0x484a('0x44')]({'where':{'id':_0x4f8f8d[_0x484a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36203c,null))['then'](saveUpdates(_0x4f8f8d[_0x484a('0x4b')],null))[_0x484a('0x22')](respondWithResult(_0x36203c,null))[_0x484a('0x3e')](handleError(_0x36203c,null));};exports[_0x484a('0x23')]=function(_0x106aae,_0x386e67){return db[_0x484a('0x3c')][_0x484a('0x44')]({'where':{'id':_0x106aae[_0x484a('0x4c')]['id']}})[_0x484a('0x22')](handleEntityNotFound(_0x386e67,null))[_0x484a('0x22')](removeEntity(_0x386e67,null))[_0x484a('0x3e')](handleError(_0x386e67,null));};exports['download']=function(_0x52058e,_0x3a997a,_0x280433){return db['AnalyticExtractedReport'][_0x484a('0x44')]({'where':{'id':_0x52058e['params']['id']},'attributes':[_0x484a('0x28'),_0x484a('0x4d'),_0x484a('0x4e'),_0x484a('0x4f')],'raw':!![]})[_0x484a('0x22')](handleEntityNotFound(_0x3a997a,null))['then'](function(_0x32be83){if(_0x32be83){if(!fs['existsSync'](path['join'](config['root'],'server/files/reports',_0x32be83['savename']))){throw new db[(_0x484a('0x50'))]['ValidationError'](_0x484a('0x51'));}if(_0x52058e['query'][_0x484a('0x52')]){return _0x3a997a[_0x484a('0x53')](0xc8);}return _0x3a997a['download'](path['join'](config['root'],_0x484a('0x54'),_0x32be83[_0x484a('0x4e')]),util['format'](_0x484a('0x55'),_0x32be83[_0x484a('0x4d')]||_0x32be83[_0x484a('0x28')],_0x32be83[_0x484a('0x4f')][_0x484a('0x56')]()));}})[_0x484a('0x3e')](handleError(_0x3a997a,null));};
\ No newline at end of file
+var _0xe6df=['include','findAll','rows','catch','show','params','rawAttributes','keys','fields','includeAll','find','create','body','role','user','userProfileId','autoAssociation','savename','output','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','type','options'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xe6df,0x13f));var _0xfe6d=function(_0x284e3e,_0x35157e){_0x284e3e=_0x284e3e-0x0;var _0x274860=_0xe6df[_0x284e3e];return _0x274860;};'use strict';var emlformat=require(_0xfe6d('0x0'));var rimraf=require(_0xfe6d('0x1'));var zipdir=require(_0xfe6d('0x2'));var jsonpatch=require(_0xfe6d('0x3'));var rp=require(_0xfe6d('0x4'));var moment=require(_0xfe6d('0x5'));var BPromise=require(_0xfe6d('0x6'));var Mustache=require(_0xfe6d('0x7'));var util=require(_0xfe6d('0x8'));var path=require(_0xfe6d('0x9'));var sox=require(_0xfe6d('0xa'));var csv=require('to-csv');var ejs=require(_0xfe6d('0xb'));var fs=require('fs');var fs_extra=require(_0xfe6d('0xc'));var _=require(_0xfe6d('0xd'));var squel=require(_0xfe6d('0xe'));var crypto=require(_0xfe6d('0xf'));var jsforce=require(_0xfe6d('0x10'));var deskjs=require(_0xfe6d('0x11'));var toCsv=require(_0xfe6d('0x12'));var querystring=require(_0xfe6d('0x13'));var Papa=require(_0xfe6d('0x14'));var Redis=require(_0xfe6d('0x15'));var authService=require(_0xfe6d('0x16'));var qs=require(_0xfe6d('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe6d('0x18'));var logger=require(_0xfe6d('0x19'))(_0xfe6d('0x1a'));var utils=require(_0xfe6d('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xfe6d('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ef48d,_0x2b4f7d){_0x2b4f7d=_0x2b4f7d||0xcc;return function(_0x3f248b){if(_0x3f248b){return _0x2ef48d['sendStatus'](_0x2b4f7d);}return _0x2ef48d[_0xfe6d('0x1d')](_0x2b4f7d)['end']();};}function respondWithResult(_0x40291a,_0x495657){_0x495657=_0x495657||0xc8;return function(_0x37a41f){if(_0x37a41f){return _0x40291a[_0xfe6d('0x1d')](_0x495657)[_0xfe6d('0x1e')](_0x37a41f);}};}function respondWithFilteredResult(_0x19ca42,_0x18f3b0){return function(_0x54ffd1){if(_0x54ffd1){var _0x1dbf4b=typeof _0x18f3b0[_0xfe6d('0x1f')]==='undefined'&&typeof _0x18f3b0[_0xfe6d('0x20')]===_0xfe6d('0x21');var _0x4f598d=_0x54ffd1['count'];var _0x579d2c=_0x1dbf4b?0x0:_0x18f3b0[_0xfe6d('0x1f')];var _0x3727cf=_0x1dbf4b?_0x54ffd1[_0xfe6d('0x22')]:_0x18f3b0[_0xfe6d('0x1f')]+_0x18f3b0[_0xfe6d('0x20')];var _0x4ae8e4;if(_0x3727cf>=_0x4f598d){_0x3727cf=_0x4f598d;_0x4ae8e4=0xc8;}else{_0x4ae8e4=0xce;}_0x19ca42[_0xfe6d('0x1d')](_0x4ae8e4);return _0x19ca42['set'](_0xfe6d('0x23'),_0x579d2c+'-'+_0x3727cf+'/'+_0x4f598d)[_0xfe6d('0x1e')](_0x54ffd1);}return null;};}function patchUpdates(_0x21a3f0){return function(_0x4da6b8){try{jsonpatch[_0xfe6d('0x24')](_0x4da6b8,_0x21a3f0,!![]);}catch(_0x4c23e2){return BPromise[_0xfe6d('0x25')](_0x4c23e2);}return _0x4da6b8[_0xfe6d('0x26')]();};}function saveUpdates(_0x296619,_0x540f9e){return function(_0x514c96){if(_0x514c96){return _0x514c96['update'](_0x296619)[_0xfe6d('0x27')](function(_0x3c9bc6){return _0x3c9bc6;});}return null;};}function removeEntity(_0x74cfc9,_0x3079a9){return function(_0x5622bd){if(_0x5622bd){return _0x5622bd[_0xfe6d('0x28')]()['then'](function(){var _0x4815a5=_0x5622bd[_0xfe6d('0x29')]({'plain':!![]});var _0x4e97ac=_0xfe6d('0x2a');return db[_0xfe6d('0x2b')][_0xfe6d('0x28')]({'where':{'type':_0x4e97ac,'resourceId':_0x4815a5['id']}})[_0xfe6d('0x27')](function(){return _0x5622bd;});})[_0xfe6d('0x27')](function(){_0x74cfc9['status'](0xcc)[_0xfe6d('0x2c')]();});}};}function handleEntityNotFound(_0x5b948b,_0x2b6e6f){return function(_0x4cd19a){if(!_0x4cd19a){_0x5b948b[_0xfe6d('0x2d')](0x194);}return _0x4cd19a;};}function handleError(_0xbe599f,_0x4dfef5){_0x4dfef5=_0x4dfef5||0x1f4;return function(_0x324533){logger[_0xfe6d('0x2e')](_0x324533[_0xfe6d('0x2f')]);if(_0x324533[_0xfe6d('0x30')]){delete _0x324533[_0xfe6d('0x30')];}_0xbe599f[_0xfe6d('0x1d')](_0x4dfef5)[_0xfe6d('0x31')](_0x324533);};}exports[_0xfe6d('0x32')]=function(_0x53141d,_0x177c1d){var _0x5839c9={},_0x248e41={},_0x294a41={'count':0x0,'rows':[]};var _0x1ef7f2=_[_0xfe6d('0x33')](db[_0xfe6d('0x34')]['rawAttributes'],function(_0x38011b){return{'name':_0x38011b[_0xfe6d('0x35')],'type':_0x38011b['type'][_0xfe6d('0x36')]};});_0x248e41[_0xfe6d('0x37')]=_[_0xfe6d('0x33')](_0x1ef7f2,_0xfe6d('0x30'));_0x248e41[_0xfe6d('0x38')]=_['keys'](_0x53141d[_0xfe6d('0x38')]);_0x248e41[_0xfe6d('0x39')]=_[_0xfe6d('0x3a')](_0x248e41[_0xfe6d('0x37')],_0x248e41[_0xfe6d('0x38')]);_0x5839c9[_0xfe6d('0x3b')]=_[_0xfe6d('0x3a')](_0x248e41[_0xfe6d('0x37')],qs['fields'](_0x53141d[_0xfe6d('0x38')]['fields']));_0x5839c9[_0xfe6d('0x3b')]=_0x5839c9[_0xfe6d('0x3b')][_0xfe6d('0x3c')]?_0x5839c9[_0xfe6d('0x3b')]:_0x248e41[_0xfe6d('0x37')];if(!_0x53141d[_0xfe6d('0x38')][_0xfe6d('0x3d')]('nolimit')){_0x5839c9[_0xfe6d('0x20')]=qs[_0xfe6d('0x20')](_0x53141d['query']['limit']);_0x5839c9[_0xfe6d('0x1f')]=qs[_0xfe6d('0x1f')](_0x53141d[_0xfe6d('0x38')][_0xfe6d('0x1f')]);}_0x5839c9['order']=qs[_0xfe6d('0x3e')](_0x53141d[_0xfe6d('0x38')][_0xfe6d('0x3e')]);_0x5839c9['where']=qs[_0xfe6d('0x39')](_[_0xfe6d('0x3f')](_0x53141d[_0xfe6d('0x38')],_0x248e41[_0xfe6d('0x39')]),_0x1ef7f2);if(_0x53141d[_0xfe6d('0x38')][_0xfe6d('0x40')]){_0x5839c9[_0xfe6d('0x41')]=_[_0xfe6d('0x42')](_0x5839c9['where'],{'$or':_['map'](_0x1ef7f2,function(_0x4ac3eb){if(_0x4ac3eb[_0xfe6d('0x43')]!=='VIRTUAL'){var _0x580ec2={};_0x580ec2[_0x4ac3eb[_0xfe6d('0x30')]]={'$like':'%'+_0x53141d[_0xfe6d('0x38')][_0xfe6d('0x40')]+'%'};return _0x580ec2;}})});}_0x5839c9=_[_0xfe6d('0x42')]({},_0x5839c9,_0x53141d[_0xfe6d('0x44')]);var _0x53333e={'where':_0x5839c9[_0xfe6d('0x41')]};return db[_0xfe6d('0x34')][_0xfe6d('0x22')](_0x53333e)[_0xfe6d('0x27')](function(_0x2350e8){_0x294a41[_0xfe6d('0x22')]=_0x2350e8;if(_0x53141d['query']['includeAll']){_0x5839c9[_0xfe6d('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xfe6d('0x46')](_0x5839c9);})[_0xfe6d('0x27')](function(_0xc1b3f){_0x294a41[_0xfe6d('0x47')]=_0xc1b3f;return _0x294a41;})['then'](respondWithFilteredResult(_0x177c1d,_0x5839c9))[_0xfe6d('0x48')](handleError(_0x177c1d,null));};exports[_0xfe6d('0x49')]=function(_0x299758,_0x48442f){var _0x349f7d={'raw':!![],'where':{'id':_0x299758[_0xfe6d('0x4a')]['id']}},_0x35d209={};_0x35d209[_0xfe6d('0x37')]=_['keys'](db[_0xfe6d('0x34')][_0xfe6d('0x4b')]);_0x35d209[_0xfe6d('0x38')]=_[_0xfe6d('0x4c')](_0x299758[_0xfe6d('0x38')]);_0x35d209[_0xfe6d('0x39')]=_[_0xfe6d('0x3a')](_0x35d209[_0xfe6d('0x37')],_0x35d209[_0xfe6d('0x38')]);_0x349f7d[_0xfe6d('0x3b')]=_[_0xfe6d('0x3a')](_0x35d209[_0xfe6d('0x37')],qs['fields'](_0x299758[_0xfe6d('0x38')][_0xfe6d('0x4d')]));_0x349f7d[_0xfe6d('0x3b')]=_0x349f7d['attributes'][_0xfe6d('0x3c')]?_0x349f7d[_0xfe6d('0x3b')]:_0x35d209[_0xfe6d('0x37')];if(_0x299758['query'][_0xfe6d('0x4e')]){_0x349f7d[_0xfe6d('0x45')]=[{'all':!![]}];}_0x349f7d=_[_0xfe6d('0x42')]({},_0x349f7d,_0x299758[_0xfe6d('0x44')]);return db[_0xfe6d('0x34')][_0xfe6d('0x4f')](_0x349f7d)['then'](handleEntityNotFound(_0x48442f,null))[_0xfe6d('0x27')](respondWithResult(_0x48442f,null))[_0xfe6d('0x48')](handleError(_0x48442f,null));};exports['create']=function(_0x1d830d,_0x4df72e){return db[_0xfe6d('0x34')][_0xfe6d('0x50')](_0x1d830d[_0xfe6d('0x51')],{})[_0xfe6d('0x27')](function(_0x57d29d){var _0x2c864b=_0x1d830d['user'][_0xfe6d('0x29')]({'plain':!![]});if(!_0x2c864b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c864b[_0xfe6d('0x52')]===_0xfe6d('0x53')){var _0x4d645f=_0x57d29d[_0xfe6d('0x29')]({'plain':!![]});var _0xad2ff1=_0xfe6d('0x2a');return db['UserProfileSection'][_0xfe6d('0x4f')]({'where':{'name':_0xad2ff1,'userProfileId':_0x2c864b[_0xfe6d('0x54')]},'raw':!![]})[_0xfe6d('0x27')](function(_0x5ef8e6){if(_0x5ef8e6&&_0x5ef8e6[_0xfe6d('0x55')]===0x0){return db[_0xfe6d('0x2b')][_0xfe6d('0x50')]({'name':_0x4d645f[_0xfe6d('0x30')],'resourceId':_0x4d645f['id'],'type':_0x5ef8e6[_0xfe6d('0x30')],'sectionId':_0x5ef8e6['id']},{})[_0xfe6d('0x27')](function(){return _0x57d29d;});}else{return _0x57d29d;}})[_0xfe6d('0x48')](function(_0x5602f4){logger[_0xfe6d('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5602f4);throw _0x5602f4;});}return _0x57d29d;})['then'](respondWithResult(_0x4df72e,0xc9))[_0xfe6d('0x48')](handleError(_0x4df72e,null));};exports['update']=function(_0x5180cf,_0x31ae0f){if(_0x5180cf[_0xfe6d('0x51')]['id']){delete _0x5180cf[_0xfe6d('0x51')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x5180cf[_0xfe6d('0x4a')]['id']}})[_0xfe6d('0x27')](handleEntityNotFound(_0x31ae0f,null))[_0xfe6d('0x27')](saveUpdates(_0x5180cf[_0xfe6d('0x51')],null))[_0xfe6d('0x27')](respondWithResult(_0x31ae0f,null))[_0xfe6d('0x48')](handleError(_0x31ae0f,null));};exports['destroy']=function(_0x591088,_0x2242f7){return db[_0xfe6d('0x34')][_0xfe6d('0x4f')]({'where':{'id':_0x591088[_0xfe6d('0x4a')]['id']}})[_0xfe6d('0x27')](handleEntityNotFound(_0x2242f7,null))[_0xfe6d('0x27')](removeEntity(_0x2242f7,null))[_0xfe6d('0x48')](handleError(_0x2242f7,null));};exports['download']=function(_0x5b5e97,_0x2fa0f8,_0x195023){return db[_0xfe6d('0x34')][_0xfe6d('0x4f')]({'where':{'id':_0x5b5e97[_0xfe6d('0x4a')]['id']},'attributes':['name','basename',_0xfe6d('0x56'),_0xfe6d('0x57')],'raw':!![]})[_0xfe6d('0x27')](handleEntityNotFound(_0x2fa0f8,null))[_0xfe6d('0x27')](function(_0x4d1cef){if(_0x4d1cef){if(!fs['existsSync'](path[_0xfe6d('0x58')](config[_0xfe6d('0x59')],_0xfe6d('0x5a'),_0x4d1cef[_0xfe6d('0x56')]))){throw new db['Sequelize']['ValidationError'](_0xfe6d('0x5b'));}if(_0x5b5e97['query'][_0xfe6d('0x5c')]){return _0x2fa0f8['sendStatus'](0xc8);}return _0x2fa0f8[_0xfe6d('0x5d')](path[_0xfe6d('0x58')](config[_0xfe6d('0x59')],_0xfe6d('0x5a'),_0x4d1cef[_0xfe6d('0x56')]),util[_0xfe6d('0x5e')](_0xfe6d('0x5f'),_0x4d1cef[_0xfe6d('0x60')]||_0x4d1cef['name'],_0x4d1cef[_0xfe6d('0x57')]['toLowerCase']()));}})[_0xfe6d('0x48')](handleError(_0x2fa0f8,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index e403640..8a371b9 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 _0xa97c=['./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xba9946,_0x3e270b){var _0x55b343=function(_0x3309da){while(--_0x3309da){_0xba9946['push'](_0xba9946['shift']());}};_0x55b343(++_0x3e270b);}(_0xa97c,0x1d8));var _0xca97=function(_0x27eff2,_0x1fbaf0){_0x27eff2=_0x27eff2-0x0;var _0x352a1f=_0xa97c[_0x27eff2];return _0x352a1f;};'use strict';var _=require(_0xca97('0x0'));var util=require('util');var logger=require(_0xca97('0x1'))(_0xca97('0x2'));var moment=require('moment');var BPromise=require(_0xca97('0x3'));var rp=require(_0xca97('0x4'));var fs=require('fs');var path=require(_0xca97('0x5'));var rimraf=require(_0xca97('0x6'));var config=require(_0xca97('0x7'));var attributes=require(_0xca97('0x8'));module[_0xca97('0x9')]=function(_0x37e7d2,_0xa41039){return _0x37e7d2[_0xca97('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0xca97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2fc=['lodash','util','api','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','define','analytics_extracted_reports'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0xb2fc,0x15f));var _0xcb2f=function(_0xf1c89c,_0x12a9dd){_0xf1c89c=_0xf1c89c-0x0;var _0x2099b8=_0xb2fc[_0xf1c89c];return _0x2099b8;};'use strict';var _=require(_0xcb2f('0x0'));var util=require(_0xcb2f('0x1'));var logger=require('../../config/logger')(_0xcb2f('0x2'));var moment=require('moment');var BPromise=require(_0xcb2f('0x3'));var rp=require(_0xcb2f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcb2f('0x5'));var attributes=require(_0xcb2f('0x6'));module['exports']=function(_0x5cfcc7,_0x572889){return _0x5cfcc7[_0xcb2f('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0xcb2f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 2c974dd..6bfffff 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 _0x6d40=['rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x375362,_0x21b72a){var _0x14ceac=function(_0x31bc4d){while(--_0x31bc4d){_0x375362['push'](_0x375362['shift']());}};_0x14ceac(++_0x21b72a);}(_0x6d40,0x1ec));var _0x06d4=function(_0x177600,_0x307b54){_0x177600=_0x177600-0x0;var _0xb6282f=_0x6d40[_0x177600];return _0xb6282f;};'use strict';var _=require(_0x06d4('0x0'));var util=require(_0x06d4('0x1'));var moment=require('moment');var BPromise=require(_0x06d4('0x2'));var rs=require(_0x06d4('0x3'));var fs=require('fs');var Redis=require(_0x06d4('0x4'));var db=require(_0x06d4('0x5'))['db'];var utils=require(_0x06d4('0x6'));var logger=require(_0x06d4('0x7'))(_0x06d4('0x8'));var config=require(_0x06d4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x06d4('0xa')][_0x06d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36f174,_0x208e2d,_0x35275f){return new BPromise(function(_0x4b5868,_0x1d6f8e){return client[_0x06d4('0xc')](_0x36f174,_0x35275f)[_0x06d4('0xd')](function(_0x3ca834){logger[_0x06d4('0xe')](_0x06d4('0xf'),_0x208e2d,_0x06d4('0x10'));logger[_0x06d4('0x11')](_0x06d4('0x12'),_0x208e2d,_0x06d4('0x10'),JSON[_0x06d4('0x13')](_0x3ca834));if(_0x3ca834[_0x06d4('0x14')]){if(_0x3ca834[_0x06d4('0x14')][_0x06d4('0x15')]===0x1f4){logger[_0x06d4('0x14')](_0x06d4('0xf'),_0x208e2d,_0x3ca834[_0x06d4('0x14')][_0x06d4('0x16')]);return _0x1d6f8e(_0x3ca834[_0x06d4('0x14')]['message']);}logger['error'](_0x06d4('0xf'),_0x208e2d,_0x3ca834['error'][_0x06d4('0x16')]);return _0x4b5868(_0x3ca834[_0x06d4('0x14')][_0x06d4('0x16')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x208e2d,_0x06d4('0x10'));_0x4b5868(_0x3ca834[_0x06d4('0x17')][_0x06d4('0x16')]);}})[_0x06d4('0x18')](function(_0x1be3c2){logger[_0x06d4('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x208e2d,_0x1be3c2);_0x1d6f8e(_0x1be3c2);});});}
\ No newline at end of file
+var _0xb0bf=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20d47f,_0x5ae529){var _0x40e585=function(_0x359a18){while(--_0x359a18){_0x20d47f['push'](_0x20d47f['shift']());}};_0x40e585(++_0x5ae529);}(_0xb0bf,0x8b));var _0xfb0b=function(_0x41db8e,_0x306aaf){_0x41db8e=_0x41db8e-0x0;var _0x444431=_0xb0bf[_0x41db8e];return _0x444431;};'use strict';var _=require(_0xfb0b('0x0'));var util=require(_0xfb0b('0x1'));var moment=require(_0xfb0b('0x2'));var BPromise=require(_0xfb0b('0x3'));var rs=require(_0xfb0b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb0b('0x5'))['db'];var utils=require(_0xfb0b('0x6'));var logger=require(_0xfb0b('0x7'))(_0xfb0b('0x8'));var config=require(_0xfb0b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb0b('0xa')][_0xfb0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54d7a1,_0x3130ac,_0x3cea1a){return new BPromise(function(_0x13928d,_0x2b8f62){return client['request'](_0x54d7a1,_0x3cea1a)[_0xfb0b('0xc')](function(_0x1a5b5a){logger[_0xfb0b('0xd')](_0xfb0b('0xe'),_0x3130ac,_0xfb0b('0xf'));logger[_0xfb0b('0x10')](_0xfb0b('0x11'),_0x3130ac,_0xfb0b('0xf'),JSON[_0xfb0b('0x12')](_0x1a5b5a));if(_0x1a5b5a[_0xfb0b('0x13')]){if(_0x1a5b5a[_0xfb0b('0x13')][_0xfb0b('0x14')]===0x1f4){logger[_0xfb0b('0x13')](_0xfb0b('0xe'),_0x3130ac,_0x1a5b5a[_0xfb0b('0x13')][_0xfb0b('0x15')]);return _0x2b8f62(_0x1a5b5a[_0xfb0b('0x13')][_0xfb0b('0x15')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3130ac,_0x1a5b5a[_0xfb0b('0x13')]['message']);return _0x13928d(_0x1a5b5a[_0xfb0b('0x13')][_0xfb0b('0x15')]);}else{logger[_0xfb0b('0xd')](_0xfb0b('0xe'),_0x3130ac,'request\x20sent');_0x13928d(_0x1a5b5a[_0xfb0b('0x16')][_0xfb0b('0x15')]);}})['catch'](function(_0x954ac9){logger['error'](_0xfb0b('0xe'),_0x3130ac,_0x954ac9);_0x2b8f62(_0x954ac9);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ea85374..f31ac67 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 _0x0477=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x8e0cd6,_0x364ace){var _0x162215=function(_0xea40c5){while(--_0xea40c5){_0x8e0cd6['push'](_0x8e0cd6['shift']());}};_0x162215(++_0x364ace);}(_0x0477,0x188));var _0x7047=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x0477[_0x555b2f];return _0x81c0a6;};'use strict';var multer=require(_0x7047('0x0'));var util=require(_0x7047('0x1'));var path=require('path');var timeout=require(_0x7047('0x2'));var express=require(_0x7047('0x3'));var router=express[_0x7047('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7047('0x5'));var interaction=require(_0x7047('0x6'));var config=require(_0x7047('0x7'));var controller=require(_0x7047('0x8'));router[_0x7047('0x9')]('/',auth[_0x7047('0xa')](),controller['index']);router[_0x7047('0x9')](_0x7047('0xb'),auth[_0x7047('0xa')](),controller[_0x7047('0xc')]);router[_0x7047('0x9')](_0x7047('0xd'),auth['isAuthenticated'](),controller[_0x7047('0xe')]);router[_0x7047('0xf')]('/',auth[_0x7047('0xa')](),controller['create']);router['put'](_0x7047('0xb'),auth[_0x7047('0xa')](),controller[_0x7047('0x10')]);router[_0x7047('0x11')]('/:id',auth[_0x7047('0xa')](),controller[_0x7047('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x00b0=['download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0x00b0,0x11b));var _0x000b=function(_0x484664,_0x14e738){_0x484664=_0x484664-0x0;var _0x3fcf3f=_0x00b0[_0x484664];return _0x3fcf3f;};'use strict';var multer=require(_0x000b('0x0'));var util=require(_0x000b('0x1'));var path=require(_0x000b('0x2'));var timeout=require(_0x000b('0x3'));var express=require(_0x000b('0x4'));var router=express[_0x000b('0x5')]();var fs_extra=require(_0x000b('0x6'));var auth=require(_0x000b('0x7'));var interaction=require(_0x000b('0x8'));var config=require(_0x000b('0x9'));var controller=require(_0x000b('0xa'));router[_0x000b('0xb')]('/',auth['isAuthenticated'](),controller[_0x000b('0xc')]);router[_0x000b('0xb')](_0x000b('0xd'),auth[_0x000b('0xe')](),controller[_0x000b('0xf')]);router[_0x000b('0xb')]('/:id/download',auth[_0x000b('0xe')](),controller[_0x000b('0x10')]);router[_0x000b('0x11')]('/',auth[_0x000b('0xe')](),controller[_0x000b('0x12')]);router[_0x000b('0x13')](_0x000b('0xd'),auth[_0x000b('0xe')](),controller[_0x000b('0x14')]);router[_0x000b('0x15')](_0x000b('0xd'),auth[_0x000b('0xe')](),controller[_0x000b('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index d7d62ec..f8abde9 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 _0xe02f=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3ba1ca,_0x225761){var _0x51d416=function(_0x407c4f){while(--_0x407c4f){_0x3ba1ca['push'](_0x3ba1ca['shift']());}};_0x51d416(++_0x225761);}(_0xe02f,0x1b9));var _0xfe02=function(_0x10f7f7,_0x457207){_0x10f7f7=_0x10f7f7-0x0;var _0x4ca615=_0xe02f[_0x10f7f7];return _0x4ca615;};'use strict';var Sequelize=require(_0xfe02('0x0'));module[_0xfe02('0x1')]={'field':{'type':Sequelize[_0xfe02('0x2')]},'alias':{'type':Sequelize[_0xfe02('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xfe02('0x3')]},'groupBy':{'type':Sequelize[_0xfe02('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xfe02('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf812=['BOOLEAN','STRING','exports','TEXT'];(function(_0xa1cd8d,_0x4579fa){var _0x640b99=function(_0x563e7a){while(--_0x563e7a){_0xa1cd8d['push'](_0xa1cd8d['shift']());}};_0x640b99(++_0x4579fa);}(_0xf812,0xd2));var _0x2f81=function(_0x57c501,_0x319f03){_0x57c501=_0x57c501-0x0;var _0x4f15ba=_0xf812[_0x57c501];return _0x4f15ba;};'use strict';var Sequelize=require('sequelize');module[_0x2f81('0x0')]={'field':{'type':Sequelize[_0x2f81('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x2f81('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2f81('0x3')]},'custom':{'type':Sequelize[_0x2f81('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 7b32f93..f56c33c 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 _0xd6a7=['undefined','limit','count','set','apply','reject','save','update','destroy','error','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','then','include','show','params','keys','merge','find','catch','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4583d0,_0x24551f){var _0x7b3c5a=function(_0x14946a){while(--_0x14946a){_0x4583d0['push'](_0x4583d0['shift']());}};_0x7b3c5a(++_0x24551f);}(_0xd6a7,0x11f));var _0x7d6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd6a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7d6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d6a('0x2'));var moment=require('moment');var BPromise=require(_0x7d6a('0x3'));var Mustache=require(_0x7d6a('0x4'));var util=require(_0x7d6a('0x5'));var path=require(_0x7d6a('0x6'));var sox=require(_0x7d6a('0x7'));var csv=require(_0x7d6a('0x8'));var ejs=require(_0x7d6a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d6a('0xa'));var squel=require(_0x7d6a('0xb'));var crypto=require('crypto');var jsforce=require(_0x7d6a('0xc'));var deskjs=require(_0x7d6a('0xd'));var toCsv=require(_0x7d6a('0x8'));var querystring=require('querystring');var Papa=require(_0x7d6a('0xe'));var Redis=require('ioredis');var authService=require(_0x7d6a('0xf'));var qs=require(_0x7d6a('0x10'));var as=require(_0x7d6a('0x11'));var hardwareService=require(_0x7d6a('0x12'));var logger=require(_0x7d6a('0x13'))(_0x7d6a('0x14'));var utils=require(_0x7d6a('0x15'));var config=require(_0x7d6a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d6a('0x17'))['db'];function respondWithStatusCode(_0x58ab9e,_0x135cf7){_0x135cf7=_0x135cf7||0xcc;return function(_0x2bae7b){if(_0x2bae7b){return _0x58ab9e[_0x7d6a('0x18')](_0x135cf7);}return _0x58ab9e[_0x7d6a('0x19')](_0x135cf7)[_0x7d6a('0x1a')]();};}function respondWithResult(_0x442e20,_0x882d0d){_0x882d0d=_0x882d0d||0xc8;return function(_0x5a73dd){if(_0x5a73dd){return _0x442e20[_0x7d6a('0x19')](_0x882d0d)[_0x7d6a('0x1b')](_0x5a73dd);}};}function respondWithFilteredResult(_0x4db851,_0x59d158){return function(_0xc9fa53){if(_0xc9fa53){var _0x281e90=typeof _0x59d158[_0x7d6a('0x1c')]===_0x7d6a('0x1d')&&typeof _0x59d158[_0x7d6a('0x1e')]===_0x7d6a('0x1d');var _0x1f591e=_0xc9fa53[_0x7d6a('0x1f')];var _0x135a0c=_0x281e90?0x0:_0x59d158[_0x7d6a('0x1c')];var _0x28455f=_0x281e90?_0xc9fa53[_0x7d6a('0x1f')]:_0x59d158[_0x7d6a('0x1c')]+_0x59d158[_0x7d6a('0x1e')];var _0x1e3b12;if(_0x28455f>=_0x1f591e){_0x28455f=_0x1f591e;_0x1e3b12=0xc8;}else{_0x1e3b12=0xce;}_0x4db851[_0x7d6a('0x19')](_0x1e3b12);return _0x4db851[_0x7d6a('0x20')]('Content-Range',_0x135a0c+'-'+_0x28455f+'/'+_0x1f591e)[_0x7d6a('0x1b')](_0xc9fa53);}return null;};}function patchUpdates(_0xbbe6ce){return function(_0x34b523){try{jsonpatch[_0x7d6a('0x21')](_0x34b523,_0xbbe6ce,!![]);}catch(_0xa0753b){return BPromise[_0x7d6a('0x22')](_0xa0753b);}return _0x34b523[_0x7d6a('0x23')]();};}function saveUpdates(_0x54f126,_0x4bfd79){return function(_0x3e35ee){if(_0x3e35ee){return _0x3e35ee[_0x7d6a('0x24')](_0x54f126)['then'](function(_0x4c6db3){return _0x4c6db3;});}return null;};}function removeEntity(_0x53f946,_0x376281){return function(_0x3af0e0){if(_0x3af0e0){return _0x3af0e0[_0x7d6a('0x25')]()['then'](function(){_0x53f946[_0x7d6a('0x19')](0xcc)[_0x7d6a('0x1a')]();});}};}function handleEntityNotFound(_0x50f626,_0x51bddd){return function(_0x40425a){if(!_0x40425a){_0x50f626[_0x7d6a('0x18')](0x194);}return _0x40425a;};}function handleError(_0x1e1fa3,_0xe8dd2e){_0xe8dd2e=_0xe8dd2e||0x1f4;return function(_0x58f9a2){logger[_0x7d6a('0x26')](_0x58f9a2['stack']);if(_0x58f9a2[_0x7d6a('0x27')]){delete _0x58f9a2[_0x7d6a('0x27')];}_0x1e1fa3[_0x7d6a('0x19')](_0xe8dd2e)[_0x7d6a('0x28')](_0x58f9a2);};}exports['index']=function(_0x4d55ec,_0x6b4a9f){var _0x3b3963={},_0x4352e4={},_0x37997a={'count':0x0,'rows':[]};var _0x10a147=_['map'](db[_0x7d6a('0x29')][_0x7d6a('0x2a')],function(_0xf94ad){return{'name':_0xf94ad[_0x7d6a('0x2b')],'type':_0xf94ad[_0x7d6a('0x2c')][_0x7d6a('0x2d')]};});_0x4352e4[_0x7d6a('0x2e')]=_[_0x7d6a('0x2f')](_0x10a147,_0x7d6a('0x27'));_0x4352e4[_0x7d6a('0x30')]=_['keys'](_0x4d55ec['query']);_0x4352e4['filters']=_[_0x7d6a('0x31')](_0x4352e4[_0x7d6a('0x2e')],_0x4352e4[_0x7d6a('0x30')]);_0x3b3963[_0x7d6a('0x32')]=_[_0x7d6a('0x31')](_0x4352e4[_0x7d6a('0x2e')],qs[_0x7d6a('0x33')](_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x33')]));_0x3b3963['attributes']=_0x3b3963[_0x7d6a('0x32')][_0x7d6a('0x34')]?_0x3b3963[_0x7d6a('0x32')]:_0x4352e4[_0x7d6a('0x2e')];if(!_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x35')](_0x7d6a('0x36'))){_0x3b3963[_0x7d6a('0x1e')]=qs[_0x7d6a('0x1e')](_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x1e')]);_0x3b3963[_0x7d6a('0x1c')]=qs[_0x7d6a('0x1c')](_0x4d55ec['query'][_0x7d6a('0x1c')]);}_0x3b3963[_0x7d6a('0x37')]=qs[_0x7d6a('0x38')](_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x38')]);_0x3b3963[_0x7d6a('0x39')]=qs[_0x7d6a('0x3a')](_['pick'](_0x4d55ec[_0x7d6a('0x30')],_0x4352e4[_0x7d6a('0x3a')]),_0x10a147);if(_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x3b')]){_0x3b3963[_0x7d6a('0x39')]=_['merge'](_0x3b3963[_0x7d6a('0x39')],{'$or':_[_0x7d6a('0x2f')](_0x10a147,function(_0x44e23a){if(_0x44e23a[_0x7d6a('0x2c')]!=='VIRTUAL'){var _0x1044da={};_0x1044da[_0x44e23a['name']]={'$like':'%'+_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x3b')]+'%'};return _0x1044da;}})});}_0x3b3963=_['merge']({},_0x3b3963,_0x4d55ec[_0x7d6a('0x3c')]);var _0x564e30={'where':_0x3b3963[_0x7d6a('0x39')]};return db[_0x7d6a('0x29')]['count'](_0x564e30)[_0x7d6a('0x3d')](function(_0x20e368){_0x37997a[_0x7d6a('0x1f')]=_0x20e368;if(_0x4d55ec['query']['includeAll']){_0x3b3963[_0x7d6a('0x3e')]=[{'all':!![]}];}return db[_0x7d6a('0x29')]['findAll'](_0x3b3963);})[_0x7d6a('0x3d')](function(_0x4feaed){_0x37997a['rows']=_0x4feaed;return _0x37997a;})[_0x7d6a('0x3d')](respondWithFilteredResult(_0x6b4a9f,_0x3b3963))['catch'](handleError(_0x6b4a9f,null));};exports[_0x7d6a('0x3f')]=function(_0x541a38,_0x37ee38){var _0x38febc={'raw':![],'where':{'id':_0x541a38[_0x7d6a('0x40')]['id']}},_0x5d21a8={};_0x5d21a8['model']=_[_0x7d6a('0x41')](db[_0x7d6a('0x29')][_0x7d6a('0x2a')]);_0x5d21a8[_0x7d6a('0x30')]=_[_0x7d6a('0x41')](_0x541a38['query']);_0x5d21a8[_0x7d6a('0x3a')]=_[_0x7d6a('0x31')](_0x5d21a8[_0x7d6a('0x2e')],_0x5d21a8[_0x7d6a('0x30')]);_0x38febc['attributes']=_[_0x7d6a('0x31')](_0x5d21a8['model'],qs[_0x7d6a('0x33')](_0x541a38[_0x7d6a('0x30')][_0x7d6a('0x33')]));_0x38febc[_0x7d6a('0x32')]=_0x38febc[_0x7d6a('0x32')][_0x7d6a('0x34')]?_0x38febc[_0x7d6a('0x32')]:_0x5d21a8[_0x7d6a('0x2e')];if(_0x541a38[_0x7d6a('0x30')]['includeAll']){_0x38febc[_0x7d6a('0x3e')]=[{'all':!![]}];}_0x38febc=_[_0x7d6a('0x42')]({},_0x38febc,_0x541a38[_0x7d6a('0x3c')]);return db[_0x7d6a('0x29')][_0x7d6a('0x43')](_0x38febc)[_0x7d6a('0x3d')](handleEntityNotFound(_0x37ee38,null))[_0x7d6a('0x3d')](respondWithResult(_0x37ee38,null))[_0x7d6a('0x44')](handleError(_0x37ee38,null));};exports[_0x7d6a('0x45')]=function(_0x5d3fd1,_0x40a482){return db[_0x7d6a('0x29')][_0x7d6a('0x45')](_0x5d3fd1['body'],{})[_0x7d6a('0x3d')](respondWithResult(_0x40a482,0xc9))['catch'](handleError(_0x40a482,null));};exports[_0x7d6a('0x46')]=function(_0x484e64,_0x1fd0d0){return db['AnalyticFieldReport']['bulkCreate'](_0x484e64[_0x7d6a('0x47')],{'raw':![],'individualHooks':!![]})[_0x7d6a('0x3d')](respondWithResult(_0x1fd0d0,0xc9))[_0x7d6a('0x44')](handleError(_0x1fd0d0,null));};exports[_0x7d6a('0x24')]=function(_0x111c46,_0x1cf51f){if(_0x111c46[_0x7d6a('0x47')]['id']){delete _0x111c46[_0x7d6a('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7d6a('0x43')]({'where':{'id':_0x111c46[_0x7d6a('0x40')]['id']}})[_0x7d6a('0x3d')](handleEntityNotFound(_0x1cf51f,null))[_0x7d6a('0x3d')](saveUpdates(_0x111c46[_0x7d6a('0x47')],null))['then'](respondWithResult(_0x1cf51f,null))[_0x7d6a('0x44')](handleError(_0x1cf51f,null));};exports[_0x7d6a('0x25')]=function(_0x535947,_0x4aecaf){return db[_0x7d6a('0x29')][_0x7d6a('0x43')]({'where':{'id':_0x535947['params']['id']}})[_0x7d6a('0x3d')](handleEntityNotFound(_0x4aecaf,null))['then'](removeEntity(_0x4aecaf,null))['catch'](handleError(_0x4aecaf,null));};exports[_0x7d6a('0x48')]=function(_0x1fad46,_0x1c82d9){return db[_0x7d6a('0x29')][_0x7d6a('0x25')]({'where':{'id':_0x1fad46['query'][_0x7d6a('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x7d6a('0x3d')](respondWithResult(_0x1c82d9,0xcc))[_0x7d6a('0x44')](handleError(_0x1c82d9,null));};exports['addFields']=function(_0x2e822d,_0x95e732,_0x223cea){return db[_0x7d6a('0x4a')][_0x7d6a('0x4b')]({'where':{'id':_0x2e822d[_0x7d6a('0x40')]['id']}})[_0x7d6a('0x3d')](handleEntityNotFound(_0x95e732,null))['then'](function(_0x3c0425){if(_0x3c0425){return db[_0x7d6a('0x4c')][_0x7d6a('0x4d')](function(_0x184244){return db[_0x7d6a('0x29')][_0x7d6a('0x25')]({'where':{'CustomReportId':_0x2e822d[_0x7d6a('0x40')]['id']},'transaction':_0x184244})[_0x7d6a('0x3d')](function(_0x511135){var _0x45aee5=_[_0x7d6a('0x2f')](_0x2e822d[_0x7d6a('0x47')],function(_0x52ef2e){delete _0x52ef2e['id'];_0x52ef2e[_0x7d6a('0x4e')]=_0x2e822d[_0x7d6a('0x40')]['id'];return _0x52ef2e;});return db[_0x7d6a('0x29')][_0x7d6a('0x46')](_0x45aee5,{'transaction':_0x184244});});})['then'](function(){return db[_0x7d6a('0x29')]['findAll']({'where':{'CustomReportId':_0x2e822d['params']['id']}});});}})[_0x7d6a('0x3d')](respondWithResult(_0x95e732,null))['catch'](handleError(_0x95e732,null));};
\ No newline at end of file
+var _0xf184=['findAll','rows','catch','show','params','AnalyticFieldReport','rawAttributes','length','include','find','create','body','bulkCreate','update','AnalyticCustomReport','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','destroy','then','error','stack','name','index','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','filter','where','merge','type','VIRTUAL','options','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf184,0xaf));var _0x4f18=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xf184[_0xcfc44];return _0x307a25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f18('0x0'));var zipdir=require(_0x4f18('0x1'));var jsonpatch=require(_0x4f18('0x2'));var rp=require(_0x4f18('0x3'));var moment=require(_0x4f18('0x4'));var BPromise=require(_0x4f18('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f18('0x6'));var sox=require(_0x4f18('0x7'));var csv=require(_0x4f18('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4f18('0x9'));var crypto=require(_0x4f18('0xa'));var jsforce=require(_0x4f18('0xb'));var deskjs=require(_0x4f18('0xc'));var toCsv=require(_0x4f18('0x8'));var querystring=require(_0x4f18('0xd'));var Papa=require(_0x4f18('0xe'));var Redis=require(_0x4f18('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4f18('0x10'));var hardwareService=require(_0x4f18('0x11'));var logger=require(_0x4f18('0x12'))(_0x4f18('0x13'));var utils=require(_0x4f18('0x14'));var config=require(_0x4f18('0x15'));var licenseUtil=require(_0x4f18('0x16'));var db=require(_0x4f18('0x17'))['db'];function respondWithStatusCode(_0x5211b2,_0x13b209){_0x13b209=_0x13b209||0xcc;return function(_0x18d6b1){if(_0x18d6b1){return _0x5211b2[_0x4f18('0x18')](_0x13b209);}return _0x5211b2[_0x4f18('0x19')](_0x13b209)[_0x4f18('0x1a')]();};}function respondWithResult(_0xb51ea,_0x36b122){_0x36b122=_0x36b122||0xc8;return function(_0x2e70a3){if(_0x2e70a3){return _0xb51ea['status'](_0x36b122)[_0x4f18('0x1b')](_0x2e70a3);}};}function respondWithFilteredResult(_0x437fd4,_0x5b122e){return function(_0x21f50a){if(_0x21f50a){var _0x5ae289=typeof _0x5b122e['offset']===_0x4f18('0x1c')&&typeof _0x5b122e[_0x4f18('0x1d')]===_0x4f18('0x1c');var _0x2e6b0e=_0x21f50a[_0x4f18('0x1e')];var _0x273fa8=_0x5ae289?0x0:_0x5b122e['offset'];var _0x8ec518=_0x5ae289?_0x21f50a[_0x4f18('0x1e')]:_0x5b122e['offset']+_0x5b122e['limit'];var _0x567066;if(_0x8ec518>=_0x2e6b0e){_0x8ec518=_0x2e6b0e;_0x567066=0xc8;}else{_0x567066=0xce;}_0x437fd4['status'](_0x567066);return _0x437fd4[_0x4f18('0x1f')]('Content-Range',_0x273fa8+'-'+_0x8ec518+'/'+_0x2e6b0e)[_0x4f18('0x1b')](_0x21f50a);}return null;};}function patchUpdates(_0x2f655c){return function(_0x3c71f3){try{jsonpatch[_0x4f18('0x20')](_0x3c71f3,_0x2f655c,!![]);}catch(_0x2be212){return BPromise[_0x4f18('0x21')](_0x2be212);}return _0x3c71f3[_0x4f18('0x22')]();};}function saveUpdates(_0x44b683,_0x48c599){return function(_0x4b7c7c){if(_0x4b7c7c){return _0x4b7c7c['update'](_0x44b683)['then'](function(_0x2b80f5){return _0x2b80f5;});}return null;};}function removeEntity(_0x1cf8df,_0x3cda5c){return function(_0x7c0992){if(_0x7c0992){return _0x7c0992[_0x4f18('0x23')]()[_0x4f18('0x24')](function(){_0x1cf8df[_0x4f18('0x19')](0xcc)[_0x4f18('0x1a')]();});}};}function handleEntityNotFound(_0x3b8675,_0x487b57){return function(_0x47e0e6){if(!_0x47e0e6){_0x3b8675['sendStatus'](0x194);}return _0x47e0e6;};}function handleError(_0x405a05,_0x1d1df5){_0x1d1df5=_0x1d1df5||0x1f4;return function(_0x241723){logger[_0x4f18('0x25')](_0x241723[_0x4f18('0x26')]);if(_0x241723[_0x4f18('0x27')]){delete _0x241723[_0x4f18('0x27')];}_0x405a05['status'](_0x1d1df5)['send'](_0x241723);};}exports[_0x4f18('0x28')]=function(_0x562049,_0x595614){var _0x244083={},_0x551124={},_0x193a40={'count':0x0,'rows':[]};var _0x2319f1=_[_0x4f18('0x29')](db['AnalyticFieldReport']['rawAttributes'],function(_0x2deeb4){return{'name':_0x2deeb4[_0x4f18('0x2a')],'type':_0x2deeb4['type'][_0x4f18('0x2b')]};});_0x551124['model']=_[_0x4f18('0x29')](_0x2319f1,_0x4f18('0x27'));_0x551124[_0x4f18('0x2c')]=_[_0x4f18('0x2d')](_0x562049[_0x4f18('0x2c')]);_0x551124[_0x4f18('0x2e')]=_[_0x4f18('0x2f')](_0x551124[_0x4f18('0x30')],_0x551124[_0x4f18('0x2c')]);_0x244083[_0x4f18('0x31')]=_[_0x4f18('0x2f')](_0x551124[_0x4f18('0x30')],qs[_0x4f18('0x32')](_0x562049['query'][_0x4f18('0x32')]));_0x244083[_0x4f18('0x31')]=_0x244083[_0x4f18('0x31')]['length']?_0x244083[_0x4f18('0x31')]:_0x551124[_0x4f18('0x30')];if(!_0x562049[_0x4f18('0x2c')][_0x4f18('0x33')](_0x4f18('0x34'))){_0x244083[_0x4f18('0x1d')]=qs[_0x4f18('0x1d')](_0x562049[_0x4f18('0x2c')]['limit']);_0x244083['offset']=qs[_0x4f18('0x35')](_0x562049[_0x4f18('0x2c')]['offset']);}_0x244083[_0x4f18('0x36')]=qs['sort'](_0x562049[_0x4f18('0x2c')]['sort']);_0x244083['where']=qs[_0x4f18('0x2e')](_['pick'](_0x562049[_0x4f18('0x2c')],_0x551124[_0x4f18('0x2e')]),_0x2319f1);if(_0x562049[_0x4f18('0x2c')][_0x4f18('0x37')]){_0x244083[_0x4f18('0x38')]=_[_0x4f18('0x39')](_0x244083[_0x4f18('0x38')],{'$or':_[_0x4f18('0x29')](_0x2319f1,function(_0x223fda){if(_0x223fda[_0x4f18('0x3a')]!==_0x4f18('0x3b')){var _0x1903ea={};_0x1903ea[_0x223fda['name']]={'$like':'%'+_0x562049[_0x4f18('0x2c')][_0x4f18('0x37')]+'%'};return _0x1903ea;}})});}_0x244083=_[_0x4f18('0x39')]({},_0x244083,_0x562049[_0x4f18('0x3c')]);var _0x40d641={'where':_0x244083[_0x4f18('0x38')]};return db['AnalyticFieldReport'][_0x4f18('0x1e')](_0x40d641)[_0x4f18('0x24')](function(_0x424a0a){_0x193a40[_0x4f18('0x1e')]=_0x424a0a;if(_0x562049[_0x4f18('0x2c')][_0x4f18('0x3d')]){_0x244083['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4f18('0x3e')](_0x244083);})[_0x4f18('0x24')](function(_0x3259fd){_0x193a40[_0x4f18('0x3f')]=_0x3259fd;return _0x193a40;})['then'](respondWithFilteredResult(_0x595614,_0x244083))[_0x4f18('0x40')](handleError(_0x595614,null));};exports[_0x4f18('0x41')]=function(_0x1263f5,_0x31fa9e){var _0xfd1ea={'raw':![],'where':{'id':_0x1263f5[_0x4f18('0x42')]['id']}},_0x1919b4={};_0x1919b4[_0x4f18('0x30')]=_[_0x4f18('0x2d')](db[_0x4f18('0x43')][_0x4f18('0x44')]);_0x1919b4['query']=_['keys'](_0x1263f5[_0x4f18('0x2c')]);_0x1919b4[_0x4f18('0x2e')]=_[_0x4f18('0x2f')](_0x1919b4['model'],_0x1919b4[_0x4f18('0x2c')]);_0xfd1ea[_0x4f18('0x31')]=_[_0x4f18('0x2f')](_0x1919b4[_0x4f18('0x30')],qs[_0x4f18('0x32')](_0x1263f5[_0x4f18('0x2c')][_0x4f18('0x32')]));_0xfd1ea[_0x4f18('0x31')]=_0xfd1ea[_0x4f18('0x31')][_0x4f18('0x45')]?_0xfd1ea[_0x4f18('0x31')]:_0x1919b4[_0x4f18('0x30')];if(_0x1263f5[_0x4f18('0x2c')][_0x4f18('0x3d')]){_0xfd1ea[_0x4f18('0x46')]=[{'all':!![]}];}_0xfd1ea=_['merge']({},_0xfd1ea,_0x1263f5[_0x4f18('0x3c')]);return db['AnalyticFieldReport'][_0x4f18('0x47')](_0xfd1ea)[_0x4f18('0x24')](handleEntityNotFound(_0x31fa9e,null))[_0x4f18('0x24')](respondWithResult(_0x31fa9e,null))[_0x4f18('0x40')](handleError(_0x31fa9e,null));};exports[_0x4f18('0x48')]=function(_0x4d081e,_0x22afcd){return db[_0x4f18('0x43')][_0x4f18('0x48')](_0x4d081e[_0x4f18('0x49')],{})[_0x4f18('0x24')](respondWithResult(_0x22afcd,0xc9))['catch'](handleError(_0x22afcd,null));};exports[_0x4f18('0x4a')]=function(_0x2f3154,_0x1ab203){return db[_0x4f18('0x43')][_0x4f18('0x4a')](_0x2f3154[_0x4f18('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1ab203,0xc9))[_0x4f18('0x40')](handleError(_0x1ab203,null));};exports[_0x4f18('0x4b')]=function(_0xb2f796,_0x74611a){if(_0xb2f796[_0x4f18('0x49')]['id']){delete _0xb2f796[_0x4f18('0x49')]['id'];}return db[_0x4f18('0x43')]['find']({'where':{'id':_0xb2f796[_0x4f18('0x42')]['id']}})[_0x4f18('0x24')](handleEntityNotFound(_0x74611a,null))['then'](saveUpdates(_0xb2f796[_0x4f18('0x49')],null))[_0x4f18('0x24')](respondWithResult(_0x74611a,null))['catch'](handleError(_0x74611a,null));};exports[_0x4f18('0x23')]=function(_0x285e5f,_0x6e4de3){return db[_0x4f18('0x43')][_0x4f18('0x47')]({'where':{'id':_0x285e5f[_0x4f18('0x42')]['id']}})[_0x4f18('0x24')](handleEntityNotFound(_0x6e4de3,null))[_0x4f18('0x24')](removeEntity(_0x6e4de3,null))[_0x4f18('0x40')](handleError(_0x6e4de3,null));};exports['bulkDestroy']=function(_0x13b40b,_0x223dcb){return db[_0x4f18('0x43')][_0x4f18('0x23')]({'where':{'id':_0x13b40b[_0x4f18('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x4f18('0x24')](respondWithResult(_0x223dcb,0xcc))['catch'](handleError(_0x223dcb,null));};exports['addFields']=function(_0x297d27,_0xd94029,_0x33faa3){return db[_0x4f18('0x4c')]['findOne']({'where':{'id':_0x297d27[_0x4f18('0x42')]['id']}})[_0x4f18('0x24')](handleEntityNotFound(_0xd94029,null))[_0x4f18('0x24')](function(_0x194b19){if(_0x194b19){return db[_0x4f18('0x4d')][_0x4f18('0x4e')](function(_0x2b5db4){return db[_0x4f18('0x43')]['destroy']({'where':{'CustomReportId':_0x297d27['params']['id']},'transaction':_0x2b5db4})[_0x4f18('0x24')](function(_0x568b62){var _0x3c7846=_[_0x4f18('0x29')](_0x297d27[_0x4f18('0x49')],function(_0x2d9471){delete _0x2d9471['id'];_0x2d9471['CustomReportId']=_0x297d27[_0x4f18('0x42')]['id'];return _0x2d9471;});return db[_0x4f18('0x43')][_0x4f18('0x4a')](_0x3c7846,{'transaction':_0x2b5db4});});})[_0x4f18('0x24')](function(){return db[_0x4f18('0x43')][_0x4f18('0x3e')]({'where':{'CustomReportId':_0x297d27[_0x4f18('0x42')]['id']}});});}})['then'](respondWithResult(_0xd94029,null))['catch'](handleError(_0xd94029,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 2066901..24cc9c3 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 _0xe706=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xe706,0x1c6));var _0x6e70=function(_0xef66ed,_0x1a5239){_0xef66ed=_0xef66ed-0x0;var _0xa14f66=_0xe706[_0xef66ed];return _0xa14f66;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x462287,_0x393afd){return _0x462287[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x18e1=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x18e1,0xc4));var _0x118e=function(_0x4c0db0,_0x19e7f9){_0x4c0db0=_0x4c0db0-0x0;var _0x31d888=_0x18e1[_0x4c0db0];return _0x31d888;};'use strict';var _=require(_0x118e('0x0'));var util=require(_0x118e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x118e('0x2'));var BPromise=require(_0x118e('0x3'));var rp=require(_0x118e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x118e('0x5'));var config=require(_0x118e('0x6'));var attributes=require(_0x118e('0x7'));module[_0x118e('0x8')]=function(_0x25297f,_0x1e663c){return _0x25297f[_0x118e('0x9')](_0x118e('0xa'),attributes,{'tableName':_0x118e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 3b15179..7763890 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 _0x07e2=['request','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x187d1f,_0x2c09c2){var _0x3556e5=function(_0x5d9095){while(--_0x5d9095){_0x187d1f['push'](_0x187d1f['shift']());}};_0x3556e5(++_0x2c09c2);}(_0x07e2,0x131));var _0x207e=function(_0x381781,_0x35257f){_0x381781=_0x381781-0x0;var _0x540ba0=_0x07e2[_0x381781];return _0x540ba0;};'use strict';var _=require('lodash');var util=require(_0x207e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x207e('0x1'));var fs=require('fs');var Redis=require(_0x207e('0x2'));var db=require(_0x207e('0x3'))['db'];var utils=require(_0x207e('0x4'));var logger=require(_0x207e('0x5'))(_0x207e('0x6'));var config=require(_0x207e('0x7'));var jayson=require(_0x207e('0x8'));var client=jayson[_0x207e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ab7ee,_0x5b1b58,_0x3305fa){return new BPromise(function(_0x4e20ac,_0x196a6b){return client[_0x207e('0xa')](_0x2ab7ee,_0x3305fa)['then'](function(_0x5e9eae){logger[_0x207e('0xb')](_0x207e('0xc'),_0x5b1b58,'request\x20sent');logger['debug'](_0x207e('0xd'),_0x5b1b58,'request\x20sent',JSON[_0x207e('0xe')](_0x5e9eae));if(_0x5e9eae[_0x207e('0xf')]){if(_0x5e9eae['error'][_0x207e('0x10')]===0x1f4){logger[_0x207e('0xf')](_0x207e('0xc'),_0x5b1b58,_0x5e9eae[_0x207e('0xf')][_0x207e('0x11')]);return _0x196a6b(_0x5e9eae[_0x207e('0xf')][_0x207e('0x11')]);}logger[_0x207e('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5b1b58,_0x5e9eae['error'][_0x207e('0x11')]);return _0x4e20ac(_0x5e9eae[_0x207e('0xf')][_0x207e('0x11')]);}else{logger['info'](_0x207e('0xc'),_0x5b1b58,_0x207e('0x12'));_0x4e20ac(_0x5e9eae[_0x207e('0x13')]['message']);}})[_0x207e('0x14')](function(_0x108281){logger[_0x207e('0xf')](_0x207e('0xc'),_0x5b1b58,_0x108281);_0x196a6b(_0x108281);});});}
\ No newline at end of file
+var _0x3e68=['AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3cb7a1,_0x37820b){var _0x55f38b=function(_0x3c717e){while(--_0x3c717e){_0x3cb7a1['push'](_0x3cb7a1['shift']());}};_0x55f38b(++_0x37820b);}(_0x3e68,0x82));var _0x83e6=function(_0x3bfa7a,_0x38d6f9){_0x3bfa7a=_0x3bfa7a-0x0;var _0x5afc30=_0x3e68[_0x3bfa7a];return _0x5afc30;};'use strict';var _=require(_0x83e6('0x0'));var util=require(_0x83e6('0x1'));var moment=require(_0x83e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x83e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x83e6('0x4'))(_0x83e6('0x5'));var config=require(_0x83e6('0x6'));var jayson=require(_0x83e6('0x7'));var client=jayson[_0x83e6('0x8')][_0x83e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d4309,_0x3b48b7,_0x4b2ac7){return new BPromise(function(_0x220aee,_0x1c80b2){return client[_0x83e6('0xa')](_0x4d4309,_0x4b2ac7)['then'](function(_0x2a0d16){logger[_0x83e6('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b48b7,'request\x20sent');logger[_0x83e6('0xc')](_0x83e6('0xd'),_0x3b48b7,_0x83e6('0xe'),JSON[_0x83e6('0xf')](_0x2a0d16));if(_0x2a0d16[_0x83e6('0x10')]){if(_0x2a0d16[_0x83e6('0x10')]['code']===0x1f4){logger[_0x83e6('0x10')](_0x83e6('0x11'),_0x3b48b7,_0x2a0d16[_0x83e6('0x10')][_0x83e6('0x12')]);return _0x1c80b2(_0x2a0d16[_0x83e6('0x10')][_0x83e6('0x12')]);}logger[_0x83e6('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b48b7,_0x2a0d16[_0x83e6('0x10')][_0x83e6('0x12')]);return _0x220aee(_0x2a0d16[_0x83e6('0x10')][_0x83e6('0x12')]);}else{logger[_0x83e6('0xb')](_0x83e6('0x11'),_0x3b48b7,'request\x20sent');_0x220aee(_0x2a0d16[_0x83e6('0x13')][_0x83e6('0x12')]);}})[_0x83e6('0x14')](function(_0x5f0741){logger[_0x83e6('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3b48b7,_0x5f0741);_0x1c80b2(_0x5f0741);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 3e4322f..454f0fc 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(_0x2c10d1,_0x9a1e2b){var _0x119b4a=function(_0xcee1a5){while(--_0xcee1a5){_0x2c10d1['push'](_0x2c10d1['shift']());}};_0x119b4a(++_0x9a1e2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x310d9e,_0x885baa){var _0x57551c=function(_0xe1b1de){while(--_0xe1b1de){_0x310d9e['push'](_0x310d9e['shift']());}};_0x57551c(++_0x885baa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 2b827da..adb4215 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 _0xb98f=['STRING','name','sequelize','exports'];(function(_0x330db1,_0x35fc39){var _0xe113f4=function(_0x422608){while(--_0x422608){_0x330db1['push'](_0x330db1['shift']());}};_0xe113f4(++_0x35fc39);}(_0xb98f,0xce));var _0xfb98=function(_0x2790cf,_0x3f8b07){_0x2790cf=_0x2790cf-0x0;var _0xc19833=_0xb98f[_0x2790cf];return _0xc19833;};'use strict';var Sequelize=require(_0xfb98('0x0'));module[_0xfb98('0x1')]={'name':{'type':Sequelize[_0xfb98('0x2')],'allowNull':![],'unique':_0xfb98('0x3')},'table':{'type':Sequelize[_0xfb98('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4bde=['TEXT','sequelize','exports','STRING'];(function(_0x3c88bf,_0x5e5bf9){var _0x53036f=function(_0x2dc8b7){while(--_0x2dc8b7){_0x3c88bf['push'](_0x3c88bf['shift']());}};_0x53036f(++_0x5e5bf9);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x2bcfc7,_0x32364e){_0x2bcfc7=_0x2bcfc7-0x0;var _0xf94493=_0x4bde[_0x2bcfc7];return _0xf94493;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'name':{'type':Sequelize[_0xe4bd('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xe4bd('0x2')]},'metric':{'type':Sequelize[_0xe4bd('0x3')]},'description':{'type':Sequelize[_0xe4bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 787601f..d4aec7e 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 _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(_0x3a2bb7,_0x4ebdce){var _0x4f5f21=function(_0x455d71){while(--_0x455d71){_0x3a2bb7['push'](_0x3a2bb7['shift']());}};_0x4f5f21(++_0x4ebdce);}(_0xe5b3,0x133));var _0x3e5b=function(_0x31b7d7,_0x3de9ed){_0x31b7d7=_0x31b7d7-0x0;var _0x3a376e=_0xe5b3[_0x31b7d7];return _0x3a376e;};'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
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5cad3b,_0x38872f){var _0x42f44e=function(_0x3bd146){while(--_0x3bd146){_0x5cad3b['push'](_0x5cad3b['shift']());}};_0x42f44e(++_0x38872f);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0xf2ca[_0x419550];return _0x55f9ef;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 47c6e2a..e238ead 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 _0x8838=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x148e7c,_0x433004){var _0x59da04=function(_0x20d6a6){while(--_0x20d6a6){_0x148e7c['push'](_0x148e7c['shift']());}};_0x59da04(++_0x433004);}(_0x8838,0x90));var _0x8883=function(_0x3f246b,_0x1c8b9a){_0x3f246b=_0x3f246b-0x0;var _0x1a7b27=_0x8838[_0x3f246b];return _0x1a7b27;};'use strict';var _=require(_0x8883('0x0'));var util=require(_0x8883('0x1'));var logger=require(_0x8883('0x2'))(_0x8883('0x3'));var moment=require(_0x8883('0x4'));var BPromise=require(_0x8883('0x5'));var rp=require(_0x8883('0x6'));var fs=require('fs');var path=require(_0x8883('0x7'));var rimraf=require(_0x8883('0x8'));var config=require(_0x8883('0x9'));var attributes=require(_0x8883('0xa'));module[_0x8883('0xb')]=function(_0x5c894f,_0x5061d6){return _0x5c894f[_0x8883('0xc')]('AnalyticMetric',attributes,{'tableName':_0x8883('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1134=['AnalyticMetric','analytics_metrics','lodash','util','api','moment','request-promise','path','../../config/environment','exports'];(function(_0x1fa3d3,_0x42a2e0){var _0x51a3b5=function(_0x54a475){while(--_0x54a475){_0x1fa3d3['push'](_0x1fa3d3['shift']());}};_0x51a3b5(++_0x42a2e0);}(_0x1134,0x19c));var _0x4113=function(_0x2585db,_0xf10c35){_0x2585db=_0x2585db-0x0;var _0x67fe48=_0x1134[_0x2585db];return _0x67fe48;};'use strict';var _=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var logger=require('../../config/logger')(_0x4113('0x2'));var moment=require(_0x4113('0x3'));var BPromise=require('bluebird');var rp=require(_0x4113('0x4'));var fs=require('fs');var path=require(_0x4113('0x5'));var rimraf=require('rimraf');var config=require(_0x4113('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x4113('0x7')]=function(_0x499091,_0x39ca01){return _0x499091['define'](_0x4113('0x8'),attributes,{'tableName':_0x4113('0x9'),'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 e36926c..8b3ad6d 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 _0x7da8=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b4f44,_0x7cc184){var _0xaaebe3=function(_0x11f155){while(--_0x11f155){_0x2b4f44['push'](_0x2b4f44['shift']());}};_0xaaebe3(++_0x7cc184);}(_0x7da8,0x164));var _0x87da=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7da8[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x87da('0x0'));var util=require(_0x87da('0x1'));var moment=require(_0x87da('0x2'));var BPromise=require('bluebird');var rs=require(_0x87da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87da('0x4'))['db'];var utils=require(_0x87da('0x5'));var logger=require(_0x87da('0x6'))(_0x87da('0x7'));var config=require(_0x87da('0x8'));var jayson=require(_0x87da('0x9'));var client=jayson[_0x87da('0xa')][_0x87da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36856c,_0x20e780,_0x2fd416){return new BPromise(function(_0x3096bb,_0x31b7f2){return client['request'](_0x36856c,_0x2fd416)[_0x87da('0xc')](function(_0x5290ea){logger[_0x87da('0xd')](_0x87da('0xe'),_0x20e780,_0x87da('0xf'));logger[_0x87da('0x10')](_0x87da('0x11'),_0x20e780,_0x87da('0xf'),JSON[_0x87da('0x12')](_0x5290ea));if(_0x5290ea[_0x87da('0x13')]){if(_0x5290ea[_0x87da('0x13')][_0x87da('0x14')]===0x1f4){logger[_0x87da('0x13')](_0x87da('0xe'),_0x20e780,_0x5290ea['error'][_0x87da('0x15')]);return _0x31b7f2(_0x5290ea[_0x87da('0x13')][_0x87da('0x15')]);}logger[_0x87da('0x13')](_0x87da('0xe'),_0x20e780,_0x5290ea['error'][_0x87da('0x15')]);return _0x3096bb(_0x5290ea[_0x87da('0x13')][_0x87da('0x15')]);}else{logger[_0x87da('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x20e780,_0x87da('0xf'));_0x3096bb(_0x5290ea['result']['message']);}})[_0x87da('0x16')](function(_0x233834){logger[_0x87da('0x13')](_0x87da('0xe'),_0x20e780,_0x233834);_0x31b7f2(_0x233834);});});}
\ No newline at end of file
+var _0xe78b=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x243c9c,_0x3dbac6){var _0x25d5e9=function(_0x1b71dd){while(--_0x1b71dd){_0x243c9c['push'](_0x243c9c['shift']());}};_0x25d5e9(++_0x3dbac6);}(_0xe78b,0x1a8));var _0xbe78=function(_0x5d2ed9,_0x16c436){_0x5d2ed9=_0x5d2ed9-0x0;var _0x4262c5=_0xe78b[_0x5d2ed9];return _0x4262c5;};'use strict';var _=require(_0xbe78('0x0'));var util=require(_0xbe78('0x1'));var moment=require(_0xbe78('0x2'));var BPromise=require(_0xbe78('0x3'));var rs=require(_0xbe78('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe78('0x5'))['db'];var utils=require(_0xbe78('0x6'));var logger=require(_0xbe78('0x7'))(_0xbe78('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbe78('0x9')][_0xbe78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d8118,_0x4f200f,_0x3908b7){return new BPromise(function(_0x117399,_0x2f7baa){return client[_0xbe78('0xb')](_0x4d8118,_0x3908b7)[_0xbe78('0xc')](function(_0x288a39){logger[_0xbe78('0xd')](_0xbe78('0xe'),_0x4f200f,_0xbe78('0xf'));logger[_0xbe78('0x10')](_0xbe78('0x11'),_0x4f200f,_0xbe78('0xf'),JSON[_0xbe78('0x12')](_0x288a39));if(_0x288a39[_0xbe78('0x13')]){if(_0x288a39[_0xbe78('0x13')]['code']===0x1f4){logger[_0xbe78('0x13')](_0xbe78('0xe'),_0x4f200f,_0x288a39[_0xbe78('0x13')][_0xbe78('0x14')]);return _0x2f7baa(_0x288a39[_0xbe78('0x13')][_0xbe78('0x14')]);}logger[_0xbe78('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4f200f,_0x288a39[_0xbe78('0x13')][_0xbe78('0x14')]);return _0x117399(_0x288a39[_0xbe78('0x13')]['message']);}else{logger[_0xbe78('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x4f200f,_0xbe78('0xf'));_0x117399(_0x288a39['result'][_0xbe78('0x14')]);}})[_0xbe78('0x15')](function(_0x45f06d){logger['error'](_0xbe78('0xe'),_0x4f200f,_0x45f06d);_0x2f7baa(_0x45f06d);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index f5b1bf6..13a06b0 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 _0xdf98=['isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf98,0xcf));var _0x8df9=function(_0x1cc060,_0x1afbdc){_0x1cc060=_0x1cc060-0x0;var _0x5c7e10=_0xdf98[_0x1cc060];return _0x5c7e10;};'use strict';var multer=require(_0x8df9('0x0'));var util=require('util');var path=require(_0x8df9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8df9('0x2')]();var fs_extra=require(_0x8df9('0x3'));var auth=require(_0x8df9('0x4'));var interaction=require(_0x8df9('0x5'));var config=require(_0x8df9('0x6'));var controller=require(_0x8df9('0x7'));router[_0x8df9('0x8')]('/',auth[_0x8df9('0x9')](),controller[_0x8df9('0xa')]);router['get'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8df9('0xd')]);router['put'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xe')]);router[_0x8df9('0xf')](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0x10')]);module[_0x8df9('0x11')]=router;
\ No newline at end of file
+var _0x6f7b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','/:id','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f7b,0x168));var _0xb6f7=function(_0x329763,_0x5a7592){_0x329763=_0x329763-0x0;var _0x4bc4f4=_0x6f7b[_0x329763];return _0x4bc4f4;};'use strict';var multer=require('multer');var util=require(_0xb6f7('0x0'));var path=require(_0xb6f7('0x1'));var timeout=require(_0xb6f7('0x2'));var express=require(_0xb6f7('0x3'));var router=express[_0xb6f7('0x4')]();var fs_extra=require(_0xb6f7('0x5'));var auth=require(_0xb6f7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb6f7('0x7'));var controller=require('./analyticMetric.controller');router[_0xb6f7('0x8')]('/',auth[_0xb6f7('0x9')](),controller[_0xb6f7('0xa')]);router[_0xb6f7('0x8')]('/:id',auth[_0xb6f7('0x9')](),controller[_0xb6f7('0xb')]);router[_0xb6f7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb6f7('0xd'),auth[_0xb6f7('0x9')](),controller[_0xb6f7('0xe')]);router[_0xb6f7('0xf')](_0xb6f7('0xd'),auth[_0xb6f7('0x9')](),controller[_0xb6f7('0x10')]);module[_0xb6f7('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 161ef42..9c216f7 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 _0xb778=['sequelize','exports','TEXT'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb778,0x1c5));var _0x8b77=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xb778[_0x143a91];return _0x1906f5;};'use strict';var Sequelize=require(_0x8b77('0x0'));module[_0x8b77('0x1')]={'tree':{'type':Sequelize[_0x8b77('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x53dd=['sequelize','exports','TEXT'];(function(_0x5467e6,_0x284a76){var _0x57cd42=function(_0x301493){while(--_0x301493){_0x5467e6['push'](_0x5467e6['shift']());}};_0x57cd42(++_0x284a76);}(_0x53dd,0x135));var _0xd53d=function(_0x2cec39,_0x1893aa){_0x2cec39=_0x2cec39-0x0;var _0x3a4ea6=_0x53dd[_0x2cec39];return _0x3a4ea6;};'use strict';var Sequelize=require(_0xd53d('0x0'));module[_0xd53d('0x1')]={'tree':{'type':Sequelize[_0xd53d('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 99d4b29..4da2363 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 _0x21ec=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes'];(function(_0x41c4c5,_0x46953c){var _0x3bd4ef=function(_0x2fd690){while(--_0x2fd690){_0x41c4c5['push'](_0x41c4c5['shift']());}};_0x3bd4ef(++_0x46953c);}(_0x21ec,0xb2));var _0xc21e=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x21ec[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc21e('0x0'));var zipdir=require(_0xc21e('0x1'));var jsonpatch=require(_0xc21e('0x2'));var rp=require('request-promise');var moment=require(_0xc21e('0x3'));var BPromise=require(_0xc21e('0x4'));var Mustache=require(_0xc21e('0x5'));var util=require(_0xc21e('0x6'));var path=require(_0xc21e('0x7'));var sox=require(_0xc21e('0x8'));var csv=require(_0xc21e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc21e('0xa'));var _=require(_0xc21e('0xb'));var squel=require(_0xc21e('0xc'));var crypto=require(_0xc21e('0xd'));var jsforce=require(_0xc21e('0xe'));var deskjs=require(_0xc21e('0xf'));var toCsv=require(_0xc21e('0x9'));var querystring=require(_0xc21e('0x10'));var Papa=require('papaparse');var Redis=require(_0xc21e('0x11'));var authService=require(_0xc21e('0x12'));var qs=require(_0xc21e('0x13'));var as=require(_0xc21e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc21e('0x15'))(_0xc21e('0x16'));var utils=require(_0xc21e('0x17'));var config=require(_0xc21e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc21e('0x19'))['db'];function respondWithStatusCode(_0x33eb3f,_0x6af8c9){_0x6af8c9=_0x6af8c9||0xcc;return function(_0x16401c){if(_0x16401c){return _0x33eb3f[_0xc21e('0x1a')](_0x6af8c9);}return _0x33eb3f['status'](_0x6af8c9)[_0xc21e('0x1b')]();};}function respondWithResult(_0xc3f443,_0x18213b){_0x18213b=_0x18213b||0xc8;return function(_0x3f234a){if(_0x3f234a){return _0xc3f443[_0xc21e('0x1c')](_0x18213b)['json'](_0x3f234a);}};}function respondWithFilteredResult(_0xfaddb2,_0x4fbed5){return function(_0xefd430){if(_0xefd430){var _0x4da0eb=typeof _0x4fbed5[_0xc21e('0x1d')]===_0xc21e('0x1e')&&typeof _0x4fbed5[_0xc21e('0x1f')]===_0xc21e('0x1e');var _0x59d5c7=_0xefd430['count'];var _0xd092df=_0x4da0eb?0x0:_0x4fbed5[_0xc21e('0x1d')];var _0x3a51aa=_0x4da0eb?_0xefd430[_0xc21e('0x20')]:_0x4fbed5['offset']+_0x4fbed5[_0xc21e('0x1f')];var _0x39249b;if(_0x3a51aa>=_0x59d5c7){_0x3a51aa=_0x59d5c7;_0x39249b=0xc8;}else{_0x39249b=0xce;}_0xfaddb2['status'](_0x39249b);return _0xfaddb2[_0xc21e('0x21')](_0xc21e('0x22'),_0xd092df+'-'+_0x3a51aa+'/'+_0x59d5c7)['json'](_0xefd430);}return null;};}function patchUpdates(_0x229102){return function(_0x14cd3f){try{jsonpatch[_0xc21e('0x23')](_0x14cd3f,_0x229102,!![]);}catch(_0x554534){return BPromise[_0xc21e('0x24')](_0x554534);}return _0x14cd3f[_0xc21e('0x25')]();};}function saveUpdates(_0xe0c810,_0x3c44bc){return function(_0x4af573){if(_0x4af573){return _0x4af573['update'](_0xe0c810)[_0xc21e('0x26')](function(_0x108f40){return _0x108f40;});}return null;};}function removeEntity(_0x1d675d,_0x4dec2d){return function(_0x828324){if(_0x828324){return _0x828324[_0xc21e('0x27')]()['then'](function(){_0x1d675d[_0xc21e('0x1c')](0xcc)[_0xc21e('0x1b')]();});}};}function handleEntityNotFound(_0x12cddf,_0x385ce3){return function(_0x178400){if(!_0x178400){_0x12cddf[_0xc21e('0x1a')](0x194);}return _0x178400;};}function handleError(_0x273bfe,_0x4416e4){_0x4416e4=_0x4416e4||0x1f4;return function(_0x2ff2c8){logger[_0xc21e('0x28')](_0x2ff2c8[_0xc21e('0x29')]);if(_0x2ff2c8[_0xc21e('0x2a')]){delete _0x2ff2c8[_0xc21e('0x2a')];}_0x273bfe[_0xc21e('0x1c')](_0x4416e4)[_0xc21e('0x2b')](_0x2ff2c8);};}exports[_0xc21e('0x2c')]=function(_0x97f908,_0x123752){var _0x500443={},_0x30ec49={},_0x19efe3={'count':0x0,'rows':[]};var _0x48a812=_[_0xc21e('0x2d')](db[_0xc21e('0x2e')][_0xc21e('0x2f')],function(_0x81650b){return{'name':_0x81650b[_0xc21e('0x30')],'type':_0x81650b['type'][_0xc21e('0x31')]};});_0x30ec49['model']=_[_0xc21e('0x2d')](_0x48a812,_0xc21e('0x2a'));_0x30ec49[_0xc21e('0x32')]=_[_0xc21e('0x33')](_0x97f908[_0xc21e('0x32')]);_0x30ec49[_0xc21e('0x34')]=_[_0xc21e('0x35')](_0x30ec49[_0xc21e('0x36')],_0x30ec49[_0xc21e('0x32')]);_0x500443[_0xc21e('0x37')]=_[_0xc21e('0x35')](_0x30ec49[_0xc21e('0x36')],qs['fields'](_0x97f908[_0xc21e('0x32')][_0xc21e('0x38')]));_0x500443[_0xc21e('0x37')]=_0x500443[_0xc21e('0x37')][_0xc21e('0x39')]?_0x500443[_0xc21e('0x37')]:_0x30ec49['model'];if(!_0x97f908[_0xc21e('0x32')][_0xc21e('0x3a')](_0xc21e('0x3b'))){_0x500443[_0xc21e('0x1f')]=qs[_0xc21e('0x1f')](_0x97f908[_0xc21e('0x32')][_0xc21e('0x1f')]);_0x500443[_0xc21e('0x1d')]=qs[_0xc21e('0x1d')](_0x97f908[_0xc21e('0x32')]['offset']);}_0x500443[_0xc21e('0x3c')]=qs['sort'](_0x97f908[_0xc21e('0x32')][_0xc21e('0x3d')]);_0x500443[_0xc21e('0x3e')]=qs['filters'](_[_0xc21e('0x3f')](_0x97f908[_0xc21e('0x32')],_0x30ec49[_0xc21e('0x34')]),_0x48a812);if(_0x97f908[_0xc21e('0x32')][_0xc21e('0x40')]){_0x500443[_0xc21e('0x3e')]=_[_0xc21e('0x41')](_0x500443[_0xc21e('0x3e')],{'$or':_[_0xc21e('0x2d')](_0x48a812,function(_0x9f6baf){if(_0x9f6baf[_0xc21e('0x42')]!==_0xc21e('0x43')){var _0x4cecfe={};_0x4cecfe[_0x9f6baf[_0xc21e('0x2a')]]={'$like':'%'+_0x97f908['query'][_0xc21e('0x40')]+'%'};return _0x4cecfe;}})});}_0x500443=_[_0xc21e('0x41')]({},_0x500443,_0x97f908[_0xc21e('0x44')]);var _0x57a598={'where':_0x500443[_0xc21e('0x3e')]};return db[_0xc21e('0x2e')]['count'](_0x57a598)['then'](function(_0x51c204){_0x19efe3[_0xc21e('0x20')]=_0x51c204;if(_0x97f908[_0xc21e('0x32')][_0xc21e('0x45')]){_0x500443[_0xc21e('0x46')]=[{'all':!![]}];}return db[_0xc21e('0x2e')]['findAll'](_0x500443);})[_0xc21e('0x26')](function(_0x3f07af){_0x19efe3[_0xc21e('0x47')]=_0x3f07af;return _0x19efe3;})['then'](respondWithFilteredResult(_0x123752,_0x500443))[_0xc21e('0x48')](handleError(_0x123752,null));};exports[_0xc21e('0x49')]=function(_0x52f509,_0x3f8daa){var _0x2a5581={'raw':!![],'where':{'id':_0x52f509[_0xc21e('0x4a')]['id']}},_0x275500={};_0x275500['model']=_['keys'](db['AnalyticTreeReport'][_0xc21e('0x2f')]);_0x275500[_0xc21e('0x32')]=_[_0xc21e('0x33')](_0x52f509[_0xc21e('0x32')]);_0x275500[_0xc21e('0x34')]=_[_0xc21e('0x35')](_0x275500[_0xc21e('0x36')],_0x275500[_0xc21e('0x32')]);_0x2a5581['attributes']=_[_0xc21e('0x35')](_0x275500['model'],qs[_0xc21e('0x38')](_0x52f509['query'][_0xc21e('0x38')]));_0x2a5581['attributes']=_0x2a5581[_0xc21e('0x37')][_0xc21e('0x39')]?_0x2a5581[_0xc21e('0x37')]:_0x275500[_0xc21e('0x36')];if(_0x52f509[_0xc21e('0x32')][_0xc21e('0x45')]){_0x2a5581[_0xc21e('0x46')]=[{'all':!![]}];}_0x2a5581=_[_0xc21e('0x41')]({},_0x2a5581,_0x52f509['options']);return db[_0xc21e('0x2e')][_0xc21e('0x4b')](_0x2a5581)[_0xc21e('0x26')](handleEntityNotFound(_0x3f8daa,null))[_0xc21e('0x26')](respondWithResult(_0x3f8daa,null))['catch'](handleError(_0x3f8daa,null));};exports[_0xc21e('0x4c')]=function(_0x507ee9,_0x3a59ad){return db['AnalyticTreeReport'][_0xc21e('0x4c')](_0x507ee9['body'],{})[_0xc21e('0x26')](respondWithResult(_0x3a59ad,0xc9))[_0xc21e('0x48')](handleError(_0x3a59ad,null));};exports['update']=function(_0x1c4707,_0x29fac4){if(_0x1c4707['body']['id']){delete _0x1c4707[_0xc21e('0x4d')]['id'];}return db[_0xc21e('0x2e')]['find']({'where':{'id':_0x1c4707[_0xc21e('0x4a')]['id']}})[_0xc21e('0x26')](handleEntityNotFound(_0x29fac4,null))['then'](saveUpdates(_0x1c4707['body'],null))[_0xc21e('0x26')](respondWithResult(_0x29fac4,null))[_0xc21e('0x48')](handleError(_0x29fac4,null));};exports['destroy']=function(_0x5dafce,_0x32a6c8){return db['AnalyticTreeReport'][_0xc21e('0x4b')]({'where':{'id':_0x5dafce['params']['id']}})[_0xc21e('0x26')](handleEntityNotFound(_0x32a6c8,null))[_0xc21e('0x26')](removeEntity(_0x32a6c8,null))[_0xc21e('0x48')](handleError(_0x32a6c8,null));};
\ No newline at end of file
+var _0xfaa0=['type','map','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xfaa0,0x148));var _0x0faa=function(_0x16eb1d,_0x12f770){_0x16eb1d=_0x16eb1d-0x0;var _0x5ed3fc=_0xfaa0[_0x16eb1d];return _0x5ed3fc;};'use strict';var emlformat=require(_0x0faa('0x0'));var rimraf=require(_0x0faa('0x1'));var zipdir=require(_0x0faa('0x2'));var jsonpatch=require(_0x0faa('0x3'));var rp=require(_0x0faa('0x4'));var moment=require(_0x0faa('0x5'));var BPromise=require(_0x0faa('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0faa('0x7'));var csv=require(_0x0faa('0x8'));var ejs=require(_0x0faa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0faa('0xa'));var squel=require(_0x0faa('0xb'));var crypto=require('crypto');var jsforce=require(_0x0faa('0xc'));var deskjs=require(_0x0faa('0xd'));var toCsv=require(_0x0faa('0x8'));var querystring=require(_0x0faa('0xe'));var Papa=require(_0x0faa('0xf'));var Redis=require(_0x0faa('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0faa('0x11'));var as=require(_0x0faa('0x12'));var hardwareService=require(_0x0faa('0x13'));var logger=require(_0x0faa('0x14'))(_0x0faa('0x15'));var utils=require(_0x0faa('0x16'));var config=require(_0x0faa('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dd86b,_0x3596b2){_0x3596b2=_0x3596b2||0xcc;return function(_0x6b4a30){if(_0x6b4a30){return _0x4dd86b['sendStatus'](_0x3596b2);}return _0x4dd86b[_0x0faa('0x18')](_0x3596b2)[_0x0faa('0x19')]();};}function respondWithResult(_0x19456c,_0x2aebc3){_0x2aebc3=_0x2aebc3||0xc8;return function(_0x12b560){if(_0x12b560){return _0x19456c[_0x0faa('0x18')](_0x2aebc3)['json'](_0x12b560);}};}function respondWithFilteredResult(_0x2ddc57,_0x3108c5){return function(_0x55c53e){if(_0x55c53e){var _0x5d4d7b=typeof _0x3108c5['offset']===_0x0faa('0x1a')&&typeof _0x3108c5[_0x0faa('0x1b')]===_0x0faa('0x1a');var _0xbec9be=_0x55c53e['count'];var _0x1f4414=_0x5d4d7b?0x0:_0x3108c5['offset'];var _0x5eaff=_0x5d4d7b?_0x55c53e[_0x0faa('0x1c')]:_0x3108c5['offset']+_0x3108c5[_0x0faa('0x1b')];var _0x316106;if(_0x5eaff>=_0xbec9be){_0x5eaff=_0xbec9be;_0x316106=0xc8;}else{_0x316106=0xce;}_0x2ddc57[_0x0faa('0x18')](_0x316106);return _0x2ddc57[_0x0faa('0x1d')](_0x0faa('0x1e'),_0x1f4414+'-'+_0x5eaff+'/'+_0xbec9be)[_0x0faa('0x1f')](_0x55c53e);}return null;};}function patchUpdates(_0x1acc38){return function(_0x547c2e){try{jsonpatch[_0x0faa('0x20')](_0x547c2e,_0x1acc38,!![]);}catch(_0x182fdc){return BPromise[_0x0faa('0x21')](_0x182fdc);}return _0x547c2e[_0x0faa('0x22')]();};}function saveUpdates(_0x1ae08e,_0x1552ca){return function(_0x22fc55){if(_0x22fc55){return _0x22fc55[_0x0faa('0x23')](_0x1ae08e)[_0x0faa('0x24')](function(_0x5512f9){return _0x5512f9;});}return null;};}function removeEntity(_0x1525aa,_0x1f881d){return function(_0x28cb16){if(_0x28cb16){return _0x28cb16[_0x0faa('0x25')]()[_0x0faa('0x24')](function(){_0x1525aa[_0x0faa('0x18')](0xcc)[_0x0faa('0x19')]();});}};}function handleEntityNotFound(_0x3c0af9,_0x4ab961){return function(_0x16b180){if(!_0x16b180){_0x3c0af9[_0x0faa('0x26')](0x194);}return _0x16b180;};}function handleError(_0x1ca407,_0x4a168c){_0x4a168c=_0x4a168c||0x1f4;return function(_0x14f0ed){logger[_0x0faa('0x27')](_0x14f0ed[_0x0faa('0x28')]);if(_0x14f0ed[_0x0faa('0x29')]){delete _0x14f0ed[_0x0faa('0x29')];}_0x1ca407[_0x0faa('0x18')](_0x4a168c)[_0x0faa('0x2a')](_0x14f0ed);};}exports[_0x0faa('0x2b')]=function(_0x50f38e,_0x1c55c6){var _0x4c69e4={},_0x1af57f={},_0x481f9b={'count':0x0,'rows':[]};var _0x41370d=_['map'](db[_0x0faa('0x2c')][_0x0faa('0x2d')],function(_0x1df311){return{'name':_0x1df311[_0x0faa('0x2e')],'type':_0x1df311[_0x0faa('0x2f')]['key']};});_0x1af57f['model']=_[_0x0faa('0x30')](_0x41370d,_0x0faa('0x29'));_0x1af57f['query']=_['keys'](_0x50f38e[_0x0faa('0x31')]);_0x1af57f[_0x0faa('0x32')]=_['intersection'](_0x1af57f[_0x0faa('0x33')],_0x1af57f[_0x0faa('0x31')]);_0x4c69e4[_0x0faa('0x34')]=_[_0x0faa('0x35')](_0x1af57f[_0x0faa('0x33')],qs[_0x0faa('0x36')](_0x50f38e['query'][_0x0faa('0x36')]));_0x4c69e4[_0x0faa('0x34')]=_0x4c69e4[_0x0faa('0x34')]['length']?_0x4c69e4[_0x0faa('0x34')]:_0x1af57f['model'];if(!_0x50f38e[_0x0faa('0x31')][_0x0faa('0x37')](_0x0faa('0x38'))){_0x4c69e4[_0x0faa('0x1b')]=qs[_0x0faa('0x1b')](_0x50f38e['query'][_0x0faa('0x1b')]);_0x4c69e4[_0x0faa('0x39')]=qs[_0x0faa('0x39')](_0x50f38e[_0x0faa('0x31')]['offset']);}_0x4c69e4[_0x0faa('0x3a')]=qs[_0x0faa('0x3b')](_0x50f38e[_0x0faa('0x31')]['sort']);_0x4c69e4[_0x0faa('0x3c')]=qs['filters'](_['pick'](_0x50f38e[_0x0faa('0x31')],_0x1af57f['filters']),_0x41370d);if(_0x50f38e[_0x0faa('0x31')][_0x0faa('0x3d')]){_0x4c69e4[_0x0faa('0x3c')]=_[_0x0faa('0x3e')](_0x4c69e4[_0x0faa('0x3c')],{'$or':_['map'](_0x41370d,function(_0x2be864){if(_0x2be864[_0x0faa('0x2f')]!==_0x0faa('0x3f')){var _0x126e68={};_0x126e68[_0x2be864[_0x0faa('0x29')]]={'$like':'%'+_0x50f38e[_0x0faa('0x31')][_0x0faa('0x3d')]+'%'};return _0x126e68;}})});}_0x4c69e4=_[_0x0faa('0x3e')]({},_0x4c69e4,_0x50f38e[_0x0faa('0x40')]);var _0x3a8597={'where':_0x4c69e4['where']};return db[_0x0faa('0x2c')][_0x0faa('0x1c')](_0x3a8597)[_0x0faa('0x24')](function(_0x424a85){_0x481f9b[_0x0faa('0x1c')]=_0x424a85;if(_0x50f38e[_0x0faa('0x31')][_0x0faa('0x41')]){_0x4c69e4[_0x0faa('0x42')]=[{'all':!![]}];}return db[_0x0faa('0x2c')][_0x0faa('0x43')](_0x4c69e4);})[_0x0faa('0x24')](function(_0x21ba07){_0x481f9b[_0x0faa('0x44')]=_0x21ba07;return _0x481f9b;})['then'](respondWithFilteredResult(_0x1c55c6,_0x4c69e4))[_0x0faa('0x45')](handleError(_0x1c55c6,null));};exports['show']=function(_0xe26019,_0x32ffaf){var _0x3dbd61={'raw':!![],'where':{'id':_0xe26019[_0x0faa('0x46')]['id']}},_0x1fd3ec={};_0x1fd3ec['model']=_['keys'](db[_0x0faa('0x2c')]['rawAttributes']);_0x1fd3ec[_0x0faa('0x31')]=_[_0x0faa('0x47')](_0xe26019[_0x0faa('0x31')]);_0x1fd3ec[_0x0faa('0x32')]=_['intersection'](_0x1fd3ec['model'],_0x1fd3ec['query']);_0x3dbd61[_0x0faa('0x34')]=_[_0x0faa('0x35')](_0x1fd3ec[_0x0faa('0x33')],qs['fields'](_0xe26019['query']['fields']));_0x3dbd61[_0x0faa('0x34')]=_0x3dbd61[_0x0faa('0x34')]['length']?_0x3dbd61[_0x0faa('0x34')]:_0x1fd3ec[_0x0faa('0x33')];if(_0xe26019[_0x0faa('0x31')][_0x0faa('0x41')]){_0x3dbd61[_0x0faa('0x42')]=[{'all':!![]}];}_0x3dbd61=_[_0x0faa('0x3e')]({},_0x3dbd61,_0xe26019['options']);return db['AnalyticTreeReport'][_0x0faa('0x48')](_0x3dbd61)[_0x0faa('0x24')](handleEntityNotFound(_0x32ffaf,null))[_0x0faa('0x24')](respondWithResult(_0x32ffaf,null))[_0x0faa('0x45')](handleError(_0x32ffaf,null));};exports[_0x0faa('0x49')]=function(_0xfb3f3d,_0x44ff5e){return db[_0x0faa('0x2c')][_0x0faa('0x49')](_0xfb3f3d[_0x0faa('0x4a')],{})[_0x0faa('0x24')](respondWithResult(_0x44ff5e,0xc9))[_0x0faa('0x45')](handleError(_0x44ff5e,null));};exports[_0x0faa('0x23')]=function(_0x40d870,_0x187064){if(_0x40d870['body']['id']){delete _0x40d870['body']['id'];}return db[_0x0faa('0x2c')][_0x0faa('0x48')]({'where':{'id':_0x40d870['params']['id']}})[_0x0faa('0x24')](handleEntityNotFound(_0x187064,null))['then'](saveUpdates(_0x40d870[_0x0faa('0x4a')],null))[_0x0faa('0x24')](respondWithResult(_0x187064,null))[_0x0faa('0x45')](handleError(_0x187064,null));};exports[_0x0faa('0x25')]=function(_0x29bfc4,_0x36ec95){return db[_0x0faa('0x2c')][_0x0faa('0x48')]({'where':{'id':_0x29bfc4[_0x0faa('0x46')]['id']}})['then'](handleEntityNotFound(_0x36ec95,null))[_0x0faa('0x24')](removeEntity(_0x36ec95,null))[_0x0faa('0x45')](handleError(_0x36ec95,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index a9f9b12..adfc100 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 _0xe2e2=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','lodash','util','../../config/logger','api','bluebird'];(function(_0x62ee48,_0x383ffc){var _0x39df44=function(_0x337e10){while(--_0x337e10){_0x62ee48['push'](_0x62ee48['shift']());}};_0x39df44(++_0x383ffc);}(_0xe2e2,0x17b));var _0x2e2e=function(_0x199c55,_0x167d19){_0x199c55=_0x199c55-0x0;var _0x592b02=_0xe2e2[_0x199c55];return _0x592b02;};'use strict';var _=require(_0x2e2e('0x0'));var util=require(_0x2e2e('0x1'));var logger=require(_0x2e2e('0x2'))(_0x2e2e('0x3'));var moment=require('moment');var BPromise=require(_0x2e2e('0x4'));var rp=require(_0x2e2e('0x5'));var fs=require('fs');var path=require(_0x2e2e('0x6'));var rimraf=require(_0x2e2e('0x7'));var config=require(_0x2e2e('0x8'));var attributes=require(_0x2e2e('0x9'));module[_0x2e2e('0xa')]=function(_0x2b76ad,_0x43d5f4){return _0x2b76ad['define']('AnalyticTreeReport',attributes,{'tableName':_0x2e2e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x88a0=['request-promise','path','rimraf','../../config/environment','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0x88a0,0x89));var _0x088a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x88a0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x088a('0x0'));var util=require(_0x088a('0x1'));var logger=require(_0x088a('0x2'))(_0x088a('0x3'));var moment=require(_0x088a('0x4'));var BPromise=require(_0x088a('0x5'));var rp=require(_0x088a('0x6'));var fs=require('fs');var path=require(_0x088a('0x7'));var rimraf=require(_0x088a('0x8'));var config=require(_0x088a('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0x088a('0xa')]=function(_0x3dc2f,_0x131d80){return _0x3dc2f[_0x088a('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x088a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 47942dc..e8b86bc 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0xadb5,0xad));var _0x5adb=function(_0x39f212,_0x26826d){_0x39f212=_0x39f212-0x0;var _0x57fd33=_0xadb5[_0x39f212];return _0x57fd33;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x22a53f,_0x135849){var _0x507733=function(_0xb0b5c){while(--_0xb0b5c){_0x22a53f['push'](_0x22a53f['shift']());}};_0x507733(++_0x135849);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2826c6,_0x481561){_0x2826c6=_0x2826c6-0x0;var _0x2f1996=_0x5f2f[_0x2826c6];return _0x2f1996;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e5163c4..39a40b1 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 _0x1d6d=['/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x290f7a,_0x45e5a6){var _0x8292c4=function(_0xb7d9f4){while(--_0xb7d9f4){_0x290f7a['push'](_0x290f7a['shift']());}};_0x8292c4(++_0x45e5a6);}(_0x1d6d,0xf8));var _0xd1d6=function(_0x7910d0,_0x171616){_0x7910d0=_0x7910d0-0x0;var _0x50c58b=_0x1d6d[_0x7910d0];return _0x50c58b;};'use strict';var multer=require(_0xd1d6('0x0'));var util=require(_0xd1d6('0x1'));var path=require('path');var timeout=require(_0xd1d6('0x2'));var express=require(_0xd1d6('0x3'));var router=express['Router']();var fs_extra=require(_0xd1d6('0x4'));var auth=require(_0xd1d6('0x5'));var interaction=require(_0xd1d6('0x6'));var config=require(_0xd1d6('0x7'));var controller=require(_0xd1d6('0x8'));router[_0xd1d6('0x9')]('/',auth[_0xd1d6('0xa')](),controller[_0xd1d6('0xb')]);router[_0xd1d6('0x9')](_0xd1d6('0xc'),auth['isAuthenticated'](),controller[_0xd1d6('0xd')]);router[_0xd1d6('0xe')]('/',auth['isAuthenticated'](),controller[_0xd1d6('0xf')]);router['put'](_0xd1d6('0xc'),auth[_0xd1d6('0xa')](),controller[_0xd1d6('0x10')]);router[_0xd1d6('0x11')](_0xd1d6('0xc'),auth[_0xd1d6('0xa')](),controller[_0xd1d6('0x12')]);module[_0xd1d6('0x13')]=router;
\ No newline at end of file
+var _0x0a19=['create','put','destroy','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x31ddba,_0x28ec26){var _0x3f014c=function(_0x24aa10){while(--_0x24aa10){_0x31ddba['push'](_0x31ddba['shift']());}};_0x3f014c(++_0x28ec26);}(_0x0a19,0xed));var _0x90a1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x0a19[_0x5f309e];return _0x487b5e;};'use strict';var multer=require('multer');var util=require(_0x90a1('0x0'));var path=require('path');var timeout=require(_0x90a1('0x1'));var express=require('express');var router=express[_0x90a1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x90a1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x90a1('0x4'));var controller=require('./analyticTreeReport.controller');router[_0x90a1('0x5')]('/',auth[_0x90a1('0x6')](),controller[_0x90a1('0x7')]);router['get'](_0x90a1('0x8'),auth[_0x90a1('0x6')](),controller[_0x90a1('0x9')]);router['post']('/',auth[_0x90a1('0x6')](),controller[_0x90a1('0xa')]);router[_0x90a1('0xb')](_0x90a1('0x8'),auth[_0x90a1('0x6')](),controller['update']);router['delete'](_0x90a1('0x8'),auth[_0x90a1('0x6')](),controller[_0x90a1('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 22acda8..a109e16 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 _0x8743=['exports','STRING','sequelize'];(function(_0x4ba3c4,_0x24842d){var _0x2b6605=function(_0xc2698f){while(--_0xc2698f){_0x4ba3c4['push'](_0x4ba3c4['shift']());}};_0x2b6605(++_0x24842d);}(_0x8743,0x7a));var _0x3874=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8743[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x3874('0x0'));module[_0x3874('0x1')]={'name':{'type':Sequelize[_0x3874('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3874('0x2')]}};
\ No newline at end of file
+var _0x4fde=['STRING','sequelize','exports'];(function(_0x47b8b9,_0x49c17a){var _0x1cc8e6=function(_0x4c7689){while(--_0x4c7689){_0x47b8b9['push'](_0x47b8b9['shift']());}};_0x1cc8e6(++_0x49c17a);}(_0x4fde,0x19f));var _0xe4fd=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x4fde[_0x5ecadc];return _0x565037;};'use strict';var Sequelize=require(_0xe4fd('0x0'));module[_0xe4fd('0x1')]={'name':{'type':Sequelize[_0xe4fd('0x2')]},'basename':{'type':Sequelize[_0xe4fd('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index a092102..c5cf6ef 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 _0x9512=['where','merge','filter','includeAll','include','findAll','rows','catch','length','options','find','clone','params','get','omit','updatedAt','body','createdAt','update','file','originalname','basename','create','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','end','error','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort'];(function(_0x52740f,_0x343961){var _0x1cbe11=function(_0x376976){while(--_0x376976){_0x52740f['push'](_0x52740f['shift']());}};_0x1cbe11(++_0x343961);}(_0x9512,0x10c));var _0x2951=function(_0x36f2b2,_0x4dea08){_0x36f2b2=_0x36f2b2-0x0;var _0x4a0f99=_0x9512[_0x36f2b2];return _0x4a0f99;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2951('0x0'));var zipdir=require(_0x2951('0x1'));var jsonpatch=require(_0x2951('0x2'));var rp=require(_0x2951('0x3'));var moment=require(_0x2951('0x4'));var BPromise=require(_0x2951('0x5'));var Mustache=require('mustache');var util=require(_0x2951('0x6'));var path=require(_0x2951('0x7'));var sox=require('sox');var csv=require(_0x2951('0x8'));var ejs=require(_0x2951('0x9'));var fs=require('fs');var fs_extra=require(_0x2951('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2951('0xb'));var deskjs=require(_0x2951('0xc'));var toCsv=require(_0x2951('0x8'));var querystring=require(_0x2951('0xd'));var Papa=require(_0x2951('0xe'));var Redis=require('ioredis');var authService=require(_0x2951('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2951('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2951('0x11'));var utils=require(_0x2951('0x12'));var config=require(_0x2951('0x13'));var licenseUtil=require(_0x2951('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5817fc,_0x49789f){_0x49789f=_0x49789f||0xcc;return function(_0x5b6ad4){if(_0x5b6ad4){return _0x5817fc[_0x2951('0x15')](_0x49789f);}return _0x5817fc[_0x2951('0x16')](_0x49789f)['end']();};}function respondWithResult(_0x4dd42b,_0x223a4d){_0x223a4d=_0x223a4d||0xc8;return function(_0x5b8789){if(_0x5b8789){return _0x4dd42b[_0x2951('0x16')](_0x223a4d)['json'](_0x5b8789);}};}function respondWithFilteredResult(_0x4c25cf,_0x2afc1e){return function(_0xae8f20){if(_0xae8f20){var _0x19d85f=typeof _0x2afc1e[_0x2951('0x17')]===_0x2951('0x18')&&typeof _0x2afc1e['limit']===_0x2951('0x18');var _0x9f560d=_0xae8f20[_0x2951('0x19')];var _0x13141a=_0x19d85f?0x0:_0x2afc1e[_0x2951('0x17')];var _0x575da8=_0x19d85f?_0xae8f20[_0x2951('0x19')]:_0x2afc1e[_0x2951('0x17')]+_0x2afc1e[_0x2951('0x1a')];var _0x152ade;if(_0x575da8>=_0x9f560d){_0x575da8=_0x9f560d;_0x152ade=0xc8;}else{_0x152ade=0xce;}_0x4c25cf[_0x2951('0x16')](_0x152ade);return _0x4c25cf[_0x2951('0x1b')](_0x2951('0x1c'),_0x13141a+'-'+_0x575da8+'/'+_0x9f560d)['json'](_0xae8f20);}return null;};}function patchUpdates(_0x4efadd){return function(_0x21f03c){try{jsonpatch[_0x2951('0x1d')](_0x21f03c,_0x4efadd,!![]);}catch(_0xafa8b9){return BPromise['reject'](_0xafa8b9);}return _0x21f03c[_0x2951('0x1e')]();};}function saveUpdates(_0x215e15,_0x2973e8){return function(_0x1e7234){if(_0x1e7234){return _0x1e7234['update'](_0x215e15)[_0x2951('0x1f')](function(_0x3e5e3d){return _0x3e5e3d;});}return null;};}function removeEntity(_0x491411,_0x4e4936){return function(_0x794f5){if(_0x794f5){return _0x794f5[_0x2951('0x20')]()[_0x2951('0x1f')](function(){_0x491411[_0x2951('0x16')](0xcc)[_0x2951('0x21')]();});}};}function handleEntityNotFound(_0x2acf63,_0x3af701){return function(_0x5c4987){if(!_0x5c4987){_0x2acf63[_0x2951('0x15')](0x194);}return _0x5c4987;};}function handleError(_0x10fefd,_0x5204f3){_0x5204f3=_0x5204f3||0x1f4;return function(_0x55e129){logger[_0x2951('0x22')](_0x55e129['stack']);if(_0x55e129[_0x2951('0x23')]){delete _0x55e129[_0x2951('0x23')];}_0x10fefd['status'](_0x5204f3)['send'](_0x55e129);};}exports[_0x2951('0x24')]=function(_0x3f2e74,_0x124c8b){var _0x3f936e={},_0x258be7={},_0x30fd2a={'count':0x0,'rows':[]};var _0x12c2f9=_['map'](db[_0x2951('0x25')][_0x2951('0x26')],function(_0x469270){return{'name':_0x469270[_0x2951('0x27')],'type':_0x469270[_0x2951('0x28')][_0x2951('0x29')]};});_0x258be7[_0x2951('0x2a')]=_[_0x2951('0x2b')](_0x12c2f9,'name');_0x258be7['query']=_[_0x2951('0x2c')](_0x3f2e74[_0x2951('0x2d')]);_0x258be7[_0x2951('0x2e')]=_[_0x2951('0x2f')](_0x258be7[_0x2951('0x2a')],_0x258be7[_0x2951('0x2d')]);_0x3f936e[_0x2951('0x30')]=_[_0x2951('0x2f')](_0x258be7['model'],qs[_0x2951('0x31')](_0x3f2e74[_0x2951('0x2d')][_0x2951('0x31')]));_0x3f936e[_0x2951('0x30')]=_0x3f936e[_0x2951('0x30')]['length']?_0x3f936e[_0x2951('0x30')]:_0x258be7['model'];if(!_0x3f2e74['query'][_0x2951('0x32')]('nolimit')){_0x3f936e[_0x2951('0x1a')]=qs[_0x2951('0x1a')](_0x3f2e74[_0x2951('0x2d')]['limit']);_0x3f936e[_0x2951('0x17')]=qs['offset'](_0x3f2e74[_0x2951('0x2d')]['offset']);}_0x3f936e['order']=qs[_0x2951('0x33')](_0x3f2e74[_0x2951('0x2d')][_0x2951('0x33')]);_0x3f936e[_0x2951('0x34')]=qs[_0x2951('0x2e')](_['pick'](_0x3f2e74[_0x2951('0x2d')],_0x258be7['filters']),_0x12c2f9);if(_0x3f2e74['query']['filter']){_0x3f936e[_0x2951('0x34')]=_[_0x2951('0x35')](_0x3f936e['where'],{'$or':_[_0x2951('0x2b')](_0x12c2f9,function(_0x5f2dd3){if(_0x5f2dd3[_0x2951('0x28')]!=='VIRTUAL'){var _0x565832={};_0x565832[_0x5f2dd3[_0x2951('0x23')]]={'$like':'%'+_0x3f2e74[_0x2951('0x2d')][_0x2951('0x36')]+'%'};return _0x565832;}})});}_0x3f936e=_['merge']({},_0x3f936e,_0x3f2e74['options']);var _0x19b3f9={'where':_0x3f936e['where']};return db[_0x2951('0x25')][_0x2951('0x19')](_0x19b3f9)[_0x2951('0x1f')](function(_0xfb67dc){_0x30fd2a[_0x2951('0x19')]=_0xfb67dc;if(_0x3f2e74[_0x2951('0x2d')][_0x2951('0x37')]){_0x3f936e[_0x2951('0x38')]=[{'all':!![]}];}return db[_0x2951('0x25')][_0x2951('0x39')](_0x3f936e);})[_0x2951('0x1f')](function(_0x55ccab){_0x30fd2a[_0x2951('0x3a')]=_0x55ccab;return _0x30fd2a;})[_0x2951('0x1f')](respondWithFilteredResult(_0x124c8b,_0x3f936e))[_0x2951('0x3b')](handleError(_0x124c8b,null));};exports['show']=function(_0x24fc13,_0x30b045){var _0x2fb0a4={'raw':!![],'where':{'id':_0x24fc13['params']['id']}},_0x569772={};_0x569772[_0x2951('0x2a')]=_['keys'](db[_0x2951('0x25')][_0x2951('0x26')]);_0x569772[_0x2951('0x2d')]=_['keys'](_0x24fc13[_0x2951('0x2d')]);_0x569772[_0x2951('0x2e')]=_[_0x2951('0x2f')](_0x569772['model'],_0x569772['query']);_0x2fb0a4[_0x2951('0x30')]=_[_0x2951('0x2f')](_0x569772['model'],qs[_0x2951('0x31')](_0x24fc13[_0x2951('0x2d')][_0x2951('0x31')]));_0x2fb0a4[_0x2951('0x30')]=_0x2fb0a4[_0x2951('0x30')][_0x2951('0x3c')]?_0x2fb0a4[_0x2951('0x30')]:_0x569772[_0x2951('0x2a')];if(_0x24fc13[_0x2951('0x2d')][_0x2951('0x37')]){_0x2fb0a4[_0x2951('0x38')]=[{'all':!![]}];}_0x2fb0a4=_[_0x2951('0x35')]({},_0x2fb0a4,_0x24fc13[_0x2951('0x3d')]);return db[_0x2951('0x25')][_0x2951('0x3e')](_0x2fb0a4)[_0x2951('0x1f')](handleEntityNotFound(_0x30b045,null))[_0x2951('0x1f')](respondWithResult(_0x30b045,null))['catch'](handleError(_0x30b045,null));};exports[_0x2951('0x3f')]=function(_0x2917c1,_0x504aa6){var _0x4af606={'where':{'id':_0x2917c1[_0x2951('0x40')]['id']}},_0x54972a={};_0x54972a[_0x2951('0x2a')]=_[_0x2951('0x2c')](db[_0x2951('0x25')][_0x2951('0x26')]);_0x4af606['attributes']=_[_0x2951('0x2f')](_0x54972a[_0x2951('0x2a')],qs['fields'](_0x2917c1['query'][_0x2951('0x31')]));_0x4af606[_0x2951('0x30')]=_0x4af606['attributes']['length']?_0x4af606['attributes']:_0x54972a['model'];if(_0x2917c1[_0x2951('0x2d')][_0x2951('0x37')]){_0x4af606['include']=[{'all':!![]}];}_0x4af606=_['merge']({},_0x4af606,_0x2917c1['options']);return db[_0x2951('0x25')][_0x2951('0x3e')](_0x4af606)[_0x2951('0x1f')](handleEntityNotFound(_0x504aa6,null))[_0x2951('0x1f')](function(_0x3a0d3e){if(_0x3a0d3e){var _0x420b6=_0x3a0d3e[_0x2951('0x41')]({'plain':!![]});_0x420b6=qs[_0x2951('0x42')](_0x420b6,['id','createdAt',_0x2951('0x43')]);_0x2917c1[_0x2951('0x44')]=_[_0x2951('0x42')](_0x2917c1[_0x2951('0x44')],['id',_0x2951('0x45'),_0x2951('0x43')]);return db[_0x2951('0x25')]['create'](_[_0x2951('0x35')](_0x420b6,_0x2917c1[_0x2951('0x44')]),{'include':_0x2917c1[_0x2951('0x2d')][_0x2951('0x37')]?[{'all':!![]}]:undefined});}})[_0x2951('0x1f')](respondWithResult(_0x504aa6,0xc9))['catch'](handleError(_0x504aa6,null));};exports[_0x2951('0x46')]=function(_0x1657fb,_0x3a86ff){if(_0x1657fb[_0x2951('0x44')]['id']){delete _0x1657fb[_0x2951('0x44')]['id'];}return db[_0x2951('0x25')]['find']({'where':{'id':_0x1657fb[_0x2951('0x40')]['id']}})[_0x2951('0x1f')](handleEntityNotFound(_0x3a86ff,null))[_0x2951('0x1f')](saveUpdates(_0x1657fb[_0x2951('0x44')],null))['then'](respondWithResult(_0x3a86ff,null))[_0x2951('0x3b')](handleError(_0x3a86ff,null));};exports[_0x2951('0x20')]=function(_0x3c675,_0x49a66e){return db[_0x2951('0x25')][_0x2951('0x3e')]({'where':{'id':_0x3c675['params']['id']}})['then'](handleEntityNotFound(_0x49a66e,null))['then'](removeEntity(_0x49a66e,null))[_0x2951('0x3b')](handleError(_0x49a66e,null));};exports['create']=function(_0x399132,_0x2e563c,_0x326b43){_0x399132[_0x2951('0x44')][_0x2951('0x23')]=_0x399132[_0x2951('0x47')][_0x2951('0x48')];_0x399132['body'][_0x2951('0x49')]=_0x399132[_0x2951('0x47')]['filename'];_0x399132[_0x2951('0x44')]['type']=_0x399132[_0x2951('0x47')]['mimetype'];return db[_0x2951('0x25')][_0x2951('0x4a')](_0x399132['body'])[_0x2951('0x1f')](respondWithResult(_0x2e563c,0xc9))[_0x2951('0x3b')](handleError(_0x2e563c,null));};exports[_0x2951('0x4b')]=function(_0x4745bf,_0x1937ca,_0xd070ce){return db[_0x2951('0x25')][_0x2951('0x4c')]({'where':{'id':_0x4745bf['params']['id']},'raw':!![]})[_0x2951('0x1f')](handleEntityNotFound(_0x1937ca,null))[_0x2951('0x1f')](function(_0x520998){if(_0x520998){var _0x37d85f=_0x520998[_0x2951('0x4d')]!==null;var _0x3e778e=path['join'](config['root'],_0x2951('0x4e'));if(_0x37d85f){_0x3e778e=path[_0x2951('0x4f')](_0x3e778e,'offline-chat/');}var _0x49ceb4=path[_0x2951('0x4f')](_0x3e778e,_0x520998[_0x2951('0x49')]);return _0x1937ca['download'](_0x49ceb4);}})[_0x2951('0x3b')](handleError(_0x1937ca,null));};
\ No newline at end of file
+var _0xd33f=['path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','Content-Range','json','reject','save','update','destroy','error','stack','name','index','map','Attachment','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','then','findAll','rows','catch','rawAttributes','keys','includeAll','include','find','clone','params','get','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','fast-json-patch','moment','bluebird','util'];(function(_0x3c0569,_0x11da9f){var _0x142524=function(_0x59a41e){while(--_0x59a41e){_0x3c0569['push'](_0x3c0569['shift']());}};_0x142524(++_0x11da9f);}(_0xd33f,0x1f2));var _0xfd33=function(_0x461250,_0x5ea58e){_0x461250=_0x461250-0x0;var _0x1eb54e=_0xd33f[_0x461250];return _0x1eb54e;};'use strict';var emlformat=require(_0xfd33('0x0'));var rimraf=require(_0xfd33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd33('0x2'));var rp=require('request-promise');var moment=require(_0xfd33('0x3'));var BPromise=require(_0xfd33('0x4'));var Mustache=require('mustache');var util=require(_0xfd33('0x5'));var path=require(_0xfd33('0x6'));var sox=require(_0xfd33('0x7'));var csv=require('to-csv');var ejs=require(_0xfd33('0x8'));var fs=require('fs');var fs_extra=require(_0xfd33('0x9'));var _=require(_0xfd33('0xa'));var squel=require(_0xfd33('0xb'));var crypto=require('crypto');var jsforce=require(_0xfd33('0xc'));var deskjs=require(_0xfd33('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfd33('0xe'));var Papa=require(_0xfd33('0xf'));var Redis=require('ioredis');var authService=require(_0xfd33('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd33('0x11'));var logger=require(_0xfd33('0x12'))('api');var utils=require(_0xfd33('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfd33('0x14'));var db=require(_0xfd33('0x15'))['db'];function respondWithStatusCode(_0xd85b6a,_0x371b0a){_0x371b0a=_0x371b0a||0xcc;return function(_0x4ec43f){if(_0x4ec43f){return _0xd85b6a[_0xfd33('0x16')](_0x371b0a);}return _0xd85b6a['status'](_0x371b0a)[_0xfd33('0x17')]();};}function respondWithResult(_0x2aaa7c,_0x4ecbac){_0x4ecbac=_0x4ecbac||0xc8;return function(_0x1bd94a){if(_0x1bd94a){return _0x2aaa7c[_0xfd33('0x18')](_0x4ecbac)['json'](_0x1bd94a);}};}function respondWithFilteredResult(_0x40c6a3,_0x19c547){return function(_0x452873){if(_0x452873){var _0x5cc1a1=typeof _0x19c547[_0xfd33('0x19')]===_0xfd33('0x1a')&&typeof _0x19c547['limit']===_0xfd33('0x1a');var _0x1cf7c3=_0x452873['count'];var _0x17ebcb=_0x5cc1a1?0x0:_0x19c547[_0xfd33('0x19')];var _0x3ba000=_0x5cc1a1?_0x452873[_0xfd33('0x1b')]:_0x19c547[_0xfd33('0x19')]+_0x19c547['limit'];var _0x56e523;if(_0x3ba000>=_0x1cf7c3){_0x3ba000=_0x1cf7c3;_0x56e523=0xc8;}else{_0x56e523=0xce;}_0x40c6a3[_0xfd33('0x18')](_0x56e523);return _0x40c6a3['set'](_0xfd33('0x1c'),_0x17ebcb+'-'+_0x3ba000+'/'+_0x1cf7c3)[_0xfd33('0x1d')](_0x452873);}return null;};}function patchUpdates(_0x50935c){return function(_0x355e7b){try{jsonpatch['apply'](_0x355e7b,_0x50935c,!![]);}catch(_0x154234){return BPromise[_0xfd33('0x1e')](_0x154234);}return _0x355e7b[_0xfd33('0x1f')]();};}function saveUpdates(_0x47bcf5,_0x434d83){return function(_0x3820f4){if(_0x3820f4){return _0x3820f4[_0xfd33('0x20')](_0x47bcf5)['then'](function(_0x4f4282){return _0x4f4282;});}return null;};}function removeEntity(_0x5c1bc7,_0x45b3d5){return function(_0x4cb835){if(_0x4cb835){return _0x4cb835[_0xfd33('0x21')]()['then'](function(){_0x5c1bc7[_0xfd33('0x18')](0xcc)[_0xfd33('0x17')]();});}};}function handleEntityNotFound(_0x2bcdbc,_0x171d70){return function(_0x125999){if(!_0x125999){_0x2bcdbc[_0xfd33('0x16')](0x194);}return _0x125999;};}function handleError(_0x4805eb,_0x24289b){_0x24289b=_0x24289b||0x1f4;return function(_0x273896){logger[_0xfd33('0x22')](_0x273896[_0xfd33('0x23')]);if(_0x273896[_0xfd33('0x24')]){delete _0x273896[_0xfd33('0x24')];}_0x4805eb[_0xfd33('0x18')](_0x24289b)['send'](_0x273896);};}exports[_0xfd33('0x25')]=function(_0x9ea675,_0x50211e){var _0xc63941={},_0x13cc76={},_0x36fe2a={'count':0x0,'rows':[]};var _0x47b641=_[_0xfd33('0x26')](db[_0xfd33('0x27')]['rawAttributes'],function(_0x2b0a32){return{'name':_0x2b0a32[_0xfd33('0x28')],'type':_0x2b0a32[_0xfd33('0x29')][_0xfd33('0x2a')]};});_0x13cc76['model']=_[_0xfd33('0x26')](_0x47b641,'name');_0x13cc76[_0xfd33('0x2b')]=_['keys'](_0x9ea675[_0xfd33('0x2b')]);_0x13cc76[_0xfd33('0x2c')]=_[_0xfd33('0x2d')](_0x13cc76[_0xfd33('0x2e')],_0x13cc76[_0xfd33('0x2b')]);_0xc63941[_0xfd33('0x2f')]=_['intersection'](_0x13cc76[_0xfd33('0x2e')],qs[_0xfd33('0x30')](_0x9ea675[_0xfd33('0x2b')][_0xfd33('0x30')]));_0xc63941[_0xfd33('0x2f')]=_0xc63941[_0xfd33('0x2f')][_0xfd33('0x31')]?_0xc63941[_0xfd33('0x2f')]:_0x13cc76[_0xfd33('0x2e')];if(!_0x9ea675[_0xfd33('0x2b')][_0xfd33('0x32')](_0xfd33('0x33'))){_0xc63941[_0xfd33('0x34')]=qs[_0xfd33('0x34')](_0x9ea675[_0xfd33('0x2b')][_0xfd33('0x34')]);_0xc63941[_0xfd33('0x19')]=qs[_0xfd33('0x19')](_0x9ea675['query']['offset']);}_0xc63941['order']=qs[_0xfd33('0x35')](_0x9ea675[_0xfd33('0x2b')][_0xfd33('0x35')]);_0xc63941[_0xfd33('0x36')]=qs[_0xfd33('0x2c')](_[_0xfd33('0x37')](_0x9ea675[_0xfd33('0x2b')],_0x13cc76[_0xfd33('0x2c')]),_0x47b641);if(_0x9ea675[_0xfd33('0x2b')][_0xfd33('0x38')]){_0xc63941[_0xfd33('0x36')]=_[_0xfd33('0x39')](_0xc63941[_0xfd33('0x36')],{'$or':_[_0xfd33('0x26')](_0x47b641,function(_0x23e096){if(_0x23e096[_0xfd33('0x29')]!=='VIRTUAL'){var _0x1782b3={};_0x1782b3[_0x23e096[_0xfd33('0x24')]]={'$like':'%'+_0x9ea675[_0xfd33('0x2b')][_0xfd33('0x38')]+'%'};return _0x1782b3;}})});}_0xc63941=_[_0xfd33('0x39')]({},_0xc63941,_0x9ea675[_0xfd33('0x3a')]);var _0x53ce88={'where':_0xc63941['where']};return db[_0xfd33('0x27')]['count'](_0x53ce88)[_0xfd33('0x3b')](function(_0x2f055c){_0x36fe2a[_0xfd33('0x1b')]=_0x2f055c;if(_0x9ea675['query']['includeAll']){_0xc63941['include']=[{'all':!![]}];}return db[_0xfd33('0x27')][_0xfd33('0x3c')](_0xc63941);})[_0xfd33('0x3b')](function(_0x5d9859){_0x36fe2a[_0xfd33('0x3d')]=_0x5d9859;return _0x36fe2a;})[_0xfd33('0x3b')](respondWithFilteredResult(_0x50211e,_0xc63941))[_0xfd33('0x3e')](handleError(_0x50211e,null));};exports['show']=function(_0x937ad3,_0x47cef1){var _0x983b8a={'raw':!![],'where':{'id':_0x937ad3['params']['id']}},_0x294cfc={};_0x294cfc[_0xfd33('0x2e')]=_['keys'](db[_0xfd33('0x27')][_0xfd33('0x3f')]);_0x294cfc[_0xfd33('0x2b')]=_[_0xfd33('0x40')](_0x937ad3['query']);_0x294cfc[_0xfd33('0x2c')]=_[_0xfd33('0x2d')](_0x294cfc[_0xfd33('0x2e')],_0x294cfc[_0xfd33('0x2b')]);_0x983b8a[_0xfd33('0x2f')]=_[_0xfd33('0x2d')](_0x294cfc[_0xfd33('0x2e')],qs[_0xfd33('0x30')](_0x937ad3[_0xfd33('0x2b')][_0xfd33('0x30')]));_0x983b8a[_0xfd33('0x2f')]=_0x983b8a['attributes'][_0xfd33('0x31')]?_0x983b8a['attributes']:_0x294cfc[_0xfd33('0x2e')];if(_0x937ad3[_0xfd33('0x2b')][_0xfd33('0x41')]){_0x983b8a[_0xfd33('0x42')]=[{'all':!![]}];}_0x983b8a=_[_0xfd33('0x39')]({},_0x983b8a,_0x937ad3[_0xfd33('0x3a')]);return db[_0xfd33('0x27')][_0xfd33('0x43')](_0x983b8a)[_0xfd33('0x3b')](handleEntityNotFound(_0x47cef1,null))[_0xfd33('0x3b')](respondWithResult(_0x47cef1,null))[_0xfd33('0x3e')](handleError(_0x47cef1,null));};exports[_0xfd33('0x44')]=function(_0xfeeb57,_0x108966){var _0x7e5b61={'where':{'id':_0xfeeb57[_0xfd33('0x45')]['id']}},_0x4a7c9f={};_0x4a7c9f[_0xfd33('0x2e')]=_[_0xfd33('0x40')](db[_0xfd33('0x27')]['rawAttributes']);_0x7e5b61[_0xfd33('0x2f')]=_[_0xfd33('0x2d')](_0x4a7c9f[_0xfd33('0x2e')],qs[_0xfd33('0x30')](_0xfeeb57[_0xfd33('0x2b')]['fields']));_0x7e5b61['attributes']=_0x7e5b61['attributes']['length']?_0x7e5b61[_0xfd33('0x2f')]:_0x4a7c9f['model'];if(_0xfeeb57[_0xfd33('0x2b')][_0xfd33('0x41')]){_0x7e5b61['include']=[{'all':!![]}];}_0x7e5b61=_[_0xfd33('0x39')]({},_0x7e5b61,_0xfeeb57['options']);return db[_0xfd33('0x27')]['find'](_0x7e5b61)['then'](handleEntityNotFound(_0x108966,null))[_0xfd33('0x3b')](function(_0x290eba){if(_0x290eba){var _0x2acc10=_0x290eba[_0xfd33('0x46')]({'plain':!![]});_0x2acc10=qs['omit'](_0x2acc10,['id',_0xfd33('0x47'),_0xfd33('0x48')]);_0xfeeb57['body']=_['omit'](_0xfeeb57[_0xfd33('0x49')],['id',_0xfd33('0x47'),'updatedAt']);return db[_0xfd33('0x27')]['create'](_[_0xfd33('0x39')](_0x2acc10,_0xfeeb57[_0xfd33('0x49')]),{'include':_0xfeeb57[_0xfd33('0x2b')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xfd33('0x3b')](respondWithResult(_0x108966,0xc9))[_0xfd33('0x3e')](handleError(_0x108966,null));};exports['update']=function(_0x491b1c,_0x4ca087){if(_0x491b1c[_0xfd33('0x49')]['id']){delete _0x491b1c[_0xfd33('0x49')]['id'];}return db[_0xfd33('0x27')][_0xfd33('0x43')]({'where':{'id':_0x491b1c[_0xfd33('0x45')]['id']}})[_0xfd33('0x3b')](handleEntityNotFound(_0x4ca087,null))[_0xfd33('0x3b')](saveUpdates(_0x491b1c[_0xfd33('0x49')],null))[_0xfd33('0x3b')](respondWithResult(_0x4ca087,null))['catch'](handleError(_0x4ca087,null));};exports[_0xfd33('0x21')]=function(_0x5e1484,_0xd38f93){return db[_0xfd33('0x27')][_0xfd33('0x43')]({'where':{'id':_0x5e1484[_0xfd33('0x45')]['id']}})['then'](handleEntityNotFound(_0xd38f93,null))[_0xfd33('0x3b')](removeEntity(_0xd38f93,null))[_0xfd33('0x3e')](handleError(_0xd38f93,null));};exports[_0xfd33('0x4a')]=function(_0xfea2b7,_0x229620,_0x1d73e5){_0xfea2b7['body']['name']=_0xfea2b7[_0xfd33('0x4b')]['originalname'];_0xfea2b7['body'][_0xfd33('0x4c')]=_0xfea2b7['file'][_0xfd33('0x4d')];_0xfea2b7[_0xfd33('0x49')]['type']=_0xfea2b7['file'][_0xfd33('0x4e')];return db['Attachment'][_0xfd33('0x4a')](_0xfea2b7['body'])[_0xfd33('0x3b')](respondWithResult(_0x229620,0xc9))[_0xfd33('0x3e')](handleError(_0x229620,null));};exports[_0xfd33('0x4f')]=function(_0x1c9a7e,_0x5beff9,_0x5db0e0){return db[_0xfd33('0x27')]['findOne']({'where':{'id':_0x1c9a7e[_0xfd33('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5beff9,null))[_0xfd33('0x3b')](function(_0x50c88d){if(_0x50c88d){var _0x5c0430=_0x50c88d[_0xfd33('0x50')]!==null;var _0x1bb1e2=path['join'](config[_0xfd33('0x51')],'server/files/attachments/');if(_0x5c0430){_0x1bb1e2=path[_0xfd33('0x52')](_0x1bb1e2,_0xfd33('0x53'));}var _0x13c425=path['join'](_0x1bb1e2,_0x50c88d[_0xfd33('0x4c')]);return _0x5beff9[_0xfd33('0x4f')](_0x13c425);}})[_0xfd33('0x3e')](handleError(_0x5beff9,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 8e5eb5a..7e187d7 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 _0x4db4=['../../config/logger','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','attachments','lodash','util'];(function(_0x11973d,_0x68c443){var _0x2875e3=function(_0x597cda){while(--_0x597cda){_0x11973d['push'](_0x11973d['shift']());}};_0x2875e3(++_0x68c443);}(_0x4db4,0x120));var _0x44db=function(_0x290cd2,_0x3c81cc){_0x290cd2=_0x290cd2-0x0;var _0x572a5d=_0x4db4[_0x290cd2];return _0x572a5d;};'use strict';var _=require(_0x44db('0x0'));var util=require(_0x44db('0x1'));var logger=require(_0x44db('0x2'))('api');var moment=require('moment');var BPromise=require(_0x44db('0x3'));var rp=require(_0x44db('0x4'));var fs=require('fs');var path=require(_0x44db('0x5'));var rimraf=require('rimraf');var config=require(_0x44db('0x6'));var attributes=require(_0x44db('0x7'));module[_0x44db('0x8')]=function(_0x5cebe8,_0x1892ce){return _0x5cebe8['define']('Attachment',attributes,{'tableName':_0x44db('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8867=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','Attachment','attachments','lodash','util'];(function(_0x1475f6,_0x723bfb){var _0x24afd0=function(_0x4b71d8){while(--_0x4b71d8){_0x1475f6['push'](_0x1475f6['shift']());}};_0x24afd0(++_0x723bfb);}(_0x8867,0x106));var _0x7886=function(_0x2020ea,_0x26fc4f){_0x2020ea=_0x2020ea-0x0;var _0x3657fe=_0x8867[_0x2020ea];return _0x3657fe;};'use strict';var _=require(_0x7886('0x0'));var util=require(_0x7886('0x1'));var logger=require(_0x7886('0x2'))(_0x7886('0x3'));var moment=require(_0x7886('0x4'));var BPromise=require(_0x7886('0x5'));var rp=require(_0x7886('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7886('0x7'));var config=require(_0x7886('0x8'));var attributes=require('./attachment.attributes');module['exports']=function(_0x320ad2,_0x509a27){return _0x320ad2['define'](_0x7886('0x9'),attributes,{'tableName':_0x7886('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 0d01780..e4e9010 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 _0x9567=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateAttachment','create','options','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x16f143,_0x813860){var _0x1fff62=function(_0x39edce){while(--_0x39edce){_0x16f143['push'](_0x16f143['shift']());}};_0x1fff62(++_0x813860);}(_0x9567,0xdc));var _0x7956=function(_0x227c3a,_0x44efb){_0x227c3a=_0x227c3a-0x0;var _0x1535e8=_0x9567[_0x227c3a];return _0x1535e8;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('Attachment,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});}exports[_0x7956('0x15')]=function(_0x5e6b90){var _0x5c3afb=this;return new Promise(function(_0x10b29c,_0x811122){return db['Attachment'][_0x7956('0x16')](_0x5e6b90['body'],{'raw':_0x5e6b90[_0x7956('0x17')]?_0x5e6b90[_0x7956('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7956('0xa')](function(_0x2e31cd){logger[_0x7956('0xb')]('CreateAttachment',_0x5e6b90);logger[_0x7956('0xd')]('CreateAttachment',_0x5e6b90,JSON[_0x7956('0x18')](_0x2e31cd));_0x10b29c(_0x2e31cd);})['catch'](function(_0x427500){logger[_0x7956('0x10')](_0x7956('0x15'),_0x427500[_0x7956('0x12')],_0x5e6b90);_0x811122(_0x5c3afb['error'](0x1f4,_0x427500[_0x7956('0x12')]));});});};
\ No newline at end of file
+var _0x3e25=['request\x20sent','debug','code','error','message','CreateAttachment','Attachment','body','raw','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x4a4668,_0x5d41a1){var _0x3480b6=function(_0x379774){while(--_0x379774){_0x4a4668['push'](_0x4a4668['shift']());}};_0x3480b6(++_0x5d41a1);}(_0x3e25,0x14f));var _0x53e2=function(_0x58afd6,_0x2718ca){_0x58afd6=_0x58afd6-0x0;var _0x325675=_0x3e25[_0x58afd6];return _0x325675;};'use strict';var _=require(_0x53e2('0x0'));var util=require(_0x53e2('0x1'));var moment=require(_0x53e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x53e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x53e2('0x5'))(_0x53e2('0x6'));var config=require(_0x53e2('0x7'));var jayson=require(_0x53e2('0x8'));var client=jayson[_0x53e2('0x9')][_0x53e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1905b4,_0x31c0fa,_0x431bee){return new BPromise(function(_0x1be9ef,_0xf13761){return client[_0x53e2('0xb')](_0x1905b4,_0x431bee)[_0x53e2('0xc')](function(_0x1570dc){logger[_0x53e2('0xd')](_0x53e2('0xe'),_0x31c0fa,_0x53e2('0xf'));logger[_0x53e2('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x31c0fa,_0x53e2('0xf'),JSON['stringify'](_0x1570dc));if(_0x1570dc['error']){if(_0x1570dc['error'][_0x53e2('0x11')]===0x1f4){logger[_0x53e2('0x12')](_0x53e2('0xe'),_0x31c0fa,_0x1570dc[_0x53e2('0x12')][_0x53e2('0x13')]);return _0xf13761(_0x1570dc[_0x53e2('0x12')][_0x53e2('0x13')]);}logger[_0x53e2('0x12')](_0x53e2('0xe'),_0x31c0fa,_0x1570dc['error'][_0x53e2('0x13')]);return _0x1be9ef(_0x1570dc[_0x53e2('0x12')][_0x53e2('0x13')]);}else{logger[_0x53e2('0xd')](_0x53e2('0xe'),_0x31c0fa,_0x53e2('0xf'));_0x1be9ef(_0x1570dc['result'][_0x53e2('0x13')]);}})['catch'](function(_0x33b1cb){logger[_0x53e2('0x12')](_0x53e2('0xe'),_0x31c0fa,_0x33b1cb);_0xf13761(_0x33b1cb);});});}exports[_0x53e2('0x14')]=function(_0x52bae6){var _0x4213d0=this;return new Promise(function(_0x323e53,_0x4f313a){return db[_0x53e2('0x15')]['create'](_0x52bae6[_0x53e2('0x16')],{'raw':_0x52bae6['options']?_0x52bae6['options'][_0x53e2('0x17')]===undefined?!![]:![]:!![]})[_0x53e2('0xc')](function(_0x3454c9){logger[_0x53e2('0xd')]('CreateAttachment',_0x52bae6);logger[_0x53e2('0x10')](_0x53e2('0x14'),_0x52bae6,JSON['stringify'](_0x3454c9));_0x323e53(_0x3454c9);})[_0x53e2('0x18')](function(_0x51be71){logger[_0x53e2('0x12')](_0x53e2('0x14'),_0x51be71['message'],_0x52bae6);_0x4f313a(_0x4213d0[_0x53e2('0x12')](0x1f4,_0x51be71[_0x53e2('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 6badcea..e5d1b43 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x5dcca0,_0x2e3385){var _0x522285=function(_0x1f36e0){while(--_0x1f36e0){_0x5dcca0['push'](_0x5dcca0['shift']());}};_0x522285(++_0x2e3385);}(_0xadb5,0xad));var _0x5adb=function(_0x5b45d9,_0x5cd565){_0x5b45d9=_0x5b45d9-0x0;var _0x13f65f=_0xadb5[_0x5b45d9];return _0x13f65f;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x4557b4,_0x753ab5){var _0x1a71a1=function(_0x3733d9){while(--_0x3733d9){_0x4557b4['push'](_0x4557b4['shift']());}};_0x1a71a1(++_0x753ab5);}(_0xb10b,0x12a));var _0xbb10=function(_0x141908,_0x4e61dc){_0x141908=_0x141908-0x0;var _0x37e9c9=_0xb10b[_0x141908];return _0x37e9c9;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 39d5733..93a5643 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 _0xa894=['disabled','online','admin','user','agent','then','blockDuration','blockedAt','add','getLicense','catch','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','passport','passport-local','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa894,0x1d6));var _0x4a89=function(_0x5d8987,_0x14d054){_0x5d8987=_0x5d8987-0x0;var _0x2997eb=_0xa894[_0x5d8987];return _0x2997eb;};'use strict';var passport=require(_0x4a89('0x0'));var LocalStrategy=require(_0x4a89('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x4a89('0x2'));var BPromise=require(_0x4a89('0x3'));var util=require(_0x4a89('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x4a89('0x5'));var utils=require(_0x4a89('0x6'));var config=require(_0x4a89('0x7'));var logger=require('../../config/logger')(_0x4a89('0x8'));function isActiveDirectoryConfigured(_0xe7bb63){var _0x7ddb6c=![];if(typeof _0xe7bb63[_0x4a89('0x9')]!==_0x4a89('0xa')){_0x7ddb6c=_0xe7bb63[_0x4a89('0x9')][_0x4a89('0xb')]&&_0xe7bb63[_0x4a89('0x9')]['url']&&_0xe7bb63['activedirectory'][_0x4a89('0xc')];}return _0x7ddb6c;}function adAuthenticate(_0x72d745,_0x1d21eb,_0xe47002){return new BPromise(function(_0x562940,_0x3b429f){try{var _0x109180=new ActiveDirectory(_0x72d745);_0x109180['authenticate'](_0x1d21eb,_0xe47002,function(_0x26cc65,_0x5530d3){if(_0x26cc65){logger[_0x4a89('0xd')](_0x4a89('0xe'),_0x1d21eb,util[_0x4a89('0xf')](_0x26cc65,{'showHidden':![],'depth':null}));_0x3b429f(_0x4a89('0x10'));}else if(!_0x5530d3){logger[_0x4a89('0xd')](_0x4a89('0x11'),_0x1d21eb);_0x3b429f(_0x4a89('0x10'));}else{_0x562940(_0x5530d3);}});}catch(_0x4b1c63){_0x3b429f(_0x4b1c63);}});}function ActiveDirectoryAuthenticate(_0x4a147a,_0x1daf5e,_0x3c48d7,_0x34858c){var _0x1a2b83,_0x1f2762;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4a89('0x12'),_0x1daf5e);return _0x34858c(null,![],{'message':_0x4a89('0x10')});}return db['Setting'][_0x4a89('0x13')]({'where':{'id':0x1},'attributes':[_0x4a89('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x1c6e23){_0x1a2b83=_0x1c6e23;if(!_0x1a2b83[_0x4a89('0x14')]){logger[_0x4a89('0xd')](_0x4a89('0x15'),_0x1daf5e);throw new Error(_0x4a89('0x10'));}return _0x4a147a[_0x4a89('0x13')]({'attributes':['id',_0x4a89('0x16'),_0x4a89('0x17'),_0x4a89('0x18'),'role',_0x4a89('0x19'),'blocked','blockedAt',_0x4a89('0x1a')],'where':{'name':_0x1daf5e,'role':{'$or':[_0x4a89('0x1b'),_0x4a89('0x1c'),_0x4a89('0x1d')]},'adSsoEnabled':!![]}});})['then'](function(_0x1c1261){if(!_0x1c1261||_0x1c1261&&_0x1c1261[_0x4a89('0x16')]!==_0x1daf5e){throw new Error(_0x4a89('0x10'));}_0x1f2762=_0x1c1261;var _0x561185=_0x1f2762['name']+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x4a89('0x9')],_0x561185,_0x3c48d7);})[_0x4a89('0x1e')](function(_0x53eb09){if(_0x1f2762[_0x4a89('0x19')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x1a2b83[_0x4a89('0x1f')]>0x0){if(_0x1f2762['blocked']){if(moment(_0x1f2762[_0x4a89('0x20')])[_0x4a89('0x21')](_0x1a2b83[_0x4a89('0x1f')],'minutes')>moment()){throw new Error(_0x4a89('0x10'));}return utils['clearBlockUser'](_0x1f2762,0x0,![],null)[_0x4a89('0x1e')](function(){return utils[_0x4a89('0x22')](_0x1f2762);})[_0x4a89('0x1e')](function(){return _0x34858c(null,_0x1f2762);});}else{return utils[_0x4a89('0x22')](_0x1f2762)[_0x4a89('0x1e')](function(){return _0x34858c(null,_0x1f2762);});}}else{return utils[_0x4a89('0x22')](_0x1f2762)[_0x4a89('0x1e')](function(){return _0x34858c(null,_0x1f2762);});}})[_0x4a89('0x23')](function(_0x3c8089){return _0x34858c(null,![],_0x3c8089);});}function handleError(_0x42c465,_0x36e2d8,_0x17c0aa){return _0x42c465[_0x4a89('0x24')](_0x36e2d8||0x1f4)[_0x4a89('0x25')]({'message':_0x17c0aa?_0x17c0aa[_0x4a89('0x26')]||_0x17c0aa:''});}exports[_0x4a89('0x27')]=function(_0x59f5ea,_0x4118aa,_0x554e12){passport[_0x4a89('0x28')](_0x4a89('0x29'),function(_0x47045c,_0x23b700,_0x3a40db){var _0x3b5efd=_0x47045c||_0x3a40db;if(_0x3b5efd){return handleError(_0x4118aa,0x191,_0x3b5efd);}if(!_0x23b700){return handleError(_0x4118aa,0x194,{'message':_0x4a89('0x2a')});}else{var _0x55c65a={'payload':{'id':_0x23b700['id'],'role':_0x23b700[_0x4a89('0x2b')]},'options':{'expiresIn':0x15180}};return authService[_0x4a89('0x2c')](_0x55c65a)[_0x4a89('0x1e')](function(_0x5ae2ac){_0x4118aa['json']({'id':_0x23b700['id'],'token':_0x5ae2ac,'statusCall':'','isAlreadyLogged':_0x23b700[_0x4a89('0x1a')]});});}})(_0x59f5ea,_0x4118aa,_0x554e12);};passport['use'](_0x4a89('0x29'),new LocalStrategy({'usernameField':_0x4a89('0x16'),'passwordField':_0x4a89('0x17')},function(_0xfd9a69,_0x4a8881,_0xd3885d){return ActiveDirectoryAuthenticate(db['User'],_0xfd9a69,_0x4a8881,_0xd3885d);}));
\ No newline at end of file
+var _0x5e6f=['../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blocked','online','admin','user','agent','name','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','activedirectory2','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x142489,_0x48a802){var _0x2b3536=function(_0x458be4){while(--_0x458be4){_0x142489['push'](_0x142489['shift']());}};_0x2b3536(++_0x48a802);}(_0x5e6f,0x1c5));var _0xf5e6=function(_0x533bf7,_0x29485b){_0x533bf7=_0x533bf7-0x0;var _0x9e4c57=_0x5e6f[_0x533bf7];return _0x9e4c57;};'use strict';var passport=require(_0xf5e6('0x0'));var LocalStrategy=require(_0xf5e6('0x1'))[_0xf5e6('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xf5e6('0x3'));var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0xf5e6('0x4'));var utils=require(_0xf5e6('0x5'));var config=require(_0xf5e6('0x6'));var logger=require(_0xf5e6('0x7'))('api');function isActiveDirectoryConfigured(_0x4c927a){var _0x177201=![];if(typeof _0x4c927a[_0xf5e6('0x8')]!==_0xf5e6('0x9')){_0x177201=_0x4c927a[_0xf5e6('0x8')][_0xf5e6('0xa')]&&_0x4c927a[_0xf5e6('0x8')][_0xf5e6('0xb')]&&_0x4c927a[_0xf5e6('0x8')][_0xf5e6('0xc')];}return _0x177201;}function adAuthenticate(_0x2c4443,_0x3f038f,_0x38d06c){return new BPromise(function(_0x59929f,_0x5c2936){try{var _0x5d1872=new ActiveDirectory(_0x2c4443);_0x5d1872[_0xf5e6('0xd')](_0x3f038f,_0x38d06c,function(_0x1f1ae9,_0x57b863){if(_0x1f1ae9){logger['error'](_0xf5e6('0xe'),_0x3f038f,util[_0xf5e6('0xf')](_0x1f1ae9,{'showHidden':![],'depth':null}));_0x5c2936(_0xf5e6('0x10'));}else if(!_0x57b863){logger[_0xf5e6('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3f038f);_0x5c2936('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x59929f(_0x57b863);}});}catch(_0x545a9a){_0x5c2936(_0x545a9a);}});}function ActiveDirectoryAuthenticate(_0x56032c,_0x37620f,_0x3a1f36,_0x429513){var _0x41168e,_0x3fd92b;if(!isActiveDirectoryConfigured(config)){logger[_0xf5e6('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x37620f);return _0x429513(null,![],{'message':_0xf5e6('0x10')});}return db[_0xf5e6('0x12')][_0xf5e6('0x13')]({'where':{'id':0x1},'attributes':[_0xf5e6('0x14'),'blockDuration'],'raw':!![]})[_0xf5e6('0x15')](function(_0x3286a0){_0x41168e=_0x3286a0;if(!_0x41168e['adSsoEnabled']){logger['error'](_0xf5e6('0x16'),_0x37620f);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x56032c[_0xf5e6('0x13')]({'attributes':['id','name',_0xf5e6('0x17'),'salt',_0xf5e6('0x18'),_0xf5e6('0x19'),_0xf5e6('0x1a'),'blockedAt',_0xf5e6('0x1b')],'where':{'name':_0x37620f,'role':{'$or':[_0xf5e6('0x1c'),_0xf5e6('0x1d'),_0xf5e6('0x1e')]},'adSsoEnabled':!![]}});})[_0xf5e6('0x15')](function(_0x23b99e){if(!_0x23b99e||_0x23b99e&&_0x23b99e['name']!==_0x37620f){throw new Error(_0xf5e6('0x10'));}_0x3fd92b=_0x23b99e;var _0x337767=_0x3fd92b[_0xf5e6('0x1f')]+'@'+config[_0xf5e6('0x8')][_0xf5e6('0xc')];return adAuthenticate(config[_0xf5e6('0x8')],_0x337767,_0x3a1f36);})[_0xf5e6('0x15')](function(_0x22fcb7){if(_0x3fd92b['disabled']){throw new Error(_0xf5e6('0x10'));}if(_0x41168e[_0xf5e6('0x20')]>0x0){if(_0x3fd92b['blocked']){if(moment(_0x3fd92b[_0xf5e6('0x21')])[_0xf5e6('0x22')](_0x41168e['blockDuration'],_0xf5e6('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xf5e6('0x24')](_0x3fd92b,0x0,![],null)[_0xf5e6('0x15')](function(){return utils[_0xf5e6('0x25')](_0x3fd92b);})[_0xf5e6('0x15')](function(){return _0x429513(null,_0x3fd92b);});}else{return utils[_0xf5e6('0x25')](_0x3fd92b)[_0xf5e6('0x15')](function(){return _0x429513(null,_0x3fd92b);});}}else{return utils[_0xf5e6('0x25')](_0x3fd92b)[_0xf5e6('0x15')](function(){return _0x429513(null,_0x3fd92b);});}})['catch'](function(_0x318f95){return _0x429513(null,![],_0x318f95);});}function handleError(_0x9a6dd,_0x7d6550,_0x236519){return _0x9a6dd['status'](_0x7d6550||0x1f4)[_0xf5e6('0x26')]({'message':_0x236519?_0x236519['message']||_0x236519:''});}exports[_0xf5e6('0x27')]=function(_0x3d5730,_0x476ed1,_0x408e02){passport[_0xf5e6('0xd')](_0xf5e6('0x28'),function(_0x45bc92,_0x513df2,_0x44d453){var _0x4a08b4=_0x45bc92||_0x44d453;if(_0x4a08b4){return handleError(_0x476ed1,0x191,_0x4a08b4);}if(!_0x513df2){return handleError(_0x476ed1,0x194,{'message':_0xf5e6('0x29')});}else{var _0x4a5ad9={'payload':{'id':_0x513df2['id'],'role':_0x513df2[_0xf5e6('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0xf5e6('0x2a')](_0x4a5ad9)['then'](function(_0x50e503){_0x476ed1[_0xf5e6('0x2b')]({'id':_0x513df2['id'],'token':_0x50e503,'statusCall':'','isAlreadyLogged':_0x513df2[_0xf5e6('0x1b')]});});}})(_0x3d5730,_0x476ed1,_0x408e02);};passport[_0xf5e6('0x2c')](_0xf5e6('0x28'),new LocalStrategy({'usernameField':_0xf5e6('0x1f'),'passwordField':'password'},function(_0x15d7c0,_0x93c0d4,_0x4a5148){return ActiveDirectoryAuthenticate(db[_0xf5e6('0x2d')],_0x15d7c0,_0x93c0d4,_0x4a5148);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 55b722b..63d74bd 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 _0x3d29=['login','exports','express'];(function(_0x472208,_0x142120){var _0x26926d=function(_0x17d12e){while(--_0x17d12e){_0x472208['push'](_0x472208['shift']());}};_0x26926d(++_0x142120);}(_0x3d29,0x68));var _0x93d2=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x3d29[_0x4d8ed9];return _0x1e2140;};'use strict';var express=require(_0x93d2('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x93d2('0x1')]);module[_0x93d2('0x2')]=router;
\ No newline at end of file
+var _0x14ff=['./authActiveDirectory.controller','post','login','express','Router'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x14ff,0xda));var _0xf14f=function(_0x14be9a,_0x529fdc){_0x14be9a=_0x14be9a-0x0;var _0x50c9a8=_0x14ff[_0x14be9a];return _0x50c9a8;};'use strict';var express=require(_0xf14f('0x0'));var router=express[_0xf14f('0x1')]();var controller=require(_0xf14f('0x2'));router[_0xf14f('0x3')]('/',controller[_0xf14f('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 5405914..cd24671 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x7a54,0x106));var _0x47a5=function(_0x52f901,_0x53f194){_0x52f901=_0x52f901-0x0;var _0x4da813=_0x7a54[_0x52f901];return _0x4da813;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _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(_0x5c641d,_0x5bf77b){var _0x160883=function(_0x4895d7){while(--_0x4895d7){_0x5c641d['push'](_0x5c641d['shift']());}};_0x160883(++_0x5bf77b);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 0cc4903..c1b4876 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 _0x843f=['exports','passport','Router','../user/user.controller.js','../../components/auth/service','get','isMiddleware','login'];(function(_0x325c4f,_0x5800b4){var _0x431098=function(_0x5be070){while(--_0x5be070){_0x325c4f['push'](_0x325c4f['shift']());}};_0x431098(++_0x5800b4);}(_0x843f,0xd1));var _0xf843=function(_0x14b37c,_0x27d104){_0x14b37c=_0x14b37c-0x0;var _0xc0bc8f=_0x843f[_0x14b37c];return _0xc0bc8f;};'use strict';var express=require('express');var passport=require(_0xf843('0x0'));var router=express[_0xf843('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xf843('0x2'));var authService=require(_0xf843('0x3'));router['get']('/',controller['login']);router[_0xf843('0x4')]('/callback',controller['callback'],authService[_0xf843('0x5')],userController[_0xf843('0x6')],authService['setTokenCookie']);module[_0xf843('0x7')]=router;
\ No newline at end of file
+var _0x692a=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport'];(function(_0x1ccd8a,_0x5bf417){var _0x5a69d8=function(_0x336fdb){while(--_0x336fdb){_0x1ccd8a['push'](_0x1ccd8a['shift']());}};_0x5a69d8(++_0x5bf417);}(_0x692a,0x12a));var _0xa692=function(_0x14bec0,_0x53acde){_0x14bec0=_0x14bec0-0x0;var _0x23bdd7=_0x692a[_0x14bec0];return _0x23bdd7;};'use strict';var express=require(_0xa692('0x0'));var passport=require(_0xa692('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xa692('0x2'));var authService=require(_0xa692('0x3'));router['get']('/',controller['login']);router[_0xa692('0x4')](_0xa692('0x5'),controller[_0xa692('0x6')],authService[_0xa692('0x7')],userController['login'],authService[_0xa692('0x8')]);module[_0xa692('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index be842cd..c2d6712 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 _0x98fa=['status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','disabled','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','blockDuration','password','salt','role','blocked','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','then','blockedAt','minutes','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify'];(function(_0x57f3bf,_0x1ec33e){var _0x45176f=function(_0x144ee6){while(--_0x144ee6){_0x57f3bf['push'](_0x57f3bf['shift']());}};_0x45176f(++_0x1ec33e);}(_0x98fa,0xd1));var _0xa98f=function(_0x496377,_0x3a68a4){_0x496377=_0x496377-0x0;var _0x151575=_0x98fa[_0x496377];return _0x151575;};'use strict';var util=require(_0xa98f('0x0'));var passport=require('passport');var LocalStrategy=require(_0xa98f('0x1'))['Strategy'];var jayson=require(_0xa98f('0x2'));var _=require(_0xa98f('0x3'));var rs=require(_0xa98f('0x4'));var moment=require(_0xa98f('0x5'));var db=require(_0xa98f('0x6'))['db'];var authService=require(_0xa98f('0x7'));var utils=require(_0xa98f('0x8'));var client=jayson['client'][_0xa98f('0x9')]({'port':0x232b});function localAuthenticate(_0x693c05,_0x3d90ac,_0x3ba300,_0x1d74e4){var _0x563fcb,_0x2e5fd5;return db['Setting'][_0xa98f('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xa98f('0xb')],'raw':!![]})['then'](function(_0x561ad1){_0x563fcb=_0x561ad1;return _0x693c05[_0xa98f('0xa')]({'attributes':['id','name',_0xa98f('0xc'),_0xa98f('0xd'),_0xa98f('0xe'),'disabled',_0xa98f('0xf'),'blockedAt',_0xa98f('0x10')],'where':{'name':_0x3d90ac,'role':{'$or':[_0xa98f('0x11'),_0xa98f('0x12'),_0xa98f('0x13')]}}});})['then'](function(_0x32cf46){if(!_0x32cf46||_0x32cf46&&_0x32cf46[_0xa98f('0x14')]!==_0x3d90ac){throw new Error(_0xa98f('0x15'));}else{_0x2e5fd5=_0x32cf46;return _0x2e5fd5;}})['then'](function(){_0x2e5fd5['authenticate'](_0x3ba300,function(_0x2253af,_0x1e4a65){var _0x2c988a=_0x2e5fd5[_0xa98f('0x10')]+0x1;if(_0x2253af){return _0x1d74e4(_0x2253af);}else if(!_0x1e4a65){if(_0x2e5fd5['disabled']){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}else if(_0x563fcb[_0xa98f('0x16')]>0x0){if(_0x2e5fd5[_0xa98f('0xf')]){if(_0x563fcb[_0xa98f('0xb')]>0x0){if(moment(_0x2e5fd5['blockedAt'])[_0xa98f('0x17')](_0x563fcb['blockDuration'],'minutes')>moment()){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}else{return utils[_0xa98f('0x18')](_0x2e5fd5,_0x2c988a,![],null)[_0xa98f('0x19')](function(){return _0x1d74e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}}else{if(_0x2c988a>=_0x563fcb[_0xa98f('0x16')]){return utils['clearBlockUser'](_0x2e5fd5,0x0,!![],moment())[_0xa98f('0x19')](function(){return _0x1d74e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xa98f('0x18')](_0x2e5fd5,_0x2c988a,![],null)[_0xa98f('0x19')](function(){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});});}}}else{return _0x1d74e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2e5fd5['disabled']){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}else if(_0x563fcb[_0xa98f('0x16')]>0x0){if(_0x2e5fd5['blocked']){if(_0x563fcb[_0xa98f('0xb')]>0x0){if(moment(_0x2e5fd5[_0xa98f('0x1a')])[_0xa98f('0x17')](_0x563fcb[_0xa98f('0xb')],_0xa98f('0x1b'))>moment()){return _0x1d74e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa98f('0x18')](_0x2e5fd5,0x0,![],null)[_0xa98f('0x19')](function(){return utils['getLicense'](_0x2e5fd5);})['then'](function(){return _0x1d74e4(null,_0x2e5fd5);});}}else{return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}}else{return utils[_0xa98f('0x18')](_0x2e5fd5,0x0,![],null)[_0xa98f('0x19')](function(){return utils[_0xa98f('0x1c')](_0x2e5fd5);})[_0xa98f('0x19')](function(){return _0x1d74e4(null,_0x2e5fd5);})[_0xa98f('0x1d')](function(_0xa819f1){return _0x1d74e4(null,![],_0xa819f1);});}}else{if(_0x2e5fd5[_0xa98f('0xf')]){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}else{return utils[_0xa98f('0x1c')](_0x2e5fd5)['then'](function(){return _0x1d74e4(null,_0x2e5fd5);});}}}});})['catch'](function(_0x3343d3){return _0x1d74e4(null,![],_0x3343d3);});}function sendServiceMail(_0xd77ee9){return db[_0xa98f('0x1e')]['find']({'where':{'service':!![]},'attributes':['id','name',_0xa98f('0x1f')],'include':[{'model':db[_0xa98f('0x20')],'as':_0xa98f('0x21'),'include':[{'model':db['CloudProvider'],'as':_0xa98f('0x22')}]}]})['then'](function(_0x111d87){if(!_0x111d87){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x10ef82=_0x111d87['getSmtpOptions']();var _0x2b552b={'account':_0x10ef82,'message':_['merge']({'from':util[_0xa98f('0x23')](_0xa98f('0x24'),_0x111d87[_0xa98f('0x14')],_0x111d87[_0xa98f('0x1f')]||_0x111d87[_0xa98f('0x21')][_0xa98f('0x12')])},_0xd77ee9)};return client[_0xa98f('0x25')](_0xa98f('0x26'),_0x2b552b);})[_0xa98f('0x19')](function(_0x3326a9){if(_0x3326a9[_0xa98f('0x27')]){throw new Error(util[_0xa98f('0x23')](_0xa98f('0x28'),_0x3326a9[_0xa98f('0x27')][_0xa98f('0x29')]||JSON[_0xa98f('0x2a')](_0x3326a9['error'])));}return!![];});}function handleError(_0x29edb6,_0x38f091,_0x4399d4){return _0x29edb6[_0xa98f('0x2b')](_0x38f091||0x1f4)[_0xa98f('0x2c')]({'message':_0x4399d4?_0x4399d4[_0xa98f('0x29')]||_0x4399d4:''});}exports[_0xa98f('0x2d')]=function(_0x2589fc,_0x46e317,_0x2b186d){passport[_0xa98f('0x2e')](_0xa98f('0x2f'),function(_0x5c8298,_0x10e057,_0x39a838){var _0x9571ae=_0x5c8298||_0x39a838;if(_0x9571ae){return handleError(_0x46e317,0x191,_0x9571ae);}if(!_0x10e057){return handleError(_0x46e317,0x194,{'message':_0xa98f('0x30')});}else{var _0x59d3f1={'payload':{'id':_0x10e057['id'],'role':_0x10e057[_0xa98f('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x59d3f1)[_0xa98f('0x19')](function(_0x48eed1){_0x46e317[_0xa98f('0x31')]({'id':_0x10e057['id'],'token':_0x48eed1,'statusCall':'','isAlreadyLogged':_0x10e057[_0xa98f('0x32')]});});}})(_0x2589fc,_0x46e317,_0x2b186d);};exports['forgot']=function(_0x3ef97c,_0x4511a7){if(!_0x3ef97c[_0xa98f('0x33')][_0xa98f('0x1f')]){return handleError(_0x4511a7,0x1f4,{'message':_0xa98f('0x34')});}var _0x36988c=rs['generate']();_0x3ef97c[_0xa98f('0x33')]['email']=_0x3ef97c[_0xa98f('0x33')][_0xa98f('0x1f')][_0xa98f('0x35')]()[_0xa98f('0x36')]();var _0x3a6871;return db[_0xa98f('0x37')][_0xa98f('0xa')]({'where':{'id':0x1},'attributes':[_0xa98f('0x16'),_0xa98f('0xb')],'raw':!![]})[_0xa98f('0x19')](function(_0xa32c63){_0x3a6871=_0xa32c63;return db[_0xa98f('0x38')][_0xa98f('0x39')]({'where':{'email':_0x3ef97c[_0xa98f('0x33')][_0xa98f('0x1f')]}});})[_0xa98f('0x19')](function(_0x3dc207){if(!_0x3dc207){throw new Error(_0xa98f('0x3a'));}if(_0x3dc207[_0xa98f('0x3b')]){throw new Error(_0xa98f('0x3c'));}if(_0x3dc207[_0xa98f('0xf')]){if(moment(_0x3dc207['blockedAt'])[_0xa98f('0x17')](_0x3a6871[_0xa98f('0xb')],'minutes')>moment()){throw new Error(_0xa98f('0x3d'));}else{_0x3dc207[_0xa98f('0xf')]=![];_0x3dc207['blockedAt']=null;}}_0x3dc207[_0xa98f('0x3e')]=_0x36988c;_0x3dc207[_0xa98f('0x3f')]=Date[_0xa98f('0x40')]()+0x36ee80;return _0x3dc207[_0xa98f('0x41')]();})['then'](function(){return sendServiceMail({'to':_0x3ef97c[_0xa98f('0x33')][_0xa98f('0x1f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xa98f('0x42')+_0xa98f('0x43')+'https://'+_0x3ef97c[_0xa98f('0x44')][_0xa98f('0x45')]+_0xa98f('0x46')+_0x36988c+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xa98f('0x19')](function(){_0x4511a7[_0xa98f('0x2b')](0xc8)[_0xa98f('0x2c')]({'message':_0xa98f('0x47')});})[_0xa98f('0x1d')](function(_0x5e017d){return handleError(_0x4511a7,0x1f4,_0x5e017d);});};exports[_0xa98f('0x48')]=function(_0x384c53,_0x111559){return db[_0xa98f('0x38')][_0xa98f('0x39')]({'where':{'resetPasswordToken':_0x384c53[_0xa98f('0x49')][_0xa98f('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xa98f('0x40')]()}}})[_0xa98f('0x19')](function(_0x3aab11){if(!_0x3aab11){throw new Error(_0xa98f('0x4b'));}return db[_0xa98f('0x37')]['findOne']({'attributes':['id',_0xa98f('0x4c'),'enforcePasswordHistory','passwordHistoryLimit']})[_0xa98f('0x19')](function(_0x1cd747){if(_0x1cd747[_0xa98f('0x4c')])authService[_0xa98f('0x4d')](_0x384c53[_0xa98f('0x33')][_0xa98f('0xc')]);if(!_0x1cd747[_0xa98f('0x4e')]||!_0x3aab11['previousPasswords'])return _0x3aab11;authService[_0xa98f('0x4f')](_0x384c53[_0xa98f('0x33')][_0xa98f('0xc')],_0x3aab11[_0xa98f('0x50')],_0x1cd747[_0xa98f('0x51')]);return _0x3aab11;})[_0xa98f('0x19')](function(){_0x3aab11[_0xa98f('0xc')]=_0x384c53[_0xa98f('0x33')][_0xa98f('0xc')];_0x3aab11[_0xa98f('0x3e')]=null;_0x3aab11[_0xa98f('0x3f')]=null;return _0x3aab11[_0xa98f('0x41')]();});})[_0xa98f('0x19')](function(){_0x111559['status'](0xc8)['send']({'message':_0xa98f('0x52')});})[_0xa98f('0x1d')](function(_0x2e4f4a){return handleError(_0x111559,0x1f4,_0x2e4f4a);});};passport[_0xa98f('0x53')](_0xa98f('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x16c9b2,_0x560ab5,_0x5030f5){return localAuthenticate(db['User'],_0x16c9b2,_0x560ab5,_0x5030f5);}));
\ No newline at end of file
+var _0xebcc=['loginAttempts','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','CloudProvider','getSmtpOptions','format','request','SendMail','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','disabled','blocked','blockedAt'];(function(_0x55c935,_0x48869a){var _0x979205=function(_0x39b955){while(--_0x39b955){_0x55c935['push'](_0x55c935['shift']());}};_0x979205(++_0x48869a);}(_0xebcc,0x89));var _0xcebc=function(_0x34895d,_0x58eaab){_0x34895d=_0x34895d-0x0;var _0x29ce5b=_0xebcc[_0x34895d];return _0x29ce5b;};'use strict';var util=require(_0xcebc('0x0'));var passport=require(_0xcebc('0x1'));var LocalStrategy=require(_0xcebc('0x2'))[_0xcebc('0x3')];var jayson=require(_0xcebc('0x4'));var _=require('lodash');var rs=require(_0xcebc('0x5'));var moment=require('moment');var db=require(_0xcebc('0x6'))['db'];var authService=require(_0xcebc('0x7'));var utils=require(_0xcebc('0x8'));var client=jayson['client'][_0xcebc('0x9')]({'port':0x232b});function localAuthenticate(_0x10d584,_0x437a6e,_0x27fa42,_0xb68606){var _0x56b8fc,_0x15bb9f;return db[_0xcebc('0xa')][_0xcebc('0xb')]({'where':{'id':0x1},'attributes':[_0xcebc('0xc'),_0xcebc('0xd')],'raw':!![]})[_0xcebc('0xe')](function(_0x4faa23){_0x56b8fc=_0x4faa23;return _0x10d584[_0xcebc('0xb')]({'attributes':['id','name',_0xcebc('0xf'),_0xcebc('0x10'),_0xcebc('0x11'),_0xcebc('0x12'),_0xcebc('0x13'),_0xcebc('0x14'),_0xcebc('0x15')],'where':{'name':_0x437a6e,'role':{'$or':['admin',_0xcebc('0x16'),_0xcebc('0x17')]}}});})[_0xcebc('0xe')](function(_0x598057){if(!_0x598057||_0x598057&&_0x598057[_0xcebc('0x18')]!==_0x437a6e){throw new Error(_0xcebc('0x19'));}else{_0x15bb9f=_0x598057;return _0x15bb9f;}})[_0xcebc('0xe')](function(){_0x15bb9f[_0xcebc('0x1a')](_0x27fa42,function(_0x130899,_0x58b074){var _0x54b4bd=_0x15bb9f[_0xcebc('0x15')]+0x1;if(_0x130899){return _0xb68606(_0x130899);}else if(!_0x58b074){if(_0x15bb9f[_0xcebc('0x12')]){return _0xb68606(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56b8fc['allowedLoginAttempts']>0x0){if(_0x15bb9f[_0xcebc('0x13')]){if(_0x56b8fc[_0xcebc('0xd')]>0x0){if(moment(_0x15bb9f[_0xcebc('0x14')])[_0xcebc('0x1b')](_0x56b8fc[_0xcebc('0xd')],_0xcebc('0x1c'))>moment()){return _0xb68606(null,![],{'message':_0xcebc('0x19')});}else{return utils[_0xcebc('0x1d')](_0x15bb9f,_0x54b4bd,![],null)[_0xcebc('0xe')](function(){return _0xb68606(null,![],{'message':_0xcebc('0x19')});});}}else{return _0xb68606(null,![],{'message':_0xcebc('0x19')});}}else{if(_0x54b4bd>=_0x56b8fc[_0xcebc('0xc')]){return utils[_0xcebc('0x1d')](_0x15bb9f,0x0,!![],moment())['then'](function(){return _0xb68606(null,![],{'message':_0xcebc('0x19')});});}else{return utils[_0xcebc('0x1d')](_0x15bb9f,_0x54b4bd,![],null)[_0xcebc('0xe')](function(){return _0xb68606(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0xb68606(null,![],{'message':_0xcebc('0x19')});}}else{if(_0x15bb9f['disabled']){return _0xb68606(null,![],{'message':_0xcebc('0x19')});}else if(_0x56b8fc[_0xcebc('0xc')]>0x0){if(_0x15bb9f[_0xcebc('0x13')]){if(_0x56b8fc[_0xcebc('0xd')]>0x0){if(moment(_0x15bb9f[_0xcebc('0x14')])[_0xcebc('0x1b')](_0x56b8fc[_0xcebc('0xd')],'minutes')>moment()){return _0xb68606(null,![],{'message':_0xcebc('0x19')});}else{return utils[_0xcebc('0x1d')](_0x15bb9f,0x0,![],null)[_0xcebc('0xe')](function(){return utils['getLicense'](_0x15bb9f);})[_0xcebc('0xe')](function(){return _0xb68606(null,_0x15bb9f);});}}else{return _0xb68606(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xcebc('0x1d')](_0x15bb9f,0x0,![],null)[_0xcebc('0xe')](function(){return utils[_0xcebc('0x1e')](_0x15bb9f);})[_0xcebc('0xe')](function(){return _0xb68606(null,_0x15bb9f);})[_0xcebc('0x1f')](function(_0x515ec9){return _0xb68606(null,![],_0x515ec9);});}}else{if(_0x15bb9f[_0xcebc('0x13')]){return _0xb68606(null,![],{'message':_0xcebc('0x19')});}else{return utils[_0xcebc('0x1e')](_0x15bb9f)['then'](function(){return _0xb68606(null,_0x15bb9f);});}}}});})[_0xcebc('0x1f')](function(_0x571439){return _0xb68606(null,![],_0x571439);});}function sendServiceMail(_0x44497a){return db['MailAccount'][_0xcebc('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xcebc('0x21')],'include':[{'model':db['MailServerOut'],'as':_0xcebc('0x22'),'include':[{'model':db[_0xcebc('0x23')],'as':_0xcebc('0x23')}]}]})[_0xcebc('0xe')](function(_0x4fbf0b){if(!_0x4fbf0b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x35e1e2=_0x4fbf0b[_0xcebc('0x24')]();var _0x4f7e73={'account':_0x35e1e2,'message':_['merge']({'from':util[_0xcebc('0x25')]('\x22%s\x22\x20<%s>',_0x4fbf0b[_0xcebc('0x18')],_0x4fbf0b[_0xcebc('0x21')]||_0x4fbf0b[_0xcebc('0x22')][_0xcebc('0x16')])},_0x44497a)};return client[_0xcebc('0x26')](_0xcebc('0x27'),_0x4f7e73);})[_0xcebc('0xe')](function(_0x34437b){if(_0x34437b[_0xcebc('0x28')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x34437b[_0xcebc('0x28')][_0xcebc('0x29')]||JSON[_0xcebc('0x2a')](_0x34437b['error'])));}return!![];});}function handleError(_0x438a59,_0x4074eb,_0x332132){return _0x438a59[_0xcebc('0x2b')](_0x4074eb||0x1f4)[_0xcebc('0x2c')]({'message':_0x332132?_0x332132[_0xcebc('0x29')]||_0x332132:''});}exports[_0xcebc('0x2d')]=function(_0x2f3dc0,_0x4c81f2,_0x8356c2){passport[_0xcebc('0x1a')](_0xcebc('0x2e'),function(_0x4cad63,_0x24d1d5,_0x3a0ecf){var _0x1c364e=_0x4cad63||_0x3a0ecf;if(_0x1c364e){return handleError(_0x4c81f2,0x191,_0x1c364e);}if(!_0x24d1d5){return handleError(_0x4c81f2,0x194,{'message':_0xcebc('0x2f')});}else{var _0x1c5e3a={'payload':{'id':_0x24d1d5['id'],'role':_0x24d1d5[_0xcebc('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xcebc('0x30')](_0x1c5e3a)[_0xcebc('0xe')](function(_0x4a5767){_0x4c81f2[_0xcebc('0x31')]({'id':_0x24d1d5['id'],'token':_0x4a5767,'statusCall':'','isAlreadyLogged':_0x24d1d5[_0xcebc('0x32')]});});}})(_0x2f3dc0,_0x4c81f2,_0x8356c2);};exports['forgot']=function(_0x5b6977,_0x4d7c02){if(!_0x5b6977[_0xcebc('0x33')][_0xcebc('0x21')]){return handleError(_0x4d7c02,0x1f4,{'message':_0xcebc('0x34')});}var _0x4be65f=rs['generate']();_0x5b6977[_0xcebc('0x33')][_0xcebc('0x21')]=_0x5b6977[_0xcebc('0x33')][_0xcebc('0x21')]['trim']()['toLowerCase']();var _0x42d7e7;return db['Setting'][_0xcebc('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x1565ca){_0x42d7e7=_0x1565ca;return db[_0xcebc('0x35')]['find']({'where':{'email':_0x5b6977[_0xcebc('0x33')][_0xcebc('0x21')]}});})[_0xcebc('0xe')](function(_0x2087b5){if(!_0x2087b5){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2087b5[_0xcebc('0x12')]){throw new Error(_0xcebc('0x36'));}if(_0x2087b5[_0xcebc('0x13')]){if(moment(_0x2087b5['blockedAt'])[_0xcebc('0x1b')](_0x42d7e7[_0xcebc('0xd')],_0xcebc('0x1c'))>moment()){throw new Error(_0xcebc('0x37'));}else{_0x2087b5['blocked']=![];_0x2087b5[_0xcebc('0x14')]=null;}}_0x2087b5[_0xcebc('0x38')]=_0x4be65f;_0x2087b5[_0xcebc('0x39')]=Date['now']()+0x36ee80;return _0x2087b5['save']();})['then'](function(){return sendServiceMail({'to':_0x5b6977[_0xcebc('0x33')][_0xcebc('0x21')],'subject':_0xcebc('0x3a'),'text':_0xcebc('0x3b')+_0xcebc('0x3c')+_0xcebc('0x3d')+_0x5b6977[_0xcebc('0x3e')][_0xcebc('0x3f')]+_0xcebc('0x40')+_0x4be65f+'\x0a\x0a'+_0xcebc('0x41')});})[_0xcebc('0xe')](function(){_0x4d7c02[_0xcebc('0x2b')](0xc8)['send']({'message':_0xcebc('0x42')});})[_0xcebc('0x1f')](function(_0x1bc1e7){return handleError(_0x4d7c02,0x1f4,_0x1bc1e7);});};exports[_0xcebc('0x43')]=function(_0x519b32,_0x2e6bfd){return db[_0xcebc('0x35')][_0xcebc('0x20')]({'where':{'resetPasswordToken':_0x519b32[_0xcebc('0x44')][_0xcebc('0x45')],'resetPasswordExpires':{'$gt':Date[_0xcebc('0x46')]()}}})[_0xcebc('0xe')](function(_0x42b1ef){if(!_0x42b1ef){throw new Error(_0xcebc('0x47'));}return db[_0xcebc('0xa')][_0xcebc('0xb')]({'attributes':['id',_0xcebc('0x48'),_0xcebc('0x49'),_0xcebc('0x4a')]})['then'](function(_0x3f3c40){if(_0x3f3c40['securePassword'])authService[_0xcebc('0x4b')](_0x519b32[_0xcebc('0x33')][_0xcebc('0xf')]);if(!_0x3f3c40[_0xcebc('0x49')]||!_0x42b1ef[_0xcebc('0x4c')])return _0x42b1ef;authService['validatePasswordHistory'](_0x519b32['body'][_0xcebc('0xf')],_0x42b1ef[_0xcebc('0x4c')],_0x3f3c40[_0xcebc('0x4a')]);return _0x42b1ef;})[_0xcebc('0xe')](function(){_0x42b1ef[_0xcebc('0xf')]=_0x519b32[_0xcebc('0x33')][_0xcebc('0xf')];_0x42b1ef[_0xcebc('0x38')]=null;_0x42b1ef[_0xcebc('0x39')]=null;return _0x42b1ef['save']();});})['then'](function(){_0x2e6bfd[_0xcebc('0x2b')](0xc8)[_0xcebc('0x2c')]({'message':_0xcebc('0x4d')});})[_0xcebc('0x1f')](function(_0x122753){return handleError(_0x2e6bfd,0x1f4,_0x122753);});};passport[_0xcebc('0x4e')](_0xcebc('0x2e'),new LocalStrategy({'usernameField':_0xcebc('0x18'),'passwordField':_0xcebc('0xf')},function(_0x4b0023,_0x2f25f6,_0x168f95){return localAuthenticate(db[_0xcebc('0x35')],_0x4b0023,_0x2f25f6,_0x168f95);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 7b58a62..fb441c0 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 _0xc977=['exports','Router','/forgot','forgot','/reset/:token','reset'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0xc977,0xc7));var _0x7c97=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc977[_0x5ddb1c];return _0x354adc;};'use strict';var express=require('express');var router=express[_0x7c97('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router['post'](_0x7c97('0x1'),controller[_0x7c97('0x2')]);router['post'](_0x7c97('0x3'),controller[_0x7c97('0x4')]);module[_0x7c97('0x5')]=router;
\ No newline at end of file
+var _0x984a=['login','/forgot','forgot','/reset/:token','exports','./authLocal.controller','post'];(function(_0x2d93b6,_0x51e677){var _0x464144=function(_0x14c633){while(--_0x14c633){_0x2d93b6['push'](_0x2d93b6['shift']());}};_0x464144(++_0x51e677);}(_0x984a,0x155));var _0xa984=function(_0x2c7e83,_0x336b96){_0x2c7e83=_0x2c7e83-0x0;var _0x5b3e65=_0x984a[_0x2c7e83];return _0x5b3e65;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa984('0x0'));router[_0xa984('0x1')]('/',controller[_0xa984('0x2')]);router[_0xa984('0x1')](_0xa984('0x3'),controller[_0xa984('0x4')]);router['post'](_0xa984('0x5'),controller['reset']);module[_0xa984('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 3fc6dcd..861a77e 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 _0xdd26=['BOOLEAN','STRING'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xdd26,0xe9));var _0x6dd2=function(_0x58ef84,_0x3ecc29){_0x58ef84=_0x58ef84-0x0;var _0x17c84a=_0xdd26[_0x58ef84];return _0x17c84a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6dd2('0x0')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6dd2('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8c1d=['STRING','INTEGER','exports'];(function(_0x320308,_0x25bdb1){var _0x379420=function(_0x8e30d){while(--_0x8e30d){_0x320308['push'](_0x320308['shift']());}};_0x379420(++_0x25bdb1);}(_0x8c1d,0xc2));var _0xd8c1=function(_0x567530,_0x24e025){_0x567530=_0x567530-0x0;var _0x24b9cd=_0x8c1d[_0x567530];return _0x24b9cd;};'use strict';var Sequelize=require('sequelize');module[_0xd8c1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8c1('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd8c1('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 fcbfad9..3b3570f 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 _0x2a29=['to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','name','send','map','Automation','fieldName','type','key','model','query','filters','attributes','intersection','fields','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length','find','catch','create','body','update','destroy','addConditions','Condition','ids','getConditions','findOne','rawAttributes','order','nolimit','addActions','Action','omit','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1c0870,_0xb3e682){var _0x454576=function(_0x545ab5){while(--_0x545ab5){_0x1c0870['push'](_0x1c0870['shift']());}};_0x454576(++_0xb3e682);}(_0x2a29,0x186));var _0x92a2=function(_0x48448d,_0x8acc8c){_0x48448d=_0x48448d-0x0;var _0x2c704e=_0x2a29[_0x48448d];return _0x2c704e;};'use strict';var emlformat=require(_0x92a2('0x0'));var rimraf=require(_0x92a2('0x1'));var zipdir=require(_0x92a2('0x2'));var jsonpatch=require(_0x92a2('0x3'));var rp=require('request-promise');var moment=require(_0x92a2('0x4'));var BPromise=require(_0x92a2('0x5'));var Mustache=require('mustache');var util=require(_0x92a2('0x6'));var path=require(_0x92a2('0x7'));var sox=require(_0x92a2('0x8'));var csv=require('to-csv');var ejs=require(_0x92a2('0x9'));var fs=require('fs');var fs_extra=require(_0x92a2('0xa'));var _=require(_0x92a2('0xb'));var squel=require(_0x92a2('0xc'));var crypto=require(_0x92a2('0xd'));var jsforce=require(_0x92a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x92a2('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x92a2('0x10'));var authService=require(_0x92a2('0x11'));var qs=require(_0x92a2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x92a2('0x13'))(_0x92a2('0x14'));var utils=require('../../config/utils');var config=require(_0x92a2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x92a2('0x16'))['db'];function respondWithStatusCode(_0x2548cf,_0x16237d){_0x16237d=_0x16237d||0xcc;return function(_0x341966){if(_0x341966){return _0x2548cf[_0x92a2('0x17')](_0x16237d);}return _0x2548cf[_0x92a2('0x18')](_0x16237d)[_0x92a2('0x19')]();};}function respondWithResult(_0x17a794,_0x129d48){_0x129d48=_0x129d48||0xc8;return function(_0x170fa9){if(_0x170fa9){return _0x17a794['status'](_0x129d48)[_0x92a2('0x1a')](_0x170fa9);}};}function respondWithFilteredResult(_0x12ebfe,_0x531a2e){return function(_0x1a9874){if(_0x1a9874){var _0x17dcd9=typeof _0x531a2e[_0x92a2('0x1b')]===_0x92a2('0x1c')&&typeof _0x531a2e[_0x92a2('0x1d')]==='undefined';var _0x42cd6f=_0x1a9874[_0x92a2('0x1e')];var _0x5bb1f6=_0x17dcd9?0x0:_0x531a2e['offset'];var _0x4dfbe7=_0x17dcd9?_0x1a9874[_0x92a2('0x1e')]:_0x531a2e['offset']+_0x531a2e[_0x92a2('0x1d')];var _0x16dd0b;if(_0x4dfbe7>=_0x42cd6f){_0x4dfbe7=_0x42cd6f;_0x16dd0b=0xc8;}else{_0x16dd0b=0xce;}_0x12ebfe[_0x92a2('0x18')](_0x16dd0b);return _0x12ebfe[_0x92a2('0x1f')]('Content-Range',_0x5bb1f6+'-'+_0x4dfbe7+'/'+_0x42cd6f)[_0x92a2('0x1a')](_0x1a9874);}return null;};}function patchUpdates(_0x5da773){return function(_0x22e518){try{jsonpatch[_0x92a2('0x20')](_0x22e518,_0x5da773,!![]);}catch(_0x453d19){return BPromise[_0x92a2('0x21')](_0x453d19);}return _0x22e518[_0x92a2('0x22')]();};}function saveUpdates(_0x36eadc,_0x4f67e4){return function(_0x1a7d71){if(_0x1a7d71){return _0x1a7d71['update'](_0x36eadc)['then'](function(_0x481aa4){return _0x481aa4;});}return null;};}function removeEntity(_0x733a1a,_0x50b608){return function(_0x4bed8a){if(_0x4bed8a){return _0x4bed8a['destroy']()[_0x92a2('0x23')](function(){_0x733a1a[_0x92a2('0x18')](0xcc)[_0x92a2('0x19')]();});}};}function handleEntityNotFound(_0x67dac0,_0x3b97eb){return function(_0x4b0da8){if(!_0x4b0da8){_0x67dac0[_0x92a2('0x17')](0x194);}return _0x4b0da8;};}function handleError(_0x17ae42,_0x5e7029){_0x5e7029=_0x5e7029||0x1f4;return function(_0x11a2e5){logger['error'](_0x11a2e5['stack']);if(_0x11a2e5[_0x92a2('0x24')]){delete _0x11a2e5['name'];}_0x17ae42[_0x92a2('0x18')](_0x5e7029)[_0x92a2('0x25')](_0x11a2e5);};}exports['index']=function(_0x2fb042,_0xf93242){var _0xdcbcfa={},_0x31e9d8={},_0x35a559={'count':0x0,'rows':[]};var _0x2dcae6=_[_0x92a2('0x26')](db[_0x92a2('0x27')]['rawAttributes'],function(_0x475da0){return{'name':_0x475da0[_0x92a2('0x28')],'type':_0x475da0[_0x92a2('0x29')][_0x92a2('0x2a')]};});_0x31e9d8[_0x92a2('0x2b')]=_[_0x92a2('0x26')](_0x2dcae6,_0x92a2('0x24'));_0x31e9d8[_0x92a2('0x2c')]=_['keys'](_0x2fb042[_0x92a2('0x2c')]);_0x31e9d8[_0x92a2('0x2d')]=_['intersection'](_0x31e9d8['model'],_0x31e9d8[_0x92a2('0x2c')]);_0xdcbcfa[_0x92a2('0x2e')]=_[_0x92a2('0x2f')](_0x31e9d8[_0x92a2('0x2b')],qs[_0x92a2('0x30')](_0x2fb042['query'][_0x92a2('0x30')]));_0xdcbcfa[_0x92a2('0x2e')]=_0xdcbcfa[_0x92a2('0x2e')]['length']?_0xdcbcfa['attributes']:_0x31e9d8[_0x92a2('0x2b')];if(!_0x2fb042[_0x92a2('0x2c')]['hasOwnProperty']('nolimit')){_0xdcbcfa[_0x92a2('0x1d')]=qs[_0x92a2('0x1d')](_0x2fb042[_0x92a2('0x2c')][_0x92a2('0x1d')]);_0xdcbcfa['offset']=qs[_0x92a2('0x1b')](_0x2fb042['query'][_0x92a2('0x1b')]);}_0xdcbcfa['order']=qs['sort'](_0x2fb042[_0x92a2('0x2c')][_0x92a2('0x31')]);_0xdcbcfa[_0x92a2('0x32')]=qs['filters'](_['pick'](_0x2fb042[_0x92a2('0x2c')],_0x31e9d8[_0x92a2('0x2d')]),_0x2dcae6);if(_0x2fb042['query'][_0x92a2('0x33')]){_0xdcbcfa[_0x92a2('0x32')]=_[_0x92a2('0x34')](_0xdcbcfa[_0x92a2('0x32')],{'$or':_[_0x92a2('0x26')](_0x2dcae6,function(_0x5e3c31){if(_0x5e3c31[_0x92a2('0x29')]!==_0x92a2('0x35')){var _0x53f6b6={};_0x53f6b6[_0x5e3c31['name']]={'$like':'%'+_0x2fb042['query']['filter']+'%'};return _0x53f6b6;}})});}_0xdcbcfa=_[_0x92a2('0x34')]({},_0xdcbcfa,_0x2fb042[_0x92a2('0x36')]);var _0x4b1667={'where':_0xdcbcfa['where']};return db[_0x92a2('0x27')]['count'](_0x4b1667)[_0x92a2('0x23')](function(_0x1dd14f){_0x35a559[_0x92a2('0x1e')]=_0x1dd14f;if(_0x2fb042[_0x92a2('0x2c')]['includeAll']){_0xdcbcfa[_0x92a2('0x37')]=[{'all':!![]}];}return db['Automation'][_0x92a2('0x38')](_0xdcbcfa);})[_0x92a2('0x23')](function(_0x281598){_0x35a559[_0x92a2('0x39')]=_0x281598;return _0x35a559;})[_0x92a2('0x23')](respondWithFilteredResult(_0xf93242,_0xdcbcfa))['catch'](handleError(_0xf93242,null));};exports[_0x92a2('0x3a')]=function(_0x473da5,_0x322ef1){var _0x43629b={'raw':![],'where':{'id':_0x473da5[_0x92a2('0x3b')]['id']}},_0x3822ee={};_0x3822ee[_0x92a2('0x2b')]=_[_0x92a2('0x3c')](db[_0x92a2('0x27')]['rawAttributes']);_0x3822ee[_0x92a2('0x2c')]=_[_0x92a2('0x3c')](_0x473da5[_0x92a2('0x2c')]);_0x3822ee[_0x92a2('0x2d')]=_[_0x92a2('0x2f')](_0x3822ee['model'],_0x3822ee[_0x92a2('0x2c')]);_0x43629b['attributes']=_['intersection'](_0x3822ee['model'],qs[_0x92a2('0x30')](_0x473da5[_0x92a2('0x2c')]['fields']));_0x43629b[_0x92a2('0x2e')]=_0x43629b[_0x92a2('0x2e')][_0x92a2('0x3d')]?_0x43629b[_0x92a2('0x2e')]:_0x3822ee['model'];if(_0x473da5[_0x92a2('0x2c')]['includeAll']){_0x43629b['include']=[{'all':!![]}];}_0x43629b=_[_0x92a2('0x34')]({},_0x43629b,_0x473da5[_0x92a2('0x36')]);return db[_0x92a2('0x27')][_0x92a2('0x3e')](_0x43629b)[_0x92a2('0x23')](handleEntityNotFound(_0x322ef1,null))['then'](respondWithResult(_0x322ef1,null))[_0x92a2('0x3f')](handleError(_0x322ef1,null));};exports[_0x92a2('0x40')]=function(_0x2a3311,_0x524ba1){return db[_0x92a2('0x27')][_0x92a2('0x40')](_0x2a3311[_0x92a2('0x41')],{})['then'](respondWithResult(_0x524ba1,0xc9))['catch'](handleError(_0x524ba1,null));};exports[_0x92a2('0x42')]=function(_0x2264b8,_0x2346ab){if(_0x2264b8[_0x92a2('0x41')]['id']){delete _0x2264b8['body']['id'];}return db[_0x92a2('0x27')]['find']({'where':{'id':_0x2264b8[_0x92a2('0x3b')]['id']}})[_0x92a2('0x23')](handleEntityNotFound(_0x2346ab,null))[_0x92a2('0x23')](saveUpdates(_0x2264b8['body'],null))[_0x92a2('0x23')](respondWithResult(_0x2346ab,null))['catch'](handleError(_0x2346ab,null));};exports[_0x92a2('0x43')]=function(_0x3b6dc4,_0x218b13){return db[_0x92a2('0x27')][_0x92a2('0x3e')]({'where':{'id':_0x3b6dc4['params']['id']}})[_0x92a2('0x23')](handleEntityNotFound(_0x218b13,null))[_0x92a2('0x23')](removeEntity(_0x218b13,null))['catch'](handleError(_0x218b13,null));};exports[_0x92a2('0x44')]=function(_0x1f53f3,_0x3f8d2e,_0x3b0546){return db[_0x92a2('0x45')][_0x92a2('0x3e')]({'where':{'id':_0x1f53f3['params']['id']}})['then'](handleEntityNotFound(_0x3f8d2e,null))['then'](function(_0x46bb80){if(_0x46bb80){return _0x46bb80[_0x92a2('0x44')](_0x1f53f3[_0x92a2('0x41')][_0x92a2('0x46')],_['omit'](_0x1f53f3[_0x92a2('0x41')],[_0x92a2('0x46'),'id'])||{});}})[_0x92a2('0x23')](respondWithResult(_0x3f8d2e,null))['catch'](handleError(_0x3f8d2e,null));};exports[_0x92a2('0x47')]=function(_0x190051,_0x29ef67,_0x1c2e39){var _0x5083ab={};var _0xc492ba={};var _0x6f0f23;var _0x5ecf79;return db['Automation'][_0x92a2('0x48')]({'where':{'id':_0x190051['params']['id']}})[_0x92a2('0x23')](handleEntityNotFound(_0x29ef67,null))[_0x92a2('0x23')](function(_0x2bf2a4){if(_0x2bf2a4){_0x6f0f23=_0x2bf2a4;_0xc492ba[_0x92a2('0x2b')]=_['keys'](db[_0x92a2('0x45')][_0x92a2('0x49')]);_0xc492ba[_0x92a2('0x2c')]=_[_0x92a2('0x3c')](_0x190051[_0x92a2('0x2c')]);_0xc492ba[_0x92a2('0x2d')]=_[_0x92a2('0x2f')](_0xc492ba[_0x92a2('0x2b')],_0xc492ba[_0x92a2('0x2c')]);_0x5083ab[_0x92a2('0x2e')]=_[_0x92a2('0x2f')](_0xc492ba[_0x92a2('0x2b')],qs[_0x92a2('0x30')](_0x190051[_0x92a2('0x2c')][_0x92a2('0x30')]));_0x5083ab['attributes']=_0x5083ab[_0x92a2('0x2e')][_0x92a2('0x3d')]?_0x5083ab[_0x92a2('0x2e')]:_0xc492ba[_0x92a2('0x2b')];_0x5083ab[_0x92a2('0x4a')]=qs[_0x92a2('0x31')](_0x190051[_0x92a2('0x2c')][_0x92a2('0x31')]);_0x5083ab[_0x92a2('0x32')]=qs[_0x92a2('0x2d')](_['pick'](_0x190051[_0x92a2('0x2c')],_0xc492ba[_0x92a2('0x2d')]));if(_0x190051[_0x92a2('0x2c')]['filter']){_0x5083ab[_0x92a2('0x32')]=_[_0x92a2('0x34')](_0x5083ab[_0x92a2('0x32')],{'$or':_[_0x92a2('0x26')](_0x5083ab['attributes'],function(_0x402944){var _0x28a61e={};_0x28a61e[_0x402944]={'$like':'%'+_0x190051[_0x92a2('0x2c')][_0x92a2('0x33')]+'%'};return _0x28a61e;})});}_0x5083ab=_[_0x92a2('0x34')]({},_0x5083ab,_0x190051[_0x92a2('0x36')]);return _0x6f0f23[_0x92a2('0x47')](_0x5083ab);}})['then'](function(_0x14ef81){if(_0x14ef81){_0x5ecf79=_0x14ef81['length'];if(!_0x190051['query']['hasOwnProperty'](_0x92a2('0x4b'))){_0x5083ab[_0x92a2('0x1d')]=qs['limit'](_0x190051['query']['limit']);_0x5083ab[_0x92a2('0x1b')]=qs[_0x92a2('0x1b')](_0x190051['query'][_0x92a2('0x1b')]);}return _0x6f0f23[_0x92a2('0x47')](_0x5083ab);}})[_0x92a2('0x23')](function(_0xd969d8){if(_0xd969d8){return _0xd969d8?{'count':_0x5ecf79,'rows':_0xd969d8}:null;}})['then'](respondWithResult(_0x29ef67,null))[_0x92a2('0x3f')](handleError(_0x29ef67,null));};exports[_0x92a2('0x4c')]=function(_0xd48d79,_0x1a4d64,_0x47eca0){return db[_0x92a2('0x4d')][_0x92a2('0x3e')]({'where':{'id':_0xd48d79[_0x92a2('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1a4d64,null))[_0x92a2('0x23')](function(_0x3ab2bf){if(_0x3ab2bf){return _0x3ab2bf[_0x92a2('0x4c')](_0xd48d79[_0x92a2('0x41')][_0x92a2('0x46')],_[_0x92a2('0x4e')](_0xd48d79[_0x92a2('0x41')],[_0x92a2('0x46'),'id'])||{});}})[_0x92a2('0x23')](respondWithResult(_0x1a4d64,null))[_0x92a2('0x3f')](handleError(_0x1a4d64,null));};exports[_0x92a2('0x4f')]=function(_0xbbd858,_0x50f3f0,_0x193e98){var _0x28f631={};var _0x418693={};var _0x30c6de;var _0x3a4d2d;return db[_0x92a2('0x27')][_0x92a2('0x48')]({'where':{'id':_0xbbd858[_0x92a2('0x3b')]['id']}})[_0x92a2('0x23')](handleEntityNotFound(_0x50f3f0,null))[_0x92a2('0x23')](function(_0x49c049){if(_0x49c049){_0x30c6de=_0x49c049;_0x418693[_0x92a2('0x2b')]=_[_0x92a2('0x3c')](db[_0x92a2('0x4d')][_0x92a2('0x49')]);_0x418693[_0x92a2('0x2c')]=_['keys'](_0xbbd858[_0x92a2('0x2c')]);_0x418693[_0x92a2('0x2d')]=_['intersection'](_0x418693[_0x92a2('0x2b')],_0x418693[_0x92a2('0x2c')]);_0x28f631['attributes']=_[_0x92a2('0x2f')](_0x418693[_0x92a2('0x2b')],qs['fields'](_0xbbd858[_0x92a2('0x2c')][_0x92a2('0x30')]));_0x28f631[_0x92a2('0x2e')]=_0x28f631[_0x92a2('0x2e')][_0x92a2('0x3d')]?_0x28f631['attributes']:_0x418693[_0x92a2('0x2b')];_0x28f631[_0x92a2('0x4a')]=qs['sort'](_0xbbd858[_0x92a2('0x2c')][_0x92a2('0x31')]);_0x28f631['where']=qs[_0x92a2('0x2d')](_[_0x92a2('0x50')](_0xbbd858['query'],_0x418693[_0x92a2('0x2d')]));if(_0xbbd858[_0x92a2('0x2c')]['filter']){_0x28f631['where']=_[_0x92a2('0x34')](_0x28f631[_0x92a2('0x32')],{'$or':_[_0x92a2('0x26')](_0x28f631['attributes'],function(_0x2ff43c){var _0x27ed01={};_0x27ed01[_0x2ff43c]={'$like':'%'+_0xbbd858[_0x92a2('0x2c')][_0x92a2('0x33')]+'%'};return _0x27ed01;})});}_0x28f631=_['merge']({},_0x28f631,_0xbbd858['options']);return _0x30c6de['getActions'](_0x28f631);}})[_0x92a2('0x23')](function(_0x25a4cb){if(_0x25a4cb){_0x3a4d2d=_0x25a4cb['length'];if(!_0xbbd858['query']['hasOwnProperty'](_0x92a2('0x4b'))){_0x28f631[_0x92a2('0x1d')]=qs[_0x92a2('0x1d')](_0xbbd858[_0x92a2('0x2c')][_0x92a2('0x1d')]);_0x28f631[_0x92a2('0x1b')]=qs[_0x92a2('0x1b')](_0xbbd858[_0x92a2('0x2c')]['offset']);}return _0x30c6de[_0x92a2('0x4f')](_0x28f631);}})[_0x92a2('0x23')](function(_0x1793e3){if(_0x1793e3){return _0x1793e3?{'count':_0x3a4d2d,'rows':_0x1793e3}:null;}})['then'](respondWithResult(_0x50f3f0,null))[_0x92a2('0x3f')](handleError(_0x50f3f0,null));};
\ No newline at end of file
+var _0x5b8f=['params','length','options','find','create','body','addConditions','Condition','omit','getConditions','findOne','sort','Action','addActions','ids','getActions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','merge','Automation','include','findAll','rows','catch','show'];(function(_0x1900a3,_0x5c9e62){var _0x434e6e=function(_0x36ee8e){while(--_0x36ee8e){_0x1900a3['push'](_0x1900a3['shift']());}};_0x434e6e(++_0x5c9e62);}(_0x5b8f,0x1b9));var _0xf5b8=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0x5b8f[_0x547af];return _0x22f7f4;};'use strict';var emlformat=require(_0xf5b8('0x0'));var rimraf=require(_0xf5b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5b8('0x2'));var rp=require(_0xf5b8('0x3'));var moment=require('moment');var BPromise=require(_0xf5b8('0x4'));var Mustache=require(_0xf5b8('0x5'));var util=require(_0xf5b8('0x6'));var path=require(_0xf5b8('0x7'));var sox=require(_0xf5b8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5b8('0x9'));var _=require(_0xf5b8('0xa'));var squel=require(_0xf5b8('0xb'));var crypto=require(_0xf5b8('0xc'));var jsforce=require(_0xf5b8('0xd'));var deskjs=require(_0xf5b8('0xe'));var toCsv=require(_0xf5b8('0xf'));var querystring=require(_0xf5b8('0x10'));var Papa=require(_0xf5b8('0x11'));var Redis=require(_0xf5b8('0x12'));var authService=require(_0xf5b8('0x13'));var qs=require(_0xf5b8('0x14'));var as=require(_0xf5b8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5b8('0x16'))(_0xf5b8('0x17'));var utils=require('../../config/utils');var config=require(_0xf5b8('0x18'));var licenseUtil=require(_0xf5b8('0x19'));var db=require(_0xf5b8('0x1a'))['db'];function respondWithStatusCode(_0x17754e,_0x466168){_0x466168=_0x466168||0xcc;return function(_0x3585de){if(_0x3585de){return _0x17754e[_0xf5b8('0x1b')](_0x466168);}return _0x17754e['status'](_0x466168)[_0xf5b8('0x1c')]();};}function respondWithResult(_0x49055b,_0x2ed5f4){_0x2ed5f4=_0x2ed5f4||0xc8;return function(_0x5bbbbd){if(_0x5bbbbd){return _0x49055b[_0xf5b8('0x1d')](_0x2ed5f4)[_0xf5b8('0x1e')](_0x5bbbbd);}};}function respondWithFilteredResult(_0x5b8214,_0x56a6e6){return function(_0x2aa97c){if(_0x2aa97c){var _0xc06d8e=typeof _0x56a6e6[_0xf5b8('0x1f')]===_0xf5b8('0x20')&&typeof _0x56a6e6[_0xf5b8('0x21')]==='undefined';var _0x2644e3=_0x2aa97c[_0xf5b8('0x22')];var _0x1dc536=_0xc06d8e?0x0:_0x56a6e6[_0xf5b8('0x1f')];var _0x6c57a5=_0xc06d8e?_0x2aa97c['count']:_0x56a6e6['offset']+_0x56a6e6['limit'];var _0xb7ad78;if(_0x6c57a5>=_0x2644e3){_0x6c57a5=_0x2644e3;_0xb7ad78=0xc8;}else{_0xb7ad78=0xce;}_0x5b8214[_0xf5b8('0x1d')](_0xb7ad78);return _0x5b8214['set'](_0xf5b8('0x23'),_0x1dc536+'-'+_0x6c57a5+'/'+_0x2644e3)['json'](_0x2aa97c);}return null;};}function patchUpdates(_0x30e5c9){return function(_0x1fe88b){try{jsonpatch[_0xf5b8('0x24')](_0x1fe88b,_0x30e5c9,!![]);}catch(_0x524b5b){return BPromise['reject'](_0x524b5b);}return _0x1fe88b[_0xf5b8('0x25')]();};}function saveUpdates(_0x6c9f71,_0x277b24){return function(_0x530cf4){if(_0x530cf4){return _0x530cf4[_0xf5b8('0x26')](_0x6c9f71)[_0xf5b8('0x27')](function(_0x110881){return _0x110881;});}return null;};}function removeEntity(_0x2f6fac,_0x51b9c9){return function(_0x4ef333){if(_0x4ef333){return _0x4ef333[_0xf5b8('0x28')]()[_0xf5b8('0x27')](function(){_0x2f6fac[_0xf5b8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d63cb,_0x252040){return function(_0x2349e8){if(!_0x2349e8){_0x4d63cb[_0xf5b8('0x1b')](0x194);}return _0x2349e8;};}function handleError(_0xc03de5,_0x36888e){_0x36888e=_0x36888e||0x1f4;return function(_0x54ff0e){logger['error'](_0x54ff0e['stack']);if(_0x54ff0e[_0xf5b8('0x29')]){delete _0x54ff0e[_0xf5b8('0x29')];}_0xc03de5['status'](_0x36888e)[_0xf5b8('0x2a')](_0x54ff0e);};}exports['index']=function(_0x29f8b0,_0x491689){var _0xf99c95={},_0xa30be1={},_0x42a3aa={'count':0x0,'rows':[]};var _0x16e142=_[_0xf5b8('0x2b')](db['Automation'][_0xf5b8('0x2c')],function(_0x23ba72){return{'name':_0x23ba72[_0xf5b8('0x2d')],'type':_0x23ba72['type'][_0xf5b8('0x2e')]};});_0xa30be1[_0xf5b8('0x2f')]=_[_0xf5b8('0x2b')](_0x16e142,'name');_0xa30be1[_0xf5b8('0x30')]=_[_0xf5b8('0x31')](_0x29f8b0[_0xf5b8('0x30')]);_0xa30be1[_0xf5b8('0x32')]=_['intersection'](_0xa30be1[_0xf5b8('0x2f')],_0xa30be1[_0xf5b8('0x30')]);_0xf99c95[_0xf5b8('0x33')]=_[_0xf5b8('0x34')](_0xa30be1[_0xf5b8('0x2f')],qs[_0xf5b8('0x35')](_0x29f8b0[_0xf5b8('0x30')][_0xf5b8('0x35')]));_0xf99c95['attributes']=_0xf99c95[_0xf5b8('0x33')]['length']?_0xf99c95[_0xf5b8('0x33')]:_0xa30be1[_0xf5b8('0x2f')];if(!_0x29f8b0[_0xf5b8('0x30')][_0xf5b8('0x36')](_0xf5b8('0x37'))){_0xf99c95[_0xf5b8('0x21')]=qs['limit'](_0x29f8b0[_0xf5b8('0x30')][_0xf5b8('0x21')]);_0xf99c95['offset']=qs[_0xf5b8('0x1f')](_0x29f8b0[_0xf5b8('0x30')]['offset']);}_0xf99c95[_0xf5b8('0x38')]=qs['sort'](_0x29f8b0[_0xf5b8('0x30')]['sort']);_0xf99c95[_0xf5b8('0x39')]=qs[_0xf5b8('0x32')](_[_0xf5b8('0x3a')](_0x29f8b0['query'],_0xa30be1[_0xf5b8('0x32')]),_0x16e142);if(_0x29f8b0[_0xf5b8('0x30')][_0xf5b8('0x3b')]){_0xf99c95[_0xf5b8('0x39')]=_['merge'](_0xf99c95[_0xf5b8('0x39')],{'$or':_[_0xf5b8('0x2b')](_0x16e142,function(_0x3a6696){if(_0x3a6696[_0xf5b8('0x3c')]!==_0xf5b8('0x3d')){var _0x3148d3={};_0x3148d3[_0x3a6696[_0xf5b8('0x29')]]={'$like':'%'+_0x29f8b0['query'][_0xf5b8('0x3b')]+'%'};return _0x3148d3;}})});}_0xf99c95=_[_0xf5b8('0x3e')]({},_0xf99c95,_0x29f8b0['options']);var _0x26317f={'where':_0xf99c95[_0xf5b8('0x39')]};return db[_0xf5b8('0x3f')][_0xf5b8('0x22')](_0x26317f)[_0xf5b8('0x27')](function(_0x457572){_0x42a3aa['count']=_0x457572;if(_0x29f8b0[_0xf5b8('0x30')]['includeAll']){_0xf99c95[_0xf5b8('0x40')]=[{'all':!![]}];}return db[_0xf5b8('0x3f')][_0xf5b8('0x41')](_0xf99c95);})[_0xf5b8('0x27')](function(_0x1eb439){_0x42a3aa[_0xf5b8('0x42')]=_0x1eb439;return _0x42a3aa;})[_0xf5b8('0x27')](respondWithFilteredResult(_0x491689,_0xf99c95))[_0xf5b8('0x43')](handleError(_0x491689,null));};exports[_0xf5b8('0x44')]=function(_0x2d218c,_0x4b3b75){var _0x233c5a={'raw':![],'where':{'id':_0x2d218c[_0xf5b8('0x45')]['id']}},_0x47cfc3={};_0x47cfc3[_0xf5b8('0x2f')]=_[_0xf5b8('0x31')](db[_0xf5b8('0x3f')]['rawAttributes']);_0x47cfc3[_0xf5b8('0x30')]=_[_0xf5b8('0x31')](_0x2d218c[_0xf5b8('0x30')]);_0x47cfc3['filters']=_[_0xf5b8('0x34')](_0x47cfc3['model'],_0x47cfc3[_0xf5b8('0x30')]);_0x233c5a['attributes']=_[_0xf5b8('0x34')](_0x47cfc3[_0xf5b8('0x2f')],qs[_0xf5b8('0x35')](_0x2d218c['query']['fields']));_0x233c5a['attributes']=_0x233c5a[_0xf5b8('0x33')][_0xf5b8('0x46')]?_0x233c5a[_0xf5b8('0x33')]:_0x47cfc3['model'];if(_0x2d218c[_0xf5b8('0x30')]['includeAll']){_0x233c5a[_0xf5b8('0x40')]=[{'all':!![]}];}_0x233c5a=_['merge']({},_0x233c5a,_0x2d218c[_0xf5b8('0x47')]);return db[_0xf5b8('0x3f')][_0xf5b8('0x48')](_0x233c5a)[_0xf5b8('0x27')](handleEntityNotFound(_0x4b3b75,null))[_0xf5b8('0x27')](respondWithResult(_0x4b3b75,null))[_0xf5b8('0x43')](handleError(_0x4b3b75,null));};exports[_0xf5b8('0x49')]=function(_0x1e9a62,_0x158bd5){return db[_0xf5b8('0x3f')][_0xf5b8('0x49')](_0x1e9a62[_0xf5b8('0x4a')],{})['then'](respondWithResult(_0x158bd5,0xc9))[_0xf5b8('0x43')](handleError(_0x158bd5,null));};exports[_0xf5b8('0x26')]=function(_0x52c9b8,_0x58c7c1){if(_0x52c9b8[_0xf5b8('0x4a')]['id']){delete _0x52c9b8['body']['id'];}return db[_0xf5b8('0x3f')][_0xf5b8('0x48')]({'where':{'id':_0x52c9b8[_0xf5b8('0x45')]['id']}})[_0xf5b8('0x27')](handleEntityNotFound(_0x58c7c1,null))[_0xf5b8('0x27')](saveUpdates(_0x52c9b8[_0xf5b8('0x4a')],null))[_0xf5b8('0x27')](respondWithResult(_0x58c7c1,null))['catch'](handleError(_0x58c7c1,null));};exports[_0xf5b8('0x28')]=function(_0x4ba7bf,_0x12bc73){return db['Automation'][_0xf5b8('0x48')]({'where':{'id':_0x4ba7bf[_0xf5b8('0x45')]['id']}})[_0xf5b8('0x27')](handleEntityNotFound(_0x12bc73,null))[_0xf5b8('0x27')](removeEntity(_0x12bc73,null))[_0xf5b8('0x43')](handleError(_0x12bc73,null));};exports[_0xf5b8('0x4b')]=function(_0x138757,_0x393259,_0x1781a4){return db[_0xf5b8('0x4c')][_0xf5b8('0x48')]({'where':{'id':_0x138757[_0xf5b8('0x45')]['id']}})['then'](handleEntityNotFound(_0x393259,null))[_0xf5b8('0x27')](function(_0x2b1f28){if(_0x2b1f28){return _0x2b1f28[_0xf5b8('0x4b')](_0x138757[_0xf5b8('0x4a')]['ids'],_[_0xf5b8('0x4d')](_0x138757[_0xf5b8('0x4a')],['ids','id'])||{});}})[_0xf5b8('0x27')](respondWithResult(_0x393259,null))[_0xf5b8('0x43')](handleError(_0x393259,null));};exports[_0xf5b8('0x4e')]=function(_0x3a9255,_0x1838e0,_0x579466){var _0x568da7={};var _0x277d0c={};var _0x50b567;var _0x4c8984;return db[_0xf5b8('0x3f')][_0xf5b8('0x4f')]({'where':{'id':_0x3a9255['params']['id']}})[_0xf5b8('0x27')](handleEntityNotFound(_0x1838e0,null))[_0xf5b8('0x27')](function(_0x2cb38c){if(_0x2cb38c){_0x50b567=_0x2cb38c;_0x277d0c[_0xf5b8('0x2f')]=_[_0xf5b8('0x31')](db[_0xf5b8('0x4c')][_0xf5b8('0x2c')]);_0x277d0c[_0xf5b8('0x30')]=_[_0xf5b8('0x31')](_0x3a9255[_0xf5b8('0x30')]);_0x277d0c['filters']=_[_0xf5b8('0x34')](_0x277d0c[_0xf5b8('0x2f')],_0x277d0c[_0xf5b8('0x30')]);_0x568da7[_0xf5b8('0x33')]=_[_0xf5b8('0x34')](_0x277d0c[_0xf5b8('0x2f')],qs[_0xf5b8('0x35')](_0x3a9255[_0xf5b8('0x30')][_0xf5b8('0x35')]));_0x568da7['attributes']=_0x568da7[_0xf5b8('0x33')][_0xf5b8('0x46')]?_0x568da7[_0xf5b8('0x33')]:_0x277d0c[_0xf5b8('0x2f')];_0x568da7[_0xf5b8('0x38')]=qs[_0xf5b8('0x50')](_0x3a9255[_0xf5b8('0x30')]['sort']);_0x568da7[_0xf5b8('0x39')]=qs['filters'](_['pick'](_0x3a9255[_0xf5b8('0x30')],_0x277d0c[_0xf5b8('0x32')]));if(_0x3a9255['query'][_0xf5b8('0x3b')]){_0x568da7[_0xf5b8('0x39')]=_['merge'](_0x568da7[_0xf5b8('0x39')],{'$or':_[_0xf5b8('0x2b')](_0x568da7[_0xf5b8('0x33')],function(_0x16e1d7){var _0x3d88b8={};_0x3d88b8[_0x16e1d7]={'$like':'%'+_0x3a9255[_0xf5b8('0x30')][_0xf5b8('0x3b')]+'%'};return _0x3d88b8;})});}_0x568da7=_[_0xf5b8('0x3e')]({},_0x568da7,_0x3a9255[_0xf5b8('0x47')]);return _0x50b567[_0xf5b8('0x4e')](_0x568da7);}})[_0xf5b8('0x27')](function(_0x24e125){if(_0x24e125){_0x4c8984=_0x24e125[_0xf5b8('0x46')];if(!_0x3a9255[_0xf5b8('0x30')][_0xf5b8('0x36')]('nolimit')){_0x568da7['limit']=qs['limit'](_0x3a9255['query'][_0xf5b8('0x21')]);_0x568da7[_0xf5b8('0x1f')]=qs['offset'](_0x3a9255['query'][_0xf5b8('0x1f')]);}return _0x50b567[_0xf5b8('0x4e')](_0x568da7);}})[_0xf5b8('0x27')](function(_0x315fbe){if(_0x315fbe){return _0x315fbe?{'count':_0x4c8984,'rows':_0x315fbe}:null;}})[_0xf5b8('0x27')](respondWithResult(_0x1838e0,null))[_0xf5b8('0x43')](handleError(_0x1838e0,null));};exports['addActions']=function(_0xbc33bc,_0x28bff0,_0x316a65){return db[_0xf5b8('0x51')][_0xf5b8('0x48')]({'where':{'id':_0xbc33bc[_0xf5b8('0x45')]['id']}})[_0xf5b8('0x27')](handleEntityNotFound(_0x28bff0,null))[_0xf5b8('0x27')](function(_0x501059){if(_0x501059){return _0x501059[_0xf5b8('0x52')](_0xbc33bc['body'][_0xf5b8('0x53')],_[_0xf5b8('0x4d')](_0xbc33bc[_0xf5b8('0x4a')],[_0xf5b8('0x53'),'id'])||{});}})[_0xf5b8('0x27')](respondWithResult(_0x28bff0,null))[_0xf5b8('0x43')](handleError(_0x28bff0,null));};exports[_0xf5b8('0x54')]=function(_0x384b6e,_0x26cd01,_0x3512e2){var _0xad9704={};var _0x1d79f0={};var _0xf65ddf;var _0x401916;return db[_0xf5b8('0x3f')][_0xf5b8('0x4f')]({'where':{'id':_0x384b6e['params']['id']}})[_0xf5b8('0x27')](handleEntityNotFound(_0x26cd01,null))[_0xf5b8('0x27')](function(_0xa9afd8){if(_0xa9afd8){_0xf65ddf=_0xa9afd8;_0x1d79f0[_0xf5b8('0x2f')]=_[_0xf5b8('0x31')](db[_0xf5b8('0x51')][_0xf5b8('0x2c')]);_0x1d79f0[_0xf5b8('0x30')]=_[_0xf5b8('0x31')](_0x384b6e[_0xf5b8('0x30')]);_0x1d79f0['filters']=_['intersection'](_0x1d79f0['model'],_0x1d79f0[_0xf5b8('0x30')]);_0xad9704[_0xf5b8('0x33')]=_['intersection'](_0x1d79f0[_0xf5b8('0x2f')],qs[_0xf5b8('0x35')](_0x384b6e['query'][_0xf5b8('0x35')]));_0xad9704[_0xf5b8('0x33')]=_0xad9704[_0xf5b8('0x33')][_0xf5b8('0x46')]?_0xad9704['attributes']:_0x1d79f0[_0xf5b8('0x2f')];_0xad9704['order']=qs[_0xf5b8('0x50')](_0x384b6e[_0xf5b8('0x30')][_0xf5b8('0x50')]);_0xad9704[_0xf5b8('0x39')]=qs[_0xf5b8('0x32')](_[_0xf5b8('0x3a')](_0x384b6e[_0xf5b8('0x30')],_0x1d79f0['filters']));if(_0x384b6e[_0xf5b8('0x30')][_0xf5b8('0x3b')]){_0xad9704[_0xf5b8('0x39')]=_[_0xf5b8('0x3e')](_0xad9704[_0xf5b8('0x39')],{'$or':_[_0xf5b8('0x2b')](_0xad9704[_0xf5b8('0x33')],function(_0x5c1dc3){var _0x4acd32={};_0x4acd32[_0x5c1dc3]={'$like':'%'+_0x384b6e[_0xf5b8('0x30')][_0xf5b8('0x3b')]+'%'};return _0x4acd32;})});}_0xad9704=_[_0xf5b8('0x3e')]({},_0xad9704,_0x384b6e['options']);return _0xf65ddf['getActions'](_0xad9704);}})[_0xf5b8('0x27')](function(_0x58212d){if(_0x58212d){_0x401916=_0x58212d[_0xf5b8('0x46')];if(!_0x384b6e[_0xf5b8('0x30')][_0xf5b8('0x36')](_0xf5b8('0x37'))){_0xad9704[_0xf5b8('0x21')]=qs[_0xf5b8('0x21')](_0x384b6e[_0xf5b8('0x30')]['limit']);_0xad9704[_0xf5b8('0x1f')]=qs[_0xf5b8('0x1f')](_0x384b6e[_0xf5b8('0x30')]['offset']);}return _0xf65ddf['getActions'](_0xad9704);}})[_0xf5b8('0x27')](function(_0x1a31ef){if(_0x1a31ef){return _0x1a31ef?{'count':_0x401916,'rows':_0x1a31ef}:null;}})['then'](respondWithResult(_0x26cd01,null))[_0xf5b8('0x43')](handleError(_0x26cd01,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index de4162f..ea4b784 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 _0x3f24=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x537662,_0x3f1da7){var _0x3bbccf=function(_0x523247){while(--_0x523247){_0x537662['push'](_0x537662['shift']());}};_0x3bbccf(++_0x3f1da7);}(_0x3f24,0x1a2));var _0x43f2=function(_0x5ed0a7,_0x2dc03a){_0x5ed0a7=_0x5ed0a7-0x0;var _0x8378c5=_0x3f24[_0x5ed0a7];return _0x8378c5;};'use strict';var _=require(_0x43f2('0x0'));var util=require(_0x43f2('0x1'));var logger=require(_0x43f2('0x2'))('api');var moment=require(_0x43f2('0x3'));var BPromise=require('bluebird');var rp=require(_0x43f2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x43f2('0x5'));var config=require(_0x43f2('0x6'));var attributes=require('./automation.attributes');module[_0x43f2('0x7')]=function(_0x2d9e02,_0xbaf19e){return _0x2d9e02[_0x43f2('0x8')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb187=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./automation.attributes','define','Automation','tools_automations'];(function(_0x273e70,_0x2971ab){var _0x2cf818=function(_0x3ef2d1){while(--_0x3ef2d1){_0x273e70['push'](_0x273e70['shift']());}};_0x2cf818(++_0x2971ab);}(_0xb187,0x179));var _0x7b18=function(_0x14082b,_0x3672d6){_0x14082b=_0x14082b-0x0;var _0x53a93d=_0xb187[_0x14082b];return _0x53a93d;};'use strict';var _=require(_0x7b18('0x0'));var util=require(_0x7b18('0x1'));var logger=require(_0x7b18('0x2'))(_0x7b18('0x3'));var moment=require(_0x7b18('0x4'));var BPromise=require(_0x7b18('0x5'));var rp=require(_0x7b18('0x6'));var fs=require('fs');var path=require(_0x7b18('0x7'));var rimraf=require(_0x7b18('0x8'));var config=require('../../config/environment');var attributes=require(_0x7b18('0x9'));module['exports']=function(_0x4eabbb,_0xb62d13){return _0x4eabbb[_0x7b18('0xa')](_0x7b18('0xb'),attributes,{'tableName':_0x7b18('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 43be275..e9f4bda 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 _0x117c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','bluebird'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x117c,0x71));var _0xc117=function(_0x41b29e,_0x34b288){_0x41b29e=_0x41b29e-0x0;var _0xacd517=_0x117c[_0x41b29e];return _0xacd517;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc117('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc117('0x1'))['db'];var utils=require(_0xc117('0x2'));var logger=require(_0xc117('0x3'))(_0xc117('0x4'));var config=require(_0xc117('0x5'));var jayson=require(_0xc117('0x6'));var client=jayson['client'][_0xc117('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x389734,_0x48efbb,_0x181a70){return new BPromise(function(_0x56c9bd,_0x451447){return client[_0xc117('0x8')](_0x389734,_0x181a70)[_0xc117('0x9')](function(_0x39e33f){logger[_0xc117('0xa')]('Automation,\x20%s,\x20%s',_0x48efbb,_0xc117('0xb'));logger['debug'](_0xc117('0xc'),_0x48efbb,'request\x20sent',JSON[_0xc117('0xd')](_0x39e33f));if(_0x39e33f[_0xc117('0xe')]){if(_0x39e33f['error'][_0xc117('0xf')]===0x1f4){logger['error'](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x451447(_0x39e33f[_0xc117('0xe')]['message']);}logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x56c9bd(_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);}else{logger[_0xc117('0xa')](_0xc117('0x10'),_0x48efbb,_0xc117('0xb'));_0x56c9bd(_0x39e33f['result']['message']);}})[_0xc117('0x12')](function(_0x241ee7){logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x241ee7);_0x451447(_0x241ee7);});});}
\ No newline at end of file
+var _0x0e56=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x0e56,0xf5));var _0x60e5=function(_0x3f52d9,_0x1d748c){_0x3f52d9=_0x3f52d9-0x0;var _0x21e01f=_0x0e56[_0x3f52d9];return _0x21e01f;};'use strict';var _=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var moment=require('moment');var BPromise=require(_0x60e5('0x2'));var rs=require(_0x60e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60e5('0x4'))['db'];var utils=require(_0x60e5('0x5'));var logger=require(_0x60e5('0x6'))(_0x60e5('0x7'));var config=require(_0x60e5('0x8'));var jayson=require(_0x60e5('0x9'));var client=jayson[_0x60e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b44b9,_0x5513f2,_0x31765c){return new BPromise(function(_0x3083a0,_0x59389e){return client[_0x60e5('0xb')](_0x1b44b9,_0x31765c)[_0x60e5('0xc')](function(_0x46d531){logger[_0x60e5('0xd')](_0x60e5('0xe'),_0x5513f2,_0x60e5('0xf'));logger[_0x60e5('0x10')](_0x60e5('0x11'),_0x5513f2,_0x60e5('0xf'),JSON[_0x60e5('0x12')](_0x46d531));if(_0x46d531[_0x60e5('0x13')]){if(_0x46d531[_0x60e5('0x13')][_0x60e5('0x14')]===0x1f4){logger[_0x60e5('0x13')](_0x60e5('0xe'),_0x5513f2,_0x46d531[_0x60e5('0x13')]['message']);return _0x59389e(_0x46d531[_0x60e5('0x13')]['message']);}logger['error'](_0x60e5('0xe'),_0x5513f2,_0x46d531[_0x60e5('0x13')]['message']);return _0x3083a0(_0x46d531[_0x60e5('0x13')][_0x60e5('0x15')]);}else{logger[_0x60e5('0xd')](_0x60e5('0xe'),_0x5513f2,'request\x20sent');_0x3083a0(_0x46d531[_0x60e5('0x16')][_0x60e5('0x15')]);}})[_0x60e5('0x17')](function(_0x1ed08d){logger[_0x60e5('0x13')](_0x60e5('0xe'),_0x5513f2,_0x1ed08d);_0x59389e(_0x1ed08d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 0d6aa4f..de7c861 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 _0xef1c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','create','/:id/actions','put','/:id','exports','multer','util','connect-timeout','express'];(function(_0x18bebd,_0x32f07a){var _0x42524b=function(_0x2db8d2){while(--_0x2db8d2){_0x18bebd['push'](_0x18bebd['shift']());}};_0x42524b(++_0x32f07a);}(_0xef1c,0x176));var _0xcef1=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xef1c[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xcef1('0x0'));var util=require(_0xcef1('0x1'));var path=require('path');var timeout=require(_0xcef1('0x2'));var express=require(_0xcef1('0x3'));var router=express[_0xcef1('0x4')]();var fs_extra=require(_0xcef1('0x5'));var auth=require(_0xcef1('0x6'));var interaction=require(_0xcef1('0x7'));var config=require('../../config/environment');var controller=require(_0xcef1('0x8'));router[_0xcef1('0x9')]('/',auth[_0xcef1('0xa')](),controller['index']);router[_0xcef1('0x9')]('/:id',auth[_0xcef1('0xa')](),controller[_0xcef1('0xb')]);router[_0xcef1('0x9')](_0xcef1('0xc'),auth['isAuthenticated'](),controller[_0xcef1('0xd')]);router[_0xcef1('0x9')]('/:id/actions',auth[_0xcef1('0xa')](),controller[_0xcef1('0xe')]);router[_0xcef1('0xf')]('/',auth['isAuthenticated'](),controller[_0xcef1('0x10')]);router['post']('/:id/conditions',auth[_0xcef1('0xa')](),controller['addConditions']);router[_0xcef1('0xf')](_0xcef1('0x11'),auth[_0xcef1('0xa')](),controller['addActions']);router[_0xcef1('0x12')](_0xcef1('0x13'),auth[_0xcef1('0xa')](),controller['update']);router['delete'](_0xcef1('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xcef1('0x14')]=router;
\ No newline at end of file
+var _0xd7f0=['update','delete','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put'];(function(_0x5a9f02,_0x2cb596){var _0x79f3a1=function(_0x9fdf9d){while(--_0x9fdf9d){_0x5a9f02['push'](_0x5a9f02['shift']());}};_0x79f3a1(++_0x2cb596);}(_0xd7f0,0x145));var _0x0d7f=function(_0x543afc,_0x70c9b6){_0x543afc=_0x543afc-0x0;var _0x588f2a=_0xd7f0[_0x543afc];return _0x588f2a;};'use strict';var multer=require(_0x0d7f('0x0'));var util=require(_0x0d7f('0x1'));var path=require(_0x0d7f('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d7f('0x3'));var router=express['Router']();var fs_extra=require(_0x0d7f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0d7f('0x5'));var config=require(_0x0d7f('0x6'));var controller=require(_0x0d7f('0x7'));router[_0x0d7f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0d7f('0x9'),auth[_0x0d7f('0xa')](),controller[_0x0d7f('0xb')]);router[_0x0d7f('0x8')]('/:id/conditions',auth[_0x0d7f('0xa')](),controller[_0x0d7f('0xc')]);router[_0x0d7f('0x8')](_0x0d7f('0xd'),auth['isAuthenticated'](),controller[_0x0d7f('0xe')]);router[_0x0d7f('0xf')]('/',auth[_0x0d7f('0xa')](),controller[_0x0d7f('0x10')]);router[_0x0d7f('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x0d7f('0x11')]);router[_0x0d7f('0xf')](_0x0d7f('0xd'),auth['isAuthenticated'](),controller[_0x0d7f('0x12')]);router[_0x0d7f('0x13')]('/:id',auth[_0x0d7f('0xa')](),controller[_0x0d7f('0x14')]);router[_0x0d7f('0x15')](_0x0d7f('0x9'),auth['isAuthenticated'](),controller[_0x0d7f('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index eca8936..c343192 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 _0xc06d=['#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','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\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,*,*,*','ENUM','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc06d,0x15a));var _0xdc06=function(_0x5bc37f,_0x50debd){_0x5bc37f=_0x5bc37f-0x0;var _0x583e6d=_0xc06d[_0x5bc37f];return _0x583e6d;};'use strict';var Sequelize=require(_0xdc06('0x0'));module[_0xdc06('0x1')]={'name':{'type':Sequelize[_0xdc06('0x2')],'unique':_0xdc06('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdc06('0x4')),'allowNull':![],'defaultValue':_0xdc06('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xdc06('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xdc06('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdc06('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'comment':_0xdc06('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xdc06('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdc06('0x2')],'defaultValue':_0xdc06('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xdc06('0xe')](_0xdc06('0xf'),'never',_0xdc06('0x10')),'defaultValue':_0xdc06('0xf')},'dialAMDActive':{'type':Sequelize[_0xdc06('0x11')],'defaultValue':0x0,'comment':_0xdc06('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xdc06('0x8')](0x9)[_0xdc06('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdc06('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xdc06('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdc06('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdc06('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdc06('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdc06('0x8')](0x9)[_0xdc06('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdc06('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xdc06('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdc06('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdc06('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdc06('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdc06('0x8')](0x9)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdc06('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xdc06('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdc06('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdc06('0x8')](0x9)[_0xdc06('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdc06('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdc06('0xe')](_0xdc06('0x1c'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdc06('0x1d')},'dialCutDigit':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdc06('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x28')}};
\ No newline at end of file
+var _0xb607=['#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','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','name','ENUM','ivr','STRING','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x3661f0,_0x57c3f9){var _0x5a9cbd=function(_0x473393){while(--_0x473393){_0x3661f0['push'](_0x3661f0['shift']());}};_0x5a9cbd(++_0x57c3f9);}(_0xb607,0x178));var _0x7b60=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xb607[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require('sequelize');module[_0x7b60('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7b60('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7b60('0x2')](_0x7b60('0x3')),'allowNull':![],'defaultValue':_0x7b60('0x3')},'description':{'type':Sequelize[_0x7b60('0x4')]},'active':{'type':Sequelize[_0x7b60('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x7b60('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7b60('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x7b60('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7b60('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7b60('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7b60('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7b60('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x7b60('0x8')](0x3)[_0x7b60('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7b60('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7b60('0x8')](0x5)[_0x7b60('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7b60('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7b60('0x8')](0x3)[_0x7b60('0x6')],'defaultValue':0x3,'comment':_0x7b60('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7b60('0x8')](0x5)[_0x7b60('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7b60('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7b60('0xf')},'dialTimezone':{'type':Sequelize[_0x7b60('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7b60('0x4')],'defaultValue':_0x7b60('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x7b60('0x2')](_0x7b60('0x11'),_0x7b60('0x12'),'onlyIfOpen'),'defaultValue':_0x7b60('0x11')},'dialAMDActive':{'type':Sequelize[_0x7b60('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7b60('0x8')](0x9)[_0x7b60('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x7b60('0x8')](0x9)[_0x7b60('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7b60('0x8')](0x9)[_0x7b60('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x7b60('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7b60('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x7b60('0x8')](0x9)[_0x7b60('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7b60('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7b60('0x8')](0x9)[_0x7b60('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7b60('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7b60('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7b60('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7b60('0x8')](0x9)[_0x7b60('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7b60('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7b60('0x2')](_0x7b60('0x19'),_0x7b60('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x7b60('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7b60('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x7b60('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7b60('0x8')](0x3)[_0x7b60('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7b60('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7b60('0x8')](0x5)[_0x7b60('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7b60('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7b60('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7b60('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7b60('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7b60('0x8')](0x3)[_0x7b60('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7b60('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7b60('0x8')](0x5)[_0x7b60('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7b60('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7b60('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7b60('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7b60('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7b60('0x8')](0x3)[_0x7b60('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7b60('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7b60('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7b60('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index df456d7..ff3e79d 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 _0xf485=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','Campaign','includeAll','findAll','rows','show','params','fields','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','user','userProfileId','findOne','CmHopper','hasOwnProperty','nolimit','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','ListId\x20=\x20?','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x1722ea,_0x4244ec){var _0x267aa0=function(_0x22cbe3){while(--_0x22cbe3){_0x1722ea['push'](_0x1722ea['shift']());}};_0x267aa0(++_0x4244ec);}(_0xf485,0x1af));var _0x5f48=function(_0x1a4b58,_0x3c8c4a){_0x1a4b58=_0x1a4b58-0x0;var _0x16e54a=_0xf485[_0x1a4b58];return _0x16e54a;};'use strict';var emlformat=require(_0x5f48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f48('0x2'));var moment=require(_0x5f48('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5f48('0x4'));var util=require(_0x5f48('0x5'));var path=require(_0x5f48('0x6'));var sox=require('sox');var csv=require(_0x5f48('0x7'));var ejs=require(_0x5f48('0x8'));var fs=require('fs');var fs_extra=require(_0x5f48('0x9'));var _=require(_0x5f48('0xa'));var squel=require(_0x5f48('0xb'));var crypto=require(_0x5f48('0xc'));var jsforce=require(_0x5f48('0xd'));var deskjs=require(_0x5f48('0xe'));var toCsv=require(_0x5f48('0x7'));var querystring=require('querystring');var Papa=require(_0x5f48('0xf'));var Redis=require(_0x5f48('0x10'));var authService=require(_0x5f48('0x11'));var qs=require(_0x5f48('0x12'));var as=require(_0x5f48('0x13'));var hardwareService=require(_0x5f48('0x14'));var logger=require(_0x5f48('0x15'))('api');var utils=require(_0x5f48('0x16'));var config=require(_0x5f48('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f48('0x18'))['db'];function respondWithStatusCode(_0x3464d3,_0x1f491d){_0x1f491d=_0x1f491d||0xcc;return function(_0x3e634f){if(_0x3e634f){return _0x3464d3[_0x5f48('0x19')](_0x1f491d);}return _0x3464d3['status'](_0x1f491d)['end']();};}function respondWithResult(_0x36a908,_0x16baa0){_0x16baa0=_0x16baa0||0xc8;return function(_0x1a1183){if(_0x1a1183){return _0x36a908[_0x5f48('0x1a')](_0x16baa0)[_0x5f48('0x1b')](_0x1a1183);}};}function respondWithFilteredResult(_0x470562,_0x474620){return function(_0x26ff72){if(_0x26ff72){var _0x49127f=typeof _0x474620[_0x5f48('0x1c')]===_0x5f48('0x1d')&&typeof _0x474620[_0x5f48('0x1e')]===_0x5f48('0x1d');var _0x324f0e=_0x26ff72['count'];var _0x1d6054=_0x49127f?0x0:_0x474620[_0x5f48('0x1c')];var _0x36896c=_0x49127f?_0x26ff72[_0x5f48('0x1f')]:_0x474620[_0x5f48('0x1c')]+_0x474620['limit'];var _0x636218;if(_0x36896c>=_0x324f0e){_0x36896c=_0x324f0e;_0x636218=0xc8;}else{_0x636218=0xce;}_0x470562[_0x5f48('0x1a')](_0x636218);return _0x470562[_0x5f48('0x20')](_0x5f48('0x21'),_0x1d6054+'-'+_0x36896c+'/'+_0x324f0e)[_0x5f48('0x1b')](_0x26ff72);}return null;};}function patchUpdates(_0x1c0e83){return function(_0x13545d){try{jsonpatch[_0x5f48('0x22')](_0x13545d,_0x1c0e83,!![]);}catch(_0x495e94){return BPromise['reject'](_0x495e94);}return _0x13545d[_0x5f48('0x23')]();};}function saveUpdates(_0x30b10b,_0x535830){return function(_0x40ab87){if(_0x40ab87){return _0x40ab87[_0x5f48('0x24')](_0x30b10b)['then'](function(_0x33dec5){return _0x33dec5;});}return null;};}function removeEntity(_0x58487b,_0x205ad3){return function(_0x315b72){if(_0x315b72){return _0x315b72[_0x5f48('0x25')]()['then'](function(){var _0x48520f=_0x315b72[_0x5f48('0x26')]({'plain':!![]});var _0x22c0a9='IvrCampaigns';return db['UserProfileResource'][_0x5f48('0x25')]({'where':{'type':_0x22c0a9,'resourceId':_0x48520f['id']}})['then'](function(){return _0x315b72;});})[_0x5f48('0x27')](function(){_0x58487b[_0x5f48('0x1a')](0xcc)[_0x5f48('0x28')]();});}};}function handleEntityNotFound(_0xe03d5,_0x12d509){return function(_0x12009d){if(!_0x12009d){_0xe03d5[_0x5f48('0x19')](0x194);}return _0x12009d;};}function handleError(_0x2831c8,_0x16a0cd){_0x16a0cd=_0x16a0cd||0x1f4;return function(_0x4731ab){logger[_0x5f48('0x29')](_0x4731ab[_0x5f48('0x2a')]);if(_0x4731ab[_0x5f48('0x2b')]){delete _0x4731ab[_0x5f48('0x2b')];}_0x2831c8['status'](_0x16a0cd)[_0x5f48('0x2c')](_0x4731ab);};}exports[_0x5f48('0x2d')]=function(_0x30e440,_0x4c10fb){var _0x46b41f={},_0x444e9c={},_0x1a244a={'count':0x0,'rows':[]};var _0x467696=_[_0x5f48('0x2e')](db['Campaign'][_0x5f48('0x2f')],function(_0x49816f){return{'name':_0x49816f[_0x5f48('0x30')],'type':_0x49816f[_0x5f48('0x31')][_0x5f48('0x32')]};});_0x444e9c[_0x5f48('0x33')]=_[_0x5f48('0x2e')](_0x467696,_0x5f48('0x2b'));_0x444e9c[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x30e440[_0x5f48('0x34')]);_0x444e9c[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x444e9c[_0x5f48('0x33')],_0x444e9c['query']);_0x46b41f[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x444e9c[_0x5f48('0x33')],qs['fields'](_0x30e440[_0x5f48('0x34')]['fields']));_0x46b41f[_0x5f48('0x38')]=_0x46b41f[_0x5f48('0x38')][_0x5f48('0x39')]?_0x46b41f[_0x5f48('0x38')]:_0x444e9c[_0x5f48('0x33')];if(!_0x30e440[_0x5f48('0x34')]['hasOwnProperty']('nolimit')){_0x46b41f['limit']=qs[_0x5f48('0x1e')](_0x30e440[_0x5f48('0x34')]['limit']);_0x46b41f[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x30e440[_0x5f48('0x34')][_0x5f48('0x1c')]);}_0x46b41f[_0x5f48('0x3a')]=qs[_0x5f48('0x3b')](_0x30e440[_0x5f48('0x34')][_0x5f48('0x3b')]);_0x46b41f[_0x5f48('0x3c')]=qs['filters'](_['pick'](_0x30e440['query'],_0x444e9c[_0x5f48('0x36')]),_0x467696);if(_0x30e440[_0x5f48('0x34')][_0x5f48('0x3d')]){_0x46b41f[_0x5f48('0x3c')]=_[_0x5f48('0x3e')](_0x46b41f['where'],{'$or':_[_0x5f48('0x2e')](_0x467696,function(_0x153267){if(_0x153267[_0x5f48('0x31')]!==_0x5f48('0x3f')){var _0x310af6={};_0x310af6[_0x153267[_0x5f48('0x2b')]]={'$like':'%'+_0x30e440[_0x5f48('0x34')]['filter']+'%'};return _0x310af6;}})});}_0x46b41f=_[_0x5f48('0x3e')]({},_0x46b41f,_0x30e440[_0x5f48('0x40')]);var _0x6c84e1={'where':_0x46b41f[_0x5f48('0x3c')]};return db[_0x5f48('0x41')]['count'](_0x6c84e1)['then'](function(_0x437f44){_0x1a244a[_0x5f48('0x1f')]=_0x437f44;if(_0x30e440['query'][_0x5f48('0x42')]){_0x46b41f['include']=[{'all':!![]}];}return db[_0x5f48('0x41')][_0x5f48('0x43')](_0x46b41f);})['then'](function(_0x1baa73){_0x1a244a[_0x5f48('0x44')]=_0x1baa73;return _0x1a244a;})['then'](respondWithFilteredResult(_0x4c10fb,_0x46b41f))['catch'](handleError(_0x4c10fb,null));};exports[_0x5f48('0x45')]=function(_0x3e955c,_0x244d96){var _0x403a24={'raw':![],'where':{'id':_0x3e955c[_0x5f48('0x46')]['id']}},_0x260fb8={};_0x260fb8[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x41')][_0x5f48('0x2f')]);_0x260fb8[_0x5f48('0x34')]=_['keys'](_0x3e955c[_0x5f48('0x34')]);_0x260fb8[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x260fb8[_0x5f48('0x33')],_0x260fb8['query']);_0x403a24[_0x5f48('0x38')]=_['intersection'](_0x260fb8[_0x5f48('0x33')],qs[_0x5f48('0x47')](_0x3e955c['query'][_0x5f48('0x47')]));_0x403a24[_0x5f48('0x38')]=_0x403a24[_0x5f48('0x38')][_0x5f48('0x39')]?_0x403a24['attributes']:_0x260fb8[_0x5f48('0x33')];if(_0x3e955c[_0x5f48('0x34')][_0x5f48('0x42')]){_0x403a24[_0x5f48('0x48')]=[{'all':!![]}];}_0x403a24=_[_0x5f48('0x3e')]({},_0x403a24,_0x3e955c[_0x5f48('0x40')]);return db[_0x5f48('0x41')][_0x5f48('0x49')](_0x403a24)[_0x5f48('0x27')](handleEntityNotFound(_0x244d96,null))['then'](respondWithResult(_0x244d96,null))[_0x5f48('0x4a')](handleError(_0x244d96,null));};exports[_0x5f48('0x4b')]=function(_0x34132d,_0x2f813a){return db['Campaign'][_0x5f48('0x4b')](_0x34132d[_0x5f48('0x4c')],{})['then'](function(_0xc23d59){var _0x101015=_0x34132d['user'][_0x5f48('0x26')]({'plain':!![]});if(!_0x101015)throw new Error(_0x5f48('0x4d'));if(_0x101015[_0x5f48('0x4e')]==='user'){var _0x5f3b1f=_0xc23d59['get']({'plain':!![]});var _0x55afb4=_0x5f48('0x4f');return db[_0x5f48('0x50')][_0x5f48('0x49')]({'where':{'name':_0x55afb4,'userProfileId':_0x101015['userProfileId']},'raw':!![]})[_0x5f48('0x27')](function(_0x50fae9){if(_0x50fae9&&_0x50fae9[_0x5f48('0x51')]===0x0){return db[_0x5f48('0x52')][_0x5f48('0x4b')]({'name':_0x5f3b1f['name'],'resourceId':_0x5f3b1f['id'],'type':_0x50fae9[_0x5f48('0x2b')],'sectionId':_0x50fae9['id']},{})[_0x5f48('0x27')](function(){return _0xc23d59;});}else{return _0xc23d59;}})[_0x5f48('0x4a')](function(_0x22302c){logger[_0x5f48('0x29')](_0x5f48('0x53'),_0x22302c);throw _0x22302c;});}return _0xc23d59;})[_0x5f48('0x27')](respondWithResult(_0x2f813a,0xc9))[_0x5f48('0x4a')](handleError(_0x2f813a,null));};exports[_0x5f48('0x54')]=function(_0x1a9ebf,_0x2015cb){var _0x45c74a={'where':{'id':_0x1a9ebf['params']['id']}},_0x4ff63e={};_0x4ff63e[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x41')][_0x5f48('0x2f')]);_0x45c74a[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x4ff63e['model'],qs[_0x5f48('0x47')](_0x1a9ebf[_0x5f48('0x34')]['fields']));_0x45c74a['attributes']=_0x45c74a['attributes'][_0x5f48('0x39')]?_0x45c74a[_0x5f48('0x38')]:_0x4ff63e[_0x5f48('0x33')];if(_0x1a9ebf['query'][_0x5f48('0x42')]){_0x45c74a[_0x5f48('0x48')]=[{'all':!![]}];}_0x45c74a=_[_0x5f48('0x3e')]({},_0x45c74a,_0x1a9ebf[_0x5f48('0x40')]);return db[_0x5f48('0x41')][_0x5f48('0x49')](_0x45c74a)[_0x5f48('0x27')](handleEntityNotFound(_0x2015cb,null))[_0x5f48('0x27')](function(_0x4276b8){if(_0x4276b8){var _0x39f162=_0x4276b8[_0x5f48('0x26')]({'plain':!![]});_0x39f162=qs[_0x5f48('0x55')](_0x39f162,['id','createdAt',_0x5f48('0x56')]);_0x1a9ebf[_0x5f48('0x4c')]=_[_0x5f48('0x55')](_0x1a9ebf[_0x5f48('0x4c')],['id',_0x5f48('0x57'),'updatedAt']);return db[_0x5f48('0x41')]['create'](_[_0x5f48('0x3e')](_0x39f162,_0x1a9ebf['body']),{'include':_0x1a9ebf['query'][_0x5f48('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x284bf8){var _0x17e5ee=_0x1a9ebf[_0x5f48('0x58')]['get']({'plain':!![]});if(!_0x17e5ee)throw new Error(_0x5f48('0x4d'));if(_0x17e5ee[_0x5f48('0x4e')]===_0x5f48('0x58')){var _0x21c051=_0x284bf8[_0x5f48('0x26')]({'plain':!![]});var _0x51365b=_0x5f48('0x4f');return db[_0x5f48('0x50')]['find']({'where':{'name':_0x51365b,'userProfileId':_0x17e5ee[_0x5f48('0x59')]},'raw':!![]})[_0x5f48('0x27')](function(_0x340b7e){if(_0x340b7e&&_0x340b7e[_0x5f48('0x51')]===0x0){return db[_0x5f48('0x52')][_0x5f48('0x4b')]({'name':_0x21c051[_0x5f48('0x2b')],'resourceId':_0x21c051['id'],'type':_0x340b7e[_0x5f48('0x2b')],'sectionId':_0x340b7e['id']},{})[_0x5f48('0x27')](function(){return _0x284bf8;});}else{return _0x284bf8;}})[_0x5f48('0x4a')](function(_0x57a38c){logger[_0x5f48('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57a38c);throw _0x57a38c;});}return _0x284bf8;});}})[_0x5f48('0x27')](respondWithResult(_0x2015cb,0xc9))[_0x5f48('0x4a')](handleError(_0x2015cb,null));};exports[_0x5f48('0x24')]=function(_0x4713b1,_0x340988){if(_0x4713b1['body']['id']){delete _0x4713b1[_0x5f48('0x4c')]['id'];}return db[_0x5f48('0x41')]['find']({'where':{'id':_0x4713b1[_0x5f48('0x46')]['id']}})['then'](handleEntityNotFound(_0x340988,null))[_0x5f48('0x27')](saveUpdates(_0x4713b1[_0x5f48('0x4c')],null))[_0x5f48('0x27')](respondWithResult(_0x340988,null))['catch'](handleError(_0x340988,null));};exports[_0x5f48('0x25')]=function(_0x16828b,_0x4775da){return db['Campaign'][_0x5f48('0x49')]({'where':{'id':_0x16828b[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x4775da,null))[_0x5f48('0x27')](removeEntity(_0x4775da,null))[_0x5f48('0x4a')](handleError(_0x4775da,null));};exports['getHoppers']=function(_0x317077,_0x887605,_0x651cfc){var _0xd7d61c={'raw':!![],'where':{}};var _0x450b3b={};var _0x4a264f={'count':0x0,'rows':[]};return db[_0x5f48('0x41')][_0x5f48('0x5a')]({'where':{'id':_0x317077[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x887605,null))['then'](function(_0x5c78bb){if(_0x5c78bb){_0x450b3b[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x5b')]['rawAttributes']);_0x450b3b[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x317077[_0x5f48('0x34')]);_0x450b3b[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x450b3b[_0x5f48('0x33')],_0x450b3b[_0x5f48('0x34')]);_0xd7d61c[_0x5f48('0x38')]=_['intersection'](_0x450b3b[_0x5f48('0x33')],qs[_0x5f48('0x47')](_0x317077[_0x5f48('0x34')]['fields']));_0xd7d61c[_0x5f48('0x38')]=_0xd7d61c[_0x5f48('0x38')][_0x5f48('0x39')]?_0xd7d61c[_0x5f48('0x38')]:_0x450b3b['model'];if(!_0x317077[_0x5f48('0x34')][_0x5f48('0x5c')](_0x5f48('0x5d'))){_0xd7d61c[_0x5f48('0x1e')]=qs['limit'](_0x317077[_0x5f48('0x34')][_0x5f48('0x1e')]);_0xd7d61c[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x317077[_0x5f48('0x34')][_0x5f48('0x1c')]);}_0xd7d61c[_0x5f48('0x3a')]=qs['sort'](_0x317077[_0x5f48('0x34')][_0x5f48('0x3b')]);_0xd7d61c[_0x5f48('0x3c')]=qs['filters'](_[_0x5f48('0x5e')](_0x317077[_0x5f48('0x34')],_0x450b3b[_0x5f48('0x36')]));_0xd7d61c[_0x5f48('0x3c')][_0x5f48('0x5f')]=_0x5c78bb['id'];if(_0x317077[_0x5f48('0x34')][_0x5f48('0x3d')]){_0xd7d61c['where']=_[_0x5f48('0x3e')](_0xd7d61c[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0xd7d61c[_0x5f48('0x38')],function(_0x4b9deb){var _0x2d9b23={};_0x2d9b23[_0x4b9deb]={'$like':'%'+_0x317077[_0x5f48('0x34')][_0x5f48('0x3d')]+'%'};return _0x2d9b23;})});}_0xd7d61c=_[_0x5f48('0x3e')]({},_0xd7d61c,_0x317077[_0x5f48('0x40')]);return db[_0x5f48('0x5b')][_0x5f48('0x1f')]({'where':_0xd7d61c[_0x5f48('0x3c')]})[_0x5f48('0x27')](function(_0x4a5295){_0x4a264f[_0x5f48('0x1f')]=_0x4a5295;if(_0x317077[_0x5f48('0x34')][_0x5f48('0x42')]){_0xd7d61c[_0x5f48('0x48')]=[{'all':!![]}];}return db[_0x5f48('0x5b')][_0x5f48('0x43')](_0xd7d61c);})[_0x5f48('0x27')](function(_0x3f2a3e){_0x4a264f[_0x5f48('0x44')]=_0x3f2a3e;return _0x4a264f;});}})[_0x5f48('0x27')](respondWithFilteredResult(_0x887605,_0xd7d61c))['catch'](handleError(_0x887605,null));};exports[_0x5f48('0x60')]=function(_0x9aeb44,_0x2a7222,_0x29632b){var _0x3a601f={'raw':!![],'where':{}};var _0x2d6705={};var _0x2c39ea={'count':0x0,'rows':[]};return db[_0x5f48('0x41')][_0x5f48('0x5a')]({'where':{'id':_0x9aeb44[_0x5f48('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a7222,null))['then'](function(_0x183e70){if(_0x183e70){_0x2d6705[_0x5f48('0x33')]=_[_0x5f48('0x35')](db['CmHopperHistory'][_0x5f48('0x2f')]);_0x2d6705[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x9aeb44['query']);_0x2d6705[_0x5f48('0x36')]=_['intersection'](_0x2d6705[_0x5f48('0x33')],_0x2d6705['query']);_0x3a601f[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x2d6705[_0x5f48('0x33')],qs[_0x5f48('0x47')](_0x9aeb44[_0x5f48('0x34')][_0x5f48('0x47')]));_0x3a601f['attributes']=_0x3a601f['attributes'][_0x5f48('0x39')]?_0x3a601f['attributes']:_0x2d6705['model'];if(!_0x9aeb44[_0x5f48('0x34')]['hasOwnProperty'](_0x5f48('0x5d'))){_0x3a601f[_0x5f48('0x1e')]=qs[_0x5f48('0x1e')](_0x9aeb44[_0x5f48('0x34')][_0x5f48('0x1e')]);_0x3a601f[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x9aeb44['query']['offset']);}_0x3a601f[_0x5f48('0x3a')]=qs[_0x5f48('0x3b')](_0x9aeb44['query'][_0x5f48('0x3b')]);_0x3a601f[_0x5f48('0x3c')]=qs[_0x5f48('0x36')](_[_0x5f48('0x5e')](_0x9aeb44['query'],_0x2d6705[_0x5f48('0x36')]));_0x3a601f[_0x5f48('0x3c')][_0x5f48('0x5f')]=_0x183e70['id'];if(_0x9aeb44['query']['filter']){_0x3a601f[_0x5f48('0x3c')]=_[_0x5f48('0x3e')](_0x3a601f[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0x3a601f[_0x5f48('0x38')],function(_0x254d4b){var _0xce22a7={};_0xce22a7[_0x254d4b]={'$like':'%'+_0x9aeb44[_0x5f48('0x34')][_0x5f48('0x3d')]+'%'};return _0xce22a7;})});}_0x3a601f=_[_0x5f48('0x3e')]({},_0x3a601f,_0x9aeb44[_0x5f48('0x40')]);return db[_0x5f48('0x61')][_0x5f48('0x1f')]({'where':_0x3a601f['where']})['then'](function(_0x243918){_0x2c39ea[_0x5f48('0x1f')]=_0x243918;if(_0x9aeb44[_0x5f48('0x34')][_0x5f48('0x42')]){_0x3a601f['include']=[{'all':!![]}];}return db[_0x5f48('0x61')][_0x5f48('0x43')](_0x3a601f);})[_0x5f48('0x27')](function(_0x43b1db){_0x2c39ea['rows']=_0x43b1db;return _0x2c39ea;});}})[_0x5f48('0x27')](respondWithFilteredResult(_0x2a7222,_0x3a601f))[_0x5f48('0x4a')](handleError(_0x2a7222,null));};exports[_0x5f48('0x62')]=function(_0x269fa0,_0x6416b7,_0x1e2e81){var _0x316215={'raw':!![],'where':{}};var _0x358764={};var _0x3bf41d={'count':0x0,'rows':[]};return db[_0x5f48('0x41')][_0x5f48('0x5a')]({'where':{'id':_0x269fa0[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x6416b7,null))['then'](function(_0x2baf1d){if(_0x2baf1d){_0x358764[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x63')][_0x5f48('0x2f')]);_0x358764[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x269fa0[_0x5f48('0x34')]);_0x358764['filters']=_['intersection'](_0x358764[_0x5f48('0x33')],_0x358764[_0x5f48('0x34')]);_0x316215[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x358764['model'],qs[_0x5f48('0x47')](_0x269fa0[_0x5f48('0x34')][_0x5f48('0x47')]));_0x316215[_0x5f48('0x38')]=_0x316215[_0x5f48('0x38')][_0x5f48('0x39')]?_0x316215[_0x5f48('0x38')]:_0x358764['model'];if(!_0x269fa0[_0x5f48('0x34')][_0x5f48('0x5c')]('nolimit')){_0x316215['limit']=qs[_0x5f48('0x1e')](_0x269fa0[_0x5f48('0x34')][_0x5f48('0x1e')]);_0x316215[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x269fa0[_0x5f48('0x34')][_0x5f48('0x1c')]);}_0x316215['order']=qs[_0x5f48('0x3b')](_0x269fa0['query'][_0x5f48('0x3b')]);_0x316215[_0x5f48('0x3c')]=qs[_0x5f48('0x36')](_['pick'](_0x269fa0[_0x5f48('0x34')],_0x358764[_0x5f48('0x36')]));_0x316215[_0x5f48('0x3c')][_0x5f48('0x5f')]=_0x2baf1d['id'];if(_0x269fa0[_0x5f48('0x34')]['filter']){_0x316215[_0x5f48('0x3c')]=_[_0x5f48('0x3e')](_0x316215[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0x316215[_0x5f48('0x38')],function(_0x5ad8de){var _0x59b219={};_0x59b219[_0x5ad8de]={'$like':'%'+_0x269fa0[_0x5f48('0x34')]['filter']+'%'};return _0x59b219;})});}_0x316215=_[_0x5f48('0x3e')]({},_0x316215,_0x269fa0[_0x5f48('0x40')]);return db[_0x5f48('0x63')][_0x5f48('0x1f')]({'where':_0x316215[_0x5f48('0x3c')]})[_0x5f48('0x27')](function(_0x2c892d){_0x3bf41d[_0x5f48('0x1f')]=_0x2c892d;if(_0x269fa0[_0x5f48('0x34')][_0x5f48('0x42')]){_0x316215[_0x5f48('0x48')]=[{'all':!![]}];}return db[_0x5f48('0x63')]['findAll'](_0x316215);})[_0x5f48('0x27')](function(_0x5cfc8a){_0x3bf41d[_0x5f48('0x44')]=_0x5cfc8a;return _0x3bf41d;});}})[_0x5f48('0x27')](respondWithFilteredResult(_0x6416b7,_0x316215))[_0x5f48('0x4a')](handleError(_0x6416b7,null));};exports[_0x5f48('0x64')]=function(_0x23f027,_0x29f7f7,_0x56ac1e){var _0x924551={'raw':!![],'where':{}};var _0x2223c1={};var _0x24913b={'count':0x0,'rows':[]};return db[_0x5f48('0x41')][_0x5f48('0x5a')]({'where':{'id':_0x23f027['params']['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x29f7f7,null))[_0x5f48('0x27')](function(_0xe21563){if(_0xe21563){_0x2223c1[_0x5f48('0x33')]=_['keys'](db[_0x5f48('0x65')][_0x5f48('0x2f')]);_0x2223c1[_0x5f48('0x34')]=_['keys'](_0x23f027['query']);_0x2223c1[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x2223c1[_0x5f48('0x33')],_0x2223c1[_0x5f48('0x34')]);_0x924551[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x2223c1['model'],qs[_0x5f48('0x47')](_0x23f027[_0x5f48('0x34')][_0x5f48('0x47')]));_0x924551[_0x5f48('0x38')]=_0x924551['attributes']['length']?_0x924551[_0x5f48('0x38')]:_0x2223c1['model'];if(!_0x23f027[_0x5f48('0x34')]['hasOwnProperty'](_0x5f48('0x5d'))){_0x924551['limit']=qs[_0x5f48('0x1e')](_0x23f027['query']['limit']);_0x924551[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x23f027[_0x5f48('0x34')][_0x5f48('0x1c')]);}_0x924551[_0x5f48('0x3a')]=qs[_0x5f48('0x3b')](_0x23f027[_0x5f48('0x34')][_0x5f48('0x3b')]);_0x924551[_0x5f48('0x3c')]=qs[_0x5f48('0x36')](_[_0x5f48('0x5e')](_0x23f027[_0x5f48('0x34')],_0x2223c1['filters']));_0x924551['where'][_0x5f48('0x5f')]=_0xe21563['id'];if(_0x23f027[_0x5f48('0x34')][_0x5f48('0x3d')]){_0x924551[_0x5f48('0x3c')]=_[_0x5f48('0x3e')](_0x924551[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0x924551[_0x5f48('0x38')],function(_0x4fb9da){var _0x374e28={};_0x374e28[_0x4fb9da]={'$like':'%'+_0x23f027['query'][_0x5f48('0x3d')]+'%'};return _0x374e28;})});}_0x924551=_[_0x5f48('0x3e')]({},_0x924551,_0x23f027[_0x5f48('0x40')]);return db[_0x5f48('0x65')][_0x5f48('0x1f')]({'where':_0x924551[_0x5f48('0x3c')]})[_0x5f48('0x27')](function(_0x12e9ce){_0x24913b[_0x5f48('0x1f')]=_0x12e9ce;if(_0x23f027[_0x5f48('0x34')][_0x5f48('0x42')]){_0x924551['include']=[{'all':!![]}];}return db[_0x5f48('0x65')][_0x5f48('0x43')](_0x924551);})[_0x5f48('0x27')](function(_0x30966a){_0x24913b[_0x5f48('0x44')]=_0x30966a;return _0x24913b;});}})[_0x5f48('0x27')](respondWithFilteredResult(_0x29f7f7,_0x924551))[_0x5f48('0x4a')](handleError(_0x29f7f7,null));};exports[_0x5f48('0x66')]=function(_0x54aa13,_0x3e67e4,_0x325ee8){var _0x4d4d44={};var _0x1c0bc5={};var _0x169d7e;var _0x40d1af;return db[_0x5f48('0x41')]['findOne']({'where':{'id':_0x54aa13[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x3e67e4,null))[_0x5f48('0x27')](function(_0x1d3323){if(_0x1d3323){_0x169d7e=_0x1d3323;_0x1c0bc5[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x67')][_0x5f48('0x2f')]);_0x1c0bc5['query']=_[_0x5f48('0x35')](_0x54aa13[_0x5f48('0x34')]);_0x1c0bc5[_0x5f48('0x36')]=_['intersection'](_0x1c0bc5[_0x5f48('0x33')],_0x1c0bc5[_0x5f48('0x34')]);_0x4d4d44[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x1c0bc5[_0x5f48('0x33')],qs['fields'](_0x54aa13[_0x5f48('0x34')][_0x5f48('0x47')]));_0x4d4d44[_0x5f48('0x38')]=_0x4d4d44[_0x5f48('0x38')][_0x5f48('0x39')]?_0x4d4d44[_0x5f48('0x38')]:_0x1c0bc5[_0x5f48('0x33')];_0x4d4d44['order']=qs[_0x5f48('0x3b')](_0x54aa13[_0x5f48('0x34')][_0x5f48('0x3b')]);_0x4d4d44[_0x5f48('0x3c')]=qs[_0x5f48('0x36')](_[_0x5f48('0x5e')](_0x54aa13['query'],_0x1c0bc5[_0x5f48('0x36')]));if(_0x54aa13[_0x5f48('0x34')][_0x5f48('0x3d')]){_0x4d4d44['where']=_[_0x5f48('0x3e')](_0x4d4d44[_0x5f48('0x3c')],{'$or':_['map'](_0x4d4d44[_0x5f48('0x38')],function(_0x480b31){var _0x38d8a4={};_0x38d8a4[_0x480b31]={'$like':'%'+_0x54aa13[_0x5f48('0x34')][_0x5f48('0x3d')]+'%'};return _0x38d8a4;})});}_0x4d4d44=_[_0x5f48('0x3e')]({},_0x4d4d44,_0x54aa13[_0x5f48('0x40')]);return _0x169d7e[_0x5f48('0x66')](_0x4d4d44);}})['then'](function(_0x1f9cfb){if(_0x1f9cfb){_0x40d1af=_0x1f9cfb[_0x5f48('0x39')];if(!_0x54aa13[_0x5f48('0x34')][_0x5f48('0x5c')](_0x5f48('0x5d'))){_0x4d4d44[_0x5f48('0x1e')]=qs[_0x5f48('0x1e')](_0x54aa13[_0x5f48('0x34')][_0x5f48('0x1e')]);_0x4d4d44['offset']=qs[_0x5f48('0x1c')](_0x54aa13['query'][_0x5f48('0x1c')]);}return _0x169d7e[_0x5f48('0x66')](_0x4d4d44);}})[_0x5f48('0x27')](function(_0x49665b){if(_0x49665b){return _0x49665b?{'count':_0x40d1af,'rows':_0x49665b}:null;}})[_0x5f48('0x27')](respondWithResult(_0x3e67e4,null))[_0x5f48('0x4a')](handleError(_0x3e67e4,null));};exports['addLists']=function(_0x55b681,_0x485357,_0xd6e51c){var _0x1a8a8d,_0x4b7bd2;var _0x4f0e39=[];var _0x25ddc7=moment()[_0x5f48('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x5f48('0x41')]['find']({'where':{'id':_0x55b681[_0x5f48('0x46')]['id']}})['then'](handleEntityNotFound(_0x485357,null))[_0x5f48('0x27')](function(_0x1f7ad3){if(_0x1f7ad3){_0x4b7bd2=_0x1f7ad3;return _0x1f7ad3[_0x5f48('0x69')](_0x55b681[_0x5f48('0x4c')]['ids'],_[_0x5f48('0x55')](_0x55b681[_0x5f48('0x4c')],[_0x5f48('0x6a'),'id'])||{});}return null;})[_0x5f48('0x6b')](function(_0x21ed50){var _0xb53a6d;var _0xa9518d;_0x1a8a8d=_0x21ed50||[];var _0x56c9e7=[];if(_0x21ed50){for(var _0x5d25e2=0x0;_0x5d25e2<_0x21ed50[_0x5f48('0x39')];_0x5d25e2+=0x1){var _0xf32f12=_0x21ed50[_0x5d25e2][_0x5f48('0x26')]({'plain':!![]});_0x4b7bd2['dialCheckDuplicateType']=_0x55b681[_0x5f48('0x4c')]['dialCheckDuplicateType']?_0x55b681['body']['dialCheckDuplicateType']:_0x4b7bd2['dialCheckDuplicateType'];switch(_0x4b7bd2[_0x5f48('0x6c')]){case _0x5f48('0x6d'):_0xb53a6d=squel[_0x5f48('0x6e')]()[_0x5f48('0x6f')](_0x5f48('0x70'))[_0x5f48('0x71')](['phone',_0x5f48('0x72'),_0x5f48('0x73'),_0x5f48('0x74'),'CampaignId',_0x5f48('0x57'),_0x5f48('0x56')],squel[_0x5f48('0x75')]()[_0x5f48('0x76')](_0x5f48('0x77'),_0x5f48('0x77'))[_0x5f48('0x76')](_0x5f48('0x78'),_0x5f48('0x72'))['field']('id',_0x5f48('0x73'))[_0x5f48('0x76')](_0xf32f12[_0x5f48('0x79')][_0x5f48('0x7a')](),_0x5f48('0x74'))[_0x5f48('0x76')](_0x55b681[_0x5f48('0x46')]['id']['toString'](),_0x5f48('0x5f'))[_0x5f48('0x76')]('\x27'+_0x25ddc7+'\x27','createdAt')['field']('\x27'+_0x25ddc7+'\x27',_0x5f48('0x56'))[_0x5f48('0x7b')](_0x5f48('0x7c'))['where']('deletedAt\x20IS\x20NULL')[_0x5f48('0x3c')]('ListId\x20=\x20?',_0xf32f12['CmListId'][_0x5f48('0x7a')]())[_0x5f48('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x5f48('0x3c')](_0x5f48('0x7d'),squel[_0x5f48('0x75')]()[_0x5f48('0x76')](_0x5f48('0x7e'))[_0x5f48('0x7b')](_0x5f48('0x7f'))[_0x5f48('0x3c')]('CampaignId\x20=\x20?',_0x55b681[_0x5f48('0x46')]['id']['toString']()))[_0x5f48('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5f48('0x76')](_0x5f48('0x80'))[_0x5f48('0x7b')](_0x5f48('0x70'))['where'](_0x5f48('0x81'),_0x55b681[_0x5f48('0x46')]['id']['toString']())))[_0x5f48('0x7a')]();break;case'onlyIfOpen':_0xb53a6d=squel[_0x5f48('0x6e')]()[_0x5f48('0x6f')]('cm_hopper')[_0x5f48('0x71')]([_0x5f48('0x77'),'scheduledAt',_0x5f48('0x73'),_0x5f48('0x74'),'CampaignId',_0x5f48('0x57'),_0x5f48('0x56')],squel[_0x5f48('0x75')]()[_0x5f48('0x76')](_0x5f48('0x77'),'phone')[_0x5f48('0x76')](_0x5f48('0x78'),_0x5f48('0x72'))['field']('id',_0x5f48('0x73'))['field'](_0xf32f12[_0x5f48('0x79')]['toString'](),_0x5f48('0x74'))[_0x5f48('0x76')](_0x55b681[_0x5f48('0x46')]['id']['toString'](),_0x5f48('0x5f'))[_0x5f48('0x76')]('\x27'+_0x25ddc7+'\x27',_0x5f48('0x57'))[_0x5f48('0x76')]('\x27'+_0x25ddc7+'\x27',_0x5f48('0x56'))[_0x5f48('0x7b')](_0x5f48('0x7c'))[_0x5f48('0x3c')](_0x5f48('0x82'))[_0x5f48('0x3c')]('ListId\x20=\x20?',_0xf32f12['CmListId']['toString']())['where'](_0x5f48('0x83'))[_0x5f48('0x3c')](_0x5f48('0x7d'),squel[_0x5f48('0x75')]()[_0x5f48('0x76')]('COALESCE(phone,\x27\x27)')[_0x5f48('0x7b')](_0x5f48('0x70'))['where'](_0x5f48('0x81'),_0x55b681[_0x5f48('0x46')]['id'][_0x5f48('0x7a')]())))['toString']();break;default:_0xb53a6d=squel['insert']()['into'](_0x5f48('0x70'))[_0x5f48('0x71')]([_0x5f48('0x77'),_0x5f48('0x72'),_0x5f48('0x73'),'ListId',_0x5f48('0x5f'),'createdAt',_0x5f48('0x56')],squel[_0x5f48('0x75')]()['field']('phone',_0x5f48('0x77'))[_0x5f48('0x76')]('NOW()',_0x5f48('0x72'))[_0x5f48('0x76')]('id','ContactId')[_0x5f48('0x76')](_0xf32f12[_0x5f48('0x79')][_0x5f48('0x7a')](),_0x5f48('0x74'))['field'](_0x55b681[_0x5f48('0x46')]['id'][_0x5f48('0x7a')](),_0x5f48('0x5f'))['field']('\x27'+_0x25ddc7+'\x27',_0x5f48('0x57'))['field']('\x27'+_0x25ddc7+'\x27',_0x5f48('0x56'))[_0x5f48('0x7b')]('cm_contacts')[_0x5f48('0x3c')](_0x5f48('0x82'))['where']('ListId\x20=\x20?',_0xf32f12[_0x5f48('0x79')][_0x5f48('0x7a')]())[_0x5f48('0x3c')](_0x5f48('0x83')))[_0x5f48('0x7a')]();}_0xa9518d=squel['insert']()[_0x5f48('0x6f')]('cm_hopper_additional_phones')[_0x5f48('0x71')]([_0x5f48('0x84'),_0x5f48('0x72'),_0x5f48('0x77'),_0x5f48('0x85'),_0x5f48('0x57'),_0x5f48('0x56')],squel['select']()['field']('h.id','id')[_0x5f48('0x76')](_0x5f48('0x78'),_0x5f48('0x72'))[_0x5f48('0x76')](_0x5f48('0x86'),_0x5f48('0x77'))[_0x5f48('0x76')](_0x5f48('0x87'),'OrderBy')['field']('\x27'+_0x25ddc7+'\x27',_0x5f48('0x57'))[_0x5f48('0x76')]('\x27'+_0x25ddc7+'\x27','updatedAt')[_0x5f48('0x7b')](_0x5f48('0x88'),'ci')[_0x5f48('0x89')](_0x5f48('0x70'),'h',_0x5f48('0x8a'))[_0x5f48('0x3c')]('h.ListId\x20=\x20?',_0xf32f12[_0x5f48('0x79')][_0x5f48('0x7a')]())[_0x5f48('0x3c')](_0x5f48('0x8b'),_0x55b681[_0x5f48('0x46')]['id'][_0x5f48('0x7a')]())['where'](_0x5f48('0x8c'),_0x25ddc7))[_0x5f48('0x7a')]();_0x56c9e7['push'](db[_0x5f48('0x8d')][_0x5f48('0x34')](_0xb53a6d));_0x4f0e39[_0x5f48('0x8e')](db[_0x5f48('0x8d')][_0x5f48('0x34')](_0xa9518d));}return BPromise['all'](_0x56c9e7);}})[_0x5f48('0x27')](function(){return BPromise[_0x5f48('0x8f')](_0x4f0e39);})['then'](function(){return _0x1a8a8d;})[_0x5f48('0x27')](respondWithResult(_0x485357,null))[_0x5f48('0x4a')](handleError(_0x485357,null));};exports['removeLists']=function(_0x1794a1,_0x111563,_0x8ca4d8){return db[_0x5f48('0x41')][_0x5f48('0x49')]({'where':{'id':_0x1794a1[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x111563,null))[_0x5f48('0x27')](function(_0x4b4ae3){if(_0x4b4ae3){return _0x4b4ae3[_0x5f48('0x90')](_0x1794a1[_0x5f48('0x34')][_0x5f48('0x6a')]);}})['then'](function(_0xf9286d){if(_0xf9286d){return db[_0x5f48('0x5b')]['destroy']({'where':{'ListId':_0x1794a1['query'][_0x5f48('0x6a')],'CampaignId':_0x1794a1[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](function(){return _0xf9286d;});}})[_0x5f48('0x27')](respondWithStatusCode(_0x111563,null))['catch'](handleError(_0x111563,null));};exports[_0x5f48('0x91')]=function(_0x397336,_0x143415,_0x5831ad){var _0x230f56={};var _0x124c74={};var _0x39e373;var _0xbb6661;return db['Campaign'][_0x5f48('0x5a')]({'where':{'id':_0x397336['params']['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x143415,null))['then'](function(_0x2ce105){if(_0x2ce105){_0x39e373=_0x2ce105;_0x124c74[_0x5f48('0x33')]=_[_0x5f48('0x35')](db['CmList'][_0x5f48('0x2f')]);_0x124c74[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x397336[_0x5f48('0x34')]);_0x124c74[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x124c74['model'],_0x124c74['query']);_0x230f56[_0x5f48('0x38')]=_['intersection'](_0x124c74[_0x5f48('0x33')],qs[_0x5f48('0x47')](_0x397336[_0x5f48('0x34')][_0x5f48('0x47')]));_0x230f56[_0x5f48('0x38')]=_0x230f56[_0x5f48('0x38')][_0x5f48('0x39')]?_0x230f56['attributes']:_0x124c74[_0x5f48('0x33')];_0x230f56[_0x5f48('0x3a')]=qs['sort'](_0x397336['query'][_0x5f48('0x3b')]);_0x230f56[_0x5f48('0x3c')]=qs['filters'](_[_0x5f48('0x5e')](_0x397336[_0x5f48('0x34')],_0x124c74[_0x5f48('0x36')]));if(_0x397336['query']['filter']){_0x230f56['where']=_[_0x5f48('0x3e')](_0x230f56[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0x230f56[_0x5f48('0x38')],function(_0x453a76){var _0x3952e8={};_0x3952e8[_0x453a76]={'$like':'%'+_0x397336[_0x5f48('0x34')][_0x5f48('0x3d')]+'%'};return _0x3952e8;})});}_0x230f56=_[_0x5f48('0x3e')]({},_0x230f56,_0x397336['options']);return _0x39e373['getBlackLists'](_0x230f56);}})[_0x5f48('0x27')](function(_0x187957){if(_0x187957){_0xbb6661=_0x187957[_0x5f48('0x39')];if(!_0x397336[_0x5f48('0x34')][_0x5f48('0x5c')](_0x5f48('0x5d'))){_0x230f56[_0x5f48('0x1e')]=qs[_0x5f48('0x1e')](_0x397336[_0x5f48('0x34')]['limit']);_0x230f56[_0x5f48('0x1c')]=qs['offset'](_0x397336[_0x5f48('0x34')][_0x5f48('0x1c')]);}return _0x39e373[_0x5f48('0x91')](_0x230f56);}})['then'](function(_0x3387de){if(_0x3387de){return _0x3387de?{'count':_0xbb6661,'rows':_0x3387de}:null;}})[_0x5f48('0x27')](respondWithResult(_0x143415,null))[_0x5f48('0x4a')](handleError(_0x143415,null));};exports[_0x5f48('0x92')]=function(_0x5a727c,_0x50b2d3,_0x42d932){var _0x5e2def,_0x47d9a6;var _0x3e62e0=[];var _0x519a86=moment()[_0x5f48('0x68')](_0x5f48('0x93'));return db[_0x5f48('0x41')][_0x5f48('0x49')]({'where':{'id':_0x5a727c[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x50b2d3,null))[_0x5f48('0x27')](function(_0x31f1a3){if(_0x31f1a3){_0x47d9a6=_0x31f1a3;return _0x31f1a3[_0x5f48('0x92')](_0x5a727c[_0x5f48('0x4c')][_0x5f48('0x6a')],_[_0x5f48('0x55')](_0x5a727c[_0x5f48('0x4c')],[_0x5f48('0x6a'),'id'])||{});}return null;})[_0x5f48('0x6b')](function(_0x24cea8){var _0x4e6102;var _0x1bec6e;_0x5e2def=_0x24cea8||[];var _0x539668=[];if(_0x24cea8){for(var _0x2addc5=0x0;_0x2addc5<_0x24cea8['length'];_0x2addc5+=0x1){var _0x51d212=_0x24cea8[_0x2addc5][_0x5f48('0x26')]({'plain':!![]});_0x4e6102=squel[_0x5f48('0x6e')]()[_0x5f48('0x6f')]('cm_hopper_black')[_0x5f48('0x71')]([_0x5f48('0x77'),_0x5f48('0x73'),'ListId',_0x5f48('0x5f'),_0x5f48('0x57'),_0x5f48('0x56')],squel[_0x5f48('0x75')]()[_0x5f48('0x76')](_0x5f48('0x77'),_0x5f48('0x77'))[_0x5f48('0x76')]('id',_0x5f48('0x73'))['field'](_0x51d212[_0x5f48('0x79')][_0x5f48('0x7a')](),'ListId')[_0x5f48('0x76')](_0x5a727c[_0x5f48('0x46')]['id'][_0x5f48('0x7a')](),_0x5f48('0x5f'))[_0x5f48('0x76')](_0x5f48('0x78'),_0x5f48('0x57'))[_0x5f48('0x76')]('NOW()',_0x5f48('0x56'))[_0x5f48('0x7b')](_0x5f48('0x7c'))[_0x5f48('0x3c')]('deletedAt\x20IS\x20NULL')[_0x5f48('0x3c')](_0x5f48('0x94'),_0x51d212['CmListId'][_0x5f48('0x7a')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5f48('0x7a')]();_0x539668[_0x5f48('0x8e')](db[_0x5f48('0x8d')][_0x5f48('0x34')](_0x4e6102));}return BPromise['all'](_0x539668);}})[_0x5f48('0x27')](function(){return _0x5e2def;})[_0x5f48('0x27')](respondWithResult(_0x50b2d3,null))[_0x5f48('0x4a')](handleError(_0x50b2d3,null));};exports['removeBlackLists']=function(_0x47abc4,_0x2945da,_0x37f4fb){return db[_0x5f48('0x41')][_0x5f48('0x49')]({'where':{'id':_0x47abc4[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x2945da,null))[_0x5f48('0x27')](function(_0x1f3535){if(_0x1f3535){return _0x1f3535['removeBlackLists'](_0x47abc4[_0x5f48('0x34')][_0x5f48('0x6a')]);}})[_0x5f48('0x27')](function(_0x37522e){if(_0x37522e){return db['CmHopperBlack'][_0x5f48('0x25')]({'where':{'ListId':_0x47abc4['query'][_0x5f48('0x6a')],'CampaignId':_0x47abc4[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](function(){return _0x37522e;});}})[_0x5f48('0x27')](respondWithStatusCode(_0x2945da,null))[_0x5f48('0x4a')](handleError(_0x2945da,null));};
\ No newline at end of file
+var _0x0f73=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','spread','all','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Campaign','includeAll','include','rows','catch','show','params','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','dialCheckDuplicateType','always'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x0f73,0x146));var _0x30f7=function(_0x1edfdc,_0x289142){_0x1edfdc=_0x1edfdc-0x0;var _0x10a4f8=_0x0f73[_0x1edfdc];return _0x10a4f8;};'use strict';var emlformat=require(_0x30f7('0x0'));var rimraf=require(_0x30f7('0x1'));var zipdir=require(_0x30f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x30f7('0x3'));var BPromise=require(_0x30f7('0x4'));var Mustache=require(_0x30f7('0x5'));var util=require(_0x30f7('0x6'));var path=require(_0x30f7('0x7'));var sox=require('sox');var csv=require(_0x30f7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30f7('0x9'));var squel=require(_0x30f7('0xa'));var crypto=require(_0x30f7('0xb'));var jsforce=require(_0x30f7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x30f7('0x8'));var querystring=require(_0x30f7('0xd'));var Papa=require('papaparse');var Redis=require(_0x30f7('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x30f7('0xf'));var hardwareService=require(_0x30f7('0x10'));var logger=require(_0x30f7('0x11'))(_0x30f7('0x12'));var utils=require('../../config/utils');var config=require(_0x30f7('0x13'));var licenseUtil=require(_0x30f7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121af8,_0x7b4cd1){_0x7b4cd1=_0x7b4cd1||0xcc;return function(_0xb9752c){if(_0xb9752c){return _0x121af8['sendStatus'](_0x7b4cd1);}return _0x121af8[_0x30f7('0x15')](_0x7b4cd1)[_0x30f7('0x16')]();};}function respondWithResult(_0x5155bd,_0x1ad086){_0x1ad086=_0x1ad086||0xc8;return function(_0xfc31c5){if(_0xfc31c5){return _0x5155bd[_0x30f7('0x15')](_0x1ad086)[_0x30f7('0x17')](_0xfc31c5);}};}function respondWithFilteredResult(_0x2b5a47,_0x579e7a){return function(_0x49fccb){if(_0x49fccb){var _0x401f9e=typeof _0x579e7a[_0x30f7('0x18')]===_0x30f7('0x19')&&typeof _0x579e7a[_0x30f7('0x1a')]==='undefined';var _0x2681d7=_0x49fccb[_0x30f7('0x1b')];var _0x1efb71=_0x401f9e?0x0:_0x579e7a[_0x30f7('0x18')];var _0x1e7777=_0x401f9e?_0x49fccb[_0x30f7('0x1b')]:_0x579e7a[_0x30f7('0x18')]+_0x579e7a[_0x30f7('0x1a')];var _0x1d6f46;if(_0x1e7777>=_0x2681d7){_0x1e7777=_0x2681d7;_0x1d6f46=0xc8;}else{_0x1d6f46=0xce;}_0x2b5a47['status'](_0x1d6f46);return _0x2b5a47[_0x30f7('0x1c')](_0x30f7('0x1d'),_0x1efb71+'-'+_0x1e7777+'/'+_0x2681d7)[_0x30f7('0x17')](_0x49fccb);}return null;};}function patchUpdates(_0x12cdf1){return function(_0x37d7d5){try{jsonpatch[_0x30f7('0x1e')](_0x37d7d5,_0x12cdf1,!![]);}catch(_0x5745d7){return BPromise[_0x30f7('0x1f')](_0x5745d7);}return _0x37d7d5[_0x30f7('0x20')]();};}function saveUpdates(_0x571f7e,_0x570d52){return function(_0x12d3f2){if(_0x12d3f2){return _0x12d3f2['update'](_0x571f7e)['then'](function(_0x4c6009){return _0x4c6009;});}return null;};}function removeEntity(_0x1bfc45,_0x261116){return function(_0x4c686d){if(_0x4c686d){return _0x4c686d['destroy']()[_0x30f7('0x21')](function(){var _0x86b4f8=_0x4c686d['get']({'plain':!![]});var _0x393d2f=_0x30f7('0x22');return db[_0x30f7('0x23')]['destroy']({'where':{'type':_0x393d2f,'resourceId':_0x86b4f8['id']}})[_0x30f7('0x21')](function(){return _0x4c686d;});})[_0x30f7('0x21')](function(){_0x1bfc45['status'](0xcc)[_0x30f7('0x16')]();});}};}function handleEntityNotFound(_0x3a8207,_0x5de116){return function(_0x23d3ae){if(!_0x23d3ae){_0x3a8207[_0x30f7('0x24')](0x194);}return _0x23d3ae;};}function handleError(_0x4b5d75,_0x3cd23f){_0x3cd23f=_0x3cd23f||0x1f4;return function(_0x591773){logger[_0x30f7('0x25')](_0x591773[_0x30f7('0x26')]);if(_0x591773[_0x30f7('0x27')]){delete _0x591773[_0x30f7('0x27')];}_0x4b5d75[_0x30f7('0x15')](_0x3cd23f)[_0x30f7('0x28')](_0x591773);};}exports[_0x30f7('0x29')]=function(_0x29bec2,_0x28daf5){var _0x3e26f3={},_0x4f16ab={},_0x7a869a={'count':0x0,'rows':[]};var _0x4fb3bb=_[_0x30f7('0x2a')](db['Campaign'][_0x30f7('0x2b')],function(_0x3e6db7){return{'name':_0x3e6db7[_0x30f7('0x2c')],'type':_0x3e6db7[_0x30f7('0x2d')]['key']};});_0x4f16ab['model']=_[_0x30f7('0x2a')](_0x4fb3bb,_0x30f7('0x27'));_0x4f16ab[_0x30f7('0x2e')]=_[_0x30f7('0x2f')](_0x29bec2['query']);_0x4f16ab[_0x30f7('0x30')]=_[_0x30f7('0x31')](_0x4f16ab[_0x30f7('0x32')],_0x4f16ab[_0x30f7('0x2e')]);_0x3e26f3[_0x30f7('0x33')]=_[_0x30f7('0x31')](_0x4f16ab[_0x30f7('0x32')],qs[_0x30f7('0x34')](_0x29bec2[_0x30f7('0x2e')]['fields']));_0x3e26f3[_0x30f7('0x33')]=_0x3e26f3[_0x30f7('0x33')][_0x30f7('0x35')]?_0x3e26f3[_0x30f7('0x33')]:_0x4f16ab['model'];if(!_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x36')](_0x30f7('0x37'))){_0x3e26f3['limit']=qs[_0x30f7('0x1a')](_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x1a')]);_0x3e26f3[_0x30f7('0x18')]=qs[_0x30f7('0x18')](_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x18')]);}_0x3e26f3[_0x30f7('0x38')]=qs['sort'](_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x39')]);_0x3e26f3['where']=qs[_0x30f7('0x30')](_[_0x30f7('0x3a')](_0x29bec2[_0x30f7('0x2e')],_0x4f16ab[_0x30f7('0x30')]),_0x4fb3bb);if(_0x29bec2[_0x30f7('0x2e')][_0x30f7('0x3b')]){_0x3e26f3[_0x30f7('0x3c')]=_[_0x30f7('0x3d')](_0x3e26f3[_0x30f7('0x3c')],{'$or':_[_0x30f7('0x2a')](_0x4fb3bb,function(_0x1edc3b){if(_0x1edc3b[_0x30f7('0x2d')]!==_0x30f7('0x3e')){var _0xb025bc={};_0xb025bc[_0x1edc3b[_0x30f7('0x27')]]={'$like':'%'+_0x29bec2['query'][_0x30f7('0x3b')]+'%'};return _0xb025bc;}})});}_0x3e26f3=_['merge']({},_0x3e26f3,_0x29bec2['options']);var _0x57795c={'where':_0x3e26f3[_0x30f7('0x3c')]};return db[_0x30f7('0x3f')][_0x30f7('0x1b')](_0x57795c)[_0x30f7('0x21')](function(_0x46b098){_0x7a869a[_0x30f7('0x1b')]=_0x46b098;if(_0x29bec2['query'][_0x30f7('0x40')]){_0x3e26f3[_0x30f7('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x3e26f3);})['then'](function(_0x5194c7){_0x7a869a[_0x30f7('0x42')]=_0x5194c7;return _0x7a869a;})['then'](respondWithFilteredResult(_0x28daf5,_0x3e26f3))[_0x30f7('0x43')](handleError(_0x28daf5,null));};exports[_0x30f7('0x44')]=function(_0xb3bcc5,_0x554a13){var _0x1afce1={'raw':![],'where':{'id':_0xb3bcc5[_0x30f7('0x45')]['id']}},_0x388484={};_0x388484[_0x30f7('0x32')]=_[_0x30f7('0x2f')](db[_0x30f7('0x3f')]['rawAttributes']);_0x388484['query']=_[_0x30f7('0x2f')](_0xb3bcc5[_0x30f7('0x2e')]);_0x388484[_0x30f7('0x30')]=_[_0x30f7('0x31')](_0x388484['model'],_0x388484[_0x30f7('0x2e')]);_0x1afce1[_0x30f7('0x33')]=_[_0x30f7('0x31')](_0x388484['model'],qs['fields'](_0xb3bcc5[_0x30f7('0x2e')][_0x30f7('0x34')]));_0x1afce1['attributes']=_0x1afce1[_0x30f7('0x33')]['length']?_0x1afce1[_0x30f7('0x33')]:_0x388484[_0x30f7('0x32')];if(_0xb3bcc5[_0x30f7('0x2e')][_0x30f7('0x40')]){_0x1afce1[_0x30f7('0x41')]=[{'all':!![]}];}_0x1afce1=_[_0x30f7('0x3d')]({},_0x1afce1,_0xb3bcc5[_0x30f7('0x46')]);return db[_0x30f7('0x3f')][_0x30f7('0x47')](_0x1afce1)[_0x30f7('0x21')](handleEntityNotFound(_0x554a13,null))[_0x30f7('0x21')](respondWithResult(_0x554a13,null))[_0x30f7('0x43')](handleError(_0x554a13,null));};exports[_0x30f7('0x48')]=function(_0x3a18b9,_0x1c18af){return db[_0x30f7('0x3f')][_0x30f7('0x48')](_0x3a18b9[_0x30f7('0x49')],{})[_0x30f7('0x21')](function(_0x1c914f){var _0x1b99df=_0x3a18b9['user'][_0x30f7('0x4a')]({'plain':!![]});if(!_0x1b99df)throw new Error(_0x30f7('0x4b'));if(_0x1b99df[_0x30f7('0x4c')]===_0x30f7('0x4d')){var _0x1bc348=_0x1c914f[_0x30f7('0x4a')]({'plain':!![]});var _0x26377e=_0x30f7('0x22');return db[_0x30f7('0x4e')][_0x30f7('0x47')]({'where':{'name':_0x26377e,'userProfileId':_0x1b99df[_0x30f7('0x4f')]},'raw':!![]})[_0x30f7('0x21')](function(_0x5e5207){if(_0x5e5207&&_0x5e5207[_0x30f7('0x50')]===0x0){return db['UserProfileResource'][_0x30f7('0x48')]({'name':_0x1bc348[_0x30f7('0x27')],'resourceId':_0x1bc348['id'],'type':_0x5e5207[_0x30f7('0x27')],'sectionId':_0x5e5207['id']},{})['then'](function(){return _0x1c914f;});}else{return _0x1c914f;}})[_0x30f7('0x43')](function(_0x9fc9f){logger[_0x30f7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9fc9f);throw _0x9fc9f;});}return _0x1c914f;})['then'](respondWithResult(_0x1c18af,0xc9))[_0x30f7('0x43')](handleError(_0x1c18af,null));};exports[_0x30f7('0x51')]=function(_0x5d023f,_0x5c00f2){var _0x406b8b={'where':{'id':_0x5d023f['params']['id']}},_0x14660d={};_0x14660d[_0x30f7('0x32')]=_[_0x30f7('0x2f')](db[_0x30f7('0x3f')][_0x30f7('0x2b')]);_0x406b8b[_0x30f7('0x33')]=_[_0x30f7('0x31')](_0x14660d[_0x30f7('0x32')],qs[_0x30f7('0x34')](_0x5d023f[_0x30f7('0x2e')][_0x30f7('0x34')]));_0x406b8b['attributes']=_0x406b8b[_0x30f7('0x33')]['length']?_0x406b8b[_0x30f7('0x33')]:_0x14660d[_0x30f7('0x32')];if(_0x5d023f[_0x30f7('0x2e')][_0x30f7('0x40')]){_0x406b8b[_0x30f7('0x41')]=[{'all':!![]}];}_0x406b8b=_[_0x30f7('0x3d')]({},_0x406b8b,_0x5d023f['options']);return db[_0x30f7('0x3f')][_0x30f7('0x47')](_0x406b8b)['then'](handleEntityNotFound(_0x5c00f2,null))['then'](function(_0x1a9a55){if(_0x1a9a55){var _0x38c670=_0x1a9a55[_0x30f7('0x4a')]({'plain':!![]});_0x38c670=qs[_0x30f7('0x52')](_0x38c670,['id',_0x30f7('0x53'),_0x30f7('0x54')]);_0x5d023f[_0x30f7('0x49')]=_[_0x30f7('0x52')](_0x5d023f[_0x30f7('0x49')],['id',_0x30f7('0x53'),_0x30f7('0x54')]);return db[_0x30f7('0x3f')][_0x30f7('0x48')](_[_0x30f7('0x3d')](_0x38c670,_0x5d023f[_0x30f7('0x49')]),{'include':_0x5d023f[_0x30f7('0x2e')][_0x30f7('0x40')]?[{'all':!![]}]:undefined})[_0x30f7('0x21')](function(_0x72f8e){var _0x3e25c4=_0x5d023f['user'][_0x30f7('0x4a')]({'plain':!![]});if(!_0x3e25c4)throw new Error(_0x30f7('0x4b'));if(_0x3e25c4[_0x30f7('0x4c')]===_0x30f7('0x4d')){var _0x4cb28e=_0x72f8e['get']({'plain':!![]});var _0x1f933c='IvrCampaigns';return db[_0x30f7('0x4e')][_0x30f7('0x47')]({'where':{'name':_0x1f933c,'userProfileId':_0x3e25c4[_0x30f7('0x4f')]},'raw':!![]})['then'](function(_0x371d8c){if(_0x371d8c&&_0x371d8c['autoAssociation']===0x0){return db[_0x30f7('0x23')][_0x30f7('0x48')]({'name':_0x4cb28e[_0x30f7('0x27')],'resourceId':_0x4cb28e['id'],'type':_0x371d8c['name'],'sectionId':_0x371d8c['id']},{})[_0x30f7('0x21')](function(){return _0x72f8e;});}else{return _0x72f8e;}})[_0x30f7('0x43')](function(_0x473723){logger[_0x30f7('0x25')](_0x30f7('0x55'),_0x473723);throw _0x473723;});}return _0x72f8e;});}})[_0x30f7('0x21')](respondWithResult(_0x5c00f2,0xc9))['catch'](handleError(_0x5c00f2,null));};exports[_0x30f7('0x56')]=function(_0x2cd21a,_0x4e32f4){if(_0x2cd21a[_0x30f7('0x49')]['id']){delete _0x2cd21a[_0x30f7('0x49')]['id'];}return db[_0x30f7('0x3f')][_0x30f7('0x47')]({'where':{'id':_0x2cd21a[_0x30f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e32f4,null))[_0x30f7('0x21')](saveUpdates(_0x2cd21a[_0x30f7('0x49')],null))['then'](respondWithResult(_0x4e32f4,null))[_0x30f7('0x43')](handleError(_0x4e32f4,null));};exports[_0x30f7('0x57')]=function(_0x236b4a,_0x4f744f){return db[_0x30f7('0x3f')][_0x30f7('0x47')]({'where':{'id':_0x236b4a[_0x30f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f744f,null))[_0x30f7('0x21')](removeEntity(_0x4f744f,null))[_0x30f7('0x43')](handleError(_0x4f744f,null));};exports[_0x30f7('0x58')]=function(_0x4872fb,_0x2f3ed6,_0xd9dadd){var _0x3447dc={'raw':!![],'where':{}};var _0x5aaa24={};var _0x49d879={'count':0x0,'rows':[]};return db[_0x30f7('0x3f')][_0x30f7('0x59')]({'where':{'id':_0x4872fb[_0x30f7('0x45')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x2f3ed6,null))[_0x30f7('0x21')](function(_0xa8f9f4){if(_0xa8f9f4){_0x5aaa24[_0x30f7('0x32')]=_[_0x30f7('0x2f')](db[_0x30f7('0x5a')][_0x30f7('0x2b')]);_0x5aaa24['query']=_['keys'](_0x4872fb[_0x30f7('0x2e')]);_0x5aaa24[_0x30f7('0x30')]=_[_0x30f7('0x31')](_0x5aaa24['model'],_0x5aaa24[_0x30f7('0x2e')]);_0x3447dc[_0x30f7('0x33')]=_[_0x30f7('0x31')](_0x5aaa24['model'],qs[_0x30f7('0x34')](_0x4872fb[_0x30f7('0x2e')]['fields']));_0x3447dc['attributes']=_0x3447dc[_0x30f7('0x33')][_0x30f7('0x35')]?_0x3447dc[_0x30f7('0x33')]:_0x5aaa24[_0x30f7('0x32')];if(!_0x4872fb['query'][_0x30f7('0x36')]('nolimit')){_0x3447dc[_0x30f7('0x1a')]=qs[_0x30f7('0x1a')](_0x4872fb[_0x30f7('0x2e')]['limit']);_0x3447dc[_0x30f7('0x18')]=qs[_0x30f7('0x18')](_0x4872fb['query'][_0x30f7('0x18')]);}_0x3447dc['order']=qs['sort'](_0x4872fb[_0x30f7('0x2e')][_0x30f7('0x39')]);_0x3447dc[_0x30f7('0x3c')]=qs[_0x30f7('0x30')](_['pick'](_0x4872fb['query'],_0x5aaa24['filters']));_0x3447dc[_0x30f7('0x3c')][_0x30f7('0x5b')]=_0xa8f9f4['id'];if(_0x4872fb[_0x30f7('0x2e')][_0x30f7('0x3b')]){_0x3447dc['where']=_[_0x30f7('0x3d')](_0x3447dc[_0x30f7('0x3c')],{'$or':_['map'](_0x3447dc[_0x30f7('0x33')],function(_0x5d22a6){var _0x4fc748={};_0x4fc748[_0x5d22a6]={'$like':'%'+_0x4872fb[_0x30f7('0x2e')][_0x30f7('0x3b')]+'%'};return _0x4fc748;})});}_0x3447dc=_[_0x30f7('0x3d')]({},_0x3447dc,_0x4872fb[_0x30f7('0x46')]);return db[_0x30f7('0x5a')]['count']({'where':_0x3447dc['where']})[_0x30f7('0x21')](function(_0x5931be){_0x49d879[_0x30f7('0x1b')]=_0x5931be;if(_0x4872fb[_0x30f7('0x2e')]['includeAll']){_0x3447dc[_0x30f7('0x41')]=[{'all':!![]}];}return db['CmHopper'][_0x30f7('0x5c')](_0x3447dc);})[_0x30f7('0x21')](function(_0xb10ecc){_0x49d879[_0x30f7('0x42')]=_0xb10ecc;return _0x49d879;});}})['then'](respondWithFilteredResult(_0x2f3ed6,_0x3447dc))[_0x30f7('0x43')](handleError(_0x2f3ed6,null));};exports[_0x30f7('0x5d')]=function(_0x1c0584,_0x40416b,_0x3b8c17){var _0x4e62e8={'raw':!![],'where':{}};var _0x274b56={};var _0x5b5d14={'count':0x0,'rows':[]};return db[_0x30f7('0x3f')][_0x30f7('0x59')]({'where':{'id':_0x1c0584[_0x30f7('0x45')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x40416b,null))[_0x30f7('0x21')](function(_0x5bcc8b){if(_0x5bcc8b){_0x274b56[_0x30f7('0x32')]=_['keys'](db['CmHopperHistory'][_0x30f7('0x2b')]);_0x274b56['query']=_[_0x30f7('0x2f')](_0x1c0584[_0x30f7('0x2e')]);_0x274b56[_0x30f7('0x30')]=_[_0x30f7('0x31')](_0x274b56[_0x30f7('0x32')],_0x274b56['query']);_0x4e62e8['attributes']=_[_0x30f7('0x31')](_0x274b56[_0x30f7('0x32')],qs[_0x30f7('0x34')](_0x1c0584[_0x30f7('0x2e')][_0x30f7('0x34')]));_0x4e62e8[_0x30f7('0x33')]=_0x4e62e8[_0x30f7('0x33')]['length']?_0x4e62e8[_0x30f7('0x33')]:_0x274b56[_0x30f7('0x32')];if(!_0x1c0584[_0x30f7('0x2e')][_0x30f7('0x36')]('nolimit')){_0x4e62e8[_0x30f7('0x1a')]=qs[_0x30f7('0x1a')](_0x1c0584[_0x30f7('0x2e')]['limit']);_0x4e62e8['offset']=qs[_0x30f7('0x18')](_0x1c0584[_0x30f7('0x2e')]['offset']);}_0x4e62e8[_0x30f7('0x38')]=qs['sort'](_0x1c0584[_0x30f7('0x2e')][_0x30f7('0x39')]);_0x4e62e8[_0x30f7('0x3c')]=qs[_0x30f7('0x30')](_['pick'](_0x1c0584[_0x30f7('0x2e')],_0x274b56['filters']));_0x4e62e8['where']['CampaignId']=_0x5bcc8b['id'];if(_0x1c0584[_0x30f7('0x2e')][_0x30f7('0x3b')]){_0x4e62e8[_0x30f7('0x3c')]=_[_0x30f7('0x3d')](_0x4e62e8[_0x30f7('0x3c')],{'$or':_[_0x30f7('0x2a')](_0x4e62e8[_0x30f7('0x33')],function(_0x1c6695){var _0xf9ea30={};_0xf9ea30[_0x1c6695]={'$like':'%'+_0x1c0584[_0x30f7('0x2e')]['filter']+'%'};return _0xf9ea30;})});}_0x4e62e8=_[_0x30f7('0x3d')]({},_0x4e62e8,_0x1c0584[_0x30f7('0x46')]);return db[_0x30f7('0x5e')]['count']({'where':_0x4e62e8['where']})['then'](function(_0x3b7023){_0x5b5d14[_0x30f7('0x1b')]=_0x3b7023;if(_0x1c0584['query'][_0x30f7('0x40')]){_0x4e62e8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x30f7('0x5c')](_0x4e62e8);})['then'](function(_0xda4da9){_0x5b5d14[_0x30f7('0x42')]=_0xda4da9;return _0x5b5d14;});}})[_0x30f7('0x21')](respondWithFilteredResult(_0x40416b,_0x4e62e8))[_0x30f7('0x43')](handleError(_0x40416b,null));};exports[_0x30f7('0x5f')]=function(_0x15240f,_0x38e3d2,_0x23f9b0){var _0x29f50d={'raw':!![],'where':{}};var _0x371559={};var _0x491a22={'count':0x0,'rows':[]};return db[_0x30f7('0x3f')][_0x30f7('0x59')]({'where':{'id':_0x15240f[_0x30f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x38e3d2,null))[_0x30f7('0x21')](function(_0x3acc6e){if(_0x3acc6e){_0x371559[_0x30f7('0x32')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x371559[_0x30f7('0x2e')]=_[_0x30f7('0x2f')](_0x15240f[_0x30f7('0x2e')]);_0x371559['filters']=_[_0x30f7('0x31')](_0x371559[_0x30f7('0x32')],_0x371559[_0x30f7('0x2e')]);_0x29f50d['attributes']=_['intersection'](_0x371559[_0x30f7('0x32')],qs[_0x30f7('0x34')](_0x15240f[_0x30f7('0x2e')]['fields']));_0x29f50d[_0x30f7('0x33')]=_0x29f50d[_0x30f7('0x33')]['length']?_0x29f50d[_0x30f7('0x33')]:_0x371559['model'];if(!_0x15240f[_0x30f7('0x2e')][_0x30f7('0x36')](_0x30f7('0x37'))){_0x29f50d[_0x30f7('0x1a')]=qs[_0x30f7('0x1a')](_0x15240f[_0x30f7('0x2e')][_0x30f7('0x1a')]);_0x29f50d[_0x30f7('0x18')]=qs[_0x30f7('0x18')](_0x15240f[_0x30f7('0x2e')][_0x30f7('0x18')]);}_0x29f50d[_0x30f7('0x38')]=qs[_0x30f7('0x39')](_0x15240f['query'][_0x30f7('0x39')]);_0x29f50d[_0x30f7('0x3c')]=qs[_0x30f7('0x30')](_[_0x30f7('0x3a')](_0x15240f[_0x30f7('0x2e')],_0x371559[_0x30f7('0x30')]));_0x29f50d[_0x30f7('0x3c')][_0x30f7('0x5b')]=_0x3acc6e['id'];if(_0x15240f['query'][_0x30f7('0x3b')]){_0x29f50d[_0x30f7('0x3c')]=_[_0x30f7('0x3d')](_0x29f50d[_0x30f7('0x3c')],{'$or':_[_0x30f7('0x2a')](_0x29f50d['attributes'],function(_0x3be212){var _0x5b8bbb={};_0x5b8bbb[_0x3be212]={'$like':'%'+_0x15240f[_0x30f7('0x2e')]['filter']+'%'};return _0x5b8bbb;})});}_0x29f50d=_[_0x30f7('0x3d')]({},_0x29f50d,_0x15240f[_0x30f7('0x46')]);return db[_0x30f7('0x60')]['count']({'where':_0x29f50d[_0x30f7('0x3c')]})[_0x30f7('0x21')](function(_0x298ee6){_0x491a22[_0x30f7('0x1b')]=_0x298ee6;if(_0x15240f['query'][_0x30f7('0x40')]){_0x29f50d[_0x30f7('0x41')]=[{'all':!![]}];}return db[_0x30f7('0x60')][_0x30f7('0x5c')](_0x29f50d);})[_0x30f7('0x21')](function(_0x57cc2e){_0x491a22[_0x30f7('0x42')]=_0x57cc2e;return _0x491a22;});}})[_0x30f7('0x21')](respondWithFilteredResult(_0x38e3d2,_0x29f50d))['catch'](handleError(_0x38e3d2,null));};exports['getHopperBlacks']=function(_0x549d0d,_0x56a52a,_0xf6e2b5){var _0x2152bd={'raw':!![],'where':{}};var _0x26def3={};var _0x1c326c={'count':0x0,'rows':[]};return db[_0x30f7('0x3f')][_0x30f7('0x59')]({'where':{'id':_0x549d0d[_0x30f7('0x45')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x56a52a,null))[_0x30f7('0x21')](function(_0x866e68){if(_0x866e68){_0x26def3[_0x30f7('0x32')]=_['keys'](db['CmHopperBlack'][_0x30f7('0x2b')]);_0x26def3[_0x30f7('0x2e')]=_[_0x30f7('0x2f')](_0x549d0d['query']);_0x26def3['filters']=_['intersection'](_0x26def3['model'],_0x26def3['query']);_0x2152bd[_0x30f7('0x33')]=_[_0x30f7('0x31')](_0x26def3[_0x30f7('0x32')],qs[_0x30f7('0x34')](_0x549d0d[_0x30f7('0x2e')][_0x30f7('0x34')]));_0x2152bd[_0x30f7('0x33')]=_0x2152bd[_0x30f7('0x33')][_0x30f7('0x35')]?_0x2152bd[_0x30f7('0x33')]:_0x26def3['model'];if(!_0x549d0d['query']['hasOwnProperty'](_0x30f7('0x37'))){_0x2152bd[_0x30f7('0x1a')]=qs[_0x30f7('0x1a')](_0x549d0d[_0x30f7('0x2e')][_0x30f7('0x1a')]);_0x2152bd[_0x30f7('0x18')]=qs['offset'](_0x549d0d[_0x30f7('0x2e')][_0x30f7('0x18')]);}_0x2152bd[_0x30f7('0x38')]=qs[_0x30f7('0x39')](_0x549d0d[_0x30f7('0x2e')]['sort']);_0x2152bd[_0x30f7('0x3c')]=qs[_0x30f7('0x30')](_['pick'](_0x549d0d[_0x30f7('0x2e')],_0x26def3[_0x30f7('0x30')]));_0x2152bd['where'][_0x30f7('0x5b')]=_0x866e68['id'];if(_0x549d0d['query'][_0x30f7('0x3b')]){_0x2152bd[_0x30f7('0x3c')]=_[_0x30f7('0x3d')](_0x2152bd[_0x30f7('0x3c')],{'$or':_[_0x30f7('0x2a')](_0x2152bd[_0x30f7('0x33')],function(_0x133b9c){var _0x5c235a={};_0x5c235a[_0x133b9c]={'$like':'%'+_0x549d0d[_0x30f7('0x2e')][_0x30f7('0x3b')]+'%'};return _0x5c235a;})});}_0x2152bd=_[_0x30f7('0x3d')]({},_0x2152bd,_0x549d0d[_0x30f7('0x46')]);return db['CmHopperBlack']['count']({'where':_0x2152bd['where']})[_0x30f7('0x21')](function(_0x2a0c99){_0x1c326c['count']=_0x2a0c99;if(_0x549d0d['query'][_0x30f7('0x40')]){_0x2152bd[_0x30f7('0x41')]=[{'all':!![]}];}return db[_0x30f7('0x61')][_0x30f7('0x5c')](_0x2152bd);})[_0x30f7('0x21')](function(_0x35f3e4){_0x1c326c[_0x30f7('0x42')]=_0x35f3e4;return _0x1c326c;});}})['then'](respondWithFilteredResult(_0x56a52a,_0x2152bd))[_0x30f7('0x43')](handleError(_0x56a52a,null));};exports[_0x30f7('0x62')]=function(_0x592f33,_0x13a5e8,_0x3a1aa9){var _0x12e3e0={};var _0x2f0dc4={};var _0x4c0377;var _0x288806;return db[_0x30f7('0x3f')]['findOne']({'where':{'id':_0x592f33[_0x30f7('0x45')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x13a5e8,null))['then'](function(_0x30befa){if(_0x30befa){_0x4c0377=_0x30befa;_0x2f0dc4['model']=_[_0x30f7('0x2f')](db[_0x30f7('0x63')]['rawAttributes']);_0x2f0dc4[_0x30f7('0x2e')]=_['keys'](_0x592f33['query']);_0x2f0dc4[_0x30f7('0x30')]=_[_0x30f7('0x31')](_0x2f0dc4['model'],_0x2f0dc4[_0x30f7('0x2e')]);_0x12e3e0[_0x30f7('0x33')]=_['intersection'](_0x2f0dc4[_0x30f7('0x32')],qs[_0x30f7('0x34')](_0x592f33[_0x30f7('0x2e')][_0x30f7('0x34')]));_0x12e3e0[_0x30f7('0x33')]=_0x12e3e0[_0x30f7('0x33')]['length']?_0x12e3e0['attributes']:_0x2f0dc4[_0x30f7('0x32')];_0x12e3e0['order']=qs[_0x30f7('0x39')](_0x592f33[_0x30f7('0x2e')][_0x30f7('0x39')]);_0x12e3e0[_0x30f7('0x3c')]=qs[_0x30f7('0x30')](_['pick'](_0x592f33['query'],_0x2f0dc4[_0x30f7('0x30')]));if(_0x592f33['query'][_0x30f7('0x3b')]){_0x12e3e0[_0x30f7('0x3c')]=_[_0x30f7('0x3d')](_0x12e3e0[_0x30f7('0x3c')],{'$or':_[_0x30f7('0x2a')](_0x12e3e0[_0x30f7('0x33')],function(_0x2977d9){var _0x3b02d6={};_0x3b02d6[_0x2977d9]={'$like':'%'+_0x592f33['query']['filter']+'%'};return _0x3b02d6;})});}_0x12e3e0=_[_0x30f7('0x3d')]({},_0x12e3e0,_0x592f33[_0x30f7('0x46')]);return _0x4c0377[_0x30f7('0x62')](_0x12e3e0);}})['then'](function(_0x4bec45){if(_0x4bec45){_0x288806=_0x4bec45['length'];if(!_0x592f33[_0x30f7('0x2e')][_0x30f7('0x36')]('nolimit')){_0x12e3e0[_0x30f7('0x1a')]=qs[_0x30f7('0x1a')](_0x592f33['query'][_0x30f7('0x1a')]);_0x12e3e0[_0x30f7('0x18')]=qs['offset'](_0x592f33[_0x30f7('0x2e')][_0x30f7('0x18')]);}return _0x4c0377['getLists'](_0x12e3e0);}})['then'](function(_0x4b317d){if(_0x4b317d){return _0x4b317d?{'count':_0x288806,'rows':_0x4b317d}:null;}})['then'](respondWithResult(_0x13a5e8,null))[_0x30f7('0x43')](handleError(_0x13a5e8,null));};exports['addLists']=function(_0x4100fb,_0x374007,_0x5f5759){var _0x1cb497,_0x2e3048;var _0xf33f57=[];var _0x274a7f=moment()[_0x30f7('0x64')](_0x30f7('0x65'));return db[_0x30f7('0x3f')][_0x30f7('0x47')]({'where':{'id':_0x4100fb[_0x30f7('0x45')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x374007,null))[_0x30f7('0x21')](function(_0x2557ab){if(_0x2557ab){_0x2e3048=_0x2557ab;return _0x2557ab[_0x30f7('0x66')](_0x4100fb[_0x30f7('0x49')][_0x30f7('0x67')],_[_0x30f7('0x52')](_0x4100fb['body'],[_0x30f7('0x67'),'id'])||{});}return null;})['spread'](function(_0xfb15c2){var _0x3e914d;var _0x3cc1b2;_0x1cb497=_0xfb15c2||[];var _0x1817f8=[];if(_0xfb15c2){for(var _0x4e1c33=0x0;_0x4e1c33<_0xfb15c2[_0x30f7('0x35')];_0x4e1c33+=0x1){var _0x1e316c=_0xfb15c2[_0x4e1c33][_0x30f7('0x4a')]({'plain':!![]});_0x2e3048[_0x30f7('0x68')]=_0x4100fb['body'][_0x30f7('0x68')]?_0x4100fb[_0x30f7('0x49')][_0x30f7('0x68')]:_0x2e3048['dialCheckDuplicateType'];switch(_0x2e3048[_0x30f7('0x68')]){case _0x30f7('0x69'):_0x3e914d=squel['insert']()[_0x30f7('0x6a')](_0x30f7('0x6b'))[_0x30f7('0x6c')]([_0x30f7('0x6d'),_0x30f7('0x6e'),_0x30f7('0x6f'),_0x30f7('0x70'),_0x30f7('0x5b'),_0x30f7('0x53'),_0x30f7('0x54')],squel[_0x30f7('0x71')]()[_0x30f7('0x72')](_0x30f7('0x6d'),_0x30f7('0x6d'))[_0x30f7('0x72')](_0x30f7('0x73'),_0x30f7('0x6e'))[_0x30f7('0x72')]('id',_0x30f7('0x6f'))[_0x30f7('0x72')](_0x1e316c[_0x30f7('0x74')][_0x30f7('0x75')](),_0x30f7('0x70'))[_0x30f7('0x72')](_0x4100fb[_0x30f7('0x45')]['id'][_0x30f7('0x75')](),'CampaignId')[_0x30f7('0x72')]('\x27'+_0x274a7f+'\x27',_0x30f7('0x53'))[_0x30f7('0x72')]('\x27'+_0x274a7f+'\x27',_0x30f7('0x54'))[_0x30f7('0x76')](_0x30f7('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x30f7('0x3c')]('ListId\x20=\x20?',_0x1e316c[_0x30f7('0x74')]['toString']())[_0x30f7('0x3c')](_0x30f7('0x78'))[_0x30f7('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x30f7('0x71')]()[_0x30f7('0x72')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0x30f7('0x3c')](_0x30f7('0x79'),_0x4100fb['params']['id']['toString']()))[_0x30f7('0x3c')](_0x30f7('0x7a'),squel[_0x30f7('0x71')]()[_0x30f7('0x72')](_0x30f7('0x7b'))[_0x30f7('0x76')]('cm_hopper')[_0x30f7('0x3c')](_0x30f7('0x79'),_0x4100fb[_0x30f7('0x45')]['id'][_0x30f7('0x75')]())))['toString']();break;case _0x30f7('0x7c'):_0x3e914d=squel[_0x30f7('0x7d')]()[_0x30f7('0x6a')]('cm_hopper')[_0x30f7('0x6c')]([_0x30f7('0x6d'),_0x30f7('0x6e'),_0x30f7('0x6f'),_0x30f7('0x70'),_0x30f7('0x5b'),_0x30f7('0x53'),_0x30f7('0x54')],squel['select']()[_0x30f7('0x72')](_0x30f7('0x6d'),_0x30f7('0x6d'))[_0x30f7('0x72')](_0x30f7('0x73'),_0x30f7('0x6e'))['field']('id',_0x30f7('0x6f'))['field'](_0x1e316c['CmListId'][_0x30f7('0x75')](),_0x30f7('0x70'))[_0x30f7('0x72')](_0x4100fb[_0x30f7('0x45')]['id'][_0x30f7('0x75')](),_0x30f7('0x5b'))[_0x30f7('0x72')]('\x27'+_0x274a7f+'\x27',_0x30f7('0x53'))[_0x30f7('0x72')]('\x27'+_0x274a7f+'\x27',_0x30f7('0x54'))[_0x30f7('0x76')](_0x30f7('0x77'))[_0x30f7('0x3c')](_0x30f7('0x7e'))[_0x30f7('0x3c')](_0x30f7('0x7f'),_0x1e316c[_0x30f7('0x74')][_0x30f7('0x75')]())[_0x30f7('0x3c')](_0x30f7('0x78'))[_0x30f7('0x3c')](_0x30f7('0x7a'),squel['select']()['field'](_0x30f7('0x7b'))[_0x30f7('0x76')](_0x30f7('0x6b'))['where']('CampaignId\x20=\x20?',_0x4100fb[_0x30f7('0x45')]['id'][_0x30f7('0x75')]())))[_0x30f7('0x75')]();break;default:_0x3e914d=squel[_0x30f7('0x7d')]()[_0x30f7('0x6a')](_0x30f7('0x6b'))[_0x30f7('0x6c')]([_0x30f7('0x6d'),'scheduledAt','ContactId',_0x30f7('0x70'),_0x30f7('0x5b'),'createdAt',_0x30f7('0x54')],squel[_0x30f7('0x71')]()[_0x30f7('0x72')](_0x30f7('0x6d'),_0x30f7('0x6d'))['field']('NOW()',_0x30f7('0x6e'))['field']('id',_0x30f7('0x6f'))['field'](_0x1e316c['CmListId'][_0x30f7('0x75')](),'ListId')[_0x30f7('0x72')](_0x4100fb[_0x30f7('0x45')]['id'][_0x30f7('0x75')](),_0x30f7('0x5b'))[_0x30f7('0x72')]('\x27'+_0x274a7f+'\x27',_0x30f7('0x53'))['field']('\x27'+_0x274a7f+'\x27',_0x30f7('0x54'))[_0x30f7('0x76')](_0x30f7('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x30f7('0x3c')](_0x30f7('0x7f'),_0x1e316c['CmListId']['toString']())[_0x30f7('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x30f7('0x75')]();}_0x3cc1b2=squel[_0x30f7('0x7d')]()['into'](_0x30f7('0x80'))[_0x30f7('0x6c')]([_0x30f7('0x81'),_0x30f7('0x6e'),_0x30f7('0x6d'),_0x30f7('0x82'),_0x30f7('0x53'),_0x30f7('0x54')],squel[_0x30f7('0x71')]()[_0x30f7('0x72')]('h.id','id')['field']('NOW()',_0x30f7('0x6e'))[_0x30f7('0x72')](_0x30f7('0x83'),_0x30f7('0x6d'))['field']('ci.OrderBY',_0x30f7('0x82'))[_0x30f7('0x72')]('\x27'+_0x274a7f+'\x27',_0x30f7('0x53'))[_0x30f7('0x72')]('\x27'+_0x274a7f+'\x27',_0x30f7('0x54'))[_0x30f7('0x76')]('cm_contact_has_items','ci')['join'](_0x30f7('0x6b'),'h',_0x30f7('0x84'))[_0x30f7('0x3c')](_0x30f7('0x85'),_0x1e316c[_0x30f7('0x74')][_0x30f7('0x75')]())[_0x30f7('0x3c')](_0x30f7('0x86'),_0x4100fb['params']['id']['toString']())[_0x30f7('0x3c')](_0x30f7('0x87'),_0x274a7f))[_0x30f7('0x75')]();_0x1817f8[_0x30f7('0x88')](db['sequelize'][_0x30f7('0x2e')](_0x3e914d));_0xf33f57[_0x30f7('0x88')](db[_0x30f7('0x89')]['query'](_0x3cc1b2));}return BPromise['all'](_0x1817f8);}})[_0x30f7('0x21')](function(){return BPromise['all'](_0xf33f57);})['then'](function(){return _0x1cb497;})[_0x30f7('0x21')](respondWithResult(_0x374007,null))[_0x30f7('0x43')](handleError(_0x374007,null));};exports[_0x30f7('0x8a')]=function(_0x2214f2,_0x484904,_0xd03bab){return db[_0x30f7('0x3f')][_0x30f7('0x47')]({'where':{'id':_0x2214f2['params']['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x484904,null))['then'](function(_0x23496c){if(_0x23496c){return _0x23496c['removeLists'](_0x2214f2[_0x30f7('0x2e')]['ids']);}})[_0x30f7('0x21')](function(_0x54994d){if(_0x54994d){return db[_0x30f7('0x5a')][_0x30f7('0x57')]({'where':{'ListId':_0x2214f2[_0x30f7('0x2e')][_0x30f7('0x67')],'CampaignId':_0x2214f2[_0x30f7('0x45')]['id']}})['then'](function(){return _0x54994d;});}})['then'](respondWithStatusCode(_0x484904,null))[_0x30f7('0x43')](handleError(_0x484904,null));};exports[_0x30f7('0x8b')]=function(_0x373a2c,_0x53eb51,_0xb540f3){var _0x4dace9={};var _0x3e01f4={};var _0x663a6c;var _0x23fddc;return db[_0x30f7('0x3f')]['findOne']({'where':{'id':_0x373a2c[_0x30f7('0x45')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x53eb51,null))[_0x30f7('0x21')](function(_0x332f89){if(_0x332f89){_0x663a6c=_0x332f89;_0x3e01f4[_0x30f7('0x32')]=_['keys'](db[_0x30f7('0x63')][_0x30f7('0x2b')]);_0x3e01f4[_0x30f7('0x2e')]=_[_0x30f7('0x2f')](_0x373a2c['query']);_0x3e01f4[_0x30f7('0x30')]=_[_0x30f7('0x31')](_0x3e01f4[_0x30f7('0x32')],_0x3e01f4[_0x30f7('0x2e')]);_0x4dace9['attributes']=_[_0x30f7('0x31')](_0x3e01f4[_0x30f7('0x32')],qs[_0x30f7('0x34')](_0x373a2c['query'][_0x30f7('0x34')]));_0x4dace9[_0x30f7('0x33')]=_0x4dace9[_0x30f7('0x33')][_0x30f7('0x35')]?_0x4dace9['attributes']:_0x3e01f4[_0x30f7('0x32')];_0x4dace9[_0x30f7('0x38')]=qs[_0x30f7('0x39')](_0x373a2c[_0x30f7('0x2e')][_0x30f7('0x39')]);_0x4dace9[_0x30f7('0x3c')]=qs[_0x30f7('0x30')](_['pick'](_0x373a2c['query'],_0x3e01f4['filters']));if(_0x373a2c[_0x30f7('0x2e')][_0x30f7('0x3b')]){_0x4dace9[_0x30f7('0x3c')]=_[_0x30f7('0x3d')](_0x4dace9['where'],{'$or':_['map'](_0x4dace9[_0x30f7('0x33')],function(_0x1173e1){var _0x29593f={};_0x29593f[_0x1173e1]={'$like':'%'+_0x373a2c['query'][_0x30f7('0x3b')]+'%'};return _0x29593f;})});}_0x4dace9=_[_0x30f7('0x3d')]({},_0x4dace9,_0x373a2c[_0x30f7('0x46')]);return _0x663a6c[_0x30f7('0x8b')](_0x4dace9);}})[_0x30f7('0x21')](function(_0x1971a5){if(_0x1971a5){_0x23fddc=_0x1971a5[_0x30f7('0x35')];if(!_0x373a2c[_0x30f7('0x2e')][_0x30f7('0x36')](_0x30f7('0x37'))){_0x4dace9[_0x30f7('0x1a')]=qs[_0x30f7('0x1a')](_0x373a2c['query'][_0x30f7('0x1a')]);_0x4dace9['offset']=qs['offset'](_0x373a2c[_0x30f7('0x2e')][_0x30f7('0x18')]);}return _0x663a6c[_0x30f7('0x8b')](_0x4dace9);}})['then'](function(_0x39756f){if(_0x39756f){return _0x39756f?{'count':_0x23fddc,'rows':_0x39756f}:null;}})[_0x30f7('0x21')](respondWithResult(_0x53eb51,null))[_0x30f7('0x43')](handleError(_0x53eb51,null));};exports['addBlackLists']=function(_0x574882,_0x33ced6,_0x5d38f1){var _0x21461f,_0x5321fb;var _0x182a65=[];var _0x5905f0=moment()[_0x30f7('0x64')](_0x30f7('0x65'));return db[_0x30f7('0x3f')][_0x30f7('0x47')]({'where':{'id':_0x574882['params']['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0x33ced6,null))['then'](function(_0x36b029){if(_0x36b029){_0x5321fb=_0x36b029;return _0x36b029[_0x30f7('0x8c')](_0x574882[_0x30f7('0x49')][_0x30f7('0x67')],_[_0x30f7('0x52')](_0x574882[_0x30f7('0x49')],['ids','id'])||{});}return null;})[_0x30f7('0x8d')](function(_0x157d2b){var _0x1ae1b4;var _0xdc63cc;_0x21461f=_0x157d2b||[];var _0xddea02=[];if(_0x157d2b){for(var _0x21b41a=0x0;_0x21b41a<_0x157d2b[_0x30f7('0x35')];_0x21b41a+=0x1){var _0xc87f16=_0x157d2b[_0x21b41a][_0x30f7('0x4a')]({'plain':!![]});_0x1ae1b4=squel[_0x30f7('0x7d')]()[_0x30f7('0x6a')]('cm_hopper_black')['fromQuery']([_0x30f7('0x6d'),'ContactId','ListId','CampaignId',_0x30f7('0x53'),'updatedAt'],squel[_0x30f7('0x71')]()[_0x30f7('0x72')](_0x30f7('0x6d'),'phone')['field']('id',_0x30f7('0x6f'))[_0x30f7('0x72')](_0xc87f16['CmListId'][_0x30f7('0x75')](),_0x30f7('0x70'))['field'](_0x574882[_0x30f7('0x45')]['id'][_0x30f7('0x75')](),'CampaignId')[_0x30f7('0x72')](_0x30f7('0x73'),_0x30f7('0x53'))[_0x30f7('0x72')](_0x30f7('0x73'),'updatedAt')['from']('cm_contacts')[_0x30f7('0x3c')](_0x30f7('0x7e'))[_0x30f7('0x3c')](_0x30f7('0x7f'),_0xc87f16[_0x30f7('0x74')]['toString']())[_0x30f7('0x3c')](_0x30f7('0x78')))[_0x30f7('0x75')]();_0xddea02['push'](db[_0x30f7('0x89')]['query'](_0x1ae1b4));}return BPromise[_0x30f7('0x8e')](_0xddea02);}})['then'](function(){return _0x21461f;})[_0x30f7('0x21')](respondWithResult(_0x33ced6,null))[_0x30f7('0x43')](handleError(_0x33ced6,null));};exports[_0x30f7('0x8f')]=function(_0x5e7d90,_0xe68149,_0x3b7114){return db[_0x30f7('0x3f')][_0x30f7('0x47')]({'where':{'id':_0x5e7d90[_0x30f7('0x45')]['id']}})[_0x30f7('0x21')](handleEntityNotFound(_0xe68149,null))['then'](function(_0x1fef60){if(_0x1fef60){return _0x1fef60[_0x30f7('0x8f')](_0x5e7d90[_0x30f7('0x2e')]['ids']);}})[_0x30f7('0x21')](function(_0x229180){if(_0x229180){return db['CmHopperBlack'][_0x30f7('0x57')]({'where':{'ListId':_0x5e7d90['query'][_0x30f7('0x67')],'CampaignId':_0x5e7d90['params']['id']}})[_0x30f7('0x21')](function(){return _0x229180;});}})[_0x30f7('0x21')](respondWithStatusCode(_0xe68149,null))[_0x30f7('0x43')](handleError(_0xe68149,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 9b86841..e8dfa54 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(_0x4b2a90,_0x27f5ea){var _0x30bee3=function(_0x30fd3e){while(--_0x30fd3e){_0x4b2a90['push'](_0x4b2a90['shift']());}};_0x30bee3(++_0x27f5ea);}(_0x7a54,0x106));var _0x47a5=function(_0x52996c,_0x28d50d){_0x52996c=_0x52996c-0x0;var _0x2e0201=_0x7a54[_0x52996c];return _0x2e0201;};'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(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 8b04a52..9284444 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 _0x44f8=['raw','where','attributes','limit','include','map','model','then','GetCampaign','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request\x20sent','error','Campaign,\x20%s,\x20%s','message','result','catch','options'];(function(_0x1e5246,_0x376043){var _0xf4d359=function(_0x5f4eb9){while(--_0x5f4eb9){_0x1e5246['push'](_0x1e5246['shift']());}};_0xf4d359(++_0x376043);}(_0x44f8,0x1de));var _0x844f=function(_0x500a6f,_0xa7042e){_0x500a6f=_0x500a6f-0x0;var _0x1093cc=_0x44f8[_0x500a6f];return _0x1093cc;};'use strict';var _=require(_0x844f('0x0'));var util=require(_0x844f('0x1'));var moment=require(_0x844f('0x2'));var BPromise=require(_0x844f('0x3'));var rs=require(_0x844f('0x4'));var fs=require('fs');var Redis=require(_0x844f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x844f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x844f('0x7')][_0x844f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46eb2c,_0x38a334,_0x37b697){return new BPromise(function(_0x1987a9,_0x188f88){return client['request'](_0x46eb2c,_0x37b697)['then'](function(_0x39416d){logger['info']('Campaign,\x20%s,\x20%s',_0x38a334,_0x844f('0x9'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x38a334,'request\x20sent',JSON['stringify'](_0x39416d));if(_0x39416d[_0x844f('0xa')]){if(_0x39416d[_0x844f('0xa')]['code']===0x1f4){logger[_0x844f('0xa')](_0x844f('0xb'),_0x38a334,_0x39416d[_0x844f('0xa')]['message']);return _0x188f88(_0x39416d['error'][_0x844f('0xc')]);}logger['error'](_0x844f('0xb'),_0x38a334,_0x39416d[_0x844f('0xa')][_0x844f('0xc')]);return _0x1987a9(_0x39416d[_0x844f('0xa')][_0x844f('0xc')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x38a334,_0x844f('0x9'));_0x1987a9(_0x39416d[_0x844f('0xd')][_0x844f('0xc')]);}})[_0x844f('0xe')](function(_0x4f7ce4){logger[_0x844f('0xa')]('Campaign,\x20%s,\x20%s',_0x38a334,_0x4f7ce4);_0x188f88(_0x4f7ce4);});});}exports['GetCampaign']=function(_0x1f96d0){var _0x2cca8e=this;return new Promise(function(_0x5cc55c,_0x24e386){return db['Campaign']['findAll']({'raw':_0x1f96d0[_0x844f('0xf')]?_0x1f96d0['options'][_0x844f('0x10')]===undefined?!![]:![]:!![],'where':_0x1f96d0[_0x844f('0xf')]?_0x1f96d0[_0x844f('0xf')][_0x844f('0x11')]||null:null,'attributes':_0x1f96d0[_0x844f('0xf')]?_0x1f96d0['options'][_0x844f('0x12')]||null:null,'limit':_0x1f96d0['options']?_0x1f96d0['options'][_0x844f('0x13')]||null:null,'include':_0x1f96d0[_0x844f('0xf')]?_0x1f96d0[_0x844f('0xf')][_0x844f('0x14')]?_[_0x844f('0x15')](_0x1f96d0['options'][_0x844f('0x14')],function(_0x4bd66d){return{'model':db[_0x4bd66d[_0x844f('0x16')]],'as':_0x4bd66d['as'],'attributes':_0x4bd66d['attributes'],'include':_0x4bd66d[_0x844f('0x14')]?_[_0x844f('0x15')](_0x4bd66d[_0x844f('0x14')],function(_0x7dc0c9){return{'model':db[_0x7dc0c9[_0x844f('0x16')]],'as':_0x7dc0c9['as'],'attributes':_0x7dc0c9[_0x844f('0x12')],'include':_0x7dc0c9[_0x844f('0x14')]?_['map'](_0x7dc0c9[_0x844f('0x14')],function(_0x16d7ad){return{'model':db[_0x16d7ad[_0x844f('0x16')]],'as':_0x16d7ad['as'],'attributes':_0x16d7ad[_0x844f('0x12')]};}):[]};}):[]};}):[]:[]})[_0x844f('0x17')](function(_0x29d224){logger['info'](_0x844f('0x18'),_0x1f96d0);logger[_0x844f('0x19')](_0x844f('0x18'),_0x1f96d0,JSON['stringify'](_0x29d224));_0x5cc55c(_0x29d224);})['catch'](function(_0x1e243c){logger[_0x844f('0xa')](_0x844f('0x18'),_0x1e243c['message'],_0x1f96d0);_0x24e386(_0x2cca8e[_0x844f('0xa')](0x1f4,_0x1e243c['message']));});});};
\ No newline at end of file
+var _0x639a=['then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','options','raw','limit','map','include','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0x639a,0xec));var _0xa639=function(_0x23f58b,_0x16c2c4){_0x23f58b=_0x23f58b-0x0;var _0x494e3a=_0x639a[_0x23f58b];return _0x494e3a;};'use strict';var _=require('lodash');var util=require(_0xa639('0x0'));var moment=require(_0xa639('0x1'));var BPromise=require(_0xa639('0x2'));var rs=require(_0xa639('0x3'));var fs=require('fs');var Redis=require(_0xa639('0x4'));var db=require(_0xa639('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa639('0x6'))(_0xa639('0x7'));var config=require(_0xa639('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa639('0x9')][_0xa639('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29d2e4,_0x4223f6,_0x4c4ebf){return new BPromise(function(_0xfb7f17,_0x3ec583){return client[_0xa639('0xb')](_0x29d2e4,_0x4c4ebf)[_0xa639('0xc')](function(_0x324365){logger[_0xa639('0xd')](_0xa639('0xe'),_0x4223f6,_0xa639('0xf'));logger[_0xa639('0x10')](_0xa639('0x11'),_0x4223f6,_0xa639('0xf'),JSON[_0xa639('0x12')](_0x324365));if(_0x324365[_0xa639('0x13')]){if(_0x324365[_0xa639('0x13')]['code']===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x4223f6,_0x324365[_0xa639('0x13')][_0xa639('0x14')]);return _0x3ec583(_0x324365['error']['message']);}logger[_0xa639('0x13')](_0xa639('0xe'),_0x4223f6,_0x324365['error'][_0xa639('0x14')]);return _0xfb7f17(_0x324365[_0xa639('0x13')][_0xa639('0x14')]);}else{logger['info'](_0xa639('0xe'),_0x4223f6,_0xa639('0xf'));_0xfb7f17(_0x324365[_0xa639('0x15')][_0xa639('0x14')]);}})[_0xa639('0x16')](function(_0x5924bd){logger[_0xa639('0x13')]('Campaign,\x20%s,\x20%s',_0x4223f6,_0x5924bd);_0x3ec583(_0x5924bd);});});}exports[_0xa639('0x17')]=function(_0x2e23a9){var _0xbd8a9=this;return new Promise(function(_0x229545,_0x3a8ee9){return db['Campaign']['findAll']({'raw':_0x2e23a9[_0xa639('0x18')]?_0x2e23a9[_0xa639('0x18')][_0xa639('0x19')]===undefined?!![]:![]:!![],'where':_0x2e23a9[_0xa639('0x18')]?_0x2e23a9[_0xa639('0x18')]['where']||null:null,'attributes':_0x2e23a9['options']?_0x2e23a9[_0xa639('0x18')]['attributes']||null:null,'limit':_0x2e23a9['options']?_0x2e23a9['options'][_0xa639('0x1a')]||null:null,'include':_0x2e23a9[_0xa639('0x18')]?_0x2e23a9[_0xa639('0x18')]['include']?_[_0xa639('0x1b')](_0x2e23a9['options'][_0xa639('0x1c')],function(_0x351a33){return{'model':db[_0x351a33['model']],'as':_0x351a33['as'],'attributes':_0x351a33['attributes'],'include':_0x351a33['include']?_[_0xa639('0x1b')](_0x351a33['include'],function(_0x42b5d8){return{'model':db[_0x42b5d8[_0xa639('0x1d')]],'as':_0x42b5d8['as'],'attributes':_0x42b5d8[_0xa639('0x1e')],'include':_0x42b5d8[_0xa639('0x1c')]?_['map'](_0x42b5d8[_0xa639('0x1c')],function(_0x1a0d4e){return{'model':db[_0x1a0d4e[_0xa639('0x1d')]],'as':_0x1a0d4e['as'],'attributes':_0x1a0d4e[_0xa639('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa639('0xc')](function(_0x398055){logger[_0xa639('0xd')](_0xa639('0x17'),_0x2e23a9);logger[_0xa639('0x10')](_0xa639('0x17'),_0x2e23a9,JSON['stringify'](_0x398055));_0x229545(_0x398055);})[_0xa639('0x16')](function(_0x38ff11){logger[_0xa639('0x13')](_0xa639('0x17'),_0x38ff11[_0xa639('0x14')],_0x2e23a9);_0x3a8ee9(_0xbd8a9['error'](0x1f4,_0x38ff11[_0xa639('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index a9414be..f811e68 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 _0xdeaf=['/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','removeLists','multer','util','path','Router','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','/:id/clone','clone'];(function(_0x316a66,_0x445ebc){var _0x100b8e=function(_0x25e5b8){while(--_0x25e5b8){_0x316a66['push'](_0x316a66['shift']());}};_0x100b8e(++_0x445ebc);}(_0xdeaf,0x19e));var _0xfdea=function(_0x24de71,_0x3af991){_0x24de71=_0x24de71-0x0;var _0x4d0303=_0xdeaf[_0x24de71];return _0x4d0303;};'use strict';var multer=require(_0xfdea('0x0'));var util=require(_0xfdea('0x1'));var path=require(_0xfdea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfdea('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfdea('0x4'));router[_0xfdea('0x5')]('/',auth[_0xfdea('0x6')](),controller[_0xfdea('0x7')]);router['get'](_0xfdea('0x8'),auth[_0xfdea('0x6')](),controller[_0xfdea('0x9')]);router[_0xfdea('0x5')]('/:id/hoppers',auth[_0xfdea('0x6')](),controller['getHoppers']);router[_0xfdea('0x5')](_0xfdea('0xa'),auth[_0xfdea('0x6')](),controller[_0xfdea('0xb')]);router[_0xfdea('0x5')](_0xfdea('0xc'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xfdea('0x5')](_0xfdea('0xd'),auth[_0xfdea('0x6')](),controller[_0xfdea('0xe')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xfdea('0xf')]);router['get']('/:id/blacklists',auth[_0xfdea('0x6')](),controller[_0xfdea('0x10')]);router[_0xfdea('0x11')]('/',auth[_0xfdea('0x6')](),controller[_0xfdea('0x12')]);router[_0xfdea('0x11')](_0xfdea('0x13'),auth[_0xfdea('0x6')](),controller[_0xfdea('0x14')]);router[_0xfdea('0x11')](_0xfdea('0x15'),auth['isAuthenticated'](),controller[_0xfdea('0x16')]);router[_0xfdea('0x11')](_0xfdea('0x17'),auth[_0xfdea('0x6')](),controller[_0xfdea('0x18')]);router[_0xfdea('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xfdea('0x1a')]);router[_0xfdea('0x1b')](_0xfdea('0x8'),auth[_0xfdea('0x6')](),controller['destroy']);router[_0xfdea('0x1b')](_0xfdea('0x15'),auth['isAuthenticated'](),controller[_0xfdea('0x1c')]);router[_0xfdea('0x1b')](_0xfdea('0x17'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0x0e85=['multer','util','connect-timeout','express','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','/:id/lists','addBlackLists','put','update','destroy','delete','removeLists','exports'];(function(_0x1c4efc,_0x3c921d){var _0x54d8de=function(_0x9e4173){while(--_0x9e4173){_0x1c4efc['push'](_0x1c4efc['shift']());}};_0x54d8de(++_0x3c921d);}(_0x0e85,0x7c));var _0x50e8=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x0e85[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xa')]);router[_0x50e8('0x6')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller['getHoppers']);router[_0x50e8('0x6')](_0x50e8('0xc'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xd')]);router[_0x50e8('0x6')](_0x50e8('0xe'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xf')]);router['get']('/:id/hopper_black',auth[_0x50e8('0x7')](),controller[_0x50e8('0x10')]);router['get']('/:id/lists',auth[_0x50e8('0x7')](),controller[_0x50e8('0x11')]);router[_0x50e8('0x6')](_0x50e8('0x12'),auth['isAuthenticated'](),controller[_0x50e8('0x13')]);router[_0x50e8('0x14')]('/',auth[_0x50e8('0x7')](),controller['create']);router['post'](_0x50e8('0x15'),auth[_0x50e8('0x7')](),controller[_0x50e8('0x16')]);router[_0x50e8('0x14')](_0x50e8('0x17'),auth[_0x50e8('0x7')](),controller['addLists']);router['post'](_0x50e8('0x12'),auth[_0x50e8('0x7')](),controller[_0x50e8('0x18')]);router[_0x50e8('0x19')](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0x1a')]);router['delete'](_0x50e8('0x9'),auth['isAuthenticated'](),controller[_0x50e8('0x1b')]);router[_0x50e8('0x1c')](_0x50e8('0x17'),auth[_0x50e8('0x7')](),controller[_0x50e8('0x1d')]);router['delete'](_0x50e8('0x12'),auth[_0x50e8('0x7')](),controller['removeBlackLists']);module[_0x50e8('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 1c4d89f..8a06101 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 _0xbaa1=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x1e3116,_0x3b2e5c){var _0x3a5501=function(_0x51b726){while(--_0x51b726){_0x1e3116['push'](_0x1e3116['shift']());}};_0x3a5501(++_0x3b2e5c);}(_0xbaa1,0x168));var _0x1baa=function(_0x5d9447,_0x642173){_0x5d9447=_0x5d9447-0x0;var _0x11bae2=_0xbaa1[_0x5d9447];return _0x11bae2;};'use strict';var Sequelize=require(_0x1baa('0x0'));module[_0x1baa('0x1')]={'key':{'type':Sequelize[_0x1baa('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x1baa('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x1baa('0x2')]},'name':{'type':Sequelize[_0x1baa('0x4')],'get':function(){return this[_0x1baa('0x5')]('key');}}};
\ No newline at end of file
+var _0x2788=['STRING','TEXT','getDataValue','key'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x2788,0x138));var _0x8278=function(_0x3ab2ce,_0xfe27ec){_0x3ab2ce=_0x3ab2ce-0x0;var _0x35c612=_0x2788[_0x3ab2ce];return _0x35c612;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x8278('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x8278('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8278('0x0')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8278('0x2')](_0x8278('0x3'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1eba068..f864fbb 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 _0x4fe9=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','include','CannedAnswer','rows','params','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','UserProfileResource','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x486512,_0x1c4f06){var _0x48e24a=function(_0x18570c){while(--_0x18570c){_0x486512['push'](_0x486512['shift']());}};_0x48e24a(++_0x1c4f06);}(_0x4fe9,0x132));var _0x94fe=function(_0x4dde9f,_0x2de95f){_0x4dde9f=_0x4dde9f-0x0;var _0x429e11=_0x4fe9[_0x4dde9f];return _0x429e11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94fe('0x0'));var zipdir=require(_0x94fe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94fe('0x2'));var moment=require(_0x94fe('0x3'));var BPromise=require(_0x94fe('0x4'));var Mustache=require(_0x94fe('0x5'));var util=require(_0x94fe('0x6'));var path=require('path');var sox=require(_0x94fe('0x7'));var csv=require(_0x94fe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94fe('0x9'));var squel=require('squel');var crypto=require(_0x94fe('0xa'));var jsforce=require(_0x94fe('0xb'));var deskjs=require(_0x94fe('0xc'));var toCsv=require(_0x94fe('0x8'));var querystring=require(_0x94fe('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x94fe('0xe'));var as=require(_0x94fe('0xf'));var hardwareService=require(_0x94fe('0x10'));var logger=require('../../config/logger')(_0x94fe('0x11'));var utils=require(_0x94fe('0x12'));var config=require(_0x94fe('0x13'));var licenseUtil=require(_0x94fe('0x14'));var db=require(_0x94fe('0x15'))['db'];function respondWithStatusCode(_0x1fcf80,_0x5a57c1){_0x5a57c1=_0x5a57c1||0xcc;return function(_0x43507d){if(_0x43507d){return _0x1fcf80[_0x94fe('0x16')](_0x5a57c1);}return _0x1fcf80[_0x94fe('0x17')](_0x5a57c1)['end']();};}function respondWithResult(_0x379a8a,_0x86a93e){_0x86a93e=_0x86a93e||0xc8;return function(_0x15c5fd){if(_0x15c5fd){return _0x379a8a[_0x94fe('0x17')](_0x86a93e)[_0x94fe('0x18')](_0x15c5fd);}};}function respondWithFilteredResult(_0x74906b,_0x46c917){return function(_0x45f4ef){if(_0x45f4ef){var _0x32aafa=typeof _0x46c917['offset']==='undefined'&&typeof _0x46c917[_0x94fe('0x19')]===_0x94fe('0x1a');var _0x18f2cc=_0x45f4ef[_0x94fe('0x1b')];var _0x3a6c90=_0x32aafa?0x0:_0x46c917[_0x94fe('0x1c')];var _0x47014c=_0x32aafa?_0x45f4ef[_0x94fe('0x1b')]:_0x46c917[_0x94fe('0x1c')]+_0x46c917[_0x94fe('0x19')];var _0x74352b;if(_0x47014c>=_0x18f2cc){_0x47014c=_0x18f2cc;_0x74352b=0xc8;}else{_0x74352b=0xce;}_0x74906b[_0x94fe('0x17')](_0x74352b);return _0x74906b['set']('Content-Range',_0x3a6c90+'-'+_0x47014c+'/'+_0x18f2cc)[_0x94fe('0x18')](_0x45f4ef);}return null;};}function patchUpdates(_0x4ceedd){return function(_0x51248f){try{jsonpatch[_0x94fe('0x1d')](_0x51248f,_0x4ceedd,!![]);}catch(_0x44a9a3){return BPromise[_0x94fe('0x1e')](_0x44a9a3);}return _0x51248f[_0x94fe('0x1f')]();};}function saveUpdates(_0x4e2047,_0x3df344){return function(_0x297a22){if(_0x297a22){return _0x297a22[_0x94fe('0x20')](_0x4e2047)['then'](function(_0x2374b5){return _0x2374b5;});}return null;};}function removeEntity(_0x251418,_0x1e86bc){return function(_0x4238a0){if(_0x4238a0){return _0x4238a0['destroy']()[_0x94fe('0x21')](function(){var _0x12d173=_0x4238a0['get']({'plain':!![]});var _0x99bc5b='CannedAnswers';return db['UserProfileResource'][_0x94fe('0x22')]({'where':{'type':_0x99bc5b,'resourceId':_0x12d173['id']}})[_0x94fe('0x21')](function(){return _0x4238a0;});})[_0x94fe('0x21')](function(){_0x251418[_0x94fe('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x135d15,_0x15dcfe){return function(_0x501aec){if(!_0x501aec){_0x135d15[_0x94fe('0x16')](0x194);}return _0x501aec;};}function handleError(_0x238e49,_0x4864ab){_0x4864ab=_0x4864ab||0x1f4;return function(_0x298435){logger[_0x94fe('0x23')](_0x298435[_0x94fe('0x24')]);if(_0x298435['name']){delete _0x298435[_0x94fe('0x25')];}_0x238e49[_0x94fe('0x17')](_0x4864ab)[_0x94fe('0x26')](_0x298435);};}exports[_0x94fe('0x27')]=function(_0x55ad86,_0x197f3a){var _0x7df08b={},_0x577011={},_0x10640d={'count':0x0,'rows':[]};var _0x18b783=_[_0x94fe('0x28')](db['CannedAnswer'][_0x94fe('0x29')],function(_0xbb7b08){return{'name':_0xbb7b08[_0x94fe('0x2a')],'type':_0xbb7b08[_0x94fe('0x2b')][_0x94fe('0x2c')]};});_0x577011[_0x94fe('0x2d')]=_['map'](_0x18b783,'name');_0x577011['query']=_[_0x94fe('0x2e')](_0x55ad86[_0x94fe('0x2f')]);_0x577011[_0x94fe('0x30')]=_[_0x94fe('0x31')](_0x577011[_0x94fe('0x2d')],_0x577011['query']);_0x7df08b[_0x94fe('0x32')]=_[_0x94fe('0x31')](_0x577011[_0x94fe('0x2d')],qs[_0x94fe('0x33')](_0x55ad86['query'][_0x94fe('0x33')]));_0x7df08b[_0x94fe('0x32')]=_0x7df08b['attributes'][_0x94fe('0x34')]?_0x7df08b[_0x94fe('0x32')]:_0x577011['model'];if(!_0x55ad86[_0x94fe('0x2f')]['hasOwnProperty']('nolimit')){_0x7df08b[_0x94fe('0x19')]=qs[_0x94fe('0x19')](_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x19')]);_0x7df08b[_0x94fe('0x1c')]=qs[_0x94fe('0x1c')](_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x1c')]);}_0x7df08b[_0x94fe('0x35')]=qs[_0x94fe('0x36')](_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x36')]);_0x7df08b[_0x94fe('0x37')]=qs[_0x94fe('0x30')](_['pick'](_0x55ad86[_0x94fe('0x2f')],_0x577011[_0x94fe('0x30')]),_0x18b783);if(_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x38')]){_0x7df08b['where']=_[_0x94fe('0x39')](_0x7df08b['where'],{'$or':[{'key':{'$like':'%'+_0x55ad86['query'][_0x94fe('0x38')]+'%'}},{'value':{'$like':'%'+_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x38')]+'%'}}]});}_0x7df08b=_[_0x94fe('0x39')]({},_0x7df08b,_0x55ad86[_0x94fe('0x3a')]);var _0x1ed0ce={'where':_0x7df08b[_0x94fe('0x37')]};return db['CannedAnswer']['count'](_0x1ed0ce)[_0x94fe('0x21')](function(_0x5c84db){_0x10640d[_0x94fe('0x1b')]=_0x5c84db;if(_0x55ad86[_0x94fe('0x2f')]['includeAll']){_0x7df08b[_0x94fe('0x3b')]=[{'all':!![]}];}return db[_0x94fe('0x3c')]['findAll'](_0x7df08b);})[_0x94fe('0x21')](function(_0x152b07){_0x10640d[_0x94fe('0x3d')]=_0x152b07;return _0x10640d;})[_0x94fe('0x21')](respondWithFilteredResult(_0x197f3a,_0x7df08b))['catch'](handleError(_0x197f3a,null));};exports['show']=function(_0x188e21,_0xfce685){var _0x1b42e3={'raw':!![],'where':{'id':_0x188e21[_0x94fe('0x3e')]['id']}},_0x483fb9={};_0x483fb9[_0x94fe('0x2d')]=_[_0x94fe('0x2e')](db[_0x94fe('0x3c')][_0x94fe('0x29')]);_0x483fb9[_0x94fe('0x2f')]=_[_0x94fe('0x2e')](_0x188e21['query']);_0x483fb9['filters']=_[_0x94fe('0x31')](_0x483fb9['model'],_0x483fb9[_0x94fe('0x2f')]);_0x1b42e3['attributes']=_['intersection'](_0x483fb9['model'],qs[_0x94fe('0x33')](_0x188e21[_0x94fe('0x2f')][_0x94fe('0x33')]));_0x1b42e3[_0x94fe('0x32')]=_0x1b42e3[_0x94fe('0x32')]['length']?_0x1b42e3[_0x94fe('0x32')]:_0x483fb9[_0x94fe('0x2d')];if(_0x188e21[_0x94fe('0x2f')]['includeAll']){_0x1b42e3[_0x94fe('0x3b')]=[{'all':!![]}];}_0x1b42e3=_[_0x94fe('0x39')]({},_0x1b42e3,_0x188e21[_0x94fe('0x3a')]);return db['CannedAnswer'][_0x94fe('0x3f')](_0x1b42e3)[_0x94fe('0x21')](handleEntityNotFound(_0xfce685,null))[_0x94fe('0x21')](respondWithResult(_0xfce685,null))['catch'](handleError(_0xfce685,null));};exports[_0x94fe('0x20')]=function(_0x571be7,_0x486eac){if(_0x571be7[_0x94fe('0x40')]['id']){delete _0x571be7[_0x94fe('0x40')]['id'];}return db['CannedAnswer'][_0x94fe('0x3f')]({'where':{'id':_0x571be7[_0x94fe('0x3e')]['id']}})[_0x94fe('0x21')](handleEntityNotFound(_0x486eac,null))[_0x94fe('0x21')](saveUpdates(_0x571be7[_0x94fe('0x40')],null))[_0x94fe('0x21')](respondWithResult(_0x486eac,null))[_0x94fe('0x41')](handleError(_0x486eac,null));};exports[_0x94fe('0x22')]=function(_0x2fd648,_0x2f1c6b){return db[_0x94fe('0x3c')]['find']({'where':{'id':_0x2fd648['params']['id']}})[_0x94fe('0x21')](handleEntityNotFound(_0x2f1c6b,null))[_0x94fe('0x21')](removeEntity(_0x2f1c6b,null))[_0x94fe('0x41')](handleError(_0x2f1c6b,null));};exports[_0x94fe('0x42')]=function(_0xcd7d4,_0x476e59){var _0x4b74fe={'key':_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x2c')]};if(_0xcd7d4['body'][_0x94fe('0x43')]){_0x4b74fe['MailAccountId']=_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x43')];}else if(_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x44')]){_0x4b74fe[_0x94fe('0x44')]=_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x44')];}else if(_0xcd7d4[_0x94fe('0x40')]['OpenchannelAccountId']){_0x4b74fe['OpenchannelAccountId']=_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x45')];}else if(_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x46')]){_0x4b74fe[_0x94fe('0x46')]=_0xcd7d4[_0x94fe('0x40')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x4b74fe})[_0x94fe('0x21')](function(_0x10d72a){if(_0x10d72a){throw new db[(_0x94fe('0x47'))]['ValidationError'](_0x94fe('0x48'));}return db[_0x94fe('0x3c')][_0x94fe('0x42')](_0xcd7d4[_0x94fe('0x40')]);})['then'](function(_0x473ac9){var _0x35f7e4=_0xcd7d4[_0x94fe('0x49')][_0x94fe('0x4a')]({'plain':!![]});if(!_0x35f7e4)throw new Error(_0x94fe('0x4b'));if(_0x35f7e4[_0x94fe('0x4c')]===_0x94fe('0x49')){var _0x17fe6a=_0x473ac9[_0x94fe('0x4a')]({'plain':!![]});return db[_0x94fe('0x4d')][_0x94fe('0x3f')]({'where':{'name':_0x94fe('0x4e'),'userProfileId':_0x35f7e4['userProfileId']},'raw':!![]})['then'](function(_0x5626e5){if(_0x5626e5&&_0x5626e5[_0x94fe('0x4f')]===0x0){return db[_0x94fe('0x50')][_0x94fe('0x42')]({'name':_0x17fe6a[_0x94fe('0x25')],'resourceId':_0x17fe6a['id'],'type':_0x5626e5['name'],'sectionId':_0x5626e5['id']},{})[_0x94fe('0x21')](function(){return _0x473ac9;});}else{return _0x473ac9;}})[_0x94fe('0x41')](function(_0x1b2bdb){logger[_0x94fe('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b2bdb);throw _0x1b2bdb;});}return _0x473ac9;})[_0x94fe('0x21')](respondWithResult(_0x476e59,0xc9))[_0x94fe('0x41')](handleError(_0x476e59,null));};
\ No newline at end of file
+var _0xfe1d=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','show','params','intersection','fields','include','catch','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','Content-Range','reject','save','update','then','CannedAnswers','destroy','error','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','model'];(function(_0x3bbe4e,_0x21cb7f){var _0x522321=function(_0x46026c){while(--_0x46026c){_0x3bbe4e['push'](_0x3bbe4e['shift']());}};_0x522321(++_0x21cb7f);}(_0xfe1d,0x12f));var _0xdfe1=function(_0x13d3d0,_0x2a8b82){_0x13d3d0=_0x13d3d0-0x0;var _0x5200d9=_0xfe1d[_0x13d3d0];return _0x5200d9;};'use strict';var emlformat=require(_0xdfe1('0x0'));var rimraf=require(_0xdfe1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfe1('0x2'));var rp=require(_0xdfe1('0x3'));var moment=require(_0xdfe1('0x4'));var BPromise=require(_0xdfe1('0x5'));var Mustache=require(_0xdfe1('0x6'));var util=require(_0xdfe1('0x7'));var path=require(_0xdfe1('0x8'));var sox=require(_0xdfe1('0x9'));var csv=require('to-csv');var ejs=require(_0xdfe1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfe1('0xb'));var squel=require(_0xdfe1('0xc'));var crypto=require('crypto');var jsforce=require(_0xdfe1('0xd'));var deskjs=require(_0xdfe1('0xe'));var toCsv=require(_0xdfe1('0xf'));var querystring=require('querystring');var Papa=require(_0xdfe1('0x10'));var Redis=require(_0xdfe1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdfe1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfe1('0x13'));var logger=require(_0xdfe1('0x14'))(_0xdfe1('0x15'));var utils=require('../../config/utils');var config=require(_0xdfe1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x926acb,_0x5c93af){_0x5c93af=_0x5c93af||0xcc;return function(_0x2fca38){if(_0x2fca38){return _0x926acb[_0xdfe1('0x17')](_0x5c93af);}return _0x926acb[_0xdfe1('0x18')](_0x5c93af)[_0xdfe1('0x19')]();};}function respondWithResult(_0x41d522,_0x3c95b5){_0x3c95b5=_0x3c95b5||0xc8;return function(_0x16d11f){if(_0x16d11f){return _0x41d522['status'](_0x3c95b5)[_0xdfe1('0x1a')](_0x16d11f);}};}function respondWithFilteredResult(_0x55b76a,_0x44a036){return function(_0x1e4209){if(_0x1e4209){var _0x4429d2=typeof _0x44a036['offset']===_0xdfe1('0x1b')&&typeof _0x44a036[_0xdfe1('0x1c')]===_0xdfe1('0x1b');var _0x4237af=_0x1e4209['count'];var _0x3820f2=_0x4429d2?0x0:_0x44a036[_0xdfe1('0x1d')];var _0x57e9c8=_0x4429d2?_0x1e4209['count']:_0x44a036['offset']+_0x44a036[_0xdfe1('0x1c')];var _0x358639;if(_0x57e9c8>=_0x4237af){_0x57e9c8=_0x4237af;_0x358639=0xc8;}else{_0x358639=0xce;}_0x55b76a['status'](_0x358639);return _0x55b76a['set'](_0xdfe1('0x1e'),_0x3820f2+'-'+_0x57e9c8+'/'+_0x4237af)[_0xdfe1('0x1a')](_0x1e4209);}return null;};}function patchUpdates(_0x3bfd9d){return function(_0x3938dd){try{jsonpatch['apply'](_0x3938dd,_0x3bfd9d,!![]);}catch(_0x12b33b){return BPromise[_0xdfe1('0x1f')](_0x12b33b);}return _0x3938dd[_0xdfe1('0x20')]();};}function saveUpdates(_0x53a5c4,_0x5ac642){return function(_0x998265){if(_0x998265){return _0x998265[_0xdfe1('0x21')](_0x53a5c4)[_0xdfe1('0x22')](function(_0x5214d6){return _0x5214d6;});}return null;};}function removeEntity(_0x4e72e9,_0x530ee1){return function(_0xd86e87){if(_0xd86e87){return _0xd86e87['destroy']()[_0xdfe1('0x22')](function(){var _0x3a0ce3=_0xd86e87['get']({'plain':!![]});var _0x11436d=_0xdfe1('0x23');return db['UserProfileResource'][_0xdfe1('0x24')]({'where':{'type':_0x11436d,'resourceId':_0x3a0ce3['id']}})['then'](function(){return _0xd86e87;});})[_0xdfe1('0x22')](function(){_0x4e72e9[_0xdfe1('0x18')](0xcc)[_0xdfe1('0x19')]();});}};}function handleEntityNotFound(_0x21d98f,_0x1f2b01){return function(_0x23372e){if(!_0x23372e){_0x21d98f[_0xdfe1('0x17')](0x194);}return _0x23372e;};}function handleError(_0x46761b,_0x4ec39b){_0x4ec39b=_0x4ec39b||0x1f4;return function(_0x4e54f1){logger[_0xdfe1('0x25')](_0x4e54f1['stack']);if(_0x4e54f1['name']){delete _0x4e54f1[_0xdfe1('0x26')];}_0x46761b[_0xdfe1('0x18')](_0x4ec39b)['send'](_0x4e54f1);};}exports[_0xdfe1('0x27')]=function(_0x311a42,_0x14a40e){var _0x61f218={},_0x592f66={},_0x444cd8={'count':0x0,'rows':[]};var _0x3edae6=_[_0xdfe1('0x28')](db[_0xdfe1('0x29')][_0xdfe1('0x2a')],function(_0x40df8e){return{'name':_0x40df8e[_0xdfe1('0x2b')],'type':_0x40df8e[_0xdfe1('0x2c')][_0xdfe1('0x2d')]};});_0x592f66['model']=_[_0xdfe1('0x28')](_0x3edae6,_0xdfe1('0x26'));_0x592f66[_0xdfe1('0x2e')]=_[_0xdfe1('0x2f')](_0x311a42['query']);_0x592f66['filters']=_['intersection'](_0x592f66[_0xdfe1('0x30')],_0x592f66['query']);_0x61f218['attributes']=_['intersection'](_0x592f66['model'],qs['fields'](_0x311a42[_0xdfe1('0x2e')]['fields']));_0x61f218['attributes']=_0x61f218[_0xdfe1('0x31')][_0xdfe1('0x32')]?_0x61f218['attributes']:_0x592f66[_0xdfe1('0x30')];if(!_0x311a42[_0xdfe1('0x2e')][_0xdfe1('0x33')](_0xdfe1('0x34'))){_0x61f218[_0xdfe1('0x1c')]=qs[_0xdfe1('0x1c')](_0x311a42[_0xdfe1('0x2e')][_0xdfe1('0x1c')]);_0x61f218[_0xdfe1('0x1d')]=qs['offset'](_0x311a42[_0xdfe1('0x2e')][_0xdfe1('0x1d')]);}_0x61f218[_0xdfe1('0x35')]=qs[_0xdfe1('0x36')](_0x311a42[_0xdfe1('0x2e')]['sort']);_0x61f218[_0xdfe1('0x37')]=qs[_0xdfe1('0x38')](_[_0xdfe1('0x39')](_0x311a42[_0xdfe1('0x2e')],_0x592f66['filters']),_0x3edae6);if(_0x311a42[_0xdfe1('0x2e')][_0xdfe1('0x3a')]){_0x61f218['where']=_[_0xdfe1('0x3b')](_0x61f218['where'],{'$or':[{'key':{'$like':'%'+_0x311a42[_0xdfe1('0x2e')][_0xdfe1('0x3a')]+'%'}},{'value':{'$like':'%'+_0x311a42['query'][_0xdfe1('0x3a')]+'%'}}]});}_0x61f218=_[_0xdfe1('0x3b')]({},_0x61f218,_0x311a42[_0xdfe1('0x3c')]);var _0x4d36f5={'where':_0x61f218[_0xdfe1('0x37')]};return db[_0xdfe1('0x29')][_0xdfe1('0x3d')](_0x4d36f5)[_0xdfe1('0x22')](function(_0x1a4d25){_0x444cd8[_0xdfe1('0x3d')]=_0x1a4d25;if(_0x311a42['query'][_0xdfe1('0x3e')]){_0x61f218['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xdfe1('0x3f')](_0x61f218);})['then'](function(_0x4a318b){_0x444cd8[_0xdfe1('0x40')]=_0x4a318b;return _0x444cd8;})['then'](respondWithFilteredResult(_0x14a40e,_0x61f218))['catch'](handleError(_0x14a40e,null));};exports[_0xdfe1('0x41')]=function(_0x3764b9,_0x520962){var _0x3cb9ee={'raw':!![],'where':{'id':_0x3764b9[_0xdfe1('0x42')]['id']}},_0x2e712a={};_0x2e712a[_0xdfe1('0x30')]=_[_0xdfe1('0x2f')](db[_0xdfe1('0x29')][_0xdfe1('0x2a')]);_0x2e712a['query']=_[_0xdfe1('0x2f')](_0x3764b9[_0xdfe1('0x2e')]);_0x2e712a[_0xdfe1('0x38')]=_[_0xdfe1('0x43')](_0x2e712a[_0xdfe1('0x30')],_0x2e712a[_0xdfe1('0x2e')]);_0x3cb9ee[_0xdfe1('0x31')]=_['intersection'](_0x2e712a[_0xdfe1('0x30')],qs[_0xdfe1('0x44')](_0x3764b9[_0xdfe1('0x2e')][_0xdfe1('0x44')]));_0x3cb9ee[_0xdfe1('0x31')]=_0x3cb9ee[_0xdfe1('0x31')]['length']?_0x3cb9ee[_0xdfe1('0x31')]:_0x2e712a[_0xdfe1('0x30')];if(_0x3764b9[_0xdfe1('0x2e')][_0xdfe1('0x3e')]){_0x3cb9ee[_0xdfe1('0x45')]=[{'all':!![]}];}_0x3cb9ee=_[_0xdfe1('0x3b')]({},_0x3cb9ee,_0x3764b9['options']);return db['CannedAnswer']['find'](_0x3cb9ee)[_0xdfe1('0x22')](handleEntityNotFound(_0x520962,null))[_0xdfe1('0x22')](respondWithResult(_0x520962,null))[_0xdfe1('0x46')](handleError(_0x520962,null));};exports['update']=function(_0x5d1f5f,_0x4db394){if(_0x5d1f5f[_0xdfe1('0x47')]['id']){delete _0x5d1f5f[_0xdfe1('0x47')]['id'];}return db[_0xdfe1('0x29')][_0xdfe1('0x48')]({'where':{'id':_0x5d1f5f[_0xdfe1('0x42')]['id']}})[_0xdfe1('0x22')](handleEntityNotFound(_0x4db394,null))['then'](saveUpdates(_0x5d1f5f[_0xdfe1('0x47')],null))[_0xdfe1('0x22')](respondWithResult(_0x4db394,null))[_0xdfe1('0x46')](handleError(_0x4db394,null));};exports[_0xdfe1('0x24')]=function(_0x3cf9ca,_0x5e937a){return db['CannedAnswer'][_0xdfe1('0x48')]({'where':{'id':_0x3cf9ca[_0xdfe1('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e937a,null))[_0xdfe1('0x22')](removeEntity(_0x5e937a,null))[_0xdfe1('0x46')](handleError(_0x5e937a,null));};exports[_0xdfe1('0x49')]=function(_0x28a0e4,_0x2c7944){var _0x266e5b={'key':_0x28a0e4[_0xdfe1('0x47')]['key']};if(_0x28a0e4[_0xdfe1('0x47')]['MailAccountId']){_0x266e5b['MailAccountId']=_0x28a0e4[_0xdfe1('0x47')][_0xdfe1('0x4a')];}else if(_0x28a0e4[_0xdfe1('0x47')][_0xdfe1('0x4b')]){_0x266e5b[_0xdfe1('0x4b')]=_0x28a0e4[_0xdfe1('0x47')][_0xdfe1('0x4b')];}else if(_0x28a0e4[_0xdfe1('0x47')]['OpenchannelAccountId']){_0x266e5b[_0xdfe1('0x4c')]=_0x28a0e4['body'][_0xdfe1('0x4c')];}else if(_0x28a0e4['body']['ChatWebsiteId']){_0x266e5b[_0xdfe1('0x4d')]=_0x28a0e4[_0xdfe1('0x47')][_0xdfe1('0x4d')];}return db['CannedAnswer'][_0xdfe1('0x48')]({'where':_0x266e5b})[_0xdfe1('0x22')](function(_0x5d84cc){if(_0x5d84cc){throw new db[(_0xdfe1('0x4e'))][(_0xdfe1('0x4f'))](_0xdfe1('0x50'));}return db[_0xdfe1('0x29')][_0xdfe1('0x49')](_0x28a0e4[_0xdfe1('0x47')]);})[_0xdfe1('0x22')](function(_0x4fa324){var _0x36f86d=_0x28a0e4[_0xdfe1('0x51')][_0xdfe1('0x52')]({'plain':!![]});if(!_0x36f86d)throw new Error(_0xdfe1('0x53'));if(_0x36f86d[_0xdfe1('0x54')]===_0xdfe1('0x51')){var _0x1de33b=_0x4fa324[_0xdfe1('0x52')]({'plain':!![]});return db['UserProfileSection'][_0xdfe1('0x48')]({'where':{'name':_0xdfe1('0x23'),'userProfileId':_0x36f86d[_0xdfe1('0x55')]},'raw':!![]})[_0xdfe1('0x22')](function(_0x124967){if(_0x124967&&_0x124967['autoAssociation']===0x0){return db[_0xdfe1('0x56')][_0xdfe1('0x49')]({'name':_0x1de33b['name'],'resourceId':_0x1de33b['id'],'type':_0x124967[_0xdfe1('0x26')],'sectionId':_0x124967['id']},{})[_0xdfe1('0x22')](function(){return _0x4fa324;});}else{return _0x4fa324;}})[_0xdfe1('0x46')](function(_0x2a04e8){logger[_0xdfe1('0x25')](_0xdfe1('0x57'),_0x2a04e8);throw _0x2a04e8;});}return _0x4fa324;})[_0xdfe1('0x22')](respondWithResult(_0x2c7944,0xc9))[_0xdfe1('0x46')](handleError(_0x2c7944,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index f3841af..2af57f6 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 _0x7061=['bluebird','request-promise','path','tools_canned_answers','lodash','util','api'];(function(_0x50cb00,_0x1499ef){var _0xd62f39=function(_0x1669fc){while(--_0x1669fc){_0x50cb00['push'](_0x50cb00['shift']());}};_0xd62f39(++_0x1499ef);}(_0x7061,0xac));var _0x1706=function(_0x4f6f04,_0x461ec4){_0x4f6f04=_0x4f6f04-0x0;var _0x311a20=_0x7061[_0x4f6f04];return _0x311a20;};'use strict';var _=require(_0x1706('0x0'));var util=require(_0x1706('0x1'));var logger=require('../../config/logger')(_0x1706('0x2'));var moment=require('moment');var BPromise=require(_0x1706('0x3'));var rp=require(_0x1706('0x4'));var fs=require('fs');var path=require(_0x1706('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x5afb73,_0x5740a6){return _0x5afb73['define']('CannedAnswer',attributes,{'tableName':_0x1706('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x405f=['exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cannedAnswer.attributes'];(function(_0x458074,_0x56f600){var _0x3532d6=function(_0x54324b){while(--_0x54324b){_0x458074['push'](_0x458074['shift']());}};_0x3532d6(++_0x56f600);}(_0x405f,0x17e));var _0xf405=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x405f[_0x576170];return _0x397c70;};'use strict';var _=require('lodash');var util=require(_0xf405('0x0'));var logger=require(_0xf405('0x1'))(_0xf405('0x2'));var moment=require(_0xf405('0x3'));var BPromise=require(_0xf405('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf405('0x5'));var rimraf=require('rimraf');var config=require(_0xf405('0x6'));var attributes=require(_0xf405('0x7'));module[_0xf405('0x8')]=function(_0x223041,_0x12ccce){return _0x223041[_0xf405('0x9')](_0xf405('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf405('0xb'),'collate':_0xf405('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 426645a..6ad1eb4 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(_0x5e729d,_0x254376){var _0x4efc38=function(_0x3a5a49){while(--_0x3a5a49){_0x5e729d['push'](_0x5e729d['shift']());}};_0x4efc38(++_0x254376);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x3e086c,_0x41f9a0){var _0x259655=function(_0x26f5d6){while(--_0x26f5d6){_0x3e086c['push'](_0x3e086c['shift']());}};_0x259655(++_0x41f9a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index f7cc97b..032b9ca 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 _0xd286=['../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','/:id','post','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd286,0x181));var _0x6d28=function(_0x5ea3f6,_0x595373){_0x5ea3f6=_0x5ea3f6-0x0;var _0x3fc5a2=_0xd286[_0x5ea3f6];return _0x3fc5a2;};'use strict';var multer=require(_0x6d28('0x0'));var util=require(_0x6d28('0x1'));var path=require(_0x6d28('0x2'));var timeout=require(_0x6d28('0x3'));var express=require(_0x6d28('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d28('0x5'));var config=require('../../config/environment');var controller=require(_0x6d28('0x6'));router['get']('/',auth[_0x6d28('0x7')](),controller['index']);router['get'](_0x6d28('0x8'),auth[_0x6d28('0x7')](),controller['show']);router[_0x6d28('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x6d28('0x7')](),controller['update']);router[_0x6d28('0xa')](_0x6d28('0x8'),auth[_0x6d28('0x7')](),controller[_0x6d28('0xb')]);module[_0x6d28('0xc')]=router;
\ No newline at end of file
+var _0x59db=['../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x103dbc,_0x492787){var _0x2a2772=function(_0x56f1ce){while(--_0x56f1ce){_0x103dbc['push'](_0x103dbc['shift']());}};_0x2a2772(++_0x492787);}(_0x59db,0x109));var _0xb59d=function(_0x2757db,_0x464403){_0x2757db=_0x2757db-0x0;var _0x38e694=_0x59db[_0x2757db];return _0x38e694;};'use strict';var multer=require(_0xb59d('0x0'));var util=require(_0xb59d('0x1'));var path=require(_0xb59d('0x2'));var timeout=require('connect-timeout');var express=require(_0xb59d('0x3'));var router=express[_0xb59d('0x4')]();var fs_extra=require(_0xb59d('0x5'));var auth=require(_0xb59d('0x6'));var interaction=require(_0xb59d('0x7'));var config=require(_0xb59d('0x8'));var controller=require(_0xb59d('0x9'));router[_0xb59d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb59d('0xa')](_0xb59d('0xb'),auth[_0xb59d('0xc')](),controller[_0xb59d('0xd')]);router[_0xb59d('0xe')]('/',auth[_0xb59d('0xc')](),controller[_0xb59d('0xf')]);router[_0xb59d('0x10')](_0xb59d('0xb'),auth[_0xb59d('0xc')](),controller[_0xb59d('0x11')]);router[_0xb59d('0x12')](_0xb59d('0xb'),auth['isAuthenticated'](),controller[_0xb59d('0x13')]);module[_0xb59d('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 3b72dd6..e3aa3ef 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 _0xf296=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x4cbfbc,_0x3165d4){var _0x11b285=function(_0x4c5948){while(--_0x4c5948){_0x4cbfbc['push'](_0x4cbfbc['shift']());}};_0x11b285(++_0x3165d4);}(_0xf296,0x94));var _0x6f29=function(_0x614dc5,_0x3dd98e){_0x614dc5=_0x614dc5-0x0;var _0x571e07=_0xf296[_0x614dc5];return _0x571e07;};'use strict';var Sequelize=require(_0x6f29('0x0'));module[_0x6f29('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x6f29('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x6f29('0x3')]},'dcontext':{'type':Sequelize[_0x6f29('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6f29('0x3')]},'lastapp':{'type':Sequelize[_0x6f29('0x3')]},'lastdata':{'type':Sequelize[_0x6f29('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6f29('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6f29('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6f29('0x3')]},'userfield':{'type':Sequelize[_0x6f29('0x3')]},'uniqueid':{'type':Sequelize[_0x6f29('0x3')]},'linkedid':{'type':Sequelize[_0x6f29('0x3')]},'sequence':{'type':Sequelize[_0x6f29('0x3')]},'peeraccount':{'type':Sequelize[_0x6f29('0x3')]},'type':{'type':Sequelize[_0x6f29('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd691=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x3aeb36,_0x312dc9){var _0xa2ef21=function(_0x50a46b){while(--_0x50a46b){_0x3aeb36['push'](_0x3aeb36['shift']());}};_0xa2ef21(++_0x312dc9);}(_0xd691,0xe6));var _0x1d69=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0xd691[_0x537c37];return _0x241f84;};'use strict';var Sequelize=require(_0x1d69('0x0'));module[_0x1d69('0x1')]={'calldate':{'type':Sequelize[_0x1d69('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x1d69('0x3')]},'src':{'type':Sequelize[_0x1d69('0x3')]},'dst':{'type':Sequelize[_0x1d69('0x3')]},'dcontext':{'type':Sequelize[_0x1d69('0x3')]},'channel':{'type':Sequelize[_0x1d69('0x3')]},'dstchannel':{'type':Sequelize[_0x1d69('0x3')]},'lastapp':{'type':Sequelize[_0x1d69('0x3')]},'lastdata':{'type':Sequelize[_0x1d69('0x3')]},'duration':{'type':Sequelize[_0x1d69('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1d69('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1d69('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1d69('0x3')]},'linkedid':{'type':Sequelize[_0x1d69('0x3')]},'sequence':{'type':Sequelize[_0x1d69('0x3')]},'peeraccount':{'type':Sequelize[_0x1d69('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x1d69('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 3823693..00fe6cd 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 _0xa751=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch','show','params','keys','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x62c646,_0xa08641){var _0x2385f3=function(_0x45b92b){while(--_0x45b92b){_0x62c646['push'](_0x62c646['shift']());}};_0x2385f3(++_0xa08641);}(_0xa751,0x175));var _0x1a75=function(_0x5b10f5,_0x47493e){_0x5b10f5=_0x5b10f5-0x0;var _0x1b5d6a=_0xa751[_0x5b10f5];return _0x1b5d6a;};'use strict';var emlformat=require(_0x1a75('0x0'));var rimraf=require(_0x1a75('0x1'));var zipdir=require(_0x1a75('0x2'));var jsonpatch=require(_0x1a75('0x3'));var rp=require('request-promise');var moment=require(_0x1a75('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a75('0x5'));var util=require(_0x1a75('0x6'));var path=require(_0x1a75('0x7'));var sox=require('sox');var csv=require(_0x1a75('0x8'));var ejs=require(_0x1a75('0x9'));var fs=require('fs');var fs_extra=require(_0x1a75('0xa'));var _=require(_0x1a75('0xb'));var squel=require(_0x1a75('0xc'));var crypto=require(_0x1a75('0xd'));var jsforce=require(_0x1a75('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a75('0xf'));var Redis=require(_0x1a75('0x10'));var authService=require(_0x1a75('0x11'));var qs=require(_0x1a75('0x12'));var as=require(_0x1a75('0x13'));var hardwareService=require(_0x1a75('0x14'));var logger=require(_0x1a75('0x15'))(_0x1a75('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a75('0x17'))['db'];function respondWithStatusCode(_0x24e8dc,_0xae1af0){_0xae1af0=_0xae1af0||0xcc;return function(_0x1220e4){if(_0x1220e4){return _0x24e8dc['sendStatus'](_0xae1af0);}return _0x24e8dc['status'](_0xae1af0)[_0x1a75('0x18')]();};}function respondWithResult(_0xf4a616,_0x48577b){_0x48577b=_0x48577b||0xc8;return function(_0x1c84d3){if(_0x1c84d3){return _0xf4a616[_0x1a75('0x19')](_0x48577b)['json'](_0x1c84d3);}};}function respondWithFilteredResult(_0x1f3c38,_0xb4a245){return function(_0x15a1ec){if(_0x15a1ec){var _0x5883df=typeof _0xb4a245['offset']==='undefined'&&typeof _0xb4a245[_0x1a75('0x1a')]===_0x1a75('0x1b');var _0x2b6f3d=_0x15a1ec[_0x1a75('0x1c')];var _0x1b1af2=_0x5883df?0x0:_0xb4a245[_0x1a75('0x1d')];var _0x47f384=_0x5883df?_0x15a1ec[_0x1a75('0x1c')]:_0xb4a245['offset']+_0xb4a245['limit'];var _0x42df2c;if(_0x47f384>=_0x2b6f3d){_0x47f384=_0x2b6f3d;_0x42df2c=0xc8;}else{_0x42df2c=0xce;}_0x1f3c38[_0x1a75('0x19')](_0x42df2c);return _0x1f3c38['set'](_0x1a75('0x1e'),_0x1b1af2+'-'+_0x47f384+'/'+_0x2b6f3d)['json'](_0x15a1ec);}return null;};}function patchUpdates(_0x4699c9){return function(_0x3e3549){try{jsonpatch[_0x1a75('0x1f')](_0x3e3549,_0x4699c9,!![]);}catch(_0x340750){return BPromise[_0x1a75('0x20')](_0x340750);}return _0x3e3549[_0x1a75('0x21')]();};}function saveUpdates(_0x5a0ad7,_0x3ed5e9){return function(_0x4dc595){if(_0x4dc595){return _0x4dc595[_0x1a75('0x22')](_0x5a0ad7)[_0x1a75('0x23')](function(_0x320413){return _0x320413;});}return null;};}function removeEntity(_0x59e3da,_0x443ff8){return function(_0x5e6617){if(_0x5e6617){return _0x5e6617[_0x1a75('0x24')]()[_0x1a75('0x23')](function(){_0x59e3da[_0x1a75('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9fe9fe,_0x126f40){return function(_0x4dec82){if(!_0x4dec82){_0x9fe9fe[_0x1a75('0x25')](0x194);}return _0x4dec82;};}function handleError(_0x399dae,_0x5a6acc){_0x5a6acc=_0x5a6acc||0x1f4;return function(_0x168e06){logger[_0x1a75('0x26')](_0x168e06[_0x1a75('0x27')]);if(_0x168e06[_0x1a75('0x28')]){delete _0x168e06['name'];}_0x399dae[_0x1a75('0x19')](_0x5a6acc)[_0x1a75('0x29')](_0x168e06);};}exports[_0x1a75('0x2a')]=function(_0x2f5ac9,_0xf33870){var _0x9e66b9={},_0x3b6e1d={},_0x38e885={'count':0x0,'rows':[]};var _0x5518ed=_['map'](db[_0x1a75('0x2b')][_0x1a75('0x2c')],function(_0x1a0359){return{'name':_0x1a0359[_0x1a75('0x2d')],'type':_0x1a0359[_0x1a75('0x2e')][_0x1a75('0x2f')]};});_0x3b6e1d[_0x1a75('0x30')]=_[_0x1a75('0x31')](_0x5518ed,'name');_0x3b6e1d['query']=_['keys'](_0x2f5ac9[_0x1a75('0x32')]);_0x3b6e1d[_0x1a75('0x33')]=_[_0x1a75('0x34')](_0x3b6e1d[_0x1a75('0x30')],_0x3b6e1d['query']);_0x9e66b9['attributes']=_['intersection'](_0x3b6e1d[_0x1a75('0x30')],qs[_0x1a75('0x35')](_0x2f5ac9['query']['fields']));_0x9e66b9[_0x1a75('0x36')]=_0x9e66b9['attributes'][_0x1a75('0x37')]?_0x9e66b9[_0x1a75('0x36')]:_0x3b6e1d[_0x1a75('0x30')];if(!_0x2f5ac9['query']['hasOwnProperty'](_0x1a75('0x38'))){_0x9e66b9[_0x1a75('0x1a')]=qs[_0x1a75('0x1a')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x1a')]);_0x9e66b9[_0x1a75('0x1d')]=qs[_0x1a75('0x1d')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x1d')]);}_0x9e66b9[_0x1a75('0x39')]=qs[_0x1a75('0x3a')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x3a')]);_0x9e66b9[_0x1a75('0x3b')]=qs[_0x1a75('0x33')](_[_0x1a75('0x3c')](_0x2f5ac9['query'],_0x3b6e1d[_0x1a75('0x33')]),_0x5518ed);if(_0x2f5ac9['query']['filter']){_0x9e66b9[_0x1a75('0x3b')]=_[_0x1a75('0x3d')](_0x9e66b9[_0x1a75('0x3b')],{'$or':_[_0x1a75('0x31')](_0x5518ed,function(_0x2842d4){if(_0x2842d4['type']!==_0x1a75('0x3e')){var _0xc88c40={};_0xc88c40[_0x2842d4[_0x1a75('0x28')]]={'$like':'%'+_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x3f')]+'%'};return _0xc88c40;}})});}_0x9e66b9=_['merge']({},_0x9e66b9,_0x2f5ac9[_0x1a75('0x40')]);var _0x481bfe={'where':_0x9e66b9[_0x1a75('0x3b')]};return db[_0x1a75('0x2b')][_0x1a75('0x1c')](_0x481bfe)[_0x1a75('0x23')](function(_0x269ed6){_0x38e885[_0x1a75('0x1c')]=_0x269ed6;if(_0x2f5ac9[_0x1a75('0x32')]['includeAll']){_0x9e66b9['include']=[{'all':!![]}];}return db[_0x1a75('0x2b')]['findAll'](_0x9e66b9);})[_0x1a75('0x23')](function(_0x14abcf){_0x38e885[_0x1a75('0x41')]=_0x14abcf;return _0x38e885;})['then'](respondWithFilteredResult(_0xf33870,_0x9e66b9))[_0x1a75('0x42')](handleError(_0xf33870,null));};exports[_0x1a75('0x43')]=function(_0x21bfae,_0x5a2c51){var _0x292cbc={'raw':!![],'where':{'id':_0x21bfae[_0x1a75('0x44')]['id']}},_0x15fe49={};_0x15fe49[_0x1a75('0x30')]=_[_0x1a75('0x45')](db[_0x1a75('0x2b')][_0x1a75('0x2c')]);_0x15fe49['query']=_[_0x1a75('0x45')](_0x21bfae[_0x1a75('0x32')]);_0x15fe49[_0x1a75('0x33')]=_[_0x1a75('0x34')](_0x15fe49[_0x1a75('0x30')],_0x15fe49['query']);_0x292cbc[_0x1a75('0x36')]=_[_0x1a75('0x34')](_0x15fe49['model'],qs[_0x1a75('0x35')](_0x21bfae['query'][_0x1a75('0x35')]));_0x292cbc['attributes']=_0x292cbc[_0x1a75('0x36')][_0x1a75('0x37')]?_0x292cbc[_0x1a75('0x36')]:_0x15fe49[_0x1a75('0x30')];if(_0x21bfae[_0x1a75('0x32')][_0x1a75('0x46')]){_0x292cbc[_0x1a75('0x47')]=[{'all':!![]}];}_0x292cbc=_['merge']({},_0x292cbc,_0x21bfae[_0x1a75('0x40')]);return db['Cdr'][_0x1a75('0x48')](_0x292cbc)[_0x1a75('0x23')](handleEntityNotFound(_0x5a2c51,null))[_0x1a75('0x23')](respondWithResult(_0x5a2c51,null))[_0x1a75('0x42')](handleError(_0x5a2c51,null));};exports[_0x1a75('0x49')]=function(_0x1bf8a0,_0x2cfacf){return db[_0x1a75('0x2b')]['create'](_0x1bf8a0[_0x1a75('0x4a')],{})[_0x1a75('0x23')](respondWithResult(_0x2cfacf,0xc9))[_0x1a75('0x42')](handleError(_0x2cfacf,null));};exports[_0x1a75('0x22')]=function(_0x385382,_0x1b76d){if(_0x385382[_0x1a75('0x4a')]['id']){delete _0x385382[_0x1a75('0x4a')]['id'];}return db[_0x1a75('0x2b')][_0x1a75('0x48')]({'where':{'id':_0x385382[_0x1a75('0x44')]['id']}})[_0x1a75('0x23')](handleEntityNotFound(_0x1b76d,null))[_0x1a75('0x23')](saveUpdates(_0x385382[_0x1a75('0x4a')],null))[_0x1a75('0x23')](respondWithResult(_0x1b76d,null))['catch'](handleError(_0x1b76d,null));};exports[_0x1a75('0x24')]=function(_0xa20c25,_0x1ae0cb){return db[_0x1a75('0x2b')][_0x1a75('0x48')]({'where':{'id':_0xa20c25[_0x1a75('0x44')]['id']}})[_0x1a75('0x23')](handleEntityNotFound(_0x1ae0cb,null))[_0x1a75('0x23')](removeEntity(_0x1ae0cb,null))['catch'](handleError(_0x1ae0cb,null));};exports[_0x1a75('0x4b')]=function(_0x5f44e3,_0x40e643){return db[_0x1a75('0x2b')][_0x1a75('0x4b')]()['then'](respondWithResult(_0x40e643,null))['catch'](handleError(_0x40e643,null));};
\ No newline at end of file
+var _0x4ab0=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','Cdr','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x3f20e2,_0x451d47){var _0xe1d9a=function(_0x3d8b48){while(--_0x3d8b48){_0x3f20e2['push'](_0x3f20e2['shift']());}};_0xe1d9a(++_0x451d47);}(_0x4ab0,0xd5));var _0x04ab=function(_0x1e17b3,_0x2e12e4){_0x1e17b3=_0x1e17b3-0x0;var _0x509cd0=_0x4ab0[_0x1e17b3];return _0x509cd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ab('0x0'));var zipdir=require(_0x04ab('0x1'));var jsonpatch=require(_0x04ab('0x2'));var rp=require(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04ab('0x5'));var path=require(_0x04ab('0x6'));var sox=require('sox');var csv=require(_0x04ab('0x7'));var ejs=require(_0x04ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x7'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var licenseUtil=require(_0x04ab('0x16'));var db=require(_0x04ab('0x17'))['db'];function respondWithStatusCode(_0x386d0a,_0x4a6b39){_0x4a6b39=_0x4a6b39||0xcc;return function(_0x710503){if(_0x710503){return _0x386d0a['sendStatus'](_0x4a6b39);}return _0x386d0a[_0x04ab('0x18')](_0x4a6b39)[_0x04ab('0x19')]();};}function respondWithResult(_0x2abdf8,_0x428798){_0x428798=_0x428798||0xc8;return function(_0x4f0da1){if(_0x4f0da1){return _0x2abdf8['status'](_0x428798)['json'](_0x4f0da1);}};}function respondWithFilteredResult(_0x103ca8,_0x3cee44){return function(_0x149fd2){if(_0x149fd2){var _0x2b10b0=typeof _0x3cee44[_0x04ab('0x1a')]===_0x04ab('0x1b')&&typeof _0x3cee44[_0x04ab('0x1c')]===_0x04ab('0x1b');var _0x1f3251=_0x149fd2[_0x04ab('0x1d')];var _0x5ce43c=_0x2b10b0?0x0:_0x3cee44[_0x04ab('0x1a')];var _0x83ab27=_0x2b10b0?_0x149fd2[_0x04ab('0x1d')]:_0x3cee44[_0x04ab('0x1a')]+_0x3cee44[_0x04ab('0x1c')];var _0x10669a;if(_0x83ab27>=_0x1f3251){_0x83ab27=_0x1f3251;_0x10669a=0xc8;}else{_0x10669a=0xce;}_0x103ca8[_0x04ab('0x18')](_0x10669a);return _0x103ca8[_0x04ab('0x1e')](_0x04ab('0x1f'),_0x5ce43c+'-'+_0x83ab27+'/'+_0x1f3251)['json'](_0x149fd2);}return null;};}function patchUpdates(_0x75a04e){return function(_0x4a6679){try{jsonpatch[_0x04ab('0x20')](_0x4a6679,_0x75a04e,!![]);}catch(_0x1d04c2){return BPromise[_0x04ab('0x21')](_0x1d04c2);}return _0x4a6679['save']();};}function saveUpdates(_0x15a36b,_0x1c08f4){return function(_0xf6275e){if(_0xf6275e){return _0xf6275e['update'](_0x15a36b)['then'](function(_0xc8358e){return _0xc8358e;});}return null;};}function removeEntity(_0x2f614a,_0x5885bd){return function(_0x551583){if(_0x551583){return _0x551583[_0x04ab('0x22')]()[_0x04ab('0x23')](function(){_0x2f614a[_0x04ab('0x18')](0xcc)[_0x04ab('0x19')]();});}};}function handleEntityNotFound(_0x26bb81,_0xa3838a){return function(_0x21d9b7){if(!_0x21d9b7){_0x26bb81[_0x04ab('0x24')](0x194);}return _0x21d9b7;};}function handleError(_0x222557,_0x5cf1e5){_0x5cf1e5=_0x5cf1e5||0x1f4;return function(_0x86bf80){logger[_0x04ab('0x25')](_0x86bf80[_0x04ab('0x26')]);if(_0x86bf80[_0x04ab('0x27')]){delete _0x86bf80['name'];}_0x222557['status'](_0x5cf1e5)[_0x04ab('0x28')](_0x86bf80);};}exports['index']=function(_0x404eae,_0x30db64){var _0x2e069d={},_0x3c25fb={},_0x12385b={'count':0x0,'rows':[]};var _0x5596fc=_['map'](db[_0x04ab('0x29')][_0x04ab('0x2a')],function(_0x28e77b){return{'name':_0x28e77b[_0x04ab('0x2b')],'type':_0x28e77b[_0x04ab('0x2c')][_0x04ab('0x2d')]};});_0x3c25fb[_0x04ab('0x2e')]=_[_0x04ab('0x2f')](_0x5596fc,_0x04ab('0x27'));_0x3c25fb[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x404eae[_0x04ab('0x30')]);_0x3c25fb[_0x04ab('0x32')]=_['intersection'](_0x3c25fb[_0x04ab('0x2e')],_0x3c25fb[_0x04ab('0x30')]);_0x2e069d['attributes']=_[_0x04ab('0x33')](_0x3c25fb[_0x04ab('0x2e')],qs['fields'](_0x404eae[_0x04ab('0x30')][_0x04ab('0x34')]));_0x2e069d['attributes']=_0x2e069d[_0x04ab('0x35')][_0x04ab('0x36')]?_0x2e069d[_0x04ab('0x35')]:_0x3c25fb[_0x04ab('0x2e')];if(!_0x404eae[_0x04ab('0x30')][_0x04ab('0x37')]('nolimit')){_0x2e069d[_0x04ab('0x1c')]=qs[_0x04ab('0x1c')](_0x404eae[_0x04ab('0x30')]['limit']);_0x2e069d[_0x04ab('0x1a')]=qs['offset'](_0x404eae['query'][_0x04ab('0x1a')]);}_0x2e069d[_0x04ab('0x38')]=qs['sort'](_0x404eae[_0x04ab('0x30')]['sort']);_0x2e069d[_0x04ab('0x39')]=qs[_0x04ab('0x32')](_[_0x04ab('0x3a')](_0x404eae[_0x04ab('0x30')],_0x3c25fb[_0x04ab('0x32')]),_0x5596fc);if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3b')]){_0x2e069d[_0x04ab('0x39')]=_[_0x04ab('0x3c')](_0x2e069d[_0x04ab('0x39')],{'$or':_[_0x04ab('0x2f')](_0x5596fc,function(_0x3f145){if(_0x3f145['type']!==_0x04ab('0x3d')){var _0x14756a={};_0x14756a[_0x3f145['name']]={'$like':'%'+_0x404eae['query'][_0x04ab('0x3b')]+'%'};return _0x14756a;}})});}_0x2e069d=_[_0x04ab('0x3c')]({},_0x2e069d,_0x404eae[_0x04ab('0x3e')]);var _0x4327b9={'where':_0x2e069d['where']};return db[_0x04ab('0x29')][_0x04ab('0x1d')](_0x4327b9)[_0x04ab('0x23')](function(_0x244acf){_0x12385b['count']=_0x244acf;if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x2e069d[_0x04ab('0x40')]=[{'all':!![]}];}return db[_0x04ab('0x29')][_0x04ab('0x41')](_0x2e069d);})[_0x04ab('0x23')](function(_0x20b8cc){_0x12385b[_0x04ab('0x42')]=_0x20b8cc;return _0x12385b;})['then'](respondWithFilteredResult(_0x30db64,_0x2e069d))['catch'](handleError(_0x30db64,null));};exports[_0x04ab('0x43')]=function(_0x4c8cb0,_0x8a93c2){var _0x46a7c5={'raw':!![],'where':{'id':_0x4c8cb0['params']['id']}},_0x3c27ee={};_0x3c27ee[_0x04ab('0x2e')]=_[_0x04ab('0x31')](db[_0x04ab('0x29')]['rawAttributes']);_0x3c27ee[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x4c8cb0[_0x04ab('0x30')]);_0x3c27ee[_0x04ab('0x32')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],_0x3c27ee[_0x04ab('0x30')]);_0x46a7c5[_0x04ab('0x35')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],qs['fields'](_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x34')]));_0x46a7c5[_0x04ab('0x35')]=_0x46a7c5[_0x04ab('0x35')][_0x04ab('0x36')]?_0x46a7c5[_0x04ab('0x35')]:_0x3c27ee['model'];if(_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x46a7c5[_0x04ab('0x40')]=[{'all':!![]}];}_0x46a7c5=_[_0x04ab('0x3c')]({},_0x46a7c5,_0x4c8cb0['options']);return db[_0x04ab('0x29')][_0x04ab('0x44')](_0x46a7c5)[_0x04ab('0x23')](handleEntityNotFound(_0x8a93c2,null))[_0x04ab('0x23')](respondWithResult(_0x8a93c2,null))[_0x04ab('0x45')](handleError(_0x8a93c2,null));};exports['create']=function(_0x326621,_0x15b995){return db['Cdr']['create'](_0x326621[_0x04ab('0x46')],{})[_0x04ab('0x23')](respondWithResult(_0x15b995,0xc9))[_0x04ab('0x45')](handleError(_0x15b995,null));};exports[_0x04ab('0x47')]=function(_0x1c4aa2,_0x3a9056){if(_0x1c4aa2[_0x04ab('0x46')]['id']){delete _0x1c4aa2['body']['id'];}return db[_0x04ab('0x29')][_0x04ab('0x44')]({'where':{'id':_0x1c4aa2[_0x04ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a9056,null))[_0x04ab('0x23')](saveUpdates(_0x1c4aa2[_0x04ab('0x46')],null))['then'](respondWithResult(_0x3a9056,null))[_0x04ab('0x45')](handleError(_0x3a9056,null));};exports['destroy']=function(_0xc9db25,_0x4bc4f6){return db[_0x04ab('0x29')]['find']({'where':{'id':_0xc9db25['params']['id']}})[_0x04ab('0x23')](handleEntityNotFound(_0x4bc4f6,null))[_0x04ab('0x23')](removeEntity(_0x4bc4f6,null))[_0x04ab('0x45')](handleError(_0x4bc4f6,null));};exports['describe']=function(_0x53f63a,_0x5ed30e){return db[_0x04ab('0x29')][_0x04ab('0x49')]()['then'](respondWithResult(_0x5ed30e,null))[_0x04ab('0x45')](handleError(_0x5ed30e,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index bca49f9..4df1791 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3d2532,_0x2936dc){var _0x1405ce=function(_0x3201d9){while(--_0x3201d9){_0x3d2532['push'](_0x3d2532['shift']());}};_0x1405ce(++_0x2936dc);}(_0x7a54,0x106));var _0x47a5=function(_0xa99e80,_0x1aea8f){_0xa99e80=_0xa99e80-0x0;var _0x5225d6=_0x7a54[_0xa99e80];return _0x5225d6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4d82b3,_0xfe6f5f){var _0x23ea02=function(_0x462b20){while(--_0x462b20){_0x4d82b3['push'](_0x4d82b3['shift']());}};_0x23ea02(++_0xfe6f5f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 29fa434..30068d7 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 _0x2d9c=['http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','Cdr,\x20%s,\x20%s','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client'];(function(_0x46ae81,_0x16cd38){var _0x5013ca=function(_0x2ad2d2){while(--_0x2ad2d2){_0x46ae81['push'](_0x46ae81['shift']());}};_0x5013ca(++_0x16cd38);}(_0x2d9c,0x185));var _0xc2d9=function(_0x13398d,_0x1a918a){_0x13398d=_0x13398d-0x0;var _0x306118=_0x2d9c[_0x13398d];return _0x306118;};'use strict';var _=require('lodash');var util=require(_0xc2d9('0x0'));var moment=require('moment');var BPromise=require(_0xc2d9('0x1'));var rs=require(_0xc2d9('0x2'));var fs=require('fs');var Redis=require(_0xc2d9('0x3'));var db=require(_0xc2d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc2d9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc2d9('0x6')][_0xc2d9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e7512,_0x41e810,_0x510655){return new BPromise(function(_0x9063eb,_0x58ea19){return client[_0xc2d9('0x8')](_0x2e7512,_0x510655)[_0xc2d9('0x9')](function(_0x55750e){logger[_0xc2d9('0xa')]('Cdr,\x20%s,\x20%s',_0x41e810,_0xc2d9('0xb'));logger['debug'](_0xc2d9('0xc'),_0x41e810,_0xc2d9('0xb'),JSON[_0xc2d9('0xd')](_0x55750e));if(_0x55750e[_0xc2d9('0xe')]){if(_0x55750e[_0xc2d9('0xe')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x41e810,_0x55750e[_0xc2d9('0xe')]['message']);return _0x58ea19(_0x55750e[_0xc2d9('0xe')][_0xc2d9('0xf')]);}logger[_0xc2d9('0xe')](_0xc2d9('0x10'),_0x41e810,_0x55750e[_0xc2d9('0xe')][_0xc2d9('0xf')]);return _0x9063eb(_0x55750e[_0xc2d9('0xe')][_0xc2d9('0xf')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x41e810,'request\x20sent');_0x9063eb(_0x55750e['result'][_0xc2d9('0xf')]);}})[_0xc2d9('0x11')](function(_0x1f728a){logger['error'](_0xc2d9('0x10'),_0x41e810,_0x1f728a);_0x58ea19(_0x1f728a);});});}
\ No newline at end of file
+var _0x4e6d=['error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3457cd,_0xd5c5c6){var _0x52f8ca=function(_0x474d86){while(--_0x474d86){_0x3457cd['push'](_0x3457cd['shift']());}};_0x52f8ca(++_0xd5c5c6);}(_0x4e6d,0x90));var _0xd4e6=function(_0x3a7e42,_0x58e47d){_0x3a7e42=_0x3a7e42-0x0;var _0x7122b7=_0x4e6d[_0x3a7e42];return _0x7122b7;};'use strict';var _=require(_0xd4e6('0x0'));var util=require('util');var moment=require(_0xd4e6('0x1'));var BPromise=require(_0xd4e6('0x2'));var rs=require(_0xd4e6('0x3'));var fs=require('fs');var Redis=require(_0xd4e6('0x4'));var db=require(_0xd4e6('0x5'))['db'];var utils=require(_0xd4e6('0x6'));var logger=require(_0xd4e6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd4e6('0x8')][_0xd4e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f5321,_0x2dec7c,_0x1429f8){return new BPromise(function(_0x2f57b3,_0x46c200){return client['request'](_0x5f5321,_0x1429f8)[_0xd4e6('0xa')](function(_0x47144d){logger[_0xd4e6('0xb')](_0xd4e6('0xc'),_0x2dec7c,_0xd4e6('0xd'));logger['debug'](_0xd4e6('0xe'),_0x2dec7c,_0xd4e6('0xd'),JSON[_0xd4e6('0xf')](_0x47144d));if(_0x47144d[_0xd4e6('0x10')]){if(_0x47144d[_0xd4e6('0x10')][_0xd4e6('0x11')]===0x1f4){logger[_0xd4e6('0x10')](_0xd4e6('0xc'),_0x2dec7c,_0x47144d[_0xd4e6('0x10')][_0xd4e6('0x12')]);return _0x46c200(_0x47144d[_0xd4e6('0x10')][_0xd4e6('0x12')]);}logger[_0xd4e6('0x10')]('Cdr,\x20%s,\x20%s',_0x2dec7c,_0x47144d[_0xd4e6('0x10')][_0xd4e6('0x12')]);return _0x2f57b3(_0x47144d[_0xd4e6('0x10')][_0xd4e6('0x12')]);}else{logger[_0xd4e6('0xb')](_0xd4e6('0xc'),_0x2dec7c,'request\x20sent');_0x2f57b3(_0x47144d['result'][_0xd4e6('0x12')]);}})[_0xd4e6('0x13')](function(_0x495f8d){logger['error'](_0xd4e6('0xc'),_0x2dec7c,_0x495f8d);_0x46c200(_0x495f8d);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index f0d60a7..abee037 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(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x33677a,_0x2db401){var _0x5ce448=function(_0x464efe){while(--_0x464efe){_0x33677a['push'](_0x33677a['shift']());}};_0x5ce448(++_0x2db401);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e712f,_0x60d75f){_0x2e712f=_0x2e712f-0x0;var _0x2fb152=_0xb10b[_0x2e712f];return _0x2fb152;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 6bc1653..af0c9fb 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 _0xa036=['*,*,*,*','exports','INTEGER','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa036,0x101));var _0x6a03=function(_0x305d3f,_0x5b9f83){_0x305d3f=_0x305d3f-0x0;var _0x438449=_0xa036[_0x305d3f];return _0x438449;};'use strict';var Sequelize=require('sequelize');module[_0x6a03('0x0')]={'priority':{'type':Sequelize[_0x6a03('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6a03('0x2')]},'interval':{'type':Sequelize[_0x6a03('0x2')],'defaultValue':_0x6a03('0x3')}};
\ No newline at end of file
+var _0x03fc=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x5e2320,_0x245774){var _0x254ea9=function(_0x3ab1ae){while(--_0x3ab1ae){_0x5e2320['push'](_0x5e2320['shift']());}};_0x254ea9(++_0x245774);}(_0x03fc,0x92));var _0xc03f=function(_0x7222a7,_0x1e6b39){_0x7222a7=_0x7222a7-0x0;var _0x51f226=_0x03fc[_0x7222a7];return _0x51f226;};'use strict';var Sequelize=require(_0xc03f('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc03f('0x1')],'allowNull':![],'defaultValue':_0xc03f('0x2')},'appdata':{'type':Sequelize[_0xc03f('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc03f('0x1')],'defaultValue':_0xc03f('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 91b2b96..6a486b4 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 _0x18e0=['moment','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','include','merge','options','find','catch','body','rimraf','fast-json-patch','request-promise'];(function(_0x4c1303,_0x4efd70){var _0x2b6af4=function(_0x52ab13){while(--_0x52ab13){_0x4c1303['push'](_0x4c1303['shift']());}};_0x2b6af4(++_0x4efd70);}(_0x18e0,0xa2));var _0x018e=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x18e0[_0x2080a3];return _0x8d7d17;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x018e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x018e('0x1'));var rp=require(_0x018e('0x2'));var moment=require(_0x018e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x018e('0x4'));var util=require('util');var path=require('path');var sox=require(_0x018e('0x5'));var csv=require(_0x018e('0x6'));var ejs=require(_0x018e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x018e('0x8'));var crypto=require(_0x018e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x018e('0xa'));var toCsv=require(_0x018e('0x6'));var querystring=require(_0x018e('0xb'));var Papa=require(_0x018e('0xc'));var Redis=require(_0x018e('0xd'));var authService=require(_0x018e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x018e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x018e('0x10'));var config=require(_0x018e('0x11'));var licenseUtil=require(_0x018e('0x12'));var db=require(_0x018e('0x13'))['db'];function respondWithStatusCode(_0x167572,_0xd16776){_0xd16776=_0xd16776||0xcc;return function(_0xc940bb){if(_0xc940bb){return _0x167572[_0x018e('0x14')](_0xd16776);}return _0x167572[_0x018e('0x15')](_0xd16776)['end']();};}function respondWithResult(_0xec531a,_0x3b1e5e){_0x3b1e5e=_0x3b1e5e||0xc8;return function(_0x2d6aa0){if(_0x2d6aa0){return _0xec531a[_0x018e('0x15')](_0x3b1e5e)[_0x018e('0x16')](_0x2d6aa0);}};}function respondWithFilteredResult(_0x5bfd6e,_0x275c21){return function(_0x142f1e){if(_0x142f1e){var _0x41cbd8=typeof _0x275c21[_0x018e('0x17')]==='undefined'&&typeof _0x275c21[_0x018e('0x18')]===_0x018e('0x19');var _0x4d46aa=_0x142f1e[_0x018e('0x1a')];var _0x237ba1=_0x41cbd8?0x0:_0x275c21[_0x018e('0x17')];var _0xdf15f8=_0x41cbd8?_0x142f1e[_0x018e('0x1a')]:_0x275c21['offset']+_0x275c21[_0x018e('0x18')];var _0x421942;if(_0xdf15f8>=_0x4d46aa){_0xdf15f8=_0x4d46aa;_0x421942=0xc8;}else{_0x421942=0xce;}_0x5bfd6e[_0x018e('0x15')](_0x421942);return _0x5bfd6e[_0x018e('0x1b')](_0x018e('0x1c'),_0x237ba1+'-'+_0xdf15f8+'/'+_0x4d46aa)[_0x018e('0x16')](_0x142f1e);}return null;};}function patchUpdates(_0x15c3fa){return function(_0x4f59e7){try{jsonpatch[_0x018e('0x1d')](_0x4f59e7,_0x15c3fa,!![]);}catch(_0x213989){return BPromise[_0x018e('0x1e')](_0x213989);}return _0x4f59e7[_0x018e('0x1f')]();};}function saveUpdates(_0x23ef86,_0x5d9fef){return function(_0x5cffe9){if(_0x5cffe9){return _0x5cffe9[_0x018e('0x20')](_0x23ef86)[_0x018e('0x21')](function(_0x2c813e){return _0x2c813e;});}return null;};}function removeEntity(_0x1e3106,_0x2ef801){return function(_0x198b0b){if(_0x198b0b){return _0x198b0b[_0x018e('0x22')]()[_0x018e('0x21')](function(){_0x1e3106[_0x018e('0x15')](0xcc)[_0x018e('0x23')]();});}};}function handleEntityNotFound(_0x35f9a3,_0x7596f4){return function(_0x4e7d9a){if(!_0x4e7d9a){_0x35f9a3[_0x018e('0x14')](0x194);}return _0x4e7d9a;};}function handleError(_0x289931,_0x176822){_0x176822=_0x176822||0x1f4;return function(_0x344e2b){logger[_0x018e('0x24')](_0x344e2b[_0x018e('0x25')]);if(_0x344e2b[_0x018e('0x26')]){delete _0x344e2b[_0x018e('0x26')];}_0x289931[_0x018e('0x15')](_0x176822)[_0x018e('0x27')](_0x344e2b);};}exports['show']=function(_0x29455a,_0x1a4726){var _0x4af339={'raw':!![],'where':{'id':_0x29455a[_0x018e('0x28')]['id']}},_0xac43bc={};_0xac43bc[_0x018e('0x29')]=_[_0x018e('0x2a')](db[_0x018e('0x2b')][_0x018e('0x2c')]);_0xac43bc['query']=_[_0x018e('0x2a')](_0x29455a[_0x018e('0x2d')]);_0xac43bc['filters']=_[_0x018e('0x2e')](_0xac43bc[_0x018e('0x29')],_0xac43bc[_0x018e('0x2d')]);_0x4af339[_0x018e('0x2f')]=_[_0x018e('0x2e')](_0xac43bc['model'],qs[_0x018e('0x30')](_0x29455a[_0x018e('0x2d')][_0x018e('0x30')]));_0x4af339['attributes']=_0x4af339[_0x018e('0x2f')]['length']?_0x4af339[_0x018e('0x2f')]:_0xac43bc[_0x018e('0x29')];if(_0x29455a['query']['includeAll']){_0x4af339[_0x018e('0x31')]=[{'all':!![]}];}_0x4af339=_[_0x018e('0x32')]({},_0x4af339,_0x29455a[_0x018e('0x33')]);return db[_0x018e('0x2b')][_0x018e('0x34')](_0x4af339)['then'](handleEntityNotFound(_0x1a4726,null))[_0x018e('0x21')](respondWithResult(_0x1a4726,null))[_0x018e('0x35')](handleError(_0x1a4726,null));};exports[_0x018e('0x20')]=function(_0x55dbda,_0x5a2741){if(_0x55dbda[_0x018e('0x36')]['id']){delete _0x55dbda[_0x018e('0x36')]['id'];}return db[_0x018e('0x2b')][_0x018e('0x34')]({'where':{'id':_0x55dbda[_0x018e('0x28')]['id']}})[_0x018e('0x21')](handleEntityNotFound(_0x5a2741,null))['then'](saveUpdates(_0x55dbda[_0x018e('0x36')],null))[_0x018e('0x21')](respondWithResult(_0x5a2741,null))['catch'](handleError(_0x5a2741,null));};exports['destroy']=function(_0x5c34c9,_0x3b6e6a){return db[_0x018e('0x2b')][_0x018e('0x34')]({'where':{'id':_0x5c34c9[_0x018e('0x28')]['id']}})[_0x018e('0x21')](handleEntityNotFound(_0x3b6e6a,null))['then'](removeEntity(_0x3b6e6a,null))[_0x018e('0x35')](handleError(_0x3b6e6a,null));};
\ No newline at end of file
+var _0x3a79=['../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','error','stack','name','show','model','keys','ChatApplication','query','filters','intersection','fields','attributes','includeAll','include','options','catch','body','find','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x1b964a,_0x40fdc2){var _0x2559fa=function(_0x1afe3e){while(--_0x1afe3e){_0x1b964a['push'](_0x1b964a['shift']());}};_0x2559fa(++_0x40fdc2);}(_0x3a79,0xca));var _0x93a7=function(_0x2787a4,_0x2147a1){_0x2787a4=_0x2787a4-0x0;var _0x472e77=_0x3a79[_0x2787a4];return _0x472e77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93a7('0x0'));var zipdir=require(_0x93a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x93a7('0x2'));var moment=require(_0x93a7('0x3'));var BPromise=require(_0x93a7('0x4'));var Mustache=require(_0x93a7('0x5'));var util=require(_0x93a7('0x6'));var path=require(_0x93a7('0x7'));var sox=require(_0x93a7('0x8'));var csv=require('to-csv');var ejs=require(_0x93a7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93a7('0xa'));var squel=require(_0x93a7('0xb'));var crypto=require(_0x93a7('0xc'));var jsforce=require(_0x93a7('0xd'));var deskjs=require(_0x93a7('0xe'));var toCsv=require(_0x93a7('0xf'));var querystring=require('querystring');var Papa=require(_0x93a7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93a7('0x11'));var as=require(_0x93a7('0x12'));var hardwareService=require(_0x93a7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x93a7('0x14'));var config=require(_0x93a7('0x15'));var licenseUtil=require(_0x93a7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57ff4d,_0x1c9461){_0x1c9461=_0x1c9461||0xcc;return function(_0x5289f7){if(_0x5289f7){return _0x57ff4d[_0x93a7('0x17')](_0x1c9461);}return _0x57ff4d[_0x93a7('0x18')](_0x1c9461)[_0x93a7('0x19')]();};}function respondWithResult(_0xa0234a,_0x23380e){_0x23380e=_0x23380e||0xc8;return function(_0x423458){if(_0x423458){return _0xa0234a[_0x93a7('0x18')](_0x23380e)['json'](_0x423458);}};}function respondWithFilteredResult(_0x46967b,_0x27ae27){return function(_0x4aa44e){if(_0x4aa44e){var _0x517a72=typeof _0x27ae27[_0x93a7('0x1a')]==='undefined'&&typeof _0x27ae27[_0x93a7('0x1b')]===_0x93a7('0x1c');var _0x8c8f3b=_0x4aa44e[_0x93a7('0x1d')];var _0x3d1db3=_0x517a72?0x0:_0x27ae27['offset'];var _0xfe6814=_0x517a72?_0x4aa44e['count']:_0x27ae27[_0x93a7('0x1a')]+_0x27ae27[_0x93a7('0x1b')];var _0x1870cb;if(_0xfe6814>=_0x8c8f3b){_0xfe6814=_0x8c8f3b;_0x1870cb=0xc8;}else{_0x1870cb=0xce;}_0x46967b[_0x93a7('0x18')](_0x1870cb);return _0x46967b[_0x93a7('0x1e')]('Content-Range',_0x3d1db3+'-'+_0xfe6814+'/'+_0x8c8f3b)[_0x93a7('0x1f')](_0x4aa44e);}return null;};}function patchUpdates(_0x321c32){return function(_0xdebaba){try{jsonpatch[_0x93a7('0x20')](_0xdebaba,_0x321c32,!![]);}catch(_0x3d0e5a){return BPromise[_0x93a7('0x21')](_0x3d0e5a);}return _0xdebaba[_0x93a7('0x22')]();};}function saveUpdates(_0x446b7a,_0x50ea8d){return function(_0x29cd68){if(_0x29cd68){return _0x29cd68[_0x93a7('0x23')](_0x446b7a)['then'](function(_0x323cb2){return _0x323cb2;});}return null;};}function removeEntity(_0x198b82,_0x24fa68){return function(_0x461632){if(_0x461632){return _0x461632['destroy']()[_0x93a7('0x24')](function(){_0x198b82[_0x93a7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xafae92,_0x1b64ec){return function(_0x5a14f2){if(!_0x5a14f2){_0xafae92[_0x93a7('0x17')](0x194);}return _0x5a14f2;};}function handleError(_0x4e72b4,_0x2c4ed7){_0x2c4ed7=_0x2c4ed7||0x1f4;return function(_0x14f413){logger[_0x93a7('0x25')](_0x14f413[_0x93a7('0x26')]);if(_0x14f413['name']){delete _0x14f413[_0x93a7('0x27')];}_0x4e72b4['status'](_0x2c4ed7)['send'](_0x14f413);};}exports[_0x93a7('0x28')]=function(_0x44c6da,_0x15e30f){var _0x3f5448={'raw':!![],'where':{'id':_0x44c6da['params']['id']}},_0x1fad6e={};_0x1fad6e[_0x93a7('0x29')]=_[_0x93a7('0x2a')](db[_0x93a7('0x2b')]['rawAttributes']);_0x1fad6e['query']=_['keys'](_0x44c6da[_0x93a7('0x2c')]);_0x1fad6e[_0x93a7('0x2d')]=_[_0x93a7('0x2e')](_0x1fad6e['model'],_0x1fad6e[_0x93a7('0x2c')]);_0x3f5448['attributes']=_['intersection'](_0x1fad6e['model'],qs[_0x93a7('0x2f')](_0x44c6da['query'][_0x93a7('0x2f')]));_0x3f5448[_0x93a7('0x30')]=_0x3f5448['attributes']['length']?_0x3f5448['attributes']:_0x1fad6e[_0x93a7('0x29')];if(_0x44c6da[_0x93a7('0x2c')][_0x93a7('0x31')]){_0x3f5448[_0x93a7('0x32')]=[{'all':!![]}];}_0x3f5448=_['merge']({},_0x3f5448,_0x44c6da[_0x93a7('0x33')]);return db[_0x93a7('0x2b')]['find'](_0x3f5448)['then'](handleEntityNotFound(_0x15e30f,null))[_0x93a7('0x24')](respondWithResult(_0x15e30f,null))[_0x93a7('0x34')](handleError(_0x15e30f,null));};exports[_0x93a7('0x23')]=function(_0x2d4723,_0xa3bb5f){if(_0x2d4723[_0x93a7('0x35')]['id']){delete _0x2d4723[_0x93a7('0x35')]['id'];}return db['ChatApplication'][_0x93a7('0x36')]({'where':{'id':_0x2d4723[_0x93a7('0x37')]['id']}})[_0x93a7('0x24')](handleEntityNotFound(_0xa3bb5f,null))[_0x93a7('0x24')](saveUpdates(_0x2d4723[_0x93a7('0x35')],null))[_0x93a7('0x24')](respondWithResult(_0xa3bb5f,null))[_0x93a7('0x34')](handleError(_0xa3bb5f,null));};exports['destroy']=function(_0x53c540,_0x7e980d){return db[_0x93a7('0x2b')][_0x93a7('0x36')]({'where':{'id':_0x53c540[_0x93a7('0x37')]['id']}})[_0x93a7('0x24')](handleEntityNotFound(_0x7e980d,null))['then'](removeEntity(_0x7e980d,null))[_0x93a7('0x34')](handleError(_0x7e980d,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 071b405..73b9ac3 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 _0xc792=['exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes'];(function(_0x550f8a,_0x1c97d5){var _0x20a27b=function(_0x5ce662){while(--_0x5ce662){_0x550f8a['push'](_0x550f8a['shift']());}};_0x20a27b(++_0x1c97d5);}(_0xc792,0x1e5));var _0x2c79=function(_0x1ee4d6,_0x26a81d){_0x1ee4d6=_0x1ee4d6-0x0;var _0x2cb60e=_0xc792[_0x1ee4d6];return _0x2cb60e;};'use strict';var _=require(_0x2c79('0x0'));var util=require(_0x2c79('0x1'));var logger=require(_0x2c79('0x2'))(_0x2c79('0x3'));var moment=require(_0x2c79('0x4'));var BPromise=require(_0x2c79('0x5'));var rp=require(_0x2c79('0x6'));var fs=require('fs');var path=require(_0x2c79('0x7'));var rimraf=require(_0x2c79('0x8'));var config=require('../../config/environment');var attributes=require(_0x2c79('0x9'));module[_0x2c79('0xa')]=function(_0x4d031c,_0x490807){return _0x4d031c[_0x2c79('0xb')](_0x2c79('0xc'),attributes,{'tableName':_0x2c79('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2c79('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xdb1a=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4'];(function(_0x8b86af,_0x4625f0){var _0x30a906=function(_0x387e1a){while(--_0x387e1a){_0x8b86af['push'](_0x8b86af['shift']());}};_0x30a906(++_0x4625f0);}(_0xdb1a,0x1bc));var _0xadb1=function(_0x35a90c,_0x3c80d8){_0x35a90c=_0x35a90c-0x0;var _0xecd5e8=_0xdb1a[_0x35a90c];return _0xecd5e8;};'use strict';var _=require('lodash');var util=require(_0xadb1('0x0'));var logger=require(_0xadb1('0x1'))(_0xadb1('0x2'));var moment=require('moment');var BPromise=require(_0xadb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadb1('0x4'));var rimraf=require(_0xadb1('0x5'));var config=require(_0xadb1('0x6'));var attributes=require(_0xadb1('0x7'));module[_0xadb1('0x8')]=function(_0x23c197,_0x3e05da){return _0x23c197[_0xadb1('0x9')]('ChatApplication',attributes,{'tableName':_0xadb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xadb1('0xb'),'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 2e8362a..bded83a 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 _0x00f8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4b32d5,_0x54b694){var _0x230836=function(_0x3e313d){while(--_0x3e313d){_0x4b32d5['push'](_0x4b32d5['shift']());}};_0x230836(++_0x54b694);}(_0x00f8,0x1b9));var _0x800f=function(_0x14562a,_0x4d3bed){_0x14562a=_0x14562a-0x0;var _0x1d1f9a=_0x00f8[_0x14562a];return _0x1d1f9a;};'use strict';var _=require('lodash');var util=require(_0x800f('0x0'));var moment=require(_0x800f('0x1'));var BPromise=require(_0x800f('0x2'));var rs=require(_0x800f('0x3'));var fs=require('fs');var Redis=require(_0x800f('0x4'));var db=require(_0x800f('0x5'))['db'];var utils=require(_0x800f('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x800f('0x7'));var client=jayson[_0x800f('0x8')][_0x800f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24fd2d,_0x2bb7af,_0x4d20fd){return new BPromise(function(_0xb6f69f,_0x1e3acc){return client[_0x800f('0xa')](_0x24fd2d,_0x4d20fd)[_0x800f('0xb')](function(_0x430d1e){logger['info'](_0x800f('0xc'),_0x2bb7af,_0x800f('0xd'));logger['debug'](_0x800f('0xe'),_0x2bb7af,_0x800f('0xd'),JSON[_0x800f('0xf')](_0x430d1e));if(_0x430d1e['error']){if(_0x430d1e[_0x800f('0x10')][_0x800f('0x11')]===0x1f4){logger[_0x800f('0x10')](_0x800f('0xc'),_0x2bb7af,_0x430d1e[_0x800f('0x10')][_0x800f('0x12')]);return _0x1e3acc(_0x430d1e[_0x800f('0x10')][_0x800f('0x12')]);}logger['error'](_0x800f('0xc'),_0x2bb7af,_0x430d1e[_0x800f('0x10')]['message']);return _0xb6f69f(_0x430d1e[_0x800f('0x10')]['message']);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x2bb7af,'request\x20sent');_0xb6f69f(_0x430d1e[_0x800f('0x13')][_0x800f('0x12')]);}})[_0x800f('0x14')](function(_0x15a7d1){logger['error'](_0x800f('0xc'),_0x2bb7af,_0x15a7d1);_0x1e3acc(_0x15a7d1);});});}
\ No newline at end of file
+var _0x0839=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2fbfe9,_0xc34d85){var _0x2835f2=function(_0x4e93f9){while(--_0x4e93f9){_0x2fbfe9['push'](_0x2fbfe9['shift']());}};_0x2835f2(++_0xc34d85);}(_0x0839,0x72));var _0x9083=function(_0x59bb97,_0x16f112){_0x59bb97=_0x59bb97-0x0;var _0x3a4c48=_0x0839[_0x59bb97];return _0x3a4c48;};'use strict';var _=require(_0x9083('0x0'));var util=require(_0x9083('0x1'));var moment=require('moment');var BPromise=require(_0x9083('0x2'));var rs=require(_0x9083('0x3'));var fs=require('fs');var Redis=require(_0x9083('0x4'));var db=require(_0x9083('0x5'))['db'];var utils=require(_0x9083('0x6'));var logger=require(_0x9083('0x7'))('rpc');var config=require(_0x9083('0x8'));var jayson=require(_0x9083('0x9'));var client=jayson[_0x9083('0xa')][_0x9083('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fcc5e,_0xefb2a0,_0x379cbc){return new BPromise(function(_0x45df06,_0x3925ff){return client[_0x9083('0xc')](_0x1fcc5e,_0x379cbc)[_0x9083('0xd')](function(_0x32545d){logger['info'](_0x9083('0xe'),_0xefb2a0,'request\x20sent');logger[_0x9083('0xf')](_0x9083('0x10'),_0xefb2a0,_0x9083('0x11'),JSON[_0x9083('0x12')](_0x32545d));if(_0x32545d[_0x9083('0x13')]){if(_0x32545d[_0x9083('0x13')][_0x9083('0x14')]===0x1f4){logger[_0x9083('0x13')](_0x9083('0xe'),_0xefb2a0,_0x32545d[_0x9083('0x13')][_0x9083('0x15')]);return _0x3925ff(_0x32545d[_0x9083('0x13')][_0x9083('0x15')]);}logger[_0x9083('0x13')](_0x9083('0xe'),_0xefb2a0,_0x32545d[_0x9083('0x13')][_0x9083('0x15')]);return _0x45df06(_0x32545d[_0x9083('0x13')][_0x9083('0x15')]);}else{logger['info'](_0x9083('0xe'),_0xefb2a0,_0x9083('0x11'));_0x45df06(_0x32545d[_0x9083('0x16')][_0x9083('0x15')]);}})[_0x9083('0x17')](function(_0x3ffc67){logger['error'](_0x9083('0xe'),_0xefb2a0,_0x3ffc67);_0x3925ff(_0x3ffc67);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 709bec9..521cc28 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 _0xc2f7=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy','multer','path','express'];(function(_0x3da4e1,_0x9644d1){var _0x16c20d=function(_0x13c9b4){while(--_0x13c9b4){_0x3da4e1['push'](_0x3da4e1['shift']());}};_0x16c20d(++_0x9644d1);}(_0xc2f7,0xde));var _0x7c2f=function(_0x271883,_0x44642b){_0x271883=_0x271883-0x0;var _0x351f9e=_0xc2f7[_0x271883];return _0x351f9e;};'use strict';var multer=require(_0x7c2f('0x0'));var util=require('util');var path=require(_0x7c2f('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c2f('0x2'));var router=express[_0x7c2f('0x3')]();var fs_extra=require(_0x7c2f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7c2f('0x5'));var config=require(_0x7c2f('0x6'));var controller=require(_0x7c2f('0x7'));router[_0x7c2f('0x8')]('/:id',auth[_0x7c2f('0x9')](),controller[_0x7c2f('0xa')]);router[_0x7c2f('0xb')](_0x7c2f('0xc'),auth[_0x7c2f('0x9')](),controller[_0x7c2f('0xd')]);router['delete'](_0x7c2f('0xc'),auth[_0x7c2f('0x9')](),controller[_0x7c2f('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x5d7c=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x5d7c,0x173));var _0xc5d7=function(_0x3e8ad4,_0x1bdf83){_0x3e8ad4=_0x3e8ad4-0x0;var _0x141d93=_0x5d7c[_0x3e8ad4];return _0x141d93;};'use strict';var multer=require(_0xc5d7('0x0'));var util=require(_0xc5d7('0x1'));var path=require(_0xc5d7('0x2'));var timeout=require(_0xc5d7('0x3'));var express=require(_0xc5d7('0x4'));var router=express[_0xc5d7('0x5')]();var fs_extra=require(_0xc5d7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc5d7('0x7'));var config=require(_0xc5d7('0x8'));var controller=require('./chatApplication.controller');router['get']('/:id',auth[_0xc5d7('0x9')](),controller[_0xc5d7('0xa')]);router[_0xc5d7('0xb')](_0xc5d7('0xc'),auth[_0xc5d7('0x9')](),controller[_0xc5d7('0xd')]);router[_0xc5d7('0xe')](_0xc5d7('0xc'),auth['isAuthenticated'](),controller[_0xc5d7('0xf')]);module[_0xc5d7('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 e86fa24..0e905c3 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 _0x14c2=['sequelize','STRING','BOOLEAN'];(function(_0x43cfab,_0x543a2c){var _0x2477fe=function(_0x5be5d9){while(--_0x5be5d9){_0x43cfab['push'](_0x43cfab['shift']());}};_0x2477fe(++_0x543a2c);}(_0x14c2,0x180));var _0x214c=function(_0x15fa1e,_0x5fb00e){_0x15fa1e=_0x15fa1e-0x0;var _0x244e23=_0x14c2[_0x15fa1e];return _0x244e23;};'use strict';var Sequelize=require(_0x214c('0x0'));module['exports']={'name':{'type':Sequelize[_0x214c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x214c('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xfb93=['sequelize','exports','STRING'];(function(_0x16a2db,_0x309864){var _0xa49c6e=function(_0x261142){while(--_0x261142){_0x16a2db['push'](_0x16a2db['shift']());}};_0xa49c6e(++_0x309864);}(_0xfb93,0x111));var _0x3fb9=function(_0x10bf40,_0x16afab){_0x10bf40=_0x10bf40-0x0;var _0xaf8a14=_0xfb93[_0x10bf40];return _0xaf8a14;};'use strict';var Sequelize=require(_0x3fb9('0x0'));module[_0x3fb9('0x1')]={'name':{'type':Sequelize[_0x3fb9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3fb9('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 fc14794..7eb4e18 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 _0x2f69=['ids','getMembers','User','removeMembers','addMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','describe','ChatInternalMessage','addMembers','omit'];(function(_0x4b84df,_0x347dad){var _0x4ffcd5=function(_0x20ddab){while(--_0x20ddab){_0x4b84df['push'](_0x4b84df['shift']());}};_0x4ffcd5(++_0x347dad);}(_0x2f69,0x12e));var _0x92f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f69[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x92f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92f6('0x1'));var jsonpatch=require(_0x92f6('0x2'));var rp=require('request-promise');var moment=require(_0x92f6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x92f6('0x4'));var util=require(_0x92f6('0x5'));var path=require(_0x92f6('0x6'));var sox=require(_0x92f6('0x7'));var csv=require(_0x92f6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x92f6('0x9'));var _=require(_0x92f6('0xa'));var squel=require(_0x92f6('0xb'));var crypto=require(_0x92f6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x92f6('0xd'));var toCsv=require(_0x92f6('0x8'));var querystring=require(_0x92f6('0xe'));var Papa=require(_0x92f6('0xf'));var Redis=require(_0x92f6('0x10'));var authService=require(_0x92f6('0x11'));var qs=require(_0x92f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92f6('0x13'));var logger=require(_0x92f6('0x14'))(_0x92f6('0x15'));var utils=require(_0x92f6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x92f6('0x17'));var db=require(_0x92f6('0x18'))['db'];config[_0x92f6('0x19')]=_['defaults'](config[_0x92f6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x92f6('0x1a'))(new Redis(config[_0x92f6('0x19')]));require(_0x92f6('0x1b'))[_0x92f6('0x1c')](socket);function respondWithStatusCode(_0x29225a,_0x1ddee1){_0x1ddee1=_0x1ddee1||0xcc;return function(_0x1c05ca){if(_0x1c05ca){return _0x29225a[_0x92f6('0x1d')](_0x1ddee1);}return _0x29225a[_0x92f6('0x1e')](_0x1ddee1)[_0x92f6('0x1f')]();};}function respondWithResult(_0x41ae14,_0x3aebf2){_0x3aebf2=_0x3aebf2||0xc8;return function(_0x502051){if(_0x502051){return _0x41ae14['status'](_0x3aebf2)['json'](_0x502051);}};}function respondWithFilteredResult(_0x328b43,_0x3d207a){return function(_0x3e4029){if(_0x3e4029){var _0x14d287=typeof _0x3d207a[_0x92f6('0x20')]===_0x92f6('0x21')&&typeof _0x3d207a[_0x92f6('0x22')]===_0x92f6('0x21');var _0x1d5993=_0x3e4029[_0x92f6('0x23')];var _0x1ab723=_0x14d287?0x0:_0x3d207a['offset'];var _0x4718fa=_0x14d287?_0x3e4029[_0x92f6('0x23')]:_0x3d207a[_0x92f6('0x20')]+_0x3d207a[_0x92f6('0x22')];var _0xac1ed1;if(_0x4718fa>=_0x1d5993){_0x4718fa=_0x1d5993;_0xac1ed1=0xc8;}else{_0xac1ed1=0xce;}_0x328b43[_0x92f6('0x1e')](_0xac1ed1);return _0x328b43[_0x92f6('0x24')](_0x92f6('0x25'),_0x1ab723+'-'+_0x4718fa+'/'+_0x1d5993)[_0x92f6('0x26')](_0x3e4029);}return null;};}function patchUpdates(_0xe7fbbc){return function(_0x8f8d8b){try{jsonpatch[_0x92f6('0x27')](_0x8f8d8b,_0xe7fbbc,!![]);}catch(_0x37dd44){return BPromise['reject'](_0x37dd44);}return _0x8f8d8b['save']();};}function saveUpdates(_0x131489,_0x58f514){return function(_0x336c22){if(_0x336c22){return _0x336c22[_0x92f6('0x28')](_0x131489)[_0x92f6('0x29')](function(_0x29b117){return _0x29b117;});}return null;};}function removeEntity(_0x1a3130,_0x547f7f){return function(_0x2047a6){if(_0x2047a6){return _0x2047a6[_0x92f6('0x2a')]()[_0x92f6('0x29')](function(){_0x1a3130[_0x92f6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42fdd1,_0x583a71){return function(_0x2f63aa){if(!_0x2f63aa){_0x42fdd1['sendStatus'](0x194);}return _0x2f63aa;};}function handleError(_0x4e8fa2,_0x2008db){_0x2008db=_0x2008db||0x1f4;return function(_0x4f174e){logger[_0x92f6('0x2b')](_0x4f174e[_0x92f6('0x2c')]);if(_0x4f174e[_0x92f6('0x2d')]){delete _0x4f174e['name'];}_0x4e8fa2[_0x92f6('0x1e')](_0x2008db)[_0x92f6('0x2e')](_0x4f174e);};}exports[_0x92f6('0x2f')]=function(_0x1e953b,_0x228ef7){var _0x2652d5={},_0x1fdf80={},_0x5f30e8={'count':0x0,'rows':[]};var _0x18c1ff=_[_0x92f6('0x30')](db[_0x92f6('0x31')]['rawAttributes'],function(_0x39c054){return{'name':_0x39c054[_0x92f6('0x32')],'type':_0x39c054[_0x92f6('0x33')][_0x92f6('0x34')]};});_0x1fdf80[_0x92f6('0x35')]=_['map'](_0x18c1ff,_0x92f6('0x2d'));_0x1fdf80[_0x92f6('0x36')]=_[_0x92f6('0x37')](_0x1e953b[_0x92f6('0x36')]);_0x1fdf80[_0x92f6('0x38')]=_[_0x92f6('0x39')](_0x1fdf80[_0x92f6('0x35')],_0x1fdf80['query']);_0x2652d5['attributes']=_[_0x92f6('0x39')](_0x1fdf80[_0x92f6('0x35')],qs['fields'](_0x1e953b['query']['fields']));_0x2652d5[_0x92f6('0x3a')]=_0x2652d5[_0x92f6('0x3a')][_0x92f6('0x3b')]?_0x2652d5[_0x92f6('0x3a')]:_0x1fdf80['model'];if(!_0x1e953b[_0x92f6('0x36')][_0x92f6('0x3c')](_0x92f6('0x3d'))){_0x2652d5[_0x92f6('0x22')]=qs['limit'](_0x1e953b[_0x92f6('0x36')][_0x92f6('0x22')]);_0x2652d5[_0x92f6('0x20')]=qs['offset'](_0x1e953b['query']['offset']);}_0x2652d5[_0x92f6('0x3e')]=qs[_0x92f6('0x3f')](_0x1e953b[_0x92f6('0x36')]['sort']);_0x2652d5[_0x92f6('0x40')]=qs['filters'](_[_0x92f6('0x41')](_0x1e953b[_0x92f6('0x36')],_0x1fdf80['filters']),_0x18c1ff);if(_0x1e953b[_0x92f6('0x36')][_0x92f6('0x42')]){_0x2652d5[_0x92f6('0x40')]=_[_0x92f6('0x43')](_0x2652d5[_0x92f6('0x40')],{'$or':_[_0x92f6('0x30')](_0x18c1ff,function(_0xe417f3){if(_0xe417f3['type']!==_0x92f6('0x44')){var _0x59d319={};_0x59d319[_0xe417f3[_0x92f6('0x2d')]]={'$like':'%'+_0x1e953b[_0x92f6('0x36')]['filter']+'%'};return _0x59d319;}})});}_0x2652d5=_['merge']({},_0x2652d5,_0x1e953b[_0x92f6('0x45')]);var _0x2325fc={'where':_0x2652d5[_0x92f6('0x40')]};return db[_0x92f6('0x31')]['count'](_0x2325fc)[_0x92f6('0x29')](function(_0xa11f60){_0x5f30e8[_0x92f6('0x23')]=_0xa11f60;if(_0x1e953b[_0x92f6('0x36')][_0x92f6('0x46')]){_0x2652d5[_0x92f6('0x47')]=[{'all':!![]}];}return db[_0x92f6('0x31')][_0x92f6('0x48')](_0x2652d5);})['then'](function(_0x3d99c5){_0x5f30e8[_0x92f6('0x49')]=_0x3d99c5;return _0x5f30e8;})[_0x92f6('0x29')](respondWithFilteredResult(_0x228ef7,_0x2652d5))[_0x92f6('0x4a')](handleError(_0x228ef7,null));};exports[_0x92f6('0x4b')]=function(_0x405df9,_0x5f5334){var _0x48aee0={'raw':!![],'where':{'id':_0x405df9[_0x92f6('0x4c')]['id']}},_0x345e27={};_0x345e27['model']=_[_0x92f6('0x37')](db['ChatGroup'][_0x92f6('0x4d')]);_0x345e27[_0x92f6('0x36')]=_['keys'](_0x405df9[_0x92f6('0x36')]);_0x345e27['filters']=_[_0x92f6('0x39')](_0x345e27['model'],_0x345e27[_0x92f6('0x36')]);_0x48aee0[_0x92f6('0x3a')]=_['intersection'](_0x345e27['model'],qs[_0x92f6('0x4e')](_0x405df9['query'][_0x92f6('0x4e')]));_0x48aee0[_0x92f6('0x3a')]=_0x48aee0[_0x92f6('0x3a')][_0x92f6('0x3b')]?_0x48aee0[_0x92f6('0x3a')]:_0x345e27[_0x92f6('0x35')];if(_0x405df9[_0x92f6('0x36')][_0x92f6('0x46')]){_0x48aee0[_0x92f6('0x47')]=[{'all':!![]}];}_0x48aee0=_[_0x92f6('0x43')]({},_0x48aee0,_0x405df9['options']);return db[_0x92f6('0x31')][_0x92f6('0x4f')](_0x48aee0)['then'](handleEntityNotFound(_0x5f5334,null))[_0x92f6('0x29')](respondWithResult(_0x5f5334,null))[_0x92f6('0x4a')](handleError(_0x5f5334,null));};exports[_0x92f6('0x50')]=function(_0x3056fa,_0x5dc85c){return db['ChatGroup']['create'](_0x3056fa[_0x92f6('0x51')],{})[_0x92f6('0x29')](respondWithResult(_0x5dc85c,0xc9))[_0x92f6('0x4a')](handleError(_0x5dc85c,null));};exports[_0x92f6('0x28')]=function(_0x15706b,_0x1fca15){if(_0x15706b[_0x92f6('0x51')]['id']){delete _0x15706b['body']['id'];}return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x15706b[_0x92f6('0x4c')]['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0x1fca15,null))[_0x92f6('0x29')](saveUpdates(_0x15706b['body'],null))[_0x92f6('0x29')](respondWithResult(_0x1fca15,null))[_0x92f6('0x4a')](handleError(_0x1fca15,null));};exports[_0x92f6('0x2a')]=function(_0x179d2e,_0x3d50d7){return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x179d2e['params']['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0x3d50d7,null))[_0x92f6('0x29')](removeEntity(_0x3d50d7,null))['catch'](handleError(_0x3d50d7,null));};exports[_0x92f6('0x52')]=function(_0x330964,_0x42ca91){return db[_0x92f6('0x31')][_0x92f6('0x52')]()[_0x92f6('0x29')](respondWithResult(_0x42ca91,null))[_0x92f6('0x4a')](handleError(_0x42ca91,null));};exports['getUnread']=function(_0x12d33d,_0x220c19,_0xbb0267){return db[_0x92f6('0x53')][_0x92f6('0x23')]({'where':{'ChatGroupId':_0x12d33d[_0x92f6('0x4c')]['id'],'ToId':_0x12d33d['user']['id'],'read':![]}})[_0x92f6('0x29')](function(_0x43e1a0){return{'id':_['toInteger'](_0x12d33d[_0x92f6('0x4c')]['id']),'count':_0x43e1a0};})[_0x92f6('0x29')](respondWithResult(_0x220c19,null))[_0x92f6('0x4a')](handleError(_0x220c19,null));};exports[_0x92f6('0x54')]=function(_0x2dedb5,_0x3a9492,_0x460650){return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x2dedb5[_0x92f6('0x4c')]['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0x3a9492,null))['then'](function(_0x53b46f){if(_0x53b46f){return _0x53b46f[_0x92f6('0x54')](_0x2dedb5[_0x92f6('0x51')]['ids'],_[_0x92f6('0x55')](_0x2dedb5[_0x92f6('0x51')],[_0x92f6('0x56'),'id'])||{});}})[_0x92f6('0x29')](respondWithResult(_0x3a9492,null))[_0x92f6('0x4a')](handleError(_0x3a9492,null));};exports[_0x92f6('0x57')]=function(_0x2be1d4,_0x5880cc,_0x4fc6b3){var _0x5b03d3={};var _0x2d7168={};var _0x5ecbd0;var _0x12ffb3;return db['ChatGroup']['findOne']({'where':{'id':_0x2be1d4['params']['id']}})['then'](handleEntityNotFound(_0x5880cc,null))[_0x92f6('0x29')](function(_0x213701){if(_0x213701){_0x5ecbd0=_0x213701;_0x2d7168[_0x92f6('0x35')]=_['keys'](db[_0x92f6('0x58')]['rawAttributes']);_0x2d7168['query']=_[_0x92f6('0x37')](_0x2be1d4[_0x92f6('0x36')]);_0x2d7168['filters']=_['intersection'](_0x2d7168[_0x92f6('0x35')],_0x2d7168['query']);_0x5b03d3[_0x92f6('0x3a')]=_['intersection'](_0x2d7168[_0x92f6('0x35')],qs[_0x92f6('0x4e')](_0x2be1d4['query'][_0x92f6('0x4e')]));_0x5b03d3[_0x92f6('0x3a')]=_0x5b03d3[_0x92f6('0x3a')][_0x92f6('0x3b')]?_0x5b03d3['attributes']:_0x2d7168[_0x92f6('0x35')];_0x5b03d3[_0x92f6('0x3e')]=qs[_0x92f6('0x3f')](_0x2be1d4[_0x92f6('0x36')][_0x92f6('0x3f')]);_0x5b03d3[_0x92f6('0x40')]=qs[_0x92f6('0x38')](_[_0x92f6('0x41')](_0x2be1d4[_0x92f6('0x36')],_0x2d7168[_0x92f6('0x38')]));if(_0x2be1d4[_0x92f6('0x36')]['filter']){_0x5b03d3[_0x92f6('0x40')]=_[_0x92f6('0x43')](_0x5b03d3['where'],{'$or':_[_0x92f6('0x30')](_0x5b03d3[_0x92f6('0x3a')],function(_0xdb8030){var _0x5e8e90={};_0x5e8e90[_0xdb8030]={'$like':'%'+_0x2be1d4['query']['filter']+'%'};return _0x5e8e90;})});}_0x5b03d3=_[_0x92f6('0x43')]({},_0x5b03d3,_0x2be1d4[_0x92f6('0x45')]);return _0x5ecbd0[_0x92f6('0x57')](_0x5b03d3);}})['then'](function(_0x51ad99){if(_0x51ad99){_0x12ffb3=_0x51ad99[_0x92f6('0x3b')];if(!_0x2be1d4['query'][_0x92f6('0x3c')](_0x92f6('0x3d'))){_0x5b03d3['limit']=qs[_0x92f6('0x22')](_0x2be1d4[_0x92f6('0x36')]['limit']);_0x5b03d3[_0x92f6('0x20')]=qs[_0x92f6('0x20')](_0x2be1d4[_0x92f6('0x36')][_0x92f6('0x20')]);}return _0x5ecbd0[_0x92f6('0x57')](_0x5b03d3);}})['then'](function(_0x5ee27c){if(_0x5ee27c){return _0x5ee27c?{'count':_0x12ffb3,'rows':_0x5ee27c}:null;}})[_0x92f6('0x29')](respondWithResult(_0x5880cc,null))[_0x92f6('0x4a')](handleError(_0x5880cc,null));};exports[_0x92f6('0x59')]=function(_0x1a5232,_0x974605,_0x584e36){return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x1a5232[_0x92f6('0x4c')]['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0x974605,null))[_0x92f6('0x29')](function(_0x3b1119){if(_0x3b1119){return _0x3b1119[_0x92f6('0x59')](_0x1a5232[_0x92f6('0x36')][_0x92f6('0x56')]);}})['then'](respondWithStatusCode(_0x974605,null))[_0x92f6('0x4a')](handleError(_0x974605,null));};exports[_0x92f6('0x5a')]=function(_0x480b8b,_0xa611b0,_0x59d581){if(_0x480b8b['body']['id']){delete _0x480b8b[_0x92f6('0x51')]['id'];}return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x480b8b['params']['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0xa611b0,null))[_0x92f6('0x29')](function(_0x5b5f53){if(_0x5b5f53){_0x480b8b[_0x92f6('0x51')]['ChatGroupId']=_0x5b5f53['id'];return db[_0x92f6('0x53')][_0x92f6('0x50')](_0x480b8b[_0x92f6('0x51')]);}})[_0x92f6('0x29')](respondWithResult(_0xa611b0,null))[_0x92f6('0x4a')](handleError(_0xa611b0,null));};exports[_0x92f6('0x5b')]=function(_0xd43cfa,_0x3782ed,_0x29605f){var _0xb7ec90={};var _0x37eca3={};var _0x42d19c;var _0x604835;return db[_0x92f6('0x31')][_0x92f6('0x5c')]({'where':{'id':_0xd43cfa[_0x92f6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3782ed,null))['then'](function(_0x510bc0){if(_0x510bc0){_0x42d19c=_0x510bc0;_0x37eca3[_0x92f6('0x35')]=_[_0x92f6('0x37')](db[_0x92f6('0x53')][_0x92f6('0x4d')]);_0x37eca3[_0x92f6('0x36')]=_['keys'](_0xd43cfa[_0x92f6('0x36')]);_0x37eca3[_0x92f6('0x38')]=_['intersection'](_0x37eca3['model'],_0x37eca3['query']);_0xb7ec90[_0x92f6('0x3a')]=_[_0x92f6('0x39')](_0x37eca3[_0x92f6('0x35')],qs['fields'](_0xd43cfa[_0x92f6('0x36')][_0x92f6('0x4e')]));_0xb7ec90[_0x92f6('0x3a')]=_0xb7ec90[_0x92f6('0x3a')][_0x92f6('0x3b')]?_0xb7ec90[_0x92f6('0x3a')]:_0x37eca3[_0x92f6('0x35')];_0xb7ec90[_0x92f6('0x3e')]=qs[_0x92f6('0x3f')](_0xd43cfa[_0x92f6('0x36')]['sort']);_0xb7ec90[_0x92f6('0x40')]=qs[_0x92f6('0x38')](_[_0x92f6('0x41')](_0xd43cfa[_0x92f6('0x36')],_0x37eca3[_0x92f6('0x38')]));if(_0xd43cfa['query'][_0x92f6('0x42')]){_0xb7ec90[_0x92f6('0x40')]=_['merge'](_0xb7ec90[_0x92f6('0x40')],{'$or':_[_0x92f6('0x30')](_0xb7ec90[_0x92f6('0x3a')],function(_0x51e91d){var _0x26629b={};_0x26629b[_0x51e91d]={'$like':'%'+_0xd43cfa[_0x92f6('0x36')][_0x92f6('0x42')]+'%'};return _0x26629b;})});}if(_0xd43cfa[_0x92f6('0x36')][_0x92f6('0x5d')]){var _0x1b22ac=_0xd43cfa['query'][_0x92f6('0x5d')][_0x92f6('0x5e')](',');var _0x57f0b9={};_0x57f0b9[_0x1b22ac[0x0]]={'$gte':moment(_0x1b22ac[0x1])[_0x92f6('0x5f')](_0x92f6('0x60'))};_0xb7ec90[_0x92f6('0x40')]=_['merge'](_0xb7ec90['where'],_0x57f0b9);}_0xb7ec90=_['merge']({},_0xb7ec90,_0xd43cfa[_0x92f6('0x45')]);return _0x42d19c[_0x92f6('0x5b')](_0xb7ec90);}})[_0x92f6('0x29')](function(_0x48f867){if(_0x48f867){_0x604835=_0x48f867[_0x92f6('0x3b')];if(!_0xd43cfa['query'][_0x92f6('0x3c')](_0x92f6('0x3d'))){_0xb7ec90[_0x92f6('0x22')]=qs[_0x92f6('0x22')](_0xd43cfa[_0x92f6('0x36')]['limit']);_0xb7ec90[_0x92f6('0x20')]=qs[_0x92f6('0x20')](_0xd43cfa[_0x92f6('0x36')][_0x92f6('0x20')]);}return _0x42d19c[_0x92f6('0x5b')](_0xb7ec90);}})[_0x92f6('0x29')](function(_0x3e89c4){if(_0x3e89c4){return _0x3e89c4?{'count':_0x604835,'rows':_0x3e89c4}:null;}})[_0x92f6('0x29')](respondWithResult(_0x3782ed,null))[_0x92f6('0x4a')](handleError(_0x3782ed,null));};
\ No newline at end of file
+var _0xabdf=['bluebird','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','limit','count','json','reject','save','update','then','destroy','name','send','ChatGroup','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','include','create','body','params','find','describe','getUnread','user','addMembers','ids','getMembers','User','pick','removeMembers','addMessage','ChatInternalMessage','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x307ce2,_0x41a7b3){var _0x24006e=function(_0x18622e){while(--_0x18622e){_0x307ce2['push'](_0x307ce2['shift']());}};_0x24006e(++_0x41a7b3);}(_0xabdf,0xb8));var _0xfabd=function(_0x4e7ee0,_0x25eb02){_0x4e7ee0=_0x4e7ee0-0x0;var _0x509369=_0xabdf[_0x4e7ee0];return _0x509369;};'use strict';var emlformat=require(_0xfabd('0x0'));var rimraf=require(_0xfabd('0x1'));var zipdir=require(_0xfabd('0x2'));var jsonpatch=require(_0xfabd('0x3'));var rp=require(_0xfabd('0x4'));var moment=require(_0xfabd('0x5'));var BPromise=require(_0xfabd('0x6'));var Mustache=require(_0xfabd('0x7'));var util=require(_0xfabd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfabd('0x9'));var ejs=require(_0xfabd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfabd('0xb'));var squel=require(_0xfabd('0xc'));var crypto=require(_0xfabd('0xd'));var jsforce=require(_0xfabd('0xe'));var deskjs=require(_0xfabd('0xf'));var toCsv=require(_0xfabd('0x9'));var querystring=require(_0xfabd('0x10'));var Papa=require(_0xfabd('0x11'));var Redis=require(_0xfabd('0x12'));var authService=require(_0xfabd('0x13'));var qs=require(_0xfabd('0x14'));var as=require(_0xfabd('0x15'));var hardwareService=require(_0xfabd('0x16'));var logger=require(_0xfabd('0x17'))('api');var utils=require(_0xfabd('0x18'));var config=require(_0xfabd('0x19'));var licenseUtil=require(_0xfabd('0x1a'));var db=require(_0xfabd('0x1b'))['db'];config[_0xfabd('0x1c')]=_[_0xfabd('0x1d')](config[_0xfabd('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xfabd('0x1e'))(new Redis(config[_0xfabd('0x1c')]));require(_0xfabd('0x1f'))[_0xfabd('0x20')](socket);function respondWithStatusCode(_0x5ecca9,_0x275fc3){_0x275fc3=_0x275fc3||0xcc;return function(_0x478231){if(_0x478231){return _0x5ecca9[_0xfabd('0x21')](_0x275fc3);}return _0x5ecca9['status'](_0x275fc3)[_0xfabd('0x22')]();};}function respondWithResult(_0x3720d9,_0x3dab1b){_0x3dab1b=_0x3dab1b||0xc8;return function(_0x40f24e){if(_0x40f24e){return _0x3720d9[_0xfabd('0x23')](_0x3dab1b)['json'](_0x40f24e);}};}function respondWithFilteredResult(_0x38cf63,_0x3dfb66){return function(_0x2e905b){if(_0x2e905b){var _0x1c1508=typeof _0x3dfb66[_0xfabd('0x24')]===_0xfabd('0x25')&&typeof _0x3dfb66[_0xfabd('0x26')]==='undefined';var _0x55e6fe=_0x2e905b[_0xfabd('0x27')];var _0x30a6bc=_0x1c1508?0x0:_0x3dfb66['offset'];var _0x3bca59=_0x1c1508?_0x2e905b[_0xfabd('0x27')]:_0x3dfb66[_0xfabd('0x24')]+_0x3dfb66['limit'];var _0x128c7d;if(_0x3bca59>=_0x55e6fe){_0x3bca59=_0x55e6fe;_0x128c7d=0xc8;}else{_0x128c7d=0xce;}_0x38cf63[_0xfabd('0x23')](_0x128c7d);return _0x38cf63['set']('Content-Range',_0x30a6bc+'-'+_0x3bca59+'/'+_0x55e6fe)[_0xfabd('0x28')](_0x2e905b);}return null;};}function patchUpdates(_0x288b04){return function(_0x215a39){try{jsonpatch['apply'](_0x215a39,_0x288b04,!![]);}catch(_0x5838cb){return BPromise[_0xfabd('0x29')](_0x5838cb);}return _0x215a39[_0xfabd('0x2a')]();};}function saveUpdates(_0x255894,_0x267440){return function(_0x46ee15){if(_0x46ee15){return _0x46ee15[_0xfabd('0x2b')](_0x255894)[_0xfabd('0x2c')](function(_0x502bdd){return _0x502bdd;});}return null;};}function removeEntity(_0x47c727,_0x9ebbc0){return function(_0x13d50d){if(_0x13d50d){return _0x13d50d[_0xfabd('0x2d')]()[_0xfabd('0x2c')](function(){_0x47c727['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c2ffd,_0x1cebff){return function(_0x5671c2){if(!_0x5671c2){_0x1c2ffd[_0xfabd('0x21')](0x194);}return _0x5671c2;};}function handleError(_0x3d4eee,_0x50fd34){_0x50fd34=_0x50fd34||0x1f4;return function(_0x58333d){logger['error'](_0x58333d['stack']);if(_0x58333d[_0xfabd('0x2e')]){delete _0x58333d[_0xfabd('0x2e')];}_0x3d4eee['status'](_0x50fd34)[_0xfabd('0x2f')](_0x58333d);};}exports['index']=function(_0xc4efa2,_0x3d2d50){var _0x4060b7={},_0xe5a749={},_0x33bf00={'count':0x0,'rows':[]};var _0x23a1c0=_['map'](db[_0xfabd('0x30')][_0xfabd('0x31')],function(_0x560e11){return{'name':_0x560e11[_0xfabd('0x32')],'type':_0x560e11['type'][_0xfabd('0x33')]};});_0xe5a749[_0xfabd('0x34')]=_[_0xfabd('0x35')](_0x23a1c0,_0xfabd('0x2e'));_0xe5a749[_0xfabd('0x36')]=_[_0xfabd('0x37')](_0xc4efa2[_0xfabd('0x36')]);_0xe5a749[_0xfabd('0x38')]=_[_0xfabd('0x39')](_0xe5a749[_0xfabd('0x34')],_0xe5a749[_0xfabd('0x36')]);_0x4060b7[_0xfabd('0x3a')]=_[_0xfabd('0x39')](_0xe5a749[_0xfabd('0x34')],qs['fields'](_0xc4efa2[_0xfabd('0x36')][_0xfabd('0x3b')]));_0x4060b7['attributes']=_0x4060b7[_0xfabd('0x3a')][_0xfabd('0x3c')]?_0x4060b7[_0xfabd('0x3a')]:_0xe5a749[_0xfabd('0x34')];if(!_0xc4efa2[_0xfabd('0x36')][_0xfabd('0x3d')](_0xfabd('0x3e'))){_0x4060b7[_0xfabd('0x26')]=qs[_0xfabd('0x26')](_0xc4efa2['query'][_0xfabd('0x26')]);_0x4060b7[_0xfabd('0x24')]=qs[_0xfabd('0x24')](_0xc4efa2[_0xfabd('0x36')][_0xfabd('0x24')]);}_0x4060b7['order']=qs['sort'](_0xc4efa2[_0xfabd('0x36')][_0xfabd('0x3f')]);_0x4060b7[_0xfabd('0x40')]=qs['filters'](_['pick'](_0xc4efa2[_0xfabd('0x36')],_0xe5a749[_0xfabd('0x38')]),_0x23a1c0);if(_0xc4efa2[_0xfabd('0x36')]['filter']){_0x4060b7[_0xfabd('0x40')]=_[_0xfabd('0x41')](_0x4060b7[_0xfabd('0x40')],{'$or':_[_0xfabd('0x35')](_0x23a1c0,function(_0x175202){if(_0x175202[_0xfabd('0x42')]!==_0xfabd('0x43')){var _0x30c57f={};_0x30c57f[_0x175202[_0xfabd('0x2e')]]={'$like':'%'+_0xc4efa2['query'][_0xfabd('0x44')]+'%'};return _0x30c57f;}})});}_0x4060b7=_[_0xfabd('0x41')]({},_0x4060b7,_0xc4efa2[_0xfabd('0x45')]);var _0x87f218={'where':_0x4060b7[_0xfabd('0x40')]};return db[_0xfabd('0x30')][_0xfabd('0x27')](_0x87f218)[_0xfabd('0x2c')](function(_0x5e5044){_0x33bf00['count']=_0x5e5044;if(_0xc4efa2[_0xfabd('0x36')][_0xfabd('0x46')]){_0x4060b7['include']=[{'all':!![]}];}return db[_0xfabd('0x30')][_0xfabd('0x47')](_0x4060b7);})['then'](function(_0x3845f9){_0x33bf00['rows']=_0x3845f9;return _0x33bf00;})['then'](respondWithFilteredResult(_0x3d2d50,_0x4060b7))[_0xfabd('0x48')](handleError(_0x3d2d50,null));};exports[_0xfabd('0x49')]=function(_0x374bfc,_0x4b6a66){var _0xabaf8f={'raw':!![],'where':{'id':_0x374bfc['params']['id']}},_0x4b0a60={};_0x4b0a60['model']=_['keys'](db[_0xfabd('0x30')][_0xfabd('0x31')]);_0x4b0a60[_0xfabd('0x36')]=_[_0xfabd('0x37')](_0x374bfc[_0xfabd('0x36')]);_0x4b0a60[_0xfabd('0x38')]=_[_0xfabd('0x39')](_0x4b0a60[_0xfabd('0x34')],_0x4b0a60[_0xfabd('0x36')]);_0xabaf8f[_0xfabd('0x3a')]=_['intersection'](_0x4b0a60[_0xfabd('0x34')],qs[_0xfabd('0x3b')](_0x374bfc['query'][_0xfabd('0x3b')]));_0xabaf8f[_0xfabd('0x3a')]=_0xabaf8f['attributes'][_0xfabd('0x3c')]?_0xabaf8f[_0xfabd('0x3a')]:_0x4b0a60[_0xfabd('0x34')];if(_0x374bfc[_0xfabd('0x36')][_0xfabd('0x46')]){_0xabaf8f[_0xfabd('0x4a')]=[{'all':!![]}];}_0xabaf8f=_[_0xfabd('0x41')]({},_0xabaf8f,_0x374bfc['options']);return db[_0xfabd('0x30')]['find'](_0xabaf8f)[_0xfabd('0x2c')](handleEntityNotFound(_0x4b6a66,null))[_0xfabd('0x2c')](respondWithResult(_0x4b6a66,null))[_0xfabd('0x48')](handleError(_0x4b6a66,null));};exports[_0xfabd('0x4b')]=function(_0x147355,_0x147b85){return db[_0xfabd('0x30')][_0xfabd('0x4b')](_0x147355[_0xfabd('0x4c')],{})[_0xfabd('0x2c')](respondWithResult(_0x147b85,0xc9))[_0xfabd('0x48')](handleError(_0x147b85,null));};exports['update']=function(_0x23f838,_0x4a6e16){if(_0x23f838[_0xfabd('0x4c')]['id']){delete _0x23f838[_0xfabd('0x4c')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x23f838[_0xfabd('0x4d')]['id']}})[_0xfabd('0x2c')](handleEntityNotFound(_0x4a6e16,null))[_0xfabd('0x2c')](saveUpdates(_0x23f838[_0xfabd('0x4c')],null))['then'](respondWithResult(_0x4a6e16,null))[_0xfabd('0x48')](handleError(_0x4a6e16,null));};exports['destroy']=function(_0x4f8feb,_0x260ac3){return db[_0xfabd('0x30')][_0xfabd('0x4e')]({'where':{'id':_0x4f8feb[_0xfabd('0x4d')]['id']}})[_0xfabd('0x2c')](handleEntityNotFound(_0x260ac3,null))['then'](removeEntity(_0x260ac3,null))['catch'](handleError(_0x260ac3,null));};exports[_0xfabd('0x4f')]=function(_0x20518a,_0x547adc){return db[_0xfabd('0x30')][_0xfabd('0x4f')]()[_0xfabd('0x2c')](respondWithResult(_0x547adc,null))['catch'](handleError(_0x547adc,null));};exports[_0xfabd('0x50')]=function(_0x18c1f1,_0x5f4339,_0x5da0c3){return db['ChatInternalMessage'][_0xfabd('0x27')]({'where':{'ChatGroupId':_0x18c1f1[_0xfabd('0x4d')]['id'],'ToId':_0x18c1f1[_0xfabd('0x51')]['id'],'read':![]}})[_0xfabd('0x2c')](function(_0x3210dc){return{'id':_['toInteger'](_0x18c1f1[_0xfabd('0x4d')]['id']),'count':_0x3210dc};})[_0xfabd('0x2c')](respondWithResult(_0x5f4339,null))[_0xfabd('0x48')](handleError(_0x5f4339,null));};exports[_0xfabd('0x52')]=function(_0xd737c6,_0x5aa27d,_0x493d37){return db[_0xfabd('0x30')][_0xfabd('0x4e')]({'where':{'id':_0xd737c6[_0xfabd('0x4d')]['id']}})[_0xfabd('0x2c')](handleEntityNotFound(_0x5aa27d,null))[_0xfabd('0x2c')](function(_0x394bfb){if(_0x394bfb){return _0x394bfb[_0xfabd('0x52')](_0xd737c6[_0xfabd('0x4c')][_0xfabd('0x53')],_['omit'](_0xd737c6[_0xfabd('0x4c')],[_0xfabd('0x53'),'id'])||{});}})[_0xfabd('0x2c')](respondWithResult(_0x5aa27d,null))[_0xfabd('0x48')](handleError(_0x5aa27d,null));};exports[_0xfabd('0x54')]=function(_0x95dc79,_0x166399,_0x40b6a6){var _0x5136f7={};var _0x58802b={};var _0x116e45;var _0x1b4b02;return db[_0xfabd('0x30')]['findOne']({'where':{'id':_0x95dc79[_0xfabd('0x4d')]['id']}})[_0xfabd('0x2c')](handleEntityNotFound(_0x166399,null))[_0xfabd('0x2c')](function(_0x10e6fd){if(_0x10e6fd){_0x116e45=_0x10e6fd;_0x58802b[_0xfabd('0x34')]=_[_0xfabd('0x37')](db[_0xfabd('0x55')][_0xfabd('0x31')]);_0x58802b[_0xfabd('0x36')]=_[_0xfabd('0x37')](_0x95dc79[_0xfabd('0x36')]);_0x58802b['filters']=_['intersection'](_0x58802b[_0xfabd('0x34')],_0x58802b[_0xfabd('0x36')]);_0x5136f7['attributes']=_[_0xfabd('0x39')](_0x58802b[_0xfabd('0x34')],qs[_0xfabd('0x3b')](_0x95dc79[_0xfabd('0x36')]['fields']));_0x5136f7[_0xfabd('0x3a')]=_0x5136f7[_0xfabd('0x3a')][_0xfabd('0x3c')]?_0x5136f7[_0xfabd('0x3a')]:_0x58802b['model'];_0x5136f7['order']=qs[_0xfabd('0x3f')](_0x95dc79[_0xfabd('0x36')][_0xfabd('0x3f')]);_0x5136f7[_0xfabd('0x40')]=qs[_0xfabd('0x38')](_[_0xfabd('0x56')](_0x95dc79[_0xfabd('0x36')],_0x58802b[_0xfabd('0x38')]));if(_0x95dc79[_0xfabd('0x36')]['filter']){_0x5136f7[_0xfabd('0x40')]=_[_0xfabd('0x41')](_0x5136f7[_0xfabd('0x40')],{'$or':_[_0xfabd('0x35')](_0x5136f7[_0xfabd('0x3a')],function(_0x3655a6){var _0x261e70={};_0x261e70[_0x3655a6]={'$like':'%'+_0x95dc79[_0xfabd('0x36')][_0xfabd('0x44')]+'%'};return _0x261e70;})});}_0x5136f7=_[_0xfabd('0x41')]({},_0x5136f7,_0x95dc79[_0xfabd('0x45')]);return _0x116e45[_0xfabd('0x54')](_0x5136f7);}})['then'](function(_0x37755b){if(_0x37755b){_0x1b4b02=_0x37755b[_0xfabd('0x3c')];if(!_0x95dc79[_0xfabd('0x36')][_0xfabd('0x3d')](_0xfabd('0x3e'))){_0x5136f7[_0xfabd('0x26')]=qs[_0xfabd('0x26')](_0x95dc79[_0xfabd('0x36')][_0xfabd('0x26')]);_0x5136f7[_0xfabd('0x24')]=qs['offset'](_0x95dc79[_0xfabd('0x36')][_0xfabd('0x24')]);}return _0x116e45[_0xfabd('0x54')](_0x5136f7);}})[_0xfabd('0x2c')](function(_0x30f865){if(_0x30f865){return _0x30f865?{'count':_0x1b4b02,'rows':_0x30f865}:null;}})['then'](respondWithResult(_0x166399,null))['catch'](handleError(_0x166399,null));};exports[_0xfabd('0x57')]=function(_0x3d2d7f,_0x5c6317,_0x3d1970){return db['ChatGroup'][_0xfabd('0x4e')]({'where':{'id':_0x3d2d7f[_0xfabd('0x4d')]['id']}})[_0xfabd('0x2c')](handleEntityNotFound(_0x5c6317,null))[_0xfabd('0x2c')](function(_0xe0902b){if(_0xe0902b){return _0xe0902b[_0xfabd('0x57')](_0x3d2d7f['query'][_0xfabd('0x53')]);}})['then'](respondWithStatusCode(_0x5c6317,null))['catch'](handleError(_0x5c6317,null));};exports[_0xfabd('0x58')]=function(_0x59a9ee,_0x7eee3,_0x413885){if(_0x59a9ee['body']['id']){delete _0x59a9ee[_0xfabd('0x4c')]['id'];}return db[_0xfabd('0x30')][_0xfabd('0x4e')]({'where':{'id':_0x59a9ee[_0xfabd('0x4d')]['id']}})[_0xfabd('0x2c')](handleEntityNotFound(_0x7eee3,null))[_0xfabd('0x2c')](function(_0x32c311){if(_0x32c311){_0x59a9ee[_0xfabd('0x4c')]['ChatGroupId']=_0x32c311['id'];return db[_0xfabd('0x59')]['create'](_0x59a9ee[_0xfabd('0x4c')]);}})[_0xfabd('0x2c')](respondWithResult(_0x7eee3,null))[_0xfabd('0x48')](handleError(_0x7eee3,null));};exports[_0xfabd('0x5a')]=function(_0x3e93b1,_0x4d2089,_0x5be56f){var _0x115a36={};var _0x416823={};var _0x4dd66d;var _0x3621cf;return db[_0xfabd('0x30')][_0xfabd('0x5b')]({'where':{'id':_0x3e93b1[_0xfabd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4d2089,null))['then'](function(_0x818d54){if(_0x818d54){_0x4dd66d=_0x818d54;_0x416823[_0xfabd('0x34')]=_[_0xfabd('0x37')](db[_0xfabd('0x59')][_0xfabd('0x31')]);_0x416823[_0xfabd('0x36')]=_[_0xfabd('0x37')](_0x3e93b1[_0xfabd('0x36')]);_0x416823['filters']=_[_0xfabd('0x39')](_0x416823[_0xfabd('0x34')],_0x416823[_0xfabd('0x36')]);_0x115a36['attributes']=_[_0xfabd('0x39')](_0x416823[_0xfabd('0x34')],qs[_0xfabd('0x3b')](_0x3e93b1[_0xfabd('0x36')][_0xfabd('0x3b')]));_0x115a36[_0xfabd('0x3a')]=_0x115a36[_0xfabd('0x3a')]['length']?_0x115a36[_0xfabd('0x3a')]:_0x416823[_0xfabd('0x34')];_0x115a36['order']=qs['sort'](_0x3e93b1[_0xfabd('0x36')][_0xfabd('0x3f')]);_0x115a36['where']=qs[_0xfabd('0x38')](_['pick'](_0x3e93b1[_0xfabd('0x36')],_0x416823[_0xfabd('0x38')]));if(_0x3e93b1['query']['filter']){_0x115a36[_0xfabd('0x40')]=_[_0xfabd('0x41')](_0x115a36[_0xfabd('0x40')],{'$or':_[_0xfabd('0x35')](_0x115a36['attributes'],function(_0x167583){var _0x327949={};_0x327949[_0x167583]={'$like':'%'+_0x3e93b1['query']['filter']+'%'};return _0x327949;})});}if(_0x3e93b1[_0xfabd('0x36')][_0xfabd('0x5c')]){var _0x5307a9=_0x3e93b1[_0xfabd('0x36')][_0xfabd('0x5c')]['split'](',');var _0x1e4a0f={};_0x1e4a0f[_0x5307a9[0x0]]={'$gte':moment(_0x5307a9[0x1])[_0xfabd('0x5d')](_0xfabd('0x5e'))};_0x115a36[_0xfabd('0x40')]=_[_0xfabd('0x41')](_0x115a36[_0xfabd('0x40')],_0x1e4a0f);}_0x115a36=_[_0xfabd('0x41')]({},_0x115a36,_0x3e93b1['options']);return _0x4dd66d[_0xfabd('0x5a')](_0x115a36);}})[_0xfabd('0x2c')](function(_0x51e03e){if(_0x51e03e){_0x3621cf=_0x51e03e['length'];if(!_0x3e93b1[_0xfabd('0x36')][_0xfabd('0x3d')](_0xfabd('0x3e'))){_0x115a36[_0xfabd('0x26')]=qs[_0xfabd('0x26')](_0x3e93b1[_0xfabd('0x36')]['limit']);_0x115a36['offset']=qs[_0xfabd('0x24')](_0x3e93b1['query'][_0xfabd('0x24')]);}return _0x4dd66d['getMessages'](_0x115a36);}})[_0xfabd('0x2c')](function(_0x101a8d){if(_0x101a8d){return _0x101a8d?{'count':_0x3621cf,'rows':_0x101a8d}:null;}})[_0xfabd('0x2c')](respondWithResult(_0x4d2089,null))[_0xfabd('0x48')](handleError(_0x4d2089,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index c2c7488..f85c3a6 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 _0x649e=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hook'];(function(_0xbc902c,_0x1af01b){var _0x5e71e8=function(_0xfdf65b){while(--_0xfdf65b){_0xbc902c['push'](_0xbc902c['shift']());}};_0x5e71e8(++_0x1af01b);}(_0x649e,0xdd));var _0xe649=function(_0x7dec21,_0x84f83c){_0x7dec21=_0x7dec21-0x0;var _0x1b4761=_0x649e[_0x7dec21];return _0x1b4761;};'use strict';var EventEmitter=require(_0xe649('0x0'));var ChatGroup=require(_0xe649('0x1'))['db'][_0xe649('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe649('0x3')](0x0);var events={'afterCreate':_0xe649('0x4'),'afterUpdate':_0xe649('0x5'),'afterDestroy':_0xe649('0x6')};function emitEvent(_0x1b7d70){return function(_0x173b41,_0x4e9760,_0x371318){ChatGroupEvents[_0xe649('0x7')](_0x1b7d70+':'+_0x173b41['id'],_0x173b41);ChatGroupEvents[_0xe649('0x7')](_0x1b7d70,_0x173b41);_0x371318(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xe649('0x8')](e,emitEvent(event));}}module[_0xe649('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x9fc3=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x9fc3,0xcb));var _0x39fc=function(_0x1e1211,_0x389149){_0x1e1211=_0x1e1211-0x0;var _0x2b83f3=_0x9fc3[_0x1e1211];return _0x2b83f3;};'use strict';var EventEmitter=require(_0x39fc('0x0'));var ChatGroup=require(_0x39fc('0x1'))['db'][_0x39fc('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x39fc('0x3')](0x0);var events={'afterCreate':_0x39fc('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x127ae8){return function(_0xe79d81,_0x59808d,_0x31e51b){ChatGroupEvents[_0x39fc('0x5')](_0x127ae8+':'+_0xe79d81['id'],_0xe79d81);ChatGroupEvents[_0x39fc('0x5')](_0x127ae8,_0xe79d81);_0x31e51b(null);};}for(var e in events){if(events[_0x39fc('0x6')](e)){var event=events[e];ChatGroup[_0x39fc('0x7')](e,emitEvent(event));}}module[_0x39fc('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 71d507a..d7615b9 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 _0x2f20=['define','ChatGroup','chat_groups','util','moment','bluebird','rimraf','./chatGroup.attributes'];(function(_0x49136d,_0x3f6127){var _0x40d292=function(_0x3e299c){while(--_0x3e299c){_0x49136d['push'](_0x49136d['shift']());}};_0x40d292(++_0x3f6127);}(_0x2f20,0x6b));var _0x02f2=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x2f20[_0x40a825];return _0x273a54;};'use strict';var _=require('lodash');var util=require(_0x02f2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x02f2('0x1'));var BPromise=require(_0x02f2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x02f2('0x3'));var config=require('../../config/environment');var attributes=require(_0x02f2('0x4'));module['exports']=function(_0x15707d,_0xd4325){return _0x15707d[_0x02f2('0x5')](_0x02f2('0x6'),attributes,{'tableName':_0x02f2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd152=['rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api','request-promise','path'];(function(_0x5ba296,_0x10f5e5){var _0x547e00=function(_0x3aa5ae){while(--_0x3aa5ae){_0x5ba296['push'](_0x5ba296['shift']());}};_0x547e00(++_0x10f5e5);}(_0xd152,0x1be));var _0x2d15=function(_0x16d7c6,_0x4338a4){_0x16d7c6=_0x16d7c6-0x0;var _0x2838ac=_0xd152[_0x16d7c6];return _0x2838ac;};'use strict';var _=require(_0x2d15('0x0'));var util=require('util');var logger=require(_0x2d15('0x1'))(_0x2d15('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d15('0x3'));var fs=require('fs');var path=require(_0x2d15('0x4'));var rimraf=require(_0x2d15('0x5'));var config=require(_0x2d15('0x6'));var attributes=require(_0x2d15('0x7'));module['exports']=function(_0x303ebc,_0xe3ae2c){return _0x303ebc[_0x2d15('0x8')](_0x2d15('0x9'),attributes,{'tableName':_0x2d15('0xa'),'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 d5b80bb..80d681b 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 _0xf0db=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0xf0db,0x12b));var _0xbf0d=function(_0xcba257,_0x510ba6){_0xcba257=_0xcba257-0x0;var _0x437e65=_0xf0db[_0xcba257];return _0x437e65;};'use strict';var _=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var moment=require('moment');var BPromise=require(_0xbf0d('0x2'));var rs=require(_0xbf0d('0x3'));var fs=require('fs');var Redis=require(_0xbf0d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf0d('0x5'));var logger=require(_0xbf0d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf0d('0x7'));var client=jayson[_0xbf0d('0x8')][_0xbf0d('0x9')]({'port':0x232a});config[_0xbf0d('0xa')]=_['defaults'](config[_0xbf0d('0xa')],{'host':_0xbf0d('0xb'),'port':0x18eb});var socket=require(_0xbf0d('0xc'))(new Redis(config[_0xbf0d('0xa')]));require(_0xbf0d('0xd'))[_0xbf0d('0xe')](socket);function respondWithRpcPromise(_0x154401,_0xb7715f,_0x55cb8f){return new BPromise(function(_0x5a28a3,_0x170113){return client[_0xbf0d('0xf')](_0x154401,_0x55cb8f)[_0xbf0d('0x10')](function(_0x290a56){logger[_0xbf0d('0x11')](_0xbf0d('0x12'),_0xb7715f,_0xbf0d('0x13'));logger[_0xbf0d('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xb7715f,_0xbf0d('0x13'),JSON[_0xbf0d('0x15')](_0x290a56));if(_0x290a56['error']){if(_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x17')]===0x1f4){logger[_0xbf0d('0x16')](_0xbf0d('0x12'),_0xb7715f,_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x18')]);return _0x170113(_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x18')]);}logger[_0xbf0d('0x16')](_0xbf0d('0x12'),_0xb7715f,_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x18')]);return _0x5a28a3(_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x18')]);}else{logger['info'](_0xbf0d('0x12'),_0xb7715f,_0xbf0d('0x13'));_0x5a28a3(_0x290a56[_0xbf0d('0x19')][_0xbf0d('0x18')]);}})[_0xbf0d('0x1a')](function(_0x35166e){logger[_0xbf0d('0x16')]('ChatGroup,\x20%s,\x20%s',_0xb7715f,_0x35166e);_0x170113(_0x35166e);});});}
\ No newline at end of file
+var _0x2123=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','register','request','then'];(function(_0xbc8ef0,_0x1b6933){var _0x53cf0e=function(_0x281982){while(--_0x281982){_0xbc8ef0['push'](_0xbc8ef0['shift']());}};_0x53cf0e(++_0x1b6933);}(_0x2123,0x190));var _0x3212=function(_0x29a1e9,_0xd2ea28){_0x29a1e9=_0x29a1e9-0x0;var _0x224e7f=_0x2123[_0x29a1e9];return _0x224e7f;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var Redis=require(_0x3212('0x5'));var db=require(_0x3212('0x6'))['db'];var utils=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var config=require(_0x3212('0xa'));var jayson=require(_0x3212('0xb'));var client=jayson['client'][_0x3212('0xc')]({'port':0x232a});config[_0x3212('0xd')]=_[_0x3212('0xe')](config['redis'],{'host':_0x3212('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3212('0xd')]));require(_0x3212('0x10'))[_0x3212('0x11')](socket);function respondWithRpcPromise(_0x1db498,_0x54f331,_0x4a46c2){return new BPromise(function(_0x3a1f28,_0xf166c2){return client[_0x3212('0x12')](_0x1db498,_0x4a46c2)[_0x3212('0x13')](function(_0x9c01c3){logger[_0x3212('0x14')](_0x3212('0x15'),_0x54f331,_0x3212('0x16'));logger[_0x3212('0x17')](_0x3212('0x18'),_0x54f331,_0x3212('0x16'),JSON[_0x3212('0x19')](_0x9c01c3));if(_0x9c01c3[_0x3212('0x1a')]){if(_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1b')]===0x1f4){logger[_0x3212('0x1a')](_0x3212('0x15'),_0x54f331,_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1c')]);return _0xf166c2(_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1c')]);}logger[_0x3212('0x1a')]('ChatGroup,\x20%s,\x20%s',_0x54f331,_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1c')]);return _0x3a1f28(_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1c')]);}else{logger[_0x3212('0x14')](_0x3212('0x15'),_0x54f331,_0x3212('0x16'));_0x3a1f28(_0x9c01c3['result']['message']);}})[_0x3212('0x1d')](function(_0x49f5c2){logger[_0x3212('0x1a')](_0x3212('0x15'),_0x54f331,_0x49f5c2);_0xf166c2(_0x49f5c2);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 8187890..0be02eb 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 _0x88c6=['chatGroup:','./chatGroup.events','save','update','emit','length'];(function(_0x23dbc3,_0x22d7ae){var _0x5cb9db=function(_0x2cddf7){while(--_0x2cddf7){_0x23dbc3['push'](_0x23dbc3['shift']());}};_0x5cb9db(++_0x22d7ae);}(_0x88c6,0x121));var _0x688c=function(_0x5d67be,_0x73cb7){_0x5d67be=_0x5d67be-0x0;var _0x4ce27a=_0x88c6[_0x5d67be];return _0x4ce27a;};'use strict';var ChatGroupEvents=require(_0x688c('0x0'));var events=[_0x688c('0x1'),'remove',_0x688c('0x2')];function createListener(_0x28e51d,_0x49dfed){return function(_0x1a0d63){_0x49dfed[_0x688c('0x3')](_0x28e51d,_0x1a0d63);};}function removeListener(_0x5b0225,_0x6b40af){return function(){ChatGroupEvents['removeListener'](_0x5b0225,_0x6b40af);};}exports['register']=function(_0x21f689){for(var _0xbb7e41=0x0,_0x3b6140=events[_0x688c('0x4')];_0xbb7e41<_0x3b6140;_0xbb7e41++){var _0x9c2932=events[_0xbb7e41];var _0x426bb8=createListener(_0x688c('0x5')+_0x9c2932,_0x21f689);ChatGroupEvents['on'](_0x9c2932,_0x426bb8);}};
\ No newline at end of file
+var _0x5e63=['emit','removeListener','register','chatGroup:','./chatGroup.events','remove','update'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x5e63,0x82));var _0x35e6=function(_0x404d14,_0x57e3c3){_0x404d14=_0x404d14-0x0;var _0x134ef5=_0x5e63[_0x404d14];return _0x134ef5;};'use strict';var ChatGroupEvents=require(_0x35e6('0x0'));var events=['save',_0x35e6('0x1'),_0x35e6('0x2')];function createListener(_0x54eac2,_0x46a84b){return function(_0x40cf76){_0x46a84b[_0x35e6('0x3')](_0x54eac2,_0x40cf76);};}function removeListener(_0x2531ae,_0x55b3fa){return function(){ChatGroupEvents[_0x35e6('0x4')](_0x2531ae,_0x55b3fa);};}exports[_0x35e6('0x5')]=function(_0x19617c){for(var _0x2c4833=0x0,_0x4796f1=events['length'];_0x2c4833<_0x4796f1;_0x2c4833++){var _0x23f3a1=events[_0x2c4833];var _0x243fee=createListener(_0x35e6('0x6')+_0x23f3a1,_0x19617c);ChatGroupEvents['on'](_0x23f3a1,_0x243fee);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e9199ce..2c02d70 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 _0xfc14=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','update','delete','removeMembers','multer'];(function(_0x1e2aae,_0x2349e3){var _0x4d8a43=function(_0x305d4c){while(--_0x305d4c){_0x1e2aae['push'](_0x1e2aae['shift']());}};_0x4d8a43(++_0x2349e3);}(_0xfc14,0x8b));var _0x4fc1=function(_0x1a59ba,_0x2b4ec3){_0x1a59ba=_0x1a59ba-0x0;var _0x3b11bb=_0xfc14[_0x1a59ba];return _0x3b11bb;};'use strict';var multer=require(_0x4fc1('0x0'));var util=require('util');var path=require(_0x4fc1('0x1'));var timeout=require(_0x4fc1('0x2'));var express=require(_0x4fc1('0x3'));var router=express[_0x4fc1('0x4')]();var fs_extra=require(_0x4fc1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4fc1('0x6'));var config=require(_0x4fc1('0x7'));var controller=require(_0x4fc1('0x8'));router[_0x4fc1('0x9')]('/',auth['isAuthenticated'](),controller[_0x4fc1('0xa')]);router[_0x4fc1('0x9')](_0x4fc1('0xb'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0xd')]);router['get'](_0x4fc1('0xe'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0xf')]);router[_0x4fc1('0x9')](_0x4fc1('0x10'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x11')]);router[_0x4fc1('0x9')](_0x4fc1('0x12'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x13')]);router[_0x4fc1('0x9')](_0x4fc1('0x14'),auth['isAuthenticated'](),controller['getMessages']);router[_0x4fc1('0x15')]('/',auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x16')]);router[_0x4fc1('0x15')](_0x4fc1('0x12'),auth['isAuthenticated'](),controller[_0x4fc1('0x17')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x4fc1('0x18')]);router['put'](_0x4fc1('0xe'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x19')]);router[_0x4fc1('0x1a')](_0x4fc1('0xe'),auth[_0x4fc1('0xc')](),controller['destroy']);router['delete']('/:id/members',auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x57a5=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put','update','destroy','delete','removeMembers','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x57a5,0x1e6));var _0x557a=function(_0x3d486f,_0x13af81){_0x3d486f=_0x3d486f-0x0;var _0x3af020=_0x57a5[_0x3d486f];return _0x3af020;};'use strict';var multer=require(_0x557a('0x0'));var util=require(_0x557a('0x1'));var path=require(_0x557a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x557a('0x3')]();var fs_extra=require(_0x557a('0x4'));var auth=require(_0x557a('0x5'));var interaction=require(_0x557a('0x6'));var config=require(_0x557a('0x7'));var controller=require(_0x557a('0x8'));router[_0x557a('0x9')]('/',auth[_0x557a('0xa')](),controller[_0x557a('0xb')]);router['get'](_0x557a('0xc'),auth[_0x557a('0xa')](),controller[_0x557a('0xd')]);router[_0x557a('0x9')](_0x557a('0xe'),auth[_0x557a('0xa')](),controller['show']);router['get'](_0x557a('0xf'),auth['isAuthenticated'](),controller[_0x557a('0x10')]);router[_0x557a('0x9')](_0x557a('0x11'),auth[_0x557a('0xa')](),controller[_0x557a('0x12')]);router[_0x557a('0x9')](_0x557a('0x13'),auth[_0x557a('0xa')](),controller['getMessages']);router[_0x557a('0x14')]('/',auth[_0x557a('0xa')](),controller[_0x557a('0x15')]);router[_0x557a('0x14')](_0x557a('0x11'),auth[_0x557a('0xa')](),controller[_0x557a('0x16')]);router['post']('/:id/messages',auth[_0x557a('0xa')](),controller[_0x557a('0x17')]);router[_0x557a('0x18')](_0x557a('0xe'),auth[_0x557a('0xa')](),controller[_0x557a('0x19')]);router['delete'](_0x557a('0xe'),auth[_0x557a('0xa')](),controller[_0x557a('0x1a')]);router[_0x557a('0x1b')](_0x557a('0x11'),auth[_0x557a('0xa')](),controller[_0x557a('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f3e3c40..010ee2f 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 _0x05b6=['thumb','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER','ENUM','star'];(function(_0x4bb12b,_0x5697df){var _0x2baa7c=function(_0x2e7f4e){while(--_0x2e7f4e){_0x4bb12b['push'](_0x4bb12b['shift']());}};_0x2baa7c(++_0x5697df);}(_0x05b6,0x74));var _0x605b=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0x05b6[_0x2eac4f];return _0x58f73b;};'use strict';var Sequelize=require(_0x605b('0x0'));module['exports']={'closed':{'type':Sequelize[_0x605b('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x605b('0x2')]},'ratingType':{'type':Sequelize[_0x605b('0x3')](_0x605b('0x4'),_0x605b('0x5')),'defaultValue':_0x605b('0x4')},'ratingMessage':{'type':Sequelize[_0x605b('0x6')]},'pathTranscript':{'type':Sequelize[_0x605b('0x6')]},'mailTranscript':{'type':Sequelize[_0x605b('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x605b('0x8')]},'disposition':{'type':Sequelize[_0x605b('0x7')]},'secondDisposition':{'type':Sequelize[_0x605b('0x7')]},'thirdDisposition':{'type':Sequelize[_0x605b('0x7')]},'note':{'type':Sequelize[_0x605b('0x7')]},'browserName':{'type':Sequelize[_0x605b('0x7')]},'browserVersion':{'type':Sequelize[_0x605b('0x7')]},'osName':{'type':Sequelize[_0x605b('0x7')]},'osVersion':{'type':Sequelize[_0x605b('0x7')]},'deviceModel':{'type':Sequelize[_0x605b('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x605b('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x605b('0x9'))},'read1stAt':{'type':Sequelize[_0x605b('0x8')]},'lastMsgAt':{'type':Sequelize[_0x605b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x605b('0x3')]('in',_0x605b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x605b('0x7')]},'customerPort':{'type':Sequelize[_0x605b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x605b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x605b('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0102=['TEXT','long','out','exports','BOOLEAN','INTEGER','ENUM','STRING','DATE'];(function(_0x3bed75,_0x2f400f){var _0x2e4147=function(_0x380079){while(--_0x380079){_0x3bed75['push'](_0x3bed75['shift']());}};_0x2e4147(++_0x2f400f);}(_0x0102,0x186));var _0x2010=function(_0xa88fb3,_0x2fd1d2){_0xa88fb3=_0xa88fb3-0x0;var _0x35270a=_0x0102[_0xa88fb3];return _0x35270a;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'closed':{'type':Sequelize[_0x2010('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2010('0x2')]},'ratingType':{'type':Sequelize[_0x2010('0x3')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2010('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2010('0x5')]},'disposition':{'type':Sequelize[_0x2010('0x4')]},'secondDisposition':{'type':Sequelize[_0x2010('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2010('0x4')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x2010('0x4')]},'osName':{'type':Sequelize[_0x2010('0x4')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x2010('0x4')]},'deviceVendor':{'type':Sequelize[_0x2010('0x4')]},'deviceType':{'type':Sequelize[_0x2010('0x4')]},'referer':{'type':Sequelize[_0x2010('0x6')]},'customerIp':{'type':Sequelize[_0x2010('0x4')]},'formData':{'type':Sequelize[_0x2010('0x6')](_0x2010('0x7'))},'read1stAt':{'type':Sequelize[_0x2010('0x5')]},'lastMsgAt':{'type':Sequelize[_0x2010('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2010('0x3')]('in',_0x2010('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2010('0x4')]},'customerPort':{'type':Sequelize[_0x2010('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x2010('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x2010('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 79a3618..549faa8 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 _0x67be=['localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','name','render','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options','create','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','follow','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','attachmentDownload','closed','Attachment','ChatOfflineMessageId','join','offline-chat/','download','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ContactId','length','format','%s%d','agentAlias','System','agentIdentifier','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','sort','where','pick','ChatInteractionId','filter','$gte','rows','getMyMessages','order','includeAgent','push','addTags','setTags','spread','color','emit','chatInteractionTags:save','removeTags','toString','server','tmp','transcript-%d-%s.zip','firstName','read','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerPort','tail','existsSync','createWriteStream','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','defaults','redis'];(function(_0x597fc3,_0x39517c){var _0x2235f4=function(_0x2596f2){while(--_0x2596f2){_0x597fc3['push'](_0x597fc3['shift']());}};_0x2235f4(++_0x39517c);}(_0x67be,0x18a));var _0xe67b=function(_0x40ceb1,_0x970175){_0x40ceb1=_0x40ceb1-0x0;var _0x264e28=_0x67be[_0x40ceb1];return _0x264e28;};'use strict';var rimraf=require(_0xe67b('0x0'));var zipdir=require(_0xe67b('0x1'));var rp=require(_0xe67b('0x2'));var moment=require(_0xe67b('0x3'));var BPromise=require(_0xe67b('0x4'));var Mustache=require(_0xe67b('0x5'));var util=require('util');var path=require(_0xe67b('0x6'));var ejs=require(_0xe67b('0x7'));var fs=require('fs');var _=require(_0xe67b('0x8'));var Redis=require(_0xe67b('0x9'));var interaction=require(_0xe67b('0xa'));var qs=require(_0xe67b('0xb'));var pdf=require(_0xe67b('0xc'));var logger=require('../../config/logger')(_0xe67b('0xd'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xe67b('0xe')](config[_0xe67b('0xf')],{'host':_0xe67b('0x10'),'port':0x18eb});var socket=require(_0xe67b('0x11'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xe67b('0x12')](socket);var jayson=require(_0xe67b('0x13'));var client=jayson['client'][_0xe67b('0x14')]({'port':0x232b});var client9004=jayson[_0xe67b('0x15')][_0xe67b('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x4f9b01,_0x23764d,_0x31b5d2,_0x21eea5){return new BPromise(function(_0x474714,_0x205609){var _0x3da1fd=_0x21eea5||client;return _0x3da1fd[_0xe67b('0x16')](_0x4f9b01,_0x31b5d2)[_0xe67b('0x17')](function(_0x23a583){logger[_0xe67b('0x18')](_0xe67b('0x19'),_0x23764d,_0xe67b('0x1a'));logger[_0xe67b('0x1b')](_0xe67b('0x1c'),_0x23764d,_0xe67b('0x1a'),JSON[_0xe67b('0x1d')](_0x23a583));if(_0x23a583[_0xe67b('0x1e')]){if(_0x23a583[_0xe67b('0x1e')][_0xe67b('0x1f')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x23764d,_0x23a583['error'][_0xe67b('0x20')]);return _0x205609(_0x23a583[_0xe67b('0x1e')][_0xe67b('0x20')]);}logger[_0xe67b('0x1e')](_0xe67b('0x19'),_0x23764d,_0x23a583[_0xe67b('0x1e')][_0xe67b('0x20')]);return _0x474714(_0x23a583[_0xe67b('0x1e')][_0xe67b('0x20')]);}else{logger[_0xe67b('0x18')](_0xe67b('0x19'),_0x23764d,_0xe67b('0x1a'));_0x474714(_0x23a583[_0xe67b('0x21')]['message']);}})[_0xe67b('0x22')](function(_0x124e97){logger[_0xe67b('0x1e')](_0xe67b('0x19'),_0x23764d,_0x124e97);_0x205609(_0x124e97);});});}function respondWithStatusCode(_0x4f0f4b,_0x307518){_0x307518=_0x307518||0xcc;return function(_0x5dca44){if(_0x5dca44){return _0x4f0f4b[_0xe67b('0x23')](_0x307518);}return _0x4f0f4b[_0xe67b('0x24')](_0x307518)[_0xe67b('0x25')]();};}function respondWithResult(_0x5d787b,_0x41e571){_0x41e571=_0x41e571||0xc8;return function(_0x4474e7){if(_0x4474e7){return _0x5d787b['status'](_0x41e571)[_0xe67b('0x26')](_0x4474e7);}};}function respondWithFilteredResult(_0x324cad,_0x1c161f){return function(_0x1ce67f){if(_0x1ce67f){var _0x3ca2a0=typeof _0x1c161f[_0xe67b('0x27')]===_0xe67b('0x28')&&typeof _0x1c161f[_0xe67b('0x29')]===_0xe67b('0x28');var _0x2e6b28=_0x1ce67f[_0xe67b('0x2a')];var _0x241ac4=_0x3ca2a0?0x0:_0x1c161f[_0xe67b('0x27')];var _0x4886cf=_0x3ca2a0?_0x1ce67f[_0xe67b('0x2a')]:_0x1c161f[_0xe67b('0x27')]+_0x1c161f[_0xe67b('0x29')];var _0x856f25;if(_0x4886cf>=_0x2e6b28){_0x4886cf=_0x2e6b28;_0x856f25=0xc8;}else{_0x856f25=0xce;}_0x324cad['status'](_0x856f25);return _0x324cad[_0xe67b('0x2b')](_0xe67b('0x2c'),_0x241ac4+'-'+_0x4886cf+'/'+_0x2e6b28)[_0xe67b('0x26')](_0x1ce67f);}return null;};}function saveUpdates(_0x56b088){return function(_0x1f56fa){if(_0x1f56fa){return _0x1f56fa[_0xe67b('0x2d')](_0x56b088)['then'](function(_0x36d272){return _0x36d272;});}return null;};}function removeEntity(_0x106019){return function(_0x65a1aa){if(_0x65a1aa){return _0x65a1aa['destroy']()[_0xe67b('0x17')](function(){_0x106019[_0xe67b('0x24')](0xcc)[_0xe67b('0x25')]();});}};}function handleEntityNotFound(_0x3125f4){return function(_0x140633){if(!_0x140633){_0x3125f4[_0xe67b('0x23')](0x194);}return _0x140633;};}function handleError(_0x2bf3a7,_0x437b52){_0x437b52=_0x437b52||0x1f4;return function(_0x5dce04){logger[_0xe67b('0x1e')](_0x5dce04['stack']);if(_0x5dce04[_0xe67b('0x2e')]){delete _0x5dce04[_0xe67b('0x2e')];}_0x2bf3a7[_0xe67b('0x24')](_0x437b52)['send'](_0x5dce04);};}function getMustacheRender(_0x4994de,_0x165ce7){return Mustache[_0xe67b('0x2f')](_0x4994de,_['merge'](_0x165ce7[_0xe67b('0x30')],{'contact':_0x165ce7[_0xe67b('0x31')],'message':_0x165ce7[_0xe67b('0x20')],'agent':_0x165ce7[_0xe67b('0x32')],'interaction':_0x165ce7[_0xe67b('0x33')],'account':_0x165ce7[_0xe67b('0x34')]}))||'';}exports[_0xe67b('0x35')]=function(_0x30d40e,_0x2f406d){var _0x99a097={};var _0x9bd45a=_[_0xe67b('0x36')](db[_0xe67b('0x37')][_0xe67b('0x38')],function(_0x56bdcc){return{'name':_0x56bdcc[_0xe67b('0x39')],'type':_0x56bdcc[_0xe67b('0x3a')][_0xe67b('0x3b')]};});_0x99a097=qs[_0xe67b('0x3c')](_0x9bd45a,_0x30d40e);return interaction[_0xe67b('0x3d')](_0xe67b('0x3e'),_0x30d40e[_0xe67b('0x3f')],_0x30d40e[_0xe67b('0x40')],_0x99a097,_0x9bd45a)[_0xe67b('0x17')](respondWithFilteredResult(_0x2f406d,_0x99a097))[_0xe67b('0x22')](handleError(_0x2f406d,null));};exports[_0xe67b('0x41')]=function(_0x3f8447,_0x458bd1){var _0x531932={'raw':![],'where':{'id':_0x3f8447[_0xe67b('0x42')]['id']}},_0x5a2018={};_0x5a2018[_0xe67b('0x43')]=_[_0xe67b('0x44')](db[_0xe67b('0x37')]['rawAttributes']);_0x5a2018['query']=_[_0xe67b('0x44')](_0x3f8447[_0xe67b('0x3f')]);_0x5a2018[_0xe67b('0x45')]=_[_0xe67b('0x46')](_0x5a2018['model'],_0x5a2018[_0xe67b('0x3f')]);_0x531932['attributes']=_['intersection'](_0x5a2018[_0xe67b('0x43')],qs[_0xe67b('0x47')](_0x3f8447[_0xe67b('0x3f')]['fields']));_0x531932[_0xe67b('0x48')]=_0x531932[_0xe67b('0x48')]['length']?_0x531932['attributes']:_0x5a2018[_0xe67b('0x43')];if(_0x3f8447[_0xe67b('0x3f')][_0xe67b('0x49')]){_0x531932[_0xe67b('0x4a')]=[{'all':!![]}];}_0x531932=_[_0xe67b('0x4b')]({},_0x531932,_0x3f8447[_0xe67b('0x4c')]);return db['ChatInteraction']['find'](_0x531932)[_0xe67b('0x17')](handleEntityNotFound(_0x458bd1,null))[_0xe67b('0x17')](respondWithResult(_0x458bd1,null))[_0xe67b('0x22')](handleError(_0x458bd1,null));};exports[_0xe67b('0x4d')]=function(_0x38a67d,_0x29c6f8){return db['ChatInteraction'][_0xe67b('0x4d')](_0x38a67d[_0xe67b('0x30')],{})['then'](respondWithResult(_0x29c6f8,0xc9))['catch'](handleError(_0x29c6f8,null));};exports[_0xe67b('0x2d')]=function(_0x2b1dcb,_0x480197){if(_0x2b1dcb['body']['id']){delete _0x2b1dcb['body']['id'];}return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x2b1dcb['params']['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x480197,null))[_0xe67b('0x17')](saveUpdates(_0x2b1dcb[_0xe67b('0x30')],null))['then'](respondWithResult(_0x480197,null))[_0xe67b('0x22')](handleError(_0x480197,null));};exports[_0xe67b('0x4f')]=function(_0x1a6f03,_0x434e03){return db[_0xe67b('0x37')]['find']({'where':{'id':_0x1a6f03[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x434e03,null))[_0xe67b('0x17')](removeEntity(_0x434e03,null))[_0xe67b('0x22')](handleError(_0x434e03,null));};exports[_0xe67b('0x50')]=function(_0x2e6c0b,_0x27c729){return db[_0xe67b('0x37')][_0xe67b('0x50')]()[_0xe67b('0x17')](respondWithResult(_0x27c729,null))[_0xe67b('0x22')](handleError(_0x27c729,null));};exports[_0xe67b('0x51')]=function(_0x4c5255,_0x1672f7){var _0x22f0c8=_0x4c5255[_0xe67b('0x42')]['id'];var _0x2630f4;var _0x56e46c;var _0x770eed;return db['ChatInteraction'][_0xe67b('0x52')]({'where':{'id':_0x22f0c8}})[_0xe67b('0x17')](function(_0x57529f){_0x2630f4=_0x57529f;return db[_0xe67b('0x53')][_0xe67b('0x52')]({'where':{'id':_0x57529f[_0xe67b('0x54')]},'attributes':['id',_0xe67b('0x55'),_0xe67b('0x56'),_0xe67b('0x57'),_0xe67b('0x58'),_0xe67b('0x59')],'raw':!![]});})[_0xe67b('0x17')](function(_0x2657dc){if(_0x2657dc&&_0x2657dc[_0xe67b('0x55')]&&_0x2657dc[_0xe67b('0x56')]){_0x56e46c=_0x2657dc;var _0x3301a1={'interaction':{'id':_0x22f0c8},'agent':{'id':_0x4c5255[_0xe67b('0x40')]['id'],'name':_0x4c5255[_0xe67b('0x40')][_0xe67b('0x2e')],'fullname':_0x4c5255[_0xe67b('0x40')][_0xe67b('0x5a')],'email':_0x4c5255[_0xe67b('0x40')]['email']},'contact':_0x4c5255['body'][_0xe67b('0x31')],'account':_0x4c5255['body'][_0xe67b('0x34')]};var _0x14f37a={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2657dc[_0xe67b('0x55')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c5255[_0xe67b('0x40')][_0xe67b('0x5b')]],'buttons':null,'topic':_0x56e46c[_0xe67b('0x57')],'note':_['isNull'](_0x56e46c[_0xe67b('0x58')])?null:getMustacheRender(_0x56e46c['vidaooNote'],_0x3301a1),'metadata':null},'redirect':_0xe67b('0x5c'),'json':!![]};try{if(!_[_0xe67b('0x5d')](_0x56e46c[_0xe67b('0x59')])){var _0x4491b8=getMustacheRender(_0x56e46c[_0xe67b('0x59')],_0x3301a1);var _0x443709=JSON[_0xe67b('0x5e')](_0x4491b8);_0x14f37a['body'][_0xe67b('0x5f')]=_0x443709;}}catch(_0x372eaf){throw new db[(_0xe67b('0x60'))][(_0xe67b('0x61'))](_0xe67b('0x62'));}return rp(_0x14f37a);}else{throw new db[(_0xe67b('0x60'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe67b('0x17')](function(_0xf21b79){_0x770eed=_0xf21b79;if(_0x770eed['id']){var _0x2c3a01={'body':_0x770eed[_0xe67b('0x63')],'ChatWebsiteId':_0x56e46c['id'],'ChatInteractionId':_0x2630f4['id'],'direction':_0xe67b('0x64'),'UserId':_0x4c5255[_0xe67b('0x40')]['id']};return db['ChatMessage'][_0xe67b('0x4d')](_0x2c3a01,{});}else{throw new db[(_0xe67b('0x60'))][(_0xe67b('0x61'))](_0xe67b('0x65'));}})[_0xe67b('0x17')](function(){return _0x2630f4[_0xe67b('0x66')]({'vidaooSessionId':_0x770eed['id']});})[_0xe67b('0x17')](respondWithResult(_0x1672f7,null))[_0xe67b('0x22')](handleError(_0x1672f7,null));};exports['customUpdate']=function(_0x227d1f,_0x4fbfef){if(_0x227d1f[_0xe67b('0x30')]['id']){delete _0x227d1f[_0xe67b('0x30')]['id'];}return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x227d1f['params']['id']},'include':[{'model':db[_0xe67b('0x67')],'as':_0xe67b('0x68')}]})[_0xe67b('0x17')](handleEntityNotFound(_0x4fbfef,null))[_0xe67b('0x17')](saveUpdates(_0x227d1f['body'],null))['then'](respondWithResult(_0x4fbfef,null))[_0xe67b('0x22')](handleError(_0x4fbfef,null));};exports['abandon']=function(_0x590270,_0x1267c3){if(_0x590270[_0xe67b('0x30')]['id']){delete _0x590270[_0xe67b('0x30')]['id'];}return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x590270[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](function(_0x40af89){if(!_0x40af89){logger[_0xe67b('0x1e')](_0xe67b('0x69'),'abandon',0x194,_0xe67b('0x6a'));_0x1267c3[_0xe67b('0x23')](0x194);}else{if(_0x40af89[_0xe67b('0x6b')]){throw new db['Sequelize'][(_0xe67b('0x61'))](_0xe67b('0x6c'));}}return _0x40af89;})[_0xe67b('0x17')](function(_0x2a71aa){if(_0x2a71aa){return _0x2a71aa[_0xe67b('0x2d')]({'closed':_0x590270[_0xe67b('0x30')]['closed'],'disposition':_0x590270[_0xe67b('0x30')][_0xe67b('0x6d')]})[_0xe67b('0x17')](function(_0xe2534c){return _0xe2534c;});}})[_0xe67b('0x17')](function(){return respondWithRpcPromise(_0xe67b('0x6e'),_0xe67b('0x6f'),_0x590270[_0xe67b('0x30')],client9004);})['then'](respondWithResult(_0x1267c3,null))['catch'](handleError(_0x1267c3,null));};exports[_0xe67b('0x70')]=function(_0x45a10f,_0x312377){_0x45a10f[_0xe67b('0x30')][_0xe67b('0x2e')]=_0x45a10f[_0xe67b('0x71')][_0xe67b('0x72')];_0x45a10f[_0xe67b('0x30')][_0xe67b('0x73')]=_0x45a10f['file']['filename'];_0x45a10f[_0xe67b('0x30')]['type']=_0x45a10f[_0xe67b('0x71')]['mimetype'];return db['Attachment']['create'](_0x45a10f[_0xe67b('0x30')])[_0xe67b('0x17')](respondWithResult(_0x312377,0xc9))['catch'](handleError(_0x312377,null));};exports[_0xe67b('0x74')]=function(_0x23723d,_0x3c8eaa){return db[_0xe67b('0x37')][_0xe67b('0x52')]({'where':{'id':_0x23723d[_0xe67b('0x42')]['id']},'raw':!![]})[_0xe67b('0x17')](handleEntityNotFound(_0x3c8eaa,null))['then'](function(_0x19dafc){if(_0x19dafc){if(_0x19dafc[_0xe67b('0x75')]){return _0x3c8eaa[_0xe67b('0x24')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xe67b('0x76')][_0xe67b('0x52')]({'where':{'id':_0x23723d[_0xe67b('0x3f')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3c8eaa,null));}})[_0xe67b('0x17')](function(_0x45d39f){if(_0x45d39f){var _0x5f4f56=_0x45d39f[_0xe67b('0x77')]!==null;var _0x50c8cb=path[_0xe67b('0x78')](config['root'],'server/files/attachments/');if(_0x5f4f56){_0x50c8cb=path[_0xe67b('0x78')](_0x50c8cb,_0xe67b('0x79'));}var _0xab5acd=path[_0xe67b('0x78')](_0x50c8cb,_0x45d39f[_0xe67b('0x73')]);return _0x3c8eaa[_0xe67b('0x7a')](_0xab5acd);}})[_0xe67b('0x22')](handleError(_0x3c8eaa,null));};exports[_0xe67b('0x7b')]=function(_0x16d8b7,_0x87bc10){var _0x516450=null;var _0x72bba3=null;var _0x43d47c=null;if(_0x16d8b7['body']['id']){delete _0x16d8b7[_0xe67b('0x30')]['id'];}if(_0x16d8b7[_0xe67b('0x30')][_0xe67b('0x7c')]){_0x43d47c=path[_0xe67b('0x78')](config[_0xe67b('0x7d')],'server/files/chat/upload/',util['format'](_0xe67b('0x7e'),Date[_0xe67b('0x7f')]()));_0x16d8b7['body'][_0xe67b('0x80')]=_0x43d47c;}return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x16d8b7[_0xe67b('0x42')]['id']},'include':[{'model':db[_0xe67b('0x81')],'as':_0xe67b('0x82'),'include':[{'model':db['User'],'as':_0xe67b('0x83')}]}]})[_0xe67b('0x17')](handleEntityNotFound(_0x87bc10,null))[_0xe67b('0x17')](saveUpdates(_0x16d8b7[_0xe67b('0x30')],null))[_0xe67b('0x17')](function(_0x1a348c){if(_0x1a348c){_0x516450=_0x1a348c;return db['ChatWebsite'][_0xe67b('0x4e')]({'where':{'id':_0x516450[_0xe67b('0x54')]}});}})[_0xe67b('0x17')](function(_0x482fd4){if(_0x482fd4){_0x72bba3=_0x482fd4;return db['CmContact'][_0xe67b('0x4e')]({'where':{'id':_0x516450[_0xe67b('0x84')]}});}})[_0xe67b('0x17')](function(_0x4106c7){if(_0x4106c7){if(_0x43d47c){var _0x373f13=null;for(var _0x11a004=0x1;_0x11a004<_0x516450['Messages'][_0xe67b('0x85')];++_0x11a004){_0x373f13=_0x516450[_0xe67b('0x82')][_0x11a004];var _0x5a15f2=_0x373f13['UserId']?util[_0xe67b('0x86')](_0xe67b('0x87'),_0x72bba3[_0xe67b('0x88')],_0x373f13[_0xe67b('0x6b')]):_0xe67b('0x89');var _0x5becfb=_0x16d8b7[_0xe67b('0x30')]['customer']||util[_0xe67b('0x86')](_0xe67b('0x87'),'Visitor',_0x373f13[_0xe67b('0x84')]);switch(_0x72bba3[_0xe67b('0x8a')]){case'website_alias':_0x5a15f2=_0x373f13[_0xe67b('0x6b')]?util[_0xe67b('0x86')]('%s%d',_0x72bba3['agentAlias'],_0x373f13[_0xe67b('0x6b')]):_0xe67b('0x89');break;case _0xe67b('0x8b'):_0x5a15f2=_0x373f13[_0xe67b('0x6b')]?_0x373f13[_0xe67b('0x83')][_0xe67b('0x8c')]||_0x373f13['User'][_0xe67b('0x5a')]:_0xe67b('0x89');break;case'agent_fullname':_0x5a15f2=_0x373f13['UserId']?_0x373f13[_0xe67b('0x83')][_0xe67b('0x5a')]:'System';break;default:_0x5a15f2=_0x373f13[_0xe67b('0x6b')]?util[_0xe67b('0x86')]('%s%d',_0x72bba3[_0xe67b('0x88')],_0x373f13['UserId']):'System';}var _0x1d06c6=util['format'](_0xe67b('0x8d'),moment(_0x373f13[_0xe67b('0x8e')])[_0xe67b('0x86')](_0xe67b('0x8f')),_0x373f13[_0xe67b('0x90')]==='in'?_0x5becfb:_0x5a15f2,_0x373f13[_0xe67b('0x30')]);if(!_0x373f13[_0xe67b('0x91')]){fs[_0xe67b('0x92')](_0x43d47c,_0x1d06c6);}}return db[_0xe67b('0x93')][_0xe67b('0x52')]({'where':{'service':!![]},'include':[{'model':db[_0xe67b('0x94')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xe67b('0x95')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x3b8902){if(!_0x3b8902||!_0x3b8902[_0xe67b('0x96')]||!_0x16d8b7[_0xe67b('0x30')])return _0x516450;var _0x42ef75=_0x3b8902[_0xe67b('0x97')]();return respondWithRpcPromise(_0xe67b('0x98'),'sendMail',{'account':_0x42ef75,'message':{'from':util[_0xe67b('0x86')]('\x22%s\x22\x20<%s>',_0x3b8902[_0xe67b('0x2e')],_0x3b8902[_0xe67b('0x5b')]||_0x3b8902['Smtp'][_0xe67b('0x40')]),'to':_0x16d8b7[_0xe67b('0x30')]['mailTranscript'],'subject':_0xe67b('0x99'),'text':util[_0xe67b('0x86')](_0xe67b('0x9a'),_0x16d8b7['body'][_0xe67b('0x7c')]),'attachments':[{'path':_0x43d47c}]}})[_0xe67b('0x17')](function(){return _0x516450;})[_0xe67b('0x22')](function(_0x25c78b){logger[_0xe67b('0x1e')](_0x25c78b);});})[_0xe67b('0x17')](respondWithStatusCode(_0x87bc10,0xc8))[_0xe67b('0x22')](handleError(_0x87bc10,null));};exports[_0xe67b('0x9b')]=function(_0x55ec55,_0x48a002){return db[_0xe67b('0x81')][_0xe67b('0x4e')]({'where':{'id':_0x55ec55[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x48a002,null))[_0xe67b('0x17')](function(_0x59b165){if(_0x59b165){return _0x59b165[_0xe67b('0x9b')](_0x55ec55[_0xe67b('0x30')]['ids'],_[_0xe67b('0x9c')](_0x55ec55['body'],[_0xe67b('0x9d'),'id'])||{});}})[_0xe67b('0x17')](respondWithResult(_0x48a002,null))['catch'](handleError(_0x48a002,null));};exports[_0xe67b('0x9e')]=function(_0x1be6ed,_0x44f236){var _0x4a304e={'raw':![],'where':{}};var _0x5c959f={};var _0x32fb0b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe67b('0x52')]({'where':{'id':_0x1be6ed['params']['id']}})['then'](handleEntityNotFound(_0x44f236,null))['then'](function(_0x41a12e){if(_0x41a12e){_0x5c959f[_0xe67b('0x43')]=_[_0xe67b('0x44')](db[_0xe67b('0x81')][_0xe67b('0x38')]);_0x5c959f[_0xe67b('0x3f')]=_[_0xe67b('0x44')](_0x1be6ed[_0xe67b('0x3f')]);_0x5c959f['filters']=_[_0xe67b('0x46')](_0x5c959f[_0xe67b('0x43')],_0x5c959f['query']);_0x4a304e[_0xe67b('0x48')]=_['intersection'](_0x5c959f['model'],qs['fields'](_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x47')]));_0x4a304e[_0xe67b('0x48')]=_0x4a304e[_0xe67b('0x48')][_0xe67b('0x85')]?_0x4a304e[_0xe67b('0x48')]:_0x5c959f[_0xe67b('0x43')];if(!_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x9f')]('nolimit')){_0x4a304e[_0xe67b('0x29')]=qs['limit'](_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x29')]);_0x4a304e[_0xe67b('0x27')]=qs['offset'](_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x27')]);}_0x4a304e['order']=qs[_0xe67b('0xa0')](_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0xa0')]);_0x4a304e[_0xe67b('0xa1')]=qs[_0xe67b('0x45')](_[_0xe67b('0xa2')](_0x1be6ed[_0xe67b('0x3f')],_0x5c959f[_0xe67b('0x45')]));_0x4a304e[_0xe67b('0xa1')][_0xe67b('0xa3')]=_0x41a12e['id'];if(_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0xa4')]){_0x4a304e[_0xe67b('0xa1')]=_[_0xe67b('0x4b')](_0x4a304e[_0xe67b('0xa1')],{'$or':_[_0xe67b('0x36')](_0x4a304e[_0xe67b('0x48')],function(_0x595ffd){var _0x351d7f={};_0x351d7f[_0x595ffd]={'$like':'%'+_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0xa4')]+'%'};return _0x351d7f;})});}if(_0x1be6ed[_0xe67b('0x3f')]['$gte']){var _0x3f5218=_0x1be6ed['query'][_0xe67b('0xa5')]['split'](',');var _0x5d1164={};_0x5d1164[_0x3f5218[0x0]]={'$gte':moment(_0x3f5218[0x1])[_0xe67b('0x86')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4a304e[_0xe67b('0xa1')]=_['merge'](_0x4a304e['where'],_0x5d1164);}_0x4a304e=_[_0xe67b('0x4b')]({},_0x4a304e,_0x1be6ed[_0xe67b('0x4c')]);return db[_0xe67b('0x81')][_0xe67b('0x2a')]({'where':_0x4a304e[_0xe67b('0xa1')]})[_0xe67b('0x17')](function(_0x41d5ec){_0x32fb0b[_0xe67b('0x2a')]=_0x41d5ec;if(_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x49')]){_0x4a304e[_0xe67b('0x4a')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4a304e);})['then'](function(_0x5a092b){_0x32fb0b[_0xe67b('0xa6')]=_0x5a092b;return _0x32fb0b;});}})[_0xe67b('0x17')](respondWithFilteredResult(_0x44f236,_0x4a304e))[_0xe67b('0x22')](handleError(_0x44f236,null));};exports[_0xe67b('0xa7')]=function(_0x1f823d,_0x134851){var _0x3cbb89={'where':{}},_0x26d1ab={},_0x7b3cbd={'count':0x0,'rows':[]};return db[_0xe67b('0x37')]['findOne']({'where':{'id':_0x1f823d[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x134851,null))[_0xe67b('0x17')](function(_0x266450){if(_0x266450){_0x26d1ab[_0xe67b('0x43')]=_[_0xe67b('0x44')](db[_0xe67b('0x81')][_0xe67b('0x38')]);_0x26d1ab[_0xe67b('0x3f')]=_[_0xe67b('0x44')](_0x1f823d['query']);_0x26d1ab['filters']=_[_0xe67b('0x46')](_0x26d1ab[_0xe67b('0x43')],_0x26d1ab[_0xe67b('0x3f')]);_0x3cbb89[_0xe67b('0x48')]=_['intersection'](_0x26d1ab[_0xe67b('0x43')],qs[_0xe67b('0x47')](_0x1f823d[_0xe67b('0x3f')]['fields']));_0x3cbb89['attributes']=_0x3cbb89['attributes'][_0xe67b('0x85')]?_0x3cbb89['attributes']:_0x26d1ab['model'];if(!_0x1f823d[_0xe67b('0x3f')][_0xe67b('0x9f')]('nolimit')){_0x3cbb89[_0xe67b('0x29')]=qs[_0xe67b('0x29')](_0x1f823d[_0xe67b('0x3f')]['limit']);_0x3cbb89[_0xe67b('0x27')]=qs[_0xe67b('0x27')](_0x1f823d[_0xe67b('0x3f')][_0xe67b('0x27')]);}_0x3cbb89[_0xe67b('0xa8')]=qs[_0xe67b('0xa0')](_0x1f823d[_0xe67b('0x3f')][_0xe67b('0xa0')]);_0x3cbb89[_0xe67b('0xa1')]=qs[_0xe67b('0x45')](_[_0xe67b('0xa2')](_0x1f823d['query'],_0x26d1ab[_0xe67b('0x45')]));_0x3cbb89[_0xe67b('0xa1')][_0xe67b('0xa3')]=_0x266450['id'];if(_0x1f823d[_0xe67b('0x3f')][_0xe67b('0xa4')]){_0x3cbb89[_0xe67b('0xa1')]=_[_0xe67b('0x4b')](_0x3cbb89[_0xe67b('0xa1')],{'$or':_[_0xe67b('0x36')](_0x3cbb89[_0xe67b('0x48')],function(_0x5b7119){var _0x1eb116={};_0x1eb116[_0x5b7119]={'$like':'%'+_0x1f823d['query'][_0xe67b('0xa4')]+'%'};return _0x1eb116;})});}_0x3cbb89['where']['secret']=![];if(_0x1f823d[_0xe67b('0x3f')]['id']){_0x3cbb89[_0xe67b('0xa1')]['id']={'$gt':_0x1f823d[_0xe67b('0x3f')]['id']};}_0x3cbb89=_[_0xe67b('0x4b')]({},_0x3cbb89,_0x1f823d[_0xe67b('0x4c')]);return db[_0xe67b('0x81')][_0xe67b('0x2a')]({'where':_0x3cbb89[_0xe67b('0xa1')]})[_0xe67b('0x17')](function(_0x398d14){_0x7b3cbd['count']=_0x398d14;_0x3cbb89[_0xe67b('0x4a')]=[];if(_0x1f823d['query'][_0xe67b('0xa9')]){_0x3cbb89[_0xe67b('0x4a')][_0xe67b('0xaa')]({'model':db['User'],'as':_0xe67b('0x83'),'attributes':['id','fullname',_0xe67b('0x8c')]});}if(_0x1f823d[_0xe67b('0x3f')][_0xe67b('0x49')]){_0x3cbb89[_0xe67b('0x4a')]=[{'all':!![]}];}return db[_0xe67b('0x81')][_0xe67b('0x3d')](_0x3cbb89);})['then'](function(_0xf1502e){_0x7b3cbd[_0xe67b('0xa6')]=_0xf1502e;return _0x7b3cbd;});}})['then'](respondWithFilteredResult(_0x134851,_0x3cbb89))[_0xe67b('0x22')](handleError(_0x134851,null));};exports[_0xe67b('0xab')]=function(_0x158724,_0x5ef299){return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x158724[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x5ef299,null))[_0xe67b('0x17')](function(_0x5d25df){if(_0x5d25df){return _0x5d25df[_0xe67b('0xac')](_0x158724[_0xe67b('0x30')][_0xe67b('0x9d')],_[_0xe67b('0x9c')](_0x158724[_0xe67b('0x30')],[_0xe67b('0x9d'),'id'])||{})[_0xe67b('0xad')](function(){return db['Tag']['findAll']({'attributes':['id',_0xe67b('0x2e'),_0xe67b('0xae')],'where':{'id':_0x158724[_0xe67b('0x30')]['ids']}});})[_0xe67b('0x17')](function(_0x385e6a){socket[_0xe67b('0xaf')](_0xe67b('0xb0'),{'id':Number(_0x158724[_0xe67b('0x42')]['id']),'tags':_0x385e6a||[]});return{'id':Number(_0x158724['params']['id']),'tags':_0x385e6a||[]};});}})['then'](respondWithResult(_0x5ef299,null))[_0xe67b('0x22')](handleError(_0x5ef299,null));};exports[_0xe67b('0xb1')]=function(_0x4ef5dd,_0x2f0e4b){return db['ChatInteraction'][_0xe67b('0x4e')]({'where':{'id':_0x4ef5dd[_0xe67b('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f0e4b,null))[_0xe67b('0x17')](function(_0x51423c){if(_0x51423c){return _0x51423c[_0xe67b('0xb1')](_0x4ef5dd['query'][_0xe67b('0x9d')]);}})[_0xe67b('0x17')](respondWithStatusCode(_0x2f0e4b,null))[_0xe67b('0x22')](handleError(_0x2f0e4b,null));};exports[_0xe67b('0x7a')]=function(_0x3ecc1c,_0x1dcdee){var _0x465ee9=moment()['unix']()[_0xe67b('0xb2')]();var _0x50f55e=path[_0xe67b('0x78')](config[_0xe67b('0x7d')],_0xe67b('0xb3'),'files',_0xe67b('0xb4'));var _0x1deb01=path[_0xe67b('0x78')](config[_0xe67b('0x7d')],_0xe67b('0xb3'),'files','attachments');var _0x136dc8=path[_0xe67b('0x78')](_0x50f55e,_0x465ee9);var _0x3802d7=util['format'](_0xe67b('0xb5'),_0x3ecc1c[_0xe67b('0x42')]['id'],_0x465ee9);var _0x5d3803=path[_0xe67b('0x78')](_0x50f55e,_0x3802d7);var _0x42a771=[];_0x42a771['push']({'model':db[_0xe67b('0x83')],'as':_0xe67b('0x83'),'attributes':['id',_0xe67b('0x5a')],'raw':!![]});_0x42a771[_0xe67b('0xaa')]({'model':db[_0xe67b('0x67')],'as':_0xe67b('0x68'),'attributes':['id',_0xe67b('0xb6'),'lastName'],'raw':!![]});if(_0x3ecc1c[_0xe67b('0x3f')]['attachments']){_0x42a771[_0xe67b('0xaa')]({'model':db[_0xe67b('0x76')],'as':'Attachment','raw':!![]});}var _0x4cb3e1=[{'model':db[_0xe67b('0x81')],'as':_0xe67b('0x82'),'attributes':['id',_0xe67b('0x30'),_0xe67b('0x8e'),_0xe67b('0x90'),_0xe67b('0x91'),_0xe67b('0xb7')],'include':_0x42a771}];_0x4cb3e1[_0xe67b('0xaa')]({'model':db['ChatWebsite'],'as':_0xe67b('0xb8'),'attributes':['id','name']});_0x4cb3e1[_0xe67b('0xaa')]({'model':db[_0xe67b('0x83')],'as':_0xe67b('0xb9'),'attributes':['id',_0xe67b('0x5a')]});return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x3ecc1c[_0xe67b('0x42')]['id']},'include':_0x4cb3e1})[_0xe67b('0x17')](handleEntityNotFound(_0x1dcdee,null))[_0xe67b('0x17')](function(_0x4cc105){if(_0x4cc105){var _0x2d89f1=_0x4cc105[_0xe67b('0xba')]({'plain':!![]});fs[_0xe67b('0xbb')](_0x136dc8);var _0x11f602={'channel':_0xe67b('0xbc'),'account':_0x2d89f1[_0xe67b('0xb8')][_0xe67b('0x2e')],'agent':_0x2d89f1[_0xe67b('0xb9')]?_0x2d89f1[_0xe67b('0xb9')][_0xe67b('0x5a')]:_0xe67b('0xbd'),'createdAt':moment(_0x2d89f1[_0xe67b('0x8e')])[_0xe67b('0x86')](_0xe67b('0xbe'))[_0xe67b('0xb2')](),'closedAt':_0x2d89f1[_0xe67b('0x75')]?moment(_0x2d89f1['closedAt'])[_0xe67b('0x86')](_0xe67b('0xbe'))['toString']():'','disposition':_0x2d89f1[_0xe67b('0x6d')],'chatInfo':{'browser':_0x2d89f1[_0xe67b('0xbf')],'os':_0x2d89f1[_0xe67b('0xc0')],'referer':_0x2d89f1[_0xe67b('0xc1')],'customerIp':_0x2d89f1['customerIp'],'customerPort':_0x2d89f1['customerPort']?_0x2d89f1[_0xe67b('0xc2')]:_0xe67b('0xbd')},'messages':_(_0x2d89f1[_0xe67b('0x82')])[_0xe67b('0xc3')]()[_0xe67b('0xa4')]({'secret':![]})['map'](function(_0x35daac){if(_0x35daac[_0xe67b('0x76')]){var _0x37fceb=path['join'](_0x1deb01,_0x35daac['Attachment'][_0xe67b('0x73')]);if(fs[_0xe67b('0xc4')](_0x37fceb)){fs['createReadStream'](_0x37fceb)['pipe'](fs[_0xe67b('0xc5')](path[_0xe67b('0x78')](_0x136dc8,_0x35daac['Attachment'][_0xe67b('0x73')])));}}return{'date':moment(_0x35daac['createdAt'])[_0xe67b('0x86')](_0xe67b('0xbe'))[_0xe67b('0xb2')](),'sender':_0x35daac['direction']===_0xe67b('0x64')?_0x35daac[_0xe67b('0x83')]?_0x35daac['User'][_0xe67b('0x5a')]:_0xe67b('0x89'):_0x35daac[_0xe67b('0x68')][_0xe67b('0xb6')]+(_0x35daac[_0xe67b('0x68')][_0xe67b('0xc6')]?'\x20'+_0x35daac[_0xe67b('0x68')][_0xe67b('0xc6')]:''),'body':_0x35daac[_0xe67b('0x76')]?_0x35daac['Attachment'][_0xe67b('0x73')]:_0x35daac['body'],'direction':_0x35daac[_0xe67b('0x90')]===_0xe67b('0x64')?'A':'C','secret':_0x35daac[_0xe67b('0x91')],'read':_0x35daac[_0xe67b('0xb7')],'attachment':_0x35daac[_0xe67b('0x76')]};})[_0xe67b('0xc7')]()};return ejs[_0xe67b('0xc8')](path[_0xe67b('0x78')](config[_0xe67b('0x7d')],_0xe67b('0xb3'),_0xe67b('0xc9'),_0xe67b('0xca')),{'interaction':_0x11f602})['then'](function(_0x4a2296){var _0xa60784=path[_0xe67b('0x78')](_0x136dc8,_0xe67b('0xcb')+_0x2d89f1['id']+'-'+_0x465ee9+_0xe67b('0xcc'));var _0x4dfcfe={'path':_0xa60784,'channel':'Chat','interactionId':_0x2d89f1['id']};return pdf['createPdfFromHTML'](_0x4a2296,_0x4dfcfe);})[_0xe67b('0x17')](function(){return new Promise(function(_0x4aac29,_0x51044f){zipdir(_0x136dc8,{'saveTo':_0x5d3803},function(_0x355e54,_0x26dafc){if(_0x355e54)return _0x51044f(_0x355e54);return _0x4aac29(_0x26dafc);});})[_0xe67b('0x17')](function(){return new BPromise(function(_0x5607ed,_0x17da85){rimraf(_0x136dc8,function(_0x2506a8){if(_0x2506a8)_0x17da85(_0x2506a8);return _0x5607ed();});});})[_0xe67b('0x17')](function(){return _0x1dcdee[_0xe67b('0x7a')](_0x5d3803,_0x3802d7,function(_0xa0cc4a){if(_0xa0cc4a){logger[_0xe67b('0x1e')]('err',_0xa0cc4a);}else{fs['unlinkSync'](_0x5d3803);}});});});}else{return _0x1dcdee[_0xe67b('0x23')](0xc8);}})[_0xe67b('0x22')](handleError(_0x1dcdee,null));};
\ No newline at end of file
+var _0x72ec=['toString','browserName','osName','referer','customerIp','customerPort','tail','pipe','createWriteStream','value','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','update','then','destroy','name','send','render','body','contact','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','user','show','params','query','intersection','attributes','model','fields','length','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','follow','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','Interaction\x20already\x20assigned','closed','disposition','originalname','basename','file','filename','Attachment','attachmentDownload','json','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','User','CmContact','ContactId','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Smtp','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','keys','filters','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','rows','getMyMessages','order','includeAgent','push','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','server','files','tmp','attachments','firstName','lastName','read','Account','Owner','get','mkdirSync','N.A.'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x72ec,0x1c4));var _0xc72e=function(_0x2866c7,_0x197fdd){_0x2866c7=_0x2866c7-0x0;var _0x3c5db2=_0x72ec[_0x2866c7];return _0x3c5db2;};'use strict';var rimraf=require(_0xc72e('0x0'));var zipdir=require(_0xc72e('0x1'));var rp=require(_0xc72e('0x2'));var moment=require(_0xc72e('0x3'));var BPromise=require(_0xc72e('0x4'));var Mustache=require(_0xc72e('0x5'));var util=require(_0xc72e('0x6'));var path=require(_0xc72e('0x7'));var ejs=require(_0xc72e('0x8'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xc72e('0x9'));var pdf=require(_0xc72e('0xa'));var logger=require('../../config/logger')(_0xc72e('0xb'));var config=require(_0xc72e('0xc'));var db=require(_0xc72e('0xd'))['db'];config['redis']=_[_0xc72e('0xe')](config[_0xc72e('0xf')],{'host':_0xc72e('0x10'),'port':0x18eb});var socket=require(_0xc72e('0x11'))(new Redis(config[_0xc72e('0xf')]));require(_0xc72e('0x12'))[_0xc72e('0x13')](socket);var jayson=require(_0xc72e('0x14'));var client=jayson[_0xc72e('0x15')][_0xc72e('0x16')]({'port':0x232b});var client9004=jayson[_0xc72e('0x15')][_0xc72e('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x3b8f46,_0x5c8fec,_0x3ed9c4,_0x34499c){return new BPromise(function(_0x1560a7,_0x54668e){var _0x1a006c=_0x34499c||client;return _0x1a006c[_0xc72e('0x17')](_0x3b8f46,_0x3ed9c4)['then'](function(_0x439d35){logger[_0xc72e('0x18')](_0xc72e('0x19'),_0x5c8fec,_0xc72e('0x1a'));logger[_0xc72e('0x1b')](_0xc72e('0x1c'),_0x5c8fec,_0xc72e('0x1a'),JSON[_0xc72e('0x1d')](_0x439d35));if(_0x439d35[_0xc72e('0x1e')]){if(_0x439d35[_0xc72e('0x1e')][_0xc72e('0x1f')]===0x1f4){logger[_0xc72e('0x1e')](_0xc72e('0x19'),_0x5c8fec,_0x439d35[_0xc72e('0x1e')]['message']);return _0x54668e(_0x439d35[_0xc72e('0x1e')][_0xc72e('0x20')]);}logger[_0xc72e('0x1e')](_0xc72e('0x19'),_0x5c8fec,_0x439d35[_0xc72e('0x1e')][_0xc72e('0x20')]);return _0x1560a7(_0x439d35['error'][_0xc72e('0x20')]);}else{logger[_0xc72e('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5c8fec,_0xc72e('0x1a'));_0x1560a7(_0x439d35[_0xc72e('0x21')][_0xc72e('0x20')]);}})[_0xc72e('0x22')](function(_0x3132f2){logger[_0xc72e('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x5c8fec,_0x3132f2);_0x54668e(_0x3132f2);});});}function respondWithStatusCode(_0x5d98cf,_0x39b416){_0x39b416=_0x39b416||0xcc;return function(_0x5e838b){if(_0x5e838b){return _0x5d98cf[_0xc72e('0x23')](_0x39b416);}return _0x5d98cf[_0xc72e('0x24')](_0x39b416)[_0xc72e('0x25')]();};}function respondWithResult(_0x59bc30,_0x47b79e){_0x47b79e=_0x47b79e||0xc8;return function(_0x4f1bdd){if(_0x4f1bdd){return _0x59bc30[_0xc72e('0x24')](_0x47b79e)['json'](_0x4f1bdd);}};}function respondWithFilteredResult(_0x25a8f1,_0x42bdce){return function(_0x39c854){if(_0x39c854){var _0x14b9aa=typeof _0x42bdce[_0xc72e('0x26')]===_0xc72e('0x27')&&typeof _0x42bdce[_0xc72e('0x28')]===_0xc72e('0x27');var _0x452f49=_0x39c854[_0xc72e('0x29')];var _0x5e7c54=_0x14b9aa?0x0:_0x42bdce[_0xc72e('0x26')];var _0x371d6c=_0x14b9aa?_0x39c854[_0xc72e('0x29')]:_0x42bdce[_0xc72e('0x26')]+_0x42bdce[_0xc72e('0x28')];var _0x16eed9;if(_0x371d6c>=_0x452f49){_0x371d6c=_0x452f49;_0x16eed9=0xc8;}else{_0x16eed9=0xce;}_0x25a8f1[_0xc72e('0x24')](_0x16eed9);return _0x25a8f1[_0xc72e('0x2a')]('Content-Range',_0x5e7c54+'-'+_0x371d6c+'/'+_0x452f49)['json'](_0x39c854);}return null;};}function saveUpdates(_0x5e6975){return function(_0x52712f){if(_0x52712f){return _0x52712f[_0xc72e('0x2b')](_0x5e6975)[_0xc72e('0x2c')](function(_0x18a1f5){return _0x18a1f5;});}return null;};}function removeEntity(_0x279bc1){return function(_0xfbc08f){if(_0xfbc08f){return _0xfbc08f[_0xc72e('0x2d')]()[_0xc72e('0x2c')](function(){_0x279bc1[_0xc72e('0x24')](0xcc)[_0xc72e('0x25')]();});}};}function handleEntityNotFound(_0x182af9){return function(_0x46a21b){if(!_0x46a21b){_0x182af9[_0xc72e('0x23')](0x194);}return _0x46a21b;};}function handleError(_0x38884c,_0x248c3d){_0x248c3d=_0x248c3d||0x1f4;return function(_0x3c76c6){logger[_0xc72e('0x1e')](_0x3c76c6['stack']);if(_0x3c76c6[_0xc72e('0x2e')]){delete _0x3c76c6[_0xc72e('0x2e')];}_0x38884c['status'](_0x248c3d)[_0xc72e('0x2f')](_0x3c76c6);};}function getMustacheRender(_0x212638,_0x1484c4){return Mustache[_0xc72e('0x30')](_0x212638,_['merge'](_0x1484c4[_0xc72e('0x31')],{'contact':_0x1484c4[_0xc72e('0x32')],'message':_0x1484c4[_0xc72e('0x20')],'agent':_0x1484c4['agent'],'interaction':_0x1484c4[_0xc72e('0x33')],'account':_0x1484c4['account']}))||'';}exports[_0xc72e('0x34')]=function(_0x5c9457,_0x2f58c1){var _0x128f8d={};var _0x5b69ae=_[_0xc72e('0x35')](db[_0xc72e('0x36')][_0xc72e('0x37')],function(_0x468fcb){return{'name':_0x468fcb[_0xc72e('0x38')],'type':_0x468fcb[_0xc72e('0x39')][_0xc72e('0x3a')]};});_0x128f8d=qs[_0xc72e('0x3b')](_0x5b69ae,_0x5c9457);return interaction[_0xc72e('0x3c')](_0xc72e('0x3d'),_0x5c9457['query'],_0x5c9457[_0xc72e('0x3e')],_0x128f8d,_0x5b69ae)[_0xc72e('0x2c')](respondWithFilteredResult(_0x2f58c1,_0x128f8d))[_0xc72e('0x22')](handleError(_0x2f58c1,null));};exports[_0xc72e('0x3f')]=function(_0x317495,_0x3f771f){var _0x487858={'raw':![],'where':{'id':_0x317495[_0xc72e('0x40')]['id']}},_0x446bb1={};_0x446bb1['model']=_['keys'](db['ChatInteraction']['rawAttributes']);_0x446bb1[_0xc72e('0x41')]=_['keys'](_0x317495['query']);_0x446bb1['filters']=_[_0xc72e('0x42')](_0x446bb1['model'],_0x446bb1['query']);_0x487858[_0xc72e('0x43')]=_[_0xc72e('0x42')](_0x446bb1[_0xc72e('0x44')],qs[_0xc72e('0x45')](_0x317495[_0xc72e('0x41')][_0xc72e('0x45')]));_0x487858[_0xc72e('0x43')]=_0x487858[_0xc72e('0x43')][_0xc72e('0x46')]?_0x487858[_0xc72e('0x43')]:_0x446bb1[_0xc72e('0x44')];if(_0x317495[_0xc72e('0x41')][_0xc72e('0x47')]){_0x487858[_0xc72e('0x48')]=[{'all':!![]}];}_0x487858=_['merge']({},_0x487858,_0x317495[_0xc72e('0x49')]);return db[_0xc72e('0x36')][_0xc72e('0x4a')](_0x487858)[_0xc72e('0x2c')](handleEntityNotFound(_0x3f771f,null))[_0xc72e('0x2c')](respondWithResult(_0x3f771f,null))[_0xc72e('0x22')](handleError(_0x3f771f,null));};exports[_0xc72e('0x4b')]=function(_0x1d1b8e,_0x478343){return db[_0xc72e('0x36')][_0xc72e('0x4b')](_0x1d1b8e[_0xc72e('0x31')],{})['then'](respondWithResult(_0x478343,0xc9))['catch'](handleError(_0x478343,null));};exports['update']=function(_0x1bc532,_0x2d81b6){if(_0x1bc532[_0xc72e('0x31')]['id']){delete _0x1bc532[_0xc72e('0x31')]['id'];}return db[_0xc72e('0x36')][_0xc72e('0x4a')]({'where':{'id':_0x1bc532[_0xc72e('0x40')]['id']}})[_0xc72e('0x2c')](handleEntityNotFound(_0x2d81b6,null))[_0xc72e('0x2c')](saveUpdates(_0x1bc532[_0xc72e('0x31')],null))[_0xc72e('0x2c')](respondWithResult(_0x2d81b6,null))[_0xc72e('0x22')](handleError(_0x2d81b6,null));};exports[_0xc72e('0x2d')]=function(_0x14ffb1,_0x42d258){return db['ChatInteraction'][_0xc72e('0x4a')]({'where':{'id':_0x14ffb1[_0xc72e('0x40')]['id']}})[_0xc72e('0x2c')](handleEntityNotFound(_0x42d258,null))['then'](removeEntity(_0x42d258,null))['catch'](handleError(_0x42d258,null));};exports[_0xc72e('0x4c')]=function(_0x4017d9,_0x39f99e){return db[_0xc72e('0x36')][_0xc72e('0x4c')]()[_0xc72e('0x2c')](respondWithResult(_0x39f99e,null))[_0xc72e('0x22')](handleError(_0x39f99e,null));};exports[_0xc72e('0x4d')]=function(_0x54532b,_0x209aca){var _0x58dacd=_0x54532b[_0xc72e('0x40')]['id'];var _0x1b1c83;var _0x3f8a27;var _0x13c262;return db['ChatInteraction'][_0xc72e('0x4e')]({'where':{'id':_0x58dacd}})[_0xc72e('0x2c')](function(_0x270873){_0x1b1c83=_0x270873;return db[_0xc72e('0x4f')]['findOne']({'where':{'id':_0x270873[_0xc72e('0x50')]},'attributes':['id',_0xc72e('0x51'),_0xc72e('0x52'),'vidaooTopic',_0xc72e('0x53'),_0xc72e('0x54')],'raw':!![]});})['then'](function(_0x16f531){if(_0x16f531&&_0x16f531[_0xc72e('0x51')]&&_0x16f531[_0xc72e('0x52')]){_0x3f8a27=_0x16f531;var _0x2d10e0={'interaction':{'id':_0x58dacd},'agent':{'id':_0x54532b[_0xc72e('0x3e')]['id'],'name':_0x54532b[_0xc72e('0x3e')]['name'],'fullname':_0x54532b[_0xc72e('0x3e')][_0xc72e('0x55')],'email':_0x54532b[_0xc72e('0x3e')]['email']},'contact':_0x54532b[_0xc72e('0x31')]['contact'],'account':_0x54532b[_0xc72e('0x31')]['account']};var _0x1baee0={'rejectUnauthorized':![],'method':'POST','url':_0xc72e('0x56'),'headers':{'X-APIKEY':_0x16f531[_0xc72e('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x54532b['user'][_0xc72e('0x57')]],'buttons':null,'topic':_0x3f8a27[_0xc72e('0x58')],'note':_['isNull'](_0x3f8a27['vidaooNote'])?null:getMustacheRender(_0x3f8a27['vidaooNote'],_0x2d10e0),'metadata':null},'redirect':_0xc72e('0x59'),'json':!![]};try{if(!_['isNull'](_0x3f8a27['vidaooMetadata'])){var _0x3e44e4=getMustacheRender(_0x3f8a27[_0xc72e('0x54')],_0x2d10e0);var _0x5b9e64=JSON[_0xc72e('0x5a')](_0x3e44e4);_0x1baee0[_0xc72e('0x31')]['metadata']=_0x5b9e64;}}catch(_0x2a4c1d){throw new db['Sequelize'][(_0xc72e('0x5b'))](_0xc72e('0x5c'));}return rp(_0x1baee0);}else{throw new db[(_0xc72e('0x5d'))][(_0xc72e('0x5b'))](_0xc72e('0x5e'));}})[_0xc72e('0x2c')](function(_0x468810){_0x13c262=_0x468810;if(_0x13c262['id']){var _0x36e83={'body':_0x13c262[_0xc72e('0x5f')],'ChatWebsiteId':_0x3f8a27['id'],'ChatInteractionId':_0x1b1c83['id'],'direction':_0xc72e('0x60'),'UserId':_0x54532b[_0xc72e('0x3e')]['id']};return db['ChatMessage']['create'](_0x36e83,{});}else{throw new db[(_0xc72e('0x5d'))][(_0xc72e('0x5b'))](_0xc72e('0x61'));}})[_0xc72e('0x2c')](function(){return _0x1b1c83[_0xc72e('0x62')]({'vidaooSessionId':_0x13c262['id']});})[_0xc72e('0x2c')](respondWithResult(_0x209aca,null))[_0xc72e('0x22')](handleError(_0x209aca,null));};exports[_0xc72e('0x63')]=function(_0x120077,_0x1f8974){if(_0x120077[_0xc72e('0x31')]['id']){delete _0x120077[_0xc72e('0x31')]['id'];}return db[_0xc72e('0x36')][_0xc72e('0x4a')]({'where':{'id':_0x120077[_0xc72e('0x40')]['id']},'include':[{'model':db['CmContact'],'as':_0xc72e('0x64')}]})[_0xc72e('0x2c')](handleEntityNotFound(_0x1f8974,null))[_0xc72e('0x2c')](saveUpdates(_0x120077['body'],null))['then'](respondWithResult(_0x1f8974,null))[_0xc72e('0x22')](handleError(_0x1f8974,null));};exports['abandon']=function(_0x130aa4,_0x43826e){if(_0x130aa4[_0xc72e('0x31')]['id']){delete _0x130aa4[_0xc72e('0x31')]['id'];}return db['ChatInteraction'][_0xc72e('0x4a')]({'where':{'id':_0x130aa4[_0xc72e('0x40')]['id']}})[_0xc72e('0x2c')](function(_0x488eb9){if(!_0x488eb9){logger['error'](_0xc72e('0x65'),_0xc72e('0x66'),0x194,'entity\x20not\x20found');_0x43826e['sendStatus'](0x194);}else{if(_0x488eb9[_0xc72e('0x67')]){throw new db['Sequelize'][(_0xc72e('0x5b'))](_0xc72e('0x68'));}}return _0x488eb9;})[_0xc72e('0x2c')](function(_0x51d901){if(_0x51d901){return _0x51d901[_0xc72e('0x2b')]({'closed':_0x130aa4[_0xc72e('0x31')][_0xc72e('0x69')],'disposition':_0x130aa4['body'][_0xc72e('0x6a')]})[_0xc72e('0x2c')](function(_0x4a73e2){return _0x4a73e2;});}})[_0xc72e('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x130aa4[_0xc72e('0x31')],client9004);})[_0xc72e('0x2c')](respondWithResult(_0x43826e,null))[_0xc72e('0x22')](handleError(_0x43826e,null));};exports['attachmentUpload']=function(_0x18df6d,_0x1f65ef){_0x18df6d[_0xc72e('0x31')][_0xc72e('0x2e')]=_0x18df6d['file'][_0xc72e('0x6b')];_0x18df6d[_0xc72e('0x31')][_0xc72e('0x6c')]=_0x18df6d[_0xc72e('0x6d')][_0xc72e('0x6e')];_0x18df6d['body'][_0xc72e('0x39')]=_0x18df6d['file']['mimetype'];return db[_0xc72e('0x6f')][_0xc72e('0x4b')](_0x18df6d[_0xc72e('0x31')])[_0xc72e('0x2c')](respondWithResult(_0x1f65ef,0xc9))['catch'](handleError(_0x1f65ef,null));};exports[_0xc72e('0x70')]=function(_0x30af95,_0x2126ef){return db[_0xc72e('0x36')]['findOne']({'where':{'id':_0x30af95[_0xc72e('0x40')]['id']},'raw':!![]})[_0xc72e('0x2c')](handleEntityNotFound(_0x2126ef,null))[_0xc72e('0x2c')](function(_0xf85fa){if(_0xf85fa){if(_0xf85fa[_0xc72e('0x69')]){return _0x2126ef[_0xc72e('0x24')](0x193)[_0xc72e('0x71')]({'status':0x193,'message':'Unauthorized'});}return db[_0xc72e('0x6f')][_0xc72e('0x4e')]({'where':{'id':_0x30af95[_0xc72e('0x41')][_0xc72e('0x72')]},'raw':!![]})[_0xc72e('0x2c')](handleEntityNotFound(_0x2126ef,null));}})[_0xc72e('0x2c')](function(_0x22f548){if(_0x22f548){var _0x4d4368=_0x22f548[_0xc72e('0x73')]!==null;var _0x36f0b5=path[_0xc72e('0x74')](config['root'],_0xc72e('0x75'));if(_0x4d4368){_0x36f0b5=path[_0xc72e('0x74')](_0x36f0b5,_0xc72e('0x76'));}var _0xf34b1d=path[_0xc72e('0x74')](_0x36f0b5,_0x22f548['basename']);return _0x2126ef['download'](_0xf34b1d);}})[_0xc72e('0x22')](handleError(_0x2126ef,null));};exports['close']=function(_0x37ad98,_0x5ef2f1){var _0x443cd7=null;var _0x204e86=null;var _0x4c32f6=null;if(_0x37ad98[_0xc72e('0x31')]['id']){delete _0x37ad98['body']['id'];}if(_0x37ad98['body']['mailTranscript']){_0x4c32f6=path[_0xc72e('0x74')](config[_0xc72e('0x77')],_0xc72e('0x78'),util['format'](_0xc72e('0x79'),Date[_0xc72e('0x7a')]()));_0x37ad98['body'][_0xc72e('0x7b')]=_0x4c32f6;}return db['ChatInteraction']['find']({'where':{'id':_0x37ad98[_0xc72e('0x40')]['id']},'include':[{'model':db[_0xc72e('0x7c')],'as':'Messages','include':[{'model':db[_0xc72e('0x7d')],'as':'User'}]}]})[_0xc72e('0x2c')](handleEntityNotFound(_0x5ef2f1,null))['then'](saveUpdates(_0x37ad98['body'],null))[_0xc72e('0x2c')](function(_0x386296){if(_0x386296){_0x443cd7=_0x386296;return db['ChatWebsite']['find']({'where':{'id':_0x443cd7[_0xc72e('0x50')]}});}})[_0xc72e('0x2c')](function(_0x42b8c4){if(_0x42b8c4){_0x204e86=_0x42b8c4;return db[_0xc72e('0x7e')]['find']({'where':{'id':_0x443cd7[_0xc72e('0x7f')]}});}})[_0xc72e('0x2c')](function(_0x42d79a){if(_0x42d79a){if(_0x4c32f6){var _0xe707c6=null;for(var _0x424b92=0x1;_0x424b92<_0x443cd7[_0xc72e('0x80')][_0xc72e('0x46')];++_0x424b92){_0xe707c6=_0x443cd7[_0xc72e('0x80')][_0x424b92];var _0x311b3a=_0xe707c6[_0xc72e('0x67')]?util[_0xc72e('0x81')](_0xc72e('0x82'),_0x204e86[_0xc72e('0x83')],_0xe707c6['UserId']):_0xc72e('0x84');var _0x28697d=_0x37ad98[_0xc72e('0x31')][_0xc72e('0x85')]||util['format'](_0xc72e('0x82'),_0xc72e('0x86'),_0xe707c6[_0xc72e('0x7f')]);switch(_0x204e86[_0xc72e('0x87')]){case _0xc72e('0x88'):_0x311b3a=_0xe707c6[_0xc72e('0x67')]?util[_0xc72e('0x81')](_0xc72e('0x82'),_0x204e86[_0xc72e('0x83')],_0xe707c6[_0xc72e('0x67')]):_0xc72e('0x84');break;case _0xc72e('0x89'):_0x311b3a=_0xe707c6[_0xc72e('0x67')]?_0xe707c6['User'][_0xc72e('0x8a')]||_0xe707c6[_0xc72e('0x7d')]['fullname']:'System';break;case _0xc72e('0x8b'):_0x311b3a=_0xe707c6[_0xc72e('0x67')]?_0xe707c6[_0xc72e('0x7d')]['fullname']:'System';break;default:_0x311b3a=_0xe707c6[_0xc72e('0x67')]?util[_0xc72e('0x81')](_0xc72e('0x82'),_0x204e86[_0xc72e('0x83')],_0xe707c6[_0xc72e('0x67')]):_0xc72e('0x84');}var _0x561cb8=util['format'](_0xc72e('0x8c'),moment(_0xe707c6[_0xc72e('0x8d')])[_0xc72e('0x81')](_0xc72e('0x8e')),_0xe707c6[_0xc72e('0x8f')]==='in'?_0x28697d:_0x311b3a,_0xe707c6[_0xc72e('0x31')]);if(!_0xe707c6[_0xc72e('0x90')]){fs[_0xc72e('0x91')](_0x4c32f6,_0x561cb8);}}return db[_0xc72e('0x92')][_0xc72e('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0xc72e('0x93')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc72e('0x94')],'as':_0xc72e('0x94'),'raw':!![]}]}]});}}})[_0xc72e('0x2c')](function(_0x2fed86){if(!_0x2fed86||!_0x2fed86['Smtp']||!_0x37ad98['body'])return _0x443cd7;var _0x1ced5e=_0x2fed86[_0xc72e('0x95')]();return respondWithRpcPromise(_0xc72e('0x96'),_0xc72e('0x97'),{'account':_0x1ced5e,'message':{'from':util['format'](_0xc72e('0x98'),_0x2fed86[_0xc72e('0x2e')],_0x2fed86[_0xc72e('0x57')]||_0x2fed86[_0xc72e('0x99')][_0xc72e('0x3e')]),'to':_0x37ad98[_0xc72e('0x31')][_0xc72e('0x9a')],'subject':_0xc72e('0x9b'),'text':util[_0xc72e('0x81')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x37ad98['body'][_0xc72e('0x9a')]),'attachments':[{'path':_0x4c32f6}]}})[_0xc72e('0x2c')](function(){return _0x443cd7;})[_0xc72e('0x22')](function(_0x517976){logger['error'](_0x517976);});})['then'](respondWithStatusCode(_0x5ef2f1,0xc8))['catch'](handleError(_0x5ef2f1,null));};exports['addMessage']=function(_0x4ec23c,_0x283802){return db['ChatMessage'][_0xc72e('0x4a')]({'where':{'id':_0x4ec23c[_0xc72e('0x40')]['id']}})[_0xc72e('0x2c')](handleEntityNotFound(_0x283802,null))['then'](function(_0x5ced47){if(_0x5ced47){return _0x5ced47[_0xc72e('0x9c')](_0x4ec23c[_0xc72e('0x31')][_0xc72e('0x9d')],_[_0xc72e('0x9e')](_0x4ec23c[_0xc72e('0x31')],[_0xc72e('0x9d'),'id'])||{});}})[_0xc72e('0x2c')](respondWithResult(_0x283802,null))['catch'](handleError(_0x283802,null));};exports['getMessages']=function(_0x521c65,_0x14a9db){var _0x337228={'raw':![],'where':{}};var _0x5041d4={};var _0xa562df={'count':0x0,'rows':[]};return db[_0xc72e('0x36')][_0xc72e('0x4e')]({'where':{'id':_0x521c65[_0xc72e('0x40')]['id']}})[_0xc72e('0x2c')](handleEntityNotFound(_0x14a9db,null))[_0xc72e('0x2c')](function(_0x1a6363){if(_0x1a6363){_0x5041d4['model']=_[_0xc72e('0x9f')](db['ChatMessage'][_0xc72e('0x37')]);_0x5041d4[_0xc72e('0x41')]=_['keys'](_0x521c65[_0xc72e('0x41')]);_0x5041d4[_0xc72e('0xa0')]=_[_0xc72e('0x42')](_0x5041d4[_0xc72e('0x44')],_0x5041d4['query']);_0x337228[_0xc72e('0x43')]=_[_0xc72e('0x42')](_0x5041d4[_0xc72e('0x44')],qs['fields'](_0x521c65[_0xc72e('0x41')][_0xc72e('0x45')]));_0x337228[_0xc72e('0x43')]=_0x337228[_0xc72e('0x43')][_0xc72e('0x46')]?_0x337228[_0xc72e('0x43')]:_0x5041d4['model'];if(!_0x521c65['query'][_0xc72e('0xa1')](_0xc72e('0xa2'))){_0x337228[_0xc72e('0x28')]=qs[_0xc72e('0x28')](_0x521c65['query']['limit']);_0x337228[_0xc72e('0x26')]=qs[_0xc72e('0x26')](_0x521c65[_0xc72e('0x41')]['offset']);}_0x337228['order']=qs['sort'](_0x521c65[_0xc72e('0x41')][_0xc72e('0xa3')]);_0x337228[_0xc72e('0xa4')]=qs[_0xc72e('0xa0')](_[_0xc72e('0xa5')](_0x521c65['query'],_0x5041d4[_0xc72e('0xa0')]));_0x337228[_0xc72e('0xa4')][_0xc72e('0xa6')]=_0x1a6363['id'];if(_0x521c65[_0xc72e('0x41')][_0xc72e('0xa7')]){_0x337228['where']=_['merge'](_0x337228[_0xc72e('0xa4')],{'$or':_['map'](_0x337228[_0xc72e('0x43')],function(_0x541f81){var _0x50090c={};_0x50090c[_0x541f81]={'$like':'%'+_0x521c65['query']['filter']+'%'};return _0x50090c;})});}if(_0x521c65[_0xc72e('0x41')][_0xc72e('0xa8')]){var _0x5eadc1=_0x521c65['query'][_0xc72e('0xa8')][_0xc72e('0xa9')](',');var _0x4801dc={};_0x4801dc[_0x5eadc1[0x0]]={'$gte':moment(_0x5eadc1[0x1])['format'](_0xc72e('0xaa'))};_0x337228[_0xc72e('0xa4')]=_['merge'](_0x337228[_0xc72e('0xa4')],_0x4801dc);}_0x337228=_[_0xc72e('0xab')]({},_0x337228,_0x521c65['options']);return db['ChatMessage'][_0xc72e('0x29')]({'where':_0x337228[_0xc72e('0xa4')]})[_0xc72e('0x2c')](function(_0x2ac4c3){_0xa562df[_0xc72e('0x29')]=_0x2ac4c3;if(_0x521c65[_0xc72e('0x41')]['includeAll']){_0x337228[_0xc72e('0x48')]=[{'all':!![]}];}return db[_0xc72e('0x7c')][_0xc72e('0x3c')](_0x337228);})[_0xc72e('0x2c')](function(_0x475732){_0xa562df[_0xc72e('0xac')]=_0x475732;return _0xa562df;});}})['then'](respondWithFilteredResult(_0x14a9db,_0x337228))['catch'](handleError(_0x14a9db,null));};exports[_0xc72e('0xad')]=function(_0x78c2ca,_0x16125){var _0x538e90={'where':{}},_0x2bbabc={},_0x1f0293={'count':0x0,'rows':[]};return db[_0xc72e('0x36')][_0xc72e('0x4e')]({'where':{'id':_0x78c2ca[_0xc72e('0x40')]['id']}})[_0xc72e('0x2c')](handleEntityNotFound(_0x16125,null))[_0xc72e('0x2c')](function(_0x594c5a){if(_0x594c5a){_0x2bbabc['model']=_[_0xc72e('0x9f')](db[_0xc72e('0x7c')][_0xc72e('0x37')]);_0x2bbabc['query']=_['keys'](_0x78c2ca[_0xc72e('0x41')]);_0x2bbabc['filters']=_[_0xc72e('0x42')](_0x2bbabc[_0xc72e('0x44')],_0x2bbabc['query']);_0x538e90[_0xc72e('0x43')]=_[_0xc72e('0x42')](_0x2bbabc[_0xc72e('0x44')],qs['fields'](_0x78c2ca[_0xc72e('0x41')][_0xc72e('0x45')]));_0x538e90['attributes']=_0x538e90[_0xc72e('0x43')][_0xc72e('0x46')]?_0x538e90['attributes']:_0x2bbabc[_0xc72e('0x44')];if(!_0x78c2ca[_0xc72e('0x41')][_0xc72e('0xa1')](_0xc72e('0xa2'))){_0x538e90[_0xc72e('0x28')]=qs['limit'](_0x78c2ca['query'][_0xc72e('0x28')]);_0x538e90[_0xc72e('0x26')]=qs[_0xc72e('0x26')](_0x78c2ca[_0xc72e('0x41')][_0xc72e('0x26')]);}_0x538e90[_0xc72e('0xae')]=qs[_0xc72e('0xa3')](_0x78c2ca[_0xc72e('0x41')]['sort']);_0x538e90[_0xc72e('0xa4')]=qs['filters'](_[_0xc72e('0xa5')](_0x78c2ca[_0xc72e('0x41')],_0x2bbabc[_0xc72e('0xa0')]));_0x538e90[_0xc72e('0xa4')][_0xc72e('0xa6')]=_0x594c5a['id'];if(_0x78c2ca['query'][_0xc72e('0xa7')]){_0x538e90[_0xc72e('0xa4')]=_[_0xc72e('0xab')](_0x538e90['where'],{'$or':_[_0xc72e('0x35')](_0x538e90[_0xc72e('0x43')],function(_0x592f95){var _0x104c11={};_0x104c11[_0x592f95]={'$like':'%'+_0x78c2ca[_0xc72e('0x41')]['filter']+'%'};return _0x104c11;})});}_0x538e90['where'][_0xc72e('0x90')]=![];if(_0x78c2ca['query']['id']){_0x538e90[_0xc72e('0xa4')]['id']={'$gt':_0x78c2ca[_0xc72e('0x41')]['id']};}_0x538e90=_[_0xc72e('0xab')]({},_0x538e90,_0x78c2ca['options']);return db[_0xc72e('0x7c')][_0xc72e('0x29')]({'where':_0x538e90['where']})[_0xc72e('0x2c')](function(_0x310e58){_0x1f0293[_0xc72e('0x29')]=_0x310e58;_0x538e90['include']=[];if(_0x78c2ca[_0xc72e('0x41')][_0xc72e('0xaf')]){_0x538e90['include'][_0xc72e('0xb0')]({'model':db['User'],'as':_0xc72e('0x7d'),'attributes':['id',_0xc72e('0x55'),_0xc72e('0x8a')]});}if(_0x78c2ca[_0xc72e('0x41')][_0xc72e('0x47')]){_0x538e90[_0xc72e('0x48')]=[{'all':!![]}];}return db[_0xc72e('0x7c')][_0xc72e('0x3c')](_0x538e90);})['then'](function(_0x59fa38){_0x1f0293['rows']=_0x59fa38;return _0x1f0293;});}})['then'](respondWithFilteredResult(_0x16125,_0x538e90))['catch'](handleError(_0x16125,null));};exports[_0xc72e('0xb1')]=function(_0x335d37,_0x36f961){return db[_0xc72e('0x36')][_0xc72e('0x4a')]({'where':{'id':_0x335d37[_0xc72e('0x40')]['id']}})[_0xc72e('0x2c')](handleEntityNotFound(_0x36f961,null))[_0xc72e('0x2c')](function(_0x350016){if(_0x350016){return _0x350016[_0xc72e('0xb2')](_0x335d37[_0xc72e('0x31')][_0xc72e('0x9d')],_[_0xc72e('0x9e')](_0x335d37[_0xc72e('0x31')],[_0xc72e('0x9d'),'id'])||{})[_0xc72e('0xb3')](function(){return db[_0xc72e('0xb4')]['findAll']({'attributes':['id',_0xc72e('0x2e'),_0xc72e('0xb5')],'where':{'id':_0x335d37[_0xc72e('0x31')][_0xc72e('0x9d')]}});})[_0xc72e('0x2c')](function(_0xba54c7){socket[_0xc72e('0xb6')](_0xc72e('0xb7'),{'id':Number(_0x335d37[_0xc72e('0x40')]['id']),'tags':_0xba54c7||[]});return{'id':Number(_0x335d37[_0xc72e('0x40')]['id']),'tags':_0xba54c7||[]};});}})[_0xc72e('0x2c')](respondWithResult(_0x36f961,null))[_0xc72e('0x22')](handleError(_0x36f961,null));};exports['removeTags']=function(_0x1f1d3f,_0x354a25){return db[_0xc72e('0x36')][_0xc72e('0x4a')]({'where':{'id':_0x1f1d3f[_0xc72e('0x40')]['id']}})[_0xc72e('0x2c')](handleEntityNotFound(_0x354a25,null))[_0xc72e('0x2c')](function(_0x47c653){if(_0x47c653){return _0x47c653[_0xc72e('0xb8')](_0x1f1d3f[_0xc72e('0x41')][_0xc72e('0x9d')]);}})['then'](respondWithStatusCode(_0x354a25,null))['catch'](handleError(_0x354a25,null));};exports[_0xc72e('0xb9')]=function(_0x28f8fe,_0x1133f2){var _0x163024=moment()[_0xc72e('0xba')]()['toString']();var _0x2ea989=path['join'](config[_0xc72e('0x77')],_0xc72e('0xbb'),_0xc72e('0xbc'),_0xc72e('0xbd'));var _0x1b8186=path['join'](config[_0xc72e('0x77')],_0xc72e('0xbb'),_0xc72e('0xbc'),_0xc72e('0xbe'));var _0x2a2962=path[_0xc72e('0x74')](_0x2ea989,_0x163024);var _0x1eb7ec=util[_0xc72e('0x81')]('transcript-%d-%s.zip',_0x28f8fe[_0xc72e('0x40')]['id'],_0x163024);var _0x1824cb=path['join'](_0x2ea989,_0x1eb7ec);var _0x3869fb=[];_0x3869fb[_0xc72e('0xb0')]({'model':db['User'],'as':_0xc72e('0x7d'),'attributes':['id',_0xc72e('0x55')],'raw':!![]});_0x3869fb[_0xc72e('0xb0')]({'model':db[_0xc72e('0x7e')],'as':_0xc72e('0x64'),'attributes':['id',_0xc72e('0xbf'),_0xc72e('0xc0')],'raw':!![]});if(_0x28f8fe[_0xc72e('0x41')][_0xc72e('0xbe')]){_0x3869fb[_0xc72e('0xb0')]({'model':db[_0xc72e('0x6f')],'as':_0xc72e('0x6f'),'raw':!![]});}var _0x7d3c8a=[{'model':db[_0xc72e('0x7c')],'as':_0xc72e('0x80'),'attributes':['id',_0xc72e('0x31'),_0xc72e('0x8d'),'direction',_0xc72e('0x90'),_0xc72e('0xc1')],'include':_0x3869fb}];_0x7d3c8a[_0xc72e('0xb0')]({'model':db[_0xc72e('0x4f')],'as':_0xc72e('0xc2'),'attributes':['id',_0xc72e('0x2e')]});_0x7d3c8a[_0xc72e('0xb0')]({'model':db['User'],'as':_0xc72e('0xc3'),'attributes':['id','fullname']});return db[_0xc72e('0x36')][_0xc72e('0x4a')]({'where':{'id':_0x28f8fe[_0xc72e('0x40')]['id']},'include':_0x7d3c8a})[_0xc72e('0x2c')](handleEntityNotFound(_0x1133f2,null))['then'](function(_0x3f5967){if(_0x3f5967){var _0x36ca76=_0x3f5967[_0xc72e('0xc4')]({'plain':!![]});fs[_0xc72e('0xc5')](_0x2a2962);var _0x1b8a73={'channel':'Chat','account':_0x36ca76[_0xc72e('0xc2')][_0xc72e('0x2e')],'agent':_0x36ca76[_0xc72e('0xc3')]?_0x36ca76['Owner'][_0xc72e('0x55')]:_0xc72e('0xc6'),'createdAt':moment(_0x36ca76[_0xc72e('0x8d')])[_0xc72e('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc72e('0xc7')](),'closedAt':_0x36ca76['closed']?moment(_0x36ca76['closedAt'])[_0xc72e('0x81')](_0xc72e('0xaa'))[_0xc72e('0xc7')]():'','disposition':_0x36ca76['disposition'],'chatInfo':{'browser':_0x36ca76[_0xc72e('0xc8')],'os':_0x36ca76[_0xc72e('0xc9')],'referer':_0x36ca76[_0xc72e('0xca')],'customerIp':_0x36ca76[_0xc72e('0xcb')],'customerPort':_0x36ca76[_0xc72e('0xcc')]?_0x36ca76[_0xc72e('0xcc')]:_0xc72e('0xc6')},'messages':_(_0x36ca76['Messages'])[_0xc72e('0xcd')]()[_0xc72e('0xa7')]({'secret':![]})[_0xc72e('0x35')](function(_0x7f8130){if(_0x7f8130[_0xc72e('0x6f')]){var _0x18aa85=path['join'](_0x1b8186,_0x7f8130['Attachment']['basename']);if(fs['existsSync'](_0x18aa85)){fs['createReadStream'](_0x18aa85)[_0xc72e('0xce')](fs[_0xc72e('0xcf')](path['join'](_0x2a2962,_0x7f8130['Attachment'][_0xc72e('0x6c')])));}}return{'date':moment(_0x7f8130['createdAt'])[_0xc72e('0x81')](_0xc72e('0xaa'))[_0xc72e('0xc7')](),'sender':_0x7f8130[_0xc72e('0x8f')]===_0xc72e('0x60')?_0x7f8130[_0xc72e('0x7d')]?_0x7f8130[_0xc72e('0x7d')]['fullname']:'System':_0x7f8130[_0xc72e('0x64')][_0xc72e('0xbf')]+(_0x7f8130[_0xc72e('0x64')][_0xc72e('0xc0')]?'\x20'+_0x7f8130[_0xc72e('0x64')][_0xc72e('0xc0')]:''),'body':_0x7f8130[_0xc72e('0x6f')]?_0x7f8130[_0xc72e('0x6f')]['basename']:_0x7f8130[_0xc72e('0x31')],'direction':_0x7f8130[_0xc72e('0x8f')]==='out'?'A':'C','secret':_0x7f8130['secret'],'read':_0x7f8130['read'],'attachment':_0x7f8130[_0xc72e('0x6f')]};})[_0xc72e('0xd0')]()};return ejs['renderFile'](path[_0xc72e('0x74')](config['root'],_0xc72e('0xbb'),_0xc72e('0xd1'),_0xc72e('0xd2')),{'interaction':_0x1b8a73})[_0xc72e('0x2c')](function(_0x2cc4a7){var _0x1c26e4=path['join'](_0x2a2962,_0xc72e('0xd3')+_0x36ca76['id']+'-'+_0x163024+_0xc72e('0xd4'));var _0x13df14={'path':_0x1c26e4,'channel':_0xc72e('0xd5'),'interactionId':_0x36ca76['id']};return pdf[_0xc72e('0xd6')](_0x2cc4a7,_0x13df14);})[_0xc72e('0x2c')](function(){return new Promise(function(_0x18a7b6,_0x37970b){zipdir(_0x2a2962,{'saveTo':_0x1824cb},function(_0x590356,_0x4eecf2){if(_0x590356)return _0x37970b(_0x590356);return _0x18a7b6(_0x4eecf2);});})['then'](function(){return new BPromise(function(_0x126b74,_0x3ac68c){rimraf(_0x2a2962,function(_0x1e863f){if(_0x1e863f)_0x3ac68c(_0x1e863f);return _0x126b74();});});})[_0xc72e('0x2c')](function(){return _0x1133f2[_0xc72e('0xb9')](_0x1824cb,_0x1eb7ec,function(_0x31aa74){if(_0x31aa74){logger[_0xc72e('0x1e')](_0xc72e('0xd7'),_0x31aa74);}else{fs[_0xc72e('0xd8')](_0x1824cb);}});});});}else{return _0x1133f2[_0xc72e('0x23')](0xc8);}})[_0xc72e('0x22')](handleError(_0x1133f2,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 42191ca..07c8e16 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 _0x7d05=['hook','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x1ac393,_0x52793d){var _0x2b54b2=function(_0x3e4bf0){while(--_0x3e4bf0){_0x1ac393['push'](_0x1ac393['shift']());}};_0x2b54b2(++_0x52793d);}(_0x7d05,0x1d1));var _0x57d0=function(_0x4d75a1,_0x45002a){_0x4d75a1=_0x4d75a1-0x0;var _0x18f98b=_0x7d05[_0x4d75a1];return _0x18f98b;};'use strict';var EventEmitter=require(_0x57d0('0x0'));var ChatInteraction=require(_0x57d0('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x57d0('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x57d0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x57d0('0x4'),'afterDestroy':_0x57d0('0x5')};function emitEvent(_0x30f090){return function(_0xf12a98,_0x4abb2a,_0x57b082){_0xf12a98['getUsers']({'attributes':['id'],'raw':!![]})[_0x57d0('0x6')](function(_0x3e8c72){_0xf12a98[_0x57d0('0x7')](_0x57d0('0x8'),_0x3e8c72[_0x57d0('0x9')](function(_0x569f46){return{'id':_0x569f46['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xf12a98['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57d0('0x6')](function(_0x49cbca){_0xf12a98[_0x57d0('0x7')](_0x57d0('0xa'),_0x49cbca[_0x57d0('0xb')]);ChatInteractionEvents[_0x57d0('0xc')](_0x30f090+':'+_0xf12a98['id'],_0xf12a98);ChatInteractionEvents['emit'](_0x30f090,_0xf12a98);_0x57b082(null);})[_0x57d0('0xd')](_0x57b082(null));};}for(var e in events){if(events[_0x57d0('0xe')](e)){var event=events[e];ChatInteraction[_0x57d0('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x91b9=['exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch'];(function(_0x264dec,_0x590e22){var _0x2f12f5=function(_0x3d516d){while(--_0x3d516d){_0x264dec['push'](_0x264dec['shift']());}};_0x2f12f5(++_0x590e22);}(_0x91b9,0x11e));var _0x991b=function(_0x3e3aca,_0xfb5e0b){_0x3e3aca=_0x3e3aca-0x0;var _0x5d1fdb=_0x91b9[_0x3e3aca];return _0x5d1fdb;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x991b('0x0'))['db'][_0x991b('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x991b('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x991b('0x3')](0x0);var events={'afterCreate':_0x991b('0x4'),'afterUpdate':_0x991b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x32235a){return function(_0x229dd6,_0x3f6d00,_0x5b62ed){_0x229dd6['getUsers']({'attributes':['id'],'raw':!![]})[_0x991b('0x6')](function(_0x11f56e){_0x229dd6[_0x991b('0x7')](_0x991b('0x8'),_0x11f56e[_0x991b('0x9')](function(_0x167dbf){return{'id':_0x167dbf['id']};}));return ChatMessage[_0x991b('0xa')]({'where':{'ChatInteractionId':_0x229dd6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x991b('0x6')](function(_0x18a194){_0x229dd6[_0x991b('0x7')](_0x991b('0xb'),_0x18a194['length']);ChatInteractionEvents[_0x991b('0xc')](_0x32235a+':'+_0x229dd6['id'],_0x229dd6);ChatInteractionEvents[_0x991b('0xc')](_0x32235a,_0x229dd6);_0x5b62ed(null);})[_0x991b('0xd')](_0x5b62ed(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x991b('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 03cdcf6..c11e7f6 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 _0x3fa1=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','format'];(function(_0x44f12f,_0x3f3957){var _0x34d474=function(_0x368f02){while(--_0x368f02){_0x44f12f['push'](_0x44f12f['shift']());}};_0x34d474(++_0x3f3957);}(_0x3fa1,0x157));var _0x13fa=function(_0x12cb90,_0xdab1f9){_0x12cb90=_0x12cb90-0x0;var _0x952309=_0x3fa1[_0x12cb90];return _0x952309;};'use strict';var _=require(_0x13fa('0x0'));var util=require(_0x13fa('0x1'));var logger=require(_0x13fa('0x2'))(_0x13fa('0x3'));var moment=require(_0x13fa('0x4'));var BPromise=require('bluebird');var rp=require(_0x13fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x13fa('0x6'));var config=require(_0x13fa('0x7'));var attributes=require(_0x13fa('0x8'));module[_0x13fa('0x9')]=function(_0x3fb8e7,_0x53ba1b){return _0x3fb8e7[_0x13fa('0xa')](_0x13fa('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56d61e,_0x388311,_0x1d1fa4){if(_0x56d61e[_0x13fa('0xc')]('closed')){_0x56d61e['closedAt']=moment()[_0x13fa('0xd')](_0x13fa('0xe'));}_0x1d1fa4(null,_0x56d61e);}},'charset':_0x13fa('0xf'),'collate':_0x13fa('0x10')});};
\ No newline at end of file
+var _0x763b=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed'];(function(_0x3f6a3f,_0x18b175){var _0x56dd76=function(_0xc1868a){while(--_0xc1868a){_0x3f6a3f['push'](_0x3f6a3f['shift']());}};_0x56dd76(++_0x18b175);}(_0x763b,0x16a));var _0xb763=function(_0x37b775,_0x23e4ce){_0x37b775=_0x37b775-0x0;var _0x294c0c=_0x763b[_0x37b775];return _0x294c0c;};'use strict';var _=require('lodash');var util=require(_0xb763('0x0'));var logger=require(_0xb763('0x1'))('api');var moment=require(_0xb763('0x2'));var BPromise=require('bluebird');var rp=require(_0xb763('0x3'));var fs=require('fs');var path=require(_0xb763('0x4'));var rimraf=require(_0xb763('0x5'));var config=require(_0xb763('0x6'));var attributes=require(_0xb763('0x7'));module[_0xb763('0x8')]=function(_0x4f0829,_0x2e6a99){return _0x4f0829[_0xb763('0x9')](_0xb763('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14bcd5,_0x527a0f,_0x35a6a0){if(_0x14bcd5[_0xb763('0xb')]('closed')){_0x14bcd5[_0xb763('0xc')]=moment()[_0xb763('0xd')](_0xb763('0xe'));}_0x35a6a0(null,_0x14bcd5);}},'charset':_0xb763('0xf'),'collate':_0xb763('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 476915d..0ec0c69 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 _0xfba1=['info','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','then','stringify','ChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfba1,0xa2));var _0x1fba=function(_0x2063de,_0x286428){_0x2063de=_0x2063de-0x0;var _0x43343c=_0xfba1[_0x2063de];return _0x43343c;};'use strict';var _=require(_0x1fba('0x0'));var util=require('util');var moment=require(_0x1fba('0x1'));var BPromise=require('bluebird');var rs=require(_0x1fba('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fba('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1fba('0x4'));var config=require(_0x1fba('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1fba('0x6')]['http']({'port':0x232a});config[_0x1fba('0x7')]=_[_0x1fba('0x8')](config[_0x1fba('0x7')],{'host':_0x1fba('0x9'),'port':0x18eb});var socket=require(_0x1fba('0xa'))(new Redis(config[_0x1fba('0x7')]));require('./chatInteraction.socket')[_0x1fba('0xb')](socket);function respondWithRpcPromise(_0x8e64ef,_0x3a3a63,_0xd6987b){return new BPromise(function(_0xabba60,_0x4f36bc){return client['request'](_0x8e64ef,_0xd6987b)['then'](function(_0x1e9b5b){logger['info'](_0x1fba('0xc'),_0x3a3a63,_0x1fba('0xd'));logger[_0x1fba('0xe')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3a3a63,_0x1fba('0xd'),JSON['stringify'](_0x1e9b5b));if(_0x1e9b5b[_0x1fba('0xf')]){if(_0x1e9b5b['error'][_0x1fba('0x10')]===0x1f4){logger['error'](_0x1fba('0xc'),_0x3a3a63,_0x1e9b5b[_0x1fba('0xf')]['message']);return _0x4f36bc(_0x1e9b5b['error']['message']);}logger[_0x1fba('0xf')](_0x1fba('0xc'),_0x3a3a63,_0x1e9b5b[_0x1fba('0xf')][_0x1fba('0x11')]);return _0xabba60(_0x1e9b5b[_0x1fba('0xf')][_0x1fba('0x11')]);}else{logger[_0x1fba('0x12')](_0x1fba('0xc'),_0x3a3a63,_0x1fba('0xd'));_0xabba60(_0x1e9b5b['result'][_0x1fba('0x11')]);}})[_0x1fba('0x13')](function(_0x31b2fb){logger[_0x1fba('0xf')](_0x1fba('0xc'),_0x3a3a63,_0x31b2fb);_0x4f36bc(_0x31b2fb);});});}exports[_0x1fba('0x14')]=function(_0x30aaa8){var _0x366159=this;return new Promise(function(_0x43fa42,_0x19a412){return db['ChatInteraction'][_0x1fba('0x15')](_0x30aaa8['body'],{'raw':_0x30aaa8[_0x1fba('0x16')]?_0x30aaa8['options'][_0x1fba('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30aaa8[_0x1fba('0x16')]?_0x30aaa8['options'][_0x1fba('0x18')]||null:null,'attributes':_0x30aaa8[_0x1fba('0x16')]?_0x30aaa8['options'][_0x1fba('0x19')]||null:null,'limit':_0x30aaa8[_0x1fba('0x16')]?_0x30aaa8[_0x1fba('0x16')][_0x1fba('0x1a')]||null:null})[_0x1fba('0x1b')](function(_0x6bad22){logger[_0x1fba('0x12')]('UpdateChatInteraction',_0x30aaa8);logger['debug'](_0x1fba('0x14'),_0x30aaa8,JSON[_0x1fba('0x1c')](_0x6bad22));_0x43fa42(_0x6bad22);})[_0x1fba('0x13')](function(_0x47ab48){logger[_0x1fba('0xf')](_0x1fba('0x14'),_0x47ab48[_0x1fba('0x11')],_0x30aaa8);_0x19a412(_0x366159[_0x1fba('0xf')](0x1f4,_0x47ab48[_0x1fba('0x11')]));});});};exports['AddTagsToChatInteraction']=function(_0x392460){return new Promise(function(_0x16f9ec,_0x5008de){return db[_0x1fba('0x1d')][_0x1fba('0x1e')]({'where':_0x392460[_0x1fba('0x16')]?_0x392460[_0x1fba('0x16')][_0x1fba('0x18')]||null:null})[_0x1fba('0x1b')](function(_0x3db7a9){if(_0x3db7a9){return _0x3db7a9[_0x1fba('0x1f')](_0x392460['body'][_0x1fba('0x20')],_[_0x1fba('0x21')](_0x392460['body'],[_0x1fba('0x20'),'id'])||{});}})[_0x1fba('0x22')](function(_0x3ddc72){logger[_0x1fba('0x12')]('AddTags',_0x392460);logger[_0x1fba('0xe')]('AddTags',_0x392460,JSON['stringify'](_0x3ddc72));_0x16f9ec(_0x3ddc72);})[_0x1fba('0x13')](function(_0x2211dd){logger[_0x1fba('0xf')](_0x1fba('0x23'),_0x2211dd['message'],_0x392460);_0x5008de(_this[_0x1fba('0xf')](0x1f4,_0x2211dd[_0x1fba('0x11')]));});});};
\ No newline at end of file
+var _0xc38b=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateChatInteraction','body','options','raw','attributes','then','stringify','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x8f8ec1,_0x528d07){var _0x4b597f=function(_0x1ae59a){while(--_0x1ae59a){_0x8f8ec1['push'](_0x8f8ec1['shift']());}};_0x4b597f(++_0x528d07);}(_0xc38b,0x117));var _0xbc38=function(_0xc76abe,_0x591c5f){_0xc76abe=_0xc76abe-0x0;var _0x357205=_0xc38b[_0xc76abe];return _0x357205;};'use strict';var _=require(_0xbc38('0x0'));var util=require(_0xbc38('0x1'));var moment=require(_0xbc38('0x2'));var BPromise=require(_0xbc38('0x3'));var rs=require(_0xbc38('0x4'));var fs=require('fs');var Redis=require(_0xbc38('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc38('0x6'));var logger=require('../../config/logger')(_0xbc38('0x7'));var config=require('../../config/environment');var jayson=require(_0xbc38('0x8'));var client=jayson['client'][_0xbc38('0x9')]({'port':0x232a});config[_0xbc38('0xa')]=_[_0xbc38('0xb')](config[_0xbc38('0xa')],{'host':_0xbc38('0xc'),'port':0x18eb});var socket=require(_0xbc38('0xd'))(new Redis(config[_0xbc38('0xa')]));require(_0xbc38('0xe'))[_0xbc38('0xf')](socket);function respondWithRpcPromise(_0x3420f7,_0x631b01,_0x4d2fae){return new BPromise(function(_0x33a721,_0x4fd634){return client[_0xbc38('0x10')](_0x3420f7,_0x4d2fae)['then'](function(_0x58e559){logger[_0xbc38('0x11')](_0xbc38('0x12'),_0x631b01,_0xbc38('0x13'));logger[_0xbc38('0x14')](_0xbc38('0x15'),_0x631b01,'request\x20sent',JSON['stringify'](_0x58e559));if(_0x58e559[_0xbc38('0x16')]){if(_0x58e559[_0xbc38('0x16')][_0xbc38('0x17')]===0x1f4){logger[_0xbc38('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x631b01,_0x58e559['error']['message']);return _0x4fd634(_0x58e559[_0xbc38('0x16')][_0xbc38('0x18')]);}logger[_0xbc38('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x631b01,_0x58e559['error'][_0xbc38('0x18')]);return _0x33a721(_0x58e559[_0xbc38('0x16')][_0xbc38('0x18')]);}else{logger[_0xbc38('0x11')](_0xbc38('0x12'),_0x631b01,_0xbc38('0x13'));_0x33a721(_0x58e559['result']['message']);}})[_0xbc38('0x19')](function(_0x14cba6){logger[_0xbc38('0x16')](_0xbc38('0x12'),_0x631b01,_0x14cba6);_0x4fd634(_0x14cba6);});});}exports[_0xbc38('0x1a')]=function(_0x535cd4){var _0x4a409a=this;return new Promise(function(_0xa9faf9,_0x467eb4){return db['ChatInteraction']['update'](_0x535cd4[_0xbc38('0x1b')],{'raw':_0x535cd4[_0xbc38('0x1c')]?_0x535cd4['options'][_0xbc38('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x535cd4[_0xbc38('0x1c')]?_0x535cd4['options']['where']||null:null,'attributes':_0x535cd4['options']?_0x535cd4[_0xbc38('0x1c')][_0xbc38('0x1e')]||null:null,'limit':_0x535cd4[_0xbc38('0x1c')]?_0x535cd4[_0xbc38('0x1c')]['limit']||null:null})[_0xbc38('0x1f')](function(_0x5cede0){logger['info']('UpdateChatInteraction',_0x535cd4);logger[_0xbc38('0x14')]('UpdateChatInteraction',_0x535cd4,JSON[_0xbc38('0x20')](_0x5cede0));_0xa9faf9(_0x5cede0);})['catch'](function(_0x696135){logger['error'](_0xbc38('0x1a'),_0x696135[_0xbc38('0x18')],_0x535cd4);_0x467eb4(_0x4a409a['error'](0x1f4,_0x696135[_0xbc38('0x18')]));});});};exports[_0xbc38('0x21')]=function(_0x4c421d){return new Promise(function(_0x1062f6,_0x11ca8f){return db['ChatInteraction'][_0xbc38('0x22')]({'where':_0x4c421d[_0xbc38('0x1c')]?_0x4c421d['options'][_0xbc38('0x23')]||null:null})[_0xbc38('0x1f')](function(_0x2729c4){if(_0x2729c4){return _0x2729c4[_0xbc38('0x24')](_0x4c421d[_0xbc38('0x1b')][_0xbc38('0x25')],_[_0xbc38('0x26')](_0x4c421d[_0xbc38('0x1b')],['ids','id'])||{});}})[_0xbc38('0x27')](function(_0x1f0e8b){logger['info']('AddTags',_0x4c421d);logger[_0xbc38('0x14')](_0xbc38('0x28'),_0x4c421d,JSON['stringify'](_0x1f0e8b));_0x1062f6(_0x1f0e8b);})[_0xbc38('0x19')](function(_0x151d68){logger[_0xbc38('0x16')](_0xbc38('0x28'),_0x151d68[_0xbc38('0x18')],_0x4c421d);_0x11ca8f(_this[_0xbc38('0x16')](0x1f4,_0x151d68[_0xbc38('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 51acad3..9fa8250 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 _0x3094=['chatInteraction:','save','remove','update','emit','register','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3094,0x86));var _0x4309=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3094[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x4309('0x0'),_0x4309('0x1'),_0x4309('0x2')];function createListener(_0x56a160,_0x1e0048){return function(_0x50d54a){_0x1e0048[_0x4309('0x3')](_0x56a160,_0x50d54a);};}function removeListener(_0x101588,_0x297793){return function(){ChatInteractionEvents['removeListener'](_0x101588,_0x297793);};}exports[_0x4309('0x4')]=function(_0x43c338){for(var _0x5da01b=0x0,_0x3567d1=events[_0x4309('0x5')];_0x5da01b<_0x3567d1;_0x5da01b++){var _0x3b143f=events[_0x5da01b];var _0x5a19f6=createListener(_0x4309('0x6')+_0x3b143f,_0x43c338);ChatInteractionEvents['on'](_0x3b143f,_0x5a19f6);}};
\ No newline at end of file
+var _0xd164=['emit','register','length','chatInteraction:','save','remove','update'];(function(_0x12ce17,_0xf357c4){var _0x297ca7=function(_0x7e9da){while(--_0x7e9da){_0x12ce17['push'](_0x12ce17['shift']());}};_0x297ca7(++_0xf357c4);}(_0xd164,0x9e));var _0x4d16=function(_0x98e357,_0x277878){_0x98e357=_0x98e357-0x0;var _0x294235=_0xd164[_0x98e357];return _0x294235;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x4d16('0x0'),_0x4d16('0x1'),_0x4d16('0x2')];function createListener(_0x4ce4b3,_0x4f9f43){return function(_0x42d8c8){_0x4f9f43[_0x4d16('0x3')](_0x4ce4b3,_0x42d8c8);};}function removeListener(_0x581ae6,_0xf13764){return function(){ChatInteractionEvents['removeListener'](_0x581ae6,_0xf13764);};}exports[_0x4d16('0x4')]=function(_0x1f7c27){for(var _0x49bd1e=0x0,_0x5d373c=events[_0x4d16('0x5')];_0x49bd1e<_0x5d373c;_0x49bd1e++){var _0x3b076c=events[_0x49bd1e];var _0x1d57e3=createListener(_0x4d16('0x6')+_0x3b076c,_0x1f7c27);ChatInteractionEvents['on'](_0x3b076c,_0x1d57e3);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 0963a31..1dde760 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 _0xf43a=['/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','isChatInteractionAuthorized','addMessage','/:id/tags','chat','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','/:id','tracked','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages'];(function(_0x44f16a,_0x43f134){var _0x2cc20f=function(_0x1e851c){while(--_0x1e851c){_0x44f16a['push'](_0x44f16a['shift']());}};_0x2cc20f(++_0x43f134);}(_0xf43a,0xc1));var _0xaf43=function(_0x4fab70,_0x520a86){_0x4fab70=_0x4fab70-0x0;var _0x322528=_0xf43a[_0x4fab70];return _0x322528;};'use strict';var multer=require('multer');var util=require(_0xaf43('0x0'));var path=require(_0xaf43('0x1'));var timeout=require(_0xaf43('0x2'));var express=require(_0xaf43('0x3'));var router=express[_0xaf43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaf43('0x5'));var interaction=require(_0xaf43('0x6'));var config=require(_0xaf43('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaf43('0x8')]);router[_0xaf43('0x9')](_0xaf43('0xa'),auth[_0xaf43('0xb')](),controller[_0xaf43('0xc')]);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller[_0xaf43('0xd')]);router[_0xaf43('0x9')](_0xaf43('0xe'),auth['isChatInteractionAuthorized'](),controller[_0xaf43('0xf')]);router[_0xaf43('0x9')](_0xaf43('0x10'),auth[_0xaf43('0xb')](),controller[_0xaf43('0x11')]);router[_0xaf43('0x9')](_0xaf43('0x12'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0xaf43('0x13'),auth[_0xaf43('0xb')](),controller[_0xaf43('0x14')]);router['post']('/',auth[_0xaf43('0xb')](),controller['create']);router[_0xaf43('0x15')](_0xaf43('0x16'),auth[_0xaf43('0xb')](),controller[_0xaf43('0x17')]);var upload=multer({'storage':multer[_0xaf43('0x18')]({'destination':function(_0x49e88b,_0x36a117,_0x5d686e){_0x5d686e(null,path[_0xaf43('0x19')](config[_0xaf43('0x1a')],_0xaf43('0x1b')));},'filename':function(_0x24091b,_0x550a38,_0x1cdd9d){_0x1cdd9d(null,util[_0xaf43('0x1c')](_0xaf43('0x1d'),Date[_0xaf43('0x1e')](),_0x550a38[_0xaf43('0x1f')][_0xaf43('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xaf43('0x15')](_0xaf43('0x21'),upload['single'](_0xaf43('0x22')),controller['attachmentUpload']);router[_0xaf43('0x15')](_0xaf43('0x10'),auth[_0xaf43('0x23')](),controller[_0xaf43('0x24')]);router[_0xaf43('0x15')](_0xaf43('0x25'),auth[_0xaf43('0xb')](),interaction['tracked'](_0xaf43('0x26'),'chatinteraction:addtags'),controller[_0xaf43('0x27')]);router[_0xaf43('0x28')]('/:id',auth[_0xaf43('0xb')](),interaction['tracked'](_0xaf43('0x26'),_0xaf43('0x29')),controller['update']);router['put'](_0xaf43('0x2a'),controller[_0xaf43('0x2b')]);router['put'](_0xaf43('0x2c'),auth[_0xaf43('0x23')](),controller[_0xaf43('0x2d')]);router[_0xaf43('0x28')](_0xaf43('0x2e'),controller['close']);router[_0xaf43('0x2f')](_0xaf43('0x30'),auth[_0xaf43('0xb')](),interaction[_0xaf43('0x31')](_0xaf43('0x26'),'chatinteraction:destroy'),controller[_0xaf43('0x32')]);router[_0xaf43('0x2f')](_0xaf43('0x25'),auth[_0xaf43('0xb')](),controller[_0xaf43('0x33')]);module[_0xaf43('0x34')]=router;
\ No newline at end of file
+var _0x2172=['./chatInteraction.controller','get','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMyMessages','download','create','createVidaooSession','join','root','format','%s-%s','now','originalname','post','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','update','put','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x52e753,_0x2530b7){var _0x5ba199=function(_0x1560fe){while(--_0x1560fe){_0x52e753['push'](_0x52e753['shift']());}};_0x5ba199(++_0x2530b7);}(_0x2172,0x135));var _0x2217=function(_0x22faa8,_0x4c7e08){_0x22faa8=_0x22faa8-0x0;var _0x3ab8b5=_0x2172[_0x22faa8];return _0x3ab8b5;};'use strict';var multer=require(_0x2217('0x0'));var util=require(_0x2217('0x1'));var path=require('path');var timeout=require(_0x2217('0x2'));var express=require(_0x2217('0x3'));var router=express[_0x2217('0x4')]();var fs_extra=require(_0x2217('0x5'));var auth=require(_0x2217('0x6'));var interaction=require(_0x2217('0x7'));var config=require(_0x2217('0x8'));var controller=require(_0x2217('0x9'));router[_0x2217('0xa')]('/',auth['isAuthenticated'](),controller[_0x2217('0xb')]);router[_0x2217('0xa')](_0x2217('0xc'),auth['isAuthenticated'](),controller[_0x2217('0xd')]);router[_0x2217('0xa')](_0x2217('0xe'),auth[_0x2217('0xf')](),controller[_0x2217('0x10')]);router[_0x2217('0xa')](_0x2217('0x11'),auth[_0x2217('0xf')](),controller[_0x2217('0x12')]);router[_0x2217('0xa')](_0x2217('0x13'),auth[_0x2217('0x14')](),controller['getMessages']);router[_0x2217('0xa')]('/:id/my_messages',auth[_0x2217('0xf')](),controller[_0x2217('0x15')]);router['get']('/:id/download',auth[_0x2217('0x14')](),controller[_0x2217('0x16')]);router['post']('/',auth[_0x2217('0x14')](),controller[_0x2217('0x17')]);router['post']('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x2217('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f3e43,_0x1cff97,_0x2520a0){_0x2520a0(null,path[_0x2217('0x19')](config[_0x2217('0x1a')],'server/files/attachments/'));},'filename':function(_0x234981,_0x1a913e,_0x4b039e){_0x4b039e(null,util[_0x2217('0x1b')](_0x2217('0x1c'),Date[_0x2217('0x1d')](),_0x1a913e[_0x2217('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2217('0x1f')](_0x2217('0x20'),upload[_0x2217('0x21')](_0x2217('0x22')),controller[_0x2217('0x23')]);router[_0x2217('0x1f')](_0x2217('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x2217('0x24')]);router[_0x2217('0x1f')](_0x2217('0x25'),auth[_0x2217('0x14')](),interaction[_0x2217('0x26')](_0x2217('0x27'),_0x2217('0x28')),controller[_0x2217('0x29')]);router['put'](_0x2217('0xe'),auth[_0x2217('0x14')](),interaction[_0x2217('0x26')](_0x2217('0x27'),'chatinteraction:update'),controller[_0x2217('0x2a')]);router[_0x2217('0x2b')]('/:id/custom_update',controller[_0x2217('0x2c')]);router['put'](_0x2217('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0x2217('0x2e')]);router[_0x2217('0x2b')]('/:id/close',controller[_0x2217('0x2f')]);router[_0x2217('0x30')]('/:id',auth[_0x2217('0x14')](),interaction['tracked'](_0x2217('0x27'),_0x2217('0x31')),controller[_0x2217('0x32')]);router[_0x2217('0x30')](_0x2217('0x25'),auth[_0x2217('0x14')](),controller[_0x2217('0x33')]);module[_0x2217('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index ff727dc..2c33501 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 _0x20c3=['sequelize','exports','INTEGER'];(function(_0x41aa24,_0xe3bb56){var _0x3a758a=function(_0x2d00e2){while(--_0x2d00e2){_0x41aa24['push'](_0x41aa24['shift']());}};_0x3a758a(++_0xe3bb56);}(_0x20c3,0x189));var _0x320c=function(_0x5d51d2,_0x286a78){_0x5d51d2=_0x5d51d2-0x0;var _0x2c63f1=_0x20c3[_0x5d51d2];return _0x2c63f1;};'use strict';var Sequelize=require(_0x320c('0x0'));module[_0x320c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x320c('0x2')]}};
\ No newline at end of file
+var _0x783f=['exports','medium','BOOLEAN','sequelize'];(function(_0x34ba87,_0x15bf07){var _0x4cfc86=function(_0x34d7e0){while(--_0x34d7e0){_0x34ba87['push'](_0x34ba87['shift']());}};_0x4cfc86(++_0x15bf07);}(_0x783f,0xd3));var _0xf783=function(_0x5b1050,_0x3bfd6b){_0x5b1050=_0x5b1050-0x0;var _0x24f8e0=_0x783f[_0x5b1050];return _0x24f8e0;};'use strict';var Sequelize=require(_0xf783('0x0'));module[_0xf783('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf783('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf783('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 98ceffb..a00ddaa 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 _0x9f12=['error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','where','pick','map','filter','merge','options','count','includeAll','include','catch','show','params','intersection','find','create','body','get','createdAt','lastMessage','lastMessageAt','format','getUsers','findAll','agent','admin','user','fullname','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','role','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','then','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f12,0x17a));var _0x29f1=function(_0x27671f,_0x449b6a){_0x27671f=_0x27671f-0x0;var _0x523bbf=_0x9f12[_0x27671f];return _0x523bbf;};'use strict';var emlformat=require(_0x29f1('0x0'));var rimraf=require(_0x29f1('0x1'));var zipdir=require(_0x29f1('0x2'));var jsonpatch=require(_0x29f1('0x3'));var rp=require(_0x29f1('0x4'));var moment=require(_0x29f1('0x5'));var BPromise=require(_0x29f1('0x6'));var Mustache=require(_0x29f1('0x7'));var util=require(_0x29f1('0x8'));var path=require(_0x29f1('0x9'));var sox=require(_0x29f1('0xa'));var csv=require(_0x29f1('0xb'));var ejs=require(_0x29f1('0xc'));var fs=require('fs');var fs_extra=require(_0x29f1('0xd'));var _=require(_0x29f1('0xe'));var squel=require('squel');var crypto=require(_0x29f1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x29f1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x29f1('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x29f1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f1('0x13'));var logger=require('../../config/logger')(_0x29f1('0x14'));var utils=require(_0x29f1('0x15'));var config=require(_0x29f1('0x16'));var licenseUtil=require(_0x29f1('0x17'));var db=require(_0x29f1('0x18'))['db'];config[_0x29f1('0x19')]=_[_0x29f1('0x1a')](config[_0x29f1('0x19')],{'host':_0x29f1('0x1b'),'port':0x18eb});var socket=require(_0x29f1('0x1c'))(new Redis(config[_0x29f1('0x19')]));require('./chatInternalMessage.socket')[_0x29f1('0x1d')](socket);function respondWithStatusCode(_0x7c5689,_0x15da5e){_0x15da5e=_0x15da5e||0xcc;return function(_0x443a7a){if(_0x443a7a){return _0x7c5689['sendStatus'](_0x15da5e);}return _0x7c5689[_0x29f1('0x1e')](_0x15da5e)[_0x29f1('0x1f')]();};}function respondWithResult(_0x343a37,_0x245ee0){_0x245ee0=_0x245ee0||0xc8;return function(_0x4baa6a){if(_0x4baa6a){return _0x343a37['status'](_0x245ee0)[_0x29f1('0x20')](_0x4baa6a);}};}function respondWithFilteredResult(_0x4d105d,_0x372150){return function(_0x3254bc){if(_0x3254bc){var _0xaa4e4a=typeof _0x372150[_0x29f1('0x21')]===_0x29f1('0x22')&&typeof _0x372150[_0x29f1('0x23')]===_0x29f1('0x22');var _0x35aeec=_0x3254bc['count'];var _0x4cf485=_0xaa4e4a?0x0:_0x372150['offset'];var _0x1145de=_0xaa4e4a?_0x3254bc['count']:_0x372150[_0x29f1('0x21')]+_0x372150['limit'];var _0x27f285;if(_0x1145de>=_0x35aeec){_0x1145de=_0x35aeec;_0x27f285=0xc8;}else{_0x27f285=0xce;}_0x4d105d[_0x29f1('0x1e')](_0x27f285);return _0x4d105d[_0x29f1('0x24')](_0x29f1('0x25'),_0x4cf485+'-'+_0x1145de+'/'+_0x35aeec)['json'](_0x3254bc);}return null;};}function patchUpdates(_0x2cf7bc){return function(_0x49c954){try{jsonpatch['apply'](_0x49c954,_0x2cf7bc,!![]);}catch(_0x525281){return BPromise['reject'](_0x525281);}return _0x49c954['save']();};}function saveUpdates(_0xc98c27,_0x14f171){return function(_0xe75ebc){if(_0xe75ebc){return _0xe75ebc[_0x29f1('0x26')](_0xc98c27)['then'](function(_0x30f253){return _0x30f253;});}return null;};}function removeEntity(_0x314994,_0x377f71){return function(_0xadc58c){if(_0xadc58c){return _0xadc58c[_0x29f1('0x27')]()[_0x29f1('0x28')](function(){_0x314994[_0x29f1('0x1e')](0xcc)[_0x29f1('0x1f')]();});}};}function handleEntityNotFound(_0x15a4ba,_0x9c97c3){return function(_0x5b3bf4){if(!_0x5b3bf4){_0x15a4ba[_0x29f1('0x29')](0x194);}return _0x5b3bf4;};}function handleError(_0x36f687,_0x2808fc){_0x2808fc=_0x2808fc||0x1f4;return function(_0x3dd314){logger[_0x29f1('0x2a')](_0x3dd314[_0x29f1('0x2b')]);if(_0x3dd314[_0x29f1('0x2c')]){delete _0x3dd314[_0x29f1('0x2c')];}_0x36f687[_0x29f1('0x1e')](_0x2808fc)[_0x29f1('0x2d')](_0x3dd314);};}exports['index']=function(_0x5bab33,_0x26825e){var _0xdc1ebf={},_0x3afed4={},_0x93d8bb={'count':0x0,'rows':[]};var _0x46fcf9=_['map'](db[_0x29f1('0x2e')][_0x29f1('0x2f')],function(_0x457e4e){return{'name':_0x457e4e[_0x29f1('0x30')],'type':_0x457e4e[_0x29f1('0x31')]['key']};});_0x3afed4[_0x29f1('0x32')]=_['map'](_0x46fcf9,_0x29f1('0x2c'));_0x3afed4[_0x29f1('0x33')]=_[_0x29f1('0x34')](_0x5bab33[_0x29f1('0x33')]);_0x3afed4[_0x29f1('0x35')]=_['intersection'](_0x3afed4[_0x29f1('0x32')],_0x3afed4[_0x29f1('0x33')]);_0xdc1ebf[_0x29f1('0x36')]=_['intersection'](_0x3afed4[_0x29f1('0x32')],qs[_0x29f1('0x37')](_0x5bab33[_0x29f1('0x33')][_0x29f1('0x37')]));_0xdc1ebf[_0x29f1('0x36')]=_0xdc1ebf[_0x29f1('0x36')][_0x29f1('0x38')]?_0xdc1ebf[_0x29f1('0x36')]:_0x3afed4[_0x29f1('0x32')];if(!_0x5bab33[_0x29f1('0x33')][_0x29f1('0x39')]('nolimit')){_0xdc1ebf['limit']=qs[_0x29f1('0x23')](_0x5bab33['query'][_0x29f1('0x23')]);_0xdc1ebf[_0x29f1('0x21')]=qs[_0x29f1('0x21')](_0x5bab33[_0x29f1('0x33')][_0x29f1('0x21')]);}_0xdc1ebf[_0x29f1('0x3a')]=qs['sort'](_0x5bab33['query']['sort']);_0xdc1ebf[_0x29f1('0x3b')]=qs[_0x29f1('0x35')](_[_0x29f1('0x3c')](_0x5bab33[_0x29f1('0x33')],_0x3afed4[_0x29f1('0x35')]),_0x46fcf9);if(_0x5bab33['query']['filter']){_0xdc1ebf[_0x29f1('0x3b')]=_['merge'](_0xdc1ebf[_0x29f1('0x3b')],{'$or':_[_0x29f1('0x3d')](_0x46fcf9,function(_0x4304e9){if(_0x4304e9[_0x29f1('0x31')]!=='VIRTUAL'){var _0x8f4057={};_0x8f4057[_0x4304e9['name']]={'$like':'%'+_0x5bab33[_0x29f1('0x33')][_0x29f1('0x3e')]+'%'};return _0x8f4057;}})});}_0xdc1ebf=_[_0x29f1('0x3f')]({},_0xdc1ebf,_0x5bab33[_0x29f1('0x40')]);var _0x15a4a2={'where':_0xdc1ebf[_0x29f1('0x3b')]};return db[_0x29f1('0x2e')][_0x29f1('0x41')](_0x15a4a2)['then'](function(_0x45f571){_0x93d8bb['count']=_0x45f571;if(_0x5bab33[_0x29f1('0x33')][_0x29f1('0x42')]){_0xdc1ebf[_0x29f1('0x43')]=[{'all':!![]}];}return db[_0x29f1('0x2e')]['findAll'](_0xdc1ebf);})[_0x29f1('0x28')](function(_0x536ebd){_0x93d8bb['rows']=_0x536ebd;return _0x93d8bb;})[_0x29f1('0x28')](respondWithFilteredResult(_0x26825e,_0xdc1ebf))[_0x29f1('0x44')](handleError(_0x26825e,null));};exports[_0x29f1('0x45')]=function(_0x38f7d8,_0xc4f756){var _0x51dcc1={'raw':!![],'where':{'id':_0x38f7d8[_0x29f1('0x46')]['id']}},_0x428111={};_0x428111[_0x29f1('0x32')]=_[_0x29f1('0x34')](db[_0x29f1('0x2e')][_0x29f1('0x2f')]);_0x428111[_0x29f1('0x33')]=_[_0x29f1('0x34')](_0x38f7d8[_0x29f1('0x33')]);_0x428111['filters']=_[_0x29f1('0x47')](_0x428111[_0x29f1('0x32')],_0x428111[_0x29f1('0x33')]);_0x51dcc1[_0x29f1('0x36')]=_[_0x29f1('0x47')](_0x428111[_0x29f1('0x32')],qs[_0x29f1('0x37')](_0x38f7d8['query'][_0x29f1('0x37')]));_0x51dcc1[_0x29f1('0x36')]=_0x51dcc1[_0x29f1('0x36')][_0x29f1('0x38')]?_0x51dcc1['attributes']:_0x428111[_0x29f1('0x32')];if(_0x38f7d8[_0x29f1('0x33')][_0x29f1('0x42')]){_0x51dcc1['include']=[{'all':!![]}];}_0x51dcc1=_['merge']({},_0x51dcc1,_0x38f7d8[_0x29f1('0x40')]);return db[_0x29f1('0x2e')][_0x29f1('0x48')](_0x51dcc1)[_0x29f1('0x28')](handleEntityNotFound(_0xc4f756,null))[_0x29f1('0x28')](respondWithResult(_0xc4f756,null))[_0x29f1('0x44')](handleError(_0xc4f756,null));};exports[_0x29f1('0x49')]=function(_0xd49b63,_0x180c13){return db['ChatInternalMessage'][_0x29f1('0x49')](_0xd49b63[_0x29f1('0x4a')],{})[_0x29f1('0x28')](respondWithResult(_0x180c13,0xc9))['catch'](handleError(_0x180c13,null));};exports[_0x29f1('0x26')]=function(_0x305cee,_0x1c102b){if(_0x305cee['body']['id']){delete _0x305cee['body']['id'];}return db[_0x29f1('0x2e')]['find']({'where':{'id':_0x305cee[_0x29f1('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c102b,null))['then'](saveUpdates(_0x305cee[_0x29f1('0x4a')],null))[_0x29f1('0x28')](respondWithResult(_0x1c102b,null))[_0x29f1('0x44')](handleError(_0x1c102b,null));};exports[_0x29f1('0x27')]=function(_0x18dc55,_0x4fdfcf){return db[_0x29f1('0x2e')]['find']({'where':{'id':_0x18dc55[_0x29f1('0x46')]['id']}})[_0x29f1('0x28')](handleEntityNotFound(_0x4fdfcf,null))[_0x29f1('0x28')](removeEntity(_0x4fdfcf,null))[_0x29f1('0x44')](handleError(_0x4fdfcf,null));};exports['describe']=function(_0x49e4c1,_0xbb8349){return db[_0x29f1('0x2e')]['describe']()[_0x29f1('0x28')](respondWithResult(_0xbb8349,null))['catch'](handleError(_0xbb8349,null));};function wrapUser(_0x1f1209){return function(_0x52650f){var _0x107c90=_0x1f1209[_0x29f1('0x4b')]({'plain':!![]});_0x107c90['messages']=[];if(_0x52650f){_0x107c90['lastMessageAt']=_0x52650f[_0x29f1('0x4c')];_0x107c90[_0x29f1('0x4d')]=_0x52650f;}else{_0x107c90[_0x29f1('0x4e')]=moment(0x0)[_0x29f1('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x107c90[_0x29f1('0x4d')]={};}return _0x107c90;};}exports[_0x29f1('0x50')]=function(_0x9aba43,_0x61e3bd,_0x48f020){var _0x55dee4=[];return db['User'][_0x29f1('0x51')]({'where':{'role':[_0x29f1('0x52'),_0x29f1('0x53'),_0x29f1('0x54')]},'attributes':['id',_0x29f1('0x55'),_0x29f1('0x2c'),'role',_0x29f1('0x56'),_0x29f1('0x57'),_0x29f1('0x58'),'lastLoginAt','allowmessenger',_0x29f1('0x59')],'order':qs['sort'](_0x29f1('0x5a')),'include':[{'model':db[_0x29f1('0x5b')],'as':_0x29f1('0x5c'),'attributes':['id',_0x29f1('0x2c'),_0x29f1('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x52b81e){if(_0x52b81e){var _0x29a663=_0x9aba43['user'][_0x29f1('0x4b')]({'plain':!![]});if(!_0x29a663)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29a663[_0x29f1('0x5d')]===_0x29f1('0x54')){return db['UserProfileSection'][_0x29f1('0x48')]({'where':{'name':_0x29f1('0x5e'),'userProfileId':_0x29a663['userProfileId']},'raw':!![]})[_0x29f1('0x28')](function(_0x5296cb){if(_0x5296cb){if(_0x5296cb[_0x29f1('0x5f')]===0x0){return db[_0x29f1('0x60')]['findAll']({'where':{'sectionId':_0x5296cb['id']},'raw':!![]})[_0x29f1('0x28')](function(_0x36542f){var _0x14b3a4=[];if(_[_0x29f1('0x61')](_0x36542f)){_0x14b3a4=_[_0x29f1('0x3e')](_0x52b81e,function(_0x2a0fa2){if(_0x2a0fa2[_0x29f1('0x5d')]!=='agent'){return _0x2a0fa2;}});return _0x14b3a4;}else{for(var _0x1946f3=0x0;_0x1946f3<_0x52b81e[_0x29f1('0x38')];_0x1946f3++){var _0x41b4f3=_0x52b81e[_0x1946f3];if(_0x41b4f3[_0x29f1('0x5d')]===_0x29f1('0x52')){var _0x52f4b2=_['find'](_0x36542f,function(_0x1a6124){return _0x1a6124[_0x29f1('0x62')]===_0x41b4f3['id'];});if(_0x52f4b2)_0x14b3a4[_0x29f1('0x63')](_0x41b4f3);}else{_0x14b3a4[_0x29f1('0x63')](_0x41b4f3);}}return _0x14b3a4;}});}else{return _0x52b81e;}}else{var _0xe11e19=_['filter'](_0x52b81e,function(_0x2f2b46){if(_0x2f2b46[_0x29f1('0x5d')]!==_0x29f1('0x52')){return _0x2f2b46;}});return _0xe11e19;}});}else{return _0x52b81e;}}})['then'](function(_0x507c4e){var _0x156041=[];if(_0x507c4e){_0x55dee4=_0x507c4e;for(var _0x27b647=0x0;_0x27b647<_0x507c4e[_0x29f1('0x38')];_0x27b647+=0x1){_0x55dee4[_0x27b647][_0x29f1('0x64')]=[];_0x156041[_0x29f1('0x63')](db[_0x29f1('0x2e')][_0x29f1('0x48')]({'where':{'FromId':[_0x9aba43[_0x29f1('0x54')]['id'],_0x507c4e[_0x27b647]['id']],'ToId':[_0x9aba43[_0x29f1('0x54')]['id'],_0x507c4e[_0x27b647]['id']],'ChatGroupId':null},'attributes':['id',_0x29f1('0x4c'),'FromId',_0x29f1('0x65'),_0x29f1('0x66'),_0x29f1('0x4a')],'order':qs['sort'](_0x29f1('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x29f1('0x28')](wrapUser(_0x507c4e[_0x27b647])));}return BPromise[_0x29f1('0x68')](_0x156041);}return[];})[_0x29f1('0x28')](function(_0x20037d){return{'rows':_0x20037d,'count':_0x20037d['length']};})['then'](respondWithResult(_0x61e3bd,null))[_0x29f1('0x44')](handleError(_0x61e3bd,null));};
\ No newline at end of file
+var _0x4f06=['keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','get','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','createdAt','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x45dbe8,_0x28b94b){var _0x1a10d0=function(_0xf363bf){while(--_0xf363bf){_0x45dbe8['push'](_0x45dbe8['shift']());}};_0x1a10d0(++_0x28b94b);}(_0x4f06,0x11a));var _0x64f0=function(_0x4006aa,_0x4c5d79){_0x4006aa=_0x4006aa-0x0;var _0x2da188=_0x4f06[_0x4006aa];return _0x2da188;};'use strict';var emlformat=require(_0x64f0('0x0'));var rimraf=require(_0x64f0('0x1'));var zipdir=require(_0x64f0('0x2'));var jsonpatch=require(_0x64f0('0x3'));var rp=require(_0x64f0('0x4'));var moment=require('moment');var BPromise=require(_0x64f0('0x5'));var Mustache=require('mustache');var util=require(_0x64f0('0x6'));var path=require(_0x64f0('0x7'));var sox=require(_0x64f0('0x8'));var csv=require(_0x64f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64f0('0xa'));var squel=require(_0x64f0('0xb'));var crypto=require(_0x64f0('0xc'));var jsforce=require(_0x64f0('0xd'));var deskjs=require(_0x64f0('0xe'));var toCsv=require(_0x64f0('0x9'));var querystring=require(_0x64f0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x64f0('0x10'));var qs=require(_0x64f0('0x11'));var as=require(_0x64f0('0x12'));var hardwareService=require(_0x64f0('0x13'));var logger=require(_0x64f0('0x14'))(_0x64f0('0x15'));var utils=require(_0x64f0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x64f0('0x17'))['db'];config[_0x64f0('0x18')]=_[_0x64f0('0x19')](config['redis'],{'host':_0x64f0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x64f0('0x1b'))[_0x64f0('0x1c')](socket);function respondWithStatusCode(_0x319b18,_0x42b754){_0x42b754=_0x42b754||0xcc;return function(_0xcf0e3b){if(_0xcf0e3b){return _0x319b18[_0x64f0('0x1d')](_0x42b754);}return _0x319b18[_0x64f0('0x1e')](_0x42b754)['end']();};}function respondWithResult(_0x16958f,_0x2e040a){_0x2e040a=_0x2e040a||0xc8;return function(_0x409fb1){if(_0x409fb1){return _0x16958f[_0x64f0('0x1e')](_0x2e040a)['json'](_0x409fb1);}};}function respondWithFilteredResult(_0x40a444,_0x158677){return function(_0x148428){if(_0x148428){var _0x343b3c=typeof _0x158677[_0x64f0('0x1f')]===_0x64f0('0x20')&&typeof _0x158677[_0x64f0('0x21')]===_0x64f0('0x20');var _0x2ff68a=_0x148428[_0x64f0('0x22')];var _0x2ccb2d=_0x343b3c?0x0:_0x158677[_0x64f0('0x1f')];var _0x2fd67a=_0x343b3c?_0x148428['count']:_0x158677['offset']+_0x158677['limit'];var _0x1ff527;if(_0x2fd67a>=_0x2ff68a){_0x2fd67a=_0x2ff68a;_0x1ff527=0xc8;}else{_0x1ff527=0xce;}_0x40a444[_0x64f0('0x1e')](_0x1ff527);return _0x40a444[_0x64f0('0x23')](_0x64f0('0x24'),_0x2ccb2d+'-'+_0x2fd67a+'/'+_0x2ff68a)['json'](_0x148428);}return null;};}function patchUpdates(_0x34177d){return function(_0x2fcfc1){try{jsonpatch[_0x64f0('0x25')](_0x2fcfc1,_0x34177d,!![]);}catch(_0x5c7dd1){return BPromise['reject'](_0x5c7dd1);}return _0x2fcfc1['save']();};}function saveUpdates(_0x394c6b,_0x2ba6aa){return function(_0x1e3638){if(_0x1e3638){return _0x1e3638['update'](_0x394c6b)[_0x64f0('0x26')](function(_0x24b9cc){return _0x24b9cc;});}return null;};}function removeEntity(_0x5a1105,_0x4b591e){return function(_0x52cd54){if(_0x52cd54){return _0x52cd54[_0x64f0('0x27')]()[_0x64f0('0x26')](function(){_0x5a1105[_0x64f0('0x1e')](0xcc)[_0x64f0('0x28')]();});}};}function handleEntityNotFound(_0x2b7ba9,_0x136c29){return function(_0x3e18cf){if(!_0x3e18cf){_0x2b7ba9[_0x64f0('0x1d')](0x194);}return _0x3e18cf;};}function handleError(_0x323fb3,_0x34dfaa){_0x34dfaa=_0x34dfaa||0x1f4;return function(_0x281a03){logger[_0x64f0('0x29')](_0x281a03['stack']);if(_0x281a03[_0x64f0('0x2a')]){delete _0x281a03[_0x64f0('0x2a')];}_0x323fb3[_0x64f0('0x1e')](_0x34dfaa)[_0x64f0('0x2b')](_0x281a03);};}exports['index']=function(_0x39d50f,_0xa9ac0a){var _0x5bdda0={},_0x5d268f={},_0xd04711={'count':0x0,'rows':[]};var _0x14ca84=_[_0x64f0('0x2c')](db['ChatInternalMessage'][_0x64f0('0x2d')],function(_0x1d1f76){return{'name':_0x1d1f76[_0x64f0('0x2e')],'type':_0x1d1f76[_0x64f0('0x2f')][_0x64f0('0x30')]};});_0x5d268f[_0x64f0('0x31')]=_[_0x64f0('0x2c')](_0x14ca84,'name');_0x5d268f[_0x64f0('0x32')]=_[_0x64f0('0x33')](_0x39d50f['query']);_0x5d268f['filters']=_[_0x64f0('0x34')](_0x5d268f['model'],_0x5d268f[_0x64f0('0x32')]);_0x5bdda0[_0x64f0('0x35')]=_[_0x64f0('0x34')](_0x5d268f[_0x64f0('0x31')],qs[_0x64f0('0x36')](_0x39d50f[_0x64f0('0x32')][_0x64f0('0x36')]));_0x5bdda0['attributes']=_0x5bdda0[_0x64f0('0x35')][_0x64f0('0x37')]?_0x5bdda0[_0x64f0('0x35')]:_0x5d268f[_0x64f0('0x31')];if(!_0x39d50f[_0x64f0('0x32')]['hasOwnProperty']('nolimit')){_0x5bdda0['limit']=qs[_0x64f0('0x21')](_0x39d50f[_0x64f0('0x32')][_0x64f0('0x21')]);_0x5bdda0['offset']=qs['offset'](_0x39d50f['query'][_0x64f0('0x1f')]);}_0x5bdda0[_0x64f0('0x38')]=qs[_0x64f0('0x39')](_0x39d50f[_0x64f0('0x32')][_0x64f0('0x39')]);_0x5bdda0[_0x64f0('0x3a')]=qs[_0x64f0('0x3b')](_[_0x64f0('0x3c')](_0x39d50f[_0x64f0('0x32')],_0x5d268f[_0x64f0('0x3b')]),_0x14ca84);if(_0x39d50f[_0x64f0('0x32')][_0x64f0('0x3d')]){_0x5bdda0[_0x64f0('0x3a')]=_[_0x64f0('0x3e')](_0x5bdda0[_0x64f0('0x3a')],{'$or':_[_0x64f0('0x2c')](_0x14ca84,function(_0xff02e3){if(_0xff02e3[_0x64f0('0x2f')]!==_0x64f0('0x3f')){var _0x48ba8c={};_0x48ba8c[_0xff02e3[_0x64f0('0x2a')]]={'$like':'%'+_0x39d50f['query'][_0x64f0('0x3d')]+'%'};return _0x48ba8c;}})});}_0x5bdda0=_[_0x64f0('0x3e')]({},_0x5bdda0,_0x39d50f[_0x64f0('0x40')]);var _0x319aef={'where':_0x5bdda0[_0x64f0('0x3a')]};return db[_0x64f0('0x41')][_0x64f0('0x22')](_0x319aef)[_0x64f0('0x26')](function(_0x5b3829){_0xd04711[_0x64f0('0x22')]=_0x5b3829;if(_0x39d50f[_0x64f0('0x32')][_0x64f0('0x42')]){_0x5bdda0[_0x64f0('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x64f0('0x44')](_0x5bdda0);})[_0x64f0('0x26')](function(_0x1f1358){_0xd04711[_0x64f0('0x45')]=_0x1f1358;return _0xd04711;})[_0x64f0('0x26')](respondWithFilteredResult(_0xa9ac0a,_0x5bdda0))[_0x64f0('0x46')](handleError(_0xa9ac0a,null));};exports[_0x64f0('0x47')]=function(_0x2e80df,_0x4414d4){var _0x5529d4={'raw':!![],'where':{'id':_0x2e80df[_0x64f0('0x48')]['id']}},_0x567f12={};_0x567f12[_0x64f0('0x31')]=_[_0x64f0('0x33')](db[_0x64f0('0x41')][_0x64f0('0x2d')]);_0x567f12[_0x64f0('0x32')]=_[_0x64f0('0x33')](_0x2e80df[_0x64f0('0x32')]);_0x567f12['filters']=_[_0x64f0('0x34')](_0x567f12['model'],_0x567f12[_0x64f0('0x32')]);_0x5529d4[_0x64f0('0x35')]=_[_0x64f0('0x34')](_0x567f12['model'],qs[_0x64f0('0x36')](_0x2e80df['query'][_0x64f0('0x36')]));_0x5529d4[_0x64f0('0x35')]=_0x5529d4['attributes']['length']?_0x5529d4[_0x64f0('0x35')]:_0x567f12[_0x64f0('0x31')];if(_0x2e80df[_0x64f0('0x32')][_0x64f0('0x42')]){_0x5529d4[_0x64f0('0x43')]=[{'all':!![]}];}_0x5529d4=_['merge']({},_0x5529d4,_0x2e80df['options']);return db[_0x64f0('0x41')]['find'](_0x5529d4)[_0x64f0('0x26')](handleEntityNotFound(_0x4414d4,null))[_0x64f0('0x26')](respondWithResult(_0x4414d4,null))[_0x64f0('0x46')](handleError(_0x4414d4,null));};exports[_0x64f0('0x49')]=function(_0x33aaaf,_0x79b489){return db[_0x64f0('0x41')][_0x64f0('0x49')](_0x33aaaf[_0x64f0('0x4a')],{})[_0x64f0('0x26')](respondWithResult(_0x79b489,0xc9))[_0x64f0('0x46')](handleError(_0x79b489,null));};exports['update']=function(_0x221fca,_0x162d12){if(_0x221fca[_0x64f0('0x4a')]['id']){delete _0x221fca[_0x64f0('0x4a')]['id'];}return db[_0x64f0('0x41')][_0x64f0('0x4b')]({'where':{'id':_0x221fca[_0x64f0('0x48')]['id']}})[_0x64f0('0x26')](handleEntityNotFound(_0x162d12,null))[_0x64f0('0x26')](saveUpdates(_0x221fca[_0x64f0('0x4a')],null))[_0x64f0('0x26')](respondWithResult(_0x162d12,null))['catch'](handleError(_0x162d12,null));};exports[_0x64f0('0x27')]=function(_0x25c27a,_0x321031){return db[_0x64f0('0x41')][_0x64f0('0x4b')]({'where':{'id':_0x25c27a[_0x64f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x321031,null))[_0x64f0('0x26')](removeEntity(_0x321031,null))[_0x64f0('0x46')](handleError(_0x321031,null));};exports[_0x64f0('0x4c')]=function(_0x4f8884,_0x1b25e0){return db[_0x64f0('0x41')]['describe']()['then'](respondWithResult(_0x1b25e0,null))[_0x64f0('0x46')](handleError(_0x1b25e0,null));};function wrapUser(_0x20e3ee){return function(_0x29f0f4){var _0xf4cdc3=_0x20e3ee[_0x64f0('0x4d')]({'plain':!![]});_0xf4cdc3[_0x64f0('0x4e')]=[];if(_0x29f0f4){_0xf4cdc3['lastMessageAt']=_0x29f0f4['createdAt'];_0xf4cdc3[_0x64f0('0x4f')]=_0x29f0f4;}else{_0xf4cdc3[_0x64f0('0x50')]=moment(0x0)[_0x64f0('0x51')](_0x64f0('0x52'));_0xf4cdc3[_0x64f0('0x4f')]={};}return _0xf4cdc3;};}exports[_0x64f0('0x53')]=function(_0x4a7a93,_0xff13a,_0x598977){var _0x3424ae=[];return db[_0x64f0('0x54')]['findAll']({'where':{'role':['agent',_0x64f0('0x55'),_0x64f0('0x56')]},'attributes':['id',_0x64f0('0x57'),'name','role',_0x64f0('0x58'),'internal',_0x64f0('0x59'),_0x64f0('0x5a'),_0x64f0('0x5b'),_0x64f0('0x5c')],'order':qs['sort'](_0x64f0('0x5d')),'include':[{'model':db[_0x64f0('0x5e')],'as':_0x64f0('0x5f'),'attributes':['id','name',_0x64f0('0x2f')],'through':{'attributes':[]}}]})[_0x64f0('0x26')](function(_0x33ebee){if(_0x33ebee){var _0x12e256=_0x4a7a93[_0x64f0('0x56')][_0x64f0('0x4d')]({'plain':!![]});if(!_0x12e256)throw new Error(_0x64f0('0x60'));if(_0x12e256[_0x64f0('0x61')]==='user'){return db[_0x64f0('0x62')][_0x64f0('0x4b')]({'where':{'name':'Agents','userProfileId':_0x12e256[_0x64f0('0x63')]},'raw':!![]})[_0x64f0('0x26')](function(_0x869f61){if(_0x869f61){if(_0x869f61[_0x64f0('0x64')]===0x0){return db[_0x64f0('0x65')][_0x64f0('0x44')]({'where':{'sectionId':_0x869f61['id']},'raw':!![]})[_0x64f0('0x26')](function(_0x23c1f6){var _0xed973f=[];if(_[_0x64f0('0x66')](_0x23c1f6)){_0xed973f=_[_0x64f0('0x3d')](_0x33ebee,function(_0x133656){if(_0x133656[_0x64f0('0x61')]!=='agent'){return _0x133656;}});return _0xed973f;}else{for(var _0x1ca818=0x0;_0x1ca818<_0x33ebee[_0x64f0('0x37')];_0x1ca818++){var _0x2fde4c=_0x33ebee[_0x1ca818];if(_0x2fde4c['role']===_0x64f0('0x67')){var _0x25afef=_['find'](_0x23c1f6,function(_0x4c5106){return _0x4c5106[_0x64f0('0x68')]===_0x2fde4c['id'];});if(_0x25afef)_0xed973f['push'](_0x2fde4c);}else{_0xed973f[_0x64f0('0x69')](_0x2fde4c);}}return _0xed973f;}});}else{return _0x33ebee;}}else{var _0x3b85fa=_[_0x64f0('0x3d')](_0x33ebee,function(_0x2b9ace){if(_0x2b9ace[_0x64f0('0x61')]!==_0x64f0('0x67')){return _0x2b9ace;}});return _0x3b85fa;}});}else{return _0x33ebee;}}})['then'](function(_0x113cb5){var _0x2e3f3d=[];if(_0x113cb5){_0x3424ae=_0x113cb5;for(var _0x45105e=0x0;_0x45105e<_0x113cb5[_0x64f0('0x37')];_0x45105e+=0x1){_0x3424ae[_0x45105e][_0x64f0('0x4e')]=[];_0x2e3f3d[_0x64f0('0x69')](db[_0x64f0('0x41')][_0x64f0('0x4b')]({'where':{'FromId':[_0x4a7a93[_0x64f0('0x56')]['id'],_0x113cb5[_0x45105e]['id']],'ToId':[_0x4a7a93[_0x64f0('0x56')]['id'],_0x113cb5[_0x45105e]['id']],'ChatGroupId':null},'attributes':['id',_0x64f0('0x6a'),_0x64f0('0x6b'),_0x64f0('0x6c'),_0x64f0('0x6d'),_0x64f0('0x4a')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x113cb5[_0x45105e])));}return BPromise[_0x64f0('0x6e')](_0x2e3f3d);}return[];})[_0x64f0('0x26')](function(_0x4c938b){return{'rows':_0x4c938b,'count':_0x4c938b[_0x64f0('0x37')]};})[_0x64f0('0x26')](respondWithResult(_0xff13a,null))['catch'](handleError(_0xff13a,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 3aacfc2..cd4636f 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 _0x083f=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4e6cfc,_0x524247){var _0x2806bb=function(_0x23c863){while(--_0x23c863){_0x4e6cfc['push'](_0x4e6cfc['shift']());}};_0x2806bb(++_0x524247);}(_0x083f,0xd1));var _0xf083=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x083f[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xf083('0x0'));var ChatInternalMessage=require(_0xf083('0x1'))['db'][_0xf083('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf083('0x3')](0x0);var events={'afterCreate':_0xf083('0x4'),'afterUpdate':_0xf083('0x5'),'afterDestroy':_0xf083('0x6')};function emitEvent(_0x38f7e6){return function(_0x374f86,_0x1e47dd,_0x338bb0){ChatInternalMessageEvents[_0xf083('0x7')](_0x38f7e6+':'+_0x374f86['id'],_0x374f86);ChatInternalMessageEvents[_0xf083('0x7')](_0x38f7e6,_0x374f86);_0x338bb0(null);};}for(var e in events){if(events[_0xf083('0x8')](e)){var event=events[e];ChatInternalMessage[_0xf083('0x9')](e,emitEvent(event));}}module[_0xf083('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xf894=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5d85ec,_0x4f6f1c){var _0xa01f0d=function(_0x2686fd){while(--_0x2686fd){_0x5d85ec['push'](_0x5d85ec['shift']());}};_0xa01f0d(++_0x4f6f1c);}(_0xf894,0xfd));var _0x4f89=function(_0x26d67c,_0x2a0d3d){_0x26d67c=_0x26d67c-0x0;var _0x143f3c=_0xf894[_0x26d67c];return _0x143f3c;};'use strict';var EventEmitter=require(_0x4f89('0x0'));var ChatInternalMessage=require(_0x4f89('0x1'))['db'][_0x4f89('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4f89('0x3')](0x0);var events={'afterCreate':_0x4f89('0x4'),'afterUpdate':_0x4f89('0x5'),'afterDestroy':_0x4f89('0x6')};function emitEvent(_0x1bfd64){return function(_0x2c2f5a,_0x297f74,_0x2f2d59){ChatInternalMessageEvents[_0x4f89('0x7')](_0x1bfd64+':'+_0x2c2f5a['id'],_0x2c2f5a);ChatInternalMessageEvents[_0x4f89('0x7')](_0x1bfd64,_0x2c2f5a);_0x2f2d59(null);};}for(var e in events){if(events[_0x4f89('0x8')](e)){var event=events[e];ChatInternalMessage[_0x4f89('0x9')](e,emitEvent(event));}}module[_0x4f89('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 94b8ebd..5117ec5 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 _0x4ef5=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','chat_internal_messages'];(function(_0x1dc029,_0x40ea99){var _0x1fdaa3=function(_0x37de31){while(--_0x37de31){_0x1dc029['push'](_0x1dc029['shift']());}};_0x1fdaa3(++_0x40ea99);}(_0x4ef5,0x109));var _0x54ef=function(_0x1ec7b3,_0x14211c){_0x1ec7b3=_0x1ec7b3-0x0;var _0x315f31=_0x4ef5[_0x1ec7b3];return _0x315f31;};'use strict';var _=require(_0x54ef('0x0'));var util=require(_0x54ef('0x1'));var logger=require(_0x54ef('0x2'))(_0x54ef('0x3'));var moment=require('moment');var BPromise=require(_0x54ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x54ef('0x5'));var config=require(_0x54ef('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x54ef('0x7')]=function(_0x39002b,_0x48e90e){return _0x39002b[_0x54ef('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x54ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x54ef('0xa')});};
\ No newline at end of file
+var _0xacf8=['request-promise','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x13a09a,_0x1abff5){var _0x499838=function(_0x292a9b){while(--_0x292a9b){_0x13a09a['push'](_0x13a09a['shift']());}};_0x499838(++_0x1abff5);}(_0xacf8,0xe5));var _0x8acf=function(_0x35a384,_0x1e102e){_0x35a384=_0x35a384-0x0;var _0x3d6e8e=_0xacf8[_0x35a384];return _0x3d6e8e;};'use strict';var _=require(_0x8acf('0x0'));var util=require(_0x8acf('0x1'));var logger=require('../../config/logger')(_0x8acf('0x2'));var moment=require(_0x8acf('0x3'));var BPromise=require(_0x8acf('0x4'));var rp=require(_0x8acf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8acf('0x6'));var attributes=require(_0x8acf('0x7'));module['exports']=function(_0x313306,_0x317d00){return _0x313306[_0x8acf('0x8')](_0x8acf('0x9'),attributes,{'tableName':_0x8acf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8acf('0xb'),'collate':_0x8acf('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9aa93dc..32cb4d4 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 _0xfafd=['then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x1ff17d,_0x375a19){var _0xf4280f=function(_0x5b0e52){while(--_0x5b0e52){_0x1ff17d['push'](_0x1ff17d['shift']());}};_0xf4280f(++_0x375a19);}(_0xfafd,0xcc));var _0xdfaf=function(_0x10a841,_0x587cf2){_0x10a841=_0x10a841-0x0;var _0xbbfbb0=_0xfafd[_0x10a841];return _0xbbfbb0;};'use strict';var _=require('lodash');var util=require(_0xdfaf('0x0'));var moment=require(_0xdfaf('0x1'));var BPromise=require(_0xdfaf('0x2'));var rs=require(_0xdfaf('0x3'));var fs=require('fs');var Redis=require(_0xdfaf('0x4'));var db=require(_0xdfaf('0x5'))['db'];var utils=require(_0xdfaf('0x6'));var logger=require(_0xdfaf('0x7'))(_0xdfaf('0x8'));var config=require(_0xdfaf('0x9'));var jayson=require(_0xdfaf('0xa'));var client=jayson[_0xdfaf('0xb')][_0xdfaf('0xc')]({'port':0x232a});config[_0xdfaf('0xd')]=_[_0xdfaf('0xe')](config['redis'],{'host':_0xdfaf('0xf'),'port':0x18eb});var socket=require(_0xdfaf('0x10'))(new Redis(config[_0xdfaf('0xd')]));require(_0xdfaf('0x11'))[_0xdfaf('0x12')](socket);function respondWithRpcPromise(_0x23712a,_0x466923,_0x26fd47){return new BPromise(function(_0x5092d6,_0x3747ce){return client[_0xdfaf('0x13')](_0x23712a,_0x26fd47)[_0xdfaf('0x14')](function(_0x42ea9f){logger[_0xdfaf('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x466923,_0xdfaf('0x16'));logger[_0xdfaf('0x17')](_0xdfaf('0x18'),_0x466923,_0xdfaf('0x16'),JSON[_0xdfaf('0x19')](_0x42ea9f));if(_0x42ea9f[_0xdfaf('0x1a')]){if(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1b')]===0x1f4){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x42ea9f['error'][_0xdfaf('0x1d')]);return _0x3747ce(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);}logger['error'](_0xdfaf('0x1c'),_0x466923,_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);return _0x5092d6(_0x42ea9f['error']['message']);}else{logger[_0xdfaf('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x466923,'request\x20sent');_0x5092d6(_0x42ea9f[_0xdfaf('0x1e')][_0xdfaf('0x1d')]);}})[_0xdfaf('0x1f')](function(_0x120e5d){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x120e5d);_0x3747ce(_0x120e5d);});});}
\ No newline at end of file
+var _0x98ac=['stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x47604d,_0x15a014){var _0x388e4c=function(_0x42a446){while(--_0x42a446){_0x47604d['push'](_0x47604d['shift']());}};_0x388e4c(++_0x15a014);}(_0x98ac,0x1d1));var _0xc98a=function(_0x9ba64a,_0x4943c3){_0x9ba64a=_0x9ba64a-0x0;var _0x121ec8=_0x98ac[_0x9ba64a];return _0x121ec8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc98a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc98a('0x1'));var db=require(_0xc98a('0x2'))['db'];var utils=require(_0xc98a('0x3'));var logger=require(_0xc98a('0x4'))(_0xc98a('0x5'));var config=require('../../config/environment');var jayson=require(_0xc98a('0x6'));var client=jayson[_0xc98a('0x7')]['http']({'port':0x232a});config[_0xc98a('0x8')]=_[_0xc98a('0x9')](config[_0xc98a('0x8')],{'host':_0xc98a('0xa'),'port':0x18eb});var socket=require(_0xc98a('0xb'))(new Redis(config[_0xc98a('0x8')]));require(_0xc98a('0xc'))['register'](socket);function respondWithRpcPromise(_0x4f7cdd,_0x53f259,_0x3c042b){return new BPromise(function(_0x43a7ba,_0x90b582){return client['request'](_0x4f7cdd,_0x3c042b)['then'](function(_0x9920){logger[_0xc98a('0xd')](_0xc98a('0xe'),_0x53f259,_0xc98a('0xf'));logger[_0xc98a('0x10')](_0xc98a('0x11'),_0x53f259,_0xc98a('0xf'),JSON[_0xc98a('0x12')](_0x9920));if(_0x9920[_0xc98a('0x13')]){if(_0x9920['error'][_0xc98a('0x14')]===0x1f4){logger[_0xc98a('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x53f259,_0x9920[_0xc98a('0x13')][_0xc98a('0x15')]);return _0x90b582(_0x9920[_0xc98a('0x13')]['message']);}logger[_0xc98a('0x13')](_0xc98a('0xe'),_0x53f259,_0x9920[_0xc98a('0x13')][_0xc98a('0x15')]);return _0x43a7ba(_0x9920['error'][_0xc98a('0x15')]);}else{logger[_0xc98a('0xd')](_0xc98a('0xe'),_0x53f259,'request\x20sent');_0x43a7ba(_0x9920['result']['message']);}})[_0xc98a('0x16')](function(_0x1e8b99){logger[_0xc98a('0x13')](_0xc98a('0xe'),_0x53f259,_0x1e8b99);_0x90b582(_0x1e8b99);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7e95ad5..216c9de 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 _0xbf03=['emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x293274,_0x1f9041){var _0x21730e=function(_0x56fc27){while(--_0x56fc27){_0x293274['push'](_0x293274['shift']());}};_0x21730e(++_0x1f9041);}(_0xbf03,0x66));var _0x3bf0=function(_0x196822,_0x3658d1){_0x196822=_0x196822-0x0;var _0x14338a=_0xbf03[_0x196822];return _0x14338a;};'use strict';var ChatInternalMessageEvents=require(_0x3bf0('0x0'));var events=[_0x3bf0('0x1'),_0x3bf0('0x2'),'update'];function createListener(_0x3b9e90,_0x3a7d5b){return function(_0x4b47f6){_0x3a7d5b[_0x3bf0('0x3')](_0x3b9e90,_0x4b47f6);};}function removeListener(_0x43da41,_0x95db4){return function(){ChatInternalMessageEvents[_0x3bf0('0x4')](_0x43da41,_0x95db4);};}exports['register']=function(_0x5e1e24){for(var _0x23329e=0x0,_0x3fbd24=events[_0x3bf0('0x5')];_0x23329e<_0x3fbd24;_0x23329e++){var _0x1cd001=events[_0x23329e];var _0x4457b2=createListener(_0x3bf0('0x6')+_0x1cd001,_0x5e1e24);ChatInternalMessageEvents['on'](_0x1cd001,_0x4457b2);}};
\ No newline at end of file
+var _0x482a=['chatInternalMessage:','save','remove','update','emit','removeListener','length'];(function(_0x4be634,_0x2b1a67){var _0x2df900=function(_0x4fabea){while(--_0x4fabea){_0x4be634['push'](_0x4be634['shift']());}};_0x2df900(++_0x2b1a67);}(_0x482a,0xcc));var _0xa482=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x482a[_0x4a53d];return _0x27410e;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xa482('0x0'),_0xa482('0x1'),_0xa482('0x2')];function createListener(_0x355e47,_0x7ecf7b){return function(_0x4e1c69){_0x7ecf7b[_0xa482('0x3')](_0x355e47,_0x4e1c69);};}function removeListener(_0x23f991,_0x3342d3){return function(){ChatInternalMessageEvents[_0xa482('0x4')](_0x23f991,_0x3342d3);};}exports['register']=function(_0x5350d6){for(var _0x34056c=0x0,_0x7b5904=events[_0xa482('0x5')];_0x34056c<_0x7b5904;_0x34056c++){var _0x35aa30=events[_0x34056c];var _0x37ef5c=createListener(_0xa482('0x6')+_0x35aa30,_0x5350d6);ChatInternalMessageEvents['on'](_0x35aa30,_0x37ef5c);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 1a31e5d..d58a8b6 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 _0xf061=['get','isAuthenticated','index','/describe','describe','/:id','post','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xf061,0x1a7));var _0x1f06=function(_0x1949eb,_0x4a899d){_0x1949eb=_0x1949eb-0x0;var _0x496bdd=_0xf061[_0x1949eb];return _0x496bdd;};'use strict';var multer=require(_0x1f06('0x0'));var util=require(_0x1f06('0x1'));var path=require(_0x1f06('0x2'));var timeout=require('connect-timeout');var express=require(_0x1f06('0x3'));var router=express[_0x1f06('0x4')]();var fs_extra=require(_0x1f06('0x5'));var auth=require(_0x1f06('0x6'));var interaction=require(_0x1f06('0x7'));var config=require(_0x1f06('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x1f06('0x9')]('/',auth[_0x1f06('0xa')](),controller[_0x1f06('0xb')]);router[_0x1f06('0x9')](_0x1f06('0xc'),auth['isAuthenticated'](),controller[_0x1f06('0xd')]);router[_0x1f06('0x9')]('/users',auth[_0x1f06('0xa')](),controller['getUsers']);router[_0x1f06('0x9')](_0x1f06('0xe'),auth[_0x1f06('0xa')](),controller['show']);router[_0x1f06('0xf')]('/',auth[_0x1f06('0xa')](),controller['create']);router['put']('/:id',controller['update']);router[_0x1f06('0x10')](_0x1f06('0xe'),auth[_0x1f06('0xa')](),controller[_0x1f06('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x4c1b=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','/describe','describe','get','/users','getUsers','/:id'];(function(_0x598ec6,_0x17113e){var _0x54de2d=function(_0x11889e){while(--_0x11889e){_0x598ec6['push'](_0x598ec6['shift']());}};_0x54de2d(++_0x17113e);}(_0x4c1b,0x1c8));var _0xb4c1=function(_0x14fbf9,_0x34e93d){_0x14fbf9=_0x14fbf9-0x0;var _0x11197b=_0x4c1b[_0x14fbf9];return _0x11197b;};'use strict';var multer=require(_0xb4c1('0x0'));var util=require(_0xb4c1('0x1'));var path=require(_0xb4c1('0x2'));var timeout=require(_0xb4c1('0x3'));var express=require(_0xb4c1('0x4'));var router=express[_0xb4c1('0x5')]();var fs_extra=require(_0xb4c1('0x6'));var auth=require(_0xb4c1('0x7'));var interaction=require(_0xb4c1('0x8'));var config=require(_0xb4c1('0x9'));var controller=require(_0xb4c1('0xa'));router['get']('/',auth[_0xb4c1('0xb')](),controller[_0xb4c1('0xc')]);router['get'](_0xb4c1('0xd'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0xe')]);router[_0xb4c1('0xf')](_0xb4c1('0x10'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x11')]);router['get'](_0xb4c1('0x12'),auth[_0xb4c1('0xb')](),controller['show']);router[_0xb4c1('0x13')]('/',auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x14')]);router['put'](_0xb4c1('0x12'),controller[_0xb4c1('0x15')]);router[_0xb4c1('0x16')](_0xb4c1('0x12'),auth['isAuthenticated'](),controller[_0xb4c1('0x17')]);module[_0xb4c1('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 09e4e54..769b93b 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(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x73a1,0x161));var _0x173a=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x73a1[_0x40dd56];return _0x4f850f;};'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 _0xe5fb=['medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe5fb,0xce));var _0xbe5f=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0xe5fb[_0x3c51d4];return _0x53c45f;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbe5f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe5f('0x4')),'defaultValue':_0xbe5f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe5f('0x5')]},'providerName':{'type':Sequelize[_0xbe5f('0x6')]},'providerResponse':{'type':Sequelize[_0xbe5f('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index fd88129..f0356d5 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 _0x8972=['reject','then','destroy','end','sendStatus','stack','name','index','map','ChatMessage','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','create','update','body','describe','chat-interactions','accept','chat','read','format','user','agent','UserId','get','ChatInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','internal','channel','motionChannel','event','EventManager','parse','formData','ChatInteractionId','RejectMessage','rejectMessage','Sequelize','contact','fullname','email','interface','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x52a80a,_0x1442d1){var _0x500083=function(_0xf0454a){while(--_0xf0454a){_0x52a80a['push'](_0x52a80a['shift']());}};_0x500083(++_0x1442d1);}(_0x8972,0xd8));var _0x2897=function(_0x2039ef,_0x51e049){_0x2039ef=_0x2039ef-0x0;var _0x1012c7=_0x8972[_0x2039ef];return _0x1012c7;};'use strict';var emlformat=require(_0x2897('0x0'));var rimraf=require(_0x2897('0x1'));var zipdir=require(_0x2897('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2897('0x3'));var moment=require(_0x2897('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2897('0x5'));var util=require(_0x2897('0x6'));var path=require(_0x2897('0x7'));var sox=require(_0x2897('0x8'));var csv=require(_0x2897('0x9'));var ejs=require(_0x2897('0xa'));var fs=require('fs');var fs_extra=require(_0x2897('0xb'));var _=require(_0x2897('0xc'));var squel=require(_0x2897('0xd'));var crypto=require(_0x2897('0xe'));var jsforce=require(_0x2897('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2897('0x10'));var Papa=require('papaparse');var Redis=require(_0x2897('0x11'));var authService=require(_0x2897('0x12'));var qs=require(_0x2897('0x13'));var as=require(_0x2897('0x14'));var hardwareService=require(_0x2897('0x15'));var logger=require(_0x2897('0x16'))(_0x2897('0x17'));var utils=require('../../config/utils');var config=require(_0x2897('0x18'));var licenseUtil=require(_0x2897('0x19'));var db=require(_0x2897('0x1a'))['db'];config[_0x2897('0x1b')]=_[_0x2897('0x1c')](config['redis'],{'host':_0x2897('0x1d'),'port':0x18eb});var socket=require(_0x2897('0x1e'))(new Redis(config[_0x2897('0x1b')]));require(_0x2897('0x1f'))[_0x2897('0x20')](socket);var jayson=require(_0x2897('0x21'));var client=jayson['client'][_0x2897('0x22')]({'port':0x232c});var client9002=jayson[_0x2897('0x23')][_0x2897('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x22e07c,_0x3eedaf,_0x3cb4e9,_0x48aeed){return new BPromise(function(_0x33d48d,_0x1437cf){var _0x30215c=_0x48aeed||client;return _0x30215c['request'](_0x22e07c,_0x3cb4e9)['then'](function(_0x1c93a8){logger[_0x2897('0x24')](_0x2897('0x25'),_0x3eedaf,_0x2897('0x26'));logger[_0x2897('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3eedaf,'request\x20sent',JSON[_0x2897('0x28')](_0x1c93a8));if(_0x1c93a8[_0x2897('0x29')]){if(_0x1c93a8['error'][_0x2897('0x2a')]===0x1f4){logger[_0x2897('0x29')]('ChatMessage,\x20%s,\x20%s',_0x3eedaf,_0x1c93a8[_0x2897('0x29')]['message']);return _0x1437cf(_0x1c93a8[_0x2897('0x29')][_0x2897('0x2b')]);}logger[_0x2897('0x29')](_0x2897('0x25'),_0x3eedaf,_0x1c93a8['error'][_0x2897('0x2b')]);return _0x33d48d(_0x1c93a8['error'][_0x2897('0x2b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3eedaf,_0x2897('0x26'));_0x33d48d(_0x1c93a8[_0x2897('0x2c')][_0x2897('0x2b')]);}})[_0x2897('0x2d')](function(_0x4857ff){logger[_0x2897('0x29')]('ChatMessage,\x20%s,\x20%s',_0x3eedaf,_0x4857ff);_0x1437cf(_0x4857ff);});});}function respondWithStatusCode(_0x5e25e9,_0x4e62ac){_0x4e62ac=_0x4e62ac||0xcc;return function(_0x37a20e){if(_0x37a20e){return _0x5e25e9['sendStatus'](_0x4e62ac);}return _0x5e25e9[_0x2897('0x2e')](_0x4e62ac)['end']();};}function respondWithResult(_0x5ed7b5,_0x50d045){_0x50d045=_0x50d045||0xc8;return function(_0x4f8c12){if(_0x4f8c12){return _0x5ed7b5[_0x2897('0x2e')](_0x50d045)[_0x2897('0x2f')](_0x4f8c12);}};}function respondWithFilteredResult(_0x942599,_0x84bc74){return function(_0x3bb17d){if(_0x3bb17d){var _0x8c4c32=typeof _0x84bc74[_0x2897('0x30')]===_0x2897('0x31')&&typeof _0x84bc74[_0x2897('0x32')]===_0x2897('0x31');var _0x1680be=_0x3bb17d[_0x2897('0x33')];var _0x41c6b9=_0x8c4c32?0x0:_0x84bc74[_0x2897('0x30')];var _0x4b9e54=_0x8c4c32?_0x3bb17d['count']:_0x84bc74[_0x2897('0x30')]+_0x84bc74[_0x2897('0x32')];var _0x13d7ec;if(_0x4b9e54>=_0x1680be){_0x4b9e54=_0x1680be;_0x13d7ec=0xc8;}else{_0x13d7ec=0xce;}_0x942599[_0x2897('0x2e')](_0x13d7ec);return _0x942599[_0x2897('0x34')](_0x2897('0x35'),_0x41c6b9+'-'+_0x4b9e54+'/'+_0x1680be)[_0x2897('0x2f')](_0x3bb17d);}return null;};}function patchUpdates(_0x5d1623){return function(_0x3a0049){try{jsonpatch['apply'](_0x3a0049,_0x5d1623,!![]);}catch(_0x27f033){return BPromise[_0x2897('0x36')](_0x27f033);}return _0x3a0049['save']();};}function saveUpdates(_0x4aba66,_0x134177){return function(_0x329dd2){if(_0x329dd2){return _0x329dd2['update'](_0x4aba66)[_0x2897('0x37')](function(_0x12f023){return _0x12f023;});}return null;};}function removeEntity(_0x407523,_0x4ec2a6){return function(_0x4a7a4e){if(_0x4a7a4e){return _0x4a7a4e[_0x2897('0x38')]()[_0x2897('0x37')](function(){_0x407523['status'](0xcc)[_0x2897('0x39')]();});}};}function handleEntityNotFound(_0x42f789,_0x4408d6){return function(_0x26bff9){if(!_0x26bff9){_0x42f789[_0x2897('0x3a')](0x194);}return _0x26bff9;};}function handleError(_0x1eb0e6,_0x3d8632){_0x3d8632=_0x3d8632||0x1f4;return function(_0x13ec7c){logger[_0x2897('0x29')](_0x13ec7c[_0x2897('0x3b')]);if(_0x13ec7c[_0x2897('0x3c')]){delete _0x13ec7c[_0x2897('0x3c')];}_0x1eb0e6['status'](_0x3d8632)['send'](_0x13ec7c);};}exports[_0x2897('0x3d')]=function(_0x1957e3,_0x457009){var _0x3d1ecb={},_0x30b6ec={},_0x3eea82={'count':0x0,'rows':[]};var _0x11c9a7=_[_0x2897('0x3e')](db[_0x2897('0x3f')]['rawAttributes'],function(_0x5ded23){return{'name':_0x5ded23['fieldName'],'type':_0x5ded23[_0x2897('0x40')][_0x2897('0x41')]};});_0x30b6ec[_0x2897('0x42')]=_[_0x2897('0x3e')](_0x11c9a7,_0x2897('0x3c'));_0x30b6ec['query']=_[_0x2897('0x43')](_0x1957e3[_0x2897('0x44')]);_0x30b6ec[_0x2897('0x45')]=_[_0x2897('0x46')](_0x30b6ec[_0x2897('0x42')],_0x30b6ec[_0x2897('0x44')]);_0x3d1ecb[_0x2897('0x47')]=_['intersection'](_0x30b6ec[_0x2897('0x42')],qs[_0x2897('0x48')](_0x1957e3[_0x2897('0x44')]['fields']));_0x3d1ecb[_0x2897('0x47')]=_0x3d1ecb['attributes']['length']?_0x3d1ecb[_0x2897('0x47')]:_0x30b6ec['model'];if(!_0x1957e3[_0x2897('0x44')][_0x2897('0x49')](_0x2897('0x4a'))){_0x3d1ecb[_0x2897('0x32')]=qs['limit'](_0x1957e3[_0x2897('0x44')][_0x2897('0x32')]);_0x3d1ecb[_0x2897('0x30')]=qs[_0x2897('0x30')](_0x1957e3['query'][_0x2897('0x30')]);}_0x3d1ecb[_0x2897('0x4b')]=qs[_0x2897('0x4c')](_0x1957e3[_0x2897('0x44')][_0x2897('0x4c')]);_0x3d1ecb[_0x2897('0x4d')]=qs[_0x2897('0x45')](_[_0x2897('0x4e')](_0x1957e3[_0x2897('0x44')],_0x30b6ec[_0x2897('0x45')]),_0x11c9a7);if(_0x1957e3[_0x2897('0x44')][_0x2897('0x4f')]){_0x3d1ecb['where']=_[_0x2897('0x50')](_0x3d1ecb[_0x2897('0x4d')],{'$or':_['map'](_0x11c9a7,function(_0x241830){if(_0x241830[_0x2897('0x40')]!==_0x2897('0x51')){var _0x1d4e4f={};_0x1d4e4f[_0x241830['name']]={'$like':'%'+_0x1957e3['query'][_0x2897('0x4f')]+'%'};return _0x1d4e4f;}})});}_0x3d1ecb=_[_0x2897('0x50')]({},_0x3d1ecb,_0x1957e3['options']);var _0x51e972={'where':_0x3d1ecb[_0x2897('0x4d')]};return db[_0x2897('0x3f')]['count'](_0x51e972)[_0x2897('0x37')](function(_0x18397a){_0x3eea82['count']=_0x18397a;if(_0x1957e3[_0x2897('0x44')][_0x2897('0x52')]){_0x3d1ecb[_0x2897('0x53')]=[{'all':!![]}];}return db['ChatMessage'][_0x2897('0x54')](_0x3d1ecb);})[_0x2897('0x37')](function(_0x4ae4aa){_0x3eea82[_0x2897('0x55')]=_0x4ae4aa;return _0x3eea82;})['then'](respondWithFilteredResult(_0x457009,_0x3d1ecb))[_0x2897('0x2d')](handleError(_0x457009,null));};exports[_0x2897('0x56')]=function(_0x4dc412,_0x1820ed){var _0x4582e3={'raw':!![],'where':{'id':_0x4dc412[_0x2897('0x57')]['id']}},_0x1d6610={};_0x1d6610[_0x2897('0x42')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x1d6610[_0x2897('0x44')]=_[_0x2897('0x43')](_0x4dc412['query']);_0x1d6610[_0x2897('0x45')]=_[_0x2897('0x46')](_0x1d6610['model'],_0x1d6610[_0x2897('0x44')]);_0x4582e3[_0x2897('0x47')]=_[_0x2897('0x46')](_0x1d6610['model'],qs[_0x2897('0x48')](_0x4dc412['query'][_0x2897('0x48')]));_0x4582e3[_0x2897('0x47')]=_0x4582e3['attributes'][_0x2897('0x58')]?_0x4582e3[_0x2897('0x47')]:_0x1d6610[_0x2897('0x42')];if(_0x4dc412[_0x2897('0x44')][_0x2897('0x52')]){_0x4582e3[_0x2897('0x53')]=[{'all':!![]}];}_0x4582e3=_[_0x2897('0x50')]({},_0x4582e3,_0x4dc412[_0x2897('0x59')]);return db['ChatMessage'][_0x2897('0x5a')](_0x4582e3)[_0x2897('0x37')](handleEntityNotFound(_0x1820ed,null))[_0x2897('0x37')](respondWithResult(_0x1820ed,null))[_0x2897('0x2d')](handleError(_0x1820ed,null));};exports[_0x2897('0x5b')]=function(_0x48b038,_0x24dc97){return db[_0x2897('0x3f')]['create'](_0x48b038['body'],{})[_0x2897('0x37')](respondWithResult(_0x24dc97,0xc9))['catch'](handleError(_0x24dc97,null));};exports[_0x2897('0x5c')]=function(_0x4d8af6,_0xc43214){if(_0x4d8af6[_0x2897('0x5d')]['id']){delete _0x4d8af6['body']['id'];}return db['ChatMessage'][_0x2897('0x5a')]({'where':{'id':_0x4d8af6[_0x2897('0x57')]['id']}})[_0x2897('0x37')](handleEntityNotFound(_0xc43214,null))['then'](saveUpdates(_0x4d8af6[_0x2897('0x5d')],null))['then'](respondWithResult(_0xc43214,null))[_0x2897('0x2d')](handleError(_0xc43214,null));};exports[_0x2897('0x38')]=function(_0x3eb982,_0x1ef863){return db['ChatMessage'][_0x2897('0x5a')]({'where':{'id':_0x3eb982['params']['id']}})[_0x2897('0x37')](handleEntityNotFound(_0x1ef863,null))[_0x2897('0x37')](removeEntity(_0x1ef863,null))[_0x2897('0x2d')](handleError(_0x1ef863,null));};exports[_0x2897('0x5e')]=function(_0x5cf38d,_0x32b310){return db[_0x2897('0x3f')][_0x2897('0x5e')]()[_0x2897('0x37')](respondWithResult(_0x32b310,null))[_0x2897('0x2d')](handleError(_0x32b310,null));};var interaction_log=require('../../config/logger')(_0x2897('0x5f'));exports[_0x2897('0x60')]=function(_0x310468,_0x557062,_0x323c91){var _0x2bbd48={'agent':{},'channel':_0x2897('0x61')};if(_0x310468[_0x2897('0x5d')]['id']){delete _0x310468['body']['id'];}_0x310468['body'][_0x2897('0x62')]=!![];_0x310468[_0x2897('0x5d')]['readAt']=moment()[_0x2897('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x310468['body']['UserId']=_0x310468['body']['UserId']||_0x310468[_0x2897('0x64')]['id'];_0x2bbd48[_0x2897('0x65')]['id']=_0x310468[_0x2897('0x5d')][_0x2897('0x66')];return db[_0x2897('0x3f')][_0x2897('0x5a')]({'where':{'id':_0x310468[_0x2897('0x57')]['id'],'UserId':null}})[_0x2897('0x37')](handleEntityNotFound(_0x557062,null))['then'](saveUpdates(_0x310468['body'],null))['then'](function(_0xe4545e){if(_0xe4545e){_0x2bbd48[_0x2897('0x2b')]=_0xe4545e[_0x2897('0x67')]({'plain':!![]});return db[_0x2897('0x68')][_0x2897('0x5a')]({'where':{'id':_0xe4545e['ChatInteractionId']}});}return null;})[_0x2897('0x37')](handleEntityNotFound(_0x557062,null))[_0x2897('0x37')](function(_0x35611c){if(_0x35611c){return _0x35611c[_0x2897('0x5c')]({'UserId':_0x310468[_0x2897('0x5d')][_0x2897('0x66')],'read1stAt':_['isNil'](_0x35611c[_0x2897('0x69')])?moment()[_0x2897('0x63')](_0x2897('0x6a')):undefined});}return null;})[_0x2897('0x37')](function(_0xd3c701){if(_0xd3c701){_0x2bbd48[_0x2897('0x6b')]=_0xd3c701[_0x2897('0x67')]({'plain':!![]});interaction_log['info'](_0x2897('0x6c'),_0x310468[_0x2897('0x64')]['id'],_0x310468[_0x2897('0x64')][_0x2897('0x3c')],_0x310468['user'][_0x2897('0x6d')],_0x2bbd48[_0x2897('0x6b')]['id'],_0x310468[_0x2897('0x5d')]?JSON[_0x2897('0x28')](_0x310468[_0x2897('0x5d')]):_0x2897('0x6e'));return respondWithRpcPromise(_0x2897('0x6f'),'acceptMessage',_0x2bbd48);}return null;})[_0x2897('0x37')](function(_0x576e13){var _0x448277=_0x2897('0x70')+_0x576e13['message'][_0x2897('0x71')];return db[_0x2897('0x72')][_0x2897('0x44')](_0x448277,{'type':db['Sequelize'][_0x2897('0x73')][_0x2897('0x74')],'raw':!![]})['then'](function(_0x9ab4c6){return _0x9ab4c6;});})[_0x2897('0x37')](function(_0x31323b){if(_0x31323b){_0x2bbd48[_0x2897('0x2b')]['contact']=_0x31323b[0x0];if(!_0x310468['body'][_0x2897('0x66')])return;return db[_0x2897('0x75')]['find']({'where':{'id':_0x310468[_0x2897('0x5d')][_0x2897('0x66')],'role':_0x2897('0x65')},'attributes':['id',_0x2897('0x3c'),'fullname','email',_0x2897('0x76')],'raw':!![]});}return null;})['then'](function(_0xc8d8b8){if(!_0xc8d8b8)return null;_0x2bbd48[_0x2897('0x2b')][_0x2897('0x65')]=_0xc8d8b8;return _0x2bbd48;})['then'](function(_0x74a973){if(_0x74a973){if(_0x310468['body']['manual']){_0x2bbd48[_0x2897('0x2b')]['interface']=util['format']('SIP/%s',_0x310468[_0x2897('0x64')][_0x2897('0x3c')]);_0x2bbd48[_0x2897('0x2b')][_0x2897('0x77')]=_0x2bbd48[_0x2897('0x77')];_0x2bbd48['message'][_0x2897('0x78')]=_0x2bbd48[_0x2897('0x77')];_0x2bbd48[_0x2897('0x2b')][_0x2897('0x79')]=_0x2897('0x60');return respondWithRpcPromise(_0x2897('0x7a'),_0x2897('0x7a'),{'event':'acceptmessage','message':_[_0x2897('0x50')](_0x2bbd48['message'],JSON[_0x2897('0x7b')](_0x2bbd48[_0x2897('0x6b')][_0x2897('0x7c')]))},client9002)[_0x2897('0x37')](function(){return _0x2bbd48;});}return _0x2bbd48;}return null;})[_0x2897('0x37')](respondWithResult(_0x557062,null))[_0x2897('0x2d')](handleError(_0x557062,null));};var interaction_log=require('../../config/logger')(_0x2897('0x5f'));exports['reject']=function(_0x3c2746,_0x8e76a1,_0x192faa){var _0x4d8670={'agent':{},'channel':_0x2897('0x61')};if(_0x3c2746[_0x2897('0x5d')]['id']){delete _0x3c2746[_0x2897('0x5d')]['id'];}_0x3c2746[_0x2897('0x5d')][_0x2897('0x66')]=_0x3c2746[_0x2897('0x5d')]['UserId']||_0x3c2746['user']['id'];_0x4d8670[_0x2897('0x65')]['id']=_0x3c2746[_0x2897('0x5d')][_0x2897('0x66')];return db['ChatMessage'][_0x2897('0x5a')]({'where':{'id':_0x3c2746[_0x2897('0x57')]['id'],'UserId':null}})[_0x2897('0x37')](handleEntityNotFound(_0x8e76a1,null))[_0x2897('0x37')](function(_0x2dc7d5){if(_0x2dc7d5){_0x4d8670[_0x2897('0x2b')]=_0x2dc7d5[_0x2897('0x67')]({'plain':!![]});return db[_0x2897('0x68')][_0x2897('0x5a')]({'where':{'id':_0x2dc7d5[_0x2897('0x7d')]}});}return null;})[_0x2897('0x37')](handleEntityNotFound(_0x8e76a1,null))['then'](function(_0x5bdb7c){if(_0x5bdb7c){_0x4d8670[_0x2897('0x6b')]=_0x5bdb7c[_0x2897('0x67')]({'plain':!![]});interaction_log[_0x2897('0x24')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3c2746[_0x2897('0x64')]['id'],_0x3c2746[_0x2897('0x64')][_0x2897('0x3c')],_0x3c2746[_0x2897('0x64')]['role'],_0x4d8670[_0x2897('0x6b')]['id'],_0x3c2746[_0x2897('0x5d')]?JSON[_0x2897('0x28')](_0x3c2746['body']):_0x2897('0x6e'));return respondWithRpcPromise(_0x2897('0x7e'),_0x2897('0x7f'),_0x4d8670);}return null;})['then'](function(_0x2fdcc6){var _0x343092=_0x2897('0x70')+_0x2fdcc6[_0x2897('0x2b')]['ContactId'];return db[_0x2897('0x72')]['query'](_0x343092,{'type':db[_0x2897('0x80')]['QueryTypes']['SELECT'],'raw':!![]})[_0x2897('0x37')](function(_0x3dde02){return _0x3dde02;});})[_0x2897('0x37')](function(_0x39a2dd){if(_0x39a2dd){_0x4d8670[_0x2897('0x2b')][_0x2897('0x81')]=_0x39a2dd[0x0];if(!_0x3c2746['body']['UserId'])return;return db[_0x2897('0x75')][_0x2897('0x5a')]({'where':{'id':_0x3c2746['body']['UserId'],'role':_0x2897('0x65')},'attributes':['id',_0x2897('0x3c'),_0x2897('0x82'),_0x2897('0x83'),_0x2897('0x76')],'raw':!![]});}return null;})[_0x2897('0x37')](function(_0x2eb32b){if(!_0x2eb32b)return null;_0x4d8670[_0x2897('0x2b')]['agent']=_0x2eb32b;return _0x4d8670;})['then'](function(_0x325356){if(_0x325356){_0x325356['message'][_0x2897('0x84')]=util[_0x2897('0x63')](_0x2897('0x85'),_0x3c2746[_0x2897('0x64')][_0x2897('0x3c')]);_0x325356[_0x2897('0x2b')][_0x2897('0x77')]=_0x4d8670[_0x2897('0x77')];_0x325356[_0x2897('0x2b')]['motionChannel']=_0x4d8670[_0x2897('0x77')];_0x325356[_0x2897('0x2b')]['event']=_0x2897('0x36');respondWithRpcPromise(_0x2897('0x7a'),_0x2897('0x7a'),{'event':_0x2897('0x86'),'message':_[_0x2897('0x50')](_0x4d8670[_0x2897('0x2b')],JSON[_0x2897('0x7b')](_0x4d8670[_0x2897('0x6b')][_0x2897('0x7c')]))},client9002);return _0x4d8670;}return null;})['then'](respondWithResult(_0x8e76a1,null))[_0x2897('0x2d')](handleError(_0x8e76a1,null));};
\ No newline at end of file
+var _0x399e=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','merge','options','create','body','find','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','rejectMessage','internal','interface','format','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x26aa2a,_0x43643d){var _0x14121a=function(_0x27fdd0){while(--_0x27fdd0){_0x26aa2a['push'](_0x26aa2a['shift']());}};_0x14121a(++_0x43643d);}(_0x399e,0x106));var _0xe399=function(_0x32abb9,_0x5f0d36){_0x32abb9=_0x32abb9-0x0;var _0xbaa5f5=_0x399e[_0x32abb9];return _0xbaa5f5;};'use strict';var emlformat=require(_0xe399('0x0'));var rimraf=require(_0xe399('0x1'));var zipdir=require(_0xe399('0x2'));var jsonpatch=require(_0xe399('0x3'));var rp=require(_0xe399('0x4'));var moment=require(_0xe399('0x5'));var BPromise=require(_0xe399('0x6'));var Mustache=require(_0xe399('0x7'));var util=require(_0xe399('0x8'));var path=require(_0xe399('0x9'));var sox=require(_0xe399('0xa'));var csv=require('to-csv');var ejs=require(_0xe399('0xb'));var fs=require('fs');var fs_extra=require(_0xe399('0xc'));var _=require(_0xe399('0xd'));var squel=require(_0xe399('0xe'));var crypto=require(_0xe399('0xf'));var jsforce=require(_0xe399('0x10'));var deskjs=require(_0xe399('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe399('0x12'));var Papa=require(_0xe399('0x13'));var Redis=require('ioredis');var authService=require(_0xe399('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe399('0x15'));var hardwareService=require(_0xe399('0x16'));var logger=require(_0xe399('0x17'))(_0xe399('0x18'));var utils=require(_0xe399('0x19'));var config=require(_0xe399('0x1a'));var licenseUtil=require(_0xe399('0x1b'));var db=require(_0xe399('0x1c'))['db'];config[_0xe399('0x1d')]=_[_0xe399('0x1e')](config[_0xe399('0x1d')],{'host':_0xe399('0x1f'),'port':0x18eb});var socket=require(_0xe399('0x20'))(new Redis(config[_0xe399('0x1d')]));require(_0xe399('0x21'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe399('0x22')][_0xe399('0x23')]({'port':0x232c});var client9002=jayson['client'][_0xe399('0x23')]({'port':0x232a});function respondWithRpcPromise(_0xdcc869,_0xd5ab09,_0x5b3926,_0x1c38c5){return new BPromise(function(_0xf03f5e,_0x7a0ad8){var _0x280629=_0x1c38c5||client;return _0x280629[_0xe399('0x24')](_0xdcc869,_0x5b3926)[_0xe399('0x25')](function(_0x2da7d2){logger[_0xe399('0x26')](_0xe399('0x27'),_0xd5ab09,_0xe399('0x28'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xd5ab09,_0xe399('0x28'),JSON[_0xe399('0x29')](_0x2da7d2));if(_0x2da7d2['error']){if(_0x2da7d2['error'][_0xe399('0x2a')]===0x1f4){logger[_0xe399('0x2b')](_0xe399('0x27'),_0xd5ab09,_0x2da7d2[_0xe399('0x2b')]['message']);return _0x7a0ad8(_0x2da7d2['error'][_0xe399('0x2c')]);}logger[_0xe399('0x2b')](_0xe399('0x27'),_0xd5ab09,_0x2da7d2[_0xe399('0x2b')][_0xe399('0x2c')]);return _0xf03f5e(_0x2da7d2['error'][_0xe399('0x2c')]);}else{logger[_0xe399('0x26')]('ChatMessage,\x20%s,\x20%s',_0xd5ab09,_0xe399('0x28'));_0xf03f5e(_0x2da7d2[_0xe399('0x2d')][_0xe399('0x2c')]);}})['catch'](function(_0x45b731){logger[_0xe399('0x2b')](_0xe399('0x27'),_0xd5ab09,_0x45b731);_0x7a0ad8(_0x45b731);});});}function respondWithStatusCode(_0x38dba4,_0x5f5988){_0x5f5988=_0x5f5988||0xcc;return function(_0x36a743){if(_0x36a743){return _0x38dba4['sendStatus'](_0x5f5988);}return _0x38dba4[_0xe399('0x2e')](_0x5f5988)[_0xe399('0x2f')]();};}function respondWithResult(_0x2e7a8a,_0x225d4e){_0x225d4e=_0x225d4e||0xc8;return function(_0x38df42){if(_0x38df42){return _0x2e7a8a[_0xe399('0x2e')](_0x225d4e)[_0xe399('0x30')](_0x38df42);}};}function respondWithFilteredResult(_0x121824,_0x3aad2a){return function(_0x315aae){if(_0x315aae){var _0x54e532=typeof _0x3aad2a[_0xe399('0x31')]===_0xe399('0x32')&&typeof _0x3aad2a[_0xe399('0x33')]===_0xe399('0x32');var _0x1708bc=_0x315aae['count'];var _0x4a8ede=_0x54e532?0x0:_0x3aad2a[_0xe399('0x31')];var _0x45e9e8=_0x54e532?_0x315aae[_0xe399('0x34')]:_0x3aad2a[_0xe399('0x31')]+_0x3aad2a['limit'];var _0x2b8567;if(_0x45e9e8>=_0x1708bc){_0x45e9e8=_0x1708bc;_0x2b8567=0xc8;}else{_0x2b8567=0xce;}_0x121824[_0xe399('0x2e')](_0x2b8567);return _0x121824[_0xe399('0x35')](_0xe399('0x36'),_0x4a8ede+'-'+_0x45e9e8+'/'+_0x1708bc)[_0xe399('0x30')](_0x315aae);}return null;};}function patchUpdates(_0x253ea4){return function(_0x50e66f){try{jsonpatch[_0xe399('0x37')](_0x50e66f,_0x253ea4,!![]);}catch(_0x933cbb){return BPromise[_0xe399('0x38')](_0x933cbb);}return _0x50e66f[_0xe399('0x39')]();};}function saveUpdates(_0x510b05,_0x2eff9a){return function(_0x910917){if(_0x910917){return _0x910917[_0xe399('0x3a')](_0x510b05)['then'](function(_0x150882){return _0x150882;});}return null;};}function removeEntity(_0x217fb6,_0x5418c9){return function(_0x304b69){if(_0x304b69){return _0x304b69[_0xe399('0x3b')]()[_0xe399('0x25')](function(){_0x217fb6['status'](0xcc)[_0xe399('0x2f')]();});}};}function handleEntityNotFound(_0x56cafd,_0x35bdb4){return function(_0x4fbb5c){if(!_0x4fbb5c){_0x56cafd['sendStatus'](0x194);}return _0x4fbb5c;};}function handleError(_0x2e1f9b,_0x4e6be1){_0x4e6be1=_0x4e6be1||0x1f4;return function(_0x1747d1){logger[_0xe399('0x2b')](_0x1747d1[_0xe399('0x3c')]);if(_0x1747d1[_0xe399('0x3d')]){delete _0x1747d1[_0xe399('0x3d')];}_0x2e1f9b[_0xe399('0x2e')](_0x4e6be1)[_0xe399('0x3e')](_0x1747d1);};}exports[_0xe399('0x3f')]=function(_0xd7e94,_0x5521e1){var _0x19b3ea={},_0x4a6740={},_0x367ddc={'count':0x0,'rows':[]};var _0xa6aa2b=_[_0xe399('0x40')](db[_0xe399('0x41')][_0xe399('0x42')],function(_0x4f2b42){return{'name':_0x4f2b42['fieldName'],'type':_0x4f2b42[_0xe399('0x43')][_0xe399('0x44')]};});_0x4a6740[_0xe399('0x45')]=_['map'](_0xa6aa2b,_0xe399('0x3d'));_0x4a6740[_0xe399('0x46')]=_[_0xe399('0x47')](_0xd7e94['query']);_0x4a6740[_0xe399('0x48')]=_[_0xe399('0x49')](_0x4a6740[_0xe399('0x45')],_0x4a6740[_0xe399('0x46')]);_0x19b3ea[_0xe399('0x4a')]=_[_0xe399('0x49')](_0x4a6740['model'],qs[_0xe399('0x4b')](_0xd7e94[_0xe399('0x46')][_0xe399('0x4b')]));_0x19b3ea[_0xe399('0x4a')]=_0x19b3ea['attributes'][_0xe399('0x4c')]?_0x19b3ea[_0xe399('0x4a')]:_0x4a6740[_0xe399('0x45')];if(!_0xd7e94[_0xe399('0x46')][_0xe399('0x4d')](_0xe399('0x4e'))){_0x19b3ea[_0xe399('0x33')]=qs['limit'](_0xd7e94[_0xe399('0x46')][_0xe399('0x33')]);_0x19b3ea['offset']=qs[_0xe399('0x31')](_0xd7e94['query'][_0xe399('0x31')]);}_0x19b3ea['order']=qs['sort'](_0xd7e94[_0xe399('0x46')][_0xe399('0x4f')]);_0x19b3ea['where']=qs[_0xe399('0x48')](_['pick'](_0xd7e94[_0xe399('0x46')],_0x4a6740['filters']),_0xa6aa2b);if(_0xd7e94[_0xe399('0x46')][_0xe399('0x50')]){_0x19b3ea['where']=_['merge'](_0x19b3ea[_0xe399('0x51')],{'$or':_['map'](_0xa6aa2b,function(_0x30bbd9){if(_0x30bbd9[_0xe399('0x43')]!==_0xe399('0x52')){var _0x49e6e3={};_0x49e6e3[_0x30bbd9['name']]={'$like':'%'+_0xd7e94[_0xe399('0x46')][_0xe399('0x50')]+'%'};return _0x49e6e3;}})});}_0x19b3ea=_['merge']({},_0x19b3ea,_0xd7e94['options']);var _0x552d50={'where':_0x19b3ea[_0xe399('0x51')]};return db[_0xe399('0x41')][_0xe399('0x34')](_0x552d50)[_0xe399('0x25')](function(_0x9446fb){_0x367ddc[_0xe399('0x34')]=_0x9446fb;if(_0xd7e94['query'][_0xe399('0x53')]){_0x19b3ea['include']=[{'all':!![]}];}return db[_0xe399('0x41')][_0xe399('0x54')](_0x19b3ea);})[_0xe399('0x25')](function(_0x48db6f){_0x367ddc[_0xe399('0x55')]=_0x48db6f;return _0x367ddc;})[_0xe399('0x25')](respondWithFilteredResult(_0x5521e1,_0x19b3ea))[_0xe399('0x56')](handleError(_0x5521e1,null));};exports[_0xe399('0x57')]=function(_0xcd78cb,_0x22e4dc){var _0x1284ed={'raw':!![],'where':{'id':_0xcd78cb[_0xe399('0x58')]['id']}},_0x4887a3={};_0x4887a3[_0xe399('0x45')]=_[_0xe399('0x47')](db[_0xe399('0x41')]['rawAttributes']);_0x4887a3[_0xe399('0x46')]=_['keys'](_0xcd78cb[_0xe399('0x46')]);_0x4887a3[_0xe399('0x48')]=_[_0xe399('0x49')](_0x4887a3[_0xe399('0x45')],_0x4887a3['query']);_0x1284ed[_0xe399('0x4a')]=_['intersection'](_0x4887a3[_0xe399('0x45')],qs[_0xe399('0x4b')](_0xcd78cb[_0xe399('0x46')][_0xe399('0x4b')]));_0x1284ed[_0xe399('0x4a')]=_0x1284ed[_0xe399('0x4a')][_0xe399('0x4c')]?_0x1284ed['attributes']:_0x4887a3['model'];if(_0xcd78cb[_0xe399('0x46')][_0xe399('0x53')]){_0x1284ed[_0xe399('0x59')]=[{'all':!![]}];}_0x1284ed=_[_0xe399('0x5a')]({},_0x1284ed,_0xcd78cb[_0xe399('0x5b')]);return db[_0xe399('0x41')]['find'](_0x1284ed)[_0xe399('0x25')](handleEntityNotFound(_0x22e4dc,null))[_0xe399('0x25')](respondWithResult(_0x22e4dc,null))['catch'](handleError(_0x22e4dc,null));};exports[_0xe399('0x5c')]=function(_0x1dc7cb,_0x4300a9){return db[_0xe399('0x41')][_0xe399('0x5c')](_0x1dc7cb[_0xe399('0x5d')],{})['then'](respondWithResult(_0x4300a9,0xc9))['catch'](handleError(_0x4300a9,null));};exports[_0xe399('0x3a')]=function(_0x2ede9e,_0x502080){if(_0x2ede9e[_0xe399('0x5d')]['id']){delete _0x2ede9e[_0xe399('0x5d')]['id'];}return db['ChatMessage'][_0xe399('0x5e')]({'where':{'id':_0x2ede9e['params']['id']}})[_0xe399('0x25')](handleEntityNotFound(_0x502080,null))[_0xe399('0x25')](saveUpdates(_0x2ede9e[_0xe399('0x5d')],null))[_0xe399('0x25')](respondWithResult(_0x502080,null))[_0xe399('0x56')](handleError(_0x502080,null));};exports[_0xe399('0x3b')]=function(_0x406923,_0x28fbae){return db[_0xe399('0x41')][_0xe399('0x5e')]({'where':{'id':_0x406923[_0xe399('0x58')]['id']}})[_0xe399('0x25')](handleEntityNotFound(_0x28fbae,null))['then'](removeEntity(_0x28fbae,null))[_0xe399('0x56')](handleError(_0x28fbae,null));};exports[_0xe399('0x5f')]=function(_0x38ad8b,_0x1f847b){return db[_0xe399('0x41')]['describe']()[_0xe399('0x25')](respondWithResult(_0x1f847b,null))[_0xe399('0x56')](handleError(_0x1f847b,null));};var interaction_log=require('../../config/logger')(_0xe399('0x60'));exports[_0xe399('0x61')]=function(_0x5596e2,_0x111b42,_0x5d5ab4){var _0x3c2986={'agent':{},'channel':_0xe399('0x62')};if(_0x5596e2[_0xe399('0x5d')]['id']){delete _0x5596e2[_0xe399('0x5d')]['id'];}_0x5596e2['body'][_0xe399('0x63')]=!![];_0x5596e2[_0xe399('0x5d')][_0xe399('0x64')]=moment()['format'](_0xe399('0x65'));_0x5596e2[_0xe399('0x5d')][_0xe399('0x66')]=_0x5596e2[_0xe399('0x5d')][_0xe399('0x66')]||_0x5596e2[_0xe399('0x67')]['id'];_0x3c2986['agent']['id']=_0x5596e2[_0xe399('0x5d')][_0xe399('0x66')];return db[_0xe399('0x41')][_0xe399('0x5e')]({'where':{'id':_0x5596e2[_0xe399('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x111b42,null))[_0xe399('0x25')](saveUpdates(_0x5596e2['body'],null))[_0xe399('0x25')](function(_0x4b4aa4){if(_0x4b4aa4){_0x3c2986['message']=_0x4b4aa4[_0xe399('0x68')]({'plain':!![]});return db[_0xe399('0x69')]['find']({'where':{'id':_0x4b4aa4[_0xe399('0x6a')]}});}return null;})[_0xe399('0x25')](handleEntityNotFound(_0x111b42,null))['then'](function(_0x3e8d72){if(_0x3e8d72){return _0x3e8d72['update']({'UserId':_0x5596e2[_0xe399('0x5d')]['UserId'],'read1stAt':_['isNil'](_0x3e8d72[_0xe399('0x6b')])?moment()['format'](_0xe399('0x65')):undefined});}return null;})[_0xe399('0x25')](function(_0xff632a){if(_0xff632a){_0x3c2986[_0xe399('0x6c')]=_0xff632a[_0xe399('0x68')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5596e2[_0xe399('0x67')]['id'],_0x5596e2[_0xe399('0x67')][_0xe399('0x3d')],_0x5596e2[_0xe399('0x67')][_0xe399('0x6d')],_0x3c2986[_0xe399('0x6c')]['id'],_0x5596e2[_0xe399('0x5d')]?JSON[_0xe399('0x29')](_0x5596e2['body']):_0xe399('0x6e'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3c2986);}return null;})['then'](function(_0x41b55b){var _0x5ea985=_0xe399('0x6f')+_0x41b55b[_0xe399('0x2c')][_0xe399('0x70')];return db[_0xe399('0x71')][_0xe399('0x46')](_0x5ea985,{'type':db[_0xe399('0x72')][_0xe399('0x73')][_0xe399('0x74')],'raw':!![]})[_0xe399('0x25')](function(_0x3f2662){return _0x3f2662;});})[_0xe399('0x25')](function(_0x2279bf){if(_0x2279bf){_0x3c2986[_0xe399('0x2c')][_0xe399('0x75')]=_0x2279bf[0x0];if(!_0x5596e2[_0xe399('0x5d')][_0xe399('0x66')])return;return db[_0xe399('0x76')]['find']({'where':{'id':_0x5596e2[_0xe399('0x5d')][_0xe399('0x66')],'role':_0xe399('0x77')},'attributes':['id',_0xe399('0x3d'),_0xe399('0x78'),_0xe399('0x79'),'internal'],'raw':!![]});}return null;})[_0xe399('0x25')](function(_0x4f9039){if(!_0x4f9039)return null;_0x3c2986[_0xe399('0x2c')][_0xe399('0x77')]=_0x4f9039;return _0x3c2986;})[_0xe399('0x25')](function(_0x5aa129){if(_0x5aa129){if(_0x5596e2['body'][_0xe399('0x7a')]){_0x3c2986[_0xe399('0x2c')]['interface']=util['format'](_0xe399('0x7b'),_0x5596e2[_0xe399('0x67')]['name']);_0x3c2986['message'][_0xe399('0x7c')]=_0x3c2986['channel'];_0x3c2986[_0xe399('0x2c')][_0xe399('0x7d')]=_0x3c2986['channel'];_0x3c2986[_0xe399('0x2c')][_0xe399('0x7e')]=_0xe399('0x61');return respondWithRpcPromise(_0xe399('0x7f'),_0xe399('0x7f'),{'event':_0xe399('0x80'),'message':_[_0xe399('0x5a')](_0x3c2986[_0xe399('0x2c')],JSON[_0xe399('0x81')](_0x3c2986[_0xe399('0x6c')][_0xe399('0x82')]))},client9002)[_0xe399('0x25')](function(){return _0x3c2986;});}return _0x3c2986;}return null;})[_0xe399('0x25')](respondWithResult(_0x111b42,null))[_0xe399('0x56')](handleError(_0x111b42,null));};var interaction_log=require('../../config/logger')(_0xe399('0x60'));exports[_0xe399('0x38')]=function(_0x3d7fab,_0x15ee6e,_0x4fab9d){var _0x325cfc={'agent':{},'channel':_0xe399('0x62')};if(_0x3d7fab[_0xe399('0x5d')]['id']){delete _0x3d7fab[_0xe399('0x5d')]['id'];}_0x3d7fab[_0xe399('0x5d')][_0xe399('0x66')]=_0x3d7fab[_0xe399('0x5d')]['UserId']||_0x3d7fab['user']['id'];_0x325cfc[_0xe399('0x77')]['id']=_0x3d7fab[_0xe399('0x5d')][_0xe399('0x66')];return db[_0xe399('0x41')]['find']({'where':{'id':_0x3d7fab[_0xe399('0x58')]['id'],'UserId':null}})[_0xe399('0x25')](handleEntityNotFound(_0x15ee6e,null))[_0xe399('0x25')](function(_0x53af5d){if(_0x53af5d){_0x325cfc[_0xe399('0x2c')]=_0x53af5d[_0xe399('0x68')]({'plain':!![]});return db[_0xe399('0x69')][_0xe399('0x5e')]({'where':{'id':_0x53af5d['ChatInteractionId']}});}return null;})[_0xe399('0x25')](handleEntityNotFound(_0x15ee6e,null))[_0xe399('0x25')](function(_0x5c65a7){if(_0x5c65a7){_0x325cfc[_0xe399('0x6c')]=_0x5c65a7[_0xe399('0x68')]({'plain':!![]});interaction_log[_0xe399('0x26')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3d7fab[_0xe399('0x67')]['id'],_0x3d7fab[_0xe399('0x67')][_0xe399('0x3d')],_0x3d7fab[_0xe399('0x67')][_0xe399('0x6d')],_0x325cfc[_0xe399('0x6c')]['id'],_0x3d7fab[_0xe399('0x5d')]?JSON[_0xe399('0x29')](_0x3d7fab[_0xe399('0x5d')]):_0xe399('0x6e'));return respondWithRpcPromise('RejectMessage',_0xe399('0x83'),_0x325cfc);}return null;})['then'](function(_0x1499ab){var _0x42085d=_0xe399('0x6f')+_0x1499ab[_0xe399('0x2c')][_0xe399('0x70')];return db['sequelize'][_0xe399('0x46')](_0x42085d,{'type':db[_0xe399('0x72')][_0xe399('0x73')][_0xe399('0x74')],'raw':!![]})[_0xe399('0x25')](function(_0x312274){return _0x312274;});})[_0xe399('0x25')](function(_0x30aab2){if(_0x30aab2){_0x325cfc[_0xe399('0x2c')]['contact']=_0x30aab2[0x0];if(!_0x3d7fab[_0xe399('0x5d')][_0xe399('0x66')])return;return db['User'][_0xe399('0x5e')]({'where':{'id':_0x3d7fab[_0xe399('0x5d')][_0xe399('0x66')],'role':'agent'},'attributes':['id',_0xe399('0x3d'),_0xe399('0x78'),_0xe399('0x79'),_0xe399('0x84')],'raw':!![]});}return null;})['then'](function(_0x4b8c04){if(!_0x4b8c04)return null;_0x325cfc[_0xe399('0x2c')][_0xe399('0x77')]=_0x4b8c04;return _0x325cfc;})[_0xe399('0x25')](function(_0x4486a3){if(_0x4486a3){_0x4486a3['message'][_0xe399('0x85')]=util[_0xe399('0x86')](_0xe399('0x7b'),_0x3d7fab[_0xe399('0x67')]['name']);_0x4486a3[_0xe399('0x2c')][_0xe399('0x7c')]=_0x325cfc[_0xe399('0x7c')];_0x4486a3[_0xe399('0x2c')][_0xe399('0x7d')]=_0x325cfc[_0xe399('0x7c')];_0x4486a3[_0xe399('0x2c')][_0xe399('0x7e')]=_0xe399('0x38');respondWithRpcPromise('EventManager','EventManager',{'event':_0xe399('0x87'),'message':_[_0xe399('0x5a')](_0x325cfc[_0xe399('0x2c')],JSON['parse'](_0x325cfc['interaction'][_0xe399('0x82')]))},client9002);return _0x325cfc;}return null;})[_0xe399('0x25')](respondWithResult(_0x15ee6e,null))['catch'](handleError(_0x15ee6e,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 82fc616..ccb1813 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 _0xbf87=['save','update','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xa71904,_0x21363f){var _0x507060=function(_0x4ac794){while(--_0x4ac794){_0xa71904['push'](_0xa71904['shift']());}};_0x507060(++_0x21363f);}(_0xbf87,0x11d));var _0x7bf8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbf87[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x7bf8('0x0'));var ChatMessage=require(_0x7bf8('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7bf8('0x2')](0x0);var events={'afterCreate':_0x7bf8('0x3'),'afterUpdate':_0x7bf8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52b631){return function(_0x534fe5,_0x4ce692,_0x54ce0f){ChatMessageEvents['emit'](_0x52b631+':'+_0x534fe5['id'],_0x534fe5);ChatMessageEvents[_0x7bf8('0x5')](_0x52b631,_0x534fe5);_0x54ce0f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7bf8('0x6')](e,emitEvent(event));}}module[_0x7bf8('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xd676=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x33e4dd,_0x3413a2){var _0x4b0e75=function(_0x7c957){while(--_0x7c957){_0x33e4dd['push'](_0x33e4dd['shift']());}};_0x4b0e75(++_0x3413a2);}(_0xd676,0x1c8));var _0x6d67=function(_0x466c42,_0x17d7c1){_0x466c42=_0x466c42-0x0;var _0x2a833f=_0xd676[_0x466c42];return _0x2a833f;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x6d67('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6d67('0x1')](0x0);var events={'afterCreate':_0x6d67('0x2'),'afterUpdate':_0x6d67('0x3'),'afterDestroy':_0x6d67('0x4')};function emitEvent(_0x12ef7d){return function(_0x35493b,_0x272f05,_0x42ca14){ChatMessageEvents[_0x6d67('0x5')](_0x12ef7d+':'+_0x35493b['id'],_0x35493b);ChatMessageEvents['emit'](_0x12ef7d,_0x35493b);_0x42ca14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x6d67('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 9dcb873..4ed2471 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 _0xef45=['catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update'];(function(_0x4c9e04,_0x1f12e1){var _0x391e86=function(_0x57f7ae){while(--_0x57f7ae){_0x4c9e04['push'](_0x4c9e04['shift']());}};_0x391e86(++_0x1f12e1);}(_0xef45,0xe3));var _0x5ef4=function(_0x3ee0e1,_0x3193b1){_0x3ee0e1=_0x3ee0e1-0x0;var _0x42be7b=_0xef45[_0x3ee0e1];return _0x42be7b;};'use strict';var _=require(_0x5ef4('0x0'));var util=require(_0x5ef4('0x1'));var logger=require(_0x5ef4('0x2'))(_0x5ef4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ef4('0x4'));var rimraf=require(_0x5ef4('0x5'));var config=require(_0x5ef4('0x6'));var attributes=require('./chatMessage.attributes');module[_0x5ef4('0x7')]=function(_0x3bd46c,_0x95d6d9){return _0x3bd46c[_0x5ef4('0x8')]('ChatMessage',attributes,{'tableName':_0x5ef4('0x9'),'paranoid':![],'indexes':[{'name':_0x5ef4('0xa'),'fields':[_0x5ef4('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14ee1f,_0x45ada7,_0x3142d1){var _0x407eff=_0x3bd46c[_0x5ef4('0xc')];var _0x4b17f1=_0x14ee1f[_0x5ef4('0xd')]({'plain':!![]});if(_0x4b17f1[_0x5ef4('0xe')][_0x5ef4('0xf')]()==='in'||_0x4b17f1[_0x5ef4('0xe')]['toLowerCase']()===_0x5ef4('0x10')&&!_0x4b17f1[_0x5ef4('0x11')]&&!_[_0x5ef4('0x12')](_0x4b17f1[_0x5ef4('0x13')])){_0x407eff[_0x5ef4('0x14')][_0x5ef4('0x15')]({'where':{'id':_0x4b17f1[_0x5ef4('0x16')]}})[_0x5ef4('0x17')](function(_0x107dd6){if(_0x107dd6){_0x107dd6[_0x5ef4('0x18')]({'lastMsgAt':_0x4b17f1['createdAt'],'lastMsgDirection':_0x4b17f1[_0x5ef4('0xe')]['toLowerCase']()});}})[_0x5ef4('0x19')](function(_0x4b87f7){console[_0x5ef4('0x1a')](_0x4b87f7);});}_0x3142d1();}},'charset':'utf8mb4','collate':_0x5ef4('0x1b')});};
\ No newline at end of file
+var _0xdd92=['FULLTEXT','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body'];(function(_0x430459,_0x58519c){var _0x3a2439=function(_0x27a0b3){while(--_0x27a0b3){_0x430459['push'](_0x430459['shift']());}};_0x3a2439(++_0x58519c);}(_0xdd92,0x188));var _0x2dd9=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xdd92[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x2dd9('0x0'));var util=require(_0x2dd9('0x1'));var logger=require(_0x2dd9('0x2'))(_0x2dd9('0x3'));var moment=require('moment');var BPromise=require(_0x2dd9('0x4'));var rp=require(_0x2dd9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dd9('0x6'));var config=require('../../config/environment');var attributes=require(_0x2dd9('0x7'));module[_0x2dd9('0x8')]=function(_0x2a394f,_0x2a0348){return _0x2a394f['define'](_0x2dd9('0x9'),attributes,{'tableName':_0x2dd9('0xa'),'paranoid':![],'indexes':[{'name':_0x2dd9('0xb'),'fields':[_0x2dd9('0xc')],'type':_0x2dd9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x243d91,_0x2b34ee,_0x2606ad){var _0x37b0b7=_0x2a394f['models'];var _0x2882ed=_0x243d91['get']({'plain':!![]});if(_0x2882ed[_0x2dd9('0xe')][_0x2dd9('0xf')]()==='in'||_0x2882ed[_0x2dd9('0xe')][_0x2dd9('0xf')]()===_0x2dd9('0x10')&&!_0x2882ed[_0x2dd9('0x11')]&&!_['isNil'](_0x2882ed[_0x2dd9('0x12')])){_0x37b0b7[_0x2dd9('0x13')][_0x2dd9('0x14')]({'where':{'id':_0x2882ed[_0x2dd9('0x15')]}})['then'](function(_0x347402){if(_0x347402){_0x347402[_0x2dd9('0x16')]({'lastMsgAt':_0x2882ed['createdAt'],'lastMsgDirection':_0x2882ed[_0x2dd9('0xe')][_0x2dd9('0xf')]()});}})[_0x2dd9('0x17')](function(_0x31b1bd){console[_0x2dd9('0x18')](_0x31b1bd);});}_0x2606ad();}},'charset':_0x2dd9('0x19'),'collate':_0x2dd9('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index bc3c617..9ee6fcc 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 _0x69d1=['request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','stringify','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x2649aa,_0x34c0c3){var _0x3cde1c=function(_0x5059d3){while(--_0x5059d3){_0x2649aa['push'](_0x2649aa['shift']());}};_0x3cde1c(++_0x34c0c3);}(_0x69d1,0xdd));var _0x169d=function(_0x13485b,_0x29fb3e){_0x13485b=_0x13485b-0x0;var _0x4ae5e8=_0x69d1[_0x13485b];return _0x4ae5e8;};'use strict';var _=require('lodash');var util=require(_0x169d('0x0'));var moment=require(_0x169d('0x1'));var BPromise=require(_0x169d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x169d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x169d('0x4'));var logger=require(_0x169d('0x5'))(_0x169d('0x6'));var config=require(_0x169d('0x7'));var jayson=require(_0x169d('0x8'));var client=jayson[_0x169d('0x9')][_0x169d('0xa')]({'port':0x232a});config['redis']=_[_0x169d('0xb')](config[_0x169d('0xc')],{'host':_0x169d('0xd'),'port':0x18eb});var socket=require(_0x169d('0xe'))(new Redis(config[_0x169d('0xc')]));require(_0x169d('0xf'))[_0x169d('0x10')](socket);function respondWithRpcPromise(_0x617d66,_0x2dc570,_0x247e69){return new BPromise(function(_0x38010a,_0x41f85d){return client[_0x169d('0x11')](_0x617d66,_0x247e69)[_0x169d('0x12')](function(_0x13676d){logger[_0x169d('0x13')](_0x169d('0x14'),_0x2dc570,_0x169d('0x15'));logger[_0x169d('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2dc570,'request\x20sent',JSON['stringify'](_0x13676d));if(_0x13676d[_0x169d('0x17')]){if(_0x13676d[_0x169d('0x17')][_0x169d('0x18')]===0x1f4){logger[_0x169d('0x17')](_0x169d('0x14'),_0x2dc570,_0x13676d[_0x169d('0x17')][_0x169d('0x19')]);return _0x41f85d(_0x13676d[_0x169d('0x17')][_0x169d('0x19')]);}logger[_0x169d('0x17')](_0x169d('0x14'),_0x2dc570,_0x13676d[_0x169d('0x17')][_0x169d('0x19')]);return _0x38010a(_0x13676d[_0x169d('0x17')][_0x169d('0x19')]);}else{logger['info'](_0x169d('0x14'),_0x2dc570,'request\x20sent');_0x38010a(_0x13676d[_0x169d('0x1a')][_0x169d('0x19')]);}})[_0x169d('0x1b')](function(_0x957cfc){logger[_0x169d('0x17')](_0x169d('0x14'),_0x2dc570,_0x957cfc);_0x41f85d(_0x957cfc);});});}exports[_0x169d('0x1c')]=function(_0x47bf84){var _0x5626fe=this;return new Promise(function(_0x43f537,_0x484889){return db[_0x169d('0x1d')][_0x169d('0x1e')](_0x47bf84['body'],{'raw':_0x47bf84['options']?_0x47bf84[_0x169d('0x1f')][_0x169d('0x20')]===undefined?!![]:![]:!![]})[_0x169d('0x12')](function(_0x118d17){logger[_0x169d('0x13')](_0x169d('0x1c'),_0x47bf84);logger[_0x169d('0x16')](_0x169d('0x1c'),_0x47bf84,JSON[_0x169d('0x21')](_0x118d17));_0x43f537(_0x118d17);})[_0x169d('0x1b')](function(_0x491565){logger[_0x169d('0x17')](_0x169d('0x1c'),_0x491565[_0x169d('0x19')],_0x47bf84);_0x484889(_0x5626fe[_0x169d('0x17')](0x1f4,_0x491565[_0x169d('0x19')]));});});};
\ No newline at end of file
+var _0x9a43=['catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x32ce1d,_0x172de1){var _0x373712=function(_0x33fc6c){while(--_0x33fc6c){_0x32ce1d['push'](_0x32ce1d['shift']());}};_0x373712(++_0x172de1);}(_0x9a43,0x143));var _0x39a4=function(_0x198247,_0x491c12){_0x198247=_0x198247-0x0;var _0x2b18bc=_0x9a43[_0x198247];return _0x2b18bc;};'use strict';var _=require(_0x39a4('0x0'));var util=require(_0x39a4('0x1'));var moment=require(_0x39a4('0x2'));var BPromise=require(_0x39a4('0x3'));var rs=require(_0x39a4('0x4'));var fs=require('fs');var Redis=require(_0x39a4('0x5'));var db=require(_0x39a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x39a4('0x7'))(_0x39a4('0x8'));var config=require(_0x39a4('0x9'));var jayson=require(_0x39a4('0xa'));var client=jayson[_0x39a4('0xb')]['http']({'port':0x232a});config['redis']=_[_0x39a4('0xc')](config['redis'],{'host':_0x39a4('0xd'),'port':0x18eb});var socket=require(_0x39a4('0xe'))(new Redis(config[_0x39a4('0xf')]));require(_0x39a4('0x10'))[_0x39a4('0x11')](socket);function respondWithRpcPromise(_0x4278f0,_0x8f248e,_0x5935f5){return new BPromise(function(_0x55f2e2,_0x58408f){return client['request'](_0x4278f0,_0x5935f5)['then'](function(_0x35e1fd){logger['info'](_0x39a4('0x12'),_0x8f248e,'request\x20sent');logger[_0x39a4('0x13')](_0x39a4('0x14'),_0x8f248e,_0x39a4('0x15'),JSON[_0x39a4('0x16')](_0x35e1fd));if(_0x35e1fd[_0x39a4('0x17')]){if(_0x35e1fd['error']['code']===0x1f4){logger[_0x39a4('0x17')](_0x39a4('0x12'),_0x8f248e,_0x35e1fd[_0x39a4('0x17')]['message']);return _0x58408f(_0x35e1fd[_0x39a4('0x17')][_0x39a4('0x18')]);}logger[_0x39a4('0x17')](_0x39a4('0x12'),_0x8f248e,_0x35e1fd['error'][_0x39a4('0x18')]);return _0x55f2e2(_0x35e1fd[_0x39a4('0x17')][_0x39a4('0x18')]);}else{logger[_0x39a4('0x19')](_0x39a4('0x12'),_0x8f248e,_0x39a4('0x15'));_0x55f2e2(_0x35e1fd[_0x39a4('0x1a')][_0x39a4('0x18')]);}})[_0x39a4('0x1b')](function(_0x4590f7){logger[_0x39a4('0x17')](_0x39a4('0x12'),_0x8f248e,_0x4590f7);_0x58408f(_0x4590f7);});});}exports[_0x39a4('0x1c')]=function(_0x403d57){var _0x469bd1=this;return new Promise(function(_0x2d6d21,_0x4b0b75){return db[_0x39a4('0x1d')][_0x39a4('0x1e')](_0x403d57[_0x39a4('0x1f')],{'raw':_0x403d57[_0x39a4('0x20')]?_0x403d57[_0x39a4('0x20')][_0x39a4('0x21')]===undefined?!![]:![]:!![]})[_0x39a4('0x22')](function(_0xe3d07b){logger[_0x39a4('0x19')](_0x39a4('0x1c'),_0x403d57);logger[_0x39a4('0x13')](_0x39a4('0x1c'),_0x403d57,JSON[_0x39a4('0x16')](_0xe3d07b));_0x2d6d21(_0xe3d07b);})[_0x39a4('0x1b')](function(_0x17490f){logger[_0x39a4('0x17')](_0x39a4('0x1c'),_0x17490f[_0x39a4('0x18')],_0x403d57);_0x4b0b75(_0x469bd1[_0x39a4('0x17')](0x1f4,_0x17490f[_0x39a4('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index fc1562e..53edce6 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 _0x56e7=['emit','removeListener','length','save','remove'];(function(_0x35d4e4,_0x19ea70){var _0x520d8a=function(_0x5455ed){while(--_0x5455ed){_0x35d4e4['push'](_0x35d4e4['shift']());}};_0x520d8a(++_0x19ea70);}(_0x56e7,0x7b));var _0x756e=function(_0x28efa0,_0x481587){_0x28efa0=_0x28efa0-0x0;var _0x110f72=_0x56e7[_0x28efa0];return _0x110f72;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x756e('0x0'),_0x756e('0x1'),'update'];function createListener(_0x2eadee,_0x3efe5c){return function(_0x46a672){_0x3efe5c[_0x756e('0x2')](_0x2eadee,_0x46a672);};}function removeListener(_0x11ce5f,_0x38546a){return function(){ChatMessageEvents[_0x756e('0x3')](_0x11ce5f,_0x38546a);};}exports['register']=function(_0x3b3b8f){for(var _0x404189=0x0,_0x26519d=events[_0x756e('0x4')];_0x404189<_0x26519d;_0x404189++){var _0x5c8589=events[_0x404189];var _0x1c6a22=createListener('chatMessage:'+_0x5c8589,_0x3b3b8f);ChatMessageEvents['on'](_0x5c8589,_0x1c6a22);}};
\ No newline at end of file
+var _0x91c6=['removeListener','register','chatMessage:','./chatMessage.events','update','emit'];(function(_0x584bc4,_0x526008){var _0x2c231c=function(_0xf9a356){while(--_0xf9a356){_0x584bc4['push'](_0x584bc4['shift']());}};_0x2c231c(++_0x526008);}(_0x91c6,0xf9));var _0x691c=function(_0x59b6ff,_0x348bf4){_0x59b6ff=_0x59b6ff-0x0;var _0x28e00b=_0x91c6[_0x59b6ff];return _0x28e00b;};'use strict';var ChatMessageEvents=require(_0x691c('0x0'));var events=['save','remove',_0x691c('0x1')];function createListener(_0x20c69c,_0xafe4d5){return function(_0xa59a0a){_0xafe4d5[_0x691c('0x2')](_0x20c69c,_0xa59a0a);};}function removeListener(_0x4944ce,_0xa14528){return function(){ChatMessageEvents[_0x691c('0x3')](_0x4944ce,_0xa14528);};}exports[_0x691c('0x4')]=function(_0x1b2e82){for(var _0x3dddf8=0x0,_0x29876a=events['length'];_0x3dddf8<_0x29876a;_0x3dddf8++){var _0x93b7b0=events[_0x3dddf8];var _0x40629a=createListener(_0x691c('0x5')+_0x93b7b0,_0x1b2e82);ChatMessageEvents['on'](_0x93b7b0,_0x40629a);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 4537fb9..1052830 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 _0x74e7=['post','create','put','update','/:id/accept','accept','/:id/reject','reject','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x5b5868,_0x5215e2){var _0x2decaa=function(_0x1ffbcc){while(--_0x1ffbcc){_0x5b5868['push'](_0x5b5868['shift']());}};_0x2decaa(++_0x5215e2);}(_0x74e7,0x1d6));var _0x774e=function(_0x54bb8c,_0x1b3e97){_0x54bb8c=_0x54bb8c-0x0;var _0x18ccc0=_0x74e7[_0x54bb8c];return _0x18ccc0;};'use strict';var multer=require(_0x774e('0x0'));var util=require(_0x774e('0x1'));var path=require(_0x774e('0x2'));var timeout=require('connect-timeout');var express=require(_0x774e('0x3'));var router=express['Router']();var fs_extra=require(_0x774e('0x4'));var auth=require(_0x774e('0x5'));var interaction=require(_0x774e('0x6'));var config=require('../../config/environment');var controller=require(_0x774e('0x7'));router[_0x774e('0x8')]('/',auth[_0x774e('0x9')](),controller[_0x774e('0xa')]);router[_0x774e('0x8')](_0x774e('0xb'),auth[_0x774e('0x9')](),controller['describe']);router[_0x774e('0x8')](_0x774e('0xc'),auth[_0x774e('0x9')](),controller[_0x774e('0xd')]);router[_0x774e('0xe')]('/',auth['isAuthenticated'](),interaction['tracked']('chat','chatmessage:create'),controller[_0x774e('0xf')]);router[_0x774e('0x10')]('/:id',controller[_0x774e('0x11')]);router[_0x774e('0x10')](_0x774e('0x12'),auth[_0x774e('0x9')](),controller[_0x774e('0x13')]);router[_0x774e('0x10')](_0x774e('0x14'),auth[_0x774e('0x9')](),controller[_0x774e('0x15')]);router['delete'](_0x774e('0xc'),auth[_0x774e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd046=['tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x1dcbbb,_0x5e0394){var _0x19d5d6=function(_0x57d24f){while(--_0x57d24f){_0x1dcbbb['push'](_0x1dcbbb['shift']());}};_0x19d5d6(++_0x5e0394);}(_0xd046,0xfb));var _0x6d04=function(_0x3162dc,_0x22e8ef){_0x3162dc=_0x3162dc-0x0;var _0x23183a=_0xd046[_0x3162dc];return _0x23183a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6d04('0x0'));var timeout=require('connect-timeout');var express=require(_0x6d04('0x1'));var router=express['Router']();var fs_extra=require(_0x6d04('0x2'));var auth=require(_0x6d04('0x3'));var interaction=require(_0x6d04('0x4'));var config=require(_0x6d04('0x5'));var controller=require('./chatMessage.controller');router[_0x6d04('0x6')]('/',auth['isAuthenticated'](),controller[_0x6d04('0x7')]);router[_0x6d04('0x6')]('/describe',auth[_0x6d04('0x8')](),controller[_0x6d04('0x9')]);router['get'](_0x6d04('0xa'),auth[_0x6d04('0x8')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')]('/',auth['isAuthenticated'](),interaction[_0x6d04('0xd')](_0x6d04('0xe'),_0x6d04('0xf')),controller[_0x6d04('0x10')]);router[_0x6d04('0x11')](_0x6d04('0xa'),controller[_0x6d04('0x12')]);router[_0x6d04('0x11')](_0x6d04('0x13'),auth[_0x6d04('0x8')](),controller[_0x6d04('0x14')]);router['put'](_0x6d04('0x15'),auth[_0x6d04('0x8')](),controller[_0x6d04('0x16')]);router[_0x6d04('0x17')](_0x6d04('0xa'),auth['isAuthenticated'](),controller['destroy']);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 351f5a5..017effd 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x28b29a,_0x2db6d4){var _0x306ac1=function(_0x4e005d){while(--_0x4e005d){_0x28b29a['push'](_0x28b29a['shift']());}};_0x306ac1(++_0x2db6d4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21a2e1,_0x548682){_0x21a2e1=_0x21a2e1-0x0;var _0x4f15e1=_0x5f2f[_0x21a2e1];return _0x4f15e1;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x4cbe5e,_0x29f27d){var _0x57cc37=function(_0x78debe){while(--_0x78debe){_0x4cbe5e['push'](_0x4cbe5e['shift']());}};_0x57cc37(++_0x29f27d);}(_0xadb5,0xad));var _0x5adb=function(_0x4d8e02,_0x806390){_0x4d8e02=_0x4d8e02-0x0;var _0x1b567e=_0xadb5[_0x4d8e02];return _0x1b567e;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 15c380c..45286d9 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(_0x3a4de8,_0x823276){var _0x4ca5a8=function(_0x883b7e){while(--_0x883b7e){_0x3a4de8['push'](_0x3a4de8['shift']());}};_0x4ca5a8(++_0x823276);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x7a54,0x106));var _0x47a5=function(_0x223d21,_0x1099ef){_0x223d21=_0x223d21-0x0;var _0x290052=_0x7a54[_0x223d21];return _0x290052;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 16da497..6b515f8 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 _0x00f0=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x48e49c,_0x18f577){var _0x4e0448=function(_0x5661e4){while(--_0x5661e4){_0x48e49c['push'](_0x48e49c['shift']());}};_0x4e0448(++_0x18f577);}(_0x00f0,0xec));var _0x000f=function(_0x4ae70d,_0x2f2082){_0x4ae70d=_0x4ae70d-0x0;var _0x446f8b=_0x00f0[_0x4ae70d];return _0x446f8b;};'use strict';var EventEmitter=require(_0x000f('0x0'));var ChatOfflineMessage=require(_0x000f('0x1'))['db'][_0x000f('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x000f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x000f('0x4')};function emitEvent(_0x4c8ce1){return function(_0x3cd8ed,_0x53989d,_0x3a0613){ChatOfflineMessageEvents[_0x000f('0x5')](_0x4c8ce1+':'+_0x3cd8ed['id'],_0x3cd8ed);ChatOfflineMessageEvents['emit'](_0x4c8ce1,_0x3cd8ed);_0x3a0613(null);};}for(var e in events){if(events[_0x000f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x000f('0x7')](e,emitEvent(event));}}module[_0x000f('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4579=['update','remove','emit','hasOwnProperty','hook','events','ChatOfflineMessage','setMaxListeners','save'];(function(_0x5a85a6,_0x11738d){var _0x1cc0cc=function(_0x203be9){while(--_0x203be9){_0x5a85a6['push'](_0x5a85a6['shift']());}};_0x1cc0cc(++_0x11738d);}(_0x4579,0x164));var _0x9457=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4579[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x9457('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x9457('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9457('0x2')](0x0);var events={'afterCreate':_0x9457('0x3'),'afterUpdate':_0x9457('0x4'),'afterDestroy':_0x9457('0x5')};function emitEvent(_0x39816c){return function(_0x11d530,_0x137554,_0x3fae20){ChatOfflineMessageEvents[_0x9457('0x6')](_0x39816c+':'+_0x11d530['id'],_0x11d530);ChatOfflineMessageEvents['emit'](_0x39816c,_0x11d530);_0x3fae20(null);};}for(var e in events){if(events[_0x9457('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x9457('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 6905caa..22aac89 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 _0xda44=['chat_offline_messages','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x2e9f28,_0x18a89e){var _0x248a5d=function(_0x188ba1){while(--_0x188ba1){_0x2e9f28['push'](_0x2e9f28['shift']());}};_0x248a5d(++_0x18a89e);}(_0xda44,0x13c));var _0x4da4=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xda44[_0x2ec461];return _0x28603d;};'use strict';var attributes=require(_0x4da4('0x0'));module[_0x4da4('0x1')]=function(_0x2e07ba){return _0x2e07ba[_0x4da4('0x2')](_0x4da4('0x3'),attributes,{'tableName':_0x4da4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe244=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe244,0xf8));var _0x4e24=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xe244[_0x13e741];return _0x3f8bb3;};'use strict';var attributes=require(_0x4e24('0x0'));module[_0x4e24('0x1')]=function(_0x41f19d){return _0x41f19d[_0x4e24('0x2')](_0x4e24('0x3'),attributes,{'tableName':_0x4e24('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e24('0x5'),'collate':_0x4e24('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 472974e..b5094ca 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 _0xb9d5=['../../config/environment','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x51fb2f,_0x37f004){var _0x40be65=function(_0x296aaa){while(--_0x296aaa){_0x51fb2f['push'](_0x51fb2f['shift']());}};_0x40be65(++_0x37f004);}(_0xb9d5,0xb6));var _0x5b9d=function(_0x4fd3d3,_0x3f34ff){_0x4fd3d3=_0x4fd3d3-0x0;var _0x36e697=_0xb9d5[_0x4fd3d3];return _0x36e697;};'use strict';var _=require('lodash');var util=require(_0x5b9d('0x0'));var moment=require(_0x5b9d('0x1'));var BPromise=require(_0x5b9d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b9d('0x3'))['db'];var utils=require(_0x5b9d('0x4'));var logger=require(_0x5b9d('0x5'))(_0x5b9d('0x6'));var config=require(_0x5b9d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5b9d('0x8')][_0x5b9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9c89ce,_0x35bde3,_0x300797){return new BPromise(function(_0x546207,_0x2fb79c){return client['request'](_0x9c89ce,_0x300797)[_0x5b9d('0xa')](function(_0x35c60b){logger[_0x5b9d('0xb')](_0x5b9d('0xc'),_0x35bde3,_0x5b9d('0xd'));logger['debug'](_0x5b9d('0xe'),_0x35bde3,_0x5b9d('0xd'),JSON[_0x5b9d('0xf')](_0x35c60b));if(_0x35c60b['error']){if(_0x35c60b['error'][_0x5b9d('0x10')]===0x1f4){logger[_0x5b9d('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x35bde3,_0x35c60b[_0x5b9d('0x11')][_0x5b9d('0x12')]);return _0x2fb79c(_0x35c60b[_0x5b9d('0x11')][_0x5b9d('0x12')]);}logger[_0x5b9d('0x11')](_0x5b9d('0xc'),_0x35bde3,_0x35c60b[_0x5b9d('0x11')]['message']);return _0x546207(_0x35c60b[_0x5b9d('0x11')][_0x5b9d('0x12')]);}else{logger[_0x5b9d('0xb')](_0x5b9d('0xc'),_0x35bde3,_0x5b9d('0xd'));_0x546207(_0x35c60b[_0x5b9d('0x13')][_0x5b9d('0x12')]);}})[_0x5b9d('0x14')](function(_0xea2730){logger['error'](_0x5b9d('0xc'),_0x35bde3,_0xea2730);_0x2fb79c(_0xea2730);});});}
\ No newline at end of file
+var _0xa992=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3ec521,_0x53acdd){var _0x594e4b=function(_0x5baea7){while(--_0x5baea7){_0x3ec521['push'](_0x3ec521['shift']());}};_0x594e4b(++_0x53acdd);}(_0xa992,0x18c));var _0x2a99=function(_0x1ad28d,_0x338468){_0x1ad28d=_0x1ad28d-0x0;var _0x3327ef=_0xa992[_0x1ad28d];return _0x3327ef;};'use strict';var _=require(_0x2a99('0x0'));var util=require(_0x2a99('0x1'));var moment=require(_0x2a99('0x2'));var BPromise=require(_0x2a99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a99('0x4'));var db=require(_0x2a99('0x5'))['db'];var utils=require(_0x2a99('0x6'));var logger=require(_0x2a99('0x7'))(_0x2a99('0x8'));var config=require(_0x2a99('0x9'));var jayson=require(_0x2a99('0xa'));var client=jayson[_0x2a99('0xb')][_0x2a99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9325b0,_0x483fb7,_0x365583){return new BPromise(function(_0x3b6f29,_0x3edcfc){return client[_0x2a99('0xd')](_0x9325b0,_0x365583)[_0x2a99('0xe')](function(_0x243164){logger[_0x2a99('0xf')](_0x2a99('0x10'),_0x483fb7,_0x2a99('0x11'));logger[_0x2a99('0x12')](_0x2a99('0x13'),_0x483fb7,'request\x20sent',JSON['stringify'](_0x243164));if(_0x243164[_0x2a99('0x14')]){if(_0x243164[_0x2a99('0x14')][_0x2a99('0x15')]===0x1f4){logger[_0x2a99('0x14')](_0x2a99('0x10'),_0x483fb7,_0x243164[_0x2a99('0x14')]['message']);return _0x3edcfc(_0x243164[_0x2a99('0x14')][_0x2a99('0x16')]);}logger[_0x2a99('0x14')](_0x2a99('0x10'),_0x483fb7,_0x243164[_0x2a99('0x14')]['message']);return _0x3b6f29(_0x243164[_0x2a99('0x14')]['message']);}else{logger['info'](_0x2a99('0x10'),_0x483fb7,_0x2a99('0x11'));_0x3b6f29(_0x243164[_0x2a99('0x17')]['message']);}})['catch'](function(_0x55d1f0){logger[_0x2a99('0x14')](_0x2a99('0x10'),_0x483fb7,_0x55d1f0);_0x3edcfc(_0x55d1f0);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 99c2f4a..1af099b 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 _0xd5a4=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x10e8ed,_0x384a0d){var _0x4aea4a=function(_0x486ad1){while(--_0x486ad1){_0x10e8ed['push'](_0x10e8ed['shift']());}};_0x4aea4a(++_0x384a0d);}(_0xd5a4,0xb8));var _0x4d5a=function(_0x468c2a,_0x4a1ca7){_0x468c2a=_0x468c2a-0x0;var _0x2c7fee=_0xd5a4[_0x468c2a];return _0x2c7fee;};'use strict';var multer=require(_0x4d5a('0x0'));var util=require(_0x4d5a('0x1'));var path=require('path');var timeout=require(_0x4d5a('0x2'));var express=require(_0x4d5a('0x3'));var router=express[_0x4d5a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4d5a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4d5a('0x6'));var controller=require(_0x4d5a('0x7'));router[_0x4d5a('0x8')]('/',auth[_0x4d5a('0x9')](),controller[_0x4d5a('0xa')]);router['get']('/describe',auth[_0x4d5a('0x9')](),controller[_0x4d5a('0xb')]);router[_0x4d5a('0x8')](_0x4d5a('0xc'),auth['isAuthenticated'](),controller[_0x4d5a('0xd')]);router[_0x4d5a('0xe')]('/',auth[_0x4d5a('0x9')](),controller['create']);router[_0x4d5a('0xf')](_0x4d5a('0xc'),auth[_0x4d5a('0x9')](),controller[_0x4d5a('0x10')]);router['delete'](_0x4d5a('0xc'),auth[_0x4d5a('0x9')](),controller[_0x4d5a('0x11')]);module[_0x4d5a('0x12')]=router;
\ No newline at end of file
+var _0xc062=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xc062,0x1c9));var _0x2c06=function(_0x266c25,_0x58bbff){_0x266c25=_0x266c25-0x0;var _0x500041=_0xc062[_0x266c25];return _0x500041;};'use strict';var multer=require('multer');var util=require(_0x2c06('0x0'));var path=require(_0x2c06('0x1'));var timeout=require(_0x2c06('0x2'));var express=require(_0x2c06('0x3'));var router=express[_0x2c06('0x4')]();var fs_extra=require(_0x2c06('0x5'));var auth=require(_0x2c06('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c06('0x7'));var controller=require(_0x2c06('0x8'));router[_0x2c06('0x9')]('/',auth[_0x2c06('0xa')](),controller[_0x2c06('0xb')]);router[_0x2c06('0x9')](_0x2c06('0xc'),auth[_0x2c06('0xa')](),controller[_0x2c06('0xd')]);router[_0x2c06('0x9')](_0x2c06('0xe'),auth[_0x2c06('0xa')](),controller[_0x2c06('0xf')]);router[_0x2c06('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x2c06('0xe'),auth[_0x2c06('0xa')](),controller[_0x2c06('0x11')]);router['delete']('/:id',auth[_0x2c06('0xa')](),controller['destroy']);module[_0x2c06('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index ceec771..5441d83 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 _0xe0ed=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x49d30a,_0xa737c2){var _0x6a6025=function(_0x38ee16){while(--_0x38ee16){_0x49d30a['push'](_0x49d30a['shift']());}};_0x6a6025(++_0xa737c2);}(_0xe0ed,0x1ab));var _0xde0e=function(_0x1258f9,_0x5dc8f3){_0x1258f9=_0x1258f9-0x0;var _0x1f8a78=_0xe0ed[_0x1258f9];return _0x1f8a78;};'use strict';var Sequelize=require(_0xde0e('0x0'));module[_0xde0e('0x1')]={'name':{'type':Sequelize[_0xde0e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xde0e('0x3')](_0xde0e('0x4'),_0xde0e('0x5')),'defaultValue':_0xde0e('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xde0e('0x6')]}};
\ No newline at end of file
+var _0xc00b=['INTEGER','sequelize','ENUM','STRING'];(function(_0x2b463b,_0x3cbff7){var _0x5d527a=function(_0x25cac3){while(--_0x25cac3){_0x2b463b['push'](_0x2b463b['shift']());}};_0x5d527a(++_0x3cbff7);}(_0xc00b,0x105));var _0xbc00=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xc00b[_0x4cc492];return _0x1f36b9;};'use strict';var Sequelize=require(_0xbc00('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbc00('0x1')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xbc00('0x2')]},'timeout':{'type':Sequelize[_0xbc00('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index fcd9b0a..1610946 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 _0x777f=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x1aa66f,_0x275c62){var _0xda3e71=function(_0x2b09d3){while(--_0x2b09d3){_0x1aa66f['push'](_0x1aa66f['shift']());}};_0xda3e71(++_0x275c62);}(_0x777f,0x9f));var _0xf777=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x777f[_0x326e79];return _0x37eb89;};'use strict';var emlformat=require(_0xf777('0x0'));var rimraf=require(_0xf777('0x1'));var zipdir=require(_0xf777('0x2'));var jsonpatch=require(_0xf777('0x3'));var rp=require(_0xf777('0x4'));var moment=require(_0xf777('0x5'));var BPromise=require(_0xf777('0x6'));var Mustache=require(_0xf777('0x7'));var util=require('util');var path=require(_0xf777('0x8'));var sox=require(_0xf777('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf777('0xa'));var squel=require(_0xf777('0xb'));var crypto=require(_0xf777('0xc'));var jsforce=require(_0xf777('0xd'));var deskjs=require(_0xf777('0xe'));var toCsv=require(_0xf777('0xf'));var querystring=require(_0xf777('0x10'));var Papa=require(_0xf777('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf777('0x12'));var hardwareService=require(_0xf777('0x13'));var logger=require('../../config/logger')(_0xf777('0x14'));var utils=require(_0xf777('0x15'));var config=require(_0xf777('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf777('0x17'))['db'];function respondWithStatusCode(_0x43c032,_0x5d7c2b){_0x5d7c2b=_0x5d7c2b||0xcc;return function(_0x1c8c65){if(_0x1c8c65){return _0x43c032[_0xf777('0x18')](_0x5d7c2b);}return _0x43c032[_0xf777('0x19')](_0x5d7c2b)[_0xf777('0x1a')]();};}function respondWithResult(_0x4d2173,_0x52e5a1){_0x52e5a1=_0x52e5a1||0xc8;return function(_0x8a1436){if(_0x8a1436){return _0x4d2173['status'](_0x52e5a1)[_0xf777('0x1b')](_0x8a1436);}};}function respondWithFilteredResult(_0x18aa74,_0x182c00){return function(_0x5780f5){if(_0x5780f5){var _0x3ecaa5=typeof _0x182c00[_0xf777('0x1c')]===_0xf777('0x1d')&&typeof _0x182c00[_0xf777('0x1e')]===_0xf777('0x1d');var _0xb3908a=_0x5780f5[_0xf777('0x1f')];var _0x3e0ba3=_0x3ecaa5?0x0:_0x182c00[_0xf777('0x1c')];var _0x126f72=_0x3ecaa5?_0x5780f5[_0xf777('0x1f')]:_0x182c00['offset']+_0x182c00[_0xf777('0x1e')];var _0x4e0edb;if(_0x126f72>=_0xb3908a){_0x126f72=_0xb3908a;_0x4e0edb=0xc8;}else{_0x4e0edb=0xce;}_0x18aa74[_0xf777('0x19')](_0x4e0edb);return _0x18aa74['set'](_0xf777('0x20'),_0x3e0ba3+'-'+_0x126f72+'/'+_0xb3908a)['json'](_0x5780f5);}return null;};}function patchUpdates(_0x4c6d39){return function(_0x3b4b0e){try{jsonpatch[_0xf777('0x21')](_0x3b4b0e,_0x4c6d39,!![]);}catch(_0x4e370b){return BPromise[_0xf777('0x22')](_0x4e370b);}return _0x3b4b0e[_0xf777('0x23')]();};}function saveUpdates(_0x50bddb,_0x55c56a){return function(_0x54bdf8){if(_0x54bdf8){return _0x54bdf8[_0xf777('0x24')](_0x50bddb)[_0xf777('0x25')](function(_0x527305){return _0x527305;});}return null;};}function removeEntity(_0x57d2b4,_0x43384d){return function(_0x5a0a3f){if(_0x5a0a3f){return _0x5a0a3f[_0xf777('0x26')]()['then'](function(){_0x57d2b4[_0xf777('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fd176,_0x2a1c7f){return function(_0x4d4296){if(!_0x4d4296){_0x4fd176[_0xf777('0x18')](0x194);}return _0x4d4296;};}function handleError(_0x48a961,_0x130461){_0x130461=_0x130461||0x1f4;return function(_0x1a1d74){logger[_0xf777('0x27')](_0x1a1d74[_0xf777('0x28')]);if(_0x1a1d74[_0xf777('0x29')]){delete _0x1a1d74[_0xf777('0x29')];}_0x48a961['status'](_0x130461)[_0xf777('0x2a')](_0x1a1d74);};}exports[_0xf777('0x2b')]=function(_0x13b2a8,_0x4f38f2){var _0x4f6933={'raw':!![],'where':{'id':_0x13b2a8['params']['id']}},_0x451e21={};_0x451e21[_0xf777('0x2c')]=_['keys'](db[_0xf777('0x2d')]['rawAttributes']);_0x451e21[_0xf777('0x2e')]=_[_0xf777('0x2f')](_0x13b2a8[_0xf777('0x2e')]);_0x451e21[_0xf777('0x30')]=_[_0xf777('0x31')](_0x451e21[_0xf777('0x2c')],_0x451e21['query']);_0x4f6933[_0xf777('0x32')]=_[_0xf777('0x31')](_0x451e21[_0xf777('0x2c')],qs[_0xf777('0x33')](_0x13b2a8[_0xf777('0x2e')][_0xf777('0x33')]));_0x4f6933[_0xf777('0x32')]=_0x4f6933['attributes'][_0xf777('0x34')]?_0x4f6933[_0xf777('0x32')]:_0x451e21[_0xf777('0x2c')];if(_0x13b2a8[_0xf777('0x2e')][_0xf777('0x35')]){_0x4f6933[_0xf777('0x36')]=[{'all':!![]}];}_0x4f6933=_['merge']({},_0x4f6933,_0x13b2a8[_0xf777('0x37')]);return db[_0xf777('0x2d')][_0xf777('0x38')](_0x4f6933)[_0xf777('0x25')](handleEntityNotFound(_0x4f38f2,null))[_0xf777('0x25')](respondWithResult(_0x4f38f2,null))[_0xf777('0x39')](handleError(_0x4f38f2,null));};exports[_0xf777('0x3a')]=function(_0x88cbc8,_0x49c864){return db[_0xf777('0x2d')][_0xf777('0x3a')](_0x88cbc8[_0xf777('0x3b')],{})[_0xf777('0x25')](respondWithResult(_0x49c864,0xc9))['catch'](handleError(_0x49c864,null));};exports[_0xf777('0x24')]=function(_0x5c5a43,_0x377c85){if(_0x5c5a43[_0xf777('0x3b')]['id']){delete _0x5c5a43[_0xf777('0x3b')]['id'];}return db[_0xf777('0x2d')]['find']({'where':{'id':_0x5c5a43['params']['id']}})[_0xf777('0x25')](handleEntityNotFound(_0x377c85,null))[_0xf777('0x25')](saveUpdates(_0x5c5a43[_0xf777('0x3b')],null))[_0xf777('0x25')](respondWithResult(_0x377c85,null))['catch'](handleError(_0x377c85,null));};exports[_0xf777('0x26')]=function(_0x47e847,_0x5f4757){return db[_0xf777('0x2d')][_0xf777('0x38')]({'where':{'id':_0x47e847['params']['id']}})[_0xf777('0x25')](handleEntityNotFound(_0x5f4757,null))[_0xf777('0x25')](removeEntity(_0x5f4757,null))['catch'](handleError(_0x5f4757,null));};
\ No newline at end of file
+var _0x254a=['offset','undefined','limit','count','Content-Range','reject','update','then','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x254a,0x138));var _0xa254=function(_0x5d289a,_0x352880){_0x5d289a=_0x5d289a-0x0;var _0x14bd5f=_0x254a[_0x5d289a];return _0x14bd5f;};'use strict';var emlformat=require(_0xa254('0x0'));var rimraf=require(_0xa254('0x1'));var zipdir=require(_0xa254('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa254('0x3'));var moment=require(_0xa254('0x4'));var BPromise=require(_0xa254('0x5'));var Mustache=require(_0xa254('0x6'));var util=require('util');var path=require(_0xa254('0x7'));var sox=require('sox');var csv=require(_0xa254('0x8'));var ejs=require(_0xa254('0x9'));var fs=require('fs');var fs_extra=require(_0xa254('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa254('0xb'));var jsforce=require(_0xa254('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa254('0x8'));var querystring=require('querystring');var Papa=require(_0xa254('0xd'));var Redis=require(_0xa254('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa254('0xf'));var hardwareService=require(_0xa254('0x10'));var logger=require(_0xa254('0x11'))(_0xa254('0x12'));var utils=require(_0xa254('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa254('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a2b59,_0x264548){_0x264548=_0x264548||0xcc;return function(_0x1e3cf8){if(_0x1e3cf8){return _0x4a2b59['sendStatus'](_0x264548);}return _0x4a2b59[_0xa254('0x15')](_0x264548)[_0xa254('0x16')]();};}function respondWithResult(_0x3f6cc5,_0x1d8ee5){_0x1d8ee5=_0x1d8ee5||0xc8;return function(_0x276480){if(_0x276480){return _0x3f6cc5['status'](_0x1d8ee5)[_0xa254('0x17')](_0x276480);}};}function respondWithFilteredResult(_0x1af363,_0x7532b7){return function(_0x24bd0f){if(_0x24bd0f){var _0x37586e=typeof _0x7532b7[_0xa254('0x18')]===_0xa254('0x19')&&typeof _0x7532b7[_0xa254('0x1a')]===_0xa254('0x19');var _0x5b5de4=_0x24bd0f['count'];var _0x4a249f=_0x37586e?0x0:_0x7532b7[_0xa254('0x18')];var _0x2dcf3a=_0x37586e?_0x24bd0f[_0xa254('0x1b')]:_0x7532b7[_0xa254('0x18')]+_0x7532b7[_0xa254('0x1a')];var _0x1b7773;if(_0x2dcf3a>=_0x5b5de4){_0x2dcf3a=_0x5b5de4;_0x1b7773=0xc8;}else{_0x1b7773=0xce;}_0x1af363[_0xa254('0x15')](_0x1b7773);return _0x1af363['set'](_0xa254('0x1c'),_0x4a249f+'-'+_0x2dcf3a+'/'+_0x5b5de4)['json'](_0x24bd0f);}return null;};}function patchUpdates(_0x338359){return function(_0x2b8645){try{jsonpatch['apply'](_0x2b8645,_0x338359,!![]);}catch(_0x3a1927){return BPromise[_0xa254('0x1d')](_0x3a1927);}return _0x2b8645['save']();};}function saveUpdates(_0x5d8bcc,_0x34c7c4){return function(_0xba5a72){if(_0xba5a72){return _0xba5a72[_0xa254('0x1e')](_0x5d8bcc)['then'](function(_0x2ab840){return _0x2ab840;});}return null;};}function removeEntity(_0x4443e7,_0x446ba9){return function(_0x597291){if(_0x597291){return _0x597291['destroy']()[_0xa254('0x1f')](function(){_0x4443e7[_0xa254('0x15')](0xcc)[_0xa254('0x16')]();});}};}function handleEntityNotFound(_0x413016,_0x54356f){return function(_0x3672c2){if(!_0x3672c2){_0x413016[_0xa254('0x20')](0x194);}return _0x3672c2;};}function handleError(_0x156612,_0x31201b){_0x31201b=_0x31201b||0x1f4;return function(_0x3e3041){logger[_0xa254('0x21')](_0x3e3041[_0xa254('0x22')]);if(_0x3e3041[_0xa254('0x23')]){delete _0x3e3041[_0xa254('0x23')];}_0x156612['status'](_0x31201b)[_0xa254('0x24')](_0x3e3041);};}exports[_0xa254('0x25')]=function(_0x1c9a9b,_0x135cf3){var _0x627344={'raw':!![],'where':{'id':_0x1c9a9b[_0xa254('0x26')]['id']}},_0x5c9e28={};_0x5c9e28[_0xa254('0x27')]=_[_0xa254('0x28')](db[_0xa254('0x29')]['rawAttributes']);_0x5c9e28[_0xa254('0x2a')]=_[_0xa254('0x28')](_0x1c9a9b[_0xa254('0x2a')]);_0x5c9e28[_0xa254('0x2b')]=_[_0xa254('0x2c')](_0x5c9e28[_0xa254('0x27')],_0x5c9e28[_0xa254('0x2a')]);_0x627344[_0xa254('0x2d')]=_['intersection'](_0x5c9e28[_0xa254('0x27')],qs[_0xa254('0x2e')](_0x1c9a9b[_0xa254('0x2a')][_0xa254('0x2e')]));_0x627344['attributes']=_0x627344[_0xa254('0x2d')][_0xa254('0x2f')]?_0x627344[_0xa254('0x2d')]:_0x5c9e28['model'];if(_0x1c9a9b[_0xa254('0x2a')][_0xa254('0x30')]){_0x627344[_0xa254('0x31')]=[{'all':!![]}];}_0x627344=_['merge']({},_0x627344,_0x1c9a9b[_0xa254('0x32')]);return db[_0xa254('0x29')][_0xa254('0x33')](_0x627344)[_0xa254('0x1f')](handleEntityNotFound(_0x135cf3,null))[_0xa254('0x1f')](respondWithResult(_0x135cf3,null))[_0xa254('0x34')](handleError(_0x135cf3,null));};exports[_0xa254('0x35')]=function(_0x26bfd6,_0x172d0d){return db['ChatProactiveAction']['create'](_0x26bfd6[_0xa254('0x36')],{})[_0xa254('0x1f')](respondWithResult(_0x172d0d,0xc9))['catch'](handleError(_0x172d0d,null));};exports[_0xa254('0x1e')]=function(_0x49c956,_0x5d1cd0){if(_0x49c956[_0xa254('0x36')]['id']){delete _0x49c956[_0xa254('0x36')]['id'];}return db[_0xa254('0x29')][_0xa254('0x33')]({'where':{'id':_0x49c956['params']['id']}})[_0xa254('0x1f')](handleEntityNotFound(_0x5d1cd0,null))[_0xa254('0x1f')](saveUpdates(_0x49c956[_0xa254('0x36')],null))[_0xa254('0x1f')](respondWithResult(_0x5d1cd0,null))[_0xa254('0x34')](handleError(_0x5d1cd0,null));};exports[_0xa254('0x37')]=function(_0x3cc843,_0x120195){return db[_0xa254('0x29')][_0xa254('0x33')]({'where':{'id':_0x3cc843[_0xa254('0x26')]['id']}})[_0xa254('0x1f')](handleEntityNotFound(_0x120195,null))[_0xa254('0x1f')](removeEntity(_0x120195,null))['catch'](handleError(_0x120195,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 16f788b..3960038 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 _0xd6ac=['moment','bluebird','request-promise','rimraf','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x4a0801,_0x55b298){var _0x47306d=function(_0x415a91){while(--_0x415a91){_0x4a0801['push'](_0x4a0801['shift']());}};_0x47306d(++_0x55b298);}(_0xd6ac,0x16f));var _0xcd6a=function(_0x555d51,_0x534544){_0x555d51=_0x555d51-0x0;var _0x2552f8=_0xd6ac[_0x555d51];return _0x2552f8;};'use strict';var _=require(_0xcd6a('0x0'));var util=require(_0xcd6a('0x1'));var logger=require(_0xcd6a('0x2'))('api');var moment=require(_0xcd6a('0x3'));var BPromise=require(_0xcd6a('0x4'));var rp=require(_0xcd6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd6a('0x6'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x55f2db,_0x294007){return _0x55f2db[_0xcd6a('0x7')](_0xcd6a('0x8'),attributes,{'tableName':_0xcd6a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x42c9=['moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x9b227d,_0x410c63){var _0x4215dd=function(_0x4da3fd){while(--_0x4da3fd){_0x9b227d['push'](_0x9b227d['shift']());}};_0x4215dd(++_0x410c63);}(_0x42c9,0xcc));var _0x942c=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x42c9[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require(_0x942c('0x0'));var util=require(_0x942c('0x1'));var logger=require(_0x942c('0x2'))(_0x942c('0x3'));var moment=require(_0x942c('0x4'));var BPromise=require(_0x942c('0x5'));var rp=require(_0x942c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x942c('0x7'));var config=require('../../config/environment');var attributes=require(_0x942c('0x8'));module[_0x942c('0x9')]=function(_0x46bac6,_0x480115){return _0x46bac6[_0x942c('0xa')](_0x942c('0xb'),attributes,{'tableName':_0x942c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 45f0a7f..87c1a5f 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 _0xf05e=['rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1da6a8,_0x2d5fcf){var _0x388f23=function(_0x1eca61){while(--_0x1eca61){_0x1da6a8['push'](_0x1da6a8['shift']());}};_0x388f23(++_0x2d5fcf);}(_0xf05e,0x179));var _0xef05=function(_0x59bd3b,_0x53eff9){_0x59bd3b=_0x59bd3b-0x0;var _0x586c53=_0xf05e[_0x59bd3b];return _0x586c53;};'use strict';var _=require(_0xef05('0x0'));var util=require(_0xef05('0x1'));var moment=require(_0xef05('0x2'));var BPromise=require(_0xef05('0x3'));var rs=require(_0xef05('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef05('0x5'))['db'];var utils=require(_0xef05('0x6'));var logger=require('../../config/logger')(_0xef05('0x7'));var config=require(_0xef05('0x8'));var jayson=require(_0xef05('0x9'));var client=jayson['client'][_0xef05('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x530739,_0x48420f,_0x2a4c96){return new BPromise(function(_0x10a0c9,_0x275493){return client[_0xef05('0xb')](_0x530739,_0x2a4c96)[_0xef05('0xc')](function(_0x62743a){logger[_0xef05('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x48420f,'request\x20sent');logger[_0xef05('0xe')](_0xef05('0xf'),_0x48420f,'request\x20sent',JSON[_0xef05('0x10')](_0x62743a));if(_0x62743a[_0xef05('0x11')]){if(_0x62743a[_0xef05('0x11')][_0xef05('0x12')]===0x1f4){logger[_0xef05('0x11')](_0xef05('0x13'),_0x48420f,_0x62743a[_0xef05('0x11')][_0xef05('0x14')]);return _0x275493(_0x62743a[_0xef05('0x11')][_0xef05('0x14')]);}logger[_0xef05('0x11')](_0xef05('0x13'),_0x48420f,_0x62743a[_0xef05('0x11')]['message']);return _0x10a0c9(_0x62743a[_0xef05('0x11')][_0xef05('0x14')]);}else{logger[_0xef05('0xd')](_0xef05('0x13'),_0x48420f,_0xef05('0x15'));_0x10a0c9(_0x62743a[_0xef05('0x16')][_0xef05('0x14')]);}})[_0xef05('0x17')](function(_0x44e9b6){logger[_0xef05('0x11')](_0xef05('0x13'),_0x48420f,_0x44e9b6);_0x275493(_0x44e9b6);});});}
\ No newline at end of file
+var _0xc186=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment'];(function(_0x22205c,_0x473493){var _0x3f5efe=function(_0x153dbb){while(--_0x153dbb){_0x22205c['push'](_0x22205c['shift']());}};_0x3f5efe(++_0x473493);}(_0xc186,0xed));var _0x6c18=function(_0x66dbff,_0x5f03ab){_0x66dbff=_0x66dbff-0x0;var _0x2c3d2d=_0xc186[_0x66dbff];return _0x2c3d2d;};'use strict';var _=require(_0x6c18('0x0'));var util=require(_0x6c18('0x1'));var moment=require(_0x6c18('0x2'));var BPromise=require(_0x6c18('0x3'));var rs=require(_0x6c18('0x4'));var fs=require('fs');var Redis=require(_0x6c18('0x5'));var db=require(_0x6c18('0x6'))['db'];var utils=require(_0x6c18('0x7'));var logger=require(_0x6c18('0x8'))(_0x6c18('0x9'));var config=require(_0x6c18('0xa'));var jayson=require(_0x6c18('0xb'));var client=jayson[_0x6c18('0xc')][_0x6c18('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33b18e,_0x55d0dc,_0x51a71e){return new BPromise(function(_0x24bafc,_0x39d3a1){return client['request'](_0x33b18e,_0x51a71e)['then'](function(_0xba9893){logger[_0x6c18('0xe')](_0x6c18('0xf'),_0x55d0dc,'request\x20sent');logger[_0x6c18('0x10')](_0x6c18('0x11'),_0x55d0dc,_0x6c18('0x12'),JSON['stringify'](_0xba9893));if(_0xba9893[_0x6c18('0x13')]){if(_0xba9893[_0x6c18('0x13')][_0x6c18('0x14')]===0x1f4){logger[_0x6c18('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x55d0dc,_0xba9893['error']['message']);return _0x39d3a1(_0xba9893[_0x6c18('0x13')][_0x6c18('0x15')]);}logger[_0x6c18('0x13')](_0x6c18('0xf'),_0x55d0dc,_0xba9893[_0x6c18('0x13')][_0x6c18('0x15')]);return _0x24bafc(_0xba9893[_0x6c18('0x13')][_0x6c18('0x15')]);}else{logger[_0x6c18('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x55d0dc,_0x6c18('0x12'));_0x24bafc(_0xba9893[_0x6c18('0x16')][_0x6c18('0x15')]);}})[_0x6c18('0x17')](function(_0x3905e6){logger[_0x6c18('0x13')](_0x6c18('0xf'),_0x55d0dc,_0x3905e6);_0x39d3a1(_0x3905e6);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 17e15fd..840ac93 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 _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x18a085,_0x2b4a77){var _0x59b09e=function(_0x4dda9d){while(--_0x4dda9d){_0x18a085['push'](_0x18a085['shift']());}};_0x59b09e(++_0x2b4a77);}(_0x326f,0xd1));var _0xf326=function(_0x198171,_0x56c7ce){_0x198171=_0x198171-0x0;var _0x5c8c45=_0x326f[_0x198171];return _0x5c8c45;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x1cb9=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller'];(function(_0x5482af,_0xd50828){var _0x22ea20=function(_0x5b2d6b){while(--_0x5b2d6b){_0x5482af['push'](_0x5482af['shift']());}};_0x22ea20(++_0xd50828);}(_0x1cb9,0x14e));var _0x91cb=function(_0x266408,_0x354f84){_0x266408=_0x266408-0x0;var _0x58930b=_0x1cb9[_0x266408];return _0x58930b;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0xb')]);router[_0x91cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xd')]);router['put'](_0x91cb('0x9'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0x10')]);module[_0x91cb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index f7b80e6..2d8f383 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 _0x59b5=['rrmemory','beepall','roundrobin','exports','name','STRING','INTEGER','ENUM'];(function(_0x2f0a2c,_0x56b573){var _0x146f78=function(_0x10fcc4){while(--_0x10fcc4){_0x2f0a2c['push'](_0x2f0a2c['shift']());}};_0x146f78(++_0x56b573);}(_0x59b5,0xd3));var _0x559b=function(_0x33d93d,_0xe170b3){_0x33d93d=_0x33d93d-0x0;var _0x2e4150=_0x59b5[_0x33d93d];return _0x2e4150;};'use strict';var Sequelize=require('sequelize');module[_0x559b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x559b('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x559b('0x2')]},'timeout':{'type':Sequelize[_0x559b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x559b('0x4')](_0x559b('0x5'),_0x559b('0x6'),_0x559b('0x7'))}};
\ No newline at end of file
+var _0x65ba=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3e5411,_0x9b2e68){var _0x537c05=function(_0x1b1cf9){while(--_0x1b1cf9){_0x3e5411['push'](_0x3e5411['shift']());}};_0x537c05(++_0x9b2e68);}(_0x65ba,0xa2));var _0xa65b=function(_0x381ec0,_0x374714){_0x381ec0=_0x381ec0-0x0;var _0x25604c=_0x65ba[_0x381ec0];return _0x25604c;};'use strict';var Sequelize=require(_0xa65b('0x0'));module[_0xa65b('0x1')]={'name':{'type':Sequelize[_0xa65b('0x2')],'unique':_0xa65b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa65b('0x2')]},'timeout':{'type':Sequelize[_0xa65b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa65b('0x5')](_0xa65b('0x6'),_0xa65b('0x7'),_0xa65b('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 3e716ae..95d15ce 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 _0x33f8=['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/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','nolimit','options','findAll','User','findAndCountAll','UserId','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','flatMap','sequelize','transaction','each','forEach','userChatQueue:save','removeTeams','select','from','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','omit','spread','isArray','getAgents','findOne','rimraf','zip-dir','request-promise','bluebird'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x33f8,0x128));var _0x833f=function(_0x3895ac,_0x4c29ed){_0x3895ac=_0x3895ac-0x0;var _0x45d22b=_0x33f8[_0x3895ac];return _0x45d22b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x833f('0x0'));var zipdir=require(_0x833f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x833f('0x2'));var moment=require('moment');var BPromise=require(_0x833f('0x3'));var Mustache=require(_0x833f('0x4'));var util=require(_0x833f('0x5'));var path=require(_0x833f('0x6'));var sox=require(_0x833f('0x7'));var csv=require(_0x833f('0x8'));var ejs=require(_0x833f('0x9'));var fs=require('fs');var fs_extra=require(_0x833f('0xa'));var _=require(_0x833f('0xb'));var squel=require('squel');var crypto=require(_0x833f('0xc'));var jsforce=require(_0x833f('0xd'));var deskjs=require(_0x833f('0xe'));var toCsv=require(_0x833f('0x8'));var querystring=require(_0x833f('0xf'));var Papa=require(_0x833f('0x10'));var Redis=require(_0x833f('0x11'));var authService=require(_0x833f('0x12'));var qs=require(_0x833f('0x13'));var as=require(_0x833f('0x14'));var hardwareService=require(_0x833f('0x15'));var logger=require(_0x833f('0x16'))(_0x833f('0x17'));var utils=require('../../config/utils');var config=require(_0x833f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x833f('0x19'))['db'];config['redis']=_[_0x833f('0x1a')](config[_0x833f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x833f('0x1c'))[_0x833f('0x1d')](socket);var jayson=require(_0x833f('0x1e'));var client=jayson[_0x833f('0x1f')][_0x833f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x369e30,_0x378873,_0x4cdb51,_0x29c337){return new BPromise(function(_0x42656b,_0x160427){var _0x11ae67=_0x29c337||client;return _0x11ae67[_0x833f('0x21')](_0x369e30,_0x4cdb51)[_0x833f('0x22')](function(_0xdded16){logger[_0x833f('0x23')](_0x833f('0x24'),_0x378873,_0x833f('0x25'));logger[_0x833f('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x378873,'request\x20sent',JSON['stringify'](_0xdded16));if(_0xdded16[_0x833f('0x27')]){if(_0xdded16[_0x833f('0x27')][_0x833f('0x28')]===0x1f4){logger[_0x833f('0x27')](_0x833f('0x24'),_0x378873,_0xdded16[_0x833f('0x27')]['message']);return _0x160427(_0xdded16[_0x833f('0x27')][_0x833f('0x29')]);}logger['error'](_0x833f('0x24'),_0x378873,_0xdded16['error']['message']);return _0x42656b(_0xdded16[_0x833f('0x27')][_0x833f('0x29')]);}else{logger[_0x833f('0x23')](_0x833f('0x24'),_0x378873,'request\x20sent');_0x42656b(_0xdded16[_0x833f('0x2a')][_0x833f('0x29')]);}})[_0x833f('0x2b')](function(_0x358fc5){logger[_0x833f('0x27')]('ChatQueue,\x20%s,\x20%s',_0x378873,_0x358fc5);_0x160427(_0x358fc5);});});}function respondWithStatusCode(_0x1ee33e,_0xb2de93){_0xb2de93=_0xb2de93||0xcc;return function(_0x5c3d3f){if(_0x5c3d3f){return _0x1ee33e[_0x833f('0x2c')](_0xb2de93);}return _0x1ee33e[_0x833f('0x2d')](_0xb2de93)[_0x833f('0x2e')]();};}function respondWithResult(_0x929af3,_0x457f4a){_0x457f4a=_0x457f4a||0xc8;return function(_0x3e784f){if(_0x3e784f){return _0x929af3[_0x833f('0x2d')](_0x457f4a)[_0x833f('0x2f')](_0x3e784f);}};}function respondWithFilteredResult(_0x46dec0,_0x371bc9){return function(_0x3ca96e){if(_0x3ca96e){var _0x16e017=typeof _0x371bc9[_0x833f('0x30')]==='undefined'&&typeof _0x371bc9[_0x833f('0x31')]===_0x833f('0x32');var _0x4eeef1=_0x3ca96e[_0x833f('0x33')];var _0x4fcb30=_0x16e017?0x0:_0x371bc9[_0x833f('0x30')];var _0x1a5d54=_0x16e017?_0x3ca96e['count']:_0x371bc9[_0x833f('0x30')]+_0x371bc9['limit'];var _0x496f96;if(_0x1a5d54>=_0x4eeef1){_0x1a5d54=_0x4eeef1;_0x496f96=0xc8;}else{_0x496f96=0xce;}_0x46dec0[_0x833f('0x2d')](_0x496f96);return _0x46dec0[_0x833f('0x34')](_0x833f('0x35'),_0x4fcb30+'-'+_0x1a5d54+'/'+_0x4eeef1)[_0x833f('0x2f')](_0x3ca96e);}return null;};}function patchUpdates(_0x4b1edd){return function(_0x14a080){try{jsonpatch['apply'](_0x14a080,_0x4b1edd,!![]);}catch(_0x5a60bc){return BPromise[_0x833f('0x36')](_0x5a60bc);}return _0x14a080[_0x833f('0x37')]();};}function saveUpdates(_0x328e8,_0x141afd){return function(_0x743331){if(_0x743331){return _0x743331[_0x833f('0x38')](_0x328e8)['then'](function(_0x2bf7e5){return _0x2bf7e5;});}return null;};}function removeEntity(_0x4f9613,_0xde4caf){return function(_0x3fe938){if(_0x3fe938){return _0x3fe938[_0x833f('0x39')]()['then'](function(){var _0x173147=_0x3fe938[_0x833f('0x3a')]({'plain':!![]});var _0x48b8d3=_0x833f('0x3b');return db[_0x833f('0x3c')]['destroy']({'where':{'type':_0x48b8d3,'resourceId':_0x173147['id']}})[_0x833f('0x22')](function(){return _0x3fe938;});})[_0x833f('0x22')](function(){_0x4f9613[_0x833f('0x2d')](0xcc)[_0x833f('0x2e')]();});}};}function handleEntityNotFound(_0x55d407,_0x2466e2){return function(_0xe72fed){if(!_0xe72fed){_0x55d407[_0x833f('0x2c')](0x194);}return _0xe72fed;};}function handleError(_0x163113,_0x3eca5a){_0x3eca5a=_0x3eca5a||0x1f4;return function(_0xa86577){logger[_0x833f('0x27')](_0xa86577[_0x833f('0x3d')]);if(_0xa86577[_0x833f('0x3e')]){delete _0xa86577['name'];}_0x163113[_0x833f('0x2d')](_0x3eca5a)[_0x833f('0x3f')](_0xa86577);};}exports[_0x833f('0x40')]=function(_0x1999b7,_0x1ab48){var _0x3ff367={},_0x5d720f={},_0x35c78d={'count':0x0,'rows':[]};var _0x21e10b=_[_0x833f('0x41')](db[_0x833f('0x42')]['rawAttributes'],function(_0x6c9b2){return{'name':_0x6c9b2['fieldName'],'type':_0x6c9b2[_0x833f('0x43')][_0x833f('0x44')]};});_0x5d720f[_0x833f('0x45')]=_['map'](_0x21e10b,_0x833f('0x3e'));_0x5d720f['query']=_[_0x833f('0x46')](_0x1999b7['query']);_0x5d720f[_0x833f('0x47')]=_[_0x833f('0x48')](_0x5d720f[_0x833f('0x45')],_0x5d720f[_0x833f('0x49')]);_0x3ff367['attributes']=_[_0x833f('0x48')](_0x5d720f[_0x833f('0x45')],qs['fields'](_0x1999b7[_0x833f('0x49')]['fields']));_0x3ff367[_0x833f('0x4a')]=_0x3ff367[_0x833f('0x4a')][_0x833f('0x4b')]?_0x3ff367[_0x833f('0x4a')]:_0x5d720f[_0x833f('0x45')];if(!_0x1999b7[_0x833f('0x49')][_0x833f('0x4c')]('nolimit')){_0x3ff367[_0x833f('0x31')]=qs[_0x833f('0x31')](_0x1999b7[_0x833f('0x49')][_0x833f('0x31')]);_0x3ff367[_0x833f('0x30')]=qs['offset'](_0x1999b7[_0x833f('0x49')][_0x833f('0x30')]);}_0x3ff367[_0x833f('0x4d')]=qs[_0x833f('0x4e')](_0x1999b7[_0x833f('0x49')][_0x833f('0x4e')]);_0x3ff367['where']=qs[_0x833f('0x47')](_[_0x833f('0x4f')](_0x1999b7['query'],_0x5d720f['filters']),_0x21e10b);if(_0x1999b7[_0x833f('0x49')][_0x833f('0x50')]){_0x3ff367[_0x833f('0x51')]=_[_0x833f('0x52')](_0x3ff367[_0x833f('0x51')],{'$or':_[_0x833f('0x41')](_0x21e10b,function(_0x302a9f){if(_0x302a9f[_0x833f('0x43')]!==_0x833f('0x53')){var _0x5a5fb1={};_0x5a5fb1[_0x302a9f[_0x833f('0x3e')]]={'$like':'%'+_0x1999b7[_0x833f('0x49')][_0x833f('0x50')]+'%'};return _0x5a5fb1;}})});}_0x3ff367=_['merge']({},_0x3ff367,_0x1999b7['options']);var _0x36c2e3={'where':_0x3ff367[_0x833f('0x51')]};return db['ChatQueue'][_0x833f('0x33')](_0x36c2e3)['then'](function(_0xa2e161){_0x35c78d[_0x833f('0x33')]=_0xa2e161;if(_0x1999b7[_0x833f('0x49')][_0x833f('0x54')]){_0x3ff367[_0x833f('0x55')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x3ff367);})['then'](function(_0x4a1a90){_0x35c78d[_0x833f('0x56')]=_0x4a1a90;return _0x35c78d;})['then'](respondWithFilteredResult(_0x1ab48,_0x3ff367))[_0x833f('0x2b')](handleError(_0x1ab48,null));};exports[_0x833f('0x57')]=function(_0x1332eb,_0x2962a7){var _0x479a31={'raw':!![],'where':{'id':_0x1332eb[_0x833f('0x58')]['id']}},_0x2830fc={};_0x2830fc[_0x833f('0x45')]=_[_0x833f('0x46')](db['ChatQueue'][_0x833f('0x59')]);_0x2830fc[_0x833f('0x49')]=_[_0x833f('0x46')](_0x1332eb[_0x833f('0x49')]);_0x2830fc['filters']=_[_0x833f('0x48')](_0x2830fc['model'],_0x2830fc['query']);_0x479a31[_0x833f('0x4a')]=_['intersection'](_0x2830fc[_0x833f('0x45')],qs[_0x833f('0x5a')](_0x1332eb[_0x833f('0x49')][_0x833f('0x5a')]));_0x479a31[_0x833f('0x4a')]=_0x479a31[_0x833f('0x4a')][_0x833f('0x4b')]?_0x479a31[_0x833f('0x4a')]:_0x2830fc['model'];if(_0x1332eb[_0x833f('0x49')][_0x833f('0x54')]){_0x479a31['include']=[{'all':!![]}];}_0x479a31=_[_0x833f('0x52')]({},_0x479a31,_0x1332eb['options']);return db[_0x833f('0x42')][_0x833f('0x5b')](_0x479a31)[_0x833f('0x22')](handleEntityNotFound(_0x2962a7,null))['then'](respondWithResult(_0x2962a7,null))['catch'](handleError(_0x2962a7,null));};exports[_0x833f('0x5c')]=function(_0xc7245f,_0x2d425f){return db['ChatQueue']['create'](_0xc7245f[_0x833f('0x5d')],{})[_0x833f('0x22')](function(_0x31a713){var _0x60fc28=_0xc7245f['user'][_0x833f('0x3a')]({'plain':!![]});if(!_0x60fc28)throw new Error(_0x833f('0x5e'));if(_0x60fc28[_0x833f('0x5f')]===_0x833f('0x60')){var _0x4afaf2=_0x31a713[_0x833f('0x3a')]({'plain':!![]});var _0x27ef77=_0x833f('0x3b');return db['UserProfileSection'][_0x833f('0x5b')]({'where':{'name':_0x27ef77,'userProfileId':_0x60fc28['userProfileId']},'raw':!![]})[_0x833f('0x22')](function(_0x2d57b1){if(_0x2d57b1&&_0x2d57b1[_0x833f('0x61')]===0x0){return db[_0x833f('0x3c')][_0x833f('0x5c')]({'name':_0x4afaf2[_0x833f('0x3e')],'resourceId':_0x4afaf2['id'],'type':_0x2d57b1['name'],'sectionId':_0x2d57b1['id']},{})['then'](function(){return _0x31a713;});}else{return _0x31a713;}})['catch'](function(_0x1ca025){logger[_0x833f('0x27')](_0x833f('0x62'),_0x1ca025);throw _0x1ca025;});}return _0x31a713;})[_0x833f('0x22')](respondWithResult(_0x2d425f,0xc9))[_0x833f('0x2b')](handleError(_0x2d425f,null));};exports['update']=function(_0x3fad18,_0x3e6b6f){if(_0x3fad18[_0x833f('0x5d')]['id']){delete _0x3fad18[_0x833f('0x5d')]['id'];}return db[_0x833f('0x42')]['find']({'where':{'id':_0x3fad18['params']['id']}})[_0x833f('0x22')](handleEntityNotFound(_0x3e6b6f,null))[_0x833f('0x22')](saveUpdates(_0x3fad18['body'],null))[_0x833f('0x22')](respondWithResult(_0x3e6b6f,null))[_0x833f('0x2b')](handleError(_0x3e6b6f,null));};exports[_0x833f('0x39')]=function(_0x4cea1e,_0x5301b8){return db[_0x833f('0x42')][_0x833f('0x5b')]({'where':{'id':_0x4cea1e[_0x833f('0x58')]['id']}})[_0x833f('0x22')](handleEntityNotFound(_0x5301b8,null))[_0x833f('0x22')](removeEntity(_0x5301b8,null))['catch'](handleError(_0x5301b8,null));};exports[_0x833f('0x63')]=function(_0x56e9b9,_0xfe8750){return db['ChatQueue'][_0x833f('0x63')]()[_0x833f('0x22')](respondWithResult(_0xfe8750,null))[_0x833f('0x2b')](handleError(_0xfe8750,null));};exports[_0x833f('0x64')]=function(_0x5b9df8,_0x575177,_0x1e45b7){var _0x1a3482={'raw':!![],'where':{}},_0xa513b9={},_0x2da040;return db[_0x833f('0x42')]['findOne']({'where':{'id':_0x5b9df8['params']['id']}})[_0x833f('0x22')](handleEntityNotFound(_0x575177,null))['then'](function(_0x30f939){if(_0x30f939){_0x2da040=_0x30f939['get']({'plain':!![]});_0xa513b9[_0x833f('0x45')]=_[_0x833f('0x46')](db[_0x833f('0x65')]['rawAttributes']);_0xa513b9[_0x833f('0x49')]=_['keys'](_0x5b9df8[_0x833f('0x49')]);_0xa513b9[_0x833f('0x47')]=_[_0x833f('0x48')](_0xa513b9[_0x833f('0x45')],_0xa513b9[_0x833f('0x49')]);_0x1a3482[_0x833f('0x4a')]=_[_0x833f('0x48')](_0xa513b9['model'],qs['fields'](_0x5b9df8[_0x833f('0x49')][_0x833f('0x5a')]));_0x1a3482[_0x833f('0x4a')]=_0x1a3482[_0x833f('0x4a')]['length']?_0x1a3482['attributes']:_0xa513b9['model'];if(!_0x5b9df8[_0x833f('0x49')]['hasOwnProperty'](_0x833f('0x66'))){_0x1a3482[_0x833f('0x31')]=qs[_0x833f('0x31')](_0x5b9df8[_0x833f('0x49')][_0x833f('0x31')]);_0x1a3482[_0x833f('0x30')]=qs['offset'](_0x5b9df8[_0x833f('0x49')][_0x833f('0x30')]);}_0x1a3482[_0x833f('0x4d')]=qs['sort'](_0x5b9df8[_0x833f('0x49')]['sort']);_0x1a3482[_0x833f('0x51')]=qs[_0x833f('0x47')](_[_0x833f('0x4f')](_0x5b9df8['query'],_0xa513b9[_0x833f('0x47')]));_0x1a3482[_0x833f('0x51')]['ChatQueueId']=_0x30f939['id'];if(_0x5b9df8['query']['filter']){_0x1a3482[_0x833f('0x51')]=_[_0x833f('0x52')](_0x1a3482[_0x833f('0x51')],{'$or':_[_0x833f('0x41')](_0x1a3482[_0x833f('0x4a')],function(_0x7e1551){var _0x3f9e9e={};_0x3f9e9e[_0x7e1551]={'$like':'%'+_0x5b9df8[_0x833f('0x49')][_0x833f('0x50')]+'%'};return _0x3f9e9e;})});}_0x1a3482=_[_0x833f('0x52')]({},_0x1a3482,_0x5b9df8[_0x833f('0x67')]);return db[_0x833f('0x65')][_0x833f('0x68')](_0x1a3482);}})['then'](function(_0x9df97a){if(_0x9df97a){return db[_0x833f('0x69')][_0x833f('0x6a')]({'where':{'id':_[_0x833f('0x41')](_0x9df97a,_0x833f('0x6b')),'role':_0x833f('0x6c')},'attributes':['id',_0x833f('0x3e'),_0x833f('0x6d'),'updatedAt',_0x833f('0x6e')]});}})[_0x833f('0x22')](function(_0x5b55b0){if(_0x5b55b0){return{'count':_0x5b55b0['count'],'rows':_[_0x833f('0x41')](_0x5b55b0[_0x833f('0x56')],function(_0x312294){return{'membername':_0x312294[_0x833f('0x3e')],'UserId':_0x312294['id'],'queue_name':_0x2da040[_0x833f('0x3e')],'ChatQueueId':_0x2da040['id'],'interface':util['format'](_0x833f('0x6f'),_0x833f('0x70'),_0x312294[_0x833f('0x3e')]),'penalty':0x0,'paused':_0x312294[_0x833f('0x6d')],'createdAt':_0x312294[_0x833f('0x6e')],'updatedAt':_0x312294[_0x833f('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x833f('0x22')](respondWithFilteredResult(_0x575177,_0x1a3482))[_0x833f('0x2b')](handleError(_0x575177,null));};exports['getTeams']=function(_0x2ba614,_0x3b915b,_0x4fa39f){var _0x55facb={};var _0x39a375={};var _0x2f3f9b;var _0xdc9983;return db['ChatQueue']['findOne']({'where':{'id':_0x2ba614[_0x833f('0x58')]['id']}})['then'](handleEntityNotFound(_0x3b915b,null))[_0x833f('0x22')](function(_0x4c3931){if(_0x4c3931){_0x2f3f9b=_0x4c3931;_0x39a375['model']=_[_0x833f('0x46')](db['Team'][_0x833f('0x59')]);_0x39a375[_0x833f('0x49')]=_[_0x833f('0x46')](_0x2ba614[_0x833f('0x49')]);_0x39a375['filters']=_[_0x833f('0x48')](_0x39a375[_0x833f('0x45')],_0x39a375['query']);_0x55facb[_0x833f('0x4a')]=_[_0x833f('0x48')](_0x39a375['model'],qs[_0x833f('0x5a')](_0x2ba614['query'][_0x833f('0x5a')]));_0x55facb[_0x833f('0x4a')]=_0x55facb[_0x833f('0x4a')][_0x833f('0x4b')]?_0x55facb[_0x833f('0x4a')]:_0x39a375[_0x833f('0x45')];_0x55facb[_0x833f('0x4d')]=qs[_0x833f('0x4e')](_0x2ba614[_0x833f('0x49')]['sort']);_0x55facb[_0x833f('0x51')]=qs[_0x833f('0x47')](_['pick'](_0x2ba614[_0x833f('0x49')],_0x39a375[_0x833f('0x47')]));if(_0x2ba614[_0x833f('0x49')][_0x833f('0x50')]){_0x55facb['where']=_['merge'](_0x55facb[_0x833f('0x51')],{'$or':_[_0x833f('0x41')](_0x55facb[_0x833f('0x4a')],function(_0x417d6c){var _0x2670d4={};_0x2670d4[_0x417d6c]={'$like':'%'+_0x2ba614['query'][_0x833f('0x50')]+'%'};return _0x2670d4;})});}_0x55facb=_[_0x833f('0x52')]({},_0x55facb,_0x2ba614[_0x833f('0x67')]);return _0x2f3f9b[_0x833f('0x72')](_0x55facb);}})[_0x833f('0x22')](function(_0x2730e1){if(_0x2730e1){_0xdc9983=_0x2730e1[_0x833f('0x4b')];if(!_0x2ba614['query']['hasOwnProperty'](_0x833f('0x66'))){_0x55facb[_0x833f('0x31')]=qs[_0x833f('0x31')](_0x2ba614['query'][_0x833f('0x31')]);_0x55facb[_0x833f('0x30')]=qs[_0x833f('0x30')](_0x2ba614['query'][_0x833f('0x30')]);}return _0x2f3f9b['getTeams'](_0x55facb);}})[_0x833f('0x22')](function(_0x1f1ba4){if(_0x1f1ba4){return _0x1f1ba4?{'count':_0xdc9983,'rows':_0x1f1ba4}:null;}})[_0x833f('0x22')](respondWithResult(_0x3b915b,null))['catch'](handleError(_0x3b915b,null));};exports[_0x833f('0x73')]=function(_0x38fb8d,_0x18cafc,_0x16b3b6){var _0x32fa2a=_0x38fb8d[_0x833f('0x5d')][_0x833f('0x74')];return db[_0x833f('0x75')][_0x833f('0x68')]({'where':{'id':_0x32fa2a},'attributes':['id'],'include':[{'model':db[_0x833f('0x69')],'as':_0x833f('0x76'),'attributes':['id',_0x833f('0x3e'),'online','voicePause','interface'],'raw':!![]}]})[_0x833f('0x22')](function(_0x3bb754){if(_0x3bb754){var _0x4fb225=_[_0x833f('0x77')](_0x3bb754,function(_0x3701a0){var _0x36b025=_0x3701a0[_0x833f('0x3a')]({'plain':!![]});return _0x36b025[_0x833f('0x76')];});return db['ChatQueue'][_0x833f('0x5b')]({'where':{'id':_0x38fb8d[_0x833f('0x58')]['id']}})[_0x833f('0x22')](function(_0x3ce590){return db[_0x833f('0x78')][_0x833f('0x79')](function(_0x4820ec){return _0x3ce590[_0x833f('0x73')](_0x32fa2a,{'transaction':_0x4820ec})['then'](function(){return BPromise[_0x833f('0x7a')](_0x4fb225,function(_0x12a21d){return db[_0x833f('0x65')]['findOrCreate']({'where':{'UserId':_0x12a21d['id'],'ChatQueueId':_0x38fb8d[_0x833f('0x58')]['id']},'transaction':_0x4820ec});});})['then'](function(){_0x4fb225[_0x833f('0x7b')](function(_0x2684bc){socket['emit'](_0x833f('0x7c'),{'UserId':_0x2684bc['id'],'ChatQueueId':_0x3ce590['id']});});});});});}})[_0x833f('0x22')](respondWithStatusCode(_0x18cafc,null))[_0x833f('0x2b')](handleError(_0x18cafc,null));};exports[_0x833f('0x7d')]=function(_0x516804,_0x35baf4,_0x5ee896){return db[_0x833f('0x75')][_0x833f('0x68')]({'where':{'id':_0x516804[_0x833f('0x49')]['ids']},'attributes':['id'],'include':[{'model':db[_0x833f('0x69')],'as':_0x833f('0x76'),'attributes':['id'],'raw':!![]}]})[_0x833f('0x22')](handleEntityNotFound(_0x35baf4,null))[_0x833f('0x22')](function(_0x73a1ef){var _0x1c9019=_[_0x833f('0x41')](_0x73a1ef,'id');var _0xaf45ae=[];var _0x860f8a=[];var _0x5d9124=squel[_0x833f('0x7e')]();_0x5d9124['field']('tq.TeamId')[_0x833f('0x7f')]('team_has_chat_queues','tq')[_0x833f('0x80')](_0x833f('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x833f('0x82'),_0x516804['params']['id']);for(var _0x27bc3e=0x0;_0x27bc3e<_0x73a1ef[_0x833f('0x4b')];_0x27bc3e+=0x1){let _0x271b07=_0x73a1ef[_0x27bc3e];for(var _0x33240d=0x0;_0x33240d<_0x271b07[_0x833f('0x76')]['length'];_0x33240d+=0x1){let _0x6c4f16=_0x271b07[_0x833f('0x76')][_0x33240d];var _0x39051a=_0x5d9124[_0x833f('0x83')]();_0x39051a['where'](_0x833f('0x84'),_0x6c4f16['id']);_0x860f8a['push'](db[_0x833f('0x78')][_0x833f('0x49')](_0x39051a[_0x833f('0x85')](),{'type':db[_0x833f('0x78')][_0x833f('0x86')][_0x833f('0x87')]})[_0x833f('0x22')](function(_0x776e80){if(_0x776e80['length']===0x1){return _0x6c4f16['id'];}else{var _0x1a7358=_[_0x833f('0x88')](_['map'](_0x776e80,'TeamId'),function(_0x568308){return _[_0x833f('0x89')](_0x1c9019,_0x568308);});if(_0x1a7358){return _0x6c4f16['id'];}}}));}}return BPromise[_0x833f('0x8a')](_0x860f8a)['then'](function(_0x69fff9){_0xaf45ae=_(_0xaf45ae)['union'](_0x69fff9)[_0x833f('0x8b')]()[_0x833f('0x8c')]();return db[_0x833f('0x42')][_0x833f('0x5b')]({'where':{'id':_0x516804['params']['id']}})['then'](function(_0x289d97){return db['sequelize'][_0x833f('0x79')](function(_0x5636c9){return _0x289d97[_0x833f('0x7d')](_0x516804['query'][_0x833f('0x74')],{'transaction':_0x5636c9})[_0x833f('0x22')](function(){if(!_[_0x833f('0x8d')](_0xaf45ae)){return _0x289d97[_0x833f('0x8e')](_0xaf45ae,{'transaction':_0x5636c9});}})[_0x833f('0x22')](function(){_0xaf45ae[_0x833f('0x7b')](function(_0x412836){socket[_0x833f('0x8f')](_0x833f('0x90'),{'UserId':_0x412836,'ChatQueueId':_0x289d97['id']});});});});});});})['then'](respondWithStatusCode(_0x35baf4,null))[_0x833f('0x2b')](handleError(_0x35baf4,null));};exports['addAgents']=function(_0x213226,_0x4ae801,_0x24d02f){return db['ChatQueue'][_0x833f('0x5b')]({'where':{'id':_0x213226[_0x833f('0x58')]['id']}})['then'](handleEntityNotFound(_0x4ae801,null))[_0x833f('0x22')](function(_0x27a069){if(_0x27a069){return _0x27a069['addAgents'](_0x213226['body'][_0x833f('0x74')],_[_0x833f('0x91')](_0x213226[_0x833f('0x5d')],[_0x833f('0x74'),'id'])||{})[_0x833f('0x92')](function(_0x586292){for(var _0x4f863c=0x0;_0x4f863c<_0x213226[_0x833f('0x5d')][_0x833f('0x74')][_0x833f('0x4b')];_0x4f863c+=0x1){socket[_0x833f('0x8f')](_0x833f('0x7c'),{'UserId':Number(_0x213226[_0x833f('0x5d')][_0x833f('0x74')][_0x4f863c]),'ChatQueueId':Number(_0x213226[_0x833f('0x58')]['id'])});}return _0x586292;});}})[_0x833f('0x22')](respondWithResult(_0x4ae801,null))[_0x833f('0x2b')](handleError(_0x4ae801,null));};exports[_0x833f('0x8e')]=function(_0x63d2ef,_0x1e5d35,_0x1aab87){return db['ChatQueue']['find']({'where':{'id':_0x63d2ef[_0x833f('0x58')]['id']}})[_0x833f('0x22')](handleEntityNotFound(_0x1e5d35,null))[_0x833f('0x22')](function(_0x5548ad){if(_0x5548ad){return _0x5548ad[_0x833f('0x8e')](_0x63d2ef[_0x833f('0x49')][_0x833f('0x74')])[_0x833f('0x22')](function(){if(_[_0x833f('0x93')](_0x63d2ef[_0x833f('0x49')][_0x833f('0x74')])){for(var _0x59f60b=0x0;_0x59f60b<_0x63d2ef[_0x833f('0x49')][_0x833f('0x74')]['length'];_0x59f60b+=0x1){socket[_0x833f('0x8f')](_0x833f('0x90'),{'UserId':Number(_0x63d2ef['query']['ids'][_0x59f60b]),'ChatQueueId':Number(_0x63d2ef['params']['id'])});}}else{socket[_0x833f('0x8f')](_0x833f('0x90'),{'UserId':Number(_0x63d2ef[_0x833f('0x49')]['ids']),'ChatQueueId':Number(_0x63d2ef[_0x833f('0x58')]['id'])});}});}})[_0x833f('0x22')](respondWithStatusCode(_0x1e5d35,null))[_0x833f('0x2b')](handleError(_0x1e5d35,null));};exports[_0x833f('0x94')]=function(_0x39573a,_0x1ec9a0,_0x196608){var _0x527fe1={};var _0x32dd4f={};var _0x2906a4;var _0x4358fa;return db[_0x833f('0x42')][_0x833f('0x95')]({'where':{'id':_0x39573a[_0x833f('0x58')]['id']}})['then'](handleEntityNotFound(_0x1ec9a0,null))[_0x833f('0x22')](function(_0x55f696){if(_0x55f696){_0x2906a4=_0x55f696;_0x32dd4f[_0x833f('0x45')]=_['keys'](db['User'][_0x833f('0x59')]);_0x32dd4f[_0x833f('0x49')]=_[_0x833f('0x46')](_0x39573a[_0x833f('0x49')]);_0x32dd4f[_0x833f('0x47')]=_[_0x833f('0x48')](_0x32dd4f[_0x833f('0x45')],_0x32dd4f[_0x833f('0x49')]);_0x527fe1[_0x833f('0x4a')]=_[_0x833f('0x48')](_0x32dd4f[_0x833f('0x45')],qs[_0x833f('0x5a')](_0x39573a[_0x833f('0x49')][_0x833f('0x5a')]));_0x527fe1[_0x833f('0x4a')]=_0x527fe1[_0x833f('0x4a')][_0x833f('0x4b')]?_0x527fe1[_0x833f('0x4a')]:_0x32dd4f['model'];_0x527fe1[_0x833f('0x4d')]=qs[_0x833f('0x4e')](_0x39573a[_0x833f('0x49')][_0x833f('0x4e')]);_0x527fe1[_0x833f('0x51')]=qs[_0x833f('0x47')](_['pick'](_0x39573a['query'],_0x32dd4f[_0x833f('0x47')]));if(_0x39573a[_0x833f('0x49')][_0x833f('0x50')]){_0x527fe1[_0x833f('0x51')]=_['merge'](_0x527fe1[_0x833f('0x51')],{'$or':_[_0x833f('0x41')](_0x527fe1[_0x833f('0x4a')],function(_0x5d1860){var _0x2285e5={};_0x2285e5[_0x5d1860]={'$like':'%'+_0x39573a['query'][_0x833f('0x50')]+'%'};return _0x2285e5;})});}_0x527fe1=_[_0x833f('0x52')]({},_0x527fe1,_0x39573a['options']);return _0x2906a4[_0x833f('0x94')](_0x527fe1);}})[_0x833f('0x22')](function(_0x3a56ff){if(_0x3a56ff){_0x4358fa=_0x3a56ff[_0x833f('0x4b')];if(!_0x39573a['query'][_0x833f('0x4c')](_0x833f('0x66'))){_0x527fe1[_0x833f('0x31')]=qs[_0x833f('0x31')](_0x39573a[_0x833f('0x49')]['limit']);_0x527fe1[_0x833f('0x30')]=qs[_0x833f('0x30')](_0x39573a[_0x833f('0x49')][_0x833f('0x30')]);}return _0x2906a4['getAgents'](_0x527fe1);}})[_0x833f('0x22')](function(_0x616653){if(_0x616653){return _0x616653?{'count':_0x4358fa,'rows':_0x616653}:null;}})[_0x833f('0x22')](respondWithResult(_0x1ec9a0,null))['catch'](handleError(_0x1ec9a0,null));};
\ No newline at end of file
+var _0x55f9=['../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','name','send','ChatQueue','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','include','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','order','sort','findAndCountAll','map','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','User','Agents','online','interface','transaction','each','emit','findAll','ids','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','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','removeAgents','forEach','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0x773bcd,_0x2b62cb){var _0x2b7aa4=function(_0x18e03a){while(--_0x18e03a){_0x773bcd['push'](_0x773bcd['shift']());}};_0x2b7aa4(++_0x2b62cb);}(_0x55f9,0x1ac));var _0x955f=function(_0x34a8ff,_0x292285){_0x34a8ff=_0x34a8ff-0x0;var _0x2f261b=_0x55f9[_0x34a8ff];return _0x2f261b;};'use strict';var emlformat=require(_0x955f('0x0'));var rimraf=require(_0x955f('0x1'));var zipdir=require(_0x955f('0x2'));var jsonpatch=require(_0x955f('0x3'));var rp=require(_0x955f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x955f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x955f('0x6'));var csv=require(_0x955f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x955f('0x8'));var _=require('lodash');var squel=require(_0x955f('0x9'));var crypto=require(_0x955f('0xa'));var jsforce=require(_0x955f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x955f('0xc'));var Papa=require(_0x955f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x955f('0xe'));var as=require(_0x955f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x955f('0x10'))(_0x955f('0x11'));var utils=require('../../config/utils');var config=require(_0x955f('0x12'));var licenseUtil=require(_0x955f('0x13'));var db=require(_0x955f('0x14'))['db'];config[_0x955f('0x15')]=_[_0x955f('0x16')](config[_0x955f('0x15')],{'host':_0x955f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x955f('0x15')]));require(_0x955f('0x18'))[_0x955f('0x19')](socket);var jayson=require(_0x955f('0x1a'));var client=jayson[_0x955f('0x1b')][_0x955f('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2cbffa,_0x4ed350,_0x5394e8,_0x10fa22){return new BPromise(function(_0x2bc214,_0xe77d9d){var _0x7a1d5c=_0x10fa22||client;return _0x7a1d5c[_0x955f('0x1d')](_0x2cbffa,_0x5394e8)[_0x955f('0x1e')](function(_0x671d27){logger[_0x955f('0x1f')](_0x955f('0x20'),_0x4ed350,'request\x20sent');logger['debug'](_0x955f('0x21'),_0x4ed350,_0x955f('0x22'),JSON[_0x955f('0x23')](_0x671d27));if(_0x671d27[_0x955f('0x24')]){if(_0x671d27[_0x955f('0x24')][_0x955f('0x25')]===0x1f4){logger[_0x955f('0x24')]('ChatQueue,\x20%s,\x20%s',_0x4ed350,_0x671d27[_0x955f('0x24')][_0x955f('0x26')]);return _0xe77d9d(_0x671d27[_0x955f('0x24')]['message']);}logger[_0x955f('0x24')](_0x955f('0x20'),_0x4ed350,_0x671d27[_0x955f('0x24')][_0x955f('0x26')]);return _0x2bc214(_0x671d27[_0x955f('0x24')]['message']);}else{logger[_0x955f('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x4ed350,_0x955f('0x22'));_0x2bc214(_0x671d27['result'][_0x955f('0x26')]);}})[_0x955f('0x27')](function(_0x508c09){logger[_0x955f('0x24')](_0x955f('0x20'),_0x4ed350,_0x508c09);_0xe77d9d(_0x508c09);});});}function respondWithStatusCode(_0x149da7,_0xe1405a){_0xe1405a=_0xe1405a||0xcc;return function(_0x3d4d5b){if(_0x3d4d5b){return _0x149da7[_0x955f('0x28')](_0xe1405a);}return _0x149da7[_0x955f('0x29')](_0xe1405a)[_0x955f('0x2a')]();};}function respondWithResult(_0x1d95f2,_0x38b6d9){_0x38b6d9=_0x38b6d9||0xc8;return function(_0x556b7c){if(_0x556b7c){return _0x1d95f2[_0x955f('0x29')](_0x38b6d9)[_0x955f('0x2b')](_0x556b7c);}};}function respondWithFilteredResult(_0x39bf29,_0xa077f){return function(_0x53bb6a){if(_0x53bb6a){var _0x23f819=typeof _0xa077f[_0x955f('0x2c')]==='undefined'&&typeof _0xa077f['limit']==='undefined';var _0x45b2f5=_0x53bb6a[_0x955f('0x2d')];var _0x195b51=_0x23f819?0x0:_0xa077f['offset'];var _0x2f90c7=_0x23f819?_0x53bb6a[_0x955f('0x2d')]:_0xa077f[_0x955f('0x2c')]+_0xa077f[_0x955f('0x2e')];var _0x4775f7;if(_0x2f90c7>=_0x45b2f5){_0x2f90c7=_0x45b2f5;_0x4775f7=0xc8;}else{_0x4775f7=0xce;}_0x39bf29[_0x955f('0x29')](_0x4775f7);return _0x39bf29[_0x955f('0x2f')](_0x955f('0x30'),_0x195b51+'-'+_0x2f90c7+'/'+_0x45b2f5)['json'](_0x53bb6a);}return null;};}function patchUpdates(_0x2272ce){return function(_0x42f74e){try{jsonpatch[_0x955f('0x31')](_0x42f74e,_0x2272ce,!![]);}catch(_0x158471){return BPromise[_0x955f('0x32')](_0x158471);}return _0x42f74e[_0x955f('0x33')]();};}function saveUpdates(_0x15a775,_0x47e7f5){return function(_0x8fa94f){if(_0x8fa94f){return _0x8fa94f[_0x955f('0x34')](_0x15a775)['then'](function(_0x448f5a){return _0x448f5a;});}return null;};}function removeEntity(_0x2804d9,_0x3671c4){return function(_0x5149f6){if(_0x5149f6){return _0x5149f6[_0x955f('0x35')]()['then'](function(){var _0x32fab3=_0x5149f6[_0x955f('0x36')]({'plain':!![]});var _0x2e9a09=_0x955f('0x37');return db[_0x955f('0x38')]['destroy']({'where':{'type':_0x2e9a09,'resourceId':_0x32fab3['id']}})['then'](function(){return _0x5149f6;});})[_0x955f('0x1e')](function(){_0x2804d9[_0x955f('0x29')](0xcc)[_0x955f('0x2a')]();});}};}function handleEntityNotFound(_0x2178e9,_0x1be590){return function(_0x5c253f){if(!_0x5c253f){_0x2178e9[_0x955f('0x28')](0x194);}return _0x5c253f;};}function handleError(_0x45bfa3,_0x57a177){_0x57a177=_0x57a177||0x1f4;return function(_0x3a5733){logger[_0x955f('0x24')](_0x3a5733['stack']);if(_0x3a5733['name']){delete _0x3a5733[_0x955f('0x39')];}_0x45bfa3['status'](_0x57a177)[_0x955f('0x3a')](_0x3a5733);};}exports['index']=function(_0x572709,_0x173245){var _0x36f583={},_0x500071={},_0x1ec402={'count':0x0,'rows':[]};var _0x3b36a3=_['map'](db[_0x955f('0x3b')][_0x955f('0x3c')],function(_0x212101){return{'name':_0x212101['fieldName'],'type':_0x212101[_0x955f('0x3d')][_0x955f('0x3e')]};});_0x500071[_0x955f('0x3f')]=_['map'](_0x3b36a3,_0x955f('0x39'));_0x500071['query']=_[_0x955f('0x40')](_0x572709[_0x955f('0x41')]);_0x500071[_0x955f('0x42')]=_[_0x955f('0x43')](_0x500071[_0x955f('0x3f')],_0x500071[_0x955f('0x41')]);_0x36f583[_0x955f('0x44')]=_[_0x955f('0x43')](_0x500071[_0x955f('0x3f')],qs[_0x955f('0x45')](_0x572709[_0x955f('0x41')][_0x955f('0x45')]));_0x36f583[_0x955f('0x44')]=_0x36f583[_0x955f('0x44')][_0x955f('0x46')]?_0x36f583['attributes']:_0x500071[_0x955f('0x3f')];if(!_0x572709[_0x955f('0x41')][_0x955f('0x47')](_0x955f('0x48'))){_0x36f583[_0x955f('0x2e')]=qs['limit'](_0x572709[_0x955f('0x41')][_0x955f('0x2e')]);_0x36f583['offset']=qs[_0x955f('0x2c')](_0x572709[_0x955f('0x41')]['offset']);}_0x36f583['order']=qs['sort'](_0x572709[_0x955f('0x41')]['sort']);_0x36f583[_0x955f('0x49')]=qs[_0x955f('0x42')](_[_0x955f('0x4a')](_0x572709[_0x955f('0x41')],_0x500071['filters']),_0x3b36a3);if(_0x572709['query'][_0x955f('0x4b')]){_0x36f583[_0x955f('0x49')]=_['merge'](_0x36f583[_0x955f('0x49')],{'$or':_['map'](_0x3b36a3,function(_0x370a05){if(_0x370a05[_0x955f('0x3d')]!==_0x955f('0x4c')){var _0x1f84e9={};_0x1f84e9[_0x370a05[_0x955f('0x39')]]={'$like':'%'+_0x572709['query'][_0x955f('0x4b')]+'%'};return _0x1f84e9;}})});}_0x36f583=_[_0x955f('0x4d')]({},_0x36f583,_0x572709[_0x955f('0x4e')]);var _0x1020a3={'where':_0x36f583[_0x955f('0x49')]};return db['ChatQueue'][_0x955f('0x2d')](_0x1020a3)['then'](function(_0x2fb0f0){_0x1ec402['count']=_0x2fb0f0;if(_0x572709['query']['includeAll']){_0x36f583[_0x955f('0x4f')]=[{'all':!![]}];}return db[_0x955f('0x3b')]['findAll'](_0x36f583);})[_0x955f('0x1e')](function(_0x2d31cd){_0x1ec402[_0x955f('0x50')]=_0x2d31cd;return _0x1ec402;})['then'](respondWithFilteredResult(_0x173245,_0x36f583))[_0x955f('0x27')](handleError(_0x173245,null));};exports[_0x955f('0x51')]=function(_0x4636fc,_0x2b5b84){var _0x4df974={'raw':!![],'where':{'id':_0x4636fc['params']['id']}},_0x35bdef={};_0x35bdef['model']=_['keys'](db[_0x955f('0x3b')]['rawAttributes']);_0x35bdef[_0x955f('0x41')]=_[_0x955f('0x40')](_0x4636fc[_0x955f('0x41')]);_0x35bdef[_0x955f('0x42')]=_[_0x955f('0x43')](_0x35bdef['model'],_0x35bdef[_0x955f('0x41')]);_0x4df974['attributes']=_[_0x955f('0x43')](_0x35bdef[_0x955f('0x3f')],qs['fields'](_0x4636fc[_0x955f('0x41')][_0x955f('0x45')]));_0x4df974['attributes']=_0x4df974[_0x955f('0x44')][_0x955f('0x46')]?_0x4df974[_0x955f('0x44')]:_0x35bdef[_0x955f('0x3f')];if(_0x4636fc[_0x955f('0x41')][_0x955f('0x52')]){_0x4df974[_0x955f('0x4f')]=[{'all':!![]}];}_0x4df974=_['merge']({},_0x4df974,_0x4636fc['options']);return db[_0x955f('0x3b')][_0x955f('0x53')](_0x4df974)[_0x955f('0x1e')](handleEntityNotFound(_0x2b5b84,null))['then'](respondWithResult(_0x2b5b84,null))[_0x955f('0x27')](handleError(_0x2b5b84,null));};exports[_0x955f('0x54')]=function(_0xf75cde,_0x6f83cd){return db[_0x955f('0x3b')]['create'](_0xf75cde[_0x955f('0x55')],{})['then'](function(_0x1768bc){var _0xbf00c6=_0xf75cde[_0x955f('0x56')][_0x955f('0x36')]({'plain':!![]});if(!_0xbf00c6)throw new Error(_0x955f('0x57'));if(_0xbf00c6[_0x955f('0x58')]===_0x955f('0x56')){var _0x30921d=_0x1768bc[_0x955f('0x36')]({'plain':!![]});var _0x5b1ab1=_0x955f('0x37');return db['UserProfileSection'][_0x955f('0x53')]({'where':{'name':_0x5b1ab1,'userProfileId':_0xbf00c6[_0x955f('0x59')]},'raw':!![]})[_0x955f('0x1e')](function(_0x3a3236){if(_0x3a3236&&_0x3a3236[_0x955f('0x5a')]===0x0){return db[_0x955f('0x38')]['create']({'name':_0x30921d[_0x955f('0x39')],'resourceId':_0x30921d['id'],'type':_0x3a3236['name'],'sectionId':_0x3a3236['id']},{})['then'](function(){return _0x1768bc;});}else{return _0x1768bc;}})['catch'](function(_0x6a206){logger['error'](_0x955f('0x5b'),_0x6a206);throw _0x6a206;});}return _0x1768bc;})[_0x955f('0x1e')](respondWithResult(_0x6f83cd,0xc9))[_0x955f('0x27')](handleError(_0x6f83cd,null));};exports['update']=function(_0x259968,_0xef18b0){if(_0x259968[_0x955f('0x55')]['id']){delete _0x259968['body']['id'];}return db[_0x955f('0x3b')][_0x955f('0x53')]({'where':{'id':_0x259968['params']['id']}})[_0x955f('0x1e')](handleEntityNotFound(_0xef18b0,null))[_0x955f('0x1e')](saveUpdates(_0x259968[_0x955f('0x55')],null))[_0x955f('0x1e')](respondWithResult(_0xef18b0,null))[_0x955f('0x27')](handleError(_0xef18b0,null));};exports['destroy']=function(_0x478f95,_0x40a872){return db[_0x955f('0x3b')][_0x955f('0x53')]({'where':{'id':_0x478f95[_0x955f('0x5c')]['id']}})[_0x955f('0x1e')](handleEntityNotFound(_0x40a872,null))[_0x955f('0x1e')](removeEntity(_0x40a872,null))[_0x955f('0x27')](handleError(_0x40a872,null));};exports[_0x955f('0x5d')]=function(_0x42aefb,_0x4af126){return db[_0x955f('0x3b')][_0x955f('0x5d')]()[_0x955f('0x1e')](respondWithResult(_0x4af126,null))['catch'](handleError(_0x4af126,null));};exports[_0x955f('0x5e')]=function(_0x338861,_0x4a4011,_0x4bf39e){var _0x4af425={'raw':!![],'where':{}},_0x40cb0d={},_0x7fe68b;return db[_0x955f('0x3b')][_0x955f('0x5f')]({'where':{'id':_0x338861['params']['id']}})['then'](handleEntityNotFound(_0x4a4011,null))['then'](function(_0x2ca2f0){if(_0x2ca2f0){_0x7fe68b=_0x2ca2f0[_0x955f('0x36')]({'plain':!![]});_0x40cb0d[_0x955f('0x3f')]=_[_0x955f('0x40')](db[_0x955f('0x60')][_0x955f('0x3c')]);_0x40cb0d[_0x955f('0x41')]=_['keys'](_0x338861[_0x955f('0x41')]);_0x40cb0d[_0x955f('0x42')]=_[_0x955f('0x43')](_0x40cb0d['model'],_0x40cb0d[_0x955f('0x41')]);_0x4af425[_0x955f('0x44')]=_[_0x955f('0x43')](_0x40cb0d[_0x955f('0x3f')],qs[_0x955f('0x45')](_0x338861[_0x955f('0x41')][_0x955f('0x45')]));_0x4af425[_0x955f('0x44')]=_0x4af425[_0x955f('0x44')][_0x955f('0x46')]?_0x4af425[_0x955f('0x44')]:_0x40cb0d[_0x955f('0x3f')];if(!_0x338861[_0x955f('0x41')][_0x955f('0x47')](_0x955f('0x48'))){_0x4af425['limit']=qs[_0x955f('0x2e')](_0x338861['query'][_0x955f('0x2e')]);_0x4af425[_0x955f('0x2c')]=qs[_0x955f('0x2c')](_0x338861[_0x955f('0x41')][_0x955f('0x2c')]);}_0x4af425[_0x955f('0x61')]=qs[_0x955f('0x62')](_0x338861[_0x955f('0x41')][_0x955f('0x62')]);_0x4af425[_0x955f('0x49')]=qs[_0x955f('0x42')](_['pick'](_0x338861['query'],_0x40cb0d[_0x955f('0x42')]));_0x4af425[_0x955f('0x49')]['ChatQueueId']=_0x2ca2f0['id'];if(_0x338861[_0x955f('0x41')][_0x955f('0x4b')]){_0x4af425[_0x955f('0x49')]=_[_0x955f('0x4d')](_0x4af425['where'],{'$or':_['map'](_0x4af425[_0x955f('0x44')],function(_0x54cc83){var _0x414325={};_0x414325[_0x54cc83]={'$like':'%'+_0x338861[_0x955f('0x41')][_0x955f('0x4b')]+'%'};return _0x414325;})});}_0x4af425=_['merge']({},_0x4af425,_0x338861[_0x955f('0x4e')]);return db['UserChatQueue']['findAll'](_0x4af425);}})['then'](function(_0x5b1c13){if(_0x5b1c13){return db['User'][_0x955f('0x63')]({'where':{'id':_[_0x955f('0x64')](_0x5b1c13,_0x955f('0x65')),'role':_0x955f('0x66')},'attributes':['id',_0x955f('0x39'),_0x955f('0x67'),_0x955f('0x68'),_0x955f('0x69')]});}})[_0x955f('0x1e')](function(_0x36a08a){if(_0x36a08a){return{'count':_0x36a08a['count'],'rows':_['map'](_0x36a08a['rows'],function(_0x2b5b47){return{'membername':_0x2b5b47[_0x955f('0x39')],'UserId':_0x2b5b47['id'],'queue_name':_0x7fe68b[_0x955f('0x39')],'ChatQueueId':_0x7fe68b['id'],'interface':util[_0x955f('0x6a')](_0x955f('0x6b'),_0x955f('0x6c'),_0x2b5b47[_0x955f('0x39')]),'penalty':0x0,'paused':_0x2b5b47['chatPause'],'createdAt':_0x2b5b47[_0x955f('0x69')],'updatedAt':_0x2b5b47[_0x955f('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x955f('0x1e')](respondWithFilteredResult(_0x4a4011,_0x4af425))['catch'](handleError(_0x4a4011,null));};exports['getTeams']=function(_0x4f5e2f,_0x4a5616,_0x3f5bf3){var _0x5cb86e={};var _0x4ce82a={};var _0x5aff62;var _0x5eaa42;return db[_0x955f('0x3b')][_0x955f('0x5f')]({'where':{'id':_0x4f5e2f[_0x955f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4a5616,null))[_0x955f('0x1e')](function(_0x483d11){if(_0x483d11){_0x5aff62=_0x483d11;_0x4ce82a[_0x955f('0x3f')]=_['keys'](db[_0x955f('0x6d')][_0x955f('0x3c')]);_0x4ce82a[_0x955f('0x41')]=_['keys'](_0x4f5e2f[_0x955f('0x41')]);_0x4ce82a[_0x955f('0x42')]=_[_0x955f('0x43')](_0x4ce82a[_0x955f('0x3f')],_0x4ce82a[_0x955f('0x41')]);_0x5cb86e[_0x955f('0x44')]=_[_0x955f('0x43')](_0x4ce82a[_0x955f('0x3f')],qs['fields'](_0x4f5e2f[_0x955f('0x41')][_0x955f('0x45')]));_0x5cb86e[_0x955f('0x44')]=_0x5cb86e['attributes'][_0x955f('0x46')]?_0x5cb86e['attributes']:_0x4ce82a[_0x955f('0x3f')];_0x5cb86e[_0x955f('0x61')]=qs[_0x955f('0x62')](_0x4f5e2f[_0x955f('0x41')]['sort']);_0x5cb86e['where']=qs[_0x955f('0x42')](_['pick'](_0x4f5e2f[_0x955f('0x41')],_0x4ce82a[_0x955f('0x42')]));if(_0x4f5e2f[_0x955f('0x41')]['filter']){_0x5cb86e[_0x955f('0x49')]=_[_0x955f('0x4d')](_0x5cb86e[_0x955f('0x49')],{'$or':_[_0x955f('0x64')](_0x5cb86e[_0x955f('0x44')],function(_0x5d1fcb){var _0x18c256={};_0x18c256[_0x5d1fcb]={'$like':'%'+_0x4f5e2f[_0x955f('0x41')][_0x955f('0x4b')]+'%'};return _0x18c256;})});}_0x5cb86e=_['merge']({},_0x5cb86e,_0x4f5e2f[_0x955f('0x4e')]);return _0x5aff62[_0x955f('0x6e')](_0x5cb86e);}})['then'](function(_0x2fc133){if(_0x2fc133){_0x5eaa42=_0x2fc133['length'];if(!_0x4f5e2f['query'][_0x955f('0x47')](_0x955f('0x48'))){_0x5cb86e[_0x955f('0x2e')]=qs[_0x955f('0x2e')](_0x4f5e2f[_0x955f('0x41')][_0x955f('0x2e')]);_0x5cb86e[_0x955f('0x2c')]=qs[_0x955f('0x2c')](_0x4f5e2f[_0x955f('0x41')]['offset']);}return _0x5aff62['getTeams'](_0x5cb86e);}})['then'](function(_0x3f158b){if(_0x3f158b){return _0x3f158b?{'count':_0x5eaa42,'rows':_0x3f158b}:null;}})['then'](respondWithResult(_0x4a5616,null))[_0x955f('0x27')](handleError(_0x4a5616,null));};exports[_0x955f('0x6f')]=function(_0x5ebe0a,_0x3e34ea,_0x587448){var _0x58696d=_0x5ebe0a[_0x955f('0x55')]['ids'];return db[_0x955f('0x6d')]['findAll']({'where':{'id':_0x58696d},'attributes':['id'],'include':[{'model':db[_0x955f('0x70')],'as':_0x955f('0x71'),'attributes':['id',_0x955f('0x39'),_0x955f('0x72'),'voicePause',_0x955f('0x73')],'raw':!![]}]})[_0x955f('0x1e')](function(_0x2ba31b){if(_0x2ba31b){var _0x19d694=_['flatMap'](_0x2ba31b,function(_0x1ffd95){var _0x19e6d7=_0x1ffd95[_0x955f('0x36')]({'plain':!![]});return _0x19e6d7[_0x955f('0x71')];});return db[_0x955f('0x3b')][_0x955f('0x53')]({'where':{'id':_0x5ebe0a[_0x955f('0x5c')]['id']}})['then'](function(_0x3e712d){return db['sequelize'][_0x955f('0x74')](function(_0xacdb66){return _0x3e712d[_0x955f('0x6f')](_0x58696d,{'transaction':_0xacdb66})[_0x955f('0x1e')](function(){return BPromise[_0x955f('0x75')](_0x19d694,function(_0x3690b8){return db[_0x955f('0x60')]['findOrCreate']({'where':{'UserId':_0x3690b8['id'],'ChatQueueId':_0x5ebe0a['params']['id']},'transaction':_0xacdb66});});})[_0x955f('0x1e')](function(){_0x19d694['forEach'](function(_0x578151){socket[_0x955f('0x76')]('userChatQueue:save',{'UserId':_0x578151['id'],'ChatQueueId':_0x3e712d['id']});});});});});}})[_0x955f('0x1e')](respondWithStatusCode(_0x3e34ea,null))[_0x955f('0x27')](handleError(_0x3e34ea,null));};exports['removeTeams']=function(_0x12aaa1,_0x2ddbd7,_0x2e8d7c){return db['Team'][_0x955f('0x77')]({'where':{'id':_0x12aaa1[_0x955f('0x41')][_0x955f('0x78')]},'attributes':['id'],'include':[{'model':db[_0x955f('0x70')],'as':_0x955f('0x71'),'attributes':['id'],'raw':!![]}]})[_0x955f('0x1e')](handleEntityNotFound(_0x2ddbd7,null))['then'](function(_0x540a4d){var _0x513600=_[_0x955f('0x64')](_0x540a4d,'id');var _0x18c92e=[];var _0x2d2e36=[];var _0x18861d=squel['select']();_0x18861d[_0x955f('0x79')](_0x955f('0x7a'))['from'](_0x955f('0x7b'),'tq')[_0x955f('0x7c')](_0x955f('0x7d'),'ut',_0x955f('0x7e'))['where'](_0x955f('0x7f'),_0x12aaa1['params']['id']);for(var _0x5257d2=0x0;_0x5257d2<_0x540a4d[_0x955f('0x46')];_0x5257d2+=0x1){let _0x2ed63c=_0x540a4d[_0x5257d2];for(var _0x1c8b68=0x0;_0x1c8b68<_0x2ed63c[_0x955f('0x71')][_0x955f('0x46')];_0x1c8b68+=0x1){let _0x3bb59c=_0x2ed63c[_0x955f('0x71')][_0x1c8b68];var _0x522554=_0x18861d[_0x955f('0x80')]();_0x522554[_0x955f('0x49')](_0x955f('0x81'),_0x3bb59c['id']);_0x2d2e36[_0x955f('0x82')](db[_0x955f('0x83')][_0x955f('0x41')](_0x522554[_0x955f('0x84')](),{'type':db[_0x955f('0x83')][_0x955f('0x85')][_0x955f('0x86')]})[_0x955f('0x1e')](function(_0x16c651){if(_0x16c651[_0x955f('0x46')]===0x1){return _0x3bb59c['id'];}else{var _0x28df5c=_[_0x955f('0x87')](_[_0x955f('0x64')](_0x16c651,_0x955f('0x88')),function(_0x1106a3){return _[_0x955f('0x89')](_0x513600,_0x1106a3);});if(_0x28df5c){return _0x3bb59c['id'];}}}));}}return BPromise[_0x955f('0x8a')](_0x2d2e36)['then'](function(_0x87a31c){_0x18c92e=_(_0x18c92e)['union'](_0x87a31c)[_0x955f('0x8b')]()[_0x955f('0x8c')]();return db[_0x955f('0x3b')][_0x955f('0x53')]({'where':{'id':_0x12aaa1[_0x955f('0x5c')]['id']}})[_0x955f('0x1e')](function(_0x4d395d){return db[_0x955f('0x83')][_0x955f('0x74')](function(_0x43745f){return _0x4d395d[_0x955f('0x8d')](_0x12aaa1[_0x955f('0x41')][_0x955f('0x78')],{'transaction':_0x43745f})['then'](function(){if(!_['isEmpty'](_0x18c92e)){return _0x4d395d[_0x955f('0x8e')](_0x18c92e,{'transaction':_0x43745f});}})[_0x955f('0x1e')](function(){_0x18c92e[_0x955f('0x8f')](function(_0x5dac32){socket[_0x955f('0x76')](_0x955f('0x90'),{'UserId':_0x5dac32,'ChatQueueId':_0x4d395d['id']});});});});});});})[_0x955f('0x1e')](respondWithStatusCode(_0x2ddbd7,null))['catch'](handleError(_0x2ddbd7,null));};exports[_0x955f('0x91')]=function(_0x492dd5,_0x28ccee,_0x100a21){return db['ChatQueue']['find']({'where':{'id':_0x492dd5[_0x955f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x28ccee,null))[_0x955f('0x1e')](function(_0x330c08){if(_0x330c08){return _0x330c08[_0x955f('0x91')](_0x492dd5['body'][_0x955f('0x78')],_[_0x955f('0x92')](_0x492dd5[_0x955f('0x55')],[_0x955f('0x78'),'id'])||{})['spread'](function(_0x920f2c){for(var _0x1599d4=0x0;_0x1599d4<_0x492dd5[_0x955f('0x55')][_0x955f('0x78')]['length'];_0x1599d4+=0x1){socket[_0x955f('0x76')]('userChatQueue:save',{'UserId':Number(_0x492dd5['body'][_0x955f('0x78')][_0x1599d4]),'ChatQueueId':Number(_0x492dd5['params']['id'])});}return _0x920f2c;});}})['then'](respondWithResult(_0x28ccee,null))[_0x955f('0x27')](handleError(_0x28ccee,null));};exports['removeAgents']=function(_0x52dddb,_0xa5f901,_0x3bf21d){return db['ChatQueue'][_0x955f('0x53')]({'where':{'id':_0x52dddb[_0x955f('0x5c')]['id']}})[_0x955f('0x1e')](handleEntityNotFound(_0xa5f901,null))[_0x955f('0x1e')](function(_0x102779){if(_0x102779){return _0x102779[_0x955f('0x8e')](_0x52dddb[_0x955f('0x41')]['ids'])[_0x955f('0x1e')](function(){if(_[_0x955f('0x93')](_0x52dddb['query'][_0x955f('0x78')])){for(var _0x1c1e80=0x0;_0x1c1e80<_0x52dddb[_0x955f('0x41')]['ids'][_0x955f('0x46')];_0x1c1e80+=0x1){socket[_0x955f('0x76')](_0x955f('0x90'),{'UserId':Number(_0x52dddb['query'][_0x955f('0x78')][_0x1c1e80]),'ChatQueueId':Number(_0x52dddb[_0x955f('0x5c')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x52dddb[_0x955f('0x41')][_0x955f('0x78')]),'ChatQueueId':Number(_0x52dddb['params']['id'])});}});}})[_0x955f('0x1e')](respondWithStatusCode(_0xa5f901,null))['catch'](handleError(_0xa5f901,null));};exports[_0x955f('0x94')]=function(_0x1ebdd2,_0x6ec805,_0xb4cfa7){var _0x3f1e86={};var _0x158d82={};var _0x13c73b;var _0x1ca99e;return db['ChatQueue'][_0x955f('0x5f')]({'where':{'id':_0x1ebdd2[_0x955f('0x5c')]['id']}})[_0x955f('0x1e')](handleEntityNotFound(_0x6ec805,null))['then'](function(_0x208e1a){if(_0x208e1a){_0x13c73b=_0x208e1a;_0x158d82[_0x955f('0x3f')]=_['keys'](db[_0x955f('0x70')]['rawAttributes']);_0x158d82[_0x955f('0x41')]=_[_0x955f('0x40')](_0x1ebdd2['query']);_0x158d82[_0x955f('0x42')]=_[_0x955f('0x43')](_0x158d82[_0x955f('0x3f')],_0x158d82[_0x955f('0x41')]);_0x3f1e86['attributes']=_['intersection'](_0x158d82['model'],qs['fields'](_0x1ebdd2[_0x955f('0x41')][_0x955f('0x45')]));_0x3f1e86[_0x955f('0x44')]=_0x3f1e86[_0x955f('0x44')][_0x955f('0x46')]?_0x3f1e86[_0x955f('0x44')]:_0x158d82[_0x955f('0x3f')];_0x3f1e86[_0x955f('0x61')]=qs[_0x955f('0x62')](_0x1ebdd2[_0x955f('0x41')]['sort']);_0x3f1e86[_0x955f('0x49')]=qs[_0x955f('0x42')](_[_0x955f('0x4a')](_0x1ebdd2[_0x955f('0x41')],_0x158d82[_0x955f('0x42')]));if(_0x1ebdd2[_0x955f('0x41')][_0x955f('0x4b')]){_0x3f1e86['where']=_['merge'](_0x3f1e86[_0x955f('0x49')],{'$or':_['map'](_0x3f1e86['attributes'],function(_0x70da88){var _0x411d20={};_0x411d20[_0x70da88]={'$like':'%'+_0x1ebdd2[_0x955f('0x41')]['filter']+'%'};return _0x411d20;})});}_0x3f1e86=_[_0x955f('0x4d')]({},_0x3f1e86,_0x1ebdd2[_0x955f('0x4e')]);return _0x13c73b[_0x955f('0x94')](_0x3f1e86);}})['then'](function(_0x41b883){if(_0x41b883){_0x1ca99e=_0x41b883[_0x955f('0x46')];if(!_0x1ebdd2[_0x955f('0x41')][_0x955f('0x47')]('nolimit')){_0x3f1e86[_0x955f('0x2e')]=qs[_0x955f('0x2e')](_0x1ebdd2[_0x955f('0x41')][_0x955f('0x2e')]);_0x3f1e86[_0x955f('0x2c')]=qs['offset'](_0x1ebdd2['query'][_0x955f('0x2c')]);}return _0x13c73b['getAgents'](_0x3f1e86);}})[_0x955f('0x1e')](function(_0x47de3e){if(_0x47de3e){return _0x47de3e?{'count':_0x1ca99e,'rows':_0x47de3e}:null;}})[_0x955f('0x1e')](respondWithResult(_0x6ec805,null))[_0x955f('0x27')](handleError(_0x6ec805,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 8033992..244d197 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 _0x74a3=['hasOwnProperty','exports','events','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0x2ce44f,_0x446221){var _0x1c1495=function(_0x53857b){while(--_0x53857b){_0x2ce44f['push'](_0x2ce44f['shift']());}};_0x1c1495(++_0x446221);}(_0x74a3,0x1b2));var _0x374a=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x74a3[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x374a('0x0'));var ChatQueue=require(_0x374a('0x1'))['db'][_0x374a('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x374a('0x3'),'afterUpdate':_0x374a('0x4'),'afterDestroy':_0x374a('0x5')};function emitEvent(_0x33a53f){return function(_0x48d0c6,_0x5138f7,_0x1fd0c5){ChatQueueEvents[_0x374a('0x6')](_0x33a53f+':'+_0x48d0c6['id'],_0x48d0c6);ChatQueueEvents[_0x374a('0x6')](_0x33a53f,_0x48d0c6);_0x1fd0c5(null);};}for(var e in events){if(events[_0x374a('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x374a('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xcefb=['ChatQueue','save','remove','emit','hook','events','../../mysqldb'];(function(_0x348c92,_0x3605af){var _0x1a8ef8=function(_0x3b16dd){while(--_0x3b16dd){_0x348c92['push'](_0x348c92['shift']());}};_0x1a8ef8(++_0x3605af);}(_0xcefb,0xfa));var _0xbcef=function(_0x418b55,_0x460d11){_0x418b55=_0x418b55-0x0;var _0x4a05c7=_0xcefb[_0x418b55];return _0x4a05c7;};'use strict';var EventEmitter=require(_0xbcef('0x0'));var ChatQueue=require(_0xbcef('0x1'))['db'][_0xbcef('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbcef('0x3'),'afterUpdate':'update','afterDestroy':_0xbcef('0x4')};function emitEvent(_0x22f518){return function(_0x34f0bf,_0x452873,_0x2b6032){ChatQueueEvents[_0xbcef('0x5')](_0x22f518+':'+_0x34f0bf['id'],_0x34f0bf);ChatQueueEvents[_0xbcef('0x5')](_0x22f518,_0x34f0bf);_0x2b6032(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xbcef('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 f2e083d..8548e08 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 _0xb801=['request-promise','path','exports','chat_queues','lodash','../../config/logger','api','moment'];(function(_0x49f79b,_0x17fdcb){var _0x2d7f34=function(_0x5062d8){while(--_0x5062d8){_0x49f79b['push'](_0x49f79b['shift']());}};_0x2d7f34(++_0x17fdcb);}(_0xb801,0x11c));var _0x1b80=function(_0x1f28a6,_0x11d1a4){_0x1f28a6=_0x1f28a6-0x0;var _0x444b21=_0xb801[_0x1f28a6];return _0x444b21;};'use strict';var _=require(_0x1b80('0x0'));var util=require('util');var logger=require(_0x1b80('0x1'))(_0x1b80('0x2'));var moment=require(_0x1b80('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b80('0x4'));var fs=require('fs');var path=require(_0x1b80('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x1b80('0x6')]=function(_0x47e1be,_0x270505){return _0x47e1be['define']('ChatQueue',attributes,{'tableName':_0x1b80('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3707=['exports','define','ChatQueue','chat_queues','lodash','util','moment','path','../../config/environment','./chatQueue.attributes'];(function(_0x4ed5e0,_0x51cc17){var _0x3d9ff0=function(_0x767297){while(--_0x767297){_0x4ed5e0['push'](_0x4ed5e0['shift']());}};_0x3d9ff0(++_0x51cc17);}(_0x3707,0x144));var _0x7370=function(_0x211baa,_0x579a69){_0x211baa=_0x211baa-0x0;var _0x4a66e4=_0x3707[_0x211baa];return _0x4a66e4;};'use strict';var _=require(_0x7370('0x0'));var util=require(_0x7370('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7370('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7370('0x3'));var rimraf=require('rimraf');var config=require(_0x7370('0x4'));var attributes=require(_0x7370('0x5'));module[_0x7370('0x6')]=function(_0x2f1ff5,_0x14215a){return _0x2f1ff5[_0x7370('0x7')](_0x7370('0x8'),attributes,{'tableName':_0x7370('0x9'),'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 6234d43..2f1de64 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 _0x6f2f=['model','attributes','then','ShowChatQueue','find','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','options','raw','where','include','map'];(function(_0x1fe978,_0x5e1d74){var _0x13b233=function(_0x2dc5d8){while(--_0x2dc5d8){_0x1fe978['push'](_0x1fe978['shift']());}};_0x13b233(++_0x5e1d74);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x6f2f[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6f2('0x3'))(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6f2('0x6')]({'port':0x232a});config[_0xf6f2('0x7')]=_[_0xf6f2('0x8')](config[_0xf6f2('0x7')],{'host':_0xf6f2('0x9'),'port':0x18eb});var socket=require(_0xf6f2('0xa'))(new Redis(config[_0xf6f2('0x7')]));require(_0xf6f2('0xb'))[_0xf6f2('0xc')](socket);function respondWithRpcPromise(_0x17ffd2,_0x55a260,_0x109271){return new BPromise(function(_0x266c6e,_0x2a4325){return client[_0xf6f2('0xd')](_0x17ffd2,_0x109271)['then'](function(_0x4ca76a){logger['info'](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));logger[_0xf6f2('0x10')](_0xf6f2('0x11'),_0x55a260,_0xf6f2('0xf'),JSON[_0xf6f2('0x12')](_0x4ca76a));if(_0x4ca76a['error']){if(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x14')]===0x1f4){logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')]['message']);return _0x2a4325(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);return _0x266c6e(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}else{logger[_0xf6f2('0x16')](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));_0x266c6e(_0x4ca76a[_0xf6f2('0x17')][_0xf6f2('0x15')]);}})[_0xf6f2('0x18')](function(_0xb05611){logger['error']('ChatQueue,\x20%s,\x20%s',_0x55a260,_0xb05611);_0x2a4325(_0xb05611);});});}exports[_0xf6f2('0x19')]=function(_0x544f71){var _0x145a7e=this;return new Promise(function(_0xe01b4d,_0x312429){return db[_0xf6f2('0x1a')]['findAll']({'raw':_0x544f71[_0xf6f2('0x1b')]?_0x544f71[_0xf6f2('0x1b')][_0xf6f2('0x1c')]===undefined?!![]:![]:!![],'where':_0x544f71[_0xf6f2('0x1b')]?_0x544f71['options'][_0xf6f2('0x1d')]||null:null,'attributes':_0x544f71['options']?_0x544f71[_0xf6f2('0x1b')]['attributes']||null:null,'limit':_0x544f71[_0xf6f2('0x1b')]?_0x544f71[_0xf6f2('0x1b')]['limit']||null:null,'include':_0x544f71[_0xf6f2('0x1b')]?_0x544f71[_0xf6f2('0x1b')][_0xf6f2('0x1e')]?_[_0xf6f2('0x1f')](_0x544f71[_0xf6f2('0x1b')][_0xf6f2('0x1e')],function(_0x3304ec){return{'model':db[_0x3304ec[_0xf6f2('0x20')]],'as':_0x3304ec['as'],'attributes':_0x3304ec['attributes'],'include':_0x3304ec[_0xf6f2('0x1e')]?_[_0xf6f2('0x1f')](_0x3304ec[_0xf6f2('0x1e')],function(_0xf0f188){return{'model':db[_0xf0f188[_0xf6f2('0x20')]],'as':_0xf0f188['as'],'attributes':_0xf0f188[_0xf6f2('0x21')],'include':_0xf0f188[_0xf6f2('0x1e')]?_[_0xf6f2('0x1f')](_0xf0f188[_0xf6f2('0x1e')],function(_0x40243e){return{'model':db[_0x40243e[_0xf6f2('0x20')]],'as':_0x40243e['as'],'attributes':_0x40243e['attributes']};}):[]};}):[]};}):[]:[]})[_0xf6f2('0x22')](function(_0x26c4dc){logger[_0xf6f2('0x16')](_0xf6f2('0x19'),_0x544f71);logger[_0xf6f2('0x10')](_0xf6f2('0x19'),_0x544f71,JSON[_0xf6f2('0x12')](_0x26c4dc));_0xe01b4d(_0x26c4dc);})[_0xf6f2('0x18')](function(_0x6a077c){logger[_0xf6f2('0x13')](_0xf6f2('0x19'),_0x6a077c[_0xf6f2('0x15')],_0x544f71);_0x312429(_0x145a7e['error'](0x1f4,_0x6a077c[_0xf6f2('0x15')]));});});};exports[_0xf6f2('0x23')]=function(_0x2fc531){var _0x1863d9=this;return new Promise(function(_0x3aec2c,_0x3a421f){return db[_0xf6f2('0x1a')][_0xf6f2('0x24')]({'raw':_0x2fc531[_0xf6f2('0x1b')]?_0x2fc531[_0xf6f2('0x1b')][_0xf6f2('0x1c')]===undefined?!![]:![]:!![],'where':_0x2fc531[_0xf6f2('0x1b')]?_0x2fc531[_0xf6f2('0x1b')]['where']||null:null,'attributes':_0x2fc531['options']?_0x2fc531['options'][_0xf6f2('0x21')]||null:null,'include':_0x2fc531[_0xf6f2('0x1b')]?_0x2fc531['options']['include']?_[_0xf6f2('0x1f')](_0x2fc531[_0xf6f2('0x1b')][_0xf6f2('0x1e')],function(_0x9bf3e0){return{'model':db[_0x9bf3e0[_0xf6f2('0x20')]],'as':_0x9bf3e0['as'],'attributes':_0x9bf3e0[_0xf6f2('0x21')],'include':_0x9bf3e0['include']?_[_0xf6f2('0x1f')](_0x9bf3e0['include'],function(_0x33139f){return{'model':db[_0x33139f[_0xf6f2('0x20')]],'as':_0x33139f['as'],'attributes':_0x33139f[_0xf6f2('0x21')],'include':_0x33139f[_0xf6f2('0x1e')]?_['map'](_0x33139f[_0xf6f2('0x1e')],function(_0x311a37){return{'model':db[_0x311a37[_0xf6f2('0x20')]],'as':_0x311a37['as'],'attributes':_0x311a37['attributes']};}):[]};}):[]};}):[]:[]})[_0xf6f2('0x22')](function(_0x213923){logger[_0xf6f2('0x16')]('ShowChatQueue',_0x2fc531);logger[_0xf6f2('0x10')]('ShowChatQueue',_0x2fc531,JSON[_0xf6f2('0x12')](_0x213923));_0x3aec2c(_0x213923);})[_0xf6f2('0x18')](function(_0x2ed69c){logger['error'](_0xf6f2('0x23'),_0x2ed69c[_0xf6f2('0x15')],_0x2fc531);_0x3a421f(_0x1863d9[_0xf6f2('0x13')](0x1f4,_0x2ed69c[_0xf6f2('0x15')]));});});};
\ No newline at end of file
+var _0x843e=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetChatQueue','ChatQueue','findAll','options','where','limit','include','map','model','attributes','catch','ShowChatQueue','find','raw'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x843e,0xcd));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe843('0x0'));var util=require(_0xe843('0x1'));var moment=require(_0xe843('0x2'));var BPromise=require(_0xe843('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe843('0x4'));var db=require(_0xe843('0x5'))['db'];var utils=require(_0xe843('0x6'));var logger=require(_0xe843('0x7'))(_0xe843('0x8'));var config=require(_0xe843('0x9'));var jayson=require(_0xe843('0xa'));var client=jayson['client'][_0xe843('0xb')]({'port':0x232a});config[_0xe843('0xc')]=_['defaults'](config[_0xe843('0xc')],{'host':_0xe843('0xd'),'port':0x18eb});var socket=require(_0xe843('0xe'))(new Redis(config[_0xe843('0xc')]));require(_0xe843('0xf'))[_0xe843('0x10')](socket);function respondWithRpcPromise(_0x443de9,_0xcd811a,_0x3b9cba){return new BPromise(function(_0xa0f3b0,_0x1c42f7){return client[_0xe843('0x11')](_0x443de9,_0x3b9cba)[_0xe843('0x12')](function(_0x1101cc){logger[_0xe843('0x13')](_0xe843('0x14'),_0xcd811a,_0xe843('0x15'));logger[_0xe843('0x16')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xcd811a,_0xe843('0x15'),JSON[_0xe843('0x17')](_0x1101cc));if(_0x1101cc[_0xe843('0x18')]){if(_0x1101cc[_0xe843('0x18')]['code']===0x1f4){logger[_0xe843('0x18')](_0xe843('0x14'),_0xcd811a,_0x1101cc[_0xe843('0x18')]['message']);return _0x1c42f7(_0x1101cc[_0xe843('0x18')]['message']);}logger['error'](_0xe843('0x14'),_0xcd811a,_0x1101cc[_0xe843('0x18')][_0xe843('0x19')]);return _0xa0f3b0(_0x1101cc[_0xe843('0x18')][_0xe843('0x19')]);}else{logger[_0xe843('0x13')](_0xe843('0x14'),_0xcd811a,_0xe843('0x15'));_0xa0f3b0(_0x1101cc[_0xe843('0x1a')]['message']);}})['catch'](function(_0x4a6c41){logger[_0xe843('0x18')]('ChatQueue,\x20%s,\x20%s',_0xcd811a,_0x4a6c41);_0x1c42f7(_0x4a6c41);});});}exports[_0xe843('0x1b')]=function(_0x216f8e){var _0x5a188b=this;return new Promise(function(_0x3012f9,_0x37bc5f){return db[_0xe843('0x1c')][_0xe843('0x1d')]({'raw':_0x216f8e[_0xe843('0x1e')]?_0x216f8e[_0xe843('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x216f8e[_0xe843('0x1e')]?_0x216f8e[_0xe843('0x1e')][_0xe843('0x1f')]||null:null,'attributes':_0x216f8e[_0xe843('0x1e')]?_0x216f8e['options']['attributes']||null:null,'limit':_0x216f8e['options']?_0x216f8e[_0xe843('0x1e')][_0xe843('0x20')]||null:null,'include':_0x216f8e[_0xe843('0x1e')]?_0x216f8e[_0xe843('0x1e')][_0xe843('0x21')]?_[_0xe843('0x22')](_0x216f8e[_0xe843('0x1e')][_0xe843('0x21')],function(_0x24faee){return{'model':db[_0x24faee[_0xe843('0x23')]],'as':_0x24faee['as'],'attributes':_0x24faee[_0xe843('0x24')],'include':_0x24faee[_0xe843('0x21')]?_['map'](_0x24faee[_0xe843('0x21')],function(_0x1bc911){return{'model':db[_0x1bc911['model']],'as':_0x1bc911['as'],'attributes':_0x1bc911['attributes'],'include':_0x1bc911[_0xe843('0x21')]?_[_0xe843('0x22')](_0x1bc911['include'],function(_0x24f049){return{'model':db[_0x24f049[_0xe843('0x23')]],'as':_0x24f049['as'],'attributes':_0x24f049['attributes']};}):[]};}):[]};}):[]:[]})[_0xe843('0x12')](function(_0x2d75ae){logger[_0xe843('0x13')]('GetChatQueue',_0x216f8e);logger[_0xe843('0x16')](_0xe843('0x1b'),_0x216f8e,JSON[_0xe843('0x17')](_0x2d75ae));_0x3012f9(_0x2d75ae);})[_0xe843('0x25')](function(_0x1a3cca){logger[_0xe843('0x18')](_0xe843('0x1b'),_0x1a3cca['message'],_0x216f8e);_0x37bc5f(_0x5a188b['error'](0x1f4,_0x1a3cca['message']));});});};exports[_0xe843('0x26')]=function(_0x5a6c7b){var _0x682881=this;return new Promise(function(_0x3cb064,_0x246aa4){return db['ChatQueue'][_0xe843('0x27')]({'raw':_0x5a6c7b[_0xe843('0x1e')]?_0x5a6c7b[_0xe843('0x1e')][_0xe843('0x28')]===undefined?!![]:![]:!![],'where':_0x5a6c7b[_0xe843('0x1e')]?_0x5a6c7b[_0xe843('0x1e')][_0xe843('0x1f')]||null:null,'attributes':_0x5a6c7b[_0xe843('0x1e')]?_0x5a6c7b[_0xe843('0x1e')]['attributes']||null:null,'include':_0x5a6c7b['options']?_0x5a6c7b[_0xe843('0x1e')][_0xe843('0x21')]?_[_0xe843('0x22')](_0x5a6c7b[_0xe843('0x1e')][_0xe843('0x21')],function(_0x303d6c){return{'model':db[_0x303d6c['model']],'as':_0x303d6c['as'],'attributes':_0x303d6c[_0xe843('0x24')],'include':_0x303d6c['include']?_['map'](_0x303d6c[_0xe843('0x21')],function(_0x128f7d){return{'model':db[_0x128f7d[_0xe843('0x23')]],'as':_0x128f7d['as'],'attributes':_0x128f7d[_0xe843('0x24')],'include':_0x128f7d[_0xe843('0x21')]?_[_0xe843('0x22')](_0x128f7d[_0xe843('0x21')],function(_0x3bab5d){return{'model':db[_0x3bab5d[_0xe843('0x23')]],'as':_0x3bab5d['as'],'attributes':_0x3bab5d[_0xe843('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe843('0x12')](function(_0x401d4b){logger[_0xe843('0x13')](_0xe843('0x26'),_0x5a6c7b);logger[_0xe843('0x16')](_0xe843('0x26'),_0x5a6c7b,JSON['stringify'](_0x401d4b));_0x3cb064(_0x401d4b);})[_0xe843('0x25')](function(_0xc1989b){logger['error'](_0xe843('0x26'),_0xc1989b['message'],_0x5a6c7b);_0x246aa4(_0x682881['error'](0x1f4,_0xc1989b['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8046db2..f2a26f9 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 _0x5178=['remove','update','register','length','save'];(function(_0x542549,_0x466258){var _0x39693b=function(_0x430e25){while(--_0x430e25){_0x542549['push'](_0x542549['shift']());}};_0x39693b(++_0x466258);}(_0x5178,0x171));var _0x8517=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5178[_0x6131cd];return _0x47e916;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8517('0x0'),_0x8517('0x1'),_0x8517('0x2')];function createListener(_0x2dc28f,_0x38d5b3){return function(_0x5e0a44){_0x38d5b3['emit'](_0x2dc28f,_0x5e0a44);};}function removeListener(_0x3ed6a5,_0x221184){return function(){ChatQueueEvents['removeListener'](_0x3ed6a5,_0x221184);};}exports[_0x8517('0x3')]=function(_0x58ed7e){for(var _0x13ba05=0x0,_0x45498e=events[_0x8517('0x4')];_0x13ba05<_0x45498e;_0x13ba05++){var _0x10f918=events[_0x13ba05];var _0x25146d=createListener('chatQueue:'+_0x10f918,_0x58ed7e);ChatQueueEvents['on'](_0x10f918,_0x25146d);}};
\ No newline at end of file
+var _0xc978=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x2c2dc3,_0x3f4379){var _0x515de4=function(_0x496fb2){while(--_0x496fb2){_0x2c2dc3['push'](_0x2c2dc3['shift']());}};_0x515de4(++_0x3f4379);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var ChatQueueEvents=require(_0x8c97('0x0'));var events=[_0x8c97('0x1'),_0x8c97('0x2'),_0x8c97('0x3')];function createListener(_0x371c48,_0x44d4ea){return function(_0x5ef47d){_0x44d4ea[_0x8c97('0x4')](_0x371c48,_0x5ef47d);};}function removeListener(_0x23c28d,_0x3ad972){return function(){ChatQueueEvents[_0x8c97('0x5')](_0x23c28d,_0x3ad972);};}exports[_0x8c97('0x6')]=function(_0x2a9434){for(var _0xabd146=0x0,_0x524196=events[_0x8c97('0x7')];_0xabd146<_0x524196;_0xabd146++){var _0x1b5864=events[_0xabd146];var _0x332cd1=createListener(_0x8c97('0x8')+_0x1b5864,_0x2a9434);ChatQueueEvents['on'](_0x1b5864,_0x332cd1);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 7719bbb..1280a80 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(_0x37d00f,_0x554792){var _0xfece47=function(_0x231088){while(--_0x231088){_0x37d00f['push'](_0x37d00f['shift']());}};_0xfece47(++_0x554792);}(_0xe14b,0x93));var _0xbe14=function(_0x142ed6,_0x3f2137){_0x142ed6=_0x142ed6-0x0;var _0x38f5f6=_0xe14b[_0x142ed6];return _0x38f5f6;};'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(_0x333f73,_0x1fa4b8){var _0x1c8d77=function(_0xb665cb){while(--_0xb665cb){_0x333f73['push'](_0x333f73['shift']());}};_0x1c8d77(++_0x1fa4b8);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 47617ef..0cf9055 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 _0x50a9=['moment','sequelize','exports','STRING','DATE'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x50a9,0x11d));var _0x950a=function(_0x411f8f,_0x11a2a2){_0x411f8f=_0x411f8f-0x0;var _0x5954f8=_0x50a9[_0x411f8f];return _0x5954f8;};'use strict';var moment=require(_0x950a('0x0'));var Sequelize=require(_0x950a('0x1'));module[_0x950a('0x2')]={'uniqueid':{'type':Sequelize[_0x950a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x950a('0x3')]},'joinAt':{'type':Sequelize[_0x950a('0x4')]},'leaveAt':{'type':Sequelize[_0x950a('0x4')]},'acceptAt':{'type':Sequelize[_0x950a('0x4')]},'exitAt':{'type':Sequelize[_0x950a('0x4')]},'reason':{'type':Sequelize[_0x950a('0x3')]}};
\ No newline at end of file
+var _0x6b6d=['sequelize','exports','STRING','DATE','moment'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x6b6d,0xbd));var _0xd6b6=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x6b6d[_0x355ce8];return _0x1db8b8;};'use strict';var moment=require(_0xd6b6('0x0'));var Sequelize=require(_0xd6b6('0x1'));module[_0xd6b6('0x2')]={'uniqueid':{'type':Sequelize[_0xd6b6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd6b6('0x4')]},'leaveAt':{'type':Sequelize[_0xd6b6('0x4')]},'acceptAt':{'type':Sequelize[_0xd6b6('0x4')]},'exitAt':{'type':Sequelize[_0xd6b6('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 6c7ae46..9af60d7 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 _0x4351=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','fields','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis'];(function(_0x190f52,_0x2927eb){var _0x4dc4c7=function(_0xaa6bf){while(--_0xaa6bf){_0x190f52['push'](_0x190f52['shift']());}};_0x4dc4c7(++_0x2927eb);}(_0x4351,0x1b5));var _0x1435=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x4351[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require(_0x1435('0x0'));var rimraf=require(_0x1435('0x1'));var zipdir=require(_0x1435('0x2'));var jsonpatch=require(_0x1435('0x3'));var rp=require(_0x1435('0x4'));var moment=require(_0x1435('0x5'));var BPromise=require(_0x1435('0x6'));var Mustache=require(_0x1435('0x7'));var util=require(_0x1435('0x8'));var path=require(_0x1435('0x9'));var sox=require(_0x1435('0xa'));var csv=require(_0x1435('0xb'));var ejs=require(_0x1435('0xc'));var fs=require('fs');var fs_extra=require(_0x1435('0xd'));var _=require(_0x1435('0xe'));var squel=require('squel');var crypto=require(_0x1435('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1435('0xb'));var querystring=require(_0x1435('0x10'));var Papa=require(_0x1435('0x11'));var Redis=require(_0x1435('0x12'));var authService=require(_0x1435('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1435('0x14'));var hardwareService=require(_0x1435('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x1435('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1435('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1632ac,_0x5137c0){_0x5137c0=_0x5137c0||0xcc;return function(_0x47daf0){if(_0x47daf0){return _0x1632ac['sendStatus'](_0x5137c0);}return _0x1632ac[_0x1435('0x18')](_0x5137c0)[_0x1435('0x19')]();};}function respondWithResult(_0x243669,_0x4a80bc){_0x4a80bc=_0x4a80bc||0xc8;return function(_0x4a52ba){if(_0x4a52ba){return _0x243669[_0x1435('0x18')](_0x4a80bc)['json'](_0x4a52ba);}};}function respondWithFilteredResult(_0x39405c,_0x3f0b08){return function(_0x1f5fc3){if(_0x1f5fc3){var _0x202744=typeof _0x3f0b08[_0x1435('0x1a')]===_0x1435('0x1b')&&typeof _0x3f0b08[_0x1435('0x1c')]===_0x1435('0x1b');var _0x2c1a6b=_0x1f5fc3[_0x1435('0x1d')];var _0x430367=_0x202744?0x0:_0x3f0b08[_0x1435('0x1a')];var _0x68f503=_0x202744?_0x1f5fc3[_0x1435('0x1d')]:_0x3f0b08[_0x1435('0x1a')]+_0x3f0b08['limit'];var _0x26da28;if(_0x68f503>=_0x2c1a6b){_0x68f503=_0x2c1a6b;_0x26da28=0xc8;}else{_0x26da28=0xce;}_0x39405c[_0x1435('0x18')](_0x26da28);return _0x39405c['set'](_0x1435('0x1e'),_0x430367+'-'+_0x68f503+'/'+_0x2c1a6b)['json'](_0x1f5fc3);}return null;};}function patchUpdates(_0x15d7c0){return function(_0x2a72aa){try{jsonpatch[_0x1435('0x1f')](_0x2a72aa,_0x15d7c0,!![]);}catch(_0x28bc0a){return BPromise[_0x1435('0x20')](_0x28bc0a);}return _0x2a72aa[_0x1435('0x21')]();};}function saveUpdates(_0x543209,_0x17ed76){return function(_0x437f61){if(_0x437f61){return _0x437f61[_0x1435('0x22')](_0x543209)[_0x1435('0x23')](function(_0x57a94f){return _0x57a94f;});}return null;};}function removeEntity(_0x1b6259,_0x302831){return function(_0xab77fa){if(_0xab77fa){return _0xab77fa[_0x1435('0x24')]()[_0x1435('0x23')](function(){_0x1b6259[_0x1435('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523792,_0x22241f){return function(_0x2b4828){if(!_0x2b4828){_0x523792[_0x1435('0x25')](0x194);}return _0x2b4828;};}function handleError(_0x4f86f0,_0x42599d){_0x42599d=_0x42599d||0x1f4;return function(_0x25cf29){logger[_0x1435('0x26')](_0x25cf29[_0x1435('0x27')]);if(_0x25cf29[_0x1435('0x28')]){delete _0x25cf29['name'];}_0x4f86f0[_0x1435('0x18')](_0x42599d)[_0x1435('0x29')](_0x25cf29);};}exports[_0x1435('0x2a')]=function(_0x453d68,_0x1c3b7e){var _0x108c25={},_0x2e0e72={},_0x57a02f={'count':0x0,'rows':[]};var _0x31ab10=_[_0x1435('0x2b')](db[_0x1435('0x2c')][_0x1435('0x2d')],function(_0x297edf){return{'name':_0x297edf['fieldName'],'type':_0x297edf[_0x1435('0x2e')][_0x1435('0x2f')]};});_0x2e0e72[_0x1435('0x30')]=_[_0x1435('0x2b')](_0x31ab10,'name');_0x2e0e72[_0x1435('0x31')]=_[_0x1435('0x32')](_0x453d68['query']);_0x2e0e72[_0x1435('0x33')]=_['intersection'](_0x2e0e72[_0x1435('0x30')],_0x2e0e72[_0x1435('0x31')]);_0x108c25['attributes']=_[_0x1435('0x34')](_0x2e0e72[_0x1435('0x30')],qs['fields'](_0x453d68['query']['fields']));_0x108c25[_0x1435('0x35')]=_0x108c25['attributes'][_0x1435('0x36')]?_0x108c25['attributes']:_0x2e0e72[_0x1435('0x30')];if(!_0x453d68['query'][_0x1435('0x37')](_0x1435('0x38'))){_0x108c25[_0x1435('0x1c')]=qs[_0x1435('0x1c')](_0x453d68[_0x1435('0x31')][_0x1435('0x1c')]);_0x108c25['offset']=qs[_0x1435('0x1a')](_0x453d68[_0x1435('0x31')][_0x1435('0x1a')]);}_0x108c25[_0x1435('0x39')]=qs[_0x1435('0x3a')](_0x453d68['query'][_0x1435('0x3a')]);_0x108c25['where']=qs[_0x1435('0x33')](_[_0x1435('0x3b')](_0x453d68['query'],_0x2e0e72[_0x1435('0x33')]),_0x31ab10);if(_0x453d68[_0x1435('0x31')][_0x1435('0x3c')]){_0x108c25[_0x1435('0x3d')]=_[_0x1435('0x3e')](_0x108c25[_0x1435('0x3d')],{'$or':_[_0x1435('0x2b')](_0x31ab10,function(_0x176dbd){if(_0x176dbd[_0x1435('0x2e')]!==_0x1435('0x3f')){var _0x3ecac4={};_0x3ecac4[_0x176dbd[_0x1435('0x28')]]={'$like':'%'+_0x453d68['query'][_0x1435('0x3c')]+'%'};return _0x3ecac4;}})});}_0x108c25=_['merge']({},_0x108c25,_0x453d68[_0x1435('0x40')]);var _0x5b24ab={'where':_0x108c25[_0x1435('0x3d')]};return db['ChatQueueReport'][_0x1435('0x1d')](_0x5b24ab)['then'](function(_0x36bc74){_0x57a02f[_0x1435('0x1d')]=_0x36bc74;if(_0x453d68[_0x1435('0x31')]['includeAll']){_0x108c25[_0x1435('0x41')]=[{'all':!![]}];}return db[_0x1435('0x2c')][_0x1435('0x42')](_0x108c25);})['then'](function(_0x1d6417){_0x57a02f[_0x1435('0x43')]=_0x1d6417;return _0x57a02f;})['then'](respondWithFilteredResult(_0x1c3b7e,_0x108c25))['catch'](handleError(_0x1c3b7e,null));};exports[_0x1435('0x44')]=function(_0x40e9eb,_0x2dd1f5){var _0x5986f8={'raw':!![],'where':{'id':_0x40e9eb[_0x1435('0x45')]['id']}},_0x4e5d0a={};_0x4e5d0a['model']=_[_0x1435('0x32')](db['ChatQueueReport'][_0x1435('0x2d')]);_0x4e5d0a['query']=_[_0x1435('0x32')](_0x40e9eb['query']);_0x4e5d0a[_0x1435('0x33')]=_['intersection'](_0x4e5d0a[_0x1435('0x30')],_0x4e5d0a[_0x1435('0x31')]);_0x5986f8['attributes']=_[_0x1435('0x34')](_0x4e5d0a['model'],qs[_0x1435('0x46')](_0x40e9eb[_0x1435('0x31')][_0x1435('0x46')]));_0x5986f8['attributes']=_0x5986f8[_0x1435('0x35')][_0x1435('0x36')]?_0x5986f8['attributes']:_0x4e5d0a[_0x1435('0x30')];if(_0x40e9eb[_0x1435('0x31')]['includeAll']){_0x5986f8[_0x1435('0x41')]=[{'all':!![]}];}_0x5986f8=_[_0x1435('0x3e')]({},_0x5986f8,_0x40e9eb['options']);return db[_0x1435('0x2c')][_0x1435('0x47')](_0x5986f8)['then'](handleEntityNotFound(_0x2dd1f5,null))[_0x1435('0x23')](respondWithResult(_0x2dd1f5,null))[_0x1435('0x48')](handleError(_0x2dd1f5,null));};exports[_0x1435('0x49')]=function(_0x4b254e,_0x57b5d4){return db[_0x1435('0x2c')]['create'](_0x4b254e[_0x1435('0x4a')],{})['then'](respondWithResult(_0x57b5d4,0xc9))[_0x1435('0x48')](handleError(_0x57b5d4,null));};exports[_0x1435('0x22')]=function(_0x1f8899,_0x148862){if(_0x1f8899[_0x1435('0x4a')]['id']){delete _0x1f8899[_0x1435('0x4a')]['id'];}return db[_0x1435('0x2c')]['find']({'where':{'id':_0x1f8899[_0x1435('0x45')]['id']}})[_0x1435('0x23')](handleEntityNotFound(_0x148862,null))[_0x1435('0x23')](saveUpdates(_0x1f8899['body'],null))[_0x1435('0x23')](respondWithResult(_0x148862,null))[_0x1435('0x48')](handleError(_0x148862,null));};exports[_0x1435('0x24')]=function(_0x24c5d0,_0x118c06){return db[_0x1435('0x2c')][_0x1435('0x47')]({'where':{'id':_0x24c5d0[_0x1435('0x45')]['id']}})['then'](handleEntityNotFound(_0x118c06,null))[_0x1435('0x23')](removeEntity(_0x118c06,null))[_0x1435('0x48')](handleError(_0x118c06,null));};exports[_0x1435('0x4b')]=function(_0x4244e1,_0x5953ce){return db['ChatQueueReport'][_0x1435('0x4b')]()[_0x1435('0x23')](respondWithResult(_0x5953ce,null))[_0x1435('0x48')](handleError(_0x5953ce,null));};
\ No newline at end of file
+var _0x77f7=['name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1c7020,_0x3723f9){var _0x22e4d6=function(_0x46c55b){while(--_0x46c55b){_0x1c7020['push'](_0x1c7020['shift']());}};_0x22e4d6(++_0x3723f9);}(_0x77f7,0xbd));var _0x777f=function(_0x3b3505,_0x1ae8af){_0x3b3505=_0x3b3505-0x0;var _0x252a6f=_0x77f7[_0x3b3505];return _0x252a6f;};'use strict';var emlformat=require(_0x777f('0x0'));var rimraf=require(_0x777f('0x1'));var zipdir=require(_0x777f('0x2'));var jsonpatch=require(_0x777f('0x3'));var rp=require(_0x777f('0x4'));var moment=require(_0x777f('0x5'));var BPromise=require(_0x777f('0x6'));var Mustache=require(_0x777f('0x7'));var util=require(_0x777f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x777f('0x9'));var ejs=require(_0x777f('0xa'));var fs=require('fs');var fs_extra=require(_0x777f('0xb'));var _=require(_0x777f('0xc'));var squel=require(_0x777f('0xd'));var crypto=require(_0x777f('0xe'));var jsforce=require(_0x777f('0xf'));var deskjs=require(_0x777f('0x10'));var toCsv=require(_0x777f('0x9'));var querystring=require(_0x777f('0x11'));var Papa=require('papaparse');var Redis=require(_0x777f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x777f('0x13'));var as=require(_0x777f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x777f('0x15'))(_0x777f('0x16'));var utils=require(_0x777f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x777f('0x18'));var db=require(_0x777f('0x19'))['db'];function respondWithStatusCode(_0x285bf7,_0x30f31b){_0x30f31b=_0x30f31b||0xcc;return function(_0xee481c){if(_0xee481c){return _0x285bf7[_0x777f('0x1a')](_0x30f31b);}return _0x285bf7['status'](_0x30f31b)[_0x777f('0x1b')]();};}function respondWithResult(_0x2cef15,_0x5468c0){_0x5468c0=_0x5468c0||0xc8;return function(_0x36652d){if(_0x36652d){return _0x2cef15[_0x777f('0x1c')](_0x5468c0)[_0x777f('0x1d')](_0x36652d);}};}function respondWithFilteredResult(_0x43d45a,_0xf4d60b){return function(_0x217e98){if(_0x217e98){var _0x41855a=typeof _0xf4d60b['offset']===_0x777f('0x1e')&&typeof _0xf4d60b[_0x777f('0x1f')]===_0x777f('0x1e');var _0x1ef1c5=_0x217e98[_0x777f('0x20')];var _0x3aeb58=_0x41855a?0x0:_0xf4d60b[_0x777f('0x21')];var _0x4e1153=_0x41855a?_0x217e98['count']:_0xf4d60b[_0x777f('0x21')]+_0xf4d60b[_0x777f('0x1f')];var _0x31f786;if(_0x4e1153>=_0x1ef1c5){_0x4e1153=_0x1ef1c5;_0x31f786=0xc8;}else{_0x31f786=0xce;}_0x43d45a[_0x777f('0x1c')](_0x31f786);return _0x43d45a[_0x777f('0x22')](_0x777f('0x23'),_0x3aeb58+'-'+_0x4e1153+'/'+_0x1ef1c5)[_0x777f('0x1d')](_0x217e98);}return null;};}function patchUpdates(_0x143f3d){return function(_0x5d31f1){try{jsonpatch[_0x777f('0x24')](_0x5d31f1,_0x143f3d,!![]);}catch(_0x5637d0){return BPromise[_0x777f('0x25')](_0x5637d0);}return _0x5d31f1[_0x777f('0x26')]();};}function saveUpdates(_0x1cc281,_0x38e32f){return function(_0x3a0c1d){if(_0x3a0c1d){return _0x3a0c1d[_0x777f('0x27')](_0x1cc281)[_0x777f('0x28')](function(_0x5732c6){return _0x5732c6;});}return null;};}function removeEntity(_0x780490,_0x17f1ed){return function(_0x5089ba){if(_0x5089ba){return _0x5089ba[_0x777f('0x29')]()['then'](function(){_0x780490[_0x777f('0x1c')](0xcc)[_0x777f('0x1b')]();});}};}function handleEntityNotFound(_0x109a8e,_0x3fe93d){return function(_0x43a7c1){if(!_0x43a7c1){_0x109a8e[_0x777f('0x1a')](0x194);}return _0x43a7c1;};}function handleError(_0x2c9edc,_0x1c0984){_0x1c0984=_0x1c0984||0x1f4;return function(_0x104b86){logger['error'](_0x104b86['stack']);if(_0x104b86[_0x777f('0x2a')]){delete _0x104b86[_0x777f('0x2a')];}_0x2c9edc[_0x777f('0x1c')](_0x1c0984)[_0x777f('0x2b')](_0x104b86);};}exports[_0x777f('0x2c')]=function(_0x32007e,_0x221dda){var _0x5b0504={},_0x2ebed8={},_0x3940cb={'count':0x0,'rows':[]};var _0x5b78b8=_[_0x777f('0x2d')](db[_0x777f('0x2e')]['rawAttributes'],function(_0x502924){return{'name':_0x502924[_0x777f('0x2f')],'type':_0x502924[_0x777f('0x30')][_0x777f('0x31')]};});_0x2ebed8[_0x777f('0x32')]=_[_0x777f('0x2d')](_0x5b78b8,_0x777f('0x2a'));_0x2ebed8[_0x777f('0x33')]=_[_0x777f('0x34')](_0x32007e[_0x777f('0x33')]);_0x2ebed8[_0x777f('0x35')]=_['intersection'](_0x2ebed8[_0x777f('0x32')],_0x2ebed8[_0x777f('0x33')]);_0x5b0504[_0x777f('0x36')]=_[_0x777f('0x37')](_0x2ebed8[_0x777f('0x32')],qs[_0x777f('0x38')](_0x32007e['query'][_0x777f('0x38')]));_0x5b0504[_0x777f('0x36')]=_0x5b0504['attributes'][_0x777f('0x39')]?_0x5b0504['attributes']:_0x2ebed8['model'];if(!_0x32007e[_0x777f('0x33')][_0x777f('0x3a')](_0x777f('0x3b'))){_0x5b0504[_0x777f('0x1f')]=qs[_0x777f('0x1f')](_0x32007e[_0x777f('0x33')][_0x777f('0x1f')]);_0x5b0504[_0x777f('0x21')]=qs['offset'](_0x32007e['query'][_0x777f('0x21')]);}_0x5b0504[_0x777f('0x3c')]=qs[_0x777f('0x3d')](_0x32007e[_0x777f('0x33')][_0x777f('0x3d')]);_0x5b0504[_0x777f('0x3e')]=qs[_0x777f('0x35')](_[_0x777f('0x3f')](_0x32007e['query'],_0x2ebed8[_0x777f('0x35')]),_0x5b78b8);if(_0x32007e[_0x777f('0x33')][_0x777f('0x40')]){_0x5b0504[_0x777f('0x3e')]=_[_0x777f('0x41')](_0x5b0504[_0x777f('0x3e')],{'$or':_[_0x777f('0x2d')](_0x5b78b8,function(_0x1f32ad){if(_0x1f32ad['type']!=='VIRTUAL'){var _0x19795e={};_0x19795e[_0x1f32ad['name']]={'$like':'%'+_0x32007e[_0x777f('0x33')][_0x777f('0x40')]+'%'};return _0x19795e;}})});}_0x5b0504=_[_0x777f('0x41')]({},_0x5b0504,_0x32007e[_0x777f('0x42')]);var _0x2727d0={'where':_0x5b0504['where']};return db[_0x777f('0x2e')][_0x777f('0x20')](_0x2727d0)[_0x777f('0x28')](function(_0x3a5d34){_0x3940cb[_0x777f('0x20')]=_0x3a5d34;if(_0x32007e['query'][_0x777f('0x43')]){_0x5b0504[_0x777f('0x44')]=[{'all':!![]}];}return db[_0x777f('0x2e')][_0x777f('0x45')](_0x5b0504);})[_0x777f('0x28')](function(_0x43e53d){_0x3940cb[_0x777f('0x46')]=_0x43e53d;return _0x3940cb;})[_0x777f('0x28')](respondWithFilteredResult(_0x221dda,_0x5b0504))['catch'](handleError(_0x221dda,null));};exports['show']=function(_0x2924e9,_0x4a4eb6){var _0x5ac30a={'raw':!![],'where':{'id':_0x2924e9[_0x777f('0x47')]['id']}},_0xdfb525={};_0xdfb525[_0x777f('0x32')]=_['keys'](db['ChatQueueReport'][_0x777f('0x48')]);_0xdfb525[_0x777f('0x33')]=_[_0x777f('0x34')](_0x2924e9[_0x777f('0x33')]);_0xdfb525['filters']=_[_0x777f('0x37')](_0xdfb525[_0x777f('0x32')],_0xdfb525[_0x777f('0x33')]);_0x5ac30a[_0x777f('0x36')]=_[_0x777f('0x37')](_0xdfb525[_0x777f('0x32')],qs[_0x777f('0x38')](_0x2924e9[_0x777f('0x33')][_0x777f('0x38')]));_0x5ac30a[_0x777f('0x36')]=_0x5ac30a[_0x777f('0x36')][_0x777f('0x39')]?_0x5ac30a[_0x777f('0x36')]:_0xdfb525[_0x777f('0x32')];if(_0x2924e9[_0x777f('0x33')]['includeAll']){_0x5ac30a[_0x777f('0x44')]=[{'all':!![]}];}_0x5ac30a=_[_0x777f('0x41')]({},_0x5ac30a,_0x2924e9[_0x777f('0x42')]);return db[_0x777f('0x2e')]['find'](_0x5ac30a)[_0x777f('0x28')](handleEntityNotFound(_0x4a4eb6,null))[_0x777f('0x28')](respondWithResult(_0x4a4eb6,null))[_0x777f('0x49')](handleError(_0x4a4eb6,null));};exports['create']=function(_0x486664,_0x364d41){return db['ChatQueueReport']['create'](_0x486664[_0x777f('0x4a')],{})[_0x777f('0x28')](respondWithResult(_0x364d41,0xc9))[_0x777f('0x49')](handleError(_0x364d41,null));};exports[_0x777f('0x27')]=function(_0x3ba76d,_0x45ea24){if(_0x3ba76d[_0x777f('0x4a')]['id']){delete _0x3ba76d[_0x777f('0x4a')]['id'];}return db['ChatQueueReport'][_0x777f('0x4b')]({'where':{'id':_0x3ba76d[_0x777f('0x47')]['id']}})[_0x777f('0x28')](handleEntityNotFound(_0x45ea24,null))[_0x777f('0x28')](saveUpdates(_0x3ba76d[_0x777f('0x4a')],null))[_0x777f('0x28')](respondWithResult(_0x45ea24,null))[_0x777f('0x49')](handleError(_0x45ea24,null));};exports[_0x777f('0x29')]=function(_0x124fc5,_0x145cbb){return db[_0x777f('0x2e')][_0x777f('0x4b')]({'where':{'id':_0x124fc5[_0x777f('0x47')]['id']}})[_0x777f('0x28')](handleEntityNotFound(_0x145cbb,null))[_0x777f('0x28')](removeEntity(_0x145cbb,null))[_0x777f('0x49')](handleError(_0x145cbb,null));};exports[_0x777f('0x4c')]=function(_0x4d9f46,_0x126b50){return db['ChatQueueReport'][_0x777f('0x4c')]()[_0x777f('0x28')](respondWithResult(_0x126b50,null))[_0x777f('0x49')](handleError(_0x126b50,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index efea479..3f10012 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x5dc123,_0x1a7217){var _0xd98e38=function(_0x1332aa){while(--_0x1332aa){_0x5dc123['push'](_0x5dc123['shift']());}};_0xd98e38(++_0x1a7217);}(_0xe706,0xa3));var _0x6e70=function(_0x6d394d,_0x185b80){_0x6d394d=_0x6d394d-0x0;var _0x1f0621=_0xe706[_0x6d394d];return _0x1f0621;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x223f38,_0x4ece37){var _0x4f18b7=function(_0x502d2c){while(--_0x502d2c){_0x223f38['push'](_0x223f38['shift']());}};_0x4f18b7(++_0x4ece37);}(_0xe706,0xa3));var _0x6e70=function(_0x67098f,_0x55e2d0){_0x67098f=_0x67098f-0x0;var _0x4cf120=_0xe706[_0x67098f];return _0x4cf120;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 23f4b5d..00f510b 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 _0xf097=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','then','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment'];(function(_0x54c10d,_0x2f2251){var _0x1fa703=function(_0x508eb4){while(--_0x508eb4){_0x54c10d['push'](_0x54c10d['shift']());}};_0x1fa703(++_0x2f2251);}(_0xf097,0x66));var _0x7f09=function(_0x541e51,_0x3b4a2c){_0x541e51=_0x541e51-0x0;var _0x4cc19e=_0xf097[_0x541e51];return _0x4cc19e;};'use strict';var _=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var moment=require(_0x7f09('0x2'));var BPromise=require(_0x7f09('0x3'));var rs=require(_0x7f09('0x4'));var fs=require('fs');var Redis=require(_0x7f09('0x5'));var db=require(_0x7f09('0x6'))['db'];var utils=require(_0x7f09('0x7'));var logger=require(_0x7f09('0x8'))(_0x7f09('0x9'));var config=require('../../config/environment');var jayson=require(_0x7f09('0xa'));var client=jayson[_0x7f09('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364e42,_0x6d7627,_0x1a60cf){return new BPromise(function(_0xebfeae,_0x3336ba){return client[_0x7f09('0xc')](_0x364e42,_0x1a60cf)['then'](function(_0x4f845f){logger[_0x7f09('0xd')](_0x7f09('0xe'),_0x6d7627,'request\x20sent');logger[_0x7f09('0xf')](_0x7f09('0x10'),_0x6d7627,_0x7f09('0x11'),JSON[_0x7f09('0x12')](_0x4f845f));if(_0x4f845f[_0x7f09('0x13')]){if(_0x4f845f[_0x7f09('0x13')]['code']===0x1f4){logger[_0x7f09('0x13')](_0x7f09('0xe'),_0x6d7627,_0x4f845f[_0x7f09('0x13')][_0x7f09('0x14')]);return _0x3336ba(_0x4f845f['error']['message']);}logger[_0x7f09('0x13')](_0x7f09('0xe'),_0x6d7627,_0x4f845f['error']['message']);return _0xebfeae(_0x4f845f[_0x7f09('0x13')][_0x7f09('0x14')]);}else{logger[_0x7f09('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x6d7627,_0x7f09('0x11'));_0xebfeae(_0x4f845f[_0x7f09('0x15')][_0x7f09('0x14')]);}})[_0x7f09('0x16')](function(_0x32b561){logger[_0x7f09('0x13')](_0x7f09('0xe'),_0x6d7627,_0x32b561);_0x3336ba(_0x32b561);});});}exports[_0x7f09('0x17')]=function(_0x25ba41){var _0x420401=this;return new Promise(function(_0x4a4bcb,_0x1b5427){return db[_0x7f09('0x18')][_0x7f09('0x19')](_0x25ba41['body'],{'raw':_0x25ba41[_0x7f09('0x1a')]?_0x25ba41[_0x7f09('0x1a')][_0x7f09('0x1b')]===undefined?!![]:![]:!![]})[_0x7f09('0x1c')](function(_0x5e59e5){logger[_0x7f09('0xd')]('CreateChatQueueReport',_0x25ba41);logger['debug'](_0x7f09('0x17'),_0x25ba41,JSON[_0x7f09('0x12')](_0x5e59e5));_0x4a4bcb(_0x5e59e5);})[_0x7f09('0x16')](function(_0x916963){logger[_0x7f09('0x13')](_0x7f09('0x17'),_0x916963[_0x7f09('0x14')],_0x25ba41);_0x1b5427(_0x420401[_0x7f09('0x13')](0x1f4,_0x916963[_0x7f09('0x14')]));});});};exports[_0x7f09('0x1d')]=function(_0x225299){var _0x101640=this;return new Promise(function(_0x5bfd73,_0x2c40cf){return db[_0x7f09('0x18')][_0x7f09('0x1e')](_0x225299[_0x7f09('0x1f')],{'raw':_0x225299[_0x7f09('0x1a')]?_0x225299['options'][_0x7f09('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225299[_0x7f09('0x1a')]?_0x225299[_0x7f09('0x1a')][_0x7f09('0x20')]||null:null,'attributes':_0x225299['options']?_0x225299[_0x7f09('0x1a')][_0x7f09('0x21')]||null:null,'limit':_0x225299[_0x7f09('0x1a')]?_0x225299['options'][_0x7f09('0x22')]||null:null})[_0x7f09('0x1c')](function(_0x4d2d93){logger[_0x7f09('0xd')](_0x7f09('0x1d'),_0x225299);logger[_0x7f09('0xf')](_0x7f09('0x1d'),_0x225299,JSON[_0x7f09('0x12')](_0x4d2d93));_0x5bfd73(_0x4d2d93);})[_0x7f09('0x16')](function(_0x2af662){logger[_0x7f09('0x13')](_0x7f09('0x1d'),_0x2af662[_0x7f09('0x14')],_0x225299);_0x2c40cf(_0x101640['error'](0x1f4,_0x2af662[_0x7f09('0x14')]));});});};
\ No newline at end of file
+var _0xa30e=['CreateChatQueueReport','ChatQueueReport','body','options','raw','update','attributes','UpdateChatQueueReport','debug','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x28732e,_0x19dd8b){var _0x163b44=function(_0x1cf8fa){while(--_0x1cf8fa){_0x28732e['push'](_0x28732e['shift']());}};_0x163b44(++_0x19dd8b);}(_0xa30e,0x117));var _0xea30=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0xa30e[_0x533110];return _0xc3c866;};'use strict';var _=require(_0xea30('0x0'));var util=require(_0xea30('0x1'));var moment=require(_0xea30('0x2'));var BPromise=require(_0xea30('0x3'));var rs=require(_0xea30('0x4'));var fs=require('fs');var Redis=require(_0xea30('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea30('0x6'));var config=require(_0xea30('0x7'));var jayson=require(_0xea30('0x8'));var client=jayson['client'][_0xea30('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33e178,_0x10c36f,_0x32320b){return new BPromise(function(_0x1c5d00,_0xc7858e){return client[_0xea30('0xa')](_0x33e178,_0x32320b)[_0xea30('0xb')](function(_0x4192e9){logger[_0xea30('0xc')](_0xea30('0xd'),_0x10c36f,_0xea30('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x10c36f,_0xea30('0xe'),JSON[_0xea30('0xf')](_0x4192e9));if(_0x4192e9[_0xea30('0x10')]){if(_0x4192e9[_0xea30('0x10')][_0xea30('0x11')]===0x1f4){logger[_0xea30('0x10')](_0xea30('0xd'),_0x10c36f,_0x4192e9[_0xea30('0x10')][_0xea30('0x12')]);return _0xc7858e(_0x4192e9[_0xea30('0x10')][_0xea30('0x12')]);}logger[_0xea30('0x10')](_0xea30('0xd'),_0x10c36f,_0x4192e9['error'][_0xea30('0x12')]);return _0x1c5d00(_0x4192e9[_0xea30('0x10')][_0xea30('0x12')]);}else{logger['info'](_0xea30('0xd'),_0x10c36f,_0xea30('0xe'));_0x1c5d00(_0x4192e9[_0xea30('0x13')][_0xea30('0x12')]);}})[_0xea30('0x14')](function(_0x36212e){logger[_0xea30('0x10')](_0xea30('0xd'),_0x10c36f,_0x36212e);_0xc7858e(_0x36212e);});});}exports[_0xea30('0x15')]=function(_0x2e7504){var _0x2bca4d=this;return new Promise(function(_0x225bb7,_0x3054fa){return db[_0xea30('0x16')]['create'](_0x2e7504[_0xea30('0x17')],{'raw':_0x2e7504[_0xea30('0x18')]?_0x2e7504[_0xea30('0x18')][_0xea30('0x19')]===undefined?!![]:![]:!![]})[_0xea30('0xb')](function(_0x2c3cc0){logger[_0xea30('0xc')](_0xea30('0x15'),_0x2e7504);logger['debug'](_0xea30('0x15'),_0x2e7504,JSON['stringify'](_0x2c3cc0));_0x225bb7(_0x2c3cc0);})['catch'](function(_0x50951f){logger[_0xea30('0x10')](_0xea30('0x15'),_0x50951f[_0xea30('0x12')],_0x2e7504);_0x3054fa(_0x2bca4d[_0xea30('0x10')](0x1f4,_0x50951f[_0xea30('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x74ceb1){var _0xf974=this;return new Promise(function(_0x3cd813,_0x2b7805){return db[_0xea30('0x16')][_0xea30('0x1a')](_0x74ceb1[_0xea30('0x17')],{'raw':_0x74ceb1['options']?_0x74ceb1['options'][_0xea30('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x74ceb1[_0xea30('0x18')]?_0x74ceb1[_0xea30('0x18')]['where']||null:null,'attributes':_0x74ceb1[_0xea30('0x18')]?_0x74ceb1[_0xea30('0x18')][_0xea30('0x1b')]||null:null,'limit':_0x74ceb1[_0xea30('0x18')]?_0x74ceb1['options']['limit']||null:null})[_0xea30('0xb')](function(_0x144aaa){logger[_0xea30('0xc')](_0xea30('0x1c'),_0x74ceb1);logger[_0xea30('0x1d')](_0xea30('0x1c'),_0x74ceb1,JSON['stringify'](_0x144aaa));_0x3cd813(_0x144aaa);})[_0xea30('0x14')](function(_0xdcf47e){logger[_0xea30('0x10')](_0xea30('0x1c'),_0xdcf47e[_0xea30('0x12')],_0x74ceb1);_0x2b7805(_0xf974[_0xea30('0x10')](0x1f4,_0xdcf47e[_0xea30('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 7d19663..4e74e4b 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 _0x7571=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatQueueReport.controller','isAuthenticated','get','/describe','show','post'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x7571,0x1a8));var _0x1757=function(_0x267c41,_0x244bd2){_0x267c41=_0x267c41-0x0;var _0x160aaf=_0x7571[_0x267c41];return _0x160aaf;};'use strict';var multer=require(_0x1757('0x0'));var util=require(_0x1757('0x1'));var path=require(_0x1757('0x2'));var timeout=require(_0x1757('0x3'));var express=require(_0x1757('0x4'));var router=express['Router']();var fs_extra=require(_0x1757('0x5'));var auth=require(_0x1757('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1757('0x7'));router['get']('/',auth[_0x1757('0x8')](),controller['index']);router[_0x1757('0x9')](_0x1757('0xa'),auth[_0x1757('0x8')](),controller['describe']);router[_0x1757('0x9')]('/:id',auth[_0x1757('0x8')](),controller[_0x1757('0xb')]);router[_0x1757('0xc')]('/',auth['isAuthenticated'](),controller[_0x1757('0xd')]);router[_0x1757('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1757('0xf')]);router[_0x1757('0x10')]('/:id',auth[_0x1757('0x8')](),controller[_0x1757('0x11')]);module[_0x1757('0x12')]=router;
\ No newline at end of file
+var _0x49d5=['express','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path'];(function(_0x3c083b,_0x549e68){var _0x1c4f50=function(_0x49f5aa){while(--_0x49f5aa){_0x3c083b['push'](_0x3c083b['shift']());}};_0x1c4f50(++_0x549e68);}(_0x49d5,0x1dd));var _0x549d=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x49d5[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x549d('0x0'));var util=require(_0x549d('0x1'));var path=require(_0x549d('0x2'));var timeout=require('connect-timeout');var express=require(_0x549d('0x3'));var router=express[_0x549d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x549d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x549d('0x6'));var controller=require(_0x549d('0x7'));router[_0x549d('0x8')]('/',auth[_0x549d('0x9')](),controller[_0x549d('0xa')]);router['get'](_0x549d('0xb'),auth['isAuthenticated'](),controller[_0x549d('0xc')]);router['get'](_0x549d('0xd'),auth['isAuthenticated'](),controller[_0x549d('0xe')]);router[_0x549d('0xf')]('/',auth[_0x549d('0x9')](),controller[_0x549d('0x10')]);router[_0x549d('0x11')](_0x549d('0xd'),auth[_0x549d('0x9')](),controller['update']);router['delete'](_0x549d('0xd'),auth[_0x549d('0x9')](),controller[_0x549d('0x12')]);module[_0x549d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0356e48..a653bf0 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1004fa,_0x21747f){var _0x4b53f2=function(_0x5120cb){while(--_0x5120cb){_0x1004fa['push'](_0x1004fa['shift']());}};_0x4b53f2(++_0x21747f);}(_0x70e0,0x17b));var _0x070e=function(_0x309995,_0xa5e701){_0x309995=_0x309995-0x0;var _0x1453f7=_0x70e0[_0x309995];return _0x1453f7;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x34e8,0x12c));var _0x834e=function(_0x44ce95,_0x57bcbf){_0x44ce95=_0x44ce95-0x0;var _0x276954=_0x34e8[_0x44ce95];return _0x276954;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index b207343..b797fde 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 _0x4ea8=['count','offset','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','keys','merge','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit'];(function(_0x2648d5,_0x59d362){var _0x47abda=function(_0x4ed58a){while(--_0x4ed58a){_0x2648d5['push'](_0x2648d5['shift']());}};_0x47abda(++_0x59d362);}(_0x4ea8,0xc0));var _0x84ea=function(_0x536442,_0x18e920){_0x536442=_0x536442-0x0;var _0x82516e=_0x4ea8[_0x536442];return _0x82516e;};'use strict';var emlformat=require(_0x84ea('0x0'));var rimraf=require(_0x84ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84ea('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x84ea('0x3'));var util=require(_0x84ea('0x4'));var path=require('path');var sox=require(_0x84ea('0x5'));var csv=require(_0x84ea('0x6'));var ejs=require(_0x84ea('0x7'));var fs=require('fs');var fs_extra=require(_0x84ea('0x8'));var _=require('lodash');var squel=require(_0x84ea('0x9'));var crypto=require(_0x84ea('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x84ea('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x84ea('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84ea('0xd'));var logger=require(_0x84ea('0xe'))(_0x84ea('0xf'));var utils=require(_0x84ea('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x84ea('0x11'));var db=require(_0x84ea('0x12'))['db'];function respondWithStatusCode(_0x2fdf8b,_0x3b0887){_0x3b0887=_0x3b0887||0xcc;return function(_0x5b6140){if(_0x5b6140){return _0x2fdf8b['sendStatus'](_0x3b0887);}return _0x2fdf8b[_0x84ea('0x13')](_0x3b0887)[_0x84ea('0x14')]();};}function respondWithResult(_0x2950a8,_0x81ff83){_0x81ff83=_0x81ff83||0xc8;return function(_0x25d628){if(_0x25d628){return _0x2950a8[_0x84ea('0x13')](_0x81ff83)[_0x84ea('0x15')](_0x25d628);}};}function respondWithFilteredResult(_0x5b957e,_0x429762){return function(_0xcfc6e9){if(_0xcfc6e9){var _0x16bef9=typeof _0x429762['offset']===_0x84ea('0x16')&&typeof _0x429762[_0x84ea('0x17')]===_0x84ea('0x16');var _0x21fe37=_0xcfc6e9['count'];var _0x57ec5b=_0x16bef9?0x0:_0x429762['offset'];var _0x2cbef5=_0x16bef9?_0xcfc6e9[_0x84ea('0x18')]:_0x429762[_0x84ea('0x19')]+_0x429762[_0x84ea('0x17')];var _0x133d78;if(_0x2cbef5>=_0x21fe37){_0x2cbef5=_0x21fe37;_0x133d78=0xc8;}else{_0x133d78=0xce;}_0x5b957e['status'](_0x133d78);return _0x5b957e['set'](_0x84ea('0x1a'),_0x57ec5b+'-'+_0x2cbef5+'/'+_0x21fe37)[_0x84ea('0x15')](_0xcfc6e9);}return null;};}function patchUpdates(_0x5824d7){return function(_0x25794f){try{jsonpatch[_0x84ea('0x1b')](_0x25794f,_0x5824d7,!![]);}catch(_0x1fc551){return BPromise[_0x84ea('0x1c')](_0x1fc551);}return _0x25794f['save']();};}function saveUpdates(_0x2d9a40,_0x5466e7){return function(_0x5b0a99){if(_0x5b0a99){return _0x5b0a99[_0x84ea('0x1d')](_0x2d9a40)[_0x84ea('0x1e')](function(_0x52f558){return _0x52f558;});}return null;};}function removeEntity(_0x18d567,_0x8adc39){return function(_0x456f0f){if(_0x456f0f){return _0x456f0f[_0x84ea('0x1f')]()[_0x84ea('0x1e')](function(){_0x18d567[_0x84ea('0x13')](0xcc)[_0x84ea('0x14')]();});}};}function handleEntityNotFound(_0x22dd92,_0x14a25c){return function(_0x1c3064){if(!_0x1c3064){_0x22dd92[_0x84ea('0x20')](0x194);}return _0x1c3064;};}function handleError(_0x222f0c,_0x1cb911){_0x1cb911=_0x1cb911||0x1f4;return function(_0x253c51){logger[_0x84ea('0x21')](_0x253c51[_0x84ea('0x22')]);if(_0x253c51['name']){delete _0x253c51['name'];}_0x222f0c[_0x84ea('0x13')](_0x1cb911)[_0x84ea('0x23')](_0x253c51);};}exports[_0x84ea('0x24')]=function(_0x26ed33,_0x173fd9){var _0x342fed={},_0x5aba3f={},_0x30e78c={'count':0x0,'rows':[]};var _0x28774d=_[_0x84ea('0x25')](db['ChatTransferReport'][_0x84ea('0x26')],function(_0x11ebd0){return{'name':_0x11ebd0[_0x84ea('0x27')],'type':_0x11ebd0['type'][_0x84ea('0x28')]};});_0x5aba3f[_0x84ea('0x29')]=_[_0x84ea('0x25')](_0x28774d,_0x84ea('0x2a'));_0x5aba3f[_0x84ea('0x2b')]=_['keys'](_0x26ed33[_0x84ea('0x2b')]);_0x5aba3f[_0x84ea('0x2c')]=_[_0x84ea('0x2d')](_0x5aba3f[_0x84ea('0x29')],_0x5aba3f['query']);_0x342fed[_0x84ea('0x2e')]=_[_0x84ea('0x2d')](_0x5aba3f[_0x84ea('0x29')],qs[_0x84ea('0x2f')](_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x2f')]));_0x342fed[_0x84ea('0x2e')]=_0x342fed[_0x84ea('0x2e')]['length']?_0x342fed['attributes']:_0x5aba3f[_0x84ea('0x29')];if(!_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x30')](_0x84ea('0x31'))){_0x342fed[_0x84ea('0x17')]=qs[_0x84ea('0x17')](_0x26ed33[_0x84ea('0x2b')]['limit']);_0x342fed[_0x84ea('0x19')]=qs[_0x84ea('0x19')](_0x26ed33['query'][_0x84ea('0x19')]);}_0x342fed[_0x84ea('0x32')]=qs[_0x84ea('0x33')](_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x33')]);_0x342fed[_0x84ea('0x34')]=qs['filters'](_[_0x84ea('0x35')](_0x26ed33['query'],_0x5aba3f['filters']),_0x28774d);if(_0x26ed33['query'][_0x84ea('0x36')]){_0x342fed['where']=_['merge'](_0x342fed[_0x84ea('0x34')],{'$or':_[_0x84ea('0x25')](_0x28774d,function(_0xd1fdd7){if(_0xd1fdd7[_0x84ea('0x37')]!==_0x84ea('0x38')){var _0x5cbebc={};_0x5cbebc[_0xd1fdd7[_0x84ea('0x2a')]]={'$like':'%'+_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x36')]+'%'};return _0x5cbebc;}})});}_0x342fed=_['merge']({},_0x342fed,_0x26ed33[_0x84ea('0x39')]);var _0x5c3f07={'where':_0x342fed['where']};return db[_0x84ea('0x3a')][_0x84ea('0x18')](_0x5c3f07)['then'](function(_0x56f213){_0x30e78c[_0x84ea('0x18')]=_0x56f213;if(_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x3b')]){_0x342fed[_0x84ea('0x3c')]=[{'all':!![]}];}return db[_0x84ea('0x3a')][_0x84ea('0x3d')](_0x342fed);})[_0x84ea('0x1e')](function(_0x49a19c){_0x30e78c[_0x84ea('0x3e')]=_0x49a19c;return _0x30e78c;})[_0x84ea('0x1e')](respondWithFilteredResult(_0x173fd9,_0x342fed))[_0x84ea('0x3f')](handleError(_0x173fd9,null));};exports[_0x84ea('0x40')]=function(_0x5c9ff9,_0x1b5e4e){var _0x4f5542={'raw':!![],'where':{'id':_0x5c9ff9['params']['id']}},_0x4863a3={};_0x4863a3[_0x84ea('0x29')]=_['keys'](db[_0x84ea('0x3a')][_0x84ea('0x26')]);_0x4863a3[_0x84ea('0x2b')]=_[_0x84ea('0x41')](_0x5c9ff9[_0x84ea('0x2b')]);_0x4863a3[_0x84ea('0x2c')]=_[_0x84ea('0x2d')](_0x4863a3['model'],_0x4863a3['query']);_0x4f5542[_0x84ea('0x2e')]=_[_0x84ea('0x2d')](_0x4863a3[_0x84ea('0x29')],qs['fields'](_0x5c9ff9['query']['fields']));_0x4f5542['attributes']=_0x4f5542[_0x84ea('0x2e')]['length']?_0x4f5542[_0x84ea('0x2e')]:_0x4863a3[_0x84ea('0x29')];if(_0x5c9ff9['query'][_0x84ea('0x3b')]){_0x4f5542[_0x84ea('0x3c')]=[{'all':!![]}];}_0x4f5542=_[_0x84ea('0x42')]({},_0x4f5542,_0x5c9ff9[_0x84ea('0x39')]);return db[_0x84ea('0x3a')][_0x84ea('0x43')](_0x4f5542)[_0x84ea('0x1e')](handleEntityNotFound(_0x1b5e4e,null))['then'](respondWithResult(_0x1b5e4e,null))[_0x84ea('0x3f')](handleError(_0x1b5e4e,null));};exports[_0x84ea('0x44')]=function(_0x455a97,_0x291320){return db[_0x84ea('0x3a')][_0x84ea('0x44')](_0x455a97[_0x84ea('0x45')],{})[_0x84ea('0x1e')](respondWithResult(_0x291320,0xc9))[_0x84ea('0x3f')](handleError(_0x291320,null));};exports[_0x84ea('0x1d')]=function(_0x49df49,_0xe237c7){if(_0x49df49['body']['id']){delete _0x49df49[_0x84ea('0x45')]['id'];}return db[_0x84ea('0x3a')][_0x84ea('0x43')]({'where':{'id':_0x49df49['params']['id']}})[_0x84ea('0x1e')](handleEntityNotFound(_0xe237c7,null))[_0x84ea('0x1e')](saveUpdates(_0x49df49[_0x84ea('0x45')],null))[_0x84ea('0x1e')](respondWithResult(_0xe237c7,null))[_0x84ea('0x3f')](handleError(_0xe237c7,null));};exports[_0x84ea('0x1f')]=function(_0x272d84,_0x2f1ac4){return db[_0x84ea('0x3a')]['find']({'where':{'id':_0x272d84[_0x84ea('0x46')]['id']}})[_0x84ea('0x1e')](handleEntityNotFound(_0x2f1ac4,null))[_0x84ea('0x1e')](removeEntity(_0x2f1ac4,null))['catch'](handleError(_0x2f1ac4,null));};exports[_0x84ea('0x47')]=function(_0x3e25ed,_0x1a68b0){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x1a68b0,null))[_0x84ea('0x3f')](handleError(_0x1a68b0,null));};
\ No newline at end of file
+var _0xcaa8=['status','set','json','apply','save','update','then','destroy','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0xcaa8,0xc3));var _0x8caa=function(_0x2c668d,_0x54b0a3){_0x2c668d=_0x2c668d-0x0;var _0x4e180c=_0xcaa8[_0x2c668d];return _0x4e180c;};'use strict';var emlformat=require(_0x8caa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8caa('0x1'));var jsonpatch=require(_0x8caa('0x2'));var rp=require(_0x8caa('0x3'));var moment=require(_0x8caa('0x4'));var BPromise=require(_0x8caa('0x5'));var Mustache=require(_0x8caa('0x6'));var util=require(_0x8caa('0x7'));var path=require(_0x8caa('0x8'));var sox=require('sox');var csv=require(_0x8caa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8caa('0xa'));var _=require(_0x8caa('0xb'));var squel=require('squel');var crypto=require(_0x8caa('0xc'));var jsforce=require(_0x8caa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8caa('0x9'));var querystring=require(_0x8caa('0xe'));var Papa=require(_0x8caa('0xf'));var Redis=require(_0x8caa('0x10'));var authService=require(_0x8caa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8caa('0x12'));var hardwareService=require(_0x8caa('0x13'));var logger=require('../../config/logger')(_0x8caa('0x14'));var utils=require(_0x8caa('0x15'));var config=require(_0x8caa('0x16'));var licenseUtil=require(_0x8caa('0x17'));var db=require(_0x8caa('0x18'))['db'];function respondWithStatusCode(_0x3eddd2,_0x53d063){_0x53d063=_0x53d063||0xcc;return function(_0x19caf2){if(_0x19caf2){return _0x3eddd2['sendStatus'](_0x53d063);}return _0x3eddd2['status'](_0x53d063)[_0x8caa('0x19')]();};}function respondWithResult(_0x54ace6,_0x2fbb5b){_0x2fbb5b=_0x2fbb5b||0xc8;return function(_0x1e2564){if(_0x1e2564){return _0x54ace6['status'](_0x2fbb5b)['json'](_0x1e2564);}};}function respondWithFilteredResult(_0x35ba56,_0x23792b){return function(_0x56ce25){if(_0x56ce25){var _0x446133=typeof _0x23792b[_0x8caa('0x1a')]===_0x8caa('0x1b')&&typeof _0x23792b[_0x8caa('0x1c')]===_0x8caa('0x1b');var _0x24cead=_0x56ce25['count'];var _0x30e161=_0x446133?0x0:_0x23792b[_0x8caa('0x1a')];var _0x790e0f=_0x446133?_0x56ce25[_0x8caa('0x1d')]:_0x23792b[_0x8caa('0x1a')]+_0x23792b[_0x8caa('0x1c')];var _0x17f670;if(_0x790e0f>=_0x24cead){_0x790e0f=_0x24cead;_0x17f670=0xc8;}else{_0x17f670=0xce;}_0x35ba56[_0x8caa('0x1e')](_0x17f670);return _0x35ba56[_0x8caa('0x1f')]('Content-Range',_0x30e161+'-'+_0x790e0f+'/'+_0x24cead)[_0x8caa('0x20')](_0x56ce25);}return null;};}function patchUpdates(_0x167f98){return function(_0x57ae58){try{jsonpatch[_0x8caa('0x21')](_0x57ae58,_0x167f98,!![]);}catch(_0x2ebe7c){return BPromise['reject'](_0x2ebe7c);}return _0x57ae58[_0x8caa('0x22')]();};}function saveUpdates(_0x168586,_0x14f2a3){return function(_0x128992){if(_0x128992){return _0x128992[_0x8caa('0x23')](_0x168586)[_0x8caa('0x24')](function(_0x39877a){return _0x39877a;});}return null;};}function removeEntity(_0x4ed6ce,_0x149245){return function(_0x372dfb){if(_0x372dfb){return _0x372dfb[_0x8caa('0x25')]()[_0x8caa('0x24')](function(){_0x4ed6ce[_0x8caa('0x1e')](0xcc)[_0x8caa('0x19')]();});}};}function handleEntityNotFound(_0x5ca7cc,_0x8a69ed){return function(_0x2fa259){if(!_0x2fa259){_0x5ca7cc['sendStatus'](0x194);}return _0x2fa259;};}function handleError(_0x4daf5e,_0x289ae1){_0x289ae1=_0x289ae1||0x1f4;return function(_0x2cf8b1){logger['error'](_0x2cf8b1[_0x8caa('0x26')]);if(_0x2cf8b1[_0x8caa('0x27')]){delete _0x2cf8b1[_0x8caa('0x27')];}_0x4daf5e[_0x8caa('0x1e')](_0x289ae1)[_0x8caa('0x28')](_0x2cf8b1);};}exports[_0x8caa('0x29')]=function(_0x2a634f,_0x3c2082){var _0x475ba8={},_0x489064={},_0x6892ec={'count':0x0,'rows':[]};var _0x1d9930=_[_0x8caa('0x2a')](db[_0x8caa('0x2b')][_0x8caa('0x2c')],function(_0x3a6149){return{'name':_0x3a6149['fieldName'],'type':_0x3a6149[_0x8caa('0x2d')][_0x8caa('0x2e')]};});_0x489064[_0x8caa('0x2f')]=_[_0x8caa('0x2a')](_0x1d9930,'name');_0x489064['query']=_[_0x8caa('0x30')](_0x2a634f[_0x8caa('0x31')]);_0x489064['filters']=_[_0x8caa('0x32')](_0x489064[_0x8caa('0x2f')],_0x489064['query']);_0x475ba8['attributes']=_[_0x8caa('0x32')](_0x489064[_0x8caa('0x2f')],qs[_0x8caa('0x33')](_0x2a634f['query']['fields']));_0x475ba8[_0x8caa('0x34')]=_0x475ba8['attributes'][_0x8caa('0x35')]?_0x475ba8[_0x8caa('0x34')]:_0x489064[_0x8caa('0x2f')];if(!_0x2a634f['query'][_0x8caa('0x36')]('nolimit')){_0x475ba8[_0x8caa('0x1c')]=qs[_0x8caa('0x1c')](_0x2a634f[_0x8caa('0x31')][_0x8caa('0x1c')]);_0x475ba8[_0x8caa('0x1a')]=qs['offset'](_0x2a634f[_0x8caa('0x31')][_0x8caa('0x1a')]);}_0x475ba8[_0x8caa('0x37')]=qs[_0x8caa('0x38')](_0x2a634f[_0x8caa('0x31')][_0x8caa('0x38')]);_0x475ba8[_0x8caa('0x39')]=qs[_0x8caa('0x3a')](_[_0x8caa('0x3b')](_0x2a634f['query'],_0x489064['filters']),_0x1d9930);if(_0x2a634f[_0x8caa('0x31')]['filter']){_0x475ba8['where']=_['merge'](_0x475ba8[_0x8caa('0x39')],{'$or':_['map'](_0x1d9930,function(_0x33cc8c){if(_0x33cc8c[_0x8caa('0x2d')]!==_0x8caa('0x3c')){var _0x26a6fc={};_0x26a6fc[_0x33cc8c['name']]={'$like':'%'+_0x2a634f['query'][_0x8caa('0x3d')]+'%'};return _0x26a6fc;}})});}_0x475ba8=_[_0x8caa('0x3e')]({},_0x475ba8,_0x2a634f['options']);var _0x5895a1={'where':_0x475ba8[_0x8caa('0x39')]};return db[_0x8caa('0x2b')][_0x8caa('0x1d')](_0x5895a1)[_0x8caa('0x24')](function(_0xe64d6f){_0x6892ec[_0x8caa('0x1d')]=_0xe64d6f;if(_0x2a634f[_0x8caa('0x31')][_0x8caa('0x3f')]){_0x475ba8[_0x8caa('0x40')]=[{'all':!![]}];}return db[_0x8caa('0x2b')][_0x8caa('0x41')](_0x475ba8);})[_0x8caa('0x24')](function(_0x3ae3ae){_0x6892ec[_0x8caa('0x42')]=_0x3ae3ae;return _0x6892ec;})[_0x8caa('0x24')](respondWithFilteredResult(_0x3c2082,_0x475ba8))['catch'](handleError(_0x3c2082,null));};exports[_0x8caa('0x43')]=function(_0x3a8a7e,_0x51618d){var _0x29f264={'raw':!![],'where':{'id':_0x3a8a7e['params']['id']}},_0x2a726b={};_0x2a726b[_0x8caa('0x2f')]=_[_0x8caa('0x30')](db[_0x8caa('0x2b')][_0x8caa('0x2c')]);_0x2a726b[_0x8caa('0x31')]=_['keys'](_0x3a8a7e[_0x8caa('0x31')]);_0x2a726b[_0x8caa('0x3a')]=_[_0x8caa('0x32')](_0x2a726b[_0x8caa('0x2f')],_0x2a726b[_0x8caa('0x31')]);_0x29f264[_0x8caa('0x34')]=_['intersection'](_0x2a726b[_0x8caa('0x2f')],qs[_0x8caa('0x33')](_0x3a8a7e[_0x8caa('0x31')][_0x8caa('0x33')]));_0x29f264['attributes']=_0x29f264[_0x8caa('0x34')]['length']?_0x29f264[_0x8caa('0x34')]:_0x2a726b[_0x8caa('0x2f')];if(_0x3a8a7e['query']['includeAll']){_0x29f264[_0x8caa('0x40')]=[{'all':!![]}];}_0x29f264=_[_0x8caa('0x3e')]({},_0x29f264,_0x3a8a7e[_0x8caa('0x44')]);return db[_0x8caa('0x2b')][_0x8caa('0x45')](_0x29f264)[_0x8caa('0x24')](handleEntityNotFound(_0x51618d,null))[_0x8caa('0x24')](respondWithResult(_0x51618d,null))[_0x8caa('0x46')](handleError(_0x51618d,null));};exports[_0x8caa('0x47')]=function(_0x5cb9f9,_0x547b34){return db[_0x8caa('0x2b')][_0x8caa('0x47')](_0x5cb9f9[_0x8caa('0x48')],{})[_0x8caa('0x24')](respondWithResult(_0x547b34,0xc9))[_0x8caa('0x46')](handleError(_0x547b34,null));};exports[_0x8caa('0x23')]=function(_0x59ef12,_0x577ecb){if(_0x59ef12[_0x8caa('0x48')]['id']){delete _0x59ef12[_0x8caa('0x48')]['id'];}return db[_0x8caa('0x2b')]['find']({'where':{'id':_0x59ef12[_0x8caa('0x49')]['id']}})[_0x8caa('0x24')](handleEntityNotFound(_0x577ecb,null))['then'](saveUpdates(_0x59ef12[_0x8caa('0x48')],null))[_0x8caa('0x24')](respondWithResult(_0x577ecb,null))['catch'](handleError(_0x577ecb,null));};exports[_0x8caa('0x25')]=function(_0x18196f,_0x12d915){return db[_0x8caa('0x2b')]['find']({'where':{'id':_0x18196f[_0x8caa('0x49')]['id']}})['then'](handleEntityNotFound(_0x12d915,null))[_0x8caa('0x24')](removeEntity(_0x12d915,null))[_0x8caa('0x46')](handleError(_0x12d915,null));};exports[_0x8caa('0x4a')]=function(_0x2c4b1b,_0x16643d){return db[_0x8caa('0x2b')][_0x8caa('0x4a')]()[_0x8caa('0x24')](respondWithResult(_0x16643d,null))[_0x8caa('0x46')](handleError(_0x16643d,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index f86abab..7e77e58 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 _0xa1be=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0xa1be,0x128));var _0xea1b=function(_0x3c6aa0,_0x280f28){_0x3c6aa0=_0x3c6aa0-0x0;var _0x4b58c6=_0xa1be[_0x3c6aa0];return _0x4b58c6;};'use strict';var _=require(_0xea1b('0x0'));var util=require('util');var logger=require(_0xea1b('0x1'))('api');var moment=require(_0xea1b('0x2'));var BPromise=require(_0xea1b('0x3'));var rp=require(_0xea1b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea1b('0x5'));var attributes=require(_0xea1b('0x6'));module[_0xea1b('0x7')]=function(_0x5f0423,_0x364c82){return _0x5f0423[_0xea1b('0x8')](_0xea1b('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xea1b('0xa'),'fields':[_0xea1b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7056=['report_chat_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x2aeaf9,_0x5040be){var _0x38b16c=function(_0x47ef5a){while(--_0x47ef5a){_0x2aeaf9['push'](_0x2aeaf9['shift']());}};_0x38b16c(++_0x5040be);}(_0x7056,0x1b1));var _0x6705=function(_0x2dc7b7,_0x385139){_0x2dc7b7=_0x2dc7b7-0x0;var _0x12f248=_0x7056[_0x2dc7b7];return _0x12f248;};'use strict';var _=require(_0x6705('0x0'));var util=require(_0x6705('0x1'));var logger=require(_0x6705('0x2'))(_0x6705('0x3'));var moment=require(_0x6705('0x4'));var BPromise=require(_0x6705('0x5'));var rp=require(_0x6705('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6705('0x7'));var attributes=require(_0x6705('0x8'));module[_0x6705('0x9')]=function(_0x5e24ac,_0x5a1044){return _0x5e24ac[_0x6705('0xa')]('ChatTransferReport',attributes,{'tableName':_0x6705('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','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 2dc1624..7dc2803 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 _0xa4e3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa4e3,0x103));var _0x3a4e=function(_0x2ea92f,_0x1b4f22){_0x2ea92f=_0x2ea92f-0x0;var _0x5529ee=_0xa4e3[_0x2ea92f];return _0x5529ee;};'use strict';var _=require(_0x3a4e('0x0'));var util=require(_0x3a4e('0x1'));var moment=require('moment');var BPromise=require(_0x3a4e('0x2'));var rs=require(_0x3a4e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a4e('0x4'))['db'];var utils=require(_0x3a4e('0x5'));var logger=require(_0x3a4e('0x6'))('rpc');var config=require(_0x3a4e('0x7'));var jayson=require(_0x3a4e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea0e0,_0x39af53,_0x27e9e5){return new BPromise(function(_0x127cf0,_0x194d21){return client[_0x3a4e('0x9')](_0x4ea0e0,_0x27e9e5)[_0x3a4e('0xa')](function(_0x32200c){logger[_0x3a4e('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x39af53,_0x3a4e('0xc'));logger[_0x3a4e('0xd')](_0x3a4e('0xe'),_0x39af53,_0x3a4e('0xc'),JSON[_0x3a4e('0xf')](_0x32200c));if(_0x32200c[_0x3a4e('0x10')]){if(_0x32200c['error'][_0x3a4e('0x11')]===0x1f4){logger[_0x3a4e('0x10')](_0x3a4e('0x12'),_0x39af53,_0x32200c[_0x3a4e('0x10')][_0x3a4e('0x13')]);return _0x194d21(_0x32200c['error']['message']);}logger[_0x3a4e('0x10')](_0x3a4e('0x12'),_0x39af53,_0x32200c[_0x3a4e('0x10')][_0x3a4e('0x13')]);return _0x127cf0(_0x32200c[_0x3a4e('0x10')][_0x3a4e('0x13')]);}else{logger['info'](_0x3a4e('0x12'),_0x39af53,'request\x20sent');_0x127cf0(_0x32200c[_0x3a4e('0x14')][_0x3a4e('0x13')]);}})[_0x3a4e('0x15')](function(_0x5c8ceb){logger[_0x3a4e('0x10')](_0x3a4e('0x12'),_0x39af53,_0x5c8ceb);_0x194d21(_0x5c8ceb);});});}
\ No newline at end of file
+var _0xdc8e=['error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x7bff4f,_0x45ce80){var _0x3c6a26=function(_0x562f84){while(--_0x562f84){_0x7bff4f['push'](_0x7bff4f['shift']());}};_0x3c6a26(++_0x45ce80);}(_0xdc8e,0x107));var _0xedc8=function(_0x1bb6aa,_0x40fe82){_0x1bb6aa=_0x1bb6aa-0x0;var _0x2ef28e=_0xdc8e[_0x1bb6aa];return _0x2ef28e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xedc8('0x0'));var BPromise=require(_0xedc8('0x1'));var rs=require(_0xedc8('0x2'));var fs=require('fs');var Redis=require(_0xedc8('0x3'));var db=require(_0xedc8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xedc8('0x5'))('rpc');var config=require(_0xedc8('0x6'));var jayson=require(_0xedc8('0x7'));var client=jayson[_0xedc8('0x8')][_0xedc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x301278,_0x22fed0,_0x3aca3c){return new BPromise(function(_0x585c5f,_0x552326){return client[_0xedc8('0xa')](_0x301278,_0x3aca3c)[_0xedc8('0xb')](function(_0xdc7113){logger[_0xedc8('0xc')](_0xedc8('0xd'),_0x22fed0,'request\x20sent');logger[_0xedc8('0xe')](_0xedc8('0xf'),_0x22fed0,_0xedc8('0x10'),JSON['stringify'](_0xdc7113));if(_0xdc7113[_0xedc8('0x11')]){if(_0xdc7113[_0xedc8('0x11')]['code']===0x1f4){logger[_0xedc8('0x11')](_0xedc8('0xd'),_0x22fed0,_0xdc7113['error'][_0xedc8('0x12')]);return _0x552326(_0xdc7113[_0xedc8('0x11')]['message']);}logger[_0xedc8('0x11')](_0xedc8('0xd'),_0x22fed0,_0xdc7113[_0xedc8('0x11')][_0xedc8('0x12')]);return _0x585c5f(_0xdc7113[_0xedc8('0x11')][_0xedc8('0x12')]);}else{logger[_0xedc8('0xc')](_0xedc8('0xd'),_0x22fed0,_0xedc8('0x10'));_0x585c5f(_0xdc7113[_0xedc8('0x13')][_0xedc8('0x12')]);}})['catch'](function(_0x10e5aa){logger['error'](_0xedc8('0xd'),_0x22fed0,_0x10e5aa);_0x552326(_0x10e5aa);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index be68b54..9969a17 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 _0x7bc8=['destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete'];(function(_0x1dce89,_0x5cae59){var _0x5415b4=function(_0x3441b1){while(--_0x3441b1){_0x1dce89['push'](_0x1dce89['shift']());}};_0x5415b4(++_0x5cae59);}(_0x7bc8,0x92));var _0x87bc=function(_0x3bc0da,_0x81d03d){_0x3bc0da=_0x3bc0da-0x0;var _0x5a2547=_0x7bc8[_0x3bc0da];return _0x5a2547;};'use strict';var multer=require(_0x87bc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x87bc('0x1'));var express=require('express');var router=express[_0x87bc('0x2')]();var fs_extra=require(_0x87bc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x87bc('0x4'));var config=require(_0x87bc('0x5'));var controller=require(_0x87bc('0x6'));router[_0x87bc('0x7')]('/',auth[_0x87bc('0x8')](),controller[_0x87bc('0x9')]);router[_0x87bc('0x7')](_0x87bc('0xa'),auth[_0x87bc('0x8')](),controller[_0x87bc('0xb')]);router[_0x87bc('0x7')](_0x87bc('0xc'),auth[_0x87bc('0x8')](),controller['show']);router['post']('/',auth[_0x87bc('0x8')](),controller['create']);router[_0x87bc('0xd')](_0x87bc('0xc'),auth[_0x87bc('0x8')](),controller[_0x87bc('0xe')]);router[_0x87bc('0xf')](_0x87bc('0xc'),auth['isAuthenticated'](),controller[_0x87bc('0x10')]);module[_0x87bc('0x11')]=router;
\ No newline at end of file
+var _0x2931=['describe','get','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe'];(function(_0x51494f,_0x305632){var _0x303914=function(_0x50782a){while(--_0x50782a){_0x51494f['push'](_0x51494f['shift']());}};_0x303914(++_0x305632);}(_0x2931,0x171));var _0x1293=function(_0x119c52,_0x3e6189){_0x119c52=_0x119c52-0x0;var _0x547a4e=_0x2931[_0x119c52];return _0x547a4e;};'use strict';var multer=require('multer');var util=require(_0x1293('0x0'));var path=require(_0x1293('0x1'));var timeout=require(_0x1293('0x2'));var express=require(_0x1293('0x3'));var router=express[_0x1293('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1293('0x5'));var interaction=require(_0x1293('0x6'));var config=require(_0x1293('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x1293('0x8')](),controller[_0x1293('0x9')]);router['get'](_0x1293('0xa'),auth['isAuthenticated'](),controller[_0x1293('0xb')]);router[_0x1293('0xc')](_0x1293('0xd'),auth[_0x1293('0x8')](),controller[_0x1293('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1293('0xf')]);router[_0x1293('0x10')](_0x1293('0xd'),auth[_0x1293('0x8')](),controller['update']);router[_0x1293('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1293('0x12')]);module[_0x1293('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 8a7e7e4..7337ff0 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 _0x702d=['ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','name','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x702d,0x147));var _0xd702=function(_0x4be77c,_0x465d29){_0x4be77c=_0x4be77c-0x0;var _0x1ddbe0=_0x702d[_0x4be77c];return _0x1ddbe0;};'use strict';var Sequelize=require(_0xd702('0x0'));var rs=require(_0xd702('0x1'));module[_0xd702('0x2')]={'name':{'type':Sequelize[_0xd702('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd702('0x3')]},'mapKey':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xd702('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x5')},'customerAlias':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':_0xd702('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':_0xd702('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd702('0x3')]},'animation':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd702('0x9')](_0xd702('0xa'),_0xd702('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xc')},'start_chat_button':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xe')},'header_offline':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xf')},'download_transcript':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd702('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x13')},'placeholderMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xe')},'skipMessageButton':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x15')},'conditionAgreement':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0xd702('0x16'),_0xd702('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd702('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xd702('0x19'),'helpText':''}},{'type':_0xd702('0x1a'),'props':{'title':_0xd702('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xd702('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd702('0x1b')](_0xd702('0x1c'))?JSON[_0xd702('0x1d')](this[_0xd702('0x1b')](_0xd702('0x1c'))):{};},'set':function(_0x94c58d){return this[_0xd702('0x1e')](_0xd702('0x1c'),JSON['stringify'](_0x94c58d));}},'offlineForm':{'type':Sequelize[_0xd702('0x10')],'defaultValue':function(){return JSON[_0xd702('0x18')]({'items':[{'type':_0xd702('0x1a'),'props':{'title':_0xd702('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd702('0x4'),'type':_0xd702('0x4')},'variable':null},{'type':_0xd702('0x1f'),'config':{'placeholder':_0xd702('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xd702('0x1b')](_0xd702('0x21'))?JSON['parse'](this[_0xd702('0x1b')](_0xd702('0x21'))):{};},'set':function(_0xffdb54){return this[_0xd702('0x1e')]('offlineForm',JSON[_0xd702('0x18')](_0xffdb54));}},'token':{'type':Sequelize[_0xd702('0x3')],'defaultValue':function(){return rs[_0xd702('0x22')]();}},'autoclose':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd702('0x3')]},'forwardOffline':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd702('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x24')},'offlineMessageBody':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x15')},'sendUnmanaged':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd702('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd702('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd702('0x10')],'defaultValue':function(){return _0xd702('0x25');}},'notificationSound':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd702('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x27')},'verticalAlignment':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x28')},'defaultTitle':{'type':Sequelize[_0xd702('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd702('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x29')},'systemAvatar':{'type':Sequelize[_0xd702('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd702('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd702('0x2b'),'set':function(_0x239bec){if(!_0x239bec)this[_0xd702('0x1e')](_0xd702('0x2c'),null);this[_0xd702('0x1e')](_0xd702('0x2d'),_0x239bec);}},'vidaooEscalation':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd702('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd702('0x2e')},'vidaooNote':{'type':Sequelize[_0xd702('0x3')],'defaultValue':function(){return _0xd702('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xd702('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x6c76=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','name','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm'];(function(_0x2a9911,_0x36e22f){var _0x57d2a5=function(_0x5c564e){while(--_0x5c564e){_0x2a9911['push'](_0x2a9911['shift']());}};_0x57d2a5(++_0x36e22f);}(_0x6c76,0x184));var _0x66c7=function(_0x5058e0,_0x178c5a){_0x5058e0=_0x5058e0-0x0;var _0x5a863d=_0x6c76[_0x5058e0];return _0x5a863d;};'use strict';var Sequelize=require(_0x66c7('0x0'));var rs=require(_0x66c7('0x1'));module[_0x66c7('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x66c7('0x3')],'allowNull':![],'unique':_0x66c7('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x66c7('0x5')},'mapKeyOffline':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x66c7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x66c7('0x3')],'allowNull':![],'defaultValue':_0x66c7('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x66c7('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x66c7('0x3')],'allowNull':![],'defaultValue':_0x66c7('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x66c7('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x66c7('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x66c7('0x9')](_0x66c7('0xa'),_0x66c7('0xb')),'defaultValue':_0x66c7('0xa')},'header_online':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0xc')},'start_chat_button':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0xd')},'header_offline':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0xe')},'download_transcript':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x66c7('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x12')},'noteTitle':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x66c7('0x13')},'closingMessageButton':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x66c7('0x14')},'conditionAgreement':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x66c7('0x15')},'ratingType':{'type':Sequelize[_0x66c7('0x9')](_0x66c7('0x16'),_0x66c7('0x17')),'defaultValue':_0x66c7('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x66c7('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x66c7('0x18')]({'items':[{'type':_0x66c7('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x66c7('0x1a'),'required':!![]},'props':{'title':_0x66c7('0x1b'),'helpText':''}},{'type':_0x66c7('0x19'),'props':{'title':_0x66c7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x66c7('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x66c7('0x1c')]('onlineForm')?JSON[_0x66c7('0x1d')](this[_0x66c7('0x1c')](_0x66c7('0x1e'))):{};},'set':function(_0x2ef6a2){return this[_0x66c7('0x1f')]('onlineForm',JSON['stringify'](_0x2ef6a2));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x66c7('0x18')]({'items':[{'type':_0x66c7('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x66c7('0x5'),'type':_0x66c7('0x5')},'variable':null},{'type':_0x66c7('0x20'),'config':{'placeholder':_0x66c7('0x21')},'props':{'title':_0x66c7('0x21'),'helpText':_0x66c7('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x66c7('0x23'))?JSON[_0x66c7('0x1d')](this[_0x66c7('0x1c')](_0x66c7('0x23'))):{};},'set':function(_0x2042ea){return this['setDataValue'](_0x66c7('0x23'),JSON['stringify'](_0x2042ea));}},'token':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x66c7('0x3')]},'forwardOffline':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x66c7('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x25')},'offlineMessageBody':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x27')},'skipUnmanaged':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x14')},'sendUnmanaged':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x66c7('0x28')]},'showAgentAvatar':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x66c7('0x3')]},'notificationTemplate':{'type':Sequelize[_0x66c7('0x28')],'defaultValue':function(){return _0x66c7('0x29');}},'notificationSound':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x66c7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x2b')},'verticalAlignment':{'type':Sequelize[_0x66c7('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x2c')},'messagesAlignment':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x66c7('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x66c7('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x66c7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':_0x66c7('0x2e')},'systemAvatar':{'type':Sequelize[_0x66c7('0x28')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x66c7('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![],'comment':_0x66c7('0x30'),'set':function(_0x14d59c){if(!_0x14d59c)this[_0x66c7('0x1f')](_0x66c7('0x31'),null);this[_0x66c7('0x1f')](_0x66c7('0x32'),_0x14d59c);}},'vidaooEscalation':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x66c7('0x3')],'allowNull':![],'defaultValue':_0x66c7('0x33')},'vidaooNote':{'type':Sequelize[_0x66c7('0x3')],'defaultValue':function(){return _0x66c7('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x66c7('0x28')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x66c7('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x66c7('0x28')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index e0c0224..2db93eb 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 _0xa70f=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Applications','account','applications','list','orderBy','asc','Contacts','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','externalUrl','interaction','ChatInteraction','spread','messageId','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','EventManager','notify','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','toPairsIn','mapValues','subjectOffline','email','Chat','MailAccountId','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','stringify','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','color_button','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','../../mysqldb','defaults','redis','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','update','then','destroy','get','sendStatus','name','send','index','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','show','Pause','mandatoryDispositionPause','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','findAll','removeDispositions','ids','getAnswers','findOne','CannedAnswer','nolimit','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','file','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from'];(function(_0x4b2d64,_0x202ded){var _0x16b037=function(_0x111fa2){while(--_0x111fa2){_0x4b2d64['push'](_0x4b2d64['shift']());}};_0x16b037(++_0x202ded);}(_0xa70f,0xa6));var _0xfa70=function(_0x1cddf6,_0x27b840){_0x1cddf6=_0x1cddf6-0x0;var _0x54ee23=_0xa70f[_0x1cddf6];return _0x54ee23;};'use strict';var BPromise=require(_0xfa70('0x0'));var Mustache=require(_0xfa70('0x1'));var util=require('util');var path=require(_0xfa70('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa70('0x3'));var _=require(_0xfa70('0x4'));var querystring=require('querystring');var Redis=require(_0xfa70('0x5'));var qs=require(_0xfa70('0x6'));var logger=require(_0xfa70('0x7'))('api');var config=require(_0xfa70('0x8'));var url=require(_0xfa70('0x9'));var db=require(_0xfa70('0xa'))['db'];config['redis']=_[_0xfa70('0xb')](config[_0xfa70('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa70('0xc')]));require(_0xfa70('0xd'))[_0xfa70('0xe')](socket);var htmlToText=require(_0xfa70('0xf'));var jayson=require(_0xfa70('0x10'));var client=jayson[_0xfa70('0x11')][_0xfa70('0x12')]({'port':0x232c});var client9002=jayson[_0xfa70('0x11')][_0xfa70('0x12')]({'port':0x232a});var client9003=jayson['client'][_0xfa70('0x12')]({'port':0x232b});var client9001=jayson[_0xfa70('0x11')][_0xfa70('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x4bf1c8,_0x929163,_0x3f8f61,_0x430401){return new BPromise(function(_0x185029,_0x50bcb2){var _0x57a8dc=_0x430401||client;return _0x57a8dc['request'](_0x4bf1c8,_0x3f8f61)['then'](function(_0x58da67){logger[_0xfa70('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x929163,_0xfa70('0x14'));logger[_0xfa70('0x15')](_0xfa70('0x16'),_0x929163,_0xfa70('0x14'),JSON['stringify'](_0x58da67));if(_0x58da67[_0xfa70('0x17')]){if(_0x58da67['error'][_0xfa70('0x18')]===0x1f4){logger[_0xfa70('0x17')](_0xfa70('0x19'),_0x929163,_0x58da67['error'][_0xfa70('0x1a')]);return _0x50bcb2(_0x58da67[_0xfa70('0x17')]['message']);}logger[_0xfa70('0x17')](_0xfa70('0x19'),_0x929163,_0x58da67[_0xfa70('0x17')][_0xfa70('0x1a')]);return _0x185029(_0x58da67[_0xfa70('0x17')][_0xfa70('0x1a')]);}else{logger['info'](_0xfa70('0x19'),_0x929163,_0xfa70('0x14'));_0x185029(_0x58da67[_0xfa70('0x1b')][_0xfa70('0x1a')]);}})[_0xfa70('0x1c')](function(_0x3544ac){logger[_0xfa70('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x929163,_0x3544ac);_0x50bcb2(_0x3544ac);});});}function respondWithStatusCode(_0x2998ed,_0x3b4196){_0x3b4196=_0x3b4196||0xcc;return function(_0x58d56d){if(_0x58d56d){return _0x2998ed['sendStatus'](_0x3b4196);}return _0x2998ed[_0xfa70('0x1d')](_0x3b4196)[_0xfa70('0x1e')]();};}function respondWithResult(_0x2b56bc,_0x78c835){_0x78c835=_0x78c835||0xc8;return function(_0x46f8c1){if(_0x46f8c1){return _0x2b56bc[_0xfa70('0x1d')](_0x78c835)[_0xfa70('0x1f')](_0x46f8c1);}};}function respondWithFilteredResult(_0x19d1f5,_0x25307f){return function(_0x11ccac){if(_0x11ccac){var _0x46a54b=typeof _0x25307f[_0xfa70('0x20')]===_0xfa70('0x21')&&typeof _0x25307f[_0xfa70('0x22')]===_0xfa70('0x21');var _0x113ece=_0x11ccac[_0xfa70('0x23')];var _0x414f9a=_0x46a54b?0x0:_0x25307f[_0xfa70('0x20')];var _0x48b443=_0x46a54b?_0x11ccac[_0xfa70('0x23')]:_0x25307f[_0xfa70('0x20')]+_0x25307f[_0xfa70('0x22')];var _0x103fd2;if(_0x48b443>=_0x113ece){_0x48b443=_0x113ece;_0x103fd2=0xc8;}else{_0x103fd2=0xce;}_0x19d1f5['status'](_0x103fd2);return _0x19d1f5[_0xfa70('0x24')]('Content-Range',_0x414f9a+'-'+_0x48b443+'/'+_0x113ece)[_0xfa70('0x1f')](_0x11ccac);}return null;};}function saveUpdates(_0x13f95c){return function(_0x3c7eef){if(_0x3c7eef){return _0x3c7eef[_0xfa70('0x25')](_0x13f95c)[_0xfa70('0x26')](function(_0x37550e){return _0x37550e;});}return null;};}function removeEntity(_0x48cc89){return function(_0x59eeb6){if(_0x59eeb6){return _0x59eeb6[_0xfa70('0x27')]()[_0xfa70('0x26')](function(){var _0x202443=_0x59eeb6[_0xfa70('0x28')]({'plain':!![]});var _0x5beb2b='ChatWebsites';return db['UserProfileResource']['destroy']({'where':{'type':_0x5beb2b,'resourceId':_0x202443['id']}})[_0xfa70('0x26')](function(){return _0x59eeb6;});})[_0xfa70('0x26')](function(){_0x48cc89[_0xfa70('0x1d')](0xcc)[_0xfa70('0x1e')]();});}};}function handleEntityNotFound(_0x5d9a72){return function(_0x3286d3){if(!_0x3286d3){_0x5d9a72[_0xfa70('0x29')](0x194);}return _0x3286d3;};}function handleError(_0x288ebc,_0x4b03f3){_0x4b03f3=_0x4b03f3||0x1f4;return function(_0x950669){logger[_0xfa70('0x17')](_0x950669['stack']);if(_0x950669[_0xfa70('0x2a')]){delete _0x950669[_0xfa70('0x2a')];}_0x288ebc[_0xfa70('0x1d')](_0x4b03f3)[_0xfa70('0x2b')](_0x950669);};}exports[_0xfa70('0x2c')]=function(_0x2fb66f,_0x536d5f){var _0x50d89e={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5387f3={},_0x112306={'count':0x0,'rows':[]};var _0x19d3d7=_[_0xfa70('0x2d')](db[_0xfa70('0x2e')][_0xfa70('0x2f')],function(_0x964668){return{'name':_0x964668[_0xfa70('0x30')],'type':_0x964668['type'][_0xfa70('0x31')]};});_0x5387f3[_0xfa70('0x32')]=_[_0xfa70('0x2d')](_0x19d3d7,_0xfa70('0x2a'));_0x5387f3[_0xfa70('0x33')]=_[_0xfa70('0x34')](_0x2fb66f[_0xfa70('0x33')]);_0x5387f3['filters']=_[_0xfa70('0x35')](_0x5387f3[_0xfa70('0x32')],_0x5387f3[_0xfa70('0x33')]);_0x50d89e['attributes']=_[_0xfa70('0x35')](_0x5387f3[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x36')]));_0x50d89e[_0xfa70('0x37')]=_0x50d89e[_0xfa70('0x37')][_0xfa70('0x38')]?_0x50d89e[_0xfa70('0x37')]:_0x5387f3[_0xfa70('0x32')];if(!_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x39')]('nolimit')){_0x50d89e[_0xfa70('0x22')]=qs['limit'](_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x22')]);_0x50d89e[_0xfa70('0x20')]=qs['offset'](_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x20')]);}_0x50d89e[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x2fb66f[_0xfa70('0x33')]['sort']);_0x50d89e[_0xfa70('0x3c')]=qs['filters'](_[_0xfa70('0x3d')](_0x2fb66f[_0xfa70('0x33')],_0x5387f3[_0xfa70('0x3e')]),_0x19d3d7);if(_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x3f')]){_0x50d89e[_0xfa70('0x3c')]=_[_0xfa70('0x40')](_0x50d89e[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x19d3d7,function(_0x481293){if(_0x481293['type']!==_0xfa70('0x41')){var _0x5dea56={};_0x5dea56[_0x481293['name']]={'$like':'%'+_0x2fb66f['query'][_0xfa70('0x3f')]+'%'};return _0x5dea56;}})});}_0x50d89e=_['merge']({},_0x50d89e,_0x2fb66f[_0xfa70('0x42')]);var _0x88ae20={'where':_0x50d89e[_0xfa70('0x3c')]};return db[_0xfa70('0x2e')][_0xfa70('0x23')](_0x88ae20)[_0xfa70('0x26')](function(_0x4de4fa){_0x112306[_0xfa70('0x23')]=_0x4de4fa;if(_0x2fb66f[_0xfa70('0x33')]['includeAll']){_0x50d89e[_0xfa70('0x43')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x50d89e);})[_0xfa70('0x26')](function(_0x14392a){_0x112306[_0xfa70('0x44')]=_0x14392a;return _0x112306;})[_0xfa70('0x26')](respondWithFilteredResult(_0x536d5f,_0x50d89e))[_0xfa70('0x1c')](handleError(_0x536d5f,null));};exports[_0xfa70('0x45')]=function(_0xd533a9,_0x27ff75){var _0x2a88d0={'raw':![],'where':{'id':_0xd533a9['params']['id']},'include':[{'model':db[_0xfa70('0x46')],'as':_0xfa70('0x47')}]},_0x325e1b={};_0x325e1b[_0xfa70('0x32')]=_[_0xfa70('0x34')](db['ChatWebsite'][_0xfa70('0x2f')]);_0x325e1b['query']=_[_0xfa70('0x34')](_0xd533a9['query']);_0x325e1b[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x325e1b[_0xfa70('0x32')],_0x325e1b[_0xfa70('0x33')]);_0x2a88d0[_0xfa70('0x37')]=_['intersection'](_0x325e1b['model'],qs[_0xfa70('0x36')](_0xd533a9['query'][_0xfa70('0x36')]));_0x2a88d0[_0xfa70('0x37')]=_0x2a88d0['attributes'][_0xfa70('0x38')]?_0x2a88d0[_0xfa70('0x37')]:_0x325e1b[_0xfa70('0x32')];if(_0xd533a9[_0xfa70('0x33')][_0xfa70('0x48')]){_0x2a88d0[_0xfa70('0x43')]=[{'all':!![]}];}_0x2a88d0=_[_0xfa70('0x40')]({},_0x2a88d0,_0xd533a9[_0xfa70('0x42')]);return db[_0xfa70('0x2e')][_0xfa70('0x49')](_0x2a88d0)[_0xfa70('0x26')](handleEntityNotFound(_0x27ff75,null))[_0xfa70('0x26')](respondWithResult(_0x27ff75,null))[_0xfa70('0x1c')](handleError(_0x27ff75,null));};exports['create']=function(_0x3ec32b,_0x58ca02){return db[_0xfa70('0x2e')][_0xfa70('0x4a')](_0x3ec32b[_0xfa70('0x4b')],{})['then'](function(_0x215627){var _0x1ce21e=_0x3ec32b[_0xfa70('0x4c')]['get']({'plain':!![]});if(!_0x1ce21e)throw new Error(_0xfa70('0x4d'));if(_0x1ce21e[_0xfa70('0x4e')]===_0xfa70('0x4c')){var _0x15765f=_0x215627[_0xfa70('0x28')]({'plain':!![]});var _0x18a8e1=_0xfa70('0x4f');return db[_0xfa70('0x50')][_0xfa70('0x49')]({'where':{'name':_0x18a8e1,'userProfileId':_0x1ce21e[_0xfa70('0x51')]},'raw':!![]})[_0xfa70('0x26')](function(_0x4b9a84){if(_0x4b9a84&&_0x4b9a84['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x15765f[_0xfa70('0x2a')],'resourceId':_0x15765f['id'],'type':_0x4b9a84['name'],'sectionId':_0x4b9a84['id']},{})['then'](function(){return _0x215627;});}else{return _0x215627;}})[_0xfa70('0x1c')](function(_0x117e19){logger[_0xfa70('0x17')](_0xfa70('0x52'),_0x117e19);throw _0x117e19;});}return _0x215627;})[_0xfa70('0x26')](respondWithResult(_0x58ca02,0xc9))[_0xfa70('0x1c')](handleError(_0x58ca02,null));};exports[_0xfa70('0x25')]=function(_0xc0ccee,_0x969ed1){if(_0xc0ccee['body']['id']){delete _0xc0ccee[_0xfa70('0x4b')]['id'];}return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0xc0ccee['params']['id']},'include':[{'model':db[_0xfa70('0x46')],'as':'mandatoryDispositionPause'}]})[_0xfa70('0x26')](handleEntityNotFound(_0x969ed1,null))['then'](saveUpdates(_0xc0ccee[_0xfa70('0x4b')],null))['then'](respondWithResult(_0x969ed1,null))['catch'](handleError(_0x969ed1,null));};exports[_0xfa70('0x27')]=function(_0x3dfc85,_0x1848d8){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x3dfc85[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x1848d8,null))[_0xfa70('0x26')](removeEntity(_0x1848d8,null))[_0xfa70('0x1c')](handleError(_0x1848d8,null));};exports[_0xfa70('0x54')]=function(_0x182f58,_0x796bf9){return db[_0xfa70('0x2e')]['describe']()[_0xfa70('0x26')](respondWithResult(_0x796bf9,null))[_0xfa70('0x1c')](handleError(_0x796bf9,null));};exports[_0xfa70('0x55')]=function(_0x44308e,_0xa8a502){if(_0x44308e[_0xfa70('0x4b')]['id']){delete _0x44308e['body']['id'];}return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x44308e['params']['id']}})['then'](handleEntityNotFound(_0xa8a502,null))[_0xfa70('0x26')](function(_0x5f35e7){if(_0x5f35e7){_0x44308e['body'][_0xfa70('0x56')]=_0x5f35e7['id'];return db['Disposition'][_0xfa70('0x4a')](_0x44308e[_0xfa70('0x4b')]);}})[_0xfa70('0x26')](respondWithResult(_0xa8a502,null))['catch'](handleError(_0xa8a502,null));};exports[_0xfa70('0x57')]=function(_0x2854c0,_0x5ba27e){var _0x315713={'raw':![],'where':{}};var _0x256f1d={};var _0x51dc0e={'count':0x0,'rows':[]};return db[_0xfa70('0x2e')]['findOne']({'where':{'id':_0x2854c0[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5ba27e,null))[_0xfa70('0x26')](function(_0x2c9a66){if(_0x2c9a66){_0x256f1d[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0x58')][_0xfa70('0x2f')]);_0x256f1d[_0xfa70('0x33')]=_[_0xfa70('0x34')](_0x2854c0['query']);_0x256f1d[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x256f1d[_0xfa70('0x32')],_0x256f1d[_0xfa70('0x33')]);_0x315713[_0xfa70('0x37')]=_['intersection'](_0x256f1d[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x2854c0[_0xfa70('0x33')][_0xfa70('0x36')]));_0x315713[_0xfa70('0x37')]=_0x315713['attributes'][_0xfa70('0x38')]?_0x315713[_0xfa70('0x37')]:_0x256f1d[_0xfa70('0x32')];if(!_0x2854c0['query'][_0xfa70('0x39')]('nolimit')){_0x315713['limit']=qs[_0xfa70('0x22')](_0x2854c0[_0xfa70('0x33')][_0xfa70('0x22')]);_0x315713['offset']=qs[_0xfa70('0x20')](_0x2854c0[_0xfa70('0x33')]['offset']);}_0x315713[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x2854c0[_0xfa70('0x33')]['sort']);_0x315713[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_['pick'](_0x2854c0['query'],_0x256f1d['filters']));_0x315713['where']['ChatWebsiteId']=_0x2c9a66['id'];if(_0x2854c0[_0xfa70('0x33')]['filter']){_0x315713[_0xfa70('0x3c')]=_['merge'](_0x315713[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x315713[_0xfa70('0x37')],function(_0x51711e){var _0x1e2164={};_0x1e2164[_0x51711e]={'$like':'%'+_0x2854c0[_0xfa70('0x33')]['filter']+'%'};return _0x1e2164;})});}_0x315713=_[_0xfa70('0x40')]({},_0x315713,_0x2854c0[_0xfa70('0x42')]);return db['Disposition'][_0xfa70('0x23')]({'where':_0x315713['where']})[_0xfa70('0x26')](function(_0x2042e4){_0x51dc0e[_0xfa70('0x23')]=_0x2042e4;if(_0x2854c0[_0xfa70('0x33')][_0xfa70('0x48')]){_0x315713['include']=[{'all':!![]}];}return db[_0xfa70('0x58')][_0xfa70('0x59')](_0x315713);})[_0xfa70('0x26')](function(_0x2cdfb5){_0x51dc0e[_0xfa70('0x44')]=_0x2cdfb5;return _0x51dc0e;});}})[_0xfa70('0x26')](respondWithFilteredResult(_0x5ba27e,_0x315713))['catch'](handleError(_0x5ba27e,null));};exports['removeDispositions']=function(_0x5d7620,_0x4f78b6){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x5d7620[_0xfa70('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f78b6,null))[_0xfa70('0x26')](function(_0x125082){if(_0x125082){return _0x125082[_0xfa70('0x5a')](_0x5d7620[_0xfa70('0x33')][_0xfa70('0x5b')]);}})[_0xfa70('0x26')](respondWithStatusCode(_0x4f78b6,null))[_0xfa70('0x1c')](handleError(_0x4f78b6,null));};exports['addAnswer']=function(_0x4f98b7,_0x40b4b6){if(_0x4f98b7['body']['id']){delete _0x4f98b7[_0xfa70('0x4b')]['id'];}return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x4f98b7[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x40b4b6,null))[_0xfa70('0x26')](function(_0x596d1b){if(_0x596d1b){_0x4f98b7[_0xfa70('0x4b')][_0xfa70('0x56')]=_0x596d1b['id'];return db['CannedAnswer'][_0xfa70('0x4a')](_0x4f98b7['body']);}})[_0xfa70('0x26')](respondWithResult(_0x40b4b6,null))[_0xfa70('0x1c')](handleError(_0x40b4b6,null));};exports[_0xfa70('0x5c')]=function(_0x49dca1,_0x3619c5){var _0x483e67={'raw':![],'where':{}};var _0x4bb3f1={};var _0x3732d5={'count':0x0,'rows':[]};return db[_0xfa70('0x2e')][_0xfa70('0x5d')]({'where':{'id':_0x49dca1[_0xfa70('0x53')]['id']}})['then'](handleEntityNotFound(_0x3619c5,null))[_0xfa70('0x26')](function(_0x45bd75){if(_0x45bd75){_0x4bb3f1[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0x5e')]['rawAttributes']);_0x4bb3f1[_0xfa70('0x33')]=_['keys'](_0x49dca1[_0xfa70('0x33')]);_0x4bb3f1[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x4bb3f1[_0xfa70('0x32')],_0x4bb3f1[_0xfa70('0x33')]);_0x483e67['attributes']=_[_0xfa70('0x35')](_0x4bb3f1['model'],qs[_0xfa70('0x36')](_0x49dca1[_0xfa70('0x33')][_0xfa70('0x36')]));_0x483e67[_0xfa70('0x37')]=_0x483e67[_0xfa70('0x37')][_0xfa70('0x38')]?_0x483e67[_0xfa70('0x37')]:_0x4bb3f1[_0xfa70('0x32')];if(!_0x49dca1['query']['hasOwnProperty'](_0xfa70('0x5f'))){_0x483e67[_0xfa70('0x22')]=qs[_0xfa70('0x22')](_0x49dca1[_0xfa70('0x33')][_0xfa70('0x22')]);_0x483e67['offset']=qs[_0xfa70('0x20')](_0x49dca1['query'][_0xfa70('0x20')]);}_0x483e67[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x49dca1[_0xfa70('0x33')]['sort']);_0x483e67['where']=qs[_0xfa70('0x3e')](_[_0xfa70('0x3d')](_0x49dca1[_0xfa70('0x33')],_0x4bb3f1['filters']));_0x483e67[_0xfa70('0x3c')][_0xfa70('0x56')]=_0x45bd75['id'];if(_0x49dca1[_0xfa70('0x33')][_0xfa70('0x3f')]){_0x483e67[_0xfa70('0x3c')]=_[_0xfa70('0x40')](_0x483e67[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x483e67[_0xfa70('0x37')],function(_0x47f56d){var _0x5d3361={};_0x5d3361[_0x47f56d]={'$like':'%'+_0x49dca1[_0xfa70('0x33')]['filter']+'%'};return _0x5d3361;})});}_0x483e67=_[_0xfa70('0x40')]({},_0x483e67,_0x49dca1[_0xfa70('0x42')]);return db['CannedAnswer']['count']({'where':_0x483e67['where']})[_0xfa70('0x26')](function(_0x2e9e47){_0x3732d5[_0xfa70('0x23')]=_0x2e9e47;if(_0x49dca1[_0xfa70('0x33')][_0xfa70('0x48')]){_0x483e67[_0xfa70('0x43')]=[{'all':!![]}];}return db[_0xfa70('0x5e')][_0xfa70('0x59')](_0x483e67);})[_0xfa70('0x26')](function(_0x207b27){_0x3732d5[_0xfa70('0x44')]=_0x207b27;return _0x3732d5;});}})[_0xfa70('0x26')](respondWithFilteredResult(_0x3619c5,_0x483e67))[_0xfa70('0x1c')](handleError(_0x3619c5,null));};exports[_0xfa70('0x60')]=function(_0x5524e2,_0x46a48c){return db[_0xfa70('0x2e')]['find']({'where':{'id':_0x5524e2['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x46a48c,null))[_0xfa70('0x26')](function(_0x3b6b9a){if(_0x3b6b9a){return _0x3b6b9a[_0xfa70('0x60')](_0x5524e2[_0xfa70('0x33')][_0xfa70('0x5b')]);}})[_0xfa70('0x26')](respondWithStatusCode(_0x46a48c,null))[_0xfa70('0x1c')](handleError(_0x46a48c,null));};exports[_0xfa70('0x61')]=function(_0x4aa72b,_0x37b35f){_0x4aa72b[_0xfa70('0x4b')][_0xfa70('0x62')]=_0x4aa72b['file'][_0xfa70('0x63')];return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x4aa72b['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x37b35f,null))['then'](saveUpdates(_0x4aa72b[_0xfa70('0x4b')],null))[_0xfa70('0x26')](respondWithResult(_0x37b35f,null))[_0xfa70('0x1c')](handleError(_0x37b35f,null));};exports[_0xfa70('0x64')]=function(_0x16136d,_0x3625b9){_0x16136d[_0xfa70('0x4b')][_0xfa70('0x65')]=_0x16136d['file'][_0xfa70('0x63')];return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x16136d[_0xfa70('0x53')]['id']}})['then'](handleEntityNotFound(_0x3625b9,null))['then'](saveUpdates(_0x16136d['body'],null))[_0xfa70('0x26')](respondWithResult(_0x3625b9,null))[_0xfa70('0x1c')](handleError(_0x3625b9,null));};exports[_0xfa70('0x66')]=function(_0x4cadf0,_0x93a349){_0x4cadf0[_0xfa70('0x4b')][_0xfa70('0x67')]=_0x4cadf0[_0xfa70('0x68')][_0xfa70('0x63')];return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x4cadf0[_0xfa70('0x53')]['id']}})['then'](handleEntityNotFound(_0x93a349,null))['then'](saveUpdates(_0x4cadf0[_0xfa70('0x4b')],null))[_0xfa70('0x26')](respondWithResult(_0x93a349,null))['catch'](handleError(_0x93a349,null));};exports[_0xfa70('0x69')]=function(_0x2ff938,_0x2d3ef3){_0x2ff938['body']['systemAvatar']=_0x2ff938[_0xfa70('0x68')][_0xfa70('0x63')];return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x2ff938[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x2d3ef3,null))[_0xfa70('0x26')](saveUpdates(_0x2ff938[_0xfa70('0x4b')],null))[_0xfa70('0x26')](respondWithResult(_0x2d3ef3,null))['catch'](handleError(_0x2d3ef3,null));};exports['getLogo']=function(_0x237ce4,_0x497945){var _0x178143=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x6c'));var _0xdc557f={'where':{'id':_0x237ce4['params']['id']},'attributes':['id',_0xfa70('0x62')],'raw':!![]};var _0x468041=![];return require(_0xfa70('0x6d'))['getLicense']()[_0xfa70('0x26')](function(_0xb3567d){if(_0xb3567d){_0x468041=_0xb3567d[_0xfa70('0x6e')];}})[_0xfa70('0x26')](function(){return db[_0xfa70('0x2e')]['find'](_0xdc557f);})['then'](handleEntityNotFound(_0x497945,null))[_0xfa70('0x26')](function(_0x101d61){if(_0x101d61){if(!_['isNil'](_0x101d61['sitepic'])){if(fs[_0xfa70('0x6f')](path[_0xfa70('0x6a')](config['root'],_0xfa70('0x70'),_0x101d61[_0xfa70('0x62')]))&&_0x468041){_0x178143=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x70'),_0x101d61[_0xfa70('0x62')]);}}return _0x497945[_0xfa70('0x71')](_0x178143);}})[_0xfa70('0x1c')](handleError(_0x497945,null));};exports[_0xfa70('0x72')]=function(_0x394f15,_0x2c0c7c){var _0x2da734=path[_0xfa70('0x6a')](config['root'],_0xfa70('0x73'));var _0x4e146b={'where':{'id':_0x394f15[_0xfa70('0x53')]['id']},'attributes':['id',_0xfa70('0x65')],'raw':!![]};return db[_0xfa70('0x2e')][_0xfa70('0x49')](_0x4e146b)[_0xfa70('0x26')](handleEntityNotFound(_0x2c0c7c,null))[_0xfa70('0x26')](function(_0x701ef9){if(_0x701ef9){if(!_[_0xfa70('0x74')](_0x701ef9[_0xfa70('0x65')])){if(fs[_0xfa70('0x6f')](path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x75'),_0x701ef9['agentAvatar']))){_0x2da734=path[_0xfa70('0x6a')](config['root'],'server/files/images/avatars/',_0x701ef9[_0xfa70('0x65')]);}}return _0x2c0c7c['download'](_0x2da734);}})[_0xfa70('0x1c')](handleError(_0x2c0c7c,null));};exports[_0xfa70('0x76')]=function(_0x356342,_0x5ea107){var _0x59fcc4=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x77'));var _0x3123d7={'where':{'id':_0x356342[_0xfa70('0x53')]['id']},'attributes':['id',_0xfa70('0x67'),_0xfa70('0x78')],'raw':!![]};return db[_0xfa70('0x2e')][_0xfa70('0x49')](_0x3123d7)[_0xfa70('0x26')](handleEntityNotFound(_0x5ea107,null))[_0xfa70('0x26')](function(_0x3fc015){if(_0x3fc015){if(!_[_0xfa70('0x74')](_0x3fc015[_0xfa70('0x67')])){if(fs[_0xfa70('0x6f')](path['join'](config[_0xfa70('0x6b')],_0xfa70('0x75'),_0x3fc015[_0xfa70('0x67')]))&&_0x3fc015[_0xfa70('0x78')]){_0x59fcc4=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],'server/files/images/avatars/',_0x3fc015[_0xfa70('0x67')]);}}return _0x5ea107['download'](_0x59fcc4);}})['catch'](handleError(_0x5ea107,null));};exports[_0xfa70('0x79')]=function(_0x3a8477,_0x5f4f89){var _0x568a4b=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x7a'));var _0x580d3b={'where':{'id':_0x3a8477[_0xfa70('0x53')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xfa70('0x2e')][_0xfa70('0x49')](_0x580d3b)[_0xfa70('0x26')](handleEntityNotFound(_0x5f4f89,null))[_0xfa70('0x26')](function(_0x5403cd){if(_0x5403cd){if(!_[_0xfa70('0x74')](_0x5403cd[_0xfa70('0x7b')])){if(fs['existsSync'](path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x75'),_0x5403cd[_0xfa70('0x7b')]))){_0x568a4b=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],'server/files/images/avatars/',_0x5403cd[_0xfa70('0x7b')]);}}return _0x5f4f89[_0xfa70('0x71')](_0x568a4b);}})[_0xfa70('0x1c')](handleError(_0x5f4f89,null));};exports['notify']=function(_0x4d1789,_0x475e49){var _0xb589=require(_0xfa70('0x7c'));var _0x58bd7b=new _0xb589();var _0x2faa7d=_0x58bd7b[_0xfa70('0x7d')](_0x4d1789[_0xfa70('0x7e')][_0xfa70('0x7f')])[_0xfa70('0x80')]();var _0x3f6c27={'body':_0x4d1789[_0xfa70('0x4b')],'channel':_0xfa70('0x81')};var _0x2872a4=[];var _0x75b8db=[];var _0x28c0fb={};var _0x510350=![];return db[_0xfa70('0x82')][_0xfa70('0x54')]()[_0xfa70('0x26')](function(_0x421a7a){if(!_0x421a7a){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0x85'));}_0x2872a4=_['difference'](_[_0xfa70('0x34')](_0x421a7a),[_0xfa70('0x86'),_0xfa70('0x87')]);_0x75b8db=_[_0xfa70('0x88')](_[_0xfa70('0x34')](_0x421a7a),[_0xfa70('0x86'),'updatedAt',_0xfa70('0x89'),_0xfa70('0x8a')]);if(_0x4d1789[_0xfa70('0x4b')]['id']){delete _0x4d1789['body']['id'];}if(_['isNil'](_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8b')])){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))]('from\x20is\x20mandatory');}if(_[_0xfa70('0x74')](_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x4b')])||_0x4d1789['body'][_0xfa70('0x4b')]===''){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0x8c'));}if(_[_0xfa70('0x74')](_0x4d1789['body'][_0xfa70('0x8d')])){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x75b8db);}if(!_[_0xfa70('0x8e')](_0x75b8db,_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8d')])){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0x8f')+_0x75b8db);}_0x28c0fb[_0x4d1789[_0xfa70('0x4b')]['mapKey']]=_0x4d1789[_0xfa70('0x4b')]['from'];})[_0xfa70('0x26')](function(){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x4d1789['params']['id']},'include':[{'model':db[_0xfa70('0x90')],'as':_0xfa70('0x91'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x28c0fb,'limit':0x1,'order':[[_0xfa70('0x87'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xfa70('0x92')}]});})['then'](handleEntityNotFound(_0x475e49,null))[_0xfa70('0x26')](function(_0x326883){if(_0x326883&&_0x326883[_0xfa70('0x91')]){_0x3f6c27[_0xfa70('0x93')]=_0x326883;_0x3f6c27[_0xfa70('0x94')]=_0x326883['Applications'];_0x3f6c27[_0xfa70('0x95')]=_0x326883[_0xfa70('0x91')];_0x3f6c27[_0xfa70('0x94')]=_[_0xfa70('0x96')](_0x3f6c27[_0xfa70('0x94')],['priority'],[_0xfa70('0x97')]);if(_0x3f6c27['account'][_0xfa70('0x92')]){delete _0x3f6c27['account'][_0xfa70('0x92')];}if(_0x3f6c27[_0xfa70('0x93')]['List']&&_0x3f6c27[_0xfa70('0x93')][_0xfa70('0x91')][_0xfa70('0x98')][_0xfa70('0x38')]){return _0x3f6c27[_0xfa70('0x93')]['List'][_0xfa70('0x98')][0x0];}var _0x29e438=_[_0xfa70('0xb')](_0x4d1789[_0xfa70('0x4b')],{'firstName':_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8b')],'ListId':_0x326883['ListId']});_0x29e438[_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8d')]]=_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8b')];return db[_0xfa70('0x82')][_0xfa70('0x4a')](_0x29e438,{'fields':_0x2872a4,'raw':!![]});}})[_0xfa70('0x26')](handleEntityNotFound(_0x475e49,null))[_0xfa70('0x26')](function(_0x590cd0){_0x3f6c27[_0xfa70('0x99')]=_0x590cd0;var _0x43c826=_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x9a')];if(_0x4d1789[_0xfa70('0x7e')][_0xfa70('0x9b')]){_0x43c826=_0x4d1789[_0xfa70('0x7e')][_0xfa70('0x9b')];}else if(_0x4d1789['headers']['x-forwarded-for']){_0x43c826=_[_0xfa70('0x9c')](_0x4d1789[_0xfa70('0x7e')][_0xfa70('0x9d')][_0xfa70('0x9e')](','));}if(_0x590cd0){var _0x27fcc6={'ContactId':_0x590cd0['id'],'ChatWebsiteId':_0x4d1789['params']['id'],'from':(_0x590cd0[_0xfa70('0x9f')]||'')+'\x20'+(_0x590cd0[_0xfa70('0xa0')]||''),'customerIp':_0x43c826,'customerPort':_0x4d1789[_0xfa70('0x7e')][_0xfa70('0xa1')]?_0x4d1789['headers'][_0xfa70('0xa1')]:null,'referer':_0x4d1789['body'][_0xfa70('0xa2')],'browserName':_0x2faa7d['browser']['name']&&_0x2faa7d[_0xfa70('0xa3')][_0xfa70('0xa4')]?util[_0xfa70('0xa5')](_0xfa70('0xa6'),_0x2faa7d[_0xfa70('0xa3')][_0xfa70('0x2a')],_0x2faa7d[_0xfa70('0xa3')][_0xfa70('0xa4')]):_0xfa70('0xa7'),'browserVersion':_0x2faa7d[_0xfa70('0xa3')][_0xfa70('0xa4')]||_0xfa70('0xa7'),'osName':util['format'](_0xfa70('0xa6'),_0x2faa7d['os'][_0xfa70('0x2a')],_0x2faa7d['os'][_0xfa70('0xa4')]),'osVersion':_0x2faa7d['os'][_0xfa70('0xa4')],'deviceModel':_0x2faa7d[_0xfa70('0xa8')]['model']&&_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xa9')]?util[_0xfa70('0xa5')](_0xfa70('0xaa'),_0x2faa7d['device']['model'],_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xa9')],_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xab')]):null,'deviceVendor':_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xa9')],'deviceType':_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xab')],'formData':JSON['stringify'](_0x4d1789[_0xfa70('0x4b')])};var _0x2ef4b1={'ChatWebsiteId':_0x4d1789[_0xfa70('0x53')]['id'],'closed':![]};if(_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xac')]){_0x2ef4b1[_0xfa70('0xac')]=_0x4d1789['body']['threadId'];return db['ChatInteraction'][_0xfa70('0x49')]({'where':_0x2ef4b1})[_0xfa70('0x26')](function(_0x5e33f2){if(_0x5e33f2){return[_0x5e33f2,![]];}_0x27fcc6[_0xfa70('0xac')]=_0x4d1789['body']['threadId'];_0x27fcc6[_0xfa70('0xad')]=_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xad')];return db['ChatInteraction'][_0xfa70('0x4a')](_0x27fcc6)[_0xfa70('0x26')](function(_0xc3c3b8){return[_0xc3c3b8,!![]];});});}_0x2ef4b1['ContactId']=_0x590cd0['id'];if(_0x4d1789['body'][_0xfa70('0xae')]&&_0x4d1789['body']['interaction']['id']){_0x2ef4b1['id']=_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xae')]['id'];return db[_0xfa70('0xaf')][_0xfa70('0x49')]({'where':_0x2ef4b1})[_0xfa70('0x26')](function(_0x9373f2){if(_0x9373f2){return[_0x9373f2,![]];}return db['ChatInteraction']['create'](_0x27fcc6)['then'](function(_0x2ad53a){return[_0x2ad53a,!![]];});});}return db[_0xfa70('0xaf')]['create'](_0x27fcc6)[_0xfa70('0x26')](function(_0xa94a88){return[_0xa94a88,!![]];});}})[_0xfa70('0xb0')](function(_0x4d15a0,_0x56c9cc){if(_0x4d15a0){_0x510350=_0x56c9cc;if(!_0x56c9cc){var _0x5bf7fd={'from':(_0x3f6c27[_0xfa70('0x99')]['firstName']||'')+'\x20'+(_0x3f6c27[_0xfa70('0x99')][_0xfa70('0xa0')]||'')};if(_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xac')]&&_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xb1')]&&_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xac')]!=_0x4d1789['body'][_0xfa70('0xb1')]){_0x5bf7fd[_0xfa70('0xac')]=_0x4d1789[_0xfa70('0x4b')]['messageId'];}return _0x4d15a0[_0xfa70('0x25')](_0x5bf7fd);}else{return _0x4d15a0;}}})[_0xfa70('0x26')](function(_0x3b80d6){_0x3f6c27[_0xfa70('0xae')]=_0x3b80d6[_0xfa70('0x28')]({'plain':!![]});_0x3f6c27[_0xfa70('0xae')][_0xfa70('0xb2')]=_0x510350;if(_0x3f6c27[_0xfa70('0xae')][_0xfa70('0xb2')]){if(_0x3f6c27[_0xfa70('0x93')]['autoclose']){_0x3f6c27[_0xfa70('0x94')][_0xfa70('0xb3')]({'id':0x0,'priority':_0x3f6c27['applications']['length']+0x1,'app':'close','appdata':_0xfa70('0xb4'),'interval':_0xfa70('0xb5')});}}return db[_0xfa70('0xb6')]['create']({'body':_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x4b')],'ChatWebsiteId':_0x4d1789['params']['id'],'ChatInteractionId':_0x3b80d6['id'],'direction':'in','ContactId':_0x3f6c27['contact']['id'],'AttachmentId':_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xb7')]});})[_0xfa70('0x26')](function(_0x470608){_0x3f6c27[_0xfa70('0x1a')]=_0x470608;if(_0x3f6c27[_0xfa70('0xae')][_0xfa70('0xb8')]){return db[_0xfa70('0xb9')][_0xfa70('0x49')]({'attributes':['id',_0xfa70('0x2a')],'where':{'id':_0x3f6c27[_0xfa70('0xae')]['UserId']}})[_0xfa70('0x26')](function(_0x455f7f){if(_0x455f7f){_0x3f6c27['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x455f7f[_0xfa70('0x2a')]+','+(_0x3f6c27[_0xfa70('0x93')][_0xfa70('0xba')]||0xa),'interval':_0xfa70('0xb5')});_0x3f6c27['forcedOwnership']=!![];}return respondWithRpcPromise(_0xfa70('0xbb'),_0xfa70('0xbc'),_0x3f6c27);});}return respondWithRpcPromise('Start',_0xfa70('0xbc'),_0x3f6c27);})['then'](function(_0x517a2a){respondWithRpcPromise(_0xfa70('0xbd'),_0xfa70('0xbd'),{'event':_0xfa70('0xbe'),'message':_0x517a2a},client9002);return _0x517a2a;})[_0xfa70('0x26')](respondWithResult(_0x475e49,null))[_0xfa70('0x1c')](handleError(_0x475e49,null));};exports[_0xfa70('0xbf')]=function(_0x3cb410,_0x4d85ae){var _0x1efda4,_0x124083,_0x1bf8f6;var _0x3333b2=[];var _0x1bef11={};var _0x3cfc60=_0x3cb410['files']||[];var _0x1e49d5=[];var _0x4bd01f;return db[_0xfa70('0x82')][_0xfa70('0x54')]()['then'](function(_0x267248){if(!_0x267248){throw new db['Sequelize'][(_0xfa70('0x84'))](_0xfa70('0x85'));}_0x3333b2=_[_0xfa70('0x88')](_[_0xfa70('0x34')](_0x267248),[_0xfa70('0x86'),_0xfa70('0x87'),'CompanyId','ListId']);if(_0x3cb410[_0xfa70('0x4b')]['id']){delete _0x3cb410['body']['id'];}if(_[_0xfa70('0x74')](_0x3cb410[_0xfa70('0x4b')]['from'])){throw _0x4d85ae[_0xfa70('0x1d')](0x1f4)[_0xfa70('0x2b')](new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0xc0')));}if(_[_0xfa70('0x74')](_0x3cb410[_0xfa70('0x4b')][_0xfa70('0x4b')])||_0x3cb410['body'][_0xfa70('0x4b')]===''){throw _0x4d85ae[_0xfa70('0x1d')](0x1f4)[_0xfa70('0x2b')](new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0x8c')));}if(_['isNil'](_0x3cb410[_0xfa70('0x4b')][_0xfa70('0xc1')])){throw _0x4d85ae[_0xfa70('0x1d')](0x1f4)['send'](new db['Sequelize'][(_0xfa70('0x84'))](_0xfa70('0xc2')+_0x3333b2));}if(!_[_0xfa70('0x8e')](_0x3333b2,_0x3cb410[_0xfa70('0x4b')][_0xfa70('0xc1')])){throw _0x4d85ae['status'](0x1f4)[_0xfa70('0x2b')](new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0xc3')+_0x3333b2));}_0x1bef11[_0x3cb410[_0xfa70('0x4b')][_0xfa70('0xc1')]]=_0x3cb410[_0xfa70('0x4b')][_0xfa70('0x8b')];})[_0xfa70('0x26')](function(){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x3cb410[_0xfa70('0x53')]['id']},'include':[{'model':db[_0xfa70('0x90')],'as':_0xfa70('0x91')},{'model':db[_0xfa70('0xc4')],'as':_0xfa70('0xc4')}]});})['then'](handleEntityNotFound(_0x4d85ae,null))[_0xfa70('0x26')](function(_0x1def23){if(_0x1def23&&_0x1def23['List']){_0x124083=_0x1def23;var _0x3bb6c8=_[_0xfa70('0xb')](_0x3cb410[_0xfa70('0x4b')],{'firstName':_0x3cb410[_0xfa70('0x4b')][_0xfa70('0x8b')],'phone':_0x3cb410[_0xfa70('0x4b')]['from'],'ListId':_0x1def23[_0xfa70('0x8a')]});_0x3bb6c8[_0x3cb410[_0xfa70('0x4b')][_0xfa70('0xc1')]]=_0x3cb410[_0xfa70('0x4b')][_0xfa70('0x8b')];return db['CmContact'][_0xfa70('0xc5')]({'where':_0x1bef11,'defaults':_0x3bb6c8});}})[_0xfa70('0xb0')](function(_0x571e68){if(_0x571e68){_0x1bf8f6=_0x571e68;var _0x1d044c=fs[_0xfa70('0xc6')](path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0xc7')),_0xfa70('0xc8'));var _0x3028e8=ejs[_0xfa70('0xc9')](_0x1d044c,{'body':_[_0xfa70('0xca')](_0x3cb410['body']['body']),'bodyTitle':_0x124083[_0xfa70('0xcb')]});return db[_0xfa70('0xcc')][_0xfa70('0x4a')]({'body':_0x3028e8,'plainBody':htmlToText[_0xfa70('0xcd')](_0x3028e8),'ContactId':_0x571e68['id'],'ChatWebsiteId':_0x124083['id']});}})[_0xfa70('0x26')](function(_0x4dc5a5){_0x4bd01f=_0x4dc5a5;if(_0x3cfc60['length']){var _0x32bc77=_0x3cfc60['map'](function(_0x35354c){return{'name':_0x35354c[_0xfa70('0xce')],'basename':_0x35354c[_0xfa70('0x63')],'type':_0x35354c[_0xfa70('0xcf')],'ChatOfflineMessageId':_0x4dc5a5['id']};});_0x1e49d5=_0x32bc77[_0xfa70('0x2d')](_0x1703bc=>{var _0x2bc913={'filename':_0x1703bc[_0xfa70('0x2a')],'path':path[_0xfa70('0x6a')](config['root'],_0xfa70('0xd0'),_0xfa70('0xd1'),'attachments','offline-chat',_0x1703bc[_0xfa70('0xd2')])};return _0x2bc913;});if(!_0x124083[_0xfa70('0xd3')]){return db[_0xfa70('0xd4')][_0xfa70('0xd5')](function(_0x17aedd){return db['Attachment'][_0xfa70('0xd6')](_0x32bc77,{'transaction':_0x17aedd});});}}})[_0xfa70('0x26')](function(){if(_0x4bd01f){_0x1efda4=_0x4bd01f;return db[_0xfa70('0xc4')][_0xfa70('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xfa70('0xd7')],'as':_0xfa70('0xd8'),'raw':!![],'include':[{'model':db[_0xfa70('0xd9')],'as':_0xfa70('0xd9'),'raw':!![]}]}]});}})[_0xfa70('0x26')](function(_0x165db6){if(_0x165db6&&_0x165db6[_0xfa70('0xd8')]&&_0x124083['forwardOffline']&&_0x124083['forwardOfflineAddress']){var _0x4bb0df=_0x165db6['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xfa70('0xda'),{'account':_0x4bb0df,'message':{'from':util[_0xfa70('0xa5')](_0xfa70('0xdb'),_0x165db6[_0xfa70('0x2a')],_0x165db6['email']||_0x165db6[_0xfa70('0xd8')][_0xfa70('0x4c')]),'to':_0x124083[_0xfa70('0xdc')],'subject':_0x124083[_0xfa70('0xdd')],'html':_0x1efda4[_0xfa70('0x4b')],'attachments':_0x1e49d5}},client9003)[_0xfa70('0x26')](function(){return _0x1efda4;})[_0xfa70('0x1c')](function(_0x1a62e6){logger['error'](_0x1a62e6);});}})[_0xfa70('0x26')](function(){if(_0x124083&&_0x124083['openNewInteraction']&&_0x124083['MailAccountId']){var _0x13cbdb=[];if(_0x3cfc60[_0xfa70('0x38')]){_0x13cbdb=_0x3cfc60['map'](function(_0x286ccf){return{'name':_0x286ccf[_0xfa70('0xce')],'basename':_0x286ccf[_0xfa70('0x63')],'type':_0x286ccf[_0xfa70('0xcf')],'ChatOfflineMessageId':_0x4bd01f['id']};});}var _0x290641;if(!_['isNil'](_0x124083['subjectOffline'])){var _0x36a04=_[_0xfa70('0x2d')](_0x3cb410['body'],function(_0x3fa3c1){return _0x3fa3c1;});var _0x24cad0=_[_0xfa70('0xde')](_0x36a04)[0x0];var _0x2f7306=_[_0xfa70('0xdf')](_0x24cad0,function(_0x26ff6f){return _0x26ff6f;});_0x290641=_0x2f7306[0x1][_0x124083[_0xfa70('0xe0')]];}var _0x11a8e9={'from':_0x1bf8f6[_0xfa70('0xe1')],'firstName':_0x1bf8f6[_0xfa70('0x9f')],'lastName':_0x1bf8f6[_0xfa70('0xa0')],'mapKey':_0xfa70('0xe1'),'message':{'from':_0x1bf8f6[_0xfa70('0xe1')],'to':_0x124083['MailAccount'][_0xfa70('0xe1')],'cc':'','subject':_[_0xfa70('0x74')](_0x290641)?_0x124083[_0xfa70('0xdd')]:_0x290641,'messageId':'','sentAt':new Date(),'attach':_0x13cbdb[_0xfa70('0x38')],'attachments':_0x13cbdb,'originChannel':_0xfa70('0xe2'),'ChatWebsiteId':_0x124083['id'],'ChatOfflineMessageId':_0x1efda4['id'],'originTo':_0x124083['MailAccount'][_0xfa70('0xe1')]},'body':_0x1efda4['body']};var _0x53e87d={'account':{'id':_0x124083[_0xfa70('0xe3')]},'body':_0x11a8e9,'log':_0xfa70('0xe4')};return respondWithRpcPromise(_0xfa70('0xe4'),_0xfa70('0xe5'),_0x53e87d,client9001)['then'](function(){return _0x1efda4;})[_0xfa70('0x1c')](function(_0x47078b){logger[_0xfa70('0x17')](_0x47078b);});}return;})[_0xfa70('0x26')](function(){if(_0x1efda4){return _0x1efda4;}})['then'](respondWithResult(_0x4d85ae,null))[_0xfa70('0x1c')](function(_0x314826){logger[_0xfa70('0x17')](_0xfa70('0x1c'),_0x314826);for(var _0x3558b1 of _0x3cfc60){var _0x3fd132=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0xd0'),_0xfa70('0xd1'),'attachments',_0xfa70('0xe6'),_0x3558b1[_0xfa70('0x63')]);fs_extra[_0xfa70('0xe7')](_0x3fd132)[_0xfa70('0x1c')](function(_0x19f0a5){logger[_0xfa70('0x17')](_0xfa70('0xe8'),_0x3fd132,_0x19f0a5);});}});};exports[_0xfa70('0xe9')]=function(_0x3ad0c5,_0x5a32f8){return db[_0xfa70('0xaf')]['find']({'where':{'id':_0x3ad0c5[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5a32f8,null))['then'](function(_0x479453){if(_0x479453){return _0x479453['addInteraction'](_0x3ad0c5[_0xfa70('0x4b')][_0xfa70('0x5b')],_[_0xfa70('0xea')](_0x3ad0c5[_0xfa70('0x4b')],[_0xfa70('0x5b'),'id'])||{});}})[_0xfa70('0x26')](respondWithResult(_0x5a32f8,null))[_0xfa70('0x1c')](handleError(_0x5a32f8,null));};exports[_0xfa70('0xeb')]=function(_0x507bc1,_0x5479a4){var _0x17b586={'raw':![],'where':{}};var _0x2f697c={};var _0x559225={'count':0x0,'rows':[]};return db[_0xfa70('0x2e')][_0xfa70('0x5d')]({'where':{'id':_0x507bc1[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5479a4,null))['then'](function(_0x1354a1){if(_0x1354a1){_0x2f697c[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0xaf')][_0xfa70('0x2f')]);_0x2f697c['query']=_[_0xfa70('0x34')](_0x507bc1[_0xfa70('0x33')]);_0x2f697c[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x2f697c[_0xfa70('0x32')],_0x2f697c[_0xfa70('0x33')]);_0x17b586[_0xfa70('0x37')]=_[_0xfa70('0x35')](_0x2f697c[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x507bc1[_0xfa70('0x33')]['fields']));_0x17b586[_0xfa70('0x37')]=_0x17b586[_0xfa70('0x37')][_0xfa70('0x38')]?_0x17b586['attributes']:_0x2f697c[_0xfa70('0x32')];if(!_0x507bc1[_0xfa70('0x33')][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x17b586['limit']=qs[_0xfa70('0x22')](_0x507bc1[_0xfa70('0x33')]['limit']);_0x17b586['offset']=qs['offset'](_0x507bc1['query'][_0xfa70('0x20')]);}_0x17b586[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x507bc1[_0xfa70('0x33')][_0xfa70('0x3b')]);_0x17b586[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_[_0xfa70('0x3d')](_0x507bc1[_0xfa70('0x33')],_0x2f697c[_0xfa70('0x3e')]));_0x17b586['where'][_0xfa70('0x56')]=_0x1354a1['id'];if(_0x507bc1[_0xfa70('0x33')][_0xfa70('0x3f')]){_0x17b586['where']=_['merge'](_0x17b586[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x17b586['attributes'],function(_0x594226){var _0x398cee={};_0x398cee[_0x594226]={'$like':'%'+_0x507bc1[_0xfa70('0x33')][_0xfa70('0x3f')]+'%'};return _0x398cee;})});}_0x17b586=_[_0xfa70('0x40')]({},_0x17b586,_0x507bc1[_0xfa70('0x42')]);return db[_0xfa70('0xaf')][_0xfa70('0x23')]({'where':_0x17b586[_0xfa70('0x3c')]})[_0xfa70('0x26')](function(_0x3ef1f1){_0x559225[_0xfa70('0x23')]=_0x3ef1f1;if(_0x507bc1['query'][_0xfa70('0x48')]){_0x17b586['include']=[{'model':db[_0xfa70('0x82')],'as':_0xfa70('0xec'),'required':![]},{'model':db[_0xfa70('0xb9')],'as':_0xfa70('0xed'),'attributes':['name',_0xfa70('0xee'),'internal'],'required':![]},{'model':db[_0xfa70('0xef')],'as':_0xfa70('0xf0'),'attributes':['id',_0xfa70('0x2a'),_0xfa70('0xf1')],'where':_0x507bc1[_0xfa70('0x33')][_0xfa70('0xf2')]?{'id':_0x507bc1['query'][_0xfa70('0xf2')]}:undefined,'required':_0x507bc1['query']['tag']?!![]:![]}];}return db[_0xfa70('0xaf')][_0xfa70('0x59')](_0x17b586);})[_0xfa70('0x26')](function(_0x303beb){_0x559225['rows']=_0x303beb;return _0x559225;});}})[_0xfa70('0x26')](respondWithFilteredResult(_0x5479a4,_0x17b586))[_0xfa70('0x1c')](handleError(_0x5479a4,null));};function iftimePromise(_0x9e9f99,_0x1d0e9d){return respondWithRpcPromise(_0xfa70('0xf3'),_0xfa70('0xf4'),{'command':_0x1d0e9d[_0xfa70('0xf5')]?util[_0xfa70('0xa5')](_0xfa70('0xf6'),_0x9e9f99[_0xfa70('0xf7')],_0x1d0e9d[_0xfa70('0xf5')]):util[_0xfa70('0xa5')]('iftime\x20%s',_0x9e9f99[_0xfa70('0xf7')])},client9002)[_0xfa70('0x26')](function(_0x2be633){var _0x4fbad2=_0x2be633&&_0x2be633[_0xfa70('0xf8')](_0xfa70('0xf9'))>=0x0?!![]:![];logger[_0xfa70('0x13')](_0xfa70('0xfa'),_0x1d0e9d['id'],_0x9e9f99['id'],_0x9e9f99[_0xfa70('0xf7')],_0x4fbad2?_0xfa70('0xfb'):_0xfa70('0xfc'),_0x1d0e9d[_0xfa70('0xf5')]?_0x1d0e9d[_0xfa70('0xf5')]:_0xfa70('0xfd'));return _0x4fbad2;})[_0xfa70('0x1c')](function(_0x546bc9){logger[_0xfa70('0x17')](_0xfa70('0xfa'),_0x1d0e9d['id'],_0x9e9f99['id'],_0x9e9f99['interval'],util['inspect'](_0x546bc9,{'showHidden':![],'depth':null}),_0x1d0e9d[_0xfa70('0xf5')]?_0x1d0e9d[_0xfa70('0xf5')]:_0xfa70('0xfd'));return![];});}exports[_0xfa70('0xf4')]=function(_0x5d040a,_0x8a6a34){var _0x527efc=0x0;var _0x358579=0x0;var _0xd1827f=![];var _0x15f198;var _0x368ba8;return db['ChatWebsite'][_0xfa70('0x49')]({'where':{'id':_0x5d040a['params']['id']},'include':[{'model':db[_0xfa70('0xfe')],'as':_0xfa70('0xfe'),'include':[{'model':db[_0xfa70('0xfe')],'as':_0xfa70('0xff'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xfa70('0x26')](handleEntityNotFound(_0x8a6a34,null))[_0xfa70('0x26')](function(_0x2ff5ba){if(_0x2ff5ba){_0x15f198=_0x2ff5ba;return _0x2ff5ba[_0xfa70('0x100')]({'raw':!![]});}})['then'](function(_0x47d246){if(_0x15f198){if(_0x47d246){_0x368ba8=_0x47d246;}}return require(_0xfa70('0x6d'))[_0xfa70('0x101')]();})[_0xfa70('0x26')](function(_0x317dca){if(_0x317dca){_0x358579=_0x317dca[_0xfa70('0x102')];_0xd1827f=_0x317dca[_0xfa70('0x6e')];}})[_0xfa70('0x26')](function(){return db[_0xfa70('0xaf')]['count']({'where':{'closed':![]}});})['then'](function(_0x23cae4){_0x527efc=_0x23cae4;if(_0x358579&&_0x23cae4>_0x358579){return db['License'][_0xfa70('0x5d')]({'where':{'id':0x1}})[_0xfa70('0x26')](function(_0x5afae7){if(_0x5afae7){_0x5afae7[_0xfa70('0x103')](_0xfa70('0x104'));}});}})['then'](function(){if(_0x15f198[_0xfa70('0xfe')]&&_0x15f198[_0xfa70('0xfe')]['Intervals']){var _0x31ff0f=[];for(var _0x37d4d2=0x0;_0x37d4d2<_0x15f198[_0xfa70('0xfe')]['Intervals'][_0xfa70('0x38')];_0x37d4d2++){var _0x1531f4=_0x15f198[_0xfa70('0xfe')][_0xfa70('0xff')][_0x37d4d2][_0xfa70('0x28')]({'plain':!![]});_0x31ff0f[_0xfa70('0xb3')](iftimePromise(_0x1531f4,_0x15f198));}return BPromise[_0xfa70('0x105')](_0x31ff0f)['then'](function(_0x2d97d9){return _[_0xfa70('0x106')](_0x2d97d9);});}else{return!![];}})['then'](function(_0x41cd40){var _0x2e436b=fs['readFileSync'](path[_0xfa70('0x6a')](config['root'],_0xfa70('0x107')),_0xfa70('0xc8'));var _0x92670e=new url[(_0xfa70('0x108'))](_0x15f198[_0xfa70('0x109')])[_0xfa70('0x10a')];var _0x16743c=_0xfa70('0x10b');var _0x6c439e=![];var _0x45cfc3={'chatVersion':_0x16743c,'chatWebsiteAddressOrigin':_0x92670e,'remote':_0x15f198[_0xfa70('0x10c')],'query':querystring[_0xfa70('0x10d')](_[_0xfa70('0x40')](_0x15f198[_0xfa70('0x28')]({'plain':!![]}),{'customerIp':_0x5d040a['headers'][_0xfa70('0x9d')]||_0x5d040a[_0xfa70('0x7e')][_0xfa70('0x10e')]||_0x5d040a[_0xfa70('0x10f')][_0xfa70('0x110')]||_0x5d040a['ip'],'referer':_0x5d040a[_0xfa70('0x7e')][_0xfa70('0xa2')],'openedInteractions':_0x527efc,'maxInteractions':_0x358579,'virtual':_0xd1827f[_0xfa70('0x102')],'online':_0x41cd40,'custom':_0xd1827f}))['replace'](/'/g,'\x5c\x27')};_0x8a6a34[_0xfa70('0x2b')](ejs[_0xfa70('0xc9')](Mustache[_0xfa70('0xc9')](_0x2e436b,_0x45cfc3),{'proactiveActions':_0x368ba8,'alignment':_0x15f198[_0xfa70('0x111')],'verticalAlignment':_0x15f198[_0xfa70('0x112')],'div_color':_0x15f198[_0xfa70('0xf1')],'labelText':_0x15f198[_0xfa70('0x113')],'text_color':_0x15f198[_0xfa70('0x114')],'text_button_color':_0x15f198['textButtonColor'],'button_color':_0x15f198[_0xfa70('0x115')],'background_color':_0x15f198['backgroundColor'],'hideWhenOffline':_0x15f198['hideWhenOffline'],'intervalId':_0x15f198[_0xfa70('0x116')],'isDevelopment':_0x6c439e,'chatVersion':_0x16743c}));})['catch'](handleError(_0x8a6a34,null));};exports[_0xfa70('0x117')]=function(_0x10b327,_0xf03ac0){var _0x1e64cd=_0x10b327[_0xfa70('0x53')]['id'];var _0x13abfb=_0x10b327[_0xfa70('0x4b')];var _0x44bf2e=0xc8;var _0x1a599d=null;return db[_0xfa70('0xd4')][_0xfa70('0xd5')]({'isolationLevel':db[_0xfa70('0xd4')][_0xfa70('0x118')][_0xfa70('0x119')][_0xfa70('0x11a')]},function(_0x1097cc){return db[_0xfa70('0x2e')]['findOne']({'where':{'id':_0x1e64cd},'transaction':_0x1097cc})[_0xfa70('0x26')](function(_0x33f475){if(_0x33f475){return db['ChatApplication'][_0xfa70('0x27')]({'where':{'ChatWebsiteId':_0x1e64cd},'transaction':_0x1097cc})[_0xfa70('0x26')](function(){var _0x3164d2=_[_0xfa70('0x2d')](_0x13abfb,function(_0x40a8b6){_0x40a8b6[_0xfa70('0x56')]=_0x1e64cd;return _0x40a8b6;});return db[_0xfa70('0x11b')][_0xfa70('0xd6')](_0x3164d2,{'transaction':_0x1097cc});});}else{_0x44bf2e=0x194;_0x1a599d=[];}});})[_0xfa70('0x26')](function(){if(_0x44bf2e!==0x194){return db[_0xfa70('0x11b')][_0xfa70('0x11c')]({'where':{'ChatWebsiteId':_0x1e64cd},'order':_0xfa70('0x11d')})[_0xfa70('0x26')](function(_0x1d5405){_0x1a599d=_0x1d5405;});}})[_0xfa70('0x1c')](function(_0x4f48c5){_0x44bf2e=0x1f4;logger[_0xfa70('0x17')](_0x4f48c5['stack']);if(_0x4f48c5[_0xfa70('0x2a')]){delete _0x4f48c5[_0xfa70('0x2a')];}_0x1a599d=_0x4f48c5;})[_0xfa70('0x11e')](function(){if(_0x1a599d===null){_0xf03ac0[_0xfa70('0x29')](_0x44bf2e);}else{if(_0x44bf2e===0x1f4){_0xf03ac0[_0xfa70('0x1d')](_0x44bf2e)[_0xfa70('0x2b')](_0x1a599d);}else{_0xf03ac0['status'](_0x44bf2e)[_0xfa70('0x1f')](_0x1a599d);}}});};exports[_0xfa70('0x11f')]=function(_0x3516ca,_0x2be032){var _0x374801={};var _0x5a39c9={};var _0x24b58c;var _0x23dce1;return db[_0xfa70('0x2e')]['findOne']({'where':{'id':_0x3516ca[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x2be032,null))[_0xfa70('0x26')](function(_0x266c0b){if(_0x266c0b){_0x24b58c=_0x266c0b;_0x5a39c9[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0x11b')][_0xfa70('0x2f')]);_0x5a39c9[_0xfa70('0x33')]=_['keys'](_0x3516ca['query']);_0x5a39c9[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x5a39c9['model'],_0x5a39c9[_0xfa70('0x33')]);_0x374801[_0xfa70('0x37')]=_[_0xfa70('0x35')](_0x5a39c9[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x3516ca['query'][_0xfa70('0x36')]));_0x374801[_0xfa70('0x37')]=_0x374801[_0xfa70('0x37')]['length']?_0x374801['attributes']:_0x5a39c9['model'];_0x374801[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x3516ca[_0xfa70('0x33')]['sort']);_0x374801[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_[_0xfa70('0x3d')](_0x3516ca[_0xfa70('0x33')],_0x5a39c9[_0xfa70('0x3e')]));if(_0x3516ca[_0xfa70('0x33')][_0xfa70('0x3f')]){_0x374801[_0xfa70('0x3c')]=_[_0xfa70('0x40')](_0x374801[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x374801[_0xfa70('0x37')],function(_0x37a8ee){var _0x231dd4={};_0x231dd4[_0x37a8ee]={'$like':'%'+_0x3516ca['query'][_0xfa70('0x3f')]+'%'};return _0x231dd4;})});}_0x374801=_[_0xfa70('0x40')]({},_0x374801,_0x3516ca['options']);return _0x24b58c[_0xfa70('0x11f')](_0x374801);}})[_0xfa70('0x26')](function(_0x4b651c){if(_0x4b651c){_0x23dce1=_0x4b651c[_0xfa70('0x38')];if(!_0x3516ca[_0xfa70('0x33')][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x374801[_0xfa70('0x22')]=qs['limit'](_0x3516ca[_0xfa70('0x33')][_0xfa70('0x22')]);_0x374801[_0xfa70('0x20')]=qs['offset'](_0x3516ca[_0xfa70('0x33')]['offset']);}return _0x24b58c['getApplications'](_0x374801);}})[_0xfa70('0x26')](function(_0x246d20){if(_0x246d20){return _0x246d20?{'count':_0x23dce1,'rows':_0x246d20}:null;}})['then'](respondWithResult(_0x2be032,null))[_0xfa70('0x1c')](handleError(_0x2be032,null));};exports[_0xfa70('0x120')]=function(_0x444e2a,_0x5ec26b){return db[_0xfa70('0x121')][_0xfa70('0x49')]({'where':{'id':_0x444e2a['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5ec26b,null))[_0xfa70('0x26')](function(_0x10d4d7){if(_0x10d4d7){return _0x10d4d7[_0xfa70('0x120')](_0x444e2a['body']['ids'],_['omit'](_0x444e2a[_0xfa70('0x4b')],['ids','id'])||{});}})[_0xfa70('0x26')](respondWithResult(_0x5ec26b,null))[_0xfa70('0x1c')](handleError(_0x5ec26b,null));};exports[_0xfa70('0x100')]=function(_0x1cf8d2,_0x38378b){var _0x2f1159={};var _0x12f808={};var _0x483a4d;var _0x1851c4;return db['ChatWebsite'][_0xfa70('0x5d')]({'where':{'id':_0x1cf8d2['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x38378b,null))['then'](function(_0x70f27a){if(_0x70f27a){_0x483a4d=_0x70f27a;_0x12f808[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0x122')][_0xfa70('0x2f')]);_0x12f808[_0xfa70('0x33')]=_[_0xfa70('0x34')](_0x1cf8d2[_0xfa70('0x33')]);_0x12f808[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x12f808[_0xfa70('0x32')],_0x12f808['query']);_0x2f1159['attributes']=_[_0xfa70('0x35')](_0x12f808[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x1cf8d2[_0xfa70('0x33')][_0xfa70('0x36')]));_0x2f1159['attributes']=_0x2f1159[_0xfa70('0x37')][_0xfa70('0x38')]?_0x2f1159['attributes']:_0x12f808[_0xfa70('0x32')];_0x2f1159[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x1cf8d2[_0xfa70('0x33')][_0xfa70('0x3b')]);_0x2f1159[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_['pick'](_0x1cf8d2[_0xfa70('0x33')],_0x12f808[_0xfa70('0x3e')]));if(_0x1cf8d2[_0xfa70('0x33')]['filter']){_0x2f1159['where']=_['merge'](_0x2f1159[_0xfa70('0x3c')],{'$or':_['map'](_0x2f1159['attributes'],function(_0x39c25f){var _0x414e08={};_0x414e08[_0x39c25f]={'$like':'%'+_0x1cf8d2[_0xfa70('0x33')]['filter']+'%'};return _0x414e08;})});}_0x2f1159=_[_0xfa70('0x40')]({},_0x2f1159,_0x1cf8d2[_0xfa70('0x42')]);return _0x483a4d['getProactiveActions'](_0x2f1159);}})[_0xfa70('0x26')](function(_0x257978){if(_0x257978){_0x1851c4=_0x257978['length'];if(!_0x1cf8d2['query'][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x2f1159[_0xfa70('0x22')]=qs[_0xfa70('0x22')](_0x1cf8d2['query'][_0xfa70('0x22')]);_0x2f1159[_0xfa70('0x20')]=qs[_0xfa70('0x20')](_0x1cf8d2[_0xfa70('0x33')][_0xfa70('0x20')]);}return _0x483a4d[_0xfa70('0x100')](_0x2f1159);}})[_0xfa70('0x26')](function(_0x33c404){if(_0x33c404){return _0x33c404?{'count':_0x1851c4,'rows':_0x33c404}:null;}})[_0xfa70('0x26')](respondWithResult(_0x38378b,null))['catch'](handleError(_0x38378b,null));};exports[_0xfa70('0x123')]=function(_0x427ef8,_0x4c0a75){var _0x25bae3=_0x427ef8['query'][_0xfa70('0x124')]==='false'?_0xfa70('0x125'):_0xfa70('0x126');return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'attributes':['id',_0x25bae3],'where':{'id':_0x427ef8[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x4c0a75,null))[_0xfa70('0x26')](function(_0x59c5b8){if(_0x59c5b8){var _0x18985b=_0x59c5b8[_0x25bae3];var _0x1c184a=_0x18985b&&_0x18985b[_0xfa70('0x127')]?_0x18985b[_0xfa70('0x127')]:[];_0x4c0a75[_0xfa70('0x2b')]({'fromKey':_[_0xfa70('0x74')](_0x18985b[_0xfa70('0x128')])?undefined:_0x18985b[_0xfa70('0x128')],'count':_0x1c184a[_0xfa70('0x38')],'rows':_0x1c184a});}})['catch'](handleError(_0x4c0a75,null));};exports[_0xfa70('0x129')]=function(_0x1a90d1,_0x214792){var _0x529929={'raw':![],'where':{}};var _0x607581={};var _0x5f3d69={'count':0x0,'rows':[]};return db[_0xfa70('0x2e')][_0xfa70('0x5d')]({'where':{'id':_0x1a90d1['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x214792,null))['then'](function(_0x223185){if(_0x223185){_0x607581['model']=_[_0xfa70('0x34')](db[_0xfa70('0xcc')][_0xfa70('0x2f')]);_0x607581[_0xfa70('0x33')]=_['keys'](_0x1a90d1[_0xfa70('0x33')]);_0x607581['filters']=_['intersection'](_0x607581[_0xfa70('0x32')],_0x607581[_0xfa70('0x33')]);_0x529929[_0xfa70('0x37')]=_['intersection'](_0x607581['model'],qs[_0xfa70('0x36')](_0x1a90d1['query'][_0xfa70('0x36')]));_0x529929[_0xfa70('0x37')]=_0x529929[_0xfa70('0x37')][_0xfa70('0x38')]?_0x529929[_0xfa70('0x37')]:_0x607581[_0xfa70('0x32')];if(!_0x1a90d1[_0xfa70('0x33')][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x529929[_0xfa70('0x22')]=qs[_0xfa70('0x22')](_0x1a90d1['query'][_0xfa70('0x22')]);_0x529929[_0xfa70('0x20')]=qs[_0xfa70('0x20')](_0x1a90d1['query'][_0xfa70('0x20')]);}_0x529929[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x1a90d1['query'][_0xfa70('0x3b')]);_0x529929[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_['pick'](_0x1a90d1[_0xfa70('0x33')],_0x607581[_0xfa70('0x3e')]));_0x529929[_0xfa70('0x3c')][_0xfa70('0x56')]=_0x223185['id'];if(_0x1a90d1['query'][_0xfa70('0x3f')]){_0x529929[_0xfa70('0x3c')]=_[_0xfa70('0x40')](_0x529929[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x529929['attributes'],function(_0x55b6ab){var _0x5e4e2b={};_0x5e4e2b[_0x55b6ab]={'$like':'%'+_0x1a90d1[_0xfa70('0x33')]['filter']+'%'};return _0x5e4e2b;})});}_0x529929=_[_0xfa70('0x40')]({},_0x529929,_0x1a90d1[_0xfa70('0x42')]);return db[_0xfa70('0xcc')][_0xfa70('0x23')]({'where':_0x529929[_0xfa70('0x3c')]})['then'](function(_0x5d455d){_0x5f3d69[_0xfa70('0x23')]=_0x5d455d;if(_0x1a90d1[_0xfa70('0x33')]['includeAll']){_0x529929[_0xfa70('0x43')]=[{'all':!![]}];}else{_0x529929[_0xfa70('0x43')]=[{'model':db[_0xfa70('0x82')],'as':'Contact','required':![]},{'model':db[_0xfa70('0x12a')],'as':'Attachments','required':![]}];}return db[_0xfa70('0xcc')]['findAll'](_0x529929);})[_0xfa70('0x26')](function(_0x36c336){_0x5f3d69[_0xfa70('0x44')]=_0x36c336;return _0x5f3d69;});}})[_0xfa70('0x26')](respondWithFilteredResult(_0x214792,_0x529929))['catch'](handleError(_0x214792,null));};exports[_0xfa70('0x12b')]=function(_0xcce62c,_0x42e3ad){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0xcce62c[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x42e3ad,null))[_0xfa70('0x26')](function(_0x126c06){if(_0x126c06){return _0x126c06[_0xfa70('0x12b')](_0xcce62c['body'][_0xfa70('0x5b')],_[_0xfa70('0xea')](_0xcce62c[_0xfa70('0x4b')],['ids','id'])||{})[_0xfa70('0xb0')](function(_0x365984){for(var _0x35ee1c=0x0;_0x35ee1c<_0xcce62c['body'][_0xfa70('0x5b')][_0xfa70('0x38')];_0x35ee1c+=0x1){socket[_0xfa70('0x12c')](_0xfa70('0x12d'),{'UserId':Number(_0xcce62c['body'][_0xfa70('0x5b')][_0x35ee1c]),'ChatWebsiteId':Number(_0xcce62c[_0xfa70('0x53')]['id'])});}return _0x365984;});}})['then'](respondWithResult(_0x42e3ad,null))[_0xfa70('0x1c')](handleError(_0x42e3ad,null));};exports[_0xfa70('0x12e')]=function(_0x640da1,_0x5defd9){return db[_0xfa70('0x2e')]['find']({'where':{'id':_0x640da1[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5defd9,null))[_0xfa70('0x26')](function(_0x3b4663){if(_0x3b4663){return _0x3b4663['removeAgents'](_0x640da1[_0xfa70('0x33')][_0xfa70('0x5b')])[_0xfa70('0x26')](function(){if(_[_0xfa70('0x12f')](_0x640da1['query'][_0xfa70('0x5b')])){for(var _0x14be27=0x0;_0x14be27<_0x640da1[_0xfa70('0x33')][_0xfa70('0x5b')][_0xfa70('0x38')];_0x14be27+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x640da1['query']['ids'][_0x14be27]),'ChatWebsiteId':Number(_0x640da1[_0xfa70('0x53')]['id'])});}}else{socket[_0xfa70('0x12c')](_0xfa70('0x130'),{'UserId':Number(_0x640da1[_0xfa70('0x33')][_0xfa70('0x5b')]),'ChatWebsiteId':Number(_0x640da1[_0xfa70('0x53')]['id'])});}});}})[_0xfa70('0x26')](respondWithStatusCode(_0x5defd9,null))['catch'](handleError(_0x5defd9,null));};exports[_0xfa70('0x131')]=function(_0x44975d,_0x20c7aa){var _0x1d23bd={};var _0x467df8={};var _0x3869b3;var _0x3107a4;return db[_0xfa70('0x2e')][_0xfa70('0x5d')]({'where':{'id':_0x44975d[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x20c7aa,null))[_0xfa70('0x26')](function(_0x38c149){if(_0x38c149){_0x3869b3=_0x38c149;_0x467df8[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0xb9')]['rawAttributes']);_0x467df8[_0xfa70('0x33')]=_[_0xfa70('0x34')](_0x44975d['query']);_0x467df8[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x467df8[_0xfa70('0x32')],_0x467df8[_0xfa70('0x33')]);_0x1d23bd['attributes']=_['intersection'](_0x467df8[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x44975d[_0xfa70('0x33')][_0xfa70('0x36')]));_0x1d23bd[_0xfa70('0x37')]=_0x1d23bd[_0xfa70('0x37')][_0xfa70('0x38')]?_0x1d23bd[_0xfa70('0x37')]:_0x467df8[_0xfa70('0x32')];_0x1d23bd['order']=qs[_0xfa70('0x3b')](_0x44975d[_0xfa70('0x33')][_0xfa70('0x3b')]);_0x1d23bd[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_[_0xfa70('0x3d')](_0x44975d[_0xfa70('0x33')],_0x467df8[_0xfa70('0x3e')]));if(_0x44975d['query'][_0xfa70('0x3f')]){_0x1d23bd[_0xfa70('0x3c')]=_['merge'](_0x1d23bd[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x1d23bd['attributes'],function(_0x105cf8){var _0x27469c={};_0x27469c[_0x105cf8]={'$like':'%'+_0x44975d[_0xfa70('0x33')]['filter']+'%'};return _0x27469c;})});}_0x1d23bd=_[_0xfa70('0x40')]({},_0x1d23bd,_0x44975d[_0xfa70('0x42')]);return _0x3869b3['getAgents'](_0x1d23bd);}})['then'](function(_0x38973c){if(_0x38973c){_0x3107a4=_0x38973c[_0xfa70('0x38')];if(!_0x44975d['query'][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x1d23bd['limit']=qs[_0xfa70('0x22')](_0x44975d[_0xfa70('0x33')][_0xfa70('0x22')]);_0x1d23bd[_0xfa70('0x20')]=qs['offset'](_0x44975d[_0xfa70('0x33')][_0xfa70('0x20')]);}return _0x3869b3[_0xfa70('0x131')](_0x1d23bd);}})[_0xfa70('0x26')](function(_0xc2610e){if(_0xc2610e){return _0xc2610e?{'count':_0x3107a4,'rows':_0xc2610e}:null;}})['then'](respondWithResult(_0x20c7aa,null))[_0xfa70('0x1c')](handleError(_0x20c7aa,null));};
\ No newline at end of file
+var _0x9950=['order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','Pause','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','priority','asc','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','all','server/files/chat/iframe.ejs','URL','address','origin','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit'];(function(_0x2cb998,_0x5c33aa){var _0x450c3e=function(_0x564336){while(--_0x564336){_0x2cb998['push'](_0x2cb998['shift']());}};_0x450c3e(++_0x5c33aa);}(_0x9950,0xf8));var _0x0995=function(_0x5b2bf2,_0x184783){_0x5b2bf2=_0x5b2bf2-0x0;var _0xbff45b=_0x9950[_0x5b2bf2];return _0xbff45b;};'use strict';var BPromise=require(_0x0995('0x0'));var Mustache=require('mustache');var util=require(_0x0995('0x1'));var path=require('path');var ejs=require(_0x0995('0x2'));var fs=require('fs');var fs_extra=require(_0x0995('0x3'));var _=require('lodash');var querystring=require(_0x0995('0x4'));var Redis=require(_0x0995('0x5'));var qs=require(_0x0995('0x6'));var logger=require(_0x0995('0x7'))('api');var config=require(_0x0995('0x8'));var url=require(_0x0995('0x9'));var db=require(_0x0995('0xa'))['db'];config['redis']=_[_0x0995('0xb')](config[_0x0995('0xc')],{'host':_0x0995('0xd'),'port':0x18eb});var socket=require(_0x0995('0xe'))(new Redis(config[_0x0995('0xc')]));require(_0x0995('0xf'))[_0x0995('0x10')](socket);var htmlToText=require(_0x0995('0x11'));var jayson=require(_0x0995('0x12'));var client=jayson['client'][_0x0995('0x13')]({'port':0x232c});var client9002=jayson[_0x0995('0x14')][_0x0995('0x13')]({'port':0x232a});var client9003=jayson[_0x0995('0x14')][_0x0995('0x13')]({'port':0x232b});var client9001=jayson[_0x0995('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x505ca3,_0x5e154f,_0x4deea5,_0x6e5489){return new BPromise(function(_0x3bdf3b,_0x643be6){var _0x19ce9d=_0x6e5489||client;return _0x19ce9d[_0x0995('0x15')](_0x505ca3,_0x4deea5)[_0x0995('0x16')](function(_0x2c6ef6){logger[_0x0995('0x17')](_0x0995('0x18'),_0x5e154f,_0x0995('0x19'));logger[_0x0995('0x1a')](_0x0995('0x1b'),_0x5e154f,'request\x20sent',JSON['stringify'](_0x2c6ef6));if(_0x2c6ef6['error']){if(_0x2c6ef6[_0x0995('0x1c')][_0x0995('0x1d')]===0x1f4){logger[_0x0995('0x1c')](_0x0995('0x18'),_0x5e154f,_0x2c6ef6[_0x0995('0x1c')][_0x0995('0x1e')]);return _0x643be6(_0x2c6ef6[_0x0995('0x1c')][_0x0995('0x1e')]);}logger[_0x0995('0x1c')](_0x0995('0x18'),_0x5e154f,_0x2c6ef6['error'][_0x0995('0x1e')]);return _0x3bdf3b(_0x2c6ef6[_0x0995('0x1c')]['message']);}else{logger[_0x0995('0x17')](_0x0995('0x18'),_0x5e154f,_0x0995('0x19'));_0x3bdf3b(_0x2c6ef6[_0x0995('0x1f')][_0x0995('0x1e')]);}})[_0x0995('0x20')](function(_0x4c81dd){logger[_0x0995('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x5e154f,_0x4c81dd);_0x643be6(_0x4c81dd);});});}function respondWithStatusCode(_0x84f7f1,_0x5acb7a){_0x5acb7a=_0x5acb7a||0xcc;return function(_0x108d25){if(_0x108d25){return _0x84f7f1[_0x0995('0x21')](_0x5acb7a);}return _0x84f7f1[_0x0995('0x22')](_0x5acb7a)[_0x0995('0x23')]();};}function respondWithResult(_0x47921c,_0x5f2ffd){_0x5f2ffd=_0x5f2ffd||0xc8;return function(_0x348010){if(_0x348010){return _0x47921c[_0x0995('0x22')](_0x5f2ffd)[_0x0995('0x24')](_0x348010);}};}function respondWithFilteredResult(_0x3ffcb1,_0x56d947){return function(_0x15f280){if(_0x15f280){var _0x14577b=typeof _0x56d947[_0x0995('0x25')]==='undefined'&&typeof _0x56d947[_0x0995('0x26')]==='undefined';var _0x220377=_0x15f280[_0x0995('0x27')];var _0x26d6e3=_0x14577b?0x0:_0x56d947['offset'];var _0x49a3fa=_0x14577b?_0x15f280[_0x0995('0x27')]:_0x56d947[_0x0995('0x25')]+_0x56d947[_0x0995('0x26')];var _0x2be15a;if(_0x49a3fa>=_0x220377){_0x49a3fa=_0x220377;_0x2be15a=0xc8;}else{_0x2be15a=0xce;}_0x3ffcb1[_0x0995('0x22')](_0x2be15a);return _0x3ffcb1[_0x0995('0x28')](_0x0995('0x29'),_0x26d6e3+'-'+_0x49a3fa+'/'+_0x220377)['json'](_0x15f280);}return null;};}function saveUpdates(_0x5de0ad){return function(_0x3fb40b){if(_0x3fb40b){return _0x3fb40b[_0x0995('0x2a')](_0x5de0ad)[_0x0995('0x16')](function(_0x19db93){return _0x19db93;});}return null;};}function removeEntity(_0x400264){return function(_0x200edd){if(_0x200edd){return _0x200edd[_0x0995('0x2b')]()['then'](function(){var _0xa6a806=_0x200edd[_0x0995('0x2c')]({'plain':!![]});var _0x2c098e=_0x0995('0x2d');return db['UserProfileResource'][_0x0995('0x2b')]({'where':{'type':_0x2c098e,'resourceId':_0xa6a806['id']}})[_0x0995('0x16')](function(){return _0x200edd;});})[_0x0995('0x16')](function(){_0x400264[_0x0995('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f486b){return function(_0x3520f3){if(!_0x3520f3){_0x3f486b[_0x0995('0x21')](0x194);}return _0x3520f3;};}function handleError(_0x3c5ef3,_0x381d58){_0x381d58=_0x381d58||0x1f4;return function(_0x5518ae){logger[_0x0995('0x1c')](_0x5518ae[_0x0995('0x2e')]);if(_0x5518ae[_0x0995('0x2f')]){delete _0x5518ae['name'];}_0x3c5ef3['status'](_0x381d58)[_0x0995('0x30')](_0x5518ae);};}exports[_0x0995('0x31')]=function(_0x317b58,_0x305ca3){var _0x4cccff={'include':[{'model':db['Pause'],'as':_0x0995('0x32')}]},_0x2b8479={},_0x24546a={'count':0x0,'rows':[]};var _0x27f05b=_[_0x0995('0x33')](db[_0x0995('0x34')][_0x0995('0x35')],function(_0x534c46){return{'name':_0x534c46[_0x0995('0x36')],'type':_0x534c46[_0x0995('0x37')][_0x0995('0x38')]};});_0x2b8479[_0x0995('0x39')]=_[_0x0995('0x33')](_0x27f05b,_0x0995('0x2f'));_0x2b8479['query']=_[_0x0995('0x3a')](_0x317b58['query']);_0x2b8479[_0x0995('0x3b')]=_[_0x0995('0x3c')](_0x2b8479[_0x0995('0x39')],_0x2b8479[_0x0995('0x3d')]);_0x4cccff['attributes']=_[_0x0995('0x3c')](_0x2b8479['model'],qs[_0x0995('0x3e')](_0x317b58[_0x0995('0x3d')]['fields']));_0x4cccff[_0x0995('0x3f')]=_0x4cccff[_0x0995('0x3f')]['length']?_0x4cccff[_0x0995('0x3f')]:_0x2b8479[_0x0995('0x39')];if(!_0x317b58['query'][_0x0995('0x40')](_0x0995('0x41'))){_0x4cccff['limit']=qs['limit'](_0x317b58[_0x0995('0x3d')][_0x0995('0x26')]);_0x4cccff[_0x0995('0x25')]=qs[_0x0995('0x25')](_0x317b58[_0x0995('0x3d')][_0x0995('0x25')]);}_0x4cccff[_0x0995('0x42')]=qs[_0x0995('0x43')](_0x317b58[_0x0995('0x3d')][_0x0995('0x43')]);_0x4cccff[_0x0995('0x44')]=qs[_0x0995('0x3b')](_[_0x0995('0x45')](_0x317b58[_0x0995('0x3d')],_0x2b8479[_0x0995('0x3b')]),_0x27f05b);if(_0x317b58[_0x0995('0x3d')][_0x0995('0x46')]){_0x4cccff['where']=_['merge'](_0x4cccff[_0x0995('0x44')],{'$or':_[_0x0995('0x33')](_0x27f05b,function(_0x3ee820){if(_0x3ee820[_0x0995('0x37')]!==_0x0995('0x47')){var _0x505837={};_0x505837[_0x3ee820[_0x0995('0x2f')]]={'$like':'%'+_0x317b58[_0x0995('0x3d')][_0x0995('0x46')]+'%'};return _0x505837;}})});}_0x4cccff=_[_0x0995('0x48')]({},_0x4cccff,_0x317b58[_0x0995('0x49')]);var _0x4ba46e={'where':_0x4cccff[_0x0995('0x44')]};return db[_0x0995('0x34')][_0x0995('0x27')](_0x4ba46e)[_0x0995('0x16')](function(_0x48465f){_0x24546a[_0x0995('0x27')]=_0x48465f;if(_0x317b58['query'][_0x0995('0x4a')]){_0x4cccff[_0x0995('0x4b')]=[{'all':!![]}];}return db[_0x0995('0x34')][_0x0995('0x4c')](_0x4cccff);})[_0x0995('0x16')](function(_0x2c6ef7){_0x24546a[_0x0995('0x4d')]=_0x2c6ef7;return _0x24546a;})[_0x0995('0x16')](respondWithFilteredResult(_0x305ca3,_0x4cccff))[_0x0995('0x20')](handleError(_0x305ca3,null));};exports[_0x0995('0x4e')]=function(_0x594a60,_0x3dca5b){var _0x1018a7={'raw':![],'where':{'id':_0x594a60[_0x0995('0x4f')]['id']},'include':[{'model':db[_0x0995('0x50')],'as':'mandatoryDispositionPause'}]},_0x237325={};_0x237325[_0x0995('0x39')]=_[_0x0995('0x3a')](db[_0x0995('0x34')][_0x0995('0x35')]);_0x237325[_0x0995('0x3d')]=_[_0x0995('0x3a')](_0x594a60[_0x0995('0x3d')]);_0x237325[_0x0995('0x3b')]=_[_0x0995('0x3c')](_0x237325[_0x0995('0x39')],_0x237325['query']);_0x1018a7['attributes']=_[_0x0995('0x3c')](_0x237325[_0x0995('0x39')],qs[_0x0995('0x3e')](_0x594a60[_0x0995('0x3d')][_0x0995('0x3e')]));_0x1018a7[_0x0995('0x3f')]=_0x1018a7['attributes'][_0x0995('0x51')]?_0x1018a7[_0x0995('0x3f')]:_0x237325[_0x0995('0x39')];if(_0x594a60[_0x0995('0x3d')][_0x0995('0x4a')]){_0x1018a7[_0x0995('0x4b')]=[{'all':!![]}];}_0x1018a7=_['merge']({},_0x1018a7,_0x594a60[_0x0995('0x49')]);return db['ChatWebsite'][_0x0995('0x52')](_0x1018a7)[_0x0995('0x16')](handleEntityNotFound(_0x3dca5b,null))[_0x0995('0x16')](respondWithResult(_0x3dca5b,null))[_0x0995('0x20')](handleError(_0x3dca5b,null));};exports[_0x0995('0x53')]=function(_0x2373d3,_0x19d94c){return db[_0x0995('0x34')][_0x0995('0x53')](_0x2373d3[_0x0995('0x54')],{})[_0x0995('0x16')](function(_0x41b103){var _0x237f8e=_0x2373d3[_0x0995('0x55')]['get']({'plain':!![]});if(!_0x237f8e)throw new Error(_0x0995('0x56'));if(_0x237f8e[_0x0995('0x57')]==='user'){var _0x3c2fe6=_0x41b103['get']({'plain':!![]});var _0x25b142=_0x0995('0x2d');return db[_0x0995('0x58')][_0x0995('0x52')]({'where':{'name':_0x25b142,'userProfileId':_0x237f8e[_0x0995('0x59')]},'raw':!![]})[_0x0995('0x16')](function(_0x5effb4){if(_0x5effb4&&_0x5effb4[_0x0995('0x5a')]===0x0){return db[_0x0995('0x5b')][_0x0995('0x53')]({'name':_0x3c2fe6[_0x0995('0x2f')],'resourceId':_0x3c2fe6['id'],'type':_0x5effb4[_0x0995('0x2f')],'sectionId':_0x5effb4['id']},{})[_0x0995('0x16')](function(){return _0x41b103;});}else{return _0x41b103;}})[_0x0995('0x20')](function(_0x35044b){logger['error'](_0x0995('0x5c'),_0x35044b);throw _0x35044b;});}return _0x41b103;})[_0x0995('0x16')](respondWithResult(_0x19d94c,0xc9))[_0x0995('0x20')](handleError(_0x19d94c,null));};exports[_0x0995('0x2a')]=function(_0x1cc08c,_0x447802){if(_0x1cc08c[_0x0995('0x54')]['id']){delete _0x1cc08c[_0x0995('0x54')]['id'];}return db[_0x0995('0x34')]['find']({'where':{'id':_0x1cc08c[_0x0995('0x4f')]['id']},'include':[{'model':db[_0x0995('0x50')],'as':_0x0995('0x32')}]})[_0x0995('0x16')](handleEntityNotFound(_0x447802,null))[_0x0995('0x16')](saveUpdates(_0x1cc08c[_0x0995('0x54')],null))[_0x0995('0x16')](respondWithResult(_0x447802,null))[_0x0995('0x20')](handleError(_0x447802,null));};exports[_0x0995('0x2b')]=function(_0x41b301,_0x222bde){return db['ChatWebsite'][_0x0995('0x52')]({'where':{'id':_0x41b301['params']['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x222bde,null))[_0x0995('0x16')](removeEntity(_0x222bde,null))['catch'](handleError(_0x222bde,null));};exports[_0x0995('0x5d')]=function(_0x320dfc,_0x3e0f77){return db[_0x0995('0x34')]['describe']()[_0x0995('0x16')](respondWithResult(_0x3e0f77,null))['catch'](handleError(_0x3e0f77,null));};exports[_0x0995('0x5e')]=function(_0x3c3a3e,_0x4bfb98){if(_0x3c3a3e['body']['id']){delete _0x3c3a3e['body']['id'];}return db[_0x0995('0x34')]['find']({'where':{'id':_0x3c3a3e[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x4bfb98,null))[_0x0995('0x16')](function(_0x19d4ee){if(_0x19d4ee){_0x3c3a3e['body'][_0x0995('0x5f')]=_0x19d4ee['id'];return db[_0x0995('0x60')][_0x0995('0x53')](_0x3c3a3e[_0x0995('0x54')]);}})[_0x0995('0x16')](respondWithResult(_0x4bfb98,null))['catch'](handleError(_0x4bfb98,null));};exports['getDispositions']=function(_0x38f5bb,_0x45872d){var _0x46b1de={'raw':![],'where':{}};var _0x54b7d7={};var _0x53bba2={'count':0x0,'rows':[]};return db[_0x0995('0x34')][_0x0995('0x61')]({'where':{'id':_0x38f5bb[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x45872d,null))['then'](function(_0x55e6c2){if(_0x55e6c2){_0x54b7d7[_0x0995('0x39')]=_['keys'](db[_0x0995('0x60')][_0x0995('0x35')]);_0x54b7d7[_0x0995('0x3d')]=_[_0x0995('0x3a')](_0x38f5bb[_0x0995('0x3d')]);_0x54b7d7[_0x0995('0x3b')]=_['intersection'](_0x54b7d7[_0x0995('0x39')],_0x54b7d7[_0x0995('0x3d')]);_0x46b1de[_0x0995('0x3f')]=_['intersection'](_0x54b7d7[_0x0995('0x39')],qs[_0x0995('0x3e')](_0x38f5bb[_0x0995('0x3d')]['fields']));_0x46b1de[_0x0995('0x3f')]=_0x46b1de[_0x0995('0x3f')][_0x0995('0x51')]?_0x46b1de[_0x0995('0x3f')]:_0x54b7d7[_0x0995('0x39')];if(!_0x38f5bb[_0x0995('0x3d')][_0x0995('0x40')](_0x0995('0x41'))){_0x46b1de[_0x0995('0x26')]=qs[_0x0995('0x26')](_0x38f5bb[_0x0995('0x3d')][_0x0995('0x26')]);_0x46b1de[_0x0995('0x25')]=qs[_0x0995('0x25')](_0x38f5bb['query'][_0x0995('0x25')]);}_0x46b1de['order']=qs[_0x0995('0x43')](_0x38f5bb[_0x0995('0x3d')][_0x0995('0x43')]);_0x46b1de[_0x0995('0x44')]=qs[_0x0995('0x3b')](_[_0x0995('0x45')](_0x38f5bb[_0x0995('0x3d')],_0x54b7d7['filters']));_0x46b1de[_0x0995('0x44')]['ChatWebsiteId']=_0x55e6c2['id'];if(_0x38f5bb['query'][_0x0995('0x46')]){_0x46b1de[_0x0995('0x44')]=_['merge'](_0x46b1de[_0x0995('0x44')],{'$or':_[_0x0995('0x33')](_0x46b1de[_0x0995('0x3f')],function(_0xc66e13){var _0xea61a={};_0xea61a[_0xc66e13]={'$like':'%'+_0x38f5bb[_0x0995('0x3d')]['filter']+'%'};return _0xea61a;})});}_0x46b1de=_['merge']({},_0x46b1de,_0x38f5bb[_0x0995('0x49')]);return db['Disposition'][_0x0995('0x27')]({'where':_0x46b1de['where']})['then'](function(_0x77daf9){_0x53bba2[_0x0995('0x27')]=_0x77daf9;if(_0x38f5bb[_0x0995('0x3d')][_0x0995('0x4a')]){_0x46b1de[_0x0995('0x4b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x46b1de);})[_0x0995('0x16')](function(_0x4bfca1){_0x53bba2[_0x0995('0x4d')]=_0x4bfca1;return _0x53bba2;});}})[_0x0995('0x16')](respondWithFilteredResult(_0x45872d,_0x46b1de))[_0x0995('0x20')](handleError(_0x45872d,null));};exports[_0x0995('0x62')]=function(_0x327d4,_0x16a93){return db[_0x0995('0x34')][_0x0995('0x52')]({'where':{'id':_0x327d4['params']['id']}})['then'](handleEntityNotFound(_0x16a93,null))[_0x0995('0x16')](function(_0xa6b847){if(_0xa6b847){return _0xa6b847[_0x0995('0x62')](_0x327d4[_0x0995('0x3d')][_0x0995('0x63')]);}})[_0x0995('0x16')](respondWithStatusCode(_0x16a93,null))[_0x0995('0x20')](handleError(_0x16a93,null));};exports[_0x0995('0x64')]=function(_0x4e86fe,_0x17b7e2){if(_0x4e86fe[_0x0995('0x54')]['id']){delete _0x4e86fe[_0x0995('0x54')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4e86fe[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x17b7e2,null))[_0x0995('0x16')](function(_0x5434b9){if(_0x5434b9){_0x4e86fe[_0x0995('0x54')]['ChatWebsiteId']=_0x5434b9['id'];return db[_0x0995('0x65')]['create'](_0x4e86fe[_0x0995('0x54')]);}})[_0x0995('0x16')](respondWithResult(_0x17b7e2,null))[_0x0995('0x20')](handleError(_0x17b7e2,null));};exports[_0x0995('0x66')]=function(_0x314c51,_0xf29715){var _0x25c44c={'raw':![],'where':{}};var _0x1e116f={};var _0x43cbaf={'count':0x0,'rows':[]};return db[_0x0995('0x34')][_0x0995('0x61')]({'where':{'id':_0x314c51[_0x0995('0x4f')]['id']}})['then'](handleEntityNotFound(_0xf29715,null))[_0x0995('0x16')](function(_0x11a9c4){if(_0x11a9c4){_0x1e116f['model']=_[_0x0995('0x3a')](db[_0x0995('0x65')][_0x0995('0x35')]);_0x1e116f[_0x0995('0x3d')]=_['keys'](_0x314c51[_0x0995('0x3d')]);_0x1e116f[_0x0995('0x3b')]=_[_0x0995('0x3c')](_0x1e116f[_0x0995('0x39')],_0x1e116f[_0x0995('0x3d')]);_0x25c44c[_0x0995('0x3f')]=_[_0x0995('0x3c')](_0x1e116f[_0x0995('0x39')],qs['fields'](_0x314c51[_0x0995('0x3d')][_0x0995('0x3e')]));_0x25c44c['attributes']=_0x25c44c[_0x0995('0x3f')][_0x0995('0x51')]?_0x25c44c['attributes']:_0x1e116f['model'];if(!_0x314c51[_0x0995('0x3d')]['hasOwnProperty'](_0x0995('0x41'))){_0x25c44c['limit']=qs[_0x0995('0x26')](_0x314c51['query'][_0x0995('0x26')]);_0x25c44c[_0x0995('0x25')]=qs[_0x0995('0x25')](_0x314c51[_0x0995('0x3d')][_0x0995('0x25')]);}_0x25c44c[_0x0995('0x42')]=qs[_0x0995('0x43')](_0x314c51[_0x0995('0x3d')]['sort']);_0x25c44c[_0x0995('0x44')]=qs['filters'](_[_0x0995('0x45')](_0x314c51['query'],_0x1e116f['filters']));_0x25c44c[_0x0995('0x44')][_0x0995('0x5f')]=_0x11a9c4['id'];if(_0x314c51[_0x0995('0x3d')][_0x0995('0x46')]){_0x25c44c[_0x0995('0x44')]=_[_0x0995('0x48')](_0x25c44c[_0x0995('0x44')],{'$or':_[_0x0995('0x33')](_0x25c44c[_0x0995('0x3f')],function(_0x1a322b){var _0x233ccb={};_0x233ccb[_0x1a322b]={'$like':'%'+_0x314c51['query'][_0x0995('0x46')]+'%'};return _0x233ccb;})});}_0x25c44c=_['merge']({},_0x25c44c,_0x314c51[_0x0995('0x49')]);return db[_0x0995('0x65')][_0x0995('0x27')]({'where':_0x25c44c[_0x0995('0x44')]})[_0x0995('0x16')](function(_0x4c09bf){_0x43cbaf[_0x0995('0x27')]=_0x4c09bf;if(_0x314c51[_0x0995('0x3d')][_0x0995('0x4a')]){_0x25c44c[_0x0995('0x4b')]=[{'all':!![]}];}return db[_0x0995('0x65')][_0x0995('0x4c')](_0x25c44c);})[_0x0995('0x16')](function(_0x603637){_0x43cbaf[_0x0995('0x4d')]=_0x603637;return _0x43cbaf;});}})[_0x0995('0x16')](respondWithFilteredResult(_0xf29715,_0x25c44c))[_0x0995('0x20')](handleError(_0xf29715,null));};exports[_0x0995('0x67')]=function(_0x84db20,_0x1b373e){return db[_0x0995('0x34')][_0x0995('0x52')]({'where':{'id':_0x84db20[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x1b373e,null))[_0x0995('0x16')](function(_0x309909){if(_0x309909){return _0x309909[_0x0995('0x67')](_0x84db20[_0x0995('0x3d')][_0x0995('0x63')]);}})[_0x0995('0x16')](respondWithStatusCode(_0x1b373e,null))[_0x0995('0x20')](handleError(_0x1b373e,null));};exports[_0x0995('0x68')]=function(_0x719b84,_0x19e8ba){_0x719b84['body'][_0x0995('0x69')]=_0x719b84[_0x0995('0x6a')]['filename'];return db[_0x0995('0x34')][_0x0995('0x52')]({'where':{'id':_0x719b84['params']['id']}})['then'](handleEntityNotFound(_0x19e8ba,null))[_0x0995('0x16')](saveUpdates(_0x719b84[_0x0995('0x54')],null))['then'](respondWithResult(_0x19e8ba,null))[_0x0995('0x20')](handleError(_0x19e8ba,null));};exports[_0x0995('0x6b')]=function(_0x117b55,_0xf898f4){_0x117b55[_0x0995('0x54')][_0x0995('0x6c')]=_0x117b55[_0x0995('0x6a')][_0x0995('0x6d')];return db[_0x0995('0x34')][_0x0995('0x52')]({'where':{'id':_0x117b55[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0xf898f4,null))[_0x0995('0x16')](saveUpdates(_0x117b55[_0x0995('0x54')],null))[_0x0995('0x16')](respondWithResult(_0xf898f4,null))[_0x0995('0x20')](handleError(_0xf898f4,null));};exports['addCustomerAvatar']=function(_0x40ccf7,_0x2846a9){_0x40ccf7['body'][_0x0995('0x6e')]=_0x40ccf7[_0x0995('0x6a')]['filename'];return db[_0x0995('0x34')][_0x0995('0x52')]({'where':{'id':_0x40ccf7[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x2846a9,null))[_0x0995('0x16')](saveUpdates(_0x40ccf7['body'],null))[_0x0995('0x16')](respondWithResult(_0x2846a9,null))[_0x0995('0x20')](handleError(_0x2846a9,null));};exports[_0x0995('0x6f')]=function(_0xe48eb3,_0x381bf4){_0xe48eb3[_0x0995('0x54')][_0x0995('0x70')]=_0xe48eb3[_0x0995('0x6a')]['filename'];return db[_0x0995('0x34')][_0x0995('0x52')]({'where':{'id':_0xe48eb3[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x381bf4,null))[_0x0995('0x16')](saveUpdates(_0xe48eb3['body'],null))[_0x0995('0x16')](respondWithResult(_0x381bf4,null))[_0x0995('0x20')](handleError(_0x381bf4,null));};exports[_0x0995('0x71')]=function(_0x2fff47,_0x496b8f){var _0x33a09a=path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0x74'));var _0xa19a33={'where':{'id':_0x2fff47[_0x0995('0x4f')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2f6458=![];return require(_0x0995('0x75'))[_0x0995('0x76')]()['then'](function(_0x652703){if(_0x652703){_0x2f6458=_0x652703['custom'];}})[_0x0995('0x16')](function(){return db[_0x0995('0x34')][_0x0995('0x52')](_0xa19a33);})[_0x0995('0x16')](handleEntityNotFound(_0x496b8f,null))[_0x0995('0x16')](function(_0xcb7400){if(_0xcb7400){if(!_[_0x0995('0x77')](_0xcb7400[_0x0995('0x69')])){if(fs['existsSync'](path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0x78'),_0xcb7400[_0x0995('0x69')]))&&_0x2f6458){_0x33a09a=path[_0x0995('0x72')](config[_0x0995('0x73')],'server/files/images/logos/',_0xcb7400['sitepic']);}}return _0x496b8f[_0x0995('0x79')](_0x33a09a);}})[_0x0995('0x20')](handleError(_0x496b8f,null));};exports[_0x0995('0x7a')]=function(_0x31434d,_0x230247){var _0x45df16=path['join'](config[_0x0995('0x73')],_0x0995('0x7b'));var _0x4795b6={'where':{'id':_0x31434d[_0x0995('0x4f')]['id']},'attributes':['id',_0x0995('0x6c')],'raw':!![]};return db[_0x0995('0x34')][_0x0995('0x52')](_0x4795b6)[_0x0995('0x16')](handleEntityNotFound(_0x230247,null))[_0x0995('0x16')](function(_0x4f8118){if(_0x4f8118){if(!_[_0x0995('0x77')](_0x4f8118['agentAvatar'])){if(fs[_0x0995('0x7c')](path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0x7d'),_0x4f8118[_0x0995('0x6c')]))){_0x45df16=path[_0x0995('0x72')](config[_0x0995('0x73')],'server/files/images/avatars/',_0x4f8118[_0x0995('0x6c')]);}}return _0x230247[_0x0995('0x79')](_0x45df16);}})['catch'](handleError(_0x230247,null));};exports[_0x0995('0x7e')]=function(_0x4583f0,_0x503556){var _0x19908c=path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0x7f'));var _0x3b2029={'where':{'id':_0x4583f0[_0x0995('0x4f')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x0995('0x52')](_0x3b2029)[_0x0995('0x16')](handleEntityNotFound(_0x503556,null))[_0x0995('0x16')](function(_0x2418b0){if(_0x2418b0){if(!_['isNil'](_0x2418b0[_0x0995('0x6e')])){if(fs[_0x0995('0x7c')](path['join'](config[_0x0995('0x73')],_0x0995('0x7d'),_0x2418b0[_0x0995('0x6e')]))&&_0x2418b0[_0x0995('0x80')]){_0x19908c=path[_0x0995('0x72')](config[_0x0995('0x73')],'server/files/images/avatars/',_0x2418b0['customerAvatar']);}}return _0x503556[_0x0995('0x79')](_0x19908c);}})[_0x0995('0x20')](handleError(_0x503556,null));};exports[_0x0995('0x81')]=function(_0x50f258,_0x40fa93){var _0x430e4b=path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0x82'));var _0x3db31f={'where':{'id':_0x50f258[_0x0995('0x4f')]['id']},'attributes':['id',_0x0995('0x70')],'raw':!![]};return db[_0x0995('0x34')][_0x0995('0x52')](_0x3db31f)[_0x0995('0x16')](handleEntityNotFound(_0x40fa93,null))[_0x0995('0x16')](function(_0x301761){if(_0x301761){if(!_[_0x0995('0x77')](_0x301761[_0x0995('0x70')])){if(fs[_0x0995('0x7c')](path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0x7d'),_0x301761[_0x0995('0x70')]))){_0x430e4b=path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0x7d'),_0x301761['systemAvatar']);}}return _0x40fa93[_0x0995('0x79')](_0x430e4b);}})['catch'](handleError(_0x40fa93,null));};exports[_0x0995('0x83')]=function(_0x488c95,_0x1fa5e3){var _0x152c80=require(_0x0995('0x84'));var _0x3b89d3=new _0x152c80();var _0x1310e8=_0x3b89d3[_0x0995('0x85')](_0x488c95['headers'][_0x0995('0x86')])[_0x0995('0x87')]();var _0x40dc48={'body':_0x488c95[_0x0995('0x54')],'channel':_0x0995('0x88')};var _0x52477b=[];var _0x3cac0f=[];var _0x482f59={};var _0x16620a=![];return db[_0x0995('0x89')][_0x0995('0x5d')]()['then'](function(_0x380972){if(!_0x380972){throw new db[(_0x0995('0x8a'))][(_0x0995('0x8b'))](_0x0995('0x8c'));}_0x52477b=_[_0x0995('0x8d')](_['keys'](_0x380972),[_0x0995('0x8e'),_0x0995('0x8f')]);_0x3cac0f=_['difference'](_[_0x0995('0x3a')](_0x380972),[_0x0995('0x8e'),_0x0995('0x8f'),'CompanyId','ListId']);if(_0x488c95[_0x0995('0x54')]['id']){delete _0x488c95[_0x0995('0x54')]['id'];}if(_[_0x0995('0x77')](_0x488c95[_0x0995('0x54')][_0x0995('0x90')])){throw new db[(_0x0995('0x8a'))][(_0x0995('0x8b'))]('from\x20is\x20mandatory');}if(_[_0x0995('0x77')](_0x488c95[_0x0995('0x54')][_0x0995('0x54')])||_0x488c95[_0x0995('0x54')][_0x0995('0x54')]===''){throw new db[(_0x0995('0x8a'))][(_0x0995('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x488c95[_0x0995('0x54')][_0x0995('0x91')])){throw new db[(_0x0995('0x8a'))][(_0x0995('0x8b'))](_0x0995('0x92')+_0x3cac0f);}if(!_[_0x0995('0x93')](_0x3cac0f,_0x488c95[_0x0995('0x54')][_0x0995('0x91')])){throw new db[(_0x0995('0x8a'))][(_0x0995('0x8b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3cac0f);}_0x482f59[_0x488c95[_0x0995('0x54')][_0x0995('0x91')]]=_0x488c95[_0x0995('0x54')]['from'];})[_0x0995('0x16')](function(){return db[_0x0995('0x34')]['find']({'where':{'id':_0x488c95['params']['id']},'include':[{'model':db[_0x0995('0x94')],'as':_0x0995('0x95'),'include':[{'model':db['CmContact'],'as':_0x0995('0x96'),'where':_0x482f59,'limit':0x1,'order':[['updatedAt',_0x0995('0x97')]]}]},{'model':db[_0x0995('0x98')],'as':_0x0995('0x99')}]});})[_0x0995('0x16')](handleEntityNotFound(_0x1fa5e3,null))[_0x0995('0x16')](function(_0x1b56a5){if(_0x1b56a5&&_0x1b56a5[_0x0995('0x95')]){_0x40dc48[_0x0995('0x9a')]=_0x1b56a5;_0x40dc48['applications']=_0x1b56a5[_0x0995('0x99')];_0x40dc48['list']=_0x1b56a5[_0x0995('0x95')];_0x40dc48['applications']=_['orderBy'](_0x40dc48[_0x0995('0x9b')],[_0x0995('0x9c')],[_0x0995('0x9d')]);if(_0x40dc48[_0x0995('0x9a')][_0x0995('0x99')]){delete _0x40dc48['account'][_0x0995('0x99')];}if(_0x40dc48[_0x0995('0x9a')]['List']&&_0x40dc48[_0x0995('0x9a')]['List'][_0x0995('0x96')]['length']){return _0x40dc48['account']['List'][_0x0995('0x96')][0x0];}var _0x44d2a4=_[_0x0995('0xb')](_0x488c95[_0x0995('0x54')],{'firstName':_0x488c95['body']['from'],'ListId':_0x1b56a5[_0x0995('0x9e')]});_0x44d2a4[_0x488c95['body']['mapKey']]=_0x488c95[_0x0995('0x54')][_0x0995('0x90')];return db[_0x0995('0x89')][_0x0995('0x53')](_0x44d2a4,{'fields':_0x52477b,'raw':!![]});}})['then'](handleEntityNotFound(_0x1fa5e3,null))[_0x0995('0x16')](function(_0x4310c8){_0x40dc48[_0x0995('0x9f')]=_0x4310c8;var _0x9ae2a0=_0x488c95['body'][_0x0995('0xa0')];if(_0x488c95[_0x0995('0xa1')][_0x0995('0xa2')]){_0x9ae2a0=_0x488c95['headers']['cf-connecting-ip'];}else if(_0x488c95['headers'][_0x0995('0xa3')]){_0x9ae2a0=_[_0x0995('0xa4')](_0x488c95[_0x0995('0xa1')]['x-forwarded-for'][_0x0995('0xa5')](','));}if(_0x4310c8){var _0x9f2a71={'ContactId':_0x4310c8['id'],'ChatWebsiteId':_0x488c95[_0x0995('0x4f')]['id'],'from':(_0x4310c8[_0x0995('0xa6')]||'')+'\x20'+(_0x4310c8[_0x0995('0xa7')]||''),'customerIp':_0x9ae2a0,'customerPort':_0x488c95[_0x0995('0xa1')]['x-real-port']?_0x488c95[_0x0995('0xa1')][_0x0995('0xa8')]:null,'referer':_0x488c95[_0x0995('0x54')][_0x0995('0xa9')],'browserName':_0x1310e8[_0x0995('0xaa')][_0x0995('0x2f')]&&_0x1310e8[_0x0995('0xaa')][_0x0995('0xab')]?util[_0x0995('0xac')](_0x0995('0xad'),_0x1310e8[_0x0995('0xaa')][_0x0995('0x2f')],_0x1310e8[_0x0995('0xaa')][_0x0995('0xab')]):_0x0995('0xae'),'browserVersion':_0x1310e8[_0x0995('0xaa')][_0x0995('0xab')]||'unknown','osName':util['format'](_0x0995('0xad'),_0x1310e8['os'][_0x0995('0x2f')],_0x1310e8['os'][_0x0995('0xab')]),'osVersion':_0x1310e8['os']['version'],'deviceModel':_0x1310e8[_0x0995('0xaf')][_0x0995('0x39')]&&_0x1310e8['device'][_0x0995('0xb0')]?util[_0x0995('0xac')](_0x0995('0xb1'),_0x1310e8[_0x0995('0xaf')][_0x0995('0x39')],_0x1310e8['device']['vendor'],_0x1310e8['device'][_0x0995('0x37')]):null,'deviceVendor':_0x1310e8[_0x0995('0xaf')]['vendor'],'deviceType':_0x1310e8['device']['type'],'formData':JSON[_0x0995('0xb2')](_0x488c95[_0x0995('0x54')])};var _0x399870={'ChatWebsiteId':_0x488c95[_0x0995('0x4f')]['id'],'closed':![]};if(_0x488c95[_0x0995('0x54')][_0x0995('0xb3')]){_0x399870[_0x0995('0xb3')]=_0x488c95[_0x0995('0x54')]['threadId'];return db[_0x0995('0xb4')][_0x0995('0x52')]({'where':_0x399870})['then'](function(_0x4734ec){if(_0x4734ec){return[_0x4734ec,![]];}_0x9f2a71['threadId']=_0x488c95[_0x0995('0x54')][_0x0995('0xb3')];_0x9f2a71[_0x0995('0xb5')]=_0x488c95[_0x0995('0x54')]['externalUrl'];return db[_0x0995('0xb4')][_0x0995('0x53')](_0x9f2a71)[_0x0995('0x16')](function(_0x244380){return[_0x244380,!![]];});});}_0x399870[_0x0995('0xb6')]=_0x4310c8['id'];if(_0x488c95[_0x0995('0x54')]['interaction']&&_0x488c95[_0x0995('0x54')]['interaction']['id']){_0x399870['id']=_0x488c95[_0x0995('0x54')]['interaction']['id'];return db[_0x0995('0xb4')]['find']({'where':_0x399870})[_0x0995('0x16')](function(_0x21c255){if(_0x21c255){return[_0x21c255,![]];}return db[_0x0995('0xb4')][_0x0995('0x53')](_0x9f2a71)['then'](function(_0x4f448c){return[_0x4f448c,!![]];});});}return db[_0x0995('0xb4')][_0x0995('0x53')](_0x9f2a71)[_0x0995('0x16')](function(_0x4c05ba){return[_0x4c05ba,!![]];});}})[_0x0995('0xb7')](function(_0x5d73c6,_0x449498){if(_0x5d73c6){_0x16620a=_0x449498;if(!_0x449498){var _0x151679={'from':(_0x40dc48[_0x0995('0x9f')]['firstName']||'')+'\x20'+(_0x40dc48[_0x0995('0x9f')][_0x0995('0xa7')]||'')};if(_0x488c95[_0x0995('0x54')][_0x0995('0xb3')]&&_0x488c95[_0x0995('0x54')]['messageId']&&_0x488c95[_0x0995('0x54')][_0x0995('0xb3')]!=_0x488c95['body'][_0x0995('0xb8')]){_0x151679[_0x0995('0xb3')]=_0x488c95['body'][_0x0995('0xb8')];}return _0x5d73c6['update'](_0x151679);}else{return _0x5d73c6;}}})[_0x0995('0x16')](function(_0x6ce0d1){_0x40dc48['interaction']=_0x6ce0d1[_0x0995('0x2c')]({'plain':!![]});_0x40dc48[_0x0995('0xb9')][_0x0995('0xba')]=_0x16620a;if(_0x40dc48['interaction']['created']){if(_0x40dc48['account']['autoclose']){_0x40dc48[_0x0995('0x9b')][_0x0995('0xbb')]({'id':0x0,'priority':_0x40dc48[_0x0995('0x9b')][_0x0995('0x51')]+0x1,'app':_0x0995('0xbc'),'appdata':_0x0995('0xbd'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x0995('0x53')]({'body':_0x488c95[_0x0995('0x54')][_0x0995('0x54')],'ChatWebsiteId':_0x488c95[_0x0995('0x4f')]['id'],'ChatInteractionId':_0x6ce0d1['id'],'direction':'in','ContactId':_0x40dc48[_0x0995('0x9f')]['id'],'AttachmentId':_0x488c95['body']['AttachmentId']});})[_0x0995('0x16')](function(_0xb0953e){_0x40dc48['message']=_0xb0953e;if(_0x40dc48['interaction'][_0x0995('0xbe')]){return db[_0x0995('0xbf')][_0x0995('0x52')]({'attributes':['id','name'],'where':{'id':_0x40dc48[_0x0995('0xb9')][_0x0995('0xbe')]}})[_0x0995('0x16')](function(_0x5a3606){if(_0x5a3606){_0x40dc48[_0x0995('0x9b')][_0x0995('0xc0')]({'id':0x0,'priority':0x0,'app':_0x0995('0xc1'),'appdata':_0x5a3606['name']+','+(_0x40dc48[_0x0995('0x9a')][_0x0995('0xc2')]||0xa),'interval':'*,*,*,*'});_0x40dc48[_0x0995('0xc3')]=!![];}return respondWithRpcPromise(_0x0995('0xc4'),'startRouting',_0x40dc48);});}return respondWithRpcPromise(_0x0995('0xc4'),_0x0995('0xc5'),_0x40dc48);})[_0x0995('0x16')](function(_0x443d23){respondWithRpcPromise(_0x0995('0xc6'),_0x0995('0xc6'),{'event':'notify','message':_0x443d23},client9002);return _0x443d23;})[_0x0995('0x16')](respondWithResult(_0x1fa5e3,null))[_0x0995('0x20')](handleError(_0x1fa5e3,null));};exports[_0x0995('0xc7')]=function(_0x3f021,_0x439a0e){var _0x44d02f,_0x505e47,_0x51f60d;var _0x5a6b3c=[];var _0x491704={};var _0x1eaa0a=_0x3f021[_0x0995('0xc8')]||[];var _0x562a5c=[];var _0x5ad9f1;return db['CmContact'][_0x0995('0x5d')]()[_0x0995('0x16')](function(_0x31dc3c){if(!_0x31dc3c){throw new db[(_0x0995('0x8a'))][(_0x0995('0x8b'))]('no\x20available\x20attributes');}_0x5a6b3c=_[_0x0995('0x8d')](_[_0x0995('0x3a')](_0x31dc3c),[_0x0995('0x8e'),_0x0995('0x8f'),_0x0995('0xc9'),_0x0995('0x9e')]);if(_0x3f021[_0x0995('0x54')]['id']){delete _0x3f021[_0x0995('0x54')]['id'];}if(_[_0x0995('0x77')](_0x3f021[_0x0995('0x54')][_0x0995('0x90')])){throw _0x439a0e[_0x0995('0x22')](0x1f4)[_0x0995('0x30')](new db['Sequelize']['ValidationError'](_0x0995('0xca')));}if(_['isNil'](_0x3f021[_0x0995('0x54')][_0x0995('0x54')])||_0x3f021['body']['body']===''){throw _0x439a0e['status'](0x1f4)['send'](new db['Sequelize'][(_0x0995('0x8b'))](_0x0995('0xcb')));}if(_[_0x0995('0x77')](_0x3f021[_0x0995('0x54')][_0x0995('0xcc')])){throw _0x439a0e[_0x0995('0x22')](0x1f4)[_0x0995('0x30')](new db[(_0x0995('0x8a'))][(_0x0995('0x8b'))](_0x0995('0xcd')+_0x5a6b3c));}if(!_[_0x0995('0x93')](_0x5a6b3c,_0x3f021[_0x0995('0x54')]['mapKeyOffline'])){throw _0x439a0e[_0x0995('0x22')](0x1f4)[_0x0995('0x30')](new db[(_0x0995('0x8a'))][(_0x0995('0x8b'))](_0x0995('0xce')+_0x5a6b3c));}_0x491704[_0x3f021[_0x0995('0x54')][_0x0995('0xcc')]]=_0x3f021[_0x0995('0x54')][_0x0995('0x90')];})[_0x0995('0x16')](function(){return db['ChatWebsite'][_0x0995('0x52')]({'where':{'id':_0x3f021['params']['id']},'include':[{'model':db['CmList'],'as':_0x0995('0x95')},{'model':db[_0x0995('0xcf')],'as':_0x0995('0xcf')}]});})['then'](handleEntityNotFound(_0x439a0e,null))[_0x0995('0x16')](function(_0x5a0b7d){if(_0x5a0b7d&&_0x5a0b7d[_0x0995('0x95')]){_0x505e47=_0x5a0b7d;var _0x28cfd1=_[_0x0995('0xb')](_0x3f021[_0x0995('0x54')],{'firstName':_0x3f021['body'][_0x0995('0x90')],'phone':_0x3f021['body'][_0x0995('0x90')],'ListId':_0x5a0b7d[_0x0995('0x9e')]});_0x28cfd1[_0x3f021[_0x0995('0x54')]['mapKeyOffline']]=_0x3f021['body'][_0x0995('0x90')];return db[_0x0995('0x89')][_0x0995('0xd0')]({'where':_0x491704,'defaults':_0x28cfd1});}})['spread'](function(_0x2ad27e){if(_0x2ad27e){_0x51f60d=_0x2ad27e;var _0x2aee0c=fs[_0x0995('0xd1')](path['join'](config['root'],_0x0995('0xd2')),_0x0995('0xd3'));var _0x198387=ejs[_0x0995('0xd4')](_0x2aee0c,{'body':_[_0x0995('0xd5')](_0x3f021[_0x0995('0x54')][_0x0995('0x54')]),'bodyTitle':_0x505e47[_0x0995('0xd6')]});return db[_0x0995('0xd7')][_0x0995('0x53')]({'body':_0x198387,'plainBody':htmlToText['fromString'](_0x198387),'ContactId':_0x2ad27e['id'],'ChatWebsiteId':_0x505e47['id']});}})[_0x0995('0x16')](function(_0x41438f){_0x5ad9f1=_0x41438f;if(_0x1eaa0a[_0x0995('0x51')]){var _0x9f5865=_0x1eaa0a[_0x0995('0x33')](function(_0x32fed7){return{'name':_0x32fed7[_0x0995('0xd8')],'basename':_0x32fed7[_0x0995('0x6d')],'type':_0x32fed7[_0x0995('0xd9')],'ChatOfflineMessageId':_0x41438f['id']};});_0x562a5c=_0x9f5865[_0x0995('0x33')](_0x377a07=>{var _0x31adc3={'filename':_0x377a07['name'],'path':path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0xda'),_0x0995('0xc8'),_0x0995('0xdb'),_0x0995('0xdc'),_0x377a07[_0x0995('0xdd')])};return _0x31adc3;});if(!_0x505e47[_0x0995('0xde')]){return db[_0x0995('0xdf')]['transaction'](function(_0xa81b73){return db[_0x0995('0xe0')]['bulkCreate'](_0x9f5865,{'transaction':_0xa81b73});});}}})[_0x0995('0x16')](function(){if(_0x5ad9f1){_0x44d02f=_0x5ad9f1;return db[_0x0995('0xcf')][_0x0995('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0x0995('0xe1')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x0995('0xe2'),'raw':!![]}]}]});}})[_0x0995('0x16')](function(_0x258932){if(_0x258932&&_0x258932[_0x0995('0xe3')]&&_0x505e47[_0x0995('0xe4')]&&_0x505e47[_0x0995('0xe5')]){var _0x4f6e41=_0x258932[_0x0995('0xe6')]();return respondWithRpcPromise('SendMail',_0x0995('0xe7'),{'account':_0x4f6e41,'message':{'from':util[_0x0995('0xac')](_0x0995('0xe8'),_0x258932[_0x0995('0x2f')],_0x258932[_0x0995('0xe9')]||_0x258932[_0x0995('0xe3')]['user']),'to':_0x505e47[_0x0995('0xe5')],'subject':_0x505e47[_0x0995('0xea')],'html':_0x44d02f[_0x0995('0x54')],'attachments':_0x562a5c}},client9003)[_0x0995('0x16')](function(){return _0x44d02f;})['catch'](function(_0x1c3abf){logger[_0x0995('0x1c')](_0x1c3abf);});}})[_0x0995('0x16')](function(){if(_0x505e47&&_0x505e47[_0x0995('0xde')]&&_0x505e47[_0x0995('0xeb')]){var _0x59a52a=[];if(_0x1eaa0a[_0x0995('0x51')]){_0x59a52a=_0x1eaa0a[_0x0995('0x33')](function(_0x3c12e7){return{'name':_0x3c12e7['originalname'],'basename':_0x3c12e7['filename'],'type':_0x3c12e7[_0x0995('0xd9')],'ChatOfflineMessageId':_0x5ad9f1['id']};});}var _0x7f0308;if(!_['isNil'](_0x505e47[_0x0995('0xec')])){var _0x65d8e4=_[_0x0995('0x33')](_0x3f021[_0x0995('0x54')],function(_0x4133ca){return _0x4133ca;});var _0x45733e=_[_0x0995('0xed')](_0x65d8e4)[0x0];var _0x3bc86f=_['mapValues'](_0x45733e,function(_0x232b54){return _0x232b54;});_0x7f0308=_0x3bc86f[0x1][_0x505e47[_0x0995('0xec')]];}var _0x4df270={'from':_0x51f60d[_0x0995('0xe9')],'firstName':_0x51f60d['firstName'],'lastName':_0x51f60d['lastName'],'mapKey':_0x0995('0xe9'),'message':{'from':_0x51f60d[_0x0995('0xe9')],'to':_0x505e47['MailAccount'][_0x0995('0xe9')],'cc':'','subject':_[_0x0995('0x77')](_0x7f0308)?_0x505e47['offlineMessageSubject']:_0x7f0308,'messageId':'','sentAt':new Date(),'attach':_0x59a52a[_0x0995('0x51')],'attachments':_0x59a52a,'originChannel':_0x0995('0xee'),'ChatWebsiteId':_0x505e47['id'],'ChatOfflineMessageId':_0x44d02f['id'],'originTo':_0x505e47[_0x0995('0xcf')][_0x0995('0xe9')]},'body':_0x44d02f[_0x0995('0x54')]};var _0x7ad903={'account':{'id':_0x505e47[_0x0995('0xeb')]},'body':_0x4df270,'log':_0x0995('0xef')};return respondWithRpcPromise(_0x0995('0xef'),'notifyMail',_0x7ad903,client9001)[_0x0995('0x16')](function(){return _0x44d02f;})['catch'](function(_0x25a768){logger[_0x0995('0x1c')](_0x25a768);});}return;})[_0x0995('0x16')](function(){if(_0x44d02f){return _0x44d02f;}})[_0x0995('0x16')](respondWithResult(_0x439a0e,null))[_0x0995('0x20')](function(_0x4a8ae6){logger[_0x0995('0x1c')](_0x0995('0x20'),_0x4a8ae6);for(var _0x3c0f15 of _0x1eaa0a){var _0x39b7ef=path['join'](config['root'],_0x0995('0xda'),_0x0995('0xc8'),'attachments',_0x0995('0xdc'),_0x3c0f15[_0x0995('0x6d')]);fs_extra[_0x0995('0xf0')](_0x39b7ef)[_0x0995('0x20')](function(_0x514bc2){logger['error'](_0x0995('0xf1'),_0x39b7ef,_0x514bc2);});}});};exports[_0x0995('0xf2')]=function(_0x1000e7,_0x455100){return db[_0x0995('0xb4')][_0x0995('0x52')]({'where':{'id':_0x1000e7['params']['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x455100,null))[_0x0995('0x16')](function(_0x52e165){if(_0x52e165){return _0x52e165[_0x0995('0xf2')](_0x1000e7[_0x0995('0x54')][_0x0995('0x63')],_[_0x0995('0xf3')](_0x1000e7[_0x0995('0x54')],[_0x0995('0x63'),'id'])||{});}})[_0x0995('0x16')](respondWithResult(_0x455100,null))['catch'](handleError(_0x455100,null));};exports[_0x0995('0xf4')]=function(_0x4c0a25,_0x5a97bf){var _0x158eef={'raw':![],'where':{}};var _0x852fbd={};var _0xf5d0d1={'count':0x0,'rows':[]};return db[_0x0995('0x34')][_0x0995('0x61')]({'where':{'id':_0x4c0a25[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x5a97bf,null))[_0x0995('0x16')](function(_0xb8d74f){if(_0xb8d74f){_0x852fbd[_0x0995('0x39')]=_[_0x0995('0x3a')](db[_0x0995('0xb4')][_0x0995('0x35')]);_0x852fbd[_0x0995('0x3d')]=_['keys'](_0x4c0a25[_0x0995('0x3d')]);_0x852fbd['filters']=_[_0x0995('0x3c')](_0x852fbd[_0x0995('0x39')],_0x852fbd[_0x0995('0x3d')]);_0x158eef[_0x0995('0x3f')]=_[_0x0995('0x3c')](_0x852fbd['model'],qs[_0x0995('0x3e')](_0x4c0a25['query'][_0x0995('0x3e')]));_0x158eef[_0x0995('0x3f')]=_0x158eef['attributes'][_0x0995('0x51')]?_0x158eef['attributes']:_0x852fbd['model'];if(!_0x4c0a25['query'][_0x0995('0x40')](_0x0995('0x41'))){_0x158eef[_0x0995('0x26')]=qs[_0x0995('0x26')](_0x4c0a25[_0x0995('0x3d')][_0x0995('0x26')]);_0x158eef[_0x0995('0x25')]=qs[_0x0995('0x25')](_0x4c0a25[_0x0995('0x3d')][_0x0995('0x25')]);}_0x158eef[_0x0995('0x42')]=qs[_0x0995('0x43')](_0x4c0a25[_0x0995('0x3d')][_0x0995('0x43')]);_0x158eef[_0x0995('0x44')]=qs['filters'](_[_0x0995('0x45')](_0x4c0a25['query'],_0x852fbd['filters']));_0x158eef[_0x0995('0x44')]['ChatWebsiteId']=_0xb8d74f['id'];if(_0x4c0a25[_0x0995('0x3d')]['filter']){_0x158eef[_0x0995('0x44')]=_[_0x0995('0x48')](_0x158eef[_0x0995('0x44')],{'$or':_[_0x0995('0x33')](_0x158eef[_0x0995('0x3f')],function(_0x47ba4a){var _0x28c8d0={};_0x28c8d0[_0x47ba4a]={'$like':'%'+_0x4c0a25[_0x0995('0x3d')]['filter']+'%'};return _0x28c8d0;})});}_0x158eef=_[_0x0995('0x48')]({},_0x158eef,_0x4c0a25[_0x0995('0x49')]);return db[_0x0995('0xb4')][_0x0995('0x27')]({'where':_0x158eef[_0x0995('0x44')]})[_0x0995('0x16')](function(_0x2c1b08){_0xf5d0d1[_0x0995('0x27')]=_0x2c1b08;if(_0x4c0a25['query'][_0x0995('0x4a')]){_0x158eef['include']=[{'model':db[_0x0995('0x89')],'as':_0x0995('0xf5'),'required':![]},{'model':db[_0x0995('0xbf')],'as':_0x0995('0xf6'),'attributes':[_0x0995('0x2f'),'fullname',_0x0995('0xf7')],'required':![]},{'model':db[_0x0995('0xf8')],'as':_0x0995('0xf9'),'attributes':['id',_0x0995('0x2f'),_0x0995('0xfa')],'where':_0x4c0a25['query'][_0x0995('0xfb')]?{'id':_0x4c0a25[_0x0995('0x3d')]['tag']}:undefined,'required':_0x4c0a25[_0x0995('0x3d')]['tag']?!![]:![]}];}return db[_0x0995('0xb4')]['findAll'](_0x158eef);})[_0x0995('0x16')](function(_0x2d70b2){_0xf5d0d1[_0x0995('0x4d')]=_0x2d70b2;return _0xf5d0d1;});}})[_0x0995('0x16')](respondWithFilteredResult(_0x5a97bf,_0x158eef))[_0x0995('0x20')](handleError(_0x5a97bf,null));};function iftimePromise(_0x4ed0d0,_0x30f9f6){return respondWithRpcPromise(_0x0995('0xfc'),'getSnippet',{'command':_0x30f9f6['timezone']?util['format'](_0x0995('0xfd'),_0x4ed0d0[_0x0995('0xfe')],_0x30f9f6['timezone']):util[_0x0995('0xac')](_0x0995('0xff'),_0x4ed0d0['interval'])},client9002)[_0x0995('0x16')](function(_0x51dbd5){var _0x49b3a1=_0x51dbd5&&_0x51dbd5[_0x0995('0x100')](_0x0995('0x101'))>=0x0?!![]:![];logger[_0x0995('0x17')](_0x0995('0x102'),_0x30f9f6['id'],_0x4ed0d0['id'],_0x4ed0d0['interval'],_0x49b3a1?_0x0995('0x103'):_0x0995('0x104'),_0x30f9f6[_0x0995('0x105')]?_0x30f9f6['timezone']:'No\x20timezone');return _0x49b3a1;})[_0x0995('0x20')](function(_0x3f71c2){logger[_0x0995('0x1c')](_0x0995('0x102'),_0x30f9f6['id'],_0x4ed0d0['id'],_0x4ed0d0[_0x0995('0xfe')],util[_0x0995('0x106')](_0x3f71c2,{'showHidden':![],'depth':null}),_0x30f9f6[_0x0995('0x105')]?_0x30f9f6[_0x0995('0x105')]:'No\x20timezone');return![];});}exports[_0x0995('0x107')]=function(_0x588c6d,_0x16acfd){var _0x4d9176=0x0;var _0x2360d5=0x0;var _0x3ff34e=![];var _0x47d801;var _0x3058c5;return db[_0x0995('0x34')]['find']({'where':{'id':_0x588c6d['params']['id']},'include':[{'model':db['Interval'],'as':_0x0995('0x108'),'include':[{'model':db[_0x0995('0x108')],'as':_0x0995('0x109'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x0995('0x16')](handleEntityNotFound(_0x16acfd,null))[_0x0995('0x16')](function(_0x4b6198){if(_0x4b6198){_0x47d801=_0x4b6198;return _0x4b6198[_0x0995('0x10a')]({'raw':!![]});}})['then'](function(_0x2e3849){if(_0x47d801){if(_0x2e3849){_0x3058c5=_0x2e3849;}}return require('../../config/license/util')['getLicense']();})[_0x0995('0x16')](function(_0x4e5762){if(_0x4e5762){_0x2360d5=_0x4e5762[_0x0995('0x10b')];_0x3ff34e=_0x4e5762[_0x0995('0x10c')];}})['then'](function(){return db[_0x0995('0xb4')][_0x0995('0x27')]({'where':{'closed':![]}});})['then'](function(_0x15f1a8){_0x4d9176=_0x15f1a8;if(_0x2360d5&&_0x15f1a8>_0x2360d5){return db[_0x0995('0x10d')][_0x0995('0x61')]({'where':{'id':0x1}})['then'](function(_0x5852ed){if(_0x5852ed){_0x5852ed[_0x0995('0x10e')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x47d801['Interval']&&_0x47d801[_0x0995('0x108')][_0x0995('0x109')]){var _0x34dc27=[];for(var _0x53a6b8=0x0;_0x53a6b8<_0x47d801['Interval']['Intervals'][_0x0995('0x51')];_0x53a6b8++){var _0x39dff7=_0x47d801[_0x0995('0x108')][_0x0995('0x109')][_0x53a6b8][_0x0995('0x2c')]({'plain':!![]});_0x34dc27[_0x0995('0xbb')](iftimePromise(_0x39dff7,_0x47d801));}return BPromise[_0x0995('0x10f')](_0x34dc27)[_0x0995('0x16')](function(_0x560f7e){return _['some'](_0x560f7e);});}else{return!![];}})[_0x0995('0x16')](function(_0x13fa23){var _0x332fb4=fs['readFileSync'](path[_0x0995('0x72')](config[_0x0995('0x73')],_0x0995('0x110')),'utf8');var _0x4b8035=new url[(_0x0995('0x111'))](_0x47d801[_0x0995('0x112')])[_0x0995('0x113')];var _0x5258a8='3.1.0';var _0x414f37=![];var _0x335f57={'chatVersion':_0x5258a8,'chatWebsiteAddressOrigin':_0x4b8035,'remote':_0x47d801[_0x0995('0x114')],'query':querystring[_0x0995('0xb2')](_['merge'](_0x47d801['get']({'plain':!![]}),{'customerIp':_0x588c6d[_0x0995('0xa1')][_0x0995('0xa3')]||_0x588c6d[_0x0995('0xa1')][_0x0995('0x115')]||_0x588c6d[_0x0995('0x116')][_0x0995('0x117')]||_0x588c6d['ip'],'referer':_0x588c6d[_0x0995('0xa1')][_0x0995('0xa9')],'openedInteractions':_0x4d9176,'maxInteractions':_0x2360d5,'virtual':_0x3ff34e['virtual'],'online':_0x13fa23,'custom':_0x3ff34e}))[_0x0995('0x118')](/'/g,'\x5c\x27')};_0x16acfd[_0x0995('0x30')](ejs[_0x0995('0xd4')](Mustache[_0x0995('0xd4')](_0x332fb4,_0x335f57),{'proactiveActions':_0x3058c5,'alignment':_0x47d801['alignment'],'verticalAlignment':_0x47d801[_0x0995('0x119')],'div_color':_0x47d801[_0x0995('0xfa')],'labelText':_0x47d801[_0x0995('0x11a')],'text_color':_0x47d801[_0x0995('0x11b')],'text_button_color':_0x47d801[_0x0995('0x11c')],'button_color':_0x47d801[_0x0995('0x11d')],'background_color':_0x47d801[_0x0995('0x11e')],'hideWhenOffline':_0x47d801[_0x0995('0x11f')],'intervalId':_0x47d801[_0x0995('0x120')],'isDevelopment':_0x414f37,'chatVersion':_0x5258a8}));})[_0x0995('0x20')](handleError(_0x16acfd,null));};exports[_0x0995('0x121')]=function(_0x332480,_0x10f226){var _0x59e108=_0x332480[_0x0995('0x4f')]['id'];var _0x3d6d6a=_0x332480['body'];var _0x6ba879=0xc8;var _0x238846=null;return db[_0x0995('0xdf')][_0x0995('0x122')]({'isolationLevel':db[_0x0995('0xdf')][_0x0995('0x123')][_0x0995('0x124')][_0x0995('0x125')]},function(_0x156ad8){return db[_0x0995('0x34')][_0x0995('0x61')]({'where':{'id':_0x59e108},'transaction':_0x156ad8})[_0x0995('0x16')](function(_0x2a9e03){if(_0x2a9e03){return db[_0x0995('0x98')][_0x0995('0x2b')]({'where':{'ChatWebsiteId':_0x59e108},'transaction':_0x156ad8})['then'](function(){var _0x5528ca=_[_0x0995('0x33')](_0x3d6d6a,function(_0x248e73){_0x248e73[_0x0995('0x5f')]=_0x59e108;return _0x248e73;});return db[_0x0995('0x98')][_0x0995('0x126')](_0x5528ca,{'transaction':_0x156ad8});});}else{_0x6ba879=0x194;_0x238846=[];}});})[_0x0995('0x16')](function(){if(_0x6ba879!==0x194){return db[_0x0995('0x98')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x59e108},'order':_0x0995('0x9c')})[_0x0995('0x16')](function(_0x407176){_0x238846=_0x407176;});}})[_0x0995('0x20')](function(_0xf7784d){_0x6ba879=0x1f4;logger[_0x0995('0x1c')](_0xf7784d[_0x0995('0x2e')]);if(_0xf7784d[_0x0995('0x2f')]){delete _0xf7784d[_0x0995('0x2f')];}_0x238846=_0xf7784d;})[_0x0995('0x127')](function(){if(_0x238846===null){_0x10f226[_0x0995('0x21')](_0x6ba879);}else{if(_0x6ba879===0x1f4){_0x10f226[_0x0995('0x22')](_0x6ba879)[_0x0995('0x30')](_0x238846);}else{_0x10f226[_0x0995('0x22')](_0x6ba879)['json'](_0x238846);}}});};exports[_0x0995('0x128')]=function(_0x6fac62,_0x103cad){var _0x33f484={};var _0x15c682={};var _0x102f1e;var _0x2e4c0e;return db[_0x0995('0x34')][_0x0995('0x61')]({'where':{'id':_0x6fac62[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x103cad,null))[_0x0995('0x16')](function(_0x5c3f97){if(_0x5c3f97){_0x102f1e=_0x5c3f97;_0x15c682[_0x0995('0x39')]=_[_0x0995('0x3a')](db[_0x0995('0x98')][_0x0995('0x35')]);_0x15c682[_0x0995('0x3d')]=_[_0x0995('0x3a')](_0x6fac62['query']);_0x15c682[_0x0995('0x3b')]=_[_0x0995('0x3c')](_0x15c682['model'],_0x15c682[_0x0995('0x3d')]);_0x33f484[_0x0995('0x3f')]=_['intersection'](_0x15c682[_0x0995('0x39')],qs[_0x0995('0x3e')](_0x6fac62['query'][_0x0995('0x3e')]));_0x33f484['attributes']=_0x33f484['attributes'][_0x0995('0x51')]?_0x33f484['attributes']:_0x15c682[_0x0995('0x39')];_0x33f484[_0x0995('0x42')]=qs[_0x0995('0x43')](_0x6fac62['query'][_0x0995('0x43')]);_0x33f484[_0x0995('0x44')]=qs[_0x0995('0x3b')](_[_0x0995('0x45')](_0x6fac62['query'],_0x15c682[_0x0995('0x3b')]));if(_0x6fac62[_0x0995('0x3d')][_0x0995('0x46')]){_0x33f484[_0x0995('0x44')]=_['merge'](_0x33f484[_0x0995('0x44')],{'$or':_['map'](_0x33f484['attributes'],function(_0x1336c0){var _0xcd4eb9={};_0xcd4eb9[_0x1336c0]={'$like':'%'+_0x6fac62[_0x0995('0x3d')][_0x0995('0x46')]+'%'};return _0xcd4eb9;})});}_0x33f484=_[_0x0995('0x48')]({},_0x33f484,_0x6fac62[_0x0995('0x49')]);return _0x102f1e[_0x0995('0x128')](_0x33f484);}})['then'](function(_0x3e2ec9){if(_0x3e2ec9){_0x2e4c0e=_0x3e2ec9[_0x0995('0x51')];if(!_0x6fac62['query']['hasOwnProperty'](_0x0995('0x41'))){_0x33f484[_0x0995('0x26')]=qs[_0x0995('0x26')](_0x6fac62[_0x0995('0x3d')][_0x0995('0x26')]);_0x33f484[_0x0995('0x25')]=qs['offset'](_0x6fac62['query'][_0x0995('0x25')]);}return _0x102f1e[_0x0995('0x128')](_0x33f484);}})['then'](function(_0x523ef7){if(_0x523ef7){return _0x523ef7?{'count':_0x2e4c0e,'rows':_0x523ef7}:null;}})[_0x0995('0x16')](respondWithResult(_0x103cad,null))[_0x0995('0x20')](handleError(_0x103cad,null));};exports[_0x0995('0x129')]=function(_0xdce544,_0x2bdc11){return db[_0x0995('0x12a')][_0x0995('0x52')]({'where':{'id':_0xdce544['params']['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x2bdc11,null))[_0x0995('0x16')](function(_0x5e44ff){if(_0x5e44ff){return _0x5e44ff['addProactiveActions'](_0xdce544[_0x0995('0x54')]['ids'],_['omit'](_0xdce544[_0x0995('0x54')],[_0x0995('0x63'),'id'])||{});}})['then'](respondWithResult(_0x2bdc11,null))[_0x0995('0x20')](handleError(_0x2bdc11,null));};exports[_0x0995('0x10a')]=function(_0x5108a7,_0x20f052){var _0x1316cc={};var _0xa3bc90={};var _0x474ba7;var _0x1978a6;return db['ChatWebsite']['findOne']({'where':{'id':_0x5108a7['params']['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x20f052,null))['then'](function(_0x675447){if(_0x675447){_0x474ba7=_0x675447;_0xa3bc90[_0x0995('0x39')]=_[_0x0995('0x3a')](db[_0x0995('0x12b')]['rawAttributes']);_0xa3bc90['query']=_['keys'](_0x5108a7[_0x0995('0x3d')]);_0xa3bc90[_0x0995('0x3b')]=_['intersection'](_0xa3bc90[_0x0995('0x39')],_0xa3bc90[_0x0995('0x3d')]);_0x1316cc[_0x0995('0x3f')]=_[_0x0995('0x3c')](_0xa3bc90[_0x0995('0x39')],qs[_0x0995('0x3e')](_0x5108a7[_0x0995('0x3d')][_0x0995('0x3e')]));_0x1316cc[_0x0995('0x3f')]=_0x1316cc[_0x0995('0x3f')][_0x0995('0x51')]?_0x1316cc[_0x0995('0x3f')]:_0xa3bc90[_0x0995('0x39')];_0x1316cc['order']=qs['sort'](_0x5108a7[_0x0995('0x3d')]['sort']);_0x1316cc['where']=qs[_0x0995('0x3b')](_['pick'](_0x5108a7[_0x0995('0x3d')],_0xa3bc90[_0x0995('0x3b')]));if(_0x5108a7[_0x0995('0x3d')][_0x0995('0x46')]){_0x1316cc[_0x0995('0x44')]=_['merge'](_0x1316cc[_0x0995('0x44')],{'$or':_[_0x0995('0x33')](_0x1316cc[_0x0995('0x3f')],function(_0x2dfe92){var _0x592bd6={};_0x592bd6[_0x2dfe92]={'$like':'%'+_0x5108a7[_0x0995('0x3d')][_0x0995('0x46')]+'%'};return _0x592bd6;})});}_0x1316cc=_[_0x0995('0x48')]({},_0x1316cc,_0x5108a7[_0x0995('0x49')]);return _0x474ba7[_0x0995('0x10a')](_0x1316cc);}})['then'](function(_0xa1fb31){if(_0xa1fb31){_0x1978a6=_0xa1fb31[_0x0995('0x51')];if(!_0x5108a7[_0x0995('0x3d')][_0x0995('0x40')](_0x0995('0x41'))){_0x1316cc[_0x0995('0x26')]=qs['limit'](_0x5108a7['query'][_0x0995('0x26')]);_0x1316cc['offset']=qs[_0x0995('0x25')](_0x5108a7[_0x0995('0x3d')][_0x0995('0x25')]);}return _0x474ba7[_0x0995('0x10a')](_0x1316cc);}})['then'](function(_0x5c2493){if(_0x5c2493){return _0x5c2493?{'count':_0x1978a6,'rows':_0x5c2493}:null;}})[_0x0995('0x16')](respondWithResult(_0x20f052,null))['catch'](handleError(_0x20f052,null));};exports[_0x0995('0x12c')]=function(_0x18e0a5,_0x50b9be){var _0x2b59cb=_0x18e0a5['query'][_0x0995('0x12d')]===_0x0995('0x12e')?_0x0995('0x12f'):'onlineForm';return db['ChatWebsite'][_0x0995('0x52')]({'attributes':['id',_0x2b59cb],'where':{'id':_0x18e0a5[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x50b9be,null))[_0x0995('0x16')](function(_0x422f1f){if(_0x422f1f){var _0x4c91d2=_0x422f1f[_0x2b59cb];var _0x47b224=_0x4c91d2&&_0x4c91d2['items']?_0x4c91d2[_0x0995('0x130')]:[];_0x50b9be[_0x0995('0x30')]({'fromKey':_[_0x0995('0x77')](_0x4c91d2['fromKey'])?undefined:_0x4c91d2['fromKey'],'count':_0x47b224[_0x0995('0x51')],'rows':_0x47b224});}})['catch'](handleError(_0x50b9be,null));};exports[_0x0995('0x131')]=function(_0x7f17e4,_0x9e894){var _0x9c80cc={'raw':![],'where':{}};var _0x462dd7={};var _0x42dbf9={'count':0x0,'rows':[]};return db[_0x0995('0x34')][_0x0995('0x61')]({'where':{'id':_0x7f17e4[_0x0995('0x4f')]['id']}})['then'](handleEntityNotFound(_0x9e894,null))[_0x0995('0x16')](function(_0x5b1bc2){if(_0x5b1bc2){_0x462dd7[_0x0995('0x39')]=_['keys'](db['ChatOfflineMessage'][_0x0995('0x35')]);_0x462dd7[_0x0995('0x3d')]=_[_0x0995('0x3a')](_0x7f17e4[_0x0995('0x3d')]);_0x462dd7['filters']=_[_0x0995('0x3c')](_0x462dd7['model'],_0x462dd7[_0x0995('0x3d')]);_0x9c80cc['attributes']=_[_0x0995('0x3c')](_0x462dd7['model'],qs[_0x0995('0x3e')](_0x7f17e4[_0x0995('0x3d')][_0x0995('0x3e')]));_0x9c80cc[_0x0995('0x3f')]=_0x9c80cc['attributes'][_0x0995('0x51')]?_0x9c80cc[_0x0995('0x3f')]:_0x462dd7[_0x0995('0x39')];if(!_0x7f17e4['query'][_0x0995('0x40')]('nolimit')){_0x9c80cc['limit']=qs[_0x0995('0x26')](_0x7f17e4[_0x0995('0x3d')]['limit']);_0x9c80cc[_0x0995('0x25')]=qs[_0x0995('0x25')](_0x7f17e4[_0x0995('0x3d')][_0x0995('0x25')]);}_0x9c80cc[_0x0995('0x42')]=qs['sort'](_0x7f17e4[_0x0995('0x3d')]['sort']);_0x9c80cc[_0x0995('0x44')]=qs[_0x0995('0x3b')](_[_0x0995('0x45')](_0x7f17e4[_0x0995('0x3d')],_0x462dd7[_0x0995('0x3b')]));_0x9c80cc['where']['ChatWebsiteId']=_0x5b1bc2['id'];if(_0x7f17e4[_0x0995('0x3d')][_0x0995('0x46')]){_0x9c80cc[_0x0995('0x44')]=_[_0x0995('0x48')](_0x9c80cc[_0x0995('0x44')],{'$or':_['map'](_0x9c80cc[_0x0995('0x3f')],function(_0x4e0173){var _0x46296c={};_0x46296c[_0x4e0173]={'$like':'%'+_0x7f17e4[_0x0995('0x3d')][_0x0995('0x46')]+'%'};return _0x46296c;})});}_0x9c80cc=_['merge']({},_0x9c80cc,_0x7f17e4[_0x0995('0x49')]);return db[_0x0995('0xd7')]['count']({'where':_0x9c80cc[_0x0995('0x44')]})['then'](function(_0x456034){_0x42dbf9['count']=_0x456034;if(_0x7f17e4[_0x0995('0x3d')]['includeAll']){_0x9c80cc[_0x0995('0x4b')]=[{'all':!![]}];}else{_0x9c80cc[_0x0995('0x4b')]=[{'model':db[_0x0995('0x89')],'as':'Contact','required':![]},{'model':db[_0x0995('0xe0')],'as':_0x0995('0x132'),'required':![]}];}return db['ChatOfflineMessage'][_0x0995('0x4c')](_0x9c80cc);})['then'](function(_0x5e5485){_0x42dbf9[_0x0995('0x4d')]=_0x5e5485;return _0x42dbf9;});}})[_0x0995('0x16')](respondWithFilteredResult(_0x9e894,_0x9c80cc))[_0x0995('0x20')](handleError(_0x9e894,null));};exports[_0x0995('0x133')]=function(_0xa2803d,_0x52df84){return db[_0x0995('0x34')][_0x0995('0x52')]({'where':{'id':_0xa2803d[_0x0995('0x4f')]['id']}})[_0x0995('0x16')](handleEntityNotFound(_0x52df84,null))[_0x0995('0x16')](function(_0x4ec866){if(_0x4ec866){return _0x4ec866[_0x0995('0x133')](_0xa2803d[_0x0995('0x54')]['ids'],_[_0x0995('0xf3')](_0xa2803d[_0x0995('0x54')],['ids','id'])||{})[_0x0995('0xb7')](function(_0x3b1200){for(var _0x267437=0x0;_0x267437<_0xa2803d[_0x0995('0x54')]['ids'][_0x0995('0x51')];_0x267437+=0x1){socket['emit'](_0x0995('0x134'),{'UserId':Number(_0xa2803d[_0x0995('0x54')][_0x0995('0x63')][_0x267437]),'ChatWebsiteId':Number(_0xa2803d[_0x0995('0x4f')]['id'])});}return _0x3b1200;});}})[_0x0995('0x16')](respondWithResult(_0x52df84,null))[_0x0995('0x20')](handleError(_0x52df84,null));};exports[_0x0995('0x135')]=function(_0x502598,_0x5ae5b5){return db[_0x0995('0x34')][_0x0995('0x52')]({'where':{'id':_0x502598['params']['id']}})['then'](handleEntityNotFound(_0x5ae5b5,null))['then'](function(_0x1a9ceb){if(_0x1a9ceb){return _0x1a9ceb[_0x0995('0x135')](_0x502598[_0x0995('0x3d')][_0x0995('0x63')])[_0x0995('0x16')](function(){if(_[_0x0995('0x136')](_0x502598[_0x0995('0x3d')][_0x0995('0x63')])){for(var _0x26f41c=0x0;_0x26f41c<_0x502598['query'][_0x0995('0x63')][_0x0995('0x51')];_0x26f41c+=0x1){socket[_0x0995('0x137')](_0x0995('0x138'),{'UserId':Number(_0x502598[_0x0995('0x3d')][_0x0995('0x63')][_0x26f41c]),'ChatWebsiteId':Number(_0x502598['params']['id'])});}}else{socket[_0x0995('0x137')]('userChatWebsite:remove',{'UserId':Number(_0x502598[_0x0995('0x3d')][_0x0995('0x63')]),'ChatWebsiteId':Number(_0x502598['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5ae5b5,null))[_0x0995('0x20')](handleError(_0x5ae5b5,null));};exports[_0x0995('0x139')]=function(_0x15c4df,_0x5ea3d0){var _0x3b2363={};var _0x2c7ce6={};var _0x306b91;var _0x1f876e;return db[_0x0995('0x34')]['findOne']({'where':{'id':_0x15c4df[_0x0995('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ea3d0,null))[_0x0995('0x16')](function(_0x203989){if(_0x203989){_0x306b91=_0x203989;_0x2c7ce6[_0x0995('0x39')]=_['keys'](db[_0x0995('0xbf')][_0x0995('0x35')]);_0x2c7ce6[_0x0995('0x3d')]=_[_0x0995('0x3a')](_0x15c4df[_0x0995('0x3d')]);_0x2c7ce6[_0x0995('0x3b')]=_[_0x0995('0x3c')](_0x2c7ce6[_0x0995('0x39')],_0x2c7ce6[_0x0995('0x3d')]);_0x3b2363[_0x0995('0x3f')]=_[_0x0995('0x3c')](_0x2c7ce6['model'],qs['fields'](_0x15c4df[_0x0995('0x3d')]['fields']));_0x3b2363[_0x0995('0x3f')]=_0x3b2363[_0x0995('0x3f')][_0x0995('0x51')]?_0x3b2363[_0x0995('0x3f')]:_0x2c7ce6[_0x0995('0x39')];_0x3b2363[_0x0995('0x42')]=qs[_0x0995('0x43')](_0x15c4df[_0x0995('0x3d')][_0x0995('0x43')]);_0x3b2363['where']=qs[_0x0995('0x3b')](_[_0x0995('0x45')](_0x15c4df[_0x0995('0x3d')],_0x2c7ce6['filters']));if(_0x15c4df[_0x0995('0x3d')][_0x0995('0x46')]){_0x3b2363[_0x0995('0x44')]=_[_0x0995('0x48')](_0x3b2363[_0x0995('0x44')],{'$or':_[_0x0995('0x33')](_0x3b2363[_0x0995('0x3f')],function(_0x54e2fb){var _0x2ff482={};_0x2ff482[_0x54e2fb]={'$like':'%'+_0x15c4df[_0x0995('0x3d')][_0x0995('0x46')]+'%'};return _0x2ff482;})});}_0x3b2363=_['merge']({},_0x3b2363,_0x15c4df[_0x0995('0x49')]);return _0x306b91[_0x0995('0x139')](_0x3b2363);}})[_0x0995('0x16')](function(_0x54d287){if(_0x54d287){_0x1f876e=_0x54d287[_0x0995('0x51')];if(!_0x15c4df[_0x0995('0x3d')]['hasOwnProperty'](_0x0995('0x41'))){_0x3b2363[_0x0995('0x26')]=qs[_0x0995('0x26')](_0x15c4df[_0x0995('0x3d')][_0x0995('0x26')]);_0x3b2363[_0x0995('0x25')]=qs[_0x0995('0x25')](_0x15c4df['query'][_0x0995('0x25')]);}return _0x306b91[_0x0995('0x139')](_0x3b2363);}})[_0x0995('0x16')](function(_0x3e9de9){if(_0x3e9de9){return _0x3e9de9?{'count':_0x1f876e,'rows':_0x3e9de9}:null;}})[_0x0995('0x16')](respondWithResult(_0x5ea3d0,null))[_0x0995('0x20')](handleError(_0x5ea3d0,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index d7d42c5..c262e8f 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 _0xcf1c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1f993a,_0x2391e8){var _0x49d756=function(_0xf15d56){while(--_0xf15d56){_0x1f993a['push'](_0x1f993a['shift']());}};_0x49d756(++_0x2391e8);}(_0xcf1c,0x18d));var _0xccf1=function(_0x458f09,_0xf2ee90){_0x458f09=_0x458f09-0x0;var _0x1ca565=_0xcf1c[_0x458f09];return _0x1ca565;};'use strict';var EventEmitter=require(_0xccf1('0x0'));var ChatWebsite=require(_0xccf1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xccf1('0x2')](0x0);var events={'afterCreate':_0xccf1('0x3'),'afterUpdate':_0xccf1('0x4'),'afterDestroy':_0xccf1('0x5')};function emitEvent(_0x5670d0){return function(_0x5d3e85,_0x509c8d,_0x301b38){ChatWebsiteEvents['emit'](_0x5670d0+':'+_0x5d3e85['id'],_0x5d3e85);ChatWebsiteEvents[_0xccf1('0x6')](_0x5670d0,_0x5d3e85);_0x301b38(null);};}for(var e in events){if(events[_0xccf1('0x7')](e)){var event=events[e];ChatWebsite[_0xccf1('0x8')](e,emitEvent(event));}}module[_0xccf1('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x32ff=['hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x59bd64,_0x237f2b){var _0x378c0e=function(_0x24e2be){while(--_0x24e2be){_0x59bd64['push'](_0x59bd64['shift']());}};_0x378c0e(++_0x237f2b);}(_0x32ff,0xc7));var _0xf32f=function(_0x1f3a3a,_0x2acf29){_0x1f3a3a=_0x1f3a3a-0x0;var _0x5e1a4c=_0x32ff[_0x1f3a3a];return _0x5e1a4c;};'use strict';var EventEmitter=require(_0xf32f('0x0'));var ChatWebsite=require(_0xf32f('0x1'))['db'][_0xf32f('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf32f('0x3')](0x0);var events={'afterCreate':_0xf32f('0x4'),'afterUpdate':_0xf32f('0x5'),'afterDestroy':_0xf32f('0x6')};function emitEvent(_0x3ee77b){return function(_0x1f96f0,_0x397240,_0x1f6ca4){ChatWebsiteEvents[_0xf32f('0x7')](_0x3ee77b+':'+_0x1f96f0['id'],_0x1f96f0);ChatWebsiteEvents[_0xf32f('0x7')](_0x3ee77b,_0x1f96f0);_0x1f6ca4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xf32f('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index c4e018d..420f1b3 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 _0x5061=['lodash','util','../../config/logger','api','moment','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x1b4a2c,_0x3fc60b){var _0x40a60e=function(_0xf9feb){while(--_0xf9feb){_0x1b4a2c['push'](_0x1b4a2c['shift']());}};_0x40a60e(++_0x3fc60b);}(_0x5061,0x176));var _0x1506=function(_0x4d9bb2,_0x3db50d){_0x4d9bb2=_0x4d9bb2-0x0;var _0x3179fe=_0x5061[_0x4d9bb2];return _0x3179fe;};'use strict';var _=require(_0x1506('0x0'));var util=require(_0x1506('0x1'));var logger=require(_0x1506('0x2'))(_0x1506('0x3'));var moment=require(_0x1506('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1506('0x5'));var rimraf=require(_0x1506('0x6'));var config=require('../../config/environment');var attributes=require(_0x1506('0x7'));module['exports']=function(_0x371fb7,_0x6836cd){return _0x371fb7[_0x1506('0x8')](_0x1506('0x9'),attributes,{'tableName':_0x1506('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4af0=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api','bluebird','request-promise','path'];(function(_0x375634,_0x15d810){var _0x3f002d=function(_0x376bd3){while(--_0x376bd3){_0x375634['push'](_0x375634['shift']());}};_0x3f002d(++_0x15d810);}(_0x4af0,0x10b));var _0x04af=function(_0x54ce00,_0x2ca0da){_0x54ce00=_0x54ce00-0x0;var _0x2b4520=_0x4af0[_0x54ce00];return _0x2b4520;};'use strict';var _=require(_0x04af('0x0'));var util=require(_0x04af('0x1'));var logger=require('../../config/logger')(_0x04af('0x2'));var moment=require('moment');var BPromise=require(_0x04af('0x3'));var rp=require(_0x04af('0x4'));var fs=require('fs');var path=require(_0x04af('0x5'));var rimraf=require(_0x04af('0x6'));var config=require(_0x04af('0x7'));var attributes=require(_0x04af('0x8'));module[_0x04af('0x9')]=function(_0x194364,_0x1ad62d){return _0x194364[_0x04af('0xa')](_0x04af('0xb'),attributes,{'tableName':_0x04af('0xc'),'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 77d4696..dc0250a 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 _0xe168=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2387c5,_0xfcc74c){var _0x2c414c=function(_0x3d1881){while(--_0x3d1881){_0x2387c5['push'](_0x2387c5['shift']());}};_0x2c414c(++_0xfcc74c);}(_0xe168,0xce));var _0x8e16=function(_0x35f511,_0x4b60ff){_0x35f511=_0x35f511-0x0;var _0x33d91b=_0xe168[_0x35f511];return _0x33d91b;};'use strict';var _=require(_0x8e16('0x0'));var util=require(_0x8e16('0x1'));var moment=require(_0x8e16('0x2'));var BPromise=require(_0x8e16('0x3'));var rs=require(_0x8e16('0x4'));var fs=require('fs');var Redis=require(_0x8e16('0x5'));var db=require(_0x8e16('0x6'))['db'];var utils=require(_0x8e16('0x7'));var logger=require(_0x8e16('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8e16('0x9'));var client=jayson[_0x8e16('0xa')][_0x8e16('0xb')]({'port':0x232a});config[_0x8e16('0xc')]=_[_0x8e16('0xd')](config[_0x8e16('0xc')],{'host':_0x8e16('0xe'),'port':0x18eb});var socket=require(_0x8e16('0xf'))(new Redis(config[_0x8e16('0xc')]));require(_0x8e16('0x10'))[_0x8e16('0x11')](socket);function respondWithRpcPromise(_0x339bc2,_0x5b1e8e,_0x2c5a1e){return new BPromise(function(_0x7ede4b,_0x20d19b){return client[_0x8e16('0x12')](_0x339bc2,_0x2c5a1e)[_0x8e16('0x13')](function(_0x122024){logger[_0x8e16('0x14')](_0x8e16('0x15'),_0x5b1e8e,_0x8e16('0x16'));logger['debug'](_0x8e16('0x17'),_0x5b1e8e,_0x8e16('0x16'),JSON[_0x8e16('0x18')](_0x122024));if(_0x122024[_0x8e16('0x19')]){if(_0x122024['error'][_0x8e16('0x1a')]===0x1f4){logger[_0x8e16('0x19')](_0x8e16('0x15'),_0x5b1e8e,_0x122024['error'][_0x8e16('0x1b')]);return _0x20d19b(_0x122024[_0x8e16('0x19')][_0x8e16('0x1b')]);}logger[_0x8e16('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x5b1e8e,_0x122024[_0x8e16('0x19')][_0x8e16('0x1b')]);return _0x7ede4b(_0x122024[_0x8e16('0x19')]['message']);}else{logger[_0x8e16('0x14')](_0x8e16('0x15'),_0x5b1e8e,'request\x20sent');_0x7ede4b(_0x122024['result']['message']);}})[_0x8e16('0x1c')](function(_0x4a02f5){logger[_0x8e16('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x5b1e8e,_0x4a02f5);_0x20d19b(_0x4a02f5);});});}
\ No newline at end of file
+var _0x3f0b=['ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatWebsite.socket','register','request'];(function(_0x13f2eb,_0x5d9979){var _0x3cb363=function(_0x57bc20){while(--_0x57bc20){_0x13f2eb['push'](_0x13f2eb['shift']());}};_0x3cb363(++_0x5d9979);}(_0x3f0b,0xd9));var _0xb3f0=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x3f0b[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xb3f0('0x0'));var util=require(_0xb3f0('0x1'));var moment=require('moment');var BPromise=require(_0xb3f0('0x2'));var rs=require(_0xb3f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3f0('0x4'))['db'];var utils=require(_0xb3f0('0x5'));var logger=require(_0xb3f0('0x6'))(_0xb3f0('0x7'));var config=require(_0xb3f0('0x8'));var jayson=require(_0xb3f0('0x9'));var client=jayson[_0xb3f0('0xa')][_0xb3f0('0xb')]({'port':0x232a});config[_0xb3f0('0xc')]=_['defaults'](config[_0xb3f0('0xc')],{'host':_0xb3f0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb3f0('0xc')]));require(_0xb3f0('0xe'))[_0xb3f0('0xf')](socket);function respondWithRpcPromise(_0x594794,_0x5eff4d,_0x53d69f){return new BPromise(function(_0xc5b5aa,_0x51532a){return client[_0xb3f0('0x10')](_0x594794,_0x53d69f)['then'](function(_0xd7783a){logger['info'](_0xb3f0('0x11'),_0x5eff4d,_0xb3f0('0x12'));logger[_0xb3f0('0x13')](_0xb3f0('0x14'),_0x5eff4d,'request\x20sent',JSON[_0xb3f0('0x15')](_0xd7783a));if(_0xd7783a[_0xb3f0('0x16')]){if(_0xd7783a[_0xb3f0('0x16')][_0xb3f0('0x17')]===0x1f4){logger[_0xb3f0('0x16')](_0xb3f0('0x11'),_0x5eff4d,_0xd7783a[_0xb3f0('0x16')][_0xb3f0('0x18')]);return _0x51532a(_0xd7783a['error'][_0xb3f0('0x18')]);}logger[_0xb3f0('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x5eff4d,_0xd7783a['error'][_0xb3f0('0x18')]);return _0xc5b5aa(_0xd7783a[_0xb3f0('0x16')]['message']);}else{logger['info'](_0xb3f0('0x11'),_0x5eff4d,_0xb3f0('0x12'));_0xc5b5aa(_0xd7783a['result'][_0xb3f0('0x18')]);}})[_0xb3f0('0x19')](function(_0x304f24){logger[_0xb3f0('0x16')](_0xb3f0('0x11'),_0x5eff4d,_0x304f24);_0x51532a(_0x304f24);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 4211eaa..9866659 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 _0xf698=['length','chatWebsite:','./chatWebsite.events','update','removeListener','register'];(function(_0x3c3eb7,_0x55343d){var _0x108733=function(_0x5bd6f6){while(--_0x5bd6f6){_0x3c3eb7['push'](_0x3c3eb7['shift']());}};_0x108733(++_0x55343d);}(_0xf698,0x14c));var _0x8f69=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xf698[_0x296897];return _0x2b44ab;};'use strict';var ChatWebsiteEvents=require(_0x8f69('0x0'));var events=['save','remove',_0x8f69('0x1')];function createListener(_0x354452,_0x12fc41){return function(_0x21c3c7){_0x12fc41['emit'](_0x354452,_0x21c3c7);};}function removeListener(_0x305bf1,_0x53824c){return function(){ChatWebsiteEvents[_0x8f69('0x2')](_0x305bf1,_0x53824c);};}exports[_0x8f69('0x3')]=function(_0x3f3f2b){for(var _0x86e8bf=0x0,_0x3f2c1e=events[_0x8f69('0x4')];_0x86e8bf<_0x3f2c1e;_0x86e8bf++){var _0x99e4c4=events[_0x86e8bf];var _0x93054e=createListener(_0x8f69('0x5')+_0x99e4c4,_0x3f3f2b);ChatWebsiteEvents['on'](_0x99e4c4,_0x93054e);}};
\ No newline at end of file
+var _0x9c14=['register','length','./chatWebsite.events','emit'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x9c14,0x9a));var _0x49c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c14[_0x3dd15e];return _0x231fd0;};'use strict';var ChatWebsiteEvents=require(_0x49c1('0x0'));var events=['save','remove','update'];function createListener(_0xe4c38c,_0x57ba46){return function(_0xb78712){_0x57ba46[_0x49c1('0x1')](_0xe4c38c,_0xb78712);};}function removeListener(_0x47e4e3,_0x7da2da){return function(){ChatWebsiteEvents['removeListener'](_0x47e4e3,_0x7da2da);};}exports[_0x49c1('0x2')]=function(_0x4edc50){for(var _0x5e4c5f=0x0,_0x1ec5d3=events[_0x49c1('0x3')];_0x5e4c5f<_0x1ec5d3;_0x5e4c5f++){var _0x57df45=events[_0x5e4c5f];var _0x58c979=createListener('chatWebsite:'+_0x57df45,_0x4edc50);ChatWebsiteEvents['on'](_0x57df45,_0x58c979);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 38b1dad..18fbf89 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 _0xbc45=['removeAnswers','removeAgents','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','post','create','addAnswer','diskStorage','root','format','%s-%s','now','/:id/logo','single','addLogo','join','server/files/images/avatars/','originalname','file','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','destroy','removeDispositions','delete'];(function(_0x2e8f90,_0x830dd9){var _0x584090=function(_0x53bd1c){while(--_0x53bd1c){_0x2e8f90['push'](_0x2e8f90['shift']());}};_0x584090(++_0x830dd9);}(_0xbc45,0x160));var _0x5bc4=function(_0x45bd77,_0x594e75){_0x45bd77=_0x45bd77-0x0;var _0x5c26ed=_0xbc45[_0x45bd77];return _0x5c26ed;};'use strict';var multer=require(_0x5bc4('0x0'));var util=require(_0x5bc4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5bc4('0x2'));var router=express['Router']();var fs_extra=require(_0x5bc4('0x3'));var auth=require(_0x5bc4('0x4'));var interaction=require(_0x5bc4('0x5'));var config=require(_0x5bc4('0x6'));var controller=require(_0x5bc4('0x7'));router[_0x5bc4('0x8')]('/',auth[_0x5bc4('0x9')](),controller['index']);router[_0x5bc4('0x8')](_0x5bc4('0xa'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0xb')]);router['get'](_0x5bc4('0xc'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0xd')]);router['get'](_0x5bc4('0xe'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0xf')]);router[_0x5bc4('0x8')](_0x5bc4('0x10'),auth[_0x5bc4('0x9')](),controller['getAnswers']);router[_0x5bc4('0x8')]('/:id/logo',controller[_0x5bc4('0x11')]);router[_0x5bc4('0x8')](_0x5bc4('0x12'),controller['getAvatar']);router['get'](_0x5bc4('0x13'),controller[_0x5bc4('0x14')]);router[_0x5bc4('0x8')]('/:id/system_avatar',controller[_0x5bc4('0x15')]);router[_0x5bc4('0x8')](_0x5bc4('0x16'),auth[_0x5bc4('0x9')](),controller['getInteractions']);router[_0x5bc4('0x8')](_0x5bc4('0x17'),controller[_0x5bc4('0x18')]);router['get'](_0x5bc4('0x19'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x1a')]);router[_0x5bc4('0x8')](_0x5bc4('0x1b'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x1c')]);router[_0x5bc4('0x8')](_0x5bc4('0x1d'),controller['getFields']);router[_0x5bc4('0x8')](_0x5bc4('0x1e'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x1f')]);router['get']('/:id/users',auth[_0x5bc4('0x9')](),controller['getAgents']);router[_0x5bc4('0x20')]('/',auth['isAuthenticated'](),controller[_0x5bc4('0x21')]);router['post'](_0x5bc4('0xe'),auth[_0x5bc4('0x9')](),controller['addDisposition']);router[_0x5bc4('0x20')]('/:id/canned_answers',auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x22')]);var upload=multer({'storage':multer[_0x5bc4('0x23')]({'destination':function(_0xc11f64,_0x351926,_0x1d54fe){_0x1d54fe(null,path['join'](config[_0x5bc4('0x24')],'server/files/images/logos/'));},'filename':function(_0x4834b3,_0x58e61b,_0x4ac44f){_0x4ac44f(null,util[_0x5bc4('0x25')](_0x5bc4('0x26'),Date[_0x5bc4('0x27')](),_0x58e61b['originalname']));}})});router[_0x5bc4('0x20')](_0x5bc4('0x28'),upload[_0x5bc4('0x29')]('file'),controller[_0x5bc4('0x2a')]);var upload=multer({'storage':multer[_0x5bc4('0x23')]({'destination':function(_0x19ef05,_0x5674dd,_0x4b7c72){_0x4b7c72(null,path[_0x5bc4('0x2b')](config['root'],_0x5bc4('0x2c')));},'filename':function(_0x1f47e4,_0x406aa2,_0xe0d6c2){_0xe0d6c2(null,util['format'](_0x5bc4('0x26'),Date[_0x5bc4('0x27')](),_0x406aa2[_0x5bc4('0x2d')]));}})});router[_0x5bc4('0x20')](_0x5bc4('0x12'),upload[_0x5bc4('0x29')](_0x5bc4('0x2e')),controller[_0x5bc4('0x2f')]);var upload=multer({'storage':multer[_0x5bc4('0x23')]({'destination':function(_0x294823,_0x391eba,_0x36b5f9){_0x36b5f9(null,path['join'](config[_0x5bc4('0x24')],_0x5bc4('0x2c')));},'filename':function(_0x22b021,_0x4290db,_0xaaf582){_0xaaf582(null,util['format'](_0x5bc4('0x26'),Date[_0x5bc4('0x27')](),_0x4290db['originalname']));}})});router['post'](_0x5bc4('0x13'),upload[_0x5bc4('0x29')](_0x5bc4('0x2e')),controller[_0x5bc4('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e3d96,_0x23ee16,_0x27d8bb){_0x27d8bb(null,path[_0x5bc4('0x2b')](config[_0x5bc4('0x24')],_0x5bc4('0x2c')));},'filename':function(_0x3126df,_0x30e5c7,_0x13c02f){_0x13c02f(null,util[_0x5bc4('0x25')](_0x5bc4('0x26'),Date[_0x5bc4('0x27')](),_0x30e5c7[_0x5bc4('0x2d')]));}})});router[_0x5bc4('0x20')](_0x5bc4('0x31'),upload[_0x5bc4('0x29')](_0x5bc4('0x2e')),controller[_0x5bc4('0x32')]);router['post'](_0x5bc4('0x33'),controller[_0x5bc4('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x5bc4('0x23')]({'destination':function(_0x7e9fe5,_0x384541,_0x31d1a0){const _0x2b0118=path['join'](config[_0x5bc4('0x24')],_0x5bc4('0x35'),'attachments',_0x5bc4('0x36'));fs_extra['ensureDir'](_0x2b0118,function(){_0x31d1a0(null,_0x2b0118);});},'filename':function(_0x4e0ce4,_0xa95f03,_0x5c5e55){const _0x14fe0c=_0xa95f03[_0x5bc4('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x34d871=path[_0x5bc4('0x37')](_0x14fe0c);const _0x1a0a2f=Date[_0x5bc4('0x27')]()+'-'+_0x14fe0c['replace'](_0x34d871,'')+_0x34d871;_0x5c5e55(null,_0x1a0a2f);}})});router['post'](_0x5bc4('0x38'),offlineUploadMulter[_0x5bc4('0x39')](),controller[_0x5bc4('0x3a')]);router[_0x5bc4('0x20')](_0x5bc4('0x16'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x3b')]);router[_0x5bc4('0x20')](_0x5bc4('0x19'),auth[_0x5bc4('0x9')](),controller['addApplications']);router['post'](_0x5bc4('0x1b'),auth['isAuthenticated'](),controller[_0x5bc4('0x3c')]);router[_0x5bc4('0x20')](_0x5bc4('0x3d'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x3e')]);router[_0x5bc4('0x3f')]('/:id',auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x40')]);router['delete'](_0x5bc4('0xc'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x41')]);router['delete'](_0x5bc4('0xe'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x42')]);router[_0x5bc4('0x43')](_0x5bc4('0x10'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x44')]);router[_0x5bc4('0x43')](_0x5bc4('0x3d'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x45')]);module['exports']=router;
\ No newline at end of file
+var _0x1a92=['addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','addApplications','/:id/users','addAgents','put','update','destroy','delete','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','create','post','addDisposition'];(function(_0x55c9e3,_0x3f01ee){var _0x1c8872=function(_0x384ea5){while(--_0x384ea5){_0x55c9e3['push'](_0x55c9e3['shift']());}};_0x1c8872(++_0x3f01ee);}(_0x1a92,0xac));var _0x21a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a92[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x21a9('0x0'));var path=require(_0x21a9('0x1'));var timeout=require(_0x21a9('0x2'));var express=require(_0x21a9('0x3'));var router=express[_0x21a9('0x4')]();var fs_extra=require(_0x21a9('0x5'));var auth=require(_0x21a9('0x6'));var interaction=require(_0x21a9('0x7'));var config=require(_0x21a9('0x8'));var controller=require(_0x21a9('0x9'));router[_0x21a9('0xa')]('/',auth[_0x21a9('0xb')](),controller[_0x21a9('0xc')]);router[_0x21a9('0xa')]('/describe',auth[_0x21a9('0xb')](),controller['describe']);router[_0x21a9('0xa')](_0x21a9('0xd'),auth[_0x21a9('0xb')](),controller['show']);router[_0x21a9('0xa')](_0x21a9('0xe'),auth['isAuthenticated'](),controller[_0x21a9('0xf')]);router[_0x21a9('0xa')](_0x21a9('0x10'),auth[_0x21a9('0xb')](),controller['getAnswers']);router[_0x21a9('0xa')](_0x21a9('0x11'),controller[_0x21a9('0x12')]);router[_0x21a9('0xa')]('/:id/avatar',controller[_0x21a9('0x13')]);router[_0x21a9('0xa')](_0x21a9('0x14'),controller[_0x21a9('0x15')]);router[_0x21a9('0xa')](_0x21a9('0x16'),controller[_0x21a9('0x17')]);router[_0x21a9('0xa')](_0x21a9('0x18'),auth[_0x21a9('0xb')](),controller['getInteractions']);router[_0x21a9('0xa')](_0x21a9('0x19'),controller[_0x21a9('0x1a')]);router[_0x21a9('0xa')](_0x21a9('0x1b'),auth[_0x21a9('0xb')](),controller[_0x21a9('0x1c')]);router['get'](_0x21a9('0x1d'),auth[_0x21a9('0xb')](),controller[_0x21a9('0x1e')]);router[_0x21a9('0xa')](_0x21a9('0x1f'),controller[_0x21a9('0x20')]);router[_0x21a9('0xa')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x21a9('0x21')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x21a9('0x22')]);router['post']('/',auth[_0x21a9('0xb')](),controller[_0x21a9('0x23')]);router[_0x21a9('0x24')]('/:id/dispositions',auth[_0x21a9('0xb')](),controller[_0x21a9('0x25')]);router[_0x21a9('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x21a9('0x26')]);var upload=multer({'storage':multer[_0x21a9('0x27')]({'destination':function(_0x4d649b,_0x4bae25,_0x6def69){_0x6def69(null,path[_0x21a9('0x28')](config[_0x21a9('0x29')],_0x21a9('0x2a')));},'filename':function(_0x3f9551,_0x37a81a,_0x5e1e07){_0x5e1e07(null,util[_0x21a9('0x2b')](_0x21a9('0x2c'),Date[_0x21a9('0x2d')](),_0x37a81a[_0x21a9('0x2e')]));}})});router[_0x21a9('0x24')](_0x21a9('0x11'),upload[_0x21a9('0x2f')](_0x21a9('0x30')),controller[_0x21a9('0x31')]);var upload=multer({'storage':multer[_0x21a9('0x27')]({'destination':function(_0x1dace2,_0x4a9850,_0x440056){_0x440056(null,path[_0x21a9('0x28')](config['root'],_0x21a9('0x32')));},'filename':function(_0x40eaac,_0x182b63,_0xa36698){_0xa36698(null,util[_0x21a9('0x2b')]('%s-%s',Date[_0x21a9('0x2d')](),_0x182b63[_0x21a9('0x2e')]));}})});router[_0x21a9('0x24')]('/:id/avatar',upload[_0x21a9('0x2f')](_0x21a9('0x30')),controller[_0x21a9('0x33')]);var upload=multer({'storage':multer[_0x21a9('0x27')]({'destination':function(_0x40c90a,_0x34572a,_0x7d8c0e){_0x7d8c0e(null,path[_0x21a9('0x28')](config[_0x21a9('0x29')],_0x21a9('0x32')));},'filename':function(_0x130892,_0x343d61,_0x17291d){_0x17291d(null,util[_0x21a9('0x2b')](_0x21a9('0x2c'),Date[_0x21a9('0x2d')](),_0x343d61[_0x21a9('0x2e')]));}})});router[_0x21a9('0x24')](_0x21a9('0x14'),upload[_0x21a9('0x2f')](_0x21a9('0x30')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x21a9('0x27')]({'destination':function(_0x51993c,_0x3102ed,_0x4b550e){_0x4b550e(null,path[_0x21a9('0x28')](config[_0x21a9('0x29')],_0x21a9('0x32')));},'filename':function(_0x122263,_0x2ac2f0,_0x47a1f2){_0x47a1f2(null,util[_0x21a9('0x2b')](_0x21a9('0x2c'),Date[_0x21a9('0x2d')](),_0x2ac2f0[_0x21a9('0x2e')]));}})});router[_0x21a9('0x24')](_0x21a9('0x16'),upload[_0x21a9('0x2f')](_0x21a9('0x30')),controller['addSystemAvatar']);router[_0x21a9('0x24')](_0x21a9('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x61c50f,_0x2d87d1,_0x2da8ae){const _0x44c264=path[_0x21a9('0x28')](config[_0x21a9('0x29')],_0x21a9('0x35'),'attachments',_0x21a9('0x36'));fs_extra[_0x21a9('0x37')](_0x44c264,function(){_0x2da8ae(null,_0x44c264);});},'filename':function(_0x38f371,_0x22f6dd,_0x202282){const _0x58cc3a=_0x22f6dd['originalname'][_0x21a9('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x45e232=path[_0x21a9('0x39')](_0x58cc3a);const _0x383f1e=Date['now']()+'-'+_0x58cc3a[_0x21a9('0x38')](_0x45e232,'')+_0x45e232;_0x202282(null,_0x383f1e);}})});router[_0x21a9('0x24')](_0x21a9('0x3a'),offlineUploadMulter[_0x21a9('0x3b')](),controller['offline']);router[_0x21a9('0x24')](_0x21a9('0x18'),auth[_0x21a9('0xb')](),controller[_0x21a9('0x3c')]);router['post'](_0x21a9('0x1b'),auth['isAuthenticated'](),controller[_0x21a9('0x3d')]);router[_0x21a9('0x24')](_0x21a9('0x1d'),auth[_0x21a9('0xb')](),controller['addProactiveActions']);router[_0x21a9('0x24')](_0x21a9('0x3e'),auth[_0x21a9('0xb')](),controller[_0x21a9('0x3f')]);router[_0x21a9('0x40')]('/:id',auth[_0x21a9('0xb')](),controller[_0x21a9('0x41')]);router['delete'](_0x21a9('0xd'),auth[_0x21a9('0xb')](),controller[_0x21a9('0x42')]);router[_0x21a9('0x43')]('/:id/dispositions',auth[_0x21a9('0xb')](),controller['removeDispositions']);router[_0x21a9('0x43')](_0x21a9('0x10'),auth[_0x21a9('0xb')](),controller['removeAnswers']);router[_0x21a9('0x43')](_0x21a9('0x3e'),auth[_0x21a9('0xb')](),controller[_0x21a9('0x44')]);module[_0x21a9('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index d91ac46..ee5b2b7 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 _0xab90=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','express','../components/auth/service','env','production','app'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xab90,0x175));var _0x0ab9=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xab90[_0x8c43de];return _0xa6591b;};var beaverLogger=require('beaver-logger/server');var express=require(_0x0ab9('0x0'));var auth=require(_0x0ab9('0x1'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x0ab9('0x2')]===_0x0ab9('0x3')||![];function clientSideLogs(_0x1593ed,_0x4f5c57,_0x3adf12){var _0x36b1aa=_0x1593ed[_0x0ab9('0x4')]['get']('client-side-logger');if(!_0x36b1aa){throw new Error(_0x0ab9('0x5'));}return beaverLogger[_0x0ab9('0x6')]({'uri':'/client-logs','logger':_0x36b1aa,'enableCors':!isProduction})(_0x1593ed,_0x4f5c57,_0x3adf12);}router['use'](auth[_0x0ab9('0x7')](),clientSideLogs);module[_0x0ab9('0x8')]=router;
\ No newline at end of file
+var _0x03c9=['expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x387a17,_0x25583b){var _0x4dab7c=function(_0x2ec1f2){while(--_0x2ec1f2){_0x387a17['push'](_0x387a17['shift']());}};_0x4dab7c(++_0x25583b);}(_0x03c9,0x12a));var _0x903c=function(_0x49c90f,_0x3da60e){_0x49c90f=_0x49c90f-0x0;var _0x48e99b=_0x03c9[_0x49c90f];return _0x48e99b;};var beaverLogger=require(_0x903c('0x0'));var express=require(_0x903c('0x1'));var auth=require(_0x903c('0x2'));var config=require(_0x903c('0x3'));var router=express[_0x903c('0x4')]();var isProduction=config[_0x903c('0x5')]==='production'||![];function clientSideLogs(_0x343c27,_0x27bf65,_0x527805){var _0x540c23=_0x343c27[_0x903c('0x6')][_0x903c('0x7')](_0x903c('0x8'));if(!_0x540c23){throw new Error(_0x903c('0x9'));}return beaverLogger[_0x903c('0xa')]({'uri':_0x903c('0xb'),'logger':_0x540c23,'enableCors':!isProduction})(_0x343c27,_0x27bf65,_0x527805);}router[_0x903c('0xc')](auth['isAuthenticated'](),clientSideLogs);module[_0x903c('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 09a4ccb..db9375c 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 _0x062b=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','Google','MicrosoftAzure'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x062b,0xe2));var _0xb062=function(_0x51713e,_0x1343f3){_0x51713e=_0x51713e-0x0;var _0x3e3743=_0x062b[_0x51713e];return _0x3e3743;};'use strict';var Sequelize=require(_0xb062('0x0'));module['exports']={'name':{'type':Sequelize[_0xb062('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb062('0x2')]('AmazonAWS',_0xb062('0x3'),_0xb062('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb062('0x2')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0xb062('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xb062('0x1')],'comment':_0xb062('0x5')},'data3':{'type':Sequelize[_0xb062('0x1')],'comment':_0xb062('0x6')},'data4':{'type':Sequelize[_0xb062('0x1')],'comment':_0xb062('0x7')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xb062('0x8')],'comment':_0xb062('0x9')},'data7':{'type':Sequelize['TEXT'],'comment':_0xb062('0xa')}};
\ No newline at end of file
+var _0x8c9c=['ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c9c,0x83));var _0xc8c9=function(_0x1771aa,_0x59eefb){_0x1771aa=_0x1771aa-0x0;var _0x5f1e82=_0x8c9c[_0x1771aa];return _0x5f1e82;};'use strict';var Sequelize=require('sequelize');module[_0xc8c9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc8c9('0x1')]('AmazonAWS','Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc8c9('0x1')](_0xc8c9('0x2'),_0xc8c9('0x3'))},'data1':{'type':Sequelize['STRING'],'comment':_0xc8c9('0x4')},'data2':{'type':Sequelize[_0xc8c9('0x5')],'comment':_0xc8c9('0x6')},'data3':{'type':Sequelize[_0xc8c9('0x5')],'comment':_0xc8c9('0x7')},'data4':{'type':Sequelize[_0xc8c9('0x5')],'comment':_0xc8c9('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xc8c9('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xc8c9('0x9')],'comment':_0xc8c9('0xa')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 1eaad2e..7321feb 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 _0xaa51=['findAll','rows','service','MicrosoftAzure','data3','catch','show','params','rawAttributes','merge','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','stack','name','padEnd','index','map','CloudProvider','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','type','VIRTUAL','filter','options','includeAll','include'];(function(_0x892f29,_0x3d4087){var _0x233136=function(_0x4f9e85){while(--_0x4f9e85){_0x892f29['push'](_0x892f29['shift']());}};_0x233136(++_0x3d4087);}(_0xaa51,0x92));var _0x1aa5=function(_0x56798d,_0x4b5937){_0x56798d=_0x56798d-0x0;var _0x2667f7=_0xaa51[_0x56798d];return _0x2667f7;};'use strict';var _=require(_0x1aa5('0x0'));var Redis=require(_0x1aa5('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x1aa5('0x2'));var config=require(_0x1aa5('0x3'));var logger=require(_0x1aa5('0x4'))(_0x1aa5('0x5'));var db=require(_0x1aa5('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x1aa5('0x7')]=_[_0x1aa5('0x8')](config[_0x1aa5('0x7')],{'host':_0x1aa5('0x9'),'port':0x18eb});var socket=require(_0x1aa5('0xa'))(new Redis(config[_0x1aa5('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x13eeb1,_0x2680b4){_0x2680b4=_0x2680b4||0xcc;return function(_0x3f849b){if(_0x3f849b){return _0x13eeb1[_0x1aa5('0xb')](_0x2680b4);}return _0x13eeb1[_0x1aa5('0xc')](_0x2680b4)[_0x1aa5('0xd')]();};}function respondWithResult(_0x49692e,_0xdb91e5){_0xdb91e5=_0xdb91e5||0xc8;return function(_0x3096aa){if(_0x3096aa){return _0x49692e[_0x1aa5('0xc')](_0xdb91e5)[_0x1aa5('0xe')](_0x3096aa);}};}function respondWithFilteredResult(_0x2bd5df,_0x1b3c99){return function(_0x4e97b){if(_0x4e97b){var _0x5a822b=typeof _0x1b3c99[_0x1aa5('0xf')]==='undefined'&&typeof _0x1b3c99['limit']===_0x1aa5('0x10');var _0x261b12=_0x4e97b[_0x1aa5('0x11')];var _0x472995=_0x5a822b?0x0:_0x1b3c99[_0x1aa5('0xf')];var _0x51f77c=_0x5a822b?_0x4e97b[_0x1aa5('0x11')]:_0x1b3c99[_0x1aa5('0xf')]+_0x1b3c99[_0x1aa5('0x12')];var _0x83833a;if(_0x51f77c>=_0x261b12){_0x51f77c=_0x261b12;_0x83833a=0xc8;}else{_0x83833a=0xce;}_0x2bd5df[_0x1aa5('0xc')](_0x83833a);return _0x2bd5df[_0x1aa5('0x13')](_0x1aa5('0x14'),_0x472995+'-'+_0x51f77c+'/'+_0x261b12)[_0x1aa5('0xe')](_0x4e97b);}return null;};}function saveUpdates(_0x5a9e26){return function(_0x232ef4){if(_0x232ef4){return _0x232ef4['update'](_0x5a9e26)[_0x1aa5('0x15')](function(_0x2530fd){return _0x2530fd;});}return null;};}function removeEntity(_0x5bdd48){return function(_0xb7757){if(_0xb7757){return _0xb7757[_0x1aa5('0x16')]()['then'](function(){_0x5bdd48['status'](0xcc)[_0x1aa5('0xd')]();});}};}function handleEntityNotFound(_0x309e5a){return function(_0x3b4177){if(!_0x3b4177){_0x309e5a['sendStatus'](0x194);}return _0x3b4177;};}function handleError(_0x478e4d,_0x1b8149){_0x1b8149=_0x1b8149||0x1f4;return function(_0x332066){logger[_0x1aa5('0x17')](_0x332066[_0x1aa5('0x18')]);if(_0x332066[_0x1aa5('0x19')]){delete _0x332066[_0x1aa5('0x19')];}_0x478e4d['status'](_0x1b8149)['send'](_0x332066);};}function maskClientSecret(_0x4b5e6d){return _[_0x1aa5('0x1a')](_0x4b5e6d['slice'](0x0,0x3),0x14,'*');}exports[_0x1aa5('0x1b')]=function(_0x47f587,_0x27672b){var _0x38f618={},_0x229123={},_0x6df553={'count':0x0,'rows':[]};var _0x1292d2=_[_0x1aa5('0x1c')](db[_0x1aa5('0x1d')]['rawAttributes'],function(_0x4f0635){return{'name':_0x4f0635['fieldName'],'type':_0x4f0635['type'][_0x1aa5('0x1e')]};});_0x229123[_0x1aa5('0x1f')]=_[_0x1aa5('0x1c')](_0x1292d2,'name');_0x229123[_0x1aa5('0x20')]=_[_0x1aa5('0x21')](_0x47f587[_0x1aa5('0x20')]);_0x229123['filters']=_[_0x1aa5('0x22')](_0x229123[_0x1aa5('0x1f')],_0x229123['query']);_0x38f618[_0x1aa5('0x23')]=_[_0x1aa5('0x22')](_0x229123[_0x1aa5('0x1f')],qs['fields'](_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x24')]));_0x38f618[_0x1aa5('0x23')]=_0x38f618[_0x1aa5('0x23')][_0x1aa5('0x25')]?_0x38f618[_0x1aa5('0x23')]:_0x229123[_0x1aa5('0x1f')];if(!_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x26')]('nolimit')){_0x38f618[_0x1aa5('0x12')]=qs[_0x1aa5('0x12')](_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x12')]);_0x38f618[_0x1aa5('0xf')]=qs[_0x1aa5('0xf')](_0x47f587[_0x1aa5('0x20')][_0x1aa5('0xf')]);}_0x38f618['order']=qs[_0x1aa5('0x27')](_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x27')]);_0x38f618[_0x1aa5('0x28')]=qs[_0x1aa5('0x29')](_['pick'](_0x47f587[_0x1aa5('0x20')],_0x229123[_0x1aa5('0x29')]),_0x1292d2);if(_0x47f587[_0x1aa5('0x20')]['filter']){_0x38f618[_0x1aa5('0x28')]=_['merge'](_0x38f618[_0x1aa5('0x28')],{'$or':_['map'](_0x1292d2,function(_0x53fc6b){if(_0x53fc6b[_0x1aa5('0x2a')]!==_0x1aa5('0x2b')){var _0x54e884={};_0x54e884[_0x53fc6b[_0x1aa5('0x19')]]={'$like':'%'+_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x2c')]+'%'};return _0x54e884;}})});}_0x38f618=_['merge']({},_0x38f618,_0x47f587[_0x1aa5('0x2d')]);var _0x4c12b2={'where':_0x38f618[_0x1aa5('0x28')]};return db[_0x1aa5('0x1d')]['count'](_0x4c12b2)['then'](function(_0x12aafa){_0x6df553[_0x1aa5('0x11')]=_0x12aafa;if(_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x2e')]){_0x38f618[_0x1aa5('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0x1aa5('0x30')](_0x38f618);})[_0x1aa5('0x15')](function(_0x3339e1){_0x6df553[_0x1aa5('0x31')]=_[_0x1aa5('0x1c')](_0x3339e1,function(_0x2db581){if(_0x2db581[_0x1aa5('0x32')]===_0x1aa5('0x33')){var _0x2e543b=encryptor['decryptString'](_0x2db581['data3']);_0x2db581[_0x1aa5('0x34')]=maskClientSecret(_0x2e543b);}return _0x2db581;});return _0x6df553;})[_0x1aa5('0x15')](respondWithFilteredResult(_0x27672b,_0x38f618))[_0x1aa5('0x35')](handleError(_0x27672b,null));};exports[_0x1aa5('0x36')]=function(_0x50f4b2,_0x58cb0f){var _0x15f487={'raw':!![],'where':{'id':_0x50f4b2[_0x1aa5('0x37')]['id']}},_0x552389={};_0x552389[_0x1aa5('0x1f')]=_[_0x1aa5('0x21')](db['CloudProvider'][_0x1aa5('0x38')]);_0x552389[_0x1aa5('0x20')]=_['keys'](_0x50f4b2[_0x1aa5('0x20')]);_0x552389[_0x1aa5('0x29')]=_[_0x1aa5('0x22')](_0x552389['model'],_0x552389[_0x1aa5('0x20')]);_0x15f487['attributes']=_[_0x1aa5('0x22')](_0x552389[_0x1aa5('0x1f')],qs['fields'](_0x50f4b2[_0x1aa5('0x20')]['fields']));_0x15f487['attributes']=_0x15f487[_0x1aa5('0x23')]['length']?_0x15f487['attributes']:_0x552389['model'];if(_0x50f4b2['query']['includeAll']){_0x15f487['include']=[{'all':!![]}];}_0x15f487=_[_0x1aa5('0x39')]({},_0x15f487,_0x50f4b2['options']);return db[_0x1aa5('0x1d')][_0x1aa5('0x3a')](_0x15f487)[_0x1aa5('0x15')](handleEntityNotFound(_0x58cb0f,null))[_0x1aa5('0x15')](function(_0x35af36){if(_0x35af36[_0x1aa5('0x32')]===_0x1aa5('0x33')){var _0x7af12c=encryptor[_0x1aa5('0x3b')](_0x35af36[_0x1aa5('0x34')]);_0x35af36[_0x1aa5('0x34')]=maskClientSecret(_0x7af12c);}return _0x35af36;})[_0x1aa5('0x15')](respondWithResult(_0x58cb0f,null))[_0x1aa5('0x35')](handleError(_0x58cb0f,null));};exports[_0x1aa5('0x3c')]=function(_0xe18710,_0xa0176c){if(!_0xe18710[_0x1aa5('0x3d')][_0x1aa5('0x19')])throw new Error(_0x1aa5('0x3e'));if(!_0xe18710[_0x1aa5('0x3d')][_0x1aa5('0x32')])throw new Error(_0x1aa5('0x3f'));var _0x3877a7=db['CloudProvider'][_0x1aa5('0x38')][_0x1aa5('0x32')][_0x1aa5('0x40')];if(!_0x3877a7[_0x1aa5('0x41')](_0xe18710[_0x1aa5('0x3d')][_0x1aa5('0x32')]))throw new Error(_0x1aa5('0x42')+_0x3877a7['join'](',\x20'));if(_0xe18710[_0x1aa5('0x3d')]['service']===_0x1aa5('0x33')&&_0xe18710['body'][_0x1aa5('0x34')]){_0xe18710[_0x1aa5('0x3d')][_0x1aa5('0x34')]=encryptor[_0x1aa5('0x43')](_0xe18710['body'][_0x1aa5('0x34')]);}return db[_0x1aa5('0x1d')][_0x1aa5('0x3c')](_0xe18710[_0x1aa5('0x3d')],{})[_0x1aa5('0x15')](respondWithResult(_0xa0176c,0xc9))[_0x1aa5('0x35')](handleError(_0xa0176c,null));};exports[_0x1aa5('0x44')]=function(_0x3fc218,_0x33fada){if(_0x3fc218[_0x1aa5('0x3d')]['id']){delete _0x3fc218[_0x1aa5('0x3d')]['id'];}return db[_0x1aa5('0x1d')][_0x1aa5('0x3a')]({'where':{'id':_0x3fc218[_0x1aa5('0x37')]['id']}})[_0x1aa5('0x15')](handleEntityNotFound(_0x33fada,null))[_0x1aa5('0x15')](function(_0xb8caa9){if(_0xb8caa9[_0x1aa5('0x32')]===_0x1aa5('0x33')&&_0x3fc218[_0x1aa5('0x3d')][_0x1aa5('0x34')]){_0x3fc218['body']['data3']=encryptor['encryptString'](_0x3fc218[_0x1aa5('0x3d')][_0x1aa5('0x34')]);}return _0xb8caa9;})['then'](saveUpdates(_0x3fc218[_0x1aa5('0x3d')],null))[_0x1aa5('0x15')](respondWithResult(_0x33fada,null))[_0x1aa5('0x35')](handleError(_0x33fada,null));};exports['destroy']=function(_0x3cf84b,_0x2d0cce){return db[_0x1aa5('0x1d')][_0x1aa5('0x3a')]({'where':{'id':_0x3cf84b[_0x1aa5('0x37')]['id']}})[_0x1aa5('0x15')](handleEntityNotFound(_0x2d0cce,null))[_0x1aa5('0x15')](removeEntity(_0x2d0cce,null))[_0x1aa5('0x35')](handleError(_0x2d0cce,null));};exports[_0x1aa5('0x45')]=function(_0x274ed0,_0x3baf54){return db['CloudProvider'][_0x1aa5('0x46')]({'where':{'id':_0x274ed0['params']['id']},'raw':!![]})['then'](function(_0xec58e7){if(!_0xec58e7)return _0x3baf54[_0x1aa5('0xb')](0x194);return{'url':oauth[_0x1aa5('0x47')](_0xec58e7,_0x274ed0[_0x1aa5('0x48')]['id'])};})[_0x1aa5('0x15')](respondWithResult(_0x3baf54,null))['catch'](handleError(_0x3baf54,null));};exports[_0x1aa5('0x49')]=function(_0x35649a,_0x201ec9){var _0x44088d=_0x35649a['body'];var _0x2ad6a5;var _0x46497e;if(_0x44088d[_0x1aa5('0x17')])throw _0x44088d;redis[_0x1aa5('0x4a')](_0x44088d[_0x1aa5('0x4b')])[_0x1aa5('0x15')](function(_0x1b2a38){if(!_0x1b2a38)throw new Error(_0x1aa5('0x4c'));_0x2ad6a5=JSON[_0x1aa5('0x4d')](_0x1b2a38);var _0x3999d9=Buffer[_0x1aa5('0x4e')](_0x44088d[_0x1aa5('0x4b')],_0x1aa5('0x4f'))[_0x1aa5('0x50')]('ascii');_0x46497e=JSON[_0x1aa5('0x4d')](_0x3999d9);if(!oauth[_0x1aa5('0x51')](_0x44088d[_0x1aa5('0x52')],_0x2ad6a5[_0x1aa5('0x53')]))throw new Error(_0x1aa5('0x54'));redis[_0x1aa5('0x55')](_0x44088d[_0x1aa5('0x4b')]);return oauth[_0x1aa5('0x56')](_0x44088d[_0x1aa5('0x57')],_0x2ad6a5);})[_0x1aa5('0x15')](function(_0x409801){_0x2ad6a5['data5']=_0x409801[_0x1aa5('0x58')];_0x2ad6a5[_0x1aa5('0x59')]=_0x409801[_0x1aa5('0x5a')];return db['CloudProvider'][_0x1aa5('0x44')]({'data5':_0x2ad6a5['data5'],'data6':_0x2ad6a5['data6']},{'where':{'id':_0x2ad6a5['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x2ad6a5);socket['emit']('microsoftAuthorization:success',{'id':_0x46497e['id']});return;})[_0x1aa5('0x15')](respondWithStatusCode(_0x201ec9,null))[_0x1aa5('0x35')](function(_0x1deb53){if(_0x46497e){socket[_0x1aa5('0x5b')](_0x1aa5('0x5c'),{'id':_0x46497e['id']});}if(!_0x2ad6a5){logger[_0x1aa5('0x17')](_0x1aa5('0x5d'),_0x1deb53);return _0x201ec9[_0x1aa5('0xc')](0x1f4)[_0x1aa5('0x5e')](_0x1deb53['message']);}logger[_0x1aa5('0x17')](_0x1aa5('0x5f'),_0x2ad6a5['id'],JSON[_0x1aa5('0x60')](_0x1deb53));});};
\ No newline at end of file
+var _0x0149=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','error','from','state','base64','toString','ascii','parse','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','data6','refresh_token','microsoftAuthorization:success','emit','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit'];(function(_0x5d77d8,_0x359738){var _0x39996f=function(_0x49c571){while(--_0x49c571){_0x5d77d8['push'](_0x5d77d8['shift']());}};_0x39996f(++_0x359738);}(_0x0149,0xec));var _0x9014=function(_0x214aaa,_0x4e5f99){_0x214aaa=_0x214aaa-0x0;var _0x2152fe=_0x0149[_0x214aaa];return _0x2152fe;};'use strict';var _=require(_0x9014('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x9014('0x1'));var logger=require(_0x9014('0x2'))('api');var db=require(_0x9014('0x3'))['db'];var oauth=require(_0x9014('0x4'));config[_0x9014('0x5')]=_['defaults'](config[_0x9014('0x5')],{'host':_0x9014('0x6'),'port':0x18eb});var socket=require(_0x9014('0x7'))(new Redis(config['redis']));var redis=new Redis(config[_0x9014('0x5')]);function respondWithStatusCode(_0x36b843,_0x40d6ac){_0x40d6ac=_0x40d6ac||0xcc;return function(_0x4c8617){if(_0x4c8617){return _0x36b843[_0x9014('0x8')](_0x40d6ac);}return _0x36b843[_0x9014('0x9')](_0x40d6ac)[_0x9014('0xa')]();};}function respondWithResult(_0x416aa1,_0x574225){_0x574225=_0x574225||0xc8;return function(_0x48a3be){if(_0x48a3be){return _0x416aa1['status'](_0x574225)[_0x9014('0xb')](_0x48a3be);}};}function respondWithFilteredResult(_0x399604,_0x18cfd5){return function(_0x9277a7){if(_0x9277a7){var _0xedb515=typeof _0x18cfd5[_0x9014('0xc')]===_0x9014('0xd')&&typeof _0x18cfd5[_0x9014('0xe')]===_0x9014('0xd');var _0x3e1898=_0x9277a7[_0x9014('0xf')];var _0x5a768f=_0xedb515?0x0:_0x18cfd5[_0x9014('0xc')];var _0xefee37=_0xedb515?_0x9277a7['count']:_0x18cfd5['offset']+_0x18cfd5[_0x9014('0xe')];var _0x47ea77;if(_0xefee37>=_0x3e1898){_0xefee37=_0x3e1898;_0x47ea77=0xc8;}else{_0x47ea77=0xce;}_0x399604[_0x9014('0x9')](_0x47ea77);return _0x399604[_0x9014('0x10')](_0x9014('0x11'),_0x5a768f+'-'+_0xefee37+'/'+_0x3e1898)[_0x9014('0xb')](_0x9277a7);}return null;};}function saveUpdates(_0x2c0706){return function(_0x494523){if(_0x494523){return _0x494523[_0x9014('0x12')](_0x2c0706)[_0x9014('0x13')](function(_0x40bd76){return _0x40bd76;});}return null;};}function removeEntity(_0x2fe877){return function(_0x1ebcfb){if(_0x1ebcfb){return _0x1ebcfb[_0x9014('0x14')]()[_0x9014('0x13')](function(){_0x2fe877[_0x9014('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x140d02){return function(_0x23f6eb){if(!_0x23f6eb){_0x140d02['sendStatus'](0x194);}return _0x23f6eb;};}function handleError(_0x30a32d,_0x40a86){_0x40a86=_0x40a86||0x1f4;return function(_0x5f4885){logger['error'](_0x5f4885[_0x9014('0x15')]);if(_0x5f4885[_0x9014('0x16')]){delete _0x5f4885[_0x9014('0x16')];}_0x30a32d[_0x9014('0x9')](_0x40a86)[_0x9014('0x17')](_0x5f4885);};}function maskClientSecret(_0xa56b71){return _[_0x9014('0x18')](_0xa56b71[_0x9014('0x19')](0x0,0x3),0x14,'*');}exports[_0x9014('0x1a')]=function(_0x52772b,_0x1cbdac){var _0x1212b4={},_0x5668e2={},_0x427f56={'count':0x0,'rows':[]};var _0x30bcf6=_[_0x9014('0x1b')](db[_0x9014('0x1c')][_0x9014('0x1d')],function(_0x2c8825){return{'name':_0x2c8825[_0x9014('0x1e')],'type':_0x2c8825[_0x9014('0x1f')]['key']};});_0x5668e2['model']=_['map'](_0x30bcf6,_0x9014('0x16'));_0x5668e2[_0x9014('0x20')]=_[_0x9014('0x21')](_0x52772b['query']);_0x5668e2['filters']=_[_0x9014('0x22')](_0x5668e2[_0x9014('0x23')],_0x5668e2[_0x9014('0x20')]);_0x1212b4[_0x9014('0x24')]=_[_0x9014('0x22')](_0x5668e2[_0x9014('0x23')],qs[_0x9014('0x25')](_0x52772b[_0x9014('0x20')][_0x9014('0x25')]));_0x1212b4[_0x9014('0x24')]=_0x1212b4[_0x9014('0x24')][_0x9014('0x26')]?_0x1212b4['attributes']:_0x5668e2[_0x9014('0x23')];if(!_0x52772b[_0x9014('0x20')]['hasOwnProperty'](_0x9014('0x27'))){_0x1212b4[_0x9014('0xe')]=qs['limit'](_0x52772b['query'][_0x9014('0xe')]);_0x1212b4['offset']=qs[_0x9014('0xc')](_0x52772b[_0x9014('0x20')][_0x9014('0xc')]);}_0x1212b4[_0x9014('0x28')]=qs[_0x9014('0x29')](_0x52772b[_0x9014('0x20')]['sort']);_0x1212b4[_0x9014('0x2a')]=qs[_0x9014('0x2b')](_[_0x9014('0x2c')](_0x52772b['query'],_0x5668e2[_0x9014('0x2b')]),_0x30bcf6);if(_0x52772b[_0x9014('0x20')][_0x9014('0x2d')]){_0x1212b4[_0x9014('0x2a')]=_[_0x9014('0x2e')](_0x1212b4[_0x9014('0x2a')],{'$or':_[_0x9014('0x1b')](_0x30bcf6,function(_0x56c269){if(_0x56c269[_0x9014('0x1f')]!==_0x9014('0x2f')){var _0x460a6f={};_0x460a6f[_0x56c269['name']]={'$like':'%'+_0x52772b[_0x9014('0x20')]['filter']+'%'};return _0x460a6f;}})});}_0x1212b4=_[_0x9014('0x2e')]({},_0x1212b4,_0x52772b[_0x9014('0x30')]);var _0x5ca65c={'where':_0x1212b4['where']};return db[_0x9014('0x1c')][_0x9014('0xf')](_0x5ca65c)[_0x9014('0x13')](function(_0x4f86d6){_0x427f56[_0x9014('0xf')]=_0x4f86d6;if(_0x52772b['query'][_0x9014('0x31')]){_0x1212b4[_0x9014('0x32')]=[{'all':!![]}];}return db[_0x9014('0x1c')][_0x9014('0x33')](_0x1212b4);})['then'](function(_0x1520dd){_0x427f56[_0x9014('0x34')]=_['map'](_0x1520dd,function(_0x3cc077){if(_0x3cc077[_0x9014('0x35')]===_0x9014('0x36')){var _0xa28908=encryptor[_0x9014('0x37')](_0x3cc077[_0x9014('0x38')]);_0x3cc077[_0x9014('0x38')]=maskClientSecret(_0xa28908);}return _0x3cc077;});return _0x427f56;})[_0x9014('0x13')](respondWithFilteredResult(_0x1cbdac,_0x1212b4))[_0x9014('0x39')](handleError(_0x1cbdac,null));};exports[_0x9014('0x3a')]=function(_0x57aa09,_0x376223){var _0x4cfa8d={'raw':!![],'where':{'id':_0x57aa09[_0x9014('0x3b')]['id']}},_0x107474={};_0x107474[_0x9014('0x23')]=_['keys'](db[_0x9014('0x1c')][_0x9014('0x1d')]);_0x107474[_0x9014('0x20')]=_[_0x9014('0x21')](_0x57aa09['query']);_0x107474[_0x9014('0x2b')]=_[_0x9014('0x22')](_0x107474['model'],_0x107474[_0x9014('0x20')]);_0x4cfa8d[_0x9014('0x24')]=_[_0x9014('0x22')](_0x107474[_0x9014('0x23')],qs['fields'](_0x57aa09[_0x9014('0x20')]['fields']));_0x4cfa8d['attributes']=_0x4cfa8d[_0x9014('0x24')][_0x9014('0x26')]?_0x4cfa8d['attributes']:_0x107474['model'];if(_0x57aa09[_0x9014('0x20')][_0x9014('0x31')]){_0x4cfa8d[_0x9014('0x32')]=[{'all':!![]}];}_0x4cfa8d=_[_0x9014('0x2e')]({},_0x4cfa8d,_0x57aa09['options']);return db[_0x9014('0x1c')][_0x9014('0x3c')](_0x4cfa8d)[_0x9014('0x13')](handleEntityNotFound(_0x376223,null))['then'](function(_0x57ff58){if(_0x57ff58[_0x9014('0x35')]===_0x9014('0x36')){var _0xd208e7=encryptor['decryptString'](_0x57ff58[_0x9014('0x38')]);_0x57ff58[_0x9014('0x38')]=maskClientSecret(_0xd208e7);}return _0x57ff58;})[_0x9014('0x13')](respondWithResult(_0x376223,null))[_0x9014('0x39')](handleError(_0x376223,null));};exports[_0x9014('0x3d')]=function(_0x1d14dc,_0x53ab43){if(!_0x1d14dc[_0x9014('0x3e')][_0x9014('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1d14dc[_0x9014('0x3e')][_0x9014('0x35')])throw new Error(_0x9014('0x3f'));var _0xf46db2=db['CloudProvider']['rawAttributes'][_0x9014('0x35')][_0x9014('0x40')];if(!_0xf46db2[_0x9014('0x41')](_0x1d14dc[_0x9014('0x3e')]['service']))throw new Error(_0x9014('0x42')+_0xf46db2[_0x9014('0x43')](',\x20'));if(_0x1d14dc[_0x9014('0x3e')][_0x9014('0x35')]===_0x9014('0x36')&&_0x1d14dc[_0x9014('0x3e')][_0x9014('0x38')]){_0x1d14dc[_0x9014('0x3e')][_0x9014('0x38')]=encryptor[_0x9014('0x44')](_0x1d14dc[_0x9014('0x3e')]['data3']);}return db['CloudProvider']['create'](_0x1d14dc[_0x9014('0x3e')],{})['then'](respondWithResult(_0x53ab43,0xc9))[_0x9014('0x39')](handleError(_0x53ab43,null));};exports[_0x9014('0x12')]=function(_0x1a2fcc,_0x4cccac){if(_0x1a2fcc[_0x9014('0x3e')]['id']){delete _0x1a2fcc['body']['id'];}return db[_0x9014('0x1c')][_0x9014('0x3c')]({'where':{'id':_0x1a2fcc[_0x9014('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4cccac,null))[_0x9014('0x13')](function(_0xcb09d3){if(_0xcb09d3[_0x9014('0x35')]===_0x9014('0x36')&&_0x1a2fcc[_0x9014('0x3e')]['data3']){_0x1a2fcc[_0x9014('0x3e')]['data3']=encryptor[_0x9014('0x44')](_0x1a2fcc[_0x9014('0x3e')][_0x9014('0x38')]);}return _0xcb09d3;})[_0x9014('0x13')](saveUpdates(_0x1a2fcc[_0x9014('0x3e')],null))['then'](respondWithResult(_0x4cccac,null))['catch'](handleError(_0x4cccac,null));};exports[_0x9014('0x14')]=function(_0x332820,_0x7cd0a0){return db[_0x9014('0x1c')][_0x9014('0x3c')]({'where':{'id':_0x332820[_0x9014('0x3b')]['id']}})['then'](handleEntityNotFound(_0x7cd0a0,null))[_0x9014('0x13')](removeEntity(_0x7cd0a0,null))[_0x9014('0x39')](handleError(_0x7cd0a0,null));};exports[_0x9014('0x45')]=function(_0x234df2,_0x84db63){return db[_0x9014('0x1c')][_0x9014('0x46')]({'where':{'id':_0x234df2['params']['id']},'raw':!![]})[_0x9014('0x13')](function(_0x28cf76){if(!_0x28cf76)return _0x84db63[_0x9014('0x8')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x28cf76,_0x234df2[_0x9014('0x47')]['id'])};})[_0x9014('0x13')](respondWithResult(_0x84db63,null))[_0x9014('0x39')](handleError(_0x84db63,null));};exports[_0x9014('0x48')]=function(_0x32b6ab,_0x5cfe90){var _0x4b8a5b=_0x32b6ab[_0x9014('0x3e')];var _0x44a1c3;var _0x5330ad;if(_0x4b8a5b[_0x9014('0x49')])throw _0x4b8a5b;redis['get'](_0x4b8a5b['state'])['then'](function(_0x5ef190){if(!_0x5ef190)throw new Error('Invalid\x20state\x20parameter');_0x44a1c3=JSON['parse'](_0x5ef190);var _0x1a90ba=Buffer[_0x9014('0x4a')](_0x4b8a5b[_0x9014('0x4b')],_0x9014('0x4c'))[_0x9014('0x4d')](_0x9014('0x4e'));_0x5330ad=JSON[_0x9014('0x4f')](_0x1a90ba);if(!oauth[_0x9014('0x50')](_0x4b8a5b['id_token'],_0x44a1c3['oauth2Claims']))throw new Error(_0x9014('0x51'));redis[_0x9014('0x52')](_0x4b8a5b[_0x9014('0x4b')]);return oauth[_0x9014('0x53')](_0x4b8a5b['code'],_0x44a1c3);})[_0x9014('0x13')](function(_0x457d90){_0x44a1c3[_0x9014('0x54')]=_0x457d90['access_token'];_0x44a1c3[_0x9014('0x55')]=_0x457d90[_0x9014('0x56')];return db['CloudProvider']['update']({'data5':_0x44a1c3['data5'],'data6':_0x44a1c3[_0x9014('0x55')]},{'where':{'id':_0x44a1c3['id']}});})[_0x9014('0x13')](function(){oauth['startRefreshInterval'](_0x44a1c3);socket['emit'](_0x9014('0x57'),{'id':_0x5330ad['id']});return;})[_0x9014('0x13')](respondWithStatusCode(_0x5cfe90,null))['catch'](function(_0x93dd4c){if(_0x5330ad){socket[_0x9014('0x58')]('microsoftAuthorization:error',{'id':_0x5330ad['id']});}if(!_0x44a1c3){logger['error'](_0x9014('0x59'),_0x93dd4c);return _0x5cfe90['status'](0x1f4)['send'](_0x93dd4c['message']);}logger[_0x9014('0x49')](_0x9014('0x5a'),_0x44a1c3['id'],JSON[_0x9014('0x5b')](_0x93dd4c));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 5e06edb..3de0970 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 _0x6f53=['bluebird','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x53cd94,_0xdb71b0){var _0x1d3b02=function(_0x789d69){while(--_0x789d69){_0x53cd94['push'](_0x53cd94['shift']());}};_0x1d3b02(++_0xdb71b0);}(_0x6f53,0x19f));var _0x36f5=function(_0x31c81b,_0x20f535){_0x31c81b=_0x31c81b-0x0;var _0x371034=_0x6f53[_0x31c81b];return _0x371034;};'use strict';var _=require(_0x36f5('0x0'));var util=require(_0x36f5('0x1'));var logger=require(_0x36f5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x36f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36f5('0x4'));var rimraf=require(_0x36f5('0x5'));var config=require('../../config/environment');var attributes=require(_0x36f5('0x6'));module[_0x36f5('0x7')]=function(_0x536c03,_0x3d9bf3){return _0x536c03[_0x36f5('0x8')](_0x36f5('0x9'),attributes,{'tableName':_0x36f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x72f5=['CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x5bc347,_0x328f6f){var _0x28622b=function(_0x586dbe){while(--_0x586dbe){_0x5bc347['push'](_0x5bc347['shift']());}};_0x28622b(++_0x328f6f);}(_0x72f5,0x144));var _0x572f=function(_0x135b16,_0x5dc1ce){_0x135b16=_0x135b16-0x0;var _0x33071c=_0x72f5[_0x135b16];return _0x33071c;};'use strict';var _=require(_0x572f('0x0'));var util=require(_0x572f('0x1'));var logger=require(_0x572f('0x2'))('api');var moment=require(_0x572f('0x3'));var BPromise=require(_0x572f('0x4'));var rp=require(_0x572f('0x5'));var fs=require('fs');var path=require(_0x572f('0x6'));var rimraf=require(_0x572f('0x7'));var config=require(_0x572f('0x8'));var attributes=require(_0x572f('0x9'));module[_0x572f('0xa')]=function(_0x2c9383,_0x2c7e4a){return _0x2c9383[_0x572f('0xb')](_0x572f('0xc'),attributes,{'tableName':_0x572f('0xd'),'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 5741dae..12350b1 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 _0x8559=['../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','Dynamics365','/.default','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','data1','response_type','join','redirect_uri','data4','form_post','scope','state','nonce','login','key','value','oauth2Claims','replace','oauth2/','decode','payload','iss','issuer','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor'];(function(_0x218554,_0x2896f4){var _0x3a2bbf=function(_0x106868){while(--_0x106868){_0x218554['push'](_0x218554['shift']());}};_0x3a2bbf(++_0x2896f4);}(_0x8559,0x175));var _0x9855=function(_0xcd47a,_0x100962){_0xcd47a=_0xcd47a-0x0;var _0x4b58dd=_0x8559[_0xcd47a];return _0x4b58dd;};'use strict';var _=require('lodash');var crypto=require(_0x9855('0x0'));var jwt=require(_0x9855('0x1'));var moment=require(_0x9855('0x2'));var Redis=require(_0x9855('0x3'));var rp=require(_0x9855('0x4'));var util=require(_0x9855('0x5'));var encryptor=require(_0x9855('0x6'));var config=require(_0x9855('0x7'));var logger=require(_0x9855('0x8'))(_0x9855('0x9'));var schedule=require(_0x9855('0xa'));var db=require(_0x9855('0xb'))['db'];config[_0x9855('0xc')]=_[_0x9855('0xd')](config[_0x9855('0xc')],{'host':_0x9855('0xe'),'port':0x18eb});var redis=new Redis(config[_0x9855('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9855('0xf'),_0x9855('0x10'),'offline_access',_0x9855('0x11'),_0x9855('0x12'),_0x9855('0x13')],'Dynamics365':[_0x9855('0x14'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x9855('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4727da){var _0x2d6e66=_[_0x9855('0x16')](AZURE_AUTH_SCOPES[_0x4727da[_0x9855('0x17')]]);if(_0x4727da[_0x9855('0x17')]===_0x9855('0x18'))_0x2d6e66['push'](_0x4727da['data7']+_0x9855('0x19'));return _0x2d6e66['join']('\x20');}function getAccessTokenScope(_0x718a08){if(_0x718a08[_0x9855('0x17')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x718a08[_0x9855('0x17')]===_0x9855('0x18'))return _0x718a08['data7']+_0x9855('0x19');}function generateMicrosoftAuthorizationUrl(_0x28cd68,_0x27afd4){var _0x5b1953=MICROSOFT_AUTH_URL['replace'](_0x9855('0x1a'),_0x28cd68[_0x9855('0x1b')]);var _0xaec9f2=[_0x9855('0x1c'),_0x9855('0x1d')];var _0x17bcfe=Buffer[_0x9855('0x1e')](JSON[_0x9855('0x1f')]({'id':_0x27afd4}))[_0x9855('0x20')](_0x9855('0x21'));var _0x72bc7a=crypto[_0x9855('0x22')](0x10)[_0x9855('0x20')]('hex');var _0x126b20=getAuthorizationScopes(_0x28cd68);var _0x562828=[{'key':'client_id','value':_0x28cd68[_0x9855('0x23')]},{'key':_0x9855('0x24'),'value':encodeURIComponent(_0xaec9f2[_0x9855('0x25')]('\x20'))},{'key':_0x9855('0x26'),'value':_0x28cd68[_0x9855('0x27')]},{'key':'response_mode','value':_0x9855('0x28')},{'key':_0x9855('0x29'),'value':encodeURIComponent(_0x126b20)},{'key':_0x9855('0x2a'),'value':_0x17bcfe},{'key':_0x9855('0x2b'),'value':_0x72bc7a},{'key':'prompt','value':_0x9855('0x2c')}];var _0x577d6a=_0x5b1953+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9855('0x16')](_0x562828,function(_0x1db66c){return _0x1db66c[_0x9855('0x2d')]+'='+_0x1db66c[_0x9855('0x2e')];})[_0x9855('0x25')]('&');_0x28cd68[_0x9855('0x2f')]={'issuer':_0x5b1953[_0x9855('0x30')](_0x9855('0x31'),''),'audience':_0x28cd68[_0x9855('0x23')],'state':_0x17bcfe,'nonce':_0x72bc7a};redis['set'](_0x17bcfe,JSON[_0x9855('0x1f')](_0x28cd68));return _0x577d6a;}function isValidIdToken(_0x805928,_0x310a39){try{var _0x1705e1=jwt[_0x9855('0x32')](_0x805928,{'complete':!![]});var _0x41e902=_0x1705e1[_0x9855('0x33')];if(_0x41e902[_0x9855('0x34')]!==_0x310a39[_0x9855('0x35')])return![];if(_0x41e902[_0x9855('0x36')]!==_0x310a39['audience'])return![];if(_0x41e902[_0x9855('0x2b')]!==_0x310a39[_0x9855('0x2b')])return![];if(moment()['isAfter'](moment[_0x9855('0x37')](_0x41e902[_0x9855('0x38')])))return![];return!![];}catch(_0x40bdd8){throw _0x40bdd8;}}function refreshOauth2MicrosoftAccessToken(_0x3b9936){return Promise[_0x9855('0x39')]()[_0x9855('0x3a')](function(){if(_0x3b9936[_0x9855('0x3b')])return _0x3b9936;return db[_0x9855('0x3c')][_0x9855('0x3d')]({'where':{'id':_0x3b9936['id']},'raw':!![]});})[_0x9855('0x3a')](function(_0x5ef6d3){var _0x11714a={'grant_type':_0x9855('0x3e'),'refresh_token':_0x5ef6d3[_0x9855('0x3f')],'scope':getAccessTokenScope(_0x5ef6d3),'redirect_uri':_0x5ef6d3[_0x9855('0x27')],'client_id':_0x5ef6d3['data1'],'client_secret':encryptor[_0x9855('0x40')](_0x5ef6d3[_0x9855('0x3b')])};var _0xc37255={'method':_0x9855('0x41'),'uri':MICROSOFT_AUTH_URL[_0x9855('0x30')](_0x9855('0x1a'),_0x5ef6d3[_0x9855('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11714a,'json':!![]};return rp(_0xc37255);})[_0x9855('0x3a')](function(_0x526b5e){_0x3b9936[_0x9855('0x42')]=_0x526b5e[_0x9855('0x43')];_0x3b9936[_0x9855('0x3f')]=_0x526b5e[_0x9855('0x3e')];return db[_0x9855('0x3c')]['update']({'data5':_0x3b9936[_0x9855('0x42')],'data6':_0x3b9936[_0x9855('0x3f')]},{'where':{'id':_0x3b9936['id']}});})[_0x9855('0x3a')](function(){return _0x3b9936;})[_0x9855('0x44')](function(_0x3d871e){logger[_0x9855('0x45')](_0x9855('0x46'),_0x3b9936['id'],_0x3d871e);});}function getOauth2MicrosoftAccessToken(_0x15d482,_0x4f5132){var _0x1e4add={'grant_type':'authorization_code','code':_0x15d482,'scope':getAccessTokenScope(_0x4f5132),'redirect_uri':_0x4f5132['data4'],'client_id':_0x4f5132[_0x9855('0x23')],'client_secret':encryptor[_0x9855('0x40')](_0x4f5132[_0x9855('0x3b')])};var _0x284dd2={'method':_0x9855('0x41'),'uri':MICROSOFT_AUTH_URL[_0x9855('0x30')](_0x9855('0x1a'),_0x4f5132[_0x9855('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1e4add,'json':!![]};return rp(_0x284dd2);}function startRefreshInterval(_0x1d2187){var _0x3cae93=schedule[_0x9855('0x47')];if(_0x3cae93[_0x1d2187['id']])clearInterval(_0x3cae93[_0x1d2187['id']]);_0x3cae93[_0x1d2187['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1d2187['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9855('0x47')]=_0x3cae93;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x9855('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9855('0x3a')](function(_0x4cb1c4){var _0x30a2f1=_0x4cb1c4[_0x9855('0x16')](function(_0x496b56){return refreshOauth2MicrosoftAccessToken(_0x496b56)[_0x9855('0x3a')](function(_0x4f1ec9){startRefreshInterval(_0x4f1ec9);});});return Promise[_0x9855('0x49')](_0x30a2f1);})[_0x9855('0x44')](function(_0x3f6f80){var _0x53316f=_0x3f6f80?util[_0x9855('0x4a')](_0x3f6f80,{'showHidden':![],'depth':null}):'';logger[_0x9855('0x45')](_0x9855('0x4b'),_0x53316f);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x380b=['state','nonce','login','key','value','join','oauth2Claims','oauth2/','decode','payload','issuer','aud','audience','isAfter','unix','resolve','data3','CloudProvider','then','refresh_token','data6','data4','decryptString','POST','data2','access_token','update','data5','catch','error','authorization_code','bind','intervals','findAll','all','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','code','id_token','from','stringify','toString','base64','randomBytes','client_id','data1','response_type','response_mode','scope'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x380b,0x195));var _0xb380=function(_0x332b6a,_0x974da3){_0x332b6a=_0x332b6a-0x0;var _0x23db9d=_0x380b[_0x332b6a];return _0x23db9d;};'use strict';var _=require(_0xb380('0x0'));var crypto=require(_0xb380('0x1'));var jwt=require(_0xb380('0x2'));var moment=require(_0xb380('0x3'));var Redis=require(_0xb380('0x4'));var rp=require('request-promise');var util=require(_0xb380('0x5'));var encryptor=require(_0xb380('0x6'));var config=require(_0xb380('0x7'));var logger=require(_0xb380('0x8'))('api');var schedule=require(_0xb380('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xb380('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xb380('0xa')]);var MICROSOFT_AUTH_URL=_0xb380('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xb380('0xc'),'email',_0xb380('0xd'),_0xb380('0xe'),_0xb380('0xf'),_0xb380('0x10')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xb380('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xb380('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xeb0bf1){var _0x4a4817=_[_0xb380('0x13')](AZURE_AUTH_SCOPES[_0xeb0bf1[_0xb380('0x14')]]);if(_0xeb0bf1['type']===_0xb380('0x15'))_0x4a4817[_0xb380('0x16')](_0xeb0bf1[_0xb380('0x17')]+_0xb380('0x18'));return _0x4a4817['join']('\x20');}function getAccessTokenScope(_0xc0d448){if(_0xc0d448[_0xb380('0x14')]==='Outlook365')return _0xb380('0xe');if(_0xc0d448[_0xb380('0x14')]===_0xb380('0x15'))return _0xc0d448[_0xb380('0x17')]+_0xb380('0x18');}function generateMicrosoftAuthorizationUrl(_0xf63433,_0x42b1b3){var _0xe54671=MICROSOFT_AUTH_URL[_0xb380('0x19')](_0xb380('0x1a'),_0xf63433['data2']);var _0x1bd1a1=[_0xb380('0x1b'),_0xb380('0x1c')];var _0xdef70e=Buffer[_0xb380('0x1d')](JSON[_0xb380('0x1e')]({'id':_0x42b1b3}))[_0xb380('0x1f')](_0xb380('0x20'));var _0xec7e90=crypto[_0xb380('0x21')](0x10)['toString']('hex');var _0x1273bd=getAuthorizationScopes(_0xf63433);var _0x5ba60f=[{'key':_0xb380('0x22'),'value':_0xf63433[_0xb380('0x23')]},{'key':_0xb380('0x24'),'value':encodeURIComponent(_0x1bd1a1['join']('\x20'))},{'key':'redirect_uri','value':_0xf63433['data4']},{'key':_0xb380('0x25'),'value':'form_post'},{'key':_0xb380('0x26'),'value':encodeURIComponent(_0x1273bd)},{'key':_0xb380('0x27'),'value':_0xdef70e},{'key':_0xb380('0x28'),'value':_0xec7e90},{'key':'prompt','value':_0xb380('0x29')}];var _0x1875eb=_0xe54671+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb380('0x13')](_0x5ba60f,function(_0x128947){return _0x128947[_0xb380('0x2a')]+'='+_0x128947[_0xb380('0x2b')];})[_0xb380('0x2c')]('&');_0xf63433[_0xb380('0x2d')]={'issuer':_0xe54671[_0xb380('0x19')](_0xb380('0x2e'),''),'audience':_0xf63433[_0xb380('0x23')],'state':_0xdef70e,'nonce':_0xec7e90};redis['set'](_0xdef70e,JSON[_0xb380('0x1e')](_0xf63433));return _0x1875eb;}function isValidIdToken(_0x18cade,_0xc8980c){try{var _0xb4cbd9=jwt[_0xb380('0x2f')](_0x18cade,{'complete':!![]});var _0x1222f1=_0xb4cbd9[_0xb380('0x30')];if(_0x1222f1['iss']!==_0xc8980c[_0xb380('0x31')])return![];if(_0x1222f1[_0xb380('0x32')]!==_0xc8980c[_0xb380('0x33')])return![];if(_0x1222f1[_0xb380('0x28')]!==_0xc8980c[_0xb380('0x28')])return![];if(moment()[_0xb380('0x34')](moment[_0xb380('0x35')](_0x1222f1['exp'])))return![];return!![];}catch(_0x1d0173){throw _0x1d0173;}}function refreshOauth2MicrosoftAccessToken(_0x263020){return Promise[_0xb380('0x36')]()['then'](function(){if(_0x263020[_0xb380('0x37')])return _0x263020;return db[_0xb380('0x38')]['findOne']({'where':{'id':_0x263020['id']},'raw':!![]});})[_0xb380('0x39')](function(_0x3fcf07){var _0x3cf069={'grant_type':_0xb380('0x3a'),'refresh_token':_0x3fcf07[_0xb380('0x3b')],'scope':getAccessTokenScope(_0x3fcf07),'redirect_uri':_0x3fcf07[_0xb380('0x3c')],'client_id':_0x3fcf07[_0xb380('0x23')],'client_secret':encryptor[_0xb380('0x3d')](_0x3fcf07['data3'])};var _0x3904b2={'method':_0xb380('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xb380('0x19')](_0xb380('0x1a'),_0x3fcf07[_0xb380('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3cf069,'json':!![]};return rp(_0x3904b2);})[_0xb380('0x39')](function(_0x36d0db){_0x263020['data5']=_0x36d0db[_0xb380('0x40')];_0x263020[_0xb380('0x3b')]=_0x36d0db[_0xb380('0x3a')];return db[_0xb380('0x38')][_0xb380('0x41')]({'data5':_0x263020[_0xb380('0x42')],'data6':_0x263020['data6']},{'where':{'id':_0x263020['id']}});})[_0xb380('0x39')](function(){return _0x263020;})[_0xb380('0x43')](function(_0x366d1d){logger[_0xb380('0x44')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x263020['id'],_0x366d1d);});}function getOauth2MicrosoftAccessToken(_0x419e74,_0x3bb5ea){var _0x55994a={'grant_type':_0xb380('0x45'),'code':_0x419e74,'scope':getAccessTokenScope(_0x3bb5ea),'redirect_uri':_0x3bb5ea[_0xb380('0x3c')],'client_id':_0x3bb5ea['data1'],'client_secret':encryptor[_0xb380('0x3d')](_0x3bb5ea[_0xb380('0x37')])};var _0x54f2ac={'method':_0xb380('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xb380('0x19')](_0xb380('0x1a'),_0x3bb5ea['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55994a,'json':!![]};return rp(_0x54f2ac);}function startRefreshInterval(_0x1dcd20){var _0xdde6d3=schedule['intervals'];if(_0xdde6d3[_0x1dcd20['id']])clearInterval(_0xdde6d3[_0x1dcd20['id']]);_0xdde6d3[_0x1dcd20['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb380('0x46')](this,{'id':_0x1dcd20['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb380('0x47')]=_0xdde6d3;}function startAllRefreshIntervals(){return db[_0xb380('0x38')][_0xb380('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb380('0x39')](function(_0x231cb7){var _0x4f6ecb=_0x231cb7['map'](function(_0x2ceb8b){return refreshOauth2MicrosoftAccessToken(_0x2ceb8b)[_0xb380('0x39')](function(_0x6a836d){startRefreshInterval(_0x6a836d);});});return Promise[_0xb380('0x49')](_0x4f6ecb);})['catch'](function(_0x492362){var _0x4165a1=_0x492362?util['inspect'](_0x492362,{'showHidden':![],'depth':null}):'';logger[_0xb380('0x44')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4165a1);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 7ec8c3e..8ef7f19 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 _0xccde=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x36147b,_0x57f40b){var _0x141351=function(_0x219aa1){while(--_0x219aa1){_0x36147b['push'](_0x36147b['shift']());}};_0x141351(++_0x57f40b);}(_0xccde,0x1e1));var _0xeccd=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xccde[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xeccd('0x0'));var util=require('util');var moment=require(_0xeccd('0x1'));var BPromise=require('bluebird');var rs=require(_0xeccd('0x2'));var fs=require('fs');var Redis=require(_0xeccd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeccd('0x4'))(_0xeccd('0x5'));var config=require(_0xeccd('0x6'));var jayson=require(_0xeccd('0x7'));var client=jayson[_0xeccd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x338742,_0x130f1c,_0x1b622f){return new BPromise(function(_0x1eebfb,_0x4b068e){return client[_0xeccd('0x9')](_0x338742,_0x1b622f)[_0xeccd('0xa')](function(_0x9dccd){logger[_0xeccd('0xb')]('CloudProvider,\x20%s,\x20%s',_0x130f1c,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x130f1c,_0xeccd('0xc'),JSON[_0xeccd('0xd')](_0x9dccd));if(_0x9dccd[_0xeccd('0xe')]){if(_0x9dccd[_0xeccd('0xe')][_0xeccd('0xf')]===0x1f4){logger['error'](_0xeccd('0x10'),_0x130f1c,_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);return _0x4b068e(_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);}logger[_0xeccd('0xe')]('CloudProvider,\x20%s,\x20%s',_0x130f1c,_0x9dccd['error'][_0xeccd('0x11')]);return _0x1eebfb(_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);}else{logger[_0xeccd('0xb')]('CloudProvider,\x20%s,\x20%s',_0x130f1c,_0xeccd('0xc'));_0x1eebfb(_0x9dccd[_0xeccd('0x12')]['message']);}})['catch'](function(_0x42e47e){logger[_0xeccd('0xe')](_0xeccd('0x10'),_0x130f1c,_0x42e47e);_0x4b068e(_0x42e47e);});});}
\ No newline at end of file
+var _0x9ccd=['catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1de14f,_0x3563cb){var _0x512594=function(_0x3d42a5){while(--_0x3d42a5){_0x1de14f['push'](_0x1de14f['shift']());}};_0x512594(++_0x3563cb);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var moment=require(_0xd9cc('0x1'));var BPromise=require(_0xd9cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9cc('0x4'))(_0xd9cc('0x5'));var config=require(_0xd9cc('0x6'));var jayson=require(_0xd9cc('0x7'));var client=jayson[_0xd9cc('0x8')][_0xd9cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f7b2b,_0x23b70a,_0x9e1e10){return new BPromise(function(_0x1a1bd1,_0x20282c){return client[_0xd9cc('0xa')](_0x1f7b2b,_0x9e1e10)[_0xd9cc('0xb')](function(_0x1737e5){logger[_0xd9cc('0xc')](_0xd9cc('0xd'),_0x23b70a,'request\x20sent');logger[_0xd9cc('0xe')](_0xd9cc('0xf'),_0x23b70a,_0xd9cc('0x10'),JSON[_0xd9cc('0x11')](_0x1737e5));if(_0x1737e5[_0xd9cc('0x12')]){if(_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x13')]===0x1f4){logger[_0xd9cc('0x12')]('CloudProvider,\x20%s,\x20%s',_0x23b70a,_0x1737e5[_0xd9cc('0x12')]['message']);return _0x20282c(_0x1737e5['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x23b70a,_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x14')]);return _0x1a1bd1(_0x1737e5[_0xd9cc('0x12')][_0xd9cc('0x14')]);}else{logger[_0xd9cc('0xc')](_0xd9cc('0xd'),_0x23b70a,_0xd9cc('0x10'));_0x1a1bd1(_0x1737e5['result'][_0xd9cc('0x14')]);}})[_0xd9cc('0x15')](function(_0x513635){logger[_0xd9cc('0x12')](_0xd9cc('0xd'),_0x23b70a,_0x513635);_0x20282c(_0x513635);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6d23763..fa37162 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x7a54,0x106));var _0x47a5=function(_0x2f09a3,_0x3d2777){_0x2f09a3=_0x2f09a3-0x0;var _0xa63c1c=_0x7a54[_0x2f09a3];return _0xa63c1c;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7a54,0x106));var _0x47a5=function(_0x4fc184,_0x1efea3){_0x4fc184=_0x4fc184-0x0;var _0x9b209b=_0x7a54[_0x4fc184];return _0x9b209b;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index bcea597..abcdf3b 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 _0xfca5=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfca5,0x1cf));var _0x5fca=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xfca5[_0x576266];return _0x18234f;};'use strict';var Sequelize=require(_0x5fca('0x0'));module[_0x5fca('0x1')]={'name':{'type':Sequelize[_0x5fca('0x2')],'unique':_0x5fca('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5fca('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x5fca('0x2')]},'phone':{'type':Sequelize[_0x5fca('0x2')]},'fax':{'type':Sequelize[_0x5fca('0x2')]},'type':{'type':Sequelize[_0x5fca('0x2')]},'street':{'type':Sequelize[_0x5fca('0x2')]},'postalCode':{'type':Sequelize[_0x5fca('0x2')]},'city':{'type':Sequelize[_0x5fca('0x2')]},'country':{'type':Sequelize[_0x5fca('0x2')]},'email':{'type':Sequelize[_0x5fca('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5fca('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x5fca('0x2')]},'sCity':{'type':Sequelize[_0x5fca('0x2')]},'sCountry':{'type':Sequelize[_0x5fca('0x2')]},'description':{'type':Sequelize[_0x5fca('0x2')]}};
\ No newline at end of file
+var _0xfc5b=['name','STRING','sequelize','exports'];(function(_0x48d4a2,_0x5b6c4e){var _0x2befa0=function(_0x1945bb){while(--_0x1945bb){_0x48d4a2['push'](_0x48d4a2['shift']());}};_0x2befa0(++_0x5b6c4e);}(_0xfc5b,0xda));var _0xbfc5=function(_0x328a23,_0x6f9208){_0x328a23=_0x328a23-0x0;var _0x3876a1=_0xfc5b[_0x328a23];return _0x3876a1;};'use strict';var Sequelize=require(_0xbfc5('0x0'));module[_0xbfc5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbfc5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbfc5('0x3')]},'companyId':{'type':Sequelize[_0xbfc5('0x3')]},'website':{'type':Sequelize[_0xbfc5('0x3')]},'phone':{'type':Sequelize[_0xbfc5('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xbfc5('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbfc5('0x3')]},'email':{'type':Sequelize[_0xbfc5('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbfc5('0x3')]},'sStreet':{'type':Sequelize[_0xbfc5('0x3')]},'sPostalCode':{'type':Sequelize[_0xbfc5('0x3')]},'sCity':{'type':Sequelize[_0xbfc5('0x3')]},'sCountry':{'type':Sequelize[_0xbfc5('0x3')]},'description':{'type':Sequelize[_0xbfc5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 5a81938..6141da6 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 _0x150c=['status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','filters','intersection','model','query','fields','attributes','length','limit','order','sort','where','pick','merge','filter','includeAll','findAll','rows','catch','show','params','include','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','addContacts','CmContact','omit','ids','getContacts','findOne','rawAttributes','map','hasOwnProperty','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x150c,0x9a));var _0xc150=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x150c[_0x342700];return _0x53406f;};'use strict';var emlformat=require(_0xc150('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc150('0x1'));var rp=require(_0xc150('0x2'));var moment=require(_0xc150('0x3'));var BPromise=require(_0xc150('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc150('0x5'));var sox=require(_0xc150('0x6'));var csv=require(_0xc150('0x7'));var ejs=require(_0xc150('0x8'));var fs=require('fs');var fs_extra=require(_0xc150('0x9'));var _=require(_0xc150('0xa'));var squel=require(_0xc150('0xb'));var crypto=require(_0xc150('0xc'));var jsforce=require(_0xc150('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc150('0x7'));var querystring=require(_0xc150('0xe'));var Papa=require(_0xc150('0xf'));var Redis=require('ioredis');var authService=require(_0xc150('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc150('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc150('0x12'))(_0xc150('0x13'));var utils=require(_0xc150('0x14'));var config=require(_0xc150('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc150('0x16'))['db'];function respondWithStatusCode(_0x4268f3,_0x3b91a4){_0x3b91a4=_0x3b91a4||0xcc;return function(_0x2bcda4){if(_0x2bcda4){return _0x4268f3[_0xc150('0x17')](_0x3b91a4);}return _0x4268f3[_0xc150('0x18')](_0x3b91a4)[_0xc150('0x19')]();};}function respondWithResult(_0x19e986,_0x4a32d4){_0x4a32d4=_0x4a32d4||0xc8;return function(_0x4a120a){if(_0x4a120a){return _0x19e986[_0xc150('0x18')](_0x4a32d4)[_0xc150('0x1a')](_0x4a120a);}};}function respondWithFilteredResult(_0x440422,_0x5a094a){return function(_0x3d730b){if(_0x3d730b){var _0x3ccefc=typeof _0x5a094a[_0xc150('0x1b')]==='undefined'&&typeof _0x5a094a['limit']===_0xc150('0x1c');var _0x364e0a=_0x3d730b[_0xc150('0x1d')];var _0x1120c9=_0x3ccefc?0x0:_0x5a094a[_0xc150('0x1b')];var _0x302a01=_0x3ccefc?_0x3d730b[_0xc150('0x1d')]:_0x5a094a['offset']+_0x5a094a['limit'];var _0x2f89b2;if(_0x302a01>=_0x364e0a){_0x302a01=_0x364e0a;_0x2f89b2=0xc8;}else{_0x2f89b2=0xce;}_0x440422[_0xc150('0x18')](_0x2f89b2);return _0x440422[_0xc150('0x1e')](_0xc150('0x1f'),_0x1120c9+'-'+_0x302a01+'/'+_0x364e0a)[_0xc150('0x1a')](_0x3d730b);}return null;};}function patchUpdates(_0x2ba0ab){return function(_0xb70a76){try{jsonpatch[_0xc150('0x20')](_0xb70a76,_0x2ba0ab,!![]);}catch(_0x2c43f2){return BPromise[_0xc150('0x21')](_0x2c43f2);}return _0xb70a76['save']();};}function saveUpdates(_0x58162d,_0xeee1d4){return function(_0x55d1e3){if(_0x55d1e3){return _0x55d1e3[_0xc150('0x22')](_0x58162d)[_0xc150('0x23')](function(_0x527b8a){return _0x527b8a;});}return null;};}function removeEntity(_0x210fd5,_0x59059d){return function(_0x289090){if(_0x289090){return _0x289090[_0xc150('0x24')]()[_0xc150('0x23')](function(){var _0x5f4992=_0x289090[_0xc150('0x25')]({'plain':!![]});var _0x453f41='Companies';return db[_0xc150('0x26')][_0xc150('0x24')]({'where':{'type':_0x453f41,'resourceId':_0x5f4992['id']}})[_0xc150('0x23')](function(){return _0x289090;});})[_0xc150('0x23')](function(){_0x210fd5[_0xc150('0x18')](0xcc)[_0xc150('0x19')]();});}};}function handleEntityNotFound(_0x33cd44,_0x5a5a31){return function(_0x489294){if(!_0x489294){_0x33cd44['sendStatus'](0x194);}return _0x489294;};}function handleError(_0x129941,_0x79a54e){_0x79a54e=_0x79a54e||0x1f4;return function(_0x2c198f){logger[_0xc150('0x27')](_0x2c198f[_0xc150('0x28')]);if(_0x2c198f['name']){delete _0x2c198f[_0xc150('0x29')];}_0x129941[_0xc150('0x18')](_0x79a54e)[_0xc150('0x2a')](_0x2c198f);};}exports[_0xc150('0x2b')]=function(_0x1d145b,_0x49fb47){var _0x174ec7={},_0x24760c={},_0x41347a={'count':0x0,'rows':[]};return db[_0xc150('0x2c')][_0xc150('0x2d')]()['then'](function(_0x3efd2c){_0x24760c['model']=_['keys'](_0x3efd2c);_0x24760c['query']=_[_0xc150('0x2e')](_0x1d145b['query']);_0x24760c[_0xc150('0x2f')]=_[_0xc150('0x30')](_0x24760c[_0xc150('0x31')],_0x24760c[_0xc150('0x32')]);_0x174ec7['attributes']=_[_0xc150('0x30')](_0x24760c[_0xc150('0x31')],qs[_0xc150('0x33')](_0x1d145b[_0xc150('0x32')][_0xc150('0x33')]));_0x174ec7[_0xc150('0x34')]=_0x174ec7[_0xc150('0x34')][_0xc150('0x35')]?_0x174ec7[_0xc150('0x34')]:_0x24760c[_0xc150('0x31')];if(!_0x1d145b[_0xc150('0x32')]['hasOwnProperty']('nolimit')){_0x174ec7[_0xc150('0x36')]=qs[_0xc150('0x36')](_0x1d145b[_0xc150('0x32')]['limit']);_0x174ec7[_0xc150('0x1b')]=qs[_0xc150('0x1b')](_0x1d145b[_0xc150('0x32')][_0xc150('0x1b')]);}_0x174ec7[_0xc150('0x37')]=qs[_0xc150('0x38')](_0x1d145b[_0xc150('0x32')][_0xc150('0x38')]);_0x174ec7[_0xc150('0x39')]=qs[_0xc150('0x2f')](_[_0xc150('0x3a')](_0x1d145b['query'],_0x24760c['filters']),_0x3efd2c);if(_0x1d145b[_0xc150('0x32')]['filter']){_0x174ec7[_0xc150('0x39')]=_[_0xc150('0x3b')](_0x174ec7['where'],{'$or':_['map'](_0x174ec7[_0xc150('0x34')],function(_0x514c25){var _0x4c5797={};_0x4c5797[_0x514c25]={'$like':'%'+_0x1d145b[_0xc150('0x32')][_0xc150('0x3c')]+'%'};return _0x4c5797;})});}_0x174ec7=_['merge']({},_0x174ec7,_0x1d145b['options']);var _0xaa3a77={'where':_0x174ec7[_0xc150('0x39')]};return db[_0xc150('0x2c')][_0xc150('0x1d')](_0xaa3a77)[_0xc150('0x23')](function(_0x3ae607){_0x41347a[_0xc150('0x1d')]=_0x3ae607;if(_0x1d145b[_0xc150('0x32')][_0xc150('0x3d')]){_0x174ec7['include']=[{'all':!![]}];}return db[_0xc150('0x2c')][_0xc150('0x3e')](_0x174ec7);})[_0xc150('0x23')](function(_0x4b55fa){_0x41347a[_0xc150('0x3f')]=_0x4b55fa;return _0x41347a;})[_0xc150('0x23')](respondWithFilteredResult(_0x49fb47,_0x174ec7))['catch'](handleError(_0x49fb47,null));})[_0xc150('0x40')](handleError(_0x49fb47,null));};exports[_0xc150('0x41')]=function(_0xfc9d19,_0x4de175){var _0x89406f={'raw':![],'where':{'id':_0xfc9d19[_0xc150('0x42')]['id']}},_0x5c999d={};_0x5c999d[_0xc150('0x31')]=_[_0xc150('0x2e')](db['CmCompany']['rawAttributes']);_0x5c999d['query']=_[_0xc150('0x2e')](_0xfc9d19[_0xc150('0x32')]);_0x5c999d[_0xc150('0x2f')]=_[_0xc150('0x30')](_0x5c999d[_0xc150('0x31')],_0x5c999d[_0xc150('0x32')]);_0x89406f['attributes']=_[_0xc150('0x30')](_0x5c999d[_0xc150('0x31')],qs[_0xc150('0x33')](_0xfc9d19['query'][_0xc150('0x33')]));_0x89406f[_0xc150('0x34')]=_0x89406f[_0xc150('0x34')][_0xc150('0x35')]?_0x89406f[_0xc150('0x34')]:_0x5c999d[_0xc150('0x31')];if(_0xfc9d19['query'][_0xc150('0x3d')]){_0x89406f[_0xc150('0x43')]=[{'all':!![]}];}_0x89406f=_['merge']({},_0x89406f,_0xfc9d19[_0xc150('0x44')]);return db[_0xc150('0x2c')][_0xc150('0x45')](_0x89406f)[_0xc150('0x23')](handleEntityNotFound(_0x4de175,null))[_0xc150('0x23')](respondWithResult(_0x4de175,null))['catch'](handleError(_0x4de175,null));};exports['create']=function(_0x6aa338,_0x2cc21f){return db[_0xc150('0x2c')][_0xc150('0x46')](_0x6aa338[_0xc150('0x47')],{})[_0xc150('0x23')](function(_0x158e9a){var _0x237481=_0x6aa338[_0xc150('0x48')]['get']({'plain':!![]});if(!_0x237481)throw new Error(_0xc150('0x49'));if(_0x237481[_0xc150('0x4a')]===_0xc150('0x48')){var _0x1c94c8=_0x158e9a[_0xc150('0x25')]({'plain':!![]});var _0x570914='Companies';return db[_0xc150('0x4b')][_0xc150('0x45')]({'where':{'name':_0x570914,'userProfileId':_0x237481[_0xc150('0x4c')]},'raw':!![]})[_0xc150('0x23')](function(_0x31aab6){if(_0x31aab6&&_0x31aab6[_0xc150('0x4d')]===0x0){return db[_0xc150('0x26')][_0xc150('0x46')]({'name':_0x1c94c8['name'],'resourceId':_0x1c94c8['id'],'type':_0x31aab6['name'],'sectionId':_0x31aab6['id']},{})[_0xc150('0x23')](function(){return _0x158e9a;});}else{return _0x158e9a;}})[_0xc150('0x40')](function(_0x5d0fc6){logger[_0xc150('0x27')](_0xc150('0x4e'),_0x5d0fc6);throw _0x5d0fc6;});}return _0x158e9a;})[_0xc150('0x23')](respondWithResult(_0x2cc21f,0xc9))['catch'](handleError(_0x2cc21f,null));};exports[_0xc150('0x22')]=function(_0x438bc2,_0x8d33c7){if(_0x438bc2[_0xc150('0x47')]['id']){delete _0x438bc2[_0xc150('0x47')]['id'];}return db['CmCompany'][_0xc150('0x45')]({'where':{'id':_0x438bc2[_0xc150('0x42')]['id']}})[_0xc150('0x23')](handleEntityNotFound(_0x8d33c7,null))[_0xc150('0x23')](saveUpdates(_0x438bc2[_0xc150('0x47')],null))['then'](respondWithResult(_0x8d33c7,null))[_0xc150('0x40')](handleError(_0x8d33c7,null));};exports[_0xc150('0x24')]=function(_0x4c3a0a,_0xfae184){return db[_0xc150('0x2c')][_0xc150('0x45')]({'where':{'id':_0x4c3a0a['params']['id']}})[_0xc150('0x23')](handleEntityNotFound(_0xfae184,null))[_0xc150('0x23')](removeEntity(_0xfae184,null))[_0xc150('0x40')](handleError(_0xfae184,null));};exports[_0xc150('0x2d')]=function(_0x384cb2,_0xc4989e){return db[_0xc150('0x2c')][_0xc150('0x2d')]()[_0xc150('0x23')](respondWithResult(_0xc4989e,null))[_0xc150('0x40')](handleError(_0xc4989e,null));};exports[_0xc150('0x4f')]=function(_0x386a7b,_0x289df6,_0x1e2800){return db[_0xc150('0x50')][_0xc150('0x45')]({'where':{'id':_0x386a7b[_0xc150('0x42')]['id']}})[_0xc150('0x23')](handleEntityNotFound(_0x289df6,null))['then'](function(_0x131839){if(_0x131839){return _0x131839[_0xc150('0x4f')](_0x386a7b[_0xc150('0x47')]['ids'],_[_0xc150('0x51')](_0x386a7b[_0xc150('0x47')],[_0xc150('0x52'),'id'])||{});}})[_0xc150('0x23')](respondWithResult(_0x289df6,null))[_0xc150('0x40')](handleError(_0x289df6,null));};exports[_0xc150('0x53')]=function(_0x26ea57,_0x24cc8d,_0x1a584a){var _0x3a9d41={};var _0x2c8c81={};var _0x503d87;var _0x32bc0b;return db[_0xc150('0x2c')][_0xc150('0x54')]({'where':{'id':_0x26ea57[_0xc150('0x42')]['id']}})[_0xc150('0x23')](handleEntityNotFound(_0x24cc8d,null))[_0xc150('0x23')](function(_0x34cb41){if(_0x34cb41){_0x503d87=_0x34cb41;_0x2c8c81[_0xc150('0x31')]=_[_0xc150('0x2e')](db[_0xc150('0x50')][_0xc150('0x55')]);_0x2c8c81[_0xc150('0x32')]=_[_0xc150('0x2e')](_0x26ea57[_0xc150('0x32')]);_0x2c8c81[_0xc150('0x2f')]=_[_0xc150('0x30')](_0x2c8c81[_0xc150('0x31')],_0x2c8c81['query']);_0x3a9d41[_0xc150('0x34')]=_[_0xc150('0x30')](_0x2c8c81['model'],qs[_0xc150('0x33')](_0x26ea57[_0xc150('0x32')][_0xc150('0x33')]));_0x3a9d41[_0xc150('0x34')]=_0x3a9d41[_0xc150('0x34')][_0xc150('0x35')]?_0x3a9d41[_0xc150('0x34')]:_0x2c8c81[_0xc150('0x31')];_0x3a9d41['order']=qs[_0xc150('0x38')](_0x26ea57['query'][_0xc150('0x38')]);_0x3a9d41[_0xc150('0x39')]=qs[_0xc150('0x2f')](_[_0xc150('0x3a')](_0x26ea57[_0xc150('0x32')],_0x2c8c81['filters']));if(_0x26ea57[_0xc150('0x32')][_0xc150('0x3c')]){_0x3a9d41[_0xc150('0x39')]=_[_0xc150('0x3b')](_0x3a9d41[_0xc150('0x39')],{'$or':_[_0xc150('0x56')](_0x3a9d41[_0xc150('0x34')],function(_0x389b61){var _0x588269={};_0x588269[_0x389b61]={'$like':'%'+_0x26ea57[_0xc150('0x32')][_0xc150('0x3c')]+'%'};return _0x588269;})});}_0x3a9d41=_[_0xc150('0x3b')]({},_0x3a9d41,_0x26ea57[_0xc150('0x44')]);return _0x503d87[_0xc150('0x53')](_0x3a9d41);}})['then'](function(_0x274c22){if(_0x274c22){_0x32bc0b=_0x274c22[_0xc150('0x35')];if(!_0x26ea57['query'][_0xc150('0x57')](_0xc150('0x58'))){_0x3a9d41['limit']=qs[_0xc150('0x36')](_0x26ea57['query'][_0xc150('0x36')]);_0x3a9d41[_0xc150('0x1b')]=qs[_0xc150('0x1b')](_0x26ea57[_0xc150('0x32')][_0xc150('0x1b')]);}return _0x503d87['getContacts'](_0x3a9d41);}})[_0xc150('0x23')](function(_0x5c756a){if(_0x5c756a){return _0x5c756a?{'count':_0x32bc0b,'rows':_0x5c756a}:null;}})[_0xc150('0x23')](respondWithResult(_0x24cc8d,null))[_0xc150('0x40')](handleError(_0x24cc8d,null));};
\ No newline at end of file
+var _0x136e=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','CmContact','addContacts','ids','omit','findOne','getContacts','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','end','error','name','send','index','CmCompany','describe'];(function(_0x17729d,_0x15e6af){var _0xbbe924=function(_0x4bcd24){while(--_0x4bcd24){_0x17729d['push'](_0x17729d['shift']());}};_0xbbe924(++_0x15e6af);}(_0x136e,0x128));var _0xe136=function(_0x3149bc,_0x24b6b7){_0x3149bc=_0x3149bc-0x0;var _0x325cd1=_0x136e[_0x3149bc];return _0x325cd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe136('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe136('0x1'));var moment=require(_0xe136('0x2'));var BPromise=require(_0xe136('0x3'));var Mustache=require('mustache');var util=require(_0xe136('0x4'));var path=require(_0xe136('0x5'));var sox=require(_0xe136('0x6'));var csv=require(_0xe136('0x7'));var ejs=require(_0xe136('0x8'));var fs=require('fs');var fs_extra=require(_0xe136('0x9'));var _=require(_0xe136('0xa'));var squel=require('squel');var crypto=require(_0xe136('0xb'));var jsforce=require(_0xe136('0xc'));var deskjs=require(_0xe136('0xd'));var toCsv=require(_0xe136('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe136('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe136('0xf'));var as=require(_0xe136('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe136('0x11'))('api');var utils=require(_0xe136('0x12'));var config=require(_0xe136('0x13'));var licenseUtil=require(_0xe136('0x14'));var db=require(_0xe136('0x15'))['db'];function respondWithStatusCode(_0x1346ec,_0x462fcd){_0x462fcd=_0x462fcd||0xcc;return function(_0x469c79){if(_0x469c79){return _0x1346ec[_0xe136('0x16')](_0x462fcd);}return _0x1346ec[_0xe136('0x17')](_0x462fcd)['end']();};}function respondWithResult(_0x1821d7,_0x71ba17){_0x71ba17=_0x71ba17||0xc8;return function(_0x2ad1fa){if(_0x2ad1fa){return _0x1821d7[_0xe136('0x17')](_0x71ba17)[_0xe136('0x18')](_0x2ad1fa);}};}function respondWithFilteredResult(_0x2a26b9,_0xb1da66){return function(_0x5f10e9){if(_0x5f10e9){var _0x256d72=typeof _0xb1da66[_0xe136('0x19')]===_0xe136('0x1a')&&typeof _0xb1da66['limit']===_0xe136('0x1a');var _0x3c95a3=_0x5f10e9[_0xe136('0x1b')];var _0x305434=_0x256d72?0x0:_0xb1da66[_0xe136('0x19')];var _0x411c7a=_0x256d72?_0x5f10e9[_0xe136('0x1b')]:_0xb1da66['offset']+_0xb1da66['limit'];var _0x5e5ebd;if(_0x411c7a>=_0x3c95a3){_0x411c7a=_0x3c95a3;_0x5e5ebd=0xc8;}else{_0x5e5ebd=0xce;}_0x2a26b9[_0xe136('0x17')](_0x5e5ebd);return _0x2a26b9[_0xe136('0x1c')](_0xe136('0x1d'),_0x305434+'-'+_0x411c7a+'/'+_0x3c95a3)[_0xe136('0x18')](_0x5f10e9);}return null;};}function patchUpdates(_0x8cbf28){return function(_0x4dd595){try{jsonpatch['apply'](_0x4dd595,_0x8cbf28,!![]);}catch(_0x3480b1){return BPromise['reject'](_0x3480b1);}return _0x4dd595[_0xe136('0x1e')]();};}function saveUpdates(_0x230183,_0x530338){return function(_0x1500c1){if(_0x1500c1){return _0x1500c1[_0xe136('0x1f')](_0x230183)[_0xe136('0x20')](function(_0x41d372){return _0x41d372;});}return null;};}function removeEntity(_0x384f47,_0x5b44f3){return function(_0x36a62d){if(_0x36a62d){return _0x36a62d[_0xe136('0x21')]()[_0xe136('0x20')](function(){var _0x1f64e7=_0x36a62d[_0xe136('0x22')]({'plain':!![]});var _0x4d64ff=_0xe136('0x23');return db[_0xe136('0x24')]['destroy']({'where':{'type':_0x4d64ff,'resourceId':_0x1f64e7['id']}})[_0xe136('0x20')](function(){return _0x36a62d;});})[_0xe136('0x20')](function(){_0x384f47[_0xe136('0x17')](0xcc)[_0xe136('0x25')]();});}};}function handleEntityNotFound(_0x124161,_0xb81e2b){return function(_0x7e296f){if(!_0x7e296f){_0x124161[_0xe136('0x16')](0x194);}return _0x7e296f;};}function handleError(_0x1bfa3f,_0x1aa8ac){_0x1aa8ac=_0x1aa8ac||0x1f4;return function(_0x2e109c){logger[_0xe136('0x26')](_0x2e109c['stack']);if(_0x2e109c[_0xe136('0x27')]){delete _0x2e109c['name'];}_0x1bfa3f[_0xe136('0x17')](_0x1aa8ac)[_0xe136('0x28')](_0x2e109c);};}exports[_0xe136('0x29')]=function(_0x2193ea,_0x5ae54a){var _0x3d7e50={},_0x2ec526={},_0x2ea180={'count':0x0,'rows':[]};return db[_0xe136('0x2a')][_0xe136('0x2b')]()[_0xe136('0x20')](function(_0x4e56e6){_0x2ec526[_0xe136('0x2c')]=_[_0xe136('0x2d')](_0x4e56e6);_0x2ec526[_0xe136('0x2e')]=_['keys'](_0x2193ea[_0xe136('0x2e')]);_0x2ec526[_0xe136('0x2f')]=_[_0xe136('0x30')](_0x2ec526[_0xe136('0x2c')],_0x2ec526[_0xe136('0x2e')]);_0x3d7e50[_0xe136('0x31')]=_[_0xe136('0x30')](_0x2ec526[_0xe136('0x2c')],qs[_0xe136('0x32')](_0x2193ea[_0xe136('0x2e')][_0xe136('0x32')]));_0x3d7e50[_0xe136('0x31')]=_0x3d7e50['attributes'][_0xe136('0x33')]?_0x3d7e50[_0xe136('0x31')]:_0x2ec526[_0xe136('0x2c')];if(!_0x2193ea['query'][_0xe136('0x34')](_0xe136('0x35'))){_0x3d7e50[_0xe136('0x36')]=qs['limit'](_0x2193ea[_0xe136('0x2e')][_0xe136('0x36')]);_0x3d7e50[_0xe136('0x19')]=qs['offset'](_0x2193ea[_0xe136('0x2e')]['offset']);}_0x3d7e50[_0xe136('0x37')]=qs['sort'](_0x2193ea[_0xe136('0x2e')][_0xe136('0x38')]);_0x3d7e50[_0xe136('0x39')]=qs[_0xe136('0x2f')](_[_0xe136('0x3a')](_0x2193ea[_0xe136('0x2e')],_0x2ec526[_0xe136('0x2f')]),_0x4e56e6);if(_0x2193ea['query'][_0xe136('0x3b')]){_0x3d7e50[_0xe136('0x39')]=_['merge'](_0x3d7e50[_0xe136('0x39')],{'$or':_[_0xe136('0x3c')](_0x3d7e50[_0xe136('0x31')],function(_0xc80bee){var _0xd0adb7={};_0xd0adb7[_0xc80bee]={'$like':'%'+_0x2193ea[_0xe136('0x2e')][_0xe136('0x3b')]+'%'};return _0xd0adb7;})});}_0x3d7e50=_[_0xe136('0x3d')]({},_0x3d7e50,_0x2193ea[_0xe136('0x3e')]);var _0x2eb714={'where':_0x3d7e50['where']};return db['CmCompany']['count'](_0x2eb714)[_0xe136('0x20')](function(_0x1d6749){_0x2ea180[_0xe136('0x1b')]=_0x1d6749;if(_0x2193ea['query']['includeAll']){_0x3d7e50[_0xe136('0x3f')]=[{'all':!![]}];}return db[_0xe136('0x2a')][_0xe136('0x40')](_0x3d7e50);})[_0xe136('0x20')](function(_0x2f7d5a){_0x2ea180[_0xe136('0x41')]=_0x2f7d5a;return _0x2ea180;})[_0xe136('0x20')](respondWithFilteredResult(_0x5ae54a,_0x3d7e50))[_0xe136('0x42')](handleError(_0x5ae54a,null));})[_0xe136('0x42')](handleError(_0x5ae54a,null));};exports[_0xe136('0x43')]=function(_0xd374d1,_0x83a239){var _0x38e038={'raw':![],'where':{'id':_0xd374d1[_0xe136('0x44')]['id']}},_0x5d861f={};_0x5d861f['model']=_['keys'](db['CmCompany'][_0xe136('0x45')]);_0x5d861f[_0xe136('0x2e')]=_[_0xe136('0x2d')](_0xd374d1['query']);_0x5d861f[_0xe136('0x2f')]=_[_0xe136('0x30')](_0x5d861f['model'],_0x5d861f[_0xe136('0x2e')]);_0x38e038[_0xe136('0x31')]=_[_0xe136('0x30')](_0x5d861f[_0xe136('0x2c')],qs[_0xe136('0x32')](_0xd374d1['query'][_0xe136('0x32')]));_0x38e038[_0xe136('0x31')]=_0x38e038[_0xe136('0x31')][_0xe136('0x33')]?_0x38e038[_0xe136('0x31')]:_0x5d861f[_0xe136('0x2c')];if(_0xd374d1['query'][_0xe136('0x46')]){_0x38e038[_0xe136('0x3f')]=[{'all':!![]}];}_0x38e038=_[_0xe136('0x3d')]({},_0x38e038,_0xd374d1[_0xe136('0x3e')]);return db[_0xe136('0x2a')][_0xe136('0x47')](_0x38e038)[_0xe136('0x20')](handleEntityNotFound(_0x83a239,null))['then'](respondWithResult(_0x83a239,null))[_0xe136('0x42')](handleError(_0x83a239,null));};exports[_0xe136('0x48')]=function(_0x539b1c,_0x1f3c22){return db[_0xe136('0x2a')][_0xe136('0x48')](_0x539b1c[_0xe136('0x49')],{})[_0xe136('0x20')](function(_0x27682e){var _0x5668a0=_0x539b1c[_0xe136('0x4a')][_0xe136('0x22')]({'plain':!![]});if(!_0x5668a0)throw new Error(_0xe136('0x4b'));if(_0x5668a0['role']===_0xe136('0x4a')){var _0x27ae08=_0x27682e[_0xe136('0x22')]({'plain':!![]});var _0x58a6fe=_0xe136('0x23');return db[_0xe136('0x4c')][_0xe136('0x47')]({'where':{'name':_0x58a6fe,'userProfileId':_0x5668a0[_0xe136('0x4d')]},'raw':!![]})['then'](function(_0x5cf6aa){if(_0x5cf6aa&&_0x5cf6aa[_0xe136('0x4e')]===0x0){return db[_0xe136('0x24')]['create']({'name':_0x27ae08[_0xe136('0x27')],'resourceId':_0x27ae08['id'],'type':_0x5cf6aa['name'],'sectionId':_0x5cf6aa['id']},{})[_0xe136('0x20')](function(){return _0x27682e;});}else{return _0x27682e;}})[_0xe136('0x42')](function(_0x559abe){logger[_0xe136('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x559abe);throw _0x559abe;});}return _0x27682e;})['then'](respondWithResult(_0x1f3c22,0xc9))['catch'](handleError(_0x1f3c22,null));};exports[_0xe136('0x1f')]=function(_0x50dff8,_0xb251cf){if(_0x50dff8[_0xe136('0x49')]['id']){delete _0x50dff8[_0xe136('0x49')]['id'];}return db[_0xe136('0x2a')][_0xe136('0x47')]({'where':{'id':_0x50dff8['params']['id']}})[_0xe136('0x20')](handleEntityNotFound(_0xb251cf,null))['then'](saveUpdates(_0x50dff8[_0xe136('0x49')],null))[_0xe136('0x20')](respondWithResult(_0xb251cf,null))[_0xe136('0x42')](handleError(_0xb251cf,null));};exports[_0xe136('0x21')]=function(_0xe2ad19,_0x5705d6){return db[_0xe136('0x2a')][_0xe136('0x47')]({'where':{'id':_0xe2ad19[_0xe136('0x44')]['id']}})[_0xe136('0x20')](handleEntityNotFound(_0x5705d6,null))[_0xe136('0x20')](removeEntity(_0x5705d6,null))[_0xe136('0x42')](handleError(_0x5705d6,null));};exports[_0xe136('0x2b')]=function(_0x1b0b6d,_0x10f5a9){return db[_0xe136('0x2a')][_0xe136('0x2b')]()[_0xe136('0x20')](respondWithResult(_0x10f5a9,null))['catch'](handleError(_0x10f5a9,null));};exports['addContacts']=function(_0x34d5b0,_0x4f898b,_0x3491a4){return db[_0xe136('0x4f')][_0xe136('0x47')]({'where':{'id':_0x34d5b0[_0xe136('0x44')]['id']}})[_0xe136('0x20')](handleEntityNotFound(_0x4f898b,null))[_0xe136('0x20')](function(_0x49cd47){if(_0x49cd47){return _0x49cd47[_0xe136('0x50')](_0x34d5b0[_0xe136('0x49')][_0xe136('0x51')],_[_0xe136('0x52')](_0x34d5b0[_0xe136('0x49')],[_0xe136('0x51'),'id'])||{});}})[_0xe136('0x20')](respondWithResult(_0x4f898b,null))[_0xe136('0x42')](handleError(_0x4f898b,null));};exports['getContacts']=function(_0x401ff0,_0x17c57e,_0x382d8c){var _0x594501={};var _0x595518={};var _0x219901;var _0x12af0e;return db['CmCompany'][_0xe136('0x53')]({'where':{'id':_0x401ff0[_0xe136('0x44')]['id']}})[_0xe136('0x20')](handleEntityNotFound(_0x17c57e,null))[_0xe136('0x20')](function(_0x59e0c6){if(_0x59e0c6){_0x219901=_0x59e0c6;_0x595518[_0xe136('0x2c')]=_[_0xe136('0x2d')](db[_0xe136('0x4f')][_0xe136('0x45')]);_0x595518[_0xe136('0x2e')]=_[_0xe136('0x2d')](_0x401ff0['query']);_0x595518['filters']=_['intersection'](_0x595518[_0xe136('0x2c')],_0x595518[_0xe136('0x2e')]);_0x594501[_0xe136('0x31')]=_[_0xe136('0x30')](_0x595518[_0xe136('0x2c')],qs[_0xe136('0x32')](_0x401ff0[_0xe136('0x2e')]['fields']));_0x594501['attributes']=_0x594501['attributes']['length']?_0x594501['attributes']:_0x595518[_0xe136('0x2c')];_0x594501[_0xe136('0x37')]=qs[_0xe136('0x38')](_0x401ff0[_0xe136('0x2e')][_0xe136('0x38')]);_0x594501[_0xe136('0x39')]=qs[_0xe136('0x2f')](_['pick'](_0x401ff0[_0xe136('0x2e')],_0x595518[_0xe136('0x2f')]));if(_0x401ff0[_0xe136('0x2e')][_0xe136('0x3b')]){_0x594501['where']=_[_0xe136('0x3d')](_0x594501[_0xe136('0x39')],{'$or':_['map'](_0x594501[_0xe136('0x31')],function(_0x16bb09){var _0x55b072={};_0x55b072[_0x16bb09]={'$like':'%'+_0x401ff0[_0xe136('0x2e')]['filter']+'%'};return _0x55b072;})});}_0x594501=_['merge']({},_0x594501,_0x401ff0[_0xe136('0x3e')]);return _0x219901[_0xe136('0x54')](_0x594501);}})[_0xe136('0x20')](function(_0x5e9ba0){if(_0x5e9ba0){_0x12af0e=_0x5e9ba0[_0xe136('0x33')];if(!_0x401ff0['query']['hasOwnProperty'](_0xe136('0x35'))){_0x594501[_0xe136('0x36')]=qs[_0xe136('0x36')](_0x401ff0[_0xe136('0x2e')][_0xe136('0x36')]);_0x594501['offset']=qs[_0xe136('0x19')](_0x401ff0['query']['offset']);}return _0x219901[_0xe136('0x54')](_0x594501);}})[_0xe136('0x20')](function(_0x4d6cb8){if(_0x4d6cb8){return _0x4d6cb8?{'count':_0x12af0e,'rows':_0x4d6cb8}:null;}})['then'](respondWithResult(_0x17c57e,null))['catch'](handleError(_0x17c57e,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 4172182..5919ecc 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 _0x257d=['exports','define','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmCompany.attributes'];(function(_0x47878f,_0x48d3bf){var _0x4b05b8=function(_0x3d6597){while(--_0x3d6597){_0x47878f['push'](_0x47878f['shift']());}};_0x4b05b8(++_0x48d3bf);}(_0x257d,0x1b3));var _0xd257=function(_0x498e3f,_0x15bb7d){_0x498e3f=_0x498e3f-0x0;var _0x537c0f=_0x257d[_0x498e3f];return _0x537c0f;};'use strict';var _=require(_0xd257('0x0'));var util=require(_0xd257('0x1'));var logger=require(_0xd257('0x2'))(_0xd257('0x3'));var moment=require(_0xd257('0x4'));var BPromise=require('bluebird');var rp=require(_0xd257('0x5'));var fs=require('fs');var path=require(_0xd257('0x6'));var rimraf=require(_0xd257('0x7'));var config=require('../../config/environment');var attributes=require(_0xd257('0x8'));module[_0xd257('0x9')]=function(_0x420e20,_0x4711fc){return _0x420e20[_0xd257('0xa')]('CmCompany',attributes,{'tableName':_0xd257('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x109d=['api','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','CmCompany','cm_companies','lodash'];(function(_0x36f797,_0x351603){var _0x44ba30=function(_0x32eb10){while(--_0x32eb10){_0x36f797['push'](_0x36f797['shift']());}};_0x44ba30(++_0x351603);}(_0x109d,0x194));var _0xd109=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x109d[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xd109('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd109('0x1'));var moment=require('moment');var BPromise=require(_0xd109('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd109('0x3'));var rimraf=require(_0xd109('0x4'));var config=require(_0xd109('0x5'));var attributes=require(_0xd109('0x6'));module['exports']=function(_0x32b38f,_0x576fc8){return _0x32b38f['define'](_0xd109('0x7'),attributes,{'tableName':_0xd109('0x8'),'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 6a86591..50199d7 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 _0x21c7=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2d0472,_0x2b3088){var _0x46a846=function(_0x209b5b){while(--_0x209b5b){_0x2d0472['push'](_0x2d0472['shift']());}};_0x46a846(++_0x2b3088);}(_0x21c7,0x1a8));var _0x721c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x721c('0x0'));var util=require(_0x721c('0x1'));var moment=require(_0x721c('0x2'));var BPromise=require(_0x721c('0x3'));var rs=require(_0x721c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x721c('0x5'));var logger=require(_0x721c('0x6'))(_0x721c('0x7'));var config=require(_0x721c('0x8'));var jayson=require(_0x721c('0x9'));var client=jayson[_0x721c('0xa')][_0x721c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53a7a6,_0x169b50,_0x33f7a2){return new BPromise(function(_0x5df156,_0x4996bd){return client[_0x721c('0xc')](_0x53a7a6,_0x33f7a2)[_0x721c('0xd')](function(_0x275b0e){logger['info']('CmCompany,\x20%s,\x20%s',_0x169b50,_0x721c('0xe'));logger[_0x721c('0xf')](_0x721c('0x10'),_0x169b50,_0x721c('0xe'),JSON[_0x721c('0x11')](_0x275b0e));if(_0x275b0e[_0x721c('0x12')]){if(_0x275b0e[_0x721c('0x12')][_0x721c('0x13')]===0x1f4){logger[_0x721c('0x12')](_0x721c('0x14'),_0x169b50,_0x275b0e[_0x721c('0x12')][_0x721c('0x15')]);return _0x4996bd(_0x275b0e['error'][_0x721c('0x15')]);}logger[_0x721c('0x12')](_0x721c('0x14'),_0x169b50,_0x275b0e[_0x721c('0x12')][_0x721c('0x15')]);return _0x5df156(_0x275b0e[_0x721c('0x12')]['message']);}else{logger[_0x721c('0x16')]('CmCompany,\x20%s,\x20%s',_0x169b50,_0x721c('0xe'));_0x5df156(_0x275b0e[_0x721c('0x17')][_0x721c('0x15')]);}})['catch'](function(_0x2f6c42){logger[_0x721c('0x12')](_0x721c('0x14'),_0x169b50,_0x2f6c42);_0x4996bd(_0x2f6c42);});});}
\ No newline at end of file
+var _0x7873=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x5bbcb5,_0x3bf21a){var _0x4a676e=function(_0x591373){while(--_0x591373){_0x5bbcb5['push'](_0x5bbcb5['shift']());}};_0x4a676e(++_0x3bf21a);}(_0x7873,0x1e0));var _0x3787=function(_0x354e87,_0x462aee){_0x354e87=_0x354e87-0x0;var _0x426a22=_0x7873[_0x354e87];return _0x426a22;};'use strict';var _=require(_0x3787('0x0'));var util=require(_0x3787('0x1'));var moment=require(_0x3787('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3787('0x3'))['db'];var utils=require(_0x3787('0x4'));var logger=require(_0x3787('0x5'))('rpc');var config=require(_0x3787('0x6'));var jayson=require(_0x3787('0x7'));var client=jayson[_0x3787('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e35bb,_0x22f4bb,_0x473596){return new BPromise(function(_0x475bc4,_0x55e8d0){return client[_0x3787('0x9')](_0x5e35bb,_0x473596)[_0x3787('0xa')](function(_0x219c6e){logger[_0x3787('0xb')]('CmCompany,\x20%s,\x20%s',_0x22f4bb,'request\x20sent');logger[_0x3787('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x22f4bb,_0x3787('0xd'),JSON[_0x3787('0xe')](_0x219c6e));if(_0x219c6e[_0x3787('0xf')]){if(_0x219c6e[_0x3787('0xf')][_0x3787('0x10')]===0x1f4){logger[_0x3787('0xf')](_0x3787('0x11'),_0x22f4bb,_0x219c6e[_0x3787('0xf')][_0x3787('0x12')]);return _0x55e8d0(_0x219c6e[_0x3787('0xf')][_0x3787('0x12')]);}logger['error'](_0x3787('0x11'),_0x22f4bb,_0x219c6e['error'][_0x3787('0x12')]);return _0x475bc4(_0x219c6e[_0x3787('0xf')][_0x3787('0x12')]);}else{logger['info'](_0x3787('0x11'),_0x22f4bb,'request\x20sent');_0x475bc4(_0x219c6e[_0x3787('0x13')][_0x3787('0x12')]);}})[_0x3787('0x14')](function(_0x594d05){logger[_0x3787('0xf')](_0x3787('0x11'),_0x22f4bb,_0x594d05);_0x55e8d0(_0x594d05);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index ff0bdb2..23a793c 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 _0x26a2=['../../config/environment','./cmCompany.controller','isAuthenticated','/describe','describe','get','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x26a2,0x125));var _0x226a=function(_0x3b004f,_0x16392b){_0x3b004f=_0x3b004f-0x0;var _0x167b2f=_0x26a2[_0x3b004f];return _0x167b2f;};'use strict';var multer=require(_0x226a('0x0'));var util=require('util');var path=require(_0x226a('0x1'));var timeout=require(_0x226a('0x2'));var express=require('express');var router=express[_0x226a('0x3')]();var fs_extra=require(_0x226a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x226a('0x5'));var config=require(_0x226a('0x6'));var controller=require(_0x226a('0x7'));router['get']('/',auth[_0x226a('0x8')](),controller['index']);router['get'](_0x226a('0x9'),auth[_0x226a('0x8')](),controller[_0x226a('0xa')]);router[_0x226a('0xb')](_0x226a('0xc'),auth[_0x226a('0x8')](),controller['show']);router[_0x226a('0xb')](_0x226a('0xd'),auth[_0x226a('0x8')](),controller[_0x226a('0xe')]);router[_0x226a('0xf')]('/',auth[_0x226a('0x8')](),controller[_0x226a('0x10')]);router[_0x226a('0xf')](_0x226a('0xd'),auth[_0x226a('0x8')](),controller[_0x226a('0x11')]);router[_0x226a('0x12')](_0x226a('0xc'),auth['isAuthenticated'](),controller[_0x226a('0x13')]);router[_0x226a('0x14')](_0x226a('0xc'),auth['isAuthenticated'](),controller[_0x226a('0x15')]);module[_0x226a('0x16')]=router;
\ No newline at end of file
+var _0xb66c=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','show','getContacts','post','create','/:id/contacts','addContacts','/:id','update','delete'];(function(_0x2d8c50,_0x55e568){var _0x45d22e=function(_0x2a779e){while(--_0x2a779e){_0x2d8c50['push'](_0x2d8c50['shift']());}};_0x45d22e(++_0x55e568);}(_0xb66c,0x154));var _0xcb66=function(_0x53cf3d,_0x350d64){_0x53cf3d=_0x53cf3d-0x0;var _0x353872=_0xb66c[_0x53cf3d];return _0x353872;};'use strict';var multer=require(_0xcb66('0x0'));var util=require(_0xcb66('0x1'));var path=require(_0xcb66('0x2'));var timeout=require(_0xcb66('0x3'));var express=require(_0xcb66('0x4'));var router=express[_0xcb66('0x5')]();var fs_extra=require(_0xcb66('0x6'));var auth=require(_0xcb66('0x7'));var interaction=require(_0xcb66('0x8'));var config=require(_0xcb66('0x9'));var controller=require(_0xcb66('0xa'));router[_0xcb66('0xb')]('/',auth[_0xcb66('0xc')](),controller[_0xcb66('0xd')]);router[_0xcb66('0xb')](_0xcb66('0xe'),auth[_0xcb66('0xc')](),controller['describe']);router[_0xcb66('0xb')]('/:id',auth[_0xcb66('0xc')](),controller[_0xcb66('0xf')]);router[_0xcb66('0xb')]('/:id/contacts',auth[_0xcb66('0xc')](),controller[_0xcb66('0x10')]);router[_0xcb66('0x11')]('/',auth[_0xcb66('0xc')](),controller[_0xcb66('0x12')]);router[_0xcb66('0x11')](_0xcb66('0x13'),auth[_0xcb66('0xc')](),controller[_0xcb66('0x14')]);router['put'](_0xcb66('0x15'),auth[_0xcb66('0xc')](),controller[_0xcb66('0x16')]);router[_0xcb66('0x17')](_0xcb66('0x15'),auth[_0xcb66('0xc')](),controller[_0xcb66('0x18')]);module[_0xcb66('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 0c4b2e0..1c5f067 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 _0x49c8=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x49c8,0x7f));var _0x849c=function(_0x1f7fd5,_0x16dbb3){_0x1f7fd5=_0x1f7fd5-0x0;var _0x429402=_0x49c8[_0x1f7fd5];return _0x429402;};'use strict';var _=require(_0x849c('0x0'));var Sequelize=require(_0x849c('0x1'));module[_0x849c('0x2')]={'firstName':{'type':Sequelize[_0x849c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x849c('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x849c('0x3')]},'city':{'type':Sequelize[_0x849c('0x3')]},'country':{'type':Sequelize[_0x849c('0x3')]},'dateOfBirth':{'type':Sequelize[_0x849c('0x3')]},'description':{'type':Sequelize[_0x849c('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x849c('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x849c('0x3')]},'url':{'type':Sequelize[_0x849c('0x3')]},'facebook':{'type':Sequelize[_0x849c('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x849c('0x3')]},'skype':{'type':Sequelize[_0x849c('0x3')]},'teams':{'type':Sequelize[_0x849c('0x3')]},'viber':{'type':Sequelize[_0x849c('0x3')]},'line':{'type':Sequelize[_0x849c('0x3')]},'wechat':{'type':Sequelize[_0x849c('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x849c('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x849c('0x3')]},'priority':{'type':Sequelize[_0x849c('0x5')](0x2)[_0x849c('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x849c('0x7')],'defaultValue':Sequelize[_0x849c('0x8')]},'dialTimezone':{'type':Sequelize[_0x849c('0x3')]},'utcOffset':{'type':Sequelize[_0x849c('0x5')]}};
\ No newline at end of file
+var _0x6eee=['UNSIGNED','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6eee,0x1db));var _0xe6ee=function(_0xd35f04,_0x5d47a7){_0xd35f04=_0xd35f04-0x0;var _0x2ca54d=_0x6eee[_0xd35f04];return _0x2ca54d;};'use strict';var _=require(_0xe6ee('0x0'));var Sequelize=require('sequelize');module[_0xe6ee('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe6ee('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe6ee('0x2')]},'city':{'type':Sequelize[_0xe6ee('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xe6ee('0x2')]},'description':{'type':Sequelize[_0xe6ee('0x3')]},'phone':{'type':Sequelize[_0xe6ee('0x2')]},'mobile':{'type':Sequelize[_0xe6ee('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe6ee('0x2')]},'url':{'type':Sequelize[_0xe6ee('0x2')]},'facebook':{'type':Sequelize[_0xe6ee('0x2')]},'fb_data':{'type':Sequelize[_0xe6ee('0x2')]},'twitter':{'type':Sequelize[_0xe6ee('0x2')]},'skype':{'type':Sequelize[_0xe6ee('0x2')]},'teams':{'type':Sequelize[_0xe6ee('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe6ee('0x2')]},'wechat':{'type':Sequelize[_0xe6ee('0x2')]},'telegram':{'type':Sequelize[_0xe6ee('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe6ee('0x4')](0x2)[_0xe6ee('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xe6ee('0x2')]},'utcOffset':{'type':Sequelize[_0xe6ee('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 887f4cb..6353d1d 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','@xcally.com','name','length','slice'];(function(_0x5ebda0,_0x385f04){var _0x4ec370=function(_0x16a040){while(--_0x16a040){_0x5ebda0['push'](_0x5ebda0['shift']());}};_0x4ec370(++_0x385f04);}(_0x3162,0x110));var _0x2316=function(_0x197b38,_0x394a4d){_0x197b38=_0x197b38-0x0;var _0x20a23a=_0x3162[_0x197b38];return _0x20a23a;};'use strict';var _=require(_0x2316('0x0'));var moment=require(_0x2316('0x1'));var random=require(_0x2316('0x2'));var fs=require('fs');var path=require(_0x2316('0x3'));var util=require(_0x2316('0x4'));var tnef=require(_0x2316('0x5'));var logger=require(_0x2316('0x6'))('email');var config=require(_0x2316('0x7'));function getAddress(_0x475439){var _0x5bdbbe=_[_0x2316('0x8')](_0x475439[_0x2316('0x9')]);return _0x5bdbbe&&_0x5bdbbe['address']?_0x5bdbbe[_0x2316('0xa')]:_0x2316('0xb')+random['generate'](0x6)+_0x2316('0xc');}function getFirstName(_0x428e23){var _0x420970=_[_0x2316('0x8')](_0x428e23[_0x2316('0x9')]);if(_0x420970&&_0x420970[_0x2316('0xd')]){if(_0x420970['name']==_0x420970[_0x2316('0xa')]){return _0x420970[_0x2316('0xd')]['substring'](0x0,_0x420970[_0x2316('0xd')]['indexOf']('@'));}var _0x5acbb7=_0x420970[_0x2316('0xd')]['split'](/\s+/);return _0x5acbb7[_0x2316('0xe')]>0x1?_0x5acbb7[_0x2316('0xf')](0x0,-0x1)[_0x2316('0x10')]('\x20'):_0x420970['name'];}return'Anonymous';}function getLastName(_0x4439d6){var _0x504995=_[_0x2316('0x8')](_0x4439d6[_0x2316('0x9')]);if(_0x504995&&_0x504995[_0x2316('0xd')]){var _0x5082ed=_0x504995[_0x2316('0xd')]['split'](/\s+/);return _0x5082ed[_0x2316('0xe')]>0x1?_0x5082ed['pop']():'';}return'';}function getMails(_0x29df36,_0x11e6d5){var _0x3798aa='';for(var _0x54ba47=0x0;_0x54ba47<_0x11e6d5['value']['length'];_0x54ba47+=0x1){if(_0x11e6d5[_0x2316('0x9')][_0x54ba47][_0x2316('0xa')]!==_0x29df36){if(!_['isEmpty'](_0x3798aa)){_0x3798aa+=',';}_0x3798aa+=_0x11e6d5[_0x2316('0x9')][_0x54ba47]['name']||_0x11e6d5[_0x2316('0x9')][_0x54ba47][_0x2316('0xa')]||'';_0x3798aa+='\x20<';_0x3798aa+=_0x11e6d5['value'][_0x54ba47]['address']?_0x11e6d5[_0x2316('0x9')][_0x54ba47][_0x2316('0xa')]:_0x2316('0xb')+random[_0x2316('0x11')](0x6)+_0x2316('0xc');_0x3798aa+='>';}}return _0x3798aa;}function parseEmail(_0x2a8474,_0x3064ca,_0x40a478){if(_0x3064ca[_0x2316('0x12')]){var _0x4bd7ad=/