From: support
Date: Thu, 7 Apr 2022 13:35:44 +0000 (+0000)
Subject: Built motion from commit e2d2a7e0.|2.6.7
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=7deb5cc2665c5549a8ac6e53c6ff049207b56877;p=motion2.git
Built motion from commit e2d2a7e0.|2.6.7
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 93e1a14..7b5b263 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-04-07T13:13:34.809Z",
+ "time": "2022-04-07T13:27:51.809Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9feaf87..217434c 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-07T13:13:34.809Z",
+ "time": "2022-04-07T13:27:51.809Z",
"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 d828211..c7209be 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 _0x07d6=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x4707a3,_0x106fd8){var _0x33dc9b=function(_0x35f934){while(--_0x35f934){_0x4707a3['push'](_0x4707a3['shift']());}};_0x33dc9b(++_0x106fd8);}(_0x07d6,0x1f2));var _0x607d=function(_0x548c66,_0x4ea9b6){_0x548c66=_0x548c66-0x0;var _0x48b69d=_0x07d6[_0x548c66];return _0x48b69d;};'use strict';var Sequelize=require('sequelize');module[_0x607d('0x0')]={'name':{'type':Sequelize[_0x607d('0x1')],'get':function(_0x37be81){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x607d('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x607d('0x3'),_0x607d('0x4'),_0x607d('0x5'),_0x607d('0x6'),_0x607d('0x7'),_0x607d('0x8'),_0x607d('0x9'),_0x607d('0xa')]],'msg':_0x607d('0xb')}},'comment':_0x607d('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x607d('0xc')},'data2':{'type':Sequelize[_0x607d('0x2')](0x1000),'comment':_0x607d('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x607d('0xe')},'data4':{'type':Sequelize[_0x607d('0x2')](0x1000),'comments':_0x607d('0xf')},'data5':{'type':Sequelize[_0x607d('0x2')](0x1000),'comments':_0x607d('0x10')},'data6':{'type':Sequelize[_0x607d('0x2')],'comments':_0x607d('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0x607d('0x12')}};
\ No newline at end of file
+var _0xf430=['urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x21929f,_0xb96182){var _0x1a6077=function(_0x209786){while(--_0x209786){_0x21929f['push'](_0x21929f['shift']());}};_0x1a6077(++_0xb96182);}(_0xf430,0x102));var _0x0f43=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xf430[_0x4e93a9];return _0x43013c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0f43('0x0')],'get':function(_0x3cf97f){return this[_0x0f43('0x1')](_0x0f43('0x2'));}},'action':{'type':Sequelize[_0x0f43('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0f43('0x4'),_0x0f43('0x5'),_0x0f43('0x6'),_0x0f43('0x7'),_0x0f43('0x8'),_0x0f43('0x9'),_0x0f43('0xa'),_0x0f43('0xb')]],'msg':_0x0f43('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x0f43('0x3')](0x1000),'comment':_0x0f43('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x0f43('0xe')},'data4':{'type':Sequelize[_0x0f43('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x0f43('0x3')](0x1000),'comments':_0x0f43('0xf')},'data6':{'type':Sequelize[_0x0f43('0x3')],'comments':_0x0f43('0x10')},'data7':{'type':Sequelize[_0x0f43('0x11')],'comments':_0x0f43('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 9b6bbd2..b59bf6c 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 _0x904e=['../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','save','update','then','destroy','error','stack','name','send','body','Action','catch','find','params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x904e,0x1a3));var _0xe904=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x904e[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe904('0x0'));var jsonpatch=require(_0xe904('0x1'));var rp=require('request-promise');var moment=require(_0xe904('0x2'));var BPromise=require(_0xe904('0x3'));var Mustache=require(_0xe904('0x4'));var util=require(_0xe904('0x5'));var path=require(_0xe904('0x6'));var sox=require(_0xe904('0x7'));var csv=require(_0xe904('0x8'));var ejs=require(_0xe904('0x9'));var fs=require('fs');var fs_extra=require(_0xe904('0xa'));var _=require(_0xe904('0xb'));var squel=require(_0xe904('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe904('0xd'));var toCsv=require(_0xe904('0x8'));var querystring=require(_0xe904('0xe'));var Papa=require(_0xe904('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe904('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe904('0x11'))(_0xe904('0x12'));var utils=require('../../config/utils');var config=require(_0xe904('0x13'));var licenseUtil=require(_0xe904('0x14'));var db=require(_0xe904('0x15'))['db'];function respondWithStatusCode(_0x312275,_0x1e0d23){_0x1e0d23=_0x1e0d23||0xcc;return function(_0xa94c7d){if(_0xa94c7d){return _0x312275[_0xe904('0x16')](_0x1e0d23);}return _0x312275[_0xe904('0x17')](_0x1e0d23)[_0xe904('0x18')]();};}function respondWithResult(_0xddf6f0,_0x17aaf2){_0x17aaf2=_0x17aaf2||0xc8;return function(_0x3514d1){if(_0x3514d1){return _0xddf6f0[_0xe904('0x17')](_0x17aaf2)[_0xe904('0x19')](_0x3514d1);}};}function respondWithFilteredResult(_0x3217fd,_0x1f0e9b){return function(_0xffc9d8){if(_0xffc9d8){var _0x5aaef1=typeof _0x1f0e9b['offset']==='undefined'&&typeof _0x1f0e9b[_0xe904('0x1a')]===_0xe904('0x1b');var _0x90b468=_0xffc9d8[_0xe904('0x1c')];var _0x299342=_0x5aaef1?0x0:_0x1f0e9b[_0xe904('0x1d')];var _0x4dc97f=_0x5aaef1?_0xffc9d8[_0xe904('0x1c')]:_0x1f0e9b[_0xe904('0x1d')]+_0x1f0e9b[_0xe904('0x1a')];var _0x466d87;if(_0x4dc97f>=_0x90b468){_0x4dc97f=_0x90b468;_0x466d87=0xc8;}else{_0x466d87=0xce;}_0x3217fd[_0xe904('0x17')](_0x466d87);return _0x3217fd[_0xe904('0x1e')]('Content-Range',_0x299342+'-'+_0x4dc97f+'/'+_0x90b468)['json'](_0xffc9d8);}return null;};}function patchUpdates(_0x3455fc){return function(_0x145f92){try{jsonpatch['apply'](_0x145f92,_0x3455fc,!![]);}catch(_0x1ec233){return BPromise['reject'](_0x1ec233);}return _0x145f92[_0xe904('0x1f')]();};}function saveUpdates(_0x3421a2,_0x1ca40f){return function(_0x1a8cf7){if(_0x1a8cf7){return _0x1a8cf7[_0xe904('0x20')](_0x3421a2)[_0xe904('0x21')](function(_0x1c15a8){return _0x1c15a8;});}return null;};}function removeEntity(_0x40815f,_0xd82187){return function(_0x2151ab){if(_0x2151ab){return _0x2151ab[_0xe904('0x22')]()[_0xe904('0x21')](function(){_0x40815f[_0xe904('0x17')](0xcc)[_0xe904('0x18')]();});}};}function handleEntityNotFound(_0x4f5bfe,_0x4acb8e){return function(_0x379c76){if(!_0x379c76){_0x4f5bfe[_0xe904('0x16')](0x194);}return _0x379c76;};}function handleError(_0x2c4c76,_0x158d3d){_0x158d3d=_0x158d3d||0x1f4;return function(_0x5b76b1){logger[_0xe904('0x23')](_0x5b76b1[_0xe904('0x24')]);if(_0x5b76b1[_0xe904('0x25')]){delete _0x5b76b1['name'];}_0x2c4c76['status'](_0x158d3d)[_0xe904('0x26')](_0x5b76b1);};}exports[_0xe904('0x20')]=function(_0x539873,_0xb58c2c){if(_0x539873['body']['id']){delete _0x539873[_0xe904('0x27')]['id'];}return db[_0xe904('0x28')]['find']({'where':{'id':_0x539873['params']['id']}})[_0xe904('0x21')](handleEntityNotFound(_0xb58c2c,null))['then'](saveUpdates(_0x539873[_0xe904('0x27')],null))[_0xe904('0x21')](respondWithResult(_0xb58c2c,null))[_0xe904('0x29')](handleError(_0xb58c2c,null));};exports[_0xe904('0x22')]=function(_0x2770b0,_0x4df979){return db[_0xe904('0x28')][_0xe904('0x2a')]({'where':{'id':_0x2770b0[_0xe904('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4df979,null))['then'](removeEntity(_0x4df979,null))[_0xe904('0x29')](handleError(_0x4df979,null));};
\ No newline at end of file
+var _0x8e7c=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','then','destroy','error','name','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x40e7b3,_0x23a8e7){var _0x2cfb20=function(_0x4cb603){while(--_0x4cb603){_0x40e7b3['push'](_0x40e7b3['shift']());}};_0x2cfb20(++_0x23a8e7);}(_0x8e7c,0x81));var _0xc8e7=function(_0x2a8d5e,_0x1c3bca){_0x2a8d5e=_0x2a8d5e-0x0;var _0x1d30e6=_0x8e7c[_0x2a8d5e];return _0x1d30e6;};'use strict';var emlformat=require(_0xc8e7('0x0'));var rimraf=require(_0xc8e7('0x1'));var zipdir=require(_0xc8e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc8e7('0x3'));var moment=require(_0xc8e7('0x4'));var BPromise=require(_0xc8e7('0x5'));var Mustache=require('mustache');var util=require(_0xc8e7('0x6'));var path=require(_0xc8e7('0x7'));var sox=require(_0xc8e7('0x8'));var csv=require(_0xc8e7('0x9'));var ejs=require(_0xc8e7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8e7('0xb'));var crypto=require(_0xc8e7('0xc'));var jsforce=require(_0xc8e7('0xd'));var deskjs=require(_0xc8e7('0xe'));var toCsv=require(_0xc8e7('0x9'));var querystring=require(_0xc8e7('0xf'));var Papa=require(_0xc8e7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc8e7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8e7('0x12'));var logger=require(_0xc8e7('0x13'))(_0xc8e7('0x14'));var utils=require(_0xc8e7('0x15'));var config=require(_0xc8e7('0x16'));var licenseUtil=require(_0xc8e7('0x17'));var db=require(_0xc8e7('0x18'))['db'];function respondWithStatusCode(_0x496eb6,_0x251a6d){_0x251a6d=_0x251a6d||0xcc;return function(_0x39b1d0){if(_0x39b1d0){return _0x496eb6[_0xc8e7('0x19')](_0x251a6d);}return _0x496eb6[_0xc8e7('0x1a')](_0x251a6d)[_0xc8e7('0x1b')]();};}function respondWithResult(_0x263ed8,_0x10aaed){_0x10aaed=_0x10aaed||0xc8;return function(_0x582161){if(_0x582161){return _0x263ed8[_0xc8e7('0x1a')](_0x10aaed)[_0xc8e7('0x1c')](_0x582161);}};}function respondWithFilteredResult(_0x2751fc,_0x393634){return function(_0x4fb934){if(_0x4fb934){var _0xccf6d7=typeof _0x393634[_0xc8e7('0x1d')]===_0xc8e7('0x1e')&&typeof _0x393634['limit']===_0xc8e7('0x1e');var _0x1cc699=_0x4fb934['count'];var _0x50aa0f=_0xccf6d7?0x0:_0x393634[_0xc8e7('0x1d')];var _0x310d5e=_0xccf6d7?_0x4fb934[_0xc8e7('0x1f')]:_0x393634[_0xc8e7('0x1d')]+_0x393634[_0xc8e7('0x20')];var _0x34f570;if(_0x310d5e>=_0x1cc699){_0x310d5e=_0x1cc699;_0x34f570=0xc8;}else{_0x34f570=0xce;}_0x2751fc[_0xc8e7('0x1a')](_0x34f570);return _0x2751fc['set'](_0xc8e7('0x21'),_0x50aa0f+'-'+_0x310d5e+'/'+_0x1cc699)[_0xc8e7('0x1c')](_0x4fb934);}return null;};}function patchUpdates(_0x275ac8){return function(_0x445389){try{jsonpatch[_0xc8e7('0x22')](_0x445389,_0x275ac8,!![]);}catch(_0x54076c){return BPromise['reject'](_0x54076c);}return _0x445389['save']();};}function saveUpdates(_0x3f21ea,_0x207fdd){return function(_0x19824a){if(_0x19824a){return _0x19824a['update'](_0x3f21ea)[_0xc8e7('0x23')](function(_0x282dd7){return _0x282dd7;});}return null;};}function removeEntity(_0x59307f,_0x185c5e){return function(_0x2c478b){if(_0x2c478b){return _0x2c478b[_0xc8e7('0x24')]()['then'](function(){_0x59307f[_0xc8e7('0x1a')](0xcc)[_0xc8e7('0x1b')]();});}};}function handleEntityNotFound(_0x4e5412,_0x53a883){return function(_0x131d1e){if(!_0x131d1e){_0x4e5412[_0xc8e7('0x19')](0x194);}return _0x131d1e;};}function handleError(_0x1b9276,_0x361695){_0x361695=_0x361695||0x1f4;return function(_0x1f4392){logger[_0xc8e7('0x25')](_0x1f4392['stack']);if(_0x1f4392[_0xc8e7('0x26')]){delete _0x1f4392['name'];}_0x1b9276[_0xc8e7('0x1a')](_0x361695)['send'](_0x1f4392);};}exports[_0xc8e7('0x27')]=function(_0x116668,_0x43f172){if(_0x116668['body']['id']){delete _0x116668[_0xc8e7('0x28')]['id'];}return db[_0xc8e7('0x29')][_0xc8e7('0x2a')]({'where':{'id':_0x116668[_0xc8e7('0x2b')]['id']}})[_0xc8e7('0x23')](handleEntityNotFound(_0x43f172,null))[_0xc8e7('0x23')](saveUpdates(_0x116668[_0xc8e7('0x28')],null))[_0xc8e7('0x23')](respondWithResult(_0x43f172,null))['catch'](handleError(_0x43f172,null));};exports[_0xc8e7('0x24')]=function(_0x37712f,_0x5edd50){return db[_0xc8e7('0x29')][_0xc8e7('0x2a')]({'where':{'id':_0x37712f[_0xc8e7('0x2b')]['id']}})[_0xc8e7('0x23')](handleEntityNotFound(_0x5edd50,null))[_0xc8e7('0x23')](removeEntity(_0x5edd50,null))[_0xc8e7('0x2c')](handleError(_0x5edd50,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index c3d8555..967e57e 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 _0x24ad=['Action','tools_actions','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x48e823,_0x4a57dd){var _0x2934ad=function(_0x296bcf){while(--_0x296bcf){_0x48e823['push'](_0x48e823['shift']());}};_0x2934ad(++_0x4a57dd);}(_0x24ad,0xf2));var _0xd24a=function(_0x2acb47,_0x565dbe){_0x2acb47=_0x2acb47-0x0;var _0xab9951=_0x24ad[_0x2acb47];return _0xab9951;};'use strict';var _=require(_0xd24a('0x0'));var util=require('util');var logger=require(_0xd24a('0x1'))('api');var moment=require(_0xd24a('0x2'));var BPromise=require(_0xd24a('0x3'));var rp=require(_0xd24a('0x4'));var fs=require('fs');var path=require(_0xd24a('0x5'));var rimraf=require(_0xd24a('0x6'));var config=require(_0xd24a('0x7'));var attributes=require(_0xd24a('0x8'));module['exports']=function(_0xa64a05,_0x18ce8d){return _0xa64a05[_0xd24a('0x9')](_0xd24a('0xa'),attributes,{'tableName':_0xd24a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b42=['request-promise','path','rimraf','../../config/environment','exports','define','lodash','moment','bluebird'];(function(_0x433108,_0x16ee0c){var _0x19de8e=function(_0xba76aa){while(--_0xba76aa){_0x433108['push'](_0x433108['shift']());}};_0x19de8e(++_0x16ee0c);}(_0x8b42,0x15c));var _0x28b4=function(_0x3f0b8a,_0x578b56){_0x3f0b8a=_0x3f0b8a-0x0;var _0x3fceba=_0x8b42[_0x3f0b8a];return _0x3fceba;};'use strict';var _=require(_0x28b4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x28b4('0x1'));var BPromise=require(_0x28b4('0x2'));var rp=require(_0x28b4('0x3'));var fs=require('fs');var path=require(_0x28b4('0x4'));var rimraf=require(_0x28b4('0x5'));var config=require(_0x28b4('0x6'));var attributes=require('./action.attributes');module[_0x28b4('0x7')]=function(_0x38e1d3,_0x165728){return _0x38e1d3[_0x28b4('0x8')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 9eaabe7..e269473 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x4975,0x86));var _0x5497=function(_0x10b21f,_0x3cd561){_0x10b21f=_0x10b21f-0x0;var _0x371a86=_0x4975[_0x10b21f];return _0x371a86;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5c1531,_0x3780d7){var _0x3690c9=function(_0x1b135e){while(--_0x1b135e){_0x5c1531['push'](_0x5c1531['shift']());}};_0x3690c9(++_0x3780d7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index ee168bb..81f6807 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 _0x47f9=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','destroy','exports'];(function(_0x42796f,_0x249394){var _0x20de26=function(_0x1a1f62){while(--_0x1a1f62){_0x42796f['push'](_0x42796f['shift']());}};_0x20de26(++_0x249394);}(_0x47f9,0x70));var _0x947f=function(_0x5c1930,_0x1b15e7){_0x5c1930=_0x5c1930-0x0;var _0x163a34=_0x47f9[_0x5c1930];return _0x163a34;};'use strict';var multer=require('multer');var util=require(_0x947f('0x0'));var path=require(_0x947f('0x1'));var timeout=require('connect-timeout');var express=require(_0x947f('0x2'));var router=express[_0x947f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x947f('0x4'));var interaction=require(_0x947f('0x5'));var config=require(_0x947f('0x6'));var controller=require(_0x947f('0x7'));router[_0x947f('0x8')](_0x947f('0x9'),auth['isAuthenticated'](),controller[_0x947f('0xa')]);router[_0x947f('0xb')](_0x947f('0x9'),auth['isAuthenticated'](),controller[_0x947f('0xc')]);module[_0x947f('0xd')]=router;
\ No newline at end of file
+var _0xe1dc=['../../config/environment','./action.controller','put','/:id','update','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x598af4,_0x24a0e9){var _0x222213=function(_0x41bdd7){while(--_0x41bdd7){_0x598af4['push'](_0x598af4['shift']());}};_0x222213(++_0x24a0e9);}(_0xe1dc,0xd8));var _0xce1d=function(_0x5f0131,_0x3604f8){_0x5f0131=_0x5f0131-0x0;var _0x5c3a57=_0xe1dc[_0x5f0131];return _0x5c3a57;};'use strict';var multer=require('multer');var util=require(_0xce1d('0x0'));var path=require(_0xce1d('0x1'));var timeout=require(_0xce1d('0x2'));var express=require(_0xce1d('0x3'));var router=express[_0xce1d('0x4')]();var fs_extra=require(_0xce1d('0x5'));var auth=require(_0xce1d('0x6'));var interaction=require(_0xce1d('0x7'));var config=require(_0xce1d('0x8'));var controller=require(_0xce1d('0x9'));router[_0xce1d('0xa')](_0xce1d('0xb'),auth['isAuthenticated'](),controller[_0xce1d('0xc')]);router['delete'](_0xce1d('0xb'),auth[_0xce1d('0xd')](),controller[_0xce1d('0xe')]);module[_0xce1d('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 54d60f8..e705a54 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 _0xda19=['exports','STRING','TEXT'];(function(_0x4f40fb,_0x3756ca){var _0x341d94=function(_0x32e26c){while(--_0x32e26c){_0x4f40fb['push'](_0x4f40fb['shift']());}};_0x341d94(++_0x3756ca);}(_0xda19,0xd5));var _0x9da1=function(_0x1e37b8,_0x1efa66){_0x1e37b8=_0x1e37b8-0x0;var _0x56315c=_0xda19[_0x1e37b8];return _0x56315c;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x1f4830,_0x1a6743){var _0x3bd1d7=function(_0x176d33){while(--_0x176d33){_0x1f4830['push'](_0x1f4830['shift']());}};_0x3bd1d7(++_0x1a6743);}(_0xe14b,0x93));var _0xbe14=function(_0x542028,_0x39daa6){_0x542028=_0x542028-0x0;var _0x1331c1=_0xe14b[_0x542028];return _0x1331c1;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 5109e9e..7305d1b 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 _0x6fc3=['update','then','get','CustomReports','UserProfileResource','status','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Reports','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','length','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','IS\x20NOT\x20EMPTY','clone','output','web','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','run','runReport','MIN(%s)','alias','debug','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','dbH','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x6fc3,0x1c2));var _0x36fc=function(_0xc2778b,_0x1dea89){_0xc2778b=_0xc2778b-0x0;var _0x1f2050=_0x6fc3[_0xc2778b];return _0x1f2050;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x36fc('0x0'));var jsonpatch=require(_0x36fc('0x1'));var rp=require('request-promise');var moment=require(_0x36fc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x36fc('0x3'));var util=require(_0x36fc('0x4'));var path=require('path');var sox=require(_0x36fc('0x5'));var csv=require(_0x36fc('0x6'));var ejs=require(_0x36fc('0x7'));var fs=require('fs');var fs_extra=require(_0x36fc('0x8'));var _=require('lodash');var squel=require(_0x36fc('0x9'));var crypto=require(_0x36fc('0xa'));var jsforce=require(_0x36fc('0xb'));var deskjs=require(_0x36fc('0xc'));var toCsv=require(_0x36fc('0x6'));var querystring=require(_0x36fc('0xd'));var Papa=require(_0x36fc('0xe'));var Redis=require(_0x36fc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x36fc('0x10'));var as=require(_0x36fc('0x11'));var hardwareService=require(_0x36fc('0x12'));var logger=require(_0x36fc('0x13'))(_0x36fc('0x14'));var utils=require(_0x36fc('0x15'));var config=require(_0x36fc('0x16'));var licenseUtil=require(_0x36fc('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x36fc('0x18')];function respondWithStatusCode(_0x2f2f7e,_0x25fac1){_0x25fac1=_0x25fac1||0xcc;return function(_0x3a7049){if(_0x3a7049){return _0x2f2f7e[_0x36fc('0x19')](_0x25fac1);}return _0x2f2f7e['status'](_0x25fac1)[_0x36fc('0x1a')]();};}function respondWithResult(_0x4934e6,_0x27fdaf){_0x27fdaf=_0x27fdaf||0xc8;return function(_0x4bbfaa){if(_0x4bbfaa){return _0x4934e6['status'](_0x27fdaf)[_0x36fc('0x1b')](_0x4bbfaa);}};}function respondWithFilteredResult(_0xd6f93b,_0x43b693){return function(_0x47bb6f){if(_0x47bb6f){var _0x3fc232=typeof _0x43b693[_0x36fc('0x1c')]===_0x36fc('0x1d')&&typeof _0x43b693[_0x36fc('0x1e')]===_0x36fc('0x1d');var _0x3f6259=_0x47bb6f[_0x36fc('0x1f')];var _0x2361cf=_0x3fc232?0x0:_0x43b693[_0x36fc('0x1c')];var _0x120574=_0x3fc232?_0x47bb6f[_0x36fc('0x1f')]:_0x43b693['offset']+_0x43b693['limit'];var _0x2b6789;if(_0x120574>=_0x3f6259){_0x120574=_0x3f6259;_0x2b6789=0xc8;}else{_0x2b6789=0xce;}_0xd6f93b['status'](_0x2b6789);return _0xd6f93b['set'](_0x36fc('0x20'),_0x2361cf+'-'+_0x120574+'/'+_0x3f6259)[_0x36fc('0x1b')](_0x47bb6f);}return null;};}function patchUpdates(_0x11b93f){return function(_0xc8bb22){try{jsonpatch[_0x36fc('0x21')](_0xc8bb22,_0x11b93f,!![]);}catch(_0x219f6b){return BPromise[_0x36fc('0x22')](_0x219f6b);}return _0xc8bb22[_0x36fc('0x23')]();};}function saveUpdates(_0x2a4fb0,_0x58f932){return function(_0xf4a1b3){if(_0xf4a1b3){return _0xf4a1b3[_0x36fc('0x24')](_0x2a4fb0)['then'](function(_0x1e7a6f){return _0x1e7a6f;});}return null;};}function removeEntity(_0x174327,_0x75d49f){return function(_0x23d870){if(_0x23d870){return _0x23d870['destroy']()[_0x36fc('0x25')](function(){var _0x123dc8=_0x23d870[_0x36fc('0x26')]({'plain':!![]});var _0x2b8596=_0x36fc('0x27');return db[_0x36fc('0x28')]['destroy']({'where':{'type':_0x2b8596,'resourceId':_0x123dc8['id']}})[_0x36fc('0x25')](function(){return _0x23d870;});})['then'](function(){_0x174327[_0x36fc('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc7ce,_0x5d5b60){return function(_0x219c71){if(!_0x219c71){_0x2bc7ce['sendStatus'](0x194);}return _0x219c71;};}function handleError(_0x1e5d59,_0xd75055){_0xd75055=_0xd75055||0x1f4;return function(_0x3a0a5f){logger['error'](_0x3a0a5f['stack']);if(_0x3a0a5f[_0x36fc('0x2a')]){delete _0x3a0a5f[_0x36fc('0x2a')];}_0x1e5d59[_0x36fc('0x29')](_0xd75055)[_0x36fc('0x2b')](_0x3a0a5f);};}exports[_0x36fc('0x2c')]=function(_0x4f9978,_0x1514c2){var _0x2be7d0={},_0x21a71a={},_0xa355fc={'count':0x0,'rows':[]};var _0x2a75aa=_[_0x36fc('0x2d')](db[_0x36fc('0x2e')][_0x36fc('0x2f')],function(_0x399b7b){return{'name':_0x399b7b['fieldName'],'type':_0x399b7b['type'][_0x36fc('0x30')]};});_0x21a71a[_0x36fc('0x31')]=_[_0x36fc('0x2d')](_0x2a75aa,'name');_0x21a71a[_0x36fc('0x32')]=_[_0x36fc('0x33')](_0x4f9978['query']);_0x21a71a['filters']=_[_0x36fc('0x34')](_0x21a71a['model'],_0x21a71a[_0x36fc('0x32')]);_0x2be7d0['attributes']=_[_0x36fc('0x34')](_0x21a71a[_0x36fc('0x31')],qs[_0x36fc('0x35')](_0x4f9978['query'][_0x36fc('0x35')]));_0x2be7d0[_0x36fc('0x36')]=_0x2be7d0['attributes']['length']?_0x2be7d0[_0x36fc('0x36')]:_0x21a71a[_0x36fc('0x31')];if(!_0x4f9978['query'][_0x36fc('0x37')](_0x36fc('0x38'))){_0x2be7d0[_0x36fc('0x1e')]=qs[_0x36fc('0x1e')](_0x4f9978[_0x36fc('0x32')][_0x36fc('0x1e')]);_0x2be7d0[_0x36fc('0x1c')]=qs[_0x36fc('0x1c')](_0x4f9978[_0x36fc('0x32')]['offset']);}_0x2be7d0['order']=qs[_0x36fc('0x39')](_0x4f9978[_0x36fc('0x32')][_0x36fc('0x39')]);_0x2be7d0['where']=qs[_0x36fc('0x3a')](_[_0x36fc('0x3b')](_0x4f9978[_0x36fc('0x32')],_0x21a71a['filters']),_0x2a75aa);if(_0x4f9978[_0x36fc('0x32')][_0x36fc('0x3c')]){_0x2be7d0[_0x36fc('0x3d')]=_[_0x36fc('0x3e')](_0x2be7d0['where'],{'$or':_[_0x36fc('0x2d')](_0x2a75aa,function(_0x4667b2){if(_0x4667b2[_0x36fc('0x3f')]!=='VIRTUAL'){var _0x45d6c0={};_0x45d6c0[_0x4667b2[_0x36fc('0x2a')]]={'$like':'%'+_0x4f9978[_0x36fc('0x32')][_0x36fc('0x3c')]+'%'};return _0x45d6c0;}})});}_0x2be7d0=_['merge']({},_0x2be7d0,_0x4f9978[_0x36fc('0x40')]);var _0x4d8b2e={'where':_0x2be7d0[_0x36fc('0x3d')]};return db[_0x36fc('0x2e')][_0x36fc('0x1f')](_0x4d8b2e)[_0x36fc('0x25')](function(_0x2833d3){_0xa355fc[_0x36fc('0x1f')]=_0x2833d3;if(_0x4f9978[_0x36fc('0x32')][_0x36fc('0x41')]){_0x2be7d0[_0x36fc('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x36fc('0x43')](_0x2be7d0);})[_0x36fc('0x25')](function(_0x589147){_0xa355fc[_0x36fc('0x44')]=_0x589147;return _0xa355fc;})[_0x36fc('0x25')](respondWithFilteredResult(_0x1514c2,_0x2be7d0))[_0x36fc('0x45')](handleError(_0x1514c2,null));};exports['show']=function(_0x336574,_0x419f92){var _0x1a7cb9={'raw':![],'where':{'id':_0x336574[_0x36fc('0x46')]['id']}},_0x2dc022={};_0x2dc022[_0x36fc('0x31')]=_[_0x36fc('0x33')](db[_0x36fc('0x2e')]['rawAttributes']);_0x2dc022['query']=_[_0x36fc('0x33')](_0x336574[_0x36fc('0x32')]);_0x2dc022[_0x36fc('0x3a')]=_[_0x36fc('0x34')](_0x2dc022[_0x36fc('0x31')],_0x2dc022['query']);_0x1a7cb9[_0x36fc('0x36')]=_[_0x36fc('0x34')](_0x2dc022[_0x36fc('0x31')],qs['fields'](_0x336574[_0x36fc('0x32')][_0x36fc('0x35')]));_0x1a7cb9['attributes']=_0x1a7cb9[_0x36fc('0x36')]['length']?_0x1a7cb9[_0x36fc('0x36')]:_0x2dc022[_0x36fc('0x31')];if(_0x336574[_0x36fc('0x32')][_0x36fc('0x41')]){_0x1a7cb9[_0x36fc('0x42')]=[{'all':!![]}];}_0x1a7cb9=_['merge']({},_0x1a7cb9,_0x336574[_0x36fc('0x40')]);return db[_0x36fc('0x2e')][_0x36fc('0x47')](_0x1a7cb9)[_0x36fc('0x25')](handleEntityNotFound(_0x419f92,null))[_0x36fc('0x25')](respondWithResult(_0x419f92,null))['catch'](handleError(_0x419f92,null));};exports[_0x36fc('0x48')]=function(_0x1654b9,_0xe9b671){return db[_0x36fc('0x2e')][_0x36fc('0x48')](_0x1654b9[_0x36fc('0x49')],{})[_0x36fc('0x25')](function(_0xaba8d1){var _0x1feeb5=_0x1654b9['user'][_0x36fc('0x26')]({'plain':!![]});if(!_0x1feeb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1feeb5['role']===_0x36fc('0x4a')){var _0x237efe=_0xaba8d1[_0x36fc('0x26')]({'plain':!![]});var _0xa84c8c=_0x36fc('0x4b');return db['UserProfileSection'][_0x36fc('0x47')]({'where':{'name':_0xa84c8c,'userProfileId':_0x1feeb5[_0x36fc('0x4c')]},'raw':!![]})[_0x36fc('0x25')](function(_0x3b61e2){if(_0x3b61e2&&_0x3b61e2[_0x36fc('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x237efe['name'],'resourceId':_0x237efe['id'],'type':_0x36fc('0x27'),'sectionId':_0x3b61e2['id']},{})[_0x36fc('0x25')](function(){return _0xaba8d1;});}else{return _0xaba8d1;}})[_0x36fc('0x45')](function(_0x1333f9){logger[_0x36fc('0x4e')](_0x36fc('0x4f'),_0x1333f9);throw _0x1333f9;});}return _0xaba8d1;})[_0x36fc('0x25')](respondWithResult(_0xe9b671,0xc9))['catch'](handleError(_0xe9b671,null));};exports[_0x36fc('0x24')]=function(_0x22e019,_0x536ca2){if(_0x22e019['body']['id']){delete _0x22e019[_0x36fc('0x49')]['id'];}return db[_0x36fc('0x2e')][_0x36fc('0x47')]({'where':{'id':_0x22e019[_0x36fc('0x46')]['id']}})[_0x36fc('0x25')](handleEntityNotFound(_0x536ca2,null))['then'](saveUpdates(_0x22e019[_0x36fc('0x49')],null))['then'](respondWithResult(_0x536ca2,null))[_0x36fc('0x45')](handleError(_0x536ca2,null));};exports[_0x36fc('0x50')]=function(_0x5dfe5d,_0x4eace7){return db[_0x36fc('0x2e')][_0x36fc('0x47')]({'where':{'id':_0x5dfe5d[_0x36fc('0x46')]['id']}})[_0x36fc('0x25')](handleEntityNotFound(_0x4eace7,null))[_0x36fc('0x25')](removeEntity(_0x4eace7,null))[_0x36fc('0x45')](handleError(_0x4eace7,null));};exports[_0x36fc('0x51')]=function(_0x495c90,_0x2c04ad){var _0x23e6be=0xa;var _0x4a0d5a=[_0x36fc('0x52'),_0x36fc('0x53'),'right_join',_0x36fc('0x54')];var _0xf56230={'SUM':_0x36fc('0x55'),'COUNT':_0x36fc('0x56'),'COUNT DISTINCT':_0x36fc('0x57'),'MAX':_0x36fc('0x58'),'MIN':'MIN(%s)','AVG':_0x36fc('0x59'),'GROUP_CONCAT':_0x36fc('0x5a'),'GROUP_CONCAT ASC':_0x36fc('0x5b'),'GROUP_CONCAT DESC':_0x36fc('0x5c')};var _0x5b5162={'SEC_TO_TIME':_0x36fc('0x5d'),'DATE':_0x36fc('0x5e'),'HOUR':_0x36fc('0x5f'),'ROUND':_0x36fc('0x60'),'UNIX_TIMESTAMP':_0x36fc('0x61')};var _0x1f1d27=function(_0x3e65f7){return!_[_0x36fc('0x62')]([_0x36fc('0x63'),_0x36fc('0x64'),_0x36fc('0x65'),'IS\x20NOT\x20EMPTY'],_0x3e65f7);};var _0x4c8aa7=function(_0x5cda4f){if(!_0x5cda4f||!_0x5cda4f['rules'][_0x36fc('0x66')]){return'';}for(var _0x2da568='(',_0x79a9be=0x0;_0x79a9be<_0x5cda4f[_0x36fc('0x67')]['length'];_0x79a9be+=0x1){_0x79a9be>0x0&&(_0x2da568+='\x20'+_0x5cda4f[_0x36fc('0x68')]+'\x20');_0x2da568+=_0x5cda4f[_0x36fc('0x67')][_0x79a9be][_0x36fc('0x69')]?_0x4c8aa7(_0x5cda4f['rules'][_0x79a9be][_0x36fc('0x69')]):_0x5cda4f['rules'][_0x79a9be][_0x36fc('0x6a')]+'\x20'+_0x5cda4f['rules'][_0x79a9be]['condition']+(_0x1f1d27(_0x5cda4f[_0x36fc('0x67')][_0x79a9be][_0x36fc('0x6b')])?'\x20'+_0x5cda4f['rules'][_0x79a9be][_0x36fc('0x6c')]:'');}return _0x2da568+')';};var _0x1bd722={'where':{'id':_0x495c90[_0x36fc('0x46')]['id']}},_0x3ff41f,_0x14d898,_0x35d658,_0x4ebba8,_0x21e71b;_0x1bd722=_[_0x36fc('0x3e')]({},_0x1bd722,_0x495c90[_0x36fc('0x40')]);return db[_0x36fc('0x2e')][_0x36fc('0x47')](_0x1bd722)['then'](function(_0x1a3001){if(_0x1a3001){_0x3ff41f=_0x1a3001;return _0x1a3001[_0x36fc('0x6d')]();}return null;})[_0x36fc('0x25')](function(_0x1d85f5){if(_0x1d85f5){if(!_0x1d85f5['length']){throw new db[(_0x36fc('0x6e'))][(_0x36fc('0x6f'))](_0x36fc('0x70'),0x193);}_0x14d898=_0x1d85f5;return db[_0x36fc('0x71')][_0x36fc('0x43')]({'raw':!![]});}return null;})[_0x36fc('0x25')](function(_0xcfb459){if(_0xcfb459){_0x35d658=_['keyBy'](_0xcfb459,'id');var _0x37c8a0;var _0x3d5a43=squel[_0x36fc('0x72')]();_0x3d5a43[_0x36fc('0x73')](_0x3ff41f[_0x36fc('0x74')]);for(var _0x16e5ae=0x0;_0x16e5ae<_0x14d898['length'];_0x16e5ae+=0x1){_0x37c8a0=_0x14d898[_0x16e5ae][_0x36fc('0x75')]?_0x35d658[_0x14d898[_0x16e5ae][_0x36fc('0x75')]][_0x36fc('0x76')]:_0x14d898[_0x16e5ae][_0x36fc('0x6a')];_0x37c8a0=_0x14d898[_0x16e5ae][_0x36fc('0x77')]?_[_0x36fc('0x78')](_0xf56230[_0x14d898[_0x16e5ae][_0x36fc('0x77')]],'%s',_0x37c8a0):_0x37c8a0;_0x37c8a0=_0x14d898[_0x16e5ae]['format']?_[_0x36fc('0x78')](_0x5b5162[_0x14d898[_0x16e5ae][_0x36fc('0x79')]],'%s',_0x37c8a0):_0x37c8a0;if(_0x14d898[_0x16e5ae][_0x36fc('0x7a')]){_0x3d5a43[_0x36fc('0x69')](_0x37c8a0);}_0x14d898[_0x16e5ae][_0x36fc('0x7b')]&&_0x3d5a43[_0x36fc('0x7c')](_0x37c8a0,_0x14d898[_0x16e5ae][_0x36fc('0x7b')]===_0x36fc('0x7d')?![]:!![]);_0x3d5a43['field'](_0x37c8a0,_0x14d898[_0x16e5ae]['alias']||_0x37c8a0);}if(_0x3ff41f[_0x36fc('0x7e')]){_0x3ff41f[_0x36fc('0x7e')]=JSON[_0x36fc('0x7f')](_0x3ff41f[_0x36fc('0x7e')]);for(var _0x3b56d3=0x0;_0x3b56d3<_0x3ff41f['joins']['length'];_0x3b56d3+=0x1){if(_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3][_0x36fc('0x3f')]&&_[_0x36fc('0x62')](_0x4a0d5a,_0x3ff41f['joins'][_0x3b56d3][_0x36fc('0x3f')])&&_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3][_0x36fc('0x80')]&&_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3][_0x36fc('0x81')]&&_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3][_0x36fc('0x82')]){_0x3d5a43[_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3][_0x36fc('0x3f')]](_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3][_0x36fc('0x81')],null,util['format'](_0x36fc('0x83'),_0x3ff41f[_0x36fc('0x74')],_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3][_0x36fc('0x80')],_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3]['foreignTable'],_0x3ff41f[_0x36fc('0x7e')][_0x3b56d3]['foreignKey']));}}}if(_0x3ff41f[_0x36fc('0x84')]){_0x3ff41f[_0x36fc('0x84')]=JSON[_0x36fc('0x7f')](_0x3ff41f[_0x36fc('0x84')]);_0x3d5a43[_0x36fc('0x3d')](_0x4c8aa7(_0x3ff41f[_0x36fc('0x84')]['group']));}_0x21e71b=_0x3d5a43['clone']();_0x3d5a43[_0x36fc('0x1e')](_0x23e6be);_0x3d5a43[_0x36fc('0x1c')](0x0);logger['debug'](_0x36fc('0x85'),_0x3d5a43[_0x36fc('0x86')]());return dbH[_0x36fc('0x87')][_0x36fc('0x32')](_0x3d5a43[_0x36fc('0x86')](),{'type':dbH[_0x36fc('0x87')][_0x36fc('0x88')][_0x36fc('0x89')]});}})[_0x36fc('0x25')](respondWithResult(_0x2c04ad,null))[_0x36fc('0x45')](handleError(_0x2c04ad,null));};function runReport(_0x4c3049,_0x1abae2,_0x54c542){var _0x3726cc=_0x1abae2[_0x36fc('0x2a')];var _0x1d296b=0xa;var _0x57d3e4=[_0x36fc('0x52'),_0x36fc('0x53'),'right_join',_0x36fc('0x54')];var _0x3c68af={'SUM':_0x36fc('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x36fc('0x57'),'MAX':_0x36fc('0x58'),'MIN':'MIN(%s)','AVG':_0x36fc('0x59'),'GROUP_CONCAT':_0x36fc('0x5a'),'GROUP_CONCAT ASC':_0x36fc('0x5b'),'GROUP_CONCAT DESC':_0x36fc('0x5c')};var _0x490fe4={'SEC_TO_TIME':_0x36fc('0x5d'),'DATE':_0x36fc('0x5e'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x362952=function(_0x15efb0){return!_[_0x36fc('0x62')]([_0x36fc('0x63'),'IS\x20NOT\x20NULL',_0x36fc('0x65'),_0x36fc('0x8a')],_0x15efb0);};var _0x5a4e71=function(_0x26206d){if(!_0x26206d||!_0x26206d[_0x36fc('0x67')][_0x36fc('0x66')]){return'';}for(var _0x243117='(',_0x53a8a2=0x0;_0x53a8a2<_0x26206d[_0x36fc('0x67')]['length'];_0x53a8a2+=0x1){_0x53a8a2>0x0&&(_0x243117+='\x20'+_0x26206d['operator']+'\x20');_0x243117+=_0x26206d[_0x36fc('0x67')][_0x53a8a2]['group']?_0x5a4e71(_0x26206d['rules'][_0x53a8a2][_0x36fc('0x69')]):_0x26206d[_0x36fc('0x67')][_0x53a8a2][_0x36fc('0x6a')]+'\x20'+_0x26206d[_0x36fc('0x67')][_0x53a8a2][_0x36fc('0x6b')]+(_0x362952(_0x26206d[_0x36fc('0x67')][_0x53a8a2][_0x36fc('0x6b')])?'\x20'+_0x26206d[_0x36fc('0x67')][_0x53a8a2][_0x36fc('0x6c')]:'');}return _0x243117+')';};var _0x2e25a7={'where':{'id':_0x4c3049['id']}},_0x2a504a,_0x3e9528,_0x4ec179,_0x5c177f,_0x197f71;_0x2e25a7=_[_0x36fc('0x3e')]({},_0x2e25a7,_0x54c542);return db[_0x36fc('0x2e')][_0x36fc('0x47')](_0x2e25a7)['then'](function(_0x2d4abd){if(_0x2d4abd){_0x2a504a=_0x2d4abd;return _0x2d4abd[_0x36fc('0x6d')]();}return null;})[_0x36fc('0x25')](function(_0xd69f9a){if(_0xd69f9a){if(!_0xd69f9a[_0x36fc('0x66')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3e9528=_0xd69f9a;return db[_0x36fc('0x71')][_0x36fc('0x43')]({'raw':!![]});}return null;})[_0x36fc('0x25')](function(_0xb8eaad){if(_0xb8eaad){_0x4ec179=_['keyBy'](_0xb8eaad,'id');var _0x33aa59;var _0x562aed=squel['select']();_0x562aed[_0x36fc('0x73')](_0x2a504a[_0x36fc('0x74')]);for(var _0xe1ec0=0x0;_0xe1ec0<_0x3e9528[_0x36fc('0x66')];_0xe1ec0+=0x1){_0x33aa59=_0x3e9528[_0xe1ec0]['MetricId']?_0x4ec179[_0x3e9528[_0xe1ec0]['MetricId']][_0x36fc('0x76')]:_0x3e9528[_0xe1ec0]['field'];_0x33aa59=_0x3e9528[_0xe1ec0][_0x36fc('0x77')]?_[_0x36fc('0x78')](_0x3c68af[_0x3e9528[_0xe1ec0][_0x36fc('0x77')]],'%s',_0x33aa59):_0x33aa59;_0x33aa59=_0x3e9528[_0xe1ec0][_0x36fc('0x79')]?_[_0x36fc('0x78')](_0x490fe4[_0x3e9528[_0xe1ec0]['format']],'%s',_0x33aa59):_0x33aa59;if(_0x3e9528[_0xe1ec0][_0x36fc('0x7a')]){_0x562aed[_0x36fc('0x69')](_0x33aa59);}_0x3e9528[_0xe1ec0]['orderBy']&&_0x562aed[_0x36fc('0x7c')](_0x33aa59,_0x3e9528[_0xe1ec0]['orderBy']===_0x36fc('0x7d')?![]:!![]);_0x562aed[_0x36fc('0x6a')](_0x33aa59,_0x3e9528[_0xe1ec0]['alias']||_0x33aa59);}if(_0x2a504a[_0x36fc('0x7e')]){_0x2a504a['joins']=JSON[_0x36fc('0x7f')](_0x2a504a['joins']);for(var _0x3e4075=0x0;_0x3e4075<_0x2a504a['joins'][_0x36fc('0x66')];_0x3e4075+=0x1){if(_0x2a504a[_0x36fc('0x7e')][_0x3e4075][_0x36fc('0x3f')]&&_['includes'](_0x57d3e4,_0x2a504a[_0x36fc('0x7e')][_0x3e4075]['type'])&&_0x2a504a[_0x36fc('0x7e')][_0x3e4075][_0x36fc('0x80')]&&_0x2a504a[_0x36fc('0x7e')][_0x3e4075][_0x36fc('0x81')]&&_0x2a504a['joins'][_0x3e4075][_0x36fc('0x82')]){_0x562aed[_0x2a504a[_0x36fc('0x7e')][_0x3e4075][_0x36fc('0x3f')]](_0x2a504a[_0x36fc('0x7e')][_0x3e4075]['foreignTable'],null,util[_0x36fc('0x79')](_0x36fc('0x83'),_0x2a504a['table'],_0x2a504a[_0x36fc('0x7e')][_0x3e4075][_0x36fc('0x80')],_0x2a504a['joins'][_0x3e4075]['foreignTable'],_0x2a504a[_0x36fc('0x7e')][_0x3e4075]['foreignKey']));}}}if(_0x2a504a['conditions']){_0x2a504a[_0x36fc('0x84')]=JSON[_0x36fc('0x7f')](_0x2a504a['conditions']);_0x562aed[_0x36fc('0x3d')](_0x5a4e71(_0x2a504a[_0x36fc('0x84')][_0x36fc('0x69')]));}_0x197f71=_0x562aed[_0x36fc('0x8b')]();_0x562aed[_0x36fc('0x1e')](_0x1d296b);_0x562aed[_0x36fc('0x1c')](0x0);return;}})[_0x36fc('0x25')](function(){if(_0x1abae2[_0x36fc('0x8c')]===_0x36fc('0x8d')){return null;}var _0x1fe35e=_['merge'](_0x1abae2,{'name':_0x1abae2['fullPath']||_0x1abae2[_0x36fc('0x2a')]||_0x2a504a[_0x36fc('0x2a')],'basename':_0x3726cc,'savename':util['format']('%s-%s.%s',_0x1abae2[_0x36fc('0x2a')]||_0x2a504a[_0x36fc('0x2a')],require('randomstring')[_0x36fc('0x8e')](0x4),_0x1abae2[_0x36fc('0x8c')]||_0x36fc('0x8f')),'reportId':_0x2a504a['id'],'reportType':_0x36fc('0x90')});return db[_0x36fc('0x91')]['create'](_0x1fe35e,{'raw':!![]});})[_0x36fc('0x25')](function(_0x2d1bb5){if(_0x2a504a['table']===_0x36fc('0x92')){_0x197f71[_0x36fc('0x3d')](_0x2a504a[_0x36fc('0x74')]+_0x36fc('0x93'),_0x1abae2[_0x36fc('0x94')],_0x1abae2[_0x36fc('0x95')]);}else{_0x197f71[_0x36fc('0x3d')](_0x2a504a[_0x36fc('0x74')]+_0x36fc('0x96'),_0x1abae2['startDate'],_0x1abae2['endDate']);}if(_0x2d1bb5){logger[_0x36fc('0x97')](_0x36fc('0x98'),_0x197f71[_0x36fc('0x86')]());require(_0x36fc('0x99'))['fork'](path['join'](__dirname,_0x36fc('0x9a'),_0x2d1bb5[_0x36fc('0x8c')]),[_0x2d1bb5['id'],_0x197f71[_0x36fc('0x86')](),path[_0x36fc('0x52')](__dirname,'../../files/reports',_0x2d1bb5[_0x36fc('0x9b')]),_0x3726cc]);return _0x2d1bb5;}else{var _0x566d92=squel[_0x36fc('0x72')]();_0x566d92[_0x36fc('0x73')]('('+_0x197f71[_0x36fc('0x86')]()+')',_0x36fc('0x9c'));_0x566d92[_0x36fc('0x6a')]('COUNT(*)',_0x36fc('0x1f'));_0x197f71[_0x36fc('0x1e')](_0x1abae2['limit']||_0x1d296b);_0x197f71[_0x36fc('0x1c')](_0x1abae2['offset']||0x0);return dbH[_0x36fc('0x87')][_0x36fc('0x32')](_0x566d92[_0x36fc('0x86')](),{'type':dbH[_0x36fc('0x87')][_0x36fc('0x88')][_0x36fc('0x89')]})[_0x36fc('0x25')](function(_0x18b413){if(!_0x18b413[_0x36fc('0x66')]){_0x5c177f=0x0;}else{_0x5c177f=_0x18b413[0x0][_0x36fc('0x1f')]||0x0;}return dbH[_0x36fc('0x87')][_0x36fc('0x32')](_0x197f71[_0x36fc('0x86')](),{'type':dbH[_0x36fc('0x87')][_0x36fc('0x88')][_0x36fc('0x89')]});})['then'](function(_0x3c7891){return{'rows':_0x3c7891||[],'count':_0x5c177f};});}});}exports[_0x36fc('0x9d')]=function(_0x259d54,_0x1f8d03){return runReport(_0x259d54['params'],_0x259d54[_0x36fc('0x32')],_0x259d54[_0x36fc('0x40')])['then'](respondWithResult(_0x1f8d03,null))['catch'](handleError(_0x1f8d03,null));};exports[_0x36fc('0x9e')]=runReport;exports[_0x36fc('0x32')]=function(_0x39eaba,_0x13a541){var _0x3dd5c8=0xa;var _0x2eac78=[_0x36fc('0x52'),'left_join','right_join','cross_join'];var _0x2f136d={'SUM':_0x36fc('0x55'),'COUNT':_0x36fc('0x56'),'COUNT DISTINCT':_0x36fc('0x57'),'MAX':_0x36fc('0x58'),'MIN':_0x36fc('0x9f'),'AVG':_0x36fc('0x59'),'GROUP_CONCAT':_0x36fc('0x5a'),'GROUP_CONCAT ASC':_0x36fc('0x5b'),'GROUP_CONCAT DESC':_0x36fc('0x5c')};var _0xb90d5={'SEC_TO_TIME':_0x36fc('0x5d'),'DATE':_0x36fc('0x5e'),'HOUR':_0x36fc('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x36fc('0x61')};var _0x192074=function(_0x1f492c){return!_[_0x36fc('0x62')]([_0x36fc('0x63'),_0x36fc('0x64'),'IS\x20EMPTY',_0x36fc('0x8a')],_0x1f492c);};var _0x15ab16=function(_0x51fcc1){if(!_0x51fcc1||!_0x51fcc1[_0x36fc('0x67')][_0x36fc('0x66')]){return'';}for(var _0x56c54c='(',_0x4366f2=0x0;_0x4366f2<_0x51fcc1[_0x36fc('0x67')][_0x36fc('0x66')];_0x4366f2+=0x1){_0x4366f2>0x0&&(_0x56c54c+='\x20'+_0x51fcc1[_0x36fc('0x68')]+'\x20');_0x56c54c+=_0x51fcc1[_0x36fc('0x67')][_0x4366f2][_0x36fc('0x69')]?_0x15ab16(_0x51fcc1['rules'][_0x4366f2][_0x36fc('0x69')]):_0x51fcc1[_0x36fc('0x67')][_0x4366f2][_0x36fc('0x6a')]+'\x20'+_0x51fcc1[_0x36fc('0x67')][_0x4366f2]['condition']+(_0x192074(_0x51fcc1[_0x36fc('0x67')][_0x4366f2][_0x36fc('0x6b')])?'\x20'+_0x51fcc1[_0x36fc('0x67')][_0x4366f2][_0x36fc('0x6c')]:'');}return _0x56c54c+')';};var _0x1339c7={'where':{'id':_0x39eaba['params']['id']}},_0x3265c6,_0x5b6153,_0x14bb9f,_0x163cf2,_0x1f5180;_0x1339c7=_['merge']({},_0x1339c7,_0x39eaba[_0x36fc('0x40')]);return db['AnalyticCustomReport'][_0x36fc('0x47')](_0x1339c7)['then'](function(_0x2c3c3c){if(_0x2c3c3c){_0x3265c6=_0x2c3c3c;return _0x2c3c3c[_0x36fc('0x6d')]();}return null;})[_0x36fc('0x25')](function(_0x1d037d){if(_0x1d037d){if(!_0x1d037d['length']){throw new db[(_0x36fc('0x6e'))][(_0x36fc('0x6f'))](_0x36fc('0x70'),0x193);}_0x5b6153=_0x1d037d;return db[_0x36fc('0x71')]['findAll']({'raw':!![]});}return null;})[_0x36fc('0x25')](function(_0x356215){if(_0x356215){_0x14bb9f=_['keyBy'](_0x356215,'id');var _0x5c7eba;var _0x375191=squel[_0x36fc('0x72')]();_0x375191[_0x36fc('0x73')](_0x3265c6[_0x36fc('0x74')]);for(var _0xe26435=0x0;_0xe26435<_0x5b6153[_0x36fc('0x66')];_0xe26435+=0x1){_0x5c7eba=_0x5b6153[_0xe26435][_0x36fc('0x75')]?_0x14bb9f[_0x5b6153[_0xe26435][_0x36fc('0x75')]][_0x36fc('0x76')]:_0x5b6153[_0xe26435][_0x36fc('0x6a')];_0x5c7eba=_0x5b6153[_0xe26435][_0x36fc('0x77')]?_[_0x36fc('0x78')](_0x2f136d[_0x5b6153[_0xe26435][_0x36fc('0x77')]],'%s',_0x5c7eba):_0x5c7eba;_0x5c7eba=_0x5b6153[_0xe26435]['format']?_[_0x36fc('0x78')](_0xb90d5[_0x5b6153[_0xe26435]['format']],'%s',_0x5c7eba):_0x5c7eba;if(_0x5b6153[_0xe26435][_0x36fc('0x7a')]){_0x375191[_0x36fc('0x69')](_0x5c7eba);}_0x5b6153[_0xe26435][_0x36fc('0x7b')]&&_0x375191[_0x36fc('0x7c')](_0x5c7eba,_0x5b6153[_0xe26435][_0x36fc('0x7b')]==='DESC'?![]:!![]);_0x375191['field'](_0x5c7eba,_0x5b6153[_0xe26435][_0x36fc('0xa0')]||_0x5c7eba);}if(_0x3265c6[_0x36fc('0x7e')]){_0x3265c6['joins']=JSON[_0x36fc('0x7f')](_0x3265c6[_0x36fc('0x7e')]);for(var _0x4daae7=0x0;_0x4daae7<_0x3265c6[_0x36fc('0x7e')]['length'];_0x4daae7+=0x1){if(_0x3265c6['joins'][_0x4daae7][_0x36fc('0x3f')]&&_[_0x36fc('0x62')](_0x2eac78,_0x3265c6['joins'][_0x4daae7][_0x36fc('0x3f')])&&_0x3265c6[_0x36fc('0x7e')][_0x4daae7][_0x36fc('0x80')]&&_0x3265c6[_0x36fc('0x7e')][_0x4daae7][_0x36fc('0x81')]&&_0x3265c6['joins'][_0x4daae7][_0x36fc('0x82')]){_0x375191[_0x3265c6['joins'][_0x4daae7][_0x36fc('0x3f')]](_0x3265c6[_0x36fc('0x7e')][_0x4daae7][_0x36fc('0x81')],null,util[_0x36fc('0x79')](_0x36fc('0x83'),_0x3265c6['table'],_0x3265c6[_0x36fc('0x7e')][_0x4daae7][_0x36fc('0x80')],_0x3265c6[_0x36fc('0x7e')][_0x4daae7]['foreignTable'],_0x3265c6['joins'][_0x4daae7]['foreignKey']));}}}if(_0x3265c6[_0x36fc('0x84')]){_0x3265c6[_0x36fc('0x84')]=JSON[_0x36fc('0x7f')](_0x3265c6[_0x36fc('0x84')]);_0x375191[_0x36fc('0x3d')](_0x15ab16(_0x3265c6['conditions'][_0x36fc('0x69')]));}_0x1f5180=_0x375191[_0x36fc('0x8b')]();_0x375191[_0x36fc('0x1e')](_0x3dd5c8);_0x375191['offset'](0x0);logger[_0x36fc('0xa1')](_0x36fc('0x85'),_0x375191[_0x36fc('0x86')]());return dbH[_0x36fc('0x87')][_0x36fc('0x32')](_0x375191[_0x36fc('0x86')](),{'type':dbH[_0x36fc('0x87')]['QueryTypes'][_0x36fc('0x89')]});}})[_0x36fc('0x25')](function(){return{'sql':_0x1f5180[_0x36fc('0x86')]()};})['then'](respondWithResult(_0x13a541,null))[_0x36fc('0x45')](handleError(_0x13a541,null));};
\ No newline at end of file
+var _0x98f0=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','AnalyticCustomReport','rows','params','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','catch','body','preview','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','replace','function','format','orderBy','DESC','alias','parse','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MIN(%s)','DATE(%s)','HOUR(%s)','output','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','countTable','COUNT(*)','runReport','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','debug','eml-format','zip-dir','fast-json-patch','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','name','send','index','rawAttributes','type','model','map','keys','query','intersection','attributes'];(function(_0x46d2d6,_0x46d924){var _0x569c76=function(_0x1c9a55){while(--_0x1c9a55){_0x46d2d6['push'](_0x46d2d6['shift']());}};_0x569c76(++_0x46d924);}(_0x98f0,0x1b5));var _0x098f=function(_0x5ca52a,_0x54d9db){_0x5ca52a=_0x5ca52a-0x0;var _0x1f9ff4=_0x98f0[_0x5ca52a];return _0x1f9ff4;};'use strict';var emlformat=require(_0x098f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x098f('0x1'));var jsonpatch=require(_0x098f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x098f('0x3'));var sox=require(_0x098f('0x4'));var csv=require(_0x098f('0x5'));var ejs=require(_0x098f('0x6'));var fs=require('fs');var fs_extra=require(_0x098f('0x7'));var _=require('lodash');var squel=require(_0x098f('0x8'));var crypto=require(_0x098f('0x9'));var jsforce=require(_0x098f('0xa'));var deskjs=require(_0x098f('0xb'));var toCsv=require(_0x098f('0x5'));var querystring=require(_0x098f('0xc'));var Papa=require(_0x098f('0xd'));var Redis=require(_0x098f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x098f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x098f('0x10'))(_0x098f('0x11'));var utils=require(_0x098f('0x12'));var config=require(_0x098f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x098f('0x14'))['db'];var dbH=require(_0x098f('0x14'))['dbH'];function respondWithStatusCode(_0x3bfb0b,_0x1de18e){_0x1de18e=_0x1de18e||0xcc;return function(_0x72a41c){if(_0x72a41c){return _0x3bfb0b[_0x098f('0x15')](_0x1de18e);}return _0x3bfb0b['status'](_0x1de18e)[_0x098f('0x16')]();};}function respondWithResult(_0x1e7fcc,_0x5da723){_0x5da723=_0x5da723||0xc8;return function(_0x411b6e){if(_0x411b6e){return _0x1e7fcc['status'](_0x5da723)[_0x098f('0x17')](_0x411b6e);}};}function respondWithFilteredResult(_0xaff9f5,_0x12b864){return function(_0x603082){if(_0x603082){var _0x4466a8=typeof _0x12b864['offset']===_0x098f('0x18')&&typeof _0x12b864[_0x098f('0x19')]===_0x098f('0x18');var _0x2d2fc6=_0x603082[_0x098f('0x1a')];var _0x251d4b=_0x4466a8?0x0:_0x12b864['offset'];var _0xa85478=_0x4466a8?_0x603082[_0x098f('0x1a')]:_0x12b864[_0x098f('0x1b')]+_0x12b864[_0x098f('0x19')];var _0x1df8f0;if(_0xa85478>=_0x2d2fc6){_0xa85478=_0x2d2fc6;_0x1df8f0=0xc8;}else{_0x1df8f0=0xce;}_0xaff9f5[_0x098f('0x1c')](_0x1df8f0);return _0xaff9f5[_0x098f('0x1d')](_0x098f('0x1e'),_0x251d4b+'-'+_0xa85478+'/'+_0x2d2fc6)[_0x098f('0x17')](_0x603082);}return null;};}function patchUpdates(_0xc3642c){return function(_0x1cbc99){try{jsonpatch[_0x098f('0x1f')](_0x1cbc99,_0xc3642c,!![]);}catch(_0x313ce3){return BPromise[_0x098f('0x20')](_0x313ce3);}return _0x1cbc99[_0x098f('0x21')]();};}function saveUpdates(_0x2b94ec,_0x4f24df){return function(_0x425cef){if(_0x425cef){return _0x425cef[_0x098f('0x22')](_0x2b94ec)['then'](function(_0x52bd4){return _0x52bd4;});}return null;};}function removeEntity(_0x237381,_0x1fa961){return function(_0x1177b2){if(_0x1177b2){return _0x1177b2['destroy']()[_0x098f('0x23')](function(){var _0x3ed256=_0x1177b2[_0x098f('0x24')]({'plain':!![]});var _0x4864d5=_0x098f('0x25');return db[_0x098f('0x26')][_0x098f('0x27')]({'where':{'type':_0x4864d5,'resourceId':_0x3ed256['id']}})['then'](function(){return _0x1177b2;});})[_0x098f('0x23')](function(){_0x237381[_0x098f('0x1c')](0xcc)[_0x098f('0x16')]();});}};}function handleEntityNotFound(_0xaba5a9,_0x3146d1){return function(_0x11cf6d){if(!_0x11cf6d){_0xaba5a9[_0x098f('0x15')](0x194);}return _0x11cf6d;};}function handleError(_0x5c896a,_0x43907){_0x43907=_0x43907||0x1f4;return function(_0x4f3600){logger[_0x098f('0x28')](_0x4f3600['stack']);if(_0x4f3600[_0x098f('0x29')]){delete _0x4f3600[_0x098f('0x29')];}_0x5c896a[_0x098f('0x1c')](_0x43907)[_0x098f('0x2a')](_0x4f3600);};}exports[_0x098f('0x2b')]=function(_0x38551c,_0x2c3a5f){var _0xf476a4={},_0xf5fdf6={},_0x3e47d1={'count':0x0,'rows':[]};var _0x500c5f=_['map'](db['AnalyticCustomReport'][_0x098f('0x2c')],function(_0xe9dde5){return{'name':_0xe9dde5['fieldName'],'type':_0xe9dde5[_0x098f('0x2d')]['key']};});_0xf5fdf6[_0x098f('0x2e')]=_[_0x098f('0x2f')](_0x500c5f,_0x098f('0x29'));_0xf5fdf6['query']=_[_0x098f('0x30')](_0x38551c[_0x098f('0x31')]);_0xf5fdf6['filters']=_[_0x098f('0x32')](_0xf5fdf6[_0x098f('0x2e')],_0xf5fdf6[_0x098f('0x31')]);_0xf476a4[_0x098f('0x33')]=_[_0x098f('0x32')](_0xf5fdf6[_0x098f('0x2e')],qs[_0x098f('0x34')](_0x38551c[_0x098f('0x31')]['fields']));_0xf476a4[_0x098f('0x33')]=_0xf476a4[_0x098f('0x33')][_0x098f('0x35')]?_0xf476a4[_0x098f('0x33')]:_0xf5fdf6[_0x098f('0x2e')];if(!_0x38551c[_0x098f('0x31')][_0x098f('0x36')](_0x098f('0x37'))){_0xf476a4[_0x098f('0x19')]=qs['limit'](_0x38551c[_0x098f('0x31')][_0x098f('0x19')]);_0xf476a4[_0x098f('0x1b')]=qs[_0x098f('0x1b')](_0x38551c[_0x098f('0x31')][_0x098f('0x1b')]);}_0xf476a4[_0x098f('0x38')]=qs[_0x098f('0x39')](_0x38551c[_0x098f('0x31')][_0x098f('0x39')]);_0xf476a4[_0x098f('0x3a')]=qs['filters'](_[_0x098f('0x3b')](_0x38551c['query'],_0xf5fdf6[_0x098f('0x3c')]),_0x500c5f);if(_0x38551c['query'][_0x098f('0x3d')]){_0xf476a4[_0x098f('0x3a')]=_[_0x098f('0x3e')](_0xf476a4[_0x098f('0x3a')],{'$or':_[_0x098f('0x2f')](_0x500c5f,function(_0x4019b1){if(_0x4019b1['type']!==_0x098f('0x3f')){var _0x5674be={};_0x5674be[_0x4019b1[_0x098f('0x29')]]={'$like':'%'+_0x38551c[_0x098f('0x31')][_0x098f('0x3d')]+'%'};return _0x5674be;}})});}_0xf476a4=_[_0x098f('0x3e')]({},_0xf476a4,_0x38551c['options']);var _0x24ad31={'where':_0xf476a4['where']};return db['AnalyticCustomReport'][_0x098f('0x1a')](_0x24ad31)[_0x098f('0x23')](function(_0x558f08){_0x3e47d1[_0x098f('0x1a')]=_0x558f08;if(_0x38551c[_0x098f('0x31')][_0x098f('0x40')]){_0xf476a4[_0x098f('0x41')]=[{'all':!![]}];}return db[_0x098f('0x42')]['findAll'](_0xf476a4);})[_0x098f('0x23')](function(_0x20a43b){_0x3e47d1[_0x098f('0x43')]=_0x20a43b;return _0x3e47d1;})[_0x098f('0x23')](respondWithFilteredResult(_0x2c3a5f,_0xf476a4))['catch'](handleError(_0x2c3a5f,null));};exports['show']=function(_0x1c3c8b,_0x143a44){var _0x2758f9={'raw':![],'where':{'id':_0x1c3c8b[_0x098f('0x44')]['id']}},_0x2b788d={};_0x2b788d['model']=_['keys'](db[_0x098f('0x42')]['rawAttributes']);_0x2b788d[_0x098f('0x31')]=_[_0x098f('0x30')](_0x1c3c8b['query']);_0x2b788d['filters']=_[_0x098f('0x32')](_0x2b788d['model'],_0x2b788d[_0x098f('0x31')]);_0x2758f9[_0x098f('0x33')]=_[_0x098f('0x32')](_0x2b788d['model'],qs['fields'](_0x1c3c8b[_0x098f('0x31')][_0x098f('0x34')]));_0x2758f9[_0x098f('0x33')]=_0x2758f9['attributes'][_0x098f('0x35')]?_0x2758f9[_0x098f('0x33')]:_0x2b788d[_0x098f('0x2e')];if(_0x1c3c8b[_0x098f('0x31')]['includeAll']){_0x2758f9[_0x098f('0x41')]=[{'all':!![]}];}_0x2758f9=_[_0x098f('0x3e')]({},_0x2758f9,_0x1c3c8b[_0x098f('0x45')]);return db['AnalyticCustomReport'][_0x098f('0x46')](_0x2758f9)[_0x098f('0x23')](handleEntityNotFound(_0x143a44,null))['then'](respondWithResult(_0x143a44,null))['catch'](handleError(_0x143a44,null));};exports[_0x098f('0x47')]=function(_0x1a9b97,_0x2cbfcb){return db[_0x098f('0x42')][_0x098f('0x47')](_0x1a9b97['body'],{})['then'](function(_0x1da7a3){var _0x3eecd7=_0x1a9b97['user']['get']({'plain':!![]});if(!_0x3eecd7)throw new Error(_0x098f('0x48'));if(_0x3eecd7[_0x098f('0x49')]===_0x098f('0x4a')){var _0x3ebc01=_0x1da7a3[_0x098f('0x24')]({'plain':!![]});var _0x105655=_0x098f('0x4b');return db[_0x098f('0x4c')][_0x098f('0x46')]({'where':{'name':_0x105655,'userProfileId':_0x3eecd7[_0x098f('0x4d')]},'raw':!![]})[_0x098f('0x23')](function(_0x2d8bf5){if(_0x2d8bf5&&_0x2d8bf5[_0x098f('0x4e')]===0x0){return db['UserProfileResource'][_0x098f('0x47')]({'name':_0x3ebc01[_0x098f('0x29')],'resourceId':_0x3ebc01['id'],'type':_0x098f('0x25'),'sectionId':_0x2d8bf5['id']},{})['then'](function(){return _0x1da7a3;});}else{return _0x1da7a3;}})[_0x098f('0x4f')](function(_0x3ef306){logger[_0x098f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ef306);throw _0x3ef306;});}return _0x1da7a3;})[_0x098f('0x23')](respondWithResult(_0x2cbfcb,0xc9))[_0x098f('0x4f')](handleError(_0x2cbfcb,null));};exports[_0x098f('0x22')]=function(_0x1888dc,_0x1ac930){if(_0x1888dc[_0x098f('0x50')]['id']){delete _0x1888dc[_0x098f('0x50')]['id'];}return db[_0x098f('0x42')][_0x098f('0x46')]({'where':{'id':_0x1888dc['params']['id']}})[_0x098f('0x23')](handleEntityNotFound(_0x1ac930,null))[_0x098f('0x23')](saveUpdates(_0x1888dc[_0x098f('0x50')],null))[_0x098f('0x23')](respondWithResult(_0x1ac930,null))[_0x098f('0x4f')](handleError(_0x1ac930,null));};exports['destroy']=function(_0x30833e,_0x251f49){return db[_0x098f('0x42')][_0x098f('0x46')]({'where':{'id':_0x30833e[_0x098f('0x44')]['id']}})[_0x098f('0x23')](handleEntityNotFound(_0x251f49,null))[_0x098f('0x23')](removeEntity(_0x251f49,null))[_0x098f('0x4f')](handleError(_0x251f49,null));};exports[_0x098f('0x51')]=function(_0x515c68,_0x5e905e){var _0x3dc1ac=0xa;var _0x2a40d7=['join',_0x098f('0x52'),_0x098f('0x53'),'cross_join'];var _0x53d60d={'SUM':_0x098f('0x54'),'COUNT':_0x098f('0x55'),'COUNT DISTINCT':_0x098f('0x56'),'MAX':_0x098f('0x57'),'MIN':'MIN(%s)','AVG':_0x098f('0x58'),'GROUP_CONCAT':_0x098f('0x59'),'GROUP_CONCAT ASC':_0x098f('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3512f0={'SEC_TO_TIME':_0x098f('0x5b'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x098f('0x5c')};var _0x3a91dd=function(_0x7bc1ee){return!_[_0x098f('0x5d')]([_0x098f('0x5e'),_0x098f('0x5f'),_0x098f('0x60'),_0x098f('0x61')],_0x7bc1ee);};var _0x2eb5ad=function(_0x2c8fd3){if(!_0x2c8fd3||!_0x2c8fd3[_0x098f('0x62')][_0x098f('0x35')]){return'';}for(var _0x5a3764='(',_0x49d501=0x0;_0x49d501<_0x2c8fd3[_0x098f('0x62')][_0x098f('0x35')];_0x49d501+=0x1){_0x49d501>0x0&&(_0x5a3764+='\x20'+_0x2c8fd3['operator']+'\x20');_0x5a3764+=_0x2c8fd3[_0x098f('0x62')][_0x49d501][_0x098f('0x63')]?_0x2eb5ad(_0x2c8fd3['rules'][_0x49d501][_0x098f('0x63')]):_0x2c8fd3[_0x098f('0x62')][_0x49d501][_0x098f('0x64')]+'\x20'+_0x2c8fd3[_0x098f('0x62')][_0x49d501]['condition']+(_0x3a91dd(_0x2c8fd3[_0x098f('0x62')][_0x49d501][_0x098f('0x65')])?'\x20'+_0x2c8fd3[_0x098f('0x62')][_0x49d501][_0x098f('0x66')]:'');}return _0x5a3764+')';};var _0x1e636c={'where':{'id':_0x515c68[_0x098f('0x44')]['id']}},_0x381187,_0x2dbe56,_0x2de95b,_0x2933cd,_0x2d0777;_0x1e636c=_[_0x098f('0x3e')]({},_0x1e636c,_0x515c68['options']);return db[_0x098f('0x42')][_0x098f('0x46')](_0x1e636c)[_0x098f('0x23')](function(_0xb100e6){if(_0xb100e6){_0x381187=_0xb100e6;return _0xb100e6[_0x098f('0x67')]();}return null;})['then'](function(_0x1da5d1){if(_0x1da5d1){if(!_0x1da5d1[_0x098f('0x35')]){throw new db[(_0x098f('0x68'))][(_0x098f('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2dbe56=_0x1da5d1;return db[_0x098f('0x6a')][_0x098f('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x12203c){if(_0x12203c){_0x2de95b=_[_0x098f('0x6c')](_0x12203c,'id');var _0x4de10a;var _0x1e92d1=squel[_0x098f('0x6d')]();_0x1e92d1[_0x098f('0x6e')](_0x381187['table']);for(var _0x2dd6a9=0x0;_0x2dd6a9<_0x2dbe56['length'];_0x2dd6a9+=0x1){_0x4de10a=_0x2dbe56[_0x2dd6a9][_0x098f('0x6f')]?_0x2de95b[_0x2dbe56[_0x2dd6a9][_0x098f('0x6f')]][_0x098f('0x70')]:_0x2dbe56[_0x2dd6a9][_0x098f('0x64')];_0x4de10a=_0x2dbe56[_0x2dd6a9]['function']?_[_0x098f('0x71')](_0x53d60d[_0x2dbe56[_0x2dd6a9][_0x098f('0x72')]],'%s',_0x4de10a):_0x4de10a;_0x4de10a=_0x2dbe56[_0x2dd6a9][_0x098f('0x73')]?_[_0x098f('0x71')](_0x3512f0[_0x2dbe56[_0x2dd6a9]['format']],'%s',_0x4de10a):_0x4de10a;if(_0x2dbe56[_0x2dd6a9]['groupBy']){_0x1e92d1[_0x098f('0x63')](_0x4de10a);}_0x2dbe56[_0x2dd6a9]['orderBy']&&_0x1e92d1['order'](_0x4de10a,_0x2dbe56[_0x2dd6a9][_0x098f('0x74')]===_0x098f('0x75')?![]:!![]);_0x1e92d1[_0x098f('0x64')](_0x4de10a,_0x2dbe56[_0x2dd6a9][_0x098f('0x76')]||_0x4de10a);}if(_0x381187['joins']){_0x381187['joins']=JSON[_0x098f('0x77')](_0x381187['joins']);for(var _0x282718=0x0;_0x282718<_0x381187[_0x098f('0x78')][_0x098f('0x35')];_0x282718+=0x1){if(_0x381187['joins'][_0x282718]['type']&&_[_0x098f('0x5d')](_0x2a40d7,_0x381187[_0x098f('0x78')][_0x282718][_0x098f('0x2d')])&&_0x381187[_0x098f('0x78')][_0x282718][_0x098f('0x79')]&&_0x381187[_0x098f('0x78')][_0x282718]['foreignTable']&&_0x381187[_0x098f('0x78')][_0x282718][_0x098f('0x7a')]){_0x1e92d1[_0x381187[_0x098f('0x78')][_0x282718]['type']](_0x381187['joins'][_0x282718][_0x098f('0x7b')],null,util['format'](_0x098f('0x7c'),_0x381187[_0x098f('0x7d')],_0x381187['joins'][_0x282718][_0x098f('0x79')],_0x381187[_0x098f('0x78')][_0x282718]['foreignTable'],_0x381187[_0x098f('0x78')][_0x282718][_0x098f('0x7a')]));}}}if(_0x381187[_0x098f('0x7e')]){_0x381187[_0x098f('0x7e')]=JSON['parse'](_0x381187[_0x098f('0x7e')]);_0x1e92d1[_0x098f('0x3a')](_0x2eb5ad(_0x381187['conditions'][_0x098f('0x63')]));}_0x2d0777=_0x1e92d1[_0x098f('0x7f')]();_0x1e92d1['limit'](_0x3dc1ac);_0x1e92d1[_0x098f('0x1b')](0x0);logger['debug'](_0x098f('0x80'),_0x1e92d1[_0x098f('0x81')]());return dbH['sequelize']['query'](_0x1e92d1[_0x098f('0x81')](),{'type':dbH[_0x098f('0x82')][_0x098f('0x83')][_0x098f('0x84')]});}})['then'](respondWithResult(_0x5e905e,null))[_0x098f('0x4f')](handleError(_0x5e905e,null));};function runReport(_0x27ba25,_0x48e8e8,_0x337e99){var _0x4cef5f=_0x48e8e8[_0x098f('0x29')];var _0x595c83=0xa;var _0x2c1e5c=[_0x098f('0x85'),_0x098f('0x52'),_0x098f('0x53'),'cross_join'];var _0x53857e={'SUM':'SUM(%s)','COUNT':_0x098f('0x55'),'COUNT DISTINCT':_0x098f('0x56'),'MAX':_0x098f('0x57'),'MIN':_0x098f('0x86'),'AVG':_0x098f('0x58'),'GROUP_CONCAT':_0x098f('0x59'),'GROUP_CONCAT ASC':_0x098f('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2a156d={'SEC_TO_TIME':_0x098f('0x5b'),'DATE':_0x098f('0x87'),'HOUR':_0x098f('0x88'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x098f('0x5c')};var _0x248e68=function(_0x3e67aa){return!_[_0x098f('0x5d')]([_0x098f('0x5e'),_0x098f('0x5f'),_0x098f('0x60'),_0x098f('0x61')],_0x3e67aa);};var _0x169e45=function(_0x348383){if(!_0x348383||!_0x348383['rules']['length']){return'';}for(var _0x44c755='(',_0x53aafe=0x0;_0x53aafe<_0x348383[_0x098f('0x62')][_0x098f('0x35')];_0x53aafe+=0x1){_0x53aafe>0x0&&(_0x44c755+='\x20'+_0x348383['operator']+'\x20');_0x44c755+=_0x348383[_0x098f('0x62')][_0x53aafe][_0x098f('0x63')]?_0x169e45(_0x348383['rules'][_0x53aafe][_0x098f('0x63')]):_0x348383['rules'][_0x53aafe]['field']+'\x20'+_0x348383['rules'][_0x53aafe]['condition']+(_0x248e68(_0x348383[_0x098f('0x62')][_0x53aafe][_0x098f('0x65')])?'\x20'+_0x348383[_0x098f('0x62')][_0x53aafe][_0x098f('0x66')]:'');}return _0x44c755+')';};var _0x3ec2d8={'where':{'id':_0x27ba25['id']}},_0x5a8b87,_0x9a0f1b,_0x5ee13f,_0x301ead,_0x3a652a;_0x3ec2d8=_[_0x098f('0x3e')]({},_0x3ec2d8,_0x337e99);return db[_0x098f('0x42')][_0x098f('0x46')](_0x3ec2d8)[_0x098f('0x23')](function(_0x5e8adc){if(_0x5e8adc){_0x5a8b87=_0x5e8adc;return _0x5e8adc[_0x098f('0x67')]();}return null;})['then'](function(_0x106cb2){if(_0x106cb2){if(!_0x106cb2[_0x098f('0x35')]){throw new db[(_0x098f('0x68'))][(_0x098f('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x9a0f1b=_0x106cb2;return db[_0x098f('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x098f('0x23')](function(_0xe389b2){if(_0xe389b2){_0x5ee13f=_[_0x098f('0x6c')](_0xe389b2,'id');var _0x4ec21e;var _0x494c72=squel[_0x098f('0x6d')]();_0x494c72[_0x098f('0x6e')](_0x5a8b87[_0x098f('0x7d')]);for(var _0x29f159=0x0;_0x29f159<_0x9a0f1b[_0x098f('0x35')];_0x29f159+=0x1){_0x4ec21e=_0x9a0f1b[_0x29f159][_0x098f('0x6f')]?_0x5ee13f[_0x9a0f1b[_0x29f159][_0x098f('0x6f')]][_0x098f('0x70')]:_0x9a0f1b[_0x29f159][_0x098f('0x64')];_0x4ec21e=_0x9a0f1b[_0x29f159][_0x098f('0x72')]?_['replace'](_0x53857e[_0x9a0f1b[_0x29f159]['function']],'%s',_0x4ec21e):_0x4ec21e;_0x4ec21e=_0x9a0f1b[_0x29f159][_0x098f('0x73')]?_['replace'](_0x2a156d[_0x9a0f1b[_0x29f159][_0x098f('0x73')]],'%s',_0x4ec21e):_0x4ec21e;if(_0x9a0f1b[_0x29f159]['groupBy']){_0x494c72[_0x098f('0x63')](_0x4ec21e);}_0x9a0f1b[_0x29f159][_0x098f('0x74')]&&_0x494c72[_0x098f('0x38')](_0x4ec21e,_0x9a0f1b[_0x29f159]['orderBy']===_0x098f('0x75')?![]:!![]);_0x494c72[_0x098f('0x64')](_0x4ec21e,_0x9a0f1b[_0x29f159][_0x098f('0x76')]||_0x4ec21e);}if(_0x5a8b87['joins']){_0x5a8b87['joins']=JSON[_0x098f('0x77')](_0x5a8b87['joins']);for(var _0x62d567=0x0;_0x62d567<_0x5a8b87[_0x098f('0x78')]['length'];_0x62d567+=0x1){if(_0x5a8b87[_0x098f('0x78')][_0x62d567][_0x098f('0x2d')]&&_[_0x098f('0x5d')](_0x2c1e5c,_0x5a8b87[_0x098f('0x78')][_0x62d567]['type'])&&_0x5a8b87[_0x098f('0x78')][_0x62d567]['parentKey']&&_0x5a8b87['joins'][_0x62d567][_0x098f('0x7b')]&&_0x5a8b87[_0x098f('0x78')][_0x62d567]['foreignKey']){_0x494c72[_0x5a8b87[_0x098f('0x78')][_0x62d567][_0x098f('0x2d')]](_0x5a8b87[_0x098f('0x78')][_0x62d567][_0x098f('0x7b')],null,util[_0x098f('0x73')](_0x098f('0x7c'),_0x5a8b87[_0x098f('0x7d')],_0x5a8b87['joins'][_0x62d567][_0x098f('0x79')],_0x5a8b87['joins'][_0x62d567][_0x098f('0x7b')],_0x5a8b87[_0x098f('0x78')][_0x62d567][_0x098f('0x7a')]));}}}if(_0x5a8b87['conditions']){_0x5a8b87[_0x098f('0x7e')]=JSON['parse'](_0x5a8b87['conditions']);_0x494c72['where'](_0x169e45(_0x5a8b87['conditions']['group']));}_0x3a652a=_0x494c72[_0x098f('0x7f')]();_0x494c72[_0x098f('0x19')](_0x595c83);_0x494c72['offset'](0x0);return;}})[_0x098f('0x23')](function(){if(_0x48e8e8[_0x098f('0x89')]==='web'){return null;}var _0x17eb31=_['merge'](_0x48e8e8,{'name':_0x48e8e8[_0x098f('0x8a')]||_0x48e8e8['name']||_0x5a8b87[_0x098f('0x29')],'basename':_0x4cef5f,'savename':util[_0x098f('0x73')](_0x098f('0x8b'),_0x48e8e8[_0x098f('0x29')]||_0x5a8b87[_0x098f('0x29')],require(_0x098f('0x8c'))[_0x098f('0x8d')](0x4),_0x48e8e8[_0x098f('0x89')]||_0x098f('0x8e')),'reportId':_0x5a8b87['id'],'reportType':'custom'});return db[_0x098f('0x8f')][_0x098f('0x47')](_0x17eb31,{'raw':!![]});})['then'](function(_0x110269){if(_0x5a8b87[_0x098f('0x7d')]===_0x098f('0x90')){_0x3a652a[_0x098f('0x3a')](_0x5a8b87['table']+_0x098f('0x91'),_0x48e8e8[_0x098f('0x92')],_0x48e8e8[_0x098f('0x93')]);}else{_0x3a652a[_0x098f('0x3a')](_0x5a8b87[_0x098f('0x7d')]+_0x098f('0x94'),_0x48e8e8[_0x098f('0x92')],_0x48e8e8[_0x098f('0x93')]);}if(_0x110269){logger[_0x098f('0x95')]('Run\x20Query:',_0x3a652a[_0x098f('0x81')]());require(_0x098f('0x96'))[_0x098f('0x97')](path[_0x098f('0x85')](__dirname,_0x098f('0x98'),_0x110269[_0x098f('0x89')]),[_0x110269['id'],_0x3a652a[_0x098f('0x81')](),path['join'](__dirname,'../../files/reports',_0x110269['savename']),_0x4cef5f]);return _0x110269;}else{var _0x573bc7=squel['select']();_0x573bc7['from']('('+_0x3a652a[_0x098f('0x81')]()+')',_0x098f('0x99'));_0x573bc7[_0x098f('0x64')](_0x098f('0x9a'),_0x098f('0x1a'));_0x3a652a['limit'](_0x48e8e8[_0x098f('0x19')]||_0x595c83);_0x3a652a[_0x098f('0x1b')](_0x48e8e8[_0x098f('0x1b')]||0x0);return dbH[_0x098f('0x82')]['query'](_0x573bc7[_0x098f('0x81')](),{'type':dbH['sequelize'][_0x098f('0x83')][_0x098f('0x84')]})[_0x098f('0x23')](function(_0x353d3b){if(!_0x353d3b[_0x098f('0x35')]){_0x301ead=0x0;}else{_0x301ead=_0x353d3b[0x0][_0x098f('0x1a')]||0x0;}return dbH[_0x098f('0x82')][_0x098f('0x31')](_0x3a652a[_0x098f('0x81')](),{'type':dbH[_0x098f('0x82')][_0x098f('0x83')][_0x098f('0x84')]});})[_0x098f('0x23')](function(_0x10d68f){return{'rows':_0x10d68f||[],'count':_0x301ead};});}});}exports['run']=function(_0xee08ac,_0x42596d){return runReport(_0xee08ac['params'],_0xee08ac['query'],_0xee08ac[_0x098f('0x45')])['then'](respondWithResult(_0x42596d,null))[_0x098f('0x4f')](handleError(_0x42596d,null));};exports[_0x098f('0x9b')]=runReport;exports[_0x098f('0x31')]=function(_0xa271d3,_0x54f395){var _0x43f05d=0xa;var _0x289b74=[_0x098f('0x85'),_0x098f('0x52'),'right_join',_0x098f('0x9c')];var _0x58e52d={'SUM':_0x098f('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x098f('0x56'),'MAX':_0x098f('0x57'),'MIN':_0x098f('0x86'),'AVG':_0x098f('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x098f('0x5a'),'GROUP_CONCAT DESC':_0x098f('0x9d')};var _0xb2de15={'SEC_TO_TIME':_0x098f('0x5b'),'DATE':_0x098f('0x87'),'HOUR':'HOUR(%s)','ROUND':_0x098f('0x9e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5c12fc=function(_0x5a97b5){return!_[_0x098f('0x5d')]([_0x098f('0x5e'),'IS\x20NOT\x20NULL',_0x098f('0x60'),_0x098f('0x61')],_0x5a97b5);};var _0x5aa4ee=function(_0xe14488){if(!_0xe14488||!_0xe14488[_0x098f('0x62')][_0x098f('0x35')]){return'';}for(var _0x4aeda8='(',_0x2b37a8=0x0;_0x2b37a8<_0xe14488['rules'][_0x098f('0x35')];_0x2b37a8+=0x1){_0x2b37a8>0x0&&(_0x4aeda8+='\x20'+_0xe14488[_0x098f('0x9f')]+'\x20');_0x4aeda8+=_0xe14488['rules'][_0x2b37a8]['group']?_0x5aa4ee(_0xe14488[_0x098f('0x62')][_0x2b37a8][_0x098f('0x63')]):_0xe14488[_0x098f('0x62')][_0x2b37a8]['field']+'\x20'+_0xe14488[_0x098f('0x62')][_0x2b37a8][_0x098f('0x65')]+(_0x5c12fc(_0xe14488[_0x098f('0x62')][_0x2b37a8][_0x098f('0x65')])?'\x20'+_0xe14488[_0x098f('0x62')][_0x2b37a8]['value']:'');}return _0x4aeda8+')';};var _0x3602e4={'where':{'id':_0xa271d3['params']['id']}},_0x19107d,_0x148e1c,_0x5ea9b2,_0x1a2e28,_0x3c386e;_0x3602e4=_[_0x098f('0x3e')]({},_0x3602e4,_0xa271d3['options']);return db[_0x098f('0x42')][_0x098f('0x46')](_0x3602e4)[_0x098f('0x23')](function(_0xe2bdd5){if(_0xe2bdd5){_0x19107d=_0xe2bdd5;return _0xe2bdd5['getFields']();}return null;})[_0x098f('0x23')](function(_0x174e9e){if(_0x174e9e){if(!_0x174e9e['length']){throw new db[(_0x098f('0x68'))][(_0x098f('0x69'))](_0x098f('0xa0'),0x193);}_0x148e1c=_0x174e9e;return db[_0x098f('0x6a')][_0x098f('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x1f963d){if(_0x1f963d){_0x5ea9b2=_[_0x098f('0x6c')](_0x1f963d,'id');var _0x185e2b;var _0x3c419a=squel['select']();_0x3c419a[_0x098f('0x6e')](_0x19107d['table']);for(var _0x52dc6a=0x0;_0x52dc6a<_0x148e1c[_0x098f('0x35')];_0x52dc6a+=0x1){_0x185e2b=_0x148e1c[_0x52dc6a][_0x098f('0x6f')]?_0x5ea9b2[_0x148e1c[_0x52dc6a][_0x098f('0x6f')]][_0x098f('0x70')]:_0x148e1c[_0x52dc6a][_0x098f('0x64')];_0x185e2b=_0x148e1c[_0x52dc6a][_0x098f('0x72')]?_['replace'](_0x58e52d[_0x148e1c[_0x52dc6a][_0x098f('0x72')]],'%s',_0x185e2b):_0x185e2b;_0x185e2b=_0x148e1c[_0x52dc6a][_0x098f('0x73')]?_[_0x098f('0x71')](_0xb2de15[_0x148e1c[_0x52dc6a][_0x098f('0x73')]],'%s',_0x185e2b):_0x185e2b;if(_0x148e1c[_0x52dc6a][_0x098f('0xa1')]){_0x3c419a[_0x098f('0x63')](_0x185e2b);}_0x148e1c[_0x52dc6a][_0x098f('0x74')]&&_0x3c419a[_0x098f('0x38')](_0x185e2b,_0x148e1c[_0x52dc6a][_0x098f('0x74')]===_0x098f('0x75')?![]:!![]);_0x3c419a[_0x098f('0x64')](_0x185e2b,_0x148e1c[_0x52dc6a][_0x098f('0x76')]||_0x185e2b);}if(_0x19107d[_0x098f('0x78')]){_0x19107d['joins']=JSON[_0x098f('0x77')](_0x19107d[_0x098f('0x78')]);for(var _0x5154fe=0x0;_0x5154fe<_0x19107d[_0x098f('0x78')]['length'];_0x5154fe+=0x1){if(_0x19107d[_0x098f('0x78')][_0x5154fe][_0x098f('0x2d')]&&_[_0x098f('0x5d')](_0x289b74,_0x19107d[_0x098f('0x78')][_0x5154fe]['type'])&&_0x19107d[_0x098f('0x78')][_0x5154fe]['parentKey']&&_0x19107d[_0x098f('0x78')][_0x5154fe]['foreignTable']&&_0x19107d[_0x098f('0x78')][_0x5154fe][_0x098f('0x7a')]){_0x3c419a[_0x19107d['joins'][_0x5154fe]['type']](_0x19107d[_0x098f('0x78')][_0x5154fe][_0x098f('0x7b')],null,util[_0x098f('0x73')](_0x098f('0x7c'),_0x19107d[_0x098f('0x7d')],_0x19107d[_0x098f('0x78')][_0x5154fe][_0x098f('0x79')],_0x19107d[_0x098f('0x78')][_0x5154fe][_0x098f('0x7b')],_0x19107d[_0x098f('0x78')][_0x5154fe][_0x098f('0x7a')]));}}}if(_0x19107d[_0x098f('0x7e')]){_0x19107d['conditions']=JSON[_0x098f('0x77')](_0x19107d['conditions']);_0x3c419a[_0x098f('0x3a')](_0x5aa4ee(_0x19107d['conditions'][_0x098f('0x63')]));}_0x3c386e=_0x3c419a[_0x098f('0x7f')]();_0x3c419a[_0x098f('0x19')](_0x43f05d);_0x3c419a[_0x098f('0x1b')](0x0);logger[_0x098f('0xa2')](_0x098f('0x80'),_0x3c419a[_0x098f('0x81')]());return dbH[_0x098f('0x82')][_0x098f('0x31')](_0x3c419a[_0x098f('0x81')](),{'type':dbH[_0x098f('0x82')][_0x098f('0x83')]['SELECT']});}})['then'](function(){return{'sql':_0x3c386e[_0x098f('0x81')]()};})[_0x098f('0x23')](respondWithResult(_0x54f395,null))[_0x098f('0x4f')](handleError(_0x54f395,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 73ab72f..e321b15 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 _0x92a3=['../../config/logger','moment','bluebird','rimraf','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util'];(function(_0x3ff1ac,_0xd050bc){var _0x45dd93=function(_0x4d03c0){while(--_0x4d03c0){_0x3ff1ac['push'](_0x3ff1ac['shift']());}};_0x45dd93(++_0xd050bc);}(_0x92a3,0x120));var _0x392a=function(_0x2fe959,_0x351d77){_0x2fe959=_0x2fe959-0x0;var _0x2f6ace=_0x92a3[_0x2fe959];return _0x2f6ace;};'use strict';var _=require(_0x392a('0x0'));var util=require(_0x392a('0x1'));var logger=require(_0x392a('0x2'))('api');var moment=require(_0x392a('0x3'));var BPromise=require(_0x392a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x392a('0x5'));var config=require('../../config/environment');var attributes=require(_0x392a('0x6'));module[_0x392a('0x7')]=function(_0x5e6304,_0x18f678){return _0x5e6304[_0x392a('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x392a('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf48f=['bluebird','rimraf','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','api','moment'];(function(_0x3cba3,_0x63a5ca){var _0x23ed82=function(_0x3dc674){while(--_0x3dc674){_0x3cba3['push'](_0x3cba3['shift']());}};_0x23ed82(++_0x63a5ca);}(_0xf48f,0xb1));var _0xff48=function(_0x4eb4c8,_0x4fa385){_0x4eb4c8=_0x4eb4c8-0x0;var _0x48a424=_0xf48f[_0x4eb4c8];return _0x48a424;};'use strict';var _=require(_0xff48('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xff48('0x1'));var moment=require(_0xff48('0x2'));var BPromise=require(_0xff48('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xff48('0x4'));var config=require('../../config/environment');var attributes=require(_0xff48('0x5'));module[_0xff48('0x6')]=function(_0x6e2c27,_0x477ecb){return _0x6e2c27[_0xff48('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0xff48('0x8'),'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 ffda135..6ec3b69 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 _0xc20a=['client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x25be63,_0x4b335e){var _0x4daaa8=function(_0x4b7f37){while(--_0x4b7f37){_0x25be63['push'](_0x25be63['shift']());}};_0x4daaa8(++_0x4b335e);}(_0xc20a,0xb6));var _0xac20=function(_0x1dd630,_0x164609){_0x1dd630=_0x1dd630-0x0;var _0x595feb=_0xc20a[_0x1dd630];return _0x595feb;};'use strict';var _=require(_0xac20('0x0'));var util=require(_0xac20('0x1'));var moment=require(_0xac20('0x2'));var BPromise=require(_0xac20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac20('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xac20('0x5'))(_0xac20('0x6'));var config=require('../../config/environment');var jayson=require(_0xac20('0x7'));var client=jayson[_0xac20('0x8')][_0xac20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x569566,_0x1d61c2,_0x48fce9){return new BPromise(function(_0x411def,_0x1912b9){return client[_0xac20('0xa')](_0x569566,_0x48fce9)[_0xac20('0xb')](function(_0x596aab){logger[_0xac20('0xc')](_0xac20('0xd'),_0x1d61c2,_0xac20('0xe'));logger[_0xac20('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1d61c2,_0xac20('0xe'),JSON['stringify'](_0x596aab));if(_0x596aab['error']){if(_0x596aab['error']['code']===0x1f4){logger[_0xac20('0x10')](_0xac20('0xd'),_0x1d61c2,_0x596aab['error']['message']);return _0x1912b9(_0x596aab[_0xac20('0x10')][_0xac20('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1d61c2,_0x596aab[_0xac20('0x10')][_0xac20('0x11')]);return _0x411def(_0x596aab[_0xac20('0x10')][_0xac20('0x11')]);}else{logger[_0xac20('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1d61c2,_0xac20('0xe'));_0x411def(_0x596aab['result'][_0xac20('0x11')]);}})[_0xac20('0x12')](function(_0x4dbe60){logger[_0xac20('0x10')](_0xac20('0xd'),_0x1d61c2,_0x4dbe60);_0x1912b9(_0x4dbe60);});});}
\ No newline at end of file
+var _0x4648=['then','info','debug','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x4648,0x6e));var _0x8464=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4648[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x8464('0x0'));var util=require(_0x8464('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8464('0x2'));var fs=require('fs');var Redis=require(_0x8464('0x3'));var db=require(_0x8464('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8464('0x5'));var config=require(_0x8464('0x6'));var jayson=require(_0x8464('0x7'));var client=jayson[_0x8464('0x8')][_0x8464('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35d976,_0x1dce4a,_0x4763ec){return new BPromise(function(_0x1f3830,_0x3d9f0f){return client['request'](_0x35d976,_0x4763ec)[_0x8464('0xa')](function(_0x57ec3d){logger[_0x8464('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1dce4a,'request\x20sent');logger[_0x8464('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1dce4a,_0x8464('0xd'),JSON[_0x8464('0xe')](_0x57ec3d));if(_0x57ec3d['error']){if(_0x57ec3d[_0x8464('0xf')][_0x8464('0x10')]===0x1f4){logger[_0x8464('0xf')](_0x8464('0x11'),_0x1dce4a,_0x57ec3d[_0x8464('0xf')][_0x8464('0x12')]);return _0x3d9f0f(_0x57ec3d[_0x8464('0xf')][_0x8464('0x12')]);}logger[_0x8464('0xf')](_0x8464('0x11'),_0x1dce4a,_0x57ec3d[_0x8464('0xf')]['message']);return _0x1f3830(_0x57ec3d[_0x8464('0xf')][_0x8464('0x12')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x1dce4a,'request\x20sent');_0x1f3830(_0x57ec3d[_0x8464('0x13')][_0x8464('0x12')]);}})['catch'](function(_0x4ad121){logger['error'](_0x8464('0x11'),_0x1dce4a,_0x4ad121);_0x3d9f0f(_0x4ad121);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 3d592ee..0629485 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 _0x904c=['index','get','/:id','show','/:id/preview','run','/:id/query','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated'];(function(_0xb39f22,_0x41eb24){var _0x4455ff=function(_0x8e182c){while(--_0x8e182c){_0xb39f22['push'](_0xb39f22['shift']());}};_0x4455ff(++_0x41eb24);}(_0x904c,0x1d9));var _0xc904=function(_0x4a85e1,_0x14f9c1){_0x4a85e1=_0x4a85e1-0x0;var _0x4300b7=_0x904c[_0x4a85e1];return _0x4300b7;};'use strict';var multer=require(_0xc904('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc904('0x1'));var express=require(_0xc904('0x2'));var router=express[_0xc904('0x3')]();var fs_extra=require(_0xc904('0x4'));var auth=require(_0xc904('0x5'));var interaction=require(_0xc904('0x6'));var config=require(_0xc904('0x7'));var controller=require(_0xc904('0x8'));router['get']('/',auth[_0xc904('0x9')](),controller[_0xc904('0xa')]);router[_0xc904('0xb')](_0xc904('0xc'),auth['isAuthenticated'](),controller[_0xc904('0xd')]);router[_0xc904('0xb')](_0xc904('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0xc904('0xb')]('/:id/run',auth[_0xc904('0x9')](),controller[_0xc904('0xf')]);router[_0xc904('0xb')](_0xc904('0x10'),auth[_0xc904('0x9')](),controller['query']);router['post']('/',auth[_0xc904('0x9')](),controller[_0xc904('0x11')]);router[_0xc904('0x12')]('/:id',auth[_0xc904('0x9')](),controller[_0xc904('0x13')]);router[_0xc904('0x14')](_0xc904('0xc'),auth[_0xc904('0x9')](),controller[_0xc904('0x15')]);module[_0xc904('0x16')]=router;
\ No newline at end of file
+var _0xb5f3=['/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4fb5fc,_0x8f539b){var _0xfb187=function(_0x2d9e45){while(--_0x2d9e45){_0x4fb5fc['push'](_0x4fb5fc['shift']());}};_0xfb187(++_0x8f539b);}(_0xb5f3,0x1c3));var _0x3b5f=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0xb5f3[_0x439d59];return _0x3670c7;};'use strict';var multer=require(_0x3b5f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3b5f('0x1'));var express=require(_0x3b5f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3b5f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3b5f('0x4'));var controller=require(_0x3b5f('0x5'));router[_0x3b5f('0x6')]('/',auth[_0x3b5f('0x7')](),controller[_0x3b5f('0x8')]);router[_0x3b5f('0x6')](_0x3b5f('0x9'),auth[_0x3b5f('0x7')](),controller[_0x3b5f('0xa')]);router['get']('/:id/preview',auth[_0x3b5f('0x7')](),controller['preview']);router[_0x3b5f('0x6')](_0x3b5f('0xb'),auth[_0x3b5f('0x7')](),controller[_0x3b5f('0xc')]);router[_0x3b5f('0x6')](_0x3b5f('0xd'),auth[_0x3b5f('0x7')](),controller[_0x3b5f('0xe')]);router[_0x3b5f('0xf')]('/',auth['isAuthenticated'](),controller[_0x3b5f('0x10')]);router[_0x3b5f('0x11')](_0x3b5f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x3b5f('0x12')](_0x3b5f('0x9'),auth[_0x3b5f('0x7')](),controller[_0x3b5f('0x13')]);module[_0x3b5f('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 225d1b6..2fb9547 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x5cd42a,_0x21a323){var _0x34a0ef=function(_0x22b943){while(--_0x22b943){_0x5cd42a['push'](_0x5cd42a['shift']());}};_0x34a0ef(++_0x21a323);}(_0x6f47,0xc7));var _0x76f4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6f47[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x274854,_0x545b06){var _0x150a58=function(_0x238f4a){while(--_0x238f4a){_0x274854['push'](_0x274854['shift']());}};_0x150a58(++_0x545b06);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x14f751,_0x418f90){_0x14f751=_0x14f751-0x0;var _0x320d37=_0x3f8a[_0x14f751];return _0x320d37;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index de8166f..f54a5d0 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 _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2ef3,0xba));var _0x32ef=function(_0x5b72a0,_0x4796d3){_0x5b72a0=_0x5b72a0-0x0;var _0x514edd=_0x2ef3[_0x5b72a0];return _0x514edd;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
+var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x231857,_0x1ca50c){_0x231857=_0x231857-0x0;var _0x3ec87e=_0xc6ac[_0x231857];return _0x3ec87e;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index c10fe88..aebb6be 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 _0x98f9=['../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x98f9,0x89));var _0x998f=function(_0x22b36e,_0x3dbd6b){_0x22b36e=_0x22b36e-0x0;var _0x6495e0=_0x98f9[_0x22b36e];return _0x6495e0;};'use strict';var _=require(_0x998f('0x0'));var util=require(_0x998f('0x1'));var logger=require(_0x998f('0x2'))(_0x998f('0x3'));var moment=require('moment');var BPromise=require(_0x998f('0x4'));var rp=require(_0x998f('0x5'));var fs=require('fs');var path=require(_0x998f('0x6'));var rimraf=require('rimraf');var config=require(_0x998f('0x7'));var attributes=require(_0x998f('0x8'));module[_0x998f('0x9')]=function(_0xcde580,_0x5bd2af){return _0xcde580[_0x998f('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x998f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69ca=['AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x69ca,0x91));var _0xa69c=function(_0x5a2db8,_0x409f2a){_0x5a2db8=_0x5a2db8-0x0;var _0x28b4f8=_0x69ca[_0x5a2db8];return _0x28b4f8;};'use strict';var _=require(_0xa69c('0x0'));var util=require(_0xa69c('0x1'));var logger=require(_0xa69c('0x2'))(_0xa69c('0x3'));var moment=require(_0xa69c('0x4'));var BPromise=require(_0xa69c('0x5'));var rp=require(_0xa69c('0x6'));var fs=require('fs');var path=require(_0xa69c('0x7'));var rimraf=require(_0xa69c('0x8'));var config=require(_0xa69c('0x9'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x25adce,_0x3d3c57){return _0x25adce[_0xa69c('0xa')](_0xa69c('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index c6e089a..ceacbd8 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 _0x0e77=['client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf36aa6,_0x302470){var _0x28c4d3=function(_0x5358a0){while(--_0x5358a0){_0xf36aa6['push'](_0xf36aa6['shift']());}};_0x28c4d3(++_0x302470);}(_0x0e77,0x1af));var _0x70e7=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0e77[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0x70e7('0x0'));var moment=require(_0x70e7('0x1'));var BPromise=require(_0x70e7('0x2'));var rs=require(_0x70e7('0x3'));var fs=require('fs');var Redis=require(_0x70e7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x70e7('0x5'));var logger=require(_0x70e7('0x6'))(_0x70e7('0x7'));var config=require(_0x70e7('0x8'));var jayson=require(_0x70e7('0x9'));var client=jayson[_0x70e7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d36cf,_0x70ee9f,_0x24f599){return new BPromise(function(_0x1483b6,_0x2a32f5){return client[_0x70e7('0xb')](_0x3d36cf,_0x24f599)['then'](function(_0x4c6c9c){logger[_0x70e7('0xc')](_0x70e7('0xd'),_0x70ee9f,_0x70e7('0xe'));logger[_0x70e7('0xf')](_0x70e7('0x10'),_0x70ee9f,'request\x20sent',JSON[_0x70e7('0x11')](_0x4c6c9c));if(_0x4c6c9c[_0x70e7('0x12')]){if(_0x4c6c9c[_0x70e7('0x12')]['code']===0x1f4){logger['error'](_0x70e7('0xd'),_0x70ee9f,_0x4c6c9c[_0x70e7('0x12')][_0x70e7('0x13')]);return _0x2a32f5(_0x4c6c9c[_0x70e7('0x12')][_0x70e7('0x13')]);}logger[_0x70e7('0x12')](_0x70e7('0xd'),_0x70ee9f,_0x4c6c9c[_0x70e7('0x12')][_0x70e7('0x13')]);return _0x1483b6(_0x4c6c9c[_0x70e7('0x12')][_0x70e7('0x13')]);}else{logger[_0x70e7('0xc')](_0x70e7('0xd'),_0x70ee9f,'request\x20sent');_0x1483b6(_0x4c6c9c[_0x70e7('0x14')][_0x70e7('0x13')]);}})['catch'](function(_0x3d3cd7){logger['error'](_0x70e7('0xd'),_0x70ee9f,_0x3d3cd7);_0x2a32f5(_0x3d3cd7);});});}
\ No newline at end of file
+var _0x6ff3=['code','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b6b89,_0x172ec0){var _0x5aa6af=function(_0x19cd5e){while(--_0x19cd5e){_0x2b6b89['push'](_0x2b6b89['shift']());}};_0x5aa6af(++_0x172ec0);}(_0x6ff3,0x1e1));var _0x36ff=function(_0x56ec4b,_0x110a5a){_0x56ec4b=_0x56ec4b-0x0;var _0x45ea8c=_0x6ff3[_0x56ec4b];return _0x45ea8c;};'use strict';var _=require(_0x36ff('0x0'));var util=require('util');var moment=require(_0x36ff('0x1'));var BPromise=require(_0x36ff('0x2'));var rs=require(_0x36ff('0x3'));var fs=require('fs');var Redis=require(_0x36ff('0x4'));var db=require(_0x36ff('0x5'))['db'];var utils=require(_0x36ff('0x6'));var logger=require(_0x36ff('0x7'))(_0x36ff('0x8'));var config=require('../../config/environment');var jayson=require(_0x36ff('0x9'));var client=jayson[_0x36ff('0xa')][_0x36ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x450b08,_0x494f12,_0x573c90){return new BPromise(function(_0x4a76ff,_0x393911){return client[_0x36ff('0xc')](_0x450b08,_0x573c90)[_0x36ff('0xd')](function(_0x5e1380){logger['info'](_0x36ff('0xe'),_0x494f12,_0x36ff('0xf'));logger[_0x36ff('0x10')](_0x36ff('0x11'),_0x494f12,_0x36ff('0xf'),JSON[_0x36ff('0x12')](_0x5e1380));if(_0x5e1380['error']){if(_0x5e1380['error'][_0x36ff('0x13')]===0x1f4){logger[_0x36ff('0x14')](_0x36ff('0xe'),_0x494f12,_0x5e1380['error'][_0x36ff('0x15')]);return _0x393911(_0x5e1380[_0x36ff('0x14')][_0x36ff('0x15')]);}logger[_0x36ff('0x14')](_0x36ff('0xe'),_0x494f12,_0x5e1380[_0x36ff('0x14')][_0x36ff('0x15')]);return _0x4a76ff(_0x5e1380[_0x36ff('0x14')][_0x36ff('0x15')]);}else{logger[_0x36ff('0x16')](_0x36ff('0xe'),_0x494f12,_0x36ff('0xf'));_0x4a76ff(_0x5e1380[_0x36ff('0x17')]['message']);}})[_0x36ff('0x18')](function(_0x5beec6){logger[_0x36ff('0x14')](_0x36ff('0xe'),_0x494f12,_0x5beec6);_0x393911(_0x5beec6);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 5106dbc..25a71b5 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 _0x4d75=['/:id/query','query','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','index','get','/:id','/:id/preview','isAuthenticated','preview','/:id/run','run'];(function(_0x5659f8,_0x6a299d){var _0x2dc495=function(_0x568307){while(--_0x568307){_0x5659f8['push'](_0x5659f8['shift']());}};_0x2dc495(++_0x6a299d);}(_0x4d75,0x178));var _0x54d7=function(_0x3c28dd,_0x4b2df6){_0x3c28dd=_0x3c28dd-0x0;var _0x55311d=_0x4d75[_0x3c28dd];return _0x55311d;};'use strict';var multer=require(_0x54d7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x54d7('0x1'));var express=require(_0x54d7('0x2'));var router=express[_0x54d7('0x3')]();var fs_extra=require(_0x54d7('0x4'));var auth=require(_0x54d7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x54d7('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x54d7('0x7')]);router[_0x54d7('0x8')](_0x54d7('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x54d7('0x8')](_0x54d7('0xa'),auth[_0x54d7('0xb')](),controller[_0x54d7('0xc')]);router[_0x54d7('0x8')](_0x54d7('0xd'),auth[_0x54d7('0xb')](),controller[_0x54d7('0xe')]);router['get'](_0x54d7('0xf'),auth[_0x54d7('0xb')](),controller[_0x54d7('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x54d7('0x11')]);router[_0x54d7('0x12')](_0x54d7('0x9'),auth[_0x54d7('0xb')](),controller[_0x54d7('0x13')]);router[_0x54d7('0x14')](_0x54d7('0x9'),auth[_0x54d7('0xb')](),controller[_0x54d7('0x15')]);module[_0x54d7('0x16')]=router;
\ No newline at end of file
+var _0x06ae=['isAuthenticated','show','/:id/preview','/:id/query','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id'];(function(_0xcbc5bd,_0x6e7646){var _0x5b23c0=function(_0x13ab6d){while(--_0x13ab6d){_0xcbc5bd['push'](_0xcbc5bd['shift']());}};_0x5b23c0(++_0x6e7646);}(_0x06ae,0x16e));var _0xe06a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x06ae[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xe06a('0x0'));var path=require(_0xe06a('0x1'));var timeout=require(_0xe06a('0x2'));var express=require(_0xe06a('0x3'));var router=express[_0xe06a('0x4')]();var fs_extra=require(_0xe06a('0x5'));var auth=require(_0xe06a('0x6'));var interaction=require(_0xe06a('0x7'));var config=require(_0xe06a('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe06a('0x9')]);router[_0xe06a('0xa')](_0xe06a('0xb'),auth[_0xe06a('0xc')](),controller[_0xe06a('0xd')]);router['get'](_0xe06a('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0xe06a('0xa')]('/:id/run',auth[_0xe06a('0xc')](),controller['run']);router['get'](_0xe06a('0xf'),auth[_0xe06a('0xc')](),controller['query']);router[_0xe06a('0x10')]('/',auth[_0xe06a('0xc')](),controller['create']);router[_0xe06a('0x11')](_0xe06a('0xb'),auth[_0xe06a('0xc')](),controller['update']);router[_0xe06a('0x12')](_0xe06a('0xb'),auth[_0xe06a('0xc')](),controller[_0xe06a('0x13')]);module[_0xe06a('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index e040df7..9dbe68e 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 _0xedf9=['csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','moment','exports','STRING'];(function(_0x24d41e,_0x503591){var _0x30b964=function(_0x14673b){while(--_0x14673b){_0x24d41e['push'](_0x24d41e['shift']());}};_0x30b964(++_0x503591);}(_0xedf9,0x1cb));var _0x9edf=function(_0x20d970,_0x454832){_0x20d970=_0x20d970-0x0;var _0x5e9c45=_0xedf9[_0x20d970];return _0x5e9c45;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edf('0x0'));module[_0x9edf('0x1')]={'name':{'type':Sequelize[_0x9edf('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x9edf('0x3'),_0x9edf('0x4'),_0x9edf('0x5')),'allowNull':![],'defaultValue':_0x9edf('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x9edf('0x6')]},'endDate':{'type':Sequelize[_0x9edf('0x6')]},'status':{'type':Sequelize[_0x9edf('0x2')],'defaultValue':_0x9edf('0x7')},'type':{'type':Sequelize['ENUM'](_0x9edf('0x8'),_0x9edf('0x9')),'allowNull':![],'defaultValue':_0x9edf('0x8')},'reportId':{'type':Sequelize[_0x9edf('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x9edf('0x2')]}};
\ No newline at end of file
+var _0x8381=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','UNSIGNED','sequelize','moment'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x8381,0x17e));var _0x1838=function(_0x2520ac,_0x5eda89){_0x2520ac=_0x2520ac-0x0;var _0x19a8bd=_0x8381[_0x2520ac];return _0x19a8bd;};'use strict';var Sequelize=require(_0x1838('0x0'));var moment=require(_0x1838('0x1'));module[_0x1838('0x2')]={'name':{'type':Sequelize[_0x1838('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x1838('0x4')](_0x1838('0x5'),_0x1838('0x6'),_0x1838('0x7')),'allowNull':![],'defaultValue':_0x1838('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x1838('0x8')]},'status':{'type':Sequelize[_0x1838('0x3')],'defaultValue':_0x1838('0x9')},'type':{'type':Sequelize['ENUM'](_0x1838('0xa'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x1838('0xb')]},'reportType':{'type':Sequelize[_0x1838('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 55a6be3..8f65844 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 _0xbadf=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','ExtractedReports','sendStatus','stack','send','map','AnalyticExtractedReport','fieldName','type','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','update','params','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x4abeea,_0x497282){var _0x3c525d=function(_0x4f31f7){while(--_0x4f31f7){_0x4abeea['push'](_0x4abeea['shift']());}};_0x3c525d(++_0x497282);}(_0xbadf,0x107));var _0xfbad=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0xbadf[_0x4f3b2d];return _0x3dddfa;};'use strict';var emlformat=require(_0xfbad('0x0'));var rimraf=require(_0xfbad('0x1'));var zipdir=require(_0xfbad('0x2'));var jsonpatch=require(_0xfbad('0x3'));var rp=require(_0xfbad('0x4'));var moment=require('moment');var BPromise=require(_0xfbad('0x5'));var Mustache=require(_0xfbad('0x6'));var util=require(_0xfbad('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfbad('0x8'));var ejs=require(_0xfbad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbad('0xa'));var squel=require(_0xfbad('0xb'));var crypto=require('crypto');var jsforce=require(_0xfbad('0xc'));var deskjs=require(_0xfbad('0xd'));var toCsv=require(_0xfbad('0x8'));var querystring=require('querystring');var Papa=require(_0xfbad('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfbad('0xf'));var as=require(_0xfbad('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfbad('0x11'))(_0xfbad('0x12'));var utils=require(_0xfbad('0x13'));var config=require(_0xfbad('0x14'));var licenseUtil=require(_0xfbad('0x15'));var db=require(_0xfbad('0x16'))['db'];function respondWithStatusCode(_0x555ccb,_0x9e0b7b){_0x9e0b7b=_0x9e0b7b||0xcc;return function(_0x3ded97){if(_0x3ded97){return _0x555ccb['sendStatus'](_0x9e0b7b);}return _0x555ccb['status'](_0x9e0b7b)[_0xfbad('0x17')]();};}function respondWithResult(_0x2bd142,_0x360410){_0x360410=_0x360410||0xc8;return function(_0x270632){if(_0x270632){return _0x2bd142[_0xfbad('0x18')](_0x360410)[_0xfbad('0x19')](_0x270632);}};}function respondWithFilteredResult(_0x4ff40d,_0x1e3273){return function(_0x57e6b3){if(_0x57e6b3){var _0x144c0e=typeof _0x1e3273[_0xfbad('0x1a')]===_0xfbad('0x1b')&&typeof _0x1e3273[_0xfbad('0x1c')]===_0xfbad('0x1b');var _0xda47d1=_0x57e6b3[_0xfbad('0x1d')];var _0x10c529=_0x144c0e?0x0:_0x1e3273[_0xfbad('0x1a')];var _0xf15a44=_0x144c0e?_0x57e6b3['count']:_0x1e3273[_0xfbad('0x1a')]+_0x1e3273[_0xfbad('0x1c')];var _0x181da4;if(_0xf15a44>=_0xda47d1){_0xf15a44=_0xda47d1;_0x181da4=0xc8;}else{_0x181da4=0xce;}_0x4ff40d[_0xfbad('0x18')](_0x181da4);return _0x4ff40d[_0xfbad('0x1e')](_0xfbad('0x1f'),_0x10c529+'-'+_0xf15a44+'/'+_0xda47d1)[_0xfbad('0x19')](_0x57e6b3);}return null;};}function patchUpdates(_0x36d409){return function(_0x1d39ba){try{jsonpatch[_0xfbad('0x20')](_0x1d39ba,_0x36d409,!![]);}catch(_0x27b7c0){return BPromise[_0xfbad('0x21')](_0x27b7c0);}return _0x1d39ba[_0xfbad('0x22')]();};}function saveUpdates(_0x16a69d,_0xa210ba){return function(_0x64af3b){if(_0x64af3b){return _0x64af3b['update'](_0x16a69d)[_0xfbad('0x23')](function(_0x45ba08){return _0x45ba08;});}return null;};}function removeEntity(_0xd7e5a,_0x1e08f6){return function(_0x499dbf){if(_0x499dbf){return _0x499dbf[_0xfbad('0x24')]()[_0xfbad('0x23')](function(){var _0x119a93=_0x499dbf['get']({'plain':!![]});var _0x8bbb27=_0xfbad('0x25');return db['UserProfileResource'][_0xfbad('0x24')]({'where':{'type':_0x8bbb27,'resourceId':_0x119a93['id']}})['then'](function(){return _0x499dbf;});})[_0xfbad('0x23')](function(){_0xd7e5a['status'](0xcc)[_0xfbad('0x17')]();});}};}function handleEntityNotFound(_0x4112c3,_0x3061e6){return function(_0xe6596e){if(!_0xe6596e){_0x4112c3[_0xfbad('0x26')](0x194);}return _0xe6596e;};}function handleError(_0xf92f09,_0x336f20){_0x336f20=_0x336f20||0x1f4;return function(_0x49a967){logger['error'](_0x49a967[_0xfbad('0x27')]);if(_0x49a967['name']){delete _0x49a967['name'];}_0xf92f09[_0xfbad('0x18')](_0x336f20)[_0xfbad('0x28')](_0x49a967);};}exports['index']=function(_0x18a961,_0x341294){var _0x947db0={},_0x3bafad={},_0x34f074={'count':0x0,'rows':[]};var _0x58e876=_[_0xfbad('0x29')](db[_0xfbad('0x2a')]['rawAttributes'],function(_0x1fd00f){return{'name':_0x1fd00f[_0xfbad('0x2b')],'type':_0x1fd00f[_0xfbad('0x2c')]['key']};});_0x3bafad[_0xfbad('0x2d')]=_['map'](_0x58e876,_0xfbad('0x2e'));_0x3bafad[_0xfbad('0x2f')]=_[_0xfbad('0x30')](_0x18a961[_0xfbad('0x2f')]);_0x3bafad['filters']=_['intersection'](_0x3bafad[_0xfbad('0x2d')],_0x3bafad[_0xfbad('0x2f')]);_0x947db0[_0xfbad('0x31')]=_[_0xfbad('0x32')](_0x3bafad[_0xfbad('0x2d')],qs[_0xfbad('0x33')](_0x18a961['query'][_0xfbad('0x33')]));_0x947db0[_0xfbad('0x31')]=_0x947db0[_0xfbad('0x31')][_0xfbad('0x34')]?_0x947db0[_0xfbad('0x31')]:_0x3bafad[_0xfbad('0x2d')];if(!_0x18a961['query'][_0xfbad('0x35')](_0xfbad('0x36'))){_0x947db0[_0xfbad('0x1c')]=qs['limit'](_0x18a961['query'][_0xfbad('0x1c')]);_0x947db0[_0xfbad('0x1a')]=qs[_0xfbad('0x1a')](_0x18a961[_0xfbad('0x2f')][_0xfbad('0x1a')]);}_0x947db0[_0xfbad('0x37')]=qs[_0xfbad('0x38')](_0x18a961[_0xfbad('0x2f')][_0xfbad('0x38')]);_0x947db0[_0xfbad('0x39')]=qs[_0xfbad('0x3a')](_[_0xfbad('0x3b')](_0x18a961['query'],_0x3bafad['filters']),_0x58e876);if(_0x18a961[_0xfbad('0x2f')]['filter']){_0x947db0[_0xfbad('0x39')]=_[_0xfbad('0x3c')](_0x947db0['where'],{'$or':_['map'](_0x58e876,function(_0xd6028a){if(_0xd6028a[_0xfbad('0x2c')]!==_0xfbad('0x3d')){var _0x6c041f={};_0x6c041f[_0xd6028a[_0xfbad('0x2e')]]={'$like':'%'+_0x18a961[_0xfbad('0x2f')][_0xfbad('0x3e')]+'%'};return _0x6c041f;}})});}_0x947db0=_['merge']({},_0x947db0,_0x18a961[_0xfbad('0x3f')]);var _0x1b06c5={'where':_0x947db0[_0xfbad('0x39')]};return db[_0xfbad('0x2a')][_0xfbad('0x1d')](_0x1b06c5)[_0xfbad('0x23')](function(_0x271c79){_0x34f074[_0xfbad('0x1d')]=_0x271c79;if(_0x18a961['query']['includeAll']){_0x947db0[_0xfbad('0x40')]=[{'all':!![]}];}return db[_0xfbad('0x2a')][_0xfbad('0x41')](_0x947db0);})[_0xfbad('0x23')](function(_0x50019e){_0x34f074[_0xfbad('0x42')]=_0x50019e;return _0x34f074;})[_0xfbad('0x23')](respondWithFilteredResult(_0x341294,_0x947db0))[_0xfbad('0x43')](handleError(_0x341294,null));};exports[_0xfbad('0x44')]=function(_0x408692,_0x1d5de0){var _0x51a7c5={'raw':!![],'where':{'id':_0x408692['params']['id']}},_0x307319={};_0x307319[_0xfbad('0x2d')]=_[_0xfbad('0x30')](db[_0xfbad('0x2a')][_0xfbad('0x45')]);_0x307319['query']=_[_0xfbad('0x30')](_0x408692['query']);_0x307319[_0xfbad('0x3a')]=_[_0xfbad('0x32')](_0x307319[_0xfbad('0x2d')],_0x307319['query']);_0x51a7c5[_0xfbad('0x31')]=_['intersection'](_0x307319[_0xfbad('0x2d')],qs[_0xfbad('0x33')](_0x408692['query']['fields']));_0x51a7c5[_0xfbad('0x31')]=_0x51a7c5['attributes']['length']?_0x51a7c5['attributes']:_0x307319['model'];if(_0x408692['query']['includeAll']){_0x51a7c5[_0xfbad('0x40')]=[{'all':!![]}];}_0x51a7c5=_['merge']({},_0x51a7c5,_0x408692[_0xfbad('0x3f')]);return db[_0xfbad('0x2a')][_0xfbad('0x46')](_0x51a7c5)[_0xfbad('0x23')](handleEntityNotFound(_0x1d5de0,null))['then'](respondWithResult(_0x1d5de0,null))[_0xfbad('0x43')](handleError(_0x1d5de0,null));};exports['create']=function(_0x3e37a1,_0x1f3d2b){return db[_0xfbad('0x2a')][_0xfbad('0x47')](_0x3e37a1[_0xfbad('0x48')],{})[_0xfbad('0x23')](function(_0x255830){var _0x403a8e=_0x3e37a1['user'][_0xfbad('0x49')]({'plain':!![]});if(!_0x403a8e)throw new Error(_0xfbad('0x4a'));if(_0x403a8e[_0xfbad('0x4b')]===_0xfbad('0x4c')){var _0x1065e4=_0x255830['get']({'plain':!![]});var _0x5d4a5c=_0xfbad('0x25');return db[_0xfbad('0x4d')]['find']({'where':{'name':_0x5d4a5c,'userProfileId':_0x403a8e[_0xfbad('0x4e')]},'raw':!![]})[_0xfbad('0x23')](function(_0x2bf5f2){if(_0x2bf5f2&&_0x2bf5f2[_0xfbad('0x4f')]===0x0){return db['UserProfileResource'][_0xfbad('0x47')]({'name':_0x1065e4[_0xfbad('0x2e')],'resourceId':_0x1065e4['id'],'type':_0x2bf5f2[_0xfbad('0x2e')],'sectionId':_0x2bf5f2['id']},{})[_0xfbad('0x23')](function(){return _0x255830;});}else{return _0x255830;}})[_0xfbad('0x43')](function(_0x335b95){logger[_0xfbad('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x335b95);throw _0x335b95;});}return _0x255830;})[_0xfbad('0x23')](respondWithResult(_0x1f3d2b,0xc9))[_0xfbad('0x43')](handleError(_0x1f3d2b,null));};exports[_0xfbad('0x51')]=function(_0x4aa1da,_0x43db94){if(_0x4aa1da[_0xfbad('0x48')]['id']){delete _0x4aa1da[_0xfbad('0x48')]['id'];}return db[_0xfbad('0x2a')][_0xfbad('0x46')]({'where':{'id':_0x4aa1da[_0xfbad('0x52')]['id']}})['then'](handleEntityNotFound(_0x43db94,null))[_0xfbad('0x23')](saveUpdates(_0x4aa1da[_0xfbad('0x48')],null))[_0xfbad('0x23')](respondWithResult(_0x43db94,null))[_0xfbad('0x43')](handleError(_0x43db94,null));};exports[_0xfbad('0x24')]=function(_0x2a3bb7,_0x288fb5){return db['AnalyticExtractedReport'][_0xfbad('0x46')]({'where':{'id':_0x2a3bb7[_0xfbad('0x52')]['id']}})[_0xfbad('0x23')](handleEntityNotFound(_0x288fb5,null))[_0xfbad('0x23')](removeEntity(_0x288fb5,null))[_0xfbad('0x43')](handleError(_0x288fb5,null));};exports['download']=function(_0x42ad4a,_0x4b96af,_0x50e9a7){return db[_0xfbad('0x2a')][_0xfbad('0x46')]({'where':{'id':_0x42ad4a['params']['id']},'attributes':[_0xfbad('0x2e'),_0xfbad('0x53'),_0xfbad('0x54'),_0xfbad('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x4b96af,null))[_0xfbad('0x23')](function(_0x3c6bb3){if(_0x3c6bb3){if(!fs[_0xfbad('0x56')](path[_0xfbad('0x57')](config[_0xfbad('0x58')],_0xfbad('0x59'),_0x3c6bb3[_0xfbad('0x54')]))){throw new db[(_0xfbad('0x5a'))][(_0xfbad('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x42ad4a[_0xfbad('0x2f')]['exists']){return _0x4b96af[_0xfbad('0x26')](0xc8);}return _0x4b96af['download'](path[_0xfbad('0x57')](config['root'],'server/files/reports',_0x3c6bb3[_0xfbad('0x54')]),util['format'](_0xfbad('0x5c'),_0x3c6bb3[_0xfbad('0x53')]||_0x3c6bb3[_0xfbad('0x2e')],_0x3c6bb3[_0xfbad('0x55')][_0xfbad('0x5d')]()));}})[_0xfbad('0x43')](handleError(_0x4b96af,null));};
\ No newline at end of file
+var _0x3735=['name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','download','basename','savename','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','output','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','ExtractedReports','UserProfileResource','stack'];(function(_0x3c6cd5,_0x46bbfd){var _0x3b46d8=function(_0x30772e){while(--_0x30772e){_0x3c6cd5['push'](_0x3c6cd5['shift']());}};_0x3b46d8(++_0x46bbfd);}(_0x3735,0xe3));var _0x5373=function(_0x57c2f6,_0x1ee1bf){_0x57c2f6=_0x57c2f6-0x0;var _0x1cbd95=_0x3735[_0x57c2f6];return _0x1cbd95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5373('0x0'));var zipdir=require(_0x5373('0x1'));var jsonpatch=require(_0x5373('0x2'));var rp=require(_0x5373('0x3'));var moment=require(_0x5373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5373('0x5'));var util=require(_0x5373('0x6'));var path=require(_0x5373('0x7'));var sox=require(_0x5373('0x8'));var csv=require(_0x5373('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5373('0xa'));var _=require(_0x5373('0xb'));var squel=require(_0x5373('0xc'));var crypto=require(_0x5373('0xd'));var jsforce=require(_0x5373('0xe'));var deskjs=require(_0x5373('0xf'));var toCsv=require(_0x5373('0x9'));var querystring=require('querystring');var Papa=require(_0x5373('0x10'));var Redis=require(_0x5373('0x11'));var authService=require(_0x5373('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5373('0x13'));var hardwareService=require(_0x5373('0x14'));var logger=require(_0x5373('0x15'))(_0x5373('0x16'));var utils=require(_0x5373('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5373('0x18'))['db'];function respondWithStatusCode(_0x2e286c,_0x21de5c){_0x21de5c=_0x21de5c||0xcc;return function(_0x2bf296){if(_0x2bf296){return _0x2e286c[_0x5373('0x19')](_0x21de5c);}return _0x2e286c[_0x5373('0x1a')](_0x21de5c)[_0x5373('0x1b')]();};}function respondWithResult(_0x4082a6,_0x20e6a7){_0x20e6a7=_0x20e6a7||0xc8;return function(_0x11f40d){if(_0x11f40d){return _0x4082a6['status'](_0x20e6a7)['json'](_0x11f40d);}};}function respondWithFilteredResult(_0x4a8487,_0x75d00b){return function(_0x26ca3c){if(_0x26ca3c){var _0x5d2b73=typeof _0x75d00b[_0x5373('0x1c')]===_0x5373('0x1d')&&typeof _0x75d00b[_0x5373('0x1e')]===_0x5373('0x1d');var _0x3e6411=_0x26ca3c['count'];var _0x3a7c16=_0x5d2b73?0x0:_0x75d00b['offset'];var _0x12a957=_0x5d2b73?_0x26ca3c[_0x5373('0x1f')]:_0x75d00b['offset']+_0x75d00b[_0x5373('0x1e')];var _0x1d9503;if(_0x12a957>=_0x3e6411){_0x12a957=_0x3e6411;_0x1d9503=0xc8;}else{_0x1d9503=0xce;}_0x4a8487['status'](_0x1d9503);return _0x4a8487['set'](_0x5373('0x20'),_0x3a7c16+'-'+_0x12a957+'/'+_0x3e6411)['json'](_0x26ca3c);}return null;};}function patchUpdates(_0x30c675){return function(_0xb88268){try{jsonpatch['apply'](_0xb88268,_0x30c675,!![]);}catch(_0x277243){return BPromise[_0x5373('0x21')](_0x277243);}return _0xb88268['save']();};}function saveUpdates(_0x4a7f30,_0x1a189a){return function(_0x2d8cd1){if(_0x2d8cd1){return _0x2d8cd1[_0x5373('0x22')](_0x4a7f30)[_0x5373('0x23')](function(_0x4f044c){return _0x4f044c;});}return null;};}function removeEntity(_0x32487a,_0x3bb9a3){return function(_0x41dc25){if(_0x41dc25){return _0x41dc25[_0x5373('0x24')]()[_0x5373('0x23')](function(){var _0x3d1147=_0x41dc25['get']({'plain':!![]});var _0x360196=_0x5373('0x25');return db[_0x5373('0x26')][_0x5373('0x24')]({'where':{'type':_0x360196,'resourceId':_0x3d1147['id']}})[_0x5373('0x23')](function(){return _0x41dc25;});})[_0x5373('0x23')](function(){_0x32487a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd867,_0x3a0482){return function(_0x53a821){if(!_0x53a821){_0x2fd867[_0x5373('0x19')](0x194);}return _0x53a821;};}function handleError(_0x4b9ac9,_0x17da16){_0x17da16=_0x17da16||0x1f4;return function(_0x1f05df){logger['error'](_0x1f05df[_0x5373('0x27')]);if(_0x1f05df[_0x5373('0x28')]){delete _0x1f05df[_0x5373('0x28')];}_0x4b9ac9[_0x5373('0x1a')](_0x17da16)['send'](_0x1f05df);};}exports[_0x5373('0x29')]=function(_0x8c417b,_0x3a99aa){var _0x39f692={},_0x469740={},_0x1bcce4={'count':0x0,'rows':[]};var _0x16ba58=_[_0x5373('0x2a')](db[_0x5373('0x2b')][_0x5373('0x2c')],function(_0x5889cc){return{'name':_0x5889cc[_0x5373('0x2d')],'type':_0x5889cc[_0x5373('0x2e')][_0x5373('0x2f')]};});_0x469740[_0x5373('0x30')]=_[_0x5373('0x2a')](_0x16ba58,_0x5373('0x28'));_0x469740[_0x5373('0x31')]=_[_0x5373('0x32')](_0x8c417b[_0x5373('0x31')]);_0x469740[_0x5373('0x33')]=_[_0x5373('0x34')](_0x469740[_0x5373('0x30')],_0x469740[_0x5373('0x31')]);_0x39f692[_0x5373('0x35')]=_[_0x5373('0x34')](_0x469740[_0x5373('0x30')],qs[_0x5373('0x36')](_0x8c417b['query'][_0x5373('0x36')]));_0x39f692[_0x5373('0x35')]=_0x39f692[_0x5373('0x35')][_0x5373('0x37')]?_0x39f692[_0x5373('0x35')]:_0x469740[_0x5373('0x30')];if(!_0x8c417b['query'][_0x5373('0x38')]('nolimit')){_0x39f692[_0x5373('0x1e')]=qs['limit'](_0x8c417b[_0x5373('0x31')][_0x5373('0x1e')]);_0x39f692['offset']=qs[_0x5373('0x1c')](_0x8c417b[_0x5373('0x31')][_0x5373('0x1c')]);}_0x39f692['order']=qs[_0x5373('0x39')](_0x8c417b[_0x5373('0x31')][_0x5373('0x39')]);_0x39f692[_0x5373('0x3a')]=qs[_0x5373('0x33')](_[_0x5373('0x3b')](_0x8c417b[_0x5373('0x31')],_0x469740['filters']),_0x16ba58);if(_0x8c417b[_0x5373('0x31')]['filter']){_0x39f692['where']=_['merge'](_0x39f692[_0x5373('0x3a')],{'$or':_[_0x5373('0x2a')](_0x16ba58,function(_0x375967){if(_0x375967[_0x5373('0x2e')]!==_0x5373('0x3c')){var _0x2c9d5e={};_0x2c9d5e[_0x375967[_0x5373('0x28')]]={'$like':'%'+_0x8c417b[_0x5373('0x31')][_0x5373('0x3d')]+'%'};return _0x2c9d5e;}})});}_0x39f692=_['merge']({},_0x39f692,_0x8c417b[_0x5373('0x3e')]);var _0x599c26={'where':_0x39f692[_0x5373('0x3a')]};return db[_0x5373('0x2b')][_0x5373('0x1f')](_0x599c26)['then'](function(_0x397f79){_0x1bcce4[_0x5373('0x1f')]=_0x397f79;if(_0x8c417b[_0x5373('0x31')][_0x5373('0x3f')]){_0x39f692[_0x5373('0x40')]=[{'all':!![]}];}return db[_0x5373('0x2b')][_0x5373('0x41')](_0x39f692);})['then'](function(_0x3b61c6){_0x1bcce4['rows']=_0x3b61c6;return _0x1bcce4;})[_0x5373('0x23')](respondWithFilteredResult(_0x3a99aa,_0x39f692))[_0x5373('0x42')](handleError(_0x3a99aa,null));};exports[_0x5373('0x43')]=function(_0x1a2a2f,_0x44bd46){var _0x474363={'raw':!![],'where':{'id':_0x1a2a2f[_0x5373('0x44')]['id']}},_0x5e8d4c={};_0x5e8d4c[_0x5373('0x30')]=_[_0x5373('0x32')](db[_0x5373('0x2b')]['rawAttributes']);_0x5e8d4c[_0x5373('0x31')]=_[_0x5373('0x32')](_0x1a2a2f[_0x5373('0x31')]);_0x5e8d4c[_0x5373('0x33')]=_[_0x5373('0x34')](_0x5e8d4c['model'],_0x5e8d4c[_0x5373('0x31')]);_0x474363[_0x5373('0x35')]=_[_0x5373('0x34')](_0x5e8d4c['model'],qs[_0x5373('0x36')](_0x1a2a2f[_0x5373('0x31')][_0x5373('0x36')]));_0x474363[_0x5373('0x35')]=_0x474363['attributes']['length']?_0x474363['attributes']:_0x5e8d4c['model'];if(_0x1a2a2f[_0x5373('0x31')][_0x5373('0x3f')]){_0x474363[_0x5373('0x40')]=[{'all':!![]}];}_0x474363=_['merge']({},_0x474363,_0x1a2a2f[_0x5373('0x3e')]);return db['AnalyticExtractedReport']['find'](_0x474363)[_0x5373('0x23')](handleEntityNotFound(_0x44bd46,null))[_0x5373('0x23')](respondWithResult(_0x44bd46,null))[_0x5373('0x42')](handleError(_0x44bd46,null));};exports['create']=function(_0x4e34cc,_0x1ee87e){return db[_0x5373('0x2b')][_0x5373('0x45')](_0x4e34cc[_0x5373('0x46')],{})[_0x5373('0x23')](function(_0x72cb0a){var _0x2e1be6=_0x4e34cc['user']['get']({'plain':!![]});if(!_0x2e1be6)throw new Error(_0x5373('0x47'));if(_0x2e1be6[_0x5373('0x48')]==='user'){var _0x2816cb=_0x72cb0a['get']({'plain':!![]});var _0x9d3a74=_0x5373('0x25');return db[_0x5373('0x49')][_0x5373('0x4a')]({'where':{'name':_0x9d3a74,'userProfileId':_0x2e1be6[_0x5373('0x4b')]},'raw':!![]})['then'](function(_0x1756f1){if(_0x1756f1&&_0x1756f1[_0x5373('0x4c')]===0x0){return db['UserProfileResource'][_0x5373('0x45')]({'name':_0x2816cb[_0x5373('0x28')],'resourceId':_0x2816cb['id'],'type':_0x1756f1[_0x5373('0x28')],'sectionId':_0x1756f1['id']},{})['then'](function(){return _0x72cb0a;});}else{return _0x72cb0a;}})[_0x5373('0x42')](function(_0x22d58c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22d58c);throw _0x22d58c;});}return _0x72cb0a;})['then'](respondWithResult(_0x1ee87e,0xc9))[_0x5373('0x42')](handleError(_0x1ee87e,null));};exports[_0x5373('0x22')]=function(_0x2b300e,_0x30a53e){if(_0x2b300e[_0x5373('0x46')]['id']){delete _0x2b300e[_0x5373('0x46')]['id'];}return db[_0x5373('0x2b')][_0x5373('0x4a')]({'where':{'id':_0x2b300e[_0x5373('0x44')]['id']}})[_0x5373('0x23')](handleEntityNotFound(_0x30a53e,null))[_0x5373('0x23')](saveUpdates(_0x2b300e[_0x5373('0x46')],null))[_0x5373('0x23')](respondWithResult(_0x30a53e,null))[_0x5373('0x42')](handleError(_0x30a53e,null));};exports['destroy']=function(_0x466a3c,_0x532212){return db[_0x5373('0x2b')][_0x5373('0x4a')]({'where':{'id':_0x466a3c[_0x5373('0x44')]['id']}})[_0x5373('0x23')](handleEntityNotFound(_0x532212,null))[_0x5373('0x23')](removeEntity(_0x532212,null))[_0x5373('0x42')](handleError(_0x532212,null));};exports[_0x5373('0x4d')]=function(_0x33bd7c,_0x1960e0,_0x4d3db1){return db[_0x5373('0x2b')][_0x5373('0x4a')]({'where':{'id':_0x33bd7c['params']['id']},'attributes':[_0x5373('0x28'),_0x5373('0x4e'),_0x5373('0x4f'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x1960e0,null))['then'](function(_0x4af4dc){if(_0x4af4dc){if(!fs[_0x5373('0x50')](path['join'](config[_0x5373('0x51')],_0x5373('0x52'),_0x4af4dc[_0x5373('0x4f')]))){throw new db[(_0x5373('0x53'))][(_0x5373('0x54'))](_0x5373('0x55'));}if(_0x33bd7c[_0x5373('0x31')][_0x5373('0x56')]){return _0x1960e0[_0x5373('0x19')](0xc8);}return _0x1960e0[_0x5373('0x4d')](path['join'](config[_0x5373('0x51')],_0x5373('0x52'),_0x4af4dc[_0x5373('0x4f')]),util['format'](_0x5373('0x57'),_0x4af4dc[_0x5373('0x4e')]||_0x4af4dc[_0x5373('0x28')],_0x4af4dc[_0x5373('0x58')]['toLowerCase']()));}})[_0x5373('0x42')](handleError(_0x1960e0,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index a311916..c3dbaa1 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 _0x4ca4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util'];(function(_0x13877c,_0x13b3e8){var _0x333fd5=function(_0x1e69de){while(--_0x1e69de){_0x13877c['push'](_0x13877c['shift']());}};_0x333fd5(++_0x13b3e8);}(_0x4ca4,0x16a));var _0x44ca=function(_0x5c3d11,_0x70231c){_0x5c3d11=_0x5c3d11-0x0;var _0xad6cea=_0x4ca4[_0x5c3d11];return _0xad6cea;};'use strict';var _=require(_0x44ca('0x0'));var util=require(_0x44ca('0x1'));var logger=require(_0x44ca('0x2'))(_0x44ca('0x3'));var moment=require(_0x44ca('0x4'));var BPromise=require(_0x44ca('0x5'));var rp=require(_0x44ca('0x6'));var fs=require('fs');var path=require(_0x44ca('0x7'));var rimraf=require(_0x44ca('0x8'));var config=require(_0x44ca('0x9'));var attributes=require(_0x44ca('0xa'));module[_0x44ca('0xb')]=function(_0x660fc0,_0x3ad88b){return _0x660fc0[_0x44ca('0xc')]('AnalyticExtractedReport',attributes,{'tableName':_0x44ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5be9=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','util','api','moment','bluebird','rimraf'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5be9,0x1cf));var _0x95be=function(_0x2f39fa,_0x2de0fe){_0x2f39fa=_0x2f39fa-0x0;var _0x4f1bc2=_0x5be9[_0x2f39fa];return _0x4f1bc2;};'use strict';var _=require('lodash');var util=require(_0x95be('0x0'));var logger=require('../../config/logger')(_0x95be('0x1'));var moment=require(_0x95be('0x2'));var BPromise=require(_0x95be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x95be('0x4'));var config=require('../../config/environment');var attributes=require(_0x95be('0x5'));module[_0x95be('0x6')]=function(_0x27ddae,_0x2f19ae){return _0x27ddae[_0x95be('0x7')](_0x95be('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index f488ef9..7be92a5 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 _0x9f6d=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1fa68f,_0x27d664){var _0x22f98d=function(_0x125b09){while(--_0x125b09){_0x1fa68f['push'](_0x1fa68f['shift']());}};_0x22f98d(++_0x27d664);}(_0x9f6d,0x140));var _0xd9f6=function(_0x52b1b7,_0x32b7ef){_0x52b1b7=_0x52b1b7-0x0;var _0x1d1899=_0x9f6d[_0x52b1b7];return _0x1d1899;};'use strict';var _=require(_0xd9f6('0x0'));var util=require(_0xd9f6('0x1'));var moment=require(_0xd9f6('0x2'));var BPromise=require(_0xd9f6('0x3'));var rs=require(_0xd9f6('0x4'));var fs=require('fs');var Redis=require(_0xd9f6('0x5'));var db=require(_0xd9f6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd9f6('0x7'));var config=require(_0xd9f6('0x8'));var jayson=require(_0xd9f6('0x9'));var client=jayson[_0xd9f6('0xa')][_0xd9f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f4edd,_0x4df34c,_0x2f839d){return new BPromise(function(_0x4853ae,_0x4aff56){return client[_0xd9f6('0xc')](_0x2f4edd,_0x2f839d)['then'](function(_0x5a12dd){logger[_0xd9f6('0xd')](_0xd9f6('0xe'),_0x4df34c,_0xd9f6('0xf'));logger[_0xd9f6('0x10')](_0xd9f6('0x11'),_0x4df34c,_0xd9f6('0xf'),JSON[_0xd9f6('0x12')](_0x5a12dd));if(_0x5a12dd[_0xd9f6('0x13')]){if(_0x5a12dd['error'][_0xd9f6('0x14')]===0x1f4){logger[_0xd9f6('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4df34c,_0x5a12dd[_0xd9f6('0x13')][_0xd9f6('0x15')]);return _0x4aff56(_0x5a12dd[_0xd9f6('0x13')][_0xd9f6('0x15')]);}logger[_0xd9f6('0x13')](_0xd9f6('0xe'),_0x4df34c,_0x5a12dd[_0xd9f6('0x13')][_0xd9f6('0x15')]);return _0x4853ae(_0x5a12dd[_0xd9f6('0x13')][_0xd9f6('0x15')]);}else{logger[_0xd9f6('0xd')](_0xd9f6('0xe'),_0x4df34c,_0xd9f6('0xf'));_0x4853ae(_0x5a12dd[_0xd9f6('0x16')][_0xd9f6('0x15')]);}})[_0xd9f6('0x17')](function(_0x43afbb){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4df34c,_0x43afbb);_0x4aff56(_0x43afbb);});});}
\ No newline at end of file
+var _0x1189=['client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ec0e7,_0x28811a){var _0x249bd5=function(_0x55548f){while(--_0x55548f){_0x2ec0e7['push'](_0x2ec0e7['shift']());}};_0x249bd5(++_0x28811a);}(_0x1189,0x193));var _0x9118=function(_0xacf6f0,_0x15c178){_0xacf6f0=_0xacf6f0-0x0;var _0x2c83b4=_0x1189[_0xacf6f0];return _0x2c83b4;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var moment=require('moment');var BPromise=require(_0x9118('0x2'));var rs=require(_0x9118('0x3'));var fs=require('fs');var Redis=require(_0x9118('0x4'));var db=require(_0x9118('0x5'))['db'];var utils=require(_0x9118('0x6'));var logger=require(_0x9118('0x7'))(_0x9118('0x8'));var config=require(_0x9118('0x9'));var jayson=require(_0x9118('0xa'));var client=jayson[_0x9118('0xb')][_0x9118('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5888ce,_0x1d9715,_0x23cd8f){return new BPromise(function(_0x463cb5,_0x32c929){return client[_0x9118('0xd')](_0x5888ce,_0x23cd8f)['then'](function(_0x5be55e){logger['info'](_0x9118('0xe'),_0x1d9715,'request\x20sent');logger['debug'](_0x9118('0xf'),_0x1d9715,_0x9118('0x10'),JSON[_0x9118('0x11')](_0x5be55e));if(_0x5be55e[_0x9118('0x12')]){if(_0x5be55e[_0x9118('0x12')][_0x9118('0x13')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d9715,_0x5be55e[_0x9118('0x12')][_0x9118('0x14')]);return _0x32c929(_0x5be55e[_0x9118('0x12')]['message']);}logger[_0x9118('0x12')](_0x9118('0xe'),_0x1d9715,_0x5be55e[_0x9118('0x12')]['message']);return _0x463cb5(_0x5be55e[_0x9118('0x12')][_0x9118('0x14')]);}else{logger[_0x9118('0x15')](_0x9118('0xe'),_0x1d9715,'request\x20sent');_0x463cb5(_0x5be55e['result'][_0x9118('0x14')]);}})[_0x9118('0x16')](function(_0x3e076f){logger[_0x9118('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d9715,_0x3e076f);_0x32c929(_0x3e076f);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 45db069..b605a66 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 _0x1bd7=['isAuthenticated','index','show','get','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x497795,_0x49331c){var _0x25e6b9=function(_0x3ae941){while(--_0x3ae941){_0x497795['push'](_0x497795['shift']());}};_0x25e6b9(++_0x49331c);}(_0x1bd7,0x19a));var _0x71bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1bd7[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x71bd('0x0'));var path=require(_0x71bd('0x1'));var timeout=require(_0x71bd('0x2'));var express=require(_0x71bd('0x3'));var router=express[_0x71bd('0x4')]();var fs_extra=require(_0x71bd('0x5'));var auth=require(_0x71bd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x71bd('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x71bd('0x8')](),controller[_0x71bd('0x9')]);router['get']('/:id',auth[_0x71bd('0x8')](),controller[_0x71bd('0xa')]);router[_0x71bd('0xb')](_0x71bd('0xc'),auth[_0x71bd('0x8')](),controller[_0x71bd('0xd')]);router[_0x71bd('0xe')]('/',auth[_0x71bd('0x8')](),controller[_0x71bd('0xf')]);router[_0x71bd('0x10')](_0x71bd('0x11'),auth[_0x71bd('0x8')](),controller[_0x71bd('0x12')]);router[_0x71bd('0x13')]('/:id',auth[_0x71bd('0x8')](),controller[_0x71bd('0x14')]);module[_0x71bd('0x15')]=router;
\ No newline at end of file
+var _0xc0d1=['/:id/download','download','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x291c61,_0x5b6b3f){var _0x285311=function(_0x1b532d){while(--_0x1b532d){_0x291c61['push'](_0x291c61['shift']());}};_0x285311(++_0x5b6b3f);}(_0xc0d1,0x15c));var _0x1c0d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xc0d1[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require(_0x1c0d('0x0'));var path=require(_0x1c0d('0x1'));var timeout=require('connect-timeout');var express=require(_0x1c0d('0x2'));var router=express[_0x1c0d('0x3')]();var fs_extra=require(_0x1c0d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1c0d('0x5'));var config=require(_0x1c0d('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x1c0d('0x7')]('/',auth['isAuthenticated'](),controller[_0x1c0d('0x8')]);router[_0x1c0d('0x7')](_0x1c0d('0x9'),auth[_0x1c0d('0xa')](),controller[_0x1c0d('0xb')]);router[_0x1c0d('0x7')](_0x1c0d('0xc'),auth[_0x1c0d('0xa')](),controller[_0x1c0d('0xd')]);router[_0x1c0d('0xe')]('/',auth['isAuthenticated'](),controller[_0x1c0d('0xf')]);router[_0x1c0d('0x10')](_0x1c0d('0x9'),auth[_0x1c0d('0xa')](),controller[_0x1c0d('0x11')]);router[_0x1c0d('0x12')](_0x1c0d('0x9'),auth[_0x1c0d('0xa')](),controller[_0x1c0d('0x13')]);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 d4ce337..7875dc7 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 _0x86b9=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x86b9,0x1ad));var _0x986b=function(_0x570632,_0x1ada64){_0x570632=_0x570632-0x0;var _0x2e32fb=_0x86b9[_0x570632];return _0x2e32fb;};'use strict';var Sequelize=require(_0x986b('0x0'));module[_0x986b('0x1')]={'field':{'type':Sequelize[_0x986b('0x2')]},'alias':{'type':Sequelize[_0x986b('0x3')]},'function':{'type':Sequelize[_0x986b('0x3')]},'format':{'type':Sequelize[_0x986b('0x3')]},'groupBy':{'type':Sequelize[_0x986b('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x986b('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x15b3=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15b3,0x1a3));var _0x315b=function(_0x5ae82c,_0x13bf1f){_0x5ae82c=_0x5ae82c-0x0;var _0x49c659=_0x15b3[_0x5ae82c];return _0x49c659;};'use strict';var Sequelize=require(_0x315b('0x0'));module[_0x315b('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x315b('0x2')]},'function':{'type':Sequelize[_0x315b('0x2')]},'format':{'type':Sequelize[_0x315b('0x2')]},'groupBy':{'type':Sequelize[_0x315b('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x315b('0x2')]},'custom':{'type':Sequelize[_0x315b('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index a5fba11..49a3b54 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 _0xc73a=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','bulkCreate','update','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','filters'];(function(_0x2556fb,_0x2027f6){var _0x164c31=function(_0x28cc5e){while(--_0x28cc5e){_0x2556fb['push'](_0x2556fb['shift']());}};_0x164c31(++_0x2027f6);}(_0xc73a,0x72));var _0xac73=function(_0x2a0721,_0x3f002a){_0x2a0721=_0x2a0721-0x0;var _0x2a2148=_0xc73a[_0x2a0721];return _0x2a2148;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac73('0x0'));var zipdir=require(_0xac73('0x1'));var jsonpatch=require(_0xac73('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xac73('0x3'));var Mustache=require(_0xac73('0x4'));var util=require(_0xac73('0x5'));var path=require('path');var sox=require(_0xac73('0x6'));var csv=require(_0xac73('0x7'));var ejs=require(_0xac73('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac73('0x9'));var squel=require(_0xac73('0xa'));var crypto=require(_0xac73('0xb'));var jsforce=require(_0xac73('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xac73('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xac73('0xd'));var authService=require(_0xac73('0xe'));var qs=require(_0xac73('0xf'));var as=require(_0xac73('0x10'));var hardwareService=require(_0xac73('0x11'));var logger=require(_0xac73('0x12'))(_0xac73('0x13'));var utils=require(_0xac73('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac73('0x15'));var db=require(_0xac73('0x16'))['db'];function respondWithStatusCode(_0x40d791,_0x7b4ade){_0x7b4ade=_0x7b4ade||0xcc;return function(_0x3caaa2){if(_0x3caaa2){return _0x40d791[_0xac73('0x17')](_0x7b4ade);}return _0x40d791['status'](_0x7b4ade)[_0xac73('0x18')]();};}function respondWithResult(_0x54a0fa,_0x3b8c56){_0x3b8c56=_0x3b8c56||0xc8;return function(_0x2e6c17){if(_0x2e6c17){return _0x54a0fa[_0xac73('0x19')](_0x3b8c56)[_0xac73('0x1a')](_0x2e6c17);}};}function respondWithFilteredResult(_0x5579e1,_0x113430){return function(_0x1466ca){if(_0x1466ca){var _0x518a0d=typeof _0x113430[_0xac73('0x1b')]===_0xac73('0x1c')&&typeof _0x113430[_0xac73('0x1d')]==='undefined';var _0x1120ce=_0x1466ca[_0xac73('0x1e')];var _0x20fb6f=_0x518a0d?0x0:_0x113430[_0xac73('0x1b')];var _0x3b6044=_0x518a0d?_0x1466ca['count']:_0x113430[_0xac73('0x1b')]+_0x113430[_0xac73('0x1d')];var _0x4d137f;if(_0x3b6044>=_0x1120ce){_0x3b6044=_0x1120ce;_0x4d137f=0xc8;}else{_0x4d137f=0xce;}_0x5579e1[_0xac73('0x19')](_0x4d137f);return _0x5579e1[_0xac73('0x1f')](_0xac73('0x20'),_0x20fb6f+'-'+_0x3b6044+'/'+_0x1120ce)[_0xac73('0x1a')](_0x1466ca);}return null;};}function patchUpdates(_0x102a02){return function(_0xeef7ea){try{jsonpatch[_0xac73('0x21')](_0xeef7ea,_0x102a02,!![]);}catch(_0xa07af0){return BPromise[_0xac73('0x22')](_0xa07af0);}return _0xeef7ea['save']();};}function saveUpdates(_0x999f70,_0x1c42ff){return function(_0x3b2c93){if(_0x3b2c93){return _0x3b2c93['update'](_0x999f70)[_0xac73('0x23')](function(_0x4998aa){return _0x4998aa;});}return null;};}function removeEntity(_0xc7791d,_0x1a3b6f){return function(_0x1522ac){if(_0x1522ac){return _0x1522ac[_0xac73('0x24')]()[_0xac73('0x23')](function(){_0xc7791d[_0xac73('0x19')](0xcc)[_0xac73('0x18')]();});}};}function handleEntityNotFound(_0x4df196,_0xc76c54){return function(_0x3e9d1c){if(!_0x3e9d1c){_0x4df196[_0xac73('0x17')](0x194);}return _0x3e9d1c;};}function handleError(_0xeee382,_0x180b3e){_0x180b3e=_0x180b3e||0x1f4;return function(_0x2dcfa6){logger['error'](_0x2dcfa6[_0xac73('0x25')]);if(_0x2dcfa6[_0xac73('0x26')]){delete _0x2dcfa6[_0xac73('0x26')];}_0xeee382[_0xac73('0x19')](_0x180b3e)[_0xac73('0x27')](_0x2dcfa6);};}exports[_0xac73('0x28')]=function(_0x364429,_0x2bc336){var _0x35dd60={},_0x4bc16f={},_0xfc0e93={'count':0x0,'rows':[]};var _0x2bcfb5=_[_0xac73('0x29')](db[_0xac73('0x2a')][_0xac73('0x2b')],function(_0x459467){return{'name':_0x459467['fieldName'],'type':_0x459467[_0xac73('0x2c')][_0xac73('0x2d')]};});_0x4bc16f[_0xac73('0x2e')]=_[_0xac73('0x29')](_0x2bcfb5,'name');_0x4bc16f[_0xac73('0x2f')]=_[_0xac73('0x30')](_0x364429[_0xac73('0x2f')]);_0x4bc16f[_0xac73('0x31')]=_[_0xac73('0x32')](_0x4bc16f[_0xac73('0x2e')],_0x4bc16f[_0xac73('0x2f')]);_0x35dd60[_0xac73('0x33')]=_[_0xac73('0x32')](_0x4bc16f[_0xac73('0x2e')],qs[_0xac73('0x34')](_0x364429[_0xac73('0x2f')][_0xac73('0x34')]));_0x35dd60[_0xac73('0x33')]=_0x35dd60[_0xac73('0x33')][_0xac73('0x35')]?_0x35dd60[_0xac73('0x33')]:_0x4bc16f[_0xac73('0x2e')];if(!_0x364429['query'][_0xac73('0x36')](_0xac73('0x37'))){_0x35dd60[_0xac73('0x1d')]=qs['limit'](_0x364429['query'][_0xac73('0x1d')]);_0x35dd60['offset']=qs['offset'](_0x364429[_0xac73('0x2f')][_0xac73('0x1b')]);}_0x35dd60[_0xac73('0x38')]=qs[_0xac73('0x39')](_0x364429['query'][_0xac73('0x39')]);_0x35dd60['where']=qs[_0xac73('0x31')](_[_0xac73('0x3a')](_0x364429['query'],_0x4bc16f[_0xac73('0x31')]),_0x2bcfb5);if(_0x364429[_0xac73('0x2f')][_0xac73('0x3b')]){_0x35dd60[_0xac73('0x3c')]=_[_0xac73('0x3d')](_0x35dd60[_0xac73('0x3c')],{'$or':_[_0xac73('0x29')](_0x2bcfb5,function(_0x292f7b){if(_0x292f7b[_0xac73('0x2c')]!==_0xac73('0x3e')){var _0x49d6a9={};_0x49d6a9[_0x292f7b[_0xac73('0x26')]]={'$like':'%'+_0x364429['query'][_0xac73('0x3b')]+'%'};return _0x49d6a9;}})});}_0x35dd60=_['merge']({},_0x35dd60,_0x364429[_0xac73('0x3f')]);var _0x5e5eb8={'where':_0x35dd60[_0xac73('0x3c')]};return db[_0xac73('0x2a')]['count'](_0x5e5eb8)[_0xac73('0x23')](function(_0x1e4b90){_0xfc0e93['count']=_0x1e4b90;if(_0x364429['query']['includeAll']){_0x35dd60['include']=[{'all':!![]}];}return db[_0xac73('0x2a')]['findAll'](_0x35dd60);})['then'](function(_0x5287c4){_0xfc0e93[_0xac73('0x40')]=_0x5287c4;return _0xfc0e93;})[_0xac73('0x23')](respondWithFilteredResult(_0x2bc336,_0x35dd60))[_0xac73('0x41')](handleError(_0x2bc336,null));};exports[_0xac73('0x42')]=function(_0x542998,_0x5dab73){var _0x235947={'raw':![],'where':{'id':_0x542998[_0xac73('0x43')]['id']}},_0x3ed3c2={};_0x3ed3c2['model']=_[_0xac73('0x30')](db[_0xac73('0x2a')]['rawAttributes']);_0x3ed3c2[_0xac73('0x2f')]=_[_0xac73('0x30')](_0x542998[_0xac73('0x2f')]);_0x3ed3c2[_0xac73('0x31')]=_['intersection'](_0x3ed3c2[_0xac73('0x2e')],_0x3ed3c2[_0xac73('0x2f')]);_0x235947[_0xac73('0x33')]=_['intersection'](_0x3ed3c2[_0xac73('0x2e')],qs[_0xac73('0x34')](_0x542998[_0xac73('0x2f')][_0xac73('0x34')]));_0x235947['attributes']=_0x235947[_0xac73('0x33')][_0xac73('0x35')]?_0x235947['attributes']:_0x3ed3c2[_0xac73('0x2e')];if(_0x542998[_0xac73('0x2f')][_0xac73('0x44')]){_0x235947[_0xac73('0x45')]=[{'all':!![]}];}_0x235947=_[_0xac73('0x3d')]({},_0x235947,_0x542998['options']);return db[_0xac73('0x2a')][_0xac73('0x46')](_0x235947)['then'](handleEntityNotFound(_0x5dab73,null))[_0xac73('0x23')](respondWithResult(_0x5dab73,null))[_0xac73('0x41')](handleError(_0x5dab73,null));};exports[_0xac73('0x47')]=function(_0x37b818,_0x463ebe){return db[_0xac73('0x2a')]['create'](_0x37b818[_0xac73('0x48')],{})[_0xac73('0x23')](respondWithResult(_0x463ebe,0xc9))[_0xac73('0x41')](handleError(_0x463ebe,null));};exports['bulkCreate']=function(_0x1bb6d2,_0x527650){return db[_0xac73('0x2a')][_0xac73('0x49')](_0x1bb6d2['body'],{'raw':![],'individualHooks':!![]})[_0xac73('0x23')](respondWithResult(_0x527650,0xc9))['catch'](handleError(_0x527650,null));};exports[_0xac73('0x4a')]=function(_0x5cf61b,_0x62c8d8){if(_0x5cf61b[_0xac73('0x48')]['id']){delete _0x5cf61b[_0xac73('0x48')]['id'];}return db[_0xac73('0x2a')][_0xac73('0x46')]({'where':{'id':_0x5cf61b['params']['id']}})[_0xac73('0x23')](handleEntityNotFound(_0x62c8d8,null))[_0xac73('0x23')](saveUpdates(_0x5cf61b['body'],null))[_0xac73('0x23')](respondWithResult(_0x62c8d8,null))[_0xac73('0x41')](handleError(_0x62c8d8,null));};exports[_0xac73('0x24')]=function(_0x2ece77,_0x52917b){return db['AnalyticFieldReport'][_0xac73('0x46')]({'where':{'id':_0x2ece77[_0xac73('0x43')]['id']}})[_0xac73('0x23')](handleEntityNotFound(_0x52917b,null))[_0xac73('0x23')](removeEntity(_0x52917b,null))[_0xac73('0x41')](handleError(_0x52917b,null));};exports[_0xac73('0x4b')]=function(_0x1fa693,_0x44509c){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x1fa693[_0xac73('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xac73('0x23')](respondWithResult(_0x44509c,0xcc))[_0xac73('0x41')](handleError(_0x44509c,null));};exports[_0xac73('0x4c')]=function(_0x3666ce,_0x298540,_0x459cb4){return db[_0xac73('0x4d')]['findOne']({'where':{'id':_0x3666ce[_0xac73('0x43')]['id']}})[_0xac73('0x23')](handleEntityNotFound(_0x298540,null))['then'](function(_0x5b3dda){if(_0x5b3dda){return db[_0xac73('0x4e')][_0xac73('0x4f')](function(_0x4629c0){return db[_0xac73('0x2a')]['destroy']({'where':{'CustomReportId':_0x3666ce['params']['id']},'transaction':_0x4629c0})['then'](function(_0x24e55d){var _0x56e971=_[_0xac73('0x29')](_0x3666ce[_0xac73('0x48')],function(_0x3e608){delete _0x3e608['id'];_0x3e608[_0xac73('0x50')]=_0x3666ce[_0xac73('0x43')]['id'];return _0x3e608;});return db[_0xac73('0x2a')][_0xac73('0x49')](_0x56e971,{'transaction':_0x4629c0});});})[_0xac73('0x23')](function(){return db[_0xac73('0x2a')][_0xac73('0x51')]({'where':{'CustomReportId':_0x3666ce[_0xac73('0x43')]['id']}});});}})['then'](respondWithResult(_0x298540,null))[_0xac73('0x41')](handleError(_0x298540,null));};
\ No newline at end of file
+var _0x087a=['moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','set','apply','reject','save','update','then','destroy','error','send','index','map','AnalyticFieldReport','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','options','create','bulkCreate','body','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','rimraf','fast-json-patch','request-promise'];(function(_0x1c6a18,_0x518dc7){var _0x14a8c4=function(_0x3e1250){while(--_0x3e1250){_0x1c6a18['push'](_0x1c6a18['shift']());}};_0x14a8c4(++_0x518dc7);}(_0x087a,0x14d));var _0xa087=function(_0x4b38d1,_0x497bc8){_0x4b38d1=_0x4b38d1-0x0;var _0x267a11=_0x087a[_0x4b38d1];return _0x267a11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa087('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa087('0x1'));var rp=require(_0xa087('0x2'));var moment=require(_0xa087('0x3'));var BPromise=require(_0xa087('0x4'));var Mustache=require(_0xa087('0x5'));var util=require('util');var path=require(_0xa087('0x6'));var sox=require(_0xa087('0x7'));var csv=require(_0xa087('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa087('0x9'));var _=require(_0xa087('0xa'));var squel=require(_0xa087('0xb'));var crypto=require(_0xa087('0xc'));var jsforce=require(_0xa087('0xd'));var deskjs=require(_0xa087('0xe'));var toCsv=require(_0xa087('0x8'));var querystring=require(_0xa087('0xf'));var Papa=require(_0xa087('0x10'));var Redis=require(_0xa087('0x11'));var authService=require(_0xa087('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa087('0x13'));var logger=require(_0xa087('0x14'))(_0xa087('0x15'));var utils=require(_0xa087('0x16'));var config=require(_0xa087('0x17'));var licenseUtil=require(_0xa087('0x18'));var db=require(_0xa087('0x19'))['db'];function respondWithStatusCode(_0x15e2af,_0x4dc418){_0x4dc418=_0x4dc418||0xcc;return function(_0x107676){if(_0x107676){return _0x15e2af[_0xa087('0x1a')](_0x4dc418);}return _0x15e2af['status'](_0x4dc418)['end']();};}function respondWithResult(_0x37d4db,_0x3a57d8){_0x3a57d8=_0x3a57d8||0xc8;return function(_0x1ffed6){if(_0x1ffed6){return _0x37d4db[_0xa087('0x1b')](_0x3a57d8)[_0xa087('0x1c')](_0x1ffed6);}};}function respondWithFilteredResult(_0x2ac460,_0x4a7e2d){return function(_0x565463){if(_0x565463){var _0x3c3e17=typeof _0x4a7e2d['offset']==='undefined'&&typeof _0x4a7e2d[_0xa087('0x1d')]==='undefined';var _0x3b5582=_0x565463[_0xa087('0x1e')];var _0x3ee04c=_0x3c3e17?0x0:_0x4a7e2d[_0xa087('0x1f')];var _0x1825f7=_0x3c3e17?_0x565463[_0xa087('0x1e')]:_0x4a7e2d[_0xa087('0x1f')]+_0x4a7e2d['limit'];var _0x5749d0;if(_0x1825f7>=_0x3b5582){_0x1825f7=_0x3b5582;_0x5749d0=0xc8;}else{_0x5749d0=0xce;}_0x2ac460['status'](_0x5749d0);return _0x2ac460[_0xa087('0x20')]('Content-Range',_0x3ee04c+'-'+_0x1825f7+'/'+_0x3b5582)[_0xa087('0x1c')](_0x565463);}return null;};}function patchUpdates(_0xa3689e){return function(_0x2c730a){try{jsonpatch[_0xa087('0x21')](_0x2c730a,_0xa3689e,!![]);}catch(_0x449e92){return BPromise[_0xa087('0x22')](_0x449e92);}return _0x2c730a[_0xa087('0x23')]();};}function saveUpdates(_0x57ae31,_0x2b6366){return function(_0x42ceb1){if(_0x42ceb1){return _0x42ceb1[_0xa087('0x24')](_0x57ae31)[_0xa087('0x25')](function(_0x16c740){return _0x16c740;});}return null;};}function removeEntity(_0x406df0,_0xa221c){return function(_0x28511c){if(_0x28511c){return _0x28511c[_0xa087('0x26')]()['then'](function(){_0x406df0[_0xa087('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20e724,_0x1429c7){return function(_0x151244){if(!_0x151244){_0x20e724[_0xa087('0x1a')](0x194);}return _0x151244;};}function handleError(_0x21cd83,_0x114008){_0x114008=_0x114008||0x1f4;return function(_0x43fdc7){logger[_0xa087('0x27')](_0x43fdc7['stack']);if(_0x43fdc7['name']){delete _0x43fdc7['name'];}_0x21cd83['status'](_0x114008)[_0xa087('0x28')](_0x43fdc7);};}exports[_0xa087('0x29')]=function(_0x3dc578,_0x48aff8){var _0x52ee10={},_0xbdbc40={},_0x2cb480={'count':0x0,'rows':[]};var _0x82b850=_[_0xa087('0x2a')](db[_0xa087('0x2b')]['rawAttributes'],function(_0x4afd5f){return{'name':_0x4afd5f[_0xa087('0x2c')],'type':_0x4afd5f[_0xa087('0x2d')][_0xa087('0x2e')]};});_0xbdbc40[_0xa087('0x2f')]=_[_0xa087('0x2a')](_0x82b850,_0xa087('0x30'));_0xbdbc40[_0xa087('0x31')]=_[_0xa087('0x32')](_0x3dc578[_0xa087('0x31')]);_0xbdbc40[_0xa087('0x33')]=_['intersection'](_0xbdbc40[_0xa087('0x2f')],_0xbdbc40['query']);_0x52ee10[_0xa087('0x34')]=_['intersection'](_0xbdbc40[_0xa087('0x2f')],qs[_0xa087('0x35')](_0x3dc578[_0xa087('0x31')]['fields']));_0x52ee10['attributes']=_0x52ee10['attributes'][_0xa087('0x36')]?_0x52ee10[_0xa087('0x34')]:_0xbdbc40[_0xa087('0x2f')];if(!_0x3dc578['query'][_0xa087('0x37')]('nolimit')){_0x52ee10[_0xa087('0x1d')]=qs['limit'](_0x3dc578['query']['limit']);_0x52ee10['offset']=qs[_0xa087('0x1f')](_0x3dc578['query'][_0xa087('0x1f')]);}_0x52ee10[_0xa087('0x38')]=qs[_0xa087('0x39')](_0x3dc578['query']['sort']);_0x52ee10[_0xa087('0x3a')]=qs[_0xa087('0x33')](_[_0xa087('0x3b')](_0x3dc578[_0xa087('0x31')],_0xbdbc40[_0xa087('0x33')]),_0x82b850);if(_0x3dc578[_0xa087('0x31')]['filter']){_0x52ee10[_0xa087('0x3a')]=_[_0xa087('0x3c')](_0x52ee10[_0xa087('0x3a')],{'$or':_[_0xa087('0x2a')](_0x82b850,function(_0x5d39cc){if(_0x5d39cc[_0xa087('0x2d')]!==_0xa087('0x3d')){var _0x40d58b={};_0x40d58b[_0x5d39cc['name']]={'$like':'%'+_0x3dc578[_0xa087('0x31')][_0xa087('0x3e')]+'%'};return _0x40d58b;}})});}_0x52ee10=_[_0xa087('0x3c')]({},_0x52ee10,_0x3dc578['options']);var _0x5634f5={'where':_0x52ee10[_0xa087('0x3a')]};return db[_0xa087('0x2b')][_0xa087('0x1e')](_0x5634f5)[_0xa087('0x25')](function(_0x1e40cf){_0x2cb480[_0xa087('0x1e')]=_0x1e40cf;if(_0x3dc578[_0xa087('0x31')][_0xa087('0x3f')]){_0x52ee10[_0xa087('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa087('0x41')](_0x52ee10);})[_0xa087('0x25')](function(_0x43dcae){_0x2cb480[_0xa087('0x42')]=_0x43dcae;return _0x2cb480;})[_0xa087('0x25')](respondWithFilteredResult(_0x48aff8,_0x52ee10))[_0xa087('0x43')](handleError(_0x48aff8,null));};exports[_0xa087('0x44')]=function(_0x420acd,_0x49a93d){var _0x147e9a={'raw':![],'where':{'id':_0x420acd['params']['id']}},_0x503811={};_0x503811[_0xa087('0x2f')]=_[_0xa087('0x32')](db[_0xa087('0x2b')][_0xa087('0x45')]);_0x503811[_0xa087('0x31')]=_[_0xa087('0x32')](_0x420acd['query']);_0x503811[_0xa087('0x33')]=_[_0xa087('0x46')](_0x503811['model'],_0x503811[_0xa087('0x31')]);_0x147e9a[_0xa087('0x34')]=_[_0xa087('0x46')](_0x503811[_0xa087('0x2f')],qs[_0xa087('0x35')](_0x420acd[_0xa087('0x31')][_0xa087('0x35')]));_0x147e9a[_0xa087('0x34')]=_0x147e9a['attributes'][_0xa087('0x36')]?_0x147e9a[_0xa087('0x34')]:_0x503811[_0xa087('0x2f')];if(_0x420acd[_0xa087('0x31')][_0xa087('0x3f')]){_0x147e9a[_0xa087('0x40')]=[{'all':!![]}];}_0x147e9a=_['merge']({},_0x147e9a,_0x420acd[_0xa087('0x47')]);return db[_0xa087('0x2b')]['find'](_0x147e9a)[_0xa087('0x25')](handleEntityNotFound(_0x49a93d,null))[_0xa087('0x25')](respondWithResult(_0x49a93d,null))[_0xa087('0x43')](handleError(_0x49a93d,null));};exports[_0xa087('0x48')]=function(_0x21ac7e,_0x36f07e){return db['AnalyticFieldReport'][_0xa087('0x48')](_0x21ac7e['body'],{})[_0xa087('0x25')](respondWithResult(_0x36f07e,0xc9))[_0xa087('0x43')](handleError(_0x36f07e,null));};exports[_0xa087('0x49')]=function(_0x3f867a,_0x18fbdb){return db['AnalyticFieldReport'][_0xa087('0x49')](_0x3f867a[_0xa087('0x4a')],{'raw':![],'individualHooks':!![]})[_0xa087('0x25')](respondWithResult(_0x18fbdb,0xc9))['catch'](handleError(_0x18fbdb,null));};exports[_0xa087('0x24')]=function(_0x40c94e,_0x2ee1fb){if(_0x40c94e[_0xa087('0x4a')]['id']){delete _0x40c94e['body']['id'];}return db['AnalyticFieldReport'][_0xa087('0x4b')]({'where':{'id':_0x40c94e[_0xa087('0x4c')]['id']}})[_0xa087('0x25')](handleEntityNotFound(_0x2ee1fb,null))['then'](saveUpdates(_0x40c94e[_0xa087('0x4a')],null))[_0xa087('0x25')](respondWithResult(_0x2ee1fb,null))[_0xa087('0x43')](handleError(_0x2ee1fb,null));};exports[_0xa087('0x26')]=function(_0x416c1d,_0x1021e8){return db[_0xa087('0x2b')][_0xa087('0x4b')]({'where':{'id':_0x416c1d['params']['id']}})[_0xa087('0x25')](handleEntityNotFound(_0x1021e8,null))[_0xa087('0x25')](removeEntity(_0x1021e8,null))[_0xa087('0x43')](handleError(_0x1021e8,null));};exports[_0xa087('0x4d')]=function(_0x272580,_0x1c3e67){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x272580[_0xa087('0x31')][_0xa087('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xa087('0x25')](respondWithResult(_0x1c3e67,0xcc))[_0xa087('0x43')](handleError(_0x1c3e67,null));};exports[_0xa087('0x4f')]=function(_0x1081e2,_0x4e31ce,_0x4ad912){return db[_0xa087('0x50')]['findOne']({'where':{'id':_0x1081e2[_0xa087('0x4c')]['id']}})[_0xa087('0x25')](handleEntityNotFound(_0x4e31ce,null))[_0xa087('0x25')](function(_0x2fe894){if(_0x2fe894){return db[_0xa087('0x51')][_0xa087('0x52')](function(_0x1f3aa3){return db[_0xa087('0x2b')][_0xa087('0x26')]({'where':{'CustomReportId':_0x1081e2[_0xa087('0x4c')]['id']},'transaction':_0x1f3aa3})[_0xa087('0x25')](function(_0x4625c4){var _0x13f39a=_['map'](_0x1081e2[_0xa087('0x4a')],function(_0x1b2097){delete _0x1b2097['id'];_0x1b2097[_0xa087('0x53')]=_0x1081e2[_0xa087('0x4c')]['id'];return _0x1b2097;});return db[_0xa087('0x2b')][_0xa087('0x49')](_0x13f39a,{'transaction':_0x1f3aa3});});})['then'](function(){return db[_0xa087('0x2b')][_0xa087('0x41')]({'where':{'CustomReportId':_0x1081e2[_0xa087('0x4c')]['id']}});});}})[_0xa087('0x25')](respondWithResult(_0x4e31ce,null))[_0xa087('0x43')](handleError(_0x4e31ce,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 87ffe69..c8bf605 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 _0xfd85=['../../config/environment','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4b221c,_0x520afe){var _0x398e12=function(_0x50b575){while(--_0x50b575){_0x4b221c['push'](_0x4b221c['shift']());}};_0x398e12(++_0x520afe);}(_0xfd85,0x81));var _0x5fd8=function(_0x34e481,_0x1f0d05){_0x34e481=_0x34e481-0x0;var _0x195d01=_0xfd85[_0x34e481];return _0x195d01;};'use strict';var _=require('lodash');var util=require(_0x5fd8('0x0'));var logger=require(_0x5fd8('0x1'))(_0x5fd8('0x2'));var moment=require('moment');var BPromise=require(_0x5fd8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fd8('0x4'));var rimraf=require(_0x5fd8('0x5'));var config=require(_0x5fd8('0x6'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x12cb71,_0x5e532a){return _0x12cb71['define'](_0x5fd8('0x7'),attributes,{'tableName':_0x5fd8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a67=['bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment'];(function(_0x3111e5,_0x42f028){var _0x7df4d8=function(_0x365792){while(--_0x365792){_0x3111e5['push'](_0x3111e5['shift']());}};_0x7df4d8(++_0x42f028);}(_0x0a67,0x115));var _0x70a6=function(_0x4ba9b4,_0x52ab66){_0x4ba9b4=_0x4ba9b4-0x0;var _0x2adb67=_0x0a67[_0x4ba9b4];return _0x2adb67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x70a6('0x0'))(_0x70a6('0x1'));var moment=require(_0x70a6('0x2'));var BPromise=require(_0x70a6('0x3'));var rp=require(_0x70a6('0x4'));var fs=require('fs');var path=require(_0x70a6('0x5'));var rimraf=require(_0x70a6('0x6'));var config=require('../../config/environment');var attributes=require(_0x70a6('0x7'));module['exports']=function(_0x219b23,_0x95a633){return _0x219b23['define'](_0x70a6('0x8'),attributes,{'tableName':_0x70a6('0x9'),'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 4695db8..9fa6f74 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 _0x2e17=['error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2e17,0x98));var _0x72e1=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x2e17[_0x4bb581];return _0x316bf5;};'use strict';var _=require(_0x72e1('0x0'));var util=require(_0x72e1('0x1'));var moment=require('moment');var BPromise=require(_0x72e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72e1('0x3'));var db=require(_0x72e1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x72e1('0x5'))(_0x72e1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72e1('0x7'));var client=jayson['client'][_0x72e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fe2f1,_0x3216fc,_0x5166d5){return new BPromise(function(_0x4fc481,_0x4a90e4){return client[_0x72e1('0x9')](_0x2fe2f1,_0x5166d5)['then'](function(_0x256ac9){logger[_0x72e1('0xa')](_0x72e1('0xb'),_0x3216fc,'request\x20sent');logger[_0x72e1('0xc')](_0x72e1('0xd'),_0x3216fc,_0x72e1('0xe'),JSON[_0x72e1('0xf')](_0x256ac9));if(_0x256ac9['error']){if(_0x256ac9[_0x72e1('0x10')][_0x72e1('0x11')]===0x1f4){logger[_0x72e1('0x10')](_0x72e1('0xb'),_0x3216fc,_0x256ac9[_0x72e1('0x10')]['message']);return _0x4a90e4(_0x256ac9[_0x72e1('0x10')][_0x72e1('0x12')]);}logger[_0x72e1('0x10')](_0x72e1('0xb'),_0x3216fc,_0x256ac9[_0x72e1('0x10')][_0x72e1('0x12')]);return _0x4fc481(_0x256ac9[_0x72e1('0x10')][_0x72e1('0x12')]);}else{logger[_0x72e1('0xa')](_0x72e1('0xb'),_0x3216fc,_0x72e1('0xe'));_0x4fc481(_0x256ac9[_0x72e1('0x13')][_0x72e1('0x12')]);}})[_0x72e1('0x14')](function(_0x3747b5){logger[_0x72e1('0x10')](_0x72e1('0xb'),_0x3216fc,_0x3747b5);_0x4a90e4(_0x3747b5);});});}
\ No newline at end of file
+var _0xc4fc=['../../config/utils','../../config/logger','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x419ffd,_0x10bdfe){var _0xb0b19d=function(_0x335815){while(--_0x335815){_0x419ffd['push'](_0x419ffd['shift']());}};_0xb0b19d(++_0x10bdfe);}(_0xc4fc,0x68));var _0xcc4f=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xc4fc[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xcc4f('0x0'));var util=require(_0xcc4f('0x1'));var moment=require(_0xcc4f('0x2'));var BPromise=require(_0xcc4f('0x3'));var rs=require(_0xcc4f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc4f('0x5'))['db'];var utils=require(_0xcc4f('0x6'));var logger=require(_0xcc4f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcc4f('0x8'));var client=jayson['client'][_0xcc4f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319362,_0x2fc72c,_0xbc368c){return new BPromise(function(_0x2e71a0,_0x127872){return client[_0xcc4f('0xa')](_0x319362,_0xbc368c)[_0xcc4f('0xb')](function(_0x3ea200){logger[_0xcc4f('0xc')](_0xcc4f('0xd'),_0x2fc72c,_0xcc4f('0xe'));logger[_0xcc4f('0xf')](_0xcc4f('0x10'),_0x2fc72c,_0xcc4f('0xe'),JSON['stringify'](_0x3ea200));if(_0x3ea200[_0xcc4f('0x11')]){if(_0x3ea200['error'][_0xcc4f('0x12')]===0x1f4){logger[_0xcc4f('0x11')](_0xcc4f('0xd'),_0x2fc72c,_0x3ea200['error'][_0xcc4f('0x13')]);return _0x127872(_0x3ea200[_0xcc4f('0x11')][_0xcc4f('0x13')]);}logger[_0xcc4f('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2fc72c,_0x3ea200[_0xcc4f('0x11')]['message']);return _0x2e71a0(_0x3ea200[_0xcc4f('0x11')][_0xcc4f('0x13')]);}else{logger[_0xcc4f('0xc')](_0xcc4f('0xd'),_0x2fc72c,_0xcc4f('0xe'));_0x2e71a0(_0x3ea200[_0xcc4f('0x14')][_0xcc4f('0x13')]);}})[_0xcc4f('0x15')](function(_0x2a3a7f){logger[_0xcc4f('0x11')](_0xcc4f('0xd'),_0x2fc72c,_0x2a3a7f);_0x127872(_0x2a3a7f);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0419366..b7c4043 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(_0x229fe9,_0x1b6252){var _0x184b49=function(_0x59b07e){while(--_0x59b07e){_0x229fe9['push'](_0x229fe9['shift']());}};_0x184b49(++_0x1b6252);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x9209e6,_0x22950b){var _0x15832a=function(_0x568ae9){while(--_0x568ae9){_0x9209e6['push'](_0x9209e6['shift']());}};_0x15832a(++_0x22950b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 90d79e3..accdf24 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x608a=['exports','STRING','TEXT'];(function(_0x2bcb76,_0x1fc42e){var _0x4c4301=function(_0x578c38){while(--_0x578c38){_0x2bcb76['push'](_0x2bcb76['shift']());}};_0x4c4301(++_0x1fc42e);}(_0x608a,0xff));var _0xa608=function(_0x230e44,_0x30918f){_0x230e44=_0x230e44-0x0;var _0x380c4f=_0x608a[_0x230e44];return _0x380c4f;};'use strict';var Sequelize=require('sequelize');module[_0xa608('0x0')]={'name':{'type':Sequelize[_0xa608('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xa608('0x1')]},'metric':{'type':Sequelize[_0xa608('0x2')]},'description':{'type':Sequelize[_0xa608('0x1')]}};
\ No newline at end of file
+var _0x0713=['TEXT','STRING','name'];(function(_0x3162fa,_0x5091bc){var _0x37373c=function(_0x3fa1aa){while(--_0x3fa1aa){_0x3162fa['push'](_0x3162fa['shift']());}};_0x37373c(++_0x5091bc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'table':{'type':Sequelize[_0x3071('0x0')]},'metric':{'type':Sequelize[_0x3071('0x2')]},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 59c4345..bcdf7c2 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x295fee,_0x4463ae){var _0x4fc9bc=function(_0x44a702){while(--_0x44a702){_0x295fee['push'](_0x295fee['shift']());}};_0x4fc9bc(++_0x4463ae);}(_0xdc97,0x13b));var _0x7dc9=function(_0x40b199,_0x589b94){_0x40b199=_0x40b199-0x0;var _0x419220=_0xdc97[_0x40b199];return _0x419220;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0xd08f2b,_0x5d07d0){var _0x59f815=function(_0x2f4eee){while(--_0x2f4eee){_0xd08f2b['push'](_0xd08f2b['shift']());}};_0x59f815(++_0x5d07d0);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x134438,_0x21045a){_0x134438=_0x134438-0x0;var _0x2899ea=_0xd6d6[_0x134438];return _0x2899ea;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index fb677f7..e678985 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 _0x4cc7=['exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes'];(function(_0x3e52f9,_0x5a96b9){var _0x22075e=function(_0x4cbbf8){while(--_0x4cbbf8){_0x3e52f9['push'](_0x3e52f9['shift']());}};_0x22075e(++_0x5a96b9);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x304411,_0x1c8764){_0x304411=_0x304411-0x0;var _0x5c3bad=_0x4cc7[_0x304411];return _0x5c3bad;};'use strict';var _=require(_0x74cc('0x0'));var util=require(_0x74cc('0x1'));var logger=require(_0x74cc('0x2'))(_0x74cc('0x3'));var moment=require(_0x74cc('0x4'));var BPromise=require(_0x74cc('0x5'));var rp=require(_0x74cc('0x6'));var fs=require('fs');var path=require(_0x74cc('0x7'));var rimraf=require('rimraf');var config=require(_0x74cc('0x8'));var attributes=require(_0x74cc('0x9'));module[_0x74cc('0xa')]=function(_0x3b5d01,_0x225d38){return _0x3b5d01[_0x74cc('0xb')](_0x74cc('0xc'),attributes,{'tableName':_0x74cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2975=['AnalyticMetric','analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','./analyticMetric.attributes','exports','define'];(function(_0x1f75ff,_0x7f2e60){var _0x2191de=function(_0x5ef6ac){while(--_0x5ef6ac){_0x1f75ff['push'](_0x1f75ff['shift']());}};_0x2191de(++_0x7f2e60);}(_0x2975,0x1c5));var _0x5297=function(_0x42a8d5,_0x33cf93){_0x42a8d5=_0x42a8d5-0x0;var _0x515da6=_0x2975[_0x42a8d5];return _0x515da6;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var logger=require(_0x5297('0x1'))(_0x5297('0x2'));var moment=require(_0x5297('0x3'));var BPromise=require(_0x5297('0x4'));var rp=require(_0x5297('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5297('0x6'));module[_0x5297('0x7')]=function(_0x11a43d,_0x3da9c6){return _0x11a43d[_0x5297('0x8')](_0x5297('0x9'),attributes,{'tableName':_0x5297('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index ccf2618..9fe1fee 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 _0x5eb5=['http','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x449edf,_0x178ff9){var _0x55dda0=function(_0x23e4fb){while(--_0x23e4fb){_0x449edf['push'](_0x449edf['shift']());}};_0x55dda0(++_0x178ff9);}(_0x5eb5,0x1d8));var _0x55eb=function(_0x298c93,_0x770694){_0x298c93=_0x298c93-0x0;var _0xca5ea3=_0x5eb5[_0x298c93];return _0xca5ea3;};'use strict';var _=require(_0x55eb('0x0'));var util=require(_0x55eb('0x1'));var moment=require(_0x55eb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55eb('0x3'));var db=require(_0x55eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x55eb('0x5'))(_0x55eb('0x6'));var config=require('../../config/environment');var jayson=require(_0x55eb('0x7'));var client=jayson['client'][_0x55eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e88f9,_0x1c20c7,_0x460aef){return new BPromise(function(_0x1b5cab,_0x3ee400){return client[_0x55eb('0x9')](_0x1e88f9,_0x460aef)[_0x55eb('0xa')](function(_0x1a6f4d){logger[_0x55eb('0xb')](_0x55eb('0xc'),_0x1c20c7,'request\x20sent');logger['debug'](_0x55eb('0xd'),_0x1c20c7,_0x55eb('0xe'),JSON[_0x55eb('0xf')](_0x1a6f4d));if(_0x1a6f4d[_0x55eb('0x10')]){if(_0x1a6f4d['error'][_0x55eb('0x11')]===0x1f4){logger[_0x55eb('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x1c20c7,_0x1a6f4d[_0x55eb('0x10')]['message']);return _0x3ee400(_0x1a6f4d[_0x55eb('0x10')][_0x55eb('0x12')]);}logger['error'](_0x55eb('0xc'),_0x1c20c7,_0x1a6f4d[_0x55eb('0x10')]['message']);return _0x1b5cab(_0x1a6f4d[_0x55eb('0x10')][_0x55eb('0x12')]);}else{logger[_0x55eb('0xb')](_0x55eb('0xc'),_0x1c20c7,_0x55eb('0xe'));_0x1b5cab(_0x1a6f4d[_0x55eb('0x13')]['message']);}})['catch'](function(_0x53cea5){logger['error'](_0x55eb('0xc'),_0x1c20c7,_0x53cea5);_0x3ee400(_0x53cea5);});});}
\ No newline at end of file
+var _0xc330=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x270cd0,_0x50e6ff){var _0x542885=function(_0x27e1e7){while(--_0x27e1e7){_0x270cd0['push'](_0x270cd0['shift']());}};_0x542885(++_0x50e6ff);}(_0xc330,0xce));var _0x0c33=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xc330[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x0c33('0x0'));var util=require(_0x0c33('0x1'));var moment=require(_0x0c33('0x2'));var BPromise=require(_0x0c33('0x3'));var rs=require(_0x0c33('0x4'));var fs=require('fs');var Redis=require(_0x0c33('0x5'));var db=require(_0x0c33('0x6'))['db'];var utils=require(_0x0c33('0x7'));var logger=require(_0x0c33('0x8'))(_0x0c33('0x9'));var config=require('../../config/environment');var jayson=require(_0x0c33('0xa'));var client=jayson[_0x0c33('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd6d35a,_0x14a494,_0x30126c){return new BPromise(function(_0x145d74,_0xf291d9){return client['request'](_0xd6d35a,_0x30126c)[_0x0c33('0xc')](function(_0x8ce72c){logger['info'](_0x0c33('0xd'),_0x14a494,_0x0c33('0xe'));logger[_0x0c33('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x14a494,_0x0c33('0xe'),JSON[_0x0c33('0x10')](_0x8ce72c));if(_0x8ce72c[_0x0c33('0x11')]){if(_0x8ce72c['error'][_0x0c33('0x12')]===0x1f4){logger[_0x0c33('0x11')](_0x0c33('0xd'),_0x14a494,_0x8ce72c['error']['message']);return _0xf291d9(_0x8ce72c[_0x0c33('0x11')][_0x0c33('0x13')]);}logger[_0x0c33('0x11')](_0x0c33('0xd'),_0x14a494,_0x8ce72c[_0x0c33('0x11')][_0x0c33('0x13')]);return _0x145d74(_0x8ce72c[_0x0c33('0x11')][_0x0c33('0x13')]);}else{logger[_0x0c33('0x14')](_0x0c33('0xd'),_0x14a494,_0x0c33('0xe'));_0x145d74(_0x8ce72c[_0x0c33('0x15')][_0x0c33('0x13')]);}})[_0x0c33('0x16')](function(_0x5e65a3){logger[_0x0c33('0x11')](_0x0c33('0xd'),_0x14a494,_0x5e65a3);_0xf291d9(_0x5e65a3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 49e8491..2c300b0 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 _0x3f27=['/:id','post','create','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index'];(function(_0x54bd7a,_0x2a868e){var _0x54c89b=function(_0x296f21){while(--_0x296f21){_0x54bd7a['push'](_0x54bd7a['shift']());}};_0x54c89b(++_0x2a868e);}(_0x3f27,0x1f4));var _0x73f2=function(_0x1672b6,_0x4a11ad){_0x1672b6=_0x1672b6-0x0;var _0x121be7=_0x3f27[_0x1672b6];return _0x121be7;};'use strict';var multer=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var path=require(_0x73f2('0x2'));var timeout=require(_0x73f2('0x3'));var express=require(_0x73f2('0x4'));var router=express['Router']();var fs_extra=require(_0x73f2('0x5'));var auth=require(_0x73f2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x73f2('0x7')]('/',auth[_0x73f2('0x8')](),controller[_0x73f2('0x9')]);router[_0x73f2('0x7')](_0x73f2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x73f2('0xb')]('/',auth[_0x73f2('0x8')](),controller[_0x73f2('0xc')]);router[_0x73f2('0xd')](_0x73f2('0xa'),auth[_0x73f2('0x8')](),controller['update']);router[_0x73f2('0xe')](_0x73f2('0xa'),auth[_0x73f2('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x56da=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b5b76,_0x213610){var _0x5abd7c=function(_0x2c06dd){while(--_0x2c06dd){_0x4b5b76['push'](_0x4b5b76['shift']());}};_0x5abd7c(++_0x213610);}(_0x56da,0x119));var _0xa56d=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0x56da[_0x46e523];return _0x5da0ee;};'use strict';var multer=require(_0xa56d('0x0'));var util=require('util');var path=require(_0xa56d('0x1'));var timeout=require(_0xa56d('0x2'));var express=require('express');var router=express[_0xa56d('0x3')]();var fs_extra=require(_0xa56d('0x4'));var auth=require(_0xa56d('0x5'));var interaction=require(_0xa56d('0x6'));var config=require(_0xa56d('0x7'));var controller=require(_0xa56d('0x8'));router[_0xa56d('0x9')]('/',auth[_0xa56d('0xa')](),controller[_0xa56d('0xb')]);router[_0xa56d('0x9')](_0xa56d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa56d('0xd')]('/',auth[_0xa56d('0xa')](),controller[_0xa56d('0xe')]);router[_0xa56d('0xf')](_0xa56d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa56d('0x10')](_0xa56d('0xc'),auth[_0xa56d('0xa')](),controller['destroy']);module[_0xa56d('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 9273068..76009b2 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 _0xddbc=['TEXT','sequelize','exports'];(function(_0x34a9fe,_0x5cf50b){var _0x443985=function(_0x23e027){while(--_0x23e027){_0x34a9fe['push'](_0x34a9fe['shift']());}};_0x443985(++_0x5cf50b);}(_0xddbc,0xe2));var _0xcddb=function(_0x4cdbb8,_0x278779){_0x4cdbb8=_0x4cdbb8-0x0;var _0x24beca=_0xddbc[_0x4cdbb8];return _0x24beca;};'use strict';var Sequelize=require(_0xcddb('0x0'));module[_0xcddb('0x1')]={'tree':{'type':Sequelize[_0xcddb('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x09e1=['TEXT','sequelize'];(function(_0x10bea5,_0x3b9545){var _0x4a241b=function(_0xd5d5a9){while(--_0xd5d5a9){_0x10bea5['push'](_0x10bea5['shift']());}};_0x4a241b(++_0x3b9545);}(_0x09e1,0x9d));var _0x109e=function(_0x1e0aee,_0x3b7a1d){_0x1e0aee=_0x1e0aee-0x0;var _0x478c48=_0x09e1[_0x1e0aee];return _0x478c48;};'use strict';var Sequelize=require(_0x109e('0x0'));module['exports']={'tree':{'type':Sequelize[_0x109e('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 92f34e4..fc619a1 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 _0xe626=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','sendStatus','error','name','send','index','map','AnalyticTreeReport','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','type','VIRTUAL','merge','rows','catch','show','params','keys','includeAll','options','create','body','find','destroy'];(function(_0x42cc58,_0x5a4760){var _0x5ca9cb=function(_0xf46e9b){while(--_0xf46e9b){_0x42cc58['push'](_0x42cc58['shift']());}};_0x5ca9cb(++_0x5a4760);}(_0xe626,0x11c));var _0x6e62=function(_0x7bd00e,_0x152f4a){_0x7bd00e=_0x7bd00e-0x0;var _0x2fff89=_0xe626[_0x7bd00e];return _0x2fff89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e62('0x0'));var zipdir=require(_0x6e62('0x1'));var jsonpatch=require(_0x6e62('0x2'));var rp=require(_0x6e62('0x3'));var moment=require('moment');var BPromise=require(_0x6e62('0x4'));var Mustache=require(_0x6e62('0x5'));var util=require(_0x6e62('0x6'));var path=require(_0x6e62('0x7'));var sox=require(_0x6e62('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e62('0x9'));var _=require(_0x6e62('0xa'));var squel=require(_0x6e62('0xb'));var crypto=require(_0x6e62('0xc'));var jsforce=require(_0x6e62('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6e62('0xe'));var querystring=require(_0x6e62('0xf'));var Papa=require(_0x6e62('0x10'));var Redis=require(_0x6e62('0x11'));var authService=require(_0x6e62('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6e62('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e62('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6e62('0x15'))['db'];function respondWithStatusCode(_0x24ca8a,_0x181a7c){_0x181a7c=_0x181a7c||0xcc;return function(_0x51308b){if(_0x51308b){return _0x24ca8a['sendStatus'](_0x181a7c);}return _0x24ca8a[_0x6e62('0x16')](_0x181a7c)[_0x6e62('0x17')]();};}function respondWithResult(_0x3932e2,_0x42aefc){_0x42aefc=_0x42aefc||0xc8;return function(_0x37548e){if(_0x37548e){return _0x3932e2[_0x6e62('0x16')](_0x42aefc)[_0x6e62('0x18')](_0x37548e);}};}function respondWithFilteredResult(_0x5c8d73,_0x48b58b){return function(_0x1ff785){if(_0x1ff785){var _0x3dcaff=typeof _0x48b58b['offset']==='undefined'&&typeof _0x48b58b['limit']===_0x6e62('0x19');var _0x57f332=_0x1ff785[_0x6e62('0x1a')];var _0x3b69d3=_0x3dcaff?0x0:_0x48b58b[_0x6e62('0x1b')];var _0x291846=_0x3dcaff?_0x1ff785[_0x6e62('0x1a')]:_0x48b58b[_0x6e62('0x1b')]+_0x48b58b['limit'];var _0x100716;if(_0x291846>=_0x57f332){_0x291846=_0x57f332;_0x100716=0xc8;}else{_0x100716=0xce;}_0x5c8d73[_0x6e62('0x16')](_0x100716);return _0x5c8d73[_0x6e62('0x1c')](_0x6e62('0x1d'),_0x3b69d3+'-'+_0x291846+'/'+_0x57f332)[_0x6e62('0x18')](_0x1ff785);}return null;};}function patchUpdates(_0x1a18bd){return function(_0x32fe71){try{jsonpatch['apply'](_0x32fe71,_0x1a18bd,!![]);}catch(_0x39f44c){return BPromise[_0x6e62('0x1e')](_0x39f44c);}return _0x32fe71[_0x6e62('0x1f')]();};}function saveUpdates(_0x536fa9,_0x15bc9a){return function(_0x434d5f){if(_0x434d5f){return _0x434d5f[_0x6e62('0x20')](_0x536fa9)[_0x6e62('0x21')](function(_0x4cfc70){return _0x4cfc70;});}return null;};}function removeEntity(_0x1d135a,_0x35c2fa){return function(_0x5c3b4c){if(_0x5c3b4c){return _0x5c3b4c['destroy']()[_0x6e62('0x21')](function(){_0x1d135a[_0x6e62('0x16')](0xcc)[_0x6e62('0x17')]();});}};}function handleEntityNotFound(_0x27882b,_0x3bff71){return function(_0x475b90){if(!_0x475b90){_0x27882b[_0x6e62('0x22')](0x194);}return _0x475b90;};}function handleError(_0x46bfd1,_0x367a74){_0x367a74=_0x367a74||0x1f4;return function(_0x25235c){logger[_0x6e62('0x23')](_0x25235c['stack']);if(_0x25235c[_0x6e62('0x24')]){delete _0x25235c[_0x6e62('0x24')];}_0x46bfd1[_0x6e62('0x16')](_0x367a74)[_0x6e62('0x25')](_0x25235c);};}exports[_0x6e62('0x26')]=function(_0x7089c6,_0xea04e9){var _0x842090={},_0x427803={},_0x4e3503={'count':0x0,'rows':[]};var _0x47155f=_[_0x6e62('0x27')](db[_0x6e62('0x28')][_0x6e62('0x29')],function(_0xbaeb1d){return{'name':_0xbaeb1d['fieldName'],'type':_0xbaeb1d['type'][_0x6e62('0x2a')]};});_0x427803['model']=_[_0x6e62('0x27')](_0x47155f,_0x6e62('0x24'));_0x427803[_0x6e62('0x2b')]=_['keys'](_0x7089c6[_0x6e62('0x2b')]);_0x427803[_0x6e62('0x2c')]=_[_0x6e62('0x2d')](_0x427803[_0x6e62('0x2e')],_0x427803[_0x6e62('0x2b')]);_0x842090[_0x6e62('0x2f')]=_[_0x6e62('0x2d')](_0x427803['model'],qs[_0x6e62('0x30')](_0x7089c6[_0x6e62('0x2b')]['fields']));_0x842090['attributes']=_0x842090[_0x6e62('0x2f')][_0x6e62('0x31')]?_0x842090[_0x6e62('0x2f')]:_0x427803[_0x6e62('0x2e')];if(!_0x7089c6[_0x6e62('0x2b')][_0x6e62('0x32')]('nolimit')){_0x842090[_0x6e62('0x33')]=qs[_0x6e62('0x33')](_0x7089c6['query'][_0x6e62('0x33')]);_0x842090[_0x6e62('0x1b')]=qs[_0x6e62('0x1b')](_0x7089c6[_0x6e62('0x2b')][_0x6e62('0x1b')]);}_0x842090[_0x6e62('0x34')]=qs[_0x6e62('0x35')](_0x7089c6[_0x6e62('0x2b')]['sort']);_0x842090['where']=qs[_0x6e62('0x2c')](_[_0x6e62('0x36')](_0x7089c6[_0x6e62('0x2b')],_0x427803[_0x6e62('0x2c')]),_0x47155f);if(_0x7089c6[_0x6e62('0x2b')][_0x6e62('0x37')]){_0x842090['where']=_['merge'](_0x842090[_0x6e62('0x38')],{'$or':_[_0x6e62('0x27')](_0x47155f,function(_0x2cc7bd){if(_0x2cc7bd[_0x6e62('0x39')]!==_0x6e62('0x3a')){var _0x528a00={};_0x528a00[_0x2cc7bd[_0x6e62('0x24')]]={'$like':'%'+_0x7089c6[_0x6e62('0x2b')]['filter']+'%'};return _0x528a00;}})});}_0x842090=_[_0x6e62('0x3b')]({},_0x842090,_0x7089c6['options']);var _0x3caeb4={'where':_0x842090[_0x6e62('0x38')]};return db[_0x6e62('0x28')]['count'](_0x3caeb4)[_0x6e62('0x21')](function(_0x1f2f1d){_0x4e3503[_0x6e62('0x1a')]=_0x1f2f1d;if(_0x7089c6[_0x6e62('0x2b')]['includeAll']){_0x842090['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x842090);})[_0x6e62('0x21')](function(_0x1d4452){_0x4e3503[_0x6e62('0x3c')]=_0x1d4452;return _0x4e3503;})['then'](respondWithFilteredResult(_0xea04e9,_0x842090))[_0x6e62('0x3d')](handleError(_0xea04e9,null));};exports[_0x6e62('0x3e')]=function(_0x279579,_0xc8b18e){var _0x2ff046={'raw':!![],'where':{'id':_0x279579[_0x6e62('0x3f')]['id']}},_0x1ece39={};_0x1ece39['model']=_[_0x6e62('0x40')](db[_0x6e62('0x28')][_0x6e62('0x29')]);_0x1ece39[_0x6e62('0x2b')]=_[_0x6e62('0x40')](_0x279579[_0x6e62('0x2b')]);_0x1ece39[_0x6e62('0x2c')]=_[_0x6e62('0x2d')](_0x1ece39[_0x6e62('0x2e')],_0x1ece39[_0x6e62('0x2b')]);_0x2ff046[_0x6e62('0x2f')]=_[_0x6e62('0x2d')](_0x1ece39[_0x6e62('0x2e')],qs[_0x6e62('0x30')](_0x279579[_0x6e62('0x2b')][_0x6e62('0x30')]));_0x2ff046['attributes']=_0x2ff046[_0x6e62('0x2f')][_0x6e62('0x31')]?_0x2ff046['attributes']:_0x1ece39[_0x6e62('0x2e')];if(_0x279579[_0x6e62('0x2b')][_0x6e62('0x41')]){_0x2ff046['include']=[{'all':!![]}];}_0x2ff046=_['merge']({},_0x2ff046,_0x279579[_0x6e62('0x42')]);return db[_0x6e62('0x28')]['find'](_0x2ff046)['then'](handleEntityNotFound(_0xc8b18e,null))[_0x6e62('0x21')](respondWithResult(_0xc8b18e,null))['catch'](handleError(_0xc8b18e,null));};exports[_0x6e62('0x43')]=function(_0x24c890,_0x2e0e7f){return db[_0x6e62('0x28')][_0x6e62('0x43')](_0x24c890[_0x6e62('0x44')],{})[_0x6e62('0x21')](respondWithResult(_0x2e0e7f,0xc9))[_0x6e62('0x3d')](handleError(_0x2e0e7f,null));};exports['update']=function(_0x4d09c2,_0x58e73b){if(_0x4d09c2['body']['id']){delete _0x4d09c2[_0x6e62('0x44')]['id'];}return db[_0x6e62('0x28')][_0x6e62('0x45')]({'where':{'id':_0x4d09c2[_0x6e62('0x3f')]['id']}})['then'](handleEntityNotFound(_0x58e73b,null))[_0x6e62('0x21')](saveUpdates(_0x4d09c2['body'],null))[_0x6e62('0x21')](respondWithResult(_0x58e73b,null))[_0x6e62('0x3d')](handleError(_0x58e73b,null));};exports[_0x6e62('0x46')]=function(_0x41783b,_0x2bb113){return db[_0x6e62('0x28')][_0x6e62('0x45')]({'where':{'id':_0x41783b[_0x6e62('0x3f')]['id']}})[_0x6e62('0x21')](handleEntityNotFound(_0x2bb113,null))['then'](removeEntity(_0x2bb113,null))[_0x6e62('0x3d')](handleError(_0x2bb113,null));};
\ No newline at end of file
+var _0xe25b=['lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','then','end','sendStatus','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','body','update','eml-format','zip-dir','moment','bluebird','mustache','path','ejs','fs-extra'];(function(_0x3d6395,_0x808e0){var _0x3f697e=function(_0x2bc7eb){while(--_0x2bc7eb){_0x3d6395['push'](_0x3d6395['shift']());}};_0x3f697e(++_0x808e0);}(_0xe25b,0x1cd));var _0xbe25=function(_0x448853,_0x858022){_0x448853=_0x448853-0x0;var _0x20b5b3=_0xe25b[_0x448853];return _0x20b5b3;};'use strict';var emlformat=require(_0xbe25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe25('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbe25('0x2'));var BPromise=require(_0xbe25('0x3'));var Mustache=require(_0xbe25('0x4'));var util=require('util');var path=require(_0xbe25('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbe25('0x6'));var fs=require('fs');var fs_extra=require(_0xbe25('0x7'));var _=require(_0xbe25('0x8'));var squel=require('squel');var crypto=require(_0xbe25('0x9'));var jsforce=require(_0xbe25('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe25('0xb'));var Papa=require(_0xbe25('0xc'));var Redis=require(_0xbe25('0xd'));var authService=require(_0xbe25('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe25('0xf'))('api');var utils=require(_0xbe25('0x10'));var config=require(_0xbe25('0x11'));var licenseUtil=require(_0xbe25('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x189c27,_0x44f413){_0x44f413=_0x44f413||0xcc;return function(_0x1a1c34){if(_0x1a1c34){return _0x189c27['sendStatus'](_0x44f413);}return _0x189c27[_0xbe25('0x13')](_0x44f413)['end']();};}function respondWithResult(_0x5bad55,_0x5260bd){_0x5260bd=_0x5260bd||0xc8;return function(_0x4cf94a){if(_0x4cf94a){return _0x5bad55[_0xbe25('0x13')](_0x5260bd)[_0xbe25('0x14')](_0x4cf94a);}};}function respondWithFilteredResult(_0x37acf3,_0x4b36fe){return function(_0x2c8746){if(_0x2c8746){var _0x22792f=typeof _0x4b36fe[_0xbe25('0x15')]===_0xbe25('0x16')&&typeof _0x4b36fe[_0xbe25('0x17')]===_0xbe25('0x16');var _0x38cc49=_0x2c8746[_0xbe25('0x18')];var _0x368fd7=_0x22792f?0x0:_0x4b36fe[_0xbe25('0x15')];var _0x3f70c2=_0x22792f?_0x2c8746[_0xbe25('0x18')]:_0x4b36fe[_0xbe25('0x15')]+_0x4b36fe[_0xbe25('0x17')];var _0x31b1ad;if(_0x3f70c2>=_0x38cc49){_0x3f70c2=_0x38cc49;_0x31b1ad=0xc8;}else{_0x31b1ad=0xce;}_0x37acf3[_0xbe25('0x13')](_0x31b1ad);return _0x37acf3[_0xbe25('0x19')](_0xbe25('0x1a'),_0x368fd7+'-'+_0x3f70c2+'/'+_0x38cc49)[_0xbe25('0x14')](_0x2c8746);}return null;};}function patchUpdates(_0x4345da){return function(_0x39912c){try{jsonpatch[_0xbe25('0x1b')](_0x39912c,_0x4345da,!![]);}catch(_0x564b27){return BPromise['reject'](_0x564b27);}return _0x39912c['save']();};}function saveUpdates(_0x219f8b,_0x2ebff9){return function(_0x4ba276){if(_0x4ba276){return _0x4ba276['update'](_0x219f8b)['then'](function(_0x12263b){return _0x12263b;});}return null;};}function removeEntity(_0x50b17e,_0x3cec6f){return function(_0x43a550){if(_0x43a550){return _0x43a550[_0xbe25('0x1c')]()[_0xbe25('0x1d')](function(){_0x50b17e[_0xbe25('0x13')](0xcc)[_0xbe25('0x1e')]();});}};}function handleEntityNotFound(_0x346643,_0x2420c6){return function(_0x3fabcd){if(!_0x3fabcd){_0x346643[_0xbe25('0x1f')](0x194);}return _0x3fabcd;};}function handleError(_0x5538fd,_0x3f47dd){_0x3f47dd=_0x3f47dd||0x1f4;return function(_0x268705){logger[_0xbe25('0x20')](_0x268705[_0xbe25('0x21')]);if(_0x268705['name']){delete _0x268705[_0xbe25('0x22')];}_0x5538fd[_0xbe25('0x13')](_0x3f47dd)[_0xbe25('0x23')](_0x268705);};}exports['index']=function(_0x33ac3b,_0x137b61){var _0x586527={},_0xd1db4a={},_0xbe020a={'count':0x0,'rows':[]};var _0x5537b6=_[_0xbe25('0x24')](db[_0xbe25('0x25')][_0xbe25('0x26')],function(_0x9d8729){return{'name':_0x9d8729['fieldName'],'type':_0x9d8729[_0xbe25('0x27')][_0xbe25('0x28')]};});_0xd1db4a['model']=_[_0xbe25('0x24')](_0x5537b6,'name');_0xd1db4a['query']=_[_0xbe25('0x29')](_0x33ac3b[_0xbe25('0x2a')]);_0xd1db4a[_0xbe25('0x2b')]=_['intersection'](_0xd1db4a[_0xbe25('0x2c')],_0xd1db4a[_0xbe25('0x2a')]);_0x586527[_0xbe25('0x2d')]=_[_0xbe25('0x2e')](_0xd1db4a['model'],qs[_0xbe25('0x2f')](_0x33ac3b[_0xbe25('0x2a')][_0xbe25('0x2f')]));_0x586527[_0xbe25('0x2d')]=_0x586527['attributes']['length']?_0x586527[_0xbe25('0x2d')]:_0xd1db4a['model'];if(!_0x33ac3b[_0xbe25('0x2a')]['hasOwnProperty']('nolimit')){_0x586527[_0xbe25('0x17')]=qs[_0xbe25('0x17')](_0x33ac3b[_0xbe25('0x2a')][_0xbe25('0x17')]);_0x586527[_0xbe25('0x15')]=qs[_0xbe25('0x15')](_0x33ac3b[_0xbe25('0x2a')][_0xbe25('0x15')]);}_0x586527[_0xbe25('0x30')]=qs[_0xbe25('0x31')](_0x33ac3b[_0xbe25('0x2a')][_0xbe25('0x31')]);_0x586527[_0xbe25('0x32')]=qs[_0xbe25('0x2b')](_[_0xbe25('0x33')](_0x33ac3b[_0xbe25('0x2a')],_0xd1db4a[_0xbe25('0x2b')]),_0x5537b6);if(_0x33ac3b[_0xbe25('0x2a')][_0xbe25('0x34')]){_0x586527['where']=_[_0xbe25('0x35')](_0x586527[_0xbe25('0x32')],{'$or':_[_0xbe25('0x24')](_0x5537b6,function(_0x35e699){if(_0x35e699[_0xbe25('0x27')]!==_0xbe25('0x36')){var _0x59eb25={};_0x59eb25[_0x35e699[_0xbe25('0x22')]]={'$like':'%'+_0x33ac3b[_0xbe25('0x2a')][_0xbe25('0x34')]+'%'};return _0x59eb25;}})});}_0x586527=_[_0xbe25('0x35')]({},_0x586527,_0x33ac3b[_0xbe25('0x37')]);var _0x183b3d={'where':_0x586527[_0xbe25('0x32')]};return db[_0xbe25('0x25')][_0xbe25('0x18')](_0x183b3d)['then'](function(_0xeb8e9d){_0xbe020a[_0xbe25('0x18')]=_0xeb8e9d;if(_0x33ac3b[_0xbe25('0x2a')][_0xbe25('0x38')]){_0x586527['include']=[{'all':!![]}];}return db[_0xbe25('0x25')][_0xbe25('0x39')](_0x586527);})[_0xbe25('0x1d')](function(_0x15303b){_0xbe020a[_0xbe25('0x3a')]=_0x15303b;return _0xbe020a;})[_0xbe25('0x1d')](respondWithFilteredResult(_0x137b61,_0x586527))[_0xbe25('0x3b')](handleError(_0x137b61,null));};exports[_0xbe25('0x3c')]=function(_0x36ad20,_0x475f2e){var _0x49056c={'raw':!![],'where':{'id':_0x36ad20[_0xbe25('0x3d')]['id']}},_0x195b66={};_0x195b66['model']=_[_0xbe25('0x29')](db[_0xbe25('0x25')][_0xbe25('0x26')]);_0x195b66[_0xbe25('0x2a')]=_[_0xbe25('0x29')](_0x36ad20[_0xbe25('0x2a')]);_0x195b66[_0xbe25('0x2b')]=_[_0xbe25('0x2e')](_0x195b66[_0xbe25('0x2c')],_0x195b66['query']);_0x49056c[_0xbe25('0x2d')]=_[_0xbe25('0x2e')](_0x195b66[_0xbe25('0x2c')],qs[_0xbe25('0x2f')](_0x36ad20[_0xbe25('0x2a')][_0xbe25('0x2f')]));_0x49056c[_0xbe25('0x2d')]=_0x49056c['attributes'][_0xbe25('0x3e')]?_0x49056c[_0xbe25('0x2d')]:_0x195b66['model'];if(_0x36ad20[_0xbe25('0x2a')][_0xbe25('0x38')]){_0x49056c[_0xbe25('0x3f')]=[{'all':!![]}];}_0x49056c=_[_0xbe25('0x35')]({},_0x49056c,_0x36ad20[_0xbe25('0x37')]);return db['AnalyticTreeReport'][_0xbe25('0x40')](_0x49056c)[_0xbe25('0x1d')](handleEntityNotFound(_0x475f2e,null))[_0xbe25('0x1d')](respondWithResult(_0x475f2e,null))[_0xbe25('0x3b')](handleError(_0x475f2e,null));};exports['create']=function(_0x345dec,_0x5bea67){return db[_0xbe25('0x25')]['create'](_0x345dec[_0xbe25('0x41')],{})[_0xbe25('0x1d')](respondWithResult(_0x5bea67,0xc9))['catch'](handleError(_0x5bea67,null));};exports[_0xbe25('0x42')]=function(_0x174166,_0x338e5e){if(_0x174166[_0xbe25('0x41')]['id']){delete _0x174166[_0xbe25('0x41')]['id'];}return db[_0xbe25('0x25')]['find']({'where':{'id':_0x174166[_0xbe25('0x3d')]['id']}})[_0xbe25('0x1d')](handleEntityNotFound(_0x338e5e,null))[_0xbe25('0x1d')](saveUpdates(_0x174166[_0xbe25('0x41')],null))['then'](respondWithResult(_0x338e5e,null))[_0xbe25('0x3b')](handleError(_0x338e5e,null));};exports[_0xbe25('0x1c')]=function(_0xa6ff5c,_0x593404){return db[_0xbe25('0x25')]['find']({'where':{'id':_0xa6ff5c[_0xbe25('0x3d')]['id']}})[_0xbe25('0x1d')](handleEntityNotFound(_0x593404,null))['then'](removeEntity(_0x593404,null))[_0xbe25('0x3b')](handleError(_0x593404,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index cb31cd0..27c2f52 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 _0x16c9=['exports','AnalyticTreeReport','analytics_report_trees','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x4ec274,_0xdf8df0){var _0x2f3647=function(_0x5abf3c){while(--_0x5abf3c){_0x4ec274['push'](_0x4ec274['shift']());}};_0x2f3647(++_0xdf8df0);}(_0x16c9,0x1a5));var _0x916c=function(_0x53b9ff,_0x89eb4f){_0x53b9ff=_0x53b9ff-0x0;var _0x3eee48=_0x16c9[_0x53b9ff];return _0x3eee48;};'use strict';var _=require(_0x916c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x916c('0x1'));var BPromise=require(_0x916c('0x2'));var rp=require(_0x916c('0x3'));var fs=require('fs');var path=require(_0x916c('0x4'));var rimraf=require(_0x916c('0x5'));var config=require(_0x916c('0x6'));var attributes=require(_0x916c('0x7'));module[_0x916c('0x8')]=function(_0x5078d1,_0x5ea000){return _0x5078d1['define'](_0x916c('0x9'),attributes,{'tableName':_0x916c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2179=['moment','bluebird','request-promise','path','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x2179,0xce));var _0x9217=function(_0x38edc7,_0x5d0576){_0x38edc7=_0x38edc7-0x0;var _0x3eb41e=_0x2179[_0x38edc7];return _0x3eb41e;};'use strict';var _=require(_0x9217('0x0'));var util=require(_0x9217('0x1'));var logger=require(_0x9217('0x2'))('api');var moment=require(_0x9217('0x3'));var BPromise=require(_0x9217('0x4'));var rp=require(_0x9217('0x5'));var fs=require('fs');var path=require(_0x9217('0x6'));var rimraf=require('rimraf');var config=require(_0x9217('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x9217('0x8')]=function(_0x3f7077,_0x558355){return _0x3f7077['define'](_0x9217('0x9'),attributes,{'tableName':_0x9217('0xa'),'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 b339da9..506c4e3 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5da955,_0x32d5cd){var _0x5450d6=function(_0x540565){while(--_0x540565){_0x5da955['push'](_0x5da955['shift']());}};_0x5450d6(++_0x32d5cd);}(_0x2ef3,0xba));var _0x32ef=function(_0x4ae150,_0x817f38){_0x4ae150=_0x4ae150-0x0;var _0xe87f12=_0x2ef3[_0x4ae150];return _0xe87f12;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1ad7fc,_0x444145){var _0x3bb433=function(_0x1e27ef){while(--_0x1e27ef){_0x1ad7fc['push'](_0x1ad7fc['shift']());}};_0x3bb433(++_0x444145);}(_0x2ef3,0xba));var _0x32ef=function(_0x1bb050,_0x41970d){_0x1bb050=_0x1bb050-0x0;var _0x4e4857=_0x2ef3[_0x1bb050];return _0x4e4857;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index a6a3f39..a8a1711 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 _0x2c63=['path','express','Router','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x3c9df8,_0x387a5d){var _0x3c8cd3=function(_0x4a0541){while(--_0x4a0541){_0x3c9df8['push'](_0x3c9df8['shift']());}};_0x3c8cd3(++_0x387a5d);}(_0x2c63,0xed));var _0x32c6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2c63[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0x32c6('0x0'));var path=require(_0x32c6('0x1'));var timeout=require('connect-timeout');var express=require(_0x32c6('0x2'));var router=express[_0x32c6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x32c6('0x4'));var controller=require(_0x32c6('0x5'));router[_0x32c6('0x6')]('/',auth[_0x32c6('0x7')](),controller['index']);router[_0x32c6('0x6')](_0x32c6('0x8'),auth['isAuthenticated'](),controller[_0x32c6('0x9')]);router[_0x32c6('0xa')]('/',auth['isAuthenticated'](),controller[_0x32c6('0xb')]);router[_0x32c6('0xc')](_0x32c6('0x8'),auth[_0x32c6('0x7')](),controller[_0x32c6('0xd')]);router[_0x32c6('0xe')](_0x32c6('0x8'),auth['isAuthenticated'](),controller[_0x32c6('0xf')]);module[_0x32c6('0x10')]=router;
\ No newline at end of file
+var _0x64a6=['get','isAuthenticated','index','/:id','post','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller'];(function(_0x81e27a,_0xeed7b7){var _0x429715=function(_0x21c5f9){while(--_0x21c5f9){_0x81e27a['push'](_0x81e27a['shift']());}};_0x429715(++_0xeed7b7);}(_0x64a6,0xd4));var _0x664a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x64a6[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x664a('0x0'));var util=require(_0x664a('0x1'));var path=require('path');var timeout=require(_0x664a('0x2'));var express=require(_0x664a('0x3'));var router=express[_0x664a('0x4')]();var fs_extra=require(_0x664a('0x5'));var auth=require(_0x664a('0x6'));var interaction=require(_0x664a('0x7'));var config=require('../../config/environment');var controller=require(_0x664a('0x8'));router[_0x664a('0x9')]('/',auth[_0x664a('0xa')](),controller[_0x664a('0xb')]);router['get'](_0x664a('0xc'),auth[_0x664a('0xa')](),controller['show']);router[_0x664a('0xd')]('/',auth[_0x664a('0xa')](),controller['create']);router[_0x664a('0xe')]('/:id',auth[_0x664a('0xa')](),controller[_0x664a('0xf')]);router['delete'](_0x664a('0xc'),auth['isAuthenticated'](),controller[_0x664a('0x10')]);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 e21f6e0..4af7855 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 _0xaf9b=['STRING','sequelize'];(function(_0x4f6337,_0x3a75bf){var _0x2bd335=function(_0x23aaa9){while(--_0x23aaa9){_0x4f6337['push'](_0x4f6337['shift']());}};_0x2bd335(++_0x3a75bf);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x2f24d1,_0x4a9e7e){_0x2f24d1=_0x2f24d1-0x0;var _0x49a3f7=_0xaf9b[_0x2f24d1];return _0x49a3f7;};'use strict';var Sequelize=require(_0xbaf9('0x0'));module['exports']={'name':{'type':Sequelize[_0xbaf9('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbaf9('0x1')]}};
\ No newline at end of file
+var _0xc368=['STRING','exports'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xc368,0x7b));var _0x8c36=function(_0x463a63,_0x2e9612){_0x463a63=_0x463a63-0x0;var _0x1cd88f=_0xc368[_0x463a63];return _0x1cd88f;};'use strict';var Sequelize=require('sequelize');module[_0x8c36('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x8c36('0x1')]},'type':{'type':Sequelize[_0x8c36('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 14f4ab4..7ebde69 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 _0xa53b=['findAll','show','params','rawAttributes','includeAll','include','find','catch','clone','get','createdAt','updatedAt','body','omit','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Attachment','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa53b,0x1d7));var _0xba53=function(_0x2898df,_0x5b750e){_0x2898df=_0x2898df-0x0;var _0x47dab3=_0xa53b[_0x2898df];return _0x47dab3;};'use strict';var emlformat=require(_0xba53('0x0'));var rimraf=require(_0xba53('0x1'));var zipdir=require(_0xba53('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xba53('0x3'));var BPromise=require(_0xba53('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xba53('0x5'));var sox=require(_0xba53('0x6'));var csv=require(_0xba53('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba53('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xba53('0x9'));var jsforce=require(_0xba53('0xa'));var deskjs=require(_0xba53('0xb'));var toCsv=require(_0xba53('0x7'));var querystring=require(_0xba53('0xc'));var Papa=require('papaparse');var Redis=require(_0xba53('0xd'));var authService=require(_0xba53('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xba53('0xf'));var hardwareService=require(_0xba53('0x10'));var logger=require(_0xba53('0x11'))(_0xba53('0x12'));var utils=require(_0xba53('0x13'));var config=require(_0xba53('0x14'));var licenseUtil=require(_0xba53('0x15'));var db=require(_0xba53('0x16'))['db'];function respondWithStatusCode(_0x1a1b58,_0xc47984){_0xc47984=_0xc47984||0xcc;return function(_0x2ed133){if(_0x2ed133){return _0x1a1b58[_0xba53('0x17')](_0xc47984);}return _0x1a1b58[_0xba53('0x18')](_0xc47984)[_0xba53('0x19')]();};}function respondWithResult(_0x19e4ee,_0x173f26){_0x173f26=_0x173f26||0xc8;return function(_0x1e55fd){if(_0x1e55fd){return _0x19e4ee['status'](_0x173f26)[_0xba53('0x1a')](_0x1e55fd);}};}function respondWithFilteredResult(_0x1e6fec,_0x44dae3){return function(_0x243e78){if(_0x243e78){var _0x208f24=typeof _0x44dae3[_0xba53('0x1b')]===_0xba53('0x1c')&&typeof _0x44dae3[_0xba53('0x1d')]===_0xba53('0x1c');var _0x19e2f6=_0x243e78[_0xba53('0x1e')];var _0x15de98=_0x208f24?0x0:_0x44dae3[_0xba53('0x1b')];var _0x22dd1b=_0x208f24?_0x243e78[_0xba53('0x1e')]:_0x44dae3[_0xba53('0x1b')]+_0x44dae3['limit'];var _0x232e88;if(_0x22dd1b>=_0x19e2f6){_0x22dd1b=_0x19e2f6;_0x232e88=0xc8;}else{_0x232e88=0xce;}_0x1e6fec['status'](_0x232e88);return _0x1e6fec[_0xba53('0x1f')](_0xba53('0x20'),_0x15de98+'-'+_0x22dd1b+'/'+_0x19e2f6)[_0xba53('0x1a')](_0x243e78);}return null;};}function patchUpdates(_0x5a041a){return function(_0x369ea7){try{jsonpatch[_0xba53('0x21')](_0x369ea7,_0x5a041a,!![]);}catch(_0x5346db){return BPromise[_0xba53('0x22')](_0x5346db);}return _0x369ea7[_0xba53('0x23')]();};}function saveUpdates(_0x31558c,_0x4383c9){return function(_0xd892e0){if(_0xd892e0){return _0xd892e0[_0xba53('0x24')](_0x31558c)[_0xba53('0x25')](function(_0x1226b7){return _0x1226b7;});}return null;};}function removeEntity(_0x23e692,_0xbba862){return function(_0x32a3ad){if(_0x32a3ad){return _0x32a3ad[_0xba53('0x26')]()['then'](function(){_0x23e692[_0xba53('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4561e6,_0x22f050){return function(_0x2f0ac5){if(!_0x2f0ac5){_0x4561e6['sendStatus'](0x194);}return _0x2f0ac5;};}function handleError(_0x4dd3ad,_0xae0d36){_0xae0d36=_0xae0d36||0x1f4;return function(_0x4ad626){logger['error'](_0x4ad626[_0xba53('0x27')]);if(_0x4ad626[_0xba53('0x28')]){delete _0x4ad626['name'];}_0x4dd3ad[_0xba53('0x18')](_0xae0d36)[_0xba53('0x29')](_0x4ad626);};}exports[_0xba53('0x2a')]=function(_0x4c067e,_0x38dd66){var _0x1a046f={},_0x5447ec={},_0x54059d={'count':0x0,'rows':[]};var _0x5d1c64=_[_0xba53('0x2b')](db[_0xba53('0x2c')]['rawAttributes'],function(_0x33a001){return{'name':_0x33a001['fieldName'],'type':_0x33a001[_0xba53('0x2d')]['key']};});_0x5447ec[_0xba53('0x2e')]=_['map'](_0x5d1c64,'name');_0x5447ec[_0xba53('0x2f')]=_[_0xba53('0x30')](_0x4c067e[_0xba53('0x2f')]);_0x5447ec[_0xba53('0x31')]=_[_0xba53('0x32')](_0x5447ec[_0xba53('0x2e')],_0x5447ec[_0xba53('0x2f')]);_0x1a046f['attributes']=_[_0xba53('0x32')](_0x5447ec['model'],qs[_0xba53('0x33')](_0x4c067e['query'][_0xba53('0x33')]));_0x1a046f[_0xba53('0x34')]=_0x1a046f[_0xba53('0x34')][_0xba53('0x35')]?_0x1a046f[_0xba53('0x34')]:_0x5447ec[_0xba53('0x2e')];if(!_0x4c067e[_0xba53('0x2f')][_0xba53('0x36')](_0xba53('0x37'))){_0x1a046f[_0xba53('0x1d')]=qs['limit'](_0x4c067e['query'][_0xba53('0x1d')]);_0x1a046f[_0xba53('0x1b')]=qs[_0xba53('0x1b')](_0x4c067e[_0xba53('0x2f')][_0xba53('0x1b')]);}_0x1a046f['order']=qs[_0xba53('0x38')](_0x4c067e['query']['sort']);_0x1a046f[_0xba53('0x39')]=qs[_0xba53('0x31')](_[_0xba53('0x3a')](_0x4c067e[_0xba53('0x2f')],_0x5447ec[_0xba53('0x31')]),_0x5d1c64);if(_0x4c067e['query'][_0xba53('0x3b')]){_0x1a046f[_0xba53('0x39')]=_[_0xba53('0x3c')](_0x1a046f[_0xba53('0x39')],{'$or':_[_0xba53('0x2b')](_0x5d1c64,function(_0x2a8c9c){if(_0x2a8c9c[_0xba53('0x2d')]!==_0xba53('0x3d')){var _0x348e41={};_0x348e41[_0x2a8c9c[_0xba53('0x28')]]={'$like':'%'+_0x4c067e[_0xba53('0x2f')][_0xba53('0x3b')]+'%'};return _0x348e41;}})});}_0x1a046f=_[_0xba53('0x3c')]({},_0x1a046f,_0x4c067e[_0xba53('0x3e')]);var _0x2e6d8b={'where':_0x1a046f['where']};return db[_0xba53('0x2c')]['count'](_0x2e6d8b)[_0xba53('0x25')](function(_0x51af91){_0x54059d[_0xba53('0x1e')]=_0x51af91;if(_0x4c067e[_0xba53('0x2f')]['includeAll']){_0x1a046f['include']=[{'all':!![]}];}return db[_0xba53('0x2c')][_0xba53('0x3f')](_0x1a046f);})['then'](function(_0xdefd2f){_0x54059d['rows']=_0xdefd2f;return _0x54059d;})[_0xba53('0x25')](respondWithFilteredResult(_0x38dd66,_0x1a046f))['catch'](handleError(_0x38dd66,null));};exports[_0xba53('0x40')]=function(_0x4a2ad3,_0x1803bd){var _0x11ff36={'raw':!![],'where':{'id':_0x4a2ad3[_0xba53('0x41')]['id']}},_0x5314b6={};_0x5314b6[_0xba53('0x2e')]=_[_0xba53('0x30')](db[_0xba53('0x2c')][_0xba53('0x42')]);_0x5314b6[_0xba53('0x2f')]=_[_0xba53('0x30')](_0x4a2ad3[_0xba53('0x2f')]);_0x5314b6[_0xba53('0x31')]=_[_0xba53('0x32')](_0x5314b6[_0xba53('0x2e')],_0x5314b6[_0xba53('0x2f')]);_0x11ff36['attributes']=_['intersection'](_0x5314b6['model'],qs[_0xba53('0x33')](_0x4a2ad3['query'][_0xba53('0x33')]));_0x11ff36['attributes']=_0x11ff36[_0xba53('0x34')][_0xba53('0x35')]?_0x11ff36['attributes']:_0x5314b6[_0xba53('0x2e')];if(_0x4a2ad3['query'][_0xba53('0x43')]){_0x11ff36[_0xba53('0x44')]=[{'all':!![]}];}_0x11ff36=_['merge']({},_0x11ff36,_0x4a2ad3[_0xba53('0x3e')]);return db[_0xba53('0x2c')][_0xba53('0x45')](_0x11ff36)[_0xba53('0x25')](handleEntityNotFound(_0x1803bd,null))[_0xba53('0x25')](respondWithResult(_0x1803bd,null))[_0xba53('0x46')](handleError(_0x1803bd,null));};exports[_0xba53('0x47')]=function(_0x50969a,_0x3391c8){var _0x5147a2={'where':{'id':_0x50969a[_0xba53('0x41')]['id']}},_0x45f8ee={};_0x45f8ee['model']=_[_0xba53('0x30')](db[_0xba53('0x2c')][_0xba53('0x42')]);_0x5147a2[_0xba53('0x34')]=_[_0xba53('0x32')](_0x45f8ee[_0xba53('0x2e')],qs['fields'](_0x50969a[_0xba53('0x2f')][_0xba53('0x33')]));_0x5147a2[_0xba53('0x34')]=_0x5147a2['attributes'][_0xba53('0x35')]?_0x5147a2[_0xba53('0x34')]:_0x45f8ee['model'];if(_0x50969a[_0xba53('0x2f')][_0xba53('0x43')]){_0x5147a2[_0xba53('0x44')]=[{'all':!![]}];}_0x5147a2=_[_0xba53('0x3c')]({},_0x5147a2,_0x50969a[_0xba53('0x3e')]);return db[_0xba53('0x2c')][_0xba53('0x45')](_0x5147a2)[_0xba53('0x25')](handleEntityNotFound(_0x3391c8,null))[_0xba53('0x25')](function(_0x5a4c0a){if(_0x5a4c0a){var _0x40cc87=_0x5a4c0a[_0xba53('0x48')]({'plain':!![]});_0x40cc87=qs['omit'](_0x40cc87,['id',_0xba53('0x49'),_0xba53('0x4a')]);_0x50969a[_0xba53('0x4b')]=_[_0xba53('0x4c')](_0x50969a['body'],['id',_0xba53('0x49'),_0xba53('0x4a')]);return db[_0xba53('0x2c')][_0xba53('0x4d')](_[_0xba53('0x3c')](_0x40cc87,_0x50969a[_0xba53('0x4b')]),{'include':_0x50969a[_0xba53('0x2f')][_0xba53('0x43')]?[{'all':!![]}]:undefined});}})[_0xba53('0x25')](respondWithResult(_0x3391c8,0xc9))[_0xba53('0x46')](handleError(_0x3391c8,null));};exports[_0xba53('0x24')]=function(_0x1c12ab,_0x57381b){if(_0x1c12ab[_0xba53('0x4b')]['id']){delete _0x1c12ab[_0xba53('0x4b')]['id'];}return db[_0xba53('0x2c')][_0xba53('0x45')]({'where':{'id':_0x1c12ab[_0xba53('0x41')]['id']}})['then'](handleEntityNotFound(_0x57381b,null))[_0xba53('0x25')](saveUpdates(_0x1c12ab['body'],null))[_0xba53('0x25')](respondWithResult(_0x57381b,null))[_0xba53('0x46')](handleError(_0x57381b,null));};exports[_0xba53('0x26')]=function(_0x4ec8c1,_0x48ef4e){return db[_0xba53('0x2c')][_0xba53('0x45')]({'where':{'id':_0x4ec8c1['params']['id']}})['then'](handleEntityNotFound(_0x48ef4e,null))[_0xba53('0x25')](removeEntity(_0x48ef4e,null))['catch'](handleError(_0x48ef4e,null));};exports[_0xba53('0x4d')]=function(_0x197d3e,_0x361403,_0x5bc2a2){_0x197d3e[_0xba53('0x4b')]['name']=_0x197d3e[_0xba53('0x4e')]['originalname'];_0x197d3e['body'][_0xba53('0x4f')]=_0x197d3e[_0xba53('0x4e')][_0xba53('0x50')];_0x197d3e[_0xba53('0x4b')][_0xba53('0x2d')]=_0x197d3e[_0xba53('0x4e')][_0xba53('0x51')];return db['Attachment'][_0xba53('0x4d')](_0x197d3e[_0xba53('0x4b')])[_0xba53('0x25')](respondWithResult(_0x361403,0xc9))[_0xba53('0x46')](handleError(_0x361403,null));};exports[_0xba53('0x52')]=function(_0x32c38f,_0x54dd04,_0x150f70){return db[_0xba53('0x2c')][_0xba53('0x53')]({'where':{'id':_0x32c38f[_0xba53('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x54dd04,null))[_0xba53('0x25')](function(_0x4eab44){if(_0x4eab44){var _0x4fa7c5=_0x4eab44[_0xba53('0x54')]!==null;var _0x5e994d=path[_0xba53('0x55')](config[_0xba53('0x56')],_0xba53('0x57'));if(_0x4fa7c5){_0x5e994d=path[_0xba53('0x55')](_0x5e994d,_0xba53('0x58'));}var _0x2acfb4=path[_0xba53('0x55')](_0x5e994d,_0x4eab44['basename']);return _0x54dd04[_0xba53('0x52')](_0x2acfb4);}})[_0xba53('0x46')](handleError(_0x54dd04,null));};
\ No newline at end of file
+var _0x08f8=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','updatedAt','body','create','update','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js'];(function(_0x3c6bc6,_0x5b2080){var _0x1a22e6=function(_0x3d3443){while(--_0x3d3443){_0x3c6bc6['push'](_0x3c6bc6['shift']());}};_0x1a22e6(++_0x5b2080);}(_0x08f8,0x16c));var _0x808f=function(_0x4ac225,_0x2e8e23){_0x4ac225=_0x4ac225-0x0;var _0x584273=_0x08f8[_0x4ac225];return _0x584273;};'use strict';var emlformat=require(_0x808f('0x0'));var rimraf=require(_0x808f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x808f('0x2'));var moment=require('moment');var BPromise=require(_0x808f('0x3'));var Mustache=require(_0x808f('0x4'));var util=require('util');var path=require(_0x808f('0x5'));var sox=require(_0x808f('0x6'));var csv=require(_0x808f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x808f('0x8'));var squel=require(_0x808f('0x9'));var crypto=require('crypto');var jsforce=require(_0x808f('0xa'));var deskjs=require(_0x808f('0xb'));var toCsv=require(_0x808f('0x7'));var querystring=require(_0x808f('0xc'));var Papa=require('papaparse');var Redis=require(_0x808f('0xd'));var authService=require(_0x808f('0xe'));var qs=require(_0x808f('0xf'));var as=require(_0x808f('0x10'));var hardwareService=require(_0x808f('0x11'));var logger=require(_0x808f('0x12'))(_0x808f('0x13'));var utils=require(_0x808f('0x14'));var config=require(_0x808f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x808f('0x16'))['db'];function respondWithStatusCode(_0x116d69,_0x19b064){_0x19b064=_0x19b064||0xcc;return function(_0x555855){if(_0x555855){return _0x116d69[_0x808f('0x17')](_0x19b064);}return _0x116d69[_0x808f('0x18')](_0x19b064)[_0x808f('0x19')]();};}function respondWithResult(_0x54b435,_0x56ee63){_0x56ee63=_0x56ee63||0xc8;return function(_0x15fcce){if(_0x15fcce){return _0x54b435[_0x808f('0x18')](_0x56ee63)[_0x808f('0x1a')](_0x15fcce);}};}function respondWithFilteredResult(_0x5a6780,_0x3549f4){return function(_0x5ca21f){if(_0x5ca21f){var _0x39fc28=typeof _0x3549f4['offset']===_0x808f('0x1b')&&typeof _0x3549f4[_0x808f('0x1c')]===_0x808f('0x1b');var _0x195a14=_0x5ca21f[_0x808f('0x1d')];var _0x471a6e=_0x39fc28?0x0:_0x3549f4[_0x808f('0x1e')];var _0x160922=_0x39fc28?_0x5ca21f[_0x808f('0x1d')]:_0x3549f4[_0x808f('0x1e')]+_0x3549f4[_0x808f('0x1c')];var _0x16a9e7;if(_0x160922>=_0x195a14){_0x160922=_0x195a14;_0x16a9e7=0xc8;}else{_0x16a9e7=0xce;}_0x5a6780['status'](_0x16a9e7);return _0x5a6780[_0x808f('0x1f')](_0x808f('0x20'),_0x471a6e+'-'+_0x160922+'/'+_0x195a14)[_0x808f('0x1a')](_0x5ca21f);}return null;};}function patchUpdates(_0x283119){return function(_0x4b5387){try{jsonpatch[_0x808f('0x21')](_0x4b5387,_0x283119,!![]);}catch(_0x29f2c9){return BPromise['reject'](_0x29f2c9);}return _0x4b5387[_0x808f('0x22')]();};}function saveUpdates(_0xe6170,_0x38331b){return function(_0x4dbcfc){if(_0x4dbcfc){return _0x4dbcfc['update'](_0xe6170)['then'](function(_0x564acb){return _0x564acb;});}return null;};}function removeEntity(_0x15d82e,_0x5fa0fd){return function(_0x4b08e1){if(_0x4b08e1){return _0x4b08e1[_0x808f('0x23')]()[_0x808f('0x24')](function(){_0x15d82e[_0x808f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d0e03,_0x571f77){return function(_0x188b2c){if(!_0x188b2c){_0x9d0e03[_0x808f('0x17')](0x194);}return _0x188b2c;};}function handleError(_0x9cd98d,_0x29eb9b){_0x29eb9b=_0x29eb9b||0x1f4;return function(_0x1b8a65){logger[_0x808f('0x25')](_0x1b8a65[_0x808f('0x26')]);if(_0x1b8a65[_0x808f('0x27')]){delete _0x1b8a65[_0x808f('0x27')];}_0x9cd98d[_0x808f('0x18')](_0x29eb9b)[_0x808f('0x28')](_0x1b8a65);};}exports[_0x808f('0x29')]=function(_0x269652,_0x28bf19){var _0x1a0c1e={},_0xc16d2d={},_0x2def88={'count':0x0,'rows':[]};var _0x2753cc=_[_0x808f('0x2a')](db[_0x808f('0x2b')][_0x808f('0x2c')],function(_0x534faf){return{'name':_0x534faf[_0x808f('0x2d')],'type':_0x534faf[_0x808f('0x2e')][_0x808f('0x2f')]};});_0xc16d2d['model']=_[_0x808f('0x2a')](_0x2753cc,_0x808f('0x27'));_0xc16d2d[_0x808f('0x30')]=_[_0x808f('0x31')](_0x269652['query']);_0xc16d2d[_0x808f('0x32')]=_[_0x808f('0x33')](_0xc16d2d[_0x808f('0x34')],_0xc16d2d['query']);_0x1a0c1e[_0x808f('0x35')]=_[_0x808f('0x33')](_0xc16d2d['model'],qs[_0x808f('0x36')](_0x269652[_0x808f('0x30')][_0x808f('0x36')]));_0x1a0c1e[_0x808f('0x35')]=_0x1a0c1e[_0x808f('0x35')][_0x808f('0x37')]?_0x1a0c1e[_0x808f('0x35')]:_0xc16d2d[_0x808f('0x34')];if(!_0x269652[_0x808f('0x30')][_0x808f('0x38')](_0x808f('0x39'))){_0x1a0c1e[_0x808f('0x1c')]=qs[_0x808f('0x1c')](_0x269652['query'][_0x808f('0x1c')]);_0x1a0c1e[_0x808f('0x1e')]=qs['offset'](_0x269652[_0x808f('0x30')][_0x808f('0x1e')]);}_0x1a0c1e[_0x808f('0x3a')]=qs[_0x808f('0x3b')](_0x269652[_0x808f('0x30')][_0x808f('0x3b')]);_0x1a0c1e[_0x808f('0x3c')]=qs['filters'](_[_0x808f('0x3d')](_0x269652[_0x808f('0x30')],_0xc16d2d[_0x808f('0x32')]),_0x2753cc);if(_0x269652[_0x808f('0x30')][_0x808f('0x3e')]){_0x1a0c1e['where']=_[_0x808f('0x3f')](_0x1a0c1e['where'],{'$or':_[_0x808f('0x2a')](_0x2753cc,function(_0x17e98c){if(_0x17e98c[_0x808f('0x2e')]!==_0x808f('0x40')){var _0x39d9b6={};_0x39d9b6[_0x17e98c['name']]={'$like':'%'+_0x269652[_0x808f('0x30')]['filter']+'%'};return _0x39d9b6;}})});}_0x1a0c1e=_[_0x808f('0x3f')]({},_0x1a0c1e,_0x269652[_0x808f('0x41')]);var _0x196615={'where':_0x1a0c1e[_0x808f('0x3c')]};return db['Attachment'][_0x808f('0x1d')](_0x196615)[_0x808f('0x24')](function(_0x46eaf4){_0x2def88['count']=_0x46eaf4;if(_0x269652['query'][_0x808f('0x42')]){_0x1a0c1e[_0x808f('0x43')]=[{'all':!![]}];}return db[_0x808f('0x2b')][_0x808f('0x44')](_0x1a0c1e);})[_0x808f('0x24')](function(_0x190402){_0x2def88[_0x808f('0x45')]=_0x190402;return _0x2def88;})[_0x808f('0x24')](respondWithFilteredResult(_0x28bf19,_0x1a0c1e))[_0x808f('0x46')](handleError(_0x28bf19,null));};exports[_0x808f('0x47')]=function(_0x6e0b4d,_0xd74d62){var _0x2edb7e={'raw':!![],'where':{'id':_0x6e0b4d[_0x808f('0x48')]['id']}},_0x28f5be={};_0x28f5be[_0x808f('0x34')]=_[_0x808f('0x31')](db['Attachment'][_0x808f('0x2c')]);_0x28f5be[_0x808f('0x30')]=_['keys'](_0x6e0b4d[_0x808f('0x30')]);_0x28f5be[_0x808f('0x32')]=_[_0x808f('0x33')](_0x28f5be[_0x808f('0x34')],_0x28f5be[_0x808f('0x30')]);_0x2edb7e[_0x808f('0x35')]=_[_0x808f('0x33')](_0x28f5be[_0x808f('0x34')],qs['fields'](_0x6e0b4d[_0x808f('0x30')]['fields']));_0x2edb7e[_0x808f('0x35')]=_0x2edb7e[_0x808f('0x35')][_0x808f('0x37')]?_0x2edb7e[_0x808f('0x35')]:_0x28f5be[_0x808f('0x34')];if(_0x6e0b4d[_0x808f('0x30')][_0x808f('0x42')]){_0x2edb7e[_0x808f('0x43')]=[{'all':!![]}];}_0x2edb7e=_[_0x808f('0x3f')]({},_0x2edb7e,_0x6e0b4d[_0x808f('0x41')]);return db[_0x808f('0x2b')][_0x808f('0x49')](_0x2edb7e)[_0x808f('0x24')](handleEntityNotFound(_0xd74d62,null))[_0x808f('0x24')](respondWithResult(_0xd74d62,null))[_0x808f('0x46')](handleError(_0xd74d62,null));};exports[_0x808f('0x4a')]=function(_0x2b10e0,_0x32ea79){var _0x493fa0={'where':{'id':_0x2b10e0['params']['id']}},_0x1e9cfe={};_0x1e9cfe[_0x808f('0x34')]=_[_0x808f('0x31')](db[_0x808f('0x2b')][_0x808f('0x2c')]);_0x493fa0[_0x808f('0x35')]=_[_0x808f('0x33')](_0x1e9cfe[_0x808f('0x34')],qs[_0x808f('0x36')](_0x2b10e0[_0x808f('0x30')][_0x808f('0x36')]));_0x493fa0[_0x808f('0x35')]=_0x493fa0[_0x808f('0x35')][_0x808f('0x37')]?_0x493fa0[_0x808f('0x35')]:_0x1e9cfe[_0x808f('0x34')];if(_0x2b10e0['query'][_0x808f('0x42')]){_0x493fa0['include']=[{'all':!![]}];}_0x493fa0=_[_0x808f('0x3f')]({},_0x493fa0,_0x2b10e0[_0x808f('0x41')]);return db['Attachment'][_0x808f('0x49')](_0x493fa0)[_0x808f('0x24')](handleEntityNotFound(_0x32ea79,null))[_0x808f('0x24')](function(_0x1177a2){if(_0x1177a2){var _0x4eb2ee=_0x1177a2[_0x808f('0x4b')]({'plain':!![]});_0x4eb2ee=qs[_0x808f('0x4c')](_0x4eb2ee,['id',_0x808f('0x4d'),_0x808f('0x4e')]);_0x2b10e0[_0x808f('0x4f')]=_[_0x808f('0x4c')](_0x2b10e0[_0x808f('0x4f')],['id',_0x808f('0x4d'),_0x808f('0x4e')]);return db[_0x808f('0x2b')][_0x808f('0x50')](_[_0x808f('0x3f')](_0x4eb2ee,_0x2b10e0[_0x808f('0x4f')]),{'include':_0x2b10e0[_0x808f('0x30')][_0x808f('0x42')]?[{'all':!![]}]:undefined});}})[_0x808f('0x24')](respondWithResult(_0x32ea79,0xc9))[_0x808f('0x46')](handleError(_0x32ea79,null));};exports[_0x808f('0x51')]=function(_0x128dc5,_0xc804fb){if(_0x128dc5[_0x808f('0x4f')]['id']){delete _0x128dc5['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x128dc5[_0x808f('0x48')]['id']}})['then'](handleEntityNotFound(_0xc804fb,null))[_0x808f('0x24')](saveUpdates(_0x128dc5[_0x808f('0x4f')],null))['then'](respondWithResult(_0xc804fb,null))[_0x808f('0x46')](handleError(_0xc804fb,null));};exports[_0x808f('0x23')]=function(_0x2a4b2c,_0x397347){return db[_0x808f('0x2b')]['find']({'where':{'id':_0x2a4b2c[_0x808f('0x48')]['id']}})[_0x808f('0x24')](handleEntityNotFound(_0x397347,null))[_0x808f('0x24')](removeEntity(_0x397347,null))['catch'](handleError(_0x397347,null));};exports[_0x808f('0x50')]=function(_0x126b55,_0x3431d2,_0x77444){_0x126b55[_0x808f('0x4f')][_0x808f('0x27')]=_0x126b55[_0x808f('0x52')][_0x808f('0x53')];_0x126b55[_0x808f('0x4f')][_0x808f('0x54')]=_0x126b55[_0x808f('0x52')][_0x808f('0x55')];_0x126b55[_0x808f('0x4f')][_0x808f('0x2e')]=_0x126b55[_0x808f('0x52')][_0x808f('0x56')];return db['Attachment']['create'](_0x126b55[_0x808f('0x4f')])[_0x808f('0x24')](respondWithResult(_0x3431d2,0xc9))['catch'](handleError(_0x3431d2,null));};exports[_0x808f('0x57')]=function(_0x2daaaa,_0xd98311,_0x5f8761){return db['Attachment'][_0x808f('0x58')]({'where':{'id':_0x2daaaa[_0x808f('0x48')]['id']},'raw':!![]})[_0x808f('0x24')](handleEntityNotFound(_0xd98311,null))['then'](function(_0x3d58ac){if(_0x3d58ac){var _0x88d56b=_0x3d58ac[_0x808f('0x59')]!==null;var _0x24aeb8=path[_0x808f('0x5a')](config[_0x808f('0x5b')],_0x808f('0x5c'));if(_0x88d56b){_0x24aeb8=path[_0x808f('0x5a')](_0x24aeb8,_0x808f('0x5d'));}var _0x553cea=path[_0x808f('0x5a')](_0x24aeb8,_0x3d58ac['basename']);return _0xd98311[_0x808f('0x57')](_0x553cea);}})['catch'](handleError(_0xd98311,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0070bac..7ddb6f6 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 _0x3db8=['attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','Attachment'];(function(_0x2e9780,_0x51e78b){var _0x4ed3cd=function(_0x49a0c9){while(--_0x49a0c9){_0x2e9780['push'](_0x2e9780['shift']());}};_0x4ed3cd(++_0x51e78b);}(_0x3db8,0x12d));var _0x83db=function(_0x3555f7,_0x3a43c3){_0x3555f7=_0x3555f7-0x0;var _0x3dfb3d=_0x3db8[_0x3555f7];return _0x3dfb3d;};'use strict';var _=require(_0x83db('0x0'));var util=require('util');var logger=require(_0x83db('0x1'))(_0x83db('0x2'));var moment=require(_0x83db('0x3'));var BPromise=require(_0x83db('0x4'));var rp=require(_0x83db('0x5'));var fs=require('fs');var path=require(_0x83db('0x6'));var rimraf=require(_0x83db('0x7'));var config=require(_0x83db('0x8'));var attributes=require(_0x83db('0x9'));module['exports']=function(_0x5de6d3,_0x3d7052){return _0x5de6d3['define'](_0x83db('0xa'),attributes,{'tableName':_0x83db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x80b4=['attachments','api','moment','request-promise','rimraf','./attachment.attributes','exports','define','Attachment'];(function(_0x1f0c5b,_0x2994f4){var _0x2a10c8=function(_0xef76ce){while(--_0xef76ce){_0x1f0c5b['push'](_0x1f0c5b['shift']());}};_0x2a10c8(++_0x2994f4);}(_0x80b4,0x172));var _0x480b=function(_0x8df02,_0x108944){_0x8df02=_0x8df02-0x0;var _0x26b9c8=_0x80b4[_0x8df02];return _0x26b9c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x480b('0x0'));var moment=require(_0x480b('0x1'));var BPromise=require('bluebird');var rp=require(_0x480b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x480b('0x3'));var config=require('../../config/environment');var attributes=require(_0x480b('0x4'));module[_0x480b('0x5')]=function(_0x48049b,_0x5d8a98){return _0x48049b[_0x480b('0x6')](_0x480b('0x7'),attributes,{'tableName':_0x480b('0x8'),'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 20159fe..94efe62 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 _0x885e=['body','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','CreateAttachment','Attachment','create'];(function(_0x3c7762,_0x45911c){var _0x5bd127=function(_0x576073){while(--_0x576073){_0x3c7762['push'](_0x3c7762['shift']());}};_0x5bd127(++_0x45911c);}(_0x885e,0xe4));var _0xe885=function(_0x4f5610,_0x1c5eb4){_0x4f5610=_0x4f5610-0x0;var _0x292b45=_0x885e[_0x4f5610];return _0x292b45;};'use strict';var _=require(_0xe885('0x0'));var util=require(_0xe885('0x1'));var moment=require('moment');var BPromise=require(_0xe885('0x2'));var rs=require(_0xe885('0x3'));var fs=require('fs');var Redis=require(_0xe885('0x4'));var db=require(_0xe885('0x5'))['db'];var utils=require(_0xe885('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe885('0x7'));var jayson=require(_0xe885('0x8'));var client=jayson[_0xe885('0x9')][_0xe885('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55d2b2,_0x37778a,_0x597bdc){return new BPromise(function(_0x2e8fe0,_0x3c5cc7){return client[_0xe885('0xb')](_0x55d2b2,_0x597bdc)[_0xe885('0xc')](function(_0x231f2f){logger[_0xe885('0xd')]('Attachment,\x20%s,\x20%s',_0x37778a,_0xe885('0xe'));logger[_0xe885('0xf')](_0xe885('0x10'),_0x37778a,_0xe885('0xe'),JSON[_0xe885('0x11')](_0x231f2f));if(_0x231f2f[_0xe885('0x12')]){if(_0x231f2f[_0xe885('0x12')]['code']===0x1f4){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);return _0x3c5cc7(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}logger[_0xe885('0x12')]('Attachment,\x20%s,\x20%s',_0x37778a,_0x231f2f['error']['message']);return _0x2e8fe0(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}else{logger[_0xe885('0xd')](_0xe885('0x13'),_0x37778a,'request\x20sent');_0x2e8fe0(_0x231f2f['result'][_0xe885('0x14')]);}})['catch'](function(_0x36b9e7){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x36b9e7);_0x3c5cc7(_0x36b9e7);});});}exports[_0xe885('0x15')]=function(_0x25a002){var _0x365eab=this;return new Promise(function(_0x4f5045,_0x39f07c){return db[_0xe885('0x16')][_0xe885('0x17')](_0x25a002[_0xe885('0x18')],{'raw':_0x25a002[_0xe885('0x19')]?_0x25a002[_0xe885('0x19')][_0xe885('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x159624){logger[_0xe885('0xd')](_0xe885('0x15'),_0x25a002);logger[_0xe885('0xf')](_0xe885('0x15'),_0x25a002,JSON[_0xe885('0x11')](_0x159624));_0x4f5045(_0x159624);})[_0xe885('0x1b')](function(_0x4375ff){logger[_0xe885('0x12')](_0xe885('0x15'),_0x4375ff[_0xe885('0x14')],_0x25a002);_0x39f07c(_0x365eab[_0xe885('0x12')](0x1f4,_0x4375ff['message']));});});};
\ No newline at end of file
+var _0x180f=['error','code','message','result','CreateAttachment','Attachment','create','body','options','raw','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4eda4a,_0x47d7b0){var _0x2b3249=function(_0x1eca99){while(--_0x1eca99){_0x4eda4a['push'](_0x4eda4a['shift']());}};_0x2b3249(++_0x47d7b0);}(_0x180f,0xf3));var _0xf180=function(_0xee2e7a,_0x58354d){_0xee2e7a=_0xee2e7a-0x0;var _0x319dd3=_0x180f[_0xee2e7a];return _0x319dd3;};'use strict';var _=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var moment=require('moment');var BPromise=require(_0xf180('0x2'));var rs=require(_0xf180('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf180('0x4'))['db'];var utils=require(_0xf180('0x5'));var logger=require(_0xf180('0x6'))(_0xf180('0x7'));var config=require(_0xf180('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf180('0x9')][_0xf180('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x513113,_0x47d87b,_0x1d6ca7){return new BPromise(function(_0x303412,_0x342a02){return client[_0xf180('0xb')](_0x513113,_0x1d6ca7)[_0xf180('0xc')](function(_0x4390be){logger[_0xf180('0xd')](_0xf180('0xe'),_0x47d87b,_0xf180('0xf'));logger['debug'](_0xf180('0x10'),_0x47d87b,_0xf180('0xf'),JSON[_0xf180('0x11')](_0x4390be));if(_0x4390be[_0xf180('0x12')]){if(_0x4390be[_0xf180('0x12')][_0xf180('0x13')]===0x1f4){logger[_0xf180('0x12')](_0xf180('0xe'),_0x47d87b,_0x4390be[_0xf180('0x12')][_0xf180('0x14')]);return _0x342a02(_0x4390be[_0xf180('0x12')]['message']);}logger[_0xf180('0x12')](_0xf180('0xe'),_0x47d87b,_0x4390be[_0xf180('0x12')][_0xf180('0x14')]);return _0x303412(_0x4390be['error'][_0xf180('0x14')]);}else{logger[_0xf180('0xd')](_0xf180('0xe'),_0x47d87b,'request\x20sent');_0x303412(_0x4390be[_0xf180('0x15')][_0xf180('0x14')]);}})['catch'](function(_0x115b86){logger[_0xf180('0x12')]('Attachment,\x20%s,\x20%s',_0x47d87b,_0x115b86);_0x342a02(_0x115b86);});});}exports[_0xf180('0x16')]=function(_0x14ddc6){var _0x335c78=this;return new Promise(function(_0xf7ab26,_0x3eb0db){return db[_0xf180('0x17')][_0xf180('0x18')](_0x14ddc6[_0xf180('0x19')],{'raw':_0x14ddc6[_0xf180('0x1a')]?_0x14ddc6[_0xf180('0x1a')][_0xf180('0x1b')]===undefined?!![]:![]:!![]})[_0xf180('0xc')](function(_0x180c0a){logger['info'](_0xf180('0x16'),_0x14ddc6);logger[_0xf180('0x1c')]('CreateAttachment',_0x14ddc6,JSON[_0xf180('0x11')](_0x180c0a));_0xf7ab26(_0x180c0a);})['catch'](function(_0x36aeee){logger['error'](_0xf180('0x16'),_0x36aeee[_0xf180('0x14')],_0x14ddc6);_0x3eb0db(_0x335c78['error'](0x1f4,_0x36aeee['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index bc012b6..1e3479b 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(_0x402a29,_0x561ab8){var _0x497a3a=function(_0x560760){while(--_0x560760){_0x402a29['push'](_0x402a29['shift']());}};_0x497a3a(++_0x561ab8);}(_0xadb5,0xad));var _0x5adb=function(_0x2619ee,_0x45c634){_0x2619ee=_0x2619ee-0x0;var _0x44f396=_0xadb5[_0x2619ee];return _0x44f396;};'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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0b0e,0x187));var _0xe0b0=function(_0x19dcc8,_0x4bae0e){_0x19dcc8=_0x19dcc8-0x0;var _0x2810f4=_0x0b0e[_0x19dcc8];return _0x2810f4;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index ab335fd..9787321 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 _0xdc15=['../../config/utils','../../config/environment','api','undefined','baseDN','activedirectory','url','domain','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role','disabled','blockedAt','online','admin','agent','name','clearBlockUser','getLicense','catch','status','send','message','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','password','passport','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xdc15,0xe0));var _0x5dc1=function(_0x1e9e56,_0x34a74a){_0x1e9e56=_0x1e9e56-0x0;var _0x5d5e2e=_0xdc15[_0x1e9e56];return _0x5d5e2e;};'use strict';var passport=require(_0x5dc1('0x0'));var LocalStrategy=require(_0x5dc1('0x1'))[_0x5dc1('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x5dc1('0x3'));var BPromise=require(_0x5dc1('0x4'));var util=require('util');var db=require(_0x5dc1('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x5dc1('0x6'));var config=require(_0x5dc1('0x7'));var logger=require('../../config/logger')(_0x5dc1('0x8'));function isActiveDirectoryConfigured(_0x128b7b){var _0x4c6782=![];if(typeof _0x128b7b['activedirectory']!==_0x5dc1('0x9')){_0x4c6782=_0x128b7b['activedirectory'][_0x5dc1('0xa')]&&_0x128b7b[_0x5dc1('0xb')][_0x5dc1('0xc')]&&_0x128b7b[_0x5dc1('0xb')][_0x5dc1('0xd')];}return _0x4c6782;}function adAuthenticate(_0x55c7fd,_0x5afd04,_0x4d94da){return new BPromise(function(_0x3d0ce0,_0x386f38){try{var _0x517f98=new ActiveDirectory(_0x55c7fd);_0x517f98['authenticate'](_0x5afd04,_0x4d94da,function(_0x359e03,_0x401773){if(_0x359e03){logger[_0x5dc1('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x5afd04,util['inspect'](_0x359e03,{'showHidden':![],'depth':null}));_0x386f38(_0x5dc1('0xf'));}else if(!_0x401773){logger[_0x5dc1('0xe')](_0x5dc1('0x10'),_0x5afd04);_0x386f38(_0x5dc1('0xf'));}else{_0x3d0ce0(_0x401773);}});}catch(_0x2ea434){_0x386f38(_0x2ea434);}});}function ActiveDirectoryAuthenticate(_0x2e1e3b,_0xeba0e7,_0x5df36c,_0xa779dd){var _0x46b8af,_0x2a6bb3;if(!isActiveDirectoryConfigured(config)){logger[_0x5dc1('0xe')](_0x5dc1('0x11'),_0xeba0e7);return _0xa779dd(null,![],{'message':_0x5dc1('0xf')});}return db[_0x5dc1('0x12')][_0x5dc1('0x13')]({'where':{'id':0x1},'attributes':[_0x5dc1('0x14'),_0x5dc1('0x15')],'raw':!![]})[_0x5dc1('0x16')](function(_0x412ac9){_0x46b8af=_0x412ac9;if(!_0x46b8af['adSsoEnabled']){logger[_0x5dc1('0xe')](_0x5dc1('0x17'),_0xeba0e7);throw new Error(_0x5dc1('0xf'));}return _0x2e1e3b['findOne']({'attributes':['id','name','password',_0x5dc1('0x18'),_0x5dc1('0x19'),_0x5dc1('0x1a'),'blocked',_0x5dc1('0x1b'),_0x5dc1('0x1c')],'where':{'name':_0xeba0e7,'role':{'$or':[_0x5dc1('0x1d'),'user',_0x5dc1('0x1e')]},'adSsoEnabled':!![]}});})[_0x5dc1('0x16')](function(_0x2d4ba5){if(!_0x2d4ba5||_0x2d4ba5&&_0x2d4ba5[_0x5dc1('0x1f')]!==_0xeba0e7){throw new Error(_0x5dc1('0xf'));}_0x2a6bb3=_0x2d4ba5;var _0x542e28=_0x2a6bb3[_0x5dc1('0x1f')]+'@'+config[_0x5dc1('0xb')][_0x5dc1('0xd')];return adAuthenticate(config[_0x5dc1('0xb')],_0x542e28,_0x5df36c);})['then'](function(_0x3fccf4){if(_0x2a6bb3['disabled']){throw new Error(_0x5dc1('0xf'));}if(_0x46b8af[_0x5dc1('0x15')]>0x0){if(_0x2a6bb3['blocked']){if(moment(_0x2a6bb3[_0x5dc1('0x1b')])['add'](_0x46b8af['blockDuration'],'minutes')>moment()){throw new Error(_0x5dc1('0xf'));}return utils[_0x5dc1('0x20')](_0x2a6bb3,0x0,![],null)[_0x5dc1('0x16')](function(){return utils[_0x5dc1('0x21')](_0x2a6bb3);})['then'](function(){return _0xa779dd(null,_0x2a6bb3);});}else{return utils[_0x5dc1('0x21')](_0x2a6bb3)[_0x5dc1('0x16')](function(){return _0xa779dd(null,_0x2a6bb3);});}}else{return utils[_0x5dc1('0x21')](_0x2a6bb3)['then'](function(){return _0xa779dd(null,_0x2a6bb3);});}})[_0x5dc1('0x22')](function(_0x3772c9){return _0xa779dd(null,![],_0x3772c9);});}function handleError(_0x115e5f,_0x38ebd6,_0x447388){return _0x115e5f[_0x5dc1('0x23')](_0x38ebd6||0x1f4)[_0x5dc1('0x24')]({'message':_0x447388?_0x447388[_0x5dc1('0x25')]||_0x447388:''});}exports[_0x5dc1('0x26')]=function(_0x56fb91,_0x5bcfe1,_0x332f8c){passport[_0x5dc1('0x27')]('ad-login',function(_0x151ac4,_0x1cdec7,_0x4532f2){var _0x545190=_0x151ac4||_0x4532f2;if(_0x545190){return handleError(_0x5bcfe1,0x191,_0x545190);}if(!_0x1cdec7){return handleError(_0x5bcfe1,0x194,{'message':_0x5dc1('0x28')});}else{var _0x3e6a01={'payload':{'id':_0x1cdec7['id'],'role':_0x1cdec7[_0x5dc1('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x5dc1('0x29')](_0x3e6a01)[_0x5dc1('0x16')](function(_0x97089c){_0x5bcfe1[_0x5dc1('0x2a')]({'id':_0x1cdec7['id'],'token':_0x97089c,'statusCall':'','isAlreadyLogged':_0x1cdec7[_0x5dc1('0x1c')]});});}})(_0x56fb91,_0x5bcfe1,_0x332f8c);};passport[_0x5dc1('0x2b')](_0x5dc1('0x2c'),new LocalStrategy({'usernameField':_0x5dc1('0x1f'),'passwordField':_0x5dc1('0x2d')},function(_0x4060c9,_0xe8f58,_0x4e2d4c){return ActiveDirectoryAuthenticate(db['User'],_0x4060c9,_0xe8f58,_0x4e2d4c);}));
\ No newline at end of file
+var _0xa151=['findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','role','disabled','blockedAt','admin','user','agent','name','domain','then','blocked','add','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','json','online','use','password','User','passport','passport-local','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','undefined','url','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa151,0x13d));var _0x1a15=function(_0x35940f,_0x5c1827){_0x35940f=_0x35940f-0x0;var _0xd1d3fd=_0xa151[_0x35940f];return _0xd1d3fd;};'use strict';var passport=require(_0x1a15('0x0'));var LocalStrategy=require(_0x1a15('0x1'))['Strategy'];var moment=require(_0x1a15('0x2'));var ActiveDirectory=require(_0x1a15('0x3'));var BPromise=require(_0x1a15('0x4'));var util=require('util');var db=require(_0x1a15('0x5'))['db'];var authService=require(_0x1a15('0x6'));var utils=require(_0x1a15('0x7'));var config=require('../../config/environment');var logger=require(_0x1a15('0x8'))('api');function isActiveDirectoryConfigured(_0x2ae542){var _0x29b7c5=![];if(typeof _0x2ae542[_0x1a15('0x9')]!==_0x1a15('0xa')){_0x29b7c5=_0x2ae542[_0x1a15('0x9')]['baseDN']&&_0x2ae542[_0x1a15('0x9')][_0x1a15('0xb')]&&_0x2ae542[_0x1a15('0x9')]['domain'];}return _0x29b7c5;}function adAuthenticate(_0x150f2c,_0x1f3ccc,_0x5c2978){return new BPromise(function(_0x383e53,_0x25ca9b){try{var _0x560c2a=new ActiveDirectory(_0x150f2c);_0x560c2a[_0x1a15('0xc')](_0x1f3ccc,_0x5c2978,function(_0xb2bfe9,_0x94be83){if(_0xb2bfe9){logger[_0x1a15('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x1f3ccc,util[_0x1a15('0xe')](_0xb2bfe9,{'showHidden':![],'depth':null}));_0x25ca9b(_0x1a15('0xf'));}else if(!_0x94be83){logger[_0x1a15('0xd')](_0x1a15('0x10'),_0x1f3ccc);_0x25ca9b(_0x1a15('0xf'));}else{_0x383e53(_0x94be83);}});}catch(_0x4a7cea){_0x25ca9b(_0x4a7cea);}});}function ActiveDirectoryAuthenticate(_0x437e9e,_0x10f022,_0x243932,_0x14fee1){var _0x3a3c0a,_0x4272d9;if(!isActiveDirectoryConfigured(config)){logger[_0x1a15('0xd')](_0x1a15('0x11'),_0x10f022);return _0x14fee1(null,![],{'message':_0x1a15('0xf')});}return db[_0x1a15('0x12')][_0x1a15('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x1a15('0x14')],'raw':!![]})['then'](function(_0x3d68f9){_0x3a3c0a=_0x3d68f9;if(!_0x3a3c0a[_0x1a15('0x15')]){logger[_0x1a15('0xd')](_0x1a15('0x16'),_0x10f022);throw new Error(_0x1a15('0xf'));}return _0x437e9e[_0x1a15('0x13')]({'attributes':['id','name','password','salt',_0x1a15('0x17'),_0x1a15('0x18'),'blocked',_0x1a15('0x19'),'online'],'where':{'name':_0x10f022,'role':{'$or':[_0x1a15('0x1a'),_0x1a15('0x1b'),_0x1a15('0x1c')]},'adSsoEnabled':!![]}});})['then'](function(_0x585184){if(!_0x585184||_0x585184&&_0x585184[_0x1a15('0x1d')]!==_0x10f022){throw new Error(_0x1a15('0xf'));}_0x4272d9=_0x585184;var _0x66a894=_0x4272d9[_0x1a15('0x1d')]+'@'+config[_0x1a15('0x9')][_0x1a15('0x1e')];return adAuthenticate(config[_0x1a15('0x9')],_0x66a894,_0x243932);})[_0x1a15('0x1f')](function(_0x3781c5){if(_0x4272d9[_0x1a15('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3a3c0a[_0x1a15('0x14')]>0x0){if(_0x4272d9[_0x1a15('0x20')]){if(moment(_0x4272d9['blockedAt'])[_0x1a15('0x21')](_0x3a3c0a[_0x1a15('0x14')],'minutes')>moment()){throw new Error(_0x1a15('0xf'));}return utils[_0x1a15('0x22')](_0x4272d9,0x0,![],null)['then'](function(){return utils[_0x1a15('0x23')](_0x4272d9);})[_0x1a15('0x1f')](function(){return _0x14fee1(null,_0x4272d9);});}else{return utils[_0x1a15('0x23')](_0x4272d9)[_0x1a15('0x1f')](function(){return _0x14fee1(null,_0x4272d9);});}}else{return utils['getLicense'](_0x4272d9)[_0x1a15('0x1f')](function(){return _0x14fee1(null,_0x4272d9);});}})[_0x1a15('0x24')](function(_0x5d2244){return _0x14fee1(null,![],_0x5d2244);});}function handleError(_0x51583b,_0x4b8d63,_0x443648){return _0x51583b[_0x1a15('0x25')](_0x4b8d63||0x1f4)[_0x1a15('0x26')]({'message':_0x443648?_0x443648[_0x1a15('0x27')]||_0x443648:''});}exports[_0x1a15('0x28')]=function(_0x4a8d3e,_0x5b8529,_0x22945f){passport['authenticate'](_0x1a15('0x29'),function(_0x3ab9c6,_0x487ad3,_0x2d9e95){var _0x3b0fed=_0x3ab9c6||_0x2d9e95;if(_0x3b0fed){return handleError(_0x5b8529,0x191,_0x3b0fed);}if(!_0x487ad3){return handleError(_0x5b8529,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x341dbf={'payload':{'id':_0x487ad3['id'],'role':_0x487ad3[_0x1a15('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0x1a15('0x2a')](_0x341dbf)[_0x1a15('0x1f')](function(_0x2c4766){_0x5b8529[_0x1a15('0x2b')]({'id':_0x487ad3['id'],'token':_0x2c4766,'statusCall':'','isAlreadyLogged':_0x487ad3[_0x1a15('0x2c')]});});}})(_0x4a8d3e,_0x5b8529,_0x22945f);};passport[_0x1a15('0x2d')](_0x1a15('0x29'),new LocalStrategy({'usernameField':_0x1a15('0x1d'),'passwordField':_0x1a15('0x2e')},function(_0x228da0,_0x16a2ee,_0x31c11d){return ActiveDirectoryAuthenticate(db[_0x1a15('0x2f')],_0x228da0,_0x16a2ee,_0x31c11d);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index e77f24d..f211cf1 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 _0x6f3c=['exports','./authActiveDirectory.controller','post'];(function(_0x433bd9,_0x2cdb95){var _0x37d089=function(_0x465a59){while(--_0x465a59){_0x433bd9['push'](_0x433bd9['shift']());}};_0x37d089(++_0x2cdb95);}(_0x6f3c,0x1e4));var _0xc6f3=function(_0x49e2bc,_0x2fc2c0){_0x49e2bc=_0x49e2bc-0x0;var _0x598cf0=_0x6f3c[_0x49e2bc];return _0x598cf0;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xc6f3('0x0'));router[_0xc6f3('0x1')]('/',controller['login']);module[_0xc6f3('0x2')]=router;
\ No newline at end of file
+var _0xdf98=['express','Router','post','login','exports'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0xdf98,0x104));var _0x8df9=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0xdf98[_0x4df85c];return _0x4e2a61;};'use strict';var express=require(_0x8df9('0x0'));var router=express[_0x8df9('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x8df9('0x2')]('/',controller[_0x8df9('0x3')]);module[_0x8df9('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 78bc9d8..2202e64 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(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x7a54,0x106));var _0x47a5=function(_0x6cc949,_0x3113fc){_0x6cc949=_0x6cc949-0x0;var _0x3fca8c=_0x7a54[_0x6cc949];return _0x3fca8c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x7a54,0x106));var _0x47a5=function(_0x58e131,_0x3917c6){_0x58e131=_0x58e131-0x0;var _0x399c5e=_0x7a54[_0x58e131];return _0x399c5e;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 7c54df4..7a64e7b 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 _0x832e=['get','/callback','callback','isMiddleware','setTokenCookie','express','passport','Router','../user/user.controller.js','../../components/auth/service','login'];(function(_0x43d9b0,_0x47d444){var _0x2f4302=function(_0x231a8a){while(--_0x231a8a){_0x43d9b0['push'](_0x43d9b0['shift']());}};_0x2f4302(++_0x47d444);}(_0x832e,0x118));var _0xe832=function(_0x4421f8,_0x551905){_0x4421f8=_0x4421f8-0x0;var _0xa14c73=_0x832e[_0x4421f8];return _0xa14c73;};'use strict';var express=require(_0xe832('0x0'));var passport=require(_0xe832('0x1'));var router=express[_0xe832('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xe832('0x3'));var authService=require(_0xe832('0x4'));router['get']('/',controller[_0xe832('0x5')]);router[_0xe832('0x6')](_0xe832('0x7'),controller[_0xe832('0x8')],authService[_0xe832('0x9')],userController[_0xe832('0x5')],authService[_0xe832('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0x713d=['get','login','/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x713d,0x16f));var _0xd713=function(_0x3ad92d,_0x5d3ac3){_0x3ad92d=_0x3ad92d-0x0;var _0xa856d3=_0x713d[_0x3ad92d];return _0xa856d3;};'use strict';var express=require('express');var passport=require(_0xd713('0x0'));var router=express[_0xd713('0x1')]();var controller=require(_0xd713('0x2'));var userController=require(_0xd713('0x3'));var authService=require(_0xd713('0x4'));router[_0xd713('0x5')]('/',controller[_0xd713('0x6')]);router[_0xd713('0x5')](_0xd713('0x7'),controller[_0xd713('0x8')],authService[_0xd713('0x9')],userController['login'],authService[_0xd713('0xa')]);module[_0xd713('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index e9da874..b5b6125 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 _0x60e6=['blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','SendMail','error','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','role','disabled'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x60e6,0x1c6));var _0x660e=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x60e6[_0x497b1e];return _0x3f72e1;};'use strict';var util=require(_0x660e('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x660e('0x1')];var jayson=require(_0x660e('0x2'));var _=require(_0x660e('0x3'));var rs=require(_0x660e('0x4'));var moment=require(_0x660e('0x5'));var db=require(_0x660e('0x6'))['db'];var authService=require(_0x660e('0x7'));var utils=require(_0x660e('0x8'));var client=jayson[_0x660e('0x9')][_0x660e('0xa')]({'port':0x232b});function localAuthenticate(_0x24c3dc,_0x950409,_0x5475b6,_0x3e5801){var _0x51d122,_0x491778;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x660e('0xb'),_0x660e('0xc')],'raw':!![]})[_0x660e('0xd')](function(_0x445118){_0x51d122=_0x445118;return _0x24c3dc[_0x660e('0xe')]({'attributes':['id',_0x660e('0xf'),_0x660e('0x10'),_0x660e('0x11'),_0x660e('0x12'),_0x660e('0x13'),_0x660e('0x14'),_0x660e('0x15'),_0x660e('0x16')],'where':{'name':_0x950409,'role':{'$or':[_0x660e('0x17'),_0x660e('0x18'),_0x660e('0x19')]}}});})[_0x660e('0xd')](function(_0x2aa1d0){if(!_0x2aa1d0||_0x2aa1d0&&_0x2aa1d0['name']!==_0x950409){throw new Error(_0x660e('0x1a'));}else{_0x491778=_0x2aa1d0;return _0x491778;}})['then'](function(){_0x491778['authenticate'](_0x5475b6,function(_0x16ee9b,_0x17c001){var _0x558882=_0x491778[_0x660e('0x16')]+0x1;if(_0x16ee9b){return _0x3e5801(_0x16ee9b);}else if(!_0x17c001){if(_0x491778['disabled']){return _0x3e5801(null,![],{'message':_0x660e('0x1a')});}else if(_0x51d122[_0x660e('0xb')]>0x0){if(_0x491778[_0x660e('0x14')]){if(_0x51d122['blockDuration']>0x0){if(moment(_0x491778['blockedAt'])[_0x660e('0x1b')](_0x51d122['blockDuration'],_0x660e('0x1c'))>moment()){return _0x3e5801(null,![],{'message':_0x660e('0x1a')});}else{return utils[_0x660e('0x1d')](_0x491778,_0x558882,![],null)[_0x660e('0xd')](function(){return _0x3e5801(null,![],{'message':_0x660e('0x1a')});});}}else{return _0x3e5801(null,![],{'message':_0x660e('0x1a')});}}else{if(_0x558882>=_0x51d122[_0x660e('0xb')]){return utils[_0x660e('0x1d')](_0x491778,0x0,!![],moment())[_0x660e('0xd')](function(){return _0x3e5801(null,![],{'message':_0x660e('0x1a')});});}else{return utils['clearBlockUser'](_0x491778,_0x558882,![],null)[_0x660e('0xd')](function(){return _0x3e5801(null,![],{'message':_0x660e('0x1a')});});}}}else{return _0x3e5801(null,![],{'message':_0x660e('0x1a')});}}else{if(_0x491778[_0x660e('0x13')]){return _0x3e5801(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x51d122[_0x660e('0xb')]>0x0){if(_0x491778[_0x660e('0x14')]){if(_0x51d122[_0x660e('0xc')]>0x0){if(moment(_0x491778[_0x660e('0x15')])['add'](_0x51d122['blockDuration'],_0x660e('0x1c'))>moment()){return _0x3e5801(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x660e('0x1d')](_0x491778,0x0,![],null)['then'](function(){return utils[_0x660e('0x1e')](_0x491778);})[_0x660e('0xd')](function(){return _0x3e5801(null,_0x491778);});}}else{return _0x3e5801(null,![],{'message':_0x660e('0x1a')});}}else{return utils[_0x660e('0x1d')](_0x491778,0x0,![],null)[_0x660e('0xd')](function(){return utils['getLicense'](_0x491778);})['then'](function(){return _0x3e5801(null,_0x491778);})[_0x660e('0x1f')](function(_0x1b253a){return _0x3e5801(null,![],_0x1b253a);});}}else{if(_0x491778[_0x660e('0x14')]){return _0x3e5801(null,![],{'message':_0x660e('0x1a')});}else{return utils[_0x660e('0x1e')](_0x491778)[_0x660e('0xd')](function(){return _0x3e5801(null,_0x491778);});}}}});})[_0x660e('0x1f')](function(_0xa197f0){return _0x3e5801(null,![],_0xa197f0);});}function sendServiceMail(_0x4b9a4e){return db['MailAccount'][_0x660e('0x20')]({'where':{'service':!![]},'attributes':['id',_0x660e('0xf'),_0x660e('0x21')],'include':[{'model':db['MailServerOut'],'as':_0x660e('0x22'),'include':[{'model':db[_0x660e('0x23')],'as':_0x660e('0x23')}]}]})[_0x660e('0xd')](function(_0x14baf2){if(!_0x14baf2){throw new Error(_0x660e('0x24'));}var _0x254ca6=_0x14baf2[_0x660e('0x25')]();var _0xc3d7ae={'account':_0x254ca6,'message':_['merge']({'from':util[_0x660e('0x26')]('\x22%s\x22\x20<%s>',_0x14baf2[_0x660e('0xf')],_0x14baf2['email']||_0x14baf2[_0x660e('0x22')][_0x660e('0x18')])},_0x4b9a4e)};return client['request'](_0x660e('0x27'),_0xc3d7ae);})['then'](function(_0x4ea5fc){if(_0x4ea5fc[_0x660e('0x28')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4ea5fc[_0x660e('0x28')][_0x660e('0x29')]||JSON[_0x660e('0x2a')](_0x4ea5fc[_0x660e('0x28')])));}return!![];});}function handleError(_0x3288e7,_0x14777f,_0xe1d738){return _0x3288e7[_0x660e('0x2b')](_0x14777f||0x1f4)[_0x660e('0x2c')]({'message':_0xe1d738?_0xe1d738['message']||_0xe1d738:''});}exports[_0x660e('0x2d')]=function(_0x119a8a,_0x54fd95,_0x384e55){passport[_0x660e('0x2e')](_0x660e('0x2f'),function(_0x30dbd0,_0x1012df,_0x263aa7){var _0x43dd0b=_0x30dbd0||_0x263aa7;if(_0x43dd0b){return handleError(_0x54fd95,0x191,_0x43dd0b);}if(!_0x1012df){return handleError(_0x54fd95,0x194,{'message':_0x660e('0x30')});}else{var _0x586c2a={'payload':{'id':_0x1012df['id'],'role':_0x1012df[_0x660e('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x586c2a)[_0x660e('0xd')](function(_0x2a829e){_0x54fd95['json']({'id':_0x1012df['id'],'token':_0x2a829e,'statusCall':'','isAlreadyLogged':_0x1012df['online']});});}})(_0x119a8a,_0x54fd95,_0x384e55);};exports[_0x660e('0x31')]=function(_0x52d781,_0x4c7fdc){if(!_0x52d781[_0x660e('0x32')]['email']){return handleError(_0x4c7fdc,0x1f4,{'message':_0x660e('0x33')});}var _0x3f0559=rs[_0x660e('0x34')]();_0x52d781[_0x660e('0x32')][_0x660e('0x21')]=_0x52d781['body']['email']['trim']()[_0x660e('0x35')]();var _0x414712;return db[_0x660e('0x36')][_0x660e('0xe')]({'where':{'id':0x1},'attributes':[_0x660e('0xb'),_0x660e('0xc')],'raw':!![]})[_0x660e('0xd')](function(_0x1f146c){_0x414712=_0x1f146c;return db[_0x660e('0x37')]['find']({'where':{'email':_0x52d781[_0x660e('0x32')][_0x660e('0x21')]}});})[_0x660e('0xd')](function(_0x4cce3e){if(!_0x4cce3e){throw new Error(_0x660e('0x38'));}if(_0x4cce3e['disabled']){throw new Error(_0x660e('0x39'));}if(_0x4cce3e[_0x660e('0x14')]){if(moment(_0x4cce3e[_0x660e('0x15')])[_0x660e('0x1b')](_0x414712['blockDuration'],'minutes')>moment()){throw new Error(_0x660e('0x3a'));}else{_0x4cce3e[_0x660e('0x14')]=![];_0x4cce3e[_0x660e('0x15')]=null;}}_0x4cce3e[_0x660e('0x3b')]=_0x3f0559;_0x4cce3e[_0x660e('0x3c')]=Date['now']()+0x36ee80;return _0x4cce3e[_0x660e('0x3d')]();})['then'](function(){return sendServiceMail({'to':_0x52d781[_0x660e('0x32')][_0x660e('0x21')],'subject':_0x660e('0x3e'),'text':_0x660e('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x660e('0x40')+_0x52d781[_0x660e('0x41')]['host']+_0x660e('0x42')+_0x3f0559+'\x0a\x0a'+_0x660e('0x43')});})[_0x660e('0xd')](function(){_0x4c7fdc[_0x660e('0x2b')](0xc8)[_0x660e('0x2c')]({'message':_0x660e('0x44')});})[_0x660e('0x1f')](function(_0x455da5){return handleError(_0x4c7fdc,0x1f4,_0x455da5);});};exports[_0x660e('0x45')]=function(_0x3bf0b8,_0x2c10e2){return db[_0x660e('0x37')][_0x660e('0x20')]({'where':{'resetPasswordToken':_0x3bf0b8['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x660e('0x46')]()}}})['then'](function(_0x42c62a){if(!_0x42c62a){throw new Error(_0x660e('0x47'));}return db[_0x660e('0x36')][_0x660e('0xe')]({'attributes':['id',_0x660e('0x48'),_0x660e('0x49'),_0x660e('0x4a')]})['then'](function(_0x466ef2){if(_0x466ef2[_0x660e('0x48')])authService[_0x660e('0x4b')](_0x3bf0b8[_0x660e('0x32')][_0x660e('0x10')]);if(!_0x466ef2[_0x660e('0x49')]||!_0x42c62a[_0x660e('0x4c')])return _0x42c62a;authService[_0x660e('0x4d')](_0x3bf0b8[_0x660e('0x32')][_0x660e('0x10')],_0x42c62a[_0x660e('0x4c')],_0x466ef2[_0x660e('0x4a')]);return _0x42c62a;})[_0x660e('0xd')](function(){_0x42c62a[_0x660e('0x10')]=_0x3bf0b8['body'][_0x660e('0x10')];_0x42c62a[_0x660e('0x3b')]=null;_0x42c62a[_0x660e('0x3c')]=null;return _0x42c62a['save']();});})[_0x660e('0xd')](function(){_0x2c10e2['status'](0xc8)[_0x660e('0x2c')]({'message':_0x660e('0x4e')});})[_0x660e('0x1f')](function(_0x27744a){return handleError(_0x2c10e2,0x1f4,_0x27744a);});};passport['use'](_0x660e('0x2f'),new LocalStrategy({'usernameField':_0x660e('0xf'),'passwordField':_0x660e('0x10')},function(_0xcf1a59,_0x336405,_0x2dd65d){return localAuthenticate(db[_0x660e('0x37')],_0xcf1a59,_0x336405,_0x2dd65d);}));
\ No newline at end of file
+var _0xda48=['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','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','blocked','blockedAt','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','catch','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save'];(function(_0x38b430,_0x58f4e0){var _0x19047b=function(_0x341419){while(--_0x341419){_0x38b430['push'](_0x38b430['shift']());}};_0x19047b(++_0x58f4e0);}(_0xda48,0xc2));var _0x8da4=function(_0xe91d3f,_0x5e715f){_0xe91d3f=_0xe91d3f-0x0;var _0x40b934=_0xda48[_0xe91d3f];return _0x40b934;};'use strict';var util=require(_0x8da4('0x0'));var passport=require('passport');var LocalStrategy=require(_0x8da4('0x1'))[_0x8da4('0x2')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require('randomstring');var moment=require(_0x8da4('0x3'));var db=require(_0x8da4('0x4'))['db'];var authService=require(_0x8da4('0x5'));var utils=require(_0x8da4('0x6'));var client=jayson[_0x8da4('0x7')][_0x8da4('0x8')]({'port':0x232b});function localAuthenticate(_0x49f7ee,_0x29937d,_0x23c596,_0x444c96){var _0x1e9e57,_0x4bc5b1;return db[_0x8da4('0x9')][_0x8da4('0xa')]({'where':{'id':0x1},'attributes':[_0x8da4('0xb'),'blockDuration'],'raw':!![]})[_0x8da4('0xc')](function(_0x5b635a){_0x1e9e57=_0x5b635a;return _0x49f7ee[_0x8da4('0xa')]({'attributes':['id','name',_0x8da4('0xd'),_0x8da4('0xe'),'role','disabled',_0x8da4('0xf'),_0x8da4('0x10'),_0x8da4('0x11')],'where':{'name':_0x29937d,'role':{'$or':[_0x8da4('0x12'),_0x8da4('0x13'),'agent']}}});})[_0x8da4('0xc')](function(_0x48d857){if(!_0x48d857||_0x48d857&&_0x48d857[_0x8da4('0x14')]!==_0x29937d){throw new Error(_0x8da4('0x15'));}else{_0x4bc5b1=_0x48d857;return _0x4bc5b1;}})[_0x8da4('0xc')](function(){_0x4bc5b1[_0x8da4('0x16')](_0x23c596,function(_0x4cde44,_0x541f34){var _0xd1420d=_0x4bc5b1['loginAttempts']+0x1;if(_0x4cde44){return _0x444c96(_0x4cde44);}else if(!_0x541f34){if(_0x4bc5b1[_0x8da4('0x17')]){return _0x444c96(null,![],{'message':_0x8da4('0x15')});}else if(_0x1e9e57[_0x8da4('0xb')]>0x0){if(_0x4bc5b1[_0x8da4('0xf')]){if(_0x1e9e57[_0x8da4('0x18')]>0x0){if(moment(_0x4bc5b1[_0x8da4('0x10')])[_0x8da4('0x19')](_0x1e9e57[_0x8da4('0x18')],_0x8da4('0x1a'))>moment()){return _0x444c96(null,![],{'message':_0x8da4('0x15')});}else{return utils['clearBlockUser'](_0x4bc5b1,_0xd1420d,![],null)[_0x8da4('0xc')](function(){return _0x444c96(null,![],{'message':_0x8da4('0x15')});});}}else{return _0x444c96(null,![],{'message':_0x8da4('0x15')});}}else{if(_0xd1420d>=_0x1e9e57[_0x8da4('0xb')]){return utils[_0x8da4('0x1b')](_0x4bc5b1,0x0,!![],moment())['then'](function(){return _0x444c96(null,![],{'message':_0x8da4('0x15')});});}else{return utils[_0x8da4('0x1b')](_0x4bc5b1,_0xd1420d,![],null)[_0x8da4('0xc')](function(){return _0x444c96(null,![],{'message':_0x8da4('0x15')});});}}}else{return _0x444c96(null,![],{'message':_0x8da4('0x15')});}}else{if(_0x4bc5b1[_0x8da4('0x17')]){return _0x444c96(null,![],{'message':_0x8da4('0x15')});}else if(_0x1e9e57['allowedLoginAttempts']>0x0){if(_0x4bc5b1[_0x8da4('0xf')]){if(_0x1e9e57[_0x8da4('0x18')]>0x0){if(moment(_0x4bc5b1['blockedAt'])[_0x8da4('0x19')](_0x1e9e57[_0x8da4('0x18')],'minutes')>moment()){return _0x444c96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8da4('0x1b')](_0x4bc5b1,0x0,![],null)[_0x8da4('0xc')](function(){return utils[_0x8da4('0x1c')](_0x4bc5b1);})[_0x8da4('0xc')](function(){return _0x444c96(null,_0x4bc5b1);});}}else{return _0x444c96(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x4bc5b1,0x0,![],null)[_0x8da4('0xc')](function(){return utils[_0x8da4('0x1c')](_0x4bc5b1);})[_0x8da4('0xc')](function(){return _0x444c96(null,_0x4bc5b1);})[_0x8da4('0x1d')](function(_0xeb0f02){return _0x444c96(null,![],_0xeb0f02);});}}else{if(_0x4bc5b1[_0x8da4('0xf')]){return _0x444c96(null,![],{'message':_0x8da4('0x15')});}else{return utils[_0x8da4('0x1c')](_0x4bc5b1)[_0x8da4('0xc')](function(){return _0x444c96(null,_0x4bc5b1);});}}}});})[_0x8da4('0x1d')](function(_0x4b46f1){return _0x444c96(null,![],_0x4b46f1);});}function sendServiceMail(_0x1e8d93){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x8da4('0x14'),_0x8da4('0x1e')],'include':[{'model':db[_0x8da4('0x1f')],'as':_0x8da4('0x20'),'include':[{'model':db[_0x8da4('0x21')],'as':_0x8da4('0x21')}]}]})[_0x8da4('0xc')](function(_0x49a4cf){if(!_0x49a4cf){throw new Error(_0x8da4('0x22'));}var _0x5bb804=_0x49a4cf['getSmtpOptions']();var _0x4125e3={'account':_0x5bb804,'message':_[_0x8da4('0x23')]({'from':util[_0x8da4('0x24')](_0x8da4('0x25'),_0x49a4cf[_0x8da4('0x14')],_0x49a4cf[_0x8da4('0x1e')]||_0x49a4cf[_0x8da4('0x20')]['user'])},_0x1e8d93)};return client[_0x8da4('0x26')](_0x8da4('0x27'),_0x4125e3);})[_0x8da4('0xc')](function(_0x114003){if(_0x114003['error']){throw new Error(util[_0x8da4('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x114003[_0x8da4('0x28')]['message']||JSON[_0x8da4('0x29')](_0x114003[_0x8da4('0x28')])));}return!![];});}function handleError(_0x37afb6,_0x101f0f,_0x49fad1){return _0x37afb6[_0x8da4('0x2a')](_0x101f0f||0x1f4)[_0x8da4('0x2b')]({'message':_0x49fad1?_0x49fad1[_0x8da4('0x2c')]||_0x49fad1:''});}exports[_0x8da4('0x2d')]=function(_0x47dd39,_0x503a4a,_0x123161){passport['authenticate'](_0x8da4('0x2e'),function(_0x342ddf,_0xda9358,_0x589f84){var _0x5da35e=_0x342ddf||_0x589f84;if(_0x5da35e){return handleError(_0x503a4a,0x191,_0x5da35e);}if(!_0xda9358){return handleError(_0x503a4a,0x194,{'message':_0x8da4('0x2f')});}else{var _0xb37901={'payload':{'id':_0xda9358['id'],'role':_0xda9358[_0x8da4('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0x8da4('0x31')](_0xb37901)['then'](function(_0x9c770c){_0x503a4a['json']({'id':_0xda9358['id'],'token':_0x9c770c,'statusCall':'','isAlreadyLogged':_0xda9358[_0x8da4('0x32')]});});}})(_0x47dd39,_0x503a4a,_0x123161);};exports['forgot']=function(_0x368119,_0x31942c){if(!_0x368119[_0x8da4('0x33')]['email']){return handleError(_0x31942c,0x1f4,{'message':_0x8da4('0x34')});}var _0x125000=rs[_0x8da4('0x35')]();_0x368119[_0x8da4('0x33')][_0x8da4('0x1e')]=_0x368119[_0x8da4('0x33')][_0x8da4('0x1e')][_0x8da4('0x36')]()[_0x8da4('0x37')]();var _0x3b54c9;return db[_0x8da4('0x9')][_0x8da4('0xa')]({'where':{'id':0x1},'attributes':[_0x8da4('0xb'),_0x8da4('0x18')],'raw':!![]})[_0x8da4('0xc')](function(_0x19b2f2){_0x3b54c9=_0x19b2f2;return db[_0x8da4('0x38')][_0x8da4('0x39')]({'where':{'email':_0x368119[_0x8da4('0x33')][_0x8da4('0x1e')]}});})['then'](function(_0x50d3a3){if(!_0x50d3a3){throw new Error(_0x8da4('0x3a'));}if(_0x50d3a3[_0x8da4('0x17')]){throw new Error(_0x8da4('0x3b'));}if(_0x50d3a3[_0x8da4('0xf')]){if(moment(_0x50d3a3[_0x8da4('0x10')])[_0x8da4('0x19')](_0x3b54c9[_0x8da4('0x18')],_0x8da4('0x1a'))>moment()){throw new Error(_0x8da4('0x3c'));}else{_0x50d3a3[_0x8da4('0xf')]=![];_0x50d3a3[_0x8da4('0x10')]=null;}}_0x50d3a3['resetPasswordToken']=_0x125000;_0x50d3a3[_0x8da4('0x3d')]=Date[_0x8da4('0x3e')]()+0x36ee80;return _0x50d3a3[_0x8da4('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x368119[_0x8da4('0x33')][_0x8da4('0x1e')],'subject':_0x8da4('0x40'),'text':_0x8da4('0x41')+_0x8da4('0x42')+_0x8da4('0x43')+_0x368119[_0x8da4('0x44')][_0x8da4('0x45')]+_0x8da4('0x46')+_0x125000+'\x0a\x0a'+_0x8da4('0x47')});})[_0x8da4('0xc')](function(){_0x31942c[_0x8da4('0x2a')](0xc8)[_0x8da4('0x2b')]({'message':_0x8da4('0x48')});})[_0x8da4('0x1d')](function(_0x5c40d0){return handleError(_0x31942c,0x1f4,_0x5c40d0);});};exports[_0x8da4('0x49')]=function(_0x221c7e,_0x5801b4){return db[_0x8da4('0x38')][_0x8da4('0x39')]({'where':{'resetPasswordToken':_0x221c7e[_0x8da4('0x4a')][_0x8da4('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x8da4('0x3e')]()}}})[_0x8da4('0xc')](function(_0x537a5e){if(!_0x537a5e){throw new Error(_0x8da4('0x4c'));}return db[_0x8da4('0x9')][_0x8da4('0xa')]({'attributes':['id',_0x8da4('0x4d'),_0x8da4('0x4e'),_0x8da4('0x4f')]})[_0x8da4('0xc')](function(_0x2d2fb4){if(_0x2d2fb4[_0x8da4('0x4d')])authService[_0x8da4('0x50')](_0x221c7e[_0x8da4('0x33')][_0x8da4('0xd')]);if(!_0x2d2fb4[_0x8da4('0x4e')]||!_0x537a5e['previousPasswords'])return _0x537a5e;authService[_0x8da4('0x51')](_0x221c7e['body']['password'],_0x537a5e[_0x8da4('0x52')],_0x2d2fb4[_0x8da4('0x4f')]);return _0x537a5e;})[_0x8da4('0xc')](function(){_0x537a5e[_0x8da4('0xd')]=_0x221c7e['body'][_0x8da4('0xd')];_0x537a5e[_0x8da4('0x53')]=null;_0x537a5e['resetPasswordExpires']=null;return _0x537a5e[_0x8da4('0x3f')]();});})['then'](function(){_0x5801b4[_0x8da4('0x2a')](0xc8)['send']({'message':_0x8da4('0x54')});})[_0x8da4('0x1d')](function(_0x5a4334){return handleError(_0x5801b4,0x1f4,_0x5a4334);});};passport[_0x8da4('0x55')](_0x8da4('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0x8da4('0xd')},function(_0xf33a8d,_0x1d4dce,_0x5613f5){return localAuthenticate(db[_0x8da4('0x38')],_0xf33a8d,_0x1d4dce,_0x5613f5);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index cd4d373..ab81803 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 _0x329d=['/reset/:token','reset','express','Router','post','forgot'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x329d,0x7a));var _0xd329=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0x329d[_0x21b36c];return _0x236627;};'use strict';var express=require(_0xd329('0x0'));var router=express[_0xd329('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0xd329('0x2')]('/forgot',controller[_0xd329('0x3')]);router['post'](_0xd329('0x4'),controller[_0xd329('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x8c29=['post','/forgot','forgot','reset','exports','express','Router','./authLocal.controller'];(function(_0x3c48de,_0x40602e){var _0x17942d=function(_0xefb110){while(--_0xefb110){_0x3c48de['push'](_0x3c48de['shift']());}};_0x17942d(++_0x40602e);}(_0x8c29,0x1dd));var _0x98c2=function(_0x179f89,_0x14cdb5){_0x179f89=_0x179f89-0x0;var _0x24632f=_0x8c29[_0x179f89];return _0x24632f;};'use strict';var express=require(_0x98c2('0x0'));var router=express[_0x98c2('0x1')]();var controller=require(_0x98c2('0x2'));router['post']('/',controller['login']);router[_0x98c2('0x3')](_0x98c2('0x4'),controller[_0x98c2('0x5')]);router['post']('/reset/:token',controller[_0x98c2('0x6')]);module[_0x98c2('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index f1898aa..24521eb 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 _0x3b7f=['STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b7f,0xd1));var _0xf3b7=function(_0x2aa1d7,_0x1b35d2){_0x2aa1d7=_0x2aa1d7-0x0;var _0x44ce7d=_0x3b7f[_0x2aa1d7];return _0x44ce7d;};'use strict';var Sequelize=require(_0xf3b7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xf3b7('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xf3b7('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x11a9=['STRING','INTEGER'];(function(_0x445892,_0x6afa21){var _0x1a0169=function(_0x7aec7a){while(--_0x7aec7a){_0x445892['push'](_0x445892['shift']());}};_0x1a0169(++_0x6afa21);}(_0x11a9,0x176));var _0x911a=function(_0x57d53e,_0x4f8f69){_0x57d53e=_0x57d53e-0x0;var _0x56525e=_0x11a9[_0x57d53e];return _0x56525e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x911a('0x0')]},'description':{'type':Sequelize[_0x911a('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x911a('0x1')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 2103c34..21dbd41 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 _0x9728=['where','VIRTUAL','options','count','findAll','rows','catch','show','params','includeAll','find','create','body','addConditions','Condition','omit','ids','getConditions','nolimit','getActions','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','apply','save','update','then','destroy','end','name','send','index','map','Automation','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge'];(function(_0x292967,_0x15053b){var _0xa27097=function(_0x1f2ea9){while(--_0x1f2ea9){_0x292967['push'](_0x292967['shift']());}};_0xa27097(++_0x15053b);}(_0x9728,0xb7));var _0x8972=function(_0xf32424,_0x57f56d){_0xf32424=_0xf32424-0x0;var _0x3290ce=_0x9728[_0xf32424];return _0x3290ce;};'use strict';var emlformat=require(_0x8972('0x0'));var rimraf=require(_0x8972('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8972('0x2'));var rp=require(_0x8972('0x3'));var moment=require(_0x8972('0x4'));var BPromise=require(_0x8972('0x5'));var Mustache=require(_0x8972('0x6'));var util=require(_0x8972('0x7'));var path=require(_0x8972('0x8'));var sox=require(_0x8972('0x9'));var csv=require(_0x8972('0xa'));var ejs=require(_0x8972('0xb'));var fs=require('fs');var fs_extra=require(_0x8972('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8972('0xd'));var jsforce=require(_0x8972('0xe'));var deskjs=require(_0x8972('0xf'));var toCsv=require(_0x8972('0xa'));var querystring=require('querystring');var Papa=require(_0x8972('0x10'));var Redis=require(_0x8972('0x11'));var authService=require(_0x8972('0x12'));var qs=require(_0x8972('0x13'));var as=require(_0x8972('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8972('0x15'))(_0x8972('0x16'));var utils=require(_0x8972('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8972('0x18'));var db=require(_0x8972('0x19'))['db'];function respondWithStatusCode(_0x3d9268,_0x1c55cd){_0x1c55cd=_0x1c55cd||0xcc;return function(_0x54e230){if(_0x54e230){return _0x3d9268[_0x8972('0x1a')](_0x1c55cd);}return _0x3d9268[_0x8972('0x1b')](_0x1c55cd)['end']();};}function respondWithResult(_0x3249bd,_0x3ecf3c){_0x3ecf3c=_0x3ecf3c||0xc8;return function(_0x82f71e){if(_0x82f71e){return _0x3249bd[_0x8972('0x1b')](_0x3ecf3c)[_0x8972('0x1c')](_0x82f71e);}};}function respondWithFilteredResult(_0x3b6000,_0xa2fe5c){return function(_0x841e7d){if(_0x841e7d){var _0x57b82f=typeof _0xa2fe5c['offset']===_0x8972('0x1d')&&typeof _0xa2fe5c[_0x8972('0x1e')]===_0x8972('0x1d');var _0x2802d1=_0x841e7d['count'];var _0x88ad1c=_0x57b82f?0x0:_0xa2fe5c[_0x8972('0x1f')];var _0xb138e9=_0x57b82f?_0x841e7d['count']:_0xa2fe5c['offset']+_0xa2fe5c[_0x8972('0x1e')];var _0x2e9bf1;if(_0xb138e9>=_0x2802d1){_0xb138e9=_0x2802d1;_0x2e9bf1=0xc8;}else{_0x2e9bf1=0xce;}_0x3b6000[_0x8972('0x1b')](_0x2e9bf1);return _0x3b6000[_0x8972('0x20')]('Content-Range',_0x88ad1c+'-'+_0xb138e9+'/'+_0x2802d1)[_0x8972('0x1c')](_0x841e7d);}return null;};}function patchUpdates(_0x989664){return function(_0x1d64f3){try{jsonpatch[_0x8972('0x21')](_0x1d64f3,_0x989664,!![]);}catch(_0x2b368d){return BPromise['reject'](_0x2b368d);}return _0x1d64f3[_0x8972('0x22')]();};}function saveUpdates(_0x4575f5,_0x55625b){return function(_0x22f08d){if(_0x22f08d){return _0x22f08d[_0x8972('0x23')](_0x4575f5)[_0x8972('0x24')](function(_0x3a910e){return _0x3a910e;});}return null;};}function removeEntity(_0x4c4ab0,_0x4774b1){return function(_0x2c080d){if(_0x2c080d){return _0x2c080d[_0x8972('0x25')]()[_0x8972('0x24')](function(){_0x4c4ab0['status'](0xcc)[_0x8972('0x26')]();});}};}function handleEntityNotFound(_0x2ceb26,_0x297c2e){return function(_0x1ea200){if(!_0x1ea200){_0x2ceb26['sendStatus'](0x194);}return _0x1ea200;};}function handleError(_0x466059,_0x1553a3){_0x1553a3=_0x1553a3||0x1f4;return function(_0x3e45c1){logger['error'](_0x3e45c1['stack']);if(_0x3e45c1[_0x8972('0x27')]){delete _0x3e45c1['name'];}_0x466059[_0x8972('0x1b')](_0x1553a3)[_0x8972('0x28')](_0x3e45c1);};}exports[_0x8972('0x29')]=function(_0x568c1c,_0xe63df6){var _0x35f134={},_0x254e23={},_0x12c0be={'count':0x0,'rows':[]};var _0x3d6dd8=_[_0x8972('0x2a')](db[_0x8972('0x2b')][_0x8972('0x2c')],function(_0x216fec){return{'name':_0x216fec['fieldName'],'type':_0x216fec[_0x8972('0x2d')]['key']};});_0x254e23['model']=_[_0x8972('0x2a')](_0x3d6dd8,_0x8972('0x27'));_0x254e23[_0x8972('0x2e')]=_[_0x8972('0x2f')](_0x568c1c['query']);_0x254e23[_0x8972('0x30')]=_[_0x8972('0x31')](_0x254e23[_0x8972('0x32')],_0x254e23[_0x8972('0x2e')]);_0x35f134[_0x8972('0x33')]=_['intersection'](_0x254e23['model'],qs[_0x8972('0x34')](_0x568c1c[_0x8972('0x2e')]['fields']));_0x35f134[_0x8972('0x33')]=_0x35f134[_0x8972('0x33')][_0x8972('0x35')]?_0x35f134[_0x8972('0x33')]:_0x254e23[_0x8972('0x32')];if(!_0x568c1c[_0x8972('0x2e')][_0x8972('0x36')]('nolimit')){_0x35f134[_0x8972('0x1e')]=qs[_0x8972('0x1e')](_0x568c1c['query'][_0x8972('0x1e')]);_0x35f134[_0x8972('0x1f')]=qs[_0x8972('0x1f')](_0x568c1c[_0x8972('0x2e')]['offset']);}_0x35f134[_0x8972('0x37')]=qs[_0x8972('0x38')](_0x568c1c[_0x8972('0x2e')][_0x8972('0x38')]);_0x35f134['where']=qs[_0x8972('0x30')](_[_0x8972('0x39')](_0x568c1c[_0x8972('0x2e')],_0x254e23[_0x8972('0x30')]),_0x3d6dd8);if(_0x568c1c[_0x8972('0x2e')][_0x8972('0x3a')]){_0x35f134['where']=_[_0x8972('0x3b')](_0x35f134[_0x8972('0x3c')],{'$or':_['map'](_0x3d6dd8,function(_0x47f208){if(_0x47f208['type']!==_0x8972('0x3d')){var _0x16319f={};_0x16319f[_0x47f208['name']]={'$like':'%'+_0x568c1c[_0x8972('0x2e')][_0x8972('0x3a')]+'%'};return _0x16319f;}})});}_0x35f134=_[_0x8972('0x3b')]({},_0x35f134,_0x568c1c[_0x8972('0x3e')]);var _0x16eea0={'where':_0x35f134['where']};return db[_0x8972('0x2b')][_0x8972('0x3f')](_0x16eea0)[_0x8972('0x24')](function(_0x29d1b4){_0x12c0be['count']=_0x29d1b4;if(_0x568c1c[_0x8972('0x2e')]['includeAll']){_0x35f134['include']=[{'all':!![]}];}return db[_0x8972('0x2b')][_0x8972('0x40')](_0x35f134);})[_0x8972('0x24')](function(_0xd86a3d){_0x12c0be[_0x8972('0x41')]=_0xd86a3d;return _0x12c0be;})[_0x8972('0x24')](respondWithFilteredResult(_0xe63df6,_0x35f134))[_0x8972('0x42')](handleError(_0xe63df6,null));};exports[_0x8972('0x43')]=function(_0x4010ae,_0xe47930){var _0x2c4777={'raw':![],'where':{'id':_0x4010ae[_0x8972('0x44')]['id']}},_0x2ceca3={};_0x2ceca3[_0x8972('0x32')]=_['keys'](db[_0x8972('0x2b')][_0x8972('0x2c')]);_0x2ceca3[_0x8972('0x2e')]=_[_0x8972('0x2f')](_0x4010ae[_0x8972('0x2e')]);_0x2ceca3[_0x8972('0x30')]=_[_0x8972('0x31')](_0x2ceca3[_0x8972('0x32')],_0x2ceca3[_0x8972('0x2e')]);_0x2c4777[_0x8972('0x33')]=_[_0x8972('0x31')](_0x2ceca3[_0x8972('0x32')],qs[_0x8972('0x34')](_0x4010ae[_0x8972('0x2e')]['fields']));_0x2c4777[_0x8972('0x33')]=_0x2c4777[_0x8972('0x33')][_0x8972('0x35')]?_0x2c4777['attributes']:_0x2ceca3[_0x8972('0x32')];if(_0x4010ae[_0x8972('0x2e')][_0x8972('0x45')]){_0x2c4777['include']=[{'all':!![]}];}_0x2c4777=_['merge']({},_0x2c4777,_0x4010ae[_0x8972('0x3e')]);return db[_0x8972('0x2b')][_0x8972('0x46')](_0x2c4777)[_0x8972('0x24')](handleEntityNotFound(_0xe47930,null))[_0x8972('0x24')](respondWithResult(_0xe47930,null))['catch'](handleError(_0xe47930,null));};exports['create']=function(_0x396e5b,_0x1fb94b){return db['Automation'][_0x8972('0x47')](_0x396e5b[_0x8972('0x48')],{})[_0x8972('0x24')](respondWithResult(_0x1fb94b,0xc9))[_0x8972('0x42')](handleError(_0x1fb94b,null));};exports[_0x8972('0x23')]=function(_0x33da77,_0x1c88a4){if(_0x33da77[_0x8972('0x48')]['id']){delete _0x33da77[_0x8972('0x48')]['id'];}return db[_0x8972('0x2b')][_0x8972('0x46')]({'where':{'id':_0x33da77[_0x8972('0x44')]['id']}})[_0x8972('0x24')](handleEntityNotFound(_0x1c88a4,null))[_0x8972('0x24')](saveUpdates(_0x33da77[_0x8972('0x48')],null))[_0x8972('0x24')](respondWithResult(_0x1c88a4,null))[_0x8972('0x42')](handleError(_0x1c88a4,null));};exports[_0x8972('0x25')]=function(_0x1697e3,_0x198ef6){return db['Automation'][_0x8972('0x46')]({'where':{'id':_0x1697e3[_0x8972('0x44')]['id']}})['then'](handleEntityNotFound(_0x198ef6,null))[_0x8972('0x24')](removeEntity(_0x198ef6,null))[_0x8972('0x42')](handleError(_0x198ef6,null));};exports[_0x8972('0x49')]=function(_0x5ab797,_0x33098f,_0x450420){return db[_0x8972('0x4a')]['find']({'where':{'id':_0x5ab797[_0x8972('0x44')]['id']}})[_0x8972('0x24')](handleEntityNotFound(_0x33098f,null))[_0x8972('0x24')](function(_0x5f5659){if(_0x5f5659){return _0x5f5659[_0x8972('0x49')](_0x5ab797[_0x8972('0x48')]['ids'],_[_0x8972('0x4b')](_0x5ab797['body'],[_0x8972('0x4c'),'id'])||{});}})[_0x8972('0x24')](respondWithResult(_0x33098f,null))[_0x8972('0x42')](handleError(_0x33098f,null));};exports[_0x8972('0x4d')]=function(_0x22b378,_0x1efcc7,_0x22abf5){var _0x53924d={};var _0xfb1021={};var _0x30d098;var _0x40452d;return db[_0x8972('0x2b')]['findOne']({'where':{'id':_0x22b378[_0x8972('0x44')]['id']}})[_0x8972('0x24')](handleEntityNotFound(_0x1efcc7,null))['then'](function(_0x269491){if(_0x269491){_0x30d098=_0x269491;_0xfb1021[_0x8972('0x32')]=_[_0x8972('0x2f')](db['Condition'][_0x8972('0x2c')]);_0xfb1021[_0x8972('0x2e')]=_[_0x8972('0x2f')](_0x22b378[_0x8972('0x2e')]);_0xfb1021[_0x8972('0x30')]=_[_0x8972('0x31')](_0xfb1021[_0x8972('0x32')],_0xfb1021['query']);_0x53924d[_0x8972('0x33')]=_[_0x8972('0x31')](_0xfb1021[_0x8972('0x32')],qs['fields'](_0x22b378['query'][_0x8972('0x34')]));_0x53924d[_0x8972('0x33')]=_0x53924d[_0x8972('0x33')]['length']?_0x53924d[_0x8972('0x33')]:_0xfb1021[_0x8972('0x32')];_0x53924d[_0x8972('0x37')]=qs[_0x8972('0x38')](_0x22b378['query'][_0x8972('0x38')]);_0x53924d[_0x8972('0x3c')]=qs[_0x8972('0x30')](_['pick'](_0x22b378[_0x8972('0x2e')],_0xfb1021[_0x8972('0x30')]));if(_0x22b378['query'][_0x8972('0x3a')]){_0x53924d[_0x8972('0x3c')]=_[_0x8972('0x3b')](_0x53924d[_0x8972('0x3c')],{'$or':_[_0x8972('0x2a')](_0x53924d[_0x8972('0x33')],function(_0x125c9c){var _0x3e927a={};_0x3e927a[_0x125c9c]={'$like':'%'+_0x22b378[_0x8972('0x2e')][_0x8972('0x3a')]+'%'};return _0x3e927a;})});}_0x53924d=_['merge']({},_0x53924d,_0x22b378[_0x8972('0x3e')]);return _0x30d098['getConditions'](_0x53924d);}})[_0x8972('0x24')](function(_0x3b2bea){if(_0x3b2bea){_0x40452d=_0x3b2bea[_0x8972('0x35')];if(!_0x22b378['query']['hasOwnProperty'](_0x8972('0x4e'))){_0x53924d[_0x8972('0x1e')]=qs[_0x8972('0x1e')](_0x22b378[_0x8972('0x2e')]['limit']);_0x53924d['offset']=qs['offset'](_0x22b378[_0x8972('0x2e')][_0x8972('0x1f')]);}return _0x30d098[_0x8972('0x4d')](_0x53924d);}})[_0x8972('0x24')](function(_0x51b243){if(_0x51b243){return _0x51b243?{'count':_0x40452d,'rows':_0x51b243}:null;}})['then'](respondWithResult(_0x1efcc7,null))[_0x8972('0x42')](handleError(_0x1efcc7,null));};exports['addActions']=function(_0x500ea2,_0x1a9f8d,_0x33b2b7){return db['Action'][_0x8972('0x46')]({'where':{'id':_0x500ea2['params']['id']}})[_0x8972('0x24')](handleEntityNotFound(_0x1a9f8d,null))[_0x8972('0x24')](function(_0x150460){if(_0x150460){return _0x150460['addActions'](_0x500ea2['body'][_0x8972('0x4c')],_[_0x8972('0x4b')](_0x500ea2[_0x8972('0x48')],['ids','id'])||{});}})[_0x8972('0x24')](respondWithResult(_0x1a9f8d,null))[_0x8972('0x42')](handleError(_0x1a9f8d,null));};exports[_0x8972('0x4f')]=function(_0x3b0d20,_0x12adba,_0x500489){var _0x7505c1={};var _0x487d12={};var _0x3e7bcf;var _0x30729d;return db[_0x8972('0x2b')][_0x8972('0x50')]({'where':{'id':_0x3b0d20[_0x8972('0x44')]['id']}})['then'](handleEntityNotFound(_0x12adba,null))[_0x8972('0x24')](function(_0x49e556){if(_0x49e556){_0x3e7bcf=_0x49e556;_0x487d12['model']=_[_0x8972('0x2f')](db['Action'][_0x8972('0x2c')]);_0x487d12[_0x8972('0x2e')]=_[_0x8972('0x2f')](_0x3b0d20[_0x8972('0x2e')]);_0x487d12[_0x8972('0x30')]=_[_0x8972('0x31')](_0x487d12[_0x8972('0x32')],_0x487d12[_0x8972('0x2e')]);_0x7505c1['attributes']=_[_0x8972('0x31')](_0x487d12[_0x8972('0x32')],qs[_0x8972('0x34')](_0x3b0d20[_0x8972('0x2e')][_0x8972('0x34')]));_0x7505c1[_0x8972('0x33')]=_0x7505c1['attributes']['length']?_0x7505c1[_0x8972('0x33')]:_0x487d12[_0x8972('0x32')];_0x7505c1[_0x8972('0x37')]=qs[_0x8972('0x38')](_0x3b0d20[_0x8972('0x2e')][_0x8972('0x38')]);_0x7505c1[_0x8972('0x3c')]=qs['filters'](_[_0x8972('0x39')](_0x3b0d20[_0x8972('0x2e')],_0x487d12[_0x8972('0x30')]));if(_0x3b0d20['query']['filter']){_0x7505c1[_0x8972('0x3c')]=_[_0x8972('0x3b')](_0x7505c1['where'],{'$or':_[_0x8972('0x2a')](_0x7505c1[_0x8972('0x33')],function(_0x5a610c){var _0x252e10={};_0x252e10[_0x5a610c]={'$like':'%'+_0x3b0d20['query'][_0x8972('0x3a')]+'%'};return _0x252e10;})});}_0x7505c1=_[_0x8972('0x3b')]({},_0x7505c1,_0x3b0d20[_0x8972('0x3e')]);return _0x3e7bcf[_0x8972('0x4f')](_0x7505c1);}})[_0x8972('0x24')](function(_0xfc723d){if(_0xfc723d){_0x30729d=_0xfc723d[_0x8972('0x35')];if(!_0x3b0d20[_0x8972('0x2e')][_0x8972('0x36')](_0x8972('0x4e'))){_0x7505c1[_0x8972('0x1e')]=qs[_0x8972('0x1e')](_0x3b0d20[_0x8972('0x2e')][_0x8972('0x1e')]);_0x7505c1[_0x8972('0x1f')]=qs[_0x8972('0x1f')](_0x3b0d20[_0x8972('0x2e')][_0x8972('0x1f')]);}return _0x3e7bcf[_0x8972('0x4f')](_0x7505c1);}})[_0x8972('0x24')](function(_0x1d0359){if(_0x1d0359){return _0x1d0359?{'count':_0x30729d,'rows':_0x1d0359}:null;}})[_0x8972('0x24')](respondWithResult(_0x12adba,null))[_0x8972('0x42')](handleError(_0x12adba,null));};
\ No newline at end of file
+var _0x65dd=['Condition','ids','findOne','getConditions','addActions','getActions','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','Automation','includeAll','include','findAll','rows','catch','params','keys','options','create','body','update','find','addConditions'];(function(_0x40f310,_0x33f8ba){var _0x414b2d=function(_0x23aa85){while(--_0x23aa85){_0x40f310['push'](_0x40f310['shift']());}};_0x414b2d(++_0x33f8ba);}(_0x65dd,0x14b));var _0xd65d=function(_0x1221eb,_0x5324be){_0x1221eb=_0x1221eb-0x0;var _0x39cc1b=_0x65dd[_0x1221eb];return _0x39cc1b;};'use strict';var emlformat=require(_0xd65d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd65d('0x1'));var jsonpatch=require(_0xd65d('0x2'));var rp=require(_0xd65d('0x3'));var moment=require(_0xd65d('0x4'));var BPromise=require(_0xd65d('0x5'));var Mustache=require(_0xd65d('0x6'));var util=require(_0xd65d('0x7'));var path=require('path');var sox=require(_0xd65d('0x8'));var csv=require(_0xd65d('0x9'));var ejs=require(_0xd65d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd65d('0xb'));var jsforce=require(_0xd65d('0xc'));var deskjs=require(_0xd65d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd65d('0xe'));var Redis=require(_0xd65d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd65d('0x10'));var hardwareService=require(_0xd65d('0x11'));var logger=require('../../config/logger')(_0xd65d('0x12'));var utils=require(_0xd65d('0x13'));var config=require(_0xd65d('0x14'));var licenseUtil=require(_0xd65d('0x15'));var db=require(_0xd65d('0x16'))['db'];function respondWithStatusCode(_0x41f4e5,_0xddb65){_0xddb65=_0xddb65||0xcc;return function(_0x358cc5){if(_0x358cc5){return _0x41f4e5['sendStatus'](_0xddb65);}return _0x41f4e5[_0xd65d('0x17')](_0xddb65)[_0xd65d('0x18')]();};}function respondWithResult(_0x49eadc,_0x5f2ac2){_0x5f2ac2=_0x5f2ac2||0xc8;return function(_0x364369){if(_0x364369){return _0x49eadc[_0xd65d('0x17')](_0x5f2ac2)['json'](_0x364369);}};}function respondWithFilteredResult(_0x56d9b6,_0x25118b){return function(_0x2a4071){if(_0x2a4071){var _0x480263=typeof _0x25118b[_0xd65d('0x19')]===_0xd65d('0x1a')&&typeof _0x25118b[_0xd65d('0x1b')]===_0xd65d('0x1a');var _0x2e68ae=_0x2a4071[_0xd65d('0x1c')];var _0x3f8e30=_0x480263?0x0:_0x25118b[_0xd65d('0x19')];var _0x129dc7=_0x480263?_0x2a4071['count']:_0x25118b['offset']+_0x25118b[_0xd65d('0x1b')];var _0x57df4b;if(_0x129dc7>=_0x2e68ae){_0x129dc7=_0x2e68ae;_0x57df4b=0xc8;}else{_0x57df4b=0xce;}_0x56d9b6[_0xd65d('0x17')](_0x57df4b);return _0x56d9b6[_0xd65d('0x1d')]('Content-Range',_0x3f8e30+'-'+_0x129dc7+'/'+_0x2e68ae)['json'](_0x2a4071);}return null;};}function patchUpdates(_0xd1c871){return function(_0x3815cc){try{jsonpatch[_0xd65d('0x1e')](_0x3815cc,_0xd1c871,!![]);}catch(_0x47bfed){return BPromise[_0xd65d('0x1f')](_0x47bfed);}return _0x3815cc[_0xd65d('0x20')]();};}function saveUpdates(_0x499973,_0x5cb0dc){return function(_0xeaf033){if(_0xeaf033){return _0xeaf033['update'](_0x499973)[_0xd65d('0x21')](function(_0x14fa0d){return _0x14fa0d;});}return null;};}function removeEntity(_0x3f5c98,_0x56fa74){return function(_0x24c52a){if(_0x24c52a){return _0x24c52a[_0xd65d('0x22')]()['then'](function(){_0x3f5c98[_0xd65d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x158468,_0x5206ef){return function(_0x50e306){if(!_0x50e306){_0x158468['sendStatus'](0x194);}return _0x50e306;};}function handleError(_0x4b8a4a,_0x3d8bd8){_0x3d8bd8=_0x3d8bd8||0x1f4;return function(_0x524c4a){logger[_0xd65d('0x23')](_0x524c4a[_0xd65d('0x24')]);if(_0x524c4a[_0xd65d('0x25')]){delete _0x524c4a[_0xd65d('0x25')];}_0x4b8a4a[_0xd65d('0x17')](_0x3d8bd8)[_0xd65d('0x26')](_0x524c4a);};}exports[_0xd65d('0x27')]=function(_0x38ade9,_0x31d787){var _0x3860e9={},_0x7a3cb2={},_0x43c1ab={'count':0x0,'rows':[]};var _0x2765e8=_[_0xd65d('0x28')](db['Automation'][_0xd65d('0x29')],function(_0x17b6c8){return{'name':_0x17b6c8[_0xd65d('0x2a')],'type':_0x17b6c8[_0xd65d('0x2b')][_0xd65d('0x2c')]};});_0x7a3cb2['model']=_['map'](_0x2765e8,_0xd65d('0x25'));_0x7a3cb2[_0xd65d('0x2d')]=_['keys'](_0x38ade9[_0xd65d('0x2d')]);_0x7a3cb2[_0xd65d('0x2e')]=_[_0xd65d('0x2f')](_0x7a3cb2[_0xd65d('0x30')],_0x7a3cb2[_0xd65d('0x2d')]);_0x3860e9[_0xd65d('0x31')]=_['intersection'](_0x7a3cb2[_0xd65d('0x30')],qs[_0xd65d('0x32')](_0x38ade9['query']['fields']));_0x3860e9[_0xd65d('0x31')]=_0x3860e9['attributes'][_0xd65d('0x33')]?_0x3860e9['attributes']:_0x7a3cb2[_0xd65d('0x30')];if(!_0x38ade9[_0xd65d('0x2d')][_0xd65d('0x34')](_0xd65d('0x35'))){_0x3860e9[_0xd65d('0x1b')]=qs['limit'](_0x38ade9['query'][_0xd65d('0x1b')]);_0x3860e9[_0xd65d('0x19')]=qs[_0xd65d('0x19')](_0x38ade9['query'][_0xd65d('0x19')]);}_0x3860e9[_0xd65d('0x36')]=qs['sort'](_0x38ade9[_0xd65d('0x2d')][_0xd65d('0x37')]);_0x3860e9['where']=qs['filters'](_['pick'](_0x38ade9[_0xd65d('0x2d')],_0x7a3cb2['filters']),_0x2765e8);if(_0x38ade9['query'][_0xd65d('0x38')]){_0x3860e9[_0xd65d('0x39')]=_[_0xd65d('0x3a')](_0x3860e9[_0xd65d('0x39')],{'$or':_['map'](_0x2765e8,function(_0x2322e4){if(_0x2322e4[_0xd65d('0x2b')]!==_0xd65d('0x3b')){var _0x38bc5c={};_0x38bc5c[_0x2322e4[_0xd65d('0x25')]]={'$like':'%'+_0x38ade9[_0xd65d('0x2d')][_0xd65d('0x38')]+'%'};return _0x38bc5c;}})});}_0x3860e9=_['merge']({},_0x3860e9,_0x38ade9['options']);var _0x803bde={'where':_0x3860e9[_0xd65d('0x39')]};return db[_0xd65d('0x3c')]['count'](_0x803bde)['then'](function(_0x2ebf52){_0x43c1ab['count']=_0x2ebf52;if(_0x38ade9['query'][_0xd65d('0x3d')]){_0x3860e9[_0xd65d('0x3e')]=[{'all':!![]}];}return db[_0xd65d('0x3c')][_0xd65d('0x3f')](_0x3860e9);})['then'](function(_0x5cbb34){_0x43c1ab[_0xd65d('0x40')]=_0x5cbb34;return _0x43c1ab;})['then'](respondWithFilteredResult(_0x31d787,_0x3860e9))[_0xd65d('0x41')](handleError(_0x31d787,null));};exports['show']=function(_0x4a3d57,_0x251a76){var _0x1f9b3a={'raw':![],'where':{'id':_0x4a3d57[_0xd65d('0x42')]['id']}},_0x3ff2a8={};_0x3ff2a8['model']=_[_0xd65d('0x43')](db['Automation'][_0xd65d('0x29')]);_0x3ff2a8[_0xd65d('0x2d')]=_[_0xd65d('0x43')](_0x4a3d57[_0xd65d('0x2d')]);_0x3ff2a8[_0xd65d('0x2e')]=_['intersection'](_0x3ff2a8[_0xd65d('0x30')],_0x3ff2a8[_0xd65d('0x2d')]);_0x1f9b3a[_0xd65d('0x31')]=_[_0xd65d('0x2f')](_0x3ff2a8['model'],qs['fields'](_0x4a3d57[_0xd65d('0x2d')][_0xd65d('0x32')]));_0x1f9b3a['attributes']=_0x1f9b3a[_0xd65d('0x31')][_0xd65d('0x33')]?_0x1f9b3a[_0xd65d('0x31')]:_0x3ff2a8[_0xd65d('0x30')];if(_0x4a3d57[_0xd65d('0x2d')][_0xd65d('0x3d')]){_0x1f9b3a['include']=[{'all':!![]}];}_0x1f9b3a=_[_0xd65d('0x3a')]({},_0x1f9b3a,_0x4a3d57[_0xd65d('0x44')]);return db[_0xd65d('0x3c')]['find'](_0x1f9b3a)[_0xd65d('0x21')](handleEntityNotFound(_0x251a76,null))['then'](respondWithResult(_0x251a76,null))[_0xd65d('0x41')](handleError(_0x251a76,null));};exports[_0xd65d('0x45')]=function(_0x1de8fa,_0x2502db){return db['Automation'][_0xd65d('0x45')](_0x1de8fa[_0xd65d('0x46')],{})['then'](respondWithResult(_0x2502db,0xc9))[_0xd65d('0x41')](handleError(_0x2502db,null));};exports[_0xd65d('0x47')]=function(_0x95ae0c,_0x5a2a93){if(_0x95ae0c['body']['id']){delete _0x95ae0c[_0xd65d('0x46')]['id'];}return db[_0xd65d('0x3c')][_0xd65d('0x48')]({'where':{'id':_0x95ae0c['params']['id']}})['then'](handleEntityNotFound(_0x5a2a93,null))[_0xd65d('0x21')](saveUpdates(_0x95ae0c['body'],null))[_0xd65d('0x21')](respondWithResult(_0x5a2a93,null))[_0xd65d('0x41')](handleError(_0x5a2a93,null));};exports['destroy']=function(_0x3bb75d,_0x147214){return db['Automation']['find']({'where':{'id':_0x3bb75d['params']['id']}})[_0xd65d('0x21')](handleEntityNotFound(_0x147214,null))[_0xd65d('0x21')](removeEntity(_0x147214,null))[_0xd65d('0x41')](handleError(_0x147214,null));};exports[_0xd65d('0x49')]=function(_0x311ffd,_0x212199,_0x5dcbe7){return db[_0xd65d('0x4a')]['find']({'where':{'id':_0x311ffd[_0xd65d('0x42')]['id']}})['then'](handleEntityNotFound(_0x212199,null))[_0xd65d('0x21')](function(_0x798506){if(_0x798506){return _0x798506[_0xd65d('0x49')](_0x311ffd['body'][_0xd65d('0x4b')],_['omit'](_0x311ffd[_0xd65d('0x46')],[_0xd65d('0x4b'),'id'])||{});}})[_0xd65d('0x21')](respondWithResult(_0x212199,null))['catch'](handleError(_0x212199,null));};exports['getConditions']=function(_0x14378f,_0x5cfdd4,_0x385127){var _0xc871c5={};var _0x4f1b08={};var _0xa64339;var _0x3fa5e6;return db[_0xd65d('0x3c')][_0xd65d('0x4c')]({'where':{'id':_0x14378f[_0xd65d('0x42')]['id']}})['then'](handleEntityNotFound(_0x5cfdd4,null))['then'](function(_0x394525){if(_0x394525){_0xa64339=_0x394525;_0x4f1b08[_0xd65d('0x30')]=_[_0xd65d('0x43')](db['Condition'][_0xd65d('0x29')]);_0x4f1b08[_0xd65d('0x2d')]=_[_0xd65d('0x43')](_0x14378f['query']);_0x4f1b08[_0xd65d('0x2e')]=_[_0xd65d('0x2f')](_0x4f1b08[_0xd65d('0x30')],_0x4f1b08[_0xd65d('0x2d')]);_0xc871c5[_0xd65d('0x31')]=_[_0xd65d('0x2f')](_0x4f1b08['model'],qs[_0xd65d('0x32')](_0x14378f[_0xd65d('0x2d')][_0xd65d('0x32')]));_0xc871c5['attributes']=_0xc871c5['attributes']['length']?_0xc871c5[_0xd65d('0x31')]:_0x4f1b08[_0xd65d('0x30')];_0xc871c5[_0xd65d('0x36')]=qs[_0xd65d('0x37')](_0x14378f[_0xd65d('0x2d')][_0xd65d('0x37')]);_0xc871c5[_0xd65d('0x39')]=qs[_0xd65d('0x2e')](_['pick'](_0x14378f[_0xd65d('0x2d')],_0x4f1b08[_0xd65d('0x2e')]));if(_0x14378f[_0xd65d('0x2d')][_0xd65d('0x38')]){_0xc871c5[_0xd65d('0x39')]=_['merge'](_0xc871c5['where'],{'$or':_[_0xd65d('0x28')](_0xc871c5[_0xd65d('0x31')],function(_0xfa6b29){var _0x5d2bcd={};_0x5d2bcd[_0xfa6b29]={'$like':'%'+_0x14378f[_0xd65d('0x2d')][_0xd65d('0x38')]+'%'};return _0x5d2bcd;})});}_0xc871c5=_[_0xd65d('0x3a')]({},_0xc871c5,_0x14378f['options']);return _0xa64339[_0xd65d('0x4d')](_0xc871c5);}})[_0xd65d('0x21')](function(_0x6d61df){if(_0x6d61df){_0x3fa5e6=_0x6d61df['length'];if(!_0x14378f[_0xd65d('0x2d')][_0xd65d('0x34')](_0xd65d('0x35'))){_0xc871c5[_0xd65d('0x1b')]=qs[_0xd65d('0x1b')](_0x14378f[_0xd65d('0x2d')][_0xd65d('0x1b')]);_0xc871c5[_0xd65d('0x19')]=qs[_0xd65d('0x19')](_0x14378f[_0xd65d('0x2d')][_0xd65d('0x19')]);}return _0xa64339[_0xd65d('0x4d')](_0xc871c5);}})[_0xd65d('0x21')](function(_0x8c835e){if(_0x8c835e){return _0x8c835e?{'count':_0x3fa5e6,'rows':_0x8c835e}:null;}})[_0xd65d('0x21')](respondWithResult(_0x5cfdd4,null))[_0xd65d('0x41')](handleError(_0x5cfdd4,null));};exports[_0xd65d('0x4e')]=function(_0x125183,_0xf0c59d,_0x3d666b){return db['Action'][_0xd65d('0x48')]({'where':{'id':_0x125183[_0xd65d('0x42')]['id']}})[_0xd65d('0x21')](handleEntityNotFound(_0xf0c59d,null))['then'](function(_0x2a8602){if(_0x2a8602){return _0x2a8602[_0xd65d('0x4e')](_0x125183['body']['ids'],_['omit'](_0x125183[_0xd65d('0x46')],[_0xd65d('0x4b'),'id'])||{});}})[_0xd65d('0x21')](respondWithResult(_0xf0c59d,null))[_0xd65d('0x41')](handleError(_0xf0c59d,null));};exports[_0xd65d('0x4f')]=function(_0x46e619,_0x4281db,_0x85f5c1){var _0x2393c5={};var _0x23cd7e={};var _0x2891c6;var _0x52ce0d;return db[_0xd65d('0x3c')][_0xd65d('0x4c')]({'where':{'id':_0x46e619['params']['id']}})[_0xd65d('0x21')](handleEntityNotFound(_0x4281db,null))[_0xd65d('0x21')](function(_0x3d154b){if(_0x3d154b){_0x2891c6=_0x3d154b;_0x23cd7e[_0xd65d('0x30')]=_[_0xd65d('0x43')](db['Action']['rawAttributes']);_0x23cd7e[_0xd65d('0x2d')]=_[_0xd65d('0x43')](_0x46e619[_0xd65d('0x2d')]);_0x23cd7e['filters']=_[_0xd65d('0x2f')](_0x23cd7e['model'],_0x23cd7e[_0xd65d('0x2d')]);_0x2393c5[_0xd65d('0x31')]=_['intersection'](_0x23cd7e[_0xd65d('0x30')],qs[_0xd65d('0x32')](_0x46e619[_0xd65d('0x2d')][_0xd65d('0x32')]));_0x2393c5['attributes']=_0x2393c5[_0xd65d('0x31')][_0xd65d('0x33')]?_0x2393c5[_0xd65d('0x31')]:_0x23cd7e[_0xd65d('0x30')];_0x2393c5[_0xd65d('0x36')]=qs[_0xd65d('0x37')](_0x46e619['query'][_0xd65d('0x37')]);_0x2393c5[_0xd65d('0x39')]=qs['filters'](_[_0xd65d('0x50')](_0x46e619[_0xd65d('0x2d')],_0x23cd7e[_0xd65d('0x2e')]));if(_0x46e619[_0xd65d('0x2d')]['filter']){_0x2393c5['where']=_[_0xd65d('0x3a')](_0x2393c5[_0xd65d('0x39')],{'$or':_[_0xd65d('0x28')](_0x2393c5[_0xd65d('0x31')],function(_0x18ad88){var _0x183a1a={};_0x183a1a[_0x18ad88]={'$like':'%'+_0x46e619[_0xd65d('0x2d')][_0xd65d('0x38')]+'%'};return _0x183a1a;})});}_0x2393c5=_['merge']({},_0x2393c5,_0x46e619[_0xd65d('0x44')]);return _0x2891c6[_0xd65d('0x4f')](_0x2393c5);}})[_0xd65d('0x21')](function(_0x12fca0){if(_0x12fca0){_0x52ce0d=_0x12fca0[_0xd65d('0x33')];if(!_0x46e619[_0xd65d('0x2d')]['hasOwnProperty'](_0xd65d('0x35'))){_0x2393c5[_0xd65d('0x1b')]=qs['limit'](_0x46e619[_0xd65d('0x2d')][_0xd65d('0x1b')]);_0x2393c5[_0xd65d('0x19')]=qs[_0xd65d('0x19')](_0x46e619[_0xd65d('0x2d')][_0xd65d('0x19')]);}return _0x2891c6[_0xd65d('0x4f')](_0x2393c5);}})[_0xd65d('0x21')](function(_0x428f72){if(_0x428f72){return _0x428f72?{'count':_0x52ce0d,'rows':_0x428f72}:null;}})['then'](respondWithResult(_0x4281db,null))[_0xd65d('0x41')](handleError(_0x4281db,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 2a70c14..d382268 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 _0xfa10=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x582ffc,_0xe6c9f){var _0x54d111=function(_0x41b017){while(--_0x41b017){_0x582ffc['push'](_0x582ffc['shift']());}};_0x54d111(++_0xe6c9f);}(_0xfa10,0x1cf));var _0x0fa1=function(_0x4763f8,_0x252cf3){_0x4763f8=_0x4763f8-0x0;var _0x3b254a=_0xfa10[_0x4763f8];return _0x3b254a;};'use strict';var _=require(_0x0fa1('0x0'));var util=require(_0x0fa1('0x1'));var logger=require(_0x0fa1('0x2'))(_0x0fa1('0x3'));var moment=require(_0x0fa1('0x4'));var BPromise=require(_0x0fa1('0x5'));var rp=require(_0x0fa1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fa1('0x7'));var config=require(_0x0fa1('0x8'));var attributes=require('./automation.attributes');module[_0x0fa1('0x9')]=function(_0xf2571c,_0x42eeee){return _0xf2571c[_0x0fa1('0xa')](_0x0fa1('0xb'),attributes,{'tableName':_0x0fa1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb47=['exports','Automation','tools_automations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb47,0xab));var _0x7eb4=function(_0x43185e,_0xef8549){_0x43185e=_0x43185e-0x0;var _0x34350e=_0xeb47[_0x43185e];return _0x34350e;};'use strict';var _=require(_0x7eb4('0x0'));var util=require(_0x7eb4('0x1'));var logger=require(_0x7eb4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7eb4('0x3'));var rp=require(_0x7eb4('0x4'));var fs=require('fs');var path=require(_0x7eb4('0x5'));var rimraf=require(_0x7eb4('0x6'));var config=require(_0x7eb4('0x7'));var attributes=require(_0x7eb4('0x8'));module[_0x7eb4('0x9')]=function(_0x222c39,_0x1b1e32){return _0x222c39['define'](_0x7eb4('0xa'),attributes,{'tableName':_0x7eb4('0xb'),'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 8add508..bd5bd9b 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 _0x9a1b=['info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1feab9,_0x71d303){var _0x1c4328=function(_0x3244f2){while(--_0x3244f2){_0x1feab9['push'](_0x1feab9['shift']());}};_0x1c4328(++_0x71d303);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x4867bc,_0x15b914){_0x4867bc=_0x4867bc-0x0;var _0x5c3ceb=_0x9a1b[_0x4867bc];return _0x5c3ceb;};'use strict';var _=require(_0xb9a1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9a1('0x1'));var fs=require('fs');var Redis=require(_0xb9a1('0x2'));var db=require(_0xb9a1('0x3'))['db'];var utils=require(_0xb9a1('0x4'));var logger=require('../../config/logger')(_0xb9a1('0x5'));var config=require(_0xb9a1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb9a1('0x7')][_0xb9a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x233810,_0x5c0924,_0x267773){return new BPromise(function(_0x36334d,_0x404275){return client[_0xb9a1('0x9')](_0x233810,_0x267773)[_0xb9a1('0xa')](function(_0x5e70af){logger['info'](_0xb9a1('0xb'),_0x5c0924,_0xb9a1('0xc'));logger[_0xb9a1('0xd')](_0xb9a1('0xe'),_0x5c0924,_0xb9a1('0xc'),JSON[_0xb9a1('0xf')](_0x5e70af));if(_0x5e70af[_0xb9a1('0x10')]){if(_0x5e70af[_0xb9a1('0x10')]['code']===0x1f4){logger['error'](_0xb9a1('0xb'),_0x5c0924,_0x5e70af[_0xb9a1('0x10')]['message']);return _0x404275(_0x5e70af[_0xb9a1('0x10')]['message']);}logger[_0xb9a1('0x10')](_0xb9a1('0xb'),_0x5c0924,_0x5e70af[_0xb9a1('0x10')]['message']);return _0x36334d(_0x5e70af[_0xb9a1('0x10')][_0xb9a1('0x11')]);}else{logger[_0xb9a1('0x12')]('Automation,\x20%s,\x20%s',_0x5c0924,_0xb9a1('0xc'));_0x36334d(_0x5e70af[_0xb9a1('0x13')][_0xb9a1('0x11')]);}})['catch'](function(_0x20c96e){logger[_0xb9a1('0x10')]('Automation,\x20%s,\x20%s',_0x5c0924,_0x20c96e);_0x404275(_0x20c96e);});});}
\ No newline at end of file
+var _0xbc95=['stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','http','request','then','info','Automation,\x20%s,\x20%s','debug'];(function(_0x115d1f,_0xc8262){var _0x357a9e=function(_0x510cb1){while(--_0x510cb1){_0x115d1f['push'](_0x115d1f['shift']());}};_0x357a9e(++_0xc8262);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0xbc95[_0x32f26d];return _0x5d9ddc;};'use strict';var _=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var moment=require(_0x5bc9('0x2'));var BPromise=require(_0x5bc9('0x3'));var rs=require(_0x5bc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bc9('0x5'))(_0x5bc9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5bc9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c02e9,_0x2fb0a2,_0x4bdc20){return new BPromise(function(_0x49ab1a,_0x6cc9f1){return client[_0x5bc9('0x8')](_0x5c02e9,_0x4bdc20)[_0x5bc9('0x9')](function(_0x357d27){logger[_0x5bc9('0xa')](_0x5bc9('0xb'),_0x2fb0a2,'request\x20sent');logger[_0x5bc9('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x2fb0a2,'request\x20sent',JSON[_0x5bc9('0xd')](_0x357d27));if(_0x357d27['error']){if(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0xf')]===0x1f4){logger[_0x5bc9('0xe')](_0x5bc9('0xb'),_0x2fb0a2,_0x357d27[_0x5bc9('0xe')]['message']);return _0x6cc9f1(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0x10')]);}logger['error'](_0x5bc9('0xb'),_0x2fb0a2,_0x357d27['error']['message']);return _0x49ab1a(_0x357d27[_0x5bc9('0xe')][_0x5bc9('0x10')]);}else{logger[_0x5bc9('0xa')](_0x5bc9('0xb'),_0x2fb0a2,_0x5bc9('0x11'));_0x49ab1a(_0x357d27[_0x5bc9('0x12')]['message']);}})['catch'](function(_0x617dad){logger[_0x5bc9('0xe')]('Automation,\x20%s,\x20%s',_0x2fb0a2,_0x617dad);_0x6cc9f1(_0x617dad);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index db17b7f..faeec2f 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 _0xc818=['put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions'];(function(_0x5c9646,_0x3e04a9){var _0x5c19b5=function(_0x1c095b){while(--_0x1c095b){_0x5c9646['push'](_0x5c9646['shift']());}};_0x5c19b5(++_0x3e04a9);}(_0xc818,0x1e3));var _0x8c81=function(_0x1b617a,_0x5ec7ed){_0x1b617a=_0x1b617a-0x0;var _0x3a6d8a=_0xc818[_0x1b617a];return _0x3a6d8a;};'use strict';var multer=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var path=require(_0x8c81('0x2'));var timeout=require(_0x8c81('0x3'));var express=require('express');var router=express[_0x8c81('0x4')]();var fs_extra=require(_0x8c81('0x5'));var auth=require(_0x8c81('0x6'));var interaction=require(_0x8c81('0x7'));var config=require(_0x8c81('0x8'));var controller=require(_0x8c81('0x9'));router[_0x8c81('0xa')]('/',auth['isAuthenticated'](),controller[_0x8c81('0xb')]);router[_0x8c81('0xa')](_0x8c81('0xc'),auth[_0x8c81('0xd')](),controller['show']);router[_0x8c81('0xa')](_0x8c81('0xe'),auth[_0x8c81('0xd')](),controller[_0x8c81('0xf')]);router[_0x8c81('0xa')](_0x8c81('0x10'),auth[_0x8c81('0xd')](),controller['getActions']);router[_0x8c81('0x11')]('/',auth[_0x8c81('0xd')](),controller[_0x8c81('0x12')]);router[_0x8c81('0x11')]('/:id/conditions',auth[_0x8c81('0xd')](),controller[_0x8c81('0x13')]);router[_0x8c81('0x11')](_0x8c81('0x10'),auth[_0x8c81('0xd')](),controller[_0x8c81('0x14')]);router[_0x8c81('0x15')](_0x8c81('0xc'),auth[_0x8c81('0xd')](),controller['update']);router['delete'](_0x8c81('0xc'),auth[_0x8c81('0xd')](),controller[_0x8c81('0x16')]);module[_0x8c81('0x17')]=router;
\ No newline at end of file
+var _0x777f=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put'];(function(_0x5041a5,_0x3890be){var _0x37a8a7=function(_0x326f9c){while(--_0x326f9c){_0x5041a5['push'](_0x5041a5['shift']());}};_0x37a8a7(++_0x3890be);}(_0x777f,0x9f));var _0xf777=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0x777f[_0x22eb96];return _0x5e1adf;};'use strict';var multer=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var path=require(_0xf777('0x2'));var timeout=require(_0xf777('0x3'));var express=require(_0xf777('0x4'));var router=express[_0xf777('0x5')]();var fs_extra=require(_0xf777('0x6'));var auth=require(_0xf777('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf777('0x8'));var controller=require(_0xf777('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf777('0xa')](_0xf777('0xb'),auth[_0xf777('0xc')](),controller[_0xf777('0xd')]);router[_0xf777('0xa')](_0xf777('0xe'),auth[_0xf777('0xc')](),controller[_0xf777('0xf')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xf777('0x10')]);router[_0xf777('0x11')]('/',auth['isAuthenticated'](),controller[_0xf777('0x12')]);router[_0xf777('0x11')](_0xf777('0xe'),auth['isAuthenticated'](),controller[_0xf777('0x13')]);router[_0xf777('0x11')](_0xf777('0x14'),auth[_0xf777('0xc')](),controller[_0xf777('0x15')]);router[_0xf777('0x16')](_0xf777('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf777('0x17')]('/:id',auth[_0xf777('0xc')](),controller[_0xf777('0x18')]);module[_0xf777('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 25a9cb3..6fb2f8a 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 _0x542b=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x2a56bc,_0x25761d){var _0x313c8c=function(_0x498717){while(--_0x498717){_0x2a56bc['push'](_0x2a56bc['shift']());}};_0x313c8c(++_0x25761d);}(_0x542b,0x11b));var _0xb542=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x542b[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require(_0xb542('0x0'));module[_0xb542('0x1')]={'name':{'type':Sequelize[_0xb542('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb542('0x3')](_0xb542('0x4')),'allowNull':![],'defaultValue':_0xb542('0x4')},'description':{'type':Sequelize[_0xb542('0x2')]},'active':{'type':Sequelize[_0xb542('0x5')],'defaultValue':0x0,'comment':_0xb542('0x6')},'limitCalls':{'type':Sequelize[_0xb542('0x7')](0x4)[_0xb542('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb542('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb542('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb542('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb542('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb542('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb542('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb542('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb542('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb542('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb542('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb542('0x7')](0x3)[_0xb542('0x8')],'defaultValue':0x3,'comment':_0xb542('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb542('0x7')](0x5)[_0xb542('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb542('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb542('0x7')](0x3)[_0xb542('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xb542('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb542('0x2')],'defaultValue':_0xb542('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xb542('0x10'),_0xb542('0x11'),_0xb542('0x12')),'defaultValue':_0xb542('0x10')},'dialAMDActive':{'type':Sequelize[_0xb542('0x5')],'defaultValue':0x0,'comment':_0xb542('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xb542('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb542('0x7')](0x9)[_0xb542('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb542('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb542('0x7')](0x9)[_0xb542('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb542('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb542('0x7')](0x9)[_0xb542('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb542('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb542('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb542('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb542('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb542('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb542('0x7')](0x9)[_0xb542('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb542('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xb542('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb542('0x7')](0x9)[_0xb542('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb542('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb542('0x3')](_0xb542('0x1b'),_0xb542('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb542('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb542('0x7')](0x3)[_0xb542('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xb542('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb542('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb542('0x7')](0x3)[_0xb542('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb542('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb542('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb542('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xb542('0x7')](0x3)[_0xb542('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb542('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xb542('0x7')](0x5)[_0xb542('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb542('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb542('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb542('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb542('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb542('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xb542('0x7')](0x3)[_0xb542('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb542('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb542('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb542('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb542('0x7')](0x5)[_0xb542('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb542('0x25')}};
\ No newline at end of file
+var _0x558c=['#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x19597b,_0x57a8e6){var _0x10d259=function(_0x48979b){while(--_0x48979b){_0x19597b['push'](_0x19597b['shift']());}};_0x10d259(++_0x57a8e6);}(_0x558c,0xbc));var _0xc558=function(_0xe4a6f0,_0x55ff14){_0xe4a6f0=_0xe4a6f0-0x0;var _0x580d29=_0x558c[_0xe4a6f0];return _0x580d29;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc558('0x0')],'unique':_0xc558('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc558('0x2')](_0xc558('0x3')),'allowNull':![],'defaultValue':_0xc558('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc558('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xc558('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc558('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc558('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc558('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xc558('0x5')](0x3)[_0xc558('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc558('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)[_0xc558('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc558('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc558('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)[_0xc558('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc558('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc558('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc558('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc558('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc558('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc558('0x0')],'defaultValue':_0xc558('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xc558('0xf'),_0xc558('0x10'),'onlyIfOpen'),'defaultValue':_0xc558('0xf')},'dialAMDActive':{'type':Sequelize[_0xc558('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc558('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc558('0x5')](0x9)[_0xc558('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc558('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc558('0x5')](0x9)[_0xc558('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc558('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc558('0x5')](0x9)[_0xc558('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc558('0x5')](0x9)[_0xc558('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc558('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc558('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc558('0x5')](0x9)[_0xc558('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc558('0x5')](0x5)[_0xc558('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc558('0x5')](0x9)[_0xc558('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc558('0x14')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xc558('0x15')),'defaultValue':_0xc558('0x16')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc558('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc558('0x17')},'dialCutDigit':{'type':Sequelize[_0xc558('0x5')](0x3)[_0xc558('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc558('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)[_0xc558('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc558('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc558('0x5')](0x5)[_0xc558('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc558('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0xc558('0x5')](0x5)[_0xc558('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc558('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)[_0xc558('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc558('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc558('0x1c')},'dialMachineMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc558('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc558('0x5')](0x5)[_0xc558('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc558('0x5')](0x3)[_0xc558('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc558('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc558('0x1e')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 14e5f76..a3ffc60 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 _0x1c19=['autoAssociation','clone','params','options','omit','updatedAt','createdAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','ContactId','ListId','field','phone','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','NOW()','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','map','Campaign','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x1c19,0x1f2));var _0x91c1=function(_0x2e4ee7,_0x4bdc11){_0x2e4ee7=_0x2e4ee7-0x0;var _0x49e2e8=_0x1c19[_0x2e4ee7];return _0x49e2e8;};'use strict';var emlformat=require(_0x91c1('0x0'));var rimraf=require(_0x91c1('0x1'));var zipdir=require(_0x91c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91c1('0x3'));var moment=require(_0x91c1('0x4'));var BPromise=require(_0x91c1('0x5'));var Mustache=require('mustache');var util=require(_0x91c1('0x6'));var path=require('path');var sox=require(_0x91c1('0x7'));var csv=require(_0x91c1('0x8'));var ejs=require(_0x91c1('0x9'));var fs=require('fs');var fs_extra=require(_0x91c1('0xa'));var _=require(_0x91c1('0xb'));var squel=require(_0x91c1('0xc'));var crypto=require(_0x91c1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x91c1('0x8'));var querystring=require(_0x91c1('0xe'));var Papa=require(_0x91c1('0xf'));var Redis=require(_0x91c1('0x10'));var authService=require(_0x91c1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x91c1('0x12'));var utils=require(_0x91c1('0x13'));var config=require(_0x91c1('0x14'));var licenseUtil=require(_0x91c1('0x15'));var db=require(_0x91c1('0x16'))['db'];function respondWithStatusCode(_0x521049,_0x4f5cdb){_0x4f5cdb=_0x4f5cdb||0xcc;return function(_0x5f482a){if(_0x5f482a){return _0x521049[_0x91c1('0x17')](_0x4f5cdb);}return _0x521049[_0x91c1('0x18')](_0x4f5cdb)[_0x91c1('0x19')]();};}function respondWithResult(_0x3af3c9,_0x17a19f){_0x17a19f=_0x17a19f||0xc8;return function(_0x410149){if(_0x410149){return _0x3af3c9[_0x91c1('0x18')](_0x17a19f)['json'](_0x410149);}};}function respondWithFilteredResult(_0x471730,_0xc0004f){return function(_0x5cabd3){if(_0x5cabd3){var _0x24b040=typeof _0xc0004f[_0x91c1('0x1a')]===_0x91c1('0x1b')&&typeof _0xc0004f[_0x91c1('0x1c')]==='undefined';var _0x4675d2=_0x5cabd3[_0x91c1('0x1d')];var _0x46c2c8=_0x24b040?0x0:_0xc0004f[_0x91c1('0x1a')];var _0x2837a4=_0x24b040?_0x5cabd3[_0x91c1('0x1d')]:_0xc0004f[_0x91c1('0x1a')]+_0xc0004f[_0x91c1('0x1c')];var _0x258e9d;if(_0x2837a4>=_0x4675d2){_0x2837a4=_0x4675d2;_0x258e9d=0xc8;}else{_0x258e9d=0xce;}_0x471730[_0x91c1('0x18')](_0x258e9d);return _0x471730[_0x91c1('0x1e')](_0x91c1('0x1f'),_0x46c2c8+'-'+_0x2837a4+'/'+_0x4675d2)['json'](_0x5cabd3);}return null;};}function patchUpdates(_0x362de8){return function(_0x3856e6){try{jsonpatch[_0x91c1('0x20')](_0x3856e6,_0x362de8,!![]);}catch(_0x147917){return BPromise['reject'](_0x147917);}return _0x3856e6[_0x91c1('0x21')]();};}function saveUpdates(_0x257db8,_0x3c4318){return function(_0x5bc24e){if(_0x5bc24e){return _0x5bc24e['update'](_0x257db8)['then'](function(_0x4bfbac){return _0x4bfbac;});}return null;};}function removeEntity(_0x1fc6c0,_0x4f77d5){return function(_0x2c8246){if(_0x2c8246){return _0x2c8246[_0x91c1('0x22')]()[_0x91c1('0x23')](function(){var _0x1b8def=_0x2c8246[_0x91c1('0x24')]({'plain':!![]});var _0x378b84=_0x91c1('0x25');return db[_0x91c1('0x26')][_0x91c1('0x22')]({'where':{'type':_0x378b84,'resourceId':_0x1b8def['id']}})[_0x91c1('0x23')](function(){return _0x2c8246;});})[_0x91c1('0x23')](function(){_0x1fc6c0['status'](0xcc)[_0x91c1('0x19')]();});}};}function handleEntityNotFound(_0x200719,_0x2462df){return function(_0x52f07f){if(!_0x52f07f){_0x200719[_0x91c1('0x17')](0x194);}return _0x52f07f;};}function handleError(_0x92847,_0x54541a){_0x54541a=_0x54541a||0x1f4;return function(_0x5351f3){logger[_0x91c1('0x27')](_0x5351f3[_0x91c1('0x28')]);if(_0x5351f3[_0x91c1('0x29')]){delete _0x5351f3[_0x91c1('0x29')];}_0x92847[_0x91c1('0x18')](_0x54541a)['send'](_0x5351f3);};}exports['index']=function(_0x445657,_0x4c7ead){var _0x426b95={},_0x1a9fbf={},_0x4f0089={'count':0x0,'rows':[]};var _0x92b238=_[_0x91c1('0x2a')](db[_0x91c1('0x2b')][_0x91c1('0x2c')],function(_0x4c227c){return{'name':_0x4c227c['fieldName'],'type':_0x4c227c[_0x91c1('0x2d')]['key']};});_0x1a9fbf[_0x91c1('0x2e')]=_['map'](_0x92b238,_0x91c1('0x29'));_0x1a9fbf[_0x91c1('0x2f')]=_[_0x91c1('0x30')](_0x445657[_0x91c1('0x2f')]);_0x1a9fbf[_0x91c1('0x31')]=_[_0x91c1('0x32')](_0x1a9fbf['model'],_0x1a9fbf[_0x91c1('0x2f')]);_0x426b95[_0x91c1('0x33')]=_[_0x91c1('0x32')](_0x1a9fbf[_0x91c1('0x2e')],qs[_0x91c1('0x34')](_0x445657[_0x91c1('0x2f')][_0x91c1('0x34')]));_0x426b95[_0x91c1('0x33')]=_0x426b95[_0x91c1('0x33')][_0x91c1('0x35')]?_0x426b95[_0x91c1('0x33')]:_0x1a9fbf[_0x91c1('0x2e')];if(!_0x445657[_0x91c1('0x2f')]['hasOwnProperty']('nolimit')){_0x426b95[_0x91c1('0x1c')]=qs[_0x91c1('0x1c')](_0x445657[_0x91c1('0x2f')][_0x91c1('0x1c')]);_0x426b95[_0x91c1('0x1a')]=qs[_0x91c1('0x1a')](_0x445657['query'][_0x91c1('0x1a')]);}_0x426b95[_0x91c1('0x36')]=qs[_0x91c1('0x37')](_0x445657[_0x91c1('0x2f')][_0x91c1('0x37')]);_0x426b95[_0x91c1('0x38')]=qs[_0x91c1('0x31')](_[_0x91c1('0x39')](_0x445657[_0x91c1('0x2f')],_0x1a9fbf[_0x91c1('0x31')]),_0x92b238);if(_0x445657['query'][_0x91c1('0x3a')]){_0x426b95['where']=_['merge'](_0x426b95[_0x91c1('0x38')],{'$or':_[_0x91c1('0x2a')](_0x92b238,function(_0x2a6688){if(_0x2a6688[_0x91c1('0x2d')]!==_0x91c1('0x3b')){var _0x3c8631={};_0x3c8631[_0x2a6688[_0x91c1('0x29')]]={'$like':'%'+_0x445657['query'][_0x91c1('0x3a')]+'%'};return _0x3c8631;}})});}_0x426b95=_['merge']({},_0x426b95,_0x445657['options']);var _0x4a6c7c={'where':_0x426b95[_0x91c1('0x38')]};return db[_0x91c1('0x2b')][_0x91c1('0x1d')](_0x4a6c7c)[_0x91c1('0x23')](function(_0x29b534){_0x4f0089[_0x91c1('0x1d')]=_0x29b534;if(_0x445657['query'][_0x91c1('0x3c')]){_0x426b95[_0x91c1('0x3d')]=[{'all':!![]}];}return db['Campaign'][_0x91c1('0x3e')](_0x426b95);})[_0x91c1('0x23')](function(_0x1809bf){_0x4f0089[_0x91c1('0x3f')]=_0x1809bf;return _0x4f0089;})[_0x91c1('0x23')](respondWithFilteredResult(_0x4c7ead,_0x426b95))[_0x91c1('0x40')](handleError(_0x4c7ead,null));};exports[_0x91c1('0x41')]=function(_0x37478e,_0x1aba2e){var _0x46e8df={'raw':![],'where':{'id':_0x37478e['params']['id']}},_0x53c1af={};_0x53c1af['model']=_['keys'](db[_0x91c1('0x2b')][_0x91c1('0x2c')]);_0x53c1af[_0x91c1('0x2f')]=_['keys'](_0x37478e[_0x91c1('0x2f')]);_0x53c1af[_0x91c1('0x31')]=_[_0x91c1('0x32')](_0x53c1af['model'],_0x53c1af[_0x91c1('0x2f')]);_0x46e8df[_0x91c1('0x33')]=_[_0x91c1('0x32')](_0x53c1af[_0x91c1('0x2e')],qs['fields'](_0x37478e[_0x91c1('0x2f')][_0x91c1('0x34')]));_0x46e8df[_0x91c1('0x33')]=_0x46e8df['attributes'][_0x91c1('0x35')]?_0x46e8df[_0x91c1('0x33')]:_0x53c1af['model'];if(_0x37478e[_0x91c1('0x2f')]['includeAll']){_0x46e8df[_0x91c1('0x3d')]=[{'all':!![]}];}_0x46e8df=_[_0x91c1('0x42')]({},_0x46e8df,_0x37478e['options']);return db['Campaign']['find'](_0x46e8df)[_0x91c1('0x23')](handleEntityNotFound(_0x1aba2e,null))[_0x91c1('0x23')](respondWithResult(_0x1aba2e,null))['catch'](handleError(_0x1aba2e,null));};exports['create']=function(_0x8ee110,_0x4253e5){return db[_0x91c1('0x2b')][_0x91c1('0x43')](_0x8ee110[_0x91c1('0x44')],{})[_0x91c1('0x23')](function(_0x13c884){var _0x3c9d69=_0x8ee110[_0x91c1('0x45')][_0x91c1('0x24')]({'plain':!![]});if(!_0x3c9d69)throw new Error(_0x91c1('0x46'));if(_0x3c9d69['role']===_0x91c1('0x45')){var _0x3f00e5=_0x13c884['get']({'plain':!![]});var _0x397450=_0x91c1('0x25');return db[_0x91c1('0x47')][_0x91c1('0x48')]({'where':{'name':_0x397450,'userProfileId':_0x3c9d69[_0x91c1('0x49')]},'raw':!![]})[_0x91c1('0x23')](function(_0x3b0bc8){if(_0x3b0bc8&&_0x3b0bc8[_0x91c1('0x4a')]===0x0){return db[_0x91c1('0x26')][_0x91c1('0x43')]({'name':_0x3f00e5[_0x91c1('0x29')],'resourceId':_0x3f00e5['id'],'type':_0x3b0bc8[_0x91c1('0x29')],'sectionId':_0x3b0bc8['id']},{})[_0x91c1('0x23')](function(){return _0x13c884;});}else{return _0x13c884;}})[_0x91c1('0x40')](function(_0x56113e){logger[_0x91c1('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56113e);throw _0x56113e;});}return _0x13c884;})[_0x91c1('0x23')](respondWithResult(_0x4253e5,0xc9))[_0x91c1('0x40')](handleError(_0x4253e5,null));};exports[_0x91c1('0x4b')]=function(_0x3b09dd,_0x34191a){var _0x3c8787={'where':{'id':_0x3b09dd[_0x91c1('0x4c')]['id']}},_0x27849c={};_0x27849c[_0x91c1('0x2e')]=_[_0x91c1('0x30')](db[_0x91c1('0x2b')][_0x91c1('0x2c')]);_0x3c8787[_0x91c1('0x33')]=_['intersection'](_0x27849c['model'],qs[_0x91c1('0x34')](_0x3b09dd[_0x91c1('0x2f')][_0x91c1('0x34')]));_0x3c8787[_0x91c1('0x33')]=_0x3c8787[_0x91c1('0x33')][_0x91c1('0x35')]?_0x3c8787[_0x91c1('0x33')]:_0x27849c[_0x91c1('0x2e')];if(_0x3b09dd[_0x91c1('0x2f')][_0x91c1('0x3c')]){_0x3c8787['include']=[{'all':!![]}];}_0x3c8787=_[_0x91c1('0x42')]({},_0x3c8787,_0x3b09dd[_0x91c1('0x4d')]);return db[_0x91c1('0x2b')][_0x91c1('0x48')](_0x3c8787)[_0x91c1('0x23')](handleEntityNotFound(_0x34191a,null))[_0x91c1('0x23')](function(_0x56f3a5){if(_0x56f3a5){var _0x1a6180=_0x56f3a5[_0x91c1('0x24')]({'plain':!![]});_0x1a6180=qs[_0x91c1('0x4e')](_0x1a6180,['id','createdAt',_0x91c1('0x4f')]);_0x3b09dd[_0x91c1('0x44')]=_['omit'](_0x3b09dd[_0x91c1('0x44')],['id',_0x91c1('0x50'),_0x91c1('0x4f')]);return db[_0x91c1('0x2b')][_0x91c1('0x43')](_[_0x91c1('0x42')](_0x1a6180,_0x3b09dd[_0x91c1('0x44')]),{'include':_0x3b09dd[_0x91c1('0x2f')][_0x91c1('0x3c')]?[{'all':!![]}]:undefined})['then'](function(_0x1512e1){var _0x52e0b7=_0x3b09dd['user']['get']({'plain':!![]});if(!_0x52e0b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52e0b7[_0x91c1('0x51')]==='user'){var _0x4398c2=_0x1512e1[_0x91c1('0x24')]({'plain':!![]});var _0x3969f9=_0x91c1('0x25');return db[_0x91c1('0x47')][_0x91c1('0x48')]({'where':{'name':_0x3969f9,'userProfileId':_0x52e0b7[_0x91c1('0x49')]},'raw':!![]})[_0x91c1('0x23')](function(_0x11f429){if(_0x11f429&&_0x11f429['autoAssociation']===0x0){return db[_0x91c1('0x26')][_0x91c1('0x43')]({'name':_0x4398c2['name'],'resourceId':_0x4398c2['id'],'type':_0x11f429['name'],'sectionId':_0x11f429['id']},{})['then'](function(){return _0x1512e1;});}else{return _0x1512e1;}})[_0x91c1('0x40')](function(_0x5e4896){logger['error'](_0x91c1('0x52'),_0x5e4896);throw _0x5e4896;});}return _0x1512e1;});}})[_0x91c1('0x23')](respondWithResult(_0x34191a,0xc9))[_0x91c1('0x40')](handleError(_0x34191a,null));};exports[_0x91c1('0x53')]=function(_0x154d47,_0x529581){if(_0x154d47[_0x91c1('0x44')]['id']){delete _0x154d47[_0x91c1('0x44')]['id'];}return db[_0x91c1('0x2b')][_0x91c1('0x48')]({'where':{'id':_0x154d47[_0x91c1('0x4c')]['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x529581,null))[_0x91c1('0x23')](saveUpdates(_0x154d47[_0x91c1('0x44')],null))[_0x91c1('0x23')](respondWithResult(_0x529581,null))[_0x91c1('0x40')](handleError(_0x529581,null));};exports[_0x91c1('0x22')]=function(_0x27f456,_0x4fe43c){return db[_0x91c1('0x2b')][_0x91c1('0x48')]({'where':{'id':_0x27f456['params']['id']}})['then'](handleEntityNotFound(_0x4fe43c,null))[_0x91c1('0x23')](removeEntity(_0x4fe43c,null))[_0x91c1('0x40')](handleError(_0x4fe43c,null));};exports['getHoppers']=function(_0x1f0470,_0x32ce96,_0x3e931d){var _0xa2f653={'raw':!![],'where':{}};var _0x3c3502={};var _0xf0d28c={'count':0x0,'rows':[]};return db[_0x91c1('0x2b')][_0x91c1('0x54')]({'where':{'id':_0x1f0470[_0x91c1('0x4c')]['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x32ce96,null))[_0x91c1('0x23')](function(_0x4c39d2){if(_0x4c39d2){_0x3c3502['model']=_[_0x91c1('0x30')](db[_0x91c1('0x55')]['rawAttributes']);_0x3c3502[_0x91c1('0x2f')]=_[_0x91c1('0x30')](_0x1f0470[_0x91c1('0x2f')]);_0x3c3502[_0x91c1('0x31')]=_['intersection'](_0x3c3502[_0x91c1('0x2e')],_0x3c3502[_0x91c1('0x2f')]);_0xa2f653[_0x91c1('0x33')]=_[_0x91c1('0x32')](_0x3c3502[_0x91c1('0x2e')],qs[_0x91c1('0x34')](_0x1f0470['query']['fields']));_0xa2f653['attributes']=_0xa2f653['attributes'][_0x91c1('0x35')]?_0xa2f653['attributes']:_0x3c3502[_0x91c1('0x2e')];if(!_0x1f0470[_0x91c1('0x2f')][_0x91c1('0x56')](_0x91c1('0x57'))){_0xa2f653[_0x91c1('0x1c')]=qs[_0x91c1('0x1c')](_0x1f0470['query'][_0x91c1('0x1c')]);_0xa2f653[_0x91c1('0x1a')]=qs[_0x91c1('0x1a')](_0x1f0470[_0x91c1('0x2f')][_0x91c1('0x1a')]);}_0xa2f653[_0x91c1('0x36')]=qs[_0x91c1('0x37')](_0x1f0470['query'][_0x91c1('0x37')]);_0xa2f653['where']=qs[_0x91c1('0x31')](_[_0x91c1('0x39')](_0x1f0470[_0x91c1('0x2f')],_0x3c3502[_0x91c1('0x31')]));_0xa2f653[_0x91c1('0x38')][_0x91c1('0x58')]=_0x4c39d2['id'];if(_0x1f0470[_0x91c1('0x2f')][_0x91c1('0x3a')]){_0xa2f653[_0x91c1('0x38')]=_['merge'](_0xa2f653[_0x91c1('0x38')],{'$or':_[_0x91c1('0x2a')](_0xa2f653[_0x91c1('0x33')],function(_0x18425c){var _0x5c253a={};_0x5c253a[_0x18425c]={'$like':'%'+_0x1f0470[_0x91c1('0x2f')]['filter']+'%'};return _0x5c253a;})});}_0xa2f653=_[_0x91c1('0x42')]({},_0xa2f653,_0x1f0470[_0x91c1('0x4d')]);return db[_0x91c1('0x55')][_0x91c1('0x1d')]({'where':_0xa2f653['where']})['then'](function(_0x102166){_0xf0d28c['count']=_0x102166;if(_0x1f0470[_0x91c1('0x2f')]['includeAll']){_0xa2f653[_0x91c1('0x3d')]=[{'all':!![]}];}return db[_0x91c1('0x55')][_0x91c1('0x3e')](_0xa2f653);})[_0x91c1('0x23')](function(_0x38adcf){_0xf0d28c[_0x91c1('0x3f')]=_0x38adcf;return _0xf0d28c;});}})[_0x91c1('0x23')](respondWithFilteredResult(_0x32ce96,_0xa2f653))['catch'](handleError(_0x32ce96,null));};exports[_0x91c1('0x59')]=function(_0x202372,_0x5422f0,_0x2fcf6c){var _0x3032c5={'raw':!![],'where':{}};var _0x57c751={};var _0x628102={'count':0x0,'rows':[]};return db[_0x91c1('0x2b')][_0x91c1('0x54')]({'where':{'id':_0x202372[_0x91c1('0x4c')]['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x5422f0,null))[_0x91c1('0x23')](function(_0x4b8242){if(_0x4b8242){_0x57c751[_0x91c1('0x2e')]=_[_0x91c1('0x30')](db['CmHopperHistory'][_0x91c1('0x2c')]);_0x57c751[_0x91c1('0x2f')]=_[_0x91c1('0x30')](_0x202372['query']);_0x57c751[_0x91c1('0x31')]=_[_0x91c1('0x32')](_0x57c751[_0x91c1('0x2e')],_0x57c751[_0x91c1('0x2f')]);_0x3032c5[_0x91c1('0x33')]=_[_0x91c1('0x32')](_0x57c751[_0x91c1('0x2e')],qs['fields'](_0x202372[_0x91c1('0x2f')][_0x91c1('0x34')]));_0x3032c5[_0x91c1('0x33')]=_0x3032c5[_0x91c1('0x33')][_0x91c1('0x35')]?_0x3032c5[_0x91c1('0x33')]:_0x57c751['model'];if(!_0x202372[_0x91c1('0x2f')][_0x91c1('0x56')](_0x91c1('0x57'))){_0x3032c5['limit']=qs[_0x91c1('0x1c')](_0x202372['query'][_0x91c1('0x1c')]);_0x3032c5[_0x91c1('0x1a')]=qs['offset'](_0x202372[_0x91c1('0x2f')][_0x91c1('0x1a')]);}_0x3032c5[_0x91c1('0x36')]=qs[_0x91c1('0x37')](_0x202372['query'][_0x91c1('0x37')]);_0x3032c5['where']=qs['filters'](_[_0x91c1('0x39')](_0x202372[_0x91c1('0x2f')],_0x57c751[_0x91c1('0x31')]));_0x3032c5['where'][_0x91c1('0x58')]=_0x4b8242['id'];if(_0x202372[_0x91c1('0x2f')][_0x91c1('0x3a')]){_0x3032c5['where']=_['merge'](_0x3032c5[_0x91c1('0x38')],{'$or':_[_0x91c1('0x2a')](_0x3032c5[_0x91c1('0x33')],function(_0x2d63d5){var _0x55f7c4={};_0x55f7c4[_0x2d63d5]={'$like':'%'+_0x202372[_0x91c1('0x2f')]['filter']+'%'};return _0x55f7c4;})});}_0x3032c5=_[_0x91c1('0x42')]({},_0x3032c5,_0x202372[_0x91c1('0x4d')]);return db[_0x91c1('0x5a')][_0x91c1('0x1d')]({'where':_0x3032c5[_0x91c1('0x38')]})[_0x91c1('0x23')](function(_0x24025c){_0x628102[_0x91c1('0x1d')]=_0x24025c;if(_0x202372[_0x91c1('0x2f')][_0x91c1('0x3c')]){_0x3032c5[_0x91c1('0x3d')]=[{'all':!![]}];}return db[_0x91c1('0x5a')][_0x91c1('0x3e')](_0x3032c5);})['then'](function(_0x11ca01){_0x628102[_0x91c1('0x3f')]=_0x11ca01;return _0x628102;});}})[_0x91c1('0x23')](respondWithFilteredResult(_0x5422f0,_0x3032c5))[_0x91c1('0x40')](handleError(_0x5422f0,null));};exports[_0x91c1('0x5b')]=function(_0xe03790,_0x28d64d,_0x5dd9ea){var _0x301a34={'raw':!![],'where':{}};var _0x32d4e6={};var _0x45da6d={'count':0x0,'rows':[]};return db[_0x91c1('0x2b')][_0x91c1('0x54')]({'where':{'id':_0xe03790[_0x91c1('0x4c')]['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x28d64d,null))[_0x91c1('0x23')](function(_0xdcb7cc){if(_0xdcb7cc){_0x32d4e6[_0x91c1('0x2e')]=_[_0x91c1('0x30')](db[_0x91c1('0x5c')][_0x91c1('0x2c')]);_0x32d4e6[_0x91c1('0x2f')]=_[_0x91c1('0x30')](_0xe03790['query']);_0x32d4e6[_0x91c1('0x31')]=_[_0x91c1('0x32')](_0x32d4e6[_0x91c1('0x2e')],_0x32d4e6[_0x91c1('0x2f')]);_0x301a34[_0x91c1('0x33')]=_[_0x91c1('0x32')](_0x32d4e6[_0x91c1('0x2e')],qs[_0x91c1('0x34')](_0xe03790[_0x91c1('0x2f')][_0x91c1('0x34')]));_0x301a34['attributes']=_0x301a34[_0x91c1('0x33')][_0x91c1('0x35')]?_0x301a34[_0x91c1('0x33')]:_0x32d4e6[_0x91c1('0x2e')];if(!_0xe03790[_0x91c1('0x2f')][_0x91c1('0x56')]('nolimit')){_0x301a34[_0x91c1('0x1c')]=qs[_0x91c1('0x1c')](_0xe03790[_0x91c1('0x2f')][_0x91c1('0x1c')]);_0x301a34[_0x91c1('0x1a')]=qs[_0x91c1('0x1a')](_0xe03790[_0x91c1('0x2f')][_0x91c1('0x1a')]);}_0x301a34[_0x91c1('0x36')]=qs[_0x91c1('0x37')](_0xe03790['query'][_0x91c1('0x37')]);_0x301a34[_0x91c1('0x38')]=qs[_0x91c1('0x31')](_['pick'](_0xe03790[_0x91c1('0x2f')],_0x32d4e6[_0x91c1('0x31')]));_0x301a34[_0x91c1('0x38')][_0x91c1('0x58')]=_0xdcb7cc['id'];if(_0xe03790['query']['filter']){_0x301a34[_0x91c1('0x38')]=_[_0x91c1('0x42')](_0x301a34[_0x91c1('0x38')],{'$or':_[_0x91c1('0x2a')](_0x301a34[_0x91c1('0x33')],function(_0x354450){var _0x6ec1c={};_0x6ec1c[_0x354450]={'$like':'%'+_0xe03790[_0x91c1('0x2f')][_0x91c1('0x3a')]+'%'};return _0x6ec1c;})});}_0x301a34=_[_0x91c1('0x42')]({},_0x301a34,_0xe03790[_0x91c1('0x4d')]);return db[_0x91c1('0x5c')][_0x91c1('0x1d')]({'where':_0x301a34[_0x91c1('0x38')]})['then'](function(_0x32d8ea){_0x45da6d[_0x91c1('0x1d')]=_0x32d8ea;if(_0xe03790[_0x91c1('0x2f')][_0x91c1('0x3c')]){_0x301a34[_0x91c1('0x3d')]=[{'all':!![]}];}return db[_0x91c1('0x5c')][_0x91c1('0x3e')](_0x301a34);})[_0x91c1('0x23')](function(_0x29611e){_0x45da6d[_0x91c1('0x3f')]=_0x29611e;return _0x45da6d;});}})[_0x91c1('0x23')](respondWithFilteredResult(_0x28d64d,_0x301a34))[_0x91c1('0x40')](handleError(_0x28d64d,null));};exports[_0x91c1('0x5d')]=function(_0x1e9ec9,_0x3c1061,_0x3cfe02){var _0xb3d2d3={'raw':!![],'where':{}};var _0x288d40={};var _0x3e8573={'count':0x0,'rows':[]};return db[_0x91c1('0x2b')][_0x91c1('0x54')]({'where':{'id':_0x1e9ec9['params']['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x3c1061,null))[_0x91c1('0x23')](function(_0x1e4d20){if(_0x1e4d20){_0x288d40[_0x91c1('0x2e')]=_[_0x91c1('0x30')](db[_0x91c1('0x5e')][_0x91c1('0x2c')]);_0x288d40[_0x91c1('0x2f')]=_[_0x91c1('0x30')](_0x1e9ec9[_0x91c1('0x2f')]);_0x288d40[_0x91c1('0x31')]=_['intersection'](_0x288d40[_0x91c1('0x2e')],_0x288d40[_0x91c1('0x2f')]);_0xb3d2d3[_0x91c1('0x33')]=_['intersection'](_0x288d40[_0x91c1('0x2e')],qs['fields'](_0x1e9ec9['query'][_0x91c1('0x34')]));_0xb3d2d3['attributes']=_0xb3d2d3[_0x91c1('0x33')][_0x91c1('0x35')]?_0xb3d2d3[_0x91c1('0x33')]:_0x288d40[_0x91c1('0x2e')];if(!_0x1e9ec9[_0x91c1('0x2f')][_0x91c1('0x56')](_0x91c1('0x57'))){_0xb3d2d3['limit']=qs[_0x91c1('0x1c')](_0x1e9ec9[_0x91c1('0x2f')][_0x91c1('0x1c')]);_0xb3d2d3['offset']=qs['offset'](_0x1e9ec9[_0x91c1('0x2f')][_0x91c1('0x1a')]);}_0xb3d2d3[_0x91c1('0x36')]=qs[_0x91c1('0x37')](_0x1e9ec9[_0x91c1('0x2f')]['sort']);_0xb3d2d3[_0x91c1('0x38')]=qs[_0x91c1('0x31')](_[_0x91c1('0x39')](_0x1e9ec9['query'],_0x288d40[_0x91c1('0x31')]));_0xb3d2d3[_0x91c1('0x38')][_0x91c1('0x58')]=_0x1e4d20['id'];if(_0x1e9ec9[_0x91c1('0x2f')][_0x91c1('0x3a')]){_0xb3d2d3[_0x91c1('0x38')]=_[_0x91c1('0x42')](_0xb3d2d3[_0x91c1('0x38')],{'$or':_[_0x91c1('0x2a')](_0xb3d2d3['attributes'],function(_0x39ec2b){var _0x50a175={};_0x50a175[_0x39ec2b]={'$like':'%'+_0x1e9ec9[_0x91c1('0x2f')]['filter']+'%'};return _0x50a175;})});}_0xb3d2d3=_[_0x91c1('0x42')]({},_0xb3d2d3,_0x1e9ec9[_0x91c1('0x4d')]);return db[_0x91c1('0x5e')][_0x91c1('0x1d')]({'where':_0xb3d2d3[_0x91c1('0x38')]})['then'](function(_0x2717bd){_0x3e8573['count']=_0x2717bd;if(_0x1e9ec9[_0x91c1('0x2f')][_0x91c1('0x3c')]){_0xb3d2d3['include']=[{'all':!![]}];}return db[_0x91c1('0x5e')][_0x91c1('0x3e')](_0xb3d2d3);})[_0x91c1('0x23')](function(_0x323786){_0x3e8573[_0x91c1('0x3f')]=_0x323786;return _0x3e8573;});}})[_0x91c1('0x23')](respondWithFilteredResult(_0x3c1061,_0xb3d2d3))['catch'](handleError(_0x3c1061,null));};exports[_0x91c1('0x5f')]=function(_0x4b47f4,_0x41ae20,_0x3efef6){var _0x2c25c7={};var _0x29804e={};var _0x1e0cd1;var _0x32500e;return db[_0x91c1('0x2b')][_0x91c1('0x54')]({'where':{'id':_0x4b47f4[_0x91c1('0x4c')]['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x41ae20,null))['then'](function(_0x378fc4){if(_0x378fc4){_0x1e0cd1=_0x378fc4;_0x29804e['model']=_[_0x91c1('0x30')](db[_0x91c1('0x60')]['rawAttributes']);_0x29804e['query']=_['keys'](_0x4b47f4[_0x91c1('0x2f')]);_0x29804e[_0x91c1('0x31')]=_[_0x91c1('0x32')](_0x29804e[_0x91c1('0x2e')],_0x29804e[_0x91c1('0x2f')]);_0x2c25c7[_0x91c1('0x33')]=_[_0x91c1('0x32')](_0x29804e['model'],qs['fields'](_0x4b47f4[_0x91c1('0x2f')][_0x91c1('0x34')]));_0x2c25c7['attributes']=_0x2c25c7[_0x91c1('0x33')][_0x91c1('0x35')]?_0x2c25c7[_0x91c1('0x33')]:_0x29804e[_0x91c1('0x2e')];_0x2c25c7[_0x91c1('0x36')]=qs[_0x91c1('0x37')](_0x4b47f4[_0x91c1('0x2f')][_0x91c1('0x37')]);_0x2c25c7[_0x91c1('0x38')]=qs[_0x91c1('0x31')](_[_0x91c1('0x39')](_0x4b47f4['query'],_0x29804e[_0x91c1('0x31')]));if(_0x4b47f4[_0x91c1('0x2f')]['filter']){_0x2c25c7[_0x91c1('0x38')]=_[_0x91c1('0x42')](_0x2c25c7[_0x91c1('0x38')],{'$or':_['map'](_0x2c25c7[_0x91c1('0x33')],function(_0x41a297){var _0x4fee36={};_0x4fee36[_0x41a297]={'$like':'%'+_0x4b47f4[_0x91c1('0x2f')][_0x91c1('0x3a')]+'%'};return _0x4fee36;})});}_0x2c25c7=_[_0x91c1('0x42')]({},_0x2c25c7,_0x4b47f4[_0x91c1('0x4d')]);return _0x1e0cd1['getLists'](_0x2c25c7);}})['then'](function(_0x29ad1c){if(_0x29ad1c){_0x32500e=_0x29ad1c[_0x91c1('0x35')];if(!_0x4b47f4['query']['hasOwnProperty'](_0x91c1('0x57'))){_0x2c25c7[_0x91c1('0x1c')]=qs['limit'](_0x4b47f4[_0x91c1('0x2f')][_0x91c1('0x1c')]);_0x2c25c7[_0x91c1('0x1a')]=qs[_0x91c1('0x1a')](_0x4b47f4[_0x91c1('0x2f')]['offset']);}return _0x1e0cd1[_0x91c1('0x5f')](_0x2c25c7);}})[_0x91c1('0x23')](function(_0x3c7d12){if(_0x3c7d12){return _0x3c7d12?{'count':_0x32500e,'rows':_0x3c7d12}:null;}})['then'](respondWithResult(_0x41ae20,null))[_0x91c1('0x40')](handleError(_0x41ae20,null));};exports['addLists']=function(_0xad304f,_0x129605,_0x58f951){var _0x26d22c,_0x5604db;var _0xf0a8b=[];var _0xed84c9=moment()[_0x91c1('0x61')](_0x91c1('0x62'));return db['Campaign'][_0x91c1('0x48')]({'where':{'id':_0xad304f[_0x91c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x129605,null))[_0x91c1('0x23')](function(_0x14b5d4){if(_0x14b5d4){_0x5604db=_0x14b5d4;return _0x14b5d4[_0x91c1('0x63')](_0xad304f[_0x91c1('0x44')]['ids'],_['omit'](_0xad304f[_0x91c1('0x44')],['ids','id'])||{});}return null;})['spread'](function(_0x2a156c){var _0xaf6e53;var _0x6fc56;_0x26d22c=_0x2a156c||[];var _0x3e5ab2=[];if(_0x2a156c){for(var _0x10cba5=0x0;_0x10cba5<_0x2a156c[_0x91c1('0x35')];_0x10cba5+=0x1){var _0x23b9d3=_0x2a156c[_0x10cba5][_0x91c1('0x24')]({'plain':!![]});_0x5604db[_0x91c1('0x64')]=_0xad304f[_0x91c1('0x44')][_0x91c1('0x64')]?_0xad304f[_0x91c1('0x44')]['dialCheckDuplicateType']:_0x5604db['dialCheckDuplicateType'];switch(_0x5604db[_0x91c1('0x64')]){case _0x91c1('0x65'):_0xaf6e53=squel[_0x91c1('0x66')]()['into'](_0x91c1('0x67'))[_0x91c1('0x68')](['phone','scheduledAt',_0x91c1('0x69'),_0x91c1('0x6a'),_0x91c1('0x58'),_0x91c1('0x50'),_0x91c1('0x4f')],squel['select']()[_0x91c1('0x6b')](_0x91c1('0x6c'),_0x91c1('0x6c'))[_0x91c1('0x6b')]('NOW()',_0x91c1('0x6d'))[_0x91c1('0x6b')]('id','ContactId')[_0x91c1('0x6b')](_0x23b9d3[_0x91c1('0x6e')][_0x91c1('0x6f')](),_0x91c1('0x6a'))[_0x91c1('0x6b')](_0xad304f[_0x91c1('0x4c')]['id'][_0x91c1('0x6f')](),'CampaignId')[_0x91c1('0x6b')]('\x27'+_0xed84c9+'\x27',_0x91c1('0x50'))[_0x91c1('0x6b')]('\x27'+_0xed84c9+'\x27',_0x91c1('0x4f'))[_0x91c1('0x70')](_0x91c1('0x71'))[_0x91c1('0x38')](_0x91c1('0x72'))[_0x91c1('0x38')]('ListId\x20=\x20?',_0x23b9d3['CmListId'][_0x91c1('0x6f')]())[_0x91c1('0x38')](_0x91c1('0x73'))[_0x91c1('0x38')](_0x91c1('0x74'),squel[_0x91c1('0x75')]()[_0x91c1('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0x91c1('0x70')]('cm_hopper_final')['where'](_0x91c1('0x76'),_0xad304f['params']['id'][_0x91c1('0x6f')]()))[_0x91c1('0x38')](_0x91c1('0x74'),squel[_0x91c1('0x75')]()[_0x91c1('0x6b')](_0x91c1('0x77'))[_0x91c1('0x70')](_0x91c1('0x67'))[_0x91c1('0x38')](_0x91c1('0x76'),_0xad304f[_0x91c1('0x4c')]['id'][_0x91c1('0x6f')]())))['toString']();break;case _0x91c1('0x78'):_0xaf6e53=squel['insert']()[_0x91c1('0x79')](_0x91c1('0x67'))[_0x91c1('0x68')]([_0x91c1('0x6c'),_0x91c1('0x6d'),_0x91c1('0x69'),_0x91c1('0x6a'),_0x91c1('0x58'),_0x91c1('0x50'),_0x91c1('0x4f')],squel[_0x91c1('0x75')]()[_0x91c1('0x6b')](_0x91c1('0x6c'),_0x91c1('0x6c'))[_0x91c1('0x6b')](_0x91c1('0x7a'),'scheduledAt')[_0x91c1('0x6b')]('id',_0x91c1('0x69'))[_0x91c1('0x6b')](_0x23b9d3[_0x91c1('0x6e')][_0x91c1('0x6f')](),_0x91c1('0x6a'))[_0x91c1('0x6b')](_0xad304f[_0x91c1('0x4c')]['id'][_0x91c1('0x6f')](),_0x91c1('0x58'))['field']('\x27'+_0xed84c9+'\x27','createdAt')[_0x91c1('0x6b')]('\x27'+_0xed84c9+'\x27',_0x91c1('0x4f'))['from'](_0x91c1('0x71'))[_0x91c1('0x38')](_0x91c1('0x72'))['where']('ListId\x20=\x20?',_0x23b9d3[_0x91c1('0x6e')][_0x91c1('0x6f')]())[_0x91c1('0x38')](_0x91c1('0x73'))[_0x91c1('0x38')](_0x91c1('0x74'),squel[_0x91c1('0x75')]()[_0x91c1('0x6b')](_0x91c1('0x77'))[_0x91c1('0x70')]('cm_hopper')[_0x91c1('0x38')](_0x91c1('0x76'),_0xad304f[_0x91c1('0x4c')]['id'][_0x91c1('0x6f')]())))[_0x91c1('0x6f')]();break;default:_0xaf6e53=squel[_0x91c1('0x66')]()['into'](_0x91c1('0x67'))[_0x91c1('0x68')]([_0x91c1('0x6c'),'scheduledAt',_0x91c1('0x69'),_0x91c1('0x6a'),_0x91c1('0x58'),_0x91c1('0x50'),_0x91c1('0x4f')],squel[_0x91c1('0x75')]()[_0x91c1('0x6b')](_0x91c1('0x6c'),'phone')[_0x91c1('0x6b')](_0x91c1('0x7a'),_0x91c1('0x6d'))['field']('id',_0x91c1('0x69'))['field'](_0x23b9d3['CmListId'][_0x91c1('0x6f')](),_0x91c1('0x6a'))['field'](_0xad304f[_0x91c1('0x4c')]['id']['toString'](),_0x91c1('0x58'))['field']('\x27'+_0xed84c9+'\x27',_0x91c1('0x50'))['field']('\x27'+_0xed84c9+'\x27',_0x91c1('0x4f'))[_0x91c1('0x70')](_0x91c1('0x71'))[_0x91c1('0x38')](_0x91c1('0x72'))[_0x91c1('0x38')](_0x91c1('0x7b'),_0x23b9d3[_0x91c1('0x6e')][_0x91c1('0x6f')]())[_0x91c1('0x38')]('phone\x20IS\x20NOT\x20NULL'))[_0x91c1('0x6f')]();}_0x6fc56=squel[_0x91c1('0x66')]()[_0x91c1('0x79')](_0x91c1('0x7c'))['fromQuery']([_0x91c1('0x7d'),_0x91c1('0x6d'),_0x91c1('0x6c'),_0x91c1('0x7e'),'createdAt',_0x91c1('0x4f')],squel[_0x91c1('0x75')]()[_0x91c1('0x6b')]('h.id','id')[_0x91c1('0x6b')](_0x91c1('0x7a'),_0x91c1('0x6d'))[_0x91c1('0x6b')](_0x91c1('0x7f'),'phone')[_0x91c1('0x6b')](_0x91c1('0x80'),_0x91c1('0x7e'))[_0x91c1('0x6b')]('\x27'+_0xed84c9+'\x27',_0x91c1('0x50'))['field']('\x27'+_0xed84c9+'\x27',_0x91c1('0x4f'))[_0x91c1('0x70')]('cm_contact_has_items','ci')[_0x91c1('0x81')](_0x91c1('0x67'),'h',_0x91c1('0x82'))[_0x91c1('0x38')](_0x91c1('0x83'),_0x23b9d3[_0x91c1('0x6e')][_0x91c1('0x6f')]())[_0x91c1('0x38')](_0x91c1('0x84'),_0xad304f[_0x91c1('0x4c')]['id']['toString']())[_0x91c1('0x38')](_0x91c1('0x85'),_0xed84c9))[_0x91c1('0x6f')]();_0x3e5ab2[_0x91c1('0x86')](db[_0x91c1('0x87')][_0x91c1('0x2f')](_0xaf6e53));_0xf0a8b['push'](db[_0x91c1('0x87')][_0x91c1('0x2f')](_0x6fc56));}return BPromise[_0x91c1('0x88')](_0x3e5ab2);}})['then'](function(){return BPromise['all'](_0xf0a8b);})[_0x91c1('0x23')](function(){return _0x26d22c;})['then'](respondWithResult(_0x129605,null))[_0x91c1('0x40')](handleError(_0x129605,null));};exports[_0x91c1('0x89')]=function(_0x3596c9,_0x27fe6d,_0x534515){return db[_0x91c1('0x2b')][_0x91c1('0x48')]({'where':{'id':_0x3596c9['params']['id']}})['then'](handleEntityNotFound(_0x27fe6d,null))[_0x91c1('0x23')](function(_0x18324b){if(_0x18324b){return _0x18324b[_0x91c1('0x89')](_0x3596c9[_0x91c1('0x2f')][_0x91c1('0x8a')]);}})[_0x91c1('0x23')](function(_0x14376a){if(_0x14376a){return db[_0x91c1('0x55')]['destroy']({'where':{'ListId':_0x3596c9['query'][_0x91c1('0x8a')],'CampaignId':_0x3596c9[_0x91c1('0x4c')]['id']}})[_0x91c1('0x23')](function(){return _0x14376a;});}})['then'](respondWithStatusCode(_0x27fe6d,null))[_0x91c1('0x40')](handleError(_0x27fe6d,null));};exports['getBlackLists']=function(_0x1134e4,_0x95bb8,_0x5a827f){var _0x438786={};var _0x29b90e={};var _0x23abed;var _0x2c8cbd;return db[_0x91c1('0x2b')]['findOne']({'where':{'id':_0x1134e4['params']['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x95bb8,null))[_0x91c1('0x23')](function(_0x1434e7){if(_0x1434e7){_0x23abed=_0x1434e7;_0x29b90e[_0x91c1('0x2e')]=_[_0x91c1('0x30')](db['CmList'][_0x91c1('0x2c')]);_0x29b90e['query']=_['keys'](_0x1134e4[_0x91c1('0x2f')]);_0x29b90e[_0x91c1('0x31')]=_['intersection'](_0x29b90e[_0x91c1('0x2e')],_0x29b90e[_0x91c1('0x2f')]);_0x438786[_0x91c1('0x33')]=_[_0x91c1('0x32')](_0x29b90e[_0x91c1('0x2e')],qs[_0x91c1('0x34')](_0x1134e4[_0x91c1('0x2f')][_0x91c1('0x34')]));_0x438786[_0x91c1('0x33')]=_0x438786[_0x91c1('0x33')][_0x91c1('0x35')]?_0x438786[_0x91c1('0x33')]:_0x29b90e[_0x91c1('0x2e')];_0x438786[_0x91c1('0x36')]=qs[_0x91c1('0x37')](_0x1134e4[_0x91c1('0x2f')][_0x91c1('0x37')]);_0x438786[_0x91c1('0x38')]=qs[_0x91c1('0x31')](_[_0x91c1('0x39')](_0x1134e4['query'],_0x29b90e[_0x91c1('0x31')]));if(_0x1134e4['query'][_0x91c1('0x3a')]){_0x438786['where']=_[_0x91c1('0x42')](_0x438786['where'],{'$or':_['map'](_0x438786[_0x91c1('0x33')],function(_0x14b430){var _0x25f9fb={};_0x25f9fb[_0x14b430]={'$like':'%'+_0x1134e4[_0x91c1('0x2f')][_0x91c1('0x3a')]+'%'};return _0x25f9fb;})});}_0x438786=_[_0x91c1('0x42')]({},_0x438786,_0x1134e4[_0x91c1('0x4d')]);return _0x23abed['getBlackLists'](_0x438786);}})['then'](function(_0x370714){if(_0x370714){_0x2c8cbd=_0x370714[_0x91c1('0x35')];if(!_0x1134e4[_0x91c1('0x2f')]['hasOwnProperty'](_0x91c1('0x57'))){_0x438786['limit']=qs['limit'](_0x1134e4[_0x91c1('0x2f')]['limit']);_0x438786['offset']=qs[_0x91c1('0x1a')](_0x1134e4[_0x91c1('0x2f')][_0x91c1('0x1a')]);}return _0x23abed['getBlackLists'](_0x438786);}})['then'](function(_0x22fafd){if(_0x22fafd){return _0x22fafd?{'count':_0x2c8cbd,'rows':_0x22fafd}:null;}})[_0x91c1('0x23')](respondWithResult(_0x95bb8,null))[_0x91c1('0x40')](handleError(_0x95bb8,null));};exports[_0x91c1('0x8b')]=function(_0x3a03d1,_0x1c747a,_0xf2b9d0){var _0x420e14,_0x36dc85;var _0x4da6c1=[];var _0x379575=moment()[_0x91c1('0x61')](_0x91c1('0x62'));return db[_0x91c1('0x2b')]['find']({'where':{'id':_0x3a03d1['params']['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x1c747a,null))[_0x91c1('0x23')](function(_0x4452e9){if(_0x4452e9){_0x36dc85=_0x4452e9;return _0x4452e9[_0x91c1('0x8b')](_0x3a03d1[_0x91c1('0x44')][_0x91c1('0x8a')],_[_0x91c1('0x4e')](_0x3a03d1[_0x91c1('0x44')],[_0x91c1('0x8a'),'id'])||{});}return null;})[_0x91c1('0x8c')](function(_0x4ad5a){var _0x1ea4e8;var _0xea140a;_0x420e14=_0x4ad5a||[];var _0x2c2459=[];if(_0x4ad5a){for(var _0x2db243=0x0;_0x2db243<_0x4ad5a[_0x91c1('0x35')];_0x2db243+=0x1){var _0x36176e=_0x4ad5a[_0x2db243][_0x91c1('0x24')]({'plain':!![]});_0x1ea4e8=squel[_0x91c1('0x66')]()[_0x91c1('0x79')](_0x91c1('0x8d'))[_0x91c1('0x68')]([_0x91c1('0x6c'),'ContactId',_0x91c1('0x6a'),_0x91c1('0x58'),'createdAt',_0x91c1('0x4f')],squel[_0x91c1('0x75')]()[_0x91c1('0x6b')]('phone',_0x91c1('0x6c'))['field']('id','ContactId')[_0x91c1('0x6b')](_0x36176e['CmListId'][_0x91c1('0x6f')](),_0x91c1('0x6a'))[_0x91c1('0x6b')](_0x3a03d1['params']['id'][_0x91c1('0x6f')](),_0x91c1('0x58'))['field'](_0x91c1('0x7a'),'createdAt')[_0x91c1('0x6b')](_0x91c1('0x7a'),_0x91c1('0x4f'))['from'](_0x91c1('0x71'))['where'](_0x91c1('0x72'))['where']('ListId\x20=\x20?',_0x36176e[_0x91c1('0x6e')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x2c2459[_0x91c1('0x86')](db['sequelize'][_0x91c1('0x2f')](_0x1ea4e8));}return BPromise[_0x91c1('0x88')](_0x2c2459);}})[_0x91c1('0x23')](function(){return _0x420e14;})[_0x91c1('0x23')](respondWithResult(_0x1c747a,null))[_0x91c1('0x40')](handleError(_0x1c747a,null));};exports['removeBlackLists']=function(_0x4effc2,_0x7c0da8,_0x448f54){return db['Campaign'][_0x91c1('0x48')]({'where':{'id':_0x4effc2[_0x91c1('0x4c')]['id']}})[_0x91c1('0x23')](handleEntityNotFound(_0x7c0da8,null))[_0x91c1('0x23')](function(_0x3157c5){if(_0x3157c5){return _0x3157c5[_0x91c1('0x8e')](_0x4effc2['query'][_0x91c1('0x8a')]);}})[_0x91c1('0x23')](function(_0x40f3ad){if(_0x40f3ad){return db[_0x91c1('0x5e')][_0x91c1('0x22')]({'where':{'ListId':_0x4effc2[_0x91c1('0x2f')][_0x91c1('0x8a')],'CampaignId':_0x4effc2[_0x91c1('0x4c')]['id']}})[_0x91c1('0x23')](function(){return _0x40f3ad;});}})[_0x91c1('0x23')](respondWithStatusCode(_0x7c0da8,null))['catch'](handleError(_0x7c0da8,null));};
\ No newline at end of file
+var _0xeb74=['params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','getHoppers','findOne','CmHopper','nolimit','sort','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','CampaignId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','fromQuery','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','send','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x44cc6f,_0xe6a260){var _0x2b22c4=function(_0x827143){while(--_0x827143){_0x44cc6f['push'](_0x44cc6f['shift']());}};_0x2b22c4(++_0xe6a260);}(_0xeb74,0xe3));var _0x4eb7=function(_0x24e709,_0x4008c4){_0x24e709=_0x24e709-0x0;var _0x30e4e9=_0xeb74[_0x24e709];return _0x30e4e9;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){var _0x2e8de8=_0x4de2d9[_0x4eb7('0x27')]({'plain':!![]});var _0x3e0da2=_0x4eb7('0x28');return db[_0x4eb7('0x29')][_0x4eb7('0x26')]({'where':{'type':_0x3e0da2,'resourceId':_0x2e8de8['id']}})[_0x4eb7('0x25')](function(){return _0x4de2d9;});})[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x2a')]();});}};}function handleEntityNotFound(_0x2d1773,_0x1b56a8){return function(_0x433794){if(!_0x433794){_0x2d1773[_0x4eb7('0x2b')](0x194);}return _0x433794;};}function handleError(_0x2be00c,_0x41e515){_0x41e515=_0x41e515||0x1f4;return function(_0x33a2c1){logger[_0x4eb7('0x2c')](_0x33a2c1[_0x4eb7('0x2d')]);if(_0x33a2c1[_0x4eb7('0x2e')]){delete _0x33a2c1[_0x4eb7('0x2e')];}_0x2be00c['status'](_0x41e515)[_0x4eb7('0x2f')](_0x33a2c1);};}exports['index']=function(_0x446872,_0x13f71a){var _0xc5aa21={},_0x1fe298={},_0x468195={'count':0x0,'rows':[]};var _0x1cec8e=_[_0x4eb7('0x30')](db[_0x4eb7('0x31')][_0x4eb7('0x32')],function(_0x4f8879){return{'name':_0x4f8879[_0x4eb7('0x33')],'type':_0x4f8879['type'][_0x4eb7('0x34')]};});_0x1fe298[_0x4eb7('0x35')]=_['map'](_0x1cec8e,'name');_0x1fe298[_0x4eb7('0x36')]=_[_0x4eb7('0x37')](_0x446872[_0x4eb7('0x36')]);_0x1fe298[_0x4eb7('0x38')]=_['intersection'](_0x1fe298[_0x4eb7('0x35')],_0x1fe298[_0x4eb7('0x36')]);_0xc5aa21[_0x4eb7('0x39')]=_[_0x4eb7('0x3a')](_0x1fe298[_0x4eb7('0x35')],qs['fields'](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0xc5aa21[_0x4eb7('0x39')]=_0xc5aa21['attributes'][_0x4eb7('0x3c')]?_0xc5aa21[_0x4eb7('0x39')]:_0x1fe298[_0x4eb7('0x35')];if(!_0x446872['query'][_0x4eb7('0x3d')]('nolimit')){_0xc5aa21[_0x4eb7('0x1d')]=qs[_0x4eb7('0x1d')](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x1d')]);_0xc5aa21['offset']=qs[_0x4eb7('0x1b')](_0x446872[_0x4eb7('0x36')][_0x4eb7('0x1b')]);}_0xc5aa21[_0x4eb7('0x3e')]=qs['sort'](_0x446872['query']['sort']);_0xc5aa21[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_[_0x4eb7('0x40')](_0x446872[_0x4eb7('0x36')],_0x1fe298[_0x4eb7('0x38')]),_0x1cec8e);if(_0x446872[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0xc5aa21[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0xc5aa21[_0x4eb7('0x3f')],{'$or':_['map'](_0x1cec8e,function(_0x5d0e51){if(_0x5d0e51[_0x4eb7('0x43')]!==_0x4eb7('0x44')){var _0x4597c8={};_0x4597c8[_0x5d0e51[_0x4eb7('0x2e')]]={'$like':'%'+_0x446872[_0x4eb7('0x36')][_0x4eb7('0x41')]+'%'};return _0x4597c8;}})});}_0xc5aa21=_[_0x4eb7('0x42')]({},_0xc5aa21,_0x446872[_0x4eb7('0x45')]);var _0x3a31ce={'where':_0xc5aa21[_0x4eb7('0x3f')]};return db[_0x4eb7('0x31')][_0x4eb7('0x1e')](_0x3a31ce)[_0x4eb7('0x25')](function(_0x38af1f){_0x468195[_0x4eb7('0x1e')]=_0x38af1f;if(_0x446872[_0x4eb7('0x36')][_0x4eb7('0x46')]){_0xc5aa21[_0x4eb7('0x47')]=[{'all':!![]}];}return db[_0x4eb7('0x31')]['findAll'](_0xc5aa21);})[_0x4eb7('0x25')](function(_0x2df542){_0x468195[_0x4eb7('0x48')]=_0x2df542;return _0x468195;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x13f71a,_0xc5aa21))[_0x4eb7('0x49')](handleError(_0x13f71a,null));};exports[_0x4eb7('0x4a')]=function(_0x3cd9e5,_0x10fac2){var _0x3d6b0b={'raw':![],'where':{'id':_0x3cd9e5[_0x4eb7('0x4b')]['id']}},_0x4969eb={};_0x4969eb['model']=_[_0x4eb7('0x37')](db[_0x4eb7('0x31')][_0x4eb7('0x32')]);_0x4969eb['query']=_[_0x4eb7('0x37')](_0x3cd9e5[_0x4eb7('0x36')]);_0x4969eb[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x4969eb['model'],_0x4969eb[_0x4eb7('0x36')]);_0x3d6b0b['attributes']=_[_0x4eb7('0x3a')](_0x4969eb[_0x4eb7('0x35')],qs[_0x4eb7('0x3b')](_0x3cd9e5[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0x3d6b0b['attributes']=_0x3d6b0b['attributes'][_0x4eb7('0x3c')]?_0x3d6b0b[_0x4eb7('0x39')]:_0x4969eb[_0x4eb7('0x35')];if(_0x3cd9e5[_0x4eb7('0x36')][_0x4eb7('0x46')]){_0x3d6b0b['include']=[{'all':!![]}];}_0x3d6b0b=_[_0x4eb7('0x42')]({},_0x3d6b0b,_0x3cd9e5[_0x4eb7('0x45')]);return db['Campaign'][_0x4eb7('0x4c')](_0x3d6b0b)[_0x4eb7('0x25')](handleEntityNotFound(_0x10fac2,null))['then'](respondWithResult(_0x10fac2,null))[_0x4eb7('0x49')](handleError(_0x10fac2,null));};exports[_0x4eb7('0x4d')]=function(_0x3c8049,_0x5774d5){return db[_0x4eb7('0x31')]['create'](_0x3c8049['body'],{})[_0x4eb7('0x25')](function(_0x312e9b){var _0x32d7d6=_0x3c8049[_0x4eb7('0x4e')][_0x4eb7('0x27')]({'plain':!![]});if(!_0x32d7d6)throw new Error(_0x4eb7('0x4f'));if(_0x32d7d6[_0x4eb7('0x50')]===_0x4eb7('0x4e')){var _0x2913c5=_0x312e9b[_0x4eb7('0x27')]({'plain':!![]});var _0x42a1d9=_0x4eb7('0x28');return db[_0x4eb7('0x51')][_0x4eb7('0x4c')]({'where':{'name':_0x42a1d9,'userProfileId':_0x32d7d6[_0x4eb7('0x52')]},'raw':!![]})[_0x4eb7('0x25')](function(_0x327f1e){if(_0x327f1e&&_0x327f1e[_0x4eb7('0x53')]===0x0){return db[_0x4eb7('0x29')][_0x4eb7('0x4d')]({'name':_0x2913c5['name'],'resourceId':_0x2913c5['id'],'type':_0x327f1e[_0x4eb7('0x2e')],'sectionId':_0x327f1e['id']},{})['then'](function(){return _0x312e9b;});}else{return _0x312e9b;}})['catch'](function(_0x3f3a5f){logger[_0x4eb7('0x2c')](_0x4eb7('0x54'),_0x3f3a5f);throw _0x3f3a5f;});}return _0x312e9b;})[_0x4eb7('0x25')](respondWithResult(_0x5774d5,0xc9))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports['clone']=function(_0x4e3163,_0x2e5d28){var _0x5a3192={'where':{'id':_0x4e3163[_0x4eb7('0x4b')]['id']}},_0x2f68a8={};_0x2f68a8[_0x4eb7('0x35')]=_[_0x4eb7('0x37')](db['Campaign'][_0x4eb7('0x32')]);_0x5a3192[_0x4eb7('0x39')]=_[_0x4eb7('0x3a')](_0x2f68a8[_0x4eb7('0x35')],qs['fields'](_0x4e3163[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0x5a3192['attributes']=_0x5a3192[_0x4eb7('0x39')][_0x4eb7('0x3c')]?_0x5a3192['attributes']:_0x2f68a8[_0x4eb7('0x35')];if(_0x4e3163['query'][_0x4eb7('0x46')]){_0x5a3192['include']=[{'all':!![]}];}_0x5a3192=_[_0x4eb7('0x42')]({},_0x5a3192,_0x4e3163[_0x4eb7('0x45')]);return db[_0x4eb7('0x31')][_0x4eb7('0x4c')](_0x5a3192)[_0x4eb7('0x25')](handleEntityNotFound(_0x2e5d28,null))[_0x4eb7('0x25')](function(_0x4e05ac){if(_0x4e05ac){var _0x4a4fc5=_0x4e05ac[_0x4eb7('0x27')]({'plain':!![]});_0x4a4fc5=qs[_0x4eb7('0x55')](_0x4a4fc5,['id',_0x4eb7('0x56'),_0x4eb7('0x57')]);_0x4e3163['body']=_[_0x4eb7('0x55')](_0x4e3163[_0x4eb7('0x58')],['id','createdAt',_0x4eb7('0x57')]);return db[_0x4eb7('0x31')][_0x4eb7('0x4d')](_[_0x4eb7('0x42')](_0x4a4fc5,_0x4e3163[_0x4eb7('0x58')]),{'include':_0x4e3163[_0x4eb7('0x36')][_0x4eb7('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x5839f1){var _0xcc658e=_0x4e3163['user'][_0x4eb7('0x27')]({'plain':!![]});if(!_0xcc658e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcc658e[_0x4eb7('0x50')]==='user'){var _0x4f7fd1=_0x5839f1[_0x4eb7('0x27')]({'plain':!![]});var _0xa67fe1='IvrCampaigns';return db[_0x4eb7('0x51')]['find']({'where':{'name':_0xa67fe1,'userProfileId':_0xcc658e[_0x4eb7('0x52')]},'raw':!![]})[_0x4eb7('0x25')](function(_0x4ab8e8){if(_0x4ab8e8&&_0x4ab8e8[_0x4eb7('0x53')]===0x0){return db[_0x4eb7('0x29')]['create']({'name':_0x4f7fd1['name'],'resourceId':_0x4f7fd1['id'],'type':_0x4ab8e8['name'],'sectionId':_0x4ab8e8['id']},{})['then'](function(){return _0x5839f1;});}else{return _0x5839f1;}})[_0x4eb7('0x49')](function(_0x560ffc){logger[_0x4eb7('0x2c')](_0x4eb7('0x54'),_0x560ffc);throw _0x560ffc;});}return _0x5839f1;});}})['then'](respondWithResult(_0x2e5d28,0xc9))[_0x4eb7('0x49')](handleError(_0x2e5d28,null));};exports[_0x4eb7('0x24')]=function(_0x463ab6,_0x984dc3){if(_0x463ab6[_0x4eb7('0x58')]['id']){delete _0x463ab6[_0x4eb7('0x58')]['id'];}return db['Campaign']['find']({'where':{'id':_0x463ab6['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x984dc3,null))[_0x4eb7('0x25')](saveUpdates(_0x463ab6[_0x4eb7('0x58')],null))[_0x4eb7('0x25')](respondWithResult(_0x984dc3,null))[_0x4eb7('0x49')](handleError(_0x984dc3,null));};exports['destroy']=function(_0x4be9e2,_0x438fc2){return db[_0x4eb7('0x31')][_0x4eb7('0x4c')]({'where':{'id':_0x4be9e2[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x438fc2,null))['then'](removeEntity(_0x438fc2,null))[_0x4eb7('0x49')](handleError(_0x438fc2,null));};exports[_0x4eb7('0x59')]=function(_0x2db051,_0x3743f3,_0x5b787c){var _0x4ea56b={'raw':!![],'where':{}};var _0x3bcbd1={};var _0x3883f3={'count':0x0,'rows':[]};return db['Campaign'][_0x4eb7('0x5a')]({'where':{'id':_0x2db051['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x3743f3,null))[_0x4eb7('0x25')](function(_0x3d06c0){if(_0x3d06c0){_0x3bcbd1[_0x4eb7('0x35')]=_['keys'](db[_0x4eb7('0x5b')][_0x4eb7('0x32')]);_0x3bcbd1[_0x4eb7('0x36')]=_[_0x4eb7('0x37')](_0x2db051[_0x4eb7('0x36')]);_0x3bcbd1[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x3bcbd1[_0x4eb7('0x35')],_0x3bcbd1[_0x4eb7('0x36')]);_0x4ea56b[_0x4eb7('0x39')]=_[_0x4eb7('0x3a')](_0x3bcbd1[_0x4eb7('0x35')],qs[_0x4eb7('0x3b')](_0x2db051[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0x4ea56b[_0x4eb7('0x39')]=_0x4ea56b[_0x4eb7('0x39')][_0x4eb7('0x3c')]?_0x4ea56b[_0x4eb7('0x39')]:_0x3bcbd1['model'];if(!_0x2db051['query'][_0x4eb7('0x3d')](_0x4eb7('0x5c'))){_0x4ea56b[_0x4eb7('0x1d')]=qs[_0x4eb7('0x1d')](_0x2db051[_0x4eb7('0x36')][_0x4eb7('0x1d')]);_0x4ea56b[_0x4eb7('0x1b')]=qs[_0x4eb7('0x1b')](_0x2db051['query'][_0x4eb7('0x1b')]);}_0x4ea56b[_0x4eb7('0x3e')]=qs[_0x4eb7('0x5d')](_0x2db051['query']['sort']);_0x4ea56b[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_[_0x4eb7('0x40')](_0x2db051['query'],_0x3bcbd1['filters']));_0x4ea56b[_0x4eb7('0x3f')][_0x4eb7('0x5e')]=_0x3d06c0['id'];if(_0x2db051[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0x4ea56b[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0x4ea56b[_0x4eb7('0x3f')],{'$or':_[_0x4eb7('0x30')](_0x4ea56b[_0x4eb7('0x39')],function(_0x2e531e){var _0x21f405={};_0x21f405[_0x2e531e]={'$like':'%'+_0x2db051[_0x4eb7('0x36')]['filter']+'%'};return _0x21f405;})});}_0x4ea56b=_['merge']({},_0x4ea56b,_0x2db051[_0x4eb7('0x45')]);return db[_0x4eb7('0x5b')][_0x4eb7('0x1e')]({'where':_0x4ea56b[_0x4eb7('0x3f')]})[_0x4eb7('0x25')](function(_0x1cc1ac){_0x3883f3['count']=_0x1cc1ac;if(_0x2db051['query'][_0x4eb7('0x46')]){_0x4ea56b[_0x4eb7('0x47')]=[{'all':!![]}];}return db[_0x4eb7('0x5b')][_0x4eb7('0x5f')](_0x4ea56b);})[_0x4eb7('0x25')](function(_0x2480ed){_0x3883f3[_0x4eb7('0x48')]=_0x2480ed;return _0x3883f3;});}})[_0x4eb7('0x25')](respondWithFilteredResult(_0x3743f3,_0x4ea56b))[_0x4eb7('0x49')](handleError(_0x3743f3,null));};exports[_0x4eb7('0x60')]=function(_0x44d914,_0x77fb5,_0x12afc0){var _0x186946={'raw':!![],'where':{}};var _0x5ea3ed={};var _0x1a2850={'count':0x0,'rows':[]};return db[_0x4eb7('0x31')][_0x4eb7('0x5a')]({'where':{'id':_0x44d914[_0x4eb7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x77fb5,null))[_0x4eb7('0x25')](function(_0xac2468){if(_0xac2468){_0x5ea3ed['model']=_[_0x4eb7('0x37')](db[_0x4eb7('0x61')][_0x4eb7('0x32')]);_0x5ea3ed['query']=_[_0x4eb7('0x37')](_0x44d914[_0x4eb7('0x36')]);_0x5ea3ed[_0x4eb7('0x38')]=_['intersection'](_0x5ea3ed[_0x4eb7('0x35')],_0x5ea3ed['query']);_0x186946['attributes']=_[_0x4eb7('0x3a')](_0x5ea3ed['model'],qs[_0x4eb7('0x3b')](_0x44d914['query'][_0x4eb7('0x3b')]));_0x186946[_0x4eb7('0x39')]=_0x186946[_0x4eb7('0x39')][_0x4eb7('0x3c')]?_0x186946[_0x4eb7('0x39')]:_0x5ea3ed[_0x4eb7('0x35')];if(!_0x44d914['query'][_0x4eb7('0x3d')](_0x4eb7('0x5c'))){_0x186946[_0x4eb7('0x1d')]=qs[_0x4eb7('0x1d')](_0x44d914[_0x4eb7('0x36')][_0x4eb7('0x1d')]);_0x186946[_0x4eb7('0x1b')]=qs['offset'](_0x44d914[_0x4eb7('0x36')][_0x4eb7('0x1b')]);}_0x186946[_0x4eb7('0x3e')]=qs[_0x4eb7('0x5d')](_0x44d914[_0x4eb7('0x36')][_0x4eb7('0x5d')]);_0x186946[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_[_0x4eb7('0x40')](_0x44d914[_0x4eb7('0x36')],_0x5ea3ed[_0x4eb7('0x38')]));_0x186946[_0x4eb7('0x3f')][_0x4eb7('0x5e')]=_0xac2468['id'];if(_0x44d914['query'][_0x4eb7('0x41')]){_0x186946[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0x186946[_0x4eb7('0x3f')],{'$or':_[_0x4eb7('0x30')](_0x186946[_0x4eb7('0x39')],function(_0x33d64f){var _0x69d5={};_0x69d5[_0x33d64f]={'$like':'%'+_0x44d914['query'][_0x4eb7('0x41')]+'%'};return _0x69d5;})});}_0x186946=_[_0x4eb7('0x42')]({},_0x186946,_0x44d914[_0x4eb7('0x45')]);return db[_0x4eb7('0x61')]['count']({'where':_0x186946[_0x4eb7('0x3f')]})['then'](function(_0x55efba){_0x1a2850['count']=_0x55efba;if(_0x44d914['query'][_0x4eb7('0x46')]){_0x186946[_0x4eb7('0x47')]=[{'all':!![]}];}return db[_0x4eb7('0x61')][_0x4eb7('0x5f')](_0x186946);})['then'](function(_0x351f20){_0x1a2850[_0x4eb7('0x48')]=_0x351f20;return _0x1a2850;});}})[_0x4eb7('0x25')](respondWithFilteredResult(_0x77fb5,_0x186946))[_0x4eb7('0x49')](handleError(_0x77fb5,null));};exports[_0x4eb7('0x62')]=function(_0x101079,_0x105139,_0x34af15){var _0x4f1998={'raw':!![],'where':{}};var _0x8e873d={};var _0x33ff1e={'count':0x0,'rows':[]};return db[_0x4eb7('0x31')]['findOne']({'where':{'id':_0x101079[_0x4eb7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x105139,null))[_0x4eb7('0x25')](function(_0x6519f8){if(_0x6519f8){_0x8e873d['model']=_[_0x4eb7('0x37')](db['CmHopperFinal'][_0x4eb7('0x32')]);_0x8e873d['query']=_[_0x4eb7('0x37')](_0x101079['query']);_0x8e873d[_0x4eb7('0x38')]=_['intersection'](_0x8e873d['model'],_0x8e873d[_0x4eb7('0x36')]);_0x4f1998[_0x4eb7('0x39')]=_[_0x4eb7('0x3a')](_0x8e873d['model'],qs['fields'](_0x101079['query']['fields']));_0x4f1998[_0x4eb7('0x39')]=_0x4f1998[_0x4eb7('0x39')][_0x4eb7('0x3c')]?_0x4f1998[_0x4eb7('0x39')]:_0x8e873d['model'];if(!_0x101079[_0x4eb7('0x36')][_0x4eb7('0x3d')](_0x4eb7('0x5c'))){_0x4f1998['limit']=qs[_0x4eb7('0x1d')](_0x101079['query'][_0x4eb7('0x1d')]);_0x4f1998[_0x4eb7('0x1b')]=qs['offset'](_0x101079[_0x4eb7('0x36')][_0x4eb7('0x1b')]);}_0x4f1998[_0x4eb7('0x3e')]=qs[_0x4eb7('0x5d')](_0x101079[_0x4eb7('0x36')][_0x4eb7('0x5d')]);_0x4f1998[_0x4eb7('0x3f')]=qs['filters'](_[_0x4eb7('0x40')](_0x101079[_0x4eb7('0x36')],_0x8e873d['filters']));_0x4f1998[_0x4eb7('0x3f')][_0x4eb7('0x5e')]=_0x6519f8['id'];if(_0x101079[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0x4f1998[_0x4eb7('0x3f')]=_['merge'](_0x4f1998['where'],{'$or':_['map'](_0x4f1998[_0x4eb7('0x39')],function(_0x5a64ee){var _0x47dd40={};_0x47dd40[_0x5a64ee]={'$like':'%'+_0x101079['query']['filter']+'%'};return _0x47dd40;})});}_0x4f1998=_[_0x4eb7('0x42')]({},_0x4f1998,_0x101079['options']);return db[_0x4eb7('0x63')][_0x4eb7('0x1e')]({'where':_0x4f1998[_0x4eb7('0x3f')]})[_0x4eb7('0x25')](function(_0x54c754){_0x33ff1e[_0x4eb7('0x1e')]=_0x54c754;if(_0x101079[_0x4eb7('0x36')][_0x4eb7('0x46')]){_0x4f1998['include']=[{'all':!![]}];}return db[_0x4eb7('0x63')][_0x4eb7('0x5f')](_0x4f1998);})[_0x4eb7('0x25')](function(_0x16fdd4){_0x33ff1e[_0x4eb7('0x48')]=_0x16fdd4;return _0x33ff1e;});}})['then'](respondWithFilteredResult(_0x105139,_0x4f1998))['catch'](handleError(_0x105139,null));};exports[_0x4eb7('0x64')]=function(_0x5d90ea,_0xb32651,_0x4a029b){var _0x1e89e5={'raw':!![],'where':{}};var _0x272c72={};var _0x499c99={'count':0x0,'rows':[]};return db[_0x4eb7('0x31')][_0x4eb7('0x5a')]({'where':{'id':_0x5d90ea[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0xb32651,null))['then'](function(_0x5769f5){if(_0x5769f5){_0x272c72[_0x4eb7('0x35')]=_[_0x4eb7('0x37')](db[_0x4eb7('0x65')][_0x4eb7('0x32')]);_0x272c72[_0x4eb7('0x36')]=_[_0x4eb7('0x37')](_0x5d90ea[_0x4eb7('0x36')]);_0x272c72[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x272c72[_0x4eb7('0x35')],_0x272c72['query']);_0x1e89e5[_0x4eb7('0x39')]=_[_0x4eb7('0x3a')](_0x272c72[_0x4eb7('0x35')],qs[_0x4eb7('0x3b')](_0x5d90ea[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0x1e89e5['attributes']=_0x1e89e5[_0x4eb7('0x39')][_0x4eb7('0x3c')]?_0x1e89e5[_0x4eb7('0x39')]:_0x272c72['model'];if(!_0x5d90ea[_0x4eb7('0x36')][_0x4eb7('0x3d')](_0x4eb7('0x5c'))){_0x1e89e5['limit']=qs[_0x4eb7('0x1d')](_0x5d90ea[_0x4eb7('0x36')][_0x4eb7('0x1d')]);_0x1e89e5[_0x4eb7('0x1b')]=qs[_0x4eb7('0x1b')](_0x5d90ea[_0x4eb7('0x36')][_0x4eb7('0x1b')]);}_0x1e89e5[_0x4eb7('0x3e')]=qs[_0x4eb7('0x5d')](_0x5d90ea[_0x4eb7('0x36')][_0x4eb7('0x5d')]);_0x1e89e5[_0x4eb7('0x3f')]=qs['filters'](_[_0x4eb7('0x40')](_0x5d90ea[_0x4eb7('0x36')],_0x272c72[_0x4eb7('0x38')]));_0x1e89e5[_0x4eb7('0x3f')]['CampaignId']=_0x5769f5['id'];if(_0x5d90ea[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0x1e89e5[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0x1e89e5[_0x4eb7('0x3f')],{'$or':_[_0x4eb7('0x30')](_0x1e89e5[_0x4eb7('0x39')],function(_0x53afbd){var _0x4de732={};_0x4de732[_0x53afbd]={'$like':'%'+_0x5d90ea[_0x4eb7('0x36')]['filter']+'%'};return _0x4de732;})});}_0x1e89e5=_['merge']({},_0x1e89e5,_0x5d90ea[_0x4eb7('0x45')]);return db[_0x4eb7('0x65')][_0x4eb7('0x1e')]({'where':_0x1e89e5[_0x4eb7('0x3f')]})[_0x4eb7('0x25')](function(_0x5ce7ff){_0x499c99[_0x4eb7('0x1e')]=_0x5ce7ff;if(_0x5d90ea['query'][_0x4eb7('0x46')]){_0x1e89e5[_0x4eb7('0x47')]=[{'all':!![]}];}return db[_0x4eb7('0x65')][_0x4eb7('0x5f')](_0x1e89e5);})[_0x4eb7('0x25')](function(_0xa32dd){_0x499c99['rows']=_0xa32dd;return _0x499c99;});}})['then'](respondWithFilteredResult(_0xb32651,_0x1e89e5))[_0x4eb7('0x49')](handleError(_0xb32651,null));};exports[_0x4eb7('0x66')]=function(_0x52c84b,_0x11c58b,_0x234ece){var _0x12cc9d={};var _0x5d169b={};var _0x5795de;var _0x4a983d;return db[_0x4eb7('0x31')][_0x4eb7('0x5a')]({'where':{'id':_0x52c84b[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x11c58b,null))[_0x4eb7('0x25')](function(_0x6efad6){if(_0x6efad6){_0x5795de=_0x6efad6;_0x5d169b[_0x4eb7('0x35')]=_['keys'](db['CmList'][_0x4eb7('0x32')]);_0x5d169b[_0x4eb7('0x36')]=_[_0x4eb7('0x37')](_0x52c84b[_0x4eb7('0x36')]);_0x5d169b[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x5d169b[_0x4eb7('0x35')],_0x5d169b[_0x4eb7('0x36')]);_0x12cc9d['attributes']=_[_0x4eb7('0x3a')](_0x5d169b['model'],qs[_0x4eb7('0x3b')](_0x52c84b[_0x4eb7('0x36')][_0x4eb7('0x3b')]));_0x12cc9d[_0x4eb7('0x39')]=_0x12cc9d['attributes'][_0x4eb7('0x3c')]?_0x12cc9d[_0x4eb7('0x39')]:_0x5d169b[_0x4eb7('0x35')];_0x12cc9d[_0x4eb7('0x3e')]=qs[_0x4eb7('0x5d')](_0x52c84b[_0x4eb7('0x36')][_0x4eb7('0x5d')]);_0x12cc9d[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_[_0x4eb7('0x40')](_0x52c84b[_0x4eb7('0x36')],_0x5d169b[_0x4eb7('0x38')]));if(_0x52c84b[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0x12cc9d[_0x4eb7('0x3f')]=_['merge'](_0x12cc9d[_0x4eb7('0x3f')],{'$or':_[_0x4eb7('0x30')](_0x12cc9d[_0x4eb7('0x39')],function(_0x3fe52b){var _0x47fb87={};_0x47fb87[_0x3fe52b]={'$like':'%'+_0x52c84b[_0x4eb7('0x36')][_0x4eb7('0x41')]+'%'};return _0x47fb87;})});}_0x12cc9d=_['merge']({},_0x12cc9d,_0x52c84b['options']);return _0x5795de['getLists'](_0x12cc9d);}})[_0x4eb7('0x25')](function(_0x517077){if(_0x517077){_0x4a983d=_0x517077[_0x4eb7('0x3c')];if(!_0x52c84b[_0x4eb7('0x36')][_0x4eb7('0x3d')](_0x4eb7('0x5c'))){_0x12cc9d['limit']=qs[_0x4eb7('0x1d')](_0x52c84b[_0x4eb7('0x36')][_0x4eb7('0x1d')]);_0x12cc9d[_0x4eb7('0x1b')]=qs[_0x4eb7('0x1b')](_0x52c84b[_0x4eb7('0x36')][_0x4eb7('0x1b')]);}return _0x5795de[_0x4eb7('0x66')](_0x12cc9d);}})[_0x4eb7('0x25')](function(_0x2a8d21){if(_0x2a8d21){return _0x2a8d21?{'count':_0x4a983d,'rows':_0x2a8d21}:null;}})[_0x4eb7('0x25')](respondWithResult(_0x11c58b,null))['catch'](handleError(_0x11c58b,null));};exports[_0x4eb7('0x67')]=function(_0x293e4d,_0x12abfc,_0xb9c2e5){var _0x3a9778,_0x383931;var _0x4fd35a=[];var _0xd0353a=moment()[_0x4eb7('0x68')](_0x4eb7('0x69'));return db['Campaign'][_0x4eb7('0x4c')]({'where':{'id':_0x293e4d[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x12abfc,null))[_0x4eb7('0x25')](function(_0xb0a8cb){if(_0xb0a8cb){_0x383931=_0xb0a8cb;return _0xb0a8cb[_0x4eb7('0x67')](_0x293e4d[_0x4eb7('0x58')][_0x4eb7('0x6a')],_[_0x4eb7('0x55')](_0x293e4d[_0x4eb7('0x58')],['ids','id'])||{});}return null;})[_0x4eb7('0x6b')](function(_0x48af11){var _0x57e88b;var _0x4ac4c0;_0x3a9778=_0x48af11||[];var _0x4106a1=[];if(_0x48af11){for(var _0x4e2c55=0x0;_0x4e2c55<_0x48af11[_0x4eb7('0x3c')];_0x4e2c55+=0x1){var _0x33d92e=_0x48af11[_0x4e2c55][_0x4eb7('0x27')]({'plain':!![]});_0x383931['dialCheckDuplicateType']=_0x293e4d[_0x4eb7('0x58')][_0x4eb7('0x6c')]?_0x293e4d['body'][_0x4eb7('0x6c')]:_0x383931[_0x4eb7('0x6c')];switch(_0x383931['dialCheckDuplicateType']){case _0x4eb7('0x6d'):_0x57e88b=squel[_0x4eb7('0x6e')]()['into'](_0x4eb7('0x6f'))['fromQuery']([_0x4eb7('0x70'),'scheduledAt',_0x4eb7('0x71'),_0x4eb7('0x72'),'CampaignId','createdAt',_0x4eb7('0x57')],squel[_0x4eb7('0x73')]()[_0x4eb7('0x74')](_0x4eb7('0x70'),_0x4eb7('0x70'))['field'](_0x4eb7('0x75'),_0x4eb7('0x76'))[_0x4eb7('0x74')]('id',_0x4eb7('0x71'))[_0x4eb7('0x74')](_0x33d92e[_0x4eb7('0x77')][_0x4eb7('0x78')](),_0x4eb7('0x72'))[_0x4eb7('0x74')](_0x293e4d[_0x4eb7('0x4b')]['id']['toString'](),_0x4eb7('0x5e'))[_0x4eb7('0x74')]('\x27'+_0xd0353a+'\x27',_0x4eb7('0x56'))['field']('\x27'+_0xd0353a+'\x27',_0x4eb7('0x57'))[_0x4eb7('0x79')](_0x4eb7('0x7a'))[_0x4eb7('0x3f')]('deletedAt\x20IS\x20NULL')[_0x4eb7('0x3f')](_0x4eb7('0x7b'),_0x33d92e[_0x4eb7('0x77')][_0x4eb7('0x78')]())[_0x4eb7('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x4eb7('0x73')]()[_0x4eb7('0x74')](_0x4eb7('0x7c'))[_0x4eb7('0x79')]('cm_hopper_final')[_0x4eb7('0x3f')]('CampaignId\x20=\x20?',_0x293e4d[_0x4eb7('0x4b')]['id'][_0x4eb7('0x78')]()))['where'](_0x4eb7('0x7d'),squel[_0x4eb7('0x73')]()[_0x4eb7('0x74')](_0x4eb7('0x7e'))['from']('cm_hopper')[_0x4eb7('0x3f')]('CampaignId\x20=\x20?',_0x293e4d[_0x4eb7('0x4b')]['id']['toString']())))[_0x4eb7('0x78')]();break;case _0x4eb7('0x7f'):_0x57e88b=squel[_0x4eb7('0x6e')]()[_0x4eb7('0x80')]('cm_hopper')['fromQuery']([_0x4eb7('0x70'),_0x4eb7('0x76'),_0x4eb7('0x71'),_0x4eb7('0x72'),_0x4eb7('0x5e'),_0x4eb7('0x56'),_0x4eb7('0x57')],squel['select']()['field'](_0x4eb7('0x70'),_0x4eb7('0x70'))['field'](_0x4eb7('0x75'),_0x4eb7('0x76'))[_0x4eb7('0x74')]('id',_0x4eb7('0x71'))[_0x4eb7('0x74')](_0x33d92e[_0x4eb7('0x77')][_0x4eb7('0x78')](),_0x4eb7('0x72'))['field'](_0x293e4d[_0x4eb7('0x4b')]['id'][_0x4eb7('0x78')](),_0x4eb7('0x5e'))[_0x4eb7('0x74')]('\x27'+_0xd0353a+'\x27',_0x4eb7('0x56'))[_0x4eb7('0x74')]('\x27'+_0xd0353a+'\x27','updatedAt')[_0x4eb7('0x79')](_0x4eb7('0x7a'))['where'](_0x4eb7('0x81'))[_0x4eb7('0x3f')]('ListId\x20=\x20?',_0x33d92e[_0x4eb7('0x77')][_0x4eb7('0x78')]())[_0x4eb7('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x4eb7('0x7d'),squel[_0x4eb7('0x73')]()[_0x4eb7('0x74')](_0x4eb7('0x7e'))[_0x4eb7('0x79')]('cm_hopper')[_0x4eb7('0x3f')](_0x4eb7('0x82'),_0x293e4d['params']['id'][_0x4eb7('0x78')]())))['toString']();break;default:_0x57e88b=squel['insert']()[_0x4eb7('0x80')](_0x4eb7('0x6f'))['fromQuery'](['phone',_0x4eb7('0x76'),_0x4eb7('0x71'),_0x4eb7('0x72'),_0x4eb7('0x5e'),_0x4eb7('0x56'),'updatedAt'],squel[_0x4eb7('0x73')]()['field'](_0x4eb7('0x70'),'phone')[_0x4eb7('0x74')](_0x4eb7('0x75'),_0x4eb7('0x76'))[_0x4eb7('0x74')]('id','ContactId')['field'](_0x33d92e['CmListId'][_0x4eb7('0x78')](),_0x4eb7('0x72'))[_0x4eb7('0x74')](_0x293e4d[_0x4eb7('0x4b')]['id'][_0x4eb7('0x78')](),_0x4eb7('0x5e'))[_0x4eb7('0x74')]('\x27'+_0xd0353a+'\x27','createdAt')[_0x4eb7('0x74')]('\x27'+_0xd0353a+'\x27',_0x4eb7('0x57'))[_0x4eb7('0x79')](_0x4eb7('0x7a'))['where'](_0x4eb7('0x81'))['where'](_0x4eb7('0x7b'),_0x33d92e[_0x4eb7('0x77')][_0x4eb7('0x78')]())[_0x4eb7('0x3f')](_0x4eb7('0x83')))[_0x4eb7('0x78')]();}_0x4ac4c0=squel[_0x4eb7('0x6e')]()[_0x4eb7('0x80')](_0x4eb7('0x84'))[_0x4eb7('0x85')]([_0x4eb7('0x86'),'scheduledAt',_0x4eb7('0x70'),'OrderBy',_0x4eb7('0x56'),'updatedAt'],squel[_0x4eb7('0x73')]()[_0x4eb7('0x74')](_0x4eb7('0x87'),'id')[_0x4eb7('0x74')](_0x4eb7('0x75'),_0x4eb7('0x76'))[_0x4eb7('0x74')](_0x4eb7('0x88'),_0x4eb7('0x70'))[_0x4eb7('0x74')](_0x4eb7('0x89'),_0x4eb7('0x8a'))['field']('\x27'+_0xd0353a+'\x27',_0x4eb7('0x56'))[_0x4eb7('0x74')]('\x27'+_0xd0353a+'\x27',_0x4eb7('0x57'))[_0x4eb7('0x79')](_0x4eb7('0x8b'),'ci')[_0x4eb7('0x8c')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x4eb7('0x8d'),_0x33d92e[_0x4eb7('0x77')][_0x4eb7('0x78')]())[_0x4eb7('0x3f')](_0x4eb7('0x8e'),_0x293e4d['params']['id'][_0x4eb7('0x78')]())[_0x4eb7('0x3f')](_0x4eb7('0x8f'),_0xd0353a))[_0x4eb7('0x78')]();_0x4106a1[_0x4eb7('0x90')](db[_0x4eb7('0x91')][_0x4eb7('0x36')](_0x57e88b));_0x4fd35a[_0x4eb7('0x90')](db[_0x4eb7('0x91')][_0x4eb7('0x36')](_0x4ac4c0));}return BPromise[_0x4eb7('0x92')](_0x4106a1);}})['then'](function(){return BPromise[_0x4eb7('0x92')](_0x4fd35a);})[_0x4eb7('0x25')](function(){return _0x3a9778;})['then'](respondWithResult(_0x12abfc,null))[_0x4eb7('0x49')](handleError(_0x12abfc,null));};exports[_0x4eb7('0x93')]=function(_0x3f4911,_0x4c103a,_0x4c53de){return db[_0x4eb7('0x31')][_0x4eb7('0x4c')]({'where':{'id':_0x3f4911[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x4c103a,null))['then'](function(_0x501a14){if(_0x501a14){return _0x501a14[_0x4eb7('0x93')](_0x3f4911[_0x4eb7('0x36')]['ids']);}})['then'](function(_0x3a5349){if(_0x3a5349){return db[_0x4eb7('0x5b')][_0x4eb7('0x26')]({'where':{'ListId':_0x3f4911[_0x4eb7('0x36')][_0x4eb7('0x6a')],'CampaignId':_0x3f4911['params']['id']}})[_0x4eb7('0x25')](function(){return _0x3a5349;});}})['then'](respondWithStatusCode(_0x4c103a,null))[_0x4eb7('0x49')](handleError(_0x4c103a,null));};exports[_0x4eb7('0x94')]=function(_0x17e567,_0x1241fc,_0x4011ed){var _0x36a4c1={};var _0x56c403={};var _0xcc27e5;var _0x3a5725;return db[_0x4eb7('0x31')]['findOne']({'where':{'id':_0x17e567['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x1241fc,null))[_0x4eb7('0x25')](function(_0x43d887){if(_0x43d887){_0xcc27e5=_0x43d887;_0x56c403[_0x4eb7('0x35')]=_['keys'](db['CmList'][_0x4eb7('0x32')]);_0x56c403[_0x4eb7('0x36')]=_[_0x4eb7('0x37')](_0x17e567[_0x4eb7('0x36')]);_0x56c403[_0x4eb7('0x38')]=_[_0x4eb7('0x3a')](_0x56c403['model'],_0x56c403[_0x4eb7('0x36')]);_0x36a4c1[_0x4eb7('0x39')]=_[_0x4eb7('0x3a')](_0x56c403[_0x4eb7('0x35')],qs['fields'](_0x17e567['query'][_0x4eb7('0x3b')]));_0x36a4c1[_0x4eb7('0x39')]=_0x36a4c1[_0x4eb7('0x39')][_0x4eb7('0x3c')]?_0x36a4c1[_0x4eb7('0x39')]:_0x56c403[_0x4eb7('0x35')];_0x36a4c1[_0x4eb7('0x3e')]=qs[_0x4eb7('0x5d')](_0x17e567[_0x4eb7('0x36')][_0x4eb7('0x5d')]);_0x36a4c1[_0x4eb7('0x3f')]=qs[_0x4eb7('0x38')](_['pick'](_0x17e567['query'],_0x56c403[_0x4eb7('0x38')]));if(_0x17e567[_0x4eb7('0x36')][_0x4eb7('0x41')]){_0x36a4c1[_0x4eb7('0x3f')]=_[_0x4eb7('0x42')](_0x36a4c1['where'],{'$or':_[_0x4eb7('0x30')](_0x36a4c1[_0x4eb7('0x39')],function(_0xad9b5b){var _0x2df275={};_0x2df275[_0xad9b5b]={'$like':'%'+_0x17e567[_0x4eb7('0x36')]['filter']+'%'};return _0x2df275;})});}_0x36a4c1=_[_0x4eb7('0x42')]({},_0x36a4c1,_0x17e567[_0x4eb7('0x45')]);return _0xcc27e5[_0x4eb7('0x94')](_0x36a4c1);}})[_0x4eb7('0x25')](function(_0x4a7dd7){if(_0x4a7dd7){_0x3a5725=_0x4a7dd7[_0x4eb7('0x3c')];if(!_0x17e567['query'][_0x4eb7('0x3d')](_0x4eb7('0x5c'))){_0x36a4c1[_0x4eb7('0x1d')]=qs['limit'](_0x17e567['query'][_0x4eb7('0x1d')]);_0x36a4c1[_0x4eb7('0x1b')]=qs[_0x4eb7('0x1b')](_0x17e567['query']['offset']);}return _0xcc27e5[_0x4eb7('0x94')](_0x36a4c1);}})[_0x4eb7('0x25')](function(_0xcba9ca){if(_0xcba9ca){return _0xcba9ca?{'count':_0x3a5725,'rows':_0xcba9ca}:null;}})['then'](respondWithResult(_0x1241fc,null))[_0x4eb7('0x49')](handleError(_0x1241fc,null));};exports[_0x4eb7('0x95')]=function(_0x4d8187,_0x438a08,_0x245c91){var _0x586757,_0x2bcfb9;var _0x396178=[];var _0x3abceb=moment()[_0x4eb7('0x68')](_0x4eb7('0x69'));return db['Campaign']['find']({'where':{'id':_0x4d8187['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x438a08,null))['then'](function(_0xc25719){if(_0xc25719){_0x2bcfb9=_0xc25719;return _0xc25719[_0x4eb7('0x95')](_0x4d8187[_0x4eb7('0x58')][_0x4eb7('0x6a')],_[_0x4eb7('0x55')](_0x4d8187[_0x4eb7('0x58')],[_0x4eb7('0x6a'),'id'])||{});}return null;})[_0x4eb7('0x6b')](function(_0x5fe16d){var _0x1828fc;var _0x2f6c36;_0x586757=_0x5fe16d||[];var _0xd1780=[];if(_0x5fe16d){for(var _0x18e3ab=0x0;_0x18e3ab<_0x5fe16d['length'];_0x18e3ab+=0x1){var _0x1ab700=_0x5fe16d[_0x18e3ab]['get']({'plain':!![]});_0x1828fc=squel[_0x4eb7('0x6e')]()['into']('cm_hopper_black')[_0x4eb7('0x85')]([_0x4eb7('0x70'),_0x4eb7('0x71'),_0x4eb7('0x72'),_0x4eb7('0x5e'),_0x4eb7('0x56'),_0x4eb7('0x57')],squel['select']()['field']('phone',_0x4eb7('0x70'))['field']('id',_0x4eb7('0x71'))[_0x4eb7('0x74')](_0x1ab700[_0x4eb7('0x77')]['toString'](),_0x4eb7('0x72'))['field'](_0x4d8187[_0x4eb7('0x4b')]['id'][_0x4eb7('0x78')](),_0x4eb7('0x5e'))[_0x4eb7('0x74')](_0x4eb7('0x75'),'createdAt')[_0x4eb7('0x74')](_0x4eb7('0x75'),_0x4eb7('0x57'))[_0x4eb7('0x79')](_0x4eb7('0x7a'))[_0x4eb7('0x3f')](_0x4eb7('0x81'))[_0x4eb7('0x3f')]('ListId\x20=\x20?',_0x1ab700[_0x4eb7('0x77')][_0x4eb7('0x78')]())[_0x4eb7('0x3f')](_0x4eb7('0x83')))[_0x4eb7('0x78')]();_0xd1780[_0x4eb7('0x90')](db[_0x4eb7('0x91')]['query'](_0x1828fc));}return BPromise[_0x4eb7('0x92')](_0xd1780);}})['then'](function(){return _0x586757;})['then'](respondWithResult(_0x438a08,null))[_0x4eb7('0x49')](handleError(_0x438a08,null));};exports[_0x4eb7('0x96')]=function(_0x483403,_0x4272df,_0xd7819d){return db[_0x4eb7('0x31')]['find']({'where':{'id':_0x483403[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x4272df,null))[_0x4eb7('0x25')](function(_0x160ce5){if(_0x160ce5){return _0x160ce5[_0x4eb7('0x96')](_0x483403[_0x4eb7('0x36')][_0x4eb7('0x6a')]);}})[_0x4eb7('0x25')](function(_0x159701){if(_0x159701){return db[_0x4eb7('0x65')][_0x4eb7('0x26')]({'where':{'ListId':_0x483403['query'][_0x4eb7('0x6a')],'CampaignId':_0x483403[_0x4eb7('0x4b')]['id']}})['then'](function(){return _0x159701;});}})[_0x4eb7('0x25')](respondWithStatusCode(_0x4272df,null))['catch'](handleError(_0x4272df,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 1c5f669..e671154 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(_0x4e7306,_0x51515f){var _0x403bbe=function(_0x311e60){while(--_0x311e60){_0x4e7306['push'](_0x4e7306['shift']());}};_0x403bbe(++_0x51515f);}(_0x7a54,0x106));var _0x47a5=function(_0x4e3ac4,_0x5dcb6a){_0x4e3ac4=_0x4e3ac4-0x0;var _0x48baf4=_0x7a54[_0x4e3ac4];return _0x48baf4;};'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(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 da2fa57..b236c11 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 _0xfc1e=['result','GetCampaign','findAll','options','attributes','limit','include','map','model','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x54165a,_0x285d04){var _0x21d301=function(_0x125b97){while(--_0x125b97){_0x54165a['push'](_0x54165a['shift']());}};_0x21d301(++_0x285d04);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x5d3903,_0x3d6c3e){_0x5d3903=_0x5d3903-0x0;var _0x4b8bc9=_0xfc1e[_0x5d3903];return _0x4b8bc9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38927c,_0x44d15b,_0x3ff4a7){return new BPromise(function(_0x45bec4,_0x77f637){return client[_0xefc1('0x8')](_0x38927c,_0x3ff4a7)[_0xefc1('0x9')](function(_0x244927){logger[_0xefc1('0xa')](_0xefc1('0xb'),_0x44d15b,'request\x20sent');logger[_0xefc1('0xc')](_0xefc1('0xd'),_0x44d15b,_0xefc1('0xe'),JSON[_0xefc1('0xf')](_0x244927));if(_0x244927[_0xefc1('0x10')]){if(_0x244927[_0xefc1('0x10')][_0xefc1('0x11')]===0x1f4){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x77f637(_0x244927['error'][_0xefc1('0x12')]);}logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x45bec4(_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);}else{logger[_0xefc1('0xa')]('Campaign,\x20%s,\x20%s',_0x44d15b,_0xefc1('0xe'));_0x45bec4(_0x244927[_0xefc1('0x13')][_0xefc1('0x12')]);}})['catch'](function(_0x159adb){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x159adb);_0x77f637(_0x159adb);});});}exports[_0xefc1('0x14')]=function(_0x257914){var _0x38923c=this;return new Promise(function(_0x3b5a6e,_0x126052){return db['Campaign'][_0xefc1('0x15')]({'raw':_0x257914[_0xefc1('0x16')]?_0x257914[_0xefc1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x257914['options']?_0x257914[_0xefc1('0x16')]['where']||null:null,'attributes':_0x257914[_0xefc1('0x16')]?_0x257914['options'][_0xefc1('0x17')]||null:null,'limit':_0x257914[_0xefc1('0x16')]?_0x257914['options'][_0xefc1('0x18')]||null:null,'include':_0x257914[_0xefc1('0x16')]?_0x257914[_0xefc1('0x16')][_0xefc1('0x19')]?_[_0xefc1('0x1a')](_0x257914[_0xefc1('0x16')]['include'],function(_0x2f4935){return{'model':db[_0x2f4935[_0xefc1('0x1b')]],'as':_0x2f4935['as'],'attributes':_0x2f4935['attributes'],'include':_0x2f4935[_0xefc1('0x19')]?_['map'](_0x2f4935['include'],function(_0x21aa3b){return{'model':db[_0x21aa3b[_0xefc1('0x1b')]],'as':_0x21aa3b['as'],'attributes':_0x21aa3b[_0xefc1('0x17')],'include':_0x21aa3b[_0xefc1('0x19')]?_[_0xefc1('0x1a')](_0x21aa3b[_0xefc1('0x19')],function(_0x538145){return{'model':db[_0x538145['model']],'as':_0x538145['as'],'attributes':_0x538145[_0xefc1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xefc1('0x9')](function(_0x20e438){logger[_0xefc1('0xa')](_0xefc1('0x14'),_0x257914);logger['debug'](_0xefc1('0x14'),_0x257914,JSON[_0xefc1('0xf')](_0x20e438));_0x3b5a6e(_0x20e438);})['catch'](function(_0x486a5b){logger[_0xefc1('0x10')](_0xefc1('0x14'),_0x486a5b[_0xefc1('0x12')],_0x257914);_0x126052(_0x38923c['error'](0x1f4,_0x486a5b[_0xefc1('0x12')]));});});};
\ No newline at end of file
+var _0x1ddc=['Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Campaign','findAll','options','attributes','limit','map','include','model','GetCampaign','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x444ff9,_0x29dc7a){_0x444ff9=_0x444ff9-0x0;var _0x3b550f=_0x1ddc[_0x444ff9];return _0x3b550f;};'use strict';var _=require('lodash');var util=require(_0xc1dd('0x0'));var moment=require(_0xc1dd('0x1'));var BPromise=require(_0xc1dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1dd('0x3'));var db=require(_0xc1dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1dd('0x5'))(_0xc1dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1dd('0x7'));var client=jayson[_0xc1dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3938ff,_0x25c543,_0x593de5){return new BPromise(function(_0x54819b,_0x411452){return client[_0xc1dd('0x9')](_0x3938ff,_0x593de5)[_0xc1dd('0xa')](function(_0x217d07){logger['info'](_0xc1dd('0xb'),_0x25c543,_0xc1dd('0xc'));logger[_0xc1dd('0xd')](_0xc1dd('0xe'),_0x25c543,'request\x20sent',JSON[_0xc1dd('0xf')](_0x217d07));if(_0x217d07[_0xc1dd('0x10')]){if(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x11')]===0x1f4){logger[_0xc1dd('0x10')](_0xc1dd('0xb'),_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x411452(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}logger[_0xc1dd('0x10')]('Campaign,\x20%s,\x20%s',_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x54819b(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}else{logger[_0xc1dd('0x13')]('Campaign,\x20%s,\x20%s',_0x25c543,_0xc1dd('0xc'));_0x54819b(_0x217d07[_0xc1dd('0x14')][_0xc1dd('0x12')]);}})[_0xc1dd('0x15')](function(_0x5815d3){logger['error'](_0xc1dd('0xb'),_0x25c543,_0x5815d3);_0x411452(_0x5815d3);});});}exports['GetCampaign']=function(_0x35139a){var _0x4c3114=this;return new Promise(function(_0x6198a7,_0x24446f){return db[_0xc1dd('0x16')][_0xc1dd('0x17')]({'raw':_0x35139a[_0xc1dd('0x18')]?_0x35139a[_0xc1dd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x35139a[_0xc1dd('0x18')]?_0x35139a[_0xc1dd('0x18')]['where']||null:null,'attributes':_0x35139a[_0xc1dd('0x18')]?_0x35139a[_0xc1dd('0x18')][_0xc1dd('0x19')]||null:null,'limit':_0x35139a[_0xc1dd('0x18')]?_0x35139a[_0xc1dd('0x18')][_0xc1dd('0x1a')]||null:null,'include':_0x35139a[_0xc1dd('0x18')]?_0x35139a[_0xc1dd('0x18')]['include']?_[_0xc1dd('0x1b')](_0x35139a[_0xc1dd('0x18')][_0xc1dd('0x1c')],function(_0x3363ff){return{'model':db[_0x3363ff['model']],'as':_0x3363ff['as'],'attributes':_0x3363ff[_0xc1dd('0x19')],'include':_0x3363ff[_0xc1dd('0x1c')]?_[_0xc1dd('0x1b')](_0x3363ff[_0xc1dd('0x1c')],function(_0x16fb8b){return{'model':db[_0x16fb8b[_0xc1dd('0x1d')]],'as':_0x16fb8b['as'],'attributes':_0x16fb8b[_0xc1dd('0x19')],'include':_0x16fb8b[_0xc1dd('0x1c')]?_[_0xc1dd('0x1b')](_0x16fb8b[_0xc1dd('0x1c')],function(_0x1212c3){return{'model':db[_0x1212c3[_0xc1dd('0x1d')]],'as':_0x1212c3['as'],'attributes':_0x1212c3[_0xc1dd('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc1dd('0xa')](function(_0x5b8edc){logger['info'](_0xc1dd('0x1e'),_0x35139a);logger[_0xc1dd('0xd')](_0xc1dd('0x1e'),_0x35139a,JSON[_0xc1dd('0xf')](_0x5b8edc));_0x6198a7(_0x5b8edc);})[_0xc1dd('0x15')](function(_0x39b8ac){logger[_0xc1dd('0x10')]('GetCampaign',_0x39b8ac[_0xc1dd('0x12')],_0x35139a);_0x24446f(_0x4c3114[_0xc1dd('0x10')](0x1f4,_0x39b8ac[_0xc1dd('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 14043c3..f0e54d0 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 _0x8a62=['removeLists','removeBlackLists','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','clone','addBlackLists','put','delete'];(function(_0x2146e9,_0x192469){var _0x5a3151=function(_0x33ca2a){while(--_0x33ca2a){_0x2146e9['push'](_0x2146e9['shift']());}};_0x5a3151(++_0x192469);}(_0x8a62,0x98));var _0x28a6=function(_0x3a53a0,_0x631292){_0x3a53a0=_0x3a53a0-0x0;var _0x276c2f=_0x8a62[_0x3a53a0];return _0x276c2f;};'use strict';var multer=require('multer');var util=require(_0x28a6('0x0'));var path=require(_0x28a6('0x1'));var timeout=require(_0x28a6('0x2'));var express=require('express');var router=express[_0x28a6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x28a6('0x4'));var interaction=require(_0x28a6('0x5'));var config=require(_0x28a6('0x6'));var controller=require(_0x28a6('0x7'));router[_0x28a6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x28a6('0x8')](_0x28a6('0x9'),auth[_0x28a6('0xa')](),controller[_0x28a6('0xb')]);router['get'](_0x28a6('0xc'),auth[_0x28a6('0xa')](),controller[_0x28a6('0xd')]);router[_0x28a6('0x8')](_0x28a6('0xe'),auth[_0x28a6('0xa')](),controller[_0x28a6('0xf')]);router['get'](_0x28a6('0x10'),auth['isAuthenticated'](),controller[_0x28a6('0x11')]);router[_0x28a6('0x8')](_0x28a6('0x12'),auth[_0x28a6('0xa')](),controller[_0x28a6('0x13')]);router[_0x28a6('0x8')](_0x28a6('0x14'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x28a6('0x15'),auth['isAuthenticated'](),controller[_0x28a6('0x16')]);router['post']('/',auth[_0x28a6('0xa')](),controller['create']);router[_0x28a6('0x17')]('/:id/clone',auth[_0x28a6('0xa')](),controller[_0x28a6('0x18')]);router[_0x28a6('0x17')](_0x28a6('0x14'),auth['isAuthenticated'](),controller['addLists']);router[_0x28a6('0x17')]('/:id/blacklists',auth[_0x28a6('0xa')](),controller[_0x28a6('0x19')]);router[_0x28a6('0x1a')](_0x28a6('0x9'),auth[_0x28a6('0xa')](),controller['update']);router[_0x28a6('0x1b')](_0x28a6('0x9'),auth[_0x28a6('0xa')](),controller['destroy']);router[_0x28a6('0x1b')](_0x28a6('0x14'),auth[_0x28a6('0xa')](),controller[_0x28a6('0x1c')]);router[_0x28a6('0x1b')]('/:id/blacklists',auth[_0x28a6('0xa')](),controller[_0x28a6('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0x3de8=['getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','update','delete','removeBlackLists','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists'];(function(_0x152c9d,_0x371656){var _0x462f34=function(_0x5a0f6b){while(--_0x5a0f6b){_0x152c9d['push'](_0x152c9d['shift']());}};_0x462f34(++_0x371656);}(_0x3de8,0xe9));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x83de('0x0'));var util=require(_0x83de('0x1'));var path=require('path');var timeout=require(_0x83de('0x2'));var express=require(_0x83de('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x83de('0x4'));var config=require(_0x83de('0x5'));var controller=require(_0x83de('0x6'));router[_0x83de('0x7')]('/',auth[_0x83de('0x8')](),controller['index']);router[_0x83de('0x7')](_0x83de('0x9'),auth[_0x83de('0x8')](),controller['show']);router['get'](_0x83de('0xa'),auth[_0x83de('0x8')](),controller['getHoppers']);router['get'](_0x83de('0xb'),auth[_0x83de('0x8')](),controller[_0x83de('0xc')]);router[_0x83de('0x7')](_0x83de('0xd'),auth[_0x83de('0x8')](),controller['getHopperFinals']);router[_0x83de('0x7')](_0x83de('0xe'),auth['isAuthenticated'](),controller[_0x83de('0xf')]);router[_0x83de('0x7')](_0x83de('0x10'),auth['isAuthenticated'](),controller[_0x83de('0x11')]);router['get'](_0x83de('0x12'),auth['isAuthenticated'](),controller[_0x83de('0x13')]);router[_0x83de('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x83de('0x14')](_0x83de('0x15'),auth['isAuthenticated'](),controller[_0x83de('0x16')]);router['post']('/:id/lists',auth[_0x83de('0x8')](),controller[_0x83de('0x17')]);router['post'](_0x83de('0x12'),auth['isAuthenticated'](),controller[_0x83de('0x18')]);router['put'](_0x83de('0x9'),auth[_0x83de('0x8')](),controller[_0x83de('0x19')]);router[_0x83de('0x1a')](_0x83de('0x9'),auth[_0x83de('0x8')](),controller['destroy']);router[_0x83de('0x1a')](_0x83de('0x10'),auth[_0x83de('0x8')](),controller['removeLists']);router['delete'](_0x83de('0x12'),auth[_0x83de('0x8')](),controller[_0x83de('0x1b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 3e25afa..de17357 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 _0x2f56=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x303c89,_0x4702e9){var _0x18debe=function(_0x2a31d7){while(--_0x2a31d7){_0x303c89['push'](_0x303c89['shift']());}};_0x18debe(++_0x4702e9);}(_0x2f56,0x159));var _0x62f5=function(_0x5112ce,_0x23a09f){_0x5112ce=_0x5112ce-0x0;var _0x5bcefa=_0x2f56[_0x5112ce];return _0x5bcefa;};'use strict';var Sequelize=require(_0x62f5('0x0'));module[_0x62f5('0x1')]={'key':{'type':Sequelize[_0x62f5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x62f5('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x62f5('0x2')]},'name':{'type':Sequelize[_0x62f5('0x4')],'get':function(){return this[_0x62f5('0x5')](_0x62f5('0x6'));}}};
\ No newline at end of file
+var _0x2424=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2424,0x17d));var _0x4242=function(_0x1ffa19,_0x29347b){_0x1ffa19=_0x1ffa19-0x0;var _0x5d0051=_0x2424[_0x1ffa19];return _0x5d0051;};'use strict';var Sequelize=require(_0x4242('0x0'));module[_0x4242('0x1')]={'key':{'type':Sequelize[_0x4242('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x4242('0x2')]},'name':{'type':Sequelize[_0x4242('0x3')],'get':function(){return this[_0x4242('0x4')](_0x4242('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index ceeedef..51b2c72 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 _0xe990=['reject','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','index','map','CannedAnswer','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','merge','where','findAll','rows','show','rawAttributes','includeAll','include','options','find','update','body','catch','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0xe990,0x1e8));var _0x0e99=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe990[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x0e99('0x0'));var rimraf=require(_0x0e99('0x1'));var zipdir=require(_0x0e99('0x2'));var jsonpatch=require(_0x0e99('0x3'));var rp=require(_0x0e99('0x4'));var moment=require(_0x0e99('0x5'));var BPromise=require(_0x0e99('0x6'));var Mustache=require(_0x0e99('0x7'));var util=require(_0x0e99('0x8'));var path=require(_0x0e99('0x9'));var sox=require('sox');var csv=require(_0x0e99('0xa'));var ejs=require(_0x0e99('0xb'));var fs=require('fs');var fs_extra=require(_0x0e99('0xc'));var _=require('lodash');var squel=require(_0x0e99('0xd'));var crypto=require('crypto');var jsforce=require(_0x0e99('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e99('0xa'));var querystring=require(_0x0e99('0xf'));var Papa=require(_0x0e99('0x10'));var Redis=require('ioredis');var authService=require(_0x0e99('0x11'));var qs=require(_0x0e99('0x12'));var as=require(_0x0e99('0x13'));var hardwareService=require(_0x0e99('0x14'));var logger=require('../../config/logger')(_0x0e99('0x15'));var utils=require(_0x0e99('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0e99('0x17'));var db=require(_0x0e99('0x18'))['db'];function respondWithStatusCode(_0x2a34a6,_0x1da1a0){_0x1da1a0=_0x1da1a0||0xcc;return function(_0x564e80){if(_0x564e80){return _0x2a34a6['sendStatus'](_0x1da1a0);}return _0x2a34a6[_0x0e99('0x19')](_0x1da1a0)[_0x0e99('0x1a')]();};}function respondWithResult(_0x3451cd,_0x37aa55){_0x37aa55=_0x37aa55||0xc8;return function(_0x30d941){if(_0x30d941){return _0x3451cd[_0x0e99('0x19')](_0x37aa55)[_0x0e99('0x1b')](_0x30d941);}};}function respondWithFilteredResult(_0x279afa,_0x4b3e10){return function(_0x300c65){if(_0x300c65){var _0xd27e30=typeof _0x4b3e10[_0x0e99('0x1c')]==='undefined'&&typeof _0x4b3e10['limit']===_0x0e99('0x1d');var _0x3665d6=_0x300c65['count'];var _0x86352f=_0xd27e30?0x0:_0x4b3e10[_0x0e99('0x1c')];var _0x41b27e=_0xd27e30?_0x300c65[_0x0e99('0x1e')]:_0x4b3e10[_0x0e99('0x1c')]+_0x4b3e10[_0x0e99('0x1f')];var _0xf7a144;if(_0x41b27e>=_0x3665d6){_0x41b27e=_0x3665d6;_0xf7a144=0xc8;}else{_0xf7a144=0xce;}_0x279afa[_0x0e99('0x19')](_0xf7a144);return _0x279afa['set'](_0x0e99('0x20'),_0x86352f+'-'+_0x41b27e+'/'+_0x3665d6)[_0x0e99('0x1b')](_0x300c65);}return null;};}function patchUpdates(_0x2e15e8){return function(_0x3c1164){try{jsonpatch[_0x0e99('0x21')](_0x3c1164,_0x2e15e8,!![]);}catch(_0x4ddc1e){return BPromise[_0x0e99('0x22')](_0x4ddc1e);}return _0x3c1164['save']();};}function saveUpdates(_0x3bfb9e,_0x391d24){return function(_0x3beff1){if(_0x3beff1){return _0x3beff1['update'](_0x3bfb9e)[_0x0e99('0x23')](function(_0x5f32cb){return _0x5f32cb;});}return null;};}function removeEntity(_0x3a5d8c,_0x5b876c){return function(_0x54db21){if(_0x54db21){return _0x54db21[_0x0e99('0x24')]()[_0x0e99('0x23')](function(){var _0x37193b=_0x54db21[_0x0e99('0x25')]({'plain':!![]});var _0xbe2b41=_0x0e99('0x26');return db[_0x0e99('0x27')][_0x0e99('0x24')]({'where':{'type':_0xbe2b41,'resourceId':_0x37193b['id']}})[_0x0e99('0x23')](function(){return _0x54db21;});})[_0x0e99('0x23')](function(){_0x3a5d8c[_0x0e99('0x19')](0xcc)[_0x0e99('0x1a')]();});}};}function handleEntityNotFound(_0xe529e5,_0xf8bc75){return function(_0x5901f7){if(!_0x5901f7){_0xe529e5[_0x0e99('0x28')](0x194);}return _0x5901f7;};}function handleError(_0x500786,_0x4b7792){_0x4b7792=_0x4b7792||0x1f4;return function(_0x545a4c){logger['error'](_0x545a4c[_0x0e99('0x29')]);if(_0x545a4c[_0x0e99('0x2a')]){delete _0x545a4c[_0x0e99('0x2a')];}_0x500786[_0x0e99('0x19')](_0x4b7792)['send'](_0x545a4c);};}exports[_0x0e99('0x2b')]=function(_0x1852ac,_0x38ac80){var _0x437280={},_0x143a3e={},_0x64a5ad={'count':0x0,'rows':[]};var _0x1f7fb8=_[_0x0e99('0x2c')](db[_0x0e99('0x2d')]['rawAttributes'],function(_0x151de7){return{'name':_0x151de7[_0x0e99('0x2e')],'type':_0x151de7[_0x0e99('0x2f')]['key']};});_0x143a3e[_0x0e99('0x30')]=_['map'](_0x1f7fb8,'name');_0x143a3e[_0x0e99('0x31')]=_[_0x0e99('0x32')](_0x1852ac[_0x0e99('0x31')]);_0x143a3e[_0x0e99('0x33')]=_[_0x0e99('0x34')](_0x143a3e[_0x0e99('0x30')],_0x143a3e[_0x0e99('0x31')]);_0x437280[_0x0e99('0x35')]=_[_0x0e99('0x34')](_0x143a3e[_0x0e99('0x30')],qs[_0x0e99('0x36')](_0x1852ac[_0x0e99('0x31')][_0x0e99('0x36')]));_0x437280[_0x0e99('0x35')]=_0x437280[_0x0e99('0x35')][_0x0e99('0x37')]?_0x437280['attributes']:_0x143a3e[_0x0e99('0x30')];if(!_0x1852ac[_0x0e99('0x31')]['hasOwnProperty'](_0x0e99('0x38'))){_0x437280[_0x0e99('0x1f')]=qs['limit'](_0x1852ac[_0x0e99('0x31')][_0x0e99('0x1f')]);_0x437280[_0x0e99('0x1c')]=qs['offset'](_0x1852ac['query'][_0x0e99('0x1c')]);}_0x437280['order']=qs[_0x0e99('0x39')](_0x1852ac[_0x0e99('0x31')]['sort']);_0x437280['where']=qs[_0x0e99('0x33')](_['pick'](_0x1852ac['query'],_0x143a3e['filters']),_0x1f7fb8);if(_0x1852ac['query'][_0x0e99('0x3a')]){_0x437280['where']=_[_0x0e99('0x3b')](_0x437280[_0x0e99('0x3c')],{'$or':[{'key':{'$like':'%'+_0x1852ac[_0x0e99('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x1852ac[_0x0e99('0x31')]['filter']+'%'}}]});}_0x437280=_[_0x0e99('0x3b')]({},_0x437280,_0x1852ac['options']);var _0x1dd34e={'where':_0x437280[_0x0e99('0x3c')]};return db[_0x0e99('0x2d')][_0x0e99('0x1e')](_0x1dd34e)[_0x0e99('0x23')](function(_0x447162){_0x64a5ad['count']=_0x447162;if(_0x1852ac[_0x0e99('0x31')]['includeAll']){_0x437280['include']=[{'all':!![]}];}return db[_0x0e99('0x2d')][_0x0e99('0x3d')](_0x437280);})['then'](function(_0x145924){_0x64a5ad[_0x0e99('0x3e')]=_0x145924;return _0x64a5ad;})['then'](respondWithFilteredResult(_0x38ac80,_0x437280))['catch'](handleError(_0x38ac80,null));};exports[_0x0e99('0x3f')]=function(_0x50b892,_0x20a72f){var _0x830200={'raw':!![],'where':{'id':_0x50b892['params']['id']}},_0x247b94={};_0x247b94[_0x0e99('0x30')]=_[_0x0e99('0x32')](db[_0x0e99('0x2d')][_0x0e99('0x40')]);_0x247b94['query']=_[_0x0e99('0x32')](_0x50b892[_0x0e99('0x31')]);_0x247b94[_0x0e99('0x33')]=_[_0x0e99('0x34')](_0x247b94[_0x0e99('0x30')],_0x247b94[_0x0e99('0x31')]);_0x830200['attributes']=_[_0x0e99('0x34')](_0x247b94[_0x0e99('0x30')],qs[_0x0e99('0x36')](_0x50b892[_0x0e99('0x31')]['fields']));_0x830200[_0x0e99('0x35')]=_0x830200['attributes'][_0x0e99('0x37')]?_0x830200['attributes']:_0x247b94[_0x0e99('0x30')];if(_0x50b892[_0x0e99('0x31')][_0x0e99('0x41')]){_0x830200[_0x0e99('0x42')]=[{'all':!![]}];}_0x830200=_[_0x0e99('0x3b')]({},_0x830200,_0x50b892[_0x0e99('0x43')]);return db[_0x0e99('0x2d')][_0x0e99('0x44')](_0x830200)['then'](handleEntityNotFound(_0x20a72f,null))[_0x0e99('0x23')](respondWithResult(_0x20a72f,null))['catch'](handleError(_0x20a72f,null));};exports[_0x0e99('0x45')]=function(_0x398b46,_0x5295eb){if(_0x398b46[_0x0e99('0x46')]['id']){delete _0x398b46['body']['id'];}return db['CannedAnswer'][_0x0e99('0x44')]({'where':{'id':_0x398b46['params']['id']}})['then'](handleEntityNotFound(_0x5295eb,null))[_0x0e99('0x23')](saveUpdates(_0x398b46[_0x0e99('0x46')],null))[_0x0e99('0x23')](respondWithResult(_0x5295eb,null))[_0x0e99('0x47')](handleError(_0x5295eb,null));};exports[_0x0e99('0x24')]=function(_0x469a21,_0x914203){return db[_0x0e99('0x2d')][_0x0e99('0x44')]({'where':{'id':_0x469a21[_0x0e99('0x48')]['id']}})['then'](handleEntityNotFound(_0x914203,null))['then'](removeEntity(_0x914203,null))[_0x0e99('0x47')](handleError(_0x914203,null));};exports['create']=function(_0x3fc7d3,_0x5aaf74){var _0x1596fd={'key':_0x3fc7d3[_0x0e99('0x46')]['key']};if(_0x3fc7d3[_0x0e99('0x46')][_0x0e99('0x49')]){_0x1596fd[_0x0e99('0x49')]=_0x3fc7d3[_0x0e99('0x46')][_0x0e99('0x49')];}else if(_0x3fc7d3[_0x0e99('0x46')]['SmsAccountId']){_0x1596fd[_0x0e99('0x4a')]=_0x3fc7d3['body'][_0x0e99('0x4a')];}else if(_0x3fc7d3['body'][_0x0e99('0x4b')]){_0x1596fd[_0x0e99('0x4b')]=_0x3fc7d3['body'][_0x0e99('0x4b')];}else if(_0x3fc7d3['body'][_0x0e99('0x4c')]){_0x1596fd[_0x0e99('0x4c')]=_0x3fc7d3['body'][_0x0e99('0x4c')];}return db['CannedAnswer']['find']({'where':_0x1596fd})[_0x0e99('0x23')](function(_0x23cf34){if(_0x23cf34){throw new db[(_0x0e99('0x4d'))][(_0x0e99('0x4e'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x0e99('0x2d')][_0x0e99('0x4f')](_0x3fc7d3['body']);})[_0x0e99('0x23')](function(_0x3a2382){var _0x2c819a=_0x3fc7d3[_0x0e99('0x50')][_0x0e99('0x25')]({'plain':!![]});if(!_0x2c819a)throw new Error(_0x0e99('0x51'));if(_0x2c819a[_0x0e99('0x52')]===_0x0e99('0x50')){var _0x4a597d=_0x3a2382[_0x0e99('0x25')]({'plain':!![]});return db[_0x0e99('0x53')][_0x0e99('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x2c819a['userProfileId']},'raw':!![]})[_0x0e99('0x23')](function(_0x18b450){if(_0x18b450&&_0x18b450[_0x0e99('0x54')]===0x0){return db[_0x0e99('0x27')][_0x0e99('0x4f')]({'name':_0x4a597d[_0x0e99('0x2a')],'resourceId':_0x4a597d['id'],'type':_0x18b450[_0x0e99('0x2a')],'sectionId':_0x18b450['id']},{})[_0x0e99('0x23')](function(){return _0x3a2382;});}else{return _0x3a2382;}})[_0x0e99('0x47')](function(_0x2a7f50){logger[_0x0e99('0x55')](_0x0e99('0x56'),_0x2a7f50);throw _0x2a7f50;});}return _0x3a2382;})[_0x0e99('0x23')](respondWithResult(_0x5aaf74,0xc9))[_0x0e99('0x47')](handleError(_0x5aaf74,null));};
\ No newline at end of file
+var _0xd342=['model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','CannedAnswer','includeAll','include','findAll','rows','catch','show','keys','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','rawAttributes','fieldName','type','key'];(function(_0x51c354,_0x11e319){var _0x45e16a=function(_0x1d15aa){while(--_0x1d15aa){_0x51c354['push'](_0x51c354['shift']());}};_0x45e16a(++_0x11e319);}(_0xd342,0x12d));var _0x2d34=function(_0x357c7d,_0x46f4f8){_0x357c7d=_0x357c7d-0x0;var _0x2f2f9a=_0xd342[_0x357c7d];return _0x2f2f9a;};'use strict';var emlformat=require(_0x2d34('0x0'));var rimraf=require(_0x2d34('0x1'));var zipdir=require(_0x2d34('0x2'));var jsonpatch=require(_0x2d34('0x3'));var rp=require(_0x2d34('0x4'));var moment=require(_0x2d34('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2d34('0x6'));var util=require(_0x2d34('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d34('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d34('0x9'));var squel=require(_0x2d34('0xa'));var crypto=require('crypto');var jsforce=require(_0x2d34('0xb'));var deskjs=require(_0x2d34('0xc'));var toCsv=require(_0x2d34('0xd'));var querystring=require(_0x2d34('0xe'));var Papa=require(_0x2d34('0xf'));var Redis=require(_0x2d34('0x10'));var authService=require(_0x2d34('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2d34('0x12'));var hardwareService=require(_0x2d34('0x13'));var logger=require(_0x2d34('0x14'))(_0x2d34('0x15'));var utils=require(_0x2d34('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2d34('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54667e,_0x454d26){_0x454d26=_0x454d26||0xcc;return function(_0xe59808){if(_0xe59808){return _0x54667e[_0x2d34('0x18')](_0x454d26);}return _0x54667e['status'](_0x454d26)[_0x2d34('0x19')]();};}function respondWithResult(_0x5db22b,_0x4793c4){_0x4793c4=_0x4793c4||0xc8;return function(_0x2d4268){if(_0x2d4268){return _0x5db22b[_0x2d34('0x1a')](_0x4793c4)[_0x2d34('0x1b')](_0x2d4268);}};}function respondWithFilteredResult(_0x211611,_0x166518){return function(_0x118815){if(_0x118815){var _0x50c78c=typeof _0x166518[_0x2d34('0x1c')]===_0x2d34('0x1d')&&typeof _0x166518[_0x2d34('0x1e')]==='undefined';var _0x4e54c9=_0x118815[_0x2d34('0x1f')];var _0x5340c6=_0x50c78c?0x0:_0x166518[_0x2d34('0x1c')];var _0x346798=_0x50c78c?_0x118815[_0x2d34('0x1f')]:_0x166518[_0x2d34('0x1c')]+_0x166518[_0x2d34('0x1e')];var _0x280cdb;if(_0x346798>=_0x4e54c9){_0x346798=_0x4e54c9;_0x280cdb=0xc8;}else{_0x280cdb=0xce;}_0x211611[_0x2d34('0x1a')](_0x280cdb);return _0x211611[_0x2d34('0x20')](_0x2d34('0x21'),_0x5340c6+'-'+_0x346798+'/'+_0x4e54c9)['json'](_0x118815);}return null;};}function patchUpdates(_0x5d92ea){return function(_0x1f8802){try{jsonpatch[_0x2d34('0x22')](_0x1f8802,_0x5d92ea,!![]);}catch(_0x4c38ac){return BPromise['reject'](_0x4c38ac);}return _0x1f8802['save']();};}function saveUpdates(_0x7481a0,_0x102075){return function(_0x48d43d){if(_0x48d43d){return _0x48d43d[_0x2d34('0x23')](_0x7481a0)[_0x2d34('0x24')](function(_0x28d726){return _0x28d726;});}return null;};}function removeEntity(_0x5d1138,_0x5d3a00){return function(_0x2162ae){if(_0x2162ae){return _0x2162ae[_0x2d34('0x25')]()[_0x2d34('0x24')](function(){var _0x2dcd08=_0x2162ae[_0x2d34('0x26')]({'plain':!![]});var _0x3a7a97='CannedAnswers';return db[_0x2d34('0x27')]['destroy']({'where':{'type':_0x3a7a97,'resourceId':_0x2dcd08['id']}})[_0x2d34('0x24')](function(){return _0x2162ae;});})[_0x2d34('0x24')](function(){_0x5d1138[_0x2d34('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x84bbcf,_0x104693){return function(_0x28c5b0){if(!_0x28c5b0){_0x84bbcf[_0x2d34('0x18')](0x194);}return _0x28c5b0;};}function handleError(_0x375fe5,_0x8180e3){_0x8180e3=_0x8180e3||0x1f4;return function(_0x297fb1){logger[_0x2d34('0x28')](_0x297fb1[_0x2d34('0x29')]);if(_0x297fb1['name']){delete _0x297fb1[_0x2d34('0x2a')];}_0x375fe5[_0x2d34('0x1a')](_0x8180e3)['send'](_0x297fb1);};}exports['index']=function(_0x5b602b,_0x206605){var _0x361012={},_0x1ccb41={},_0x3b9256={'count':0x0,'rows':[]};var _0x16d789=_['map'](db['CannedAnswer'][_0x2d34('0x2b')],function(_0x28fbc0){return{'name':_0x28fbc0[_0x2d34('0x2c')],'type':_0x28fbc0[_0x2d34('0x2d')][_0x2d34('0x2e')]};});_0x1ccb41[_0x2d34('0x2f')]=_['map'](_0x16d789,_0x2d34('0x2a'));_0x1ccb41['query']=_['keys'](_0x5b602b['query']);_0x1ccb41[_0x2d34('0x30')]=_[_0x2d34('0x31')](_0x1ccb41[_0x2d34('0x2f')],_0x1ccb41[_0x2d34('0x32')]);_0x361012[_0x2d34('0x33')]=_[_0x2d34('0x31')](_0x1ccb41['model'],qs[_0x2d34('0x34')](_0x5b602b['query'][_0x2d34('0x34')]));_0x361012[_0x2d34('0x33')]=_0x361012[_0x2d34('0x33')][_0x2d34('0x35')]?_0x361012['attributes']:_0x1ccb41[_0x2d34('0x2f')];if(!_0x5b602b[_0x2d34('0x32')][_0x2d34('0x36')](_0x2d34('0x37'))){_0x361012['limit']=qs[_0x2d34('0x1e')](_0x5b602b['query'][_0x2d34('0x1e')]);_0x361012['offset']=qs[_0x2d34('0x1c')](_0x5b602b[_0x2d34('0x32')][_0x2d34('0x1c')]);}_0x361012[_0x2d34('0x38')]=qs[_0x2d34('0x39')](_0x5b602b[_0x2d34('0x32')][_0x2d34('0x39')]);_0x361012['where']=qs['filters'](_[_0x2d34('0x3a')](_0x5b602b['query'],_0x1ccb41[_0x2d34('0x30')]),_0x16d789);if(_0x5b602b[_0x2d34('0x32')][_0x2d34('0x3b')]){_0x361012[_0x2d34('0x3c')]=_[_0x2d34('0x3d')](_0x361012[_0x2d34('0x3c')],{'$or':[{'key':{'$like':'%'+_0x5b602b[_0x2d34('0x32')][_0x2d34('0x3b')]+'%'}},{'value':{'$like':'%'+_0x5b602b['query'][_0x2d34('0x3b')]+'%'}}]});}_0x361012=_[_0x2d34('0x3d')]({},_0x361012,_0x5b602b['options']);var _0x3dcd58={'where':_0x361012[_0x2d34('0x3c')]};return db[_0x2d34('0x3e')][_0x2d34('0x1f')](_0x3dcd58)['then'](function(_0x31aae6){_0x3b9256[_0x2d34('0x1f')]=_0x31aae6;if(_0x5b602b[_0x2d34('0x32')][_0x2d34('0x3f')]){_0x361012[_0x2d34('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2d34('0x41')](_0x361012);})[_0x2d34('0x24')](function(_0x8e7435){_0x3b9256[_0x2d34('0x42')]=_0x8e7435;return _0x3b9256;})[_0x2d34('0x24')](respondWithFilteredResult(_0x206605,_0x361012))[_0x2d34('0x43')](handleError(_0x206605,null));};exports[_0x2d34('0x44')]=function(_0x1460dc,_0x5bf3cb){var _0x8a5cc4={'raw':!![],'where':{'id':_0x1460dc['params']['id']}},_0x236cf3={};_0x236cf3[_0x2d34('0x2f')]=_[_0x2d34('0x45')](db[_0x2d34('0x3e')][_0x2d34('0x2b')]);_0x236cf3['query']=_[_0x2d34('0x45')](_0x1460dc['query']);_0x236cf3['filters']=_[_0x2d34('0x31')](_0x236cf3[_0x2d34('0x2f')],_0x236cf3[_0x2d34('0x32')]);_0x8a5cc4[_0x2d34('0x33')]=_[_0x2d34('0x31')](_0x236cf3[_0x2d34('0x2f')],qs['fields'](_0x1460dc[_0x2d34('0x32')][_0x2d34('0x34')]));_0x8a5cc4[_0x2d34('0x33')]=_0x8a5cc4[_0x2d34('0x33')][_0x2d34('0x35')]?_0x8a5cc4[_0x2d34('0x33')]:_0x236cf3[_0x2d34('0x2f')];if(_0x1460dc[_0x2d34('0x32')][_0x2d34('0x3f')]){_0x8a5cc4['include']=[{'all':!![]}];}_0x8a5cc4=_[_0x2d34('0x3d')]({},_0x8a5cc4,_0x1460dc['options']);return db['CannedAnswer'][_0x2d34('0x46')](_0x8a5cc4)[_0x2d34('0x24')](handleEntityNotFound(_0x5bf3cb,null))[_0x2d34('0x24')](respondWithResult(_0x5bf3cb,null))[_0x2d34('0x43')](handleError(_0x5bf3cb,null));};exports[_0x2d34('0x23')]=function(_0x307cde,_0x5e92f6){if(_0x307cde[_0x2d34('0x47')]['id']){delete _0x307cde['body']['id'];}return db[_0x2d34('0x3e')]['find']({'where':{'id':_0x307cde[_0x2d34('0x48')]['id']}})[_0x2d34('0x24')](handleEntityNotFound(_0x5e92f6,null))[_0x2d34('0x24')](saveUpdates(_0x307cde[_0x2d34('0x47')],null))[_0x2d34('0x24')](respondWithResult(_0x5e92f6,null))['catch'](handleError(_0x5e92f6,null));};exports[_0x2d34('0x25')]=function(_0x19e9b0,_0x421cd8){return db['CannedAnswer']['find']({'where':{'id':_0x19e9b0[_0x2d34('0x48')]['id']}})['then'](handleEntityNotFound(_0x421cd8,null))[_0x2d34('0x24')](removeEntity(_0x421cd8,null))['catch'](handleError(_0x421cd8,null));};exports[_0x2d34('0x49')]=function(_0x1a3633,_0x4b23a4){var _0x3d0603={'key':_0x1a3633['body'][_0x2d34('0x2e')]};if(_0x1a3633[_0x2d34('0x47')]['MailAccountId']){_0x3d0603[_0x2d34('0x4a')]=_0x1a3633[_0x2d34('0x47')][_0x2d34('0x4a')];}else if(_0x1a3633[_0x2d34('0x47')]['SmsAccountId']){_0x3d0603['SmsAccountId']=_0x1a3633[_0x2d34('0x47')][_0x2d34('0x4b')];}else if(_0x1a3633[_0x2d34('0x47')][_0x2d34('0x4c')]){_0x3d0603['OpenchannelAccountId']=_0x1a3633[_0x2d34('0x47')][_0x2d34('0x4c')];}else if(_0x1a3633[_0x2d34('0x47')][_0x2d34('0x4d')]){_0x3d0603[_0x2d34('0x4d')]=_0x1a3633[_0x2d34('0x47')][_0x2d34('0x4d')];}return db[_0x2d34('0x3e')]['find']({'where':_0x3d0603})[_0x2d34('0x24')](function(_0x24a06c){if(_0x24a06c){throw new db[(_0x2d34('0x4e'))]['ValidationError'](_0x2d34('0x4f'));}return db[_0x2d34('0x3e')]['create'](_0x1a3633['body']);})['then'](function(_0x33cea2){var _0x23f4c2=_0x1a3633[_0x2d34('0x50')][_0x2d34('0x26')]({'plain':!![]});if(!_0x23f4c2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f4c2[_0x2d34('0x51')]===_0x2d34('0x50')){var _0x12544c=_0x33cea2['get']({'plain':!![]});return db[_0x2d34('0x52')][_0x2d34('0x46')]({'where':{'name':_0x2d34('0x53'),'userProfileId':_0x23f4c2[_0x2d34('0x54')]},'raw':!![]})[_0x2d34('0x24')](function(_0x59b157){if(_0x59b157&&_0x59b157[_0x2d34('0x55')]===0x0){return db[_0x2d34('0x27')][_0x2d34('0x49')]({'name':_0x12544c['name'],'resourceId':_0x12544c['id'],'type':_0x59b157['name'],'sectionId':_0x59b157['id']},{})['then'](function(){return _0x33cea2;});}else{return _0x33cea2;}})[_0x2d34('0x43')](function(_0x2b5e14){logger['error'](_0x2d34('0x56'),_0x2b5e14);throw _0x2b5e14;});}return _0x33cea2;})[_0x2d34('0x24')](respondWithResult(_0x4b23a4,0xc9))[_0x2d34('0x43')](handleError(_0x4b23a4,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 9eee018..5b245c4 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 _0x10ff=['request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','lodash','api','moment'];(function(_0x87cd78,_0x1fa259){var _0x12b1f5=function(_0x3d55bf){while(--_0x3d55bf){_0x87cd78['push'](_0x87cd78['shift']());}};_0x12b1f5(++_0x1fa259);}(_0x10ff,0x1b5));var _0xf10f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x10ff[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf10f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf10f('0x1'));var moment=require(_0xf10f('0x2'));var BPromise=require('bluebird');var rp=require(_0xf10f('0x3'));var fs=require('fs');var path=require(_0xf10f('0x4'));var rimraf=require(_0xf10f('0x5'));var config=require(_0xf10f('0x6'));var attributes=require(_0xf10f('0x7'));module[_0xf10f('0x8')]=function(_0x12186e,_0x38820d){return _0x12186e[_0xf10f('0x9')](_0xf10f('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x12ed=['exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x458586,_0x85fbee){var _0x23c612=function(_0x59cebb){while(--_0x59cebb){_0x458586['push'](_0x458586['shift']());}};_0x23c612(++_0x85fbee);}(_0x12ed,0x1d9));var _0xd12e=function(_0x35ade4,_0x4e3cfa){_0x35ade4=_0x35ade4-0x0;var _0x274e32=_0x12ed[_0x35ade4];return _0x274e32;};'use strict';var _=require(_0xd12e('0x0'));var util=require(_0xd12e('0x1'));var logger=require('../../config/logger')(_0xd12e('0x2'));var moment=require(_0xd12e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd12e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd12e('0x5'));var config=require(_0xd12e('0x6'));var attributes=require(_0xd12e('0x7'));module[_0xd12e('0x8')]=function(_0x474cdb,_0x143019){return _0x474cdb[_0xd12e('0x9')]('CannedAnswer',attributes,{'tableName':_0xd12e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd12e('0xb'),'collate':_0xd12e('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 7590ac9..3c5102f 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(_0x339101,_0x15dd25){var _0x426e7a=function(_0x53596a){while(--_0x53596a){_0x339101['push'](_0x339101['shift']());}};_0x426e7a(++_0x15dd25);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x1b8ed8,_0x4b2629){var _0x2248c9=function(_0x3755f7){while(--_0x3755f7){_0x1b8ed8['push'](_0x1b8ed8['shift']());}};_0x2248c9(++_0x4b2629);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index d3b0653..fdec471 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 _0xaed0=['show','post','create','put','update','destroy','exports','multer','path','Router','../../components/auth/service','./cannedAnswer.controller','isAuthenticated','index','get','/:id'];(function(_0x809bb1,_0x25f72e){var _0x1a762a=function(_0x146da8){while(--_0x146da8){_0x809bb1['push'](_0x809bb1['shift']());}};_0x1a762a(++_0x25f72e);}(_0xaed0,0x1e7));var _0x0aed=function(_0x21278c,_0x3bb264){_0x21278c=_0x21278c-0x0;var _0x19679b=_0xaed0[_0x21278c];return _0x19679b;};'use strict';var multer=require(_0x0aed('0x0'));var util=require('util');var path=require(_0x0aed('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0aed('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0aed('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0aed('0x4'));router['get']('/',auth[_0x0aed('0x5')](),controller[_0x0aed('0x6')]);router[_0x0aed('0x7')](_0x0aed('0x8'),auth[_0x0aed('0x5')](),controller[_0x0aed('0x9')]);router[_0x0aed('0xa')]('/',auth[_0x0aed('0x5')](),controller[_0x0aed('0xb')]);router[_0x0aed('0xc')](_0x0aed('0x8'),auth[_0x0aed('0x5')](),controller[_0x0aed('0xd')]);router['delete'](_0x0aed('0x8'),auth[_0x0aed('0x5')](),controller[_0x0aed('0xe')]);module[_0x0aed('0xf')]=router;
\ No newline at end of file
+var _0x87a8=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','post','create','put','update'];(function(_0x2cf891,_0x54171b){var _0x307493=function(_0x4acd75){while(--_0x4acd75){_0x2cf891['push'](_0x2cf891['shift']());}};_0x307493(++_0x54171b);}(_0x87a8,0x1b8));var _0x887a=function(_0x11239b,_0xdfd2b0){_0x11239b=_0x11239b-0x0;var _0x1d51c4=_0x87a8[_0x11239b];return _0x1d51c4;};'use strict';var multer=require(_0x887a('0x0'));var util=require('util');var path=require(_0x887a('0x1'));var timeout=require(_0x887a('0x2'));var express=require(_0x887a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x887a('0x4'));var interaction=require(_0x887a('0x5'));var config=require(_0x887a('0x6'));var controller=require(_0x887a('0x7'));router[_0x887a('0x8')]('/',auth['isAuthenticated'](),controller[_0x887a('0x9')]);router[_0x887a('0x8')](_0x887a('0xa'),auth[_0x887a('0xb')](),controller['show']);router[_0x887a('0xc')]('/',auth[_0x887a('0xb')](),controller[_0x887a('0xd')]);router[_0x887a('0xe')](_0x887a('0xa'),auth[_0x887a('0xb')](),controller[_0x887a('0xf')]);router[_0x887a('0x10')](_0x887a('0xa'),auth[_0x887a('0xb')](),controller[_0x887a('0x11')]);module[_0x887a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index e13605c..006825a 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 _0xc17f=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x3dad31,_0x56532e){var _0x5e9cb3=function(_0x3cb6c4){while(--_0x3cb6c4){_0x3dad31['push'](_0x3dad31['shift']());}};_0x5e9cb3(++_0x56532e);}(_0xc17f,0xb8));var _0xfc17=function(_0x540cdd,_0x45bd54){_0x540cdd=_0x540cdd-0x0;var _0x2f976e=_0xc17f[_0x540cdd];return _0x2f976e;};'use strict';var Sequelize=require(_0xfc17('0x0'));module[_0xfc17('0x1')]={'calldate':{'type':Sequelize[_0xfc17('0x2')],'allowNull':![],'defaultValue':_0xfc17('0x3')},'clid':{'type':Sequelize[_0xfc17('0x4')]},'src':{'type':Sequelize[_0xfc17('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xfc17('0x4')]},'channel':{'type':Sequelize[_0xfc17('0x4')]},'dstchannel':{'type':Sequelize[_0xfc17('0x4')]},'lastapp':{'type':Sequelize[_0xfc17('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xfc17('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfc17('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfc17('0x4')]},'amaflags':{'type':Sequelize[_0xfc17('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfc17('0x4')]},'userfield':{'type':Sequelize[_0xfc17('0x4')]},'uniqueid':{'type':Sequelize[_0xfc17('0x4')]},'linkedid':{'type':Sequelize[_0xfc17('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xfc17('0x4')]},'type':{'type':Sequelize[_0xfc17('0x4')]},'tag':{'type':Sequelize[_0xfc17('0x4')]}};
\ No newline at end of file
+var _0xde9f=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0xde9f,0x16d));var _0xfde9=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xde9f[_0x52666e];return _0x515330;};'use strict';var Sequelize=require(_0xfde9('0x0'));module[_0xfde9('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xfde9('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xfde9('0x3')]},'dst':{'type':Sequelize[_0xfde9('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfde9('0x3')]},'dstchannel':{'type':Sequelize[_0xfde9('0x3')]},'lastapp':{'type':Sequelize[_0xfde9('0x3')]},'lastdata':{'type':Sequelize[_0xfde9('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xfde9('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfde9('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfde9('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xfde9('0x3')]},'peeraccount':{'type':Sequelize[_0xfde9('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xfde9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index d9d6471..d411e18 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 _0xbacd=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x45236e,_0x137377){var _0x3c528d=function(_0x1bb977){while(--_0x1bb977){_0x45236e['push'](_0x45236e['shift']());}};_0x3c528d(++_0x137377);}(_0xbacd,0x1c5));var _0xdbac=function(_0x33eae5,_0x22b51d){_0x33eae5=_0x33eae5-0x0;var _0x56b25c=_0xbacd[_0x33eae5];return _0x56b25c;};'use strict';var emlformat=require(_0xdbac('0x0'));var rimraf=require(_0xdbac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbac('0x2'));var rp=require(_0xdbac('0x3'));var moment=require(_0xdbac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdbac('0x5'));var util=require(_0xdbac('0x6'));var path=require(_0xdbac('0x7'));var sox=require(_0xdbac('0x8'));var csv=require(_0xdbac('0x9'));var ejs=require(_0xdbac('0xa'));var fs=require('fs');var fs_extra=require(_0xdbac('0xb'));var _=require(_0xdbac('0xc'));var squel=require(_0xdbac('0xd'));var crypto=require(_0xdbac('0xe'));var jsforce=require(_0xdbac('0xf'));var deskjs=require(_0xdbac('0x10'));var toCsv=require(_0xdbac('0x9'));var querystring=require(_0xdbac('0x11'));var Papa=require(_0xdbac('0x12'));var Redis=require('ioredis');var authService=require(_0xdbac('0x13'));var qs=require(_0xdbac('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbac('0x15'));var logger=require('../../config/logger')(_0xdbac('0x16'));var utils=require(_0xdbac('0x17'));var config=require(_0xdbac('0x18'));var licenseUtil=require(_0xdbac('0x19'));var db=require(_0xdbac('0x1a'))['db'];function respondWithStatusCode(_0x1ebee0,_0xd9ec70){_0xd9ec70=_0xd9ec70||0xcc;return function(_0x2c7f44){if(_0x2c7f44){return _0x1ebee0[_0xdbac('0x1b')](_0xd9ec70);}return _0x1ebee0['status'](_0xd9ec70)[_0xdbac('0x1c')]();};}function respondWithResult(_0x1793b9,_0x1eed36){_0x1eed36=_0x1eed36||0xc8;return function(_0x14ebaa){if(_0x14ebaa){return _0x1793b9[_0xdbac('0x1d')](_0x1eed36)[_0xdbac('0x1e')](_0x14ebaa);}};}function respondWithFilteredResult(_0x94a61,_0x176da6){return function(_0x574e58){if(_0x574e58){var _0x2694ef=typeof _0x176da6[_0xdbac('0x1f')]===_0xdbac('0x20')&&typeof _0x176da6['limit']===_0xdbac('0x20');var _0x36e0de=_0x574e58[_0xdbac('0x21')];var _0x252fc1=_0x2694ef?0x0:_0x176da6[_0xdbac('0x1f')];var _0x1a9690=_0x2694ef?_0x574e58[_0xdbac('0x21')]:_0x176da6[_0xdbac('0x1f')]+_0x176da6[_0xdbac('0x22')];var _0x1301d2;if(_0x1a9690>=_0x36e0de){_0x1a9690=_0x36e0de;_0x1301d2=0xc8;}else{_0x1301d2=0xce;}_0x94a61[_0xdbac('0x1d')](_0x1301d2);return _0x94a61[_0xdbac('0x23')]('Content-Range',_0x252fc1+'-'+_0x1a9690+'/'+_0x36e0de)[_0xdbac('0x1e')](_0x574e58);}return null;};}function patchUpdates(_0x323801){return function(_0x4e4af9){try{jsonpatch[_0xdbac('0x24')](_0x4e4af9,_0x323801,!![]);}catch(_0x582c0b){return BPromise[_0xdbac('0x25')](_0x582c0b);}return _0x4e4af9['save']();};}function saveUpdates(_0x1ead7b,_0x2bcf69){return function(_0x20642c){if(_0x20642c){return _0x20642c[_0xdbac('0x26')](_0x1ead7b)[_0xdbac('0x27')](function(_0x4148fc){return _0x4148fc;});}return null;};}function removeEntity(_0x28393a,_0x4e68b0){return function(_0x361930){if(_0x361930){return _0x361930[_0xdbac('0x28')]()[_0xdbac('0x27')](function(){_0x28393a[_0xdbac('0x1d')](0xcc)[_0xdbac('0x1c')]();});}};}function handleEntityNotFound(_0x2b4cda,_0x3a0f3f){return function(_0x15653d){if(!_0x15653d){_0x2b4cda[_0xdbac('0x1b')](0x194);}return _0x15653d;};}function handleError(_0x175ebc,_0x2cb8b4){_0x2cb8b4=_0x2cb8b4||0x1f4;return function(_0x1ea3c3){logger[_0xdbac('0x29')](_0x1ea3c3[_0xdbac('0x2a')]);if(_0x1ea3c3[_0xdbac('0x2b')]){delete _0x1ea3c3[_0xdbac('0x2b')];}_0x175ebc[_0xdbac('0x1d')](_0x2cb8b4)[_0xdbac('0x2c')](_0x1ea3c3);};}exports[_0xdbac('0x2d')]=function(_0xe744cc,_0x1caa18){var _0x4e7ef9={},_0x446a32={},_0x397f3d={'count':0x0,'rows':[]};var _0x43c0a3=_[_0xdbac('0x2e')](db['Cdr']['rawAttributes'],function(_0x10c3c8){return{'name':_0x10c3c8[_0xdbac('0x2f')],'type':_0x10c3c8[_0xdbac('0x30')][_0xdbac('0x31')]};});_0x446a32['model']=_[_0xdbac('0x2e')](_0x43c0a3,_0xdbac('0x2b'));_0x446a32[_0xdbac('0x32')]=_[_0xdbac('0x33')](_0xe744cc[_0xdbac('0x32')]);_0x446a32[_0xdbac('0x34')]=_[_0xdbac('0x35')](_0x446a32[_0xdbac('0x36')],_0x446a32['query']);_0x4e7ef9['attributes']=_[_0xdbac('0x35')](_0x446a32[_0xdbac('0x36')],qs[_0xdbac('0x37')](_0xe744cc[_0xdbac('0x32')]['fields']));_0x4e7ef9['attributes']=_0x4e7ef9[_0xdbac('0x38')][_0xdbac('0x39')]?_0x4e7ef9[_0xdbac('0x38')]:_0x446a32[_0xdbac('0x36')];if(!_0xe744cc[_0xdbac('0x32')][_0xdbac('0x3a')](_0xdbac('0x3b'))){_0x4e7ef9[_0xdbac('0x22')]=qs[_0xdbac('0x22')](_0xe744cc[_0xdbac('0x32')][_0xdbac('0x22')]);_0x4e7ef9[_0xdbac('0x1f')]=qs[_0xdbac('0x1f')](_0xe744cc['query'][_0xdbac('0x1f')]);}_0x4e7ef9['order']=qs[_0xdbac('0x3c')](_0xe744cc[_0xdbac('0x32')][_0xdbac('0x3c')]);_0x4e7ef9[_0xdbac('0x3d')]=qs['filters'](_[_0xdbac('0x3e')](_0xe744cc[_0xdbac('0x32')],_0x446a32['filters']),_0x43c0a3);if(_0xe744cc['query'][_0xdbac('0x3f')]){_0x4e7ef9['where']=_['merge'](_0x4e7ef9[_0xdbac('0x3d')],{'$or':_[_0xdbac('0x2e')](_0x43c0a3,function(_0x6c5ecc){if(_0x6c5ecc['type']!==_0xdbac('0x40')){var _0x35f8b7={};_0x35f8b7[_0x6c5ecc[_0xdbac('0x2b')]]={'$like':'%'+_0xe744cc[_0xdbac('0x32')]['filter']+'%'};return _0x35f8b7;}})});}_0x4e7ef9=_['merge']({},_0x4e7ef9,_0xe744cc[_0xdbac('0x41')]);var _0x124904={'where':_0x4e7ef9[_0xdbac('0x3d')]};return db[_0xdbac('0x42')][_0xdbac('0x21')](_0x124904)['then'](function(_0x1a27a4){_0x397f3d[_0xdbac('0x21')]=_0x1a27a4;if(_0xe744cc['query'][_0xdbac('0x43')]){_0x4e7ef9[_0xdbac('0x44')]=[{'all':!![]}];}return db[_0xdbac('0x42')][_0xdbac('0x45')](_0x4e7ef9);})[_0xdbac('0x27')](function(_0x575b59){_0x397f3d[_0xdbac('0x46')]=_0x575b59;return _0x397f3d;})[_0xdbac('0x27')](respondWithFilteredResult(_0x1caa18,_0x4e7ef9))[_0xdbac('0x47')](handleError(_0x1caa18,null));};exports[_0xdbac('0x48')]=function(_0x726ba4,_0x25344a){var _0x2589e1={'raw':!![],'where':{'id':_0x726ba4[_0xdbac('0x49')]['id']}},_0x3c1894={};_0x3c1894[_0xdbac('0x36')]=_[_0xdbac('0x33')](db[_0xdbac('0x42')]['rawAttributes']);_0x3c1894['query']=_['keys'](_0x726ba4['query']);_0x3c1894[_0xdbac('0x34')]=_[_0xdbac('0x35')](_0x3c1894[_0xdbac('0x36')],_0x3c1894[_0xdbac('0x32')]);_0x2589e1[_0xdbac('0x38')]=_[_0xdbac('0x35')](_0x3c1894[_0xdbac('0x36')],qs[_0xdbac('0x37')](_0x726ba4[_0xdbac('0x32')]['fields']));_0x2589e1['attributes']=_0x2589e1['attributes'][_0xdbac('0x39')]?_0x2589e1[_0xdbac('0x38')]:_0x3c1894['model'];if(_0x726ba4['query']['includeAll']){_0x2589e1[_0xdbac('0x44')]=[{'all':!![]}];}_0x2589e1=_[_0xdbac('0x4a')]({},_0x2589e1,_0x726ba4[_0xdbac('0x41')]);return db['Cdr'][_0xdbac('0x4b')](_0x2589e1)[_0xdbac('0x27')](handleEntityNotFound(_0x25344a,null))[_0xdbac('0x27')](respondWithResult(_0x25344a,null))[_0xdbac('0x47')](handleError(_0x25344a,null));};exports[_0xdbac('0x4c')]=function(_0x5b8aca,_0x35696f){return db[_0xdbac('0x42')][_0xdbac('0x4c')](_0x5b8aca[_0xdbac('0x4d')],{})['then'](respondWithResult(_0x35696f,0xc9))[_0xdbac('0x47')](handleError(_0x35696f,null));};exports[_0xdbac('0x26')]=function(_0x1463ca,_0x5d6e86){if(_0x1463ca[_0xdbac('0x4d')]['id']){delete _0x1463ca[_0xdbac('0x4d')]['id'];}return db[_0xdbac('0x42')][_0xdbac('0x4b')]({'where':{'id':_0x1463ca[_0xdbac('0x49')]['id']}})[_0xdbac('0x27')](handleEntityNotFound(_0x5d6e86,null))['then'](saveUpdates(_0x1463ca[_0xdbac('0x4d')],null))[_0xdbac('0x27')](respondWithResult(_0x5d6e86,null))['catch'](handleError(_0x5d6e86,null));};exports[_0xdbac('0x28')]=function(_0x12b600,_0x26ee2e){return db[_0xdbac('0x42')]['find']({'where':{'id':_0x12b600['params']['id']}})[_0xdbac('0x27')](handleEntityNotFound(_0x26ee2e,null))[_0xdbac('0x27')](removeEntity(_0x26ee2e,null))['catch'](handleError(_0x26ee2e,null));};exports['describe']=function(_0x3f0b35,_0x538747){return db[_0xdbac('0x42')][_0xdbac('0x4e')]()[_0xdbac('0x27')](respondWithResult(_0x538747,null))['catch'](handleError(_0x538747,null));};
\ No newline at end of file
+var _0x9c5a=['order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','Cdr','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x22f9a1,_0x20a035){var _0x6f5014=function(_0x22d325){while(--_0x22d325){_0x22f9a1['push'](_0x22f9a1['shift']());}};_0x6f5014(++_0x20a035);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x56c23f,_0xcb8fad){_0x56c23f=_0x56c23f-0x0;var _0x8fba65=_0x9c5a[_0x56c23f];return _0x8fba65;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)[_0xa9c5('0x18')]();});}};}function handleEntityNotFound(_0x32fc7d,_0x4cbba1){return function(_0x40f08b){if(!_0x40f08b){_0x32fc7d[_0xa9c5('0x17')](0x194);}return _0x40f08b;};}function handleError(_0x51b64a,_0x4e8a7f){_0x4e8a7f=_0x4e8a7f||0x1f4;return function(_0x242771){logger['error'](_0x242771[_0xa9c5('0x25')]);if(_0x242771[_0xa9c5('0x26')]){delete _0x242771['name'];}_0x51b64a[_0xa9c5('0x19')](_0x4e8a7f)[_0xa9c5('0x27')](_0x242771);};}exports['index']=function(_0x413edf,_0x32baf9){var _0x198cdf={},_0x185eb8={},_0x325c65={'count':0x0,'rows':[]};var _0x4f6e70=_[_0xa9c5('0x28')](db['Cdr'][_0xa9c5('0x29')],function(_0x1ef388){return{'name':_0x1ef388[_0xa9c5('0x2a')],'type':_0x1ef388['type'][_0xa9c5('0x2b')]};});_0x185eb8[_0xa9c5('0x2c')]=_['map'](_0x4f6e70,_0xa9c5('0x26'));_0x185eb8[_0xa9c5('0x2d')]=_[_0xa9c5('0x2e')](_0x413edf[_0xa9c5('0x2d')]);_0x185eb8[_0xa9c5('0x2f')]=_[_0xa9c5('0x30')](_0x185eb8[_0xa9c5('0x2c')],_0x185eb8['query']);_0x198cdf[_0xa9c5('0x31')]=_[_0xa9c5('0x30')](_0x185eb8[_0xa9c5('0x2c')],qs[_0xa9c5('0x32')](_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x32')]));_0x198cdf[_0xa9c5('0x31')]=_0x198cdf[_0xa9c5('0x31')]['length']?_0x198cdf['attributes']:_0x185eb8[_0xa9c5('0x2c')];if(!_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x33')](_0xa9c5('0x34'))){_0x198cdf[_0xa9c5('0x1c')]=qs[_0xa9c5('0x1c')](_0x413edf['query']['limit']);_0x198cdf['offset']=qs[_0xa9c5('0x1e')](_0x413edf[_0xa9c5('0x2d')]['offset']);}_0x198cdf[_0xa9c5('0x35')]=qs['sort'](_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x36')]);_0x198cdf[_0xa9c5('0x37')]=qs[_0xa9c5('0x2f')](_['pick'](_0x413edf[_0xa9c5('0x2d')],_0x185eb8[_0xa9c5('0x2f')]),_0x4f6e70);if(_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x38')]){_0x198cdf[_0xa9c5('0x37')]=_[_0xa9c5('0x39')](_0x198cdf[_0xa9c5('0x37')],{'$or':_[_0xa9c5('0x28')](_0x4f6e70,function(_0x573fc0){if(_0x573fc0[_0xa9c5('0x3a')]!==_0xa9c5('0x3b')){var _0x841c18={};_0x841c18[_0x573fc0[_0xa9c5('0x26')]]={'$like':'%'+_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x38')]+'%'};return _0x841c18;}})});}_0x198cdf=_['merge']({},_0x198cdf,_0x413edf[_0xa9c5('0x3c')]);var _0x5b7a0a={'where':_0x198cdf[_0xa9c5('0x37')]};return db['Cdr'][_0xa9c5('0x1d')](_0x5b7a0a)[_0xa9c5('0x24')](function(_0x37fb1b){_0x325c65['count']=_0x37fb1b;if(_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x3d')]){_0x198cdf[_0xa9c5('0x3e')]=[{'all':!![]}];}return db[_0xa9c5('0x3f')]['findAll'](_0x198cdf);})[_0xa9c5('0x24')](function(_0x97803f){_0x325c65[_0xa9c5('0x40')]=_0x97803f;return _0x325c65;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x32baf9,_0x198cdf))[_0xa9c5('0x41')](handleError(_0x32baf9,null));};exports['show']=function(_0x2a1138,_0x566b60){var _0x1de605={'raw':!![],'where':{'id':_0x2a1138[_0xa9c5('0x42')]['id']}},_0x397614={};_0x397614[_0xa9c5('0x2c')]=_[_0xa9c5('0x2e')](db[_0xa9c5('0x3f')][_0xa9c5('0x29')]);_0x397614[_0xa9c5('0x2d')]=_[_0xa9c5('0x2e')](_0x2a1138[_0xa9c5('0x2d')]);_0x397614['filters']=_[_0xa9c5('0x30')](_0x397614[_0xa9c5('0x2c')],_0x397614[_0xa9c5('0x2d')]);_0x1de605[_0xa9c5('0x31')]=_[_0xa9c5('0x30')](_0x397614[_0xa9c5('0x2c')],qs['fields'](_0x2a1138[_0xa9c5('0x2d')][_0xa9c5('0x32')]));_0x1de605['attributes']=_0x1de605['attributes']['length']?_0x1de605['attributes']:_0x397614['model'];if(_0x2a1138[_0xa9c5('0x2d')][_0xa9c5('0x3d')]){_0x1de605[_0xa9c5('0x3e')]=[{'all':!![]}];}_0x1de605=_[_0xa9c5('0x39')]({},_0x1de605,_0x2a1138[_0xa9c5('0x3c')]);return db[_0xa9c5('0x3f')][_0xa9c5('0x43')](_0x1de605)[_0xa9c5('0x24')](handleEntityNotFound(_0x566b60,null))[_0xa9c5('0x24')](respondWithResult(_0x566b60,null))[_0xa9c5('0x41')](handleError(_0x566b60,null));};exports[_0xa9c5('0x44')]=function(_0x2c3dbf,_0x1c2ccf){return db['Cdr'][_0xa9c5('0x44')](_0x2c3dbf['body'],{})[_0xa9c5('0x24')](respondWithResult(_0x1c2ccf,0xc9))[_0xa9c5('0x41')](handleError(_0x1c2ccf,null));};exports['update']=function(_0x5cbd33,_0xf00970){if(_0x5cbd33[_0xa9c5('0x45')]['id']){delete _0x5cbd33[_0xa9c5('0x45')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5cbd33[_0xa9c5('0x42')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0xf00970,null))['then'](saveUpdates(_0x5cbd33[_0xa9c5('0x45')],null))[_0xa9c5('0x24')](respondWithResult(_0xf00970,null))[_0xa9c5('0x41')](handleError(_0xf00970,null));};exports[_0xa9c5('0x46')]=function(_0x34020f,_0xb369da){return db['Cdr']['find']({'where':{'id':_0x34020f['params']['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0xb369da,null))[_0xa9c5('0x24')](removeEntity(_0xb369da,null))[_0xa9c5('0x41')](handleError(_0xb369da,null));};exports[_0xa9c5('0x47')]=function(_0x380266,_0x15d044){return db['Cdr'][_0xa9c5('0x47')]()[_0xa9c5('0x24')](respondWithResult(_0x15d044,null))[_0xa9c5('0x41')](handleError(_0x15d044,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 9260d48..44ae420 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(_0x547877,_0x41d5dc){var _0x291d53=function(_0x3dccc5){while(--_0x3dccc5){_0x547877['push'](_0x547877['shift']());}};_0x291d53(++_0x41d5dc);}(_0x7a54,0x106));var _0x47a5=function(_0x59b1d8,_0x4f1846){_0x59b1d8=_0x59b1d8-0x0;var _0x543b0e=_0x7a54[_0x59b1d8];return _0x543b0e;};'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(_0x3f2e17,_0x356198){var _0x32c01a=function(_0xe75dae){while(--_0xe75dae){_0x3f2e17['push'](_0x3f2e17['shift']());}};_0x32c01a(++_0x356198);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 89e8b5b..bd68590 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 _0xfa59=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message'];(function(_0x3f42dc,_0x3332a4){var _0x4888a3=function(_0x24a5f8){while(--_0x24a5f8){_0x3f42dc['push'](_0x3f42dc['shift']());}};_0x4888a3(++_0x3332a4);}(_0xfa59,0x10b));var _0x9fa5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfa59[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x9fa5('0x0'));var util=require(_0x9fa5('0x1'));var moment=require('moment');var BPromise=require(_0x9fa5('0x2'));var rs=require(_0x9fa5('0x3'));var fs=require('fs');var Redis=require(_0x9fa5('0x4'));var db=require(_0x9fa5('0x5'))['db'];var utils=require(_0x9fa5('0x6'));var logger=require(_0x9fa5('0x7'))(_0x9fa5('0x8'));var config=require(_0x9fa5('0x9'));var jayson=require(_0x9fa5('0xa'));var client=jayson[_0x9fa5('0xb')][_0x9fa5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x218c9f,_0x483d8c,_0x2ee9b4){return new BPromise(function(_0xb36bfc,_0x496a63){return client['request'](_0x218c9f,_0x2ee9b4)[_0x9fa5('0xd')](function(_0x5650c8){logger['info'](_0x9fa5('0xe'),_0x483d8c,'request\x20sent');logger[_0x9fa5('0xf')](_0x9fa5('0x10'),_0x483d8c,_0x9fa5('0x11'),JSON['stringify'](_0x5650c8));if(_0x5650c8['error']){if(_0x5650c8['error'][_0x9fa5('0x12')]===0x1f4){logger[_0x9fa5('0x13')]('Cdr,\x20%s,\x20%s',_0x483d8c,_0x5650c8[_0x9fa5('0x13')][_0x9fa5('0x14')]);return _0x496a63(_0x5650c8[_0x9fa5('0x13')]['message']);}logger[_0x9fa5('0x13')]('Cdr,\x20%s,\x20%s',_0x483d8c,_0x5650c8['error'][_0x9fa5('0x14')]);return _0xb36bfc(_0x5650c8[_0x9fa5('0x13')]['message']);}else{logger[_0x9fa5('0x15')]('Cdr,\x20%s,\x20%s',_0x483d8c,'request\x20sent');_0xb36bfc(_0x5650c8[_0x9fa5('0x16')][_0x9fa5('0x14')]);}})[_0x9fa5('0x17')](function(_0x40ad11){logger['error'](_0x9fa5('0xe'),_0x483d8c,_0x40ad11);_0x496a63(_0x40ad11);});});}
\ No newline at end of file
+var _0x4d67=['http','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','Cdr,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x173f45,_0x3bf2be){var _0x19f610=function(_0x1a7495){while(--_0x1a7495){_0x173f45['push'](_0x173f45['shift']());}};_0x19f610(++_0x3bf2be);}(_0x4d67,0x6e));var _0x74d6=function(_0x185fb1,_0x30ad2f){_0x185fb1=_0x185fb1-0x0;var _0x3ab848=_0x4d67[_0x185fb1];return _0x3ab848;};'use strict';var _=require(_0x74d6('0x0'));var util=require(_0x74d6('0x1'));var moment=require('moment');var BPromise=require(_0x74d6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74d6('0x3'));var db=require(_0x74d6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x74d6('0x5'))(_0x74d6('0x6'));var config=require(_0x74d6('0x7'));var jayson=require(_0x74d6('0x8'));var client=jayson[_0x74d6('0x9')][_0x74d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fed2f,_0x157839,_0x6c5c5e){return new BPromise(function(_0x27dbda,_0x49ea8f){return client['request'](_0x4fed2f,_0x6c5c5e)[_0x74d6('0xb')](function(_0x41005d){logger[_0x74d6('0xc')]('Cdr,\x20%s,\x20%s',_0x157839,_0x74d6('0xd'));logger[_0x74d6('0xe')](_0x74d6('0xf'),_0x157839,_0x74d6('0xd'),JSON['stringify'](_0x41005d));if(_0x41005d[_0x74d6('0x10')]){if(_0x41005d[_0x74d6('0x10')]['code']===0x1f4){logger['error'](_0x74d6('0x11'),_0x157839,_0x41005d[_0x74d6('0x10')]['message']);return _0x49ea8f(_0x41005d[_0x74d6('0x10')][_0x74d6('0x12')]);}logger[_0x74d6('0x10')]('Cdr,\x20%s,\x20%s',_0x157839,_0x41005d[_0x74d6('0x10')]['message']);return _0x27dbda(_0x41005d['error']['message']);}else{logger[_0x74d6('0xc')](_0x74d6('0x11'),_0x157839,'request\x20sent');_0x27dbda(_0x41005d[_0x74d6('0x13')][_0x74d6('0x12')]);}})['catch'](function(_0xbee65a){logger[_0x74d6('0x10')]('Cdr,\x20%s,\x20%s',_0x157839,_0xbee65a);_0x49ea8f(_0xbee65a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e6bf3e7..e93b0f1 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(_0x4e35d2,_0x516864){var _0x384964=function(_0x53012b){while(--_0x53012b){_0x4e35d2['push'](_0x4e35d2['shift']());}};_0x384964(++_0x516864);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index aabd92a..9d9dabf 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 _0x213f=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x5710c9,_0x44780c){var _0x5dd2d5=function(_0x51213d){while(--_0x51213d){_0x5710c9['push'](_0x5710c9['shift']());}};_0x5dd2d5(++_0x44780c);}(_0x213f,0x117));var _0xf213=function(_0xa2f1f7,_0x32b527){_0xa2f1f7=_0xa2f1f7-0x0;var _0x57081f=_0x213f[_0xa2f1f7];return _0x57081f;};'use strict';var Sequelize=require(_0xf213('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf213('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf213('0x2')],'allowNull':![],'defaultValue':_0xf213('0x3')},'appdata':{'type':Sequelize[_0xf213('0x4')]()},'description':{'type':Sequelize[_0xf213('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf213('0x5')}};
\ No newline at end of file
+var _0xfab0=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x5ba68e,_0x12d804){var _0x3c4158=function(_0x5c8c15){while(--_0x5c8c15){_0x5ba68e['push'](_0x5ba68e['shift']());}};_0x3c4158(++_0x12d804);}(_0xfab0,0x96));var _0x0fab=function(_0x2fab67,_0x510e24){_0x2fab67=_0x2fab67-0x0;var _0x3b0237=_0xfab0[_0x2fab67];return _0x3b0237;};'use strict';var Sequelize=require(_0x0fab('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0fab('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0fab('0x2')],'allowNull':![],'defaultValue':_0x0fab('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0fab('0x2')],'defaultValue':_0x0fab('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f9c2b1e..1ff58c2 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 _0x0f88=['model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','show','params'];(function(_0x559947,_0x31384a){var _0x5dd49b=function(_0x314341){while(--_0x314341){_0x559947['push'](_0x559947['shift']());}};_0x5dd49b(++_0x31384a);}(_0x0f88,0x1d9));var _0x80f8=function(_0x354fc7,_0x10bd45){_0x354fc7=_0x354fc7-0x0;var _0x462135=_0x0f88[_0x354fc7];return _0x462135;};'use strict';var emlformat=require(_0x80f8('0x0'));var rimraf=require(_0x80f8('0x1'));var zipdir=require(_0x80f8('0x2'));var jsonpatch=require(_0x80f8('0x3'));var rp=require(_0x80f8('0x4'));var moment=require(_0x80f8('0x5'));var BPromise=require(_0x80f8('0x6'));var Mustache=require(_0x80f8('0x7'));var util=require('util');var path=require(_0x80f8('0x8'));var sox=require('sox');var csv=require(_0x80f8('0x9'));var ejs=require(_0x80f8('0xa'));var fs=require('fs');var fs_extra=require(_0x80f8('0xb'));var _=require(_0x80f8('0xc'));var squel=require(_0x80f8('0xd'));var crypto=require(_0x80f8('0xe'));var jsforce=require(_0x80f8('0xf'));var deskjs=require(_0x80f8('0x10'));var toCsv=require(_0x80f8('0x9'));var querystring=require(_0x80f8('0x11'));var Papa=require(_0x80f8('0x12'));var Redis=require(_0x80f8('0x13'));var authService=require(_0x80f8('0x14'));var qs=require(_0x80f8('0x15'));var as=require(_0x80f8('0x16'));var hardwareService=require(_0x80f8('0x17'));var logger=require(_0x80f8('0x18'))(_0x80f8('0x19'));var utils=require(_0x80f8('0x1a'));var config=require(_0x80f8('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x80f8('0x1c'))['db'];function respondWithStatusCode(_0x3fbc80,_0x35538b){_0x35538b=_0x35538b||0xcc;return function(_0x5e6020){if(_0x5e6020){return _0x3fbc80[_0x80f8('0x1d')](_0x35538b);}return _0x3fbc80[_0x80f8('0x1e')](_0x35538b)[_0x80f8('0x1f')]();};}function respondWithResult(_0x495b10,_0x4887d3){_0x4887d3=_0x4887d3||0xc8;return function(_0x4f8755){if(_0x4f8755){return _0x495b10['status'](_0x4887d3)[_0x80f8('0x20')](_0x4f8755);}};}function respondWithFilteredResult(_0x574fc1,_0x2c9b94){return function(_0x25c36b){if(_0x25c36b){var _0x381355=typeof _0x2c9b94[_0x80f8('0x21')]===_0x80f8('0x22')&&typeof _0x2c9b94[_0x80f8('0x23')]===_0x80f8('0x22');var _0x16ae36=_0x25c36b[_0x80f8('0x24')];var _0xeff401=_0x381355?0x0:_0x2c9b94['offset'];var _0x450b77=_0x381355?_0x25c36b[_0x80f8('0x24')]:_0x2c9b94[_0x80f8('0x21')]+_0x2c9b94[_0x80f8('0x23')];var _0xa88a03;if(_0x450b77>=_0x16ae36){_0x450b77=_0x16ae36;_0xa88a03=0xc8;}else{_0xa88a03=0xce;}_0x574fc1['status'](_0xa88a03);return _0x574fc1[_0x80f8('0x25')](_0x80f8('0x26'),_0xeff401+'-'+_0x450b77+'/'+_0x16ae36)['json'](_0x25c36b);}return null;};}function patchUpdates(_0xbaea36){return function(_0x3d23b5){try{jsonpatch['apply'](_0x3d23b5,_0xbaea36,!![]);}catch(_0x431b10){return BPromise[_0x80f8('0x27')](_0x431b10);}return _0x3d23b5[_0x80f8('0x28')]();};}function saveUpdates(_0x2a693d,_0x214dc7){return function(_0x1a4988){if(_0x1a4988){return _0x1a4988[_0x80f8('0x29')](_0x2a693d)[_0x80f8('0x2a')](function(_0x5b823a){return _0x5b823a;});}return null;};}function removeEntity(_0x26c62a,_0x530350){return function(_0x192ae5){if(_0x192ae5){return _0x192ae5['destroy']()[_0x80f8('0x2a')](function(){_0x26c62a['status'](0xcc)[_0x80f8('0x1f')]();});}};}function handleEntityNotFound(_0x34c126,_0x5e3f76){return function(_0x57fad1){if(!_0x57fad1){_0x34c126['sendStatus'](0x194);}return _0x57fad1;};}function handleError(_0x40d26a,_0x3032bb){_0x3032bb=_0x3032bb||0x1f4;return function(_0x4ae1a6){logger[_0x80f8('0x2b')](_0x4ae1a6['stack']);if(_0x4ae1a6[_0x80f8('0x2c')]){delete _0x4ae1a6['name'];}_0x40d26a[_0x80f8('0x1e')](_0x3032bb)['send'](_0x4ae1a6);};}exports[_0x80f8('0x2d')]=function(_0x1b92a9,_0x109ea3){var _0x46d379={'raw':!![],'where':{'id':_0x1b92a9[_0x80f8('0x2e')]['id']}},_0x42e871={};_0x42e871[_0x80f8('0x2f')]=_[_0x80f8('0x30')](db[_0x80f8('0x31')][_0x80f8('0x32')]);_0x42e871['query']=_['keys'](_0x1b92a9[_0x80f8('0x33')]);_0x42e871[_0x80f8('0x34')]=_[_0x80f8('0x35')](_0x42e871[_0x80f8('0x2f')],_0x42e871['query']);_0x46d379[_0x80f8('0x36')]=_[_0x80f8('0x35')](_0x42e871['model'],qs[_0x80f8('0x37')](_0x1b92a9['query'][_0x80f8('0x37')]));_0x46d379['attributes']=_0x46d379[_0x80f8('0x36')][_0x80f8('0x38')]?_0x46d379['attributes']:_0x42e871['model'];if(_0x1b92a9[_0x80f8('0x33')][_0x80f8('0x39')]){_0x46d379[_0x80f8('0x3a')]=[{'all':!![]}];}_0x46d379=_[_0x80f8('0x3b')]({},_0x46d379,_0x1b92a9[_0x80f8('0x3c')]);return db[_0x80f8('0x31')][_0x80f8('0x3d')](_0x46d379)['then'](handleEntityNotFound(_0x109ea3,null))[_0x80f8('0x2a')](respondWithResult(_0x109ea3,null))[_0x80f8('0x3e')](handleError(_0x109ea3,null));};exports[_0x80f8('0x29')]=function(_0x3c6d37,_0x5cec47){if(_0x3c6d37[_0x80f8('0x3f')]['id']){delete _0x3c6d37[_0x80f8('0x3f')]['id'];}return db[_0x80f8('0x31')][_0x80f8('0x3d')]({'where':{'id':_0x3c6d37['params']['id']}})[_0x80f8('0x2a')](handleEntityNotFound(_0x5cec47,null))['then'](saveUpdates(_0x3c6d37['body'],null))[_0x80f8('0x2a')](respondWithResult(_0x5cec47,null))[_0x80f8('0x3e')](handleError(_0x5cec47,null));};exports[_0x80f8('0x40')]=function(_0x3d92a9,_0x52eba0){return db[_0x80f8('0x31')][_0x80f8('0x3d')]({'where':{'id':_0x3d92a9[_0x80f8('0x2e')]['id']}})[_0x80f8('0x2a')](handleEntityNotFound(_0x52eba0,null))[_0x80f8('0x2a')](removeEntity(_0x52eba0,null))[_0x80f8('0x3e')](handleError(_0x52eba0,null));};
\ No newline at end of file
+var _0x3276=['filters','intersection','attributes','length','includeAll','include','merge','options','find','ChatApplication','params','body','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','keys','rawAttributes','query'];(function(_0x572219,_0x184991){var _0x321bc3=function(_0x1dfffb){while(--_0x1dfffb){_0x572219['push'](_0x572219['shift']());}};_0x321bc3(++_0x184991);}(_0x3276,0xc7));var _0x6327=function(_0x3eebe0,_0x2bca68){_0x3eebe0=_0x3eebe0-0x0;var _0x39da4a=_0x3276[_0x3eebe0];return _0x39da4a;};'use strict';var emlformat=require(_0x6327('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6327('0x1'));var rp=require(_0x6327('0x2'));var moment=require(_0x6327('0x3'));var BPromise=require(_0x6327('0x4'));var Mustache=require(_0x6327('0x5'));var util=require(_0x6327('0x6'));var path=require(_0x6327('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6327('0x8'));var fs=require('fs');var fs_extra=require(_0x6327('0x9'));var _=require(_0x6327('0xa'));var squel=require('squel');var crypto=require(_0x6327('0xb'));var jsforce=require(_0x6327('0xc'));var deskjs=require(_0x6327('0xd'));var toCsv=require(_0x6327('0xe'));var querystring=require('querystring');var Papa=require(_0x6327('0xf'));var Redis=require(_0x6327('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6327('0x11'));var as=require(_0x6327('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6327('0x13'))(_0x6327('0x14'));var utils=require(_0x6327('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6327('0x16'));var db=require(_0x6327('0x17'))['db'];function respondWithStatusCode(_0xb6de72,_0x32408c){_0x32408c=_0x32408c||0xcc;return function(_0x3ff61b){if(_0x3ff61b){return _0xb6de72[_0x6327('0x18')](_0x32408c);}return _0xb6de72[_0x6327('0x19')](_0x32408c)[_0x6327('0x1a')]();};}function respondWithResult(_0x576b1c,_0x306095){_0x306095=_0x306095||0xc8;return function(_0x48eb75){if(_0x48eb75){return _0x576b1c[_0x6327('0x19')](_0x306095)['json'](_0x48eb75);}};}function respondWithFilteredResult(_0x441ff9,_0x1e850c){return function(_0x43186f){if(_0x43186f){var _0x4e9741=typeof _0x1e850c[_0x6327('0x1b')]===_0x6327('0x1c')&&typeof _0x1e850c[_0x6327('0x1d')]===_0x6327('0x1c');var _0x3ea016=_0x43186f[_0x6327('0x1e')];var _0x341a51=_0x4e9741?0x0:_0x1e850c[_0x6327('0x1b')];var _0x287899=_0x4e9741?_0x43186f[_0x6327('0x1e')]:_0x1e850c[_0x6327('0x1b')]+_0x1e850c[_0x6327('0x1d')];var _0x55cf65;if(_0x287899>=_0x3ea016){_0x287899=_0x3ea016;_0x55cf65=0xc8;}else{_0x55cf65=0xce;}_0x441ff9[_0x6327('0x19')](_0x55cf65);return _0x441ff9[_0x6327('0x1f')](_0x6327('0x20'),_0x341a51+'-'+_0x287899+'/'+_0x3ea016)[_0x6327('0x21')](_0x43186f);}return null;};}function patchUpdates(_0x4cbc80){return function(_0x56249b){try{jsonpatch[_0x6327('0x22')](_0x56249b,_0x4cbc80,!![]);}catch(_0x700766){return BPromise[_0x6327('0x23')](_0x700766);}return _0x56249b[_0x6327('0x24')]();};}function saveUpdates(_0x3078c5,_0x76c718){return function(_0x5754e1){if(_0x5754e1){return _0x5754e1[_0x6327('0x25')](_0x3078c5)[_0x6327('0x26')](function(_0x2f153c){return _0x2f153c;});}return null;};}function removeEntity(_0x1c3d7f,_0x302b3f){return function(_0x254c2f){if(_0x254c2f){return _0x254c2f[_0x6327('0x27')]()[_0x6327('0x26')](function(){_0x1c3d7f[_0x6327('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51dbe9,_0xc155b){return function(_0x499321){if(!_0x499321){_0x51dbe9[_0x6327('0x18')](0x194);}return _0x499321;};}function handleError(_0x5ada97,_0x3c3711){_0x3c3711=_0x3c3711||0x1f4;return function(_0x559dbb){logger[_0x6327('0x28')](_0x559dbb[_0x6327('0x29')]);if(_0x559dbb['name']){delete _0x559dbb[_0x6327('0x2a')];}_0x5ada97[_0x6327('0x19')](_0x3c3711)[_0x6327('0x2b')](_0x559dbb);};}exports[_0x6327('0x2c')]=function(_0x894157,_0x29f43e){var _0x42b225={'raw':!![],'where':{'id':_0x894157['params']['id']}},_0x2c4ca5={};_0x2c4ca5[_0x6327('0x2d')]=_[_0x6327('0x2e')](db['ChatApplication'][_0x6327('0x2f')]);_0x2c4ca5[_0x6327('0x30')]=_['keys'](_0x894157[_0x6327('0x30')]);_0x2c4ca5[_0x6327('0x31')]=_[_0x6327('0x32')](_0x2c4ca5['model'],_0x2c4ca5[_0x6327('0x30')]);_0x42b225[_0x6327('0x33')]=_[_0x6327('0x32')](_0x2c4ca5[_0x6327('0x2d')],qs['fields'](_0x894157[_0x6327('0x30')]['fields']));_0x42b225['attributes']=_0x42b225[_0x6327('0x33')][_0x6327('0x34')]?_0x42b225[_0x6327('0x33')]:_0x2c4ca5[_0x6327('0x2d')];if(_0x894157['query'][_0x6327('0x35')]){_0x42b225[_0x6327('0x36')]=[{'all':!![]}];}_0x42b225=_[_0x6327('0x37')]({},_0x42b225,_0x894157[_0x6327('0x38')]);return db['ChatApplication'][_0x6327('0x39')](_0x42b225)[_0x6327('0x26')](handleEntityNotFound(_0x29f43e,null))[_0x6327('0x26')](respondWithResult(_0x29f43e,null))['catch'](handleError(_0x29f43e,null));};exports[_0x6327('0x25')]=function(_0x3f21f9,_0x456090){if(_0x3f21f9['body']['id']){delete _0x3f21f9['body']['id'];}return db[_0x6327('0x3a')]['find']({'where':{'id':_0x3f21f9[_0x6327('0x3b')]['id']}})['then'](handleEntityNotFound(_0x456090,null))[_0x6327('0x26')](saveUpdates(_0x3f21f9[_0x6327('0x3c')],null))[_0x6327('0x26')](respondWithResult(_0x456090,null))[_0x6327('0x3d')](handleError(_0x456090,null));};exports[_0x6327('0x27')]=function(_0x2b1982,_0x544e6b){return db[_0x6327('0x3a')][_0x6327('0x39')]({'where':{'id':_0x2b1982[_0x6327('0x3b')]['id']}})[_0x6327('0x26')](handleEntityNotFound(_0x544e6b,null))['then'](removeEntity(_0x544e6b,null))['catch'](handleError(_0x544e6b,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 986ea02..f47afea 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 _0x1748=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatApplication','utf8mb4'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x1748,0x146));var _0x8174=function(_0x3798a1,_0x1d57d1){_0x3798a1=_0x3798a1-0x0;var _0x2e6636=_0x1748[_0x3798a1];return _0x2e6636;};'use strict';var _=require(_0x8174('0x0'));var util=require(_0x8174('0x1'));var logger=require(_0x8174('0x2'))('api');var moment=require(_0x8174('0x3'));var BPromise=require(_0x8174('0x4'));var rp=require(_0x8174('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8174('0x6'));var config=require(_0x8174('0x7'));var attributes=require('./chatApplication.attributes');module[_0x8174('0x8')]=function(_0x4f0763,_0xa513b2){return _0x4f0763[_0x8174('0x9')](_0x8174('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8174('0xb'),'collate':_0x8174('0xc')});};
\ No newline at end of file
+var _0x1427=['exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','../../config/environment','./chatApplication.attributes'];(function(_0xc826d9,_0x27e433){var _0x5dcb0c=function(_0x5d95b3){while(--_0x5d95b3){_0xc826d9['push'](_0xc826d9['shift']());}};_0x5dcb0c(++_0x27e433);}(_0x1427,0x7b));var _0x7142=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1427[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7142('0x0'));var logger=require(_0x7142('0x1'))(_0x7142('0x2'));var moment=require(_0x7142('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7142('0x4'));var rimraf=require('rimraf');var config=require(_0x7142('0x5'));var attributes=require(_0x7142('0x6'));module[_0x7142('0x7')]=function(_0x3a225d,_0x28a8cd){return _0x3a225d[_0x7142('0x8')](_0x7142('0x9'),attributes,{'tableName':_0x7142('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7142('0xb'),'collate':_0x7142('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0b89db2..94ffbbc 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 _0x2365=['ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5852ca,_0x4b3f30){var _0x311057=function(_0x99a1d8){while(--_0x99a1d8){_0x5852ca['push'](_0x5852ca['shift']());}};_0x311057(++_0x4b3f30);}(_0x2365,0x126));var _0x5236=function(_0x55d434,_0x10c9dc){_0x55d434=_0x55d434-0x0;var _0xb57f84=_0x2365[_0x55d434];return _0xb57f84;};'use strict';var _=require(_0x5236('0x0'));var util=require(_0x5236('0x1'));var moment=require(_0x5236('0x2'));var BPromise=require(_0x5236('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5236('0x4'));var db=require(_0x5236('0x5'))['db'];var utils=require(_0x5236('0x6'));var logger=require('../../config/logger')(_0x5236('0x7'));var config=require(_0x5236('0x8'));var jayson=require(_0x5236('0x9'));var client=jayson[_0x5236('0xa')][_0x5236('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5aa2c3,_0x2898f4,_0x269c73){return new BPromise(function(_0x437189,_0x2b753e){return client[_0x5236('0xc')](_0x5aa2c3,_0x269c73)[_0x5236('0xd')](function(_0x1e189e){logger[_0x5236('0xe')](_0x5236('0xf'),_0x2898f4,_0x5236('0x10'));logger[_0x5236('0x11')](_0x5236('0x12'),_0x2898f4,_0x5236('0x10'),JSON['stringify'](_0x1e189e));if(_0x1e189e[_0x5236('0x13')]){if(_0x1e189e[_0x5236('0x13')][_0x5236('0x14')]===0x1f4){logger[_0x5236('0x13')](_0x5236('0xf'),_0x2898f4,_0x1e189e[_0x5236('0x13')][_0x5236('0x15')]);return _0x2b753e(_0x1e189e[_0x5236('0x13')]['message']);}logger[_0x5236('0x13')](_0x5236('0xf'),_0x2898f4,_0x1e189e['error']['message']);return _0x437189(_0x1e189e[_0x5236('0x13')]['message']);}else{logger[_0x5236('0xe')](_0x5236('0xf'),_0x2898f4,'request\x20sent');_0x437189(_0x1e189e[_0x5236('0x16')][_0x5236('0x15')]);}})[_0x5236('0x17')](function(_0x14e19c){logger[_0x5236('0x13')](_0x5236('0xf'),_0x2898f4,_0x14e19c);_0x2b753e(_0x14e19c);});});}
\ No newline at end of file
+var _0xb103=['info','request\x20sent','debug','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x47e2a2,_0xdc9935){var _0x2f3352=function(_0x3480ae){while(--_0x3480ae){_0x47e2a2['push'](_0x47e2a2['shift']());}};_0x2f3352(++_0xdc9935);}(_0xb103,0x82));var _0x3b10=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0xb103[_0x967959];return _0x5c4489;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3b10('0x0'));var BPromise=require(_0x3b10('0x1'));var rs=require(_0x3b10('0x2'));var fs=require('fs');var Redis=require(_0x3b10('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b10('0x4'));var logger=require('../../config/logger')(_0x3b10('0x5'));var config=require(_0x3b10('0x6'));var jayson=require(_0x3b10('0x7'));var client=jayson['client'][_0x3b10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4380c0,_0x13c400,_0x304c5c){return new BPromise(function(_0x135051,_0x3fc6c8){return client[_0x3b10('0x9')](_0x4380c0,_0x304c5c)['then'](function(_0x555cc1){logger[_0x3b10('0xa')]('ChatApplication,\x20%s,\x20%s',_0x13c400,_0x3b10('0xb'));logger[_0x3b10('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x13c400,'request\x20sent',JSON[_0x3b10('0xd')](_0x555cc1));if(_0x555cc1['error']){if(_0x555cc1[_0x3b10('0xe')][_0x3b10('0xf')]===0x1f4){logger[_0x3b10('0xe')]('ChatApplication,\x20%s,\x20%s',_0x13c400,_0x555cc1['error'][_0x3b10('0x10')]);return _0x3fc6c8(_0x555cc1[_0x3b10('0xe')][_0x3b10('0x10')]);}logger['error'](_0x3b10('0x11'),_0x13c400,_0x555cc1[_0x3b10('0xe')]['message']);return _0x135051(_0x555cc1[_0x3b10('0xe')][_0x3b10('0x10')]);}else{logger[_0x3b10('0xa')]('ChatApplication,\x20%s,\x20%s',_0x13c400,_0x3b10('0xb'));_0x135051(_0x555cc1[_0x3b10('0x12')][_0x3b10('0x10')]);}})[_0x3b10('0x13')](function(_0x959c02){logger[_0x3b10('0xe')](_0x3b10('0x11'),_0x13c400,_0x959c02);_0x3fc6c8(_0x959c02);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3ad1460..7bd48e5 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 _0x11b1=['delete','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','show','put'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x11b1,0xfa));var _0x111b=function(_0xc2f2ab,_0x292fab){_0xc2f2ab=_0xc2f2ab-0x0;var _0xd5b3ec=_0x11b1[_0xc2f2ab];return _0xd5b3ec;};'use strict';var multer=require(_0x111b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x111b('0x1'));var router=express[_0x111b('0x2')]();var fs_extra=require(_0x111b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x111b('0x4'));var config=require('../../config/environment');var controller=require(_0x111b('0x5'));router['get'](_0x111b('0x6'),auth[_0x111b('0x7')](),controller[_0x111b('0x8')]);router[_0x111b('0x9')](_0x111b('0x6'),auth[_0x111b('0x7')](),controller['update']);router[_0x111b('0xa')](_0x111b('0x6'),auth[_0x111b('0x7')](),controller[_0x111b('0xb')]);module[_0x111b('0xc')]=router;
\ No newline at end of file
+var _0xaf98=['../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0xaf98,0x145));var _0x8af9=function(_0x3ab7e0,_0x3e8f88){_0x3ab7e0=_0x3ab7e0-0x0;var _0x47a5ba=_0xaf98[_0x3ab7e0];return _0x47a5ba;};'use strict';var multer=require('multer');var util=require(_0x8af9('0x0'));var path=require(_0x8af9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8af9('0x2')]();var fs_extra=require(_0x8af9('0x3'));var auth=require(_0x8af9('0x4'));var interaction=require(_0x8af9('0x5'));var config=require(_0x8af9('0x6'));var controller=require(_0x8af9('0x7'));router['get'](_0x8af9('0x8'),auth[_0x8af9('0x9')](),controller[_0x8af9('0xa')]);router[_0x8af9('0xb')](_0x8af9('0x8'),auth['isAuthenticated'](),controller[_0x8af9('0xc')]);router[_0x8af9('0xd')]('/:id',auth[_0x8af9('0x9')](),controller[_0x8af9('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index f056526..7c36692 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 _0xfd1b=['BOOLEAN','STRING'];(function(_0xd840,_0x14119c){var _0x1d19e4=function(_0x5e0cd4){while(--_0x5e0cd4){_0xd840['push'](_0xd840['shift']());}};_0x1d19e4(++_0x14119c);}(_0xfd1b,0x1b1));var _0xbfd1=function(_0x423fff,_0x428afb){_0x423fff=_0x423fff-0x0;var _0x48d8a9=_0xfd1b[_0x423fff];return _0x48d8a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbfd1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xbfd1('0x0')]},'write':{'type':Sequelize[_0xbfd1('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x46e4=['STRING','BOOLEAN','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x46e4,0xdd));var _0x446e=function(_0x20b328,_0x11174d){_0x20b328=_0x20b328-0x0;var _0x3d0297=_0x46e4[_0x20b328];return _0x3d0297;};'use strict';var Sequelize=require(_0x446e('0x0'));module['exports']={'name':{'type':Sequelize[_0x446e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x446e('0x1')]},'write':{'type':Sequelize[_0x446e('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 1011f4b..7d25158 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 _0x41f9=['redis','defaults','localhost','./chatGroup.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','ChatGroup','includeAll','include','findAll','params','merge','find','catch','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','findOne','User','options','getMembers','removeMembers','addMessage','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x634811,_0xc4455c){var _0x31aa5b=function(_0xec9150){while(--_0xec9150){_0x634811['push'](_0x634811['shift']());}};_0x31aa5b(++_0xc4455c);}(_0x41f9,0xa9));var _0x941f=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x41f9[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0x941f('0x0'));var rimraf=require(_0x941f('0x1'));var zipdir=require(_0x941f('0x2'));var jsonpatch=require(_0x941f('0x3'));var rp=require(_0x941f('0x4'));var moment=require(_0x941f('0x5'));var BPromise=require(_0x941f('0x6'));var Mustache=require('mustache');var util=require(_0x941f('0x7'));var path=require('path');var sox=require(_0x941f('0x8'));var csv=require('to-csv');var ejs=require(_0x941f('0x9'));var fs=require('fs');var fs_extra=require(_0x941f('0xa'));var _=require(_0x941f('0xb'));var squel=require(_0x941f('0xc'));var crypto=require('crypto');var jsforce=require(_0x941f('0xd'));var deskjs=require(_0x941f('0xe'));var toCsv=require(_0x941f('0xf'));var querystring=require(_0x941f('0x10'));var Papa=require(_0x941f('0x11'));var Redis=require(_0x941f('0x12'));var authService=require(_0x941f('0x13'));var qs=require(_0x941f('0x14'));var as=require(_0x941f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x941f('0x16'))(_0x941f('0x17'));var utils=require(_0x941f('0x18'));var config=require(_0x941f('0x19'));var licenseUtil=require(_0x941f('0x1a'));var db=require('../../mysqldb')['db'];config[_0x941f('0x1b')]=_[_0x941f('0x1c')](config[_0x941f('0x1b')],{'host':_0x941f('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x941f('0x1b')]));require(_0x941f('0x1e'))['register'](socket);function respondWithStatusCode(_0x46be05,_0x10bdcd){_0x10bdcd=_0x10bdcd||0xcc;return function(_0x3ea8f2){if(_0x3ea8f2){return _0x46be05[_0x941f('0x1f')](_0x10bdcd);}return _0x46be05[_0x941f('0x20')](_0x10bdcd)['end']();};}function respondWithResult(_0x3e3fea,_0x18bd5a){_0x18bd5a=_0x18bd5a||0xc8;return function(_0x18ac38){if(_0x18ac38){return _0x3e3fea[_0x941f('0x20')](_0x18bd5a)[_0x941f('0x21')](_0x18ac38);}};}function respondWithFilteredResult(_0x296ddb,_0x2ebedf){return function(_0x1f4845){if(_0x1f4845){var _0x327935=typeof _0x2ebedf[_0x941f('0x22')]===_0x941f('0x23')&&typeof _0x2ebedf[_0x941f('0x24')]===_0x941f('0x23');var _0x48980b=_0x1f4845[_0x941f('0x25')];var _0x4580dc=_0x327935?0x0:_0x2ebedf[_0x941f('0x22')];var _0x45c459=_0x327935?_0x1f4845[_0x941f('0x25')]:_0x2ebedf['offset']+_0x2ebedf[_0x941f('0x24')];var _0xf8daab;if(_0x45c459>=_0x48980b){_0x45c459=_0x48980b;_0xf8daab=0xc8;}else{_0xf8daab=0xce;}_0x296ddb[_0x941f('0x20')](_0xf8daab);return _0x296ddb[_0x941f('0x26')](_0x941f('0x27'),_0x4580dc+'-'+_0x45c459+'/'+_0x48980b)[_0x941f('0x21')](_0x1f4845);}return null;};}function patchUpdates(_0x2c0542){return function(_0x2ad230){try{jsonpatch[_0x941f('0x28')](_0x2ad230,_0x2c0542,!![]);}catch(_0xc227ae){return BPromise[_0x941f('0x29')](_0xc227ae);}return _0x2ad230[_0x941f('0x2a')]();};}function saveUpdates(_0x311b23,_0x4b0da3){return function(_0x21dea5){if(_0x21dea5){return _0x21dea5[_0x941f('0x2b')](_0x311b23)[_0x941f('0x2c')](function(_0x3e035b){return _0x3e035b;});}return null;};}function removeEntity(_0x27b927,_0x711f64){return function(_0x44f326){if(_0x44f326){return _0x44f326[_0x941f('0x2d')]()[_0x941f('0x2c')](function(){_0x27b927['status'](0xcc)[_0x941f('0x2e')]();});}};}function handleEntityNotFound(_0x5c8fca,_0x4fe170){return function(_0x537f56){if(!_0x537f56){_0x5c8fca['sendStatus'](0x194);}return _0x537f56;};}function handleError(_0x305e13,_0x3492e8){_0x3492e8=_0x3492e8||0x1f4;return function(_0x1f9508){logger[_0x941f('0x2f')](_0x1f9508[_0x941f('0x30')]);if(_0x1f9508[_0x941f('0x31')]){delete _0x1f9508[_0x941f('0x31')];}_0x305e13['status'](_0x3492e8)[_0x941f('0x32')](_0x1f9508);};}exports['index']=function(_0x1471d6,_0x10820e){var _0x2c4b04={},_0x22b5db={},_0x57f9b7={'count':0x0,'rows':[]};var _0x35d570=_[_0x941f('0x33')](db['ChatGroup'][_0x941f('0x34')],function(_0x5e999d){return{'name':_0x5e999d[_0x941f('0x35')],'type':_0x5e999d[_0x941f('0x36')][_0x941f('0x37')]};});_0x22b5db['model']=_['map'](_0x35d570,_0x941f('0x31'));_0x22b5db[_0x941f('0x38')]=_[_0x941f('0x39')](_0x1471d6[_0x941f('0x38')]);_0x22b5db[_0x941f('0x3a')]=_[_0x941f('0x3b')](_0x22b5db[_0x941f('0x3c')],_0x22b5db[_0x941f('0x38')]);_0x2c4b04[_0x941f('0x3d')]=_[_0x941f('0x3b')](_0x22b5db['model'],qs[_0x941f('0x3e')](_0x1471d6[_0x941f('0x38')]['fields']));_0x2c4b04['attributes']=_0x2c4b04[_0x941f('0x3d')][_0x941f('0x3f')]?_0x2c4b04['attributes']:_0x22b5db[_0x941f('0x3c')];if(!_0x1471d6[_0x941f('0x38')][_0x941f('0x40')](_0x941f('0x41'))){_0x2c4b04[_0x941f('0x24')]=qs[_0x941f('0x24')](_0x1471d6[_0x941f('0x38')][_0x941f('0x24')]);_0x2c4b04[_0x941f('0x22')]=qs[_0x941f('0x22')](_0x1471d6[_0x941f('0x38')][_0x941f('0x22')]);}_0x2c4b04[_0x941f('0x42')]=qs['sort'](_0x1471d6[_0x941f('0x38')][_0x941f('0x43')]);_0x2c4b04['where']=qs[_0x941f('0x3a')](_[_0x941f('0x44')](_0x1471d6['query'],_0x22b5db['filters']),_0x35d570);if(_0x1471d6[_0x941f('0x38')][_0x941f('0x45')]){_0x2c4b04[_0x941f('0x46')]=_['merge'](_0x2c4b04[_0x941f('0x46')],{'$or':_[_0x941f('0x33')](_0x35d570,function(_0x38a53f){if(_0x38a53f[_0x941f('0x36')]!==_0x941f('0x47')){var _0x4d3a23={};_0x4d3a23[_0x38a53f['name']]={'$like':'%'+_0x1471d6[_0x941f('0x38')]['filter']+'%'};return _0x4d3a23;}})});}_0x2c4b04=_['merge']({},_0x2c4b04,_0x1471d6['options']);var _0x25bb01={'where':_0x2c4b04[_0x941f('0x46')]};return db[_0x941f('0x48')][_0x941f('0x25')](_0x25bb01)[_0x941f('0x2c')](function(_0x52f25c){_0x57f9b7[_0x941f('0x25')]=_0x52f25c;if(_0x1471d6[_0x941f('0x38')][_0x941f('0x49')]){_0x2c4b04[_0x941f('0x4a')]=[{'all':!![]}];}return db[_0x941f('0x48')][_0x941f('0x4b')](_0x2c4b04);})[_0x941f('0x2c')](function(_0x138816){_0x57f9b7['rows']=_0x138816;return _0x57f9b7;})[_0x941f('0x2c')](respondWithFilteredResult(_0x10820e,_0x2c4b04))['catch'](handleError(_0x10820e,null));};exports['show']=function(_0x25715c,_0x5efea1){var _0x4be236={'raw':!![],'where':{'id':_0x25715c[_0x941f('0x4c')]['id']}},_0x261345={};_0x261345[_0x941f('0x3c')]=_['keys'](db[_0x941f('0x48')][_0x941f('0x34')]);_0x261345[_0x941f('0x38')]=_[_0x941f('0x39')](_0x25715c['query']);_0x261345[_0x941f('0x3a')]=_[_0x941f('0x3b')](_0x261345[_0x941f('0x3c')],_0x261345[_0x941f('0x38')]);_0x4be236[_0x941f('0x3d')]=_[_0x941f('0x3b')](_0x261345[_0x941f('0x3c')],qs[_0x941f('0x3e')](_0x25715c['query'][_0x941f('0x3e')]));_0x4be236[_0x941f('0x3d')]=_0x4be236['attributes'][_0x941f('0x3f')]?_0x4be236[_0x941f('0x3d')]:_0x261345['model'];if(_0x25715c[_0x941f('0x38')][_0x941f('0x49')]){_0x4be236['include']=[{'all':!![]}];}_0x4be236=_[_0x941f('0x4d')]({},_0x4be236,_0x25715c['options']);return db[_0x941f('0x48')][_0x941f('0x4e')](_0x4be236)[_0x941f('0x2c')](handleEntityNotFound(_0x5efea1,null))['then'](respondWithResult(_0x5efea1,null))[_0x941f('0x4f')](handleError(_0x5efea1,null));};exports[_0x941f('0x50')]=function(_0x1379e1,_0x9b9d16){return db[_0x941f('0x48')][_0x941f('0x50')](_0x1379e1[_0x941f('0x51')],{})[_0x941f('0x2c')](respondWithResult(_0x9b9d16,0xc9))['catch'](handleError(_0x9b9d16,null));};exports[_0x941f('0x2b')]=function(_0x44d142,_0x1c2963){if(_0x44d142[_0x941f('0x51')]['id']){delete _0x44d142[_0x941f('0x51')]['id'];}return db['ChatGroup'][_0x941f('0x4e')]({'where':{'id':_0x44d142[_0x941f('0x4c')]['id']}})[_0x941f('0x2c')](handleEntityNotFound(_0x1c2963,null))[_0x941f('0x2c')](saveUpdates(_0x44d142[_0x941f('0x51')],null))[_0x941f('0x2c')](respondWithResult(_0x1c2963,null))[_0x941f('0x4f')](handleError(_0x1c2963,null));};exports['destroy']=function(_0x191694,_0x1c48c6){return db[_0x941f('0x48')][_0x941f('0x4e')]({'where':{'id':_0x191694[_0x941f('0x4c')]['id']}})[_0x941f('0x2c')](handleEntityNotFound(_0x1c48c6,null))[_0x941f('0x2c')](removeEntity(_0x1c48c6,null))[_0x941f('0x4f')](handleError(_0x1c48c6,null));};exports[_0x941f('0x52')]=function(_0x5a3533,_0x1cb5a3){return db[_0x941f('0x48')][_0x941f('0x52')]()['then'](respondWithResult(_0x1cb5a3,null))['catch'](handleError(_0x1cb5a3,null));};exports[_0x941f('0x53')]=function(_0x20e40b,_0x16b875,_0x4b8afc){return db['ChatInternalMessage'][_0x941f('0x25')]({'where':{'ChatGroupId':_0x20e40b[_0x941f('0x4c')]['id'],'ToId':_0x20e40b[_0x941f('0x54')]['id'],'read':![]}})['then'](function(_0x1decf3){return{'id':_[_0x941f('0x55')](_0x20e40b[_0x941f('0x4c')]['id']),'count':_0x1decf3};})[_0x941f('0x2c')](respondWithResult(_0x16b875,null))[_0x941f('0x4f')](handleError(_0x16b875,null));};exports[_0x941f('0x56')]=function(_0x5999e0,_0x4f6027,_0x385b09){return db[_0x941f('0x48')][_0x941f('0x4e')]({'where':{'id':_0x5999e0['params']['id']}})[_0x941f('0x2c')](handleEntityNotFound(_0x4f6027,null))['then'](function(_0x145986){if(_0x145986){return _0x145986[_0x941f('0x56')](_0x5999e0[_0x941f('0x51')][_0x941f('0x57')],_[_0x941f('0x58')](_0x5999e0['body'],[_0x941f('0x57'),'id'])||{});}})['then'](respondWithResult(_0x4f6027,null))[_0x941f('0x4f')](handleError(_0x4f6027,null));};exports['getMembers']=function(_0x63c912,_0x563299,_0x530f74){var _0xc1fb5b={};var _0x255e50={};var _0x4ee701;var _0x2eaa9f;return db[_0x941f('0x48')][_0x941f('0x59')]({'where':{'id':_0x63c912[_0x941f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x563299,null))[_0x941f('0x2c')](function(_0x55d6b0){if(_0x55d6b0){_0x4ee701=_0x55d6b0;_0x255e50[_0x941f('0x3c')]=_[_0x941f('0x39')](db[_0x941f('0x5a')][_0x941f('0x34')]);_0x255e50['query']=_[_0x941f('0x39')](_0x63c912[_0x941f('0x38')]);_0x255e50['filters']=_[_0x941f('0x3b')](_0x255e50[_0x941f('0x3c')],_0x255e50[_0x941f('0x38')]);_0xc1fb5b[_0x941f('0x3d')]=_['intersection'](_0x255e50[_0x941f('0x3c')],qs['fields'](_0x63c912[_0x941f('0x38')][_0x941f('0x3e')]));_0xc1fb5b[_0x941f('0x3d')]=_0xc1fb5b[_0x941f('0x3d')]['length']?_0xc1fb5b['attributes']:_0x255e50[_0x941f('0x3c')];_0xc1fb5b[_0x941f('0x42')]=qs[_0x941f('0x43')](_0x63c912[_0x941f('0x38')][_0x941f('0x43')]);_0xc1fb5b[_0x941f('0x46')]=qs[_0x941f('0x3a')](_['pick'](_0x63c912[_0x941f('0x38')],_0x255e50['filters']));if(_0x63c912['query'][_0x941f('0x45')]){_0xc1fb5b[_0x941f('0x46')]=_[_0x941f('0x4d')](_0xc1fb5b[_0x941f('0x46')],{'$or':_[_0x941f('0x33')](_0xc1fb5b[_0x941f('0x3d')],function(_0x234ae0){var _0x5418fc={};_0x5418fc[_0x234ae0]={'$like':'%'+_0x63c912['query']['filter']+'%'};return _0x5418fc;})});}_0xc1fb5b=_['merge']({},_0xc1fb5b,_0x63c912[_0x941f('0x5b')]);return _0x4ee701[_0x941f('0x5c')](_0xc1fb5b);}})['then'](function(_0x39a8c8){if(_0x39a8c8){_0x2eaa9f=_0x39a8c8[_0x941f('0x3f')];if(!_0x63c912['query']['hasOwnProperty'](_0x941f('0x41'))){_0xc1fb5b[_0x941f('0x24')]=qs[_0x941f('0x24')](_0x63c912['query'][_0x941f('0x24')]);_0xc1fb5b[_0x941f('0x22')]=qs[_0x941f('0x22')](_0x63c912['query'][_0x941f('0x22')]);}return _0x4ee701[_0x941f('0x5c')](_0xc1fb5b);}})['then'](function(_0x410d63){if(_0x410d63){return _0x410d63?{'count':_0x2eaa9f,'rows':_0x410d63}:null;}})[_0x941f('0x2c')](respondWithResult(_0x563299,null))[_0x941f('0x4f')](handleError(_0x563299,null));};exports[_0x941f('0x5d')]=function(_0x33fd1e,_0xbe27ee,_0x28fe26){return db[_0x941f('0x48')][_0x941f('0x4e')]({'where':{'id':_0x33fd1e[_0x941f('0x4c')]['id']}})[_0x941f('0x2c')](handleEntityNotFound(_0xbe27ee,null))[_0x941f('0x2c')](function(_0x14574b){if(_0x14574b){return _0x14574b[_0x941f('0x5d')](_0x33fd1e[_0x941f('0x38')]['ids']);}})[_0x941f('0x2c')](respondWithStatusCode(_0xbe27ee,null))[_0x941f('0x4f')](handleError(_0xbe27ee,null));};exports[_0x941f('0x5e')]=function(_0x49af84,_0x1570db,_0x161136){if(_0x49af84[_0x941f('0x51')]['id']){delete _0x49af84[_0x941f('0x51')]['id'];}return db[_0x941f('0x48')]['find']({'where':{'id':_0x49af84[_0x941f('0x4c')]['id']}})[_0x941f('0x2c')](handleEntityNotFound(_0x1570db,null))[_0x941f('0x2c')](function(_0x226c02){if(_0x226c02){_0x49af84['body']['ChatGroupId']=_0x226c02['id'];return db['ChatInternalMessage'][_0x941f('0x50')](_0x49af84[_0x941f('0x51')]);}})[_0x941f('0x2c')](respondWithResult(_0x1570db,null))[_0x941f('0x4f')](handleError(_0x1570db,null));};exports[_0x941f('0x5f')]=function(_0x5d0fb9,_0x2d4db3,_0x505069){var _0x59168d={};var _0x5a3358={};var _0x3a69af;var _0x49f20e;return db['ChatGroup'][_0x941f('0x59')]({'where':{'id':_0x5d0fb9[_0x941f('0x4c')]['id']}})[_0x941f('0x2c')](handleEntityNotFound(_0x2d4db3,null))['then'](function(_0xda37c7){if(_0xda37c7){_0x3a69af=_0xda37c7;_0x5a3358[_0x941f('0x3c')]=_[_0x941f('0x39')](db['ChatInternalMessage'][_0x941f('0x34')]);_0x5a3358[_0x941f('0x38')]=_[_0x941f('0x39')](_0x5d0fb9[_0x941f('0x38')]);_0x5a3358[_0x941f('0x3a')]=_[_0x941f('0x3b')](_0x5a3358['model'],_0x5a3358[_0x941f('0x38')]);_0x59168d[_0x941f('0x3d')]=_[_0x941f('0x3b')](_0x5a3358[_0x941f('0x3c')],qs['fields'](_0x5d0fb9[_0x941f('0x38')]['fields']));_0x59168d[_0x941f('0x3d')]=_0x59168d['attributes'][_0x941f('0x3f')]?_0x59168d['attributes']:_0x5a3358[_0x941f('0x3c')];_0x59168d[_0x941f('0x42')]=qs[_0x941f('0x43')](_0x5d0fb9[_0x941f('0x38')][_0x941f('0x43')]);_0x59168d[_0x941f('0x46')]=qs[_0x941f('0x3a')](_[_0x941f('0x44')](_0x5d0fb9[_0x941f('0x38')],_0x5a3358[_0x941f('0x3a')]));if(_0x5d0fb9[_0x941f('0x38')][_0x941f('0x45')]){_0x59168d[_0x941f('0x46')]=_['merge'](_0x59168d[_0x941f('0x46')],{'$or':_[_0x941f('0x33')](_0x59168d[_0x941f('0x3d')],function(_0xa86913){var _0x52a350={};_0x52a350[_0xa86913]={'$like':'%'+_0x5d0fb9[_0x941f('0x38')][_0x941f('0x45')]+'%'};return _0x52a350;})});}if(_0x5d0fb9[_0x941f('0x38')][_0x941f('0x60')]){var _0x5f0df1=_0x5d0fb9[_0x941f('0x38')]['$gte']['split'](',');var _0x33926d={};_0x33926d[_0x5f0df1[0x0]]={'$gte':moment(_0x5f0df1[0x1])['format'](_0x941f('0x61'))};_0x59168d['where']=_[_0x941f('0x4d')](_0x59168d['where'],_0x33926d);}_0x59168d=_[_0x941f('0x4d')]({},_0x59168d,_0x5d0fb9[_0x941f('0x5b')]);return _0x3a69af['getMessages'](_0x59168d);}})[_0x941f('0x2c')](function(_0x1fddfb){if(_0x1fddfb){_0x49f20e=_0x1fddfb[_0x941f('0x3f')];if(!_0x5d0fb9[_0x941f('0x38')][_0x941f('0x40')](_0x941f('0x41'))){_0x59168d[_0x941f('0x24')]=qs['limit'](_0x5d0fb9[_0x941f('0x38')][_0x941f('0x24')]);_0x59168d['offset']=qs[_0x941f('0x22')](_0x5d0fb9[_0x941f('0x38')][_0x941f('0x22')]);}return _0x3a69af[_0x941f('0x5f')](_0x59168d);}})['then'](function(_0x2057fb){if(_0x2057fb){return _0x2057fb?{'count':_0x49f20e,'rows':_0x2057fb}:null;}})[_0x941f('0x2c')](respondWithResult(_0x2d4db3,null))[_0x941f('0x4f')](handleError(_0x2d4db3,null));};
\ No newline at end of file
+var _0xe5cf=['YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','ChatInternalMessage','toInteger','addMembers','getMembers','findOne','User','fields','order','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0xe5cf,0x12a));var _0xfe5c=function(_0x4466c6,_0x25db42){_0x4466c6=_0x4466c6-0x0;var _0x45c69d=_0xe5cf[_0x4466c6];return _0x45c69d;};'use strict';var emlformat=require(_0xfe5c('0x0'));var rimraf=require(_0xfe5c('0x1'));var zipdir=require(_0xfe5c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe5c('0x3'));var moment=require(_0xfe5c('0x4'));var BPromise=require(_0xfe5c('0x5'));var Mustache=require(_0xfe5c('0x6'));var util=require(_0xfe5c('0x7'));var path=require(_0xfe5c('0x8'));var sox=require(_0xfe5c('0x9'));var csv=require(_0xfe5c('0xa'));var ejs=require(_0xfe5c('0xb'));var fs=require('fs');var fs_extra=require(_0xfe5c('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfe5c('0xd'));var jsforce=require(_0xfe5c('0xe'));var deskjs=require(_0xfe5c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfe5c('0x10'));var Papa=require(_0xfe5c('0x11'));var Redis=require('ioredis');var authService=require(_0xfe5c('0x12'));var qs=require(_0xfe5c('0x13'));var as=require(_0xfe5c('0x14'));var hardwareService=require(_0xfe5c('0x15'));var logger=require('../../config/logger')(_0xfe5c('0x16'));var utils=require(_0xfe5c('0x17'));var config=require(_0xfe5c('0x18'));var licenseUtil=require(_0xfe5c('0x19'));var db=require('../../mysqldb')['db'];config[_0xfe5c('0x1a')]=_[_0xfe5c('0x1b')](config[_0xfe5c('0x1a')],{'host':_0xfe5c('0x1c'),'port':0x18eb});var socket=require(_0xfe5c('0x1d'))(new Redis(config['redis']));require(_0xfe5c('0x1e'))[_0xfe5c('0x1f')](socket);function respondWithStatusCode(_0x1f280a,_0x173da8){_0x173da8=_0x173da8||0xcc;return function(_0x54a84c){if(_0x54a84c){return _0x1f280a[_0xfe5c('0x20')](_0x173da8);}return _0x1f280a[_0xfe5c('0x21')](_0x173da8)['end']();};}function respondWithResult(_0x415669,_0x3add65){_0x3add65=_0x3add65||0xc8;return function(_0x5713b9){if(_0x5713b9){return _0x415669[_0xfe5c('0x21')](_0x3add65)[_0xfe5c('0x22')](_0x5713b9);}};}function respondWithFilteredResult(_0x1944d6,_0x5871c8){return function(_0x22fe75){if(_0x22fe75){var _0x4ac07a=typeof _0x5871c8['offset']===_0xfe5c('0x23')&&typeof _0x5871c8[_0xfe5c('0x24')]===_0xfe5c('0x23');var _0x11796c=_0x22fe75['count'];var _0x197ac1=_0x4ac07a?0x0:_0x5871c8[_0xfe5c('0x25')];var _0x36f37b=_0x4ac07a?_0x22fe75[_0xfe5c('0x26')]:_0x5871c8[_0xfe5c('0x25')]+_0x5871c8[_0xfe5c('0x24')];var _0x262c72;if(_0x36f37b>=_0x11796c){_0x36f37b=_0x11796c;_0x262c72=0xc8;}else{_0x262c72=0xce;}_0x1944d6['status'](_0x262c72);return _0x1944d6[_0xfe5c('0x27')](_0xfe5c('0x28'),_0x197ac1+'-'+_0x36f37b+'/'+_0x11796c)[_0xfe5c('0x22')](_0x22fe75);}return null;};}function patchUpdates(_0x881b4d){return function(_0x5e1712){try{jsonpatch['apply'](_0x5e1712,_0x881b4d,!![]);}catch(_0x14afd1){return BPromise[_0xfe5c('0x29')](_0x14afd1);}return _0x5e1712[_0xfe5c('0x2a')]();};}function saveUpdates(_0x1dd59d,_0x49670f){return function(_0x5f5be3){if(_0x5f5be3){return _0x5f5be3[_0xfe5c('0x2b')](_0x1dd59d)[_0xfe5c('0x2c')](function(_0x4f7363){return _0x4f7363;});}return null;};}function removeEntity(_0x382972,_0x454979){return function(_0x5c19d4){if(_0x5c19d4){return _0x5c19d4[_0xfe5c('0x2d')]()[_0xfe5c('0x2c')](function(){_0x382972['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10a246,_0x48819f){return function(_0x2a3569){if(!_0x2a3569){_0x10a246[_0xfe5c('0x20')](0x194);}return _0x2a3569;};}function handleError(_0x56c7b2,_0x4ab684){_0x4ab684=_0x4ab684||0x1f4;return function(_0x15739d){logger[_0xfe5c('0x2e')](_0x15739d['stack']);if(_0x15739d[_0xfe5c('0x2f')]){delete _0x15739d['name'];}_0x56c7b2[_0xfe5c('0x21')](_0x4ab684)[_0xfe5c('0x30')](_0x15739d);};}exports[_0xfe5c('0x31')]=function(_0x41d1b0,_0xcd37dc){var _0x1bde98={},_0x269ec9={},_0x8f225c={'count':0x0,'rows':[]};var _0x20dd1b=_[_0xfe5c('0x32')](db[_0xfe5c('0x33')][_0xfe5c('0x34')],function(_0x52c062){return{'name':_0x52c062[_0xfe5c('0x35')],'type':_0x52c062[_0xfe5c('0x36')][_0xfe5c('0x37')]};});_0x269ec9[_0xfe5c('0x38')]=_[_0xfe5c('0x32')](_0x20dd1b,_0xfe5c('0x2f'));_0x269ec9[_0xfe5c('0x39')]=_[_0xfe5c('0x3a')](_0x41d1b0['query']);_0x269ec9[_0xfe5c('0x3b')]=_[_0xfe5c('0x3c')](_0x269ec9[_0xfe5c('0x38')],_0x269ec9[_0xfe5c('0x39')]);_0x1bde98[_0xfe5c('0x3d')]=_[_0xfe5c('0x3c')](_0x269ec9['model'],qs['fields'](_0x41d1b0['query']['fields']));_0x1bde98[_0xfe5c('0x3d')]=_0x1bde98[_0xfe5c('0x3d')][_0xfe5c('0x3e')]?_0x1bde98[_0xfe5c('0x3d')]:_0x269ec9['model'];if(!_0x41d1b0[_0xfe5c('0x39')][_0xfe5c('0x3f')](_0xfe5c('0x40'))){_0x1bde98[_0xfe5c('0x24')]=qs['limit'](_0x41d1b0['query']['limit']);_0x1bde98[_0xfe5c('0x25')]=qs['offset'](_0x41d1b0[_0xfe5c('0x39')][_0xfe5c('0x25')]);}_0x1bde98['order']=qs[_0xfe5c('0x41')](_0x41d1b0[_0xfe5c('0x39')][_0xfe5c('0x41')]);_0x1bde98['where']=qs['filters'](_[_0xfe5c('0x42')](_0x41d1b0[_0xfe5c('0x39')],_0x269ec9[_0xfe5c('0x3b')]),_0x20dd1b);if(_0x41d1b0[_0xfe5c('0x39')][_0xfe5c('0x43')]){_0x1bde98[_0xfe5c('0x44')]=_[_0xfe5c('0x45')](_0x1bde98['where'],{'$or':_[_0xfe5c('0x32')](_0x20dd1b,function(_0x2fd2bd){if(_0x2fd2bd[_0xfe5c('0x36')]!==_0xfe5c('0x46')){var _0x3e71ef={};_0x3e71ef[_0x2fd2bd['name']]={'$like':'%'+_0x41d1b0['query'][_0xfe5c('0x43')]+'%'};return _0x3e71ef;}})});}_0x1bde98=_[_0xfe5c('0x45')]({},_0x1bde98,_0x41d1b0[_0xfe5c('0x47')]);var _0x5a003={'where':_0x1bde98[_0xfe5c('0x44')]};return db[_0xfe5c('0x33')][_0xfe5c('0x26')](_0x5a003)[_0xfe5c('0x2c')](function(_0x5ab269){_0x8f225c[_0xfe5c('0x26')]=_0x5ab269;if(_0x41d1b0[_0xfe5c('0x39')][_0xfe5c('0x48')]){_0x1bde98[_0xfe5c('0x49')]=[{'all':!![]}];}return db[_0xfe5c('0x33')][_0xfe5c('0x4a')](_0x1bde98);})['then'](function(_0x559587){_0x8f225c[_0xfe5c('0x4b')]=_0x559587;return _0x8f225c;})[_0xfe5c('0x2c')](respondWithFilteredResult(_0xcd37dc,_0x1bde98))[_0xfe5c('0x4c')](handleError(_0xcd37dc,null));};exports['show']=function(_0x335f87,_0x5e6264){var _0x47955f={'raw':!![],'where':{'id':_0x335f87[_0xfe5c('0x4d')]['id']}},_0x274eee={};_0x274eee[_0xfe5c('0x38')]=_[_0xfe5c('0x3a')](db[_0xfe5c('0x33')][_0xfe5c('0x34')]);_0x274eee[_0xfe5c('0x39')]=_[_0xfe5c('0x3a')](_0x335f87[_0xfe5c('0x39')]);_0x274eee[_0xfe5c('0x3b')]=_[_0xfe5c('0x3c')](_0x274eee[_0xfe5c('0x38')],_0x274eee[_0xfe5c('0x39')]);_0x47955f['attributes']=_[_0xfe5c('0x3c')](_0x274eee[_0xfe5c('0x38')],qs['fields'](_0x335f87['query']['fields']));_0x47955f[_0xfe5c('0x3d')]=_0x47955f['attributes'][_0xfe5c('0x3e')]?_0x47955f['attributes']:_0x274eee['model'];if(_0x335f87['query']['includeAll']){_0x47955f[_0xfe5c('0x49')]=[{'all':!![]}];}_0x47955f=_[_0xfe5c('0x45')]({},_0x47955f,_0x335f87['options']);return db[_0xfe5c('0x33')][_0xfe5c('0x4e')](_0x47955f)['then'](handleEntityNotFound(_0x5e6264,null))['then'](respondWithResult(_0x5e6264,null))['catch'](handleError(_0x5e6264,null));};exports['create']=function(_0x566dc4,_0x2eb053){return db[_0xfe5c('0x33')][_0xfe5c('0x4f')](_0x566dc4['body'],{})['then'](respondWithResult(_0x2eb053,0xc9))[_0xfe5c('0x4c')](handleError(_0x2eb053,null));};exports[_0xfe5c('0x2b')]=function(_0x1ecef2,_0x17f662){if(_0x1ecef2[_0xfe5c('0x50')]['id']){delete _0x1ecef2[_0xfe5c('0x50')]['id'];}return db[_0xfe5c('0x33')]['find']({'where':{'id':_0x1ecef2[_0xfe5c('0x4d')]['id']}})[_0xfe5c('0x2c')](handleEntityNotFound(_0x17f662,null))[_0xfe5c('0x2c')](saveUpdates(_0x1ecef2[_0xfe5c('0x50')],null))[_0xfe5c('0x2c')](respondWithResult(_0x17f662,null))[_0xfe5c('0x4c')](handleError(_0x17f662,null));};exports['destroy']=function(_0x54ba3f,_0x291de5){return db[_0xfe5c('0x33')][_0xfe5c('0x4e')]({'where':{'id':_0x54ba3f['params']['id']}})[_0xfe5c('0x2c')](handleEntityNotFound(_0x291de5,null))[_0xfe5c('0x2c')](removeEntity(_0x291de5,null))[_0xfe5c('0x4c')](handleError(_0x291de5,null));};exports[_0xfe5c('0x51')]=function(_0x4bb684,_0x3f6e3c){return db['ChatGroup'][_0xfe5c('0x51')]()[_0xfe5c('0x2c')](respondWithResult(_0x3f6e3c,null))['catch'](handleError(_0x3f6e3c,null));};exports['getUnread']=function(_0x5a9a48,_0x48e796,_0x5bbb68){return db[_0xfe5c('0x52')]['count']({'where':{'ChatGroupId':_0x5a9a48[_0xfe5c('0x4d')]['id'],'ToId':_0x5a9a48['user']['id'],'read':![]}})[_0xfe5c('0x2c')](function(_0x14dc5a){return{'id':_[_0xfe5c('0x53')](_0x5a9a48[_0xfe5c('0x4d')]['id']),'count':_0x14dc5a};})['then'](respondWithResult(_0x48e796,null))[_0xfe5c('0x4c')](handleError(_0x48e796,null));};exports[_0xfe5c('0x54')]=function(_0xcd8fb9,_0x4862b7,_0x2a4959){return db[_0xfe5c('0x33')][_0xfe5c('0x4e')]({'where':{'id':_0xcd8fb9[_0xfe5c('0x4d')]['id']}})[_0xfe5c('0x2c')](handleEntityNotFound(_0x4862b7,null))[_0xfe5c('0x2c')](function(_0x271146){if(_0x271146){return _0x271146[_0xfe5c('0x54')](_0xcd8fb9[_0xfe5c('0x50')]['ids'],_['omit'](_0xcd8fb9['body'],['ids','id'])||{});}})[_0xfe5c('0x2c')](respondWithResult(_0x4862b7,null))[_0xfe5c('0x4c')](handleError(_0x4862b7,null));};exports[_0xfe5c('0x55')]=function(_0x207f43,_0xc3d17a,_0x2b99c6){var _0x1639c1={};var _0x2fd796={};var _0x30b763;var _0x5bc22c;return db[_0xfe5c('0x33')][_0xfe5c('0x56')]({'where':{'id':_0x207f43[_0xfe5c('0x4d')]['id']}})[_0xfe5c('0x2c')](handleEntityNotFound(_0xc3d17a,null))[_0xfe5c('0x2c')](function(_0x50429d){if(_0x50429d){_0x30b763=_0x50429d;_0x2fd796[_0xfe5c('0x38')]=_[_0xfe5c('0x3a')](db[_0xfe5c('0x57')][_0xfe5c('0x34')]);_0x2fd796[_0xfe5c('0x39')]=_[_0xfe5c('0x3a')](_0x207f43[_0xfe5c('0x39')]);_0x2fd796[_0xfe5c('0x3b')]=_[_0xfe5c('0x3c')](_0x2fd796[_0xfe5c('0x38')],_0x2fd796[_0xfe5c('0x39')]);_0x1639c1[_0xfe5c('0x3d')]=_['intersection'](_0x2fd796[_0xfe5c('0x38')],qs['fields'](_0x207f43[_0xfe5c('0x39')][_0xfe5c('0x58')]));_0x1639c1[_0xfe5c('0x3d')]=_0x1639c1[_0xfe5c('0x3d')]['length']?_0x1639c1['attributes']:_0x2fd796['model'];_0x1639c1[_0xfe5c('0x59')]=qs[_0xfe5c('0x41')](_0x207f43[_0xfe5c('0x39')][_0xfe5c('0x41')]);_0x1639c1['where']=qs[_0xfe5c('0x3b')](_[_0xfe5c('0x42')](_0x207f43[_0xfe5c('0x39')],_0x2fd796[_0xfe5c('0x3b')]));if(_0x207f43[_0xfe5c('0x39')][_0xfe5c('0x43')]){_0x1639c1['where']=_[_0xfe5c('0x45')](_0x1639c1[_0xfe5c('0x44')],{'$or':_['map'](_0x1639c1[_0xfe5c('0x3d')],function(_0x81a297){var _0x3c8164={};_0x3c8164[_0x81a297]={'$like':'%'+_0x207f43[_0xfe5c('0x39')][_0xfe5c('0x43')]+'%'};return _0x3c8164;})});}_0x1639c1=_['merge']({},_0x1639c1,_0x207f43[_0xfe5c('0x47')]);return _0x30b763['getMembers'](_0x1639c1);}})[_0xfe5c('0x2c')](function(_0x18dd2c){if(_0x18dd2c){_0x5bc22c=_0x18dd2c['length'];if(!_0x207f43[_0xfe5c('0x39')][_0xfe5c('0x3f')]('nolimit')){_0x1639c1[_0xfe5c('0x24')]=qs[_0xfe5c('0x24')](_0x207f43[_0xfe5c('0x39')][_0xfe5c('0x24')]);_0x1639c1[_0xfe5c('0x25')]=qs[_0xfe5c('0x25')](_0x207f43[_0xfe5c('0x39')][_0xfe5c('0x25')]);}return _0x30b763[_0xfe5c('0x55')](_0x1639c1);}})['then'](function(_0x1ba8d6){if(_0x1ba8d6){return _0x1ba8d6?{'count':_0x5bc22c,'rows':_0x1ba8d6}:null;}})[_0xfe5c('0x2c')](respondWithResult(_0xc3d17a,null))[_0xfe5c('0x4c')](handleError(_0xc3d17a,null));};exports[_0xfe5c('0x5a')]=function(_0x1e02d0,_0x49b493,_0x33f131){return db['ChatGroup'][_0xfe5c('0x4e')]({'where':{'id':_0x1e02d0[_0xfe5c('0x4d')]['id']}})[_0xfe5c('0x2c')](handleEntityNotFound(_0x49b493,null))[_0xfe5c('0x2c')](function(_0x37fdaf){if(_0x37fdaf){return _0x37fdaf['removeMembers'](_0x1e02d0['query'][_0xfe5c('0x5b')]);}})[_0xfe5c('0x2c')](respondWithStatusCode(_0x49b493,null))['catch'](handleError(_0x49b493,null));};exports[_0xfe5c('0x5c')]=function(_0x21f80c,_0x495235,_0x5b3828){if(_0x21f80c[_0xfe5c('0x50')]['id']){delete _0x21f80c[_0xfe5c('0x50')]['id'];}return db[_0xfe5c('0x33')][_0xfe5c('0x4e')]({'where':{'id':_0x21f80c[_0xfe5c('0x4d')]['id']}})[_0xfe5c('0x2c')](handleEntityNotFound(_0x495235,null))[_0xfe5c('0x2c')](function(_0x529cbd){if(_0x529cbd){_0x21f80c['body'][_0xfe5c('0x5d')]=_0x529cbd['id'];return db[_0xfe5c('0x52')]['create'](_0x21f80c[_0xfe5c('0x50')]);}})[_0xfe5c('0x2c')](respondWithResult(_0x495235,null))[_0xfe5c('0x4c')](handleError(_0x495235,null));};exports[_0xfe5c('0x5e')]=function(_0x147c32,_0x1b0ca6,_0x50aa9d){var _0x123267={};var _0x146870={};var _0x21d2f0;var _0x37970a;return db[_0xfe5c('0x33')][_0xfe5c('0x56')]({'where':{'id':_0x147c32['params']['id']}})[_0xfe5c('0x2c')](handleEntityNotFound(_0x1b0ca6,null))['then'](function(_0x3d006c){if(_0x3d006c){_0x21d2f0=_0x3d006c;_0x146870[_0xfe5c('0x38')]=_['keys'](db[_0xfe5c('0x52')]['rawAttributes']);_0x146870['query']=_['keys'](_0x147c32[_0xfe5c('0x39')]);_0x146870[_0xfe5c('0x3b')]=_[_0xfe5c('0x3c')](_0x146870[_0xfe5c('0x38')],_0x146870[_0xfe5c('0x39')]);_0x123267['attributes']=_['intersection'](_0x146870[_0xfe5c('0x38')],qs[_0xfe5c('0x58')](_0x147c32[_0xfe5c('0x39')][_0xfe5c('0x58')]));_0x123267[_0xfe5c('0x3d')]=_0x123267[_0xfe5c('0x3d')][_0xfe5c('0x3e')]?_0x123267['attributes']:_0x146870[_0xfe5c('0x38')];_0x123267[_0xfe5c('0x59')]=qs[_0xfe5c('0x41')](_0x147c32['query'][_0xfe5c('0x41')]);_0x123267[_0xfe5c('0x44')]=qs[_0xfe5c('0x3b')](_[_0xfe5c('0x42')](_0x147c32[_0xfe5c('0x39')],_0x146870['filters']));if(_0x147c32[_0xfe5c('0x39')]['filter']){_0x123267[_0xfe5c('0x44')]=_[_0xfe5c('0x45')](_0x123267[_0xfe5c('0x44')],{'$or':_[_0xfe5c('0x32')](_0x123267['attributes'],function(_0x153a13){var _0x39014b={};_0x39014b[_0x153a13]={'$like':'%'+_0x147c32[_0xfe5c('0x39')]['filter']+'%'};return _0x39014b;})});}if(_0x147c32['query'][_0xfe5c('0x5f')]){var _0x51ea0e=_0x147c32['query'][_0xfe5c('0x5f')][_0xfe5c('0x60')](',');var _0x1ac773={};_0x1ac773[_0x51ea0e[0x0]]={'$gte':moment(_0x51ea0e[0x1])[_0xfe5c('0x61')](_0xfe5c('0x62'))};_0x123267[_0xfe5c('0x44')]=_[_0xfe5c('0x45')](_0x123267[_0xfe5c('0x44')],_0x1ac773);}_0x123267=_[_0xfe5c('0x45')]({},_0x123267,_0x147c32[_0xfe5c('0x47')]);return _0x21d2f0[_0xfe5c('0x5e')](_0x123267);}})[_0xfe5c('0x2c')](function(_0x3b316a){if(_0x3b316a){_0x37970a=_0x3b316a[_0xfe5c('0x3e')];if(!_0x147c32[_0xfe5c('0x39')][_0xfe5c('0x3f')](_0xfe5c('0x40'))){_0x123267[_0xfe5c('0x24')]=qs[_0xfe5c('0x24')](_0x147c32['query'][_0xfe5c('0x24')]);_0x123267['offset']=qs[_0xfe5c('0x25')](_0x147c32['query']['offset']);}return _0x21d2f0[_0xfe5c('0x5e')](_0x123267);}})[_0xfe5c('0x2c')](function(_0x59dde8){if(_0x59dde8){return _0x59dde8?{'count':_0x37970a,'rows':_0x59dde8}:null;}})[_0xfe5c('0x2c')](respondWithResult(_0x1b0ca6,null))[_0xfe5c('0x4c')](handleError(_0x1b0ca6,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 63d96f2..1081137 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 _0xf82b=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x39fdb7,_0x5ac80d){var _0xbd17e7=function(_0x33c1ef){while(--_0x33c1ef){_0x39fdb7['push'](_0x39fdb7['shift']());}};_0xbd17e7(++_0x5ac80d);}(_0xf82b,0xe3));var _0xbf82=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf82b[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xbf82('0x0'));var ChatGroup=require(_0xbf82('0x1'))['db'][_0xbf82('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbf82('0x3')](0x0);var events={'afterCreate':_0xbf82('0x4'),'afterUpdate':_0xbf82('0x5'),'afterDestroy':_0xbf82('0x6')};function emitEvent(_0x37a39d){return function(_0x5ea455,_0x13fb0b,_0x2d2eee){ChatGroupEvents[_0xbf82('0x7')](_0x37a39d+':'+_0x5ea455['id'],_0x5ea455);ChatGroupEvents['emit'](_0x37a39d,_0x5ea455);_0x2d2eee(null);};}for(var e in events){if(events[_0xbf82('0x8')](e)){var event=events[e];ChatGroup[_0xbf82('0x9')](e,emitEvent(event));}}module[_0xbf82('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x0309=['hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove'];(function(_0x58bf06,_0x4b9259){var _0x122771=function(_0x481817){while(--_0x481817){_0x58bf06['push'](_0x58bf06['shift']());}};_0x122771(++_0x4b9259);}(_0x0309,0x8d));var _0x9030=function(_0x17931e,_0x96932c){_0x17931e=_0x17931e-0x0;var _0x4ec2ff=_0x0309[_0x17931e];return _0x4ec2ff;};'use strict';var EventEmitter=require(_0x9030('0x0'));var ChatGroup=require(_0x9030('0x1'))['db'][_0x9030('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9030('0x3')](0x0);var events={'afterCreate':_0x9030('0x4'),'afterUpdate':'update','afterDestroy':_0x9030('0x5')};function emitEvent(_0x1131fd){return function(_0x4aa8c5,_0x52abf3,_0x300f73){ChatGroupEvents['emit'](_0x1131fd+':'+_0x4aa8c5['id'],_0x4aa8c5);ChatGroupEvents['emit'](_0x1131fd,_0x4aa8c5);_0x300f73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x9030('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index cefefcd..f2d1e6d 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 _0xdcd3=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x13405d,_0x44a104){var _0x4784cc=function(_0x2620e6){while(--_0x2620e6){_0x13405d['push'](_0x13405d['shift']());}};_0x4784cc(++_0x44a104);}(_0xdcd3,0x19f));var _0x3dcd=function(_0xf19a74,_0x11026c){_0xf19a74=_0xf19a74-0x0;var _0x14b399=_0xdcd3[_0xf19a74];return _0x14b399;};'use strict';var _=require(_0x3dcd('0x0'));var util=require(_0x3dcd('0x1'));var logger=require(_0x3dcd('0x2'))(_0x3dcd('0x3'));var moment=require('moment');var BPromise=require(_0x3dcd('0x4'));var rp=require(_0x3dcd('0x5'));var fs=require('fs');var path=require(_0x3dcd('0x6'));var rimraf=require(_0x3dcd('0x7'));var config=require('../../config/environment');var attributes=require(_0x3dcd('0x8'));module[_0x3dcd('0x9')]=function(_0x44c1aa,_0x2742b7){return _0x44c1aa[_0x3dcd('0xa')](_0x3dcd('0xb'),attributes,{'tableName':_0x3dcd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce0a=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xce0a,0xf0));var _0xace0=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0xce0a[_0x427217];return _0x5b28fb;};'use strict';var _=require(_0xace0('0x0'));var util=require(_0xace0('0x1'));var logger=require(_0xace0('0x2'))(_0xace0('0x3'));var moment=require('moment');var BPromise=require(_0xace0('0x4'));var rp=require(_0xace0('0x5'));var fs=require('fs');var path=require(_0xace0('0x6'));var rimraf=require(_0xace0('0x7'));var config=require(_0xace0('0x8'));var attributes=require(_0xace0('0x9'));module[_0xace0('0xa')]=function(_0x397ae4,_0x4655f2){return _0x397ae4[_0xace0('0xb')](_0xace0('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 187d8b5..78d6c59 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 _0xadc5=['./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x443691,_0x17b893){var _0xb668dc=function(_0x4ae1b8){while(--_0x4ae1b8){_0x443691['push'](_0x443691['shift']());}};_0xb668dc(++_0x17b893);}(_0xadc5,0x1bd));var _0x5adc=function(_0x4113ca,_0x22afff){_0x4113ca=_0x4113ca-0x0;var _0x4328ab=_0xadc5[_0x4113ca];return _0x4328ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5adc('0x0'));var BPromise=require(_0x5adc('0x1'));var rs=require(_0x5adc('0x2'));var fs=require('fs');var Redis=require(_0x5adc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5adc('0x4'))(_0x5adc('0x5'));var config=require(_0x5adc('0x6'));var jayson=require(_0x5adc('0x7'));var client=jayson[_0x5adc('0x8')][_0x5adc('0x9')]({'port':0x232a});config[_0x5adc('0xa')]=_[_0x5adc('0xb')](config[_0x5adc('0xa')],{'host':_0x5adc('0xc'),'port':0x18eb});var socket=require(_0x5adc('0xd'))(new Redis(config[_0x5adc('0xa')]));require(_0x5adc('0xe'))[_0x5adc('0xf')](socket);function respondWithRpcPromise(_0x2c3df1,_0x436a13,_0x166703){return new BPromise(function(_0x1be611,_0xeb4ebf){return client[_0x5adc('0x10')](_0x2c3df1,_0x166703)[_0x5adc('0x11')](function(_0x2b76ca){logger[_0x5adc('0x12')](_0x5adc('0x13'),_0x436a13,_0x5adc('0x14'));logger['debug'](_0x5adc('0x15'),_0x436a13,_0x5adc('0x14'),JSON[_0x5adc('0x16')](_0x2b76ca));if(_0x2b76ca[_0x5adc('0x17')]){if(_0x2b76ca[_0x5adc('0x17')]['code']===0x1f4){logger[_0x5adc('0x17')](_0x5adc('0x13'),_0x436a13,_0x2b76ca['error'][_0x5adc('0x18')]);return _0xeb4ebf(_0x2b76ca[_0x5adc('0x17')][_0x5adc('0x18')]);}logger[_0x5adc('0x17')](_0x5adc('0x13'),_0x436a13,_0x2b76ca[_0x5adc('0x17')][_0x5adc('0x18')]);return _0x1be611(_0x2b76ca[_0x5adc('0x17')][_0x5adc('0x18')]);}else{logger[_0x5adc('0x12')]('ChatGroup,\x20%s,\x20%s',_0x436a13,_0x5adc('0x14'));_0x1be611(_0x2b76ca[_0x5adc('0x19')]['message']);}})[_0x5adc('0x1a')](function(_0x2f9ad4){logger[_0x5adc('0x17')](_0x5adc('0x13'),_0x436a13,_0x2f9ad4);_0xeb4ebf(_0x2f9ad4);});});}
\ No newline at end of file
+var _0x46fc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x260d4b,_0x25be3a){var _0x32751f=function(_0xd7db96){while(--_0xd7db96){_0x260d4b['push'](_0x260d4b['shift']());}};_0x32751f(++_0x25be3a);}(_0x46fc,0x103));var _0xc46f=function(_0x5904ba,_0x38ce04){_0x5904ba=_0x5904ba-0x0;var _0x996e12=_0x46fc[_0x5904ba];return _0x996e12;};'use strict';var _=require(_0xc46f('0x0'));var util=require(_0xc46f('0x1'));var moment=require(_0xc46f('0x2'));var BPromise=require(_0xc46f('0x3'));var rs=require(_0xc46f('0x4'));var fs=require('fs');var Redis=require(_0xc46f('0x5'));var db=require(_0xc46f('0x6'))['db'];var utils=require(_0xc46f('0x7'));var logger=require(_0xc46f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc46f('0x9'));var client=jayson[_0xc46f('0xa')][_0xc46f('0xb')]({'port':0x232a});config[_0xc46f('0xc')]=_[_0xc46f('0xd')](config[_0xc46f('0xc')],{'host':_0xc46f('0xe'),'port':0x18eb});var socket=require(_0xc46f('0xf'))(new Redis(config[_0xc46f('0xc')]));require(_0xc46f('0x10'))[_0xc46f('0x11')](socket);function respondWithRpcPromise(_0x3df2a4,_0x112351,_0x832eae){return new BPromise(function(_0x58eaa5,_0x3b438d){return client[_0xc46f('0x12')](_0x3df2a4,_0x832eae)[_0xc46f('0x13')](function(_0x14e547){logger['info']('ChatGroup,\x20%s,\x20%s',_0x112351,'request\x20sent');logger[_0xc46f('0x14')](_0xc46f('0x15'),_0x112351,'request\x20sent',JSON[_0xc46f('0x16')](_0x14e547));if(_0x14e547[_0xc46f('0x17')]){if(_0x14e547['error']['code']===0x1f4){logger[_0xc46f('0x17')](_0xc46f('0x18'),_0x112351,_0x14e547[_0xc46f('0x17')][_0xc46f('0x19')]);return _0x3b438d(_0x14e547['error']['message']);}logger['error'](_0xc46f('0x18'),_0x112351,_0x14e547[_0xc46f('0x17')][_0xc46f('0x19')]);return _0x58eaa5(_0x14e547['error'][_0xc46f('0x19')]);}else{logger[_0xc46f('0x1a')]('ChatGroup,\x20%s,\x20%s',_0x112351,'request\x20sent');_0x58eaa5(_0x14e547[_0xc46f('0x1b')]['message']);}})[_0xc46f('0x1c')](function(_0x14d1f5){logger[_0xc46f('0x17')]('ChatGroup,\x20%s,\x20%s',_0x112351,_0x14d1f5);_0x3b438d(_0x14d1f5);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 424597d..660e0ef 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 _0x006b=['length','chatGroup:','./chatGroup.events','save','update','emit','removeListener'];(function(_0x2a6ab8,_0x5eb621){var _0x5752ab=function(_0x49766d){while(--_0x49766d){_0x2a6ab8['push'](_0x2a6ab8['shift']());}};_0x5752ab(++_0x5eb621);}(_0x006b,0x87));var _0xb006=function(_0x39804e,_0x5d5530){_0x39804e=_0x39804e-0x0;var _0x32a258=_0x006b[_0x39804e];return _0x32a258;};'use strict';var ChatGroupEvents=require(_0xb006('0x0'));var events=[_0xb006('0x1'),'remove',_0xb006('0x2')];function createListener(_0xd66c51,_0x5c3a32){return function(_0x2693c8){_0x5c3a32[_0xb006('0x3')](_0xd66c51,_0x2693c8);};}function removeListener(_0x455eed,_0x5e10a8){return function(){ChatGroupEvents[_0xb006('0x4')](_0x455eed,_0x5e10a8);};}exports['register']=function(_0xce406b){for(var _0x1b06b3=0x0,_0x9518e1=events[_0xb006('0x5')];_0x1b06b3<_0x9518e1;_0x1b06b3++){var _0x33bddb=events[_0x1b06b3];var _0x56b6f1=createListener(_0xb006('0x6')+_0x33bddb,_0xce406b);ChatGroupEvents['on'](_0x33bddb,_0x56b6f1);}};
\ No newline at end of file
+var _0xe1e1=['length','chatGroup:','save','removeListener','register'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe1e1,0xcf));var _0x1e1e=function(_0x813342,_0x1210d1){_0x813342=_0x813342-0x0;var _0x44ab10=_0xe1e1[_0x813342];return _0x44ab10;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x1e1e('0x0'),'remove','update'];function createListener(_0xa96c8f,_0x1cf029){return function(_0x199075){_0x1cf029['emit'](_0xa96c8f,_0x199075);};}function removeListener(_0x4881bb,_0x422ac2){return function(){ChatGroupEvents[_0x1e1e('0x1')](_0x4881bb,_0x422ac2);};}exports[_0x1e1e('0x2')]=function(_0x53e4c){for(var _0x59d82c=0x0,_0x19926d=events[_0x1e1e('0x3')];_0x59d82c<_0x19926d;_0x59d82c++){var _0x34b57b=events[_0x59d82c];var _0x17a7f5=createListener(_0x1e1e('0x4')+_0x34b57b,_0x53e4c);ChatGroupEvents['on'](_0x34b57b,_0x17a7f5);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index d5f7d89..3e17463 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 _0x8700=['getUnread','/:id/members','getMembers','get','/:id/messages','getMessages','post','create','addMessage','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','/describe','/:id','show'];(function(_0x4109ed,_0x3afcf5){var _0x1e8493=function(_0x5843e5){while(--_0x5843e5){_0x4109ed['push'](_0x4109ed['shift']());}};_0x1e8493(++_0x3afcf5);}(_0x8700,0x75));var _0x0870=function(_0x221102,_0x458de6){_0x221102=_0x221102-0x0;var _0x5d0673=_0x8700[_0x221102];return _0x5d0673;};'use strict';var multer=require(_0x0870('0x0'));var util=require(_0x0870('0x1'));var path=require(_0x0870('0x2'));var timeout=require('connect-timeout');var express=require(_0x0870('0x3'));var router=express[_0x0870('0x4')]();var fs_extra=require(_0x0870('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0870('0x6'));var config=require('../../config/environment');var controller=require(_0x0870('0x7'));router['get']('/',auth[_0x0870('0x8')](),controller[_0x0870('0x9')]);router['get'](_0x0870('0xa'),auth[_0x0870('0x8')](),controller['describe']);router['get'](_0x0870('0xb'),auth[_0x0870('0x8')](),controller[_0x0870('0xc')]);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0x0870('0xd')]);router['get'](_0x0870('0xe'),auth['isAuthenticated'](),controller[_0x0870('0xf')]);router[_0x0870('0x10')](_0x0870('0x11'),auth['isAuthenticated'](),controller[_0x0870('0x12')]);router[_0x0870('0x13')]('/',auth['isAuthenticated'](),controller[_0x0870('0x14')]);router['post']('/:id/members',auth[_0x0870('0x8')](),controller['addMembers']);router[_0x0870('0x13')]('/:id/messages',auth[_0x0870('0x8')](),controller[_0x0870('0x15')]);router['put'](_0x0870('0xb'),auth[_0x0870('0x8')](),controller[_0x0870('0x16')]);router[_0x0870('0x17')](_0x0870('0xb'),auth[_0x0870('0x8')](),controller[_0x0870('0x18')]);router['delete']('/:id/members',auth[_0x0870('0x8')](),controller['removeMembers']);module[_0x0870('0x19')]=router;
\ No newline at end of file
+var _0xcf66=['post','create','addMembers','put','update','delete','destroy','removeMembers','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','/:id','getUnread','get','/:id/members','getMembers','/:id/messages','getMessages'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xcf66,0x19d));var _0x6cf6=function(_0x41c443,_0x28ef86){_0x41c443=_0x41c443-0x0;var _0x2e2a6c=_0xcf66[_0x41c443];return _0x2e2a6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6cf6('0x0'));var timeout=require(_0x6cf6('0x1'));var express=require(_0x6cf6('0x2'));var router=express[_0x6cf6('0x3')]();var fs_extra=require(_0x6cf6('0x4'));var auth=require(_0x6cf6('0x5'));var interaction=require(_0x6cf6('0x6'));var config=require(_0x6cf6('0x7'));var controller=require(_0x6cf6('0x8'));router['get']('/',auth[_0x6cf6('0x9')](),controller[_0x6cf6('0xa')]);router['get'](_0x6cf6('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x6cf6('0xc'),auth[_0x6cf6('0x9')](),controller['show']);router['get']('/:id/unread',auth[_0x6cf6('0x9')](),controller[_0x6cf6('0xd')]);router[_0x6cf6('0xe')](_0x6cf6('0xf'),auth['isAuthenticated'](),controller[_0x6cf6('0x10')]);router[_0x6cf6('0xe')](_0x6cf6('0x11'),auth[_0x6cf6('0x9')](),controller[_0x6cf6('0x12')]);router[_0x6cf6('0x13')]('/',auth[_0x6cf6('0x9')](),controller[_0x6cf6('0x14')]);router[_0x6cf6('0x13')](_0x6cf6('0xf'),auth[_0x6cf6('0x9')](),controller[_0x6cf6('0x15')]);router[_0x6cf6('0x13')](_0x6cf6('0x11'),auth[_0x6cf6('0x9')](),controller['addMessage']);router[_0x6cf6('0x16')]('/:id',auth[_0x6cf6('0x9')](),controller[_0x6cf6('0x17')]);router[_0x6cf6('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6cf6('0x19')]);router['delete'](_0x6cf6('0xf'),auth[_0x6cf6('0x9')](),controller[_0x6cf6('0x1a')]);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 3686b8f..27a4acc 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 _0xd7a0=['ENUM','out','BOOLEAN','sequelize','exports','INTEGER','star','thumb','TEXT','DATE','STRING'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xd7a0,0x163));var _0x0d7a=function(_0x4aa3ac,_0x1dc5ea){_0x4aa3ac=_0x4aa3ac-0x0;var _0x24c9e6=_0xd7a0[_0x4aa3ac];return _0x24c9e6;};'use strict';var Sequelize=require(_0x0d7a('0x0'));module[_0x0d7a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0d7a('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x0d7a('0x3'),_0x0d7a('0x4')),'defaultValue':_0x0d7a('0x3')},'ratingMessage':{'type':Sequelize[_0x0d7a('0x5')]},'pathTranscript':{'type':Sequelize[_0x0d7a('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0d7a('0x6')]},'disposition':{'type':Sequelize[_0x0d7a('0x7')]},'secondDisposition':{'type':Sequelize[_0x0d7a('0x7')]},'thirdDisposition':{'type':Sequelize[_0x0d7a('0x7')]},'note':{'type':Sequelize[_0x0d7a('0x7')]},'browserName':{'type':Sequelize[_0x0d7a('0x7')]},'browserVersion':{'type':Sequelize[_0x0d7a('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x0d7a('0x7')]},'deviceModel':{'type':Sequelize[_0x0d7a('0x7')]},'deviceVendor':{'type':Sequelize[_0x0d7a('0x7')]},'deviceType':{'type':Sequelize[_0x0d7a('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x0d7a('0x7')]},'formData':{'type':Sequelize[_0x0d7a('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x0d7a('0x6')]},'lastMsgAt':{'type':Sequelize[_0x0d7a('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x0d7a('0x8')]('in',_0x0d7a('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0d7a('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x0d7a('0xa')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0c71=['BOOLEAN','exports','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x0c71,0xfb));var _0x10c7=function(_0xea35b3,_0x18f99a){_0xea35b3=_0xea35b3-0x0;var _0xcac0c5=_0x0c71[_0xea35b3];return _0xcac0c5;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x10c7('0x1')]},'ratingType':{'type':Sequelize[_0x10c7('0x2')](_0x10c7('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x10c7('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x10c7('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x10c7('0x6')]},'disposition':{'type':Sequelize[_0x10c7('0x5')]},'secondDisposition':{'type':Sequelize[_0x10c7('0x5')]},'thirdDisposition':{'type':Sequelize[_0x10c7('0x5')]},'note':{'type':Sequelize[_0x10c7('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x10c7('0x5')]},'osName':{'type':Sequelize[_0x10c7('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x10c7('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x10c7('0x4')]},'customerIp':{'type':Sequelize[_0x10c7('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x10c7('0x7'))},'read1stAt':{'type':Sequelize[_0x10c7('0x6')]},'lastMsgAt':{'type':Sequelize[_0x10c7('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x10c7('0x2')]('in',_0x10c7('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x10c7('0x5')]},'customerPort':{'type':Sequelize[_0x10c7('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x10c7('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x10c7('0x9')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index c5c94c4..ef15404 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 _0x9f62=['findAll','getMyMessages','addTags','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','firstName','lastName','read','Account','Owner','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.ejs','.pdf','err','zip-dir','moment','bluebird','mustache','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','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','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','stack','name','send','render','merge','body','contact','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','talking','answered','unmanaged','abandoned','total','UserId','closed','waiting','disposition','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','sequelize','toString','ChatInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','o.fullname','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','includeAll','include','find','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','ValidationError','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','nolimit','sort','$gte','options'];(function(_0x2ca55e,_0x280c31){var _0x3c7753=function(_0x4719e8){while(--_0x4719e8){_0x2ca55e['push'](_0x2ca55e['shift']());}};_0x3c7753(++_0x280c31);}(_0x9f62,0x154));var _0x29f6=function(_0x209c36,_0x26b379){_0x209c36=_0x209c36-0x0;var _0x2a0f24=_0x9f62[_0x209c36];return _0x2a0f24;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x29f6('0x0'));var rp=require('request-promise');var moment=require(_0x29f6('0x1'));var BPromise=require(_0x29f6('0x2'));var Mustache=require(_0x29f6('0x3'));var util=require('util');var path=require('path');var ejs=require(_0x29f6('0x4'));var fs=require('fs');var _=require(_0x29f6('0x5'));var squel=require(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0x29f6('0x8'));var pdf=require(_0x29f6('0x9'));var logger=require(_0x29f6('0xa'))(_0x29f6('0xb'));var config=require(_0x29f6('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x29f6('0xd'),'port':0x18eb});var socket=require(_0x29f6('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x29f6('0xf')](socket);var jayson=require(_0x29f6('0x10'));var client=jayson['client'][_0x29f6('0x11')]({'port':0x232b});var client9004=jayson[_0x29f6('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5b9b6a,_0x559585,_0x57b2d2,_0x2ae0e4){return new BPromise(function(_0x55cf4,_0x189344){var _0x11a1fd=_0x2ae0e4||client;return _0x11a1fd[_0x29f6('0x13')](_0x5b9b6a,_0x57b2d2)[_0x29f6('0x14')](function(_0x35d2e2){logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));logger[_0x29f6('0x18')](_0x29f6('0x19'),_0x559585,_0x29f6('0x17'),JSON[_0x29f6('0x1a')](_0x35d2e2));if(_0x35d2e2[_0x29f6('0x1b')]){if(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x559585,_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x189344(_0x35d2e2[_0x29f6('0x1b')]['message']);}logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x35d2e2['error'][_0x29f6('0x1d')]);return _0x55cf4(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);}else{logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));_0x55cf4(_0x35d2e2['result'][_0x29f6('0x1d')]);}})['catch'](function(_0x4acb15){logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x4acb15);_0x189344(_0x4acb15);});});}function respondWithStatusCode(_0x39c6b3,_0xafb5dd){_0xafb5dd=_0xafb5dd||0xcc;return function(_0x54ddeb){if(_0x54ddeb){return _0x39c6b3[_0x29f6('0x1e')](_0xafb5dd);}return _0x39c6b3['status'](_0xafb5dd)[_0x29f6('0x1f')]();};}function respondWithResult(_0xcce041,_0x4200cc){_0x4200cc=_0x4200cc||0xc8;return function(_0x1b80aa){if(_0x1b80aa){return _0xcce041['status'](_0x4200cc)[_0x29f6('0x20')](_0x1b80aa);}};}function respondWithFilteredResult(_0x4d494f,_0x47c385){return function(_0x1401fb){if(_0x1401fb){var _0x45f792=typeof _0x47c385[_0x29f6('0x21')]===_0x29f6('0x22')&&typeof _0x47c385[_0x29f6('0x23')]===_0x29f6('0x22');var _0x23c630=_0x1401fb['count'];var _0x2183b7=_0x45f792?0x0:_0x47c385[_0x29f6('0x21')];var _0x1ab8d8=_0x45f792?_0x1401fb[_0x29f6('0x24')]:_0x47c385[_0x29f6('0x21')]+_0x47c385[_0x29f6('0x23')];var _0x3790f5;if(_0x1ab8d8>=_0x23c630){_0x1ab8d8=_0x23c630;_0x3790f5=0xc8;}else{_0x3790f5=0xce;}_0x4d494f[_0x29f6('0x25')](_0x3790f5);return _0x4d494f[_0x29f6('0x26')](_0x29f6('0x27'),_0x2183b7+'-'+_0x1ab8d8+'/'+_0x23c630)[_0x29f6('0x20')](_0x1401fb);}return null;};}function saveUpdates(_0x1c3f0b){return function(_0x40c830){if(_0x40c830){return _0x40c830[_0x29f6('0x28')](_0x1c3f0b)[_0x29f6('0x14')](function(_0x218931){return _0x218931;});}return null;};}function removeEntity(_0x3a7249){return function(_0x5492c2){if(_0x5492c2){return _0x5492c2['destroy']()[_0x29f6('0x14')](function(){_0x3a7249['status'](0xcc)[_0x29f6('0x1f')]();});}};}function handleEntityNotFound(_0xc8d2c5){return function(_0x1e1bb6){if(!_0x1e1bb6){_0xc8d2c5[_0x29f6('0x1e')](0x194);}return _0x1e1bb6;};}function handleError(_0x5e5d89,_0x53e11f){_0x53e11f=_0x53e11f||0x1f4;return function(_0x1bde69){logger[_0x29f6('0x1b')](_0x1bde69[_0x29f6('0x29')]);if(_0x1bde69[_0x29f6('0x2a')]){delete _0x1bde69[_0x29f6('0x2a')];}_0x5e5d89[_0x29f6('0x25')](_0x53e11f)[_0x29f6('0x2b')](_0x1bde69);};}function getMustacheRender(_0x1c3f0f,_0xad83a3){return Mustache[_0x29f6('0x2c')](_0x1c3f0f,_[_0x29f6('0x2d')](_0xad83a3[_0x29f6('0x2e')],{'contact':_0xad83a3[_0x29f6('0x2f')],'message':_0xad83a3[_0x29f6('0x1d')],'agent':_0xad83a3['agent'],'interaction':_0xad83a3['interaction'],'account':_0xad83a3[_0x29f6('0x30')]}))||'';}function getInteractionUsers(_0x44cf19,_0x1cd62a){return new BPromise(function(_0x5416dc,_0x3e1e25){try{if(_0x1cd62a[_0x44cf19['id']]){_0x44cf19[_0x29f6('0x31')]=_[_0x29f6('0x32')](_0x1cd62a[_0x44cf19['id']],function(_0x27d945){return{'id':_0x27d945['id'],'fullname':_0x27d945[_0x29f6('0x33')]};});}}catch(_0x48fbd1){_0x3e1e25(_0x48fbd1);}_0x5416dc(_0x44cf19);});}function getInteractionTags(_0x7695ee,_0x2ad06f){return new BPromise(function(_0x2c3441,_0x1b51cc){try{if(_0x7695ee['TagIds']){_0x7695ee[_0x29f6('0x34')]=[];_0x7695ee[_0x29f6('0x35')][_0x29f6('0x36')](',')[_0x29f6('0x37')](function(_0x5ddc09){_0x7695ee['Tags'][_0x29f6('0x38')](_0x2ad06f[_0x5ddc09]);});}delete _0x7695ee['TagIds'];}catch(_0x10f077){_0x1b51cc(_0x10f077);}_0x2c3441(_0x7695ee);});}function updateChatInteraction(_0x551411,_0x3a1a75,_0x537210){return new BPromise(function(_0x34b1ea,_0x11fb2d){return getInteractionUsers(_0x551411,_0x537210)['then'](function(_0x1431fc){return getInteractionTags(_0x1431fc,_0x3a1a75);})['then'](function(_0x3f3475){return getStateInteraction(_0x3f3475);})[_0x29f6('0x14')](function(_0x4aea11){_0x34b1ea(_0x4aea11);})[_0x29f6('0x39')](function(_0xc6a6b1){_0x11fb2d(_0xc6a6b1);});});}function getStateInteraction(_0x2cad42){return new BPromise(function(_0x1e9d5a){_0x2cad42['waiting']=0x0;_0x2cad42[_0x29f6('0x3a')]=0x0;_0x2cad42[_0x29f6('0x3b')]=0x0;_0x2cad42[_0x29f6('0x3c')]=0x0;_0x2cad42[_0x29f6('0x3d')]=0x0;_0x2cad42[_0x29f6('0x3e')]=0x0;if(!_0x2cad42['closed']&&!_0x2cad42[_0x29f6('0x3f')]){_0x2cad42['waiting']+=0x1;}if(!_0x2cad42[_0x29f6('0x40')]&&_0x2cad42['UserId']){_0x2cad42[_0x29f6('0x3a')]+=0x1;if(_0x2cad42[_0x29f6('0x41')]){_0x2cad42['waiting']-=0x1;}}if(_0x2cad42[_0x29f6('0x40')]&&_0x2cad42[_0x29f6('0x42')]===_0x29f6('0x3d')){_0x2cad42[_0x29f6('0x3d')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42[_0x29f6('0x40')]&&!_0x2cad42[_0x29f6('0x3f')]&&_0x2cad42['disposition']){_0x2cad42[_0x29f6('0x3c')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42['closed']&&_0x2cad42['UserId']){_0x2cad42['answered']+=0x1;if(_0x2cad42[_0x29f6('0x3a')]){_0x2cad42[_0x29f6('0x3a')]-=0x1;}}_0x2cad42[_0x29f6('0x3e')]+=0x1;_0x1e9d5a(_0x2cad42);});}exports[_0x29f6('0x43')]=function(_0x19fd60,_0x270842){var _0x29b3f6={},_0x155ffb={},_0x352119={'count':0x0,'rows':[]};var _0x1bde93=_['map'](db['ChatInteraction'][_0x29f6('0x44')],function(_0x450e76){return{'name':_0x450e76[_0x29f6('0x45')],'type':_0x450e76[_0x29f6('0x46')]['key']};});_0x155ffb[_0x29f6('0x47')]=_[_0x29f6('0x32')](_0x1bde93,'name');_0x155ffb[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x19fd60[_0x29f6('0x48')]);_0x155ffb[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],_0x155ffb[_0x29f6('0x48')]);_0x29b3f6[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x19fd60[_0x29f6('0x48')]['fields']));_0x29b3f6[_0x29f6('0x4c')]=_0x29b3f6[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x29b3f6[_0x29f6('0x4c')]:_0x155ffb[_0x29f6('0x47')];if(!_0x19fd60['query'][_0x29f6('0x4f')]('nolimit')){_0x29b3f6['limit']=qs[_0x29f6('0x23')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x23')]);_0x29b3f6[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x19fd60['query'][_0x29f6('0x21')]);}_0x29b3f6[_0x29f6('0x50')]=qs['sort'](_0x19fd60[_0x29f6('0x48')]['sort']);_0x29b3f6[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x19fd60[_0x29f6('0x48')],_0x155ffb['filters']),_0x1bde93);var _0x199060=[];var _0xaa915c=squel[_0x29f6('0x53')]()[_0x29f6('0x54')]('id')[_0x29f6('0x54')](_0x29f6('0x2a'))[_0x29f6('0x54')]('color')[_0x29f6('0x55')](_0x29f6('0x56'));var _0x3bca11=squel[_0x29f6('0x53')]()[_0x29f6('0x54')](_0x29f6('0x57'))[_0x29f6('0x54')](_0x29f6('0x58'))[_0x29f6('0x54')](_0x29f6('0x59'))['from']('user_has_chat_interactions','ui')[_0x29f6('0x5a')](_0x29f6('0x5b'),'u',_0x29f6('0x5c'));var _0x5ab84e=squel[_0x29f6('0x53')]()['from']('chat_interactions','i')[_0x29f6('0x5a')](_0x29f6('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x29f6('0x5b'),'o',_0x29f6('0x5e'))[_0x29f6('0x5a')]('chat_websites','a',_0x29f6('0x5f'))[_0x29f6('0x5a')](_0x29f6('0x60'),'me',_0x29f6('0x61'))[_0x29f6('0x5a')](_0x29f6('0x62'),'it',_0x29f6('0x63'))[_0x29f6('0x5a')](_0x29f6('0x56'),'t',_0x29f6('0x64'));var _0x2d4c8d=squel[_0x29f6('0x65')]();var _0x434e04=[];var _0x5078d1=squel['expr']();var _0x2bd7d9;if(_0x19fd60['query'][_0x29f6('0x66')]){_0x2bd7d9=as[_0x29f6('0x67')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x66')]);var _0x2f757b=_0x2bd7d9['sqlOperator'];for(var _0x56c442=0x0;_0x56c442<_0x2bd7d9[_0x29f6('0x68')][_0x29f6('0x4e')];_0x56c442++){var _0x293f9d=_0x2bd7d9[_0x29f6('0x68')][_0x56c442];var _0x56342e='i';var _0x32291b=_['find'](_0x1bde93,['name',_0x293f9d[_0x29f6('0x54')]]);if(!_0x32291b){switch(_0x293f9d[_0x29f6('0x54')]){case'unreadMessages':if(_0x293f9d[_0x29f6('0x69')]==0x1){_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d['field']+_0x29f6('0x6b'));}else{_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d[_0x29f6('0x54')]+_0x29f6('0x6c'));}break;case _0x29f6('0x6d'):if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){if(_0x293f9d['value'][_0x29f6('0x36')]('\x20')['length']>0x1){_0x2d4c8d[_0x2f757b](_0x29f6('0x70'),qs['getFullTextValue'](_0x293f9d['value']),null);}else{var _0x1a3357='%'+_0x293f9d[_0x29f6('0x69')]+'%';_0x2d4c8d[_0x2f757b](_0x29f6('0x71'),_0x1a3357,_0x1a3357,_0x1a3357);}}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x72')]);_0x293f9d[_0x29f6('0x54')]='ContactId';_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b[_0x29f6('0x46')],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x76'):var _0x56f3cb=_0x293f9d[_0x29f6('0x69')][_0x29f6('0x36')](',')[_0x29f6('0x32')](function(_0x456578){return Number(_0x456578);});_0x56f3cb[_0x29f6('0x37')](function(_0x122a1a){_0x5078d1['or'](_0x29f6('0x77'),'%,'+_0x122a1a+',%');});_0x434e04=_[_0x29f6('0x78')](_0x434e04,_0x56f3cb);break;case'User':if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){_0x2d4c8d[_0x2f757b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x293f9d[_0x29f6('0x69')]+'%',null);}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x3f')]);_0x293f9d['field']=_0x29f6('0x3f');_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e['text'],_0x411f3e['value'][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x2e'):_0x411f3e=as[_0x29f6('0x73')]('me',null,_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')]['start'],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);break;}}else{var _0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}}}else{var _0x478ed0=_(_0x19fd60[_0x29f6('0x48')])[_0x29f6('0x49')]()[_0x29f6('0x32')](function(_0x1f401c){return _[_0x29f6('0x79')](_0x1bde93,[_0x29f6('0x2a'),_0x1f401c])?_0x1f401c:undefined;})['compact']()[_0x29f6('0x69')]();if(!_['isEmpty'](_0x478ed0)){_0x478ed0['forEach'](function(_0x4f9907){if(_0x4f9907===_0x29f6('0x7a')){_0x5ab84e['where'](_0x29f6('0x7b'),[][_0x29f6('0x7c')](_0x19fd60[_0x29f6('0x48')][_0x4f9907]));}else if(_0x4f9907===_0x29f6('0x7d')){var _0x8a5e58=JSON[_0x29f6('0x7e')](_0x19fd60[_0x29f6('0x48')][_0x4f9907])['$gte'];var _0x3a23f3=JSON['parse'](_0x19fd60[_0x29f6('0x48')][_0x4f9907])[_0x29f6('0x7f')];_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x80'),_0x8a5e58,_0x3a23f3);}else{if(_0x19fd60[_0x29f6('0x48')][_0x4f9907]===_0x29f6('0x81')){_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x82'));}else{_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x83'),_0x19fd60[_0x29f6('0x48')][_0x4f9907]);}}});}if(_0x19fd60[_0x29f6('0x48')]['read']){if(_0x19fd60['query']['read']==0x1){_0x5ab84e[_0x29f6('0x6a')](_0x29f6('0x84'));}else{_0x5ab84e['having'](_0x29f6('0x85'));}}if(_0x19fd60['query'][_0x29f6('0x86')]){_0x434e04=_[_0x29f6('0x87')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')])?_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]:new Array(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]);_0x434e04[_0x29f6('0x37')](function(_0xa2ab9e){_0x5078d1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa2ab9e+',%');});}if(_0x19fd60[_0x29f6('0x48')]['filter']){var _0x16bb3c=_0x19fd60[_0x29f6('0x48')][_0x29f6('0x88')][_0x29f6('0x89')]('\x5c','\x5c\x5c')[_0x29f6('0x89')](/'/g,'\x27\x27');if(qs[_0x29f6('0x8a')](_0x16bb3c)){_0x2d4c8d['or'](_0x29f6('0x8b'),_0x16bb3c+'%');}else{_0x2d4c8d['or'](_0x29f6('0x8c'),qs['getFullTextValue'](_0x16bb3c))['or'](_0x29f6('0x8d'),_0x16bb3c+'%');}}}_0x5ab84e[_0x29f6('0x51')](_0x2d4c8d);_0x5ab84e['group']('i.id');var _0x216f51={'type':db[_0x29f6('0x8e')][_0x29f6('0x8f')][_0x29f6('0x90')],'raw':!![]};var _0x467dd2=_0x5ab84e[_0x29f6('0x91')]();_0x467dd2[_0x29f6('0x54')](_0x29f6('0x92'));_0x467dd2[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));if(_0x29b3f6[_0x29f6('0x50')]){_0x29b3f6['order']['forEach'](function(_0x2e2f16){var _0x180658=_0x2e2f16[0x0]==='contactName'?_0x2e2f16[0x0]:'i.'+_0x2e2f16[0x0];_0x5ab84e[_0x29f6('0x50')](_0x180658,_0x2e2f16[0x1]===_0x29f6('0x95')?![]:!![]);});}if(!_[_0x29f6('0x96')](_0x434e04)){_0x5ab84e[_0x29f6('0x6a')](_0x5078d1);_0x467dd2[_0x29f6('0x51')](_0x29f6('0x97'),_0x434e04);}BPromise[_0x29f6('0x98')]()['then'](function(){if(!_0x2bd7d9){if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return;_0x467dd2[_0x29f6('0x51')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x99'));return;}if(_0x19fd60['user'][_0x29f6('0x9a')]!==_0x29f6('0x9b'))return;return _0x19fd60['user'][_0x29f6('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x405124){if(_[_0x29f6('0x96')](_0x405124)){_0x467dd2[_0x29f6('0x51')](_0x29f6('0x9d'));_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x9d'));}else{_0x467dd2['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));_0x5ab84e[_0x29f6('0x51')]('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));}});})['then'](function(){if(_0x19fd60[_0x29f6('0x9e')][_0x29f6('0x9a')]===_0x29f6('0x9b')&&!_0x2bd7d9&&!_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return[];return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x467dd2['toString'](),_0x216f51);})[_0x29f6('0x14')](function(_0x365b6d){_0x352119[_0x29f6('0x24')]=_0x365b6d['length'];if(_0x352119['count']===0x0)return[];return db['sequelize']['query'](_0xaa915c[_0x29f6('0xa0')](),_0x216f51)['then'](function(_0x537a8d){_0x199060=_['keyBy'](_0x537a8d,'id');_0x216f51=_[_0x29f6('0x2d')](_0x216f51,{'model':db[_0x29f6('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x4d')]){_0x29b3f6[_0x29f6('0x4c')]['forEach'](function(_0x28cf80){_0x5ab84e['field']('i.'+_0x28cf80);});}else{_0x5ab84e[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));_0x5ab84e[_0x29f6('0x54')]('a.key','Account.key');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa2'),_0x29f6('0xa3'));_0x5ab84e['field'](_0x29f6('0xa4'),_0x29f6('0xa5'));_0x5ab84e['field'](_0x29f6('0xa6'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa7'),_0x29f6('0xa8'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa9'),_0x29f6('0xaa'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xab'),_0x29f6('0xac'));_0x5ab84e['field'](_0x29f6('0xad'),'Contact.phone');_0x5ab84e['field']('c.mobile',_0x29f6('0xae'));_0x5ab84e[_0x29f6('0x54')]('c.fax','Contact.fax');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xaf'),'Owner.fullname');_0x5ab84e['field']('o.internal','Owner.internal');_0x5ab84e[_0x29f6('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x29f6('0x35'));}if(_0x29b3f6[_0x29f6('0x23')])_0x5ab84e['limit'](_0x29b3f6[_0x29f6('0x23')]);if(_0x29b3f6[_0x29f6('0x21')])_0x5ab84e['offset'](_0x29b3f6[_0x29f6('0x21')]);return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x5ab84e[_0x29f6('0xa0')](),_0x216f51);})[_0x29f6('0x14')](function(_0x399328){if(_0x399328[_0x29f6('0x4e')]>0x0)_0x3bca11[_0x29f6('0x51')](_0x29f6('0xb0'),_[_0x29f6('0x32')](_0x399328,'id'));return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x3bca11[_0x29f6('0xa0')](),_0x216f51)[_0x29f6('0x14')](function(_0x5076ed){var _0x24757e=_[_0x29f6('0xb1')](_0x5076ed,_0x29f6('0xb2'));var _0x264617=[];_0x399328[_0x29f6('0x37')](function(_0x3569f7){_0x264617[_0x29f6('0x38')](updateChatInteraction(_0x3569f7,_0x199060,_0x24757e));});return BPromise['all'](_0x264617);});});})[_0x29f6('0x14')](function(_0x4ec09d){_0x352119[_0x29f6('0xb3')]=_0x4ec09d;return _0x352119;})[_0x29f6('0x14')](respondWithFilteredResult(_0x270842,_0x29b3f6))[_0x29f6('0x39')](handleError(_0x270842,null));};exports[_0x29f6('0xb4')]=function(_0x43c44d,_0x63517e){var _0x2dc960={'raw':![],'where':{'id':_0x43c44d[_0x29f6('0xb5')]['id']}},_0x312a6f={};_0x312a6f['model']=_[_0x29f6('0x49')](db[_0x29f6('0xa1')]['rawAttributes']);_0x312a6f['query']=_[_0x29f6('0x49')](_0x43c44d[_0x29f6('0x48')]);_0x312a6f[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x312a6f['model'],_0x312a6f[_0x29f6('0x48')]);_0x2dc960[_0x29f6('0x4c')]=_['intersection'](_0x312a6f[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x43c44d[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x2dc960[_0x29f6('0x4c')]=_0x2dc960[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2dc960[_0x29f6('0x4c')]:_0x312a6f[_0x29f6('0x47')];if(_0x43c44d[_0x29f6('0x48')][_0x29f6('0xb6')]){_0x2dc960[_0x29f6('0xb7')]=[{'all':!![]}];}_0x2dc960=_[_0x29f6('0x2d')]({},_0x2dc960,_0x43c44d['options']);return db[_0x29f6('0xa1')][_0x29f6('0xb8')](_0x2dc960)[_0x29f6('0x14')](handleEntityNotFound(_0x63517e,null))[_0x29f6('0x14')](respondWithResult(_0x63517e,null))['catch'](handleError(_0x63517e,null));};exports[_0x29f6('0xb9')]=function(_0x2ffad1,_0x37ea1b){return db['ChatInteraction'][_0x29f6('0xb9')](_0x2ffad1[_0x29f6('0x2e')],{})['then'](respondWithResult(_0x37ea1b,0xc9))[_0x29f6('0x39')](handleError(_0x37ea1b,null));};exports[_0x29f6('0x28')]=function(_0x26f030,_0x247bce){if(_0x26f030[_0x29f6('0x2e')]['id']){delete _0x26f030[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x26f030[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x247bce,null))[_0x29f6('0x14')](saveUpdates(_0x26f030['body'],null))['then'](respondWithResult(_0x247bce,null))[_0x29f6('0x39')](handleError(_0x247bce,null));};exports[_0x29f6('0xba')]=function(_0x1621b7,_0x1f0e72){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x1621b7[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1f0e72,null))['then'](removeEntity(_0x1f0e72,null))['catch'](handleError(_0x1f0e72,null));};exports['describe']=function(_0x1fd477,_0x45dfd1){return db[_0x29f6('0xa1')][_0x29f6('0xbb')]()['then'](respondWithResult(_0x45dfd1,null))[_0x29f6('0x39')](handleError(_0x45dfd1,null));};exports[_0x29f6('0xbc')]=function(_0x4f2471,_0x1ef540){var _0x5a51c0=_0x4f2471[_0x29f6('0xb5')]['id'];var _0x2a2e0e;var _0xaccfb7;var _0x19c10d;return db['ChatInteraction'][_0x29f6('0xbd')]({'where':{'id':_0x5a51c0}})['then'](function(_0x47785a){_0x2a2e0e=_0x47785a;return db[_0x29f6('0xbe')][_0x29f6('0xbd')]({'where':{'id':_0x47785a[_0x29f6('0x7a')]},'attributes':['id',_0x29f6('0xbf'),_0x29f6('0xc0'),'vidaooTopic','vidaooNote',_0x29f6('0xc1')],'raw':!![]});})['then'](function(_0x5db958){if(_0x5db958&&_0x5db958[_0x29f6('0xbf')]&&_0x5db958['vidaooEscalation']){_0xaccfb7=_0x5db958;var _0x67c30a={'interaction':{'id':_0x5a51c0},'agent':{'id':_0x4f2471[_0x29f6('0x9e')]['id'],'name':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x2a')],'fullname':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x33')],'email':_0x4f2471['user'][_0x29f6('0xc2')]},'contact':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x2f')],'account':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x30')]};var _0x1cec09={'rejectUnauthorized':![],'method':_0x29f6('0xc3'),'url':_0x29f6('0xc4'),'headers':{'X-APIKEY':_0x5db958[_0x29f6('0xbf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4f2471[_0x29f6('0x9e')][_0x29f6('0xc2')]],'buttons':null,'topic':_0xaccfb7['vidaooTopic'],'note':_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc6')])?null:getMustacheRender(_0xaccfb7['vidaooNote'],_0x67c30a),'metadata':null},'redirect':_0x29f6('0xc7'),'json':!![]};try{if(!_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc1')])){var _0x50d48d=getMustacheRender(_0xaccfb7['vidaooMetadata'],_0x67c30a);var _0x1413a5=JSON[_0x29f6('0x7e')](_0x50d48d);_0x1cec09[_0x29f6('0x2e')][_0x29f6('0xc8')]=_0x1413a5;}}catch(_0x2b6357){throw new db[(_0x29f6('0x8e'))]['ValidationError'](_0x29f6('0xc9'));}return rp(_0x1cec09);}else{throw new db[(_0x29f6('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x231f26){_0x19c10d=_0x231f26;if(_0x19c10d['id']){var _0x578d49={'body':_0x19c10d[_0x29f6('0xca')],'ChatWebsiteId':_0xaccfb7['id'],'ChatInteractionId':_0x2a2e0e['id'],'direction':'out','UserId':_0x4f2471[_0x29f6('0x9e')]['id']};return db[_0x29f6('0xcb')][_0x29f6('0xb9')](_0x578d49,{});}else{throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x29f6('0x14')](function(){return _0x2a2e0e['updateAttributes']({'vidaooSessionId':_0x19c10d['id']});})[_0x29f6('0x14')](respondWithResult(_0x1ef540,null))[_0x29f6('0x39')](handleError(_0x1ef540,null));};exports[_0x29f6('0xcd')]=function(_0x19d1cb,_0x478660){if(_0x19d1cb[_0x29f6('0x2e')]['id']){delete _0x19d1cb[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x19d1cb[_0x29f6('0xb5')]['id']},'include':[{'model':db['CmContact'],'as':_0x29f6('0x6d')}]})[_0x29f6('0x14')](handleEntityNotFound(_0x478660,null))['then'](saveUpdates(_0x19d1cb[_0x29f6('0x2e')],null))['then'](respondWithResult(_0x478660,null))[_0x29f6('0x39')](handleError(_0x478660,null));};exports[_0x29f6('0xce')]=function(_0x52c66d,_0x955f7){if(_0x52c66d[_0x29f6('0x2e')]['id']){delete _0x52c66d['body']['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x52c66d[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](function(_0x352a07){if(!_0x352a07){logger[_0x29f6('0x1b')](_0x29f6('0xcf'),_0x29f6('0xce'),0x194,'entity\x20not\x20found');_0x955f7[_0x29f6('0x1e')](0x194);}else{if(_0x352a07[_0x29f6('0x3f')]){throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Interaction\x20already\x20assigned');}}return _0x352a07;})[_0x29f6('0x14')](function(_0x10648e){if(_0x10648e){return _0x10648e[_0x29f6('0x28')]({'closed':_0x52c66d[_0x29f6('0x2e')][_0x29f6('0x40')],'disposition':_0x52c66d['body']['disposition']})[_0x29f6('0x14')](function(_0x1b3b27){return _0x1b3b27;});}})['then'](function(){return respondWithRpcPromise(_0x29f6('0xd0'),'abandon',_0x52c66d['body'],client9004);})[_0x29f6('0x14')](respondWithResult(_0x955f7,null))['catch'](handleError(_0x955f7,null));};exports[_0x29f6('0xd1')]=function(_0x24a7fb,_0x454c4c){_0x24a7fb[_0x29f6('0x2e')]['name']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd3')];_0x24a7fb[_0x29f6('0x2e')][_0x29f6('0xd4')]=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd5')];_0x24a7fb['body']['type']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd6')];return db[_0x29f6('0xd7')][_0x29f6('0xb9')](_0x24a7fb[_0x29f6('0x2e')])[_0x29f6('0x14')](respondWithResult(_0x454c4c,0xc9))[_0x29f6('0x39')](handleError(_0x454c4c,null));};exports[_0x29f6('0xd8')]=function(_0x3d131a,_0x2bc181){return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d131a[_0x29f6('0xb5')]['id']},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null))[_0x29f6('0x14')](function(_0x583f5f){if(_0x583f5f){if(_0x583f5f[_0x29f6('0x40')]){return _0x2bc181[_0x29f6('0x25')](0x193)[_0x29f6('0x20')]({'status':0x193,'message':_0x29f6('0xd9')});}return db[_0x29f6('0xd7')]['findOne']({'where':{'id':_0x3d131a[_0x29f6('0x48')][_0x29f6('0xda')]},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null));}})['then'](function(_0x2378b8){if(_0x2378b8){var _0x2a5414=_0x2378b8[_0x29f6('0xdb')]!==null;var _0x189048=path['join'](config[_0x29f6('0xdc')],'server/files/attachments/');if(_0x2a5414){_0x189048=path[_0x29f6('0xdd')](_0x189048,'offline-chat/');}var _0x2aa18b=path[_0x29f6('0xdd')](_0x189048,_0x2378b8[_0x29f6('0xd4')]);return _0x2bc181[_0x29f6('0xde')](_0x2aa18b);}})['catch'](handleError(_0x2bc181,null));};exports[_0x29f6('0xdf')]=function(_0x2216ef,_0x4577ee){var _0x2ef994=null;var _0x28e4c5=null;var _0x168724=null;if(_0x2216ef[_0x29f6('0x2e')]['id']){delete _0x2216ef[_0x29f6('0x2e')]['id'];}if(_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')]){_0x168724=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server/files/chat/upload/',util[_0x29f6('0xe1')](_0x29f6('0xe2'),Date[_0x29f6('0xe3')]()));_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe4')]=_0x168724;}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x2216ef[_0x29f6('0xb5')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x29f6('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x29f6('0x14')](handleEntityNotFound(_0x4577ee,null))['then'](saveUpdates(_0x2216ef[_0x29f6('0x2e')],null))[_0x29f6('0x14')](function(_0x4a3381){if(_0x4a3381){_0x2ef994=_0x4a3381;return db[_0x29f6('0xbe')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994[_0x29f6('0x7a')]}});}})[_0x29f6('0x14')](function(_0xdb766a){if(_0xdb766a){_0x28e4c5=_0xdb766a;return db[_0x29f6('0xe6')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994['ContactId']}});}})[_0x29f6('0x14')](function(_0x37735f){if(_0x37735f){if(_0x168724){var _0x399aed=null;for(var _0xe432b0=0x1;_0xe432b0<_0x2ef994[_0x29f6('0xe5')][_0x29f6('0x4e')];++_0xe432b0){_0x399aed=_0x2ef994['Messages'][_0xe432b0];var _0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):_0x29f6('0xe9');var _0x46a5da=_0x2216ef['body'][_0x29f6('0xea')]||util['format']('%s%d',_0x29f6('0xeb'),_0x399aed[_0x29f6('0x72')]);switch(_0x28e4c5[_0x29f6('0xec')]){case _0x29f6('0xed'):_0x21bc96=_0x399aed['UserId']?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed[_0x29f6('0x3f')]):_0x29f6('0xe9');break;case _0x29f6('0xee'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed[_0x29f6('0xef')][_0x29f6('0xf0')]||_0x399aed[_0x29f6('0xef')][_0x29f6('0x33')]:_0x29f6('0xe9');break;case _0x29f6('0xf1'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed['User']['fullname']:_0x29f6('0xe9');break;default:_0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):'System';}var _0x593d86=util[_0x29f6('0xe1')](_0x29f6('0xf2'),moment(_0x399aed[_0x29f6('0x7d')])[_0x29f6('0xe1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x399aed[_0x29f6('0xf3')]==='in'?_0x46a5da:_0x21bc96,_0x399aed[_0x29f6('0x2e')]);if(!_0x399aed[_0x29f6('0xf4')]){fs[_0x29f6('0xf5')](_0x168724,_0x593d86);}}return db[_0x29f6('0xf6')][_0x29f6('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0x29f6('0xf7')],'as':_0x29f6('0xf8'),'raw':!![],'include':[{'model':db[_0x29f6('0xf9')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x29f6('0x14')](function(_0x294136){if(!_0x294136||!_0x294136[_0x29f6('0xf8')]||!_0x2216ef[_0x29f6('0x2e')])return _0x2ef994;var _0x59fb2a=_0x294136['getSmtpOptions']();return respondWithRpcPromise(_0x29f6('0xfa'),_0x29f6('0xfb'),{'account':_0x59fb2a,'message':{'from':util[_0x29f6('0xe1')](_0x29f6('0xfc'),_0x294136[_0x29f6('0x2a')],_0x294136['email']||_0x294136[_0x29f6('0xf8')][_0x29f6('0x9e')]),'to':_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')],'subject':_0x29f6('0xfd'),'text':util[_0x29f6('0xe1')](_0x29f6('0xfe'),_0x2216ef['body'][_0x29f6('0xe0')]),'attachments':[{'path':_0x168724}]}})[_0x29f6('0x14')](function(){return _0x2ef994;})[_0x29f6('0x39')](function(_0x3d027f){logger['error'](_0x3d027f);});})[_0x29f6('0x14')](respondWithStatusCode(_0x4577ee,0xc8))[_0x29f6('0x39')](handleError(_0x4577ee,null));};exports[_0x29f6('0xff')]=function(_0x2df557,_0x589222){return db[_0x29f6('0xcb')][_0x29f6('0xb8')]({'where':{'id':_0x2df557[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x589222,null))[_0x29f6('0x14')](function(_0x318fd1){if(_0x318fd1){return _0x318fd1[_0x29f6('0xff')](_0x2df557[_0x29f6('0x2e')]['ids'],_[_0x29f6('0x100')](_0x2df557[_0x29f6('0x2e')],['ids','id'])||{});}})['then'](respondWithResult(_0x589222,null))['catch'](handleError(_0x589222,null));};exports[_0x29f6('0x101')]=function(_0x29017d,_0x5863a2){var _0x2f7729={'raw':![],'where':{}};var _0x171342={};var _0x1dafb9={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x29017d['params']['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x5863a2,null))[_0x29f6('0x14')](function(_0x1207f7){if(_0x1207f7){_0x171342[_0x29f6('0x47')]=_[_0x29f6('0x49')](db[_0x29f6('0xcb')][_0x29f6('0x44')]);_0x171342[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x29017d[_0x29f6('0x48')]);_0x171342['filters']=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],_0x171342['query']);_0x2f7729[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x29017d[_0x29f6('0x48')]['fields']));_0x2f7729[_0x29f6('0x4c')]=_0x2f7729[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2f7729['attributes']:_0x171342['model'];if(!_0x29017d[_0x29f6('0x48')][_0x29f6('0x4f')](_0x29f6('0x102'))){_0x2f7729[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x29017d[_0x29f6('0x48')]['limit']);_0x2f7729['offset']=qs[_0x29f6('0x21')](_0x29017d[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x2f7729[_0x29f6('0x50')]=qs[_0x29f6('0x103')](_0x29017d[_0x29f6('0x48')]['sort']);_0x2f7729['where']=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x29017d[_0x29f6('0x48')],_0x171342['filters']));_0x2f7729['where']['ChatInteractionId']=_0x1207f7['id'];if(_0x29017d[_0x29f6('0x48')]['filter']){_0x2f7729[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x2f7729[_0x29f6('0x4c')],function(_0x25532f){var _0x31ebb3={};_0x31ebb3[_0x25532f]={'$like':'%'+_0x29017d[_0x29f6('0x48')][_0x29f6('0x88')]+'%'};return _0x31ebb3;})});}if(_0x29017d['query'][_0x29f6('0x104')]){var _0x173977=_0x29017d['query'][_0x29f6('0x104')][_0x29f6('0x36')](',');var _0x43acdc={};_0x43acdc[_0x173977[0x0]]={'$gte':moment(_0x173977[0x1])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2f7729['where']=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],_0x43acdc);}_0x2f7729=_[_0x29f6('0x2d')]({},_0x2f7729,_0x29017d[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x2f7729['where']})[_0x29f6('0x14')](function(_0x216ad8){_0x1dafb9['count']=_0x216ad8;if(_0x29017d['query']['includeAll']){_0x2f7729[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')][_0x29f6('0x106')](_0x2f7729);})[_0x29f6('0x14')](function(_0x2b1808){_0x1dafb9['rows']=_0x2b1808;return _0x1dafb9;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x5863a2,_0x2f7729))[_0x29f6('0x39')](handleError(_0x5863a2,null));};exports[_0x29f6('0x107')]=function(_0x3d68f3,_0x1cb0c0){var _0x47e4e5={'where':{}},_0x3a19d2={},_0x3450c3={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d68f3[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1cb0c0,null))[_0x29f6('0x14')](function(_0x6a318b){if(_0x6a318b){_0x3a19d2['model']=_[_0x29f6('0x49')](db[_0x29f6('0xcb')]['rawAttributes']);_0x3a19d2[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x3d68f3[_0x29f6('0x48')]);_0x3a19d2['filters']=_['intersection'](_0x3a19d2['model'],_0x3a19d2['query']);_0x47e4e5[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x3a19d2[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x47e4e5[_0x29f6('0x4c')]=_0x47e4e5[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x47e4e5[_0x29f6('0x4c')]:_0x3a19d2['model'];if(!_0x3d68f3[_0x29f6('0x48')]['hasOwnProperty'](_0x29f6('0x102'))){_0x47e4e5[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x23')]);_0x47e4e5[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x47e4e5['order']=qs['sort'](_0x3d68f3[_0x29f6('0x48')]['sort']);_0x47e4e5[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x3d68f3[_0x29f6('0x48')],_0x3a19d2[_0x29f6('0x4a')]));_0x47e4e5['where'][_0x29f6('0xb2')]=_0x6a318b['id'];if(_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x88')]){_0x47e4e5[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x47e4e5[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x47e4e5[_0x29f6('0x4c')],function(_0x346ece){var _0xc22605={};_0xc22605[_0x346ece]={'$like':'%'+_0x3d68f3[_0x29f6('0x48')]['filter']+'%'};return _0xc22605;})});}_0x47e4e5[_0x29f6('0x51')]['secret']=![];if(_0x3d68f3[_0x29f6('0x48')]['id']){_0x47e4e5[_0x29f6('0x51')]['id']={'$gt':_0x3d68f3['query']['id']};}_0x47e4e5=_['merge']({},_0x47e4e5,_0x3d68f3[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x47e4e5[_0x29f6('0x51')]})[_0x29f6('0x14')](function(_0x15db8c){_0x3450c3[_0x29f6('0x24')]=_0x15db8c;_0x47e4e5[_0x29f6('0xb7')]=[];if(_0x3d68f3['query']['includeAgent']){_0x47e4e5[_0x29f6('0xb7')]['push']({'model':db[_0x29f6('0xef')],'as':_0x29f6('0xef'),'attributes':['id','fullname',_0x29f6('0xf0')]});}if(_0x3d68f3[_0x29f6('0x48')]['includeAll']){_0x47e4e5[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')]['findAll'](_0x47e4e5);})['then'](function(_0x37c860){_0x3450c3[_0x29f6('0xb3')]=_0x37c860;return _0x3450c3;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x1cb0c0,_0x47e4e5))[_0x29f6('0x39')](handleError(_0x1cb0c0,null));};exports[_0x29f6('0x108')]=function(_0x371548,_0x7a0ebf){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x371548[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x7a0ebf,null))[_0x29f6('0x14')](function(_0x1e05e2){if(_0x1e05e2){return _0x1e05e2[_0x29f6('0x109')](_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')],_[_0x29f6('0x100')](_0x371548[_0x29f6('0x2e')],[_0x29f6('0x10a'),'id'])||{})[_0x29f6('0x10b')](function(){return db[_0x29f6('0x76')]['findAll']({'attributes':['id',_0x29f6('0x2a'),_0x29f6('0x10c')],'where':{'id':_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')]}});})['then'](function(_0x5248ba){socket[_0x29f6('0x10d')](_0x29f6('0x10e'),{'id':Number(_0x371548[_0x29f6('0xb5')]['id']),'tags':_0x5248ba||[]});return{'id':Number(_0x371548['params']['id']),'tags':_0x5248ba||[]};});}})[_0x29f6('0x14')](respondWithResult(_0x7a0ebf,null))[_0x29f6('0x39')](handleError(_0x7a0ebf,null));};exports[_0x29f6('0x10f')]=function(_0x47028e,_0x410ab5){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x47028e[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x410ab5,null))[_0x29f6('0x14')](function(_0x281c49){if(_0x281c49){return _0x281c49[_0x29f6('0x10f')](_0x47028e[_0x29f6('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x410ab5,null))[_0x29f6('0x39')](handleError(_0x410ab5,null));};exports['download']=function(_0x5250bc,_0x31ba94){var _0x31dcfe=moment()[_0x29f6('0x110')]()[_0x29f6('0xa0')]();var _0x5cf3d4=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],_0x29f6('0x111'),'files',_0x29f6('0x112'));var _0x5dcaf2=path['join'](config['root'],'server',_0x29f6('0x113'),_0x29f6('0x114'));var _0xcf75fe=path[_0x29f6('0xdd')](_0x5cf3d4,_0x31dcfe);var _0x48ecb0=util['format']('transcript-%d-%s.zip',_0x5250bc[_0x29f6('0xb5')]['id'],_0x31dcfe);var _0x5de30e=path[_0x29f6('0xdd')](_0x5cf3d4,_0x48ecb0);var _0x10989a=[];_0x10989a[_0x29f6('0x38')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x10989a[_0x29f6('0x38')]({'model':db[_0x29f6('0xe6')],'as':_0x29f6('0x6d'),'attributes':['id',_0x29f6('0x115'),_0x29f6('0x116')],'raw':!![]});if(_0x5250bc['query'][_0x29f6('0x114')]){_0x10989a[_0x29f6('0x38')]({'model':db['Attachment'],'as':_0x29f6('0xd7'),'raw':!![]});}var _0x15c951=[{'model':db[_0x29f6('0xcb')],'as':'Messages','attributes':['id','body',_0x29f6('0x7d'),'direction',_0x29f6('0xf4'),_0x29f6('0x117')],'include':_0x10989a}];_0x15c951['push']({'model':db['ChatWebsite'],'as':_0x29f6('0x118'),'attributes':['id',_0x29f6('0x2a')]});_0x15c951[_0x29f6('0x38')]({'model':db['User'],'as':_0x29f6('0x119'),'attributes':['id',_0x29f6('0x33')]});return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x5250bc[_0x29f6('0xb5')]['id']},'include':_0x15c951})['then'](handleEntityNotFound(_0x31ba94,null))[_0x29f6('0x14')](function(_0x4ad41d){if(_0x4ad41d){var _0x598bcd=_0x4ad41d['get']({'plain':!![]});fs['mkdirSync'](_0xcf75fe);var _0x53751c={'channel':_0x29f6('0x11a'),'account':_0x598bcd['Account'][_0x29f6('0x2a')],'agent':_0x598bcd[_0x29f6('0x119')]?_0x598bcd[_0x29f6('0x119')][_0x29f6('0x33')]:_0x29f6('0x11b'),'createdAt':moment(_0x598bcd['createdAt'])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'closedAt':_0x598bcd['closed']?moment(_0x598bcd[_0x29f6('0x11d')])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29f6('0xa0')]():'','disposition':_0x598bcd['disposition'],'chatInfo':{'browser':_0x598bcd[_0x29f6('0x11e')],'os':_0x598bcd[_0x29f6('0x11f')],'referer':_0x598bcd[_0x29f6('0x120')],'customerIp':_0x598bcd[_0x29f6('0x121')],'customerPort':_0x598bcd[_0x29f6('0x122')]?_0x598bcd[_0x29f6('0x122')]:_0x29f6('0x11b')},'messages':_(_0x598bcd[_0x29f6('0xe5')])[_0x29f6('0x123')]()[_0x29f6('0x88')]({'secret':![]})[_0x29f6('0x32')](function(_0x2fd414){if(_0x2fd414['Attachment']){var _0x49c5f6=path[_0x29f6('0xdd')](_0x5dcaf2,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]);if(fs[_0x29f6('0x124')](_0x49c5f6)){fs[_0x29f6('0x125')](_0x49c5f6)[_0x29f6('0x126')](fs[_0x29f6('0x127')](path[_0x29f6('0xdd')](_0xcf75fe,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')])));}}return{'date':moment(_0x2fd414[_0x29f6('0x7d')])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'sender':_0x2fd414[_0x29f6('0xf3')]===_0x29f6('0x128')?_0x2fd414[_0x29f6('0xef')]?_0x2fd414[_0x29f6('0xef')]['fullname']:_0x29f6('0xe9'):_0x2fd414[_0x29f6('0x6d')]['firstName']+(_0x2fd414['Contact'][_0x29f6('0x116')]?'\x20'+_0x2fd414[_0x29f6('0x6d')][_0x29f6('0x116')]:''),'body':_0x2fd414[_0x29f6('0xd7')]?_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]:_0x2fd414[_0x29f6('0x2e')],'direction':_0x2fd414['direction']==='out'?'A':'C','secret':_0x2fd414['secret'],'read':_0x2fd414[_0x29f6('0x117')],'attachment':_0x2fd414[_0x29f6('0xd7')]};})[_0x29f6('0x69')]()};return ejs[_0x29f6('0x129')](path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server','views',_0x29f6('0x12a')),{'interaction':_0x53751c})[_0x29f6('0x14')](function(_0x3307a1){var _0x595aff=path[_0x29f6('0xdd')](_0xcf75fe,'transcript-'+_0x598bcd['id']+'-'+_0x31dcfe+_0x29f6('0x12b'));var _0x3101aa={'path':_0x595aff,'channel':'Chat','interactionId':_0x598bcd['id']};return pdf['createPdfFromHTML'](_0x3307a1,_0x3101aa);})[_0x29f6('0x14')](function(){return new Promise(function(_0x4c7b46,_0x41d45f){zipdir(_0xcf75fe,{'saveTo':_0x5de30e},function(_0x1f1679,_0x2dfc83){if(_0x1f1679)return _0x41d45f(_0x1f1679);return _0x4c7b46(_0x2dfc83);});})[_0x29f6('0x14')](function(){return new BPromise(function(_0x53cde9,_0x26eef7){rimraf(_0xcf75fe,function(_0x17b595){if(_0x17b595)_0x26eef7(_0x17b595);return _0x53cde9();});});})['then'](function(){return _0x31ba94[_0x29f6('0xde')](_0x5de30e,_0x48ecb0,function(_0x22fcde){if(_0x22fcde){logger[_0x29f6('0x1b')](_0x29f6('0x12c'),_0x22fcde);}else{fs['unlinkSync'](_0x5de30e);}});});});}else{return _0x31ba94[_0x29f6('0x1e')](0xc8);}})[_0x29f6('0x39')](handleError(_0x31ba94,null));};
\ No newline at end of file
+var _0xb43b=['i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','rawAttributes','includeAll','include','options','create','params','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','AbandonInteraction','file','basename','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','format','transcript-%s.txt','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','nolimit','$gte','findAll','getMyMessages','includeAgent','alias','spread','color','emit','chatInteractionTags:save','removeTags','server','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Account','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','osName','referer','createReadStream','pipe','createWriteStream','out','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','path','ejs','lodash','squel','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','offset','undefined','limit','count','set','json','update','stack','name','status','render','merge','body','contact','agent','interaction','account','Users','map','fullname','split','forEach','push','TagIds','talking','answered','unmanaged','abandoned','closed','UserId','waiting','disposition','total','index','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','pick','select','field','from','tools_tags','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','resolve'];(function(_0x583761,_0x119f81){var _0x4b72f0=function(_0x351cad){while(--_0x351cad){_0x583761['push'](_0x583761['shift']());}};_0x4b72f0(++_0x119f81);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5145bd,_0x2739d2){_0x5145bd=_0x5145bd-0x0;var _0x109bd1=_0xb43b[_0x5145bd];return _0x109bd1;};'use strict';var rimraf=require(_0xbb43('0x0'));var zipdir=require(_0xbb43('0x1'));var rp=require('request-promise');var moment=require(_0xbb43('0x2'));var BPromise=require(_0xbb43('0x3'));var Mustache=require(_0xbb43('0x4'));var util=require('util');var path=require(_0xbb43('0x5'));var ejs=require(_0xbb43('0x6'));var fs=require('fs');var _=require(_0xbb43('0x7'));var squel=require(_0xbb43('0x8'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xbb43('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xbb43('0xa'))(_0xbb43('0xb'));var config=require(_0xbb43('0xc'));var db=require(_0xbb43('0xd'))['db'];config[_0xbb43('0xe')]=_['defaults'](config[_0xbb43('0xe')],{'host':_0xbb43('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb43('0xe')]));require(_0xbb43('0x10'))[_0xbb43('0x11')](socket);var jayson=require(_0xbb43('0x12'));var client=jayson[_0xbb43('0x13')][_0xbb43('0x14')]({'port':0x232b});var client9004=jayson['client'][_0xbb43('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x2a5a4d,_0x50e2c0,_0x578392,_0x41e7e5){return new BPromise(function(_0x4a3714,_0x593d0b){var _0x438591=_0x41e7e5||client;return _0x438591['request'](_0x2a5a4d,_0x578392)[_0xbb43('0x15')](function(_0x43021d){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x50e2c0,'request\x20sent');logger[_0xbb43('0x16')](_0xbb43('0x17'),_0x50e2c0,'request\x20sent',JSON['stringify'](_0x43021d));if(_0x43021d[_0xbb43('0x18')]){if(_0x43021d['error']['code']===0x1f4){logger[_0xbb43('0x18')](_0xbb43('0x19'),_0x50e2c0,_0x43021d[_0xbb43('0x18')]['message']);return _0x593d0b(_0x43021d[_0xbb43('0x18')]['message']);}logger[_0xbb43('0x18')](_0xbb43('0x19'),_0x50e2c0,_0x43021d['error']['message']);return _0x4a3714(_0x43021d[_0xbb43('0x18')][_0xbb43('0x1a')]);}else{logger[_0xbb43('0x1b')](_0xbb43('0x19'),_0x50e2c0,'request\x20sent');_0x4a3714(_0x43021d[_0xbb43('0x1c')]['message']);}})[_0xbb43('0x1d')](function(_0x4bfaca){logger[_0xbb43('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x50e2c0,_0x4bfaca);_0x593d0b(_0x4bfaca);});});}function respondWithStatusCode(_0x3f323e,_0x451cbd){_0x451cbd=_0x451cbd||0xcc;return function(_0x577ddd){if(_0x577ddd){return _0x3f323e[_0xbb43('0x1e')](_0x451cbd);}return _0x3f323e['status'](_0x451cbd)[_0xbb43('0x1f')]();};}function respondWithResult(_0x298ce2,_0x16384e){_0x16384e=_0x16384e||0xc8;return function(_0x4d6d77){if(_0x4d6d77){return _0x298ce2['status'](_0x16384e)['json'](_0x4d6d77);}};}function respondWithFilteredResult(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(_0x5d8310){var _0x3b3083=typeof _0x32d7f0[_0xbb43('0x20')]===_0xbb43('0x21')&&typeof _0x32d7f0[_0xbb43('0x22')]==='undefined';var _0x4b5342=_0x5d8310[_0xbb43('0x23')];var _0x42800f=_0x3b3083?0x0:_0x32d7f0[_0xbb43('0x20')];var _0x8b3205=_0x3b3083?_0x5d8310[_0xbb43('0x23')]:_0x32d7f0[_0xbb43('0x20')]+_0x32d7f0[_0xbb43('0x22')];var _0x473828;if(_0x8b3205>=_0x4b5342){_0x8b3205=_0x4b5342;_0x473828=0xc8;}else{_0x473828=0xce;}_0x269ca5['status'](_0x473828);return _0x269ca5[_0xbb43('0x24')]('Content-Range',_0x42800f+'-'+_0x8b3205+'/'+_0x4b5342)[_0xbb43('0x25')](_0x5d8310);}return null;};}function saveUpdates(_0x436fd5){return function(_0x34f5b2){if(_0x34f5b2){return _0x34f5b2[_0xbb43('0x26')](_0x436fd5)['then'](function(_0x157d62){return _0x157d62;});}return null;};}function removeEntity(_0x547a6f){return function(_0x5566cf){if(_0x5566cf){return _0x5566cf['destroy']()[_0xbb43('0x15')](function(){_0x547a6f['status'](0xcc)[_0xbb43('0x1f')]();});}};}function handleEntityNotFound(_0x4511d9){return function(_0xc577ac){if(!_0xc577ac){_0x4511d9['sendStatus'](0x194);}return _0xc577ac;};}function handleError(_0x205011,_0x1bdf91){_0x1bdf91=_0x1bdf91||0x1f4;return function(_0x46650c){logger[_0xbb43('0x18')](_0x46650c[_0xbb43('0x27')]);if(_0x46650c[_0xbb43('0x28')]){delete _0x46650c[_0xbb43('0x28')];}_0x205011[_0xbb43('0x29')](_0x1bdf91)['send'](_0x46650c);};}function getMustacheRender(_0x2109aa,_0x3961f5){return Mustache[_0xbb43('0x2a')](_0x2109aa,_[_0xbb43('0x2b')](_0x3961f5[_0xbb43('0x2c')],{'contact':_0x3961f5[_0xbb43('0x2d')],'message':_0x3961f5[_0xbb43('0x1a')],'agent':_0x3961f5[_0xbb43('0x2e')],'interaction':_0x3961f5[_0xbb43('0x2f')],'account':_0x3961f5[_0xbb43('0x30')]}))||'';}function getInteractionUsers(_0x21346a,_0x18debb){return new BPromise(function(_0x2b87c7,_0x33f45c){try{if(_0x18debb[_0x21346a['id']]){_0x21346a[_0xbb43('0x31')]=_[_0xbb43('0x32')](_0x18debb[_0x21346a['id']],function(_0x549841){return{'id':_0x549841['id'],'fullname':_0x549841[_0xbb43('0x33')]};});}}catch(_0x2d2056){_0x33f45c(_0x2d2056);}_0x2b87c7(_0x21346a);});}function getInteractionTags(_0x52a694,_0x285014){return new BPromise(function(_0x2c9a7c,_0x11d384){try{if(_0x52a694['TagIds']){_0x52a694['Tags']=[];_0x52a694['TagIds'][_0xbb43('0x34')](',')[_0xbb43('0x35')](function(_0x4a95c3){_0x52a694['Tags'][_0xbb43('0x36')](_0x285014[_0x4a95c3]);});}delete _0x52a694[_0xbb43('0x37')];}catch(_0x29f6e5){_0x11d384(_0x29f6e5);}_0x2c9a7c(_0x52a694);});}function updateChatInteraction(_0x37afbb,_0x3f9e7f,_0x5edacc){return new BPromise(function(_0x249b6a,_0x526cb8){return getInteractionUsers(_0x37afbb,_0x5edacc)[_0xbb43('0x15')](function(_0x3340aa){return getInteractionTags(_0x3340aa,_0x3f9e7f);})[_0xbb43('0x15')](function(_0x531d96){return getStateInteraction(_0x531d96);})[_0xbb43('0x15')](function(_0x4f0f13){_0x249b6a(_0x4f0f13);})[_0xbb43('0x1d')](function(_0x93aa1c){_0x526cb8(_0x93aa1c);});});}function getStateInteraction(_0x56c808){return new BPromise(function(_0x4783fe){_0x56c808['waiting']=0x0;_0x56c808[_0xbb43('0x38')]=0x0;_0x56c808[_0xbb43('0x39')]=0x0;_0x56c808[_0xbb43('0x3a')]=0x0;_0x56c808[_0xbb43('0x3b')]=0x0;_0x56c808['total']=0x0;if(!_0x56c808[_0xbb43('0x3c')]&&!_0x56c808[_0xbb43('0x3d')]){_0x56c808['waiting']+=0x1;}if(!_0x56c808[_0xbb43('0x3c')]&&_0x56c808['UserId']){_0x56c808[_0xbb43('0x38')]+=0x1;if(_0x56c808[_0xbb43('0x3e')]){_0x56c808[_0xbb43('0x3e')]-=0x1;}}if(_0x56c808[_0xbb43('0x3c')]&&_0x56c808[_0xbb43('0x3f')]===_0xbb43('0x3b')){_0x56c808['abandoned']+=0x1;if(_0x56c808[_0xbb43('0x3e')]){_0x56c808['waiting']-=0x1;}}else if(_0x56c808[_0xbb43('0x3c')]&&!_0x56c808[_0xbb43('0x3d')]&&_0x56c808[_0xbb43('0x3f')]){_0x56c808[_0xbb43('0x3a')]+=0x1;if(_0x56c808['waiting']){_0x56c808[_0xbb43('0x3e')]-=0x1;}}else if(_0x56c808[_0xbb43('0x3c')]&&_0x56c808[_0xbb43('0x3d')]){_0x56c808[_0xbb43('0x39')]+=0x1;if(_0x56c808[_0xbb43('0x38')]){_0x56c808[_0xbb43('0x38')]-=0x1;}}_0x56c808[_0xbb43('0x40')]+=0x1;_0x4783fe(_0x56c808);});}exports[_0xbb43('0x41')]=function(_0x5a662b,_0x2eaece){var _0x8c57af={},_0x4898b2={},_0x1a66f0={'count':0x0,'rows':[]};var _0x5d4c19=_['map'](db['ChatInteraction']['rawAttributes'],function(_0x1c3482){return{'name':_0x1c3482['fieldName'],'type':_0x1c3482[_0xbb43('0x42')]['key']};});_0x4898b2[_0xbb43('0x43')]=_[_0xbb43('0x32')](_0x5d4c19,_0xbb43('0x28'));_0x4898b2['query']=_[_0xbb43('0x44')](_0x5a662b['query']);_0x4898b2[_0xbb43('0x45')]=_[_0xbb43('0x46')](_0x4898b2[_0xbb43('0x43')],_0x4898b2[_0xbb43('0x47')]);_0x8c57af[_0xbb43('0x48')]=_[_0xbb43('0x46')](_0x4898b2[_0xbb43('0x43')],qs['fields'](_0x5a662b[_0xbb43('0x47')][_0xbb43('0x49')]));_0x8c57af[_0xbb43('0x48')]=_0x8c57af[_0xbb43('0x48')]['length']?_0x8c57af[_0xbb43('0x48')]:_0x4898b2[_0xbb43('0x43')];if(!_0x5a662b[_0xbb43('0x47')][_0xbb43('0x4a')]('nolimit')){_0x8c57af[_0xbb43('0x22')]=qs[_0xbb43('0x22')](_0x5a662b[_0xbb43('0x47')]['limit']);_0x8c57af[_0xbb43('0x20')]=qs[_0xbb43('0x20')](_0x5a662b[_0xbb43('0x47')][_0xbb43('0x20')]);}_0x8c57af[_0xbb43('0x4b')]=qs['sort'](_0x5a662b['query'][_0xbb43('0x4c')]);_0x8c57af['where']=qs[_0xbb43('0x45')](_[_0xbb43('0x4d')](_0x5a662b['query'],_0x4898b2[_0xbb43('0x45')]),_0x5d4c19);var _0x3719dc=[];var _0x39dc59=squel[_0xbb43('0x4e')]()[_0xbb43('0x4f')]('id')['field'](_0xbb43('0x28'))['field']('color')[_0xbb43('0x50')](_0xbb43('0x51'));var _0x182c9b=squel[_0xbb43('0x4e')]()[_0xbb43('0x4f')]('u.id')['field'](_0xbb43('0x52'))[_0xbb43('0x4f')](_0xbb43('0x53'))[_0xbb43('0x50')](_0xbb43('0x54'),'ui')[_0xbb43('0x55')](_0xbb43('0x56'),'u',_0xbb43('0x57'));var _0x1a3f98=squel['select']()[_0xbb43('0x50')](_0xbb43('0x58'),'i')[_0xbb43('0x55')](_0xbb43('0x59'),'c',_0xbb43('0x5a'))[_0xbb43('0x55')](_0xbb43('0x56'),'o',_0xbb43('0x5b'))[_0xbb43('0x55')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0xbb43('0x55')](_0xbb43('0x5c'),'me',_0xbb43('0x5d'))[_0xbb43('0x55')](_0xbb43('0x5e'),'it',_0xbb43('0x5f'))[_0xbb43('0x55')]('tools_tags','t',_0xbb43('0x60'));var _0x599eec=squel['expr']();var _0x1decf2=[];var _0x1f626a=squel[_0xbb43('0x61')]();var _0x22ce17;if(_0x5a662b[_0xbb43('0x47')][_0xbb43('0x62')]){_0x22ce17=as[_0xbb43('0x63')](_0x5a662b[_0xbb43('0x47')]['search']);var _0x4f2631=_0x22ce17[_0xbb43('0x64')];for(var _0x2b96b8=0x0;_0x2b96b8<_0x22ce17[_0xbb43('0x65')][_0xbb43('0x66')];_0x2b96b8++){var _0x1a3cdc=_0x22ce17[_0xbb43('0x65')][_0x2b96b8];var _0x12717e='i';var _0x404e22=_[_0xbb43('0x67')](_0x5d4c19,['name',_0x1a3cdc[_0xbb43('0x4f')]]);if(!_0x404e22){switch(_0x1a3cdc[_0xbb43('0x4f')]){case _0xbb43('0x68'):if(_0x1a3cdc[_0xbb43('0x69')]==0x1){_0x1a3f98[_0xbb43('0x6a')]('`'+_0x1a3cdc[_0xbb43('0x4f')]+'`\x20=\x200');}else{_0x1a3f98[_0xbb43('0x6a')]('`'+_0x1a3cdc[_0xbb43('0x4f')]+_0xbb43('0x6b'));}break;case _0xbb43('0x6c'):if(_0x1a3cdc[_0xbb43('0x6d')]==='$substring'){if(_0x1a3cdc[_0xbb43('0x69')][_0xbb43('0x34')]('\x20')[_0xbb43('0x66')]>0x1){_0x599eec[_0x4f2631](_0xbb43('0x6e'),qs[_0xbb43('0x6f')](_0x1a3cdc[_0xbb43('0x69')]),null);}else{var _0x2bd30e='%'+_0x1a3cdc[_0xbb43('0x69')]+'%';_0x599eec[_0x4f2631](_0xbb43('0x70'),_0x2bd30e,_0x2bd30e,_0x2bd30e);}}else{_0x404e22=_[_0xbb43('0x67')](_0x5d4c19,['name',_0xbb43('0x71')]);_0x1a3cdc['field']=_0xbb43('0x71');_0x3e4619=as[_0xbb43('0x72')](_0x12717e,_0x404e22[_0xbb43('0x42')],_0x1a3cdc);_0x599eec[_0x4f2631](_0x3e4619[_0xbb43('0x73')],_0x3e4619[_0xbb43('0x69')]['start'],_0x3e4619['value'][_0xbb43('0x1f')]);}break;case _0xbb43('0x74'):var _0x48f14a=_0x1a3cdc[_0xbb43('0x69')][_0xbb43('0x34')](',')[_0xbb43('0x32')](function(_0x52ca51){return Number(_0x52ca51);});_0x48f14a[_0xbb43('0x35')](function(_0x298a77){_0x1f626a['or'](_0xbb43('0x75'),'%,'+_0x298a77+',%');});_0x1decf2=_[_0xbb43('0x76')](_0x1decf2,_0x48f14a);break;case _0xbb43('0x77'):if(_0x1a3cdc[_0xbb43('0x6d')]===_0xbb43('0x78')){_0x599eec[_0x4f2631](_0xbb43('0x79'),'%'+_0x1a3cdc[_0xbb43('0x69')]+'%',null);}else{_0x404e22=_[_0xbb43('0x67')](_0x5d4c19,['name','UserId']);_0x1a3cdc[_0xbb43('0x4f')]=_0xbb43('0x3d');_0x3e4619=as[_0xbb43('0x72')](_0x12717e,_0x404e22['type'],_0x1a3cdc);_0x599eec[_0x4f2631](_0x3e4619[_0xbb43('0x73')],_0x3e4619[_0xbb43('0x69')][_0xbb43('0x7a')],_0x3e4619[_0xbb43('0x69')][_0xbb43('0x1f')]);}break;case'body':_0x3e4619=as[_0xbb43('0x72')]('me',null,_0x1a3cdc);_0x599eec[_0x4f2631](_0x3e4619[_0xbb43('0x73')],_0x3e4619[_0xbb43('0x69')]['start'],_0x3e4619[_0xbb43('0x69')][_0xbb43('0x1f')]);break;}}else{var _0x3e4619=as[_0xbb43('0x72')](_0x12717e,_0x404e22[_0xbb43('0x42')],_0x1a3cdc);_0x599eec[_0x4f2631](_0x3e4619[_0xbb43('0x73')],_0x3e4619[_0xbb43('0x69')][_0xbb43('0x7a')],_0x3e4619[_0xbb43('0x69')][_0xbb43('0x1f')]);}}}else{var _0x445219=_(_0x5a662b['query'])[_0xbb43('0x44')]()[_0xbb43('0x32')](function(_0x2d439f){return _[_0xbb43('0x7b')](_0x5d4c19,[_0xbb43('0x28'),_0x2d439f])?_0x2d439f:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x445219)){_0x445219[_0xbb43('0x35')](function(_0x34e4d6){if(_0x34e4d6===_0xbb43('0x7c')){_0x1a3f98[_0xbb43('0x7d')](_0xbb43('0x7e'),[][_0xbb43('0x7f')](_0x5a662b[_0xbb43('0x47')][_0x34e4d6]));}else if(_0x34e4d6==='createdAt'){var _0x3a5d49=JSON[_0xbb43('0x80')](_0x5a662b[_0xbb43('0x47')][_0x34e4d6])['$gte'];var _0x26e95d=JSON['parse'](_0x5a662b[_0xbb43('0x47')][_0x34e4d6])['$lte'];_0x1a3f98[_0xbb43('0x7d')](_0xbb43('0x81'),_0x3a5d49,_0x26e95d);}else{if(_0x5a662b[_0xbb43('0x47')][_0x34e4d6]===_0xbb43('0x82')){_0x1a3f98[_0xbb43('0x7d')]('i.'+_0x34e4d6+_0xbb43('0x83'));}else{_0x1a3f98[_0xbb43('0x7d')]('i.'+_0x34e4d6+_0xbb43('0x84'),_0x5a662b['query'][_0x34e4d6]);}}});}if(_0x5a662b[_0xbb43('0x47')][_0xbb43('0x85')]){if(_0x5a662b['query'][_0xbb43('0x85')]==0x1){_0x1a3f98[_0xbb43('0x6a')](_0xbb43('0x86'));}else{_0x1a3f98['having'](_0xbb43('0x87'));}}if(_0x5a662b[_0xbb43('0x47')][_0xbb43('0x88')]){_0x1decf2=_[_0xbb43('0x89')](_0x5a662b[_0xbb43('0x47')][_0xbb43('0x88')])?_0x5a662b['query'][_0xbb43('0x88')]:new Array(_0x5a662b['query'][_0xbb43('0x88')]);_0x1decf2[_0xbb43('0x35')](function(_0x4b2a47){_0x1f626a['or'](_0xbb43('0x75'),'%,'+_0x4b2a47+',%');});}if(_0x5a662b[_0xbb43('0x47')]['filter']){var _0x4cee72=_0x5a662b[_0xbb43('0x47')][_0xbb43('0x8a')][_0xbb43('0x8b')]('\x5c','\x5c\x5c')[_0xbb43('0x8b')](/'/g,'\x27\x27');if(qs[_0xbb43('0x8c')](_0x4cee72)){_0x599eec['or'](_0xbb43('0x8d'),_0x4cee72+'%');}else{_0x599eec['or'](_0xbb43('0x8e'),qs[_0xbb43('0x6f')](_0x4cee72))['or'](_0xbb43('0x8f'),_0x4cee72+'%');}}}_0x1a3f98[_0xbb43('0x7d')](_0x599eec);_0x1a3f98['group'](_0xbb43('0x90'));var _0x104ce3={'type':db[_0xbb43('0x91')]['QueryTypes']['SELECT'],'raw':!![]};var _0xd6a304=_0x1a3f98[_0xbb43('0x92')]();_0xd6a304[_0xbb43('0x4f')](_0xbb43('0x90'));_0xd6a304['field'](_0xbb43('0x93'),'unreadMessages');if(_0x8c57af[_0xbb43('0x4b')]){_0x8c57af[_0xbb43('0x4b')][_0xbb43('0x35')](function(_0x5d606f){var _0x1451ec=_0x5d606f[0x0]===_0xbb43('0x94')?_0x5d606f[0x0]:'i.'+_0x5d606f[0x0];_0x1a3f98['order'](_0x1451ec,_0x5d606f[0x1]==='DESC'?![]:!![]);});}if(!_[_0xbb43('0x95')](_0x1decf2)){_0x1a3f98[_0xbb43('0x6a')](_0x1f626a);_0xd6a304[_0xbb43('0x7d')](_0xbb43('0x96'),_0x1decf2);}BPromise[_0xbb43('0x97')]()[_0xbb43('0x15')](function(){if(!_0x22ce17){if(_0x5a662b[_0xbb43('0x47')][_0xbb43('0x7c')])return;_0xd6a304['where'](_0xbb43('0x98'));_0x1a3f98[_0xbb43('0x7d')](_0xbb43('0x98'));return;}if(_0x5a662b[_0xbb43('0x99')]['role']!==_0xbb43('0x2e'))return;return _0x5a662b['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xbb43('0x15')](function(_0x40f913){if(_[_0xbb43('0x95')](_0x40f913)){_0xd6a304['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x1a3f98['where'](_0xbb43('0x9a'));}else{_0xd6a304[_0xbb43('0x7d')](_0xbb43('0x7e'),_[_0xbb43('0x32')](_0x40f913,'id'));_0x1a3f98[_0xbb43('0x7d')]('i.ChatWebsiteId\x20IN\x20?',_[_0xbb43('0x32')](_0x40f913,'id'));}});})['then'](function(){if(_0x5a662b[_0xbb43('0x99')]['role']==='agent'&&!_0x22ce17&&!_0x5a662b['query'][_0xbb43('0x7c')])return[];return db[_0xbb43('0x9b')]['query'](_0xd6a304[_0xbb43('0x9c')](),_0x104ce3);})[_0xbb43('0x15')](function(_0x134ca3){_0x1a66f0[_0xbb43('0x23')]=_0x134ca3[_0xbb43('0x66')];if(_0x1a66f0[_0xbb43('0x23')]===0x0)return[];return db[_0xbb43('0x9b')][_0xbb43('0x47')](_0x39dc59[_0xbb43('0x9c')](),_0x104ce3)[_0xbb43('0x15')](function(_0x20f767){_0x3719dc=_['keyBy'](_0x20f767,'id');_0x104ce3=_[_0xbb43('0x2b')](_0x104ce3,{'model':db[_0xbb43('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a662b[_0xbb43('0x47')][_0xbb43('0x49')]){_0x8c57af[_0xbb43('0x48')][_0xbb43('0x35')](function(_0x1852e0){_0x1a3f98[_0xbb43('0x4f')]('i.'+_0x1852e0);});}else{_0x1a3f98[_0xbb43('0x4f')](_0xbb43('0x93'),_0xbb43('0x68'));_0x1a3f98['field']('a.key',_0xbb43('0x9e'));_0x1a3f98[_0xbb43('0x4f')]('a.mandatoryDisposition',_0xbb43('0x9f'));_0x1a3f98['field'](_0xbb43('0xa0'),_0xbb43('0x94'));_0x1a3f98[_0xbb43('0x4f')](_0xbb43('0xa1'));_0x1a3f98[_0xbb43('0x4f')](_0xbb43('0xa2'),'Contact.firstName');_0x1a3f98[_0xbb43('0x4f')](_0xbb43('0xa3'),_0xbb43('0xa4'));_0x1a3f98[_0xbb43('0x4f')](_0xbb43('0xa5'),_0xbb43('0xa6'));_0x1a3f98[_0xbb43('0x4f')](_0xbb43('0xa7'),_0xbb43('0xa8'));_0x1a3f98[_0xbb43('0x4f')](_0xbb43('0xa9'),_0xbb43('0xaa'));_0x1a3f98[_0xbb43('0x4f')](_0xbb43('0xab'),_0xbb43('0xac'));_0x1a3f98['field'](_0xbb43('0xad'),_0xbb43('0xae'));_0x1a3f98['field']('o.internal',_0xbb43('0xaf'));_0x1a3f98['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbb43('0x37'));}if(_0x8c57af['limit'])_0x1a3f98[_0xbb43('0x22')](_0x8c57af[_0xbb43('0x22')]);if(_0x8c57af[_0xbb43('0x20')])_0x1a3f98[_0xbb43('0x20')](_0x8c57af['offset']);return db[_0xbb43('0x9b')][_0xbb43('0x47')](_0x1a3f98[_0xbb43('0x9c')](),_0x104ce3);})['then'](function(_0x263d28){if(_0x263d28[_0xbb43('0x66')]>0x0)_0x182c9b['where'](_0xbb43('0xb0'),_[_0xbb43('0x32')](_0x263d28,'id'));return db[_0xbb43('0x9b')][_0xbb43('0x47')](_0x182c9b[_0xbb43('0x9c')](),_0x104ce3)[_0xbb43('0x15')](function(_0x457e5b){var _0x134c3b=_[_0xbb43('0xb1')](_0x457e5b,_0xbb43('0xb2'));var _0xda0e5d=[];_0x263d28[_0xbb43('0x35')](function(_0x2aef2f){_0xda0e5d[_0xbb43('0x36')](updateChatInteraction(_0x2aef2f,_0x3719dc,_0x134c3b));});return BPromise['all'](_0xda0e5d);});});})[_0xbb43('0x15')](function(_0x1e757f){_0x1a66f0[_0xbb43('0xb3')]=_0x1e757f;return _0x1a66f0;})[_0xbb43('0x15')](respondWithFilteredResult(_0x2eaece,_0x8c57af))['catch'](handleError(_0x2eaece,null));};exports[_0xbb43('0xb4')]=function(_0xd3af99,_0x44f9a8){var _0x2745a6={'raw':![],'where':{'id':_0xd3af99['params']['id']}},_0x3dc08f={};_0x3dc08f[_0xbb43('0x43')]=_[_0xbb43('0x44')](db['ChatInteraction'][_0xbb43('0xb5')]);_0x3dc08f[_0xbb43('0x47')]=_['keys'](_0xd3af99[_0xbb43('0x47')]);_0x3dc08f[_0xbb43('0x45')]=_[_0xbb43('0x46')](_0x3dc08f[_0xbb43('0x43')],_0x3dc08f[_0xbb43('0x47')]);_0x2745a6['attributes']=_[_0xbb43('0x46')](_0x3dc08f[_0xbb43('0x43')],qs[_0xbb43('0x49')](_0xd3af99[_0xbb43('0x47')][_0xbb43('0x49')]));_0x2745a6['attributes']=_0x2745a6[_0xbb43('0x48')]['length']?_0x2745a6['attributes']:_0x3dc08f[_0xbb43('0x43')];if(_0xd3af99[_0xbb43('0x47')][_0xbb43('0xb6')]){_0x2745a6[_0xbb43('0xb7')]=[{'all':!![]}];}_0x2745a6=_[_0xbb43('0x2b')]({},_0x2745a6,_0xd3af99[_0xbb43('0xb8')]);return db['ChatInteraction']['find'](_0x2745a6)['then'](handleEntityNotFound(_0x44f9a8,null))[_0xbb43('0x15')](respondWithResult(_0x44f9a8,null))[_0xbb43('0x1d')](handleError(_0x44f9a8,null));};exports[_0xbb43('0xb9')]=function(_0x3b7b8e,_0x10b34b){return db[_0xbb43('0x9d')][_0xbb43('0xb9')](_0x3b7b8e[_0xbb43('0x2c')],{})['then'](respondWithResult(_0x10b34b,0xc9))[_0xbb43('0x1d')](handleError(_0x10b34b,null));};exports['update']=function(_0x6510ee,_0x4c5500){if(_0x6510ee[_0xbb43('0x2c')]['id']){delete _0x6510ee[_0xbb43('0x2c')]['id'];}return db[_0xbb43('0x9d')][_0xbb43('0x67')]({'where':{'id':_0x6510ee[_0xbb43('0xba')]['id']}})[_0xbb43('0x15')](handleEntityNotFound(_0x4c5500,null))[_0xbb43('0x15')](saveUpdates(_0x6510ee['body'],null))[_0xbb43('0x15')](respondWithResult(_0x4c5500,null))[_0xbb43('0x1d')](handleError(_0x4c5500,null));};exports[_0xbb43('0xbb')]=function(_0x45d407,_0x53549d){return db[_0xbb43('0x9d')]['find']({'where':{'id':_0x45d407[_0xbb43('0xba')]['id']}})[_0xbb43('0x15')](handleEntityNotFound(_0x53549d,null))[_0xbb43('0x15')](removeEntity(_0x53549d,null))[_0xbb43('0x1d')](handleError(_0x53549d,null));};exports[_0xbb43('0xbc')]=function(_0x1a1e9e,_0xe0b935){return db[_0xbb43('0x9d')][_0xbb43('0xbc')]()['then'](respondWithResult(_0xe0b935,null))[_0xbb43('0x1d')](handleError(_0xe0b935,null));};exports[_0xbb43('0xbd')]=function(_0x2733f4,_0x4933f7){var _0x3e1bc0=_0x2733f4['params']['id'];var _0x50c68e;var _0x12d058;var _0x17d7c4;return db['ChatInteraction'][_0xbb43('0xbe')]({'where':{'id':_0x3e1bc0}})['then'](function(_0x2d1b62){_0x50c68e=_0x2d1b62;return db[_0xbb43('0xbf')][_0xbb43('0xbe')]({'where':{'id':_0x2d1b62['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xbb43('0xc0'),_0xbb43('0xc1'),_0xbb43('0xc2')],'raw':!![]});})[_0xbb43('0x15')](function(_0x13dfba){if(_0x13dfba&&_0x13dfba['vidaooApiKey']&&_0x13dfba[_0xbb43('0xc3')]){_0x12d058=_0x13dfba;var _0x7271d0={'interaction':{'id':_0x3e1bc0},'agent':{'id':_0x2733f4[_0xbb43('0x99')]['id'],'name':_0x2733f4[_0xbb43('0x99')][_0xbb43('0x28')],'fullname':_0x2733f4[_0xbb43('0x99')]['fullname'],'email':_0x2733f4['user'][_0xbb43('0xc4')]},'contact':_0x2733f4[_0xbb43('0x2c')]['contact'],'account':_0x2733f4['body'][_0xbb43('0x30')]};var _0x543bd5={'rejectUnauthorized':![],'method':_0xbb43('0xc5'),'url':_0xbb43('0xc6'),'headers':{'X-APIKEY':_0x13dfba[_0xbb43('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2733f4[_0xbb43('0x99')]['email']],'buttons':null,'topic':_0x12d058[_0xbb43('0xc0')],'note':_[_0xbb43('0xc8')](_0x12d058[_0xbb43('0xc1')])?null:getMustacheRender(_0x12d058[_0xbb43('0xc1')],_0x7271d0),'metadata':null},'redirect':_0xbb43('0xc9'),'json':!![]};try{if(!_[_0xbb43('0xc8')](_0x12d058['vidaooMetadata'])){var _0x493308=getMustacheRender(_0x12d058[_0xbb43('0xc2')],_0x7271d0);var _0x3a8237=JSON[_0xbb43('0x80')](_0x493308);_0x543bd5[_0xbb43('0x2c')][_0xbb43('0xca')]=_0x3a8237;}}catch(_0x51d255){throw new db['Sequelize'][(_0xbb43('0xcb'))](_0xbb43('0xcc'));}return rp(_0x543bd5);}else{throw new db[(_0xbb43('0x91'))]['ValidationError'](_0xbb43('0xcd'));}})[_0xbb43('0x15')](function(_0x3c4059){_0x17d7c4=_0x3c4059;if(_0x17d7c4['id']){var _0x4bc906={'body':_0x17d7c4[_0xbb43('0xce')],'ChatWebsiteId':_0x12d058['id'],'ChatInteractionId':_0x50c68e['id'],'direction':'out','UserId':_0x2733f4[_0xbb43('0x99')]['id']};return db[_0xbb43('0xcf')][_0xbb43('0xb9')](_0x4bc906,{});}else{throw new db['Sequelize'][(_0xbb43('0xcb'))](_0xbb43('0xd0'));}})[_0xbb43('0x15')](function(){return _0x50c68e[_0xbb43('0xd1')]({'vidaooSessionId':_0x17d7c4['id']});})[_0xbb43('0x15')](respondWithResult(_0x4933f7,null))[_0xbb43('0x1d')](handleError(_0x4933f7,null));};exports[_0xbb43('0xd2')]=function(_0x4122e7,_0x301b7f){if(_0x4122e7[_0xbb43('0x2c')]['id']){delete _0x4122e7[_0xbb43('0x2c')]['id'];}return db[_0xbb43('0x9d')][_0xbb43('0x67')]({'where':{'id':_0x4122e7[_0xbb43('0xba')]['id']},'include':[{'model':db['CmContact'],'as':_0xbb43('0x6c')}]})[_0xbb43('0x15')](handleEntityNotFound(_0x301b7f,null))[_0xbb43('0x15')](saveUpdates(_0x4122e7[_0xbb43('0x2c')],null))[_0xbb43('0x15')](respondWithResult(_0x301b7f,null))[_0xbb43('0x1d')](handleError(_0x301b7f,null));};exports[_0xbb43('0xd3')]=function(_0x1a9c77,_0x1f8f78){if(_0x1a9c77[_0xbb43('0x2c')]['id']){delete _0x1a9c77[_0xbb43('0x2c')]['id'];}return db[_0xbb43('0x9d')][_0xbb43('0x67')]({'where':{'id':_0x1a9c77[_0xbb43('0xba')]['id']}})[_0xbb43('0x15')](function(_0x357e45){if(!_0x357e45){logger[_0xbb43('0x18')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xbb43('0xd3'),0x194,'entity\x20not\x20found');_0x1f8f78['sendStatus'](0x194);}else{if(_0x357e45[_0xbb43('0x3d')]){throw new db[(_0xbb43('0x91'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x357e45;})[_0xbb43('0x15')](function(_0x5911fc){if(_0x5911fc){return _0x5911fc['update']({'closed':_0x1a9c77[_0xbb43('0x2c')]['closed'],'disposition':_0x1a9c77[_0xbb43('0x2c')]['disposition']})[_0xbb43('0x15')](function(_0x5fdbcd){return _0x5fdbcd;});}})['then'](function(){return respondWithRpcPromise(_0xbb43('0xd4'),_0xbb43('0xd3'),_0x1a9c77[_0xbb43('0x2c')],client9004);})[_0xbb43('0x15')](respondWithResult(_0x1f8f78,null))[_0xbb43('0x1d')](handleError(_0x1f8f78,null));};exports['attachmentUpload']=function(_0x6b0dd,_0x240d76){_0x6b0dd[_0xbb43('0x2c')][_0xbb43('0x28')]=_0x6b0dd[_0xbb43('0xd5')]['originalname'];_0x6b0dd[_0xbb43('0x2c')][_0xbb43('0xd6')]=_0x6b0dd[_0xbb43('0xd5')]['filename'];_0x6b0dd['body'][_0xbb43('0x42')]=_0x6b0dd[_0xbb43('0xd5')][_0xbb43('0xd7')];return db['Attachment']['create'](_0x6b0dd[_0xbb43('0x2c')])[_0xbb43('0x15')](respondWithResult(_0x240d76,0xc9))[_0xbb43('0x1d')](handleError(_0x240d76,null));};exports[_0xbb43('0xd8')]=function(_0x235942,_0x51673b){return db[_0xbb43('0x9d')][_0xbb43('0xbe')]({'where':{'id':_0x235942[_0xbb43('0xba')]['id']},'raw':!![]})[_0xbb43('0x15')](handleEntityNotFound(_0x51673b,null))[_0xbb43('0x15')](function(_0x2937c2){if(_0x2937c2){if(_0x2937c2['closed']){return _0x51673b[_0xbb43('0x29')](0x193)[_0xbb43('0x25')]({'status':0x193,'message':_0xbb43('0xd9')});}return db['Attachment'][_0xbb43('0xbe')]({'where':{'id':_0x235942['query'][_0xbb43('0xda')]},'raw':!![]})[_0xbb43('0x15')](handleEntityNotFound(_0x51673b,null));}})[_0xbb43('0x15')](function(_0x2e66b8){if(_0x2e66b8){var _0x59bb83=_0x2e66b8[_0xbb43('0xdb')]!==null;var _0x512e64=path[_0xbb43('0xdc')](config[_0xbb43('0xdd')],_0xbb43('0xde'));if(_0x59bb83){_0x512e64=path[_0xbb43('0xdc')](_0x512e64,_0xbb43('0xdf'));}var _0x532596=path[_0xbb43('0xdc')](_0x512e64,_0x2e66b8[_0xbb43('0xd6')]);return _0x51673b[_0xbb43('0xe0')](_0x532596);}})[_0xbb43('0x1d')](handleError(_0x51673b,null));};exports[_0xbb43('0xe1')]=function(_0x597c10,_0x1ba8b8){var _0x3b50e8=null;var _0x39c8fd=null;var _0x4e6ac5=null;if(_0x597c10[_0xbb43('0x2c')]['id']){delete _0x597c10['body']['id'];}if(_0x597c10['body']['mailTranscript']){_0x4e6ac5=path['join'](config[_0xbb43('0xdd')],'server/files/chat/upload/',util[_0xbb43('0xe2')](_0xbb43('0xe3'),Date[_0xbb43('0xe4')]()));_0x597c10[_0xbb43('0x2c')]['pathTranscript']=_0x4e6ac5;}return db[_0xbb43('0x9d')][_0xbb43('0x67')]({'where':{'id':_0x597c10['params']['id']},'include':[{'model':db[_0xbb43('0xcf')],'as':_0xbb43('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})[_0xbb43('0x15')](handleEntityNotFound(_0x1ba8b8,null))[_0xbb43('0x15')](saveUpdates(_0x597c10[_0xbb43('0x2c')],null))['then'](function(_0x17065d){if(_0x17065d){_0x3b50e8=_0x17065d;return db['ChatWebsite'][_0xbb43('0x67')]({'where':{'id':_0x3b50e8[_0xbb43('0x7c')]}});}})[_0xbb43('0x15')](function(_0x2f8e05){if(_0x2f8e05){_0x39c8fd=_0x2f8e05;return db['CmContact'][_0xbb43('0x67')]({'where':{'id':_0x3b50e8[_0xbb43('0x71')]}});}})[_0xbb43('0x15')](function(_0x7c7f55){if(_0x7c7f55){if(_0x4e6ac5){var _0x20040b=null;for(var _0x57e81b=0x1;_0x57e81b<_0x3b50e8[_0xbb43('0xe5')][_0xbb43('0x66')];++_0x57e81b){_0x20040b=_0x3b50e8['Messages'][_0x57e81b];var _0x5a87b3=_0x20040b[_0xbb43('0x3d')]?util['format'](_0xbb43('0xe6'),_0x39c8fd[_0xbb43('0xe7')],_0x20040b[_0xbb43('0x3d')]):_0xbb43('0xe8');var _0x6bbd30=_0x597c10[_0xbb43('0x2c')][_0xbb43('0xe9')]||util[_0xbb43('0xe2')](_0xbb43('0xe6'),_0xbb43('0xea'),_0x20040b['ContactId']);switch(_0x39c8fd[_0xbb43('0xeb')]){case _0xbb43('0xec'):_0x5a87b3=_0x20040b[_0xbb43('0x3d')]?util['format'](_0xbb43('0xe6'),_0x39c8fd[_0xbb43('0xe7')],_0x20040b[_0xbb43('0x3d')]):_0xbb43('0xe8');break;case _0xbb43('0xed'):_0x5a87b3=_0x20040b['UserId']?_0x20040b[_0xbb43('0x77')]['alias']||_0x20040b['User']['fullname']:'System';break;case _0xbb43('0xee'):_0x5a87b3=_0x20040b[_0xbb43('0x3d')]?_0x20040b[_0xbb43('0x77')][_0xbb43('0x33')]:_0xbb43('0xe8');break;default:_0x5a87b3=_0x20040b[_0xbb43('0x3d')]?util[_0xbb43('0xe2')]('%s%d',_0x39c8fd[_0xbb43('0xe7')],_0x20040b[_0xbb43('0x3d')]):_0xbb43('0xe8');}var _0x16e6d0=util[_0xbb43('0xe2')](_0xbb43('0xef'),moment(_0x20040b[_0xbb43('0xf0')])[_0xbb43('0xe2')](_0xbb43('0xf1')),_0x20040b[_0xbb43('0xf2')]==='in'?_0x6bbd30:_0x5a87b3,_0x20040b[_0xbb43('0x2c')]);if(!_0x20040b['secret']){fs['appendFileSync'](_0x4e6ac5,_0x16e6d0);}}return db[_0xbb43('0xf3')][_0xbb43('0xbe')]({'where':{'service':!![]},'include':[{'model':db[_0xbb43('0xf4')],'as':_0xbb43('0xf5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xbb43('0xf6'),'raw':!![]}]}]});}}})[_0xbb43('0x15')](function(_0x42441d){if(!_0x42441d||!_0x42441d[_0xbb43('0xf5')]||!_0x597c10['body'])return _0x3b50e8;var _0x5228d9=_0x42441d[_0xbb43('0xf7')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5228d9,'message':{'from':util[_0xbb43('0xe2')](_0xbb43('0xf8'),_0x42441d[_0xbb43('0x28')],_0x42441d[_0xbb43('0xc4')]||_0x42441d['Smtp'][_0xbb43('0x99')]),'to':_0x597c10[_0xbb43('0x2c')][_0xbb43('0xf9')],'subject':'Mail\x20Transcript','text':util[_0xbb43('0xe2')](_0xbb43('0xfa'),_0x597c10[_0xbb43('0x2c')][_0xbb43('0xf9')]),'attachments':[{'path':_0x4e6ac5}]}})[_0xbb43('0x15')](function(){return _0x3b50e8;})[_0xbb43('0x1d')](function(_0x5d7a43){logger[_0xbb43('0x18')](_0x5d7a43);});})['then'](respondWithStatusCode(_0x1ba8b8,0xc8))[_0xbb43('0x1d')](handleError(_0x1ba8b8,null));};exports[_0xbb43('0xfb')]=function(_0x36a180,_0x30b80a){return db[_0xbb43('0xcf')][_0xbb43('0x67')]({'where':{'id':_0x36a180['params']['id']}})[_0xbb43('0x15')](handleEntityNotFound(_0x30b80a,null))[_0xbb43('0x15')](function(_0x52a9cb){if(_0x52a9cb){return _0x52a9cb[_0xbb43('0xfb')](_0x36a180[_0xbb43('0x2c')][_0xbb43('0xfc')],_[_0xbb43('0xfd')](_0x36a180[_0xbb43('0x2c')],[_0xbb43('0xfc'),'id'])||{});}})[_0xbb43('0x15')](respondWithResult(_0x30b80a,null))[_0xbb43('0x1d')](handleError(_0x30b80a,null));};exports['getMessages']=function(_0x45d84c,_0x30dd90){var _0x3e0507={'raw':![],'where':{}};var _0x2965d6={};var _0x4db12f={'count':0x0,'rows':[]};return db[_0xbb43('0x9d')][_0xbb43('0xbe')]({'where':{'id':_0x45d84c[_0xbb43('0xba')]['id']}})[_0xbb43('0x15')](handleEntityNotFound(_0x30dd90,null))[_0xbb43('0x15')](function(_0x26f8e9){if(_0x26f8e9){_0x2965d6[_0xbb43('0x43')]=_[_0xbb43('0x44')](db[_0xbb43('0xcf')][_0xbb43('0xb5')]);_0x2965d6['query']=_[_0xbb43('0x44')](_0x45d84c[_0xbb43('0x47')]);_0x2965d6[_0xbb43('0x45')]=_['intersection'](_0x2965d6[_0xbb43('0x43')],_0x2965d6[_0xbb43('0x47')]);_0x3e0507[_0xbb43('0x48')]=_[_0xbb43('0x46')](_0x2965d6[_0xbb43('0x43')],qs['fields'](_0x45d84c[_0xbb43('0x47')][_0xbb43('0x49')]));_0x3e0507[_0xbb43('0x48')]=_0x3e0507[_0xbb43('0x48')][_0xbb43('0x66')]?_0x3e0507[_0xbb43('0x48')]:_0x2965d6['model'];if(!_0x45d84c[_0xbb43('0x47')][_0xbb43('0x4a')](_0xbb43('0xfe'))){_0x3e0507[_0xbb43('0x22')]=qs[_0xbb43('0x22')](_0x45d84c[_0xbb43('0x47')][_0xbb43('0x22')]);_0x3e0507[_0xbb43('0x20')]=qs[_0xbb43('0x20')](_0x45d84c[_0xbb43('0x47')][_0xbb43('0x20')]);}_0x3e0507[_0xbb43('0x4b')]=qs[_0xbb43('0x4c')](_0x45d84c[_0xbb43('0x47')]['sort']);_0x3e0507[_0xbb43('0x7d')]=qs[_0xbb43('0x45')](_[_0xbb43('0x4d')](_0x45d84c[_0xbb43('0x47')],_0x2965d6[_0xbb43('0x45')]));_0x3e0507[_0xbb43('0x7d')]['ChatInteractionId']=_0x26f8e9['id'];if(_0x45d84c[_0xbb43('0x47')][_0xbb43('0x8a')]){_0x3e0507[_0xbb43('0x7d')]=_[_0xbb43('0x2b')](_0x3e0507[_0xbb43('0x7d')],{'$or':_[_0xbb43('0x32')](_0x3e0507[_0xbb43('0x48')],function(_0x1a89da){var _0x3f7b7c={};_0x3f7b7c[_0x1a89da]={'$like':'%'+_0x45d84c['query'][_0xbb43('0x8a')]+'%'};return _0x3f7b7c;})});}if(_0x45d84c[_0xbb43('0x47')][_0xbb43('0xff')]){var _0x435691=_0x45d84c[_0xbb43('0x47')]['$gte'][_0xbb43('0x34')](',');var _0x58ac0d={};_0x58ac0d[_0x435691[0x0]]={'$gte':moment(_0x435691[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3e0507[_0xbb43('0x7d')]=_[_0xbb43('0x2b')](_0x3e0507['where'],_0x58ac0d);}_0x3e0507=_['merge']({},_0x3e0507,_0x45d84c[_0xbb43('0xb8')]);return db['ChatMessage'][_0xbb43('0x23')]({'where':_0x3e0507[_0xbb43('0x7d')]})[_0xbb43('0x15')](function(_0x2f7bcf){_0x4db12f[_0xbb43('0x23')]=_0x2f7bcf;if(_0x45d84c['query'][_0xbb43('0xb6')]){_0x3e0507[_0xbb43('0xb7')]=[{'all':!![]}];}return db[_0xbb43('0xcf')][_0xbb43('0x100')](_0x3e0507);})[_0xbb43('0x15')](function(_0xc6c129){_0x4db12f['rows']=_0xc6c129;return _0x4db12f;});}})[_0xbb43('0x15')](respondWithFilteredResult(_0x30dd90,_0x3e0507))[_0xbb43('0x1d')](handleError(_0x30dd90,null));};exports[_0xbb43('0x101')]=function(_0x47d4d7,_0x40ca42){var _0x4cd83a={'where':{}},_0x169866={},_0x27c99b={'count':0x0,'rows':[]};return db[_0xbb43('0x9d')][_0xbb43('0xbe')]({'where':{'id':_0x47d4d7[_0xbb43('0xba')]['id']}})[_0xbb43('0x15')](handleEntityNotFound(_0x40ca42,null))[_0xbb43('0x15')](function(_0x2109cc){if(_0x2109cc){_0x169866[_0xbb43('0x43')]=_['keys'](db[_0xbb43('0xcf')][_0xbb43('0xb5')]);_0x169866[_0xbb43('0x47')]=_[_0xbb43('0x44')](_0x47d4d7[_0xbb43('0x47')]);_0x169866[_0xbb43('0x45')]=_[_0xbb43('0x46')](_0x169866['model'],_0x169866[_0xbb43('0x47')]);_0x4cd83a['attributes']=_[_0xbb43('0x46')](_0x169866['model'],qs[_0xbb43('0x49')](_0x47d4d7[_0xbb43('0x47')][_0xbb43('0x49')]));_0x4cd83a[_0xbb43('0x48')]=_0x4cd83a[_0xbb43('0x48')]['length']?_0x4cd83a['attributes']:_0x169866['model'];if(!_0x47d4d7[_0xbb43('0x47')][_0xbb43('0x4a')]('nolimit')){_0x4cd83a['limit']=qs[_0xbb43('0x22')](_0x47d4d7[_0xbb43('0x47')][_0xbb43('0x22')]);_0x4cd83a[_0xbb43('0x20')]=qs[_0xbb43('0x20')](_0x47d4d7['query'][_0xbb43('0x20')]);}_0x4cd83a[_0xbb43('0x4b')]=qs['sort'](_0x47d4d7['query'][_0xbb43('0x4c')]);_0x4cd83a[_0xbb43('0x7d')]=qs[_0xbb43('0x45')](_['pick'](_0x47d4d7[_0xbb43('0x47')],_0x169866['filters']));_0x4cd83a[_0xbb43('0x7d')][_0xbb43('0xb2')]=_0x2109cc['id'];if(_0x47d4d7[_0xbb43('0x47')][_0xbb43('0x8a')]){_0x4cd83a[_0xbb43('0x7d')]=_['merge'](_0x4cd83a[_0xbb43('0x7d')],{'$or':_[_0xbb43('0x32')](_0x4cd83a[_0xbb43('0x48')],function(_0x1dc19d){var _0x1249c7={};_0x1249c7[_0x1dc19d]={'$like':'%'+_0x47d4d7['query'][_0xbb43('0x8a')]+'%'};return _0x1249c7;})});}_0x4cd83a[_0xbb43('0x7d')]['secret']=![];if(_0x47d4d7['query']['id']){_0x4cd83a[_0xbb43('0x7d')]['id']={'$gt':_0x47d4d7[_0xbb43('0x47')]['id']};}_0x4cd83a=_['merge']({},_0x4cd83a,_0x47d4d7['options']);return db[_0xbb43('0xcf')][_0xbb43('0x23')]({'where':_0x4cd83a[_0xbb43('0x7d')]})[_0xbb43('0x15')](function(_0x569f54){_0x27c99b[_0xbb43('0x23')]=_0x569f54;_0x4cd83a['include']=[];if(_0x47d4d7[_0xbb43('0x47')][_0xbb43('0x102')]){_0x4cd83a[_0xbb43('0xb7')]['push']({'model':db[_0xbb43('0x77')],'as':_0xbb43('0x77'),'attributes':['id',_0xbb43('0x33'),_0xbb43('0x103')]});}if(_0x47d4d7[_0xbb43('0x47')][_0xbb43('0xb6')]){_0x4cd83a[_0xbb43('0xb7')]=[{'all':!![]}];}return db['ChatMessage'][_0xbb43('0x100')](_0x4cd83a);})['then'](function(_0x1e5668){_0x27c99b[_0xbb43('0xb3')]=_0x1e5668;return _0x27c99b;});}})[_0xbb43('0x15')](respondWithFilteredResult(_0x40ca42,_0x4cd83a))[_0xbb43('0x1d')](handleError(_0x40ca42,null));};exports['addTags']=function(_0x1731e8,_0x2ec383){return db['ChatInteraction'][_0xbb43('0x67')]({'where':{'id':_0x1731e8['params']['id']}})[_0xbb43('0x15')](handleEntityNotFound(_0x2ec383,null))[_0xbb43('0x15')](function(_0x37c4b4){if(_0x37c4b4){return _0x37c4b4['setTags'](_0x1731e8['body'][_0xbb43('0xfc')],_['omit'](_0x1731e8[_0xbb43('0x2c')],['ids','id'])||{})[_0xbb43('0x104')](function(){return db[_0xbb43('0x74')][_0xbb43('0x100')]({'attributes':['id',_0xbb43('0x28'),_0xbb43('0x105')],'where':{'id':_0x1731e8[_0xbb43('0x2c')][_0xbb43('0xfc')]}});})[_0xbb43('0x15')](function(_0x58d41d){socket[_0xbb43('0x106')](_0xbb43('0x107'),{'id':Number(_0x1731e8[_0xbb43('0xba')]['id']),'tags':_0x58d41d||[]});return{'id':Number(_0x1731e8[_0xbb43('0xba')]['id']),'tags':_0x58d41d||[]};});}})['then'](respondWithResult(_0x2ec383,null))[_0xbb43('0x1d')](handleError(_0x2ec383,null));};exports[_0xbb43('0x108')]=function(_0x3178f7,_0x360eb5){return db[_0xbb43('0x9d')][_0xbb43('0x67')]({'where':{'id':_0x3178f7['params']['id']}})['then'](handleEntityNotFound(_0x360eb5,null))['then'](function(_0x31f548){if(_0x31f548){return _0x31f548['removeTags'](_0x3178f7[_0xbb43('0x47')][_0xbb43('0xfc')]);}})['then'](respondWithStatusCode(_0x360eb5,null))[_0xbb43('0x1d')](handleError(_0x360eb5,null));};exports[_0xbb43('0xe0')]=function(_0xea8659,_0x157391){var _0x2b60f0=moment()['unix']()[_0xbb43('0x9c')]();var _0x19622c=path['join'](config['root'],_0xbb43('0x109'),'files',_0xbb43('0x10a'));var _0x24fa63=path['join'](config[_0xbb43('0xdd')],_0xbb43('0x109'),'files',_0xbb43('0x10b'));var _0x5eb021=path['join'](_0x19622c,_0x2b60f0);var _0x4bb31b=util['format'](_0xbb43('0x10c'),_0xea8659[_0xbb43('0xba')]['id'],_0x2b60f0);var _0x21ba01=path[_0xbb43('0xdc')](_0x19622c,_0x4bb31b);var _0x2414e4=[];_0x2414e4[_0xbb43('0x36')]({'model':db[_0xbb43('0x77')],'as':_0xbb43('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x2414e4[_0xbb43('0x36')]({'model':db[_0xbb43('0x10d')],'as':_0xbb43('0x6c'),'attributes':['id',_0xbb43('0x10e'),_0xbb43('0x10f')],'raw':!![]});if(_0xea8659[_0xbb43('0x47')]['attachments']){_0x2414e4['push']({'model':db[_0xbb43('0x110')],'as':_0xbb43('0x110'),'raw':!![]});}var _0x2e8b8c=[{'model':db['ChatMessage'],'as':_0xbb43('0xe5'),'attributes':['id',_0xbb43('0x2c'),_0xbb43('0xf0'),_0xbb43('0xf2'),'secret',_0xbb43('0x85')],'include':_0x2414e4}];_0x2e8b8c['push']({'model':db[_0xbb43('0xbf')],'as':_0xbb43('0x111'),'attributes':['id',_0xbb43('0x28')]});_0x2e8b8c['push']({'model':db[_0xbb43('0x77')],'as':'Owner','attributes':['id',_0xbb43('0x33')]});return db['ChatInteraction']['find']({'where':{'id':_0xea8659[_0xbb43('0xba')]['id']},'include':_0x2e8b8c})[_0xbb43('0x15')](handleEntityNotFound(_0x157391,null))['then'](function(_0x312c22){if(_0x312c22){var _0x1f7d62=_0x312c22['get']({'plain':!![]});fs['mkdirSync'](_0x5eb021);var _0x4ab4d5={'channel':_0xbb43('0x112'),'account':_0x1f7d62['Account'][_0xbb43('0x28')],'agent':_0x1f7d62[_0xbb43('0x113')]?_0x1f7d62[_0xbb43('0x113')][_0xbb43('0x33')]:_0xbb43('0x114'),'createdAt':moment(_0x1f7d62['createdAt'])[_0xbb43('0xe2')](_0xbb43('0x115'))[_0xbb43('0x9c')](),'closedAt':_0x1f7d62[_0xbb43('0x3c')]?moment(_0x1f7d62[_0xbb43('0x116')])[_0xbb43('0xe2')](_0xbb43('0x115'))['toString']():'','disposition':_0x1f7d62['disposition'],'chatInfo':{'browser':_0x1f7d62['browserName'],'os':_0x1f7d62[_0xbb43('0x117')],'referer':_0x1f7d62[_0xbb43('0x118')],'customerIp':_0x1f7d62['customerIp'],'customerPort':_0x1f7d62['customerPort']?_0x1f7d62['customerPort']:_0xbb43('0x114')},'messages':_(_0x1f7d62[_0xbb43('0xe5')])['tail']()[_0xbb43('0x8a')]({'secret':![]})[_0xbb43('0x32')](function(_0x533eae){if(_0x533eae[_0xbb43('0x110')]){var _0x24790f=path['join'](_0x24fa63,_0x533eae[_0xbb43('0x110')][_0xbb43('0xd6')]);if(fs['existsSync'](_0x24790f)){fs[_0xbb43('0x119')](_0x24790f)[_0xbb43('0x11a')](fs[_0xbb43('0x11b')](path[_0xbb43('0xdc')](_0x5eb021,_0x533eae[_0xbb43('0x110')][_0xbb43('0xd6')])));}}return{'date':moment(_0x533eae[_0xbb43('0xf0')])['format'](_0xbb43('0x115'))[_0xbb43('0x9c')](),'sender':_0x533eae['direction']===_0xbb43('0x11c')?_0x533eae[_0xbb43('0x77')]?_0x533eae[_0xbb43('0x77')]['fullname']:_0xbb43('0xe8'):_0x533eae[_0xbb43('0x6c')][_0xbb43('0x10e')]+(_0x533eae[_0xbb43('0x6c')][_0xbb43('0x10f')]?'\x20'+_0x533eae['Contact'][_0xbb43('0x10f')]:''),'body':_0x533eae[_0xbb43('0x110')]?_0x533eae['Attachment'][_0xbb43('0xd6')]:_0x533eae[_0xbb43('0x2c')],'direction':_0x533eae[_0xbb43('0xf2')]===_0xbb43('0x11c')?'A':'C','secret':_0x533eae[_0xbb43('0x11d')],'read':_0x533eae[_0xbb43('0x85')],'attachment':_0x533eae[_0xbb43('0x110')]};})[_0xbb43('0x69')]()};return ejs[_0xbb43('0x11e')](path[_0xbb43('0xdc')](config['root'],_0xbb43('0x109'),_0xbb43('0x11f'),_0xbb43('0x120')),{'interaction':_0x4ab4d5})[_0xbb43('0x15')](function(_0x5cce0f){var _0x5e6df7=path[_0xbb43('0xdc')](_0x5eb021,_0xbb43('0x121')+_0x1f7d62['id']+'-'+_0x2b60f0+_0xbb43('0x122'));var _0x18b331={'path':_0x5e6df7,'channel':_0xbb43('0x112'),'interactionId':_0x1f7d62['id']};return pdf[_0xbb43('0x123')](_0x5cce0f,_0x18b331);})[_0xbb43('0x15')](function(){return new Promise(function(_0x574325,_0x3f800d){zipdir(_0x5eb021,{'saveTo':_0x21ba01},function(_0x262099,_0x306138){if(_0x262099)return _0x3f800d(_0x262099);return _0x574325(_0x306138);});})[_0xbb43('0x15')](function(){return new BPromise(function(_0x271aa2,_0x62768a){rimraf(_0x5eb021,function(_0x1e48ab){if(_0x1e48ab)_0x62768a(_0x1e48ab);return _0x271aa2();});});})[_0xbb43('0x15')](function(){return _0x157391[_0xbb43('0xe0')](_0x21ba01,_0x4bb31b,function(_0x41341e){if(_0x41341e){logger['error']('err',_0x41341e);}else{fs[_0xbb43('0x124')](_0x21ba01);}});});});}else{return _0x157391['sendStatus'](0xc8);}})[_0xbb43('0x1d')](handleError(_0x157391,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 6a3bc9b..7ef0f66 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 _0xa18e=['Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','setDataValue'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xa18e,0x1c0));var _0xea18=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xa18e[_0x5a3cf0];return _0x5a64ee;};'use strict';var EventEmitter=require(_0xea18('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xea18('0x1')];var ChatMessage=require(_0xea18('0x2'))['db'][_0xea18('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xea18('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xea18('0x5')};function emitEvent(_0xe9309){return function(_0x5203fa,_0x1e9994,_0x198a28){_0x5203fa[_0xea18('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x10a59c){_0x5203fa[_0xea18('0x7')](_0xea18('0x8'),_0x10a59c[_0xea18('0x9')](function(_0x2a80b6){return{'id':_0x2a80b6['id']};}));return ChatMessage[_0xea18('0xa')]({'where':{'ChatInteractionId':_0x5203fa['id'],'direction':'in','read':![]},'raw':!![]});})[_0xea18('0xb')](function(_0x4adbea){_0x5203fa[_0xea18('0x7')](_0xea18('0xc'),_0x4adbea[_0xea18('0xd')]);ChatInteractionEvents[_0xea18('0xe')](_0xe9309+':'+_0x5203fa['id'],_0x5203fa);ChatInteractionEvents[_0xea18('0xe')](_0xe9309,_0x5203fa);_0x198a28(null);})[_0xea18('0xf')](_0x198a28(null));};}for(var e in events){if(events[_0xea18('0x10')](e)){var event=events[e];ChatInteraction[_0xea18('0x11')](e,emitEvent(event));}}module[_0xea18('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x24a5=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','Users','map','findAll','setDataValue','unreadMessages'];(function(_0xf8c90c,_0x29d757){var _0x37c757=function(_0xe50cd4){while(--_0xe50cd4){_0xf8c90c['push'](_0xf8c90c['shift']());}};_0x37c757(++_0x29d757);}(_0x24a5,0x1c6));var _0x524a=function(_0x418da8,_0x417bdd){_0x418da8=_0x418da8-0x0;var _0x2ae1c4=_0x24a5[_0x418da8];return _0x2ae1c4;};'use strict';var EventEmitter=require(_0x524a('0x0'));var ChatInteraction=require(_0x524a('0x1'))['db'][_0x524a('0x2')];var ChatMessage=require(_0x524a('0x1'))['db'][_0x524a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x524a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x527694){return function(_0x3b14e3,_0x59acf1,_0x5218e0){_0x3b14e3['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x301cd6){_0x3b14e3['setDataValue'](_0x524a('0x5'),_0x301cd6[_0x524a('0x6')](function(_0x132c37){return{'id':_0x132c37['id']};}));return ChatMessage[_0x524a('0x7')]({'where':{'ChatInteractionId':_0x3b14e3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1fabf6){_0x3b14e3[_0x524a('0x8')](_0x524a('0x9'),_0x1fabf6[_0x524a('0xa')]);ChatInteractionEvents[_0x524a('0xb')](_0x527694+':'+_0x3b14e3['id'],_0x3b14e3);ChatInteractionEvents[_0x524a('0xb')](_0x527694,_0x3b14e3);_0x5218e0(null);})[_0x524a('0xc')](_0x5218e0(null));};}for(var e in events){if(events[_0x524a('0xd')](e)){var event=events[e];ChatInteraction[_0x524a('0xe')](e,emitEvent(event));}}module[_0x524a('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c3da693..315a8a9 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 _0x6d4d=['utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1398ad,_0x44e0e2){var _0x10ea56=function(_0x58c12a){while(--_0x58c12a){_0x1398ad['push'](_0x1398ad['shift']());}};_0x10ea56(++_0x44e0e2);}(_0x6d4d,0x177));var _0xd6d4=function(_0x2fc884,_0x2e4070){_0x2fc884=_0x2fc884-0x0;var _0xb2525d=_0x6d4d[_0x2fc884];return _0xb2525d;};'use strict';var _=require(_0xd6d4('0x0'));var util=require(_0xd6d4('0x1'));var logger=require('../../config/logger')(_0xd6d4('0x2'));var moment=require('moment');var BPromise=require(_0xd6d4('0x3'));var rp=require(_0xd6d4('0x4'));var fs=require('fs');var path=require(_0xd6d4('0x5'));var rimraf=require(_0xd6d4('0x6'));var config=require(_0xd6d4('0x7'));var attributes=require(_0xd6d4('0x8'));module[_0xd6d4('0x9')]=function(_0x1c2c72,_0x4fa78f){return _0x1c2c72['define'](_0xd6d4('0xa'),attributes,{'tableName':_0xd6d4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5903f8,_0x4f662f,_0x30cb4e){if(_0x5903f8[_0xd6d4('0xc')](_0xd6d4('0xd'))){_0x5903f8[_0xd6d4('0xe')]=moment()['format'](_0xd6d4('0xf'));}_0x30cb4e(null,_0x5903f8);}},'charset':_0xd6d4('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x263a=['../../config/environment','./chatInteraction.attributes','exports','define','changed','closed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x29e871,_0x330b98){var _0x3380e3=function(_0x26eeae){while(--_0x26eeae){_0x29e871['push'](_0x29e871['shift']());}};_0x3380e3(++_0x330b98);}(_0x263a,0x1c3));var _0xa263=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x263a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa263('0x0'));var util=require('util');var logger=require(_0xa263('0x1'))(_0xa263('0x2'));var moment=require(_0xa263('0x3'));var BPromise=require(_0xa263('0x4'));var rp=require(_0xa263('0x5'));var fs=require('fs');var path=require(_0xa263('0x6'));var rimraf=require(_0xa263('0x7'));var config=require(_0xa263('0x8'));var attributes=require(_0xa263('0x9'));module[_0xa263('0xa')]=function(_0x5bf5db,_0x310121){return _0x5bf5db[_0xa263('0xb')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x489ce6,_0x1d057d,_0x16f24b){if(_0x489ce6[_0xa263('0xc')](_0xa263('0xd'))){_0x489ce6[_0xa263('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x16f24b(null,_0x489ce6);}},'charset':_0xa263('0xf'),'collate':_0xa263('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index a941f04..61fe7fc 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 _0xb2ed=['info','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','then','debug','AddTagsToChatInteraction','find','ids','omit','AddTags','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3964b5,_0xeb4190){var _0x37d532=function(_0xadd178){while(--_0xadd178){_0x3964b5['push'](_0x3964b5['shift']());}};_0x37d532(++_0xeb4190);}(_0xb2ed,0x179));var _0xdb2e=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xb2ed[_0x148c09];return _0x18e613;};'use strict';var _=require(_0xdb2e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdb2e('0x1'));var rs=require(_0xdb2e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb2e('0x3'))['db'];var utils=require(_0xdb2e('0x4'));var logger=require('../../config/logger')(_0xdb2e('0x5'));var config=require(_0xdb2e('0x6'));var jayson=require(_0xdb2e('0x7'));var client=jayson[_0xdb2e('0x8')][_0xdb2e('0x9')]({'port':0x232a});config['redis']=_[_0xdb2e('0xa')](config[_0xdb2e('0xb')],{'host':_0xdb2e('0xc'),'port':0x18eb});var socket=require(_0xdb2e('0xd'))(new Redis(config[_0xdb2e('0xb')]));require(_0xdb2e('0xe'))['register'](socket);function respondWithRpcPromise(_0x48c0e5,_0x2b06a0,_0x4092c1){return new BPromise(function(_0x4e9495,_0x3f6677){return client[_0xdb2e('0xf')](_0x48c0e5,_0x4092c1)['then'](function(_0xf4e273){logger['info'](_0xdb2e('0x10'),_0x2b06a0,_0xdb2e('0x11'));logger['debug'](_0xdb2e('0x12'),_0x2b06a0,_0xdb2e('0x11'),JSON[_0xdb2e('0x13')](_0xf4e273));if(_0xf4e273[_0xdb2e('0x14')]){if(_0xf4e273[_0xdb2e('0x14')][_0xdb2e('0x15')]===0x1f4){logger[_0xdb2e('0x14')](_0xdb2e('0x10'),_0x2b06a0,_0xf4e273[_0xdb2e('0x14')][_0xdb2e('0x16')]);return _0x3f6677(_0xf4e273['error'][_0xdb2e('0x16')]);}logger['error'](_0xdb2e('0x10'),_0x2b06a0,_0xf4e273['error'][_0xdb2e('0x16')]);return _0x4e9495(_0xf4e273[_0xdb2e('0x14')][_0xdb2e('0x16')]);}else{logger[_0xdb2e('0x17')](_0xdb2e('0x10'),_0x2b06a0,_0xdb2e('0x11'));_0x4e9495(_0xf4e273[_0xdb2e('0x18')][_0xdb2e('0x16')]);}})[_0xdb2e('0x19')](function(_0x15ff53){logger[_0xdb2e('0x14')](_0xdb2e('0x10'),_0x2b06a0,_0x15ff53);_0x3f6677(_0x15ff53);});});}exports[_0xdb2e('0x1a')]=function(_0x549ed8){var _0x48023c=this;return new Promise(function(_0x3abd54,_0x58b156){return db[_0xdb2e('0x1b')][_0xdb2e('0x1c')](_0x549ed8['body'],{'raw':_0x549ed8[_0xdb2e('0x1d')]?_0x549ed8[_0xdb2e('0x1d')][_0xdb2e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x549ed8['options']?_0x549ed8[_0xdb2e('0x1d')][_0xdb2e('0x1f')]||null:null,'attributes':_0x549ed8[_0xdb2e('0x1d')]?_0x549ed8[_0xdb2e('0x1d')][_0xdb2e('0x20')]||null:null,'limit':_0x549ed8['options']?_0x549ed8[_0xdb2e('0x1d')]['limit']||null:null})[_0xdb2e('0x21')](function(_0x4580c3){logger[_0xdb2e('0x17')](_0xdb2e('0x1a'),_0x549ed8);logger[_0xdb2e('0x22')](_0xdb2e('0x1a'),_0x549ed8,JSON[_0xdb2e('0x13')](_0x4580c3));_0x3abd54(_0x4580c3);})[_0xdb2e('0x19')](function(_0x1b6da5){logger[_0xdb2e('0x14')](_0xdb2e('0x1a'),_0x1b6da5['message'],_0x549ed8);_0x58b156(_0x48023c[_0xdb2e('0x14')](0x1f4,_0x1b6da5[_0xdb2e('0x16')]));});});};exports[_0xdb2e('0x23')]=function(_0x16024c){return new Promise(function(_0x390862,_0x214d33){return db[_0xdb2e('0x1b')][_0xdb2e('0x24')]({'where':_0x16024c[_0xdb2e('0x1d')]?_0x16024c[_0xdb2e('0x1d')]['where']||null:null})[_0xdb2e('0x21')](function(_0x5ab539){if(_0x5ab539){return _0x5ab539['addTags'](_0x16024c['body'][_0xdb2e('0x25')],_[_0xdb2e('0x26')](_0x16024c['body'],[_0xdb2e('0x25'),'id'])||{});}})['spread'](function(_0x77ee2){logger[_0xdb2e('0x17')]('AddTags',_0x16024c);logger[_0xdb2e('0x22')](_0xdb2e('0x27'),_0x16024c,JSON[_0xdb2e('0x13')](_0x77ee2));_0x390862(_0x77ee2);})['catch'](function(_0x45fb19){logger[_0xdb2e('0x14')](_0xdb2e('0x27'),_0x45fb19[_0xdb2e('0x16')],_0x16024c);_0x214d33(_this[_0xdb2e('0x14')](0x1f4,_0x45fb19[_0xdb2e('0x16')]));});});};
\ No newline at end of file
+var _0xf1b5=['update','body','options','raw','attributes','limit','catch','find','where','addTags','ids','spread','AddTags','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateChatInteraction','ChatInteraction'];(function(_0x491956,_0x43d798){var _0x4cde6b=function(_0x43ccba){while(--_0x43ccba){_0x491956['push'](_0x491956['shift']());}};_0x4cde6b(++_0x43d798);}(_0xf1b5,0x117));var _0x5f1b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf1b5[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5f1b('0x0'));var moment=require(_0x5f1b('0x1'));var BPromise=require(_0x5f1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f1b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f1b('0x4'));var logger=require(_0x5f1b('0x5'))('rpc');var config=require(_0x5f1b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5f1b('0x7')]['http']({'port':0x232a});config[_0x5f1b('0x8')]=_[_0x5f1b('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5f1b('0xa'))(new Redis(config[_0x5f1b('0x8')]));require(_0x5f1b('0xb'))[_0x5f1b('0xc')](socket);function respondWithRpcPromise(_0x5581f5,_0x40da75,_0x50df19){return new BPromise(function(_0x1ace5a,_0x4a081d){return client[_0x5f1b('0xd')](_0x5581f5,_0x50df19)[_0x5f1b('0xe')](function(_0x3d573c){logger[_0x5f1b('0xf')](_0x5f1b('0x10'),_0x40da75,_0x5f1b('0x11'));logger[_0x5f1b('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x40da75,'request\x20sent',JSON[_0x5f1b('0x13')](_0x3d573c));if(_0x3d573c['error']){if(_0x3d573c[_0x5f1b('0x14')][_0x5f1b('0x15')]===0x1f4){logger[_0x5f1b('0x14')](_0x5f1b('0x10'),_0x40da75,_0x3d573c[_0x5f1b('0x14')][_0x5f1b('0x16')]);return _0x4a081d(_0x3d573c['error'][_0x5f1b('0x16')]);}logger[_0x5f1b('0x14')](_0x5f1b('0x10'),_0x40da75,_0x3d573c[_0x5f1b('0x14')][_0x5f1b('0x16')]);return _0x1ace5a(_0x3d573c[_0x5f1b('0x14')][_0x5f1b('0x16')]);}else{logger[_0x5f1b('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x40da75,_0x5f1b('0x11'));_0x1ace5a(_0x3d573c['result']['message']);}})['catch'](function(_0x508ca3){logger['error'](_0x5f1b('0x10'),_0x40da75,_0x508ca3);_0x4a081d(_0x508ca3);});});}exports[_0x5f1b('0x17')]=function(_0x127c9a){var _0x2f09f9=this;return new Promise(function(_0x40523d,_0x1aa7d1){return db[_0x5f1b('0x18')][_0x5f1b('0x19')](_0x127c9a[_0x5f1b('0x1a')],{'raw':_0x127c9a[_0x5f1b('0x1b')]?_0x127c9a[_0x5f1b('0x1b')][_0x5f1b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x127c9a[_0x5f1b('0x1b')]?_0x127c9a[_0x5f1b('0x1b')]['where']||null:null,'attributes':_0x127c9a[_0x5f1b('0x1b')]?_0x127c9a[_0x5f1b('0x1b')][_0x5f1b('0x1d')]||null:null,'limit':_0x127c9a[_0x5f1b('0x1b')]?_0x127c9a[_0x5f1b('0x1b')][_0x5f1b('0x1e')]||null:null})['then'](function(_0x2627c2){logger[_0x5f1b('0xf')](_0x5f1b('0x17'),_0x127c9a);logger[_0x5f1b('0x12')](_0x5f1b('0x17'),_0x127c9a,JSON[_0x5f1b('0x13')](_0x2627c2));_0x40523d(_0x2627c2);})[_0x5f1b('0x1f')](function(_0x4257bb){logger[_0x5f1b('0x14')](_0x5f1b('0x17'),_0x4257bb[_0x5f1b('0x16')],_0x127c9a);_0x1aa7d1(_0x2f09f9[_0x5f1b('0x14')](0x1f4,_0x4257bb[_0x5f1b('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0xb0c5ce){return new Promise(function(_0x11d8a5,_0x27e386){return db[_0x5f1b('0x18')][_0x5f1b('0x20')]({'where':_0xb0c5ce[_0x5f1b('0x1b')]?_0xb0c5ce[_0x5f1b('0x1b')][_0x5f1b('0x21')]||null:null})[_0x5f1b('0xe')](function(_0x3e5c39){if(_0x3e5c39){return _0x3e5c39[_0x5f1b('0x22')](_0xb0c5ce[_0x5f1b('0x1a')][_0x5f1b('0x23')],_['omit'](_0xb0c5ce[_0x5f1b('0x1a')],[_0x5f1b('0x23'),'id'])||{});}})[_0x5f1b('0x24')](function(_0x3b9607){logger['info']('AddTags',_0xb0c5ce);logger[_0x5f1b('0x12')](_0x5f1b('0x25'),_0xb0c5ce,JSON[_0x5f1b('0x13')](_0x3b9607));_0x11d8a5(_0x3b9607);})[_0x5f1b('0x1f')](function(_0xec8ad9){logger[_0x5f1b('0x14')](_0x5f1b('0x25'),_0xec8ad9[_0x5f1b('0x16')],_0xb0c5ce);_0x27e386(_this['error'](0x1f4,_0xec8ad9[_0x5f1b('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 214f829..ccb06f1 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 _0x45fc=['length','./chatInteraction.events','update','removeListener','register'];(function(_0x327f87,_0x5e05ff){var _0x5cca27=function(_0x180d99){while(--_0x180d99){_0x327f87['push'](_0x327f87['shift']());}};_0x5cca27(++_0x5e05ff);}(_0x45fc,0x1b9));var _0xc45f=function(_0x16df89,_0x31311e){_0x16df89=_0x16df89-0x0;var _0x14dba3=_0x45fc[_0x16df89];return _0x14dba3;};'use strict';var ChatInteractionEvents=require(_0xc45f('0x0'));var events=['save','remove',_0xc45f('0x1')];function createListener(_0x1c2dac,_0x43cbd3){return function(_0x2f27d9){_0x43cbd3['emit'](_0x1c2dac,_0x2f27d9);};}function removeListener(_0x3a4c82,_0x157d02){return function(){ChatInteractionEvents[_0xc45f('0x2')](_0x3a4c82,_0x157d02);};}exports[_0xc45f('0x3')]=function(_0x50fa53){for(var _0x296521=0x0,_0x9bbcc1=events[_0xc45f('0x4')];_0x296521<_0x9bbcc1;_0x296521++){var _0x616b22=events[_0x296521];var _0x2c2d85=createListener('chatInteraction:'+_0x616b22,_0x50fa53);ChatInteractionEvents['on'](_0x616b22,_0x2c2d85);}};
\ No newline at end of file
+var _0xf9f9=['emit','removeListener','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x3669d0,_0x2ae8c1){var _0x37a9e4=function(_0x34e049){while(--_0x34e049){_0x3669d0['push'](_0x3669d0['shift']());}};_0x37a9e4(++_0x2ae8c1);}(_0xf9f9,0x90));var _0x9f9f=function(_0x11fc3f,_0x5b2b90){_0x11fc3f=_0x11fc3f-0x0;var _0x4d8e0d=_0xf9f9[_0x11fc3f];return _0x4d8e0d;};'use strict';var ChatInteractionEvents=require(_0x9f9f('0x0'));var events=[_0x9f9f('0x1'),_0x9f9f('0x2'),'update'];function createListener(_0x5ec2b9,_0x103b3a){return function(_0x27bfd6){_0x103b3a[_0x9f9f('0x3')](_0x5ec2b9,_0x27bfd6);};}function removeListener(_0xd0543f,_0x4c986d){return function(){ChatInteractionEvents[_0x9f9f('0x4')](_0xd0543f,_0x4c986d);};}exports[_0x9f9f('0x5')]=function(_0xe759d9){for(var _0x3c2b59=0x0,_0x5bef94=events['length'];_0x3c2b59<_0x5bef94;_0x3c2b59++){var _0x397af8=events[_0x3c2b59];var _0x251da5=createListener(_0x9f9f('0x6')+_0x397af8,_0xe759d9);ChatInteractionEvents['on'](_0x397af8,_0x251da5);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 98f3690..7ef2d4d 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 _0x0271=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','/:id/messages','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','destroy','delete'];(function(_0x5edc93,_0x461b5e){var _0x2d9463=function(_0x291d93){while(--_0x291d93){_0x5edc93['push'](_0x5edc93['shift']());}};_0x2d9463(++_0x461b5e);}(_0x0271,0x139));var _0x1027=function(_0x524de5,_0x17e494){_0x524de5=_0x524de5-0x0;var _0x1a7a5f=_0x0271[_0x524de5];return _0x1a7a5f;};'use strict';var multer=require(_0x1027('0x0'));var util=require(_0x1027('0x1'));var path=require(_0x1027('0x2'));var timeout=require(_0x1027('0x3'));var express=require('express');var router=express[_0x1027('0x4')]();var fs_extra=require(_0x1027('0x5'));var auth=require(_0x1027('0x6'));var interaction=require(_0x1027('0x7'));var config=require(_0x1027('0x8'));var controller=require(_0x1027('0x9'));router[_0x1027('0xa')]('/',auth[_0x1027('0xb')](),controller[_0x1027('0xc')]);router[_0x1027('0xa')](_0x1027('0xd'),auth[_0x1027('0xb')](),controller[_0x1027('0xe')]);router['get']('/:id',auth[_0x1027('0xf')](),controller[_0x1027('0x10')]);router[_0x1027('0xa')](_0x1027('0x11'),auth[_0x1027('0xf')](),controller['attachmentDownload']);router[_0x1027('0xa')]('/:id/messages',auth[_0x1027('0xb')](),controller['getMessages']);router[_0x1027('0xa')](_0x1027('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x1027('0x13')]);router['get']('/:id/download',auth[_0x1027('0xb')](),controller[_0x1027('0x14')]);router[_0x1027('0x15')]('/',auth[_0x1027('0xb')](),controller[_0x1027('0x16')]);router['post'](_0x1027('0x17'),auth['isAuthenticated'](),controller[_0x1027('0x18')]);var upload=multer({'storage':multer[_0x1027('0x19')]({'destination':function(_0x1e592e,_0x441cd6,_0x30da44){_0x30da44(null,path[_0x1027('0x1a')](config['root'],_0x1027('0x1b')));},'filename':function(_0x50dd0c,_0x167524,_0x3be189){_0x3be189(null,util['format'](_0x1027('0x1c'),Date[_0x1027('0x1d')](),_0x167524[_0x1027('0x1e')][_0x1027('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1027('0x15')](_0x1027('0x20'),upload[_0x1027('0x21')]('file'),controller['attachmentUpload']);router[_0x1027('0x15')](_0x1027('0x22'),auth[_0x1027('0xf')](),controller['addMessage']);router[_0x1027('0x15')](_0x1027('0x23'),auth[_0x1027('0xb')](),interaction[_0x1027('0x24')](_0x1027('0x25'),_0x1027('0x26')),controller[_0x1027('0x27')]);router[_0x1027('0x28')](_0x1027('0x29'),auth[_0x1027('0xb')](),interaction['tracked'](_0x1027('0x25'),_0x1027('0x2a')),controller[_0x1027('0x2b')]);router[_0x1027('0x28')]('/:id/custom_update',controller[_0x1027('0x2c')]);router[_0x1027('0x28')](_0x1027('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0x1027('0x2e')]);router[_0x1027('0x28')](_0x1027('0x2f'),controller[_0x1027('0x30')]);router['delete'](_0x1027('0x29'),auth[_0x1027('0xb')](),interaction['tracked'](_0x1027('0x25'),'chatinteraction:destroy'),controller[_0x1027('0x31')]);router[_0x1027('0x32')]('/:id/tags',auth[_0x1027('0xb')](),controller['removeTags']);module[_0x1027('0x33')]=router;
\ No newline at end of file
+var _0xf2eb=['destroy','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy'];(function(_0x18d50f,_0x124aff){var _0x8ce385=function(_0x321962){while(--_0x321962){_0x18d50f['push'](_0x18d50f['shift']());}};_0x8ce385(++_0x124aff);}(_0xf2eb,0x120));var _0xbf2e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xf2eb[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0xbf2e('0x0'));var util=require(_0xbf2e('0x1'));var path=require(_0xbf2e('0x2'));var timeout=require(_0xbf2e('0x3'));var express=require(_0xbf2e('0x4'));var router=express[_0xbf2e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbf2e('0x6'));var interaction=require(_0xbf2e('0x7'));var config=require(_0xbf2e('0x8'));var controller=require(_0xbf2e('0x9'));router[_0xbf2e('0xa')]('/',auth[_0xbf2e('0xb')](),controller['index']);router['get'](_0xbf2e('0xc'),auth[_0xbf2e('0xb')](),controller[_0xbf2e('0xd')]);router['get'](_0xbf2e('0xe'),auth[_0xbf2e('0xf')](),controller['show']);router[_0xbf2e('0xa')](_0xbf2e('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xbf2e('0x11')]);router['get'](_0xbf2e('0x12'),auth[_0xbf2e('0xb')](),controller[_0xbf2e('0x13')]);router[_0xbf2e('0xa')](_0xbf2e('0x14'),auth[_0xbf2e('0xf')](),controller['getMyMessages']);router['get'](_0xbf2e('0x15'),auth['isAuthenticated'](),controller['download']);router[_0xbf2e('0x16')]('/',auth['isAuthenticated'](),controller[_0xbf2e('0x17')]);router[_0xbf2e('0x16')](_0xbf2e('0x18'),auth[_0xbf2e('0xb')](),controller[_0xbf2e('0x19')]);var upload=multer({'storage':multer[_0xbf2e('0x1a')]({'destination':function(_0x11eb6d,_0x53285d,_0x19d73c){_0x19d73c(null,path[_0xbf2e('0x1b')](config[_0xbf2e('0x1c')],_0xbf2e('0x1d')));},'filename':function(_0xa92968,_0x3fee43,_0x27efad){_0x27efad(null,util[_0xbf2e('0x1e')](_0xbf2e('0x1f'),Date[_0xbf2e('0x20')](),_0x3fee43[_0xbf2e('0x21')][_0xbf2e('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbf2e('0x16')](_0xbf2e('0x23'),upload[_0xbf2e('0x24')](_0xbf2e('0x25')),controller[_0xbf2e('0x26')]);router[_0xbf2e('0x16')](_0xbf2e('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xbf2e('0x27')]);router[_0xbf2e('0x16')](_0xbf2e('0x28'),auth[_0xbf2e('0xb')](),interaction[_0xbf2e('0x29')](_0xbf2e('0x2a'),_0xbf2e('0x2b')),controller[_0xbf2e('0x2c')]);router[_0xbf2e('0x2d')]('/:id',auth[_0xbf2e('0xb')](),interaction[_0xbf2e('0x29')](_0xbf2e('0x2a'),'chatinteraction:update'),controller[_0xbf2e('0x2e')]);router[_0xbf2e('0x2d')](_0xbf2e('0x2f'),controller[_0xbf2e('0x30')]);router[_0xbf2e('0x2d')](_0xbf2e('0x31'),auth[_0xbf2e('0xf')](),controller[_0xbf2e('0x32')]);router['put'](_0xbf2e('0x33'),controller[_0xbf2e('0x34')]);router['delete'](_0xbf2e('0xe'),auth['isAuthenticated'](),interaction[_0xbf2e('0x29')](_0xbf2e('0x2a'),_0xbf2e('0x35')),controller[_0xbf2e('0x36')]);router[_0xbf2e('0x37')](_0xbf2e('0x28'),auth[_0xbf2e('0xb')](),controller['removeTags']);module[_0xbf2e('0x38')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index db4f42a..481701b 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 _0xdca8=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xdca8,0x15f));var _0x8dca=function(_0x1678db,_0x3a5489){_0x1678db=_0x1678db-0x0;var _0x245f29=_0xdca8[_0x1678db];return _0x245f29;};'use strict';var Sequelize=require(_0x8dca('0x0'));module[_0x8dca('0x1')]={'body':{'type':Sequelize[_0x8dca('0x2')](_0x8dca('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8dca('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8dca('0x5')]}};
\ No newline at end of file
+var _0xd3b3=['TEXT','BOOLEAN','INTEGER'];(function(_0x1f5bcc,_0x4e8729){var _0x537bd7=function(_0x419cf4){while(--_0x419cf4){_0x1f5bcc['push'](_0x1f5bcc['shift']());}};_0x537bd7(++_0x4e8729);}(_0xd3b3,0x1ad));var _0x3d3b=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xd3b3[_0x31b5a5];return _0x364cc9;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3d3b('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3d3b('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3d3b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index efdf8e5..b6ef30e 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 _0xa6c4=['sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','show','params','rawAttributes','fields','include','find','create','body','catch','describe','get','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','push','messages','createdAt','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','ChatInternalMessage','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa6c4,0x119));var _0x4a6c=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0xa6c4[_0x29e35f];return _0x266b74;};'use strict';var emlformat=require(_0x4a6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a6c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a6c('0x2'));var moment=require(_0x4a6c('0x3'));var BPromise=require(_0x4a6c('0x4'));var Mustache=require(_0x4a6c('0x5'));var util=require(_0x4a6c('0x6'));var path=require(_0x4a6c('0x7'));var sox=require(_0x4a6c('0x8'));var csv=require(_0x4a6c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4a6c('0xa'));var crypto=require(_0x4a6c('0xb'));var jsforce=require(_0x4a6c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4a6c('0x9'));var querystring=require(_0x4a6c('0xd'));var Papa=require(_0x4a6c('0xe'));var Redis=require(_0x4a6c('0xf'));var authService=require(_0x4a6c('0x10'));var qs=require(_0x4a6c('0x11'));var as=require(_0x4a6c('0x12'));var hardwareService=require(_0x4a6c('0x13'));var logger=require('../../config/logger')(_0x4a6c('0x14'));var utils=require(_0x4a6c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4a6c('0x16'));var db=require(_0x4a6c('0x17'))['db'];config[_0x4a6c('0x18')]=_[_0x4a6c('0x19')](config['redis'],{'host':_0x4a6c('0x1a'),'port':0x18eb});var socket=require(_0x4a6c('0x1b'))(new Redis(config[_0x4a6c('0x18')]));require('./chatInternalMessage.socket')[_0x4a6c('0x1c')](socket);function respondWithStatusCode(_0x8b02cb,_0xa59264){_0xa59264=_0xa59264||0xcc;return function(_0x109266){if(_0x109266){return _0x8b02cb[_0x4a6c('0x1d')](_0xa59264);}return _0x8b02cb[_0x4a6c('0x1e')](_0xa59264)[_0x4a6c('0x1f')]();};}function respondWithResult(_0x5f6856,_0x40666c){_0x40666c=_0x40666c||0xc8;return function(_0x1cf664){if(_0x1cf664){return _0x5f6856['status'](_0x40666c)[_0x4a6c('0x20')](_0x1cf664);}};}function respondWithFilteredResult(_0x2ef347,_0x3874a0){return function(_0x3ff422){if(_0x3ff422){var _0xfdb3ab=typeof _0x3874a0[_0x4a6c('0x21')]===_0x4a6c('0x22')&&typeof _0x3874a0['limit']==='undefined';var _0x25c659=_0x3ff422['count'];var _0xede467=_0xfdb3ab?0x0:_0x3874a0[_0x4a6c('0x21')];var _0x18fa99=_0xfdb3ab?_0x3ff422['count']:_0x3874a0[_0x4a6c('0x21')]+_0x3874a0[_0x4a6c('0x23')];var _0x1c9ba2;if(_0x18fa99>=_0x25c659){_0x18fa99=_0x25c659;_0x1c9ba2=0xc8;}else{_0x1c9ba2=0xce;}_0x2ef347[_0x4a6c('0x1e')](_0x1c9ba2);return _0x2ef347[_0x4a6c('0x24')](_0x4a6c('0x25'),_0xede467+'-'+_0x18fa99+'/'+_0x25c659)[_0x4a6c('0x20')](_0x3ff422);}return null;};}function patchUpdates(_0x2646f3){return function(_0x144df8){try{jsonpatch[_0x4a6c('0x26')](_0x144df8,_0x2646f3,!![]);}catch(_0x2b8e16){return BPromise[_0x4a6c('0x27')](_0x2b8e16);}return _0x144df8[_0x4a6c('0x28')]();};}function saveUpdates(_0x43d196,_0x35694d){return function(_0x27322a){if(_0x27322a){return _0x27322a[_0x4a6c('0x29')](_0x43d196)[_0x4a6c('0x2a')](function(_0x157e53){return _0x157e53;});}return null;};}function removeEntity(_0x102c4b,_0x5b87fc){return function(_0x47d38c){if(_0x47d38c){return _0x47d38c[_0x4a6c('0x2b')]()['then'](function(){_0x102c4b[_0x4a6c('0x1e')](0xcc)[_0x4a6c('0x1f')]();});}};}function handleEntityNotFound(_0x5b0a49,_0x6ceb18){return function(_0x19c277){if(!_0x19c277){_0x5b0a49[_0x4a6c('0x1d')](0x194);}return _0x19c277;};}function handleError(_0x16af77,_0xd837c8){_0xd837c8=_0xd837c8||0x1f4;return function(_0x2f8902){logger[_0x4a6c('0x2c')](_0x2f8902[_0x4a6c('0x2d')]);if(_0x2f8902['name']){delete _0x2f8902[_0x4a6c('0x2e')];}_0x16af77['status'](_0xd837c8)['send'](_0x2f8902);};}exports[_0x4a6c('0x2f')]=function(_0x5f1818,_0x1907fd){var _0x32fc21={},_0x3d3e4a={},_0x11f4e0={'count':0x0,'rows':[]};var _0x496581=_['map'](db[_0x4a6c('0x30')]['rawAttributes'],function(_0x3efda9){return{'name':_0x3efda9[_0x4a6c('0x31')],'type':_0x3efda9['type'][_0x4a6c('0x32')]};});_0x3d3e4a[_0x4a6c('0x33')]=_[_0x4a6c('0x34')](_0x496581,_0x4a6c('0x2e'));_0x3d3e4a[_0x4a6c('0x35')]=_[_0x4a6c('0x36')](_0x5f1818[_0x4a6c('0x35')]);_0x3d3e4a[_0x4a6c('0x37')]=_[_0x4a6c('0x38')](_0x3d3e4a[_0x4a6c('0x33')],_0x3d3e4a[_0x4a6c('0x35')]);_0x32fc21['attributes']=_[_0x4a6c('0x38')](_0x3d3e4a['model'],qs['fields'](_0x5f1818[_0x4a6c('0x35')]['fields']));_0x32fc21[_0x4a6c('0x39')]=_0x32fc21[_0x4a6c('0x39')][_0x4a6c('0x3a')]?_0x32fc21[_0x4a6c('0x39')]:_0x3d3e4a[_0x4a6c('0x33')];if(!_0x5f1818[_0x4a6c('0x35')]['hasOwnProperty'](_0x4a6c('0x3b'))){_0x32fc21[_0x4a6c('0x23')]=qs[_0x4a6c('0x23')](_0x5f1818['query']['limit']);_0x32fc21[_0x4a6c('0x21')]=qs[_0x4a6c('0x21')](_0x5f1818['query'][_0x4a6c('0x21')]);}_0x32fc21[_0x4a6c('0x3c')]=qs[_0x4a6c('0x3d')](_0x5f1818[_0x4a6c('0x35')][_0x4a6c('0x3d')]);_0x32fc21['where']=qs['filters'](_[_0x4a6c('0x3e')](_0x5f1818[_0x4a6c('0x35')],_0x3d3e4a['filters']),_0x496581);if(_0x5f1818[_0x4a6c('0x35')][_0x4a6c('0x3f')]){_0x32fc21[_0x4a6c('0x40')]=_[_0x4a6c('0x41')](_0x32fc21[_0x4a6c('0x40')],{'$or':_[_0x4a6c('0x34')](_0x496581,function(_0x3f9c12){if(_0x3f9c12['type']!==_0x4a6c('0x42')){var _0x30c9b8={};_0x30c9b8[_0x3f9c12[_0x4a6c('0x2e')]]={'$like':'%'+_0x5f1818[_0x4a6c('0x35')]['filter']+'%'};return _0x30c9b8;}})});}_0x32fc21=_[_0x4a6c('0x41')]({},_0x32fc21,_0x5f1818[_0x4a6c('0x43')]);var _0x54f906={'where':_0x32fc21[_0x4a6c('0x40')]};return db[_0x4a6c('0x30')]['count'](_0x54f906)[_0x4a6c('0x2a')](function(_0x57b407){_0x11f4e0[_0x4a6c('0x44')]=_0x57b407;if(_0x5f1818['query'][_0x4a6c('0x45')]){_0x32fc21['include']=[{'all':!![]}];}return db[_0x4a6c('0x30')]['findAll'](_0x32fc21);})['then'](function(_0x1b075d){_0x11f4e0['rows']=_0x1b075d;return _0x11f4e0;})[_0x4a6c('0x2a')](respondWithFilteredResult(_0x1907fd,_0x32fc21))['catch'](handleError(_0x1907fd,null));};exports[_0x4a6c('0x46')]=function(_0x962046,_0x56f494){var _0x2d24e8={'raw':!![],'where':{'id':_0x962046[_0x4a6c('0x47')]['id']}},_0x15b3a3={};_0x15b3a3[_0x4a6c('0x33')]=_[_0x4a6c('0x36')](db[_0x4a6c('0x30')][_0x4a6c('0x48')]);_0x15b3a3['query']=_[_0x4a6c('0x36')](_0x962046[_0x4a6c('0x35')]);_0x15b3a3['filters']=_['intersection'](_0x15b3a3['model'],_0x15b3a3[_0x4a6c('0x35')]);_0x2d24e8[_0x4a6c('0x39')]=_[_0x4a6c('0x38')](_0x15b3a3[_0x4a6c('0x33')],qs[_0x4a6c('0x49')](_0x962046[_0x4a6c('0x35')]['fields']));_0x2d24e8[_0x4a6c('0x39')]=_0x2d24e8[_0x4a6c('0x39')][_0x4a6c('0x3a')]?_0x2d24e8[_0x4a6c('0x39')]:_0x15b3a3[_0x4a6c('0x33')];if(_0x962046[_0x4a6c('0x35')][_0x4a6c('0x45')]){_0x2d24e8[_0x4a6c('0x4a')]=[{'all':!![]}];}_0x2d24e8=_[_0x4a6c('0x41')]({},_0x2d24e8,_0x962046[_0x4a6c('0x43')]);return db['ChatInternalMessage'][_0x4a6c('0x4b')](_0x2d24e8)[_0x4a6c('0x2a')](handleEntityNotFound(_0x56f494,null))[_0x4a6c('0x2a')](respondWithResult(_0x56f494,null))['catch'](handleError(_0x56f494,null));};exports[_0x4a6c('0x4c')]=function(_0x4c360f,_0x119e76){return db[_0x4a6c('0x30')][_0x4a6c('0x4c')](_0x4c360f[_0x4a6c('0x4d')],{})[_0x4a6c('0x2a')](respondWithResult(_0x119e76,0xc9))['catch'](handleError(_0x119e76,null));};exports[_0x4a6c('0x29')]=function(_0x3dca30,_0x3f168c){if(_0x3dca30['body']['id']){delete _0x3dca30[_0x4a6c('0x4d')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x3dca30[_0x4a6c('0x47')]['id']}})[_0x4a6c('0x2a')](handleEntityNotFound(_0x3f168c,null))['then'](saveUpdates(_0x3dca30[_0x4a6c('0x4d')],null))[_0x4a6c('0x2a')](respondWithResult(_0x3f168c,null))[_0x4a6c('0x4e')](handleError(_0x3f168c,null));};exports['destroy']=function(_0x40a857,_0x4b5792){return db[_0x4a6c('0x30')][_0x4a6c('0x4b')]({'where':{'id':_0x40a857[_0x4a6c('0x47')]['id']}})[_0x4a6c('0x2a')](handleEntityNotFound(_0x4b5792,null))[_0x4a6c('0x2a')](removeEntity(_0x4b5792,null))[_0x4a6c('0x4e')](handleError(_0x4b5792,null));};exports[_0x4a6c('0x4f')]=function(_0x408aac,_0x3e83b6){return db[_0x4a6c('0x30')]['describe']()[_0x4a6c('0x2a')](respondWithResult(_0x3e83b6,null))[_0x4a6c('0x4e')](handleError(_0x3e83b6,null));};function wrapUser(_0x4e2426){return function(_0xa5d437){var _0xfaeef7=_0x4e2426[_0x4a6c('0x50')]({'plain':!![]});_0xfaeef7['messages']=[];if(_0xa5d437){_0xfaeef7[_0x4a6c('0x51')]=_0xa5d437['createdAt'];_0xfaeef7[_0x4a6c('0x52')]=_0xa5d437;}else{_0xfaeef7[_0x4a6c('0x51')]=moment(0x0)[_0x4a6c('0x53')](_0x4a6c('0x54'));_0xfaeef7[_0x4a6c('0x52')]={};}return _0xfaeef7;};}exports[_0x4a6c('0x55')]=function(_0x56e025,_0x2522c5,_0x2f9593){var _0xbad15b=[];return db[_0x4a6c('0x56')][_0x4a6c('0x57')]({'where':{'role':[_0x4a6c('0x58'),_0x4a6c('0x59'),'user']},'attributes':['id',_0x4a6c('0x5a'),'name','role','userpic',_0x4a6c('0x5b'),_0x4a6c('0x5c'),_0x4a6c('0x5d'),_0x4a6c('0x5e'),'showWebBar'],'order':qs['sort'](_0x4a6c('0x5f')),'include':[{'model':db[_0x4a6c('0x60')],'as':_0x4a6c('0x61'),'attributes':['id',_0x4a6c('0x2e'),_0x4a6c('0x62')],'through':{'attributes':[]}}]})[_0x4a6c('0x2a')](function(_0x42e444){if(_0x42e444){var _0x20a5cc=_0x56e025[_0x4a6c('0x63')]['get']({'plain':!![]});if(!_0x20a5cc)throw new Error(_0x4a6c('0x64'));if(_0x20a5cc[_0x4a6c('0x65')]===_0x4a6c('0x63')){return db[_0x4a6c('0x66')][_0x4a6c('0x4b')]({'where':{'name':_0x4a6c('0x67'),'userProfileId':_0x20a5cc[_0x4a6c('0x68')]},'raw':!![]})[_0x4a6c('0x2a')](function(_0x11c3b2){if(_0x11c3b2){if(_0x11c3b2[_0x4a6c('0x69')]===0x0){return db['UserProfileResource'][_0x4a6c('0x57')]({'where':{'sectionId':_0x11c3b2['id']},'raw':!![]})[_0x4a6c('0x2a')](function(_0x3367ce){var _0x351563=[];if(_['isEmpty'](_0x3367ce)){_0x351563=_['filter'](_0x42e444,function(_0x19f0da){if(_0x19f0da[_0x4a6c('0x65')]!==_0x4a6c('0x58')){return _0x19f0da;}});return _0x351563;}else{for(var _0x4d026e=0x0;_0x4d026e<_0x42e444[_0x4a6c('0x3a')];_0x4d026e++){var _0x4eb752=_0x42e444[_0x4d026e];if(_0x4eb752[_0x4a6c('0x65')]===_0x4a6c('0x58')){var _0x409720=_[_0x4a6c('0x4b')](_0x3367ce,function(_0x202d18){return _0x202d18['resourceId']===_0x4eb752['id'];});if(_0x409720)_0x351563['push'](_0x4eb752);}else{_0x351563[_0x4a6c('0x6a')](_0x4eb752);}}return _0x351563;}});}else{return _0x42e444;}}else{var _0x3f474b=_['filter'](_0x42e444,function(_0xb79e7d){if(_0xb79e7d[_0x4a6c('0x65')]!=='agent'){return _0xb79e7d;}});return _0x3f474b;}});}else{return _0x42e444;}}})[_0x4a6c('0x2a')](function(_0x4a9ac5){var _0x403b2e=[];if(_0x4a9ac5){_0xbad15b=_0x4a9ac5;for(var _0x1b07bf=0x0;_0x1b07bf<_0x4a9ac5[_0x4a6c('0x3a')];_0x1b07bf+=0x1){_0xbad15b[_0x1b07bf][_0x4a6c('0x6b')]=[];_0x403b2e[_0x4a6c('0x6a')](db[_0x4a6c('0x30')][_0x4a6c('0x4b')]({'where':{'FromId':[_0x56e025[_0x4a6c('0x63')]['id'],_0x4a9ac5[_0x1b07bf]['id']],'ToId':[_0x56e025['user']['id'],_0x4a9ac5[_0x1b07bf]['id']],'ChatGroupId':null},'attributes':['id',_0x4a6c('0x6c'),_0x4a6c('0x6d'),_0x4a6c('0x6e'),_0x4a6c('0x6f'),_0x4a6c('0x4d')],'order':qs[_0x4a6c('0x3d')](_0x4a6c('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x4a9ac5[_0x1b07bf])));}return BPromise[_0x4a6c('0x71')](_0x403b2e);}return[];})[_0x4a6c('0x2a')](function(_0x3cfad4){return{'rows':_0x3cfad4,'count':_0x3cfad4[_0x4a6c('0x3a')]};})['then'](respondWithResult(_0x2522c5,null))[_0x4a6c('0x4e')](handleError(_0x2522c5,null));};
\ No newline at end of file
+var _0xb82e=['userProfileId','autoAssociation','isEmpty','resourceId','push','messages','FromId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','options','ChatInternalMessage','includeAll','include','findAll','rows','show','params','find','catch','create','update','body','describe','createdAt','lastMessage','lastMessageAt','format','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents'];(function(_0x4cd86a,_0x2416ea){var _0x4bbff0=function(_0x16b25e){while(--_0x16b25e){_0x4cd86a['push'](_0x4cd86a['shift']());}};_0x4bbff0(++_0x2416ea);}(_0xb82e,0x79));var _0xeb82=function(_0x2ed357,_0x5c7bab){_0x2ed357=_0x2ed357-0x0;var _0x2da7cd=_0xb82e[_0x2ed357];return _0x2da7cd;};'use strict';var emlformat=require(_0xeb82('0x0'));var rimraf=require(_0xeb82('0x1'));var zipdir=require(_0xeb82('0x2'));var jsonpatch=require(_0xeb82('0x3'));var rp=require(_0xeb82('0x4'));var moment=require(_0xeb82('0x5'));var BPromise=require(_0xeb82('0x6'));var Mustache=require(_0xeb82('0x7'));var util=require(_0xeb82('0x8'));var path=require(_0xeb82('0x9'));var sox=require(_0xeb82('0xa'));var csv=require(_0xeb82('0xb'));var ejs=require(_0xeb82('0xc'));var fs=require('fs');var fs_extra=require(_0xeb82('0xd'));var _=require('lodash');var squel=require(_0xeb82('0xe'));var crypto=require(_0xeb82('0xf'));var jsforce=require(_0xeb82('0x10'));var deskjs=require(_0xeb82('0x11'));var toCsv=require(_0xeb82('0xb'));var querystring=require(_0xeb82('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeb82('0x13'));var hardwareService=require(_0xeb82('0x14'));var logger=require(_0xeb82('0x15'))('api');var utils=require(_0xeb82('0x16'));var config=require(_0xeb82('0x17'));var licenseUtil=require(_0xeb82('0x18'));var db=require('../../mysqldb')['db'];config[_0xeb82('0x19')]=_[_0xeb82('0x1a')](config[_0xeb82('0x19')],{'host':_0xeb82('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xeb82('0x1c')](socket);function respondWithStatusCode(_0x3dbc93,_0x260406){_0x260406=_0x260406||0xcc;return function(_0x1fad63){if(_0x1fad63){return _0x3dbc93[_0xeb82('0x1d')](_0x260406);}return _0x3dbc93[_0xeb82('0x1e')](_0x260406)[_0xeb82('0x1f')]();};}function respondWithResult(_0x438608,_0x32a0f5){_0x32a0f5=_0x32a0f5||0xc8;return function(_0x287414){if(_0x287414){return _0x438608[_0xeb82('0x1e')](_0x32a0f5)[_0xeb82('0x20')](_0x287414);}};}function respondWithFilteredResult(_0x6593a9,_0x5819f7){return function(_0xb797b2){if(_0xb797b2){var _0x4d2679=typeof _0x5819f7[_0xeb82('0x21')]===_0xeb82('0x22')&&typeof _0x5819f7[_0xeb82('0x23')]===_0xeb82('0x22');var _0x5368ce=_0xb797b2[_0xeb82('0x24')];var _0xf8fbaa=_0x4d2679?0x0:_0x5819f7[_0xeb82('0x21')];var _0x15f6b6=_0x4d2679?_0xb797b2['count']:_0x5819f7[_0xeb82('0x21')]+_0x5819f7[_0xeb82('0x23')];var _0x45eb33;if(_0x15f6b6>=_0x5368ce){_0x15f6b6=_0x5368ce;_0x45eb33=0xc8;}else{_0x45eb33=0xce;}_0x6593a9[_0xeb82('0x1e')](_0x45eb33);return _0x6593a9[_0xeb82('0x25')](_0xeb82('0x26'),_0xf8fbaa+'-'+_0x15f6b6+'/'+_0x5368ce)[_0xeb82('0x20')](_0xb797b2);}return null;};}function patchUpdates(_0x21987b){return function(_0x1eee35){try{jsonpatch[_0xeb82('0x27')](_0x1eee35,_0x21987b,!![]);}catch(_0x1a2d5b){return BPromise[_0xeb82('0x28')](_0x1a2d5b);}return _0x1eee35[_0xeb82('0x29')]();};}function saveUpdates(_0x150584,_0x209d52){return function(_0x132bb1){if(_0x132bb1){return _0x132bb1['update'](_0x150584)[_0xeb82('0x2a')](function(_0x11b062){return _0x11b062;});}return null;};}function removeEntity(_0x3cc6db,_0x347c36){return function(_0x2f101c){if(_0x2f101c){return _0x2f101c['destroy']()[_0xeb82('0x2a')](function(){_0x3cc6db[_0xeb82('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce74b,_0x310e87){return function(_0x5088e0){if(!_0x5088e0){_0x5ce74b[_0xeb82('0x1d')](0x194);}return _0x5088e0;};}function handleError(_0x5eaa82,_0x387907){_0x387907=_0x387907||0x1f4;return function(_0x1bdf54){logger['error'](_0x1bdf54[_0xeb82('0x2b')]);if(_0x1bdf54[_0xeb82('0x2c')]){delete _0x1bdf54[_0xeb82('0x2c')];}_0x5eaa82[_0xeb82('0x1e')](_0x387907)[_0xeb82('0x2d')](_0x1bdf54);};}exports[_0xeb82('0x2e')]=function(_0x997188,_0x2f8316){var _0x49e820={},_0x31f136={},_0x141025={'count':0x0,'rows':[]};var _0x5a9fdd=_['map'](db['ChatInternalMessage'][_0xeb82('0x2f')],function(_0x464a4a){return{'name':_0x464a4a[_0xeb82('0x30')],'type':_0x464a4a[_0xeb82('0x31')][_0xeb82('0x32')]};});_0x31f136['model']=_['map'](_0x5a9fdd,'name');_0x31f136['query']=_[_0xeb82('0x33')](_0x997188[_0xeb82('0x34')]);_0x31f136[_0xeb82('0x35')]=_[_0xeb82('0x36')](_0x31f136[_0xeb82('0x37')],_0x31f136[_0xeb82('0x34')]);_0x49e820['attributes']=_[_0xeb82('0x36')](_0x31f136[_0xeb82('0x37')],qs[_0xeb82('0x38')](_0x997188['query'][_0xeb82('0x38')]));_0x49e820['attributes']=_0x49e820['attributes'][_0xeb82('0x39')]?_0x49e820[_0xeb82('0x3a')]:_0x31f136[_0xeb82('0x37')];if(!_0x997188['query'][_0xeb82('0x3b')]('nolimit')){_0x49e820[_0xeb82('0x23')]=qs['limit'](_0x997188[_0xeb82('0x34')]['limit']);_0x49e820[_0xeb82('0x21')]=qs[_0xeb82('0x21')](_0x997188[_0xeb82('0x34')][_0xeb82('0x21')]);}_0x49e820[_0xeb82('0x3c')]=qs[_0xeb82('0x3d')](_0x997188[_0xeb82('0x34')]['sort']);_0x49e820[_0xeb82('0x3e')]=qs[_0xeb82('0x35')](_[_0xeb82('0x3f')](_0x997188[_0xeb82('0x34')],_0x31f136[_0xeb82('0x35')]),_0x5a9fdd);if(_0x997188[_0xeb82('0x34')]['filter']){_0x49e820['where']=_[_0xeb82('0x40')](_0x49e820[_0xeb82('0x3e')],{'$or':_[_0xeb82('0x41')](_0x5a9fdd,function(_0x5b6de6){if(_0x5b6de6[_0xeb82('0x31')]!==_0xeb82('0x42')){var _0x408688={};_0x408688[_0x5b6de6[_0xeb82('0x2c')]]={'$like':'%'+_0x997188[_0xeb82('0x34')][_0xeb82('0x43')]+'%'};return _0x408688;}})});}_0x49e820=_[_0xeb82('0x40')]({},_0x49e820,_0x997188[_0xeb82('0x44')]);var _0x3682f4={'where':_0x49e820[_0xeb82('0x3e')]};return db[_0xeb82('0x45')][_0xeb82('0x24')](_0x3682f4)['then'](function(_0x5137fd){_0x141025[_0xeb82('0x24')]=_0x5137fd;if(_0x997188[_0xeb82('0x34')][_0xeb82('0x46')]){_0x49e820[_0xeb82('0x47')]=[{'all':!![]}];}return db[_0xeb82('0x45')][_0xeb82('0x48')](_0x49e820);})[_0xeb82('0x2a')](function(_0x37fd7b){_0x141025[_0xeb82('0x49')]=_0x37fd7b;return _0x141025;})['then'](respondWithFilteredResult(_0x2f8316,_0x49e820))['catch'](handleError(_0x2f8316,null));};exports[_0xeb82('0x4a')]=function(_0x2e652b,_0x3c4e99){var _0x314baf={'raw':!![],'where':{'id':_0x2e652b[_0xeb82('0x4b')]['id']}},_0x26128f={};_0x26128f['model']=_[_0xeb82('0x33')](db[_0xeb82('0x45')][_0xeb82('0x2f')]);_0x26128f[_0xeb82('0x34')]=_[_0xeb82('0x33')](_0x2e652b[_0xeb82('0x34')]);_0x26128f[_0xeb82('0x35')]=_['intersection'](_0x26128f['model'],_0x26128f['query']);_0x314baf['attributes']=_[_0xeb82('0x36')](_0x26128f[_0xeb82('0x37')],qs['fields'](_0x2e652b[_0xeb82('0x34')][_0xeb82('0x38')]));_0x314baf['attributes']=_0x314baf[_0xeb82('0x3a')][_0xeb82('0x39')]?_0x314baf[_0xeb82('0x3a')]:_0x26128f[_0xeb82('0x37')];if(_0x2e652b[_0xeb82('0x34')]['includeAll']){_0x314baf['include']=[{'all':!![]}];}_0x314baf=_[_0xeb82('0x40')]({},_0x314baf,_0x2e652b[_0xeb82('0x44')]);return db[_0xeb82('0x45')][_0xeb82('0x4c')](_0x314baf)[_0xeb82('0x2a')](handleEntityNotFound(_0x3c4e99,null))[_0xeb82('0x2a')](respondWithResult(_0x3c4e99,null))[_0xeb82('0x4d')](handleError(_0x3c4e99,null));};exports[_0xeb82('0x4e')]=function(_0x41caf7,_0x552959){return db[_0xeb82('0x45')][_0xeb82('0x4e')](_0x41caf7['body'],{})[_0xeb82('0x2a')](respondWithResult(_0x552959,0xc9))['catch'](handleError(_0x552959,null));};exports[_0xeb82('0x4f')]=function(_0xdd7304,_0x2bbe31){if(_0xdd7304[_0xeb82('0x50')]['id']){delete _0xdd7304[_0xeb82('0x50')]['id'];}return db[_0xeb82('0x45')]['find']({'where':{'id':_0xdd7304[_0xeb82('0x4b')]['id']}})[_0xeb82('0x2a')](handleEntityNotFound(_0x2bbe31,null))['then'](saveUpdates(_0xdd7304[_0xeb82('0x50')],null))[_0xeb82('0x2a')](respondWithResult(_0x2bbe31,null))[_0xeb82('0x4d')](handleError(_0x2bbe31,null));};exports['destroy']=function(_0x4785d5,_0x1dfb60){return db['ChatInternalMessage'][_0xeb82('0x4c')]({'where':{'id':_0x4785d5[_0xeb82('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1dfb60,null))[_0xeb82('0x2a')](removeEntity(_0x1dfb60,null))[_0xeb82('0x4d')](handleError(_0x1dfb60,null));};exports[_0xeb82('0x51')]=function(_0x3c1fcd,_0x2a66c5){return db[_0xeb82('0x45')][_0xeb82('0x51')]()[_0xeb82('0x2a')](respondWithResult(_0x2a66c5,null))[_0xeb82('0x4d')](handleError(_0x2a66c5,null));};function wrapUser(_0x4f6c62){return function(_0x883050){var _0x438406=_0x4f6c62['get']({'plain':!![]});_0x438406['messages']=[];if(_0x883050){_0x438406['lastMessageAt']=_0x883050[_0xeb82('0x52')];_0x438406[_0xeb82('0x53')]=_0x883050;}else{_0x438406[_0xeb82('0x54')]=moment(0x0)[_0xeb82('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x438406[_0xeb82('0x53')]={};}return _0x438406;};}exports['getUsers']=function(_0x227989,_0x21f803,_0x29fe2d){var _0x422b7a=[];return db[_0xeb82('0x56')][_0xeb82('0x48')]({'where':{'role':[_0xeb82('0x57'),'admin',_0xeb82('0x58')]},'attributes':['id',_0xeb82('0x59'),_0xeb82('0x2c'),_0xeb82('0x5a'),_0xeb82('0x5b'),_0xeb82('0x5c'),_0xeb82('0x5d'),_0xeb82('0x5e'),_0xeb82('0x5f'),_0xeb82('0x60')],'order':qs[_0xeb82('0x3d')](_0xeb82('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0xeb82('0x62'),'attributes':['id','name',_0xeb82('0x31')],'through':{'attributes':[]}}]})[_0xeb82('0x2a')](function(_0x334f3a){if(_0x334f3a){var _0x3d9a67=_0x227989[_0xeb82('0x58')][_0xeb82('0x63')]({'plain':!![]});if(!_0x3d9a67)throw new Error(_0xeb82('0x64'));if(_0x3d9a67[_0xeb82('0x5a')]==='user'){return db[_0xeb82('0x65')][_0xeb82('0x4c')]({'where':{'name':_0xeb82('0x66'),'userProfileId':_0x3d9a67[_0xeb82('0x67')]},'raw':!![]})['then'](function(_0x56ac00){if(_0x56ac00){if(_0x56ac00[_0xeb82('0x68')]===0x0){return db['UserProfileResource'][_0xeb82('0x48')]({'where':{'sectionId':_0x56ac00['id']},'raw':!![]})['then'](function(_0xf1d56f){var _0x32edf9=[];if(_[_0xeb82('0x69')](_0xf1d56f)){_0x32edf9=_[_0xeb82('0x43')](_0x334f3a,function(_0x3f37b0){if(_0x3f37b0['role']!==_0xeb82('0x57')){return _0x3f37b0;}});return _0x32edf9;}else{for(var _0x267ab5=0x0;_0x267ab5<_0x334f3a[_0xeb82('0x39')];_0x267ab5++){var _0x2ec708=_0x334f3a[_0x267ab5];if(_0x2ec708[_0xeb82('0x5a')]===_0xeb82('0x57')){var _0xfe38a2=_[_0xeb82('0x4c')](_0xf1d56f,function(_0x443efa){return _0x443efa[_0xeb82('0x6a')]===_0x2ec708['id'];});if(_0xfe38a2)_0x32edf9[_0xeb82('0x6b')](_0x2ec708);}else{_0x32edf9[_0xeb82('0x6b')](_0x2ec708);}}return _0x32edf9;}});}else{return _0x334f3a;}}else{var _0xcdcaad=_['filter'](_0x334f3a,function(_0x13101a){if(_0x13101a['role']!==_0xeb82('0x57')){return _0x13101a;}});return _0xcdcaad;}});}else{return _0x334f3a;}}})[_0xeb82('0x2a')](function(_0x43abf1){var _0x1ecda5=[];if(_0x43abf1){_0x422b7a=_0x43abf1;for(var _0x2bd919=0x0;_0x2bd919<_0x43abf1[_0xeb82('0x39')];_0x2bd919+=0x1){_0x422b7a[_0x2bd919][_0xeb82('0x6c')]=[];_0x1ecda5[_0xeb82('0x6b')](db[_0xeb82('0x45')][_0xeb82('0x4c')]({'where':{'FromId':[_0x227989[_0xeb82('0x58')]['id'],_0x43abf1[_0x2bd919]['id']],'ToId':[_0x227989[_0xeb82('0x58')]['id'],_0x43abf1[_0x2bd919]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xeb82('0x6d'),'ToId',_0xeb82('0x6e'),_0xeb82('0x50')],'order':qs['sort'](_0xeb82('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xeb82('0x2a')](wrapUser(_0x43abf1[_0x2bd919])));}return BPromise['all'](_0x1ecda5);}return[];})['then'](function(_0x4d1d57){return{'rows':_0x4d1d57,'count':_0x4d1d57['length']};})[_0xeb82('0x2a')](respondWithResult(_0x21f803,null))[_0xeb82('0x4d')](handleError(_0x21f803,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 69671ff..78b55da 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 _0x171b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update','remove'];(function(_0x134bfc,_0x144d5f){var _0x2f4dcc=function(_0x56cf22){while(--_0x56cf22){_0x134bfc['push'](_0x134bfc['shift']());}};_0x2f4dcc(++_0x144d5f);}(_0x171b,0x112));var _0xb171=function(_0x4259c1,_0x2757e8){_0x4259c1=_0x4259c1-0x0;var _0x1e95df=_0x171b[_0x4259c1];return _0x1e95df;};'use strict';var EventEmitter=require(_0xb171('0x0'));var ChatInternalMessage=require(_0xb171('0x1'))['db'][_0xb171('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb171('0x3'),'afterUpdate':_0xb171('0x4'),'afterDestroy':_0xb171('0x5')};function emitEvent(_0x129a52){return function(_0x38b87a,_0x2fa374,_0x1f56ea){ChatInternalMessageEvents[_0xb171('0x6')](_0x129a52+':'+_0x38b87a['id'],_0x38b87a);ChatInternalMessageEvents[_0xb171('0x6')](_0x129a52,_0x38b87a);_0x1f56ea(null);};}for(var e in events){if(events[_0xb171('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb171('0x8')](e,emitEvent(event));}}module[_0xb171('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x1698=['hook','exports','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x1e3c87,_0x368df7){var _0x17beb5=function(_0x5b9af1){while(--_0x5b9af1){_0x1e3c87['push'](_0x1e3c87['shift']());}};_0x17beb5(++_0x368df7);}(_0x1698,0x1c4));var _0x8169=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x1698[_0x616290];return _0x453879;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8169('0x0')](0x0);var events={'afterCreate':_0x8169('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x401fa4){return function(_0x1a6bcc,_0x4aed65,_0xd26922){ChatInternalMessageEvents['emit'](_0x401fa4+':'+_0x1a6bcc['id'],_0x1a6bcc);ChatInternalMessageEvents[_0x8169('0x2')](_0x401fa4,_0x1a6bcc);_0xd26922(null);};}for(var e in events){if(events[_0x8169('0x3')](e)){var event=events[e];ChatInternalMessage[_0x8169('0x4')](e,emitEvent(event));}}module[_0x8169('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 68c288c..ea3a803 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 _0x942b=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','exports'];(function(_0x578c18,_0x1de4d8){var _0x18604c=function(_0x4e8c2b){while(--_0x4e8c2b){_0x578c18['push'](_0x578c18['shift']());}};_0x18604c(++_0x1de4d8);}(_0x942b,0x107));var _0xb942=function(_0x555fdf,_0x41db9e){_0x555fdf=_0x555fdf-0x0;var _0x3b6e3a=_0x942b[_0x555fdf];return _0x3b6e3a;};'use strict';var _=require(_0xb942('0x0'));var util=require(_0xb942('0x1'));var logger=require(_0xb942('0x2'))(_0xb942('0x3'));var moment=require(_0xb942('0x4'));var BPromise=require(_0xb942('0x5'));var rp=require(_0xb942('0x6'));var fs=require('fs');var path=require(_0xb942('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb942('0x8'));module[_0xb942('0x9')]=function(_0x2c65a7,_0x4657a3){return _0x2c65a7['define']('ChatInternalMessage',attributes,{'tableName':_0xb942('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb942('0xb'),'collate':_0xb942('0xc')});};
\ No newline at end of file
+var _0xc99e=['lodash','../../config/logger','moment','request-promise','path','rimraf','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3c3a03,_0x3c0da1){var _0x57ff53=function(_0xd08f4a){while(--_0xd08f4a){_0x3c3a03['push'](_0x3c3a03['shift']());}};_0x57ff53(++_0x3c0da1);}(_0xc99e,0x113));var _0xec99=function(_0x2c086d,_0x3928ad){_0x2c086d=_0x2c086d-0x0;var _0x3ba1ff=_0xc99e[_0x2c086d];return _0x3ba1ff;};'use strict';var _=require(_0xec99('0x0'));var util=require('util');var logger=require(_0xec99('0x1'))('api');var moment=require(_0xec99('0x2'));var BPromise=require('bluebird');var rp=require(_0xec99('0x3'));var fs=require('fs');var path=require(_0xec99('0x4'));var rimraf=require(_0xec99('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xec99('0x6')]=function(_0x50beef,_0x340753){return _0x50beef[_0xec99('0x7')]('ChatInternalMessage',attributes,{'tableName':_0xec99('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec99('0x9'),'collate':_0xec99('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 2067216..97abbdc 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 _0xfff6=['redis','defaults','localhost','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x34956e,_0xbcaeef){var _0x156cce=function(_0x16f093){while(--_0x16f093){_0x34956e['push'](_0x34956e['shift']());}};_0x156cce(++_0xbcaeef);}(_0xfff6,0x97));var _0x6fff=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfff6[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6fff('0x0'));var BPromise=require(_0x6fff('0x1'));var rs=require(_0x6fff('0x2'));var fs=require('fs');var Redis=require(_0x6fff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6fff('0x4'));var logger=require(_0x6fff('0x5'))(_0x6fff('0x6'));var config=require(_0x6fff('0x7'));var jayson=require(_0x6fff('0x8'));var client=jayson[_0x6fff('0x9')][_0x6fff('0xa')]({'port':0x232a});config[_0x6fff('0xb')]=_[_0x6fff('0xc')](config[_0x6fff('0xb')],{'host':_0x6fff('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6fff('0xb')]));require(_0x6fff('0xe'))[_0x6fff('0xf')](socket);function respondWithRpcPromise(_0x23d292,_0x11c2c3,_0x51c560){return new BPromise(function(_0x4b5a40,_0x5ced83){return client['request'](_0x23d292,_0x51c560)[_0x6fff('0x10')](function(_0x4c4d6e){logger[_0x6fff('0x11')](_0x6fff('0x12'),_0x11c2c3,_0x6fff('0x13'));logger[_0x6fff('0x14')](_0x6fff('0x15'),_0x11c2c3,_0x6fff('0x13'),JSON[_0x6fff('0x16')](_0x4c4d6e));if(_0x4c4d6e[_0x6fff('0x17')]){if(_0x4c4d6e[_0x6fff('0x17')][_0x6fff('0x18')]===0x1f4){logger[_0x6fff('0x17')](_0x6fff('0x12'),_0x11c2c3,_0x4c4d6e[_0x6fff('0x17')][_0x6fff('0x19')]);return _0x5ced83(_0x4c4d6e[_0x6fff('0x17')][_0x6fff('0x19')]);}logger[_0x6fff('0x17')](_0x6fff('0x12'),_0x11c2c3,_0x4c4d6e[_0x6fff('0x17')]['message']);return _0x4b5a40(_0x4c4d6e[_0x6fff('0x17')]['message']);}else{logger[_0x6fff('0x11')](_0x6fff('0x12'),_0x11c2c3,'request\x20sent');_0x4b5a40(_0x4c4d6e[_0x6fff('0x1a')][_0x6fff('0x19')]);}})['catch'](function(_0xb2195){logger[_0x6fff('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x11c2c3,_0xb2195);_0x5ced83(_0xb2195);});});}
\ No newline at end of file
+var _0x64fa=['result','catch','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','request\x20sent'];(function(_0x228acb,_0x3d4196){var _0x294939=function(_0x2673fc){while(--_0x2673fc){_0x228acb['push'](_0x228acb['shift']());}};_0x294939(++_0x3d4196);}(_0x64fa,0xbf));var _0xa64f=function(_0xb5bced,_0x22a520){_0xb5bced=_0xb5bced-0x0;var _0x13adc2=_0x64fa[_0xb5bced];return _0x13adc2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa64f('0x0'));var rs=require(_0xa64f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa64f('0x2'));var logger=require(_0xa64f('0x3'))(_0xa64f('0x4'));var config=require(_0xa64f('0x5'));var jayson=require(_0xa64f('0x6'));var client=jayson[_0xa64f('0x7')][_0xa64f('0x8')]({'port':0x232a});config[_0xa64f('0x9')]=_[_0xa64f('0xa')](config[_0xa64f('0x9')],{'host':_0xa64f('0xb'),'port':0x18eb});var socket=require(_0xa64f('0xc'))(new Redis(config[_0xa64f('0x9')]));require(_0xa64f('0xd'))[_0xa64f('0xe')](socket);function respondWithRpcPromise(_0xff5771,_0x73b433,_0x25ff23){return new BPromise(function(_0x541ae7,_0x1c9542){return client[_0xa64f('0xf')](_0xff5771,_0x25ff23)[_0xa64f('0x10')](function(_0x51d8b5){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x73b433,'request\x20sent');logger[_0xa64f('0x11')](_0xa64f('0x12'),_0x73b433,'request\x20sent',JSON[_0xa64f('0x13')](_0x51d8b5));if(_0x51d8b5[_0xa64f('0x14')]){if(_0x51d8b5[_0xa64f('0x14')][_0xa64f('0x15')]===0x1f4){logger[_0xa64f('0x14')](_0xa64f('0x16'),_0x73b433,_0x51d8b5[_0xa64f('0x14')][_0xa64f('0x17')]);return _0x1c9542(_0x51d8b5[_0xa64f('0x14')][_0xa64f('0x17')]);}logger[_0xa64f('0x14')](_0xa64f('0x16'),_0x73b433,_0x51d8b5[_0xa64f('0x14')][_0xa64f('0x17')]);return _0x541ae7(_0x51d8b5[_0xa64f('0x14')][_0xa64f('0x17')]);}else{logger['info'](_0xa64f('0x16'),_0x73b433,_0xa64f('0x18'));_0x541ae7(_0x51d8b5[_0xa64f('0x19')][_0xa64f('0x17')]);}})[_0xa64f('0x1a')](function(_0x2a6a9c){logger['error'](_0xa64f('0x16'),_0x73b433,_0x2a6a9c);_0x1c9542(_0x2a6a9c);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 957a99c..e4e813b 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 _0xf3d6=['length','chatInternalMessage:','remove','update','emit','removeListener','register'];(function(_0x524653,_0x5ba03d){var _0x16d192=function(_0x2ff2dd){while(--_0x2ff2dd){_0x524653['push'](_0x524653['shift']());}};_0x16d192(++_0x5ba03d);}(_0xf3d6,0xdb));var _0x6f3d=function(_0x5837b1,_0x54229a){_0x5837b1=_0x5837b1-0x0;var _0x490d8b=_0xf3d6[_0x5837b1];return _0x490d8b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x6f3d('0x0'),_0x6f3d('0x1')];function createListener(_0x113f40,_0x508e9f){return function(_0x4285a0){_0x508e9f[_0x6f3d('0x2')](_0x113f40,_0x4285a0);};}function removeListener(_0x55adf3,_0x16e151){return function(){ChatInternalMessageEvents[_0x6f3d('0x3')](_0x55adf3,_0x16e151);};}exports[_0x6f3d('0x4')]=function(_0x23d88a){for(var _0x1f31d7=0x0,_0x426c8f=events[_0x6f3d('0x5')];_0x1f31d7<_0x426c8f;_0x1f31d7++){var _0x238395=events[_0x1f31d7];var _0x496fb1=createListener(_0x6f3d('0x6')+_0x238395,_0x23d88a);ChatInternalMessageEvents['on'](_0x238395,_0x496fb1);}};
\ No newline at end of file
+var _0x0779=['./chatInternalMessage.events','save','update','emit','removeListener','register','length'];(function(_0x13b8b1,_0x42882a){var _0x467f68=function(_0x1948e0){while(--_0x1948e0){_0x13b8b1['push'](_0x13b8b1['shift']());}};_0x467f68(++_0x42882a);}(_0x0779,0x126));var _0x9077=function(_0xd563ee,_0x2be32c){_0xd563ee=_0xd563ee-0x0;var _0x1ba94d=_0x0779[_0xd563ee];return _0x1ba94d;};'use strict';var ChatInternalMessageEvents=require(_0x9077('0x0'));var events=[_0x9077('0x1'),'remove',_0x9077('0x2')];function createListener(_0x49227e,_0x4ad4d8){return function(_0x5c1ce7){_0x4ad4d8[_0x9077('0x3')](_0x49227e,_0x5c1ce7);};}function removeListener(_0x4c0c86,_0x53de89){return function(){ChatInternalMessageEvents[_0x9077('0x4')](_0x4c0c86,_0x53de89);};}exports[_0x9077('0x5')]=function(_0x4c1ab3){for(var _0x49cb4f=0x0,_0x720665=events[_0x9077('0x6')];_0x49cb4f<_0x720665;_0x49cb4f++){var _0x48ad1d=events[_0x49cb4f];var _0x31627e=createListener('chatInternalMessage:'+_0x48ad1d,_0x4c1ab3);ChatInternalMessageEvents['on'](_0x48ad1d,_0x31627e);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 05ea022..487d074 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 _0x6825=['update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','isAuthenticated','/describe','get','/users','getUsers','post','create','put','/:id'];(function(_0x3af40d,_0x5f38f6){var _0x363acb=function(_0x2ed0f8){while(--_0x2ed0f8){_0x3af40d['push'](_0x3af40d['shift']());}};_0x363acb(++_0x5f38f6);}(_0x6825,0x70));var _0x5682=function(_0x299492,_0x34c8e2){_0x299492=_0x299492-0x0;var _0x3cf0c9=_0x6825[_0x299492];return _0x3cf0c9;};'use strict';var multer=require('multer');var util=require(_0x5682('0x0'));var path=require('path');var timeout=require(_0x5682('0x1'));var express=require(_0x5682('0x2'));var router=express['Router']();var fs_extra=require(_0x5682('0x3'));var auth=require(_0x5682('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x5682('0x5')](),controller['index']);router['get'](_0x5682('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x5682('0x7')](_0x5682('0x8'),auth[_0x5682('0x5')](),controller[_0x5682('0x9')]);router[_0x5682('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5682('0xa')]('/',auth[_0x5682('0x5')](),controller[_0x5682('0xb')]);router[_0x5682('0xc')](_0x5682('0xd'),controller[_0x5682('0xe')]);router[_0x5682('0xf')](_0x5682('0xd'),auth[_0x5682('0x5')](),controller[_0x5682('0x10')]);module[_0x5682('0x11')]=router;
\ No newline at end of file
+var _0xf874=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','describe','/users','isAuthenticated','getUsers','show','post','create','put','/:id','update','delete'];(function(_0x57d96a,_0x5f2495){var _0x1e9d93=function(_0xe2376d){while(--_0xe2376d){_0x57d96a['push'](_0x57d96a['shift']());}};_0x1e9d93(++_0x5f2495);}(_0xf874,0x177));var _0x4f87=function(_0x3f650e,_0x151fec){_0x3f650e=_0x3f650e-0x0;var _0x294c88=_0xf874[_0x3f650e];return _0x294c88;};'use strict';var multer=require(_0x4f87('0x0'));var util=require('util');var path=require(_0x4f87('0x1'));var timeout=require(_0x4f87('0x2'));var express=require(_0x4f87('0x3'));var router=express[_0x4f87('0x4')]();var fs_extra=require(_0x4f87('0x5'));var auth=require(_0x4f87('0x6'));var interaction=require(_0x4f87('0x7'));var config=require('../../config/environment');var controller=require(_0x4f87('0x8'));router[_0x4f87('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x4f87('0xa')]);router['get'](_0x4f87('0xb'),auth[_0x4f87('0xc')](),controller[_0x4f87('0xd')]);router[_0x4f87('0x9')]('/:id',auth[_0x4f87('0xc')](),controller[_0x4f87('0xe')]);router[_0x4f87('0xf')]('/',auth[_0x4f87('0xc')](),controller[_0x4f87('0x10')]);router[_0x4f87('0x11')](_0x4f87('0x12'),controller[_0x4f87('0x13')]);router[_0x4f87('0x14')](_0x4f87('0x12'),auth[_0x4f87('0xc')](),controller['destroy']);module[_0x4f87('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 4abb05a..0fc7469 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 _0x65c9=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x498834,_0x57c709){var _0x2fc7ef=function(_0x393556){while(--_0x393556){_0x498834['push'](_0x498834['shift']());}};_0x2fc7ef(++_0x57c709);}(_0x65c9,0x182));var _0x965c=function(_0x35f2c0,_0x6184a4){_0x35f2c0=_0x35f2c0-0x0;var _0x3d41c9=_0x65c9[_0x35f2c0];return _0x3d41c9;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x965c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x965c('0x4')]('in',_0x965c('0x5')),'defaultValue':_0x965c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x965c('0x6')]},'providerName':{'type':Sequelize[_0x965c('0x7')]},'providerResponse':{'type':Sequelize[_0x965c('0x8')]}};
\ No newline at end of file
+var _0xe9e8=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x2064b0,_0x232d42){var _0x4ac160=function(_0x2540fa){while(--_0x2540fa){_0x2064b0['push'](_0x2064b0['shift']());}};_0x4ac160(++_0x232d42);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x129bd2,_0xda7c6){_0x129bd2=_0x129bd2-0x0;var _0x31c204=_0xe9e8[_0x129bd2];return _0x31c204;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'body':{'type':Sequelize[_0x8e9e('0x2')](_0x8e9e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8e9e('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8e9e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8e9e('0x5')]('in','out'),'defaultValue':_0x8e9e('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8e9e('0x7')]},'providerName':{'type':Sequelize[_0x8e9e('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 8710ed8..d876af9 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 _0x2e32=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','end','stack','send','map','ChatMessage','fieldName','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','name','includeAll','include','findAll','rows','catch','params','rawAttributes','length','merge','options','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','update','isNil','read1stAt','get','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','EventManager','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','channel','motionChannel','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','request','then'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0x2e32,0x1f0));var _0x22e3=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x2e32[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0x22e3('0x0'));var rimraf=require(_0x22e3('0x1'));var zipdir=require(_0x22e3('0x2'));var jsonpatch=require(_0x22e3('0x3'));var rp=require(_0x22e3('0x4'));var moment=require(_0x22e3('0x5'));var BPromise=require(_0x22e3('0x6'));var Mustache=require(_0x22e3('0x7'));var util=require('util');var path=require(_0x22e3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x22e3('0x9'));var fs=require('fs');var fs_extra=require(_0x22e3('0xa'));var _=require('lodash');var squel=require(_0x22e3('0xb'));var crypto=require(_0x22e3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x22e3('0xd'));var toCsv=require(_0x22e3('0xe'));var querystring=require(_0x22e3('0xf'));var Papa=require('papaparse');var Redis=require(_0x22e3('0x10'));var authService=require(_0x22e3('0x11'));var qs=require(_0x22e3('0x12'));var as=require(_0x22e3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22e3('0x14'))(_0x22e3('0x15'));var utils=require(_0x22e3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x22e3('0x17'));var db=require(_0x22e3('0x18'))['db'];config[_0x22e3('0x19')]=_[_0x22e3('0x1a')](config[_0x22e3('0x19')],{'host':_0x22e3('0x1b'),'port':0x18eb});var socket=require(_0x22e3('0x1c'))(new Redis(config[_0x22e3('0x19')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x22e3('0x1d')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b3786,_0x47e487,_0x289880,_0x14c134){return new BPromise(function(_0x1f4ec5,_0x3e9d33){var _0x48f3bf=_0x14c134||client;return _0x48f3bf[_0x22e3('0x1e')](_0x3b3786,_0x289880)[_0x22e3('0x1f')](function(_0x17b5e3){logger['info'](_0x22e3('0x20'),_0x47e487,_0x22e3('0x21'));logger[_0x22e3('0x22')](_0x22e3('0x23'),_0x47e487,'request\x20sent',JSON[_0x22e3('0x24')](_0x17b5e3));if(_0x17b5e3[_0x22e3('0x25')]){if(_0x17b5e3[_0x22e3('0x25')][_0x22e3('0x26')]===0x1f4){logger[_0x22e3('0x25')](_0x22e3('0x20'),_0x47e487,_0x17b5e3['error'][_0x22e3('0x27')]);return _0x3e9d33(_0x17b5e3[_0x22e3('0x25')][_0x22e3('0x27')]);}logger[_0x22e3('0x25')](_0x22e3('0x20'),_0x47e487,_0x17b5e3['error'][_0x22e3('0x27')]);return _0x1f4ec5(_0x17b5e3[_0x22e3('0x25')]['message']);}else{logger[_0x22e3('0x28')](_0x22e3('0x20'),_0x47e487,_0x22e3('0x21'));_0x1f4ec5(_0x17b5e3['result'][_0x22e3('0x27')]);}})['catch'](function(_0x23889f){logger[_0x22e3('0x25')](_0x22e3('0x20'),_0x47e487,_0x23889f);_0x3e9d33(_0x23889f);});});}function respondWithStatusCode(_0x13e267,_0x52f049){_0x52f049=_0x52f049||0xcc;return function(_0xbd0ee1){if(_0xbd0ee1){return _0x13e267[_0x22e3('0x29')](_0x52f049);}return _0x13e267[_0x22e3('0x2a')](_0x52f049)['end']();};}function respondWithResult(_0x168582,_0x55e42f){_0x55e42f=_0x55e42f||0xc8;return function(_0x5a8224){if(_0x5a8224){return _0x168582['status'](_0x55e42f)[_0x22e3('0x2b')](_0x5a8224);}};}function respondWithFilteredResult(_0x180229,_0x381973){return function(_0x2b9a79){if(_0x2b9a79){var _0x19f164=typeof _0x381973[_0x22e3('0x2c')]===_0x22e3('0x2d')&&typeof _0x381973[_0x22e3('0x2e')]==='undefined';var _0x22b523=_0x2b9a79[_0x22e3('0x2f')];var _0x258cc4=_0x19f164?0x0:_0x381973['offset'];var _0x10cccc=_0x19f164?_0x2b9a79[_0x22e3('0x2f')]:_0x381973[_0x22e3('0x2c')]+_0x381973[_0x22e3('0x2e')];var _0x407fee;if(_0x10cccc>=_0x22b523){_0x10cccc=_0x22b523;_0x407fee=0xc8;}else{_0x407fee=0xce;}_0x180229['status'](_0x407fee);return _0x180229[_0x22e3('0x30')]('Content-Range',_0x258cc4+'-'+_0x10cccc+'/'+_0x22b523)[_0x22e3('0x2b')](_0x2b9a79);}return null;};}function patchUpdates(_0x2227ca){return function(_0x32ee8f){try{jsonpatch[_0x22e3('0x31')](_0x32ee8f,_0x2227ca,!![]);}catch(_0x287a77){return BPromise[_0x22e3('0x32')](_0x287a77);}return _0x32ee8f[_0x22e3('0x33')]();};}function saveUpdates(_0x11b5ca,_0x4765b1){return function(_0x514478){if(_0x514478){return _0x514478['update'](_0x11b5ca)[_0x22e3('0x1f')](function(_0x1a7404){return _0x1a7404;});}return null;};}function removeEntity(_0x256a55,_0x3d15fc){return function(_0x277c01){if(_0x277c01){return _0x277c01[_0x22e3('0x34')]()[_0x22e3('0x1f')](function(){_0x256a55[_0x22e3('0x2a')](0xcc)[_0x22e3('0x35')]();});}};}function handleEntityNotFound(_0x5eecb3,_0xc628fc){return function(_0x2f42b1){if(!_0x2f42b1){_0x5eecb3['sendStatus'](0x194);}return _0x2f42b1;};}function handleError(_0x2b497d,_0x43cdf2){_0x43cdf2=_0x43cdf2||0x1f4;return function(_0x589d60){logger[_0x22e3('0x25')](_0x589d60[_0x22e3('0x36')]);if(_0x589d60['name']){delete _0x589d60['name'];}_0x2b497d[_0x22e3('0x2a')](_0x43cdf2)[_0x22e3('0x37')](_0x589d60);};}exports['index']=function(_0x543e91,_0x4b628f){var _0x13914c={},_0x9dbcf={},_0x3c5bf8={'count':0x0,'rows':[]};var _0x210567=_[_0x22e3('0x38')](db[_0x22e3('0x39')]['rawAttributes'],function(_0x3d7fb7){return{'name':_0x3d7fb7[_0x22e3('0x3a')],'type':_0x3d7fb7['type'][_0x22e3('0x3b')]};});_0x9dbcf[_0x22e3('0x3c')]=_[_0x22e3('0x38')](_0x210567,'name');_0x9dbcf['query']=_[_0x22e3('0x3d')](_0x543e91['query']);_0x9dbcf[_0x22e3('0x3e')]=_['intersection'](_0x9dbcf['model'],_0x9dbcf[_0x22e3('0x3f')]);_0x13914c[_0x22e3('0x40')]=_[_0x22e3('0x41')](_0x9dbcf['model'],qs[_0x22e3('0x42')](_0x543e91['query'][_0x22e3('0x42')]));_0x13914c[_0x22e3('0x40')]=_0x13914c[_0x22e3('0x40')]['length']?_0x13914c['attributes']:_0x9dbcf[_0x22e3('0x3c')];if(!_0x543e91[_0x22e3('0x3f')][_0x22e3('0x43')]('nolimit')){_0x13914c[_0x22e3('0x2e')]=qs[_0x22e3('0x2e')](_0x543e91['query']['limit']);_0x13914c['offset']=qs[_0x22e3('0x2c')](_0x543e91[_0x22e3('0x3f')][_0x22e3('0x2c')]);}_0x13914c[_0x22e3('0x44')]=qs[_0x22e3('0x45')](_0x543e91['query']['sort']);_0x13914c[_0x22e3('0x46')]=qs['filters'](_[_0x22e3('0x47')](_0x543e91[_0x22e3('0x3f')],_0x9dbcf['filters']),_0x210567);if(_0x543e91[_0x22e3('0x3f')][_0x22e3('0x48')]){_0x13914c[_0x22e3('0x46')]=_['merge'](_0x13914c[_0x22e3('0x46')],{'$or':_[_0x22e3('0x38')](_0x210567,function(_0x4ae392){if(_0x4ae392[_0x22e3('0x49')]!==_0x22e3('0x4a')){var _0x292ad5={};_0x292ad5[_0x4ae392[_0x22e3('0x4b')]]={'$like':'%'+_0x543e91[_0x22e3('0x3f')][_0x22e3('0x48')]+'%'};return _0x292ad5;}})});}_0x13914c=_['merge']({},_0x13914c,_0x543e91['options']);var _0x556817={'where':_0x13914c[_0x22e3('0x46')]};return db[_0x22e3('0x39')]['count'](_0x556817)[_0x22e3('0x1f')](function(_0x3ad2dd){_0x3c5bf8[_0x22e3('0x2f')]=_0x3ad2dd;if(_0x543e91[_0x22e3('0x3f')][_0x22e3('0x4c')]){_0x13914c[_0x22e3('0x4d')]=[{'all':!![]}];}return db[_0x22e3('0x39')][_0x22e3('0x4e')](_0x13914c);})[_0x22e3('0x1f')](function(_0x5f3ca3){_0x3c5bf8[_0x22e3('0x4f')]=_0x5f3ca3;return _0x3c5bf8;})[_0x22e3('0x1f')](respondWithFilteredResult(_0x4b628f,_0x13914c))[_0x22e3('0x50')](handleError(_0x4b628f,null));};exports['show']=function(_0x47e7fc,_0xf0c8cd){var _0x1a9bb9={'raw':!![],'where':{'id':_0x47e7fc[_0x22e3('0x51')]['id']}},_0x273eba={};_0x273eba['model']=_[_0x22e3('0x3d')](db[_0x22e3('0x39')][_0x22e3('0x52')]);_0x273eba[_0x22e3('0x3f')]=_[_0x22e3('0x3d')](_0x47e7fc[_0x22e3('0x3f')]);_0x273eba[_0x22e3('0x3e')]=_[_0x22e3('0x41')](_0x273eba['model'],_0x273eba[_0x22e3('0x3f')]);_0x1a9bb9[_0x22e3('0x40')]=_[_0x22e3('0x41')](_0x273eba[_0x22e3('0x3c')],qs[_0x22e3('0x42')](_0x47e7fc[_0x22e3('0x3f')][_0x22e3('0x42')]));_0x1a9bb9[_0x22e3('0x40')]=_0x1a9bb9[_0x22e3('0x40')][_0x22e3('0x53')]?_0x1a9bb9['attributes']:_0x273eba['model'];if(_0x47e7fc['query'][_0x22e3('0x4c')]){_0x1a9bb9[_0x22e3('0x4d')]=[{'all':!![]}];}_0x1a9bb9=_[_0x22e3('0x54')]({},_0x1a9bb9,_0x47e7fc[_0x22e3('0x55')]);return db[_0x22e3('0x39')][_0x22e3('0x56')](_0x1a9bb9)[_0x22e3('0x1f')](handleEntityNotFound(_0xf0c8cd,null))[_0x22e3('0x1f')](respondWithResult(_0xf0c8cd,null))[_0x22e3('0x50')](handleError(_0xf0c8cd,null));};exports[_0x22e3('0x57')]=function(_0x85c5ac,_0x11de06){return db[_0x22e3('0x39')][_0x22e3('0x57')](_0x85c5ac[_0x22e3('0x58')],{})[_0x22e3('0x1f')](respondWithResult(_0x11de06,0xc9))[_0x22e3('0x50')](handleError(_0x11de06,null));};exports['update']=function(_0x448c2c,_0x1673dd){if(_0x448c2c[_0x22e3('0x58')]['id']){delete _0x448c2c[_0x22e3('0x58')]['id'];}return db[_0x22e3('0x39')][_0x22e3('0x56')]({'where':{'id':_0x448c2c[_0x22e3('0x51')]['id']}})[_0x22e3('0x1f')](handleEntityNotFound(_0x1673dd,null))['then'](saveUpdates(_0x448c2c[_0x22e3('0x58')],null))['then'](respondWithResult(_0x1673dd,null))[_0x22e3('0x50')](handleError(_0x1673dd,null));};exports[_0x22e3('0x34')]=function(_0x112ae0,_0x3366df){return db[_0x22e3('0x39')][_0x22e3('0x56')]({'where':{'id':_0x112ae0[_0x22e3('0x51')]['id']}})['then'](handleEntityNotFound(_0x3366df,null))[_0x22e3('0x1f')](removeEntity(_0x3366df,null))['catch'](handleError(_0x3366df,null));};exports['describe']=function(_0x4796da,_0x3bc16c){return db[_0x22e3('0x39')][_0x22e3('0x59')]()[_0x22e3('0x1f')](respondWithResult(_0x3bc16c,null))[_0x22e3('0x50')](handleError(_0x3bc16c,null));};var interaction_log=require(_0x22e3('0x14'))(_0x22e3('0x5a'));exports[_0x22e3('0x5b')]=function(_0x59a753,_0x38a94f,_0x3cf128){var _0x40746d={'agent':{},'channel':_0x22e3('0x5c')};if(_0x59a753[_0x22e3('0x58')]['id']){delete _0x59a753[_0x22e3('0x58')]['id'];}_0x59a753[_0x22e3('0x58')][_0x22e3('0x5d')]=!![];_0x59a753[_0x22e3('0x58')]['readAt']=moment()[_0x22e3('0x5e')](_0x22e3('0x5f'));_0x59a753['body'][_0x22e3('0x60')]=_0x59a753['body'][_0x22e3('0x60')]||_0x59a753[_0x22e3('0x61')]['id'];_0x40746d['agent']['id']=_0x59a753[_0x22e3('0x58')][_0x22e3('0x60')];return db['ChatMessage'][_0x22e3('0x56')]({'where':{'id':_0x59a753[_0x22e3('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x38a94f,null))[_0x22e3('0x1f')](saveUpdates(_0x59a753[_0x22e3('0x58')],null))[_0x22e3('0x1f')](function(_0x28487a){if(_0x28487a){_0x40746d[_0x22e3('0x27')]=_0x28487a['get']({'plain':!![]});return db[_0x22e3('0x62')][_0x22e3('0x56')]({'where':{'id':_0x28487a['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x38a94f,null))[_0x22e3('0x1f')](function(_0x559154){if(_0x559154){return _0x559154[_0x22e3('0x63')]({'UserId':_0x59a753['body']['UserId'],'read1stAt':_[_0x22e3('0x64')](_0x559154[_0x22e3('0x65')])?moment()[_0x22e3('0x5e')](_0x22e3('0x5f')):undefined});}return null;})['then'](function(_0x5a9fef){if(_0x5a9fef){_0x40746d['interaction']=_0x5a9fef[_0x22e3('0x66')]({'plain':!![]});interaction_log[_0x22e3('0x28')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59a753[_0x22e3('0x61')]['id'],_0x59a753['user'][_0x22e3('0x4b')],_0x59a753[_0x22e3('0x61')][_0x22e3('0x67')],_0x40746d[_0x22e3('0x68')]['id'],_0x59a753['body']?JSON[_0x22e3('0x24')](_0x59a753[_0x22e3('0x58')]):_0x22e3('0x69'));return respondWithRpcPromise(_0x22e3('0x6a'),_0x22e3('0x6b'),_0x40746d);}return null;})[_0x22e3('0x1f')](function(_0x2476bd){var _0x58b5e1=_0x22e3('0x6c')+_0x2476bd[_0x22e3('0x27')][_0x22e3('0x6d')];return db[_0x22e3('0x6e')][_0x22e3('0x3f')](_0x58b5e1,{'type':db[_0x22e3('0x6f')][_0x22e3('0x70')][_0x22e3('0x71')],'raw':!![]})[_0x22e3('0x1f')](function(_0x30f681){return _0x30f681;});})['then'](function(_0x594da3){if(_0x594da3){_0x40746d[_0x22e3('0x27')]['contact']=_0x594da3[0x0];if(!_0x59a753['body'][_0x22e3('0x60')])return;return db[_0x22e3('0x72')][_0x22e3('0x56')]({'where':{'id':_0x59a753[_0x22e3('0x58')][_0x22e3('0x60')],'role':_0x22e3('0x73')},'attributes':['id',_0x22e3('0x4b'),_0x22e3('0x74'),_0x22e3('0x75'),_0x22e3('0x76')],'raw':!![]});}return null;})[_0x22e3('0x1f')](function(_0x5deb5d){if(!_0x5deb5d)return null;_0x40746d['message'][_0x22e3('0x73')]=_0x5deb5d;return _0x40746d;})[_0x22e3('0x1f')](function(_0x426dab){if(_0x426dab){if(_0x59a753[_0x22e3('0x58')][_0x22e3('0x77')]){_0x40746d[_0x22e3('0x27')][_0x22e3('0x78')]=util[_0x22e3('0x5e')](_0x22e3('0x79'),_0x59a753[_0x22e3('0x61')][_0x22e3('0x4b')]);_0x40746d[_0x22e3('0x27')]['channel']=_0x40746d['channel'];_0x40746d['message']['motionChannel']=_0x40746d['channel'];_0x40746d[_0x22e3('0x27')]['event']=_0x22e3('0x5b');return respondWithRpcPromise(_0x22e3('0x7a'),'EventManager',{'event':'acceptmessage','message':_['merge'](_0x40746d['message'],JSON[_0x22e3('0x7b')](_0x40746d[_0x22e3('0x68')][_0x22e3('0x7c')]))},client9002)[_0x22e3('0x1f')](function(){return _0x40746d;});}return _0x40746d;}return null;})[_0x22e3('0x1f')](respondWithResult(_0x38a94f,null))[_0x22e3('0x50')](handleError(_0x38a94f,null));};var interaction_log=require('../../config/logger')(_0x22e3('0x5a'));exports[_0x22e3('0x32')]=function(_0x5cf2c7,_0x4bbb8d,_0x40ac80){var _0x3aa9c2={'agent':{},'channel':'chat'};if(_0x5cf2c7['body']['id']){delete _0x5cf2c7[_0x22e3('0x58')]['id'];}_0x5cf2c7[_0x22e3('0x58')][_0x22e3('0x60')]=_0x5cf2c7[_0x22e3('0x58')][_0x22e3('0x60')]||_0x5cf2c7[_0x22e3('0x61')]['id'];_0x3aa9c2[_0x22e3('0x73')]['id']=_0x5cf2c7[_0x22e3('0x58')][_0x22e3('0x60')];return db[_0x22e3('0x39')][_0x22e3('0x56')]({'where':{'id':_0x5cf2c7[_0x22e3('0x51')]['id'],'UserId':null}})[_0x22e3('0x1f')](handleEntityNotFound(_0x4bbb8d,null))[_0x22e3('0x1f')](function(_0xbcc9b7){if(_0xbcc9b7){_0x3aa9c2['message']=_0xbcc9b7['get']({'plain':!![]});return db[_0x22e3('0x62')][_0x22e3('0x56')]({'where':{'id':_0xbcc9b7[_0x22e3('0x7d')]}});}return null;})[_0x22e3('0x1f')](handleEntityNotFound(_0x4bbb8d,null))['then'](function(_0xb88afa){if(_0xb88afa){_0x3aa9c2[_0x22e3('0x68')]=_0xb88afa[_0x22e3('0x66')]({'plain':!![]});interaction_log[_0x22e3('0x28')](_0x22e3('0x7e'),_0x5cf2c7[_0x22e3('0x61')]['id'],_0x5cf2c7['user'][_0x22e3('0x4b')],_0x5cf2c7['user'][_0x22e3('0x67')],_0x3aa9c2[_0x22e3('0x68')]['id'],_0x5cf2c7['body']?JSON[_0x22e3('0x24')](_0x5cf2c7['body']):'null');return respondWithRpcPromise('RejectMessage',_0x22e3('0x7f'),_0x3aa9c2);}return null;})[_0x22e3('0x1f')](function(_0x1efae9){var _0x330402=_0x22e3('0x6c')+_0x1efae9['message'][_0x22e3('0x6d')];return db['sequelize'][_0x22e3('0x3f')](_0x330402,{'type':db[_0x22e3('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x22e3('0x1f')](function(_0x2fb7cd){return _0x2fb7cd;});})[_0x22e3('0x1f')](function(_0x548507){if(_0x548507){_0x3aa9c2[_0x22e3('0x27')]['contact']=_0x548507[0x0];if(!_0x5cf2c7[_0x22e3('0x58')]['UserId'])return;return db['User'][_0x22e3('0x56')]({'where':{'id':_0x5cf2c7['body'][_0x22e3('0x60')],'role':_0x22e3('0x73')},'attributes':['id',_0x22e3('0x4b'),_0x22e3('0x74'),_0x22e3('0x75'),_0x22e3('0x76')],'raw':!![]});}return null;})[_0x22e3('0x1f')](function(_0x21084b){if(!_0x21084b)return null;_0x3aa9c2[_0x22e3('0x27')][_0x22e3('0x73')]=_0x21084b;return _0x3aa9c2;})[_0x22e3('0x1f')](function(_0x51a348){if(_0x51a348){_0x51a348[_0x22e3('0x27')][_0x22e3('0x78')]=util['format']('SIP/%s',_0x5cf2c7['user'][_0x22e3('0x4b')]);_0x51a348['message'][_0x22e3('0x80')]=_0x3aa9c2['channel'];_0x51a348[_0x22e3('0x27')][_0x22e3('0x81')]=_0x3aa9c2[_0x22e3('0x80')];_0x51a348['message'][_0x22e3('0x82')]=_0x22e3('0x32');respondWithRpcPromise(_0x22e3('0x7a'),_0x22e3('0x7a'),{'event':_0x22e3('0x83'),'message':_[_0x22e3('0x54')](_0x3aa9c2['message'],JSON[_0x22e3('0x7b')](_0x3aa9c2['interaction']['formData']))},client9002);return _0x3aa9c2;}return null;})[_0x22e3('0x1f')](respondWithResult(_0x4bbb8d,null))[_0x22e3('0x50')](handleError(_0x4bbb8d,null));};
\ No newline at end of file
+var _0xdc2f=['channel','event','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','formData','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','ChatMessage','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','show','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','motionChannel'];(function(_0x47ae45,_0x5f1fce){var _0x5f3267=function(_0x421a8e){while(--_0x421a8e){_0x47ae45['push'](_0x47ae45['shift']());}};_0x5f3267(++_0x5f1fce);}(_0xdc2f,0x192));var _0xfdc2=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xdc2f[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require(_0xfdc2('0x0'));var rimraf=require(_0xfdc2('0x1'));var zipdir=require(_0xfdc2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdc2('0x3'));var moment=require(_0xfdc2('0x4'));var BPromise=require(_0xfdc2('0x5'));var Mustache=require('mustache');var util=require(_0xfdc2('0x6'));var path=require('path');var sox=require(_0xfdc2('0x7'));var csv=require(_0xfdc2('0x8'));var ejs=require(_0xfdc2('0x9'));var fs=require('fs');var fs_extra=require(_0xfdc2('0xa'));var _=require(_0xfdc2('0xb'));var squel=require(_0xfdc2('0xc'));var crypto=require(_0xfdc2('0xd'));var jsforce=require(_0xfdc2('0xe'));var deskjs=require(_0xfdc2('0xf'));var toCsv=require(_0xfdc2('0x8'));var querystring=require(_0xfdc2('0x10'));var Papa=require(_0xfdc2('0x11'));var Redis=require(_0xfdc2('0x12'));var authService=require(_0xfdc2('0x13'));var qs=require(_0xfdc2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdc2('0x15'));var logger=require(_0xfdc2('0x16'))(_0xfdc2('0x17'));var utils=require(_0xfdc2('0x18'));var config=require(_0xfdc2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xfdc2('0x1a'))['db'];config[_0xfdc2('0x1b')]=_[_0xfdc2('0x1c')](config[_0xfdc2('0x1b')],{'host':_0xfdc2('0x1d'),'port':0x18eb});var socket=require(_0xfdc2('0x1e'))(new Redis(config[_0xfdc2('0x1b')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xfdc2('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xfdc2('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40465d,_0x44c3cb,_0x24372e,_0x36eef9){return new BPromise(function(_0x3ca5c,_0x3f3568){var _0x51836f=_0x36eef9||client;return _0x51836f['request'](_0x40465d,_0x24372e)[_0xfdc2('0x21')](function(_0x7f0260){logger[_0xfdc2('0x22')](_0xfdc2('0x23'),_0x44c3cb,_0xfdc2('0x24'));logger[_0xfdc2('0x25')](_0xfdc2('0x26'),_0x44c3cb,'request\x20sent',JSON[_0xfdc2('0x27')](_0x7f0260));if(_0x7f0260[_0xfdc2('0x28')]){if(_0x7f0260['error'][_0xfdc2('0x29')]===0x1f4){logger[_0xfdc2('0x28')](_0xfdc2('0x23'),_0x44c3cb,_0x7f0260['error'][_0xfdc2('0x2a')]);return _0x3f3568(_0x7f0260['error'][_0xfdc2('0x2a')]);}logger[_0xfdc2('0x28')](_0xfdc2('0x23'),_0x44c3cb,_0x7f0260[_0xfdc2('0x28')]['message']);return _0x3ca5c(_0x7f0260[_0xfdc2('0x28')]['message']);}else{logger[_0xfdc2('0x22')](_0xfdc2('0x23'),_0x44c3cb,_0xfdc2('0x24'));_0x3ca5c(_0x7f0260['result'][_0xfdc2('0x2a')]);}})[_0xfdc2('0x2b')](function(_0x28ce24){logger[_0xfdc2('0x28')](_0xfdc2('0x23'),_0x44c3cb,_0x28ce24);_0x3f3568(_0x28ce24);});});}function respondWithStatusCode(_0x700baf,_0x5e77b9){_0x5e77b9=_0x5e77b9||0xcc;return function(_0x52212b){if(_0x52212b){return _0x700baf[_0xfdc2('0x2c')](_0x5e77b9);}return _0x700baf[_0xfdc2('0x2d')](_0x5e77b9)['end']();};}function respondWithResult(_0x40129e,_0xb73019){_0xb73019=_0xb73019||0xc8;return function(_0x3f997a){if(_0x3f997a){return _0x40129e[_0xfdc2('0x2d')](_0xb73019)[_0xfdc2('0x2e')](_0x3f997a);}};}function respondWithFilteredResult(_0x596dc1,_0x36c5ed){return function(_0x4057ed){if(_0x4057ed){var _0x1a2f2f=typeof _0x36c5ed['offset']==='undefined'&&typeof _0x36c5ed['limit']==='undefined';var _0x5a990b=_0x4057ed[_0xfdc2('0x2f')];var _0x234953=_0x1a2f2f?0x0:_0x36c5ed['offset'];var _0x169c4a=_0x1a2f2f?_0x4057ed['count']:_0x36c5ed[_0xfdc2('0x30')]+_0x36c5ed[_0xfdc2('0x31')];var _0x3d9be9;if(_0x169c4a>=_0x5a990b){_0x169c4a=_0x5a990b;_0x3d9be9=0xc8;}else{_0x3d9be9=0xce;}_0x596dc1[_0xfdc2('0x2d')](_0x3d9be9);return _0x596dc1[_0xfdc2('0x32')](_0xfdc2('0x33'),_0x234953+'-'+_0x169c4a+'/'+_0x5a990b)['json'](_0x4057ed);}return null;};}function patchUpdates(_0x331f9f){return function(_0x5bb362){try{jsonpatch[_0xfdc2('0x34')](_0x5bb362,_0x331f9f,!![]);}catch(_0x4e750e){return BPromise[_0xfdc2('0x35')](_0x4e750e);}return _0x5bb362[_0xfdc2('0x36')]();};}function saveUpdates(_0xa37fba,_0x68a2d1){return function(_0x4cb013){if(_0x4cb013){return _0x4cb013[_0xfdc2('0x37')](_0xa37fba)[_0xfdc2('0x21')](function(_0xc400be){return _0xc400be;});}return null;};}function removeEntity(_0x3d7230,_0x2a73c1){return function(_0x20a779){if(_0x20a779){return _0x20a779[_0xfdc2('0x38')]()['then'](function(){_0x3d7230[_0xfdc2('0x2d')](0xcc)[_0xfdc2('0x39')]();});}};}function handleEntityNotFound(_0x24f53b,_0x2134cf){return function(_0x521712){if(!_0x521712){_0x24f53b['sendStatus'](0x194);}return _0x521712;};}function handleError(_0x168efd,_0x5788e8){_0x5788e8=_0x5788e8||0x1f4;return function(_0x29bb33){logger[_0xfdc2('0x28')](_0x29bb33[_0xfdc2('0x3a')]);if(_0x29bb33[_0xfdc2('0x3b')]){delete _0x29bb33[_0xfdc2('0x3b')];}_0x168efd['status'](_0x5788e8)[_0xfdc2('0x3c')](_0x29bb33);};}exports[_0xfdc2('0x3d')]=function(_0x4a76ca,_0x416f98){var _0x2c24af={},_0xb085ae={},_0x5a4521={'count':0x0,'rows':[]};var _0x359840=_['map'](db[_0xfdc2('0x3e')]['rawAttributes'],function(_0x3a0854){return{'name':_0x3a0854[_0xfdc2('0x3f')],'type':_0x3a0854[_0xfdc2('0x40')][_0xfdc2('0x41')]};});_0xb085ae[_0xfdc2('0x42')]=_[_0xfdc2('0x43')](_0x359840,'name');_0xb085ae[_0xfdc2('0x44')]=_['keys'](_0x4a76ca[_0xfdc2('0x44')]);_0xb085ae[_0xfdc2('0x45')]=_[_0xfdc2('0x46')](_0xb085ae[_0xfdc2('0x42')],_0xb085ae[_0xfdc2('0x44')]);_0x2c24af['attributes']=_['intersection'](_0xb085ae['model'],qs[_0xfdc2('0x47')](_0x4a76ca['query'][_0xfdc2('0x47')]));_0x2c24af[_0xfdc2('0x48')]=_0x2c24af['attributes'][_0xfdc2('0x49')]?_0x2c24af[_0xfdc2('0x48')]:_0xb085ae[_0xfdc2('0x42')];if(!_0x4a76ca[_0xfdc2('0x44')]['hasOwnProperty'](_0xfdc2('0x4a'))){_0x2c24af[_0xfdc2('0x31')]=qs['limit'](_0x4a76ca[_0xfdc2('0x44')]['limit']);_0x2c24af[_0xfdc2('0x30')]=qs[_0xfdc2('0x30')](_0x4a76ca['query']['offset']);}_0x2c24af[_0xfdc2('0x4b')]=qs[_0xfdc2('0x4c')](_0x4a76ca[_0xfdc2('0x44')]['sort']);_0x2c24af[_0xfdc2('0x4d')]=qs[_0xfdc2('0x45')](_[_0xfdc2('0x4e')](_0x4a76ca[_0xfdc2('0x44')],_0xb085ae[_0xfdc2('0x45')]),_0x359840);if(_0x4a76ca[_0xfdc2('0x44')][_0xfdc2('0x4f')]){_0x2c24af[_0xfdc2('0x4d')]=_['merge'](_0x2c24af['where'],{'$or':_[_0xfdc2('0x43')](_0x359840,function(_0x3da7d9){if(_0x3da7d9['type']!=='VIRTUAL'){var _0x1195cb={};_0x1195cb[_0x3da7d9['name']]={'$like':'%'+_0x4a76ca[_0xfdc2('0x44')][_0xfdc2('0x4f')]+'%'};return _0x1195cb;}})});}_0x2c24af=_[_0xfdc2('0x50')]({},_0x2c24af,_0x4a76ca[_0xfdc2('0x51')]);var _0x2a01bf={'where':_0x2c24af['where']};return db[_0xfdc2('0x3e')]['count'](_0x2a01bf)[_0xfdc2('0x21')](function(_0xba8dc0){_0x5a4521['count']=_0xba8dc0;if(_0x4a76ca[_0xfdc2('0x44')][_0xfdc2('0x52')]){_0x2c24af['include']=[{'all':!![]}];}return db[_0xfdc2('0x3e')]['findAll'](_0x2c24af);})['then'](function(_0x21a96d){_0x5a4521['rows']=_0x21a96d;return _0x5a4521;})['then'](respondWithFilteredResult(_0x416f98,_0x2c24af))[_0xfdc2('0x2b')](handleError(_0x416f98,null));};exports[_0xfdc2('0x53')]=function(_0x2926cd,_0x265c71){var _0x40e830={'raw':!![],'where':{'id':_0x2926cd['params']['id']}},_0x298d77={};_0x298d77[_0xfdc2('0x42')]=_['keys'](db[_0xfdc2('0x3e')]['rawAttributes']);_0x298d77['query']=_['keys'](_0x2926cd['query']);_0x298d77['filters']=_['intersection'](_0x298d77[_0xfdc2('0x42')],_0x298d77[_0xfdc2('0x44')]);_0x40e830[_0xfdc2('0x48')]=_[_0xfdc2('0x46')](_0x298d77['model'],qs[_0xfdc2('0x47')](_0x2926cd[_0xfdc2('0x44')][_0xfdc2('0x47')]));_0x40e830[_0xfdc2('0x48')]=_0x40e830[_0xfdc2('0x48')][_0xfdc2('0x49')]?_0x40e830[_0xfdc2('0x48')]:_0x298d77[_0xfdc2('0x42')];if(_0x2926cd[_0xfdc2('0x44')][_0xfdc2('0x52')]){_0x40e830['include']=[{'all':!![]}];}_0x40e830=_[_0xfdc2('0x50')]({},_0x40e830,_0x2926cd[_0xfdc2('0x51')]);return db[_0xfdc2('0x3e')][_0xfdc2('0x54')](_0x40e830)[_0xfdc2('0x21')](handleEntityNotFound(_0x265c71,null))[_0xfdc2('0x21')](respondWithResult(_0x265c71,null))[_0xfdc2('0x2b')](handleError(_0x265c71,null));};exports[_0xfdc2('0x55')]=function(_0x577085,_0x82a1ec){return db[_0xfdc2('0x3e')]['create'](_0x577085['body'],{})[_0xfdc2('0x21')](respondWithResult(_0x82a1ec,0xc9))[_0xfdc2('0x2b')](handleError(_0x82a1ec,null));};exports[_0xfdc2('0x37')]=function(_0x21750c,_0x3394b9){if(_0x21750c[_0xfdc2('0x56')]['id']){delete _0x21750c[_0xfdc2('0x56')]['id'];}return db[_0xfdc2('0x3e')][_0xfdc2('0x54')]({'where':{'id':_0x21750c[_0xfdc2('0x57')]['id']}})[_0xfdc2('0x21')](handleEntityNotFound(_0x3394b9,null))[_0xfdc2('0x21')](saveUpdates(_0x21750c[_0xfdc2('0x56')],null))['then'](respondWithResult(_0x3394b9,null))[_0xfdc2('0x2b')](handleError(_0x3394b9,null));};exports['destroy']=function(_0x48d232,_0x3952a9){return db['ChatMessage'][_0xfdc2('0x54')]({'where':{'id':_0x48d232['params']['id']}})[_0xfdc2('0x21')](handleEntityNotFound(_0x3952a9,null))[_0xfdc2('0x21')](removeEntity(_0x3952a9,null))[_0xfdc2('0x2b')](handleError(_0x3952a9,null));};exports[_0xfdc2('0x58')]=function(_0x4bb82,_0x4af9fe){return db[_0xfdc2('0x3e')][_0xfdc2('0x58')]()[_0xfdc2('0x21')](respondWithResult(_0x4af9fe,null))['catch'](handleError(_0x4af9fe,null));};var interaction_log=require('../../config/logger')(_0xfdc2('0x59'));exports[_0xfdc2('0x5a')]=function(_0x23be4a,_0x5939ef,_0x52214f){var _0x5231f9={'agent':{},'channel':_0xfdc2('0x5b')};if(_0x23be4a[_0xfdc2('0x56')]['id']){delete _0x23be4a[_0xfdc2('0x56')]['id'];}_0x23be4a[_0xfdc2('0x56')][_0xfdc2('0x5c')]=!![];_0x23be4a['body'][_0xfdc2('0x5d')]=moment()[_0xfdc2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x23be4a[_0xfdc2('0x56')][_0xfdc2('0x5f')]=_0x23be4a['body'][_0xfdc2('0x5f')]||_0x23be4a[_0xfdc2('0x60')]['id'];_0x5231f9['agent']['id']=_0x23be4a[_0xfdc2('0x56')][_0xfdc2('0x5f')];return db[_0xfdc2('0x3e')]['find']({'where':{'id':_0x23be4a[_0xfdc2('0x57')]['id'],'UserId':null}})[_0xfdc2('0x21')](handleEntityNotFound(_0x5939ef,null))[_0xfdc2('0x21')](saveUpdates(_0x23be4a[_0xfdc2('0x56')],null))[_0xfdc2('0x21')](function(_0xc0f8b5){if(_0xc0f8b5){_0x5231f9[_0xfdc2('0x2a')]=_0xc0f8b5[_0xfdc2('0x61')]({'plain':!![]});return db[_0xfdc2('0x62')][_0xfdc2('0x54')]({'where':{'id':_0xc0f8b5[_0xfdc2('0x63')]}});}return null;})[_0xfdc2('0x21')](handleEntityNotFound(_0x5939ef,null))[_0xfdc2('0x21')](function(_0x28c30e){if(_0x28c30e){return _0x28c30e[_0xfdc2('0x37')]({'UserId':_0x23be4a[_0xfdc2('0x56')][_0xfdc2('0x5f')],'read1stAt':_['isNil'](_0x28c30e[_0xfdc2('0x64')])?moment()['format'](_0xfdc2('0x65')):undefined});}return null;})[_0xfdc2('0x21')](function(_0x1d55f1){if(_0x1d55f1){_0x5231f9['interaction']=_0x1d55f1[_0xfdc2('0x61')]({'plain':!![]});interaction_log[_0xfdc2('0x22')](_0xfdc2('0x66'),_0x23be4a[_0xfdc2('0x60')]['id'],_0x23be4a[_0xfdc2('0x60')][_0xfdc2('0x3b')],_0x23be4a[_0xfdc2('0x60')]['role'],_0x5231f9[_0xfdc2('0x67')]['id'],_0x23be4a['body']?JSON[_0xfdc2('0x27')](_0x23be4a[_0xfdc2('0x56')]):_0xfdc2('0x68'));return respondWithRpcPromise('AcceptMessage',_0xfdc2('0x69'),_0x5231f9);}return null;})[_0xfdc2('0x21')](function(_0x4fa2b0){var _0x1277d1=_0xfdc2('0x6a')+_0x4fa2b0['message'][_0xfdc2('0x6b')];return db[_0xfdc2('0x6c')][_0xfdc2('0x44')](_0x1277d1,{'type':db[_0xfdc2('0x6d')][_0xfdc2('0x6e')][_0xfdc2('0x6f')],'raw':!![]})[_0xfdc2('0x21')](function(_0x22059e){return _0x22059e;});})[_0xfdc2('0x21')](function(_0x5afe08){if(_0x5afe08){_0x5231f9[_0xfdc2('0x2a')][_0xfdc2('0x70')]=_0x5afe08[0x0];if(!_0x23be4a[_0xfdc2('0x56')][_0xfdc2('0x5f')])return;return db[_0xfdc2('0x71')][_0xfdc2('0x54')]({'where':{'id':_0x23be4a['body'][_0xfdc2('0x5f')],'role':_0xfdc2('0x72')},'attributes':['id',_0xfdc2('0x3b'),_0xfdc2('0x73'),_0xfdc2('0x74'),_0xfdc2('0x75')],'raw':!![]});}return null;})['then'](function(_0x5381d8){if(!_0x5381d8)return null;_0x5231f9['message'][_0xfdc2('0x72')]=_0x5381d8;return _0x5231f9;})['then'](function(_0x3810cb){if(_0x3810cb){if(_0x23be4a[_0xfdc2('0x56')][_0xfdc2('0x76')]){_0x5231f9[_0xfdc2('0x2a')][_0xfdc2('0x77')]=util[_0xfdc2('0x5e')](_0xfdc2('0x78'),_0x23be4a['user'][_0xfdc2('0x3b')]);_0x5231f9['message']['channel']=_0x5231f9['channel'];_0x5231f9[_0xfdc2('0x2a')][_0xfdc2('0x79')]=_0x5231f9[_0xfdc2('0x7a')];_0x5231f9[_0xfdc2('0x2a')][_0xfdc2('0x7b')]=_0xfdc2('0x5a');return respondWithRpcPromise('EventManager',_0xfdc2('0x7c'),{'event':_0xfdc2('0x7d'),'message':_['merge'](_0x5231f9[_0xfdc2('0x2a')],JSON[_0xfdc2('0x7e')](_0x5231f9[_0xfdc2('0x67')]['formData']))},client9002)[_0xfdc2('0x21')](function(){return _0x5231f9;});}return _0x5231f9;}return null;})[_0xfdc2('0x21')](respondWithResult(_0x5939ef,null))[_0xfdc2('0x2b')](handleError(_0x5939ef,null));};var interaction_log=require(_0xfdc2('0x16'))('chat-interactions');exports[_0xfdc2('0x35')]=function(_0x1e6d7a,_0x538aeb,_0x16dc4f){var _0xb4aef7={'agent':{},'channel':_0xfdc2('0x5b')};if(_0x1e6d7a[_0xfdc2('0x56')]['id']){delete _0x1e6d7a[_0xfdc2('0x56')]['id'];}_0x1e6d7a[_0xfdc2('0x56')][_0xfdc2('0x5f')]=_0x1e6d7a[_0xfdc2('0x56')][_0xfdc2('0x5f')]||_0x1e6d7a['user']['id'];_0xb4aef7[_0xfdc2('0x72')]['id']=_0x1e6d7a[_0xfdc2('0x56')][_0xfdc2('0x5f')];return db['ChatMessage'][_0xfdc2('0x54')]({'where':{'id':_0x1e6d7a[_0xfdc2('0x57')]['id'],'UserId':null}})[_0xfdc2('0x21')](handleEntityNotFound(_0x538aeb,null))['then'](function(_0x533301){if(_0x533301){_0xb4aef7[_0xfdc2('0x2a')]=_0x533301[_0xfdc2('0x61')]({'plain':!![]});return db[_0xfdc2('0x62')]['find']({'where':{'id':_0x533301[_0xfdc2('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x538aeb,null))[_0xfdc2('0x21')](function(_0x4d8c3a){if(_0x4d8c3a){_0xb4aef7['interaction']=_0x4d8c3a['get']({'plain':!![]});interaction_log[_0xfdc2('0x22')](_0xfdc2('0x7f'),_0x1e6d7a['user']['id'],_0x1e6d7a[_0xfdc2('0x60')]['name'],_0x1e6d7a[_0xfdc2('0x60')][_0xfdc2('0x80')],_0xb4aef7[_0xfdc2('0x67')]['id'],_0x1e6d7a[_0xfdc2('0x56')]?JSON[_0xfdc2('0x27')](_0x1e6d7a[_0xfdc2('0x56')]):_0xfdc2('0x68'));return respondWithRpcPromise(_0xfdc2('0x81'),'rejectMessage',_0xb4aef7);}return null;})[_0xfdc2('0x21')](function(_0x448ab2){var _0x4246fb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x448ab2[_0xfdc2('0x2a')][_0xfdc2('0x6b')];return db[_0xfdc2('0x6c')][_0xfdc2('0x44')](_0x4246fb,{'type':db[_0xfdc2('0x6d')]['QueryTypes'][_0xfdc2('0x6f')],'raw':!![]})[_0xfdc2('0x21')](function(_0x1de5b0){return _0x1de5b0;});})[_0xfdc2('0x21')](function(_0x559722){if(_0x559722){_0xb4aef7[_0xfdc2('0x2a')][_0xfdc2('0x70')]=_0x559722[0x0];if(!_0x1e6d7a[_0xfdc2('0x56')]['UserId'])return;return db[_0xfdc2('0x71')]['find']({'where':{'id':_0x1e6d7a['body'][_0xfdc2('0x5f')],'role':'agent'},'attributes':['id',_0xfdc2('0x3b'),_0xfdc2('0x73'),_0xfdc2('0x74'),'internal'],'raw':!![]});}return null;})[_0xfdc2('0x21')](function(_0x4797ea){if(!_0x4797ea)return null;_0xb4aef7[_0xfdc2('0x2a')]['agent']=_0x4797ea;return _0xb4aef7;})[_0xfdc2('0x21')](function(_0x1384c3){if(_0x1384c3){_0x1384c3[_0xfdc2('0x2a')][_0xfdc2('0x77')]=util[_0xfdc2('0x5e')](_0xfdc2('0x78'),_0x1e6d7a[_0xfdc2('0x60')][_0xfdc2('0x3b')]);_0x1384c3[_0xfdc2('0x2a')][_0xfdc2('0x7a')]=_0xb4aef7['channel'];_0x1384c3['message'][_0xfdc2('0x79')]=_0xb4aef7['channel'];_0x1384c3[_0xfdc2('0x2a')][_0xfdc2('0x7b')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0xfdc2('0x50')](_0xb4aef7[_0xfdc2('0x2a')],JSON['parse'](_0xb4aef7['interaction'][_0xfdc2('0x82')]))},client9002);return _0xb4aef7;}return null;})[_0xfdc2('0x21')](respondWithResult(_0x538aeb,null))[_0xfdc2('0x2b')](handleError(_0x538aeb,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 95a7c04..1dcd49e 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 _0x2200=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x223494,_0x7b0380){var _0xa7293e=function(_0x34a577){while(--_0x34a577){_0x223494['push'](_0x223494['shift']());}};_0xa7293e(++_0x7b0380);}(_0x2200,0x9d));var _0x0220=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0x2200[_0x15cbce];return _0x257f29;};'use strict';var EventEmitter=require(_0x0220('0x0'));var ChatMessage=require(_0x0220('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0220('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0220('0x3'),'afterDestroy':_0x0220('0x4')};function emitEvent(_0x12fe17){return function(_0x5e31d1,_0x4de14e,_0x17b63a){ChatMessageEvents[_0x0220('0x5')](_0x12fe17+':'+_0x5e31d1['id'],_0x5e31d1);ChatMessageEvents[_0x0220('0x5')](_0x12fe17,_0x5e31d1);_0x17b63a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x0220('0x6')](e,emitEvent(event));}}module[_0x0220('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x75e0=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x75e0,0xa7));var _0x075e=function(_0x2447c1,_0x28fe94){_0x2447c1=_0x2447c1-0x0;var _0x37e46d=_0x75e0[_0x2447c1];return _0x37e46d;};'use strict';var EventEmitter=require(_0x075e('0x0'));var ChatMessage=require(_0x075e('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x075e('0x2')](0x0);var events={'afterCreate':_0x075e('0x3'),'afterUpdate':_0x075e('0x4'),'afterDestroy':_0x075e('0x5')};function emitEvent(_0x58c9fd){return function(_0x233919,_0x4c127d,_0x1473d3){ChatMessageEvents[_0x075e('0x6')](_0x58c9fd+':'+_0x233919['id'],_0x233919);ChatMessageEvents[_0x075e('0x6')](_0x58c9fd,_0x233919);_0x1473d3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x075e('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 850d6a2..9d771c4 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 _0x69c8=['moment','bluebird','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x69c8,0xbc));var _0x869c=function(_0x50e7a4,_0x35bfbf){_0x50e7a4=_0x50e7a4-0x0;var _0x35c692=_0x69c8[_0x50e7a4];return _0x35c692;};'use strict';var _=require(_0x869c('0x0'));var util=require(_0x869c('0x1'));var logger=require(_0x869c('0x2'))(_0x869c('0x3'));var moment=require(_0x869c('0x4'));var BPromise=require(_0x869c('0x5'));var rp=require(_0x869c('0x6'));var fs=require('fs');var path=require(_0x869c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x869c('0x8'));module[_0x869c('0x9')]=function(_0x2ba45b,_0x134695){return _0x2ba45b[_0x869c('0xa')](_0x869c('0xb'),attributes,{'tableName':_0x869c('0xc'),'paranoid':![],'indexes':[{'name':_0x869c('0xd'),'fields':[_0x869c('0xe')],'type':_0x869c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x535546,_0x36e6c7,_0x4dd4b9){var _0x2728fb=_0x2ba45b[_0x869c('0x10')];var _0x453406=_0x535546[_0x869c('0x11')]({'plain':!![]});if(_0x453406[_0x869c('0x12')]['toLowerCase']()==='in'||_0x453406[_0x869c('0x12')][_0x869c('0x13')]()===_0x869c('0x14')&&!_0x453406[_0x869c('0x15')]&&!_[_0x869c('0x16')](_0x453406[_0x869c('0x17')])){_0x2728fb['ChatInteraction'][_0x869c('0x18')]({'where':{'id':_0x453406[_0x869c('0x19')]}})[_0x869c('0x1a')](function(_0x1d747a){if(_0x1d747a){_0x1d747a[_0x869c('0x1b')]({'lastMsgAt':_0x453406[_0x869c('0x1c')],'lastMsgDirection':_0x453406[_0x869c('0x12')][_0x869c('0x13')]()});}})[_0x869c('0x1d')](function(_0x344fb8){console[_0x869c('0x1e')](_0x344fb8);});}_0x4dd4b9();}},'charset':'utf8mb4','collate':_0x869c('0x1f')});};
\ No newline at end of file
+var _0x1fda=['error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','FULLTEXT','get','toLowerCase','direction','out','isNil','ChatInteractionId','then','createdAt'];(function(_0x26659f,_0x32f426){var _0x42667f=function(_0xdc0b71){while(--_0xdc0b71){_0x26659f['push'](_0x26659f['shift']());}};_0x42667f(++_0x32f426);}(_0x1fda,0x19b));var _0xa1fd=function(_0x13c0f3,_0x33d4bf){_0x13c0f3=_0x13c0f3-0x0;var _0x1c2c33=_0x1fda[_0x13c0f3];return _0x1c2c33;};'use strict';var _=require(_0xa1fd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa1fd('0x1'));var moment=require(_0xa1fd('0x2'));var BPromise=require(_0xa1fd('0x3'));var rp=require(_0xa1fd('0x4'));var fs=require('fs');var path=require(_0xa1fd('0x5'));var rimraf=require(_0xa1fd('0x6'));var config=require(_0xa1fd('0x7'));var attributes=require(_0xa1fd('0x8'));module['exports']=function(_0x151253,_0x3e4df7){return _0x151253[_0xa1fd('0x9')](_0xa1fd('0xa'),attributes,{'tableName':_0xa1fd('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xa1fd('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3198c4,_0x48037d,_0x1a5001){var _0x1efb03=_0x151253['models'];var _0x410515=_0x3198c4[_0xa1fd('0xd')]({'plain':!![]});if(_0x410515['direction'][_0xa1fd('0xe')]()==='in'||_0x410515[_0xa1fd('0xf')][_0xa1fd('0xe')]()===_0xa1fd('0x10')&&!_0x410515['secret']&&!_[_0xa1fd('0x11')](_0x410515['UserId'])){_0x1efb03['ChatInteraction']['findOne']({'where':{'id':_0x410515[_0xa1fd('0x12')]}})[_0xa1fd('0x13')](function(_0x1d09ce){if(_0x1d09ce){_0x1d09ce['update']({'lastMsgAt':_0x410515[_0xa1fd('0x14')],'lastMsgDirection':_0x410515[_0xa1fd('0xf')][_0xa1fd('0xe')]()});}})['catch'](function(_0x1b4697){console[_0xa1fd('0x15')](_0x1b4697);});}_0x1a5001();}},'charset':_0xa1fd('0x16'),'collate':_0xa1fd('0x17')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 946904e..6698a01 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 _0x7be6=['ChatMessage','create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','CreateChatMessage'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7be6,0x1e3));var _0x67be=function(_0x318162,_0x222103){_0x318162=_0x318162-0x0;var _0xfea92b=_0x7be6[_0x318162];return _0xfea92b;};'use strict';var _=require(_0x67be('0x0'));var util=require(_0x67be('0x1'));var moment=require(_0x67be('0x2'));var BPromise=require(_0x67be('0x3'));var rs=require(_0x67be('0x4'));var fs=require('fs');var Redis=require(_0x67be('0x5'));var db=require(_0x67be('0x6'))['db'];var utils=require(_0x67be('0x7'));var logger=require(_0x67be('0x8'))(_0x67be('0x9'));var config=require(_0x67be('0xa'));var jayson=require(_0x67be('0xb'));var client=jayson[_0x67be('0xc')][_0x67be('0xd')]({'port':0x232a});config[_0x67be('0xe')]=_['defaults'](config[_0x67be('0xe')],{'host':_0x67be('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x67be('0x10'))[_0x67be('0x11')](socket);function respondWithRpcPromise(_0x500f48,_0x405f14,_0xc01bec){return new BPromise(function(_0x939d83,_0x2991da){return client['request'](_0x500f48,_0xc01bec)['then'](function(_0x32a333){logger[_0x67be('0x12')](_0x67be('0x13'),_0x405f14,_0x67be('0x14'));logger[_0x67be('0x15')](_0x67be('0x16'),_0x405f14,_0x67be('0x14'),JSON['stringify'](_0x32a333));if(_0x32a333[_0x67be('0x17')]){if(_0x32a333[_0x67be('0x17')][_0x67be('0x18')]===0x1f4){logger[_0x67be('0x17')]('ChatMessage,\x20%s,\x20%s',_0x405f14,_0x32a333[_0x67be('0x17')][_0x67be('0x19')]);return _0x2991da(_0x32a333[_0x67be('0x17')][_0x67be('0x19')]);}logger[_0x67be('0x17')](_0x67be('0x13'),_0x405f14,_0x32a333[_0x67be('0x17')]['message']);return _0x939d83(_0x32a333[_0x67be('0x17')]['message']);}else{logger[_0x67be('0x12')](_0x67be('0x13'),_0x405f14,_0x67be('0x14'));_0x939d83(_0x32a333['result'][_0x67be('0x19')]);}})['catch'](function(_0x5e058f){logger[_0x67be('0x17')]('ChatMessage,\x20%s,\x20%s',_0x405f14,_0x5e058f);_0x2991da(_0x5e058f);});});}exports[_0x67be('0x1a')]=function(_0x38cfb5){var _0x5a97ba=this;return new Promise(function(_0x5c8e5a,_0x1012f9){return db[_0x67be('0x1b')][_0x67be('0x1c')](_0x38cfb5[_0x67be('0x1d')],{'raw':_0x38cfb5[_0x67be('0x1e')]?_0x38cfb5[_0x67be('0x1e')][_0x67be('0x1f')]===undefined?!![]:![]:!![]})[_0x67be('0x20')](function(_0x111411){logger[_0x67be('0x12')](_0x67be('0x1a'),_0x38cfb5);logger[_0x67be('0x15')](_0x67be('0x1a'),_0x38cfb5,JSON['stringify'](_0x111411));_0x5c8e5a(_0x111411);})[_0x67be('0x21')](function(_0x2c31a1){logger[_0x67be('0x17')](_0x67be('0x1a'),_0x2c31a1[_0x67be('0x19')],_0x38cfb5);_0x1012f9(_0x5a97ba[_0x67be('0x17')](0x1f4,_0x2c31a1[_0x67be('0x19')]));});});};
\ No newline at end of file
+var _0x154a=['body','options','raw','CreateChatMessage','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','create'];(function(_0x5042a8,_0x2d66a5){var _0x51b197=function(_0x41111f){while(--_0x41111f){_0x5042a8['push'](_0x5042a8['shift']());}};_0x51b197(++_0x2d66a5);}(_0x154a,0x1e5));var _0xa154=function(_0x4d7033,_0x1ce24e){_0x4d7033=_0x4d7033-0x0;var _0x309128=_0x154a[_0x4d7033];return _0x309128;};'use strict';var _=require(_0xa154('0x0'));var util=require(_0xa154('0x1'));var moment=require(_0xa154('0x2'));var BPromise=require('bluebird');var rs=require(_0xa154('0x3'));var fs=require('fs');var Redis=require(_0xa154('0x4'));var db=require(_0xa154('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa154('0x6'))(_0xa154('0x7'));var config=require(_0xa154('0x8'));var jayson=require(_0xa154('0x9'));var client=jayson[_0xa154('0xa')][_0xa154('0xb')]({'port':0x232a});config[_0xa154('0xc')]=_['defaults'](config['redis'],{'host':_0xa154('0xd'),'port':0x18eb});var socket=require(_0xa154('0xe'))(new Redis(config[_0xa154('0xc')]));require(_0xa154('0xf'))['register'](socket);function respondWithRpcPromise(_0x1c90ad,_0x1f7b15,_0x3737aa){return new BPromise(function(_0x41285a,_0x549ad4){return client[_0xa154('0x10')](_0x1c90ad,_0x3737aa)[_0xa154('0x11')](function(_0x591537){logger[_0xa154('0x12')](_0xa154('0x13'),_0x1f7b15,'request\x20sent');logger[_0xa154('0x14')](_0xa154('0x15'),_0x1f7b15,_0xa154('0x16'),JSON[_0xa154('0x17')](_0x591537));if(_0x591537[_0xa154('0x18')]){if(_0x591537[_0xa154('0x18')]['code']===0x1f4){logger[_0xa154('0x18')](_0xa154('0x13'),_0x1f7b15,_0x591537[_0xa154('0x18')][_0xa154('0x19')]);return _0x549ad4(_0x591537[_0xa154('0x18')]['message']);}logger[_0xa154('0x18')](_0xa154('0x13'),_0x1f7b15,_0x591537[_0xa154('0x18')][_0xa154('0x19')]);return _0x41285a(_0x591537[_0xa154('0x18')][_0xa154('0x19')]);}else{logger[_0xa154('0x12')](_0xa154('0x13'),_0x1f7b15,'request\x20sent');_0x41285a(_0x591537['result'][_0xa154('0x19')]);}})['catch'](function(_0x50ccf0){logger[_0xa154('0x18')](_0xa154('0x13'),_0x1f7b15,_0x50ccf0);_0x549ad4(_0x50ccf0);});});}exports['CreateChatMessage']=function(_0x3c34a3){var _0x37ec74=this;return new Promise(function(_0x9c36cb,_0x45b651){return db['ChatMessage'][_0xa154('0x1a')](_0x3c34a3[_0xa154('0x1b')],{'raw':_0x3c34a3[_0xa154('0x1c')]?_0x3c34a3[_0xa154('0x1c')][_0xa154('0x1d')]===undefined?!![]:![]:!![]})[_0xa154('0x11')](function(_0x1f9f00){logger[_0xa154('0x12')](_0xa154('0x1e'),_0x3c34a3);logger[_0xa154('0x14')](_0xa154('0x1e'),_0x3c34a3,JSON[_0xa154('0x17')](_0x1f9f00));_0x9c36cb(_0x1f9f00);})[_0xa154('0x1f')](function(_0x3e61b0){logger[_0xa154('0x18')](_0xa154('0x1e'),_0x3e61b0[_0xa154('0x19')],_0x3c34a3);_0x45b651(_0x37ec74[_0xa154('0x18')](0x1f4,_0x3e61b0['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 2b3ba3a..40ae35e 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 _0x3645=['emit','removeListener','register','length','save','remove','update'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x3645,0x154));var _0x5364=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x3645[_0x34d346];return _0x122d76;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5364('0x0'),_0x5364('0x1'),_0x5364('0x2')];function createListener(_0x28eafb,_0x2d71d7){return function(_0x2f629b){_0x2d71d7[_0x5364('0x3')](_0x28eafb,_0x2f629b);};}function removeListener(_0x5a63bf,_0x334a16){return function(){ChatMessageEvents[_0x5364('0x4')](_0x5a63bf,_0x334a16);};}exports[_0x5364('0x5')]=function(_0x1f9c6b){for(var _0x417c44=0x0,_0x7933a5=events[_0x5364('0x6')];_0x417c44<_0x7933a5;_0x417c44++){var _0x43fb3f=events[_0x417c44];var _0x3c1b21=createListener('chatMessage:'+_0x43fb3f,_0x1f9c6b);ChatMessageEvents['on'](_0x43fb3f,_0x3c1b21);}};
\ No newline at end of file
+var _0x3e74=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x3e74,0x175));var _0x43e7=function(_0x18d077,_0xd20563){_0x18d077=_0x18d077-0x0;var _0x50dec6=_0x3e74[_0x18d077];return _0x50dec6;};'use strict';var ChatMessageEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatMessageEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatMessageEvents['on'](_0x3491d6,_0x2ede2d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 7e1b658..6fbe130 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 _0x5b18=['../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked','chatmessage:create','create','put','update','accept','delete','exports','util','path','Router','fs-extra','../../components/auth/service'];(function(_0xb010e8,_0x47ae36){var _0x1fdb0a=function(_0x6db2e4){while(--_0x6db2e4){_0xb010e8['push'](_0xb010e8['shift']());}};_0x1fdb0a(++_0x47ae36);}(_0x5b18,0xf8));var _0x85b1=function(_0x21c23e,_0x1d33e3){_0x21c23e=_0x21c23e-0x0;var _0xa7b7e2=_0x5b18[_0x21c23e];return _0xa7b7e2;};'use strict';var multer=require('multer');var util=require(_0x85b1('0x0'));var path=require(_0x85b1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85b1('0x2')]();var fs_extra=require(_0x85b1('0x3'));var auth=require(_0x85b1('0x4'));var interaction=require(_0x85b1('0x5'));var config=require(_0x85b1('0x6'));var controller=require(_0x85b1('0x7'));router['get']('/',auth[_0x85b1('0x8')](),controller[_0x85b1('0x9')]);router[_0x85b1('0xa')](_0x85b1('0xb'),auth[_0x85b1('0x8')](),controller['describe']);router['get'](_0x85b1('0xc'),auth[_0x85b1('0x8')](),controller[_0x85b1('0xd')]);router[_0x85b1('0xe')]('/',auth[_0x85b1('0x8')](),interaction[_0x85b1('0xf')]('chat',_0x85b1('0x10')),controller[_0x85b1('0x11')]);router[_0x85b1('0x12')](_0x85b1('0xc'),controller[_0x85b1('0x13')]);router[_0x85b1('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x85b1('0x14')]);router[_0x85b1('0x12')]('/:id/reject',auth[_0x85b1('0x8')](),controller['reject']);router[_0x85b1('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x85b1('0x16')]=router;
\ No newline at end of file
+var _0xec85=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec85,0x12c));var _0x5ec8=function(_0x3abd6a,_0xd7417b){_0x3abd6a=_0x3abd6a-0x0;var _0x2d383c=_0xec85[_0x3abd6a];return _0x2d383c;};'use strict';var multer=require(_0x5ec8('0x0'));var util=require('util');var path=require(_0x5ec8('0x1'));var timeout=require(_0x5ec8('0x2'));var express=require(_0x5ec8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5ec8('0x4'));var interaction=require(_0x5ec8('0x5'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x5ec8('0x6')](),controller['index']);router[_0x5ec8('0x7')](_0x5ec8('0x8'),auth['isAuthenticated'](),controller[_0x5ec8('0x9')]);router[_0x5ec8('0x7')](_0x5ec8('0xa'),auth[_0x5ec8('0x6')](),controller[_0x5ec8('0xb')]);router[_0x5ec8('0xc')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x5ec8('0xd'),_0x5ec8('0xe')),controller[_0x5ec8('0xf')]);router[_0x5ec8('0x10')](_0x5ec8('0xa'),controller[_0x5ec8('0x11')]);router[_0x5ec8('0x10')](_0x5ec8('0x12'),auth['isAuthenticated'](),controller[_0x5ec8('0x13')]);router[_0x5ec8('0x10')](_0x5ec8('0x14'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x5ec8('0xa'),auth['isAuthenticated'](),controller[_0x5ec8('0x15')]);module[_0x5ec8('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index bd377cb..5eeab96 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['medium','TEXT','exports'];(function(_0x4fb479,_0x148044){var _0x2685ee=function(_0x5150e9){while(--_0x5150e9){_0x4fb479['push'](_0x4fb479['shift']());}};_0x2685ee(++_0x148044);}(_0xadb5,0xad));var _0x5adb=function(_0x64b63,_0x40c6e9){_0x64b63=_0x64b63-0x0;var _0x367bc7=_0xadb5[_0x64b63];return _0x367bc7;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x44e5f3,_0x98265d){var _0x3a9dc0=function(_0x3daca6){while(--_0x3daca6){_0x44e5f3['push'](_0x44e5f3['shift']());}};_0x3a9dc0(++_0x98265d);}(_0x2032,0xd9));var _0x2203=function(_0x5eb99b,_0x48b62a){_0x5eb99b=_0x5eb99b-0x0;var _0x1c76f2=_0x2032[_0x5eb99b];return _0x1c76f2;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2a89eb6..eb0fed0 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(_0x5a483f,_0x95b3f8){var _0x247d88=function(_0x5e6359){while(--_0x5e6359){_0x5a483f['push'](_0x5a483f['shift']());}};_0x247d88(++_0x95b3f8);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x37d793,_0x22441d){_0x37d793=_0x37d793-0x0;var _0x28adb7=_0x7a54[_0x37d793];return _0x28adb7;};'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 c1b1481..cad8a29 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 _0x0d91=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x22c867,_0x20589d){var _0x439f1f=function(_0xd69f7){while(--_0xd69f7){_0x22c867['push'](_0x22c867['shift']());}};_0x439f1f(++_0x20589d);}(_0x0d91,0x76));var _0x10d9=function(_0x5bdd5d,_0x5042c5){_0x5bdd5d=_0x5bdd5d-0x0;var _0x37d28c=_0x0d91[_0x5bdd5d];return _0x37d28c;};'use strict';var EventEmitter=require(_0x10d9('0x0'));var ChatOfflineMessage=require(_0x10d9('0x1'))['db'][_0x10d9('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x10d9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x10d9('0x4'),'afterDestroy':_0x10d9('0x5')};function emitEvent(_0x132a71){return function(_0x56ab5d,_0x2f6e57,_0x305c20){ChatOfflineMessageEvents[_0x10d9('0x6')](_0x132a71+':'+_0x56ab5d['id'],_0x56ab5d);ChatOfflineMessageEvents['emit'](_0x132a71,_0x56ab5d);_0x305c20(null);};}for(var e in events){if(events[_0x10d9('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x10d9('0x8')](e,emitEvent(event));}}module[_0x10d9('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x41be=['update','remove','emit','hook','exports','events','setMaxListeners'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0x41be,0x11d));var _0xe41b=function(_0x23cc76,_0x9c756b){_0x23cc76=_0x23cc76-0x0;var _0x2f5c13=_0x41be[_0x23cc76];return _0x2f5c13;};'use strict';var EventEmitter=require(_0xe41b('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe41b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe41b('0x2'),'afterDestroy':_0xe41b('0x3')};function emitEvent(_0x335c93){return function(_0x19cab3,_0x2e898c,_0x33e8c0){ChatOfflineMessageEvents[_0xe41b('0x4')](_0x335c93+':'+_0x19cab3['id'],_0x19cab3);ChatOfflineMessageEvents[_0xe41b('0x4')](_0x335c93,_0x19cab3);_0x33e8c0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xe41b('0x5')](e,emitEvent(event));}}module[_0xe41b('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index d25a3c8..cea14a4 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 _0x211b=['ChatOfflineMessage','chat_offline_messages','exports','define'];(function(_0x160734,_0x2f62c3){var _0x168888=function(_0x3f3a6e){while(--_0x3f3a6e){_0x160734['push'](_0x160734['shift']());}};_0x168888(++_0x2f62c3);}(_0x211b,0x1d2));var _0xb211=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x211b[_0x1ae5ab];return _0x1ce001;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xb211('0x0')]=function(_0x36e262){return _0x36e262[_0xb211('0x1')](_0xb211('0x2'),attributes,{'tableName':_0xb211('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x126d=['./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0x40bb78,_0x4ea7da){var _0x2371b7=function(_0x4caedb){while(--_0x4caedb){_0x40bb78['push'](_0x40bb78['shift']());}};_0x2371b7(++_0x4ea7da);}(_0x126d,0x1bd));var _0xd126=function(_0x69f3aa,_0x2331f6){_0x69f3aa=_0x69f3aa-0x0;var _0xe7999a=_0x126d[_0x69f3aa];return _0xe7999a;};'use strict';var attributes=require(_0xd126('0x0'));module['exports']=function(_0x4b52d4){return _0x4b52d4[_0xd126('0x1')](_0xd126('0x2'),attributes,{'tableName':_0xd126('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd126('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 6db1cb6..15aabcf 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 _0xceb3=['rpc','../../config/environment','jayson/promise','client','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0xceb3,0xf5));var _0x3ceb=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xceb3[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require(_0x3ceb('0x0'));var util=require(_0x3ceb('0x1'));var moment=require(_0x3ceb('0x2'));var BPromise=require(_0x3ceb('0x3'));var rs=require(_0x3ceb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ceb('0x5'))['db'];var utils=require(_0x3ceb('0x6'));var logger=require(_0x3ceb('0x7'))(_0x3ceb('0x8'));var config=require(_0x3ceb('0x9'));var jayson=require(_0x3ceb('0xa'));var client=jayson[_0x3ceb('0xb')][_0x3ceb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x245f31,_0x1467cd,_0xdd8862){return new BPromise(function(_0x433147,_0x3c5dd9){return client['request'](_0x245f31,_0xdd8862)['then'](function(_0x3bb28d){logger[_0x3ceb('0xd')](_0x3ceb('0xe'),_0x1467cd,_0x3ceb('0xf'));logger['debug'](_0x3ceb('0x10'),_0x1467cd,'request\x20sent',JSON[_0x3ceb('0x11')](_0x3bb28d));if(_0x3bb28d[_0x3ceb('0x12')]){if(_0x3bb28d[_0x3ceb('0x12')][_0x3ceb('0x13')]===0x1f4){logger[_0x3ceb('0x12')](_0x3ceb('0xe'),_0x1467cd,_0x3bb28d[_0x3ceb('0x12')][_0x3ceb('0x14')]);return _0x3c5dd9(_0x3bb28d[_0x3ceb('0x12')]['message']);}logger[_0x3ceb('0x12')](_0x3ceb('0xe'),_0x1467cd,_0x3bb28d[_0x3ceb('0x12')][_0x3ceb('0x14')]);return _0x433147(_0x3bb28d[_0x3ceb('0x12')]['message']);}else{logger[_0x3ceb('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1467cd,'request\x20sent');_0x433147(_0x3bb28d[_0x3ceb('0x15')][_0x3ceb('0x14')]);}})[_0x3ceb('0x16')](function(_0x506d40){logger[_0x3ceb('0x12')](_0x3ceb('0xe'),_0x1467cd,_0x506d40);_0x3c5dd9(_0x506d40);});});}
\ No newline at end of file
+var _0x0a52=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x3965de,_0x4a3560){var _0x347113=function(_0x5bc637){while(--_0x5bc637){_0x3965de['push'](_0x3965de['shift']());}};_0x347113(++_0x4a3560);}(_0x0a52,0xe4));var _0x20a5=function(_0x22d299,_0x1d1a10){_0x22d299=_0x22d299-0x0;var _0x2360d0=_0x0a52[_0x22d299];return _0x2360d0;};'use strict';var _=require(_0x20a5('0x0'));var util=require(_0x20a5('0x1'));var moment=require('moment');var BPromise=require(_0x20a5('0x2'));var rs=require(_0x20a5('0x3'));var fs=require('fs');var Redis=require(_0x20a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20a5('0x5'));var logger=require(_0x20a5('0x6'))(_0x20a5('0x7'));var config=require(_0x20a5('0x8'));var jayson=require(_0x20a5('0x9'));var client=jayson[_0x20a5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56b172,_0x39920b,_0x1f44fd){return new BPromise(function(_0x478779,_0x37196c){return client[_0x20a5('0xb')](_0x56b172,_0x1f44fd)[_0x20a5('0xc')](function(_0xcf7c56){logger['info'](_0x20a5('0xd'),_0x39920b,_0x20a5('0xe'));logger[_0x20a5('0xf')](_0x20a5('0x10'),_0x39920b,_0x20a5('0xe'),JSON[_0x20a5('0x11')](_0xcf7c56));if(_0xcf7c56[_0x20a5('0x12')]){if(_0xcf7c56[_0x20a5('0x12')]['code']===0x1f4){logger[_0x20a5('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x39920b,_0xcf7c56[_0x20a5('0x12')][_0x20a5('0x13')]);return _0x37196c(_0xcf7c56['error'][_0x20a5('0x13')]);}logger[_0x20a5('0x12')](_0x20a5('0xd'),_0x39920b,_0xcf7c56[_0x20a5('0x12')][_0x20a5('0x13')]);return _0x478779(_0xcf7c56[_0x20a5('0x12')][_0x20a5('0x13')]);}else{logger[_0x20a5('0x14')](_0x20a5('0xd'),_0x39920b,_0x20a5('0xe'));_0x478779(_0xcf7c56[_0x20a5('0x15')][_0x20a5('0x13')]);}})['catch'](function(_0x2ea9ab){logger['error'](_0x20a5('0xd'),_0x39920b,_0x2ea9ab);_0x37196c(_0x2ea9ab);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 0033e5e..aa21330 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 _0x0fdb=['show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe','isAuthenticated'];(function(_0x43469e,_0x4e69d6){var _0xcefd2a=function(_0x8ded6f){while(--_0x8ded6f){_0x43469e['push'](_0x43469e['shift']());}};_0xcefd2a(++_0x4e69d6);}(_0x0fdb,0x110));var _0xb0fd=function(_0x53308b,_0x28dc1a){_0x53308b=_0x53308b-0x0;var _0x5eac23=_0x0fdb[_0x53308b];return _0x5eac23;};'use strict';var multer=require('multer');var util=require(_0xb0fd('0x0'));var path=require(_0xb0fd('0x1'));var timeout=require(_0xb0fd('0x2'));var express=require(_0xb0fd('0x3'));var router=express[_0xb0fd('0x4')]();var fs_extra=require(_0xb0fd('0x5'));var auth=require(_0xb0fd('0x6'));var interaction=require(_0xb0fd('0x7'));var config=require(_0xb0fd('0x8'));var controller=require(_0xb0fd('0x9'));router[_0xb0fd('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb0fd('0xa')](_0xb0fd('0xb'),auth['isAuthenticated'](),controller[_0xb0fd('0xc')]);router[_0xb0fd('0xa')]('/:id',auth[_0xb0fd('0xd')](),controller[_0xb0fd('0xe')]);router[_0xb0fd('0xf')]('/',auth[_0xb0fd('0xd')](),controller[_0xb0fd('0x10')]);router[_0xb0fd('0x11')]('/:id',auth[_0xb0fd('0xd')](),controller[_0xb0fd('0x12')]);router[_0xb0fd('0x13')]('/:id',auth[_0xb0fd('0xd')](),controller[_0xb0fd('0x14')]);module[_0xb0fd('0x15')]=router;
\ No newline at end of file
+var _0xdd79=['/describe','isAuthenticated','show','post','create','/:id','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index'];(function(_0x7f816c,_0x25f12e){var _0x9106ca=function(_0x9958b3){while(--_0x9958b3){_0x7f816c['push'](_0x7f816c['shift']());}};_0x9106ca(++_0x25f12e);}(_0xdd79,0x128));var _0x9dd7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdd79[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x9dd7('0x0'));var util=require(_0x9dd7('0x1'));var path=require('path');var timeout=require(_0x9dd7('0x2'));var express=require('express');var router=express[_0x9dd7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9dd7('0x4'));var interaction=require(_0x9dd7('0x5'));var config=require(_0x9dd7('0x6'));var controller=require(_0x9dd7('0x7'));router[_0x9dd7('0x8')]('/',auth['isAuthenticated'](),controller[_0x9dd7('0x9')]);router['get'](_0x9dd7('0xa'),auth[_0x9dd7('0xb')](),controller['describe']);router[_0x9dd7('0x8')]('/:id',auth[_0x9dd7('0xb')](),controller[_0x9dd7('0xc')]);router[_0x9dd7('0xd')]('/',auth[_0x9dd7('0xb')](),controller[_0x9dd7('0xe')]);router['put']('/:id',auth[_0x9dd7('0xb')](),controller['update']);router['delete'](_0x9dd7('0xf'),auth[_0x9dd7('0xb')](),controller[_0x9dd7('0x10')]);module[_0x9dd7('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index d40ea06..1bcf0d8 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 _0xd9ff=['mouseOver','timeout','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x19cf1f,_0x4105e3){var _0x234028=function(_0x24748c){while(--_0x24748c){_0x19cf1f['push'](_0x19cf1f['shift']());}};_0x234028(++_0x4105e3);}(_0xd9ff,0x1e6));var _0xfd9f=function(_0x52e22e,_0x3674e9){_0x52e22e=_0x52e22e-0x0;var _0xb79010=_0xd9ff[_0x52e22e];return _0xb79010;};'use strict';var Sequelize=require(_0xfd9f('0x0'));module[_0xfd9f('0x1')]={'name':{'type':Sequelize[_0xfd9f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfd9f('0x3')](_0xfd9f('0x4'),_0xfd9f('0x5')),'defaultValue':_0xfd9f('0x4')},'selector':{'type':Sequelize[_0xfd9f('0x2')]},'timeout':{'type':Sequelize[_0xfd9f('0x6')]}};
\ No newline at end of file
+var _0x9c8c=['exports','STRING','mouseOver','INTEGER','sequelize'];(function(_0x2dad33,_0x314bb4){var _0x2dc233=function(_0x36282c){while(--_0x36282c){_0x2dad33['push'](_0x2dad33['shift']());}};_0x2dc233(++_0x314bb4);}(_0x9c8c,0x1ee));var _0xc9c8=function(_0x2335ca,_0x1db94a){_0x2335ca=_0x2335ca-0x0;var _0x21631c=_0x9c8c[_0x2335ca];return _0x21631c;};'use strict';var Sequelize=require(_0xc9c8('0x0'));module[_0xc9c8('0x1')]={'name':{'type':Sequelize[_0xc9c8('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc9c8('0x3'),'timeout'),'defaultValue':_0xc9c8('0x3')},'selector':{'type':Sequelize[_0xc9c8('0x2')]},'timeout':{'type':Sequelize[_0xc9c8('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d7b4766..c3415ab 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 _0x7a2d=['destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','update','then'];(function(_0x4f4643,_0x1d2526){var _0x383711=function(_0x519da6){while(--_0x519da6){_0x4f4643['push'](_0x4f4643['shift']());}};_0x383711(++_0x1d2526);}(_0x7a2d,0x142));var _0xd7a2=function(_0x77f1ba,_0x55d5d7){_0x77f1ba=_0x77f1ba-0x0;var _0x2fe1dd=_0x7a2d[_0x77f1ba];return _0x2fe1dd;};'use strict';var emlformat=require(_0xd7a2('0x0'));var rimraf=require(_0xd7a2('0x1'));var zipdir=require(_0xd7a2('0x2'));var jsonpatch=require(_0xd7a2('0x3'));var rp=require(_0xd7a2('0x4'));var moment=require(_0xd7a2('0x5'));var BPromise=require(_0xd7a2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd7a2('0x7'));var sox=require(_0xd7a2('0x8'));var csv=require(_0xd7a2('0x9'));var ejs=require(_0xd7a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7a2('0xb'));var squel=require(_0xd7a2('0xc'));var crypto=require(_0xd7a2('0xd'));var jsforce=require(_0xd7a2('0xe'));var deskjs=require(_0xd7a2('0xf'));var toCsv=require(_0xd7a2('0x9'));var querystring=require(_0xd7a2('0x10'));var Papa=require(_0xd7a2('0x11'));var Redis=require(_0xd7a2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd7a2('0x13'));var as=require(_0xd7a2('0x14'));var hardwareService=require(_0xd7a2('0x15'));var logger=require(_0xd7a2('0x16'))(_0xd7a2('0x17'));var utils=require(_0xd7a2('0x18'));var config=require(_0xd7a2('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x72ff99,_0x4d8a97){_0x4d8a97=_0x4d8a97||0xcc;return function(_0x58cde8){if(_0x58cde8){return _0x72ff99[_0xd7a2('0x1a')](_0x4d8a97);}return _0x72ff99[_0xd7a2('0x1b')](_0x4d8a97)[_0xd7a2('0x1c')]();};}function respondWithResult(_0x3724c5,_0x37f995){_0x37f995=_0x37f995||0xc8;return function(_0x42a6c5){if(_0x42a6c5){return _0x3724c5[_0xd7a2('0x1b')](_0x37f995)[_0xd7a2('0x1d')](_0x42a6c5);}};}function respondWithFilteredResult(_0x16e2d6,_0x292f64){return function(_0x47b226){if(_0x47b226){var _0x2dc1b7=typeof _0x292f64['offset']==='undefined'&&typeof _0x292f64[_0xd7a2('0x1e')]===_0xd7a2('0x1f');var _0x2e8c80=_0x47b226[_0xd7a2('0x20')];var _0x296784=_0x2dc1b7?0x0:_0x292f64[_0xd7a2('0x21')];var _0x510caa=_0x2dc1b7?_0x47b226['count']:_0x292f64[_0xd7a2('0x21')]+_0x292f64[_0xd7a2('0x1e')];var _0x2653b1;if(_0x510caa>=_0x2e8c80){_0x510caa=_0x2e8c80;_0x2653b1=0xc8;}else{_0x2653b1=0xce;}_0x16e2d6['status'](_0x2653b1);return _0x16e2d6['set'](_0xd7a2('0x22'),_0x296784+'-'+_0x510caa+'/'+_0x2e8c80)['json'](_0x47b226);}return null;};}function patchUpdates(_0x4f885a){return function(_0x217c19){try{jsonpatch['apply'](_0x217c19,_0x4f885a,!![]);}catch(_0x5b50d9){return BPromise[_0xd7a2('0x23')](_0x5b50d9);}return _0x217c19['save']();};}function saveUpdates(_0x5bd05f,_0x4fc69c){return function(_0x21da02){if(_0x21da02){return _0x21da02[_0xd7a2('0x24')](_0x5bd05f)[_0xd7a2('0x25')](function(_0x21be90){return _0x21be90;});}return null;};}function removeEntity(_0x2b17ca,_0x3a2be7){return function(_0x2bfde1){if(_0x2bfde1){return _0x2bfde1[_0xd7a2('0x26')]()[_0xd7a2('0x25')](function(){_0x2b17ca[_0xd7a2('0x1b')](0xcc)[_0xd7a2('0x1c')]();});}};}function handleEntityNotFound(_0x2601b3,_0x1c3580){return function(_0x5caa05){if(!_0x5caa05){_0x2601b3['sendStatus'](0x194);}return _0x5caa05;};}function handleError(_0x11a498,_0x52b1b4){_0x52b1b4=_0x52b1b4||0x1f4;return function(_0x41e24b){logger['error'](_0x41e24b[_0xd7a2('0x27')]);if(_0x41e24b[_0xd7a2('0x28')]){delete _0x41e24b[_0xd7a2('0x28')];}_0x11a498[_0xd7a2('0x1b')](_0x52b1b4)[_0xd7a2('0x29')](_0x41e24b);};}exports[_0xd7a2('0x2a')]=function(_0x1a69e4,_0x303dc5){var _0x43b81c={'raw':!![],'where':{'id':_0x1a69e4[_0xd7a2('0x2b')]['id']}},_0x410cce={};_0x410cce[_0xd7a2('0x2c')]=_[_0xd7a2('0x2d')](db[_0xd7a2('0x2e')][_0xd7a2('0x2f')]);_0x410cce['query']=_[_0xd7a2('0x2d')](_0x1a69e4[_0xd7a2('0x30')]);_0x410cce['filters']=_[_0xd7a2('0x31')](_0x410cce[_0xd7a2('0x2c')],_0x410cce['query']);_0x43b81c[_0xd7a2('0x32')]=_[_0xd7a2('0x31')](_0x410cce[_0xd7a2('0x2c')],qs['fields'](_0x1a69e4[_0xd7a2('0x30')][_0xd7a2('0x33')]));_0x43b81c[_0xd7a2('0x32')]=_0x43b81c['attributes'][_0xd7a2('0x34')]?_0x43b81c['attributes']:_0x410cce[_0xd7a2('0x2c')];if(_0x1a69e4[_0xd7a2('0x30')][_0xd7a2('0x35')]){_0x43b81c[_0xd7a2('0x36')]=[{'all':!![]}];}_0x43b81c=_['merge']({},_0x43b81c,_0x1a69e4[_0xd7a2('0x37')]);return db[_0xd7a2('0x2e')][_0xd7a2('0x38')](_0x43b81c)[_0xd7a2('0x25')](handleEntityNotFound(_0x303dc5,null))['then'](respondWithResult(_0x303dc5,null))[_0xd7a2('0x39')](handleError(_0x303dc5,null));};exports[_0xd7a2('0x3a')]=function(_0x2bd3a6,_0x446153){return db[_0xd7a2('0x2e')][_0xd7a2('0x3a')](_0x2bd3a6[_0xd7a2('0x3b')],{})[_0xd7a2('0x25')](respondWithResult(_0x446153,0xc9))[_0xd7a2('0x39')](handleError(_0x446153,null));};exports['update']=function(_0x356375,_0x475fae){if(_0x356375[_0xd7a2('0x3b')]['id']){delete _0x356375[_0xd7a2('0x3b')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x356375[_0xd7a2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x475fae,null))[_0xd7a2('0x25')](saveUpdates(_0x356375[_0xd7a2('0x3b')],null))['then'](respondWithResult(_0x475fae,null))[_0xd7a2('0x39')](handleError(_0x475fae,null));};exports[_0xd7a2('0x26')]=function(_0x189e21,_0x392ffe){return db[_0xd7a2('0x2e')][_0xd7a2('0x38')]({'where':{'id':_0x189e21[_0xd7a2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x392ffe,null))['then'](removeEntity(_0x392ffe,null))[_0xd7a2('0x39')](handleError(_0x392ffe,null));};
\ No newline at end of file
+var _0xb2b5=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','destroy','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4252fb,_0x2875b6){var _0x40b2ae=function(_0xf9ca79){while(--_0xf9ca79){_0x4252fb['push'](_0x4252fb['shift']());}};_0x40b2ae(++_0x2875b6);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb2b5[_0x160c73];return _0xd9302;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5b2b('0x0'));var moment=require(_0x5b2b('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5b2b('0x2'));var path=require(_0x5b2b('0x3'));var sox=require(_0x5b2b('0x4'));var csv=require(_0x5b2b('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b2b('0x6'));var _=require(_0x5b2b('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b2b('0x8'));var deskjs=require(_0x5b2b('0x9'));var toCsv=require(_0x5b2b('0x5'));var querystring=require(_0x5b2b('0xa'));var Papa=require(_0x5b2b('0xb'));var Redis=require(_0x5b2b('0xc'));var authService=require(_0x5b2b('0xd'));var qs=require(_0x5b2b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b2b('0xf'));var logger=require(_0x5b2b('0x10'))('api');var utils=require(_0x5b2b('0x11'));var config=require(_0x5b2b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b2b('0x13'))['db'];function respondWithStatusCode(_0x1a339a,_0xfe1936){_0xfe1936=_0xfe1936||0xcc;return function(_0x12f1f8){if(_0x12f1f8){return _0x1a339a[_0x5b2b('0x14')](_0xfe1936);}return _0x1a339a[_0x5b2b('0x15')](_0xfe1936)[_0x5b2b('0x16')]();};}function respondWithResult(_0x4bfe97,_0x30e9a3){_0x30e9a3=_0x30e9a3||0xc8;return function(_0x4fa243){if(_0x4fa243){return _0x4bfe97[_0x5b2b('0x15')](_0x30e9a3)[_0x5b2b('0x17')](_0x4fa243);}};}function respondWithFilteredResult(_0x3f5236,_0x2611a3){return function(_0x4ff4ba){if(_0x4ff4ba){var _0x310060=typeof _0x2611a3['offset']===_0x5b2b('0x18')&&typeof _0x2611a3['limit']==='undefined';var _0x44be6d=_0x4ff4ba[_0x5b2b('0x19')];var _0x5b6645=_0x310060?0x0:_0x2611a3[_0x5b2b('0x1a')];var _0x2db9ee=_0x310060?_0x4ff4ba[_0x5b2b('0x19')]:_0x2611a3[_0x5b2b('0x1a')]+_0x2611a3[_0x5b2b('0x1b')];var _0x47bb1b;if(_0x2db9ee>=_0x44be6d){_0x2db9ee=_0x44be6d;_0x47bb1b=0xc8;}else{_0x47bb1b=0xce;}_0x3f5236[_0x5b2b('0x15')](_0x47bb1b);return _0x3f5236[_0x5b2b('0x1c')](_0x5b2b('0x1d'),_0x5b6645+'-'+_0x2db9ee+'/'+_0x44be6d)[_0x5b2b('0x17')](_0x4ff4ba);}return null;};}function patchUpdates(_0x1b994d){return function(_0x42f0ed){try{jsonpatch[_0x5b2b('0x1e')](_0x42f0ed,_0x1b994d,!![]);}catch(_0x208c1f){return BPromise[_0x5b2b('0x1f')](_0x208c1f);}return _0x42f0ed[_0x5b2b('0x20')]();};}function saveUpdates(_0x34c624,_0xa8ebd5){return function(_0x2de273){if(_0x2de273){return _0x2de273[_0x5b2b('0x21')](_0x34c624)['then'](function(_0x5e0add){return _0x5e0add;});}return null;};}function removeEntity(_0xfdaeed,_0x58e346){return function(_0x3a530f){if(_0x3a530f){return _0x3a530f['destroy']()[_0x5b2b('0x22')](function(){_0xfdaeed[_0x5b2b('0x15')](0xcc)[_0x5b2b('0x16')]();});}};}function handleEntityNotFound(_0x37cbd8,_0x33a88c){return function(_0x564c21){if(!_0x564c21){_0x37cbd8[_0x5b2b('0x14')](0x194);}return _0x564c21;};}function handleError(_0x3e97dc,_0x55b05c){_0x55b05c=_0x55b05c||0x1f4;return function(_0x3fd917){logger[_0x5b2b('0x23')](_0x3fd917['stack']);if(_0x3fd917[_0x5b2b('0x24')]){delete _0x3fd917[_0x5b2b('0x24')];}_0x3e97dc[_0x5b2b('0x15')](_0x55b05c)[_0x5b2b('0x25')](_0x3fd917);};}exports[_0x5b2b('0x26')]=function(_0x94d866,_0x57284a){var _0x2c80be={'raw':!![],'where':{'id':_0x94d866[_0x5b2b('0x27')]['id']}},_0x42b46c={};_0x42b46c[_0x5b2b('0x28')]=_[_0x5b2b('0x29')](db['ChatProactiveAction'][_0x5b2b('0x2a')]);_0x42b46c[_0x5b2b('0x2b')]=_[_0x5b2b('0x29')](_0x94d866[_0x5b2b('0x2b')]);_0x42b46c[_0x5b2b('0x2c')]=_[_0x5b2b('0x2d')](_0x42b46c['model'],_0x42b46c[_0x5b2b('0x2b')]);_0x2c80be[_0x5b2b('0x2e')]=_[_0x5b2b('0x2d')](_0x42b46c[_0x5b2b('0x28')],qs[_0x5b2b('0x2f')](_0x94d866[_0x5b2b('0x2b')][_0x5b2b('0x2f')]));_0x2c80be[_0x5b2b('0x2e')]=_0x2c80be[_0x5b2b('0x2e')][_0x5b2b('0x30')]?_0x2c80be['attributes']:_0x42b46c[_0x5b2b('0x28')];if(_0x94d866[_0x5b2b('0x2b')][_0x5b2b('0x31')]){_0x2c80be[_0x5b2b('0x32')]=[{'all':!![]}];}_0x2c80be=_[_0x5b2b('0x33')]({},_0x2c80be,_0x94d866[_0x5b2b('0x34')]);return db[_0x5b2b('0x35')][_0x5b2b('0x36')](_0x2c80be)[_0x5b2b('0x22')](handleEntityNotFound(_0x57284a,null))['then'](respondWithResult(_0x57284a,null))[_0x5b2b('0x37')](handleError(_0x57284a,null));};exports[_0x5b2b('0x38')]=function(_0x1f6b2f,_0xf0bed){return db['ChatProactiveAction']['create'](_0x1f6b2f[_0x5b2b('0x39')],{})['then'](respondWithResult(_0xf0bed,0xc9))[_0x5b2b('0x37')](handleError(_0xf0bed,null));};exports[_0x5b2b('0x21')]=function(_0x176eb4,_0x461515){if(_0x176eb4['body']['id']){delete _0x176eb4[_0x5b2b('0x39')]['id'];}return db[_0x5b2b('0x35')][_0x5b2b('0x36')]({'where':{'id':_0x176eb4[_0x5b2b('0x27')]['id']}})[_0x5b2b('0x22')](handleEntityNotFound(_0x461515,null))[_0x5b2b('0x22')](saveUpdates(_0x176eb4[_0x5b2b('0x39')],null))['then'](respondWithResult(_0x461515,null))['catch'](handleError(_0x461515,null));};exports[_0x5b2b('0x3a')]=function(_0xb4ad96,_0x4a97e0){return db[_0x5b2b('0x35')][_0x5b2b('0x36')]({'where':{'id':_0xb4ad96['params']['id']}})['then'](handleEntityNotFound(_0x4a97e0,null))['then'](removeEntity(_0x4a97e0,null))[_0x5b2b('0x37')](handleError(_0x4a97e0,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index dd39c3f..58ac940 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 _0xc89d=['path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','moment'];(function(_0x29a4d5,_0x51eb8a){var _0xa9e951=function(_0x148e22){while(--_0x148e22){_0x29a4d5['push'](_0x29a4d5['shift']());}};_0xa9e951(++_0x51eb8a);}(_0xc89d,0x128));var _0xdc89=function(_0xf50207,_0x22ce0a){_0xf50207=_0xf50207-0x0;var _0x28e44a=_0xc89d[_0xf50207];return _0x28e44a;};'use strict';var _=require(_0xdc89('0x0'));var util=require(_0xdc89('0x1'));var logger=require(_0xdc89('0x2'))('api');var moment=require(_0xdc89('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc89('0x4'));var rimraf=require('rimraf');var config=require(_0xdc89('0x5'));var attributes=require(_0xdc89('0x6'));module[_0xdc89('0x7')]=function(_0x359333,_0x192304){return _0x359333[_0xdc89('0x8')](_0xdc89('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6fab=['chat_proactive_actions','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x126ad0,_0x4274d6){var _0x31cde4=function(_0x3be80c){while(--_0x3be80c){_0x126ad0['push'](_0x126ad0['shift']());}};_0x31cde4(++_0x4274d6);}(_0x6fab,0x1ae));var _0xb6fa=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0x6fab[_0x242a4f];return _0x122117;};'use strict';var _=require(_0xb6fa('0x0'));var util=require('util');var logger=require(_0xb6fa('0x1'))('api');var moment=require(_0xb6fa('0x2'));var BPromise=require(_0xb6fa('0x3'));var rp=require(_0xb6fa('0x4'));var fs=require('fs');var path=require(_0xb6fa('0x5'));var rimraf=require('rimraf');var config=require(_0xb6fa('0x6'));var attributes=require(_0xb6fa('0x7'));module[_0xb6fa('0x8')]=function(_0x127bd8,_0xdd627f){return _0x127bd8[_0xb6fa('0x9')]('ChatProactiveAction',attributes,{'tableName':_0xb6fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 1da71fb..265a883 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 _0x08fa=['http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','randomstring','../../config/logger','../../config/environment','client'];(function(_0x5d8987,_0x14d054){var _0x2997eb=function(_0x56f92a){while(--_0x56f92a){_0x5d8987['push'](_0x5d8987['shift']());}};_0x2997eb(++_0x14d054);}(_0x08fa,0x12d));var _0xa08f=function(_0x1a6561,_0x18c449){_0x1a6561=_0x1a6561-0x0;var _0x531a9c=_0x08fa[_0x1a6561];return _0x531a9c;};'use strict';var _=require(_0xa08f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa08f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa08f('0x2'))('rpc');var config=require(_0xa08f('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xa08f('0x4')][_0xa08f('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2d3ca0,_0x5969fb,_0x1c5e1b){return new BPromise(function(_0x1f3223,_0x59c5a5){return client['request'](_0x2d3ca0,_0x1c5e1b)[_0xa08f('0x6')](function(_0x22f829){logger['info'](_0xa08f('0x7'),_0x5969fb,_0xa08f('0x8'));logger[_0xa08f('0x9')](_0xa08f('0xa'),_0x5969fb,_0xa08f('0x8'),JSON[_0xa08f('0xb')](_0x22f829));if(_0x22f829[_0xa08f('0xc')]){if(_0x22f829[_0xa08f('0xc')][_0xa08f('0xd')]===0x1f4){logger[_0xa08f('0xc')](_0xa08f('0x7'),_0x5969fb,_0x22f829[_0xa08f('0xc')][_0xa08f('0xe')]);return _0x59c5a5(_0x22f829[_0xa08f('0xc')][_0xa08f('0xe')]);}logger['error'](_0xa08f('0x7'),_0x5969fb,_0x22f829[_0xa08f('0xc')][_0xa08f('0xe')]);return _0x1f3223(_0x22f829[_0xa08f('0xc')][_0xa08f('0xe')]);}else{logger[_0xa08f('0xf')](_0xa08f('0x7'),_0x5969fb,_0xa08f('0x8'));_0x1f3223(_0x22f829[_0xa08f('0x10')][_0xa08f('0xe')]);}})[_0xa08f('0x11')](function(_0x4efb26){logger[_0xa08f('0xc')](_0xa08f('0x7'),_0x5969fb,_0x4efb26);_0x59c5a5(_0x4efb26);});});}
\ No newline at end of file
+var _0x82c4=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x15e73b,_0x191a5d){var _0x433c2a=function(_0x1ea70c){while(--_0x1ea70c){_0x15e73b['push'](_0x15e73b['shift']());}};_0x433c2a(++_0x191a5d);}(_0x82c4,0x19f));var _0x482c=function(_0x52282a,_0x45aef7){_0x52282a=_0x52282a-0x0;var _0x3c66b4=_0x82c4[_0x52282a];return _0x3c66b4;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x482c('0x4'));var db=require(_0x482c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x6'))(_0x482c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x482c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33302c,_0x3b7a24,_0x75e0ec){return new BPromise(function(_0x4ef26f,_0xe5dc74){return client[_0x482c('0x9')](_0x33302c,_0x75e0ec)[_0x482c('0xa')](function(_0x2a8b34){logger[_0x482c('0xb')](_0x482c('0xc'),_0x3b7a24,'request\x20sent');logger[_0x482c('0xd')](_0x482c('0xe'),_0x3b7a24,_0x482c('0xf'),JSON[_0x482c('0x10')](_0x2a8b34));if(_0x2a8b34[_0x482c('0x11')]){if(_0x2a8b34[_0x482c('0x11')][_0x482c('0x12')]===0x1f4){logger[_0x482c('0x11')](_0x482c('0xc'),_0x3b7a24,_0x2a8b34[_0x482c('0x11')][_0x482c('0x13')]);return _0xe5dc74(_0x2a8b34[_0x482c('0x11')][_0x482c('0x13')]);}logger[_0x482c('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b7a24,_0x2a8b34[_0x482c('0x11')][_0x482c('0x13')]);return _0x4ef26f(_0x2a8b34[_0x482c('0x11')][_0x482c('0x13')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x3b7a24,_0x482c('0xf'));_0x4ef26f(_0x2a8b34[_0x482c('0x14')]['message']);}})[_0x482c('0x15')](function(_0x2de2b6){logger[_0x482c('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b7a24,_0x2de2b6);_0xe5dc74(_0x2de2b6);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 22ae501..caa762d 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 _0x3f8a=['/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x4a4d27,_0x2e0670){var _0x34d00b=function(_0x47c9bd){while(--_0x47c9bd){_0x4a4d27['push'](_0x4a4d27['shift']());}};_0x34d00b(++_0x2e0670);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2e5f15,_0x5c62c0){_0x2e5f15=_0x2e5f15-0x0;var _0x4624b4=_0x3f8a[_0x2e5f15];return _0x4624b4;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x11')]);router['delete'](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('0x13')]=router;
\ No newline at end of file
+var _0x5d58=['/:id','isAuthenticated','show','create','update','delete','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0xa2ac9,_0xf07f28){var _0x690e9b=function(_0x5b2582){while(--_0x5b2582){_0xa2ac9['push'](_0xa2ac9['shift']());}};_0x690e9b(++_0xf07f28);}(_0x5d58,0x187));var _0x85d5=function(_0x2f949d,_0x310eba){_0x2f949d=_0x2f949d-0x0;var _0x217158=_0x5d58[_0x2f949d];return _0x217158;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./chatProactiveAction.controller');router[_0x85d5('0x4')](_0x85d5('0x5'),auth[_0x85d5('0x6')](),controller[_0x85d5('0x7')]);router['post']('/',auth[_0x85d5('0x6')](),controller[_0x85d5('0x8')]);router['put'](_0x85d5('0x5'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x5'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 5331c30..208bf0c 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 _0xff8e=['beepall','sequelize','exports'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xff8e,0x7c));var _0xeff8=function(_0x474495,_0x50c083){_0x474495=_0x474495-0x0;var _0x2f3abf=_0xff8e[_0x474495];return _0x2f3abf;};'use strict';var Sequelize=require(_0xeff8('0x0'));module[_0xeff8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xeff8('0x2'),'roundrobin')}};
\ No newline at end of file
+var _0x628b=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x628b,0x15c));var _0xb628=function(_0x4a4644,_0x45526c){_0x4a4644=_0x4a4644-0x0;var _0x14c6f2=_0x628b[_0x4a4644];return _0x14c6f2;};'use strict';var Sequelize=require(_0xb628('0x0'));module[_0xb628('0x1')]={'name':{'type':Sequelize[_0xb628('0x2')],'unique':_0xb628('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb628('0x2')]},'timeout':{'type':Sequelize[_0xb628('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb628('0x5')](_0xb628('0x6'),_0xb628('0x7'),_0xb628('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 1180b81..c7ac943 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 _0x7870=['status','end','json','offset','undefined','limit','apply','reject','save','update','get','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','include','findAll','show','params','length','create','body','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','QueryTypes','TeamId','includes','all','union','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x222f42,_0x54f2f5){var _0x28251a=function(_0x263c95){while(--_0x263c95){_0x222f42['push'](_0x222f42['shift']());}};_0x28251a(++_0x54f2f5);}(_0x7870,0x195));var _0x0787=function(_0x223d6d,_0x14e9e3){_0x223d6d=_0x223d6d-0x0;var _0x349dd0=_0x7870[_0x223d6d];return _0x349dd0;};'use strict';var emlformat=require(_0x0787('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0787('0x1'));var rp=require(_0x0787('0x2'));var moment=require(_0x0787('0x3'));var BPromise=require(_0x0787('0x4'));var Mustache=require(_0x0787('0x5'));var util=require('util');var path=require(_0x0787('0x6'));var sox=require(_0x0787('0x7'));var csv=require(_0x0787('0x8'));var ejs=require(_0x0787('0x9'));var fs=require('fs');var fs_extra=require(_0x0787('0xa'));var _=require('lodash');var squel=require(_0x0787('0xb'));var crypto=require(_0x0787('0xc'));var jsforce=require(_0x0787('0xd'));var deskjs=require(_0x0787('0xe'));var toCsv=require(_0x0787('0x8'));var querystring=require(_0x0787('0xf'));var Papa=require(_0x0787('0x10'));var Redis=require(_0x0787('0x11'));var authService=require(_0x0787('0x12'));var qs=require(_0x0787('0x13'));var as=require(_0x0787('0x14'));var hardwareService=require(_0x0787('0x15'));var logger=require(_0x0787('0x16'))(_0x0787('0x17'));var utils=require(_0x0787('0x18'));var config=require(_0x0787('0x19'));var licenseUtil=require(_0x0787('0x1a'));var db=require(_0x0787('0x1b'))['db'];config[_0x0787('0x1c')]=_[_0x0787('0x1d')](config['redis'],{'host':_0x0787('0x1e'),'port':0x18eb});var socket=require(_0x0787('0x1f'))(new Redis(config[_0x0787('0x1c')]));require('./chatQueue.socket')[_0x0787('0x20')](socket);var jayson=require(_0x0787('0x21'));var client=jayson[_0x0787('0x22')][_0x0787('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x2d0a62,_0x314f9c,_0x2fcbdc,_0xdfc711){return new BPromise(function(_0x3e1176,_0x3532e4){var _0x299404=_0xdfc711||client;return _0x299404[_0x0787('0x24')](_0x2d0a62,_0x2fcbdc)[_0x0787('0x25')](function(_0x1f872a){logger[_0x0787('0x26')](_0x0787('0x27'),_0x314f9c,_0x0787('0x28'));logger['debug'](_0x0787('0x29'),_0x314f9c,'request\x20sent',JSON[_0x0787('0x2a')](_0x1f872a));if(_0x1f872a[_0x0787('0x2b')]){if(_0x1f872a[_0x0787('0x2b')][_0x0787('0x2c')]===0x1f4){logger['error'](_0x0787('0x27'),_0x314f9c,_0x1f872a[_0x0787('0x2b')]['message']);return _0x3532e4(_0x1f872a[_0x0787('0x2b')][_0x0787('0x2d')]);}logger[_0x0787('0x2b')](_0x0787('0x27'),_0x314f9c,_0x1f872a[_0x0787('0x2b')][_0x0787('0x2d')]);return _0x3e1176(_0x1f872a['error'][_0x0787('0x2d')]);}else{logger[_0x0787('0x26')](_0x0787('0x27'),_0x314f9c,_0x0787('0x28'));_0x3e1176(_0x1f872a[_0x0787('0x2e')][_0x0787('0x2d')]);}})[_0x0787('0x2f')](function(_0x58d4a0){logger[_0x0787('0x2b')](_0x0787('0x27'),_0x314f9c,_0x58d4a0);_0x3532e4(_0x58d4a0);});});}function respondWithStatusCode(_0x26cb57,_0x27d6ed){_0x27d6ed=_0x27d6ed||0xcc;return function(_0x5d5f0b){if(_0x5d5f0b){return _0x26cb57['sendStatus'](_0x27d6ed);}return _0x26cb57[_0x0787('0x30')](_0x27d6ed)[_0x0787('0x31')]();};}function respondWithResult(_0x222d64,_0x5a9d90){_0x5a9d90=_0x5a9d90||0xc8;return function(_0x3fe5f1){if(_0x3fe5f1){return _0x222d64[_0x0787('0x30')](_0x5a9d90)[_0x0787('0x32')](_0x3fe5f1);}};}function respondWithFilteredResult(_0x43297f,_0x16c162){return function(_0x548894){if(_0x548894){var _0x2ff4e4=typeof _0x16c162[_0x0787('0x33')]===_0x0787('0x34')&&typeof _0x16c162['limit']===_0x0787('0x34');var _0x595ddc=_0x548894['count'];var _0x5a01a3=_0x2ff4e4?0x0:_0x16c162[_0x0787('0x33')];var _0x25c937=_0x2ff4e4?_0x548894['count']:_0x16c162['offset']+_0x16c162[_0x0787('0x35')];var _0x421357;if(_0x25c937>=_0x595ddc){_0x25c937=_0x595ddc;_0x421357=0xc8;}else{_0x421357=0xce;}_0x43297f['status'](_0x421357);return _0x43297f['set']('Content-Range',_0x5a01a3+'-'+_0x25c937+'/'+_0x595ddc)[_0x0787('0x32')](_0x548894);}return null;};}function patchUpdates(_0x721c55){return function(_0x468585){try{jsonpatch[_0x0787('0x36')](_0x468585,_0x721c55,!![]);}catch(_0x5df64a){return BPromise[_0x0787('0x37')](_0x5df64a);}return _0x468585[_0x0787('0x38')]();};}function saveUpdates(_0x4112a5,_0x2e9f10){return function(_0xbbac62){if(_0xbbac62){return _0xbbac62[_0x0787('0x39')](_0x4112a5)[_0x0787('0x25')](function(_0x1277b9){return _0x1277b9;});}return null;};}function removeEntity(_0x18dcfc,_0xf5cf3){return function(_0x1e31a2){if(_0x1e31a2){return _0x1e31a2['destroy']()[_0x0787('0x25')](function(){var _0x205e8b=_0x1e31a2[_0x0787('0x3a')]({'plain':!![]});var _0xffe216='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xffe216,'resourceId':_0x205e8b['id']}})[_0x0787('0x25')](function(){return _0x1e31a2;});})[_0x0787('0x25')](function(){_0x18dcfc[_0x0787('0x30')](0xcc)[_0x0787('0x31')]();});}};}function handleEntityNotFound(_0x380147,_0xd0675a){return function(_0x40ce8c){if(!_0x40ce8c){_0x380147['sendStatus'](0x194);}return _0x40ce8c;};}function handleError(_0x48b9c1,_0x2b4c9e){_0x2b4c9e=_0x2b4c9e||0x1f4;return function(_0x3e7c68){logger[_0x0787('0x2b')](_0x3e7c68[_0x0787('0x3b')]);if(_0x3e7c68[_0x0787('0x3c')]){delete _0x3e7c68[_0x0787('0x3c')];}_0x48b9c1[_0x0787('0x30')](_0x2b4c9e)[_0x0787('0x3d')](_0x3e7c68);};}exports[_0x0787('0x3e')]=function(_0x3cd39f,_0x276b27){var _0x2fc8d0={},_0x391b99={},_0x5a8feb={'count':0x0,'rows':[]};var _0x6da400=_[_0x0787('0x3f')](db[_0x0787('0x40')][_0x0787('0x41')],function(_0x1239f5){return{'name':_0x1239f5[_0x0787('0x42')],'type':_0x1239f5[_0x0787('0x43')][_0x0787('0x44')]};});_0x391b99[_0x0787('0x45')]=_[_0x0787('0x3f')](_0x6da400,_0x0787('0x3c'));_0x391b99['query']=_[_0x0787('0x46')](_0x3cd39f['query']);_0x391b99[_0x0787('0x47')]=_[_0x0787('0x48')](_0x391b99[_0x0787('0x45')],_0x391b99[_0x0787('0x49')]);_0x2fc8d0[_0x0787('0x4a')]=_[_0x0787('0x48')](_0x391b99[_0x0787('0x45')],qs[_0x0787('0x4b')](_0x3cd39f[_0x0787('0x49')][_0x0787('0x4b')]));_0x2fc8d0['attributes']=_0x2fc8d0[_0x0787('0x4a')]['length']?_0x2fc8d0[_0x0787('0x4a')]:_0x391b99[_0x0787('0x45')];if(!_0x3cd39f[_0x0787('0x49')][_0x0787('0x4c')](_0x0787('0x4d'))){_0x2fc8d0[_0x0787('0x35')]=qs[_0x0787('0x35')](_0x3cd39f[_0x0787('0x49')][_0x0787('0x35')]);_0x2fc8d0[_0x0787('0x33')]=qs['offset'](_0x3cd39f['query']['offset']);}_0x2fc8d0[_0x0787('0x4e')]=qs[_0x0787('0x4f')](_0x3cd39f['query'][_0x0787('0x4f')]);_0x2fc8d0[_0x0787('0x50')]=qs['filters'](_[_0x0787('0x51')](_0x3cd39f[_0x0787('0x49')],_0x391b99['filters']),_0x6da400);if(_0x3cd39f['query']['filter']){_0x2fc8d0[_0x0787('0x50')]=_[_0x0787('0x52')](_0x2fc8d0[_0x0787('0x50')],{'$or':_[_0x0787('0x3f')](_0x6da400,function(_0x4c74a8){if(_0x4c74a8[_0x0787('0x43')]!==_0x0787('0x53')){var _0x39b00b={};_0x39b00b[_0x4c74a8[_0x0787('0x3c')]]={'$like':'%'+_0x3cd39f[_0x0787('0x49')][_0x0787('0x54')]+'%'};return _0x39b00b;}})});}_0x2fc8d0=_[_0x0787('0x52')]({},_0x2fc8d0,_0x3cd39f[_0x0787('0x55')]);var _0x58de81={'where':_0x2fc8d0['where']};return db[_0x0787('0x40')][_0x0787('0x56')](_0x58de81)[_0x0787('0x25')](function(_0x5a5ed8){_0x5a8feb['count']=_0x5a5ed8;if(_0x3cd39f[_0x0787('0x49')]['includeAll']){_0x2fc8d0[_0x0787('0x57')]=[{'all':!![]}];}return db[_0x0787('0x40')][_0x0787('0x58')](_0x2fc8d0);})['then'](function(_0x3970d2){_0x5a8feb['rows']=_0x3970d2;return _0x5a8feb;})[_0x0787('0x25')](respondWithFilteredResult(_0x276b27,_0x2fc8d0))[_0x0787('0x2f')](handleError(_0x276b27,null));};exports[_0x0787('0x59')]=function(_0x4f67f9,_0x53f1df){var _0x2be5a3={'raw':!![],'where':{'id':_0x4f67f9[_0x0787('0x5a')]['id']}},_0x2f0722={};_0x2f0722[_0x0787('0x45')]=_[_0x0787('0x46')](db[_0x0787('0x40')][_0x0787('0x41')]);_0x2f0722[_0x0787('0x49')]=_[_0x0787('0x46')](_0x4f67f9[_0x0787('0x49')]);_0x2f0722[_0x0787('0x47')]=_[_0x0787('0x48')](_0x2f0722['model'],_0x2f0722[_0x0787('0x49')]);_0x2be5a3[_0x0787('0x4a')]=_[_0x0787('0x48')](_0x2f0722[_0x0787('0x45')],qs[_0x0787('0x4b')](_0x4f67f9[_0x0787('0x49')]['fields']));_0x2be5a3[_0x0787('0x4a')]=_0x2be5a3[_0x0787('0x4a')][_0x0787('0x5b')]?_0x2be5a3[_0x0787('0x4a')]:_0x2f0722[_0x0787('0x45')];if(_0x4f67f9[_0x0787('0x49')]['includeAll']){_0x2be5a3[_0x0787('0x57')]=[{'all':!![]}];}_0x2be5a3=_['merge']({},_0x2be5a3,_0x4f67f9[_0x0787('0x55')]);return db[_0x0787('0x40')]['find'](_0x2be5a3)[_0x0787('0x25')](handleEntityNotFound(_0x53f1df,null))[_0x0787('0x25')](respondWithResult(_0x53f1df,null))[_0x0787('0x2f')](handleError(_0x53f1df,null));};exports[_0x0787('0x5c')]=function(_0x229a23,_0x521619){return db[_0x0787('0x40')][_0x0787('0x5c')](_0x229a23[_0x0787('0x5d')],{})['then'](function(_0x519568){var _0x38838e=_0x229a23['user'][_0x0787('0x3a')]({'plain':!![]});if(!_0x38838e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38838e['role']==='user'){var _0x1a3b9b=_0x519568[_0x0787('0x3a')]({'plain':!![]});var _0x764a96=_0x0787('0x5e');return db[_0x0787('0x5f')]['find']({'where':{'name':_0x764a96,'userProfileId':_0x38838e[_0x0787('0x60')]},'raw':!![]})[_0x0787('0x25')](function(_0xc80f5b){if(_0xc80f5b&&_0xc80f5b[_0x0787('0x61')]===0x0){return db[_0x0787('0x62')]['create']({'name':_0x1a3b9b['name'],'resourceId':_0x1a3b9b['id'],'type':_0xc80f5b['name'],'sectionId':_0xc80f5b['id']},{})[_0x0787('0x25')](function(){return _0x519568;});}else{return _0x519568;}})[_0x0787('0x2f')](function(_0x41e8a3){logger[_0x0787('0x2b')](_0x0787('0x63'),_0x41e8a3);throw _0x41e8a3;});}return _0x519568;})[_0x0787('0x25')](respondWithResult(_0x521619,0xc9))[_0x0787('0x2f')](handleError(_0x521619,null));};exports['update']=function(_0x4181e9,_0x59a00b){if(_0x4181e9[_0x0787('0x5d')]['id']){delete _0x4181e9[_0x0787('0x5d')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x4181e9[_0x0787('0x5a')]['id']}})[_0x0787('0x25')](handleEntityNotFound(_0x59a00b,null))['then'](saveUpdates(_0x4181e9[_0x0787('0x5d')],null))[_0x0787('0x25')](respondWithResult(_0x59a00b,null))[_0x0787('0x2f')](handleError(_0x59a00b,null));};exports['destroy']=function(_0x5a77bb,_0x59b58f){return db['ChatQueue'][_0x0787('0x64')]({'where':{'id':_0x5a77bb['params']['id']}})[_0x0787('0x25')](handleEntityNotFound(_0x59b58f,null))[_0x0787('0x25')](removeEntity(_0x59b58f,null))[_0x0787('0x2f')](handleError(_0x59b58f,null));};exports['describe']=function(_0x36967e,_0x2d4a09){return db[_0x0787('0x40')][_0x0787('0x65')]()['then'](respondWithResult(_0x2d4a09,null))['catch'](handleError(_0x2d4a09,null));};exports['getMembers']=function(_0x296c18,_0x5e5e63,_0x414995){var _0x970265={'raw':!![],'where':{}},_0x3c5844={},_0x5cf35;return db[_0x0787('0x40')][_0x0787('0x66')]({'where':{'id':_0x296c18[_0x0787('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5e5e63,null))['then'](function(_0x44860a){if(_0x44860a){_0x5cf35=_0x44860a[_0x0787('0x3a')]({'plain':!![]});_0x3c5844['model']=_[_0x0787('0x46')](db[_0x0787('0x67')][_0x0787('0x41')]);_0x3c5844[_0x0787('0x49')]=_[_0x0787('0x46')](_0x296c18[_0x0787('0x49')]);_0x3c5844[_0x0787('0x47')]=_[_0x0787('0x48')](_0x3c5844['model'],_0x3c5844[_0x0787('0x49')]);_0x970265[_0x0787('0x4a')]=_['intersection'](_0x3c5844[_0x0787('0x45')],qs[_0x0787('0x4b')](_0x296c18[_0x0787('0x49')][_0x0787('0x4b')]));_0x970265[_0x0787('0x4a')]=_0x970265[_0x0787('0x4a')]['length']?_0x970265['attributes']:_0x3c5844[_0x0787('0x45')];if(!_0x296c18[_0x0787('0x49')][_0x0787('0x4c')](_0x0787('0x4d'))){_0x970265[_0x0787('0x35')]=qs[_0x0787('0x35')](_0x296c18[_0x0787('0x49')][_0x0787('0x35')]);_0x970265['offset']=qs[_0x0787('0x33')](_0x296c18[_0x0787('0x49')][_0x0787('0x33')]);}_0x970265[_0x0787('0x4e')]=qs[_0x0787('0x4f')](_0x296c18[_0x0787('0x49')][_0x0787('0x4f')]);_0x970265[_0x0787('0x50')]=qs[_0x0787('0x47')](_[_0x0787('0x51')](_0x296c18[_0x0787('0x49')],_0x3c5844[_0x0787('0x47')]));_0x970265[_0x0787('0x50')]['ChatQueueId']=_0x44860a['id'];if(_0x296c18[_0x0787('0x49')][_0x0787('0x54')]){_0x970265[_0x0787('0x50')]=_[_0x0787('0x52')](_0x970265[_0x0787('0x50')],{'$or':_[_0x0787('0x3f')](_0x970265[_0x0787('0x4a')],function(_0x1160bc){var _0x2fb6a6={};_0x2fb6a6[_0x1160bc]={'$like':'%'+_0x296c18[_0x0787('0x49')][_0x0787('0x54')]+'%'};return _0x2fb6a6;})});}_0x970265=_['merge']({},_0x970265,_0x296c18['options']);return db[_0x0787('0x67')]['findAll'](_0x970265);}})[_0x0787('0x25')](function(_0x310c1b){if(_0x310c1b){return db[_0x0787('0x68')][_0x0787('0x69')]({'where':{'id':_[_0x0787('0x3f')](_0x310c1b,_0x0787('0x6a')),'role':_0x0787('0x6b')},'attributes':['id','name',_0x0787('0x6c'),_0x0787('0x6d'),_0x0787('0x6e')]});}})[_0x0787('0x25')](function(_0x5e0f48){if(_0x5e0f48){return{'count':_0x5e0f48[_0x0787('0x56')],'rows':_[_0x0787('0x3f')](_0x5e0f48[_0x0787('0x6f')],function(_0x555e4b){return{'membername':_0x555e4b[_0x0787('0x3c')],'UserId':_0x555e4b['id'],'queue_name':_0x5cf35[_0x0787('0x3c')],'ChatQueueId':_0x5cf35['id'],'interface':util[_0x0787('0x70')](_0x0787('0x71'),'SIP',_0x555e4b[_0x0787('0x3c')]),'penalty':0x0,'paused':_0x555e4b['chatPause'],'createdAt':_0x555e4b[_0x0787('0x6e')],'updatedAt':_0x555e4b[_0x0787('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0787('0x25')](respondWithFilteredResult(_0x5e5e63,_0x970265))[_0x0787('0x2f')](handleError(_0x5e5e63,null));};exports[_0x0787('0x72')]=function(_0x37d4b7,_0x3d474f,_0x59d4ad){var _0x1e9f4f={};var _0x384840={};var _0x27275e;var _0x2a5775;return db['ChatQueue']['findOne']({'where':{'id':_0x37d4b7[_0x0787('0x5a')]['id']}})[_0x0787('0x25')](handleEntityNotFound(_0x3d474f,null))[_0x0787('0x25')](function(_0x33c12c){if(_0x33c12c){_0x27275e=_0x33c12c;_0x384840['model']=_[_0x0787('0x46')](db[_0x0787('0x73')][_0x0787('0x41')]);_0x384840['query']=_[_0x0787('0x46')](_0x37d4b7[_0x0787('0x49')]);_0x384840[_0x0787('0x47')]=_['intersection'](_0x384840[_0x0787('0x45')],_0x384840[_0x0787('0x49')]);_0x1e9f4f['attributes']=_[_0x0787('0x48')](_0x384840[_0x0787('0x45')],qs[_0x0787('0x4b')](_0x37d4b7[_0x0787('0x49')][_0x0787('0x4b')]));_0x1e9f4f[_0x0787('0x4a')]=_0x1e9f4f[_0x0787('0x4a')][_0x0787('0x5b')]?_0x1e9f4f[_0x0787('0x4a')]:_0x384840[_0x0787('0x45')];_0x1e9f4f[_0x0787('0x4e')]=qs[_0x0787('0x4f')](_0x37d4b7[_0x0787('0x49')][_0x0787('0x4f')]);_0x1e9f4f[_0x0787('0x50')]=qs['filters'](_[_0x0787('0x51')](_0x37d4b7[_0x0787('0x49')],_0x384840['filters']));if(_0x37d4b7['query'][_0x0787('0x54')]){_0x1e9f4f[_0x0787('0x50')]=_[_0x0787('0x52')](_0x1e9f4f[_0x0787('0x50')],{'$or':_['map'](_0x1e9f4f[_0x0787('0x4a')],function(_0x16b520){var _0x38374d={};_0x38374d[_0x16b520]={'$like':'%'+_0x37d4b7[_0x0787('0x49')][_0x0787('0x54')]+'%'};return _0x38374d;})});}_0x1e9f4f=_[_0x0787('0x52')]({},_0x1e9f4f,_0x37d4b7[_0x0787('0x55')]);return _0x27275e['getTeams'](_0x1e9f4f);}})[_0x0787('0x25')](function(_0x502e95){if(_0x502e95){_0x2a5775=_0x502e95[_0x0787('0x5b')];if(!_0x37d4b7[_0x0787('0x49')]['hasOwnProperty'](_0x0787('0x4d'))){_0x1e9f4f[_0x0787('0x35')]=qs[_0x0787('0x35')](_0x37d4b7[_0x0787('0x49')]['limit']);_0x1e9f4f['offset']=qs[_0x0787('0x33')](_0x37d4b7[_0x0787('0x49')][_0x0787('0x33')]);}return _0x27275e[_0x0787('0x72')](_0x1e9f4f);}})[_0x0787('0x25')](function(_0x4638a3){if(_0x4638a3){return _0x4638a3?{'count':_0x2a5775,'rows':_0x4638a3}:null;}})[_0x0787('0x25')](respondWithResult(_0x3d474f,null))[_0x0787('0x2f')](handleError(_0x3d474f,null));};exports[_0x0787('0x74')]=function(_0x309327,_0x54b68e,_0x2d4833){var _0x1e1663=_0x309327[_0x0787('0x5d')][_0x0787('0x75')];return db[_0x0787('0x73')][_0x0787('0x58')]({'where':{'id':_0x1e1663},'attributes':['id'],'include':[{'model':db[_0x0787('0x68')],'as':'Agents','attributes':['id',_0x0787('0x3c'),_0x0787('0x76'),_0x0787('0x77'),'interface'],'raw':!![]}]})[_0x0787('0x25')](function(_0x14692d){if(_0x14692d){var _0x5063d6=_[_0x0787('0x78')](_0x14692d,function(_0x3b4b3d){var _0x4dea2e=_0x3b4b3d[_0x0787('0x3a')]({'plain':!![]});return _0x4dea2e[_0x0787('0x79')];});return db[_0x0787('0x40')][_0x0787('0x64')]({'where':{'id':_0x309327['params']['id']}})[_0x0787('0x25')](function(_0x4702f5){return db[_0x0787('0x7a')][_0x0787('0x7b')](function(_0x4bb85d){return _0x4702f5[_0x0787('0x74')](_0x1e1663,{'transaction':_0x4bb85d})[_0x0787('0x25')](function(){return BPromise[_0x0787('0x7c')](_0x5063d6,function(_0x1f1aa1){return db[_0x0787('0x67')][_0x0787('0x7d')]({'where':{'UserId':_0x1f1aa1['id'],'ChatQueueId':_0x309327[_0x0787('0x5a')]['id']},'transaction':_0x4bb85d});});})[_0x0787('0x25')](function(){_0x5063d6[_0x0787('0x7e')](function(_0x90420e){socket[_0x0787('0x7f')](_0x0787('0x80'),{'UserId':_0x90420e['id'],'ChatQueueId':_0x4702f5['id']});});});});});}})['then'](respondWithStatusCode(_0x54b68e,null))[_0x0787('0x2f')](handleError(_0x54b68e,null));};exports[_0x0787('0x81')]=function(_0x5709f1,_0x2486f8,_0x13c1c9){return db[_0x0787('0x73')]['findAll']({'where':{'id':_0x5709f1[_0x0787('0x49')][_0x0787('0x75')]},'attributes':['id'],'include':[{'model':db[_0x0787('0x68')],'as':_0x0787('0x79'),'attributes':['id'],'raw':!![]}]})[_0x0787('0x25')](handleEntityNotFound(_0x2486f8,null))[_0x0787('0x25')](function(_0x107cab){var _0x49c3f1=_[_0x0787('0x3f')](_0x107cab,'id');var _0x2cb3a1=[];var _0x2034fd=[];var _0x551795=squel['select']();_0x551795[_0x0787('0x82')](_0x0787('0x83'))['from'](_0x0787('0x84'),'tq')[_0x0787('0x85')](_0x0787('0x86'),'ut',_0x0787('0x87'))[_0x0787('0x50')]('ChatQueueId\x20=\x20?',_0x5709f1[_0x0787('0x5a')]['id']);for(var _0x72bb5e=0x0;_0x72bb5e<_0x107cab[_0x0787('0x5b')];_0x72bb5e+=0x1){let _0x1510ee=_0x107cab[_0x72bb5e];for(var _0x1f9ba4=0x0;_0x1f9ba4<_0x1510ee[_0x0787('0x79')]['length'];_0x1f9ba4+=0x1){let _0x3d21ed=_0x1510ee['Agents'][_0x1f9ba4];var _0x573637=_0x551795[_0x0787('0x88')]();_0x573637['where']('ut.UserId\x20=\x20?',_0x3d21ed['id']);_0x2034fd[_0x0787('0x89')](db[_0x0787('0x7a')][_0x0787('0x49')](_0x573637['toString'](),{'type':db[_0x0787('0x7a')][_0x0787('0x8a')]['SELECT']})['then'](function(_0x487593){if(_0x487593[_0x0787('0x5b')]===0x1){return _0x3d21ed['id'];}else{var _0x4cbcb1=_['every'](_[_0x0787('0x3f')](_0x487593,_0x0787('0x8b')),function(_0xd4c7ec){return _[_0x0787('0x8c')](_0x49c3f1,_0xd4c7ec);});if(_0x4cbcb1){return _0x3d21ed['id'];}}}));}}return BPromise[_0x0787('0x8d')](_0x2034fd)[_0x0787('0x25')](function(_0x56d316){_0x2cb3a1=_(_0x2cb3a1)[_0x0787('0x8e')](_0x56d316)['compact']()['value']();return db[_0x0787('0x40')][_0x0787('0x64')]({'where':{'id':_0x5709f1[_0x0787('0x5a')]['id']}})['then'](function(_0x54751d){return db[_0x0787('0x7a')]['transaction'](function(_0x4b3baf){return _0x54751d[_0x0787('0x81')](_0x5709f1[_0x0787('0x49')][_0x0787('0x75')],{'transaction':_0x4b3baf})[_0x0787('0x25')](function(){if(!_[_0x0787('0x8f')](_0x2cb3a1)){return _0x54751d[_0x0787('0x90')](_0x2cb3a1,{'transaction':_0x4b3baf});}})['then'](function(){_0x2cb3a1['forEach'](function(_0x303452){socket[_0x0787('0x7f')]('userChatQueue:remove',{'UserId':_0x303452,'ChatQueueId':_0x54751d['id']});});});});});});})[_0x0787('0x25')](respondWithStatusCode(_0x2486f8,null))['catch'](handleError(_0x2486f8,null));};exports[_0x0787('0x91')]=function(_0x4bdbba,_0x128603,_0x2bc2d8){return db['ChatQueue'][_0x0787('0x64')]({'where':{'id':_0x4bdbba[_0x0787('0x5a')]['id']}})[_0x0787('0x25')](handleEntityNotFound(_0x128603,null))[_0x0787('0x25')](function(_0x2f39a1){if(_0x2f39a1){return _0x2f39a1[_0x0787('0x91')](_0x4bdbba[_0x0787('0x5d')][_0x0787('0x75')],_[_0x0787('0x92')](_0x4bdbba['body'],['ids','id'])||{})[_0x0787('0x93')](function(_0x50fffa){for(var _0x59bd99=0x0;_0x59bd99<_0x4bdbba[_0x0787('0x5d')]['ids'][_0x0787('0x5b')];_0x59bd99+=0x1){socket[_0x0787('0x7f')](_0x0787('0x80'),{'UserId':Number(_0x4bdbba[_0x0787('0x5d')][_0x0787('0x75')][_0x59bd99]),'ChatQueueId':Number(_0x4bdbba[_0x0787('0x5a')]['id'])});}return _0x50fffa;});}})['then'](respondWithResult(_0x128603,null))[_0x0787('0x2f')](handleError(_0x128603,null));};exports[_0x0787('0x90')]=function(_0x3a378a,_0x5a632a,_0x361ea1){return db[_0x0787('0x40')][_0x0787('0x64')]({'where':{'id':_0x3a378a[_0x0787('0x5a')]['id']}})[_0x0787('0x25')](handleEntityNotFound(_0x5a632a,null))[_0x0787('0x25')](function(_0x59c255){if(_0x59c255){return _0x59c255[_0x0787('0x90')](_0x3a378a[_0x0787('0x49')][_0x0787('0x75')])[_0x0787('0x25')](function(){if(_[_0x0787('0x94')](_0x3a378a[_0x0787('0x49')][_0x0787('0x75')])){for(var _0x2b006c=0x0;_0x2b006c<_0x3a378a[_0x0787('0x49')][_0x0787('0x75')][_0x0787('0x5b')];_0x2b006c+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x3a378a[_0x0787('0x49')][_0x0787('0x75')][_0x2b006c]),'ChatQueueId':Number(_0x3a378a[_0x0787('0x5a')]['id'])});}}else{socket['emit'](_0x0787('0x95'),{'UserId':Number(_0x3a378a[_0x0787('0x49')]['ids']),'ChatQueueId':Number(_0x3a378a[_0x0787('0x5a')]['id'])});}});}})[_0x0787('0x25')](respondWithStatusCode(_0x5a632a,null))[_0x0787('0x2f')](handleError(_0x5a632a,null));};exports[_0x0787('0x96')]=function(_0x45b924,_0x1acb36,_0x56f56f){var _0x513e54={};var _0x4cbe76={};var _0x1104b6;var _0x129d46;return db[_0x0787('0x40')][_0x0787('0x66')]({'where':{'id':_0x45b924[_0x0787('0x5a')]['id']}})[_0x0787('0x25')](handleEntityNotFound(_0x1acb36,null))[_0x0787('0x25')](function(_0x51449b){if(_0x51449b){_0x1104b6=_0x51449b;_0x4cbe76['model']=_[_0x0787('0x46')](db['User']['rawAttributes']);_0x4cbe76[_0x0787('0x49')]=_[_0x0787('0x46')](_0x45b924['query']);_0x4cbe76[_0x0787('0x47')]=_[_0x0787('0x48')](_0x4cbe76['model'],_0x4cbe76[_0x0787('0x49')]);_0x513e54['attributes']=_[_0x0787('0x48')](_0x4cbe76['model'],qs[_0x0787('0x4b')](_0x45b924[_0x0787('0x49')][_0x0787('0x4b')]));_0x513e54['attributes']=_0x513e54['attributes'][_0x0787('0x5b')]?_0x513e54[_0x0787('0x4a')]:_0x4cbe76['model'];_0x513e54[_0x0787('0x4e')]=qs[_0x0787('0x4f')](_0x45b924[_0x0787('0x49')][_0x0787('0x4f')]);_0x513e54[_0x0787('0x50')]=qs[_0x0787('0x47')](_['pick'](_0x45b924['query'],_0x4cbe76[_0x0787('0x47')]));if(_0x45b924[_0x0787('0x49')][_0x0787('0x54')]){_0x513e54['where']=_[_0x0787('0x52')](_0x513e54[_0x0787('0x50')],{'$or':_[_0x0787('0x3f')](_0x513e54[_0x0787('0x4a')],function(_0x5e3e04){var _0x5bd5a9={};_0x5bd5a9[_0x5e3e04]={'$like':'%'+_0x45b924[_0x0787('0x49')]['filter']+'%'};return _0x5bd5a9;})});}_0x513e54=_[_0x0787('0x52')]({},_0x513e54,_0x45b924['options']);return _0x1104b6[_0x0787('0x96')](_0x513e54);}})[_0x0787('0x25')](function(_0x2ac26d){if(_0x2ac26d){_0x129d46=_0x2ac26d[_0x0787('0x5b')];if(!_0x45b924[_0x0787('0x49')]['hasOwnProperty']('nolimit')){_0x513e54[_0x0787('0x35')]=qs['limit'](_0x45b924[_0x0787('0x49')][_0x0787('0x35')]);_0x513e54[_0x0787('0x33')]=qs['offset'](_0x45b924[_0x0787('0x49')][_0x0787('0x33')]);}return _0x1104b6[_0x0787('0x96')](_0x513e54);}})[_0x0787('0x25')](function(_0x409985){if(_0x409985){return _0x409985?{'count':_0x129d46,'rows':_0x409985}:null;}})[_0x0787('0x25')](respondWithResult(_0x1acb36,null))[_0x0787('0x2f')](handleError(_0x1acb36,null));};
\ No newline at end of file
+var _0x335f=['autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','pick','ChatQueueId','filter','findAndCountAll','UserId','updatedAt','chatPause','createdAt','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','sendStatus','status','json','undefined','limit','count','offset','set','save','update','destroy','then','get','UserProfileResource','end','stack','name','send','index','ChatQueue','key','model','map','keys','query','filters','fields','attributes','nolimit','order','sort','where','VIRTUAL','merge','options','findAll','rows','show','rawAttributes','intersection','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection'];(function(_0x2a29de,_0x1acca3){var _0x1e31f3=function(_0x5d4187){while(--_0x5d4187){_0x2a29de['push'](_0x2a29de['shift']());}};_0x1e31f3(++_0x1acca3);}(_0x335f,0x16a));var _0xf335=function(_0xb83e0b,_0xc15aa4){_0xb83e0b=_0xb83e0b-0x0;var _0x4d280c=_0x335f[_0xb83e0b];return _0x4d280c;};'use strict';var emlformat=require(_0xf335('0x0'));var rimraf=require(_0xf335('0x1'));var zipdir=require(_0xf335('0x2'));var jsonpatch=require(_0xf335('0x3'));var rp=require(_0xf335('0x4'));var moment=require('moment');var BPromise=require(_0xf335('0x5'));var Mustache=require(_0xf335('0x6'));var util=require('util');var path=require(_0xf335('0x7'));var sox=require(_0xf335('0x8'));var csv=require('to-csv');var ejs=require(_0xf335('0x9'));var fs=require('fs');var fs_extra=require(_0xf335('0xa'));var _=require(_0xf335('0xb'));var squel=require('squel');var crypto=require(_0xf335('0xc'));var jsforce=require(_0xf335('0xd'));var deskjs=require(_0xf335('0xe'));var toCsv=require(_0xf335('0xf'));var querystring=require(_0xf335('0x10'));var Papa=require(_0xf335('0x11'));var Redis=require(_0xf335('0x12'));var authService=require(_0xf335('0x13'));var qs=require(_0xf335('0x14'));var as=require(_0xf335('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf335('0x16'))(_0xf335('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf335('0x18'));var db=require(_0xf335('0x19'))['db'];config[_0xf335('0x1a')]=_['defaults'](config[_0xf335('0x1a')],{'host':_0xf335('0x1b'),'port':0x18eb});var socket=require(_0xf335('0x1c'))(new Redis(config[_0xf335('0x1a')]));require('./chatQueue.socket')[_0xf335('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf335('0x1e')][_0xf335('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x27492e,_0x1ed04a,_0x1ea085,_0x1090e2){return new BPromise(function(_0x52722a,_0x3a065a){var _0x10e71f=_0x1090e2||client;return _0x10e71f[_0xf335('0x20')](_0x27492e,_0x1ea085)['then'](function(_0x53ef05){logger['info']('ChatQueue,\x20%s,\x20%s',_0x1ed04a,'request\x20sent');logger[_0xf335('0x21')](_0xf335('0x22'),_0x1ed04a,_0xf335('0x23'),JSON[_0xf335('0x24')](_0x53ef05));if(_0x53ef05['error']){if(_0x53ef05[_0xf335('0x25')][_0xf335('0x26')]===0x1f4){logger[_0xf335('0x25')](_0xf335('0x27'),_0x1ed04a,_0x53ef05[_0xf335('0x25')][_0xf335('0x28')]);return _0x3a065a(_0x53ef05[_0xf335('0x25')]['message']);}logger[_0xf335('0x25')](_0xf335('0x27'),_0x1ed04a,_0x53ef05[_0xf335('0x25')][_0xf335('0x28')]);return _0x52722a(_0x53ef05[_0xf335('0x25')]['message']);}else{logger[_0xf335('0x29')](_0xf335('0x27'),_0x1ed04a,_0xf335('0x23'));_0x52722a(_0x53ef05[_0xf335('0x2a')]['message']);}})['catch'](function(_0x4417a6){logger[_0xf335('0x25')]('ChatQueue,\x20%s,\x20%s',_0x1ed04a,_0x4417a6);_0x3a065a(_0x4417a6);});});}function respondWithStatusCode(_0x1b81a2,_0xea7032){_0xea7032=_0xea7032||0xcc;return function(_0x392f3a){if(_0x392f3a){return _0x1b81a2[_0xf335('0x2b')](_0xea7032);}return _0x1b81a2[_0xf335('0x2c')](_0xea7032)['end']();};}function respondWithResult(_0x3014e8,_0x822948){_0x822948=_0x822948||0xc8;return function(_0x4dea2d){if(_0x4dea2d){return _0x3014e8['status'](_0x822948)[_0xf335('0x2d')](_0x4dea2d);}};}function respondWithFilteredResult(_0x298308,_0x4178ff){return function(_0x3bb7a1){if(_0x3bb7a1){var _0x2145dd=typeof _0x4178ff['offset']===_0xf335('0x2e')&&typeof _0x4178ff[_0xf335('0x2f')]===_0xf335('0x2e');var _0x4ebe05=_0x3bb7a1[_0xf335('0x30')];var _0x4f1e54=_0x2145dd?0x0:_0x4178ff[_0xf335('0x31')];var _0x489bcc=_0x2145dd?_0x3bb7a1['count']:_0x4178ff[_0xf335('0x31')]+_0x4178ff['limit'];var _0xefbc45;if(_0x489bcc>=_0x4ebe05){_0x489bcc=_0x4ebe05;_0xefbc45=0xc8;}else{_0xefbc45=0xce;}_0x298308[_0xf335('0x2c')](_0xefbc45);return _0x298308[_0xf335('0x32')]('Content-Range',_0x4f1e54+'-'+_0x489bcc+'/'+_0x4ebe05)[_0xf335('0x2d')](_0x3bb7a1);}return null;};}function patchUpdates(_0x68c3ba){return function(_0x34c8fb){try{jsonpatch['apply'](_0x34c8fb,_0x68c3ba,!![]);}catch(_0x20a9b0){return BPromise['reject'](_0x20a9b0);}return _0x34c8fb[_0xf335('0x33')]();};}function saveUpdates(_0x100763,_0x44d3f7){return function(_0x408f40){if(_0x408f40){return _0x408f40[_0xf335('0x34')](_0x100763)['then'](function(_0x1d4730){return _0x1d4730;});}return null;};}function removeEntity(_0x58ae53,_0x38eb76){return function(_0x4c1c01){if(_0x4c1c01){return _0x4c1c01[_0xf335('0x35')]()[_0xf335('0x36')](function(){var _0x2dbe0c=_0x4c1c01[_0xf335('0x37')]({'plain':!![]});var _0xff3206='ChatQueues';return db[_0xf335('0x38')][_0xf335('0x35')]({'where':{'type':_0xff3206,'resourceId':_0x2dbe0c['id']}})['then'](function(){return _0x4c1c01;});})['then'](function(){_0x58ae53['status'](0xcc)[_0xf335('0x39')]();});}};}function handleEntityNotFound(_0x597598,_0x4ea666){return function(_0x2cc28c){if(!_0x2cc28c){_0x597598[_0xf335('0x2b')](0x194);}return _0x2cc28c;};}function handleError(_0x4229f2,_0x4483c8){_0x4483c8=_0x4483c8||0x1f4;return function(_0x5ee892){logger[_0xf335('0x25')](_0x5ee892[_0xf335('0x3a')]);if(_0x5ee892[_0xf335('0x3b')]){delete _0x5ee892[_0xf335('0x3b')];}_0x4229f2[_0xf335('0x2c')](_0x4483c8)[_0xf335('0x3c')](_0x5ee892);};}exports[_0xf335('0x3d')]=function(_0x2972ad,_0xe90219){var _0x3bc7ed={},_0xf92f67={},_0xb7d744={'count':0x0,'rows':[]};var _0x2582a7=_['map'](db[_0xf335('0x3e')]['rawAttributes'],function(_0x646971){return{'name':_0x646971['fieldName'],'type':_0x646971['type'][_0xf335('0x3f')]};});_0xf92f67[_0xf335('0x40')]=_[_0xf335('0x41')](_0x2582a7,_0xf335('0x3b'));_0xf92f67['query']=_[_0xf335('0x42')](_0x2972ad[_0xf335('0x43')]);_0xf92f67[_0xf335('0x44')]=_['intersection'](_0xf92f67[_0xf335('0x40')],_0xf92f67[_0xf335('0x43')]);_0x3bc7ed['attributes']=_['intersection'](_0xf92f67[_0xf335('0x40')],qs[_0xf335('0x45')](_0x2972ad[_0xf335('0x43')]['fields']));_0x3bc7ed[_0xf335('0x46')]=_0x3bc7ed['attributes']['length']?_0x3bc7ed[_0xf335('0x46')]:_0xf92f67[_0xf335('0x40')];if(!_0x2972ad['query']['hasOwnProperty'](_0xf335('0x47'))){_0x3bc7ed['limit']=qs['limit'](_0x2972ad[_0xf335('0x43')][_0xf335('0x2f')]);_0x3bc7ed[_0xf335('0x31')]=qs[_0xf335('0x31')](_0x2972ad['query'][_0xf335('0x31')]);}_0x3bc7ed[_0xf335('0x48')]=qs[_0xf335('0x49')](_0x2972ad[_0xf335('0x43')][_0xf335('0x49')]);_0x3bc7ed['where']=qs[_0xf335('0x44')](_['pick'](_0x2972ad[_0xf335('0x43')],_0xf92f67[_0xf335('0x44')]),_0x2582a7);if(_0x2972ad[_0xf335('0x43')]['filter']){_0x3bc7ed['where']=_['merge'](_0x3bc7ed[_0xf335('0x4a')],{'$or':_[_0xf335('0x41')](_0x2582a7,function(_0x334810){if(_0x334810['type']!==_0xf335('0x4b')){var _0x509ec7={};_0x509ec7[_0x334810['name']]={'$like':'%'+_0x2972ad[_0xf335('0x43')]['filter']+'%'};return _0x509ec7;}})});}_0x3bc7ed=_[_0xf335('0x4c')]({},_0x3bc7ed,_0x2972ad[_0xf335('0x4d')]);var _0x44be02={'where':_0x3bc7ed[_0xf335('0x4a')]};return db[_0xf335('0x3e')][_0xf335('0x30')](_0x44be02)[_0xf335('0x36')](function(_0x53ebcf){_0xb7d744[_0xf335('0x30')]=_0x53ebcf;if(_0x2972ad['query']['includeAll']){_0x3bc7ed['include']=[{'all':!![]}];}return db[_0xf335('0x3e')][_0xf335('0x4e')](_0x3bc7ed);})[_0xf335('0x36')](function(_0x776259){_0xb7d744[_0xf335('0x4f')]=_0x776259;return _0xb7d744;})[_0xf335('0x36')](respondWithFilteredResult(_0xe90219,_0x3bc7ed))['catch'](handleError(_0xe90219,null));};exports[_0xf335('0x50')]=function(_0x1c28dc,_0x335ecb){var _0x4e35ba={'raw':!![],'where':{'id':_0x1c28dc['params']['id']}},_0x17a146={};_0x17a146[_0xf335('0x40')]=_['keys'](db['ChatQueue'][_0xf335('0x51')]);_0x17a146['query']=_[_0xf335('0x42')](_0x1c28dc['query']);_0x17a146[_0xf335('0x44')]=_[_0xf335('0x52')](_0x17a146[_0xf335('0x40')],_0x17a146[_0xf335('0x43')]);_0x4e35ba[_0xf335('0x46')]=_[_0xf335('0x52')](_0x17a146[_0xf335('0x40')],qs['fields'](_0x1c28dc[_0xf335('0x43')][_0xf335('0x45')]));_0x4e35ba[_0xf335('0x46')]=_0x4e35ba[_0xf335('0x46')][_0xf335('0x53')]?_0x4e35ba[_0xf335('0x46')]:_0x17a146['model'];if(_0x1c28dc[_0xf335('0x43')]['includeAll']){_0x4e35ba['include']=[{'all':!![]}];}_0x4e35ba=_[_0xf335('0x4c')]({},_0x4e35ba,_0x1c28dc[_0xf335('0x4d')]);return db[_0xf335('0x3e')][_0xf335('0x54')](_0x4e35ba)['then'](handleEntityNotFound(_0x335ecb,null))[_0xf335('0x36')](respondWithResult(_0x335ecb,null))['catch'](handleError(_0x335ecb,null));};exports[_0xf335('0x55')]=function(_0x1e0718,_0x21d820){return db[_0xf335('0x3e')][_0xf335('0x55')](_0x1e0718['body'],{})[_0xf335('0x36')](function(_0x15e555){var _0x3b59cb=_0x1e0718['user'][_0xf335('0x37')]({'plain':!![]});if(!_0x3b59cb)throw new Error(_0xf335('0x56'));if(_0x3b59cb[_0xf335('0x57')]===_0xf335('0x58')){var _0x3eb403=_0x15e555['get']({'plain':!![]});var _0x3aa7a2=_0xf335('0x59');return db[_0xf335('0x5a')][_0xf335('0x54')]({'where':{'name':_0x3aa7a2,'userProfileId':_0x3b59cb['userProfileId']},'raw':!![]})[_0xf335('0x36')](function(_0x2168c3){if(_0x2168c3&&_0x2168c3[_0xf335('0x5b')]===0x0){return db[_0xf335('0x38')][_0xf335('0x55')]({'name':_0x3eb403[_0xf335('0x3b')],'resourceId':_0x3eb403['id'],'type':_0x2168c3['name'],'sectionId':_0x2168c3['id']},{})['then'](function(){return _0x15e555;});}else{return _0x15e555;}})[_0xf335('0x5c')](function(_0x218763){logger[_0xf335('0x25')](_0xf335('0x5d'),_0x218763);throw _0x218763;});}return _0x15e555;})[_0xf335('0x36')](respondWithResult(_0x21d820,0xc9))['catch'](handleError(_0x21d820,null));};exports[_0xf335('0x34')]=function(_0x1c336c,_0x25a8e9){if(_0x1c336c['body']['id']){delete _0x1c336c[_0xf335('0x5e')]['id'];}return db['ChatQueue'][_0xf335('0x54')]({'where':{'id':_0x1c336c['params']['id']}})[_0xf335('0x36')](handleEntityNotFound(_0x25a8e9,null))[_0xf335('0x36')](saveUpdates(_0x1c336c[_0xf335('0x5e')],null))[_0xf335('0x36')](respondWithResult(_0x25a8e9,null))[_0xf335('0x5c')](handleError(_0x25a8e9,null));};exports[_0xf335('0x35')]=function(_0x147ab0,_0x3ea68a){return db['ChatQueue']['find']({'where':{'id':_0x147ab0[_0xf335('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3ea68a,null))[_0xf335('0x36')](removeEntity(_0x3ea68a,null))[_0xf335('0x5c')](handleError(_0x3ea68a,null));};exports[_0xf335('0x60')]=function(_0x1dad5a,_0x1c5514){return db[_0xf335('0x3e')][_0xf335('0x60')]()['then'](respondWithResult(_0x1c5514,null))[_0xf335('0x5c')](handleError(_0x1c5514,null));};exports[_0xf335('0x61')]=function(_0x26f7da,_0x5d1174,_0x129c5b){var _0x38bf1c={'raw':!![],'where':{}},_0x1c1c78={},_0x3ee864;return db[_0xf335('0x3e')][_0xf335('0x62')]({'where':{'id':_0x26f7da[_0xf335('0x5f')]['id']}})[_0xf335('0x36')](handleEntityNotFound(_0x5d1174,null))[_0xf335('0x36')](function(_0x541e6d){if(_0x541e6d){_0x3ee864=_0x541e6d[_0xf335('0x37')]({'plain':!![]});_0x1c1c78['model']=_['keys'](db[_0xf335('0x63')][_0xf335('0x51')]);_0x1c1c78[_0xf335('0x43')]=_['keys'](_0x26f7da['query']);_0x1c1c78['filters']=_[_0xf335('0x52')](_0x1c1c78[_0xf335('0x40')],_0x1c1c78[_0xf335('0x43')]);_0x38bf1c['attributes']=_[_0xf335('0x52')](_0x1c1c78[_0xf335('0x40')],qs[_0xf335('0x45')](_0x26f7da[_0xf335('0x43')]['fields']));_0x38bf1c[_0xf335('0x46')]=_0x38bf1c['attributes'][_0xf335('0x53')]?_0x38bf1c['attributes']:_0x1c1c78[_0xf335('0x40')];if(!_0x26f7da[_0xf335('0x43')][_0xf335('0x64')](_0xf335('0x47'))){_0x38bf1c[_0xf335('0x2f')]=qs[_0xf335('0x2f')](_0x26f7da[_0xf335('0x43')][_0xf335('0x2f')]);_0x38bf1c[_0xf335('0x31')]=qs['offset'](_0x26f7da[_0xf335('0x43')][_0xf335('0x31')]);}_0x38bf1c[_0xf335('0x48')]=qs['sort'](_0x26f7da['query']['sort']);_0x38bf1c['where']=qs[_0xf335('0x44')](_[_0xf335('0x65')](_0x26f7da[_0xf335('0x43')],_0x1c1c78['filters']));_0x38bf1c[_0xf335('0x4a')][_0xf335('0x66')]=_0x541e6d['id'];if(_0x26f7da['query']['filter']){_0x38bf1c[_0xf335('0x4a')]=_[_0xf335('0x4c')](_0x38bf1c['where'],{'$or':_[_0xf335('0x41')](_0x38bf1c[_0xf335('0x46')],function(_0x535590){var _0x3f2366={};_0x3f2366[_0x535590]={'$like':'%'+_0x26f7da[_0xf335('0x43')][_0xf335('0x67')]+'%'};return _0x3f2366;})});}_0x38bf1c=_[_0xf335('0x4c')]({},_0x38bf1c,_0x26f7da[_0xf335('0x4d')]);return db[_0xf335('0x63')]['findAll'](_0x38bf1c);}})[_0xf335('0x36')](function(_0xd8cf8){if(_0xd8cf8){return db['User'][_0xf335('0x68')]({'where':{'id':_[_0xf335('0x41')](_0xd8cf8,_0xf335('0x69')),'role':'agent'},'attributes':['id','name','chatPause',_0xf335('0x6a'),'createdAt']});}})[_0xf335('0x36')](function(_0x41b6b7){if(_0x41b6b7){return{'count':_0x41b6b7[_0xf335('0x30')],'rows':_[_0xf335('0x41')](_0x41b6b7[_0xf335('0x4f')],function(_0xe79e65){return{'membername':_0xe79e65[_0xf335('0x3b')],'UserId':_0xe79e65['id'],'queue_name':_0x3ee864[_0xf335('0x3b')],'ChatQueueId':_0x3ee864['id'],'interface':util['format']('%s/%s','SIP',_0xe79e65['name']),'penalty':0x0,'paused':_0xe79e65[_0xf335('0x6b')],'createdAt':_0xe79e65[_0xf335('0x6c')],'updatedAt':_0xe79e65['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf335('0x36')](respondWithFilteredResult(_0x5d1174,_0x38bf1c))[_0xf335('0x5c')](handleError(_0x5d1174,null));};exports[_0xf335('0x6d')]=function(_0x26d469,_0x5cffe0,_0xdc1cbf){var _0xa997a3={};var _0x30dcc6={};var _0x4111cd;var _0xa504d5;return db[_0xf335('0x3e')][_0xf335('0x62')]({'where':{'id':_0x26d469[_0xf335('0x5f')]['id']}})[_0xf335('0x36')](handleEntityNotFound(_0x5cffe0,null))[_0xf335('0x36')](function(_0x5943f3){if(_0x5943f3){_0x4111cd=_0x5943f3;_0x30dcc6[_0xf335('0x40')]=_[_0xf335('0x42')](db[_0xf335('0x6e')][_0xf335('0x51')]);_0x30dcc6[_0xf335('0x43')]=_[_0xf335('0x42')](_0x26d469[_0xf335('0x43')]);_0x30dcc6[_0xf335('0x44')]=_['intersection'](_0x30dcc6[_0xf335('0x40')],_0x30dcc6['query']);_0xa997a3['attributes']=_['intersection'](_0x30dcc6['model'],qs[_0xf335('0x45')](_0x26d469[_0xf335('0x43')][_0xf335('0x45')]));_0xa997a3['attributes']=_0xa997a3[_0xf335('0x46')][_0xf335('0x53')]?_0xa997a3[_0xf335('0x46')]:_0x30dcc6[_0xf335('0x40')];_0xa997a3[_0xf335('0x48')]=qs[_0xf335('0x49')](_0x26d469[_0xf335('0x43')][_0xf335('0x49')]);_0xa997a3['where']=qs[_0xf335('0x44')](_[_0xf335('0x65')](_0x26d469['query'],_0x30dcc6[_0xf335('0x44')]));if(_0x26d469['query']['filter']){_0xa997a3[_0xf335('0x4a')]=_[_0xf335('0x4c')](_0xa997a3['where'],{'$or':_['map'](_0xa997a3[_0xf335('0x46')],function(_0x5022fa){var _0x81f739={};_0x81f739[_0x5022fa]={'$like':'%'+_0x26d469[_0xf335('0x43')]['filter']+'%'};return _0x81f739;})});}_0xa997a3=_[_0xf335('0x4c')]({},_0xa997a3,_0x26d469[_0xf335('0x4d')]);return _0x4111cd[_0xf335('0x6d')](_0xa997a3);}})[_0xf335('0x36')](function(_0x3bdda4){if(_0x3bdda4){_0xa504d5=_0x3bdda4[_0xf335('0x53')];if(!_0x26d469['query'][_0xf335('0x64')](_0xf335('0x47'))){_0xa997a3[_0xf335('0x2f')]=qs['limit'](_0x26d469['query']['limit']);_0xa997a3[_0xf335('0x31')]=qs[_0xf335('0x31')](_0x26d469[_0xf335('0x43')]['offset']);}return _0x4111cd[_0xf335('0x6d')](_0xa997a3);}})[_0xf335('0x36')](function(_0x4f4006){if(_0x4f4006){return _0x4f4006?{'count':_0xa504d5,'rows':_0x4f4006}:null;}})[_0xf335('0x36')](respondWithResult(_0x5cffe0,null))['catch'](handleError(_0x5cffe0,null));};exports[_0xf335('0x6f')]=function(_0x3d13d6,_0x2b69d5,_0xcfd113){var _0x4fdeca=_0x3d13d6[_0xf335('0x5e')][_0xf335('0x70')];return db[_0xf335('0x6e')]['findAll']({'where':{'id':_0x4fdeca},'attributes':['id'],'include':[{'model':db[_0xf335('0x71')],'as':_0xf335('0x72'),'attributes':['id','name',_0xf335('0x73'),_0xf335('0x74'),_0xf335('0x75')],'raw':!![]}]})['then'](function(_0x5d5604){if(_0x5d5604){var _0x12f3f6=_[_0xf335('0x76')](_0x5d5604,function(_0x2aad52){var _0x344051=_0x2aad52[_0xf335('0x37')]({'plain':!![]});return _0x344051['Agents'];});return db[_0xf335('0x3e')][_0xf335('0x54')]({'where':{'id':_0x3d13d6[_0xf335('0x5f')]['id']}})[_0xf335('0x36')](function(_0x1b67d6){return db[_0xf335('0x77')]['transaction'](function(_0x302458){return _0x1b67d6['addTeams'](_0x4fdeca,{'transaction':_0x302458})[_0xf335('0x36')](function(){return BPromise[_0xf335('0x78')](_0x12f3f6,function(_0x668fd1){return db[_0xf335('0x63')]['findOrCreate']({'where':{'UserId':_0x668fd1['id'],'ChatQueueId':_0x3d13d6[_0xf335('0x5f')]['id']},'transaction':_0x302458});});})[_0xf335('0x36')](function(){_0x12f3f6[_0xf335('0x79')](function(_0x2e97eb){socket[_0xf335('0x7a')](_0xf335('0x7b'),{'UserId':_0x2e97eb['id'],'ChatQueueId':_0x1b67d6['id']});});});});});}})[_0xf335('0x36')](respondWithStatusCode(_0x2b69d5,null))[_0xf335('0x5c')](handleError(_0x2b69d5,null));};exports[_0xf335('0x7c')]=function(_0x2181cd,_0xee5262,_0x582c6d){return db[_0xf335('0x6e')]['findAll']({'where':{'id':_0x2181cd[_0xf335('0x43')][_0xf335('0x70')]},'attributes':['id'],'include':[{'model':db[_0xf335('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf335('0x36')](handleEntityNotFound(_0xee5262,null))[_0xf335('0x36')](function(_0x496920){var _0x1f8a7e=_[_0xf335('0x41')](_0x496920,'id');var _0x5a6af1=[];var _0x2d3b91=[];var _0x5912c0=squel[_0xf335('0x7d')]();_0x5912c0[_0xf335('0x7e')](_0xf335('0x7f'))[_0xf335('0x80')](_0xf335('0x81'),'tq')[_0xf335('0x82')](_0xf335('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf335('0x4a')]('ChatQueueId\x20=\x20?',_0x2181cd[_0xf335('0x5f')]['id']);for(var _0x1f6813=0x0;_0x1f6813<_0x496920[_0xf335('0x53')];_0x1f6813+=0x1){let _0x3a5e97=_0x496920[_0x1f6813];for(var _0x46a6ab=0x0;_0x46a6ab<_0x3a5e97[_0xf335('0x72')][_0xf335('0x53')];_0x46a6ab+=0x1){let _0x3550a6=_0x3a5e97[_0xf335('0x72')][_0x46a6ab];var _0x1f9b95=_0x5912c0[_0xf335('0x84')]();_0x1f9b95['where'](_0xf335('0x85'),_0x3550a6['id']);_0x2d3b91['push'](db[_0xf335('0x77')][_0xf335('0x43')](_0x1f9b95['toString'](),{'type':db['sequelize'][_0xf335('0x86')][_0xf335('0x87')]})['then'](function(_0x121740){if(_0x121740[_0xf335('0x53')]===0x1){return _0x3550a6['id'];}else{var _0x5a4a77=_[_0xf335('0x88')](_[_0xf335('0x41')](_0x121740,_0xf335('0x89')),function(_0x3c2ec6){return _[_0xf335('0x8a')](_0x1f8a7e,_0x3c2ec6);});if(_0x5a4a77){return _0x3550a6['id'];}}}));}}return BPromise[_0xf335('0x8b')](_0x2d3b91)['then'](function(_0x45c78f){_0x5a6af1=_(_0x5a6af1)['union'](_0x45c78f)[_0xf335('0x8c')]()[_0xf335('0x8d')]();return db[_0xf335('0x3e')][_0xf335('0x54')]({'where':{'id':_0x2181cd[_0xf335('0x5f')]['id']}})[_0xf335('0x36')](function(_0x5c53ee){return db[_0xf335('0x77')][_0xf335('0x8e')](function(_0x4cf6b9){return _0x5c53ee[_0xf335('0x7c')](_0x2181cd[_0xf335('0x43')][_0xf335('0x70')],{'transaction':_0x4cf6b9})[_0xf335('0x36')](function(){if(!_[_0xf335('0x8f')](_0x5a6af1)){return _0x5c53ee[_0xf335('0x90')](_0x5a6af1,{'transaction':_0x4cf6b9});}})[_0xf335('0x36')](function(){_0x5a6af1[_0xf335('0x79')](function(_0x4f9803){socket[_0xf335('0x7a')](_0xf335('0x91'),{'UserId':_0x4f9803,'ChatQueueId':_0x5c53ee['id']});});});});});});})[_0xf335('0x36')](respondWithStatusCode(_0xee5262,null))[_0xf335('0x5c')](handleError(_0xee5262,null));};exports[_0xf335('0x92')]=function(_0x5c73c2,_0x13fd42,_0x319cc0){return db['ChatQueue']['find']({'where':{'id':_0x5c73c2[_0xf335('0x5f')]['id']}})[_0xf335('0x36')](handleEntityNotFound(_0x13fd42,null))[_0xf335('0x36')](function(_0x219cd4){if(_0x219cd4){return _0x219cd4[_0xf335('0x92')](_0x5c73c2[_0xf335('0x5e')][_0xf335('0x70')],_[_0xf335('0x93')](_0x5c73c2[_0xf335('0x5e')],[_0xf335('0x70'),'id'])||{})[_0xf335('0x94')](function(_0x532911){for(var _0x1b9bf5=0x0;_0x1b9bf5<_0x5c73c2[_0xf335('0x5e')]['ids'][_0xf335('0x53')];_0x1b9bf5+=0x1){socket['emit'](_0xf335('0x7b'),{'UserId':Number(_0x5c73c2[_0xf335('0x5e')][_0xf335('0x70')][_0x1b9bf5]),'ChatQueueId':Number(_0x5c73c2['params']['id'])});}return _0x532911;});}})[_0xf335('0x36')](respondWithResult(_0x13fd42,null))['catch'](handleError(_0x13fd42,null));};exports[_0xf335('0x90')]=function(_0x2b45bc,_0x4cf99f,_0x59a04f){return db[_0xf335('0x3e')][_0xf335('0x54')]({'where':{'id':_0x2b45bc['params']['id']}})['then'](handleEntityNotFound(_0x4cf99f,null))[_0xf335('0x36')](function(_0x313e9c){if(_0x313e9c){return _0x313e9c[_0xf335('0x90')](_0x2b45bc['query']['ids'])[_0xf335('0x36')](function(){if(_[_0xf335('0x95')](_0x2b45bc[_0xf335('0x43')]['ids'])){for(var _0x2371d9=0x0;_0x2371d9<_0x2b45bc[_0xf335('0x43')][_0xf335('0x70')][_0xf335('0x53')];_0x2371d9+=0x1){socket[_0xf335('0x7a')](_0xf335('0x91'),{'UserId':Number(_0x2b45bc['query'][_0xf335('0x70')][_0x2371d9]),'ChatQueueId':Number(_0x2b45bc[_0xf335('0x5f')]['id'])});}}else{socket[_0xf335('0x7a')](_0xf335('0x91'),{'UserId':Number(_0x2b45bc[_0xf335('0x43')]['ids']),'ChatQueueId':Number(_0x2b45bc[_0xf335('0x5f')]['id'])});}});}})[_0xf335('0x36')](respondWithStatusCode(_0x4cf99f,null))[_0xf335('0x5c')](handleError(_0x4cf99f,null));};exports['getAgents']=function(_0x5f5346,_0x3b4033,_0x567453){var _0x35a5b7={};var _0x16bb6b={};var _0x174c65;var _0xa7bd7c;return db[_0xf335('0x3e')][_0xf335('0x62')]({'where':{'id':_0x5f5346['params']['id']}})[_0xf335('0x36')](handleEntityNotFound(_0x3b4033,null))[_0xf335('0x36')](function(_0x554bb3){if(_0x554bb3){_0x174c65=_0x554bb3;_0x16bb6b[_0xf335('0x40')]=_[_0xf335('0x42')](db[_0xf335('0x71')][_0xf335('0x51')]);_0x16bb6b['query']=_[_0xf335('0x42')](_0x5f5346['query']);_0x16bb6b['filters']=_[_0xf335('0x52')](_0x16bb6b[_0xf335('0x40')],_0x16bb6b[_0xf335('0x43')]);_0x35a5b7['attributes']=_[_0xf335('0x52')](_0x16bb6b[_0xf335('0x40')],qs[_0xf335('0x45')](_0x5f5346[_0xf335('0x43')][_0xf335('0x45')]));_0x35a5b7[_0xf335('0x46')]=_0x35a5b7[_0xf335('0x46')]['length']?_0x35a5b7['attributes']:_0x16bb6b[_0xf335('0x40')];_0x35a5b7[_0xf335('0x48')]=qs[_0xf335('0x49')](_0x5f5346['query'][_0xf335('0x49')]);_0x35a5b7[_0xf335('0x4a')]=qs['filters'](_[_0xf335('0x65')](_0x5f5346[_0xf335('0x43')],_0x16bb6b[_0xf335('0x44')]));if(_0x5f5346[_0xf335('0x43')]['filter']){_0x35a5b7[_0xf335('0x4a')]=_[_0xf335('0x4c')](_0x35a5b7[_0xf335('0x4a')],{'$or':_['map'](_0x35a5b7[_0xf335('0x46')],function(_0x13fcb4){var _0x4141a0={};_0x4141a0[_0x13fcb4]={'$like':'%'+_0x5f5346['query']['filter']+'%'};return _0x4141a0;})});}_0x35a5b7=_[_0xf335('0x4c')]({},_0x35a5b7,_0x5f5346['options']);return _0x174c65[_0xf335('0x96')](_0x35a5b7);}})[_0xf335('0x36')](function(_0x1591b5){if(_0x1591b5){_0xa7bd7c=_0x1591b5[_0xf335('0x53')];if(!_0x5f5346[_0xf335('0x43')][_0xf335('0x64')](_0xf335('0x47'))){_0x35a5b7[_0xf335('0x2f')]=qs['limit'](_0x5f5346[_0xf335('0x43')]['limit']);_0x35a5b7[_0xf335('0x31')]=qs['offset'](_0x5f5346['query'][_0xf335('0x31')]);}return _0x174c65[_0xf335('0x96')](_0x35a5b7);}})['then'](function(_0x2a4448){if(_0x2a4448){return _0x2a4448?{'count':_0xa7bd7c,'rows':_0x2a4448}:null;}})[_0xf335('0x36')](respondWithResult(_0x3b4033,null))[_0xf335('0x5c')](handleError(_0x3b4033,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 25c7643..4238773 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 _0xfc6e=['events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x57745d,_0x1fe06e){var _0x414130=function(_0x39e8a8){while(--_0x39e8a8){_0x57745d['push'](_0x57745d['shift']());}};_0x414130(++_0x1fe06e);}(_0xfc6e,0x13b));var _0xefc6=function(_0x19c4bd,_0x19a00d){_0x19c4bd=_0x19c4bd-0x0;var _0x2fc7b5=_0xfc6e[_0x19c4bd];return _0x2fc7b5;};'use strict';var EventEmitter=require(_0xefc6('0x0'));var ChatQueue=require(_0xefc6('0x1'))['db'][_0xefc6('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xefc6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xefc6('0x4'),'afterDestroy':_0xefc6('0x5')};function emitEvent(_0x3aaa94){return function(_0x3ece1a,_0x169f18,_0x1df705){ChatQueueEvents['emit'](_0x3aaa94+':'+_0x3ece1a['id'],_0x3ece1a);ChatQueueEvents[_0xefc6('0x6')](_0x3aaa94,_0x3ece1a);_0x1df705(null);};}for(var e in events){if(events[_0xefc6('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xefc6('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf734=['emit','hook','exports','ChatQueue','setMaxListeners','save','update'];(function(_0x28b78c,_0x1b406d){var _0x1c4f79=function(_0x178c2f){while(--_0x178c2f){_0x28b78c['push'](_0x28b78c['shift']());}};_0x1c4f79(++_0x1b406d);}(_0xf734,0x129));var _0x4f73=function(_0x9f231b,_0x1ed4bb){_0x9f231b=_0x9f231b-0x0;var _0x3c1276=_0xf734[_0x9f231b];return _0x3c1276;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x4f73('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4f73('0x1')](0x0);var events={'afterCreate':_0x4f73('0x2'),'afterUpdate':_0x4f73('0x3'),'afterDestroy':'remove'};function emitEvent(_0x34e8ac){return function(_0x5d8421,_0x394946,_0x5c797f){ChatQueueEvents[_0x4f73('0x4')](_0x34e8ac+':'+_0x5d8421['id'],_0x5d8421);ChatQueueEvents[_0x4f73('0x4')](_0x34e8ac,_0x5d8421);_0x5c797f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x4f73('0x5')](e,emitEvent(event));}}module[_0x4f73('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 3f6c903..ae272a4 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 _0x1cd7=['define','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x599610,_0x1c88b0){var _0x124756=function(_0x46fda4){while(--_0x46fda4){_0x599610['push'](_0x599610['shift']());}};_0x124756(++_0x1c88b0);}(_0x1cd7,0xb1));var _0x71cd=function(_0x3f95ba,_0x4d880a){_0x3f95ba=_0x3f95ba-0x0;var _0x3f8987=_0x1cd7[_0x3f95ba];return _0x3f8987;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x71cd('0x0'))(_0x71cd('0x1'));var moment=require(_0x71cd('0x2'));var BPromise=require(_0x71cd('0x3'));var rp=require(_0x71cd('0x4'));var fs=require('fs');var path=require(_0x71cd('0x5'));var rimraf=require('rimraf');var config=require(_0x71cd('0x6'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x144c2f,_0x3adcbc){return _0x144c2f[_0x71cd('0x7')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeea8=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xeea8,0xb1));var _0x8eea=function(_0x8c96ac,_0xdda81e){_0x8c96ac=_0x8c96ac-0x0;var _0x39f78e=_0xeea8[_0x8c96ac];return _0x39f78e;};'use strict';var _=require(_0x8eea('0x0'));var util=require(_0x8eea('0x1'));var logger=require(_0x8eea('0x2'))(_0x8eea('0x3'));var moment=require(_0x8eea('0x4'));var BPromise=require(_0x8eea('0x5'));var rp=require(_0x8eea('0x6'));var fs=require('fs');var path=require(_0x8eea('0x7'));var rimraf=require(_0x8eea('0x8'));var config=require(_0x8eea('0x9'));var attributes=require(_0x8eea('0xa'));module['exports']=function(_0xc2c556,_0x5e035e){return _0xc2c556[_0x8eea('0xb')]('ChatQueue',attributes,{'tableName':_0x8eea('0xc'),'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 e85cd57..a0632b2 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 _0xb5a4=['socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','then','debug','ShowChatQueue','find','raw','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x4e2ec5,_0xc79b56){var _0x1dd09c=function(_0x5c9484){while(--_0x5c9484){_0x4e2ec5['push'](_0x4e2ec5['shift']());}};_0x1dd09c(++_0xc79b56);}(_0xb5a4,0x17d));var _0x4b5a=function(_0x270c2d,_0x1b378b){_0x270c2d=_0x270c2d-0x0;var _0x4f728a=_0xb5a4[_0x270c2d];return _0x4f728a;};'use strict';var _=require('lodash');var util=require(_0x4b5a('0x0'));var moment=require(_0x4b5a('0x1'));var BPromise=require(_0x4b5a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b5a('0x3'));var db=require(_0x4b5a('0x4'))['db'];var utils=require(_0x4b5a('0x5'));var logger=require(_0x4b5a('0x6'))(_0x4b5a('0x7'));var config=require(_0x4b5a('0x8'));var jayson=require(_0x4b5a('0x9'));var client=jayson[_0x4b5a('0xa')][_0x4b5a('0xb')]({'port':0x232a});config['redis']=_[_0x4b5a('0xc')](config[_0x4b5a('0xd')],{'host':_0x4b5a('0xe'),'port':0x18eb});var socket=require(_0x4b5a('0xf'))(new Redis(config[_0x4b5a('0xd')]));require(_0x4b5a('0x10'))[_0x4b5a('0x11')](socket);function respondWithRpcPromise(_0x10e9ac,_0x5b8213,_0x1b0c8a){return new BPromise(function(_0x53f6cd,_0x59395e){return client[_0x4b5a('0x12')](_0x10e9ac,_0x1b0c8a)['then'](function(_0x191734){logger[_0x4b5a('0x13')](_0x4b5a('0x14'),_0x5b8213,'request\x20sent');logger['debug'](_0x4b5a('0x15'),_0x5b8213,_0x4b5a('0x16'),JSON[_0x4b5a('0x17')](_0x191734));if(_0x191734[_0x4b5a('0x18')]){if(_0x191734[_0x4b5a('0x18')][_0x4b5a('0x19')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5b8213,_0x191734[_0x4b5a('0x18')][_0x4b5a('0x1a')]);return _0x59395e(_0x191734[_0x4b5a('0x18')]['message']);}logger['error'](_0x4b5a('0x14'),_0x5b8213,_0x191734['error'][_0x4b5a('0x1a')]);return _0x53f6cd(_0x191734[_0x4b5a('0x18')]['message']);}else{logger[_0x4b5a('0x13')](_0x4b5a('0x14'),_0x5b8213,_0x4b5a('0x16'));_0x53f6cd(_0x191734[_0x4b5a('0x1b')][_0x4b5a('0x1a')]);}})['catch'](function(_0x4fbd7c){logger['error'](_0x4b5a('0x14'),_0x5b8213,_0x4fbd7c);_0x59395e(_0x4fbd7c);});});}exports[_0x4b5a('0x1c')]=function(_0x2cc10c){var _0xa351fe=this;return new Promise(function(_0x402eb1,_0x5140c1){return db[_0x4b5a('0x1d')][_0x4b5a('0x1e')]({'raw':_0x2cc10c[_0x4b5a('0x1f')]?_0x2cc10c[_0x4b5a('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2cc10c[_0x4b5a('0x1f')]?_0x2cc10c[_0x4b5a('0x1f')][_0x4b5a('0x20')]||null:null,'attributes':_0x2cc10c['options']?_0x2cc10c[_0x4b5a('0x1f')][_0x4b5a('0x21')]||null:null,'limit':_0x2cc10c[_0x4b5a('0x1f')]?_0x2cc10c[_0x4b5a('0x1f')][_0x4b5a('0x22')]||null:null,'include':_0x2cc10c['options']?_0x2cc10c[_0x4b5a('0x1f')][_0x4b5a('0x23')]?_[_0x4b5a('0x24')](_0x2cc10c['options'][_0x4b5a('0x23')],function(_0x2d4fc8){return{'model':db[_0x2d4fc8['model']],'as':_0x2d4fc8['as'],'attributes':_0x2d4fc8[_0x4b5a('0x21')],'include':_0x2d4fc8[_0x4b5a('0x23')]?_['map'](_0x2d4fc8[_0x4b5a('0x23')],function(_0x2036c2){return{'model':db[_0x2036c2[_0x4b5a('0x25')]],'as':_0x2036c2['as'],'attributes':_0x2036c2[_0x4b5a('0x21')],'include':_0x2036c2[_0x4b5a('0x23')]?_[_0x4b5a('0x24')](_0x2036c2['include'],function(_0x517d99){return{'model':db[_0x517d99[_0x4b5a('0x25')]],'as':_0x517d99['as'],'attributes':_0x517d99[_0x4b5a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4b5a('0x26')](function(_0x51c187){logger['info'](_0x4b5a('0x1c'),_0x2cc10c);logger[_0x4b5a('0x27')](_0x4b5a('0x1c'),_0x2cc10c,JSON['stringify'](_0x51c187));_0x402eb1(_0x51c187);})['catch'](function(_0x50eec4){logger[_0x4b5a('0x18')](_0x4b5a('0x1c'),_0x50eec4[_0x4b5a('0x1a')],_0x2cc10c);_0x5140c1(_0xa351fe[_0x4b5a('0x18')](0x1f4,_0x50eec4[_0x4b5a('0x1a')]));});});};exports[_0x4b5a('0x28')]=function(_0x37c954){var _0x809744=this;return new Promise(function(_0x497c36,_0x1604a9){return db[_0x4b5a('0x1d')][_0x4b5a('0x29')]({'raw':_0x37c954[_0x4b5a('0x1f')]?_0x37c954[_0x4b5a('0x1f')][_0x4b5a('0x2a')]===undefined?!![]:![]:!![],'where':_0x37c954[_0x4b5a('0x1f')]?_0x37c954[_0x4b5a('0x1f')][_0x4b5a('0x20')]||null:null,'attributes':_0x37c954['options']?_0x37c954[_0x4b5a('0x1f')][_0x4b5a('0x21')]||null:null,'include':_0x37c954[_0x4b5a('0x1f')]?_0x37c954['options']['include']?_[_0x4b5a('0x24')](_0x37c954['options']['include'],function(_0x3a6a76){return{'model':db[_0x3a6a76[_0x4b5a('0x25')]],'as':_0x3a6a76['as'],'attributes':_0x3a6a76['attributes'],'include':_0x3a6a76['include']?_['map'](_0x3a6a76[_0x4b5a('0x23')],function(_0x22ff8b){return{'model':db[_0x22ff8b[_0x4b5a('0x25')]],'as':_0x22ff8b['as'],'attributes':_0x22ff8b['attributes'],'include':_0x22ff8b['include']?_[_0x4b5a('0x24')](_0x22ff8b[_0x4b5a('0x23')],function(_0x5ce35e){return{'model':db[_0x5ce35e[_0x4b5a('0x25')]],'as':_0x5ce35e['as'],'attributes':_0x5ce35e[_0x4b5a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4b5a('0x26')](function(_0x283727){logger[_0x4b5a('0x13')](_0x4b5a('0x28'),_0x37c954);logger[_0x4b5a('0x27')](_0x4b5a('0x28'),_0x37c954,JSON[_0x4b5a('0x17')](_0x283727));_0x497c36(_0x283727);})[_0x4b5a('0x2b')](function(_0x1caaa5){logger[_0x4b5a('0x18')]('ShowChatQueue',_0x1caaa5[_0x4b5a('0x1a')],_0x37c954);_0x1604a9(_0x809744[_0x4b5a('0x18')](0x1f4,_0x1caaa5[_0x4b5a('0x1a')]));});});};
\ No newline at end of file
+var _0x2b4a=['raw','where','limit','include','map','attributes','model','ChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b4a,0x13e));var _0xa2b4=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x2b4a[_0x2e04ef];return _0x5722b0;};'use strict';var _=require(_0xa2b4('0x0'));var util=require(_0xa2b4('0x1'));var moment=require(_0xa2b4('0x2'));var BPromise=require(_0xa2b4('0x3'));var rs=require(_0xa2b4('0x4'));var fs=require('fs');var Redis=require(_0xa2b4('0x5'));var db=require(_0xa2b4('0x6'))['db'];var utils=require(_0xa2b4('0x7'));var logger=require('../../config/logger')(_0xa2b4('0x8'));var config=require(_0xa2b4('0x9'));var jayson=require(_0xa2b4('0xa'));var client=jayson[_0xa2b4('0xb')]['http']({'port':0x232a});config[_0xa2b4('0xc')]=_[_0xa2b4('0xd')](config['redis'],{'host':_0xa2b4('0xe'),'port':0x18eb});var socket=require(_0xa2b4('0xf'))(new Redis(config[_0xa2b4('0xc')]));require(_0xa2b4('0x10'))[_0xa2b4('0x11')](socket);function respondWithRpcPromise(_0x20619e,_0x5e5cb0,_0x5f5abc){return new BPromise(function(_0xfda0b6,_0x4c2f17){return client[_0xa2b4('0x12')](_0x20619e,_0x5f5abc)[_0xa2b4('0x13')](function(_0x2913ce){logger[_0xa2b4('0x14')](_0xa2b4('0x15'),_0x5e5cb0,_0xa2b4('0x16'));logger[_0xa2b4('0x17')](_0xa2b4('0x18'),_0x5e5cb0,_0xa2b4('0x16'),JSON[_0xa2b4('0x19')](_0x2913ce));if(_0x2913ce[_0xa2b4('0x1a')]){if(_0x2913ce[_0xa2b4('0x1a')][_0xa2b4('0x1b')]===0x1f4){logger[_0xa2b4('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x5e5cb0,_0x2913ce[_0xa2b4('0x1a')][_0xa2b4('0x1c')]);return _0x4c2f17(_0x2913ce[_0xa2b4('0x1a')][_0xa2b4('0x1c')]);}logger[_0xa2b4('0x1a')](_0xa2b4('0x15'),_0x5e5cb0,_0x2913ce['error'][_0xa2b4('0x1c')]);return _0xfda0b6(_0x2913ce[_0xa2b4('0x1a')][_0xa2b4('0x1c')]);}else{logger[_0xa2b4('0x14')]('ChatQueue,\x20%s,\x20%s',_0x5e5cb0,_0xa2b4('0x16'));_0xfda0b6(_0x2913ce[_0xa2b4('0x1d')][_0xa2b4('0x1c')]);}})[_0xa2b4('0x1e')](function(_0x6ed641){logger['error'](_0xa2b4('0x15'),_0x5e5cb0,_0x6ed641);_0x4c2f17(_0x6ed641);});});}exports[_0xa2b4('0x1f')]=function(_0x28b194){var _0x426e4e=this;return new Promise(function(_0x4e41f0,_0x57b56e){return db['ChatQueue'][_0xa2b4('0x20')]({'raw':_0x28b194['options']?_0x28b194[_0xa2b4('0x21')][_0xa2b4('0x22')]===undefined?!![]:![]:!![],'where':_0x28b194[_0xa2b4('0x21')]?_0x28b194[_0xa2b4('0x21')][_0xa2b4('0x23')]||null:null,'attributes':_0x28b194['options']?_0x28b194[_0xa2b4('0x21')]['attributes']||null:null,'limit':_0x28b194['options']?_0x28b194['options'][_0xa2b4('0x24')]||null:null,'include':_0x28b194[_0xa2b4('0x21')]?_0x28b194[_0xa2b4('0x21')][_0xa2b4('0x25')]?_[_0xa2b4('0x26')](_0x28b194['options'][_0xa2b4('0x25')],function(_0x369a4d){return{'model':db[_0x369a4d['model']],'as':_0x369a4d['as'],'attributes':_0x369a4d['attributes'],'include':_0x369a4d[_0xa2b4('0x25')]?_[_0xa2b4('0x26')](_0x369a4d[_0xa2b4('0x25')],function(_0xc716b1){return{'model':db[_0xc716b1['model']],'as':_0xc716b1['as'],'attributes':_0xc716b1[_0xa2b4('0x27')],'include':_0xc716b1['include']?_['map'](_0xc716b1[_0xa2b4('0x25')],function(_0x5cabc4){return{'model':db[_0x5cabc4[_0xa2b4('0x28')]],'as':_0x5cabc4['as'],'attributes':_0x5cabc4[_0xa2b4('0x27')]};}):[]};}):[]};}):[]:[]})[_0xa2b4('0x13')](function(_0x3eb9e8){logger[_0xa2b4('0x14')]('GetChatQueue',_0x28b194);logger['debug'](_0xa2b4('0x1f'),_0x28b194,JSON[_0xa2b4('0x19')](_0x3eb9e8));_0x4e41f0(_0x3eb9e8);})[_0xa2b4('0x1e')](function(_0x7e2950){logger[_0xa2b4('0x1a')]('GetChatQueue',_0x7e2950[_0xa2b4('0x1c')],_0x28b194);_0x57b56e(_0x426e4e['error'](0x1f4,_0x7e2950[_0xa2b4('0x1c')]));});});};exports['ShowChatQueue']=function(_0x4f83a8){var _0x67f6ee=this;return new Promise(function(_0x453b0f,_0x20447a){return db[_0xa2b4('0x29')][_0xa2b4('0x2a')]({'raw':_0x4f83a8['options']?_0x4f83a8[_0xa2b4('0x21')][_0xa2b4('0x22')]===undefined?!![]:![]:!![],'where':_0x4f83a8[_0xa2b4('0x21')]?_0x4f83a8[_0xa2b4('0x21')][_0xa2b4('0x23')]||null:null,'attributes':_0x4f83a8[_0xa2b4('0x21')]?_0x4f83a8['options']['attributes']||null:null,'include':_0x4f83a8[_0xa2b4('0x21')]?_0x4f83a8['options']['include']?_['map'](_0x4f83a8['options']['include'],function(_0x35c11e){return{'model':db[_0x35c11e['model']],'as':_0x35c11e['as'],'attributes':_0x35c11e['attributes'],'include':_0x35c11e[_0xa2b4('0x25')]?_[_0xa2b4('0x26')](_0x35c11e[_0xa2b4('0x25')],function(_0x50a0fa){return{'model':db[_0x50a0fa[_0xa2b4('0x28')]],'as':_0x50a0fa['as'],'attributes':_0x50a0fa['attributes'],'include':_0x50a0fa[_0xa2b4('0x25')]?_[_0xa2b4('0x26')](_0x50a0fa['include'],function(_0x5cfb47){return{'model':db[_0x5cfb47['model']],'as':_0x5cfb47['as'],'attributes':_0x5cfb47[_0xa2b4('0x27')]};}):[]};}):[]};}):[]:[]})[_0xa2b4('0x13')](function(_0x23db33){logger[_0xa2b4('0x14')](_0xa2b4('0x2b'),_0x4f83a8);logger[_0xa2b4('0x17')](_0xa2b4('0x2b'),_0x4f83a8,JSON[_0xa2b4('0x19')](_0x23db33));_0x453b0f(_0x23db33);})[_0xa2b4('0x1e')](function(_0x443eb1){logger['error'](_0xa2b4('0x2b'),_0x443eb1['message'],_0x4f83a8);_0x20447a(_0x67f6ee['error'](0x1f4,_0x443eb1[_0xa2b4('0x1c')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 766399f..3722ec6 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 _0x0e85=['update','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x4db751,_0x1af8ef){var _0x386732=function(_0x3a4412){while(--_0x3a4412){_0x4db751['push'](_0x4db751['shift']());}};_0x386732(++_0x1af8ef);}(_0x0e85,0x7c));var _0x50e8=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x0e85[_0x3740fe];return _0x55492b;};'use strict';var ChatQueueEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatQueueEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatQueueEvents['on'](_0x108edc,_0x42665e);}};
\ No newline at end of file
+var _0xdace=['remove','update','emit','register','length','./chatQueue.events'];(function(_0x1c3863,_0x3d9c0e){var _0x1110f4=function(_0x31602e){while(--_0x31602e){_0x1c3863['push'](_0x1c3863['shift']());}};_0x1110f4(++_0x3d9c0e);}(_0xdace,0xc5));var _0xedac=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0xdace[_0x574617];return _0x29de90;};'use strict';var ChatQueueEvents=require(_0xedac('0x0'));var events=['save',_0xedac('0x1'),_0xedac('0x2')];function createListener(_0x46eba0,_0x518516){return function(_0x413d77){_0x518516[_0xedac('0x3')](_0x46eba0,_0x413d77);};}function removeListener(_0x15d3bd,_0xefb142){return function(){ChatQueueEvents['removeListener'](_0x15d3bd,_0xefb142);};}exports[_0xedac('0x4')]=function(_0x1cba89){for(var _0x39328a=0x0,_0x5ecbd3=events[_0xedac('0x5')];_0x39328a<_0x5ecbd3;_0x39328a++){var _0x21440e=events[_0x39328a];var _0x162eea=createListener('chatQueue:'+_0x21440e,_0x1cba89);ChatQueueEvents['on'](_0x21440e,_0x162eea);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 99eef48..e4d4c26 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1fba66,_0x5407f3){var _0x2b3f89=function(_0x41f0ff){while(--_0x41f0ff){_0x1fba66['push'](_0x1fba66['shift']());}};_0x2b3f89(++_0x5407f3);}(_0x7217,0x19e));var _0x7721=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x7217[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x56b495,_0x535ede){var _0x21943f=function(_0x5cab79){while(--_0x5cab79){_0x56b495['push'](_0x56b495['shift']());}};_0x21943f(++_0x535ede);}(_0xe14b,0x93));var _0xbe14=function(_0x2e697c,_0xc8720){_0x2e697c=_0x2e697c-0x0;var _0x4e558b=_0xe14b[_0x2e697c];return _0x4e558b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 3921165..7ae0acb 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 _0x793d=['sequelize','exports','STRING','DATE','moment'];(function(_0x1d9428,_0x5021a0){var _0x162843=function(_0x97c9c2){while(--_0x97c9c2){_0x1d9428['push'](_0x1d9428['shift']());}};_0x162843(++_0x5021a0);}(_0x793d,0x15d));var _0xd793=function(_0x2cf360,_0xf8915e){_0x2cf360=_0x2cf360-0x0;var _0x222778=_0x793d[_0x2cf360];return _0x222778;};'use strict';var moment=require(_0xd793('0x0'));var Sequelize=require(_0xd793('0x1'));module[_0xd793('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd793('0x3')]},'joinAt':{'type':Sequelize[_0xd793('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd793('0x4')]},'exitAt':{'type':Sequelize[_0xd793('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xac4b=['moment','sequelize','exports','DATE','STRING'];(function(_0x1103e6,_0x3a0217){var _0x5bc0ef=function(_0x3e979b){while(--_0x3e979b){_0x1103e6['push'](_0x1103e6['shift']());}};_0x5bc0ef(++_0x3a0217);}(_0xac4b,0xb4));var _0xbac4=function(_0x160661,_0x33ffa0){_0x160661=_0x160661-0x0;var _0x2bd307=_0xac4b[_0x160661];return _0x2bd307;};'use strict';var moment=require(_0xbac4('0x0'));var Sequelize=require(_0xbac4('0x1'));module[_0xbac4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbac4('0x3')]},'leaveAt':{'type':Sequelize[_0xbac4('0x3')]},'acceptAt':{'type':Sequelize[_0xbac4('0x3')]},'exitAt':{'type':Sequelize[_0xbac4('0x3')]},'reason':{'type':Sequelize[_0xbac4('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index df35df9..40f0cfc 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 _0xb89c=['status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','nolimit','sort','pick','merge','where','filter','options','include','rows','catch','show','keys','intersection','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x389f40,_0x13c234){var _0x41a331=function(_0x1edece){while(--_0x1edece){_0x389f40['push'](_0x389f40['shift']());}};_0x41a331(++_0x13c234);}(_0xb89c,0x198));var _0xcb89=function(_0x4fd209,_0x334f60){_0x4fd209=_0x4fd209-0x0;var _0x2c5064=_0xb89c[_0x4fd209];return _0x2c5064;};'use strict';var emlformat=require(_0xcb89('0x0'));var rimraf=require(_0xcb89('0x1'));var zipdir=require(_0xcb89('0x2'));var jsonpatch=require(_0xcb89('0x3'));var rp=require('request-promise');var moment=require(_0xcb89('0x4'));var BPromise=require(_0xcb89('0x5'));var Mustache=require('mustache');var util=require(_0xcb89('0x6'));var path=require(_0xcb89('0x7'));var sox=require(_0xcb89('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb89('0x9'));var _=require(_0xcb89('0xa'));var squel=require(_0xcb89('0xb'));var crypto=require('crypto');var jsforce=require(_0xcb89('0xc'));var deskjs=require(_0xcb89('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcb89('0xe'));var Redis=require('ioredis');var authService=require(_0xcb89('0xf'));var qs=require(_0xcb89('0x10'));var as=require(_0xcb89('0x11'));var hardwareService=require(_0xcb89('0x12'));var logger=require(_0xcb89('0x13'))(_0xcb89('0x14'));var utils=require('../../config/utils');var config=require(_0xcb89('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb89('0x16'))['db'];function respondWithStatusCode(_0xf61a78,_0x31dbd7){_0x31dbd7=_0x31dbd7||0xcc;return function(_0x363de1){if(_0x363de1){return _0xf61a78[_0xcb89('0x17')](_0x31dbd7);}return _0xf61a78[_0xcb89('0x18')](_0x31dbd7)[_0xcb89('0x19')]();};}function respondWithResult(_0x53774a,_0x33f09a){_0x33f09a=_0x33f09a||0xc8;return function(_0x90a9eb){if(_0x90a9eb){return _0x53774a['status'](_0x33f09a)[_0xcb89('0x1a')](_0x90a9eb);}};}function respondWithFilteredResult(_0x15c35e,_0x1805fa){return function(_0x50a395){if(_0x50a395){var _0x8b9afa=typeof _0x1805fa['offset']==='undefined'&&typeof _0x1805fa[_0xcb89('0x1b')]===_0xcb89('0x1c');var _0x254d38=_0x50a395[_0xcb89('0x1d')];var _0x3ace69=_0x8b9afa?0x0:_0x1805fa[_0xcb89('0x1e')];var _0x1d99bd=_0x8b9afa?_0x50a395[_0xcb89('0x1d')]:_0x1805fa['offset']+_0x1805fa[_0xcb89('0x1b')];var _0x2bcb0b;if(_0x1d99bd>=_0x254d38){_0x1d99bd=_0x254d38;_0x2bcb0b=0xc8;}else{_0x2bcb0b=0xce;}_0x15c35e['status'](_0x2bcb0b);return _0x15c35e['set'](_0xcb89('0x1f'),_0x3ace69+'-'+_0x1d99bd+'/'+_0x254d38)[_0xcb89('0x1a')](_0x50a395);}return null;};}function patchUpdates(_0x1bbf3f){return function(_0x7a2f38){try{jsonpatch[_0xcb89('0x20')](_0x7a2f38,_0x1bbf3f,!![]);}catch(_0x355994){return BPromise[_0xcb89('0x21')](_0x355994);}return _0x7a2f38[_0xcb89('0x22')]();};}function saveUpdates(_0x5e547c,_0x1ae8e0){return function(_0x1dc399){if(_0x1dc399){return _0x1dc399[_0xcb89('0x23')](_0x5e547c)[_0xcb89('0x24')](function(_0x5d164c){return _0x5d164c;});}return null;};}function removeEntity(_0x136ecb,_0x4e81e2){return function(_0x189ada){if(_0x189ada){return _0x189ada['destroy']()[_0xcb89('0x24')](function(){_0x136ecb[_0xcb89('0x18')](0xcc)[_0xcb89('0x19')]();});}};}function handleEntityNotFound(_0x52bed3,_0x3b4d44){return function(_0x6925c7){if(!_0x6925c7){_0x52bed3[_0xcb89('0x17')](0x194);}return _0x6925c7;};}function handleError(_0x25b797,_0x7dc2d2){_0x7dc2d2=_0x7dc2d2||0x1f4;return function(_0x8febfd){logger[_0xcb89('0x25')](_0x8febfd[_0xcb89('0x26')]);if(_0x8febfd[_0xcb89('0x27')]){delete _0x8febfd['name'];}_0x25b797[_0xcb89('0x18')](_0x7dc2d2)['send'](_0x8febfd);};}exports[_0xcb89('0x28')]=function(_0x557dd4,_0x52eb25){var _0x185676={},_0x407daa={},_0x3b0c71={'count':0x0,'rows':[]};var _0x16059d=_[_0xcb89('0x29')](db[_0xcb89('0x2a')][_0xcb89('0x2b')],function(_0x240258){return{'name':_0x240258[_0xcb89('0x2c')],'type':_0x240258[_0xcb89('0x2d')][_0xcb89('0x2e')]};});_0x407daa['model']=_['map'](_0x16059d,_0xcb89('0x27'));_0x407daa[_0xcb89('0x2f')]=_['keys'](_0x557dd4[_0xcb89('0x2f')]);_0x407daa[_0xcb89('0x30')]=_['intersection'](_0x407daa[_0xcb89('0x31')],_0x407daa[_0xcb89('0x2f')]);_0x185676[_0xcb89('0x32')]=_['intersection'](_0x407daa[_0xcb89('0x31')],qs['fields'](_0x557dd4['query'][_0xcb89('0x33')]));_0x185676[_0xcb89('0x32')]=_0x185676[_0xcb89('0x32')]['length']?_0x185676[_0xcb89('0x32')]:_0x407daa[_0xcb89('0x31')];if(!_0x557dd4[_0xcb89('0x2f')]['hasOwnProperty'](_0xcb89('0x34'))){_0x185676[_0xcb89('0x1b')]=qs[_0xcb89('0x1b')](_0x557dd4[_0xcb89('0x2f')][_0xcb89('0x1b')]);_0x185676[_0xcb89('0x1e')]=qs['offset'](_0x557dd4[_0xcb89('0x2f')][_0xcb89('0x1e')]);}_0x185676['order']=qs[_0xcb89('0x35')](_0x557dd4[_0xcb89('0x2f')][_0xcb89('0x35')]);_0x185676['where']=qs[_0xcb89('0x30')](_[_0xcb89('0x36')](_0x557dd4[_0xcb89('0x2f')],_0x407daa[_0xcb89('0x30')]),_0x16059d);if(_0x557dd4[_0xcb89('0x2f')]['filter']){_0x185676['where']=_[_0xcb89('0x37')](_0x185676[_0xcb89('0x38')],{'$or':_[_0xcb89('0x29')](_0x16059d,function(_0x282fa3){if(_0x282fa3['type']!=='VIRTUAL'){var _0x1890e1={};_0x1890e1[_0x282fa3['name']]={'$like':'%'+_0x557dd4[_0xcb89('0x2f')][_0xcb89('0x39')]+'%'};return _0x1890e1;}})});}_0x185676=_[_0xcb89('0x37')]({},_0x185676,_0x557dd4[_0xcb89('0x3a')]);var _0x599b29={'where':_0x185676[_0xcb89('0x38')]};return db[_0xcb89('0x2a')][_0xcb89('0x1d')](_0x599b29)[_0xcb89('0x24')](function(_0x1b5082){_0x3b0c71[_0xcb89('0x1d')]=_0x1b5082;if(_0x557dd4[_0xcb89('0x2f')]['includeAll']){_0x185676[_0xcb89('0x3b')]=[{'all':!![]}];}return db[_0xcb89('0x2a')]['findAll'](_0x185676);})[_0xcb89('0x24')](function(_0x49c3a9){_0x3b0c71[_0xcb89('0x3c')]=_0x49c3a9;return _0x3b0c71;})[_0xcb89('0x24')](respondWithFilteredResult(_0x52eb25,_0x185676))[_0xcb89('0x3d')](handleError(_0x52eb25,null));};exports[_0xcb89('0x3e')]=function(_0x3a6b1e,_0x356e8f){var _0x5cc614={'raw':!![],'where':{'id':_0x3a6b1e['params']['id']}},_0x483150={};_0x483150[_0xcb89('0x31')]=_[_0xcb89('0x3f')](db[_0xcb89('0x2a')][_0xcb89('0x2b')]);_0x483150['query']=_[_0xcb89('0x3f')](_0x3a6b1e[_0xcb89('0x2f')]);_0x483150['filters']=_['intersection'](_0x483150[_0xcb89('0x31')],_0x483150[_0xcb89('0x2f')]);_0x5cc614[_0xcb89('0x32')]=_[_0xcb89('0x40')](_0x483150['model'],qs[_0xcb89('0x33')](_0x3a6b1e[_0xcb89('0x2f')][_0xcb89('0x33')]));_0x5cc614[_0xcb89('0x32')]=_0x5cc614['attributes'][_0xcb89('0x41')]?_0x5cc614['attributes']:_0x483150[_0xcb89('0x31')];if(_0x3a6b1e[_0xcb89('0x2f')][_0xcb89('0x42')]){_0x5cc614[_0xcb89('0x3b')]=[{'all':!![]}];}_0x5cc614=_[_0xcb89('0x37')]({},_0x5cc614,_0x3a6b1e['options']);return db[_0xcb89('0x2a')][_0xcb89('0x43')](_0x5cc614)['then'](handleEntityNotFound(_0x356e8f,null))[_0xcb89('0x24')](respondWithResult(_0x356e8f,null))[_0xcb89('0x3d')](handleError(_0x356e8f,null));};exports['create']=function(_0x4bb31e,_0x3775b3){return db[_0xcb89('0x2a')][_0xcb89('0x44')](_0x4bb31e[_0xcb89('0x45')],{})[_0xcb89('0x24')](respondWithResult(_0x3775b3,0xc9))[_0xcb89('0x3d')](handleError(_0x3775b3,null));};exports[_0xcb89('0x23')]=function(_0x295f08,_0x484585){if(_0x295f08[_0xcb89('0x45')]['id']){delete _0x295f08[_0xcb89('0x45')]['id'];}return db['ChatQueueReport'][_0xcb89('0x43')]({'where':{'id':_0x295f08['params']['id']}})[_0xcb89('0x24')](handleEntityNotFound(_0x484585,null))[_0xcb89('0x24')](saveUpdates(_0x295f08[_0xcb89('0x45')],null))[_0xcb89('0x24')](respondWithResult(_0x484585,null))['catch'](handleError(_0x484585,null));};exports['destroy']=function(_0x1fb950,_0x40dc8e){return db[_0xcb89('0x2a')][_0xcb89('0x43')]({'where':{'id':_0x1fb950[_0xcb89('0x46')]['id']}})[_0xcb89('0x24')](handleEntityNotFound(_0x40dc8e,null))[_0xcb89('0x24')](removeEntity(_0x40dc8e,null))[_0xcb89('0x3d')](handleError(_0x40dc8e,null));};exports[_0xcb89('0x47')]=function(_0x56da18,_0x1dc709){return db[_0xcb89('0x2a')][_0xcb89('0x47')]()['then'](respondWithResult(_0x1dc709,null))[_0xcb89('0x3d')](handleError(_0x1dc709,null));};
\ No newline at end of file
+var _0x229c=['rimraf','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','end','error','stack','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','describe'];(function(_0x4ce19b,_0xbba834){var _0x617495=function(_0xb5c941){while(--_0xb5c941){_0x4ce19b['push'](_0x4ce19b['shift']());}};_0x617495(++_0xbba834);}(_0x229c,0xcf));var _0xc229=function(_0x35fb43,_0x2ed757){_0x35fb43=_0x35fb43-0x0;var _0x379bda=_0x229c[_0x35fb43];return _0x379bda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc229('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc229('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc229('0x2'));var util=require('util');var path=require(_0xc229('0x3'));var sox=require(_0xc229('0x4'));var csv=require(_0xc229('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc229('0x6'));var _=require('lodash');var squel=require(_0xc229('0x7'));var crypto=require(_0xc229('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xc229('0x9'));var toCsv=require(_0xc229('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc229('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc229('0xb'));var hardwareService=require(_0xc229('0xc'));var logger=require(_0xc229('0xd'))(_0xc229('0xe'));var utils=require(_0xc229('0xf'));var config=require(_0xc229('0x10'));var licenseUtil=require(_0xc229('0x11'));var db=require(_0xc229('0x12'))['db'];function respondWithStatusCode(_0xf7cd15,_0x337ae0){_0x337ae0=_0x337ae0||0xcc;return function(_0x1faf37){if(_0x1faf37){return _0xf7cd15[_0xc229('0x13')](_0x337ae0);}return _0xf7cd15[_0xc229('0x14')](_0x337ae0)['end']();};}function respondWithResult(_0x36cfb4,_0x53ba7a){_0x53ba7a=_0x53ba7a||0xc8;return function(_0x6dd4c2){if(_0x6dd4c2){return _0x36cfb4[_0xc229('0x14')](_0x53ba7a)[_0xc229('0x15')](_0x6dd4c2);}};}function respondWithFilteredResult(_0x1cc8ed,_0x1d9efd){return function(_0x7b71c3){if(_0x7b71c3){var _0x292f30=typeof _0x1d9efd[_0xc229('0x16')]===_0xc229('0x17')&&typeof _0x1d9efd[_0xc229('0x18')]===_0xc229('0x17');var _0x11771e=_0x7b71c3[_0xc229('0x19')];var _0x4cae05=_0x292f30?0x0:_0x1d9efd[_0xc229('0x16')];var _0x10339a=_0x292f30?_0x7b71c3[_0xc229('0x19')]:_0x1d9efd[_0xc229('0x16')]+_0x1d9efd[_0xc229('0x18')];var _0x14ef5e;if(_0x10339a>=_0x11771e){_0x10339a=_0x11771e;_0x14ef5e=0xc8;}else{_0x14ef5e=0xce;}_0x1cc8ed[_0xc229('0x14')](_0x14ef5e);return _0x1cc8ed['set']('Content-Range',_0x4cae05+'-'+_0x10339a+'/'+_0x11771e)[_0xc229('0x15')](_0x7b71c3);}return null;};}function patchUpdates(_0x53dbba){return function(_0x46b7b0){try{jsonpatch[_0xc229('0x1a')](_0x46b7b0,_0x53dbba,!![]);}catch(_0x55691a){return BPromise['reject'](_0x55691a);}return _0x46b7b0[_0xc229('0x1b')]();};}function saveUpdates(_0x40d549,_0x3a9957){return function(_0x3b20af){if(_0x3b20af){return _0x3b20af[_0xc229('0x1c')](_0x40d549)[_0xc229('0x1d')](function(_0x6e7910){return _0x6e7910;});}return null;};}function removeEntity(_0x50fd02,_0x5cb52f){return function(_0x8c4f83){if(_0x8c4f83){return _0x8c4f83[_0xc229('0x1e')]()['then'](function(){_0x50fd02['status'](0xcc)[_0xc229('0x1f')]();});}};}function handleEntityNotFound(_0x30c711,_0x12a5b8){return function(_0x190e58){if(!_0x190e58){_0x30c711[_0xc229('0x13')](0x194);}return _0x190e58;};}function handleError(_0x268546,_0x5a05b3){_0x5a05b3=_0x5a05b3||0x1f4;return function(_0x103d43){logger[_0xc229('0x20')](_0x103d43[_0xc229('0x21')]);if(_0x103d43['name']){delete _0x103d43['name'];}_0x268546[_0xc229('0x14')](_0x5a05b3)['send'](_0x103d43);};}exports[_0xc229('0x22')]=function(_0x2a6e38,_0x2c5fbf){var _0x1a94ac={},_0xfa1ba2={},_0x34d258={'count':0x0,'rows':[]};var _0x1928b8=_[_0xc229('0x23')](db[_0xc229('0x24')][_0xc229('0x25')],function(_0x195be7){return{'name':_0x195be7[_0xc229('0x26')],'type':_0x195be7[_0xc229('0x27')][_0xc229('0x28')]};});_0xfa1ba2[_0xc229('0x29')]=_[_0xc229('0x23')](_0x1928b8,_0xc229('0x2a'));_0xfa1ba2[_0xc229('0x2b')]=_[_0xc229('0x2c')](_0x2a6e38[_0xc229('0x2b')]);_0xfa1ba2[_0xc229('0x2d')]=_['intersection'](_0xfa1ba2[_0xc229('0x29')],_0xfa1ba2['query']);_0x1a94ac[_0xc229('0x2e')]=_[_0xc229('0x2f')](_0xfa1ba2['model'],qs[_0xc229('0x30')](_0x2a6e38[_0xc229('0x2b')][_0xc229('0x30')]));_0x1a94ac[_0xc229('0x2e')]=_0x1a94ac[_0xc229('0x2e')][_0xc229('0x31')]?_0x1a94ac['attributes']:_0xfa1ba2[_0xc229('0x29')];if(!_0x2a6e38[_0xc229('0x2b')][_0xc229('0x32')](_0xc229('0x33'))){_0x1a94ac[_0xc229('0x18')]=qs[_0xc229('0x18')](_0x2a6e38[_0xc229('0x2b')][_0xc229('0x18')]);_0x1a94ac[_0xc229('0x16')]=qs[_0xc229('0x16')](_0x2a6e38[_0xc229('0x2b')]['offset']);}_0x1a94ac[_0xc229('0x34')]=qs[_0xc229('0x35')](_0x2a6e38[_0xc229('0x2b')]['sort']);_0x1a94ac[_0xc229('0x36')]=qs[_0xc229('0x2d')](_['pick'](_0x2a6e38['query'],_0xfa1ba2[_0xc229('0x2d')]),_0x1928b8);if(_0x2a6e38['query']['filter']){_0x1a94ac['where']=_[_0xc229('0x37')](_0x1a94ac['where'],{'$or':_['map'](_0x1928b8,function(_0x19b4a8){if(_0x19b4a8['type']!==_0xc229('0x38')){var _0x3f0008={};_0x3f0008[_0x19b4a8[_0xc229('0x2a')]]={'$like':'%'+_0x2a6e38[_0xc229('0x2b')][_0xc229('0x39')]+'%'};return _0x3f0008;}})});}_0x1a94ac=_['merge']({},_0x1a94ac,_0x2a6e38[_0xc229('0x3a')]);var _0x4f9912={'where':_0x1a94ac[_0xc229('0x36')]};return db[_0xc229('0x24')][_0xc229('0x19')](_0x4f9912)[_0xc229('0x1d')](function(_0x2c352b){_0x34d258[_0xc229('0x19')]=_0x2c352b;if(_0x2a6e38['query'][_0xc229('0x3b')]){_0x1a94ac[_0xc229('0x3c')]=[{'all':!![]}];}return db[_0xc229('0x24')][_0xc229('0x3d')](_0x1a94ac);})[_0xc229('0x1d')](function(_0x48e504){_0x34d258['rows']=_0x48e504;return _0x34d258;})[_0xc229('0x1d')](respondWithFilteredResult(_0x2c5fbf,_0x1a94ac))[_0xc229('0x3e')](handleError(_0x2c5fbf,null));};exports[_0xc229('0x3f')]=function(_0x1deb7b,_0x553386){var _0x109b37={'raw':!![],'where':{'id':_0x1deb7b[_0xc229('0x40')]['id']}},_0x192f0d={};_0x192f0d[_0xc229('0x29')]=_[_0xc229('0x2c')](db[_0xc229('0x24')][_0xc229('0x25')]);_0x192f0d['query']=_['keys'](_0x1deb7b[_0xc229('0x2b')]);_0x192f0d[_0xc229('0x2d')]=_[_0xc229('0x2f')](_0x192f0d[_0xc229('0x29')],_0x192f0d[_0xc229('0x2b')]);_0x109b37[_0xc229('0x2e')]=_[_0xc229('0x2f')](_0x192f0d[_0xc229('0x29')],qs[_0xc229('0x30')](_0x1deb7b[_0xc229('0x2b')]['fields']));_0x109b37[_0xc229('0x2e')]=_0x109b37['attributes'][_0xc229('0x31')]?_0x109b37[_0xc229('0x2e')]:_0x192f0d[_0xc229('0x29')];if(_0x1deb7b['query'][_0xc229('0x3b')]){_0x109b37['include']=[{'all':!![]}];}_0x109b37=_[_0xc229('0x37')]({},_0x109b37,_0x1deb7b[_0xc229('0x3a')]);return db[_0xc229('0x24')]['find'](_0x109b37)[_0xc229('0x1d')](handleEntityNotFound(_0x553386,null))[_0xc229('0x1d')](respondWithResult(_0x553386,null))[_0xc229('0x3e')](handleError(_0x553386,null));};exports[_0xc229('0x41')]=function(_0x2f3cc,_0x7d7799){return db[_0xc229('0x24')][_0xc229('0x41')](_0x2f3cc[_0xc229('0x42')],{})[_0xc229('0x1d')](respondWithResult(_0x7d7799,0xc9))[_0xc229('0x3e')](handleError(_0x7d7799,null));};exports[_0xc229('0x1c')]=function(_0x13f449,_0x41d94c){if(_0x13f449[_0xc229('0x42')]['id']){delete _0x13f449[_0xc229('0x42')]['id'];}return db[_0xc229('0x24')][_0xc229('0x43')]({'where':{'id':_0x13f449[_0xc229('0x40')]['id']}})[_0xc229('0x1d')](handleEntityNotFound(_0x41d94c,null))['then'](saveUpdates(_0x13f449['body'],null))[_0xc229('0x1d')](respondWithResult(_0x41d94c,null))[_0xc229('0x3e')](handleError(_0x41d94c,null));};exports[_0xc229('0x1e')]=function(_0x442dbe,_0x5c043c){return db['ChatQueueReport'][_0xc229('0x43')]({'where':{'id':_0x442dbe['params']['id']}})[_0xc229('0x1d')](handleEntityNotFound(_0x5c043c,null))['then'](removeEntity(_0x5c043c,null))[_0xc229('0x3e')](handleError(_0x5c043c,null));};exports[_0xc229('0x44')]=function(_0x47fd5c,_0x3df335){return db[_0xc229('0x24')][_0xc229('0x44')]()['then'](respondWithResult(_0x3df335,null))[_0xc229('0x3e')](handleError(_0x3df335,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 1950e4d..1bdedd1 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x16b737,_0x16d0cb){var _0x3405fa=function(_0x389d5b){while(--_0x389d5b){_0x16b737['push'](_0x16b737['shift']());}};_0x3405fa(++_0x16d0cb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb7e7[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'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(_0x380356,_0x44304f){var _0x542fb4=function(_0x132eec){while(--_0x132eec){_0x380356['push'](_0x380356['shift']());}};_0x542fb4(++_0x44304f);}(_0xe706,0xa3));var _0x6e70=function(_0x5aa992,_0x559ebb){_0x5aa992=_0x5aa992-0x0;var _0x2e2d59=_0xe706[_0x5aa992];return _0x2e2d59;};'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 4f7f32f..f45acef 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 _0x756e=['request','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','update','where','attributes','limit','UpdateChatQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2917f0,_0x1cd7fb){var _0x41602e=function(_0xb196e3){while(--_0xb196e3){_0x2917f0['push'](_0x2917f0['shift']());}};_0x41602e(++_0x1cd7fb);}(_0x756e,0x18d));var _0xe756=function(_0x52f871,_0x4091eb){_0x52f871=_0x52f871-0x0;var _0x4e380f=_0x756e[_0x52f871];return _0x4e380f;};'use strict';var _=require('lodash');var util=require(_0xe756('0x0'));var moment=require('moment');var BPromise=require(_0xe756('0x1'));var rs=require(_0xe756('0x2'));var fs=require('fs');var Redis=require(_0xe756('0x3'));var db=require(_0xe756('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe756('0x5'))(_0xe756('0x6'));var config=require(_0xe756('0x7'));var jayson=require(_0xe756('0x8'));var client=jayson[_0xe756('0x9')][_0xe756('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ee1e6,_0x3e47e6,_0x1f0738){return new BPromise(function(_0x134ba7,_0x381dba){return client[_0xe756('0xb')](_0x2ee1e6,_0x1f0738)['then'](function(_0xc6a946){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x3e47e6,_0xe756('0xc'));logger[_0xe756('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3e47e6,_0xe756('0xc'),JSON[_0xe756('0xe')](_0xc6a946));if(_0xc6a946[_0xe756('0xf')]){if(_0xc6a946[_0xe756('0xf')][_0xe756('0x10')]===0x1f4){logger[_0xe756('0xf')](_0xe756('0x11'),_0x3e47e6,_0xc6a946['error']['message']);return _0x381dba(_0xc6a946[_0xe756('0xf')][_0xe756('0x12')]);}logger[_0xe756('0xf')](_0xe756('0x11'),_0x3e47e6,_0xc6a946[_0xe756('0xf')][_0xe756('0x12')]);return _0x134ba7(_0xc6a946[_0xe756('0xf')][_0xe756('0x12')]);}else{logger[_0xe756('0x13')](_0xe756('0x11'),_0x3e47e6,_0xe756('0xc'));_0x134ba7(_0xc6a946[_0xe756('0x14')][_0xe756('0x12')]);}})[_0xe756('0x15')](function(_0x557b5c){logger['error'](_0xe756('0x11'),_0x3e47e6,_0x557b5c);_0x381dba(_0x557b5c);});});}exports['CreateChatQueueReport']=function(_0x31b538){var _0x2f0638=this;return new Promise(function(_0x381f49,_0x2d20b3){return db[_0xe756('0x16')][_0xe756('0x17')](_0x31b538[_0xe756('0x18')],{'raw':_0x31b538[_0xe756('0x19')]?_0x31b538[_0xe756('0x19')][_0xe756('0x1a')]===undefined?!![]:![]:!![]})[_0xe756('0x1b')](function(_0x269bdd){logger['info'](_0xe756('0x1c'),_0x31b538);logger[_0xe756('0xd')](_0xe756('0x1c'),_0x31b538,JSON[_0xe756('0xe')](_0x269bdd));_0x381f49(_0x269bdd);})[_0xe756('0x15')](function(_0x1d9383){logger[_0xe756('0xf')](_0xe756('0x1c'),_0x1d9383[_0xe756('0x12')],_0x31b538);_0x2d20b3(_0x2f0638[_0xe756('0xf')](0x1f4,_0x1d9383['message']));});});};exports['UpdateChatQueueReport']=function(_0xacf91){var _0x5b82eb=this;return new Promise(function(_0x146dbe,_0x576feb){return db['ChatQueueReport'][_0xe756('0x1d')](_0xacf91[_0xe756('0x18')],{'raw':_0xacf91[_0xe756('0x19')]?_0xacf91['options'][_0xe756('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xacf91['options']?_0xacf91['options'][_0xe756('0x1e')]||null:null,'attributes':_0xacf91[_0xe756('0x19')]?_0xacf91['options'][_0xe756('0x1f')]||null:null,'limit':_0xacf91['options']?_0xacf91['options'][_0xe756('0x20')]||null:null})[_0xe756('0x1b')](function(_0x1d7043){logger[_0xe756('0x13')](_0xe756('0x21'),_0xacf91);logger[_0xe756('0xd')](_0xe756('0x21'),_0xacf91,JSON[_0xe756('0xe')](_0x1d7043));_0x146dbe(_0x1d7043);})['catch'](function(_0x27b5b5){logger[_0xe756('0xf')]('UpdateChatQueueReport',_0x27b5b5[_0xe756('0x12')],_0xacf91);_0x576feb(_0x5b82eb['error'](0x1f4,_0x27b5b5[_0xe756('0x12')]));});});};
\ No newline at end of file
+var _0x3107=['client','http','request','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','limit','then','UpdateChatQueueReport','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x11e2ea,_0x1d81d6){var _0x446348=function(_0x2dfef1){while(--_0x2dfef1){_0x11e2ea['push'](_0x11e2ea['shift']());}};_0x446348(++_0x1d81d6);}(_0x3107,0x1b8));var _0x7310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3107[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7310('0x0'));var BPromise=require(_0x7310('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7310('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7310('0x3'));var logger=require(_0x7310('0x4'))(_0x7310('0x5'));var config=require(_0x7310('0x6'));var jayson=require(_0x7310('0x7'));var client=jayson[_0x7310('0x8')][_0x7310('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3895d9,_0x45cf32,_0x5bc976){return new BPromise(function(_0x30812e,_0x1a481d){return client[_0x7310('0xa')](_0x3895d9,_0x5bc976)['then'](function(_0x19bda8){logger[_0x7310('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x45cf32,'request\x20sent');logger[_0x7310('0xc')](_0x7310('0xd'),_0x45cf32,_0x7310('0xe'),JSON[_0x7310('0xf')](_0x19bda8));if(_0x19bda8[_0x7310('0x10')]){if(_0x19bda8[_0x7310('0x10')][_0x7310('0x11')]===0x1f4){logger[_0x7310('0x10')](_0x7310('0x12'),_0x45cf32,_0x19bda8[_0x7310('0x10')]['message']);return _0x1a481d(_0x19bda8[_0x7310('0x10')][_0x7310('0x13')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x45cf32,_0x19bda8[_0x7310('0x10')][_0x7310('0x13')]);return _0x30812e(_0x19bda8[_0x7310('0x10')]['message']);}else{logger[_0x7310('0xb')](_0x7310('0x12'),_0x45cf32,_0x7310('0xe'));_0x30812e(_0x19bda8[_0x7310('0x14')][_0x7310('0x13')]);}})['catch'](function(_0x1d0769){logger['error'](_0x7310('0x12'),_0x45cf32,_0x1d0769);_0x1a481d(_0x1d0769);});});}exports[_0x7310('0x15')]=function(_0x2fa1ca){var _0x36844e=this;return new Promise(function(_0xe43518,_0x538518){return db[_0x7310('0x16')][_0x7310('0x17')](_0x2fa1ca[_0x7310('0x18')],{'raw':_0x2fa1ca[_0x7310('0x19')]?_0x2fa1ca[_0x7310('0x19')][_0x7310('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1efda5){logger['info'](_0x7310('0x15'),_0x2fa1ca);logger[_0x7310('0xc')]('CreateChatQueueReport',_0x2fa1ca,JSON['stringify'](_0x1efda5));_0xe43518(_0x1efda5);})['catch'](function(_0x4511c2){logger[_0x7310('0x10')]('CreateChatQueueReport',_0x4511c2[_0x7310('0x13')],_0x2fa1ca);_0x538518(_0x36844e[_0x7310('0x10')](0x1f4,_0x4511c2[_0x7310('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x377d73){var _0x563f84=this;return new Promise(function(_0x5cb4a1,_0x125e30){return db[_0x7310('0x16')][_0x7310('0x1b')](_0x377d73[_0x7310('0x18')],{'raw':_0x377d73[_0x7310('0x19')]?_0x377d73[_0x7310('0x19')][_0x7310('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377d73[_0x7310('0x19')]?_0x377d73[_0x7310('0x19')]['where']||null:null,'attributes':_0x377d73[_0x7310('0x19')]?_0x377d73[_0x7310('0x19')]['attributes']||null:null,'limit':_0x377d73[_0x7310('0x19')]?_0x377d73[_0x7310('0x19')][_0x7310('0x1c')]||null:null})[_0x7310('0x1d')](function(_0x2cb1b5){logger[_0x7310('0xb')](_0x7310('0x1e'),_0x377d73);logger[_0x7310('0xc')](_0x7310('0x1e'),_0x377d73,JSON[_0x7310('0xf')](_0x2cb1b5));_0x5cb4a1(_0x2cb1b5);})[_0x7310('0x1f')](function(_0x57e516){logger[_0x7310('0x10')](_0x7310('0x1e'),_0x57e516[_0x7310('0x13')],_0x377d73);_0x125e30(_0x563f84['error'](0x1f4,_0x57e516[_0x7310('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 1c98743..821ad57 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 _0x5a8d=['index','/describe','describe','/:id','show','post','isAuthenticated','create','put','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x3942e0,_0x168622){var _0x377871=function(_0x46fe1c){while(--_0x46fe1c){_0x3942e0['push'](_0x3942e0['shift']());}};_0x377871(++_0x168622);}(_0x5a8d,0xac));var _0xd5a8=function(_0x1c8a2f,_0x45b2b8){_0x1c8a2f=_0x1c8a2f-0x0;var _0x469bd4=_0x5a8d[_0x1c8a2f];return _0x469bd4;};'use strict';var multer=require('multer');var util=require(_0xd5a8('0x0'));var path=require(_0xd5a8('0x1'));var timeout=require(_0xd5a8('0x2'));var express=require('express');var router=express[_0xd5a8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd5a8('0x4'));var interaction=require(_0xd5a8('0x5'));var config=require(_0xd5a8('0x6'));var controller=require(_0xd5a8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd5a8('0x8')]);router['get'](_0xd5a8('0x9'),auth['isAuthenticated'](),controller[_0xd5a8('0xa')]);router['get'](_0xd5a8('0xb'),auth['isAuthenticated'](),controller[_0xd5a8('0xc')]);router[_0xd5a8('0xd')]('/',auth[_0xd5a8('0xe')](),controller[_0xd5a8('0xf')]);router[_0xd5a8('0x10')](_0xd5a8('0xb'),auth[_0xd5a8('0xe')](),controller['update']);router['delete'](_0xd5a8('0xb'),auth[_0xd5a8('0xe')](),controller['destroy']);module[_0xd5a8('0x11')]=router;
\ No newline at end of file
+var _0xe3e6=['update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x49c5e7,_0x398f36){var _0x70bbae=function(_0x1e77d3){while(--_0x1e77d3){_0x49c5e7['push'](_0x49c5e7['shift']());}};_0x70bbae(++_0x398f36);}(_0xe3e6,0xd5));var _0x6e3e=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0xe3e6[_0x5bfa44];return _0x43815f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6e3e('0x0'));var timeout=require(_0x6e3e('0x1'));var express=require(_0x6e3e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6e3e('0x3'));var interaction=require(_0x6e3e('0x4'));var config=require(_0x6e3e('0x5'));var controller=require(_0x6e3e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6e3e('0x7')]);router[_0x6e3e('0x8')]('/describe',auth[_0x6e3e('0x9')](),controller['describe']);router['get'](_0x6e3e('0xa'),auth[_0x6e3e('0x9')](),controller[_0x6e3e('0xb')]);router[_0x6e3e('0xc')]('/',auth[_0x6e3e('0x9')](),controller[_0x6e3e('0xd')]);router[_0x6e3e('0xe')](_0x6e3e('0xa'),auth[_0x6e3e('0x9')](),controller[_0x6e3e('0xf')]);router[_0x6e3e('0x10')](_0x6e3e('0xa'),auth['isAuthenticated'](),controller[_0x6e3e('0x11')]);module[_0x6e3e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0814c3e..7799041 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2fbfe2,_0x29310a){var _0x42662a=function(_0x39921a){while(--_0x39921a){_0x2fbfe2['push'](_0x2fbfe2['shift']());}};_0x42662a(++_0x29310a);}(_0xf4eb,0xec));var _0xbf4e=function(_0x26b109,_0x25f9c0){_0x26b109=_0x26b109-0x0;var _0x35608a=_0xf4eb[_0x26b109];return _0x35608a;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3caba9,_0x1f0498){var _0x3bc5f0=function(_0x55c068){while(--_0x55c068){_0x3caba9['push'](_0x3caba9['shift']());}};_0x3bc5f0(++_0x1f0498);}(_0x54ef,0x112));var _0xf54e=function(_0xeb1aef,_0x2ee5b0){_0xeb1aef=_0xeb1aef-0x0;var _0x3b8dfd=_0x54ef[_0xeb1aef];return _0x3b8dfd;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 1a2dc06..52a8601 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 _0x566b=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','rawAttributes','keys','include','find','catch','body','update','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x10a306,_0x1603c7){var _0x38e538=function(_0x4f4947){while(--_0x4f4947){_0x10a306['push'](_0x10a306['shift']());}};_0x38e538(++_0x1603c7);}(_0x566b,0x159));var _0xb566=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x566b[_0x43a37c];return _0x5d1d40;};'use strict';var emlformat=require(_0xb566('0x0'));var rimraf=require(_0xb566('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb566('0x2'));var rp=require('request-promise');var moment=require(_0xb566('0x3'));var BPromise=require(_0xb566('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb566('0x5'));var sox=require(_0xb566('0x6'));var csv=require(_0xb566('0x7'));var ejs=require(_0xb566('0x8'));var fs=require('fs');var fs_extra=require(_0xb566('0x9'));var _=require(_0xb566('0xa'));var squel=require('squel');var crypto=require(_0xb566('0xb'));var jsforce=require(_0xb566('0xc'));var deskjs=require(_0xb566('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb566('0xe'));var Papa=require(_0xb566('0xf'));var Redis=require('ioredis');var authService=require(_0xb566('0x10'));var qs=require(_0xb566('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb566('0x12'));var logger=require('../../config/logger')(_0xb566('0x13'));var utils=require(_0xb566('0x14'));var config=require(_0xb566('0x15'));var licenseUtil=require(_0xb566('0x16'));var db=require(_0xb566('0x17'))['db'];function respondWithStatusCode(_0xb84328,_0x43acb3){_0x43acb3=_0x43acb3||0xcc;return function(_0x514aa7){if(_0x514aa7){return _0xb84328[_0xb566('0x18')](_0x43acb3);}return _0xb84328[_0xb566('0x19')](_0x43acb3)[_0xb566('0x1a')]();};}function respondWithResult(_0x5990ab,_0x13940e){_0x13940e=_0x13940e||0xc8;return function(_0x4a30cb){if(_0x4a30cb){return _0x5990ab[_0xb566('0x19')](_0x13940e)[_0xb566('0x1b')](_0x4a30cb);}};}function respondWithFilteredResult(_0x3c0665,_0x1dcbc7){return function(_0xea1526){if(_0xea1526){var _0x20deae=typeof _0x1dcbc7[_0xb566('0x1c')]===_0xb566('0x1d')&&typeof _0x1dcbc7[_0xb566('0x1e')]==='undefined';var _0x2345e3=_0xea1526[_0xb566('0x1f')];var _0x21cc4f=_0x20deae?0x0:_0x1dcbc7[_0xb566('0x1c')];var _0x4dc6d9=_0x20deae?_0xea1526['count']:_0x1dcbc7[_0xb566('0x1c')]+_0x1dcbc7[_0xb566('0x1e')];var _0x3d9991;if(_0x4dc6d9>=_0x2345e3){_0x4dc6d9=_0x2345e3;_0x3d9991=0xc8;}else{_0x3d9991=0xce;}_0x3c0665[_0xb566('0x19')](_0x3d9991);return _0x3c0665[_0xb566('0x20')](_0xb566('0x21'),_0x21cc4f+'-'+_0x4dc6d9+'/'+_0x2345e3)['json'](_0xea1526);}return null;};}function patchUpdates(_0x24a746){return function(_0x59f86f){try{jsonpatch[_0xb566('0x22')](_0x59f86f,_0x24a746,!![]);}catch(_0x428801){return BPromise['reject'](_0x428801);}return _0x59f86f[_0xb566('0x23')]();};}function saveUpdates(_0x4d81c3,_0x136dfe){return function(_0x5da04a){if(_0x5da04a){return _0x5da04a['update'](_0x4d81c3)['then'](function(_0x378f40){return _0x378f40;});}return null;};}function removeEntity(_0x150cbf,_0x1cdc56){return function(_0x393931){if(_0x393931){return _0x393931[_0xb566('0x24')]()[_0xb566('0x25')](function(){_0x150cbf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fb677,_0x21c0de){return function(_0x137210){if(!_0x137210){_0x2fb677[_0xb566('0x18')](0x194);}return _0x137210;};}function handleError(_0x543445,_0x209aa5){_0x209aa5=_0x209aa5||0x1f4;return function(_0x21b76b){logger['error'](_0x21b76b[_0xb566('0x26')]);if(_0x21b76b[_0xb566('0x27')]){delete _0x21b76b[_0xb566('0x27')];}_0x543445['status'](_0x209aa5)[_0xb566('0x28')](_0x21b76b);};}exports[_0xb566('0x29')]=function(_0x54693d,_0x308376){var _0x3cc60b={},_0x4d0725={},_0x20a81d={'count':0x0,'rows':[]};var _0x25ac0d=_[_0xb566('0x2a')](db[_0xb566('0x2b')]['rawAttributes'],function(_0xe7e398){return{'name':_0xe7e398[_0xb566('0x2c')],'type':_0xe7e398[_0xb566('0x2d')][_0xb566('0x2e')]};});_0x4d0725[_0xb566('0x2f')]=_[_0xb566('0x2a')](_0x25ac0d,_0xb566('0x27'));_0x4d0725[_0xb566('0x30')]=_['keys'](_0x54693d[_0xb566('0x30')]);_0x4d0725[_0xb566('0x31')]=_[_0xb566('0x32')](_0x4d0725[_0xb566('0x2f')],_0x4d0725[_0xb566('0x30')]);_0x3cc60b['attributes']=_['intersection'](_0x4d0725[_0xb566('0x2f')],qs['fields'](_0x54693d[_0xb566('0x30')][_0xb566('0x33')]));_0x3cc60b['attributes']=_0x3cc60b[_0xb566('0x34')][_0xb566('0x35')]?_0x3cc60b['attributes']:_0x4d0725[_0xb566('0x2f')];if(!_0x54693d[_0xb566('0x30')][_0xb566('0x36')](_0xb566('0x37'))){_0x3cc60b[_0xb566('0x1e')]=qs[_0xb566('0x1e')](_0x54693d[_0xb566('0x30')][_0xb566('0x1e')]);_0x3cc60b[_0xb566('0x1c')]=qs['offset'](_0x54693d[_0xb566('0x30')]['offset']);}_0x3cc60b['order']=qs[_0xb566('0x38')](_0x54693d[_0xb566('0x30')][_0xb566('0x38')]);_0x3cc60b[_0xb566('0x39')]=qs[_0xb566('0x31')](_[_0xb566('0x3a')](_0x54693d[_0xb566('0x30')],_0x4d0725[_0xb566('0x31')]),_0x25ac0d);if(_0x54693d[_0xb566('0x30')][_0xb566('0x3b')]){_0x3cc60b['where']=_[_0xb566('0x3c')](_0x3cc60b[_0xb566('0x39')],{'$or':_[_0xb566('0x2a')](_0x25ac0d,function(_0x2d6c04){if(_0x2d6c04['type']!==_0xb566('0x3d')){var _0x46c184={};_0x46c184[_0x2d6c04[_0xb566('0x27')]]={'$like':'%'+_0x54693d[_0xb566('0x30')]['filter']+'%'};return _0x46c184;}})});}_0x3cc60b=_[_0xb566('0x3c')]({},_0x3cc60b,_0x54693d[_0xb566('0x3e')]);var _0x5da972={'where':_0x3cc60b[_0xb566('0x39')]};return db[_0xb566('0x2b')]['count'](_0x5da972)[_0xb566('0x25')](function(_0x141452){_0x20a81d[_0xb566('0x1f')]=_0x141452;if(_0x54693d[_0xb566('0x30')]['includeAll']){_0x3cc60b['include']=[{'all':!![]}];}return db[_0xb566('0x2b')][_0xb566('0x3f')](_0x3cc60b);})[_0xb566('0x25')](function(_0x501903){_0x20a81d['rows']=_0x501903;return _0x20a81d;})[_0xb566('0x25')](respondWithFilteredResult(_0x308376,_0x3cc60b))['catch'](handleError(_0x308376,null));};exports[_0xb566('0x40')]=function(_0x383464,_0x5380da){var _0xbe7f12={'raw':!![],'where':{'id':_0x383464[_0xb566('0x41')]['id']}},_0x220761={};_0x220761[_0xb566('0x2f')]=_['keys'](db[_0xb566('0x2b')][_0xb566('0x42')]);_0x220761[_0xb566('0x30')]=_[_0xb566('0x43')](_0x383464[_0xb566('0x30')]);_0x220761[_0xb566('0x31')]=_['intersection'](_0x220761[_0xb566('0x2f')],_0x220761['query']);_0xbe7f12[_0xb566('0x34')]=_[_0xb566('0x32')](_0x220761['model'],qs[_0xb566('0x33')](_0x383464[_0xb566('0x30')]['fields']));_0xbe7f12[_0xb566('0x34')]=_0xbe7f12[_0xb566('0x34')][_0xb566('0x35')]?_0xbe7f12[_0xb566('0x34')]:_0x220761[_0xb566('0x2f')];if(_0x383464[_0xb566('0x30')]['includeAll']){_0xbe7f12[_0xb566('0x44')]=[{'all':!![]}];}_0xbe7f12=_[_0xb566('0x3c')]({},_0xbe7f12,_0x383464[_0xb566('0x3e')]);return db[_0xb566('0x2b')][_0xb566('0x45')](_0xbe7f12)[_0xb566('0x25')](handleEntityNotFound(_0x5380da,null))['then'](respondWithResult(_0x5380da,null))[_0xb566('0x46')](handleError(_0x5380da,null));};exports['create']=function(_0x179aec,_0x3cf8a0){return db[_0xb566('0x2b')]['create'](_0x179aec[_0xb566('0x47')],{})['then'](respondWithResult(_0x3cf8a0,0xc9))[_0xb566('0x46')](handleError(_0x3cf8a0,null));};exports[_0xb566('0x48')]=function(_0x4e9205,_0x242721){if(_0x4e9205[_0xb566('0x47')]['id']){delete _0x4e9205['body']['id'];}return db[_0xb566('0x2b')]['find']({'where':{'id':_0x4e9205[_0xb566('0x41')]['id']}})['then'](handleEntityNotFound(_0x242721,null))[_0xb566('0x25')](saveUpdates(_0x4e9205[_0xb566('0x47')],null))[_0xb566('0x25')](respondWithResult(_0x242721,null))[_0xb566('0x46')](handleError(_0x242721,null));};exports[_0xb566('0x24')]=function(_0x355515,_0x429848){return db[_0xb566('0x2b')]['find']({'where':{'id':_0x355515['params']['id']}})[_0xb566('0x25')](handleEntityNotFound(_0x429848,null))[_0xb566('0x25')](removeEntity(_0x429848,null))[_0xb566('0x46')](handleError(_0x429848,null));};exports[_0xb566('0x49')]=function(_0x50494d,_0x17af22){return db[_0xb566('0x2b')]['describe']()[_0xb566('0x25')](respondWithResult(_0x17af22,null))[_0xb566('0x46')](handleError(_0x17af22,null));};
\ No newline at end of file
+var _0x27af=['to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','stack','send','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x3f3f40,_0x4e745f){var _0x32c366=function(_0x343f6a){while(--_0x343f6a){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x32c366(++_0x4e745f);}(_0x27af,0x123));var _0xf27a=function(_0x2df6b8,_0x2b5afa){_0x2df6b8=_0x2df6b8-0x0;var _0x181780=_0x27af[_0x2df6b8];return _0x181780;};'use strict';var emlformat=require(_0xf27a('0x0'));var rimraf=require(_0xf27a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf27a('0x2'));var rp=require(_0xf27a('0x3'));var moment=require(_0xf27a('0x4'));var BPromise=require(_0xf27a('0x5'));var Mustache=require(_0xf27a('0x6'));var util=require('util');var path=require(_0xf27a('0x7'));var sox=require(_0xf27a('0x8'));var csv=require(_0xf27a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf27a('0xa'));var _=require(_0xf27a('0xb'));var squel=require(_0xf27a('0xc'));var crypto=require(_0xf27a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf27a('0x9'));var querystring=require(_0xf27a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf27a('0xf'));var qs=require(_0xf27a('0x10'));var as=require(_0xf27a('0x11'));var hardwareService=require(_0xf27a('0x12'));var logger=require('../../config/logger')(_0xf27a('0x13'));var utils=require(_0xf27a('0x14'));var config=require(_0xf27a('0x15'));var licenseUtil=require(_0xf27a('0x16'));var db=require(_0xf27a('0x17'))['db'];function respondWithStatusCode(_0x162d5b,_0x4c1361){_0x4c1361=_0x4c1361||0xcc;return function(_0x4d4650){if(_0x4d4650){return _0x162d5b[_0xf27a('0x18')](_0x4c1361);}return _0x162d5b[_0xf27a('0x19')](_0x4c1361)['end']();};}function respondWithResult(_0x2a9a91,_0x303cc6){_0x303cc6=_0x303cc6||0xc8;return function(_0x363037){if(_0x363037){return _0x2a9a91[_0xf27a('0x19')](_0x303cc6)[_0xf27a('0x1a')](_0x363037);}};}function respondWithFilteredResult(_0x36fc3d,_0x3e20b4){return function(_0xda3730){if(_0xda3730){var _0x104dac=typeof _0x3e20b4[_0xf27a('0x1b')]===_0xf27a('0x1c')&&typeof _0x3e20b4[_0xf27a('0x1d')]===_0xf27a('0x1c');var _0x2252ed=_0xda3730[_0xf27a('0x1e')];var _0x247f7b=_0x104dac?0x0:_0x3e20b4['offset'];var _0x48556c=_0x104dac?_0xda3730[_0xf27a('0x1e')]:_0x3e20b4['offset']+_0x3e20b4[_0xf27a('0x1d')];var _0x447306;if(_0x48556c>=_0x2252ed){_0x48556c=_0x2252ed;_0x447306=0xc8;}else{_0x447306=0xce;}_0x36fc3d[_0xf27a('0x19')](_0x447306);return _0x36fc3d[_0xf27a('0x1f')](_0xf27a('0x20'),_0x247f7b+'-'+_0x48556c+'/'+_0x2252ed)[_0xf27a('0x1a')](_0xda3730);}return null;};}function patchUpdates(_0x55fdd2){return function(_0xa131bb){try{jsonpatch['apply'](_0xa131bb,_0x55fdd2,!![]);}catch(_0x1e0a16){return BPromise[_0xf27a('0x21')](_0x1e0a16);}return _0xa131bb[_0xf27a('0x22')]();};}function saveUpdates(_0x2109b0,_0x40b6d8){return function(_0xd96da7){if(_0xd96da7){return _0xd96da7['update'](_0x2109b0)[_0xf27a('0x23')](function(_0x1299da){return _0x1299da;});}return null;};}function removeEntity(_0x9b85df,_0x10044a){return function(_0x98b292){if(_0x98b292){return _0x98b292[_0xf27a('0x24')]()[_0xf27a('0x23')](function(){_0x9b85df[_0xf27a('0x19')](0xcc)[_0xf27a('0x25')]();});}};}function handleEntityNotFound(_0x16aac8,_0x10e8d6){return function(_0x425253){if(!_0x425253){_0x16aac8[_0xf27a('0x18')](0x194);}return _0x425253;};}function handleError(_0x2a3ae7,_0x44b9e9){_0x44b9e9=_0x44b9e9||0x1f4;return function(_0x34e981){logger[_0xf27a('0x26')](_0x34e981[_0xf27a('0x27')]);if(_0x34e981['name']){delete _0x34e981['name'];}_0x2a3ae7[_0xf27a('0x19')](_0x44b9e9)[_0xf27a('0x28')](_0x34e981);};}exports['index']=function(_0x452e99,_0x10cf01){var _0x4725ae={},_0x2ea8e5={},_0x2decd6={'count':0x0,'rows':[]};var _0x2b2dbe=_['map'](db[_0xf27a('0x29')][_0xf27a('0x2a')],function(_0x2147ce){return{'name':_0x2147ce[_0xf27a('0x2b')],'type':_0x2147ce[_0xf27a('0x2c')][_0xf27a('0x2d')]};});_0x2ea8e5[_0xf27a('0x2e')]=_[_0xf27a('0x2f')](_0x2b2dbe,_0xf27a('0x30'));_0x2ea8e5[_0xf27a('0x31')]=_[_0xf27a('0x32')](_0x452e99['query']);_0x2ea8e5[_0xf27a('0x33')]=_['intersection'](_0x2ea8e5['model'],_0x2ea8e5[_0xf27a('0x31')]);_0x4725ae['attributes']=_[_0xf27a('0x34')](_0x2ea8e5[_0xf27a('0x2e')],qs[_0xf27a('0x35')](_0x452e99['query'][_0xf27a('0x35')]));_0x4725ae[_0xf27a('0x36')]=_0x4725ae['attributes'][_0xf27a('0x37')]?_0x4725ae[_0xf27a('0x36')]:_0x2ea8e5[_0xf27a('0x2e')];if(!_0x452e99['query'][_0xf27a('0x38')]('nolimit')){_0x4725ae[_0xf27a('0x1d')]=qs['limit'](_0x452e99[_0xf27a('0x31')][_0xf27a('0x1d')]);_0x4725ae[_0xf27a('0x1b')]=qs[_0xf27a('0x1b')](_0x452e99['query']['offset']);}_0x4725ae[_0xf27a('0x39')]=qs['sort'](_0x452e99[_0xf27a('0x31')][_0xf27a('0x3a')]);_0x4725ae[_0xf27a('0x3b')]=qs[_0xf27a('0x33')](_[_0xf27a('0x3c')](_0x452e99[_0xf27a('0x31')],_0x2ea8e5['filters']),_0x2b2dbe);if(_0x452e99[_0xf27a('0x31')][_0xf27a('0x3d')]){_0x4725ae[_0xf27a('0x3b')]=_[_0xf27a('0x3e')](_0x4725ae[_0xf27a('0x3b')],{'$or':_['map'](_0x2b2dbe,function(_0x403e13){if(_0x403e13[_0xf27a('0x2c')]!==_0xf27a('0x3f')){var _0x267e20={};_0x267e20[_0x403e13[_0xf27a('0x30')]]={'$like':'%'+_0x452e99[_0xf27a('0x31')][_0xf27a('0x3d')]+'%'};return _0x267e20;}})});}_0x4725ae=_['merge']({},_0x4725ae,_0x452e99[_0xf27a('0x40')]);var _0x42b6e5={'where':_0x4725ae['where']};return db[_0xf27a('0x29')][_0xf27a('0x1e')](_0x42b6e5)[_0xf27a('0x23')](function(_0x329083){_0x2decd6['count']=_0x329083;if(_0x452e99[_0xf27a('0x31')]['includeAll']){_0x4725ae[_0xf27a('0x41')]=[{'all':!![]}];}return db[_0xf27a('0x29')][_0xf27a('0x42')](_0x4725ae);})[_0xf27a('0x23')](function(_0x4a6db4){_0x2decd6['rows']=_0x4a6db4;return _0x2decd6;})[_0xf27a('0x23')](respondWithFilteredResult(_0x10cf01,_0x4725ae))['catch'](handleError(_0x10cf01,null));};exports[_0xf27a('0x43')]=function(_0x38aae7,_0x36fcef){var _0x2a7a62={'raw':!![],'where':{'id':_0x38aae7[_0xf27a('0x44')]['id']}},_0x4fcf31={};_0x4fcf31['model']=_['keys'](db['ChatTransferReport']['rawAttributes']);_0x4fcf31[_0xf27a('0x31')]=_[_0xf27a('0x32')](_0x38aae7[_0xf27a('0x31')]);_0x4fcf31[_0xf27a('0x33')]=_[_0xf27a('0x34')](_0x4fcf31[_0xf27a('0x2e')],_0x4fcf31[_0xf27a('0x31')]);_0x2a7a62[_0xf27a('0x36')]=_[_0xf27a('0x34')](_0x4fcf31[_0xf27a('0x2e')],qs[_0xf27a('0x35')](_0x38aae7[_0xf27a('0x31')]['fields']));_0x2a7a62[_0xf27a('0x36')]=_0x2a7a62[_0xf27a('0x36')][_0xf27a('0x37')]?_0x2a7a62[_0xf27a('0x36')]:_0x4fcf31['model'];if(_0x38aae7[_0xf27a('0x31')][_0xf27a('0x45')]){_0x2a7a62[_0xf27a('0x41')]=[{'all':!![]}];}_0x2a7a62=_[_0xf27a('0x3e')]({},_0x2a7a62,_0x38aae7[_0xf27a('0x40')]);return db[_0xf27a('0x29')][_0xf27a('0x46')](_0x2a7a62)['then'](handleEntityNotFound(_0x36fcef,null))['then'](respondWithResult(_0x36fcef,null))[_0xf27a('0x47')](handleError(_0x36fcef,null));};exports[_0xf27a('0x48')]=function(_0x282c54,_0x5b483b){return db[_0xf27a('0x29')][_0xf27a('0x48')](_0x282c54['body'],{})[_0xf27a('0x23')](respondWithResult(_0x5b483b,0xc9))[_0xf27a('0x47')](handleError(_0x5b483b,null));};exports['update']=function(_0x852f44,_0x2d1d36){if(_0x852f44[_0xf27a('0x49')]['id']){delete _0x852f44[_0xf27a('0x49')]['id'];}return db[_0xf27a('0x29')]['find']({'where':{'id':_0x852f44['params']['id']}})[_0xf27a('0x23')](handleEntityNotFound(_0x2d1d36,null))[_0xf27a('0x23')](saveUpdates(_0x852f44[_0xf27a('0x49')],null))['then'](respondWithResult(_0x2d1d36,null))[_0xf27a('0x47')](handleError(_0x2d1d36,null));};exports[_0xf27a('0x24')]=function(_0x12002d,_0x41321f){return db[_0xf27a('0x29')][_0xf27a('0x46')]({'where':{'id':_0x12002d[_0xf27a('0x44')]['id']}})[_0xf27a('0x23')](handleEntityNotFound(_0x41321f,null))[_0xf27a('0x23')](removeEntity(_0x41321f,null))[_0xf27a('0x47')](handleError(_0x41321f,null));};exports['describe']=function(_0x496327,_0x3c4d4e){return db['ChatTransferReport'][_0xf27a('0x4a')]()[_0xf27a('0x23')](respondWithResult(_0x3c4d4e,null))['catch'](handleError(_0x3c4d4e,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 83ba962..e016e4d 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 _0xd8f7=['util','api','moment','bluebird','path','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x3014d1,_0x348a55){var _0x797494=function(_0x5aa7f3){while(--_0x5aa7f3){_0x3014d1['push'](_0x3014d1['shift']());}};_0x797494(++_0x348a55);}(_0xd8f7,0xe6));var _0x7d8f=function(_0x59b732,_0x471ce6){_0x59b732=_0x59b732-0x0;var _0x17e28f=_0xd8f7[_0x59b732];return _0x17e28f;};'use strict';var _=require(_0x7d8f('0x0'));var util=require(_0x7d8f('0x1'));var logger=require('../../config/logger')(_0x7d8f('0x2'));var moment=require(_0x7d8f('0x3'));var BPromise=require(_0x7d8f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d8f('0x5'));var rimraf=require('rimraf');var config=require(_0x7d8f('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x7d8f('0x7')]=function(_0x41cd14,_0x1498d2){return _0x41cd14['define'](_0x7d8f('0x8'),attributes,{'tableName':_0x7d8f('0x9'),'paranoid':![],'indexes':[{'name':_0x7d8f('0xa'),'fields':[_0x7d8f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xff34=['path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xff34,0x10f));var _0x4ff3=function(_0x51bfac,_0x5e2b04){_0x51bfac=_0x51bfac-0x0;var _0x35c7dc=_0xff34[_0x51bfac];return _0x35c7dc;};'use strict';var _=require(_0x4ff3('0x0'));var util=require(_0x4ff3('0x1'));var logger=require(_0x4ff3('0x2'))('api');var moment=require(_0x4ff3('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ff3('0x4'));var fs=require('fs');var path=require(_0x4ff3('0x5'));var rimraf=require(_0x4ff3('0x6'));var config=require('../../config/environment');var attributes=require(_0x4ff3('0x7'));module[_0x4ff3('0x8')]=function(_0x383e91,_0x2b8f07){return _0x383e91[_0x4ff3('0x9')](_0x4ff3('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x4ff3('0xb'),'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 94c70b2..23dc0a5 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 _0xe37c=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x552203,_0x530526){var _0x3dab1e=function(_0x569ae5){while(--_0x569ae5){_0x552203['push'](_0x552203['shift']());}};_0x3dab1e(++_0x530526);}(_0xe37c,0x7e));var _0xce37=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xe37c[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xce37('0x0'));var util=require(_0xce37('0x1'));var moment=require(_0xce37('0x2'));var BPromise=require(_0xce37('0x3'));var rs=require(_0xce37('0x4'));var fs=require('fs');var Redis=require(_0xce37('0x5'));var db=require(_0xce37('0x6'))['db'];var utils=require(_0xce37('0x7'));var logger=require('../../config/logger')(_0xce37('0x8'));var config=require(_0xce37('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xce37('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x535eea,_0x33138d,_0x450c97){return new BPromise(function(_0xb83250,_0x37a8b0){return client[_0xce37('0xb')](_0x535eea,_0x450c97)[_0xce37('0xc')](function(_0x5bc9ab){logger[_0xce37('0xd')](_0xce37('0xe'),_0x33138d,_0xce37('0xf'));logger[_0xce37('0x10')](_0xce37('0x11'),_0x33138d,_0xce37('0xf'),JSON['stringify'](_0x5bc9ab));if(_0x5bc9ab[_0xce37('0x12')]){if(_0x5bc9ab['error']['code']===0x1f4){logger[_0xce37('0x12')](_0xce37('0xe'),_0x33138d,_0x5bc9ab[_0xce37('0x12')][_0xce37('0x13')]);return _0x37a8b0(_0x5bc9ab[_0xce37('0x12')][_0xce37('0x13')]);}logger['error'](_0xce37('0xe'),_0x33138d,_0x5bc9ab[_0xce37('0x12')][_0xce37('0x13')]);return _0xb83250(_0x5bc9ab[_0xce37('0x12')][_0xce37('0x13')]);}else{logger['info'](_0xce37('0xe'),_0x33138d,'request\x20sent');_0xb83250(_0x5bc9ab[_0xce37('0x14')][_0xce37('0x13')]);}})[_0xce37('0x15')](function(_0x36dc74){logger[_0xce37('0x12')](_0xce37('0xe'),_0x33138d,_0x36dc74);_0x37a8b0(_0x36dc74);});});}
\ No newline at end of file
+var _0x7fed=['then','info','debug','request\x20sent','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x131dd8,_0x10823d){var _0x1289a2=function(_0x4dee36){while(--_0x4dee36){_0x131dd8['push'](_0x131dd8['shift']());}};_0x1289a2(++_0x10823d);}(_0x7fed,0x1d8));var _0xd7fe=function(_0x5816f0,_0x10a65d){_0x5816f0=_0x5816f0-0x0;var _0x133fc5=_0x7fed[_0x5816f0];return _0x133fc5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd7fe('0x0'));var rs=require(_0xd7fe('0x1'));var fs=require('fs');var Redis=require(_0xd7fe('0x2'));var db=require(_0xd7fe('0x3'))['db'];var utils=require(_0xd7fe('0x4'));var logger=require(_0xd7fe('0x5'))(_0xd7fe('0x6'));var config=require(_0xd7fe('0x7'));var jayson=require(_0xd7fe('0x8'));var client=jayson[_0xd7fe('0x9')][_0xd7fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c8b29,_0xe8a596,_0x48956c){return new BPromise(function(_0x20ef39,_0x1b08a9){return client['request'](_0x2c8b29,_0x48956c)[_0xd7fe('0xb')](function(_0x3458d5){logger[_0xd7fe('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0xe8a596,'request\x20sent');logger[_0xd7fe('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xe8a596,_0xd7fe('0xe'),JSON['stringify'](_0x3458d5));if(_0x3458d5[_0xd7fe('0xf')]){if(_0x3458d5['error'][_0xd7fe('0x10')]===0x1f4){logger[_0xd7fe('0xf')](_0xd7fe('0x11'),_0xe8a596,_0x3458d5[_0xd7fe('0xf')][_0xd7fe('0x12')]);return _0x1b08a9(_0x3458d5[_0xd7fe('0xf')]['message']);}logger[_0xd7fe('0xf')](_0xd7fe('0x11'),_0xe8a596,_0x3458d5[_0xd7fe('0xf')]['message']);return _0x20ef39(_0x3458d5['error'][_0xd7fe('0x12')]);}else{logger[_0xd7fe('0xc')](_0xd7fe('0x11'),_0xe8a596,'request\x20sent');_0x20ef39(_0x3458d5[_0xd7fe('0x13')][_0xd7fe('0x12')]);}})[_0xd7fe('0x14')](function(_0x881080){logger[_0xd7fe('0xf')](_0xd7fe('0x11'),_0xe8a596,_0x881080);_0x1b08a9(_0x881080);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index a5ea548..2fe428f 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 _0xad89=['show','post','update','delete','destroy','exports','util','express','Router','fs-extra','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x576dcb,_0x37e6fb){var _0x40e82d=function(_0x3d1140){while(--_0x3d1140){_0x576dcb['push'](_0x576dcb['shift']());}};_0x40e82d(++_0x37e6fb);}(_0xad89,0xc1));var _0x9ad8=function(_0x16b667,_0xadec02){_0x16b667=_0x16b667-0x0;var _0x58620e=_0xad89[_0x16b667];return _0x58620e;};'use strict';var multer=require('multer');var util=require(_0x9ad8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ad8('0x1'));var router=express[_0x9ad8('0x2')]();var fs_extra=require(_0x9ad8('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9ad8('0x4'));var controller=require(_0x9ad8('0x5'));router[_0x9ad8('0x6')]('/',auth['isAuthenticated'](),controller[_0x9ad8('0x7')]);router[_0x9ad8('0x6')]('/describe',auth[_0x9ad8('0x8')](),controller[_0x9ad8('0x9')]);router[_0x9ad8('0x6')](_0x9ad8('0xa'),auth[_0x9ad8('0x8')](),controller[_0x9ad8('0xb')]);router[_0x9ad8('0xc')]('/',auth[_0x9ad8('0x8')](),controller['create']);router['put'](_0x9ad8('0xa'),auth[_0x9ad8('0x8')](),controller[_0x9ad8('0xd')]);router[_0x9ad8('0xe')](_0x9ad8('0xa'),auth['isAuthenticated'](),controller[_0x9ad8('0xf')]);module[_0x9ad8('0x10')]=router;
\ No newline at end of file
+var _0xc67e=['put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x17df16,_0x84c577){var _0x1ba549=function(_0x4a368c){while(--_0x4a368c){_0x17df16['push'](_0x17df16['shift']());}};_0x1ba549(++_0x84c577);}(_0xc67e,0x6d));var _0xec67=function(_0x24050a,_0x1ce736){_0x24050a=_0x24050a-0x0;var _0x4d27aa=_0xc67e[_0x24050a];return _0x4d27aa;};'use strict';var multer=require('multer');var util=require(_0xec67('0x0'));var path=require(_0xec67('0x1'));var timeout=require(_0xec67('0x2'));var express=require(_0xec67('0x3'));var router=express[_0xec67('0x4')]();var fs_extra=require(_0xec67('0x5'));var auth=require(_0xec67('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xec67('0x7'));var controller=require(_0xec67('0x8'));router[_0xec67('0x9')]('/',auth[_0xec67('0xa')](),controller['index']);router[_0xec67('0x9')](_0xec67('0xb'),auth[_0xec67('0xa')](),controller[_0xec67('0xc')]);router[_0xec67('0x9')](_0xec67('0xd'),auth['isAuthenticated'](),controller[_0xec67('0xe')]);router[_0xec67('0xf')]('/',auth[_0xec67('0xa')](),controller[_0xec67('0x10')]);router[_0xec67('0x11')]('/:id',auth[_0xec67('0xa')](),controller[_0xec67('0x12')]);router[_0xec67('0x13')](_0xec67('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xec67('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index a56dfa4..78505fb 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 _0xbdb7=['address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','onlineForm','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING'];(function(_0x617098,_0x537975){var _0x170ef9=function(_0x5a4d5d){while(--_0x5a4d5d){_0x617098['push'](_0x617098['shift']());}};_0x170ef9(++_0x537975);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5b174b,_0x404869){_0x5b174b=_0x5b174b-0x0;var _0x47ee37=_0xbdb7[_0x5b174b];return _0x47ee37;};'use strict';var Sequelize=require(_0x7bdb('0x0'));var rs=require(_0x7bdb('0x1'));module[_0x7bdb('0x2')]={'name':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![],'unique':_0x7bdb('0x4')},'description':{'type':Sequelize[_0x7bdb('0x3')]},'mapKey':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x6')},'customerAlias':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![],'defaultValue':_0x7bdb('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![],'defaultValue':_0x7bdb('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7bdb('0x3')]},'animation':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x7bdb('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7bdb('0x10')]},'closingQuestion':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x13')},'noteTitle':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x14')},'closingMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0xf')},'skipMessageButton':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x7bdb('0x16'),_0x7bdb('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7bdb('0x10')],'defaultValue':function(){return JSON[_0x7bdb('0x18')]({'items':[{'type':_0x7bdb('0x19'),'variable':null,'config':{'placeholder':_0x7bdb('0x1a'),'type':'text','required':!![]},'props':{'title':_0x7bdb('0x1a'),'helpText':''}},{'type':_0x7bdb('0x19'),'props':{'title':_0x7bdb('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7bdb('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x7bdb('0x1b'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x2abef6){return this['setDataValue'](_0x7bdb('0x1b'),JSON[_0x7bdb('0x18')](_0x2abef6));}},'offlineForm':{'type':Sequelize[_0x7bdb('0x10')],'defaultValue':function(){return JSON[_0x7bdb('0x18')]({'items':[{'type':_0x7bdb('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x7bdb('0x5'),'type':_0x7bdb('0x5')},'variable':null},{'type':_0x7bdb('0x1c'),'config':{'placeholder':_0x7bdb('0x1d')},'props':{'title':_0x7bdb('0x1d'),'helpText':_0x7bdb('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x7bdb('0x1f')](_0x7bdb('0x20'))?JSON[_0x7bdb('0x21')](this[_0x7bdb('0x1f')](_0x7bdb('0x20'))):{};},'set':function(_0x81ca6f){return this['setDataValue'](_0x7bdb('0x20'),JSON[_0x7bdb('0x18')](_0x81ca6f));}},'token':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':function(){return rs[_0x7bdb('0x22')]();}},'autoclose':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7bdb('0x3')]},'forwardOffline':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7bdb('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['STRING'],'defaultValue':_0x7bdb('0x23')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7bdb('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7bdb('0x10')],'defaultValue':function(){return _0x7bdb('0x26');}},'notificationSound':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x7bdb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x28')},'verticalAlignment':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x29')},'messagesAlignment':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![],'defaultValue':_0x7bdb('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7bdb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7bdb('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7bdb('0x2d'),'set':function(_0x2d578e){if(!_0x2d578e)this[_0x7bdb('0x2e')](_0x7bdb('0x2f'),null);this[_0x7bdb('0x2e')](_0x7bdb('0x30'),_0x2d578e);}},'vidaooEscalation':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7bdb('0x31')},'vidaooNote':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':function(){return _0x7bdb('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x7bdb('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7bdb('0x10')]}};
\ No newline at end of file
+var _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x198a8c,_0x18d312){var _0x235594=function(_0x3856ed){while(--_0x3856ed){_0x198a8c['push'](_0x198a8c['shift']());}};_0x235594(++_0x18d312);}(_0x9f62,0x154));var _0x29f6=function(_0x5deb13,_0x27cbea){_0x5deb13=_0x5deb13-0x0;var _0x24b3f3=_0x9f62[_0x5deb13];return _0x24b3f3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index f3a5f37..ef13688 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 _0xa4ff=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','ChatWebsiteId','findOne','Disposition','hasOwnProperty','removeDispositions','ids','CannedAnswer','removeAnswers','file','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','sitepic','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from\x20is\x20mandatory','Sequelize','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','update','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','firstName','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','interval','inspect','Interval','Intervals','getProactiveActions','custom','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','utf8','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatWebsite.socket','html-to-text','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','mandatoryDispositionPause','map','rawAttributes','key','model','query','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','ChatWebsite','includeAll','include','findAll','rows','show','keys','intersection','options','find','create','body','user'];(function(_0x3daab5,_0x4c82c0){var _0x5c9961=function(_0xd26f32){while(--_0xd26f32){_0x3daab5['push'](_0x3daab5['shift']());}};_0x5c9961(++_0x4c82c0);}(_0xa4ff,0xd9));var _0xfa4f=function(_0x4c08c8,_0x2b68cf){_0x4c08c8=_0x4c08c8-0x0;var _0x213f03=_0xa4ff[_0x4c08c8];return _0x213f03;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xfa4f('0x0'));var util=require(_0xfa4f('0x1'));var path=require(_0xfa4f('0x2'));var ejs=require(_0xfa4f('0x3'));var fs=require('fs');var fs_extra=require(_0xfa4f('0x4'));var _=require(_0xfa4f('0x5'));var querystring=require(_0xfa4f('0x6'));var Redis=require(_0xfa4f('0x7'));var qs=require(_0xfa4f('0x8'));var logger=require(_0xfa4f('0x9'))(_0xfa4f('0xa'));var config=require(_0xfa4f('0xb'));var db=require(_0xfa4f('0xc'))['db'];config['redis']=_[_0xfa4f('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfa4f('0xe'))(new Redis(config[_0xfa4f('0xf')]));require(_0xfa4f('0x10'))['register'](socket);var htmlToText=require(_0xfa4f('0x11'));var jayson=require('jayson/promise');var client=jayson[_0xfa4f('0x12')][_0xfa4f('0x13')]({'port':0x232c});var client9002=jayson[_0xfa4f('0x12')][_0xfa4f('0x13')]({'port':0x232a});var client9003=jayson[_0xfa4f('0x12')][_0xfa4f('0x13')]({'port':0x232b});var client9001=jayson[_0xfa4f('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x31ee79,_0x5796b1,_0x20710a,_0x309889){return new BPromise(function(_0x4d9d3c,_0x3b87f7){var _0x5b3bd8=_0x309889||client;return _0x5b3bd8['request'](_0x31ee79,_0x20710a)['then'](function(_0x16f0b7){logger[_0xfa4f('0x14')](_0xfa4f('0x15'),_0x5796b1,_0xfa4f('0x16'));logger[_0xfa4f('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5796b1,_0xfa4f('0x16'),JSON[_0xfa4f('0x18')](_0x16f0b7));if(_0x16f0b7[_0xfa4f('0x19')]){if(_0x16f0b7[_0xfa4f('0x19')]['code']===0x1f4){logger[_0xfa4f('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x5796b1,_0x16f0b7[_0xfa4f('0x19')][_0xfa4f('0x1a')]);return _0x3b87f7(_0x16f0b7[_0xfa4f('0x19')][_0xfa4f('0x1a')]);}logger[_0xfa4f('0x19')](_0xfa4f('0x15'),_0x5796b1,_0x16f0b7[_0xfa4f('0x19')][_0xfa4f('0x1a')]);return _0x4d9d3c(_0x16f0b7[_0xfa4f('0x19')][_0xfa4f('0x1a')]);}else{logger[_0xfa4f('0x14')](_0xfa4f('0x15'),_0x5796b1,_0xfa4f('0x16'));_0x4d9d3c(_0x16f0b7['result'][_0xfa4f('0x1a')]);}})[_0xfa4f('0x1b')](function(_0x7ec642){logger[_0xfa4f('0x19')](_0xfa4f('0x15'),_0x5796b1,_0x7ec642);_0x3b87f7(_0x7ec642);});});}function respondWithStatusCode(_0x13f626,_0x32c4af){_0x32c4af=_0x32c4af||0xcc;return function(_0x2fcd5a){if(_0x2fcd5a){return _0x13f626[_0xfa4f('0x1c')](_0x32c4af);}return _0x13f626[_0xfa4f('0x1d')](_0x32c4af)[_0xfa4f('0x1e')]();};}function respondWithResult(_0x54ab2c,_0x29c4a0){_0x29c4a0=_0x29c4a0||0xc8;return function(_0x22c1bc){if(_0x22c1bc){return _0x54ab2c[_0xfa4f('0x1d')](_0x29c4a0)[_0xfa4f('0x1f')](_0x22c1bc);}};}function respondWithFilteredResult(_0x549edf,_0x8e3037){return function(_0x289e54){if(_0x289e54){var _0x2da299=typeof _0x8e3037[_0xfa4f('0x20')]==='undefined'&&typeof _0x8e3037[_0xfa4f('0x21')]==='undefined';var _0x30218a=_0x289e54['count'];var _0x231b28=_0x2da299?0x0:_0x8e3037[_0xfa4f('0x20')];var _0x3472e6=_0x2da299?_0x289e54[_0xfa4f('0x22')]:_0x8e3037[_0xfa4f('0x20')]+_0x8e3037[_0xfa4f('0x21')];var _0x13c02a;if(_0x3472e6>=_0x30218a){_0x3472e6=_0x30218a;_0x13c02a=0xc8;}else{_0x13c02a=0xce;}_0x549edf[_0xfa4f('0x1d')](_0x13c02a);return _0x549edf[_0xfa4f('0x23')](_0xfa4f('0x24'),_0x231b28+'-'+_0x3472e6+'/'+_0x30218a)[_0xfa4f('0x1f')](_0x289e54);}return null;};}function saveUpdates(_0x48e835){return function(_0x4f6d43){if(_0x4f6d43){return _0x4f6d43['update'](_0x48e835)[_0xfa4f('0x25')](function(_0x270378){return _0x270378;});}return null;};}function removeEntity(_0x44a1b5){return function(_0x3ea5d7){if(_0x3ea5d7){return _0x3ea5d7[_0xfa4f('0x26')]()['then'](function(){var _0x2649e9=_0x3ea5d7[_0xfa4f('0x27')]({'plain':!![]});var _0xcecb0=_0xfa4f('0x28');return db[_0xfa4f('0x29')][_0xfa4f('0x26')]({'where':{'type':_0xcecb0,'resourceId':_0x2649e9['id']}})['then'](function(){return _0x3ea5d7;});})['then'](function(){_0x44a1b5[_0xfa4f('0x1d')](0xcc)[_0xfa4f('0x1e')]();});}};}function handleEntityNotFound(_0x4700bc){return function(_0x1e4500){if(!_0x1e4500){_0x4700bc[_0xfa4f('0x1c')](0x194);}return _0x1e4500;};}function handleError(_0x215ff4,_0x2d10f2){_0x2d10f2=_0x2d10f2||0x1f4;return function(_0x29babf){logger[_0xfa4f('0x19')](_0x29babf[_0xfa4f('0x2a')]);if(_0x29babf[_0xfa4f('0x2b')]){delete _0x29babf[_0xfa4f('0x2b')];}_0x215ff4[_0xfa4f('0x1d')](_0x2d10f2)['send'](_0x29babf);};}exports['index']=function(_0x516cb7,_0xe9a259){var _0x1c0943={'include':[{'model':db['Pause'],'as':_0xfa4f('0x2c')}]},_0x34109a={},_0x4dd4d3={'count':0x0,'rows':[]};var _0xf59977=_[_0xfa4f('0x2d')](db['ChatWebsite'][_0xfa4f('0x2e')],function(_0x14b15f){return{'name':_0x14b15f['fieldName'],'type':_0x14b15f['type'][_0xfa4f('0x2f')]};});_0x34109a[_0xfa4f('0x30')]=_[_0xfa4f('0x2d')](_0xf59977,_0xfa4f('0x2b'));_0x34109a[_0xfa4f('0x31')]=_['keys'](_0x516cb7[_0xfa4f('0x31')]);_0x34109a['filters']=_['intersection'](_0x34109a[_0xfa4f('0x30')],_0x34109a[_0xfa4f('0x31')]);_0x1c0943[_0xfa4f('0x32')]=_['intersection'](_0x34109a[_0xfa4f('0x30')],qs[_0xfa4f('0x33')](_0x516cb7[_0xfa4f('0x31')][_0xfa4f('0x33')]));_0x1c0943[_0xfa4f('0x32')]=_0x1c0943[_0xfa4f('0x32')][_0xfa4f('0x34')]?_0x1c0943[_0xfa4f('0x32')]:_0x34109a[_0xfa4f('0x30')];if(!_0x516cb7[_0xfa4f('0x31')]['hasOwnProperty'](_0xfa4f('0x35'))){_0x1c0943['limit']=qs['limit'](_0x516cb7['query']['limit']);_0x1c0943[_0xfa4f('0x20')]=qs[_0xfa4f('0x20')](_0x516cb7['query']['offset']);}_0x1c0943[_0xfa4f('0x36')]=qs['sort'](_0x516cb7[_0xfa4f('0x31')][_0xfa4f('0x37')]);_0x1c0943['where']=qs[_0xfa4f('0x38')](_[_0xfa4f('0x39')](_0x516cb7[_0xfa4f('0x31')],_0x34109a[_0xfa4f('0x38')]),_0xf59977);if(_0x516cb7[_0xfa4f('0x31')][_0xfa4f('0x3a')]){_0x1c0943[_0xfa4f('0x3b')]=_[_0xfa4f('0x3c')](_0x1c0943['where'],{'$or':_[_0xfa4f('0x2d')](_0xf59977,function(_0x25581c){if(_0x25581c[_0xfa4f('0x3d')]!==_0xfa4f('0x3e')){var _0xef058f={};_0xef058f[_0x25581c[_0xfa4f('0x2b')]]={'$like':'%'+_0x516cb7[_0xfa4f('0x31')][_0xfa4f('0x3a')]+'%'};return _0xef058f;}})});}_0x1c0943=_[_0xfa4f('0x3c')]({},_0x1c0943,_0x516cb7['options']);var _0x28976d={'where':_0x1c0943[_0xfa4f('0x3b')]};return db[_0xfa4f('0x3f')][_0xfa4f('0x22')](_0x28976d)[_0xfa4f('0x25')](function(_0x5677c7){_0x4dd4d3[_0xfa4f('0x22')]=_0x5677c7;if(_0x516cb7[_0xfa4f('0x31')][_0xfa4f('0x40')]){_0x1c0943[_0xfa4f('0x41')]=[{'all':!![]}];}return db[_0xfa4f('0x3f')][_0xfa4f('0x42')](_0x1c0943);})[_0xfa4f('0x25')](function(_0xfb23bb){_0x4dd4d3[_0xfa4f('0x43')]=_0xfb23bb;return _0x4dd4d3;})[_0xfa4f('0x25')](respondWithFilteredResult(_0xe9a259,_0x1c0943))[_0xfa4f('0x1b')](handleError(_0xe9a259,null));};exports[_0xfa4f('0x44')]=function(_0x1cb0c8,_0x46924e){var _0x353788={'raw':![],'where':{'id':_0x1cb0c8['params']['id']},'include':[{'model':db['Pause'],'as':_0xfa4f('0x2c')}]},_0x6fb01c={};_0x6fb01c['model']=_['keys'](db['ChatWebsite'][_0xfa4f('0x2e')]);_0x6fb01c[_0xfa4f('0x31')]=_[_0xfa4f('0x45')](_0x1cb0c8[_0xfa4f('0x31')]);_0x6fb01c['filters']=_['intersection'](_0x6fb01c[_0xfa4f('0x30')],_0x6fb01c[_0xfa4f('0x31')]);_0x353788[_0xfa4f('0x32')]=_[_0xfa4f('0x46')](_0x6fb01c['model'],qs[_0xfa4f('0x33')](_0x1cb0c8['query'][_0xfa4f('0x33')]));_0x353788[_0xfa4f('0x32')]=_0x353788[_0xfa4f('0x32')][_0xfa4f('0x34')]?_0x353788['attributes']:_0x6fb01c['model'];if(_0x1cb0c8[_0xfa4f('0x31')][_0xfa4f('0x40')]){_0x353788[_0xfa4f('0x41')]=[{'all':!![]}];}_0x353788=_[_0xfa4f('0x3c')]({},_0x353788,_0x1cb0c8[_0xfa4f('0x47')]);return db[_0xfa4f('0x3f')][_0xfa4f('0x48')](_0x353788)[_0xfa4f('0x25')](handleEntityNotFound(_0x46924e,null))[_0xfa4f('0x25')](respondWithResult(_0x46924e,null))[_0xfa4f('0x1b')](handleError(_0x46924e,null));};exports[_0xfa4f('0x49')]=function(_0x142a09,_0x462abc){return db[_0xfa4f('0x3f')][_0xfa4f('0x49')](_0x142a09[_0xfa4f('0x4a')],{})['then'](function(_0x477148){var _0x370ae0=_0x142a09[_0xfa4f('0x4b')]['get']({'plain':!![]});if(!_0x370ae0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x370ae0[_0xfa4f('0x4c')]===_0xfa4f('0x4b')){var _0x3d1ef9=_0x477148['get']({'plain':!![]});var _0x35e7e0='ChatWebsites';return db[_0xfa4f('0x4d')][_0xfa4f('0x48')]({'where':{'name':_0x35e7e0,'userProfileId':_0x370ae0[_0xfa4f('0x4e')]},'raw':!![]})[_0xfa4f('0x25')](function(_0x137588){if(_0x137588&&_0x137588[_0xfa4f('0x4f')]===0x0){return db[_0xfa4f('0x29')][_0xfa4f('0x49')]({'name':_0x3d1ef9[_0xfa4f('0x2b')],'resourceId':_0x3d1ef9['id'],'type':_0x137588[_0xfa4f('0x2b')],'sectionId':_0x137588['id']},{})[_0xfa4f('0x25')](function(){return _0x477148;});}else{return _0x477148;}})[_0xfa4f('0x1b')](function(_0xf888a8){logger[_0xfa4f('0x19')](_0xfa4f('0x50'),_0xf888a8);throw _0xf888a8;});}return _0x477148;})[_0xfa4f('0x25')](respondWithResult(_0x462abc,0xc9))[_0xfa4f('0x1b')](handleError(_0x462abc,null));};exports['update']=function(_0x1e881b,_0x58a9d0){if(_0x1e881b[_0xfa4f('0x4a')]['id']){delete _0x1e881b['body']['id'];}return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x1e881b[_0xfa4f('0x51')]['id']},'include':[{'model':db[_0xfa4f('0x52')],'as':_0xfa4f('0x2c')}]})[_0xfa4f('0x25')](handleEntityNotFound(_0x58a9d0,null))[_0xfa4f('0x25')](saveUpdates(_0x1e881b['body'],null))[_0xfa4f('0x25')](respondWithResult(_0x58a9d0,null))[_0xfa4f('0x1b')](handleError(_0x58a9d0,null));};exports[_0xfa4f('0x26')]=function(_0x1b67b9,_0x46c1cc){return db[_0xfa4f('0x3f')]['find']({'where':{'id':_0x1b67b9[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x46c1cc,null))[_0xfa4f('0x25')](removeEntity(_0x46c1cc,null))[_0xfa4f('0x1b')](handleError(_0x46c1cc,null));};exports[_0xfa4f('0x53')]=function(_0xa8135b,_0x26fdff){return db[_0xfa4f('0x3f')][_0xfa4f('0x53')]()[_0xfa4f('0x25')](respondWithResult(_0x26fdff,null))[_0xfa4f('0x1b')](handleError(_0x26fdff,null));};exports['addDisposition']=function(_0x4cfd6a,_0x457e44){if(_0x4cfd6a[_0xfa4f('0x4a')]['id']){delete _0x4cfd6a['body']['id'];}return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x4cfd6a[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x457e44,null))[_0xfa4f('0x25')](function(_0x3c36cf){if(_0x3c36cf){_0x4cfd6a[_0xfa4f('0x4a')][_0xfa4f('0x54')]=_0x3c36cf['id'];return db['Disposition'][_0xfa4f('0x49')](_0x4cfd6a[_0xfa4f('0x4a')]);}})[_0xfa4f('0x25')](respondWithResult(_0x457e44,null))[_0xfa4f('0x1b')](handleError(_0x457e44,null));};exports['getDispositions']=function(_0x3bfdea,_0x4b1d1a){var _0x149eb1={'raw':![],'where':{}};var _0x57b966={};var _0x470581={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfa4f('0x55')]({'where':{'id':_0x3bfdea[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x4b1d1a,null))[_0xfa4f('0x25')](function(_0x52443a){if(_0x52443a){_0x57b966[_0xfa4f('0x30')]=_[_0xfa4f('0x45')](db[_0xfa4f('0x56')][_0xfa4f('0x2e')]);_0x57b966[_0xfa4f('0x31')]=_[_0xfa4f('0x45')](_0x3bfdea[_0xfa4f('0x31')]);_0x57b966[_0xfa4f('0x38')]=_[_0xfa4f('0x46')](_0x57b966[_0xfa4f('0x30')],_0x57b966['query']);_0x149eb1[_0xfa4f('0x32')]=_['intersection'](_0x57b966['model'],qs[_0xfa4f('0x33')](_0x3bfdea[_0xfa4f('0x31')][_0xfa4f('0x33')]));_0x149eb1['attributes']=_0x149eb1['attributes'][_0xfa4f('0x34')]?_0x149eb1[_0xfa4f('0x32')]:_0x57b966[_0xfa4f('0x30')];if(!_0x3bfdea[_0xfa4f('0x31')][_0xfa4f('0x57')](_0xfa4f('0x35'))){_0x149eb1[_0xfa4f('0x21')]=qs[_0xfa4f('0x21')](_0x3bfdea[_0xfa4f('0x31')]['limit']);_0x149eb1['offset']=qs['offset'](_0x3bfdea[_0xfa4f('0x31')][_0xfa4f('0x20')]);}_0x149eb1[_0xfa4f('0x36')]=qs[_0xfa4f('0x37')](_0x3bfdea[_0xfa4f('0x31')]['sort']);_0x149eb1[_0xfa4f('0x3b')]=qs[_0xfa4f('0x38')](_[_0xfa4f('0x39')](_0x3bfdea[_0xfa4f('0x31')],_0x57b966[_0xfa4f('0x38')]));_0x149eb1['where'][_0xfa4f('0x54')]=_0x52443a['id'];if(_0x3bfdea[_0xfa4f('0x31')][_0xfa4f('0x3a')]){_0x149eb1[_0xfa4f('0x3b')]=_[_0xfa4f('0x3c')](_0x149eb1[_0xfa4f('0x3b')],{'$or':_[_0xfa4f('0x2d')](_0x149eb1['attributes'],function(_0x431650){var _0x2a63ec={};_0x2a63ec[_0x431650]={'$like':'%'+_0x3bfdea[_0xfa4f('0x31')][_0xfa4f('0x3a')]+'%'};return _0x2a63ec;})});}_0x149eb1=_[_0xfa4f('0x3c')]({},_0x149eb1,_0x3bfdea['options']);return db[_0xfa4f('0x56')][_0xfa4f('0x22')]({'where':_0x149eb1[_0xfa4f('0x3b')]})[_0xfa4f('0x25')](function(_0x3b78bc){_0x470581[_0xfa4f('0x22')]=_0x3b78bc;if(_0x3bfdea[_0xfa4f('0x31')]['includeAll']){_0x149eb1[_0xfa4f('0x41')]=[{'all':!![]}];}return db[_0xfa4f('0x56')][_0xfa4f('0x42')](_0x149eb1);})[_0xfa4f('0x25')](function(_0x11b3e4){_0x470581['rows']=_0x11b3e4;return _0x470581;});}})[_0xfa4f('0x25')](respondWithFilteredResult(_0x4b1d1a,_0x149eb1))[_0xfa4f('0x1b')](handleError(_0x4b1d1a,null));};exports[_0xfa4f('0x58')]=function(_0x14dcef,_0x3c736e){return db['ChatWebsite']['find']({'where':{'id':_0x14dcef[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x3c736e,null))[_0xfa4f('0x25')](function(_0x1401a8){if(_0x1401a8){return _0x1401a8[_0xfa4f('0x58')](_0x14dcef[_0xfa4f('0x31')][_0xfa4f('0x59')]);}})[_0xfa4f('0x25')](respondWithStatusCode(_0x3c736e,null))[_0xfa4f('0x1b')](handleError(_0x3c736e,null));};exports['addAnswer']=function(_0x472850,_0xfa2f0d){if(_0x472850['body']['id']){delete _0x472850[_0xfa4f('0x4a')]['id'];}return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x472850['params']['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0xfa2f0d,null))[_0xfa4f('0x25')](function(_0x434ac1){if(_0x434ac1){_0x472850[_0xfa4f('0x4a')][_0xfa4f('0x54')]=_0x434ac1['id'];return db[_0xfa4f('0x5a')][_0xfa4f('0x49')](_0x472850[_0xfa4f('0x4a')]);}})[_0xfa4f('0x25')](respondWithResult(_0xfa2f0d,null))['catch'](handleError(_0xfa2f0d,null));};exports['getAnswers']=function(_0x130988,_0x1c969c){var _0x56bbc6={'raw':![],'where':{}};var _0x46ac9e={};var _0x2f0f1e={'count':0x0,'rows':[]};return db[_0xfa4f('0x3f')][_0xfa4f('0x55')]({'where':{'id':_0x130988[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x1c969c,null))[_0xfa4f('0x25')](function(_0x15fe22){if(_0x15fe22){_0x46ac9e[_0xfa4f('0x30')]=_[_0xfa4f('0x45')](db[_0xfa4f('0x5a')][_0xfa4f('0x2e')]);_0x46ac9e[_0xfa4f('0x31')]=_[_0xfa4f('0x45')](_0x130988['query']);_0x46ac9e[_0xfa4f('0x38')]=_['intersection'](_0x46ac9e[_0xfa4f('0x30')],_0x46ac9e[_0xfa4f('0x31')]);_0x56bbc6[_0xfa4f('0x32')]=_[_0xfa4f('0x46')](_0x46ac9e[_0xfa4f('0x30')],qs['fields'](_0x130988[_0xfa4f('0x31')]['fields']));_0x56bbc6['attributes']=_0x56bbc6['attributes'][_0xfa4f('0x34')]?_0x56bbc6[_0xfa4f('0x32')]:_0x46ac9e[_0xfa4f('0x30')];if(!_0x130988[_0xfa4f('0x31')][_0xfa4f('0x57')](_0xfa4f('0x35'))){_0x56bbc6[_0xfa4f('0x21')]=qs[_0xfa4f('0x21')](_0x130988[_0xfa4f('0x31')][_0xfa4f('0x21')]);_0x56bbc6[_0xfa4f('0x20')]=qs[_0xfa4f('0x20')](_0x130988[_0xfa4f('0x31')][_0xfa4f('0x20')]);}_0x56bbc6[_0xfa4f('0x36')]=qs[_0xfa4f('0x37')](_0x130988[_0xfa4f('0x31')][_0xfa4f('0x37')]);_0x56bbc6[_0xfa4f('0x3b')]=qs[_0xfa4f('0x38')](_[_0xfa4f('0x39')](_0x130988[_0xfa4f('0x31')],_0x46ac9e[_0xfa4f('0x38')]));_0x56bbc6['where'][_0xfa4f('0x54')]=_0x15fe22['id'];if(_0x130988[_0xfa4f('0x31')]['filter']){_0x56bbc6[_0xfa4f('0x3b')]=_[_0xfa4f('0x3c')](_0x56bbc6[_0xfa4f('0x3b')],{'$or':_[_0xfa4f('0x2d')](_0x56bbc6[_0xfa4f('0x32')],function(_0xe226c6){var _0x3c13d9={};_0x3c13d9[_0xe226c6]={'$like':'%'+_0x130988['query'][_0xfa4f('0x3a')]+'%'};return _0x3c13d9;})});}_0x56bbc6=_[_0xfa4f('0x3c')]({},_0x56bbc6,_0x130988[_0xfa4f('0x47')]);return db[_0xfa4f('0x5a')][_0xfa4f('0x22')]({'where':_0x56bbc6[_0xfa4f('0x3b')]})['then'](function(_0x36e983){_0x2f0f1e[_0xfa4f('0x22')]=_0x36e983;if(_0x130988['query']['includeAll']){_0x56bbc6[_0xfa4f('0x41')]=[{'all':!![]}];}return db[_0xfa4f('0x5a')]['findAll'](_0x56bbc6);})['then'](function(_0x51d75e){_0x2f0f1e[_0xfa4f('0x43')]=_0x51d75e;return _0x2f0f1e;});}})[_0xfa4f('0x25')](respondWithFilteredResult(_0x1c969c,_0x56bbc6))[_0xfa4f('0x1b')](handleError(_0x1c969c,null));};exports[_0xfa4f('0x5b')]=function(_0x4e33d3,_0x44f828){return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x4e33d3['params']['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x44f828,null))[_0xfa4f('0x25')](function(_0x5f1724){if(_0x5f1724){return _0x5f1724[_0xfa4f('0x5b')](_0x4e33d3[_0xfa4f('0x31')][_0xfa4f('0x59')]);}})[_0xfa4f('0x25')](respondWithStatusCode(_0x44f828,null))['catch'](handleError(_0x44f828,null));};exports['addLogo']=function(_0x754b1c,_0x1935d1){_0x754b1c[_0xfa4f('0x4a')]['sitepic']=_0x754b1c[_0xfa4f('0x5c')]['filename'];return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x754b1c[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x1935d1,null))[_0xfa4f('0x25')](saveUpdates(_0x754b1c['body'],null))[_0xfa4f('0x25')](respondWithResult(_0x1935d1,null))['catch'](handleError(_0x1935d1,null));};exports['addAvatar']=function(_0x66b310,_0x11ba1d){_0x66b310['body'][_0xfa4f('0x5d')]=_0x66b310[_0xfa4f('0x5c')][_0xfa4f('0x5e')];return db[_0xfa4f('0x3f')]['find']({'where':{'id':_0x66b310['params']['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x11ba1d,null))[_0xfa4f('0x25')](saveUpdates(_0x66b310['body'],null))[_0xfa4f('0x25')](respondWithResult(_0x11ba1d,null))[_0xfa4f('0x1b')](handleError(_0x11ba1d,null));};exports[_0xfa4f('0x5f')]=function(_0x53346d,_0x446cce){_0x53346d['body'][_0xfa4f('0x60')]=_0x53346d[_0xfa4f('0x5c')][_0xfa4f('0x5e')];return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x53346d[_0xfa4f('0x51')]['id']}})['then'](handleEntityNotFound(_0x446cce,null))['then'](saveUpdates(_0x53346d[_0xfa4f('0x4a')],null))[_0xfa4f('0x25')](respondWithResult(_0x446cce,null))[_0xfa4f('0x1b')](handleError(_0x446cce,null));};exports[_0xfa4f('0x61')]=function(_0x557c79,_0x2bfe1d){_0x557c79[_0xfa4f('0x4a')][_0xfa4f('0x62')]=_0x557c79[_0xfa4f('0x5c')]['filename'];return db['ChatWebsite'][_0xfa4f('0x48')]({'where':{'id':_0x557c79[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x2bfe1d,null))[_0xfa4f('0x25')](saveUpdates(_0x557c79[_0xfa4f('0x4a')],null))[_0xfa4f('0x25')](respondWithResult(_0x2bfe1d,null))[_0xfa4f('0x1b')](handleError(_0x2bfe1d,null));};exports['getLogo']=function(_0x32a79a,_0x5bdb7d){var _0xd2c468=path[_0xfa4f('0x63')](config[_0xfa4f('0x64')],'server/files/images/logos/default_logo.svg');var _0x3fe4e5={'where':{'id':_0x32a79a['params']['id']},'attributes':['id',_0xfa4f('0x65')],'raw':!![]};var _0x4ca51a=![];return require(_0xfa4f('0x66'))[_0xfa4f('0x67')]()['then'](function(_0x24ac63){if(_0x24ac63){_0x4ca51a=_0x24ac63['custom'];}})[_0xfa4f('0x25')](function(){return db['ChatWebsite'][_0xfa4f('0x48')](_0x3fe4e5);})['then'](handleEntityNotFound(_0x5bdb7d,null))['then'](function(_0x4c3948){if(_0x4c3948){if(!_[_0xfa4f('0x68')](_0x4c3948[_0xfa4f('0x65')])){if(fs[_0xfa4f('0x69')](path[_0xfa4f('0x63')](config['root'],_0xfa4f('0x6a'),_0x4c3948[_0xfa4f('0x65')]))&&_0x4ca51a){_0xd2c468=path['join'](config['root'],_0xfa4f('0x6a'),_0x4c3948[_0xfa4f('0x65')]);}}return _0x5bdb7d[_0xfa4f('0x6b')](_0xd2c468);}})['catch'](handleError(_0x5bdb7d,null));};exports[_0xfa4f('0x6c')]=function(_0x5aee6d,_0x281d14){var _0x1aa040=path[_0xfa4f('0x63')](config[_0xfa4f('0x64')],_0xfa4f('0x6d'));var _0x4516ca={'where':{'id':_0x5aee6d['params']['id']},'attributes':['id',_0xfa4f('0x5d')],'raw':!![]};return db[_0xfa4f('0x3f')]['find'](_0x4516ca)[_0xfa4f('0x25')](handleEntityNotFound(_0x281d14,null))[_0xfa4f('0x25')](function(_0x29c794){if(_0x29c794){if(!_[_0xfa4f('0x68')](_0x29c794[_0xfa4f('0x5d')])){if(fs['existsSync'](path[_0xfa4f('0x63')](config[_0xfa4f('0x64')],_0xfa4f('0x6e'),_0x29c794['agentAvatar']))){_0x1aa040=path[_0xfa4f('0x63')](config[_0xfa4f('0x64')],_0xfa4f('0x6e'),_0x29c794[_0xfa4f('0x5d')]);}}return _0x281d14[_0xfa4f('0x6b')](_0x1aa040);}})[_0xfa4f('0x1b')](handleError(_0x281d14,null));};exports[_0xfa4f('0x6f')]=function(_0x13183a,_0x37c734){var _0x2735aa=path[_0xfa4f('0x63')](config[_0xfa4f('0x64')],'server/files/images/avatars/customer_avatar.png');var _0x58ae55={'where':{'id':_0x13183a['params']['id']},'attributes':['id','customerAvatar',_0xfa4f('0x70')],'raw':!![]};return db[_0xfa4f('0x3f')][_0xfa4f('0x48')](_0x58ae55)[_0xfa4f('0x25')](handleEntityNotFound(_0x37c734,null))[_0xfa4f('0x25')](function(_0x1c4632){if(_0x1c4632){if(!_['isNil'](_0x1c4632[_0xfa4f('0x60')])){if(fs[_0xfa4f('0x69')](path[_0xfa4f('0x63')](config['root'],'server/files/images/avatars/',_0x1c4632['customerAvatar']))&&_0x1c4632[_0xfa4f('0x70')]){_0x2735aa=path['join'](config[_0xfa4f('0x64')],'server/files/images/avatars/',_0x1c4632[_0xfa4f('0x60')]);}}return _0x37c734['download'](_0x2735aa);}})[_0xfa4f('0x1b')](handleError(_0x37c734,null));};exports[_0xfa4f('0x71')]=function(_0x117d64,_0x4576b7){var _0x488a16=path['join'](config[_0xfa4f('0x64')],_0xfa4f('0x72'));var _0x3b4d5a={'where':{'id':_0x117d64[_0xfa4f('0x51')]['id']},'attributes':['id',_0xfa4f('0x62')],'raw':!![]};return db[_0xfa4f('0x3f')]['find'](_0x3b4d5a)[_0xfa4f('0x25')](handleEntityNotFound(_0x4576b7,null))[_0xfa4f('0x25')](function(_0x469e81){if(_0x469e81){if(!_[_0xfa4f('0x68')](_0x469e81[_0xfa4f('0x62')])){if(fs['existsSync'](path[_0xfa4f('0x63')](config['root'],'server/files/images/avatars/',_0x469e81[_0xfa4f('0x62')]))){_0x488a16=path['join'](config['root'],_0xfa4f('0x6e'),_0x469e81['systemAvatar']);}}return _0x4576b7[_0xfa4f('0x6b')](_0x488a16);}})[_0xfa4f('0x1b')](handleError(_0x4576b7,null));};exports['notify']=function(_0x205e05,_0x30691f){var _0x43be2f=require('user-agent-parser');var _0x1dfc61=new _0x43be2f();var _0x9bc9f9=_0x1dfc61[_0xfa4f('0x73')](_0x205e05[_0xfa4f('0x74')][_0xfa4f('0x75')])[_0xfa4f('0x76')]();var _0x5c9d94={'body':_0x205e05[_0xfa4f('0x4a')],'channel':_0xfa4f('0x77')};var _0x19f21f=[];var _0x592746=[];var _0x227a13={};var _0x499728=![];return db[_0xfa4f('0x78')][_0xfa4f('0x53')]()['then'](function(_0x216430){if(!_0x216430){throw new db['Sequelize']['ValidationError'](_0xfa4f('0x79'));}_0x19f21f=_[_0xfa4f('0x7a')](_[_0xfa4f('0x45')](_0x216430),['createdAt',_0xfa4f('0x7b')]);_0x592746=_['difference'](_[_0xfa4f('0x45')](_0x216430),[_0xfa4f('0x7c'),_0xfa4f('0x7b'),_0xfa4f('0x7d'),_0xfa4f('0x7e')]);if(_0x205e05[_0xfa4f('0x4a')]['id']){delete _0x205e05[_0xfa4f('0x4a')]['id'];}if(_['isNil'](_0x205e05['body']['from'])){throw new db['Sequelize']['ValidationError'](_0xfa4f('0x7f'));}if(_[_0xfa4f('0x68')](_0x205e05[_0xfa4f('0x4a')]['body'])||_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0x4a')]===''){throw new db[(_0xfa4f('0x80'))][(_0xfa4f('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfa4f('0x68')](_0x205e05[_0xfa4f('0x4a')]['mapKey'])){throw new db[(_0xfa4f('0x80'))][(_0xfa4f('0x81'))](_0xfa4f('0x82')+_0x592746);}if(!_[_0xfa4f('0x83')](_0x592746,_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0x84')])){throw new db['Sequelize'][(_0xfa4f('0x81'))](_0xfa4f('0x85')+_0x592746);}_0x227a13[_0x205e05['body'][_0xfa4f('0x84')]]=_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0x86')];})[_0xfa4f('0x25')](function(){return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x205e05['params']['id']},'include':[{'model':db[_0xfa4f('0x87')],'as':_0xfa4f('0x88'),'include':[{'model':db[_0xfa4f('0x78')],'as':_0xfa4f('0x89'),'where':_0x227a13,'limit':0x1,'order':[['updatedAt',_0xfa4f('0x8a')]]}]},{'model':db[_0xfa4f('0x8b')],'as':'Applications'}]});})[_0xfa4f('0x25')](handleEntityNotFound(_0x30691f,null))[_0xfa4f('0x25')](function(_0x58d410){if(_0x58d410&&_0x58d410[_0xfa4f('0x88')]){_0x5c9d94[_0xfa4f('0x8c')]=_0x58d410;_0x5c9d94[_0xfa4f('0x8d')]=_0x58d410[_0xfa4f('0x8e')];_0x5c9d94[_0xfa4f('0x8f')]=_0x58d410[_0xfa4f('0x88')];_0x5c9d94['applications']=_['orderBy'](_0x5c9d94[_0xfa4f('0x8d')],[_0xfa4f('0x90')],[_0xfa4f('0x91')]);if(_0x5c9d94[_0xfa4f('0x8c')][_0xfa4f('0x8e')]){delete _0x5c9d94[_0xfa4f('0x8c')][_0xfa4f('0x8e')];}if(_0x5c9d94[_0xfa4f('0x8c')][_0xfa4f('0x88')]&&_0x5c9d94['account']['List'][_0xfa4f('0x89')]['length']){return _0x5c9d94['account'][_0xfa4f('0x88')]['Contacts'][0x0];}var _0x2ad64d=_[_0xfa4f('0xd')](_0x205e05[_0xfa4f('0x4a')],{'firstName':_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0x86')],'ListId':_0x58d410[_0xfa4f('0x7e')]});_0x2ad64d[_0x205e05['body']['mapKey']]=_0x205e05['body']['from'];return db[_0xfa4f('0x78')]['create'](_0x2ad64d,{'fields':_0x19f21f,'raw':!![]});}})[_0xfa4f('0x25')](handleEntityNotFound(_0x30691f,null))[_0xfa4f('0x25')](function(_0x406f3b){_0x5c9d94[_0xfa4f('0x92')]=_0x406f3b;var _0x3a174f=_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0x93')];if(_0x205e05['headers'][_0xfa4f('0x94')]){_0x3a174f=_0x205e05[_0xfa4f('0x74')]['cf-connecting-ip'];}else if(_0x205e05['headers'][_0xfa4f('0x95')]){_0x3a174f=_[_0xfa4f('0x96')](_0x205e05['headers']['x-forwarded-for'][_0xfa4f('0x97')](','));}if(_0x406f3b){var _0xd1092b={'ContactId':_0x406f3b['id'],'ChatWebsiteId':_0x205e05['params']['id'],'from':(_0x406f3b['firstName']||'')+'\x20'+(_0x406f3b['lastName']||''),'customerIp':_0x3a174f,'customerPort':_0x205e05[_0xfa4f('0x74')][_0xfa4f('0x98')]?_0x205e05['headers'][_0xfa4f('0x98')]:null,'referer':_0x205e05[_0xfa4f('0x4a')]['referer'],'browserName':_0x9bc9f9[_0xfa4f('0x99')][_0xfa4f('0x2b')]&&_0x9bc9f9[_0xfa4f('0x99')][_0xfa4f('0x9a')]?util['format'](_0xfa4f('0x9b'),_0x9bc9f9['browser']['name'],_0x9bc9f9[_0xfa4f('0x99')]['version']):_0xfa4f('0x9c'),'browserVersion':_0x9bc9f9[_0xfa4f('0x99')]['version']||_0xfa4f('0x9c'),'osName':util[_0xfa4f('0x9d')]('%s\x20%s',_0x9bc9f9['os'][_0xfa4f('0x2b')],_0x9bc9f9['os'][_0xfa4f('0x9a')]),'osVersion':_0x9bc9f9['os'][_0xfa4f('0x9a')],'deviceModel':_0x9bc9f9[_0xfa4f('0x9e')][_0xfa4f('0x30')]&&_0x9bc9f9[_0xfa4f('0x9e')][_0xfa4f('0x9f')]?util[_0xfa4f('0x9d')](_0xfa4f('0xa0'),_0x9bc9f9['device'][_0xfa4f('0x30')],_0x9bc9f9[_0xfa4f('0x9e')]['vendor'],_0x9bc9f9[_0xfa4f('0x9e')][_0xfa4f('0x3d')]):null,'deviceVendor':_0x9bc9f9[_0xfa4f('0x9e')]['vendor'],'deviceType':_0x9bc9f9[_0xfa4f('0x9e')][_0xfa4f('0x3d')],'formData':JSON[_0xfa4f('0x18')](_0x205e05[_0xfa4f('0x4a')])};var _0xc74962={'ChatWebsiteId':_0x205e05[_0xfa4f('0x51')]['id'],'closed':![]};if(_0x205e05[_0xfa4f('0x4a')]['threadId']){_0xc74962[_0xfa4f('0xa1')]=_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0xa1')];return db[_0xfa4f('0xa2')][_0xfa4f('0x48')]({'where':_0xc74962})[_0xfa4f('0x25')](function(_0x5dd9ca){if(_0x5dd9ca){return[_0x5dd9ca,![]];}_0xd1092b[_0xfa4f('0xa1')]=_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0xa1')];_0xd1092b[_0xfa4f('0xa3')]=_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0xa3')];return db['ChatInteraction'][_0xfa4f('0x49')](_0xd1092b)[_0xfa4f('0x25')](function(_0x3545a3){return[_0x3545a3,!![]];});});}_0xc74962[_0xfa4f('0xa4')]=_0x406f3b['id'];if(_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0xa5')]&&_0x205e05['body'][_0xfa4f('0xa5')]['id']){_0xc74962['id']=_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0xa5')]['id'];return db[_0xfa4f('0xa2')][_0xfa4f('0x48')]({'where':_0xc74962})[_0xfa4f('0x25')](function(_0x54696c){if(_0x54696c){return[_0x54696c,![]];}return db['ChatInteraction']['create'](_0xd1092b)[_0xfa4f('0x25')](function(_0x3c1a26){return[_0x3c1a26,!![]];});});}return db[_0xfa4f('0xa2')]['create'](_0xd1092b)[_0xfa4f('0x25')](function(_0x3c5c76){return[_0x3c5c76,!![]];});}})['spread'](function(_0x200b4a,_0x2b38b8){if(_0x200b4a){_0x499728=_0x2b38b8;if(!_0x2b38b8){var _0x347c7c={'from':(_0x5c9d94[_0xfa4f('0x92')]['firstName']||'')+'\x20'+(_0x5c9d94[_0xfa4f('0x92')][_0xfa4f('0xa6')]||'')};if(_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0xa1')]&&_0x205e05[_0xfa4f('0x4a')]['messageId']&&_0x205e05[_0xfa4f('0x4a')]['threadId']!=_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0xa7')]){_0x347c7c[_0xfa4f('0xa1')]=_0x205e05[_0xfa4f('0x4a')][_0xfa4f('0xa7')];}return _0x200b4a[_0xfa4f('0xa8')](_0x347c7c);}else{return _0x200b4a;}}})['then'](function(_0x1b7d92){_0x5c9d94[_0xfa4f('0xa5')]=_0x1b7d92['get']({'plain':!![]});_0x5c9d94[_0xfa4f('0xa5')][_0xfa4f('0xa9')]=_0x499728;if(_0x5c9d94[_0xfa4f('0xa5')]['created']){if(_0x5c9d94[_0xfa4f('0x8c')][_0xfa4f('0xaa')]){_0x5c9d94[_0xfa4f('0x8d')][_0xfa4f('0xab')]({'id':0x0,'priority':_0x5c9d94[_0xfa4f('0x8d')]['length']+0x1,'app':_0xfa4f('0xac'),'appdata':'unmanaged','interval':_0xfa4f('0xad')});}}return db[_0xfa4f('0xae')][_0xfa4f('0x49')]({'body':_0x205e05[_0xfa4f('0x4a')]['body'],'ChatWebsiteId':_0x205e05[_0xfa4f('0x51')]['id'],'ChatInteractionId':_0x1b7d92['id'],'direction':'in','ContactId':_0x5c9d94[_0xfa4f('0x92')]['id'],'AttachmentId':_0x205e05['body'][_0xfa4f('0xaf')]});})['then'](function(_0x14f24b){_0x5c9d94[_0xfa4f('0x1a')]=_0x14f24b;if(_0x5c9d94[_0xfa4f('0xa5')][_0xfa4f('0xb0')]){return db[_0xfa4f('0xb1')][_0xfa4f('0x48')]({'attributes':['id',_0xfa4f('0x2b')],'where':{'id':_0x5c9d94[_0xfa4f('0xa5')]['UserId']}})['then'](function(_0x5c41dc){if(_0x5c41dc){_0x5c9d94[_0xfa4f('0x8d')][_0xfa4f('0xb2')]({'id':0x0,'priority':0x0,'app':_0xfa4f('0xb3'),'appdata':_0x5c41dc[_0xfa4f('0x2b')]+','+(_0x5c9d94['account'][_0xfa4f('0xb4')]||0xa),'interval':_0xfa4f('0xad')});_0x5c9d94[_0xfa4f('0xb5')]=!![];}return respondWithRpcPromise(_0xfa4f('0xb6'),_0xfa4f('0xb7'),_0x5c9d94);});}return respondWithRpcPromise(_0xfa4f('0xb6'),_0xfa4f('0xb7'),_0x5c9d94);})[_0xfa4f('0x25')](function(_0x3a81e2){respondWithRpcPromise(_0xfa4f('0xb8'),_0xfa4f('0xb8'),{'event':_0xfa4f('0xb9'),'message':_0x3a81e2},client9002);return _0x3a81e2;})[_0xfa4f('0x25')](respondWithResult(_0x30691f,null))[_0xfa4f('0x1b')](handleError(_0x30691f,null));};exports[_0xfa4f('0xba')]=function(_0x3b55f9,_0x1f2dbd){var _0x588b25,_0x595619,_0x2b3228;var _0x1490f9=[];var _0x5e5e9f={};var _0x3d6539=_0x3b55f9[_0xfa4f('0xbb')]||[];var _0x47d435=[];var _0x3a4edf;return db[_0xfa4f('0x78')][_0xfa4f('0x53')]()['then'](function(_0x5d1c3b){if(!_0x5d1c3b){throw new db['Sequelize'][(_0xfa4f('0x81'))](_0xfa4f('0x79'));}_0x1490f9=_[_0xfa4f('0x7a')](_[_0xfa4f('0x45')](_0x5d1c3b),[_0xfa4f('0x7c'),_0xfa4f('0x7b'),'CompanyId',_0xfa4f('0x7e')]);if(_0x3b55f9[_0xfa4f('0x4a')]['id']){delete _0x3b55f9['body']['id'];}if(_[_0xfa4f('0x68')](_0x3b55f9[_0xfa4f('0x4a')]['from'])){throw _0x1f2dbd['status'](0x1f4)[_0xfa4f('0xbc')](new db[(_0xfa4f('0x80'))][(_0xfa4f('0x81'))](_0xfa4f('0x7f')));}if(_[_0xfa4f('0x68')](_0x3b55f9[_0xfa4f('0x4a')][_0xfa4f('0x4a')])||_0x3b55f9[_0xfa4f('0x4a')][_0xfa4f('0x4a')]===''){throw _0x1f2dbd[_0xfa4f('0x1d')](0x1f4)[_0xfa4f('0xbc')](new db['Sequelize']['ValidationError'](_0xfa4f('0xbd')));}if(_['isNil'](_0x3b55f9[_0xfa4f('0x4a')][_0xfa4f('0xbe')])){throw _0x1f2dbd[_0xfa4f('0x1d')](0x1f4)['send'](new db[(_0xfa4f('0x80'))][(_0xfa4f('0x81'))](_0xfa4f('0xbf')+_0x1490f9));}if(!_['includes'](_0x1490f9,_0x3b55f9[_0xfa4f('0x4a')][_0xfa4f('0xbe')])){throw _0x1f2dbd[_0xfa4f('0x1d')](0x1f4)['send'](new db[(_0xfa4f('0x80'))][(_0xfa4f('0x81'))](_0xfa4f('0xc0')+_0x1490f9));}_0x5e5e9f[_0x3b55f9[_0xfa4f('0x4a')][_0xfa4f('0xbe')]]=_0x3b55f9[_0xfa4f('0x4a')][_0xfa4f('0x86')];})[_0xfa4f('0x25')](function(){return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x3b55f9['params']['id']},'include':[{'model':db[_0xfa4f('0x87')],'as':_0xfa4f('0x88')},{'model':db['MailAccount'],'as':_0xfa4f('0xc1')}]});})[_0xfa4f('0x25')](handleEntityNotFound(_0x1f2dbd,null))[_0xfa4f('0x25')](function(_0x310059){if(_0x310059&&_0x310059['List']){_0x595619=_0x310059;var _0x44e14c=_[_0xfa4f('0xd')](_0x3b55f9[_0xfa4f('0x4a')],{'firstName':_0x3b55f9['body'][_0xfa4f('0x86')],'phone':_0x3b55f9['body'][_0xfa4f('0x86')],'ListId':_0x310059[_0xfa4f('0x7e')]});_0x44e14c[_0x3b55f9[_0xfa4f('0x4a')]['mapKeyOffline']]=_0x3b55f9[_0xfa4f('0x4a')][_0xfa4f('0x86')];return db['CmContact'][_0xfa4f('0xc2')]({'where':_0x5e5e9f,'defaults':_0x44e14c});}})[_0xfa4f('0xc3')](function(_0x5dcb52){if(_0x5dcb52){_0x2b3228=_0x5dcb52;var _0x40d904=fs[_0xfa4f('0xc4')](path[_0xfa4f('0x63')](config['root'],_0xfa4f('0xc5')),'utf8');var _0x35cd8c=ejs[_0xfa4f('0xc6')](_0x40d904,{'body':_[_0xfa4f('0xc7')](_0x3b55f9[_0xfa4f('0x4a')][_0xfa4f('0x4a')]),'bodyTitle':_0x595619['offlineMessageBody']});return db[_0xfa4f('0xc8')][_0xfa4f('0x49')]({'body':_0x35cd8c,'plainBody':htmlToText[_0xfa4f('0xc9')](_0x35cd8c),'ContactId':_0x5dcb52['id'],'ChatWebsiteId':_0x595619['id']});}})[_0xfa4f('0x25')](function(_0x4bdbf1){_0x3a4edf=_0x4bdbf1;if(_0x3d6539['length']){var _0x20f150=_0x3d6539[_0xfa4f('0x2d')](function(_0x5059f2){return{'name':_0x5059f2[_0xfa4f('0xca')],'basename':_0x5059f2[_0xfa4f('0x5e')],'type':_0x5059f2[_0xfa4f('0xcb')],'ChatOfflineMessageId':_0x4bdbf1['id']};});_0x47d435=_0x20f150[_0xfa4f('0x2d')](_0x450dc0=>{var _0x13e371={'filename':_0x450dc0[_0xfa4f('0x2b')],'path':path[_0xfa4f('0x63')](config[_0xfa4f('0x64')],_0xfa4f('0xcc'),_0xfa4f('0xbb'),_0xfa4f('0xcd'),_0xfa4f('0xce'),_0x450dc0[_0xfa4f('0xcf')])};return _0x13e371;});if(!_0x595619['openNewInteraction']){return db[_0xfa4f('0xd0')][_0xfa4f('0xd1')](function(_0x150df3){return db[_0xfa4f('0xd2')][_0xfa4f('0xd3')](_0x20f150,{'transaction':_0x150df3});});}}})[_0xfa4f('0x25')](function(){if(_0x3a4edf){_0x588b25=_0x3a4edf;return db[_0xfa4f('0xc1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfa4f('0xd4')],'as':_0xfa4f('0xd5'),'raw':!![],'include':[{'model':db[_0xfa4f('0xd6')],'as':_0xfa4f('0xd6'),'raw':!![]}]}]});}})[_0xfa4f('0x25')](function(_0x5d2cef){if(_0x5d2cef&&_0x5d2cef['Smtp']&&_0x595619[_0xfa4f('0xd7')]&&_0x595619[_0xfa4f('0xd8')]){var _0x319e0f=_0x5d2cef[_0xfa4f('0xd9')]();return respondWithRpcPromise(_0xfa4f('0xda'),_0xfa4f('0xdb'),{'account':_0x319e0f,'message':{'from':util['format'](_0xfa4f('0xdc'),_0x5d2cef[_0xfa4f('0x2b')],_0x5d2cef[_0xfa4f('0xdd')]||_0x5d2cef[_0xfa4f('0xd5')][_0xfa4f('0x4b')]),'to':_0x595619[_0xfa4f('0xd8')],'subject':_0x595619[_0xfa4f('0xde')],'html':_0x588b25[_0xfa4f('0x4a')],'attachments':_0x47d435}},client9003)[_0xfa4f('0x25')](function(){return _0x588b25;})[_0xfa4f('0x1b')](function(_0x56ef3c){logger[_0xfa4f('0x19')](_0x56ef3c);});}})[_0xfa4f('0x25')](function(){if(_0x595619&&_0x595619[_0xfa4f('0xdf')]&&_0x595619[_0xfa4f('0xe0')]){var _0x176c04=[];if(_0x3d6539[_0xfa4f('0x34')]){_0x176c04=_0x3d6539['map'](function(_0x374c8f){return{'name':_0x374c8f['originalname'],'basename':_0x374c8f[_0xfa4f('0x5e')],'type':_0x374c8f[_0xfa4f('0xcb')],'ChatOfflineMessageId':_0x3a4edf['id']};});}var _0x69c778;if(!_[_0xfa4f('0x68')](_0x595619[_0xfa4f('0xe1')])){var _0x1e5442=_[_0xfa4f('0x2d')](_0x3b55f9[_0xfa4f('0x4a')],function(_0x16e7ae){return _0x16e7ae;});var _0x26315d=_[_0xfa4f('0xe2')](_0x1e5442)[0x0];var _0x344b07=_[_0xfa4f('0xe3')](_0x26315d,function(_0x4060e7){return _0x4060e7;});_0x69c778=_0x344b07[0x1][_0x595619['subjectOffline']];}var _0x31dcc7={'from':_0x2b3228[_0xfa4f('0xdd')],'firstName':_0x2b3228[_0xfa4f('0xe4')],'lastName':_0x2b3228[_0xfa4f('0xa6')],'mapKey':_0xfa4f('0xdd'),'message':{'from':_0x2b3228['email'],'to':_0x595619[_0xfa4f('0xc1')][_0xfa4f('0xdd')],'cc':'','subject':_[_0xfa4f('0x68')](_0x69c778)?_0x595619[_0xfa4f('0xde')]:_0x69c778,'messageId':'','sentAt':new Date(),'attach':_0x176c04[_0xfa4f('0x34')],'attachments':_0x176c04,'originChannel':'Chat','ChatWebsiteId':_0x595619['id'],'ChatOfflineMessageId':_0x588b25['id'],'originTo':_0x595619[_0xfa4f('0xc1')][_0xfa4f('0xdd')]},'body':_0x588b25[_0xfa4f('0x4a')]};var _0x5ecee7={'account':{'id':_0x595619['MailAccountId']},'body':_0x31dcc7,'log':_0xfa4f('0xe5')};return respondWithRpcPromise(_0xfa4f('0xe5'),_0xfa4f('0xe6'),_0x5ecee7,client9001)['then'](function(){return _0x588b25;})[_0xfa4f('0x1b')](function(_0x2e97b2){logger[_0xfa4f('0x19')](_0x2e97b2);});}return;})['then'](function(){if(_0x588b25){return _0x588b25;}})['then'](respondWithResult(_0x1f2dbd,null))[_0xfa4f('0x1b')](function(_0x5354c5){logger['error'](_0xfa4f('0x1b'),_0x5354c5);for(var _0x5a40a9 of _0x3d6539){var _0x59eff8=path[_0xfa4f('0x63')](config[_0xfa4f('0x64')],_0xfa4f('0xcc'),_0xfa4f('0xbb'),_0xfa4f('0xcd'),'offline-chat',_0x5a40a9[_0xfa4f('0x5e')]);fs_extra['remove'](_0x59eff8)['catch'](function(_0x5b9c93){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x59eff8,_0x5b9c93);});}});};exports[_0xfa4f('0xe7')]=function(_0x2cc7e4,_0x2d597e){return db['ChatInteraction'][_0xfa4f('0x48')]({'where':{'id':_0x2cc7e4[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x2d597e,null))[_0xfa4f('0x25')](function(_0x13a357){if(_0x13a357){return _0x13a357[_0xfa4f('0xe7')](_0x2cc7e4[_0xfa4f('0x4a')][_0xfa4f('0x59')],_[_0xfa4f('0xe8')](_0x2cc7e4[_0xfa4f('0x4a')],['ids','id'])||{});}})[_0xfa4f('0x25')](respondWithResult(_0x2d597e,null))['catch'](handleError(_0x2d597e,null));};exports[_0xfa4f('0xe9')]=function(_0xbb0e3c,_0x2e6792){var _0xb7e934={'raw':![],'where':{}};var _0x59b8a5={};var _0x36c983={'count':0x0,'rows':[]};return db[_0xfa4f('0x3f')][_0xfa4f('0x55')]({'where':{'id':_0xbb0e3c[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x2e6792,null))[_0xfa4f('0x25')](function(_0x175de1){if(_0x175de1){_0x59b8a5[_0xfa4f('0x30')]=_[_0xfa4f('0x45')](db[_0xfa4f('0xa2')][_0xfa4f('0x2e')]);_0x59b8a5[_0xfa4f('0x31')]=_['keys'](_0xbb0e3c[_0xfa4f('0x31')]);_0x59b8a5[_0xfa4f('0x38')]=_['intersection'](_0x59b8a5[_0xfa4f('0x30')],_0x59b8a5['query']);_0xb7e934[_0xfa4f('0x32')]=_[_0xfa4f('0x46')](_0x59b8a5['model'],qs['fields'](_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0x33')]));_0xb7e934[_0xfa4f('0x32')]=_0xb7e934[_0xfa4f('0x32')][_0xfa4f('0x34')]?_0xb7e934[_0xfa4f('0x32')]:_0x59b8a5[_0xfa4f('0x30')];if(!_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0x57')](_0xfa4f('0x35'))){_0xb7e934[_0xfa4f('0x21')]=qs['limit'](_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0x21')]);_0xb7e934[_0xfa4f('0x20')]=qs[_0xfa4f('0x20')](_0xbb0e3c['query'][_0xfa4f('0x20')]);}_0xb7e934[_0xfa4f('0x36')]=qs['sort'](_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0x37')]);_0xb7e934[_0xfa4f('0x3b')]=qs['filters'](_[_0xfa4f('0x39')](_0xbb0e3c['query'],_0x59b8a5['filters']));_0xb7e934[_0xfa4f('0x3b')][_0xfa4f('0x54')]=_0x175de1['id'];if(_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0x3a')]){_0xb7e934[_0xfa4f('0x3b')]=_[_0xfa4f('0x3c')](_0xb7e934[_0xfa4f('0x3b')],{'$or':_[_0xfa4f('0x2d')](_0xb7e934['attributes'],function(_0x3ab097){var _0x4f5fe2={};_0x4f5fe2[_0x3ab097]={'$like':'%'+_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0x3a')]+'%'};return _0x4f5fe2;})});}_0xb7e934=_['merge']({},_0xb7e934,_0xbb0e3c[_0xfa4f('0x47')]);return db[_0xfa4f('0xa2')]['count']({'where':_0xb7e934[_0xfa4f('0x3b')]})[_0xfa4f('0x25')](function(_0x2c5cdd){_0x36c983[_0xfa4f('0x22')]=_0x2c5cdd;if(_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0x40')]){_0xb7e934[_0xfa4f('0x41')]=[{'model':db['CmContact'],'as':_0xfa4f('0xea'),'required':![]},{'model':db[_0xfa4f('0xb1')],'as':_0xfa4f('0xeb'),'attributes':[_0xfa4f('0x2b'),_0xfa4f('0xec'),'internal'],'required':![]},{'model':db[_0xfa4f('0xed')],'as':_0xfa4f('0xee'),'attributes':['id',_0xfa4f('0x2b'),_0xfa4f('0xef')],'where':_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0xf0')]?{'id':_0xbb0e3c[_0xfa4f('0x31')]['tag']}:undefined,'required':_0xbb0e3c[_0xfa4f('0x31')][_0xfa4f('0xf0')]?!![]:![]}];}return db[_0xfa4f('0xa2')][_0xfa4f('0x42')](_0xb7e934);})[_0xfa4f('0x25')](function(_0x591afe){_0x36c983['rows']=_0x591afe;return _0x36c983;});}})[_0xfa4f('0x25')](respondWithFilteredResult(_0x2e6792,_0xb7e934))[_0xfa4f('0x1b')](handleError(_0x2e6792,null));};function iftimePromise(_0x1ef8ba,_0x564b0a){return respondWithRpcPromise('Command',_0xfa4f('0xf1'),{'command':_0x564b0a[_0xfa4f('0xf2')]?util[_0xfa4f('0x9d')](_0xfa4f('0xf3'),_0x1ef8ba['interval'],_0x564b0a[_0xfa4f('0xf2')]):util[_0xfa4f('0x9d')](_0xfa4f('0xf4'),_0x1ef8ba['interval'])},client9002)['then'](function(_0x301b16){var _0x13eedc=_0x301b16&&_0x301b16['indexOf'](_0xfa4f('0xf5'))>=0x0?!![]:![];logger['info'](_0xfa4f('0xf6'),_0x564b0a['id'],_0x1ef8ba['id'],_0x1ef8ba['interval'],_0x13eedc?_0xfa4f('0xf7'):_0xfa4f('0xf8'),_0x564b0a[_0xfa4f('0xf2')]?_0x564b0a['timezone']:'No\x20timezone');return _0x13eedc;})[_0xfa4f('0x1b')](function(_0x42ec70){logger[_0xfa4f('0x19')](_0xfa4f('0xf6'),_0x564b0a['id'],_0x1ef8ba['id'],_0x1ef8ba[_0xfa4f('0xf9')],util[_0xfa4f('0xfa')](_0x42ec70,{'showHidden':![],'depth':null}),_0x564b0a['timezone']?_0x564b0a[_0xfa4f('0xf2')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x24096a,_0x488e3f){var _0x24ac3c=0x0;var _0x3d13fe=0x0;var _0x38db69=![];var _0x1572a3;var _0x258249;return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x24096a['params']['id']},'include':[{'model':db[_0xfa4f('0xfb')],'as':'Interval','include':[{'model':db[_0xfa4f('0xfb')],'as':_0xfa4f('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xfa4f('0x25')](handleEntityNotFound(_0x488e3f,null))[_0xfa4f('0x25')](function(_0x352481){if(_0x352481){_0x1572a3=_0x352481;return _0x352481[_0xfa4f('0xfd')]({'raw':!![]});}})[_0xfa4f('0x25')](function(_0x585cdf){if(_0x1572a3){if(_0x585cdf){_0x258249=_0x585cdf;}}return require(_0xfa4f('0x66'))[_0xfa4f('0x67')]();})[_0xfa4f('0x25')](function(_0x5a429a){if(_0x5a429a){_0x3d13fe=_0x5a429a['virtual'];_0x38db69=_0x5a429a[_0xfa4f('0xfe')];}})['then'](function(){return db[_0xfa4f('0xa2')][_0xfa4f('0x22')]({'where':{'closed':![]}});})[_0xfa4f('0x25')](function(_0x1a29d2){_0x24ac3c=_0x1a29d2;if(_0x3d13fe&&_0x1a29d2>_0x3d13fe){return db['License'][_0xfa4f('0x55')]({'where':{'id':0x1}})[_0xfa4f('0x25')](function(_0x5381c3){if(_0x5381c3){_0x5381c3[_0xfa4f('0xff')](_0xfa4f('0x100'));}});}})[_0xfa4f('0x25')](function(){if(_0x1572a3[_0xfa4f('0xfb')]&&_0x1572a3[_0xfa4f('0xfb')][_0xfa4f('0xfc')]){var _0x4961a4=[];for(var _0x573716=0x0;_0x573716<_0x1572a3[_0xfa4f('0xfb')][_0xfa4f('0xfc')][_0xfa4f('0x34')];_0x573716++){var _0x2c23d1=_0x1572a3[_0xfa4f('0xfb')][_0xfa4f('0xfc')][_0x573716][_0xfa4f('0x27')]({'plain':!![]});_0x4961a4[_0xfa4f('0xab')](iftimePromise(_0x2c23d1,_0x1572a3));}return BPromise[_0xfa4f('0x101')](_0x4961a4)['then'](function(_0x50e296){return _['some'](_0x50e296);});}else{return!![];}})[_0xfa4f('0x25')](function(_0x198e3e){var _0x11b634=fs[_0xfa4f('0xc4')](path[_0xfa4f('0x63')](config[_0xfa4f('0x64')],_0xfa4f('0x102')),_0xfa4f('0x103'));var _0x41b9ee={'remote':_0x1572a3['remote'],'query':querystring[_0xfa4f('0x18')](_[_0xfa4f('0x3c')](_0x1572a3[_0xfa4f('0x27')]({'plain':!![]}),{'customerIp':_0x24096a[_0xfa4f('0x74')][_0xfa4f('0x95')]||_0x24096a[_0xfa4f('0x74')][_0xfa4f('0x104')]||_0x24096a[_0xfa4f('0x105')][_0xfa4f('0x106')]||_0x24096a['ip'],'referer':_0x24096a[_0xfa4f('0x74')][_0xfa4f('0x107')],'openedInteractions':_0x24ac3c,'maxInteractions':_0x3d13fe,'virtual':_0x38db69['virtual'],'online':_0x198e3e,'custom':_0x38db69}))[_0xfa4f('0x108')](/'/g,'\x5c\x27')};_0x488e3f[_0xfa4f('0xbc')](ejs['render'](Mustache['render'](_0x11b634,_0x41b9ee),{'proactiveActions':_0x258249,'alignment':_0x1572a3[_0xfa4f('0x109')],'verticalAlignment':_0x1572a3[_0xfa4f('0x10a')],'div_color':_0x1572a3[_0xfa4f('0xef')],'labelText':_0x1572a3[_0xfa4f('0x10b')],'text_color':_0x1572a3[_0xfa4f('0x10c')],'text_button_color':_0x1572a3[_0xfa4f('0x10d')],'button_color':_0x1572a3[_0xfa4f('0x10e')],'background_color':_0x1572a3[_0xfa4f('0x10f')],'hideWhenOffline':_0x1572a3['hideWhenOffline'],'interval':_0x1572a3[_0xfa4f('0x110')]}));})[_0xfa4f('0x1b')](handleError(_0x488e3f,null));};exports[_0xfa4f('0x111')]=function(_0xd9e519,_0x7d79e9){var _0xd754cd=_0xd9e519[_0xfa4f('0x51')]['id'];var _0x5a400b=_0xd9e519[_0xfa4f('0x4a')];var _0x4177e5=0xc8;var _0x42c4a9=null;return db['sequelize'][_0xfa4f('0xd1')]({'isolationLevel':db[_0xfa4f('0xd0')][_0xfa4f('0x112')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x26a8ca){return db[_0xfa4f('0x3f')][_0xfa4f('0x55')]({'where':{'id':_0xd754cd},'transaction':_0x26a8ca})[_0xfa4f('0x25')](function(_0x5385d3){if(_0x5385d3){return db[_0xfa4f('0x8b')][_0xfa4f('0x26')]({'where':{'ChatWebsiteId':_0xd754cd},'transaction':_0x26a8ca})['then'](function(){var _0x2bf180=_['map'](_0x5a400b,function(_0x1d0ae8){_0x1d0ae8[_0xfa4f('0x54')]=_0xd754cd;return _0x1d0ae8;});return db['ChatApplication'][_0xfa4f('0xd3')](_0x2bf180,{'transaction':_0x26a8ca});});}else{_0x4177e5=0x194;_0x42c4a9=[];}});})[_0xfa4f('0x25')](function(){if(_0x4177e5!==0x194){return db[_0xfa4f('0x8b')][_0xfa4f('0x113')]({'where':{'ChatWebsiteId':_0xd754cd},'order':_0xfa4f('0x90')})['then'](function(_0x54671c){_0x42c4a9=_0x54671c;});}})[_0xfa4f('0x1b')](function(_0x4fc2d3){_0x4177e5=0x1f4;logger[_0xfa4f('0x19')](_0x4fc2d3[_0xfa4f('0x2a')]);if(_0x4fc2d3['name']){delete _0x4fc2d3[_0xfa4f('0x2b')];}_0x42c4a9=_0x4fc2d3;})[_0xfa4f('0x114')](function(){if(_0x42c4a9===null){_0x7d79e9[_0xfa4f('0x1c')](_0x4177e5);}else{if(_0x4177e5===0x1f4){_0x7d79e9[_0xfa4f('0x1d')](_0x4177e5)[_0xfa4f('0xbc')](_0x42c4a9);}else{_0x7d79e9[_0xfa4f('0x1d')](_0x4177e5)[_0xfa4f('0x1f')](_0x42c4a9);}}});};exports[_0xfa4f('0x115')]=function(_0x2df894,_0x440c58){var _0x5932c1={};var _0x1afdc4={};var _0x114e26;var _0x3a3491;return db[_0xfa4f('0x3f')][_0xfa4f('0x55')]({'where':{'id':_0x2df894[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x440c58,null))[_0xfa4f('0x25')](function(_0x4f92c0){if(_0x4f92c0){_0x114e26=_0x4f92c0;_0x1afdc4['model']=_['keys'](db[_0xfa4f('0x8b')]['rawAttributes']);_0x1afdc4[_0xfa4f('0x31')]=_['keys'](_0x2df894[_0xfa4f('0x31')]);_0x1afdc4[_0xfa4f('0x38')]=_['intersection'](_0x1afdc4[_0xfa4f('0x30')],_0x1afdc4[_0xfa4f('0x31')]);_0x5932c1[_0xfa4f('0x32')]=_[_0xfa4f('0x46')](_0x1afdc4[_0xfa4f('0x30')],qs['fields'](_0x2df894[_0xfa4f('0x31')][_0xfa4f('0x33')]));_0x5932c1[_0xfa4f('0x32')]=_0x5932c1['attributes']['length']?_0x5932c1[_0xfa4f('0x32')]:_0x1afdc4['model'];_0x5932c1[_0xfa4f('0x36')]=qs[_0xfa4f('0x37')](_0x2df894['query'][_0xfa4f('0x37')]);_0x5932c1[_0xfa4f('0x3b')]=qs[_0xfa4f('0x38')](_[_0xfa4f('0x39')](_0x2df894['query'],_0x1afdc4[_0xfa4f('0x38')]));if(_0x2df894['query'][_0xfa4f('0x3a')]){_0x5932c1[_0xfa4f('0x3b')]=_[_0xfa4f('0x3c')](_0x5932c1[_0xfa4f('0x3b')],{'$or':_[_0xfa4f('0x2d')](_0x5932c1[_0xfa4f('0x32')],function(_0x58b18e){var _0x7997a2={};_0x7997a2[_0x58b18e]={'$like':'%'+_0x2df894['query'][_0xfa4f('0x3a')]+'%'};return _0x7997a2;})});}_0x5932c1=_[_0xfa4f('0x3c')]({},_0x5932c1,_0x2df894[_0xfa4f('0x47')]);return _0x114e26['getApplications'](_0x5932c1);}})[_0xfa4f('0x25')](function(_0xf5e383){if(_0xf5e383){_0x3a3491=_0xf5e383[_0xfa4f('0x34')];if(!_0x2df894[_0xfa4f('0x31')][_0xfa4f('0x57')](_0xfa4f('0x35'))){_0x5932c1[_0xfa4f('0x21')]=qs['limit'](_0x2df894[_0xfa4f('0x31')]['limit']);_0x5932c1[_0xfa4f('0x20')]=qs[_0xfa4f('0x20')](_0x2df894[_0xfa4f('0x31')][_0xfa4f('0x20')]);}return _0x114e26[_0xfa4f('0x115')](_0x5932c1);}})[_0xfa4f('0x25')](function(_0x2fb40f){if(_0x2fb40f){return _0x2fb40f?{'count':_0x3a3491,'rows':_0x2fb40f}:null;}})[_0xfa4f('0x25')](respondWithResult(_0x440c58,null))[_0xfa4f('0x1b')](handleError(_0x440c58,null));};exports[_0xfa4f('0x116')]=function(_0x1dc047,_0x243cf4){return db['chatProactiveAction'][_0xfa4f('0x48')]({'where':{'id':_0x1dc047[_0xfa4f('0x51')]['id']}})['then'](handleEntityNotFound(_0x243cf4,null))[_0xfa4f('0x25')](function(_0x35a78c){if(_0x35a78c){return _0x35a78c[_0xfa4f('0x116')](_0x1dc047['body'][_0xfa4f('0x59')],_[_0xfa4f('0xe8')](_0x1dc047[_0xfa4f('0x4a')],['ids','id'])||{});}})[_0xfa4f('0x25')](respondWithResult(_0x243cf4,null))[_0xfa4f('0x1b')](handleError(_0x243cf4,null));};exports[_0xfa4f('0xfd')]=function(_0x59acbd,_0x1e4918){var _0x2cd041={};var _0x53a8d4={};var _0x308559;var _0x174358;return db['ChatWebsite'][_0xfa4f('0x55')]({'where':{'id':_0x59acbd[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x1e4918,null))[_0xfa4f('0x25')](function(_0x5abe17){if(_0x5abe17){_0x308559=_0x5abe17;_0x53a8d4['model']=_['keys'](db[_0xfa4f('0x117')][_0xfa4f('0x2e')]);_0x53a8d4[_0xfa4f('0x31')]=_[_0xfa4f('0x45')](_0x59acbd['query']);_0x53a8d4[_0xfa4f('0x38')]=_['intersection'](_0x53a8d4[_0xfa4f('0x30')],_0x53a8d4[_0xfa4f('0x31')]);_0x2cd041[_0xfa4f('0x32')]=_[_0xfa4f('0x46')](_0x53a8d4[_0xfa4f('0x30')],qs[_0xfa4f('0x33')](_0x59acbd['query'][_0xfa4f('0x33')]));_0x2cd041['attributes']=_0x2cd041['attributes'][_0xfa4f('0x34')]?_0x2cd041[_0xfa4f('0x32')]:_0x53a8d4[_0xfa4f('0x30')];_0x2cd041['order']=qs[_0xfa4f('0x37')](_0x59acbd['query'][_0xfa4f('0x37')]);_0x2cd041[_0xfa4f('0x3b')]=qs[_0xfa4f('0x38')](_[_0xfa4f('0x39')](_0x59acbd['query'],_0x53a8d4[_0xfa4f('0x38')]));if(_0x59acbd['query']['filter']){_0x2cd041[_0xfa4f('0x3b')]=_[_0xfa4f('0x3c')](_0x2cd041[_0xfa4f('0x3b')],{'$or':_['map'](_0x2cd041[_0xfa4f('0x32')],function(_0x8ec31c){var _0x5b8f4={};_0x5b8f4[_0x8ec31c]={'$like':'%'+_0x59acbd[_0xfa4f('0x31')][_0xfa4f('0x3a')]+'%'};return _0x5b8f4;})});}_0x2cd041=_[_0xfa4f('0x3c')]({},_0x2cd041,_0x59acbd[_0xfa4f('0x47')]);return _0x308559['getProactiveActions'](_0x2cd041);}})[_0xfa4f('0x25')](function(_0x5ded80){if(_0x5ded80){_0x174358=_0x5ded80[_0xfa4f('0x34')];if(!_0x59acbd[_0xfa4f('0x31')][_0xfa4f('0x57')](_0xfa4f('0x35'))){_0x2cd041[_0xfa4f('0x21')]=qs['limit'](_0x59acbd[_0xfa4f('0x31')][_0xfa4f('0x21')]);_0x2cd041[_0xfa4f('0x20')]=qs[_0xfa4f('0x20')](_0x59acbd[_0xfa4f('0x31')][_0xfa4f('0x20')]);}return _0x308559[_0xfa4f('0xfd')](_0x2cd041);}})['then'](function(_0x4144e8){if(_0x4144e8){return _0x4144e8?{'count':_0x174358,'rows':_0x4144e8}:null;}})[_0xfa4f('0x25')](respondWithResult(_0x1e4918,null))[_0xfa4f('0x1b')](handleError(_0x1e4918,null));};exports['getFields']=function(_0x1dfae8,_0x2df2e7){var _0x375cee=_0x1dfae8[_0xfa4f('0x31')]['online']===_0xfa4f('0x118')?_0xfa4f('0x119'):_0xfa4f('0x11a');return db['ChatWebsite'][_0xfa4f('0x48')]({'attributes':['id',_0x375cee],'where':{'id':_0x1dfae8[_0xfa4f('0x51')]['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x2df2e7,null))[_0xfa4f('0x25')](function(_0x9a6a1){if(_0x9a6a1){var _0x15005e=_0x9a6a1[_0x375cee];var _0x30b209=_0x15005e&&_0x15005e['items']?_0x15005e[_0xfa4f('0x11b')]:[];_0x2df2e7[_0xfa4f('0xbc')]({'fromKey':_['isNil'](_0x15005e[_0xfa4f('0x11c')])?undefined:_0x15005e[_0xfa4f('0x11c')],'count':_0x30b209[_0xfa4f('0x34')],'rows':_0x30b209});}})[_0xfa4f('0x1b')](handleError(_0x2df2e7,null));};exports[_0xfa4f('0x11d')]=function(_0x5d7f5f,_0xba0f44){var _0x15520e={'raw':![],'where':{}};var _0x43254c={};var _0x41bcb8={'count':0x0,'rows':[]};return db[_0xfa4f('0x3f')][_0xfa4f('0x55')]({'where':{'id':_0x5d7f5f[_0xfa4f('0x51')]['id']}})['then'](handleEntityNotFound(_0xba0f44,null))['then'](function(_0x15ccd4){if(_0x15ccd4){_0x43254c[_0xfa4f('0x30')]=_['keys'](db[_0xfa4f('0xc8')][_0xfa4f('0x2e')]);_0x43254c[_0xfa4f('0x31')]=_[_0xfa4f('0x45')](_0x5d7f5f[_0xfa4f('0x31')]);_0x43254c['filters']=_[_0xfa4f('0x46')](_0x43254c[_0xfa4f('0x30')],_0x43254c['query']);_0x15520e['attributes']=_['intersection'](_0x43254c['model'],qs[_0xfa4f('0x33')](_0x5d7f5f[_0xfa4f('0x31')][_0xfa4f('0x33')]));_0x15520e[_0xfa4f('0x32')]=_0x15520e[_0xfa4f('0x32')][_0xfa4f('0x34')]?_0x15520e[_0xfa4f('0x32')]:_0x43254c[_0xfa4f('0x30')];if(!_0x5d7f5f[_0xfa4f('0x31')][_0xfa4f('0x57')]('nolimit')){_0x15520e[_0xfa4f('0x21')]=qs[_0xfa4f('0x21')](_0x5d7f5f[_0xfa4f('0x31')][_0xfa4f('0x21')]);_0x15520e[_0xfa4f('0x20')]=qs[_0xfa4f('0x20')](_0x5d7f5f['query'][_0xfa4f('0x20')]);}_0x15520e[_0xfa4f('0x36')]=qs['sort'](_0x5d7f5f[_0xfa4f('0x31')][_0xfa4f('0x37')]);_0x15520e[_0xfa4f('0x3b')]=qs[_0xfa4f('0x38')](_['pick'](_0x5d7f5f[_0xfa4f('0x31')],_0x43254c[_0xfa4f('0x38')]));_0x15520e[_0xfa4f('0x3b')][_0xfa4f('0x54')]=_0x15ccd4['id'];if(_0x5d7f5f[_0xfa4f('0x31')][_0xfa4f('0x3a')]){_0x15520e[_0xfa4f('0x3b')]=_[_0xfa4f('0x3c')](_0x15520e[_0xfa4f('0x3b')],{'$or':_[_0xfa4f('0x2d')](_0x15520e[_0xfa4f('0x32')],function(_0x58d61d){var _0x4a076b={};_0x4a076b[_0x58d61d]={'$like':'%'+_0x5d7f5f[_0xfa4f('0x31')]['filter']+'%'};return _0x4a076b;})});}_0x15520e=_['merge']({},_0x15520e,_0x5d7f5f[_0xfa4f('0x47')]);return db[_0xfa4f('0xc8')][_0xfa4f('0x22')]({'where':_0x15520e[_0xfa4f('0x3b')]})['then'](function(_0xe53f8e){_0x41bcb8[_0xfa4f('0x22')]=_0xe53f8e;if(_0x5d7f5f['query'][_0xfa4f('0x40')]){_0x15520e[_0xfa4f('0x41')]=[{'all':!![]}];}else{_0x15520e['include']=[{'model':db[_0xfa4f('0x78')],'as':_0xfa4f('0xea'),'required':![]},{'model':db[_0xfa4f('0xd2')],'as':_0xfa4f('0x11e'),'required':![]}];}return db[_0xfa4f('0xc8')][_0xfa4f('0x42')](_0x15520e);})[_0xfa4f('0x25')](function(_0x3c35bf){_0x41bcb8['rows']=_0x3c35bf;return _0x41bcb8;});}})['then'](respondWithFilteredResult(_0xba0f44,_0x15520e))[_0xfa4f('0x1b')](handleError(_0xba0f44,null));};exports['addAgents']=function(_0x30761b,_0x5f2739){return db[_0xfa4f('0x3f')]['find']({'where':{'id':_0x30761b['params']['id']}})[_0xfa4f('0x25')](handleEntityNotFound(_0x5f2739,null))['then'](function(_0x1a588e){if(_0x1a588e){return _0x1a588e['addAgents'](_0x30761b['body'][_0xfa4f('0x59')],_[_0xfa4f('0xe8')](_0x30761b[_0xfa4f('0x4a')],['ids','id'])||{})[_0xfa4f('0xc3')](function(_0x2298e3){for(var _0xf4e111=0x0;_0xf4e111<_0x30761b[_0xfa4f('0x4a')][_0xfa4f('0x59')][_0xfa4f('0x34')];_0xf4e111+=0x1){socket[_0xfa4f('0x11f')](_0xfa4f('0x120'),{'UserId':Number(_0x30761b[_0xfa4f('0x4a')][_0xfa4f('0x59')][_0xf4e111]),'ChatWebsiteId':Number(_0x30761b[_0xfa4f('0x51')]['id'])});}return _0x2298e3;});}})[_0xfa4f('0x25')](respondWithResult(_0x5f2739,null))[_0xfa4f('0x1b')](handleError(_0x5f2739,null));};exports[_0xfa4f('0x121')]=function(_0x442113,_0x55440d){return db[_0xfa4f('0x3f')][_0xfa4f('0x48')]({'where':{'id':_0x442113[_0xfa4f('0x51')]['id']}})['then'](handleEntityNotFound(_0x55440d,null))[_0xfa4f('0x25')](function(_0x3ae566){if(_0x3ae566){return _0x3ae566[_0xfa4f('0x121')](_0x442113[_0xfa4f('0x31')]['ids'])[_0xfa4f('0x25')](function(){if(_[_0xfa4f('0x122')](_0x442113['query']['ids'])){for(var _0x5324eb=0x0;_0x5324eb<_0x442113[_0xfa4f('0x31')]['ids'][_0xfa4f('0x34')];_0x5324eb+=0x1){socket[_0xfa4f('0x11f')](_0xfa4f('0x123'),{'UserId':Number(_0x442113[_0xfa4f('0x31')][_0xfa4f('0x59')][_0x5324eb]),'ChatWebsiteId':Number(_0x442113[_0xfa4f('0x51')]['id'])});}}else{socket[_0xfa4f('0x11f')]('userChatWebsite:remove',{'UserId':Number(_0x442113[_0xfa4f('0x31')][_0xfa4f('0x59')]),'ChatWebsiteId':Number(_0x442113[_0xfa4f('0x51')]['id'])});}});}})[_0xfa4f('0x25')](respondWithStatusCode(_0x55440d,null))[_0xfa4f('0x1b')](handleError(_0x55440d,null));};exports[_0xfa4f('0x124')]=function(_0x40738c,_0x3095fa){var _0x57e0e2={};var _0x31d292={};var _0x5f4f02;var _0xd7bd83;return db[_0xfa4f('0x3f')][_0xfa4f('0x55')]({'where':{'id':_0x40738c[_0xfa4f('0x51')]['id']}})['then'](handleEntityNotFound(_0x3095fa,null))[_0xfa4f('0x25')](function(_0x1323a3){if(_0x1323a3){_0x5f4f02=_0x1323a3;_0x31d292[_0xfa4f('0x30')]=_[_0xfa4f('0x45')](db[_0xfa4f('0xb1')]['rawAttributes']);_0x31d292[_0xfa4f('0x31')]=_['keys'](_0x40738c[_0xfa4f('0x31')]);_0x31d292['filters']=_[_0xfa4f('0x46')](_0x31d292[_0xfa4f('0x30')],_0x31d292[_0xfa4f('0x31')]);_0x57e0e2[_0xfa4f('0x32')]=_[_0xfa4f('0x46')](_0x31d292[_0xfa4f('0x30')],qs[_0xfa4f('0x33')](_0x40738c[_0xfa4f('0x31')][_0xfa4f('0x33')]));_0x57e0e2[_0xfa4f('0x32')]=_0x57e0e2[_0xfa4f('0x32')]['length']?_0x57e0e2[_0xfa4f('0x32')]:_0x31d292[_0xfa4f('0x30')];_0x57e0e2[_0xfa4f('0x36')]=qs['sort'](_0x40738c[_0xfa4f('0x31')][_0xfa4f('0x37')]);_0x57e0e2[_0xfa4f('0x3b')]=qs[_0xfa4f('0x38')](_[_0xfa4f('0x39')](_0x40738c['query'],_0x31d292[_0xfa4f('0x38')]));if(_0x40738c[_0xfa4f('0x31')]['filter']){_0x57e0e2['where']=_[_0xfa4f('0x3c')](_0x57e0e2[_0xfa4f('0x3b')],{'$or':_[_0xfa4f('0x2d')](_0x57e0e2[_0xfa4f('0x32')],function(_0x4abcbd){var _0x5a72f9={};_0x5a72f9[_0x4abcbd]={'$like':'%'+_0x40738c['query'][_0xfa4f('0x3a')]+'%'};return _0x5a72f9;})});}_0x57e0e2=_[_0xfa4f('0x3c')]({},_0x57e0e2,_0x40738c[_0xfa4f('0x47')]);return _0x5f4f02[_0xfa4f('0x124')](_0x57e0e2);}})['then'](function(_0x2dd873){if(_0x2dd873){_0xd7bd83=_0x2dd873[_0xfa4f('0x34')];if(!_0x40738c['query']['hasOwnProperty']('nolimit')){_0x57e0e2[_0xfa4f('0x21')]=qs[_0xfa4f('0x21')](_0x40738c[_0xfa4f('0x31')][_0xfa4f('0x21')]);_0x57e0e2[_0xfa4f('0x20')]=qs[_0xfa4f('0x20')](_0x40738c['query'][_0xfa4f('0x20')]);}return _0x5f4f02[_0xfa4f('0x124')](_0x57e0e2);}})['then'](function(_0x548b10){if(_0x548b10){return _0x548b10?{'count':_0xd7bd83,'rows':_0x548b10}:null;}})[_0xfa4f('0x25')](respondWithResult(_0x3095fa,null))[_0xfa4f('0x1b')](handleError(_0x3095fa,null));};
\ No newline at end of file
+var _0x6d9e=['device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','push','close','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','virtual','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','filter','where','merge','includeAll','include','show','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','hasOwnProperty','pick','findAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','findOne','options','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','existsSync','server/files/images/logos/','join','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','isNil','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','priority','asc','account','contact','cf-connecting-ip','x-forwarded-for','first','lastName','x-real-port','referer','browser','version','format','unknown'];(function(_0x46306f,_0x5aef14){var _0x16a27f=function(_0x5526fd){while(--_0x5526fd){_0x46306f['push'](_0x46306f['shift']());}};_0x16a27f(++_0x5aef14);}(_0x6d9e,0x1a8));var _0xe6d9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6d9e[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require(_0xe6d9('0x0'));var Mustache=require(_0xe6d9('0x1'));var util=require(_0xe6d9('0x2'));var path=require(_0xe6d9('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6d9('0x4'));var _=require(_0xe6d9('0x5'));var querystring=require('querystring');var Redis=require(_0xe6d9('0x6'));var qs=require(_0xe6d9('0x7'));var logger=require(_0xe6d9('0x8'))(_0xe6d9('0x9'));var config=require('../../config/environment');var db=require(_0xe6d9('0xa'))['db'];config[_0xe6d9('0xb')]=_[_0xe6d9('0xc')](config['redis'],{'host':_0xe6d9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6d9('0xb')]));require('./chatWebsite.socket')[_0xe6d9('0xe')](socket);var htmlToText=require(_0xe6d9('0xf'));var jayson=require('jayson/promise');var client=jayson[_0xe6d9('0x10')]['http']({'port':0x232c});var client9002=jayson[_0xe6d9('0x10')][_0xe6d9('0x11')]({'port':0x232a});var client9003=jayson[_0xe6d9('0x10')]['http']({'port':0x232b});var client9001=jayson[_0xe6d9('0x10')][_0xe6d9('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x1bc092,_0x3b2d60,_0x32c680,_0x1ef066){return new BPromise(function(_0x35f43a,_0x5bf97a){var _0x508ded=_0x1ef066||client;return _0x508ded[_0xe6d9('0x12')](_0x1bc092,_0x32c680)[_0xe6d9('0x13')](function(_0x5b8116){logger[_0xe6d9('0x14')](_0xe6d9('0x15'),_0x3b2d60,_0xe6d9('0x16'));logger['debug'](_0xe6d9('0x17'),_0x3b2d60,_0xe6d9('0x16'),JSON[_0xe6d9('0x18')](_0x5b8116));if(_0x5b8116[_0xe6d9('0x19')]){if(_0x5b8116['error'][_0xe6d9('0x1a')]===0x1f4){logger[_0xe6d9('0x19')](_0xe6d9('0x15'),_0x3b2d60,_0x5b8116[_0xe6d9('0x19')][_0xe6d9('0x1b')]);return _0x5bf97a(_0x5b8116[_0xe6d9('0x19')][_0xe6d9('0x1b')]);}logger[_0xe6d9('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x3b2d60,_0x5b8116['error'][_0xe6d9('0x1b')]);return _0x35f43a(_0x5b8116[_0xe6d9('0x19')][_0xe6d9('0x1b')]);}else{logger[_0xe6d9('0x14')](_0xe6d9('0x15'),_0x3b2d60,_0xe6d9('0x16'));_0x35f43a(_0x5b8116['result']['message']);}})['catch'](function(_0x8e7220){logger['error'](_0xe6d9('0x15'),_0x3b2d60,_0x8e7220);_0x5bf97a(_0x8e7220);});});}function respondWithStatusCode(_0x5d608c,_0x1b15c2){_0x1b15c2=_0x1b15c2||0xcc;return function(_0x427bf7){if(_0x427bf7){return _0x5d608c[_0xe6d9('0x1c')](_0x1b15c2);}return _0x5d608c['status'](_0x1b15c2)[_0xe6d9('0x1d')]();};}function respondWithResult(_0x38b198,_0x50b1f3){_0x50b1f3=_0x50b1f3||0xc8;return function(_0x494cc7){if(_0x494cc7){return _0x38b198[_0xe6d9('0x1e')](_0x50b1f3)[_0xe6d9('0x1f')](_0x494cc7);}};}function respondWithFilteredResult(_0x2635f3,_0x4917ac){return function(_0x35ef62){if(_0x35ef62){var _0x4c29a7=typeof _0x4917ac[_0xe6d9('0x20')]===_0xe6d9('0x21')&&typeof _0x4917ac['limit']===_0xe6d9('0x21');var _0x5e43f7=_0x35ef62[_0xe6d9('0x22')];var _0x329e6a=_0x4c29a7?0x0:_0x4917ac[_0xe6d9('0x20')];var _0x28a358=_0x4c29a7?_0x35ef62[_0xe6d9('0x22')]:_0x4917ac[_0xe6d9('0x20')]+_0x4917ac['limit'];var _0x11be3e;if(_0x28a358>=_0x5e43f7){_0x28a358=_0x5e43f7;_0x11be3e=0xc8;}else{_0x11be3e=0xce;}_0x2635f3[_0xe6d9('0x1e')](_0x11be3e);return _0x2635f3[_0xe6d9('0x23')](_0xe6d9('0x24'),_0x329e6a+'-'+_0x28a358+'/'+_0x5e43f7)[_0xe6d9('0x1f')](_0x35ef62);}return null;};}function saveUpdates(_0x1ce078){return function(_0x50c513){if(_0x50c513){return _0x50c513[_0xe6d9('0x25')](_0x1ce078)['then'](function(_0x28c682){return _0x28c682;});}return null;};}function removeEntity(_0x45320a){return function(_0x5efe39){if(_0x5efe39){return _0x5efe39[_0xe6d9('0x26')]()[_0xe6d9('0x13')](function(){var _0x2d5186=_0x5efe39[_0xe6d9('0x27')]({'plain':!![]});var _0x3773d3=_0xe6d9('0x28');return db[_0xe6d9('0x29')][_0xe6d9('0x26')]({'where':{'type':_0x3773d3,'resourceId':_0x2d5186['id']}})[_0xe6d9('0x13')](function(){return _0x5efe39;});})[_0xe6d9('0x13')](function(){_0x45320a[_0xe6d9('0x1e')](0xcc)[_0xe6d9('0x1d')]();});}};}function handleEntityNotFound(_0x2bb35a){return function(_0x51a8ea){if(!_0x51a8ea){_0x2bb35a[_0xe6d9('0x1c')](0x194);}return _0x51a8ea;};}function handleError(_0x52102a,_0x43884d){_0x43884d=_0x43884d||0x1f4;return function(_0x209c84){logger[_0xe6d9('0x19')](_0x209c84[_0xe6d9('0x2a')]);if(_0x209c84[_0xe6d9('0x2b')]){delete _0x209c84[_0xe6d9('0x2b')];}_0x52102a[_0xe6d9('0x1e')](_0x43884d)[_0xe6d9('0x2c')](_0x209c84);};}exports['index']=function(_0x5b3398,_0xbb445b){var _0x220a99={'include':[{'model':db[_0xe6d9('0x2d')],'as':_0xe6d9('0x2e')}]},_0x4e1ea7={},_0x197f82={'count':0x0,'rows':[]};var _0x5f1050=_[_0xe6d9('0x2f')](db[_0xe6d9('0x30')]['rawAttributes'],function(_0x1d1833){return{'name':_0x1d1833[_0xe6d9('0x31')],'type':_0x1d1833[_0xe6d9('0x32')][_0xe6d9('0x33')]};});_0x4e1ea7[_0xe6d9('0x34')]=_[_0xe6d9('0x2f')](_0x5f1050,'name');_0x4e1ea7[_0xe6d9('0x35')]=_[_0xe6d9('0x36')](_0x5b3398[_0xe6d9('0x35')]);_0x4e1ea7[_0xe6d9('0x37')]=_[_0xe6d9('0x38')](_0x4e1ea7[_0xe6d9('0x34')],_0x4e1ea7[_0xe6d9('0x35')]);_0x220a99[_0xe6d9('0x39')]=_[_0xe6d9('0x38')](_0x4e1ea7[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x5b3398['query'][_0xe6d9('0x3a')]));_0x220a99[_0xe6d9('0x39')]=_0x220a99[_0xe6d9('0x39')][_0xe6d9('0x3b')]?_0x220a99[_0xe6d9('0x39')]:_0x4e1ea7[_0xe6d9('0x34')];if(!_0x5b3398[_0xe6d9('0x35')]['hasOwnProperty'](_0xe6d9('0x3c'))){_0x220a99[_0xe6d9('0x3d')]=qs[_0xe6d9('0x3d')](_0x5b3398[_0xe6d9('0x35')][_0xe6d9('0x3d')]);_0x220a99[_0xe6d9('0x20')]=qs[_0xe6d9('0x20')](_0x5b3398[_0xe6d9('0x35')][_0xe6d9('0x20')]);}_0x220a99[_0xe6d9('0x3e')]=qs['sort'](_0x5b3398['query'][_0xe6d9('0x3f')]);_0x220a99['where']=qs['filters'](_['pick'](_0x5b3398[_0xe6d9('0x35')],_0x4e1ea7['filters']),_0x5f1050);if(_0x5b3398[_0xe6d9('0x35')][_0xe6d9('0x40')]){_0x220a99[_0xe6d9('0x41')]=_[_0xe6d9('0x42')](_0x220a99[_0xe6d9('0x41')],{'$or':_['map'](_0x5f1050,function(_0x30ab20){if(_0x30ab20[_0xe6d9('0x32')]!=='VIRTUAL'){var _0x1a39f1={};_0x1a39f1[_0x30ab20[_0xe6d9('0x2b')]]={'$like':'%'+_0x5b3398[_0xe6d9('0x35')][_0xe6d9('0x40')]+'%'};return _0x1a39f1;}})});}_0x220a99=_['merge']({},_0x220a99,_0x5b3398['options']);var _0x1eb037={'where':_0x220a99[_0xe6d9('0x41')]};return db[_0xe6d9('0x30')]['count'](_0x1eb037)[_0xe6d9('0x13')](function(_0x5a8927){_0x197f82[_0xe6d9('0x22')]=_0x5a8927;if(_0x5b3398[_0xe6d9('0x35')][_0xe6d9('0x43')]){_0x220a99[_0xe6d9('0x44')]=[{'all':!![]}];}return db[_0xe6d9('0x30')]['findAll'](_0x220a99);})[_0xe6d9('0x13')](function(_0x50aae3){_0x197f82['rows']=_0x50aae3;return _0x197f82;})['then'](respondWithFilteredResult(_0xbb445b,_0x220a99))['catch'](handleError(_0xbb445b,null));};exports[_0xe6d9('0x45')]=function(_0x582eb8,_0x559807){var _0x114017={'raw':![],'where':{'id':_0x582eb8['params']['id']},'include':[{'model':db[_0xe6d9('0x2d')],'as':_0xe6d9('0x2e')}]},_0x1a19dc={};_0x1a19dc[_0xe6d9('0x34')]=_[_0xe6d9('0x36')](db[_0xe6d9('0x30')][_0xe6d9('0x46')]);_0x1a19dc[_0xe6d9('0x35')]=_[_0xe6d9('0x36')](_0x582eb8[_0xe6d9('0x35')]);_0x1a19dc['filters']=_[_0xe6d9('0x38')](_0x1a19dc[_0xe6d9('0x34')],_0x1a19dc[_0xe6d9('0x35')]);_0x114017['attributes']=_['intersection'](_0x1a19dc[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x582eb8[_0xe6d9('0x35')][_0xe6d9('0x3a')]));_0x114017[_0xe6d9('0x39')]=_0x114017[_0xe6d9('0x39')][_0xe6d9('0x3b')]?_0x114017[_0xe6d9('0x39')]:_0x1a19dc[_0xe6d9('0x34')];if(_0x582eb8[_0xe6d9('0x35')]['includeAll']){_0x114017[_0xe6d9('0x44')]=[{'all':!![]}];}_0x114017=_[_0xe6d9('0x42')]({},_0x114017,_0x582eb8['options']);return db[_0xe6d9('0x30')][_0xe6d9('0x47')](_0x114017)[_0xe6d9('0x13')](handleEntityNotFound(_0x559807,null))[_0xe6d9('0x13')](respondWithResult(_0x559807,null))[_0xe6d9('0x48')](handleError(_0x559807,null));};exports[_0xe6d9('0x49')]=function(_0x1b2933,_0x315f39){return db[_0xe6d9('0x30')][_0xe6d9('0x49')](_0x1b2933['body'],{})[_0xe6d9('0x13')](function(_0xecff66){var _0x2e8368=_0x1b2933[_0xe6d9('0x4a')]['get']({'plain':!![]});if(!_0x2e8368)throw new Error(_0xe6d9('0x4b'));if(_0x2e8368[_0xe6d9('0x4c')]===_0xe6d9('0x4a')){var _0x49b3b0=_0xecff66['get']({'plain':!![]});var _0x4a21ca='ChatWebsites';return db['UserProfileSection'][_0xe6d9('0x47')]({'where':{'name':_0x4a21ca,'userProfileId':_0x2e8368['userProfileId']},'raw':!![]})[_0xe6d9('0x13')](function(_0x24a304){if(_0x24a304&&_0x24a304[_0xe6d9('0x4d')]===0x0){return db[_0xe6d9('0x29')][_0xe6d9('0x49')]({'name':_0x49b3b0[_0xe6d9('0x2b')],'resourceId':_0x49b3b0['id'],'type':_0x24a304[_0xe6d9('0x2b')],'sectionId':_0x24a304['id']},{})[_0xe6d9('0x13')](function(){return _0xecff66;});}else{return _0xecff66;}})[_0xe6d9('0x48')](function(_0x342e2f){logger[_0xe6d9('0x19')](_0xe6d9('0x4e'),_0x342e2f);throw _0x342e2f;});}return _0xecff66;})['then'](respondWithResult(_0x315f39,0xc9))[_0xe6d9('0x48')](handleError(_0x315f39,null));};exports['update']=function(_0x14996d,_0x4cc184){if(_0x14996d[_0xe6d9('0x4f')]['id']){delete _0x14996d['body']['id'];}return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'where':{'id':_0x14996d[_0xe6d9('0x50')]['id']},'include':[{'model':db[_0xe6d9('0x2d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4cc184,null))[_0xe6d9('0x13')](saveUpdates(_0x14996d['body'],null))['then'](respondWithResult(_0x4cc184,null))['catch'](handleError(_0x4cc184,null));};exports[_0xe6d9('0x26')]=function(_0x5af88a,_0x453984){return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'where':{'id':_0x5af88a[_0xe6d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x453984,null))['then'](removeEntity(_0x453984,null))['catch'](handleError(_0x453984,null));};exports['describe']=function(_0x59f42e,_0xbaf2ea){return db[_0xe6d9('0x30')][_0xe6d9('0x51')]()[_0xe6d9('0x13')](respondWithResult(_0xbaf2ea,null))['catch'](handleError(_0xbaf2ea,null));};exports[_0xe6d9('0x52')]=function(_0x3cdf54,_0x2c00c3){if(_0x3cdf54['body']['id']){delete _0x3cdf54['body']['id'];}return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'where':{'id':_0x3cdf54[_0xe6d9('0x50')]['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x2c00c3,null))['then'](function(_0x27db03){if(_0x27db03){_0x3cdf54['body'][_0xe6d9('0x53')]=_0x27db03['id'];return db[_0xe6d9('0x54')][_0xe6d9('0x49')](_0x3cdf54[_0xe6d9('0x4f')]);}})[_0xe6d9('0x13')](respondWithResult(_0x2c00c3,null))['catch'](handleError(_0x2c00c3,null));};exports[_0xe6d9('0x55')]=function(_0x1014b5,_0x152de5){var _0x664a3d={'raw':![],'where':{}};var _0x14f2a0={};var _0x1d6415={'count':0x0,'rows':[]};return db[_0xe6d9('0x30')]['findOne']({'where':{'id':_0x1014b5['params']['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x152de5,null))[_0xe6d9('0x13')](function(_0x562b3d){if(_0x562b3d){_0x14f2a0[_0xe6d9('0x34')]=_[_0xe6d9('0x36')](db[_0xe6d9('0x54')][_0xe6d9('0x46')]);_0x14f2a0[_0xe6d9('0x35')]=_[_0xe6d9('0x36')](_0x1014b5[_0xe6d9('0x35')]);_0x14f2a0[_0xe6d9('0x37')]=_[_0xe6d9('0x38')](_0x14f2a0[_0xe6d9('0x34')],_0x14f2a0[_0xe6d9('0x35')]);_0x664a3d[_0xe6d9('0x39')]=_['intersection'](_0x14f2a0[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x1014b5['query'][_0xe6d9('0x3a')]));_0x664a3d[_0xe6d9('0x39')]=_0x664a3d[_0xe6d9('0x39')][_0xe6d9('0x3b')]?_0x664a3d[_0xe6d9('0x39')]:_0x14f2a0[_0xe6d9('0x34')];if(!_0x1014b5[_0xe6d9('0x35')][_0xe6d9('0x56')](_0xe6d9('0x3c'))){_0x664a3d[_0xe6d9('0x3d')]=qs[_0xe6d9('0x3d')](_0x1014b5[_0xe6d9('0x35')][_0xe6d9('0x3d')]);_0x664a3d[_0xe6d9('0x20')]=qs[_0xe6d9('0x20')](_0x1014b5['query'][_0xe6d9('0x20')]);}_0x664a3d[_0xe6d9('0x3e')]=qs['sort'](_0x1014b5[_0xe6d9('0x35')][_0xe6d9('0x3f')]);_0x664a3d['where']=qs[_0xe6d9('0x37')](_[_0xe6d9('0x57')](_0x1014b5['query'],_0x14f2a0[_0xe6d9('0x37')]));_0x664a3d[_0xe6d9('0x41')][_0xe6d9('0x53')]=_0x562b3d['id'];if(_0x1014b5[_0xe6d9('0x35')][_0xe6d9('0x40')]){_0x664a3d[_0xe6d9('0x41')]=_['merge'](_0x664a3d[_0xe6d9('0x41')],{'$or':_[_0xe6d9('0x2f')](_0x664a3d[_0xe6d9('0x39')],function(_0x398f86){var _0x1286db={};_0x1286db[_0x398f86]={'$like':'%'+_0x1014b5[_0xe6d9('0x35')][_0xe6d9('0x40')]+'%'};return _0x1286db;})});}_0x664a3d=_['merge']({},_0x664a3d,_0x1014b5['options']);return db[_0xe6d9('0x54')][_0xe6d9('0x22')]({'where':_0x664a3d[_0xe6d9('0x41')]})[_0xe6d9('0x13')](function(_0x30585b){_0x1d6415[_0xe6d9('0x22')]=_0x30585b;if(_0x1014b5['query']['includeAll']){_0x664a3d[_0xe6d9('0x44')]=[{'all':!![]}];}return db['Disposition'][_0xe6d9('0x58')](_0x664a3d);})[_0xe6d9('0x13')](function(_0x5f4829){_0x1d6415[_0xe6d9('0x59')]=_0x5f4829;return _0x1d6415;});}})[_0xe6d9('0x13')](respondWithFilteredResult(_0x152de5,_0x664a3d))[_0xe6d9('0x48')](handleError(_0x152de5,null));};exports[_0xe6d9('0x5a')]=function(_0x561cfa,_0x50cf4f){return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'where':{'id':_0x561cfa[_0xe6d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x50cf4f,null))[_0xe6d9('0x13')](function(_0x2e65f9){if(_0x2e65f9){return _0x2e65f9[_0xe6d9('0x5a')](_0x561cfa[_0xe6d9('0x35')][_0xe6d9('0x5b')]);}})[_0xe6d9('0x13')](respondWithStatusCode(_0x50cf4f,null))[_0xe6d9('0x48')](handleError(_0x50cf4f,null));};exports['addAnswer']=function(_0x22b30b,_0x51efa5){if(_0x22b30b[_0xe6d9('0x4f')]['id']){delete _0x22b30b[_0xe6d9('0x4f')]['id'];}return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'where':{'id':_0x22b30b[_0xe6d9('0x50')]['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x51efa5,null))[_0xe6d9('0x13')](function(_0x15f592){if(_0x15f592){_0x22b30b[_0xe6d9('0x4f')][_0xe6d9('0x53')]=_0x15f592['id'];return db[_0xe6d9('0x5c')][_0xe6d9('0x49')](_0x22b30b[_0xe6d9('0x4f')]);}})['then'](respondWithResult(_0x51efa5,null))[_0xe6d9('0x48')](handleError(_0x51efa5,null));};exports[_0xe6d9('0x5d')]=function(_0x4b1145,_0x5d2a2b){var _0x59c8a2={'raw':![],'where':{}};var _0x5559c6={};var _0x976f18={'count':0x0,'rows':[]};return db[_0xe6d9('0x30')][_0xe6d9('0x5e')]({'where':{'id':_0x4b1145['params']['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x5d2a2b,null))[_0xe6d9('0x13')](function(_0x572112){if(_0x572112){_0x5559c6['model']=_[_0xe6d9('0x36')](db[_0xe6d9('0x5c')][_0xe6d9('0x46')]);_0x5559c6['query']=_[_0xe6d9('0x36')](_0x4b1145[_0xe6d9('0x35')]);_0x5559c6[_0xe6d9('0x37')]=_['intersection'](_0x5559c6[_0xe6d9('0x34')],_0x5559c6[_0xe6d9('0x35')]);_0x59c8a2[_0xe6d9('0x39')]=_[_0xe6d9('0x38')](_0x5559c6[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x4b1145[_0xe6d9('0x35')][_0xe6d9('0x3a')]));_0x59c8a2['attributes']=_0x59c8a2[_0xe6d9('0x39')][_0xe6d9('0x3b')]?_0x59c8a2['attributes']:_0x5559c6[_0xe6d9('0x34')];if(!_0x4b1145[_0xe6d9('0x35')][_0xe6d9('0x56')](_0xe6d9('0x3c'))){_0x59c8a2[_0xe6d9('0x3d')]=qs[_0xe6d9('0x3d')](_0x4b1145[_0xe6d9('0x35')][_0xe6d9('0x3d')]);_0x59c8a2['offset']=qs[_0xe6d9('0x20')](_0x4b1145[_0xe6d9('0x35')]['offset']);}_0x59c8a2[_0xe6d9('0x3e')]=qs['sort'](_0x4b1145[_0xe6d9('0x35')][_0xe6d9('0x3f')]);_0x59c8a2[_0xe6d9('0x41')]=qs[_0xe6d9('0x37')](_['pick'](_0x4b1145[_0xe6d9('0x35')],_0x5559c6[_0xe6d9('0x37')]));_0x59c8a2[_0xe6d9('0x41')][_0xe6d9('0x53')]=_0x572112['id'];if(_0x4b1145['query'][_0xe6d9('0x40')]){_0x59c8a2['where']=_[_0xe6d9('0x42')](_0x59c8a2['where'],{'$or':_[_0xe6d9('0x2f')](_0x59c8a2['attributes'],function(_0x55f138){var _0x30625c={};_0x30625c[_0x55f138]={'$like':'%'+_0x4b1145[_0xe6d9('0x35')][_0xe6d9('0x40')]+'%'};return _0x30625c;})});}_0x59c8a2=_['merge']({},_0x59c8a2,_0x4b1145[_0xe6d9('0x5f')]);return db[_0xe6d9('0x5c')]['count']({'where':_0x59c8a2[_0xe6d9('0x41')]})[_0xe6d9('0x13')](function(_0xb8789a){_0x976f18[_0xe6d9('0x22')]=_0xb8789a;if(_0x4b1145[_0xe6d9('0x35')][_0xe6d9('0x43')]){_0x59c8a2[_0xe6d9('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe6d9('0x58')](_0x59c8a2);})[_0xe6d9('0x13')](function(_0x24295d){_0x976f18['rows']=_0x24295d;return _0x976f18;});}})['then'](respondWithFilteredResult(_0x5d2a2b,_0x59c8a2))[_0xe6d9('0x48')](handleError(_0x5d2a2b,null));};exports['removeAnswers']=function(_0x36b9ff,_0x14deaf){return db[_0xe6d9('0x30')]['find']({'where':{'id':_0x36b9ff[_0xe6d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x14deaf,null))[_0xe6d9('0x13')](function(_0x501a22){if(_0x501a22){return _0x501a22[_0xe6d9('0x60')](_0x36b9ff[_0xe6d9('0x35')][_0xe6d9('0x5b')]);}})[_0xe6d9('0x13')](respondWithStatusCode(_0x14deaf,null))[_0xe6d9('0x48')](handleError(_0x14deaf,null));};exports[_0xe6d9('0x61')]=function(_0x45fe71,_0x19e0de){_0x45fe71[_0xe6d9('0x4f')]['sitepic']=_0x45fe71[_0xe6d9('0x62')][_0xe6d9('0x63')];return db[_0xe6d9('0x30')]['find']({'where':{'id':_0x45fe71[_0xe6d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x19e0de,null))[_0xe6d9('0x13')](saveUpdates(_0x45fe71[_0xe6d9('0x4f')],null))['then'](respondWithResult(_0x19e0de,null))[_0xe6d9('0x48')](handleError(_0x19e0de,null));};exports[_0xe6d9('0x64')]=function(_0x3b5d42,_0x331ee4){_0x3b5d42[_0xe6d9('0x4f')]['agentAvatar']=_0x3b5d42[_0xe6d9('0x62')][_0xe6d9('0x63')];return db[_0xe6d9('0x30')]['find']({'where':{'id':_0x3b5d42[_0xe6d9('0x50')]['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x331ee4,null))[_0xe6d9('0x13')](saveUpdates(_0x3b5d42[_0xe6d9('0x4f')],null))['then'](respondWithResult(_0x331ee4,null))[_0xe6d9('0x48')](handleError(_0x331ee4,null));};exports[_0xe6d9('0x65')]=function(_0x5eca3d,_0x3b8e68){_0x5eca3d['body'][_0xe6d9('0x66')]=_0x5eca3d[_0xe6d9('0x62')][_0xe6d9('0x63')];return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'where':{'id':_0x5eca3d['params']['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x3b8e68,null))[_0xe6d9('0x13')](saveUpdates(_0x5eca3d[_0xe6d9('0x4f')],null))[_0xe6d9('0x13')](respondWithResult(_0x3b8e68,null))[_0xe6d9('0x48')](handleError(_0x3b8e68,null));};exports['addSystemAvatar']=function(_0x542658,_0x436b64){_0x542658[_0xe6d9('0x4f')][_0xe6d9('0x67')]=_0x542658[_0xe6d9('0x62')][_0xe6d9('0x63')];return db[_0xe6d9('0x30')]['find']({'where':{'id':_0x542658['params']['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x436b64,null))[_0xe6d9('0x13')](saveUpdates(_0x542658[_0xe6d9('0x4f')],null))[_0xe6d9('0x13')](respondWithResult(_0x436b64,null))[_0xe6d9('0x48')](handleError(_0x436b64,null));};exports[_0xe6d9('0x68')]=function(_0x520bd0,_0x1b6904){var _0x1d8fe9=path['join'](config[_0xe6d9('0x69')],_0xe6d9('0x6a'));var _0x448dae={'where':{'id':_0x520bd0[_0xe6d9('0x50')]['id']},'attributes':['id',_0xe6d9('0x6b')],'raw':!![]};var _0x52ab6a=![];return require(_0xe6d9('0x6c'))['getLicense']()[_0xe6d9('0x13')](function(_0x162295){if(_0x162295){_0x52ab6a=_0x162295[_0xe6d9('0x6d')];}})[_0xe6d9('0x13')](function(){return db[_0xe6d9('0x30')]['find'](_0x448dae);})['then'](handleEntityNotFound(_0x1b6904,null))['then'](function(_0x56cb85){if(_0x56cb85){if(!_['isNil'](_0x56cb85[_0xe6d9('0x6b')])){if(fs[_0xe6d9('0x6e')](path['join'](config[_0xe6d9('0x69')],_0xe6d9('0x6f'),_0x56cb85[_0xe6d9('0x6b')]))&&_0x52ab6a){_0x1d8fe9=path[_0xe6d9('0x70')](config[_0xe6d9('0x69')],_0xe6d9('0x6f'),_0x56cb85[_0xe6d9('0x6b')]);}}return _0x1b6904['download'](_0x1d8fe9);}})[_0xe6d9('0x48')](handleError(_0x1b6904,null));};exports[_0xe6d9('0x71')]=function(_0xef9dcb,_0x4dc161){var _0x44069e=path[_0xe6d9('0x70')](config[_0xe6d9('0x69')],_0xe6d9('0x72'));var _0xf94210={'where':{'id':_0xef9dcb['params']['id']},'attributes':['id',_0xe6d9('0x73')],'raw':!![]};return db[_0xe6d9('0x30')]['find'](_0xf94210)[_0xe6d9('0x13')](handleEntityNotFound(_0x4dc161,null))['then'](function(_0xb9d1a7){if(_0xb9d1a7){if(!_['isNil'](_0xb9d1a7[_0xe6d9('0x73')])){if(fs[_0xe6d9('0x6e')](path[_0xe6d9('0x70')](config[_0xe6d9('0x69')],_0xe6d9('0x74'),_0xb9d1a7['agentAvatar']))){_0x44069e=path[_0xe6d9('0x70')](config[_0xe6d9('0x69')],_0xe6d9('0x74'),_0xb9d1a7[_0xe6d9('0x73')]);}}return _0x4dc161['download'](_0x44069e);}})['catch'](handleError(_0x4dc161,null));};exports[_0xe6d9('0x75')]=function(_0x3224ba,_0x308782){var _0x14f51d=path[_0xe6d9('0x70')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x396da2={'where':{'id':_0x3224ba['params']['id']},'attributes':['id',_0xe6d9('0x66'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xe6d9('0x47')](_0x396da2)[_0xe6d9('0x13')](handleEntityNotFound(_0x308782,null))[_0xe6d9('0x13')](function(_0xc48ea1){if(_0xc48ea1){if(!_[_0xe6d9('0x76')](_0xc48ea1[_0xe6d9('0x66')])){if(fs[_0xe6d9('0x6e')](path[_0xe6d9('0x70')](config['root'],'server/files/images/avatars/',_0xc48ea1[_0xe6d9('0x66')]))&&_0xc48ea1[_0xe6d9('0x77')]){_0x14f51d=path['join'](config[_0xe6d9('0x69')],'server/files/images/avatars/',_0xc48ea1['customerAvatar']);}}return _0x308782[_0xe6d9('0x78')](_0x14f51d);}})[_0xe6d9('0x48')](handleError(_0x308782,null));};exports[_0xe6d9('0x79')]=function(_0x491330,_0x5a6b52){var _0x540413=path[_0xe6d9('0x70')](config[_0xe6d9('0x69')],_0xe6d9('0x7a'));var _0x5e95ae={'where':{'id':_0x491330[_0xe6d9('0x50')]['id']},'attributes':['id',_0xe6d9('0x67')],'raw':!![]};return db['ChatWebsite'][_0xe6d9('0x47')](_0x5e95ae)[_0xe6d9('0x13')](handleEntityNotFound(_0x5a6b52,null))['then'](function(_0x517c32){if(_0x517c32){if(!_[_0xe6d9('0x76')](_0x517c32[_0xe6d9('0x67')])){if(fs['existsSync'](path['join'](config['root'],_0xe6d9('0x74'),_0x517c32[_0xe6d9('0x67')]))){_0x540413=path[_0xe6d9('0x70')](config['root'],_0xe6d9('0x74'),_0x517c32[_0xe6d9('0x67')]);}}return _0x5a6b52[_0xe6d9('0x78')](_0x540413);}})[_0xe6d9('0x48')](handleError(_0x5a6b52,null));};exports[_0xe6d9('0x7b')]=function(_0x545200,_0x2ee29e){var _0x3a717b=require(_0xe6d9('0x7c'));var _0x5d2f3a=new _0x3a717b();var _0x288782=_0x5d2f3a[_0xe6d9('0x7d')](_0x545200[_0xe6d9('0x7e')][_0xe6d9('0x7f')])[_0xe6d9('0x80')]();var _0x47b148={'body':_0x545200[_0xe6d9('0x4f')],'channel':_0xe6d9('0x81')};var _0x46308e=[];var _0x5872f7=[];var _0x162f92={};var _0x2de9fd=![];return db[_0xe6d9('0x82')][_0xe6d9('0x51')]()[_0xe6d9('0x13')](function(_0x578194){if(!_0x578194){throw new db['Sequelize'][(_0xe6d9('0x83'))](_0xe6d9('0x84'));}_0x46308e=_[_0xe6d9('0x85')](_[_0xe6d9('0x36')](_0x578194),[_0xe6d9('0x86'),_0xe6d9('0x87')]);_0x5872f7=_[_0xe6d9('0x85')](_[_0xe6d9('0x36')](_0x578194),[_0xe6d9('0x86'),_0xe6d9('0x87'),'CompanyId',_0xe6d9('0x88')]);if(_0x545200['body']['id']){delete _0x545200[_0xe6d9('0x4f')]['id'];}if(_[_0xe6d9('0x76')](_0x545200[_0xe6d9('0x4f')][_0xe6d9('0x89')])){throw new db[(_0xe6d9('0x8a'))][(_0xe6d9('0x83'))]('from\x20is\x20mandatory');}if(_[_0xe6d9('0x76')](_0x545200[_0xe6d9('0x4f')][_0xe6d9('0x4f')])||_0x545200[_0xe6d9('0x4f')][_0xe6d9('0x4f')]===''){throw new db['Sequelize'][(_0xe6d9('0x83'))](_0xe6d9('0x8b'));}if(_[_0xe6d9('0x76')](_0x545200[_0xe6d9('0x4f')][_0xe6d9('0x8c')])){throw new db[(_0xe6d9('0x8a'))][(_0xe6d9('0x83'))](_0xe6d9('0x8d')+_0x5872f7);}if(!_[_0xe6d9('0x8e')](_0x5872f7,_0x545200['body']['mapKey'])){throw new db[(_0xe6d9('0x8a'))][(_0xe6d9('0x83'))](_0xe6d9('0x8f')+_0x5872f7);}_0x162f92[_0x545200[_0xe6d9('0x4f')][_0xe6d9('0x8c')]]=_0x545200['body'][_0xe6d9('0x89')];})['then'](function(){return db[_0xe6d9('0x30')]['find']({'where':{'id':_0x545200[_0xe6d9('0x50')]['id']},'include':[{'model':db[_0xe6d9('0x90')],'as':_0xe6d9('0x91'),'include':[{'model':db[_0xe6d9('0x82')],'as':_0xe6d9('0x92'),'where':_0x162f92,'limit':0x1,'order':[[_0xe6d9('0x87'),_0xe6d9('0x93')]]}]},{'model':db[_0xe6d9('0x94')],'as':_0xe6d9('0x95')}]});})[_0xe6d9('0x13')](handleEntityNotFound(_0x2ee29e,null))[_0xe6d9('0x13')](function(_0x3fa156){if(_0x3fa156&&_0x3fa156[_0xe6d9('0x91')]){_0x47b148['account']=_0x3fa156;_0x47b148[_0xe6d9('0x96')]=_0x3fa156[_0xe6d9('0x95')];_0x47b148[_0xe6d9('0x97')]=_0x3fa156[_0xe6d9('0x91')];_0x47b148[_0xe6d9('0x96')]=_['orderBy'](_0x47b148['applications'],[_0xe6d9('0x98')],[_0xe6d9('0x99')]);if(_0x47b148['account'][_0xe6d9('0x95')]){delete _0x47b148['account'][_0xe6d9('0x95')];}if(_0x47b148['account'][_0xe6d9('0x91')]&&_0x47b148[_0xe6d9('0x9a')]['List']['Contacts']['length']){return _0x47b148['account'][_0xe6d9('0x91')]['Contacts'][0x0];}var _0x9b369d=_[_0xe6d9('0xc')](_0x545200[_0xe6d9('0x4f')],{'firstName':_0x545200[_0xe6d9('0x4f')]['from'],'ListId':_0x3fa156[_0xe6d9('0x88')]});_0x9b369d[_0x545200['body'][_0xe6d9('0x8c')]]=_0x545200[_0xe6d9('0x4f')][_0xe6d9('0x89')];return db[_0xe6d9('0x82')][_0xe6d9('0x49')](_0x9b369d,{'fields':_0x46308e,'raw':!![]});}})[_0xe6d9('0x13')](handleEntityNotFound(_0x2ee29e,null))[_0xe6d9('0x13')](function(_0x5eff11){_0x47b148[_0xe6d9('0x9b')]=_0x5eff11;var _0x23fdfd=_0x545200[_0xe6d9('0x4f')]['customerIp'];if(_0x545200[_0xe6d9('0x7e')][_0xe6d9('0x9c')]){_0x23fdfd=_0x545200[_0xe6d9('0x7e')]['cf-connecting-ip'];}else if(_0x545200['headers'][_0xe6d9('0x9d')]){_0x23fdfd=_[_0xe6d9('0x9e')](_0x545200[_0xe6d9('0x7e')][_0xe6d9('0x9d')]['split'](','));}if(_0x5eff11){var _0x396932={'ContactId':_0x5eff11['id'],'ChatWebsiteId':_0x545200[_0xe6d9('0x50')]['id'],'from':(_0x5eff11['firstName']||'')+'\x20'+(_0x5eff11[_0xe6d9('0x9f')]||''),'customerIp':_0x23fdfd,'customerPort':_0x545200[_0xe6d9('0x7e')][_0xe6d9('0xa0')]?_0x545200[_0xe6d9('0x7e')][_0xe6d9('0xa0')]:null,'referer':_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xa1')],'browserName':_0x288782[_0xe6d9('0xa2')][_0xe6d9('0x2b')]&&_0x288782['browser'][_0xe6d9('0xa3')]?util[_0xe6d9('0xa4')]('%s\x20%s',_0x288782['browser'][_0xe6d9('0x2b')],_0x288782[_0xe6d9('0xa2')][_0xe6d9('0xa3')]):'unknown','browserVersion':_0x288782[_0xe6d9('0xa2')][_0xe6d9('0xa3')]||_0xe6d9('0xa5'),'osName':util['format']('%s\x20%s',_0x288782['os'][_0xe6d9('0x2b')],_0x288782['os'][_0xe6d9('0xa3')]),'osVersion':_0x288782['os'][_0xe6d9('0xa3')],'deviceModel':_0x288782[_0xe6d9('0xa6')][_0xe6d9('0x34')]&&_0x288782[_0xe6d9('0xa6')][_0xe6d9('0xa7')]?util[_0xe6d9('0xa4')]('%s\x20%s\x20%s',_0x288782[_0xe6d9('0xa6')][_0xe6d9('0x34')],_0x288782[_0xe6d9('0xa6')]['vendor'],_0x288782['device'][_0xe6d9('0x32')]):null,'deviceVendor':_0x288782[_0xe6d9('0xa6')][_0xe6d9('0xa7')],'deviceType':_0x288782[_0xe6d9('0xa6')][_0xe6d9('0x32')],'formData':JSON[_0xe6d9('0x18')](_0x545200[_0xe6d9('0x4f')])};var _0x579245={'ChatWebsiteId':_0x545200[_0xe6d9('0x50')]['id'],'closed':![]};if(_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xa8')]){_0x579245[_0xe6d9('0xa8')]=_0x545200['body'][_0xe6d9('0xa8')];return db[_0xe6d9('0xa9')][_0xe6d9('0x47')]({'where':_0x579245})[_0xe6d9('0x13')](function(_0x5e20dd){if(_0x5e20dd){return[_0x5e20dd,![]];}_0x396932[_0xe6d9('0xa8')]=_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xa8')];_0x396932['externalUrl']=_0x545200['body'][_0xe6d9('0xaa')];return db[_0xe6d9('0xa9')][_0xe6d9('0x49')](_0x396932)['then'](function(_0x42ae1e){return[_0x42ae1e,!![]];});});}_0x579245[_0xe6d9('0xab')]=_0x5eff11['id'];if(_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xac')]&&_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xac')]['id']){_0x579245['id']=_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xac')]['id'];return db[_0xe6d9('0xa9')][_0xe6d9('0x47')]({'where':_0x579245})['then'](function(_0x4a1cab){if(_0x4a1cab){return[_0x4a1cab,![]];}return db['ChatInteraction'][_0xe6d9('0x49')](_0x396932)[_0xe6d9('0x13')](function(_0x58fbca){return[_0x58fbca,!![]];});});}return db[_0xe6d9('0xa9')][_0xe6d9('0x49')](_0x396932)['then'](function(_0x208917){return[_0x208917,!![]];});}})['spread'](function(_0x47477b,_0x136aac){if(_0x47477b){_0x2de9fd=_0x136aac;if(!_0x136aac){var _0x186063={'from':(_0x47b148['contact'][_0xe6d9('0xad')]||'')+'\x20'+(_0x47b148['contact'][_0xe6d9('0x9f')]||'')};if(_0x545200['body'][_0xe6d9('0xa8')]&&_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xae')]&&_0x545200[_0xe6d9('0x4f')]['threadId']!=_0x545200['body']['messageId']){_0x186063['threadId']=_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xae')];}return _0x47477b['update'](_0x186063);}else{return _0x47477b;}}})['then'](function(_0x582535){_0x47b148['interaction']=_0x582535[_0xe6d9('0x27')]({'plain':!![]});_0x47b148[_0xe6d9('0xac')][_0xe6d9('0xaf')]=_0x2de9fd;if(_0x47b148[_0xe6d9('0xac')]['created']){if(_0x47b148[_0xe6d9('0x9a')]['autoclose']){_0x47b148[_0xe6d9('0x96')][_0xe6d9('0xb0')]({'id':0x0,'priority':_0x47b148[_0xe6d9('0x96')][_0xe6d9('0x3b')]+0x1,'app':_0xe6d9('0xb1'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xe6d9('0xb2')][_0xe6d9('0x49')]({'body':_0x545200[_0xe6d9('0x4f')][_0xe6d9('0x4f')],'ChatWebsiteId':_0x545200['params']['id'],'ChatInteractionId':_0x582535['id'],'direction':'in','ContactId':_0x47b148[_0xe6d9('0x9b')]['id'],'AttachmentId':_0x545200[_0xe6d9('0x4f')][_0xe6d9('0xb3')]});})[_0xe6d9('0x13')](function(_0x3c9247){_0x47b148[_0xe6d9('0x1b')]=_0x3c9247;if(_0x47b148[_0xe6d9('0xac')][_0xe6d9('0xb4')]){return db['User']['find']({'attributes':['id',_0xe6d9('0x2b')],'where':{'id':_0x47b148[_0xe6d9('0xac')][_0xe6d9('0xb4')]}})['then'](function(_0x177c2f){if(_0x177c2f){_0x47b148[_0xe6d9('0x96')][_0xe6d9('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x177c2f[_0xe6d9('0x2b')]+','+(_0x47b148[_0xe6d9('0x9a')][_0xe6d9('0xb6')]||0xa),'interval':_0xe6d9('0xb7')});_0x47b148[_0xe6d9('0xb8')]=!![];}return respondWithRpcPromise('Start',_0xe6d9('0xb9'),_0x47b148);});}return respondWithRpcPromise(_0xe6d9('0xba'),_0xe6d9('0xb9'),_0x47b148);})[_0xe6d9('0x13')](function(_0x2ff776){respondWithRpcPromise(_0xe6d9('0xbb'),_0xe6d9('0xbb'),{'event':'notify','message':_0x2ff776},client9002);return _0x2ff776;})[_0xe6d9('0x13')](respondWithResult(_0x2ee29e,null))[_0xe6d9('0x48')](handleError(_0x2ee29e,null));};exports[_0xe6d9('0xbc')]=function(_0x5ca0d2,_0x336ae5){var _0x4a32e5,_0x58953a,_0x1ec06d;var _0x432317=[];var _0x23ab2b={};var _0x2cba15=_0x5ca0d2[_0xe6d9('0xbd')]||[];var _0x300f75=[];var _0x587d1c;return db[_0xe6d9('0x82')]['describe']()[_0xe6d9('0x13')](function(_0x3070a3){if(!_0x3070a3){throw new db[(_0xe6d9('0x8a'))][(_0xe6d9('0x83'))](_0xe6d9('0x84'));}_0x432317=_['difference'](_[_0xe6d9('0x36')](_0x3070a3),[_0xe6d9('0x86'),_0xe6d9('0x87'),'CompanyId',_0xe6d9('0x88')]);if(_0x5ca0d2[_0xe6d9('0x4f')]['id']){delete _0x5ca0d2[_0xe6d9('0x4f')]['id'];}if(_[_0xe6d9('0x76')](_0x5ca0d2['body'][_0xe6d9('0x89')])){throw _0x336ae5[_0xe6d9('0x1e')](0x1f4)['send'](new db[(_0xe6d9('0x8a'))][(_0xe6d9('0x83'))](_0xe6d9('0xbe')));}if(_[_0xe6d9('0x76')](_0x5ca0d2[_0xe6d9('0x4f')][_0xe6d9('0x4f')])||_0x5ca0d2['body'][_0xe6d9('0x4f')]===''){throw _0x336ae5[_0xe6d9('0x1e')](0x1f4)[_0xe6d9('0x2c')](new db[(_0xe6d9('0x8a'))][(_0xe6d9('0x83'))](_0xe6d9('0x8b')));}if(_[_0xe6d9('0x76')](_0x5ca0d2[_0xe6d9('0x4f')][_0xe6d9('0xbf')])){throw _0x336ae5[_0xe6d9('0x1e')](0x1f4)[_0xe6d9('0x2c')](new db[(_0xe6d9('0x8a'))][(_0xe6d9('0x83'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x432317));}if(!_[_0xe6d9('0x8e')](_0x432317,_0x5ca0d2[_0xe6d9('0x4f')]['mapKeyOffline'])){throw _0x336ae5[_0xe6d9('0x1e')](0x1f4)['send'](new db[(_0xe6d9('0x8a'))][(_0xe6d9('0x83'))](_0xe6d9('0xc0')+_0x432317));}_0x23ab2b[_0x5ca0d2[_0xe6d9('0x4f')][_0xe6d9('0xbf')]]=_0x5ca0d2[_0xe6d9('0x4f')]['from'];})[_0xe6d9('0x13')](function(){return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'where':{'id':_0x5ca0d2[_0xe6d9('0x50')]['id']},'include':[{'model':db[_0xe6d9('0x90')],'as':'List'},{'model':db[_0xe6d9('0xc1')],'as':_0xe6d9('0xc1')}]});})[_0xe6d9('0x13')](handleEntityNotFound(_0x336ae5,null))['then'](function(_0x1a91a1){if(_0x1a91a1&&_0x1a91a1[_0xe6d9('0x91')]){_0x58953a=_0x1a91a1;var _0x124bd7=_[_0xe6d9('0xc')](_0x5ca0d2[_0xe6d9('0x4f')],{'firstName':_0x5ca0d2[_0xe6d9('0x4f')][_0xe6d9('0x89')],'phone':_0x5ca0d2['body']['from'],'ListId':_0x1a91a1['ListId']});_0x124bd7[_0x5ca0d2[_0xe6d9('0x4f')][_0xe6d9('0xbf')]]=_0x5ca0d2[_0xe6d9('0x4f')][_0xe6d9('0x89')];return db[_0xe6d9('0x82')]['findOrCreate']({'where':_0x23ab2b,'defaults':_0x124bd7});}})[_0xe6d9('0xc2')](function(_0x280473){if(_0x280473){_0x1ec06d=_0x280473;var _0x2d88b0=fs[_0xe6d9('0xc3')](path[_0xe6d9('0x70')](config[_0xe6d9('0x69')],_0xe6d9('0xc4')),_0xe6d9('0xc5'));var _0xf0a82e=ejs['render'](_0x2d88b0,{'body':_[_0xe6d9('0xc6')](_0x5ca0d2[_0xe6d9('0x4f')][_0xe6d9('0x4f')]),'bodyTitle':_0x58953a[_0xe6d9('0xc7')]});return db[_0xe6d9('0xc8')][_0xe6d9('0x49')]({'body':_0xf0a82e,'plainBody':htmlToText[_0xe6d9('0xc9')](_0xf0a82e),'ContactId':_0x280473['id'],'ChatWebsiteId':_0x58953a['id']});}})[_0xe6d9('0x13')](function(_0x5d97d4){_0x587d1c=_0x5d97d4;if(_0x2cba15[_0xe6d9('0x3b')]){var _0x9030d7=_0x2cba15['map'](function(_0x4d688c){return{'name':_0x4d688c['originalname'],'basename':_0x4d688c[_0xe6d9('0x63')],'type':_0x4d688c[_0xe6d9('0xca')],'ChatOfflineMessageId':_0x5d97d4['id']};});_0x300f75=_0x9030d7[_0xe6d9('0x2f')](_0x27fd90=>{var _0x5e77b9={'filename':_0x27fd90[_0xe6d9('0x2b')],'path':path[_0xe6d9('0x70')](config['root'],'server','files','attachments',_0xe6d9('0xcb'),_0x27fd90[_0xe6d9('0xcc')])};return _0x5e77b9;});if(!_0x58953a[_0xe6d9('0xcd')]){return db[_0xe6d9('0xce')][_0xe6d9('0xcf')](function(_0xa1bf44){return db[_0xe6d9('0xd0')][_0xe6d9('0xd1')](_0x9030d7,{'transaction':_0xa1bf44});});}}})[_0xe6d9('0x13')](function(){if(_0x587d1c){_0x4a32e5=_0x587d1c;return db['MailAccount'][_0xe6d9('0x5e')]({'where':{'service':!![]},'include':[{'model':db[_0xe6d9('0xd2')],'as':_0xe6d9('0xd3'),'raw':!![],'include':[{'model':db[_0xe6d9('0xd4')],'as':_0xe6d9('0xd4'),'raw':!![]}]}]});}})['then'](function(_0x28f4bf){if(_0x28f4bf&&_0x28f4bf[_0xe6d9('0xd3')]&&_0x58953a[_0xe6d9('0xd5')]&&_0x58953a[_0xe6d9('0xd6')]){var _0x4fc51a=_0x28f4bf[_0xe6d9('0xd7')]();return respondWithRpcPromise(_0xe6d9('0xd8'),_0xe6d9('0xd9'),{'account':_0x4fc51a,'message':{'from':util[_0xe6d9('0xa4')]('\x22%s\x22\x20<%s>',_0x28f4bf[_0xe6d9('0x2b')],_0x28f4bf[_0xe6d9('0xda')]||_0x28f4bf[_0xe6d9('0xd3')][_0xe6d9('0x4a')]),'to':_0x58953a[_0xe6d9('0xd6')],'subject':_0x58953a['offlineMessageSubject'],'html':_0x4a32e5[_0xe6d9('0x4f')],'attachments':_0x300f75}},client9003)[_0xe6d9('0x13')](function(){return _0x4a32e5;})[_0xe6d9('0x48')](function(_0x970cc7){logger['error'](_0x970cc7);});}})[_0xe6d9('0x13')](function(){if(_0x58953a&&_0x58953a[_0xe6d9('0xcd')]&&_0x58953a[_0xe6d9('0xdb')]){var _0x31187e=[];if(_0x2cba15[_0xe6d9('0x3b')]){_0x31187e=_0x2cba15[_0xe6d9('0x2f')](function(_0x442331){return{'name':_0x442331[_0xe6d9('0xdc')],'basename':_0x442331['filename'],'type':_0x442331[_0xe6d9('0xca')],'ChatOfflineMessageId':_0x587d1c['id']};});}var _0x31567f;if(!_['isNil'](_0x58953a[_0xe6d9('0xdd')])){var _0x375f10=_[_0xe6d9('0x2f')](_0x5ca0d2[_0xe6d9('0x4f')],function(_0x2afeee){return _0x2afeee;});var _0x103b5c=_[_0xe6d9('0xde')](_0x375f10)[0x0];var _0x5bf20a=_[_0xe6d9('0xdf')](_0x103b5c,function(_0x529cc0){return _0x529cc0;});_0x31567f=_0x5bf20a[0x1][_0x58953a[_0xe6d9('0xdd')]];}var _0x2ec4a8={'from':_0x1ec06d['email'],'firstName':_0x1ec06d[_0xe6d9('0xad')],'lastName':_0x1ec06d['lastName'],'mapKey':'email','message':{'from':_0x1ec06d[_0xe6d9('0xda')],'to':_0x58953a[_0xe6d9('0xc1')]['email'],'cc':'','subject':_[_0xe6d9('0x76')](_0x31567f)?_0x58953a[_0xe6d9('0xe0')]:_0x31567f,'messageId':'','sentAt':new Date(),'attach':_0x31187e['length'],'attachments':_0x31187e,'originChannel':'Chat','ChatWebsiteId':_0x58953a['id'],'ChatOfflineMessageId':_0x4a32e5['id'],'originTo':_0x58953a[_0xe6d9('0xc1')]['email']},'body':_0x4a32e5[_0xe6d9('0x4f')]};var _0x23b8c7={'account':{'id':_0x58953a[_0xe6d9('0xdb')]},'body':_0x2ec4a8,'log':_0xe6d9('0xe1')};return respondWithRpcPromise('NotifyMailAccount',_0xe6d9('0xe2'),_0x23b8c7,client9001)['then'](function(){return _0x4a32e5;})[_0xe6d9('0x48')](function(_0x54fc0c){logger['error'](_0x54fc0c);});}return;})['then'](function(){if(_0x4a32e5){return _0x4a32e5;}})[_0xe6d9('0x13')](respondWithResult(_0x336ae5,null))[_0xe6d9('0x48')](function(_0xe00e7c){logger['error'](_0xe6d9('0x48'),_0xe00e7c);for(var _0x588efc of _0x2cba15){var _0x304d7f=path['join'](config[_0xe6d9('0x69')],'server',_0xe6d9('0xbd'),_0xe6d9('0xe3'),_0xe6d9('0xcb'),_0x588efc[_0xe6d9('0x63')]);fs_extra['remove'](_0x304d7f)[_0xe6d9('0x48')](function(_0x4b5b24){logger[_0xe6d9('0x19')](_0xe6d9('0xe4'),_0x304d7f,_0x4b5b24);});}});};exports[_0xe6d9('0xe5')]=function(_0x57c94a,_0x328a11){return db[_0xe6d9('0xa9')][_0xe6d9('0x47')]({'where':{'id':_0x57c94a[_0xe6d9('0x50')]['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x328a11,null))[_0xe6d9('0x13')](function(_0x583802){if(_0x583802){return _0x583802[_0xe6d9('0xe5')](_0x57c94a[_0xe6d9('0x4f')][_0xe6d9('0x5b')],_[_0xe6d9('0xe6')](_0x57c94a['body'],[_0xe6d9('0x5b'),'id'])||{});}})[_0xe6d9('0x13')](respondWithResult(_0x328a11,null))['catch'](handleError(_0x328a11,null));};exports[_0xe6d9('0xe7')]=function(_0x45277e,_0x5d68d5){var _0x332ad1={'raw':![],'where':{}};var _0x103eaf={};var _0x22e87f={'count':0x0,'rows':[]};return db[_0xe6d9('0x30')][_0xe6d9('0x5e')]({'where':{'id':_0x45277e[_0xe6d9('0x50')]['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x5d68d5,null))[_0xe6d9('0x13')](function(_0xcccb1c){if(_0xcccb1c){_0x103eaf[_0xe6d9('0x34')]=_[_0xe6d9('0x36')](db[_0xe6d9('0xa9')][_0xe6d9('0x46')]);_0x103eaf[_0xe6d9('0x35')]=_[_0xe6d9('0x36')](_0x45277e[_0xe6d9('0x35')]);_0x103eaf[_0xe6d9('0x37')]=_[_0xe6d9('0x38')](_0x103eaf[_0xe6d9('0x34')],_0x103eaf[_0xe6d9('0x35')]);_0x332ad1[_0xe6d9('0x39')]=_[_0xe6d9('0x38')](_0x103eaf[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x45277e['query'][_0xe6d9('0x3a')]));_0x332ad1['attributes']=_0x332ad1[_0xe6d9('0x39')][_0xe6d9('0x3b')]?_0x332ad1[_0xe6d9('0x39')]:_0x103eaf[_0xe6d9('0x34')];if(!_0x45277e[_0xe6d9('0x35')][_0xe6d9('0x56')]('nolimit')){_0x332ad1[_0xe6d9('0x3d')]=qs[_0xe6d9('0x3d')](_0x45277e[_0xe6d9('0x35')][_0xe6d9('0x3d')]);_0x332ad1[_0xe6d9('0x20')]=qs['offset'](_0x45277e[_0xe6d9('0x35')][_0xe6d9('0x20')]);}_0x332ad1[_0xe6d9('0x3e')]=qs['sort'](_0x45277e['query']['sort']);_0x332ad1[_0xe6d9('0x41')]=qs[_0xe6d9('0x37')](_[_0xe6d9('0x57')](_0x45277e[_0xe6d9('0x35')],_0x103eaf[_0xe6d9('0x37')]));_0x332ad1[_0xe6d9('0x41')][_0xe6d9('0x53')]=_0xcccb1c['id'];if(_0x45277e[_0xe6d9('0x35')][_0xe6d9('0x40')]){_0x332ad1['where']=_['merge'](_0x332ad1['where'],{'$or':_[_0xe6d9('0x2f')](_0x332ad1[_0xe6d9('0x39')],function(_0xabe9e8){var _0x59a3fd={};_0x59a3fd[_0xabe9e8]={'$like':'%'+_0x45277e['query'][_0xe6d9('0x40')]+'%'};return _0x59a3fd;})});}_0x332ad1=_[_0xe6d9('0x42')]({},_0x332ad1,_0x45277e[_0xe6d9('0x5f')]);return db[_0xe6d9('0xa9')][_0xe6d9('0x22')]({'where':_0x332ad1[_0xe6d9('0x41')]})[_0xe6d9('0x13')](function(_0x4dcf2d){_0x22e87f[_0xe6d9('0x22')]=_0x4dcf2d;if(_0x45277e[_0xe6d9('0x35')][_0xe6d9('0x43')]){_0x332ad1[_0xe6d9('0x44')]=[{'model':db[_0xe6d9('0x82')],'as':_0xe6d9('0xe8'),'required':![]},{'model':db[_0xe6d9('0xe9')],'as':_0xe6d9('0xea'),'attributes':[_0xe6d9('0x2b'),_0xe6d9('0xeb'),'internal'],'required':![]},{'model':db[_0xe6d9('0xec')],'as':_0xe6d9('0xed'),'attributes':['id','name',_0xe6d9('0xee')],'where':_0x45277e[_0xe6d9('0x35')][_0xe6d9('0xef')]?{'id':_0x45277e[_0xe6d9('0x35')][_0xe6d9('0xef')]}:undefined,'required':_0x45277e[_0xe6d9('0x35')]['tag']?!![]:![]}];}return db[_0xe6d9('0xa9')][_0xe6d9('0x58')](_0x332ad1);})[_0xe6d9('0x13')](function(_0x543921){_0x22e87f[_0xe6d9('0x59')]=_0x543921;return _0x22e87f;});}})['then'](respondWithFilteredResult(_0x5d68d5,_0x332ad1))[_0xe6d9('0x48')](handleError(_0x5d68d5,null));};function iftimePromise(_0x471cbe,_0x1fcfd1){return respondWithRpcPromise(_0xe6d9('0xf0'),_0xe6d9('0xf1'),{'command':_0x1fcfd1[_0xe6d9('0xf2')]?util[_0xe6d9('0xa4')](_0xe6d9('0xf3'),_0x471cbe[_0xe6d9('0xf4')],_0x1fcfd1[_0xe6d9('0xf2')]):util[_0xe6d9('0xa4')](_0xe6d9('0xf5'),_0x471cbe[_0xe6d9('0xf4')])},client9002)['then'](function(_0x7eb158){var _0x3d3b4a=_0x7eb158&&_0x7eb158['indexOf'](_0xe6d9('0xf6'))>=0x0?!![]:![];logger['info'](_0xe6d9('0xf7'),_0x1fcfd1['id'],_0x471cbe['id'],_0x471cbe[_0xe6d9('0xf4')],_0x3d3b4a?_0xe6d9('0xf8'):'OFFLINE',_0x1fcfd1['timezone']?_0x1fcfd1[_0xe6d9('0xf2')]:_0xe6d9('0xf9'));return _0x3d3b4a;})[_0xe6d9('0x48')](function(_0x5f580e){logger[_0xe6d9('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1fcfd1['id'],_0x471cbe['id'],_0x471cbe[_0xe6d9('0xf4')],util[_0xe6d9('0xfa')](_0x5f580e,{'showHidden':![],'depth':null}),_0x1fcfd1[_0xe6d9('0xf2')]?_0x1fcfd1[_0xe6d9('0xf2')]:_0xe6d9('0xf9'));return![];});}exports[_0xe6d9('0xf1')]=function(_0xeb36fa,_0x279a3c){var _0x286fbd=0x0;var _0x376625=0x0;var _0x3154b6=![];var _0x2c5a5b;var _0xffed10;return db[_0xe6d9('0x30')]['find']({'where':{'id':_0xeb36fa['params']['id']},'include':[{'model':db[_0xe6d9('0xfb')],'as':_0xe6d9('0xfb'),'include':[{'model':db[_0xe6d9('0xfb')],'as':_0xe6d9('0xfc'),'attributes':['id',_0xe6d9('0xf4')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x279a3c,null))[_0xe6d9('0x13')](function(_0x1d6b06){if(_0x1d6b06){_0x2c5a5b=_0x1d6b06;return _0x1d6b06['getProactiveActions']({'raw':!![]});}})['then'](function(_0x40d1cf){if(_0x2c5a5b){if(_0x40d1cf){_0xffed10=_0x40d1cf;}}return require(_0xe6d9('0x6c'))['getLicense']();})[_0xe6d9('0x13')](function(_0x383c22){if(_0x383c22){_0x376625=_0x383c22['virtual'];_0x3154b6=_0x383c22[_0xe6d9('0x6d')];}})[_0xe6d9('0x13')](function(){return db[_0xe6d9('0xa9')][_0xe6d9('0x22')]({'where':{'closed':![]}});})[_0xe6d9('0x13')](function(_0x88d71a){_0x286fbd=_0x88d71a;if(_0x376625&&_0x88d71a>_0x376625){return db[_0xe6d9('0xfd')]['findOne']({'where':{'id':0x1}})['then'](function(_0x51dc70){if(_0x51dc70){_0x51dc70[_0xe6d9('0xfe')](_0xe6d9('0xff'));}});}})['then'](function(){if(_0x2c5a5b[_0xe6d9('0xfb')]&&_0x2c5a5b[_0xe6d9('0xfb')][_0xe6d9('0xfc')]){var _0x32122b=[];for(var _0x43273d=0x0;_0x43273d<_0x2c5a5b[_0xe6d9('0xfb')][_0xe6d9('0xfc')][_0xe6d9('0x3b')];_0x43273d++){var _0x96f3e5=_0x2c5a5b['Interval']['Intervals'][_0x43273d]['get']({'plain':!![]});_0x32122b[_0xe6d9('0xb0')](iftimePromise(_0x96f3e5,_0x2c5a5b));}return BPromise[_0xe6d9('0x100')](_0x32122b)[_0xe6d9('0x13')](function(_0x3cf029){return _[_0xe6d9('0x101')](_0x3cf029);});}else{return!![];}})[_0xe6d9('0x13')](function(_0x5d4f33){var _0x44f32c=fs[_0xe6d9('0xc3')](path[_0xe6d9('0x70')](config['root'],_0xe6d9('0x102')),_0xe6d9('0xc5'));var _0xcba026={'remote':_0x2c5a5b[_0xe6d9('0x103')],'query':querystring[_0xe6d9('0x18')](_[_0xe6d9('0x42')](_0x2c5a5b[_0xe6d9('0x27')]({'plain':!![]}),{'customerIp':_0xeb36fa[_0xe6d9('0x7e')][_0xe6d9('0x9d')]||_0xeb36fa[_0xe6d9('0x7e')]['x-real-ip']||_0xeb36fa[_0xe6d9('0x104')][_0xe6d9('0x105')]||_0xeb36fa['ip'],'referer':_0xeb36fa[_0xe6d9('0x7e')][_0xe6d9('0xa1')],'openedInteractions':_0x286fbd,'maxInteractions':_0x376625,'virtual':_0x3154b6[_0xe6d9('0x106')],'online':_0x5d4f33,'custom':_0x3154b6}))[_0xe6d9('0x107')](/'/g,'\x5c\x27')};_0x279a3c[_0xe6d9('0x2c')](ejs[_0xe6d9('0x108')](Mustache[_0xe6d9('0x108')](_0x44f32c,_0xcba026),{'proactiveActions':_0xffed10,'alignment':_0x2c5a5b[_0xe6d9('0x109')],'verticalAlignment':_0x2c5a5b[_0xe6d9('0x10a')],'div_color':_0x2c5a5b[_0xe6d9('0xee')],'labelText':_0x2c5a5b[_0xe6d9('0x10b')],'text_color':_0x2c5a5b[_0xe6d9('0x10c')],'text_button_color':_0x2c5a5b[_0xe6d9('0x10d')],'button_color':_0x2c5a5b[_0xe6d9('0x10e')],'background_color':_0x2c5a5b['backgroundColor'],'hideWhenOffline':_0x2c5a5b[_0xe6d9('0x10f')],'interval':_0x2c5a5b['IntervalId']}));})[_0xe6d9('0x48')](handleError(_0x279a3c,null));};exports[_0xe6d9('0x110')]=function(_0x257e08,_0x1c9171){var _0x32be6c=_0x257e08[_0xe6d9('0x50')]['id'];var _0x3fce15=_0x257e08[_0xe6d9('0x4f')];var _0xc5e27e=0xc8;var _0x52065f=null;return db[_0xe6d9('0xce')][_0xe6d9('0xcf')]({'isolationLevel':db[_0xe6d9('0xce')][_0xe6d9('0x111')][_0xe6d9('0x112')][_0xe6d9('0x113')]},function(_0x18976b){return db[_0xe6d9('0x30')]['findOne']({'where':{'id':_0x32be6c},'transaction':_0x18976b})[_0xe6d9('0x13')](function(_0xc4b43a){if(_0xc4b43a){return db[_0xe6d9('0x94')][_0xe6d9('0x26')]({'where':{'ChatWebsiteId':_0x32be6c},'transaction':_0x18976b})[_0xe6d9('0x13')](function(){var _0x22031a=_[_0xe6d9('0x2f')](_0x3fce15,function(_0x3cfb4d){_0x3cfb4d['ChatWebsiteId']=_0x32be6c;return _0x3cfb4d;});return db[_0xe6d9('0x94')][_0xe6d9('0xd1')](_0x22031a,{'transaction':_0x18976b});});}else{_0xc5e27e=0x194;_0x52065f=[];}});})[_0xe6d9('0x13')](function(){if(_0xc5e27e!==0x194){return db[_0xe6d9('0x94')][_0xe6d9('0x114')]({'where':{'ChatWebsiteId':_0x32be6c},'order':_0xe6d9('0x98')})['then'](function(_0x4c98c7){_0x52065f=_0x4c98c7;});}})[_0xe6d9('0x48')](function(_0x15072f){_0xc5e27e=0x1f4;logger[_0xe6d9('0x19')](_0x15072f[_0xe6d9('0x2a')]);if(_0x15072f[_0xe6d9('0x2b')]){delete _0x15072f['name'];}_0x52065f=_0x15072f;})[_0xe6d9('0x115')](function(){if(_0x52065f===null){_0x1c9171[_0xe6d9('0x1c')](_0xc5e27e);}else{if(_0xc5e27e===0x1f4){_0x1c9171[_0xe6d9('0x1e')](_0xc5e27e)[_0xe6d9('0x2c')](_0x52065f);}else{_0x1c9171['status'](_0xc5e27e)[_0xe6d9('0x1f')](_0x52065f);}}});};exports[_0xe6d9('0x116')]=function(_0x433449,_0x287bbd){var _0x1c6c1d={};var _0x3fc712={};var _0x48c6ab;var _0x3c5767;return db[_0xe6d9('0x30')][_0xe6d9('0x5e')]({'where':{'id':_0x433449[_0xe6d9('0x50')]['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x287bbd,null))[_0xe6d9('0x13')](function(_0x925caa){if(_0x925caa){_0x48c6ab=_0x925caa;_0x3fc712['model']=_[_0xe6d9('0x36')](db['ChatApplication'][_0xe6d9('0x46')]);_0x3fc712[_0xe6d9('0x35')]=_[_0xe6d9('0x36')](_0x433449['query']);_0x3fc712[_0xe6d9('0x37')]=_[_0xe6d9('0x38')](_0x3fc712[_0xe6d9('0x34')],_0x3fc712[_0xe6d9('0x35')]);_0x1c6c1d['attributes']=_[_0xe6d9('0x38')](_0x3fc712[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x433449['query'][_0xe6d9('0x3a')]));_0x1c6c1d['attributes']=_0x1c6c1d['attributes'][_0xe6d9('0x3b')]?_0x1c6c1d[_0xe6d9('0x39')]:_0x3fc712[_0xe6d9('0x34')];_0x1c6c1d[_0xe6d9('0x3e')]=qs[_0xe6d9('0x3f')](_0x433449['query'][_0xe6d9('0x3f')]);_0x1c6c1d['where']=qs[_0xe6d9('0x37')](_[_0xe6d9('0x57')](_0x433449[_0xe6d9('0x35')],_0x3fc712[_0xe6d9('0x37')]));if(_0x433449['query'][_0xe6d9('0x40')]){_0x1c6c1d[_0xe6d9('0x41')]=_['merge'](_0x1c6c1d[_0xe6d9('0x41')],{'$or':_[_0xe6d9('0x2f')](_0x1c6c1d[_0xe6d9('0x39')],function(_0x1dd0ff){var _0xea49f0={};_0xea49f0[_0x1dd0ff]={'$like':'%'+_0x433449[_0xe6d9('0x35')][_0xe6d9('0x40')]+'%'};return _0xea49f0;})});}_0x1c6c1d=_[_0xe6d9('0x42')]({},_0x1c6c1d,_0x433449['options']);return _0x48c6ab['getApplications'](_0x1c6c1d);}})[_0xe6d9('0x13')](function(_0x1f4f00){if(_0x1f4f00){_0x3c5767=_0x1f4f00[_0xe6d9('0x3b')];if(!_0x433449[_0xe6d9('0x35')]['hasOwnProperty'](_0xe6d9('0x3c'))){_0x1c6c1d[_0xe6d9('0x3d')]=qs[_0xe6d9('0x3d')](_0x433449[_0xe6d9('0x35')]['limit']);_0x1c6c1d[_0xe6d9('0x20')]=qs['offset'](_0x433449[_0xe6d9('0x35')][_0xe6d9('0x20')]);}return _0x48c6ab[_0xe6d9('0x116')](_0x1c6c1d);}})[_0xe6d9('0x13')](function(_0x441b1d){if(_0x441b1d){return _0x441b1d?{'count':_0x3c5767,'rows':_0x441b1d}:null;}})[_0xe6d9('0x13')](respondWithResult(_0x287bbd,null))[_0xe6d9('0x48')](handleError(_0x287bbd,null));};exports[_0xe6d9('0x117')]=function(_0x15df45,_0x4a9ac0){return db[_0xe6d9('0x118')][_0xe6d9('0x47')]({'where':{'id':_0x15df45[_0xe6d9('0x50')]['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x4a9ac0,null))[_0xe6d9('0x13')](function(_0x29f510){if(_0x29f510){return _0x29f510[_0xe6d9('0x117')](_0x15df45[_0xe6d9('0x4f')][_0xe6d9('0x5b')],_[_0xe6d9('0xe6')](_0x15df45[_0xe6d9('0x4f')],[_0xe6d9('0x5b'),'id'])||{});}})[_0xe6d9('0x13')](respondWithResult(_0x4a9ac0,null))[_0xe6d9('0x48')](handleError(_0x4a9ac0,null));};exports[_0xe6d9('0x119')]=function(_0x276bc9,_0x17de6a){var _0x3b59ec={};var _0xfabbff={};var _0x4a7bdd;var _0x3bfdf9;return db['ChatWebsite'][_0xe6d9('0x5e')]({'where':{'id':_0x276bc9['params']['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x17de6a,null))[_0xe6d9('0x13')](function(_0x397aaa){if(_0x397aaa){_0x4a7bdd=_0x397aaa;_0xfabbff[_0xe6d9('0x34')]=_[_0xe6d9('0x36')](db[_0xe6d9('0x11a')][_0xe6d9('0x46')]);_0xfabbff['query']=_[_0xe6d9('0x36')](_0x276bc9['query']);_0xfabbff[_0xe6d9('0x37')]=_['intersection'](_0xfabbff[_0xe6d9('0x34')],_0xfabbff[_0xe6d9('0x35')]);_0x3b59ec[_0xe6d9('0x39')]=_[_0xe6d9('0x38')](_0xfabbff[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x276bc9[_0xe6d9('0x35')]['fields']));_0x3b59ec[_0xe6d9('0x39')]=_0x3b59ec[_0xe6d9('0x39')][_0xe6d9('0x3b')]?_0x3b59ec[_0xe6d9('0x39')]:_0xfabbff[_0xe6d9('0x34')];_0x3b59ec[_0xe6d9('0x3e')]=qs[_0xe6d9('0x3f')](_0x276bc9[_0xe6d9('0x35')][_0xe6d9('0x3f')]);_0x3b59ec[_0xe6d9('0x41')]=qs[_0xe6d9('0x37')](_[_0xe6d9('0x57')](_0x276bc9[_0xe6d9('0x35')],_0xfabbff[_0xe6d9('0x37')]));if(_0x276bc9[_0xe6d9('0x35')][_0xe6d9('0x40')]){_0x3b59ec[_0xe6d9('0x41')]=_[_0xe6d9('0x42')](_0x3b59ec['where'],{'$or':_[_0xe6d9('0x2f')](_0x3b59ec[_0xe6d9('0x39')],function(_0x276ad4){var _0x16f95c={};_0x16f95c[_0x276ad4]={'$like':'%'+_0x276bc9[_0xe6d9('0x35')][_0xe6d9('0x40')]+'%'};return _0x16f95c;})});}_0x3b59ec=_[_0xe6d9('0x42')]({},_0x3b59ec,_0x276bc9[_0xe6d9('0x5f')]);return _0x4a7bdd[_0xe6d9('0x119')](_0x3b59ec);}})[_0xe6d9('0x13')](function(_0x2e4f13){if(_0x2e4f13){_0x3bfdf9=_0x2e4f13['length'];if(!_0x276bc9[_0xe6d9('0x35')][_0xe6d9('0x56')](_0xe6d9('0x3c'))){_0x3b59ec['limit']=qs[_0xe6d9('0x3d')](_0x276bc9['query'][_0xe6d9('0x3d')]);_0x3b59ec[_0xe6d9('0x20')]=qs[_0xe6d9('0x20')](_0x276bc9['query'][_0xe6d9('0x20')]);}return _0x4a7bdd[_0xe6d9('0x119')](_0x3b59ec);}})['then'](function(_0x3e96a4){if(_0x3e96a4){return _0x3e96a4?{'count':_0x3bfdf9,'rows':_0x3e96a4}:null;}})[_0xe6d9('0x13')](respondWithResult(_0x17de6a,null))[_0xe6d9('0x48')](handleError(_0x17de6a,null));};exports['getFields']=function(_0x4b9979,_0x5927bc){var _0x53ecbe=_0x4b9979[_0xe6d9('0x35')]['online']===_0xe6d9('0x11b')?_0xe6d9('0x11c'):'onlineForm';return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'attributes':['id',_0x53ecbe],'where':{'id':_0x4b9979['params']['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x5927bc,null))[_0xe6d9('0x13')](function(_0x3f08da){if(_0x3f08da){var _0x3fcc1c=_0x3f08da[_0x53ecbe];var _0x379959=_0x3fcc1c&&_0x3fcc1c[_0xe6d9('0x11d')]?_0x3fcc1c['items']:[];_0x5927bc[_0xe6d9('0x2c')]({'fromKey':_[_0xe6d9('0x76')](_0x3fcc1c[_0xe6d9('0x11e')])?undefined:_0x3fcc1c[_0xe6d9('0x11e')],'count':_0x379959[_0xe6d9('0x3b')],'rows':_0x379959});}})[_0xe6d9('0x48')](handleError(_0x5927bc,null));};exports[_0xe6d9('0x11f')]=function(_0x199ee3,_0x21bf74){var _0x2ce0c9={'raw':![],'where':{}};var _0x3626dc={};var _0x4fa95b={'count':0x0,'rows':[]};return db[_0xe6d9('0x30')][_0xe6d9('0x5e')]({'where':{'id':_0x199ee3[_0xe6d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x21bf74,null))['then'](function(_0x188857){if(_0x188857){_0x3626dc[_0xe6d9('0x34')]=_[_0xe6d9('0x36')](db[_0xe6d9('0xc8')][_0xe6d9('0x46')]);_0x3626dc[_0xe6d9('0x35')]=_['keys'](_0x199ee3[_0xe6d9('0x35')]);_0x3626dc[_0xe6d9('0x37')]=_['intersection'](_0x3626dc[_0xe6d9('0x34')],_0x3626dc['query']);_0x2ce0c9[_0xe6d9('0x39')]=_[_0xe6d9('0x38')](_0x3626dc[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x199ee3['query'][_0xe6d9('0x3a')]));_0x2ce0c9[_0xe6d9('0x39')]=_0x2ce0c9['attributes']['length']?_0x2ce0c9[_0xe6d9('0x39')]:_0x3626dc['model'];if(!_0x199ee3['query'][_0xe6d9('0x56')](_0xe6d9('0x3c'))){_0x2ce0c9[_0xe6d9('0x3d')]=qs['limit'](_0x199ee3[_0xe6d9('0x35')]['limit']);_0x2ce0c9['offset']=qs[_0xe6d9('0x20')](_0x199ee3[_0xe6d9('0x35')]['offset']);}_0x2ce0c9['order']=qs['sort'](_0x199ee3['query'][_0xe6d9('0x3f')]);_0x2ce0c9[_0xe6d9('0x41')]=qs[_0xe6d9('0x37')](_['pick'](_0x199ee3[_0xe6d9('0x35')],_0x3626dc[_0xe6d9('0x37')]));_0x2ce0c9[_0xe6d9('0x41')]['ChatWebsiteId']=_0x188857['id'];if(_0x199ee3[_0xe6d9('0x35')][_0xe6d9('0x40')]){_0x2ce0c9[_0xe6d9('0x41')]=_[_0xe6d9('0x42')](_0x2ce0c9[_0xe6d9('0x41')],{'$or':_[_0xe6d9('0x2f')](_0x2ce0c9['attributes'],function(_0x421f80){var _0x485a27={};_0x485a27[_0x421f80]={'$like':'%'+_0x199ee3[_0xe6d9('0x35')][_0xe6d9('0x40')]+'%'};return _0x485a27;})});}_0x2ce0c9=_['merge']({},_0x2ce0c9,_0x199ee3[_0xe6d9('0x5f')]);return db[_0xe6d9('0xc8')]['count']({'where':_0x2ce0c9[_0xe6d9('0x41')]})[_0xe6d9('0x13')](function(_0x5d66f2){_0x4fa95b[_0xe6d9('0x22')]=_0x5d66f2;if(_0x199ee3[_0xe6d9('0x35')][_0xe6d9('0x43')]){_0x2ce0c9['include']=[{'all':!![]}];}else{_0x2ce0c9[_0xe6d9('0x44')]=[{'model':db[_0xe6d9('0x82')],'as':'Contact','required':![]},{'model':db[_0xe6d9('0xd0')],'as':_0xe6d9('0x120'),'required':![]}];}return db[_0xe6d9('0xc8')][_0xe6d9('0x58')](_0x2ce0c9);})[_0xe6d9('0x13')](function(_0x1bda9f){_0x4fa95b['rows']=_0x1bda9f;return _0x4fa95b;});}})['then'](respondWithFilteredResult(_0x21bf74,_0x2ce0c9))[_0xe6d9('0x48')](handleError(_0x21bf74,null));};exports['addAgents']=function(_0x4d08df,_0x1232a0){return db[_0xe6d9('0x30')]['find']({'where':{'id':_0x4d08df[_0xe6d9('0x50')]['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x1232a0,null))[_0xe6d9('0x13')](function(_0x4d8819){if(_0x4d8819){return _0x4d8819[_0xe6d9('0x121')](_0x4d08df[_0xe6d9('0x4f')]['ids'],_[_0xe6d9('0xe6')](_0x4d08df[_0xe6d9('0x4f')],[_0xe6d9('0x5b'),'id'])||{})[_0xe6d9('0xc2')](function(_0x528e7b){for(var _0x9d7400=0x0;_0x9d7400<_0x4d08df['body'][_0xe6d9('0x5b')][_0xe6d9('0x3b')];_0x9d7400+=0x1){socket[_0xe6d9('0x122')]('userChatWebsite:save',{'UserId':Number(_0x4d08df[_0xe6d9('0x4f')]['ids'][_0x9d7400]),'ChatWebsiteId':Number(_0x4d08df[_0xe6d9('0x50')]['id'])});}return _0x528e7b;});}})[_0xe6d9('0x13')](respondWithResult(_0x1232a0,null))[_0xe6d9('0x48')](handleError(_0x1232a0,null));};exports[_0xe6d9('0x123')]=function(_0x4c08ac,_0x3925fb){return db[_0xe6d9('0x30')][_0xe6d9('0x47')]({'where':{'id':_0x4c08ac[_0xe6d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x3925fb,null))[_0xe6d9('0x13')](function(_0x54c037){if(_0x54c037){return _0x54c037['removeAgents'](_0x4c08ac['query']['ids'])[_0xe6d9('0x13')](function(){if(_[_0xe6d9('0x124')](_0x4c08ac[_0xe6d9('0x35')][_0xe6d9('0x5b')])){for(var _0x3f7201=0x0;_0x3f7201<_0x4c08ac[_0xe6d9('0x35')][_0xe6d9('0x5b')]['length'];_0x3f7201+=0x1){socket['emit'](_0xe6d9('0x125'),{'UserId':Number(_0x4c08ac[_0xe6d9('0x35')][_0xe6d9('0x5b')][_0x3f7201]),'ChatWebsiteId':Number(_0x4c08ac[_0xe6d9('0x50')]['id'])});}}else{socket[_0xe6d9('0x122')](_0xe6d9('0x125'),{'UserId':Number(_0x4c08ac[_0xe6d9('0x35')]['ids']),'ChatWebsiteId':Number(_0x4c08ac[_0xe6d9('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x3925fb,null))[_0xe6d9('0x48')](handleError(_0x3925fb,null));};exports[_0xe6d9('0x126')]=function(_0x46778c,_0x274ec5){var _0x20bcd8={};var _0x305dae={};var _0x484349;var _0x1663ed;return db[_0xe6d9('0x30')]['findOne']({'where':{'id':_0x46778c['params']['id']}})[_0xe6d9('0x13')](handleEntityNotFound(_0x274ec5,null))[_0xe6d9('0x13')](function(_0x42f81c){if(_0x42f81c){_0x484349=_0x42f81c;_0x305dae[_0xe6d9('0x34')]=_[_0xe6d9('0x36')](db['User'][_0xe6d9('0x46')]);_0x305dae[_0xe6d9('0x35')]=_[_0xe6d9('0x36')](_0x46778c['query']);_0x305dae[_0xe6d9('0x37')]=_['intersection'](_0x305dae[_0xe6d9('0x34')],_0x305dae[_0xe6d9('0x35')]);_0x20bcd8[_0xe6d9('0x39')]=_[_0xe6d9('0x38')](_0x305dae[_0xe6d9('0x34')],qs[_0xe6d9('0x3a')](_0x46778c[_0xe6d9('0x35')][_0xe6d9('0x3a')]));_0x20bcd8['attributes']=_0x20bcd8[_0xe6d9('0x39')]['length']?_0x20bcd8[_0xe6d9('0x39')]:_0x305dae[_0xe6d9('0x34')];_0x20bcd8[_0xe6d9('0x3e')]=qs[_0xe6d9('0x3f')](_0x46778c[_0xe6d9('0x35')][_0xe6d9('0x3f')]);_0x20bcd8[_0xe6d9('0x41')]=qs[_0xe6d9('0x37')](_[_0xe6d9('0x57')](_0x46778c[_0xe6d9('0x35')],_0x305dae[_0xe6d9('0x37')]));if(_0x46778c[_0xe6d9('0x35')][_0xe6d9('0x40')]){_0x20bcd8['where']=_['merge'](_0x20bcd8[_0xe6d9('0x41')],{'$or':_['map'](_0x20bcd8['attributes'],function(_0x5b0008){var _0x599917={};_0x599917[_0x5b0008]={'$like':'%'+_0x46778c[_0xe6d9('0x35')]['filter']+'%'};return _0x599917;})});}_0x20bcd8=_[_0xe6d9('0x42')]({},_0x20bcd8,_0x46778c[_0xe6d9('0x5f')]);return _0x484349['getAgents'](_0x20bcd8);}})[_0xe6d9('0x13')](function(_0x595da2){if(_0x595da2){_0x1663ed=_0x595da2[_0xe6d9('0x3b')];if(!_0x46778c[_0xe6d9('0x35')][_0xe6d9('0x56')]('nolimit')){_0x20bcd8[_0xe6d9('0x3d')]=qs[_0xe6d9('0x3d')](_0x46778c[_0xe6d9('0x35')][_0xe6d9('0x3d')]);_0x20bcd8[_0xe6d9('0x20')]=qs[_0xe6d9('0x20')](_0x46778c['query'][_0xe6d9('0x20')]);}return _0x484349['getAgents'](_0x20bcd8);}})['then'](function(_0x3bc756){if(_0x3bc756){return _0x3bc756?{'count':_0x1663ed,'rows':_0x3bc756}:null;}})[_0xe6d9('0x13')](respondWithResult(_0x274ec5,null))[_0xe6d9('0x48')](handleError(_0x274ec5,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a566238..5f2f84c 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 _0xeb79=['ChatWebsite','save','remove','emit','hook'];(function(_0x57f100,_0xa53aca){var _0x4cac01=function(_0x447061){while(--_0x447061){_0x57f100['push'](_0x57f100['shift']());}};_0x4cac01(++_0xa53aca);}(_0xeb79,0x87));var _0x9eb7=function(_0x1f7070,_0x2c97fc){_0x1f7070=_0x1f7070-0x0;var _0x2d063b=_0xeb79[_0x1f7070];return _0x2d063b;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x9eb7('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9eb7('0x1'),'afterUpdate':'update','afterDestroy':_0x9eb7('0x2')};function emitEvent(_0x47e1e5){return function(_0x3ee5c6,_0x2987e1,_0x385233){ChatWebsiteEvents[_0x9eb7('0x3')](_0x47e1e5+':'+_0x3ee5c6['id'],_0x3ee5c6);ChatWebsiteEvents['emit'](_0x47e1e5,_0x3ee5c6);_0x385233(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x9eb7('0x4')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xeec6=['events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x47f719,_0x2e559d){var _0x407f4e=function(_0x2be03a){while(--_0x2be03a){_0x47f719['push'](_0x47f719['shift']());}};_0x407f4e(++_0x2e559d);}(_0xeec6,0x1c2));var _0x6eec=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0xeec6[_0x25b4a4];return _0x707267;};'use strict';var EventEmitter=require(_0x6eec('0x0'));var ChatWebsite=require(_0x6eec('0x1'))['db'][_0x6eec('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6eec('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6eec('0x4'),'afterDestroy':_0x6eec('0x5')};function emitEvent(_0x1699ce){return function(_0x2d7a15,_0x3e7b6b,_0x2e450c){ChatWebsiteEvents['emit'](_0x1699ce+':'+_0x2d7a15['id'],_0x2d7a15);ChatWebsiteEvents[_0x6eec('0x6')](_0x1699ce,_0x2d7a15);_0x2e450c(null);};}for(var e in events){if(events[_0x6eec('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x6eec('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 8932a4a..210fccc 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 _0x2f0c=['rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2f0c,0xad));var _0xc2f0=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x2f0c[_0x65c50e];return _0x4573e7;};'use strict';var _=require(_0xc2f0('0x0'));var util=require(_0xc2f0('0x1'));var logger=require(_0xc2f0('0x2'))(_0xc2f0('0x3'));var moment=require(_0xc2f0('0x4'));var BPromise=require(_0xc2f0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2f0('0x6'));var rimraf=require(_0xc2f0('0x7'));var config=require('../../config/environment');var attributes=require(_0xc2f0('0x8'));module[_0xc2f0('0x9')]=function(_0x16d091,_0x2fa7f8){return _0x16d091[_0xc2f0('0xa')]('ChatWebsite',attributes,{'tableName':_0xc2f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x245b=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4d0d1f,_0x53c5fb){var _0x6845eb=function(_0xa59e1d){while(--_0xa59e1d){_0x4d0d1f['push'](_0x4d0d1f['shift']());}};_0x6845eb(++_0x53c5fb);}(_0x245b,0x119));var _0xb245=function(_0x54b8c4,_0x44c72f){_0x54b8c4=_0x54b8c4-0x0;var _0x50bd7f=_0x245b[_0x54b8c4];return _0x50bd7f;};'use strict';var _=require('lodash');var util=require(_0xb245('0x0'));var logger=require(_0xb245('0x1'))('api');var moment=require(_0xb245('0x2'));var BPromise=require(_0xb245('0x3'));var rp=require(_0xb245('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb245('0x5'));var attributes=require(_0xb245('0x6'));module[_0xb245('0x7')]=function(_0x369b45,_0x43f04f){return _0x369b45[_0xb245('0x8')](_0xb245('0x9'),attributes,{'tableName':_0xb245('0xa'),'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 f17f0c8..a327de5 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 _0x7b4d=['then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatWebsite.socket','request'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7b4d,0x73));var _0xd7b4=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x7b4d[_0x4a29a9];return _0x386570;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd7b4('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd7b4('0x1'));var logger=require(_0xd7b4('0x2'))(_0xd7b4('0x3'));var config=require('../../config/environment');var jayson=require(_0xd7b4('0x4'));var client=jayson[_0xd7b4('0x5')]['http']({'port':0x232a});config[_0xd7b4('0x6')]=_['defaults'](config['redis'],{'host':_0xd7b4('0x7'),'port':0x18eb});var socket=require(_0xd7b4('0x8'))(new Redis(config[_0xd7b4('0x6')]));require(_0xd7b4('0x9'))['register'](socket);function respondWithRpcPromise(_0x44fba0,_0x569308,_0xe391c3){return new BPromise(function(_0x385d8c,_0x51264c){return client[_0xd7b4('0xa')](_0x44fba0,_0xe391c3)[_0xd7b4('0xb')](function(_0x311265){logger[_0xd7b4('0xc')](_0xd7b4('0xd'),_0x569308,_0xd7b4('0xe'));logger['debug'](_0xd7b4('0xf'),_0x569308,_0xd7b4('0xe'),JSON[_0xd7b4('0x10')](_0x311265));if(_0x311265[_0xd7b4('0x11')]){if(_0x311265[_0xd7b4('0x11')][_0xd7b4('0x12')]===0x1f4){logger[_0xd7b4('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x569308,_0x311265[_0xd7b4('0x11')]['message']);return _0x51264c(_0x311265[_0xd7b4('0x11')][_0xd7b4('0x13')]);}logger['error'](_0xd7b4('0xd'),_0x569308,_0x311265[_0xd7b4('0x11')][_0xd7b4('0x13')]);return _0x385d8c(_0x311265[_0xd7b4('0x11')][_0xd7b4('0x13')]);}else{logger[_0xd7b4('0xc')](_0xd7b4('0xd'),_0x569308,_0xd7b4('0xe'));_0x385d8c(_0x311265['result']['message']);}})[_0xd7b4('0x14')](function(_0x139429){logger['error'](_0xd7b4('0xd'),_0x569308,_0x139429);_0x51264c(_0x139429);});});}
\ No newline at end of file
+var _0x0663=['bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0663,0xcf));var _0x3066=function(_0x51620a,_0x53c8c7){_0x51620a=_0x51620a-0x0;var _0x539150=_0x0663[_0x51620a];return _0x539150;};'use strict';var _=require(_0x3066('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3066('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3066('0x2'))['db'];var utils=require(_0x3066('0x3'));var logger=require(_0x3066('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3066('0x5'));var client=jayson[_0x3066('0x6')][_0x3066('0x7')]({'port':0x232a});config[_0x3066('0x8')]=_[_0x3066('0x9')](config[_0x3066('0x8')],{'host':_0x3066('0xa'),'port':0x18eb});var socket=require(_0x3066('0xb'))(new Redis(config[_0x3066('0x8')]));require(_0x3066('0xc'))[_0x3066('0xd')](socket);function respondWithRpcPromise(_0xff742d,_0x5b11ac,_0x1602cf){return new BPromise(function(_0x13e453,_0x2b508c){return client[_0x3066('0xe')](_0xff742d,_0x1602cf)['then'](function(_0x26c495){logger['info'](_0x3066('0xf'),_0x5b11ac,_0x3066('0x10'));logger[_0x3066('0x11')](_0x3066('0x12'),_0x5b11ac,'request\x20sent',JSON[_0x3066('0x13')](_0x26c495));if(_0x26c495[_0x3066('0x14')]){if(_0x26c495['error'][_0x3066('0x15')]===0x1f4){logger['error'](_0x3066('0xf'),_0x5b11ac,_0x26c495[_0x3066('0x14')][_0x3066('0x16')]);return _0x2b508c(_0x26c495[_0x3066('0x14')][_0x3066('0x16')]);}logger[_0x3066('0x14')](_0x3066('0xf'),_0x5b11ac,_0x26c495[_0x3066('0x14')]['message']);return _0x13e453(_0x26c495[_0x3066('0x14')][_0x3066('0x16')]);}else{logger[_0x3066('0x17')](_0x3066('0xf'),_0x5b11ac,'request\x20sent');_0x13e453(_0x26c495[_0x3066('0x18')][_0x3066('0x16')]);}})[_0x3066('0x19')](function(_0x5d14dc){logger[_0x3066('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x5b11ac,_0x5d14dc);_0x2b508c(_0x5d14dc);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index eb14125..00c18b0 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 _0xa84c=['remove','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa84c,0x1d3));var _0xca84=function(_0x44dc4c,_0x357e6a){_0x44dc4c=_0x44dc4c-0x0;var _0x4e644e=_0xa84c[_0x44dc4c];return _0x4e644e;};'use strict';var ChatWebsiteEvents=require(_0xca84('0x0'));var events=['save',_0xca84('0x1'),'update'];function createListener(_0x55e597,_0xd95225){return function(_0x4415a8){_0xd95225['emit'](_0x55e597,_0x4415a8);};}function removeListener(_0x433179,_0xa9a87b){return function(){ChatWebsiteEvents[_0xca84('0x2')](_0x433179,_0xa9a87b);};}exports[_0xca84('0x3')]=function(_0x51c719){for(var _0x5b4295=0x0,_0x53b9ae=events[_0xca84('0x4')];_0x5b4295<_0x53b9ae;_0x5b4295++){var _0x1e8a12=events[_0x5b4295];var _0x3669ca=createListener(_0xca84('0x5')+_0x1e8a12,_0x51c719);ChatWebsiteEvents['on'](_0x1e8a12,_0x3669ca);}};
\ No newline at end of file
+var _0x85dc=['register','length','chatWebsite:','./chatWebsite.events','save','update','removeListener'];(function(_0x20f391,_0xed985b){var _0x3cdbc5=function(_0x4c16b8){while(--_0x4c16b8){_0x20f391['push'](_0x20f391['shift']());}};_0x3cdbc5(++_0xed985b);}(_0x85dc,0x65));var _0xc85d=function(_0x188598,_0x512231){_0x188598=_0x188598-0x0;var _0x1f486d=_0x85dc[_0x188598];return _0x1f486d;};'use strict';var ChatWebsiteEvents=require(_0xc85d('0x0'));var events=[_0xc85d('0x1'),'remove',_0xc85d('0x2')];function createListener(_0x4644af,_0x333a52){return function(_0x1c0d49){_0x333a52['emit'](_0x4644af,_0x1c0d49);};}function removeListener(_0x1d3da8,_0x3d27ae){return function(){ChatWebsiteEvents[_0xc85d('0x3')](_0x1d3da8,_0x3d27ae);};}exports[_0xc85d('0x4')]=function(_0x349c2e){for(var _0x5b8a9e=0x0,_0x498a89=events[_0xc85d('0x5')];_0x5b8a9e<_0x498a89;_0x5b8a9e++){var _0x282d89=events[_0x5b8a9e];var _0x12e976=createListener(_0xc85d('0x6')+_0x282d89,_0x349c2e);ChatWebsiteEvents['on'](_0x282d89,_0x12e976);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 99975e5..6eb675c 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 _0x8a1f=['now','originalname','addLogo','/:id/avatar','file','addAvatar','single','addCustomerAvatar','server/files/images/avatars/','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8a1f,0x196));var _0xf8a1=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0x8a1f[_0x16e57d];return _0x40239c;};'use strict';var multer=require('multer');var util=require(_0xf8a1('0x0'));var path=require('path');var timeout=require(_0xf8a1('0x1'));var express=require('express');var router=express[_0xf8a1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf8a1('0x3'));var interaction=require(_0xf8a1('0x4'));var config=require(_0xf8a1('0x5'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0xf8a1('0x6')](),controller['index']);router[_0xf8a1('0x7')](_0xf8a1('0x8'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x9')]);router[_0xf8a1('0x7')](_0xf8a1('0xa'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0xb')]);router[_0xf8a1('0x7')](_0xf8a1('0xc'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0xd')]);router[_0xf8a1('0x7')](_0xf8a1('0xe'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0xf')]);router[_0xf8a1('0x7')](_0xf8a1('0x10'),controller[_0xf8a1('0x11')]);router['get']('/:id/avatar',controller[_0xf8a1('0x12')]);router[_0xf8a1('0x7')](_0xf8a1('0x13'),controller['getCustomerAvatar']);router[_0xf8a1('0x7')]('/:id/system_avatar',controller[_0xf8a1('0x14')]);router['get'](_0xf8a1('0x15'),auth['isAuthenticated'](),controller[_0xf8a1('0x16')]);router[_0xf8a1('0x7')](_0xf8a1('0x17'),controller[_0xf8a1('0x18')]);router[_0xf8a1('0x7')](_0xf8a1('0x19'),auth['isAuthenticated'](),controller[_0xf8a1('0x1a')]);router['get'](_0xf8a1('0x1b'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x1c')]);router[_0xf8a1('0x7')](_0xf8a1('0x1d'),controller[_0xf8a1('0x1e')]);router[_0xf8a1('0x7')](_0xf8a1('0x1f'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x20')]);router[_0xf8a1('0x7')](_0xf8a1('0x21'),auth[_0xf8a1('0x6')](),controller['getAgents']);router['post']('/',auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x22')]);router[_0xf8a1('0x23')](_0xf8a1('0xc'),auth['isAuthenticated'](),controller[_0xf8a1('0x24')]);router[_0xf8a1('0x23')](_0xf8a1('0xe'),auth['isAuthenticated'](),controller[_0xf8a1('0x25')]);var upload=multer({'storage':multer[_0xf8a1('0x26')]({'destination':function(_0x538009,_0x1ca470,_0x472884){_0x472884(null,path[_0xf8a1('0x27')](config[_0xf8a1('0x28')],_0xf8a1('0x29')));},'filename':function(_0x5d2c1a,_0x3b8f00,_0x3ebbe8){_0x3ebbe8(null,util[_0xf8a1('0x2a')](_0xf8a1('0x2b'),Date[_0xf8a1('0x2c')](),_0x3b8f00[_0xf8a1('0x2d')]));}})});router[_0xf8a1('0x23')](_0xf8a1('0x10'),upload['single']('file'),controller[_0xf8a1('0x2e')]);var upload=multer({'storage':multer[_0xf8a1('0x26')]({'destination':function(_0x3db96a,_0x33b5c8,_0x35ca21){_0x35ca21(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x5ea9a2,_0x5dfbc4,_0x25e4f8){_0x25e4f8(null,util['format']('%s-%s',Date[_0xf8a1('0x2c')](),_0x5dfbc4[_0xf8a1('0x2d')]));}})});router[_0xf8a1('0x23')](_0xf8a1('0x2f'),upload['single'](_0xf8a1('0x30')),controller[_0xf8a1('0x31')]);var upload=multer({'storage':multer[_0xf8a1('0x26')]({'destination':function(_0x36d2da,_0x5d7643,_0x431065){_0x431065(null,path[_0xf8a1('0x27')](config[_0xf8a1('0x28')],'server/files/images/avatars/'));},'filename':function(_0x29ae83,_0x4c636a,_0x2c6d56){_0x2c6d56(null,util[_0xf8a1('0x2a')](_0xf8a1('0x2b'),Date[_0xf8a1('0x2c')](),_0x4c636a['originalname']));}})});router[_0xf8a1('0x23')](_0xf8a1('0x13'),upload[_0xf8a1('0x32')](_0xf8a1('0x30')),controller[_0xf8a1('0x33')]);var upload=multer({'storage':multer[_0xf8a1('0x26')]({'destination':function(_0x5591a9,_0x15289e,_0x2bbbba){_0x2bbbba(null,path[_0xf8a1('0x27')](config[_0xf8a1('0x28')],_0xf8a1('0x34')));},'filename':function(_0x213ffe,_0xe3af9,_0x336a44){_0x336a44(null,util[_0xf8a1('0x2a')](_0xf8a1('0x2b'),Date['now'](),_0xe3af9['originalname']));}})});router[_0xf8a1('0x23')](_0xf8a1('0x35'),upload[_0xf8a1('0x32')](_0xf8a1('0x30')),controller[_0xf8a1('0x36')]);router[_0xf8a1('0x23')](_0xf8a1('0x37'),controller[_0xf8a1('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0xf8a1('0x26')]({'destination':function(_0x4b5cad,_0x716262,_0x194f8b){const _0x1f7947=path['join'](config[_0xf8a1('0x28')],_0xf8a1('0x39'),'attachments',_0xf8a1('0x3a'));fs_extra[_0xf8a1('0x3b')](_0x1f7947,function(){_0x194f8b(null,_0x1f7947);});},'filename':function(_0x45da27,_0x1e6959,_0x1335c4){const _0x5c7d32=_0x1e6959[_0xf8a1('0x2d')][_0xf8a1('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1e52ee=path[_0xf8a1('0x3d')](_0x5c7d32);const _0x2ee43c=Date[_0xf8a1('0x2c')]()+'-'+_0x5c7d32[_0xf8a1('0x3c')](_0x1e52ee,'')+_0x1e52ee;_0x1335c4(null,_0x2ee43c);}})});router[_0xf8a1('0x23')](_0xf8a1('0x3e'),offlineUploadMulter[_0xf8a1('0x3f')](),controller[_0xf8a1('0x40')]);router[_0xf8a1('0x23')]('/:id/interactions',auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x41')]);router[_0xf8a1('0x23')](_0xf8a1('0x19'),auth[_0xf8a1('0x6')](),controller['addApplications']);router[_0xf8a1('0x23')](_0xf8a1('0x1b'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x42')]);router[_0xf8a1('0x23')]('/:id/users',auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x43')]);router[_0xf8a1('0x44')](_0xf8a1('0xa'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x45')]);router[_0xf8a1('0x46')](_0xf8a1('0xa'),auth['isAuthenticated'](),controller[_0xf8a1('0x47')]);router[_0xf8a1('0x46')](_0xf8a1('0xc'),auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x48')]);router[_0xf8a1('0x46')](_0xf8a1('0xe'),auth[_0xf8a1('0x6')](),controller['removeAnswers']);router[_0xf8a1('0x46')]('/:id/users',auth[_0xf8a1('0x6')](),controller[_0xf8a1('0x49')]);module[_0xf8a1('0x4a')]=router;
\ No newline at end of file
+var _0xdf99=['getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','%s-%s','now','originalname','single','file','join','root','server/files/images/avatars/','/:id/avatar','addSystemAvatar','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addInteraction','/:id/applications','addApplications','/:id/users','addAgents','put','update','/:id','destroy','removeDispositions','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet'];(function(_0x1d77a1,_0x29dbe4){var _0x1b6fa4=function(_0x41ea43){while(--_0x41ea43){_0x1d77a1['push'](_0x1d77a1['shift']());}};_0x1b6fa4(++_0x29dbe4);}(_0xdf99,0x136));var _0x9df9=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0xdf99[_0x32f26d];return _0x5d9ddc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9df9('0x0'));var timeout=require(_0x9df9('0x1'));var express=require(_0x9df9('0x2'));var router=express[_0x9df9('0x3')]();var fs_extra=require(_0x9df9('0x4'));var auth=require(_0x9df9('0x5'));var interaction=require(_0x9df9('0x6'));var config=require(_0x9df9('0x7'));var controller=require(_0x9df9('0x8'));router[_0x9df9('0x9')]('/',auth[_0x9df9('0xa')](),controller['index']);router['get'](_0x9df9('0xb'),auth[_0x9df9('0xa')](),controller[_0x9df9('0xc')]);router[_0x9df9('0x9')]('/:id',auth[_0x9df9('0xa')](),controller[_0x9df9('0xd')]);router[_0x9df9('0x9')]('/:id/dispositions',auth[_0x9df9('0xa')](),controller[_0x9df9('0xe')]);router[_0x9df9('0x9')](_0x9df9('0xf'),auth['isAuthenticated'](),controller[_0x9df9('0x10')]);router['get'](_0x9df9('0x11'),controller[_0x9df9('0x12')]);router[_0x9df9('0x9')]('/:id/avatar',controller['getAvatar']);router[_0x9df9('0x9')](_0x9df9('0x13'),controller[_0x9df9('0x14')]);router[_0x9df9('0x9')](_0x9df9('0x15'),controller['getSystemAvatar']);router[_0x9df9('0x9')](_0x9df9('0x16'),auth[_0x9df9('0xa')](),controller[_0x9df9('0x17')]);router[_0x9df9('0x9')](_0x9df9('0x18'),controller['getSnippet']);router[_0x9df9('0x9')]('/:id/applications',auth[_0x9df9('0xa')](),controller[_0x9df9('0x19')]);router['get'](_0x9df9('0x1a'),auth[_0x9df9('0xa')](),controller[_0x9df9('0x1b')]);router[_0x9df9('0x9')](_0x9df9('0x1c'),controller[_0x9df9('0x1d')]);router['get'](_0x9df9('0x1e'),auth[_0x9df9('0xa')](),controller['getOfflineMessages']);router[_0x9df9('0x9')]('/:id/users',auth[_0x9df9('0xa')](),controller['getAgents']);router[_0x9df9('0x1f')]('/',auth[_0x9df9('0xa')](),controller['create']);router['post'](_0x9df9('0x20'),auth['isAuthenticated'](),controller[_0x9df9('0x21')]);router[_0x9df9('0x1f')](_0x9df9('0xf'),auth[_0x9df9('0xa')](),controller[_0x9df9('0x22')]);var upload=multer({'storage':multer[_0x9df9('0x23')]({'destination':function(_0x37201c,_0x5f2ad0,_0x3147d1){_0x3147d1(null,path['join'](config['root'],_0x9df9('0x24')));},'filename':function(_0x5b3903,_0x257c48,_0x3ce933){_0x3ce933(null,util[_0x9df9('0x25')](_0x9df9('0x26'),Date[_0x9df9('0x27')](),_0x257c48[_0x9df9('0x28')]));}})});router['post']('/:id/logo',upload[_0x9df9('0x29')](_0x9df9('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0x9df9('0x23')]({'destination':function(_0x24fa9e,_0x21fcc9,_0x2466ad){_0x2466ad(null,path[_0x9df9('0x2b')](config[_0x9df9('0x2c')],_0x9df9('0x2d')));},'filename':function(_0x270e5c,_0x2243a4,_0x5ec081){_0x5ec081(null,util['format']('%s-%s',Date[_0x9df9('0x27')](),_0x2243a4[_0x9df9('0x28')]));}})});router[_0x9df9('0x1f')](_0x9df9('0x2e'),upload[_0x9df9('0x29')](_0x9df9('0x2a')),controller['addAvatar']);var upload=multer({'storage':multer[_0x9df9('0x23')]({'destination':function(_0x3d7660,_0xb961fd,_0x5d07de){_0x5d07de(null,path[_0x9df9('0x2b')](config[_0x9df9('0x2c')],_0x9df9('0x2d')));},'filename':function(_0x394117,_0x532e96,_0x29557a){_0x29557a(null,util[_0x9df9('0x25')](_0x9df9('0x26'),Date['now'](),_0x532e96[_0x9df9('0x28')]));}})});router['post'](_0x9df9('0x13'),upload['single'](_0x9df9('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x9df9('0x23')]({'destination':function(_0x2df8b7,_0xb62ea1,_0x1b628c){_0x1b628c(null,path[_0x9df9('0x2b')](config[_0x9df9('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x56c5e4,_0x38c91c,_0x193c36){_0x193c36(null,util[_0x9df9('0x25')](_0x9df9('0x26'),Date[_0x9df9('0x27')](),_0x38c91c[_0x9df9('0x28')]));}})});router[_0x9df9('0x1f')]('/:id/system_avatar',upload[_0x9df9('0x29')]('file'),controller[_0x9df9('0x2f')]);router[_0x9df9('0x1f')]('/:id/notify',controller[_0x9df9('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x9df9('0x23')]({'destination':function(_0x416c46,_0x2c066,_0x4f23ab){const _0x245bb3=path['join'](config[_0x9df9('0x2c')],'server/files',_0x9df9('0x31'),_0x9df9('0x32'));fs_extra[_0x9df9('0x33')](_0x245bb3,function(){_0x4f23ab(null,_0x245bb3);});},'filename':function(_0x508542,_0x3687f7,_0x330c75){const _0xd70db1=_0x3687f7['originalname'][_0x9df9('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x43f99a=path[_0x9df9('0x35')](_0xd70db1);const _0xbc0536=Date['now']()+'-'+_0xd70db1[_0x9df9('0x34')](_0x43f99a,'')+_0x43f99a;_0x330c75(null,_0xbc0536);}})});router[_0x9df9('0x1f')](_0x9df9('0x36'),offlineUploadMulter['any'](),controller['offline']);router[_0x9df9('0x1f')](_0x9df9('0x16'),auth[_0x9df9('0xa')](),controller[_0x9df9('0x37')]);router[_0x9df9('0x1f')](_0x9df9('0x38'),auth[_0x9df9('0xa')](),controller[_0x9df9('0x39')]);router['post'](_0x9df9('0x1a'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post'](_0x9df9('0x3a'),auth[_0x9df9('0xa')](),controller[_0x9df9('0x3b')]);router[_0x9df9('0x3c')]('/:id',auth['isAuthenticated'](),controller[_0x9df9('0x3d')]);router['delete'](_0x9df9('0x3e'),auth[_0x9df9('0xa')](),controller[_0x9df9('0x3f')]);router['delete'](_0x9df9('0x20'),auth[_0x9df9('0xa')](),controller[_0x9df9('0x40')]);router[_0x9df9('0x41')](_0x9df9('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x9df9('0x41')](_0x9df9('0x3a'),auth[_0x9df9('0xa')](),controller['removeAgents']);module[_0x9df9('0x42')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 0d4d9bf..51fd0de 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 _0xedd9=['../config/environment','Router','env','production','app','Client-Side\x20logger\x20not\x20found!','use','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x575dd5,_0x5f24fe){var _0x338962=function(_0x1b7f77){while(--_0x1b7f77){_0x575dd5['push'](_0x575dd5['shift']());}};_0x338962(++_0x5f24fe);}(_0xedd9,0xa2));var _0x9edd=function(_0x1bf951,_0x3f59aa){_0x1bf951=_0x1bf951-0x0;var _0x210585=_0xedd9[_0x1bf951];return _0x210585;};var beaverLogger=require(_0x9edd('0x0'));var express=require(_0x9edd('0x1'));var auth=require(_0x9edd('0x2'));var config=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var isProduction=config[_0x9edd('0x5')]===_0x9edd('0x6')||![];function clientSideLogs(_0x2924ad,_0x20fbcc,_0x50a1d9){var _0x22a52a=_0x2924ad[_0x9edd('0x7')]['get']('client-side-logger');if(!_0x22a52a){throw new Error(_0x9edd('0x8'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x22a52a,'enableCors':!isProduction})(_0x2924ad,_0x20fbcc,_0x50a1d9);}router[_0x9edd('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0x9edd('0xa')]=router;
\ No newline at end of file
+var _0x39c5=['exports','beaver-logger/server','express','../components/auth/service','env','production','app','get','client-side-logger','expressEndpoint','/client-logs','use'];(function(_0x180b14,_0x1bddba){var _0x221f13=function(_0x17742c){while(--_0x17742c){_0x180b14['push'](_0x180b14['shift']());}};_0x221f13(++_0x1bddba);}(_0x39c5,0x1ed));var _0x539c=function(_0x30e092,_0x4c1763){_0x30e092=_0x30e092-0x0;var _0xdd544f=_0x39c5[_0x30e092];return _0xdd544f;};var beaverLogger=require(_0x539c('0x0'));var express=require(_0x539c('0x1'));var auth=require(_0x539c('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x539c('0x3')]===_0x539c('0x4')||![];function clientSideLogs(_0x370c42,_0x4ebfc8,_0x1fbc77){var _0x42c70a=_0x370c42[_0x539c('0x5')][_0x539c('0x6')](_0x539c('0x7'));if(!_0x42c70a){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x539c('0x8')]({'uri':_0x539c('0x9'),'logger':_0x42c70a,'enableCors':!isProduction})(_0x370c42,_0x4ebfc8,_0x1fbc77);}router[_0x539c('0xa')](auth['isAuthenticated'](),clientSideLogs);module[_0x539c('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 05dba74..cb40dba 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 _0x0ee1=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x2fcd6e,_0x365baf){var _0x1277fe=function(_0x33c15f){while(--_0x33c15f){_0x2fcd6e['push'](_0x2fcd6e['shift']());}};_0x1277fe(++_0x365baf);}(_0x0ee1,0x161));var _0x10ee=function(_0x7148a3,_0x1c6652){_0x7148a3=_0x7148a3-0x0;var _0x52f31d=_0x0ee1[_0x7148a3];return _0x52f31d;};'use strict';var Sequelize=require(_0x10ee('0x0'));module['exports']={'name':{'type':Sequelize[_0x10ee('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x10ee('0x2')](_0x10ee('0x3'),_0x10ee('0x4'),_0x10ee('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x10ee('0x2')](_0x10ee('0x6'),_0x10ee('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x10ee('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x10ee('0x9')},'data3':{'type':Sequelize[_0x10ee('0x1')],'comment':_0x10ee('0xa')},'data4':{'type':Sequelize[_0x10ee('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x10ee('0xb')],'comment':_0x10ee('0xc')},'data6':{'type':Sequelize[_0x10ee('0xb')],'comment':_0x10ee('0xd')},'data7':{'type':Sequelize[_0x10ee('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0xa849=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','AmazonAWS','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0xc17737,_0x9e6a4b){var _0x3c8d6f=function(_0x18a7e4){while(--_0x18a7e4){_0xc17737['push'](_0xc17737['shift']());}};_0x3c8d6f(++_0x9e6a4b);}(_0xa849,0x180));var _0x9a84=function(_0x11fe62,_0x462b8e){_0x11fe62=_0x11fe62-0x0;var _0x2cd6ed=_0xa849[_0x11fe62];return _0x2cd6ed;};'use strict';var Sequelize=require('sequelize');module[_0x9a84('0x0')]={'name':{'type':Sequelize[_0x9a84('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x9a84('0x2'),'Google',_0x9a84('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9a84('0x4')](_0x9a84('0x5'),_0x9a84('0x6'))},'data1':{'type':Sequelize[_0x9a84('0x1')],'comment':_0x9a84('0x7')},'data2':{'type':Sequelize[_0x9a84('0x1')],'comment':_0x9a84('0x8')},'data3':{'type':Sequelize[_0x9a84('0x1')],'comment':_0x9a84('0x9')},'data4':{'type':Sequelize[_0x9a84('0x1')],'comment':_0x9a84('0xa')},'data5':{'type':Sequelize[_0x9a84('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x9a84('0xc')},'data7':{'type':Sequelize[_0x9a84('0xb')],'comment':_0x9a84('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e501542..94c2ca3 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 _0xb961=['undefined','offset','count','limit','Content-Range','update','end','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','CloudProvider','includeAll','include','findAll','then','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','find','create','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','json'];(function(_0x9bf782,_0x7da9d5){var _0x514b67=function(_0x322a0c){while(--_0x322a0c){_0x9bf782['push'](_0x9bf782['shift']());}};_0x514b67(++_0x7da9d5);}(_0xb961,0x1bf));var _0x1b96=function(_0x799c60,_0x586227){_0x799c60=_0x799c60-0x0;var _0x5efdae=_0xb961[_0x799c60];return _0x5efdae;};'use strict';var _=require(_0x1b96('0x0'));var Redis=require(_0x1b96('0x1'));var qs=require(_0x1b96('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x1b96('0x3'));var logger=require(_0x1b96('0x4'))(_0x1b96('0x5'));var db=require(_0x1b96('0x6'))['db'];var oauth=require(_0x1b96('0x7'));config[_0x1b96('0x8')]=_['defaults'](config[_0x1b96('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b96('0x9'))(new Redis(config[_0x1b96('0x8')]));var redis=new Redis(config[_0x1b96('0x8')]);function respondWithStatusCode(_0x326c66,_0x1ca1be){_0x1ca1be=_0x1ca1be||0xcc;return function(_0x4a415c){if(_0x4a415c){return _0x326c66[_0x1b96('0xa')](_0x1ca1be);}return _0x326c66[_0x1b96('0xb')](_0x1ca1be)['end']();};}function respondWithResult(_0x117ff6,_0x2af079){_0x2af079=_0x2af079||0xc8;return function(_0x2700ac){if(_0x2700ac){return _0x117ff6[_0x1b96('0xb')](_0x2af079)[_0x1b96('0xc')](_0x2700ac);}};}function respondWithFilteredResult(_0x55c240,_0x47ea78){return function(_0x229d99){if(_0x229d99){var _0x5f52a7=typeof _0x47ea78['offset']===_0x1b96('0xd')&&typeof _0x47ea78['limit']===_0x1b96('0xd');var _0x8ef4bf=_0x229d99['count'];var _0xf9a0e9=_0x5f52a7?0x0:_0x47ea78[_0x1b96('0xe')];var _0x54e07c=_0x5f52a7?_0x229d99[_0x1b96('0xf')]:_0x47ea78[_0x1b96('0xe')]+_0x47ea78[_0x1b96('0x10')];var _0x533ac5;if(_0x54e07c>=_0x8ef4bf){_0x54e07c=_0x8ef4bf;_0x533ac5=0xc8;}else{_0x533ac5=0xce;}_0x55c240[_0x1b96('0xb')](_0x533ac5);return _0x55c240['set'](_0x1b96('0x11'),_0xf9a0e9+'-'+_0x54e07c+'/'+_0x8ef4bf)[_0x1b96('0xc')](_0x229d99);}return null;};}function saveUpdates(_0x41e1d6){return function(_0xd83ca2){if(_0xd83ca2){return _0xd83ca2[_0x1b96('0x12')](_0x41e1d6)['then'](function(_0x12ff7d){return _0x12ff7d;});}return null;};}function removeEntity(_0x2dec7a){return function(_0xadd829){if(_0xadd829){return _0xadd829['destroy']()['then'](function(){_0x2dec7a['status'](0xcc)[_0x1b96('0x13')]();});}};}function handleEntityNotFound(_0xfc188f){return function(_0x2813c9){if(!_0x2813c9){_0xfc188f['sendStatus'](0x194);}return _0x2813c9;};}function handleError(_0x346fd5,_0x4778a5){_0x4778a5=_0x4778a5||0x1f4;return function(_0x28deb8){logger[_0x1b96('0x14')](_0x28deb8[_0x1b96('0x15')]);if(_0x28deb8['name']){delete _0x28deb8[_0x1b96('0x16')];}_0x346fd5[_0x1b96('0xb')](_0x4778a5)[_0x1b96('0x17')](_0x28deb8);};}function maskClientSecret(_0x5390f3){return _['padEnd'](_0x5390f3['slice'](0x0,0x3),0x14,'*');}exports[_0x1b96('0x18')]=function(_0x3ec93c,_0x589b40){var _0x155f83={},_0x2cd699={},_0x3b7f03={'count':0x0,'rows':[]};var _0x43851f=_[_0x1b96('0x19')](db['CloudProvider']['rawAttributes'],function(_0x504c93){return{'name':_0x504c93['fieldName'],'type':_0x504c93[_0x1b96('0x1a')][_0x1b96('0x1b')]};});_0x2cd699[_0x1b96('0x1c')]=_[_0x1b96('0x19')](_0x43851f,_0x1b96('0x16'));_0x2cd699[_0x1b96('0x1d')]=_[_0x1b96('0x1e')](_0x3ec93c['query']);_0x2cd699[_0x1b96('0x1f')]=_[_0x1b96('0x20')](_0x2cd699[_0x1b96('0x1c')],_0x2cd699[_0x1b96('0x1d')]);_0x155f83[_0x1b96('0x21')]=_[_0x1b96('0x20')](_0x2cd699[_0x1b96('0x1c')],qs[_0x1b96('0x22')](_0x3ec93c[_0x1b96('0x1d')][_0x1b96('0x22')]));_0x155f83[_0x1b96('0x21')]=_0x155f83[_0x1b96('0x21')][_0x1b96('0x23')]?_0x155f83[_0x1b96('0x21')]:_0x2cd699[_0x1b96('0x1c')];if(!_0x3ec93c[_0x1b96('0x1d')][_0x1b96('0x24')]('nolimit')){_0x155f83['limit']=qs[_0x1b96('0x10')](_0x3ec93c['query'][_0x1b96('0x10')]);_0x155f83[_0x1b96('0xe')]=qs[_0x1b96('0xe')](_0x3ec93c[_0x1b96('0x1d')][_0x1b96('0xe')]);}_0x155f83[_0x1b96('0x25')]=qs[_0x1b96('0x26')](_0x3ec93c[_0x1b96('0x1d')][_0x1b96('0x26')]);_0x155f83[_0x1b96('0x27')]=qs[_0x1b96('0x1f')](_['pick'](_0x3ec93c[_0x1b96('0x1d')],_0x2cd699[_0x1b96('0x1f')]),_0x43851f);if(_0x3ec93c[_0x1b96('0x1d')]['filter']){_0x155f83[_0x1b96('0x27')]=_[_0x1b96('0x28')](_0x155f83[_0x1b96('0x27')],{'$or':_[_0x1b96('0x19')](_0x43851f,function(_0x587657){if(_0x587657[_0x1b96('0x1a')]!==_0x1b96('0x29')){var _0x177982={};_0x177982[_0x587657[_0x1b96('0x16')]]={'$like':'%'+_0x3ec93c['query'][_0x1b96('0x2a')]+'%'};return _0x177982;}})});}_0x155f83=_['merge']({},_0x155f83,_0x3ec93c[_0x1b96('0x2b')]);var _0x5086cf={'where':_0x155f83['where']};return db[_0x1b96('0x2c')]['count'](_0x5086cf)['then'](function(_0x40b566){_0x3b7f03[_0x1b96('0xf')]=_0x40b566;if(_0x3ec93c[_0x1b96('0x1d')][_0x1b96('0x2d')]){_0x155f83[_0x1b96('0x2e')]=[{'all':!![]}];}return db[_0x1b96('0x2c')][_0x1b96('0x2f')](_0x155f83);})[_0x1b96('0x30')](function(_0x3592fa){_0x3b7f03[_0x1b96('0x31')]=_['map'](_0x3592fa,function(_0x201097){if(_0x201097[_0x1b96('0x32')]===_0x1b96('0x33')){var _0x599cd4=encryptor[_0x1b96('0x34')](_0x201097['data3']);_0x201097[_0x1b96('0x35')]=maskClientSecret(_0x599cd4);}return _0x201097;});return _0x3b7f03;})[_0x1b96('0x30')](respondWithFilteredResult(_0x589b40,_0x155f83))[_0x1b96('0x36')](handleError(_0x589b40,null));};exports[_0x1b96('0x37')]=function(_0x2034a0,_0x37a45e){var _0x43e39c={'raw':!![],'where':{'id':_0x2034a0[_0x1b96('0x38')]['id']}},_0x53c811={};_0x53c811['model']=_['keys'](db[_0x1b96('0x2c')][_0x1b96('0x39')]);_0x53c811['query']=_[_0x1b96('0x1e')](_0x2034a0[_0x1b96('0x1d')]);_0x53c811['filters']=_['intersection'](_0x53c811[_0x1b96('0x1c')],_0x53c811[_0x1b96('0x1d')]);_0x43e39c[_0x1b96('0x21')]=_[_0x1b96('0x20')](_0x53c811[_0x1b96('0x1c')],qs[_0x1b96('0x22')](_0x2034a0[_0x1b96('0x1d')][_0x1b96('0x22')]));_0x43e39c[_0x1b96('0x21')]=_0x43e39c[_0x1b96('0x21')][_0x1b96('0x23')]?_0x43e39c[_0x1b96('0x21')]:_0x53c811[_0x1b96('0x1c')];if(_0x2034a0[_0x1b96('0x1d')][_0x1b96('0x2d')]){_0x43e39c['include']=[{'all':!![]}];}_0x43e39c=_['merge']({},_0x43e39c,_0x2034a0[_0x1b96('0x2b')]);return db[_0x1b96('0x2c')][_0x1b96('0x3a')](_0x43e39c)[_0x1b96('0x30')](handleEntityNotFound(_0x37a45e,null))[_0x1b96('0x30')](function(_0x3aa7ae){if(_0x3aa7ae[_0x1b96('0x32')]===_0x1b96('0x33')){var _0x201642=encryptor[_0x1b96('0x34')](_0x3aa7ae[_0x1b96('0x35')]);_0x3aa7ae[_0x1b96('0x35')]=maskClientSecret(_0x201642);}return _0x3aa7ae;})[_0x1b96('0x30')](respondWithResult(_0x37a45e,null))['catch'](handleError(_0x37a45e,null));};exports[_0x1b96('0x3b')]=function(_0x3a45d9,_0x9c5069){if(!_0x3a45d9[_0x1b96('0x3c')][_0x1b96('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3a45d9['body'][_0x1b96('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x362caa=db['CloudProvider'][_0x1b96('0x39')][_0x1b96('0x32')][_0x1b96('0x3d')];if(!_0x362caa[_0x1b96('0x3e')](_0x3a45d9[_0x1b96('0x3c')][_0x1b96('0x32')]))throw new Error(_0x1b96('0x3f')+_0x362caa[_0x1b96('0x40')](',\x20'));if(_0x3a45d9[_0x1b96('0x3c')][_0x1b96('0x32')]===_0x1b96('0x33')&&_0x3a45d9[_0x1b96('0x3c')][_0x1b96('0x35')]){_0x3a45d9[_0x1b96('0x3c')][_0x1b96('0x35')]=encryptor['encryptString'](_0x3a45d9[_0x1b96('0x3c')]['data3']);}return db[_0x1b96('0x2c')][_0x1b96('0x3b')](_0x3a45d9[_0x1b96('0x3c')],{})['then'](respondWithResult(_0x9c5069,0xc9))[_0x1b96('0x36')](handleError(_0x9c5069,null));};exports[_0x1b96('0x12')]=function(_0xbad15f,_0x3117ad){if(_0xbad15f[_0x1b96('0x3c')]['id']){delete _0xbad15f[_0x1b96('0x3c')]['id'];}return db[_0x1b96('0x2c')]['find']({'where':{'id':_0xbad15f[_0x1b96('0x38')]['id']}})[_0x1b96('0x30')](handleEntityNotFound(_0x3117ad,null))[_0x1b96('0x30')](function(_0x190e34){if(_0x190e34[_0x1b96('0x32')]===_0x1b96('0x33')&&_0xbad15f[_0x1b96('0x3c')][_0x1b96('0x35')]){_0xbad15f[_0x1b96('0x3c')][_0x1b96('0x35')]=encryptor[_0x1b96('0x41')](_0xbad15f[_0x1b96('0x3c')][_0x1b96('0x35')]);}return _0x190e34;})['then'](saveUpdates(_0xbad15f[_0x1b96('0x3c')],null))['then'](respondWithResult(_0x3117ad,null))[_0x1b96('0x36')](handleError(_0x3117ad,null));};exports[_0x1b96('0x42')]=function(_0x10c63c,_0x40a8f2){return db['CloudProvider']['find']({'where':{'id':_0x10c63c[_0x1b96('0x38')]['id']}})[_0x1b96('0x30')](handleEntityNotFound(_0x40a8f2,null))['then'](removeEntity(_0x40a8f2,null))[_0x1b96('0x36')](handleError(_0x40a8f2,null));};exports['oauth2MicrosoftAuthorize']=function(_0x42ef9d,_0x16b092){return db[_0x1b96('0x2c')][_0x1b96('0x43')]({'where':{'id':_0x42ef9d[_0x1b96('0x38')]['id']},'raw':!![]})[_0x1b96('0x30')](function(_0x3e45e9){if(!_0x3e45e9)return _0x16b092[_0x1b96('0xa')](0x194);return{'url':oauth[_0x1b96('0x44')](_0x3e45e9,_0x42ef9d[_0x1b96('0x45')]['id'])};})[_0x1b96('0x30')](respondWithResult(_0x16b092,null))[_0x1b96('0x36')](handleError(_0x16b092,null));};exports[_0x1b96('0x46')]=function(_0x4ba8a6,_0x374cdb){var _0x21c2b0=_0x4ba8a6[_0x1b96('0x3c')];var _0x5abaeb;var _0x1ab2e2;if(_0x21c2b0[_0x1b96('0x14')])throw _0x21c2b0;redis[_0x1b96('0x47')](_0x21c2b0['state'])[_0x1b96('0x30')](function(_0x462a29){if(!_0x462a29)throw new Error(_0x1b96('0x48'));_0x5abaeb=JSON[_0x1b96('0x49')](_0x462a29);var _0x5c5276=Buffer[_0x1b96('0x4a')](_0x21c2b0[_0x1b96('0x4b')],_0x1b96('0x4c'))[_0x1b96('0x4d')](_0x1b96('0x4e'));_0x1ab2e2=JSON[_0x1b96('0x49')](_0x5c5276);if(!oauth[_0x1b96('0x4f')](_0x21c2b0[_0x1b96('0x50')],_0x5abaeb['oauth2Claims']))throw new Error(_0x1b96('0x51'));redis['del'](_0x21c2b0[_0x1b96('0x4b')]);return oauth['getOauth2MicrosoftAccessToken'](_0x21c2b0[_0x1b96('0x52')],_0x5abaeb);})['then'](function(_0x57de33){_0x5abaeb[_0x1b96('0x53')]=_0x57de33['access_token'];_0x5abaeb[_0x1b96('0x54')]=_0x57de33[_0x1b96('0x55')];return db[_0x1b96('0x2c')][_0x1b96('0x12')]({'data5':_0x5abaeb[_0x1b96('0x53')],'data6':_0x5abaeb[_0x1b96('0x54')]},{'where':{'id':_0x5abaeb['id']}});})[_0x1b96('0x30')](function(){oauth[_0x1b96('0x56')](_0x5abaeb);socket[_0x1b96('0x57')]('microsoftAuthorization:success',{'id':_0x1ab2e2['id']});return;})[_0x1b96('0x30')](respondWithStatusCode(_0x374cdb,null))[_0x1b96('0x36')](function(_0x8f000c){if(_0x1ab2e2){socket[_0x1b96('0x57')](_0x1b96('0x58'),{'id':_0x1ab2e2['id']});}if(!_0x5abaeb){logger[_0x1b96('0x14')](_0x1b96('0x59'),_0x8f000c);return _0x374cdb[_0x1b96('0xb')](0x1f4)['send'](_0x8f000c['message']);}logger[_0x1b96('0x14')](_0x1b96('0x5a'),_0x5abaeb['id'],JSON[_0x1b96('0x5b')](_0x8f000c));});};
\ No newline at end of file
+var _0x7c38=['lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','count','offset','limit','Content-Range','then','end','error','stack','name','send','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','find','MicrosoftAzure','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','create','destroy','oauth2MicrosoftAuthorize','findOne','user','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','update','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c38,0x1e0));var _0x87c3=function(_0x2d5d9d,_0x38a071){_0x2d5d9d=_0x2d5d9d-0x0;var _0x547338=_0x7c38[_0x2d5d9d];return _0x547338;};'use strict';var _=require(_0x87c3('0x0'));var Redis=require(_0x87c3('0x1'));var qs=require(_0x87c3('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x87c3('0x3'));var logger=require(_0x87c3('0x4'))(_0x87c3('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x87c3('0x6'));config[_0x87c3('0x7')]=_[_0x87c3('0x8')](config[_0x87c3('0x7')],{'host':_0x87c3('0x9'),'port':0x18eb});var socket=require(_0x87c3('0xa'))(new Redis(config[_0x87c3('0x7')]));var redis=new Redis(config[_0x87c3('0x7')]);function respondWithStatusCode(_0x4490af,_0x546ade){_0x546ade=_0x546ade||0xcc;return function(_0x391b7f){if(_0x391b7f){return _0x4490af[_0x87c3('0xb')](_0x546ade);}return _0x4490af[_0x87c3('0xc')](_0x546ade)['end']();};}function respondWithResult(_0x43edce,_0x9f4952){_0x9f4952=_0x9f4952||0xc8;return function(_0x296783){if(_0x296783){return _0x43edce['status'](_0x9f4952)[_0x87c3('0xd')](_0x296783);}};}function respondWithFilteredResult(_0x5829bd,_0x5db77f){return function(_0x103762){if(_0x103762){var _0x503d58=typeof _0x5db77f['offset']==='undefined'&&typeof _0x5db77f['limit']==='undefined';var _0x4d236b=_0x103762[_0x87c3('0xe')];var _0x405f05=_0x503d58?0x0:_0x5db77f['offset'];var _0x195ebb=_0x503d58?_0x103762[_0x87c3('0xe')]:_0x5db77f[_0x87c3('0xf')]+_0x5db77f[_0x87c3('0x10')];var _0x2ad09f;if(_0x195ebb>=_0x4d236b){_0x195ebb=_0x4d236b;_0x2ad09f=0xc8;}else{_0x2ad09f=0xce;}_0x5829bd[_0x87c3('0xc')](_0x2ad09f);return _0x5829bd['set'](_0x87c3('0x11'),_0x405f05+'-'+_0x195ebb+'/'+_0x4d236b)[_0x87c3('0xd')](_0x103762);}return null;};}function saveUpdates(_0x1a6409){return function(_0x332439){if(_0x332439){return _0x332439['update'](_0x1a6409)[_0x87c3('0x12')](function(_0x178036){return _0x178036;});}return null;};}function removeEntity(_0x380db5){return function(_0x2ad266){if(_0x2ad266){return _0x2ad266['destroy']()['then'](function(){_0x380db5['status'](0xcc)[_0x87c3('0x13')]();});}};}function handleEntityNotFound(_0x1a9b78){return function(_0x2a04c4){if(!_0x2a04c4){_0x1a9b78[_0x87c3('0xb')](0x194);}return _0x2a04c4;};}function handleError(_0x5a0bd2,_0x26b01a){_0x26b01a=_0x26b01a||0x1f4;return function(_0x2195d8){logger[_0x87c3('0x14')](_0x2195d8[_0x87c3('0x15')]);if(_0x2195d8[_0x87c3('0x16')]){delete _0x2195d8['name'];}_0x5a0bd2[_0x87c3('0xc')](_0x26b01a)[_0x87c3('0x17')](_0x2195d8);};}function maskClientSecret(_0x2b0a77){return _[_0x87c3('0x18')](_0x2b0a77['slice'](0x0,0x3),0x14,'*');}exports[_0x87c3('0x19')]=function(_0x79865e,_0x421dcf){var _0x34a449={},_0x123135={},_0x16c009={'count':0x0,'rows':[]};var _0x75698d=_['map'](db[_0x87c3('0x1a')][_0x87c3('0x1b')],function(_0xa7baba){return{'name':_0xa7baba[_0x87c3('0x1c')],'type':_0xa7baba[_0x87c3('0x1d')][_0x87c3('0x1e')]};});_0x123135[_0x87c3('0x1f')]=_[_0x87c3('0x20')](_0x75698d,'name');_0x123135[_0x87c3('0x21')]=_['keys'](_0x79865e[_0x87c3('0x21')]);_0x123135['filters']=_[_0x87c3('0x22')](_0x123135[_0x87c3('0x1f')],_0x123135[_0x87c3('0x21')]);_0x34a449['attributes']=_[_0x87c3('0x22')](_0x123135[_0x87c3('0x1f')],qs['fields'](_0x79865e[_0x87c3('0x21')][_0x87c3('0x23')]));_0x34a449[_0x87c3('0x24')]=_0x34a449[_0x87c3('0x24')][_0x87c3('0x25')]?_0x34a449[_0x87c3('0x24')]:_0x123135[_0x87c3('0x1f')];if(!_0x79865e[_0x87c3('0x21')][_0x87c3('0x26')](_0x87c3('0x27'))){_0x34a449['limit']=qs[_0x87c3('0x10')](_0x79865e[_0x87c3('0x21')][_0x87c3('0x10')]);_0x34a449['offset']=qs[_0x87c3('0xf')](_0x79865e[_0x87c3('0x21')][_0x87c3('0xf')]);}_0x34a449[_0x87c3('0x28')]=qs[_0x87c3('0x29')](_0x79865e[_0x87c3('0x21')]['sort']);_0x34a449[_0x87c3('0x2a')]=qs[_0x87c3('0x2b')](_[_0x87c3('0x2c')](_0x79865e[_0x87c3('0x21')],_0x123135['filters']),_0x75698d);if(_0x79865e[_0x87c3('0x21')][_0x87c3('0x2d')]){_0x34a449[_0x87c3('0x2a')]=_[_0x87c3('0x2e')](_0x34a449[_0x87c3('0x2a')],{'$or':_['map'](_0x75698d,function(_0x453a4f){if(_0x453a4f[_0x87c3('0x1d')]!==_0x87c3('0x2f')){var _0x5a0f31={};_0x5a0f31[_0x453a4f[_0x87c3('0x16')]]={'$like':'%'+_0x79865e[_0x87c3('0x21')][_0x87c3('0x2d')]+'%'};return _0x5a0f31;}})});}_0x34a449=_[_0x87c3('0x2e')]({},_0x34a449,_0x79865e[_0x87c3('0x30')]);var _0x9e1908={'where':_0x34a449[_0x87c3('0x2a')]};return db[_0x87c3('0x1a')][_0x87c3('0xe')](_0x9e1908)[_0x87c3('0x12')](function(_0x382e3c){_0x16c009[_0x87c3('0xe')]=_0x382e3c;if(_0x79865e[_0x87c3('0x21')][_0x87c3('0x31')]){_0x34a449[_0x87c3('0x32')]=[{'all':!![]}];}return db[_0x87c3('0x1a')][_0x87c3('0x33')](_0x34a449);})[_0x87c3('0x12')](function(_0x5e2063){_0x16c009[_0x87c3('0x34')]=_[_0x87c3('0x20')](_0x5e2063,function(_0x2c5468){if(_0x2c5468[_0x87c3('0x35')]==='MicrosoftAzure'){var _0x52d4a4=encryptor[_0x87c3('0x36')](_0x2c5468[_0x87c3('0x37')]);_0x2c5468[_0x87c3('0x37')]=maskClientSecret(_0x52d4a4);}return _0x2c5468;});return _0x16c009;})[_0x87c3('0x12')](respondWithFilteredResult(_0x421dcf,_0x34a449))[_0x87c3('0x38')](handleError(_0x421dcf,null));};exports[_0x87c3('0x39')]=function(_0x1bc67a,_0x46f901){var _0xc678b9={'raw':!![],'where':{'id':_0x1bc67a[_0x87c3('0x3a')]['id']}},_0x12ff6c={};_0x12ff6c[_0x87c3('0x1f')]=_['keys'](db['CloudProvider'][_0x87c3('0x1b')]);_0x12ff6c[_0x87c3('0x21')]=_['keys'](_0x1bc67a[_0x87c3('0x21')]);_0x12ff6c['filters']=_[_0x87c3('0x22')](_0x12ff6c['model'],_0x12ff6c[_0x87c3('0x21')]);_0xc678b9[_0x87c3('0x24')]=_[_0x87c3('0x22')](_0x12ff6c[_0x87c3('0x1f')],qs[_0x87c3('0x23')](_0x1bc67a[_0x87c3('0x21')][_0x87c3('0x23')]));_0xc678b9[_0x87c3('0x24')]=_0xc678b9['attributes'][_0x87c3('0x25')]?_0xc678b9[_0x87c3('0x24')]:_0x12ff6c[_0x87c3('0x1f')];if(_0x1bc67a[_0x87c3('0x21')][_0x87c3('0x31')]){_0xc678b9[_0x87c3('0x32')]=[{'all':!![]}];}_0xc678b9=_[_0x87c3('0x2e')]({},_0xc678b9,_0x1bc67a[_0x87c3('0x30')]);return db[_0x87c3('0x1a')][_0x87c3('0x3b')](_0xc678b9)['then'](handleEntityNotFound(_0x46f901,null))[_0x87c3('0x12')](function(_0x30c72c){if(_0x30c72c[_0x87c3('0x35')]===_0x87c3('0x3c')){var _0x590365=encryptor[_0x87c3('0x36')](_0x30c72c[_0x87c3('0x37')]);_0x30c72c[_0x87c3('0x37')]=maskClientSecret(_0x590365);}return _0x30c72c;})[_0x87c3('0x12')](respondWithResult(_0x46f901,null))[_0x87c3('0x38')](handleError(_0x46f901,null));};exports['create']=function(_0xe5638c,_0x207768){if(!_0xe5638c[_0x87c3('0x3d')][_0x87c3('0x16')])throw new Error(_0x87c3('0x3e'));if(!_0xe5638c[_0x87c3('0x3d')][_0x87c3('0x35')])throw new Error(_0x87c3('0x3f'));var _0x56b65e=db[_0x87c3('0x1a')][_0x87c3('0x1b')][_0x87c3('0x35')][_0x87c3('0x40')];if(!_0x56b65e[_0x87c3('0x41')](_0xe5638c[_0x87c3('0x3d')]['service']))throw new Error(_0x87c3('0x42')+_0x56b65e['join'](',\x20'));if(_0xe5638c['body']['service']===_0x87c3('0x3c')&&_0xe5638c[_0x87c3('0x3d')]['data3']){_0xe5638c[_0x87c3('0x3d')]['data3']=encryptor[_0x87c3('0x43')](_0xe5638c[_0x87c3('0x3d')]['data3']);}return db[_0x87c3('0x1a')][_0x87c3('0x44')](_0xe5638c['body'],{})[_0x87c3('0x12')](respondWithResult(_0x207768,0xc9))[_0x87c3('0x38')](handleError(_0x207768,null));};exports['update']=function(_0x324c29,_0xbf6dbc){if(_0x324c29['body']['id']){delete _0x324c29[_0x87c3('0x3d')]['id'];}return db[_0x87c3('0x1a')][_0x87c3('0x3b')]({'where':{'id':_0x324c29[_0x87c3('0x3a')]['id']}})[_0x87c3('0x12')](handleEntityNotFound(_0xbf6dbc,null))[_0x87c3('0x12')](function(_0x3e6410){if(_0x3e6410[_0x87c3('0x35')]===_0x87c3('0x3c')&&_0x324c29[_0x87c3('0x3d')][_0x87c3('0x37')]){_0x324c29[_0x87c3('0x3d')][_0x87c3('0x37')]=encryptor[_0x87c3('0x43')](_0x324c29[_0x87c3('0x3d')][_0x87c3('0x37')]);}return _0x3e6410;})['then'](saveUpdates(_0x324c29[_0x87c3('0x3d')],null))[_0x87c3('0x12')](respondWithResult(_0xbf6dbc,null))[_0x87c3('0x38')](handleError(_0xbf6dbc,null));};exports[_0x87c3('0x45')]=function(_0x1fab0e,_0x2fc0ab){return db['CloudProvider']['find']({'where':{'id':_0x1fab0e['params']['id']}})[_0x87c3('0x12')](handleEntityNotFound(_0x2fc0ab,null))['then'](removeEntity(_0x2fc0ab,null))[_0x87c3('0x38')](handleError(_0x2fc0ab,null));};exports[_0x87c3('0x46')]=function(_0x3b5bb4,_0x1dc85c){return db[_0x87c3('0x1a')][_0x87c3('0x47')]({'where':{'id':_0x3b5bb4['params']['id']},'raw':!![]})['then'](function(_0x225483){if(!_0x225483)return _0x1dc85c[_0x87c3('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x225483,_0x3b5bb4[_0x87c3('0x48')]['id'])};})['then'](respondWithResult(_0x1dc85c,null))['catch'](handleError(_0x1dc85c,null));};exports['oauth2MicrosoftCallback']=function(_0x4c7cc3,_0x45a5cf){var _0x46e2a4=_0x4c7cc3[_0x87c3('0x3d')];var _0x2d1725;var _0x1f7f99;if(_0x46e2a4[_0x87c3('0x14')])throw _0x46e2a4;redis['get'](_0x46e2a4[_0x87c3('0x49')])[_0x87c3('0x12')](function(_0x359f95){if(!_0x359f95)throw new Error(_0x87c3('0x4a'));_0x2d1725=JSON[_0x87c3('0x4b')](_0x359f95);var _0x3a4047=Buffer['from'](_0x46e2a4[_0x87c3('0x49')],_0x87c3('0x4c'))[_0x87c3('0x4d')](_0x87c3('0x4e'));_0x1f7f99=JSON[_0x87c3('0x4b')](_0x3a4047);if(!oauth[_0x87c3('0x4f')](_0x46e2a4['id_token'],_0x2d1725['oauth2Claims']))throw new Error(_0x87c3('0x50'));redis[_0x87c3('0x51')](_0x46e2a4[_0x87c3('0x49')]);return oauth[_0x87c3('0x52')](_0x46e2a4[_0x87c3('0x53')],_0x2d1725);})[_0x87c3('0x12')](function(_0x490d6c){_0x2d1725[_0x87c3('0x54')]=_0x490d6c[_0x87c3('0x55')];_0x2d1725[_0x87c3('0x56')]=_0x490d6c[_0x87c3('0x57')];return db[_0x87c3('0x1a')][_0x87c3('0x58')]({'data5':_0x2d1725['data5'],'data6':_0x2d1725[_0x87c3('0x56')]},{'where':{'id':_0x2d1725['id']}});})[_0x87c3('0x12')](function(){oauth[_0x87c3('0x59')](_0x2d1725);socket['emit'](_0x87c3('0x5a'),{'id':_0x1f7f99['id']});return;})[_0x87c3('0x12')](respondWithStatusCode(_0x45a5cf,null))[_0x87c3('0x38')](function(_0x5cd3a3){if(_0x1f7f99){socket[_0x87c3('0x5b')](_0x87c3('0x5c'),{'id':_0x1f7f99['id']});}if(!_0x2d1725){logger[_0x87c3('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0x5cd3a3);return _0x45a5cf[_0x87c3('0xc')](0x1f4)[_0x87c3('0x17')](_0x5cd3a3[_0x87c3('0x5d')]);}logger['error'](_0x87c3('0x5e'),_0x2d1725['id'],JSON[_0x87c3('0x5f')](_0x5cd3a3));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index a344655..132f0a3 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 _0xdab7=['moment','bluebird','path','rimraf','../../config/environment','exports','define','cloud_providers','lodash','util','../../config/logger'];(function(_0x5b366e,_0x54990a){var _0x6cd6a3=function(_0x2b08bb){while(--_0x2b08bb){_0x5b366e['push'](_0x5b366e['shift']());}};_0x6cd6a3(++_0x54990a);}(_0xdab7,0x189));var _0x7dab=function(_0x264705,_0x9791f6){_0x264705=_0x264705-0x0;var _0x4875ff=_0xdab7[_0x264705];return _0x4875ff;};'use strict';var _=require(_0x7dab('0x0'));var util=require(_0x7dab('0x1'));var logger=require(_0x7dab('0x2'))('api');var moment=require(_0x7dab('0x3'));var BPromise=require(_0x7dab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7dab('0x5'));var rimraf=require(_0x7dab('0x6'));var config=require(_0x7dab('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x7dab('0x8')]=function(_0x595007,_0x454a41){return _0x595007[_0x7dab('0x9')]('CloudProvider',attributes,{'tableName':_0x7dab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84bb=['../../config/environment','exports','CloudProvider','cloud_providers','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x685346,_0x3ef2e5){var _0x52e15b=function(_0x4435da){while(--_0x4435da){_0x685346['push'](_0x685346['shift']());}};_0x52e15b(++_0x3ef2e5);}(_0x84bb,0x138));var _0xb84b=function(_0x4287cb,_0xe75c02){_0x4287cb=_0x4287cb-0x0;var _0x2b5fd3=_0x84bb[_0x4287cb];return _0x2b5fd3;};'use strict';var _=require(_0xb84b('0x0'));var util=require(_0xb84b('0x1'));var logger=require('../../config/logger')(_0xb84b('0x2'));var moment=require('moment');var BPromise=require(_0xb84b('0x3'));var rp=require(_0xb84b('0x4'));var fs=require('fs');var path=require(_0xb84b('0x5'));var rimraf=require(_0xb84b('0x6'));var config=require(_0xb84b('0x7'));var attributes=require('./cloudProvider.attributes');module[_0xb84b('0x8')]=function(_0x5b3f54,_0x418b14){return _0x5b3f54['define'](_0xb84b('0x9'),attributes,{'tableName':_0xb84b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 269b65d..a253b3c 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 _0x13c8=['value','set','stringify','decode','payload','iss','issuer','isAfter','exp','then','data3','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','error','authorization_code','data2','intervals','bind','CloudProvider','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','defaults','redis','localhost','openid','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','code','id_token','from','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','key'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x13c8,0x10e));var _0x813c=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0x13c8[_0x1526e1];return _0x249a1e;};'use strict';var _=require(_0x813c('0x0'));var crypto=require(_0x813c('0x1'));var jwt=require(_0x813c('0x2'));var moment=require(_0x813c('0x3'));var Redis=require(_0x813c('0x4'));var rp=require('request-promise');var util=require(_0x813c('0x5'));var encryptor=require(_0x813c('0x6'));var config=require(_0x813c('0x7'));var logger=require(_0x813c('0x8'))(_0x813c('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x813c('0xa'))['db'];config['redis']=_[_0x813c('0xb')](config[_0x813c('0xc')],{'host':_0x813c('0xd'),'port':0x18eb});var redis=new Redis(config[_0x813c('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x813c('0xe'),'profile',_0x813c('0xf'),_0x813c('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x813c('0x11'),_0x813c('0x12')],'Dynamics365':[_0x813c('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x813c('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x8011cc){var _0x18d920=_[_0x813c('0x14')](AZURE_AUTH_SCOPES[_0x8011cc[_0x813c('0x15')]]);if(_0x8011cc[_0x813c('0x15')]===_0x813c('0x16'))_0x18d920[_0x813c('0x17')](_0x8011cc[_0x813c('0x18')]+_0x813c('0x19'));return _0x18d920[_0x813c('0x1a')]('\x20');}function getAccessTokenScope(_0x2fae71){if(_0x2fae71[_0x813c('0x15')]===_0x813c('0x1b'))return _0x813c('0x1c');if(_0x2fae71['type']===_0x813c('0x16'))return _0x2fae71[_0x813c('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4ae6eb,_0x280840){var _0x5da1eb=MICROSOFT_AUTH_URL[_0x813c('0x1d')](_0x813c('0x1e'),_0x4ae6eb['data2']);var _0x4eb597=[_0x813c('0x1f'),_0x813c('0x20')];var _0x454c59=Buffer[_0x813c('0x21')](JSON['stringify']({'id':_0x280840}))[_0x813c('0x22')](_0x813c('0x23'));var _0x29b719=crypto[_0x813c('0x24')](0x10)['toString'](_0x813c('0x25'));var _0x5c6332=getAuthorizationScopes(_0x4ae6eb);var _0x364285=[{'key':_0x813c('0x26'),'value':_0x4ae6eb[_0x813c('0x27')]},{'key':_0x813c('0x28'),'value':encodeURIComponent(_0x4eb597[_0x813c('0x1a')]('\x20'))},{'key':_0x813c('0x29'),'value':_0x4ae6eb[_0x813c('0x2a')]},{'key':_0x813c('0x2b'),'value':_0x813c('0x2c')},{'key':_0x813c('0x2d'),'value':encodeURIComponent(_0x5c6332)},{'key':_0x813c('0x2e'),'value':_0x454c59},{'key':_0x813c('0x2f'),'value':_0x29b719},{'key':_0x813c('0x30'),'value':'login'}];var _0x510a4f=_0x5da1eb+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x813c('0x14')](_0x364285,function(_0xb04974){return _0xb04974[_0x813c('0x31')]+'='+_0xb04974[_0x813c('0x32')];})[_0x813c('0x1a')]('&');_0x4ae6eb['oauth2Claims']={'issuer':_0x5da1eb['replace']('oauth2/',''),'audience':_0x4ae6eb[_0x813c('0x27')],'state':_0x454c59,'nonce':_0x29b719};redis[_0x813c('0x33')](_0x454c59,JSON[_0x813c('0x34')](_0x4ae6eb));return _0x510a4f;}function isValidIdToken(_0x5675ea,_0x3b2006){try{var _0x5cbef3=jwt[_0x813c('0x35')](_0x5675ea,{'complete':!![]});var _0x333754=_0x5cbef3[_0x813c('0x36')];if(_0x333754[_0x813c('0x37')]!==_0x3b2006[_0x813c('0x38')])return![];if(_0x333754['aud']!==_0x3b2006['audience'])return![];if(_0x333754[_0x813c('0x2f')]!==_0x3b2006[_0x813c('0x2f')])return![];if(moment()[_0x813c('0x39')](moment['unix'](_0x333754[_0x813c('0x3a')])))return![];return!![];}catch(_0x273849){throw _0x273849;}}function refreshOauth2MicrosoftAccessToken(_0x2b98d2){return Promise['resolve']()[_0x813c('0x3b')](function(){if(_0x2b98d2[_0x813c('0x3c')])return _0x2b98d2;return db['CloudProvider'][_0x813c('0x3d')]({'where':{'id':_0x2b98d2['id']},'raw':!![]});})[_0x813c('0x3b')](function(_0x9f96d1){var _0x44e748={'grant_type':_0x813c('0x3e'),'refresh_token':_0x9f96d1[_0x813c('0x3f')],'scope':getAccessTokenScope(_0x9f96d1),'redirect_uri':_0x9f96d1[_0x813c('0x2a')],'client_id':_0x9f96d1[_0x813c('0x27')],'client_secret':encryptor[_0x813c('0x40')](_0x9f96d1[_0x813c('0x3c')])};var _0x4c3946={'method':_0x813c('0x41'),'uri':MICROSOFT_AUTH_URL[_0x813c('0x1d')](_0x813c('0x1e'),_0x9f96d1['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x44e748,'json':!![]};return rp(_0x4c3946);})[_0x813c('0x3b')](function(_0x357441){_0x2b98d2[_0x813c('0x42')]=_0x357441[_0x813c('0x43')];_0x2b98d2[_0x813c('0x3f')]=_0x357441[_0x813c('0x3e')];return db['CloudProvider'][_0x813c('0x44')]({'data5':_0x2b98d2[_0x813c('0x42')],'data6':_0x2b98d2[_0x813c('0x3f')]},{'where':{'id':_0x2b98d2['id']}});})['then'](function(){return _0x2b98d2;})['catch'](function(_0x5a5e18){logger[_0x813c('0x45')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x2b98d2['id'],_0x5a5e18);});}function getOauth2MicrosoftAccessToken(_0x230106,_0x4ed106){var _0x2846f3={'grant_type':_0x813c('0x46'),'code':_0x230106,'scope':getAccessTokenScope(_0x4ed106),'redirect_uri':_0x4ed106[_0x813c('0x2a')],'client_id':_0x4ed106['data1'],'client_secret':encryptor[_0x813c('0x40')](_0x4ed106[_0x813c('0x3c')])};var _0x178f60={'method':_0x813c('0x41'),'uri':MICROSOFT_AUTH_URL[_0x813c('0x1d')](_0x813c('0x1e'),_0x4ed106[_0x813c('0x47')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2846f3,'json':!![]};return rp(_0x178f60);}function startRefreshInterval(_0x463e83){var _0x14a537=schedule[_0x813c('0x48')];if(_0x14a537[_0x463e83['id']])clearInterval(_0x14a537[_0x463e83['id']]);_0x14a537[_0x463e83['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x813c('0x49')](this,{'id':_0x463e83['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x813c('0x48')]=_0x14a537;}function startAllRefreshIntervals(){return db[_0x813c('0x4a')][_0x813c('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x813c('0x3b')](function(_0x5f55c6){var _0x93b1de=_0x5f55c6[_0x813c('0x14')](function(_0x549e1e){return refreshOauth2MicrosoftAccessToken(_0x549e1e)['then'](function(_0x51d8de){startRefreshInterval(_0x51d8de);});});return Promise[_0x813c('0x4c')](_0x93b1de);})[_0x813c('0x4d')](function(_0x55d733){var _0x3043cd=_0x55d733?util[_0x813c('0x4e')](_0x55d733,{'showHidden':![],'depth':null}):'';logger[_0x813c('0x45')](_0x813c('0x4f'),_0x3043cd);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x05cd=['bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../config/logger','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/token','map','type','Dynamics365','push','data7','join','Outlook365','code','from','stringify','toString','base64','hex','data1','redirect_uri','response_mode','form_post','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','data4','decryptString','POST','replace','{TENANT_ID}','data2','data5','access_token','data6','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x05cd,0x1da));var _0xd05c=function(_0x57bdce,_0x579631){_0x57bdce=_0x57bdce-0x0;var _0x35cbd3=_0x05cd[_0x57bdce];return _0x35cbd3;};'use strict';var _=require(_0xd05c('0x0'));var crypto=require(_0xd05c('0x1'));var jwt=require(_0xd05c('0x2'));var moment=require(_0xd05c('0x3'));var Redis=require('ioredis');var rp=require(_0xd05c('0x4'));var util=require(_0xd05c('0x5'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xd05c('0x6'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xd05c('0x7')]=_[_0xd05c('0x8')](config[_0xd05c('0x7')],{'host':_0xd05c('0x9'),'port':0x18eb});var redis=new Redis(config[_0xd05c('0x7')]);var MICROSOFT_AUTH_URL=_0xd05c('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd05c('0xb'),_0xd05c('0xc'),_0xd05c('0xd'),_0xd05c('0xe'),_0xd05c('0xf'),_0xd05c('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xd05c('0xb'),_0xd05c('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xd05c('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x26c9b2){var _0x18731f=_[_0xd05c('0x12')](AZURE_AUTH_SCOPES[_0x26c9b2[_0xd05c('0x13')]]);if(_0x26c9b2[_0xd05c('0x13')]===_0xd05c('0x14'))_0x18731f[_0xd05c('0x15')](_0x26c9b2[_0xd05c('0x16')]+'/.default');return _0x18731f[_0xd05c('0x17')]('\x20');}function getAccessTokenScope(_0x38baee){if(_0x38baee[_0xd05c('0x13')]===_0xd05c('0x18'))return _0xd05c('0xf');if(_0x38baee[_0xd05c('0x13')]===_0xd05c('0x14'))return _0x38baee[_0xd05c('0x16')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x3a6375,_0x11b94a){var _0x4b3b53=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3a6375['data2']);var _0x24e003=[_0xd05c('0x19'),'id_token'];var _0x13a00e=Buffer[_0xd05c('0x1a')](JSON[_0xd05c('0x1b')]({'id':_0x11b94a}))[_0xd05c('0x1c')](_0xd05c('0x1d'));var _0x17a2dd=crypto['randomBytes'](0x10)[_0xd05c('0x1c')](_0xd05c('0x1e'));var _0x2e010e=getAuthorizationScopes(_0x3a6375);var _0x1ae043=[{'key':'client_id','value':_0x3a6375[_0xd05c('0x1f')]},{'key':'response_type','value':encodeURIComponent(_0x24e003['join']('\x20'))},{'key':_0xd05c('0x20'),'value':_0x3a6375['data4']},{'key':_0xd05c('0x21'),'value':_0xd05c('0x22')},{'key':'scope','value':encodeURIComponent(_0x2e010e)},{'key':_0xd05c('0x23'),'value':_0x13a00e},{'key':_0xd05c('0x24'),'value':_0x17a2dd},{'key':_0xd05c('0x25'),'value':'login'}];var _0x431486=_0x4b3b53+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd05c('0x12')](_0x1ae043,function(_0x3bf7b9){return _0x3bf7b9[_0xd05c('0x26')]+'='+_0x3bf7b9[_0xd05c('0x27')];})[_0xd05c('0x17')]('&');_0x3a6375[_0xd05c('0x28')]={'issuer':_0x4b3b53['replace'](_0xd05c('0x29'),''),'audience':_0x3a6375[_0xd05c('0x1f')],'state':_0x13a00e,'nonce':_0x17a2dd};redis[_0xd05c('0x2a')](_0x13a00e,JSON[_0xd05c('0x1b')](_0x3a6375));return _0x431486;}function isValidIdToken(_0x456baa,_0x1eca1b){try{var _0x545e90=jwt[_0xd05c('0x2b')](_0x456baa,{'complete':!![]});var _0x489a3d=_0x545e90[_0xd05c('0x2c')];if(_0x489a3d[_0xd05c('0x2d')]!==_0x1eca1b[_0xd05c('0x2e')])return![];if(_0x489a3d[_0xd05c('0x2f')]!==_0x1eca1b[_0xd05c('0x30')])return![];if(_0x489a3d[_0xd05c('0x24')]!==_0x1eca1b[_0xd05c('0x24')])return![];if(moment()[_0xd05c('0x31')](moment[_0xd05c('0x32')](_0x489a3d[_0xd05c('0x33')])))return![];return!![];}catch(_0x4a9783){throw _0x4a9783;}}function refreshOauth2MicrosoftAccessToken(_0x17badf){return Promise[_0xd05c('0x34')]()[_0xd05c('0x35')](function(){if(_0x17badf[_0xd05c('0x36')])return _0x17badf;return db[_0xd05c('0x37')]['findOne']({'where':{'id':_0x17badf['id']},'raw':!![]});})[_0xd05c('0x35')](function(_0x24acc2){var _0x2b6f71={'grant_type':'refresh_token','refresh_token':_0x24acc2['data6'],'scope':getAccessTokenScope(_0x24acc2),'redirect_uri':_0x24acc2[_0xd05c('0x38')],'client_id':_0x24acc2[_0xd05c('0x1f')],'client_secret':encryptor[_0xd05c('0x39')](_0x24acc2[_0xd05c('0x36')])};var _0x1b7164={'method':_0xd05c('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xd05c('0x3b')](_0xd05c('0x3c'),_0x24acc2[_0xd05c('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2b6f71,'json':!![]};return rp(_0x1b7164);})[_0xd05c('0x35')](function(_0x101609){_0x17badf[_0xd05c('0x3e')]=_0x101609[_0xd05c('0x3f')];_0x17badf[_0xd05c('0x40')]=_0x101609[_0xd05c('0x41')];return db[_0xd05c('0x37')][_0xd05c('0x42')]({'data5':_0x17badf[_0xd05c('0x3e')],'data6':_0x17badf[_0xd05c('0x40')]},{'where':{'id':_0x17badf['id']}});})[_0xd05c('0x35')](function(){return _0x17badf;})[_0xd05c('0x43')](function(_0xdb2243){logger[_0xd05c('0x44')](_0xd05c('0x45'),_0x17badf['id'],_0xdb2243);});}function getOauth2MicrosoftAccessToken(_0x56ccfa,_0x5d8f25){var _0x263b6a={'grant_type':_0xd05c('0x46'),'code':_0x56ccfa,'scope':getAccessTokenScope(_0x5d8f25),'redirect_uri':_0x5d8f25['data4'],'client_id':_0x5d8f25[_0xd05c('0x1f')],'client_secret':encryptor[_0xd05c('0x39')](_0x5d8f25['data3'])};var _0x2f4882={'method':_0xd05c('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xd05c('0x3b')](_0xd05c('0x3c'),_0x5d8f25[_0xd05c('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x263b6a,'json':!![]};return rp(_0x2f4882);}function startRefreshInterval(_0x3ec11d){var _0x1797e6=schedule[_0xd05c('0x47')];if(_0x1797e6[_0x3ec11d['id']])clearInterval(_0x1797e6[_0x3ec11d['id']]);_0x1797e6[_0x3ec11d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xd05c('0x48')](this,{'id':_0x3ec11d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x1797e6;}function startAllRefreshIntervals(){return db[_0xd05c('0x37')][_0xd05c('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd05c('0x35')](function(_0x479af5){var _0x443c32=_0x479af5[_0xd05c('0x12')](function(_0x3ff9f0){return refreshOauth2MicrosoftAccessToken(_0x3ff9f0)['then'](function(_0x558404){startRefreshInterval(_0x558404);});});return Promise[_0xd05c('0x4a')](_0x443c32);})['catch'](function(_0x3274f3){var _0x524657=_0x3274f3?util[_0xd05c('0x4b')](_0x3274f3,{'showHidden':![],'depth':null}):'';logger['error'](_0xd05c('0x4c'),_0x524657);});}module[_0xd05c('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 1176e80..5e53f98 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 _0x887b=['request','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5a168a,_0x2aa6e8){var _0x7dbbcc=function(_0x231f97){while(--_0x231f97){_0x5a168a['push'](_0x5a168a['shift']());}};_0x7dbbcc(++_0x2aa6e8);}(_0x887b,0x185));var _0xb887=function(_0x1dfe26,_0x35dbcf){_0x1dfe26=_0x1dfe26-0x0;var _0xfcb5ff=_0x887b[_0x1dfe26];return _0xfcb5ff;};'use strict';var _=require(_0xb887('0x0'));var util=require(_0xb887('0x1'));var moment=require(_0xb887('0x2'));var BPromise=require(_0xb887('0x3'));var rs=require(_0xb887('0x4'));var fs=require('fs');var Redis=require(_0xb887('0x5'));var db=require(_0xb887('0x6'))['db'];var utils=require(_0xb887('0x7'));var logger=require(_0xb887('0x8'))('rpc');var config=require(_0xb887('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x332507,_0x353587,_0x59707f){return new BPromise(function(_0x4a1c1e,_0x32ace2){return client[_0xb887('0xa')](_0x332507,_0x59707f)['then'](function(_0x49962f){logger['info'](_0xb887('0xb'),_0x353587,_0xb887('0xc'));logger['debug'](_0xb887('0xd'),_0x353587,'request\x20sent',JSON[_0xb887('0xe')](_0x49962f));if(_0x49962f[_0xb887('0xf')]){if(_0x49962f[_0xb887('0xf')][_0xb887('0x10')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x353587,_0x49962f[_0xb887('0xf')][_0xb887('0x11')]);return _0x32ace2(_0x49962f[_0xb887('0xf')][_0xb887('0x11')]);}logger[_0xb887('0xf')]('CloudProvider,\x20%s,\x20%s',_0x353587,_0x49962f[_0xb887('0xf')][_0xb887('0x11')]);return _0x4a1c1e(_0x49962f[_0xb887('0xf')][_0xb887('0x11')]);}else{logger[_0xb887('0x12')](_0xb887('0xb'),_0x353587,_0xb887('0xc'));_0x4a1c1e(_0x49962f[_0xb887('0x13')][_0xb887('0x11')]);}})[_0xb887('0x14')](function(_0x2f4e2d){logger[_0xb887('0xf')]('CloudProvider,\x20%s,\x20%s',_0x353587,_0x2f4e2d);_0x32ace2(_0x2f4e2d);});});}
\ No newline at end of file
+var _0x3070=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x49ed32,_0x573235){var _0x5f04c1=function(_0x35e88b){while(--_0x35e88b){_0x49ed32['push'](_0x49ed32['shift']());}};_0x5f04c1(++_0x573235);}(_0x3070,0x75));var _0x0307=function(_0x5cf121,_0x48b19c){_0x5cf121=_0x5cf121-0x0;var _0x5bb99c=_0x3070[_0x5cf121];return _0x5bb99c;};'use strict';var _=require('lodash');var util=require(_0x0307('0x0'));var moment=require('moment');var BPromise=require(_0x0307('0x1'));var rs=require(_0x0307('0x2'));var fs=require('fs');var Redis=require(_0x0307('0x3'));var db=require(_0x0307('0x4'))['db'];var utils=require(_0x0307('0x5'));var logger=require(_0x0307('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0307('0x7'));var client=jayson[_0x0307('0x8')][_0x0307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc1dc51,_0x4fbe3e,_0x3ecfb6){return new BPromise(function(_0x41e638,_0x53e6b7){return client[_0x0307('0xa')](_0xc1dc51,_0x3ecfb6)[_0x0307('0xb')](function(_0x187fb3){logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,_0x0307('0xe'));logger[_0x0307('0xf')](_0x0307('0x10'),_0x4fbe3e,_0x0307('0xe'),JSON['stringify'](_0x187fb3));if(_0x187fb3[_0x0307('0x11')]){if(_0x187fb3['error'][_0x0307('0x12')]===0x1f4){logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x53e6b7(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x41e638(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}else{logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,'request\x20sent');_0x41e638(_0x187fb3[_0x0307('0x14')][_0x0307('0x13')]);}})[_0x0307('0x15')](function(_0x5f11a5){logger['error'](_0x0307('0xd'),_0x4fbe3e,_0x5f11a5);_0x53e6b7(_0x5f11a5);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index cd9e697..4f049b3 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x1261,0x144));var _0x1126=function(_0xf58288,_0x35333c){_0xf58288=_0xf58288-0x0;var _0x196e87=_0x1261[_0xf58288];return _0x196e87;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x5bade4,_0x392912){var _0x111177=function(_0x21b25e){while(--_0x21b25e){_0x5bade4['push'](_0x5bade4['shift']());}};_0x111177(++_0x392912);}(_0x2ef3,0xba));var _0x32ef=function(_0x44de74,_0x310731){_0x44de74=_0x44de74-0x0;var _0x3811db=_0x2ef3[_0x44de74];return _0x3811db;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index da95566..f063e92 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 _0xfa7e=['STRING','sequelize','exports'];(function(_0x1b8bda,_0x43ad31){var _0x1f7050=function(_0x1d8dc6){while(--_0x1d8dc6){_0x1b8bda['push'](_0x1b8bda['shift']());}};_0x1f7050(++_0x43ad31);}(_0xfa7e,0xfd));var _0xefa7=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xfa7e[_0x412e27];return _0x53da42;};'use strict';var Sequelize=require(_0xefa7('0x0'));module[_0xefa7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xefa7('0x2')]},'companyId':{'type':Sequelize[_0xefa7('0x2')]},'website':{'type':Sequelize[_0xefa7('0x2')]},'phone':{'type':Sequelize[_0xefa7('0x2')]},'fax':{'type':Sequelize[_0xefa7('0x2')]},'type':{'type':Sequelize[_0xefa7('0x2')]},'street':{'type':Sequelize[_0xefa7('0x2')]},'postalCode':{'type':Sequelize[_0xefa7('0x2')]},'city':{'type':Sequelize[_0xefa7('0x2')]},'country':{'type':Sequelize[_0xefa7('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xefa7('0x2')]},'sPostalCode':{'type':Sequelize[_0xefa7('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xefa7('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe023=['name','STRING','sequelize','exports'];(function(_0x50a008,_0x46083e){var _0x165d01=function(_0x54c50f){while(--_0x54c50f){_0x50a008['push'](_0x50a008['shift']());}};_0x165d01(++_0x46083e);}(_0xe023,0x1da));var _0x3e02=function(_0x41cc0d,_0x3f4045){_0x41cc0d=_0x41cc0d-0x0;var _0x11e7c3=_0xe023[_0x41cc0d];return _0x11e7c3;};'use strict';var Sequelize=require(_0x3e02('0x0'));module[_0x3e02('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3e02('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3e02('0x3')]},'companyId':{'type':Sequelize[_0x3e02('0x3')]},'website':{'type':Sequelize[_0x3e02('0x3')]},'phone':{'type':Sequelize[_0x3e02('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3e02('0x3')]},'city':{'type':Sequelize[_0x3e02('0x3')]},'country':{'type':Sequelize[_0x3e02('0x3')]},'email':{'type':Sequelize[_0x3e02('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3e02('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3e02('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 7806c0b..d95bf6a 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 _0x7141=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','Companies','UserProfileResource','end','error','stack','send','index','describe','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','findOne','keys','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring'];(function(_0x376262,_0x51db10){var _0x1be2a4=function(_0x5629fe){while(--_0x5629fe){_0x376262['push'](_0x376262['shift']());}};_0x1be2a4(++_0x51db10);}(_0x7141,0x108));var _0x1714=function(_0x25f458,_0x1adf3e){_0x25f458=_0x25f458-0x0;var _0x28d182=_0x7141[_0x25f458];return _0x28d182;};'use strict';var emlformat=require(_0x1714('0x0'));var rimraf=require(_0x1714('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1714('0x2'));var rp=require(_0x1714('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1714('0x4'));var util=require(_0x1714('0x5'));var path=require(_0x1714('0x6'));var sox=require(_0x1714('0x7'));var csv=require('to-csv');var ejs=require(_0x1714('0x8'));var fs=require('fs');var fs_extra=require(_0x1714('0x9'));var _=require('lodash');var squel=require(_0x1714('0xa'));var crypto=require(_0x1714('0xb'));var jsforce=require(_0x1714('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1714('0xd'));var querystring=require(_0x1714('0xe'));var Papa=require('papaparse');var Redis=require(_0x1714('0xf'));var authService=require(_0x1714('0x10'));var qs=require(_0x1714('0x11'));var as=require(_0x1714('0x12'));var hardwareService=require(_0x1714('0x13'));var logger=require(_0x1714('0x14'))(_0x1714('0x15'));var utils=require(_0x1714('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1714('0x17'));var db=require(_0x1714('0x18'))['db'];function respondWithStatusCode(_0x3f1fca,_0x165fe7){_0x165fe7=_0x165fe7||0xcc;return function(_0x10b38a){if(_0x10b38a){return _0x3f1fca[_0x1714('0x19')](_0x165fe7);}return _0x3f1fca['status'](_0x165fe7)['end']();};}function respondWithResult(_0x25ea5c,_0xdd2dd7){_0xdd2dd7=_0xdd2dd7||0xc8;return function(_0x6ca5dd){if(_0x6ca5dd){return _0x25ea5c[_0x1714('0x1a')](_0xdd2dd7)[_0x1714('0x1b')](_0x6ca5dd);}};}function respondWithFilteredResult(_0x126bec,_0x2c2ec3){return function(_0x11959b){if(_0x11959b){var _0x48f003=typeof _0x2c2ec3[_0x1714('0x1c')]===_0x1714('0x1d')&&typeof _0x2c2ec3[_0x1714('0x1e')]===_0x1714('0x1d');var _0x5786b4=_0x11959b['count'];var _0x14b78c=_0x48f003?0x0:_0x2c2ec3[_0x1714('0x1c')];var _0x36ea8a=_0x48f003?_0x11959b[_0x1714('0x1f')]:_0x2c2ec3[_0x1714('0x1c')]+_0x2c2ec3[_0x1714('0x1e')];var _0x4b9e93;if(_0x36ea8a>=_0x5786b4){_0x36ea8a=_0x5786b4;_0x4b9e93=0xc8;}else{_0x4b9e93=0xce;}_0x126bec[_0x1714('0x1a')](_0x4b9e93);return _0x126bec[_0x1714('0x20')](_0x1714('0x21'),_0x14b78c+'-'+_0x36ea8a+'/'+_0x5786b4)[_0x1714('0x1b')](_0x11959b);}return null;};}function patchUpdates(_0x329945){return function(_0x60de8e){try{jsonpatch[_0x1714('0x22')](_0x60de8e,_0x329945,!![]);}catch(_0x235486){return BPromise[_0x1714('0x23')](_0x235486);}return _0x60de8e[_0x1714('0x24')]();};}function saveUpdates(_0x414ec8,_0x926323){return function(_0x4a4449){if(_0x4a4449){return _0x4a4449['update'](_0x414ec8)['then'](function(_0x5e2e60){return _0x5e2e60;});}return null;};}function removeEntity(_0x928d8f,_0x3ab34d){return function(_0x9f88d4){if(_0x9f88d4){return _0x9f88d4[_0x1714('0x25')]()[_0x1714('0x26')](function(){var _0x36edba=_0x9f88d4[_0x1714('0x27')]({'plain':!![]});var _0x870cdc=_0x1714('0x28');return db[_0x1714('0x29')]['destroy']({'where':{'type':_0x870cdc,'resourceId':_0x36edba['id']}})[_0x1714('0x26')](function(){return _0x9f88d4;});})[_0x1714('0x26')](function(){_0x928d8f[_0x1714('0x1a')](0xcc)[_0x1714('0x2a')]();});}};}function handleEntityNotFound(_0x5a5cd3,_0xcc2bf4){return function(_0x47b8de){if(!_0x47b8de){_0x5a5cd3[_0x1714('0x19')](0x194);}return _0x47b8de;};}function handleError(_0x32fb1a,_0x222bbc){_0x222bbc=_0x222bbc||0x1f4;return function(_0x511c99){logger[_0x1714('0x2b')](_0x511c99[_0x1714('0x2c')]);if(_0x511c99['name']){delete _0x511c99['name'];}_0x32fb1a[_0x1714('0x1a')](_0x222bbc)[_0x1714('0x2d')](_0x511c99);};}exports[_0x1714('0x2e')]=function(_0x5aaf7d,_0x404833){var _0x57708a={},_0x2941f2={},_0x36c515={'count':0x0,'rows':[]};return db['CmCompany'][_0x1714('0x2f')]()['then'](function(_0xdd69f0){_0x2941f2['model']=_['keys'](_0xdd69f0);_0x2941f2[_0x1714('0x30')]=_['keys'](_0x5aaf7d[_0x1714('0x30')]);_0x2941f2[_0x1714('0x31')]=_[_0x1714('0x32')](_0x2941f2[_0x1714('0x33')],_0x2941f2[_0x1714('0x30')]);_0x57708a[_0x1714('0x34')]=_[_0x1714('0x32')](_0x2941f2['model'],qs[_0x1714('0x35')](_0x5aaf7d[_0x1714('0x30')]['fields']));_0x57708a[_0x1714('0x34')]=_0x57708a['attributes'][_0x1714('0x36')]?_0x57708a[_0x1714('0x34')]:_0x2941f2[_0x1714('0x33')];if(!_0x5aaf7d[_0x1714('0x30')][_0x1714('0x37')](_0x1714('0x38'))){_0x57708a[_0x1714('0x1e')]=qs[_0x1714('0x1e')](_0x5aaf7d[_0x1714('0x30')]['limit']);_0x57708a[_0x1714('0x1c')]=qs[_0x1714('0x1c')](_0x5aaf7d[_0x1714('0x30')][_0x1714('0x1c')]);}_0x57708a[_0x1714('0x39')]=qs[_0x1714('0x3a')](_0x5aaf7d[_0x1714('0x30')][_0x1714('0x3a')]);_0x57708a[_0x1714('0x3b')]=qs['filters'](_[_0x1714('0x3c')](_0x5aaf7d[_0x1714('0x30')],_0x2941f2[_0x1714('0x31')]),_0xdd69f0);if(_0x5aaf7d[_0x1714('0x30')]['filter']){_0x57708a[_0x1714('0x3b')]=_[_0x1714('0x3d')](_0x57708a[_0x1714('0x3b')],{'$or':_[_0x1714('0x3e')](_0x57708a[_0x1714('0x34')],function(_0x4dc3b9){var _0x4df2dd={};_0x4df2dd[_0x4dc3b9]={'$like':'%'+_0x5aaf7d[_0x1714('0x30')][_0x1714('0x3f')]+'%'};return _0x4df2dd;})});}_0x57708a=_['merge']({},_0x57708a,_0x5aaf7d[_0x1714('0x40')]);var _0x34bfdc={'where':_0x57708a[_0x1714('0x3b')]};return db[_0x1714('0x41')]['count'](_0x34bfdc)[_0x1714('0x26')](function(_0x234f9c){_0x36c515[_0x1714('0x1f')]=_0x234f9c;if(_0x5aaf7d['query'][_0x1714('0x42')]){_0x57708a[_0x1714('0x43')]=[{'all':!![]}];}return db[_0x1714('0x41')][_0x1714('0x44')](_0x57708a);})[_0x1714('0x26')](function(_0x47f3c1){_0x36c515[_0x1714('0x45')]=_0x47f3c1;return _0x36c515;})[_0x1714('0x26')](respondWithFilteredResult(_0x404833,_0x57708a))['catch'](handleError(_0x404833,null));})[_0x1714('0x46')](handleError(_0x404833,null));};exports[_0x1714('0x47')]=function(_0x5541d8,_0x227779){var _0x36671e={'raw':![],'where':{'id':_0x5541d8[_0x1714('0x48')]['id']}},_0x13efc5={};_0x13efc5[_0x1714('0x33')]=_['keys'](db[_0x1714('0x41')][_0x1714('0x49')]);_0x13efc5[_0x1714('0x30')]=_['keys'](_0x5541d8['query']);_0x13efc5[_0x1714('0x31')]=_[_0x1714('0x32')](_0x13efc5[_0x1714('0x33')],_0x13efc5[_0x1714('0x30')]);_0x36671e[_0x1714('0x34')]=_[_0x1714('0x32')](_0x13efc5[_0x1714('0x33')],qs[_0x1714('0x35')](_0x5541d8['query']['fields']));_0x36671e['attributes']=_0x36671e[_0x1714('0x34')][_0x1714('0x36')]?_0x36671e[_0x1714('0x34')]:_0x13efc5[_0x1714('0x33')];if(_0x5541d8[_0x1714('0x30')][_0x1714('0x42')]){_0x36671e[_0x1714('0x43')]=[{'all':!![]}];}_0x36671e=_[_0x1714('0x3d')]({},_0x36671e,_0x5541d8[_0x1714('0x40')]);return db[_0x1714('0x41')][_0x1714('0x4a')](_0x36671e)[_0x1714('0x26')](handleEntityNotFound(_0x227779,null))[_0x1714('0x26')](respondWithResult(_0x227779,null))[_0x1714('0x46')](handleError(_0x227779,null));};exports[_0x1714('0x4b')]=function(_0x226a0b,_0x432014){return db[_0x1714('0x41')][_0x1714('0x4b')](_0x226a0b[_0x1714('0x4c')],{})[_0x1714('0x26')](function(_0x2aba0f){var _0x1b5a0d=_0x226a0b[_0x1714('0x4d')][_0x1714('0x27')]({'plain':!![]});if(!_0x1b5a0d)throw new Error(_0x1714('0x4e'));if(_0x1b5a0d[_0x1714('0x4f')]===_0x1714('0x4d')){var _0x116ebe=_0x2aba0f[_0x1714('0x27')]({'plain':!![]});var _0x441925=_0x1714('0x28');return db[_0x1714('0x50')][_0x1714('0x4a')]({'where':{'name':_0x441925,'userProfileId':_0x1b5a0d[_0x1714('0x51')]},'raw':!![]})[_0x1714('0x26')](function(_0x3b5e16){if(_0x3b5e16&&_0x3b5e16[_0x1714('0x52')]===0x0){return db[_0x1714('0x29')]['create']({'name':_0x116ebe[_0x1714('0x53')],'resourceId':_0x116ebe['id'],'type':_0x3b5e16[_0x1714('0x53')],'sectionId':_0x3b5e16['id']},{})[_0x1714('0x26')](function(){return _0x2aba0f;});}else{return _0x2aba0f;}})[_0x1714('0x46')](function(_0x40351d){logger[_0x1714('0x2b')](_0x1714('0x54'),_0x40351d);throw _0x40351d;});}return _0x2aba0f;})['then'](respondWithResult(_0x432014,0xc9))['catch'](handleError(_0x432014,null));};exports[_0x1714('0x55')]=function(_0x6c8ecd,_0x5ef143){if(_0x6c8ecd[_0x1714('0x4c')]['id']){delete _0x6c8ecd[_0x1714('0x4c')]['id'];}return db[_0x1714('0x41')][_0x1714('0x4a')]({'where':{'id':_0x6c8ecd['params']['id']}})[_0x1714('0x26')](handleEntityNotFound(_0x5ef143,null))[_0x1714('0x26')](saveUpdates(_0x6c8ecd['body'],null))['then'](respondWithResult(_0x5ef143,null))[_0x1714('0x46')](handleError(_0x5ef143,null));};exports['destroy']=function(_0x54abd4,_0x1ded23){return db[_0x1714('0x41')]['find']({'where':{'id':_0x54abd4[_0x1714('0x48')]['id']}})[_0x1714('0x26')](handleEntityNotFound(_0x1ded23,null))[_0x1714('0x26')](removeEntity(_0x1ded23,null))[_0x1714('0x46')](handleError(_0x1ded23,null));};exports['describe']=function(_0x3f10fa,_0x41d41a){return db[_0x1714('0x41')][_0x1714('0x2f')]()[_0x1714('0x26')](respondWithResult(_0x41d41a,null))['catch'](handleError(_0x41d41a,null));};exports[_0x1714('0x56')]=function(_0x1211a8,_0x4399c2,_0x55b36d){return db[_0x1714('0x57')][_0x1714('0x4a')]({'where':{'id':_0x1211a8['params']['id']}})[_0x1714('0x26')](handleEntityNotFound(_0x4399c2,null))['then'](function(_0x59bd74){if(_0x59bd74){return _0x59bd74['addContacts'](_0x1211a8['body'][_0x1714('0x58')],_[_0x1714('0x59')](_0x1211a8[_0x1714('0x4c')],[_0x1714('0x58'),'id'])||{});}})[_0x1714('0x26')](respondWithResult(_0x4399c2,null))[_0x1714('0x46')](handleError(_0x4399c2,null));};exports[_0x1714('0x5a')]=function(_0x40639c,_0x18f3a0,_0x3d7cd4){var _0x40c054={};var _0xc36bc2={};var _0x54f9af;var _0x3e2437;return db[_0x1714('0x41')][_0x1714('0x5b')]({'where':{'id':_0x40639c[_0x1714('0x48')]['id']}})[_0x1714('0x26')](handleEntityNotFound(_0x18f3a0,null))['then'](function(_0x5977bb){if(_0x5977bb){_0x54f9af=_0x5977bb;_0xc36bc2[_0x1714('0x33')]=_['keys'](db[_0x1714('0x57')][_0x1714('0x49')]);_0xc36bc2[_0x1714('0x30')]=_[_0x1714('0x5c')](_0x40639c[_0x1714('0x30')]);_0xc36bc2[_0x1714('0x31')]=_[_0x1714('0x32')](_0xc36bc2[_0x1714('0x33')],_0xc36bc2[_0x1714('0x30')]);_0x40c054['attributes']=_['intersection'](_0xc36bc2[_0x1714('0x33')],qs['fields'](_0x40639c[_0x1714('0x30')]['fields']));_0x40c054[_0x1714('0x34')]=_0x40c054['attributes'][_0x1714('0x36')]?_0x40c054[_0x1714('0x34')]:_0xc36bc2[_0x1714('0x33')];_0x40c054['order']=qs[_0x1714('0x3a')](_0x40639c[_0x1714('0x30')][_0x1714('0x3a')]);_0x40c054[_0x1714('0x3b')]=qs[_0x1714('0x31')](_[_0x1714('0x3c')](_0x40639c[_0x1714('0x30')],_0xc36bc2[_0x1714('0x31')]));if(_0x40639c[_0x1714('0x30')][_0x1714('0x3f')]){_0x40c054[_0x1714('0x3b')]=_[_0x1714('0x3d')](_0x40c054[_0x1714('0x3b')],{'$or':_['map'](_0x40c054[_0x1714('0x34')],function(_0x26db73){var _0x5dac64={};_0x5dac64[_0x26db73]={'$like':'%'+_0x40639c[_0x1714('0x30')][_0x1714('0x3f')]+'%'};return _0x5dac64;})});}_0x40c054=_[_0x1714('0x3d')]({},_0x40c054,_0x40639c[_0x1714('0x40')]);return _0x54f9af[_0x1714('0x5a')](_0x40c054);}})[_0x1714('0x26')](function(_0x2146b5){if(_0x2146b5){_0x3e2437=_0x2146b5[_0x1714('0x36')];if(!_0x40639c[_0x1714('0x30')][_0x1714('0x37')](_0x1714('0x38'))){_0x40c054['limit']=qs['limit'](_0x40639c[_0x1714('0x30')][_0x1714('0x1e')]);_0x40c054['offset']=qs[_0x1714('0x1c')](_0x40639c[_0x1714('0x30')][_0x1714('0x1c')]);}return _0x54f9af['getContacts'](_0x40c054);}})[_0x1714('0x26')](function(_0x42d896){if(_0x42d896){return _0x42d896?{'count':_0x3e2437,'rows':_0x42d896}:null;}})[_0x1714('0x26')](respondWithResult(_0x18f3a0,null))[_0x1714('0x46')](handleError(_0x18f3a0,null));};
\ No newline at end of file
+var _0xb5ca=['UserProfileResource','stack','name','index','CmCompany','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','findAll','catch','show','params','model','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addContacts','omit','ids','findOne','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','then','destroy','get','Companies'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0xb5ca,0x121));var _0xab5c=function(_0x58cd03,_0x233a86){_0x58cd03=_0x58cd03-0x0;var _0xee0802=_0xb5ca[_0x58cd03];return _0xee0802;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab5c('0x0'));var zipdir=require(_0xab5c('0x1'));var jsonpatch=require(_0xab5c('0x2'));var rp=require('request-promise');var moment=require(_0xab5c('0x3'));var BPromise=require(_0xab5c('0x4'));var Mustache=require(_0xab5c('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xab5c('0x6'));var ejs=require(_0xab5c('0x7'));var fs=require('fs');var fs_extra=require(_0xab5c('0x8'));var _=require('lodash');var squel=require(_0xab5c('0x9'));var crypto=require('crypto');var jsforce=require(_0xab5c('0xa'));var deskjs=require(_0xab5c('0xb'));var toCsv=require('to-csv');var querystring=require(_0xab5c('0xc'));var Papa=require(_0xab5c('0xd'));var Redis=require(_0xab5c('0xe'));var authService=require(_0xab5c('0xf'));var qs=require(_0xab5c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xab5c('0x11'))(_0xab5c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab5c('0x13'));var db=require(_0xab5c('0x14'))['db'];function respondWithStatusCode(_0x26ff10,_0x309050){_0x309050=_0x309050||0xcc;return function(_0x5d992e){if(_0x5d992e){return _0x26ff10[_0xab5c('0x15')](_0x309050);}return _0x26ff10[_0xab5c('0x16')](_0x309050)[_0xab5c('0x17')]();};}function respondWithResult(_0x2ee54f,_0x5a2e7e){_0x5a2e7e=_0x5a2e7e||0xc8;return function(_0x489acd){if(_0x489acd){return _0x2ee54f[_0xab5c('0x16')](_0x5a2e7e)[_0xab5c('0x18')](_0x489acd);}};}function respondWithFilteredResult(_0x2b15b9,_0xde7fe6){return function(_0x383b76){if(_0x383b76){var _0x151fd2=typeof _0xde7fe6[_0xab5c('0x19')]===_0xab5c('0x1a')&&typeof _0xde7fe6[_0xab5c('0x1b')]===_0xab5c('0x1a');var _0x4a4a5c=_0x383b76['count'];var _0x2b3512=_0x151fd2?0x0:_0xde7fe6[_0xab5c('0x19')];var _0x19799f=_0x151fd2?_0x383b76['count']:_0xde7fe6['offset']+_0xde7fe6[_0xab5c('0x1b')];var _0x2d837b;if(_0x19799f>=_0x4a4a5c){_0x19799f=_0x4a4a5c;_0x2d837b=0xc8;}else{_0x2d837b=0xce;}_0x2b15b9['status'](_0x2d837b);return _0x2b15b9[_0xab5c('0x1c')]('Content-Range',_0x2b3512+'-'+_0x19799f+'/'+_0x4a4a5c)[_0xab5c('0x18')](_0x383b76);}return null;};}function patchUpdates(_0x1403b9){return function(_0x30917b){try{jsonpatch[_0xab5c('0x1d')](_0x30917b,_0x1403b9,!![]);}catch(_0x4c61cb){return BPromise['reject'](_0x4c61cb);}return _0x30917b[_0xab5c('0x1e')]();};}function saveUpdates(_0x5f0f00,_0x44e8bc){return function(_0xf5671d){if(_0xf5671d){return _0xf5671d['update'](_0x5f0f00)[_0xab5c('0x1f')](function(_0xaf0553){return _0xaf0553;});}return null;};}function removeEntity(_0x6b9d24,_0xbf95a7){return function(_0x2970f6){if(_0x2970f6){return _0x2970f6[_0xab5c('0x20')]()[_0xab5c('0x1f')](function(){var _0x48d08b=_0x2970f6[_0xab5c('0x21')]({'plain':!![]});var _0x5d7cdd=_0xab5c('0x22');return db[_0xab5c('0x23')]['destroy']({'where':{'type':_0x5d7cdd,'resourceId':_0x48d08b['id']}})[_0xab5c('0x1f')](function(){return _0x2970f6;});})[_0xab5c('0x1f')](function(){_0x6b9d24[_0xab5c('0x16')](0xcc)[_0xab5c('0x17')]();});}};}function handleEntityNotFound(_0x301a12,_0x4a84e5){return function(_0xe7e915){if(!_0xe7e915){_0x301a12[_0xab5c('0x15')](0x194);}return _0xe7e915;};}function handleError(_0xaaae34,_0x9f744b){_0x9f744b=_0x9f744b||0x1f4;return function(_0x3a1559){logger['error'](_0x3a1559[_0xab5c('0x24')]);if(_0x3a1559['name']){delete _0x3a1559[_0xab5c('0x25')];}_0xaaae34[_0xab5c('0x16')](_0x9f744b)['send'](_0x3a1559);};}exports[_0xab5c('0x26')]=function(_0x2368a3,_0x333446){var _0x342acd={},_0x19694f={},_0x220799={'count':0x0,'rows':[]};return db[_0xab5c('0x27')]['describe']()[_0xab5c('0x1f')](function(_0x173163){_0x19694f['model']=_['keys'](_0x173163);_0x19694f[_0xab5c('0x28')]=_[_0xab5c('0x29')](_0x2368a3['query']);_0x19694f[_0xab5c('0x2a')]=_[_0xab5c('0x2b')](_0x19694f['model'],_0x19694f['query']);_0x342acd[_0xab5c('0x2c')]=_[_0xab5c('0x2b')](_0x19694f['model'],qs[_0xab5c('0x2d')](_0x2368a3[_0xab5c('0x28')]['fields']));_0x342acd['attributes']=_0x342acd[_0xab5c('0x2c')][_0xab5c('0x2e')]?_0x342acd[_0xab5c('0x2c')]:_0x19694f['model'];if(!_0x2368a3['query'][_0xab5c('0x2f')](_0xab5c('0x30'))){_0x342acd[_0xab5c('0x1b')]=qs[_0xab5c('0x1b')](_0x2368a3['query'][_0xab5c('0x1b')]);_0x342acd[_0xab5c('0x19')]=qs[_0xab5c('0x19')](_0x2368a3[_0xab5c('0x28')][_0xab5c('0x19')]);}_0x342acd[_0xab5c('0x31')]=qs[_0xab5c('0x32')](_0x2368a3['query'][_0xab5c('0x32')]);_0x342acd[_0xab5c('0x33')]=qs[_0xab5c('0x2a')](_[_0xab5c('0x34')](_0x2368a3[_0xab5c('0x28')],_0x19694f[_0xab5c('0x2a')]),_0x173163);if(_0x2368a3[_0xab5c('0x28')][_0xab5c('0x35')]){_0x342acd[_0xab5c('0x33')]=_[_0xab5c('0x36')](_0x342acd[_0xab5c('0x33')],{'$or':_[_0xab5c('0x37')](_0x342acd['attributes'],function(_0x427e48){var _0x368f6a={};_0x368f6a[_0x427e48]={'$like':'%'+_0x2368a3[_0xab5c('0x28')][_0xab5c('0x35')]+'%'};return _0x368f6a;})});}_0x342acd=_[_0xab5c('0x36')]({},_0x342acd,_0x2368a3['options']);var _0x413b74={'where':_0x342acd['where']};return db['CmCompany']['count'](_0x413b74)[_0xab5c('0x1f')](function(_0x18ad48){_0x220799['count']=_0x18ad48;if(_0x2368a3[_0xab5c('0x28')][_0xab5c('0x38')]){_0x342acd['include']=[{'all':!![]}];}return db['CmCompany'][_0xab5c('0x39')](_0x342acd);})[_0xab5c('0x1f')](function(_0x5bfca5){_0x220799['rows']=_0x5bfca5;return _0x220799;})['then'](respondWithFilteredResult(_0x333446,_0x342acd))[_0xab5c('0x3a')](handleError(_0x333446,null));})['catch'](handleError(_0x333446,null));};exports[_0xab5c('0x3b')]=function(_0x2a3eae,_0x3a94f8){var _0x223a97={'raw':![],'where':{'id':_0x2a3eae[_0xab5c('0x3c')]['id']}},_0x494e04={};_0x494e04[_0xab5c('0x3d')]=_[_0xab5c('0x29')](db['CmCompany'][_0xab5c('0x3e')]);_0x494e04[_0xab5c('0x28')]=_[_0xab5c('0x29')](_0x2a3eae['query']);_0x494e04[_0xab5c('0x2a')]=_[_0xab5c('0x2b')](_0x494e04['model'],_0x494e04[_0xab5c('0x28')]);_0x223a97[_0xab5c('0x2c')]=_['intersection'](_0x494e04[_0xab5c('0x3d')],qs['fields'](_0x2a3eae[_0xab5c('0x28')][_0xab5c('0x2d')]));_0x223a97['attributes']=_0x223a97[_0xab5c('0x2c')][_0xab5c('0x2e')]?_0x223a97['attributes']:_0x494e04[_0xab5c('0x3d')];if(_0x2a3eae[_0xab5c('0x28')]['includeAll']){_0x223a97[_0xab5c('0x3f')]=[{'all':!![]}];}_0x223a97=_[_0xab5c('0x36')]({},_0x223a97,_0x2a3eae[_0xab5c('0x40')]);return db['CmCompany'][_0xab5c('0x41')](_0x223a97)[_0xab5c('0x1f')](handleEntityNotFound(_0x3a94f8,null))[_0xab5c('0x1f')](respondWithResult(_0x3a94f8,null))[_0xab5c('0x3a')](handleError(_0x3a94f8,null));};exports[_0xab5c('0x42')]=function(_0x4a447a,_0x19bce9){return db[_0xab5c('0x27')][_0xab5c('0x42')](_0x4a447a[_0xab5c('0x43')],{})[_0xab5c('0x1f')](function(_0x31ba47){var _0x4b9cb5=_0x4a447a[_0xab5c('0x44')][_0xab5c('0x21')]({'plain':!![]});if(!_0x4b9cb5)throw new Error(_0xab5c('0x45'));if(_0x4b9cb5[_0xab5c('0x46')]===_0xab5c('0x44')){var _0x335935=_0x31ba47[_0xab5c('0x21')]({'plain':!![]});var _0x26677b=_0xab5c('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x26677b,'userProfileId':_0x4b9cb5[_0xab5c('0x47')]},'raw':!![]})[_0xab5c('0x1f')](function(_0x538110){if(_0x538110&&_0x538110[_0xab5c('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x335935[_0xab5c('0x25')],'resourceId':_0x335935['id'],'type':_0x538110[_0xab5c('0x25')],'sectionId':_0x538110['id']},{})[_0xab5c('0x1f')](function(){return _0x31ba47;});}else{return _0x31ba47;}})[_0xab5c('0x3a')](function(_0x426e06){logger[_0xab5c('0x49')](_0xab5c('0x4a'),_0x426e06);throw _0x426e06;});}return _0x31ba47;})[_0xab5c('0x1f')](respondWithResult(_0x19bce9,0xc9))[_0xab5c('0x3a')](handleError(_0x19bce9,null));};exports[_0xab5c('0x4b')]=function(_0x27133d,_0x4a10a9){if(_0x27133d[_0xab5c('0x43')]['id']){delete _0x27133d['body']['id'];}return db[_0xab5c('0x27')][_0xab5c('0x41')]({'where':{'id':_0x27133d['params']['id']}})[_0xab5c('0x1f')](handleEntityNotFound(_0x4a10a9,null))[_0xab5c('0x1f')](saveUpdates(_0x27133d[_0xab5c('0x43')],null))[_0xab5c('0x1f')](respondWithResult(_0x4a10a9,null))[_0xab5c('0x3a')](handleError(_0x4a10a9,null));};exports[_0xab5c('0x20')]=function(_0x1be9f4,_0x6c9c11){return db[_0xab5c('0x27')][_0xab5c('0x41')]({'where':{'id':_0x1be9f4[_0xab5c('0x3c')]['id']}})[_0xab5c('0x1f')](handleEntityNotFound(_0x6c9c11,null))['then'](removeEntity(_0x6c9c11,null))[_0xab5c('0x3a')](handleError(_0x6c9c11,null));};exports[_0xab5c('0x4c')]=function(_0x20bef8,_0x52dbfc){return db[_0xab5c('0x27')][_0xab5c('0x4c')]()[_0xab5c('0x1f')](respondWithResult(_0x52dbfc,null))['catch'](handleError(_0x52dbfc,null));};exports[_0xab5c('0x4d')]=function(_0x57985c,_0x17414d,_0x1690a4){return db['CmContact']['find']({'where':{'id':_0x57985c['params']['id']}})['then'](handleEntityNotFound(_0x17414d,null))[_0xab5c('0x1f')](function(_0x14b0a3){if(_0x14b0a3){return _0x14b0a3[_0xab5c('0x4d')](_0x57985c['body']['ids'],_[_0xab5c('0x4e')](_0x57985c['body'],[_0xab5c('0x4f'),'id'])||{});}})[_0xab5c('0x1f')](respondWithResult(_0x17414d,null))[_0xab5c('0x3a')](handleError(_0x17414d,null));};exports['getContacts']=function(_0x3deeb6,_0x12b567,_0x131edb){var _0x32fd73={};var _0x30e158={};var _0x50a0e9;var _0xd67f13;return db[_0xab5c('0x27')][_0xab5c('0x50')]({'where':{'id':_0x3deeb6['params']['id']}})['then'](handleEntityNotFound(_0x12b567,null))['then'](function(_0x95bbfa){if(_0x95bbfa){_0x50a0e9=_0x95bbfa;_0x30e158['model']=_[_0xab5c('0x29')](db['CmContact'][_0xab5c('0x3e')]);_0x30e158[_0xab5c('0x28')]=_[_0xab5c('0x29')](_0x3deeb6[_0xab5c('0x28')]);_0x30e158['filters']=_['intersection'](_0x30e158[_0xab5c('0x3d')],_0x30e158['query']);_0x32fd73[_0xab5c('0x2c')]=_[_0xab5c('0x2b')](_0x30e158[_0xab5c('0x3d')],qs[_0xab5c('0x2d')](_0x3deeb6[_0xab5c('0x28')]['fields']));_0x32fd73[_0xab5c('0x2c')]=_0x32fd73[_0xab5c('0x2c')][_0xab5c('0x2e')]?_0x32fd73[_0xab5c('0x2c')]:_0x30e158[_0xab5c('0x3d')];_0x32fd73[_0xab5c('0x31')]=qs['sort'](_0x3deeb6[_0xab5c('0x28')][_0xab5c('0x32')]);_0x32fd73[_0xab5c('0x33')]=qs[_0xab5c('0x2a')](_[_0xab5c('0x34')](_0x3deeb6['query'],_0x30e158[_0xab5c('0x2a')]));if(_0x3deeb6['query'][_0xab5c('0x35')]){_0x32fd73['where']=_[_0xab5c('0x36')](_0x32fd73['where'],{'$or':_[_0xab5c('0x37')](_0x32fd73[_0xab5c('0x2c')],function(_0x269944){var _0x2083ca={};_0x2083ca[_0x269944]={'$like':'%'+_0x3deeb6[_0xab5c('0x28')][_0xab5c('0x35')]+'%'};return _0x2083ca;})});}_0x32fd73=_[_0xab5c('0x36')]({},_0x32fd73,_0x3deeb6[_0xab5c('0x40')]);return _0x50a0e9['getContacts'](_0x32fd73);}})['then'](function(_0x2c6ff2){if(_0x2c6ff2){_0xd67f13=_0x2c6ff2[_0xab5c('0x2e')];if(!_0x3deeb6[_0xab5c('0x28')]['hasOwnProperty'](_0xab5c('0x30'))){_0x32fd73[_0xab5c('0x1b')]=qs[_0xab5c('0x1b')](_0x3deeb6[_0xab5c('0x28')][_0xab5c('0x1b')]);_0x32fd73[_0xab5c('0x19')]=qs[_0xab5c('0x19')](_0x3deeb6[_0xab5c('0x28')][_0xab5c('0x19')]);}return _0x50a0e9['getContacts'](_0x32fd73);}})[_0xab5c('0x1f')](function(_0x5317f2){if(_0x5317f2){return _0x5317f2?{'count':_0xd67f13,'rows':_0x5317f2}:null;}})['then'](respondWithResult(_0x12b567,null))[_0xab5c('0x3a')](handleError(_0x12b567,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index e4e328e..4e36f8e 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 _0x9da7=['exports','define','CmCompany','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x9da7,0x19d));var _0x79da=function(_0x3af6d3,_0xd6ff2e){_0x3af6d3=_0x3af6d3-0x0;var _0xf0c5a8=_0x9da7[_0x3af6d3];return _0xf0c5a8;};'use strict';var _=require(_0x79da('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x79da('0x1'));var BPromise=require(_0x79da('0x2'));var rp=require(_0x79da('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79da('0x4'));var config=require(_0x79da('0x5'));var attributes=require(_0x79da('0x6'));module[_0x79da('0x7')]=function(_0x596266,_0x4e57e8){return _0x596266[_0x79da('0x8')](_0x79da('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13bd=['moment','bluebird','request-promise','path','../../config/environment','exports','define','cm_companies','util','../../config/logger'];(function(_0x27e004,_0x4008cc){var _0x493997=function(_0x17e9ab){while(--_0x17e9ab){_0x27e004['push'](_0x27e004['shift']());}};_0x493997(++_0x4008cc);}(_0x13bd,0x94));var _0xd13b=function(_0x245c4f,_0x34b70f){_0x245c4f=_0x245c4f-0x0;var _0x3157a1=_0x13bd[_0x245c4f];return _0x3157a1;};'use strict';var _=require('lodash');var util=require(_0xd13b('0x0'));var logger=require(_0xd13b('0x1'))('api');var moment=require(_0xd13b('0x2'));var BPromise=require(_0xd13b('0x3'));var rp=require(_0xd13b('0x4'));var fs=require('fs');var path=require(_0xd13b('0x5'));var rimraf=require('rimraf');var config=require(_0xd13b('0x6'));var attributes=require('./cmCompany.attributes');module[_0xd13b('0x7')]=function(_0x10d08e,_0x57145e){return _0x10d08e[_0xd13b('0x8')]('CmCompany',attributes,{'tableName':_0xd13b('0x9'),'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 16e9e6c..361d748 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 _0xd2ee=['CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x23622e,_0x90502c){var _0x14a39e=function(_0x296d32){while(--_0x296d32){_0x23622e['push'](_0x23622e['shift']());}};_0x14a39e(++_0x90502c);}(_0xd2ee,0x1a7));var _0xed2e=function(_0x58cda9,_0x2291d9){_0x58cda9=_0x58cda9-0x0;var _0x5739ed=_0xd2ee[_0x58cda9];return _0x5739ed;};'use strict';var _=require(_0xed2e('0x0'));var util=require(_0xed2e('0x1'));var moment=require(_0xed2e('0x2'));var BPromise=require(_0xed2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xed2e('0x4'));var logger=require(_0xed2e('0x5'))(_0xed2e('0x6'));var config=require('../../config/environment');var jayson=require(_0xed2e('0x7'));var client=jayson[_0xed2e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35a3bb,_0x44ae34,_0x3bce78){return new BPromise(function(_0x319513,_0x537402){return client[_0xed2e('0x9')](_0x35a3bb,_0x3bce78)['then'](function(_0x2a8eb4){logger[_0xed2e('0xa')]('CmCompany,\x20%s,\x20%s',_0x44ae34,_0xed2e('0xb'));logger[_0xed2e('0xc')](_0xed2e('0xd'),_0x44ae34,'request\x20sent',JSON['stringify'](_0x2a8eb4));if(_0x2a8eb4[_0xed2e('0xe')]){if(_0x2a8eb4[_0xed2e('0xe')][_0xed2e('0xf')]===0x1f4){logger[_0xed2e('0xe')]('CmCompany,\x20%s,\x20%s',_0x44ae34,_0x2a8eb4[_0xed2e('0xe')][_0xed2e('0x10')]);return _0x537402(_0x2a8eb4['error'][_0xed2e('0x10')]);}logger[_0xed2e('0xe')](_0xed2e('0x11'),_0x44ae34,_0x2a8eb4[_0xed2e('0xe')][_0xed2e('0x10')]);return _0x319513(_0x2a8eb4[_0xed2e('0xe')][_0xed2e('0x10')]);}else{logger[_0xed2e('0xa')]('CmCompany,\x20%s,\x20%s',_0x44ae34,_0xed2e('0xb'));_0x319513(_0x2a8eb4[_0xed2e('0x12')]['message']);}})[_0xed2e('0x13')](function(_0x383e36){logger['error']('CmCompany,\x20%s,\x20%s',_0x44ae34,_0x383e36);_0x537402(_0x383e36);});});}
\ No newline at end of file
+var _0xd713=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x1eca7,_0x464b3a){var _0x529ca3=function(_0x4c1d7b){while(--_0x4c1d7b){_0x1eca7['push'](_0x1eca7['shift']());}};_0x529ca3(++_0x464b3a);}(_0xd713,0x98));var _0x3d71=function(_0xbd18d4,_0x112df4){_0xbd18d4=_0xbd18d4-0x0;var _0xec2e4a=_0xd713[_0xbd18d4];return _0xec2e4a;};'use strict';var _=require('lodash');var util=require(_0x3d71('0x0'));var moment=require(_0x3d71('0x1'));var BPromise=require(_0x3d71('0x2'));var rs=require(_0x3d71('0x3'));var fs=require('fs');var Redis=require(_0x3d71('0x4'));var db=require(_0x3d71('0x5'))['db'];var utils=require(_0x3d71('0x6'));var logger=require(_0x3d71('0x7'))(_0x3d71('0x8'));var config=require(_0x3d71('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3d71('0xa')][_0x3d71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1359b6,_0x5b046e,_0x3c5221){return new BPromise(function(_0x3b66a4,_0x51a6d5){return client['request'](_0x1359b6,_0x3c5221)[_0x3d71('0xc')](function(_0x39e154){logger[_0x3d71('0xd')]('CmCompany,\x20%s,\x20%s',_0x5b046e,_0x3d71('0xe'));logger[_0x3d71('0xf')](_0x3d71('0x10'),_0x5b046e,'request\x20sent',JSON['stringify'](_0x39e154));if(_0x39e154[_0x3d71('0x11')]){if(_0x39e154[_0x3d71('0x11')]['code']===0x1f4){logger[_0x3d71('0x11')](_0x3d71('0x12'),_0x5b046e,_0x39e154[_0x3d71('0x11')][_0x3d71('0x13')]);return _0x51a6d5(_0x39e154['error'][_0x3d71('0x13')]);}logger[_0x3d71('0x11')](_0x3d71('0x12'),_0x5b046e,_0x39e154[_0x3d71('0x11')][_0x3d71('0x13')]);return _0x3b66a4(_0x39e154[_0x3d71('0x11')][_0x3d71('0x13')]);}else{logger[_0x3d71('0xd')]('CmCompany,\x20%s,\x20%s',_0x5b046e,_0x3d71('0xe'));_0x3b66a4(_0x39e154[_0x3d71('0x14')][_0x3d71('0x13')]);}})[_0x3d71('0x15')](function(_0x159736){logger['error'](_0x3d71('0x12'),_0x5b046e,_0x159736);_0x51a6d5(_0x159736);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 3406043..3e3261b 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 _0x29ae=['describe','/:id','show','/:id/contacts','post','create','addContacts','destroy','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated'];(function(_0x5365ad,_0x41ec9b){var _0x365519=function(_0x5f0cd2){while(--_0x5f0cd2){_0x5365ad['push'](_0x5365ad['shift']());}};_0x365519(++_0x41ec9b);}(_0x29ae,0x17e));var _0xe29a=function(_0x4bf374,_0x6ce396){_0x4bf374=_0x4bf374-0x0;var _0x40aa89=_0x29ae[_0x4bf374];return _0x40aa89;};'use strict';var multer=require('multer');var util=require(_0xe29a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe29a('0x1')]();var fs_extra=require(_0xe29a('0x2'));var auth=require(_0xe29a('0x3'));var interaction=require(_0xe29a('0x4'));var config=require(_0xe29a('0x5'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe29a('0x6')](_0xe29a('0x7'),auth[_0xe29a('0x8')](),controller[_0xe29a('0x9')]);router[_0xe29a('0x6')](_0xe29a('0xa'),auth[_0xe29a('0x8')](),controller[_0xe29a('0xb')]);router[_0xe29a('0x6')](_0xe29a('0xc'),auth[_0xe29a('0x8')](),controller['getContacts']);router[_0xe29a('0xd')]('/',auth['isAuthenticated'](),controller[_0xe29a('0xe')]);router['post']('/:id/contacts',auth[_0xe29a('0x8')](),controller[_0xe29a('0xf')]);router['put'](_0xe29a('0xa'),auth[_0xe29a('0x8')](),controller['update']);router['delete'](_0xe29a('0xa'),auth[_0xe29a('0x8')](),controller[_0xe29a('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x2395=['./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5af7ae,_0x42f37b){var _0x5166a2=function(_0x31b574){while(--_0x31b574){_0x5af7ae['push'](_0x5af7ae['shift']());}};_0x5166a2(++_0x42f37b);}(_0x2395,0x1c1));var _0x5239=function(_0x3a6f39,_0x46f8ea){_0x3a6f39=_0x3a6f39-0x0;var _0x443024=_0x2395[_0x3a6f39];return _0x443024;};'use strict';var multer=require(_0x5239('0x0'));var util=require(_0x5239('0x1'));var path=require(_0x5239('0x2'));var timeout=require(_0x5239('0x3'));var express=require(_0x5239('0x4'));var router=express[_0x5239('0x5')]();var fs_extra=require(_0x5239('0x6'));var auth=require(_0x5239('0x7'));var interaction=require(_0x5239('0x8'));var config=require(_0x5239('0x9'));var controller=require(_0x5239('0xa'));router['get']('/',auth[_0x5239('0xb')](),controller[_0x5239('0xc')]);router[_0x5239('0xd')](_0x5239('0xe'),auth['isAuthenticated'](),controller[_0x5239('0xf')]);router[_0x5239('0xd')](_0x5239('0x10'),auth[_0x5239('0xb')](),controller[_0x5239('0x11')]);router['get'](_0x5239('0x12'),auth[_0x5239('0xb')](),controller[_0x5239('0x13')]);router[_0x5239('0x14')]('/',auth[_0x5239('0xb')](),controller[_0x5239('0x15')]);router[_0x5239('0x14')](_0x5239('0x12'),auth[_0x5239('0xb')](),controller[_0x5239('0x16')]);router[_0x5239('0x17')](_0x5239('0x10'),auth[_0x5239('0xb')](),controller[_0x5239('0x18')]);router[_0x5239('0x19')](_0x5239('0x10'),auth[_0x5239('0xb')](),controller['destroy']);module[_0x5239('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3a57b13..a6624c4 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 _0x4faa=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4faa,0xcb));var _0xa4fa=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x4faa[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xa4fa('0x0'));var Sequelize=require(_0xa4fa('0x1'));module[_0xa4fa('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa4fa('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa4fa('0x3')]},'dateOfBirth':{'type':Sequelize[_0xa4fa('0x3')]},'description':{'type':Sequelize[_0xa4fa('0x4')]},'phone':{'type':Sequelize[_0xa4fa('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa4fa('0x3')]},'email':{'type':Sequelize[_0xa4fa('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa4fa('0x3')]},'fb_data':{'type':Sequelize[_0xa4fa('0x3')]},'twitter':{'type':Sequelize[_0xa4fa('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xa4fa('0x3')]},'viber':{'type':Sequelize[_0xa4fa('0x3')]},'line':{'type':Sequelize[_0xa4fa('0x3')]},'wechat':{'type':Sequelize[_0xa4fa('0x3')]},'telegram':{'type':Sequelize[_0xa4fa('0x3')]},'UserId':{'type':Sequelize[_0xa4fa('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa4fa('0x5')](0x2)[_0xa4fa('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa4fa('0x7')],'defaultValue':Sequelize[_0xa4fa('0x8')]},'dialTimezone':{'type':Sequelize[_0xa4fa('0x3')]},'utcOffset':{'type':Sequelize[_0xa4fa('0x5')]}};
\ No newline at end of file
+var _0xd7ec=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x325f39,_0x279f45){var _0xbbf965=function(_0xe09bba){while(--_0xe09bba){_0x325f39['push'](_0x325f39['shift']());}};_0xbbf965(++_0x279f45);}(_0xd7ec,0xa6));var _0xcd7e=function(_0x586803,_0x201178){_0x586803=_0x586803-0x0;var _0x4d56b3=_0xd7ec[_0x586803];return _0x4d56b3;};'use strict';var _=require(_0xcd7e('0x0'));var Sequelize=require(_0xcd7e('0x1'));module[_0xcd7e('0x2')]={'firstName':{'type':Sequelize[_0xcd7e('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xcd7e('0x3')]},'street':{'type':Sequelize[_0xcd7e('0x3')]},'postalCode':{'type':Sequelize[_0xcd7e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xcd7e('0x3')]},'dateOfBirth':{'type':Sequelize[_0xcd7e('0x3')]},'description':{'type':Sequelize[_0xcd7e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xcd7e('0x3')]},'fax':{'type':Sequelize[_0xcd7e('0x3')]},'email':{'type':Sequelize[_0xcd7e('0x3')]},'url':{'type':Sequelize[_0xcd7e('0x3')]},'facebook':{'type':Sequelize[_0xcd7e('0x3')]},'fb_data':{'type':Sequelize[_0xcd7e('0x3')]},'twitter':{'type':Sequelize[_0xcd7e('0x3')]},'skype':{'type':Sequelize[_0xcd7e('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xcd7e('0x3')]},'wechat':{'type':Sequelize[_0xcd7e('0x3')]},'telegram':{'type':Sequelize[_0xcd7e('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xcd7e('0x3')]},'priority':{'type':Sequelize[_0xcd7e('0x5')](0x2)[_0xcd7e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xcd7e('0x7')],'defaultValue':Sequelize[_0xcd7e('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xcd7e('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 86200c0..6d52d82 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 _0x08e3=['ContactItemType','ItemType','literal','Phones.OrderBy','get','$and','omit','format','cf_%d','dialTimezone','pickBy','table','cm_contacts','id\x20=\x20?','toParam','rawAttributes','merge','options','getTags','setTags','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','phone','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','includeAll','include','getHopperHistories','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','join','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','../../components/import/cm/csvUpdates','error\x20child\x20process','mail','chat','sms','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','source','destination','callerid','starttime','endtime','duration','note','userDisposition','userThirdDisposition','fullname','alias','createdAt','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','UserId','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','openchannel','threadId','Interaction','flatten','sortBy','reverse','slice','moment','bluebird','path','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','socket.io-emitter','register','json','limit','undefined','count','offset','status','set','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','length','cf_','CmCustomField','findOne','fieldType','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','text','start','filter','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','c.id','DESC','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.firstName','c.lastName','c.mobile','c.fax','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','tags','startsWith','columnName','displayName','analytics','findAll','custom','body','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','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','spread','contact','all','show','find','params','CmContactHasItem','Phones'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x08e3,0x1c1));var _0x308e=function(_0x2fd123,_0x3649e4){_0x2fd123=_0x2fd123-0x0;var _0x14686b=_0x08e3[_0x2fd123];return _0x14686b;};'use strict';var moment=require(_0x308e('0x0'));var BPromise=require(_0x308e('0x1'));var util=require('util');var path=require(_0x308e('0x2'));var fs=require('fs');var _=require(_0x308e('0x3'));var squel=require(_0x308e('0x4'));var Papa=require(_0x308e('0x5'));var Redis=require('ioredis');var qs=require(_0x308e('0x6'));var as=require(_0x308e('0x7'));var logger=require(_0x308e('0x8'))(_0x308e('0x9'));var config=require(_0x308e('0xa'));var shared=require(_0x308e('0xb'));var db=require('../../mysqldb')['db'];config[_0x308e('0xc')]=_['defaults'](config[_0x308e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x308e('0xd'))(new Redis(config[_0x308e('0xc')]));require('./cmContact.socket')[_0x308e('0xe')](socket);function respondWithResult(_0x45fd27,_0x3dc340){_0x3dc340=_0x3dc340||0xc8;return function(_0x195948){if(_0x195948){return _0x45fd27['status'](_0x3dc340)[_0x308e('0xf')](_0x195948);}};}function respondWithFilteredResult(_0x20d0b7,_0x38bd23){return function(_0x4852b1){if(_0x4852b1){var _0x40fa89=typeof _0x38bd23['offset']==='undefined'&&typeof _0x38bd23[_0x308e('0x10')]===_0x308e('0x11');var _0x1d0b3f=_0x4852b1[_0x308e('0x12')];var _0x12bdf1=_0x40fa89?0x0:_0x38bd23[_0x308e('0x13')];var _0x4a1569=_0x40fa89?_0x4852b1[_0x308e('0x12')]:_0x38bd23['offset']+_0x38bd23[_0x308e('0x10')];var _0x57f313;if(_0x4a1569>=_0x1d0b3f){_0x4a1569=_0x1d0b3f;_0x57f313=0xc8;}else{_0x57f313=0xce;}_0x20d0b7[_0x308e('0x14')](_0x57f313);return _0x20d0b7[_0x308e('0x15')]('Content-Range',_0x12bdf1+'-'+_0x4a1569+'/'+_0x1d0b3f)['json'](_0x4852b1);}return null;};}function saveUpdates(_0x3ccd55){return function(_0x74d46){if(_0x74d46){return _0x74d46[_0x308e('0x16')](_0x3ccd55)[_0x308e('0x17')](function(_0x137b18){return _0x137b18;});}return null;};}function removeEntity(_0x250910){return function(_0x299978){if(_0x299978){return _0x299978[_0x308e('0x18')]()[_0x308e('0x17')](function(){_0x250910[_0x308e('0x14')](0xcc)[_0x308e('0x19')]();});}};}function handleEntityNotFound(_0x4c3904){return function(_0x2b78c7){if(!_0x2b78c7){_0x4c3904[_0x308e('0x1a')](0x194);}return _0x2b78c7;};}function handleError(_0x5ae495,_0x373e50){_0x373e50=_0x373e50||0x1f4;return function(_0x4de37d){logger[_0x308e('0x1b')](_0x4de37d[_0x308e('0x1c')]);if(_0x4de37d[_0x308e('0x1d')]){delete _0x4de37d[_0x308e('0x1d')];}_0x5ae495[_0x308e('0x14')](_0x373e50)[_0x308e('0x1e')](_0x4de37d);};}exports[_0x308e('0x1f')]=function(_0x2e705b,_0x52c81a){var _0x5c3402={},_0x551759={},_0x245ba3={'count':0x0,'rows':[]};return db[_0x308e('0x20')][_0x308e('0x21')]()['then'](function(_0x9fab6e){var _0x186c62=[];for(var _0x4d2420=0x0;_0x4d2420
','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','email','address'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x3864,0xd1));var _0x4386=function(_0xcf74f9,_0x1b6d45){_0xcf74f9=_0xcf74f9-0x0;var _0x51bcc9=_0x3864[_0xcf74f9];return _0x51bcc9;};'use strict';var _=require(_0x4386('0x0'));var moment=require(_0x4386('0x1'));var random=require(_0x4386('0x2'));var fs=require('fs');var path=require(_0x4386('0x3'));var util=require(_0x4386('0x4'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x4386('0x5'));var config=require('../../../config/environment');function getAddress(_0x520d8b){var _0x4c6d30=_['head'](_0x520d8b['value']);return _0x4c6d30&&_0x4c6d30[_0x4386('0x6')]?_0x4c6d30['address']:_0x4386('0x7')+random[_0x4386('0x8')](0x6)+_0x4386('0x9');}function getFirstName(_0x3350b2){var _0x20e285=_['head'](_0x3350b2['value']);if(_0x20e285&&_0x20e285[_0x4386('0xa')]){if(_0x20e285[_0x4386('0xa')]==_0x20e285[_0x4386('0x6')]){return _0x20e285[_0x4386('0xa')][_0x4386('0xb')](0x0,_0x20e285[_0x4386('0xa')][_0x4386('0xc')]('@'));}var _0x89b53b=_0x20e285[_0x4386('0xa')][_0x4386('0xd')](/\s+/);return _0x89b53b[_0x4386('0xe')]>0x1?_0x89b53b[_0x4386('0xf')](0x0,-0x1)[_0x4386('0x10')]('\x20'):_0x20e285[_0x4386('0xa')];}return _0x4386('0x11');}function getLastName(_0x3a7f11){var _0x2bd9f6=_[_0x4386('0x12')](_0x3a7f11[_0x4386('0x13')]);if(_0x2bd9f6&&_0x2bd9f6[_0x4386('0xa')]){var _0x3705c3=_0x2bd9f6['name']['split'](/\s+/);return _0x3705c3[_0x4386('0xe')]>0x1?_0x3705c3[_0x4386('0x14')]():'';}return'';}function getMails(_0x504865,_0x45c7b3){var _0xd5c388='';for(var _0x770fb6=0x0;_0x770fb6<_0x45c7b3[_0x4386('0x13')][_0x4386('0xe')];_0x770fb6+=0x1){if(_0x45c7b3[_0x4386('0x13')][_0x770fb6][_0x4386('0x6')]!==_0x504865){if(!_[_0x4386('0x15')](_0xd5c388)){_0xd5c388+=',';}_0xd5c388+=_0x45c7b3['value'][_0x770fb6]['name']||_0x45c7b3[_0x4386('0x13')][_0x770fb6][_0x4386('0x6')]||'';_0xd5c388+='\x20<';_0xd5c388+=_0x45c7b3[_0x4386('0x13')][_0x770fb6][_0x4386('0x6')]?_0x45c7b3['value'][_0x770fb6][_0x4386('0x6')]:_0x4386('0x7')+random['generate'](0x6)+_0x4386('0x9');_0xd5c388+='>';}}return _0xd5c388;}function parseEmail(_0x31490e,_0x4d4593,_0x2337db){if(_0x4d4593[_0x4386('0x16')]){var _0x2437a1=/