From: Andrea Amorese
Date: Thu, 25 Nov 2021 09:35:20 +0000 (+0100)
Subject: Built motion from commit 53978783.|2.5.39
X-Git-Url: http://repos.xcallymotion.com/base//%22api/fax/attachments/%7B%7BfaxAttachment.id%7D%7D/%22?a=commitdiff_plain;h=8f1e5b8e3ef90a951371620736d3392ddeeb5040;p=motion2.git
Built motion from commit 53978783.|2.5.39
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index d81f83a..d18c0ca 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-24T15:31:57.052Z",
+ "time": "2021-11-25T09:21:10.797Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 055b9aa..84f4a8f 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-24T15:31:57.052Z",
+ "time": "2021-11-25T09:21:10.797Z",
"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 17baaf3..bd628e5 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 _0x59b0=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','urlForward'];(function(_0x3f6565,_0x12a8bb){var _0x4abd23=function(_0x56dce7){while(--_0x56dce7){_0x3f6565['push'](_0x3f6565['shift']());}};_0x4abd23(++_0x12a8bb);}(_0x59b0,0x188));var _0x059b=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x59b0[_0x4314d7];return _0x5c599b;};'use strict';var Sequelize=require(_0x059b('0x0'));module['exports']={'name':{'type':Sequelize[_0x059b('0x1')],'get':function(_0x517c2c){return this[_0x059b('0x2')](_0x059b('0x3'));}},'action':{'type':Sequelize[_0x059b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x059b('0x5'),'integration',_0x059b('0x6'),'jscripty',_0x059b('0x7'),_0x059b('0x8'),_0x059b('0x9'),_0x059b('0xa')]],'msg':_0x059b('0xb')}},'comment':_0x059b('0xb')},'data1':{'type':Sequelize[_0x059b('0x4')](0x1000),'comment':_0x059b('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x059b('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x059b('0xe')},'data4':{'type':Sequelize[_0x059b('0x4')](0x1000),'comments':_0x059b('0xf')},'data5':{'type':Sequelize[_0x059b('0x4')](0x1000),'comments':_0x059b('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0x059b('0x11')},'data7':{'type':Sequelize[_0x059b('0x12')],'comments':_0x059b('0x13')}};
\ No newline at end of file
+var _0x54b2=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','urlForward','browser','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x54b2,0x6e));var _0x254b=function(_0x450dd0,_0x29c7aa){_0x450dd0=_0x450dd0-0x0;var _0x3b8712=_0x54b2[_0x450dd0];return _0x3b8712;};'use strict';var Sequelize=require(_0x254b('0x0'));module['exports']={'name':{'type':Sequelize[_0x254b('0x1')],'get':function(_0x418dfa){return this[_0x254b('0x2')](_0x254b('0x3'));}},'action':{'type':Sequelize[_0x254b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x254b('0x5'),_0x254b('0x6'),_0x254b('0x7'),_0x254b('0x8'),_0x254b('0x9'),'bot',_0x254b('0xa')]],'msg':_0x254b('0xb')}},'comment':_0x254b('0xb')},'data1':{'type':Sequelize[_0x254b('0x4')](0x1000),'comment':_0x254b('0xc')},'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[_0x254b('0x4')](0x1000),'comment':_0x254b('0xd')},'data4':{'type':Sequelize[_0x254b('0x4')](0x1000),'comments':_0x254b('0xe')},'data5':{'type':Sequelize[_0x254b('0x4')](0x1000),'comments':_0x254b('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x254b('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x254b('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index d71bb5f..ca5a1d0 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 _0x3bf1=['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','error','stack','name','send','body','find','params','Action','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5073fe,_0x278fdf){var _0x7e7638=function(_0x364f81){while(--_0x364f81){_0x5073fe['push'](_0x5073fe['shift']());}};_0x7e7638(++_0x278fdf);}(_0x3bf1,0x17c));var _0x13bf=function(_0x42ce2b,_0xa55246){_0x42ce2b=_0x42ce2b-0x0;var _0x4fe361=_0x3bf1[_0x42ce2b];return _0x4fe361;};'use strict';var emlformat=require(_0x13bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13bf('0x2'));var moment=require(_0x13bf('0x3'));var BPromise=require(_0x13bf('0x4'));var Mustache=require(_0x13bf('0x5'));var util=require(_0x13bf('0x6'));var path=require(_0x13bf('0x7'));var sox=require(_0x13bf('0x8'));var csv=require(_0x13bf('0x9'));var ejs=require(_0x13bf('0xa'));var fs=require('fs');var fs_extra=require(_0x13bf('0xb'));var _=require(_0x13bf('0xc'));var squel=require(_0x13bf('0xd'));var crypto=require(_0x13bf('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x13bf('0x9'));var querystring=require(_0x13bf('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x13bf('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x13bf('0x11'));var hardwareService=require(_0x13bf('0x12'));var logger=require(_0x13bf('0x13'))(_0x13bf('0x14'));var utils=require(_0x13bf('0x15'));var config=require(_0x13bf('0x16'));var licenseUtil=require(_0x13bf('0x17'));var db=require(_0x13bf('0x18'))['db'];function respondWithStatusCode(_0x40e34a,_0x21a319){_0x21a319=_0x21a319||0xcc;return function(_0x478857){if(_0x478857){return _0x40e34a[_0x13bf('0x19')](_0x21a319);}return _0x40e34a[_0x13bf('0x1a')](_0x21a319)[_0x13bf('0x1b')]();};}function respondWithResult(_0x3acafb,_0x31ba1a){_0x31ba1a=_0x31ba1a||0xc8;return function(_0x269bc7){if(_0x269bc7){return _0x3acafb[_0x13bf('0x1a')](_0x31ba1a)[_0x13bf('0x1c')](_0x269bc7);}};}function respondWithFilteredResult(_0x7c91e1,_0x371c76){return function(_0x2feaed){if(_0x2feaed){var _0x251150=typeof _0x371c76[_0x13bf('0x1d')]===_0x13bf('0x1e')&&typeof _0x371c76[_0x13bf('0x1f')]===_0x13bf('0x1e');var _0x4b7aec=_0x2feaed[_0x13bf('0x20')];var _0x2d8608=_0x251150?0x0:_0x371c76['offset'];var _0x3e5345=_0x251150?_0x2feaed['count']:_0x371c76[_0x13bf('0x1d')]+_0x371c76['limit'];var _0x3fa61a;if(_0x3e5345>=_0x4b7aec){_0x3e5345=_0x4b7aec;_0x3fa61a=0xc8;}else{_0x3fa61a=0xce;}_0x7c91e1[_0x13bf('0x1a')](_0x3fa61a);return _0x7c91e1[_0x13bf('0x21')](_0x13bf('0x22'),_0x2d8608+'-'+_0x3e5345+'/'+_0x4b7aec)[_0x13bf('0x1c')](_0x2feaed);}return null;};}function patchUpdates(_0x5c4806){return function(_0x205e40){try{jsonpatch[_0x13bf('0x23')](_0x205e40,_0x5c4806,!![]);}catch(_0x29113d){return BPromise[_0x13bf('0x24')](_0x29113d);}return _0x205e40[_0x13bf('0x25')]();};}function saveUpdates(_0x2aaf4e,_0x42967c){return function(_0x54e7d6){if(_0x54e7d6){return _0x54e7d6[_0x13bf('0x26')](_0x2aaf4e)[_0x13bf('0x27')](function(_0x520bd7){return _0x520bd7;});}return null;};}function removeEntity(_0x40ea66,_0x4b9ac4){return function(_0x59f01b){if(_0x59f01b){return _0x59f01b[_0x13bf('0x28')]()[_0x13bf('0x27')](function(){_0x40ea66[_0x13bf('0x1a')](0xcc)[_0x13bf('0x1b')]();});}};}function handleEntityNotFound(_0xc8aed7,_0x13fc2c){return function(_0x336c7c){if(!_0x336c7c){_0xc8aed7[_0x13bf('0x19')](0x194);}return _0x336c7c;};}function handleError(_0x327428,_0x1eb877){_0x1eb877=_0x1eb877||0x1f4;return function(_0x4ce5a8){logger[_0x13bf('0x29')](_0x4ce5a8[_0x13bf('0x2a')]);if(_0x4ce5a8[_0x13bf('0x2b')]){delete _0x4ce5a8['name'];}_0x327428[_0x13bf('0x1a')](_0x1eb877)[_0x13bf('0x2c')](_0x4ce5a8);};}exports[_0x13bf('0x26')]=function(_0x4793dd,_0x4bde79){if(_0x4793dd['body']['id']){delete _0x4793dd[_0x13bf('0x2d')]['id'];}return db['Action'][_0x13bf('0x2e')]({'where':{'id':_0x4793dd[_0x13bf('0x2f')]['id']}})[_0x13bf('0x27')](handleEntityNotFound(_0x4bde79,null))[_0x13bf('0x27')](saveUpdates(_0x4793dd[_0x13bf('0x2d')],null))['then'](respondWithResult(_0x4bde79,null))['catch'](handleError(_0x4bde79,null));};exports['destroy']=function(_0x25a5b1,_0x1b0135){return db[_0x13bf('0x30')][_0x13bf('0x2e')]({'where':{'id':_0x25a5b1[_0x13bf('0x2f')]['id']}})[_0x13bf('0x27')](handleEntityNotFound(_0x1b0135,null))[_0x13bf('0x27')](removeEntity(_0x1b0135,null))[_0x13bf('0x31')](handleError(_0x1b0135,null));};
\ No newline at end of file
+var _0xd793=['body','Action','find','params','catch','destroy','rimraf','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send'];(function(_0x24eaaa,_0x2aa0bc){var _0x25f160=function(_0xfca29f){while(--_0xfca29f){_0x24eaaa['push'](_0x24eaaa['shift']());}};_0x25f160(++_0x2aa0bc);}(_0xd793,0x1f0));var _0x3d79=function(_0x56ef7f,_0x327af8){_0x56ef7f=_0x56ef7f-0x0;var _0x24b910=_0xd793[_0x56ef7f];return _0x24b910;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3d79('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3d79('0x2'));var path=require(_0x3d79('0x3'));var sox=require(_0x3d79('0x4'));var csv=require('to-csv');var ejs=require(_0x3d79('0x5'));var fs=require('fs');var fs_extra=require(_0x3d79('0x6'));var _=require(_0x3d79('0x7'));var squel=require(_0x3d79('0x8'));var crypto=require(_0x3d79('0x9'));var jsforce=require(_0x3d79('0xa'));var deskjs=require(_0x3d79('0xb'));var toCsv=require(_0x3d79('0xc'));var querystring=require(_0x3d79('0xd'));var Papa=require(_0x3d79('0xe'));var Redis=require(_0x3d79('0xf'));var authService=require(_0x3d79('0x10'));var qs=require(_0x3d79('0x11'));var as=require(_0x3d79('0x12'));var hardwareService=require(_0x3d79('0x13'));var logger=require(_0x3d79('0x14'))('api');var utils=require(_0x3d79('0x15'));var config=require(_0x3d79('0x16'));var licenseUtil=require(_0x3d79('0x17'));var db=require(_0x3d79('0x18'))['db'];function respondWithStatusCode(_0x5b8a38,_0x384fd0){_0x384fd0=_0x384fd0||0xcc;return function(_0x196a94){if(_0x196a94){return _0x5b8a38['sendStatus'](_0x384fd0);}return _0x5b8a38[_0x3d79('0x19')](_0x384fd0)[_0x3d79('0x1a')]();};}function respondWithResult(_0x27df7e,_0x1a49c2){_0x1a49c2=_0x1a49c2||0xc8;return function(_0x5d34f4){if(_0x5d34f4){return _0x27df7e['status'](_0x1a49c2)['json'](_0x5d34f4);}};}function respondWithFilteredResult(_0x23dcf5,_0x7d951e){return function(_0x24ce61){if(_0x24ce61){var _0x202a88=typeof _0x7d951e[_0x3d79('0x1b')]==='undefined'&&typeof _0x7d951e[_0x3d79('0x1c')]===_0x3d79('0x1d');var _0x238223=_0x24ce61['count'];var _0xfa9e33=_0x202a88?0x0:_0x7d951e[_0x3d79('0x1b')];var _0x61791d=_0x202a88?_0x24ce61[_0x3d79('0x1e')]:_0x7d951e[_0x3d79('0x1b')]+_0x7d951e[_0x3d79('0x1c')];var _0x3101a0;if(_0x61791d>=_0x238223){_0x61791d=_0x238223;_0x3101a0=0xc8;}else{_0x3101a0=0xce;}_0x23dcf5[_0x3d79('0x19')](_0x3101a0);return _0x23dcf5[_0x3d79('0x1f')](_0x3d79('0x20'),_0xfa9e33+'-'+_0x61791d+'/'+_0x238223)[_0x3d79('0x21')](_0x24ce61);}return null;};}function patchUpdates(_0xf96ee){return function(_0x1b50f0){try{jsonpatch[_0x3d79('0x22')](_0x1b50f0,_0xf96ee,!![]);}catch(_0x526bfe){return BPromise['reject'](_0x526bfe);}return _0x1b50f0[_0x3d79('0x23')]();};}function saveUpdates(_0x5e6b46,_0x18fcaa){return function(_0xc02edf){if(_0xc02edf){return _0xc02edf[_0x3d79('0x24')](_0x5e6b46)[_0x3d79('0x25')](function(_0x4c841a){return _0x4c841a;});}return null;};}function removeEntity(_0x28e487,_0x1388b1){return function(_0x289da4){if(_0x289da4){return _0x289da4['destroy']()[_0x3d79('0x25')](function(){_0x28e487[_0x3d79('0x19')](0xcc)[_0x3d79('0x1a')]();});}};}function handleEntityNotFound(_0xaeec07,_0x1f62c9){return function(_0x218b43){if(!_0x218b43){_0xaeec07[_0x3d79('0x26')](0x194);}return _0x218b43;};}function handleError(_0x5ad36a,_0x220e67){_0x220e67=_0x220e67||0x1f4;return function(_0x5ef5d2){logger[_0x3d79('0x27')](_0x5ef5d2[_0x3d79('0x28')]);if(_0x5ef5d2[_0x3d79('0x29')]){delete _0x5ef5d2[_0x3d79('0x29')];}_0x5ad36a['status'](_0x220e67)[_0x3d79('0x2a')](_0x5ef5d2);};}exports[_0x3d79('0x24')]=function(_0x508bab,_0x20bbb0){if(_0x508bab[_0x3d79('0x2b')]['id']){delete _0x508bab['body']['id'];}return db[_0x3d79('0x2c')][_0x3d79('0x2d')]({'where':{'id':_0x508bab[_0x3d79('0x2e')]['id']}})['then'](handleEntityNotFound(_0x20bbb0,null))['then'](saveUpdates(_0x508bab[_0x3d79('0x2b')],null))['then'](respondWithResult(_0x20bbb0,null))[_0x3d79('0x2f')](handleError(_0x20bbb0,null));};exports[_0x3d79('0x30')]=function(_0x14f0cf,_0x4491c1){return db['Action'][_0x3d79('0x2d')]({'where':{'id':_0x14f0cf[_0x3d79('0x2e')]['id']}})[_0x3d79('0x25')](handleEntityNotFound(_0x4491c1,null))[_0x3d79('0x25')](removeEntity(_0x4491c1,null))[_0x3d79('0x2f')](handleError(_0x4491c1,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index ebac93e..ef085a4 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 _0x0b6b=['request-promise','path','rimraf','../../config/environment','exports','define','tools_actions','lodash','../../config/logger','api','moment'];(function(_0x2034e2,_0x3a13b5){var _0x4dca78=function(_0x24f493){while(--_0x24f493){_0x2034e2['push'](_0x2034e2['shift']());}};_0x4dca78(++_0x3a13b5);}(_0x0b6b,0x125));var _0xb0b6=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0x0b6b[_0xb3b452];return _0x238983;};'use strict';var _=require(_0xb0b6('0x0'));var util=require('util');var logger=require(_0xb0b6('0x1'))(_0xb0b6('0x2'));var moment=require(_0xb0b6('0x3'));var BPromise=require('bluebird');var rp=require(_0xb0b6('0x4'));var fs=require('fs');var path=require(_0xb0b6('0x5'));var rimraf=require(_0xb0b6('0x6'));var config=require(_0xb0b6('0x7'));var attributes=require('./action.attributes');module[_0xb0b6('0x8')]=function(_0x43f31d,_0x1477ff){return _0x43f31d[_0xb0b6('0x9')]('Action',attributes,{'tableName':_0xb0b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2405=['Action','lodash','util','api','moment','bluebird','request-promise','rimraf','./action.attributes','exports'];(function(_0x3c1883,_0x34869a){var _0x972f41=function(_0x3777f5){while(--_0x3777f5){_0x3c1883['push'](_0x3c1883['shift']());}};_0x972f41(++_0x34869a);}(_0x2405,0x173));var _0x5240=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x2405[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0x5240('0x0'));var util=require(_0x5240('0x1'));var logger=require('../../config/logger')(_0x5240('0x2'));var moment=require(_0x5240('0x3'));var BPromise=require(_0x5240('0x4'));var rp=require(_0x5240('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5240('0x6'));var config=require('../../config/environment');var attributes=require(_0x5240('0x7'));module[_0x5240('0x8')]=function(_0x2bac60,_0x8d0e5a){return _0x2bac60['define'](_0x5240('0x9'),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 9e865a9..8564657 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x434ce6,_0x4a1e8d){var _0x3ac61e=function(_0x3cf2b1){while(--_0x3cf2b1){_0x434ce6['push'](_0x434ce6['shift']());}};_0x3ac61e(++_0x4a1e8d);}(_0x326f,0xd1));var _0xf326=function(_0x46e880,_0x1ff896){_0x46e880=_0x46e880-0x0;var _0xef8636=_0x326f[_0x46e880];return _0xef8636;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1690b6,_0x1b6717){var _0x15f107=function(_0x495147){while(--_0x495147){_0x1690b6['push'](_0x1690b6['shift']());}};_0x15f107(++_0x1b6717);}(_0x326f,0xd1));var _0xf326=function(_0x4e5dce,_0x34981f){_0x4e5dce=_0x4e5dce-0x0;var _0x3bd624=_0x326f[_0x4e5dce];return _0x3bd624;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 3155628..97bd027 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 _0x8b78=['Router','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b78,0x183));var _0x88b7=function(_0x5934e6,_0x50fb76){_0x5934e6=_0x5934e6-0x0;var _0xef6993=_0x8b78[_0x5934e6];return _0xef6993;};'use strict';var multer=require(_0x88b7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x88b7('0x1'));var express=require(_0x88b7('0x2'));var router=express[_0x88b7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x88b7('0x4'));var interaction=require(_0x88b7('0x5'));var config=require('../../config/environment');var controller=require(_0x88b7('0x6'));router[_0x88b7('0x7')](_0x88b7('0x8'),auth[_0x88b7('0x9')](),controller['update']);router[_0x88b7('0xa')](_0x88b7('0x8'),auth[_0x88b7('0x9')](),controller[_0x88b7('0xb')]);module[_0x88b7('0xc')]=router;
\ No newline at end of file
+var _0x4c53=['isAuthenticated','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id'];(function(_0x366c9c,_0x38de3a){var _0x14a683=function(_0x34e95f){while(--_0x34e95f){_0x366c9c['push'](_0x366c9c['shift']());}};_0x14a683(++_0x38de3a);}(_0x4c53,0xab));var _0x34c5=function(_0x1b21be,_0x2ccf31){_0x1b21be=_0x1b21be-0x0;var _0x29002a=_0x4c53[_0x1b21be];return _0x29002a;};'use strict';var multer=require(_0x34c5('0x0'));var util=require(_0x34c5('0x1'));var path=require(_0x34c5('0x2'));var timeout=require('connect-timeout');var express=require(_0x34c5('0x3'));var router=express[_0x34c5('0x4')]();var fs_extra=require(_0x34c5('0x5'));var auth=require(_0x34c5('0x6'));var interaction=require(_0x34c5('0x7'));var config=require('../../config/environment');var controller=require(_0x34c5('0x8'));router[_0x34c5('0x9')](_0x34c5('0xa'),auth[_0x34c5('0xb')](),controller['update']);router['delete'](_0x34c5('0xa'),auth[_0x34c5('0xb')](),controller[_0x34c5('0xc')]);module[_0x34c5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 9015936..be9737b 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 _0x7fbe=['STRING','TEXT'];(function(_0x4362c4,_0x57b51f){var _0x4e2876=function(_0x208a59){while(--_0x208a59){_0x4362c4['push'](_0x4362c4['shift']());}};_0x4e2876(++_0x57b51f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x49adfd,_0x136735){_0x49adfd=_0x49adfd-0x0;var _0x518e53=_0x7fbe[_0x49adfd];return _0x518e53;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}};
\ No newline at end of file
+var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x33fd6b,_0x2068fc){var _0x5bacb9=function(_0x1975bf){while(--_0x1975bf){_0x33fd6b['push'](_0x33fd6b['shift']());}};_0x5bacb9(++_0x2068fc);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x2a6b5c,_0x3631cd){_0x2a6b5c=_0x2a6b5c-0x0;var _0x2284a9=_0x9c5a[_0x2a6b5c];return _0x2284a9;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 21316cc..6eb77bf 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 _0x01bd=['hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','rows','show','params','keys','fields','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','parse','joins','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','Sequelize','%s.%s\x20=\x20%s.%s','clone','output','web','%s-%s.%s','randomstring','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','COUNT(*)','run','SUM(%s)','COUNT(DISTINCT\x20%s)','ROUND(%s)','IS\x20NOT\x20NULL','metric','alias','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length'];(function(_0x4583d0,_0x24551f){var _0x7b3c5a=function(_0x14946a){while(--_0x14946a){_0x4583d0['push'](_0x4583d0['shift']());}};_0x7b3c5a(++_0x24551f);}(_0x01bd,0x1aa));var _0xd01b=function(_0x5657fa,_0x1edcfe){_0x5657fa=_0x5657fa-0x0;var _0x5a799e=_0x01bd[_0x5657fa];return _0x5a799e;};'use strict';var emlformat=require(_0xd01b('0x0'));var rimraf=require(_0xd01b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd01b('0x2'));var rp=require(_0xd01b('0x3'));var moment=require(_0xd01b('0x4'));var BPromise=require(_0xd01b('0x5'));var Mustache=require('mustache');var util=require(_0xd01b('0x6'));var path=require(_0xd01b('0x7'));var sox=require(_0xd01b('0x8'));var csv=require('to-csv');var ejs=require(_0xd01b('0x9'));var fs=require('fs');var fs_extra=require(_0xd01b('0xa'));var _=require('lodash');var squel=require(_0xd01b('0xb'));var crypto=require(_0xd01b('0xc'));var jsforce=require(_0xd01b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd01b('0xe'));var querystring=require(_0xd01b('0xf'));var Papa=require(_0xd01b('0x10'));var Redis=require(_0xd01b('0x11'));var authService=require(_0xd01b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd01b('0x13'));var logger=require(_0xd01b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd01b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd01b('0x16'))['db'];var dbH=require(_0xd01b('0x16'))[_0xd01b('0x17')];function respondWithStatusCode(_0x51b746,_0x45a45a){_0x45a45a=_0x45a45a||0xcc;return function(_0x1d6015){if(_0x1d6015){return _0x51b746[_0xd01b('0x18')](_0x45a45a);}return _0x51b746[_0xd01b('0x19')](_0x45a45a)[_0xd01b('0x1a')]();};}function respondWithResult(_0x481203,_0x19b306){_0x19b306=_0x19b306||0xc8;return function(_0x19349c){if(_0x19349c){return _0x481203[_0xd01b('0x19')](_0x19b306)[_0xd01b('0x1b')](_0x19349c);}};}function respondWithFilteredResult(_0x154125,_0x3f6e7c){return function(_0x11639a){if(_0x11639a){var _0x147ca3=typeof _0x3f6e7c[_0xd01b('0x1c')]==='undefined'&&typeof _0x3f6e7c[_0xd01b('0x1d')]==='undefined';var _0x972f45=_0x11639a[_0xd01b('0x1e')];var _0x6d92a0=_0x147ca3?0x0:_0x3f6e7c[_0xd01b('0x1c')];var _0x5ea4be=_0x147ca3?_0x11639a['count']:_0x3f6e7c[_0xd01b('0x1c')]+_0x3f6e7c[_0xd01b('0x1d')];var _0x57f654;if(_0x5ea4be>=_0x972f45){_0x5ea4be=_0x972f45;_0x57f654=0xc8;}else{_0x57f654=0xce;}_0x154125[_0xd01b('0x19')](_0x57f654);return _0x154125[_0xd01b('0x1f')](_0xd01b('0x20'),_0x6d92a0+'-'+_0x5ea4be+'/'+_0x972f45)[_0xd01b('0x1b')](_0x11639a);}return null;};}function patchUpdates(_0xf908b7){return function(_0x32bfab){try{jsonpatch['apply'](_0x32bfab,_0xf908b7,!![]);}catch(_0x1bd00a){return BPromise[_0xd01b('0x21')](_0x1bd00a);}return _0x32bfab[_0xd01b('0x22')]();};}function saveUpdates(_0x2a6ad7,_0x2174ed){return function(_0xdc24d3){if(_0xdc24d3){return _0xdc24d3['update'](_0x2a6ad7)[_0xd01b('0x23')](function(_0x4fc7d0){return _0x4fc7d0;});}return null;};}function removeEntity(_0x1498a4,_0x5b925c){return function(_0x96b132){if(_0x96b132){return _0x96b132[_0xd01b('0x24')]()['then'](function(){var _0x1cbb7f=_0x96b132['get']({'plain':!![]});var _0x2fe4b5='CustomReports';return db[_0xd01b('0x25')][_0xd01b('0x24')]({'where':{'type':_0x2fe4b5,'resourceId':_0x1cbb7f['id']}})[_0xd01b('0x23')](function(){return _0x96b132;});})[_0xd01b('0x23')](function(){_0x1498a4[_0xd01b('0x19')](0xcc)[_0xd01b('0x1a')]();});}};}function handleEntityNotFound(_0x337db6,_0x3b4c42){return function(_0x231e8a){if(!_0x231e8a){_0x337db6[_0xd01b('0x18')](0x194);}return _0x231e8a;};}function handleError(_0x4ecd99,_0x1e5546){_0x1e5546=_0x1e5546||0x1f4;return function(_0x1a0435){logger['error'](_0x1a0435[_0xd01b('0x26')]);if(_0x1a0435[_0xd01b('0x27')]){delete _0x1a0435['name'];}_0x4ecd99[_0xd01b('0x19')](_0x1e5546)[_0xd01b('0x28')](_0x1a0435);};}exports[_0xd01b('0x29')]=function(_0x34efe2,_0x5680e1){var _0x5626f4={},_0xf26526={},_0x4e37e6={'count':0x0,'rows':[]};var _0x3912bb=_[_0xd01b('0x2a')](db[_0xd01b('0x2b')][_0xd01b('0x2c')],function(_0x3f852b){return{'name':_0x3f852b[_0xd01b('0x2d')],'type':_0x3f852b[_0xd01b('0x2e')][_0xd01b('0x2f')]};});_0xf26526[_0xd01b('0x30')]=_[_0xd01b('0x2a')](_0x3912bb,_0xd01b('0x27'));_0xf26526[_0xd01b('0x31')]=_['keys'](_0x34efe2[_0xd01b('0x31')]);_0xf26526[_0xd01b('0x32')]=_[_0xd01b('0x33')](_0xf26526[_0xd01b('0x30')],_0xf26526['query']);_0x5626f4[_0xd01b('0x34')]=_[_0xd01b('0x33')](_0xf26526[_0xd01b('0x30')],qs['fields'](_0x34efe2['query']['fields']));_0x5626f4[_0xd01b('0x34')]=_0x5626f4['attributes'][_0xd01b('0x35')]?_0x5626f4[_0xd01b('0x34')]:_0xf26526[_0xd01b('0x30')];if(!_0x34efe2[_0xd01b('0x31')][_0xd01b('0x36')](_0xd01b('0x37'))){_0x5626f4['limit']=qs[_0xd01b('0x1d')](_0x34efe2[_0xd01b('0x31')][_0xd01b('0x1d')]);_0x5626f4[_0xd01b('0x1c')]=qs[_0xd01b('0x1c')](_0x34efe2['query'][_0xd01b('0x1c')]);}_0x5626f4[_0xd01b('0x38')]=qs['sort'](_0x34efe2['query'][_0xd01b('0x39')]);_0x5626f4['where']=qs['filters'](_[_0xd01b('0x3a')](_0x34efe2[_0xd01b('0x31')],_0xf26526[_0xd01b('0x32')]),_0x3912bb);if(_0x34efe2[_0xd01b('0x31')][_0xd01b('0x3b')]){_0x5626f4['where']=_[_0xd01b('0x3c')](_0x5626f4[_0xd01b('0x3d')],{'$or':_[_0xd01b('0x2a')](_0x3912bb,function(_0x3dc6a0){if(_0x3dc6a0[_0xd01b('0x2e')]!=='VIRTUAL'){var _0x4aae57={};_0x4aae57[_0x3dc6a0[_0xd01b('0x27')]]={'$like':'%'+_0x34efe2[_0xd01b('0x31')][_0xd01b('0x3b')]+'%'};return _0x4aae57;}})});}_0x5626f4=_['merge']({},_0x5626f4,_0x34efe2[_0xd01b('0x3e')]);var _0x29a5d7={'where':_0x5626f4[_0xd01b('0x3d')]};return db['AnalyticCustomReport']['count'](_0x29a5d7)[_0xd01b('0x23')](function(_0x16c022){_0x4e37e6[_0xd01b('0x1e')]=_0x16c022;if(_0x34efe2['query'][_0xd01b('0x3f')]){_0x5626f4['include']=[{'all':!![]}];}return db[_0xd01b('0x2b')]['findAll'](_0x5626f4);})[_0xd01b('0x23')](function(_0x27e290){_0x4e37e6[_0xd01b('0x40')]=_0x27e290;return _0x4e37e6;})[_0xd01b('0x23')](respondWithFilteredResult(_0x5680e1,_0x5626f4))['catch'](handleError(_0x5680e1,null));};exports[_0xd01b('0x41')]=function(_0x4fb64c,_0x4dc53b){var _0xfc7d7a={'raw':![],'where':{'id':_0x4fb64c[_0xd01b('0x42')]['id']}},_0x3b46ed={};_0x3b46ed[_0xd01b('0x30')]=_[_0xd01b('0x43')](db['AnalyticCustomReport'][_0xd01b('0x2c')]);_0x3b46ed['query']=_[_0xd01b('0x43')](_0x4fb64c[_0xd01b('0x31')]);_0x3b46ed['filters']=_[_0xd01b('0x33')](_0x3b46ed[_0xd01b('0x30')],_0x3b46ed[_0xd01b('0x31')]);_0xfc7d7a['attributes']=_[_0xd01b('0x33')](_0x3b46ed[_0xd01b('0x30')],qs[_0xd01b('0x44')](_0x4fb64c[_0xd01b('0x31')][_0xd01b('0x44')]));_0xfc7d7a[_0xd01b('0x34')]=_0xfc7d7a[_0xd01b('0x34')][_0xd01b('0x35')]?_0xfc7d7a[_0xd01b('0x34')]:_0x3b46ed['model'];if(_0x4fb64c[_0xd01b('0x31')][_0xd01b('0x3f')]){_0xfc7d7a[_0xd01b('0x45')]=[{'all':!![]}];}_0xfc7d7a=_['merge']({},_0xfc7d7a,_0x4fb64c['options']);return db[_0xd01b('0x2b')][_0xd01b('0x46')](_0xfc7d7a)[_0xd01b('0x23')](handleEntityNotFound(_0x4dc53b,null))[_0xd01b('0x23')](respondWithResult(_0x4dc53b,null))[_0xd01b('0x47')](handleError(_0x4dc53b,null));};exports[_0xd01b('0x48')]=function(_0x21810b,_0x26a499){return db['AnalyticCustomReport'][_0xd01b('0x48')](_0x21810b[_0xd01b('0x49')],{})[_0xd01b('0x23')](function(_0x161b4e){var _0x4a770c=_0x21810b['user']['get']({'plain':!![]});if(!_0x4a770c)throw new Error(_0xd01b('0x4a'));if(_0x4a770c['role']===_0xd01b('0x4b')){var _0x27789d=_0x161b4e[_0xd01b('0x4c')]({'plain':!![]});var _0x36c690='Reports';return db[_0xd01b('0x4d')]['find']({'where':{'name':_0x36c690,'userProfileId':_0x4a770c['userProfileId']},'raw':!![]})['then'](function(_0x3281cf){if(_0x3281cf&&_0x3281cf[_0xd01b('0x4e')]===0x0){return db[_0xd01b('0x25')]['create']({'name':_0x27789d[_0xd01b('0x27')],'resourceId':_0x27789d['id'],'type':'CustomReports','sectionId':_0x3281cf['id']},{})[_0xd01b('0x23')](function(){return _0x161b4e;});}else{return _0x161b4e;}})[_0xd01b('0x47')](function(_0x3a52a6){logger[_0xd01b('0x4f')](_0xd01b('0x50'),_0x3a52a6);throw _0x3a52a6;});}return _0x161b4e;})[_0xd01b('0x23')](respondWithResult(_0x26a499,0xc9))[_0xd01b('0x47')](handleError(_0x26a499,null));};exports['update']=function(_0x48a633,_0x18bb04){if(_0x48a633[_0xd01b('0x49')]['id']){delete _0x48a633[_0xd01b('0x49')]['id'];}return db[_0xd01b('0x2b')][_0xd01b('0x46')]({'where':{'id':_0x48a633['params']['id']}})[_0xd01b('0x23')](handleEntityNotFound(_0x18bb04,null))[_0xd01b('0x23')](saveUpdates(_0x48a633['body'],null))[_0xd01b('0x23')](respondWithResult(_0x18bb04,null))[_0xd01b('0x47')](handleError(_0x18bb04,null));};exports[_0xd01b('0x24')]=function(_0x432a35,_0x3f4ab1){return db[_0xd01b('0x2b')][_0xd01b('0x46')]({'where':{'id':_0x432a35['params']['id']}})[_0xd01b('0x23')](handleEntityNotFound(_0x3f4ab1,null))[_0xd01b('0x23')](removeEntity(_0x3f4ab1,null))[_0xd01b('0x47')](handleError(_0x3f4ab1,null));};exports[_0xd01b('0x51')]=function(_0x2caa88,_0x2c0a35){var _0x1fdbc1=0xa;var _0x36c9f5=[_0xd01b('0x52'),_0xd01b('0x53'),_0xd01b('0x54'),_0xd01b('0x55')];var _0x8ad734={'SUM':'SUM(%s)','COUNT':_0xd01b('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd01b('0x57'),'MIN':_0xd01b('0x58'),'AVG':_0xd01b('0x59'),'GROUP_CONCAT':_0xd01b('0x5a'),'GROUP_CONCAT ASC':_0xd01b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1db70e={'SEC_TO_TIME':_0xd01b('0x5c'),'DATE':_0xd01b('0x5d'),'HOUR':_0xd01b('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd01b('0x5f')};var _0xfd9481=function(_0x37a1ed){return!_[_0xd01b('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xd01b('0x61'),_0xd01b('0x62')],_0x37a1ed);};var _0x5aefca=function(_0x326b78){if(!_0x326b78||!_0x326b78[_0xd01b('0x63')]['length']){return'';}for(var _0x746fd1='(',_0x455f82=0x0;_0x455f82<_0x326b78[_0xd01b('0x63')]['length'];_0x455f82+=0x1){_0x455f82>0x0&&(_0x746fd1+='\x20'+_0x326b78[_0xd01b('0x64')]+'\x20');_0x746fd1+=_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x65')]?_0x5aefca(_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x65')]):_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x66')]+'\x20'+_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x67')]+(_0xfd9481(_0x326b78[_0xd01b('0x63')][_0x455f82][_0xd01b('0x67')])?'\x20'+_0x326b78['rules'][_0x455f82][_0xd01b('0x68')]:'');}return _0x746fd1+')';};var _0x2cb63c={'where':{'id':_0x2caa88[_0xd01b('0x42')]['id']}},_0x29eb2c,_0x10670c,_0x3d4bc6,_0x2edd2f,_0x21e8b4;_0x2cb63c=_[_0xd01b('0x3c')]({},_0x2cb63c,_0x2caa88[_0xd01b('0x3e')]);return db[_0xd01b('0x2b')][_0xd01b('0x46')](_0x2cb63c)[_0xd01b('0x23')](function(_0x22f553){if(_0x22f553){_0x29eb2c=_0x22f553;return _0x22f553[_0xd01b('0x69')]();}return null;})['then'](function(_0x1670b9){if(_0x1670b9){if(!_0x1670b9[_0xd01b('0x35')]){throw new db['Sequelize'][(_0xd01b('0x6a'))](_0xd01b('0x6b'),0x193);}_0x10670c=_0x1670b9;return db[_0xd01b('0x6c')][_0xd01b('0x6d')]({'raw':!![]});}return null;})[_0xd01b('0x23')](function(_0x25efaf){if(_0x25efaf){_0x3d4bc6=_[_0xd01b('0x6e')](_0x25efaf,'id');var _0xffb92d;var _0x3f157f=squel[_0xd01b('0x6f')]();_0x3f157f[_0xd01b('0x70')](_0x29eb2c[_0xd01b('0x71')]);for(var _0x17423f=0x0;_0x17423f<_0x10670c[_0xd01b('0x35')];_0x17423f+=0x1){_0xffb92d=_0x10670c[_0x17423f][_0xd01b('0x72')]?_0x3d4bc6[_0x10670c[_0x17423f][_0xd01b('0x72')]]['metric']:_0x10670c[_0x17423f][_0xd01b('0x66')];_0xffb92d=_0x10670c[_0x17423f][_0xd01b('0x73')]?_[_0xd01b('0x74')](_0x8ad734[_0x10670c[_0x17423f][_0xd01b('0x73')]],'%s',_0xffb92d):_0xffb92d;_0xffb92d=_0x10670c[_0x17423f][_0xd01b('0x75')]?_[_0xd01b('0x74')](_0x1db70e[_0x10670c[_0x17423f][_0xd01b('0x75')]],'%s',_0xffb92d):_0xffb92d;if(_0x10670c[_0x17423f][_0xd01b('0x76')]){_0x3f157f[_0xd01b('0x65')](_0xffb92d);}_0x10670c[_0x17423f][_0xd01b('0x77')]&&_0x3f157f['order'](_0xffb92d,_0x10670c[_0x17423f][_0xd01b('0x77')]===_0xd01b('0x78')?![]:!![]);_0x3f157f['field'](_0xffb92d,_0x10670c[_0x17423f]['alias']||_0xffb92d);}if(_0x29eb2c['joins']){_0x29eb2c['joins']=JSON[_0xd01b('0x79')](_0x29eb2c[_0xd01b('0x7a')]);for(var _0x2123f8=0x0;_0x2123f8<_0x29eb2c[_0xd01b('0x7a')][_0xd01b('0x35')];_0x2123f8+=0x1){if(_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x2e')]&&_[_0xd01b('0x60')](_0x36c9f5,_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x2e')])&&_0x29eb2c['joins'][_0x2123f8][_0xd01b('0x7b')]&&_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x7c')]&&_0x29eb2c['joins'][_0x2123f8][_0xd01b('0x7d')]){_0x3f157f[_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x2e')]](_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x7c')],null,util[_0xd01b('0x75')]('%s.%s\x20=\x20%s.%s',_0x29eb2c[_0xd01b('0x71')],_0x29eb2c['joins'][_0x2123f8][_0xd01b('0x7b')],_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x7c')],_0x29eb2c[_0xd01b('0x7a')][_0x2123f8][_0xd01b('0x7d')]));}}}if(_0x29eb2c[_0xd01b('0x7e')]){_0x29eb2c[_0xd01b('0x7e')]=JSON[_0xd01b('0x79')](_0x29eb2c[_0xd01b('0x7e')]);_0x3f157f[_0xd01b('0x3d')](_0x5aefca(_0x29eb2c[_0xd01b('0x7e')]['group']));}_0x21e8b4=_0x3f157f['clone']();_0x3f157f[_0xd01b('0x1d')](_0x1fdbc1);_0x3f157f[_0xd01b('0x1c')](0x0);logger[_0xd01b('0x7f')](_0xd01b('0x80'),_0x3f157f[_0xd01b('0x81')]());return dbH[_0xd01b('0x82')][_0xd01b('0x31')](_0x3f157f[_0xd01b('0x81')](),{'type':dbH[_0xd01b('0x82')][_0xd01b('0x83')][_0xd01b('0x84')]});}})['then'](respondWithResult(_0x2c0a35,null))['catch'](handleError(_0x2c0a35,null));};function runReport(_0x335dfc,_0x565315,_0x4bfa60){var _0xdc22ef=_0x565315[_0xd01b('0x27')];var _0x20b759=0xa;var _0x130015=[_0xd01b('0x52'),_0xd01b('0x53'),'right_join','cross_join'];var _0x4f0511={'SUM':'SUM(%s)','COUNT':_0xd01b('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd01b('0x57'),'MIN':_0xd01b('0x58'),'AVG':_0xd01b('0x59'),'GROUP_CONCAT':_0xd01b('0x5a'),'GROUP_CONCAT ASC':_0xd01b('0x5b'),'GROUP_CONCAT DESC':_0xd01b('0x85')};var _0x3f8808={'SEC_TO_TIME':_0xd01b('0x5c'),'DATE':'DATE(%s)','HOUR':_0xd01b('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x37bc66=function(_0x381b82){return!_[_0xd01b('0x60')]([_0xd01b('0x86'),'IS\x20NOT\x20NULL',_0xd01b('0x61'),_0xd01b('0x62')],_0x381b82);};var _0x16c6a6=function(_0x534783){if(!_0x534783||!_0x534783[_0xd01b('0x63')][_0xd01b('0x35')]){return'';}for(var _0x5b4185='(',_0xb7d88d=0x0;_0xb7d88d<_0x534783[_0xd01b('0x63')][_0xd01b('0x35')];_0xb7d88d+=0x1){_0xb7d88d>0x0&&(_0x5b4185+='\x20'+_0x534783['operator']+'\x20');_0x5b4185+=_0x534783[_0xd01b('0x63')][_0xb7d88d][_0xd01b('0x65')]?_0x16c6a6(_0x534783[_0xd01b('0x63')][_0xb7d88d][_0xd01b('0x65')]):_0x534783[_0xd01b('0x63')][_0xb7d88d][_0xd01b('0x66')]+'\x20'+_0x534783['rules'][_0xb7d88d][_0xd01b('0x67')]+(_0x37bc66(_0x534783[_0xd01b('0x63')][_0xb7d88d][_0xd01b('0x67')])?'\x20'+_0x534783['rules'][_0xb7d88d][_0xd01b('0x68')]:'');}return _0x5b4185+')';};var _0x47d8cf={'where':{'id':_0x335dfc['id']}},_0x172975,_0x145a18,_0x42b2d4,_0x252521,_0x4d3741;_0x47d8cf=_[_0xd01b('0x3c')]({},_0x47d8cf,_0x4bfa60);return db['AnalyticCustomReport'][_0xd01b('0x46')](_0x47d8cf)[_0xd01b('0x23')](function(_0x24cd1f){if(_0x24cd1f){_0x172975=_0x24cd1f;return _0x24cd1f[_0xd01b('0x69')]();}return null;})[_0xd01b('0x23')](function(_0x222fcf){if(_0x222fcf){if(!_0x222fcf[_0xd01b('0x35')]){throw new db[(_0xd01b('0x87'))][(_0xd01b('0x6a'))](_0xd01b('0x6b'),0x193);}_0x145a18=_0x222fcf;return db[_0xd01b('0x6c')][_0xd01b('0x6d')]({'raw':!![]});}return null;})[_0xd01b('0x23')](function(_0x493dff){if(_0x493dff){_0x42b2d4=_[_0xd01b('0x6e')](_0x493dff,'id');var _0x38fa41;var _0x28393a=squel[_0xd01b('0x6f')]();_0x28393a[_0xd01b('0x70')](_0x172975[_0xd01b('0x71')]);for(var _0x29651c=0x0;_0x29651c<_0x145a18[_0xd01b('0x35')];_0x29651c+=0x1){_0x38fa41=_0x145a18[_0x29651c]['MetricId']?_0x42b2d4[_0x145a18[_0x29651c][_0xd01b('0x72')]]['metric']:_0x145a18[_0x29651c][_0xd01b('0x66')];_0x38fa41=_0x145a18[_0x29651c]['function']?_[_0xd01b('0x74')](_0x4f0511[_0x145a18[_0x29651c]['function']],'%s',_0x38fa41):_0x38fa41;_0x38fa41=_0x145a18[_0x29651c][_0xd01b('0x75')]?_['replace'](_0x3f8808[_0x145a18[_0x29651c][_0xd01b('0x75')]],'%s',_0x38fa41):_0x38fa41;if(_0x145a18[_0x29651c][_0xd01b('0x76')]){_0x28393a['group'](_0x38fa41);}_0x145a18[_0x29651c]['orderBy']&&_0x28393a[_0xd01b('0x38')](_0x38fa41,_0x145a18[_0x29651c][_0xd01b('0x77')]===_0xd01b('0x78')?![]:!![]);_0x28393a[_0xd01b('0x66')](_0x38fa41,_0x145a18[_0x29651c]['alias']||_0x38fa41);}if(_0x172975[_0xd01b('0x7a')]){_0x172975[_0xd01b('0x7a')]=JSON[_0xd01b('0x79')](_0x172975[_0xd01b('0x7a')]);for(var _0x358894=0x0;_0x358894<_0x172975[_0xd01b('0x7a')][_0xd01b('0x35')];_0x358894+=0x1){if(_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x2e')]&&_['includes'](_0x130015,_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x2e')])&&_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7b')]&&_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7c')]&&_0x172975['joins'][_0x358894][_0xd01b('0x7d')]){_0x28393a[_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x2e')]](_0x172975[_0xd01b('0x7a')][_0x358894]['foreignTable'],null,util[_0xd01b('0x75')](_0xd01b('0x88'),_0x172975[_0xd01b('0x71')],_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7b')],_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7c')],_0x172975[_0xd01b('0x7a')][_0x358894][_0xd01b('0x7d')]));}}}if(_0x172975['conditions']){_0x172975[_0xd01b('0x7e')]=JSON[_0xd01b('0x79')](_0x172975[_0xd01b('0x7e')]);_0x28393a[_0xd01b('0x3d')](_0x16c6a6(_0x172975[_0xd01b('0x7e')]['group']));}_0x4d3741=_0x28393a[_0xd01b('0x89')]();_0x28393a[_0xd01b('0x1d')](_0x20b759);_0x28393a[_0xd01b('0x1c')](0x0);return;}})[_0xd01b('0x23')](function(){if(_0x565315[_0xd01b('0x8a')]===_0xd01b('0x8b')){return null;}var _0x21d6d2=_[_0xd01b('0x3c')](_0x565315,{'name':_0x565315['fullPath']||_0x565315[_0xd01b('0x27')]||_0x172975['name'],'basename':_0xdc22ef,'savename':util[_0xd01b('0x75')](_0xd01b('0x8c'),_0x565315[_0xd01b('0x27')]||_0x172975[_0xd01b('0x27')],require(_0xd01b('0x8d'))['generate'](0x4),_0x565315[_0xd01b('0x8a')]||_0xd01b('0x8e')),'reportId':_0x172975['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xd01b('0x48')](_0x21d6d2,{'raw':!![]});})[_0xd01b('0x23')](function(_0x280e89){if(_0x172975[_0xd01b('0x71')]===_0xd01b('0x8f')){_0x4d3741['where'](_0x172975[_0xd01b('0x71')]+_0xd01b('0x90'),_0x565315[_0xd01b('0x91')],_0x565315[_0xd01b('0x92')]);}else{_0x4d3741['where'](_0x172975[_0xd01b('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x565315[_0xd01b('0x91')],_0x565315['endDate']);}if(_0x280e89){logger[_0xd01b('0x93')](_0xd01b('0x94'),_0x4d3741['toString']());require(_0xd01b('0x95'))['fork'](path[_0xd01b('0x52')](__dirname,_0xd01b('0x96'),_0x280e89[_0xd01b('0x8a')]),[_0x280e89['id'],_0x4d3741['toString'](),path[_0xd01b('0x52')](__dirname,_0xd01b('0x97'),_0x280e89['savename']),_0xdc22ef]);return _0x280e89;}else{var _0x4fb4e5=squel[_0xd01b('0x6f')]();_0x4fb4e5[_0xd01b('0x70')]('('+_0x4d3741[_0xd01b('0x81')]()+')','countTable');_0x4fb4e5[_0xd01b('0x66')](_0xd01b('0x98'),_0xd01b('0x1e'));_0x4d3741[_0xd01b('0x1d')](_0x565315[_0xd01b('0x1d')]||_0x20b759);_0x4d3741['offset'](_0x565315[_0xd01b('0x1c')]||0x0);return dbH[_0xd01b('0x82')][_0xd01b('0x31')](_0x4fb4e5['toString'](),{'type':dbH[_0xd01b('0x82')]['QueryTypes'][_0xd01b('0x84')]})['then'](function(_0x412c62){if(!_0x412c62[_0xd01b('0x35')]){_0x252521=0x0;}else{_0x252521=_0x412c62[0x0]['count']||0x0;}return dbH['sequelize'][_0xd01b('0x31')](_0x4d3741[_0xd01b('0x81')](),{'type':dbH[_0xd01b('0x82')][_0xd01b('0x83')][_0xd01b('0x84')]});})[_0xd01b('0x23')](function(_0x24f5be){return{'rows':_0x24f5be||[],'count':_0x252521};});}});}exports[_0xd01b('0x99')]=function(_0x46731d,_0x3ec101){return runReport(_0x46731d[_0xd01b('0x42')],_0x46731d[_0xd01b('0x31')],_0x46731d['options'])['then'](respondWithResult(_0x3ec101,null))[_0xd01b('0x47')](handleError(_0x3ec101,null));};exports['runReport']=runReport;exports[_0xd01b('0x31')]=function(_0x386c99,_0x27ca94){var _0x363bc9=0xa;var _0x4f4c9f=[_0xd01b('0x52'),_0xd01b('0x53'),_0xd01b('0x54'),_0xd01b('0x55')];var _0x4cd237={'SUM':_0xd01b('0x9a'),'COUNT':_0xd01b('0x56'),'COUNT DISTINCT':_0xd01b('0x9b'),'MAX':_0xd01b('0x57'),'MIN':_0xd01b('0x58'),'AVG':_0xd01b('0x59'),'GROUP_CONCAT':_0xd01b('0x5a'),'GROUP_CONCAT ASC':_0xd01b('0x5b'),'GROUP_CONCAT DESC':_0xd01b('0x85')};var _0x29682c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd01b('0x5d'),'HOUR':_0xd01b('0x5e'),'ROUND':_0xd01b('0x9c'),'UNIX_TIMESTAMP':_0xd01b('0x5f')};var _0x1d28b0=function(_0x199320){return!_[_0xd01b('0x60')]([_0xd01b('0x86'),_0xd01b('0x9d'),_0xd01b('0x61'),_0xd01b('0x62')],_0x199320);};var _0x1505b0=function(_0x20f040){if(!_0x20f040||!_0x20f040['rules']['length']){return'';}for(var _0x3e8044='(',_0x20e45b=0x0;_0x20e45b<_0x20f040[_0xd01b('0x63')][_0xd01b('0x35')];_0x20e45b+=0x1){_0x20e45b>0x0&&(_0x3e8044+='\x20'+_0x20f040[_0xd01b('0x64')]+'\x20');_0x3e8044+=_0x20f040[_0xd01b('0x63')][_0x20e45b][_0xd01b('0x65')]?_0x1505b0(_0x20f040[_0xd01b('0x63')][_0x20e45b][_0xd01b('0x65')]):_0x20f040['rules'][_0x20e45b][_0xd01b('0x66')]+'\x20'+_0x20f040[_0xd01b('0x63')][_0x20e45b][_0xd01b('0x67')]+(_0x1d28b0(_0x20f040[_0xd01b('0x63')][_0x20e45b]['condition'])?'\x20'+_0x20f040[_0xd01b('0x63')][_0x20e45b][_0xd01b('0x68')]:'');}return _0x3e8044+')';};var _0x1a0c39={'where':{'id':_0x386c99[_0xd01b('0x42')]['id']}},_0x51202b,_0x53a3e4,_0x5d0d60,_0x331f6b,_0x578f91;_0x1a0c39=_[_0xd01b('0x3c')]({},_0x1a0c39,_0x386c99['options']);return db['AnalyticCustomReport'][_0xd01b('0x46')](_0x1a0c39)['then'](function(_0x3e81c4){if(_0x3e81c4){_0x51202b=_0x3e81c4;return _0x3e81c4['getFields']();}return null;})['then'](function(_0x35b1bf){if(_0x35b1bf){if(!_0x35b1bf['length']){throw new db[(_0xd01b('0x87'))][(_0xd01b('0x6a'))](_0xd01b('0x6b'),0x193);}_0x53a3e4=_0x35b1bf;return db[_0xd01b('0x6c')][_0xd01b('0x6d')]({'raw':!![]});}return null;})['then'](function(_0xcc4f3b){if(_0xcc4f3b){_0x5d0d60=_[_0xd01b('0x6e')](_0xcc4f3b,'id');var _0x28ae4e;var _0x376399=squel[_0xd01b('0x6f')]();_0x376399['from'](_0x51202b['table']);for(var _0xf1eeb0=0x0;_0xf1eeb0<_0x53a3e4[_0xd01b('0x35')];_0xf1eeb0+=0x1){_0x28ae4e=_0x53a3e4[_0xf1eeb0][_0xd01b('0x72')]?_0x5d0d60[_0x53a3e4[_0xf1eeb0][_0xd01b('0x72')]][_0xd01b('0x9e')]:_0x53a3e4[_0xf1eeb0][_0xd01b('0x66')];_0x28ae4e=_0x53a3e4[_0xf1eeb0][_0xd01b('0x73')]?_[_0xd01b('0x74')](_0x4cd237[_0x53a3e4[_0xf1eeb0]['function']],'%s',_0x28ae4e):_0x28ae4e;_0x28ae4e=_0x53a3e4[_0xf1eeb0][_0xd01b('0x75')]?_[_0xd01b('0x74')](_0x29682c[_0x53a3e4[_0xf1eeb0][_0xd01b('0x75')]],'%s',_0x28ae4e):_0x28ae4e;if(_0x53a3e4[_0xf1eeb0][_0xd01b('0x76')]){_0x376399[_0xd01b('0x65')](_0x28ae4e);}_0x53a3e4[_0xf1eeb0]['orderBy']&&_0x376399['order'](_0x28ae4e,_0x53a3e4[_0xf1eeb0][_0xd01b('0x77')]===_0xd01b('0x78')?![]:!![]);_0x376399[_0xd01b('0x66')](_0x28ae4e,_0x53a3e4[_0xf1eeb0][_0xd01b('0x9f')]||_0x28ae4e);}if(_0x51202b[_0xd01b('0x7a')]){_0x51202b[_0xd01b('0x7a')]=JSON[_0xd01b('0x79')](_0x51202b[_0xd01b('0x7a')]);for(var _0x159dfb=0x0;_0x159dfb<_0x51202b[_0xd01b('0x7a')][_0xd01b('0x35')];_0x159dfb+=0x1){if(_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x2e')]&&_[_0xd01b('0x60')](_0x4f4c9f,_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x2e')])&&_0x51202b['joins'][_0x159dfb][_0xd01b('0x7b')]&&_0x51202b['joins'][_0x159dfb]['foreignTable']&&_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x7d')]){_0x376399[_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x2e')]](_0x51202b[_0xd01b('0x7a')][_0x159dfb]['foreignTable'],null,util[_0xd01b('0x75')](_0xd01b('0x88'),_0x51202b[_0xd01b('0x71')],_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x7b')],_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x7c')],_0x51202b[_0xd01b('0x7a')][_0x159dfb][_0xd01b('0x7d')]));}}}if(_0x51202b['conditions']){_0x51202b[_0xd01b('0x7e')]=JSON[_0xd01b('0x79')](_0x51202b[_0xd01b('0x7e')]);_0x376399['where'](_0x1505b0(_0x51202b['conditions']['group']));}_0x578f91=_0x376399[_0xd01b('0x89')]();_0x376399[_0xd01b('0x1d')](_0x363bc9);_0x376399[_0xd01b('0x1c')](0x0);logger[_0xd01b('0x7f')](_0xd01b('0x80'),_0x376399[_0xd01b('0x81')]());return dbH[_0xd01b('0x82')][_0xd01b('0x31')](_0x376399[_0xd01b('0x81')](),{'type':dbH['sequelize'][_0xd01b('0x83')]['SELECT']});}})[_0xd01b('0x23')](function(){return{'sql':_0x578f91['toString']()};})[_0xd01b('0x23')](respondWithResult(_0x27ca94,null))[_0xd01b('0x47')](handleError(_0x27ca94,null));};
\ No newline at end of file
+var _0xc217=['getFields','replace','clone','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','then','get','CustomReports','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','AnalyticCustomReport','include','findAll','rows','catch','show','params','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','find','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','GROUP_CONCAT(%s)','operator','condition'];(function(_0x34d7e8,_0x1b3355){var _0x5d45bc=function(_0x1dd0a5){while(--_0x1dd0a5){_0x34d7e8['push'](_0x34d7e8['shift']());}};_0x5d45bc(++_0x1b3355);}(_0xc217,0x15d));var _0x7c21=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0xc217[_0x9a3e0f];return _0x3d2a9a;};'use strict';var emlformat=require(_0x7c21('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c21('0x1'));var jsonpatch=require(_0x7c21('0x2'));var rp=require(_0x7c21('0x3'));var moment=require(_0x7c21('0x4'));var BPromise=require(_0x7c21('0x5'));var Mustache=require('mustache');var util=require(_0x7c21('0x6'));var path=require(_0x7c21('0x7'));var sox=require(_0x7c21('0x8'));var csv=require(_0x7c21('0x9'));var ejs=require(_0x7c21('0xa'));var fs=require('fs');var fs_extra=require(_0x7c21('0xb'));var _=require(_0x7c21('0xc'));var squel=require('squel');var crypto=require(_0x7c21('0xd'));var jsforce=require(_0x7c21('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7c21('0x9'));var querystring=require(_0x7c21('0xf'));var Papa=require(_0x7c21('0x10'));var Redis=require(_0x7c21('0x11'));var authService=require(_0x7c21('0x12'));var qs=require(_0x7c21('0x13'));var as=require(_0x7c21('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c21('0x15'))('api');var utils=require(_0x7c21('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7c21('0x17'));var db=require(_0x7c21('0x18'))['db'];var dbH=require(_0x7c21('0x18'))[_0x7c21('0x19')];function respondWithStatusCode(_0x15bbc4,_0x19b39f){_0x19b39f=_0x19b39f||0xcc;return function(_0x4a665d){if(_0x4a665d){return _0x15bbc4[_0x7c21('0x1a')](_0x19b39f);}return _0x15bbc4[_0x7c21('0x1b')](_0x19b39f)[_0x7c21('0x1c')]();};}function respondWithResult(_0x692529,_0x5f3b6d){_0x5f3b6d=_0x5f3b6d||0xc8;return function(_0x2cee0d){if(_0x2cee0d){return _0x692529[_0x7c21('0x1b')](_0x5f3b6d)[_0x7c21('0x1d')](_0x2cee0d);}};}function respondWithFilteredResult(_0x4611df,_0x2fd1dd){return function(_0x22b5d0){if(_0x22b5d0){var _0x4dad7c=typeof _0x2fd1dd[_0x7c21('0x1e')]==='undefined'&&typeof _0x2fd1dd[_0x7c21('0x1f')]===_0x7c21('0x20');var _0x4165aa=_0x22b5d0['count'];var _0x2ec99b=_0x4dad7c?0x0:_0x2fd1dd[_0x7c21('0x1e')];var _0x294213=_0x4dad7c?_0x22b5d0[_0x7c21('0x21')]:_0x2fd1dd[_0x7c21('0x1e')]+_0x2fd1dd[_0x7c21('0x1f')];var _0x368351;if(_0x294213>=_0x4165aa){_0x294213=_0x4165aa;_0x368351=0xc8;}else{_0x368351=0xce;}_0x4611df[_0x7c21('0x1b')](_0x368351);return _0x4611df['set']('Content-Range',_0x2ec99b+'-'+_0x294213+'/'+_0x4165aa)[_0x7c21('0x1d')](_0x22b5d0);}return null;};}function patchUpdates(_0x57efb7){return function(_0x468e23){try{jsonpatch[_0x7c21('0x22')](_0x468e23,_0x57efb7,!![]);}catch(_0x2da528){return BPromise['reject'](_0x2da528);}return _0x468e23[_0x7c21('0x23')]();};}function saveUpdates(_0x619b02,_0x3dd770){return function(_0x205039){if(_0x205039){return _0x205039['update'](_0x619b02)[_0x7c21('0x24')](function(_0x23851f){return _0x23851f;});}return null;};}function removeEntity(_0x55269d,_0x287688){return function(_0x35052f){if(_0x35052f){return _0x35052f['destroy']()[_0x7c21('0x24')](function(){var _0xc6164b=_0x35052f[_0x7c21('0x25')]({'plain':!![]});var _0x4b3528=_0x7c21('0x26');return db[_0x7c21('0x27')][_0x7c21('0x28')]({'where':{'type':_0x4b3528,'resourceId':_0xc6164b['id']}})['then'](function(){return _0x35052f;});})['then'](function(){_0x55269d[_0x7c21('0x1b')](0xcc)[_0x7c21('0x1c')]();});}};}function handleEntityNotFound(_0x1ed8b2,_0x10c69f){return function(_0x31e91f){if(!_0x31e91f){_0x1ed8b2[_0x7c21('0x1a')](0x194);}return _0x31e91f;};}function handleError(_0x2c8847,_0x5b52ce){_0x5b52ce=_0x5b52ce||0x1f4;return function(_0x1ffce1){logger[_0x7c21('0x29')](_0x1ffce1['stack']);if(_0x1ffce1['name']){delete _0x1ffce1[_0x7c21('0x2a')];}_0x2c8847[_0x7c21('0x1b')](_0x5b52ce)[_0x7c21('0x2b')](_0x1ffce1);};}exports[_0x7c21('0x2c')]=function(_0x539690,_0x146e6f){var _0x455469={},_0x35d833={},_0x253836={'count':0x0,'rows':[]};var _0x5b17af=_[_0x7c21('0x2d')](db['AnalyticCustomReport'][_0x7c21('0x2e')],function(_0x4ba36c){return{'name':_0x4ba36c[_0x7c21('0x2f')],'type':_0x4ba36c['type'][_0x7c21('0x30')]};});_0x35d833[_0x7c21('0x31')]=_[_0x7c21('0x2d')](_0x5b17af,_0x7c21('0x2a'));_0x35d833[_0x7c21('0x32')]=_[_0x7c21('0x33')](_0x539690['query']);_0x35d833[_0x7c21('0x34')]=_[_0x7c21('0x35')](_0x35d833['model'],_0x35d833[_0x7c21('0x32')]);_0x455469[_0x7c21('0x36')]=_[_0x7c21('0x35')](_0x35d833[_0x7c21('0x31')],qs[_0x7c21('0x37')](_0x539690['query'][_0x7c21('0x37')]));_0x455469[_0x7c21('0x36')]=_0x455469[_0x7c21('0x36')][_0x7c21('0x38')]?_0x455469[_0x7c21('0x36')]:_0x35d833['model'];if(!_0x539690[_0x7c21('0x32')][_0x7c21('0x39')]('nolimit')){_0x455469[_0x7c21('0x1f')]=qs[_0x7c21('0x1f')](_0x539690[_0x7c21('0x32')][_0x7c21('0x1f')]);_0x455469[_0x7c21('0x1e')]=qs['offset'](_0x539690[_0x7c21('0x32')][_0x7c21('0x1e')]);}_0x455469[_0x7c21('0x3a')]=qs['sort'](_0x539690[_0x7c21('0x32')][_0x7c21('0x3b')]);_0x455469[_0x7c21('0x3c')]=qs[_0x7c21('0x34')](_['pick'](_0x539690['query'],_0x35d833['filters']),_0x5b17af);if(_0x539690[_0x7c21('0x32')][_0x7c21('0x3d')]){_0x455469[_0x7c21('0x3c')]=_[_0x7c21('0x3e')](_0x455469['where'],{'$or':_[_0x7c21('0x2d')](_0x5b17af,function(_0x1fc9c5){if(_0x1fc9c5[_0x7c21('0x3f')]!=='VIRTUAL'){var _0x42a59b={};_0x42a59b[_0x1fc9c5[_0x7c21('0x2a')]]={'$like':'%'+_0x539690[_0x7c21('0x32')]['filter']+'%'};return _0x42a59b;}})});}_0x455469=_[_0x7c21('0x3e')]({},_0x455469,_0x539690['options']);var _0x3d9c69={'where':_0x455469[_0x7c21('0x3c')]};return db[_0x7c21('0x40')][_0x7c21('0x21')](_0x3d9c69)[_0x7c21('0x24')](function(_0x1f4c1e){_0x253836[_0x7c21('0x21')]=_0x1f4c1e;if(_0x539690[_0x7c21('0x32')]['includeAll']){_0x455469[_0x7c21('0x41')]=[{'all':!![]}];}return db[_0x7c21('0x40')][_0x7c21('0x42')](_0x455469);})['then'](function(_0x4b93db){_0x253836[_0x7c21('0x43')]=_0x4b93db;return _0x253836;})['then'](respondWithFilteredResult(_0x146e6f,_0x455469))[_0x7c21('0x44')](handleError(_0x146e6f,null));};exports[_0x7c21('0x45')]=function(_0x1b36a8,_0x1e8ceb){var _0x1df6d7={'raw':![],'where':{'id':_0x1b36a8[_0x7c21('0x46')]['id']}},_0x797ac={};_0x797ac['model']=_[_0x7c21('0x33')](db[_0x7c21('0x40')][_0x7c21('0x2e')]);_0x797ac[_0x7c21('0x32')]=_[_0x7c21('0x33')](_0x1b36a8[_0x7c21('0x32')]);_0x797ac[_0x7c21('0x34')]=_['intersection'](_0x797ac['model'],_0x797ac['query']);_0x1df6d7[_0x7c21('0x36')]=_['intersection'](_0x797ac[_0x7c21('0x31')],qs[_0x7c21('0x37')](_0x1b36a8[_0x7c21('0x32')][_0x7c21('0x37')]));_0x1df6d7[_0x7c21('0x36')]=_0x1df6d7[_0x7c21('0x36')][_0x7c21('0x38')]?_0x1df6d7[_0x7c21('0x36')]:_0x797ac[_0x7c21('0x31')];if(_0x1b36a8[_0x7c21('0x32')][_0x7c21('0x47')]){_0x1df6d7[_0x7c21('0x41')]=[{'all':!![]}];}_0x1df6d7=_[_0x7c21('0x3e')]({},_0x1df6d7,_0x1b36a8[_0x7c21('0x48')]);return db[_0x7c21('0x40')]['find'](_0x1df6d7)[_0x7c21('0x24')](handleEntityNotFound(_0x1e8ceb,null))[_0x7c21('0x24')](respondWithResult(_0x1e8ceb,null))[_0x7c21('0x44')](handleError(_0x1e8ceb,null));};exports[_0x7c21('0x49')]=function(_0x410b2b,_0x4c93e6){return db['AnalyticCustomReport']['create'](_0x410b2b[_0x7c21('0x4a')],{})['then'](function(_0x4142f9){var _0x4989e=_0x410b2b['user']['get']({'plain':!![]});if(!_0x4989e)throw new Error(_0x7c21('0x4b'));if(_0x4989e[_0x7c21('0x4c')]===_0x7c21('0x4d')){var _0x42dce2=_0x4142f9['get']({'plain':!![]});var _0x5135d5=_0x7c21('0x4e');return db[_0x7c21('0x4f')]['find']({'where':{'name':_0x5135d5,'userProfileId':_0x4989e[_0x7c21('0x50')]},'raw':!![]})[_0x7c21('0x24')](function(_0x273f5c){if(_0x273f5c&&_0x273f5c[_0x7c21('0x51')]===0x0){return db[_0x7c21('0x27')][_0x7c21('0x49')]({'name':_0x42dce2[_0x7c21('0x2a')],'resourceId':_0x42dce2['id'],'type':_0x7c21('0x26'),'sectionId':_0x273f5c['id']},{})[_0x7c21('0x24')](function(){return _0x4142f9;});}else{return _0x4142f9;}})['catch'](function(_0x18da43){logger[_0x7c21('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18da43);throw _0x18da43;});}return _0x4142f9;})[_0x7c21('0x24')](respondWithResult(_0x4c93e6,0xc9))[_0x7c21('0x44')](handleError(_0x4c93e6,null));};exports['update']=function(_0xd97085,_0x3ca526){if(_0xd97085[_0x7c21('0x4a')]['id']){delete _0xd97085[_0x7c21('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x7c21('0x52')]({'where':{'id':_0xd97085[_0x7c21('0x46')]['id']}})[_0x7c21('0x24')](handleEntityNotFound(_0x3ca526,null))[_0x7c21('0x24')](saveUpdates(_0xd97085[_0x7c21('0x4a')],null))[_0x7c21('0x24')](respondWithResult(_0x3ca526,null))[_0x7c21('0x44')](handleError(_0x3ca526,null));};exports[_0x7c21('0x28')]=function(_0x29052d,_0xfd81b9){return db[_0x7c21('0x40')][_0x7c21('0x52')]({'where':{'id':_0x29052d['params']['id']}})['then'](handleEntityNotFound(_0xfd81b9,null))['then'](removeEntity(_0xfd81b9,null))[_0x7c21('0x44')](handleError(_0xfd81b9,null));};exports[_0x7c21('0x53')]=function(_0x506510,_0xfea710){var _0x3bd527=0xa;var _0x5c30ef=[_0x7c21('0x54'),_0x7c21('0x55'),_0x7c21('0x56'),'cross_join'];var _0x27184d={'SUM':_0x7c21('0x57'),'COUNT':_0x7c21('0x58'),'COUNT DISTINCT':_0x7c21('0x59'),'MAX':_0x7c21('0x5a'),'MIN':_0x7c21('0x5b'),'AVG':_0x7c21('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7c21('0x5d')};var _0x4fb1b6={'SEC_TO_TIME':_0x7c21('0x5e'),'DATE':_0x7c21('0x5f'),'HOUR':_0x7c21('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7c21('0x61')};var _0x1db4d9=function(_0x15eb37){return!_[_0x7c21('0x62')]([_0x7c21('0x63'),_0x7c21('0x64'),_0x7c21('0x65'),_0x7c21('0x66')],_0x15eb37);};var _0xc08090=function(_0xc86b83){if(!_0xc86b83||!_0xc86b83[_0x7c21('0x67')][_0x7c21('0x38')]){return'';}for(var _0x3434e5='(',_0x57a744=0x0;_0x57a744<_0xc86b83['rules'][_0x7c21('0x38')];_0x57a744+=0x1){_0x57a744>0x0&&(_0x3434e5+='\x20'+_0xc86b83['operator']+'\x20');_0x3434e5+=_0xc86b83['rules'][_0x57a744][_0x7c21('0x68')]?_0xc08090(_0xc86b83[_0x7c21('0x67')][_0x57a744][_0x7c21('0x68')]):_0xc86b83[_0x7c21('0x67')][_0x57a744][_0x7c21('0x69')]+'\x20'+_0xc86b83[_0x7c21('0x67')][_0x57a744]['condition']+(_0x1db4d9(_0xc86b83[_0x7c21('0x67')][_0x57a744]['condition'])?'\x20'+_0xc86b83[_0x7c21('0x67')][_0x57a744][_0x7c21('0x6a')]:'');}return _0x3434e5+')';};var _0x5a1583={'where':{'id':_0x506510[_0x7c21('0x46')]['id']}},_0x5266ad,_0x1a3d7b,_0x14f63f,_0x157b0e,_0x14de44;_0x5a1583=_[_0x7c21('0x3e')]({},_0x5a1583,_0x506510[_0x7c21('0x48')]);return db[_0x7c21('0x40')][_0x7c21('0x52')](_0x5a1583)[_0x7c21('0x24')](function(_0x56e7ed){if(_0x56e7ed){_0x5266ad=_0x56e7ed;return _0x56e7ed['getFields']();}return null;})[_0x7c21('0x24')](function(_0x3e04ca){if(_0x3e04ca){if(!_0x3e04ca[_0x7c21('0x38')]){throw new db[(_0x7c21('0x6b'))][(_0x7c21('0x6c'))](_0x7c21('0x6d'),0x193);}_0x1a3d7b=_0x3e04ca;return db[_0x7c21('0x6e')][_0x7c21('0x42')]({'raw':!![]});}return null;})[_0x7c21('0x24')](function(_0x4a2b44){if(_0x4a2b44){_0x14f63f=_[_0x7c21('0x6f')](_0x4a2b44,'id');var _0x3ac98a;var _0x5c0382=squel[_0x7c21('0x70')]();_0x5c0382[_0x7c21('0x71')](_0x5266ad[_0x7c21('0x72')]);for(var _0x2e16b8=0x0;_0x2e16b8<_0x1a3d7b[_0x7c21('0x38')];_0x2e16b8+=0x1){_0x3ac98a=_0x1a3d7b[_0x2e16b8]['MetricId']?_0x14f63f[_0x1a3d7b[_0x2e16b8][_0x7c21('0x73')]][_0x7c21('0x74')]:_0x1a3d7b[_0x2e16b8][_0x7c21('0x69')];_0x3ac98a=_0x1a3d7b[_0x2e16b8][_0x7c21('0x75')]?_['replace'](_0x27184d[_0x1a3d7b[_0x2e16b8][_0x7c21('0x75')]],'%s',_0x3ac98a):_0x3ac98a;_0x3ac98a=_0x1a3d7b[_0x2e16b8][_0x7c21('0x76')]?_['replace'](_0x4fb1b6[_0x1a3d7b[_0x2e16b8][_0x7c21('0x76')]],'%s',_0x3ac98a):_0x3ac98a;if(_0x1a3d7b[_0x2e16b8][_0x7c21('0x77')]){_0x5c0382['group'](_0x3ac98a);}_0x1a3d7b[_0x2e16b8]['orderBy']&&_0x5c0382[_0x7c21('0x3a')](_0x3ac98a,_0x1a3d7b[_0x2e16b8][_0x7c21('0x78')]===_0x7c21('0x79')?![]:!![]);_0x5c0382[_0x7c21('0x69')](_0x3ac98a,_0x1a3d7b[_0x2e16b8][_0x7c21('0x7a')]||_0x3ac98a);}if(_0x5266ad[_0x7c21('0x7b')]){_0x5266ad[_0x7c21('0x7b')]=JSON[_0x7c21('0x7c')](_0x5266ad[_0x7c21('0x7b')]);for(var _0x3ca6ae=0x0;_0x3ca6ae<_0x5266ad[_0x7c21('0x7b')]['length'];_0x3ca6ae+=0x1){if(_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x3f')]&&_[_0x7c21('0x62')](_0x5c30ef,_0x5266ad['joins'][_0x3ca6ae][_0x7c21('0x3f')])&&_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x7d')]&&_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae]['foreignTable']&&_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x7e')]){_0x5c0382[_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x3f')]](_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x7f')],null,util[_0x7c21('0x76')](_0x7c21('0x80'),_0x5266ad['table'],_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae]['parentKey'],_0x5266ad['joins'][_0x3ca6ae][_0x7c21('0x7f')],_0x5266ad[_0x7c21('0x7b')][_0x3ca6ae][_0x7c21('0x7e')]));}}}if(_0x5266ad[_0x7c21('0x81')]){_0x5266ad['conditions']=JSON[_0x7c21('0x7c')](_0x5266ad['conditions']);_0x5c0382[_0x7c21('0x3c')](_0xc08090(_0x5266ad[_0x7c21('0x81')]['group']));}_0x14de44=_0x5c0382['clone']();_0x5c0382[_0x7c21('0x1f')](_0x3bd527);_0x5c0382['offset'](0x0);logger[_0x7c21('0x82')](_0x7c21('0x83'),_0x5c0382[_0x7c21('0x84')]());return dbH['sequelize'][_0x7c21('0x32')](_0x5c0382[_0x7c21('0x84')](),{'type':dbH[_0x7c21('0x85')][_0x7c21('0x86')][_0x7c21('0x87')]});}})['then'](respondWithResult(_0xfea710,null))[_0x7c21('0x44')](handleError(_0xfea710,null));};function runReport(_0x306e95,_0x1300f3,_0x2e7501){var _0x33c2c4=_0x1300f3[_0x7c21('0x2a')];var _0xfae9db=0xa;var _0x244eec=[_0x7c21('0x54'),'left_join','right_join',_0x7c21('0x88')];var _0x3b9a6a={'SUM':_0x7c21('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7c21('0x59'),'MAX':'MAX(%s)','MIN':_0x7c21('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7c21('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7c21('0x5d')};var _0x5753ac={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7c21('0x5f'),'HOUR':_0x7c21('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7c21('0x61')};var _0x23441e=function(_0x27cf8e){return!_[_0x7c21('0x62')]([_0x7c21('0x63'),_0x7c21('0x64'),_0x7c21('0x65'),_0x7c21('0x66')],_0x27cf8e);};var _0x369ed5=function(_0x5a43cb){if(!_0x5a43cb||!_0x5a43cb[_0x7c21('0x67')][_0x7c21('0x38')]){return'';}for(var _0x33412d='(',_0x1d5184=0x0;_0x1d5184<_0x5a43cb[_0x7c21('0x67')][_0x7c21('0x38')];_0x1d5184+=0x1){_0x1d5184>0x0&&(_0x33412d+='\x20'+_0x5a43cb[_0x7c21('0x8a')]+'\x20');_0x33412d+=_0x5a43cb['rules'][_0x1d5184][_0x7c21('0x68')]?_0x369ed5(_0x5a43cb[_0x7c21('0x67')][_0x1d5184][_0x7c21('0x68')]):_0x5a43cb[_0x7c21('0x67')][_0x1d5184]['field']+'\x20'+_0x5a43cb[_0x7c21('0x67')][_0x1d5184][_0x7c21('0x8b')]+(_0x23441e(_0x5a43cb['rules'][_0x1d5184][_0x7c21('0x8b')])?'\x20'+_0x5a43cb[_0x7c21('0x67')][_0x1d5184]['value']:'');}return _0x33412d+')';};var _0xa1d104={'where':{'id':_0x306e95['id']}},_0x5839dc,_0x4e3f73,_0x48cd3c,_0x49f0af,_0x3b6902;_0xa1d104=_[_0x7c21('0x3e')]({},_0xa1d104,_0x2e7501);return db[_0x7c21('0x40')][_0x7c21('0x52')](_0xa1d104)[_0x7c21('0x24')](function(_0xa7f6c3){if(_0xa7f6c3){_0x5839dc=_0xa7f6c3;return _0xa7f6c3[_0x7c21('0x8c')]();}return null;})['then'](function(_0x2377e9){if(_0x2377e9){if(!_0x2377e9[_0x7c21('0x38')]){throw new db[(_0x7c21('0x6b'))]['ValidationErrorItem'](_0x7c21('0x6d'),0x193);}_0x4e3f73=_0x2377e9;return db[_0x7c21('0x6e')][_0x7c21('0x42')]({'raw':!![]});}return null;})[_0x7c21('0x24')](function(_0x451edc){if(_0x451edc){_0x48cd3c=_['keyBy'](_0x451edc,'id');var _0x3c13e4;var _0x2ae727=squel[_0x7c21('0x70')]();_0x2ae727[_0x7c21('0x71')](_0x5839dc[_0x7c21('0x72')]);for(var _0xb77eb7=0x0;_0xb77eb7<_0x4e3f73[_0x7c21('0x38')];_0xb77eb7+=0x1){_0x3c13e4=_0x4e3f73[_0xb77eb7][_0x7c21('0x73')]?_0x48cd3c[_0x4e3f73[_0xb77eb7][_0x7c21('0x73')]][_0x7c21('0x74')]:_0x4e3f73[_0xb77eb7][_0x7c21('0x69')];_0x3c13e4=_0x4e3f73[_0xb77eb7][_0x7c21('0x75')]?_[_0x7c21('0x8d')](_0x3b9a6a[_0x4e3f73[_0xb77eb7][_0x7c21('0x75')]],'%s',_0x3c13e4):_0x3c13e4;_0x3c13e4=_0x4e3f73[_0xb77eb7]['format']?_[_0x7c21('0x8d')](_0x5753ac[_0x4e3f73[_0xb77eb7][_0x7c21('0x76')]],'%s',_0x3c13e4):_0x3c13e4;if(_0x4e3f73[_0xb77eb7][_0x7c21('0x77')]){_0x2ae727[_0x7c21('0x68')](_0x3c13e4);}_0x4e3f73[_0xb77eb7]['orderBy']&&_0x2ae727['order'](_0x3c13e4,_0x4e3f73[_0xb77eb7][_0x7c21('0x78')]==='DESC'?![]:!![]);_0x2ae727[_0x7c21('0x69')](_0x3c13e4,_0x4e3f73[_0xb77eb7][_0x7c21('0x7a')]||_0x3c13e4);}if(_0x5839dc[_0x7c21('0x7b')]){_0x5839dc['joins']=JSON['parse'](_0x5839dc[_0x7c21('0x7b')]);for(var _0x2e0cd2=0x0;_0x2e0cd2<_0x5839dc[_0x7c21('0x7b')][_0x7c21('0x38')];_0x2e0cd2+=0x1){if(_0x5839dc['joins'][_0x2e0cd2][_0x7c21('0x3f')]&&_[_0x7c21('0x62')](_0x244eec,_0x5839dc['joins'][_0x2e0cd2][_0x7c21('0x3f')])&&_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2][_0x7c21('0x7d')]&&_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2][_0x7c21('0x7f')]&&_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2]['foreignKey']){_0x2ae727[_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2][_0x7c21('0x3f')]](_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2][_0x7c21('0x7f')],null,util[_0x7c21('0x76')](_0x7c21('0x80'),_0x5839dc['table'],_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2]['parentKey'],_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2]['foreignTable'],_0x5839dc[_0x7c21('0x7b')][_0x2e0cd2]['foreignKey']));}}}if(_0x5839dc[_0x7c21('0x81')]){_0x5839dc[_0x7c21('0x81')]=JSON[_0x7c21('0x7c')](_0x5839dc[_0x7c21('0x81')]);_0x2ae727[_0x7c21('0x3c')](_0x369ed5(_0x5839dc[_0x7c21('0x81')][_0x7c21('0x68')]));}_0x3b6902=_0x2ae727[_0x7c21('0x8e')]();_0x2ae727[_0x7c21('0x1f')](_0xfae9db);_0x2ae727[_0x7c21('0x1e')](0x0);return;}})[_0x7c21('0x24')](function(){if(_0x1300f3['output']==='web'){return null;}var _0x8066a2=_[_0x7c21('0x3e')](_0x1300f3,{'name':_0x1300f3[_0x7c21('0x8f')]||_0x1300f3[_0x7c21('0x2a')]||_0x5839dc[_0x7c21('0x2a')],'basename':_0x33c2c4,'savename':util[_0x7c21('0x76')](_0x7c21('0x90'),_0x1300f3[_0x7c21('0x2a')]||_0x5839dc[_0x7c21('0x2a')],require(_0x7c21('0x91'))[_0x7c21('0x92')](0x4),_0x1300f3[_0x7c21('0x93')]||_0x7c21('0x94')),'reportId':_0x5839dc['id'],'reportType':_0x7c21('0x95')});return db['AnalyticExtractedReport'][_0x7c21('0x49')](_0x8066a2,{'raw':!![]});})['then'](function(_0x66f08f){if(_0x5839dc['table']===_0x7c21('0x96')){_0x3b6902['where'](_0x5839dc[_0x7c21('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1300f3[_0x7c21('0x97')],_0x1300f3['endDate']);}else{_0x3b6902[_0x7c21('0x3c')](_0x5839dc[_0x7c21('0x72')]+_0x7c21('0x98'),_0x1300f3['startDate'],_0x1300f3[_0x7c21('0x99')]);}if(_0x66f08f){logger[_0x7c21('0x9a')](_0x7c21('0x9b'),_0x3b6902[_0x7c21('0x84')]());require(_0x7c21('0x9c'))['fork'](path[_0x7c21('0x54')](__dirname,'../../components/export/',_0x66f08f['output']),[_0x66f08f['id'],_0x3b6902[_0x7c21('0x84')](),path[_0x7c21('0x54')](__dirname,_0x7c21('0x9d'),_0x66f08f[_0x7c21('0x9e')]),_0x33c2c4]);return _0x66f08f;}else{var _0x1048ae=squel[_0x7c21('0x70')]();_0x1048ae[_0x7c21('0x71')]('('+_0x3b6902[_0x7c21('0x84')]()+')',_0x7c21('0x9f'));_0x1048ae[_0x7c21('0x69')]('COUNT(*)',_0x7c21('0x21'));_0x3b6902[_0x7c21('0x1f')](_0x1300f3[_0x7c21('0x1f')]||_0xfae9db);_0x3b6902[_0x7c21('0x1e')](_0x1300f3[_0x7c21('0x1e')]||0x0);return dbH[_0x7c21('0x85')][_0x7c21('0x32')](_0x1048ae['toString'](),{'type':dbH[_0x7c21('0x85')][_0x7c21('0x86')]['SELECT']})[_0x7c21('0x24')](function(_0x4d64a1){if(!_0x4d64a1[_0x7c21('0x38')]){_0x49f0af=0x0;}else{_0x49f0af=_0x4d64a1[0x0][_0x7c21('0x21')]||0x0;}return dbH[_0x7c21('0x85')][_0x7c21('0x32')](_0x3b6902['toString'](),{'type':dbH[_0x7c21('0x85')][_0x7c21('0x86')]['SELECT']});})[_0x7c21('0x24')](function(_0x2e6dbe){return{'rows':_0x2e6dbe||[],'count':_0x49f0af};});}});}exports[_0x7c21('0xa0')]=function(_0x2456ae,_0x85ac11){return runReport(_0x2456ae['params'],_0x2456ae['query'],_0x2456ae[_0x7c21('0x48')])[_0x7c21('0x24')](respondWithResult(_0x85ac11,null))[_0x7c21('0x44')](handleError(_0x85ac11,null));};exports['runReport']=runReport;exports['query']=function(_0x2a944c,_0x347d84){var _0x558c62=0xa;var _0x3577ed=[_0x7c21('0x54'),_0x7c21('0x55'),'right_join',_0x7c21('0x88')];var _0x5091dd={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7c21('0x59'),'MAX':_0x7c21('0x5a'),'MIN':_0x7c21('0x5b'),'AVG':_0x7c21('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7c21('0xa1'),'GROUP_CONCAT DESC':_0x7c21('0x5d')};var _0xec1d30={'SEC_TO_TIME':_0x7c21('0x5e'),'DATE':_0x7c21('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x7c21('0xa2'),'UNIX_TIMESTAMP':_0x7c21('0x61')};var _0x3472a5=function(_0x5c713e){return!_[_0x7c21('0x62')]([_0x7c21('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x7c21('0x66')],_0x5c713e);};var _0x2cc5a4=function(_0x1532d4){if(!_0x1532d4||!_0x1532d4['rules']['length']){return'';}for(var _0x40e3db='(',_0x5ad922=0x0;_0x5ad922<_0x1532d4['rules']['length'];_0x5ad922+=0x1){_0x5ad922>0x0&&(_0x40e3db+='\x20'+_0x1532d4[_0x7c21('0x8a')]+'\x20');_0x40e3db+=_0x1532d4[_0x7c21('0x67')][_0x5ad922][_0x7c21('0x68')]?_0x2cc5a4(_0x1532d4[_0x7c21('0x67')][_0x5ad922][_0x7c21('0x68')]):_0x1532d4[_0x7c21('0x67')][_0x5ad922][_0x7c21('0x69')]+'\x20'+_0x1532d4[_0x7c21('0x67')][_0x5ad922][_0x7c21('0x8b')]+(_0x3472a5(_0x1532d4[_0x7c21('0x67')][_0x5ad922]['condition'])?'\x20'+_0x1532d4[_0x7c21('0x67')][_0x5ad922]['value']:'');}return _0x40e3db+')';};var _0x43832d={'where':{'id':_0x2a944c[_0x7c21('0x46')]['id']}},_0xf45b0a,_0x12b79c,_0x89ff9c,_0x409c16,_0x2d96f3;_0x43832d=_[_0x7c21('0x3e')]({},_0x43832d,_0x2a944c[_0x7c21('0x48')]);return db[_0x7c21('0x40')][_0x7c21('0x52')](_0x43832d)[_0x7c21('0x24')](function(_0x10467f){if(_0x10467f){_0xf45b0a=_0x10467f;return _0x10467f['getFields']();}return null;})[_0x7c21('0x24')](function(_0x22656c){if(_0x22656c){if(!_0x22656c['length']){throw new db[(_0x7c21('0x6b'))]['ValidationErrorItem'](_0x7c21('0x6d'),0x193);}_0x12b79c=_0x22656c;return db[_0x7c21('0x6e')][_0x7c21('0x42')]({'raw':!![]});}return null;})[_0x7c21('0x24')](function(_0x1e4c7d){if(_0x1e4c7d){_0x89ff9c=_['keyBy'](_0x1e4c7d,'id');var _0x2f0802;var _0x24f57d=squel[_0x7c21('0x70')]();_0x24f57d[_0x7c21('0x71')](_0xf45b0a[_0x7c21('0x72')]);for(var _0x3b4c8a=0x0;_0x3b4c8a<_0x12b79c[_0x7c21('0x38')];_0x3b4c8a+=0x1){_0x2f0802=_0x12b79c[_0x3b4c8a][_0x7c21('0x73')]?_0x89ff9c[_0x12b79c[_0x3b4c8a][_0x7c21('0x73')]][_0x7c21('0x74')]:_0x12b79c[_0x3b4c8a][_0x7c21('0x69')];_0x2f0802=_0x12b79c[_0x3b4c8a]['function']?_['replace'](_0x5091dd[_0x12b79c[_0x3b4c8a][_0x7c21('0x75')]],'%s',_0x2f0802):_0x2f0802;_0x2f0802=_0x12b79c[_0x3b4c8a]['format']?_[_0x7c21('0x8d')](_0xec1d30[_0x12b79c[_0x3b4c8a]['format']],'%s',_0x2f0802):_0x2f0802;if(_0x12b79c[_0x3b4c8a][_0x7c21('0x77')]){_0x24f57d[_0x7c21('0x68')](_0x2f0802);}_0x12b79c[_0x3b4c8a][_0x7c21('0x78')]&&_0x24f57d[_0x7c21('0x3a')](_0x2f0802,_0x12b79c[_0x3b4c8a]['orderBy']===_0x7c21('0x79')?![]:!![]);_0x24f57d['field'](_0x2f0802,_0x12b79c[_0x3b4c8a]['alias']||_0x2f0802);}if(_0xf45b0a[_0x7c21('0x7b')]){_0xf45b0a[_0x7c21('0x7b')]=JSON[_0x7c21('0x7c')](_0xf45b0a[_0x7c21('0x7b')]);for(var _0x41154c=0x0;_0x41154c<_0xf45b0a[_0x7c21('0x7b')][_0x7c21('0x38')];_0x41154c+=0x1){if(_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x3f')]&&_[_0x7c21('0x62')](_0x3577ed,_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x3f')])&&_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x7d')]&&_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x7f')]&&_0xf45b0a[_0x7c21('0x7b')][_0x41154c]['foreignKey']){_0x24f57d[_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x3f')]](_0xf45b0a['joins'][_0x41154c][_0x7c21('0x7f')],null,util[_0x7c21('0x76')](_0x7c21('0x80'),_0xf45b0a[_0x7c21('0x72')],_0xf45b0a[_0x7c21('0x7b')][_0x41154c]['parentKey'],_0xf45b0a[_0x7c21('0x7b')][_0x41154c][_0x7c21('0x7f')],_0xf45b0a['joins'][_0x41154c][_0x7c21('0x7e')]));}}}if(_0xf45b0a[_0x7c21('0x81')]){_0xf45b0a[_0x7c21('0x81')]=JSON[_0x7c21('0x7c')](_0xf45b0a[_0x7c21('0x81')]);_0x24f57d[_0x7c21('0x3c')](_0x2cc5a4(_0xf45b0a[_0x7c21('0x81')][_0x7c21('0x68')]));}_0x2d96f3=_0x24f57d['clone']();_0x24f57d['limit'](_0x558c62);_0x24f57d['offset'](0x0);logger['debug'](_0x7c21('0x83'),_0x24f57d['toString']());return dbH[_0x7c21('0x85')]['query'](_0x24f57d['toString'](),{'type':dbH[_0x7c21('0x85')]['QueryTypes'][_0x7c21('0x87')]});}})['then'](function(){return{'sql':_0x2d96f3[_0x7c21('0x84')]()};})[_0x7c21('0x24')](respondWithResult(_0x347d84,null))[_0x7c21('0x44')](handleError(_0x347d84,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 6fb48e5..6a731e1 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 _0x6548=['bluebird','path','rimraf','../../config/environment','exports','define','analytics_custom_reports','util','../../config/logger','api'];(function(_0x497e9e,_0x36e053){var _0x2aaf55=function(_0x476fa3){while(--_0x476fa3){_0x497e9e['push'](_0x497e9e['shift']());}};_0x2aaf55(++_0x36e053);}(_0x6548,0x151));var _0x8654=function(_0x1c9995,_0x542b6e){_0x1c9995=_0x1c9995-0x0;var _0x47a31a=_0x6548[_0x1c9995];return _0x47a31a;};'use strict';var _=require('lodash');var util=require(_0x8654('0x0'));var logger=require(_0x8654('0x1'))(_0x8654('0x2'));var moment=require('moment');var BPromise=require(_0x8654('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8654('0x4'));var rimraf=require(_0x8654('0x5'));var config=require(_0x8654('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x8654('0x7')]=function(_0x224d30,_0x4bce57){return _0x224d30[_0x8654('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x8654('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1b84=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28e1e1,_0x4c99b2){var _0x34698a=function(_0x550ed1){while(--_0x550ed1){_0x28e1e1['push'](_0x28e1e1['shift']());}};_0x34698a(++_0x4c99b2);}(_0x1b84,0x178));var _0x41b8=function(_0x51b214,_0x463e42){_0x51b214=_0x51b214-0x0;var _0x57bc84=_0x1b84[_0x51b214];return _0x57bc84;};'use strict';var _=require(_0x41b8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x41b8('0x1'));var moment=require(_0x41b8('0x2'));var BPromise=require(_0x41b8('0x3'));var rp=require(_0x41b8('0x4'));var fs=require('fs');var path=require(_0x41b8('0x5'));var rimraf=require(_0x41b8('0x6'));var config=require(_0x41b8('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x41b8('0x8')]=function(_0x24b866,_0x464720){return _0x24b866[_0x41b8('0x9')](_0x41b8('0xa'),attributes,{'tableName':_0x41b8('0xb'),'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 cb0632f..3b45b3a 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 _0xe174=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','ioredis','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4f47a2,_0x67272d){var _0x53813f=function(_0x4c173f){while(--_0x4c173f){_0x4f47a2['push'](_0x4f47a2['shift']());}};_0x53813f(++_0x67272d);}(_0xe174,0x102));var _0x4e17=function(_0x565b23,_0x2ba1ee){_0x565b23=_0x565b23-0x0;var _0x20913c=_0xe174[_0x565b23];return _0x20913c;};'use strict';var _=require(_0x4e17('0x0'));var util=require(_0x4e17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e17('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e17('0x3'));var config=require(_0x4e17('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4e17('0x5')][_0x4e17('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x268b84,_0x26bb10,_0x57dc27){return new BPromise(function(_0x6a326e,_0x50b578){return client['request'](_0x268b84,_0x57dc27)[_0x4e17('0x7')](function(_0x40c11b){logger[_0x4e17('0x8')](_0x4e17('0x9'),_0x26bb10,_0x4e17('0xa'));logger[_0x4e17('0xb')](_0x4e17('0xc'),_0x26bb10,'request\x20sent',JSON[_0x4e17('0xd')](_0x40c11b));if(_0x40c11b['error']){if(_0x40c11b[_0x4e17('0xe')][_0x4e17('0xf')]===0x1f4){logger[_0x4e17('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x26bb10,_0x40c11b[_0x4e17('0xe')]['message']);return _0x50b578(_0x40c11b[_0x4e17('0xe')]['message']);}logger[_0x4e17('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x26bb10,_0x40c11b[_0x4e17('0xe')][_0x4e17('0x10')]);return _0x6a326e(_0x40c11b[_0x4e17('0xe')]['message']);}else{logger[_0x4e17('0x8')](_0x4e17('0x9'),_0x26bb10,_0x4e17('0xa'));_0x6a326e(_0x40c11b['result']['message']);}})[_0x4e17('0x11')](function(_0x269b72){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x26bb10,_0x269b72);_0x50b578(_0x269b72);});});}
\ No newline at end of file
+var _0x5720=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x5720,0x1e9));var _0x0572=function(_0x28d396,_0x50bd20){_0x28d396=_0x28d396-0x0;var _0x3bdb1d=_0x5720[_0x28d396];return _0x3bdb1d;};'use strict';var _=require('lodash');var util=require(_0x0572('0x0'));var moment=require(_0x0572('0x1'));var BPromise=require(_0x0572('0x2'));var rs=require(_0x0572('0x3'));var fs=require('fs');var Redis=require(_0x0572('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0572('0x5'))(_0x0572('0x6'));var config=require(_0x0572('0x7'));var jayson=require(_0x0572('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d16e2,_0x352eeb,_0x3a2a33){return new BPromise(function(_0x16a97f,_0x308c97){return client[_0x0572('0x9')](_0x3d16e2,_0x3a2a33)[_0x0572('0xa')](function(_0x33e524){logger[_0x0572('0xb')](_0x0572('0xc'),_0x352eeb,_0x0572('0xd'));logger[_0x0572('0xe')](_0x0572('0xf'),_0x352eeb,_0x0572('0xd'),JSON[_0x0572('0x10')](_0x33e524));if(_0x33e524['error']){if(_0x33e524[_0x0572('0x11')][_0x0572('0x12')]===0x1f4){logger[_0x0572('0x11')](_0x0572('0xc'),_0x352eeb,_0x33e524[_0x0572('0x11')][_0x0572('0x13')]);return _0x308c97(_0x33e524['error']['message']);}logger[_0x0572('0x11')](_0x0572('0xc'),_0x352eeb,_0x33e524[_0x0572('0x11')][_0x0572('0x13')]);return _0x16a97f(_0x33e524[_0x0572('0x11')][_0x0572('0x13')]);}else{logger[_0x0572('0xb')](_0x0572('0xc'),_0x352eeb,_0x0572('0xd'));_0x16a97f(_0x33e524[_0x0572('0x14')][_0x0572('0x13')]);}})[_0x0572('0x15')](function(_0x40f9cd){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x352eeb,_0x40f9cd);_0x308c97(_0x40f9cd);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index c31553c..77cd984 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 _0x8a8d=['query','update','delete','exports','path','connect-timeout','Router','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','/:id/run','run'];(function(_0x25d2bd,_0x4b5453){var _0x1852de=function(_0x500db8){while(--_0x500db8){_0x25d2bd['push'](_0x25d2bd['shift']());}};_0x1852de(++_0x4b5453);}(_0x8a8d,0xc4));var _0xd8a8=function(_0x1f2773,_0x153741){_0x1f2773=_0x1f2773-0x0;var _0x3eda0f=_0x8a8d[_0x1f2773];return _0x3eda0f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd8a8('0x0'));var timeout=require(_0xd8a8('0x1'));var express=require('express');var router=express[_0xd8a8('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd8a8('0x3'));var config=require('../../config/environment');var controller=require(_0xd8a8('0x4'));router[_0xd8a8('0x5')]('/',auth[_0xd8a8('0x6')](),controller[_0xd8a8('0x7')]);router[_0xd8a8('0x5')](_0xd8a8('0x8'),auth[_0xd8a8('0x6')](),controller['show']);router['get'](_0xd8a8('0x9'),auth[_0xd8a8('0x6')](),controller['preview']);router[_0xd8a8('0x5')](_0xd8a8('0xa'),auth['isAuthenticated'](),controller[_0xd8a8('0xb')]);router['get']('/:id/query',auth[_0xd8a8('0x6')](),controller[_0xd8a8('0xc')]);router['post']('/',auth[_0xd8a8('0x6')](),controller['create']);router['put'](_0xd8a8('0x8'),auth[_0xd8a8('0x6')](),controller[_0xd8a8('0xd')]);router[_0xd8a8('0xe')](_0xd8a8('0x8'),auth[_0xd8a8('0x6')](),controller['destroy']);module[_0xd8a8('0xf')]=router;
\ No newline at end of file
+var _0xb853=['query','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query'];(function(_0x49bd05,_0xf8935){var _0x2b5ea0=function(_0x40b504){while(--_0x40b504){_0x49bd05['push'](_0x49bd05['shift']());}};_0x2b5ea0(++_0xf8935);}(_0xb853,0x96));var _0x3b85=function(_0x35e1e5,_0x1a17b5){_0x35e1e5=_0x35e1e5-0x0;var _0x18b21c=_0xb853[_0x35e1e5];return _0x18b21c;};'use strict';var multer=require(_0x3b85('0x0'));var util=require(_0x3b85('0x1'));var path=require(_0x3b85('0x2'));var timeout=require(_0x3b85('0x3'));var express=require(_0x3b85('0x4'));var router=express[_0x3b85('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3b85('0x6'));var config=require(_0x3b85('0x7'));var controller=require(_0x3b85('0x8'));router[_0x3b85('0x9')]('/',auth[_0x3b85('0xa')](),controller[_0x3b85('0xb')]);router[_0x3b85('0x9')](_0x3b85('0xc'),auth['isAuthenticated'](),controller[_0x3b85('0xd')]);router[_0x3b85('0x9')](_0x3b85('0xe'),auth[_0x3b85('0xa')](),controller['preview']);router[_0x3b85('0x9')](_0x3b85('0xf'),auth[_0x3b85('0xa')](),controller[_0x3b85('0x10')]);router['get'](_0x3b85('0x11'),auth[_0x3b85('0xa')](),controller[_0x3b85('0x12')]);router[_0x3b85('0x13')]('/',auth['isAuthenticated'](),controller[_0x3b85('0x14')]);router['put'](_0x3b85('0xc'),auth[_0x3b85('0xa')](),controller[_0x3b85('0x15')]);router[_0x3b85('0x16')](_0x3b85('0xc'),auth[_0x3b85('0xa')](),controller[_0x3b85('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index fb413b7..661f7f1 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x35d649,_0x331b46){var _0x31489d=function(_0x1a8bfd){while(--_0x1a8bfd){_0x35d649['push'](_0x35d649['shift']());}};_0x31489d(++_0x331b46);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0xdc97,0x13b));var _0x7dc9=function(_0x41d03b,_0x2df68a){_0x41d03b=_0x41d03b-0x0;var _0x1ac319=_0xdc97[_0x41d03b];return _0x1ac319;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 2b66624..30f378a 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x4195ab,_0x54a952){var _0x4eb46f=function(_0x5b4c5c){while(--_0x5b4c5c){_0x4195ab['push'](_0x4195ab['shift']());}};_0x4eb46f(++_0x54a952);}(_0x31f0,0xb7));var _0x031f=function(_0x228481,_0x27f47a){_0x228481=_0x228481-0x0;var _0x18f590=_0x31f0[_0x228481];return _0x18f590;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
+var _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x326f,0xd1));var _0xf326=function(_0x5904e4,_0x83cf65){_0x5904e4=_0x5904e4-0x0;var _0x3d825b=_0x326f[_0x5904e4];return _0x3d825b;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a494b68..b57cabe 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 _0x80ce=['analytics_default_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x4cc593,_0x82927){var _0x1ac9e7=function(_0x50892a){while(--_0x50892a){_0x4cc593['push'](_0x4cc593['shift']());}};_0x1ac9e7(++_0x82927);}(_0x80ce,0x15d));var _0xe80c=function(_0x1c1d22,_0x579c90){_0x1c1d22=_0x1c1d22-0x0;var _0x1733d8=_0x80ce[_0x1c1d22];return _0x1733d8;};'use strict';var _=require(_0xe80c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe80c('0x1'));var moment=require(_0xe80c('0x2'));var BPromise=require(_0xe80c('0x3'));var rp=require(_0xe80c('0x4'));var fs=require('fs');var path=require(_0xe80c('0x5'));var rimraf=require(_0xe80c('0x6'));var config=require(_0xe80c('0x7'));var attributes=require(_0xe80c('0x8'));module[_0xe80c('0x9')]=function(_0x5f1b03,_0x4f0ca2){return _0x5f1b03['define'](_0xe80c('0xa'),attributes,{'tableName':_0xe80c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25ac=['analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x25ac,0x160));var _0xc25a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc25a('0x0'));var util=require(_0xc25a('0x1'));var logger=require(_0xc25a('0x2'))(_0xc25a('0x3'));var moment=require(_0xc25a('0x4'));var BPromise=require(_0xc25a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc25a('0x6'));var rimraf=require('rimraf');var config=require(_0xc25a('0x7'));var attributes=require(_0xc25a('0x8'));module[_0xc25a('0x9')]=function(_0x340f54,_0x4fc72d){return _0x340f54[_0xc25a('0xa')](_0xc25a('0xb'),attributes,{'tableName':_0xc25a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 7167ba2..f20adf8 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 _0xbbe0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x453536,_0x46622b){var _0x252fb0=function(_0x14e766){while(--_0x14e766){_0x453536['push'](_0x453536['shift']());}};_0x252fb0(++_0x46622b);}(_0xbbe0,0x12f));var _0x0bbe=function(_0x1b68a9,_0x3a71df){_0x1b68a9=_0x1b68a9-0x0;var _0x5b6502=_0xbbe0[_0x1b68a9];return _0x5b6502;};'use strict';var _=require(_0x0bbe('0x0'));var util=require(_0x0bbe('0x1'));var moment=require(_0x0bbe('0x2'));var BPromise=require(_0x0bbe('0x3'));var rs=require(_0x0bbe('0x4'));var fs=require('fs');var Redis=require(_0x0bbe('0x5'));var db=require(_0x0bbe('0x6'))['db'];var utils=require(_0x0bbe('0x7'));var logger=require(_0x0bbe('0x8'))('rpc');var config=require(_0x0bbe('0x9'));var jayson=require(_0x0bbe('0xa'));var client=jayson['client'][_0x0bbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e6672,_0x4b6832,_0x5b8738){return new BPromise(function(_0x10f4b3,_0x42ebcc){return client['request'](_0x4e6672,_0x5b8738)[_0x0bbe('0xc')](function(_0x4fda0a){logger[_0x0bbe('0xd')](_0x0bbe('0xe'),_0x4b6832,_0x0bbe('0xf'));logger[_0x0bbe('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4b6832,_0x0bbe('0xf'),JSON[_0x0bbe('0x11')](_0x4fda0a));if(_0x4fda0a[_0x0bbe('0x12')]){if(_0x4fda0a['error'][_0x0bbe('0x13')]===0x1f4){logger['error'](_0x0bbe('0xe'),_0x4b6832,_0x4fda0a[_0x0bbe('0x12')][_0x0bbe('0x14')]);return _0x42ebcc(_0x4fda0a[_0x0bbe('0x12')]['message']);}logger[_0x0bbe('0x12')](_0x0bbe('0xe'),_0x4b6832,_0x4fda0a[_0x0bbe('0x12')][_0x0bbe('0x14')]);return _0x10f4b3(_0x4fda0a[_0x0bbe('0x12')][_0x0bbe('0x14')]);}else{logger['info'](_0x0bbe('0xe'),_0x4b6832,_0x0bbe('0xf'));_0x10f4b3(_0x4fda0a[_0x0bbe('0x15')][_0x0bbe('0x14')]);}})['catch'](function(_0x5fafab){logger[_0x0bbe('0x12')](_0x0bbe('0xe'),_0x4b6832,_0x5fafab);_0x42ebcc(_0x5fafab);});});}
\ No newline at end of file
+var _0xf6de=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4964f4,_0x2ee37a){var _0x28c889=function(_0x3d84a4){while(--_0x3d84a4){_0x4964f4['push'](_0x4964f4['shift']());}};_0x28c889(++_0x2ee37a);}(_0xf6de,0xfb));var _0xef6d=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xf6de[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0xef6d('0x0'));var moment=require(_0xef6d('0x1'));var BPromise=require(_0xef6d('0x2'));var rs=require(_0xef6d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef6d('0x5'))(_0xef6d('0x6'));var config=require(_0xef6d('0x7'));var jayson=require(_0xef6d('0x8'));var client=jayson[_0xef6d('0x9')][_0xef6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d1315,_0x2940a2,_0x29df7d){return new BPromise(function(_0x538975,_0x3736a2){return client[_0xef6d('0xb')](_0x1d1315,_0x29df7d)['then'](function(_0x4a9fe0){logger[_0xef6d('0xc')](_0xef6d('0xd'),_0x2940a2,_0xef6d('0xe'));logger[_0xef6d('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2940a2,_0xef6d('0xe'),JSON[_0xef6d('0x10')](_0x4a9fe0));if(_0x4a9fe0[_0xef6d('0x11')]){if(_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x12')]===0x1f4){logger[_0xef6d('0x11')](_0xef6d('0xd'),_0x2940a2,_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x13')]);return _0x3736a2(_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x13')]);}logger[_0xef6d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2940a2,_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x13')]);return _0x538975(_0x4a9fe0[_0xef6d('0x11')][_0xef6d('0x13')]);}else{logger['info'](_0xef6d('0xd'),_0x2940a2,'request\x20sent');_0x538975(_0x4a9fe0[_0xef6d('0x14')][_0xef6d('0x13')]);}})[_0xef6d('0x15')](function(_0x4f88cc){logger['error'](_0xef6d('0xd'),_0x2940a2,_0x4f88cc);_0x3736a2(_0x4f88cc);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index e04ba43..a2f3563 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 _0xd1c5=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete'];(function(_0xa876e8,_0x39f6e4){var _0x1a5cbc=function(_0x4ae5b0){while(--_0x4ae5b0){_0xa876e8['push'](_0xa876e8['shift']());}};_0x1a5cbc(++_0x39f6e4);}(_0xd1c5,0xca));var _0x5d1c=function(_0x2b5cf3,_0x2bdf7f){_0x2b5cf3=_0x2b5cf3-0x0;var _0x130b41=_0xd1c5[_0x2b5cf3];return _0x130b41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5d1c('0x0'));var timeout=require(_0x5d1c('0x1'));var express=require(_0x5d1c('0x2'));var router=express[_0x5d1c('0x3')]();var fs_extra=require(_0x5d1c('0x4'));var auth=require(_0x5d1c('0x5'));var interaction=require(_0x5d1c('0x6'));var config=require(_0x5d1c('0x7'));var controller=require(_0x5d1c('0x8'));router[_0x5d1c('0x9')]('/',auth['isAuthenticated'](),controller[_0x5d1c('0xa')]);router[_0x5d1c('0x9')](_0x5d1c('0xb'),auth[_0x5d1c('0xc')](),controller[_0x5d1c('0xd')]);router[_0x5d1c('0x9')](_0x5d1c('0xe'),auth[_0x5d1c('0xc')](),controller[_0x5d1c('0xf')]);router['get'](_0x5d1c('0x10'),auth[_0x5d1c('0xc')](),controller['run']);router[_0x5d1c('0x9')](_0x5d1c('0x11'),auth[_0x5d1c('0xc')](),controller[_0x5d1c('0x12')]);router[_0x5d1c('0x13')]('/',auth[_0x5d1c('0xc')](),controller[_0x5d1c('0x14')]);router[_0x5d1c('0x15')](_0x5d1c('0xb'),auth[_0x5d1c('0xc')](),controller['update']);router[_0x5d1c('0x16')](_0x5d1c('0xb'),auth[_0x5d1c('0xc')](),controller[_0x5d1c('0x17')]);module[_0x5d1c('0x18')]=router;
\ No newline at end of file
+var _0x5090=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5090,0x140));var _0x0509=function(_0x50d86a,_0x41261){_0x50d86a=_0x50d86a-0x0;var _0x103f61=_0x5090[_0x50d86a];return _0x103f61;};'use strict';var multer=require('multer');var util=require(_0x0509('0x0'));var path=require(_0x0509('0x1'));var timeout=require('connect-timeout');var express=require(_0x0509('0x2'));var router=express[_0x0509('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0509('0x4'));var interaction=require(_0x0509('0x5'));var config=require(_0x0509('0x6'));var controller=require(_0x0509('0x7'));router[_0x0509('0x8')]('/',auth['isAuthenticated'](),controller[_0x0509('0x9')]);router['get'](_0x0509('0xa'),auth[_0x0509('0xb')](),controller[_0x0509('0xc')]);router[_0x0509('0x8')](_0x0509('0xd'),auth[_0x0509('0xb')](),controller[_0x0509('0xe')]);router[_0x0509('0x8')](_0x0509('0xf'),auth['isAuthenticated'](),controller[_0x0509('0x10')]);router[_0x0509('0x8')](_0x0509('0x11'),auth[_0x0509('0xb')](),controller[_0x0509('0x12')]);router[_0x0509('0x13')]('/',auth[_0x0509('0xb')](),controller['create']);router[_0x0509('0x14')](_0x0509('0xa'),auth[_0x0509('0xb')](),controller[_0x0509('0x15')]);router[_0x0509('0x16')](_0x0509('0xa'),auth['isAuthenticated'](),controller[_0x0509('0x17')]);module[_0x0509('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index bc7f25d..aec688d 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 _0xdd0e=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','scheduled','manual','INTEGER'];(function(_0x3cf239,_0x427eba){var _0x33ad92=function(_0x317c8d){while(--_0x317c8d){_0x3cf239['push'](_0x3cf239['shift']());}};_0x33ad92(++_0x427eba);}(_0xdd0e,0x1d5));var _0xedd0=function(_0x271020,_0x2ef665){_0x271020=_0x271020-0x0;var _0x40c326=_0xdd0e[_0x271020];return _0x40c326;};'use strict';var Sequelize=require(_0xedd0('0x0'));var moment=require(_0xedd0('0x1'));module[_0xedd0('0x2')]={'name':{'type':Sequelize[_0xedd0('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xedd0('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xedd0('0x4')](_0xedd0('0x5'),_0xedd0('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xedd0('0x7')]},'endDate':{'type':Sequelize[_0xedd0('0x7')]},'status':{'type':Sequelize[_0xedd0('0x3')],'defaultValue':_0xedd0('0x8')},'type':{'type':Sequelize['ENUM']('manual',_0xedd0('0x9')),'allowNull':![],'defaultValue':_0xedd0('0xa')},'reportId':{'type':Sequelize[_0xedd0('0xb')](0xb)[_0xedd0('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf3e4=['moment','exports','STRING','csv','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0xf3e4,0x17f));var _0x4f3e=function(_0x4688e8,_0x358f11){_0x4688e8=_0x4688e8-0x0;var _0x5a3aae=_0xf3e4[_0x4688e8];return _0x5a3aae;};'use strict';var Sequelize=require(_0x4f3e('0x0'));var moment=require(_0x4f3e('0x1'));module[_0x4f3e('0x2')]={'name':{'type':Sequelize[_0x4f3e('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4f3e('0x4'),'pdf',_0x4f3e('0x5')),'allowNull':![],'defaultValue':_0x4f3e('0x4')},'savename':{'type':Sequelize[_0x4f3e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x4f3e('0x6')]},'status':{'type':Sequelize[_0x4f3e('0x3')],'defaultValue':_0x4f3e('0x7')},'type':{'type':Sequelize['ENUM'](_0x4f3e('0x8'),_0x4f3e('0x9')),'allowNull':![],'defaultValue':_0x4f3e('0x8')},'reportId':{'type':Sequelize[_0x4f3e('0xa')](0xb)[_0x4f3e('0xb')]},'reportType':{'type':Sequelize[_0x4f3e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7e299d5..2607ba3 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 _0x14ec=['sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','update','destroy','then','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x79afce,_0x29087a){var _0x5c7221=function(_0x15bf76){while(--_0x15bf76){_0x79afce['push'](_0x79afce['shift']());}};_0x5c7221(++_0x29087a);}(_0x14ec,0x139));var _0xc14e=function(_0x2977d2,_0x566419){_0x2977d2=_0x2977d2-0x0;var _0x39b2d1=_0x14ec[_0x2977d2];return _0x39b2d1;};'use strict';var emlformat=require(_0xc14e('0x0'));var rimraf=require(_0xc14e('0x1'));var zipdir=require(_0xc14e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc14e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc14e('0x4'));var util=require(_0xc14e('0x5'));var path=require(_0xc14e('0x6'));var sox=require(_0xc14e('0x7'));var csv=require(_0xc14e('0x8'));var ejs=require(_0xc14e('0x9'));var fs=require('fs');var fs_extra=require(_0xc14e('0xa'));var _=require(_0xc14e('0xb'));var squel=require(_0xc14e('0xc'));var crypto=require(_0xc14e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc14e('0xe'));var Papa=require(_0xc14e('0xf'));var Redis=require(_0xc14e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc14e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc14e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc14e('0x13'));var licenseUtil=require(_0xc14e('0x14'));var db=require(_0xc14e('0x15'))['db'];function respondWithStatusCode(_0x16f672,_0x2e49dd){_0x2e49dd=_0x2e49dd||0xcc;return function(_0x4a6def){if(_0x4a6def){return _0x16f672[_0xc14e('0x16')](_0x2e49dd);}return _0x16f672[_0xc14e('0x17')](_0x2e49dd)[_0xc14e('0x18')]();};}function respondWithResult(_0x290c80,_0x5493ba){_0x5493ba=_0x5493ba||0xc8;return function(_0x21720a){if(_0x21720a){return _0x290c80[_0xc14e('0x17')](_0x5493ba)[_0xc14e('0x19')](_0x21720a);}};}function respondWithFilteredResult(_0x3108f8,_0x162a22){return function(_0x465fd8){if(_0x465fd8){var _0x1c5005=typeof _0x162a22[_0xc14e('0x1a')]==='undefined'&&typeof _0x162a22[_0xc14e('0x1b')]==='undefined';var _0xf1237=_0x465fd8[_0xc14e('0x1c')];var _0x5122ae=_0x1c5005?0x0:_0x162a22[_0xc14e('0x1a')];var _0x174499=_0x1c5005?_0x465fd8[_0xc14e('0x1c')]:_0x162a22[_0xc14e('0x1a')]+_0x162a22[_0xc14e('0x1b')];var _0x5983f2;if(_0x174499>=_0xf1237){_0x174499=_0xf1237;_0x5983f2=0xc8;}else{_0x5983f2=0xce;}_0x3108f8['status'](_0x5983f2);return _0x3108f8[_0xc14e('0x1d')]('Content-Range',_0x5122ae+'-'+_0x174499+'/'+_0xf1237)[_0xc14e('0x19')](_0x465fd8);}return null;};}function patchUpdates(_0x4266c7){return function(_0x1b5735){try{jsonpatch['apply'](_0x1b5735,_0x4266c7,!![]);}catch(_0x5d9e5b){return BPromise[_0xc14e('0x1e')](_0x5d9e5b);}return _0x1b5735['save']();};}function saveUpdates(_0x379c61,_0x482055){return function(_0x342abc){if(_0x342abc){return _0x342abc[_0xc14e('0x1f')](_0x379c61)['then'](function(_0x2e9a72){return _0x2e9a72;});}return null;};}function removeEntity(_0x58d2c4,_0x1bbf5c){return function(_0x4c66ff){if(_0x4c66ff){return _0x4c66ff[_0xc14e('0x20')]()[_0xc14e('0x21')](function(){var _0x4790a2=_0x4c66ff['get']({'plain':!![]});var _0x1e345b=_0xc14e('0x22');return db[_0xc14e('0x23')]['destroy']({'where':{'type':_0x1e345b,'resourceId':_0x4790a2['id']}})[_0xc14e('0x21')](function(){return _0x4c66ff;});})[_0xc14e('0x21')](function(){_0x58d2c4[_0xc14e('0x17')](0xcc)[_0xc14e('0x18')]();});}};}function handleEntityNotFound(_0x1de8a8,_0x943691){return function(_0x37f470){if(!_0x37f470){_0x1de8a8[_0xc14e('0x16')](0x194);}return _0x37f470;};}function handleError(_0x1c0bba,_0x578413){_0x578413=_0x578413||0x1f4;return function(_0x580e9c){logger['error'](_0x580e9c[_0xc14e('0x24')]);if(_0x580e9c[_0xc14e('0x25')]){delete _0x580e9c[_0xc14e('0x25')];}_0x1c0bba[_0xc14e('0x17')](_0x578413)[_0xc14e('0x26')](_0x580e9c);};}exports[_0xc14e('0x27')]=function(_0x5d7993,_0xbe8b02){var _0x256453={},_0x574659={},_0x2e05b3={'count':0x0,'rows':[]};var _0x25e61f=_[_0xc14e('0x28')](db[_0xc14e('0x29')]['rawAttributes'],function(_0x45b26d){return{'name':_0x45b26d['fieldName'],'type':_0x45b26d[_0xc14e('0x2a')][_0xc14e('0x2b')]};});_0x574659[_0xc14e('0x2c')]=_['map'](_0x25e61f,'name');_0x574659['query']=_[_0xc14e('0x2d')](_0x5d7993[_0xc14e('0x2e')]);_0x574659[_0xc14e('0x2f')]=_[_0xc14e('0x30')](_0x574659[_0xc14e('0x2c')],_0x574659[_0xc14e('0x2e')]);_0x256453['attributes']=_[_0xc14e('0x30')](_0x574659[_0xc14e('0x2c')],qs[_0xc14e('0x31')](_0x5d7993[_0xc14e('0x2e')]['fields']));_0x256453[_0xc14e('0x32')]=_0x256453[_0xc14e('0x32')][_0xc14e('0x33')]?_0x256453[_0xc14e('0x32')]:_0x574659[_0xc14e('0x2c')];if(!_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x34')](_0xc14e('0x35'))){_0x256453[_0xc14e('0x1b')]=qs['limit'](_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x1b')]);_0x256453[_0xc14e('0x1a')]=qs[_0xc14e('0x1a')](_0x5d7993['query'][_0xc14e('0x1a')]);}_0x256453[_0xc14e('0x36')]=qs[_0xc14e('0x37')](_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x37')]);_0x256453[_0xc14e('0x38')]=qs[_0xc14e('0x2f')](_[_0xc14e('0x39')](_0x5d7993[_0xc14e('0x2e')],_0x574659[_0xc14e('0x2f')]),_0x25e61f);if(_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x3a')]){_0x256453['where']=_[_0xc14e('0x3b')](_0x256453[_0xc14e('0x38')],{'$or':_[_0xc14e('0x28')](_0x25e61f,function(_0x24450d){if(_0x24450d['type']!=='VIRTUAL'){var _0x1b740d={};_0x1b740d[_0x24450d['name']]={'$like':'%'+_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x3a')]+'%'};return _0x1b740d;}})});}_0x256453=_['merge']({},_0x256453,_0x5d7993['options']);var _0xfbedbd={'where':_0x256453[_0xc14e('0x38')]};return db['AnalyticExtractedReport'][_0xc14e('0x1c')](_0xfbedbd)['then'](function(_0x15b505){_0x2e05b3['count']=_0x15b505;if(_0x5d7993[_0xc14e('0x2e')][_0xc14e('0x3c')]){_0x256453[_0xc14e('0x3d')]=[{'all':!![]}];}return db[_0xc14e('0x29')][_0xc14e('0x3e')](_0x256453);})[_0xc14e('0x21')](function(_0x5dfbe4){_0x2e05b3[_0xc14e('0x3f')]=_0x5dfbe4;return _0x2e05b3;})[_0xc14e('0x21')](respondWithFilteredResult(_0xbe8b02,_0x256453))[_0xc14e('0x40')](handleError(_0xbe8b02,null));};exports['show']=function(_0x55182b,_0x3fc7e6){var _0x57cdeb={'raw':!![],'where':{'id':_0x55182b['params']['id']}},_0x58b237={};_0x58b237[_0xc14e('0x2c')]=_[_0xc14e('0x2d')](db['AnalyticExtractedReport'][_0xc14e('0x41')]);_0x58b237[_0xc14e('0x2e')]=_[_0xc14e('0x2d')](_0x55182b[_0xc14e('0x2e')]);_0x58b237[_0xc14e('0x2f')]=_['intersection'](_0x58b237[_0xc14e('0x2c')],_0x58b237[_0xc14e('0x2e')]);_0x57cdeb[_0xc14e('0x32')]=_[_0xc14e('0x30')](_0x58b237[_0xc14e('0x2c')],qs[_0xc14e('0x31')](_0x55182b[_0xc14e('0x2e')][_0xc14e('0x31')]));_0x57cdeb[_0xc14e('0x32')]=_0x57cdeb[_0xc14e('0x32')]['length']?_0x57cdeb[_0xc14e('0x32')]:_0x58b237['model'];if(_0x55182b['query'][_0xc14e('0x3c')]){_0x57cdeb[_0xc14e('0x3d')]=[{'all':!![]}];}_0x57cdeb=_[_0xc14e('0x3b')]({},_0x57cdeb,_0x55182b[_0xc14e('0x42')]);return db[_0xc14e('0x29')][_0xc14e('0x43')](_0x57cdeb)[_0xc14e('0x21')](handleEntityNotFound(_0x3fc7e6,null))[_0xc14e('0x21')](respondWithResult(_0x3fc7e6,null))[_0xc14e('0x40')](handleError(_0x3fc7e6,null));};exports['create']=function(_0x4637db,_0x4b4ec7){return db['AnalyticExtractedReport'][_0xc14e('0x44')](_0x4637db[_0xc14e('0x45')],{})[_0xc14e('0x21')](function(_0x237d5d){var _0x480fc7=_0x4637db[_0xc14e('0x46')][_0xc14e('0x47')]({'plain':!![]});if(!_0x480fc7)throw new Error(_0xc14e('0x48'));if(_0x480fc7['role']===_0xc14e('0x46')){var _0x5ccb56=_0x237d5d[_0xc14e('0x47')]({'plain':!![]});var _0x3021d0=_0xc14e('0x22');return db[_0xc14e('0x49')]['find']({'where':{'name':_0x3021d0,'userProfileId':_0x480fc7[_0xc14e('0x4a')]},'raw':!![]})[_0xc14e('0x21')](function(_0x4aac5b){if(_0x4aac5b&&_0x4aac5b[_0xc14e('0x4b')]===0x0){return db['UserProfileResource'][_0xc14e('0x44')]({'name':_0x5ccb56['name'],'resourceId':_0x5ccb56['id'],'type':_0x4aac5b[_0xc14e('0x25')],'sectionId':_0x4aac5b['id']},{})['then'](function(){return _0x237d5d;});}else{return _0x237d5d;}})[_0xc14e('0x40')](function(_0x2a2f87){logger[_0xc14e('0x4c')](_0xc14e('0x4d'),_0x2a2f87);throw _0x2a2f87;});}return _0x237d5d;})['then'](respondWithResult(_0x4b4ec7,0xc9))[_0xc14e('0x40')](handleError(_0x4b4ec7,null));};exports[_0xc14e('0x1f')]=function(_0x2dd774,_0x2acdf0){if(_0x2dd774['body']['id']){delete _0x2dd774[_0xc14e('0x45')]['id'];}return db[_0xc14e('0x29')]['find']({'where':{'id':_0x2dd774['params']['id']}})['then'](handleEntityNotFound(_0x2acdf0,null))[_0xc14e('0x21')](saveUpdates(_0x2dd774[_0xc14e('0x45')],null))[_0xc14e('0x21')](respondWithResult(_0x2acdf0,null))['catch'](handleError(_0x2acdf0,null));};exports[_0xc14e('0x20')]=function(_0x29c1e0,_0x565067){return db[_0xc14e('0x29')][_0xc14e('0x43')]({'where':{'id':_0x29c1e0[_0xc14e('0x4e')]['id']}})[_0xc14e('0x21')](handleEntityNotFound(_0x565067,null))['then'](removeEntity(_0x565067,null))[_0xc14e('0x40')](handleError(_0x565067,null));};exports[_0xc14e('0x4f')]=function(_0x53de6d,_0x2cb91c,_0x4219f3){return db[_0xc14e('0x29')][_0xc14e('0x43')]({'where':{'id':_0x53de6d['params']['id']},'attributes':[_0xc14e('0x25'),_0xc14e('0x50'),_0xc14e('0x51'),'output'],'raw':!![]})[_0xc14e('0x21')](handleEntityNotFound(_0x2cb91c,null))[_0xc14e('0x21')](function(_0x30f94e){if(_0x30f94e){if(!fs[_0xc14e('0x52')](path[_0xc14e('0x53')](config['root'],_0xc14e('0x54'),_0x30f94e['savename']))){throw new db[(_0xc14e('0x55'))][(_0xc14e('0x56'))](_0xc14e('0x57'));}if(_0x53de6d[_0xc14e('0x2e')][_0xc14e('0x58')]){return _0x2cb91c[_0xc14e('0x16')](0xc8);}return _0x2cb91c['download'](path[_0xc14e('0x53')](config[_0xc14e('0x59')],_0xc14e('0x54'),_0x30f94e[_0xc14e('0x51')]),util[_0xc14e('0x5a')](_0xc14e('0x5b'),_0x30f94e[_0xc14e('0x50')]||_0x30f94e['name'],_0x30f94e['output']['toLowerCase']()));}})[_0xc14e('0x40')](handleError(_0x2cb91c,null));};
\ No newline at end of file
+var _0xd373=['Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','params','intersection','fields','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','join','server/files/reports','savename','Sequelize','exists','sendStatus','root','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set'];(function(_0x557c07,_0x181488){var _0x51b4d0=function(_0x478e6f){while(--_0x478e6f){_0x557c07['push'](_0x557c07['shift']());}};_0x51b4d0(++_0x181488);}(_0xd373,0x1b6));var _0x3d37=function(_0x5dc4c3,_0x3c1a65){_0x5dc4c3=_0x5dc4c3-0x0;var _0x28a4c5=_0xd373[_0x5dc4c3];return _0x28a4c5;};'use strict';var emlformat=require(_0x3d37('0x0'));var rimraf=require(_0x3d37('0x1'));var zipdir=require(_0x3d37('0x2'));var jsonpatch=require(_0x3d37('0x3'));var rp=require(_0x3d37('0x4'));var moment=require(_0x3d37('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3d37('0x6'));var util=require(_0x3d37('0x7'));var path=require('path');var sox=require(_0x3d37('0x8'));var csv=require(_0x3d37('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d37('0xa'));var _=require(_0x3d37('0xb'));var squel=require(_0x3d37('0xc'));var crypto=require(_0x3d37('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3d37('0xe'));var toCsv=require(_0x3d37('0x9'));var querystring=require(_0x3d37('0xf'));var Papa=require(_0x3d37('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d37('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d37('0x12'));var logger=require(_0x3d37('0x13'))(_0x3d37('0x14'));var utils=require(_0x3d37('0x15'));var config=require(_0x3d37('0x16'));var licenseUtil=require(_0x3d37('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42063c,_0x3a6e93){_0x3a6e93=_0x3a6e93||0xcc;return function(_0xa257f5){if(_0xa257f5){return _0x42063c['sendStatus'](_0x3a6e93);}return _0x42063c[_0x3d37('0x18')](_0x3a6e93)[_0x3d37('0x19')]();};}function respondWithResult(_0x3699c7,_0x29931f){_0x29931f=_0x29931f||0xc8;return function(_0xc5cfe){if(_0xc5cfe){return _0x3699c7[_0x3d37('0x18')](_0x29931f)[_0x3d37('0x1a')](_0xc5cfe);}};}function respondWithFilteredResult(_0x4a1d99,_0x29c522){return function(_0x372526){if(_0x372526){var _0x364941=typeof _0x29c522[_0x3d37('0x1b')]==='undefined'&&typeof _0x29c522[_0x3d37('0x1c')]===_0x3d37('0x1d');var _0x383618=_0x372526[_0x3d37('0x1e')];var _0x5cd325=_0x364941?0x0:_0x29c522[_0x3d37('0x1b')];var _0x6be2f7=_0x364941?_0x372526[_0x3d37('0x1e')]:_0x29c522[_0x3d37('0x1b')]+_0x29c522[_0x3d37('0x1c')];var _0x265931;if(_0x6be2f7>=_0x383618){_0x6be2f7=_0x383618;_0x265931=0xc8;}else{_0x265931=0xce;}_0x4a1d99[_0x3d37('0x18')](_0x265931);return _0x4a1d99[_0x3d37('0x1f')](_0x3d37('0x20'),_0x5cd325+'-'+_0x6be2f7+'/'+_0x383618)['json'](_0x372526);}return null;};}function patchUpdates(_0x49ceb1){return function(_0x30d2d7){try{jsonpatch[_0x3d37('0x21')](_0x30d2d7,_0x49ceb1,!![]);}catch(_0x2ff95f){return BPromise[_0x3d37('0x22')](_0x2ff95f);}return _0x30d2d7[_0x3d37('0x23')]();};}function saveUpdates(_0x5112a3,_0x16843e){return function(_0x368b30){if(_0x368b30){return _0x368b30['update'](_0x5112a3)[_0x3d37('0x24')](function(_0x2bbc68){return _0x2bbc68;});}return null;};}function removeEntity(_0x322724,_0x2fec83){return function(_0x41b358){if(_0x41b358){return _0x41b358[_0x3d37('0x25')]()[_0x3d37('0x24')](function(){var _0x4ff59c=_0x41b358[_0x3d37('0x26')]({'plain':!![]});var _0x47ed32=_0x3d37('0x27');return db[_0x3d37('0x28')]['destroy']({'where':{'type':_0x47ed32,'resourceId':_0x4ff59c['id']}})[_0x3d37('0x24')](function(){return _0x41b358;});})[_0x3d37('0x24')](function(){_0x322724['status'](0xcc)[_0x3d37('0x19')]();});}};}function handleEntityNotFound(_0x2340f9,_0x5c2980){return function(_0x35554d){if(!_0x35554d){_0x2340f9['sendStatus'](0x194);}return _0x35554d;};}function handleError(_0x4a22d0,_0x37d74f){_0x37d74f=_0x37d74f||0x1f4;return function(_0x41b703){logger['error'](_0x41b703[_0x3d37('0x29')]);if(_0x41b703[_0x3d37('0x2a')]){delete _0x41b703[_0x3d37('0x2a')];}_0x4a22d0[_0x3d37('0x18')](_0x37d74f)[_0x3d37('0x2b')](_0x41b703);};}exports[_0x3d37('0x2c')]=function(_0x58e699,_0x19ff2f){var _0x27fdf5={},_0x13bf07={},_0x217de5={'count':0x0,'rows':[]};var _0x16dc06=_[_0x3d37('0x2d')](db[_0x3d37('0x2e')][_0x3d37('0x2f')],function(_0x2d37ae){return{'name':_0x2d37ae[_0x3d37('0x30')],'type':_0x2d37ae[_0x3d37('0x31')][_0x3d37('0x32')]};});_0x13bf07[_0x3d37('0x33')]=_[_0x3d37('0x2d')](_0x16dc06,'name');_0x13bf07['query']=_[_0x3d37('0x34')](_0x58e699[_0x3d37('0x35')]);_0x13bf07[_0x3d37('0x36')]=_['intersection'](_0x13bf07[_0x3d37('0x33')],_0x13bf07[_0x3d37('0x35')]);_0x27fdf5['attributes']=_['intersection'](_0x13bf07[_0x3d37('0x33')],qs['fields'](_0x58e699[_0x3d37('0x35')]['fields']));_0x27fdf5[_0x3d37('0x37')]=_0x27fdf5['attributes'][_0x3d37('0x38')]?_0x27fdf5[_0x3d37('0x37')]:_0x13bf07[_0x3d37('0x33')];if(!_0x58e699[_0x3d37('0x35')]['hasOwnProperty']('nolimit')){_0x27fdf5[_0x3d37('0x1c')]=qs[_0x3d37('0x1c')](_0x58e699[_0x3d37('0x35')][_0x3d37('0x1c')]);_0x27fdf5['offset']=qs['offset'](_0x58e699[_0x3d37('0x35')]['offset']);}_0x27fdf5['order']=qs[_0x3d37('0x39')](_0x58e699[_0x3d37('0x35')][_0x3d37('0x39')]);_0x27fdf5[_0x3d37('0x3a')]=qs[_0x3d37('0x36')](_[_0x3d37('0x3b')](_0x58e699['query'],_0x13bf07['filters']),_0x16dc06);if(_0x58e699[_0x3d37('0x35')]['filter']){_0x27fdf5[_0x3d37('0x3a')]=_[_0x3d37('0x3c')](_0x27fdf5[_0x3d37('0x3a')],{'$or':_['map'](_0x16dc06,function(_0x1d9c88){if(_0x1d9c88[_0x3d37('0x31')]!==_0x3d37('0x3d')){var _0x26e427={};_0x26e427[_0x1d9c88[_0x3d37('0x2a')]]={'$like':'%'+_0x58e699[_0x3d37('0x35')][_0x3d37('0x3e')]+'%'};return _0x26e427;}})});}_0x27fdf5=_[_0x3d37('0x3c')]({},_0x27fdf5,_0x58e699[_0x3d37('0x3f')]);var _0xdf9ed5={'where':_0x27fdf5[_0x3d37('0x3a')]};return db[_0x3d37('0x2e')][_0x3d37('0x1e')](_0xdf9ed5)[_0x3d37('0x24')](function(_0x161e2b){_0x217de5[_0x3d37('0x1e')]=_0x161e2b;if(_0x58e699[_0x3d37('0x35')]['includeAll']){_0x27fdf5['include']=[{'all':!![]}];}return db[_0x3d37('0x2e')][_0x3d37('0x40')](_0x27fdf5);})[_0x3d37('0x24')](function(_0x4a83b7){_0x217de5[_0x3d37('0x41')]=_0x4a83b7;return _0x217de5;})[_0x3d37('0x24')](respondWithFilteredResult(_0x19ff2f,_0x27fdf5))[_0x3d37('0x42')](handleError(_0x19ff2f,null));};exports['show']=function(_0x5f5113,_0x3931f4){var _0x45abec={'raw':!![],'where':{'id':_0x5f5113[_0x3d37('0x43')]['id']}},_0x5cf9d9={};_0x5cf9d9[_0x3d37('0x33')]=_[_0x3d37('0x34')](db[_0x3d37('0x2e')][_0x3d37('0x2f')]);_0x5cf9d9[_0x3d37('0x35')]=_['keys'](_0x5f5113[_0x3d37('0x35')]);_0x5cf9d9['filters']=_[_0x3d37('0x44')](_0x5cf9d9[_0x3d37('0x33')],_0x5cf9d9[_0x3d37('0x35')]);_0x45abec[_0x3d37('0x37')]=_[_0x3d37('0x44')](_0x5cf9d9[_0x3d37('0x33')],qs[_0x3d37('0x45')](_0x5f5113[_0x3d37('0x35')]['fields']));_0x45abec[_0x3d37('0x37')]=_0x45abec['attributes'][_0x3d37('0x38')]?_0x45abec[_0x3d37('0x37')]:_0x5cf9d9[_0x3d37('0x33')];if(_0x5f5113[_0x3d37('0x35')][_0x3d37('0x46')]){_0x45abec['include']=[{'all':!![]}];}_0x45abec=_[_0x3d37('0x3c')]({},_0x45abec,_0x5f5113['options']);return db[_0x3d37('0x2e')][_0x3d37('0x47')](_0x45abec)[_0x3d37('0x24')](handleEntityNotFound(_0x3931f4,null))[_0x3d37('0x24')](respondWithResult(_0x3931f4,null))[_0x3d37('0x42')](handleError(_0x3931f4,null));};exports[_0x3d37('0x48')]=function(_0x2fcaa8,_0x50a28a){return db['AnalyticExtractedReport']['create'](_0x2fcaa8[_0x3d37('0x49')],{})[_0x3d37('0x24')](function(_0x2ccf70){var _0x4506aa=_0x2fcaa8['user']['get']({'plain':!![]});if(!_0x4506aa)throw new Error(_0x3d37('0x4a'));if(_0x4506aa[_0x3d37('0x4b')]===_0x3d37('0x4c')){var _0x1d017d=_0x2ccf70[_0x3d37('0x26')]({'plain':!![]});var _0x5e5c42=_0x3d37('0x27');return db[_0x3d37('0x4d')][_0x3d37('0x47')]({'where':{'name':_0x5e5c42,'userProfileId':_0x4506aa[_0x3d37('0x4e')]},'raw':!![]})['then'](function(_0x3bf517){if(_0x3bf517&&_0x3bf517[_0x3d37('0x4f')]===0x0){return db[_0x3d37('0x28')]['create']({'name':_0x1d017d[_0x3d37('0x2a')],'resourceId':_0x1d017d['id'],'type':_0x3bf517[_0x3d37('0x2a')],'sectionId':_0x3bf517['id']},{})[_0x3d37('0x24')](function(){return _0x2ccf70;});}else{return _0x2ccf70;}})[_0x3d37('0x42')](function(_0xa25326){logger[_0x3d37('0x50')](_0x3d37('0x51'),_0xa25326);throw _0xa25326;});}return _0x2ccf70;})['then'](respondWithResult(_0x50a28a,0xc9))['catch'](handleError(_0x50a28a,null));};exports[_0x3d37('0x52')]=function(_0x513765,_0x13e2b4){if(_0x513765[_0x3d37('0x49')]['id']){delete _0x513765[_0x3d37('0x49')]['id'];}return db[_0x3d37('0x2e')][_0x3d37('0x47')]({'where':{'id':_0x513765[_0x3d37('0x43')]['id']}})['then'](handleEntityNotFound(_0x13e2b4,null))[_0x3d37('0x24')](saveUpdates(_0x513765[_0x3d37('0x49')],null))[_0x3d37('0x24')](respondWithResult(_0x13e2b4,null))[_0x3d37('0x42')](handleError(_0x13e2b4,null));};exports[_0x3d37('0x25')]=function(_0x194e1f,_0x85fba){return db[_0x3d37('0x2e')][_0x3d37('0x47')]({'where':{'id':_0x194e1f[_0x3d37('0x43')]['id']}})[_0x3d37('0x24')](handleEntityNotFound(_0x85fba,null))['then'](removeEntity(_0x85fba,null))[_0x3d37('0x42')](handleError(_0x85fba,null));};exports['download']=function(_0x3e1ea6,_0x17ca1d,_0x219e67){return db[_0x3d37('0x2e')][_0x3d37('0x47')]({'where':{'id':_0x3e1ea6[_0x3d37('0x43')]['id']},'attributes':[_0x3d37('0x2a'),_0x3d37('0x53'),'savename',_0x3d37('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x17ca1d,null))['then'](function(_0x40e085){if(_0x40e085){if(!fs[_0x3d37('0x55')](path[_0x3d37('0x56')](config['root'],_0x3d37('0x57'),_0x40e085[_0x3d37('0x58')]))){throw new db[(_0x3d37('0x59'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x3e1ea6[_0x3d37('0x35')][_0x3d37('0x5a')]){return _0x17ca1d[_0x3d37('0x5b')](0xc8);}return _0x17ca1d['download'](path['join'](config[_0x3d37('0x5c')],_0x3d37('0x57'),_0x40e085[_0x3d37('0x58')]),util[_0x3d37('0x5d')]('%s.%s',_0x40e085[_0x3d37('0x53')]||_0x40e085['name'],_0x40e085[_0x3d37('0x54')]['toLowerCase']()));}})['catch'](handleError(_0x17ca1d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b469fba..351591d 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 _0xd1f2=['api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger'];(function(_0x35bd04,_0x333beb){var _0x3a42e8=function(_0x4f5bda){while(--_0x4f5bda){_0x35bd04['push'](_0x35bd04['shift']());}};_0x3a42e8(++_0x333beb);}(_0xd1f2,0x18a));var _0x2d1f=function(_0x4eaa00,_0x10e6c1){_0x4eaa00=_0x4eaa00-0x0;var _0xba8c86=_0xd1f2[_0x4eaa00];return _0xba8c86;};'use strict';var _=require(_0x2d1f('0x0'));var util=require('util');var logger=require(_0x2d1f('0x1'))(_0x2d1f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d1f('0x3'));var fs=require('fs');var path=require(_0x2d1f('0x4'));var rimraf=require(_0x2d1f('0x5'));var config=require(_0x2d1f('0x6'));var attributes=require(_0x2d1f('0x7'));module[_0x2d1f('0x8')]=function(_0x21ed6f,_0x54eac0){return _0x21ed6f[_0x2d1f('0x9')](_0x2d1f('0xa'),attributes,{'tableName':_0x2d1f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe8a4=['AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x4ed07b,_0x2e370a){var _0x422a39=function(_0x1077fa){while(--_0x1077fa){_0x4ed07b['push'](_0x4ed07b['shift']());}};_0x422a39(++_0x2e370a);}(_0xe8a4,0xdf));var _0x4e8a=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xe8a4[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x4e8a('0x0'));var util=require('util');var logger=require(_0x4e8a('0x1'))(_0x4e8a('0x2'));var moment=require(_0x4e8a('0x3'));var BPromise=require(_0x4e8a('0x4'));var rp=require(_0x4e8a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e8a('0x6'));var config=require(_0x4e8a('0x7'));var attributes=require(_0x4e8a('0x8'));module[_0x4e8a('0x9')]=function(_0x6f533c,_0x587b74){return _0x6f533c[_0x4e8a('0xa')](_0x4e8a('0xb'),attributes,{'tableName':_0x4e8a('0xc'),'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 a78fb2e..8e5268b 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 _0x9652=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3f4a8e,_0x507c39){var _0x7f68fd=function(_0x29890f){while(--_0x29890f){_0x3f4a8e['push'](_0x3f4a8e['shift']());}};_0x7f68fd(++_0x507c39);}(_0x9652,0xaf));var _0x2965=function(_0x4dac30,_0x3b1e61){_0x4dac30=_0x4dac30-0x0;var _0x4ae741=_0x9652[_0x4dac30];return _0x4ae741;};'use strict';var _=require(_0x2965('0x0'));var util=require(_0x2965('0x1'));var moment=require('moment');var BPromise=require(_0x2965('0x2'));var rs=require(_0x2965('0x3'));var fs=require('fs');var Redis=require(_0x2965('0x4'));var db=require(_0x2965('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2965('0x6'));var config=require(_0x2965('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x694054,_0x4a51b2,_0x31e39f){return new BPromise(function(_0x3be4b1,_0x33ce11){return client['request'](_0x694054,_0x31e39f)[_0x2965('0x8')](function(_0x13fbb9){logger[_0x2965('0x9')](_0x2965('0xa'),_0x4a51b2,_0x2965('0xb'));logger['debug'](_0x2965('0xc'),_0x4a51b2,_0x2965('0xb'),JSON['stringify'](_0x13fbb9));if(_0x13fbb9[_0x2965('0xd')]){if(_0x13fbb9[_0x2965('0xd')][_0x2965('0xe')]===0x1f4){logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);return _0x33ce11(_0x13fbb9['error'][_0x2965('0xf')]);}logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);return _0x3be4b1(_0x13fbb9[_0x2965('0xd')][_0x2965('0xf')]);}else{logger['info'](_0x2965('0xa'),_0x4a51b2,_0x2965('0xb'));_0x3be4b1(_0x13fbb9['result'][_0x2965('0xf')]);}})[_0x2965('0x10')](function(_0x3409b1){logger[_0x2965('0xd')](_0x2965('0xa'),_0x4a51b2,_0x3409b1);_0x33ce11(_0x3409b1);});});}
\ No newline at end of file
+var _0xe0e7=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util'];(function(_0x28b5d6,_0x31f3ea){var _0x3ae39e=function(_0x1d86bd){while(--_0x1d86bd){_0x28b5d6['push'](_0x28b5d6['shift']());}};_0x3ae39e(++_0x31f3ea);}(_0xe0e7,0x17b));var _0x7e0e=function(_0xfd5f37,_0x24a79c){_0xfd5f37=_0xfd5f37-0x0;var _0x11bd01=_0xe0e7[_0xfd5f37];return _0x11bd01;};'use strict';var _=require('lodash');var util=require(_0x7e0e('0x0'));var moment=require(_0x7e0e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e0e('0x2'));var fs=require('fs');var Redis=require(_0x7e0e('0x3'));var db=require(_0x7e0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e0e('0x5'))('rpc');var config=require(_0x7e0e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e0e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29a488,_0x198eb6,_0x1902b1){return new BPromise(function(_0x2d49b7,_0x15e6ea){return client[_0x7e0e('0x8')](_0x29a488,_0x1902b1)[_0x7e0e('0x9')](function(_0x1aabe6){logger['info'](_0x7e0e('0xa'),_0x198eb6,_0x7e0e('0xb'));logger[_0x7e0e('0xc')](_0x7e0e('0xd'),_0x198eb6,'request\x20sent',JSON['stringify'](_0x1aabe6));if(_0x1aabe6[_0x7e0e('0xe')]){if(_0x1aabe6[_0x7e0e('0xe')][_0x7e0e('0xf')]===0x1f4){logger[_0x7e0e('0xe')](_0x7e0e('0xa'),_0x198eb6,_0x1aabe6[_0x7e0e('0xe')]['message']);return _0x15e6ea(_0x1aabe6[_0x7e0e('0xe')][_0x7e0e('0x10')]);}logger[_0x7e0e('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x198eb6,_0x1aabe6['error']['message']);return _0x2d49b7(_0x1aabe6[_0x7e0e('0xe')]['message']);}else{logger[_0x7e0e('0x11')](_0x7e0e('0xa'),_0x198eb6,_0x7e0e('0xb'));_0x2d49b7(_0x1aabe6[_0x7e0e('0x12')][_0x7e0e('0x10')]);}})['catch'](function(_0x149617){logger[_0x7e0e('0xe')](_0x7e0e('0xa'),_0x198eb6,_0x149617);_0x15e6ea(_0x149617);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 947ed41..369d4b7 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 _0x95fc=['isAuthenticated','/:id','show','get','/:id/download','download','create','put','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x95fc,0xd6));var _0xc95f=function(_0x59ed0e,_0x41a60f){_0x59ed0e=_0x59ed0e-0x0;var _0x9a8307=_0x95fc[_0x59ed0e];return _0x9a8307;};'use strict';var multer=require('multer');var util=require(_0xc95f('0x0'));var path=require('path');var timeout=require(_0xc95f('0x1'));var express=require('express');var router=express[_0xc95f('0x2')]();var fs_extra=require(_0xc95f('0x3'));var auth=require(_0xc95f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc95f('0x5'));var controller=require(_0xc95f('0x6'));router['get']('/',auth[_0xc95f('0x7')](),controller['index']);router['get'](_0xc95f('0x8'),auth[_0xc95f('0x7')](),controller[_0xc95f('0x9')]);router[_0xc95f('0xa')](_0xc95f('0xb'),auth['isAuthenticated'](),controller[_0xc95f('0xc')]);router['post']('/',auth[_0xc95f('0x7')](),controller[_0xc95f('0xd')]);router[_0xc95f('0xe')]('/:id',auth[_0xc95f('0x7')](),controller['update']);router[_0xc95f('0xf')](_0xc95f('0x8'),auth[_0xc95f('0x7')](),controller[_0xc95f('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xfac6=['get','index','show','/:id/download','isAuthenticated','download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xfac6,0x116));var _0x6fac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfac6[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x6fac('0x0'));var path=require(_0x6fac('0x1'));var timeout=require(_0x6fac('0x2'));var express=require(_0x6fac('0x3'));var router=express['Router']();var fs_extra=require(_0x6fac('0x4'));var auth=require(_0x6fac('0x5'));var interaction=require(_0x6fac('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x6fac('0x7')]('/',auth['isAuthenticated'](),controller[_0x6fac('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6fac('0x9')]);router['get'](_0x6fac('0xa'),auth[_0x6fac('0xb')](),controller[_0x6fac('0xc')]);router[_0x6fac('0xd')]('/',auth[_0x6fac('0xb')](),controller[_0x6fac('0xe')]);router['put'](_0x6fac('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6fac('0x10')](_0x6fac('0xf'),auth[_0x6fac('0xb')](),controller[_0x6fac('0x11')]);module[_0x6fac('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c7ba85a..c083b7b 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 _0xf35e=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x554092,_0x211b5f){var _0x33d000=function(_0x43b7a6){while(--_0x43b7a6){_0x554092['push'](_0x554092['shift']());}};_0x33d000(++_0x211b5f);}(_0xf35e,0x1b6));var _0xef35=function(_0x389267,_0x2e51d7){_0x389267=_0x389267-0x0;var _0x66af=_0xf35e[_0x389267];return _0x66af;};'use strict';var Sequelize=require(_0xef35('0x0'));module[_0xef35('0x1')]={'field':{'type':Sequelize[_0xef35('0x2')]},'alias':{'type':Sequelize[_0xef35('0x3')]},'function':{'type':Sequelize[_0xef35('0x3')]},'format':{'type':Sequelize[_0xef35('0x3')]},'groupBy':{'type':Sequelize[_0xef35('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xef35('0x3')]},'custom':{'type':Sequelize[_0xef35('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe64f=['exports','TEXT','STRING','BOOLEAN'];(function(_0x2f2b03,_0x39f038){var _0x44ee4b=function(_0x4336ac){while(--_0x4336ac){_0x2f2b03['push'](_0x2f2b03['shift']());}};_0x44ee4b(++_0x39f038);}(_0xe64f,0x1a8));var _0xfe64=function(_0x16da64,_0x357fbd){_0x16da64=_0x16da64-0x0;var _0x15d5b=_0xe64f[_0x16da64];return _0x15d5b;};'use strict';var Sequelize=require('sequelize');module[_0xfe64('0x0')]={'field':{'type':Sequelize[_0xfe64('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xfe64('0x2')]},'format':{'type':Sequelize[_0xfe64('0x2')]},'groupBy':{'type':Sequelize[_0xfe64('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfe64('0x2')]},'custom':{'type':Sequelize[_0xfe64('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 5edcff4..6605247 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 _0x8aaa=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','bulkCreate','update','bulkDestroy','ids','addFields','sequelize','transaction','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','stack','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x3a7e01,_0x51204c){var _0x5b8398=function(_0x4dcfab){while(--_0x4dcfab){_0x3a7e01['push'](_0x3a7e01['shift']());}};_0x5b8398(++_0x51204c);}(_0x8aaa,0x10a));var _0xa8aa=function(_0x5ee73b,_0x282c4c){_0x5ee73b=_0x5ee73b-0x0;var _0x22948a=_0x8aaa[_0x5ee73b];return _0x22948a;};'use strict';var emlformat=require(_0xa8aa('0x0'));var rimraf=require(_0xa8aa('0x1'));var zipdir=require(_0xa8aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8aa('0x3'));var moment=require('moment');var BPromise=require(_0xa8aa('0x4'));var Mustache=require('mustache');var util=require(_0xa8aa('0x5'));var path=require(_0xa8aa('0x6'));var sox=require(_0xa8aa('0x7'));var csv=require(_0xa8aa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8aa('0x9'));var _=require(_0xa8aa('0xa'));var squel=require(_0xa8aa('0xb'));var crypto=require(_0xa8aa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa8aa('0xd'));var toCsv=require(_0xa8aa('0x8'));var querystring=require(_0xa8aa('0xe'));var Papa=require(_0xa8aa('0xf'));var Redis=require(_0xa8aa('0x10'));var authService=require(_0xa8aa('0x11'));var qs=require(_0xa8aa('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8aa('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa8aa('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa8aa('0x15'));var db=require(_0xa8aa('0x16'))['db'];function respondWithStatusCode(_0x4de1f0,_0x4ac506){_0x4ac506=_0x4ac506||0xcc;return function(_0x52c314){if(_0x52c314){return _0x4de1f0['sendStatus'](_0x4ac506);}return _0x4de1f0[_0xa8aa('0x17')](_0x4ac506)[_0xa8aa('0x18')]();};}function respondWithResult(_0x5b38ca,_0x45c3e6){_0x45c3e6=_0x45c3e6||0xc8;return function(_0x25d333){if(_0x25d333){return _0x5b38ca[_0xa8aa('0x17')](_0x45c3e6)[_0xa8aa('0x19')](_0x25d333);}};}function respondWithFilteredResult(_0x4ed803,_0x1aa4d6){return function(_0x483a4b){if(_0x483a4b){var _0x4ed67d=typeof _0x1aa4d6[_0xa8aa('0x1a')]===_0xa8aa('0x1b')&&typeof _0x1aa4d6[_0xa8aa('0x1c')]===_0xa8aa('0x1b');var _0x274b0c=_0x483a4b['count'];var _0x5269d9=_0x4ed67d?0x0:_0x1aa4d6[_0xa8aa('0x1a')];var _0x1a52ff=_0x4ed67d?_0x483a4b[_0xa8aa('0x1d')]:_0x1aa4d6[_0xa8aa('0x1a')]+_0x1aa4d6[_0xa8aa('0x1c')];var _0x13c118;if(_0x1a52ff>=_0x274b0c){_0x1a52ff=_0x274b0c;_0x13c118=0xc8;}else{_0x13c118=0xce;}_0x4ed803[_0xa8aa('0x17')](_0x13c118);return _0x4ed803['set'](_0xa8aa('0x1e'),_0x5269d9+'-'+_0x1a52ff+'/'+_0x274b0c)[_0xa8aa('0x19')](_0x483a4b);}return null;};}function patchUpdates(_0x5dbc61){return function(_0x5c3c23){try{jsonpatch['apply'](_0x5c3c23,_0x5dbc61,!![]);}catch(_0x564a4a){return BPromise[_0xa8aa('0x1f')](_0x564a4a);}return _0x5c3c23[_0xa8aa('0x20')]();};}function saveUpdates(_0x2afc86,_0x4cf473){return function(_0x5548d9){if(_0x5548d9){return _0x5548d9['update'](_0x2afc86)[_0xa8aa('0x21')](function(_0x3bc136){return _0x3bc136;});}return null;};}function removeEntity(_0x276b0c,_0x10a7eb){return function(_0x5caa39){if(_0x5caa39){return _0x5caa39[_0xa8aa('0x22')]()['then'](function(){_0x276b0c[_0xa8aa('0x17')](0xcc)[_0xa8aa('0x18')]();});}};}function handleEntityNotFound(_0x5a2dc5,_0x5998c5){return function(_0x1f8527){if(!_0x1f8527){_0x5a2dc5['sendStatus'](0x194);}return _0x1f8527;};}function handleError(_0x3ce5cb,_0x34449e){_0x34449e=_0x34449e||0x1f4;return function(_0xda83f2){logger['error'](_0xda83f2[_0xa8aa('0x23')]);if(_0xda83f2[_0xa8aa('0x24')]){delete _0xda83f2[_0xa8aa('0x24')];}_0x3ce5cb[_0xa8aa('0x17')](_0x34449e)['send'](_0xda83f2);};}exports[_0xa8aa('0x25')]=function(_0x40a2a6,_0x39accd){var _0x4d6589={},_0xcb4825={},_0x13e766={'count':0x0,'rows':[]};var _0x1a10c9=_['map'](db[_0xa8aa('0x26')][_0xa8aa('0x27')],function(_0x4af511){return{'name':_0x4af511[_0xa8aa('0x28')],'type':_0x4af511[_0xa8aa('0x29')][_0xa8aa('0x2a')]};});_0xcb4825[_0xa8aa('0x2b')]=_[_0xa8aa('0x2c')](_0x1a10c9,_0xa8aa('0x24'));_0xcb4825[_0xa8aa('0x2d')]=_[_0xa8aa('0x2e')](_0x40a2a6['query']);_0xcb4825[_0xa8aa('0x2f')]=_[_0xa8aa('0x30')](_0xcb4825[_0xa8aa('0x2b')],_0xcb4825[_0xa8aa('0x2d')]);_0x4d6589[_0xa8aa('0x31')]=_['intersection'](_0xcb4825[_0xa8aa('0x2b')],qs[_0xa8aa('0x32')](_0x40a2a6[_0xa8aa('0x2d')]['fields']));_0x4d6589[_0xa8aa('0x31')]=_0x4d6589['attributes'][_0xa8aa('0x33')]?_0x4d6589[_0xa8aa('0x31')]:_0xcb4825[_0xa8aa('0x2b')];if(!_0x40a2a6[_0xa8aa('0x2d')][_0xa8aa('0x34')](_0xa8aa('0x35'))){_0x4d6589[_0xa8aa('0x1c')]=qs[_0xa8aa('0x1c')](_0x40a2a6[_0xa8aa('0x2d')][_0xa8aa('0x1c')]);_0x4d6589[_0xa8aa('0x1a')]=qs[_0xa8aa('0x1a')](_0x40a2a6[_0xa8aa('0x2d')][_0xa8aa('0x1a')]);}_0x4d6589[_0xa8aa('0x36')]=qs[_0xa8aa('0x37')](_0x40a2a6['query']['sort']);_0x4d6589['where']=qs[_0xa8aa('0x2f')](_[_0xa8aa('0x38')](_0x40a2a6[_0xa8aa('0x2d')],_0xcb4825[_0xa8aa('0x2f')]),_0x1a10c9);if(_0x40a2a6[_0xa8aa('0x2d')]['filter']){_0x4d6589[_0xa8aa('0x39')]=_[_0xa8aa('0x3a')](_0x4d6589['where'],{'$or':_[_0xa8aa('0x2c')](_0x1a10c9,function(_0x423a38){if(_0x423a38[_0xa8aa('0x29')]!=='VIRTUAL'){var _0x103058={};_0x103058[_0x423a38[_0xa8aa('0x24')]]={'$like':'%'+_0x40a2a6['query'][_0xa8aa('0x3b')]+'%'};return _0x103058;}})});}_0x4d6589=_['merge']({},_0x4d6589,_0x40a2a6['options']);var _0x5229c1={'where':_0x4d6589[_0xa8aa('0x39')]};return db[_0xa8aa('0x26')][_0xa8aa('0x1d')](_0x5229c1)['then'](function(_0x29164e){_0x13e766['count']=_0x29164e;if(_0x40a2a6['query'][_0xa8aa('0x3c')]){_0x4d6589[_0xa8aa('0x3d')]=[{'all':!![]}];}return db[_0xa8aa('0x26')][_0xa8aa('0x3e')](_0x4d6589);})[_0xa8aa('0x21')](function(_0x327ab7){_0x13e766[_0xa8aa('0x3f')]=_0x327ab7;return _0x13e766;})[_0xa8aa('0x21')](respondWithFilteredResult(_0x39accd,_0x4d6589))[_0xa8aa('0x40')](handleError(_0x39accd,null));};exports[_0xa8aa('0x41')]=function(_0x573df6,_0x29a1c4){var _0x5301ce={'raw':![],'where':{'id':_0x573df6[_0xa8aa('0x42')]['id']}},_0x2de433={};_0x2de433[_0xa8aa('0x2b')]=_['keys'](db[_0xa8aa('0x26')][_0xa8aa('0x27')]);_0x2de433['query']=_[_0xa8aa('0x2e')](_0x573df6[_0xa8aa('0x2d')]);_0x2de433[_0xa8aa('0x2f')]=_[_0xa8aa('0x30')](_0x2de433[_0xa8aa('0x2b')],_0x2de433[_0xa8aa('0x2d')]);_0x5301ce[_0xa8aa('0x31')]=_[_0xa8aa('0x30')](_0x2de433[_0xa8aa('0x2b')],qs[_0xa8aa('0x32')](_0x573df6[_0xa8aa('0x2d')][_0xa8aa('0x32')]));_0x5301ce[_0xa8aa('0x31')]=_0x5301ce[_0xa8aa('0x31')][_0xa8aa('0x33')]?_0x5301ce[_0xa8aa('0x31')]:_0x2de433[_0xa8aa('0x2b')];if(_0x573df6['query'][_0xa8aa('0x3c')]){_0x5301ce['include']=[{'all':!![]}];}_0x5301ce=_[_0xa8aa('0x3a')]({},_0x5301ce,_0x573df6[_0xa8aa('0x43')]);return db[_0xa8aa('0x26')][_0xa8aa('0x44')](_0x5301ce)[_0xa8aa('0x21')](handleEntityNotFound(_0x29a1c4,null))['then'](respondWithResult(_0x29a1c4,null))[_0xa8aa('0x40')](handleError(_0x29a1c4,null));};exports[_0xa8aa('0x45')]=function(_0x439613,_0x47383c){return db[_0xa8aa('0x26')]['create'](_0x439613[_0xa8aa('0x46')],{})[_0xa8aa('0x21')](respondWithResult(_0x47383c,0xc9))['catch'](handleError(_0x47383c,null));};exports[_0xa8aa('0x47')]=function(_0x22d6ad,_0x2822c3){return db['AnalyticFieldReport'][_0xa8aa('0x47')](_0x22d6ad[_0xa8aa('0x46')],{'raw':![],'individualHooks':!![]})[_0xa8aa('0x21')](respondWithResult(_0x2822c3,0xc9))[_0xa8aa('0x40')](handleError(_0x2822c3,null));};exports[_0xa8aa('0x48')]=function(_0x2dfc51,_0x1e5042){if(_0x2dfc51[_0xa8aa('0x46')]['id']){delete _0x2dfc51[_0xa8aa('0x46')]['id'];}return db[_0xa8aa('0x26')][_0xa8aa('0x44')]({'where':{'id':_0x2dfc51[_0xa8aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e5042,null))[_0xa8aa('0x21')](saveUpdates(_0x2dfc51['body'],null))['then'](respondWithResult(_0x1e5042,null))[_0xa8aa('0x40')](handleError(_0x1e5042,null));};exports[_0xa8aa('0x22')]=function(_0x32109a,_0x33489d){return db['AnalyticFieldReport'][_0xa8aa('0x44')]({'where':{'id':_0x32109a['params']['id']}})[_0xa8aa('0x21')](handleEntityNotFound(_0x33489d,null))[_0xa8aa('0x21')](removeEntity(_0x33489d,null))['catch'](handleError(_0x33489d,null));};exports[_0xa8aa('0x49')]=function(_0x11536f,_0x44cebd){return db[_0xa8aa('0x26')][_0xa8aa('0x22')]({'where':{'id':_0x11536f[_0xa8aa('0x2d')][_0xa8aa('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xa8aa('0x21')](respondWithResult(_0x44cebd,0xcc))['catch'](handleError(_0x44cebd,null));};exports[_0xa8aa('0x4b')]=function(_0xeb3d19,_0x3ece61,_0x154466){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0xeb3d19[_0xa8aa('0x42')]['id']}})[_0xa8aa('0x21')](handleEntityNotFound(_0x3ece61,null))[_0xa8aa('0x21')](function(_0xcb9acd){if(_0xcb9acd){return db[_0xa8aa('0x4c')][_0xa8aa('0x4d')](function(_0x3e79e8){return db[_0xa8aa('0x26')][_0xa8aa('0x22')]({'where':{'CustomReportId':_0xeb3d19[_0xa8aa('0x42')]['id']},'transaction':_0x3e79e8})[_0xa8aa('0x21')](function(_0x4e802d){var _0x5dbaed=_[_0xa8aa('0x2c')](_0xeb3d19[_0xa8aa('0x46')],function(_0x2244d2){delete _0x2244d2['id'];_0x2244d2['CustomReportId']=_0xeb3d19[_0xa8aa('0x42')]['id'];return _0x2244d2;});return db['AnalyticFieldReport'][_0xa8aa('0x47')](_0x5dbaed,{'transaction':_0x3e79e8});});})[_0xa8aa('0x21')](function(){return db[_0xa8aa('0x26')][_0xa8aa('0x3e')]({'where':{'CustomReportId':_0xeb3d19[_0xa8aa('0x42')]['id']}});});}})[_0xa8aa('0x21')](respondWithResult(_0x3ece61,null))[_0xa8aa('0x40')](handleError(_0x3ece61,null));};
\ No newline at end of file
+var _0x037e=['api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','rawAttributes','include','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','findOne','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x037e,0x1ec));var _0xe037=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x037e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe037('0x0'));var rimraf=require(_0xe037('0x1'));var zipdir=require(_0xe037('0x2'));var jsonpatch=require(_0xe037('0x3'));var rp=require(_0xe037('0x4'));var moment=require(_0xe037('0x5'));var BPromise=require(_0xe037('0x6'));var Mustache=require(_0xe037('0x7'));var util=require(_0xe037('0x8'));var path=require(_0xe037('0x9'));var sox=require(_0xe037('0xa'));var csv=require(_0xe037('0xb'));var ejs=require(_0xe037('0xc'));var fs=require('fs');var fs_extra=require(_0xe037('0xd'));var _=require(_0xe037('0xe'));var squel=require(_0xe037('0xf'));var crypto=require(_0xe037('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe037('0xb'));var querystring=require(_0xe037('0x11'));var Papa=require(_0xe037('0x12'));var Redis=require(_0xe037('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe037('0x14'));var as=require(_0xe037('0x15'));var hardwareService=require(_0xe037('0x16'));var logger=require(_0xe037('0x17'))(_0xe037('0x18'));var utils=require(_0xe037('0x19'));var config=require(_0xe037('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xe037('0x1b'))['db'];function respondWithStatusCode(_0x23a693,_0xed735a){_0xed735a=_0xed735a||0xcc;return function(_0x1f256f){if(_0x1f256f){return _0x23a693['sendStatus'](_0xed735a);}return _0x23a693['status'](_0xed735a)[_0xe037('0x1c')]();};}function respondWithResult(_0x7f9b9,_0x450776){_0x450776=_0x450776||0xc8;return function(_0x251e01){if(_0x251e01){return _0x7f9b9[_0xe037('0x1d')](_0x450776)[_0xe037('0x1e')](_0x251e01);}};}function respondWithFilteredResult(_0x1969d5,_0x2ccbf0){return function(_0x22fb0c){if(_0x22fb0c){var _0x20aad3=typeof _0x2ccbf0[_0xe037('0x1f')]===_0xe037('0x20')&&typeof _0x2ccbf0[_0xe037('0x21')]===_0xe037('0x20');var _0x13d87a=_0x22fb0c[_0xe037('0x22')];var _0x152fdd=_0x20aad3?0x0:_0x2ccbf0[_0xe037('0x1f')];var _0x2ddece=_0x20aad3?_0x22fb0c[_0xe037('0x22')]:_0x2ccbf0[_0xe037('0x1f')]+_0x2ccbf0[_0xe037('0x21')];var _0x769195;if(_0x2ddece>=_0x13d87a){_0x2ddece=_0x13d87a;_0x769195=0xc8;}else{_0x769195=0xce;}_0x1969d5[_0xe037('0x1d')](_0x769195);return _0x1969d5[_0xe037('0x23')](_0xe037('0x24'),_0x152fdd+'-'+_0x2ddece+'/'+_0x13d87a)[_0xe037('0x1e')](_0x22fb0c);}return null;};}function patchUpdates(_0x5d19be){return function(_0x29a23f){try{jsonpatch['apply'](_0x29a23f,_0x5d19be,!![]);}catch(_0x5d804a){return BPromise[_0xe037('0x25')](_0x5d804a);}return _0x29a23f['save']();};}function saveUpdates(_0x1f0ff8,_0x14c2e5){return function(_0x149b38){if(_0x149b38){return _0x149b38[_0xe037('0x26')](_0x1f0ff8)[_0xe037('0x27')](function(_0x4ff092){return _0x4ff092;});}return null;};}function removeEntity(_0x1668ef,_0x4c6a91){return function(_0x2dc8c8){if(_0x2dc8c8){return _0x2dc8c8[_0xe037('0x28')]()[_0xe037('0x27')](function(){_0x1668ef[_0xe037('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x377a14,_0x5ac43c){return function(_0x266cc8){if(!_0x266cc8){_0x377a14['sendStatus'](0x194);}return _0x266cc8;};}function handleError(_0x2dd35c,_0x193d77){_0x193d77=_0x193d77||0x1f4;return function(_0x2f80ee){logger[_0xe037('0x29')](_0x2f80ee[_0xe037('0x2a')]);if(_0x2f80ee[_0xe037('0x2b')]){delete _0x2f80ee['name'];}_0x2dd35c[_0xe037('0x1d')](_0x193d77)[_0xe037('0x2c')](_0x2f80ee);};}exports[_0xe037('0x2d')]=function(_0x4e9fe9,_0x526c1a){var _0xd82964={},_0x19988a={},_0x349cd3={'count':0x0,'rows':[]};var _0x4097ee=_[_0xe037('0x2e')](db[_0xe037('0x2f')]['rawAttributes'],function(_0x35f284){return{'name':_0x35f284['fieldName'],'type':_0x35f284[_0xe037('0x30')][_0xe037('0x31')]};});_0x19988a['model']=_[_0xe037('0x2e')](_0x4097ee,'name');_0x19988a[_0xe037('0x32')]=_[_0xe037('0x33')](_0x4e9fe9[_0xe037('0x32')]);_0x19988a[_0xe037('0x34')]=_[_0xe037('0x35')](_0x19988a[_0xe037('0x36')],_0x19988a[_0xe037('0x32')]);_0xd82964[_0xe037('0x37')]=_[_0xe037('0x35')](_0x19988a[_0xe037('0x36')],qs['fields'](_0x4e9fe9[_0xe037('0x32')][_0xe037('0x38')]));_0xd82964[_0xe037('0x37')]=_0xd82964['attributes'][_0xe037('0x39')]?_0xd82964[_0xe037('0x37')]:_0x19988a[_0xe037('0x36')];if(!_0x4e9fe9[_0xe037('0x32')][_0xe037('0x3a')](_0xe037('0x3b'))){_0xd82964['limit']=qs[_0xe037('0x21')](_0x4e9fe9[_0xe037('0x32')][_0xe037('0x21')]);_0xd82964[_0xe037('0x1f')]=qs[_0xe037('0x1f')](_0x4e9fe9[_0xe037('0x32')][_0xe037('0x1f')]);}_0xd82964[_0xe037('0x3c')]=qs[_0xe037('0x3d')](_0x4e9fe9['query'][_0xe037('0x3d')]);_0xd82964['where']=qs[_0xe037('0x34')](_[_0xe037('0x3e')](_0x4e9fe9[_0xe037('0x32')],_0x19988a[_0xe037('0x34')]),_0x4097ee);if(_0x4e9fe9[_0xe037('0x32')][_0xe037('0x3f')]){_0xd82964[_0xe037('0x40')]=_[_0xe037('0x41')](_0xd82964[_0xe037('0x40')],{'$or':_[_0xe037('0x2e')](_0x4097ee,function(_0x32dcd7){if(_0x32dcd7[_0xe037('0x30')]!==_0xe037('0x42')){var _0x3e6e0b={};_0x3e6e0b[_0x32dcd7[_0xe037('0x2b')]]={'$like':'%'+_0x4e9fe9[_0xe037('0x32')][_0xe037('0x3f')]+'%'};return _0x3e6e0b;}})});}_0xd82964=_[_0xe037('0x41')]({},_0xd82964,_0x4e9fe9[_0xe037('0x43')]);var _0x1b7dce={'where':_0xd82964[_0xe037('0x40')]};return db[_0xe037('0x2f')][_0xe037('0x22')](_0x1b7dce)[_0xe037('0x27')](function(_0x1c0f5e){_0x349cd3[_0xe037('0x22')]=_0x1c0f5e;if(_0x4e9fe9['query'][_0xe037('0x44')]){_0xd82964['include']=[{'all':!![]}];}return db[_0xe037('0x2f')]['findAll'](_0xd82964);})[_0xe037('0x27')](function(_0x4ff1c0){_0x349cd3[_0xe037('0x45')]=_0x4ff1c0;return _0x349cd3;})[_0xe037('0x27')](respondWithFilteredResult(_0x526c1a,_0xd82964))[_0xe037('0x46')](handleError(_0x526c1a,null));};exports[_0xe037('0x47')]=function(_0x40bbb4,_0x3019c6){var _0x357d1c={'raw':![],'where':{'id':_0x40bbb4['params']['id']}},_0x320ea9={};_0x320ea9[_0xe037('0x36')]=_[_0xe037('0x33')](db[_0xe037('0x2f')][_0xe037('0x48')]);_0x320ea9[_0xe037('0x32')]=_[_0xe037('0x33')](_0x40bbb4[_0xe037('0x32')]);_0x320ea9[_0xe037('0x34')]=_[_0xe037('0x35')](_0x320ea9[_0xe037('0x36')],_0x320ea9[_0xe037('0x32')]);_0x357d1c[_0xe037('0x37')]=_[_0xe037('0x35')](_0x320ea9[_0xe037('0x36')],qs['fields'](_0x40bbb4['query'][_0xe037('0x38')]));_0x357d1c[_0xe037('0x37')]=_0x357d1c[_0xe037('0x37')][_0xe037('0x39')]?_0x357d1c['attributes']:_0x320ea9[_0xe037('0x36')];if(_0x40bbb4['query'][_0xe037('0x44')]){_0x357d1c[_0xe037('0x49')]=[{'all':!![]}];}_0x357d1c=_[_0xe037('0x41')]({},_0x357d1c,_0x40bbb4[_0xe037('0x43')]);return db[_0xe037('0x2f')][_0xe037('0x4a')](_0x357d1c)[_0xe037('0x27')](handleEntityNotFound(_0x3019c6,null))['then'](respondWithResult(_0x3019c6,null))[_0xe037('0x46')](handleError(_0x3019c6,null));};exports[_0xe037('0x4b')]=function(_0x375354,_0x4ad77a){return db[_0xe037('0x2f')][_0xe037('0x4b')](_0x375354[_0xe037('0x4c')],{})['then'](respondWithResult(_0x4ad77a,0xc9))[_0xe037('0x46')](handleError(_0x4ad77a,null));};exports[_0xe037('0x4d')]=function(_0x3ecbc2,_0x461569){return db['AnalyticFieldReport']['bulkCreate'](_0x3ecbc2[_0xe037('0x4c')],{'raw':![],'individualHooks':!![]})[_0xe037('0x27')](respondWithResult(_0x461569,0xc9))[_0xe037('0x46')](handleError(_0x461569,null));};exports[_0xe037('0x26')]=function(_0x268e1d,_0x528f9d){if(_0x268e1d[_0xe037('0x4c')]['id']){delete _0x268e1d[_0xe037('0x4c')]['id'];}return db[_0xe037('0x2f')][_0xe037('0x4a')]({'where':{'id':_0x268e1d[_0xe037('0x4e')]['id']}})[_0xe037('0x27')](handleEntityNotFound(_0x528f9d,null))['then'](saveUpdates(_0x268e1d[_0xe037('0x4c')],null))[_0xe037('0x27')](respondWithResult(_0x528f9d,null))[_0xe037('0x46')](handleError(_0x528f9d,null));};exports[_0xe037('0x28')]=function(_0x4187da,_0x462298){return db['AnalyticFieldReport'][_0xe037('0x4a')]({'where':{'id':_0x4187da['params']['id']}})['then'](handleEntityNotFound(_0x462298,null))['then'](removeEntity(_0x462298,null))[_0xe037('0x46')](handleError(_0x462298,null));};exports[_0xe037('0x4f')]=function(_0x2140cc,_0x258070){return db[_0xe037('0x2f')][_0xe037('0x28')]({'where':{'id':_0x2140cc[_0xe037('0x32')][_0xe037('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xe037('0x27')](respondWithResult(_0x258070,0xcc))[_0xe037('0x46')](handleError(_0x258070,null));};exports[_0xe037('0x51')]=function(_0x384ef8,_0x33d55b,_0x421ff3){return db['AnalyticCustomReport'][_0xe037('0x52')]({'where':{'id':_0x384ef8[_0xe037('0x4e')]['id']}})[_0xe037('0x27')](handleEntityNotFound(_0x33d55b,null))['then'](function(_0x464575){if(_0x464575){return db['sequelize'][_0xe037('0x53')](function(_0x6bf944){return db[_0xe037('0x2f')][_0xe037('0x28')]({'where':{'CustomReportId':_0x384ef8['params']['id']},'transaction':_0x6bf944})[_0xe037('0x27')](function(_0x577a35){var _0x579a94=_[_0xe037('0x2e')](_0x384ef8[_0xe037('0x4c')],function(_0x3e7fd8){delete _0x3e7fd8['id'];_0x3e7fd8[_0xe037('0x54')]=_0x384ef8['params']['id'];return _0x3e7fd8;});return db['AnalyticFieldReport'][_0xe037('0x4d')](_0x579a94,{'transaction':_0x6bf944});});})[_0xe037('0x27')](function(){return db[_0xe037('0x2f')][_0xe037('0x55')]({'where':{'CustomReportId':_0x384ef8['params']['id']}});});}})[_0xe037('0x27')](respondWithResult(_0x33d55b,null))['catch'](handleError(_0x33d55b,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 0245384..0668292 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 _0xfb34=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x576f97,_0x215bbd){var _0x1822a0=function(_0x34b86c){while(--_0x34b86c){_0x576f97['push'](_0x576f97['shift']());}};_0x1822a0(++_0x215bbd);}(_0xfb34,0x185));var _0x4fb3=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xfb34[_0x1dbaf7];return _0x593f05;};'use strict';var _=require(_0x4fb3('0x0'));var util=require(_0x4fb3('0x1'));var logger=require(_0x4fb3('0x2'))(_0x4fb3('0x3'));var moment=require(_0x4fb3('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fb3('0x5'));var fs=require('fs');var path=require(_0x4fb3('0x6'));var rimraf=require(_0x4fb3('0x7'));var config=require(_0x4fb3('0x8'));var attributes=require(_0x4fb3('0x9'));module[_0x4fb3('0xa')]=function(_0x4a8fe6,_0x403e60){return _0x4a8fe6[_0x4fb3('0xb')](_0x4fb3('0xc'),attributes,{'tableName':_0x4fb3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25ba=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x266012,_0x54bd8d){var _0xd52b29=function(_0x19371a){while(--_0x19371a){_0x266012['push'](_0x266012['shift']());}};_0xd52b29(++_0x54bd8d);}(_0x25ba,0xc8));var _0xa25b=function(_0x452f9f,_0x194f43){_0x452f9f=_0x452f9f-0x0;var _0xbc7fc4=_0x25ba[_0x452f9f];return _0xbc7fc4;};'use strict';var _=require('lodash');var util=require(_0xa25b('0x0'));var logger=require(_0xa25b('0x1'))(_0xa25b('0x2'));var moment=require('moment');var BPromise=require(_0xa25b('0x3'));var rp=require(_0xa25b('0x4'));var fs=require('fs');var path=require(_0xa25b('0x5'));var rimraf=require(_0xa25b('0x6'));var config=require(_0xa25b('0x7'));var attributes=require(_0xa25b('0x8'));module[_0xa25b('0x9')]=function(_0x1b05e2,_0x43981e){return _0x1b05e2[_0xa25b('0xa')](_0xa25b('0xb'),attributes,{'tableName':_0xa25b('0xc'),'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 8809490..f53f139 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 _0x658b=['randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x120d55,_0xe7f868){var _0x266408=function(_0x486835){while(--_0x486835){_0x120d55['push'](_0x120d55['shift']());}};_0x266408(++_0xe7f868);}(_0x658b,0x66));var _0xb658=function(_0x2096ed,_0xeac518){_0x2096ed=_0x2096ed-0x0;var _0x5c8969=_0x658b[_0x2096ed];return _0x5c8969;};'use strict';var _=require(_0xb658('0x0'));var util=require(_0xb658('0x1'));var moment=require(_0xb658('0x2'));var BPromise=require('bluebird');var rs=require(_0xb658('0x3'));var fs=require('fs');var Redis=require(_0xb658('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb658('0x5'));var config=require(_0xb658('0x6'));var jayson=require(_0xb658('0x7'));var client=jayson[_0xb658('0x8')][_0xb658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc54fa,_0x4a1edf,_0x3579f9){return new BPromise(function(_0x7ee83b,_0x34f249){return client[_0xb658('0xa')](_0xc54fa,_0x3579f9)[_0xb658('0xb')](function(_0x5f30cf){logger[_0xb658('0xc')](_0xb658('0xd'),_0x4a1edf,'request\x20sent');logger[_0xb658('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4a1edf,'request\x20sent',JSON[_0xb658('0xf')](_0x5f30cf));if(_0x5f30cf[_0xb658('0x10')]){if(_0x5f30cf[_0xb658('0x10')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4a1edf,_0x5f30cf['error'][_0xb658('0x11')]);return _0x34f249(_0x5f30cf[_0xb658('0x10')][_0xb658('0x11')]);}logger['error'](_0xb658('0xd'),_0x4a1edf,_0x5f30cf[_0xb658('0x10')]['message']);return _0x7ee83b(_0x5f30cf['error'][_0xb658('0x11')]);}else{logger[_0xb658('0xc')](_0xb658('0xd'),_0x4a1edf,_0xb658('0x12'));_0x7ee83b(_0x5f30cf[_0xb658('0x13')][_0xb658('0x11')]);}})[_0xb658('0x14')](function(_0x3df1c1){logger[_0xb658('0x10')](_0xb658('0xd'),_0x4a1edf,_0x3df1c1);_0x34f249(_0x3df1c1);});});}
\ No newline at end of file
+var _0xe38c=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','debug','request\x20sent','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info'];(function(_0x2b12b7,_0x2621a1){var _0x2c7af3=function(_0x4d3946){while(--_0x4d3946){_0x2b12b7['push'](_0x2b12b7['shift']());}};_0x2c7af3(++_0x2621a1);}(_0xe38c,0x1ba));var _0xce38=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xe38c[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require(_0xce38('0x0'));var moment=require(_0xce38('0x1'));var BPromise=require(_0xce38('0x2'));var rs=require(_0xce38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce38('0x4'))['db'];var utils=require(_0xce38('0x5'));var logger=require(_0xce38('0x6'))(_0xce38('0x7'));var config=require(_0xce38('0x8'));var jayson=require(_0xce38('0x9'));var client=jayson['client'][_0xce38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x346f01,_0x985dfb,_0xa1ec8e){return new BPromise(function(_0x1561f7,_0x3eba46){return client['request'](_0x346f01,_0xa1ec8e)['then'](function(_0x38098f){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x985dfb,'request\x20sent');logger[_0xce38('0xb')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x985dfb,_0xce38('0xc'),JSON[_0xce38('0xd')](_0x38098f));if(_0x38098f['error']){if(_0x38098f[_0xce38('0xe')]['code']===0x1f4){logger['error'](_0xce38('0xf'),_0x985dfb,_0x38098f[_0xce38('0xe')][_0xce38('0x10')]);return _0x3eba46(_0x38098f['error'][_0xce38('0x10')]);}logger[_0xce38('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x985dfb,_0x38098f[_0xce38('0xe')][_0xce38('0x10')]);return _0x1561f7(_0x38098f[_0xce38('0xe')][_0xce38('0x10')]);}else{logger[_0xce38('0x11')](_0xce38('0xf'),_0x985dfb,_0xce38('0xc'));_0x1561f7(_0x38098f[_0xce38('0x12')][_0xce38('0x10')]);}})[_0xce38('0x13')](function(_0x4ba451){logger[_0xce38('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x985dfb,_0x4ba451);_0x3eba46(_0x4ba451);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4f0ab05..4d31b4a 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(_0x4d6321,_0x13044d){var _0x185667=function(_0x556b6a){while(--_0x556b6a){_0x4d6321['push'](_0x4d6321['shift']());}};_0x185667(++_0x13044d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x420425,_0x12292b){var _0x340329=function(_0x69b0f8){while(--_0x69b0f8){_0x420425['push'](_0x420425['shift']());}};_0x340329(++_0x12292b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 456114a..e6cce49 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 _0x7980=['exports','STRING','name','sequelize'];(function(_0x35db9d,_0x526e15){var _0x4642a0=function(_0x3117f4){while(--_0x3117f4){_0x35db9d['push'](_0x35db9d['shift']());}};_0x4642a0(++_0x526e15);}(_0x7980,0xab));var _0x0798=function(_0x51c2f8,_0x24af65){_0x51c2f8=_0x51c2f8-0x0;var _0x30b874=_0x7980[_0x51c2f8];return _0x30b874;};'use strict';var Sequelize=require(_0x0798('0x0'));module[_0x0798('0x1')]={'name':{'type':Sequelize[_0x0798('0x2')],'allowNull':![],'unique':_0x0798('0x3')},'table':{'type':Sequelize[_0x0798('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x0798('0x2')]}};
\ No newline at end of file
+var _0xd027=['STRING','TEXT','exports'];(function(_0x54d5c8,_0x344ce5){var _0x525e2e=function(_0x4581b7){while(--_0x4581b7){_0x54d5c8['push'](_0x54d5c8['shift']());}};_0x525e2e(++_0x344ce5);}(_0xd027,0x197));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7d02('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x7d02('0x1')]},'metric':{'type':Sequelize[_0x7d02('0x2')]},'description':{'type':Sequelize[_0x7d02('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 3651553..584f38a 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x1ab724,_0x2e2566){var _0x2167ac=function(_0xb2e7fd){while(--_0xb2e7fd){_0x1ab724['push'](_0x1ab724['shift']());}};_0x2167ac(++_0x2e2566);}(_0x008c,0x188));var _0xc008=function(_0xc6583e,_0x3e854a){_0xc6583e=_0xc6583e-0x0;var _0x11f67e=_0x008c[_0xc6583e];return _0x11f67e;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x385364,_0x2d2121){var _0x27a054=function(_0x3126a9){while(--_0x3126a9){_0x385364['push'](_0x385364['shift']());}};_0x27a054(++_0x2d2121);}(_0x3e74,0x175));var _0x43e7=function(_0x4e922a,_0x418973){_0x4e922a=_0x4e922a-0x0;var _0x34f8e8=_0x3e74[_0x4e922a];return _0x34f8e8;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index ad813fd..da64f45 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 _0x24ce=['analytics_metrics','util','../../config/logger','api','moment','path','./analyticMetric.attributes','exports','define'];(function(_0x26f582,_0x2f890b){var _0x58ac50=function(_0x2cddd7){while(--_0x2cddd7){_0x26f582['push'](_0x26f582['shift']());}};_0x58ac50(++_0x2f890b);}(_0x24ce,0x1de));var _0xe24c=function(_0x45dcf6,_0x47fa5d){_0x45dcf6=_0x45dcf6-0x0;var _0x33cc76=_0x24ce[_0x45dcf6];return _0x33cc76;};'use strict';var _=require('lodash');var util=require(_0xe24c('0x0'));var logger=require(_0xe24c('0x1'))(_0xe24c('0x2'));var moment=require(_0xe24c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe24c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe24c('0x5'));module[_0xe24c('0x6')]=function(_0x6f92e0,_0x1ac59c){return _0x6f92e0[_0xe24c('0x7')]('AnalyticMetric',attributes,{'tableName':_0xe24c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fc5=['define','AnalyticMetric','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x2e2073,_0x4b778f){var _0xd996ba=function(_0x2c12ac){while(--_0x2c12ac){_0x2e2073['push'](_0x2e2073['shift']());}};_0xd996ba(++_0x4b778f);}(_0x9fc5,0xb6));var _0x59fc=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x9fc5[_0x1c546c];return _0x2cc384;};'use strict';var _=require('lodash');var util=require(_0x59fc('0x0'));var logger=require(_0x59fc('0x1'))('api');var moment=require(_0x59fc('0x2'));var BPromise=require(_0x59fc('0x3'));var rp=require(_0x59fc('0x4'));var fs=require('fs');var path=require(_0x59fc('0x5'));var rimraf=require(_0x59fc('0x6'));var config=require(_0x59fc('0x7'));var attributes=require(_0x59fc('0x8'));module[_0x59fc('0x9')]=function(_0x4cb94d,_0x3bde0b){return _0x4cb94d[_0x59fc('0xa')](_0x59fc('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index f0470d4..a87022b 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 _0x0cb9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x596bb7,_0x2e1c68){var _0x10b55b=function(_0x433204){while(--_0x433204){_0x596bb7['push'](_0x596bb7['shift']());}};_0x10b55b(++_0x2e1c68);}(_0x0cb9,0xd1));var _0x90cb=function(_0x4a99ff,_0x181d92){_0x4a99ff=_0x4a99ff-0x0;var _0x32551e=_0x0cb9[_0x4a99ff];return _0x32551e;};'use strict';var _=require(_0x90cb('0x0'));var util=require(_0x90cb('0x1'));var moment=require(_0x90cb('0x2'));var BPromise=require(_0x90cb('0x3'));var rs=require(_0x90cb('0x4'));var fs=require('fs');var Redis=require(_0x90cb('0x5'));var db=require(_0x90cb('0x6'))['db'];var utils=require(_0x90cb('0x7'));var logger=require(_0x90cb('0x8'))(_0x90cb('0x9'));var config=require(_0x90cb('0xa'));var jayson=require(_0x90cb('0xb'));var client=jayson[_0x90cb('0xc')][_0x90cb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4f0b77,_0x47d304,_0x227cbc){return new BPromise(function(_0x5c0bf4,_0x1580e1){return client['request'](_0x4f0b77,_0x227cbc)[_0x90cb('0xe')](function(_0x40669a){logger[_0x90cb('0xf')](_0x90cb('0x10'),_0x47d304,_0x90cb('0x11'));logger[_0x90cb('0x12')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x47d304,_0x90cb('0x11'),JSON[_0x90cb('0x13')](_0x40669a));if(_0x40669a[_0x90cb('0x14')]){if(_0x40669a[_0x90cb('0x14')][_0x90cb('0x15')]===0x1f4){logger[_0x90cb('0x14')](_0x90cb('0x10'),_0x47d304,_0x40669a[_0x90cb('0x14')]['message']);return _0x1580e1(_0x40669a[_0x90cb('0x14')][_0x90cb('0x16')]);}logger['error'](_0x90cb('0x10'),_0x47d304,_0x40669a[_0x90cb('0x14')][_0x90cb('0x16')]);return _0x5c0bf4(_0x40669a[_0x90cb('0x14')][_0x90cb('0x16')]);}else{logger['info'](_0x90cb('0x10'),_0x47d304,_0x90cb('0x11'));_0x5c0bf4(_0x40669a['result']['message']);}})[_0x90cb('0x17')](function(_0x2b86a4){logger[_0x90cb('0x14')](_0x90cb('0x10'),_0x47d304,_0x2b86a4);_0x1580e1(_0x2b86a4);});});}
\ No newline at end of file
+var _0x584a=['jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0x584a,0x6f));var _0xa584=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x584a[_0x2b9e8a];return _0x520e67;};'use strict';var _=require(_0xa584('0x0'));var util=require(_0xa584('0x1'));var moment=require(_0xa584('0x2'));var BPromise=require('bluebird');var rs=require(_0xa584('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa584('0x4'))['db'];var utils=require(_0xa584('0x5'));var logger=require(_0xa584('0x6'))(_0xa584('0x7'));var config=require(_0xa584('0x8'));var jayson=require(_0xa584('0x9'));var client=jayson[_0xa584('0xa')][_0xa584('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd8c8,_0x22552a,_0x4ad4bd){return new BPromise(function(_0x59dead,_0x17e258){return client[_0xa584('0xc')](_0x1bd8c8,_0x4ad4bd)[_0xa584('0xd')](function(_0x224808){logger[_0xa584('0xe')](_0xa584('0xf'),_0x22552a,_0xa584('0x10'));logger['debug'](_0xa584('0x11'),_0x22552a,_0xa584('0x10'),JSON[_0xa584('0x12')](_0x224808));if(_0x224808['error']){if(_0x224808[_0xa584('0x13')][_0xa584('0x14')]===0x1f4){logger[_0xa584('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x22552a,_0x224808[_0xa584('0x13')]['message']);return _0x17e258(_0x224808['error']['message']);}logger[_0xa584('0x13')](_0xa584('0xf'),_0x22552a,_0x224808[_0xa584('0x13')][_0xa584('0x15')]);return _0x59dead(_0x224808['error']['message']);}else{logger['info'](_0xa584('0xf'),_0x22552a,_0xa584('0x10'));_0x59dead(_0x224808[_0xa584('0x16')][_0xa584('0x15')]);}})[_0xa584('0x17')](function(_0x49a9c6){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x22552a,_0x49a9c6);_0x17e258(_0x49a9c6);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b938f60..eda84c8 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 _0xf4d9=['isAuthenticated','index','get','post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x1a43e6,_0x2d06bc){var _0x283d30=function(_0x5f02f5){while(--_0x5f02f5){_0x1a43e6['push'](_0x1a43e6['shift']());}};_0x283d30(++_0x2d06bc);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x36900f,_0x59fcd6){_0x36900f=_0x36900f-0x0;var _0xdf4daf=_0xf4d9[_0x36900f];return _0xdf4daf;};'use strict';var multer=require(_0x9f4d('0x0'));var util=require('util');var path=require(_0x9f4d('0x1'));var timeout=require(_0x9f4d('0x2'));var express=require(_0x9f4d('0x3'));var router=express[_0x9f4d('0x4')]();var fs_extra=require(_0x9f4d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9f4d('0x6'));var config=require(_0x9f4d('0x7'));var controller=require(_0x9f4d('0x8'));router['get']('/',auth[_0x9f4d('0x9')](),controller[_0x9f4d('0xa')]);router[_0x9f4d('0xb')]('/:id',auth[_0x9f4d('0x9')](),controller['show']);router[_0x9f4d('0xc')]('/',auth['isAuthenticated'](),controller[_0x9f4d('0xd')]);router[_0x9f4d('0xe')](_0x9f4d('0xf'),auth[_0x9f4d('0x9')](),controller['update']);router[_0x9f4d('0x10')](_0x9f4d('0xf'),auth[_0x9f4d('0x9')](),controller[_0x9f4d('0x11')]);module[_0x9f4d('0x12')]=router;
\ No newline at end of file
+var _0x1b69=['update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x433d33,_0x361a43){var _0x468297=function(_0x49041e){while(--_0x49041e){_0x433d33['push'](_0x433d33['shift']());}};_0x468297(++_0x361a43);}(_0x1b69,0x190));var _0x91b6=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1b69[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x91b6('0x0'));var express=require(_0x91b6('0x1'));var router=express[_0x91b6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x91b6('0x3'));var interaction=require(_0x91b6('0x4'));var config=require(_0x91b6('0x5'));var controller=require(_0x91b6('0x6'));router[_0x91b6('0x7')]('/',auth[_0x91b6('0x8')](),controller[_0x91b6('0x9')]);router[_0x91b6('0x7')](_0x91b6('0xa'),auth[_0x91b6('0x8')](),controller[_0x91b6('0xb')]);router[_0x91b6('0xc')]('/',auth[_0x91b6('0x8')](),controller[_0x91b6('0xd')]);router['put']('/:id',auth[_0x91b6('0x8')](),controller[_0x91b6('0xe')]);router[_0x91b6('0xf')]('/:id',auth[_0x91b6('0x8')](),controller[_0x91b6('0x10')]);module[_0x91b6('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 e723796..70f07b5 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 _0x4c33=['TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c33,0x1d9));var _0x34c3=function(_0x4b44ac,_0x84990a){_0x4b44ac=_0x4b44ac-0x0;var _0x1f3c0a=_0x4c33[_0x4b44ac];return _0x1f3c0a;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x34c3('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x3934=['sequelize','exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3934,0x10e));var _0x4393=function(_0x194658,_0x45a76c){_0x194658=_0x194658-0x0;var _0x429ca1=_0x3934[_0x194658];return _0x429ca1;};'use strict';var Sequelize=require(_0x4393('0x0'));module[_0x4393('0x1')]={'tree':{'type':Sequelize[_0x4393('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 1e791fb..f762a5b 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 _0xcec5=['lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','save','update','destroy','then','error','stack','name','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcec5,0x1b5));var _0x5cec=function(_0x50de46,_0x5c398c){_0x50de46=_0x50de46-0x0;var _0x5ac054=_0xcec5[_0x50de46];return _0x5ac054;};'use strict';var emlformat=require(_0x5cec('0x0'));var rimraf=require(_0x5cec('0x1'));var zipdir=require(_0x5cec('0x2'));var jsonpatch=require(_0x5cec('0x3'));var rp=require('request-promise');var moment=require(_0x5cec('0x4'));var BPromise=require(_0x5cec('0x5'));var Mustache=require(_0x5cec('0x6'));var util=require(_0x5cec('0x7'));var path=require(_0x5cec('0x8'));var sox=require(_0x5cec('0x9'));var csv=require(_0x5cec('0xa'));var ejs=require(_0x5cec('0xb'));var fs=require('fs');var fs_extra=require(_0x5cec('0xc'));var _=require(_0x5cec('0xd'));var squel=require('squel');var crypto=require(_0x5cec('0xe'));var jsforce=require(_0x5cec('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5cec('0xa'));var querystring=require('querystring');var Papa=require(_0x5cec('0x10'));var Redis=require(_0x5cec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5cec('0x12'));var as=require(_0x5cec('0x13'));var hardwareService=require(_0x5cec('0x14'));var logger=require(_0x5cec('0x15'))('api');var utils=require(_0x5cec('0x16'));var config=require(_0x5cec('0x17'));var licenseUtil=require(_0x5cec('0x18'));var db=require(_0x5cec('0x19'))['db'];function respondWithStatusCode(_0x4a2af4,_0x68227e){_0x68227e=_0x68227e||0xcc;return function(_0x4e7e2f){if(_0x4e7e2f){return _0x4a2af4[_0x5cec('0x1a')](_0x68227e);}return _0x4a2af4['status'](_0x68227e)[_0x5cec('0x1b')]();};}function respondWithResult(_0x48837b,_0xa9b03d){_0xa9b03d=_0xa9b03d||0xc8;return function(_0x3c167d){if(_0x3c167d){return _0x48837b[_0x5cec('0x1c')](_0xa9b03d)['json'](_0x3c167d);}};}function respondWithFilteredResult(_0x271f59,_0x936cf){return function(_0x116f61){if(_0x116f61){var _0x3a4129=typeof _0x936cf['offset']===_0x5cec('0x1d')&&typeof _0x936cf['limit']==='undefined';var _0x257bd4=_0x116f61['count'];var _0x1d0f77=_0x3a4129?0x0:_0x936cf['offset'];var _0x5c8b20=_0x3a4129?_0x116f61[_0x5cec('0x1e')]:_0x936cf[_0x5cec('0x1f')]+_0x936cf[_0x5cec('0x20')];var _0x3529ee;if(_0x5c8b20>=_0x257bd4){_0x5c8b20=_0x257bd4;_0x3529ee=0xc8;}else{_0x3529ee=0xce;}_0x271f59[_0x5cec('0x1c')](_0x3529ee);return _0x271f59[_0x5cec('0x21')](_0x5cec('0x22'),_0x1d0f77+'-'+_0x5c8b20+'/'+_0x257bd4)[_0x5cec('0x23')](_0x116f61);}return null;};}function patchUpdates(_0x2f9f6b){return function(_0x5cfdf4){try{jsonpatch['apply'](_0x5cfdf4,_0x2f9f6b,!![]);}catch(_0x53d812){return BPromise['reject'](_0x53d812);}return _0x5cfdf4[_0x5cec('0x24')]();};}function saveUpdates(_0x42d37a,_0x4a4293){return function(_0x5c0510){if(_0x5c0510){return _0x5c0510[_0x5cec('0x25')](_0x42d37a)['then'](function(_0x68aaf5){return _0x68aaf5;});}return null;};}function removeEntity(_0x5a5d59,_0x55676d){return function(_0x3e421d){if(_0x3e421d){return _0x3e421d[_0x5cec('0x26')]()[_0x5cec('0x27')](function(){_0x5a5d59[_0x5cec('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12facf,_0x3192f4){return function(_0xffaee){if(!_0xffaee){_0x12facf[_0x5cec('0x1a')](0x194);}return _0xffaee;};}function handleError(_0x4ee74b,_0x1f04ee){_0x1f04ee=_0x1f04ee||0x1f4;return function(_0x1c9c9a){logger[_0x5cec('0x28')](_0x1c9c9a[_0x5cec('0x29')]);if(_0x1c9c9a[_0x5cec('0x2a')]){delete _0x1c9c9a[_0x5cec('0x2a')];}_0x4ee74b[_0x5cec('0x1c')](_0x1f04ee)['send'](_0x1c9c9a);};}exports['index']=function(_0x4feea5,_0x38d757){var _0x1df8cf={},_0x4cbb3a={},_0x5e4932={'count':0x0,'rows':[]};var _0x3b2b7f=_['map'](db['AnalyticTreeReport'][_0x5cec('0x2b')],function(_0x3cd092){return{'name':_0x3cd092[_0x5cec('0x2c')],'type':_0x3cd092['type'][_0x5cec('0x2d')]};});_0x4cbb3a[_0x5cec('0x2e')]=_[_0x5cec('0x2f')](_0x3b2b7f,_0x5cec('0x2a'));_0x4cbb3a[_0x5cec('0x30')]=_[_0x5cec('0x31')](_0x4feea5['query']);_0x4cbb3a[_0x5cec('0x32')]=_['intersection'](_0x4cbb3a[_0x5cec('0x2e')],_0x4cbb3a[_0x5cec('0x30')]);_0x1df8cf['attributes']=_[_0x5cec('0x33')](_0x4cbb3a['model'],qs[_0x5cec('0x34')](_0x4feea5['query'][_0x5cec('0x34')]));_0x1df8cf[_0x5cec('0x35')]=_0x1df8cf[_0x5cec('0x35')]['length']?_0x1df8cf['attributes']:_0x4cbb3a[_0x5cec('0x2e')];if(!_0x4feea5['query'][_0x5cec('0x36')](_0x5cec('0x37'))){_0x1df8cf[_0x5cec('0x20')]=qs[_0x5cec('0x20')](_0x4feea5[_0x5cec('0x30')]['limit']);_0x1df8cf[_0x5cec('0x1f')]=qs['offset'](_0x4feea5['query'][_0x5cec('0x1f')]);}_0x1df8cf[_0x5cec('0x38')]=qs[_0x5cec('0x39')](_0x4feea5[_0x5cec('0x30')][_0x5cec('0x39')]);_0x1df8cf['where']=qs[_0x5cec('0x32')](_[_0x5cec('0x3a')](_0x4feea5[_0x5cec('0x30')],_0x4cbb3a['filters']),_0x3b2b7f);if(_0x4feea5['query'][_0x5cec('0x3b')]){_0x1df8cf[_0x5cec('0x3c')]=_[_0x5cec('0x3d')](_0x1df8cf['where'],{'$or':_['map'](_0x3b2b7f,function(_0x5564eb){if(_0x5564eb['type']!==_0x5cec('0x3e')){var _0x53225f={};_0x53225f[_0x5564eb[_0x5cec('0x2a')]]={'$like':'%'+_0x4feea5['query']['filter']+'%'};return _0x53225f;}})});}_0x1df8cf=_[_0x5cec('0x3d')]({},_0x1df8cf,_0x4feea5[_0x5cec('0x3f')]);var _0x21aa39={'where':_0x1df8cf[_0x5cec('0x3c')]};return db[_0x5cec('0x40')][_0x5cec('0x1e')](_0x21aa39)[_0x5cec('0x27')](function(_0x419683){_0x5e4932['count']=_0x419683;if(_0x4feea5[_0x5cec('0x30')][_0x5cec('0x41')]){_0x1df8cf[_0x5cec('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x5cec('0x43')](_0x1df8cf);})[_0x5cec('0x27')](function(_0x4efa5c){_0x5e4932[_0x5cec('0x44')]=_0x4efa5c;return _0x5e4932;})[_0x5cec('0x27')](respondWithFilteredResult(_0x38d757,_0x1df8cf))[_0x5cec('0x45')](handleError(_0x38d757,null));};exports['show']=function(_0x5b43ea,_0x19efab){var _0x40a73e={'raw':!![],'where':{'id':_0x5b43ea[_0x5cec('0x46')]['id']}},_0x57b7e5={};_0x57b7e5[_0x5cec('0x2e')]=_[_0x5cec('0x31')](db[_0x5cec('0x40')][_0x5cec('0x2b')]);_0x57b7e5[_0x5cec('0x30')]=_['keys'](_0x5b43ea[_0x5cec('0x30')]);_0x57b7e5[_0x5cec('0x32')]=_[_0x5cec('0x33')](_0x57b7e5[_0x5cec('0x2e')],_0x57b7e5[_0x5cec('0x30')]);_0x40a73e[_0x5cec('0x35')]=_[_0x5cec('0x33')](_0x57b7e5[_0x5cec('0x2e')],qs[_0x5cec('0x34')](_0x5b43ea[_0x5cec('0x30')][_0x5cec('0x34')]));_0x40a73e[_0x5cec('0x35')]=_0x40a73e[_0x5cec('0x35')][_0x5cec('0x47')]?_0x40a73e['attributes']:_0x57b7e5[_0x5cec('0x2e')];if(_0x5b43ea[_0x5cec('0x30')][_0x5cec('0x41')]){_0x40a73e['include']=[{'all':!![]}];}_0x40a73e=_['merge']({},_0x40a73e,_0x5b43ea['options']);return db[_0x5cec('0x40')][_0x5cec('0x48')](_0x40a73e)[_0x5cec('0x27')](handleEntityNotFound(_0x19efab,null))[_0x5cec('0x27')](respondWithResult(_0x19efab,null))['catch'](handleError(_0x19efab,null));};exports[_0x5cec('0x49')]=function(_0x1aaeec,_0x337c32){return db[_0x5cec('0x40')][_0x5cec('0x49')](_0x1aaeec['body'],{})[_0x5cec('0x27')](respondWithResult(_0x337c32,0xc9))['catch'](handleError(_0x337c32,null));};exports[_0x5cec('0x25')]=function(_0xa811bf,_0x182210){if(_0xa811bf['body']['id']){delete _0xa811bf[_0x5cec('0x4a')]['id'];}return db[_0x5cec('0x40')][_0x5cec('0x48')]({'where':{'id':_0xa811bf[_0x5cec('0x46')]['id']}})[_0x5cec('0x27')](handleEntityNotFound(_0x182210,null))[_0x5cec('0x27')](saveUpdates(_0xa811bf['body'],null))[_0x5cec('0x27')](respondWithResult(_0x182210,null))['catch'](handleError(_0x182210,null));};exports['destroy']=function(_0x44c2e6,_0xa53f2){return db[_0x5cec('0x40')][_0x5cec('0x48')]({'where':{'id':_0x44c2e6[_0x5cec('0x46')]['id']}})[_0x5cec('0x27')](handleEntityNotFound(_0xa53f2,null))['then'](removeEntity(_0xa53f2,null))[_0x5cec('0x45')](handleError(_0xa53f2,null));};
\ No newline at end of file
+var _0x8999=['count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','offset','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined'];(function(_0x563456,_0x10d2da){var _0x4c009=function(_0x31cc55){while(--_0x31cc55){_0x563456['push'](_0x563456['shift']());}};_0x4c009(++_0x10d2da);}(_0x8999,0xb3));var _0x9899=function(_0x57e9a0,_0x24b43a){_0x57e9a0=_0x57e9a0-0x0;var _0x3c0c39=_0x8999[_0x57e9a0];return _0x3c0c39;};'use strict';var emlformat=require(_0x9899('0x0'));var rimraf=require(_0x9899('0x1'));var zipdir=require(_0x9899('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9899('0x3'));var moment=require(_0x9899('0x4'));var BPromise=require(_0x9899('0x5'));var Mustache=require(_0x9899('0x6'));var util=require(_0x9899('0x7'));var path=require(_0x9899('0x8'));var sox=require(_0x9899('0x9'));var csv=require(_0x9899('0xa'));var ejs=require(_0x9899('0xb'));var fs=require('fs');var fs_extra=require(_0x9899('0xc'));var _=require(_0x9899('0xd'));var squel=require(_0x9899('0xe'));var crypto=require(_0x9899('0xf'));var jsforce=require(_0x9899('0x10'));var deskjs=require(_0x9899('0x11'));var toCsv=require(_0x9899('0xa'));var querystring=require(_0x9899('0x12'));var Papa=require(_0x9899('0x13'));var Redis=require(_0x9899('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9899('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9899('0x16'))(_0x9899('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9899('0x18'));var db=require(_0x9899('0x19'))['db'];function respondWithStatusCode(_0x4cf048,_0x55ea76){_0x55ea76=_0x55ea76||0xcc;return function(_0x11b816){if(_0x11b816){return _0x4cf048[_0x9899('0x1a')](_0x55ea76);}return _0x4cf048['status'](_0x55ea76)[_0x9899('0x1b')]();};}function respondWithResult(_0x4208ea,_0x2c1fca){_0x2c1fca=_0x2c1fca||0xc8;return function(_0x779d92){if(_0x779d92){return _0x4208ea[_0x9899('0x1c')](_0x2c1fca)[_0x9899('0x1d')](_0x779d92);}};}function respondWithFilteredResult(_0x29ab17,_0x2f513c){return function(_0x42fc53){if(_0x42fc53){var _0xc71e3d=typeof _0x2f513c['offset']===_0x9899('0x1e')&&typeof _0x2f513c['limit']===_0x9899('0x1e');var _0xce40fb=_0x42fc53[_0x9899('0x1f')];var _0x3ea213=_0xc71e3d?0x0:_0x2f513c['offset'];var _0x3921b6=_0xc71e3d?_0x42fc53[_0x9899('0x1f')]:_0x2f513c['offset']+_0x2f513c[_0x9899('0x20')];var _0x1321a8;if(_0x3921b6>=_0xce40fb){_0x3921b6=_0xce40fb;_0x1321a8=0xc8;}else{_0x1321a8=0xce;}_0x29ab17['status'](_0x1321a8);return _0x29ab17[_0x9899('0x21')](_0x9899('0x22'),_0x3ea213+'-'+_0x3921b6+'/'+_0xce40fb)['json'](_0x42fc53);}return null;};}function patchUpdates(_0x714205){return function(_0x2901da){try{jsonpatch[_0x9899('0x23')](_0x2901da,_0x714205,!![]);}catch(_0x4040c7){return BPromise[_0x9899('0x24')](_0x4040c7);}return _0x2901da[_0x9899('0x25')]();};}function saveUpdates(_0x3bcc80,_0x42d97d){return function(_0x5c02fc){if(_0x5c02fc){return _0x5c02fc[_0x9899('0x26')](_0x3bcc80)[_0x9899('0x27')](function(_0x1c96b9){return _0x1c96b9;});}return null;};}function removeEntity(_0x48ae3c,_0x1f2915){return function(_0x488e9a){if(_0x488e9a){return _0x488e9a[_0x9899('0x28')]()[_0x9899('0x27')](function(){_0x48ae3c[_0x9899('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x123cdd,_0x565768){return function(_0x452892){if(!_0x452892){_0x123cdd['sendStatus'](0x194);}return _0x452892;};}function handleError(_0xb59f5f,_0x4b454f){_0x4b454f=_0x4b454f||0x1f4;return function(_0x32006b){logger['error'](_0x32006b['stack']);if(_0x32006b[_0x9899('0x29')]){delete _0x32006b[_0x9899('0x29')];}_0xb59f5f[_0x9899('0x1c')](_0x4b454f)['send'](_0x32006b);};}exports[_0x9899('0x2a')]=function(_0xf0747a,_0xfeab06){var _0x21b59a={},_0x17f9d5={},_0x53d802={'count':0x0,'rows':[]};var _0x30befe=_[_0x9899('0x2b')](db[_0x9899('0x2c')][_0x9899('0x2d')],function(_0x2b9488){return{'name':_0x2b9488['fieldName'],'type':_0x2b9488['type']['key']};});_0x17f9d5[_0x9899('0x2e')]=_[_0x9899('0x2b')](_0x30befe,_0x9899('0x29'));_0x17f9d5['query']=_[_0x9899('0x2f')](_0xf0747a[_0x9899('0x30')]);_0x17f9d5[_0x9899('0x31')]=_[_0x9899('0x32')](_0x17f9d5[_0x9899('0x2e')],_0x17f9d5['query']);_0x21b59a[_0x9899('0x33')]=_[_0x9899('0x32')](_0x17f9d5['model'],qs[_0x9899('0x34')](_0xf0747a[_0x9899('0x30')][_0x9899('0x34')]));_0x21b59a[_0x9899('0x33')]=_0x21b59a[_0x9899('0x33')][_0x9899('0x35')]?_0x21b59a[_0x9899('0x33')]:_0x17f9d5['model'];if(!_0xf0747a['query']['hasOwnProperty']('nolimit')){_0x21b59a[_0x9899('0x20')]=qs[_0x9899('0x20')](_0xf0747a[_0x9899('0x30')][_0x9899('0x20')]);_0x21b59a[_0x9899('0x36')]=qs[_0x9899('0x36')](_0xf0747a[_0x9899('0x30')][_0x9899('0x36')]);}_0x21b59a['order']=qs['sort'](_0xf0747a[_0x9899('0x30')][_0x9899('0x37')]);_0x21b59a[_0x9899('0x38')]=qs[_0x9899('0x31')](_['pick'](_0xf0747a[_0x9899('0x30')],_0x17f9d5['filters']),_0x30befe);if(_0xf0747a[_0x9899('0x30')][_0x9899('0x39')]){_0x21b59a[_0x9899('0x38')]=_[_0x9899('0x3a')](_0x21b59a[_0x9899('0x38')],{'$or':_['map'](_0x30befe,function(_0x1db76f){if(_0x1db76f[_0x9899('0x3b')]!==_0x9899('0x3c')){var _0x2349f0={};_0x2349f0[_0x1db76f[_0x9899('0x29')]]={'$like':'%'+_0xf0747a[_0x9899('0x30')]['filter']+'%'};return _0x2349f0;}})});}_0x21b59a=_['merge']({},_0x21b59a,_0xf0747a[_0x9899('0x3d')]);var _0x394b73={'where':_0x21b59a[_0x9899('0x38')]};return db['AnalyticTreeReport'][_0x9899('0x1f')](_0x394b73)[_0x9899('0x27')](function(_0x2ae9a8){_0x53d802['count']=_0x2ae9a8;if(_0xf0747a['query'][_0x9899('0x3e')]){_0x21b59a[_0x9899('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x21b59a);})['then'](function(_0x87174){_0x53d802[_0x9899('0x40')]=_0x87174;return _0x53d802;})[_0x9899('0x27')](respondWithFilteredResult(_0xfeab06,_0x21b59a))[_0x9899('0x41')](handleError(_0xfeab06,null));};exports[_0x9899('0x42')]=function(_0x14ad75,_0x14826f){var _0x5120aa={'raw':!![],'where':{'id':_0x14ad75['params']['id']}},_0xc99ec4={};_0xc99ec4[_0x9899('0x2e')]=_[_0x9899('0x2f')](db[_0x9899('0x2c')]['rawAttributes']);_0xc99ec4['query']=_[_0x9899('0x2f')](_0x14ad75[_0x9899('0x30')]);_0xc99ec4[_0x9899('0x31')]=_[_0x9899('0x32')](_0xc99ec4['model'],_0xc99ec4[_0x9899('0x30')]);_0x5120aa[_0x9899('0x33')]=_['intersection'](_0xc99ec4['model'],qs['fields'](_0x14ad75[_0x9899('0x30')][_0x9899('0x34')]));_0x5120aa[_0x9899('0x33')]=_0x5120aa[_0x9899('0x33')]['length']?_0x5120aa[_0x9899('0x33')]:_0xc99ec4['model'];if(_0x14ad75[_0x9899('0x30')][_0x9899('0x3e')]){_0x5120aa[_0x9899('0x3f')]=[{'all':!![]}];}_0x5120aa=_[_0x9899('0x3a')]({},_0x5120aa,_0x14ad75[_0x9899('0x3d')]);return db[_0x9899('0x2c')][_0x9899('0x43')](_0x5120aa)['then'](handleEntityNotFound(_0x14826f,null))[_0x9899('0x27')](respondWithResult(_0x14826f,null))[_0x9899('0x41')](handleError(_0x14826f,null));};exports[_0x9899('0x44')]=function(_0x5ab575,_0xa70afa){return db[_0x9899('0x2c')][_0x9899('0x44')](_0x5ab575[_0x9899('0x45')],{})['then'](respondWithResult(_0xa70afa,0xc9))[_0x9899('0x41')](handleError(_0xa70afa,null));};exports[_0x9899('0x26')]=function(_0x4e4bd9,_0x4be886){if(_0x4e4bd9[_0x9899('0x45')]['id']){delete _0x4e4bd9['body']['id'];}return db[_0x9899('0x2c')][_0x9899('0x43')]({'where':{'id':_0x4e4bd9['params']['id']}})[_0x9899('0x27')](handleEntityNotFound(_0x4be886,null))[_0x9899('0x27')](saveUpdates(_0x4e4bd9['body'],null))[_0x9899('0x27')](respondWithResult(_0x4be886,null))['catch'](handleError(_0x4be886,null));};exports['destroy']=function(_0x170a60,_0x1abec5){return db[_0x9899('0x2c')][_0x9899('0x43')]({'where':{'id':_0x170a60['params']['id']}})[_0x9899('0x27')](handleEntityNotFound(_0x1abec5,null))['then'](removeEntity(_0x1abec5,null))['catch'](handleError(_0x1abec5,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 7b7c13d..9e853f6 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 _0x188b=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x188b,0x6c));var _0xb188=function(_0xaa75b0,_0x1a05e7){_0xaa75b0=_0xaa75b0-0x0;var _0x49dbe1=_0x188b[_0xaa75b0];return _0x49dbe1;};'use strict';var _=require(_0xb188('0x0'));var util=require(_0xb188('0x1'));var logger=require(_0xb188('0x2'))('api');var moment=require(_0xb188('0x3'));var BPromise=require(_0xb188('0x4'));var rp=require(_0xb188('0x5'));var fs=require('fs');var path=require(_0xb188('0x6'));var rimraf=require(_0xb188('0x7'));var config=require(_0xb188('0x8'));var attributes=require(_0xb188('0x9'));module['exports']=function(_0x4bc5a3,_0x4a654d){return _0x4bc5a3[_0xb188('0xa')](_0xb188('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25c8=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_report_trees','util'];(function(_0x1de4d3,_0x4809a5){var _0x41b51e=function(_0x3f7702){while(--_0x3f7702){_0x1de4d3['push'](_0x1de4d3['shift']());}};_0x41b51e(++_0x4809a5);}(_0x25c8,0xb3));var _0x825c=function(_0x37abba,_0x490d40){_0x37abba=_0x37abba-0x0;var _0x459ef6=_0x25c8[_0x37abba];return _0x459ef6;};'use strict';var _=require('lodash');var util=require(_0x825c('0x0'));var logger=require(_0x825c('0x1'))('api');var moment=require(_0x825c('0x2'));var BPromise=require(_0x825c('0x3'));var rp=require(_0x825c('0x4'));var fs=require('fs');var path=require(_0x825c('0x5'));var rimraf=require(_0x825c('0x6'));var config=require(_0x825c('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x2e515c,_0x479b70){return _0x2e515c[_0x825c('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0x825c('0x9'),'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 ffba945..4893ff4 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4094d9,_0x16234a){var _0x133fdb=function(_0x234f9a){while(--_0x234f9a){_0x4094d9['push'](_0x4094d9['shift']());}};_0x133fdb(++_0x16234a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ecf10,_0x1f6ea7){_0x4ecf10=_0x4ecf10-0x0;var _0x2e737b=_0x5f2f[_0x4ecf10];return _0x2e737b;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x26e9e8,_0x4b18bb){var _0x570436=function(_0x163a8c){while(--_0x163a8c){_0x26e9e8['push'](_0x26e9e8['shift']());}};_0x570436(++_0x4b18bb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x20a48e,_0x19c088){_0x20a48e=_0x20a48e-0x0;var _0x4b0c22=_0x5f2f[_0x20a48e];return _0x4b0c22;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index add37e9..2d5ff59 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 _0x23fd=['exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','create','put','/:id','delete','destroy'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x23fd,0x131));var _0xd23f=function(_0x579a16,_0x27986b){_0x579a16=_0x579a16-0x0;var _0x489de6=_0x23fd[_0x579a16];return _0x489de6;};'use strict';var multer=require(_0xd23f('0x0'));var util=require(_0xd23f('0x1'));var path=require('path');var timeout=require(_0xd23f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd23f('0x3'));var interaction=require(_0xd23f('0x4'));var config=require(_0xd23f('0x5'));var controller=require('./analyticTreeReport.controller');router[_0xd23f('0x6')]('/',auth['isAuthenticated'](),controller[_0xd23f('0x7')]);router[_0xd23f('0x6')]('/:id',auth[_0xd23f('0x8')](),controller['show']);router[_0xd23f('0x9')]('/',auth[_0xd23f('0x8')](),controller[_0xd23f('0xa')]);router[_0xd23f('0xb')](_0xd23f('0xc'),auth[_0xd23f('0x8')](),controller['update']);router[_0xd23f('0xd')](_0xd23f('0xc'),auth[_0xd23f('0x8')](),controller[_0xd23f('0xe')]);module[_0xd23f('0xf')]=router;
\ No newline at end of file
+var _0x1c60=['post','create','put','update','delete','destroy','exports','util','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x4d76cf,_0x37d73e){var _0x5d10fb=function(_0x439b5c){while(--_0x439b5c){_0x4d76cf['push'](_0x4d76cf['shift']());}};_0x5d10fb(++_0x37d73e);}(_0x1c60,0xbb));var _0x01c6=function(_0x567f0e,_0x2be7a0){_0x567f0e=_0x567f0e-0x0;var _0x15aca8=_0x1c60[_0x567f0e];return _0x15aca8;};'use strict';var multer=require('multer');var util=require(_0x01c6('0x0'));var path=require('path');var timeout=require(_0x01c6('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x01c6('0x2'));var config=require(_0x01c6('0x3'));var controller=require('./analyticTreeReport.controller');router[_0x01c6('0x4')]('/',auth[_0x01c6('0x5')](),controller['index']);router[_0x01c6('0x4')](_0x01c6('0x6'),auth[_0x01c6('0x5')](),controller[_0x01c6('0x7')]);router[_0x01c6('0x8')]('/',auth[_0x01c6('0x5')](),controller[_0x01c6('0x9')]);router[_0x01c6('0xa')](_0x01c6('0x6'),auth[_0x01c6('0x5')](),controller[_0x01c6('0xb')]);router[_0x01c6('0xc')](_0x01c6('0x6'),auth[_0x01c6('0x5')](),controller[_0x01c6('0xd')]);module[_0x01c6('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index b9cbc75..e2fa122 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 _0xc831=['STRING','exports'];(function(_0xcc1875,_0xa0f98d){var _0x113da2=function(_0x229505){while(--_0x229505){_0xcc1875['push'](_0xcc1875['shift']());}};_0x113da2(++_0xa0f98d);}(_0xc831,0x103));var _0x1c83=function(_0x467aa9,_0x24b963){_0x467aa9=_0x467aa9-0x0;var _0x5d9e92=_0xc831[_0x467aa9];return _0x5d9e92;};'use strict';var Sequelize=require('sequelize');module[_0x1c83('0x0')]={'name':{'type':Sequelize[_0x1c83('0x1')]},'basename':{'type':Sequelize[_0x1c83('0x1')]},'type':{'type':Sequelize[_0x1c83('0x1')]}};
\ No newline at end of file
+var _0x34e7=['exports','STRING','sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x34e7,0x164));var _0x734e=function(_0x44044a,_0x3a0097){_0x44044a=_0x44044a-0x0;var _0x43bb6e=_0x34e7[_0x44044a];return _0x43bb6e;};'use strict';var Sequelize=require(_0x734e('0x0'));module[_0x734e('0x1')]={'name':{'type':Sequelize[_0x734e('0x2')]},'basename':{'type':Sequelize[_0x734e('0x2')]},'type':{'type':Sequelize[_0x734e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index aa580f6..d75e578 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 _0xd464=['omit','create','catch','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','name','send','index','Attachment','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','find','clone','rawAttributes','options','get','createdAt','updatedAt','body'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xd464,0x6f));var _0x4d46=function(_0x532138,_0x3b38ad){_0x532138=_0x532138-0x0;var _0x3555dd=_0xd464[_0x532138];return _0x3555dd;};'use strict';var emlformat=require(_0x4d46('0x0'));var rimraf=require(_0x4d46('0x1'));var zipdir=require(_0x4d46('0x2'));var jsonpatch=require(_0x4d46('0x3'));var rp=require(_0x4d46('0x4'));var moment=require(_0x4d46('0x5'));var BPromise=require(_0x4d46('0x6'));var Mustache=require(_0x4d46('0x7'));var util=require(_0x4d46('0x8'));var path=require(_0x4d46('0x9'));var sox=require(_0x4d46('0xa'));var csv=require(_0x4d46('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d46('0xc'));var _=require(_0x4d46('0xd'));var squel=require(_0x4d46('0xe'));var crypto=require(_0x4d46('0xf'));var jsforce=require(_0x4d46('0x10'));var deskjs=require(_0x4d46('0x11'));var toCsv=require(_0x4d46('0xb'));var querystring=require(_0x4d46('0x12'));var Papa=require(_0x4d46('0x13'));var Redis=require(_0x4d46('0x14'));var authService=require(_0x4d46('0x15'));var qs=require(_0x4d46('0x16'));var as=require(_0x4d46('0x17'));var hardwareService=require(_0x4d46('0x18'));var logger=require(_0x4d46('0x19'))(_0x4d46('0x1a'));var utils=require(_0x4d46('0x1b'));var config=require(_0x4d46('0x1c'));var licenseUtil=require(_0x4d46('0x1d'));var db=require(_0x4d46('0x1e'))['db'];function respondWithStatusCode(_0x4554e7,_0x271a43){_0x271a43=_0x271a43||0xcc;return function(_0x296e1d){if(_0x296e1d){return _0x4554e7[_0x4d46('0x1f')](_0x271a43);}return _0x4554e7[_0x4d46('0x20')](_0x271a43)[_0x4d46('0x21')]();};}function respondWithResult(_0x50c721,_0x5e4dde){_0x5e4dde=_0x5e4dde||0xc8;return function(_0x2c1a76){if(_0x2c1a76){return _0x50c721[_0x4d46('0x20')](_0x5e4dde)['json'](_0x2c1a76);}};}function respondWithFilteredResult(_0xa92d12,_0xdeef26){return function(_0x49b984){if(_0x49b984){var _0x26ef10=typeof _0xdeef26[_0x4d46('0x22')]===_0x4d46('0x23')&&typeof _0xdeef26[_0x4d46('0x24')]===_0x4d46('0x23');var _0x4bc520=_0x49b984[_0x4d46('0x25')];var _0x2ef287=_0x26ef10?0x0:_0xdeef26[_0x4d46('0x22')];var _0x1848ed=_0x26ef10?_0x49b984['count']:_0xdeef26['offset']+_0xdeef26[_0x4d46('0x24')];var _0x19f334;if(_0x1848ed>=_0x4bc520){_0x1848ed=_0x4bc520;_0x19f334=0xc8;}else{_0x19f334=0xce;}_0xa92d12['status'](_0x19f334);return _0xa92d12[_0x4d46('0x26')](_0x4d46('0x27'),_0x2ef287+'-'+_0x1848ed+'/'+_0x4bc520)[_0x4d46('0x28')](_0x49b984);}return null;};}function patchUpdates(_0x240c89){return function(_0x273cf1){try{jsonpatch['apply'](_0x273cf1,_0x240c89,!![]);}catch(_0x3872f8){return BPromise[_0x4d46('0x29')](_0x3872f8);}return _0x273cf1[_0x4d46('0x2a')]();};}function saveUpdates(_0x80d584,_0x26ad63){return function(_0x172fce){if(_0x172fce){return _0x172fce['update'](_0x80d584)[_0x4d46('0x2b')](function(_0x5ed26c){return _0x5ed26c;});}return null;};}function removeEntity(_0x37bd9a,_0x55b368){return function(_0x3dce22){if(_0x3dce22){return _0x3dce22[_0x4d46('0x2c')]()[_0x4d46('0x2b')](function(){_0x37bd9a[_0x4d46('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27d3b4,_0x1ac0b8){return function(_0x54cff0){if(!_0x54cff0){_0x27d3b4[_0x4d46('0x1f')](0x194);}return _0x54cff0;};}function handleError(_0x20adf2,_0x3f016f){_0x3f016f=_0x3f016f||0x1f4;return function(_0xca9e0e){logger[_0x4d46('0x2d')](_0xca9e0e['stack']);if(_0xca9e0e[_0x4d46('0x2e')]){delete _0xca9e0e['name'];}_0x20adf2[_0x4d46('0x20')](_0x3f016f)[_0x4d46('0x2f')](_0xca9e0e);};}exports[_0x4d46('0x30')]=function(_0x4dc870,_0x54af5d){var _0x5040f1={},_0x17384c={},_0x1150d6={'count':0x0,'rows':[]};var _0x257ce1=_['map'](db[_0x4d46('0x31')]['rawAttributes'],function(_0x1c15ad){return{'name':_0x1c15ad['fieldName'],'type':_0x1c15ad[_0x4d46('0x32')][_0x4d46('0x33')]};});_0x17384c[_0x4d46('0x34')]=_[_0x4d46('0x35')](_0x257ce1,_0x4d46('0x2e'));_0x17384c[_0x4d46('0x36')]=_[_0x4d46('0x37')](_0x4dc870[_0x4d46('0x36')]);_0x17384c['filters']=_[_0x4d46('0x38')](_0x17384c['model'],_0x17384c[_0x4d46('0x36')]);_0x5040f1[_0x4d46('0x39')]=_[_0x4d46('0x38')](_0x17384c[_0x4d46('0x34')],qs[_0x4d46('0x3a')](_0x4dc870['query'][_0x4d46('0x3a')]));_0x5040f1['attributes']=_0x5040f1[_0x4d46('0x39')][_0x4d46('0x3b')]?_0x5040f1[_0x4d46('0x39')]:_0x17384c[_0x4d46('0x34')];if(!_0x4dc870[_0x4d46('0x36')][_0x4d46('0x3c')](_0x4d46('0x3d'))){_0x5040f1[_0x4d46('0x24')]=qs[_0x4d46('0x24')](_0x4dc870[_0x4d46('0x36')][_0x4d46('0x24')]);_0x5040f1[_0x4d46('0x22')]=qs[_0x4d46('0x22')](_0x4dc870[_0x4d46('0x36')][_0x4d46('0x22')]);}_0x5040f1['order']=qs[_0x4d46('0x3e')](_0x4dc870[_0x4d46('0x36')][_0x4d46('0x3e')]);_0x5040f1['where']=qs[_0x4d46('0x3f')](_[_0x4d46('0x40')](_0x4dc870['query'],_0x17384c[_0x4d46('0x3f')]),_0x257ce1);if(_0x4dc870['query'][_0x4d46('0x41')]){_0x5040f1[_0x4d46('0x42')]=_['merge'](_0x5040f1['where'],{'$or':_[_0x4d46('0x35')](_0x257ce1,function(_0x535b06){if(_0x535b06[_0x4d46('0x32')]!==_0x4d46('0x43')){var _0x48203b={};_0x48203b[_0x535b06[_0x4d46('0x2e')]]={'$like':'%'+_0x4dc870['query'][_0x4d46('0x41')]+'%'};return _0x48203b;}})});}_0x5040f1=_[_0x4d46('0x44')]({},_0x5040f1,_0x4dc870['options']);var _0x5355e8={'where':_0x5040f1[_0x4d46('0x42')]};return db[_0x4d46('0x31')][_0x4d46('0x25')](_0x5355e8)[_0x4d46('0x2b')](function(_0x7c5341){_0x1150d6[_0x4d46('0x25')]=_0x7c5341;if(_0x4dc870[_0x4d46('0x36')][_0x4d46('0x45')]){_0x5040f1[_0x4d46('0x46')]=[{'all':!![]}];}return db[_0x4d46('0x31')][_0x4d46('0x47')](_0x5040f1);})[_0x4d46('0x2b')](function(_0x5237c6){_0x1150d6[_0x4d46('0x48')]=_0x5237c6;return _0x1150d6;})[_0x4d46('0x2b')](respondWithFilteredResult(_0x54af5d,_0x5040f1))['catch'](handleError(_0x54af5d,null));};exports[_0x4d46('0x49')]=function(_0x59bfe7,_0x4493a6){var _0x244278={'raw':!![],'where':{'id':_0x59bfe7[_0x4d46('0x4a')]['id']}},_0xcf199={};_0xcf199[_0x4d46('0x34')]=_[_0x4d46('0x37')](db[_0x4d46('0x31')]['rawAttributes']);_0xcf199['query']=_[_0x4d46('0x37')](_0x59bfe7[_0x4d46('0x36')]);_0xcf199[_0x4d46('0x3f')]=_['intersection'](_0xcf199[_0x4d46('0x34')],_0xcf199[_0x4d46('0x36')]);_0x244278['attributes']=_[_0x4d46('0x38')](_0xcf199[_0x4d46('0x34')],qs[_0x4d46('0x3a')](_0x59bfe7[_0x4d46('0x36')][_0x4d46('0x3a')]));_0x244278[_0x4d46('0x39')]=_0x244278[_0x4d46('0x39')][_0x4d46('0x3b')]?_0x244278[_0x4d46('0x39')]:_0xcf199[_0x4d46('0x34')];if(_0x59bfe7['query']['includeAll']){_0x244278['include']=[{'all':!![]}];}_0x244278=_[_0x4d46('0x44')]({},_0x244278,_0x59bfe7['options']);return db[_0x4d46('0x31')][_0x4d46('0x4b')](_0x244278)[_0x4d46('0x2b')](handleEntityNotFound(_0x4493a6,null))[_0x4d46('0x2b')](respondWithResult(_0x4493a6,null))['catch'](handleError(_0x4493a6,null));};exports[_0x4d46('0x4c')]=function(_0x21b43a,_0x3f471e){var _0x32fb79={'where':{'id':_0x21b43a[_0x4d46('0x4a')]['id']}},_0x144f00={};_0x144f00[_0x4d46('0x34')]=_[_0x4d46('0x37')](db[_0x4d46('0x31')][_0x4d46('0x4d')]);_0x32fb79[_0x4d46('0x39')]=_['intersection'](_0x144f00['model'],qs['fields'](_0x21b43a[_0x4d46('0x36')][_0x4d46('0x3a')]));_0x32fb79[_0x4d46('0x39')]=_0x32fb79['attributes'][_0x4d46('0x3b')]?_0x32fb79[_0x4d46('0x39')]:_0x144f00[_0x4d46('0x34')];if(_0x21b43a[_0x4d46('0x36')][_0x4d46('0x45')]){_0x32fb79['include']=[{'all':!![]}];}_0x32fb79=_[_0x4d46('0x44')]({},_0x32fb79,_0x21b43a[_0x4d46('0x4e')]);return db['Attachment'][_0x4d46('0x4b')](_0x32fb79)[_0x4d46('0x2b')](handleEntityNotFound(_0x3f471e,null))[_0x4d46('0x2b')](function(_0xce49e2){if(_0xce49e2){var _0x45080e=_0xce49e2[_0x4d46('0x4f')]({'plain':!![]});_0x45080e=qs['omit'](_0x45080e,['id',_0x4d46('0x50'),_0x4d46('0x51')]);_0x21b43a[_0x4d46('0x52')]=_[_0x4d46('0x53')](_0x21b43a[_0x4d46('0x52')],['id','createdAt','updatedAt']);return db[_0x4d46('0x31')][_0x4d46('0x54')](_['merge'](_0x45080e,_0x21b43a['body']),{'include':_0x21b43a[_0x4d46('0x36')][_0x4d46('0x45')]?[{'all':!![]}]:undefined});}})[_0x4d46('0x2b')](respondWithResult(_0x3f471e,0xc9))[_0x4d46('0x55')](handleError(_0x3f471e,null));};exports['update']=function(_0x568b32,_0xb7c2ec){if(_0x568b32[_0x4d46('0x52')]['id']){delete _0x568b32[_0x4d46('0x52')]['id'];}return db[_0x4d46('0x31')][_0x4d46('0x4b')]({'where':{'id':_0x568b32[_0x4d46('0x4a')]['id']}})[_0x4d46('0x2b')](handleEntityNotFound(_0xb7c2ec,null))['then'](saveUpdates(_0x568b32[_0x4d46('0x52')],null))[_0x4d46('0x2b')](respondWithResult(_0xb7c2ec,null))['catch'](handleError(_0xb7c2ec,null));};exports[_0x4d46('0x2c')]=function(_0x3f1a0d,_0x10d345){return db[_0x4d46('0x31')][_0x4d46('0x4b')]({'where':{'id':_0x3f1a0d[_0x4d46('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10d345,null))[_0x4d46('0x2b')](removeEntity(_0x10d345,null))[_0x4d46('0x55')](handleError(_0x10d345,null));};exports['create']=function(_0x811dbf,_0x1d4072,_0x188c52){_0x811dbf[_0x4d46('0x52')][_0x4d46('0x2e')]=_0x811dbf[_0x4d46('0x56')][_0x4d46('0x57')];_0x811dbf[_0x4d46('0x52')]['basename']=_0x811dbf[_0x4d46('0x56')][_0x4d46('0x58')];_0x811dbf[_0x4d46('0x52')][_0x4d46('0x32')]=_0x811dbf['file'][_0x4d46('0x59')];return db['Attachment']['create'](_0x811dbf[_0x4d46('0x52')])[_0x4d46('0x2b')](respondWithResult(_0x1d4072,0xc9))[_0x4d46('0x55')](handleError(_0x1d4072,null));};exports[_0x4d46('0x5a')]=function(_0x1e2ec2,_0x3815ab,_0x5c1869){return db[_0x4d46('0x31')][_0x4d46('0x5b')]({'where':{'id':_0x1e2ec2['params']['id']},'raw':!![]})[_0x4d46('0x2b')](handleEntityNotFound(_0x3815ab,null))['then'](function(_0x5796c9){if(_0x5796c9){var _0x5b35e4=_0x5796c9[_0x4d46('0x5c')]!==null;var _0x19f887=path['join'](config[_0x4d46('0x5d')],_0x4d46('0x5e'));if(_0x5b35e4){_0x19f887=path[_0x4d46('0x5f')](_0x19f887,'offline-chat/');}var _0x2ed711=path[_0x4d46('0x5f')](_0x19f887,_0x5796c9[_0x4d46('0x60')]);return _0x3815ab[_0x4d46('0x5a')](_0x2ed711);}})[_0x4d46('0x55')](handleError(_0x3815ab,null));};
\ No newline at end of file
+var _0xbd43=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','show','params','rawAttributes','find','catch','clone','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd43,0xf6));var _0x3bd4=function(_0x53762a,_0x25997a){_0x53762a=_0x53762a-0x0;var _0x469e93=_0xbd43[_0x53762a];return _0x469e93;};'use strict';var emlformat=require(_0x3bd4('0x0'));var rimraf=require(_0x3bd4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3bd4('0x2'));var rp=require(_0x3bd4('0x3'));var moment=require(_0x3bd4('0x4'));var BPromise=require(_0x3bd4('0x5'));var Mustache=require(_0x3bd4('0x6'));var util=require(_0x3bd4('0x7'));var path=require(_0x3bd4('0x8'));var sox=require('sox');var csv=require(_0x3bd4('0x9'));var ejs=require(_0x3bd4('0xa'));var fs=require('fs');var fs_extra=require(_0x3bd4('0xb'));var _=require(_0x3bd4('0xc'));var squel=require('squel');var crypto=require(_0x3bd4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3bd4('0x9'));var querystring=require(_0x3bd4('0xe'));var Papa=require(_0x3bd4('0xf'));var Redis=require(_0x3bd4('0x10'));var authService=require(_0x3bd4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3bd4('0x12'));var hardwareService=require(_0x3bd4('0x13'));var logger=require('../../config/logger')(_0x3bd4('0x14'));var utils=require(_0x3bd4('0x15'));var config=require(_0x3bd4('0x16'));var licenseUtil=require(_0x3bd4('0x17'));var db=require(_0x3bd4('0x18'))['db'];function respondWithStatusCode(_0x1a6a92,_0x478b42){_0x478b42=_0x478b42||0xcc;return function(_0x1ea089){if(_0x1ea089){return _0x1a6a92['sendStatus'](_0x478b42);}return _0x1a6a92[_0x3bd4('0x19')](_0x478b42)[_0x3bd4('0x1a')]();};}function respondWithResult(_0x427123,_0x52a0d0){_0x52a0d0=_0x52a0d0||0xc8;return function(_0x42781f){if(_0x42781f){return _0x427123[_0x3bd4('0x19')](_0x52a0d0)['json'](_0x42781f);}};}function respondWithFilteredResult(_0x526f98,_0x5ed5f3){return function(_0xf580c5){if(_0xf580c5){var _0x2a7ff4=typeof _0x5ed5f3['offset']===_0x3bd4('0x1b')&&typeof _0x5ed5f3[_0x3bd4('0x1c')]===_0x3bd4('0x1b');var _0x4b64ee=_0xf580c5[_0x3bd4('0x1d')];var _0x3c9e82=_0x2a7ff4?0x0:_0x5ed5f3[_0x3bd4('0x1e')];var _0x5a09ee=_0x2a7ff4?_0xf580c5[_0x3bd4('0x1d')]:_0x5ed5f3[_0x3bd4('0x1e')]+_0x5ed5f3[_0x3bd4('0x1c')];var _0x41f2e6;if(_0x5a09ee>=_0x4b64ee){_0x5a09ee=_0x4b64ee;_0x41f2e6=0xc8;}else{_0x41f2e6=0xce;}_0x526f98[_0x3bd4('0x19')](_0x41f2e6);return _0x526f98['set'](_0x3bd4('0x1f'),_0x3c9e82+'-'+_0x5a09ee+'/'+_0x4b64ee)[_0x3bd4('0x20')](_0xf580c5);}return null;};}function patchUpdates(_0x51de64){return function(_0x1939e4){try{jsonpatch[_0x3bd4('0x21')](_0x1939e4,_0x51de64,!![]);}catch(_0x2b4737){return BPromise[_0x3bd4('0x22')](_0x2b4737);}return _0x1939e4[_0x3bd4('0x23')]();};}function saveUpdates(_0x394b23,_0x5f5bc1){return function(_0x4c0e4d){if(_0x4c0e4d){return _0x4c0e4d[_0x3bd4('0x24')](_0x394b23)[_0x3bd4('0x25')](function(_0x4919ec){return _0x4919ec;});}return null;};}function removeEntity(_0x5534c5,_0x3c9b36){return function(_0x47d577){if(_0x47d577){return _0x47d577[_0x3bd4('0x26')]()[_0x3bd4('0x25')](function(){_0x5534c5[_0x3bd4('0x19')](0xcc)[_0x3bd4('0x1a')]();});}};}function handleEntityNotFound(_0x2f8626,_0x10f99a){return function(_0x226aba){if(!_0x226aba){_0x2f8626['sendStatus'](0x194);}return _0x226aba;};}function handleError(_0x53d20f,_0x214235){_0x214235=_0x214235||0x1f4;return function(_0xfcd693){logger[_0x3bd4('0x27')](_0xfcd693[_0x3bd4('0x28')]);if(_0xfcd693[_0x3bd4('0x29')]){delete _0xfcd693[_0x3bd4('0x29')];}_0x53d20f[_0x3bd4('0x19')](_0x214235)['send'](_0xfcd693);};}exports[_0x3bd4('0x2a')]=function(_0x3fbabc,_0x42c4e4){var _0x9f588f={},_0x1fc588={},_0x3dd6dc={'count':0x0,'rows':[]};var _0x53d9b5=_[_0x3bd4('0x2b')](db['Attachment']['rawAttributes'],function(_0x1de80c){return{'name':_0x1de80c['fieldName'],'type':_0x1de80c[_0x3bd4('0x2c')]['key']};});_0x1fc588[_0x3bd4('0x2d')]=_[_0x3bd4('0x2b')](_0x53d9b5,_0x3bd4('0x29'));_0x1fc588['query']=_[_0x3bd4('0x2e')](_0x3fbabc[_0x3bd4('0x2f')]);_0x1fc588[_0x3bd4('0x30')]=_[_0x3bd4('0x31')](_0x1fc588['model'],_0x1fc588[_0x3bd4('0x2f')]);_0x9f588f[_0x3bd4('0x32')]=_['intersection'](_0x1fc588[_0x3bd4('0x2d')],qs[_0x3bd4('0x33')](_0x3fbabc[_0x3bd4('0x2f')][_0x3bd4('0x33')]));_0x9f588f[_0x3bd4('0x32')]=_0x9f588f[_0x3bd4('0x32')][_0x3bd4('0x34')]?_0x9f588f[_0x3bd4('0x32')]:_0x1fc588['model'];if(!_0x3fbabc[_0x3bd4('0x2f')]['hasOwnProperty'](_0x3bd4('0x35'))){_0x9f588f['limit']=qs[_0x3bd4('0x1c')](_0x3fbabc[_0x3bd4('0x2f')][_0x3bd4('0x1c')]);_0x9f588f['offset']=qs[_0x3bd4('0x1e')](_0x3fbabc[_0x3bd4('0x2f')][_0x3bd4('0x1e')]);}_0x9f588f['order']=qs[_0x3bd4('0x36')](_0x3fbabc[_0x3bd4('0x2f')]['sort']);_0x9f588f[_0x3bd4('0x37')]=qs['filters'](_['pick'](_0x3fbabc['query'],_0x1fc588[_0x3bd4('0x30')]),_0x53d9b5);if(_0x3fbabc['query'][_0x3bd4('0x38')]){_0x9f588f[_0x3bd4('0x37')]=_[_0x3bd4('0x39')](_0x9f588f[_0x3bd4('0x37')],{'$or':_[_0x3bd4('0x2b')](_0x53d9b5,function(_0x8ea638){if(_0x8ea638[_0x3bd4('0x2c')]!==_0x3bd4('0x3a')){var _0x1b9d22={};_0x1b9d22[_0x8ea638[_0x3bd4('0x29')]]={'$like':'%'+_0x3fbabc[_0x3bd4('0x2f')][_0x3bd4('0x38')]+'%'};return _0x1b9d22;}})});}_0x9f588f=_[_0x3bd4('0x39')]({},_0x9f588f,_0x3fbabc[_0x3bd4('0x3b')]);var _0x1585d3={'where':_0x9f588f[_0x3bd4('0x37')]};return db[_0x3bd4('0x3c')][_0x3bd4('0x1d')](_0x1585d3)[_0x3bd4('0x25')](function(_0xfdaa18){_0x3dd6dc[_0x3bd4('0x1d')]=_0xfdaa18;if(_0x3fbabc['query'][_0x3bd4('0x3d')]){_0x9f588f[_0x3bd4('0x3e')]=[{'all':!![]}];}return db[_0x3bd4('0x3c')][_0x3bd4('0x3f')](_0x9f588f);})[_0x3bd4('0x25')](function(_0x402f20){_0x3dd6dc['rows']=_0x402f20;return _0x3dd6dc;})[_0x3bd4('0x25')](respondWithFilteredResult(_0x42c4e4,_0x9f588f))['catch'](handleError(_0x42c4e4,null));};exports[_0x3bd4('0x40')]=function(_0x417136,_0x544692){var _0x35de9a={'raw':!![],'where':{'id':_0x417136[_0x3bd4('0x41')]['id']}},_0x36d80b={};_0x36d80b['model']=_['keys'](db[_0x3bd4('0x3c')][_0x3bd4('0x42')]);_0x36d80b[_0x3bd4('0x2f')]=_[_0x3bd4('0x2e')](_0x417136[_0x3bd4('0x2f')]);_0x36d80b[_0x3bd4('0x30')]=_[_0x3bd4('0x31')](_0x36d80b[_0x3bd4('0x2d')],_0x36d80b[_0x3bd4('0x2f')]);_0x35de9a[_0x3bd4('0x32')]=_['intersection'](_0x36d80b[_0x3bd4('0x2d')],qs['fields'](_0x417136[_0x3bd4('0x2f')]['fields']));_0x35de9a[_0x3bd4('0x32')]=_0x35de9a[_0x3bd4('0x32')]['length']?_0x35de9a[_0x3bd4('0x32')]:_0x36d80b[_0x3bd4('0x2d')];if(_0x417136[_0x3bd4('0x2f')]['includeAll']){_0x35de9a[_0x3bd4('0x3e')]=[{'all':!![]}];}_0x35de9a=_[_0x3bd4('0x39')]({},_0x35de9a,_0x417136[_0x3bd4('0x3b')]);return db[_0x3bd4('0x3c')][_0x3bd4('0x43')](_0x35de9a)[_0x3bd4('0x25')](handleEntityNotFound(_0x544692,null))[_0x3bd4('0x25')](respondWithResult(_0x544692,null))[_0x3bd4('0x44')](handleError(_0x544692,null));};exports[_0x3bd4('0x45')]=function(_0x4932db,_0x124fd9){var _0x367790={'where':{'id':_0x4932db['params']['id']}},_0x38bb6e={};_0x38bb6e[_0x3bd4('0x2d')]=_['keys'](db[_0x3bd4('0x3c')][_0x3bd4('0x42')]);_0x367790[_0x3bd4('0x32')]=_[_0x3bd4('0x31')](_0x38bb6e[_0x3bd4('0x2d')],qs[_0x3bd4('0x33')](_0x4932db[_0x3bd4('0x2f')][_0x3bd4('0x33')]));_0x367790[_0x3bd4('0x32')]=_0x367790[_0x3bd4('0x32')][_0x3bd4('0x34')]?_0x367790[_0x3bd4('0x32')]:_0x38bb6e[_0x3bd4('0x2d')];if(_0x4932db[_0x3bd4('0x2f')][_0x3bd4('0x3d')]){_0x367790[_0x3bd4('0x3e')]=[{'all':!![]}];}_0x367790=_[_0x3bd4('0x39')]({},_0x367790,_0x4932db['options']);return db[_0x3bd4('0x3c')]['find'](_0x367790)[_0x3bd4('0x25')](handleEntityNotFound(_0x124fd9,null))[_0x3bd4('0x25')](function(_0x50579c){if(_0x50579c){var _0x5c8c31=_0x50579c['get']({'plain':!![]});_0x5c8c31=qs[_0x3bd4('0x46')](_0x5c8c31,['id',_0x3bd4('0x47'),_0x3bd4('0x48')]);_0x4932db[_0x3bd4('0x49')]=_[_0x3bd4('0x46')](_0x4932db[_0x3bd4('0x49')],['id',_0x3bd4('0x47'),_0x3bd4('0x48')]);return db[_0x3bd4('0x3c')][_0x3bd4('0x4a')](_[_0x3bd4('0x39')](_0x5c8c31,_0x4932db[_0x3bd4('0x49')]),{'include':_0x4932db[_0x3bd4('0x2f')][_0x3bd4('0x3d')]?[{'all':!![]}]:undefined});}})[_0x3bd4('0x25')](respondWithResult(_0x124fd9,0xc9))[_0x3bd4('0x44')](handleError(_0x124fd9,null));};exports[_0x3bd4('0x24')]=function(_0x4e4d57,_0x11bede){if(_0x4e4d57[_0x3bd4('0x49')]['id']){delete _0x4e4d57['body']['id'];}return db[_0x3bd4('0x3c')][_0x3bd4('0x43')]({'where':{'id':_0x4e4d57[_0x3bd4('0x41')]['id']}})[_0x3bd4('0x25')](handleEntityNotFound(_0x11bede,null))[_0x3bd4('0x25')](saveUpdates(_0x4e4d57[_0x3bd4('0x49')],null))[_0x3bd4('0x25')](respondWithResult(_0x11bede,null))[_0x3bd4('0x44')](handleError(_0x11bede,null));};exports[_0x3bd4('0x26')]=function(_0x227c3f,_0x3dbc04){return db[_0x3bd4('0x3c')]['find']({'where':{'id':_0x227c3f[_0x3bd4('0x41')]['id']}})['then'](handleEntityNotFound(_0x3dbc04,null))['then'](removeEntity(_0x3dbc04,null))[_0x3bd4('0x44')](handleError(_0x3dbc04,null));};exports[_0x3bd4('0x4a')]=function(_0x3f7cdf,_0x1f32b8,_0xbf7150){_0x3f7cdf[_0x3bd4('0x49')][_0x3bd4('0x29')]=_0x3f7cdf['file'][_0x3bd4('0x4b')];_0x3f7cdf[_0x3bd4('0x49')][_0x3bd4('0x4c')]=_0x3f7cdf[_0x3bd4('0x4d')][_0x3bd4('0x4e')];_0x3f7cdf[_0x3bd4('0x49')][_0x3bd4('0x2c')]=_0x3f7cdf['file'][_0x3bd4('0x4f')];return db[_0x3bd4('0x3c')]['create'](_0x3f7cdf[_0x3bd4('0x49')])[_0x3bd4('0x25')](respondWithResult(_0x1f32b8,0xc9))['catch'](handleError(_0x1f32b8,null));};exports[_0x3bd4('0x50')]=function(_0x4f7530,_0x37dc30,_0x21b666){return db[_0x3bd4('0x3c')][_0x3bd4('0x51')]({'where':{'id':_0x4f7530[_0x3bd4('0x41')]['id']},'raw':!![]})[_0x3bd4('0x25')](handleEntityNotFound(_0x37dc30,null))[_0x3bd4('0x25')](function(_0x3ead43){if(_0x3ead43){var _0x336bc5=_0x3ead43[_0x3bd4('0x52')]!==null;var _0x4e80ed=path[_0x3bd4('0x53')](config[_0x3bd4('0x54')],_0x3bd4('0x55'));if(_0x336bc5){_0x4e80ed=path['join'](_0x4e80ed,_0x3bd4('0x56'));}var _0xcd8d1a=path[_0x3bd4('0x53')](_0x4e80ed,_0x3ead43[_0x3bd4('0x4c')]);return _0x37dc30[_0x3bd4('0x50')](_0xcd8d1a);}})[_0x3bd4('0x44')](handleError(_0x37dc30,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 6c3b5a1..3b6657b 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 _0xd954=['../../config/environment','exports','define','Attachment','attachments','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2a089b,_0x5d0db9){var _0x40cd66=function(_0x24f349){while(--_0x24f349){_0x2a089b['push'](_0x2a089b['shift']());}};_0x40cd66(++_0x5d0db9);}(_0xd954,0xe1));var _0x4d95=function(_0x26d51f,_0x1de895){_0x26d51f=_0x26d51f-0x0;var _0x48305d=_0xd954[_0x26d51f];return _0x48305d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4d95('0x0'))(_0x4d95('0x1'));var moment=require(_0x4d95('0x2'));var BPromise=require(_0x4d95('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d95('0x4'));var rimraf=require(_0x4d95('0x5'));var config=require(_0x4d95('0x6'));var attributes=require('./attachment.attributes');module[_0x4d95('0x7')]=function(_0x5c25ad,_0x542544){return _0x5c25ad[_0x4d95('0x8')](_0x4d95('0x9'),attributes,{'tableName':_0x4d95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec33=['Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0xa48710,_0x4e8107){var _0x271041=function(_0x2bac29){while(--_0x2bac29){_0xa48710['push'](_0xa48710['shift']());}};_0x271041(++_0x4e8107);}(_0xec33,0x152));var _0x3ec3=function(_0x28cc40,_0x54f517){_0x28cc40=_0x28cc40-0x0;var _0x4e10c1=_0xec33[_0x28cc40];return _0x4e10c1;};'use strict';var _=require(_0x3ec3('0x0'));var util=require(_0x3ec3('0x1'));var logger=require(_0x3ec3('0x2'))('api');var moment=require(_0x3ec3('0x3'));var BPromise=require(_0x3ec3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ec3('0x5'));var rimraf=require(_0x3ec3('0x6'));var config=require(_0x3ec3('0x7'));var attributes=require(_0x3ec3('0x8'));module['exports']=function(_0x2ee4be,_0x22f0e5){return _0x2ee4be[_0x3ec3('0x9')](_0x3ec3('0xa'),attributes,{'tableName':_0x3ec3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 05c2ee5..523ed5d 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 _0x03ce=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Attachment','create','body','raw','CreateAttachment','lodash','util','moment'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x03ce,0x1a1));var _0xe03c=function(_0xa4bc34,_0x4b8774){_0xa4bc34=_0xa4bc34-0x0;var _0xea4df9=_0x03ce[_0xa4bc34];return _0xea4df9;};'use strict';var _=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var moment=require(_0xe03c('0x2'));var BPromise=require(_0xe03c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe03c('0x4'));var db=require(_0xe03c('0x5'))['db'];var utils=require(_0xe03c('0x6'));var logger=require('../../config/logger')(_0xe03c('0x7'));var config=require(_0xe03c('0x8'));var jayson=require(_0xe03c('0x9'));var client=jayson[_0xe03c('0xa')][_0xe03c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44c54f,_0x89f039,_0x52dda4){return new BPromise(function(_0x53c2b0,_0x3bca56){return client[_0xe03c('0xc')](_0x44c54f,_0x52dda4)[_0xe03c('0xd')](function(_0x267044){logger[_0xe03c('0xe')](_0xe03c('0xf'),_0x89f039,_0xe03c('0x10'));logger[_0xe03c('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x89f039,_0xe03c('0x10'),JSON[_0xe03c('0x12')](_0x267044));if(_0x267044[_0xe03c('0x13')]){if(_0x267044['error'][_0xe03c('0x14')]===0x1f4){logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x267044[_0xe03c('0x13')][_0xe03c('0x15')]);return _0x3bca56(_0x267044['error'][_0xe03c('0x15')]);}logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x267044['error'][_0xe03c('0x15')]);return _0x53c2b0(_0x267044[_0xe03c('0x13')][_0xe03c('0x15')]);}else{logger[_0xe03c('0xe')](_0xe03c('0xf'),_0x89f039,'request\x20sent');_0x53c2b0(_0x267044[_0xe03c('0x16')][_0xe03c('0x15')]);}})['catch'](function(_0x7160ac){logger[_0xe03c('0x13')](_0xe03c('0xf'),_0x89f039,_0x7160ac);_0x3bca56(_0x7160ac);});});}exports['CreateAttachment']=function(_0x56ec58){var _0x23080a=this;return new Promise(function(_0x386cb7,_0x47da2a){return db[_0xe03c('0x17')][_0xe03c('0x18')](_0x56ec58[_0xe03c('0x19')],{'raw':_0x56ec58['options']?_0x56ec58['options'][_0xe03c('0x1a')]===undefined?!![]:![]:!![]})[_0xe03c('0xd')](function(_0x3bf505){logger[_0xe03c('0xe')](_0xe03c('0x1b'),_0x56ec58);logger[_0xe03c('0x11')](_0xe03c('0x1b'),_0x56ec58,JSON[_0xe03c('0x12')](_0x3bf505));_0x386cb7(_0x3bf505);})['catch'](function(_0x1cbf9f){logger['error'](_0xe03c('0x1b'),_0x1cbf9f[_0xe03c('0x15')],_0x56ec58);_0x47da2a(_0x23080a[_0xe03c('0x13')](0x1f4,_0x1cbf9f[_0xe03c('0x15')]));});});};
\ No newline at end of file
+var _0x7af2=['message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error'];(function(_0x15c885,_0x1b4937){var _0x35949d=function(_0x13094f){while(--_0x13094f){_0x15c885['push'](_0x15c885['shift']());}};_0x35949d(++_0x1b4937);}(_0x7af2,0x119));var _0x27af=function(_0x3b1869,_0x2fa04b){_0x3b1869=_0x3b1869-0x0;var _0x433b45=_0x7af2[_0x3b1869];return _0x433b45;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var moment=require(_0x27af('0x1'));var BPromise=require(_0x27af('0x2'));var rs=require(_0x27af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27af('0x4'))['db'];var utils=require(_0x27af('0x5'));var logger=require(_0x27af('0x6'))(_0x27af('0x7'));var config=require(_0x27af('0x8'));var jayson=require(_0x27af('0x9'));var client=jayson[_0x27af('0xa')][_0x27af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2193c6,_0x572219,_0x1e2509){return new BPromise(function(_0x366868,_0x389e97){return client['request'](_0x2193c6,_0x1e2509)[_0x27af('0xc')](function(_0xfa1882){logger[_0x27af('0xd')]('Attachment,\x20%s,\x20%s',_0x572219,_0x27af('0xe'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x572219,_0x27af('0xe'),JSON['stringify'](_0xfa1882));if(_0xfa1882['error']){if(_0xfa1882[_0x27af('0xf')]['code']===0x1f4){logger[_0x27af('0xf')]('Attachment,\x20%s,\x20%s',_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x389e97(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}logger[_0x27af('0xf')](_0x27af('0x11'),_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x366868(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}else{logger[_0x27af('0xd')](_0x27af('0x11'),_0x572219,_0x27af('0xe'));_0x366868(_0xfa1882[_0x27af('0x12')][_0x27af('0x10')]);}})[_0x27af('0x13')](function(_0x13f8ed){logger[_0x27af('0xf')]('Attachment,\x20%s,\x20%s',_0x572219,_0x13f8ed);_0x389e97(_0x13f8ed);});});}exports[_0x27af('0x14')]=function(_0x31d702){var _0x5997ae=this;return new Promise(function(_0x4e6e2f,_0x20a6d7){return db[_0x27af('0x15')][_0x27af('0x16')](_0x31d702[_0x27af('0x17')],{'raw':_0x31d702[_0x27af('0x18')]?_0x31d702['options'][_0x27af('0x19')]===undefined?!![]:![]:!![]})[_0x27af('0xc')](function(_0xcb4b90){logger['info'](_0x27af('0x14'),_0x31d702);logger[_0x27af('0x1a')](_0x27af('0x14'),_0x31d702,JSON['stringify'](_0xcb4b90));_0x4e6e2f(_0xcb4b90);})[_0x27af('0x13')](function(_0x2460f4){logger[_0x27af('0xf')](_0x27af('0x14'),_0x2460f4[_0x27af('0x10')],_0x31d702);_0x20a6d7(_0x5997ae[_0x27af('0xf')](0x1f4,_0x2460f4[_0x27af('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 57dbc0a..b445486 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x3829de,_0x20365e){_0x3829de=_0x3829de-0x0;var _0x8cd041=_0xdb28[_0x3829de];return _0x8cd041;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index fcdf5a6..49383a6 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 _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
+var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 6179c43..5fdb1ce 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 _0x2277=['express','post','login','exports'];(function(_0x269c42,_0xeed101){var _0x4dad76=function(_0x167b87){while(--_0x167b87){_0x269c42['push'](_0x269c42['shift']());}};_0x4dad76(++_0xeed101);}(_0x2277,0x170));var _0x7227=function(_0x378825,_0x53fa0e){_0x378825=_0x378825-0x0;var _0x1f92dc=_0x2277[_0x378825];return _0x1f92dc;};'use strict';var express=require(_0x7227('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x7227('0x1')]('/',controller[_0x7227('0x2')]);module[_0x7227('0x3')]=router;
\ No newline at end of file
+var _0x1cd9=['Router','express'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x1cd9,0x1ed));var _0x91cd=function(_0x2d96a7,_0xe0f108){_0x2d96a7=_0x2d96a7-0x0;var _0x398def=_0x1cd9[_0x2d96a7];return _0x398def;};'use strict';var express=require(_0x91cd('0x0'));var router=express[_0x91cd('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index e9117d7..118288a 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x662597,_0x29b293){var _0x25d4f9=function(_0x47aa6b){while(--_0x47aa6b){_0x662597['push'](_0x662597['shift']());}};_0x25d4f9(++_0x29b293);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x7a54,0x106));var _0x47a5=function(_0x3b86ce,_0x188400){_0x3b86ce=_0x3b86ce-0x0;var _0xf54668=_0x7a54[_0x3b86ce];return _0xf54668;};'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 f9579a0..fd011be 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 _0xf97d=['exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware'];(function(_0xd55562,_0x4aa596){var _0x4129f1=function(_0x3d565d){while(--_0x3d565d){_0xd55562['push'](_0xd55562['shift']());}};_0x4129f1(++_0x4aa596);}(_0xf97d,0x199));var _0xdf97=function(_0x3fa435,_0x152d94){_0x3fa435=_0x3fa435-0x0;var _0x5dc72e=_0xf97d[_0x3fa435];return _0x5dc72e;};'use strict';var express=require(_0xdf97('0x0'));var passport=require(_0xdf97('0x1'));var router=express[_0xdf97('0x2')]();var controller=require(_0xdf97('0x3'));var userController=require(_0xdf97('0x4'));var authService=require(_0xdf97('0x5'));router[_0xdf97('0x6')]('/',controller[_0xdf97('0x7')]);router['get'](_0xdf97('0x8'),controller[_0xdf97('0x9')],authService[_0xdf97('0xa')],userController[_0xdf97('0x7')],authService['setTokenCookie']);module[_0xdf97('0xb')]=router;
\ No newline at end of file
+var _0xe890=['get','callback','login','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x2899dd,_0x482585){var _0x1feee0=function(_0x2f15f9){while(--_0x2f15f9){_0x2899dd['push'](_0x2899dd['shift']());}};_0x1feee0(++_0x482585);}(_0xe890,0x19a));var _0x0e89=function(_0x3a6eb2,_0x20da4b){_0x3a6eb2=_0x3a6eb2-0x0;var _0x1a6b2b=_0xe890[_0x3a6eb2];return _0x1a6b2b;};'use strict';var express=require(_0x0e89('0x0'));var passport=require(_0x0e89('0x1'));var router=express['Router']();var controller=require(_0x0e89('0x2'));var userController=require(_0x0e89('0x3'));var authService=require('../../components/auth/service');router[_0x0e89('0x4')]('/',controller['login']);router[_0x0e89('0x4')]('/callback',controller[_0x0e89('0x5')],authService['isMiddleware'],userController[_0x0e89('0x6')],authService[_0x0e89('0x7')]);module[_0x0e89('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index c682434..8db0184 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 _0x2257=['minutes','clearBlockUser','add','getLicense','catch','MailAccount','name','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','merge','format','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','findOne','find','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','client','Setting','allowedLoginAttempts','blockDuration','then','password','salt','disabled','blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x44d741,_0x58f36c){var _0x491fb8=function(_0xb5576c){while(--_0xb5576c){_0x44d741['push'](_0x44d741['shift']());}};_0x491fb8(++_0x58f36c);}(_0x2257,0x1d1));var _0x7225=function(_0x3b4d49,_0x578d2f){_0x3b4d49=_0x3b4d49-0x0;var _0x42b92b=_0x2257[_0x3b4d49];return _0x42b92b;};'use strict';var util=require('util');var passport=require(_0x7225('0x0'));var LocalStrategy=require(_0x7225('0x1'))[_0x7225('0x2')];var jayson=require(_0x7225('0x3'));var _=require(_0x7225('0x4'));var rs=require(_0x7225('0x5'));var moment=require('moment');var db=require(_0x7225('0x6'))['db'];var authService=require(_0x7225('0x7'));var utils=require('../../config/utils');var client=jayson[_0x7225('0x8')]['http']({'port':0x232b});function localAuthenticate(_0xcc118f,_0x30329e,_0x3afc4b,_0x2f863d){var _0x21bb69,_0x278311;return db[_0x7225('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x7225('0xa'),_0x7225('0xb')],'raw':!![]})[_0x7225('0xc')](function(_0x41be3e){_0x21bb69=_0x41be3e;return _0xcc118f['findOne']({'attributes':['id','name',_0x7225('0xd'),_0x7225('0xe'),'role',_0x7225('0xf'),_0x7225('0x10'),_0x7225('0x11'),'loginAttempts'],'where':{'name':_0x30329e,'role':{'$or':[_0x7225('0x12'),_0x7225('0x13'),'agent']}}});})['then'](function(_0x26f3c8){if(!_0x26f3c8||_0x26f3c8&&_0x26f3c8['name']!==_0x30329e){throw new Error(_0x7225('0x14'));}else{_0x278311=_0x26f3c8;return _0x278311;}})['then'](function(){_0x278311['authenticate'](_0x3afc4b,function(_0x5a4452,_0x41c1dd){var _0x53c4d4=_0x278311['loginAttempts']+0x1;if(_0x5a4452){return _0x2f863d(_0x5a4452);}else if(!_0x41c1dd){if(_0x278311[_0x7225('0xf')]){return _0x2f863d(null,![],{'message':_0x7225('0x14')});}else if(_0x21bb69[_0x7225('0xa')]>0x0){if(_0x278311['blocked']){if(_0x21bb69['blockDuration']>0x0){if(moment(_0x278311[_0x7225('0x11')])['add'](_0x21bb69['blockDuration'],_0x7225('0x15'))>moment()){return _0x2f863d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7225('0x16')](_0x278311,_0x53c4d4,![],null)['then'](function(){return _0x2f863d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2f863d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x53c4d4>=_0x21bb69['allowedLoginAttempts']){return utils['clearBlockUser'](_0x278311,0x0,!![],moment())[_0x7225('0xc')](function(){return _0x2f863d(null,![],{'message':_0x7225('0x14')});});}else{return utils[_0x7225('0x16')](_0x278311,_0x53c4d4,![],null)[_0x7225('0xc')](function(){return _0x2f863d(null,![],{'message':_0x7225('0x14')});});}}}else{return _0x2f863d(null,![],{'message':_0x7225('0x14')});}}else{if(_0x278311[_0x7225('0xf')]){return _0x2f863d(null,![],{'message':_0x7225('0x14')});}else if(_0x21bb69['allowedLoginAttempts']>0x0){if(_0x278311[_0x7225('0x10')]){if(_0x21bb69[_0x7225('0xb')]>0x0){if(moment(_0x278311[_0x7225('0x11')])[_0x7225('0x17')](_0x21bb69[_0x7225('0xb')],_0x7225('0x15'))>moment()){return _0x2f863d(null,![],{'message':_0x7225('0x14')});}else{return utils[_0x7225('0x16')](_0x278311,0x0,![],null)[_0x7225('0xc')](function(){return utils[_0x7225('0x18')](_0x278311);})[_0x7225('0xc')](function(){return _0x2f863d(null,_0x278311);});}}else{return _0x2f863d(null,![],{'message':_0x7225('0x14')});}}else{return utils[_0x7225('0x16')](_0x278311,0x0,![],null)['then'](function(){return utils[_0x7225('0x18')](_0x278311);})[_0x7225('0xc')](function(){return _0x2f863d(null,_0x278311);})[_0x7225('0x19')](function(_0x537431){return _0x2f863d(null,![],_0x537431);});}}else{if(_0x278311[_0x7225('0x10')]){return _0x2f863d(null,![],{'message':_0x7225('0x14')});}else{return utils[_0x7225('0x18')](_0x278311)[_0x7225('0xc')](function(){return _0x2f863d(null,_0x278311);});}}}});})[_0x7225('0x19')](function(_0x106272){return _0x2f863d(null,![],_0x106272);});}function sendServiceMail(_0xd42814){return db[_0x7225('0x1a')]['find']({'where':{'service':!![]},'attributes':['id',_0x7225('0x1b'),_0x7225('0x1c')],'include':[{'model':db['MailServerOut'],'as':_0x7225('0x1d')}]})[_0x7225('0xc')](function(_0x6efece){if(!_0x6efece){throw new Error(_0x7225('0x1e'));}var _0x56a988={'tls':{'rejectUnauthorized':![]}};if(_0x6efece[_0x7225('0x1d')][_0x7225('0x1f')]){_0x56a988['service']=_0x6efece['Smtp']['service'];}else{_0x56a988[_0x7225('0x20')]=_0x6efece['Smtp']['host'];_0x56a988[_0x7225('0x21')]=_0x6efece[_0x7225('0x1d')][_0x7225('0x21')];_0x56a988[_0x7225('0x22')]=_0x6efece[_0x7225('0x1d')][_0x7225('0x22')];}if(_0x6efece['Smtp']['authentication']){_0x56a988[_0x7225('0x23')]={'user':_0x6efece[_0x7225('0x1d')]['user'],'pass':_0x6efece[_0x7225('0x1d')]['pass']};}var _0x58ebe5={'account':_0x56a988,'message':_[_0x7225('0x24')]({'from':util[_0x7225('0x25')]('\x22%s\x22\x20<%s>',_0x6efece['name'],_0x6efece[_0x7225('0x1c')]||_0x6efece['Smtp']['user'])},_0xd42814)};return client[_0x7225('0x26')]('SendMail',_0x58ebe5);})[_0x7225('0xc')](function(_0x297f67){if(_0x297f67['error']){throw new Error(util[_0x7225('0x25')](_0x7225('0x27'),_0x297f67[_0x7225('0x28')][_0x7225('0x29')]||JSON[_0x7225('0x2a')](_0x297f67[_0x7225('0x28')])));}return!![];});}function handleError(_0xf988e3,_0x39056b,_0x27de89){return _0xf988e3[_0x7225('0x2b')](_0x39056b||0x1f4)[_0x7225('0x2c')]({'message':_0x27de89?_0x27de89[_0x7225('0x29')]||_0x27de89:''});}exports['login']=function(_0x67062e,_0x14419f,_0x35c8dc){passport['authenticate'](_0x7225('0x2d'),function(_0x438338,_0x21a32d,_0x2ada6a){var _0x5e43b4=_0x438338||_0x2ada6a;if(_0x5e43b4){return handleError(_0x14419f,0x191,_0x5e43b4);}if(!_0x21a32d){return handleError(_0x14419f,0x194,{'message':_0x7225('0x2e')});}else{var _0x50316b={'payload':{'id':_0x21a32d['id'],'role':_0x21a32d[_0x7225('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x7225('0x30')](_0x50316b)[_0x7225('0xc')](function(_0x2069b7){_0x14419f[_0x7225('0x31')]({'id':_0x21a32d['id'],'token':_0x2069b7,'statusCall':'','isAlreadyLogged':_0x21a32d['online']});});}})(_0x67062e,_0x14419f,_0x35c8dc);};exports[_0x7225('0x32')]=function(_0x1bf174,_0x3d67b7,_0xa71896){if(!_0x1bf174['body'][_0x7225('0x1c')]){return handleError(_0x3d67b7,0x1f4,{'message':_0x7225('0x33')});}var _0x2816bb=rs[_0x7225('0x34')]();_0x1bf174[_0x7225('0x35')][_0x7225('0x1c')]=_0x1bf174[_0x7225('0x35')][_0x7225('0x1c')][_0x7225('0x36')]()[_0x7225('0x37')]();var _0x18d9b6;return db[_0x7225('0x9')][_0x7225('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7225('0xb')],'raw':!![]})[_0x7225('0xc')](function(_0xc07d4d){_0x18d9b6=_0xc07d4d;return db['User'][_0x7225('0x39')]({'where':{'email':_0x1bf174['body']['email']}});})[_0x7225('0xc')](function(_0x1ca7f9){if(!_0x1ca7f9){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1ca7f9[_0x7225('0xf')]){throw new Error(_0x7225('0x3a'));}if(_0x1ca7f9[_0x7225('0x10')]){if(moment(_0x1ca7f9[_0x7225('0x11')])[_0x7225('0x17')](_0x18d9b6[_0x7225('0xb')],_0x7225('0x15'))>moment()){throw new Error(_0x7225('0x3b'));}else{_0x1ca7f9[_0x7225('0x10')]=![];_0x1ca7f9[_0x7225('0x11')]=null;}}_0x1ca7f9[_0x7225('0x3c')]=_0x2816bb;_0x1ca7f9[_0x7225('0x3d')]=Date['now']()+0x36ee80;return _0x1ca7f9[_0x7225('0x3e')]();})[_0x7225('0xc')](function(){return sendServiceMail({'to':_0x1bf174[_0x7225('0x35')][_0x7225('0x1c')],'subject':_0x7225('0x3f'),'text':_0x7225('0x40')+_0x7225('0x41')+_0x7225('0x42')+_0x1bf174['headers'][_0x7225('0x20')]+_0x7225('0x43')+_0x2816bb+'\x0a\x0a'+_0x7225('0x44')});})[_0x7225('0xc')](function(){_0x3d67b7['status'](0xc8)[_0x7225('0x2c')]({'message':_0x7225('0x45')});})[_0x7225('0x19')](function(_0x44d2de){return handleError(_0x3d67b7,0x1f4,_0x44d2de);});};exports[_0x7225('0x46')]=function(_0x43e55c,_0x5f8557,_0x58d312){return db[_0x7225('0x47')][_0x7225('0x39')]({'where':{'resetPasswordToken':_0x43e55c[_0x7225('0x48')][_0x7225('0x49')],'resetPasswordExpires':{'$gt':Date[_0x7225('0x4a')]()}}})[_0x7225('0xc')](function(_0x56ecf6){if(!_0x56ecf6){throw new Error(_0x7225('0x4b'));}return db['Setting'][_0x7225('0x38')]({'attributes':['id',_0x7225('0x4c'),_0x7225('0x4d'),_0x7225('0x4e')]})[_0x7225('0xc')](function(_0x3354a7){if(_0x3354a7[_0x7225('0x4c')])authService['validatePasswordPattern'](_0x43e55c[_0x7225('0x35')][_0x7225('0xd')]);if(!_0x3354a7['enforcePasswordHistory']||!_0x56ecf6['previousPasswords'])return _0x56ecf6;authService[_0x7225('0x4f')](_0x43e55c[_0x7225('0x35')][_0x7225('0xd')],_0x56ecf6[_0x7225('0x50')],_0x3354a7[_0x7225('0x4e')]);return _0x56ecf6;})[_0x7225('0xc')](function(){_0x56ecf6['password']=_0x43e55c['body'][_0x7225('0xd')];_0x56ecf6[_0x7225('0x3c')]=null;_0x56ecf6['resetPasswordExpires']=null;return _0x56ecf6[_0x7225('0x3e')]();});})[_0x7225('0xc')](function(){_0x5f8557[_0x7225('0x2b')](0xc8)[_0x7225('0x2c')]({'message':'Password\x20reset!'});})[_0x7225('0x19')](function(_0x51e785){return handleError(_0x5f8557,0x1f4,_0x51e785);});};passport['use'](_0x7225('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0x7225('0xd')},function(_0x26594a,_0x3efdef,_0x10579c){return localAuthenticate(db[_0x7225('0x47')],_0x26594a,_0x3efdef,_0x10579c);}));
\ No newline at end of file
+var _0xfb59=['format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','Setting','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','save','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','name','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb59,0x7e));var _0x9fb5=function(_0x187f5a,_0x29ccda){_0x187f5a=_0x187f5a-0x0;var _0x547ed8=_0xfb59[_0x187f5a];return _0x547ed8;};'use strict';var util=require(_0x9fb5('0x0'));var passport=require(_0x9fb5('0x1'));var LocalStrategy=require('passport-local')[_0x9fb5('0x2')];var jayson=require(_0x9fb5('0x3'));var _=require(_0x9fb5('0x4'));var rs=require(_0x9fb5('0x5'));var moment=require('moment');var db=require(_0x9fb5('0x6'))['db'];var authService=require(_0x9fb5('0x7'));var utils=require(_0x9fb5('0x8'));var client=jayson[_0x9fb5('0x9')]['http']({'port':0x232b});function localAuthenticate(_0xff89ab,_0x3bfded,_0x418bf6,_0x47856d){var _0x470a76,_0x4221e4;return db['Setting'][_0x9fb5('0xa')]({'where':{'id':0x1},'attributes':[_0x9fb5('0xb'),_0x9fb5('0xc')],'raw':!![]})['then'](function(_0xfd8616){_0x470a76=_0xfd8616;return _0xff89ab[_0x9fb5('0xa')]({'attributes':['id','name','password',_0x9fb5('0xd'),'role',_0x9fb5('0xe'),_0x9fb5('0xf'),_0x9fb5('0x10'),_0x9fb5('0x11')],'where':{'name':_0x3bfded,'role':{'$or':[_0x9fb5('0x12'),_0x9fb5('0x13'),'agent']}}});})[_0x9fb5('0x14')](function(_0xd55089){if(!_0xd55089||_0xd55089&&_0xd55089['name']!==_0x3bfded){throw new Error(_0x9fb5('0x15'));}else{_0x4221e4=_0xd55089;return _0x4221e4;}})[_0x9fb5('0x14')](function(){_0x4221e4[_0x9fb5('0x16')](_0x418bf6,function(_0x55a2b1,_0x4e45d8){var _0x293ba4=_0x4221e4[_0x9fb5('0x11')]+0x1;if(_0x55a2b1){return _0x47856d(_0x55a2b1);}else if(!_0x4e45d8){if(_0x4221e4[_0x9fb5('0xe')]){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}else if(_0x470a76[_0x9fb5('0xb')]>0x0){if(_0x4221e4[_0x9fb5('0xf')]){if(_0x470a76[_0x9fb5('0xc')]>0x0){if(moment(_0x4221e4['blockedAt'])[_0x9fb5('0x17')](_0x470a76[_0x9fb5('0xc')],_0x9fb5('0x18'))>moment()){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}else{return utils[_0x9fb5('0x19')](_0x4221e4,_0x293ba4,![],null)[_0x9fb5('0x14')](function(){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});});}}else{return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}}else{if(_0x293ba4>=_0x470a76[_0x9fb5('0xb')]){return utils[_0x9fb5('0x19')](_0x4221e4,0x0,!![],moment())[_0x9fb5('0x14')](function(){return _0x47856d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9fb5('0x19')](_0x4221e4,_0x293ba4,![],null)[_0x9fb5('0x14')](function(){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});});}}}else{return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}}else{if(_0x4221e4[_0x9fb5('0xe')]){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}else if(_0x470a76[_0x9fb5('0xb')]>0x0){if(_0x4221e4[_0x9fb5('0xf')]){if(_0x470a76[_0x9fb5('0xc')]>0x0){if(moment(_0x4221e4[_0x9fb5('0x10')])[_0x9fb5('0x17')](_0x470a76['blockDuration'],_0x9fb5('0x18'))>moment()){return _0x47856d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9fb5('0x19')](_0x4221e4,0x0,![],null)[_0x9fb5('0x14')](function(){return utils['getLicense'](_0x4221e4);})[_0x9fb5('0x14')](function(){return _0x47856d(null,_0x4221e4);});}}else{return _0x47856d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x9fb5('0x19')](_0x4221e4,0x0,![],null)['then'](function(){return utils[_0x9fb5('0x1a')](_0x4221e4);})['then'](function(){return _0x47856d(null,_0x4221e4);})[_0x9fb5('0x1b')](function(_0x24d61e){return _0x47856d(null,![],_0x24d61e);});}}else{if(_0x4221e4[_0x9fb5('0xf')]){return _0x47856d(null,![],{'message':_0x9fb5('0x15')});}else{return utils[_0x9fb5('0x1a')](_0x4221e4)[_0x9fb5('0x14')](function(){return _0x47856d(null,_0x4221e4);});}}}});})[_0x9fb5('0x1b')](function(_0x3dee2f){return _0x47856d(null,![],_0x3dee2f);});}function sendServiceMail(_0x2be671){return db['MailAccount'][_0x9fb5('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x9fb5('0x1d'),_0x9fb5('0x1e')],'include':[{'model':db[_0x9fb5('0x1f')],'as':_0x9fb5('0x20')}]})[_0x9fb5('0x14')](function(_0x22dd14){if(!_0x22dd14){throw new Error(_0x9fb5('0x21'));}var _0x397e20={'tls':{'rejectUnauthorized':![]}};if(_0x22dd14[_0x9fb5('0x20')]['service']){_0x397e20[_0x9fb5('0x22')]=_0x22dd14['Smtp']['service'];}else{_0x397e20[_0x9fb5('0x23')]=_0x22dd14[_0x9fb5('0x20')]['host'];_0x397e20['port']=_0x22dd14[_0x9fb5('0x20')][_0x9fb5('0x24')];_0x397e20[_0x9fb5('0x25')]=_0x22dd14[_0x9fb5('0x20')][_0x9fb5('0x25')];}if(_0x22dd14[_0x9fb5('0x20')][_0x9fb5('0x26')]){_0x397e20[_0x9fb5('0x27')]={'user':_0x22dd14['Smtp']['user'],'pass':_0x22dd14['Smtp']['pass']};}var _0x3e5079={'account':_0x397e20,'message':_['merge']({'from':util[_0x9fb5('0x28')]('\x22%s\x22\x20<%s>',_0x22dd14[_0x9fb5('0x1d')],_0x22dd14[_0x9fb5('0x1e')]||_0x22dd14[_0x9fb5('0x20')][_0x9fb5('0x13')])},_0x2be671)};return client[_0x9fb5('0x29')](_0x9fb5('0x2a'),_0x3e5079);})[_0x9fb5('0x14')](function(_0x167179){if(_0x167179[_0x9fb5('0x2b')]){throw new Error(util[_0x9fb5('0x28')](_0x9fb5('0x2c'),_0x167179[_0x9fb5('0x2b')][_0x9fb5('0x2d')]||JSON[_0x9fb5('0x2e')](_0x167179[_0x9fb5('0x2b')])));}return!![];});}function handleError(_0x3a9245,_0x1bffa9,_0x2c1310){return _0x3a9245[_0x9fb5('0x2f')](_0x1bffa9||0x1f4)[_0x9fb5('0x30')]({'message':_0x2c1310?_0x2c1310[_0x9fb5('0x2d')]||_0x2c1310:''});}exports[_0x9fb5('0x31')]=function(_0x376a21,_0x554970,_0x38e944){passport['authenticate'](_0x9fb5('0x32'),function(_0x35bd80,_0x4cd713,_0x1fb663){var _0x5d5de3=_0x35bd80||_0x1fb663;if(_0x5d5de3){return handleError(_0x554970,0x191,_0x5d5de3);}if(!_0x4cd713){return handleError(_0x554970,0x194,{'message':_0x9fb5('0x33')});}else{var _0x1bd9a2={'payload':{'id':_0x4cd713['id'],'role':_0x4cd713[_0x9fb5('0x34')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1bd9a2)[_0x9fb5('0x14')](function(_0x39d3b6){_0x554970[_0x9fb5('0x35')]({'id':_0x4cd713['id'],'token':_0x39d3b6,'statusCall':'','isAlreadyLogged':_0x4cd713[_0x9fb5('0x36')]});});}})(_0x376a21,_0x554970,_0x38e944);};exports[_0x9fb5('0x37')]=function(_0x5903f6,_0x2fca9b,_0x3d5351){if(!_0x5903f6['body'][_0x9fb5('0x1e')]){return handleError(_0x2fca9b,0x1f4,{'message':_0x9fb5('0x38')});}var _0x55dee2=rs['generate']();_0x5903f6[_0x9fb5('0x39')][_0x9fb5('0x1e')]=_0x5903f6[_0x9fb5('0x39')]['email'][_0x9fb5('0x3a')]()[_0x9fb5('0x3b')]();var _0x48843a;return db['Setting'][_0x9fb5('0xa')]({'where':{'id':0x1},'attributes':[_0x9fb5('0xb'),_0x9fb5('0xc')],'raw':!![]})[_0x9fb5('0x14')](function(_0x4d5d7d){_0x48843a=_0x4d5d7d;return db['User'][_0x9fb5('0x1c')]({'where':{'email':_0x5903f6[_0x9fb5('0x39')]['email']}});})['then'](function(_0xddb67d){if(!_0xddb67d){throw new Error(_0x9fb5('0x3c'));}if(_0xddb67d[_0x9fb5('0xe')]){throw new Error(_0x9fb5('0x3d'));}if(_0xddb67d['blocked']){if(moment(_0xddb67d[_0x9fb5('0x10')])[_0x9fb5('0x17')](_0x48843a[_0x9fb5('0xc')],_0x9fb5('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xddb67d['blocked']=![];_0xddb67d[_0x9fb5('0x10')]=null;}}_0xddb67d[_0x9fb5('0x3e')]=_0x55dee2;_0xddb67d[_0x9fb5('0x3f')]=Date[_0x9fb5('0x40')]()+0x36ee80;return _0xddb67d['save']();})[_0x9fb5('0x14')](function(){return sendServiceMail({'to':_0x5903f6['body'][_0x9fb5('0x1e')],'subject':_0x9fb5('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x9fb5('0x42')+_0x9fb5('0x43')+_0x5903f6[_0x9fb5('0x44')][_0x9fb5('0x23')]+'/reset/'+_0x55dee2+'\x0a\x0a'+_0x9fb5('0x45')});})['then'](function(){_0x2fca9b['status'](0xc8)[_0x9fb5('0x30')]({'message':_0x9fb5('0x46')});})[_0x9fb5('0x1b')](function(_0x2cfcca){return handleError(_0x2fca9b,0x1f4,_0x2cfcca);});};exports[_0x9fb5('0x47')]=function(_0x15cd6a,_0x2fae92,_0x4811d4){return db[_0x9fb5('0x48')][_0x9fb5('0x1c')]({'where':{'resetPasswordToken':_0x15cd6a[_0x9fb5('0x49')][_0x9fb5('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x9fb5('0x40')]()}}})[_0x9fb5('0x14')](function(_0x1170c2){if(!_0x1170c2){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x9fb5('0x4b')][_0x9fb5('0xa')]({'attributes':['id','securePassword',_0x9fb5('0x4c'),_0x9fb5('0x4d')]})['then'](function(_0x46cb00){if(_0x46cb00['securePassword'])authService['validatePasswordPattern'](_0x15cd6a[_0x9fb5('0x39')]['password']);if(!_0x46cb00[_0x9fb5('0x4c')]||!_0x1170c2['previousPasswords'])return _0x1170c2;authService['validatePasswordHistory'](_0x15cd6a[_0x9fb5('0x39')][_0x9fb5('0x4e')],_0x1170c2[_0x9fb5('0x4f')],_0x46cb00['passwordHistoryLimit']);return _0x1170c2;})[_0x9fb5('0x14')](function(){_0x1170c2['password']=_0x15cd6a[_0x9fb5('0x39')]['password'];_0x1170c2[_0x9fb5('0x3e')]=null;_0x1170c2[_0x9fb5('0x3f')]=null;return _0x1170c2[_0x9fb5('0x50')]();});})[_0x9fb5('0x14')](function(){_0x2fae92['status'](0xc8)[_0x9fb5('0x30')]({'message':_0x9fb5('0x51')});})[_0x9fb5('0x1b')](function(_0x14d53b){return handleError(_0x2fae92,0x1f4,_0x14d53b);});};passport[_0x9fb5('0x52')](_0x9fb5('0x32'),new LocalStrategy({'usernameField':'name','passwordField':_0x9fb5('0x4e')},function(_0x20aed9,_0x23be3b,_0x72c015){return localAuthenticate(db[_0x9fb5('0x48')],_0x20aed9,_0x23be3b,_0x72c015);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 0bf4378..4c71684 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 _0x1a9a=['post','/reset/:token','reset','exports','express','Router','/forgot','forgot'];(function(_0x5a9397,_0x2e444c){var _0x5b89be=function(_0x17d763){while(--_0x17d763){_0x5a9397['push'](_0x5a9397['shift']());}};_0x5b89be(++_0x2e444c);}(_0x1a9a,0xec));var _0xa1a9=function(_0x14a188,_0x12c89b){_0x14a188=_0x14a188-0x0;var _0x4222b2=_0x1a9a[_0x14a188];return _0x4222b2;};'use strict';var express=require(_0xa1a9('0x0'));var router=express[_0xa1a9('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router['post'](_0xa1a9('0x2'),controller[_0xa1a9('0x3')]);router[_0xa1a9('0x4')](_0xa1a9('0x5'),controller[_0xa1a9('0x6')]);module[_0xa1a9('0x7')]=router;
\ No newline at end of file
+var _0xe368=['forgot','reset','Router','post','login','/forgot'];(function(_0x5c4de0,_0x435e61){var _0x565255=function(_0x41bf22){while(--_0x41bf22){_0x5c4de0['push'](_0x5c4de0['shift']());}};_0x565255(++_0x435e61);}(_0xe368,0x14c));var _0x8e36=function(_0x1b6cfb,_0x13520c){_0x1b6cfb=_0x1b6cfb-0x0;var _0x280347=_0xe368[_0x1b6cfb];return _0x280347;};'use strict';var express=require('express');var router=express[_0x8e36('0x0')]();var controller=require('./authLocal.controller');router[_0x8e36('0x1')]('/',controller[_0x8e36('0x2')]);router[_0x8e36('0x1')](_0x8e36('0x3'),controller[_0x8e36('0x4')]);router['post']('/reset/:token',controller[_0x8e36('0x5')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 24e92af..64afcaa 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 _0xfac7=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x19d998,_0x3697e3){var _0x30aa6f=function(_0x1b7a72){while(--_0x1b7a72){_0x19d998['push'](_0x19d998['shift']());}};_0x30aa6f(++_0x3697e3);}(_0xfac7,0x189));var _0x7fac=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0xfac7[_0x387dc1];return _0x17567c;};'use strict';var Sequelize=require(_0x7fac('0x0'));module[_0x7fac('0x1')]={'name':{'type':Sequelize[_0x7fac('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7fac('0x2')]},'description':{'type':Sequelize[_0x7fac('0x2')]},'status':{'type':Sequelize[_0x7fac('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7fac('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5f64=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x5f64,0x175));var _0x45f6=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0x5f64[_0xb5fc3e];return _0x2efc3c;};'use strict';var Sequelize=require(_0x45f6('0x0'));module[_0x45f6('0x1')]={'name':{'type':Sequelize[_0x45f6('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x45f6('0x2')]},'description':{'type':Sequelize[_0x45f6('0x2')]},'status':{'type':Sequelize[_0x45f6('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x45f6('0x4')],'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 bcf7cb8..93e8733 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 _0xdb01=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','rows','catch','show','rawAttributes','include','create','body','find','params','addConditions','Condition','omit','ids','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','filters'];(function(_0x325b77,_0x161ccd){var _0x13282c=function(_0x235631){while(--_0x235631){_0x325b77['push'](_0x325b77['shift']());}};_0x13282c(++_0x161ccd);}(_0xdb01,0x120));var _0x1db0=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0xdb01[_0x498334];return _0x13bb70;};'use strict';var emlformat=require(_0x1db0('0x0'));var rimraf=require(_0x1db0('0x1'));var zipdir=require(_0x1db0('0x2'));var jsonpatch=require(_0x1db0('0x3'));var rp=require(_0x1db0('0x4'));var moment=require(_0x1db0('0x5'));var BPromise=require(_0x1db0('0x6'));var Mustache=require('mustache');var util=require(_0x1db0('0x7'));var path=require(_0x1db0('0x8'));var sox=require(_0x1db0('0x9'));var csv=require('to-csv');var ejs=require(_0x1db0('0xa'));var fs=require('fs');var fs_extra=require(_0x1db0('0xb'));var _=require(_0x1db0('0xc'));var squel=require(_0x1db0('0xd'));var crypto=require(_0x1db0('0xe'));var jsforce=require(_0x1db0('0xf'));var deskjs=require(_0x1db0('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1db0('0x11'));var Papa=require(_0x1db0('0x12'));var Redis=require(_0x1db0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1db0('0x14'));var as=require(_0x1db0('0x15'));var hardwareService=require(_0x1db0('0x16'));var logger=require('../../config/logger')(_0x1db0('0x17'));var utils=require(_0x1db0('0x18'));var config=require(_0x1db0('0x19'));var licenseUtil=require(_0x1db0('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa52f4d,_0x2b71e6){_0x2b71e6=_0x2b71e6||0xcc;return function(_0x397d40){if(_0x397d40){return _0xa52f4d['sendStatus'](_0x2b71e6);}return _0xa52f4d[_0x1db0('0x1b')](_0x2b71e6)[_0x1db0('0x1c')]();};}function respondWithResult(_0x2acc53,_0x3bba0b){_0x3bba0b=_0x3bba0b||0xc8;return function(_0x5ea811){if(_0x5ea811){return _0x2acc53[_0x1db0('0x1b')](_0x3bba0b)[_0x1db0('0x1d')](_0x5ea811);}};}function respondWithFilteredResult(_0x2c717e,_0x2fd8d4){return function(_0x430ac4){if(_0x430ac4){var _0x3e65fe=typeof _0x2fd8d4[_0x1db0('0x1e')]===_0x1db0('0x1f')&&typeof _0x2fd8d4[_0x1db0('0x20')]===_0x1db0('0x1f');var _0x18852d=_0x430ac4[_0x1db0('0x21')];var _0x4d43e3=_0x3e65fe?0x0:_0x2fd8d4[_0x1db0('0x1e')];var _0x316bc8=_0x3e65fe?_0x430ac4[_0x1db0('0x21')]:_0x2fd8d4['offset']+_0x2fd8d4[_0x1db0('0x20')];var _0x4c7f8c;if(_0x316bc8>=_0x18852d){_0x316bc8=_0x18852d;_0x4c7f8c=0xc8;}else{_0x4c7f8c=0xce;}_0x2c717e['status'](_0x4c7f8c);return _0x2c717e[_0x1db0('0x22')]('Content-Range',_0x4d43e3+'-'+_0x316bc8+'/'+_0x18852d)[_0x1db0('0x1d')](_0x430ac4);}return null;};}function patchUpdates(_0x53cc7b){return function(_0x40631b){try{jsonpatch['apply'](_0x40631b,_0x53cc7b,!![]);}catch(_0x5e5f82){return BPromise[_0x1db0('0x23')](_0x5e5f82);}return _0x40631b[_0x1db0('0x24')]();};}function saveUpdates(_0xd788ff,_0x1e69e2){return function(_0x2c5dcd){if(_0x2c5dcd){return _0x2c5dcd[_0x1db0('0x25')](_0xd788ff)[_0x1db0('0x26')](function(_0x5909c6){return _0x5909c6;});}return null;};}function removeEntity(_0xe33e8,_0x13f4a8){return function(_0x48b16e){if(_0x48b16e){return _0x48b16e[_0x1db0('0x27')]()[_0x1db0('0x26')](function(){_0xe33e8['status'](0xcc)[_0x1db0('0x1c')]();});}};}function handleEntityNotFound(_0x101945,_0xb400f1){return function(_0xfcb526){if(!_0xfcb526){_0x101945['sendStatus'](0x194);}return _0xfcb526;};}function handleError(_0x5f3825,_0x55ac9d){_0x55ac9d=_0x55ac9d||0x1f4;return function(_0x351fcb){logger['error'](_0x351fcb[_0x1db0('0x28')]);if(_0x351fcb[_0x1db0('0x29')]){delete _0x351fcb['name'];}_0x5f3825[_0x1db0('0x1b')](_0x55ac9d)['send'](_0x351fcb);};}exports[_0x1db0('0x2a')]=function(_0xf84175,_0x4b4ee0){var _0x3bb681={},_0x104947={},_0x16dcdf={'count':0x0,'rows':[]};var _0x234a9c=_[_0x1db0('0x2b')](db[_0x1db0('0x2c')]['rawAttributes'],function(_0x2a548d){return{'name':_0x2a548d[_0x1db0('0x2d')],'type':_0x2a548d[_0x1db0('0x2e')][_0x1db0('0x2f')]};});_0x104947[_0x1db0('0x30')]=_[_0x1db0('0x2b')](_0x234a9c,_0x1db0('0x29'));_0x104947[_0x1db0('0x31')]=_[_0x1db0('0x32')](_0xf84175[_0x1db0('0x31')]);_0x104947[_0x1db0('0x33')]=_[_0x1db0('0x34')](_0x104947[_0x1db0('0x30')],_0x104947[_0x1db0('0x31')]);_0x3bb681[_0x1db0('0x35')]=_['intersection'](_0x104947[_0x1db0('0x30')],qs[_0x1db0('0x36')](_0xf84175[_0x1db0('0x31')][_0x1db0('0x36')]));_0x3bb681[_0x1db0('0x35')]=_0x3bb681[_0x1db0('0x35')][_0x1db0('0x37')]?_0x3bb681[_0x1db0('0x35')]:_0x104947[_0x1db0('0x30')];if(!_0xf84175[_0x1db0('0x31')][_0x1db0('0x38')](_0x1db0('0x39'))){_0x3bb681[_0x1db0('0x20')]=qs[_0x1db0('0x20')](_0xf84175['query'][_0x1db0('0x20')]);_0x3bb681[_0x1db0('0x1e')]=qs[_0x1db0('0x1e')](_0xf84175[_0x1db0('0x31')][_0x1db0('0x1e')]);}_0x3bb681[_0x1db0('0x3a')]=qs[_0x1db0('0x3b')](_0xf84175['query']['sort']);_0x3bb681['where']=qs[_0x1db0('0x33')](_[_0x1db0('0x3c')](_0xf84175[_0x1db0('0x31')],_0x104947['filters']),_0x234a9c);if(_0xf84175['query'][_0x1db0('0x3d')]){_0x3bb681['where']=_[_0x1db0('0x3e')](_0x3bb681['where'],{'$or':_[_0x1db0('0x2b')](_0x234a9c,function(_0x45493e){if(_0x45493e['type']!==_0x1db0('0x3f')){var _0xd7e06={};_0xd7e06[_0x45493e['name']]={'$like':'%'+_0xf84175[_0x1db0('0x31')][_0x1db0('0x3d')]+'%'};return _0xd7e06;}})});}_0x3bb681=_[_0x1db0('0x3e')]({},_0x3bb681,_0xf84175[_0x1db0('0x40')]);var _0x448ddd={'where':_0x3bb681[_0x1db0('0x41')]};return db[_0x1db0('0x2c')][_0x1db0('0x21')](_0x448ddd)[_0x1db0('0x26')](function(_0x1dc2a3){_0x16dcdf[_0x1db0('0x21')]=_0x1dc2a3;if(_0xf84175['query'][_0x1db0('0x42')]){_0x3bb681['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x3bb681);})[_0x1db0('0x26')](function(_0x5f493d){_0x16dcdf[_0x1db0('0x43')]=_0x5f493d;return _0x16dcdf;})[_0x1db0('0x26')](respondWithFilteredResult(_0x4b4ee0,_0x3bb681))[_0x1db0('0x44')](handleError(_0x4b4ee0,null));};exports[_0x1db0('0x45')]=function(_0x592d58,_0x1da5a6){var _0x4a0ec7={'raw':![],'where':{'id':_0x592d58['params']['id']}},_0x24ea0e={};_0x24ea0e[_0x1db0('0x30')]=_['keys'](db[_0x1db0('0x2c')][_0x1db0('0x46')]);_0x24ea0e[_0x1db0('0x31')]=_[_0x1db0('0x32')](_0x592d58[_0x1db0('0x31')]);_0x24ea0e[_0x1db0('0x33')]=_[_0x1db0('0x34')](_0x24ea0e[_0x1db0('0x30')],_0x24ea0e[_0x1db0('0x31')]);_0x4a0ec7[_0x1db0('0x35')]=_[_0x1db0('0x34')](_0x24ea0e[_0x1db0('0x30')],qs[_0x1db0('0x36')](_0x592d58[_0x1db0('0x31')][_0x1db0('0x36')]));_0x4a0ec7['attributes']=_0x4a0ec7['attributes']['length']?_0x4a0ec7['attributes']:_0x24ea0e['model'];if(_0x592d58['query']['includeAll']){_0x4a0ec7[_0x1db0('0x47')]=[{'all':!![]}];}_0x4a0ec7=_[_0x1db0('0x3e')]({},_0x4a0ec7,_0x592d58[_0x1db0('0x40')]);return db[_0x1db0('0x2c')]['find'](_0x4a0ec7)[_0x1db0('0x26')](handleEntityNotFound(_0x1da5a6,null))[_0x1db0('0x26')](respondWithResult(_0x1da5a6,null))[_0x1db0('0x44')](handleError(_0x1da5a6,null));};exports[_0x1db0('0x48')]=function(_0x478b44,_0x26d579){return db[_0x1db0('0x2c')][_0x1db0('0x48')](_0x478b44[_0x1db0('0x49')],{})[_0x1db0('0x26')](respondWithResult(_0x26d579,0xc9))['catch'](handleError(_0x26d579,null));};exports[_0x1db0('0x25')]=function(_0x48e460,_0x3d456b){if(_0x48e460['body']['id']){delete _0x48e460[_0x1db0('0x49')]['id'];}return db['Automation'][_0x1db0('0x4a')]({'where':{'id':_0x48e460['params']['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x3d456b,null))[_0x1db0('0x26')](saveUpdates(_0x48e460['body'],null))[_0x1db0('0x26')](respondWithResult(_0x3d456b,null))['catch'](handleError(_0x3d456b,null));};exports[_0x1db0('0x27')]=function(_0x590e1a,_0x1ff1e7){return db['Automation'][_0x1db0('0x4a')]({'where':{'id':_0x590e1a[_0x1db0('0x4b')]['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x1ff1e7,null))[_0x1db0('0x26')](removeEntity(_0x1ff1e7,null))[_0x1db0('0x44')](handleError(_0x1ff1e7,null));};exports[_0x1db0('0x4c')]=function(_0x204862,_0x2bfad9,_0x2449c6){return db[_0x1db0('0x4d')][_0x1db0('0x4a')]({'where':{'id':_0x204862[_0x1db0('0x4b')]['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x2bfad9,null))[_0x1db0('0x26')](function(_0xb6c718){if(_0xb6c718){return _0xb6c718['addConditions'](_0x204862[_0x1db0('0x49')]['ids'],_[_0x1db0('0x4e')](_0x204862['body'],[_0x1db0('0x4f'),'id'])||{});}})[_0x1db0('0x26')](respondWithResult(_0x2bfad9,null))[_0x1db0('0x44')](handleError(_0x2bfad9,null));};exports[_0x1db0('0x50')]=function(_0x3478c1,_0x46eab8,_0xd35341){var _0x50385b={};var _0x2cec62={};var _0x2c3c33;var _0x535cb4;return db['Automation'][_0x1db0('0x51')]({'where':{'id':_0x3478c1[_0x1db0('0x4b')]['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x46eab8,null))['then'](function(_0x478279){if(_0x478279){_0x2c3c33=_0x478279;_0x2cec62[_0x1db0('0x30')]=_['keys'](db[_0x1db0('0x4d')][_0x1db0('0x46')]);_0x2cec62[_0x1db0('0x31')]=_['keys'](_0x3478c1['query']);_0x2cec62[_0x1db0('0x33')]=_[_0x1db0('0x34')](_0x2cec62[_0x1db0('0x30')],_0x2cec62['query']);_0x50385b[_0x1db0('0x35')]=_['intersection'](_0x2cec62['model'],qs[_0x1db0('0x36')](_0x3478c1[_0x1db0('0x31')][_0x1db0('0x36')]));_0x50385b[_0x1db0('0x35')]=_0x50385b['attributes'][_0x1db0('0x37')]?_0x50385b[_0x1db0('0x35')]:_0x2cec62['model'];_0x50385b['order']=qs[_0x1db0('0x3b')](_0x3478c1[_0x1db0('0x31')][_0x1db0('0x3b')]);_0x50385b[_0x1db0('0x41')]=qs[_0x1db0('0x33')](_[_0x1db0('0x3c')](_0x3478c1[_0x1db0('0x31')],_0x2cec62[_0x1db0('0x33')]));if(_0x3478c1['query']['filter']){_0x50385b[_0x1db0('0x41')]=_[_0x1db0('0x3e')](_0x50385b[_0x1db0('0x41')],{'$or':_[_0x1db0('0x2b')](_0x50385b[_0x1db0('0x35')],function(_0x545b3b){var _0x49ea75={};_0x49ea75[_0x545b3b]={'$like':'%'+_0x3478c1[_0x1db0('0x31')][_0x1db0('0x3d')]+'%'};return _0x49ea75;})});}_0x50385b=_[_0x1db0('0x3e')]({},_0x50385b,_0x3478c1[_0x1db0('0x40')]);return _0x2c3c33['getConditions'](_0x50385b);}})['then'](function(_0x5711a6){if(_0x5711a6){_0x535cb4=_0x5711a6['length'];if(!_0x3478c1['query'][_0x1db0('0x38')]('nolimit')){_0x50385b[_0x1db0('0x20')]=qs[_0x1db0('0x20')](_0x3478c1[_0x1db0('0x31')][_0x1db0('0x20')]);_0x50385b[_0x1db0('0x1e')]=qs[_0x1db0('0x1e')](_0x3478c1[_0x1db0('0x31')][_0x1db0('0x1e')]);}return _0x2c3c33['getConditions'](_0x50385b);}})[_0x1db0('0x26')](function(_0x70ca69){if(_0x70ca69){return _0x70ca69?{'count':_0x535cb4,'rows':_0x70ca69}:null;}})[_0x1db0('0x26')](respondWithResult(_0x46eab8,null))[_0x1db0('0x44')](handleError(_0x46eab8,null));};exports[_0x1db0('0x52')]=function(_0xbf2600,_0x2efcab,_0x39e94f){return db[_0x1db0('0x53')]['find']({'where':{'id':_0xbf2600['params']['id']}})['then'](handleEntityNotFound(_0x2efcab,null))[_0x1db0('0x26')](function(_0x25c379){if(_0x25c379){return _0x25c379[_0x1db0('0x52')](_0xbf2600[_0x1db0('0x49')][_0x1db0('0x4f')],_[_0x1db0('0x4e')](_0xbf2600[_0x1db0('0x49')],[_0x1db0('0x4f'),'id'])||{});}})[_0x1db0('0x26')](respondWithResult(_0x2efcab,null))[_0x1db0('0x44')](handleError(_0x2efcab,null));};exports[_0x1db0('0x54')]=function(_0x5591a2,_0x11279e,_0x4da846){var _0x1c8771={};var _0x1b3e4c={};var _0xc339;var _0xced2db;return db[_0x1db0('0x2c')][_0x1db0('0x51')]({'where':{'id':_0x5591a2[_0x1db0('0x4b')]['id']}})[_0x1db0('0x26')](handleEntityNotFound(_0x11279e,null))[_0x1db0('0x26')](function(_0x3c1e08){if(_0x3c1e08){_0xc339=_0x3c1e08;_0x1b3e4c[_0x1db0('0x30')]=_[_0x1db0('0x32')](db[_0x1db0('0x53')][_0x1db0('0x46')]);_0x1b3e4c[_0x1db0('0x31')]=_['keys'](_0x5591a2[_0x1db0('0x31')]);_0x1b3e4c[_0x1db0('0x33')]=_[_0x1db0('0x34')](_0x1b3e4c[_0x1db0('0x30')],_0x1b3e4c[_0x1db0('0x31')]);_0x1c8771[_0x1db0('0x35')]=_[_0x1db0('0x34')](_0x1b3e4c[_0x1db0('0x30')],qs[_0x1db0('0x36')](_0x5591a2[_0x1db0('0x31')][_0x1db0('0x36')]));_0x1c8771[_0x1db0('0x35')]=_0x1c8771['attributes'][_0x1db0('0x37')]?_0x1c8771[_0x1db0('0x35')]:_0x1b3e4c[_0x1db0('0x30')];_0x1c8771['order']=qs[_0x1db0('0x3b')](_0x5591a2[_0x1db0('0x31')][_0x1db0('0x3b')]);_0x1c8771[_0x1db0('0x41')]=qs[_0x1db0('0x33')](_['pick'](_0x5591a2[_0x1db0('0x31')],_0x1b3e4c[_0x1db0('0x33')]));if(_0x5591a2['query'][_0x1db0('0x3d')]){_0x1c8771[_0x1db0('0x41')]=_[_0x1db0('0x3e')](_0x1c8771[_0x1db0('0x41')],{'$or':_['map'](_0x1c8771['attributes'],function(_0x1f87e8){var _0x27e1e2={};_0x27e1e2[_0x1f87e8]={'$like':'%'+_0x5591a2[_0x1db0('0x31')]['filter']+'%'};return _0x27e1e2;})});}_0x1c8771=_['merge']({},_0x1c8771,_0x5591a2[_0x1db0('0x40')]);return _0xc339[_0x1db0('0x54')](_0x1c8771);}})[_0x1db0('0x26')](function(_0x128498){if(_0x128498){_0xced2db=_0x128498[_0x1db0('0x37')];if(!_0x5591a2[_0x1db0('0x31')][_0x1db0('0x38')]('nolimit')){_0x1c8771['limit']=qs['limit'](_0x5591a2[_0x1db0('0x31')][_0x1db0('0x20')]);_0x1c8771['offset']=qs['offset'](_0x5591a2[_0x1db0('0x31')][_0x1db0('0x1e')]);}return _0xc339[_0x1db0('0x54')](_0x1c8771);}})[_0x1db0('0x26')](function(_0x43eef0){if(_0x43eef0){return _0x43eef0?{'count':_0xced2db,'rows':_0x43eef0}:null;}})['then'](respondWithResult(_0x11279e,null))[_0x1db0('0x44')](handleError(_0x11279e,null));};
\ No newline at end of file
+var _0x26ea=['error','stack','name','send','Automation','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','then','show','params','find','catch','create','body','addConditions','Condition','ids','omit','findOne','getConditions','Action','addActions','getActions','order','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x23899b,_0x1ef7c7){var _0x3b7fda=function(_0x119d17){while(--_0x119d17){_0x23899b['push'](_0x23899b['shift']());}};_0x3b7fda(++_0x1ef7c7);}(_0x26ea,0x176));var _0xa26e=function(_0x36580f,_0x35017f){_0x36580f=_0x36580f-0x0;var _0x5dab9b=_0x26ea[_0x36580f];return _0x5dab9b;};'use strict';var emlformat=require(_0xa26e('0x0'));var rimraf=require(_0xa26e('0x1'));var zipdir=require(_0xa26e('0x2'));var jsonpatch=require(_0xa26e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa26e('0x4'));var Mustache=require(_0xa26e('0x5'));var util=require(_0xa26e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa26e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa26e('0x8'));var _=require(_0xa26e('0x9'));var squel=require(_0xa26e('0xa'));var crypto=require(_0xa26e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa26e('0xc'));var toCsv=require(_0xa26e('0x7'));var querystring=require(_0xa26e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa26e('0xe'));var qs=require(_0xa26e('0xf'));var as=require(_0xa26e('0x10'));var hardwareService=require(_0xa26e('0x11'));var logger=require(_0xa26e('0x12'))(_0xa26e('0x13'));var utils=require(_0xa26e('0x14'));var config=require(_0xa26e('0x15'));var licenseUtil=require(_0xa26e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4435d9,_0xd6f8b5){_0xd6f8b5=_0xd6f8b5||0xcc;return function(_0x2eae05){if(_0x2eae05){return _0x4435d9[_0xa26e('0x17')](_0xd6f8b5);}return _0x4435d9[_0xa26e('0x18')](_0xd6f8b5)[_0xa26e('0x19')]();};}function respondWithResult(_0x244e7e,_0x468b43){_0x468b43=_0x468b43||0xc8;return function(_0x36e34a){if(_0x36e34a){return _0x244e7e[_0xa26e('0x18')](_0x468b43)['json'](_0x36e34a);}};}function respondWithFilteredResult(_0x15b9e6,_0x2806b7){return function(_0x2a6e40){if(_0x2a6e40){var _0x5e2149=typeof _0x2806b7[_0xa26e('0x1a')]===_0xa26e('0x1b')&&typeof _0x2806b7[_0xa26e('0x1c')]===_0xa26e('0x1b');var _0x4935bb=_0x2a6e40[_0xa26e('0x1d')];var _0x1c31b6=_0x5e2149?0x0:_0x2806b7[_0xa26e('0x1a')];var _0x5bd3b0=_0x5e2149?_0x2a6e40[_0xa26e('0x1d')]:_0x2806b7[_0xa26e('0x1a')]+_0x2806b7[_0xa26e('0x1c')];var _0x381c39;if(_0x5bd3b0>=_0x4935bb){_0x5bd3b0=_0x4935bb;_0x381c39=0xc8;}else{_0x381c39=0xce;}_0x15b9e6[_0xa26e('0x18')](_0x381c39);return _0x15b9e6[_0xa26e('0x1e')](_0xa26e('0x1f'),_0x1c31b6+'-'+_0x5bd3b0+'/'+_0x4935bb)['json'](_0x2a6e40);}return null;};}function patchUpdates(_0x3443c9){return function(_0x376be2){try{jsonpatch[_0xa26e('0x20')](_0x376be2,_0x3443c9,!![]);}catch(_0x3586a6){return BPromise[_0xa26e('0x21')](_0x3586a6);}return _0x376be2[_0xa26e('0x22')]();};}function saveUpdates(_0x34d7da,_0x365318){return function(_0x2e381b){if(_0x2e381b){return _0x2e381b[_0xa26e('0x23')](_0x34d7da)['then'](function(_0x1e0b02){return _0x1e0b02;});}return null;};}function removeEntity(_0x26364e,_0x2e1b8b){return function(_0xefae7c){if(_0xefae7c){return _0xefae7c['destroy']()['then'](function(){_0x26364e[_0xa26e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7d6ae2,_0x1e65f8){return function(_0x62587e){if(!_0x62587e){_0x7d6ae2[_0xa26e('0x17')](0x194);}return _0x62587e;};}function handleError(_0x1cb5e5,_0x18e86e){_0x18e86e=_0x18e86e||0x1f4;return function(_0x1ccaa0){logger[_0xa26e('0x24')](_0x1ccaa0[_0xa26e('0x25')]);if(_0x1ccaa0[_0xa26e('0x26')]){delete _0x1ccaa0['name'];}_0x1cb5e5[_0xa26e('0x18')](_0x18e86e)[_0xa26e('0x27')](_0x1ccaa0);};}exports['index']=function(_0x312620,_0x9bcf79){var _0x37c375={},_0x5278a0={},_0x51962c={'count':0x0,'rows':[]};var _0x2abb55=_['map'](db[_0xa26e('0x28')][_0xa26e('0x29')],function(_0x52f8f5){return{'name':_0x52f8f5['fieldName'],'type':_0x52f8f5['type'][_0xa26e('0x2a')]};});_0x5278a0[_0xa26e('0x2b')]=_[_0xa26e('0x2c')](_0x2abb55,'name');_0x5278a0[_0xa26e('0x2d')]=_[_0xa26e('0x2e')](_0x312620[_0xa26e('0x2d')]);_0x5278a0['filters']=_[_0xa26e('0x2f')](_0x5278a0[_0xa26e('0x2b')],_0x5278a0['query']);_0x37c375[_0xa26e('0x30')]=_['intersection'](_0x5278a0[_0xa26e('0x2b')],qs['fields'](_0x312620['query'][_0xa26e('0x31')]));_0x37c375['attributes']=_0x37c375['attributes'][_0xa26e('0x32')]?_0x37c375[_0xa26e('0x30')]:_0x5278a0[_0xa26e('0x2b')];if(!_0x312620[_0xa26e('0x2d')][_0xa26e('0x33')](_0xa26e('0x34'))){_0x37c375['limit']=qs[_0xa26e('0x1c')](_0x312620[_0xa26e('0x2d')]['limit']);_0x37c375[_0xa26e('0x1a')]=qs[_0xa26e('0x1a')](_0x312620[_0xa26e('0x2d')]['offset']);}_0x37c375['order']=qs[_0xa26e('0x35')](_0x312620[_0xa26e('0x2d')][_0xa26e('0x35')]);_0x37c375['where']=qs['filters'](_[_0xa26e('0x36')](_0x312620['query'],_0x5278a0[_0xa26e('0x37')]),_0x2abb55);if(_0x312620[_0xa26e('0x2d')][_0xa26e('0x38')]){_0x37c375[_0xa26e('0x39')]=_[_0xa26e('0x3a')](_0x37c375[_0xa26e('0x39')],{'$or':_['map'](_0x2abb55,function(_0x216bb3){if(_0x216bb3[_0xa26e('0x3b')]!==_0xa26e('0x3c')){var _0x2fce92={};_0x2fce92[_0x216bb3['name']]={'$like':'%'+_0x312620[_0xa26e('0x2d')][_0xa26e('0x38')]+'%'};return _0x2fce92;}})});}_0x37c375=_[_0xa26e('0x3a')]({},_0x37c375,_0x312620[_0xa26e('0x3d')]);var _0x5b3139={'where':_0x37c375[_0xa26e('0x39')]};return db[_0xa26e('0x28')][_0xa26e('0x1d')](_0x5b3139)['then'](function(_0x283469){_0x51962c[_0xa26e('0x1d')]=_0x283469;if(_0x312620[_0xa26e('0x2d')][_0xa26e('0x3e')]){_0x37c375[_0xa26e('0x3f')]=[{'all':!![]}];}return db[_0xa26e('0x28')][_0xa26e('0x40')](_0x37c375);})['then'](function(_0x26fd69){_0x51962c['rows']=_0x26fd69;return _0x51962c;})[_0xa26e('0x41')](respondWithFilteredResult(_0x9bcf79,_0x37c375))['catch'](handleError(_0x9bcf79,null));};exports[_0xa26e('0x42')]=function(_0x40e786,_0x3bc4ed){var _0x462cae={'raw':![],'where':{'id':_0x40e786[_0xa26e('0x43')]['id']}},_0x5737c1={};_0x5737c1[_0xa26e('0x2b')]=_[_0xa26e('0x2e')](db[_0xa26e('0x28')]['rawAttributes']);_0x5737c1[_0xa26e('0x2d')]=_[_0xa26e('0x2e')](_0x40e786['query']);_0x5737c1[_0xa26e('0x37')]=_[_0xa26e('0x2f')](_0x5737c1['model'],_0x5737c1[_0xa26e('0x2d')]);_0x462cae[_0xa26e('0x30')]=_[_0xa26e('0x2f')](_0x5737c1['model'],qs[_0xa26e('0x31')](_0x40e786[_0xa26e('0x2d')]['fields']));_0x462cae['attributes']=_0x462cae[_0xa26e('0x30')][_0xa26e('0x32')]?_0x462cae[_0xa26e('0x30')]:_0x5737c1[_0xa26e('0x2b')];if(_0x40e786[_0xa26e('0x2d')][_0xa26e('0x3e')]){_0x462cae[_0xa26e('0x3f')]=[{'all':!![]}];}_0x462cae=_[_0xa26e('0x3a')]({},_0x462cae,_0x40e786['options']);return db[_0xa26e('0x28')][_0xa26e('0x44')](_0x462cae)[_0xa26e('0x41')](handleEntityNotFound(_0x3bc4ed,null))[_0xa26e('0x41')](respondWithResult(_0x3bc4ed,null))[_0xa26e('0x45')](handleError(_0x3bc4ed,null));};exports[_0xa26e('0x46')]=function(_0x263209,_0x404f89){return db[_0xa26e('0x28')]['create'](_0x263209[_0xa26e('0x47')],{})[_0xa26e('0x41')](respondWithResult(_0x404f89,0xc9))[_0xa26e('0x45')](handleError(_0x404f89,null));};exports[_0xa26e('0x23')]=function(_0x4c96fa,_0x31ba9){if(_0x4c96fa[_0xa26e('0x47')]['id']){delete _0x4c96fa[_0xa26e('0x47')]['id'];}return db[_0xa26e('0x28')][_0xa26e('0x44')]({'where':{'id':_0x4c96fa['params']['id']}})['then'](handleEntityNotFound(_0x31ba9,null))['then'](saveUpdates(_0x4c96fa[_0xa26e('0x47')],null))[_0xa26e('0x41')](respondWithResult(_0x31ba9,null))[_0xa26e('0x45')](handleError(_0x31ba9,null));};exports['destroy']=function(_0x300c24,_0x260fce){return db[_0xa26e('0x28')][_0xa26e('0x44')]({'where':{'id':_0x300c24[_0xa26e('0x43')]['id']}})[_0xa26e('0x41')](handleEntityNotFound(_0x260fce,null))[_0xa26e('0x41')](removeEntity(_0x260fce,null))[_0xa26e('0x45')](handleError(_0x260fce,null));};exports[_0xa26e('0x48')]=function(_0x30bf4e,_0x3326a4,_0x57b078){return db[_0xa26e('0x49')]['find']({'where':{'id':_0x30bf4e[_0xa26e('0x43')]['id']}})['then'](handleEntityNotFound(_0x3326a4,null))[_0xa26e('0x41')](function(_0x5e397b){if(_0x5e397b){return _0x5e397b[_0xa26e('0x48')](_0x30bf4e[_0xa26e('0x47')][_0xa26e('0x4a')],_[_0xa26e('0x4b')](_0x30bf4e['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x3326a4,null))[_0xa26e('0x45')](handleError(_0x3326a4,null));};exports['getConditions']=function(_0x682178,_0x31c700,_0x2b3927){var _0x3bd38c={};var _0x354bb2={};var _0x3fb090;var _0x11d7d6;return db[_0xa26e('0x28')][_0xa26e('0x4c')]({'where':{'id':_0x682178[_0xa26e('0x43')]['id']}})['then'](handleEntityNotFound(_0x31c700,null))[_0xa26e('0x41')](function(_0x31b4bd){if(_0x31b4bd){_0x3fb090=_0x31b4bd;_0x354bb2['model']=_['keys'](db[_0xa26e('0x49')][_0xa26e('0x29')]);_0x354bb2['query']=_[_0xa26e('0x2e')](_0x682178[_0xa26e('0x2d')]);_0x354bb2[_0xa26e('0x37')]=_[_0xa26e('0x2f')](_0x354bb2['model'],_0x354bb2[_0xa26e('0x2d')]);_0x3bd38c['attributes']=_[_0xa26e('0x2f')](_0x354bb2[_0xa26e('0x2b')],qs[_0xa26e('0x31')](_0x682178[_0xa26e('0x2d')][_0xa26e('0x31')]));_0x3bd38c['attributes']=_0x3bd38c[_0xa26e('0x30')]['length']?_0x3bd38c[_0xa26e('0x30')]:_0x354bb2['model'];_0x3bd38c['order']=qs['sort'](_0x682178[_0xa26e('0x2d')][_0xa26e('0x35')]);_0x3bd38c[_0xa26e('0x39')]=qs[_0xa26e('0x37')](_['pick'](_0x682178[_0xa26e('0x2d')],_0x354bb2['filters']));if(_0x682178[_0xa26e('0x2d')][_0xa26e('0x38')]){_0x3bd38c['where']=_['merge'](_0x3bd38c['where'],{'$or':_[_0xa26e('0x2c')](_0x3bd38c[_0xa26e('0x30')],function(_0x44204c){var _0x4062f6={};_0x4062f6[_0x44204c]={'$like':'%'+_0x682178[_0xa26e('0x2d')][_0xa26e('0x38')]+'%'};return _0x4062f6;})});}_0x3bd38c=_[_0xa26e('0x3a')]({},_0x3bd38c,_0x682178[_0xa26e('0x3d')]);return _0x3fb090['getConditions'](_0x3bd38c);}})[_0xa26e('0x41')](function(_0xde3453){if(_0xde3453){_0x11d7d6=_0xde3453[_0xa26e('0x32')];if(!_0x682178[_0xa26e('0x2d')][_0xa26e('0x33')](_0xa26e('0x34'))){_0x3bd38c[_0xa26e('0x1c')]=qs[_0xa26e('0x1c')](_0x682178[_0xa26e('0x2d')][_0xa26e('0x1c')]);_0x3bd38c[_0xa26e('0x1a')]=qs['offset'](_0x682178[_0xa26e('0x2d')][_0xa26e('0x1a')]);}return _0x3fb090[_0xa26e('0x4d')](_0x3bd38c);}})[_0xa26e('0x41')](function(_0x525a3d){if(_0x525a3d){return _0x525a3d?{'count':_0x11d7d6,'rows':_0x525a3d}:null;}})[_0xa26e('0x41')](respondWithResult(_0x31c700,null))['catch'](handleError(_0x31c700,null));};exports['addActions']=function(_0x3abadb,_0x25e15d,_0xc01922){return db[_0xa26e('0x4e')]['find']({'where':{'id':_0x3abadb[_0xa26e('0x43')]['id']}})[_0xa26e('0x41')](handleEntityNotFound(_0x25e15d,null))['then'](function(_0x7bc968){if(_0x7bc968){return _0x7bc968[_0xa26e('0x4f')](_0x3abadb[_0xa26e('0x47')]['ids'],_[_0xa26e('0x4b')](_0x3abadb[_0xa26e('0x47')],[_0xa26e('0x4a'),'id'])||{});}})[_0xa26e('0x41')](respondWithResult(_0x25e15d,null))[_0xa26e('0x45')](handleError(_0x25e15d,null));};exports[_0xa26e('0x50')]=function(_0x5ab469,_0x1124bb,_0x1fd5b0){var _0x3d92bf={};var _0x29abfa={};var _0x5ed218;var _0x4c056c;return db[_0xa26e('0x28')]['findOne']({'where':{'id':_0x5ab469[_0xa26e('0x43')]['id']}})[_0xa26e('0x41')](handleEntityNotFound(_0x1124bb,null))[_0xa26e('0x41')](function(_0x1b8573){if(_0x1b8573){_0x5ed218=_0x1b8573;_0x29abfa['model']=_[_0xa26e('0x2e')](db['Action'][_0xa26e('0x29')]);_0x29abfa['query']=_[_0xa26e('0x2e')](_0x5ab469[_0xa26e('0x2d')]);_0x29abfa['filters']=_[_0xa26e('0x2f')](_0x29abfa[_0xa26e('0x2b')],_0x29abfa['query']);_0x3d92bf[_0xa26e('0x30')]=_['intersection'](_0x29abfa[_0xa26e('0x2b')],qs['fields'](_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x31')]));_0x3d92bf[_0xa26e('0x30')]=_0x3d92bf['attributes'][_0xa26e('0x32')]?_0x3d92bf[_0xa26e('0x30')]:_0x29abfa[_0xa26e('0x2b')];_0x3d92bf[_0xa26e('0x51')]=qs[_0xa26e('0x35')](_0x5ab469['query'][_0xa26e('0x35')]);_0x3d92bf['where']=qs[_0xa26e('0x37')](_[_0xa26e('0x36')](_0x5ab469[_0xa26e('0x2d')],_0x29abfa[_0xa26e('0x37')]));if(_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x38')]){_0x3d92bf[_0xa26e('0x39')]=_[_0xa26e('0x3a')](_0x3d92bf[_0xa26e('0x39')],{'$or':_[_0xa26e('0x2c')](_0x3d92bf[_0xa26e('0x30')],function(_0x55bfc4){var _0x922e10={};_0x922e10[_0x55bfc4]={'$like':'%'+_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x38')]+'%'};return _0x922e10;})});}_0x3d92bf=_[_0xa26e('0x3a')]({},_0x3d92bf,_0x5ab469[_0xa26e('0x3d')]);return _0x5ed218[_0xa26e('0x50')](_0x3d92bf);}})[_0xa26e('0x41')](function(_0x186bb0){if(_0x186bb0){_0x4c056c=_0x186bb0[_0xa26e('0x32')];if(!_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x33')](_0xa26e('0x34'))){_0x3d92bf['limit']=qs[_0xa26e('0x1c')](_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x1c')]);_0x3d92bf['offset']=qs['offset'](_0x5ab469[_0xa26e('0x2d')][_0xa26e('0x1a')]);}return _0x5ed218[_0xa26e('0x50')](_0x3d92bf);}})[_0xa26e('0x41')](function(_0x1bbd3a){if(_0x1bbd3a){return _0x1bbd3a?{'count':_0x4c056c,'rows':_0x1bbd3a}:null;}})[_0xa26e('0x41')](respondWithResult(_0x1124bb,null))[_0xa26e('0x45')](handleError(_0x1124bb,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 7e7d08c..14765de 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 _0x060f=['request-promise','path','rimraf','./automation.attributes','define','tools_automations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3870ae,_0x969767){var _0x58966d=function(_0x2f6ccb){while(--_0x2f6ccb){_0x3870ae['push'](_0x3870ae['shift']());}};_0x58966d(++_0x969767);}(_0x060f,0x1b3));var _0xf060=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x060f[_0x39bc44];return _0x2916d8;};'use strict';var _=require(_0xf060('0x0'));var util=require('util');var logger=require(_0xf060('0x1'))(_0xf060('0x2'));var moment=require(_0xf060('0x3'));var BPromise=require(_0xf060('0x4'));var rp=require(_0xf060('0x5'));var fs=require('fs');var path=require(_0xf060('0x6'));var rimraf=require(_0xf060('0x7'));var config=require('../../config/environment');var attributes=require(_0xf060('0x8'));module['exports']=function(_0x8ae8c1,_0x2bd10d){return _0x8ae8c1[_0xf060('0x9')]('Automation',attributes,{'tableName':_0xf060('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed0d=['util','../../config/logger','api','moment','request-promise','path','define','tools_automations','lodash'];(function(_0x1aa47e,_0x4fc638){var _0x13d4b7=function(_0x1f5811){while(--_0x1f5811){_0x1aa47e['push'](_0x1aa47e['shift']());}};_0x13d4b7(++_0x4fc638);}(_0xed0d,0x143));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xded0('0x0'));var util=require(_0xded0('0x1'));var logger=require(_0xded0('0x2'))(_0xded0('0x3'));var moment=require(_0xded0('0x4'));var BPromise=require('bluebird');var rp=require(_0xded0('0x5'));var fs=require('fs');var path=require(_0xded0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x211f85,_0x27c13d){return _0x211f85[_0xded0('0x7')]('Automation',attributes,{'tableName':_0xded0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 54ee730..b3adb84 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 _0xa3b7=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x4e76b0,_0x3168de){var _0x5d5358=function(_0x57db2a){while(--_0x57db2a){_0x4e76b0['push'](_0x4e76b0['shift']());}};_0x5d5358(++_0x3168de);}(_0xa3b7,0xe6));var _0x7a3b=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0xa3b7[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0x7a3b('0x0'));var util=require('util');var moment=require(_0x7a3b('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a3b('0x2'));var fs=require('fs');var Redis=require(_0x7a3b('0x3'));var db=require(_0x7a3b('0x4'))['db'];var utils=require(_0x7a3b('0x5'));var logger=require(_0x7a3b('0x6'))(_0x7a3b('0x7'));var config=require(_0x7a3b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7a3b('0x9')][_0x7a3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31274f,_0x43c083,_0x63f93d){return new BPromise(function(_0x560f45,_0x1d6e53){return client['request'](_0x31274f,_0x63f93d)[_0x7a3b('0xb')](function(_0x60adf9){logger[_0x7a3b('0xc')](_0x7a3b('0xd'),_0x43c083,_0x7a3b('0xe'));logger[_0x7a3b('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x43c083,_0x7a3b('0xe'),JSON[_0x7a3b('0x10')](_0x60adf9));if(_0x60adf9[_0x7a3b('0x11')]){if(_0x60adf9['error'][_0x7a3b('0x12')]===0x1f4){logger[_0x7a3b('0x11')]('Automation,\x20%s,\x20%s',_0x43c083,_0x60adf9[_0x7a3b('0x11')][_0x7a3b('0x13')]);return _0x1d6e53(_0x60adf9[_0x7a3b('0x11')]['message']);}logger[_0x7a3b('0x11')](_0x7a3b('0xd'),_0x43c083,_0x60adf9[_0x7a3b('0x11')]['message']);return _0x560f45(_0x60adf9[_0x7a3b('0x11')][_0x7a3b('0x13')]);}else{logger['info'](_0x7a3b('0xd'),_0x43c083,_0x7a3b('0xe'));_0x560f45(_0x60adf9[_0x7a3b('0x14')]['message']);}})[_0x7a3b('0x15')](function(_0x414a5b){logger['error'](_0x7a3b('0xd'),_0x43c083,_0x414a5b);_0x1d6e53(_0x414a5b);});});}
\ No newline at end of file
+var _0x23bb=['stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','debug'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0x23bb,0x79));var _0xb23b=function(_0x330a95,_0x2b0fe3){_0x330a95=_0x330a95-0x0;var _0xb9a8d=_0x23bb[_0x330a95];return _0xb9a8d;};'use strict';var _=require(_0xb23b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb23b('0x1'));var rs=require(_0xb23b('0x2'));var fs=require('fs');var Redis=require(_0xb23b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb23b('0x4'));var logger=require(_0xb23b('0x5'))(_0xb23b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb23b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c5626,_0x4a2873,_0x596a94){return new BPromise(function(_0x29e8e9,_0x4d00fe){return client[_0xb23b('0x8')](_0x4c5626,_0x596a94)['then'](function(_0x23270c){logger[_0xb23b('0x9')]('Automation,\x20%s,\x20%s',_0x4a2873,_0xb23b('0xa'));logger[_0xb23b('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x4a2873,_0xb23b('0xa'),JSON[_0xb23b('0xc')](_0x23270c));if(_0x23270c[_0xb23b('0xd')]){if(_0x23270c['error'][_0xb23b('0xe')]===0x1f4){logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);return _0x4d00fe(_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);}logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);return _0x29e8e9(_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);}else{logger[_0xb23b('0x9')](_0xb23b('0xf'),_0x4a2873,_0xb23b('0xa'));_0x29e8e9(_0x23270c[_0xb23b('0x11')]['message']);}})[_0xb23b('0x12')](function(_0x3c5852){logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x3c5852);_0x4d00fe(_0x3c5852);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 138d0fa..bf7577c 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 _0xd89f=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','addConditions','post','addActions','update','destroy'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xd89f,0x191));var _0xfd89=function(_0x4696d6,_0x27b551){_0x4696d6=_0x4696d6-0x0;var _0x19f53d=_0xd89f[_0x4696d6];return _0x19f53d;};'use strict';var multer=require(_0xfd89('0x0'));var util=require(_0xfd89('0x1'));var path=require(_0xfd89('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd89('0x3'));var router=express[_0xfd89('0x4')]();var fs_extra=require(_0xfd89('0x5'));var auth=require(_0xfd89('0x6'));var interaction=require(_0xfd89('0x7'));var config=require(_0xfd89('0x8'));var controller=require('./automation.controller');router[_0xfd89('0x9')]('/',auth[_0xfd89('0xa')](),controller[_0xfd89('0xb')]);router[_0xfd89('0x9')](_0xfd89('0xc'),auth[_0xfd89('0xa')](),controller[_0xfd89('0xd')]);router[_0xfd89('0x9')](_0xfd89('0xe'),auth[_0xfd89('0xa')](),controller[_0xfd89('0xf')]);router[_0xfd89('0x9')](_0xfd89('0x10'),auth[_0xfd89('0xa')](),controller[_0xfd89('0x11')]);router['post']('/',auth[_0xfd89('0xa')](),controller[_0xfd89('0x12')]);router['post']('/:id/conditions',auth[_0xfd89('0xa')](),controller[_0xfd89('0x13')]);router[_0xfd89('0x14')](_0xfd89('0x10'),auth['isAuthenticated'](),controller[_0xfd89('0x15')]);router['put'](_0xfd89('0xc'),auth[_0xfd89('0xa')](),controller[_0xfd89('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfd89('0x17')]);module[_0xfd89('0x18')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x3e74,0x175));var _0x43e7=function(_0x3af4b9,_0x3b01a1){_0x3af4b9=_0x3af4b9-0x0;var _0xcadb14=_0x3e74[_0x3af4b9];return _0xcadb14;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/actions',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['post']('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xf')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0xf')](_0x43e7('0x11'),auth[_0x43e7('0x8')](),controller['addActions']);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x12')]);router['delete']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);module[_0x43e7('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index ef9a961..eba16d6 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 _0x025c=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x025c,0x128));var _0xc025=function(_0x471351,_0x2777eb){_0x471351=_0x471351-0x0;var _0x4a1c5b=_0x025c[_0x471351];return _0x4a1c5b;};'use strict';var Sequelize=require(_0xc025('0x0'));module[_0xc025('0x1')]={'name':{'type':Sequelize[_0xc025('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc025('0x3')](_0xc025('0x4')),'allowNull':![],'defaultValue':_0xc025('0x4')},'description':{'type':Sequelize[_0xc025('0x2')]},'active':{'type':Sequelize[_0xc025('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xc025('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc025('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc025('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc025('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'comment':_0xc025('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc025('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc025('0x2')],'defaultValue':_0xc025('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xc025('0x3')](_0xc025('0x12'),_0xc025('0x13'),_0xc025('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xc025('0x5')],'defaultValue':0x0,'comment':_0xc025('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xc025('0x6')](0x9)[_0xc025('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc025('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xc025('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc025('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc025('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc025('0x6')](0x9)[_0xc025('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc025('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0xc025('0x6')](0x9)[_0xc025('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc025('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc025('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc025('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc025('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc025('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc025('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc025('0x1e'),_0xc025('0x1f')),'defaultValue':_0xc025('0x1e')},'dialPrefix':{'type':Sequelize[_0xc025('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc025('0x20')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc025('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc025('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x24')},'dialDropRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc025('0x6')](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x26')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc025('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x27')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc025('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc025('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc025('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc025('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x8e11=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\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)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x8e11,0x11d));var _0x18e1=function(_0x4ebf10,_0x2ea42a){_0x4ebf10=_0x4ebf10-0x0;var _0x12453b=_0x8e11[_0x4ebf10];return _0x12453b;};'use strict';var Sequelize=require('sequelize');module[_0x18e1('0x0')]={'name':{'type':Sequelize[_0x18e1('0x1')],'unique':_0x18e1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x18e1('0x3')](_0x18e1('0x4')),'allowNull':![],'defaultValue':_0x18e1('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x18e1('0x5')],'defaultValue':0x0,'comment':_0x18e1('0x6')},'limitCalls':{'type':Sequelize[_0x18e1('0x7')](0x4)[_0x18e1('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x18e1('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x18e1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x18e1('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x18e1('0x7')](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x18e1('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x18e1('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x18e1('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x18e1('0xe'),_0x18e1('0xf'),_0x18e1('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x18e1('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x18e1('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x18e1('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x18e1('0x7')](0x9)[_0x18e1('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x18e1('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x18e1('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x18e1('0x7')](0x9)[_0x18e1('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x18e1('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x18e1('0x7')](0x9)[_0x18e1('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x18e1('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x18e1('0x7')](0x9)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x18e1('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x18e1('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x18e1('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x18e1('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x18e1('0x3')](_0x18e1('0x17'),'ASC'),'defaultValue':_0x18e1('0x17')},'dialPrefix':{'type':Sequelize[_0x18e1('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18e1('0x18')},'dialCutDigit':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x18e1('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x18e1('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x18e1('0x7')](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x18e1('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x18e1('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x18e1('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x18e1('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x18e1('0x21')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 1bd3d4f..2f56481 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 _0xfcef=['filters','intersection','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','updatedAt','omit','body','params','findOne','nolimit','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','NOW()','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','cm_hopper','phone\x20NOT\x20IN\x20(?)','push','removeLists','addBlackLists','sequelize','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show'];(function(_0x44b743,_0x58b597){var _0x24bd58=function(_0x29db9c){while(--_0x29db9c){_0x44b743['push'](_0x44b743['shift']());}};_0x24bd58(++_0x58b597);}(_0xfcef,0x1cc));var _0xffce=function(_0x17aa4f,_0x5146fc){_0x17aa4f=_0x17aa4f-0x0;var _0x1fa956=_0xfcef[_0x17aa4f];return _0x1fa956;};'use strict';var emlformat=require(_0xffce('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xffce('0x1'));var rp=require(_0xffce('0x2'));var moment=require(_0xffce('0x3'));var BPromise=require(_0xffce('0x4'));var Mustache=require(_0xffce('0x5'));var util=require(_0xffce('0x6'));var path=require(_0xffce('0x7'));var sox=require('sox');var csv=require(_0xffce('0x8'));var ejs=require(_0xffce('0x9'));var fs=require('fs');var fs_extra=require(_0xffce('0xa'));var _=require(_0xffce('0xb'));var squel=require('squel');var crypto=require(_0xffce('0xc'));var jsforce=require(_0xffce('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xffce('0x8'));var querystring=require('querystring');var Papa=require(_0xffce('0xe'));var Redis=require('ioredis');var authService=require(_0xffce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xffce('0x10'));var hardwareService=require(_0xffce('0x11'));var logger=require(_0xffce('0x12'))('api');var utils=require(_0xffce('0x13'));var config=require(_0xffce('0x14'));var licenseUtil=require(_0xffce('0x15'));var db=require(_0xffce('0x16'))['db'];function respondWithStatusCode(_0x19be98,_0x560a14){_0x560a14=_0x560a14||0xcc;return function(_0x23815a){if(_0x23815a){return _0x19be98[_0xffce('0x17')](_0x560a14);}return _0x19be98[_0xffce('0x18')](_0x560a14)[_0xffce('0x19')]();};}function respondWithResult(_0x2f5d17,_0x375878){_0x375878=_0x375878||0xc8;return function(_0x37812e){if(_0x37812e){return _0x2f5d17[_0xffce('0x18')](_0x375878)['json'](_0x37812e);}};}function respondWithFilteredResult(_0x2c9bac,_0x51941a){return function(_0x3a646c){if(_0x3a646c){var _0x71a054=typeof _0x51941a[_0xffce('0x1a')]===_0xffce('0x1b')&&typeof _0x51941a['limit']===_0xffce('0x1b');var _0x31a112=_0x3a646c[_0xffce('0x1c')];var _0xd475ef=_0x71a054?0x0:_0x51941a['offset'];var _0x5a8751=_0x71a054?_0x3a646c[_0xffce('0x1c')]:_0x51941a[_0xffce('0x1a')]+_0x51941a[_0xffce('0x1d')];var _0x37ad20;if(_0x5a8751>=_0x31a112){_0x5a8751=_0x31a112;_0x37ad20=0xc8;}else{_0x37ad20=0xce;}_0x2c9bac[_0xffce('0x18')](_0x37ad20);return _0x2c9bac['set'](_0xffce('0x1e'),_0xd475ef+'-'+_0x5a8751+'/'+_0x31a112)[_0xffce('0x1f')](_0x3a646c);}return null;};}function patchUpdates(_0x46daab){return function(_0x43a9b0){try{jsonpatch[_0xffce('0x20')](_0x43a9b0,_0x46daab,!![]);}catch(_0x3e9428){return BPromise[_0xffce('0x21')](_0x3e9428);}return _0x43a9b0['save']();};}function saveUpdates(_0x4bd9c3,_0x200705){return function(_0x1be721){if(_0x1be721){return _0x1be721[_0xffce('0x22')](_0x4bd9c3)[_0xffce('0x23')](function(_0x2f85ea){return _0x2f85ea;});}return null;};}function removeEntity(_0x5e14ba,_0x1c6943){return function(_0x989d97){if(_0x989d97){return _0x989d97['destroy']()[_0xffce('0x23')](function(){var _0x10bae4=_0x989d97[_0xffce('0x24')]({'plain':!![]});var _0x71a4e0=_0xffce('0x25');return db[_0xffce('0x26')][_0xffce('0x27')]({'where':{'type':_0x71a4e0,'resourceId':_0x10bae4['id']}})[_0xffce('0x23')](function(){return _0x989d97;});})[_0xffce('0x23')](function(){_0x5e14ba[_0xffce('0x18')](0xcc)[_0xffce('0x19')]();});}};}function handleEntityNotFound(_0x2d554f,_0x3fab6f){return function(_0x497fe1){if(!_0x497fe1){_0x2d554f['sendStatus'](0x194);}return _0x497fe1;};}function handleError(_0x28b040,_0x17baed){_0x17baed=_0x17baed||0x1f4;return function(_0x2ecfac){logger[_0xffce('0x28')](_0x2ecfac['stack']);if(_0x2ecfac[_0xffce('0x29')]){delete _0x2ecfac[_0xffce('0x29')];}_0x28b040[_0xffce('0x18')](_0x17baed)[_0xffce('0x2a')](_0x2ecfac);};}exports[_0xffce('0x2b')]=function(_0x2cb51c,_0x12ea95){var _0x3230ed={},_0x1a36d9={},_0x11255b={'count':0x0,'rows':[]};var _0xfb329c=_[_0xffce('0x2c')](db[_0xffce('0x2d')][_0xffce('0x2e')],function(_0xfc8473){return{'name':_0xfc8473[_0xffce('0x2f')],'type':_0xfc8473['type'][_0xffce('0x30')]};});_0x1a36d9[_0xffce('0x31')]=_[_0xffce('0x2c')](_0xfb329c,_0xffce('0x29'));_0x1a36d9[_0xffce('0x32')]=_[_0xffce('0x33')](_0x2cb51c['query']);_0x1a36d9['filters']=_['intersection'](_0x1a36d9['model'],_0x1a36d9[_0xffce('0x32')]);_0x3230ed[_0xffce('0x34')]=_['intersection'](_0x1a36d9[_0xffce('0x31')],qs[_0xffce('0x35')](_0x2cb51c['query']['fields']));_0x3230ed[_0xffce('0x34')]=_0x3230ed['attributes'][_0xffce('0x36')]?_0x3230ed['attributes']:_0x1a36d9[_0xffce('0x31')];if(!_0x2cb51c[_0xffce('0x32')][_0xffce('0x37')]('nolimit')){_0x3230ed[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0x2cb51c['query'][_0xffce('0x1d')]);_0x3230ed[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0x2cb51c[_0xffce('0x32')][_0xffce('0x1a')]);}_0x3230ed[_0xffce('0x38')]=qs['sort'](_0x2cb51c[_0xffce('0x32')][_0xffce('0x39')]);_0x3230ed[_0xffce('0x3a')]=qs['filters'](_[_0xffce('0x3b')](_0x2cb51c[_0xffce('0x32')],_0x1a36d9['filters']),_0xfb329c);if(_0x2cb51c[_0xffce('0x32')][_0xffce('0x3c')]){_0x3230ed['where']=_[_0xffce('0x3d')](_0x3230ed['where'],{'$or':_['map'](_0xfb329c,function(_0xd6df69){if(_0xd6df69[_0xffce('0x3e')]!==_0xffce('0x3f')){var _0x518e76={};_0x518e76[_0xd6df69[_0xffce('0x29')]]={'$like':'%'+_0x2cb51c[_0xffce('0x32')][_0xffce('0x3c')]+'%'};return _0x518e76;}})});}_0x3230ed=_[_0xffce('0x3d')]({},_0x3230ed,_0x2cb51c[_0xffce('0x40')]);var _0x5a6c9a={'where':_0x3230ed[_0xffce('0x3a')]};return db[_0xffce('0x2d')][_0xffce('0x1c')](_0x5a6c9a)[_0xffce('0x23')](function(_0x589cf0){_0x11255b[_0xffce('0x1c')]=_0x589cf0;if(_0x2cb51c[_0xffce('0x32')][_0xffce('0x41')]){_0x3230ed['include']=[{'all':!![]}];}return db[_0xffce('0x2d')]['findAll'](_0x3230ed);})[_0xffce('0x23')](function(_0x271cab){_0x11255b[_0xffce('0x42')]=_0x271cab;return _0x11255b;})['then'](respondWithFilteredResult(_0x12ea95,_0x3230ed))['catch'](handleError(_0x12ea95,null));};exports[_0xffce('0x43')]=function(_0x2497d1,_0x2abfb7){var _0x3b9f9a={'raw':![],'where':{'id':_0x2497d1['params']['id']}},_0x323f78={};_0x323f78[_0xffce('0x31')]=_['keys'](db[_0xffce('0x2d')][_0xffce('0x2e')]);_0x323f78['query']=_[_0xffce('0x33')](_0x2497d1[_0xffce('0x32')]);_0x323f78[_0xffce('0x44')]=_['intersection'](_0x323f78[_0xffce('0x31')],_0x323f78[_0xffce('0x32')]);_0x3b9f9a[_0xffce('0x34')]=_[_0xffce('0x45')](_0x323f78[_0xffce('0x31')],qs[_0xffce('0x35')](_0x2497d1['query'][_0xffce('0x35')]));_0x3b9f9a['attributes']=_0x3b9f9a[_0xffce('0x34')][_0xffce('0x36')]?_0x3b9f9a[_0xffce('0x34')]:_0x323f78[_0xffce('0x31')];if(_0x2497d1[_0xffce('0x32')][_0xffce('0x41')]){_0x3b9f9a[_0xffce('0x46')]=[{'all':!![]}];}_0x3b9f9a=_[_0xffce('0x3d')]({},_0x3b9f9a,_0x2497d1[_0xffce('0x40')]);return db['Campaign'][_0xffce('0x47')](_0x3b9f9a)['then'](handleEntityNotFound(_0x2abfb7,null))[_0xffce('0x23')](respondWithResult(_0x2abfb7,null))[_0xffce('0x48')](handleError(_0x2abfb7,null));};exports[_0xffce('0x49')]=function(_0x13376e,_0x477947){return db[_0xffce('0x2d')][_0xffce('0x49')](_0x13376e['body'],{})[_0xffce('0x23')](function(_0x321443){var _0x19a0cf=_0x13376e[_0xffce('0x4a')]['get']({'plain':!![]});if(!_0x19a0cf)throw new Error(_0xffce('0x4b'));if(_0x19a0cf[_0xffce('0x4c')]==='user'){var _0x816855=_0x321443[_0xffce('0x24')]({'plain':!![]});var _0x1b90b7=_0xffce('0x25');return db[_0xffce('0x4d')]['find']({'where':{'name':_0x1b90b7,'userProfileId':_0x19a0cf[_0xffce('0x4e')]},'raw':!![]})[_0xffce('0x23')](function(_0x40a15e){if(_0x40a15e&&_0x40a15e[_0xffce('0x4f')]===0x0){return db[_0xffce('0x26')]['create']({'name':_0x816855[_0xffce('0x29')],'resourceId':_0x816855['id'],'type':_0x40a15e['name'],'sectionId':_0x40a15e['id']},{})['then'](function(){return _0x321443;});}else{return _0x321443;}})[_0xffce('0x48')](function(_0x558853){logger[_0xffce('0x28')](_0xffce('0x50'),_0x558853);throw _0x558853;});}return _0x321443;})[_0xffce('0x23')](respondWithResult(_0x477947,0xc9))[_0xffce('0x48')](handleError(_0x477947,null));};exports['clone']=function(_0x188856,_0x1a37cc){var _0x1e8e49={'where':{'id':_0x188856['params']['id']}},_0x3cda59={};_0x3cda59[_0xffce('0x31')]=_[_0xffce('0x33')](db[_0xffce('0x2d')][_0xffce('0x2e')]);_0x1e8e49[_0xffce('0x34')]=_[_0xffce('0x45')](_0x3cda59[_0xffce('0x31')],qs[_0xffce('0x35')](_0x188856['query'][_0xffce('0x35')]));_0x1e8e49['attributes']=_0x1e8e49[_0xffce('0x34')]['length']?_0x1e8e49[_0xffce('0x34')]:_0x3cda59['model'];if(_0x188856['query'][_0xffce('0x41')]){_0x1e8e49[_0xffce('0x46')]=[{'all':!![]}];}_0x1e8e49=_[_0xffce('0x3d')]({},_0x1e8e49,_0x188856[_0xffce('0x40')]);return db[_0xffce('0x2d')][_0xffce('0x47')](_0x1e8e49)[_0xffce('0x23')](handleEntityNotFound(_0x1a37cc,null))[_0xffce('0x23')](function(_0x18bfe0){if(_0x18bfe0){var _0x5ab159=_0x18bfe0[_0xffce('0x24')]({'plain':!![]});_0x5ab159=qs['omit'](_0x5ab159,['id','createdAt',_0xffce('0x51')]);_0x188856['body']=_[_0xffce('0x52')](_0x188856[_0xffce('0x53')],['id','createdAt','updatedAt']);return db[_0xffce('0x2d')]['create'](_[_0xffce('0x3d')](_0x5ab159,_0x188856[_0xffce('0x53')]),{'include':_0x188856[_0xffce('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x21f959){var _0xa47ca9=_0x188856[_0xffce('0x4a')][_0xffce('0x24')]({'plain':!![]});if(!_0xa47ca9)throw new Error(_0xffce('0x4b'));if(_0xa47ca9[_0xffce('0x4c')]===_0xffce('0x4a')){var _0x9699d3=_0x21f959[_0xffce('0x24')]({'plain':!![]});var _0x1a70e6=_0xffce('0x25');return db[_0xffce('0x4d')][_0xffce('0x47')]({'where':{'name':_0x1a70e6,'userProfileId':_0xa47ca9[_0xffce('0x4e')]},'raw':!![]})[_0xffce('0x23')](function(_0x10b737){if(_0x10b737&&_0x10b737[_0xffce('0x4f')]===0x0){return db[_0xffce('0x26')]['create']({'name':_0x9699d3[_0xffce('0x29')],'resourceId':_0x9699d3['id'],'type':_0x10b737[_0xffce('0x29')],'sectionId':_0x10b737['id']},{})[_0xffce('0x23')](function(){return _0x21f959;});}else{return _0x21f959;}})['catch'](function(_0x820599){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x820599);throw _0x820599;});}return _0x21f959;});}})[_0xffce('0x23')](respondWithResult(_0x1a37cc,0xc9))[_0xffce('0x48')](handleError(_0x1a37cc,null));};exports['update']=function(_0x539660,_0x148d99){if(_0x539660[_0xffce('0x53')]['id']){delete _0x539660['body']['id'];}return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x539660[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x148d99,null))[_0xffce('0x23')](saveUpdates(_0x539660['body'],null))['then'](respondWithResult(_0x148d99,null))[_0xffce('0x48')](handleError(_0x148d99,null));};exports['destroy']=function(_0x40da1,_0x5a3271){return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x40da1[_0xffce('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a3271,null))['then'](removeEntity(_0x5a3271,null))[_0xffce('0x48')](handleError(_0x5a3271,null));};exports['getHoppers']=function(_0x138156,_0x4e3fed,_0x5e8df5){var _0x329dd7={'raw':!![],'where':{}};var _0x26d8d1={};var _0x1f50a9={'count':0x0,'rows':[]};return db[_0xffce('0x2d')][_0xffce('0x55')]({'where':{'id':_0x138156['params']['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x4e3fed,null))[_0xffce('0x23')](function(_0x33f21a){if(_0x33f21a){_0x26d8d1[_0xffce('0x31')]=_['keys'](db['CmHopper'][_0xffce('0x2e')]);_0x26d8d1[_0xffce('0x32')]=_['keys'](_0x138156[_0xffce('0x32')]);_0x26d8d1['filters']=_[_0xffce('0x45')](_0x26d8d1[_0xffce('0x31')],_0x26d8d1['query']);_0x329dd7[_0xffce('0x34')]=_[_0xffce('0x45')](_0x26d8d1['model'],qs[_0xffce('0x35')](_0x138156[_0xffce('0x32')][_0xffce('0x35')]));_0x329dd7[_0xffce('0x34')]=_0x329dd7['attributes']['length']?_0x329dd7['attributes']:_0x26d8d1[_0xffce('0x31')];if(!_0x138156[_0xffce('0x32')][_0xffce('0x37')](_0xffce('0x56'))){_0x329dd7[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0x138156[_0xffce('0x32')][_0xffce('0x1d')]);_0x329dd7['offset']=qs['offset'](_0x138156['query'][_0xffce('0x1a')]);}_0x329dd7['order']=qs['sort'](_0x138156[_0xffce('0x32')][_0xffce('0x39')]);_0x329dd7[_0xffce('0x3a')]=qs[_0xffce('0x44')](_['pick'](_0x138156[_0xffce('0x32')],_0x26d8d1[_0xffce('0x44')]));_0x329dd7[_0xffce('0x3a')][_0xffce('0x57')]=_0x33f21a['id'];if(_0x138156['query'][_0xffce('0x3c')]){_0x329dd7[_0xffce('0x3a')]=_['merge'](_0x329dd7['where'],{'$or':_[_0xffce('0x2c')](_0x329dd7[_0xffce('0x34')],function(_0x5e6d39){var _0x4af4e3={};_0x4af4e3[_0x5e6d39]={'$like':'%'+_0x138156['query'][_0xffce('0x3c')]+'%'};return _0x4af4e3;})});}_0x329dd7=_['merge']({},_0x329dd7,_0x138156[_0xffce('0x40')]);return db[_0xffce('0x58')][_0xffce('0x1c')]({'where':_0x329dd7['where']})[_0xffce('0x23')](function(_0x5c5685){_0x1f50a9[_0xffce('0x1c')]=_0x5c5685;if(_0x138156[_0xffce('0x32')]['includeAll']){_0x329dd7[_0xffce('0x46')]=[{'all':!![]}];}return db[_0xffce('0x58')][_0xffce('0x59')](_0x329dd7);})[_0xffce('0x23')](function(_0xd9272a){_0x1f50a9[_0xffce('0x42')]=_0xd9272a;return _0x1f50a9;});}})[_0xffce('0x23')](respondWithFilteredResult(_0x4e3fed,_0x329dd7))[_0xffce('0x48')](handleError(_0x4e3fed,null));};exports[_0xffce('0x5a')]=function(_0xacb476,_0x40ba7f,_0x16ff46){var _0x51e531={'raw':!![],'where':{}};var _0x1ff0b0={};var _0x2690a7={'count':0x0,'rows':[]};return db[_0xffce('0x2d')][_0xffce('0x55')]({'where':{'id':_0xacb476['params']['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x40ba7f,null))[_0xffce('0x23')](function(_0x3f08b7){if(_0x3f08b7){_0x1ff0b0[_0xffce('0x31')]=_[_0xffce('0x33')](db['CmHopperHistory'][_0xffce('0x2e')]);_0x1ff0b0[_0xffce('0x32')]=_[_0xffce('0x33')](_0xacb476[_0xffce('0x32')]);_0x1ff0b0[_0xffce('0x44')]=_['intersection'](_0x1ff0b0[_0xffce('0x31')],_0x1ff0b0[_0xffce('0x32')]);_0x51e531[_0xffce('0x34')]=_[_0xffce('0x45')](_0x1ff0b0[_0xffce('0x31')],qs['fields'](_0xacb476[_0xffce('0x32')][_0xffce('0x35')]));_0x51e531[_0xffce('0x34')]=_0x51e531[_0xffce('0x34')]['length']?_0x51e531[_0xffce('0x34')]:_0x1ff0b0[_0xffce('0x31')];if(!_0xacb476['query'][_0xffce('0x37')](_0xffce('0x56'))){_0x51e531[_0xffce('0x1d')]=qs['limit'](_0xacb476[_0xffce('0x32')][_0xffce('0x1d')]);_0x51e531[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0xacb476[_0xffce('0x32')]['offset']);}_0x51e531[_0xffce('0x38')]=qs[_0xffce('0x39')](_0xacb476[_0xffce('0x32')]['sort']);_0x51e531[_0xffce('0x3a')]=qs[_0xffce('0x44')](_['pick'](_0xacb476[_0xffce('0x32')],_0x1ff0b0[_0xffce('0x44')]));_0x51e531[_0xffce('0x3a')][_0xffce('0x57')]=_0x3f08b7['id'];if(_0xacb476[_0xffce('0x32')]['filter']){_0x51e531[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0x51e531[_0xffce('0x3a')],{'$or':_['map'](_0x51e531[_0xffce('0x34')],function(_0x5e8480){var _0x4974de={};_0x4974de[_0x5e8480]={'$like':'%'+_0xacb476[_0xffce('0x32')]['filter']+'%'};return _0x4974de;})});}_0x51e531=_[_0xffce('0x3d')]({},_0x51e531,_0xacb476[_0xffce('0x40')]);return db['CmHopperHistory']['count']({'where':_0x51e531['where']})[_0xffce('0x23')](function(_0x1657f8){_0x2690a7['count']=_0x1657f8;if(_0xacb476['query'][_0xffce('0x41')]){_0x51e531[_0xffce('0x46')]=[{'all':!![]}];}return db[_0xffce('0x5b')][_0xffce('0x59')](_0x51e531);})['then'](function(_0xbaac4c){_0x2690a7['rows']=_0xbaac4c;return _0x2690a7;});}})[_0xffce('0x23')](respondWithFilteredResult(_0x40ba7f,_0x51e531))['catch'](handleError(_0x40ba7f,null));};exports[_0xffce('0x5c')]=function(_0x36e60f,_0x9387f2,_0x408b21){var _0xebefea={'raw':!![],'where':{}};var _0x2d55ea={};var _0x372f94={'count':0x0,'rows':[]};return db['Campaign'][_0xffce('0x55')]({'where':{'id':_0x36e60f[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x9387f2,null))[_0xffce('0x23')](function(_0x5a1a24){if(_0x5a1a24){_0x2d55ea[_0xffce('0x31')]=_[_0xffce('0x33')](db['CmHopperFinal'][_0xffce('0x2e')]);_0x2d55ea[_0xffce('0x32')]=_[_0xffce('0x33')](_0x36e60f['query']);_0x2d55ea[_0xffce('0x44')]=_['intersection'](_0x2d55ea[_0xffce('0x31')],_0x2d55ea[_0xffce('0x32')]);_0xebefea[_0xffce('0x34')]=_[_0xffce('0x45')](_0x2d55ea[_0xffce('0x31')],qs['fields'](_0x36e60f[_0xffce('0x32')][_0xffce('0x35')]));_0xebefea['attributes']=_0xebefea[_0xffce('0x34')][_0xffce('0x36')]?_0xebefea[_0xffce('0x34')]:_0x2d55ea[_0xffce('0x31')];if(!_0x36e60f[_0xffce('0x32')][_0xffce('0x37')](_0xffce('0x56'))){_0xebefea['limit']=qs[_0xffce('0x1d')](_0x36e60f[_0xffce('0x32')]['limit']);_0xebefea[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0x36e60f[_0xffce('0x32')][_0xffce('0x1a')]);}_0xebefea[_0xffce('0x38')]=qs[_0xffce('0x39')](_0x36e60f[_0xffce('0x32')]['sort']);_0xebefea[_0xffce('0x3a')]=qs[_0xffce('0x44')](_[_0xffce('0x3b')](_0x36e60f[_0xffce('0x32')],_0x2d55ea[_0xffce('0x44')]));_0xebefea[_0xffce('0x3a')][_0xffce('0x57')]=_0x5a1a24['id'];if(_0x36e60f[_0xffce('0x32')][_0xffce('0x3c')]){_0xebefea[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0xebefea[_0xffce('0x3a')],{'$or':_[_0xffce('0x2c')](_0xebefea[_0xffce('0x34')],function(_0xec8e67){var _0xdafbe6={};_0xdafbe6[_0xec8e67]={'$like':'%'+_0x36e60f[_0xffce('0x32')]['filter']+'%'};return _0xdafbe6;})});}_0xebefea=_['merge']({},_0xebefea,_0x36e60f[_0xffce('0x40')]);return db[_0xffce('0x5d')]['count']({'where':_0xebefea['where']})['then'](function(_0x25a9d2){_0x372f94[_0xffce('0x1c')]=_0x25a9d2;if(_0x36e60f[_0xffce('0x32')][_0xffce('0x41')]){_0xebefea[_0xffce('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xffce('0x59')](_0xebefea);})['then'](function(_0x13a07c){_0x372f94[_0xffce('0x42')]=_0x13a07c;return _0x372f94;});}})['then'](respondWithFilteredResult(_0x9387f2,_0xebefea))['catch'](handleError(_0x9387f2,null));};exports[_0xffce('0x5e')]=function(_0x447e2a,_0xb624ed,_0x33ed9b){var _0x5c0dc3={'raw':!![],'where':{}};var _0x7f9361={};var _0x4f1091={'count':0x0,'rows':[]};return db[_0xffce('0x2d')][_0xffce('0x55')]({'where':{'id':_0x447e2a[_0xffce('0x54')]['id']}})['then'](handleEntityNotFound(_0xb624ed,null))[_0xffce('0x23')](function(_0x2957ca){if(_0x2957ca){_0x7f9361[_0xffce('0x31')]=_[_0xffce('0x33')](db[_0xffce('0x5f')][_0xffce('0x2e')]);_0x7f9361['query']=_[_0xffce('0x33')](_0x447e2a[_0xffce('0x32')]);_0x7f9361[_0xffce('0x44')]=_[_0xffce('0x45')](_0x7f9361[_0xffce('0x31')],_0x7f9361[_0xffce('0x32')]);_0x5c0dc3[_0xffce('0x34')]=_['intersection'](_0x7f9361[_0xffce('0x31')],qs['fields'](_0x447e2a['query'][_0xffce('0x35')]));_0x5c0dc3[_0xffce('0x34')]=_0x5c0dc3['attributes'][_0xffce('0x36')]?_0x5c0dc3[_0xffce('0x34')]:_0x7f9361[_0xffce('0x31')];if(!_0x447e2a['query']['hasOwnProperty'](_0xffce('0x56'))){_0x5c0dc3[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0x447e2a[_0xffce('0x32')][_0xffce('0x1d')]);_0x5c0dc3[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0x447e2a[_0xffce('0x32')]['offset']);}_0x5c0dc3['order']=qs['sort'](_0x447e2a[_0xffce('0x32')][_0xffce('0x39')]);_0x5c0dc3[_0xffce('0x3a')]=qs[_0xffce('0x44')](_[_0xffce('0x3b')](_0x447e2a[_0xffce('0x32')],_0x7f9361[_0xffce('0x44')]));_0x5c0dc3[_0xffce('0x3a')][_0xffce('0x57')]=_0x2957ca['id'];if(_0x447e2a[_0xffce('0x32')]['filter']){_0x5c0dc3[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0x5c0dc3[_0xffce('0x3a')],{'$or':_[_0xffce('0x2c')](_0x5c0dc3[_0xffce('0x34')],function(_0x3e3c67){var _0x1ca0d6={};_0x1ca0d6[_0x3e3c67]={'$like':'%'+_0x447e2a['query']['filter']+'%'};return _0x1ca0d6;})});}_0x5c0dc3=_[_0xffce('0x3d')]({},_0x5c0dc3,_0x447e2a[_0xffce('0x40')]);return db['CmHopperBlack'][_0xffce('0x1c')]({'where':_0x5c0dc3[_0xffce('0x3a')]})[_0xffce('0x23')](function(_0x4c691e){_0x4f1091[_0xffce('0x1c')]=_0x4c691e;if(_0x447e2a['query'][_0xffce('0x41')]){_0x5c0dc3[_0xffce('0x46')]=[{'all':!![]}];}return db[_0xffce('0x5f')][_0xffce('0x59')](_0x5c0dc3);})[_0xffce('0x23')](function(_0x193731){_0x4f1091['rows']=_0x193731;return _0x4f1091;});}})['then'](respondWithFilteredResult(_0xb624ed,_0x5c0dc3))[_0xffce('0x48')](handleError(_0xb624ed,null));};exports[_0xffce('0x60')]=function(_0x1c8f16,_0x59f60b,_0x3f8cfb){var _0x4c9fdb={};var _0x5a296f={};var _0x1222ba;var _0x4276a1;return db[_0xffce('0x2d')]['findOne']({'where':{'id':_0x1c8f16[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x59f60b,null))[_0xffce('0x23')](function(_0x39e1dd){if(_0x39e1dd){_0x1222ba=_0x39e1dd;_0x5a296f[_0xffce('0x31')]=_[_0xffce('0x33')](db[_0xffce('0x61')][_0xffce('0x2e')]);_0x5a296f[_0xffce('0x32')]=_[_0xffce('0x33')](_0x1c8f16[_0xffce('0x32')]);_0x5a296f['filters']=_['intersection'](_0x5a296f[_0xffce('0x31')],_0x5a296f[_0xffce('0x32')]);_0x4c9fdb[_0xffce('0x34')]=_[_0xffce('0x45')](_0x5a296f[_0xffce('0x31')],qs[_0xffce('0x35')](_0x1c8f16[_0xffce('0x32')]['fields']));_0x4c9fdb[_0xffce('0x34')]=_0x4c9fdb['attributes'][_0xffce('0x36')]?_0x4c9fdb[_0xffce('0x34')]:_0x5a296f['model'];_0x4c9fdb[_0xffce('0x38')]=qs[_0xffce('0x39')](_0x1c8f16['query']['sort']);_0x4c9fdb[_0xffce('0x3a')]=qs[_0xffce('0x44')](_['pick'](_0x1c8f16[_0xffce('0x32')],_0x5a296f[_0xffce('0x44')]));if(_0x1c8f16['query'][_0xffce('0x3c')]){_0x4c9fdb[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0x4c9fdb[_0xffce('0x3a')],{'$or':_[_0xffce('0x2c')](_0x4c9fdb[_0xffce('0x34')],function(_0x401ed5){var _0x5e894a={};_0x5e894a[_0x401ed5]={'$like':'%'+_0x1c8f16[_0xffce('0x32')][_0xffce('0x3c')]+'%'};return _0x5e894a;})});}_0x4c9fdb=_[_0xffce('0x3d')]({},_0x4c9fdb,_0x1c8f16[_0xffce('0x40')]);return _0x1222ba[_0xffce('0x60')](_0x4c9fdb);}})[_0xffce('0x23')](function(_0x54aa10){if(_0x54aa10){_0x4276a1=_0x54aa10[_0xffce('0x36')];if(!_0x1c8f16[_0xffce('0x32')][_0xffce('0x37')](_0xffce('0x56'))){_0x4c9fdb[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0x1c8f16[_0xffce('0x32')]['limit']);_0x4c9fdb[_0xffce('0x1a')]=qs['offset'](_0x1c8f16[_0xffce('0x32')][_0xffce('0x1a')]);}return _0x1222ba[_0xffce('0x60')](_0x4c9fdb);}})[_0xffce('0x23')](function(_0x244ec3){if(_0x244ec3){return _0x244ec3?{'count':_0x4276a1,'rows':_0x244ec3}:null;}})[_0xffce('0x23')](respondWithResult(_0x59f60b,null))[_0xffce('0x48')](handleError(_0x59f60b,null));};exports[_0xffce('0x62')]=function(_0x8d89c7,_0xe12ac0,_0x2d0a6e){var _0x473b81,_0x49b9b4;return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x8d89c7[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0xe12ac0,null))['then'](function(_0x3d5e1d){if(_0x3d5e1d){_0x49b9b4=_0x3d5e1d;return _0x3d5e1d[_0xffce('0x62')](_0x8d89c7[_0xffce('0x53')]['ids'],_[_0xffce('0x52')](_0x8d89c7['body'],[_0xffce('0x63'),'id'])||{});}return null;})[_0xffce('0x64')](function(_0xb3384f){var _0x2be7cd;_0x473b81=_0xb3384f||[];var _0x1dbc20=[];if(_0xb3384f){for(var _0x53af64=0x0;_0x53af64<_0xb3384f['length'];_0x53af64+=0x1){var _0x2cf5eb=_0xb3384f[_0x53af64][_0xffce('0x24')]({'plain':!![]});_0x49b9b4['dialCheckDuplicateType']=_0x8d89c7['body']['dialCheckDuplicateType']?_0x8d89c7[_0xffce('0x53')][_0xffce('0x65')]:_0x49b9b4[_0xffce('0x65')];switch(_0x49b9b4['dialCheckDuplicateType']){case _0xffce('0x66'):_0x2be7cd=squel[_0xffce('0x67')]()[_0xffce('0x68')]('cm_hopper')[_0xffce('0x69')]([_0xffce('0x6a'),_0xffce('0x6b'),_0xffce('0x6c'),_0xffce('0x6d'),_0xffce('0x57'),_0xffce('0x6e'),_0xffce('0x51')],squel['select']()['field'](_0xffce('0x6a'),_0xffce('0x6a'))['field'](_0xffce('0x6f'),_0xffce('0x6b'))[_0xffce('0x70')]('id',_0xffce('0x6c'))['field'](_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')](),_0xffce('0x6d'))[_0xffce('0x70')](_0x8d89c7[_0xffce('0x54')]['id']['toString'](),'CampaignId')[_0xffce('0x70')]('NOW()',_0xffce('0x6e'))['field']('NOW()',_0xffce('0x51'))[_0xffce('0x73')](_0xffce('0x74'))[_0xffce('0x3a')](_0xffce('0x75'))[_0xffce('0x3a')](_0xffce('0x76'),_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')]())['where'](_0xffce('0x77'))[_0xffce('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xffce('0x70')](_0xffce('0x78'))['from'](_0xffce('0x79'))['where'](_0xffce('0x7a'),_0x8d89c7['params']['id'][_0xffce('0x72')]()))[_0xffce('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xffce('0x7b')]()['field'](_0xffce('0x7c'))[_0xffce('0x73')](_0xffce('0x7d'))[_0xffce('0x3a')]('CampaignId\x20=\x20?',_0x8d89c7['params']['id'][_0xffce('0x72')]())))[_0xffce('0x72')]();break;case'onlyIfOpen':_0x2be7cd=squel[_0xffce('0x67')]()['into'](_0xffce('0x7d'))[_0xffce('0x69')]([_0xffce('0x6a'),_0xffce('0x6b'),_0xffce('0x6c'),'ListId','CampaignId','createdAt',_0xffce('0x51')],squel[_0xffce('0x7b')]()[_0xffce('0x70')](_0xffce('0x6a'),_0xffce('0x6a'))['field'](_0xffce('0x6f'),_0xffce('0x6b'))['field']('id',_0xffce('0x6c'))[_0xffce('0x70')](_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')](),_0xffce('0x6d'))[_0xffce('0x70')](_0x8d89c7[_0xffce('0x54')]['id'][_0xffce('0x72')](),'CampaignId')[_0xffce('0x70')](_0xffce('0x6f'),_0xffce('0x6e'))[_0xffce('0x70')]('NOW()',_0xffce('0x51'))[_0xffce('0x73')]('cm_contacts')[_0xffce('0x3a')](_0xffce('0x75'))['where'](_0xffce('0x76'),_0x2cf5eb['CmListId']['toString']())[_0xffce('0x3a')](_0xffce('0x77'))[_0xffce('0x3a')](_0xffce('0x7e'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xffce('0x73')](_0xffce('0x7d'))[_0xffce('0x3a')](_0xffce('0x7a'),_0x8d89c7['params']['id'][_0xffce('0x72')]())))[_0xffce('0x72')]();break;default:_0x2be7cd=squel[_0xffce('0x67')]()['into'](_0xffce('0x7d'))[_0xffce('0x69')]([_0xffce('0x6a'),_0xffce('0x6b'),_0xffce('0x6c'),'ListId',_0xffce('0x57'),_0xffce('0x6e'),'updatedAt'],squel[_0xffce('0x7b')]()[_0xffce('0x70')](_0xffce('0x6a'),_0xffce('0x6a'))[_0xffce('0x70')](_0xffce('0x6f'),_0xffce('0x6b'))[_0xffce('0x70')]('id',_0xffce('0x6c'))[_0xffce('0x70')](_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')](),_0xffce('0x6d'))[_0xffce('0x70')](_0x8d89c7[_0xffce('0x54')]['id'][_0xffce('0x72')](),'CampaignId')[_0xffce('0x70')](_0xffce('0x6f'),_0xffce('0x6e'))[_0xffce('0x70')]('NOW()',_0xffce('0x51'))[_0xffce('0x73')]('cm_contacts')[_0xffce('0x3a')](_0xffce('0x75'))[_0xffce('0x3a')](_0xffce('0x76'),_0x2cf5eb[_0xffce('0x71')][_0xffce('0x72')]())[_0xffce('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xffce('0x72')]();}_0x1dbc20[_0xffce('0x7f')](db['sequelize'][_0xffce('0x32')](_0x2be7cd));}return BPromise['all'](_0x1dbc20);}})[_0xffce('0x23')](function(){return _0x473b81;})[_0xffce('0x23')](respondWithResult(_0xe12ac0,null))[_0xffce('0x48')](handleError(_0xe12ac0,null));};exports[_0xffce('0x80')]=function(_0xe4b627,_0x1c61ce,_0x3e169b){return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0xe4b627['params']['id']}})['then'](handleEntityNotFound(_0x1c61ce,null))['then'](function(_0x3f5861){if(_0x3f5861){return _0x3f5861[_0xffce('0x80')](_0xe4b627[_0xffce('0x32')][_0xffce('0x63')]);}})[_0xffce('0x23')](function(_0xd3298e){if(_0xd3298e){return db[_0xffce('0x58')][_0xffce('0x27')]({'where':{'ListId':_0xe4b627[_0xffce('0x32')][_0xffce('0x63')],'CampaignId':_0xe4b627[_0xffce('0x54')]['id']}})[_0xffce('0x23')](function(){return _0xd3298e;});}})[_0xffce('0x23')](respondWithStatusCode(_0x1c61ce,null))['catch'](handleError(_0x1c61ce,null));};exports['getBlackLists']=function(_0xd20b55,_0x37c68c,_0x578cea){var _0x59daf8={};var _0x455918={};var _0x3f5cc6;var _0xe61f73;return db[_0xffce('0x2d')][_0xffce('0x55')]({'where':{'id':_0xd20b55[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x37c68c,null))[_0xffce('0x23')](function(_0x4a77fb){if(_0x4a77fb){_0x3f5cc6=_0x4a77fb;_0x455918[_0xffce('0x31')]=_[_0xffce('0x33')](db['CmList'][_0xffce('0x2e')]);_0x455918['query']=_['keys'](_0xd20b55[_0xffce('0x32')]);_0x455918[_0xffce('0x44')]=_[_0xffce('0x45')](_0x455918[_0xffce('0x31')],_0x455918['query']);_0x59daf8[_0xffce('0x34')]=_[_0xffce('0x45')](_0x455918['model'],qs[_0xffce('0x35')](_0xd20b55[_0xffce('0x32')][_0xffce('0x35')]));_0x59daf8[_0xffce('0x34')]=_0x59daf8['attributes'][_0xffce('0x36')]?_0x59daf8[_0xffce('0x34')]:_0x455918['model'];_0x59daf8[_0xffce('0x38')]=qs[_0xffce('0x39')](_0xd20b55[_0xffce('0x32')][_0xffce('0x39')]);_0x59daf8[_0xffce('0x3a')]=qs[_0xffce('0x44')](_[_0xffce('0x3b')](_0xd20b55[_0xffce('0x32')],_0x455918[_0xffce('0x44')]));if(_0xd20b55[_0xffce('0x32')]['filter']){_0x59daf8[_0xffce('0x3a')]=_[_0xffce('0x3d')](_0x59daf8[_0xffce('0x3a')],{'$or':_[_0xffce('0x2c')](_0x59daf8[_0xffce('0x34')],function(_0x173b37){var _0xdb8e19={};_0xdb8e19[_0x173b37]={'$like':'%'+_0xd20b55[_0xffce('0x32')][_0xffce('0x3c')]+'%'};return _0xdb8e19;})});}_0x59daf8=_[_0xffce('0x3d')]({},_0x59daf8,_0xd20b55['options']);return _0x3f5cc6['getBlackLists'](_0x59daf8);}})[_0xffce('0x23')](function(_0x57461f){if(_0x57461f){_0xe61f73=_0x57461f[_0xffce('0x36')];if(!_0xd20b55[_0xffce('0x32')]['hasOwnProperty']('nolimit')){_0x59daf8[_0xffce('0x1d')]=qs[_0xffce('0x1d')](_0xd20b55[_0xffce('0x32')]['limit']);_0x59daf8[_0xffce('0x1a')]=qs[_0xffce('0x1a')](_0xd20b55[_0xffce('0x32')][_0xffce('0x1a')]);}return _0x3f5cc6['getBlackLists'](_0x59daf8);}})['then'](function(_0x54a6cc){if(_0x54a6cc){return _0x54a6cc?{'count':_0xe61f73,'rows':_0x54a6cc}:null;}})[_0xffce('0x23')](respondWithResult(_0x37c68c,null))[_0xffce('0x48')](handleError(_0x37c68c,null));};exports[_0xffce('0x81')]=function(_0x128a3d,_0x2835b1,_0xed7541){var _0x44418f,_0x5e284a;return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x128a3d[_0xffce('0x54')]['id']}})['then'](handleEntityNotFound(_0x2835b1,null))[_0xffce('0x23')](function(_0x21726e){if(_0x21726e){_0x5e284a=_0x21726e;return _0x21726e[_0xffce('0x81')](_0x128a3d[_0xffce('0x53')][_0xffce('0x63')],_[_0xffce('0x52')](_0x128a3d['body'],['ids','id'])||{});}return null;})['spread'](function(_0x28ac72){var _0x5131b8;_0x44418f=_0x28ac72||[];var _0x3996ab=[];if(_0x28ac72){for(var _0x10daa5=0x0;_0x10daa5<_0x28ac72[_0xffce('0x36')];_0x10daa5+=0x1){var _0xa9070a=_0x28ac72[_0x10daa5]['get']({'plain':!![]});_0x5131b8=squel[_0xffce('0x67')]()['into']('cm_hopper_black')[_0xffce('0x69')]([_0xffce('0x6a'),_0xffce('0x6c'),'ListId',_0xffce('0x57'),'createdAt','updatedAt'],squel[_0xffce('0x7b')]()['field'](_0xffce('0x6a'),_0xffce('0x6a'))['field']('id',_0xffce('0x6c'))['field'](_0xa9070a[_0xffce('0x71')][_0xffce('0x72')](),_0xffce('0x6d'))[_0xffce('0x70')](_0x128a3d['params']['id'][_0xffce('0x72')](),_0xffce('0x57'))['field'](_0xffce('0x6f'),_0xffce('0x6e'))[_0xffce('0x70')](_0xffce('0x6f'),'updatedAt')[_0xffce('0x73')](_0xffce('0x74'))[_0xffce('0x3a')](_0xffce('0x75'))[_0xffce('0x3a')](_0xffce('0x76'),_0xa9070a[_0xffce('0x71')]['toString']())[_0xffce('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xffce('0x72')]();_0x3996ab[_0xffce('0x7f')](db[_0xffce('0x82')][_0xffce('0x32')](_0x5131b8));}return BPromise['all'](_0x3996ab);}})[_0xffce('0x23')](function(){return _0x44418f;})[_0xffce('0x23')](respondWithResult(_0x2835b1,null))[_0xffce('0x48')](handleError(_0x2835b1,null));};exports[_0xffce('0x83')]=function(_0x25d4ce,_0x2c35cc,_0x26a773){return db[_0xffce('0x2d')][_0xffce('0x47')]({'where':{'id':_0x25d4ce[_0xffce('0x54')]['id']}})[_0xffce('0x23')](handleEntityNotFound(_0x2c35cc,null))[_0xffce('0x23')](function(_0x88f242){if(_0x88f242){return _0x88f242[_0xffce('0x83')](_0x25d4ce['query']['ids']);}})[_0xffce('0x23')](function(_0x4ad0f0){if(_0x4ad0f0){return db[_0xffce('0x5f')][_0xffce('0x27')]({'where':{'ListId':_0x25d4ce['query']['ids'],'CampaignId':_0x25d4ce[_0xffce('0x54')]['id']}})['then'](function(){return _0x4ad0f0;});}})['then'](respondWithStatusCode(_0x2c35cc,null))[_0xffce('0x48')](handleError(_0x2c35cc,null));};
\ No newline at end of file
+var _0xd5c4=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','save','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','model','map','keys','filters','query','fields','attributes','length','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','hasOwnProperty','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0xf2b35e,_0x1531c7){var _0x38dfc4=function(_0x29fe76){while(--_0x29fe76){_0xf2b35e['push'](_0xf2b35e['shift']());}};_0x38dfc4(++_0x1531c7);}(_0xd5c4,0x80));var _0x4d5c=function(_0x3242e7,_0x43139f){_0x3242e7=_0x3242e7-0x0;var _0x56502d=_0xd5c4[_0x3242e7];return _0x56502d;};'use strict';var emlformat=require(_0x4d5c('0x0'));var rimraf=require(_0x4d5c('0x1'));var zipdir=require(_0x4d5c('0x2'));var jsonpatch=require(_0x4d5c('0x3'));var rp=require(_0x4d5c('0x4'));var moment=require(_0x4d5c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4d5c('0x6'));var util=require(_0x4d5c('0x7'));var path=require(_0x4d5c('0x8'));var sox=require(_0x4d5c('0x9'));var csv=require(_0x4d5c('0xa'));var ejs=require(_0x4d5c('0xb'));var fs=require('fs');var fs_extra=require(_0x4d5c('0xc'));var _=require(_0x4d5c('0xd'));var squel=require(_0x4d5c('0xe'));var crypto=require(_0x4d5c('0xf'));var jsforce=require(_0x4d5c('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d5c('0x11'));var Papa=require('papaparse');var Redis=require(_0x4d5c('0x12'));var authService=require(_0x4d5c('0x13'));var qs=require(_0x4d5c('0x14'));var as=require(_0x4d5c('0x15'));var hardwareService=require(_0x4d5c('0x16'));var logger=require('../../config/logger')(_0x4d5c('0x17'));var utils=require(_0x4d5c('0x18'));var config=require(_0x4d5c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d5c('0x1a'))['db'];function respondWithStatusCode(_0xf62f8f,_0x3d2ae1){_0x3d2ae1=_0x3d2ae1||0xcc;return function(_0x4ad0fc){if(_0x4ad0fc){return _0xf62f8f['sendStatus'](_0x3d2ae1);}return _0xf62f8f[_0x4d5c('0x1b')](_0x3d2ae1)[_0x4d5c('0x1c')]();};}function respondWithResult(_0x5ea36c,_0x588e9d){_0x588e9d=_0x588e9d||0xc8;return function(_0x1e6da0){if(_0x1e6da0){return _0x5ea36c['status'](_0x588e9d)['json'](_0x1e6da0);}};}function respondWithFilteredResult(_0x3e21d6,_0x1321a8){return function(_0x221ff9){if(_0x221ff9){var _0x588b33=typeof _0x1321a8['offset']===_0x4d5c('0x1d')&&typeof _0x1321a8[_0x4d5c('0x1e')]===_0x4d5c('0x1d');var _0x8023a6=_0x221ff9['count'];var _0x1ac965=_0x588b33?0x0:_0x1321a8[_0x4d5c('0x1f')];var _0x39f21f=_0x588b33?_0x221ff9[_0x4d5c('0x20')]:_0x1321a8['offset']+_0x1321a8[_0x4d5c('0x1e')];var _0x288efe;if(_0x39f21f>=_0x8023a6){_0x39f21f=_0x8023a6;_0x288efe=0xc8;}else{_0x288efe=0xce;}_0x3e21d6[_0x4d5c('0x1b')](_0x288efe);return _0x3e21d6[_0x4d5c('0x21')](_0x4d5c('0x22'),_0x1ac965+'-'+_0x39f21f+'/'+_0x8023a6)[_0x4d5c('0x23')](_0x221ff9);}return null;};}function patchUpdates(_0x783a5c){return function(_0x5e5c42){try{jsonpatch[_0x4d5c('0x24')](_0x5e5c42,_0x783a5c,!![]);}catch(_0x10ffa6){return BPromise['reject'](_0x10ffa6);}return _0x5e5c42[_0x4d5c('0x25')]();};}function saveUpdates(_0x137497,_0x575388){return function(_0x1e6a0b){if(_0x1e6a0b){return _0x1e6a0b['update'](_0x137497)['then'](function(_0x1d42fb){return _0x1d42fb;});}return null;};}function removeEntity(_0x48dc11,_0x283e52){return function(_0x5aec09){if(_0x5aec09){return _0x5aec09['destroy']()[_0x4d5c('0x26')](function(){var _0x14e0ba=_0x5aec09[_0x4d5c('0x27')]({'plain':!![]});var _0x4b9cb5=_0x4d5c('0x28');return db[_0x4d5c('0x29')][_0x4d5c('0x2a')]({'where':{'type':_0x4b9cb5,'resourceId':_0x14e0ba['id']}})[_0x4d5c('0x26')](function(){return _0x5aec09;});})[_0x4d5c('0x26')](function(){_0x48dc11[_0x4d5c('0x1b')](0xcc)[_0x4d5c('0x1c')]();});}};}function handleEntityNotFound(_0x5a80fc,_0x3a1480){return function(_0x579998){if(!_0x579998){_0x5a80fc['sendStatus'](0x194);}return _0x579998;};}function handleError(_0x43cd8a,_0xb1963e){_0xb1963e=_0xb1963e||0x1f4;return function(_0x5c43f0){logger[_0x4d5c('0x2b')](_0x5c43f0[_0x4d5c('0x2c')]);if(_0x5c43f0[_0x4d5c('0x2d')]){delete _0x5c43f0[_0x4d5c('0x2d')];}_0x43cd8a['status'](_0xb1963e)[_0x4d5c('0x2e')](_0x5c43f0);};}exports[_0x4d5c('0x2f')]=function(_0x1b114c,_0x56c925){var _0x3495a4={},_0xb723b7={},_0x5df1e5={'count':0x0,'rows':[]};var _0x53b513=_['map'](db['Campaign'][_0x4d5c('0x30')],function(_0x3fb2d1){return{'name':_0x3fb2d1[_0x4d5c('0x31')],'type':_0x3fb2d1['type']['key']};});_0xb723b7[_0x4d5c('0x32')]=_[_0x4d5c('0x33')](_0x53b513,_0x4d5c('0x2d'));_0xb723b7['query']=_[_0x4d5c('0x34')](_0x1b114c['query']);_0xb723b7[_0x4d5c('0x35')]=_['intersection'](_0xb723b7[_0x4d5c('0x32')],_0xb723b7[_0x4d5c('0x36')]);_0x3495a4['attributes']=_['intersection'](_0xb723b7['model'],qs[_0x4d5c('0x37')](_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x37')]));_0x3495a4[_0x4d5c('0x38')]=_0x3495a4[_0x4d5c('0x38')][_0x4d5c('0x39')]?_0x3495a4['attributes']:_0xb723b7[_0x4d5c('0x32')];if(!_0x1b114c[_0x4d5c('0x36')]['hasOwnProperty'](_0x4d5c('0x3a'))){_0x3495a4[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x3495a4[_0x4d5c('0x1f')]=qs['offset'](_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x1f')]);}_0x3495a4['order']=qs[_0x4d5c('0x3b')](_0x1b114c['query'][_0x4d5c('0x3b')]);_0x3495a4['where']=qs[_0x4d5c('0x35')](_[_0x4d5c('0x3c')](_0x1b114c[_0x4d5c('0x36')],_0xb723b7[_0x4d5c('0x35')]),_0x53b513);if(_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x3495a4['where']=_[_0x4d5c('0x3e')](_0x3495a4[_0x4d5c('0x3f')],{'$or':_['map'](_0x53b513,function(_0x3a9ab3){if(_0x3a9ab3[_0x4d5c('0x40')]!==_0x4d5c('0x41')){var _0x18c0e2={};_0x18c0e2[_0x3a9ab3['name']]={'$like':'%'+_0x1b114c['query'][_0x4d5c('0x3d')]+'%'};return _0x18c0e2;}})});}_0x3495a4=_[_0x4d5c('0x3e')]({},_0x3495a4,_0x1b114c[_0x4d5c('0x42')]);var _0x5e3f81={'where':_0x3495a4[_0x4d5c('0x3f')]};return db[_0x4d5c('0x43')][_0x4d5c('0x20')](_0x5e3f81)[_0x4d5c('0x26')](function(_0x3c01e3){_0x5df1e5[_0x4d5c('0x20')]=_0x3c01e3;if(_0x1b114c[_0x4d5c('0x36')][_0x4d5c('0x44')]){_0x3495a4[_0x4d5c('0x45')]=[{'all':!![]}];}return db['Campaign'][_0x4d5c('0x46')](_0x3495a4);})[_0x4d5c('0x26')](function(_0x101bc5){_0x5df1e5[_0x4d5c('0x47')]=_0x101bc5;return _0x5df1e5;})[_0x4d5c('0x26')](respondWithFilteredResult(_0x56c925,_0x3495a4))[_0x4d5c('0x48')](handleError(_0x56c925,null));};exports[_0x4d5c('0x49')]=function(_0x25b92c,_0x94a698){var _0xfd1f66={'raw':![],'where':{'id':_0x25b92c['params']['id']}},_0x5d19cb={};_0x5d19cb[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db[_0x4d5c('0x43')]['rawAttributes']);_0x5d19cb[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0x25b92c[_0x4d5c('0x36')]);_0x5d19cb['filters']=_[_0x4d5c('0x4a')](_0x5d19cb[_0x4d5c('0x32')],_0x5d19cb['query']);_0xfd1f66[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x5d19cb[_0x4d5c('0x32')],qs[_0x4d5c('0x37')](_0x25b92c['query'][_0x4d5c('0x37')]));_0xfd1f66[_0x4d5c('0x38')]=_0xfd1f66['attributes'][_0x4d5c('0x39')]?_0xfd1f66[_0x4d5c('0x38')]:_0x5d19cb[_0x4d5c('0x32')];if(_0x25b92c['query'][_0x4d5c('0x44')]){_0xfd1f66[_0x4d5c('0x45')]=[{'all':!![]}];}_0xfd1f66=_[_0x4d5c('0x3e')]({},_0xfd1f66,_0x25b92c['options']);return db[_0x4d5c('0x43')]['find'](_0xfd1f66)[_0x4d5c('0x26')](handleEntityNotFound(_0x94a698,null))['then'](respondWithResult(_0x94a698,null))[_0x4d5c('0x48')](handleError(_0x94a698,null));};exports[_0x4d5c('0x4b')]=function(_0x554851,_0x5519a7){return db[_0x4d5c('0x43')][_0x4d5c('0x4b')](_0x554851[_0x4d5c('0x4c')],{})['then'](function(_0x3ecf00){var _0x27124e=_0x554851[_0x4d5c('0x4d')][_0x4d5c('0x27')]({'plain':!![]});if(!_0x27124e)throw new Error(_0x4d5c('0x4e'));if(_0x27124e['role']===_0x4d5c('0x4d')){var _0x677e5d=_0x3ecf00[_0x4d5c('0x27')]({'plain':!![]});var _0x6c0572='IvrCampaigns';return db[_0x4d5c('0x4f')][_0x4d5c('0x50')]({'where':{'name':_0x6c0572,'userProfileId':_0x27124e[_0x4d5c('0x51')]},'raw':!![]})['then'](function(_0x1532f5){if(_0x1532f5&&_0x1532f5[_0x4d5c('0x52')]===0x0){return db['UserProfileResource'][_0x4d5c('0x4b')]({'name':_0x677e5d[_0x4d5c('0x2d')],'resourceId':_0x677e5d['id'],'type':_0x1532f5[_0x4d5c('0x2d')],'sectionId':_0x1532f5['id']},{})[_0x4d5c('0x26')](function(){return _0x3ecf00;});}else{return _0x3ecf00;}})['catch'](function(_0x3d9f38){logger[_0x4d5c('0x2b')](_0x4d5c('0x53'),_0x3d9f38);throw _0x3d9f38;});}return _0x3ecf00;})[_0x4d5c('0x26')](respondWithResult(_0x5519a7,0xc9))[_0x4d5c('0x48')](handleError(_0x5519a7,null));};exports[_0x4d5c('0x54')]=function(_0x24e13b,_0x2e28b2){var _0x22ce0b={'where':{'id':_0x24e13b[_0x4d5c('0x55')]['id']}},_0xb3fdf2={};_0xb3fdf2[_0x4d5c('0x32')]=_['keys'](db['Campaign'][_0x4d5c('0x30')]);_0x22ce0b[_0x4d5c('0x38')]=_['intersection'](_0xb3fdf2['model'],qs[_0x4d5c('0x37')](_0x24e13b[_0x4d5c('0x36')]['fields']));_0x22ce0b['attributes']=_0x22ce0b[_0x4d5c('0x38')][_0x4d5c('0x39')]?_0x22ce0b[_0x4d5c('0x38')]:_0xb3fdf2[_0x4d5c('0x32')];if(_0x24e13b[_0x4d5c('0x36')][_0x4d5c('0x44')]){_0x22ce0b[_0x4d5c('0x45')]=[{'all':!![]}];}_0x22ce0b=_[_0x4d5c('0x3e')]({},_0x22ce0b,_0x24e13b[_0x4d5c('0x42')]);return db[_0x4d5c('0x43')][_0x4d5c('0x50')](_0x22ce0b)['then'](handleEntityNotFound(_0x2e28b2,null))[_0x4d5c('0x26')](function(_0x4e9ffd){if(_0x4e9ffd){var _0x57e4ef=_0x4e9ffd[_0x4d5c('0x27')]({'plain':!![]});_0x57e4ef=qs[_0x4d5c('0x56')](_0x57e4ef,['id',_0x4d5c('0x57'),_0x4d5c('0x58')]);_0x24e13b[_0x4d5c('0x4c')]=_[_0x4d5c('0x56')](_0x24e13b['body'],['id',_0x4d5c('0x57'),_0x4d5c('0x58')]);return db[_0x4d5c('0x43')][_0x4d5c('0x4b')](_['merge'](_0x57e4ef,_0x24e13b[_0x4d5c('0x4c')]),{'include':_0x24e13b[_0x4d5c('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x50e3e8){var _0x307dcb=_0x24e13b['user'][_0x4d5c('0x27')]({'plain':!![]});if(!_0x307dcb)throw new Error(_0x4d5c('0x4e'));if(_0x307dcb[_0x4d5c('0x59')]===_0x4d5c('0x4d')){var _0x1c3f82=_0x50e3e8[_0x4d5c('0x27')]({'plain':!![]});var _0x3525b3='IvrCampaigns';return db[_0x4d5c('0x4f')][_0x4d5c('0x50')]({'where':{'name':_0x3525b3,'userProfileId':_0x307dcb['userProfileId']},'raw':!![]})[_0x4d5c('0x26')](function(_0x5d2261){if(_0x5d2261&&_0x5d2261[_0x4d5c('0x52')]===0x0){return db['UserProfileResource'][_0x4d5c('0x4b')]({'name':_0x1c3f82[_0x4d5c('0x2d')],'resourceId':_0x1c3f82['id'],'type':_0x5d2261[_0x4d5c('0x2d')],'sectionId':_0x5d2261['id']},{})[_0x4d5c('0x26')](function(){return _0x50e3e8;});}else{return _0x50e3e8;}})[_0x4d5c('0x48')](function(_0x45ad3c){logger['error'](_0x4d5c('0x53'),_0x45ad3c);throw _0x45ad3c;});}return _0x50e3e8;});}})[_0x4d5c('0x26')](respondWithResult(_0x2e28b2,0xc9))[_0x4d5c('0x48')](handleError(_0x2e28b2,null));};exports['update']=function(_0x171a21,_0x493e5e){if(_0x171a21['body']['id']){delete _0x171a21[_0x4d5c('0x4c')]['id'];}return db['Campaign'][_0x4d5c('0x50')]({'where':{'id':_0x171a21['params']['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x493e5e,null))[_0x4d5c('0x26')](saveUpdates(_0x171a21['body'],null))[_0x4d5c('0x26')](respondWithResult(_0x493e5e,null))[_0x4d5c('0x48')](handleError(_0x493e5e,null));};exports['destroy']=function(_0xa442e2,_0x9a9e60){return db[_0x4d5c('0x43')][_0x4d5c('0x50')]({'where':{'id':_0xa442e2['params']['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x9a9e60,null))[_0x4d5c('0x26')](removeEntity(_0x9a9e60,null))['catch'](handleError(_0x9a9e60,null));};exports[_0x4d5c('0x5a')]=function(_0x51964d,_0x4b0d62,_0x51dcc4){var _0x2c4f32={'raw':!![],'where':{}};var _0x384e0b={};var _0x41ba12={'count':0x0,'rows':[]};return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0x51964d['params']['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x4b0d62,null))[_0x4d5c('0x26')](function(_0x45d98a){if(_0x45d98a){_0x384e0b[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db[_0x4d5c('0x5c')][_0x4d5c('0x30')]);_0x384e0b[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0x51964d[_0x4d5c('0x36')]);_0x384e0b[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0x384e0b[_0x4d5c('0x32')],_0x384e0b['query']);_0x2c4f32[_0x4d5c('0x38')]=_['intersection'](_0x384e0b['model'],qs['fields'](_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x37')]));_0x2c4f32[_0x4d5c('0x38')]=_0x2c4f32[_0x4d5c('0x38')]['length']?_0x2c4f32[_0x4d5c('0x38')]:_0x384e0b[_0x4d5c('0x32')];if(!_0x51964d[_0x4d5c('0x36')]['hasOwnProperty']('nolimit')){_0x2c4f32[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x2c4f32['offset']=qs[_0x4d5c('0x1f')](_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x1f')]);}_0x2c4f32['order']=qs[_0x4d5c('0x3b')](_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x3b')]);_0x2c4f32[_0x4d5c('0x3f')]=qs['filters'](_['pick'](_0x51964d[_0x4d5c('0x36')],_0x384e0b[_0x4d5c('0x35')]));_0x2c4f32[_0x4d5c('0x3f')][_0x4d5c('0x5d')]=_0x45d98a['id'];if(_0x51964d[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x2c4f32[_0x4d5c('0x3f')]=_[_0x4d5c('0x3e')](_0x2c4f32[_0x4d5c('0x3f')],{'$or':_[_0x4d5c('0x33')](_0x2c4f32['attributes'],function(_0x1911e8){var _0x418822={};_0x418822[_0x1911e8]={'$like':'%'+_0x51964d[_0x4d5c('0x36')]['filter']+'%'};return _0x418822;})});}_0x2c4f32=_[_0x4d5c('0x3e')]({},_0x2c4f32,_0x51964d[_0x4d5c('0x42')]);return db[_0x4d5c('0x5c')][_0x4d5c('0x20')]({'where':_0x2c4f32[_0x4d5c('0x3f')]})['then'](function(_0x5461a0){_0x41ba12[_0x4d5c('0x20')]=_0x5461a0;if(_0x51964d[_0x4d5c('0x36')]['includeAll']){_0x2c4f32[_0x4d5c('0x45')]=[{'all':!![]}];}return db[_0x4d5c('0x5c')][_0x4d5c('0x46')](_0x2c4f32);})[_0x4d5c('0x26')](function(_0x4944be){_0x41ba12[_0x4d5c('0x47')]=_0x4944be;return _0x41ba12;});}})[_0x4d5c('0x26')](respondWithFilteredResult(_0x4b0d62,_0x2c4f32))[_0x4d5c('0x48')](handleError(_0x4b0d62,null));};exports[_0x4d5c('0x5e')]=function(_0x35c44b,_0x25af4d,_0x919d5f){var _0x642b78={'raw':!![],'where':{}};var _0x1457b9={};var _0xb8a7ae={'count':0x0,'rows':[]};return db[_0x4d5c('0x43')]['findOne']({'where':{'id':_0x35c44b[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x25af4d,null))['then'](function(_0xc9e6f3){if(_0xc9e6f3){_0x1457b9[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db[_0x4d5c('0x5f')][_0x4d5c('0x30')]);_0x1457b9[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0x35c44b[_0x4d5c('0x36')]);_0x1457b9[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0x1457b9[_0x4d5c('0x32')],_0x1457b9[_0x4d5c('0x36')]);_0x642b78[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x1457b9['model'],qs['fields'](_0x35c44b['query'][_0x4d5c('0x37')]));_0x642b78['attributes']=_0x642b78['attributes'][_0x4d5c('0x39')]?_0x642b78['attributes']:_0x1457b9[_0x4d5c('0x32')];if(!_0x35c44b['query'][_0x4d5c('0x60')]('nolimit')){_0x642b78[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x35c44b[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x642b78[_0x4d5c('0x1f')]=qs[_0x4d5c('0x1f')](_0x35c44b[_0x4d5c('0x36')][_0x4d5c('0x1f')]);}_0x642b78[_0x4d5c('0x61')]=qs[_0x4d5c('0x3b')](_0x35c44b[_0x4d5c('0x36')][_0x4d5c('0x3b')]);_0x642b78[_0x4d5c('0x3f')]=qs['filters'](_[_0x4d5c('0x3c')](_0x35c44b[_0x4d5c('0x36')],_0x1457b9['filters']));_0x642b78['where'][_0x4d5c('0x5d')]=_0xc9e6f3['id'];if(_0x35c44b[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x642b78[_0x4d5c('0x3f')]=_[_0x4d5c('0x3e')](_0x642b78[_0x4d5c('0x3f')],{'$or':_[_0x4d5c('0x33')](_0x642b78[_0x4d5c('0x38')],function(_0xd6c649){var _0x29ea39={};_0x29ea39[_0xd6c649]={'$like':'%'+_0x35c44b[_0x4d5c('0x36')]['filter']+'%'};return _0x29ea39;})});}_0x642b78=_[_0x4d5c('0x3e')]({},_0x642b78,_0x35c44b[_0x4d5c('0x42')]);return db[_0x4d5c('0x5f')][_0x4d5c('0x20')]({'where':_0x642b78['where']})['then'](function(_0x5c8364){_0xb8a7ae[_0x4d5c('0x20')]=_0x5c8364;if(_0x35c44b[_0x4d5c('0x36')]['includeAll']){_0x642b78[_0x4d5c('0x45')]=[{'all':!![]}];}return db[_0x4d5c('0x5f')]['findAll'](_0x642b78);})[_0x4d5c('0x26')](function(_0x4fc22d){_0xb8a7ae['rows']=_0x4fc22d;return _0xb8a7ae;});}})[_0x4d5c('0x26')](respondWithFilteredResult(_0x25af4d,_0x642b78))[_0x4d5c('0x48')](handleError(_0x25af4d,null));};exports[_0x4d5c('0x62')]=function(_0xd42398,_0x8d2ad2,_0x335ab9){var _0x3bc0a2={'raw':!![],'where':{}};var _0x3bcc6d={};var _0x42fa3d={'count':0x0,'rows':[]};return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0xd42398[_0x4d5c('0x55')]['id']}})['then'](handleEntityNotFound(_0x8d2ad2,null))[_0x4d5c('0x26')](function(_0xcaef92){if(_0xcaef92){_0x3bcc6d['model']=_[_0x4d5c('0x34')](db[_0x4d5c('0x63')][_0x4d5c('0x30')]);_0x3bcc6d[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0xd42398['query']);_0x3bcc6d[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0x3bcc6d[_0x4d5c('0x32')],_0x3bcc6d[_0x4d5c('0x36')]);_0x3bc0a2[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x3bcc6d['model'],qs[_0x4d5c('0x37')](_0xd42398['query'][_0x4d5c('0x37')]));_0x3bc0a2[_0x4d5c('0x38')]=_0x3bc0a2['attributes'][_0x4d5c('0x39')]?_0x3bc0a2['attributes']:_0x3bcc6d[_0x4d5c('0x32')];if(!_0xd42398[_0x4d5c('0x36')][_0x4d5c('0x60')](_0x4d5c('0x3a'))){_0x3bc0a2[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0xd42398[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x3bc0a2[_0x4d5c('0x1f')]=qs[_0x4d5c('0x1f')](_0xd42398['query'][_0x4d5c('0x1f')]);}_0x3bc0a2['order']=qs[_0x4d5c('0x3b')](_0xd42398[_0x4d5c('0x36')]['sort']);_0x3bc0a2['where']=qs['filters'](_[_0x4d5c('0x3c')](_0xd42398[_0x4d5c('0x36')],_0x3bcc6d[_0x4d5c('0x35')]));_0x3bc0a2[_0x4d5c('0x3f')][_0x4d5c('0x5d')]=_0xcaef92['id'];if(_0xd42398[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x3bc0a2[_0x4d5c('0x3f')]=_[_0x4d5c('0x3e')](_0x3bc0a2['where'],{'$or':_[_0x4d5c('0x33')](_0x3bc0a2['attributes'],function(_0x1e4410){var _0x8d1f2e={};_0x8d1f2e[_0x1e4410]={'$like':'%'+_0xd42398[_0x4d5c('0x36')][_0x4d5c('0x3d')]+'%'};return _0x8d1f2e;})});}_0x3bc0a2=_['merge']({},_0x3bc0a2,_0xd42398[_0x4d5c('0x42')]);return db['CmHopperFinal']['count']({'where':_0x3bc0a2[_0x4d5c('0x3f')]})[_0x4d5c('0x26')](function(_0x52f018){_0x42fa3d[_0x4d5c('0x20')]=_0x52f018;if(_0xd42398[_0x4d5c('0x36')]['includeAll']){_0x3bc0a2['include']=[{'all':!![]}];}return db[_0x4d5c('0x63')][_0x4d5c('0x46')](_0x3bc0a2);})[_0x4d5c('0x26')](function(_0x8f95e1){_0x42fa3d[_0x4d5c('0x47')]=_0x8f95e1;return _0x42fa3d;});}})[_0x4d5c('0x26')](respondWithFilteredResult(_0x8d2ad2,_0x3bc0a2))['catch'](handleError(_0x8d2ad2,null));};exports[_0x4d5c('0x64')]=function(_0x1b0c70,_0xfc9792,_0x3004b9){var _0x1f30a3={'raw':!![],'where':{}};var _0xe9fb3d={};var _0x563f93={'count':0x0,'rows':[]};return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0x1b0c70[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0xfc9792,null))[_0x4d5c('0x26')](function(_0x2c329d){if(_0x2c329d){_0xe9fb3d[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db[_0x4d5c('0x65')]['rawAttributes']);_0xe9fb3d['query']=_[_0x4d5c('0x34')](_0x1b0c70['query']);_0xe9fb3d[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0xe9fb3d['model'],_0xe9fb3d[_0x4d5c('0x36')]);_0x1f30a3[_0x4d5c('0x38')]=_['intersection'](_0xe9fb3d['model'],qs['fields'](_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x37')]));_0x1f30a3[_0x4d5c('0x38')]=_0x1f30a3[_0x4d5c('0x38')][_0x4d5c('0x39')]?_0x1f30a3[_0x4d5c('0x38')]:_0xe9fb3d[_0x4d5c('0x32')];if(!_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x60')]('nolimit')){_0x1f30a3[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x1f30a3[_0x4d5c('0x1f')]=qs[_0x4d5c('0x1f')](_0x1b0c70['query'][_0x4d5c('0x1f')]);}_0x1f30a3[_0x4d5c('0x61')]=qs['sort'](_0x1b0c70[_0x4d5c('0x36')]['sort']);_0x1f30a3[_0x4d5c('0x3f')]=qs[_0x4d5c('0x35')](_['pick'](_0x1b0c70[_0x4d5c('0x36')],_0xe9fb3d[_0x4d5c('0x35')]));_0x1f30a3[_0x4d5c('0x3f')]['CampaignId']=_0x2c329d['id'];if(_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x1f30a3['where']=_[_0x4d5c('0x3e')](_0x1f30a3[_0x4d5c('0x3f')],{'$or':_[_0x4d5c('0x33')](_0x1f30a3['attributes'],function(_0xcc73e6){var _0x226b8e={};_0x226b8e[_0xcc73e6]={'$like':'%'+_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x3d')]+'%'};return _0x226b8e;})});}_0x1f30a3=_[_0x4d5c('0x3e')]({},_0x1f30a3,_0x1b0c70[_0x4d5c('0x42')]);return db[_0x4d5c('0x65')][_0x4d5c('0x20')]({'where':_0x1f30a3['where']})[_0x4d5c('0x26')](function(_0x5b0ca0){_0x563f93[_0x4d5c('0x20')]=_0x5b0ca0;if(_0x1b0c70[_0x4d5c('0x36')][_0x4d5c('0x44')]){_0x1f30a3[_0x4d5c('0x45')]=[{'all':!![]}];}return db[_0x4d5c('0x65')]['findAll'](_0x1f30a3);})['then'](function(_0x15cc39){_0x563f93['rows']=_0x15cc39;return _0x563f93;});}})[_0x4d5c('0x26')](respondWithFilteredResult(_0xfc9792,_0x1f30a3))[_0x4d5c('0x48')](handleError(_0xfc9792,null));};exports['getLists']=function(_0x21ac94,_0x5d4912,_0x3b7f91){var _0x5335f9={};var _0x2eb31b={};var _0x5e25ae;var _0x49a9f3;return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0x21ac94[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x5d4912,null))[_0x4d5c('0x26')](function(_0x2b8f11){if(_0x2b8f11){_0x5e25ae=_0x2b8f11;_0x2eb31b[_0x4d5c('0x32')]=_[_0x4d5c('0x34')](db['CmList'][_0x4d5c('0x30')]);_0x2eb31b[_0x4d5c('0x36')]=_[_0x4d5c('0x34')](_0x21ac94[_0x4d5c('0x36')]);_0x2eb31b[_0x4d5c('0x35')]=_[_0x4d5c('0x4a')](_0x2eb31b[_0x4d5c('0x32')],_0x2eb31b[_0x4d5c('0x36')]);_0x5335f9[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x2eb31b[_0x4d5c('0x32')],qs['fields'](_0x21ac94[_0x4d5c('0x36')]['fields']));_0x5335f9[_0x4d5c('0x38')]=_0x5335f9[_0x4d5c('0x38')][_0x4d5c('0x39')]?_0x5335f9[_0x4d5c('0x38')]:_0x2eb31b[_0x4d5c('0x32')];_0x5335f9['order']=qs[_0x4d5c('0x3b')](_0x21ac94[_0x4d5c('0x36')]['sort']);_0x5335f9[_0x4d5c('0x3f')]=qs['filters'](_[_0x4d5c('0x3c')](_0x21ac94[_0x4d5c('0x36')],_0x2eb31b['filters']));if(_0x21ac94[_0x4d5c('0x36')][_0x4d5c('0x3d')]){_0x5335f9[_0x4d5c('0x3f')]=_['merge'](_0x5335f9['where'],{'$or':_[_0x4d5c('0x33')](_0x5335f9[_0x4d5c('0x38')],function(_0x2df03e){var _0x1bffbd={};_0x1bffbd[_0x2df03e]={'$like':'%'+_0x21ac94[_0x4d5c('0x36')]['filter']+'%'};return _0x1bffbd;})});}_0x5335f9=_['merge']({},_0x5335f9,_0x21ac94[_0x4d5c('0x42')]);return _0x5e25ae[_0x4d5c('0x66')](_0x5335f9);}})[_0x4d5c('0x26')](function(_0xcc999d){if(_0xcc999d){_0x49a9f3=_0xcc999d[_0x4d5c('0x39')];if(!_0x21ac94[_0x4d5c('0x36')][_0x4d5c('0x60')]('nolimit')){_0x5335f9[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x21ac94[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x5335f9['offset']=qs[_0x4d5c('0x1f')](_0x21ac94['query'][_0x4d5c('0x1f')]);}return _0x5e25ae[_0x4d5c('0x66')](_0x5335f9);}})[_0x4d5c('0x26')](function(_0x4fbeac){if(_0x4fbeac){return _0x4fbeac?{'count':_0x49a9f3,'rows':_0x4fbeac}:null;}})[_0x4d5c('0x26')](respondWithResult(_0x5d4912,null))['catch'](handleError(_0x5d4912,null));};exports[_0x4d5c('0x67')]=function(_0x1bbaac,_0x110a32,_0x519374){var _0x6bd512,_0x4b7a0c;return db[_0x4d5c('0x43')][_0x4d5c('0x50')]({'where':{'id':_0x1bbaac[_0x4d5c('0x55')]['id']}})['then'](handleEntityNotFound(_0x110a32,null))[_0x4d5c('0x26')](function(_0x1650c0){if(_0x1650c0){_0x4b7a0c=_0x1650c0;return _0x1650c0['addLists'](_0x1bbaac[_0x4d5c('0x4c')][_0x4d5c('0x68')],_[_0x4d5c('0x56')](_0x1bbaac[_0x4d5c('0x4c')],[_0x4d5c('0x68'),'id'])||{});}return null;})[_0x4d5c('0x69')](function(_0x4414c4){var _0x2b6fc3;_0x6bd512=_0x4414c4||[];var _0x4e584b=[];if(_0x4414c4){for(var _0x387dae=0x0;_0x387dae<_0x4414c4['length'];_0x387dae+=0x1){var _0x3c7a62=_0x4414c4[_0x387dae]['get']({'plain':!![]});_0x4b7a0c['dialCheckDuplicateType']=_0x1bbaac[_0x4d5c('0x4c')][_0x4d5c('0x6a')]?_0x1bbaac[_0x4d5c('0x4c')][_0x4d5c('0x6a')]:_0x4b7a0c[_0x4d5c('0x6a')];switch(_0x4b7a0c[_0x4d5c('0x6a')]){case _0x4d5c('0x6b'):_0x2b6fc3=squel['insert']()[_0x4d5c('0x6c')]('cm_hopper')[_0x4d5c('0x6d')](['phone',_0x4d5c('0x6e'),_0x4d5c('0x6f'),_0x4d5c('0x70'),_0x4d5c('0x5d'),_0x4d5c('0x57'),'updatedAt'],squel['select']()[_0x4d5c('0x71')](_0x4d5c('0x72'),_0x4d5c('0x72'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x6e'))[_0x4d5c('0x71')]('id',_0x4d5c('0x6f'))[_0x4d5c('0x71')](_0x3c7a62[_0x4d5c('0x74')][_0x4d5c('0x75')](),_0x4d5c('0x70'))['field'](_0x1bbaac[_0x4d5c('0x55')]['id'][_0x4d5c('0x75')](),'CampaignId')[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x57'))[_0x4d5c('0x71')](_0x4d5c('0x73'),'updatedAt')[_0x4d5c('0x76')]('cm_contacts')[_0x4d5c('0x3f')](_0x4d5c('0x77'))['where'](_0x4d5c('0x78'),_0x3c7a62[_0x4d5c('0x74')]['toString']())[_0x4d5c('0x3f')](_0x4d5c('0x79'))[_0x4d5c('0x3f')](_0x4d5c('0x7a'),squel[_0x4d5c('0x7b')]()[_0x4d5c('0x71')](_0x4d5c('0x7c'))[_0x4d5c('0x76')](_0x4d5c('0x7d'))[_0x4d5c('0x3f')]('CampaignId\x20=\x20?',_0x1bbaac[_0x4d5c('0x55')]['id'][_0x4d5c('0x75')]()))[_0x4d5c('0x3f')](_0x4d5c('0x7a'),squel[_0x4d5c('0x7b')]()[_0x4d5c('0x71')](_0x4d5c('0x7e'))[_0x4d5c('0x76')](_0x4d5c('0x7f'))['where'](_0x4d5c('0x80'),_0x1bbaac[_0x4d5c('0x55')]['id'][_0x4d5c('0x75')]())))[_0x4d5c('0x75')]();break;case _0x4d5c('0x81'):_0x2b6fc3=squel[_0x4d5c('0x82')]()[_0x4d5c('0x6c')]('cm_hopper')[_0x4d5c('0x6d')]([_0x4d5c('0x72'),_0x4d5c('0x6e'),_0x4d5c('0x6f'),_0x4d5c('0x70'),'CampaignId','createdAt',_0x4d5c('0x58')],squel['select']()['field'](_0x4d5c('0x72'),_0x4d5c('0x72'))[_0x4d5c('0x71')]('NOW()',_0x4d5c('0x6e'))[_0x4d5c('0x71')]('id','ContactId')[_0x4d5c('0x71')](_0x3c7a62[_0x4d5c('0x74')]['toString'](),'ListId')[_0x4d5c('0x71')](_0x1bbaac[_0x4d5c('0x55')]['id']['toString'](),_0x4d5c('0x5d'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x57'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x58'))[_0x4d5c('0x76')](_0x4d5c('0x83'))['where'](_0x4d5c('0x77'))[_0x4d5c('0x3f')]('ListId\x20=\x20?',_0x3c7a62[_0x4d5c('0x74')][_0x4d5c('0x75')]())[_0x4d5c('0x3f')](_0x4d5c('0x79'))[_0x4d5c('0x3f')](_0x4d5c('0x7a'),squel['select']()[_0x4d5c('0x71')](_0x4d5c('0x7e'))['from'](_0x4d5c('0x7f'))[_0x4d5c('0x3f')]('CampaignId\x20=\x20?',_0x1bbaac['params']['id'][_0x4d5c('0x75')]())))['toString']();break;default:_0x2b6fc3=squel['insert']()['into'](_0x4d5c('0x7f'))[_0x4d5c('0x6d')]([_0x4d5c('0x72'),_0x4d5c('0x6e'),_0x4d5c('0x6f'),'ListId','CampaignId','createdAt','updatedAt'],squel['select']()[_0x4d5c('0x71')]('phone',_0x4d5c('0x72'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x6e'))['field']('id',_0x4d5c('0x6f'))[_0x4d5c('0x71')](_0x3c7a62[_0x4d5c('0x74')]['toString'](),_0x4d5c('0x70'))[_0x4d5c('0x71')](_0x1bbaac[_0x4d5c('0x55')]['id']['toString'](),_0x4d5c('0x5d'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x57'))[_0x4d5c('0x71')]('NOW()',_0x4d5c('0x58'))[_0x4d5c('0x76')](_0x4d5c('0x83'))[_0x4d5c('0x3f')](_0x4d5c('0x77'))[_0x4d5c('0x3f')]('ListId\x20=\x20?',_0x3c7a62[_0x4d5c('0x74')][_0x4d5c('0x75')]())[_0x4d5c('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x4d5c('0x75')]();}_0x4e584b[_0x4d5c('0x84')](db[_0x4d5c('0x85')][_0x4d5c('0x36')](_0x2b6fc3));}return BPromise[_0x4d5c('0x86')](_0x4e584b);}})[_0x4d5c('0x26')](function(){return _0x6bd512;})[_0x4d5c('0x26')](respondWithResult(_0x110a32,null))[_0x4d5c('0x48')](handleError(_0x110a32,null));};exports[_0x4d5c('0x87')]=function(_0x4bb898,_0x5498fc,_0x1f75a2){return db[_0x4d5c('0x43')][_0x4d5c('0x50')]({'where':{'id':_0x4bb898[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x5498fc,null))[_0x4d5c('0x26')](function(_0x4fbf21){if(_0x4fbf21){return _0x4fbf21[_0x4d5c('0x87')](_0x4bb898['query'][_0x4d5c('0x68')]);}})[_0x4d5c('0x26')](function(_0x3023a0){if(_0x3023a0){return db[_0x4d5c('0x5c')]['destroy']({'where':{'ListId':_0x4bb898[_0x4d5c('0x36')][_0x4d5c('0x68')],'CampaignId':_0x4bb898[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](function(){return _0x3023a0;});}})[_0x4d5c('0x26')](respondWithStatusCode(_0x5498fc,null))['catch'](handleError(_0x5498fc,null));};exports[_0x4d5c('0x88')]=function(_0x5041b0,_0x3590fb,_0x5e0226){var _0x3d5c94={};var _0x5e57b6={};var _0x45e1f0;var _0x2062a1;return db[_0x4d5c('0x43')][_0x4d5c('0x5b')]({'where':{'id':_0x5041b0['params']['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x3590fb,null))[_0x4d5c('0x26')](function(_0x7ff3c5){if(_0x7ff3c5){_0x45e1f0=_0x7ff3c5;_0x5e57b6['model']=_[_0x4d5c('0x34')](db[_0x4d5c('0x89')]['rawAttributes']);_0x5e57b6['query']=_[_0x4d5c('0x34')](_0x5041b0['query']);_0x5e57b6[_0x4d5c('0x35')]=_['intersection'](_0x5e57b6['model'],_0x5e57b6['query']);_0x3d5c94[_0x4d5c('0x38')]=_[_0x4d5c('0x4a')](_0x5e57b6['model'],qs[_0x4d5c('0x37')](_0x5041b0[_0x4d5c('0x36')][_0x4d5c('0x37')]));_0x3d5c94[_0x4d5c('0x38')]=_0x3d5c94[_0x4d5c('0x38')]['length']?_0x3d5c94[_0x4d5c('0x38')]:_0x5e57b6['model'];_0x3d5c94[_0x4d5c('0x61')]=qs[_0x4d5c('0x3b')](_0x5041b0[_0x4d5c('0x36')]['sort']);_0x3d5c94[_0x4d5c('0x3f')]=qs[_0x4d5c('0x35')](_[_0x4d5c('0x3c')](_0x5041b0[_0x4d5c('0x36')],_0x5e57b6[_0x4d5c('0x35')]));if(_0x5041b0[_0x4d5c('0x36')]['filter']){_0x3d5c94['where']=_['merge'](_0x3d5c94[_0x4d5c('0x3f')],{'$or':_['map'](_0x3d5c94['attributes'],function(_0x2be182){var _0x4aa61b={};_0x4aa61b[_0x2be182]={'$like':'%'+_0x5041b0[_0x4d5c('0x36')]['filter']+'%'};return _0x4aa61b;})});}_0x3d5c94=_[_0x4d5c('0x3e')]({},_0x3d5c94,_0x5041b0[_0x4d5c('0x42')]);return _0x45e1f0[_0x4d5c('0x88')](_0x3d5c94);}})[_0x4d5c('0x26')](function(_0x4cd417){if(_0x4cd417){_0x2062a1=_0x4cd417['length'];if(!_0x5041b0['query'][_0x4d5c('0x60')]('nolimit')){_0x3d5c94[_0x4d5c('0x1e')]=qs[_0x4d5c('0x1e')](_0x5041b0[_0x4d5c('0x36')][_0x4d5c('0x1e')]);_0x3d5c94[_0x4d5c('0x1f')]=qs['offset'](_0x5041b0[_0x4d5c('0x36')][_0x4d5c('0x1f')]);}return _0x45e1f0[_0x4d5c('0x88')](_0x3d5c94);}})[_0x4d5c('0x26')](function(_0x168619){if(_0x168619){return _0x168619?{'count':_0x2062a1,'rows':_0x168619}:null;}})[_0x4d5c('0x26')](respondWithResult(_0x3590fb,null))[_0x4d5c('0x48')](handleError(_0x3590fb,null));};exports[_0x4d5c('0x8a')]=function(_0x512ff3,_0x5be972,_0x5a1f9e){var _0x6bf256,_0x3bdeaa;return db['Campaign'][_0x4d5c('0x50')]({'where':{'id':_0x512ff3[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x5be972,null))[_0x4d5c('0x26')](function(_0x39e0d3){if(_0x39e0d3){_0x3bdeaa=_0x39e0d3;return _0x39e0d3[_0x4d5c('0x8a')](_0x512ff3[_0x4d5c('0x4c')]['ids'],_['omit'](_0x512ff3['body'],['ids','id'])||{});}return null;})[_0x4d5c('0x69')](function(_0xef8e3){var _0x432190;_0x6bf256=_0xef8e3||[];var _0x2a259e=[];if(_0xef8e3){for(var _0x914b77=0x0;_0x914b77<_0xef8e3[_0x4d5c('0x39')];_0x914b77+=0x1){var _0x4ed438=_0xef8e3[_0x914b77][_0x4d5c('0x27')]({'plain':!![]});_0x432190=squel[_0x4d5c('0x82')]()[_0x4d5c('0x6c')](_0x4d5c('0x8b'))[_0x4d5c('0x6d')]([_0x4d5c('0x72'),_0x4d5c('0x6f'),'ListId',_0x4d5c('0x5d'),'createdAt',_0x4d5c('0x58')],squel[_0x4d5c('0x7b')]()['field'](_0x4d5c('0x72'),_0x4d5c('0x72'))['field']('id',_0x4d5c('0x6f'))[_0x4d5c('0x71')](_0x4ed438[_0x4d5c('0x74')][_0x4d5c('0x75')](),'ListId')[_0x4d5c('0x71')](_0x512ff3[_0x4d5c('0x55')]['id'][_0x4d5c('0x75')](),_0x4d5c('0x5d'))[_0x4d5c('0x71')](_0x4d5c('0x73'),_0x4d5c('0x57'))[_0x4d5c('0x71')]('NOW()','updatedAt')[_0x4d5c('0x76')](_0x4d5c('0x83'))['where'](_0x4d5c('0x77'))[_0x4d5c('0x3f')](_0x4d5c('0x78'),_0x4ed438['CmListId'][_0x4d5c('0x75')]())[_0x4d5c('0x3f')](_0x4d5c('0x79')))[_0x4d5c('0x75')]();_0x2a259e[_0x4d5c('0x84')](db[_0x4d5c('0x85')][_0x4d5c('0x36')](_0x432190));}return BPromise[_0x4d5c('0x86')](_0x2a259e);}})[_0x4d5c('0x26')](function(){return _0x6bf256;})[_0x4d5c('0x26')](respondWithResult(_0x5be972,null))['catch'](handleError(_0x5be972,null));};exports[_0x4d5c('0x8c')]=function(_0x260f77,_0x35eaf5,_0x426566){return db[_0x4d5c('0x43')][_0x4d5c('0x50')]({'where':{'id':_0x260f77[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](handleEntityNotFound(_0x35eaf5,null))['then'](function(_0x5727d8){if(_0x5727d8){return _0x5727d8[_0x4d5c('0x8c')](_0x260f77[_0x4d5c('0x36')][_0x4d5c('0x68')]);}})[_0x4d5c('0x26')](function(_0x61a4a2){if(_0x61a4a2){return db[_0x4d5c('0x65')][_0x4d5c('0x2a')]({'where':{'ListId':_0x260f77[_0x4d5c('0x36')][_0x4d5c('0x68')],'CampaignId':_0x260f77[_0x4d5c('0x55')]['id']}})[_0x4d5c('0x26')](function(){return _0x61a4a2;});}})['then'](respondWithStatusCode(_0x35eaf5,null))[_0x4d5c('0x48')](handleError(_0x35eaf5,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index afc7f7d..4d60c37 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4ccc7a,_0x2b65d2){var _0x1f8000=function(_0x3463aa){while(--_0x3463aa){_0x4ccc7a['push'](_0x4ccc7a['shift']());}};_0x1f8000(++_0x2b65d2);}(_0x7a54,0x106));var _0x47a5=function(_0x2c1910,_0x1eddfd){_0x2c1910=_0x2c1910-0x0;var _0x4a956c=_0x7a54[_0x2c1910];return _0x4a956c;};'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
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index e6c160c..2a61098 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 _0x2750=['Campaign','options','raw','where','attributes','include','model','map','GetCampaign','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x2750,0x13b));var _0x0275=function(_0x4cbc7c,_0x5aa7e4){_0x4cbc7c=_0x4cbc7c-0x0;var _0x4c2ab6=_0x2750[_0x4cbc7c];return _0x4c2ab6;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var moment=require(_0x0275('0x1'));var BPromise=require(_0x0275('0x2'));var rs=require(_0x0275('0x3'));var fs=require('fs');var Redis=require(_0x0275('0x4'));var db=require(_0x0275('0x5'))['db'];var utils=require(_0x0275('0x6'));var logger=require(_0x0275('0x7'))(_0x0275('0x8'));var config=require(_0x0275('0x9'));var jayson=require(_0x0275('0xa'));var client=jayson['client'][_0x0275('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2421fd,_0x2fa0eb,_0x2e4b5c){return new BPromise(function(_0x4dffd1,_0x1f7c4a){return client[_0x0275('0xc')](_0x2421fd,_0x2e4b5c)[_0x0275('0xd')](function(_0x5e0e4a){logger['info'](_0x0275('0xe'),_0x2fa0eb,'request\x20sent');logger[_0x0275('0xf')](_0x0275('0x10'),_0x2fa0eb,_0x0275('0x11'),JSON[_0x0275('0x12')](_0x5e0e4a));if(_0x5e0e4a[_0x0275('0x13')]){if(_0x5e0e4a['error'][_0x0275('0x14')]===0x1f4){logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a['error']['message']);return _0x1f7c4a(_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);}logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);return _0x4dffd1(_0x5e0e4a['error'][_0x0275('0x15')]);}else{logger[_0x0275('0x16')]('Campaign,\x20%s,\x20%s',_0x2fa0eb,_0x0275('0x11'));_0x4dffd1(_0x5e0e4a[_0x0275('0x17')]['message']);}})[_0x0275('0x18')](function(_0x31c76b){logger['error']('Campaign,\x20%s,\x20%s',_0x2fa0eb,_0x31c76b);_0x1f7c4a(_0x31c76b);});});}exports['GetCampaign']=function(_0x591d27){var _0x5b8746=this;return new Promise(function(_0x566ad6,_0x44f7b0){return db[_0x0275('0x19')]['findAll']({'raw':_0x591d27[_0x0275('0x1a')]?_0x591d27[_0x0275('0x1a')][_0x0275('0x1b')]===undefined?!![]:![]:!![],'where':_0x591d27['options']?_0x591d27[_0x0275('0x1a')][_0x0275('0x1c')]||null:null,'attributes':_0x591d27['options']?_0x591d27['options'][_0x0275('0x1d')]||null:null,'limit':_0x591d27[_0x0275('0x1a')]?_0x591d27[_0x0275('0x1a')]['limit']||null:null,'include':_0x591d27[_0x0275('0x1a')]?_0x591d27['options'][_0x0275('0x1e')]?_['map'](_0x591d27[_0x0275('0x1a')][_0x0275('0x1e')],function(_0x594321){return{'model':db[_0x594321[_0x0275('0x1f')]],'as':_0x594321['as'],'attributes':_0x594321[_0x0275('0x1d')],'include':_0x594321[_0x0275('0x1e')]?_['map'](_0x594321[_0x0275('0x1e')],function(_0x44bbf8){return{'model':db[_0x44bbf8[_0x0275('0x1f')]],'as':_0x44bbf8['as'],'attributes':_0x44bbf8[_0x0275('0x1d')],'include':_0x44bbf8[_0x0275('0x1e')]?_[_0x0275('0x20')](_0x44bbf8['include'],function(_0x35343c){return{'model':db[_0x35343c[_0x0275('0x1f')]],'as':_0x35343c['as'],'attributes':_0x35343c[_0x0275('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0275('0xd')](function(_0x4689a3){logger['info'](_0x0275('0x21'),_0x591d27);logger[_0x0275('0xf')](_0x0275('0x21'),_0x591d27,JSON[_0x0275('0x12')](_0x4689a3));_0x566ad6(_0x4689a3);})[_0x0275('0x18')](function(_0x49e645){logger[_0x0275('0x13')](_0x0275('0x21'),_0x49e645[_0x0275('0x15')],_0x591d27);_0x44f7b0(_0x5b8746['error'](0x1f4,_0x49e645['message']));});});};
\ No newline at end of file
+var _0x1c4d=['Campaign','findAll','options','where','attributes','limit','map','include','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign'];(function(_0x535222,_0x30d7a5){var _0x10680b=function(_0x25cb5e){while(--_0x25cb5e){_0x535222['push'](_0x535222['shift']());}};_0x10680b(++_0x30d7a5);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x3b0e1e,_0x31eb24){_0x3b0e1e=_0x3b0e1e-0x0;var _0x2466b8=_0x1c4d[_0x3b0e1e];return _0x2466b8;};'use strict';var _=require('lodash');var util=require(_0xd1c4('0x0'));var moment=require(_0xd1c4('0x1'));var BPromise=require(_0xd1c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1c4('0x3'));var db=require(_0xd1c4('0x4'))['db'];var utils=require(_0xd1c4('0x5'));var logger=require(_0xd1c4('0x6'))('rpc');var config=require(_0xd1c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd1c4('0x8')][_0xd1c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41cc76,_0x35cbf5,_0x429dc6){return new BPromise(function(_0xc9284c,_0x49c2dc){return client[_0xd1c4('0xa')](_0x41cc76,_0x429dc6)[_0xd1c4('0xb')](function(_0x5443f3){logger[_0xd1c4('0xc')]('Campaign,\x20%s,\x20%s',_0x35cbf5,_0xd1c4('0xd'));logger[_0xd1c4('0xe')](_0xd1c4('0xf'),_0x35cbf5,_0xd1c4('0xd'),JSON[_0xd1c4('0x10')](_0x5443f3));if(_0x5443f3[_0xd1c4('0x11')]){if(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x12')]===0x1f4){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0x49c2dc(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x14')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0xc9284c(_0x5443f3[_0xd1c4('0x11')]['message']);}else{logger['info'](_0xd1c4('0x13'),_0x35cbf5,'request\x20sent');_0xc9284c(_0x5443f3[_0xd1c4('0x15')][_0xd1c4('0x14')]);}})[_0xd1c4('0x16')](function(_0x4af352){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x4af352);_0x49c2dc(_0x4af352);});});}exports[_0xd1c4('0x17')]=function(_0x41c496){var _0xe25f12=this;return new Promise(function(_0x39e0bb,_0x51a465){return db[_0xd1c4('0x18')][_0xd1c4('0x19')]({'raw':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1b')]||null:null,'attributes':_0x41c496[_0xd1c4('0x1a')]?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1c')]||null:null,'limit':_0x41c496['options']?_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1d')]||null:null,'include':_0x41c496['options']?_0x41c496[_0xd1c4('0x1a')]['include']?_[_0xd1c4('0x1e')](_0x41c496[_0xd1c4('0x1a')][_0xd1c4('0x1f')],function(_0x5d24e7){return{'model':db[_0x5d24e7[_0xd1c4('0x20')]],'as':_0x5d24e7['as'],'attributes':_0x5d24e7[_0xd1c4('0x1c')],'include':_0x5d24e7[_0xd1c4('0x1f')]?_[_0xd1c4('0x1e')](_0x5d24e7[_0xd1c4('0x1f')],function(_0x23f9af){return{'model':db[_0x23f9af[_0xd1c4('0x20')]],'as':_0x23f9af['as'],'attributes':_0x23f9af[_0xd1c4('0x1c')],'include':_0x23f9af[_0xd1c4('0x1f')]?_['map'](_0x23f9af[_0xd1c4('0x1f')],function(_0x2cdf75){return{'model':db[_0x2cdf75[_0xd1c4('0x20')]],'as':_0x2cdf75['as'],'attributes':_0x2cdf75[_0xd1c4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd1c4('0xb')](function(_0x26fda4){logger['info'](_0xd1c4('0x17'),_0x41c496);logger['debug'](_0xd1c4('0x17'),_0x41c496,JSON[_0xd1c4('0x10')](_0x26fda4));_0x39e0bb(_0x26fda4);})[_0xd1c4('0x16')](function(_0x3ef290){logger[_0xd1c4('0x11')]('GetCampaign',_0x3ef290[_0xd1c4('0x14')],_0x41c496);_0x51a465(_0xe25f12[_0xd1c4('0x11')](0x1f4,_0x3ef290['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 4ab3fff..ff9318b 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 _0xe10c=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','/:id','update','destroy','removeLists','delete','/:id/blacklists','removeBlackLists','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/hoppers'];(function(_0x1a967b,_0x2eba36){var _0x3c9397=function(_0x1a5aca){while(--_0x1a5aca){_0x1a967b['push'](_0x1a967b['shift']());}};_0x3c9397(++_0x2eba36);}(_0xe10c,0x153));var _0xce10=function(_0x1e64b4,_0xe0c41){_0x1e64b4=_0x1e64b4-0x0;var _0x1e2670=_0xe10c[_0x1e64b4];return _0x1e2670;};'use strict';var multer=require(_0xce10('0x0'));var util=require(_0xce10('0x1'));var path=require(_0xce10('0x2'));var timeout=require('connect-timeout');var express=require(_0xce10('0x3'));var router=express['Router']();var fs_extra=require(_0xce10('0x4'));var auth=require(_0xce10('0x5'));var interaction=require(_0xce10('0x6'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xce10('0x7')]('/',auth[_0xce10('0x8')](),controller[_0xce10('0x9')]);router[_0xce10('0x7')]('/:id',auth[_0xce10('0x8')](),controller['show']);router[_0xce10('0x7')](_0xce10('0xa'),auth['isAuthenticated'](),controller[_0xce10('0xb')]);router['get'](_0xce10('0xc'),auth[_0xce10('0x8')](),controller[_0xce10('0xd')]);router[_0xce10('0x7')](_0xce10('0xe'),auth[_0xce10('0x8')](),controller[_0xce10('0xf')]);router[_0xce10('0x7')](_0xce10('0x10'),auth[_0xce10('0x8')](),controller[_0xce10('0x11')]);router[_0xce10('0x7')]('/:id/lists',auth['isAuthenticated'](),controller[_0xce10('0x12')]);router[_0xce10('0x7')]('/:id/blacklists',auth[_0xce10('0x8')](),controller[_0xce10('0x13')]);router[_0xce10('0x14')]('/',auth[_0xce10('0x8')](),controller[_0xce10('0x15')]);router['post'](_0xce10('0x16'),auth[_0xce10('0x8')](),controller[_0xce10('0x17')]);router[_0xce10('0x14')](_0xce10('0x18'),auth[_0xce10('0x8')](),controller[_0xce10('0x19')]);router[_0xce10('0x14')]('/:id/blacklists',auth[_0xce10('0x8')](),controller[_0xce10('0x1a')]);router[_0xce10('0x1b')](_0xce10('0x1c'),auth[_0xce10('0x8')](),controller[_0xce10('0x1d')]);router['delete'](_0xce10('0x1c'),auth[_0xce10('0x8')](),controller[_0xce10('0x1e')]);router['delete'](_0xce10('0x18'),auth[_0xce10('0x8')](),controller[_0xce10('0x1f')]);router[_0xce10('0x20')](_0xce10('0x21'),auth[_0xce10('0x8')](),controller[_0xce10('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0xb877=['addBlackLists','delete','destroy','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getBlackLists','post','create','/:id/clone','/:id/lists','addLists','/:id/blacklists'];(function(_0x598fae,_0x13abf1){var _0x1d975c=function(_0x34f13f){while(--_0x34f13f){_0x598fae['push'](_0x598fae['shift']());}};_0x1d975c(++_0x13abf1);}(_0xb877,0x1cb));var _0x7b87=function(_0x3b2306,_0xfde2f7){_0x3b2306=_0x3b2306-0x0;var _0x53f8e5=_0xb877[_0x3b2306];return _0x53f8e5;};'use strict';var multer=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var path=require(_0x7b87('0x2'));var timeout=require(_0x7b87('0x3'));var express=require(_0x7b87('0x4'));var router=express[_0x7b87('0x5')]();var fs_extra=require(_0x7b87('0x6'));var auth=require(_0x7b87('0x7'));var interaction=require(_0x7b87('0x8'));var config=require(_0x7b87('0x9'));var controller=require(_0x7b87('0xa'));router[_0x7b87('0xb')]('/',auth[_0x7b87('0xc')](),controller[_0x7b87('0xd')]);router[_0x7b87('0xb')](_0x7b87('0xe'),auth[_0x7b87('0xc')](),controller[_0x7b87('0xf')]);router[_0x7b87('0xb')](_0x7b87('0x10'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x11')]);router['get'](_0x7b87('0x12'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x13')]);router[_0x7b87('0xb')](_0x7b87('0x14'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x15')]);router[_0x7b87('0xb')](_0x7b87('0x16'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x17')]);router[_0x7b87('0xb')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x7b87('0xc')](),controller[_0x7b87('0x18')]);router[_0x7b87('0x19')]('/',auth[_0x7b87('0xc')](),controller[_0x7b87('0x1a')]);router[_0x7b87('0x19')](_0x7b87('0x1b'),auth[_0x7b87('0xc')](),controller['clone']);router['post'](_0x7b87('0x1c'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x1d')]);router[_0x7b87('0x19')](_0x7b87('0x1e'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x1f')]);router['put'](_0x7b87('0xe'),auth[_0x7b87('0xc')](),controller['update']);router[_0x7b87('0x20')](_0x7b87('0xe'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x21')]);router[_0x7b87('0x20')](_0x7b87('0x1c'),auth[_0x7b87('0xc')](),controller['removeLists']);router[_0x7b87('0x20')](_0x7b87('0x1e'),auth[_0x7b87('0xc')](),controller[_0x7b87('0x22')]);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 6bd3f47..4c2c3ae 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 _0x2870=['key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2870,0x1b1));var _0x0287=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x2870[_0x555069];return _0x100af7;};'use strict';var Sequelize=require(_0x0287('0x0'));module[_0x0287('0x1')]={'key':{'type':Sequelize[_0x0287('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0287('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x0287('0x4')],'get':function(){return this['getDataValue'](_0x0287('0x5'));}}};
\ No newline at end of file
+var _0x7c78=['getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x591e8e,_0x11eb4f){var _0x4119e7=function(_0x41415e){while(--_0x41415e){_0x591e8e['push'](_0x591e8e['shift']());}};_0x4119e7(++_0x11eb4f);}(_0x7c78,0x158));var _0x87c7=function(_0x9d37d9,_0x4cdbf8){_0x9d37d9=_0x9d37d9-0x0;var _0x22db05=_0x7c78[_0x9d37d9];return _0x22db05;};'use strict';var Sequelize=require(_0x87c7('0x0'));module[_0x87c7('0x1')]={'key':{'type':Sequelize[_0x87c7('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x87c7('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x87c7('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x87c7('0x4')](_0x87c7('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1e4099b..5f615e7 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 _0x64c2=['type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x57246f,_0x3d0f4c){var _0x2c7db9=function(_0x9cd6d){while(--_0x9cd6d){_0x57246f['push'](_0x57246f['shift']());}};_0x2c7db9(++_0x3d0f4c);}(_0x64c2,0x194));var _0x264c=function(_0xdb815e,_0x3012fc){_0xdb815e=_0xdb815e-0x0;var _0x2bab1f=_0x64c2[_0xdb815e];return _0x2bab1f;};'use strict';var emlformat=require(_0x264c('0x0'));var rimraf=require(_0x264c('0x1'));var zipdir=require(_0x264c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x264c('0x3'));var moment=require(_0x264c('0x4'));var BPromise=require(_0x264c('0x5'));var Mustache=require(_0x264c('0x6'));var util=require(_0x264c('0x7'));var path=require(_0x264c('0x8'));var sox=require(_0x264c('0x9'));var csv=require('to-csv');var ejs=require(_0x264c('0xa'));var fs=require('fs');var fs_extra=require(_0x264c('0xb'));var _=require('lodash');var squel=require(_0x264c('0xc'));var crypto=require(_0x264c('0xd'));var jsforce=require(_0x264c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x264c('0xf'));var Papa=require(_0x264c('0x10'));var Redis=require(_0x264c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x264c('0x12'));var as=require(_0x264c('0x13'));var hardwareService=require(_0x264c('0x14'));var logger=require(_0x264c('0x15'))(_0x264c('0x16'));var utils=require('../../config/utils');var config=require(_0x264c('0x17'));var licenseUtil=require(_0x264c('0x18'));var db=require(_0x264c('0x19'))['db'];function respondWithStatusCode(_0x2124e1,_0x982e76){_0x982e76=_0x982e76||0xcc;return function(_0x203ace){if(_0x203ace){return _0x2124e1['sendStatus'](_0x982e76);}return _0x2124e1[_0x264c('0x1a')](_0x982e76)[_0x264c('0x1b')]();};}function respondWithResult(_0x4f2154,_0x2f8214){_0x2f8214=_0x2f8214||0xc8;return function(_0x11947e){if(_0x11947e){return _0x4f2154[_0x264c('0x1a')](_0x2f8214)[_0x264c('0x1c')](_0x11947e);}};}function respondWithFilteredResult(_0x530289,_0x152af2){return function(_0x5310ac){if(_0x5310ac){var _0x50e3a8=typeof _0x152af2[_0x264c('0x1d')]===_0x264c('0x1e')&&typeof _0x152af2[_0x264c('0x1f')]==='undefined';var _0x12a8d5=_0x5310ac[_0x264c('0x20')];var _0x5ca376=_0x50e3a8?0x0:_0x152af2['offset'];var _0x42f578=_0x50e3a8?_0x5310ac[_0x264c('0x20')]:_0x152af2[_0x264c('0x1d')]+_0x152af2[_0x264c('0x1f')];var _0x2858d9;if(_0x42f578>=_0x12a8d5){_0x42f578=_0x12a8d5;_0x2858d9=0xc8;}else{_0x2858d9=0xce;}_0x530289[_0x264c('0x1a')](_0x2858d9);return _0x530289[_0x264c('0x21')](_0x264c('0x22'),_0x5ca376+'-'+_0x42f578+'/'+_0x12a8d5)[_0x264c('0x1c')](_0x5310ac);}return null;};}function patchUpdates(_0x253405){return function(_0x39d0c9){try{jsonpatch['apply'](_0x39d0c9,_0x253405,!![]);}catch(_0x571f4c){return BPromise[_0x264c('0x23')](_0x571f4c);}return _0x39d0c9[_0x264c('0x24')]();};}function saveUpdates(_0x4d6ba2,_0x15a3f2){return function(_0x40858c){if(_0x40858c){return _0x40858c[_0x264c('0x25')](_0x4d6ba2)['then'](function(_0x496455){return _0x496455;});}return null;};}function removeEntity(_0x2f8427,_0x22b73b){return function(_0xd7abf1){if(_0xd7abf1){return _0xd7abf1[_0x264c('0x26')]()[_0x264c('0x27')](function(){var _0x40c325=_0xd7abf1[_0x264c('0x28')]({'plain':!![]});var _0x4bbf6a=_0x264c('0x29');return db[_0x264c('0x2a')][_0x264c('0x26')]({'where':{'type':_0x4bbf6a,'resourceId':_0x40c325['id']}})[_0x264c('0x27')](function(){return _0xd7abf1;});})[_0x264c('0x27')](function(){_0x2f8427['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e7b98,_0x386f19){return function(_0x8e3074){if(!_0x8e3074){_0x4e7b98[_0x264c('0x2b')](0x194);}return _0x8e3074;};}function handleError(_0x26c92f,_0x489d27){_0x489d27=_0x489d27||0x1f4;return function(_0x1ab901){logger['error'](_0x1ab901[_0x264c('0x2c')]);if(_0x1ab901['name']){delete _0x1ab901[_0x264c('0x2d')];}_0x26c92f[_0x264c('0x1a')](_0x489d27)[_0x264c('0x2e')](_0x1ab901);};}exports[_0x264c('0x2f')]=function(_0x653b44,_0x1bf4ae){var _0x2fd82f={},_0x3ede53={},_0x11ed39={'count':0x0,'rows':[]};var _0x149ac2=_[_0x264c('0x30')](db[_0x264c('0x31')][_0x264c('0x32')],function(_0x2601c4){return{'name':_0x2601c4['fieldName'],'type':_0x2601c4[_0x264c('0x33')]['key']};});_0x3ede53[_0x264c('0x34')]=_['map'](_0x149ac2,_0x264c('0x2d'));_0x3ede53[_0x264c('0x35')]=_[_0x264c('0x36')](_0x653b44[_0x264c('0x35')]);_0x3ede53[_0x264c('0x37')]=_[_0x264c('0x38')](_0x3ede53[_0x264c('0x34')],_0x3ede53[_0x264c('0x35')]);_0x2fd82f[_0x264c('0x39')]=_[_0x264c('0x38')](_0x3ede53[_0x264c('0x34')],qs[_0x264c('0x3a')](_0x653b44[_0x264c('0x35')][_0x264c('0x3a')]));_0x2fd82f[_0x264c('0x39')]=_0x2fd82f['attributes'][_0x264c('0x3b')]?_0x2fd82f[_0x264c('0x39')]:_0x3ede53[_0x264c('0x34')];if(!_0x653b44[_0x264c('0x35')]['hasOwnProperty'](_0x264c('0x3c'))){_0x2fd82f[_0x264c('0x1f')]=qs[_0x264c('0x1f')](_0x653b44['query'][_0x264c('0x1f')]);_0x2fd82f[_0x264c('0x1d')]=qs[_0x264c('0x1d')](_0x653b44[_0x264c('0x35')][_0x264c('0x1d')]);}_0x2fd82f[_0x264c('0x3d')]=qs[_0x264c('0x3e')](_0x653b44[_0x264c('0x35')][_0x264c('0x3e')]);_0x2fd82f[_0x264c('0x3f')]=qs[_0x264c('0x37')](_[_0x264c('0x40')](_0x653b44[_0x264c('0x35')],_0x3ede53['filters']),_0x149ac2);if(_0x653b44[_0x264c('0x35')]['filter']){_0x2fd82f[_0x264c('0x3f')]=_['merge'](_0x2fd82f[_0x264c('0x3f')],{'$or':[{'key':{'$like':'%'+_0x653b44['query'][_0x264c('0x41')]+'%'}},{'value':{'$like':'%'+_0x653b44[_0x264c('0x35')][_0x264c('0x41')]+'%'}}]});}_0x2fd82f=_[_0x264c('0x42')]({},_0x2fd82f,_0x653b44[_0x264c('0x43')]);var _0x413321={'where':_0x2fd82f[_0x264c('0x3f')]};return db[_0x264c('0x31')][_0x264c('0x20')](_0x413321)[_0x264c('0x27')](function(_0x13fe66){_0x11ed39[_0x264c('0x20')]=_0x13fe66;if(_0x653b44['query'][_0x264c('0x44')]){_0x2fd82f['include']=[{'all':!![]}];}return db[_0x264c('0x31')][_0x264c('0x45')](_0x2fd82f);})['then'](function(_0xea1f41){_0x11ed39[_0x264c('0x46')]=_0xea1f41;return _0x11ed39;})[_0x264c('0x27')](respondWithFilteredResult(_0x1bf4ae,_0x2fd82f))[_0x264c('0x47')](handleError(_0x1bf4ae,null));};exports[_0x264c('0x48')]=function(_0x5e2a36,_0x4f537e){var _0x46f7d6={'raw':!![],'where':{'id':_0x5e2a36['params']['id']}},_0x216677={};_0x216677['model']=_[_0x264c('0x36')](db[_0x264c('0x31')]['rawAttributes']);_0x216677[_0x264c('0x35')]=_['keys'](_0x5e2a36[_0x264c('0x35')]);_0x216677[_0x264c('0x37')]=_[_0x264c('0x38')](_0x216677[_0x264c('0x34')],_0x216677[_0x264c('0x35')]);_0x46f7d6[_0x264c('0x39')]=_['intersection'](_0x216677[_0x264c('0x34')],qs[_0x264c('0x3a')](_0x5e2a36[_0x264c('0x35')]['fields']));_0x46f7d6[_0x264c('0x39')]=_0x46f7d6['attributes'][_0x264c('0x3b')]?_0x46f7d6[_0x264c('0x39')]:_0x216677[_0x264c('0x34')];if(_0x5e2a36['query'][_0x264c('0x44')]){_0x46f7d6[_0x264c('0x49')]=[{'all':!![]}];}_0x46f7d6=_[_0x264c('0x42')]({},_0x46f7d6,_0x5e2a36[_0x264c('0x43')]);return db[_0x264c('0x31')][_0x264c('0x4a')](_0x46f7d6)[_0x264c('0x27')](handleEntityNotFound(_0x4f537e,null))[_0x264c('0x27')](respondWithResult(_0x4f537e,null))['catch'](handleError(_0x4f537e,null));};exports[_0x264c('0x25')]=function(_0x54f755,_0x5ae673){if(_0x54f755['body']['id']){delete _0x54f755[_0x264c('0x4b')]['id'];}return db[_0x264c('0x31')][_0x264c('0x4a')]({'where':{'id':_0x54f755[_0x264c('0x4c')]['id']}})[_0x264c('0x27')](handleEntityNotFound(_0x5ae673,null))[_0x264c('0x27')](saveUpdates(_0x54f755['body'],null))['then'](respondWithResult(_0x5ae673,null))[_0x264c('0x47')](handleError(_0x5ae673,null));};exports[_0x264c('0x26')]=function(_0x28f184,_0x22b56f){return db[_0x264c('0x31')][_0x264c('0x4a')]({'where':{'id':_0x28f184[_0x264c('0x4c')]['id']}})[_0x264c('0x27')](handleEntityNotFound(_0x22b56f,null))[_0x264c('0x27')](removeEntity(_0x22b56f,null))[_0x264c('0x47')](handleError(_0x22b56f,null));};exports[_0x264c('0x4d')]=function(_0x4ca901,_0xd898f6){var _0x401023={'key':_0x4ca901[_0x264c('0x4b')]['key']};if(_0x4ca901[_0x264c('0x4b')][_0x264c('0x4e')]){_0x401023[_0x264c('0x4e')]=_0x4ca901[_0x264c('0x4b')][_0x264c('0x4e')];}else if(_0x4ca901[_0x264c('0x4b')][_0x264c('0x4f')]){_0x401023[_0x264c('0x4f')]=_0x4ca901['body'][_0x264c('0x4f')];}else if(_0x4ca901[_0x264c('0x4b')][_0x264c('0x50')]){_0x401023[_0x264c('0x50')]=_0x4ca901[_0x264c('0x4b')]['OpenchannelAccountId'];}else if(_0x4ca901[_0x264c('0x4b')][_0x264c('0x51')]){_0x401023[_0x264c('0x51')]=_0x4ca901[_0x264c('0x4b')][_0x264c('0x51')];}return db[_0x264c('0x31')]['find']({'where':_0x401023})['then'](function(_0x28a3dd){if(_0x28a3dd){throw new db['Sequelize'][(_0x264c('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x264c('0x31')]['create'](_0x4ca901['body']);})[_0x264c('0x27')](function(_0x291311){var _0x4467f1=_0x4ca901[_0x264c('0x53')]['get']({'plain':!![]});if(!_0x4467f1)throw new Error(_0x264c('0x54'));if(_0x4467f1[_0x264c('0x55')]===_0x264c('0x53')){var _0xf0d3b=_0x291311['get']({'plain':!![]});return db[_0x264c('0x56')][_0x264c('0x4a')]({'where':{'name':_0x264c('0x29'),'userProfileId':_0x4467f1[_0x264c('0x57')]},'raw':!![]})[_0x264c('0x27')](function(_0x4c0996){if(_0x4c0996&&_0x4c0996[_0x264c('0x58')]===0x0){return db[_0x264c('0x2a')][_0x264c('0x4d')]({'name':_0xf0d3b[_0x264c('0x2d')],'resourceId':_0xf0d3b['id'],'type':_0x4c0996[_0x264c('0x2d')],'sectionId':_0x4c0996['id']},{})[_0x264c('0x27')](function(){return _0x291311;});}else{return _0x291311;}})[_0x264c('0x47')](function(_0x2de0d1){logger[_0x264c('0x59')](_0x264c('0x5a'),_0x2de0d1);throw _0x2de0d1;});}return _0x291311;})[_0x264c('0x27')](respondWithResult(_0xd898f6,0xc9))[_0x264c('0x47')](handleError(_0xd898f6,null));};
\ No newline at end of file
+var _0x5871=['error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','update','then','get','CannedAnswers','destroy'];(function(_0x121896,_0x30212b){var _0x329155=function(_0x224039){while(--_0x224039){_0x121896['push'](_0x121896['shift']());}};_0x329155(++_0x30212b);}(_0x5871,0x12e));var _0x1587=function(_0x2b9bfa,_0x403511){_0x2b9bfa=_0x2b9bfa-0x0;var _0x1c355d=_0x5871[_0x2b9bfa];return _0x1c355d;};'use strict';var emlformat=require(_0x1587('0x0'));var rimraf=require(_0x1587('0x1'));var zipdir=require(_0x1587('0x2'));var jsonpatch=require(_0x1587('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1587('0x4'));var util=require(_0x1587('0x5'));var path=require(_0x1587('0x6'));var sox=require(_0x1587('0x7'));var csv=require(_0x1587('0x8'));var ejs=require(_0x1587('0x9'));var fs=require('fs');var fs_extra=require(_0x1587('0xa'));var _=require('lodash');var squel=require(_0x1587('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1587('0x8'));var querystring=require(_0x1587('0xc'));var Papa=require('papaparse');var Redis=require(_0x1587('0xd'));var authService=require(_0x1587('0xe'));var qs=require(_0x1587('0xf'));var as=require(_0x1587('0x10'));var hardwareService=require(_0x1587('0x11'));var logger=require(_0x1587('0x12'))('api');var utils=require(_0x1587('0x13'));var config=require(_0x1587('0x14'));var licenseUtil=require(_0x1587('0x15'));var db=require(_0x1587('0x16'))['db'];function respondWithStatusCode(_0x229066,_0x46e638){_0x46e638=_0x46e638||0xcc;return function(_0x5f02b9){if(_0x5f02b9){return _0x229066[_0x1587('0x17')](_0x46e638);}return _0x229066['status'](_0x46e638)[_0x1587('0x18')]();};}function respondWithResult(_0x18f5e6,_0x39bc79){_0x39bc79=_0x39bc79||0xc8;return function(_0x22f452){if(_0x22f452){return _0x18f5e6[_0x1587('0x19')](_0x39bc79)[_0x1587('0x1a')](_0x22f452);}};}function respondWithFilteredResult(_0x1c612d,_0x76c915){return function(_0x4a3617){if(_0x4a3617){var _0x2efeee=typeof _0x76c915['offset']===_0x1587('0x1b')&&typeof _0x76c915[_0x1587('0x1c')]==='undefined';var _0xe6414=_0x4a3617[_0x1587('0x1d')];var _0x1de94c=_0x2efeee?0x0:_0x76c915[_0x1587('0x1e')];var _0x38a7f0=_0x2efeee?_0x4a3617[_0x1587('0x1d')]:_0x76c915[_0x1587('0x1e')]+_0x76c915[_0x1587('0x1c')];var _0x124ade;if(_0x38a7f0>=_0xe6414){_0x38a7f0=_0xe6414;_0x124ade=0xc8;}else{_0x124ade=0xce;}_0x1c612d[_0x1587('0x19')](_0x124ade);return _0x1c612d['set'](_0x1587('0x1f'),_0x1de94c+'-'+_0x38a7f0+'/'+_0xe6414)[_0x1587('0x1a')](_0x4a3617);}return null;};}function patchUpdates(_0x3c4145){return function(_0x4966fe){try{jsonpatch[_0x1587('0x20')](_0x4966fe,_0x3c4145,!![]);}catch(_0x366e72){return BPromise['reject'](_0x366e72);}return _0x4966fe['save']();};}function saveUpdates(_0x27ae31,_0x3dd564){return function(_0x2ded4d){if(_0x2ded4d){return _0x2ded4d[_0x1587('0x21')](_0x27ae31)[_0x1587('0x22')](function(_0xd06ce9){return _0xd06ce9;});}return null;};}function removeEntity(_0x590091,_0x56ef5e){return function(_0x438b4b){if(_0x438b4b){return _0x438b4b['destroy']()['then'](function(){var _0x39cfe6=_0x438b4b[_0x1587('0x23')]({'plain':!![]});var _0x1fb615=_0x1587('0x24');return db['UserProfileResource'][_0x1587('0x25')]({'where':{'type':_0x1fb615,'resourceId':_0x39cfe6['id']}})['then'](function(){return _0x438b4b;});})[_0x1587('0x22')](function(){_0x590091[_0x1587('0x19')](0xcc)[_0x1587('0x18')]();});}};}function handleEntityNotFound(_0x3f284b,_0x276af2){return function(_0x43b40c){if(!_0x43b40c){_0x3f284b['sendStatus'](0x194);}return _0x43b40c;};}function handleError(_0x13bdcf,_0x42b5e2){_0x42b5e2=_0x42b5e2||0x1f4;return function(_0x1986fd){logger[_0x1587('0x26')](_0x1986fd[_0x1587('0x27')]);if(_0x1986fd[_0x1587('0x28')]){delete _0x1986fd[_0x1587('0x28')];}_0x13bdcf[_0x1587('0x19')](_0x42b5e2)[_0x1587('0x29')](_0x1986fd);};}exports['index']=function(_0x5b79d1,_0x256ac5){var _0x307445={},_0x4b8cfb={},_0x4111ef={'count':0x0,'rows':[]};var _0x37938b=_[_0x1587('0x2a')](db[_0x1587('0x2b')][_0x1587('0x2c')],function(_0xe7bc97){return{'name':_0xe7bc97[_0x1587('0x2d')],'type':_0xe7bc97[_0x1587('0x2e')][_0x1587('0x2f')]};});_0x4b8cfb[_0x1587('0x30')]=_[_0x1587('0x2a')](_0x37938b,'name');_0x4b8cfb['query']=_[_0x1587('0x31')](_0x5b79d1[_0x1587('0x32')]);_0x4b8cfb[_0x1587('0x33')]=_[_0x1587('0x34')](_0x4b8cfb[_0x1587('0x30')],_0x4b8cfb[_0x1587('0x32')]);_0x307445[_0x1587('0x35')]=_['intersection'](_0x4b8cfb[_0x1587('0x30')],qs['fields'](_0x5b79d1[_0x1587('0x32')][_0x1587('0x36')]));_0x307445[_0x1587('0x35')]=_0x307445[_0x1587('0x35')][_0x1587('0x37')]?_0x307445[_0x1587('0x35')]:_0x4b8cfb[_0x1587('0x30')];if(!_0x5b79d1[_0x1587('0x32')][_0x1587('0x38')]('nolimit')){_0x307445[_0x1587('0x1c')]=qs[_0x1587('0x1c')](_0x5b79d1['query'][_0x1587('0x1c')]);_0x307445['offset']=qs[_0x1587('0x1e')](_0x5b79d1[_0x1587('0x32')][_0x1587('0x1e')]);}_0x307445[_0x1587('0x39')]=qs[_0x1587('0x3a')](_0x5b79d1[_0x1587('0x32')][_0x1587('0x3a')]);_0x307445[_0x1587('0x3b')]=qs['filters'](_[_0x1587('0x3c')](_0x5b79d1[_0x1587('0x32')],_0x4b8cfb[_0x1587('0x33')]),_0x37938b);if(_0x5b79d1[_0x1587('0x32')][_0x1587('0x3d')]){_0x307445[_0x1587('0x3b')]=_[_0x1587('0x3e')](_0x307445[_0x1587('0x3b')],{'$or':[{'key':{'$like':'%'+_0x5b79d1[_0x1587('0x32')][_0x1587('0x3d')]+'%'}},{'value':{'$like':'%'+_0x5b79d1['query'][_0x1587('0x3d')]+'%'}}]});}_0x307445=_[_0x1587('0x3e')]({},_0x307445,_0x5b79d1[_0x1587('0x3f')]);var _0x2b364a={'where':_0x307445[_0x1587('0x3b')]};return db['CannedAnswer'][_0x1587('0x1d')](_0x2b364a)['then'](function(_0xf16a65){_0x4111ef[_0x1587('0x1d')]=_0xf16a65;if(_0x5b79d1[_0x1587('0x32')][_0x1587('0x40')]){_0x307445[_0x1587('0x41')]=[{'all':!![]}];}return db[_0x1587('0x2b')]['findAll'](_0x307445);})[_0x1587('0x22')](function(_0x2f1930){_0x4111ef['rows']=_0x2f1930;return _0x4111ef;})[_0x1587('0x22')](respondWithFilteredResult(_0x256ac5,_0x307445))[_0x1587('0x42')](handleError(_0x256ac5,null));};exports[_0x1587('0x43')]=function(_0x283477,_0x35e18d){var _0x509d85={'raw':!![],'where':{'id':_0x283477['params']['id']}},_0x265c7c={};_0x265c7c['model']=_[_0x1587('0x31')](db['CannedAnswer'][_0x1587('0x2c')]);_0x265c7c[_0x1587('0x32')]=_['keys'](_0x283477[_0x1587('0x32')]);_0x265c7c[_0x1587('0x33')]=_['intersection'](_0x265c7c[_0x1587('0x30')],_0x265c7c[_0x1587('0x32')]);_0x509d85['attributes']=_[_0x1587('0x34')](_0x265c7c['model'],qs[_0x1587('0x36')](_0x283477[_0x1587('0x32')][_0x1587('0x36')]));_0x509d85['attributes']=_0x509d85[_0x1587('0x35')][_0x1587('0x37')]?_0x509d85[_0x1587('0x35')]:_0x265c7c['model'];if(_0x283477[_0x1587('0x32')][_0x1587('0x40')]){_0x509d85[_0x1587('0x41')]=[{'all':!![]}];}_0x509d85=_[_0x1587('0x3e')]({},_0x509d85,_0x283477[_0x1587('0x3f')]);return db['CannedAnswer'][_0x1587('0x44')](_0x509d85)['then'](handleEntityNotFound(_0x35e18d,null))['then'](respondWithResult(_0x35e18d,null))[_0x1587('0x42')](handleError(_0x35e18d,null));};exports[_0x1587('0x21')]=function(_0x3687c0,_0x3cbc0b){if(_0x3687c0[_0x1587('0x45')]['id']){delete _0x3687c0[_0x1587('0x45')]['id'];}return db[_0x1587('0x2b')][_0x1587('0x44')]({'where':{'id':_0x3687c0[_0x1587('0x46')]['id']}})[_0x1587('0x22')](handleEntityNotFound(_0x3cbc0b,null))[_0x1587('0x22')](saveUpdates(_0x3687c0['body'],null))[_0x1587('0x22')](respondWithResult(_0x3cbc0b,null))['catch'](handleError(_0x3cbc0b,null));};exports[_0x1587('0x25')]=function(_0x160293,_0x70925b){return db[_0x1587('0x2b')][_0x1587('0x44')]({'where':{'id':_0x160293['params']['id']}})[_0x1587('0x22')](handleEntityNotFound(_0x70925b,null))[_0x1587('0x22')](removeEntity(_0x70925b,null))['catch'](handleError(_0x70925b,null));};exports[_0x1587('0x47')]=function(_0x514948,_0x416178){var _0x4ad68a={'key':_0x514948[_0x1587('0x45')][_0x1587('0x2f')]};if(_0x514948[_0x1587('0x45')][_0x1587('0x48')]){_0x4ad68a['MailAccountId']=_0x514948[_0x1587('0x45')][_0x1587('0x48')];}else if(_0x514948[_0x1587('0x45')]['SmsAccountId']){_0x4ad68a[_0x1587('0x49')]=_0x514948[_0x1587('0x45')][_0x1587('0x49')];}else if(_0x514948[_0x1587('0x45')]['OpenchannelAccountId']){_0x4ad68a[_0x1587('0x4a')]=_0x514948[_0x1587('0x45')][_0x1587('0x4a')];}else if(_0x514948[_0x1587('0x45')][_0x1587('0x4b')]){_0x4ad68a[_0x1587('0x4b')]=_0x514948['body'][_0x1587('0x4b')];}return db['CannedAnswer'][_0x1587('0x44')]({'where':_0x4ad68a})[_0x1587('0x22')](function(_0x311602){if(_0x311602){throw new db['Sequelize']['ValidationError'](_0x1587('0x4c'));}return db['CannedAnswer'][_0x1587('0x47')](_0x514948[_0x1587('0x45')]);})[_0x1587('0x22')](function(_0x4cd654){var _0x41a281=_0x514948['user'][_0x1587('0x23')]({'plain':!![]});if(!_0x41a281)throw new Error(_0x1587('0x4d'));if(_0x41a281[_0x1587('0x4e')]===_0x1587('0x4f')){var _0x446867=_0x4cd654[_0x1587('0x23')]({'plain':!![]});return db[_0x1587('0x50')][_0x1587('0x44')]({'where':{'name':_0x1587('0x24'),'userProfileId':_0x41a281[_0x1587('0x51')]},'raw':!![]})['then'](function(_0x5399bf){if(_0x5399bf&&_0x5399bf[_0x1587('0x52')]===0x0){return db[_0x1587('0x53')][_0x1587('0x47')]({'name':_0x446867[_0x1587('0x28')],'resourceId':_0x446867['id'],'type':_0x5399bf[_0x1587('0x28')],'sectionId':_0x5399bf['id']},{})[_0x1587('0x22')](function(){return _0x4cd654;});}else{return _0x4cd654;}})[_0x1587('0x42')](function(_0x4f5b37){logger['error'](_0x1587('0x54'),_0x4f5b37);throw _0x4f5b37;});}return _0x4cd654;})['then'](respondWithResult(_0x416178,0xc9))[_0x1587('0x42')](handleError(_0x416178,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 8d148e7..9144db1 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 _0x1afa=['bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger','api','moment'];(function(_0x310522,_0x44a838){var _0xa37d9b=function(_0x1d4ddb){while(--_0x1d4ddb){_0x310522['push'](_0x310522['shift']());}};_0xa37d9b(++_0x44a838);}(_0x1afa,0x70));var _0xa1af=function(_0xbea2f0,_0x3fbf98){_0xbea2f0=_0xbea2f0-0x0;var _0x5b4840=_0x1afa[_0xbea2f0];return _0x5b4840;};'use strict';var _=require(_0xa1af('0x0'));var util=require(_0xa1af('0x1'));var logger=require(_0xa1af('0x2'))(_0xa1af('0x3'));var moment=require(_0xa1af('0x4'));var BPromise=require(_0xa1af('0x5'));var rp=require(_0xa1af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1af('0x7'));var config=require(_0xa1af('0x8'));var attributes=require(_0xa1af('0x9'));module[_0xa1af('0xa')]=function(_0x33ee37,_0xf609ff){return _0x33ee37[_0xa1af('0xb')]('CannedAnswer',attributes,{'tableName':_0xa1af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0e01=['exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','rimraf'];(function(_0x35f2ce,_0x137df9){var _0x23aea4=function(_0x3f6819){while(--_0x3f6819){_0x35f2ce['push'](_0x35f2ce['shift']());}};_0x23aea4(++_0x137df9);}(_0x0e01,0x87));var _0x10e0=function(_0x4baf82,_0x4e05f3){_0x4baf82=_0x4baf82-0x0;var _0x3985bd=_0x0e01[_0x4baf82];return _0x3985bd;};'use strict';var _=require(_0x10e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x10e0('0x1'));var moment=require(_0x10e0('0x2'));var BPromise=require(_0x10e0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x10e0('0x4'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x10e0('0x5')]=function(_0x4a9f5f,_0x684dac){return _0x4a9f5f[_0x10e0('0x6')]('CannedAnswer',attributes,{'tableName':_0x10e0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x10e0('0x8'),'collate':_0x10e0('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 139fe54..34c1dab 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(_0x356e41,_0x1169cc){var _0x5ce4af=function(_0x4d4f26){while(--_0x4d4f26){_0x356e41['push'](_0x356e41['shift']());}};_0x5ce4af(++_0x1169cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x5ef192,_0x163c5b){var _0x45bea1=function(_0x2cb1c4){while(--_0x2cb1c4){_0x5ef192['push'](_0x5ef192['shift']());}};_0x45bea1(++_0x163c5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 26510a8..d8fbfae 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 _0x508d=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','show','create','isAuthenticated','update'];(function(_0x4b65d8,_0x23f32b){var _0x1d85f6=function(_0x1e802f){while(--_0x1e802f){_0x4b65d8['push'](_0x4b65d8['shift']());}};_0x1d85f6(++_0x23f32b);}(_0x508d,0x1a6));var _0xd508=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x508d[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0xd508('0x0'));var util=require(_0xd508('0x1'));var path=require(_0xd508('0x2'));var timeout=require(_0xd508('0x3'));var express=require(_0xd508('0x4'));var router=express[_0xd508('0x5')]();var fs_extra=require(_0xd508('0x6'));var auth=require(_0xd508('0x7'));var interaction=require(_0xd508('0x8'));var config=require(_0xd508('0x9'));var controller=require(_0xd508('0xa'));router[_0xd508('0xb')]('/',auth['isAuthenticated'](),controller[_0xd508('0xc')]);router[_0xd508('0xb')](_0xd508('0xd'),auth['isAuthenticated'](),controller[_0xd508('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd508('0xf')]);router['put']('/:id',auth[_0xd508('0x10')](),controller[_0xd508('0x11')]);router[_0xd508('0x12')](_0xd508('0xd'),auth[_0xd508('0x10')](),controller['destroy']);module[_0xd508('0x13')]=router;
\ No newline at end of file
+var _0x3f67=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','put','update'];(function(_0x19441b,_0x5a239b){var _0x16bbd7=function(_0x4f8ecb){while(--_0x4f8ecb){_0x19441b['push'](_0x19441b['shift']());}};_0x16bbd7(++_0x5a239b);}(_0x3f67,0x1d0));var _0x73f6=function(_0x3e4db1,_0x385cd6){_0x3e4db1=_0x3e4db1-0x0;var _0x33ecd5=_0x3f67[_0x3e4db1];return _0x33ecd5;};'use strict';var multer=require(_0x73f6('0x0'));var util=require(_0x73f6('0x1'));var path=require(_0x73f6('0x2'));var timeout=require(_0x73f6('0x3'));var express=require(_0x73f6('0x4'));var router=express[_0x73f6('0x5')]();var fs_extra=require(_0x73f6('0x6'));var auth=require(_0x73f6('0x7'));var interaction=require(_0x73f6('0x8'));var config=require(_0x73f6('0x9'));var controller=require(_0x73f6('0xa'));router[_0x73f6('0xb')]('/',auth['isAuthenticated'](),controller[_0x73f6('0xc')]);router[_0x73f6('0xb')](_0x73f6('0xd'),auth[_0x73f6('0xe')](),controller[_0x73f6('0xf')]);router[_0x73f6('0x10')]('/',auth[_0x73f6('0xe')](),controller['create']);router[_0x73f6('0x11')](_0x73f6('0xd'),auth[_0x73f6('0xe')](),controller[_0x73f6('0x12')]);router[_0x73f6('0x13')](_0x73f6('0xd'),auth[_0x73f6('0xe')](),controller[_0x73f6('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index f20c812..6327cf6 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 _0xd957=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2dd2bc,_0x20cd80){var _0x57e3b6=function(_0x1194ea){while(--_0x1194ea){_0x2dd2bc['push'](_0x2dd2bc['shift']());}};_0x57e3b6(++_0x20cd80);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x7d95('0x2')},'clid':{'type':Sequelize[_0x7d95('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x7d95('0x3')]},'dcontext':{'type':Sequelize[_0x7d95('0x3')]},'channel':{'type':Sequelize[_0x7d95('0x3')]},'dstchannel':{'type':Sequelize[_0x7d95('0x3')]},'lastapp':{'type':Sequelize[_0x7d95('0x3')]},'lastdata':{'type':Sequelize[_0x7d95('0x3')]},'duration':{'type':Sequelize[_0x7d95('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7d95('0x3')]},'amaflags':{'type':Sequelize[_0x7d95('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7d95('0x3')]},'uniqueid':{'type':Sequelize[_0x7d95('0x3')]},'linkedid':{'type':Sequelize[_0x7d95('0x3')]},'sequence':{'type':Sequelize[_0x7d95('0x3')]},'peeraccount':{'type':Sequelize[_0x7d95('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x7d95('0x3')]}};
\ No newline at end of file
+var _0x475d=['sequelize','exports','STRING','INTEGER'];(function(_0x3d1202,_0x171153){var _0x59fa79=function(_0x521bf7){while(--_0x521bf7){_0x3d1202['push'](_0x3d1202['shift']());}};_0x59fa79(++_0x171153);}(_0x475d,0x110));var _0xd475=function(_0xb518e5,_0x5b627c){_0xb518e5=_0xb518e5-0x0;var _0x59c78e=_0x475d[_0xb518e5];return _0x59c78e;};'use strict';var Sequelize=require(_0xd475('0x0'));module[_0xd475('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xd475('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xd475('0x2')]},'channel':{'type':Sequelize[_0xd475('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd475('0x2')]},'lastdata':{'type':Sequelize[_0xd475('0x2')]},'duration':{'type':Sequelize[_0xd475('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd475('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd475('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xd475('0x2')]},'uniqueid':{'type':Sequelize[_0xd475('0x2')]},'linkedid':{'type':Sequelize[_0xd475('0x2')]},'sequence':{'type':Sequelize[_0xd475('0x2')]},'peeraccount':{'type':Sequelize[_0xd475('0x2')]},'type':{'type':Sequelize[_0xd475('0x2')]},'tag':{'type':Sequelize[_0xd475('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ffe32e0..4b7b67f 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 _0xe0ae=['where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','catch','create','body','update','find','describe','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0xe0ae,0xa1));var _0xee0a=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0xe0ae[_0x2652ef];return _0x2db578;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee0a('0x0'));var jsonpatch=require(_0xee0a('0x1'));var rp=require('request-promise');var moment=require(_0xee0a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xee0a('0x3'));var util=require(_0xee0a('0x4'));var path=require('path');var sox=require(_0xee0a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee0a('0x6'));var _=require(_0xee0a('0x7'));var squel=require(_0xee0a('0x8'));var crypto=require(_0xee0a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee0a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee0a('0xb'));var Redis=require(_0xee0a('0xc'));var authService=require(_0xee0a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xee0a('0xe'));var hardwareService=require(_0xee0a('0xf'));var logger=require('../../config/logger')(_0xee0a('0x10'));var utils=require('../../config/utils');var config=require(_0xee0a('0x11'));var licenseUtil=require(_0xee0a('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fcf59,_0x5c56d9){_0x5c56d9=_0x5c56d9||0xcc;return function(_0x32fad9){if(_0x32fad9){return _0x1fcf59[_0xee0a('0x13')](_0x5c56d9);}return _0x1fcf59['status'](_0x5c56d9)['end']();};}function respondWithResult(_0x325a8e,_0x41b70a){_0x41b70a=_0x41b70a||0xc8;return function(_0x347604){if(_0x347604){return _0x325a8e[_0xee0a('0x14')](_0x41b70a)[_0xee0a('0x15')](_0x347604);}};}function respondWithFilteredResult(_0x57afe6,_0xb891a9){return function(_0xd39431){if(_0xd39431){var _0x50063f=typeof _0xb891a9[_0xee0a('0x16')]===_0xee0a('0x17')&&typeof _0xb891a9[_0xee0a('0x18')]===_0xee0a('0x17');var _0x4f711b=_0xd39431[_0xee0a('0x19')];var _0x1d7a8a=_0x50063f?0x0:_0xb891a9[_0xee0a('0x16')];var _0x55c474=_0x50063f?_0xd39431[_0xee0a('0x19')]:_0xb891a9[_0xee0a('0x16')]+_0xb891a9[_0xee0a('0x18')];var _0x24f8f1;if(_0x55c474>=_0x4f711b){_0x55c474=_0x4f711b;_0x24f8f1=0xc8;}else{_0x24f8f1=0xce;}_0x57afe6['status'](_0x24f8f1);return _0x57afe6[_0xee0a('0x1a')](_0xee0a('0x1b'),_0x1d7a8a+'-'+_0x55c474+'/'+_0x4f711b)[_0xee0a('0x15')](_0xd39431);}return null;};}function patchUpdates(_0x201d32){return function(_0x5c981e){try{jsonpatch[_0xee0a('0x1c')](_0x5c981e,_0x201d32,!![]);}catch(_0xff2f14){return BPromise[_0xee0a('0x1d')](_0xff2f14);}return _0x5c981e[_0xee0a('0x1e')]();};}function saveUpdates(_0x39fa96,_0x1eb176){return function(_0x2c543c){if(_0x2c543c){return _0x2c543c['update'](_0x39fa96)[_0xee0a('0x1f')](function(_0x3d5459){return _0x3d5459;});}return null;};}function removeEntity(_0x27989c,_0x38d029){return function(_0x567810){if(_0x567810){return _0x567810[_0xee0a('0x20')]()[_0xee0a('0x1f')](function(){_0x27989c[_0xee0a('0x14')](0xcc)[_0xee0a('0x21')]();});}};}function handleEntityNotFound(_0x4c61e2,_0x50e9d1){return function(_0x578ecf){if(!_0x578ecf){_0x4c61e2[_0xee0a('0x13')](0x194);}return _0x578ecf;};}function handleError(_0x4f9f56,_0x5c7cfa){_0x5c7cfa=_0x5c7cfa||0x1f4;return function(_0x1c9ad8){logger[_0xee0a('0x22')](_0x1c9ad8[_0xee0a('0x23')]);if(_0x1c9ad8['name']){delete _0x1c9ad8[_0xee0a('0x24')];}_0x4f9f56[_0xee0a('0x14')](_0x5c7cfa)[_0xee0a('0x25')](_0x1c9ad8);};}exports[_0xee0a('0x26')]=function(_0x2e7f18,_0x45538d){var _0x145332={},_0x408909={},_0x65e054={'count':0x0,'rows':[]};var _0x7b472b=_['map'](db[_0xee0a('0x27')][_0xee0a('0x28')],function(_0x284be5){return{'name':_0x284be5[_0xee0a('0x29')],'type':_0x284be5[_0xee0a('0x2a')][_0xee0a('0x2b')]};});_0x408909['model']=_[_0xee0a('0x2c')](_0x7b472b,_0xee0a('0x24'));_0x408909[_0xee0a('0x2d')]=_[_0xee0a('0x2e')](_0x2e7f18['query']);_0x408909[_0xee0a('0x2f')]=_['intersection'](_0x408909[_0xee0a('0x30')],_0x408909[_0xee0a('0x2d')]);_0x145332[_0xee0a('0x31')]=_[_0xee0a('0x32')](_0x408909[_0xee0a('0x30')],qs[_0xee0a('0x33')](_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x33')]));_0x145332['attributes']=_0x145332[_0xee0a('0x31')][_0xee0a('0x34')]?_0x145332['attributes']:_0x408909[_0xee0a('0x30')];if(!_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x35')]('nolimit')){_0x145332[_0xee0a('0x18')]=qs[_0xee0a('0x18')](_0x2e7f18[_0xee0a('0x2d')]['limit']);_0x145332[_0xee0a('0x16')]=qs[_0xee0a('0x16')](_0x2e7f18[_0xee0a('0x2d')]['offset']);}_0x145332['order']=qs[_0xee0a('0x36')](_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x36')]);_0x145332[_0xee0a('0x37')]=qs[_0xee0a('0x2f')](_[_0xee0a('0x38')](_0x2e7f18[_0xee0a('0x2d')],_0x408909[_0xee0a('0x2f')]),_0x7b472b);if(_0x2e7f18[_0xee0a('0x2d')]['filter']){_0x145332[_0xee0a('0x37')]=_[_0xee0a('0x39')](_0x145332['where'],{'$or':_[_0xee0a('0x2c')](_0x7b472b,function(_0x20a6f2){if(_0x20a6f2['type']!==_0xee0a('0x3a')){var _0x22b1c0={};_0x22b1c0[_0x20a6f2[_0xee0a('0x24')]]={'$like':'%'+_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x3b')]+'%'};return _0x22b1c0;}})});}_0x145332=_[_0xee0a('0x39')]({},_0x145332,_0x2e7f18[_0xee0a('0x3c')]);var _0x1b88df={'where':_0x145332[_0xee0a('0x37')]};return db['Cdr'][_0xee0a('0x19')](_0x1b88df)[_0xee0a('0x1f')](function(_0x41eba8){_0x65e054[_0xee0a('0x19')]=_0x41eba8;if(_0x2e7f18['query']['includeAll']){_0x145332[_0xee0a('0x3d')]=[{'all':!![]}];}return db[_0xee0a('0x27')][_0xee0a('0x3e')](_0x145332);})[_0xee0a('0x1f')](function(_0x1b69b9){_0x65e054[_0xee0a('0x3f')]=_0x1b69b9;return _0x65e054;})[_0xee0a('0x1f')](respondWithFilteredResult(_0x45538d,_0x145332))['catch'](handleError(_0x45538d,null));};exports['show']=function(_0x285543,_0x283062){var _0x587ee3={'raw':!![],'where':{'id':_0x285543[_0xee0a('0x40')]['id']}},_0x3293b5={};_0x3293b5['model']=_[_0xee0a('0x2e')](db[_0xee0a('0x27')][_0xee0a('0x28')]);_0x3293b5[_0xee0a('0x2d')]=_[_0xee0a('0x2e')](_0x285543[_0xee0a('0x2d')]);_0x3293b5[_0xee0a('0x2f')]=_['intersection'](_0x3293b5['model'],_0x3293b5[_0xee0a('0x2d')]);_0x587ee3['attributes']=_['intersection'](_0x3293b5['model'],qs[_0xee0a('0x33')](_0x285543[_0xee0a('0x2d')]['fields']));_0x587ee3['attributes']=_0x587ee3['attributes']['length']?_0x587ee3[_0xee0a('0x31')]:_0x3293b5[_0xee0a('0x30')];if(_0x285543[_0xee0a('0x2d')][_0xee0a('0x41')]){_0x587ee3[_0xee0a('0x3d')]=[{'all':!![]}];}_0x587ee3=_[_0xee0a('0x39')]({},_0x587ee3,_0x285543['options']);return db[_0xee0a('0x27')]['find'](_0x587ee3)[_0xee0a('0x1f')](handleEntityNotFound(_0x283062,null))[_0xee0a('0x1f')](respondWithResult(_0x283062,null))[_0xee0a('0x42')](handleError(_0x283062,null));};exports[_0xee0a('0x43')]=function(_0x567680,_0x3ef07b){return db[_0xee0a('0x27')][_0xee0a('0x43')](_0x567680[_0xee0a('0x44')],{})[_0xee0a('0x1f')](respondWithResult(_0x3ef07b,0xc9))[_0xee0a('0x42')](handleError(_0x3ef07b,null));};exports[_0xee0a('0x45')]=function(_0x4cd7d3,_0x51300e){if(_0x4cd7d3[_0xee0a('0x44')]['id']){delete _0x4cd7d3[_0xee0a('0x44')]['id'];}return db[_0xee0a('0x27')][_0xee0a('0x46')]({'where':{'id':_0x4cd7d3[_0xee0a('0x40')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x51300e,null))[_0xee0a('0x1f')](saveUpdates(_0x4cd7d3[_0xee0a('0x44')],null))[_0xee0a('0x1f')](respondWithResult(_0x51300e,null))[_0xee0a('0x42')](handleError(_0x51300e,null));};exports[_0xee0a('0x20')]=function(_0x335356,_0x57face){return db[_0xee0a('0x27')][_0xee0a('0x46')]({'where':{'id':_0x335356[_0xee0a('0x40')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x57face,null))[_0xee0a('0x1f')](removeEntity(_0x57face,null))['catch'](handleError(_0x57face,null));};exports[_0xee0a('0x47')]=function(_0x160123,_0xc9c3a3){return db[_0xee0a('0x27')][_0xee0a('0x47')]()['then'](respondWithResult(_0xc9c3a3,null))[_0xee0a('0x42')](handleError(_0xc9c3a3,null));};
\ No newline at end of file
+var _0x919e=['Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','map'];(function(_0x24fa83,_0x4df1a8){var _0x520fd3=function(_0x7c12f1){while(--_0x7c12f1){_0x24fa83['push'](_0x24fa83['shift']());}};_0x520fd3(++_0x4df1a8);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe919('0x0'));var rimraf=require(_0xe919('0x1'));var zipdir=require(_0xe919('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe919('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe919('0x4'));var util=require(_0xe919('0x5'));var path=require(_0xe919('0x6'));var sox=require(_0xe919('0x7'));var csv=require(_0xe919('0x8'));var ejs=require(_0xe919('0x9'));var fs=require('fs');var fs_extra=require(_0xe919('0xa'));var _=require('lodash');var squel=require(_0xe919('0xb'));var crypto=require(_0xe919('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe919('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe919('0xe'));var Papa=require(_0xe919('0xf'));var Redis=require(_0xe919('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe919('0x11'));var as=require(_0xe919('0x12'));var hardwareService=require(_0xe919('0x13'));var logger=require('../../config/logger')(_0xe919('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe919('0x15'))['db'];function respondWithStatusCode(_0xb06def,_0x40d013){_0x40d013=_0x40d013||0xcc;return function(_0x525f3e){if(_0x525f3e){return _0xb06def['sendStatus'](_0x40d013);}return _0xb06def[_0xe919('0x16')](_0x40d013)[_0xe919('0x17')]();};}function respondWithResult(_0x5c44d4,_0x3c09be){_0x3c09be=_0x3c09be||0xc8;return function(_0x1f88a0){if(_0x1f88a0){return _0x5c44d4[_0xe919('0x16')](_0x3c09be)[_0xe919('0x18')](_0x1f88a0);}};}function respondWithFilteredResult(_0x1e2bdd,_0x20d095){return function(_0x33b067){if(_0x33b067){var _0x5768f8=typeof _0x20d095[_0xe919('0x19')]==='undefined'&&typeof _0x20d095['limit']===_0xe919('0x1a');var _0x1ca098=_0x33b067['count'];var _0x4b3ea3=_0x5768f8?0x0:_0x20d095['offset'];var _0x1c820f=_0x5768f8?_0x33b067[_0xe919('0x1b')]:_0x20d095[_0xe919('0x19')]+_0x20d095[_0xe919('0x1c')];var _0x4a6945;if(_0x1c820f>=_0x1ca098){_0x1c820f=_0x1ca098;_0x4a6945=0xc8;}else{_0x4a6945=0xce;}_0x1e2bdd['status'](_0x4a6945);return _0x1e2bdd[_0xe919('0x1d')](_0xe919('0x1e'),_0x4b3ea3+'-'+_0x1c820f+'/'+_0x1ca098)[_0xe919('0x18')](_0x33b067);}return null;};}function patchUpdates(_0xd2a816){return function(_0x48d99f){try{jsonpatch[_0xe919('0x1f')](_0x48d99f,_0xd2a816,!![]);}catch(_0xc39074){return BPromise['reject'](_0xc39074);}return _0x48d99f['save']();};}function saveUpdates(_0x175b39,_0x483515){return function(_0x53e428){if(_0x53e428){return _0x53e428[_0xe919('0x20')](_0x175b39)[_0xe919('0x21')](function(_0x57056a){return _0x57056a;});}return null;};}function removeEntity(_0x26e01d,_0x5694b0){return function(_0x422934){if(_0x422934){return _0x422934[_0xe919('0x22')]()['then'](function(){_0x26e01d[_0xe919('0x16')](0xcc)[_0xe919('0x17')]();});}};}function handleEntityNotFound(_0x4607f5,_0x509bfa){return function(_0x2bb8d6){if(!_0x2bb8d6){_0x4607f5[_0xe919('0x23')](0x194);}return _0x2bb8d6;};}function handleError(_0x58f7a3,_0x19580b){_0x19580b=_0x19580b||0x1f4;return function(_0x354849){logger[_0xe919('0x24')](_0x354849['stack']);if(_0x354849[_0xe919('0x25')]){delete _0x354849['name'];}_0x58f7a3[_0xe919('0x16')](_0x19580b)[_0xe919('0x26')](_0x354849);};}exports['index']=function(_0x29b693,_0x5adb9b){var _0x101522={},_0x46d4f4={},_0x16d3a2={'count':0x0,'rows':[]};var _0x50e5cc=_[_0xe919('0x27')](db[_0xe919('0x28')][_0xe919('0x29')],function(_0x1090d4){return{'name':_0x1090d4[_0xe919('0x2a')],'type':_0x1090d4[_0xe919('0x2b')][_0xe919('0x2c')]};});_0x46d4f4[_0xe919('0x2d')]=_['map'](_0x50e5cc,_0xe919('0x25'));_0x46d4f4[_0xe919('0x2e')]=_['keys'](_0x29b693['query']);_0x46d4f4[_0xe919('0x2f')]=_[_0xe919('0x30')](_0x46d4f4[_0xe919('0x2d')],_0x46d4f4[_0xe919('0x2e')]);_0x101522[_0xe919('0x31')]=_[_0xe919('0x30')](_0x46d4f4[_0xe919('0x2d')],qs[_0xe919('0x32')](_0x29b693['query'][_0xe919('0x32')]));_0x101522[_0xe919('0x31')]=_0x101522[_0xe919('0x31')][_0xe919('0x33')]?_0x101522[_0xe919('0x31')]:_0x46d4f4[_0xe919('0x2d')];if(!_0x29b693[_0xe919('0x2e')][_0xe919('0x34')](_0xe919('0x35'))){_0x101522['limit']=qs[_0xe919('0x1c')](_0x29b693['query'][_0xe919('0x1c')]);_0x101522['offset']=qs['offset'](_0x29b693[_0xe919('0x2e')]['offset']);}_0x101522[_0xe919('0x36')]=qs[_0xe919('0x37')](_0x29b693['query']['sort']);_0x101522[_0xe919('0x38')]=qs[_0xe919('0x2f')](_[_0xe919('0x39')](_0x29b693[_0xe919('0x2e')],_0x46d4f4[_0xe919('0x2f')]),_0x50e5cc);if(_0x29b693[_0xe919('0x2e')][_0xe919('0x3a')]){_0x101522[_0xe919('0x38')]=_[_0xe919('0x3b')](_0x101522[_0xe919('0x38')],{'$or':_[_0xe919('0x27')](_0x50e5cc,function(_0x160774){if(_0x160774[_0xe919('0x2b')]!==_0xe919('0x3c')){var _0x35de99={};_0x35de99[_0x160774['name']]={'$like':'%'+_0x29b693[_0xe919('0x2e')][_0xe919('0x3a')]+'%'};return _0x35de99;}})});}_0x101522=_['merge']({},_0x101522,_0x29b693[_0xe919('0x3d')]);var _0xe34037={'where':_0x101522[_0xe919('0x38')]};return db[_0xe919('0x28')][_0xe919('0x1b')](_0xe34037)[_0xe919('0x21')](function(_0x48a291){_0x16d3a2[_0xe919('0x1b')]=_0x48a291;if(_0x29b693['query'][_0xe919('0x3e')]){_0x101522[_0xe919('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0xe919('0x40')](_0x101522);})[_0xe919('0x21')](function(_0x717cce){_0x16d3a2[_0xe919('0x41')]=_0x717cce;return _0x16d3a2;})[_0xe919('0x21')](respondWithFilteredResult(_0x5adb9b,_0x101522))[_0xe919('0x42')](handleError(_0x5adb9b,null));};exports[_0xe919('0x43')]=function(_0x347384,_0xf4ec66){var _0x435bd8={'raw':!![],'where':{'id':_0x347384[_0xe919('0x44')]['id']}},_0x4cbdea={};_0x4cbdea['model']=_['keys'](db[_0xe919('0x28')][_0xe919('0x29')]);_0x4cbdea['query']=_[_0xe919('0x45')](_0x347384[_0xe919('0x2e')]);_0x4cbdea[_0xe919('0x2f')]=_['intersection'](_0x4cbdea[_0xe919('0x2d')],_0x4cbdea[_0xe919('0x2e')]);_0x435bd8[_0xe919('0x31')]=_[_0xe919('0x30')](_0x4cbdea['model'],qs[_0xe919('0x32')](_0x347384[_0xe919('0x2e')]['fields']));_0x435bd8[_0xe919('0x31')]=_0x435bd8[_0xe919('0x31')][_0xe919('0x33')]?_0x435bd8[_0xe919('0x31')]:_0x4cbdea[_0xe919('0x2d')];if(_0x347384['query'][_0xe919('0x3e')]){_0x435bd8['include']=[{'all':!![]}];}_0x435bd8=_[_0xe919('0x3b')]({},_0x435bd8,_0x347384[_0xe919('0x3d')]);return db[_0xe919('0x28')][_0xe919('0x46')](_0x435bd8)[_0xe919('0x21')](handleEntityNotFound(_0xf4ec66,null))[_0xe919('0x21')](respondWithResult(_0xf4ec66,null))[_0xe919('0x42')](handleError(_0xf4ec66,null));};exports['create']=function(_0x3cd8f4,_0x19d7b3){return db[_0xe919('0x28')]['create'](_0x3cd8f4[_0xe919('0x47')],{})[_0xe919('0x21')](respondWithResult(_0x19d7b3,0xc9))['catch'](handleError(_0x19d7b3,null));};exports[_0xe919('0x20')]=function(_0x3da722,_0x300d64){if(_0x3da722[_0xe919('0x47')]['id']){delete _0x3da722[_0xe919('0x47')]['id'];}return db[_0xe919('0x28')]['find']({'where':{'id':_0x3da722[_0xe919('0x44')]['id']}})[_0xe919('0x21')](handleEntityNotFound(_0x300d64,null))['then'](saveUpdates(_0x3da722[_0xe919('0x47')],null))[_0xe919('0x21')](respondWithResult(_0x300d64,null))[_0xe919('0x42')](handleError(_0x300d64,null));};exports[_0xe919('0x22')]=function(_0x125160,_0x1aae2c){return db[_0xe919('0x28')][_0xe919('0x46')]({'where':{'id':_0x125160[_0xe919('0x44')]['id']}})[_0xe919('0x21')](handleEntityNotFound(_0x1aae2c,null))['then'](removeEntity(_0x1aae2c,null))[_0xe919('0x42')](handleError(_0x1aae2c,null));};exports[_0xe919('0x48')]=function(_0x3a44bb,_0x3d4b2a){return db[_0xe919('0x28')][_0xe919('0x48')]()[_0xe919('0x21')](respondWithResult(_0x3d4b2a,null))[_0xe919('0x42')](handleError(_0x3d4b2a,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b210e18..b86a0be 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(_0x11a9e3,_0x567aef){var _0x58b7c8=function(_0x4b74f1){while(--_0x4b74f1){_0x11a9e3['push'](_0x11a9e3['shift']());}};_0x58b7c8(++_0x567aef);}(_0x7a54,0x106));var _0x47a5=function(_0x2bcd8b,_0x4e9062){_0x2bcd8b=_0x2bcd8b-0x0;var _0x4f9133=_0x7a54[_0x2bcd8b];return _0x4f9133;};'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(_0xcc5b09,_0x17464d){var _0x1f165e=function(_0x211199){while(--_0x211199){_0xcc5b09['push'](_0xcc5b09['shift']());}};_0x1f165e(++_0x17464d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 cf0b894..2079577 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 _0x09d6=['jayson/promise','http','then','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x407db6,_0x11bd0e){var _0x3013f4=function(_0x23d84e){while(--_0x23d84e){_0x407db6['push'](_0x407db6['shift']());}};_0x3013f4(++_0x11bd0e);}(_0x09d6,0xdf));var _0x609d=function(_0x5bf2a1,_0x5ec237){_0x5bf2a1=_0x5bf2a1-0x0;var _0x27b22c=_0x09d6[_0x5bf2a1];return _0x27b22c;};'use strict';var _=require(_0x609d('0x0'));var util=require('util');var moment=require(_0x609d('0x1'));var BPromise=require(_0x609d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x609d('0x3'));var db=require(_0x609d('0x4'))['db'];var utils=require(_0x609d('0x5'));var logger=require('../../config/logger')(_0x609d('0x6'));var config=require(_0x609d('0x7'));var jayson=require(_0x609d('0x8'));var client=jayson['client'][_0x609d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17ef50,_0x104d2e,_0x1e1499){return new BPromise(function(_0x5017b3,_0x3810a8){return client['request'](_0x17ef50,_0x1e1499)[_0x609d('0xa')](function(_0x58c921){logger['info']('Cdr,\x20%s,\x20%s',_0x104d2e,_0x609d('0xb'));logger[_0x609d('0xc')](_0x609d('0xd'),_0x104d2e,_0x609d('0xb'),JSON[_0x609d('0xe')](_0x58c921));if(_0x58c921[_0x609d('0xf')]){if(_0x58c921['error'][_0x609d('0x10')]===0x1f4){logger['error'](_0x609d('0x11'),_0x104d2e,_0x58c921['error']['message']);return _0x3810a8(_0x58c921[_0x609d('0xf')][_0x609d('0x12')]);}logger[_0x609d('0xf')](_0x609d('0x11'),_0x104d2e,_0x58c921[_0x609d('0xf')][_0x609d('0x12')]);return _0x5017b3(_0x58c921[_0x609d('0xf')][_0x609d('0x12')]);}else{logger[_0x609d('0x13')](_0x609d('0x11'),_0x104d2e,_0x609d('0xb'));_0x5017b3(_0x58c921[_0x609d('0x14')][_0x609d('0x12')]);}})['catch'](function(_0x207651){logger[_0x609d('0xf')](_0x609d('0x11'),_0x104d2e,_0x207651);_0x3810a8(_0x207651);});});}
\ No newline at end of file
+var _0x75ac=['jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x7b192a,_0x4db383){var _0x33ba94=function(_0x14e55a){while(--_0x14e55a){_0x7b192a['push'](_0x7b192a['shift']());}};_0x33ba94(++_0x4db383);}(_0x75ac,0x151));var _0xc75a=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x75ac[_0x363ef8];return _0x148822;};'use strict';var _=require('lodash');var util=require(_0xc75a('0x0'));var moment=require(_0xc75a('0x1'));var BPromise=require(_0xc75a('0x2'));var rs=require(_0xc75a('0x3'));var fs=require('fs');var Redis=require(_0xc75a('0x4'));var db=require(_0xc75a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc75a('0x6'));var config=require(_0xc75a('0x7'));var jayson=require(_0xc75a('0x8'));var client=jayson[_0xc75a('0x9')][_0xc75a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189897,_0x303e75,_0x408923){return new BPromise(function(_0xadaaac,_0xbc9677){return client[_0xc75a('0xb')](_0x189897,_0x408923)[_0xc75a('0xc')](function(_0x5024c7){logger[_0xc75a('0xd')]('Cdr,\x20%s,\x20%s',_0x303e75,_0xc75a('0xe'));logger[_0xc75a('0xf')](_0xc75a('0x10'),_0x303e75,_0xc75a('0xe'),JSON[_0xc75a('0x11')](_0x5024c7));if(_0x5024c7[_0xc75a('0x12')]){if(_0x5024c7[_0xc75a('0x12')][_0xc75a('0x13')]===0x1f4){logger[_0xc75a('0x12')](_0xc75a('0x14'),_0x303e75,_0x5024c7[_0xc75a('0x12')][_0xc75a('0x15')]);return _0xbc9677(_0x5024c7[_0xc75a('0x12')][_0xc75a('0x15')]);}logger[_0xc75a('0x12')](_0xc75a('0x14'),_0x303e75,_0x5024c7[_0xc75a('0x12')][_0xc75a('0x15')]);return _0xadaaac(_0x5024c7[_0xc75a('0x12')][_0xc75a('0x15')]);}else{logger[_0xc75a('0xd')](_0xc75a('0x14'),_0x303e75,_0xc75a('0xe'));_0xadaaac(_0x5024c7['result'][_0xc75a('0x15')]);}})[_0xc75a('0x16')](function(_0x4026a5){logger['error'](_0xc75a('0x14'),_0x303e75,_0x4026a5);_0xbc9677(_0x4026a5);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index d8fdea0..c9207c6 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2c5c39,_0x2f303f){var _0x36c20f=function(_0x27310c){while(--_0x27310c){_0x2c5c39['push'](_0x2c5c39['shift']());}};_0x36c20f(++_0x2f303f);}(_0xb10b,0x12a));var _0xbb10=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xb10b[_0x555069];return _0x100af7;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2e9bbe7..e18fb4d 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 _0x1859=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x1859,0x183));var _0x9185=function(_0x49aea6,_0x164d24){_0x49aea6=_0x49aea6-0x0;var _0x54f4d4=_0x1859[_0x49aea6];return _0x54f4d4;};'use strict';var Sequelize=require(_0x9185('0x0'));module[_0x9185('0x1')]={'priority':{'type':Sequelize[_0x9185('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9185('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9185('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9185('0x3')],'defaultValue':_0x9185('0x5')}};
\ No newline at end of file
+var _0xa06c=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0xa06c,0x125));var _0xca06=function(_0xb82f1b,_0x412bde){_0xb82f1b=_0xb82f1b-0x0;var _0x35cdbf=_0xa06c[_0xb82f1b];return _0x35cdbf;};'use strict';var Sequelize=require('sequelize');module[_0xca06('0x0')]={'priority':{'type':Sequelize[_0xca06('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xca06('0x2')],'allowNull':![],'defaultValue':_0xca06('0x3')},'appdata':{'type':Sequelize[_0xca06('0x4')]()},'description':{'type':Sequelize[_0xca06('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xca06('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 2f4319b..fe3a1cd 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 _0x30fe=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x30fe,0x149));var _0xe30f=function(_0x1ae8d4,_0x3ae445){_0x1ae8d4=_0x1ae8d4-0x0;var _0x3d48c6=_0x30fe[_0x1ae8d4];return _0x3d48c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe30f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe30f('0x1'));var rp=require('request-promise');var moment=require(_0xe30f('0x2'));var BPromise=require(_0xe30f('0x3'));var Mustache=require(_0xe30f('0x4'));var util=require(_0xe30f('0x5'));var path=require(_0xe30f('0x6'));var sox=require('sox');var csv=require(_0xe30f('0x7'));var ejs=require(_0xe30f('0x8'));var fs=require('fs');var fs_extra=require(_0xe30f('0x9'));var _=require(_0xe30f('0xa'));var squel=require(_0xe30f('0xb'));var crypto=require(_0xe30f('0xc'));var jsforce=require(_0xe30f('0xd'));var deskjs=require(_0xe30f('0xe'));var toCsv=require(_0xe30f('0x7'));var querystring=require(_0xe30f('0xf'));var Papa=require('papaparse');var Redis=require(_0xe30f('0x10'));var authService=require(_0xe30f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe30f('0x12'));var hardwareService=require(_0xe30f('0x13'));var logger=require(_0xe30f('0x14'))(_0xe30f('0x15'));var utils=require('../../config/utils');var config=require(_0xe30f('0x16'));var licenseUtil=require(_0xe30f('0x17'));var db=require(_0xe30f('0x18'))['db'];function respondWithStatusCode(_0x583eb9,_0x3859df){_0x3859df=_0x3859df||0xcc;return function(_0x19970e){if(_0x19970e){return _0x583eb9[_0xe30f('0x19')](_0x3859df);}return _0x583eb9['status'](_0x3859df)[_0xe30f('0x1a')]();};}function respondWithResult(_0x460e07,_0x122e2a){_0x122e2a=_0x122e2a||0xc8;return function(_0x7d684c){if(_0x7d684c){return _0x460e07['status'](_0x122e2a)['json'](_0x7d684c);}};}function respondWithFilteredResult(_0x5ac4b2,_0x3c9680){return function(_0x494ad3){if(_0x494ad3){var _0x2b6a9b=typeof _0x3c9680[_0xe30f('0x1b')]==='undefined'&&typeof _0x3c9680[_0xe30f('0x1c')]==='undefined';var _0x2dbb2b=_0x494ad3[_0xe30f('0x1d')];var _0x406c98=_0x2b6a9b?0x0:_0x3c9680[_0xe30f('0x1b')];var _0x17024a=_0x2b6a9b?_0x494ad3['count']:_0x3c9680['offset']+_0x3c9680[_0xe30f('0x1c')];var _0x535873;if(_0x17024a>=_0x2dbb2b){_0x17024a=_0x2dbb2b;_0x535873=0xc8;}else{_0x535873=0xce;}_0x5ac4b2[_0xe30f('0x1e')](_0x535873);return _0x5ac4b2['set'](_0xe30f('0x1f'),_0x406c98+'-'+_0x17024a+'/'+_0x2dbb2b)[_0xe30f('0x20')](_0x494ad3);}return null;};}function patchUpdates(_0x2c4d1f){return function(_0x2a0432){try{jsonpatch[_0xe30f('0x21')](_0x2a0432,_0x2c4d1f,!![]);}catch(_0x5b33fa){return BPromise[_0xe30f('0x22')](_0x5b33fa);}return _0x2a0432['save']();};}function saveUpdates(_0xf66c5a,_0x5af7b5){return function(_0x322ee0){if(_0x322ee0){return _0x322ee0[_0xe30f('0x23')](_0xf66c5a)[_0xe30f('0x24')](function(_0x42833a){return _0x42833a;});}return null;};}function removeEntity(_0x7f7b1f,_0x378d6f){return function(_0x50bca4){if(_0x50bca4){return _0x50bca4[_0xe30f('0x25')]()['then'](function(){_0x7f7b1f[_0xe30f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4fbe,_0x4fc220){return function(_0x11a539){if(!_0x11a539){_0x4d4fbe['sendStatus'](0x194);}return _0x11a539;};}function handleError(_0x412015,_0x25e3cf){_0x25e3cf=_0x25e3cf||0x1f4;return function(_0x37c716){logger[_0xe30f('0x26')](_0x37c716[_0xe30f('0x27')]);if(_0x37c716[_0xe30f('0x28')]){delete _0x37c716['name'];}_0x412015[_0xe30f('0x1e')](_0x25e3cf)[_0xe30f('0x29')](_0x37c716);};}exports['show']=function(_0x15a217,_0x2d67d4){var _0x5a6cc3={'raw':!![],'where':{'id':_0x15a217['params']['id']}},_0x500626={};_0x500626[_0xe30f('0x2a')]=_[_0xe30f('0x2b')](db[_0xe30f('0x2c')][_0xe30f('0x2d')]);_0x500626[_0xe30f('0x2e')]=_[_0xe30f('0x2b')](_0x15a217['query']);_0x500626[_0xe30f('0x2f')]=_['intersection'](_0x500626[_0xe30f('0x2a')],_0x500626[_0xe30f('0x2e')]);_0x5a6cc3[_0xe30f('0x30')]=_[_0xe30f('0x31')](_0x500626['model'],qs[_0xe30f('0x32')](_0x15a217[_0xe30f('0x2e')][_0xe30f('0x32')]));_0x5a6cc3['attributes']=_0x5a6cc3[_0xe30f('0x30')]['length']?_0x5a6cc3[_0xe30f('0x30')]:_0x500626[_0xe30f('0x2a')];if(_0x15a217[_0xe30f('0x2e')][_0xe30f('0x33')]){_0x5a6cc3['include']=[{'all':!![]}];}_0x5a6cc3=_[_0xe30f('0x34')]({},_0x5a6cc3,_0x15a217[_0xe30f('0x35')]);return db[_0xe30f('0x2c')][_0xe30f('0x36')](_0x5a6cc3)[_0xe30f('0x24')](handleEntityNotFound(_0x2d67d4,null))[_0xe30f('0x24')](respondWithResult(_0x2d67d4,null))[_0xe30f('0x37')](handleError(_0x2d67d4,null));};exports['update']=function(_0x139915,_0xcc659c){if(_0x139915[_0xe30f('0x38')]['id']){delete _0x139915['body']['id'];}return db[_0xe30f('0x2c')][_0xe30f('0x36')]({'where':{'id':_0x139915['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0xcc659c,null))['then'](saveUpdates(_0x139915[_0xe30f('0x38')],null))['then'](respondWithResult(_0xcc659c,null))['catch'](handleError(_0xcc659c,null));};exports['destroy']=function(_0xf09327,_0x86fbbc){return db['ChatApplication'][_0xe30f('0x36')]({'where':{'id':_0xf09327['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0x86fbbc,null))[_0xe30f('0x24')](removeEntity(_0x86fbbc,null))[_0xe30f('0x37')](handleError(_0x86fbbc,null));};
\ No newline at end of file
+var _0x205d=['intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','keys'];(function(_0xb4a6da,_0x4c1e9e){var _0x4f7bea=function(_0x443f96){while(--_0x443f96){_0xb4a6da['push'](_0xb4a6da['shift']());}};_0x4f7bea(++_0x4c1e9e);}(_0x205d,0xf6));var _0xd205=function(_0x4f4e4b,_0x46ea73){_0x4f4e4b=_0x4f4e4b-0x0;var _0x23a628=_0x205d[_0x4f4e4b];return _0x23a628;};'use strict';var emlformat=require(_0xd205('0x0'));var rimraf=require(_0xd205('0x1'));var zipdir=require(_0xd205('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd205('0x3'));var BPromise=require(_0xd205('0x4'));var Mustache=require(_0xd205('0x5'));var util=require('util');var path=require(_0xd205('0x6'));var sox=require(_0xd205('0x7'));var csv=require(_0xd205('0x8'));var ejs=require(_0xd205('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd205('0xa'));var squel=require(_0xd205('0xb'));var crypto=require(_0xd205('0xc'));var jsforce=require(_0xd205('0xd'));var deskjs=require(_0xd205('0xe'));var toCsv=require(_0xd205('0x8'));var querystring=require(_0xd205('0xf'));var Papa=require(_0xd205('0x10'));var Redis=require(_0xd205('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd205('0x12'));var as=require(_0xd205('0x13'));var hardwareService=require(_0xd205('0x14'));var logger=require(_0xd205('0x15'))('api');var utils=require(_0xd205('0x16'));var config=require(_0xd205('0x17'));var licenseUtil=require(_0xd205('0x18'));var db=require(_0xd205('0x19'))['db'];function respondWithStatusCode(_0x1ba89e,_0x23ec66){_0x23ec66=_0x23ec66||0xcc;return function(_0xd53838){if(_0xd53838){return _0x1ba89e['sendStatus'](_0x23ec66);}return _0x1ba89e[_0xd205('0x1a')](_0x23ec66)[_0xd205('0x1b')]();};}function respondWithResult(_0x2ad6db,_0x4f62d8){_0x4f62d8=_0x4f62d8||0xc8;return function(_0x584b3f){if(_0x584b3f){return _0x2ad6db[_0xd205('0x1a')](_0x4f62d8)['json'](_0x584b3f);}};}function respondWithFilteredResult(_0x177854,_0x4a0805){return function(_0x398fc3){if(_0x398fc3){var _0x3a907a=typeof _0x4a0805[_0xd205('0x1c')]===_0xd205('0x1d')&&typeof _0x4a0805['limit']===_0xd205('0x1d');var _0x3d88e3=_0x398fc3[_0xd205('0x1e')];var _0x135e9d=_0x3a907a?0x0:_0x4a0805[_0xd205('0x1c')];var _0x31eb94=_0x3a907a?_0x398fc3[_0xd205('0x1e')]:_0x4a0805[_0xd205('0x1c')]+_0x4a0805[_0xd205('0x1f')];var _0x5a1429;if(_0x31eb94>=_0x3d88e3){_0x31eb94=_0x3d88e3;_0x5a1429=0xc8;}else{_0x5a1429=0xce;}_0x177854[_0xd205('0x1a')](_0x5a1429);return _0x177854['set']('Content-Range',_0x135e9d+'-'+_0x31eb94+'/'+_0x3d88e3)[_0xd205('0x20')](_0x398fc3);}return null;};}function patchUpdates(_0x5c3c31){return function(_0x53b46e){try{jsonpatch[_0xd205('0x21')](_0x53b46e,_0x5c3c31,!![]);}catch(_0x3b89b4){return BPromise[_0xd205('0x22')](_0x3b89b4);}return _0x53b46e[_0xd205('0x23')]();};}function saveUpdates(_0x162c26,_0x19f710){return function(_0x2ba4cf){if(_0x2ba4cf){return _0x2ba4cf[_0xd205('0x24')](_0x162c26)[_0xd205('0x25')](function(_0x1b0fef){return _0x1b0fef;});}return null;};}function removeEntity(_0x17b032,_0x37cf59){return function(_0x436a3a){if(_0x436a3a){return _0x436a3a[_0xd205('0x26')]()[_0xd205('0x25')](function(){_0x17b032[_0xd205('0x1a')](0xcc)[_0xd205('0x1b')]();});}};}function handleEntityNotFound(_0x2c0369,_0xf798bd){return function(_0x1b5485){if(!_0x1b5485){_0x2c0369['sendStatus'](0x194);}return _0x1b5485;};}function handleError(_0x3dea83,_0x1c3609){_0x1c3609=_0x1c3609||0x1f4;return function(_0xe0f84d){logger[_0xd205('0x27')](_0xe0f84d[_0xd205('0x28')]);if(_0xe0f84d[_0xd205('0x29')]){delete _0xe0f84d['name'];}_0x3dea83['status'](_0x1c3609)['send'](_0xe0f84d);};}exports[_0xd205('0x2a')]=function(_0x12e354,_0x3bfd88){var _0x102094={'raw':!![],'where':{'id':_0x12e354[_0xd205('0x2b')]['id']}},_0x2486a5={};_0x2486a5[_0xd205('0x2c')]=_['keys'](db[_0xd205('0x2d')][_0xd205('0x2e')]);_0x2486a5[_0xd205('0x2f')]=_[_0xd205('0x30')](_0x12e354['query']);_0x2486a5['filters']=_[_0xd205('0x31')](_0x2486a5[_0xd205('0x2c')],_0x2486a5[_0xd205('0x2f')]);_0x102094['attributes']=_[_0xd205('0x31')](_0x2486a5[_0xd205('0x2c')],qs[_0xd205('0x32')](_0x12e354['query'][_0xd205('0x32')]));_0x102094[_0xd205('0x33')]=_0x102094[_0xd205('0x33')]['length']?_0x102094['attributes']:_0x2486a5[_0xd205('0x2c')];if(_0x12e354['query'][_0xd205('0x34')]){_0x102094[_0xd205('0x35')]=[{'all':!![]}];}_0x102094=_[_0xd205('0x36')]({},_0x102094,_0x12e354[_0xd205('0x37')]);return db['ChatApplication'][_0xd205('0x38')](_0x102094)['then'](handleEntityNotFound(_0x3bfd88,null))[_0xd205('0x25')](respondWithResult(_0x3bfd88,null))[_0xd205('0x39')](handleError(_0x3bfd88,null));};exports['update']=function(_0x8bbb41,_0x526378){if(_0x8bbb41[_0xd205('0x3a')]['id']){delete _0x8bbb41[_0xd205('0x3a')]['id'];}return db[_0xd205('0x2d')][_0xd205('0x38')]({'where':{'id':_0x8bbb41[_0xd205('0x2b')]['id']}})[_0xd205('0x25')](handleEntityNotFound(_0x526378,null))[_0xd205('0x25')](saveUpdates(_0x8bbb41[_0xd205('0x3a')],null))[_0xd205('0x25')](respondWithResult(_0x526378,null))[_0xd205('0x39')](handleError(_0x526378,null));};exports['destroy']=function(_0x38d565,_0x35b82a){return db['ChatApplication']['find']({'where':{'id':_0x38d565['params']['id']}})[_0xd205('0x25')](handleEntityNotFound(_0x35b82a,null))[_0xd205('0x25')](removeEntity(_0x35b82a,null))[_0xd205('0x39')](handleError(_0x35b82a,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9989de4..4b6020b 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 _0xb717=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb717,0x1b4));var _0x7b71=function(_0x557fc9,_0x39d16e){_0x557fc9=_0x557fc9-0x0;var _0x26d2c1=_0xb717[_0x557fc9];return _0x26d2c1;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b71('0xc'),'collate':_0x7b71('0xd')});};
\ No newline at end of file
+var _0xe29d=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./chatApplication.attributes','ChatApplication'];(function(_0x4ee806,_0x33c72d){var _0x3ddc84=function(_0x2571dc){while(--_0x2571dc){_0x4ee806['push'](_0x4ee806['shift']());}};_0x3ddc84(++_0x33c72d);}(_0xe29d,0x66));var _0xde29=function(_0x114b00,_0x3e8ee){_0x114b00=_0x114b00-0x0;var _0x3e0ad3=_0xe29d[_0x114b00];return _0x3e0ad3;};'use strict';var _=require(_0xde29('0x0'));var util=require('util');var logger=require(_0xde29('0x1'))(_0xde29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde29('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde29('0x4'));var config=require(_0xde29('0x5'));var attributes=require(_0xde29('0x6'));module['exports']=function(_0x151eb8,_0x17cc46){return _0x151eb8['define'](_0xde29('0x7'),attributes,{'tableName':_0xde29('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde29('0x9'),'collate':_0xde29('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index afeda19..c622c57 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 _0x6b95=['jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b95,0x19f));var _0x56b9=function(_0x51fb96,_0x1f33f7){_0x51fb96=_0x51fb96-0x0;var _0x573228=_0x6b95[_0x51fb96];return _0x573228;};'use strict';var _=require(_0x56b9('0x0'));var util=require('util');var moment=require(_0x56b9('0x1'));var BPromise=require(_0x56b9('0x2'));var rs=require(_0x56b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56b9('0x4'));var config=require('../../config/environment');var jayson=require(_0x56b9('0x5'));var client=jayson[_0x56b9('0x6')][_0x56b9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1aae21,_0x4b8148,_0x53336f){return new BPromise(function(_0x2e14a1,_0x115666){return client[_0x56b9('0x8')](_0x1aae21,_0x53336f)[_0x56b9('0x9')](function(_0x3ade31){logger[_0x56b9('0xa')](_0x56b9('0xb'),_0x4b8148,'request\x20sent');logger[_0x56b9('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4b8148,'request\x20sent',JSON[_0x56b9('0xd')](_0x3ade31));if(_0x3ade31[_0x56b9('0xe')]){if(_0x3ade31[_0x56b9('0xe')][_0x56b9('0xf')]===0x1f4){logger[_0x56b9('0xe')](_0x56b9('0xb'),_0x4b8148,_0x3ade31[_0x56b9('0xe')][_0x56b9('0x10')]);return _0x115666(_0x3ade31[_0x56b9('0xe')][_0x56b9('0x10')]);}logger['error'](_0x56b9('0xb'),_0x4b8148,_0x3ade31[_0x56b9('0xe')][_0x56b9('0x10')]);return _0x2e14a1(_0x3ade31['error']['message']);}else{logger[_0x56b9('0xa')](_0x56b9('0xb'),_0x4b8148,_0x56b9('0x11'));_0x2e14a1(_0x3ade31[_0x56b9('0x12')][_0x56b9('0x10')]);}})[_0x56b9('0x13')](function(_0x3c1b9b){logger[_0x56b9('0xe')](_0x56b9('0xb'),_0x4b8148,_0x3c1b9b);_0x115666(_0x3c1b9b);});});}
\ No newline at end of file
+var _0x61a8=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2ce563,_0x26eca2){var _0x5164e0=function(_0x19844f){while(--_0x19844f){_0x2ce563['push'](_0x2ce563['shift']());}};_0x5164e0(++_0x26eca2);}(_0x61a8,0x1cd));var _0x861a=function(_0x47c901,_0x16799f){_0x47c901=_0x47c901-0x0;var _0x5f15c8=_0x61a8[_0x47c901];return _0x5f15c8;};'use strict';var _=require(_0x861a('0x0'));var util=require('util');var moment=require(_0x861a('0x1'));var BPromise=require(_0x861a('0x2'));var rs=require(_0x861a('0x3'));var fs=require('fs');var Redis=require(_0x861a('0x4'));var db=require(_0x861a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x861a('0x6'))(_0x861a('0x7'));var config=require(_0x861a('0x8'));var jayson=require(_0x861a('0x9'));var client=jayson['client'][_0x861a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ab28d,_0x362c34,_0x744154){return new BPromise(function(_0x238dec,_0x256cae){return client[_0x861a('0xb')](_0x1ab28d,_0x744154)[_0x861a('0xc')](function(_0x54eddb){logger[_0x861a('0xd')](_0x861a('0xe'),_0x362c34,_0x861a('0xf'));logger['debug'](_0x861a('0x10'),_0x362c34,_0x861a('0xf'),JSON[_0x861a('0x11')](_0x54eddb));if(_0x54eddb['error']){if(_0x54eddb[_0x861a('0x12')][_0x861a('0x13')]===0x1f4){logger[_0x861a('0x12')](_0x861a('0xe'),_0x362c34,_0x54eddb['error'][_0x861a('0x14')]);return _0x256cae(_0x54eddb[_0x861a('0x12')][_0x861a('0x14')]);}logger['error'](_0x861a('0xe'),_0x362c34,_0x54eddb[_0x861a('0x12')][_0x861a('0x14')]);return _0x238dec(_0x54eddb[_0x861a('0x12')][_0x861a('0x14')]);}else{logger[_0x861a('0xd')]('ChatApplication,\x20%s,\x20%s',_0x362c34,_0x861a('0xf'));_0x238dec(_0x54eddb[_0x861a('0x15')][_0x861a('0x14')]);}})[_0x861a('0x16')](function(_0x38c641){logger[_0x861a('0x12')](_0x861a('0xe'),_0x362c34,_0x38c641);_0x256cae(_0x38c641);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index e1af02d..c6eba1d 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 _0xe21e=['/:id','isAuthenticated','show','put','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x2420c8,_0x540b1e){var _0x151e7c=function(_0x1218c5){while(--_0x1218c5){_0x2420c8['push'](_0x2420c8['shift']());}};_0x151e7c(++_0x540b1e);}(_0xe21e,0xd9));var _0xee21=function(_0x2a78be,_0x3686cc){_0x2a78be=_0x2a78be-0x0;var _0x5fa345=_0xe21e[_0x2a78be];return _0x5fa345;};'use strict';var multer=require('multer');var util=require(_0xee21('0x0'));var path=require(_0xee21('0x1'));var timeout=require('connect-timeout');var express=require(_0xee21('0x2'));var router=express['Router']();var fs_extra=require(_0xee21('0x3'));var auth=require(_0xee21('0x4'));var interaction=require(_0xee21('0x5'));var config=require(_0xee21('0x6'));var controller=require(_0xee21('0x7'));router['get'](_0xee21('0x8'),auth[_0xee21('0x9')](),controller[_0xee21('0xa')]);router[_0xee21('0xb')]('/:id',auth[_0xee21('0x9')](),controller[_0xee21('0xc')]);router[_0xee21('0xd')](_0xee21('0x8'),auth['isAuthenticated'](),controller[_0xee21('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x2c35=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x2c35,0x157));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x52c3('0x0'));var path=require(_0x52c3('0x1'));var timeout=require(_0x52c3('0x2'));var express=require(_0x52c3('0x3'));var router=express[_0x52c3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x52c3('0x5'));var interaction=require(_0x52c3('0x6'));var config=require(_0x52c3('0x7'));var controller=require(_0x52c3('0x8'));router[_0x52c3('0x9')](_0x52c3('0xa'),auth[_0x52c3('0xb')](),controller['show']);router[_0x52c3('0xc')](_0x52c3('0xa'),auth[_0x52c3('0xb')](),controller[_0x52c3('0xd')]);router[_0x52c3('0xe')](_0x52c3('0xa'),auth[_0x52c3('0xb')](),controller[_0x52c3('0xf')]);module[_0x52c3('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 93142ee..1c0280d 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 _0x58ea=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58ea,0xe7));var _0xa58e=function(_0x2f2940,_0x3f393e){_0x2f2940=_0x2f2940-0x0;var _0x4ad6fc=_0x58ea[_0x2f2940];return _0x4ad6fc;};'use strict';var Sequelize=require(_0xa58e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa58e('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6e75=['sequelize','exports','STRING','BOOLEAN'];(function(_0x198d47,_0x599e61){var _0x45a964=function(_0x1645cd){while(--_0x1645cd){_0x198d47['push'](_0x198d47['shift']());}};_0x45a964(++_0x599e61);}(_0x6e75,0xa4));var _0x56e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e75[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x56e7('0x0'));module[_0x56e7('0x1')]={'name':{'type':Sequelize[_0x56e7('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x56e7('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 916e800..dbd9f6f 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 _0xb20e=['count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','fields','find','create','body','describe','ChatInternalMessage','params','toInteger','addMembers','ids','getMembers','findOne','User','sort','removeMembers','addMessage','getMessages','order','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0xb20e,0x9c));var _0xeb20=function(_0x4d01bd,_0x3995ae){_0x4d01bd=_0x4d01bd-0x0;var _0x1ffff6=_0xb20e[_0x4d01bd];return _0x1ffff6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb20('0x0'));var zipdir=require(_0xeb20('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeb20('0x2'));var Mustache=require(_0xeb20('0x3'));var util=require(_0xeb20('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xeb20('0x5'));var ejs=require(_0xeb20('0x6'));var fs=require('fs');var fs_extra=require(_0xeb20('0x7'));var _=require(_0xeb20('0x8'));var squel=require(_0xeb20('0x9'));var crypto=require(_0xeb20('0xa'));var jsforce=require(_0xeb20('0xb'));var deskjs=require(_0xeb20('0xc'));var toCsv=require(_0xeb20('0x5'));var querystring=require(_0xeb20('0xd'));var Papa=require(_0xeb20('0xe'));var Redis=require('ioredis');var authService=require(_0xeb20('0xf'));var qs=require(_0xeb20('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb20('0x11'));var logger=require(_0xeb20('0x12'))(_0xeb20('0x13'));var utils=require(_0xeb20('0x14'));var config=require(_0xeb20('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb20('0x16'))['db'];config['redis']=_[_0xeb20('0x17')](config['redis'],{'host':_0xeb20('0x18'),'port':0x18eb});var socket=require(_0xeb20('0x19'))(new Redis(config[_0xeb20('0x1a')]));require(_0xeb20('0x1b'))[_0xeb20('0x1c')](socket);function respondWithStatusCode(_0x768e67,_0x3d8681){_0x3d8681=_0x3d8681||0xcc;return function(_0x35acba){if(_0x35acba){return _0x768e67[_0xeb20('0x1d')](_0x3d8681);}return _0x768e67[_0xeb20('0x1e')](_0x3d8681)[_0xeb20('0x1f')]();};}function respondWithResult(_0x319f5c,_0xf95fa2){_0xf95fa2=_0xf95fa2||0xc8;return function(_0x312483){if(_0x312483){return _0x319f5c[_0xeb20('0x1e')](_0xf95fa2)[_0xeb20('0x20')](_0x312483);}};}function respondWithFilteredResult(_0x2cb558,_0x32aabd){return function(_0x2cf635){if(_0x2cf635){var _0x665289=typeof _0x32aabd[_0xeb20('0x21')]==='undefined'&&typeof _0x32aabd[_0xeb20('0x22')]===_0xeb20('0x23');var _0x1033cb=_0x2cf635[_0xeb20('0x24')];var _0x57e2df=_0x665289?0x0:_0x32aabd[_0xeb20('0x21')];var _0x2a834d=_0x665289?_0x2cf635[_0xeb20('0x24')]:_0x32aabd[_0xeb20('0x21')]+_0x32aabd[_0xeb20('0x22')];var _0x1c1488;if(_0x2a834d>=_0x1033cb){_0x2a834d=_0x1033cb;_0x1c1488=0xc8;}else{_0x1c1488=0xce;}_0x2cb558[_0xeb20('0x1e')](_0x1c1488);return _0x2cb558[_0xeb20('0x25')](_0xeb20('0x26'),_0x57e2df+'-'+_0x2a834d+'/'+_0x1033cb)['json'](_0x2cf635);}return null;};}function patchUpdates(_0x5aa2ea){return function(_0x3fc397){try{jsonpatch[_0xeb20('0x27')](_0x3fc397,_0x5aa2ea,!![]);}catch(_0x3c4741){return BPromise[_0xeb20('0x28')](_0x3c4741);}return _0x3fc397[_0xeb20('0x29')]();};}function saveUpdates(_0x1f49b0,_0x3a8a03){return function(_0x147f9f){if(_0x147f9f){return _0x147f9f[_0xeb20('0x2a')](_0x1f49b0)[_0xeb20('0x2b')](function(_0x308e0a){return _0x308e0a;});}return null;};}function removeEntity(_0x16ec9f,_0x7b6180){return function(_0x3e7c12){if(_0x3e7c12){return _0x3e7c12[_0xeb20('0x2c')]()[_0xeb20('0x2b')](function(){_0x16ec9f[_0xeb20('0x1e')](0xcc)[_0xeb20('0x1f')]();});}};}function handleEntityNotFound(_0x4724a2,_0x19e56f){return function(_0x52b716){if(!_0x52b716){_0x4724a2[_0xeb20('0x1d')](0x194);}return _0x52b716;};}function handleError(_0x2fbbae,_0x5ae350){_0x5ae350=_0x5ae350||0x1f4;return function(_0x1bb016){logger[_0xeb20('0x2d')](_0x1bb016[_0xeb20('0x2e')]);if(_0x1bb016['name']){delete _0x1bb016[_0xeb20('0x2f')];}_0x2fbbae[_0xeb20('0x1e')](_0x5ae350)[_0xeb20('0x30')](_0x1bb016);};}exports[_0xeb20('0x31')]=function(_0x43979e,_0x1b21a5){var _0x561ee7={},_0x31a08a={},_0x3f747b={'count':0x0,'rows':[]};var _0x2d6bd=_[_0xeb20('0x32')](db[_0xeb20('0x33')][_0xeb20('0x34')],function(_0x398158){return{'name':_0x398158[_0xeb20('0x35')],'type':_0x398158[_0xeb20('0x36')][_0xeb20('0x37')]};});_0x31a08a['model']=_['map'](_0x2d6bd,_0xeb20('0x2f'));_0x31a08a[_0xeb20('0x38')]=_[_0xeb20('0x39')](_0x43979e[_0xeb20('0x38')]);_0x31a08a[_0xeb20('0x3a')]=_[_0xeb20('0x3b')](_0x31a08a[_0xeb20('0x3c')],_0x31a08a[_0xeb20('0x38')]);_0x561ee7[_0xeb20('0x3d')]=_[_0xeb20('0x3b')](_0x31a08a[_0xeb20('0x3c')],qs['fields'](_0x43979e['query']['fields']));_0x561ee7[_0xeb20('0x3d')]=_0x561ee7[_0xeb20('0x3d')][_0xeb20('0x3e')]?_0x561ee7[_0xeb20('0x3d')]:_0x31a08a[_0xeb20('0x3c')];if(!_0x43979e[_0xeb20('0x38')][_0xeb20('0x3f')](_0xeb20('0x40'))){_0x561ee7[_0xeb20('0x22')]=qs[_0xeb20('0x22')](_0x43979e[_0xeb20('0x38')][_0xeb20('0x22')]);_0x561ee7[_0xeb20('0x21')]=qs['offset'](_0x43979e[_0xeb20('0x38')][_0xeb20('0x21')]);}_0x561ee7['order']=qs['sort'](_0x43979e[_0xeb20('0x38')]['sort']);_0x561ee7[_0xeb20('0x41')]=qs[_0xeb20('0x3a')](_[_0xeb20('0x42')](_0x43979e[_0xeb20('0x38')],_0x31a08a[_0xeb20('0x3a')]),_0x2d6bd);if(_0x43979e[_0xeb20('0x38')][_0xeb20('0x43')]){_0x561ee7[_0xeb20('0x41')]=_[_0xeb20('0x44')](_0x561ee7[_0xeb20('0x41')],{'$or':_['map'](_0x2d6bd,function(_0xaf1f7e){if(_0xaf1f7e['type']!==_0xeb20('0x45')){var _0x15d648={};_0x15d648[_0xaf1f7e[_0xeb20('0x2f')]]={'$like':'%'+_0x43979e[_0xeb20('0x38')][_0xeb20('0x43')]+'%'};return _0x15d648;}})});}_0x561ee7=_[_0xeb20('0x44')]({},_0x561ee7,_0x43979e[_0xeb20('0x46')]);var _0x3ae0a6={'where':_0x561ee7[_0xeb20('0x41')]};return db[_0xeb20('0x33')][_0xeb20('0x24')](_0x3ae0a6)['then'](function(_0x3aab8b){_0x3f747b[_0xeb20('0x24')]=_0x3aab8b;if(_0x43979e['query'][_0xeb20('0x47')]){_0x561ee7[_0xeb20('0x48')]=[{'all':!![]}];}return db[_0xeb20('0x33')]['findAll'](_0x561ee7);})['then'](function(_0x4f7266){_0x3f747b[_0xeb20('0x49')]=_0x4f7266;return _0x3f747b;})[_0xeb20('0x2b')](respondWithFilteredResult(_0x1b21a5,_0x561ee7))[_0xeb20('0x4a')](handleError(_0x1b21a5,null));};exports[_0xeb20('0x4b')]=function(_0xce8583,_0x301968){var _0x40791c={'raw':!![],'where':{'id':_0xce8583['params']['id']}},_0x528345={};_0x528345[_0xeb20('0x3c')]=_['keys'](db['ChatGroup'][_0xeb20('0x34')]);_0x528345['query']=_[_0xeb20('0x39')](_0xce8583[_0xeb20('0x38')]);_0x528345[_0xeb20('0x3a')]=_[_0xeb20('0x3b')](_0x528345['model'],_0x528345[_0xeb20('0x38')]);_0x40791c[_0xeb20('0x3d')]=_[_0xeb20('0x3b')](_0x528345[_0xeb20('0x3c')],qs[_0xeb20('0x4c')](_0xce8583[_0xeb20('0x38')][_0xeb20('0x4c')]));_0x40791c[_0xeb20('0x3d')]=_0x40791c[_0xeb20('0x3d')][_0xeb20('0x3e')]?_0x40791c[_0xeb20('0x3d')]:_0x528345['model'];if(_0xce8583[_0xeb20('0x38')][_0xeb20('0x47')]){_0x40791c[_0xeb20('0x48')]=[{'all':!![]}];}_0x40791c=_['merge']({},_0x40791c,_0xce8583[_0xeb20('0x46')]);return db[_0xeb20('0x33')][_0xeb20('0x4d')](_0x40791c)[_0xeb20('0x2b')](handleEntityNotFound(_0x301968,null))[_0xeb20('0x2b')](respondWithResult(_0x301968,null))[_0xeb20('0x4a')](handleError(_0x301968,null));};exports[_0xeb20('0x4e')]=function(_0x190c74,_0x1fb46b){return db['ChatGroup'][_0xeb20('0x4e')](_0x190c74['body'],{})[_0xeb20('0x2b')](respondWithResult(_0x1fb46b,0xc9))[_0xeb20('0x4a')](handleError(_0x1fb46b,null));};exports[_0xeb20('0x2a')]=function(_0x4aa192,_0x1becc7){if(_0x4aa192[_0xeb20('0x4f')]['id']){delete _0x4aa192[_0xeb20('0x4f')]['id'];}return db[_0xeb20('0x33')][_0xeb20('0x4d')]({'where':{'id':_0x4aa192['params']['id']}})['then'](handleEntityNotFound(_0x1becc7,null))[_0xeb20('0x2b')](saveUpdates(_0x4aa192[_0xeb20('0x4f')],null))[_0xeb20('0x2b')](respondWithResult(_0x1becc7,null))[_0xeb20('0x4a')](handleError(_0x1becc7,null));};exports[_0xeb20('0x2c')]=function(_0x273a1e,_0x37ced5){return db['ChatGroup'][_0xeb20('0x4d')]({'where':{'id':_0x273a1e['params']['id']}})[_0xeb20('0x2b')](handleEntityNotFound(_0x37ced5,null))['then'](removeEntity(_0x37ced5,null))['catch'](handleError(_0x37ced5,null));};exports[_0xeb20('0x50')]=function(_0x109ac2,_0x517540){return db[_0xeb20('0x33')][_0xeb20('0x50')]()[_0xeb20('0x2b')](respondWithResult(_0x517540,null))[_0xeb20('0x4a')](handleError(_0x517540,null));};exports['getUnread']=function(_0x461e80,_0xc8851a,_0x303b6a){return db[_0xeb20('0x51')][_0xeb20('0x24')]({'where':{'ChatGroupId':_0x461e80[_0xeb20('0x52')]['id'],'ToId':_0x461e80['user']['id'],'read':![]}})[_0xeb20('0x2b')](function(_0x5b912f){return{'id':_[_0xeb20('0x53')](_0x461e80['params']['id']),'count':_0x5b912f};})[_0xeb20('0x2b')](respondWithResult(_0xc8851a,null))[_0xeb20('0x4a')](handleError(_0xc8851a,null));};exports[_0xeb20('0x54')]=function(_0x8c06ab,_0x52aba6,_0x1b19f6){return db['ChatGroup'][_0xeb20('0x4d')]({'where':{'id':_0x8c06ab['params']['id']}})['then'](handleEntityNotFound(_0x52aba6,null))['then'](function(_0x38c960){if(_0x38c960){return _0x38c960['addMembers'](_0x8c06ab[_0xeb20('0x4f')][_0xeb20('0x55')],_['omit'](_0x8c06ab['body'],['ids','id'])||{});}})[_0xeb20('0x2b')](respondWithResult(_0x52aba6,null))[_0xeb20('0x4a')](handleError(_0x52aba6,null));};exports[_0xeb20('0x56')]=function(_0x252c22,_0x55d468,_0x2a2279){var _0xe60745={};var _0x522359={};var _0x4fbbe0;var _0x3a58ef;return db['ChatGroup'][_0xeb20('0x57')]({'where':{'id':_0x252c22['params']['id']}})[_0xeb20('0x2b')](handleEntityNotFound(_0x55d468,null))['then'](function(_0x1083fd){if(_0x1083fd){_0x4fbbe0=_0x1083fd;_0x522359['model']=_['keys'](db[_0xeb20('0x58')]['rawAttributes']);_0x522359['query']=_[_0xeb20('0x39')](_0x252c22[_0xeb20('0x38')]);_0x522359['filters']=_['intersection'](_0x522359['model'],_0x522359['query']);_0xe60745[_0xeb20('0x3d')]=_[_0xeb20('0x3b')](_0x522359[_0xeb20('0x3c')],qs[_0xeb20('0x4c')](_0x252c22[_0xeb20('0x38')][_0xeb20('0x4c')]));_0xe60745[_0xeb20('0x3d')]=_0xe60745[_0xeb20('0x3d')][_0xeb20('0x3e')]?_0xe60745[_0xeb20('0x3d')]:_0x522359[_0xeb20('0x3c')];_0xe60745['order']=qs[_0xeb20('0x59')](_0x252c22['query']['sort']);_0xe60745['where']=qs[_0xeb20('0x3a')](_[_0xeb20('0x42')](_0x252c22[_0xeb20('0x38')],_0x522359[_0xeb20('0x3a')]));if(_0x252c22[_0xeb20('0x38')]['filter']){_0xe60745['where']=_['merge'](_0xe60745['where'],{'$or':_[_0xeb20('0x32')](_0xe60745[_0xeb20('0x3d')],function(_0x3c256b){var _0x36c293={};_0x36c293[_0x3c256b]={'$like':'%'+_0x252c22[_0xeb20('0x38')][_0xeb20('0x43')]+'%'};return _0x36c293;})});}_0xe60745=_['merge']({},_0xe60745,_0x252c22[_0xeb20('0x46')]);return _0x4fbbe0[_0xeb20('0x56')](_0xe60745);}})['then'](function(_0x28f116){if(_0x28f116){_0x3a58ef=_0x28f116[_0xeb20('0x3e')];if(!_0x252c22[_0xeb20('0x38')][_0xeb20('0x3f')]('nolimit')){_0xe60745[_0xeb20('0x22')]=qs['limit'](_0x252c22[_0xeb20('0x38')][_0xeb20('0x22')]);_0xe60745['offset']=qs[_0xeb20('0x21')](_0x252c22[_0xeb20('0x38')][_0xeb20('0x21')]);}return _0x4fbbe0[_0xeb20('0x56')](_0xe60745);}})[_0xeb20('0x2b')](function(_0x9b49cb){if(_0x9b49cb){return _0x9b49cb?{'count':_0x3a58ef,'rows':_0x9b49cb}:null;}})[_0xeb20('0x2b')](respondWithResult(_0x55d468,null))[_0xeb20('0x4a')](handleError(_0x55d468,null));};exports[_0xeb20('0x5a')]=function(_0x2b5557,_0xba5ddb,_0x46371f){return db['ChatGroup'][_0xeb20('0x4d')]({'where':{'id':_0x2b5557['params']['id']}})['then'](handleEntityNotFound(_0xba5ddb,null))[_0xeb20('0x2b')](function(_0x530eaf){if(_0x530eaf){return _0x530eaf['removeMembers'](_0x2b5557[_0xeb20('0x38')][_0xeb20('0x55')]);}})['then'](respondWithStatusCode(_0xba5ddb,null))[_0xeb20('0x4a')](handleError(_0xba5ddb,null));};exports[_0xeb20('0x5b')]=function(_0x5605f1,_0x56231b,_0x282105){if(_0x5605f1['body']['id']){delete _0x5605f1[_0xeb20('0x4f')]['id'];}return db[_0xeb20('0x33')]['find']({'where':{'id':_0x5605f1[_0xeb20('0x52')]['id']}})['then'](handleEntityNotFound(_0x56231b,null))[_0xeb20('0x2b')](function(_0x2f8c36){if(_0x2f8c36){_0x5605f1[_0xeb20('0x4f')]['ChatGroupId']=_0x2f8c36['id'];return db[_0xeb20('0x51')][_0xeb20('0x4e')](_0x5605f1[_0xeb20('0x4f')]);}})[_0xeb20('0x2b')](respondWithResult(_0x56231b,null))[_0xeb20('0x4a')](handleError(_0x56231b,null));};exports[_0xeb20('0x5c')]=function(_0x3b2132,_0x500217,_0x4c033a){var _0x48427d={};var _0x55de77={};var _0x2080fe;var _0x5c97e6;return db[_0xeb20('0x33')][_0xeb20('0x57')]({'where':{'id':_0x3b2132['params']['id']}})[_0xeb20('0x2b')](handleEntityNotFound(_0x500217,null))[_0xeb20('0x2b')](function(_0x59b2af){if(_0x59b2af){_0x2080fe=_0x59b2af;_0x55de77[_0xeb20('0x3c')]=_[_0xeb20('0x39')](db['ChatInternalMessage'][_0xeb20('0x34')]);_0x55de77['query']=_[_0xeb20('0x39')](_0x3b2132[_0xeb20('0x38')]);_0x55de77[_0xeb20('0x3a')]=_[_0xeb20('0x3b')](_0x55de77[_0xeb20('0x3c')],_0x55de77[_0xeb20('0x38')]);_0x48427d[_0xeb20('0x3d')]=_[_0xeb20('0x3b')](_0x55de77[_0xeb20('0x3c')],qs['fields'](_0x3b2132[_0xeb20('0x38')][_0xeb20('0x4c')]));_0x48427d[_0xeb20('0x3d')]=_0x48427d[_0xeb20('0x3d')][_0xeb20('0x3e')]?_0x48427d[_0xeb20('0x3d')]:_0x55de77['model'];_0x48427d[_0xeb20('0x5d')]=qs[_0xeb20('0x59')](_0x3b2132[_0xeb20('0x38')][_0xeb20('0x59')]);_0x48427d[_0xeb20('0x41')]=qs[_0xeb20('0x3a')](_[_0xeb20('0x42')](_0x3b2132['query'],_0x55de77[_0xeb20('0x3a')]));if(_0x3b2132[_0xeb20('0x38')][_0xeb20('0x43')]){_0x48427d[_0xeb20('0x41')]=_[_0xeb20('0x44')](_0x48427d[_0xeb20('0x41')],{'$or':_['map'](_0x48427d[_0xeb20('0x3d')],function(_0x160d31){var _0x1dbe87={};_0x1dbe87[_0x160d31]={'$like':'%'+_0x3b2132['query'][_0xeb20('0x43')]+'%'};return _0x1dbe87;})});}if(_0x3b2132[_0xeb20('0x38')]['$gte']){var _0x4e1aee=_0x3b2132['query']['$gte']['split'](',');var _0x43c02c={};_0x43c02c[_0x4e1aee[0x0]]={'$gte':moment(_0x4e1aee[0x1])[_0xeb20('0x5e')](_0xeb20('0x5f'))};_0x48427d[_0xeb20('0x41')]=_[_0xeb20('0x44')](_0x48427d[_0xeb20('0x41')],_0x43c02c);}_0x48427d=_[_0xeb20('0x44')]({},_0x48427d,_0x3b2132[_0xeb20('0x46')]);return _0x2080fe[_0xeb20('0x5c')](_0x48427d);}})[_0xeb20('0x2b')](function(_0x474fdc){if(_0x474fdc){_0x5c97e6=_0x474fdc['length'];if(!_0x3b2132[_0xeb20('0x38')][_0xeb20('0x3f')](_0xeb20('0x40'))){_0x48427d[_0xeb20('0x22')]=qs[_0xeb20('0x22')](_0x3b2132[_0xeb20('0x38')]['limit']);_0x48427d[_0xeb20('0x21')]=qs[_0xeb20('0x21')](_0x3b2132[_0xeb20('0x38')][_0xeb20('0x21')]);}return _0x2080fe['getMessages'](_0x48427d);}})['then'](function(_0x5a40dd){if(_0x5a40dd){return _0x5a40dd?{'count':_0x5c97e6,'rows':_0x5a40dd}:null;}})[_0xeb20('0x2b')](respondWithResult(_0x500217,null))[_0xeb20('0x4a')](handleError(_0x500217,null));};
\ No newline at end of file
+var _0x5750=['include','catch','show','params','length','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','hasOwnProperty','nolimit','removeMembers','addMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','status','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll'];(function(_0x550a6b,_0x473bb3){var _0x2369de=function(_0x396ab1){while(--_0x396ab1){_0x550a6b['push'](_0x550a6b['shift']());}};_0x2369de(++_0x473bb3);}(_0x5750,0xd9));var _0x0575=function(_0x321976,_0x2cb745){_0x321976=_0x321976-0x0;var _0x1537f8=_0x5750[_0x321976];return _0x1537f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0575('0x0'));var jsonpatch=require(_0x0575('0x1'));var rp=require(_0x0575('0x2'));var moment=require(_0x0575('0x3'));var BPromise=require(_0x0575('0x4'));var Mustache=require(_0x0575('0x5'));var util=require(_0x0575('0x6'));var path=require(_0x0575('0x7'));var sox=require(_0x0575('0x8'));var csv=require(_0x0575('0x9'));var ejs=require(_0x0575('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0575('0xb'));var squel=require('squel');var crypto=require(_0x0575('0xc'));var jsforce=require(_0x0575('0xd'));var deskjs=require(_0x0575('0xe'));var toCsv=require(_0x0575('0x9'));var querystring=require('querystring');var Papa=require(_0x0575('0xf'));var Redis=require('ioredis');var authService=require(_0x0575('0x10'));var qs=require(_0x0575('0x11'));var as=require(_0x0575('0x12'));var hardwareService=require(_0x0575('0x13'));var logger=require(_0x0575('0x14'))(_0x0575('0x15'));var utils=require(_0x0575('0x16'));var config=require(_0x0575('0x17'));var licenseUtil=require(_0x0575('0x18'));var db=require(_0x0575('0x19'))['db'];config[_0x0575('0x1a')]=_[_0x0575('0x1b')](config[_0x0575('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0575('0x1c'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x0575('0x1d')](socket);function respondWithStatusCode(_0x119e14,_0x5ed622){_0x5ed622=_0x5ed622||0xcc;return function(_0x139d40){if(_0x139d40){return _0x119e14[_0x0575('0x1e')](_0x5ed622);}return _0x119e14['status'](_0x5ed622)[_0x0575('0x1f')]();};}function respondWithResult(_0xeff7c4,_0x49e602){_0x49e602=_0x49e602||0xc8;return function(_0x12e251){if(_0x12e251){return _0xeff7c4['status'](_0x49e602)[_0x0575('0x20')](_0x12e251);}};}function respondWithFilteredResult(_0x4eb9e6,_0x3e6c12){return function(_0x1231c4){if(_0x1231c4){var _0x5103d9=typeof _0x3e6c12[_0x0575('0x21')]==='undefined'&&typeof _0x3e6c12[_0x0575('0x22')]===_0x0575('0x23');var _0x122c6e=_0x1231c4[_0x0575('0x24')];var _0x1963d9=_0x5103d9?0x0:_0x3e6c12['offset'];var _0x33602d=_0x5103d9?_0x1231c4[_0x0575('0x24')]:_0x3e6c12['offset']+_0x3e6c12['limit'];var _0x268fcd;if(_0x33602d>=_0x122c6e){_0x33602d=_0x122c6e;_0x268fcd=0xc8;}else{_0x268fcd=0xce;}_0x4eb9e6['status'](_0x268fcd);return _0x4eb9e6[_0x0575('0x25')](_0x0575('0x26'),_0x1963d9+'-'+_0x33602d+'/'+_0x122c6e)[_0x0575('0x20')](_0x1231c4);}return null;};}function patchUpdates(_0x444e6a){return function(_0x2b8920){try{jsonpatch['apply'](_0x2b8920,_0x444e6a,!![]);}catch(_0x40320c){return BPromise[_0x0575('0x27')](_0x40320c);}return _0x2b8920[_0x0575('0x28')]();};}function saveUpdates(_0x47af8b,_0x3e2bd6){return function(_0x489dce){if(_0x489dce){return _0x489dce[_0x0575('0x29')](_0x47af8b)['then'](function(_0x581bbb){return _0x581bbb;});}return null;};}function removeEntity(_0x3ae790,_0x2ec6a1){return function(_0x30b6aa){if(_0x30b6aa){return _0x30b6aa[_0x0575('0x2a')]()[_0x0575('0x2b')](function(){_0x3ae790[_0x0575('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x253fb9,_0x5a6d14){return function(_0x1c522a){if(!_0x1c522a){_0x253fb9[_0x0575('0x1e')](0x194);}return _0x1c522a;};}function handleError(_0x71b2e6,_0x2e23cb){_0x2e23cb=_0x2e23cb||0x1f4;return function(_0x531e96){logger[_0x0575('0x2d')](_0x531e96[_0x0575('0x2e')]);if(_0x531e96[_0x0575('0x2f')]){delete _0x531e96[_0x0575('0x2f')];}_0x71b2e6[_0x0575('0x2c')](_0x2e23cb)['send'](_0x531e96);};}exports[_0x0575('0x30')]=function(_0x52394e,_0x1f4e4e){var _0x105ac1={},_0x22a3ed={},_0x22ce4b={'count':0x0,'rows':[]};var _0x366663=_[_0x0575('0x31')](db[_0x0575('0x32')][_0x0575('0x33')],function(_0x4722f1){return{'name':_0x4722f1[_0x0575('0x34')],'type':_0x4722f1['type'][_0x0575('0x35')]};});_0x22a3ed[_0x0575('0x36')]=_[_0x0575('0x31')](_0x366663,_0x0575('0x2f'));_0x22a3ed['query']=_[_0x0575('0x37')](_0x52394e[_0x0575('0x38')]);_0x22a3ed[_0x0575('0x39')]=_[_0x0575('0x3a')](_0x22a3ed[_0x0575('0x36')],_0x22a3ed[_0x0575('0x38')]);_0x105ac1[_0x0575('0x3b')]=_[_0x0575('0x3a')](_0x22a3ed[_0x0575('0x36')],qs[_0x0575('0x3c')](_0x52394e['query'][_0x0575('0x3c')]));_0x105ac1[_0x0575('0x3b')]=_0x105ac1[_0x0575('0x3b')]['length']?_0x105ac1[_0x0575('0x3b')]:_0x22a3ed[_0x0575('0x36')];if(!_0x52394e[_0x0575('0x38')]['hasOwnProperty']('nolimit')){_0x105ac1[_0x0575('0x22')]=qs[_0x0575('0x22')](_0x52394e[_0x0575('0x38')][_0x0575('0x22')]);_0x105ac1[_0x0575('0x21')]=qs[_0x0575('0x21')](_0x52394e['query'][_0x0575('0x21')]);}_0x105ac1[_0x0575('0x3d')]=qs[_0x0575('0x3e')](_0x52394e[_0x0575('0x38')]['sort']);_0x105ac1[_0x0575('0x3f')]=qs['filters'](_[_0x0575('0x40')](_0x52394e['query'],_0x22a3ed[_0x0575('0x39')]),_0x366663);if(_0x52394e[_0x0575('0x38')]['filter']){_0x105ac1[_0x0575('0x3f')]=_[_0x0575('0x41')](_0x105ac1[_0x0575('0x3f')],{'$or':_['map'](_0x366663,function(_0xa9e10a){if(_0xa9e10a[_0x0575('0x42')]!==_0x0575('0x43')){var _0x2f330b={};_0x2f330b[_0xa9e10a['name']]={'$like':'%'+_0x52394e[_0x0575('0x38')][_0x0575('0x44')]+'%'};return _0x2f330b;}})});}_0x105ac1=_[_0x0575('0x41')]({},_0x105ac1,_0x52394e[_0x0575('0x45')]);var _0x1f97c7={'where':_0x105ac1[_0x0575('0x3f')]};return db['ChatGroup']['count'](_0x1f97c7)[_0x0575('0x2b')](function(_0x3520cf){_0x22ce4b[_0x0575('0x24')]=_0x3520cf;if(_0x52394e[_0x0575('0x38')][_0x0575('0x46')]){_0x105ac1[_0x0575('0x47')]=[{'all':!![]}];}return db[_0x0575('0x32')]['findAll'](_0x105ac1);})[_0x0575('0x2b')](function(_0x19325c){_0x22ce4b['rows']=_0x19325c;return _0x22ce4b;})[_0x0575('0x2b')](respondWithFilteredResult(_0x1f4e4e,_0x105ac1))[_0x0575('0x48')](handleError(_0x1f4e4e,null));};exports[_0x0575('0x49')]=function(_0x59509f,_0x5964a9){var _0x56ed6d={'raw':!![],'where':{'id':_0x59509f[_0x0575('0x4a')]['id']}},_0x2e2e2d={};_0x2e2e2d['model']=_[_0x0575('0x37')](db[_0x0575('0x32')][_0x0575('0x33')]);_0x2e2e2d[_0x0575('0x38')]=_[_0x0575('0x37')](_0x59509f[_0x0575('0x38')]);_0x2e2e2d['filters']=_['intersection'](_0x2e2e2d['model'],_0x2e2e2d['query']);_0x56ed6d[_0x0575('0x3b')]=_[_0x0575('0x3a')](_0x2e2e2d[_0x0575('0x36')],qs[_0x0575('0x3c')](_0x59509f[_0x0575('0x38')][_0x0575('0x3c')]));_0x56ed6d[_0x0575('0x3b')]=_0x56ed6d['attributes'][_0x0575('0x4b')]?_0x56ed6d[_0x0575('0x3b')]:_0x2e2e2d[_0x0575('0x36')];if(_0x59509f['query'][_0x0575('0x46')]){_0x56ed6d['include']=[{'all':!![]}];}_0x56ed6d=_['merge']({},_0x56ed6d,_0x59509f['options']);return db['ChatGroup'][_0x0575('0x4c')](_0x56ed6d)['then'](handleEntityNotFound(_0x5964a9,null))[_0x0575('0x2b')](respondWithResult(_0x5964a9,null))['catch'](handleError(_0x5964a9,null));};exports[_0x0575('0x4d')]=function(_0x5abb50,_0x1e999e){return db[_0x0575('0x32')][_0x0575('0x4d')](_0x5abb50['body'],{})[_0x0575('0x2b')](respondWithResult(_0x1e999e,0xc9))[_0x0575('0x48')](handleError(_0x1e999e,null));};exports[_0x0575('0x29')]=function(_0x29b807,_0x288a0a){if(_0x29b807[_0x0575('0x4e')]['id']){delete _0x29b807[_0x0575('0x4e')]['id'];}return db[_0x0575('0x32')]['find']({'where':{'id':_0x29b807[_0x0575('0x4a')]['id']}})[_0x0575('0x2b')](handleEntityNotFound(_0x288a0a,null))[_0x0575('0x2b')](saveUpdates(_0x29b807[_0x0575('0x4e')],null))[_0x0575('0x2b')](respondWithResult(_0x288a0a,null))[_0x0575('0x48')](handleError(_0x288a0a,null));};exports[_0x0575('0x2a')]=function(_0x477fec,_0x139e7f){return db['ChatGroup'][_0x0575('0x4c')]({'where':{'id':_0x477fec[_0x0575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x139e7f,null))[_0x0575('0x2b')](removeEntity(_0x139e7f,null))[_0x0575('0x48')](handleError(_0x139e7f,null));};exports[_0x0575('0x4f')]=function(_0x702d96,_0x165351){return db[_0x0575('0x32')][_0x0575('0x4f')]()[_0x0575('0x2b')](respondWithResult(_0x165351,null))[_0x0575('0x48')](handleError(_0x165351,null));};exports['getUnread']=function(_0x30b90a,_0x5ae1c9,_0x13328d){return db[_0x0575('0x50')]['count']({'where':{'ChatGroupId':_0x30b90a[_0x0575('0x4a')]['id'],'ToId':_0x30b90a[_0x0575('0x51')]['id'],'read':![]}})[_0x0575('0x2b')](function(_0x1658fc){return{'id':_[_0x0575('0x52')](_0x30b90a[_0x0575('0x4a')]['id']),'count':_0x1658fc};})[_0x0575('0x2b')](respondWithResult(_0x5ae1c9,null))[_0x0575('0x48')](handleError(_0x5ae1c9,null));};exports['addMembers']=function(_0x452482,_0x5667bb,_0x384844){return db[_0x0575('0x32')]['find']({'where':{'id':_0x452482[_0x0575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5667bb,null))[_0x0575('0x2b')](function(_0x1ad84a){if(_0x1ad84a){return _0x1ad84a[_0x0575('0x53')](_0x452482['body'][_0x0575('0x54')],_[_0x0575('0x55')](_0x452482[_0x0575('0x4e')],[_0x0575('0x54'),'id'])||{});}})[_0x0575('0x2b')](respondWithResult(_0x5667bb,null))[_0x0575('0x48')](handleError(_0x5667bb,null));};exports[_0x0575('0x56')]=function(_0x412b14,_0x112d92,_0x32bd8d){var _0x59c04b={};var _0x524d43={};var _0x3023b3;var _0x5cf01a;return db['ChatGroup'][_0x0575('0x57')]({'where':{'id':_0x412b14[_0x0575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x112d92,null))[_0x0575('0x2b')](function(_0x40ed33){if(_0x40ed33){_0x3023b3=_0x40ed33;_0x524d43[_0x0575('0x36')]=_['keys'](db['User'][_0x0575('0x33')]);_0x524d43[_0x0575('0x38')]=_[_0x0575('0x37')](_0x412b14[_0x0575('0x38')]);_0x524d43[_0x0575('0x39')]=_[_0x0575('0x3a')](_0x524d43[_0x0575('0x36')],_0x524d43[_0x0575('0x38')]);_0x59c04b[_0x0575('0x3b')]=_[_0x0575('0x3a')](_0x524d43['model'],qs['fields'](_0x412b14[_0x0575('0x38')][_0x0575('0x3c')]));_0x59c04b[_0x0575('0x3b')]=_0x59c04b[_0x0575('0x3b')][_0x0575('0x4b')]?_0x59c04b[_0x0575('0x3b')]:_0x524d43[_0x0575('0x36')];_0x59c04b[_0x0575('0x3d')]=qs[_0x0575('0x3e')](_0x412b14[_0x0575('0x38')]['sort']);_0x59c04b[_0x0575('0x3f')]=qs[_0x0575('0x39')](_['pick'](_0x412b14['query'],_0x524d43['filters']));if(_0x412b14[_0x0575('0x38')]['filter']){_0x59c04b[_0x0575('0x3f')]=_[_0x0575('0x41')](_0x59c04b[_0x0575('0x3f')],{'$or':_['map'](_0x59c04b[_0x0575('0x3b')],function(_0x5624f0){var _0x3da4ba={};_0x3da4ba[_0x5624f0]={'$like':'%'+_0x412b14['query'][_0x0575('0x44')]+'%'};return _0x3da4ba;})});}_0x59c04b=_['merge']({},_0x59c04b,_0x412b14['options']);return _0x3023b3[_0x0575('0x56')](_0x59c04b);}})['then'](function(_0x4dd44c){if(_0x4dd44c){_0x5cf01a=_0x4dd44c['length'];if(!_0x412b14['query'][_0x0575('0x58')](_0x0575('0x59'))){_0x59c04b[_0x0575('0x22')]=qs[_0x0575('0x22')](_0x412b14[_0x0575('0x38')][_0x0575('0x22')]);_0x59c04b['offset']=qs[_0x0575('0x21')](_0x412b14['query'][_0x0575('0x21')]);}return _0x3023b3[_0x0575('0x56')](_0x59c04b);}})[_0x0575('0x2b')](function(_0x379b21){if(_0x379b21){return _0x379b21?{'count':_0x5cf01a,'rows':_0x379b21}:null;}})[_0x0575('0x2b')](respondWithResult(_0x112d92,null))[_0x0575('0x48')](handleError(_0x112d92,null));};exports['removeMembers']=function(_0x2cce36,_0x18bf2f,_0x4acc4a){return db[_0x0575('0x32')]['find']({'where':{'id':_0x2cce36[_0x0575('0x4a')]['id']}})['then'](handleEntityNotFound(_0x18bf2f,null))[_0x0575('0x2b')](function(_0x1a9e71){if(_0x1a9e71){return _0x1a9e71[_0x0575('0x5a')](_0x2cce36[_0x0575('0x38')][_0x0575('0x54')]);}})[_0x0575('0x2b')](respondWithStatusCode(_0x18bf2f,null))[_0x0575('0x48')](handleError(_0x18bf2f,null));};exports[_0x0575('0x5b')]=function(_0x44d538,_0x3d675e,_0x122e45){if(_0x44d538[_0x0575('0x4e')]['id']){delete _0x44d538['body']['id'];}return db[_0x0575('0x32')][_0x0575('0x4c')]({'where':{'id':_0x44d538[_0x0575('0x4a')]['id']}})[_0x0575('0x2b')](handleEntityNotFound(_0x3d675e,null))[_0x0575('0x2b')](function(_0x4f80ba){if(_0x4f80ba){_0x44d538[_0x0575('0x4e')]['ChatGroupId']=_0x4f80ba['id'];return db[_0x0575('0x50')][_0x0575('0x4d')](_0x44d538[_0x0575('0x4e')]);}})['then'](respondWithResult(_0x3d675e,null))[_0x0575('0x48')](handleError(_0x3d675e,null));};exports[_0x0575('0x5c')]=function(_0x1e1dd9,_0x40e9d1,_0x13b070){var _0x4add81={};var _0x218b75={};var _0x29c414;var _0x169eae;return db[_0x0575('0x32')][_0x0575('0x57')]({'where':{'id':_0x1e1dd9[_0x0575('0x4a')]['id']}})[_0x0575('0x2b')](handleEntityNotFound(_0x40e9d1,null))['then'](function(_0xed1fff){if(_0xed1fff){_0x29c414=_0xed1fff;_0x218b75[_0x0575('0x36')]=_[_0x0575('0x37')](db['ChatInternalMessage'][_0x0575('0x33')]);_0x218b75[_0x0575('0x38')]=_[_0x0575('0x37')](_0x1e1dd9[_0x0575('0x38')]);_0x218b75['filters']=_[_0x0575('0x3a')](_0x218b75[_0x0575('0x36')],_0x218b75[_0x0575('0x38')]);_0x4add81[_0x0575('0x3b')]=_[_0x0575('0x3a')](_0x218b75[_0x0575('0x36')],qs[_0x0575('0x3c')](_0x1e1dd9[_0x0575('0x38')]['fields']));_0x4add81[_0x0575('0x3b')]=_0x4add81['attributes'][_0x0575('0x4b')]?_0x4add81['attributes']:_0x218b75[_0x0575('0x36')];_0x4add81[_0x0575('0x3d')]=qs['sort'](_0x1e1dd9[_0x0575('0x38')][_0x0575('0x3e')]);_0x4add81[_0x0575('0x3f')]=qs['filters'](_[_0x0575('0x40')](_0x1e1dd9[_0x0575('0x38')],_0x218b75[_0x0575('0x39')]));if(_0x1e1dd9[_0x0575('0x38')]['filter']){_0x4add81[_0x0575('0x3f')]=_[_0x0575('0x41')](_0x4add81[_0x0575('0x3f')],{'$or':_[_0x0575('0x31')](_0x4add81[_0x0575('0x3b')],function(_0x4754f4){var _0xbf4f31={};_0xbf4f31[_0x4754f4]={'$like':'%'+_0x1e1dd9['query'][_0x0575('0x44')]+'%'};return _0xbf4f31;})});}if(_0x1e1dd9[_0x0575('0x38')][_0x0575('0x5d')]){var _0x162ac9=_0x1e1dd9['query'][_0x0575('0x5d')][_0x0575('0x5e')](',');var _0x43877e={};_0x43877e[_0x162ac9[0x0]]={'$gte':moment(_0x162ac9[0x1])['format'](_0x0575('0x5f'))};_0x4add81[_0x0575('0x3f')]=_[_0x0575('0x41')](_0x4add81[_0x0575('0x3f')],_0x43877e);}_0x4add81=_[_0x0575('0x41')]({},_0x4add81,_0x1e1dd9[_0x0575('0x45')]);return _0x29c414['getMessages'](_0x4add81);}})['then'](function(_0x12a255){if(_0x12a255){_0x169eae=_0x12a255['length'];if(!_0x1e1dd9[_0x0575('0x38')][_0x0575('0x58')]('nolimit')){_0x4add81['limit']=qs[_0x0575('0x22')](_0x1e1dd9['query'][_0x0575('0x22')]);_0x4add81[_0x0575('0x21')]=qs['offset'](_0x1e1dd9[_0x0575('0x38')]['offset']);}return _0x29c414[_0x0575('0x5c')](_0x4add81);}})['then'](function(_0x1860ac){if(_0x1860ac){return _0x1860ac?{'count':_0x169eae,'rows':_0x1860ac}:null;}})[_0x0575('0x2b')](respondWithResult(_0x40e9d1,null))[_0x0575('0x48')](handleError(_0x40e9d1,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index b861763..72b3be6 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 _0x117c=['emit','hasOwnProperty','hook','setMaxListeners','remove'];(function(_0x161192,_0x4b4d12){var _0x5a643b=function(_0x388d8a){while(--_0x388d8a){_0x161192['push'](_0x161192['shift']());}};_0x5a643b(++_0x4b4d12);}(_0x117c,0x71));var _0xc117=function(_0x11c032,_0x4ca503){_0x11c032=_0x11c032-0x0;var _0x55919f=_0x117c[_0x11c032];return _0x55919f;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc117('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc117('0x1')};function emitEvent(_0x36ca43){return function(_0x2ec18c,_0x2361ee,_0x1768dc){ChatGroupEvents[_0xc117('0x2')](_0x36ca43+':'+_0x2ec18c['id'],_0x2ec18c);ChatGroupEvents['emit'](_0x36ca43,_0x2ec18c);_0x1768dc(null);};}for(var e in events){if(events[_0xc117('0x3')](e)){var event=events[e];ChatGroup[_0xc117('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x508b=['setMaxListeners','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x508b,0x1c1));var _0xb508=function(_0x49ca6b,_0x3ba842){_0x49ca6b=_0x49ca6b-0x0;var _0x1d957f=_0x508b[_0x49ca6b];return _0x1d957f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xb508('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb508('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb508('0x2')};function emitEvent(_0x592cb7){return function(_0x322891,_0x97a155,_0x22ceb1){ChatGroupEvents[_0xb508('0x3')](_0x592cb7+':'+_0x322891['id'],_0x322891);ChatGroupEvents[_0xb508('0x3')](_0x592cb7,_0x322891);_0x22ceb1(null);};}for(var e in events){if(events[_0xb508('0x4')](e)){var event=events[e];ChatGroup['hook'](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 64fa5c1..4430ee3 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 _0xe5bb=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3a5a75,_0x4c4e3c){var _0x53a146=function(_0x5aaf3a){while(--_0x5aaf3a){_0x3a5a75['push'](_0x3a5a75['shift']());}};_0x53a146(++_0x4c4e3c);}(_0xe5bb,0x1ab));var _0xbe5b=function(_0x303965,_0x580a9d){_0x303965=_0x303965-0x0;var _0x1048eb=_0xe5bb[_0x303965];return _0x1048eb;};'use strict';var _=require(_0xbe5b('0x0'));var util=require(_0xbe5b('0x1'));var logger=require(_0xbe5b('0x2'))(_0xbe5b('0x3'));var moment=require(_0xbe5b('0x4'));var BPromise=require(_0xbe5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe5b('0x6'));var rimraf=require(_0xbe5b('0x7'));var config=require(_0xbe5b('0x8'));var attributes=require(_0xbe5b('0x9'));module[_0xbe5b('0xa')]=function(_0x1af5c5,_0x3d7f92){return _0x1af5c5[_0xbe5b('0xb')](_0xbe5b('0xc'),attributes,{'tableName':_0xbe5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x109e=['define','ChatGroup','chat_groups','util','../../config/logger','bluebird','request-promise','./chatGroup.attributes'];(function(_0x17d7ee,_0x1a0d71){var _0x51f272=function(_0x37be77){while(--_0x37be77){_0x17d7ee['push'](_0x17d7ee['shift']());}};_0x51f272(++_0x1a0d71);}(_0x109e,0x1ab));var _0xe109=function(_0x4e920b,_0x329dde){_0x4e920b=_0x4e920b-0x0;var _0x40ed85=_0x109e[_0x4e920b];return _0x40ed85;};'use strict';var _=require('lodash');var util=require(_0xe109('0x0'));var logger=require(_0xe109('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe109('0x2'));var rp=require(_0xe109('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe109('0x4'));module['exports']=function(_0x53d875,_0x3cf368){return _0x53d875[_0xe109('0x5')](_0xe109('0x6'),attributes,{'tableName':_0xe109('0x7'),'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 c1c7418..94fe9e3 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 _0x0d0b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3cc870,_0x2c014b){var _0x1f6aed=function(_0x1f2fb6){while(--_0x1f2fb6){_0x3cc870['push'](_0x3cc870['shift']());}};_0x1f6aed(++_0x2c014b);}(_0x0d0b,0x1ef));var _0xb0d0=function(_0x2369e6,_0x2931a6){_0x2369e6=_0x2369e6-0x0;var _0x39f461=_0x0d0b[_0x2369e6];return _0x39f461;};'use strict';var _=require('lodash');var util=require(_0xb0d0('0x0'));var moment=require('moment');var BPromise=require(_0xb0d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0d0('0x2'));var db=require(_0xb0d0('0x3'))['db'];var utils=require(_0xb0d0('0x4'));var logger=require(_0xb0d0('0x5'))(_0xb0d0('0x6'));var config=require(_0xb0d0('0x7'));var jayson=require(_0xb0d0('0x8'));var client=jayson[_0xb0d0('0x9')]['http']({'port':0x232a});config[_0xb0d0('0xa')]=_[_0xb0d0('0xb')](config[_0xb0d0('0xa')],{'host':_0xb0d0('0xc'),'port':0x18eb});var socket=require(_0xb0d0('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xb0d0('0xe')](socket);function respondWithRpcPromise(_0x316f3e,_0x598239,_0x55f77b){return new BPromise(function(_0x42e5ea,_0x267e7f){return client[_0xb0d0('0xf')](_0x316f3e,_0x55f77b)[_0xb0d0('0x10')](function(_0x317fa4){logger[_0xb0d0('0x11')]('ChatGroup,\x20%s,\x20%s',_0x598239,_0xb0d0('0x12'));logger[_0xb0d0('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x598239,_0xb0d0('0x12'),JSON['stringify'](_0x317fa4));if(_0x317fa4[_0xb0d0('0x14')]){if(_0x317fa4['error'][_0xb0d0('0x15')]===0x1f4){logger['error'](_0xb0d0('0x16'),_0x598239,_0x317fa4[_0xb0d0('0x14')]['message']);return _0x267e7f(_0x317fa4[_0xb0d0('0x14')][_0xb0d0('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x598239,_0x317fa4['error'][_0xb0d0('0x17')]);return _0x42e5ea(_0x317fa4[_0xb0d0('0x14')]['message']);}else{logger[_0xb0d0('0x11')](_0xb0d0('0x16'),_0x598239,_0xb0d0('0x12'));_0x42e5ea(_0x317fa4[_0xb0d0('0x18')][_0xb0d0('0x17')]);}})['catch'](function(_0x2643e3){logger[_0xb0d0('0x14')](_0xb0d0('0x16'),_0x598239,_0x2643e3);_0x267e7f(_0x2643e3);});});}
\ No newline at end of file
+var _0x12c9=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x12c9,0x1c9));var _0x912c=function(_0x211c60,_0x3cc9d1){_0x211c60=_0x211c60-0x0;var _0x1623e6=_0x12c9[_0x211c60];return _0x1623e6;};'use strict';var _=require(_0x912c('0x0'));var util=require(_0x912c('0x1'));var moment=require(_0x912c('0x2'));var BPromise=require(_0x912c('0x3'));var rs=require(_0x912c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x912c('0x5'))['db'];var utils=require(_0x912c('0x6'));var logger=require(_0x912c('0x7'))(_0x912c('0x8'));var config=require(_0x912c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x912c('0xa')]({'port':0x232a});config[_0x912c('0xb')]=_[_0x912c('0xc')](config[_0x912c('0xb')],{'host':_0x912c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x912c('0xb')]));require('./chatGroup.socket')[_0x912c('0xe')](socket);function respondWithRpcPromise(_0x56f7ba,_0xf95487,_0x580a52){return new BPromise(function(_0x14f4ea,_0x53746d){return client[_0x912c('0xf')](_0x56f7ba,_0x580a52)[_0x912c('0x10')](function(_0x52bbf3){logger[_0x912c('0x11')]('ChatGroup,\x20%s,\x20%s',_0xf95487,_0x912c('0x12'));logger[_0x912c('0x13')](_0x912c('0x14'),_0xf95487,_0x912c('0x12'),JSON[_0x912c('0x15')](_0x52bbf3));if(_0x52bbf3['error']){if(_0x52bbf3[_0x912c('0x16')]['code']===0x1f4){logger[_0x912c('0x16')](_0x912c('0x17'),_0xf95487,_0x52bbf3['error'][_0x912c('0x18')]);return _0x53746d(_0x52bbf3[_0x912c('0x16')][_0x912c('0x18')]);}logger[_0x912c('0x16')](_0x912c('0x17'),_0xf95487,_0x52bbf3[_0x912c('0x16')][_0x912c('0x18')]);return _0x14f4ea(_0x52bbf3[_0x912c('0x16')][_0x912c('0x18')]);}else{logger[_0x912c('0x11')]('ChatGroup,\x20%s,\x20%s',_0xf95487,_0x912c('0x12'));_0x14f4ea(_0x52bbf3[_0x912c('0x19')][_0x912c('0x18')]);}})[_0x912c('0x1a')](function(_0xa18263){logger[_0x912c('0x16')](_0x912c('0x17'),_0xf95487,_0xa18263);_0x53746d(_0xa18263);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 42cfeff..340b38f 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 _0x76be=['./chatGroup.events','update','emit','removeListener','register','length','chatGroup:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x76be,0xa8));var _0xe76b=function(_0x9df766,_0x3495a2){_0x9df766=_0x9df766-0x0;var _0x5ddc65=_0x76be[_0x9df766];return _0x5ddc65;};'use strict';var ChatGroupEvents=require(_0xe76b('0x0'));var events=['save','remove',_0xe76b('0x1')];function createListener(_0x4d2441,_0x49e087){return function(_0x517b3e){_0x49e087[_0xe76b('0x2')](_0x4d2441,_0x517b3e);};}function removeListener(_0x194215,_0x556c95){return function(){ChatGroupEvents[_0xe76b('0x3')](_0x194215,_0x556c95);};}exports[_0xe76b('0x4')]=function(_0x44d7a9){for(var _0x3f4de0=0x0,_0x10fc7a=events[_0xe76b('0x5')];_0x3f4de0<_0x10fc7a;_0x3f4de0++){var _0x26cfee=events[_0x3f4de0];var _0x3a2731=createListener(_0xe76b('0x6')+_0x26cfee,_0x44d7a9);ChatGroupEvents['on'](_0x26cfee,_0x3a2731);}};
\ No newline at end of file
+var _0x77da=['save','remove','update','removeListener','register','chatGroup:','./chatGroup.events'];(function(_0x24c805,_0xbe445c){var _0x1ea8cb=function(_0x4fe90d){while(--_0x4fe90d){_0x24c805['push'](_0x24c805['shift']());}};_0x1ea8cb(++_0xbe445c);}(_0x77da,0x13a));var _0xa77d=function(_0x4eb142,_0x5895d6){_0x4eb142=_0x4eb142-0x0;var _0x5a3a5f=_0x77da[_0x4eb142];return _0x5a3a5f;};'use strict';var ChatGroupEvents=require(_0xa77d('0x0'));var events=[_0xa77d('0x1'),_0xa77d('0x2'),_0xa77d('0x3')];function createListener(_0x49e5af,_0x29f335){return function(_0x679ce){_0x29f335['emit'](_0x49e5af,_0x679ce);};}function removeListener(_0x183e53,_0xf1153b){return function(){ChatGroupEvents[_0xa77d('0x4')](_0x183e53,_0xf1153b);};}exports[_0xa77d('0x5')]=function(_0x15abf4){for(var _0x493083=0x0,_0x50740d=events['length'];_0x493083<_0x50740d;_0x493083++){var _0x26d1db=events[_0x493083];var _0x20f5d5=createListener(_0xa77d('0x6')+_0x26d1db,_0x15abf4);ChatGroupEvents['on'](_0x26d1db,_0x20f5d5);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 6af2aa4..7f1cc08 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 _0x222f=['put','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x222f,0x19a));var _0xf222=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x222f[_0x2dc96f];return _0xd012da;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require('path');var timeout=require(_0xf222('0x2'));var express=require(_0xf222('0x3'));var router=express['Router']();var fs_extra=require(_0xf222('0x4'));var auth=require(_0xf222('0x5'));var interaction=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var controller=require('./chatGroup.controller');router[_0xf222('0x8')]('/',auth[_0xf222('0x9')](),controller[_0xf222('0xa')]);router[_0xf222('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xf222('0xb')]);router[_0xf222('0x8')](_0xf222('0xc'),auth[_0xf222('0x9')](),controller[_0xf222('0xd')]);router[_0xf222('0x8')](_0xf222('0xe'),auth[_0xf222('0x9')](),controller[_0xf222('0xf')]);router[_0xf222('0x8')](_0xf222('0x10'),auth[_0xf222('0x9')](),controller[_0xf222('0x11')]);router[_0xf222('0x8')](_0xf222('0x12'),auth['isAuthenticated'](),controller[_0xf222('0x13')]);router[_0xf222('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf222('0x14')](_0xf222('0x10'),auth['isAuthenticated'](),controller[_0xf222('0x15')]);router['post']('/:id/messages',auth[_0xf222('0x9')](),controller['addMessage']);router[_0xf222('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf222('0x17')]('/:id',auth[_0xf222('0x9')](),controller[_0xf222('0x18')]);router[_0xf222('0x17')](_0xf222('0x10'),auth[_0xf222('0x9')](),controller[_0xf222('0x19')]);module[_0xf222('0x1a')]=router;
\ No newline at end of file
+var _0xd124=['isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x3a8d06,_0xc5596f){var _0x3c1015=function(_0x1888a5){while(--_0x1888a5){_0x3a8d06['push'](_0x3a8d06['shift']());}};_0x3c1015(++_0xc5596f);}(_0xd124,0x9f));var _0x4d12=function(_0xd9edc5,_0xdaff9e){_0xd9edc5=_0xd9edc5-0x0;var _0x2a2936=_0xd124[_0xd9edc5];return _0x2a2936;};'use strict';var multer=require(_0x4d12('0x0'));var util=require(_0x4d12('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d12('0x2'));var router=express['Router']();var fs_extra=require(_0x4d12('0x3'));var auth=require(_0x4d12('0x4'));var interaction=require(_0x4d12('0x5'));var config=require(_0x4d12('0x6'));var controller=require(_0x4d12('0x7'));router[_0x4d12('0x8')]('/',auth[_0x4d12('0x9')](),controller[_0x4d12('0xa')]);router[_0x4d12('0x8')](_0x4d12('0xb'),auth['isAuthenticated'](),controller[_0x4d12('0xc')]);router['get'](_0x4d12('0xd'),auth['isAuthenticated'](),controller[_0x4d12('0xe')]);router[_0x4d12('0x8')](_0x4d12('0xf'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x10')]);router[_0x4d12('0x8')](_0x4d12('0x11'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x12')]);router[_0x4d12('0x8')](_0x4d12('0x13'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x14')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4d12('0x15')]('/:id/members',auth['isAuthenticated'](),controller[_0x4d12('0x16')]);router[_0x4d12('0x15')](_0x4d12('0x13'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x17')]);router[_0x4d12('0x18')](_0x4d12('0xd'),auth[_0x4d12('0x9')](),controller['update']);router['delete'](_0x4d12('0xd'),auth[_0x4d12('0x9')](),controller['destroy']);router[_0x4d12('0x19')](_0x4d12('0x11'),auth[_0x4d12('0x9')](),controller[_0x4d12('0x1a')]);module[_0x4d12('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 8ee96a9..97828c1 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 _0x3276=['BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x12b58f,_0x18ffc9){var _0x350c16=function(_0x176a30){while(--_0x176a30){_0x12b58f['push'](_0x12b58f['shift']());}};_0x350c16(++_0x18ffc9);}(_0x3276,0xc7));var _0x6327=function(_0x409c6b,_0x3bd25f){_0x409c6b=_0x409c6b-0x0;var _0x13a52b=_0x3276[_0x409c6b];return _0x13a52b;};'use strict';var Sequelize=require(_0x6327('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6327('0x1')]},'ratingType':{'type':Sequelize[_0x6327('0x2')](_0x6327('0x3'),_0x6327('0x4')),'defaultValue':_0x6327('0x3')},'ratingMessage':{'type':Sequelize[_0x6327('0x5')]},'pathTranscript':{'type':Sequelize[_0x6327('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6327('0x6')]},'secondDisposition':{'type':Sequelize[_0x6327('0x6')]},'thirdDisposition':{'type':Sequelize[_0x6327('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x6327('0x6')]},'browserVersion':{'type':Sequelize[_0x6327('0x6')]},'osName':{'type':Sequelize[_0x6327('0x6')]},'osVersion':{'type':Sequelize[_0x6327('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x6327('0x6')]},'deviceType':{'type':Sequelize[_0x6327('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x6327('0x6')]},'formData':{'type':Sequelize[_0x6327('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x6327('0x7')]},'lastMsgAt':{'type':Sequelize[_0x6327('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x6327('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6327('0x6')]},'customerPort':{'type':Sequelize[_0x6327('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x6327('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x6327('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2f3a=['BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x3847b3,_0x22ffc9){var _0x2f7412=function(_0x15343d){while(--_0x15343d){_0x3847b3['push'](_0x3847b3['shift']());}};_0x2f7412(++_0x22ffc9);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x3b0879,_0x4caa55){_0x3b0879=_0x3b0879-0x0;var _0x5e6e8c=_0x2f3a[_0x3b0879];return _0x5e6e8c;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa2f3('0x1')]},'ratingType':{'type':Sequelize[_0xa2f3('0x2')](_0xa2f3('0x3'),_0xa2f3('0x4')),'defaultValue':_0xa2f3('0x3')},'ratingMessage':{'type':Sequelize[_0xa2f3('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa2f3('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa2f3('0x6')]},'secondDisposition':{'type':Sequelize[_0xa2f3('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa2f3('0x6')]},'browserVersion':{'type':Sequelize[_0xa2f3('0x6')]},'osName':{'type':Sequelize[_0xa2f3('0x6')]},'osVersion':{'type':Sequelize[_0xa2f3('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xa2f3('0x6')]},'deviceType':{'type':Sequelize[_0xa2f3('0x6')]},'referer':{'type':Sequelize[_0xa2f3('0x5')]},'customerIp':{'type':Sequelize[_0xa2f3('0x6')]},'formData':{'type':Sequelize[_0xa2f3('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xa2f3('0x7')]},'lastMsgAt':{'type':Sequelize[_0xa2f3('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa2f3('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa2f3('0x6')]},'customerPort':{'type':Sequelize[_0xa2f3('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa2f3('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 b776d90..c7a8ff5 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 _0x6588=['ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','show','params','includeAll','create','body','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','AbandonInteraction','attachmentUpload','originalname','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','basename','close','mailTranscript','server/files/chat/upload/','now','Messages','User','%s%d','agentAlias','System','customer','format','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','$gte','include','findAll','getMyMessages','includeAgent','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','download','server','files','transcript-%d-%s.zip','firstName','lastName','secret','Owner','get','mkdirSync','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','createWriteStream','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','stack','name','send','merge','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','talking','answered','unmanaged','total','UserId','waiting','closed','disposition','abandoned','index','ChatInteraction','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','end','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','keys','some','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','a.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','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x56f6e3,_0x4be59b){var _0x4f86e8=function(_0x55e562){while(--_0x55e562){_0x56f6e3['push'](_0x56f6e3['shift']());}};_0x4f86e8(++_0x4be59b);}(_0x6588,0x80));var _0x8658=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x6588[_0x209ec9];return _0x129b1b;};'use strict';var emlformat=require(_0x8658('0x0'));var rimraf=require(_0x8658('0x1'));var zipdir=require(_0x8658('0x2'));var jsonpatch=require(_0x8658('0x3'));var rp=require('request-promise');var moment=require(_0x8658('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8658('0x5'));var util=require(_0x8658('0x6'));var path=require(_0x8658('0x7'));var sox=require(_0x8658('0x8'));var csv=require(_0x8658('0x9'));var ejs=require(_0x8658('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8658('0xb'));var squel=require(_0x8658('0xc'));var crypto=require(_0x8658('0xd'));var jsforce=require(_0x8658('0xe'));var deskjs=require(_0x8658('0xf'));var toCsv=require(_0x8658('0x9'));var querystring=require('querystring');var Papa=require(_0x8658('0x10'));var Redis=require(_0x8658('0x11'));var authService=require(_0x8658('0x12'));var qs=require(_0x8658('0x13'));var as=require(_0x8658('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8658('0x15'));var logger=require(_0x8658('0x16'))(_0x8658('0x17'));var utils=require(_0x8658('0x18'));var config=require(_0x8658('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8658('0x1a'))['db'];config['redis']=_[_0x8658('0x1b')](config[_0x8658('0x1c')],{'host':_0x8658('0x1d'),'port':0x18eb});var socket=require(_0x8658('0x1e'))(new Redis(config[_0x8658('0x1c')]));require(_0x8658('0x1f'))[_0x8658('0x20')](socket);var jayson=require(_0x8658('0x21'));var client=jayson['client'][_0x8658('0x22')]({'port':0x232b});var client9004=jayson[_0x8658('0x23')][_0x8658('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x594177,_0x43beb3,_0x2a77fa,_0x15d8c8){return new BPromise(function(_0x5e9108,_0x368417){var _0x4b3a10=_0x15d8c8||client;return _0x4b3a10[_0x8658('0x24')](_0x594177,_0x2a77fa)[_0x8658('0x25')](function(_0xb49892){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x43beb3,_0x8658('0x26'));logger[_0x8658('0x27')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x43beb3,'request\x20sent',JSON[_0x8658('0x28')](_0xb49892));if(_0xb49892[_0x8658('0x29')]){if(_0xb49892[_0x8658('0x29')][_0x8658('0x2a')]===0x1f4){logger['error'](_0x8658('0x2b'),_0x43beb3,_0xb49892[_0x8658('0x29')][_0x8658('0x2c')]);return _0x368417(_0xb49892['error'][_0x8658('0x2c')]);}logger[_0x8658('0x29')](_0x8658('0x2b'),_0x43beb3,_0xb49892[_0x8658('0x29')]['message']);return _0x5e9108(_0xb49892[_0x8658('0x29')][_0x8658('0x2c')]);}else{logger[_0x8658('0x2d')](_0x8658('0x2b'),_0x43beb3,_0x8658('0x26'));_0x5e9108(_0xb49892['result'][_0x8658('0x2c')]);}})[_0x8658('0x2e')](function(_0xa00f2f){logger[_0x8658('0x29')](_0x8658('0x2b'),_0x43beb3,_0xa00f2f);_0x368417(_0xa00f2f);});});}function respondWithStatusCode(_0x48e1e6,_0x3f853c){_0x3f853c=_0x3f853c||0xcc;return function(_0x3a61c8){if(_0x3a61c8){return _0x48e1e6[_0x8658('0x2f')](_0x3f853c);}return _0x48e1e6[_0x8658('0x30')](_0x3f853c)['end']();};}function respondWithResult(_0x54a26b,_0x7cc95){_0x7cc95=_0x7cc95||0xc8;return function(_0x2d6611){if(_0x2d6611){return _0x54a26b['status'](_0x7cc95)[_0x8658('0x31')](_0x2d6611);}};}function respondWithFilteredResult(_0x58266b,_0x3224b5){return function(_0x298176){if(_0x298176){var _0x44fbaa=typeof _0x3224b5[_0x8658('0x32')]===_0x8658('0x33')&&typeof _0x3224b5['limit']===_0x8658('0x33');var _0x83551=_0x298176[_0x8658('0x34')];var _0x40d019=_0x44fbaa?0x0:_0x3224b5[_0x8658('0x32')];var _0x1e75d8=_0x44fbaa?_0x298176['count']:_0x3224b5[_0x8658('0x32')]+_0x3224b5[_0x8658('0x35')];var _0x479106;if(_0x1e75d8>=_0x83551){_0x1e75d8=_0x83551;_0x479106=0xc8;}else{_0x479106=0xce;}_0x58266b[_0x8658('0x30')](_0x479106);return _0x58266b['set'](_0x8658('0x36'),_0x40d019+'-'+_0x1e75d8+'/'+_0x83551)[_0x8658('0x31')](_0x298176);}return null;};}function patchUpdates(_0x224661){return function(_0x3591ce){try{jsonpatch[_0x8658('0x37')](_0x3591ce,_0x224661,!![]);}catch(_0x3af5b6){return BPromise[_0x8658('0x38')](_0x3af5b6);}return _0x3591ce[_0x8658('0x39')]();};}function saveUpdates(_0x1df4c5,_0x5b01a9){return function(_0x30fb82){if(_0x30fb82){return _0x30fb82[_0x8658('0x3a')](_0x1df4c5)[_0x8658('0x25')](function(_0x30bab7){return _0x30bab7;});}return null;};}function removeEntity(_0x23efc0,_0xc668b8){return function(_0x84ab1e){if(_0x84ab1e){return _0x84ab1e['destroy']()[_0x8658('0x25')](function(){_0x23efc0[_0x8658('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x550813,_0xd3647e){return function(_0x3cb9f6){if(!_0x3cb9f6){_0x550813[_0x8658('0x2f')](0x194);}return _0x3cb9f6;};}function handleError(_0x2e9638,_0x253402){_0x253402=_0x253402||0x1f4;return function(_0x4b64a5){logger[_0x8658('0x29')](_0x4b64a5[_0x8658('0x3b')]);if(_0x4b64a5[_0x8658('0x3c')]){delete _0x4b64a5[_0x8658('0x3c')];}_0x2e9638[_0x8658('0x30')](_0x253402)[_0x8658('0x3d')](_0x4b64a5);};}function getMustacheRender(_0x120c0d,_0x16dba9){return Mustache['render'](_0x120c0d,_[_0x8658('0x3e')](_0x16dba9['body'],{'contact':_0x16dba9['contact'],'message':_0x16dba9[_0x8658('0x2c')],'agent':_0x16dba9[_0x8658('0x3f')],'interaction':_0x16dba9[_0x8658('0x40')],'account':_0x16dba9[_0x8658('0x41')]}))||'';}function getInteractionUsers(_0x3f9ef9,_0x5e5573){return new BPromise(function(_0x4be3a9,_0x1bc0a3){try{if(_0x5e5573[_0x3f9ef9['id']]){_0x3f9ef9[_0x8658('0x42')]=_[_0x8658('0x43')](_0x5e5573[_0x3f9ef9['id']],function(_0x8cd391){return{'id':_0x8cd391['id'],'fullname':_0x8cd391[_0x8658('0x44')]};});}}catch(_0x229d47){_0x1bc0a3(_0x229d47);}_0x4be3a9(_0x3f9ef9);});}function getInteractionTags(_0x2cbc8d,_0x1d4b2c){return new BPromise(function(_0x30f043,_0xe798cd){try{if(_0x2cbc8d[_0x8658('0x45')]){_0x2cbc8d[_0x8658('0x46')]=[];_0x2cbc8d['TagIds'][_0x8658('0x47')](',')[_0x8658('0x48')](function(_0x55781e){_0x2cbc8d[_0x8658('0x46')]['push'](_0x1d4b2c[_0x55781e]);});}delete _0x2cbc8d[_0x8658('0x45')];}catch(_0x44539c){_0xe798cd(_0x44539c);}_0x30f043(_0x2cbc8d);});}function updateChatInteraction(_0x13444f,_0x2890aa,_0x3958bb){return new BPromise(function(_0x50978a,_0x29dd9a){return getInteractionUsers(_0x13444f,_0x3958bb)[_0x8658('0x25')](function(_0x4da848){return getInteractionTags(_0x4da848,_0x2890aa);})[_0x8658('0x25')](function(_0x2e1acd){return getStateInteraction(_0x2e1acd);})[_0x8658('0x25')](function(_0x135d17){_0x50978a(_0x135d17);})[_0x8658('0x2e')](function(_0x42a502){_0x29dd9a(_0x42a502);});});}function getStateInteraction(_0x1bba9b){return new BPromise(function(_0x1e2e9e){_0x1bba9b['waiting']=0x0;_0x1bba9b[_0x8658('0x49')]=0x0;_0x1bba9b[_0x8658('0x4a')]=0x0;_0x1bba9b[_0x8658('0x4b')]=0x0;_0x1bba9b['abandoned']=0x0;_0x1bba9b[_0x8658('0x4c')]=0x0;if(!_0x1bba9b['closed']&&!_0x1bba9b[_0x8658('0x4d')]){_0x1bba9b[_0x8658('0x4e')]+=0x1;}if(!_0x1bba9b[_0x8658('0x4f')]&&_0x1bba9b[_0x8658('0x4d')]){_0x1bba9b[_0x8658('0x49')]+=0x1;if(_0x1bba9b['waiting']){_0x1bba9b[_0x8658('0x4e')]-=0x1;}}if(_0x1bba9b[_0x8658('0x4f')]&&_0x1bba9b[_0x8658('0x50')]===_0x8658('0x51')){_0x1bba9b[_0x8658('0x51')]+=0x1;if(_0x1bba9b[_0x8658('0x4e')]){_0x1bba9b['waiting']-=0x1;}}else if(_0x1bba9b[_0x8658('0x4f')]&&!_0x1bba9b[_0x8658('0x4d')]&&_0x1bba9b['disposition']){_0x1bba9b[_0x8658('0x4b')]+=0x1;if(_0x1bba9b[_0x8658('0x4e')]){_0x1bba9b[_0x8658('0x4e')]-=0x1;}}else if(_0x1bba9b['closed']&&_0x1bba9b[_0x8658('0x4d')]){_0x1bba9b[_0x8658('0x4a')]+=0x1;if(_0x1bba9b[_0x8658('0x49')]){_0x1bba9b[_0x8658('0x49')]-=0x1;}}_0x1bba9b[_0x8658('0x4c')]+=0x1;_0x1e2e9e(_0x1bba9b);});}exports[_0x8658('0x52')]=function(_0x2cb3c1,_0x4800ba){var _0x4b7d12={},_0x38a8c3={},_0x1dbc7c={'count':0x0,'rows':[]};var _0x1ece2f=_['map'](db[_0x8658('0x53')][_0x8658('0x54')],function(_0x2a9be3){return{'name':_0x2a9be3[_0x8658('0x55')],'type':_0x2a9be3[_0x8658('0x56')]['key']};});_0x38a8c3[_0x8658('0x57')]=_[_0x8658('0x43')](_0x1ece2f,_0x8658('0x3c'));_0x38a8c3[_0x8658('0x58')]=_['keys'](_0x2cb3c1[_0x8658('0x58')]);_0x38a8c3['filters']=_[_0x8658('0x59')](_0x38a8c3[_0x8658('0x57')],_0x38a8c3[_0x8658('0x58')]);_0x4b7d12['attributes']=_[_0x8658('0x59')](_0x38a8c3[_0x8658('0x57')],qs['fields'](_0x2cb3c1['query'][_0x8658('0x5a')]));_0x4b7d12[_0x8658('0x5b')]=_0x4b7d12['attributes'][_0x8658('0x5c')]?_0x4b7d12['attributes']:_0x38a8c3['model'];if(!_0x2cb3c1[_0x8658('0x58')][_0x8658('0x5d')](_0x8658('0x5e'))){_0x4b7d12[_0x8658('0x35')]=qs[_0x8658('0x35')](_0x2cb3c1[_0x8658('0x58')][_0x8658('0x35')]);_0x4b7d12[_0x8658('0x32')]=qs[_0x8658('0x32')](_0x2cb3c1['query']['offset']);}_0x4b7d12['order']=qs[_0x8658('0x5f')](_0x2cb3c1[_0x8658('0x58')][_0x8658('0x5f')]);_0x4b7d12[_0x8658('0x60')]=qs[_0x8658('0x61')](_[_0x8658('0x62')](_0x2cb3c1['query'],_0x38a8c3[_0x8658('0x61')]),_0x1ece2f);var _0x345597=[];var _0x4069f2=squel[_0x8658('0x63')]()[_0x8658('0x64')]('id')['field']('name')[_0x8658('0x64')]('color')[_0x8658('0x65')](_0x8658('0x66'));var _0x26518c=squel[_0x8658('0x63')]()[_0x8658('0x64')](_0x8658('0x67'))[_0x8658('0x64')](_0x8658('0x68'))['field'](_0x8658('0x69'))[_0x8658('0x65')](_0x8658('0x6a'),'ui')[_0x8658('0x6b')](_0x8658('0x6c'),'u',_0x8658('0x6d'));var _0x31552e=squel['select']()[_0x8658('0x65')](_0x8658('0x6e'),'i')[_0x8658('0x6b')]('cm_contacts','c',_0x8658('0x6f'))[_0x8658('0x6b')](_0x8658('0x6c'),'o',_0x8658('0x70'))['left_join'](_0x8658('0x71'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x8658('0x6b')]('chat_messages','me',_0x8658('0x72'))[_0x8658('0x6b')](_0x8658('0x73'),'it',_0x8658('0x74'))[_0x8658('0x6b')]('tools_tags','t',_0x8658('0x75'));var _0x4436b1=squel[_0x8658('0x76')]();var _0xb93a8e=[];var _0x5b5295=squel[_0x8658('0x76')]();var _0x3ec33b;if(_0x2cb3c1['query'][_0x8658('0x77')]){_0x3ec33b=as['parseSearch'](_0x2cb3c1[_0x8658('0x58')][_0x8658('0x77')]);var _0x20d053=_0x3ec33b[_0x8658('0x78')];for(var _0x214693=0x0;_0x214693<_0x3ec33b[_0x8658('0x79')]['length'];_0x214693++){var _0x49a0ba=_0x3ec33b[_0x8658('0x79')][_0x214693];var _0x23f5d5='i';var _0x387cca=_[_0x8658('0x7a')](_0x1ece2f,[_0x8658('0x3c'),_0x49a0ba[_0x8658('0x64')]]);if(!_0x387cca){switch(_0x49a0ba[_0x8658('0x64')]){case _0x8658('0x7b'):if(_0x49a0ba[_0x8658('0x7c')]==0x1){_0x31552e['having']('`'+_0x49a0ba[_0x8658('0x64')]+'`\x20=\x200');}else{_0x31552e[_0x8658('0x7d')]('`'+_0x49a0ba[_0x8658('0x64')]+_0x8658('0x7e'));}break;case _0x8658('0x7f'):if(_0x49a0ba[_0x8658('0x80')]==='$substring'){if(_0x49a0ba[_0x8658('0x7c')][_0x8658('0x47')]('\x20')[_0x8658('0x5c')]>0x1){_0x4436b1[_0x20d053](_0x8658('0x81'),qs['getFullTextValue'](_0x49a0ba[_0x8658('0x7c')]),null);}else{var _0x320089='%'+_0x49a0ba[_0x8658('0x7c')]+'%';_0x4436b1[_0x20d053](_0x8658('0x82'),_0x320089,_0x320089,_0x320089);}}else{_0x387cca=_['find'](_0x1ece2f,['name',_0x8658('0x83')]);_0x49a0ba['field']=_0x8658('0x83');_0x27d3fe=as[_0x8658('0x84')](_0x23f5d5,_0x387cca['type'],_0x49a0ba);_0x4436b1[_0x20d053](_0x27d3fe['text'],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x85')],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x86')]);}break;case'Tag':var _0x36d608=_0x49a0ba['value'][_0x8658('0x47')](',')['map'](function(_0x519ca7){return Number(_0x519ca7);});_0x36d608[_0x8658('0x48')](function(_0x1b2835){_0x5b5295['or'](_0x8658('0x87'),'%,'+_0x1b2835+',%');});_0xb93a8e=_['union'](_0xb93a8e,_0x36d608);break;case'User':if(_0x49a0ba[_0x8658('0x80')]===_0x8658('0x88')){_0x4436b1[_0x20d053](_0x8658('0x89'),'%'+_0x49a0ba[_0x8658('0x7c')]+'%',null);}else{_0x387cca=_[_0x8658('0x7a')](_0x1ece2f,[_0x8658('0x3c'),_0x8658('0x4d')]);_0x49a0ba[_0x8658('0x64')]=_0x8658('0x4d');_0x27d3fe=as['buildExpression'](_0x23f5d5,_0x387cca['type'],_0x49a0ba);_0x4436b1[_0x20d053](_0x27d3fe[_0x8658('0x8a')],_0x27d3fe[_0x8658('0x7c')]['start'],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x86')]);}break;case'body':_0x27d3fe=as[_0x8658('0x84')]('me',null,_0x49a0ba);_0x4436b1[_0x20d053](_0x27d3fe[_0x8658('0x8a')],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x85')],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x86')]);break;}}else{var _0x27d3fe=as[_0x8658('0x84')](_0x23f5d5,_0x387cca[_0x8658('0x56')],_0x49a0ba);_0x4436b1[_0x20d053](_0x27d3fe[_0x8658('0x8a')],_0x27d3fe[_0x8658('0x7c')]['start'],_0x27d3fe[_0x8658('0x7c')][_0x8658('0x86')]);}}}else{var _0x10c337=_(_0x2cb3c1['query'])[_0x8658('0x8b')]()[_0x8658('0x43')](function(_0x27c75b){return _[_0x8658('0x8c')](_0x1ece2f,[_0x8658('0x3c'),_0x27c75b])?_0x27c75b:undefined;})[_0x8658('0x8d')]()['value']();if(!_['isEmpty'](_0x10c337)){_0x10c337[_0x8658('0x48')](function(_0xc1cea8){if(_0xc1cea8==='ChatWebsiteId'){_0x31552e[_0x8658('0x60')](_0x8658('0x8e'),[][_0x8658('0x8f')](_0x2cb3c1[_0x8658('0x58')][_0xc1cea8]));}else if(_0xc1cea8===_0x8658('0x90')){var _0x2c0f4c=JSON[_0x8658('0x91')](_0x2cb3c1[_0x8658('0x58')][_0xc1cea8])['$gte'];var _0x45344f=JSON['parse'](_0x2cb3c1['query'][_0xc1cea8])[_0x8658('0x92')];_0x31552e[_0x8658('0x60')](_0x8658('0x93'),_0x2c0f4c,_0x45344f);}else{if(_0x2cb3c1['query'][_0xc1cea8]===_0x8658('0x94')){_0x31552e['where']('i.'+_0xc1cea8+'\x20IS\x20NULL');}else{_0x31552e['where']('i.'+_0xc1cea8+_0x8658('0x95'),_0x2cb3c1['query'][_0xc1cea8]);}}});}if(_0x2cb3c1[_0x8658('0x58')][_0x8658('0x96')]){if(_0x2cb3c1[_0x8658('0x58')]['read']==0x1){_0x31552e[_0x8658('0x7d')]('`unreadMessages`\x20=\x200');}else{_0x31552e[_0x8658('0x7d')](_0x8658('0x97'));}}if(_0x2cb3c1[_0x8658('0x58')][_0x8658('0x98')]){_0xb93a8e=_[_0x8658('0x99')](_0x2cb3c1['query'][_0x8658('0x98')])?_0x2cb3c1[_0x8658('0x58')][_0x8658('0x98')]:new Array(_0x2cb3c1['query']['tag']);_0xb93a8e['forEach'](function(_0x5badc6){_0x5b5295['or'](_0x8658('0x87'),'%,'+_0x5badc6+',%');});}if(_0x2cb3c1[_0x8658('0x58')]['filter']){var _0x3517bd=_0x2cb3c1['query'][_0x8658('0x9a')]['replace']('\x5c','\x5c\x5c')[_0x8658('0x9b')](/'/g,'\x27\x27');if(qs[_0x8658('0x9c')](_0x3517bd)){_0x4436b1['or'](_0x8658('0x9d'),_0x3517bd+'%');}else{_0x4436b1['or'](_0x8658('0x9e'),qs[_0x8658('0x9f')](_0x3517bd))['or'](_0x8658('0xa0'),_0x3517bd+'%');}}}_0x31552e[_0x8658('0x60')](_0x4436b1);_0x31552e[_0x8658('0xa1')](_0x8658('0xa2'));var _0x491e44={'type':db[_0x8658('0xa3')][_0x8658('0xa4')]['SELECT'],'raw':!![]};var _0x4e07fe=_0x31552e[_0x8658('0xa5')]();_0x4e07fe[_0x8658('0x64')]('i.id');_0x4e07fe[_0x8658('0x64')](_0x8658('0xa6'),_0x8658('0x7b'));if(_0x4b7d12[_0x8658('0xa7')]){_0x4b7d12[_0x8658('0xa7')]['forEach'](function(_0x11f3b0){var _0x5b908a=_0x11f3b0[0x0]===_0x8658('0xa8')?_0x11f3b0[0x0]:'i.'+_0x11f3b0[0x0];_0x31552e[_0x8658('0xa7')](_0x5b908a,_0x11f3b0[0x1]===_0x8658('0xa9')?![]:!![]);});}if(!_['isEmpty'](_0xb93a8e)){_0x31552e[_0x8658('0x7d')](_0x5b5295);_0x4e07fe[_0x8658('0x60')](_0x8658('0xaa'),_0xb93a8e);}BPromise[_0x8658('0xab')]()[_0x8658('0x25')](function(){if(!_0x3ec33b){if(_0x2cb3c1[_0x8658('0x58')][_0x8658('0xac')])return;_0x4e07fe['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x31552e[_0x8658('0x60')](_0x8658('0xad'));return;}if(_0x2cb3c1[_0x8658('0xae')][_0x8658('0xaf')]!==_0x8658('0x3f'))return;return _0x2cb3c1[_0x8658('0xae')][_0x8658('0xb0')]({'attributes':['id'],'raw':!![]})[_0x8658('0x25')](function(_0x3e66f0){if(_[_0x8658('0xb1')](_0x3e66f0)){_0x4e07fe[_0x8658('0x60')]('i.ChatWebsiteId\x20IS\x20NULL');_0x31552e['where'](_0x8658('0xb2'));}else{_0x4e07fe['where'](_0x8658('0x8e'),_[_0x8658('0x43')](_0x3e66f0,'id'));_0x31552e['where'](_0x8658('0x8e'),_[_0x8658('0x43')](_0x3e66f0,'id'));}});})[_0x8658('0x25')](function(){if(_0x2cb3c1['user'][_0x8658('0xaf')]===_0x8658('0x3f')&&!_0x3ec33b&&!_0x2cb3c1[_0x8658('0x58')][_0x8658('0xac')])return[];return db[_0x8658('0xb3')]['query'](_0x4e07fe['toString'](),_0x491e44);})[_0x8658('0x25')](function(_0x49d079){_0x1dbc7c['count']=_0x49d079[_0x8658('0x5c')];if(_0x1dbc7c['count']===0x0)return[];return db[_0x8658('0xb3')][_0x8658('0x58')](_0x4069f2[_0x8658('0xb4')](),_0x491e44)[_0x8658('0x25')](function(_0x1ab673){_0x345597=_['keyBy'](_0x1ab673,'id');_0x491e44=_[_0x8658('0x3e')](_0x491e44,{'model':db[_0x8658('0x53')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2cb3c1[_0x8658('0x58')][_0x8658('0x5a')]){_0x4b7d12[_0x8658('0x5b')]['forEach'](function(_0x5bb576){_0x31552e[_0x8658('0x64')]('i.'+_0x5bb576);});}else{_0x31552e[_0x8658('0x64')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8658('0x7b'));_0x31552e[_0x8658('0x64')](_0x8658('0xb5'),_0x8658('0xb6'));_0x31552e[_0x8658('0x64')](_0x8658('0xb7'),'Account.mandatoryDisposition');_0x31552e[_0x8658('0x64')](_0x8658('0xb8'),_0x8658('0xa8'));_0x31552e['field'](_0x8658('0xb9'));_0x31552e[_0x8658('0x64')](_0x8658('0xba'),_0x8658('0xbb'));_0x31552e[_0x8658('0x64')](_0x8658('0xbc'),_0x8658('0xbd'));_0x31552e[_0x8658('0x64')](_0x8658('0xbe'),'Contact.email');_0x31552e['field'](_0x8658('0xbf'),_0x8658('0xc0'));_0x31552e[_0x8658('0x64')](_0x8658('0xc1'),_0x8658('0xc2'));_0x31552e[_0x8658('0x64')](_0x8658('0xc3'),_0x8658('0xc4'));_0x31552e['field']('o.fullname','Owner.fullname');_0x31552e[_0x8658('0x64')](_0x8658('0xc5'),_0x8658('0xc6'));_0x31552e['field'](_0x8658('0xc7'),'TagIds');}if(_0x4b7d12[_0x8658('0x35')])_0x31552e[_0x8658('0x35')](_0x4b7d12[_0x8658('0x35')]);if(_0x4b7d12[_0x8658('0x32')])_0x31552e['offset'](_0x4b7d12[_0x8658('0x32')]);return db[_0x8658('0xb3')]['query'](_0x31552e[_0x8658('0xb4')](),_0x491e44);})[_0x8658('0x25')](function(_0x5f5070){if(_0x5f5070['length']>0x0)_0x26518c['where'](_0x8658('0xc8'),_['map'](_0x5f5070,'id'));return db[_0x8658('0xb3')]['query'](_0x26518c[_0x8658('0xb4')](),_0x491e44)[_0x8658('0x25')](function(_0x40d6c5){var _0x140511=_['groupBy'](_0x40d6c5,_0x8658('0xc9'));var _0x3e33b7=[];_0x5f5070['forEach'](function(_0x135719){_0x3e33b7[_0x8658('0xca')](updateChatInteraction(_0x135719,_0x345597,_0x140511));});return BPromise[_0x8658('0xcb')](_0x3e33b7);});});})['then'](function(_0x2a1ac7){_0x1dbc7c[_0x8658('0xcc')]=_0x2a1ac7;return _0x1dbc7c;})[_0x8658('0x25')](respondWithFilteredResult(_0x4800ba,_0x4b7d12))[_0x8658('0x2e')](handleError(_0x4800ba,null));};exports[_0x8658('0xcd')]=function(_0x460257,_0x4988b7){var _0x83592d={'raw':![],'where':{'id':_0x460257[_0x8658('0xce')]['id']}},_0x32929e={};_0x32929e[_0x8658('0x57')]=_[_0x8658('0x8b')](db[_0x8658('0x53')]['rawAttributes']);_0x32929e[_0x8658('0x58')]=_[_0x8658('0x8b')](_0x460257[_0x8658('0x58')]);_0x32929e[_0x8658('0x61')]=_[_0x8658('0x59')](_0x32929e[_0x8658('0x57')],_0x32929e['query']);_0x83592d['attributes']=_['intersection'](_0x32929e['model'],qs[_0x8658('0x5a')](_0x460257[_0x8658('0x58')][_0x8658('0x5a')]));_0x83592d[_0x8658('0x5b')]=_0x83592d[_0x8658('0x5b')][_0x8658('0x5c')]?_0x83592d[_0x8658('0x5b')]:_0x32929e[_0x8658('0x57')];if(_0x460257[_0x8658('0x58')][_0x8658('0xcf')]){_0x83592d['include']=[{'all':!![]}];}_0x83592d=_[_0x8658('0x3e')]({},_0x83592d,_0x460257['options']);return db[_0x8658('0x53')]['find'](_0x83592d)[_0x8658('0x25')](handleEntityNotFound(_0x4988b7,null))[_0x8658('0x25')](respondWithResult(_0x4988b7,null))[_0x8658('0x2e')](handleError(_0x4988b7,null));};exports[_0x8658('0xd0')]=function(_0x1ac79f,_0x3a3c1c){return db[_0x8658('0x53')]['create'](_0x1ac79f[_0x8658('0xd1')],{})['then'](respondWithResult(_0x3a3c1c,0xc9))[_0x8658('0x2e')](handleError(_0x3a3c1c,null));};exports[_0x8658('0x3a')]=function(_0xf9ecf5,_0x2a1c89){if(_0xf9ecf5[_0x8658('0xd1')]['id']){delete _0xf9ecf5[_0x8658('0xd1')]['id'];}return db[_0x8658('0x53')][_0x8658('0x7a')]({'where':{'id':_0xf9ecf5[_0x8658('0xce')]['id']}})[_0x8658('0x25')](handleEntityNotFound(_0x2a1c89,null))[_0x8658('0x25')](saveUpdates(_0xf9ecf5['body'],null))[_0x8658('0x25')](respondWithResult(_0x2a1c89,null))['catch'](handleError(_0x2a1c89,null));};exports[_0x8658('0xd2')]=function(_0x49a424,_0x2395b5){return db[_0x8658('0x53')][_0x8658('0x7a')]({'where':{'id':_0x49a424[_0x8658('0xce')]['id']}})['then'](handleEntityNotFound(_0x2395b5,null))[_0x8658('0x25')](removeEntity(_0x2395b5,null))[_0x8658('0x2e')](handleError(_0x2395b5,null));};exports[_0x8658('0xd3')]=function(_0x2a5ea0,_0x225166){return db['ChatInteraction'][_0x8658('0xd3')]()[_0x8658('0x25')](respondWithResult(_0x225166,null))[_0x8658('0x2e')](handleError(_0x225166,null));};exports[_0x8658('0xd4')]=function(_0x4bf0de,_0x312ec6){var _0x39125f=_0x4bf0de[_0x8658('0xce')]['id'];var _0x4687fb;var _0x120bc8;var _0x2ce9de;return db[_0x8658('0x53')][_0x8658('0xd5')]({'where':{'id':_0x39125f}})['then'](function(_0x4607d2){_0x4687fb=_0x4607d2;return db[_0x8658('0xd6')][_0x8658('0xd5')]({'where':{'id':_0x4607d2[_0x8658('0xac')]},'attributes':['id',_0x8658('0xd7'),_0x8658('0xd8'),_0x8658('0xd9'),_0x8658('0xda'),_0x8658('0xdb')],'raw':!![]});})[_0x8658('0x25')](function(_0x356736){if(_0x356736&&_0x356736[_0x8658('0xd7')]&&_0x356736[_0x8658('0xd8')]){_0x120bc8=_0x356736;var _0xbb37df={'interaction':{'id':_0x39125f},'agent':{'id':_0x4bf0de[_0x8658('0xae')]['id'],'name':_0x4bf0de['user'][_0x8658('0x3c')],'fullname':_0x4bf0de[_0x8658('0xae')][_0x8658('0x44')],'email':_0x4bf0de[_0x8658('0xae')]['email']},'contact':_0x4bf0de[_0x8658('0xd1')][_0x8658('0xdc')],'account':_0x4bf0de[_0x8658('0xd1')][_0x8658('0x41')]};var _0x2052ad={'rejectUnauthorized':![],'method':_0x8658('0xdd'),'url':_0x8658('0xde'),'headers':{'X-APIKEY':_0x356736[_0x8658('0xd7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4bf0de['user'][_0x8658('0xdf')]],'buttons':null,'topic':_0x120bc8[_0x8658('0xd9')],'note':_[_0x8658('0xe0')](_0x120bc8[_0x8658('0xda')])?null:getMustacheRender(_0x120bc8[_0x8658('0xda')],_0xbb37df),'metadata':null},'redirect':_0x8658('0xe1'),'json':!![]};try{if(!_[_0x8658('0xe0')](_0x120bc8[_0x8658('0xdb')])){var _0x150fca=getMustacheRender(_0x120bc8[_0x8658('0xdb')],_0xbb37df);var _0x30023a=JSON[_0x8658('0x91')](_0x150fca);_0x2052ad['body'][_0x8658('0xe2')]=_0x30023a;}}catch(_0x440da5){throw new db['Sequelize'][(_0x8658('0xe3'))](_0x8658('0xe4'));}return rp(_0x2052ad);}else{throw new db[(_0x8658('0xa3'))][(_0x8658('0xe3'))](_0x8658('0xe5'));}})[_0x8658('0x25')](function(_0x3fbd8b){_0x2ce9de=_0x3fbd8b;if(_0x2ce9de['id']){var _0x5f92ca={'body':_0x2ce9de[_0x8658('0xe6')],'ChatWebsiteId':_0x120bc8['id'],'ChatInteractionId':_0x4687fb['id'],'direction':_0x8658('0xe7'),'UserId':_0x4bf0de[_0x8658('0xae')]['id']};return db[_0x8658('0xe8')]['create'](_0x5f92ca,{});}else{throw new db[(_0x8658('0xa3'))][(_0x8658('0xe3'))](_0x8658('0xe9'));}})[_0x8658('0x25')](function(){return _0x4687fb['updateAttributes']({'vidaooSessionId':_0x2ce9de['id']});})['then'](respondWithResult(_0x312ec6,null))[_0x8658('0x2e')](handleError(_0x312ec6,null));};exports[_0x8658('0xea')]=function(_0x3b1600,_0x542f9e){if(_0x3b1600[_0x8658('0xd1')]['id']){delete _0x3b1600[_0x8658('0xd1')]['id'];}return db['ChatInteraction'][_0x8658('0x7a')]({'where':{'id':_0x3b1600['params']['id']},'include':[{'model':db[_0x8658('0xeb')],'as':_0x8658('0x7f')}]})[_0x8658('0x25')](handleEntityNotFound(_0x542f9e,null))[_0x8658('0x25')](saveUpdates(_0x3b1600[_0x8658('0xd1')],null))[_0x8658('0x25')](respondWithResult(_0x542f9e,null))['catch'](handleError(_0x542f9e,null));};exports['abandon']=function(_0x259769,_0x58290c,_0x5cfe17){if(_0x259769[_0x8658('0xd1')]['id']){delete _0x259769[_0x8658('0xd1')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x259769[_0x8658('0xce')]['id']}})[_0x8658('0x25')](function(_0x235382){if(!_0x235382){logger[_0x8658('0x29')](_0x8658('0xec'),_0x8658('0xed'),0x194,_0x8658('0xee'));_0x58290c['sendStatus'](0x194);}else{if(_0x235382[_0x8658('0x4d')]){throw new db[(_0x8658('0xa3'))][(_0x8658('0xe3'))]('Interaction\x20already\x20assigned');}}return _0x235382;})[_0x8658('0x25')](function(_0x229db9){if(_0x229db9){return _0x229db9[_0x8658('0x3a')]({'closed':_0x259769[_0x8658('0xd1')][_0x8658('0x4f')],'disposition':_0x259769['body'][_0x8658('0x50')]})[_0x8658('0x25')](function(_0x795429){return _0x795429;});}})['then'](function(_0xe4e687){return respondWithRpcPromise(_0x8658('0xef'),'abandon',_0x259769[_0x8658('0xd1')],client9004);})[_0x8658('0x25')](respondWithResult(_0x58290c,null))['catch'](handleError(_0x58290c,null));};exports[_0x8658('0xf0')]=function(_0x190c34,_0x494399,_0x1e002b){_0x190c34[_0x8658('0xd1')][_0x8658('0x3c')]=_0x190c34['file'][_0x8658('0xf1')];_0x190c34['body']['basename']=_0x190c34[_0x8658('0xf2')][_0x8658('0xf3')];_0x190c34['body']['type']=_0x190c34[_0x8658('0xf2')][_0x8658('0xf4')];return db[_0x8658('0xf5')][_0x8658('0xd0')](_0x190c34['body'])[_0x8658('0x25')](respondWithResult(_0x494399,0xc9))['catch'](handleError(_0x494399,null));};exports[_0x8658('0xf6')]=function(_0x8dec85,_0x2a6aef,_0x11a56b){return db['ChatInteraction']['findOne']({'where':{'id':_0x8dec85[_0x8658('0xce')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2a6aef,null))[_0x8658('0x25')](function(_0x273129){if(_0x273129){if(_0x273129['closed']){return _0x2a6aef['status'](0x193)['json']({'status':0x193,'message':_0x8658('0xf7')});}return db[_0x8658('0xf5')]['findOne']({'where':{'id':_0x8dec85[_0x8658('0x58')][_0x8658('0xf8')]},'raw':!![]})[_0x8658('0x25')](handleEntityNotFound(_0x2a6aef,null));}})['then'](function(_0x2761a2){if(_0x2761a2){var _0x43dc41=_0x2761a2['ChatOfflineMessageId']!==null;var _0x5a28be=path[_0x8658('0xf9')](config[_0x8658('0xfa')],_0x8658('0xfb'));if(_0x43dc41){_0x5a28be=path[_0x8658('0xf9')](_0x5a28be,'offline-chat/');}var _0x2e2b78=path['join'](_0x5a28be,_0x2761a2[_0x8658('0xfc')]);return _0x2a6aef['download'](_0x2e2b78);}})[_0x8658('0x2e')](handleError(_0x2a6aef,null));};exports[_0x8658('0xfd')]=function(_0x5638db,_0x31a7f2){var _0x21cb07=null;var _0x1a0fc5=null;var _0x196ec1=null;var _0x2db9b7=null;if(_0x5638db[_0x8658('0xd1')]['id']){delete _0x5638db[_0x8658('0xd1')]['id'];}if(_0x5638db[_0x8658('0xd1')][_0x8658('0xfe')]){_0x2db9b7=path[_0x8658('0xf9')](config[_0x8658('0xfa')],_0x8658('0xff'),util['format']('transcript-%s.txt',Date[_0x8658('0x100')]()));_0x5638db['body']['pathTranscript']=_0x2db9b7;}return db[_0x8658('0x53')]['find']({'where':{'id':_0x5638db[_0x8658('0xce')]['id']},'include':[{'model':db[_0x8658('0xe8')],'as':_0x8658('0x101'),'include':[{'model':db[_0x8658('0x102')],'as':_0x8658('0x102')}]}]})[_0x8658('0x25')](handleEntityNotFound(_0x31a7f2,null))['then'](saveUpdates(_0x5638db[_0x8658('0xd1')],null))['then'](function(_0x5a1f70){if(_0x5a1f70){_0x21cb07=_0x5a1f70;return db[_0x8658('0xd6')]['find']({'where':{'id':_0x21cb07['ChatWebsiteId']}});}})[_0x8658('0x25')](function(_0x130a82){if(_0x130a82){_0x196ec1=_0x130a82;return db[_0x8658('0xeb')]['find']({'where':{'id':_0x21cb07['ContactId']}});}})['then'](function(_0xb54f42){if(_0xb54f42){_0x1a0fc5=_0xb54f42;if(_0x2db9b7){var _0x1966ca=null;for(var _0x3d57ba=0x1;_0x3d57ba<_0x21cb07[_0x8658('0x101')][_0x8658('0x5c')];++_0x3d57ba){_0x1966ca=_0x21cb07[_0x8658('0x101')][_0x3d57ba];var _0xb17147=_0x1966ca[_0x8658('0x4d')]?util['format'](_0x8658('0x103'),_0x196ec1[_0x8658('0x104')],_0x1966ca[_0x8658('0x4d')]):_0x8658('0x105');var _0x20d216=_0x5638db[_0x8658('0xd1')][_0x8658('0x106')]||util[_0x8658('0x107')](_0x8658('0x103'),_0x8658('0x108'),_0x1966ca[_0x8658('0x83')]);switch(_0x196ec1['agentIdentifier']){case _0x8658('0x109'):_0xb17147=_0x1966ca['UserId']?util[_0x8658('0x107')](_0x8658('0x103'),_0x196ec1['agentAlias'],_0x1966ca[_0x8658('0x4d')]):_0x8658('0x105');break;case _0x8658('0x10a'):_0xb17147=_0x1966ca['UserId']?_0x1966ca['User'][_0x8658('0x10b')]||_0x1966ca[_0x8658('0x102')]['fullname']:'System';break;case _0x8658('0x10c'):_0xb17147=_0x1966ca['UserId']?_0x1966ca[_0x8658('0x102')][_0x8658('0x44')]:_0x8658('0x105');break;default:_0xb17147=_0x1966ca[_0x8658('0x4d')]?util[_0x8658('0x107')](_0x8658('0x103'),_0x196ec1[_0x8658('0x104')],_0x1966ca['UserId']):_0x8658('0x105');}var _0x1c96b1=util['format'](_0x8658('0x10d'),moment(_0x1966ca['createdAt'])[_0x8658('0x107')](_0x8658('0x10e')),_0x1966ca[_0x8658('0x10f')]==='in'?_0x20d216:_0xb17147,_0x1966ca[_0x8658('0xd1')]);if(!_0x1966ca['secret']){fs[_0x8658('0x110')](_0x2db9b7,_0x1c96b1);}}return db[_0x8658('0x111')][_0x8658('0xd5')]({'where':{'service':!![]},'include':[{'model':db[_0x8658('0x112')],'as':_0x8658('0x113'),'raw':!![]}]});}}})[_0x8658('0x25')](function(_0x3215f9){if(_0x3215f9&&_0x3215f9[_0x8658('0x113')]&&_0x5638db['body']){var _0x157b37={'tls':{'rejectUnauthorized':![]}};if(_0x3215f9[_0x8658('0x113')][_0x8658('0x114')]){_0x157b37['service']=_0x3215f9['Smtp'][_0x8658('0x114')];}else{_0x157b37[_0x8658('0x115')]=_0x3215f9['Smtp'][_0x8658('0x115')];_0x157b37[_0x8658('0x116')]=_0x3215f9[_0x8658('0x113')][_0x8658('0x116')];_0x157b37[_0x8658('0x117')]=_0x3215f9[_0x8658('0x113')][_0x8658('0x117')];}if(_0x3215f9[_0x8658('0x113')][_0x8658('0x118')]){_0x157b37[_0x8658('0x119')]={'user':_0x3215f9[_0x8658('0x113')]['user'],'pass':_0x3215f9['Smtp'][_0x8658('0x11a')]};}return respondWithRpcPromise(_0x8658('0x11b'),_0x8658('0x11c'),{'account':_0x157b37,'message':{'from':util[_0x8658('0x107')]('\x22%s\x22\x20<%s>',_0x3215f9['name'],_0x3215f9[_0x8658('0xdf')]||_0x3215f9[_0x8658('0x113')][_0x8658('0xae')]),'to':_0x5638db['body']['mailTranscript'],'subject':_0x8658('0x11d'),'text':util[_0x8658('0x107')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5638db[_0x8658('0xd1')][_0x8658('0xfe')]),'attachments':[{'path':_0x2db9b7}]}})[_0x8658('0x25')](function(){return _0x21cb07;})[_0x8658('0x2e')](function(_0x2015e2){console[_0x8658('0x29')](_0x2015e2);});}else{return _0x21cb07;}})[_0x8658('0x25')](respondWithStatusCode(_0x31a7f2,0xc8))[_0x8658('0x2e')](handleError(_0x31a7f2,null));};exports[_0x8658('0x11e')]=function(_0x214d09,_0x8a5ed1,_0x229fca){return db[_0x8658('0xe8')][_0x8658('0x7a')]({'where':{'id':_0x214d09['params']['id']}})[_0x8658('0x25')](handleEntityNotFound(_0x8a5ed1,null))[_0x8658('0x25')](function(_0x4defb8){if(_0x4defb8){return _0x4defb8[_0x8658('0x11e')](_0x214d09[_0x8658('0xd1')][_0x8658('0x11f')],_[_0x8658('0x120')](_0x214d09[_0x8658('0xd1')],[_0x8658('0x11f'),'id'])||{});}})[_0x8658('0x25')](respondWithResult(_0x8a5ed1,null))[_0x8658('0x2e')](handleError(_0x8a5ed1,null));};exports['getMessages']=function(_0x5b0f20,_0xad624,_0x5478f6){var _0x3cb90f={'raw':![],'where':{}};var _0x366f9b={};var _0x44ef7e={'count':0x0,'rows':[]};return db[_0x8658('0x53')][_0x8658('0xd5')]({'where':{'id':_0x5b0f20[_0x8658('0xce')]['id']}})['then'](handleEntityNotFound(_0xad624,null))[_0x8658('0x25')](function(_0x1182cc){if(_0x1182cc){_0x366f9b[_0x8658('0x57')]=_[_0x8658('0x8b')](db[_0x8658('0xe8')]['rawAttributes']);_0x366f9b[_0x8658('0x58')]=_[_0x8658('0x8b')](_0x5b0f20[_0x8658('0x58')]);_0x366f9b['filters']=_[_0x8658('0x59')](_0x366f9b[_0x8658('0x57')],_0x366f9b['query']);_0x3cb90f['attributes']=_['intersection'](_0x366f9b[_0x8658('0x57')],qs[_0x8658('0x5a')](_0x5b0f20['query']['fields']));_0x3cb90f[_0x8658('0x5b')]=_0x3cb90f[_0x8658('0x5b')]['length']?_0x3cb90f[_0x8658('0x5b')]:_0x366f9b[_0x8658('0x57')];if(!_0x5b0f20[_0x8658('0x58')][_0x8658('0x5d')](_0x8658('0x5e'))){_0x3cb90f['limit']=qs[_0x8658('0x35')](_0x5b0f20['query'][_0x8658('0x35')]);_0x3cb90f['offset']=qs[_0x8658('0x32')](_0x5b0f20['query'][_0x8658('0x32')]);}_0x3cb90f['order']=qs[_0x8658('0x5f')](_0x5b0f20['query']['sort']);_0x3cb90f[_0x8658('0x60')]=qs[_0x8658('0x61')](_[_0x8658('0x62')](_0x5b0f20['query'],_0x366f9b['filters']));_0x3cb90f['where'][_0x8658('0xc9')]=_0x1182cc['id'];if(_0x5b0f20['query'][_0x8658('0x9a')]){_0x3cb90f[_0x8658('0x60')]=_[_0x8658('0x3e')](_0x3cb90f[_0x8658('0x60')],{'$or':_[_0x8658('0x43')](_0x3cb90f[_0x8658('0x5b')],function(_0x27a1d4){var _0x254ebb={};_0x254ebb[_0x27a1d4]={'$like':'%'+_0x5b0f20['query']['filter']+'%'};return _0x254ebb;})});}if(_0x5b0f20[_0x8658('0x58')]['$gte']){var _0x233f0f=_0x5b0f20[_0x8658('0x58')][_0x8658('0x121')][_0x8658('0x47')](',');var _0xe2319b={};_0xe2319b[_0x233f0f[0x0]]={'$gte':moment(_0x233f0f[0x1])[_0x8658('0x107')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3cb90f['where']=_[_0x8658('0x3e')](_0x3cb90f[_0x8658('0x60')],_0xe2319b);}_0x3cb90f=_[_0x8658('0x3e')]({},_0x3cb90f,_0x5b0f20['options']);return db[_0x8658('0xe8')][_0x8658('0x34')]({'where':_0x3cb90f['where']})[_0x8658('0x25')](function(_0x43f610){_0x44ef7e['count']=_0x43f610;if(_0x5b0f20[_0x8658('0x58')][_0x8658('0xcf')]){_0x3cb90f[_0x8658('0x122')]=[{'all':!![]}];}return db['ChatMessage'][_0x8658('0x123')](_0x3cb90f);})['then'](function(_0x5901d9){_0x44ef7e['rows']=_0x5901d9;return _0x44ef7e;});}})['then'](respondWithFilteredResult(_0xad624,_0x3cb90f))['catch'](handleError(_0xad624,null));};exports[_0x8658('0x124')]=function(_0x1a3325,_0x7da060,_0x43c496){var _0x329b3b={'where':{}},_0xc50fdd={},_0x52b3fd={'count':0x0,'rows':[]};return db[_0x8658('0x53')][_0x8658('0xd5')]({'where':{'id':_0x1a3325[_0x8658('0xce')]['id']}})[_0x8658('0x25')](handleEntityNotFound(_0x7da060,null))[_0x8658('0x25')](function(_0x3cd027){if(_0x3cd027){_0xc50fdd[_0x8658('0x57')]=_['keys'](db[_0x8658('0xe8')][_0x8658('0x54')]);_0xc50fdd[_0x8658('0x58')]=_['keys'](_0x1a3325['query']);_0xc50fdd[_0x8658('0x61')]=_[_0x8658('0x59')](_0xc50fdd[_0x8658('0x57')],_0xc50fdd[_0x8658('0x58')]);_0x329b3b[_0x8658('0x5b')]=_[_0x8658('0x59')](_0xc50fdd['model'],qs[_0x8658('0x5a')](_0x1a3325[_0x8658('0x58')]['fields']));_0x329b3b[_0x8658('0x5b')]=_0x329b3b[_0x8658('0x5b')]['length']?_0x329b3b[_0x8658('0x5b')]:_0xc50fdd['model'];if(!_0x1a3325['query']['hasOwnProperty'](_0x8658('0x5e'))){_0x329b3b['limit']=qs[_0x8658('0x35')](_0x1a3325['query'][_0x8658('0x35')]);_0x329b3b[_0x8658('0x32')]=qs[_0x8658('0x32')](_0x1a3325['query'][_0x8658('0x32')]);}_0x329b3b['order']=qs[_0x8658('0x5f')](_0x1a3325[_0x8658('0x58')][_0x8658('0x5f')]);_0x329b3b[_0x8658('0x60')]=qs[_0x8658('0x61')](_[_0x8658('0x62')](_0x1a3325[_0x8658('0x58')],_0xc50fdd['filters']));_0x329b3b[_0x8658('0x60')][_0x8658('0xc9')]=_0x3cd027['id'];if(_0x1a3325['query']['filter']){_0x329b3b[_0x8658('0x60')]=_[_0x8658('0x3e')](_0x329b3b[_0x8658('0x60')],{'$or':_[_0x8658('0x43')](_0x329b3b[_0x8658('0x5b')],function(_0x279e8d){var _0x3ed303={};_0x3ed303[_0x279e8d]={'$like':'%'+_0x1a3325[_0x8658('0x58')][_0x8658('0x9a')]+'%'};return _0x3ed303;})});}_0x329b3b['where']['secret']=![];if(_0x1a3325[_0x8658('0x58')]['id']){_0x329b3b['where']['id']={'$gt':_0x1a3325[_0x8658('0x58')]['id']};}_0x329b3b=_[_0x8658('0x3e')]({},_0x329b3b,_0x1a3325['options']);return db[_0x8658('0xe8')][_0x8658('0x34')]({'where':_0x329b3b[_0x8658('0x60')]})[_0x8658('0x25')](function(_0xcfec07){_0x52b3fd['count']=_0xcfec07;_0x329b3b[_0x8658('0x122')]=[];if(_0x1a3325['query'][_0x8658('0x125')]){_0x329b3b[_0x8658('0x122')][_0x8658('0xca')]({'model':db[_0x8658('0x102')],'as':'User','attributes':['id',_0x8658('0x44'),_0x8658('0x10b')]});}if(_0x1a3325['query'][_0x8658('0xcf')]){_0x329b3b[_0x8658('0x122')]=[{'all':!![]}];}return db[_0x8658('0xe8')][_0x8658('0x123')](_0x329b3b);})[_0x8658('0x25')](function(_0x1082f7){_0x52b3fd[_0x8658('0xcc')]=_0x1082f7;return _0x52b3fd;});}})[_0x8658('0x25')](respondWithFilteredResult(_0x7da060,_0x329b3b))[_0x8658('0x2e')](handleError(_0x7da060,null));};exports['addTags']=function(_0x37e313,_0x5a401e,_0x14bfa9){return db[_0x8658('0x53')][_0x8658('0x7a')]({'where':{'id':_0x37e313[_0x8658('0xce')]['id']}})['then'](handleEntityNotFound(_0x5a401e,null))[_0x8658('0x25')](function(_0x416fc8){if(_0x416fc8){return _0x416fc8[_0x8658('0x126')](_0x37e313[_0x8658('0xd1')]['ids'],_[_0x8658('0x120')](_0x37e313[_0x8658('0xd1')],['ids','id'])||{})['spread'](function(){return db[_0x8658('0x127')]['findAll']({'attributes':['id','name',_0x8658('0x128')],'where':{'id':_0x37e313['body'][_0x8658('0x11f')]}});})[_0x8658('0x25')](function(_0x4a8157){socket[_0x8658('0x129')](_0x8658('0x12a'),{'id':Number(_0x37e313[_0x8658('0xce')]['id']),'tags':_0x4a8157||[]});return{'id':Number(_0x37e313[_0x8658('0xce')]['id']),'tags':_0x4a8157||[]};});}})['then'](respondWithResult(_0x5a401e,null))[_0x8658('0x2e')](handleError(_0x5a401e,null));};exports[_0x8658('0x12b')]=function(_0x56ea6a,_0x487f36,_0x4db015){return db['ChatInteraction'][_0x8658('0x7a')]({'where':{'id':_0x56ea6a['params']['id']}})['then'](handleEntityNotFound(_0x487f36,null))[_0x8658('0x25')](function(_0x241c98){if(_0x241c98){return _0x241c98[_0x8658('0x12b')](_0x56ea6a[_0x8658('0x58')][_0x8658('0x11f')]);}})['then'](respondWithStatusCode(_0x487f36,null))[_0x8658('0x2e')](handleError(_0x487f36,null));};exports[_0x8658('0x12c')]=function(_0x1d1d04,_0x464e5c){var _0x14d327=moment()['unix']()[_0x8658('0xb4')]();var _0x403e14=path[_0x8658('0xf9')](config['root'],_0x8658('0x12d'),_0x8658('0x12e'),'tmp');var _0x4abe8b=path[_0x8658('0xf9')](config[_0x8658('0xfa')],_0x8658('0x12d'),_0x8658('0x12e'),'attachments');var _0x2ab7f7=path[_0x8658('0xf9')](_0x403e14,_0x14d327);var _0x310300=util[_0x8658('0x107')](_0x8658('0x12f'),_0x1d1d04[_0x8658('0xce')]['id'],_0x14d327);var _0xd10136=path[_0x8658('0xf9')](_0x403e14,_0x310300);var _0x22d652=[];_0x22d652[_0x8658('0xca')]({'model':db[_0x8658('0x102')],'as':'User','attributes':['id',_0x8658('0x44')],'raw':!![]});_0x22d652[_0x8658('0xca')]({'model':db[_0x8658('0xeb')],'as':_0x8658('0x7f'),'attributes':['id',_0x8658('0x130'),_0x8658('0x131')],'raw':!![]});if(_0x1d1d04[_0x8658('0x58')]['attachments']){_0x22d652['push']({'model':db[_0x8658('0xf5')],'as':_0x8658('0xf5'),'raw':!![]});}var _0x483631=[{'model':db[_0x8658('0xe8')],'as':_0x8658('0x101'),'attributes':['id',_0x8658('0xd1'),'createdAt','direction',_0x8658('0x132'),_0x8658('0x96')],'include':_0x22d652}];_0x483631[_0x8658('0xca')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x8658('0x3c')]});_0x483631[_0x8658('0xca')]({'model':db['User'],'as':_0x8658('0x133'),'attributes':['id',_0x8658('0x44')]});return db[_0x8658('0x53')][_0x8658('0x7a')]({'where':{'id':_0x1d1d04[_0x8658('0xce')]['id']},'include':_0x483631})[_0x8658('0x25')](handleEntityNotFound(_0x464e5c,null))['then'](function(_0xcf61ec){if(_0xcf61ec){var _0x437383=_0xcf61ec[_0x8658('0x134')]({'plain':!![]});fs[_0x8658('0x135')](_0x2ab7f7);var _0x53bb1d={'channel':_0x8658('0x136'),'account':_0x437383[_0x8658('0x137')][_0x8658('0x3c')],'agent':_0x437383[_0x8658('0x133')]?_0x437383[_0x8658('0x133')][_0x8658('0x44')]:_0x8658('0x138'),'createdAt':moment(_0x437383[_0x8658('0x90')])[_0x8658('0x107')](_0x8658('0x139'))[_0x8658('0xb4')](),'closedAt':_0x437383[_0x8658('0x4f')]?moment(_0x437383[_0x8658('0x13a')])[_0x8658('0x107')](_0x8658('0x139'))[_0x8658('0xb4')]():'','disposition':_0x437383[_0x8658('0x50')],'chatInfo':{'browser':_0x437383[_0x8658('0x13b')],'os':_0x437383[_0x8658('0x13c')],'referer':_0x437383[_0x8658('0x13d')],'customerIp':_0x437383[_0x8658('0x13e')],'customerPort':_0x437383[_0x8658('0x13f')]?_0x437383[_0x8658('0x13f')]:_0x8658('0x138')},'messages':_(_0x437383[_0x8658('0x101')])[_0x8658('0x140')]()['filter']({'secret':![]})[_0x8658('0x43')](function(_0x3d7f10){if(_0x3d7f10[_0x8658('0xf5')]){var _0x40ae0f=path[_0x8658('0xf9')](_0x4abe8b,_0x3d7f10[_0x8658('0xf5')][_0x8658('0xfc')]);if(fs['existsSync'](_0x40ae0f)){fs[_0x8658('0x141')](_0x40ae0f)['pipe'](fs[_0x8658('0x142')](path[_0x8658('0xf9')](_0x2ab7f7,_0x3d7f10[_0x8658('0xf5')][_0x8658('0xfc')])));}}return{'date':moment(_0x3d7f10[_0x8658('0x90')])[_0x8658('0x107')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8658('0xb4')](),'sender':_0x3d7f10[_0x8658('0x10f')]==='out'?_0x3d7f10['User']?_0x3d7f10[_0x8658('0x102')][_0x8658('0x44')]:_0x8658('0x105'):_0x3d7f10['Contact'][_0x8658('0x130')]+(_0x3d7f10['Contact'][_0x8658('0x131')]?'\x20'+_0x3d7f10[_0x8658('0x7f')]['lastName']:''),'body':_0x3d7f10[_0x8658('0xf5')]?_0x3d7f10[_0x8658('0xf5')][_0x8658('0xfc')]:_0x3d7f10[_0x8658('0xd1')],'direction':_0x3d7f10[_0x8658('0x10f')]==='out'?'A':'C','secret':_0x3d7f10[_0x8658('0x132')],'read':_0x3d7f10[_0x8658('0x96')],'attachment':_0x3d7f10['Attachment']};})[_0x8658('0x7c')]()};return ejs['renderFile'](path[_0x8658('0xf9')](config[_0x8658('0xfa')],_0x8658('0x12d'),'views',_0x8658('0x143')),{'interaction':_0x53bb1d})[_0x8658('0x25')](function(_0x1ae3bf){var _0x3b3bfc=path[_0x8658('0xf9')](_0x2ab7f7,_0x8658('0x144')+_0x437383['id']+'-'+_0x14d327+_0x8658('0x145'));var _0x4d1045={'path':_0x3b3bfc,'channel':_0x8658('0x136'),'interactionId':_0x437383['id']};return pdf[_0x8658('0x146')](_0x1ae3bf,_0x4d1045);})[_0x8658('0x25')](function(){return new BPromise(function(_0x4cb7b8,_0x207e06){zipdir(_0x2ab7f7,{'saveTo':_0xd10136},function(_0x3a3727,_0xc32bdf){if(_0x3a3727)return _0x207e06(_0x3a3727);return _0x4cb7b8(_0xc32bdf);});})[_0x8658('0x25')](function(){return new BPromise(function(_0xbdf497,_0x5062dd){rimraf(_0x2ab7f7,function(_0x585566){if(_0x585566)_0x5062dd(_0x585566);return _0xbdf497();});});})[_0x8658('0x25')](function(){return _0x464e5c[_0x8658('0x12c')](_0xd10136,_0x310300,function(_0x8993c6){if(_0x8993c6){console[_0x8658('0x147')]('err',_0x8993c6);}else{fs['unlinkSync'](_0xd10136);}});});});}else{return _0x464e5c[_0x8658('0x2f')](0xc8);}})[_0x8658('0x2e')](handleError(_0x464e5c,null));};
\ No newline at end of file
+var _0x9f02=['isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','customer','agentIdentifier','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','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','ids','getMessages','nolimit','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','secret','includeAgent','setTags','omit','spread','emit','chatInteractionTags:save','unix','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','Account','Owner','get','Chat','N.A.','browserName','osName','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','render','contact','agent','account','fullname','TagIds','Tags','split','push','waiting','talking','answered','abandoned','total','UserId','closed','disposition','unmanaged','map','ChatInteraction','rawAttributes','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','filters','color','tools_tags','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','ChatWebsiteId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','user','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','includeAll','include','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0x9f02,0x6b));var _0x29f0=function(_0x31cf21,_0x1916a7){_0x31cf21=_0x31cf21-0x0;var _0x4c73bd=_0x9f02[_0x31cf21];return _0x4c73bd;};'use strict';var emlformat=require(_0x29f0('0x0'));var rimraf=require(_0x29f0('0x1'));var zipdir=require(_0x29f0('0x2'));var jsonpatch=require(_0x29f0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x29f0('0x4'));var Mustache=require('mustache');var util=require(_0x29f0('0x5'));var path=require(_0x29f0('0x6'));var sox=require(_0x29f0('0x7'));var csv=require(_0x29f0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f0('0x9'));var _=require(_0x29f0('0xa'));var squel=require(_0x29f0('0xb'));var crypto=require(_0x29f0('0xc'));var jsforce=require(_0x29f0('0xd'));var deskjs=require(_0x29f0('0xe'));var toCsv=require(_0x29f0('0x8'));var querystring=require(_0x29f0('0xf'));var Papa=require(_0x29f0('0x10'));var Redis=require(_0x29f0('0x11'));var authService=require(_0x29f0('0x12'));var qs=require(_0x29f0('0x13'));var as=require(_0x29f0('0x14'));var pdf=require(_0x29f0('0x15'));var hardwareService=require(_0x29f0('0x16'));var logger=require('../../config/logger')(_0x29f0('0x17'));var utils=require('../../config/utils');var config=require(_0x29f0('0x18'));var licenseUtil=require(_0x29f0('0x19'));var db=require(_0x29f0('0x1a'))['db'];config['redis']=_[_0x29f0('0x1b')](config['redis'],{'host':_0x29f0('0x1c'),'port':0x18eb});var socket=require(_0x29f0('0x1d'))(new Redis(config[_0x29f0('0x1e')]));require(_0x29f0('0x1f'))[_0x29f0('0x20')](socket);var jayson=require(_0x29f0('0x21'));var client=jayson[_0x29f0('0x22')][_0x29f0('0x23')]({'port':0x232b});var client9004=jayson[_0x29f0('0x22')][_0x29f0('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x13680f,_0x492f23,_0x29dd7d,_0x2cf752){return new BPromise(function(_0x3ed5ba,_0x38b467){var _0x2d4ccc=_0x2cf752||client;return _0x2d4ccc[_0x29f0('0x24')](_0x13680f,_0x29dd7d)[_0x29f0('0x25')](function(_0x204652){logger[_0x29f0('0x26')](_0x29f0('0x27'),_0x492f23,_0x29f0('0x28'));logger['debug'](_0x29f0('0x29'),_0x492f23,'request\x20sent',JSON['stringify'](_0x204652));if(_0x204652['error']){if(_0x204652[_0x29f0('0x2a')]['code']===0x1f4){logger['error'](_0x29f0('0x27'),_0x492f23,_0x204652['error'][_0x29f0('0x2b')]);return _0x38b467(_0x204652[_0x29f0('0x2a')]['message']);}logger[_0x29f0('0x2a')](_0x29f0('0x27'),_0x492f23,_0x204652[_0x29f0('0x2a')][_0x29f0('0x2b')]);return _0x3ed5ba(_0x204652[_0x29f0('0x2a')][_0x29f0('0x2b')]);}else{logger[_0x29f0('0x26')](_0x29f0('0x27'),_0x492f23,_0x29f0('0x28'));_0x3ed5ba(_0x204652[_0x29f0('0x2c')][_0x29f0('0x2b')]);}})[_0x29f0('0x2d')](function(_0x12b342){logger[_0x29f0('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x492f23,_0x12b342);_0x38b467(_0x12b342);});});}function respondWithStatusCode(_0x26b767,_0x3bf2be){_0x3bf2be=_0x3bf2be||0xcc;return function(_0x21aeac){if(_0x21aeac){return _0x26b767[_0x29f0('0x2e')](_0x3bf2be);}return _0x26b767['status'](_0x3bf2be)[_0x29f0('0x2f')]();};}function respondWithResult(_0x244dd7,_0x5936fb){_0x5936fb=_0x5936fb||0xc8;return function(_0xbb312c){if(_0xbb312c){return _0x244dd7[_0x29f0('0x30')](_0x5936fb)[_0x29f0('0x31')](_0xbb312c);}};}function respondWithFilteredResult(_0x4e06ba,_0x33c4a2){return function(_0x154b04){if(_0x154b04){var _0x8bca7c=typeof _0x33c4a2[_0x29f0('0x32')]===_0x29f0('0x33')&&typeof _0x33c4a2[_0x29f0('0x34')]==='undefined';var _0x471711=_0x154b04[_0x29f0('0x35')];var _0x42182b=_0x8bca7c?0x0:_0x33c4a2['offset'];var _0x5ee38c=_0x8bca7c?_0x154b04[_0x29f0('0x35')]:_0x33c4a2['offset']+_0x33c4a2[_0x29f0('0x34')];var _0x518dbc;if(_0x5ee38c>=_0x471711){_0x5ee38c=_0x471711;_0x518dbc=0xc8;}else{_0x518dbc=0xce;}_0x4e06ba[_0x29f0('0x30')](_0x518dbc);return _0x4e06ba[_0x29f0('0x36')](_0x29f0('0x37'),_0x42182b+'-'+_0x5ee38c+'/'+_0x471711)['json'](_0x154b04);}return null;};}function patchUpdates(_0xb75d32){return function(_0x344b0a){try{jsonpatch['apply'](_0x344b0a,_0xb75d32,!![]);}catch(_0xb4b1db){return BPromise[_0x29f0('0x38')](_0xb4b1db);}return _0x344b0a[_0x29f0('0x39')]();};}function saveUpdates(_0x16880a,_0x519b96){return function(_0x23fba8){if(_0x23fba8){return _0x23fba8[_0x29f0('0x3a')](_0x16880a)[_0x29f0('0x25')](function(_0x5666c2){return _0x5666c2;});}return null;};}function removeEntity(_0x2a26e7,_0x5db8ca){return function(_0x1964d3){if(_0x1964d3){return _0x1964d3[_0x29f0('0x3b')]()[_0x29f0('0x25')](function(){_0x2a26e7['status'](0xcc)[_0x29f0('0x2f')]();});}};}function handleEntityNotFound(_0x444854,_0x30dea1){return function(_0x3bf58b){if(!_0x3bf58b){_0x444854[_0x29f0('0x2e')](0x194);}return _0x3bf58b;};}function handleError(_0x4ad186,_0x362969){_0x362969=_0x362969||0x1f4;return function(_0x5decd5){logger['error'](_0x5decd5[_0x29f0('0x3c')]);if(_0x5decd5[_0x29f0('0x3d')]){delete _0x5decd5[_0x29f0('0x3d')];}_0x4ad186[_0x29f0('0x30')](_0x362969)[_0x29f0('0x3e')](_0x5decd5);};}function getMustacheRender(_0x3628f9,_0x228c30){return Mustache[_0x29f0('0x3f')](_0x3628f9,_['merge'](_0x228c30['body'],{'contact':_0x228c30[_0x29f0('0x40')],'message':_0x228c30['message'],'agent':_0x228c30[_0x29f0('0x41')],'interaction':_0x228c30['interaction'],'account':_0x228c30[_0x29f0('0x42')]}))||'';}function getInteractionUsers(_0x1e9fbd,_0x46aaac){return new BPromise(function(_0x2b07d9,_0x921e98){try{if(_0x46aaac[_0x1e9fbd['id']]){_0x1e9fbd['Users']=_['map'](_0x46aaac[_0x1e9fbd['id']],function(_0x198f71){return{'id':_0x198f71['id'],'fullname':_0x198f71[_0x29f0('0x43')]};});}}catch(_0x2a04d4){_0x921e98(_0x2a04d4);}_0x2b07d9(_0x1e9fbd);});}function getInteractionTags(_0x417e64,_0x284dec){return new BPromise(function(_0xdc83df,_0x2df5e7){try{if(_0x417e64[_0x29f0('0x44')]){_0x417e64[_0x29f0('0x45')]=[];_0x417e64[_0x29f0('0x44')][_0x29f0('0x46')](',')['forEach'](function(_0x215d5d){_0x417e64[_0x29f0('0x45')][_0x29f0('0x47')](_0x284dec[_0x215d5d]);});}delete _0x417e64[_0x29f0('0x44')];}catch(_0x1d9697){_0x2df5e7(_0x1d9697);}_0xdc83df(_0x417e64);});}function updateChatInteraction(_0x7fd8b2,_0x11c873,_0x394680){return new BPromise(function(_0x35a623,_0x15aeeb){return getInteractionUsers(_0x7fd8b2,_0x394680)[_0x29f0('0x25')](function(_0x3f880f){return getInteractionTags(_0x3f880f,_0x11c873);})[_0x29f0('0x25')](function(_0x586fa4){return getStateInteraction(_0x586fa4);})[_0x29f0('0x25')](function(_0x4016e3){_0x35a623(_0x4016e3);})['catch'](function(_0x3f98b9){_0x15aeeb(_0x3f98b9);});});}function getStateInteraction(_0x500e97){return new BPromise(function(_0x49cd20){_0x500e97[_0x29f0('0x48')]=0x0;_0x500e97[_0x29f0('0x49')]=0x0;_0x500e97[_0x29f0('0x4a')]=0x0;_0x500e97['unmanaged']=0x0;_0x500e97[_0x29f0('0x4b')]=0x0;_0x500e97[_0x29f0('0x4c')]=0x0;if(!_0x500e97['closed']&&!_0x500e97[_0x29f0('0x4d')]){_0x500e97[_0x29f0('0x48')]+=0x1;}if(!_0x500e97[_0x29f0('0x4e')]&&_0x500e97[_0x29f0('0x4d')]){_0x500e97['talking']+=0x1;if(_0x500e97[_0x29f0('0x48')]){_0x500e97[_0x29f0('0x48')]-=0x1;}}if(_0x500e97[_0x29f0('0x4e')]&&_0x500e97[_0x29f0('0x4f')]==='abandoned'){_0x500e97[_0x29f0('0x4b')]+=0x1;if(_0x500e97[_0x29f0('0x48')]){_0x500e97[_0x29f0('0x48')]-=0x1;}}else if(_0x500e97['closed']&&!_0x500e97[_0x29f0('0x4d')]&&_0x500e97['disposition']){_0x500e97[_0x29f0('0x50')]+=0x1;if(_0x500e97['waiting']){_0x500e97[_0x29f0('0x48')]-=0x1;}}else if(_0x500e97[_0x29f0('0x4e')]&&_0x500e97['UserId']){_0x500e97[_0x29f0('0x4a')]+=0x1;if(_0x500e97['talking']){_0x500e97[_0x29f0('0x49')]-=0x1;}}_0x500e97[_0x29f0('0x4c')]+=0x1;_0x49cd20(_0x500e97);});}exports['index']=function(_0x13f457,_0x189811){var _0x22687c={},_0x3ba889={},_0x2108f5={'count':0x0,'rows':[]};var _0x8f7db8=_[_0x29f0('0x51')](db[_0x29f0('0x52')][_0x29f0('0x53')],function(_0x191b9c){return{'name':_0x191b9c['fieldName'],'type':_0x191b9c[_0x29f0('0x54')][_0x29f0('0x55')]};});_0x3ba889['model']=_[_0x29f0('0x51')](_0x8f7db8,'name');_0x3ba889[_0x29f0('0x56')]=_[_0x29f0('0x57')](_0x13f457[_0x29f0('0x56')]);_0x3ba889['filters']=_['intersection'](_0x3ba889['model'],_0x3ba889[_0x29f0('0x56')]);_0x22687c[_0x29f0('0x58')]=_[_0x29f0('0x59')](_0x3ba889[_0x29f0('0x5a')],qs[_0x29f0('0x5b')](_0x13f457[_0x29f0('0x56')][_0x29f0('0x5b')]));_0x22687c['attributes']=_0x22687c['attributes'][_0x29f0('0x5c')]?_0x22687c[_0x29f0('0x58')]:_0x3ba889[_0x29f0('0x5a')];if(!_0x13f457[_0x29f0('0x56')][_0x29f0('0x5d')]('nolimit')){_0x22687c[_0x29f0('0x34')]=qs[_0x29f0('0x34')](_0x13f457['query']['limit']);_0x22687c[_0x29f0('0x32')]=qs[_0x29f0('0x32')](_0x13f457[_0x29f0('0x56')][_0x29f0('0x32')]);}_0x22687c[_0x29f0('0x5e')]=qs[_0x29f0('0x5f')](_0x13f457[_0x29f0('0x56')][_0x29f0('0x5f')]);_0x22687c[_0x29f0('0x60')]=qs[_0x29f0('0x61')](_['pick'](_0x13f457[_0x29f0('0x56')],_0x3ba889[_0x29f0('0x61')]),_0x8f7db8);var _0x3f62b8=[];var _0x15ee00=squel['select']()['field']('id')['field'](_0x29f0('0x3d'))['field'](_0x29f0('0x62'))['from'](_0x29f0('0x63'));var _0x29d943=squel[_0x29f0('0x64')]()[_0x29f0('0x65')](_0x29f0('0x66'))[_0x29f0('0x65')](_0x29f0('0x67'))[_0x29f0('0x65')](_0x29f0('0x68'))[_0x29f0('0x69')](_0x29f0('0x6a'),'ui')[_0x29f0('0x6b')](_0x29f0('0x6c'),'u',_0x29f0('0x6d'));var _0x584246=squel['select']()[_0x29f0('0x69')]('chat_interactions','i')[_0x29f0('0x6b')](_0x29f0('0x6e'),'c',_0x29f0('0x6f'))[_0x29f0('0x6b')](_0x29f0('0x6c'),'o',_0x29f0('0x70'))[_0x29f0('0x6b')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x29f0('0x6b')](_0x29f0('0x71'),'me',_0x29f0('0x72'))[_0x29f0('0x6b')]('chat_interaction_has_tags','it',_0x29f0('0x73'))[_0x29f0('0x6b')]('tools_tags','t',_0x29f0('0x74'));var _0x5201e5=squel[_0x29f0('0x75')]();var _0x5cfe35=[];var _0x2f73fd=squel[_0x29f0('0x75')]();var _0x30e2ac;if(_0x13f457[_0x29f0('0x56')]['search']){_0x30e2ac=as[_0x29f0('0x76')](_0x13f457[_0x29f0('0x56')][_0x29f0('0x77')]);var _0x19aa01=_0x30e2ac[_0x29f0('0x78')];for(var _0x4a5f0e=0x0;_0x4a5f0e<_0x30e2ac['conditions'][_0x29f0('0x5c')];_0x4a5f0e++){var _0x86e9d3=_0x30e2ac[_0x29f0('0x79')][_0x4a5f0e];var _0x4c7c6a='i';var _0x4a0e86=_['find'](_0x8f7db8,[_0x29f0('0x3d'),_0x86e9d3[_0x29f0('0x65')]]);if(!_0x4a0e86){switch(_0x86e9d3['field']){case _0x29f0('0x7a'):if(_0x86e9d3[_0x29f0('0x7b')]==0x1){_0x584246[_0x29f0('0x7c')]('`'+_0x86e9d3[_0x29f0('0x65')]+'`\x20=\x200');}else{_0x584246['having']('`'+_0x86e9d3[_0x29f0('0x65')]+'`\x20>\x200');}break;case _0x29f0('0x7d'):if(_0x86e9d3[_0x29f0('0x7e')]===_0x29f0('0x7f')){if(_0x86e9d3['value'][_0x29f0('0x46')]('\x20')[_0x29f0('0x5c')]>0x1){_0x5201e5[_0x19aa01](_0x29f0('0x80'),qs['getFullTextValue'](_0x86e9d3['value']),null);}else{var _0x63e497='%'+_0x86e9d3[_0x29f0('0x7b')]+'%';_0x5201e5[_0x19aa01]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x63e497,_0x63e497,_0x63e497);}}else{_0x4a0e86=_[_0x29f0('0x81')](_0x8f7db8,[_0x29f0('0x3d'),_0x29f0('0x82')]);_0x86e9d3['field']=_0x29f0('0x82');_0x24b8c2=as[_0x29f0('0x83')](_0x4c7c6a,_0x4a0e86[_0x29f0('0x54')],_0x86e9d3);_0x5201e5[_0x19aa01](_0x24b8c2[_0x29f0('0x84')],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x85')],_0x24b8c2['value'][_0x29f0('0x2f')]);}break;case _0x29f0('0x86'):var _0x59c4c9=_0x86e9d3['value'][_0x29f0('0x46')](',')[_0x29f0('0x51')](function(_0x53a7f1){return Number(_0x53a7f1);});_0x59c4c9[_0x29f0('0x87')](function(_0x43e277){_0x2f73fd['or'](_0x29f0('0x88'),'%,'+_0x43e277+',%');});_0x5cfe35=_[_0x29f0('0x89')](_0x5cfe35,_0x59c4c9);break;case'User':if(_0x86e9d3[_0x29f0('0x7e')]==='$substring'){_0x5201e5[_0x19aa01](_0x29f0('0x8a'),'%'+_0x86e9d3[_0x29f0('0x7b')]+'%',null);}else{_0x4a0e86=_['find'](_0x8f7db8,['name',_0x29f0('0x4d')]);_0x86e9d3[_0x29f0('0x65')]='UserId';_0x24b8c2=as[_0x29f0('0x83')](_0x4c7c6a,_0x4a0e86['type'],_0x86e9d3);_0x5201e5[_0x19aa01](_0x24b8c2[_0x29f0('0x84')],_0x24b8c2['value']['start'],_0x24b8c2['value'][_0x29f0('0x2f')]);}break;case _0x29f0('0x8b'):_0x24b8c2=as['buildExpression']('me',null,_0x86e9d3);_0x5201e5[_0x19aa01](_0x24b8c2[_0x29f0('0x84')],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x85')],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x2f')]);break;}}else{var _0x24b8c2=as[_0x29f0('0x83')](_0x4c7c6a,_0x4a0e86[_0x29f0('0x54')],_0x86e9d3);_0x5201e5[_0x19aa01](_0x24b8c2['text'],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x85')],_0x24b8c2[_0x29f0('0x7b')][_0x29f0('0x2f')]);}}}else{var _0x18cc91=_(_0x13f457[_0x29f0('0x56')])[_0x29f0('0x57')]()[_0x29f0('0x51')](function(_0x46c7b3){return _['some'](_0x8f7db8,['name',_0x46c7b3])?_0x46c7b3:undefined;})[_0x29f0('0x8c')]()[_0x29f0('0x7b')]();if(!_['isEmpty'](_0x18cc91)){_0x18cc91['forEach'](function(_0x55849d){if(_0x55849d===_0x29f0('0x8d')){_0x584246[_0x29f0('0x60')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x13f457['query'][_0x55849d]));}else if(_0x55849d===_0x29f0('0x8e')){var _0x1b03b1=JSON[_0x29f0('0x8f')](_0x13f457[_0x29f0('0x56')][_0x55849d])['$gte'];var _0x455806=JSON['parse'](_0x13f457[_0x29f0('0x56')][_0x55849d])[_0x29f0('0x90')];_0x584246[_0x29f0('0x60')](_0x29f0('0x91'),_0x1b03b1,_0x455806);}else{if(_0x13f457[_0x29f0('0x56')][_0x55849d]===_0x29f0('0x92')){_0x584246['where']('i.'+_0x55849d+_0x29f0('0x93'));}else{_0x584246[_0x29f0('0x60')]('i.'+_0x55849d+'\x20=\x20?',_0x13f457[_0x29f0('0x56')][_0x55849d]);}}});}if(_0x13f457['query'][_0x29f0('0x94')]){if(_0x13f457[_0x29f0('0x56')][_0x29f0('0x94')]==0x1){_0x584246[_0x29f0('0x7c')](_0x29f0('0x95'));}else{_0x584246[_0x29f0('0x7c')](_0x29f0('0x96'));}}if(_0x13f457[_0x29f0('0x56')][_0x29f0('0x97')]){_0x5cfe35=_[_0x29f0('0x98')](_0x13f457[_0x29f0('0x56')]['tag'])?_0x13f457['query']['tag']:new Array(_0x13f457[_0x29f0('0x56')][_0x29f0('0x97')]);_0x5cfe35[_0x29f0('0x87')](function(_0x298dbc){_0x2f73fd['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298dbc+',%');});}if(_0x13f457[_0x29f0('0x56')]['filter']){var _0x40aa05=_0x13f457['query'][_0x29f0('0x99')][_0x29f0('0x9a')]('\x5c','\x5c\x5c')[_0x29f0('0x9a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x40aa05)){_0x5201e5['or'](_0x29f0('0x9b'),_0x40aa05+'%');}else{_0x5201e5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x40aa05))['or'](_0x29f0('0x9c'),_0x40aa05+'%');}}}_0x584246[_0x29f0('0x60')](_0x5201e5);_0x584246[_0x29f0('0x9d')](_0x29f0('0x9e'));var _0x1a5a42={'type':db[_0x29f0('0x9f')][_0x29f0('0xa0')][_0x29f0('0xa1')],'raw':!![]};var _0x147ee3=_0x584246[_0x29f0('0xa2')]();_0x147ee3[_0x29f0('0x65')](_0x29f0('0x9e'));_0x147ee3['field'](_0x29f0('0xa3'),_0x29f0('0x7a'));if(_0x22687c[_0x29f0('0x5e')]){_0x22687c[_0x29f0('0x5e')][_0x29f0('0x87')](function(_0x6b2677){var _0x4ed9ea=_0x6b2677[0x0]==='contactName'?_0x6b2677[0x0]:'i.'+_0x6b2677[0x0];_0x584246['order'](_0x4ed9ea,_0x6b2677[0x1]==='DESC'?![]:!![]);});}if(!_[_0x29f0('0xa4')](_0x5cfe35)){_0x584246['having'](_0x2f73fd);_0x147ee3['where'](_0x29f0('0xa5'),_0x5cfe35);}BPromise[_0x29f0('0xa6')]()[_0x29f0('0x25')](function(){if(!_0x30e2ac){if(_0x13f457['query'][_0x29f0('0x8d')])return;_0x147ee3[_0x29f0('0x60')](_0x29f0('0xa7'));_0x584246[_0x29f0('0x60')](_0x29f0('0xa7'));return;}if(_0x13f457['user'][_0x29f0('0xa8')]!=='agent')return;return _0x13f457['user'][_0x29f0('0xa9')]({'attributes':['id'],'raw':!![]})[_0x29f0('0x25')](function(_0x3c454c){if(_[_0x29f0('0xa4')](_0x3c454c)){_0x147ee3[_0x29f0('0x60')](_0x29f0('0xaa'));_0x584246[_0x29f0('0x60')](_0x29f0('0xaa'));}else{_0x147ee3[_0x29f0('0x60')](_0x29f0('0xab'),_[_0x29f0('0x51')](_0x3c454c,'id'));_0x584246[_0x29f0('0x60')](_0x29f0('0xab'),_[_0x29f0('0x51')](_0x3c454c,'id'));}});})[_0x29f0('0x25')](function(){if(_0x13f457[_0x29f0('0xac')][_0x29f0('0xa8')]===_0x29f0('0x41')&&!_0x30e2ac&&!_0x13f457[_0x29f0('0x56')][_0x29f0('0x8d')])return[];return db[_0x29f0('0xad')][_0x29f0('0x56')](_0x147ee3[_0x29f0('0xae')](),_0x1a5a42);})[_0x29f0('0x25')](function(_0x2b48b4){_0x2108f5[_0x29f0('0x35')]=_0x2b48b4['length'];if(_0x2108f5[_0x29f0('0x35')]===0x0)return[];return db[_0x29f0('0xad')][_0x29f0('0x56')](_0x15ee00[_0x29f0('0xae')](),_0x1a5a42)[_0x29f0('0x25')](function(_0x703715){_0x3f62b8=_[_0x29f0('0xaf')](_0x703715,'id');_0x1a5a42=_[_0x29f0('0xb0')](_0x1a5a42,{'model':db[_0x29f0('0x52')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13f457[_0x29f0('0x56')][_0x29f0('0x5b')]){_0x22687c[_0x29f0('0x58')][_0x29f0('0x87')](function(_0x1f353d){_0x584246['field']('i.'+_0x1f353d);});}else{_0x584246['field'](_0x29f0('0xa3'),_0x29f0('0x7a'));_0x584246[_0x29f0('0x65')](_0x29f0('0xb1'),_0x29f0('0xb2'));_0x584246[_0x29f0('0x65')]('a.mandatoryDisposition',_0x29f0('0xb3'));_0x584246['field']('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',_0x29f0('0xb4'));_0x584246[_0x29f0('0x65')]('i.*');_0x584246[_0x29f0('0x65')]('c.firstName',_0x29f0('0xb5'));_0x584246['field']('c.lastName',_0x29f0('0xb6'));_0x584246[_0x29f0('0x65')]('c.email','Contact.email');_0x584246[_0x29f0('0x65')](_0x29f0('0xb7'),_0x29f0('0xb8'));_0x584246[_0x29f0('0x65')]('c.mobile',_0x29f0('0xb9'));_0x584246[_0x29f0('0x65')]('c.fax','Contact.fax');_0x584246[_0x29f0('0x65')](_0x29f0('0xba'),_0x29f0('0xbb'));_0x584246[_0x29f0('0x65')](_0x29f0('0xbc'),_0x29f0('0xbd'));_0x584246[_0x29f0('0x65')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x29f0('0x44'));}if(_0x22687c[_0x29f0('0x34')])_0x584246[_0x29f0('0x34')](_0x22687c[_0x29f0('0x34')]);if(_0x22687c[_0x29f0('0x32')])_0x584246[_0x29f0('0x32')](_0x22687c[_0x29f0('0x32')]);return db['sequelize'][_0x29f0('0x56')](_0x584246[_0x29f0('0xae')](),_0x1a5a42);})['then'](function(_0x280d83){if(_0x280d83[_0x29f0('0x5c')]>0x0)_0x29d943['where'](_0x29f0('0xbe'),_[_0x29f0('0x51')](_0x280d83,'id'));return db['sequelize'][_0x29f0('0x56')](_0x29d943[_0x29f0('0xae')](),_0x1a5a42)['then'](function(_0x2ea2ca){var _0x3fb15d=_[_0x29f0('0xbf')](_0x2ea2ca,_0x29f0('0xc0'));var _0x1dde84=[];_0x280d83[_0x29f0('0x87')](function(_0x3d8c8a){_0x1dde84[_0x29f0('0x47')](updateChatInteraction(_0x3d8c8a,_0x3f62b8,_0x3fb15d));});return BPromise[_0x29f0('0xc1')](_0x1dde84);});});})[_0x29f0('0x25')](function(_0x4f6598){_0x2108f5[_0x29f0('0xc2')]=_0x4f6598;return _0x2108f5;})[_0x29f0('0x25')](respondWithFilteredResult(_0x189811,_0x22687c))['catch'](handleError(_0x189811,null));};exports[_0x29f0('0xc3')]=function(_0x20117d,_0x4b0d36){var _0x28805e={'raw':![],'where':{'id':_0x20117d['params']['id']}},_0x4f9e18={};_0x4f9e18[_0x29f0('0x5a')]=_[_0x29f0('0x57')](db['ChatInteraction'][_0x29f0('0x53')]);_0x4f9e18[_0x29f0('0x56')]=_['keys'](_0x20117d['query']);_0x4f9e18['filters']=_[_0x29f0('0x59')](_0x4f9e18['model'],_0x4f9e18[_0x29f0('0x56')]);_0x28805e['attributes']=_[_0x29f0('0x59')](_0x4f9e18[_0x29f0('0x5a')],qs['fields'](_0x20117d[_0x29f0('0x56')][_0x29f0('0x5b')]));_0x28805e[_0x29f0('0x58')]=_0x28805e[_0x29f0('0x58')]['length']?_0x28805e[_0x29f0('0x58')]:_0x4f9e18[_0x29f0('0x5a')];if(_0x20117d[_0x29f0('0x56')][_0x29f0('0xc4')]){_0x28805e[_0x29f0('0xc5')]=[{'all':!![]}];}_0x28805e=_[_0x29f0('0xb0')]({},_0x28805e,_0x20117d[_0x29f0('0xc6')]);return db[_0x29f0('0x52')]['find'](_0x28805e)[_0x29f0('0x25')](handleEntityNotFound(_0x4b0d36,null))['then'](respondWithResult(_0x4b0d36,null))[_0x29f0('0x2d')](handleError(_0x4b0d36,null));};exports[_0x29f0('0xc7')]=function(_0x310e02,_0x526daf){return db[_0x29f0('0x52')]['create'](_0x310e02[_0x29f0('0x8b')],{})[_0x29f0('0x25')](respondWithResult(_0x526daf,0xc9))[_0x29f0('0x2d')](handleError(_0x526daf,null));};exports[_0x29f0('0x3a')]=function(_0x38ac96,_0x28a1bb){if(_0x38ac96[_0x29f0('0x8b')]['id']){delete _0x38ac96['body']['id'];}return db[_0x29f0('0x52')]['find']({'where':{'id':_0x38ac96[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x28a1bb,null))[_0x29f0('0x25')](saveUpdates(_0x38ac96[_0x29f0('0x8b')],null))[_0x29f0('0x25')](respondWithResult(_0x28a1bb,null))[_0x29f0('0x2d')](handleError(_0x28a1bb,null));};exports[_0x29f0('0x3b')]=function(_0x15c880,_0x2d6930){return db['ChatInteraction']['find']({'where':{'id':_0x15c880[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x2d6930,null))['then'](removeEntity(_0x2d6930,null))['catch'](handleError(_0x2d6930,null));};exports[_0x29f0('0xc9')]=function(_0x2c16b9,_0x5c35c1){return db[_0x29f0('0x52')]['describe']()[_0x29f0('0x25')](respondWithResult(_0x5c35c1,null))[_0x29f0('0x2d')](handleError(_0x5c35c1,null));};exports[_0x29f0('0xca')]=function(_0x45abfa,_0x510479){var _0x30ca18=_0x45abfa['params']['id'];var _0x435f47;var _0xd582a5;var _0x5528c8;return db[_0x29f0('0x52')][_0x29f0('0xcb')]({'where':{'id':_0x30ca18}})[_0x29f0('0x25')](function(_0x18267c){_0x435f47=_0x18267c;return db[_0x29f0('0xcc')]['findOne']({'where':{'id':_0x18267c[_0x29f0('0x8d')]},'attributes':['id','vidaooApiKey',_0x29f0('0xcd'),_0x29f0('0xce'),_0x29f0('0xcf'),_0x29f0('0xd0')],'raw':!![]});})[_0x29f0('0x25')](function(_0x579153){if(_0x579153&&_0x579153[_0x29f0('0xd1')]&&_0x579153[_0x29f0('0xcd')]){_0xd582a5=_0x579153;var _0x2bdea3={'interaction':{'id':_0x30ca18},'agent':{'id':_0x45abfa[_0x29f0('0xac')]['id'],'name':_0x45abfa['user'][_0x29f0('0x3d')],'fullname':_0x45abfa['user']['fullname'],'email':_0x45abfa['user'][_0x29f0('0xd2')]},'contact':_0x45abfa[_0x29f0('0x8b')][_0x29f0('0x40')],'account':_0x45abfa[_0x29f0('0x8b')][_0x29f0('0x42')]};var _0x32bf3f={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x579153[_0x29f0('0xd1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x45abfa[_0x29f0('0xac')][_0x29f0('0xd2')]],'buttons':null,'topic':_0xd582a5['vidaooTopic'],'note':_[_0x29f0('0xd3')](_0xd582a5[_0x29f0('0xcf')])?null:getMustacheRender(_0xd582a5[_0x29f0('0xcf')],_0x2bdea3),'metadata':null},'redirect':_0x29f0('0xd4'),'json':!![]};try{if(!_['isNull'](_0xd582a5['vidaooMetadata'])){var _0x1620c3=getMustacheRender(_0xd582a5[_0x29f0('0xd0')],_0x2bdea3);var _0x3003cb=JSON[_0x29f0('0x8f')](_0x1620c3);_0x32bf3f['body']['metadata']=_0x3003cb;}}catch(_0x2ad975){throw new db[(_0x29f0('0x9f'))]['ValidationError'](_0x29f0('0xd5'));}return rp(_0x32bf3f);}else{throw new db['Sequelize'][(_0x29f0('0xd6'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x29f0('0x25')](function(_0xbe09b3){_0x5528c8=_0xbe09b3;if(_0x5528c8['id']){var _0x561877={'body':_0x5528c8[_0x29f0('0xd7')],'ChatWebsiteId':_0xd582a5['id'],'ChatInteractionId':_0x435f47['id'],'direction':_0x29f0('0xd8'),'UserId':_0x45abfa['user']['id']};return db[_0x29f0('0xd9')][_0x29f0('0xc7')](_0x561877,{});}else{throw new db[(_0x29f0('0x9f'))][(_0x29f0('0xd6'))](_0x29f0('0xda'));}})['then'](function(){return _0x435f47[_0x29f0('0xdb')]({'vidaooSessionId':_0x5528c8['id']});})[_0x29f0('0x25')](respondWithResult(_0x510479,null))['catch'](handleError(_0x510479,null));};exports['customUpdate']=function(_0x7f7baa,_0x2a8188){if(_0x7f7baa['body']['id']){delete _0x7f7baa[_0x29f0('0x8b')]['id'];}return db[_0x29f0('0x52')][_0x29f0('0x81')]({'where':{'id':_0x7f7baa[_0x29f0('0xc8')]['id']},'include':[{'model':db[_0x29f0('0xdc')],'as':_0x29f0('0x7d')}]})['then'](handleEntityNotFound(_0x2a8188,null))[_0x29f0('0x25')](saveUpdates(_0x7f7baa['body'],null))[_0x29f0('0x25')](respondWithResult(_0x2a8188,null))[_0x29f0('0x2d')](handleError(_0x2a8188,null));};exports[_0x29f0('0xdd')]=function(_0x5b5045,_0x5ba5c6,_0x3d0435){if(_0x5b5045[_0x29f0('0x8b')]['id']){delete _0x5b5045[_0x29f0('0x8b')]['id'];}return db[_0x29f0('0x52')]['find']({'where':{'id':_0x5b5045[_0x29f0('0xc8')]['id']}})['then'](function(_0x310f40){if(!_0x310f40){logger[_0x29f0('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x29f0('0xdd'),0x194,_0x29f0('0xde'));_0x5ba5c6['sendStatus'](0x194);}else{if(_0x310f40['UserId']){throw new db[(_0x29f0('0x9f'))]['ValidationError'](_0x29f0('0xdf'));}}return _0x310f40;})['then'](function(_0x42b926){if(_0x42b926){return _0x42b926[_0x29f0('0x3a')]({'closed':_0x5b5045[_0x29f0('0x8b')][_0x29f0('0x4e')],'disposition':_0x5b5045[_0x29f0('0x8b')][_0x29f0('0x4f')]})[_0x29f0('0x25')](function(_0x2ffc6d){return _0x2ffc6d;});}})[_0x29f0('0x25')](function(_0x23eb35){return respondWithRpcPromise(_0x29f0('0xe0'),_0x29f0('0xdd'),_0x5b5045[_0x29f0('0x8b')],client9004);})['then'](respondWithResult(_0x5ba5c6,null))[_0x29f0('0x2d')](handleError(_0x5ba5c6,null));};exports[_0x29f0('0xe1')]=function(_0x39de91,_0x1cceae,_0xbbba50){_0x39de91[_0x29f0('0x8b')][_0x29f0('0x3d')]=_0x39de91['file'][_0x29f0('0xe2')];_0x39de91[_0x29f0('0x8b')][_0x29f0('0xe3')]=_0x39de91[_0x29f0('0xe4')][_0x29f0('0xe5')];_0x39de91[_0x29f0('0x8b')][_0x29f0('0x54')]=_0x39de91[_0x29f0('0xe4')][_0x29f0('0xe6')];return db[_0x29f0('0xe7')][_0x29f0('0xc7')](_0x39de91[_0x29f0('0x8b')])[_0x29f0('0x25')](respondWithResult(_0x1cceae,0xc9))['catch'](handleError(_0x1cceae,null));};exports[_0x29f0('0xe8')]=function(_0x8cddb0,_0xdd3c86,_0x49bf44){return db[_0x29f0('0x52')][_0x29f0('0xcb')]({'where':{'id':_0x8cddb0['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xdd3c86,null))[_0x29f0('0x25')](function(_0x25d01b){if(_0x25d01b){if(_0x25d01b['closed']){return _0xdd3c86['status'](0x193)['json']({'status':0x193,'message':_0x29f0('0xe9')});}return db[_0x29f0('0xe7')]['findOne']({'where':{'id':_0x8cddb0['query'][_0x29f0('0xea')]},'raw':!![]})['then'](handleEntityNotFound(_0xdd3c86,null));}})[_0x29f0('0x25')](function(_0x5525f5){if(_0x5525f5){var _0x6370a2=_0x5525f5[_0x29f0('0xeb')]!==null;var _0x50d928=path[_0x29f0('0xec')](config['root'],_0x29f0('0xed'));if(_0x6370a2){_0x50d928=path['join'](_0x50d928,_0x29f0('0xee'));}var _0x3dd6ed=path[_0x29f0('0xec')](_0x50d928,_0x5525f5[_0x29f0('0xe3')]);return _0xdd3c86['download'](_0x3dd6ed);}})['catch'](handleError(_0xdd3c86,null));};exports[_0x29f0('0xef')]=function(_0x2e2091,_0x1717ed){var _0x325b06=null;var _0x40d2c2=null;var _0x2b144d=null;var _0x1cba1c=null;if(_0x2e2091[_0x29f0('0x8b')]['id']){delete _0x2e2091[_0x29f0('0x8b')]['id'];}if(_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xf0')]){_0x1cba1c=path[_0x29f0('0xec')](config[_0x29f0('0xf1')],_0x29f0('0xf2'),util[_0x29f0('0xf3')](_0x29f0('0xf4'),Date[_0x29f0('0xf5')]()));_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xf6')]=_0x1cba1c;}return db[_0x29f0('0x52')]['find']({'where':{'id':_0x2e2091['params']['id']},'include':[{'model':db[_0x29f0('0xd9')],'as':_0x29f0('0xf7'),'include':[{'model':db[_0x29f0('0xf8')],'as':_0x29f0('0xf8')}]}]})[_0x29f0('0x25')](handleEntityNotFound(_0x1717ed,null))[_0x29f0('0x25')](saveUpdates(_0x2e2091[_0x29f0('0x8b')],null))[_0x29f0('0x25')](function(_0x38e7e1){if(_0x38e7e1){_0x325b06=_0x38e7e1;return db['ChatWebsite'][_0x29f0('0x81')]({'where':{'id':_0x325b06[_0x29f0('0x8d')]}});}})[_0x29f0('0x25')](function(_0xaac683){if(_0xaac683){_0x2b144d=_0xaac683;return db[_0x29f0('0xdc')][_0x29f0('0x81')]({'where':{'id':_0x325b06[_0x29f0('0x82')]}});}})[_0x29f0('0x25')](function(_0x3ea84c){if(_0x3ea84c){_0x40d2c2=_0x3ea84c;if(_0x1cba1c){var _0x5e92e9=null;for(var _0x57d47a=0x1;_0x57d47a<_0x325b06[_0x29f0('0xf7')]['length'];++_0x57d47a){_0x5e92e9=_0x325b06[_0x29f0('0xf7')][_0x57d47a];var _0x25eaed=_0x5e92e9['UserId']?util[_0x29f0('0xf3')](_0x29f0('0xf9'),_0x2b144d[_0x29f0('0xfa')],_0x5e92e9[_0x29f0('0x4d')]):'System';var _0x112d58=_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xfb')]||util[_0x29f0('0xf3')](_0x29f0('0xf9'),'Visitor',_0x5e92e9[_0x29f0('0x82')]);switch(_0x2b144d[_0x29f0('0xfc')]){case'website_alias':_0x25eaed=_0x5e92e9[_0x29f0('0x4d')]?util['format'](_0x29f0('0xf9'),_0x2b144d['agentAlias'],_0x5e92e9[_0x29f0('0x4d')]):_0x29f0('0xfd');break;case _0x29f0('0xfe'):_0x25eaed=_0x5e92e9['UserId']?_0x5e92e9[_0x29f0('0xf8')][_0x29f0('0xff')]||_0x5e92e9[_0x29f0('0xf8')][_0x29f0('0x43')]:_0x29f0('0xfd');break;case _0x29f0('0x100'):_0x25eaed=_0x5e92e9[_0x29f0('0x4d')]?_0x5e92e9[_0x29f0('0xf8')][_0x29f0('0x43')]:_0x29f0('0xfd');break;default:_0x25eaed=_0x5e92e9[_0x29f0('0x4d')]?util[_0x29f0('0xf3')](_0x29f0('0xf9'),_0x2b144d[_0x29f0('0xfa')],_0x5e92e9['UserId']):_0x29f0('0xfd');}var _0x4ff91b=util['format'](_0x29f0('0x101'),moment(_0x5e92e9[_0x29f0('0x8e')])['format'](_0x29f0('0x102')),_0x5e92e9[_0x29f0('0x103')]==='in'?_0x112d58:_0x25eaed,_0x5e92e9[_0x29f0('0x8b')]);if(!_0x5e92e9['secret']){fs[_0x29f0('0x104')](_0x1cba1c,_0x4ff91b);}}return db[_0x29f0('0x105')][_0x29f0('0xcb')]({'where':{'service':!![]},'include':[{'model':db[_0x29f0('0x106')],'as':_0x29f0('0x107'),'raw':!![]}]});}}})['then'](function(_0x74ddc7){if(_0x74ddc7&&_0x74ddc7[_0x29f0('0x107')]&&_0x2e2091[_0x29f0('0x8b')]){var _0x11fd39={'tls':{'rejectUnauthorized':![]}};if(_0x74ddc7[_0x29f0('0x107')]['service']){_0x11fd39[_0x29f0('0x108')]=_0x74ddc7[_0x29f0('0x107')]['service'];}else{_0x11fd39[_0x29f0('0x109')]=_0x74ddc7[_0x29f0('0x107')][_0x29f0('0x109')];_0x11fd39['port']=_0x74ddc7['Smtp'][_0x29f0('0x10a')];_0x11fd39[_0x29f0('0x10b')]=_0x74ddc7['Smtp'][_0x29f0('0x10b')];}if(_0x74ddc7[_0x29f0('0x107')][_0x29f0('0x10c')]){_0x11fd39['auth']={'user':_0x74ddc7['Smtp']['user'],'pass':_0x74ddc7[_0x29f0('0x107')][_0x29f0('0x10d')]};}return respondWithRpcPromise(_0x29f0('0x10e'),'sendMail',{'account':_0x11fd39,'message':{'from':util['format'](_0x29f0('0x10f'),_0x74ddc7[_0x29f0('0x3d')],_0x74ddc7[_0x29f0('0xd2')]||_0x74ddc7[_0x29f0('0x107')]['user']),'to':_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xf0')],'subject':_0x29f0('0x110'),'text':util[_0x29f0('0xf3')](_0x29f0('0x111'),_0x2e2091[_0x29f0('0x8b')][_0x29f0('0xf0')]),'attachments':[{'path':_0x1cba1c}]}})[_0x29f0('0x25')](function(){return _0x325b06;})['catch'](function(_0x156ec6){console[_0x29f0('0x2a')](_0x156ec6);});}else{return _0x325b06;}})[_0x29f0('0x25')](respondWithStatusCode(_0x1717ed,0xc8))[_0x29f0('0x2d')](handleError(_0x1717ed,null));};exports[_0x29f0('0x112')]=function(_0x3d96b9,_0x2abd80,_0x438e57){return db[_0x29f0('0xd9')][_0x29f0('0x81')]({'where':{'id':_0x3d96b9[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x2abd80,null))['then'](function(_0xd1e306){if(_0xd1e306){return _0xd1e306[_0x29f0('0x112')](_0x3d96b9[_0x29f0('0x8b')]['ids'],_['omit'](_0x3d96b9['body'],[_0x29f0('0x113'),'id'])||{});}})[_0x29f0('0x25')](respondWithResult(_0x2abd80,null))['catch'](handleError(_0x2abd80,null));};exports[_0x29f0('0x114')]=function(_0xc6515c,_0x24cb8f,_0x1eae1e){var _0x77698e={'raw':![],'where':{}};var _0x2d0dab={};var _0x408c92={'count':0x0,'rows':[]};return db[_0x29f0('0x52')][_0x29f0('0xcb')]({'where':{'id':_0xc6515c[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x24cb8f,null))['then'](function(_0x41672d){if(_0x41672d){_0x2d0dab['model']=_[_0x29f0('0x57')](db[_0x29f0('0xd9')][_0x29f0('0x53')]);_0x2d0dab[_0x29f0('0x56')]=_[_0x29f0('0x57')](_0xc6515c[_0x29f0('0x56')]);_0x2d0dab[_0x29f0('0x61')]=_[_0x29f0('0x59')](_0x2d0dab[_0x29f0('0x5a')],_0x2d0dab['query']);_0x77698e['attributes']=_[_0x29f0('0x59')](_0x2d0dab[_0x29f0('0x5a')],qs[_0x29f0('0x5b')](_0xc6515c[_0x29f0('0x56')]['fields']));_0x77698e[_0x29f0('0x58')]=_0x77698e[_0x29f0('0x58')][_0x29f0('0x5c')]?_0x77698e[_0x29f0('0x58')]:_0x2d0dab['model'];if(!_0xc6515c[_0x29f0('0x56')][_0x29f0('0x5d')](_0x29f0('0x115'))){_0x77698e['limit']=qs[_0x29f0('0x34')](_0xc6515c[_0x29f0('0x56')][_0x29f0('0x34')]);_0x77698e['offset']=qs[_0x29f0('0x32')](_0xc6515c[_0x29f0('0x56')][_0x29f0('0x32')]);}_0x77698e[_0x29f0('0x5e')]=qs[_0x29f0('0x5f')](_0xc6515c[_0x29f0('0x56')][_0x29f0('0x5f')]);_0x77698e[_0x29f0('0x60')]=qs[_0x29f0('0x61')](_[_0x29f0('0x116')](_0xc6515c[_0x29f0('0x56')],_0x2d0dab[_0x29f0('0x61')]));_0x77698e[_0x29f0('0x60')][_0x29f0('0xc0')]=_0x41672d['id'];if(_0xc6515c[_0x29f0('0x56')][_0x29f0('0x99')]){_0x77698e[_0x29f0('0x60')]=_[_0x29f0('0xb0')](_0x77698e[_0x29f0('0x60')],{'$or':_[_0x29f0('0x51')](_0x77698e[_0x29f0('0x58')],function(_0x49bd38){var _0x19bf31={};_0x19bf31[_0x49bd38]={'$like':'%'+_0xc6515c[_0x29f0('0x56')][_0x29f0('0x99')]+'%'};return _0x19bf31;})});}if(_0xc6515c['query'][_0x29f0('0x117')]){var _0x49eb6b=_0xc6515c['query'][_0x29f0('0x117')][_0x29f0('0x46')](',');var _0x35cce3={};_0x35cce3[_0x49eb6b[0x0]]={'$gte':moment(_0x49eb6b[0x1])['format'](_0x29f0('0x118'))};_0x77698e[_0x29f0('0x60')]=_[_0x29f0('0xb0')](_0x77698e[_0x29f0('0x60')],_0x35cce3);}_0x77698e=_[_0x29f0('0xb0')]({},_0x77698e,_0xc6515c['options']);return db[_0x29f0('0xd9')][_0x29f0('0x35')]({'where':_0x77698e[_0x29f0('0x60')]})['then'](function(_0x2ebb4a){_0x408c92['count']=_0x2ebb4a;if(_0xc6515c[_0x29f0('0x56')]['includeAll']){_0x77698e['include']=[{'all':!![]}];}return db[_0x29f0('0xd9')][_0x29f0('0x119')](_0x77698e);})[_0x29f0('0x25')](function(_0x47cc5){_0x408c92[_0x29f0('0xc2')]=_0x47cc5;return _0x408c92;});}})[_0x29f0('0x25')](respondWithFilteredResult(_0x24cb8f,_0x77698e))[_0x29f0('0x2d')](handleError(_0x24cb8f,null));};exports[_0x29f0('0x11a')]=function(_0x3c1c89,_0xbba52a,_0x304d31){var _0x4eb88b={'where':{}},_0x55a38f={},_0x3beaea={'count':0x0,'rows':[]};return db[_0x29f0('0x52')]['findOne']({'where':{'id':_0x3c1c89[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0xbba52a,null))[_0x29f0('0x25')](function(_0x148c8b){if(_0x148c8b){_0x55a38f[_0x29f0('0x5a')]=_['keys'](db[_0x29f0('0xd9')][_0x29f0('0x53')]);_0x55a38f[_0x29f0('0x56')]=_[_0x29f0('0x57')](_0x3c1c89[_0x29f0('0x56')]);_0x55a38f[_0x29f0('0x61')]=_[_0x29f0('0x59')](_0x55a38f[_0x29f0('0x5a')],_0x55a38f[_0x29f0('0x56')]);_0x4eb88b[_0x29f0('0x58')]=_[_0x29f0('0x59')](_0x55a38f[_0x29f0('0x5a')],qs[_0x29f0('0x5b')](_0x3c1c89[_0x29f0('0x56')]['fields']));_0x4eb88b['attributes']=_0x4eb88b[_0x29f0('0x58')][_0x29f0('0x5c')]?_0x4eb88b[_0x29f0('0x58')]:_0x55a38f[_0x29f0('0x5a')];if(!_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x5d')](_0x29f0('0x115'))){_0x4eb88b[_0x29f0('0x34')]=qs[_0x29f0('0x34')](_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x34')]);_0x4eb88b[_0x29f0('0x32')]=qs[_0x29f0('0x32')](_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x32')]);}_0x4eb88b[_0x29f0('0x5e')]=qs[_0x29f0('0x5f')](_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x5f')]);_0x4eb88b[_0x29f0('0x60')]=qs[_0x29f0('0x61')](_[_0x29f0('0x116')](_0x3c1c89[_0x29f0('0x56')],_0x55a38f['filters']));_0x4eb88b[_0x29f0('0x60')][_0x29f0('0xc0')]=_0x148c8b['id'];if(_0x3c1c89['query']['filter']){_0x4eb88b['where']=_[_0x29f0('0xb0')](_0x4eb88b[_0x29f0('0x60')],{'$or':_[_0x29f0('0x51')](_0x4eb88b[_0x29f0('0x58')],function(_0x7d19a){var _0x23c29c={};_0x23c29c[_0x7d19a]={'$like':'%'+_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x99')]+'%'};return _0x23c29c;})});}_0x4eb88b[_0x29f0('0x60')][_0x29f0('0x11b')]=![];if(_0x3c1c89[_0x29f0('0x56')]['id']){_0x4eb88b[_0x29f0('0x60')]['id']={'$gt':_0x3c1c89[_0x29f0('0x56')]['id']};}_0x4eb88b=_[_0x29f0('0xb0')]({},_0x4eb88b,_0x3c1c89[_0x29f0('0xc6')]);return db['ChatMessage']['count']({'where':_0x4eb88b[_0x29f0('0x60')]})[_0x29f0('0x25')](function(_0x244a26){_0x3beaea[_0x29f0('0x35')]=_0x244a26;_0x4eb88b[_0x29f0('0xc5')]=[];if(_0x3c1c89[_0x29f0('0x56')][_0x29f0('0x11c')]){_0x4eb88b[_0x29f0('0xc5')][_0x29f0('0x47')]({'model':db[_0x29f0('0xf8')],'as':'User','attributes':['id',_0x29f0('0x43'),_0x29f0('0xff')]});}if(_0x3c1c89[_0x29f0('0x56')][_0x29f0('0xc4')]){_0x4eb88b[_0x29f0('0xc5')]=[{'all':!![]}];}return db[_0x29f0('0xd9')]['findAll'](_0x4eb88b);})[_0x29f0('0x25')](function(_0x47b220){_0x3beaea[_0x29f0('0xc2')]=_0x47b220;return _0x3beaea;});}})[_0x29f0('0x25')](respondWithFilteredResult(_0xbba52a,_0x4eb88b))['catch'](handleError(_0xbba52a,null));};exports['addTags']=function(_0x38c54d,_0x1cd4d8,_0x4bb54d){return db[_0x29f0('0x52')]['find']({'where':{'id':_0x38c54d[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x1cd4d8,null))['then'](function(_0x4c9263){if(_0x4c9263){return _0x4c9263[_0x29f0('0x11d')](_0x38c54d[_0x29f0('0x8b')]['ids'],_[_0x29f0('0x11e')](_0x38c54d[_0x29f0('0x8b')],[_0x29f0('0x113'),'id'])||{})[_0x29f0('0x11f')](function(){return db[_0x29f0('0x86')][_0x29f0('0x119')]({'attributes':['id',_0x29f0('0x3d'),_0x29f0('0x62')],'where':{'id':_0x38c54d[_0x29f0('0x8b')][_0x29f0('0x113')]}});})['then'](function(_0x3aee8e){socket[_0x29f0('0x120')](_0x29f0('0x121'),{'id':Number(_0x38c54d['params']['id']),'tags':_0x3aee8e||[]});return{'id':Number(_0x38c54d[_0x29f0('0xc8')]['id']),'tags':_0x3aee8e||[]};});}})[_0x29f0('0x25')](respondWithResult(_0x1cd4d8,null))['catch'](handleError(_0x1cd4d8,null));};exports['removeTags']=function(_0x2d6ac6,_0x40e23c,_0x49a14d){return db['ChatInteraction']['find']({'where':{'id':_0x2d6ac6[_0x29f0('0xc8')]['id']}})[_0x29f0('0x25')](handleEntityNotFound(_0x40e23c,null))[_0x29f0('0x25')](function(_0x5c2456){if(_0x5c2456){return _0x5c2456['removeTags'](_0x2d6ac6['query'][_0x29f0('0x113')]);}})[_0x29f0('0x25')](respondWithStatusCode(_0x40e23c,null))[_0x29f0('0x2d')](handleError(_0x40e23c,null));};exports['download']=function(_0x57c80a,_0x52c53f){var _0xd55701=moment()[_0x29f0('0x122')]()[_0x29f0('0xae')]();var _0x218bc6=path[_0x29f0('0xec')](config[_0x29f0('0xf1')],_0x29f0('0x123'),_0x29f0('0x124'),'tmp');var _0x38526c=path[_0x29f0('0xec')](config[_0x29f0('0xf1')],_0x29f0('0x123'),_0x29f0('0x124'),'attachments');var _0x51264d=path[_0x29f0('0xec')](_0x218bc6,_0xd55701);var _0x52d801=util[_0x29f0('0xf3')](_0x29f0('0x125'),_0x57c80a[_0x29f0('0xc8')]['id'],_0xd55701);var _0x2d12a8=path[_0x29f0('0xec')](_0x218bc6,_0x52d801);var _0x20cb64=[];_0x20cb64[_0x29f0('0x47')]({'model':db[_0x29f0('0xf8')],'as':_0x29f0('0xf8'),'attributes':['id',_0x29f0('0x43')],'raw':!![]});_0x20cb64[_0x29f0('0x47')]({'model':db[_0x29f0('0xdc')],'as':_0x29f0('0x7d'),'attributes':['id',_0x29f0('0x126'),_0x29f0('0x127')],'raw':!![]});if(_0x57c80a['query'][_0x29f0('0x128')]){_0x20cb64[_0x29f0('0x47')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4b7bb3=[{'model':db[_0x29f0('0xd9')],'as':_0x29f0('0xf7'),'attributes':['id',_0x29f0('0x8b'),_0x29f0('0x8e'),_0x29f0('0x103'),_0x29f0('0x11b'),_0x29f0('0x94')],'include':_0x20cb64}];_0x4b7bb3[_0x29f0('0x47')]({'model':db['ChatWebsite'],'as':_0x29f0('0x129'),'attributes':['id','name']});_0x4b7bb3[_0x29f0('0x47')]({'model':db[_0x29f0('0xf8')],'as':_0x29f0('0x12a'),'attributes':['id',_0x29f0('0x43')]});return db[_0x29f0('0x52')]['find']({'where':{'id':_0x57c80a['params']['id']},'include':_0x4b7bb3})['then'](handleEntityNotFound(_0x52c53f,null))[_0x29f0('0x25')](function(_0x5ab301){if(_0x5ab301){var _0x3224b2=_0x5ab301[_0x29f0('0x12b')]({'plain':!![]});fs['mkdirSync'](_0x51264d);var _0x2d737a={'channel':_0x29f0('0x12c'),'account':_0x3224b2[_0x29f0('0x129')]['name'],'agent':_0x3224b2[_0x29f0('0x12a')]?_0x3224b2['Owner'][_0x29f0('0x43')]:_0x29f0('0x12d'),'createdAt':moment(_0x3224b2[_0x29f0('0x8e')])[_0x29f0('0xf3')](_0x29f0('0x118'))[_0x29f0('0xae')](),'closedAt':_0x3224b2[_0x29f0('0x4e')]?moment(_0x3224b2['closedAt'])['format'](_0x29f0('0x118'))[_0x29f0('0xae')]():'','disposition':_0x3224b2['disposition'],'chatInfo':{'browser':_0x3224b2[_0x29f0('0x12e')],'os':_0x3224b2[_0x29f0('0x12f')],'referer':_0x3224b2['referer'],'customerIp':_0x3224b2['customerIp'],'customerPort':_0x3224b2[_0x29f0('0x130')]?_0x3224b2['customerPort']:_0x29f0('0x12d')},'messages':_(_0x3224b2['Messages'])[_0x29f0('0x131')]()['filter']({'secret':![]})['map'](function(_0x5eba71){if(_0x5eba71['Attachment']){var _0x2420c0=path[_0x29f0('0xec')](_0x38526c,_0x5eba71[_0x29f0('0xe7')]['basename']);if(fs[_0x29f0('0x132')](_0x2420c0)){fs[_0x29f0('0x133')](_0x2420c0)[_0x29f0('0x134')](fs['createWriteStream'](path['join'](_0x51264d,_0x5eba71[_0x29f0('0xe7')]['basename'])));}}return{'date':moment(_0x5eba71[_0x29f0('0x8e')])[_0x29f0('0xf3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x5eba71[_0x29f0('0x103')]===_0x29f0('0xd8')?_0x5eba71[_0x29f0('0xf8')]?_0x5eba71[_0x29f0('0xf8')][_0x29f0('0x43')]:_0x29f0('0xfd'):_0x5eba71['Contact'][_0x29f0('0x126')]+(_0x5eba71[_0x29f0('0x7d')][_0x29f0('0x127')]?'\x20'+_0x5eba71[_0x29f0('0x7d')][_0x29f0('0x127')]:''),'body':_0x5eba71['Attachment']?_0x5eba71[_0x29f0('0xe7')][_0x29f0('0xe3')]:_0x5eba71[_0x29f0('0x8b')],'direction':_0x5eba71[_0x29f0('0x103')]===_0x29f0('0xd8')?'A':'C','secret':_0x5eba71['secret'],'read':_0x5eba71[_0x29f0('0x94')],'attachment':_0x5eba71[_0x29f0('0xe7')]};})[_0x29f0('0x7b')]()};return ejs[_0x29f0('0x135')](path[_0x29f0('0xec')](config[_0x29f0('0xf1')],'server',_0x29f0('0x136'),_0x29f0('0x137')),{'interaction':_0x2d737a})[_0x29f0('0x25')](function(_0x161e49){var _0x16c616=path['join'](_0x51264d,_0x29f0('0x138')+_0x3224b2['id']+'-'+_0xd55701+_0x29f0('0x139'));var _0x372bfb={'path':_0x16c616,'channel':_0x29f0('0x12c'),'interactionId':_0x3224b2['id']};return pdf[_0x29f0('0x13a')](_0x161e49,_0x372bfb);})['then'](function(){return new BPromise(function(_0x5c9177,_0xe7fd29){zipdir(_0x51264d,{'saveTo':_0x2d12a8},function(_0x871fbc,_0x452c33){if(_0x871fbc)return _0xe7fd29(_0x871fbc);return _0x5c9177(_0x452c33);});})[_0x29f0('0x25')](function(){return new BPromise(function(_0x2b8bda,_0x1d62e9){rimraf(_0x51264d,function(_0x22a118){if(_0x22a118)_0x1d62e9(_0x22a118);return _0x2b8bda();});});})['then'](function(){return _0x52c53f[_0x29f0('0x13b')](_0x2d12a8,_0x52d801,function(_0x481f9d){if(_0x481f9d){console['log'](_0x29f0('0x13c'),_0x481f9d);}else{fs[_0x29f0('0x13d')](_0x2d12a8);}});});});}else{return _0x52c53f[_0x29f0('0x2e')](0xc8);}})[_0x29f0('0x2d')](handleError(_0x52c53f,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 11b0e59..259499f 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 _0x16bf=['unreadMessages','length','emit','hasOwnProperty','hook','exports','ChatInteraction','../../mysqldb','ChatMessage','save','remove','getUsers','then','Users','map','findAll','setDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16bf,0x116));var _0xf16b=function(_0x3f15ae,_0x2f8168){_0x3f15ae=_0x3f15ae-0x0;var _0x5ad4=_0x16bf[_0x3f15ae];return _0x5ad4;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xf16b('0x0')];var ChatMessage=require(_0xf16b('0x1'))['db'][_0xf16b('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf16b('0x3'),'afterUpdate':'update','afterDestroy':_0xf16b('0x4')};function emitEvent(_0x2ba743){return function(_0x4fe78c,_0x1d5f9b,_0x2ec26c){_0x4fe78c[_0xf16b('0x5')]({'attributes':['id'],'raw':!![]})[_0xf16b('0x6')](function(_0x3e15d3){_0x4fe78c['setDataValue'](_0xf16b('0x7'),_0x3e15d3[_0xf16b('0x8')](function(_0x3d8fc3){return{'id':_0x3d8fc3['id']};}));return ChatMessage[_0xf16b('0x9')]({'where':{'ChatInteractionId':_0x4fe78c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf16b('0x6')](function(_0x2ba46a){_0x4fe78c[_0xf16b('0xa')](_0xf16b('0xb'),_0x2ba46a[_0xf16b('0xc')]);ChatInteractionEvents[_0xf16b('0xd')](_0x2ba743+':'+_0x4fe78c['id'],_0x4fe78c);ChatInteractionEvents[_0xf16b('0xd')](_0x2ba743,_0x4fe78c);_0x2ec26c(null);})['catch'](_0x2ec26c(null));};}for(var e in events){if(events[_0xf16b('0xe')](e)){var event=events[e];ChatInteraction[_0xf16b('0xf')](e,emitEvent(event));}}module[_0xf16b('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc2da=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update','then','setDataValue','Users'];(function(_0x583345,_0x42d756){var _0x1b2505=function(_0x1fc76c){while(--_0x1fc76c){_0x583345['push'](_0x583345['shift']());}};_0x1b2505(++_0x42d756);}(_0xc2da,0xc3));var _0xac2d=function(_0xeb5ddc,_0x47cac9){_0xeb5ddc=_0xeb5ddc-0x0;var _0xfe6f47=_0xc2da[_0xeb5ddc];return _0xfe6f47;};'use strict';var EventEmitter=require(_0xac2d('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xac2d('0x1')];var ChatMessage=require(_0xac2d('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xac2d('0x3')](0x0);var events={'afterCreate':_0xac2d('0x4'),'afterUpdate':_0xac2d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ecbe5){return function(_0x1f9336,_0x3dd620,_0x56d364){_0x1f9336['getUsers']({'attributes':['id'],'raw':!![]})[_0xac2d('0x6')](function(_0x22a7b8){_0x1f9336[_0xac2d('0x7')](_0xac2d('0x8'),_0x22a7b8[_0xac2d('0x9')](function(_0x402126){return{'id':_0x402126['id']};}));return ChatMessage[_0xac2d('0xa')]({'where':{'ChatInteractionId':_0x1f9336['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac2d('0x6')](function(_0x841a42){_0x1f9336[_0xac2d('0x7')](_0xac2d('0xb'),_0x841a42[_0xac2d('0xc')]);ChatInteractionEvents[_0xac2d('0xd')](_0x1ecbe5+':'+_0x1f9336['id'],_0x1f9336);ChatInteractionEvents[_0xac2d('0xd')](_0x1ecbe5,_0x1f9336);_0x56d364(null);})[_0xac2d('0xe')](_0x56d364(null));};}for(var e in events){if(events[_0xac2d('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xac2d('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 1b1df5f..d5eab1c 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 _0xb13c=['../../config/logger','api','request-promise','path','./chatInteraction.attributes','define','chat_interactions','closed','closedAt','format','utf8mb4','lodash','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb13c,0x184));var _0xcb13=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0xb13c[_0x4e0359];return _0x450f0a;};'use strict';var _=require(_0xcb13('0x0'));var util=require(_0xcb13('0x1'));var logger=require(_0xcb13('0x2'))(_0xcb13('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb13('0x4'));var fs=require('fs');var path=require(_0xcb13('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb13('0x6'));module['exports']=function(_0x15cd0b,_0x2cb225){return _0x15cd0b[_0xcb13('0x7')]('ChatInteraction',attributes,{'tableName':_0xcb13('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f785a,_0x583a44,_0x1bce6a){if(_0x1f785a['changed'](_0xcb13('0x9'))){_0x1f785a[_0xcb13('0xa')]=moment()[_0xcb13('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1bce6a(null,_0x1f785a);}},'charset':_0xcb13('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xdcae=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format'];(function(_0x53a456,_0x1c3d73){var _0x19bf77=function(_0x252263){while(--_0x252263){_0x53a456['push'](_0x53a456['shift']());}};_0x19bf77(++_0x1c3d73);}(_0xdcae,0x1e3));var _0xedca=function(_0x5a709c,_0x1e6cfe){_0x5a709c=_0x5a709c-0x0;var _0x719025=_0xdcae[_0x5a709c];return _0x719025;};'use strict';var _=require('lodash');var util=require(_0xedca('0x0'));var logger=require('../../config/logger')(_0xedca('0x1'));var moment=require(_0xedca('0x2'));var BPromise=require(_0xedca('0x3'));var rp=require(_0xedca('0x4'));var fs=require('fs');var path=require(_0xedca('0x5'));var rimraf=require(_0xedca('0x6'));var config=require(_0xedca('0x7'));var attributes=require(_0xedca('0x8'));module[_0xedca('0x9')]=function(_0x26faff,_0x49a82d){return _0x26faff[_0xedca('0xa')](_0xedca('0xb'),attributes,{'tableName':_0xedca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x128b39,_0x2edc48,_0x507248){if(_0x128b39[_0xedca('0xd')](_0xedca('0xe'))){_0x128b39[_0xedca('0xf')]=moment()[_0xedca('0x10')](_0xedca('0x11'));}_0x507248(null,_0x128b39);}},'charset':_0xedca('0x12'),'collate':_0xedca('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 43f2527..f03aad3 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 _0x50bf=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatInteraction,\x20%s,\x20%s','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','stringify','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash'];(function(_0x1d0a01,_0x163bbf){var _0x1f7ecf=function(_0x3f151c){while(--_0x3f151c){_0x1d0a01['push'](_0x1d0a01['shift']());}};_0x1f7ecf(++_0x163bbf);}(_0x50bf,0x101));var _0xf50b=function(_0x42abf5,_0x53bfde){_0x42abf5=_0x42abf5-0x0;var _0x21cf79=_0x50bf[_0x42abf5];return _0x21cf79;};'use strict';var _=require(_0xf50b('0x0'));var util=require('util');var moment=require(_0xf50b('0x1'));var BPromise=require(_0xf50b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf50b('0x3'))['db'];var utils=require(_0xf50b('0x4'));var logger=require(_0xf50b('0x5'))(_0xf50b('0x6'));var config=require(_0xf50b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf50b('0x8')][_0xf50b('0x9')]({'port':0x232a});config['redis']=_[_0xf50b('0xa')](config[_0xf50b('0xb')],{'host':_0xf50b('0xc'),'port':0x18eb});var socket=require(_0xf50b('0xd'))(new Redis(config[_0xf50b('0xb')]));require('./chatInteraction.socket')[_0xf50b('0xe')](socket);function respondWithRpcPromise(_0xabc2ca,_0x54e905,_0x8e190c){return new BPromise(function(_0x2688b3,_0x184817){return client[_0xf50b('0xf')](_0xabc2ca,_0x8e190c)[_0xf50b('0x10')](function(_0x27a4a6){logger[_0xf50b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x54e905,'request\x20sent');logger[_0xf50b('0x12')](_0xf50b('0x13'),_0x54e905,_0xf50b('0x14'),JSON['stringify'](_0x27a4a6));if(_0x27a4a6[_0xf50b('0x15')]){if(_0x27a4a6[_0xf50b('0x15')][_0xf50b('0x16')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x54e905,_0x27a4a6[_0xf50b('0x15')]['message']);return _0x184817(_0x27a4a6[_0xf50b('0x15')][_0xf50b('0x17')]);}logger[_0xf50b('0x15')](_0xf50b('0x18'),_0x54e905,_0x27a4a6[_0xf50b('0x15')]['message']);return _0x2688b3(_0x27a4a6[_0xf50b('0x15')][_0xf50b('0x17')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x54e905,_0xf50b('0x14'));_0x2688b3(_0x27a4a6[_0xf50b('0x19')]['message']);}})['catch'](function(_0x53409e){logger[_0xf50b('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x54e905,_0x53409e);_0x184817(_0x53409e);});});}exports[_0xf50b('0x1a')]=function(_0x1a1620){var _0x508938=this;return new Promise(function(_0x302274,_0x201867){return db[_0xf50b('0x1b')][_0xf50b('0x1c')](_0x1a1620[_0xf50b('0x1d')],{'raw':_0x1a1620[_0xf50b('0x1e')]?_0x1a1620['options'][_0xf50b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a1620[_0xf50b('0x1e')]?_0x1a1620[_0xf50b('0x1e')][_0xf50b('0x20')]||null:null,'attributes':_0x1a1620[_0xf50b('0x1e')]?_0x1a1620[_0xf50b('0x1e')]['attributes']||null:null,'limit':_0x1a1620[_0xf50b('0x1e')]?_0x1a1620[_0xf50b('0x1e')][_0xf50b('0x21')]||null:null})['then'](function(_0x47b603){logger['info'](_0xf50b('0x1a'),_0x1a1620);logger[_0xf50b('0x12')]('UpdateChatInteraction',_0x1a1620,JSON[_0xf50b('0x22')](_0x47b603));_0x302274(_0x47b603);})[_0xf50b('0x23')](function(_0x7a7d8a){logger[_0xf50b('0x15')](_0xf50b('0x1a'),_0x7a7d8a[_0xf50b('0x17')],_0x1a1620);_0x201867(_0x508938[_0xf50b('0x15')](0x1f4,_0x7a7d8a[_0xf50b('0x17')]));});});};exports[_0xf50b('0x24')]=function(_0x296d3c){return new Promise(function(_0x596d09,_0x4613f0){return db[_0xf50b('0x1b')][_0xf50b('0x25')]({'where':_0x296d3c[_0xf50b('0x1e')]?_0x296d3c[_0xf50b('0x1e')][_0xf50b('0x20')]||null:null})['then'](function(_0x46a73f){if(_0x46a73f){return _0x46a73f[_0xf50b('0x26')](_0x296d3c[_0xf50b('0x1d')][_0xf50b('0x27')],_[_0xf50b('0x28')](_0x296d3c['body'],['ids','id'])||{});}})[_0xf50b('0x29')](function(_0x275de7){logger[_0xf50b('0x11')](_0xf50b('0x2a'),_0x296d3c);logger[_0xf50b('0x12')](_0xf50b('0x2a'),_0x296d3c,JSON[_0xf50b('0x22')](_0x275de7));_0x596d09(_0x275de7);})[_0xf50b('0x23')](function(_0xe43aec){logger['error']('AddTags',_0xe43aec[_0xf50b('0x17')],_0x296d3c);_0x4613f0(_this[_0xf50b('0x15')](0x1f4,_0xe43aec[_0xf50b('0x17')]));});});};
\ No newline at end of file
+var _0xbb91=['./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','stringify','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','redis'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xbb91,0x9e));var _0x1bb9=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0xbb91[_0x1c72b8];return _0x191114;};'use strict';var _=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var moment=require(_0x1bb9('0x2'));var BPromise=require(_0x1bb9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1bb9('0x4'))['db'];var utils=require(_0x1bb9('0x5'));var logger=require(_0x1bb9('0x6'))(_0x1bb9('0x7'));var config=require(_0x1bb9('0x8'));var jayson=require(_0x1bb9('0x9'));var client=jayson[_0x1bb9('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1bb9('0xb')](config['redis'],{'host':_0x1bb9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1bb9('0xd')]));require(_0x1bb9('0xe'))[_0x1bb9('0xf')](socket);function respondWithRpcPromise(_0x12dd2a,_0x31f453,_0x3696e2){return new BPromise(function(_0xc23f1,_0x130b78){return client[_0x1bb9('0x10')](_0x12dd2a,_0x3696e2)[_0x1bb9('0x11')](function(_0x2758af){logger[_0x1bb9('0x12')](_0x1bb9('0x13'),_0x31f453,_0x1bb9('0x14'));logger[_0x1bb9('0x15')](_0x1bb9('0x16'),_0x31f453,_0x1bb9('0x14'),JSON['stringify'](_0x2758af));if(_0x2758af[_0x1bb9('0x17')]){if(_0x2758af[_0x1bb9('0x17')][_0x1bb9('0x18')]===0x1f4){logger[_0x1bb9('0x17')](_0x1bb9('0x13'),_0x31f453,_0x2758af[_0x1bb9('0x17')][_0x1bb9('0x19')]);return _0x130b78(_0x2758af['error'][_0x1bb9('0x19')]);}logger[_0x1bb9('0x17')](_0x1bb9('0x13'),_0x31f453,_0x2758af[_0x1bb9('0x17')][_0x1bb9('0x19')]);return _0xc23f1(_0x2758af['error'][_0x1bb9('0x19')]);}else{logger[_0x1bb9('0x12')](_0x1bb9('0x13'),_0x31f453,_0x1bb9('0x14'));_0xc23f1(_0x2758af[_0x1bb9('0x1a')][_0x1bb9('0x19')]);}})[_0x1bb9('0x1b')](function(_0x38a860){logger[_0x1bb9('0x17')](_0x1bb9('0x13'),_0x31f453,_0x38a860);_0x130b78(_0x38a860);});});}exports[_0x1bb9('0x1c')]=function(_0x4c54c2){var _0x5c5355=this;return new Promise(function(_0x50be32,_0x3c1351){return db[_0x1bb9('0x1d')][_0x1bb9('0x1e')](_0x4c54c2[_0x1bb9('0x1f')],{'raw':_0x4c54c2[_0x1bb9('0x20')]?_0x4c54c2[_0x1bb9('0x20')][_0x1bb9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c54c2[_0x1bb9('0x20')]?_0x4c54c2[_0x1bb9('0x20')][_0x1bb9('0x22')]||null:null,'attributes':_0x4c54c2[_0x1bb9('0x20')]?_0x4c54c2[_0x1bb9('0x20')]['attributes']||null:null,'limit':_0x4c54c2[_0x1bb9('0x20')]?_0x4c54c2['options'][_0x1bb9('0x23')]||null:null})[_0x1bb9('0x11')](function(_0x7a3e87){logger[_0x1bb9('0x12')](_0x1bb9('0x1c'),_0x4c54c2);logger[_0x1bb9('0x15')](_0x1bb9('0x1c'),_0x4c54c2,JSON[_0x1bb9('0x24')](_0x7a3e87));_0x50be32(_0x7a3e87);})[_0x1bb9('0x1b')](function(_0x3377ee){logger['error'](_0x1bb9('0x1c'),_0x3377ee[_0x1bb9('0x19')],_0x4c54c2);_0x3c1351(_0x5c5355['error'](0x1f4,_0x3377ee[_0x1bb9('0x19')]));});});};exports[_0x1bb9('0x25')]=function(_0x2f2442){return new Promise(function(_0x58c6a1,_0x438a76){return db[_0x1bb9('0x1d')][_0x1bb9('0x26')]({'where':_0x2f2442[_0x1bb9('0x20')]?_0x2f2442[_0x1bb9('0x20')][_0x1bb9('0x22')]||null:null})['then'](function(_0x3a73ca){if(_0x3a73ca){return _0x3a73ca['addTags'](_0x2f2442[_0x1bb9('0x1f')][_0x1bb9('0x27')],_[_0x1bb9('0x28')](_0x2f2442[_0x1bb9('0x1f')],[_0x1bb9('0x27'),'id'])||{});}})[_0x1bb9('0x29')](function(_0x4b5b26){logger[_0x1bb9('0x12')](_0x1bb9('0x2a'),_0x2f2442);logger[_0x1bb9('0x15')](_0x1bb9('0x2a'),_0x2f2442,JSON[_0x1bb9('0x24')](_0x4b5b26));_0x58c6a1(_0x4b5b26);})[_0x1bb9('0x1b')](function(_0x29c0c9){logger['error'](_0x1bb9('0x2a'),_0x29c0c9['message'],_0x2f2442);_0x438a76(_this['error'](0x1f4,_0x29c0c9[_0x1bb9('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b018cd9..48e2a3b 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 _0x6c6f=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x5f14ef,_0x2c0b21){var _0x1b5067=function(_0x566d2f){while(--_0x566d2f){_0x5f14ef['push'](_0x5f14ef['shift']());}};_0x1b5067(++_0x2c0b21);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x11a3cc,_0x587433){_0x11a3cc=_0x11a3cc-0x0;var _0x16d50e=_0x6c6f[_0x11a3cc];return _0x16d50e;};'use strict';var ChatInteractionEvents=require(_0xf6c6('0x0'));var events=[_0xf6c6('0x1'),_0xf6c6('0x2'),_0xf6c6('0x3')];function createListener(_0x2f571d,_0x3c8fc3){return function(_0x332916){_0x3c8fc3[_0xf6c6('0x4')](_0x2f571d,_0x332916);};}function removeListener(_0x36fcd2,_0xa1183){return function(){ChatInteractionEvents[_0xf6c6('0x5')](_0x36fcd2,_0xa1183);};}exports['register']=function(_0x3b4e7b){for(var _0x4f8e34=0x0,_0x4c27f8=events[_0xf6c6('0x6')];_0x4f8e34<_0x4c27f8;_0x4f8e34++){var _0x5b34df=events[_0x4f8e34];var _0x308c42=createListener(_0xf6c6('0x7')+_0x5b34df,_0x3b4e7b);ChatInteractionEvents['on'](_0x5b34df,_0x308c42);}};
\ No newline at end of file
+var _0x4ed4=['remove','update','emit','register','chatInteraction:','save'];(function(_0x10f68,_0x450501){var _0x353b09=function(_0x292fd2){while(--_0x292fd2){_0x10f68['push'](_0x10f68['shift']());}};_0x353b09(++_0x450501);}(_0x4ed4,0xbf));var _0x44ed=function(_0x334623,_0x33a637){_0x334623=_0x334623-0x0;var _0x2c3799=_0x4ed4[_0x334623];return _0x2c3799;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x44ed('0x0'),_0x44ed('0x1'),_0x44ed('0x2')];function createListener(_0x2016e0,_0x34ac2a){return function(_0xa80d0c){_0x34ac2a[_0x44ed('0x3')](_0x2016e0,_0xa80d0c);};}function removeListener(_0x515e2a,_0x2fab7d){return function(){ChatInteractionEvents['removeListener'](_0x515e2a,_0x2fab7d);};}exports[_0x44ed('0x4')]=function(_0x5d44e1){for(var _0x438adf=0x0,_0x319878=events['length'];_0x438adf<_0x319878;_0x438adf++){var _0x44e4e0=events[_0x438adf];var _0x4d9e3c=createListener(_0x44ed('0x5')+_0x44e4e0,_0x5d44e1);ChatInteractionEvents['on'](_0x44e4e0,_0x4d9e3c);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c1f0e7e..56cd953 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 _0x0556=['diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','/:id/messages','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','createVidaooSession'];(function(_0x5c1f18,_0x53d570){var _0xa58746=function(_0x3a3c5e){while(--_0x3a3c5e){_0x5c1f18['push'](_0x5c1f18['shift']());}};_0xa58746(++_0x53d570);}(_0x0556,0xb6));var _0x6055=function(_0x1eb82d,_0x1e23cb){_0x1eb82d=_0x1eb82d-0x0;var _0x2c9502=_0x0556[_0x1eb82d];return _0x2c9502;};'use strict';var multer=require(_0x6055('0x0'));var util=require('util');var path=require(_0x6055('0x1'));var timeout=require(_0x6055('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6055('0x3'));var interaction=require(_0x6055('0x4'));var config=require(_0x6055('0x5'));var controller=require(_0x6055('0x6'));router['get']('/',auth[_0x6055('0x7')](),controller['index']);router[_0x6055('0x8')]('/describe',auth[_0x6055('0x7')](),controller[_0x6055('0x9')]);router[_0x6055('0x8')](_0x6055('0xa'),auth['isChatInteractionAuthorized'](),controller[_0x6055('0xb')]);router[_0x6055('0x8')](_0x6055('0xc'),auth[_0x6055('0xd')](),controller[_0x6055('0xe')]);router['get']('/:id/messages',auth[_0x6055('0x7')](),controller[_0x6055('0xf')]);router[_0x6055('0x8')](_0x6055('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x6055('0x11')]);router[_0x6055('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x6055('0x12')]);router[_0x6055('0x13')]('/',auth[_0x6055('0x7')](),controller[_0x6055('0x14')]);router[_0x6055('0x13')]('/:id/vidaoo',auth[_0x6055('0x7')](),controller[_0x6055('0x15')]);var upload=multer({'storage':multer[_0x6055('0x16')]({'destination':function(_0x26b23a,_0xfb4580,_0x2c47f0){_0x2c47f0(null,path[_0x6055('0x17')](config[_0x6055('0x18')],_0x6055('0x19')));},'filename':function(_0x29d032,_0x48452f,_0x196708){_0x196708(null,util[_0x6055('0x1a')](_0x6055('0x1b'),Date[_0x6055('0x1c')](),_0x48452f[_0x6055('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x6055('0x1e'),upload[_0x6055('0x1f')](_0x6055('0x20')),controller['attachmentUpload']);router[_0x6055('0x13')](_0x6055('0x21'),auth[_0x6055('0xd')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x6055('0x22')](_0x6055('0x23'),_0x6055('0x24')),controller['addTags']);router[_0x6055('0x25')]('/:id',auth[_0x6055('0x7')](),interaction[_0x6055('0x22')](_0x6055('0x23'),_0x6055('0x26')),controller[_0x6055('0x27')]);router[_0x6055('0x25')](_0x6055('0x28'),controller[_0x6055('0x29')]);router[_0x6055('0x25')](_0x6055('0x2a'),auth[_0x6055('0xd')](),controller[_0x6055('0x2b')]);router['put']('/:id/close',controller[_0x6055('0x2c')]);router[_0x6055('0x2d')](_0x6055('0xa'),auth['isAuthenticated'](),interaction[_0x6055('0x22')](_0x6055('0x23'),_0x6055('0x2e')),controller[_0x6055('0x2f')]);router['delete'](_0x6055('0x30'),auth[_0x6055('0x7')](),controller[_0x6055('0x31')]);module[_0x6055('0x32')]=router;
\ No newline at end of file
+var _0x11d4=['close','delete','tracked','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','post','create','/:id/vidaoo','diskStorage','join','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11d4,0x105));var _0x411d=function(_0x207f46,_0x20cc49){_0x207f46=_0x207f46-0x0;var _0x226e01=_0x11d4[_0x207f46];return _0x226e01;};'use strict';var multer=require(_0x411d('0x0'));var util=require('util');var path=require(_0x411d('0x1'));var timeout=require(_0x411d('0x2'));var express=require(_0x411d('0x3'));var router=express['Router']();var fs_extra=require(_0x411d('0x4'));var auth=require(_0x411d('0x5'));var interaction=require(_0x411d('0x6'));var config=require(_0x411d('0x7'));var controller=require(_0x411d('0x8'));router[_0x411d('0x9')]('/',auth[_0x411d('0xa')](),controller[_0x411d('0xb')]);router[_0x411d('0x9')](_0x411d('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x411d('0x9')](_0x411d('0xd'),auth[_0x411d('0xe')](),controller[_0x411d('0xf')]);router[_0x411d('0x9')](_0x411d('0x10'),auth[_0x411d('0xe')](),controller[_0x411d('0x11')]);router[_0x411d('0x9')](_0x411d('0x12'),auth[_0x411d('0xa')](),controller[_0x411d('0x13')]);router[_0x411d('0x9')]('/:id/my_messages',auth[_0x411d('0xe')](),controller[_0x411d('0x14')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x411d('0x15')]);router[_0x411d('0x16')]('/',auth['isAuthenticated'](),controller[_0x411d('0x17')]);router[_0x411d('0x16')](_0x411d('0x18'),auth[_0x411d('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x411d('0x19')]({'destination':function(_0x12b94a,_0xbfc138,_0x3c06d3){_0x3c06d3(null,path[_0x411d('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x2b2cf9,_0x28c40b,_0x24ca79){_0x24ca79(null,util['format']('%s-%s',Date['now'](),_0x28c40b[_0x411d('0x1b')][_0x411d('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x411d('0x16')](_0x411d('0x1d'),upload[_0x411d('0x1e')]('file'),controller[_0x411d('0x1f')]);router[_0x411d('0x16')]('/:id/messages',auth[_0x411d('0xe')](),controller[_0x411d('0x20')]);router['post'](_0x411d('0x21'),auth['isAuthenticated'](),interaction['tracked'](_0x411d('0x22'),_0x411d('0x23')),controller[_0x411d('0x24')]);router[_0x411d('0x25')]('/:id',auth[_0x411d('0xa')](),interaction['tracked'](_0x411d('0x22'),_0x411d('0x26')),controller[_0x411d('0x27')]);router[_0x411d('0x25')](_0x411d('0x28'),controller[_0x411d('0x29')]);router[_0x411d('0x25')](_0x411d('0x2a'),auth[_0x411d('0xe')](),controller[_0x411d('0x2b')]);router[_0x411d('0x25')](_0x411d('0x2c'),controller[_0x411d('0x2d')]);router[_0x411d('0x2e')](_0x411d('0xd'),auth[_0x411d('0xa')](),interaction[_0x411d('0x2f')](_0x411d('0x22'),_0x411d('0x30')),controller[_0x411d('0x31')]);router[_0x411d('0x2e')](_0x411d('0x21'),auth[_0x411d('0xa')](),controller['removeTags']);module[_0x411d('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 42ac092..beccba5 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 _0x8713=['sequelize','exports','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8713,0x184));var _0x3871=function(_0x5fdb22,_0x24aaf9){_0x5fdb22=_0x5fdb22-0x0;var _0xaa6d7e=_0x8713[_0x5fdb22];return _0xaa6d7e;};'use strict';var Sequelize=require(_0x3871('0x0'));module[_0x3871('0x1')]={'body':{'type':Sequelize[_0x3871('0x2')](_0x3871('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4b39=['medium','BOOLEAN','sequelize','TEXT'];(function(_0x2dbe16,_0x13655b){var _0x3eb827=function(_0x3b3c87){while(--_0x3b3c87){_0x2dbe16['push'](_0x2dbe16['shift']());}};_0x3eb827(++_0x13655b);}(_0x4b39,0x116));var _0x94b3=function(_0x4e2d46,_0x199962){_0x4e2d46=_0x4e2d46-0x0;var _0x12f797=_0x4b39[_0x4e2d46];return _0x12f797;};'use strict';var Sequelize=require(_0x94b3('0x0'));module['exports']={'body':{'type':Sequelize[_0x94b3('0x1')](_0x94b3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x94b3('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 59465dc..41cba22 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 _0xda3d=['push','messages','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatInternalMessage','then','include','findAll','rows','show','includeAll','find','catch','create','body','params','createdAt','lastMessage','format','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xda3d,0x154));var _0xdda3=function(_0xd3381d,_0x6c6291){_0xd3381d=_0xd3381d-0x0;var _0x2fe10e=_0xda3d[_0xd3381d];return _0x2fe10e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda3('0x0'));var zipdir=require(_0xdda3('0x1'));var jsonpatch=require(_0xdda3('0x2'));var rp=require(_0xdda3('0x3'));var moment=require(_0xdda3('0x4'));var BPromise=require(_0xdda3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdda3('0x6'));var csv=require(_0xdda3('0x7'));var ejs=require(_0xdda3('0x8'));var fs=require('fs');var fs_extra=require(_0xdda3('0x9'));var _=require(_0xdda3('0xa'));var squel=require(_0xdda3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdda3('0xc'));var toCsv=require(_0xdda3('0x7'));var querystring=require(_0xdda3('0xd'));var Papa=require(_0xdda3('0xe'));var Redis=require(_0xdda3('0xf'));var authService=require(_0xdda3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdda3('0x11'));var hardwareService=require(_0xdda3('0x12'));var logger=require(_0xdda3('0x13'))(_0xdda3('0x14'));var utils=require(_0xdda3('0x15'));var config=require(_0xdda3('0x16'));var licenseUtil=require(_0xdda3('0x17'));var db=require(_0xdda3('0x18'))['db'];config[_0xdda3('0x19')]=_[_0xdda3('0x1a')](config[_0xdda3('0x19')],{'host':_0xdda3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdda3('0x19')]));require(_0xdda3('0x1c'))[_0xdda3('0x1d')](socket);function respondWithStatusCode(_0x36b832,_0x519eee){_0x519eee=_0x519eee||0xcc;return function(_0x5932c9){if(_0x5932c9){return _0x36b832[_0xdda3('0x1e')](_0x519eee);}return _0x36b832[_0xdda3('0x1f')](_0x519eee)[_0xdda3('0x20')]();};}function respondWithResult(_0x196dbf,_0x4ce646){_0x4ce646=_0x4ce646||0xc8;return function(_0x5d2000){if(_0x5d2000){return _0x196dbf[_0xdda3('0x1f')](_0x4ce646)['json'](_0x5d2000);}};}function respondWithFilteredResult(_0x53d576,_0x55ba24){return function(_0x48ee07){if(_0x48ee07){var _0xde3565=typeof _0x55ba24[_0xdda3('0x21')]===_0xdda3('0x22')&&typeof _0x55ba24[_0xdda3('0x23')]===_0xdda3('0x22');var _0x4d5000=_0x48ee07[_0xdda3('0x24')];var _0x1eab3a=_0xde3565?0x0:_0x55ba24[_0xdda3('0x21')];var _0xa6d4cd=_0xde3565?_0x48ee07[_0xdda3('0x24')]:_0x55ba24['offset']+_0x55ba24[_0xdda3('0x23')];var _0x2fe071;if(_0xa6d4cd>=_0x4d5000){_0xa6d4cd=_0x4d5000;_0x2fe071=0xc8;}else{_0x2fe071=0xce;}_0x53d576[_0xdda3('0x1f')](_0x2fe071);return _0x53d576[_0xdda3('0x25')](_0xdda3('0x26'),_0x1eab3a+'-'+_0xa6d4cd+'/'+_0x4d5000)['json'](_0x48ee07);}return null;};}function patchUpdates(_0x2bd683){return function(_0x491f99){try{jsonpatch['apply'](_0x491f99,_0x2bd683,!![]);}catch(_0x570c1a){return BPromise[_0xdda3('0x27')](_0x570c1a);}return _0x491f99[_0xdda3('0x28')]();};}function saveUpdates(_0x5a9b27,_0x4efe1c){return function(_0x17674b){if(_0x17674b){return _0x17674b[_0xdda3('0x29')](_0x5a9b27)['then'](function(_0x4a79b7){return _0x4a79b7;});}return null;};}function removeEntity(_0x24080a,_0x1ffb08){return function(_0x35a11e){if(_0x35a11e){return _0x35a11e[_0xdda3('0x2a')]()['then'](function(){_0x24080a[_0xdda3('0x1f')](0xcc)[_0xdda3('0x20')]();});}};}function handleEntityNotFound(_0x1cfe6a,_0x18059d){return function(_0x4ab970){if(!_0x4ab970){_0x1cfe6a['sendStatus'](0x194);}return _0x4ab970;};}function handleError(_0x3579d7,_0x193910){_0x193910=_0x193910||0x1f4;return function(_0x155d0e){logger[_0xdda3('0x2b')](_0x155d0e[_0xdda3('0x2c')]);if(_0x155d0e['name']){delete _0x155d0e[_0xdda3('0x2d')];}_0x3579d7[_0xdda3('0x1f')](_0x193910)['send'](_0x155d0e);};}exports[_0xdda3('0x2e')]=function(_0x17ae91,_0x5d3c8b){var _0x1ececc={},_0x3bcd43={},_0x7b7c25={'count':0x0,'rows':[]};var _0x5614d5=_[_0xdda3('0x2f')](db['ChatInternalMessage'][_0xdda3('0x30')],function(_0x543e8b){return{'name':_0x543e8b['fieldName'],'type':_0x543e8b[_0xdda3('0x31')]['key']};});_0x3bcd43['model']=_['map'](_0x5614d5,_0xdda3('0x2d'));_0x3bcd43[_0xdda3('0x32')]=_[_0xdda3('0x33')](_0x17ae91[_0xdda3('0x32')]);_0x3bcd43[_0xdda3('0x34')]=_[_0xdda3('0x35')](_0x3bcd43[_0xdda3('0x36')],_0x3bcd43[_0xdda3('0x32')]);_0x1ececc[_0xdda3('0x37')]=_[_0xdda3('0x35')](_0x3bcd43[_0xdda3('0x36')],qs[_0xdda3('0x38')](_0x17ae91['query'][_0xdda3('0x38')]));_0x1ececc[_0xdda3('0x37')]=_0x1ececc[_0xdda3('0x37')][_0xdda3('0x39')]?_0x1ececc['attributes']:_0x3bcd43[_0xdda3('0x36')];if(!_0x17ae91[_0xdda3('0x32')][_0xdda3('0x3a')](_0xdda3('0x3b'))){_0x1ececc[_0xdda3('0x23')]=qs['limit'](_0x17ae91[_0xdda3('0x32')][_0xdda3('0x23')]);_0x1ececc['offset']=qs[_0xdda3('0x21')](_0x17ae91[_0xdda3('0x32')]['offset']);}_0x1ececc[_0xdda3('0x3c')]=qs[_0xdda3('0x3d')](_0x17ae91[_0xdda3('0x32')][_0xdda3('0x3d')]);_0x1ececc[_0xdda3('0x3e')]=qs[_0xdda3('0x34')](_[_0xdda3('0x3f')](_0x17ae91['query'],_0x3bcd43[_0xdda3('0x34')]),_0x5614d5);if(_0x17ae91[_0xdda3('0x32')][_0xdda3('0x40')]){_0x1ececc['where']=_[_0xdda3('0x41')](_0x1ececc['where'],{'$or':_['map'](_0x5614d5,function(_0x2c67fd){if(_0x2c67fd['type']!=='VIRTUAL'){var _0x5d9208={};_0x5d9208[_0x2c67fd[_0xdda3('0x2d')]]={'$like':'%'+_0x17ae91[_0xdda3('0x32')]['filter']+'%'};return _0x5d9208;}})});}_0x1ececc=_['merge']({},_0x1ececc,_0x17ae91[_0xdda3('0x42')]);var _0xa16993={'where':_0x1ececc[_0xdda3('0x3e')]};return db[_0xdda3('0x43')][_0xdda3('0x24')](_0xa16993)[_0xdda3('0x44')](function(_0x3f93a5){_0x7b7c25[_0xdda3('0x24')]=_0x3f93a5;if(_0x17ae91[_0xdda3('0x32')]['includeAll']){_0x1ececc[_0xdda3('0x45')]=[{'all':!![]}];}return db[_0xdda3('0x43')][_0xdda3('0x46')](_0x1ececc);})['then'](function(_0x23d3ef){_0x7b7c25[_0xdda3('0x47')]=_0x23d3ef;return _0x7b7c25;})['then'](respondWithFilteredResult(_0x5d3c8b,_0x1ececc))['catch'](handleError(_0x5d3c8b,null));};exports[_0xdda3('0x48')]=function(_0x51f6d3,_0x483b85){var _0x357f9b={'raw':!![],'where':{'id':_0x51f6d3['params']['id']}},_0x16b601={};_0x16b601[_0xdda3('0x36')]=_['keys'](db['ChatInternalMessage'][_0xdda3('0x30')]);_0x16b601['query']=_[_0xdda3('0x33')](_0x51f6d3['query']);_0x16b601[_0xdda3('0x34')]=_[_0xdda3('0x35')](_0x16b601[_0xdda3('0x36')],_0x16b601[_0xdda3('0x32')]);_0x357f9b[_0xdda3('0x37')]=_[_0xdda3('0x35')](_0x16b601['model'],qs[_0xdda3('0x38')](_0x51f6d3[_0xdda3('0x32')]['fields']));_0x357f9b[_0xdda3('0x37')]=_0x357f9b[_0xdda3('0x37')][_0xdda3('0x39')]?_0x357f9b[_0xdda3('0x37')]:_0x16b601[_0xdda3('0x36')];if(_0x51f6d3[_0xdda3('0x32')][_0xdda3('0x49')]){_0x357f9b[_0xdda3('0x45')]=[{'all':!![]}];}_0x357f9b=_[_0xdda3('0x41')]({},_0x357f9b,_0x51f6d3['options']);return db[_0xdda3('0x43')][_0xdda3('0x4a')](_0x357f9b)[_0xdda3('0x44')](handleEntityNotFound(_0x483b85,null))[_0xdda3('0x44')](respondWithResult(_0x483b85,null))[_0xdda3('0x4b')](handleError(_0x483b85,null));};exports['create']=function(_0x467292,_0x345d2b){return db[_0xdda3('0x43')][_0xdda3('0x4c')](_0x467292[_0xdda3('0x4d')],{})[_0xdda3('0x44')](respondWithResult(_0x345d2b,0xc9))['catch'](handleError(_0x345d2b,null));};exports['update']=function(_0x3f3c2b,_0x2ce132){if(_0x3f3c2b[_0xdda3('0x4d')]['id']){delete _0x3f3c2b[_0xdda3('0x4d')]['id'];}return db[_0xdda3('0x43')][_0xdda3('0x4a')]({'where':{'id':_0x3f3c2b[_0xdda3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2ce132,null))['then'](saveUpdates(_0x3f3c2b[_0xdda3('0x4d')],null))[_0xdda3('0x44')](respondWithResult(_0x2ce132,null))[_0xdda3('0x4b')](handleError(_0x2ce132,null));};exports['destroy']=function(_0x4f4c79,_0x511489){return db['ChatInternalMessage'][_0xdda3('0x4a')]({'where':{'id':_0x4f4c79[_0xdda3('0x4e')]['id']}})[_0xdda3('0x44')](handleEntityNotFound(_0x511489,null))[_0xdda3('0x44')](removeEntity(_0x511489,null))[_0xdda3('0x4b')](handleError(_0x511489,null));};exports['describe']=function(_0x2f60a9,_0x41481){return db[_0xdda3('0x43')]['describe']()[_0xdda3('0x44')](respondWithResult(_0x41481,null))['catch'](handleError(_0x41481,null));};function wrapUser(_0x2df9fa){return function(_0x1819f8){var _0x2f7ddd=_0x2df9fa['get']({'plain':!![]});_0x2f7ddd['messages']=[];if(_0x1819f8){_0x2f7ddd['lastMessageAt']=_0x1819f8[_0xdda3('0x4f')];_0x2f7ddd[_0xdda3('0x50')]=_0x1819f8;}else{_0x2f7ddd['lastMessageAt']=moment(0x0)[_0xdda3('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f7ddd[_0xdda3('0x50')]={};}return _0x2f7ddd;};}exports[_0xdda3('0x52')]=function(_0x1d3be5,_0x44e8a4,_0x48b3d5){var _0x567f21=[];return db[_0xdda3('0x53')]['findAll']({'where':{'role':[_0xdda3('0x54'),_0xdda3('0x55'),_0xdda3('0x56')]},'attributes':['id',_0xdda3('0x57'),_0xdda3('0x2d'),_0xdda3('0x58'),_0xdda3('0x59'),_0xdda3('0x5a'),_0xdda3('0x5b'),_0xdda3('0x5c'),_0xdda3('0x5d'),'showWebBar'],'order':qs[_0xdda3('0x3d')]('-online'),'include':[{'model':db[_0xdda3('0x5e')],'as':'VoiceQueues','attributes':['id','name',_0xdda3('0x31')],'through':{'attributes':[]}}]})[_0xdda3('0x44')](function(_0x499d34){if(_0x499d34){var _0x90616e=_0x1d3be5[_0xdda3('0x56')][_0xdda3('0x5f')]({'plain':!![]});if(!_0x90616e)throw new Error(_0xdda3('0x60'));if(_0x90616e[_0xdda3('0x58')]===_0xdda3('0x56')){return db[_0xdda3('0x61')][_0xdda3('0x4a')]({'where':{'name':_0xdda3('0x62'),'userProfileId':_0x90616e[_0xdda3('0x63')]},'raw':!![]})[_0xdda3('0x44')](function(_0x29d4d0){if(_0x29d4d0){if(_0x29d4d0[_0xdda3('0x64')]===0x0){return db[_0xdda3('0x65')]['findAll']({'where':{'sectionId':_0x29d4d0['id']},'raw':!![]})['then'](function(_0x3745dd){var _0x4819ad=[];if(_[_0xdda3('0x66')](_0x3745dd)){_0x4819ad=_['filter'](_0x499d34,function(_0x40f8f9){if(_0x40f8f9['role']!==_0xdda3('0x54')){return _0x40f8f9;}});return _0x4819ad;}else{for(var _0x409af4=0x0;_0x409af4<_0x499d34[_0xdda3('0x39')];_0x409af4++){var _0x4f037f=_0x499d34[_0x409af4];if(_0x4f037f[_0xdda3('0x58')]===_0xdda3('0x54')){var _0x4224ec=_[_0xdda3('0x4a')](_0x3745dd,function(_0x55898a){return _0x55898a[_0xdda3('0x67')]===_0x4f037f['id'];});if(_0x4224ec)_0x4819ad[_0xdda3('0x68')](_0x4f037f);}else{_0x4819ad[_0xdda3('0x68')](_0x4f037f);}}return _0x4819ad;}});}else{return _0x499d34;}}else{var _0x5bfed3=_[_0xdda3('0x40')](_0x499d34,function(_0x430735){if(_0x430735[_0xdda3('0x58')]!=='agent'){return _0x430735;}});return _0x5bfed3;}});}else{return _0x499d34;}}})['then'](function(_0x4758ae){var _0x27eb75=[];if(_0x4758ae){_0x567f21=_0x4758ae;for(var _0x2dc006=0x0;_0x2dc006<_0x4758ae[_0xdda3('0x39')];_0x2dc006+=0x1){_0x567f21[_0x2dc006][_0xdda3('0x69')]=[];_0x27eb75[_0xdda3('0x68')](db[_0xdda3('0x43')][_0xdda3('0x4a')]({'where':{'FromId':[_0x1d3be5['user']['id'],_0x4758ae[_0x2dc006]['id']],'ToId':[_0x1d3be5[_0xdda3('0x56')]['id'],_0x4758ae[_0x2dc006]['id']],'ChatGroupId':null},'attributes':['id',_0xdda3('0x4f'),_0xdda3('0x6a'),_0xdda3('0x6b'),_0xdda3('0x6c'),_0xdda3('0x4d')],'order':qs[_0xdda3('0x3d')](_0xdda3('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdda3('0x44')](wrapUser(_0x4758ae[_0x2dc006])));}return BPromise[_0xdda3('0x6e')](_0x27eb75);}return[];})[_0xdda3('0x44')](function(_0x428a82){return{'rows':_0x428a82,'count':_0x428a82['length']};})[_0xdda3('0x44')](respondWithResult(_0x44e8a4,null))[_0xdda3('0x4b')](handleError(_0x44e8a4,null));};
\ No newline at end of file
+var _0xa238=['find','catch','create','body','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','user','fullname','role','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','offset','limit','undefined','Content-Range','apply','update','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','then','rows','params'];(function(_0x5207a2,_0x316913){var _0x314716=function(_0x2ca663){while(--_0x2ca663){_0x5207a2['push'](_0x5207a2['shift']());}};_0x314716(++_0x316913);}(_0xa238,0x156));var _0x8a23=function(_0x1faa29,_0x4192ad){_0x1faa29=_0x1faa29-0x0;var _0x2b75ee=_0xa238[_0x1faa29];return _0x2b75ee;};'use strict';var emlformat=require(_0x8a23('0x0'));var rimraf=require(_0x8a23('0x1'));var zipdir=require(_0x8a23('0x2'));var jsonpatch=require(_0x8a23('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8a23('0x4'));var util=require(_0x8a23('0x5'));var path=require(_0x8a23('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8a23('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a23('0x8'));var squel=require(_0x8a23('0x9'));var crypto=require(_0x8a23('0xa'));var jsforce=require(_0x8a23('0xb'));var deskjs=require(_0x8a23('0xc'));var toCsv=require(_0x8a23('0xd'));var querystring=require(_0x8a23('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8a23('0xf'));var qs=require(_0x8a23('0x10'));var as=require(_0x8a23('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a23('0x12'))('api');var utils=require(_0x8a23('0x13'));var config=require(_0x8a23('0x14'));var licenseUtil=require(_0x8a23('0x15'));var db=require(_0x8a23('0x16'))['db'];config[_0x8a23('0x17')]=_[_0x8a23('0x18')](config[_0x8a23('0x17')],{'host':_0x8a23('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a23('0x17')]));require(_0x8a23('0x1a'))[_0x8a23('0x1b')](socket);function respondWithStatusCode(_0x86e4de,_0x39e8e0){_0x39e8e0=_0x39e8e0||0xcc;return function(_0x7e1100){if(_0x7e1100){return _0x86e4de[_0x8a23('0x1c')](_0x39e8e0);}return _0x86e4de['status'](_0x39e8e0)[_0x8a23('0x1d')]();};}function respondWithResult(_0x53e107,_0x20caf2){_0x20caf2=_0x20caf2||0xc8;return function(_0x3811f7){if(_0x3811f7){return _0x53e107[_0x8a23('0x1e')](_0x20caf2)['json'](_0x3811f7);}};}function respondWithFilteredResult(_0x516b6f,_0x3e9909){return function(_0x5d3d96){if(_0x5d3d96){var _0x3d1493=typeof _0x3e9909[_0x8a23('0x1f')]==='undefined'&&typeof _0x3e9909[_0x8a23('0x20')]===_0x8a23('0x21');var _0x5cab94=_0x5d3d96['count'];var _0x4d4f2f=_0x3d1493?0x0:_0x3e9909['offset'];var _0x54c155=_0x3d1493?_0x5d3d96['count']:_0x3e9909[_0x8a23('0x1f')]+_0x3e9909[_0x8a23('0x20')];var _0x12dd57;if(_0x54c155>=_0x5cab94){_0x54c155=_0x5cab94;_0x12dd57=0xc8;}else{_0x12dd57=0xce;}_0x516b6f['status'](_0x12dd57);return _0x516b6f['set'](_0x8a23('0x22'),_0x4d4f2f+'-'+_0x54c155+'/'+_0x5cab94)['json'](_0x5d3d96);}return null;};}function patchUpdates(_0x220f88){return function(_0x3b125d){try{jsonpatch[_0x8a23('0x23')](_0x3b125d,_0x220f88,!![]);}catch(_0x464d66){return BPromise['reject'](_0x464d66);}return _0x3b125d['save']();};}function saveUpdates(_0x200b81,_0x3d06a2){return function(_0x1df3ec){if(_0x1df3ec){return _0x1df3ec[_0x8a23('0x24')](_0x200b81)['then'](function(_0x4faf1c){return _0x4faf1c;});}return null;};}function removeEntity(_0x42c158,_0x2e2751){return function(_0x261f8c){if(_0x261f8c){return _0x261f8c['destroy']()['then'](function(){_0x42c158[_0x8a23('0x1e')](0xcc)[_0x8a23('0x1d')]();});}};}function handleEntityNotFound(_0x39fa38,_0x73fdf7){return function(_0x51488c){if(!_0x51488c){_0x39fa38[_0x8a23('0x1c')](0x194);}return _0x51488c;};}function handleError(_0x5181fd,_0x3a3950){_0x3a3950=_0x3a3950||0x1f4;return function(_0x599bb5){logger[_0x8a23('0x25')](_0x599bb5[_0x8a23('0x26')]);if(_0x599bb5[_0x8a23('0x27')]){delete _0x599bb5[_0x8a23('0x27')];}_0x5181fd[_0x8a23('0x1e')](_0x3a3950)[_0x8a23('0x28')](_0x599bb5);};}exports[_0x8a23('0x29')]=function(_0xd8e477,_0x1f43fc){var _0x342d57={},_0x55f867={},_0x186d27={'count':0x0,'rows':[]};var _0x1e154b=_[_0x8a23('0x2a')](db[_0x8a23('0x2b')][_0x8a23('0x2c')],function(_0x3120b8){return{'name':_0x3120b8['fieldName'],'type':_0x3120b8[_0x8a23('0x2d')]['key']};});_0x55f867['model']=_['map'](_0x1e154b,'name');_0x55f867[_0x8a23('0x2e')]=_[_0x8a23('0x2f')](_0xd8e477[_0x8a23('0x2e')]);_0x55f867['filters']=_[_0x8a23('0x30')](_0x55f867['model'],_0x55f867['query']);_0x342d57[_0x8a23('0x31')]=_['intersection'](_0x55f867[_0x8a23('0x32')],qs[_0x8a23('0x33')](_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x33')]));_0x342d57[_0x8a23('0x31')]=_0x342d57[_0x8a23('0x31')][_0x8a23('0x34')]?_0x342d57[_0x8a23('0x31')]:_0x55f867[_0x8a23('0x32')];if(!_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x35')]('nolimit')){_0x342d57[_0x8a23('0x20')]=qs['limit'](_0xd8e477[_0x8a23('0x2e')]['limit']);_0x342d57[_0x8a23('0x1f')]=qs[_0x8a23('0x1f')](_0xd8e477[_0x8a23('0x2e')]['offset']);}_0x342d57[_0x8a23('0x36')]=qs[_0x8a23('0x37')](_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x37')]);_0x342d57[_0x8a23('0x38')]=qs[_0x8a23('0x39')](_[_0x8a23('0x3a')](_0xd8e477[_0x8a23('0x2e')],_0x55f867[_0x8a23('0x39')]),_0x1e154b);if(_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x3b')]){_0x342d57[_0x8a23('0x38')]=_[_0x8a23('0x3c')](_0x342d57[_0x8a23('0x38')],{'$or':_[_0x8a23('0x2a')](_0x1e154b,function(_0x2a6448){if(_0x2a6448[_0x8a23('0x2d')]!==_0x8a23('0x3d')){var _0x3e33d8={};_0x3e33d8[_0x2a6448[_0x8a23('0x27')]]={'$like':'%'+_0xd8e477[_0x8a23('0x2e')]['filter']+'%'};return _0x3e33d8;}})});}_0x342d57=_['merge']({},_0x342d57,_0xd8e477[_0x8a23('0x3e')]);var _0x2e9366={'where':_0x342d57['where']};return db[_0x8a23('0x2b')][_0x8a23('0x3f')](_0x2e9366)['then'](function(_0x1b0148){_0x186d27[_0x8a23('0x3f')]=_0x1b0148;if(_0xd8e477[_0x8a23('0x2e')][_0x8a23('0x40')]){_0x342d57[_0x8a23('0x41')]=[{'all':!![]}];}return db[_0x8a23('0x2b')][_0x8a23('0x42')](_0x342d57);})[_0x8a23('0x43')](function(_0x586d8e){_0x186d27[_0x8a23('0x44')]=_0x586d8e;return _0x186d27;})[_0x8a23('0x43')](respondWithFilteredResult(_0x1f43fc,_0x342d57))['catch'](handleError(_0x1f43fc,null));};exports['show']=function(_0x58441d,_0x591dfe){var _0x581989={'raw':!![],'where':{'id':_0x58441d[_0x8a23('0x45')]['id']}},_0x3279a7={};_0x3279a7[_0x8a23('0x32')]=_['keys'](db[_0x8a23('0x2b')]['rawAttributes']);_0x3279a7[_0x8a23('0x2e')]=_['keys'](_0x58441d[_0x8a23('0x2e')]);_0x3279a7['filters']=_[_0x8a23('0x30')](_0x3279a7[_0x8a23('0x32')],_0x3279a7[_0x8a23('0x2e')]);_0x581989[_0x8a23('0x31')]=_[_0x8a23('0x30')](_0x3279a7[_0x8a23('0x32')],qs[_0x8a23('0x33')](_0x58441d[_0x8a23('0x2e')][_0x8a23('0x33')]));_0x581989[_0x8a23('0x31')]=_0x581989['attributes'][_0x8a23('0x34')]?_0x581989[_0x8a23('0x31')]:_0x3279a7[_0x8a23('0x32')];if(_0x58441d[_0x8a23('0x2e')][_0x8a23('0x40')]){_0x581989[_0x8a23('0x41')]=[{'all':!![]}];}_0x581989=_[_0x8a23('0x3c')]({},_0x581989,_0x58441d['options']);return db['ChatInternalMessage'][_0x8a23('0x46')](_0x581989)[_0x8a23('0x43')](handleEntityNotFound(_0x591dfe,null))[_0x8a23('0x43')](respondWithResult(_0x591dfe,null))[_0x8a23('0x47')](handleError(_0x591dfe,null));};exports[_0x8a23('0x48')]=function(_0x55f2c2,_0x2f3bea){return db[_0x8a23('0x2b')][_0x8a23('0x48')](_0x55f2c2[_0x8a23('0x49')],{})['then'](respondWithResult(_0x2f3bea,0xc9))[_0x8a23('0x47')](handleError(_0x2f3bea,null));};exports[_0x8a23('0x24')]=function(_0xdba9f1,_0x18fdb0){if(_0xdba9f1[_0x8a23('0x49')]['id']){delete _0xdba9f1['body']['id'];}return db['ChatInternalMessage'][_0x8a23('0x46')]({'where':{'id':_0xdba9f1[_0x8a23('0x45')]['id']}})[_0x8a23('0x43')](handleEntityNotFound(_0x18fdb0,null))[_0x8a23('0x43')](saveUpdates(_0xdba9f1[_0x8a23('0x49')],null))[_0x8a23('0x43')](respondWithResult(_0x18fdb0,null))[_0x8a23('0x47')](handleError(_0x18fdb0,null));};exports['destroy']=function(_0x4ca922,_0x520b99){return db[_0x8a23('0x2b')]['find']({'where':{'id':_0x4ca922[_0x8a23('0x45')]['id']}})['then'](handleEntityNotFound(_0x520b99,null))['then'](removeEntity(_0x520b99,null))[_0x8a23('0x47')](handleError(_0x520b99,null));};exports[_0x8a23('0x4a')]=function(_0x3b4176,_0x104268){return db[_0x8a23('0x2b')][_0x8a23('0x4a')]()[_0x8a23('0x43')](respondWithResult(_0x104268,null))[_0x8a23('0x47')](handleError(_0x104268,null));};function wrapUser(_0x500925){return function(_0x1aa15c){var _0x233427=_0x500925[_0x8a23('0x4b')]({'plain':!![]});_0x233427['messages']=[];if(_0x1aa15c){_0x233427[_0x8a23('0x4c')]=_0x1aa15c[_0x8a23('0x4d')];_0x233427['lastMessage']=_0x1aa15c;}else{_0x233427[_0x8a23('0x4c')]=moment(0x0)[_0x8a23('0x4e')](_0x8a23('0x4f'));_0x233427[_0x8a23('0x50')]={};}return _0x233427;};}exports['getUsers']=function(_0x40295f,_0x2de5ba,_0x504a44){var _0x4a9402=[];return db[_0x8a23('0x51')]['findAll']({'where':{'role':['agent','admin',_0x8a23('0x52')]},'attributes':['id',_0x8a23('0x53'),_0x8a23('0x27'),_0x8a23('0x54'),'userpic',_0x8a23('0x55'),_0x8a23('0x56'),_0x8a23('0x57'),'allowmessenger',_0x8a23('0x58')],'order':qs['sort'](_0x8a23('0x59')),'include':[{'model':db[_0x8a23('0x5a')],'as':'VoiceQueues','attributes':['id',_0x8a23('0x27'),'type'],'through':{'attributes':[]}}]})['then'](function(_0xafb015){if(_0xafb015){var _0x30766a=_0x40295f[_0x8a23('0x52')]['get']({'plain':!![]});if(!_0x30766a)throw new Error(_0x8a23('0x5b'));if(_0x30766a[_0x8a23('0x54')]===_0x8a23('0x52')){return db[_0x8a23('0x5c')][_0x8a23('0x46')]({'where':{'name':'Agents','userProfileId':_0x30766a[_0x8a23('0x5d')]},'raw':!![]})[_0x8a23('0x43')](function(_0x25536c){if(_0x25536c){if(_0x25536c[_0x8a23('0x5e')]===0x0){return db[_0x8a23('0x5f')][_0x8a23('0x42')]({'where':{'sectionId':_0x25536c['id']},'raw':!![]})['then'](function(_0x163300){var _0x3dd53d=[];if(_[_0x8a23('0x60')](_0x163300)){_0x3dd53d=_[_0x8a23('0x3b')](_0xafb015,function(_0x147889){if(_0x147889[_0x8a23('0x54')]!==_0x8a23('0x61')){return _0x147889;}});return _0x3dd53d;}else{for(var _0x346a0a=0x0;_0x346a0a<_0xafb015[_0x8a23('0x34')];_0x346a0a++){var _0x13053a=_0xafb015[_0x346a0a];if(_0x13053a['role']===_0x8a23('0x61')){var _0x4bd905=_[_0x8a23('0x46')](_0x163300,function(_0x36413a){return _0x36413a['resourceId']===_0x13053a['id'];});if(_0x4bd905)_0x3dd53d[_0x8a23('0x62')](_0x13053a);}else{_0x3dd53d[_0x8a23('0x62')](_0x13053a);}}return _0x3dd53d;}});}else{return _0xafb015;}}else{var _0x27bf32=_['filter'](_0xafb015,function(_0x5402f5){if(_0x5402f5[_0x8a23('0x54')]!==_0x8a23('0x61')){return _0x5402f5;}});return _0x27bf32;}});}else{return _0xafb015;}}})[_0x8a23('0x43')](function(_0x23b249){var _0x5e152f=[];if(_0x23b249){_0x4a9402=_0x23b249;for(var _0x419ee7=0x0;_0x419ee7<_0x23b249['length'];_0x419ee7+=0x1){_0x4a9402[_0x419ee7]['messages']=[];_0x5e152f['push'](db[_0x8a23('0x2b')][_0x8a23('0x46')]({'where':{'FromId':[_0x40295f[_0x8a23('0x52')]['id'],_0x23b249[_0x419ee7]['id']],'ToId':[_0x40295f[_0x8a23('0x52')]['id'],_0x23b249[_0x419ee7]['id']],'ChatGroupId':null},'attributes':['id',_0x8a23('0x4d'),_0x8a23('0x63'),_0x8a23('0x64'),_0x8a23('0x65'),_0x8a23('0x49')],'order':qs[_0x8a23('0x37')](_0x8a23('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8a23('0x43')](wrapUser(_0x23b249[_0x419ee7])));}return BPromise['all'](_0x5e152f);}return[];})[_0x8a23('0x43')](function(_0x53b162){return{'rows':_0x53b162,'count':_0x53b162[_0x8a23('0x34')]};})[_0x8a23('0x43')](respondWithResult(_0x2de5ba,null))[_0x8a23('0x47')](handleError(_0x2de5ba,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 129e823..52a8237 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 _0x96ab=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x96ab,0x146));var _0xb96a=function(_0x556fcf,_0xf09f41){_0x556fcf=_0x556fcf-0x0;var _0x5d8ace=_0x96ab[_0x556fcf];return _0x5d8ace;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xb96a('0x0'))['db'][_0xb96a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb96a('0x2')](0x0);var events={'afterCreate':_0xb96a('0x3'),'afterUpdate':_0xb96a('0x4'),'afterDestroy':_0xb96a('0x5')};function emitEvent(_0x13809c){return function(_0x52e7be,_0x360ef4,_0xbe5590){ChatInternalMessageEvents[_0xb96a('0x6')](_0x13809c+':'+_0x52e7be['id'],_0x52e7be);ChatInternalMessageEvents[_0xb96a('0x6')](_0x13809c,_0x52e7be);_0xbe5590(null);};}for(var e in events){if(events[_0xb96a('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb96a('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xda3c=['exports','events','../../mysqldb','ChatInternalMessage','save','emit'];(function(_0x512b27,_0x55c73b){var _0x2ad648=function(_0xe0b23b){while(--_0xe0b23b){_0x512b27['push'](_0x512b27['shift']());}};_0x2ad648(++_0x55c73b);}(_0xda3c,0x163));var _0xcda3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xda3c[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xcda3('0x0'));var ChatInternalMessage=require(_0xcda3('0x1'))['db'][_0xcda3('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcda3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x6138c7){return function(_0x160679,_0x667e22,_0x158d25){ChatInternalMessageEvents[_0xcda3('0x4')](_0x6138c7+':'+_0x160679['id'],_0x160679);ChatInternalMessageEvents['emit'](_0x6138c7,_0x160679);_0x158d25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xcda3('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 22c7527..e69017e 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 _0x2a7d=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1a8b07,_0x492d7c){var _0x13813e=function(_0x18a2dd){while(--_0x18a2dd){_0x1a8b07['push'](_0x1a8b07['shift']());}};_0x13813e(++_0x492d7c);}(_0x2a7d,0x121));var _0xd2a7=function(_0x3af7ef,_0x5444ec){_0x3af7ef=_0x3af7ef-0x0;var _0x5cffcc=_0x2a7d[_0x3af7ef];return _0x5cffcc;};'use strict';var _=require('lodash');var util=require(_0xd2a7('0x0'));var logger=require(_0xd2a7('0x1'))(_0xd2a7('0x2'));var moment=require('moment');var BPromise=require(_0xd2a7('0x3'));var rp=require(_0xd2a7('0x4'));var fs=require('fs');var path=require(_0xd2a7('0x5'));var rimraf=require(_0xd2a7('0x6'));var config=require(_0xd2a7('0x7'));var attributes=require(_0xd2a7('0x8'));module['exports']=function(_0x4f3746,_0xe540dc){return _0x4f3746[_0xd2a7('0x9')](_0xd2a7('0xa'),attributes,{'tableName':_0xd2a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd2a7('0xc'),'collate':_0xd2a7('0xd')});};
\ No newline at end of file
+var _0xe2a0=['utf8mb4','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','chat_internal_messages'];(function(_0x90c1e4,_0xbe318d){var _0x4ea509=function(_0x57a680){while(--_0x57a680){_0x90c1e4['push'](_0x90c1e4['shift']());}};_0x4ea509(++_0xbe318d);}(_0xe2a0,0x1c3));var _0x0e2a=function(_0x1c324d,_0x2daa7c){_0x1c324d=_0x1c324d-0x0;var _0x33347f=_0xe2a0[_0x1c324d];return _0x33347f;};'use strict';var _=require(_0x0e2a('0x0'));var util=require('util');var logger=require(_0x0e2a('0x1'))(_0x0e2a('0x2'));var moment=require(_0x0e2a('0x3'));var BPromise=require(_0x0e2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e2a('0x5'));var config=require(_0x0e2a('0x6'));var attributes=require(_0x0e2a('0x7'));module['exports']=function(_0xd3e39,_0x2906b5){return _0xd3e39['define']('ChatInternalMessage',attributes,{'tableName':_0x0e2a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0e2a('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 74dbbf0..3162c86 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 _0xb66b=['info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x55bdd7,_0x3ddd0a){var _0xb5101=function(_0x476d59){while(--_0x476d59){_0x55bdd7['push'](_0x55bdd7['shift']());}};_0xb5101(++_0x3ddd0a);}(_0xb66b,0x1a7));var _0xbb66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb66b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbb66('0x0'));var util=require('util');var moment=require(_0xbb66('0x1'));var BPromise=require(_0xbb66('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb66('0x3'));var db=require(_0xbb66('0x4'))['db'];var utils=require(_0xbb66('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xbb66('0x6'));var jayson=require(_0xbb66('0x7'));var client=jayson[_0xbb66('0x8')][_0xbb66('0x9')]({'port':0x232a});config['redis']=_[_0xbb66('0xa')](config[_0xbb66('0xb')],{'host':_0xbb66('0xc'),'port':0x18eb});var socket=require(_0xbb66('0xd'))(new Redis(config[_0xbb66('0xb')]));require(_0xbb66('0xe'))[_0xbb66('0xf')](socket);function respondWithRpcPromise(_0x5e6861,_0x4558a6,_0x2dfef8){return new BPromise(function(_0x139565,_0x525432){return client[_0xbb66('0x10')](_0x5e6861,_0x2dfef8)['then'](function(_0x3040d8){logger['info'](_0xbb66('0x11'),_0x4558a6,_0xbb66('0x12'));logger[_0xbb66('0x13')](_0xbb66('0x14'),_0x4558a6,_0xbb66('0x12'),JSON[_0xbb66('0x15')](_0x3040d8));if(_0x3040d8[_0xbb66('0x16')]){if(_0x3040d8['error'][_0xbb66('0x17')]===0x1f4){logger[_0xbb66('0x16')](_0xbb66('0x11'),_0x4558a6,_0x3040d8[_0xbb66('0x16')][_0xbb66('0x18')]);return _0x525432(_0x3040d8[_0xbb66('0x16')][_0xbb66('0x18')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4558a6,_0x3040d8['error'][_0xbb66('0x18')]);return _0x139565(_0x3040d8[_0xbb66('0x16')]['message']);}else{logger[_0xbb66('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x4558a6,'request\x20sent');_0x139565(_0x3040d8[_0xbb66('0x1a')]['message']);}})[_0xbb66('0x1b')](function(_0x7838e5){logger[_0xbb66('0x16')](_0xbb66('0x11'),_0x4558a6,_0x7838e5);_0x525432(_0x7838e5);});});}
\ No newline at end of file
+var _0xd22b=['ChatInternalMessage,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../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','request\x20sent','stringify','error','code','message'];(function(_0x18fe46,_0x47a2b0){var _0x27c44d=function(_0x1b9e59){while(--_0x1b9e59){_0x18fe46['push'](_0x18fe46['shift']());}};_0x27c44d(++_0x47a2b0);}(_0xd22b,0x11b));var _0xbd22=function(_0x6d0d1e,_0x5f584b){_0x6d0d1e=_0x6d0d1e-0x0;var _0x285729=_0xd22b[_0x6d0d1e];return _0x285729;};'use strict';var _=require(_0xbd22('0x0'));var util=require(_0xbd22('0x1'));var moment=require(_0xbd22('0x2'));var BPromise=require(_0xbd22('0x3'));var rs=require(_0xbd22('0x4'));var fs=require('fs');var Redis=require(_0xbd22('0x5'));var db=require(_0xbd22('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd22('0x7'))('rpc');var config=require(_0xbd22('0x8'));var jayson=require(_0xbd22('0x9'));var client=jayson[_0xbd22('0xa')][_0xbd22('0xb')]({'port':0x232a});config[_0xbd22('0xc')]=_[_0xbd22('0xd')](config[_0xbd22('0xc')],{'host':_0xbd22('0xe'),'port':0x18eb});var socket=require(_0xbd22('0xf'))(new Redis(config[_0xbd22('0xc')]));require(_0xbd22('0x10'))[_0xbd22('0x11')](socket);function respondWithRpcPromise(_0x3f8c09,_0x351d96,_0xd99fc4){return new BPromise(function(_0x1a4973,_0x192b81){return client[_0xbd22('0x12')](_0x3f8c09,_0xd99fc4)[_0xbd22('0x13')](function(_0x415cd8){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x351d96,'request\x20sent');logger[_0xbd22('0x14')](_0xbd22('0x15'),_0x351d96,_0xbd22('0x16'),JSON[_0xbd22('0x17')](_0x415cd8));if(_0x415cd8[_0xbd22('0x18')]){if(_0x415cd8[_0xbd22('0x18')][_0xbd22('0x19')]===0x1f4){logger[_0xbd22('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x351d96,_0x415cd8[_0xbd22('0x18')][_0xbd22('0x1a')]);return _0x192b81(_0x415cd8[_0xbd22('0x18')][_0xbd22('0x1a')]);}logger[_0xbd22('0x18')](_0xbd22('0x1b'),_0x351d96,_0x415cd8[_0xbd22('0x18')][_0xbd22('0x1a')]);return _0x1a4973(_0x415cd8['error'][_0xbd22('0x1a')]);}else{logger[_0xbd22('0x1c')](_0xbd22('0x1b'),_0x351d96,_0xbd22('0x16'));_0x1a4973(_0x415cd8[_0xbd22('0x1d')][_0xbd22('0x1a')]);}})[_0xbd22('0x1e')](function(_0x319f13){logger['error'](_0xbd22('0x1b'),_0x351d96,_0x319f13);_0x192b81(_0x319f13);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4e947ea..1757402 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 _0x8e2e=['./chatInternalMessage.events','update','removeListener','register','length','chatInternalMessage:'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0x8e2e,0xb4));var _0xe8e2=function(_0x321d5e,_0x1ae4a9){_0x321d5e=_0x321d5e-0x0;var _0x3458cd=_0x8e2e[_0x321d5e];return _0x3458cd;};'use strict';var ChatInternalMessageEvents=require(_0xe8e2('0x0'));var events=['save','remove',_0xe8e2('0x1')];function createListener(_0x5c566e,_0x10e9eb){return function(_0x8d944a){_0x10e9eb['emit'](_0x5c566e,_0x8d944a);};}function removeListener(_0x2ee229,_0x500757){return function(){ChatInternalMessageEvents[_0xe8e2('0x2')](_0x2ee229,_0x500757);};}exports[_0xe8e2('0x3')]=function(_0x472d7e){for(var _0x246c64=0x0,_0x11634e=events[_0xe8e2('0x4')];_0x246c64<_0x11634e;_0x246c64++){var _0x4ce58e=events[_0x246c64];var _0x4efbda=createListener(_0xe8e2('0x5')+_0x4ce58e,_0x472d7e);ChatInternalMessageEvents['on'](_0x4ce58e,_0x4efbda);}};
\ No newline at end of file
+var _0xda1a=['./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0xda1a,0x1b9));var _0xada1=function(_0x16b852,_0x174214){_0x16b852=_0x16b852-0x0;var _0xc6653a=_0xda1a[_0x16b852];return _0xc6653a;};'use strict';var ChatInternalMessageEvents=require(_0xada1('0x0'));var events=[_0xada1('0x1'),_0xada1('0x2'),_0xada1('0x3')];function createListener(_0x50e141,_0x6f6285){return function(_0x41800d){_0x6f6285[_0xada1('0x4')](_0x50e141,_0x41800d);};}function removeListener(_0x430942,_0x3589dd){return function(){ChatInternalMessageEvents[_0xada1('0x5')](_0x430942,_0x3589dd);};}exports[_0xada1('0x6')]=function(_0x5c2e3b){for(var _0x56f11c=0x0,_0x1a93c5=events[_0xada1('0x7')];_0x56f11c<_0x1a93c5;_0x56f11c++){var _0x105c66=events[_0x56f11c];var _0x330bb8=createListener(_0xada1('0x8')+_0x105c66,_0x5c2e3b);ChatInternalMessageEvents['on'](_0x105c66,_0x330bb8);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 01ceb03..ea161f6 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 _0x1ca6=['/:id','show','post','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x5620aa,_0x417f7e){var _0xf0f3ad=function(_0x141e30){while(--_0x141e30){_0x5620aa['push'](_0x5620aa['shift']());}};_0xf0f3ad(++_0x417f7e);}(_0x1ca6,0x97));var _0x61ca=function(_0x1c8412,_0x15456e){_0x1c8412=_0x1c8412-0x0;var _0xf0f5f1=_0x1ca6[_0x1c8412];return _0xf0f5f1;};'use strict';var multer=require(_0x61ca('0x0'));var util=require(_0x61ca('0x1'));var path=require(_0x61ca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x61ca('0x3')]();var fs_extra=require(_0x61ca('0x4'));var auth=require(_0x61ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x61ca('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x61ca('0x7')]('/',auth[_0x61ca('0x8')](),controller['index']);router[_0x61ca('0x7')](_0x61ca('0x9'),auth[_0x61ca('0x8')](),controller[_0x61ca('0xa')]);router[_0x61ca('0x7')]('/users',auth[_0x61ca('0x8')](),controller['getUsers']);router[_0x61ca('0x7')](_0x61ca('0xb'),auth[_0x61ca('0x8')](),controller[_0x61ca('0xc')]);router[_0x61ca('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x61ca('0xe')]('/:id',controller[_0x61ca('0xf')]);router[_0x61ca('0x10')]('/:id',auth[_0x61ca('0x8')](),controller['destroy']);module[_0x61ca('0x11')]=router;
\ No newline at end of file
+var _0x5cac=['getUsers','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/users'];(function(_0x2f1e82,_0x50bf3a){var _0x4bc038=function(_0x436dbb){while(--_0x436dbb){_0x2f1e82['push'](_0x2f1e82['shift']());}};_0x4bc038(++_0x50bf3a);}(_0x5cac,0x182));var _0xc5ca=function(_0x3b558e,_0x6d6aeb){_0x3b558e=_0x3b558e-0x0;var _0x178be9=_0x5cac[_0x3b558e];return _0x178be9;};'use strict';var multer=require(_0xc5ca('0x0'));var util=require(_0xc5ca('0x1'));var path=require(_0xc5ca('0x2'));var timeout=require(_0xc5ca('0x3'));var express=require('express');var router=express[_0xc5ca('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc5ca('0x5'));var interaction=require(_0xc5ca('0x6'));var config=require(_0xc5ca('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0xc5ca('0x8')](),controller[_0xc5ca('0x9')]);router['get'](_0xc5ca('0xa'),auth['isAuthenticated'](),controller[_0xc5ca('0xb')]);router[_0xc5ca('0xc')](_0xc5ca('0xd'),auth[_0xc5ca('0x8')](),controller[_0xc5ca('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc5ca('0xf')](_0xc5ca('0x10'),controller['update']);router[_0xc5ca('0x11')]('/:id',auth[_0xc5ca('0x8')](),controller[_0xc5ca('0x12')]);module[_0xc5ca('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 0383eb9..9e2ea58 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 _0x8a5c=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x1adff8,_0x283cc1){var _0x3483d8=function(_0x56b79d){while(--_0x56b79d){_0x1adff8['push'](_0x1adff8['shift']());}};_0x3483d8(++_0x283cc1);}(_0x8a5c,0x136));var _0xc8a5=function(_0x417485,_0x431bb3){_0x417485=_0x417485-0x0;var _0x2ef6fd=_0x8a5c[_0x417485];return _0x2ef6fd;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'body':{'type':Sequelize[_0xc8a5('0x2')](_0xc8a5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc8a5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc8a5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc8a5('0x5')]('in',_0xc8a5('0x6')),'defaultValue':_0xc8a5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xc8a5('0x7')]},'providerResponse':{'type':Sequelize[_0xc8a5('0x2')]}};
\ No newline at end of file
+var _0x0b0e=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0x0b0e[_0x4de1b1];return _0x639f27;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0b0('0x3')]('in',_0xe0b0('0x4')),'defaultValue':_0xe0b0('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe0b0('0x5')]},'providerName':{'type':Sequelize[_0xe0b0('0x6')]},'providerResponse':{'type':Sequelize[_0xe0b0('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index f59fe8c..ba08c9c 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 _0x3971=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','describe','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','internal','reject','rejectmessage','formData','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x45f2ed,_0x1b9102){var _0x121587=function(_0x3d274c){while(--_0x3d274c){_0x45f2ed['push'](_0x45f2ed['shift']());}};_0x121587(++_0x1b9102);}(_0x3971,0x146));var _0x1397=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x3971[_0x4358f5];return _0x4d8104;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1397('0x0'));var zipdir=require(_0x1397('0x1'));var jsonpatch=require(_0x1397('0x2'));var rp=require(_0x1397('0x3'));var moment=require(_0x1397('0x4'));var BPromise=require(_0x1397('0x5'));var Mustache=require(_0x1397('0x6'));var util=require('util');var path=require(_0x1397('0x7'));var sox=require(_0x1397('0x8'));var csv=require(_0x1397('0x9'));var ejs=require(_0x1397('0xa'));var fs=require('fs');var fs_extra=require(_0x1397('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1397('0xc'));var jsforce=require(_0x1397('0xd'));var deskjs=require(_0x1397('0xe'));var toCsv=require(_0x1397('0x9'));var querystring=require('querystring');var Papa=require(_0x1397('0xf'));var Redis=require('ioredis');var authService=require(_0x1397('0x10'));var qs=require(_0x1397('0x11'));var as=require(_0x1397('0x12'));var hardwareService=require(_0x1397('0x13'));var logger=require(_0x1397('0x14'))(_0x1397('0x15'));var utils=require(_0x1397('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1397('0x17'));var db=require('../../mysqldb')['db'];config[_0x1397('0x18')]=_['defaults'](config[_0x1397('0x18')],{'host':_0x1397('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1397('0x18')]));require('./chatMessage.socket')[_0x1397('0x1a')](socket);var jayson=require(_0x1397('0x1b'));var client=jayson[_0x1397('0x1c')][_0x1397('0x1d')]({'port':0x232c});var client9002=jayson[_0x1397('0x1c')][_0x1397('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x51b078,_0x14c526,_0x3b4a10,_0x4344a2){return new BPromise(function(_0x12ace7,_0x425eca){var _0x515488=_0x4344a2||client;return _0x515488[_0x1397('0x1e')](_0x51b078,_0x3b4a10)[_0x1397('0x1f')](function(_0x4a178f){logger[_0x1397('0x20')]('ChatMessage,\x20%s,\x20%s',_0x14c526,_0x1397('0x21'));logger[_0x1397('0x22')](_0x1397('0x23'),_0x14c526,_0x1397('0x21'),JSON[_0x1397('0x24')](_0x4a178f));if(_0x4a178f['error']){if(_0x4a178f[_0x1397('0x25')][_0x1397('0x26')]===0x1f4){logger[_0x1397('0x25')](_0x1397('0x27'),_0x14c526,_0x4a178f[_0x1397('0x25')][_0x1397('0x28')]);return _0x425eca(_0x4a178f['error']['message']);}logger[_0x1397('0x25')](_0x1397('0x27'),_0x14c526,_0x4a178f[_0x1397('0x25')][_0x1397('0x28')]);return _0x12ace7(_0x4a178f[_0x1397('0x25')][_0x1397('0x28')]);}else{logger[_0x1397('0x20')]('ChatMessage,\x20%s,\x20%s',_0x14c526,_0x1397('0x21'));_0x12ace7(_0x4a178f['result']['message']);}})['catch'](function(_0x28022f){logger[_0x1397('0x25')](_0x1397('0x27'),_0x14c526,_0x28022f);_0x425eca(_0x28022f);});});}function respondWithStatusCode(_0x2742af,_0x4b5fb3){_0x4b5fb3=_0x4b5fb3||0xcc;return function(_0x283094){if(_0x283094){return _0x2742af[_0x1397('0x29')](_0x4b5fb3);}return _0x2742af[_0x1397('0x2a')](_0x4b5fb3)[_0x1397('0x2b')]();};}function respondWithResult(_0xfaadfa,_0x5ae21e){_0x5ae21e=_0x5ae21e||0xc8;return function(_0x2b5e22){if(_0x2b5e22){return _0xfaadfa[_0x1397('0x2a')](_0x5ae21e)[_0x1397('0x2c')](_0x2b5e22);}};}function respondWithFilteredResult(_0x270a2c,_0x1e2d3b){return function(_0x28dae6){if(_0x28dae6){var _0x1f22b2=typeof _0x1e2d3b['offset']==='undefined'&&typeof _0x1e2d3b[_0x1397('0x2d')]===_0x1397('0x2e');var _0x81ed8b=_0x28dae6['count'];var _0x2a471d=_0x1f22b2?0x0:_0x1e2d3b[_0x1397('0x2f')];var _0x548dbb=_0x1f22b2?_0x28dae6[_0x1397('0x30')]:_0x1e2d3b[_0x1397('0x2f')]+_0x1e2d3b[_0x1397('0x2d')];var _0x571137;if(_0x548dbb>=_0x81ed8b){_0x548dbb=_0x81ed8b;_0x571137=0xc8;}else{_0x571137=0xce;}_0x270a2c[_0x1397('0x2a')](_0x571137);return _0x270a2c['set'](_0x1397('0x31'),_0x2a471d+'-'+_0x548dbb+'/'+_0x81ed8b)[_0x1397('0x2c')](_0x28dae6);}return null;};}function patchUpdates(_0x41cd47){return function(_0x3a33a8){try{jsonpatch[_0x1397('0x32')](_0x3a33a8,_0x41cd47,!![]);}catch(_0x9a8f9e){return BPromise['reject'](_0x9a8f9e);}return _0x3a33a8['save']();};}function saveUpdates(_0x91ce28,_0x31a3b0){return function(_0x8c6d50){if(_0x8c6d50){return _0x8c6d50[_0x1397('0x33')](_0x91ce28)[_0x1397('0x1f')](function(_0x24c519){return _0x24c519;});}return null;};}function removeEntity(_0x55d475,_0x368c7f){return function(_0x198aee){if(_0x198aee){return _0x198aee[_0x1397('0x34')]()[_0x1397('0x1f')](function(){_0x55d475[_0x1397('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a7a9e,_0x3e4a27){return function(_0x195bcc){if(!_0x195bcc){_0x5a7a9e[_0x1397('0x29')](0x194);}return _0x195bcc;};}function handleError(_0x52673f,_0x50a939){_0x50a939=_0x50a939||0x1f4;return function(_0x177959){logger[_0x1397('0x25')](_0x177959[_0x1397('0x35')]);if(_0x177959[_0x1397('0x36')]){delete _0x177959['name'];}_0x52673f[_0x1397('0x2a')](_0x50a939)['send'](_0x177959);};}exports[_0x1397('0x37')]=function(_0x5e6da3,_0x5c1dc0){var _0x46ee3d={},_0x11b6f2={},_0x2c3d07={'count':0x0,'rows':[]};var _0x40574a=_[_0x1397('0x38')](db[_0x1397('0x39')][_0x1397('0x3a')],function(_0x2bd6fb){return{'name':_0x2bd6fb[_0x1397('0x3b')],'type':_0x2bd6fb[_0x1397('0x3c')][_0x1397('0x3d')]};});_0x11b6f2[_0x1397('0x3e')]=_[_0x1397('0x38')](_0x40574a,_0x1397('0x36'));_0x11b6f2[_0x1397('0x3f')]=_[_0x1397('0x40')](_0x5e6da3[_0x1397('0x3f')]);_0x11b6f2[_0x1397('0x41')]=_[_0x1397('0x42')](_0x11b6f2['model'],_0x11b6f2[_0x1397('0x3f')]);_0x46ee3d[_0x1397('0x43')]=_['intersection'](_0x11b6f2[_0x1397('0x3e')],qs[_0x1397('0x44')](_0x5e6da3[_0x1397('0x3f')]['fields']));_0x46ee3d[_0x1397('0x43')]=_0x46ee3d['attributes']['length']?_0x46ee3d['attributes']:_0x11b6f2[_0x1397('0x3e')];if(!_0x5e6da3[_0x1397('0x3f')][_0x1397('0x45')](_0x1397('0x46'))){_0x46ee3d['limit']=qs['limit'](_0x5e6da3[_0x1397('0x3f')][_0x1397('0x2d')]);_0x46ee3d[_0x1397('0x2f')]=qs[_0x1397('0x2f')](_0x5e6da3[_0x1397('0x3f')]['offset']);}_0x46ee3d[_0x1397('0x47')]=qs['sort'](_0x5e6da3[_0x1397('0x3f')][_0x1397('0x48')]);_0x46ee3d[_0x1397('0x49')]=qs[_0x1397('0x41')](_[_0x1397('0x4a')](_0x5e6da3[_0x1397('0x3f')],_0x11b6f2[_0x1397('0x41')]),_0x40574a);if(_0x5e6da3[_0x1397('0x3f')][_0x1397('0x4b')]){_0x46ee3d[_0x1397('0x49')]=_[_0x1397('0x4c')](_0x46ee3d[_0x1397('0x49')],{'$or':_[_0x1397('0x38')](_0x40574a,function(_0x3c7adc){if(_0x3c7adc['type']!==_0x1397('0x4d')){var _0x18eedb={};_0x18eedb[_0x3c7adc[_0x1397('0x36')]]={'$like':'%'+_0x5e6da3[_0x1397('0x3f')]['filter']+'%'};return _0x18eedb;}})});}_0x46ee3d=_[_0x1397('0x4c')]({},_0x46ee3d,_0x5e6da3[_0x1397('0x4e')]);var _0x4ea6a2={'where':_0x46ee3d['where']};return db[_0x1397('0x39')][_0x1397('0x30')](_0x4ea6a2)['then'](function(_0x5080ee){_0x2c3d07[_0x1397('0x30')]=_0x5080ee;if(_0x5e6da3[_0x1397('0x3f')][_0x1397('0x4f')]){_0x46ee3d[_0x1397('0x50')]=[{'all':!![]}];}return db[_0x1397('0x39')][_0x1397('0x51')](_0x46ee3d);})[_0x1397('0x1f')](function(_0x447d17){_0x2c3d07[_0x1397('0x52')]=_0x447d17;return _0x2c3d07;})['then'](respondWithFilteredResult(_0x5c1dc0,_0x46ee3d))[_0x1397('0x53')](handleError(_0x5c1dc0,null));};exports[_0x1397('0x54')]=function(_0x1b2d29,_0x6b1675){var _0x1b300b={'raw':!![],'where':{'id':_0x1b2d29[_0x1397('0x55')]['id']}},_0x3e618f={};_0x3e618f[_0x1397('0x3e')]=_[_0x1397('0x40')](db[_0x1397('0x39')]['rawAttributes']);_0x3e618f[_0x1397('0x3f')]=_[_0x1397('0x40')](_0x1b2d29[_0x1397('0x3f')]);_0x3e618f['filters']=_['intersection'](_0x3e618f[_0x1397('0x3e')],_0x3e618f[_0x1397('0x3f')]);_0x1b300b[_0x1397('0x43')]=_[_0x1397('0x42')](_0x3e618f[_0x1397('0x3e')],qs[_0x1397('0x44')](_0x1b2d29[_0x1397('0x3f')]['fields']));_0x1b300b['attributes']=_0x1b300b[_0x1397('0x43')][_0x1397('0x56')]?_0x1b300b['attributes']:_0x3e618f[_0x1397('0x3e')];if(_0x1b2d29[_0x1397('0x3f')][_0x1397('0x4f')]){_0x1b300b[_0x1397('0x50')]=[{'all':!![]}];}_0x1b300b=_[_0x1397('0x4c')]({},_0x1b300b,_0x1b2d29[_0x1397('0x4e')]);return db['ChatMessage']['find'](_0x1b300b)[_0x1397('0x1f')](handleEntityNotFound(_0x6b1675,null))['then'](respondWithResult(_0x6b1675,null))[_0x1397('0x53')](handleError(_0x6b1675,null));};exports[_0x1397('0x57')]=function(_0x19c147,_0x58905e){return db[_0x1397('0x39')][_0x1397('0x57')](_0x19c147[_0x1397('0x58')],{})[_0x1397('0x1f')](respondWithResult(_0x58905e,0xc9))[_0x1397('0x53')](handleError(_0x58905e,null));};exports[_0x1397('0x33')]=function(_0x5c909a,_0x126898){if(_0x5c909a[_0x1397('0x58')]['id']){delete _0x5c909a[_0x1397('0x58')]['id'];}return db[_0x1397('0x39')][_0x1397('0x59')]({'where':{'id':_0x5c909a[_0x1397('0x55')]['id']}})[_0x1397('0x1f')](handleEntityNotFound(_0x126898,null))[_0x1397('0x1f')](saveUpdates(_0x5c909a[_0x1397('0x58')],null))[_0x1397('0x1f')](respondWithResult(_0x126898,null))[_0x1397('0x53')](handleError(_0x126898,null));};exports[_0x1397('0x34')]=function(_0x4f8629,_0x16c641){return db[_0x1397('0x39')][_0x1397('0x59')]({'where':{'id':_0x4f8629[_0x1397('0x55')]['id']}})[_0x1397('0x1f')](handleEntityNotFound(_0x16c641,null))['then'](removeEntity(_0x16c641,null))['catch'](handleError(_0x16c641,null));};exports['describe']=function(_0x103f0d,_0x55341a){return db[_0x1397('0x39')][_0x1397('0x5a')]()['then'](respondWithResult(_0x55341a,null))['catch'](handleError(_0x55341a,null));};var interaction_log=require(_0x1397('0x14'))(_0x1397('0x5b'));exports[_0x1397('0x5c')]=function(_0x1bd779,_0x3a84b4,_0x45ed47){var _0x3ef339={'agent':{},'channel':'chat'};if(_0x1bd779[_0x1397('0x58')]['id']){delete _0x1bd779[_0x1397('0x58')]['id'];}_0x1bd779[_0x1397('0x58')]['read']=!![];_0x1bd779['body'][_0x1397('0x5d')]=moment()['format'](_0x1397('0x5e'));_0x1bd779['body']['UserId']=_0x1bd779[_0x1397('0x58')][_0x1397('0x5f')]||_0x1bd779[_0x1397('0x60')]['id'];_0x3ef339[_0x1397('0x61')]['id']=_0x1bd779['body'][_0x1397('0x5f')];return db[_0x1397('0x39')][_0x1397('0x59')]({'where':{'id':_0x1bd779['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a84b4,null))['then'](saveUpdates(_0x1bd779['body'],null))[_0x1397('0x1f')](function(_0xcbb7dd){if(_0xcbb7dd){_0x3ef339[_0x1397('0x28')]=_0xcbb7dd[_0x1397('0x62')]({'plain':!![]});return db[_0x1397('0x63')][_0x1397('0x59')]({'where':{'id':_0xcbb7dd[_0x1397('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x3a84b4,null))[_0x1397('0x1f')](function(_0x35f4ee){if(_0x35f4ee){return _0x35f4ee[_0x1397('0x33')]({'UserId':_0x1bd779['body']['UserId'],'read1stAt':_['isNil'](_0x35f4ee['read1stAt'])?moment()[_0x1397('0x65')](_0x1397('0x5e')):undefined});}return null;})[_0x1397('0x1f')](function(_0x316ac1){if(_0x316ac1){_0x3ef339[_0x1397('0x66')]=_0x316ac1['get']({'plain':!![]});interaction_log[_0x1397('0x20')](_0x1397('0x67'),_0x1bd779[_0x1397('0x60')]['id'],_0x1bd779[_0x1397('0x60')][_0x1397('0x36')],_0x1bd779[_0x1397('0x60')][_0x1397('0x68')],_0x3ef339[_0x1397('0x66')]['id'],_0x1bd779[_0x1397('0x58')]?JSON[_0x1397('0x24')](_0x1bd779['body']):_0x1397('0x69'));return respondWithRpcPromise(_0x1397('0x6a'),_0x1397('0x6b'),_0x3ef339);}return null;})[_0x1397('0x1f')](function(_0x20bd5b){var _0x231357=_0x1397('0x6c')+_0x20bd5b[_0x1397('0x28')]['ContactId'];return db[_0x1397('0x6d')][_0x1397('0x3f')](_0x231357,{'type':db[_0x1397('0x6e')][_0x1397('0x6f')][_0x1397('0x70')],'raw':!![]})[_0x1397('0x1f')](function(_0x536a22){return _0x536a22;});})[_0x1397('0x1f')](function(_0x443863){if(_0x443863){_0x3ef339[_0x1397('0x28')][_0x1397('0x71')]=_0x443863[0x0];if(!_0x1bd779[_0x1397('0x58')]['UserId'])return;return db[_0x1397('0x72')][_0x1397('0x59')]({'where':{'id':_0x1bd779[_0x1397('0x58')][_0x1397('0x5f')],'role':_0x1397('0x61')},'attributes':['id','name','fullname',_0x1397('0x73'),'internal'],'raw':!![]});}return null;})[_0x1397('0x1f')](function(_0x3f7335){if(!_0x3f7335)return null;_0x3ef339[_0x1397('0x28')]['agent']=_0x3f7335;return _0x3ef339;})[_0x1397('0x1f')](function(_0x2c0e20){if(_0x2c0e20){if(_0x1bd779[_0x1397('0x58')][_0x1397('0x74')]){_0x3ef339['message'][_0x1397('0x75')]=util[_0x1397('0x65')]('SIP/%s',_0x1bd779['user'][_0x1397('0x36')]);_0x3ef339[_0x1397('0x28')][_0x1397('0x76')]=_0x3ef339[_0x1397('0x76')];_0x3ef339[_0x1397('0x28')][_0x1397('0x77')]=_0x3ef339[_0x1397('0x76')];_0x3ef339['message'][_0x1397('0x78')]='accept';return respondWithRpcPromise(_0x1397('0x79'),_0x1397('0x79'),{'event':_0x1397('0x7a'),'message':_[_0x1397('0x4c')](_0x3ef339[_0x1397('0x28')],JSON[_0x1397('0x7b')](_0x3ef339[_0x1397('0x66')]['formData']))},client9002)[_0x1397('0x1f')](function(){return _0x3ef339;});}return _0x3ef339;}return null;})[_0x1397('0x1f')](respondWithResult(_0x3a84b4,null))['catch'](handleError(_0x3a84b4,null));};var interaction_log=require(_0x1397('0x14'))(_0x1397('0x5b'));exports['reject']=function(_0x5ef003,_0x55bdba,_0x2bfc30){var _0x5a5fc7={'agent':{},'channel':_0x1397('0x7c')};if(_0x5ef003[_0x1397('0x58')]['id']){delete _0x5ef003['body']['id'];}_0x5ef003[_0x1397('0x58')][_0x1397('0x5f')]=_0x5ef003[_0x1397('0x58')]['UserId']||_0x5ef003[_0x1397('0x60')]['id'];_0x5a5fc7[_0x1397('0x61')]['id']=_0x5ef003[_0x1397('0x58')][_0x1397('0x5f')];return db[_0x1397('0x39')][_0x1397('0x59')]({'where':{'id':_0x5ef003['params']['id'],'UserId':null}})[_0x1397('0x1f')](handleEntityNotFound(_0x55bdba,null))[_0x1397('0x1f')](function(_0xe7ee99){if(_0xe7ee99){_0x5a5fc7['message']=_0xe7ee99['get']({'plain':!![]});return db[_0x1397('0x63')][_0x1397('0x59')]({'where':{'id':_0xe7ee99[_0x1397('0x64')]}});}return null;})[_0x1397('0x1f')](handleEntityNotFound(_0x55bdba,null))[_0x1397('0x1f')](function(_0x2a2036){if(_0x2a2036){_0x5a5fc7['interaction']=_0x2a2036[_0x1397('0x62')]({'plain':!![]});interaction_log[_0x1397('0x20')](_0x1397('0x7d'),_0x5ef003[_0x1397('0x60')]['id'],_0x5ef003[_0x1397('0x60')][_0x1397('0x36')],_0x5ef003['user']['role'],_0x5a5fc7[_0x1397('0x66')]['id'],_0x5ef003['body']?JSON[_0x1397('0x24')](_0x5ef003[_0x1397('0x58')]):_0x1397('0x69'));return respondWithRpcPromise(_0x1397('0x7e'),_0x1397('0x7f'),_0x5a5fc7);}return null;})[_0x1397('0x1f')](function(_0x7a8c87){var _0x162262=_0x1397('0x6c')+_0x7a8c87['message']['ContactId'];return db['sequelize'][_0x1397('0x3f')](_0x162262,{'type':db[_0x1397('0x6e')][_0x1397('0x6f')][_0x1397('0x70')],'raw':!![]})[_0x1397('0x1f')](function(_0x17b887){return _0x17b887;});})[_0x1397('0x1f')](function(_0x122019){if(_0x122019){_0x5a5fc7['message'][_0x1397('0x71')]=_0x122019[0x0];if(!_0x5ef003[_0x1397('0x58')]['UserId'])return;return db[_0x1397('0x72')][_0x1397('0x59')]({'where':{'id':_0x5ef003[_0x1397('0x58')][_0x1397('0x5f')],'role':_0x1397('0x61')},'attributes':['id',_0x1397('0x36'),_0x1397('0x80'),_0x1397('0x73'),_0x1397('0x81')],'raw':!![]});}return null;})[_0x1397('0x1f')](function(_0x5e6337){if(!_0x5e6337)return null;_0x5a5fc7['message']['agent']=_0x5e6337;return _0x5a5fc7;})[_0x1397('0x1f')](function(_0x4f067b){if(_0x4f067b){_0x4f067b[_0x1397('0x28')][_0x1397('0x75')]=util['format']('SIP/%s',_0x5ef003[_0x1397('0x60')][_0x1397('0x36')]);_0x4f067b[_0x1397('0x28')][_0x1397('0x76')]=_0x5a5fc7[_0x1397('0x76')];_0x4f067b[_0x1397('0x28')]['motionChannel']=_0x5a5fc7['channel'];_0x4f067b[_0x1397('0x28')][_0x1397('0x78')]=_0x1397('0x82');respondWithRpcPromise(_0x1397('0x79'),_0x1397('0x79'),{'event':_0x1397('0x83'),'message':_['merge'](_0x5a5fc7[_0x1397('0x28')],JSON[_0x1397('0x7b')](_0x5a5fc7[_0x1397('0x66')][_0x1397('0x84')]))},client9002);return _0x5a5fc7;}return null;})[_0x1397('0x1f')](respondWithResult(_0x55bdba,null))[_0x1397('0x53')](handleError(_0x55bdba,null));};
\ No newline at end of file
+var _0x41d6=['internal','rejectmessage','parse','formData','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','describe','../../config/logger','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','channel','motionChannel','event','EventManager','acceptmessage','chat','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId'];(function(_0x4b9702,_0x1ce3ab){var _0x152ef5=function(_0x136419){while(--_0x136419){_0x4b9702['push'](_0x4b9702['shift']());}};_0x152ef5(++_0x1ce3ab);}(_0x41d6,0x10c));var _0x641d=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x41d6[_0x27638d];return _0x35da35;};'use strict';var emlformat=require(_0x641d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x641d('0x1'));var moment=require(_0x641d('0x2'));var BPromise=require(_0x641d('0x3'));var Mustache=require(_0x641d('0x4'));var util=require('util');var path=require(_0x641d('0x5'));var sox=require(_0x641d('0x6'));var csv=require(_0x641d('0x7'));var ejs=require(_0x641d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x641d('0x9'));var crypto=require(_0x641d('0xa'));var jsforce=require(_0x641d('0xb'));var deskjs=require(_0x641d('0xc'));var toCsv=require(_0x641d('0x7'));var querystring=require('querystring');var Papa=require(_0x641d('0xd'));var Redis=require(_0x641d('0xe'));var authService=require(_0x641d('0xf'));var qs=require(_0x641d('0x10'));var as=require(_0x641d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x641d('0x12'));var utils=require(_0x641d('0x13'));var config=require(_0x641d('0x14'));var licenseUtil=require(_0x641d('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x641d('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0x641d('0x17')](socket);var jayson=require(_0x641d('0x18'));var client=jayson[_0x641d('0x19')][_0x641d('0x1a')]({'port':0x232c});var client9002=jayson[_0x641d('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x599cec,_0x2350d0,_0x406371,_0x11b7e9){return new BPromise(function(_0x4c0d8d,_0x5077b5){var _0x16c914=_0x11b7e9||client;return _0x16c914[_0x641d('0x1b')](_0x599cec,_0x406371)[_0x641d('0x1c')](function(_0x328cf2){logger[_0x641d('0x1d')](_0x641d('0x1e'),_0x2350d0,_0x641d('0x1f'));logger[_0x641d('0x20')](_0x641d('0x21'),_0x2350d0,_0x641d('0x1f'),JSON['stringify'](_0x328cf2));if(_0x328cf2[_0x641d('0x22')]){if(_0x328cf2[_0x641d('0x22')][_0x641d('0x23')]===0x1f4){logger['error'](_0x641d('0x1e'),_0x2350d0,_0x328cf2[_0x641d('0x22')][_0x641d('0x24')]);return _0x5077b5(_0x328cf2[_0x641d('0x22')][_0x641d('0x24')]);}logger[_0x641d('0x22')](_0x641d('0x1e'),_0x2350d0,_0x328cf2[_0x641d('0x22')]['message']);return _0x4c0d8d(_0x328cf2['error'][_0x641d('0x24')]);}else{logger['info'](_0x641d('0x1e'),_0x2350d0,_0x641d('0x1f'));_0x4c0d8d(_0x328cf2[_0x641d('0x25')][_0x641d('0x24')]);}})[_0x641d('0x26')](function(_0xa5732c){logger[_0x641d('0x22')](_0x641d('0x1e'),_0x2350d0,_0xa5732c);_0x5077b5(_0xa5732c);});});}function respondWithStatusCode(_0x17944c,_0x44b9a7){_0x44b9a7=_0x44b9a7||0xcc;return function(_0x10ace9){if(_0x10ace9){return _0x17944c[_0x641d('0x27')](_0x44b9a7);}return _0x17944c[_0x641d('0x28')](_0x44b9a7)[_0x641d('0x29')]();};}function respondWithResult(_0x49f8d3,_0x5abcbe){_0x5abcbe=_0x5abcbe||0xc8;return function(_0x498ce4){if(_0x498ce4){return _0x49f8d3[_0x641d('0x28')](_0x5abcbe)['json'](_0x498ce4);}};}function respondWithFilteredResult(_0x2af9fb,_0x262aca){return function(_0x55cc80){if(_0x55cc80){var _0x499859=typeof _0x262aca['offset']===_0x641d('0x2a')&&typeof _0x262aca['limit']==='undefined';var _0x353e82=_0x55cc80[_0x641d('0x2b')];var _0x529d32=_0x499859?0x0:_0x262aca[_0x641d('0x2c')];var _0x530eb6=_0x499859?_0x55cc80[_0x641d('0x2b')]:_0x262aca[_0x641d('0x2c')]+_0x262aca['limit'];var _0x27c4aa;if(_0x530eb6>=_0x353e82){_0x530eb6=_0x353e82;_0x27c4aa=0xc8;}else{_0x27c4aa=0xce;}_0x2af9fb[_0x641d('0x28')](_0x27c4aa);return _0x2af9fb[_0x641d('0x2d')](_0x641d('0x2e'),_0x529d32+'-'+_0x530eb6+'/'+_0x353e82)['json'](_0x55cc80);}return null;};}function patchUpdates(_0x49569b){return function(_0x30c1d0){try{jsonpatch['apply'](_0x30c1d0,_0x49569b,!![]);}catch(_0x2e5d6f){return BPromise[_0x641d('0x2f')](_0x2e5d6f);}return _0x30c1d0[_0x641d('0x30')]();};}function saveUpdates(_0x1ef3dc,_0x1f5ecc){return function(_0x181a85){if(_0x181a85){return _0x181a85[_0x641d('0x31')](_0x1ef3dc)[_0x641d('0x1c')](function(_0x260f54){return _0x260f54;});}return null;};}function removeEntity(_0x21dd5b,_0x101154){return function(_0xca2126){if(_0xca2126){return _0xca2126[_0x641d('0x32')]()[_0x641d('0x1c')](function(){_0x21dd5b['status'](0xcc)[_0x641d('0x29')]();});}};}function handleEntityNotFound(_0x28d8f8,_0x2a0a8a){return function(_0x1838a2){if(!_0x1838a2){_0x28d8f8[_0x641d('0x27')](0x194);}return _0x1838a2;};}function handleError(_0x21d779,_0x5efdcd){_0x5efdcd=_0x5efdcd||0x1f4;return function(_0x2b0b1d){logger[_0x641d('0x22')](_0x2b0b1d[_0x641d('0x33')]);if(_0x2b0b1d[_0x641d('0x34')]){delete _0x2b0b1d[_0x641d('0x34')];}_0x21d779[_0x641d('0x28')](_0x5efdcd)[_0x641d('0x35')](_0x2b0b1d);};}exports[_0x641d('0x36')]=function(_0x46624a,_0x1d2e99){var _0x232426={},_0x4c350e={},_0x3b7607={'count':0x0,'rows':[]};var _0x43c6b2=_[_0x641d('0x37')](db[_0x641d('0x38')]['rawAttributes'],function(_0x3b5975){return{'name':_0x3b5975[_0x641d('0x39')],'type':_0x3b5975[_0x641d('0x3a')]['key']};});_0x4c350e[_0x641d('0x3b')]=_[_0x641d('0x37')](_0x43c6b2,_0x641d('0x34'));_0x4c350e[_0x641d('0x3c')]=_[_0x641d('0x3d')](_0x46624a[_0x641d('0x3c')]);_0x4c350e[_0x641d('0x3e')]=_[_0x641d('0x3f')](_0x4c350e[_0x641d('0x3b')],_0x4c350e[_0x641d('0x3c')]);_0x232426[_0x641d('0x40')]=_['intersection'](_0x4c350e[_0x641d('0x3b')],qs[_0x641d('0x41')](_0x46624a[_0x641d('0x3c')][_0x641d('0x41')]));_0x232426[_0x641d('0x40')]=_0x232426[_0x641d('0x40')][_0x641d('0x42')]?_0x232426['attributes']:_0x4c350e[_0x641d('0x3b')];if(!_0x46624a[_0x641d('0x3c')][_0x641d('0x43')]('nolimit')){_0x232426[_0x641d('0x44')]=qs[_0x641d('0x44')](_0x46624a[_0x641d('0x3c')][_0x641d('0x44')]);_0x232426['offset']=qs[_0x641d('0x2c')](_0x46624a[_0x641d('0x3c')][_0x641d('0x2c')]);}_0x232426[_0x641d('0x45')]=qs[_0x641d('0x46')](_0x46624a[_0x641d('0x3c')][_0x641d('0x46')]);_0x232426['where']=qs[_0x641d('0x3e')](_['pick'](_0x46624a[_0x641d('0x3c')],_0x4c350e['filters']),_0x43c6b2);if(_0x46624a['query'][_0x641d('0x47')]){_0x232426[_0x641d('0x48')]=_[_0x641d('0x49')](_0x232426['where'],{'$or':_[_0x641d('0x37')](_0x43c6b2,function(_0x2fd001){if(_0x2fd001[_0x641d('0x3a')]!==_0x641d('0x4a')){var _0x344451={};_0x344451[_0x2fd001[_0x641d('0x34')]]={'$like':'%'+_0x46624a[_0x641d('0x3c')]['filter']+'%'};return _0x344451;}})});}_0x232426=_[_0x641d('0x49')]({},_0x232426,_0x46624a['options']);var _0x35a056={'where':_0x232426[_0x641d('0x48')]};return db[_0x641d('0x38')]['count'](_0x35a056)[_0x641d('0x1c')](function(_0x3328cf){_0x3b7607[_0x641d('0x2b')]=_0x3328cf;if(_0x46624a[_0x641d('0x3c')][_0x641d('0x4b')]){_0x232426[_0x641d('0x4c')]=[{'all':!![]}];}return db['ChatMessage'][_0x641d('0x4d')](_0x232426);})[_0x641d('0x1c')](function(_0x5e1f5b){_0x3b7607[_0x641d('0x4e')]=_0x5e1f5b;return _0x3b7607;})[_0x641d('0x1c')](respondWithFilteredResult(_0x1d2e99,_0x232426))[_0x641d('0x26')](handleError(_0x1d2e99,null));};exports[_0x641d('0x4f')]=function(_0x386320,_0x446dd1){var _0x282799={'raw':!![],'where':{'id':_0x386320[_0x641d('0x50')]['id']}},_0x30468b={};_0x30468b[_0x641d('0x3b')]=_['keys'](db[_0x641d('0x38')][_0x641d('0x51')]);_0x30468b[_0x641d('0x3c')]=_[_0x641d('0x3d')](_0x386320[_0x641d('0x3c')]);_0x30468b[_0x641d('0x3e')]=_[_0x641d('0x3f')](_0x30468b[_0x641d('0x3b')],_0x30468b[_0x641d('0x3c')]);_0x282799[_0x641d('0x40')]=_[_0x641d('0x3f')](_0x30468b[_0x641d('0x3b')],qs['fields'](_0x386320[_0x641d('0x3c')]['fields']));_0x282799[_0x641d('0x40')]=_0x282799[_0x641d('0x40')][_0x641d('0x42')]?_0x282799[_0x641d('0x40')]:_0x30468b[_0x641d('0x3b')];if(_0x386320[_0x641d('0x3c')][_0x641d('0x4b')]){_0x282799[_0x641d('0x4c')]=[{'all':!![]}];}_0x282799=_[_0x641d('0x49')]({},_0x282799,_0x386320[_0x641d('0x52')]);return db[_0x641d('0x38')][_0x641d('0x53')](_0x282799)[_0x641d('0x1c')](handleEntityNotFound(_0x446dd1,null))[_0x641d('0x1c')](respondWithResult(_0x446dd1,null))[_0x641d('0x26')](handleError(_0x446dd1,null));};exports[_0x641d('0x54')]=function(_0x28de21,_0x3787ef){return db[_0x641d('0x38')][_0x641d('0x54')](_0x28de21[_0x641d('0x55')],{})[_0x641d('0x1c')](respondWithResult(_0x3787ef,0xc9))[_0x641d('0x26')](handleError(_0x3787ef,null));};exports[_0x641d('0x31')]=function(_0xd2a239,_0xb5430e){if(_0xd2a239[_0x641d('0x55')]['id']){delete _0xd2a239[_0x641d('0x55')]['id'];}return db[_0x641d('0x38')][_0x641d('0x53')]({'where':{'id':_0xd2a239[_0x641d('0x50')]['id']}})['then'](handleEntityNotFound(_0xb5430e,null))[_0x641d('0x1c')](saveUpdates(_0xd2a239[_0x641d('0x55')],null))[_0x641d('0x1c')](respondWithResult(_0xb5430e,null))[_0x641d('0x26')](handleError(_0xb5430e,null));};exports[_0x641d('0x32')]=function(_0x5452cf,_0x2ec2c2){return db[_0x641d('0x38')][_0x641d('0x53')]({'where':{'id':_0x5452cf[_0x641d('0x50')]['id']}})['then'](handleEntityNotFound(_0x2ec2c2,null))['then'](removeEntity(_0x2ec2c2,null))[_0x641d('0x26')](handleError(_0x2ec2c2,null));};exports['describe']=function(_0x4725d2,_0x114739){return db['ChatMessage'][_0x641d('0x56')]()[_0x641d('0x1c')](respondWithResult(_0x114739,null))[_0x641d('0x26')](handleError(_0x114739,null));};var interaction_log=require(_0x641d('0x57'))('chat-interactions');exports[_0x641d('0x58')]=function(_0x2d6019,_0x3f580d,_0xa2142c){var _0x11b207={'agent':{},'channel':'chat'};if(_0x2d6019[_0x641d('0x55')]['id']){delete _0x2d6019[_0x641d('0x55')]['id'];}_0x2d6019['body'][_0x641d('0x59')]=!![];_0x2d6019['body'][_0x641d('0x5a')]=moment()[_0x641d('0x5b')](_0x641d('0x5c'));_0x2d6019[_0x641d('0x55')][_0x641d('0x5d')]=_0x2d6019['body'][_0x641d('0x5d')]||_0x2d6019[_0x641d('0x5e')]['id'];_0x11b207[_0x641d('0x5f')]['id']=_0x2d6019[_0x641d('0x55')]['UserId'];return db[_0x641d('0x38')][_0x641d('0x53')]({'where':{'id':_0x2d6019[_0x641d('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3f580d,null))[_0x641d('0x1c')](saveUpdates(_0x2d6019[_0x641d('0x55')],null))[_0x641d('0x1c')](function(_0x2153ca){if(_0x2153ca){_0x11b207[_0x641d('0x24')]=_0x2153ca[_0x641d('0x60')]({'plain':!![]});return db['ChatInteraction'][_0x641d('0x53')]({'where':{'id':_0x2153ca[_0x641d('0x61')]}});}return null;})[_0x641d('0x1c')](handleEntityNotFound(_0x3f580d,null))[_0x641d('0x1c')](function(_0x2ec619){if(_0x2ec619){return _0x2ec619[_0x641d('0x31')]({'UserId':_0x2d6019[_0x641d('0x55')][_0x641d('0x5d')],'read1stAt':_[_0x641d('0x62')](_0x2ec619[_0x641d('0x63')])?moment()[_0x641d('0x5b')](_0x641d('0x5c')):undefined});}return null;})[_0x641d('0x1c')](function(_0x8c7627){if(_0x8c7627){_0x11b207['interaction']=_0x8c7627['get']({'plain':!![]});interaction_log[_0x641d('0x1d')](_0x641d('0x64'),_0x2d6019[_0x641d('0x5e')]['id'],_0x2d6019[_0x641d('0x5e')][_0x641d('0x34')],_0x2d6019[_0x641d('0x5e')]['role'],_0x11b207[_0x641d('0x65')]['id'],_0x2d6019[_0x641d('0x55')]?JSON[_0x641d('0x66')](_0x2d6019[_0x641d('0x55')]):_0x641d('0x67'));return respondWithRpcPromise(_0x641d('0x68'),_0x641d('0x69'),_0x11b207);}return null;})[_0x641d('0x1c')](function(_0x31d03a){var _0x4df362=_0x641d('0x6a')+_0x31d03a[_0x641d('0x24')]['ContactId'];return db[_0x641d('0x6b')][_0x641d('0x3c')](_0x4df362,{'type':db[_0x641d('0x6c')][_0x641d('0x6d')][_0x641d('0x6e')],'raw':!![]})[_0x641d('0x1c')](function(_0x32da01){return _0x32da01;});})[_0x641d('0x1c')](function(_0x159ca8){if(_0x159ca8){_0x11b207[_0x641d('0x24')][_0x641d('0x6f')]=_0x159ca8[0x0];if(!_0x2d6019['body'][_0x641d('0x5d')])return;return db[_0x641d('0x70')][_0x641d('0x53')]({'where':{'id':_0x2d6019[_0x641d('0x55')][_0x641d('0x5d')],'role':_0x641d('0x5f')},'attributes':['id',_0x641d('0x34'),_0x641d('0x71'),_0x641d('0x72'),'internal'],'raw':!![]});}return null;})[_0x641d('0x1c')](function(_0xb839eb){if(!_0xb839eb)return null;_0x11b207[_0x641d('0x24')][_0x641d('0x5f')]=_0xb839eb;return _0x11b207;})[_0x641d('0x1c')](function(_0x4aae66){if(_0x4aae66){if(_0x2d6019[_0x641d('0x55')]['manual']){_0x11b207[_0x641d('0x24')][_0x641d('0x73')]=util['format']('SIP/%s',_0x2d6019[_0x641d('0x5e')][_0x641d('0x34')]);_0x11b207['message'][_0x641d('0x74')]=_0x11b207[_0x641d('0x74')];_0x11b207[_0x641d('0x24')][_0x641d('0x75')]=_0x11b207[_0x641d('0x74')];_0x11b207[_0x641d('0x24')][_0x641d('0x76')]=_0x641d('0x58');return respondWithRpcPromise('EventManager',_0x641d('0x77'),{'event':_0x641d('0x78'),'message':_[_0x641d('0x49')](_0x11b207['message'],JSON['parse'](_0x11b207[_0x641d('0x65')]['formData']))},client9002)[_0x641d('0x1c')](function(){return _0x11b207;});}return _0x11b207;}return null;})[_0x641d('0x1c')](respondWithResult(_0x3f580d,null))[_0x641d('0x26')](handleError(_0x3f580d,null));};var interaction_log=require(_0x641d('0x57'))('chat-interactions');exports['reject']=function(_0x6e3ad,_0x358f25,_0xca2b52){var _0x37e322={'agent':{},'channel':_0x641d('0x79')};if(_0x6e3ad[_0x641d('0x55')]['id']){delete _0x6e3ad[_0x641d('0x55')]['id'];}_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')]=_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')]||_0x6e3ad[_0x641d('0x5e')]['id'];_0x37e322[_0x641d('0x5f')]['id']=_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')];return db['ChatMessage'][_0x641d('0x53')]({'where':{'id':_0x6e3ad['params']['id'],'UserId':null}})[_0x641d('0x1c')](handleEntityNotFound(_0x358f25,null))[_0x641d('0x1c')](function(_0x2551bd){if(_0x2551bd){_0x37e322[_0x641d('0x24')]=_0x2551bd[_0x641d('0x60')]({'plain':!![]});return db[_0x641d('0x7a')][_0x641d('0x53')]({'where':{'id':_0x2551bd[_0x641d('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x358f25,null))[_0x641d('0x1c')](function(_0x846701){if(_0x846701){_0x37e322[_0x641d('0x65')]=_0x846701['get']({'plain':!![]});interaction_log[_0x641d('0x1d')](_0x641d('0x7b'),_0x6e3ad[_0x641d('0x5e')]['id'],_0x6e3ad[_0x641d('0x5e')][_0x641d('0x34')],_0x6e3ad['user'][_0x641d('0x7c')],_0x37e322[_0x641d('0x65')]['id'],_0x6e3ad[_0x641d('0x55')]?JSON[_0x641d('0x66')](_0x6e3ad[_0x641d('0x55')]):'null');return respondWithRpcPromise(_0x641d('0x7d'),_0x641d('0x7e'),_0x37e322);}return null;})[_0x641d('0x1c')](function(_0x5b31e5){var _0x2bf1cb=_0x641d('0x6a')+_0x5b31e5[_0x641d('0x24')][_0x641d('0x7f')];return db[_0x641d('0x6b')]['query'](_0x2bf1cb,{'type':db[_0x641d('0x6c')][_0x641d('0x6d')][_0x641d('0x6e')],'raw':!![]})['then'](function(_0x22047d){return _0x22047d;});})[_0x641d('0x1c')](function(_0x4a63b0){if(_0x4a63b0){_0x37e322['message']['contact']=_0x4a63b0[0x0];if(!_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')])return;return db['User'][_0x641d('0x53')]({'where':{'id':_0x6e3ad[_0x641d('0x55')][_0x641d('0x5d')],'role':_0x641d('0x5f')},'attributes':['id',_0x641d('0x34'),_0x641d('0x71'),'email',_0x641d('0x80')],'raw':!![]});}return null;})[_0x641d('0x1c')](function(_0x2fc736){if(!_0x2fc736)return null;_0x37e322[_0x641d('0x24')]['agent']=_0x2fc736;return _0x37e322;})[_0x641d('0x1c')](function(_0x9288f7){if(_0x9288f7){_0x9288f7[_0x641d('0x24')][_0x641d('0x73')]=util[_0x641d('0x5b')]('SIP/%s',_0x6e3ad[_0x641d('0x5e')][_0x641d('0x34')]);_0x9288f7[_0x641d('0x24')]['channel']=_0x37e322[_0x641d('0x74')];_0x9288f7[_0x641d('0x24')][_0x641d('0x75')]=_0x37e322['channel'];_0x9288f7[_0x641d('0x24')][_0x641d('0x76')]=_0x641d('0x2f');respondWithRpcPromise(_0x641d('0x77'),_0x641d('0x77'),{'event':_0x641d('0x81'),'message':_[_0x641d('0x49')](_0x37e322['message'],JSON[_0x641d('0x82')](_0x37e322[_0x641d('0x65')][_0x641d('0x83')]))},client9002);return _0x37e322;}return null;})['then'](respondWithResult(_0x358f25,null))[_0x641d('0x26')](handleError(_0x358f25,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 72e7af3..2bcc357 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 _0x9e0c=['ChatMessage','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x9e0c,0x1c9));var _0xc9e0=function(_0x56b1db,_0x4beb76){_0x56b1db=_0x56b1db-0x0;var _0x44e78a=_0x9e0c[_0x56b1db];return _0x44e78a;};'use strict';var EventEmitter=require(_0xc9e0('0x0'));var ChatMessage=require(_0xc9e0('0x1'))['db'][_0xc9e0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9e0('0x3'),'afterDestroy':_0xc9e0('0x4')};function emitEvent(_0x5e5534){return function(_0x456532,_0x1cc3d2,_0x48d713){ChatMessageEvents[_0xc9e0('0x5')](_0x5e5534+':'+_0x456532['id'],_0x456532);ChatMessageEvents['emit'](_0x5e5534,_0x456532);_0x48d713(null);};}for(var e in events){if(events[_0xc9e0('0x6')](e)){var event=events[e];ChatMessage[_0xc9e0('0x7')](e,emitEvent(event));}}module[_0xc9e0('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xc562=['hasOwnProperty','../../mysqldb','ChatMessage','save','update','emit'];(function(_0x15f964,_0x3e7bcf){var _0x317e6c=function(_0x4e4aa4){while(--_0x4e4aa4){_0x15f964['push'](_0x15f964['shift']());}};_0x317e6c(++_0x3e7bcf);}(_0xc562,0x163));var _0x2c56=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xc562[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x2c56('0x0'))['db'][_0x2c56('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c56('0x2'),'afterUpdate':_0x2c56('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d577c){return function(_0x1ebc03,_0x233e9c,_0x4f9d51){ChatMessageEvents[_0x2c56('0x4')](_0x4d577c+':'+_0x1ebc03['id'],_0x1ebc03);ChatMessageEvents[_0x2c56('0x4')](_0x4d577c,_0x1ebc03);_0x4f9d51(null);};}for(var e in events){if(events[_0x2c56('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index f256c6f..46bfaf0 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 _0x720a=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','findOne','then','update'];(function(_0x229310,_0x36482a){var _0xbcea9b=function(_0x45fddd){while(--_0x45fddd){_0x229310['push'](_0x229310['shift']());}};_0xbcea9b(++_0x36482a);}(_0x720a,0x1a5));var _0xa720=function(_0x9e3b3c,_0x2da57d){_0x9e3b3c=_0x9e3b3c-0x0;var _0xd848be=_0x720a[_0x9e3b3c];return _0xd848be;};'use strict';var _=require(_0xa720('0x0'));var util=require('util');var logger=require(_0xa720('0x1'))('api');var moment=require(_0xa720('0x2'));var BPromise=require(_0xa720('0x3'));var rp=require(_0xa720('0x4'));var fs=require('fs');var path=require(_0xa720('0x5'));var rimraf=require('rimraf');var config=require(_0xa720('0x6'));var attributes=require(_0xa720('0x7'));module['exports']=function(_0x1ab069,_0x3e45d9){return _0x1ab069[_0xa720('0x8')](_0xa720('0x9'),attributes,{'tableName':_0xa720('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xa720('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x171d41,_0x2990d9,_0x180d48){var _0x2e75f3=_0x1ab069['models'];var _0x26f826=_0x171d41[_0xa720('0xc')]({'plain':!![]});if(_0x26f826[_0xa720('0xd')][_0xa720('0xe')]()==='in'||_0x26f826[_0xa720('0xd')][_0xa720('0xe')]()===_0xa720('0xf')&&!_0x26f826[_0xa720('0x10')]&&!_[_0xa720('0x11')](_0x26f826['UserId'])){_0x2e75f3['ChatInteraction'][_0xa720('0x12')]({'where':{'id':_0x26f826['ChatInteractionId']}})[_0xa720('0x13')](function(_0x3ab312){if(_0x3ab312){_0x3ab312[_0xa720('0x14')]({'lastMsgAt':_0x26f826[_0xa720('0x15')],'lastMsgDirection':_0x26f826[_0xa720('0xd')]['toLowerCase']()});}})[_0xa720('0x16')](function(_0x512f89){console[_0xa720('0x17')](_0x512f89);});}_0x180d48();}},'charset':_0xa720('0x18'),'collate':_0xa720('0x19')});};
\ No newline at end of file
+var _0x5044=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','createdAt','catch','utf8mb4','util','api','moment'];(function(_0x5d289a,_0x352880){var _0x14bd5f=function(_0x268766){while(--_0x268766){_0x5d289a['push'](_0x5d289a['shift']());}};_0x14bd5f(++_0x352880);}(_0x5044,0xc8));var _0x4504=function(_0x4e204f,_0x417205){_0x4e204f=_0x4e204f-0x0;var _0x32e8e1=_0x5044[_0x4e204f];return _0x32e8e1;};'use strict';var _=require('lodash');var util=require(_0x4504('0x0'));var logger=require('../../config/logger')(_0x4504('0x1'));var moment=require(_0x4504('0x2'));var BPromise=require(_0x4504('0x3'));var rp=require(_0x4504('0x4'));var fs=require('fs');var path=require(_0x4504('0x5'));var rimraf=require(_0x4504('0x6'));var config=require(_0x4504('0x7'));var attributes=require(_0x4504('0x8'));module['exports']=function(_0x10b50f,_0x40195b){return _0x10b50f[_0x4504('0x9')](_0x4504('0xa'),attributes,{'tableName':_0x4504('0xb'),'paranoid':![],'indexes':[{'name':_0x4504('0xc'),'fields':[_0x4504('0xd')],'type':_0x4504('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1719c1,_0x56961c,_0xe150a1){var _0x5693ac=_0x10b50f[_0x4504('0xf')];var _0x337392=_0x1719c1[_0x4504('0x10')]({'plain':!![]});if(_0x337392[_0x4504('0x11')][_0x4504('0x12')]()==='in'||_0x337392[_0x4504('0x11')][_0x4504('0x12')]()===_0x4504('0x13')&&!_0x337392[_0x4504('0x14')]&&!_[_0x4504('0x15')](_0x337392[_0x4504('0x16')])){_0x5693ac[_0x4504('0x17')][_0x4504('0x18')]({'where':{'id':_0x337392['ChatInteractionId']}})[_0x4504('0x19')](function(_0x1f6c56){if(_0x1f6c56){_0x1f6c56['update']({'lastMsgAt':_0x337392[_0x4504('0x1a')],'lastMsgDirection':_0x337392[_0x4504('0x11')][_0x4504('0x12')]()});}})[_0x4504('0x1b')](function(_0x4c773a){console['error'](_0x4c773a);});}_0xe150a1();}},'charset':_0x4504('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 963da02..4e7e769 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 _0x1aa5=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x24f211,_0x2774a7){var _0xaab41=function(_0x34b4f7){while(--_0x34b4f7){_0x24f211['push'](_0x24f211['shift']());}};_0xaab41(++_0x2774a7);}(_0x1aa5,0x18e));var _0x51aa=function(_0x56903a,_0x32da1d){_0x56903a=_0x56903a-0x0;var _0x2d3083=_0x1aa5[_0x56903a];return _0x2d3083;};'use strict';var _=require(_0x51aa('0x0'));var util=require('util');var moment=require(_0x51aa('0x1'));var BPromise=require(_0x51aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51aa('0x3'))['db'];var utils=require(_0x51aa('0x4'));var logger=require(_0x51aa('0x5'))('rpc');var config=require(_0x51aa('0x6'));var jayson=require(_0x51aa('0x7'));var client=jayson[_0x51aa('0x8')][_0x51aa('0x9')]({'port':0x232a});config[_0x51aa('0xa')]=_[_0x51aa('0xb')](config[_0x51aa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x51aa('0xc'))(new Redis(config[_0x51aa('0xa')]));require('./chatMessage.socket')[_0x51aa('0xd')](socket);function respondWithRpcPromise(_0x42ac4c,_0x4275c9,_0x587b23){return new BPromise(function(_0x4c1c8c,_0x5245b6){return client[_0x51aa('0xe')](_0x42ac4c,_0x587b23)[_0x51aa('0xf')](function(_0x4ddfee){logger['info'](_0x51aa('0x10'),_0x4275c9,_0x51aa('0x11'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4275c9,_0x51aa('0x11'),JSON[_0x51aa('0x12')](_0x4ddfee));if(_0x4ddfee[_0x51aa('0x13')]){if(_0x4ddfee[_0x51aa('0x13')][_0x51aa('0x14')]===0x1f4){logger[_0x51aa('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4275c9,_0x4ddfee['error'][_0x51aa('0x15')]);return _0x5245b6(_0x4ddfee[_0x51aa('0x13')][_0x51aa('0x15')]);}logger[_0x51aa('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4275c9,_0x4ddfee[_0x51aa('0x13')]['message']);return _0x4c1c8c(_0x4ddfee[_0x51aa('0x13')][_0x51aa('0x15')]);}else{logger[_0x51aa('0x16')](_0x51aa('0x10'),_0x4275c9,_0x51aa('0x11'));_0x4c1c8c(_0x4ddfee['result']['message']);}})[_0x51aa('0x17')](function(_0x4fd365){logger['error'](_0x51aa('0x10'),_0x4275c9,_0x4fd365);_0x5245b6(_0x4fd365);});});}exports[_0x51aa('0x18')]=function(_0x2754bf){var _0x489c99=this;return new Promise(function(_0x3e0da7,_0x2f7cdc){return db[_0x51aa('0x19')][_0x51aa('0x1a')](_0x2754bf[_0x51aa('0x1b')],{'raw':_0x2754bf[_0x51aa('0x1c')]?_0x2754bf[_0x51aa('0x1c')][_0x51aa('0x1d')]===undefined?!![]:![]:!![]})[_0x51aa('0xf')](function(_0x108c23){logger[_0x51aa('0x16')](_0x51aa('0x18'),_0x2754bf);logger[_0x51aa('0x1e')](_0x51aa('0x18'),_0x2754bf,JSON[_0x51aa('0x12')](_0x108c23));_0x3e0da7(_0x108c23);})[_0x51aa('0x17')](function(_0x3cb151){logger[_0x51aa('0x13')](_0x51aa('0x18'),_0x3cb151[_0x51aa('0x15')],_0x2754bf);_0x2f7cdc(_0x489c99[_0x51aa('0x13')](0x1f4,_0x3cb151[_0x51aa('0x15')]));});});};
\ No newline at end of file
+var _0x84cd=['options','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','create'];(function(_0x21ff9c,_0x424a46){var _0x552861=function(_0xd0a872){while(--_0xd0a872){_0x21ff9c['push'](_0x21ff9c['shift']());}};_0x552861(++_0x424a46);}(_0x84cd,0x16b));var _0xd84c=function(_0x59b72b,_0x2537d9){_0x59b72b=_0x59b72b-0x0;var _0x389230=_0x84cd[_0x59b72b];return _0x389230;};'use strict';var _=require(_0xd84c('0x0'));var util=require(_0xd84c('0x1'));var moment=require(_0xd84c('0x2'));var BPromise=require(_0xd84c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd84c('0x4'));var db=require(_0xd84c('0x5'))['db'];var utils=require(_0xd84c('0x6'));var logger=require(_0xd84c('0x7'))(_0xd84c('0x8'));var config=require(_0xd84c('0x9'));var jayson=require(_0xd84c('0xa'));var client=jayson[_0xd84c('0xb')][_0xd84c('0xc')]({'port':0x232a});config[_0xd84c('0xd')]=_[_0xd84c('0xe')](config[_0xd84c('0xd')],{'host':_0xd84c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd84c('0xd')]));require(_0xd84c('0x10'))[_0xd84c('0x11')](socket);function respondWithRpcPromise(_0x167bb2,_0x2337cf,_0x51cb1a){return new BPromise(function(_0x3d9f9a,_0x4d6734){return client[_0xd84c('0x12')](_0x167bb2,_0x51cb1a)['then'](function(_0x328b4e){logger['info']('ChatMessage,\x20%s,\x20%s',_0x2337cf,'request\x20sent');logger[_0xd84c('0x13')](_0xd84c('0x14'),_0x2337cf,_0xd84c('0x15'),JSON[_0xd84c('0x16')](_0x328b4e));if(_0x328b4e[_0xd84c('0x17')]){if(_0x328b4e['error'][_0xd84c('0x18')]===0x1f4){logger['error'](_0xd84c('0x19'),_0x2337cf,_0x328b4e[_0xd84c('0x17')][_0xd84c('0x1a')]);return _0x4d6734(_0x328b4e[_0xd84c('0x17')][_0xd84c('0x1a')]);}logger[_0xd84c('0x17')](_0xd84c('0x19'),_0x2337cf,_0x328b4e[_0xd84c('0x17')][_0xd84c('0x1a')]);return _0x3d9f9a(_0x328b4e['error'][_0xd84c('0x1a')]);}else{logger[_0xd84c('0x1b')](_0xd84c('0x19'),_0x2337cf,_0xd84c('0x15'));_0x3d9f9a(_0x328b4e[_0xd84c('0x1c')][_0xd84c('0x1a')]);}})[_0xd84c('0x1d')](function(_0x151862){logger[_0xd84c('0x17')]('ChatMessage,\x20%s,\x20%s',_0x2337cf,_0x151862);_0x4d6734(_0x151862);});});}exports[_0xd84c('0x1e')]=function(_0x5c8f0e){var _0x2e7dbc=this;return new Promise(function(_0x43f9d1,_0x3be18f){return db[_0xd84c('0x1f')][_0xd84c('0x20')](_0x5c8f0e['body'],{'raw':_0x5c8f0e[_0xd84c('0x21')]?_0x5c8f0e[_0xd84c('0x21')][_0xd84c('0x22')]===undefined?!![]:![]:!![]})[_0xd84c('0x23')](function(_0x53f7a1){logger['info'](_0xd84c('0x1e'),_0x5c8f0e);logger['debug'](_0xd84c('0x1e'),_0x5c8f0e,JSON['stringify'](_0x53f7a1));_0x43f9d1(_0x53f7a1);})[_0xd84c('0x1d')](function(_0x43f5ea){logger[_0xd84c('0x17')](_0xd84c('0x1e'),_0x43f5ea[_0xd84c('0x1a')],_0x5c8f0e);_0x3be18f(_0x2e7dbc[_0xd84c('0x17')](0x1f4,_0x43f5ea['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index bcd3c06..bf9a15f 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 _0x3c17=['register','length','./chatMessage.events','remove','removeListener'];(function(_0x17d1c1,_0x3a5a2d){var _0x56e1de=function(_0x2fee11){while(--_0x2fee11){_0x17d1c1['push'](_0x17d1c1['shift']());}};_0x56e1de(++_0x3a5a2d);}(_0x3c17,0x1a1));var _0x73c1=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x3c17[_0x266618];return _0x54dbf5;};'use strict';var ChatMessageEvents=require(_0x73c1('0x0'));var events=['save',_0x73c1('0x1'),'update'];function createListener(_0x1a088c,_0x19c8cc){return function(_0x1ed81e){_0x19c8cc['emit'](_0x1a088c,_0x1ed81e);};}function removeListener(_0x3a00a0,_0xcbe17a){return function(){ChatMessageEvents[_0x73c1('0x2')](_0x3a00a0,_0xcbe17a);};}exports[_0x73c1('0x3')]=function(_0x48c943){for(var _0x382f82=0x0,_0x58151c=events[_0x73c1('0x4')];_0x382f82<_0x58151c;_0x382f82++){var _0x42ca06=events[_0x382f82];var _0x422176=createListener('chatMessage:'+_0x42ca06,_0x48c943);ChatMessageEvents['on'](_0x42ca06,_0x422176);}};
\ No newline at end of file
+var _0x06f4=['register','chatMessage:','./chatMessage.events','save','update','emit','removeListener'];(function(_0x21d424,_0x7c5147){var _0x504777=function(_0xa06101){while(--_0xa06101){_0x21d424['push'](_0x21d424['shift']());}};_0x504777(++_0x7c5147);}(_0x06f4,0x136));var _0x406f=function(_0x480481,_0x246ad9){_0x480481=_0x480481-0x0;var _0x2bdace=_0x06f4[_0x480481];return _0x2bdace;};'use strict';var ChatMessageEvents=require(_0x406f('0x0'));var events=[_0x406f('0x1'),'remove',_0x406f('0x2')];function createListener(_0x276a15,_0x58cd7d){return function(_0x5cab5e){_0x58cd7d[_0x406f('0x3')](_0x276a15,_0x5cab5e);};}function removeListener(_0x5ed32f,_0x32abfd){return function(){ChatMessageEvents[_0x406f('0x4')](_0x5ed32f,_0x32abfd);};}exports[_0x406f('0x5')]=function(_0x32b2bd){for(var _0x59821c=0x0,_0x1d2886=events['length'];_0x59821c<_0x1d2886;_0x59821c++){var _0x1afec4=events[_0x59821c];var _0x1c39ce=createListener(_0x406f('0x6')+_0x1afec4,_0x32b2bd);ChatMessageEvents['on'](_0x1afec4,_0x1c39ce);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 804e490..0725dee 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 _0x3dc9=['chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','tracked'];(function(_0x5f31e9,_0xf44932){var _0x165bed=function(_0xfa0e79){while(--_0xfa0e79){_0x5f31e9['push'](_0x5f31e9['shift']());}};_0x165bed(++_0xf44932);}(_0x3dc9,0x143));var _0x93dc=function(_0xd3b6f9,_0x3747f3){_0xd3b6f9=_0xd3b6f9-0x0;var _0x2009fd=_0x3dc9[_0xd3b6f9];return _0x2009fd;};'use strict';var multer=require(_0x93dc('0x0'));var util=require(_0x93dc('0x1'));var path=require('path');var timeout=require(_0x93dc('0x2'));var express=require('express');var router=express[_0x93dc('0x3')]();var fs_extra=require(_0x93dc('0x4'));var auth=require(_0x93dc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93dc('0x6'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x93dc('0x7')](),controller[_0x93dc('0x8')]);router[_0x93dc('0x9')]('/describe',auth[_0x93dc('0x7')](),controller['describe']);router['get'](_0x93dc('0xa'),auth['isAuthenticated'](),controller[_0x93dc('0xb')]);router['post']('/',auth[_0x93dc('0x7')](),interaction[_0x93dc('0xc')](_0x93dc('0xd'),_0x93dc('0xe')),controller[_0x93dc('0xf')]);router[_0x93dc('0x10')](_0x93dc('0xa'),controller[_0x93dc('0x11')]);router[_0x93dc('0x10')](_0x93dc('0x12'),auth[_0x93dc('0x7')](),controller['accept']);router['put'](_0x93dc('0x13'),auth[_0x93dc('0x7')](),controller[_0x93dc('0x14')]);router[_0x93dc('0x15')](_0x93dc('0xa'),auth['isAuthenticated'](),controller[_0x93dc('0x16')]);module[_0x93dc('0x17')]=router;
\ No newline at end of file
+var _0x02a8=['post','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','isAuthenticated','index','/describe','/:id','show'];(function(_0x419cba,_0x2173ee){var _0x5512ed=function(_0xf41bd){while(--_0xf41bd){_0x419cba['push'](_0x419cba['shift']());}};_0x5512ed(++_0x2173ee);}(_0x02a8,0xa1));var _0x802a=function(_0x27f920,_0x2b9e90){_0x27f920=_0x27f920-0x0;var _0x16ed9d=_0x02a8[_0x27f920];return _0x16ed9d;};'use strict';var multer=require(_0x802a('0x0'));var util=require(_0x802a('0x1'));var path=require(_0x802a('0x2'));var timeout=require(_0x802a('0x3'));var express=require(_0x802a('0x4'));var router=express[_0x802a('0x5')]();var fs_extra=require(_0x802a('0x6'));var auth=require(_0x802a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x802a('0x8'));router['get']('/',auth[_0x802a('0x9')](),controller[_0x802a('0xa')]);router['get'](_0x802a('0xb'),auth[_0x802a('0x9')](),controller['describe']);router['get'](_0x802a('0xc'),auth['isAuthenticated'](),controller[_0x802a('0xd')]);router[_0x802a('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x802a('0xf'),_0x802a('0x10')),controller['create']);router[_0x802a('0x11')](_0x802a('0xc'),controller[_0x802a('0x12')]);router[_0x802a('0x11')](_0x802a('0x13'),auth[_0x802a('0x9')](),controller[_0x802a('0x14')]);router[_0x802a('0x11')](_0x802a('0x15'),auth[_0x802a('0x9')](),controller[_0x802a('0x16')]);router[_0x802a('0x17')](_0x802a('0xc'),auth['isAuthenticated'](),controller[_0x802a('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 582c38e..976b448 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 _0xdaa7=['exports','medium','sequelize'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0xdaa7,0xec));var _0x7daa=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0xdaa7[_0xfc0976];return _0x23579f;};'use strict';var Sequelize=require(_0x7daa('0x0'));module[_0x7daa('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7daa('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x6aec=['sequelize','TEXT','medium'];(function(_0x382e11,_0x24daf4){var _0xcd301c=function(_0x2ceb35){while(--_0x2ceb35){_0x382e11['push'](_0x382e11['shift']());}};_0xcd301c(++_0x24daf4);}(_0x6aec,0x10e));var _0xc6ae=function(_0x39f7ce,_0x5d3ea7){_0x39f7ce=_0x39f7ce-0x0;var _0x1ae5b0=_0x6aec[_0x39f7ce];return _0x1ae5b0;};'use strict';var Sequelize=require(_0xc6ae('0x0'));module['exports']={'body':{'type':Sequelize[_0xc6ae('0x1')](_0xc6ae('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 5b4e7ac..13aa78a 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(_0x400e19,_0x28b2c6){var _0x4e31a7=function(_0x27502a){while(--_0x27502a){_0x400e19['push'](_0x400e19['shift']());}};_0x4e31a7(++_0x28b2c6);}(_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(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7a54,0x106));var _0x47a5=function(_0x513822,_0x311601){_0x513822=_0x513822-0x0;var _0x3c0d73=_0x7a54[_0x513822];return _0x3c0d73;};'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 ac00b05..8a55210 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 _0xd04e=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1f6e01,_0x4c1606){var _0x50a4a0=function(_0x3905c7){while(--_0x3905c7){_0x1f6e01['push'](_0x1f6e01['shift']());}};_0x50a4a0(++_0x4c1606);}(_0xd04e,0x10d));var _0xed04=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xd04e[_0x45bf86];return _0x1f02b7;};'use strict';var EventEmitter=require(_0xed04('0x0'));var ChatOfflineMessage=require(_0xed04('0x1'))['db'][_0xed04('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xed04('0x3')](0x0);var events={'afterCreate':_0xed04('0x4'),'afterUpdate':_0xed04('0x5'),'afterDestroy':_0xed04('0x6')};function emitEvent(_0x39af6d){return function(_0x106c9b,_0x590cd8,_0x491930){ChatOfflineMessageEvents[_0xed04('0x7')](_0x39af6d+':'+_0x106c9b['id'],_0x106c9b);ChatOfflineMessageEvents[_0xed04('0x7')](_0x39af6d,_0x106c9b);_0x491930(null);};}for(var e in events){if(events[_0xed04('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xed04('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xc058=['exports','events','ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc058,0xc7));var _0x8c05=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xc058[_0x122096];return _0x3d1966;};'use strict';var EventEmitter=require(_0x8c05('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x8c05('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8c05('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8c05('0x3'),'afterDestroy':_0x8c05('0x4')};function emitEvent(_0x254e51){return function(_0xf70219,_0x47e175,_0xf64bf){ChatOfflineMessageEvents['emit'](_0x254e51+':'+_0xf70219['id'],_0xf70219);ChatOfflineMessageEvents[_0x8c05('0x5')](_0x254e51,_0xf70219);_0xf64bf(null);};}for(var e in events){if(events[_0x8c05('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x8c05('0x7')](e,emitEvent(event));}}module[_0x8c05('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index cda59f4..afd046a 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 _0xb88c=['exports','define','ChatOfflineMessage','utf8mb4_unicode_ci','models','get','./chatOfflineMessage.attributes'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0xb88c,0x84));var _0xcb88=function(_0x1c4c1e,_0x37ae2c){_0x1c4c1e=_0x1c4c1e-0x0;var _0x308b62=_0xb88c[_0x1c4c1e];return _0x308b62;};'use strict';var attributes=require(_0xcb88('0x0'));module[_0xcb88('0x1')]=function(_0x507131){return _0x507131[_0xcb88('0x2')](_0xcb88('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcb88('0x4'),'hooks':{'afterCreate':function(_0x2fdd66,_0xe9ca69,_0xd1b25f){var _0x3f5c38=_0x507131[_0xcb88('0x5')];var _0x3ba1a0=_0x2fdd66[_0xcb88('0x6')]({'plain':!![]});_0xd1b25f();}}});};
\ No newline at end of file
+var _0x49a4=['models','get','./chatOfflineMessage.attributes','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x49a4,0x17c));var _0x449a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x49a4[_0x17d9e3];return _0x14192d;};'use strict';var attributes=require(_0x449a('0x0'));module['exports']=function(_0x66bef2){return _0x66bef2['define']('ChatOfflineMessage',attributes,{'tableName':_0x449a('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x449a('0x2'),'collate':_0x449a('0x3'),'hooks':{'afterCreate':function(_0x120bba,_0x3e5c88,_0x2d673a){var _0x599999=_0x66bef2[_0x449a('0x4')];var _0x3b7579=_0x120bba[_0x449a('0x5')]({'plain':!![]});_0x2d673a();}}});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index be30f49..6490520 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 _0xf8db=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8db,0x16b));var _0xbf8d=function(_0x2c45c4,_0x4bb43b){_0x2c45c4=_0x2c45c4-0x0;var _0x34540a=_0xf8db[_0x2c45c4];return _0x34540a;};'use strict';var _=require(_0xbf8d('0x0'));var util=require('util');var moment=require(_0xbf8d('0x1'));var BPromise=require(_0xbf8d('0x2'));var rs=require(_0xbf8d('0x3'));var fs=require('fs');var Redis=require(_0xbf8d('0x4'));var db=require(_0xbf8d('0x5'))['db'];var utils=require(_0xbf8d('0x6'));var logger=require('../../config/logger')(_0xbf8d('0x7'));var config=require(_0xbf8d('0x8'));var jayson=require(_0xbf8d('0x9'));var client=jayson[_0xbf8d('0xa')][_0xbf8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12f40d,_0x5065ad,_0x3b5a99){return new BPromise(function(_0x4f9a83,_0x55e16a){return client[_0xbf8d('0xc')](_0x12f40d,_0x3b5a99)[_0xbf8d('0xd')](function(_0x391657){logger[_0xbf8d('0xe')](_0xbf8d('0xf'),_0x5065ad,_0xbf8d('0x10'));logger[_0xbf8d('0x11')](_0xbf8d('0x12'),_0x5065ad,_0xbf8d('0x10'),JSON[_0xbf8d('0x13')](_0x391657));if(_0x391657[_0xbf8d('0x14')]){if(_0x391657[_0xbf8d('0x14')][_0xbf8d('0x15')]===0x1f4){logger[_0xbf8d('0x14')](_0xbf8d('0xf'),_0x5065ad,_0x391657[_0xbf8d('0x14')][_0xbf8d('0x16')]);return _0x55e16a(_0x391657[_0xbf8d('0x14')][_0xbf8d('0x16')]);}logger[_0xbf8d('0x14')](_0xbf8d('0xf'),_0x5065ad,_0x391657[_0xbf8d('0x14')][_0xbf8d('0x16')]);return _0x4f9a83(_0x391657[_0xbf8d('0x14')][_0xbf8d('0x16')]);}else{logger[_0xbf8d('0xe')](_0xbf8d('0xf'),_0x5065ad,_0xbf8d('0x10'));_0x4f9a83(_0x391657[_0xbf8d('0x17')][_0xbf8d('0x16')]);}})[_0xbf8d('0x18')](function(_0x1460f1){logger[_0xbf8d('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5065ad,_0x1460f1);_0x55e16a(_0x1460f1);});});}
\ No newline at end of file
+var _0xb70a=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xb70a,0x18e));var _0xab70=function(_0xaf6691,_0x10c873){_0xaf6691=_0xaf6691-0x0;var _0x23b08a=_0xb70a[_0xaf6691];return _0x23b08a;};'use strict';var _=require('lodash');var util=require(_0xab70('0x0'));var moment=require(_0xab70('0x1'));var BPromise=require(_0xab70('0x2'));var rs=require(_0xab70('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab70('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab70('0x5'))(_0xab70('0x6'));var config=require('../../config/environment');var jayson=require(_0xab70('0x7'));var client=jayson['client'][_0xab70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46e903,_0x302d78,_0x31e83b){return new BPromise(function(_0x5314ab,_0x3631e5){return client[_0xab70('0x9')](_0x46e903,_0x31e83b)[_0xab70('0xa')](function(_0xbfe54){logger[_0xab70('0xb')](_0xab70('0xc'),_0x302d78,_0xab70('0xd'));logger[_0xab70('0xe')](_0xab70('0xf'),_0x302d78,_0xab70('0xd'),JSON['stringify'](_0xbfe54));if(_0xbfe54[_0xab70('0x10')]){if(_0xbfe54[_0xab70('0x10')][_0xab70('0x11')]===0x1f4){logger['error'](_0xab70('0xc'),_0x302d78,_0xbfe54[_0xab70('0x10')][_0xab70('0x12')]);return _0x3631e5(_0xbfe54[_0xab70('0x10')]['message']);}logger[_0xab70('0x10')](_0xab70('0xc'),_0x302d78,_0xbfe54[_0xab70('0x10')]['message']);return _0x5314ab(_0xbfe54['error'][_0xab70('0x12')]);}else{logger[_0xab70('0xb')](_0xab70('0xc'),_0x302d78,'request\x20sent');_0x5314ab(_0xbfe54[_0xab70('0x13')][_0xab70('0x12')]);}})['catch'](function(_0x3c0cec){logger[_0xab70('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x302d78,_0x3c0cec);_0x3631e5(_0x3c0cec);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index ba5c0eb..b700bce 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 _0x9375=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9375,0x11f));var _0x5937=function(_0x3b3bc1,_0x38b1df){_0x3b3bc1=_0x3b3bc1-0x0;var _0x3735b0=_0x9375[_0x3b3bc1];return _0x3735b0;};'use strict';var multer=require(_0x5937('0x0'));var util=require(_0x5937('0x1'));var path=require(_0x5937('0x2'));var timeout=require(_0x5937('0x3'));var express=require(_0x5937('0x4'));var router=express['Router']();var fs_extra=require(_0x5937('0x5'));var auth=require(_0x5937('0x6'));var interaction=require(_0x5937('0x7'));var config=require(_0x5937('0x8'));var controller=require(_0x5937('0x9'));router[_0x5937('0xa')]('/',auth[_0x5937('0xb')](),controller[_0x5937('0xc')]);router[_0x5937('0xa')](_0x5937('0xd'),auth[_0x5937('0xb')](),controller[_0x5937('0xe')]);router[_0x5937('0xa')](_0x5937('0xf'),auth[_0x5937('0xb')](),controller[_0x5937('0x10')]);router['post']('/',auth[_0x5937('0xb')](),controller['create']);router[_0x5937('0x11')]('/:id',auth[_0x5937('0xb')](),controller[_0x5937('0x12')]);router[_0x5937('0x13')](_0x5937('0xf'),auth[_0x5937('0xb')](),controller['destroy']);module[_0x5937('0x14')]=router;
\ No newline at end of file
+var _0x41a2=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe','/:id'];(function(_0x1aeba3,_0xad09a9){var _0x134fa9=function(_0x3e4b3c){while(--_0x3e4b3c){_0x1aeba3['push'](_0x1aeba3['shift']());}};_0x134fa9(++_0xad09a9);}(_0x41a2,0xa9));var _0x241a=function(_0x536755,_0x3bfa50){_0x536755=_0x536755-0x0;var _0x2b9dde=_0x41a2[_0x536755];return _0x2b9dde;};'use strict';var multer=require(_0x241a('0x0'));var util=require('util');var path=require(_0x241a('0x1'));var timeout=require(_0x241a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x241a('0x3'));var auth=require(_0x241a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x241a('0x5'));var controller=require(_0x241a('0x6'));router[_0x241a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x241a('0x8'),auth['isAuthenticated'](),controller[_0x241a('0x9')]);router[_0x241a('0x7')](_0x241a('0xa'),auth[_0x241a('0xb')](),controller[_0x241a('0xc')]);router[_0x241a('0xd')]('/',auth[_0x241a('0xb')](),controller[_0x241a('0xe')]);router[_0x241a('0xf')]('/:id',auth[_0x241a('0xb')](),controller[_0x241a('0x10')]);router[_0x241a('0x11')](_0x241a('0xa'),auth[_0x241a('0xb')](),controller[_0x241a('0x12')]);module[_0x241a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index f017ba5..0dc6dff 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 _0x6893=['exports','ENUM','mouseOver','timeout','STRING','sequelize'];(function(_0x58106b,_0x230f7a){var _0x1ea838=function(_0x33b049){while(--_0x33b049){_0x58106b['push'](_0x58106b['shift']());}};_0x1ea838(++_0x230f7a);}(_0x6893,0xb3));var _0x3689=function(_0x1a675c,_0x4648bc){_0x1a675c=_0x1a675c-0x0;var _0x4ee1dc=_0x6893[_0x1a675c];return _0x4ee1dc;};'use strict';var Sequelize=require(_0x3689('0x0'));module[_0x3689('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3689('0x2')](_0x3689('0x3'),_0x3689('0x4')),'defaultValue':_0x3689('0x3')},'selector':{'type':Sequelize[_0x3689('0x5')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0347=['INTEGER','sequelize','ENUM','mouseOver'];(function(_0x5d6613,_0x276bdc){var _0xc1fc9e=function(_0x41674f){while(--_0x41674f){_0x5d6613['push'](_0x5d6613['shift']());}};_0xc1fc9e(++_0x276bdc);}(_0x0347,0x109));var _0x7034=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0347[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x7034('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7034('0x1')](_0x7034('0x2'),'timeout'),'defaultValue':_0x7034('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7034('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 65e6413..fcf6ee0 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 _0xa381=['rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','create','body','eml-format'];(function(_0x28fda7,_0x3d6bab){var _0x22e520=function(_0x354dba){while(--_0x354dba){_0x28fda7['push'](_0x28fda7['shift']());}};_0x22e520(++_0x3d6bab);}(_0xa381,0x79));var _0x1a38=function(_0x325ee2,_0xaf1371){_0x325ee2=_0x325ee2-0x0;var _0x7f2741=_0xa381[_0x325ee2];return _0x7f2741;};'use strict';var emlformat=require(_0x1a38('0x0'));var rimraf=require(_0x1a38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a38('0x2'));var moment=require(_0x1a38('0x3'));var BPromise=require(_0x1a38('0x4'));var Mustache=require('mustache');var util=require(_0x1a38('0x5'));var path=require(_0x1a38('0x6'));var sox=require(_0x1a38('0x7'));var csv=require(_0x1a38('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a38('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a38('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1a38('0xb'));var toCsv=require(_0x1a38('0x8'));var querystring=require(_0x1a38('0xc'));var Papa=require(_0x1a38('0xd'));var Redis=require('ioredis');var authService=require(_0x1a38('0xe'));var qs=require(_0x1a38('0xf'));var as=require(_0x1a38('0x10'));var hardwareService=require(_0x1a38('0x11'));var logger=require(_0x1a38('0x12'))(_0x1a38('0x13'));var utils=require(_0x1a38('0x14'));var config=require(_0x1a38('0x15'));var licenseUtil=require(_0x1a38('0x16'));var db=require(_0x1a38('0x17'))['db'];function respondWithStatusCode(_0x332dab,_0x28f875){_0x28f875=_0x28f875||0xcc;return function(_0x8c19e){if(_0x8c19e){return _0x332dab[_0x1a38('0x18')](_0x28f875);}return _0x332dab[_0x1a38('0x19')](_0x28f875)[_0x1a38('0x1a')]();};}function respondWithResult(_0x3177ec,_0x111055){_0x111055=_0x111055||0xc8;return function(_0x3392cb){if(_0x3392cb){return _0x3177ec[_0x1a38('0x19')](_0x111055)[_0x1a38('0x1b')](_0x3392cb);}};}function respondWithFilteredResult(_0x478419,_0x3a60ea){return function(_0x5d6cce){if(_0x5d6cce){var _0x54d688=typeof _0x3a60ea[_0x1a38('0x1c')]==='undefined'&&typeof _0x3a60ea[_0x1a38('0x1d')]===_0x1a38('0x1e');var _0x44a325=_0x5d6cce[_0x1a38('0x1f')];var _0x25ebb0=_0x54d688?0x0:_0x3a60ea[_0x1a38('0x1c')];var _0x408e8f=_0x54d688?_0x5d6cce[_0x1a38('0x1f')]:_0x3a60ea[_0x1a38('0x1c')]+_0x3a60ea['limit'];var _0x65f17c;if(_0x408e8f>=_0x44a325){_0x408e8f=_0x44a325;_0x65f17c=0xc8;}else{_0x65f17c=0xce;}_0x478419['status'](_0x65f17c);return _0x478419[_0x1a38('0x20')](_0x1a38('0x21'),_0x25ebb0+'-'+_0x408e8f+'/'+_0x44a325)['json'](_0x5d6cce);}return null;};}function patchUpdates(_0x45272f){return function(_0x50fccb){try{jsonpatch['apply'](_0x50fccb,_0x45272f,!![]);}catch(_0x1b87d9){return BPromise[_0x1a38('0x22')](_0x1b87d9);}return _0x50fccb[_0x1a38('0x23')]();};}function saveUpdates(_0x205c5b,_0x561fa4){return function(_0x391040){if(_0x391040){return _0x391040[_0x1a38('0x24')](_0x205c5b)[_0x1a38('0x25')](function(_0x4bfa67){return _0x4bfa67;});}return null;};}function removeEntity(_0x18912c,_0x214228){return function(_0x2877fe){if(_0x2877fe){return _0x2877fe[_0x1a38('0x26')]()[_0x1a38('0x25')](function(){_0x18912c[_0x1a38('0x19')](0xcc)[_0x1a38('0x1a')]();});}};}function handleEntityNotFound(_0x160ac1,_0x37a7d9){return function(_0x20daca){if(!_0x20daca){_0x160ac1['sendStatus'](0x194);}return _0x20daca;};}function handleError(_0x1c4d20,_0x54e4a9){_0x54e4a9=_0x54e4a9||0x1f4;return function(_0x398827){logger[_0x1a38('0x27')](_0x398827['stack']);if(_0x398827[_0x1a38('0x28')]){delete _0x398827['name'];}_0x1c4d20[_0x1a38('0x19')](_0x54e4a9)[_0x1a38('0x29')](_0x398827);};}exports[_0x1a38('0x2a')]=function(_0x59d9cc,_0x4be61f){var _0x39ac00={'raw':!![],'where':{'id':_0x59d9cc[_0x1a38('0x2b')]['id']}},_0x2a4027={};_0x2a4027[_0x1a38('0x2c')]=_[_0x1a38('0x2d')](db[_0x1a38('0x2e')][_0x1a38('0x2f')]);_0x2a4027[_0x1a38('0x30')]=_['keys'](_0x59d9cc['query']);_0x2a4027[_0x1a38('0x31')]=_[_0x1a38('0x32')](_0x2a4027[_0x1a38('0x2c')],_0x2a4027[_0x1a38('0x30')]);_0x39ac00[_0x1a38('0x33')]=_[_0x1a38('0x32')](_0x2a4027[_0x1a38('0x2c')],qs['fields'](_0x59d9cc[_0x1a38('0x30')]['fields']));_0x39ac00[_0x1a38('0x33')]=_0x39ac00[_0x1a38('0x33')][_0x1a38('0x34')]?_0x39ac00[_0x1a38('0x33')]:_0x2a4027[_0x1a38('0x2c')];if(_0x59d9cc['query'][_0x1a38('0x35')]){_0x39ac00[_0x1a38('0x36')]=[{'all':!![]}];}_0x39ac00=_[_0x1a38('0x37')]({},_0x39ac00,_0x59d9cc[_0x1a38('0x38')]);return db[_0x1a38('0x2e')][_0x1a38('0x39')](_0x39ac00)['then'](handleEntityNotFound(_0x4be61f,null))[_0x1a38('0x25')](respondWithResult(_0x4be61f,null))[_0x1a38('0x3a')](handleError(_0x4be61f,null));};exports[_0x1a38('0x3b')]=function(_0x54baf1,_0x2c8b24){return db[_0x1a38('0x2e')]['create'](_0x54baf1['body'],{})[_0x1a38('0x25')](respondWithResult(_0x2c8b24,0xc9))[_0x1a38('0x3a')](handleError(_0x2c8b24,null));};exports[_0x1a38('0x24')]=function(_0x29a32b,_0x490ab4){if(_0x29a32b['body']['id']){delete _0x29a32b[_0x1a38('0x3c')]['id'];}return db[_0x1a38('0x2e')][_0x1a38('0x39')]({'where':{'id':_0x29a32b[_0x1a38('0x2b')]['id']}})[_0x1a38('0x25')](handleEntityNotFound(_0x490ab4,null))[_0x1a38('0x25')](saveUpdates(_0x29a32b[_0x1a38('0x3c')],null))[_0x1a38('0x25')](respondWithResult(_0x490ab4,null))[_0x1a38('0x3a')](handleError(_0x490ab4,null));};exports[_0x1a38('0x26')]=function(_0x433755,_0x4971d0){return db[_0x1a38('0x2e')][_0x1a38('0x39')]({'where':{'id':_0x433755[_0x1a38('0x2b')]['id']}})[_0x1a38('0x25')](handleEntityNotFound(_0x4971d0,null))[_0x1a38('0x25')](removeEntity(_0x4971d0,null))[_0x1a38('0x3a')](handleError(_0x4971d0,null));};
\ No newline at end of file
+var _0x3c70=['util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','include','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x391802,_0xde0fd){var _0x3aa73b=function(_0x31d199){while(--_0x31d199){_0x391802['push'](_0x391802['shift']());}};_0x3aa73b(++_0xde0fd);}(_0x3c70,0x10c));var _0x03c7=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x3c70[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x03c7('0x0'));var rimraf=require(_0x03c7('0x1'));var zipdir=require(_0x03c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03c7('0x3'));var moment=require(_0x03c7('0x4'));var BPromise=require(_0x03c7('0x5'));var Mustache=require(_0x03c7('0x6'));var util=require(_0x03c7('0x7'));var path=require(_0x03c7('0x8'));var sox=require('sox');var csv=require(_0x03c7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03c7('0xa'));var _=require(_0x03c7('0xb'));var squel=require(_0x03c7('0xc'));var crypto=require('crypto');var jsforce=require(_0x03c7('0xd'));var deskjs=require(_0x03c7('0xe'));var toCsv=require(_0x03c7('0x9'));var querystring=require('querystring');var Papa=require(_0x03c7('0xf'));var Redis=require('ioredis');var authService=require(_0x03c7('0x10'));var qs=require(_0x03c7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03c7('0x12'));var logger=require(_0x03c7('0x13'))(_0x03c7('0x14'));var utils=require(_0x03c7('0x15'));var config=require(_0x03c7('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe78fd1,_0xb1b40a){_0xb1b40a=_0xb1b40a||0xcc;return function(_0x49697f){if(_0x49697f){return _0xe78fd1[_0x03c7('0x17')](_0xb1b40a);}return _0xe78fd1[_0x03c7('0x18')](_0xb1b40a)[_0x03c7('0x19')]();};}function respondWithResult(_0x2c57af,_0x1d9668){_0x1d9668=_0x1d9668||0xc8;return function(_0x5adce3){if(_0x5adce3){return _0x2c57af[_0x03c7('0x18')](_0x1d9668)['json'](_0x5adce3);}};}function respondWithFilteredResult(_0xdc48a7,_0x1ae657){return function(_0x4e3ff5){if(_0x4e3ff5){var _0x9a3264=typeof _0x1ae657[_0x03c7('0x1a')]===_0x03c7('0x1b')&&typeof _0x1ae657['limit']===_0x03c7('0x1b');var _0x6c852d=_0x4e3ff5[_0x03c7('0x1c')];var _0xdb40cc=_0x9a3264?0x0:_0x1ae657[_0x03c7('0x1a')];var _0x2946d7=_0x9a3264?_0x4e3ff5['count']:_0x1ae657['offset']+_0x1ae657[_0x03c7('0x1d')];var _0x2cd27c;if(_0x2946d7>=_0x6c852d){_0x2946d7=_0x6c852d;_0x2cd27c=0xc8;}else{_0x2cd27c=0xce;}_0xdc48a7[_0x03c7('0x18')](_0x2cd27c);return _0xdc48a7[_0x03c7('0x1e')](_0x03c7('0x1f'),_0xdb40cc+'-'+_0x2946d7+'/'+_0x6c852d)['json'](_0x4e3ff5);}return null;};}function patchUpdates(_0x1e3de1){return function(_0x1e6fae){try{jsonpatch['apply'](_0x1e6fae,_0x1e3de1,!![]);}catch(_0x4e8062){return BPromise['reject'](_0x4e8062);}return _0x1e6fae[_0x03c7('0x20')]();};}function saveUpdates(_0x734b3b,_0x3a5da2){return function(_0x50b316){if(_0x50b316){return _0x50b316[_0x03c7('0x21')](_0x734b3b)[_0x03c7('0x22')](function(_0x3c960a){return _0x3c960a;});}return null;};}function removeEntity(_0x4d6a9c,_0xfa2d9e){return function(_0x4795e7){if(_0x4795e7){return _0x4795e7[_0x03c7('0x23')]()['then'](function(){_0x4d6a9c[_0x03c7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270ee3,_0x304337){return function(_0x246f9d){if(!_0x246f9d){_0x270ee3['sendStatus'](0x194);}return _0x246f9d;};}function handleError(_0x3b1cbb,_0x2a4ac4){_0x2a4ac4=_0x2a4ac4||0x1f4;return function(_0x222912){logger[_0x03c7('0x24')](_0x222912['stack']);if(_0x222912['name']){delete _0x222912[_0x03c7('0x25')];}_0x3b1cbb['status'](_0x2a4ac4)[_0x03c7('0x26')](_0x222912);};}exports[_0x03c7('0x27')]=function(_0x51929b,_0x24a331){var _0x462f08={'raw':!![],'where':{'id':_0x51929b[_0x03c7('0x28')]['id']}},_0x153be5={};_0x153be5[_0x03c7('0x29')]=_[_0x03c7('0x2a')](db[_0x03c7('0x2b')][_0x03c7('0x2c')]);_0x153be5[_0x03c7('0x2d')]=_[_0x03c7('0x2a')](_0x51929b[_0x03c7('0x2d')]);_0x153be5['filters']=_[_0x03c7('0x2e')](_0x153be5[_0x03c7('0x29')],_0x153be5[_0x03c7('0x2d')]);_0x462f08['attributes']=_['intersection'](_0x153be5['model'],qs[_0x03c7('0x2f')](_0x51929b['query'][_0x03c7('0x2f')]));_0x462f08[_0x03c7('0x30')]=_0x462f08[_0x03c7('0x30')]['length']?_0x462f08[_0x03c7('0x30')]:_0x153be5[_0x03c7('0x29')];if(_0x51929b[_0x03c7('0x2d')]['includeAll']){_0x462f08[_0x03c7('0x31')]=[{'all':!![]}];}_0x462f08=_[_0x03c7('0x32')]({},_0x462f08,_0x51929b['options']);return db[_0x03c7('0x2b')][_0x03c7('0x33')](_0x462f08)['then'](handleEntityNotFound(_0x24a331,null))[_0x03c7('0x22')](respondWithResult(_0x24a331,null))[_0x03c7('0x34')](handleError(_0x24a331,null));};exports[_0x03c7('0x35')]=function(_0x48a30b,_0x2309de){return db[_0x03c7('0x2b')][_0x03c7('0x35')](_0x48a30b[_0x03c7('0x36')],{})['then'](respondWithResult(_0x2309de,0xc9))[_0x03c7('0x34')](handleError(_0x2309de,null));};exports['update']=function(_0x132c1b,_0xc29c21){if(_0x132c1b[_0x03c7('0x36')]['id']){delete _0x132c1b[_0x03c7('0x36')]['id'];}return db[_0x03c7('0x2b')][_0x03c7('0x33')]({'where':{'id':_0x132c1b['params']['id']}})['then'](handleEntityNotFound(_0xc29c21,null))[_0x03c7('0x22')](saveUpdates(_0x132c1b[_0x03c7('0x36')],null))['then'](respondWithResult(_0xc29c21,null))[_0x03c7('0x34')](handleError(_0xc29c21,null));};exports[_0x03c7('0x23')]=function(_0x346335,_0x7c8ba5){return db[_0x03c7('0x2b')][_0x03c7('0x33')]({'where':{'id':_0x346335[_0x03c7('0x28')]['id']}})['then'](handleEntityNotFound(_0x7c8ba5,null))['then'](removeEntity(_0x7c8ba5,null))[_0x03c7('0x34')](handleError(_0x7c8ba5,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index bb389eb..5e96605 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 _0x98f0=['bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','util','../../config/logger','moment'];(function(_0x1d5dde,_0x151614){var _0x47e4ab=function(_0x3d54b5){while(--_0x3d54b5){_0x1d5dde['push'](_0x1d5dde['shift']());}};_0x47e4ab(++_0x151614);}(_0x98f0,0x1dd));var _0x098f=function(_0x429fe2,_0x21c22e){_0x429fe2=_0x429fe2-0x0;var _0x53aa98=_0x98f0[_0x429fe2];return _0x53aa98;};'use strict';var _=require('lodash');var util=require(_0x098f('0x0'));var logger=require(_0x098f('0x1'))('api');var moment=require(_0x098f('0x2'));var BPromise=require(_0x098f('0x3'));var rp=require(_0x098f('0x4'));var fs=require('fs');var path=require(_0x098f('0x5'));var rimraf=require('rimraf');var config=require(_0x098f('0x6'));var attributes=require(_0x098f('0x7'));module[_0x098f('0x8')]=function(_0x3db1e9,_0x49a2b2){return _0x3db1e9[_0x098f('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d45=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0x4677ee,_0x5d58dd){var _0x3dda22=function(_0x16c414){while(--_0x16c414){_0x4677ee['push'](_0x4677ee['shift']());}};_0x3dda22(++_0x5d58dd);}(_0x6d45,0xa8));var _0x56d4=function(_0x2efdef,_0x80ec4f){_0x2efdef=_0x2efdef-0x0;var _0x22fa0c=_0x6d45[_0x2efdef];return _0x22fa0c;};'use strict';var _=require(_0x56d4('0x0'));var util=require(_0x56d4('0x1'));var logger=require('../../config/logger')(_0x56d4('0x2'));var moment=require(_0x56d4('0x3'));var BPromise=require(_0x56d4('0x4'));var rp=require(_0x56d4('0x5'));var fs=require('fs');var path=require(_0x56d4('0x6'));var rimraf=require(_0x56d4('0x7'));var config=require(_0x56d4('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x56d4('0x9')]=function(_0x2f9401,_0x9b809b){return _0x2f9401['define'](_0x56d4('0xa'),attributes,{'tableName':_0x56d4('0xb'),'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 51aa6b3..03ea4ad 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 _0x795e=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x48de38,_0x3a0a5c){var _0x3a8a8b=function(_0x1264ed){while(--_0x1264ed){_0x48de38['push'](_0x48de38['shift']());}};_0x3a8a8b(++_0x3a0a5c);}(_0x795e,0x177));var _0xe795=function(_0x496ade,_0x443c5a){_0x496ade=_0x496ade-0x0;var _0x41bef1=_0x795e[_0x496ade];return _0x41bef1;};'use strict';var _=require(_0xe795('0x0'));var util=require(_0xe795('0x1'));var moment=require(_0xe795('0x2'));var BPromise=require(_0xe795('0x3'));var rs=require(_0xe795('0x4'));var fs=require('fs');var Redis=require(_0xe795('0x5'));var db=require(_0xe795('0x6'))['db'];var utils=require(_0xe795('0x7'));var logger=require('../../config/logger')(_0xe795('0x8'));var config=require(_0xe795('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe795('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a6c52,_0x175513,_0x38cf7a){return new BPromise(function(_0x26d37d,_0x347262){return client[_0xe795('0xb')](_0x4a6c52,_0x38cf7a)[_0xe795('0xc')](function(_0x26800d){logger['info'](_0xe795('0xd'),_0x175513,_0xe795('0xe'));logger[_0xe795('0xf')](_0xe795('0x10'),_0x175513,'request\x20sent',JSON['stringify'](_0x26800d));if(_0x26800d[_0xe795('0x11')]){if(_0x26800d[_0xe795('0x11')][_0xe795('0x12')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x175513,_0x26800d[_0xe795('0x11')][_0xe795('0x13')]);return _0x347262(_0x26800d['error'][_0xe795('0x13')]);}logger['error'](_0xe795('0xd'),_0x175513,_0x26800d['error'][_0xe795('0x13')]);return _0x26d37d(_0x26800d['error'][_0xe795('0x13')]);}else{logger[_0xe795('0x14')](_0xe795('0xd'),_0x175513,_0xe795('0xe'));_0x26d37d(_0x26800d[_0xe795('0x15')]['message']);}})[_0xe795('0x16')](function(_0x145770){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x175513,_0x145770);_0x347262(_0x145770);});});}
\ No newline at end of file
+var _0xb2f1=['../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4d82e1,_0x5ac72b){var _0x5f3bd9=function(_0x5380db){while(--_0x5380db){_0x4d82e1['push'](_0x4d82e1['shift']());}};_0x5f3bd9(++_0x5ac72b);}(_0xb2f1,0x6a));var _0x1b2f=function(_0x33f099,_0x21f5cd){_0x33f099=_0x33f099-0x0;var _0x109851=_0xb2f1[_0x33f099];return _0x109851;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var moment=require(_0x1b2f('0x2'));var BPromise=require(_0x1b2f('0x3'));var rs=require(_0x1b2f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b2f('0x5'))['db'];var utils=require(_0x1b2f('0x6'));var logger=require(_0x1b2f('0x7'))(_0x1b2f('0x8'));var config=require(_0x1b2f('0x9'));var jayson=require(_0x1b2f('0xa'));var client=jayson[_0x1b2f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37192e,_0x2fbc52,_0x256316){return new BPromise(function(_0x383bbe,_0x7dc463){return client[_0x1b2f('0xc')](_0x37192e,_0x256316)[_0x1b2f('0xd')](function(_0x25491b){logger[_0x1b2f('0xe')](_0x1b2f('0xf'),_0x2fbc52,_0x1b2f('0x10'));logger[_0x1b2f('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2fbc52,'request\x20sent',JSON[_0x1b2f('0x12')](_0x25491b));if(_0x25491b[_0x1b2f('0x13')]){if(_0x25491b[_0x1b2f('0x13')][_0x1b2f('0x14')]===0x1f4){logger[_0x1b2f('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x2fbc52,_0x25491b['error'][_0x1b2f('0x15')]);return _0x7dc463(_0x25491b['error'][_0x1b2f('0x15')]);}logger['error'](_0x1b2f('0xf'),_0x2fbc52,_0x25491b[_0x1b2f('0x13')][_0x1b2f('0x15')]);return _0x383bbe(_0x25491b[_0x1b2f('0x13')][_0x1b2f('0x15')]);}else{logger['info'](_0x1b2f('0xf'),_0x2fbc52,_0x1b2f('0x10'));_0x383bbe(_0x25491b['result'][_0x1b2f('0x15')]);}})[_0x1b2f('0x16')](function(_0x5d6009){logger[_0x1b2f('0x13')](_0x1b2f('0xf'),_0x2fbc52,_0x5d6009);_0x7dc463(_0x5d6009);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 1667e0a..946b923 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 _0x038b=['isAuthenticated','/:id','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','show','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x038b,0x114));var _0xb038=function(_0x15609b,_0x203633){_0x15609b=_0x15609b-0x0;var _0x40c5e8=_0x038b[_0x15609b];return _0x40c5e8;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0x8')]);router[_0xb038('0x9')]('/',auth[_0xb038('0xa')](),controller['create']);router['put'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['update']);router['delete'](_0xb038('0xb'),auth[_0xb038('0xa')](),controller['destroy']);module[_0xb038('0xc')]=router;
\ No newline at end of file
+var _0x9c5a=['/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','update'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xc41898,_0x4b7fa8){_0xc41898=_0xc41898-0x0;var _0x3f1d80=_0x9c5a[_0xc41898];return _0x3f1d80;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./chatProactiveAction.controller');router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9c5('0xb')]);router[_0xa9c5('0xc')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xd')]);router['delete'](_0xa9c5('0xe'),auth[_0xa9c5('0x9')](),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 7b4fd05..87c3cc5 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 _0x9cfe=['ENUM','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9cfe,0x96));var _0xe9cf=function(_0x3c8113,_0x788e9f){_0x3c8113=_0x3c8113-0x0;var _0x24079b=_0x9cfe[_0x3c8113];return _0x24079b;};'use strict';var Sequelize=require(_0xe9cf('0x0'));module[_0xe9cf('0x1')]={'name':{'type':Sequelize[_0xe9cf('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe9cf('0x2')]},'timeout':{'type':Sequelize[_0xe9cf('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe9cf('0x4')]('rrmemory',_0xe9cf('0x5'),_0xe9cf('0x6'))}};
\ No newline at end of file
+var _0x8e92=['rrmemory','roundrobin','sequelize','name','ENUM'];(function(_0x413786,_0x50e1a0){var _0x39365a=function(_0x398bbb){while(--_0x398bbb){_0x413786['push'](_0x413786['shift']());}};_0x39365a(++_0x50e1a0);}(_0x8e92,0x147));var _0x28e9=function(_0x254691,_0x2618e5){_0x254691=_0x254691-0x0;var _0x2bccd5=_0x8e92[_0x254691];return _0x2bccd5;};'use strict';var Sequelize=require(_0x28e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x28e9('0x1'),'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[_0x28e9('0x2')](_0x28e9('0x3'),'beepall',_0x28e9('0x4'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 6944d45..a3698d3 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 _0xf148=['stack','index','map','rawAttributes','fieldName','type','key','name','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatQueue','includeAll','rows','show','params','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','order','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','QueryTypes','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','omit','isArray','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','sendStatus'];(function(_0xf8bbac,_0x3c9c1d){var _0x4e19dd=function(_0x108e8e){while(--_0x108e8e){_0xf8bbac['push'](_0xf8bbac['shift']());}};_0x4e19dd(++_0x3c9c1d);}(_0xf148,0x184));var _0x8f14=function(_0x528eaf,_0x4cc41c){_0x528eaf=_0x528eaf-0x0;var _0x39922d=_0xf148[_0x528eaf];return _0x39922d;};'use strict';var emlformat=require(_0x8f14('0x0'));var rimraf=require(_0x8f14('0x1'));var zipdir=require(_0x8f14('0x2'));var jsonpatch=require(_0x8f14('0x3'));var rp=require(_0x8f14('0x4'));var moment=require('moment');var BPromise=require(_0x8f14('0x5'));var Mustache=require(_0x8f14('0x6'));var util=require(_0x8f14('0x7'));var path=require(_0x8f14('0x8'));var sox=require(_0x8f14('0x9'));var csv=require(_0x8f14('0xa'));var ejs=require(_0x8f14('0xb'));var fs=require('fs');var fs_extra=require(_0x8f14('0xc'));var _=require('lodash');var squel=require(_0x8f14('0xd'));var crypto=require('crypto');var jsforce=require(_0x8f14('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f14('0xf'));var Redis=require('ioredis');var authService=require(_0x8f14('0x10'));var qs=require(_0x8f14('0x11'));var as=require(_0x8f14('0x12'));var hardwareService=require(_0x8f14('0x13'));var logger=require(_0x8f14('0x14'))(_0x8f14('0x15'));var utils=require(_0x8f14('0x16'));var config=require(_0x8f14('0x17'));var licenseUtil=require(_0x8f14('0x18'));var db=require(_0x8f14('0x19'))['db'];config['redis']=_[_0x8f14('0x1a')](config[_0x8f14('0x1b')],{'host':_0x8f14('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f14('0x1b')]));require('./chatQueue.socket')[_0x8f14('0x1d')](socket);var jayson=require(_0x8f14('0x1e'));var client=jayson[_0x8f14('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cc3b3,_0x245bc0,_0x4b1a10,_0x496373){return new BPromise(function(_0x529bc0,_0x2d3568){var _0xc2f0e=_0x496373||client;return _0xc2f0e[_0x8f14('0x20')](_0x4cc3b3,_0x4b1a10)[_0x8f14('0x21')](function(_0x4992a8){logger['info'](_0x8f14('0x22'),_0x245bc0,_0x8f14('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x245bc0,'request\x20sent',JSON['stringify'](_0x4992a8));if(_0x4992a8[_0x8f14('0x24')]){if(_0x4992a8[_0x8f14('0x24')]['code']===0x1f4){logger[_0x8f14('0x24')](_0x8f14('0x22'),_0x245bc0,_0x4992a8[_0x8f14('0x24')][_0x8f14('0x25')]);return _0x2d3568(_0x4992a8[_0x8f14('0x24')][_0x8f14('0x25')]);}logger['error'](_0x8f14('0x22'),_0x245bc0,_0x4992a8[_0x8f14('0x24')][_0x8f14('0x25')]);return _0x529bc0(_0x4992a8[_0x8f14('0x24')][_0x8f14('0x25')]);}else{logger[_0x8f14('0x26')](_0x8f14('0x22'),_0x245bc0,_0x8f14('0x23'));_0x529bc0(_0x4992a8[_0x8f14('0x27')][_0x8f14('0x25')]);}})[_0x8f14('0x28')](function(_0x35aaaa){logger[_0x8f14('0x24')]('ChatQueue,\x20%s,\x20%s',_0x245bc0,_0x35aaaa);_0x2d3568(_0x35aaaa);});});}function respondWithStatusCode(_0x39763f,_0x4418c8){_0x4418c8=_0x4418c8||0xcc;return function(_0x4cf151){if(_0x4cf151){return _0x39763f['sendStatus'](_0x4418c8);}return _0x39763f[_0x8f14('0x29')](_0x4418c8)['end']();};}function respondWithResult(_0x1cf33e,_0x207364){_0x207364=_0x207364||0xc8;return function(_0x434a69){if(_0x434a69){return _0x1cf33e[_0x8f14('0x29')](_0x207364)[_0x8f14('0x2a')](_0x434a69);}};}function respondWithFilteredResult(_0x4d3e5f,_0x455888){return function(_0x208dc0){if(_0x208dc0){var _0x1502dd=typeof _0x455888[_0x8f14('0x2b')]===_0x8f14('0x2c')&&typeof _0x455888['limit']==='undefined';var _0x5ba989=_0x208dc0[_0x8f14('0x2d')];var _0xafc65=_0x1502dd?0x0:_0x455888[_0x8f14('0x2b')];var _0x1f2edc=_0x1502dd?_0x208dc0[_0x8f14('0x2d')]:_0x455888[_0x8f14('0x2b')]+_0x455888[_0x8f14('0x2e')];var _0x2b9bf1;if(_0x1f2edc>=_0x5ba989){_0x1f2edc=_0x5ba989;_0x2b9bf1=0xc8;}else{_0x2b9bf1=0xce;}_0x4d3e5f[_0x8f14('0x29')](_0x2b9bf1);return _0x4d3e5f[_0x8f14('0x2f')](_0x8f14('0x30'),_0xafc65+'-'+_0x1f2edc+'/'+_0x5ba989)['json'](_0x208dc0);}return null;};}function patchUpdates(_0x1bd39c){return function(_0x101b67){try{jsonpatch[_0x8f14('0x31')](_0x101b67,_0x1bd39c,!![]);}catch(_0x3f428a){return BPromise[_0x8f14('0x32')](_0x3f428a);}return _0x101b67['save']();};}function saveUpdates(_0x330b44,_0x313587){return function(_0x7e10cd){if(_0x7e10cd){return _0x7e10cd[_0x8f14('0x33')](_0x330b44)[_0x8f14('0x21')](function(_0x88876d){return _0x88876d;});}return null;};}function removeEntity(_0x2722f2,_0x104f44){return function(_0x2b2b6d){if(_0x2b2b6d){return _0x2b2b6d[_0x8f14('0x34')]()[_0x8f14('0x21')](function(){var _0x985e05=_0x2b2b6d[_0x8f14('0x35')]({'plain':!![]});var _0x583a66=_0x8f14('0x36');return db['UserProfileResource'][_0x8f14('0x34')]({'where':{'type':_0x583a66,'resourceId':_0x985e05['id']}})[_0x8f14('0x21')](function(){return _0x2b2b6d;});})[_0x8f14('0x21')](function(){_0x2722f2[_0x8f14('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59e6fb,_0x244d61){return function(_0x217972){if(!_0x217972){_0x59e6fb[_0x8f14('0x37')](0x194);}return _0x217972;};}function handleError(_0x2630df,_0x324d00){_0x324d00=_0x324d00||0x1f4;return function(_0x108d17){logger[_0x8f14('0x24')](_0x108d17[_0x8f14('0x38')]);if(_0x108d17['name']){delete _0x108d17['name'];}_0x2630df['status'](_0x324d00)['send'](_0x108d17);};}exports[_0x8f14('0x39')]=function(_0xe435b2,_0x2c3ff5){var _0x45cb73={},_0x251e59={},_0x77dd8e={'count':0x0,'rows':[]};var _0x1ab42b=_[_0x8f14('0x3a')](db['ChatQueue'][_0x8f14('0x3b')],function(_0x5808d4){return{'name':_0x5808d4[_0x8f14('0x3c')],'type':_0x5808d4[_0x8f14('0x3d')][_0x8f14('0x3e')]};});_0x251e59['model']=_[_0x8f14('0x3a')](_0x1ab42b,_0x8f14('0x3f'));_0x251e59['query']=_[_0x8f14('0x40')](_0xe435b2[_0x8f14('0x41')]);_0x251e59['filters']=_[_0x8f14('0x42')](_0x251e59[_0x8f14('0x43')],_0x251e59[_0x8f14('0x41')]);_0x45cb73[_0x8f14('0x44')]=_[_0x8f14('0x42')](_0x251e59[_0x8f14('0x43')],qs['fields'](_0xe435b2[_0x8f14('0x41')]['fields']));_0x45cb73['attributes']=_0x45cb73['attributes'][_0x8f14('0x45')]?_0x45cb73['attributes']:_0x251e59[_0x8f14('0x43')];if(!_0xe435b2['query'][_0x8f14('0x46')](_0x8f14('0x47'))){_0x45cb73['limit']=qs[_0x8f14('0x2e')](_0xe435b2['query']['limit']);_0x45cb73[_0x8f14('0x2b')]=qs[_0x8f14('0x2b')](_0xe435b2[_0x8f14('0x41')][_0x8f14('0x2b')]);}_0x45cb73['order']=qs['sort'](_0xe435b2['query'][_0x8f14('0x48')]);_0x45cb73[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_[_0x8f14('0x4b')](_0xe435b2[_0x8f14('0x41')],_0x251e59['filters']),_0x1ab42b);if(_0xe435b2[_0x8f14('0x41')][_0x8f14('0x4c')]){_0x45cb73[_0x8f14('0x49')]=_[_0x8f14('0x4d')](_0x45cb73['where'],{'$or':_[_0x8f14('0x3a')](_0x1ab42b,function(_0x4975cf){if(_0x4975cf['type']!==_0x8f14('0x4e')){var _0x23e1db={};_0x23e1db[_0x4975cf['name']]={'$like':'%'+_0xe435b2[_0x8f14('0x41')]['filter']+'%'};return _0x23e1db;}})});}_0x45cb73=_[_0x8f14('0x4d')]({},_0x45cb73,_0xe435b2[_0x8f14('0x4f')]);var _0x6525b6={'where':_0x45cb73[_0x8f14('0x49')]};return db[_0x8f14('0x50')][_0x8f14('0x2d')](_0x6525b6)[_0x8f14('0x21')](function(_0x52e43e){_0x77dd8e['count']=_0x52e43e;if(_0xe435b2['query'][_0x8f14('0x51')]){_0x45cb73['include']=[{'all':!![]}];}return db[_0x8f14('0x50')]['findAll'](_0x45cb73);})['then'](function(_0x92e8dc){_0x77dd8e[_0x8f14('0x52')]=_0x92e8dc;return _0x77dd8e;})[_0x8f14('0x21')](respondWithFilteredResult(_0x2c3ff5,_0x45cb73))['catch'](handleError(_0x2c3ff5,null));};exports[_0x8f14('0x53')]=function(_0xdd4124,_0x435182){var _0x333b19={'raw':!![],'where':{'id':_0xdd4124[_0x8f14('0x54')]['id']}},_0x3affca={};_0x3affca[_0x8f14('0x43')]=_[_0x8f14('0x40')](db[_0x8f14('0x50')][_0x8f14('0x3b')]);_0x3affca[_0x8f14('0x41')]=_[_0x8f14('0x40')](_0xdd4124[_0x8f14('0x41')]);_0x3affca[_0x8f14('0x4a')]=_[_0x8f14('0x42')](_0x3affca['model'],_0x3affca['query']);_0x333b19[_0x8f14('0x44')]=_[_0x8f14('0x42')](_0x3affca['model'],qs['fields'](_0xdd4124[_0x8f14('0x41')][_0x8f14('0x55')]));_0x333b19[_0x8f14('0x44')]=_0x333b19['attributes'][_0x8f14('0x45')]?_0x333b19[_0x8f14('0x44')]:_0x3affca[_0x8f14('0x43')];if(_0xdd4124['query']['includeAll']){_0x333b19[_0x8f14('0x56')]=[{'all':!![]}];}_0x333b19=_[_0x8f14('0x4d')]({},_0x333b19,_0xdd4124[_0x8f14('0x4f')]);return db[_0x8f14('0x50')][_0x8f14('0x57')](_0x333b19)[_0x8f14('0x21')](handleEntityNotFound(_0x435182,null))[_0x8f14('0x21')](respondWithResult(_0x435182,null))[_0x8f14('0x28')](handleError(_0x435182,null));};exports[_0x8f14('0x58')]=function(_0xd99ea6,_0x38f0e7){return db[_0x8f14('0x50')][_0x8f14('0x58')](_0xd99ea6[_0x8f14('0x59')],{})[_0x8f14('0x21')](function(_0x124e69){var _0xba2d5c=_0xd99ea6[_0x8f14('0x5a')][_0x8f14('0x35')]({'plain':!![]});if(!_0xba2d5c)throw new Error(_0x8f14('0x5b'));if(_0xba2d5c[_0x8f14('0x5c')]===_0x8f14('0x5a')){var _0x35d449=_0x124e69[_0x8f14('0x35')]({'plain':!![]});var _0x3532dc=_0x8f14('0x36');return db['UserProfileSection']['find']({'where':{'name':_0x3532dc,'userProfileId':_0xba2d5c[_0x8f14('0x5d')]},'raw':!![]})[_0x8f14('0x21')](function(_0x25611d){if(_0x25611d&&_0x25611d[_0x8f14('0x5e')]===0x0){return db[_0x8f14('0x5f')]['create']({'name':_0x35d449[_0x8f14('0x3f')],'resourceId':_0x35d449['id'],'type':_0x25611d[_0x8f14('0x3f')],'sectionId':_0x25611d['id']},{})[_0x8f14('0x21')](function(){return _0x124e69;});}else{return _0x124e69;}})[_0x8f14('0x28')](function(_0xb6a93a){logger[_0x8f14('0x24')](_0x8f14('0x60'),_0xb6a93a);throw _0xb6a93a;});}return _0x124e69;})[_0x8f14('0x21')](respondWithResult(_0x38f0e7,0xc9))['catch'](handleError(_0x38f0e7,null));};exports[_0x8f14('0x33')]=function(_0x1032a8,_0x536942){if(_0x1032a8[_0x8f14('0x59')]['id']){delete _0x1032a8[_0x8f14('0x59')]['id'];}return db['ChatQueue'][_0x8f14('0x57')]({'where':{'id':_0x1032a8[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x536942,null))[_0x8f14('0x21')](saveUpdates(_0x1032a8[_0x8f14('0x59')],null))['then'](respondWithResult(_0x536942,null))[_0x8f14('0x28')](handleError(_0x536942,null));};exports[_0x8f14('0x34')]=function(_0xe8b0ba,_0x829160){return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0xe8b0ba[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x829160,null))['then'](removeEntity(_0x829160,null))[_0x8f14('0x28')](handleError(_0x829160,null));};exports['describe']=function(_0x10d71b,_0x4fcf93){return db['ChatQueue'][_0x8f14('0x61')]()[_0x8f14('0x21')](respondWithResult(_0x4fcf93,null))[_0x8f14('0x28')](handleError(_0x4fcf93,null));};exports['getMembers']=function(_0x2f5118,_0x4002b4,_0xe6c40c){var _0x9f8c17={'raw':!![],'where':{}},_0x5e6c5e={},_0x216373;return db[_0x8f14('0x50')][_0x8f14('0x62')]({'where':{'id':_0x2f5118[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x4002b4,null))[_0x8f14('0x21')](function(_0x218d2c){if(_0x218d2c){_0x216373=_0x218d2c[_0x8f14('0x35')]({'plain':!![]});_0x5e6c5e[_0x8f14('0x43')]=_[_0x8f14('0x40')](db[_0x8f14('0x63')][_0x8f14('0x3b')]);_0x5e6c5e[_0x8f14('0x41')]=_[_0x8f14('0x40')](_0x2f5118[_0x8f14('0x41')]);_0x5e6c5e[_0x8f14('0x4a')]=_['intersection'](_0x5e6c5e[_0x8f14('0x43')],_0x5e6c5e[_0x8f14('0x41')]);_0x9f8c17[_0x8f14('0x44')]=_['intersection'](_0x5e6c5e['model'],qs[_0x8f14('0x55')](_0x2f5118[_0x8f14('0x41')]['fields']));_0x9f8c17[_0x8f14('0x44')]=_0x9f8c17['attributes'][_0x8f14('0x45')]?_0x9f8c17['attributes']:_0x5e6c5e[_0x8f14('0x43')];if(!_0x2f5118['query'][_0x8f14('0x46')](_0x8f14('0x47'))){_0x9f8c17[_0x8f14('0x2e')]=qs[_0x8f14('0x2e')](_0x2f5118[_0x8f14('0x41')][_0x8f14('0x2e')]);_0x9f8c17[_0x8f14('0x2b')]=qs[_0x8f14('0x2b')](_0x2f5118[_0x8f14('0x41')]['offset']);}_0x9f8c17[_0x8f14('0x64')]=qs['sort'](_0x2f5118['query'][_0x8f14('0x48')]);_0x9f8c17[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_[_0x8f14('0x4b')](_0x2f5118[_0x8f14('0x41')],_0x5e6c5e['filters']));_0x9f8c17[_0x8f14('0x49')]['ChatQueueId']=_0x218d2c['id'];if(_0x2f5118[_0x8f14('0x41')][_0x8f14('0x4c')]){_0x9f8c17[_0x8f14('0x49')]=_[_0x8f14('0x4d')](_0x9f8c17[_0x8f14('0x49')],{'$or':_['map'](_0x9f8c17[_0x8f14('0x44')],function(_0x4f3844){var _0x4e2c7a={};_0x4e2c7a[_0x4f3844]={'$like':'%'+_0x2f5118[_0x8f14('0x41')][_0x8f14('0x4c')]+'%'};return _0x4e2c7a;})});}_0x9f8c17=_[_0x8f14('0x4d')]({},_0x9f8c17,_0x2f5118['options']);return db['UserChatQueue'][_0x8f14('0x65')](_0x9f8c17);}})[_0x8f14('0x21')](function(_0x182fa2){if(_0x182fa2){return db[_0x8f14('0x66')]['findAndCountAll']({'where':{'id':_['map'](_0x182fa2,_0x8f14('0x67')),'role':_0x8f14('0x68')},'attributes':['id',_0x8f14('0x3f'),_0x8f14('0x69'),_0x8f14('0x6a'),_0x8f14('0x6b')]});}})[_0x8f14('0x21')](function(_0x494611){if(_0x494611){return{'count':_0x494611[_0x8f14('0x2d')],'rows':_['map'](_0x494611['rows'],function(_0x182396){return{'membername':_0x182396[_0x8f14('0x3f')],'UserId':_0x182396['id'],'queue_name':_0x216373[_0x8f14('0x3f')],'ChatQueueId':_0x216373['id'],'interface':util[_0x8f14('0x6c')](_0x8f14('0x6d'),_0x8f14('0x6e'),_0x182396['name']),'penalty':0x0,'paused':_0x182396[_0x8f14('0x69')],'createdAt':_0x182396[_0x8f14('0x6b')],'updatedAt':_0x182396[_0x8f14('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8f14('0x21')](respondWithFilteredResult(_0x4002b4,_0x9f8c17))[_0x8f14('0x28')](handleError(_0x4002b4,null));};exports[_0x8f14('0x6f')]=function(_0x1e4fb3,_0x5ac69f,_0x1ba288){var _0x9e7df2={};var _0x305488={};var _0x3912ee;var _0x3dc3bb;return db[_0x8f14('0x50')][_0x8f14('0x62')]({'where':{'id':_0x1e4fb3[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x5ac69f,null))[_0x8f14('0x21')](function(_0x51005e){if(_0x51005e){_0x3912ee=_0x51005e;_0x305488[_0x8f14('0x43')]=_[_0x8f14('0x40')](db[_0x8f14('0x70')]['rawAttributes']);_0x305488[_0x8f14('0x41')]=_['keys'](_0x1e4fb3[_0x8f14('0x41')]);_0x305488[_0x8f14('0x4a')]=_[_0x8f14('0x42')](_0x305488[_0x8f14('0x43')],_0x305488[_0x8f14('0x41')]);_0x9e7df2['attributes']=_[_0x8f14('0x42')](_0x305488[_0x8f14('0x43')],qs[_0x8f14('0x55')](_0x1e4fb3[_0x8f14('0x41')][_0x8f14('0x55')]));_0x9e7df2[_0x8f14('0x44')]=_0x9e7df2[_0x8f14('0x44')][_0x8f14('0x45')]?_0x9e7df2[_0x8f14('0x44')]:_0x305488['model'];_0x9e7df2['order']=qs[_0x8f14('0x48')](_0x1e4fb3['query'][_0x8f14('0x48')]);_0x9e7df2[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_[_0x8f14('0x4b')](_0x1e4fb3[_0x8f14('0x41')],_0x305488[_0x8f14('0x4a')]));if(_0x1e4fb3[_0x8f14('0x41')][_0x8f14('0x4c')]){_0x9e7df2['where']=_[_0x8f14('0x4d')](_0x9e7df2[_0x8f14('0x49')],{'$or':_[_0x8f14('0x3a')](_0x9e7df2[_0x8f14('0x44')],function(_0x489916){var _0x291870={};_0x291870[_0x489916]={'$like':'%'+_0x1e4fb3[_0x8f14('0x41')][_0x8f14('0x4c')]+'%'};return _0x291870;})});}_0x9e7df2=_['merge']({},_0x9e7df2,_0x1e4fb3[_0x8f14('0x4f')]);return _0x3912ee[_0x8f14('0x6f')](_0x9e7df2);}})[_0x8f14('0x21')](function(_0x3cb4eb){if(_0x3cb4eb){_0x3dc3bb=_0x3cb4eb[_0x8f14('0x45')];if(!_0x1e4fb3['query'][_0x8f14('0x46')](_0x8f14('0x47'))){_0x9e7df2['limit']=qs['limit'](_0x1e4fb3[_0x8f14('0x41')][_0x8f14('0x2e')]);_0x9e7df2[_0x8f14('0x2b')]=qs['offset'](_0x1e4fb3['query']['offset']);}return _0x3912ee['getTeams'](_0x9e7df2);}})[_0x8f14('0x21')](function(_0x801bc9){if(_0x801bc9){return _0x801bc9?{'count':_0x3dc3bb,'rows':_0x801bc9}:null;}})[_0x8f14('0x21')](respondWithResult(_0x5ac69f,null))['catch'](handleError(_0x5ac69f,null));};exports[_0x8f14('0x71')]=function(_0x3c5543,_0x5e7331,_0x17d0df){var _0x1fc5c8=_0x3c5543['body'][_0x8f14('0x72')];return db[_0x8f14('0x70')][_0x8f14('0x65')]({'where':{'id':_0x1fc5c8},'attributes':['id'],'include':[{'model':db[_0x8f14('0x66')],'as':'Agents','attributes':['id',_0x8f14('0x3f'),_0x8f14('0x73'),_0x8f14('0x74'),_0x8f14('0x75')],'raw':!![]}]})[_0x8f14('0x21')](function(_0x62f766){if(_0x62f766){var _0x29242d=_[_0x8f14('0x76')](_0x62f766,function(_0x3472d6){var _0x3c3de1=_0x3472d6['get']({'plain':!![]});return _0x3c3de1[_0x8f14('0x77')];});return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0x3c5543[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](function(_0x2937d2){return db[_0x8f14('0x78')][_0x8f14('0x79')](function(_0x1e5293){return _0x2937d2[_0x8f14('0x71')](_0x1fc5c8,{'transaction':_0x1e5293})[_0x8f14('0x21')](function(){return BPromise[_0x8f14('0x7a')](_0x29242d,function(_0x35361a){return db[_0x8f14('0x63')][_0x8f14('0x7b')]({'where':{'UserId':_0x35361a['id'],'ChatQueueId':_0x3c5543[_0x8f14('0x54')]['id']},'transaction':_0x1e5293});});})[_0x8f14('0x21')](function(){_0x29242d[_0x8f14('0x7c')](function(_0x39354d){socket['emit'](_0x8f14('0x7d'),{'UserId':_0x39354d['id'],'ChatQueueId':_0x2937d2['id']});});});});});}})[_0x8f14('0x21')](respondWithStatusCode(_0x5e7331,null))['catch'](handleError(_0x5e7331,null));};exports['removeTeams']=function(_0x3d1b0e,_0x5048f1,_0x2d1c92){return db[_0x8f14('0x70')][_0x8f14('0x65')]({'where':{'id':_0x3d1b0e[_0x8f14('0x41')][_0x8f14('0x72')]},'attributes':['id'],'include':[{'model':db[_0x8f14('0x66')],'as':_0x8f14('0x77'),'attributes':['id'],'raw':!![]}]})[_0x8f14('0x21')](handleEntityNotFound(_0x5048f1,null))[_0x8f14('0x21')](function(_0x323211){var _0x15dc65=_[_0x8f14('0x3a')](_0x323211,'id');var _0x3f08dd=[];var _0x245c2c=[];var _0x46b971=squel[_0x8f14('0x7e')]();_0x46b971[_0x8f14('0x7f')](_0x8f14('0x80'))[_0x8f14('0x81')](_0x8f14('0x82'),'tq')['join'](_0x8f14('0x83'),'ut',_0x8f14('0x84'))[_0x8f14('0x49')](_0x8f14('0x85'),_0x3d1b0e[_0x8f14('0x54')]['id']);for(var _0x3d79bc=0x0;_0x3d79bc<_0x323211[_0x8f14('0x45')];_0x3d79bc+=0x1){let _0x1ebf57=_0x323211[_0x3d79bc];for(var _0x1ce66c=0x0;_0x1ce66c<_0x1ebf57[_0x8f14('0x77')]['length'];_0x1ce66c+=0x1){let _0x548c87=_0x1ebf57[_0x8f14('0x77')][_0x1ce66c];var _0x2a60d1=_0x46b971['clone']();_0x2a60d1[_0x8f14('0x49')]('ut.UserId\x20=\x20?',_0x548c87['id']);_0x245c2c['push'](db['sequelize']['query'](_0x2a60d1['toString'](),{'type':db[_0x8f14('0x78')][_0x8f14('0x86')]['SELECT']})[_0x8f14('0x21')](function(_0x406e12){if(_0x406e12[_0x8f14('0x45')]===0x1){return _0x548c87['id'];}else{var _0x366a1b=_[_0x8f14('0x87')](_[_0x8f14('0x3a')](_0x406e12,_0x8f14('0x88')),function(_0x1cdea1){return _[_0x8f14('0x89')](_0x15dc65,_0x1cdea1);});if(_0x366a1b){return _0x548c87['id'];}}}));}}return BPromise[_0x8f14('0x8a')](_0x245c2c)[_0x8f14('0x21')](function(_0x2296d2){_0x3f08dd=_(_0x3f08dd)[_0x8f14('0x8b')](_0x2296d2)[_0x8f14('0x8c')]()['value']();return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0x3d1b0e[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](function(_0x473dbf){return db[_0x8f14('0x78')][_0x8f14('0x79')](function(_0x138748){return _0x473dbf[_0x8f14('0x8d')](_0x3d1b0e[_0x8f14('0x41')]['ids'],{'transaction':_0x138748})['then'](function(){if(!_[_0x8f14('0x8e')](_0x3f08dd)){return _0x473dbf[_0x8f14('0x8f')](_0x3f08dd,{'transaction':_0x138748});}})[_0x8f14('0x21')](function(){_0x3f08dd[_0x8f14('0x7c')](function(_0x3ef81a){socket[_0x8f14('0x90')](_0x8f14('0x91'),{'UserId':_0x3ef81a,'ChatQueueId':_0x473dbf['id']});});});});});});})[_0x8f14('0x21')](respondWithStatusCode(_0x5048f1,null))[_0x8f14('0x28')](handleError(_0x5048f1,null));};exports['addAgents']=function(_0x22cb20,_0x5e7332,_0x553998){return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0x22cb20[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x5e7332,null))['then'](function(_0xcc105c){if(_0xcc105c){return _0xcc105c['addAgents'](_0x22cb20[_0x8f14('0x59')]['ids'],_[_0x8f14('0x92')](_0x22cb20['body'],[_0x8f14('0x72'),'id'])||{})['spread'](function(_0x10dbdf){for(var _0x5e82e9=0x0;_0x5e82e9<_0x22cb20[_0x8f14('0x59')][_0x8f14('0x72')][_0x8f14('0x45')];_0x5e82e9+=0x1){socket[_0x8f14('0x90')](_0x8f14('0x7d'),{'UserId':Number(_0x22cb20[_0x8f14('0x59')][_0x8f14('0x72')][_0x5e82e9]),'ChatQueueId':Number(_0x22cb20[_0x8f14('0x54')]['id'])});}return _0x10dbdf;});}})[_0x8f14('0x21')](respondWithResult(_0x5e7332,null))[_0x8f14('0x28')](handleError(_0x5e7332,null));};exports[_0x8f14('0x8f')]=function(_0x1fa090,_0x56d42e,_0x61036f){return db[_0x8f14('0x50')][_0x8f14('0x57')]({'where':{'id':_0x1fa090[_0x8f14('0x54')]['id']}})[_0x8f14('0x21')](handleEntityNotFound(_0x56d42e,null))[_0x8f14('0x21')](function(_0x213d27){if(_0x213d27){return _0x213d27[_0x8f14('0x8f')](_0x1fa090[_0x8f14('0x41')][_0x8f14('0x72')])[_0x8f14('0x21')](function(){if(_[_0x8f14('0x93')](_0x1fa090[_0x8f14('0x41')][_0x8f14('0x72')])){for(var _0x37e131=0x0;_0x37e131<_0x1fa090['query'][_0x8f14('0x72')][_0x8f14('0x45')];_0x37e131+=0x1){socket[_0x8f14('0x90')](_0x8f14('0x91'),{'UserId':Number(_0x1fa090[_0x8f14('0x41')][_0x8f14('0x72')][_0x37e131]),'ChatQueueId':Number(_0x1fa090[_0x8f14('0x54')]['id'])});}}else{socket[_0x8f14('0x90')]('userChatQueue:remove',{'UserId':Number(_0x1fa090[_0x8f14('0x41')][_0x8f14('0x72')]),'ChatQueueId':Number(_0x1fa090[_0x8f14('0x54')]['id'])});}});}})[_0x8f14('0x21')](respondWithStatusCode(_0x56d42e,null))[_0x8f14('0x28')](handleError(_0x56d42e,null));};exports['getAgents']=function(_0x32c321,_0x5a67b2,_0x10ee1b){var _0x187346={};var _0x1dbcf2={};var _0x514627;var _0x7ba174;return db[_0x8f14('0x50')][_0x8f14('0x62')]({'where':{'id':_0x32c321['params']['id']}})['then'](handleEntityNotFound(_0x5a67b2,null))['then'](function(_0x2f08cf){if(_0x2f08cf){_0x514627=_0x2f08cf;_0x1dbcf2[_0x8f14('0x43')]=_[_0x8f14('0x40')](db[_0x8f14('0x66')]['rawAttributes']);_0x1dbcf2[_0x8f14('0x41')]=_[_0x8f14('0x40')](_0x32c321[_0x8f14('0x41')]);_0x1dbcf2[_0x8f14('0x4a')]=_['intersection'](_0x1dbcf2['model'],_0x1dbcf2[_0x8f14('0x41')]);_0x187346['attributes']=_[_0x8f14('0x42')](_0x1dbcf2[_0x8f14('0x43')],qs[_0x8f14('0x55')](_0x32c321[_0x8f14('0x41')][_0x8f14('0x55')]));_0x187346[_0x8f14('0x44')]=_0x187346[_0x8f14('0x44')]['length']?_0x187346[_0x8f14('0x44')]:_0x1dbcf2[_0x8f14('0x43')];_0x187346[_0x8f14('0x64')]=qs[_0x8f14('0x48')](_0x32c321[_0x8f14('0x41')][_0x8f14('0x48')]);_0x187346[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_[_0x8f14('0x4b')](_0x32c321[_0x8f14('0x41')],_0x1dbcf2[_0x8f14('0x4a')]));if(_0x32c321[_0x8f14('0x41')]['filter']){_0x187346['where']=_['merge'](_0x187346['where'],{'$or':_[_0x8f14('0x3a')](_0x187346['attributes'],function(_0x373776){var _0x3ebf6e={};_0x3ebf6e[_0x373776]={'$like':'%'+_0x32c321[_0x8f14('0x41')]['filter']+'%'};return _0x3ebf6e;})});}_0x187346=_[_0x8f14('0x4d')]({},_0x187346,_0x32c321['options']);return _0x514627['getAgents'](_0x187346);}})[_0x8f14('0x21')](function(_0x2454af){if(_0x2454af){_0x7ba174=_0x2454af[_0x8f14('0x45')];if(!_0x32c321[_0x8f14('0x41')]['hasOwnProperty'](_0x8f14('0x47'))){_0x187346[_0x8f14('0x2e')]=qs[_0x8f14('0x2e')](_0x32c321['query'][_0x8f14('0x2e')]);_0x187346['offset']=qs[_0x8f14('0x2b')](_0x32c321['query']['offset']);}return _0x514627['getAgents'](_0x187346);}})[_0x8f14('0x21')](function(_0x3ed80d){if(_0x3ed80d){return _0x3ed80d?{'count':_0x7ba174,'rows':_0x3ed80d}:null;}})[_0x8f14('0x21')](respondWithResult(_0x5a67b2,null))[_0x8f14('0x28')](handleError(_0x5a67b2,null));};
\ No newline at end of file
+var _0x9cfe=['findOrCreate','forEach','userChatQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','ids','emit','userChatQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','name','send','index','fieldName','type','model','map','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','ChatQueue','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','addTeams','Agents','online','interface','flatMap','sequelize','each'];(function(_0x177131,_0x37d940){var _0x4cec84=function(_0x17ea48){while(--_0x17ea48){_0x177131['push'](_0x177131['shift']());}};_0x4cec84(++_0x37d940);}(_0x9cfe,0x1d9));var _0xe9cf=function(_0x1c8141,_0x32f8d7){_0x1c8141=_0x1c8141-0x0;var _0x126697=_0x9cfe[_0x1c8141];return _0x126697;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9cf('0x1'));var rp=require(_0xe9cf('0x2'));var moment=require(_0xe9cf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe9cf('0x4'));var util=require(_0xe9cf('0x5'));var path=require(_0xe9cf('0x6'));var sox=require(_0xe9cf('0x7'));var csv=require(_0xe9cf('0x8'));var ejs=require(_0xe9cf('0x9'));var fs=require('fs');var fs_extra=require(_0xe9cf('0xa'));var _=require('lodash');var squel=require(_0xe9cf('0xb'));var crypto=require(_0xe9cf('0xc'));var jsforce=require(_0xe9cf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe9cf('0x8'));var querystring=require(_0xe9cf('0xe'));var Papa=require(_0xe9cf('0xf'));var Redis=require('ioredis');var authService=require(_0xe9cf('0x10'));var qs=require(_0xe9cf('0x11'));var as=require(_0xe9cf('0x12'));var hardwareService=require(_0xe9cf('0x13'));var logger=require(_0xe9cf('0x14'))(_0xe9cf('0x15'));var utils=require('../../config/utils');var config=require(_0xe9cf('0x16'));var licenseUtil=require(_0xe9cf('0x17'));var db=require(_0xe9cf('0x18'))['db'];config[_0xe9cf('0x19')]=_['defaults'](config['redis'],{'host':_0xe9cf('0x1a'),'port':0x18eb});var socket=require(_0xe9cf('0x1b'))(new Redis(config[_0xe9cf('0x19')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0xe9cf('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x676d1e,_0x5e5120,_0x6f8f2e,_0x1938da){return new BPromise(function(_0x50b82d,_0x31214e){var _0x55c9e4=_0x1938da||client;return _0x55c9e4['request'](_0x676d1e,_0x6f8f2e)['then'](function(_0x10459b){logger[_0xe9cf('0x1d')](_0xe9cf('0x1e'),_0x5e5120,_0xe9cf('0x1f'));logger[_0xe9cf('0x20')](_0xe9cf('0x21'),_0x5e5120,_0xe9cf('0x1f'),JSON['stringify'](_0x10459b));if(_0x10459b[_0xe9cf('0x22')]){if(_0x10459b[_0xe9cf('0x22')][_0xe9cf('0x23')]===0x1f4){logger[_0xe9cf('0x22')](_0xe9cf('0x1e'),_0x5e5120,_0x10459b[_0xe9cf('0x22')][_0xe9cf('0x24')]);return _0x31214e(_0x10459b[_0xe9cf('0x22')][_0xe9cf('0x24')]);}logger[_0xe9cf('0x22')]('ChatQueue,\x20%s,\x20%s',_0x5e5120,_0x10459b[_0xe9cf('0x22')]['message']);return _0x50b82d(_0x10459b[_0xe9cf('0x22')][_0xe9cf('0x24')]);}else{logger[_0xe9cf('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x5e5120,_0xe9cf('0x1f'));_0x50b82d(_0x10459b[_0xe9cf('0x25')][_0xe9cf('0x24')]);}})[_0xe9cf('0x26')](function(_0x50f860){logger[_0xe9cf('0x22')](_0xe9cf('0x1e'),_0x5e5120,_0x50f860);_0x31214e(_0x50f860);});});}function respondWithStatusCode(_0x175630,_0x316fe0){_0x316fe0=_0x316fe0||0xcc;return function(_0x2ea283){if(_0x2ea283){return _0x175630[_0xe9cf('0x27')](_0x316fe0);}return _0x175630[_0xe9cf('0x28')](_0x316fe0)[_0xe9cf('0x29')]();};}function respondWithResult(_0x555319,_0x51058e){_0x51058e=_0x51058e||0xc8;return function(_0x336e50){if(_0x336e50){return _0x555319[_0xe9cf('0x28')](_0x51058e)[_0xe9cf('0x2a')](_0x336e50);}};}function respondWithFilteredResult(_0x543e04,_0x2390cc){return function(_0x3d1239){if(_0x3d1239){var _0x2a8fcd=typeof _0x2390cc['offset']===_0xe9cf('0x2b')&&typeof _0x2390cc[_0xe9cf('0x2c')]===_0xe9cf('0x2b');var _0x2bb102=_0x3d1239[_0xe9cf('0x2d')];var _0x4086b0=_0x2a8fcd?0x0:_0x2390cc[_0xe9cf('0x2e')];var _0x56d2c8=_0x2a8fcd?_0x3d1239[_0xe9cf('0x2d')]:_0x2390cc[_0xe9cf('0x2e')]+_0x2390cc['limit'];var _0x16a62f;if(_0x56d2c8>=_0x2bb102){_0x56d2c8=_0x2bb102;_0x16a62f=0xc8;}else{_0x16a62f=0xce;}_0x543e04[_0xe9cf('0x28')](_0x16a62f);return _0x543e04[_0xe9cf('0x2f')](_0xe9cf('0x30'),_0x4086b0+'-'+_0x56d2c8+'/'+_0x2bb102)[_0xe9cf('0x2a')](_0x3d1239);}return null;};}function patchUpdates(_0x4fb3f4){return function(_0x14785d){try{jsonpatch[_0xe9cf('0x31')](_0x14785d,_0x4fb3f4,!![]);}catch(_0x4cba8f){return BPromise[_0xe9cf('0x32')](_0x4cba8f);}return _0x14785d[_0xe9cf('0x33')]();};}function saveUpdates(_0x35c43c,_0x2f194c){return function(_0x32fdcd){if(_0x32fdcd){return _0x32fdcd[_0xe9cf('0x34')](_0x35c43c)[_0xe9cf('0x35')](function(_0x39d8ad){return _0x39d8ad;});}return null;};}function removeEntity(_0x48bb0b,_0x10ee5a){return function(_0x44a06e){if(_0x44a06e){return _0x44a06e[_0xe9cf('0x36')]()[_0xe9cf('0x35')](function(){var _0x5bc8d9=_0x44a06e[_0xe9cf('0x37')]({'plain':!![]});var _0x267225=_0xe9cf('0x38');return db[_0xe9cf('0x39')][_0xe9cf('0x36')]({'where':{'type':_0x267225,'resourceId':_0x5bc8d9['id']}})[_0xe9cf('0x35')](function(){return _0x44a06e;});})[_0xe9cf('0x35')](function(){_0x48bb0b['status'](0xcc)[_0xe9cf('0x29')]();});}};}function handleEntityNotFound(_0x727371,_0x309371){return function(_0x2d354b){if(!_0x2d354b){_0x727371[_0xe9cf('0x27')](0x194);}return _0x2d354b;};}function handleError(_0x1e6bc0,_0x80b27b){_0x80b27b=_0x80b27b||0x1f4;return function(_0x48e366){logger[_0xe9cf('0x22')](_0x48e366['stack']);if(_0x48e366[_0xe9cf('0x3a')]){delete _0x48e366[_0xe9cf('0x3a')];}_0x1e6bc0[_0xe9cf('0x28')](_0x80b27b)[_0xe9cf('0x3b')](_0x48e366);};}exports[_0xe9cf('0x3c')]=function(_0x47dae9,_0x390729){var _0x36c788={},_0x1c5349={},_0x203d1e={'count':0x0,'rows':[]};var _0x32df8a=_['map'](db['ChatQueue']['rawAttributes'],function(_0x14bc2e){return{'name':_0x14bc2e[_0xe9cf('0x3d')],'type':_0x14bc2e[_0xe9cf('0x3e')]['key']};});_0x1c5349[_0xe9cf('0x3f')]=_[_0xe9cf('0x40')](_0x32df8a,_0xe9cf('0x3a'));_0x1c5349['query']=_[_0xe9cf('0x41')](_0x47dae9['query']);_0x1c5349[_0xe9cf('0x42')]=_[_0xe9cf('0x43')](_0x1c5349['model'],_0x1c5349['query']);_0x36c788[_0xe9cf('0x44')]=_[_0xe9cf('0x43')](_0x1c5349[_0xe9cf('0x3f')],qs['fields'](_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x46')]));_0x36c788[_0xe9cf('0x44')]=_0x36c788[_0xe9cf('0x44')][_0xe9cf('0x47')]?_0x36c788[_0xe9cf('0x44')]:_0x1c5349[_0xe9cf('0x3f')];if(!_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x48')](_0xe9cf('0x49'))){_0x36c788['limit']=qs[_0xe9cf('0x2c')](_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x2c')]);_0x36c788['offset']=qs['offset'](_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x2e')]);}_0x36c788[_0xe9cf('0x4a')]=qs['sort'](_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x4b')]);_0x36c788[_0xe9cf('0x4c')]=qs[_0xe9cf('0x42')](_[_0xe9cf('0x4d')](_0x47dae9[_0xe9cf('0x45')],_0x1c5349[_0xe9cf('0x42')]),_0x32df8a);if(_0x47dae9[_0xe9cf('0x45')]['filter']){_0x36c788[_0xe9cf('0x4c')]=_[_0xe9cf('0x4e')](_0x36c788[_0xe9cf('0x4c')],{'$or':_[_0xe9cf('0x40')](_0x32df8a,function(_0x4b4929){if(_0x4b4929['type']!=='VIRTUAL'){var _0x1cd7f7={};_0x1cd7f7[_0x4b4929[_0xe9cf('0x3a')]]={'$like':'%'+_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x4f')]+'%'};return _0x1cd7f7;}})});}_0x36c788=_[_0xe9cf('0x4e')]({},_0x36c788,_0x47dae9[_0xe9cf('0x50')]);var _0x30364d={'where':_0x36c788[_0xe9cf('0x4c')]};return db['ChatQueue'][_0xe9cf('0x2d')](_0x30364d)[_0xe9cf('0x35')](function(_0x110f5b){_0x203d1e[_0xe9cf('0x2d')]=_0x110f5b;if(_0x47dae9[_0xe9cf('0x45')][_0xe9cf('0x51')]){_0x36c788[_0xe9cf('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0xe9cf('0x53')](_0x36c788);})[_0xe9cf('0x35')](function(_0x105341){_0x203d1e[_0xe9cf('0x54')]=_0x105341;return _0x203d1e;})[_0xe9cf('0x35')](respondWithFilteredResult(_0x390729,_0x36c788))['catch'](handleError(_0x390729,null));};exports[_0xe9cf('0x55')]=function(_0x1c8b62,_0x19fef3){var _0x363eb4={'raw':!![],'where':{'id':_0x1c8b62['params']['id']}},_0x196594={};_0x196594[_0xe9cf('0x3f')]=_[_0xe9cf('0x41')](db[_0xe9cf('0x56')][_0xe9cf('0x57')]);_0x196594[_0xe9cf('0x45')]=_['keys'](_0x1c8b62[_0xe9cf('0x45')]);_0x196594[_0xe9cf('0x42')]=_[_0xe9cf('0x43')](_0x196594[_0xe9cf('0x3f')],_0x196594['query']);_0x363eb4[_0xe9cf('0x44')]=_[_0xe9cf('0x43')](_0x196594[_0xe9cf('0x3f')],qs[_0xe9cf('0x46')](_0x1c8b62[_0xe9cf('0x45')][_0xe9cf('0x46')]));_0x363eb4[_0xe9cf('0x44')]=_0x363eb4[_0xe9cf('0x44')][_0xe9cf('0x47')]?_0x363eb4[_0xe9cf('0x44')]:_0x196594[_0xe9cf('0x3f')];if(_0x1c8b62[_0xe9cf('0x45')][_0xe9cf('0x51')]){_0x363eb4[_0xe9cf('0x52')]=[{'all':!![]}];}_0x363eb4=_[_0xe9cf('0x4e')]({},_0x363eb4,_0x1c8b62[_0xe9cf('0x50')]);return db[_0xe9cf('0x56')][_0xe9cf('0x58')](_0x363eb4)[_0xe9cf('0x35')](handleEntityNotFound(_0x19fef3,null))[_0xe9cf('0x35')](respondWithResult(_0x19fef3,null))['catch'](handleError(_0x19fef3,null));};exports[_0xe9cf('0x59')]=function(_0x17e84f,_0x2306a8){return db[_0xe9cf('0x56')]['create'](_0x17e84f[_0xe9cf('0x5a')],{})[_0xe9cf('0x35')](function(_0x1fc712){var _0x27f29e=_0x17e84f[_0xe9cf('0x5b')][_0xe9cf('0x37')]({'plain':!![]});if(!_0x27f29e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27f29e[_0xe9cf('0x5c')]==='user'){var _0x35682a=_0x1fc712[_0xe9cf('0x37')]({'plain':!![]});var _0x2a96f6=_0xe9cf('0x38');return db[_0xe9cf('0x5d')][_0xe9cf('0x58')]({'where':{'name':_0x2a96f6,'userProfileId':_0x27f29e['userProfileId']},'raw':!![]})[_0xe9cf('0x35')](function(_0xa0c2db){if(_0xa0c2db&&_0xa0c2db[_0xe9cf('0x5e')]===0x0){return db[_0xe9cf('0x39')]['create']({'name':_0x35682a[_0xe9cf('0x3a')],'resourceId':_0x35682a['id'],'type':_0xa0c2db[_0xe9cf('0x3a')],'sectionId':_0xa0c2db['id']},{})['then'](function(){return _0x1fc712;});}else{return _0x1fc712;}})[_0xe9cf('0x26')](function(_0x532a46){logger[_0xe9cf('0x22')](_0xe9cf('0x5f'),_0x532a46);throw _0x532a46;});}return _0x1fc712;})[_0xe9cf('0x35')](respondWithResult(_0x2306a8,0xc9))['catch'](handleError(_0x2306a8,null));};exports[_0xe9cf('0x34')]=function(_0x3c9c20,_0x3b4c4e){if(_0x3c9c20[_0xe9cf('0x5a')]['id']){delete _0x3c9c20[_0xe9cf('0x5a')]['id'];}return db[_0xe9cf('0x56')][_0xe9cf('0x58')]({'where':{'id':_0x3c9c20[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x3b4c4e,null))[_0xe9cf('0x35')](saveUpdates(_0x3c9c20[_0xe9cf('0x5a')],null))[_0xe9cf('0x35')](respondWithResult(_0x3b4c4e,null))[_0xe9cf('0x26')](handleError(_0x3b4c4e,null));};exports['destroy']=function(_0xc1a963,_0x2549a6){return db['ChatQueue'][_0xe9cf('0x58')]({'where':{'id':_0xc1a963['params']['id']}})['then'](handleEntityNotFound(_0x2549a6,null))[_0xe9cf('0x35')](removeEntity(_0x2549a6,null))[_0xe9cf('0x26')](handleError(_0x2549a6,null));};exports[_0xe9cf('0x61')]=function(_0x424d41,_0x348184){return db[_0xe9cf('0x56')]['describe']()[_0xe9cf('0x35')](respondWithResult(_0x348184,null))[_0xe9cf('0x26')](handleError(_0x348184,null));};exports[_0xe9cf('0x62')]=function(_0x492fc3,_0x41fc23,_0x1dd452){var _0x163b73={'raw':!![],'where':{}},_0x47b216={},_0x2d5d1e;return db['ChatQueue'][_0xe9cf('0x63')]({'where':{'id':_0x492fc3[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x41fc23,null))['then'](function(_0x4e9d1f){if(_0x4e9d1f){_0x2d5d1e=_0x4e9d1f[_0xe9cf('0x37')]({'plain':!![]});_0x47b216[_0xe9cf('0x3f')]=_[_0xe9cf('0x41')](db['UserChatQueue'][_0xe9cf('0x57')]);_0x47b216[_0xe9cf('0x45')]=_[_0xe9cf('0x41')](_0x492fc3['query']);_0x47b216[_0xe9cf('0x42')]=_['intersection'](_0x47b216[_0xe9cf('0x3f')],_0x47b216[_0xe9cf('0x45')]);_0x163b73['attributes']=_[_0xe9cf('0x43')](_0x47b216[_0xe9cf('0x3f')],qs['fields'](_0x492fc3[_0xe9cf('0x45')]['fields']));_0x163b73[_0xe9cf('0x44')]=_0x163b73[_0xe9cf('0x44')][_0xe9cf('0x47')]?_0x163b73['attributes']:_0x47b216[_0xe9cf('0x3f')];if(!_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x48')](_0xe9cf('0x49'))){_0x163b73[_0xe9cf('0x2c')]=qs['limit'](_0x492fc3[_0xe9cf('0x45')]['limit']);_0x163b73['offset']=qs[_0xe9cf('0x2e')](_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x2e')]);}_0x163b73['order']=qs[_0xe9cf('0x4b')](_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x4b')]);_0x163b73[_0xe9cf('0x4c')]=qs['filters'](_['pick'](_0x492fc3[_0xe9cf('0x45')],_0x47b216['filters']));_0x163b73['where'][_0xe9cf('0x64')]=_0x4e9d1f['id'];if(_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x4f')]){_0x163b73['where']=_[_0xe9cf('0x4e')](_0x163b73[_0xe9cf('0x4c')],{'$or':_['map'](_0x163b73[_0xe9cf('0x44')],function(_0x2a4f69){var _0x1d385c={};_0x1d385c[_0x2a4f69]={'$like':'%'+_0x492fc3[_0xe9cf('0x45')][_0xe9cf('0x4f')]+'%'};return _0x1d385c;})});}_0x163b73=_['merge']({},_0x163b73,_0x492fc3[_0xe9cf('0x50')]);return db[_0xe9cf('0x65')][_0xe9cf('0x53')](_0x163b73);}})['then'](function(_0x218a14){if(_0x218a14){return db[_0xe9cf('0x66')][_0xe9cf('0x67')]({'where':{'id':_[_0xe9cf('0x40')](_0x218a14,'UserId'),'role':_0xe9cf('0x68')},'attributes':['id',_0xe9cf('0x3a'),_0xe9cf('0x69'),_0xe9cf('0x6a'),_0xe9cf('0x6b')]});}})[_0xe9cf('0x35')](function(_0x2e7547){if(_0x2e7547){return{'count':_0x2e7547[_0xe9cf('0x2d')],'rows':_[_0xe9cf('0x40')](_0x2e7547[_0xe9cf('0x54')],function(_0x3209e2){return{'membername':_0x3209e2['name'],'UserId':_0x3209e2['id'],'queue_name':_0x2d5d1e[_0xe9cf('0x3a')],'ChatQueueId':_0x2d5d1e['id'],'interface':util[_0xe9cf('0x6c')](_0xe9cf('0x6d'),'SIP',_0x3209e2[_0xe9cf('0x3a')]),'penalty':0x0,'paused':_0x3209e2[_0xe9cf('0x69')],'createdAt':_0x3209e2[_0xe9cf('0x6b')],'updatedAt':_0x3209e2[_0xe9cf('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe9cf('0x35')](respondWithFilteredResult(_0x41fc23,_0x163b73))[_0xe9cf('0x26')](handleError(_0x41fc23,null));};exports['getTeams']=function(_0x41afce,_0xc21223,_0x18ee52){var _0x3a5fe6={};var _0x47fd4f={};var _0x4ff45d;var _0x29c808;return db[_0xe9cf('0x56')]['findOne']({'where':{'id':_0x41afce[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0xc21223,null))['then'](function(_0xedac78){if(_0xedac78){_0x4ff45d=_0xedac78;_0x47fd4f[_0xe9cf('0x3f')]=_['keys'](db[_0xe9cf('0x6e')][_0xe9cf('0x57')]);_0x47fd4f[_0xe9cf('0x45')]=_[_0xe9cf('0x41')](_0x41afce['query']);_0x47fd4f['filters']=_[_0xe9cf('0x43')](_0x47fd4f['model'],_0x47fd4f[_0xe9cf('0x45')]);_0x3a5fe6[_0xe9cf('0x44')]=_[_0xe9cf('0x43')](_0x47fd4f[_0xe9cf('0x3f')],qs[_0xe9cf('0x46')](_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x46')]));_0x3a5fe6[_0xe9cf('0x44')]=_0x3a5fe6[_0xe9cf('0x44')][_0xe9cf('0x47')]?_0x3a5fe6[_0xe9cf('0x44')]:_0x47fd4f[_0xe9cf('0x3f')];_0x3a5fe6[_0xe9cf('0x4a')]=qs[_0xe9cf('0x4b')](_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x4b')]);_0x3a5fe6['where']=qs[_0xe9cf('0x42')](_[_0xe9cf('0x4d')](_0x41afce[_0xe9cf('0x45')],_0x47fd4f[_0xe9cf('0x42')]));if(_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x4f')]){_0x3a5fe6['where']=_[_0xe9cf('0x4e')](_0x3a5fe6[_0xe9cf('0x4c')],{'$or':_[_0xe9cf('0x40')](_0x3a5fe6[_0xe9cf('0x44')],function(_0x451fd0){var _0x434af3={};_0x434af3[_0x451fd0]={'$like':'%'+_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x4f')]+'%'};return _0x434af3;})});}_0x3a5fe6=_[_0xe9cf('0x4e')]({},_0x3a5fe6,_0x41afce['options']);return _0x4ff45d[_0xe9cf('0x6f')](_0x3a5fe6);}})['then'](function(_0xdef7a6){if(_0xdef7a6){_0x29c808=_0xdef7a6[_0xe9cf('0x47')];if(!_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x48')](_0xe9cf('0x49'))){_0x3a5fe6[_0xe9cf('0x2c')]=qs[_0xe9cf('0x2c')](_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x2c')]);_0x3a5fe6[_0xe9cf('0x2e')]=qs[_0xe9cf('0x2e')](_0x41afce[_0xe9cf('0x45')][_0xe9cf('0x2e')]);}return _0x4ff45d[_0xe9cf('0x6f')](_0x3a5fe6);}})['then'](function(_0x3af794){if(_0x3af794){return _0x3af794?{'count':_0x29c808,'rows':_0x3af794}:null;}})[_0xe9cf('0x35')](respondWithResult(_0xc21223,null))[_0xe9cf('0x26')](handleError(_0xc21223,null));};exports[_0xe9cf('0x70')]=function(_0x522765,_0x3586af,_0x1867f1){var _0x3cfdfc=_0x522765[_0xe9cf('0x5a')]['ids'];return db['Team'][_0xe9cf('0x53')]({'where':{'id':_0x3cfdfc},'attributes':['id'],'include':[{'model':db[_0xe9cf('0x66')],'as':_0xe9cf('0x71'),'attributes':['id',_0xe9cf('0x3a'),_0xe9cf('0x72'),'voicePause',_0xe9cf('0x73')],'raw':!![]}]})[_0xe9cf('0x35')](function(_0x1543c5){if(_0x1543c5){var _0x4b9920=_[_0xe9cf('0x74')](_0x1543c5,function(_0x4029da){var _0x124690=_0x4029da[_0xe9cf('0x37')]({'plain':!![]});return _0x124690[_0xe9cf('0x71')];});return db[_0xe9cf('0x56')][_0xe9cf('0x58')]({'where':{'id':_0x522765['params']['id']}})['then'](function(_0x465731){return db[_0xe9cf('0x75')]['transaction'](function(_0xd45133){return _0x465731['addTeams'](_0x3cfdfc,{'transaction':_0xd45133})[_0xe9cf('0x35')](function(){return BPromise[_0xe9cf('0x76')](_0x4b9920,function(_0x35fbde){return db[_0xe9cf('0x65')][_0xe9cf('0x77')]({'where':{'UserId':_0x35fbde['id'],'ChatQueueId':_0x522765['params']['id']},'transaction':_0xd45133});});})[_0xe9cf('0x35')](function(){_0x4b9920[_0xe9cf('0x78')](function(_0x30cb5e){socket['emit'](_0xe9cf('0x79'),{'UserId':_0x30cb5e['id'],'ChatQueueId':_0x465731['id']});});});});});}})[_0xe9cf('0x35')](respondWithStatusCode(_0x3586af,null))['catch'](handleError(_0x3586af,null));};exports[_0xe9cf('0x7a')]=function(_0x570095,_0xed29e7,_0xadbcd6){return db[_0xe9cf('0x6e')][_0xe9cf('0x53')]({'where':{'id':_0x570095[_0xe9cf('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe9cf('0x66')],'as':_0xe9cf('0x71'),'attributes':['id'],'raw':!![]}]})[_0xe9cf('0x35')](handleEntityNotFound(_0xed29e7,null))['then'](function(_0x33fff7){var _0x4d1f86=_['map'](_0x33fff7,'id');var _0x209775=[];var _0x111cec=[];var _0x2bccaf=squel[_0xe9cf('0x7b')]();_0x2bccaf['field'](_0xe9cf('0x7c'))[_0xe9cf('0x7d')]('team_has_chat_queues','tq')[_0xe9cf('0x7e')](_0xe9cf('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x570095[_0xe9cf('0x60')]['id']);for(var _0x190519=0x0;_0x190519<_0x33fff7[_0xe9cf('0x47')];_0x190519+=0x1){let _0x25ab96=_0x33fff7[_0x190519];for(var _0x55c2d3=0x0;_0x55c2d3<_0x25ab96[_0xe9cf('0x71')][_0xe9cf('0x47')];_0x55c2d3+=0x1){let _0x596eb7=_0x25ab96[_0xe9cf('0x71')][_0x55c2d3];var _0x378df4=_0x2bccaf[_0xe9cf('0x80')]();_0x378df4['where'](_0xe9cf('0x81'),_0x596eb7['id']);_0x111cec[_0xe9cf('0x82')](db[_0xe9cf('0x75')][_0xe9cf('0x45')](_0x378df4[_0xe9cf('0x83')](),{'type':db[_0xe9cf('0x75')][_0xe9cf('0x84')][_0xe9cf('0x85')]})[_0xe9cf('0x35')](function(_0x536990){if(_0x536990[_0xe9cf('0x47')]===0x1){return _0x596eb7['id'];}else{var _0x30b5ac=_[_0xe9cf('0x86')](_[_0xe9cf('0x40')](_0x536990,_0xe9cf('0x87')),function(_0x1792ad){return _[_0xe9cf('0x88')](_0x4d1f86,_0x1792ad);});if(_0x30b5ac){return _0x596eb7['id'];}}}));}}return BPromise['all'](_0x111cec)[_0xe9cf('0x35')](function(_0x5dc746){_0x209775=_(_0x209775)[_0xe9cf('0x89')](_0x5dc746)[_0xe9cf('0x8a')]()[_0xe9cf('0x8b')]();return db[_0xe9cf('0x56')][_0xe9cf('0x58')]({'where':{'id':_0x570095[_0xe9cf('0x60')]['id']}})['then'](function(_0x1e96e5){return db[_0xe9cf('0x75')]['transaction'](function(_0x53fe53){return _0x1e96e5[_0xe9cf('0x7a')](_0x570095['query'][_0xe9cf('0x8c')],{'transaction':_0x53fe53})['then'](function(){if(!_['isEmpty'](_0x209775)){return _0x1e96e5['removeAgents'](_0x209775,{'transaction':_0x53fe53});}})['then'](function(){_0x209775[_0xe9cf('0x78')](function(_0x4090ad){socket[_0xe9cf('0x8d')](_0xe9cf('0x8e'),{'UserId':_0x4090ad,'ChatQueueId':_0x1e96e5['id']});});});});});});})[_0xe9cf('0x35')](respondWithStatusCode(_0xed29e7,null))['catch'](handleError(_0xed29e7,null));};exports[_0xe9cf('0x8f')]=function(_0x2a31a4,_0x52209d,_0x20f59c){return db['ChatQueue'][_0xe9cf('0x58')]({'where':{'id':_0x2a31a4['params']['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x52209d,null))[_0xe9cf('0x35')](function(_0x5ec5e0){if(_0x5ec5e0){return _0x5ec5e0[_0xe9cf('0x8f')](_0x2a31a4[_0xe9cf('0x5a')][_0xe9cf('0x8c')],_['omit'](_0x2a31a4[_0xe9cf('0x5a')],[_0xe9cf('0x8c'),'id'])||{})[_0xe9cf('0x90')](function(_0x4ca70c){for(var _0x4d7e08=0x0;_0x4d7e08<_0x2a31a4[_0xe9cf('0x5a')][_0xe9cf('0x8c')]['length'];_0x4d7e08+=0x1){socket[_0xe9cf('0x8d')]('userChatQueue:save',{'UserId':Number(_0x2a31a4[_0xe9cf('0x5a')]['ids'][_0x4d7e08]),'ChatQueueId':Number(_0x2a31a4[_0xe9cf('0x60')]['id'])});}return _0x4ca70c;});}})[_0xe9cf('0x35')](respondWithResult(_0x52209d,null))[_0xe9cf('0x26')](handleError(_0x52209d,null));};exports[_0xe9cf('0x91')]=function(_0x3a98c9,_0x1764ac,_0x5c49de){return db[_0xe9cf('0x56')][_0xe9cf('0x58')]({'where':{'id':_0x3a98c9[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x1764ac,null))[_0xe9cf('0x35')](function(_0x749d4f){if(_0x749d4f){return _0x749d4f['removeAgents'](_0x3a98c9[_0xe9cf('0x45')]['ids'])[_0xe9cf('0x35')](function(){if(_[_0xe9cf('0x92')](_0x3a98c9['query']['ids'])){for(var _0x40e600=0x0;_0x40e600<_0x3a98c9['query']['ids'][_0xe9cf('0x47')];_0x40e600+=0x1){socket[_0xe9cf('0x8d')](_0xe9cf('0x8e'),{'UserId':Number(_0x3a98c9[_0xe9cf('0x45')]['ids'][_0x40e600]),'ChatQueueId':Number(_0x3a98c9['params']['id'])});}}else{socket['emit'](_0xe9cf('0x8e'),{'UserId':Number(_0x3a98c9[_0xe9cf('0x45')][_0xe9cf('0x8c')]),'ChatQueueId':Number(_0x3a98c9[_0xe9cf('0x60')]['id'])});}});}})[_0xe9cf('0x35')](respondWithStatusCode(_0x1764ac,null))['catch'](handleError(_0x1764ac,null));};exports[_0xe9cf('0x93')]=function(_0x12846d,_0x313b71,_0x247a3c){var _0x4b1123={};var _0x19c8c5={};var _0x20f52b;var _0x76fd3a;return db[_0xe9cf('0x56')][_0xe9cf('0x63')]({'where':{'id':_0x12846d[_0xe9cf('0x60')]['id']}})[_0xe9cf('0x35')](handleEntityNotFound(_0x313b71,null))['then'](function(_0x3b98f8){if(_0x3b98f8){_0x20f52b=_0x3b98f8;_0x19c8c5['model']=_[_0xe9cf('0x41')](db['User'][_0xe9cf('0x57')]);_0x19c8c5['query']=_[_0xe9cf('0x41')](_0x12846d[_0xe9cf('0x45')]);_0x19c8c5['filters']=_[_0xe9cf('0x43')](_0x19c8c5[_0xe9cf('0x3f')],_0x19c8c5[_0xe9cf('0x45')]);_0x4b1123[_0xe9cf('0x44')]=_[_0xe9cf('0x43')](_0x19c8c5[_0xe9cf('0x3f')],qs[_0xe9cf('0x46')](_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x46')]));_0x4b1123[_0xe9cf('0x44')]=_0x4b1123['attributes'][_0xe9cf('0x47')]?_0x4b1123[_0xe9cf('0x44')]:_0x19c8c5[_0xe9cf('0x3f')];_0x4b1123[_0xe9cf('0x4a')]=qs['sort'](_0x12846d['query'][_0xe9cf('0x4b')]);_0x4b1123[_0xe9cf('0x4c')]=qs['filters'](_['pick'](_0x12846d[_0xe9cf('0x45')],_0x19c8c5['filters']));if(_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x4f')]){_0x4b1123[_0xe9cf('0x4c')]=_['merge'](_0x4b1123[_0xe9cf('0x4c')],{'$or':_['map'](_0x4b1123['attributes'],function(_0x5e7ceb){var _0x508edd={};_0x508edd[_0x5e7ceb]={'$like':'%'+_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x4f')]+'%'};return _0x508edd;})});}_0x4b1123=_[_0xe9cf('0x4e')]({},_0x4b1123,_0x12846d[_0xe9cf('0x50')]);return _0x20f52b[_0xe9cf('0x93')](_0x4b1123);}})[_0xe9cf('0x35')](function(_0x611b72){if(_0x611b72){_0x76fd3a=_0x611b72['length'];if(!_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x48')]('nolimit')){_0x4b1123[_0xe9cf('0x2c')]=qs[_0xe9cf('0x2c')](_0x12846d['query']['limit']);_0x4b1123['offset']=qs[_0xe9cf('0x2e')](_0x12846d[_0xe9cf('0x45')][_0xe9cf('0x2e')]);}return _0x20f52b[_0xe9cf('0x93')](_0x4b1123);}})[_0xe9cf('0x35')](function(_0xa0aee0){if(_0xa0aee0){return _0xa0aee0?{'count':_0x76fd3a,'rows':_0xa0aee0}:null;}})[_0xe9cf('0x35')](respondWithResult(_0x313b71,null))[_0xe9cf('0x26')](handleError(_0x313b71,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 20eb4f1..05015f9 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 _0x5793=['hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','emit'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x5793,0xb1));var _0x3579=function(_0x1f029b,_0x2e3f7f){_0x1f029b=_0x1f029b-0x0;var _0x38f53c=_0x5793[_0x1f029b];return _0x38f53c;};'use strict';var EventEmitter=require(_0x3579('0x0'));var ChatQueue=require(_0x3579('0x1'))['db'][_0x3579('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3579('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x320a4c){return function(_0x45c4bc,_0x165417,_0x470028){ChatQueueEvents[_0x3579('0x4')](_0x320a4c+':'+_0x45c4bc['id'],_0x45c4bc);ChatQueueEvents['emit'](_0x320a4c,_0x45c4bc);_0x470028(null);};}for(var e in events){if(events[_0x3579('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x3579('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0xcefb=['ChatQueue','save','remove','emit','hook','events','../../mysqldb'];(function(_0x3d16d2,_0x4f1364){var _0x96e9b1=function(_0x523f4f){while(--_0x523f4f){_0x3d16d2['push'](_0x3d16d2['shift']());}};_0x96e9b1(++_0x4f1364);}(_0xcefb,0xfa));var _0xbcef=function(_0x18515d,_0x5c442b){_0x18515d=_0x18515d-0x0;var _0x175db2=_0xcefb[_0x18515d];return _0x175db2;};'use strict';var EventEmitter=require(_0xbcef('0x0'));var ChatQueue=require(_0xbcef('0x1'))['db'][_0xbcef('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbcef('0x3'),'afterUpdate':'update','afterDestroy':_0xbcef('0x4')};function emitEvent(_0x22f518){return function(_0x34f0bf,_0x452873,_0x2b6032){ChatQueueEvents[_0xbcef('0x5')](_0x22f518+':'+_0x34f0bf['id'],_0x34f0bf);ChatQueueEvents[_0xbcef('0x5')](_0x22f518,_0x34f0bf);_0x2b6032(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xbcef('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 7ef5be9..801dfdc 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 _0xce98=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','chat_queues','lodash','api','moment'];(function(_0x1ebb10,_0x156b3e){var _0x20d709=function(_0x4cc093){while(--_0x4cc093){_0x1ebb10['push'](_0x1ebb10['shift']());}};_0x20d709(++_0x156b3e);}(_0xce98,0x1e1));var _0x8ce9=function(_0x2f5ab1,_0x4ffb4b){_0x2f5ab1=_0x2f5ab1-0x0;var _0x18f707=_0xce98[_0x2f5ab1];return _0x18f707;};'use strict';var _=require(_0x8ce9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ce9('0x1'));var moment=require(_0x8ce9('0x2'));var BPromise=require(_0x8ce9('0x3'));var rp=require(_0x8ce9('0x4'));var fs=require('fs');var path=require(_0x8ce9('0x5'));var rimraf=require(_0x8ce9('0x6'));var config=require(_0x8ce9('0x7'));var attributes=require(_0x8ce9('0x8'));module['exports']=function(_0x16480a,_0x3d85e9){return _0x16480a[_0x8ce9('0x9')]('ChatQueue',attributes,{'tableName':_0x8ce9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x51f4=['path','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','../../config/logger','moment','bluebird'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x51f4,0x1a0));var _0x451f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x51f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x451f('0x0'));var util=require('util');var logger=require(_0x451f('0x1'))('api');var moment=require(_0x451f('0x2'));var BPromise=require(_0x451f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x451f('0x4'));var rimraf=require('rimraf');var config=require(_0x451f('0x5'));var attributes=require(_0x451f('0x6'));module[_0x451f('0x7')]=function(_0x182df6,_0x44f2e4){return _0x182df6['define'](_0x451f('0x8'),attributes,{'tableName':_0x451f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 97b9f8c..b99011c 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 _0x685b=['where','limit','include','model','attributes','map','stringify','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x685b,0xbd));var _0xb685=function(_0x549fb4,_0x57140c){_0x549fb4=_0x549fb4-0x0;var _0xc64c37=_0x685b[_0x549fb4];return _0xc64c37;};'use strict';var _=require(_0xb685('0x0'));var util=require(_0xb685('0x1'));var moment=require(_0xb685('0x2'));var BPromise=require(_0xb685('0x3'));var rs=require(_0xb685('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb685('0x5'))['db'];var utils=require(_0xb685('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb685('0x7'));var jayson=require(_0xb685('0x8'));var client=jayson[_0xb685('0x9')]['http']({'port':0x232a});config[_0xb685('0xa')]=_[_0xb685('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb685('0xa')]));require('./chatQueue.socket')[_0xb685('0xc')](socket);function respondWithRpcPromise(_0x4996e2,_0x1034fe,_0xfcd2){return new BPromise(function(_0x22052e,_0x17a28b){return client['request'](_0x4996e2,_0xfcd2)[_0xb685('0xd')](function(_0x3f3ca7){logger[_0xb685('0xe')](_0xb685('0xf'),_0x1034fe,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1034fe,_0xb685('0x10'),JSON['stringify'](_0x3f3ca7));if(_0x3f3ca7[_0xb685('0x11')]){if(_0x3f3ca7[_0xb685('0x11')][_0xb685('0x12')]===0x1f4){logger[_0xb685('0x11')](_0xb685('0xf'),_0x1034fe,_0x3f3ca7[_0xb685('0x11')][_0xb685('0x13')]);return _0x17a28b(_0x3f3ca7[_0xb685('0x11')]['message']);}logger[_0xb685('0x11')](_0xb685('0xf'),_0x1034fe,_0x3f3ca7[_0xb685('0x11')]['message']);return _0x22052e(_0x3f3ca7[_0xb685('0x11')][_0xb685('0x13')]);}else{logger[_0xb685('0xe')](_0xb685('0xf'),_0x1034fe,_0xb685('0x10'));_0x22052e(_0x3f3ca7[_0xb685('0x14')][_0xb685('0x13')]);}})[_0xb685('0x15')](function(_0x4f4932){logger[_0xb685('0x11')](_0xb685('0xf'),_0x1034fe,_0x4f4932);_0x17a28b(_0x4f4932);});});}exports[_0xb685('0x16')]=function(_0x367400){var _0x501559=this;return new Promise(function(_0x7ececd,_0x51439c){return db[_0xb685('0x17')][_0xb685('0x18')]({'raw':_0x367400['options']?_0x367400['options'][_0xb685('0x19')]===undefined?!![]:![]:!![],'where':_0x367400[_0xb685('0x1a')]?_0x367400['options'][_0xb685('0x1b')]||null:null,'attributes':_0x367400['options']?_0x367400[_0xb685('0x1a')]['attributes']||null:null,'limit':_0x367400[_0xb685('0x1a')]?_0x367400[_0xb685('0x1a')][_0xb685('0x1c')]||null:null,'include':_0x367400['options']?_0x367400[_0xb685('0x1a')][_0xb685('0x1d')]?_['map'](_0x367400[_0xb685('0x1a')][_0xb685('0x1d')],function(_0xdfc74d){return{'model':db[_0xdfc74d[_0xb685('0x1e')]],'as':_0xdfc74d['as'],'attributes':_0xdfc74d[_0xb685('0x1f')],'include':_0xdfc74d[_0xb685('0x1d')]?_[_0xb685('0x20')](_0xdfc74d['include'],function(_0x1a3011){return{'model':db[_0x1a3011[_0xb685('0x1e')]],'as':_0x1a3011['as'],'attributes':_0x1a3011[_0xb685('0x1f')],'include':_0x1a3011['include']?_[_0xb685('0x20')](_0x1a3011[_0xb685('0x1d')],function(_0x26fa16){return{'model':db[_0x26fa16['model']],'as':_0x26fa16['as'],'attributes':_0x26fa16[_0xb685('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb685('0xd')](function(_0xa4b7a6){logger[_0xb685('0xe')](_0xb685('0x16'),_0x367400);logger['debug'](_0xb685('0x16'),_0x367400,JSON[_0xb685('0x21')](_0xa4b7a6));_0x7ececd(_0xa4b7a6);})[_0xb685('0x15')](function(_0x2253f6){logger[_0xb685('0x11')](_0xb685('0x16'),_0x2253f6[_0xb685('0x13')],_0x367400);_0x51439c(_0x501559['error'](0x1f4,_0x2253f6[_0xb685('0x13')]));});});};exports[_0xb685('0x22')]=function(_0x516674){var _0x25eac5=this;return new Promise(function(_0x5d6471,_0x49818){return db[_0xb685('0x17')][_0xb685('0x23')]({'raw':_0x516674[_0xb685('0x1a')]?_0x516674[_0xb685('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x516674[_0xb685('0x1a')]?_0x516674[_0xb685('0x1a')][_0xb685('0x1b')]||null:null,'attributes':_0x516674[_0xb685('0x1a')]?_0x516674[_0xb685('0x1a')][_0xb685('0x1f')]||null:null,'include':_0x516674['options']?_0x516674[_0xb685('0x1a')][_0xb685('0x1d')]?_[_0xb685('0x20')](_0x516674['options'][_0xb685('0x1d')],function(_0x2ecdbd){return{'model':db[_0x2ecdbd[_0xb685('0x1e')]],'as':_0x2ecdbd['as'],'attributes':_0x2ecdbd[_0xb685('0x1f')],'include':_0x2ecdbd[_0xb685('0x1d')]?_[_0xb685('0x20')](_0x2ecdbd[_0xb685('0x1d')],function(_0x404b1b){return{'model':db[_0x404b1b[_0xb685('0x1e')]],'as':_0x404b1b['as'],'attributes':_0x404b1b[_0xb685('0x1f')],'include':_0x404b1b[_0xb685('0x1d')]?_[_0xb685('0x20')](_0x404b1b[_0xb685('0x1d')],function(_0xa398fe){return{'model':db[_0xa398fe[_0xb685('0x1e')]],'as':_0xa398fe['as'],'attributes':_0xa398fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f392a){logger['info'](_0xb685('0x22'),_0x516674);logger['debug'](_0xb685('0x22'),_0x516674,JSON[_0xb685('0x21')](_0x4f392a));_0x5d6471(_0x4f392a);})['catch'](function(_0x4940f9){logger[_0xb685('0x11')]('ShowChatQueue',_0x4940f9[_0xb685('0x13')],_0x516674);_0x49818(_0x25eac5[_0xb685('0x11')](0x1f4,_0x4940f9[_0xb685('0x13')]));});});};
\ No newline at end of file
+var _0xda66=['redis','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','findAll','options','raw','where','attributes','include','map','model','then','GetChatQueue','stringify','ChatQueue','ShowChatQueue','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x27f68f,_0x177be3){var _0xef1bec=function(_0x5551b2){while(--_0x5551b2){_0x27f68f['push'](_0x27f68f['shift']());}};_0xef1bec(++_0x177be3);}(_0xda66,0x7f));var _0x6da6=function(_0x3144b3,_0x45f961){_0x3144b3=_0x3144b3-0x0;var _0x2517a9=_0xda66[_0x3144b3];return _0x2517a9;};'use strict';var _=require(_0x6da6('0x0'));var util=require('util');var moment=require(_0x6da6('0x1'));var BPromise=require(_0x6da6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6da6('0x3'));var logger=require(_0x6da6('0x4'))(_0x6da6('0x5'));var config=require(_0x6da6('0x6'));var jayson=require(_0x6da6('0x7'));var client=jayson['client'][_0x6da6('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6da6('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6da6('0xa'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x6da6('0xb')](socket);function respondWithRpcPromise(_0x28bd1,_0x273738,_0x53f6b){return new BPromise(function(_0x117d66,_0x3dd80d){return client[_0x6da6('0xc')](_0x28bd1,_0x53f6b)['then'](function(_0x535b87){logger[_0x6da6('0xd')](_0x6da6('0xe'),_0x273738,_0x6da6('0xf'));logger[_0x6da6('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x273738,_0x6da6('0xf'),JSON['stringify'](_0x535b87));if(_0x535b87[_0x6da6('0x11')]){if(_0x535b87[_0x6da6('0x11')][_0x6da6('0x12')]===0x1f4){logger[_0x6da6('0x11')](_0x6da6('0xe'),_0x273738,_0x535b87[_0x6da6('0x11')][_0x6da6('0x13')]);return _0x3dd80d(_0x535b87['error']['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x273738,_0x535b87['error']['message']);return _0x117d66(_0x535b87[_0x6da6('0x11')][_0x6da6('0x13')]);}else{logger[_0x6da6('0xd')](_0x6da6('0xe'),_0x273738,_0x6da6('0xf'));_0x117d66(_0x535b87['result'][_0x6da6('0x13')]);}})[_0x6da6('0x14')](function(_0x4494b4){logger['error'](_0x6da6('0xe'),_0x273738,_0x4494b4);_0x3dd80d(_0x4494b4);});});}exports['GetChatQueue']=function(_0xd6e637){var _0x3bd06a=this;return new Promise(function(_0x22340e,_0xd63d5b){return db['ChatQueue'][_0x6da6('0x15')]({'raw':_0xd6e637[_0x6da6('0x16')]?_0xd6e637['options'][_0x6da6('0x17')]===undefined?!![]:![]:!![],'where':_0xd6e637[_0x6da6('0x16')]?_0xd6e637[_0x6da6('0x16')][_0x6da6('0x18')]||null:null,'attributes':_0xd6e637['options']?_0xd6e637[_0x6da6('0x16')][_0x6da6('0x19')]||null:null,'limit':_0xd6e637[_0x6da6('0x16')]?_0xd6e637[_0x6da6('0x16')]['limit']||null:null,'include':_0xd6e637['options']?_0xd6e637[_0x6da6('0x16')][_0x6da6('0x1a')]?_[_0x6da6('0x1b')](_0xd6e637[_0x6da6('0x16')][_0x6da6('0x1a')],function(_0x5dff07){return{'model':db[_0x5dff07[_0x6da6('0x1c')]],'as':_0x5dff07['as'],'attributes':_0x5dff07[_0x6da6('0x19')],'include':_0x5dff07[_0x6da6('0x1a')]?_[_0x6da6('0x1b')](_0x5dff07[_0x6da6('0x1a')],function(_0x3a3903){return{'model':db[_0x3a3903[_0x6da6('0x1c')]],'as':_0x3a3903['as'],'attributes':_0x3a3903['attributes'],'include':_0x3a3903[_0x6da6('0x1a')]?_[_0x6da6('0x1b')](_0x3a3903[_0x6da6('0x1a')],function(_0x1cd1a4){return{'model':db[_0x1cd1a4[_0x6da6('0x1c')]],'as':_0x1cd1a4['as'],'attributes':_0x1cd1a4[_0x6da6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6da6('0x1d')](function(_0x33f5fa){logger[_0x6da6('0xd')](_0x6da6('0x1e'),_0xd6e637);logger[_0x6da6('0x10')]('GetChatQueue',_0xd6e637,JSON[_0x6da6('0x1f')](_0x33f5fa));_0x22340e(_0x33f5fa);})['catch'](function(_0x945988){logger[_0x6da6('0x11')](_0x6da6('0x1e'),_0x945988[_0x6da6('0x13')],_0xd6e637);_0xd63d5b(_0x3bd06a[_0x6da6('0x11')](0x1f4,_0x945988[_0x6da6('0x13')]));});});};exports['ShowChatQueue']=function(_0x2fa8af){var _0x362451=this;return new Promise(function(_0x18a3cb,_0x582bf7){return db[_0x6da6('0x20')]['find']({'raw':_0x2fa8af[_0x6da6('0x16')]?_0x2fa8af[_0x6da6('0x16')][_0x6da6('0x17')]===undefined?!![]:![]:!![],'where':_0x2fa8af[_0x6da6('0x16')]?_0x2fa8af['options'][_0x6da6('0x18')]||null:null,'attributes':_0x2fa8af[_0x6da6('0x16')]?_0x2fa8af[_0x6da6('0x16')][_0x6da6('0x19')]||null:null,'include':_0x2fa8af['options']?_0x2fa8af['options'][_0x6da6('0x1a')]?_['map'](_0x2fa8af[_0x6da6('0x16')][_0x6da6('0x1a')],function(_0x5e14a8){return{'model':db[_0x5e14a8[_0x6da6('0x1c')]],'as':_0x5e14a8['as'],'attributes':_0x5e14a8['attributes'],'include':_0x5e14a8[_0x6da6('0x1a')]?_[_0x6da6('0x1b')](_0x5e14a8[_0x6da6('0x1a')],function(_0xd668ca){return{'model':db[_0xd668ca[_0x6da6('0x1c')]],'as':_0xd668ca['as'],'attributes':_0xd668ca[_0x6da6('0x19')],'include':_0xd668ca[_0x6da6('0x1a')]?_['map'](_0xd668ca['include'],function(_0x563a3b){return{'model':db[_0x563a3b['model']],'as':_0x563a3b['as'],'attributes':_0x563a3b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6da6('0x1d')](function(_0x9531d8){logger[_0x6da6('0xd')](_0x6da6('0x21'),_0x2fa8af);logger[_0x6da6('0x10')]('ShowChatQueue',_0x2fa8af,JSON[_0x6da6('0x1f')](_0x9531d8));_0x18a3cb(_0x9531d8);})[_0x6da6('0x14')](function(_0x192ee2){logger['error'](_0x6da6('0x21'),_0x192ee2[_0x6da6('0x13')],_0x2fa8af);_0x582bf7(_0x362451[_0x6da6('0x11')](0x1f4,_0x192ee2[_0x6da6('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 2e332fd..8ad69ea 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 _0xe14d=['update','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x394a80,_0xb35b3f){var _0x42797e=function(_0x17843f){while(--_0x17843f){_0x394a80['push'](_0x394a80['shift']());}};_0x42797e(++_0xb35b3f);}(_0xe14d,0x1ee));var _0xde14=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe14d[_0x15bc81];return _0x59440e;};'use strict';var ChatQueueEvents=require(_0xde14('0x0'));var events=[_0xde14('0x1'),_0xde14('0x2'),_0xde14('0x3')];function createListener(_0x48b392,_0x1c5b4){return function(_0x28965b){_0x1c5b4['emit'](_0x48b392,_0x28965b);};}function removeListener(_0x1c3e94,_0x13c24e){return function(){ChatQueueEvents[_0xde14('0x4')](_0x1c3e94,_0x13c24e);};}exports[_0xde14('0x5')]=function(_0x461af3){for(var _0xba1514=0x0,_0x4b1f6b=events['length'];_0xba1514<_0x4b1f6b;_0xba1514++){var _0x1bd49d=events[_0xba1514];var _0x115b7d=createListener(_0xde14('0x6')+_0x1bd49d,_0x461af3);ChatQueueEvents['on'](_0x1bd49d,_0x115b7d);}};
\ No newline at end of file
+var _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x4b0f00,_0x18cb68){var _0x4a2bfd=function(_0x4a853e){while(--_0x4a853e){_0x4b0f00['push'](_0x4b0f00['shift']());}};_0x4a2bfd(++_0x18cb68);}(_0x22fb,0x192));var _0xb22f=function(_0x54bb55,_0x5bdec1){_0x54bb55=_0x54bb55-0x0;var _0x30528c=_0x22fb[_0x54bb55];return _0x30528c;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 5143e6e..38e419f 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x3703ee,_0x4235ce){_0x3703ee=_0x3703ee-0x0;var _0x1a1180=_0x3e74[_0x3703ee];return _0x1a1180;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+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(_0x1a6687,_0x1d0824){var _0x3c4995=function(_0x247d53){while(--_0x247d53){_0x1a6687['push'](_0x1a6687['shift']());}};_0x3c4995(++_0x1d0824);}(_0x7217,0x19e));var _0x7721=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7217[_0x38a7ac];return _0x53061a;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e950111..dcfee9c 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 _0x3706=['sequelize','exports','STRING','DATE','moment'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x3706,0xae));var _0x6370=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x3706[_0x1780f8];return _0x33a410;};'use strict';var moment=require(_0x6370('0x0'));var Sequelize=require(_0x6370('0x1'));module[_0x6370('0x2')]={'uniqueid':{'type':Sequelize[_0x6370('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6370('0x3')]},'joinAt':{'type':Sequelize[_0x6370('0x4')]},'leaveAt':{'type':Sequelize[_0x6370('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6370('0x4')]},'reason':{'type':Sequelize[_0x6370('0x3')]}};
\ No newline at end of file
+var _0xa61a=['moment','sequelize','exports','STRING','DATE'];(function(_0x13c774,_0x4d3531){var _0x5ae4e7=function(_0x43a7b0){while(--_0x43a7b0){_0x13c774['push'](_0x13c774['shift']());}};_0x5ae4e7(++_0x4d3531);}(_0xa61a,0xc8));var _0xaa61=function(_0x305bbf,_0x5647b3){_0x305bbf=_0x305bbf-0x0;var _0x4ed772=_0xa61a[_0x305bbf];return _0x4ed772;};'use strict';var moment=require(_0xaa61('0x0'));var Sequelize=require(_0xaa61('0x1'));module[_0xaa61('0x2')]={'uniqueid':{'type':Sequelize[_0xaa61('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xaa61('0x4')]},'leaveAt':{'type':Sequelize[_0xaa61('0x4')]},'acceptAt':{'type':Sequelize[_0xaa61('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xaa61('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 61ccb7b..54331d7 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x103f=['rows','catch','show','params','intersection','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','index','ChatQueueReport','rawAttributes','fieldName','keys','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x347402,_0x581b59){var _0x487765=function(_0x2ac371){while(--_0x2ac371){_0x347402['push'](_0x347402['shift']());}};_0x487765(++_0x581b59);}(_0x103f,0x13e));var _0xf103=function(_0x46b8af,_0x307d60){_0x46b8af=_0x46b8af-0x0;var _0x33bf87=_0x103f[_0x46b8af];return _0x33bf87;};'use strict';var emlformat=require(_0xf103('0x0'));var rimraf=require(_0xf103('0x1'));var zipdir=require(_0xf103('0x2'));var jsonpatch=require(_0xf103('0x3'));var rp=require(_0xf103('0x4'));var moment=require(_0xf103('0x5'));var BPromise=require(_0xf103('0x6'));var Mustache=require(_0xf103('0x7'));var util=require(_0xf103('0x8'));var path=require(_0xf103('0x9'));var sox=require('sox');var csv=require(_0xf103('0xa'));var ejs=require(_0xf103('0xb'));var fs=require('fs');var fs_extra=require(_0xf103('0xc'));var _=require(_0xf103('0xd'));var squel=require(_0xf103('0xe'));var crypto=require(_0xf103('0xf'));var jsforce=require(_0xf103('0x10'));var deskjs=require(_0xf103('0x11'));var toCsv=require(_0xf103('0xa'));var querystring=require(_0xf103('0x12'));var Papa=require(_0xf103('0x13'));var Redis=require(_0xf103('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xf103('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf103('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf103('0x17'));var config=require(_0xf103('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf103('0x19'))['db'];function respondWithStatusCode(_0x568960,_0x5735d1){_0x5735d1=_0x5735d1||0xcc;return function(_0x4e7ec5){if(_0x4e7ec5){return _0x568960[_0xf103('0x1a')](_0x5735d1);}return _0x568960['status'](_0x5735d1)[_0xf103('0x1b')]();};}function respondWithResult(_0x1e8765,_0x55ec64){_0x55ec64=_0x55ec64||0xc8;return function(_0x189a41){if(_0x189a41){return _0x1e8765[_0xf103('0x1c')](_0x55ec64)['json'](_0x189a41);}};}function respondWithFilteredResult(_0x1de2a8,_0x299ddf){return function(_0x5bf405){if(_0x5bf405){var _0x13be78=typeof _0x299ddf['offset']==='undefined'&&typeof _0x299ddf[_0xf103('0x1d')]===_0xf103('0x1e');var _0x31e26e=_0x5bf405[_0xf103('0x1f')];var _0x1659fa=_0x13be78?0x0:_0x299ddf[_0xf103('0x20')];var _0x5a2e85=_0x13be78?_0x5bf405[_0xf103('0x1f')]:_0x299ddf[_0xf103('0x20')]+_0x299ddf['limit'];var _0x21ea69;if(_0x5a2e85>=_0x31e26e){_0x5a2e85=_0x31e26e;_0x21ea69=0xc8;}else{_0x21ea69=0xce;}_0x1de2a8[_0xf103('0x1c')](_0x21ea69);return _0x1de2a8[_0xf103('0x21')](_0xf103('0x22'),_0x1659fa+'-'+_0x5a2e85+'/'+_0x31e26e)[_0xf103('0x23')](_0x5bf405);}return null;};}function patchUpdates(_0x5d28e9){return function(_0x32aaa5){try{jsonpatch[_0xf103('0x24')](_0x32aaa5,_0x5d28e9,!![]);}catch(_0x467b15){return BPromise[_0xf103('0x25')](_0x467b15);}return _0x32aaa5[_0xf103('0x26')]();};}function saveUpdates(_0x319c49,_0x3607ce){return function(_0x111e83){if(_0x111e83){return _0x111e83['update'](_0x319c49)[_0xf103('0x27')](function(_0x4fab08){return _0x4fab08;});}return null;};}function removeEntity(_0x470479,_0x4d1752){return function(_0x3a8d9e){if(_0x3a8d9e){return _0x3a8d9e[_0xf103('0x28')]()[_0xf103('0x27')](function(){_0x470479[_0xf103('0x1c')](0xcc)[_0xf103('0x1b')]();});}};}function handleEntityNotFound(_0x297198,_0x23a122){return function(_0x259797){if(!_0x259797){_0x297198['sendStatus'](0x194);}return _0x259797;};}function handleError(_0x2c415a,_0x4bdc52){_0x4bdc52=_0x4bdc52||0x1f4;return function(_0x259fdc){logger['error'](_0x259fdc[_0xf103('0x29')]);if(_0x259fdc[_0xf103('0x2a')]){delete _0x259fdc[_0xf103('0x2a')];}_0x2c415a[_0xf103('0x1c')](_0x4bdc52)['send'](_0x259fdc);};}exports[_0xf103('0x2b')]=function(_0x1d3cdd,_0x14b6b7){var _0x5a1f81={},_0x4adf44={},_0x1b0a13={'count':0x0,'rows':[]};var _0x7ee263=_['map'](db[_0xf103('0x2c')][_0xf103('0x2d')],function(_0x2fab93){return{'name':_0x2fab93[_0xf103('0x2e')],'type':_0x2fab93['type']['key']};});_0x4adf44['model']=_['map'](_0x7ee263,_0xf103('0x2a'));_0x4adf44['query']=_[_0xf103('0x2f')](_0x1d3cdd[_0xf103('0x30')]);_0x4adf44[_0xf103('0x31')]=_['intersection'](_0x4adf44['model'],_0x4adf44[_0xf103('0x30')]);_0x5a1f81[_0xf103('0x32')]=_['intersection'](_0x4adf44[_0xf103('0x33')],qs[_0xf103('0x34')](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x34')]));_0x5a1f81[_0xf103('0x32')]=_0x5a1f81[_0xf103('0x32')][_0xf103('0x35')]?_0x5a1f81[_0xf103('0x32')]:_0x4adf44[_0xf103('0x33')];if(!_0x1d3cdd[_0xf103('0x30')][_0xf103('0x36')](_0xf103('0x37'))){_0x5a1f81[_0xf103('0x1d')]=qs[_0xf103('0x1d')](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x1d')]);_0x5a1f81[_0xf103('0x20')]=qs['offset'](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x20')]);}_0x5a1f81[_0xf103('0x38')]=qs['sort'](_0x1d3cdd[_0xf103('0x30')]['sort']);_0x5a1f81['where']=qs[_0xf103('0x31')](_[_0xf103('0x39')](_0x1d3cdd[_0xf103('0x30')],_0x4adf44[_0xf103('0x31')]),_0x7ee263);if(_0x1d3cdd[_0xf103('0x30')][_0xf103('0x3a')]){_0x5a1f81[_0xf103('0x3b')]=_[_0xf103('0x3c')](_0x5a1f81[_0xf103('0x3b')],{'$or':_['map'](_0x7ee263,function(_0x3cd906){if(_0x3cd906[_0xf103('0x3d')]!==_0xf103('0x3e')){var _0x4a192c={};_0x4a192c[_0x3cd906[_0xf103('0x2a')]]={'$like':'%'+_0x1d3cdd[_0xf103('0x30')][_0xf103('0x3a')]+'%'};return _0x4a192c;}})});}_0x5a1f81=_['merge']({},_0x5a1f81,_0x1d3cdd[_0xf103('0x3f')]);var _0x7ff67a={'where':_0x5a1f81[_0xf103('0x3b')]};return db[_0xf103('0x2c')][_0xf103('0x1f')](_0x7ff67a)['then'](function(_0x4c22b2){_0x1b0a13[_0xf103('0x1f')]=_0x4c22b2;if(_0x1d3cdd[_0xf103('0x30')][_0xf103('0x40')]){_0x5a1f81[_0xf103('0x41')]=[{'all':!![]}];}return db[_0xf103('0x2c')][_0xf103('0x42')](_0x5a1f81);})[_0xf103('0x27')](function(_0x304ce2){_0x1b0a13[_0xf103('0x43')]=_0x304ce2;return _0x1b0a13;})[_0xf103('0x27')](respondWithFilteredResult(_0x14b6b7,_0x5a1f81))[_0xf103('0x44')](handleError(_0x14b6b7,null));};exports[_0xf103('0x45')]=function(_0x439cf4,_0x26df37){var _0x434a3a={'raw':!![],'where':{'id':_0x439cf4[_0xf103('0x46')]['id']}},_0x16ed02={};_0x16ed02['model']=_['keys'](db[_0xf103('0x2c')][_0xf103('0x2d')]);_0x16ed02['query']=_[_0xf103('0x2f')](_0x439cf4[_0xf103('0x30')]);_0x16ed02[_0xf103('0x31')]=_[_0xf103('0x47')](_0x16ed02[_0xf103('0x33')],_0x16ed02['query']);_0x434a3a[_0xf103('0x32')]=_[_0xf103('0x47')](_0x16ed02['model'],qs[_0xf103('0x34')](_0x439cf4[_0xf103('0x30')][_0xf103('0x34')]));_0x434a3a[_0xf103('0x32')]=_0x434a3a[_0xf103('0x32')]['length']?_0x434a3a['attributes']:_0x16ed02['model'];if(_0x439cf4['query'][_0xf103('0x40')]){_0x434a3a[_0xf103('0x41')]=[{'all':!![]}];}_0x434a3a=_[_0xf103('0x3c')]({},_0x434a3a,_0x439cf4[_0xf103('0x3f')]);return db[_0xf103('0x2c')][_0xf103('0x48')](_0x434a3a)[_0xf103('0x27')](handleEntityNotFound(_0x26df37,null))[_0xf103('0x27')](respondWithResult(_0x26df37,null))[_0xf103('0x44')](handleError(_0x26df37,null));};exports[_0xf103('0x49')]=function(_0x326562,_0x2f6cca){return db[_0xf103('0x2c')]['create'](_0x326562[_0xf103('0x4a')],{})[_0xf103('0x27')](respondWithResult(_0x2f6cca,0xc9))['catch'](handleError(_0x2f6cca,null));};exports[_0xf103('0x4b')]=function(_0x5209ac,_0x382217){if(_0x5209ac[_0xf103('0x4a')]['id']){delete _0x5209ac[_0xf103('0x4a')]['id'];}return db[_0xf103('0x2c')][_0xf103('0x48')]({'where':{'id':_0x5209ac['params']['id']}})[_0xf103('0x27')](handleEntityNotFound(_0x382217,null))['then'](saveUpdates(_0x5209ac[_0xf103('0x4a')],null))[_0xf103('0x27')](respondWithResult(_0x382217,null))['catch'](handleError(_0x382217,null));};exports['destroy']=function(_0x267e8f,_0x677aaf){return db[_0xf103('0x2c')][_0xf103('0x48')]({'where':{'id':_0x267e8f[_0xf103('0x46')]['id']}})['then'](handleEntityNotFound(_0x677aaf,null))[_0xf103('0x27')](removeEntity(_0x677aaf,null))[_0xf103('0x44')](handleError(_0x677aaf,null));};exports['describe']=function(_0x463494,_0x2a0e12){return db[_0xf103('0x2c')][_0xf103('0x4c')]()[_0xf103('0x27')](respondWithResult(_0x2a0e12,null))['catch'](handleError(_0x2a0e12,null));};
\ No newline at end of file
+var _0x3e4d=['jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','end','error','stack','send','map','ChatQueueReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','show','params','keys','length','include','create','update','body','find','describe','eml-format','zip-dir','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto'];(function(_0x249b6f,_0x2ecefb){var _0x578c21=function(_0x52d857){while(--_0x52d857){_0x249b6f['push'](_0x249b6f['shift']());}};_0x578c21(++_0x2ecefb);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x12366b,_0x3eb259){_0x12366b=_0x12366b-0x0;var _0x15b2b2=_0x3e4d[_0x12366b];return _0x15b2b2;};'use strict';var emlformat=require(_0xd3e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd3e4('0x2'));var Mustache=require(_0xd3e4('0x3'));var util=require(_0xd3e4('0x4'));var path=require('path');var sox=require(_0xd3e4('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3e4('0x6'));var _=require(_0xd3e4('0x7'));var squel=require(_0xd3e4('0x8'));var crypto=require(_0xd3e4('0x9'));var jsforce=require(_0xd3e4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd3e4('0xb'));var querystring=require(_0xd3e4('0xc'));var Papa=require(_0xd3e4('0xd'));var Redis=require('ioredis');var authService=require(_0xd3e4('0xe'));var qs=require(_0xd3e4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3e4('0x10'))(_0xd3e4('0x11'));var utils=require(_0xd3e4('0x12'));var config=require(_0xd3e4('0x13'));var licenseUtil=require(_0xd3e4('0x14'));var db=require(_0xd3e4('0x15'))['db'];function respondWithStatusCode(_0x1fadc6,_0x4e3258){_0x4e3258=_0x4e3258||0xcc;return function(_0x178b05){if(_0x178b05){return _0x1fadc6[_0xd3e4('0x16')](_0x4e3258);}return _0x1fadc6[_0xd3e4('0x17')](_0x4e3258)['end']();};}function respondWithResult(_0x49c058,_0x254706){_0x254706=_0x254706||0xc8;return function(_0x4abd20){if(_0x4abd20){return _0x49c058[_0xd3e4('0x17')](_0x254706)[_0xd3e4('0x18')](_0x4abd20);}};}function respondWithFilteredResult(_0x586db9,_0x2dbbc5){return function(_0x17081f){if(_0x17081f){var _0x4d5136=typeof _0x2dbbc5['offset']==='undefined'&&typeof _0x2dbbc5[_0xd3e4('0x19')]===_0xd3e4('0x1a');var _0xd6de64=_0x17081f[_0xd3e4('0x1b')];var _0xcf261b=_0x4d5136?0x0:_0x2dbbc5['offset'];var _0x1a6d65=_0x4d5136?_0x17081f[_0xd3e4('0x1b')]:_0x2dbbc5[_0xd3e4('0x1c')]+_0x2dbbc5['limit'];var _0x413a10;if(_0x1a6d65>=_0xd6de64){_0x1a6d65=_0xd6de64;_0x413a10=0xc8;}else{_0x413a10=0xce;}_0x586db9[_0xd3e4('0x17')](_0x413a10);return _0x586db9[_0xd3e4('0x1d')]('Content-Range',_0xcf261b+'-'+_0x1a6d65+'/'+_0xd6de64)[_0xd3e4('0x18')](_0x17081f);}return null;};}function patchUpdates(_0x2e2ab8){return function(_0x52af67){try{jsonpatch[_0xd3e4('0x1e')](_0x52af67,_0x2e2ab8,!![]);}catch(_0x4386b0){return BPromise[_0xd3e4('0x1f')](_0x4386b0);}return _0x52af67[_0xd3e4('0x20')]();};}function saveUpdates(_0x186786,_0x196be4){return function(_0x27019e){if(_0x27019e){return _0x27019e['update'](_0x186786)[_0xd3e4('0x21')](function(_0x5cd1fa){return _0x5cd1fa;});}return null;};}function removeEntity(_0x17b41a,_0x4281e5){return function(_0xe295b6){if(_0xe295b6){return _0xe295b6[_0xd3e4('0x22')]()[_0xd3e4('0x21')](function(){_0x17b41a[_0xd3e4('0x17')](0xcc)[_0xd3e4('0x23')]();});}};}function handleEntityNotFound(_0x4d24ab,_0x512ab8){return function(_0x81b1f5){if(!_0x81b1f5){_0x4d24ab[_0xd3e4('0x16')](0x194);}return _0x81b1f5;};}function handleError(_0xebf9ff,_0x178023){_0x178023=_0x178023||0x1f4;return function(_0x868020){logger[_0xd3e4('0x24')](_0x868020[_0xd3e4('0x25')]);if(_0x868020['name']){delete _0x868020['name'];}_0xebf9ff['status'](_0x178023)[_0xd3e4('0x26')](_0x868020);};}exports['index']=function(_0x46dada,_0x387ea6){var _0x59b895={},_0x250e70={},_0xef4209={'count':0x0,'rows':[]};var _0xe0942d=_[_0xd3e4('0x27')](db[_0xd3e4('0x28')][_0xd3e4('0x29')],function(_0x1b6cab){return{'name':_0x1b6cab[_0xd3e4('0x2a')],'type':_0x1b6cab[_0xd3e4('0x2b')][_0xd3e4('0x2c')]};});_0x250e70['model']=_[_0xd3e4('0x27')](_0xe0942d,'name');_0x250e70[_0xd3e4('0x2d')]=_['keys'](_0x46dada['query']);_0x250e70['filters']=_[_0xd3e4('0x2e')](_0x250e70[_0xd3e4('0x2f')],_0x250e70[_0xd3e4('0x2d')]);_0x59b895['attributes']=_[_0xd3e4('0x2e')](_0x250e70[_0xd3e4('0x2f')],qs[_0xd3e4('0x30')](_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x30')]));_0x59b895[_0xd3e4('0x31')]=_0x59b895['attributes']['length']?_0x59b895[_0xd3e4('0x31')]:_0x250e70['model'];if(!_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x32')](_0xd3e4('0x33'))){_0x59b895['limit']=qs[_0xd3e4('0x19')](_0x46dada['query'][_0xd3e4('0x19')]);_0x59b895[_0xd3e4('0x1c')]=qs[_0xd3e4('0x1c')](_0x46dada[_0xd3e4('0x2d')]['offset']);}_0x59b895[_0xd3e4('0x34')]=qs['sort'](_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x35')]);_0x59b895[_0xd3e4('0x36')]=qs['filters'](_[_0xd3e4('0x37')](_0x46dada[_0xd3e4('0x2d')],_0x250e70[_0xd3e4('0x38')]),_0xe0942d);if(_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x39')]){_0x59b895[_0xd3e4('0x36')]=_[_0xd3e4('0x3a')](_0x59b895[_0xd3e4('0x36')],{'$or':_[_0xd3e4('0x27')](_0xe0942d,function(_0x40a1e9){if(_0x40a1e9[_0xd3e4('0x2b')]!==_0xd3e4('0x3b')){var _0x541802={};_0x541802[_0x40a1e9[_0xd3e4('0x3c')]]={'$like':'%'+_0x46dada[_0xd3e4('0x2d')][_0xd3e4('0x39')]+'%'};return _0x541802;}})});}_0x59b895=_[_0xd3e4('0x3a')]({},_0x59b895,_0x46dada[_0xd3e4('0x3d')]);var _0x2ab66a={'where':_0x59b895[_0xd3e4('0x36')]};return db[_0xd3e4('0x28')][_0xd3e4('0x1b')](_0x2ab66a)['then'](function(_0xc429de){_0xef4209['count']=_0xc429de;if(_0x46dada['query'][_0xd3e4('0x3e')]){_0x59b895['include']=[{'all':!![]}];}return db[_0xd3e4('0x28')]['findAll'](_0x59b895);})[_0xd3e4('0x21')](function(_0x13d688){_0xef4209[_0xd3e4('0x3f')]=_0x13d688;return _0xef4209;})[_0xd3e4('0x21')](respondWithFilteredResult(_0x387ea6,_0x59b895))[_0xd3e4('0x40')](handleError(_0x387ea6,null));};exports[_0xd3e4('0x41')]=function(_0x307223,_0x5345e2){var _0x4fef51={'raw':!![],'where':{'id':_0x307223[_0xd3e4('0x42')]['id']}},_0x5b97f8={};_0x5b97f8[_0xd3e4('0x2f')]=_[_0xd3e4('0x43')](db[_0xd3e4('0x28')][_0xd3e4('0x29')]);_0x5b97f8[_0xd3e4('0x2d')]=_[_0xd3e4('0x43')](_0x307223[_0xd3e4('0x2d')]);_0x5b97f8[_0xd3e4('0x38')]=_[_0xd3e4('0x2e')](_0x5b97f8['model'],_0x5b97f8[_0xd3e4('0x2d')]);_0x4fef51[_0xd3e4('0x31')]=_[_0xd3e4('0x2e')](_0x5b97f8[_0xd3e4('0x2f')],qs[_0xd3e4('0x30')](_0x307223[_0xd3e4('0x2d')][_0xd3e4('0x30')]));_0x4fef51[_0xd3e4('0x31')]=_0x4fef51[_0xd3e4('0x31')][_0xd3e4('0x44')]?_0x4fef51[_0xd3e4('0x31')]:_0x5b97f8[_0xd3e4('0x2f')];if(_0x307223['query'][_0xd3e4('0x3e')]){_0x4fef51[_0xd3e4('0x45')]=[{'all':!![]}];}_0x4fef51=_[_0xd3e4('0x3a')]({},_0x4fef51,_0x307223['options']);return db[_0xd3e4('0x28')]['find'](_0x4fef51)[_0xd3e4('0x21')](handleEntityNotFound(_0x5345e2,null))[_0xd3e4('0x21')](respondWithResult(_0x5345e2,null))[_0xd3e4('0x40')](handleError(_0x5345e2,null));};exports[_0xd3e4('0x46')]=function(_0x8ffe57,_0x4e113c){return db[_0xd3e4('0x28')][_0xd3e4('0x46')](_0x8ffe57['body'],{})[_0xd3e4('0x21')](respondWithResult(_0x4e113c,0xc9))[_0xd3e4('0x40')](handleError(_0x4e113c,null));};exports[_0xd3e4('0x47')]=function(_0x55d726,_0x26b7b3){if(_0x55d726[_0xd3e4('0x48')]['id']){delete _0x55d726[_0xd3e4('0x48')]['id'];}return db[_0xd3e4('0x28')][_0xd3e4('0x49')]({'where':{'id':_0x55d726[_0xd3e4('0x42')]['id']}})[_0xd3e4('0x21')](handleEntityNotFound(_0x26b7b3,null))['then'](saveUpdates(_0x55d726[_0xd3e4('0x48')],null))[_0xd3e4('0x21')](respondWithResult(_0x26b7b3,null))[_0xd3e4('0x40')](handleError(_0x26b7b3,null));};exports[_0xd3e4('0x22')]=function(_0x51ba4f,_0x12aa09){return db[_0xd3e4('0x28')]['find']({'where':{'id':_0x51ba4f['params']['id']}})[_0xd3e4('0x21')](handleEntityNotFound(_0x12aa09,null))[_0xd3e4('0x21')](removeEntity(_0x12aa09,null))[_0xd3e4('0x40')](handleError(_0x12aa09,null));};exports[_0xd3e4('0x4a')]=function(_0x5340c6,_0x259db2){return db[_0xd3e4('0x28')][_0xd3e4('0x4a')]()['then'](respondWithResult(_0x259db2,null))[_0xd3e4('0x40')](handleError(_0x259db2,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 55fe4b4..0184c65 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0xe706,0xa3));var _0x6e70=function(_0x2606e7,_0xcbe32c){_0x2606e7=_0x2606e7-0x0;var _0x56d2b6=_0xe706[_0x2606e7];return _0x56d2b6;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x587d38,_0x2aa598){var _0x37ff5c=function(_0x19070b){while(--_0x19070b){_0x587d38['push'](_0x587d38['shift']());}};_0x37ff5c(++_0x2aa598);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index b69371a..95c4b34 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 _0xf1f9=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','body','where','attributes','limit','UpdateChatQueueReport','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x1a9699,_0x456e23){_0x1a9699=_0x1a9699-0x0;var _0x4a91ef=_0xf1f9[_0x1a9699];return _0x4a91ef;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require(_0x9f1f('0x7'))(_0x9f1f('0x8'));var config=require(_0x9f1f('0x9'));var jayson=require(_0x9f1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x363d26,_0x373b98,_0x117fa5){return new BPromise(function(_0x12309e,_0x4e6054){return client[_0x9f1f('0xb')](_0x363d26,_0x117fa5)[_0x9f1f('0xc')](function(_0x3efac2){logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));logger[_0x9f1f('0x10')](_0x9f1f('0x11'),_0x373b98,'request\x20sent',JSON[_0x9f1f('0x12')](_0x3efac2));if(_0x3efac2[_0x9f1f('0x13')]){if(_0x3efac2[_0x9f1f('0x13')]['code']===0x1f4){logger['error'](_0x9f1f('0xe'),_0x373b98,_0x3efac2['error'][_0x9f1f('0x14')]);return _0x4e6054(_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);}logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);return _0x12309e(_0x3efac2['error'][_0x9f1f('0x14')]);}else{logger['info'](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));_0x12309e(_0x3efac2[_0x9f1f('0x15')][_0x9f1f('0x14')]);}})[_0x9f1f('0x16')](function(_0x5645fc){logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x5645fc);_0x4e6054(_0x5645fc);});});}exports[_0x9f1f('0x17')]=function(_0x5d35a6){var _0x23d9c0=this;return new Promise(function(_0x11d55b,_0x19d3f2){return db[_0x9f1f('0x18')][_0x9f1f('0x19')](_0x5d35a6['body'],{'raw':_0x5d35a6[_0x9f1f('0x1a')]?_0x5d35a6[_0x9f1f('0x1a')][_0x9f1f('0x1b')]===undefined?!![]:![]:!![]})[_0x9f1f('0xc')](function(_0x5db027){logger[_0x9f1f('0xd')]('CreateChatQueueReport',_0x5d35a6);logger[_0x9f1f('0x10')](_0x9f1f('0x17'),_0x5d35a6,JSON['stringify'](_0x5db027));_0x11d55b(_0x5db027);})[_0x9f1f('0x16')](function(_0x317f75){logger[_0x9f1f('0x13')](_0x9f1f('0x17'),_0x317f75[_0x9f1f('0x14')],_0x5d35a6);_0x19d3f2(_0x23d9c0['error'](0x1f4,_0x317f75['message']));});});};exports['UpdateChatQueueReport']=function(_0x57d29f){var _0x47db05=this;return new Promise(function(_0x42a5ac,_0x35dac1){return db[_0x9f1f('0x18')]['update'](_0x57d29f[_0x9f1f('0x1c')],{'raw':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1d')]||null:null,'attributes':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1e')]||null:null,'limit':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1f')]||null:null})[_0x9f1f('0xc')](function(_0x4e4636){logger['info'](_0x9f1f('0x20'),_0x57d29f);logger[_0x9f1f('0x10')]('UpdateChatQueueReport',_0x57d29f,JSON[_0x9f1f('0x12')](_0x4e4636));_0x42a5ac(_0x4e4636);})[_0x9f1f('0x16')](function(_0x3fccb6){logger[_0x9f1f('0x13')](_0x9f1f('0x20'),_0x3fccb6[_0x9f1f('0x14')],_0x57d29f);_0x35dac1(_0x47db05[_0x9f1f('0x13')](0x1f4,_0x3fccb6[_0x9f1f('0x14')]));});});};
\ No newline at end of file
+var _0x0066=['then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x167067,_0xca5f29){var _0xcf561b=function(_0x11bda4){while(--_0x11bda4){_0x167067['push'](_0x167067['shift']());}};_0xcf561b(++_0xca5f29);}(_0x0066,0x111));var _0x6006=function(_0x1ef294,_0x496671){_0x1ef294=_0x1ef294-0x0;var _0x3c1c9c=_0x0066[_0x1ef294];return _0x3c1c9c;};'use strict';var _=require(_0x6006('0x0'));var util=require(_0x6006('0x1'));var moment=require(_0x6006('0x2'));var BPromise=require(_0x6006('0x3'));var rs=require(_0x6006('0x4'));var fs=require('fs');var Redis=require(_0x6006('0x5'));var db=require(_0x6006('0x6'))['db'];var utils=require(_0x6006('0x7'));var logger=require(_0x6006('0x8'))(_0x6006('0x9'));var config=require(_0x6006('0xa'));var jayson=require(_0x6006('0xb'));var client=jayson[_0x6006('0xc')][_0x6006('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3aee4f,_0x568810,_0x4af6e8){return new BPromise(function(_0xdf0291,_0x5afcb3){return client[_0x6006('0xe')](_0x3aee4f,_0x4af6e8)[_0x6006('0xf')](function(_0x2e6093){logger[_0x6006('0x10')](_0x6006('0x11'),_0x568810,'request\x20sent');logger[_0x6006('0x12')](_0x6006('0x13'),_0x568810,'request\x20sent',JSON[_0x6006('0x14')](_0x2e6093));if(_0x2e6093[_0x6006('0x15')]){if(_0x2e6093['error'][_0x6006('0x16')]===0x1f4){logger[_0x6006('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x568810,_0x2e6093[_0x6006('0x15')][_0x6006('0x17')]);return _0x5afcb3(_0x2e6093[_0x6006('0x15')][_0x6006('0x17')]);}logger[_0x6006('0x15')](_0x6006('0x11'),_0x568810,_0x2e6093['error']['message']);return _0xdf0291(_0x2e6093['error'][_0x6006('0x17')]);}else{logger[_0x6006('0x10')](_0x6006('0x11'),_0x568810,_0x6006('0x18'));_0xdf0291(_0x2e6093['result'][_0x6006('0x17')]);}})['catch'](function(_0x5d277e){logger['error'](_0x6006('0x11'),_0x568810,_0x5d277e);_0x5afcb3(_0x5d277e);});});}exports['CreateChatQueueReport']=function(_0x3be2b0){var _0x213493=this;return new Promise(function(_0x49f63f,_0xd97b56){return db[_0x6006('0x19')][_0x6006('0x1a')](_0x3be2b0[_0x6006('0x1b')],{'raw':_0x3be2b0[_0x6006('0x1c')]?_0x3be2b0[_0x6006('0x1c')][_0x6006('0x1d')]===undefined?!![]:![]:!![]})[_0x6006('0xf')](function(_0x62bf30){logger['info'](_0x6006('0x1e'),_0x3be2b0);logger['debug'](_0x6006('0x1e'),_0x3be2b0,JSON[_0x6006('0x14')](_0x62bf30));_0x49f63f(_0x62bf30);})['catch'](function(_0x229ba9){logger[_0x6006('0x15')](_0x6006('0x1e'),_0x229ba9[_0x6006('0x17')],_0x3be2b0);_0xd97b56(_0x213493['error'](0x1f4,_0x229ba9[_0x6006('0x17')]));});});};exports[_0x6006('0x1f')]=function(_0x1e1eb4){var _0x4c52fb=this;return new Promise(function(_0x515952,_0x30744e){return db[_0x6006('0x19')][_0x6006('0x20')](_0x1e1eb4['body'],{'raw':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4[_0x6006('0x1c')][_0x6006('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4[_0x6006('0x1c')][_0x6006('0x21')]||null:null,'attributes':_0x1e1eb4['options']?_0x1e1eb4[_0x6006('0x1c')]['attributes']||null:null,'limit':_0x1e1eb4[_0x6006('0x1c')]?_0x1e1eb4['options'][_0x6006('0x22')]||null:null})[_0x6006('0xf')](function(_0x137b1a){logger[_0x6006('0x10')]('UpdateChatQueueReport',_0x1e1eb4);logger['debug'](_0x6006('0x1f'),_0x1e1eb4,JSON[_0x6006('0x14')](_0x137b1a));_0x515952(_0x137b1a);})[_0x6006('0x23')](function(_0xa63979){logger[_0x6006('0x15')]('UpdateChatQueueReport',_0xa63979['message'],_0x1e1eb4);_0x30744e(_0x4c52fb[_0x6006('0x15')](0x1f4,_0xa63979['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index da89834..07c68fa 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 _0x3128=['/describe','describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','get','isAuthenticated','index'];(function(_0x41954f,_0x85d7b8){var _0x4b8406=function(_0x373b43){while(--_0x373b43){_0x41954f['push'](_0x41954f['shift']());}};_0x4b8406(++_0x85d7b8);}(_0x3128,0xab));var _0x8312=function(_0x2054d2,_0x3b06cb){_0x2054d2=_0x2054d2-0x0;var _0x82bf17=_0x3128[_0x2054d2];return _0x82bf17;};'use strict';var multer=require(_0x8312('0x0'));var util=require(_0x8312('0x1'));var path=require(_0x8312('0x2'));var timeout=require(_0x8312('0x3'));var express=require(_0x8312('0x4'));var router=express['Router']();var fs_extra=require(_0x8312('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x8312('0x6')]('/',auth[_0x8312('0x7')](),controller[_0x8312('0x8')]);router[_0x8312('0x6')](_0x8312('0x9'),auth[_0x8312('0x7')](),controller[_0x8312('0xa')]);router[_0x8312('0x6')](_0x8312('0xb'),auth[_0x8312('0x7')](),controller[_0x8312('0xc')]);router[_0x8312('0xd')]('/',auth['isAuthenticated'](),controller[_0x8312('0xe')]);router[_0x8312('0xf')](_0x8312('0xb'),auth[_0x8312('0x7')](),controller[_0x8312('0x10')]);router['delete'](_0x8312('0xb'),auth['isAuthenticated'](),controller[_0x8312('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x6ff7=['isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x5c6c64,_0x12d4cb){var _0x172174=function(_0x3f49c3){while(--_0x3f49c3){_0x5c6c64['push'](_0x5c6c64['shift']());}};_0x172174(++_0x12d4cb);}(_0x6ff7,0x16f));var _0x76ff=function(_0x79a988,_0x336527){_0x79a988=_0x79a988-0x0;var _0x29f9d2=_0x6ff7[_0x79a988];return _0x29f9d2;};'use strict';var multer=require(_0x76ff('0x0'));var util=require(_0x76ff('0x1'));var path=require('path');var timeout=require(_0x76ff('0x2'));var express=require(_0x76ff('0x3'));var router=express[_0x76ff('0x4')]();var fs_extra=require(_0x76ff('0x5'));var auth=require(_0x76ff('0x6'));var interaction=require(_0x76ff('0x7'));var config=require(_0x76ff('0x8'));var controller=require(_0x76ff('0x9'));router[_0x76ff('0xa')]('/',auth[_0x76ff('0xb')](),controller[_0x76ff('0xc')]);router[_0x76ff('0xa')](_0x76ff('0xd'),auth[_0x76ff('0xb')](),controller['describe']);router[_0x76ff('0xa')](_0x76ff('0xe'),auth[_0x76ff('0xb')](),controller[_0x76ff('0xf')]);router[_0x76ff('0x10')]('/',auth[_0x76ff('0xb')](),controller[_0x76ff('0x11')]);router[_0x76ff('0x12')](_0x76ff('0xe'),auth[_0x76ff('0xb')](),controller[_0x76ff('0x13')]);router[_0x76ff('0x14')]('/:id',auth[_0x76ff('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index fd97dda..13519b7 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xc4ea75,_0x273753){var _0x52ea5e=function(_0x1ee872){while(--_0x1ee872){_0xc4ea75['push'](_0xc4ea75['shift']());}};_0x52ea5e(++_0x273753);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x008c,0x188));var _0xc008=function(_0x56a06f,_0x183813){_0x56a06f=_0x56a06f-0x0;var _0x3309ac=_0x008c[_0x56a06f];return _0x3309ac;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 103830f..5109a26 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 _0xe1f0=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','update','then','destroy','name','send','index','rawAttributes','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','ChatTransferReport','findAll','rows','catch','show','params','keys','create','body','find','describe'];(function(_0x4e5969,_0x59d73e){var _0x59d7ce=function(_0x13a624){while(--_0x13a624){_0x4e5969['push'](_0x4e5969['shift']());}};_0x59d7ce(++_0x59d73e);}(_0xe1f0,0x1ea));var _0x0e1f=function(_0x4bd740,_0x25ce9e){_0x4bd740=_0x4bd740-0x0;var _0x41f39e=_0xe1f0[_0x4bd740];return _0x41f39e;};'use strict';var emlformat=require(_0x0e1f('0x0'));var rimraf=require(_0x0e1f('0x1'));var zipdir=require(_0x0e1f('0x2'));var jsonpatch=require(_0x0e1f('0x3'));var rp=require(_0x0e1f('0x4'));var moment=require(_0x0e1f('0x5'));var BPromise=require(_0x0e1f('0x6'));var Mustache=require(_0x0e1f('0x7'));var util=require(_0x0e1f('0x8'));var path=require(_0x0e1f('0x9'));var sox=require(_0x0e1f('0xa'));var csv=require(_0x0e1f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e1f('0xc'));var squel=require('squel');var crypto=require(_0x0e1f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0e1f('0xe'));var toCsv=require(_0x0e1f('0xb'));var querystring=require(_0x0e1f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e1f('0x10'));var as=require(_0x0e1f('0x11'));var hardwareService=require(_0x0e1f('0x12'));var logger=require('../../config/logger')(_0x0e1f('0x13'));var utils=require(_0x0e1f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0e1f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124cec,_0xc2abd8){_0xc2abd8=_0xc2abd8||0xcc;return function(_0x4bd123){if(_0x4bd123){return _0x124cec[_0x0e1f('0x16')](_0xc2abd8);}return _0x124cec[_0x0e1f('0x17')](_0xc2abd8)[_0x0e1f('0x18')]();};}function respondWithResult(_0x4e0d54,_0x5c235d){_0x5c235d=_0x5c235d||0xc8;return function(_0xc59f20){if(_0xc59f20){return _0x4e0d54[_0x0e1f('0x17')](_0x5c235d)[_0x0e1f('0x19')](_0xc59f20);}};}function respondWithFilteredResult(_0x3bd237,_0x59ece2){return function(_0x5a9ee8){if(_0x5a9ee8){var _0x2f6f20=typeof _0x59ece2[_0x0e1f('0x1a')]==='undefined'&&typeof _0x59ece2[_0x0e1f('0x1b')]==='undefined';var _0x2af45d=_0x5a9ee8['count'];var _0x5f04c9=_0x2f6f20?0x0:_0x59ece2['offset'];var _0x37ffd2=_0x2f6f20?_0x5a9ee8[_0x0e1f('0x1c')]:_0x59ece2['offset']+_0x59ece2[_0x0e1f('0x1b')];var _0x81c9c5;if(_0x37ffd2>=_0x2af45d){_0x37ffd2=_0x2af45d;_0x81c9c5=0xc8;}else{_0x81c9c5=0xce;}_0x3bd237[_0x0e1f('0x17')](_0x81c9c5);return _0x3bd237['set'](_0x0e1f('0x1d'),_0x5f04c9+'-'+_0x37ffd2+'/'+_0x2af45d)[_0x0e1f('0x19')](_0x5a9ee8);}return null;};}function patchUpdates(_0x4d52bc){return function(_0x4dd689){try{jsonpatch['apply'](_0x4dd689,_0x4d52bc,!![]);}catch(_0x278504){return BPromise[_0x0e1f('0x1e')](_0x278504);}return _0x4dd689['save']();};}function saveUpdates(_0x1c402a,_0x5bbaa8){return function(_0x2d751b){if(_0x2d751b){return _0x2d751b[_0x0e1f('0x1f')](_0x1c402a)[_0x0e1f('0x20')](function(_0x1a1b11){return _0x1a1b11;});}return null;};}function removeEntity(_0x4aa0f7,_0x2a328c){return function(_0x15d0e3){if(_0x15d0e3){return _0x15d0e3[_0x0e1f('0x21')]()[_0x0e1f('0x20')](function(){_0x4aa0f7[_0x0e1f('0x17')](0xcc)[_0x0e1f('0x18')]();});}};}function handleEntityNotFound(_0x4a61dd,_0x4f49da){return function(_0x2c3d19){if(!_0x2c3d19){_0x4a61dd[_0x0e1f('0x16')](0x194);}return _0x2c3d19;};}function handleError(_0x18eb9b,_0x41c47e){_0x41c47e=_0x41c47e||0x1f4;return function(_0x4d1e2c){logger['error'](_0x4d1e2c['stack']);if(_0x4d1e2c[_0x0e1f('0x22')]){delete _0x4d1e2c['name'];}_0x18eb9b[_0x0e1f('0x17')](_0x41c47e)[_0x0e1f('0x23')](_0x4d1e2c);};}exports[_0x0e1f('0x24')]=function(_0x4b6596,_0x4ae5ae){var _0x4ba73f={},_0x2dd563={},_0xd29787={'count':0x0,'rows':[]};var _0x14b7d9=_['map'](db['ChatTransferReport'][_0x0e1f('0x25')],function(_0x4b31e4){return{'name':_0x4b31e4['fieldName'],'type':_0x4b31e4[_0x0e1f('0x26')][_0x0e1f('0x27')]};});_0x2dd563['model']=_[_0x0e1f('0x28')](_0x14b7d9,'name');_0x2dd563[_0x0e1f('0x29')]=_['keys'](_0x4b6596[_0x0e1f('0x29')]);_0x2dd563[_0x0e1f('0x2a')]=_[_0x0e1f('0x2b')](_0x2dd563[_0x0e1f('0x2c')],_0x2dd563[_0x0e1f('0x29')]);_0x4ba73f[_0x0e1f('0x2d')]=_[_0x0e1f('0x2b')](_0x2dd563['model'],qs['fields'](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x2e')]));_0x4ba73f[_0x0e1f('0x2d')]=_0x4ba73f[_0x0e1f('0x2d')][_0x0e1f('0x2f')]?_0x4ba73f['attributes']:_0x2dd563['model'];if(!_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x30')](_0x0e1f('0x31'))){_0x4ba73f[_0x0e1f('0x1b')]=qs[_0x0e1f('0x1b')](_0x4b6596[_0x0e1f('0x29')]['limit']);_0x4ba73f[_0x0e1f('0x1a')]=qs[_0x0e1f('0x1a')](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x1a')]);}_0x4ba73f['order']=qs['sort'](_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x32')]);_0x4ba73f['where']=qs[_0x0e1f('0x2a')](_[_0x0e1f('0x33')](_0x4b6596[_0x0e1f('0x29')],_0x2dd563[_0x0e1f('0x2a')]),_0x14b7d9);if(_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x34')]){_0x4ba73f[_0x0e1f('0x35')]=_[_0x0e1f('0x36')](_0x4ba73f[_0x0e1f('0x35')],{'$or':_[_0x0e1f('0x28')](_0x14b7d9,function(_0x27c717){if(_0x27c717[_0x0e1f('0x26')]!==_0x0e1f('0x37')){var _0x32859f={};_0x32859f[_0x27c717[_0x0e1f('0x22')]]={'$like':'%'+_0x4b6596[_0x0e1f('0x29')]['filter']+'%'};return _0x32859f;}})});}_0x4ba73f=_[_0x0e1f('0x36')]({},_0x4ba73f,_0x4b6596[_0x0e1f('0x38')]);var _0x3b51ef={'where':_0x4ba73f[_0x0e1f('0x35')]};return db['ChatTransferReport'][_0x0e1f('0x1c')](_0x3b51ef)['then'](function(_0x2187ae){_0xd29787['count']=_0x2187ae;if(_0x4b6596[_0x0e1f('0x29')][_0x0e1f('0x39')]){_0x4ba73f[_0x0e1f('0x3a')]=[{'all':!![]}];}return db[_0x0e1f('0x3b')][_0x0e1f('0x3c')](_0x4ba73f);})[_0x0e1f('0x20')](function(_0x228013){_0xd29787[_0x0e1f('0x3d')]=_0x228013;return _0xd29787;})[_0x0e1f('0x20')](respondWithFilteredResult(_0x4ae5ae,_0x4ba73f))[_0x0e1f('0x3e')](handleError(_0x4ae5ae,null));};exports[_0x0e1f('0x3f')]=function(_0x5e26b5,_0x11f9e8){var _0x4d7374={'raw':!![],'where':{'id':_0x5e26b5[_0x0e1f('0x40')]['id']}},_0xf13325={};_0xf13325[_0x0e1f('0x2c')]=_[_0x0e1f('0x41')](db[_0x0e1f('0x3b')][_0x0e1f('0x25')]);_0xf13325[_0x0e1f('0x29')]=_[_0x0e1f('0x41')](_0x5e26b5['query']);_0xf13325['filters']=_[_0x0e1f('0x2b')](_0xf13325[_0x0e1f('0x2c')],_0xf13325[_0x0e1f('0x29')]);_0x4d7374['attributes']=_[_0x0e1f('0x2b')](_0xf13325['model'],qs['fields'](_0x5e26b5[_0x0e1f('0x29')][_0x0e1f('0x2e')]));_0x4d7374['attributes']=_0x4d7374['attributes'][_0x0e1f('0x2f')]?_0x4d7374[_0x0e1f('0x2d')]:_0xf13325[_0x0e1f('0x2c')];if(_0x5e26b5['query'][_0x0e1f('0x39')]){_0x4d7374[_0x0e1f('0x3a')]=[{'all':!![]}];}_0x4d7374=_[_0x0e1f('0x36')]({},_0x4d7374,_0x5e26b5[_0x0e1f('0x38')]);return db[_0x0e1f('0x3b')]['find'](_0x4d7374)[_0x0e1f('0x20')](handleEntityNotFound(_0x11f9e8,null))[_0x0e1f('0x20')](respondWithResult(_0x11f9e8,null))['catch'](handleError(_0x11f9e8,null));};exports[_0x0e1f('0x42')]=function(_0xa166ed,_0x244d97){return db[_0x0e1f('0x3b')][_0x0e1f('0x42')](_0xa166ed['body'],{})['then'](respondWithResult(_0x244d97,0xc9))[_0x0e1f('0x3e')](handleError(_0x244d97,null));};exports[_0x0e1f('0x1f')]=function(_0x208c15,_0x22ff97){if(_0x208c15[_0x0e1f('0x43')]['id']){delete _0x208c15[_0x0e1f('0x43')]['id'];}return db[_0x0e1f('0x3b')][_0x0e1f('0x44')]({'where':{'id':_0x208c15[_0x0e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0x22ff97,null))[_0x0e1f('0x20')](saveUpdates(_0x208c15[_0x0e1f('0x43')],null))[_0x0e1f('0x20')](respondWithResult(_0x22ff97,null))[_0x0e1f('0x3e')](handleError(_0x22ff97,null));};exports['destroy']=function(_0x28d058,_0xab1e60){return db[_0x0e1f('0x3b')]['find']({'where':{'id':_0x28d058[_0x0e1f('0x40')]['id']}})['then'](handleEntityNotFound(_0xab1e60,null))[_0x0e1f('0x20')](removeEntity(_0xab1e60,null))[_0x0e1f('0x3e')](handleError(_0xab1e60,null));};exports[_0x0e1f('0x45')]=function(_0x326b1b,_0x4bc4d6){return db['ChatTransferReport'][_0x0e1f('0x45')]()[_0x0e1f('0x20')](respondWithResult(_0x4bc4d6,null))[_0x0e1f('0x3e')](handleError(_0x4bc4d6,null));};
\ No newline at end of file
+var _0xcf10=['merge','options','create','body','update','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','filter','include','findAll','rows','catch','show','keys'];(function(_0x1cf2e3,_0x4e62db){var _0x3f868f=function(_0x263baf){while(--_0x263baf){_0x1cf2e3['push'](_0x1cf2e3['shift']());}};_0x3f868f(++_0x4e62db);}(_0xcf10,0x1d6));var _0x0cf1=function(_0x34750b,_0x34aae5){_0x34750b=_0x34750b-0x0;var _0x244258=_0xcf10[_0x34750b];return _0x244258;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0cf1('0x0'));var zipdir=require(_0x0cf1('0x1'));var jsonpatch=require(_0x0cf1('0x2'));var rp=require('request-promise');var moment=require(_0x0cf1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0cf1('0x4'));var util=require(_0x0cf1('0x5'));var path=require(_0x0cf1('0x6'));var sox=require(_0x0cf1('0x7'));var csv=require(_0x0cf1('0x8'));var ejs=require(_0x0cf1('0x9'));var fs=require('fs');var fs_extra=require(_0x0cf1('0xa'));var _=require(_0x0cf1('0xb'));var squel=require('squel');var crypto=require(_0x0cf1('0xc'));var jsforce=require(_0x0cf1('0xd'));var deskjs=require(_0x0cf1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0cf1('0xf'));var Papa=require(_0x0cf1('0x10'));var Redis=require('ioredis');var authService=require(_0x0cf1('0x11'));var qs=require(_0x0cf1('0x12'));var as=require(_0x0cf1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0cf1('0x14'));var utils=require(_0x0cf1('0x15'));var config=require(_0x0cf1('0x16'));var licenseUtil=require(_0x0cf1('0x17'));var db=require(_0x0cf1('0x18'))['db'];function respondWithStatusCode(_0x320821,_0x548e5f){_0x548e5f=_0x548e5f||0xcc;return function(_0x3def44){if(_0x3def44){return _0x320821[_0x0cf1('0x19')](_0x548e5f);}return _0x320821[_0x0cf1('0x1a')](_0x548e5f)[_0x0cf1('0x1b')]();};}function respondWithResult(_0x5aa83a,_0x31935b){_0x31935b=_0x31935b||0xc8;return function(_0x3f55f3){if(_0x3f55f3){return _0x5aa83a['status'](_0x31935b)[_0x0cf1('0x1c')](_0x3f55f3);}};}function respondWithFilteredResult(_0xd426cf,_0x44894a){return function(_0x1cac30){if(_0x1cac30){var _0x3282b0=typeof _0x44894a['offset']===_0x0cf1('0x1d')&&typeof _0x44894a[_0x0cf1('0x1e')]===_0x0cf1('0x1d');var _0x6571e3=_0x1cac30[_0x0cf1('0x1f')];var _0x41c595=_0x3282b0?0x0:_0x44894a[_0x0cf1('0x20')];var _0x3d9dee=_0x3282b0?_0x1cac30[_0x0cf1('0x1f')]:_0x44894a['offset']+_0x44894a[_0x0cf1('0x1e')];var _0x2822c3;if(_0x3d9dee>=_0x6571e3){_0x3d9dee=_0x6571e3;_0x2822c3=0xc8;}else{_0x2822c3=0xce;}_0xd426cf[_0x0cf1('0x1a')](_0x2822c3);return _0xd426cf[_0x0cf1('0x21')](_0x0cf1('0x22'),_0x41c595+'-'+_0x3d9dee+'/'+_0x6571e3)['json'](_0x1cac30);}return null;};}function patchUpdates(_0x4cffc6){return function(_0x419690){try{jsonpatch[_0x0cf1('0x23')](_0x419690,_0x4cffc6,!![]);}catch(_0x98db32){return BPromise[_0x0cf1('0x24')](_0x98db32);}return _0x419690['save']();};}function saveUpdates(_0x349d1b,_0x3b420e){return function(_0x2c855c){if(_0x2c855c){return _0x2c855c['update'](_0x349d1b)[_0x0cf1('0x25')](function(_0x44523d){return _0x44523d;});}return null;};}function removeEntity(_0x1e5481,_0x171b45){return function(_0x9f4ad7){if(_0x9f4ad7){return _0x9f4ad7['destroy']()[_0x0cf1('0x25')](function(){_0x1e5481[_0x0cf1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f4ae4,_0x191849){return function(_0x890c15){if(!_0x890c15){_0x1f4ae4[_0x0cf1('0x19')](0x194);}return _0x890c15;};}function handleError(_0x50e7a7,_0x1ce204){_0x1ce204=_0x1ce204||0x1f4;return function(_0x5a4187){logger[_0x0cf1('0x26')](_0x5a4187[_0x0cf1('0x27')]);if(_0x5a4187[_0x0cf1('0x28')]){delete _0x5a4187[_0x0cf1('0x28')];}_0x50e7a7[_0x0cf1('0x1a')](_0x1ce204)[_0x0cf1('0x29')](_0x5a4187);};}exports[_0x0cf1('0x2a')]=function(_0xbb58fc,_0x1f137e){var _0x3ece12={},_0x7b78e4={},_0x4da793={'count':0x0,'rows':[]};var _0x48136e=_['map'](db[_0x0cf1('0x2b')][_0x0cf1('0x2c')],function(_0x571ae9){return{'name':_0x571ae9[_0x0cf1('0x2d')],'type':_0x571ae9[_0x0cf1('0x2e')][_0x0cf1('0x2f')]};});_0x7b78e4[_0x0cf1('0x30')]=_['map'](_0x48136e,_0x0cf1('0x28'));_0x7b78e4[_0x0cf1('0x31')]=_['keys'](_0xbb58fc[_0x0cf1('0x31')]);_0x7b78e4[_0x0cf1('0x32')]=_[_0x0cf1('0x33')](_0x7b78e4['model'],_0x7b78e4['query']);_0x3ece12[_0x0cf1('0x34')]=_[_0x0cf1('0x33')](_0x7b78e4[_0x0cf1('0x30')],qs[_0x0cf1('0x35')](_0xbb58fc[_0x0cf1('0x31')]['fields']));_0x3ece12[_0x0cf1('0x34')]=_0x3ece12[_0x0cf1('0x34')][_0x0cf1('0x36')]?_0x3ece12['attributes']:_0x7b78e4['model'];if(!_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x37')](_0x0cf1('0x38'))){_0x3ece12[_0x0cf1('0x1e')]=qs['limit'](_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x1e')]);_0x3ece12['offset']=qs['offset'](_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x20')]);}_0x3ece12['order']=qs['sort'](_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x39')]);_0x3ece12[_0x0cf1('0x3a')]=qs[_0x0cf1('0x32')](_[_0x0cf1('0x3b')](_0xbb58fc[_0x0cf1('0x31')],_0x7b78e4[_0x0cf1('0x32')]),_0x48136e);if(_0xbb58fc[_0x0cf1('0x31')]['filter']){_0x3ece12[_0x0cf1('0x3a')]=_['merge'](_0x3ece12['where'],{'$or':_[_0x0cf1('0x3c')](_0x48136e,function(_0x13e4ea){if(_0x13e4ea[_0x0cf1('0x2e')]!==_0x0cf1('0x3d')){var _0x4da89f={};_0x4da89f[_0x13e4ea[_0x0cf1('0x28')]]={'$like':'%'+_0xbb58fc[_0x0cf1('0x31')][_0x0cf1('0x3e')]+'%'};return _0x4da89f;}})});}_0x3ece12=_['merge']({},_0x3ece12,_0xbb58fc['options']);var _0x5ecea4={'where':_0x3ece12[_0x0cf1('0x3a')]};return db[_0x0cf1('0x2b')][_0x0cf1('0x1f')](_0x5ecea4)[_0x0cf1('0x25')](function(_0x612a14){_0x4da793['count']=_0x612a14;if(_0xbb58fc[_0x0cf1('0x31')]['includeAll']){_0x3ece12[_0x0cf1('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x0cf1('0x40')](_0x3ece12);})['then'](function(_0x1f6129){_0x4da793[_0x0cf1('0x41')]=_0x1f6129;return _0x4da793;})['then'](respondWithFilteredResult(_0x1f137e,_0x3ece12))[_0x0cf1('0x42')](handleError(_0x1f137e,null));};exports[_0x0cf1('0x43')]=function(_0x1f47c5,_0x2114c9){var _0x377f6c={'raw':!![],'where':{'id':_0x1f47c5['params']['id']}},_0x936ba5={};_0x936ba5[_0x0cf1('0x30')]=_[_0x0cf1('0x44')](db[_0x0cf1('0x2b')]['rawAttributes']);_0x936ba5[_0x0cf1('0x31')]=_[_0x0cf1('0x44')](_0x1f47c5[_0x0cf1('0x31')]);_0x936ba5['filters']=_[_0x0cf1('0x33')](_0x936ba5[_0x0cf1('0x30')],_0x936ba5[_0x0cf1('0x31')]);_0x377f6c[_0x0cf1('0x34')]=_[_0x0cf1('0x33')](_0x936ba5[_0x0cf1('0x30')],qs[_0x0cf1('0x35')](_0x1f47c5[_0x0cf1('0x31')][_0x0cf1('0x35')]));_0x377f6c['attributes']=_0x377f6c[_0x0cf1('0x34')][_0x0cf1('0x36')]?_0x377f6c[_0x0cf1('0x34')]:_0x936ba5[_0x0cf1('0x30')];if(_0x1f47c5[_0x0cf1('0x31')]['includeAll']){_0x377f6c['include']=[{'all':!![]}];}_0x377f6c=_[_0x0cf1('0x45')]({},_0x377f6c,_0x1f47c5[_0x0cf1('0x46')]);return db['ChatTransferReport']['find'](_0x377f6c)[_0x0cf1('0x25')](handleEntityNotFound(_0x2114c9,null))[_0x0cf1('0x25')](respondWithResult(_0x2114c9,null))[_0x0cf1('0x42')](handleError(_0x2114c9,null));};exports[_0x0cf1('0x47')]=function(_0x50f6e8,_0x406713){return db[_0x0cf1('0x2b')][_0x0cf1('0x47')](_0x50f6e8[_0x0cf1('0x48')],{})[_0x0cf1('0x25')](respondWithResult(_0x406713,0xc9))[_0x0cf1('0x42')](handleError(_0x406713,null));};exports[_0x0cf1('0x49')]=function(_0x1c022b,_0x263976){if(_0x1c022b[_0x0cf1('0x48')]['id']){delete _0x1c022b[_0x0cf1('0x48')]['id'];}return db[_0x0cf1('0x2b')]['find']({'where':{'id':_0x1c022b[_0x0cf1('0x4a')]['id']}})[_0x0cf1('0x25')](handleEntityNotFound(_0x263976,null))[_0x0cf1('0x25')](saveUpdates(_0x1c022b[_0x0cf1('0x48')],null))[_0x0cf1('0x25')](respondWithResult(_0x263976,null))[_0x0cf1('0x42')](handleError(_0x263976,null));};exports[_0x0cf1('0x4b')]=function(_0x31e3b6,_0x58815e){return db['ChatTransferReport']['find']({'where':{'id':_0x31e3b6['params']['id']}})[_0x0cf1('0x25')](handleEntityNotFound(_0x58815e,null))[_0x0cf1('0x25')](removeEntity(_0x58815e,null))[_0x0cf1('0x42')](handleError(_0x58815e,null));};exports[_0x0cf1('0x4c')]=function(_0x12a526,_0x2df567){return db['ChatTransferReport'][_0x0cf1('0x4c')]()['then'](respondWithResult(_0x2df567,null))['catch'](handleError(_0x2df567,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 5e50f47..8dee480 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 _0xf2e6=['bluebird','request-promise','path','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0xb138d9,_0x11c0a3){var _0x578de3=function(_0x4a80d8){while(--_0x4a80d8){_0xb138d9['push'](_0xb138d9['shift']());}};_0x578de3(++_0x11c0a3);}(_0xf2e6,0x194));var _0x6f2e=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xf2e6[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x6f2e('0x0'));var util=require(_0x6f2e('0x1'));var logger=require(_0x6f2e('0x2'))(_0x6f2e('0x3'));var moment=require('moment');var BPromise=require(_0x6f2e('0x4'));var rp=require(_0x6f2e('0x5'));var fs=require('fs');var path=require(_0x6f2e('0x6'));var rimraf=require('rimraf');var config=require(_0x6f2e('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x6f2e('0x8')]=function(_0x1857df,_0x54475b){return _0x1857df['define'](_0x6f2e('0x9'),attributes,{'tableName':_0x6f2e('0xa'),'paranoid':![],'indexes':[{'name':_0x6f2e('0xb'),'fields':[_0x6f2e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x077e=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path'];(function(_0x184486,_0x2155b6){var _0x47ed62=function(_0x452d9e){while(--_0x452d9e){_0x184486['push'](_0x184486['shift']());}};_0x47ed62(++_0x2155b6);}(_0x077e,0x1a7));var _0xe077=function(_0x3e2687,_0x2ca49b){_0x3e2687=_0x3e2687-0x0;var _0x22d33d=_0x077e[_0x3e2687];return _0x22d33d;};'use strict';var _=require(_0xe077('0x0'));var util=require(_0xe077('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe077('0x2'));var BPromise=require(_0xe077('0x3'));var rp=require(_0xe077('0x4'));var fs=require('fs');var path=require(_0xe077('0x5'));var rimraf=require(_0xe077('0x6'));var config=require(_0xe077('0x7'));var attributes=require(_0xe077('0x8'));module[_0xe077('0x9')]=function(_0x4ab513,_0x5cd39f){return _0x4ab513['define'](_0xe077('0xa'),attributes,{'tableName':_0xe077('0xb'),'paranoid':![],'indexes':[{'name':_0xe077('0xc'),'fields':[_0xe077('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 4e1ee18..5c3d86a 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 _0x18e7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','moment','randomstring'];(function(_0x37a5f7,_0x2d4830){var _0x44efda=function(_0x57613a){while(--_0x57613a){_0x37a5f7['push'](_0x37a5f7['shift']());}};_0x44efda(++_0x2d4830);}(_0x18e7,0x140));var _0x718e=function(_0x1b936e,_0x5e6437){_0x1b936e=_0x1b936e-0x0;var _0x5d4fc7=_0x18e7[_0x1b936e];return _0x5d4fc7;};'use strict';var _=require('lodash');var util=require(_0x718e('0x0'));var moment=require(_0x718e('0x1'));var BPromise=require('bluebird');var rs=require(_0x718e('0x2'));var fs=require('fs');var Redis=require(_0x718e('0x3'));var db=require(_0x718e('0x4'))['db'];var utils=require(_0x718e('0x5'));var logger=require(_0x718e('0x6'))(_0x718e('0x7'));var config=require(_0x718e('0x8'));var jayson=require(_0x718e('0x9'));var client=jayson[_0x718e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb656c3,_0x19bdaf,_0x545cc0){return new BPromise(function(_0x523511,_0x14c1a1){return client['request'](_0xb656c3,_0x545cc0)['then'](function(_0x3f1b18){logger[_0x718e('0xb')](_0x718e('0xc'),_0x19bdaf,'request\x20sent');logger[_0x718e('0xd')](_0x718e('0xe'),_0x19bdaf,_0x718e('0xf'),JSON['stringify'](_0x3f1b18));if(_0x3f1b18[_0x718e('0x10')]){if(_0x3f1b18[_0x718e('0x10')]['code']===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x19bdaf,_0x3f1b18[_0x718e('0x10')][_0x718e('0x11')]);return _0x14c1a1(_0x3f1b18[_0x718e('0x10')]['message']);}logger[_0x718e('0x10')](_0x718e('0xc'),_0x19bdaf,_0x3f1b18[_0x718e('0x10')][_0x718e('0x11')]);return _0x523511(_0x3f1b18[_0x718e('0x10')]['message']);}else{logger[_0x718e('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x19bdaf,_0x718e('0xf'));_0x523511(_0x3f1b18['result']['message']);}})[_0x718e('0x12')](function(_0x2833b2){logger[_0x718e('0x10')](_0x718e('0xc'),_0x19bdaf,_0x2833b2);_0x14c1a1(_0x2833b2);});});}
\ No newline at end of file
+var _0x16ca=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x25f341,_0x4dcc49){var _0x749c7b=function(_0x45433f){while(--_0x45433f){_0x25f341['push'](_0x25f341['shift']());}};_0x749c7b(++_0x4dcc49);}(_0x16ca,0xe5));var _0xa16c=function(_0xff765f,_0xdc88a9){_0xff765f=_0xff765f-0x0;var _0x36ceea=_0x16ca[_0xff765f];return _0x36ceea;};'use strict';var _=require('lodash');var util=require(_0xa16c('0x0'));var moment=require(_0xa16c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa16c('0x2'));var db=require(_0xa16c('0x3'))['db'];var utils=require(_0xa16c('0x4'));var logger=require(_0xa16c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa16c('0x6'));var client=jayson[_0xa16c('0x7')][_0xa16c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ef611,_0x18e066,_0x352b9c){return new BPromise(function(_0x40d979,_0x38ae00){return client[_0xa16c('0x9')](_0x2ef611,_0x352b9c)[_0xa16c('0xa')](function(_0x5e1bc8){logger[_0xa16c('0xb')](_0xa16c('0xc'),_0x18e066,_0xa16c('0xd'));logger[_0xa16c('0xe')](_0xa16c('0xf'),_0x18e066,_0xa16c('0xd'),JSON[_0xa16c('0x10')](_0x5e1bc8));if(_0x5e1bc8[_0xa16c('0x11')]){if(_0x5e1bc8[_0xa16c('0x11')][_0xa16c('0x12')]===0x1f4){logger['error'](_0xa16c('0xc'),_0x18e066,_0x5e1bc8[_0xa16c('0x11')][_0xa16c('0x13')]);return _0x38ae00(_0x5e1bc8[_0xa16c('0x11')][_0xa16c('0x13')]);}logger[_0xa16c('0x11')](_0xa16c('0xc'),_0x18e066,_0x5e1bc8['error'][_0xa16c('0x13')]);return _0x40d979(_0x5e1bc8[_0xa16c('0x11')]['message']);}else{logger[_0xa16c('0xb')](_0xa16c('0xc'),_0x18e066,_0xa16c('0xd'));_0x40d979(_0x5e1bc8[_0xa16c('0x14')][_0xa16c('0x13')]);}})[_0xa16c('0x15')](function(_0x381995){logger[_0xa16c('0x11')](_0xa16c('0xc'),_0x18e066,_0x381995);_0x38ae00(_0x381995);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 38365f1..e376b90 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 _0x3812=['/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x535b58,_0x48d56b){var _0x4cf320=function(_0xe47069){while(--_0xe47069){_0x535b58['push'](_0x535b58['shift']());}};_0x4cf320(++_0x48d56b);}(_0x3812,0x15f));var _0x2381=function(_0x5088ab,_0x38e7a8){_0x5088ab=_0x5088ab-0x0;var _0x1f9f55=_0x3812[_0x5088ab];return _0x1f9f55;};'use strict';var multer=require(_0x2381('0x0'));var util=require(_0x2381('0x1'));var path=require(_0x2381('0x2'));var timeout=require('connect-timeout');var express=require(_0x2381('0x3'));var router=express['Router']();var fs_extra=require(_0x2381('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2381('0x5'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x2381('0x6')]('/',auth[_0x2381('0x7')](),controller[_0x2381('0x8')]);router[_0x2381('0x6')](_0x2381('0x9'),auth[_0x2381('0x7')](),controller[_0x2381('0xa')]);router[_0x2381('0x6')](_0x2381('0xb'),auth[_0x2381('0x7')](),controller[_0x2381('0xc')]);router[_0x2381('0xd')]('/',auth['isAuthenticated'](),controller[_0x2381('0xe')]);router['put'](_0x2381('0xb'),auth['isAuthenticated'](),controller[_0x2381('0xf')]);router[_0x2381('0x10')]('/:id',auth[_0x2381('0x7')](),controller['destroy']);module[_0x2381('0x11')]=router;
\ No newline at end of file
+var _0x8284=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','isAuthenticated','describe','get','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x493bc9,_0x5e1501){var _0x552b55=function(_0x2a63eb){while(--_0x2a63eb){_0x493bc9['push'](_0x493bc9['shift']());}};_0x552b55(++_0x5e1501);}(_0x8284,0xb6));var _0x4828=function(_0x103e40,_0x33fba3){_0x103e40=_0x103e40-0x0;var _0x4b186d=_0x8284[_0x103e40];return _0x4b186d;};'use strict';var multer=require(_0x4828('0x0'));var util=require(_0x4828('0x1'));var path=require(_0x4828('0x2'));var timeout=require(_0x4828('0x3'));var express=require(_0x4828('0x4'));var router=express[_0x4828('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4828('0x6'));var interaction=require(_0x4828('0x7'));var config=require(_0x4828('0x8'));var controller=require(_0x4828('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4828('0xa')]);router['get'](_0x4828('0xb'),auth[_0x4828('0xc')](),controller[_0x4828('0xd')]);router[_0x4828('0xe')](_0x4828('0xf'),auth[_0x4828('0xc')](),controller['show']);router[_0x4828('0x10')]('/',auth[_0x4828('0xc')](),controller['create']);router[_0x4828('0x11')](_0x4828('0xf'),auth[_0x4828('0xc')](),controller[_0x4828('0x12')]);router[_0x4828('0x13')](_0x4828('0xf'),auth[_0x4828('0xc')](),controller['destroy']);module[_0x4828('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 09c76dc..2d024a6 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 _0xc3c2=['Agent','#ffffff','INTEGER','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','onlineForm','parse','getDataValue','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email'];(function(_0x35d268,_0x3c22de){var _0x481a37=function(_0x1ba721){while(--_0x1ba721){_0x35d268['push'](_0x35d268['shift']());}};_0x481a37(++_0x3c22de);}(_0xc3c2,0x1aa));var _0x2c3c=function(_0x116816,_0xa8b0a3){_0x116816=_0x116816-0x0;var _0x5e1f45=_0xc3c2[_0x116816];return _0x5e1f45;};'use strict';var Sequelize=require(_0x2c3c('0x0'));var rs=require(_0x2c3c('0x1'));module[_0x2c3c('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'unique':_0x2c3c('0x4')},'description':{'type':Sequelize[_0x2c3c('0x3')]},'mapKey':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x5')},'key':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x6')},'customerAlias':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':_0x2c3c('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2c3c('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2c3c('0x9')](_0x2c3c('0xa'),'squared'),'defaultValue':_0x2c3c('0xa')},'header_online':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0xc')},'header_offline':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xd')},'download_transcript':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2c3c('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2c3c('0x10')]},'closingQuestion':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x14')},'closingMessage':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x15')},'closingMessageButton':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xc')},'skipMessageButton':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x16')},'conditionAgreement':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x17')},'ratingType':{'type':Sequelize[_0x2c3c('0x9')](_0x2c3c('0x18'),_0x2c3c('0x19')),'defaultValue':_0x2c3c('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x2c3c('0x1a')]({'items':[{'type':_0x2c3c('0x1b'),'variable':null,'config':{'placeholder':_0x2c3c('0x1c'),'type':_0x2c3c('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x2c3c('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2c3c('0x5'),'type':_0x2c3c('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x2c3c('0x1e'))?JSON[_0x2c3c('0x1f')](this[_0x2c3c('0x20')](_0x2c3c('0x1e'))):{};},'set':function(_0x43c69a){return this['setDataValue'](_0x2c3c('0x1e'),JSON[_0x2c3c('0x1a')](_0x43c69a));}},'offlineForm':{'type':Sequelize[_0x2c3c('0x10')],'defaultValue':function(){return JSON[_0x2c3c('0x1a')]({'items':[{'type':_0x2c3c('0x1b'),'props':{'title':_0x2c3c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x2c3c('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x2c3c('0x20')]('offlineForm')?JSON[_0x2c3c('0x1f')](this[_0x2c3c('0x20')]('offlineForm')):{};},'set':function(_0x48f83d){return this['setDataValue'](_0x2c3c('0x22'),JSON[_0x2c3c('0x1a')](_0x48f83d));}},'token':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2c3c('0x3')]},'forwardOffline':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2c3c('0x3')]},'waitingTitle':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x23')},'waitingMessage':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x24')},'offlineMessageBody':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x16')},'sendUnmanaged':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2c3c('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2c3c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2c3c('0x10')],'defaultValue':function(){return _0x2c3c('0x25');}},'notificationSound':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x2c3c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x26')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':_0x2c3c('0x27')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x28')},'defaultTitle':{'type':Sequelize[_0x2c3c('0x3')]},'customerAvatar':{'type':Sequelize[_0x2c3c('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2c3c('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':_0x2c3c('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2c3c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2c3c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2c3c('0x2a')},'systemAvatar':{'type':Sequelize[_0x2c3c('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x2c3c('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![],'comment':_0x2c3c('0x2c'),'set':function(_0x332b77){if(!_0x332b77)this[_0x2c3c('0x2d')](_0x2c3c('0x2e'),null);this[_0x2c3c('0x2d')]('mandatoryDisposition',_0x332b77);}},'vidaooEscalation':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2c3c('0x3')]},'vidaooTopic':{'type':Sequelize[_0x2c3c('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x2c3c('0x3')],'defaultValue':function(){return _0x2c3c('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x2c3c('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2c3c('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9041=['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}}','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea'];(function(_0x30f270,_0x29deee){var _0x5a7fd1=function(_0x1755bb){while(--_0x1755bb){_0x30f270['push'](_0x30f270['shift']());}};_0x5a7fd1(++_0x29deee);}(_0x9041,0x1a0));var _0x1904=function(_0xff71f2,_0x3abf3e){_0xff71f2=_0xff71f2-0x0;var _0x145310=_0x9041[_0xff71f2];return _0x145310;};'use strict';var Sequelize=require(_0x1904('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x1904('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x1904('0x1')],'allowNull':![],'unique':_0x1904('0x2')},'description':{'type':Sequelize[_0x1904('0x1')]},'mapKey':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1904('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1904('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1904('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1904('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1904('0x8')](_0x1904('0x9'),_0x1904('0xa')),'defaultValue':_0x1904('0x9')},'header_online':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0xc')},'offline_chat_button':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0xd')},'download_transcript':{'type':Sequelize[_0x1904('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1904('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x1904('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x12')},'placeholderMessage':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x13')},'closingMessage':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x15')},'skipMessageButton':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x1904('0x8')](_0x1904('0x17'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x1904('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1904('0x18')],'defaultValue':function(){return JSON[_0x1904('0x19')]({'items':[{'type':_0x1904('0x1a'),'variable':null,'config':{'placeholder':_0x1904('0x1b'),'type':_0x1904('0x1c'),'required':!![]},'props':{'title':_0x1904('0x1b'),'helpText':''}},{'type':_0x1904('0x1a'),'props':{'title':_0x1904('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x1904('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1904('0x1d'))?JSON[_0x1904('0x1e')](this[_0x1904('0x1f')](_0x1904('0x1d'))):{};},'set':function(_0x5e44c0){return this[_0x1904('0x20')](_0x1904('0x1d'),JSON[_0x1904('0x19')](_0x5e44c0));}},'offlineForm':{'type':Sequelize[_0x1904('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1904('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1904('0x3'),'type':_0x1904('0x3')},'variable':null},{'type':_0x1904('0x21'),'config':{'placeholder':_0x1904('0x22')},'props':{'title':_0x1904('0x22'),'helpText':_0x1904('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x1904('0x1f')](_0x1904('0x24'))?JSON[_0x1904('0x1e')](this[_0x1904('0x1f')]('offlineForm')):{};},'set':function(_0x194b43){return this['setDataValue']('offlineForm',JSON['stringify'](_0x194b43));}},'token':{'type':Sequelize[_0x1904('0x1')],'defaultValue':function(){return rs[_0x1904('0x25')]();}},'autoclose':{'type':Sequelize[_0x1904('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1904('0x1')]},'forwardOffline':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1904('0x1')]},'waitingTitle':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x26')},'waitingMessage':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x1904('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x29')},'skipUnmanaged':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1904('0x15')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1904('0x18')]},'showAgentAvatar':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1904('0x1')]},'notificationTemplate':{'type':Sequelize[_0x1904('0x18')],'defaultValue':function(){return _0x1904('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x1904('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x1904('0x1')],'defaultValue':_0x1904('0x2b')},'defaultTitle':{'type':Sequelize[_0x1904('0x1')]},'customerAvatar':{'type':Sequelize[_0x1904('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1904('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1904('0x1')],'allowNull':![],'defaultValue':_0x1904('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1904('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1904('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1904('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x1904('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1904('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![],'comment':_0x1904('0x2d'),'set':function(_0x1d9423){if(!_0x1d9423)this['setDataValue'](_0x1904('0x2e'),null);this[_0x1904('0x20')](_0x1904('0x2f'),_0x1d9423);}},'vidaooEscalation':{'type':Sequelize[_0x1904('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1904('0x1')]},'vidaooTopic':{'type':Sequelize[_0x1904('0x1')],'allowNull':![],'defaultValue':_0x1904('0x30')},'vidaooNote':{'type':Sequelize[_0x1904('0x1')],'defaultValue':function(){return _0x1904('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x1904('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'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 3f3f7ba..116440a 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 _0xd2fe=['includeAll','show','params','rawAttributes','include','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','find','ChatWebsiteId','Disposition','getDispositions','nolimit','map','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','../../config/license/util','isNil','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','createdAt','updatedAt','difference','CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','applications','list','asc','account','Applications','contact','customerIp','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','chatLicenseExceeded','all','some','utf8','remote','x-real-ip','connection','remoteAddress','replace','render','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','fromKey','getOfflineMessages','Attachments','rows','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','update','destroy','get','ChatWebsites','name','index','Pause','mandatoryDispositionPause','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','ChatWebsite'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0xd2fe,0xea));var _0xed2f=function(_0x2513ce,_0xf33af6){_0x2513ce=_0x2513ce-0x0;var _0x19e1e7=_0xd2fe[_0x2513ce];return _0x19e1e7;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xed2f('0x0'));var util=require('util');var path=require(_0xed2f('0x1'));var ejs=require(_0xed2f('0x2'));var fs=require('fs');var fs_extra=require(_0xed2f('0x3'));var _=require(_0xed2f('0x4'));var querystring=require(_0xed2f('0x5'));var Redis=require(_0xed2f('0x6'));var qs=require(_0xed2f('0x7'));var logger=require(_0xed2f('0x8'))('api');var config=require(_0xed2f('0x9'));var db=require(_0xed2f('0xa'))['db'];config['redis']=_[_0xed2f('0xb')](config['redis'],{'host':_0xed2f('0xc'),'port':0x18eb});var socket=require(_0xed2f('0xd'))(new Redis(config[_0xed2f('0xe')]));require(_0xed2f('0xf'))[_0xed2f('0x10')](socket);var jayson=require(_0xed2f('0x11'));var client=jayson[_0xed2f('0x12')][_0xed2f('0x13')]({'port':0x232c});var client9002=jayson[_0xed2f('0x12')][_0xed2f('0x13')]({'port':0x232a});var client9003=jayson[_0xed2f('0x12')][_0xed2f('0x13')]({'port':0x232b});var client9001=jayson[_0xed2f('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3d5482,_0x577d76,_0x1fb51d,_0x16b8ae){return new BPromise(function(_0x55bd1f,_0x447eba){var _0x5ebd19=_0x16b8ae||client;return _0x5ebd19[_0xed2f('0x14')](_0x3d5482,_0x1fb51d)[_0xed2f('0x15')](function(_0x3d7c3c){logger[_0xed2f('0x16')](_0xed2f('0x17'),_0x577d76,_0xed2f('0x18'));logger['debug'](_0xed2f('0x19'),_0x577d76,_0xed2f('0x18'),JSON[_0xed2f('0x1a')](_0x3d7c3c));if(_0x3d7c3c[_0xed2f('0x1b')]){if(_0x3d7c3c[_0xed2f('0x1b')][_0xed2f('0x1c')]===0x1f4){logger['error'](_0xed2f('0x17'),_0x577d76,_0x3d7c3c[_0xed2f('0x1b')][_0xed2f('0x1d')]);return _0x447eba(_0x3d7c3c['error'][_0xed2f('0x1d')]);}logger['error'](_0xed2f('0x17'),_0x577d76,_0x3d7c3c[_0xed2f('0x1b')][_0xed2f('0x1d')]);return _0x55bd1f(_0x3d7c3c[_0xed2f('0x1b')][_0xed2f('0x1d')]);}else{logger[_0xed2f('0x16')](_0xed2f('0x17'),_0x577d76,_0xed2f('0x18'));_0x55bd1f(_0x3d7c3c[_0xed2f('0x1e')][_0xed2f('0x1d')]);}})[_0xed2f('0x1f')](function(_0x3dfa11){logger[_0xed2f('0x1b')](_0xed2f('0x17'),_0x577d76,_0x3dfa11);_0x447eba(_0x3dfa11);});});}function respondWithStatusCode(_0x71a6ac,_0x511eb8){_0x511eb8=_0x511eb8||0xcc;return function(_0x1d15d9){if(_0x1d15d9){return _0x71a6ac[_0xed2f('0x20')](_0x511eb8);}return _0x71a6ac['status'](_0x511eb8)[_0xed2f('0x21')]();};}function respondWithResult(_0x37e512,_0x3e4e64){_0x3e4e64=_0x3e4e64||0xc8;return function(_0x50b63c){if(_0x50b63c){return _0x37e512['status'](_0x3e4e64)[_0xed2f('0x22')](_0x50b63c);}};}function respondWithFilteredResult(_0x30e49d,_0x55b2e3){return function(_0x457319){if(_0x457319){var _0x2d226c=typeof _0x55b2e3[_0xed2f('0x23')]===_0xed2f('0x24')&&typeof _0x55b2e3[_0xed2f('0x25')]===_0xed2f('0x24');var _0x271695=_0x457319[_0xed2f('0x26')];var _0x5b506d=_0x2d226c?0x0:_0x55b2e3['offset'];var _0x55ba58=_0x2d226c?_0x457319[_0xed2f('0x26')]:_0x55b2e3['offset']+_0x55b2e3['limit'];var _0x46ef43;if(_0x55ba58>=_0x271695){_0x55ba58=_0x271695;_0x46ef43=0xc8;}else{_0x46ef43=0xce;}_0x30e49d[_0xed2f('0x27')](_0x46ef43);return _0x30e49d['set'](_0xed2f('0x28'),_0x5b506d+'-'+_0x55ba58+'/'+_0x271695)['json'](_0x457319);}return null;};}function saveUpdates(_0x519131){return function(_0x49d019){if(_0x49d019){return _0x49d019[_0xed2f('0x29')](_0x519131)[_0xed2f('0x15')](function(_0x1e5637){return _0x1e5637;});}return null;};}function removeEntity(_0x3bb0af){return function(_0x27814a){if(_0x27814a){return _0x27814a[_0xed2f('0x2a')]()[_0xed2f('0x15')](function(){var _0x28f425=_0x27814a[_0xed2f('0x2b')]({'plain':!![]});var _0x2457ec=_0xed2f('0x2c');return db['UserProfileResource'][_0xed2f('0x2a')]({'where':{'type':_0x2457ec,'resourceId':_0x28f425['id']}})[_0xed2f('0x15')](function(){return _0x27814a;});})[_0xed2f('0x15')](function(){_0x3bb0af[_0xed2f('0x27')](0xcc)[_0xed2f('0x21')]();});}};}function handleEntityNotFound(_0x3de9e2){return function(_0x4ee256){if(!_0x4ee256){_0x3de9e2[_0xed2f('0x20')](0x194);}return _0x4ee256;};}function handleError(_0x413832,_0x3b40dc){_0x3b40dc=_0x3b40dc||0x1f4;return function(_0x52485c){logger[_0xed2f('0x1b')](_0x52485c['stack']);if(_0x52485c['name']){delete _0x52485c[_0xed2f('0x2d')];}_0x413832[_0xed2f('0x27')](_0x3b40dc)['send'](_0x52485c);};}exports[_0xed2f('0x2e')]=function(_0x580857,_0x390e7e){var _0x12d5d4={'include':[{'model':db[_0xed2f('0x2f')],'as':_0xed2f('0x30')}]},_0xc5ed0e={},_0x1c7698={'count':0x0,'rows':[]};var _0x1ecaca=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x29a68e){return{'name':_0x29a68e['fieldName'],'type':_0x29a68e[_0xed2f('0x31')][_0xed2f('0x32')]};});_0xc5ed0e['model']=_['map'](_0x1ecaca,_0xed2f('0x2d'));_0xc5ed0e[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x580857[_0xed2f('0x33')]);_0xc5ed0e['filters']=_[_0xed2f('0x35')](_0xc5ed0e[_0xed2f('0x36')],_0xc5ed0e['query']);_0x12d5d4[_0xed2f('0x37')]=_[_0xed2f('0x35')](_0xc5ed0e[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x580857[_0xed2f('0x33')]['fields']));_0x12d5d4[_0xed2f('0x37')]=_0x12d5d4[_0xed2f('0x37')][_0xed2f('0x39')]?_0x12d5d4['attributes']:_0xc5ed0e[_0xed2f('0x36')];if(!_0x580857['query'][_0xed2f('0x3a')]('nolimit')){_0x12d5d4['limit']=qs['limit'](_0x580857[_0xed2f('0x33')]['limit']);_0x12d5d4[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0x580857[_0xed2f('0x33')]['offset']);}_0x12d5d4[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0x580857[_0xed2f('0x33')][_0xed2f('0x3c')]);_0x12d5d4[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x580857['query'],_0xc5ed0e[_0xed2f('0x3e')]),_0x1ecaca);if(_0x580857[_0xed2f('0x33')]['filter']){_0x12d5d4[_0xed2f('0x3d')]=_[_0xed2f('0x40')](_0x12d5d4[_0xed2f('0x3d')],{'$or':_['map'](_0x1ecaca,function(_0x3bfc32){if(_0x3bfc32['type']!==_0xed2f('0x41')){var _0x1a576a={};_0x1a576a[_0x3bfc32[_0xed2f('0x2d')]]={'$like':'%'+_0x580857[_0xed2f('0x33')][_0xed2f('0x42')]+'%'};return _0x1a576a;}})});}_0x12d5d4=_[_0xed2f('0x40')]({},_0x12d5d4,_0x580857[_0xed2f('0x43')]);var _0x2105a9={'where':_0x12d5d4[_0xed2f('0x3d')]};return db[_0xed2f('0x44')][_0xed2f('0x26')](_0x2105a9)[_0xed2f('0x15')](function(_0x535bf3){_0x1c7698['count']=_0x535bf3;if(_0x580857['query'][_0xed2f('0x45')]){_0x12d5d4['include']=[{'all':!![]}];}return db[_0xed2f('0x44')]['findAll'](_0x12d5d4);})[_0xed2f('0x15')](function(_0x468c9a){_0x1c7698['rows']=_0x468c9a;return _0x1c7698;})[_0xed2f('0x15')](respondWithFilteredResult(_0x390e7e,_0x12d5d4))[_0xed2f('0x1f')](handleError(_0x390e7e,null));};exports[_0xed2f('0x46')]=function(_0x16e7f3,_0x10e6f6){var _0x581251={'raw':![],'where':{'id':_0x16e7f3[_0xed2f('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xed2f('0x30')}]},_0x5f4f09={};_0x5f4f09[_0xed2f('0x36')]=_[_0xed2f('0x34')](db[_0xed2f('0x44')][_0xed2f('0x48')]);_0x5f4f09[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x16e7f3[_0xed2f('0x33')]);_0x5f4f09[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x5f4f09[_0xed2f('0x36')],_0x5f4f09[_0xed2f('0x33')]);_0x581251[_0xed2f('0x37')]=_['intersection'](_0x5f4f09[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x16e7f3[_0xed2f('0x33')][_0xed2f('0x38')]));_0x581251[_0xed2f('0x37')]=_0x581251['attributes'][_0xed2f('0x39')]?_0x581251['attributes']:_0x5f4f09[_0xed2f('0x36')];if(_0x16e7f3[_0xed2f('0x33')][_0xed2f('0x45')]){_0x581251[_0xed2f('0x49')]=[{'all':!![]}];}_0x581251=_['merge']({},_0x581251,_0x16e7f3[_0xed2f('0x43')]);return db[_0xed2f('0x44')]['find'](_0x581251)[_0xed2f('0x15')](handleEntityNotFound(_0x10e6f6,null))[_0xed2f('0x15')](respondWithResult(_0x10e6f6,null))[_0xed2f('0x1f')](handleError(_0x10e6f6,null));};exports[_0xed2f('0x4a')]=function(_0xb39c8b,_0x190e9c){return db[_0xed2f('0x44')][_0xed2f('0x4a')](_0xb39c8b[_0xed2f('0x4b')],{})[_0xed2f('0x15')](function(_0x4d5eac){var _0x3bd9fb=_0xb39c8b['user'][_0xed2f('0x2b')]({'plain':!![]});if(!_0x3bd9fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bd9fb[_0xed2f('0x4c')]===_0xed2f('0x4d')){var _0x1b16f1=_0x4d5eac['get']({'plain':!![]});var _0x403531=_0xed2f('0x2c');return db[_0xed2f('0x4e')]['find']({'where':{'name':_0x403531,'userProfileId':_0x3bd9fb[_0xed2f('0x4f')]},'raw':!![]})[_0xed2f('0x15')](function(_0x53fdfe){if(_0x53fdfe&&_0x53fdfe[_0xed2f('0x50')]===0x0){return db[_0xed2f('0x51')]['create']({'name':_0x1b16f1[_0xed2f('0x2d')],'resourceId':_0x1b16f1['id'],'type':_0x53fdfe[_0xed2f('0x2d')],'sectionId':_0x53fdfe['id']},{})[_0xed2f('0x15')](function(){return _0x4d5eac;});}else{return _0x4d5eac;}})[_0xed2f('0x1f')](function(_0x33315f){logger[_0xed2f('0x1b')](_0xed2f('0x52'),_0x33315f);throw _0x33315f;});}return _0x4d5eac;})['then'](respondWithResult(_0x190e9c,0xc9))[_0xed2f('0x1f')](handleError(_0x190e9c,null));};exports['update']=function(_0x4790b9,_0x2eacc6){if(_0x4790b9[_0xed2f('0x4b')]['id']){delete _0x4790b9[_0xed2f('0x4b')]['id'];}return db[_0xed2f('0x44')]['find']({'where':{'id':_0x4790b9['params']['id']},'include':[{'model':db[_0xed2f('0x2f')],'as':_0xed2f('0x30')}]})[_0xed2f('0x15')](handleEntityNotFound(_0x2eacc6,null))[_0xed2f('0x15')](saveUpdates(_0x4790b9[_0xed2f('0x4b')],null))[_0xed2f('0x15')](respondWithResult(_0x2eacc6,null))[_0xed2f('0x1f')](handleError(_0x2eacc6,null));};exports[_0xed2f('0x2a')]=function(_0x44b95c,_0x2f40af){return db[_0xed2f('0x44')]['find']({'where':{'id':_0x44b95c['params']['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x2f40af,null))[_0xed2f('0x15')](removeEntity(_0x2f40af,null))['catch'](handleError(_0x2f40af,null));};exports['describe']=function(_0x16cff7,_0xa75c7d){return db[_0xed2f('0x44')][_0xed2f('0x53')]()['then'](respondWithResult(_0xa75c7d,null))[_0xed2f('0x1f')](handleError(_0xa75c7d,null));};exports[_0xed2f('0x54')]=function(_0x3ec741,_0x14649d){if(_0x3ec741[_0xed2f('0x4b')]['id']){delete _0x3ec741[_0xed2f('0x4b')]['id'];}return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x3ec741[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x14649d,null))[_0xed2f('0x15')](function(_0x316c93){if(_0x316c93){_0x3ec741[_0xed2f('0x4b')][_0xed2f('0x56')]=_0x316c93['id'];return db[_0xed2f('0x57')][_0xed2f('0x4a')](_0x3ec741['body']);}})['then'](respondWithResult(_0x14649d,null))[_0xed2f('0x1f')](handleError(_0x14649d,null));};exports[_0xed2f('0x58')]=function(_0xcb991c,_0x25810f){var _0x44659d={'raw':![],'where':{}};var _0x241c4f={};var _0x1f67f8={'count':0x0,'rows':[]};return db[_0xed2f('0x44')]['findOne']({'where':{'id':_0xcb991c[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x25810f,null))[_0xed2f('0x15')](function(_0x22ff2b){if(_0x22ff2b){_0x241c4f[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['Disposition']['rawAttributes']);_0x241c4f['query']=_['keys'](_0xcb991c[_0xed2f('0x33')]);_0x241c4f[_0xed2f('0x3e')]=_['intersection'](_0x241c4f[_0xed2f('0x36')],_0x241c4f[_0xed2f('0x33')]);_0x44659d['attributes']=_[_0xed2f('0x35')](_0x241c4f[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0xcb991c[_0xed2f('0x33')]['fields']));_0x44659d[_0xed2f('0x37')]=_0x44659d[_0xed2f('0x37')][_0xed2f('0x39')]?_0x44659d['attributes']:_0x241c4f[_0xed2f('0x36')];if(!_0xcb991c[_0xed2f('0x33')]['hasOwnProperty'](_0xed2f('0x59'))){_0x44659d[_0xed2f('0x25')]=qs['limit'](_0xcb991c[_0xed2f('0x33')]['limit']);_0x44659d[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0xcb991c[_0xed2f('0x33')][_0xed2f('0x23')]);}_0x44659d[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0xcb991c[_0xed2f('0x33')]['sort']);_0x44659d[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0xcb991c[_0xed2f('0x33')],_0x241c4f[_0xed2f('0x3e')]));_0x44659d[_0xed2f('0x3d')][_0xed2f('0x56')]=_0x22ff2b['id'];if(_0xcb991c[_0xed2f('0x33')][_0xed2f('0x42')]){_0x44659d[_0xed2f('0x3d')]=_[_0xed2f('0x40')](_0x44659d['where'],{'$or':_[_0xed2f('0x5a')](_0x44659d[_0xed2f('0x37')],function(_0x473b02){var _0x58bdc2={};_0x58bdc2[_0x473b02]={'$like':'%'+_0xcb991c[_0xed2f('0x33')][_0xed2f('0x42')]+'%'};return _0x58bdc2;})});}_0x44659d=_['merge']({},_0x44659d,_0xcb991c['options']);return db[_0xed2f('0x57')]['count']({'where':_0x44659d['where']})[_0xed2f('0x15')](function(_0x522ff3){_0x1f67f8['count']=_0x522ff3;if(_0xcb991c[_0xed2f('0x33')][_0xed2f('0x45')]){_0x44659d['include']=[{'all':!![]}];}return db[_0xed2f('0x57')][_0xed2f('0x5b')](_0x44659d);})[_0xed2f('0x15')](function(_0x7a1da7){_0x1f67f8['rows']=_0x7a1da7;return _0x1f67f8;});}})[_0xed2f('0x15')](respondWithFilteredResult(_0x25810f,_0x44659d))[_0xed2f('0x1f')](handleError(_0x25810f,null));};exports[_0xed2f('0x5c')]=function(_0x476b87,_0x5b1b8b){return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x476b87['params']['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x5b1b8b,null))['then'](function(_0x48db78){if(_0x48db78){return _0x48db78['removeDispositions'](_0x476b87[_0xed2f('0x33')]['ids']);}})[_0xed2f('0x15')](respondWithStatusCode(_0x5b1b8b,null))['catch'](handleError(_0x5b1b8b,null));};exports[_0xed2f('0x5d')]=function(_0x18ed97,_0x5adae1){if(_0x18ed97[_0xed2f('0x4b')]['id']){delete _0x18ed97['body']['id'];}return db[_0xed2f('0x44')]['find']({'where':{'id':_0x18ed97[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x5adae1,null))[_0xed2f('0x15')](function(_0x209c24){if(_0x209c24){_0x18ed97[_0xed2f('0x4b')][_0xed2f('0x56')]=_0x209c24['id'];return db[_0xed2f('0x5e')][_0xed2f('0x4a')](_0x18ed97[_0xed2f('0x4b')]);}})[_0xed2f('0x15')](respondWithResult(_0x5adae1,null))['catch'](handleError(_0x5adae1,null));};exports[_0xed2f('0x5f')]=function(_0x5ed2b5,_0x47ee4a){var _0xefa13b={'raw':![],'where':{}};var _0x4164d6={};var _0x3d15bc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xed2f('0x60')]({'where':{'id':_0x5ed2b5[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x47ee4a,null))[_0xed2f('0x15')](function(_0xc34b74){if(_0xc34b74){_0x4164d6[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['CannedAnswer']['rawAttributes']);_0x4164d6[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x5ed2b5[_0xed2f('0x33')]);_0x4164d6[_0xed2f('0x3e')]=_['intersection'](_0x4164d6[_0xed2f('0x36')],_0x4164d6[_0xed2f('0x33')]);_0xefa13b[_0xed2f('0x37')]=_['intersection'](_0x4164d6[_0xed2f('0x36')],qs['fields'](_0x5ed2b5[_0xed2f('0x33')][_0xed2f('0x38')]));_0xefa13b[_0xed2f('0x37')]=_0xefa13b[_0xed2f('0x37')][_0xed2f('0x39')]?_0xefa13b[_0xed2f('0x37')]:_0x4164d6['model'];if(!_0x5ed2b5['query'][_0xed2f('0x3a')](_0xed2f('0x59'))){_0xefa13b[_0xed2f('0x25')]=qs[_0xed2f('0x25')](_0x5ed2b5['query'][_0xed2f('0x25')]);_0xefa13b['offset']=qs[_0xed2f('0x23')](_0x5ed2b5['query']['offset']);}_0xefa13b[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0x5ed2b5['query'][_0xed2f('0x3c')]);_0xefa13b[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x5ed2b5[_0xed2f('0x33')],_0x4164d6[_0xed2f('0x3e')]));_0xefa13b['where'][_0xed2f('0x56')]=_0xc34b74['id'];if(_0x5ed2b5[_0xed2f('0x33')][_0xed2f('0x42')]){_0xefa13b['where']=_[_0xed2f('0x40')](_0xefa13b[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0xefa13b[_0xed2f('0x37')],function(_0x4c575a){var _0x465ef8={};_0x465ef8[_0x4c575a]={'$like':'%'+_0x5ed2b5[_0xed2f('0x33')][_0xed2f('0x42')]+'%'};return _0x465ef8;})});}_0xefa13b=_[_0xed2f('0x40')]({},_0xefa13b,_0x5ed2b5[_0xed2f('0x43')]);return db[_0xed2f('0x5e')][_0xed2f('0x26')]({'where':_0xefa13b[_0xed2f('0x3d')]})[_0xed2f('0x15')](function(_0x419f98){_0x3d15bc[_0xed2f('0x26')]=_0x419f98;if(_0x5ed2b5[_0xed2f('0x33')]['includeAll']){_0xefa13b[_0xed2f('0x49')]=[{'all':!![]}];}return db[_0xed2f('0x5e')][_0xed2f('0x5b')](_0xefa13b);})[_0xed2f('0x15')](function(_0x56301d){_0x3d15bc['rows']=_0x56301d;return _0x3d15bc;});}})['then'](respondWithFilteredResult(_0x47ee4a,_0xefa13b))[_0xed2f('0x1f')](handleError(_0x47ee4a,null));};exports[_0xed2f('0x61')]=function(_0x3149fc,_0x2cafba){return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x3149fc[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2cafba,null))[_0xed2f('0x15')](function(_0x3fbf3c){if(_0x3fbf3c){return _0x3fbf3c[_0xed2f('0x61')](_0x3149fc[_0xed2f('0x33')][_0xed2f('0x62')]);}})['then'](respondWithStatusCode(_0x2cafba,null))[_0xed2f('0x1f')](handleError(_0x2cafba,null));};exports[_0xed2f('0x63')]=function(_0x101fd9,_0x457dad){_0x101fd9[_0xed2f('0x4b')][_0xed2f('0x64')]=_0x101fd9[_0xed2f('0x65')][_0xed2f('0x66')];return db['ChatWebsite'][_0xed2f('0x55')]({'where':{'id':_0x101fd9['params']['id']}})['then'](handleEntityNotFound(_0x457dad,null))['then'](saveUpdates(_0x101fd9[_0xed2f('0x4b')],null))[_0xed2f('0x15')](respondWithResult(_0x457dad,null))[_0xed2f('0x1f')](handleError(_0x457dad,null));};exports[_0xed2f('0x67')]=function(_0x5a3813,_0x28a00c){_0x5a3813['body'][_0xed2f('0x68')]=_0x5a3813['file'][_0xed2f('0x66')];return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x5a3813['params']['id']}})['then'](handleEntityNotFound(_0x28a00c,null))['then'](saveUpdates(_0x5a3813[_0xed2f('0x4b')],null))[_0xed2f('0x15')](respondWithResult(_0x28a00c,null))[_0xed2f('0x1f')](handleError(_0x28a00c,null));};exports[_0xed2f('0x69')]=function(_0x3c36f5,_0x14b288){_0x3c36f5[_0xed2f('0x4b')][_0xed2f('0x6a')]=_0x3c36f5[_0xed2f('0x65')][_0xed2f('0x66')];return db['ChatWebsite'][_0xed2f('0x55')]({'where':{'id':_0x3c36f5[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x14b288,null))[_0xed2f('0x15')](saveUpdates(_0x3c36f5[_0xed2f('0x4b')],null))['then'](respondWithResult(_0x14b288,null))['catch'](handleError(_0x14b288,null));};exports[_0xed2f('0x6b')]=function(_0x45bc93,_0x534a16){_0x45bc93[_0xed2f('0x4b')][_0xed2f('0x6c')]=_0x45bc93[_0xed2f('0x65')][_0xed2f('0x66')];return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x45bc93[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x534a16,null))['then'](saveUpdates(_0x45bc93[_0xed2f('0x4b')],null))['then'](respondWithResult(_0x534a16,null))['catch'](handleError(_0x534a16,null));};exports['getLogo']=function(_0x3206ff,_0x3807a4){var _0x344188=path['join'](config[_0xed2f('0x6d')],'server/files/images/logos/default_logo.svg');var _0x3ca44c={'where':{'id':_0x3206ff[_0xed2f('0x47')]['id']},'attributes':['id',_0xed2f('0x64')],'raw':!![]};var _0x507975=![];return require(_0xed2f('0x6e'))['getLicense']()[_0xed2f('0x15')](function(_0x3231fe){if(_0x3231fe){_0x507975=_0x3231fe['custom'];}})[_0xed2f('0x15')](function(){return db['ChatWebsite']['find'](_0x3ca44c);})[_0xed2f('0x15')](handleEntityNotFound(_0x3807a4,null))[_0xed2f('0x15')](function(_0x2014be){if(_0x2014be){if(!_[_0xed2f('0x6f')](_0x2014be['sitepic'])){if(fs[_0xed2f('0x70')](path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0x72'),_0x2014be[_0xed2f('0x64')]))&&_0x507975){_0x344188=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0x72'),_0x2014be['sitepic']);}}return _0x3807a4['download'](_0x344188);}})[_0xed2f('0x1f')](handleError(_0x3807a4,null));};exports[_0xed2f('0x73')]=function(_0x1722d6,_0xbbc261){var _0x21c137=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0xac77e3={'where':{'id':_0x1722d6[_0xed2f('0x47')]['id']},'attributes':['id',_0xed2f('0x68')],'raw':!![]};return db['ChatWebsite']['find'](_0xac77e3)[_0xed2f('0x15')](handleEntityNotFound(_0xbbc261,null))[_0xed2f('0x15')](function(_0x2f8100){if(_0x2f8100){if(!_['isNil'](_0x2f8100[_0xed2f('0x68')])){if(fs['existsSync'](path['join'](config[_0xed2f('0x6d')],_0xed2f('0x74'),_0x2f8100['agentAvatar']))){_0x21c137=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server/files/images/avatars/',_0x2f8100['agentAvatar']);}}return _0xbbc261[_0xed2f('0x75')](_0x21c137);}})[_0xed2f('0x1f')](handleError(_0xbbc261,null));};exports[_0xed2f('0x76')]=function(_0x158a2a,_0x4967cf){var _0xf674e1=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0x77'));var _0x4a41f8={'where':{'id':_0x158a2a[_0xed2f('0x47')]['id']},'attributes':['id',_0xed2f('0x6a'),_0xed2f('0x78')],'raw':!![]};return db[_0xed2f('0x44')]['find'](_0x4a41f8)['then'](handleEntityNotFound(_0x4967cf,null))[_0xed2f('0x15')](function(_0x46ae5e){if(_0x46ae5e){if(!_[_0xed2f('0x6f')](_0x46ae5e['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0xed2f('0x6d')],'server/files/images/avatars/',_0x46ae5e[_0xed2f('0x6a')]))&&_0x46ae5e[_0xed2f('0x78')]){_0xf674e1=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server/files/images/avatars/',_0x46ae5e['customerAvatar']);}}return _0x4967cf[_0xed2f('0x75')](_0xf674e1);}})[_0xed2f('0x1f')](handleError(_0x4967cf,null));};exports[_0xed2f('0x79')]=function(_0x5f2aef,_0x901907){var _0x5eb22c=path['join'](config['root'],_0xed2f('0x7a'));var _0x1653ac={'where':{'id':_0x5f2aef[_0xed2f('0x47')]['id']},'attributes':['id',_0xed2f('0x6c')],'raw':!![]};return db['ChatWebsite']['find'](_0x1653ac)[_0xed2f('0x15')](handleEntityNotFound(_0x901907,null))[_0xed2f('0x15')](function(_0x5ee73c){if(_0x5ee73c){if(!_[_0xed2f('0x6f')](_0x5ee73c['systemAvatar'])){if(fs['existsSync'](path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server/files/images/avatars/',_0x5ee73c['systemAvatar']))){_0x5eb22c=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0x74'),_0x5ee73c[_0xed2f('0x6c')]);}}return _0x901907[_0xed2f('0x75')](_0x5eb22c);}})[_0xed2f('0x1f')](handleError(_0x901907,null));};exports[_0xed2f('0x7b')]=function(_0x2d6cb8,_0x547510){var _0x29a9c6=require(_0xed2f('0x7c'));var _0x5ba6e7=new _0x29a9c6();var _0x4b9777=_0x5ba6e7[_0xed2f('0x7d')](_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x7f')])[_0xed2f('0x80')]();var _0x59dc89={'body':_0x2d6cb8[_0xed2f('0x4b')],'channel':'chat'};var _0x343b3f=[];var _0x135d3b=[];var _0x4df2d7={};var _0x43f02c=![];return db[_0xed2f('0x81')]['describe']()['then'](function(_0x5aeda5){if(!_0x5aeda5){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x343b3f=_['difference'](_[_0xed2f('0x34')](_0x5aeda5),[_0xed2f('0x82'),_0xed2f('0x83')]);_0x135d3b=_[_0xed2f('0x84')](_[_0xed2f('0x34')](_0x5aeda5),[_0xed2f('0x82'),_0xed2f('0x83'),_0xed2f('0x85'),_0xed2f('0x86')]);if(_0x2d6cb8[_0xed2f('0x4b')]['id']){delete _0x2d6cb8[_0xed2f('0x4b')]['id'];}if(_[_0xed2f('0x6f')](_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x87')])){throw new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0x8a'));}if(_['isNil'](_0x2d6cb8[_0xed2f('0x4b')]['body'])||_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x4b')]===''){throw new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0x8b'));}if(_[_0xed2f('0x6f')](_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x8c')])){throw new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x135d3b);}if(!_['includes'](_0x135d3b,_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x8c')])){throw new db['Sequelize']['ValidationError'](_0xed2f('0x8d')+_0x135d3b);}_0x4df2d7[_0x2d6cb8['body']['mapKey']]=_0x2d6cb8[_0xed2f('0x4b')]['from'];})[_0xed2f('0x15')](function(){return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x2d6cb8[_0xed2f('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0xed2f('0x8e'),'include':[{'model':db['CmContact'],'as':_0xed2f('0x8f'),'where':_0x4df2d7,'limit':0x1,'order':[[_0xed2f('0x83'),_0xed2f('0x90')]]}]},{'model':db[_0xed2f('0x91')],'as':'Applications'}]});})[_0xed2f('0x15')](handleEntityNotFound(_0x547510,null))[_0xed2f('0x15')](function(_0x53a7f0){if(_0x53a7f0&&_0x53a7f0[_0xed2f('0x8e')]){_0x59dc89['account']=_0x53a7f0;_0x59dc89[_0xed2f('0x92')]=_0x53a7f0['Applications'];_0x59dc89[_0xed2f('0x93')]=_0x53a7f0[_0xed2f('0x8e')];_0x59dc89[_0xed2f('0x92')]=_['orderBy'](_0x59dc89[_0xed2f('0x92')],['priority'],[_0xed2f('0x94')]);if(_0x59dc89[_0xed2f('0x95')][_0xed2f('0x96')]){delete _0x59dc89[_0xed2f('0x95')][_0xed2f('0x96')];}if(_0x59dc89['account'][_0xed2f('0x8e')]&&_0x59dc89[_0xed2f('0x95')]['List'][_0xed2f('0x8f')]['length']){return _0x59dc89[_0xed2f('0x95')][_0xed2f('0x8e')][_0xed2f('0x8f')][0x0];}var _0x400059=_[_0xed2f('0xb')](_0x2d6cb8['body'],{'firstName':_0x2d6cb8[_0xed2f('0x4b')]['from'],'ListId':_0x53a7f0[_0xed2f('0x86')]});_0x400059[_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x8c')]]=_0x2d6cb8[_0xed2f('0x4b')]['from'];return db[_0xed2f('0x81')][_0xed2f('0x4a')](_0x400059,{'fields':_0x343b3f,'raw':!![]});}})[_0xed2f('0x15')](handleEntityNotFound(_0x547510,null))[_0xed2f('0x15')](function(_0x589255){_0x59dc89[_0xed2f('0x97')]=_0x589255;var _0x2c1615=_0x2d6cb8['body'][_0xed2f('0x98')];if(_0x2d6cb8[_0xed2f('0x7e')]['cf-connecting-ip']){_0x2c1615=_0x2d6cb8[_0xed2f('0x7e')]['cf-connecting-ip'];}else if(_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x99')]){_0x2c1615=_[_0xed2f('0x9a')](_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x99')][_0xed2f('0x9b')](','));}if(_0x589255){var _0x5ec497={'ContactId':_0x589255['id'],'ChatWebsiteId':_0x2d6cb8['params']['id'],'from':(_0x589255[_0xed2f('0x9c')]||'')+'\x20'+(_0x589255[_0xed2f('0x9d')]||''),'customerIp':_0x2c1615,'customerPort':_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x9e')]?_0x2d6cb8[_0xed2f('0x7e')][_0xed2f('0x9e')]:null,'referer':_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0x9f')],'browserName':_0x4b9777[_0xed2f('0xa0')][_0xed2f('0x2d')]&&_0x4b9777[_0xed2f('0xa0')]['version']?util[_0xed2f('0xa1')](_0xed2f('0xa2'),_0x4b9777[_0xed2f('0xa0')][_0xed2f('0x2d')],_0x4b9777['browser'][_0xed2f('0xa3')]):'unknown','browserVersion':_0x4b9777[_0xed2f('0xa0')][_0xed2f('0xa3')]||_0xed2f('0xa4'),'osName':util[_0xed2f('0xa1')](_0xed2f('0xa2'),_0x4b9777['os'][_0xed2f('0x2d')],_0x4b9777['os'][_0xed2f('0xa3')]),'osVersion':_0x4b9777['os'][_0xed2f('0xa3')],'deviceModel':_0x4b9777[_0xed2f('0xa5')]['model']&&_0x4b9777[_0xed2f('0xa5')][_0xed2f('0xa6')]?util[_0xed2f('0xa1')](_0xed2f('0xa7'),_0x4b9777['device']['model'],_0x4b9777[_0xed2f('0xa5')][_0xed2f('0xa6')],_0x4b9777[_0xed2f('0xa5')]['type']):null,'deviceVendor':_0x4b9777[_0xed2f('0xa5')][_0xed2f('0xa6')],'deviceType':_0x4b9777[_0xed2f('0xa5')][_0xed2f('0x31')],'formData':JSON[_0xed2f('0x1a')](_0x2d6cb8[_0xed2f('0x4b')])};var _0x44ec47={'ChatWebsiteId':_0x2d6cb8[_0xed2f('0x47')]['id'],'closed':![]};if(_0x2d6cb8[_0xed2f('0x4b')]['threadId']){_0x44ec47[_0xed2f('0xa8')]=_0x2d6cb8['body'][_0xed2f('0xa8')];return db[_0xed2f('0xa9')]['find']({'where':_0x44ec47})[_0xed2f('0x15')](function(_0x1e5e3a){if(_0x1e5e3a){return[_0x1e5e3a,![]];}_0x5ec497[_0xed2f('0xa8')]=_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xa8')];_0x5ec497[_0xed2f('0xaa')]=_0x2d6cb8['body']['externalUrl'];return db[_0xed2f('0xa9')][_0xed2f('0x4a')](_0x5ec497)[_0xed2f('0x15')](function(_0x23ae4d){return[_0x23ae4d,!![]];});});}_0x44ec47[_0xed2f('0xab')]=_0x589255['id'];if(_0x2d6cb8['body'][_0xed2f('0xac')]&&_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xac')]['id']){_0x44ec47['id']=_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xac')]['id'];return db[_0xed2f('0xa9')][_0xed2f('0x55')]({'where':_0x44ec47})[_0xed2f('0x15')](function(_0x995013){if(_0x995013){return[_0x995013,![]];}return db[_0xed2f('0xa9')]['create'](_0x5ec497)['then'](function(_0x383b6f){return[_0x383b6f,!![]];});});}return db[_0xed2f('0xa9')][_0xed2f('0x4a')](_0x5ec497)[_0xed2f('0x15')](function(_0x4087f7){return[_0x4087f7,!![]];});}})['spread'](function(_0x23728a,_0x381cae){if(_0x23728a){_0x43f02c=_0x381cae;if(!_0x381cae){var _0x2433ed={'from':(_0x59dc89['contact'][_0xed2f('0x9c')]||'')+'\x20'+(_0x59dc89[_0xed2f('0x97')][_0xed2f('0x9d')]||'')};if(_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xa8')]&&_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xad')]&&_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xa8')]!=_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xad')]){_0x2433ed[_0xed2f('0xa8')]=_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xad')];}return _0x23728a[_0xed2f('0x29')](_0x2433ed);}else{return _0x23728a;}}})[_0xed2f('0x15')](function(_0x47a825){_0x59dc89[_0xed2f('0xac')]=_0x47a825[_0xed2f('0x2b')]({'plain':!![]});_0x59dc89[_0xed2f('0xac')]['created']=_0x43f02c;if(_0x59dc89[_0xed2f('0xac')][_0xed2f('0xae')]){if(_0x59dc89[_0xed2f('0x95')][_0xed2f('0xaf')]){_0x59dc89[_0xed2f('0x92')][_0xed2f('0xb0')]({'id':0x0,'priority':_0x59dc89[_0xed2f('0x92')][_0xed2f('0x39')]+0x1,'app':_0xed2f('0xb1'),'appdata':_0xed2f('0xb2'),'interval':_0xed2f('0xb3')});}}return db[_0xed2f('0xb4')]['create']({'body':_0x2d6cb8[_0xed2f('0x4b')]['body'],'ChatWebsiteId':_0x2d6cb8['params']['id'],'ChatInteractionId':_0x47a825['id'],'direction':'in','ContactId':_0x59dc89[_0xed2f('0x97')]['id'],'AttachmentId':_0x2d6cb8[_0xed2f('0x4b')][_0xed2f('0xb5')]});})[_0xed2f('0x15')](function(_0x5240d7){_0x59dc89[_0xed2f('0x1d')]=_0x5240d7;if(_0x59dc89['interaction'][_0xed2f('0xb6')]){return db['User'][_0xed2f('0x55')]({'attributes':['id','name'],'where':{'id':_0x59dc89[_0xed2f('0xac')]['UserId']}})[_0xed2f('0x15')](function(_0x36ce38){if(_0x36ce38){_0x59dc89[_0xed2f('0x92')][_0xed2f('0xb7')]({'id':0x0,'priority':0x0,'app':_0xed2f('0xb8'),'appdata':_0x36ce38[_0xed2f('0x2d')]+','+(_0x59dc89[_0xed2f('0x95')][_0xed2f('0xb9')]||0xa),'interval':_0xed2f('0xb3')});_0x59dc89['forcedOwnership']=!![];}return respondWithRpcPromise(_0xed2f('0xba'),_0xed2f('0xbb'),_0x59dc89);});}return respondWithRpcPromise(_0xed2f('0xba'),_0xed2f('0xbb'),_0x59dc89);})[_0xed2f('0x15')](function(_0x18b10b){respondWithRpcPromise('EventManager',_0xed2f('0xbc'),{'event':_0xed2f('0x7b'),'message':_0x18b10b},client9002);return _0x18b10b;})[_0xed2f('0x15')](respondWithResult(_0x547510,null))[_0xed2f('0x1f')](handleError(_0x547510,null));};exports[_0xed2f('0xbd')]=function(_0x58858c,_0x1bd343){var _0x10e639,_0x223825,_0x5c79e8;var _0x16fbe5=[];var _0x4c5b07={};var _0x142d4a=_0x58858c[_0xed2f('0xbe')]||[];var _0x2f940a=[];var _0x17d04e;return db[_0xed2f('0x81')][_0xed2f('0x53')]()[_0xed2f('0x15')](function(_0x3971df){if(!_0x3971df){throw new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0xbf'));}_0x16fbe5=_[_0xed2f('0x84')](_[_0xed2f('0x34')](_0x3971df),[_0xed2f('0x82'),_0xed2f('0x83'),'CompanyId',_0xed2f('0x86')]);if(_0x58858c[_0xed2f('0x4b')]['id']){delete _0x58858c[_0xed2f('0x4b')]['id'];}if(_['isNil'](_0x58858c[_0xed2f('0x4b')][_0xed2f('0x87')])){throw _0x1bd343[_0xed2f('0x27')](0x1f4)[_0xed2f('0xc0')](new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0x8a')));}if(_[_0xed2f('0x6f')](_0x58858c[_0xed2f('0x4b')][_0xed2f('0x4b')])||_0x58858c['body'][_0xed2f('0x4b')]===''){throw _0x1bd343[_0xed2f('0x27')](0x1f4)[_0xed2f('0xc0')](new db['Sequelize'][(_0xed2f('0x89'))](_0xed2f('0x8b')));}if(_['isNil'](_0x58858c[_0xed2f('0x4b')][_0xed2f('0xc1')])){throw _0x1bd343['status'](0x1f4)[_0xed2f('0xc0')](new db[(_0xed2f('0x88'))][(_0xed2f('0x89'))](_0xed2f('0xc2')+_0x16fbe5));}if(!_[_0xed2f('0xc3')](_0x16fbe5,_0x58858c[_0xed2f('0x4b')][_0xed2f('0xc1')])){throw _0x1bd343[_0xed2f('0x27')](0x1f4)[_0xed2f('0xc0')](new db['Sequelize'][(_0xed2f('0x89'))](_0xed2f('0xc4')+_0x16fbe5));}_0x4c5b07[_0x58858c[_0xed2f('0x4b')][_0xed2f('0xc1')]]=_0x58858c[_0xed2f('0x4b')][_0xed2f('0x87')];})[_0xed2f('0x15')](function(){return db[_0xed2f('0x44')][_0xed2f('0x55')]({'where':{'id':_0x58858c[_0xed2f('0x47')]['id']},'include':[{'model':db[_0xed2f('0xc5')],'as':_0xed2f('0x8e')},{'model':db[_0xed2f('0xc6')],'as':_0xed2f('0xc6')}]});})['then'](handleEntityNotFound(_0x1bd343,null))['then'](function(_0x5014a1){if(_0x5014a1&&_0x5014a1[_0xed2f('0x8e')]){_0x223825=_0x5014a1;var _0x51d495=_['defaults'](_0x58858c[_0xed2f('0x4b')],{'firstName':_0x58858c['body']['from'],'phone':_0x58858c[_0xed2f('0x4b')][_0xed2f('0x87')],'ListId':_0x5014a1[_0xed2f('0x86')]});_0x51d495[_0x58858c[_0xed2f('0x4b')][_0xed2f('0xc1')]]=_0x58858c[_0xed2f('0x4b')][_0xed2f('0x87')];return db['CmContact'][_0xed2f('0xc7')]({'where':_0x4c5b07,'defaults':_0x51d495});}})[_0xed2f('0xc8')](function(_0x4ed782){if(_0x4ed782){_0x5c79e8=_0x4ed782;var _0x246824=fs[_0xed2f('0xc9')](path[_0xed2f('0x71')](config[_0xed2f('0x6d')],_0xed2f('0xca')),'utf8');var _0x419f08=ejs['render'](_0x246824,{'body':_[_0xed2f('0xcb')](_0x58858c['body']['body']),'bodyTitle':_0x223825['offlineMessageBody']});return db[_0xed2f('0xcc')][_0xed2f('0x4a')]({'body':_0x419f08,'ContactId':_0x4ed782['id'],'ChatWebsiteId':_0x223825['id']});}})[_0xed2f('0x15')](function(_0x3a2698){_0x17d04e=_0x3a2698;if(_0x142d4a[_0xed2f('0x39')]){var _0x33741c=_0x142d4a[_0xed2f('0x5a')](function(_0x257bcc){return{'name':_0x257bcc[_0xed2f('0xcd')],'basename':_0x257bcc[_0xed2f('0x66')],'type':_0x257bcc[_0xed2f('0xce')],'ChatOfflineMessageId':_0x3a2698['id']};});_0x2f940a=_0x33741c[_0xed2f('0x5a')](_0xcaaf98=>{var _0x1488e5={'filename':_0xcaaf98[_0xed2f('0x2d')],'path':path['join'](config['root'],_0xed2f('0xcf'),_0xed2f('0xbe'),_0xed2f('0xd0'),_0xed2f('0xd1'),_0xcaaf98[_0xed2f('0xd2')])};return _0x1488e5;});if(!_0x223825[_0xed2f('0xd3')]){return db['sequelize'][_0xed2f('0xd4')](function(_0x37bf9f){return db[_0xed2f('0xd5')]['bulkCreate'](_0x33741c,{'transaction':_0x37bf9f});});}}})[_0xed2f('0x15')](function(){if(_0x17d04e){_0x10e639=_0x17d04e;return db['MailAccount'][_0xed2f('0x60')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0xed2f('0x15')](function(_0x44c4e8){if(_0x44c4e8&&_0x44c4e8[_0xed2f('0xd6')]&&_0x223825['forwardOffline']&&_0x223825['forwardOfflineAddress']){var _0x142b91={'tls':{'rejectUnauthorized':![]}};if(_0x44c4e8['Smtp'][_0xed2f('0xd7')]){_0x142b91[_0xed2f('0xd7')]=_0x44c4e8[_0xed2f('0xd6')]['service'];}else{_0x142b91['host']=_0x44c4e8[_0xed2f('0xd6')][_0xed2f('0xd8')];_0x142b91['port']=_0x44c4e8['Smtp'][_0xed2f('0xd9')];_0x142b91['secure']=_0x44c4e8['Smtp'][_0xed2f('0xda')];}if(_0x44c4e8['Smtp'][_0xed2f('0xdb')]){_0x142b91[_0xed2f('0xdc')]={'user':_0x44c4e8[_0xed2f('0xd6')][_0xed2f('0x4d')],'pass':_0x44c4e8[_0xed2f('0xd6')]['pass']};}return respondWithRpcPromise(_0xed2f('0xdd'),_0xed2f('0xde'),{'account':_0x142b91,'message':{'from':util[_0xed2f('0xa1')](_0xed2f('0xdf'),_0x44c4e8[_0xed2f('0x2d')],_0x44c4e8['email']||_0x44c4e8[_0xed2f('0xd6')][_0xed2f('0x4d')]),'to':_0x223825[_0xed2f('0xe0')],'subject':_0x223825[_0xed2f('0xe1')],'html':_0x10e639[_0xed2f('0x4b')],'attachments':_0x2f940a}},client9003)['then'](function(){return _0x10e639;})[_0xed2f('0x1f')](function(_0x2ec217){console[_0xed2f('0x1b')](_0x2ec217);});}})[_0xed2f('0x15')](function(){if(_0x223825&&_0x223825['openNewInteraction']&&_0x223825[_0xed2f('0xe2')]){var _0x465e4d=[];if(_0x142d4a[_0xed2f('0x39')]){_0x465e4d=_0x142d4a[_0xed2f('0x5a')](function(_0x1e7e8e){return{'name':_0x1e7e8e[_0xed2f('0xcd')],'basename':_0x1e7e8e[_0xed2f('0x66')],'type':_0x1e7e8e[_0xed2f('0xce')],'ChatOfflineMessageId':_0x17d04e['id']};});}var _0x2656c3;if(!_[_0xed2f('0x6f')](_0x223825[_0xed2f('0xe3')])){var _0x2b3da1=_['map'](_0x58858c[_0xed2f('0x4b')],function(_0x18ebfb){return _0x18ebfb;});var _0x196a30=_[_0xed2f('0xe4')](_0x2b3da1)[0x0];var _0x77f576=_[_0xed2f('0xe5')](_0x196a30,function(_0x4528cd){return _0x4528cd;});_0x2656c3=_0x77f576[0x1][_0x223825['subjectOffline']];}var _0x12d8c9={'from':_0x5c79e8[_0xed2f('0xe6')],'firstName':_0x5c79e8[_0xed2f('0x9c')],'lastName':_0x5c79e8['lastName'],'mapKey':_0xed2f('0xe6'),'message':{'from':_0x5c79e8['email'],'to':_0x223825[_0xed2f('0xc6')][_0xed2f('0xe6')],'cc':'','subject':_['isNil'](_0x2656c3)?_0x223825[_0xed2f('0xe1')]:_0x2656c3,'messageId':'','sentAt':new Date(),'attach':_0x465e4d['length'],'attachments':_0x465e4d,'originChannel':_0xed2f('0xe7'),'ChatWebsiteId':_0x223825['id'],'ChatOfflineMessageId':_0x10e639['id'],'originTo':_0x223825[_0xed2f('0xc6')][_0xed2f('0xe6')]},'body':_0x10e639[_0xed2f('0x4b')]};var _0x1bc1a0={'account':{'id':_0x223825[_0xed2f('0xe2')]},'body':_0x12d8c9,'log':_0xed2f('0xe8')};return respondWithRpcPromise(_0xed2f('0xe8'),_0xed2f('0xe9'),_0x1bc1a0,client9001)['then'](function(){return _0x10e639;})['catch'](function(_0x204d79){console[_0xed2f('0x1b')](_0x204d79);});}return;})['then'](function(){if(_0x10e639){return _0x10e639;}})[_0xed2f('0x15')](respondWithResult(_0x1bd343,null))['catch'](function(_0x58ec7e){console[_0xed2f('0x1b')](_0xed2f('0x1f'),_0x58ec7e);for(var _0x20101b of _0x142d4a){var _0x2f2f30=path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server',_0xed2f('0xbe'),_0xed2f('0xd0'),_0xed2f('0xd1'),_0x20101b[_0xed2f('0x66')]);fs_extra['remove'](_0x2f2f30)[_0xed2f('0x1f')](function(_0x4f7d78){console['error'](_0xed2f('0xea'),_0x2f2f30,_0x4f7d78);});}});};exports[_0xed2f('0xeb')]=function(_0x3ce8ce,_0x5ab9d6){return db[_0xed2f('0xa9')][_0xed2f('0x55')]({'where':{'id':_0x3ce8ce[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x5ab9d6,null))[_0xed2f('0x15')](function(_0x28dd4b){if(_0x28dd4b){return _0x28dd4b['addInteraction'](_0x3ce8ce[_0xed2f('0x4b')][_0xed2f('0x62')],_[_0xed2f('0xec')](_0x3ce8ce[_0xed2f('0x4b')],[_0xed2f('0x62'),'id'])||{});}})['then'](respondWithResult(_0x5ab9d6,null))[_0xed2f('0x1f')](handleError(_0x5ab9d6,null));};exports[_0xed2f('0xed')]=function(_0x59e55e,_0x1669c2){var _0x1a324e={'raw':![],'where':{}};var _0x3c08dc={};var _0x5a2f1c={'count':0x0,'rows':[]};return db[_0xed2f('0x44')]['findOne']({'where':{'id':_0x59e55e['params']['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x1669c2,null))[_0xed2f('0x15')](function(_0x433b26){if(_0x433b26){_0x3c08dc[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['ChatInteraction'][_0xed2f('0x48')]);_0x3c08dc['query']=_[_0xed2f('0x34')](_0x59e55e[_0xed2f('0x33')]);_0x3c08dc[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x3c08dc[_0xed2f('0x36')],_0x3c08dc[_0xed2f('0x33')]);_0x1a324e[_0xed2f('0x37')]=_[_0xed2f('0x35')](_0x3c08dc[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x59e55e[_0xed2f('0x33')][_0xed2f('0x38')]));_0x1a324e[_0xed2f('0x37')]=_0x1a324e['attributes'][_0xed2f('0x39')]?_0x1a324e[_0xed2f('0x37')]:_0x3c08dc['model'];if(!_0x59e55e[_0xed2f('0x33')][_0xed2f('0x3a')](_0xed2f('0x59'))){_0x1a324e[_0xed2f('0x25')]=qs[_0xed2f('0x25')](_0x59e55e['query'][_0xed2f('0x25')]);_0x1a324e[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0x59e55e['query']['offset']);}_0x1a324e['order']=qs[_0xed2f('0x3c')](_0x59e55e['query'][_0xed2f('0x3c')]);_0x1a324e[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x59e55e[_0xed2f('0x33')],_0x3c08dc[_0xed2f('0x3e')]));_0x1a324e['where'][_0xed2f('0x56')]=_0x433b26['id'];if(_0x59e55e[_0xed2f('0x33')][_0xed2f('0x42')]){_0x1a324e[_0xed2f('0x3d')]=_['merge'](_0x1a324e[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0x1a324e[_0xed2f('0x37')],function(_0x10355e){var _0x4a6ad5={};_0x4a6ad5[_0x10355e]={'$like':'%'+_0x59e55e['query'][_0xed2f('0x42')]+'%'};return _0x4a6ad5;})});}_0x1a324e=_[_0xed2f('0x40')]({},_0x1a324e,_0x59e55e[_0xed2f('0x43')]);return db[_0xed2f('0xa9')]['count']({'where':_0x1a324e['where']})[_0xed2f('0x15')](function(_0x12afb9){_0x5a2f1c['count']=_0x12afb9;if(_0x59e55e[_0xed2f('0x33')]['includeAll']){_0x1a324e[_0xed2f('0x49')]=[{'model':db[_0xed2f('0x81')],'as':_0xed2f('0xee'),'required':![]},{'model':db[_0xed2f('0xef')],'as':_0xed2f('0xf0'),'attributes':[_0xed2f('0x2d'),'fullname','internal'],'required':![]},{'model':db[_0xed2f('0xf1')],'as':_0xed2f('0xf2'),'attributes':['id',_0xed2f('0x2d'),_0xed2f('0xf3')],'where':_0x59e55e['query']['tag']?{'id':_0x59e55e['query'][_0xed2f('0xf4')]}:undefined,'required':_0x59e55e['query'][_0xed2f('0xf4')]?!![]:![]}];}return db[_0xed2f('0xa9')][_0xed2f('0x5b')](_0x1a324e);})[_0xed2f('0x15')](function(_0x15dd24){_0x5a2f1c['rows']=_0x15dd24;return _0x5a2f1c;});}})[_0xed2f('0x15')](respondWithFilteredResult(_0x1669c2,_0x1a324e))[_0xed2f('0x1f')](handleError(_0x1669c2,null));};function iftimePromise(_0x1c0c72,_0x58aebd){return respondWithRpcPromise(_0xed2f('0xf5'),_0xed2f('0xf6'),{'command':_0x58aebd[_0xed2f('0xf7')]?util[_0xed2f('0xa1')](_0xed2f('0xf8'),_0x1c0c72[_0xed2f('0xf9')],_0x58aebd['timezone']):util[_0xed2f('0xa1')](_0xed2f('0xfa'),_0x1c0c72['interval'])},client9002)['then'](function(_0x3b3af4){var _0x47e607=_0x3b3af4&&_0x3b3af4[_0xed2f('0xfb')](_0xed2f('0xfc'))>=0x0?!![]:![];logger[_0xed2f('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x58aebd['id'],_0x1c0c72['id'],_0x1c0c72[_0xed2f('0xf9')],_0x47e607?_0xed2f('0xfd'):'OFFLINE',_0x58aebd[_0xed2f('0xf7')]?_0x58aebd[_0xed2f('0xf7')]:_0xed2f('0xfe'));return _0x47e607;})[_0xed2f('0x1f')](function(_0x811190){logger[_0xed2f('0x1b')](_0xed2f('0xff'),_0x58aebd['id'],_0x1c0c72['id'],_0x1c0c72['interval'],util[_0xed2f('0x100')](_0x811190,{'showHidden':![],'depth':null}),_0x58aebd['timezone']?_0x58aebd[_0xed2f('0xf7')]:'No\x20timezone');return![];});}exports[_0xed2f('0xf6')]=function(_0x2ad790,_0x562db5){var _0x1f1a69=0x0;var _0x672f0a=0x0;var _0x8ce47e=![];var _0x48b209;var _0x1e7d22;return db['ChatWebsite'][_0xed2f('0x55')]({'where':{'id':_0x2ad790['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xed2f('0x101')],'as':_0xed2f('0x102'),'attributes':['id',_0xed2f('0xf9')],'raw':!![]}]}]})[_0xed2f('0x15')](handleEntityNotFound(_0x562db5,null))[_0xed2f('0x15')](function(_0x24e12c){if(_0x24e12c){_0x48b209=_0x24e12c;return _0x24e12c[_0xed2f('0x103')]({'raw':!![]});}})[_0xed2f('0x15')](function(_0x16d605){if(_0x48b209){if(_0x16d605){_0x1e7d22=_0x16d605;}}return require('../../config/license/util')[_0xed2f('0x104')]();})[_0xed2f('0x15')](function(_0x27a2f6){if(_0x27a2f6){_0x672f0a=_0x27a2f6[_0xed2f('0x105')];_0x8ce47e=_0x27a2f6['custom'];}})['then'](function(){return db[_0xed2f('0xa9')][_0xed2f('0x26')]({'where':{'closed':![]}});})[_0xed2f('0x15')](function(_0x151bce){_0x1f1a69=_0x151bce;if(_0x672f0a&&_0x151bce>_0x672f0a){return db['License'][_0xed2f('0x60')]({'where':{'id':0x1}})['then'](function(_0x551709){if(_0x551709){_0x551709[_0xed2f('0x106')](_0xed2f('0x107'));}});}})['then'](function(){if(_0x48b209[_0xed2f('0x101')]&&_0x48b209[_0xed2f('0x101')]['Intervals']){var _0xbb9b38=[];for(var _0xe1582b=0x0;_0xe1582b<_0x48b209[_0xed2f('0x101')][_0xed2f('0x102')][_0xed2f('0x39')];_0xe1582b++){var _0x30a27c=_0x48b209[_0xed2f('0x101')][_0xed2f('0x102')][_0xe1582b][_0xed2f('0x2b')]({'plain':!![]});_0xbb9b38[_0xed2f('0xb0')](iftimePromise(_0x30a27c,_0x48b209));}return BPromise[_0xed2f('0x108')](_0xbb9b38)[_0xed2f('0x15')](function(_0x3ffc14){return _[_0xed2f('0x109')](_0x3ffc14);});}else{return!![];}})['then'](function(_0xdb41c0){var _0x276dcf=fs[_0xed2f('0xc9')](path[_0xed2f('0x71')](config[_0xed2f('0x6d')],'server/files/chat/iframe.ejs'),_0xed2f('0x10a'));var _0x49f8e8={'remote':_0x48b209[_0xed2f('0x10b')],'query':querystring['stringify'](_[_0xed2f('0x40')](_0x48b209[_0xed2f('0x2b')]({'plain':!![]}),{'customerIp':_0x2ad790[_0xed2f('0x7e')][_0xed2f('0x99')]||_0x2ad790[_0xed2f('0x7e')][_0xed2f('0x10c')]||_0x2ad790[_0xed2f('0x10d')][_0xed2f('0x10e')]||_0x2ad790['ip'],'referer':_0x2ad790[_0xed2f('0x7e')][_0xed2f('0x9f')],'openedInteractions':_0x1f1a69,'maxInteractions':_0x672f0a,'virtual':_0x8ce47e[_0xed2f('0x105')],'online':_0xdb41c0,'custom':_0x8ce47e}))[_0xed2f('0x10f')](/'/g,'\x5c\x27')};_0x562db5[_0xed2f('0xc0')](ejs[_0xed2f('0x110')](Mustache[_0xed2f('0x110')](_0x276dcf,_0x49f8e8),{'proactiveActions':_0x1e7d22,'alignment':_0x48b209['alignment'],'verticalAlignment':_0x48b209[_0xed2f('0x111')],'div_color':_0x48b209[_0xed2f('0xf3')],'labelText':_0x48b209[_0xed2f('0x112')],'text_color':_0x48b209[_0xed2f('0x113')],'button_color':_0x48b209[_0xed2f('0x114')],'background_color':_0x48b209[_0xed2f('0x115')]}));})[_0xed2f('0x1f')](handleError(_0x562db5,null));};exports[_0xed2f('0x116')]=function(_0x28d27f,_0x265304){var _0x1eb2c4=_0x28d27f['params']['id'];var _0x3fbbb3=_0x28d27f[_0xed2f('0x4b')];var _0x2a700e=0xc8;var _0x5d9d1e=null;return db['sequelize'][_0xed2f('0xd4')]({'isolationLevel':db[_0xed2f('0x117')][_0xed2f('0x118')][_0xed2f('0x119')][_0xed2f('0x11a')]},function(_0x2131d5){return db[_0xed2f('0x44')][_0xed2f('0x60')]({'where':{'id':_0x1eb2c4},'transaction':_0x2131d5})[_0xed2f('0x15')](function(_0x1d7006){if(_0x1d7006){return db['ChatApplication'][_0xed2f('0x2a')]({'where':{'ChatWebsiteId':_0x1eb2c4},'transaction':_0x2131d5})[_0xed2f('0x15')](function(){var _0x22c810=_['map'](_0x3fbbb3,function(_0x59e004){_0x59e004[_0xed2f('0x56')]=_0x1eb2c4;return _0x59e004;});return db['ChatApplication'][_0xed2f('0x11b')](_0x22c810,{'transaction':_0x2131d5});});}else{_0x2a700e=0x194;_0x5d9d1e=[];}});})[_0xed2f('0x15')](function(){if(_0x2a700e!==0x194){return db[_0xed2f('0x91')][_0xed2f('0x11c')]({'where':{'ChatWebsiteId':_0x1eb2c4},'order':'priority'})['then'](function(_0x4e9aeb){_0x5d9d1e=_0x4e9aeb;});}})[_0xed2f('0x1f')](function(_0x254697){_0x2a700e=0x1f4;logger['error'](_0x254697['stack']);if(_0x254697[_0xed2f('0x2d')]){delete _0x254697[_0xed2f('0x2d')];}_0x5d9d1e=_0x254697;})['finally'](function(){if(_0x5d9d1e===null){_0x265304[_0xed2f('0x20')](_0x2a700e);}else{if(_0x2a700e===0x1f4){_0x265304[_0xed2f('0x27')](_0x2a700e)[_0xed2f('0xc0')](_0x5d9d1e);}else{_0x265304[_0xed2f('0x27')](_0x2a700e)['json'](_0x5d9d1e);}}});};exports[_0xed2f('0x11d')]=function(_0x53cd63,_0x3112e4){var _0x4bf1b9={};var _0x1c55a1={};var _0x4028a6;var _0x3f6825;return db[_0xed2f('0x44')][_0xed2f('0x60')]({'where':{'id':_0x53cd63[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x3112e4,null))[_0xed2f('0x15')](function(_0x2e87f5){if(_0x2e87f5){_0x4028a6=_0x2e87f5;_0x1c55a1[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['ChatApplication'][_0xed2f('0x48')]);_0x1c55a1[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x53cd63[_0xed2f('0x33')]);_0x1c55a1[_0xed2f('0x3e')]=_['intersection'](_0x1c55a1[_0xed2f('0x36')],_0x1c55a1[_0xed2f('0x33')]);_0x4bf1b9['attributes']=_[_0xed2f('0x35')](_0x1c55a1[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x53cd63[_0xed2f('0x33')]['fields']));_0x4bf1b9['attributes']=_0x4bf1b9[_0xed2f('0x37')][_0xed2f('0x39')]?_0x4bf1b9['attributes']:_0x1c55a1['model'];_0x4bf1b9[_0xed2f('0x3b')]=qs['sort'](_0x53cd63[_0xed2f('0x33')]['sort']);_0x4bf1b9[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x53cd63[_0xed2f('0x33')],_0x1c55a1[_0xed2f('0x3e')]));if(_0x53cd63['query'][_0xed2f('0x42')]){_0x4bf1b9[_0xed2f('0x3d')]=_[_0xed2f('0x40')](_0x4bf1b9['where'],{'$or':_['map'](_0x4bf1b9['attributes'],function(_0x317cc5){var _0x2d4774={};_0x2d4774[_0x317cc5]={'$like':'%'+_0x53cd63[_0xed2f('0x33')]['filter']+'%'};return _0x2d4774;})});}_0x4bf1b9=_[_0xed2f('0x40')]({},_0x4bf1b9,_0x53cd63[_0xed2f('0x43')]);return _0x4028a6[_0xed2f('0x11d')](_0x4bf1b9);}})[_0xed2f('0x15')](function(_0x5f334a){if(_0x5f334a){_0x3f6825=_0x5f334a[_0xed2f('0x39')];if(!_0x53cd63[_0xed2f('0x33')][_0xed2f('0x3a')](_0xed2f('0x59'))){_0x4bf1b9[_0xed2f('0x25')]=qs[_0xed2f('0x25')](_0x53cd63[_0xed2f('0x33')][_0xed2f('0x25')]);_0x4bf1b9[_0xed2f('0x23')]=qs['offset'](_0x53cd63[_0xed2f('0x33')][_0xed2f('0x23')]);}return _0x4028a6['getApplications'](_0x4bf1b9);}})['then'](function(_0x1f078c){if(_0x1f078c){return _0x1f078c?{'count':_0x3f6825,'rows':_0x1f078c}:null;}})[_0xed2f('0x15')](respondWithResult(_0x3112e4,null))['catch'](handleError(_0x3112e4,null));};exports['addProactiveActions']=function(_0xed57c8,_0x5aa3a2){return db[_0xed2f('0x11e')][_0xed2f('0x55')]({'where':{'id':_0xed57c8[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x5aa3a2,null))[_0xed2f('0x15')](function(_0x5245d9){if(_0x5245d9){return _0x5245d9['addProactiveActions'](_0xed57c8[_0xed2f('0x4b')][_0xed2f('0x62')],_[_0xed2f('0xec')](_0xed57c8['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5aa3a2,null))['catch'](handleError(_0x5aa3a2,null));};exports['getProactiveActions']=function(_0x32911b,_0x217760){var _0x31e77b={};var _0x1715df={};var _0x162a6a;var _0x4c8feb;return db[_0xed2f('0x44')]['findOne']({'where':{'id':_0x32911b[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x217760,null))[_0xed2f('0x15')](function(_0x3e6963){if(_0x3e6963){_0x162a6a=_0x3e6963;_0x1715df['model']=_['keys'](db[_0xed2f('0x11f')][_0xed2f('0x48')]);_0x1715df[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x32911b[_0xed2f('0x33')]);_0x1715df[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x1715df['model'],_0x1715df[_0xed2f('0x33')]);_0x31e77b[_0xed2f('0x37')]=_[_0xed2f('0x35')](_0x1715df[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x32911b[_0xed2f('0x33')][_0xed2f('0x38')]));_0x31e77b[_0xed2f('0x37')]=_0x31e77b['attributes']['length']?_0x31e77b[_0xed2f('0x37')]:_0x1715df['model'];_0x31e77b[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0x32911b[_0xed2f('0x33')][_0xed2f('0x3c')]);_0x31e77b[_0xed2f('0x3d')]=qs['filters'](_[_0xed2f('0x3f')](_0x32911b['query'],_0x1715df['filters']));if(_0x32911b[_0xed2f('0x33')][_0xed2f('0x42')]){_0x31e77b[_0xed2f('0x3d')]=_[_0xed2f('0x40')](_0x31e77b[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0x31e77b[_0xed2f('0x37')],function(_0x50b23d){var _0x5d8d47={};_0x5d8d47[_0x50b23d]={'$like':'%'+_0x32911b['query'][_0xed2f('0x42')]+'%'};return _0x5d8d47;})});}_0x31e77b=_[_0xed2f('0x40')]({},_0x31e77b,_0x32911b[_0xed2f('0x43')]);return _0x162a6a[_0xed2f('0x103')](_0x31e77b);}})[_0xed2f('0x15')](function(_0x3b8150){if(_0x3b8150){_0x4c8feb=_0x3b8150[_0xed2f('0x39')];if(!_0x32911b[_0xed2f('0x33')][_0xed2f('0x3a')](_0xed2f('0x59'))){_0x31e77b['limit']=qs[_0xed2f('0x25')](_0x32911b[_0xed2f('0x33')][_0xed2f('0x25')]);_0x31e77b[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0x32911b[_0xed2f('0x33')][_0xed2f('0x23')]);}return _0x162a6a[_0xed2f('0x103')](_0x31e77b);}})[_0xed2f('0x15')](function(_0x50382a){if(_0x50382a){return _0x50382a?{'count':_0x4c8feb,'rows':_0x50382a}:null;}})['then'](respondWithResult(_0x217760,null))[_0xed2f('0x1f')](handleError(_0x217760,null));};exports[_0xed2f('0x120')]=function(_0x2f2438,_0xe58ef4){var _0x5e9e6d=_0x2f2438[_0xed2f('0x33')][_0xed2f('0x121')]===_0xed2f('0x122')?_0xed2f('0x123'):'onlineForm';return db[_0xed2f('0x44')][_0xed2f('0x55')]({'attributes':['id',_0x5e9e6d],'where':{'id':_0x2f2438[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0xe58ef4,null))['then'](function(_0x3c08df){if(_0x3c08df){var _0x3513e5=_0x3c08df[_0x5e9e6d];var _0x266dc1=_0x3513e5&&_0x3513e5['items']?_0x3513e5['items']:[];_0xe58ef4[_0xed2f('0xc0')]({'fromKey':_[_0xed2f('0x6f')](_0x3513e5[_0xed2f('0x124')])?undefined:_0x3513e5[_0xed2f('0x124')],'count':_0x266dc1[_0xed2f('0x39')],'rows':_0x266dc1});}})[_0xed2f('0x1f')](handleError(_0xe58ef4,null));};exports[_0xed2f('0x125')]=function(_0x185b62,_0xa683b1){var _0x5dc28b={'raw':![],'where':{}};var _0x363777={};var _0x2da55f={'count':0x0,'rows':[]};return db[_0xed2f('0x44')][_0xed2f('0x60')]({'where':{'id':_0x185b62[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0xa683b1,null))[_0xed2f('0x15')](function(_0x423f57){if(_0x423f57){_0x363777[_0xed2f('0x36')]=_['keys'](db[_0xed2f('0xcc')]['rawAttributes']);_0x363777[_0xed2f('0x33')]=_[_0xed2f('0x34')](_0x185b62[_0xed2f('0x33')]);_0x363777[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x363777[_0xed2f('0x36')],_0x363777[_0xed2f('0x33')]);_0x5dc28b['attributes']=_[_0xed2f('0x35')](_0x363777[_0xed2f('0x36')],qs[_0xed2f('0x38')](_0x185b62[_0xed2f('0x33')][_0xed2f('0x38')]));_0x5dc28b['attributes']=_0x5dc28b[_0xed2f('0x37')][_0xed2f('0x39')]?_0x5dc28b[_0xed2f('0x37')]:_0x363777[_0xed2f('0x36')];if(!_0x185b62[_0xed2f('0x33')][_0xed2f('0x3a')]('nolimit')){_0x5dc28b['limit']=qs['limit'](_0x185b62['query'][_0xed2f('0x25')]);_0x5dc28b[_0xed2f('0x23')]=qs[_0xed2f('0x23')](_0x185b62[_0xed2f('0x33')][_0xed2f('0x23')]);}_0x5dc28b[_0xed2f('0x3b')]=qs[_0xed2f('0x3c')](_0x185b62[_0xed2f('0x33')][_0xed2f('0x3c')]);_0x5dc28b[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_[_0xed2f('0x3f')](_0x185b62['query'],_0x363777['filters']));_0x5dc28b[_0xed2f('0x3d')]['ChatWebsiteId']=_0x423f57['id'];if(_0x185b62[_0xed2f('0x33')][_0xed2f('0x42')]){_0x5dc28b[_0xed2f('0x3d')]=_['merge'](_0x5dc28b[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0x5dc28b[_0xed2f('0x37')],function(_0xfa2fc9){var _0x28b143={};_0x28b143[_0xfa2fc9]={'$like':'%'+_0x185b62[_0xed2f('0x33')][_0xed2f('0x42')]+'%'};return _0x28b143;})});}_0x5dc28b=_[_0xed2f('0x40')]({},_0x5dc28b,_0x185b62[_0xed2f('0x43')]);return db['ChatOfflineMessage'][_0xed2f('0x26')]({'where':_0x5dc28b[_0xed2f('0x3d')]})[_0xed2f('0x15')](function(_0x506c60){_0x2da55f['count']=_0x506c60;if(_0x185b62[_0xed2f('0x33')][_0xed2f('0x45')]){_0x5dc28b[_0xed2f('0x49')]=[{'all':!![]}];}else{_0x5dc28b[_0xed2f('0x49')]=[{'model':db['CmContact'],'as':_0xed2f('0xee'),'required':![]},{'model':db['Attachment'],'as':_0xed2f('0x126'),'required':![]}];}return db[_0xed2f('0xcc')][_0xed2f('0x5b')](_0x5dc28b);})[_0xed2f('0x15')](function(_0x1ed533){_0x2da55f[_0xed2f('0x127')]=_0x1ed533;return _0x2da55f;});}})['then'](respondWithFilteredResult(_0xa683b1,_0x5dc28b))[_0xed2f('0x1f')](handleError(_0xa683b1,null));};exports['addAgents']=function(_0x4825a7,_0x5ed2eb){return db['ChatWebsite'][_0xed2f('0x55')]({'where':{'id':_0x4825a7[_0xed2f('0x47')]['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x5ed2eb,null))[_0xed2f('0x15')](function(_0x50b86d){if(_0x50b86d){return _0x50b86d[_0xed2f('0x128')](_0x4825a7[_0xed2f('0x4b')][_0xed2f('0x62')],_[_0xed2f('0xec')](_0x4825a7['body'],[_0xed2f('0x62'),'id'])||{})[_0xed2f('0xc8')](function(_0x491bc4){for(var _0x4436e9=0x0;_0x4436e9<_0x4825a7[_0xed2f('0x4b')][_0xed2f('0x62')]['length'];_0x4436e9+=0x1){socket[_0xed2f('0x129')](_0xed2f('0x12a'),{'UserId':Number(_0x4825a7[_0xed2f('0x4b')][_0xed2f('0x62')][_0x4436e9]),'ChatWebsiteId':Number(_0x4825a7[_0xed2f('0x47')]['id'])});}return _0x491bc4;});}})[_0xed2f('0x15')](respondWithResult(_0x5ed2eb,null))[_0xed2f('0x1f')](handleError(_0x5ed2eb,null));};exports[_0xed2f('0x12b')]=function(_0x4b0ff6,_0x37e899){return db[_0xed2f('0x44')]['find']({'where':{'id':_0x4b0ff6[_0xed2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x37e899,null))['then'](function(_0x31eeb8){if(_0x31eeb8){return _0x31eeb8[_0xed2f('0x12b')](_0x4b0ff6[_0xed2f('0x33')][_0xed2f('0x62')])['then'](function(){if(_[_0xed2f('0x12c')](_0x4b0ff6[_0xed2f('0x33')][_0xed2f('0x62')])){for(var _0x3bfeb4=0x0;_0x3bfeb4<_0x4b0ff6[_0xed2f('0x33')]['ids']['length'];_0x3bfeb4+=0x1){socket[_0xed2f('0x129')](_0xed2f('0x12d'),{'UserId':Number(_0x4b0ff6['query'][_0xed2f('0x62')][_0x3bfeb4]),'ChatWebsiteId':Number(_0x4b0ff6[_0xed2f('0x47')]['id'])});}}else{socket[_0xed2f('0x129')]('userChatWebsite:remove',{'UserId':Number(_0x4b0ff6[_0xed2f('0x33')]['ids']),'ChatWebsiteId':Number(_0x4b0ff6[_0xed2f('0x47')]['id'])});}});}})[_0xed2f('0x15')](respondWithStatusCode(_0x37e899,null))['catch'](handleError(_0x37e899,null));};exports[_0xed2f('0x12e')]=function(_0x4e1603,_0x4ba4f3){var _0x41b4f1={};var _0x2181ac={};var _0x4974a7;var _0x1f8a39;return db[_0xed2f('0x44')][_0xed2f('0x60')]({'where':{'id':_0x4e1603['params']['id']}})[_0xed2f('0x15')](handleEntityNotFound(_0x4ba4f3,null))[_0xed2f('0x15')](function(_0x41653d){if(_0x41653d){_0x4974a7=_0x41653d;_0x2181ac[_0xed2f('0x36')]=_[_0xed2f('0x34')](db['User'][_0xed2f('0x48')]);_0x2181ac[_0xed2f('0x33')]=_['keys'](_0x4e1603[_0xed2f('0x33')]);_0x2181ac[_0xed2f('0x3e')]=_[_0xed2f('0x35')](_0x2181ac[_0xed2f('0x36')],_0x2181ac[_0xed2f('0x33')]);_0x41b4f1['attributes']=_[_0xed2f('0x35')](_0x2181ac[_0xed2f('0x36')],qs['fields'](_0x4e1603[_0xed2f('0x33')][_0xed2f('0x38')]));_0x41b4f1[_0xed2f('0x37')]=_0x41b4f1[_0xed2f('0x37')]['length']?_0x41b4f1['attributes']:_0x2181ac[_0xed2f('0x36')];_0x41b4f1['order']=qs[_0xed2f('0x3c')](_0x4e1603[_0xed2f('0x33')]['sort']);_0x41b4f1[_0xed2f('0x3d')]=qs[_0xed2f('0x3e')](_['pick'](_0x4e1603[_0xed2f('0x33')],_0x2181ac[_0xed2f('0x3e')]));if(_0x4e1603[_0xed2f('0x33')][_0xed2f('0x42')]){_0x41b4f1[_0xed2f('0x3d')]=_['merge'](_0x41b4f1[_0xed2f('0x3d')],{'$or':_[_0xed2f('0x5a')](_0x41b4f1[_0xed2f('0x37')],function(_0x388b2d){var _0xa81edc={};_0xa81edc[_0x388b2d]={'$like':'%'+_0x4e1603[_0xed2f('0x33')]['filter']+'%'};return _0xa81edc;})});}_0x41b4f1=_[_0xed2f('0x40')]({},_0x41b4f1,_0x4e1603[_0xed2f('0x43')]);return _0x4974a7[_0xed2f('0x12e')](_0x41b4f1);}})[_0xed2f('0x15')](function(_0x34b8dc){if(_0x34b8dc){_0x1f8a39=_0x34b8dc[_0xed2f('0x39')];if(!_0x4e1603[_0xed2f('0x33')][_0xed2f('0x3a')](_0xed2f('0x59'))){_0x41b4f1['limit']=qs[_0xed2f('0x25')](_0x4e1603['query']['limit']);_0x41b4f1['offset']=qs['offset'](_0x4e1603[_0xed2f('0x33')]['offset']);}return _0x4974a7[_0xed2f('0x12e')](_0x41b4f1);}})[_0xed2f('0x15')](function(_0x5e262a){if(_0x5e262a){return _0x5e262a?{'count':_0x1f8a39,'rows':_0x5e262a}:null;}})['then'](respondWithResult(_0x4ba4f3,null))[_0xed2f('0x1f')](handleError(_0x4ba4f3,null));};
\ No newline at end of file
+var _0x7db4=['close','*,*,*,*','UserId','Start','startRouting','EventManager','offline','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','forwardOfflineAddress','service','host','secure','auth','pass','SendMail','\x22%s\x22\x20<%s>','MailAccountId','subjectOffline','toPairsIn','firstName','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','internal','color','tag','Command','interval','timezone','iftime\x20%s','indexOf','true','info','ONLINE','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','labelText','textColor','color_button','addApplications','Transaction','READ_COMMITTED','ChatApplication','getApplications','addProactiveActions','chatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','ChatWebsites','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','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','Contacts','DESC','account','applications','Applications','List','orderBy','priority','asc','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push'];(function(_0x227d71,_0x19044b){var _0x33c663=function(_0x52bffd){while(--_0x52bffd){_0x227d71['push'](_0x227d71['shift']());}};_0x33c663(++_0x19044b);}(_0x7db4,0x193));var _0x47db=function(_0x498262,_0x2cda1e){_0x498262=_0x498262-0x0;var _0x3c9f08=_0x7db4[_0x498262];return _0x3c9f08;};'use strict';var BPromise=require(_0x47db('0x0'));var Mustache=require(_0x47db('0x1'));var util=require(_0x47db('0x2'));var path=require('path');var ejs=require(_0x47db('0x3'));var fs=require('fs');var fs_extra=require(_0x47db('0x4'));var _=require(_0x47db('0x5'));var querystring=require(_0x47db('0x6'));var Redis=require('ioredis');var qs=require(_0x47db('0x7'));var logger=require(_0x47db('0x8'))(_0x47db('0x9'));var config=require('../../config/environment');var db=require(_0x47db('0xa'))['db'];config[_0x47db('0xb')]=_[_0x47db('0xc')](config[_0x47db('0xb')],{'host':_0x47db('0xd'),'port':0x18eb});var socket=require(_0x47db('0xe'))(new Redis(config['redis']));require(_0x47db('0xf'))[_0x47db('0x10')](socket);var jayson=require(_0x47db('0x11'));var client=jayson[_0x47db('0x12')][_0x47db('0x13')]({'port':0x232c});var client9002=jayson[_0x47db('0x12')][_0x47db('0x13')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x47db('0x12')][_0x47db('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x1be61e,_0x4314b3,_0x5b6556,_0x57d37e){return new BPromise(function(_0x37a84c,_0x53b022){var _0x11e12d=_0x57d37e||client;return _0x11e12d[_0x47db('0x14')](_0x1be61e,_0x5b6556)[_0x47db('0x15')](function(_0x30170b){logger['info'](_0x47db('0x16'),_0x4314b3,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4314b3,'request\x20sent',JSON[_0x47db('0x17')](_0x30170b));if(_0x30170b[_0x47db('0x18')]){if(_0x30170b[_0x47db('0x18')][_0x47db('0x19')]===0x1f4){logger[_0x47db('0x18')](_0x47db('0x16'),_0x4314b3,_0x30170b[_0x47db('0x18')]['message']);return _0x53b022(_0x30170b['error']['message']);}logger[_0x47db('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x4314b3,_0x30170b['error'][_0x47db('0x1a')]);return _0x37a84c(_0x30170b['error'][_0x47db('0x1a')]);}else{logger['info'](_0x47db('0x16'),_0x4314b3,_0x47db('0x1b'));_0x37a84c(_0x30170b[_0x47db('0x1c')][_0x47db('0x1a')]);}})[_0x47db('0x1d')](function(_0x73a4c7){logger[_0x47db('0x18')](_0x47db('0x16'),_0x4314b3,_0x73a4c7);_0x53b022(_0x73a4c7);});});}function respondWithStatusCode(_0x3bb8fc,_0x4dc509){_0x4dc509=_0x4dc509||0xcc;return function(_0x40402b){if(_0x40402b){return _0x3bb8fc['sendStatus'](_0x4dc509);}return _0x3bb8fc[_0x47db('0x1e')](_0x4dc509)['end']();};}function respondWithResult(_0x3c8248,_0xd6d4ae){_0xd6d4ae=_0xd6d4ae||0xc8;return function(_0x1416cd){if(_0x1416cd){return _0x3c8248[_0x47db('0x1e')](_0xd6d4ae)['json'](_0x1416cd);}};}function respondWithFilteredResult(_0xc4bc54,_0x1f70af){return function(_0x395f3b){if(_0x395f3b){var _0x1b87a5=typeof _0x1f70af[_0x47db('0x1f')]===_0x47db('0x20')&&typeof _0x1f70af[_0x47db('0x21')]==='undefined';var _0x48616f=_0x395f3b[_0x47db('0x22')];var _0x43f866=_0x1b87a5?0x0:_0x1f70af[_0x47db('0x1f')];var _0x308c84=_0x1b87a5?_0x395f3b[_0x47db('0x22')]:_0x1f70af['offset']+_0x1f70af[_0x47db('0x21')];var _0x437c30;if(_0x308c84>=_0x48616f){_0x308c84=_0x48616f;_0x437c30=0xc8;}else{_0x437c30=0xce;}_0xc4bc54[_0x47db('0x1e')](_0x437c30);return _0xc4bc54[_0x47db('0x23')](_0x47db('0x24'),_0x43f866+'-'+_0x308c84+'/'+_0x48616f)[_0x47db('0x25')](_0x395f3b);}return null;};}function saveUpdates(_0x1fb439){return function(_0x4a4de6){if(_0x4a4de6){return _0x4a4de6[_0x47db('0x26')](_0x1fb439)['then'](function(_0x3d826e){return _0x3d826e;});}return null;};}function removeEntity(_0x3b3400){return function(_0x472245){if(_0x472245){return _0x472245[_0x47db('0x27')]()[_0x47db('0x15')](function(){var _0x26792a=_0x472245['get']({'plain':!![]});var _0x594133=_0x47db('0x28');return db['UserProfileResource'][_0x47db('0x27')]({'where':{'type':_0x594133,'resourceId':_0x26792a['id']}})[_0x47db('0x15')](function(){return _0x472245;});})[_0x47db('0x15')](function(){_0x3b3400[_0x47db('0x1e')](0xcc)[_0x47db('0x29')]();});}};}function handleEntityNotFound(_0x2d19f3){return function(_0x24fcc7){if(!_0x24fcc7){_0x2d19f3[_0x47db('0x2a')](0x194);}return _0x24fcc7;};}function handleError(_0x2b0d2a,_0x4668e2){_0x4668e2=_0x4668e2||0x1f4;return function(_0x428156){logger[_0x47db('0x18')](_0x428156[_0x47db('0x2b')]);if(_0x428156[_0x47db('0x2c')]){delete _0x428156[_0x47db('0x2c')];}_0x2b0d2a[_0x47db('0x1e')](_0x4668e2)[_0x47db('0x2d')](_0x428156);};}exports[_0x47db('0x2e')]=function(_0x54e49d,_0xac37ac){var _0x307d73={'include':[{'model':db[_0x47db('0x2f')],'as':_0x47db('0x30')}]},_0x3713ae={},_0x2a3303={'count':0x0,'rows':[]};var _0x20e4a0=_['map'](db[_0x47db('0x31')][_0x47db('0x32')],function(_0x1ea643){return{'name':_0x1ea643[_0x47db('0x33')],'type':_0x1ea643[_0x47db('0x34')][_0x47db('0x35')]};});_0x3713ae[_0x47db('0x36')]=_[_0x47db('0x37')](_0x20e4a0,'name');_0x3713ae[_0x47db('0x38')]=_[_0x47db('0x39')](_0x54e49d[_0x47db('0x38')]);_0x3713ae[_0x47db('0x3a')]=_['intersection'](_0x3713ae[_0x47db('0x36')],_0x3713ae['query']);_0x307d73[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x3713ae[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x54e49d[_0x47db('0x38')]['fields']));_0x307d73[_0x47db('0x3b')]=_0x307d73[_0x47db('0x3b')][_0x47db('0x3e')]?_0x307d73['attributes']:_0x3713ae[_0x47db('0x36')];if(!_0x54e49d['query'][_0x47db('0x3f')](_0x47db('0x40'))){_0x307d73[_0x47db('0x21')]=qs['limit'](_0x54e49d['query'][_0x47db('0x21')]);_0x307d73[_0x47db('0x1f')]=qs[_0x47db('0x1f')](_0x54e49d[_0x47db('0x38')][_0x47db('0x1f')]);}_0x307d73[_0x47db('0x41')]=qs['sort'](_0x54e49d[_0x47db('0x38')][_0x47db('0x42')]);_0x307d73[_0x47db('0x43')]=qs[_0x47db('0x3a')](_['pick'](_0x54e49d[_0x47db('0x38')],_0x3713ae['filters']),_0x20e4a0);if(_0x54e49d['query'][_0x47db('0x44')]){_0x307d73[_0x47db('0x43')]=_[_0x47db('0x45')](_0x307d73['where'],{'$or':_[_0x47db('0x37')](_0x20e4a0,function(_0x57b7d2){if(_0x57b7d2[_0x47db('0x34')]!==_0x47db('0x46')){var _0x1f6257={};_0x1f6257[_0x57b7d2[_0x47db('0x2c')]]={'$like':'%'+_0x54e49d[_0x47db('0x38')][_0x47db('0x44')]+'%'};return _0x1f6257;}})});}_0x307d73=_[_0x47db('0x45')]({},_0x307d73,_0x54e49d[_0x47db('0x47')]);var _0x14ec65={'where':_0x307d73[_0x47db('0x43')]};return db[_0x47db('0x31')][_0x47db('0x22')](_0x14ec65)[_0x47db('0x15')](function(_0x56f6b1){_0x2a3303[_0x47db('0x22')]=_0x56f6b1;if(_0x54e49d['query'][_0x47db('0x48')]){_0x307d73[_0x47db('0x49')]=[{'all':!![]}];}return db[_0x47db('0x31')][_0x47db('0x4a')](_0x307d73);})[_0x47db('0x15')](function(_0x26c6a4){_0x2a3303[_0x47db('0x4b')]=_0x26c6a4;return _0x2a3303;})[_0x47db('0x15')](respondWithFilteredResult(_0xac37ac,_0x307d73))[_0x47db('0x1d')](handleError(_0xac37ac,null));};exports['show']=function(_0x53f6db,_0x56058d){var _0x48bb48={'raw':![],'where':{'id':_0x53f6db['params']['id']},'include':[{'model':db[_0x47db('0x2f')],'as':_0x47db('0x30')}]},_0x342ae0={};_0x342ae0[_0x47db('0x36')]=_[_0x47db('0x39')](db[_0x47db('0x31')][_0x47db('0x32')]);_0x342ae0[_0x47db('0x38')]=_[_0x47db('0x39')](_0x53f6db[_0x47db('0x38')]);_0x342ae0[_0x47db('0x3a')]=_[_0x47db('0x3c')](_0x342ae0[_0x47db('0x36')],_0x342ae0['query']);_0x48bb48[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x342ae0[_0x47db('0x36')],qs['fields'](_0x53f6db[_0x47db('0x38')]['fields']));_0x48bb48[_0x47db('0x3b')]=_0x48bb48[_0x47db('0x3b')][_0x47db('0x3e')]?_0x48bb48['attributes']:_0x342ae0[_0x47db('0x36')];if(_0x53f6db[_0x47db('0x38')][_0x47db('0x48')]){_0x48bb48[_0x47db('0x49')]=[{'all':!![]}];}_0x48bb48=_['merge']({},_0x48bb48,_0x53f6db[_0x47db('0x47')]);return db['ChatWebsite'][_0x47db('0x4c')](_0x48bb48)[_0x47db('0x15')](handleEntityNotFound(_0x56058d,null))[_0x47db('0x15')](respondWithResult(_0x56058d,null))[_0x47db('0x1d')](handleError(_0x56058d,null));};exports['create']=function(_0x3a9922,_0xec085d){return db[_0x47db('0x31')][_0x47db('0x4d')](_0x3a9922['body'],{})['then'](function(_0x56f73a){var _0x170b9b=_0x3a9922['user'][_0x47db('0x4e')]({'plain':!![]});if(!_0x170b9b)throw new Error(_0x47db('0x4f'));if(_0x170b9b[_0x47db('0x50')]===_0x47db('0x51')){var _0x53acc0=_0x56f73a['get']({'plain':!![]});var _0x171c83='ChatWebsites';return db[_0x47db('0x52')][_0x47db('0x4c')]({'where':{'name':_0x171c83,'userProfileId':_0x170b9b[_0x47db('0x53')]},'raw':!![]})[_0x47db('0x15')](function(_0x2ac531){if(_0x2ac531&&_0x2ac531[_0x47db('0x54')]===0x0){return db[_0x47db('0x55')][_0x47db('0x4d')]({'name':_0x53acc0[_0x47db('0x2c')],'resourceId':_0x53acc0['id'],'type':_0x2ac531[_0x47db('0x2c')],'sectionId':_0x2ac531['id']},{})[_0x47db('0x15')](function(){return _0x56f73a;});}else{return _0x56f73a;}})[_0x47db('0x1d')](function(_0x4fd0ba){logger[_0x47db('0x18')](_0x47db('0x56'),_0x4fd0ba);throw _0x4fd0ba;});}return _0x56f73a;})[_0x47db('0x15')](respondWithResult(_0xec085d,0xc9))[_0x47db('0x1d')](handleError(_0xec085d,null));};exports[_0x47db('0x26')]=function(_0x489ee7,_0x3ccdb7){if(_0x489ee7[_0x47db('0x57')]['id']){delete _0x489ee7['body']['id'];}return db['ChatWebsite'][_0x47db('0x4c')]({'where':{'id':_0x489ee7[_0x47db('0x58')]['id']},'include':[{'model':db[_0x47db('0x2f')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3ccdb7,null))[_0x47db('0x15')](saveUpdates(_0x489ee7[_0x47db('0x57')],null))['then'](respondWithResult(_0x3ccdb7,null))[_0x47db('0x1d')](handleError(_0x3ccdb7,null));};exports['destroy']=function(_0x29a365,_0xda4a8f){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x29a365[_0x47db('0x58')]['id']}})['then'](handleEntityNotFound(_0xda4a8f,null))[_0x47db('0x15')](removeEntity(_0xda4a8f,null))['catch'](handleError(_0xda4a8f,null));};exports[_0x47db('0x59')]=function(_0x5e7da5,_0x4ab4a0){return db['ChatWebsite'][_0x47db('0x59')]()[_0x47db('0x15')](respondWithResult(_0x4ab4a0,null))[_0x47db('0x1d')](handleError(_0x4ab4a0,null));};exports[_0x47db('0x5a')]=function(_0x145284,_0x5f14ac){if(_0x145284['body']['id']){delete _0x145284[_0x47db('0x57')]['id'];}return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x145284['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x5f14ac,null))[_0x47db('0x15')](function(_0x5a91a7){if(_0x5a91a7){_0x145284[_0x47db('0x57')][_0x47db('0x5b')]=_0x5a91a7['id'];return db[_0x47db('0x5c')][_0x47db('0x4d')](_0x145284[_0x47db('0x57')]);}})[_0x47db('0x15')](respondWithResult(_0x5f14ac,null))[_0x47db('0x1d')](handleError(_0x5f14ac,null));};exports[_0x47db('0x5d')]=function(_0x2fc8b2,_0x51651d){var _0x1852c2={'raw':![],'where':{}};var _0x57a3df={};var _0x2f5e67={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x47db('0x5e')]({'where':{'id':_0x2fc8b2[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x51651d,null))[_0x47db('0x15')](function(_0x5b6a84){if(_0x5b6a84){_0x57a3df[_0x47db('0x36')]=_[_0x47db('0x39')](db[_0x47db('0x5c')][_0x47db('0x32')]);_0x57a3df[_0x47db('0x38')]=_[_0x47db('0x39')](_0x2fc8b2[_0x47db('0x38')]);_0x57a3df[_0x47db('0x3a')]=_['intersection'](_0x57a3df['model'],_0x57a3df[_0x47db('0x38')]);_0x1852c2[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x57a3df[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x2fc8b2['query'][_0x47db('0x3d')]));_0x1852c2[_0x47db('0x3b')]=_0x1852c2['attributes']['length']?_0x1852c2[_0x47db('0x3b')]:_0x57a3df[_0x47db('0x36')];if(!_0x2fc8b2[_0x47db('0x38')][_0x47db('0x3f')](_0x47db('0x40'))){_0x1852c2['limit']=qs[_0x47db('0x21')](_0x2fc8b2[_0x47db('0x38')][_0x47db('0x21')]);_0x1852c2[_0x47db('0x1f')]=qs[_0x47db('0x1f')](_0x2fc8b2[_0x47db('0x38')][_0x47db('0x1f')]);}_0x1852c2[_0x47db('0x41')]=qs[_0x47db('0x42')](_0x2fc8b2[_0x47db('0x38')][_0x47db('0x42')]);_0x1852c2[_0x47db('0x43')]=qs[_0x47db('0x3a')](_['pick'](_0x2fc8b2[_0x47db('0x38')],_0x57a3df[_0x47db('0x3a')]));_0x1852c2['where'][_0x47db('0x5b')]=_0x5b6a84['id'];if(_0x2fc8b2[_0x47db('0x38')]['filter']){_0x1852c2['where']=_[_0x47db('0x45')](_0x1852c2[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x1852c2[_0x47db('0x3b')],function(_0xdc935f){var _0xca722b={};_0xca722b[_0xdc935f]={'$like':'%'+_0x2fc8b2[_0x47db('0x38')][_0x47db('0x44')]+'%'};return _0xca722b;})});}_0x1852c2=_[_0x47db('0x45')]({},_0x1852c2,_0x2fc8b2[_0x47db('0x47')]);return db[_0x47db('0x5c')][_0x47db('0x22')]({'where':_0x1852c2['where']})[_0x47db('0x15')](function(_0x281e08){_0x2f5e67[_0x47db('0x22')]=_0x281e08;if(_0x2fc8b2[_0x47db('0x38')][_0x47db('0x48')]){_0x1852c2[_0x47db('0x49')]=[{'all':!![]}];}return db[_0x47db('0x5c')]['findAll'](_0x1852c2);})[_0x47db('0x15')](function(_0x1e08da){_0x2f5e67[_0x47db('0x4b')]=_0x1e08da;return _0x2f5e67;});}})[_0x47db('0x15')](respondWithFilteredResult(_0x51651d,_0x1852c2))['catch'](handleError(_0x51651d,null));};exports['removeDispositions']=function(_0x2479ea,_0x226d84){return db[_0x47db('0x31')]['find']({'where':{'id':_0x2479ea[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x226d84,null))[_0x47db('0x15')](function(_0x849df9){if(_0x849df9){return _0x849df9[_0x47db('0x5f')](_0x2479ea['query'][_0x47db('0x60')]);}})[_0x47db('0x15')](respondWithStatusCode(_0x226d84,null))[_0x47db('0x1d')](handleError(_0x226d84,null));};exports[_0x47db('0x61')]=function(_0x4ee027,_0x17912b){if(_0x4ee027[_0x47db('0x57')]['id']){delete _0x4ee027[_0x47db('0x57')]['id'];}return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x4ee027[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x17912b,null))['then'](function(_0x426842){if(_0x426842){_0x4ee027[_0x47db('0x57')][_0x47db('0x5b')]=_0x426842['id'];return db[_0x47db('0x62')][_0x47db('0x4d')](_0x4ee027[_0x47db('0x57')]);}})[_0x47db('0x15')](respondWithResult(_0x17912b,null))['catch'](handleError(_0x17912b,null));};exports[_0x47db('0x63')]=function(_0x5bdb94,_0x1e17ed){var _0x4cddfe={'raw':![],'where':{}};var _0x2e0617={};var _0x329e91={'count':0x0,'rows':[]};return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x5bdb94['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x1e17ed,null))[_0x47db('0x15')](function(_0x29ee2c){if(_0x29ee2c){_0x2e0617[_0x47db('0x36')]=_[_0x47db('0x39')](db['CannedAnswer'][_0x47db('0x32')]);_0x2e0617['query']=_['keys'](_0x5bdb94['query']);_0x2e0617[_0x47db('0x3a')]=_['intersection'](_0x2e0617[_0x47db('0x36')],_0x2e0617['query']);_0x4cddfe[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x2e0617[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x5bdb94[_0x47db('0x38')][_0x47db('0x3d')]));_0x4cddfe[_0x47db('0x3b')]=_0x4cddfe[_0x47db('0x3b')]['length']?_0x4cddfe[_0x47db('0x3b')]:_0x2e0617[_0x47db('0x36')];if(!_0x5bdb94[_0x47db('0x38')][_0x47db('0x3f')]('nolimit')){_0x4cddfe[_0x47db('0x21')]=qs[_0x47db('0x21')](_0x5bdb94['query']['limit']);_0x4cddfe[_0x47db('0x1f')]=qs['offset'](_0x5bdb94[_0x47db('0x38')][_0x47db('0x1f')]);}_0x4cddfe['order']=qs[_0x47db('0x42')](_0x5bdb94[_0x47db('0x38')][_0x47db('0x42')]);_0x4cddfe['where']=qs[_0x47db('0x3a')](_[_0x47db('0x64')](_0x5bdb94[_0x47db('0x38')],_0x2e0617[_0x47db('0x3a')]));_0x4cddfe['where'][_0x47db('0x5b')]=_0x29ee2c['id'];if(_0x5bdb94['query'][_0x47db('0x44')]){_0x4cddfe['where']=_[_0x47db('0x45')](_0x4cddfe[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x4cddfe['attributes'],function(_0x5cf08d){var _0x49b4da={};_0x49b4da[_0x5cf08d]={'$like':'%'+_0x5bdb94['query']['filter']+'%'};return _0x49b4da;})});}_0x4cddfe=_['merge']({},_0x4cddfe,_0x5bdb94[_0x47db('0x47')]);return db[_0x47db('0x62')][_0x47db('0x22')]({'where':_0x4cddfe[_0x47db('0x43')]})[_0x47db('0x15')](function(_0x1433f1){_0x329e91['count']=_0x1433f1;if(_0x5bdb94[_0x47db('0x38')]['includeAll']){_0x4cddfe[_0x47db('0x49')]=[{'all':!![]}];}return db['CannedAnswer'][_0x47db('0x4a')](_0x4cddfe);})[_0x47db('0x15')](function(_0x438e68){_0x329e91[_0x47db('0x4b')]=_0x438e68;return _0x329e91;});}})[_0x47db('0x15')](respondWithFilteredResult(_0x1e17ed,_0x4cddfe))[_0x47db('0x1d')](handleError(_0x1e17ed,null));};exports[_0x47db('0x65')]=function(_0x486f1e,_0x2efa0c){return db['ChatWebsite'][_0x47db('0x4c')]({'where':{'id':_0x486f1e[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2efa0c,null))['then'](function(_0x28f6e8){if(_0x28f6e8){return _0x28f6e8['removeAnswers'](_0x486f1e[_0x47db('0x38')][_0x47db('0x60')]);}})[_0x47db('0x15')](respondWithStatusCode(_0x2efa0c,null))[_0x47db('0x1d')](handleError(_0x2efa0c,null));};exports[_0x47db('0x66')]=function(_0x41f4d0,_0x4aa0c3){_0x41f4d0[_0x47db('0x57')][_0x47db('0x67')]=_0x41f4d0[_0x47db('0x68')]['filename'];return db[_0x47db('0x31')]['find']({'where':{'id':_0x41f4d0['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x4aa0c3,null))[_0x47db('0x15')](saveUpdates(_0x41f4d0[_0x47db('0x57')],null))[_0x47db('0x15')](respondWithResult(_0x4aa0c3,null))[_0x47db('0x1d')](handleError(_0x4aa0c3,null));};exports[_0x47db('0x69')]=function(_0x459f05,_0x382ec8){_0x459f05[_0x47db('0x57')][_0x47db('0x6a')]=_0x459f05[_0x47db('0x68')]['filename'];return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x459f05[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x382ec8,null))['then'](saveUpdates(_0x459f05['body'],null))[_0x47db('0x15')](respondWithResult(_0x382ec8,null))[_0x47db('0x1d')](handleError(_0x382ec8,null));};exports['addCustomerAvatar']=function(_0x8faf2e,_0x2e4315){_0x8faf2e[_0x47db('0x57')]['customerAvatar']=_0x8faf2e['file'][_0x47db('0x6b')];return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x8faf2e[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2e4315,null))[_0x47db('0x15')](saveUpdates(_0x8faf2e[_0x47db('0x57')],null))[_0x47db('0x15')](respondWithResult(_0x2e4315,null))[_0x47db('0x1d')](handleError(_0x2e4315,null));};exports[_0x47db('0x6c')]=function(_0x5559df,_0x2978da){_0x5559df[_0x47db('0x57')][_0x47db('0x6d')]=_0x5559df[_0x47db('0x68')][_0x47db('0x6b')];return db[_0x47db('0x31')]['find']({'where':{'id':_0x5559df[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2978da,null))[_0x47db('0x15')](saveUpdates(_0x5559df[_0x47db('0x57')],null))[_0x47db('0x15')](respondWithResult(_0x2978da,null))['catch'](handleError(_0x2978da,null));};exports[_0x47db('0x6e')]=function(_0x28e3f8,_0x3257ab){var _0x4edd0f=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x71'));var _0x44e393={'where':{'id':_0x28e3f8[_0x47db('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x298ea1=![];return require('../../config/license/util')[_0x47db('0x72')]()[_0x47db('0x15')](function(_0x47d605){if(_0x47d605){_0x298ea1=_0x47d605[_0x47db('0x73')];}})[_0x47db('0x15')](function(){return db[_0x47db('0x31')][_0x47db('0x4c')](_0x44e393);})[_0x47db('0x15')](handleEntityNotFound(_0x3257ab,null))[_0x47db('0x15')](function(_0x118645){if(_0x118645){if(!_[_0x47db('0x74')](_0x118645['sitepic'])){if(fs['existsSync'](path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x75'),_0x118645[_0x47db('0x67')]))&&_0x298ea1){_0x4edd0f=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x75'),_0x118645[_0x47db('0x67')]);}}return _0x3257ab[_0x47db('0x76')](_0x4edd0f);}})[_0x47db('0x1d')](handleError(_0x3257ab,null));};exports['getAvatar']=function(_0x21b0a7,_0x1431b1){var _0xa50a53=path[_0x47db('0x6f')](config['root'],_0x47db('0x77'));var _0x49da8a={'where':{'id':_0x21b0a7[_0x47db('0x58')]['id']},'attributes':['id',_0x47db('0x6a')],'raw':!![]};return db[_0x47db('0x31')][_0x47db('0x4c')](_0x49da8a)[_0x47db('0x15')](handleEntityNotFound(_0x1431b1,null))[_0x47db('0x15')](function(_0x5b48e4){if(_0x5b48e4){if(!_['isNil'](_0x5b48e4[_0x47db('0x6a')])){if(fs[_0x47db('0x78')](path[_0x47db('0x6f')](config[_0x47db('0x70')],'server/files/images/avatars/',_0x5b48e4[_0x47db('0x6a')]))){_0xa50a53=path[_0x47db('0x6f')](config['root'],_0x47db('0x79'),_0x5b48e4[_0x47db('0x6a')]);}}return _0x1431b1['download'](_0xa50a53);}})['catch'](handleError(_0x1431b1,null));};exports[_0x47db('0x7a')]=function(_0x25fa50,_0x45732e){var _0x18d8b6=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x7b'));var _0x33ae54={'where':{'id':_0x25fa50[_0x47db('0x58')]['id']},'attributes':['id',_0x47db('0x7c'),_0x47db('0x7d')],'raw':!![]};return db['ChatWebsite']['find'](_0x33ae54)[_0x47db('0x15')](handleEntityNotFound(_0x45732e,null))[_0x47db('0x15')](function(_0x4934a4){if(_0x4934a4){if(!_['isNil'](_0x4934a4[_0x47db('0x7c')])){if(fs[_0x47db('0x78')](path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x79'),_0x4934a4[_0x47db('0x7c')]))&&_0x4934a4[_0x47db('0x7d')]){_0x18d8b6=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x79'),_0x4934a4[_0x47db('0x7c')]);}}return _0x45732e[_0x47db('0x76')](_0x18d8b6);}})[_0x47db('0x1d')](handleError(_0x45732e,null));};exports[_0x47db('0x7e')]=function(_0x592869,_0x3e6017){var _0x59d8e6=path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x7f'));var _0x2f2966={'where':{'id':_0x592869[_0x47db('0x58')]['id']},'attributes':['id',_0x47db('0x6d')],'raw':!![]};return db[_0x47db('0x31')][_0x47db('0x4c')](_0x2f2966)[_0x47db('0x15')](handleEntityNotFound(_0x3e6017,null))['then'](function(_0x380f22){if(_0x380f22){if(!_['isNil'](_0x380f22[_0x47db('0x6d')])){if(fs[_0x47db('0x78')](path['join'](config[_0x47db('0x70')],'server/files/images/avatars/',_0x380f22['systemAvatar']))){_0x59d8e6=path['join'](config[_0x47db('0x70')],_0x47db('0x79'),_0x380f22['systemAvatar']);}}return _0x3e6017['download'](_0x59d8e6);}})[_0x47db('0x1d')](handleError(_0x3e6017,null));};exports['notify']=function(_0x137ced,_0x18b980){var _0x63d215=require(_0x47db('0x80'));var _0x44a33f=new _0x63d215();var _0x532851=_0x44a33f['setUA'](_0x137ced['headers'][_0x47db('0x81')])[_0x47db('0x82')]();var _0xf1181c={'body':_0x137ced['body'],'channel':_0x47db('0x83')};var _0x17b91=[];var _0x62d395=[];var _0x545ef7={};var _0x2cceef=![];return db[_0x47db('0x84')][_0x47db('0x59')]()[_0x47db('0x15')](function(_0x4bbd0b){if(!_0x4bbd0b){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x87'));}_0x17b91=_[_0x47db('0x88')](_[_0x47db('0x39')](_0x4bbd0b),['createdAt',_0x47db('0x89')]);_0x62d395=_[_0x47db('0x88')](_[_0x47db('0x39')](_0x4bbd0b),['createdAt',_0x47db('0x89'),_0x47db('0x8a'),_0x47db('0x8b')]);if(_0x137ced[_0x47db('0x57')]['id']){delete _0x137ced['body']['id'];}if(_[_0x47db('0x74')](_0x137ced[_0x47db('0x57')][_0x47db('0x8c')])){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x8d'));}if(_[_0x47db('0x74')](_0x137ced['body'][_0x47db('0x57')])||_0x137ced['body']['body']===''){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x8e'));}if(_[_0x47db('0x74')](_0x137ced[_0x47db('0x57')][_0x47db('0x8f')])){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x90')+_0x62d395);}if(!_[_0x47db('0x91')](_0x62d395,_0x137ced[_0x47db('0x57')]['mapKey'])){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x92')+_0x62d395);}_0x545ef7[_0x137ced[_0x47db('0x57')][_0x47db('0x8f')]]=_0x137ced[_0x47db('0x57')][_0x47db('0x8c')];})['then'](function(){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x137ced[_0x47db('0x58')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47db('0x84')],'as':_0x47db('0x93'),'where':_0x545ef7,'limit':0x1,'order':[[_0x47db('0x89'),_0x47db('0x94')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x47db('0x15')](handleEntityNotFound(_0x18b980,null))[_0x47db('0x15')](function(_0xe9cff7){if(_0xe9cff7&&_0xe9cff7['List']){_0xf1181c[_0x47db('0x95')]=_0xe9cff7;_0xf1181c[_0x47db('0x96')]=_0xe9cff7[_0x47db('0x97')];_0xf1181c['list']=_0xe9cff7[_0x47db('0x98')];_0xf1181c[_0x47db('0x96')]=_[_0x47db('0x99')](_0xf1181c[_0x47db('0x96')],[_0x47db('0x9a')],[_0x47db('0x9b')]);if(_0xf1181c[_0x47db('0x95')][_0x47db('0x97')]){delete _0xf1181c[_0x47db('0x95')]['Applications'];}if(_0xf1181c[_0x47db('0x95')][_0x47db('0x98')]&&_0xf1181c[_0x47db('0x95')][_0x47db('0x98')][_0x47db('0x93')][_0x47db('0x3e')]){return _0xf1181c[_0x47db('0x95')]['List'][_0x47db('0x93')][0x0];}var _0xdd2f8b=_[_0x47db('0xc')](_0x137ced[_0x47db('0x57')],{'firstName':_0x137ced[_0x47db('0x57')]['from'],'ListId':_0xe9cff7[_0x47db('0x8b')]});_0xdd2f8b[_0x137ced[_0x47db('0x57')][_0x47db('0x8f')]]=_0x137ced['body'][_0x47db('0x8c')];return db['CmContact']['create'](_0xdd2f8b,{'fields':_0x17b91,'raw':!![]});}})[_0x47db('0x15')](handleEntityNotFound(_0x18b980,null))[_0x47db('0x15')](function(_0x11c567){_0xf1181c[_0x47db('0x9c')]=_0x11c567;var _0x3e18ca=_0x137ced[_0x47db('0x57')]['customerIp'];if(_0x137ced[_0x47db('0x9d')][_0x47db('0x9e')]){_0x3e18ca=_0x137ced['headers'][_0x47db('0x9e')];}else if(_0x137ced['headers'][_0x47db('0x9f')]){_0x3e18ca=_[_0x47db('0xa0')](_0x137ced[_0x47db('0x9d')][_0x47db('0x9f')][_0x47db('0xa1')](','));}if(_0x11c567){var _0x3c57d2={'ContactId':_0x11c567['id'],'ChatWebsiteId':_0x137ced[_0x47db('0x58')]['id'],'from':(_0x11c567['firstName']||'')+'\x20'+(_0x11c567['lastName']||''),'customerIp':_0x3e18ca,'customerPort':_0x137ced[_0x47db('0x9d')]['x-real-port']?_0x137ced['headers']['x-real-port']:null,'referer':_0x137ced[_0x47db('0x57')]['referer'],'browserName':_0x532851['browser'][_0x47db('0x2c')]&&_0x532851[_0x47db('0xa2')][_0x47db('0xa3')]?util[_0x47db('0xa4')](_0x47db('0xa5'),_0x532851['browser'][_0x47db('0x2c')],_0x532851[_0x47db('0xa2')][_0x47db('0xa3')]):_0x47db('0xa6'),'browserVersion':_0x532851[_0x47db('0xa2')][_0x47db('0xa3')]||_0x47db('0xa6'),'osName':util[_0x47db('0xa4')](_0x47db('0xa5'),_0x532851['os'][_0x47db('0x2c')],_0x532851['os'][_0x47db('0xa3')]),'osVersion':_0x532851['os']['version'],'deviceModel':_0x532851[_0x47db('0xa7')]['model']&&_0x532851['device'][_0x47db('0xa8')]?util[_0x47db('0xa4')](_0x47db('0xa9'),_0x532851['device'][_0x47db('0x36')],_0x532851[_0x47db('0xa7')][_0x47db('0xa8')],_0x532851[_0x47db('0xa7')]['type']):null,'deviceVendor':_0x532851['device'][_0x47db('0xa8')],'deviceType':_0x532851[_0x47db('0xa7')]['type'],'formData':JSON[_0x47db('0x17')](_0x137ced[_0x47db('0x57')])};var _0x335d21={'ChatWebsiteId':_0x137ced['params']['id'],'closed':![]};if(_0x137ced[_0x47db('0x57')][_0x47db('0xaa')]){_0x335d21[_0x47db('0xaa')]=_0x137ced[_0x47db('0x57')][_0x47db('0xaa')];return db[_0x47db('0xab')][_0x47db('0x4c')]({'where':_0x335d21})[_0x47db('0x15')](function(_0x282a18){if(_0x282a18){return[_0x282a18,![]];}_0x3c57d2[_0x47db('0xaa')]=_0x137ced[_0x47db('0x57')][_0x47db('0xaa')];_0x3c57d2[_0x47db('0xac')]=_0x137ced[_0x47db('0x57')]['externalUrl'];return db[_0x47db('0xab')][_0x47db('0x4d')](_0x3c57d2)[_0x47db('0x15')](function(_0x35b02c){return[_0x35b02c,!![]];});});}_0x335d21[_0x47db('0xad')]=_0x11c567['id'];if(_0x137ced[_0x47db('0x57')][_0x47db('0xae')]&&_0x137ced[_0x47db('0x57')][_0x47db('0xae')]['id']){_0x335d21['id']=_0x137ced[_0x47db('0x57')][_0x47db('0xae')]['id'];return db[_0x47db('0xab')][_0x47db('0x4c')]({'where':_0x335d21})[_0x47db('0x15')](function(_0x261083){if(_0x261083){return[_0x261083,![]];}return db['ChatInteraction'][_0x47db('0x4d')](_0x3c57d2)['then'](function(_0x224e1d){return[_0x224e1d,!![]];});});}return db[_0x47db('0xab')][_0x47db('0x4d')](_0x3c57d2)[_0x47db('0x15')](function(_0x14a1de){return[_0x14a1de,!![]];});}})[_0x47db('0xaf')](function(_0x35a48f,_0x1257cb){if(_0x35a48f){_0x2cceef=_0x1257cb;if(!_0x1257cb){var _0x5bc7f0={'from':(_0xf1181c['contact']['firstName']||'')+'\x20'+(_0xf1181c[_0x47db('0x9c')][_0x47db('0xb0')]||'')};if(_0x137ced[_0x47db('0x57')][_0x47db('0xaa')]&&_0x137ced[_0x47db('0x57')][_0x47db('0xb1')]&&_0x137ced['body'][_0x47db('0xaa')]!=_0x137ced['body'][_0x47db('0xb1')]){_0x5bc7f0['threadId']=_0x137ced[_0x47db('0x57')][_0x47db('0xb1')];}return _0x35a48f['update'](_0x5bc7f0);}else{return _0x35a48f;}}})[_0x47db('0x15')](function(_0x3bc248){_0xf1181c[_0x47db('0xae')]=_0x3bc248[_0x47db('0x4e')]({'plain':!![]});_0xf1181c['interaction'][_0x47db('0xb2')]=_0x2cceef;if(_0xf1181c[_0x47db('0xae')][_0x47db('0xb2')]){if(_0xf1181c[_0x47db('0x95')][_0x47db('0xb3')]){_0xf1181c['applications'][_0x47db('0xb4')]({'id':0x0,'priority':_0xf1181c[_0x47db('0x96')][_0x47db('0x3e')]+0x1,'app':_0x47db('0xb5'),'appdata':'unmanaged','interval':_0x47db('0xb6')});}}return db['ChatMessage']['create']({'body':_0x137ced[_0x47db('0x57')]['body'],'ChatWebsiteId':_0x137ced[_0x47db('0x58')]['id'],'ChatInteractionId':_0x3bc248['id'],'direction':'in','ContactId':_0xf1181c[_0x47db('0x9c')]['id'],'AttachmentId':_0x137ced[_0x47db('0x57')]['AttachmentId']});})[_0x47db('0x15')](function(_0x1551eb){_0xf1181c['message']=_0x1551eb;if(_0xf1181c[_0x47db('0xae')][_0x47db('0xb7')]){return db['User']['find']({'attributes':['id',_0x47db('0x2c')],'where':{'id':_0xf1181c[_0x47db('0xae')]['UserId']}})['then'](function(_0x115011){if(_0x115011){_0xf1181c['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x115011[_0x47db('0x2c')]+','+(_0xf1181c[_0x47db('0x95')]['waitForTheAssignedAgent']||0xa),'interval':_0x47db('0xb6')});_0xf1181c['forcedOwnership']=!![];}return respondWithRpcPromise(_0x47db('0xb8'),_0x47db('0xb9'),_0xf1181c);});}return respondWithRpcPromise(_0x47db('0xb8'),_0x47db('0xb9'),_0xf1181c);})[_0x47db('0x15')](function(_0x21e0a1){respondWithRpcPromise(_0x47db('0xba'),'EventManager',{'event':'notify','message':_0x21e0a1},client9002);return _0x21e0a1;})[_0x47db('0x15')](respondWithResult(_0x18b980,null))['catch'](handleError(_0x18b980,null));};exports[_0x47db('0xbb')]=function(_0x16fe70,_0x54d4d7){var _0x5bb677,_0x12e30e,_0x50f360;var _0x3d7e18=[];var _0x762e7f={};var _0x2ba327=_0x16fe70[_0x47db('0xbc')]||[];var _0x16a7f1=[];var _0x4cb864;return db[_0x47db('0x84')]['describe']()[_0x47db('0x15')](function(_0x32b4e0){if(!_0x32b4e0){throw new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0x87'));}_0x3d7e18=_[_0x47db('0x88')](_[_0x47db('0x39')](_0x32b4e0),[_0x47db('0xbd'),_0x47db('0x89'),_0x47db('0x8a'),_0x47db('0x8b')]);if(_0x16fe70['body']['id']){delete _0x16fe70['body']['id'];}if(_[_0x47db('0x74')](_0x16fe70['body'][_0x47db('0x8c')])){throw _0x54d4d7['status'](0x1f4)[_0x47db('0x2d')](new db['Sequelize'][(_0x47db('0x86'))]('from\x20is\x20mandatory'));}if(_[_0x47db('0x74')](_0x16fe70[_0x47db('0x57')][_0x47db('0x57')])||_0x16fe70[_0x47db('0x57')][_0x47db('0x57')]===''){throw _0x54d4d7[_0x47db('0x1e')](0x1f4)['send'](new db[(_0x47db('0x85'))][(_0x47db('0x86'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x47db('0x74')](_0x16fe70[_0x47db('0x57')][_0x47db('0xbe')])){throw _0x54d4d7[_0x47db('0x1e')](0x1f4)[_0x47db('0x2d')](new db[(_0x47db('0x85'))][(_0x47db('0x86'))](_0x47db('0xbf')+_0x3d7e18));}if(!_[_0x47db('0x91')](_0x3d7e18,_0x16fe70[_0x47db('0x57')]['mapKeyOffline'])){throw _0x54d4d7[_0x47db('0x1e')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x47db('0xc0')+_0x3d7e18));}_0x762e7f[_0x16fe70[_0x47db('0x57')][_0x47db('0xbe')]]=_0x16fe70[_0x47db('0x57')][_0x47db('0x8c')];})[_0x47db('0x15')](function(){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x16fe70[_0x47db('0x58')]['id']},'include':[{'model':db[_0x47db('0xc1')],'as':'List'},{'model':db[_0x47db('0xc2')],'as':_0x47db('0xc2')}]});})['then'](handleEntityNotFound(_0x54d4d7,null))[_0x47db('0x15')](function(_0x39f1d8){if(_0x39f1d8&&_0x39f1d8[_0x47db('0x98')]){_0x12e30e=_0x39f1d8;var _0x1cb7c4=_[_0x47db('0xc')](_0x16fe70[_0x47db('0x57')],{'firstName':_0x16fe70[_0x47db('0x57')][_0x47db('0x8c')],'phone':_0x16fe70['body']['from'],'ListId':_0x39f1d8['ListId']});_0x1cb7c4[_0x16fe70[_0x47db('0x57')]['mapKeyOffline']]=_0x16fe70[_0x47db('0x57')][_0x47db('0x8c')];return db[_0x47db('0x84')][_0x47db('0xc3')]({'where':_0x762e7f,'defaults':_0x1cb7c4});}})[_0x47db('0xaf')](function(_0x3bcd5c){if(_0x3bcd5c){_0x50f360=_0x3bcd5c;var _0x1e64b0=fs[_0x47db('0xc4')](path[_0x47db('0x6f')](config['root'],_0x47db('0xc5')),'utf8');var _0x2145eb=ejs[_0x47db('0xc6')](_0x1e64b0,{'body':_[_0x47db('0xc7')](_0x16fe70[_0x47db('0x57')]['body']),'bodyTitle':_0x12e30e[_0x47db('0xc8')]});return db[_0x47db('0xc9')][_0x47db('0x4d')]({'body':_0x2145eb,'ContactId':_0x3bcd5c['id'],'ChatWebsiteId':_0x12e30e['id']});}})['then'](function(_0x1871b8){_0x4cb864=_0x1871b8;if(_0x2ba327[_0x47db('0x3e')]){var _0x35aab5=_0x2ba327[_0x47db('0x37')](function(_0x101ca0){return{'name':_0x101ca0[_0x47db('0xca')],'basename':_0x101ca0[_0x47db('0x6b')],'type':_0x101ca0[_0x47db('0xcb')],'ChatOfflineMessageId':_0x1871b8['id']};});_0x16a7f1=_0x35aab5[_0x47db('0x37')](_0x376775=>{var _0x458964={'filename':_0x376775['name'],'path':path[_0x47db('0x6f')](config['root'],'server',_0x47db('0xbc'),_0x47db('0xcc'),_0x47db('0xcd'),_0x376775[_0x47db('0xce')])};return _0x458964;});if(!_0x12e30e[_0x47db('0xcf')]){return db[_0x47db('0xd0')]['transaction'](function(_0x4bd6f5){return db['Attachment'][_0x47db('0xd1')](_0x35aab5,{'transaction':_0x4bd6f5});});}}})[_0x47db('0x15')](function(){if(_0x4cb864){_0x5bb677=_0x4cb864;return db[_0x47db('0xc2')][_0x47db('0x5e')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x47db('0xd2'),'raw':!![]}]});}})[_0x47db('0x15')](function(_0x455e01){if(_0x455e01&&_0x455e01[_0x47db('0xd2')]&&_0x12e30e['forwardOffline']&&_0x12e30e[_0x47db('0xd3')]){var _0x297ce4={'tls':{'rejectUnauthorized':![]}};if(_0x455e01['Smtp'][_0x47db('0xd4')]){_0x297ce4['service']=_0x455e01[_0x47db('0xd2')][_0x47db('0xd4')];}else{_0x297ce4[_0x47db('0xd5')]=_0x455e01[_0x47db('0xd2')][_0x47db('0xd5')];_0x297ce4['port']=_0x455e01[_0x47db('0xd2')]['port'];_0x297ce4[_0x47db('0xd6')]=_0x455e01[_0x47db('0xd2')][_0x47db('0xd6')];}if(_0x455e01[_0x47db('0xd2')]['authentication']){_0x297ce4[_0x47db('0xd7')]={'user':_0x455e01['Smtp']['user'],'pass':_0x455e01[_0x47db('0xd2')][_0x47db('0xd8')]};}return respondWithRpcPromise(_0x47db('0xd9'),'sendMail',{'account':_0x297ce4,'message':{'from':util[_0x47db('0xa4')](_0x47db('0xda'),_0x455e01['name'],_0x455e01['email']||_0x455e01['Smtp'][_0x47db('0x51')]),'to':_0x12e30e['forwardOfflineAddress'],'subject':_0x12e30e['offlineMessageSubject'],'html':_0x5bb677['body'],'attachments':_0x16a7f1}},client9003)[_0x47db('0x15')](function(){return _0x5bb677;})['catch'](function(_0x4e231a){console[_0x47db('0x18')](_0x4e231a);});}})[_0x47db('0x15')](function(){if(_0x12e30e&&_0x12e30e['openNewInteraction']&&_0x12e30e[_0x47db('0xdb')]){var _0x3e23a5=[];if(_0x2ba327['length']){_0x3e23a5=_0x2ba327[_0x47db('0x37')](function(_0x4b76eb){return{'name':_0x4b76eb['originalname'],'basename':_0x4b76eb[_0x47db('0x6b')],'type':_0x4b76eb['mimetype'],'ChatOfflineMessageId':_0x4cb864['id']};});}var _0x28706f;if(!_[_0x47db('0x74')](_0x12e30e[_0x47db('0xdc')])){var _0x46578a=_[_0x47db('0x37')](_0x16fe70[_0x47db('0x57')],function(_0x1a320f){return _0x1a320f;});var _0x5324f7=_[_0x47db('0xdd')](_0x46578a)[0x0];var _0x4e3bc2=_['mapValues'](_0x5324f7,function(_0x232267){return _0x232267;});_0x28706f=_0x4e3bc2[0x1][_0x12e30e[_0x47db('0xdc')]];}var _0x5977d3={'from':_0x50f360['email'],'firstName':_0x50f360[_0x47db('0xde')],'lastName':_0x50f360['lastName'],'mapKey':_0x47db('0xdf'),'message':{'from':_0x50f360[_0x47db('0xdf')],'to':_0x12e30e[_0x47db('0xc2')]['email'],'cc':'','subject':_[_0x47db('0x74')](_0x28706f)?_0x12e30e[_0x47db('0xe0')]:_0x28706f,'messageId':'','sentAt':new Date(),'attach':_0x3e23a5['length'],'attachments':_0x3e23a5,'originChannel':_0x47db('0xe1'),'ChatWebsiteId':_0x12e30e['id'],'ChatOfflineMessageId':_0x5bb677['id'],'originTo':_0x12e30e[_0x47db('0xc2')][_0x47db('0xdf')]},'body':_0x5bb677[_0x47db('0x57')]};var _0x5cad1a={'account':{'id':_0x12e30e['MailAccountId']},'body':_0x5977d3,'log':_0x47db('0xe2')};return respondWithRpcPromise('NotifyMailAccount',_0x47db('0xe3'),_0x5cad1a,client9001)[_0x47db('0x15')](function(){return _0x5bb677;})['catch'](function(_0x3b3d4a){console['error'](_0x3b3d4a);});}return;})[_0x47db('0x15')](function(){if(_0x5bb677){return _0x5bb677;}})[_0x47db('0x15')](respondWithResult(_0x54d4d7,null))[_0x47db('0x1d')](function(_0x3c4ff0){console[_0x47db('0x18')](_0x47db('0x1d'),_0x3c4ff0);for(var _0x151601 of _0x2ba327){var _0x1c4804=path[_0x47db('0x6f')](config[_0x47db('0x70')],'server',_0x47db('0xbc'),_0x47db('0xcc'),_0x47db('0xcd'),_0x151601[_0x47db('0x6b')]);fs_extra[_0x47db('0xe4')](_0x1c4804)[_0x47db('0x1d')](function(_0x5acb2b){console[_0x47db('0x18')](_0x47db('0xe5'),_0x1c4804,_0x5acb2b);});}});};exports[_0x47db('0xe6')]=function(_0x3e9800,_0x2508ae){return db[_0x47db('0xab')]['find']({'where':{'id':_0x3e9800['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2508ae,null))['then'](function(_0x44e751){if(_0x44e751){return _0x44e751[_0x47db('0xe6')](_0x3e9800[_0x47db('0x57')]['ids'],_[_0x47db('0xe7')](_0x3e9800['body'],[_0x47db('0x60'),'id'])||{});}})['then'](respondWithResult(_0x2508ae,null))[_0x47db('0x1d')](handleError(_0x2508ae,null));};exports[_0x47db('0xe8')]=function(_0x4a80bf,_0x417696){var _0x1cff4f={'raw':![],'where':{}};var _0x127a5d={};var _0x44441b={'count':0x0,'rows':[]};return db[_0x47db('0x31')]['findOne']({'where':{'id':_0x4a80bf[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x417696,null))[_0x47db('0x15')](function(_0x115ac3){if(_0x115ac3){_0x127a5d[_0x47db('0x36')]=_[_0x47db('0x39')](db[_0x47db('0xab')]['rawAttributes']);_0x127a5d[_0x47db('0x38')]=_[_0x47db('0x39')](_0x4a80bf['query']);_0x127a5d['filters']=_[_0x47db('0x3c')](_0x127a5d[_0x47db('0x36')],_0x127a5d[_0x47db('0x38')]);_0x1cff4f['attributes']=_['intersection'](_0x127a5d[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x4a80bf['query']['fields']));_0x1cff4f[_0x47db('0x3b')]=_0x1cff4f[_0x47db('0x3b')][_0x47db('0x3e')]?_0x1cff4f[_0x47db('0x3b')]:_0x127a5d[_0x47db('0x36')];if(!_0x4a80bf['query']['hasOwnProperty'](_0x47db('0x40'))){_0x1cff4f[_0x47db('0x21')]=qs['limit'](_0x4a80bf[_0x47db('0x38')][_0x47db('0x21')]);_0x1cff4f[_0x47db('0x1f')]=qs['offset'](_0x4a80bf[_0x47db('0x38')][_0x47db('0x1f')]);}_0x1cff4f[_0x47db('0x41')]=qs['sort'](_0x4a80bf[_0x47db('0x38')][_0x47db('0x42')]);_0x1cff4f['where']=qs[_0x47db('0x3a')](_[_0x47db('0x64')](_0x4a80bf[_0x47db('0x38')],_0x127a5d[_0x47db('0x3a')]));_0x1cff4f['where'][_0x47db('0x5b')]=_0x115ac3['id'];if(_0x4a80bf[_0x47db('0x38')]['filter']){_0x1cff4f[_0x47db('0x43')]=_['merge'](_0x1cff4f[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x1cff4f[_0x47db('0x3b')],function(_0x509023){var _0x2d5435={};_0x2d5435[_0x509023]={'$like':'%'+_0x4a80bf[_0x47db('0x38')]['filter']+'%'};return _0x2d5435;})});}_0x1cff4f=_[_0x47db('0x45')]({},_0x1cff4f,_0x4a80bf[_0x47db('0x47')]);return db[_0x47db('0xab')][_0x47db('0x22')]({'where':_0x1cff4f[_0x47db('0x43')]})[_0x47db('0x15')](function(_0x186e60){_0x44441b[_0x47db('0x22')]=_0x186e60;if(_0x4a80bf[_0x47db('0x38')][_0x47db('0x48')]){_0x1cff4f[_0x47db('0x49')]=[{'model':db[_0x47db('0x84')],'as':_0x47db('0xe9'),'required':![]},{'model':db[_0x47db('0xea')],'as':_0x47db('0xeb'),'attributes':[_0x47db('0x2c'),'fullname',_0x47db('0xec')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x47db('0x2c'),_0x47db('0xed')],'where':_0x4a80bf['query'][_0x47db('0xee')]?{'id':_0x4a80bf[_0x47db('0x38')][_0x47db('0xee')]}:undefined,'required':_0x4a80bf[_0x47db('0x38')][_0x47db('0xee')]?!![]:![]}];}return db[_0x47db('0xab')][_0x47db('0x4a')](_0x1cff4f);})['then'](function(_0x1744fa){_0x44441b['rows']=_0x1744fa;return _0x44441b;});}})[_0x47db('0x15')](respondWithFilteredResult(_0x417696,_0x1cff4f))[_0x47db('0x1d')](handleError(_0x417696,null));};function iftimePromise(_0x6bead0,_0x21cb19){return respondWithRpcPromise(_0x47db('0xef'),'getSnippet',{'command':_0x21cb19['timezone']?util['format']('iftime\x20%s,%s',_0x6bead0[_0x47db('0xf0')],_0x21cb19[_0x47db('0xf1')]):util[_0x47db('0xa4')](_0x47db('0xf2'),_0x6bead0[_0x47db('0xf0')])},client9002)['then'](function(_0x1d510e){var _0x643a75=_0x1d510e&&_0x1d510e[_0x47db('0xf3')](_0x47db('0xf4'))>=0x0?!![]:![];logger[_0x47db('0xf5')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x21cb19['id'],_0x6bead0['id'],_0x6bead0[_0x47db('0xf0')],_0x643a75?_0x47db('0xf6'):_0x47db('0xf7'),_0x21cb19[_0x47db('0xf1')]?_0x21cb19[_0x47db('0xf1')]:'No\x20timezone');return _0x643a75;})[_0x47db('0x1d')](function(_0x45e7ff){logger[_0x47db('0x18')](_0x47db('0xf8'),_0x21cb19['id'],_0x6bead0['id'],_0x6bead0[_0x47db('0xf0')],util[_0x47db('0xf9')](_0x45e7ff,{'showHidden':![],'depth':null}),_0x21cb19[_0x47db('0xf1')]?_0x21cb19[_0x47db('0xf1')]:_0x47db('0xfa'));return![];});}exports[_0x47db('0xfb')]=function(_0x5c5057,_0x632ecd){var _0x165f69=0x0;var _0x61b611=0x0;var _0x353903=![];var _0x46757c;var _0x1e7a35;return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x5c5057[_0x47db('0x58')]['id']},'include':[{'model':db[_0x47db('0xfc')],'as':_0x47db('0xfc'),'include':[{'model':db[_0x47db('0xfc')],'as':_0x47db('0xfd'),'attributes':['id',_0x47db('0xf0')],'raw':!![]}]}]})[_0x47db('0x15')](handleEntityNotFound(_0x632ecd,null))[_0x47db('0x15')](function(_0x241c4e){if(_0x241c4e){_0x46757c=_0x241c4e;return _0x241c4e[_0x47db('0xfe')]({'raw':!![]});}})['then'](function(_0xdc1d44){if(_0x46757c){if(_0xdc1d44){_0x1e7a35=_0xdc1d44;}}return require('../../config/license/util')[_0x47db('0x72')]();})['then'](function(_0x125562){if(_0x125562){_0x61b611=_0x125562[_0x47db('0xff')];_0x353903=_0x125562[_0x47db('0x73')];}})['then'](function(){return db[_0x47db('0xab')][_0x47db('0x22')]({'where':{'closed':![]}});})[_0x47db('0x15')](function(_0x456d0a){_0x165f69=_0x456d0a;if(_0x61b611&&_0x456d0a>_0x61b611){return db['License'][_0x47db('0x5e')]({'where':{'id':0x1}})[_0x47db('0x15')](function(_0x411b28){if(_0x411b28){_0x411b28['increment'](_0x47db('0x100'));}});}})['then'](function(){if(_0x46757c[_0x47db('0xfc')]&&_0x46757c['Interval']['Intervals']){var _0x109af1=[];for(var _0x2d4bad=0x0;_0x2d4bad<_0x46757c[_0x47db('0xfc')][_0x47db('0xfd')]['length'];_0x2d4bad++){var _0x1b5b85=_0x46757c['Interval'][_0x47db('0xfd')][_0x2d4bad]['get']({'plain':!![]});_0x109af1['push'](iftimePromise(_0x1b5b85,_0x46757c));}return BPromise[_0x47db('0x101')](_0x109af1)[_0x47db('0x15')](function(_0x5d41a8){return _['some'](_0x5d41a8);});}else{return!![];}})[_0x47db('0x15')](function(_0x21ac89){var _0x332303=fs[_0x47db('0xc4')](path[_0x47db('0x6f')](config[_0x47db('0x70')],_0x47db('0x102')),'utf8');var _0x477b89={'remote':_0x46757c[_0x47db('0x103')],'query':querystring[_0x47db('0x17')](_[_0x47db('0x45')](_0x46757c[_0x47db('0x4e')]({'plain':!![]}),{'customerIp':_0x5c5057[_0x47db('0x9d')]['x-forwarded-for']||_0x5c5057[_0x47db('0x9d')][_0x47db('0x104')]||_0x5c5057[_0x47db('0x105')][_0x47db('0x106')]||_0x5c5057['ip'],'referer':_0x5c5057['headers'][_0x47db('0x107')],'openedInteractions':_0x165f69,'maxInteractions':_0x61b611,'virtual':_0x353903[_0x47db('0xff')],'online':_0x21ac89,'custom':_0x353903}))[_0x47db('0x108')](/'/g,'\x5c\x27')};_0x632ecd[_0x47db('0x2d')](ejs[_0x47db('0xc6')](Mustache[_0x47db('0xc6')](_0x332303,_0x477b89),{'proactiveActions':_0x1e7a35,'alignment':_0x46757c[_0x47db('0x109')],'verticalAlignment':_0x46757c[_0x47db('0x10a')],'div_color':_0x46757c[_0x47db('0xed')],'labelText':_0x46757c[_0x47db('0x10b')],'text_color':_0x46757c[_0x47db('0x10c')],'button_color':_0x46757c[_0x47db('0x10d')],'background_color':_0x46757c['backgroundColor']}));})['catch'](handleError(_0x632ecd,null));};exports[_0x47db('0x10e')]=function(_0x24d403,_0x46d70d){var _0x41250c=_0x24d403[_0x47db('0x58')]['id'];var _0x143c09=_0x24d403[_0x47db('0x57')];var _0x4e3c3c=0xc8;var _0x27f9db=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x47db('0xd0')][_0x47db('0x10f')]['ISOLATION_LEVELS'][_0x47db('0x110')]},function(_0x6f7096){return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x41250c},'transaction':_0x6f7096})[_0x47db('0x15')](function(_0x2ccc4c){if(_0x2ccc4c){return db[_0x47db('0x111')]['destroy']({'where':{'ChatWebsiteId':_0x41250c},'transaction':_0x6f7096})[_0x47db('0x15')](function(){var _0x4e2134=_[_0x47db('0x37')](_0x143c09,function(_0x42bfe4){_0x42bfe4[_0x47db('0x5b')]=_0x41250c;return _0x42bfe4;});return db[_0x47db('0x111')]['bulkCreate'](_0x4e2134,{'transaction':_0x6f7096});});}else{_0x4e3c3c=0x194;_0x27f9db=[];}});})[_0x47db('0x15')](function(){if(_0x4e3c3c!==0x194){return db[_0x47db('0x111')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x41250c},'order':_0x47db('0x9a')})[_0x47db('0x15')](function(_0x4f0e32){_0x27f9db=_0x4f0e32;});}})[_0x47db('0x1d')](function(_0xeafb72){_0x4e3c3c=0x1f4;logger[_0x47db('0x18')](_0xeafb72[_0x47db('0x2b')]);if(_0xeafb72[_0x47db('0x2c')]){delete _0xeafb72[_0x47db('0x2c')];}_0x27f9db=_0xeafb72;})['finally'](function(){if(_0x27f9db===null){_0x46d70d['sendStatus'](_0x4e3c3c);}else{if(_0x4e3c3c===0x1f4){_0x46d70d[_0x47db('0x1e')](_0x4e3c3c)[_0x47db('0x2d')](_0x27f9db);}else{_0x46d70d['status'](_0x4e3c3c)['json'](_0x27f9db);}}});};exports['getApplications']=function(_0x331350,_0x1883dd){var _0x3c88d2={};var _0x1394c0={};var _0x228de2;var _0x4b4e9a;return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x331350[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x1883dd,null))['then'](function(_0x4b37f1){if(_0x4b37f1){_0x228de2=_0x4b37f1;_0x1394c0[_0x47db('0x36')]=_[_0x47db('0x39')](db[_0x47db('0x111')][_0x47db('0x32')]);_0x1394c0[_0x47db('0x38')]=_[_0x47db('0x39')](_0x331350[_0x47db('0x38')]);_0x1394c0[_0x47db('0x3a')]=_[_0x47db('0x3c')](_0x1394c0[_0x47db('0x36')],_0x1394c0[_0x47db('0x38')]);_0x3c88d2[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x1394c0[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x331350['query'][_0x47db('0x3d')]));_0x3c88d2['attributes']=_0x3c88d2[_0x47db('0x3b')][_0x47db('0x3e')]?_0x3c88d2['attributes']:_0x1394c0[_0x47db('0x36')];_0x3c88d2['order']=qs[_0x47db('0x42')](_0x331350[_0x47db('0x38')][_0x47db('0x42')]);_0x3c88d2[_0x47db('0x43')]=qs['filters'](_[_0x47db('0x64')](_0x331350['query'],_0x1394c0[_0x47db('0x3a')]));if(_0x331350['query'][_0x47db('0x44')]){_0x3c88d2['where']=_['merge'](_0x3c88d2[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x3c88d2[_0x47db('0x3b')],function(_0x148c6e){var _0x46118a={};_0x46118a[_0x148c6e]={'$like':'%'+_0x331350['query'][_0x47db('0x44')]+'%'};return _0x46118a;})});}_0x3c88d2=_['merge']({},_0x3c88d2,_0x331350[_0x47db('0x47')]);return _0x228de2[_0x47db('0x112')](_0x3c88d2);}})[_0x47db('0x15')](function(_0x3cb6e6){if(_0x3cb6e6){_0x4b4e9a=_0x3cb6e6[_0x47db('0x3e')];if(!_0x331350['query']['hasOwnProperty'](_0x47db('0x40'))){_0x3c88d2[_0x47db('0x21')]=qs[_0x47db('0x21')](_0x331350['query'][_0x47db('0x21')]);_0x3c88d2[_0x47db('0x1f')]=qs[_0x47db('0x1f')](_0x331350[_0x47db('0x38')][_0x47db('0x1f')]);}return _0x228de2[_0x47db('0x112')](_0x3c88d2);}})[_0x47db('0x15')](function(_0x1518a7){if(_0x1518a7){return _0x1518a7?{'count':_0x4b4e9a,'rows':_0x1518a7}:null;}})[_0x47db('0x15')](respondWithResult(_0x1883dd,null))[_0x47db('0x1d')](handleError(_0x1883dd,null));};exports[_0x47db('0x113')]=function(_0x3b8e05,_0x32bd8b){return db[_0x47db('0x114')][_0x47db('0x4c')]({'where':{'id':_0x3b8e05[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x32bd8b,null))[_0x47db('0x15')](function(_0x844232){if(_0x844232){return _0x844232[_0x47db('0x113')](_0x3b8e05[_0x47db('0x57')][_0x47db('0x60')],_[_0x47db('0xe7')](_0x3b8e05[_0x47db('0x57')],[_0x47db('0x60'),'id'])||{});}})['then'](respondWithResult(_0x32bd8b,null))[_0x47db('0x1d')](handleError(_0x32bd8b,null));};exports['getProactiveActions']=function(_0x676769,_0x27817c){var _0x24ceb9={};var _0x3e92f4={};var _0x3fb690;var _0x56db34;return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x676769[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x27817c,null))['then'](function(_0x901a67){if(_0x901a67){_0x3fb690=_0x901a67;_0x3e92f4[_0x47db('0x36')]=_[_0x47db('0x39')](db['ChatProactiveAction'][_0x47db('0x32')]);_0x3e92f4[_0x47db('0x38')]=_[_0x47db('0x39')](_0x676769[_0x47db('0x38')]);_0x3e92f4[_0x47db('0x3a')]=_['intersection'](_0x3e92f4[_0x47db('0x36')],_0x3e92f4[_0x47db('0x38')]);_0x24ceb9[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x3e92f4[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x676769['query'][_0x47db('0x3d')]));_0x24ceb9['attributes']=_0x24ceb9[_0x47db('0x3b')][_0x47db('0x3e')]?_0x24ceb9[_0x47db('0x3b')]:_0x3e92f4[_0x47db('0x36')];_0x24ceb9['order']=qs[_0x47db('0x42')](_0x676769['query']['sort']);_0x24ceb9['where']=qs[_0x47db('0x3a')](_['pick'](_0x676769[_0x47db('0x38')],_0x3e92f4[_0x47db('0x3a')]));if(_0x676769[_0x47db('0x38')][_0x47db('0x44')]){_0x24ceb9[_0x47db('0x43')]=_['merge'](_0x24ceb9[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x24ceb9[_0x47db('0x3b')],function(_0x3add84){var _0x222f9a={};_0x222f9a[_0x3add84]={'$like':'%'+_0x676769['query'][_0x47db('0x44')]+'%'};return _0x222f9a;})});}_0x24ceb9=_[_0x47db('0x45')]({},_0x24ceb9,_0x676769[_0x47db('0x47')]);return _0x3fb690[_0x47db('0xfe')](_0x24ceb9);}})[_0x47db('0x15')](function(_0x5a173c){if(_0x5a173c){_0x56db34=_0x5a173c['length'];if(!_0x676769[_0x47db('0x38')][_0x47db('0x3f')](_0x47db('0x40'))){_0x24ceb9['limit']=qs[_0x47db('0x21')](_0x676769[_0x47db('0x38')][_0x47db('0x21')]);_0x24ceb9[_0x47db('0x1f')]=qs[_0x47db('0x1f')](_0x676769[_0x47db('0x38')][_0x47db('0x1f')]);}return _0x3fb690[_0x47db('0xfe')](_0x24ceb9);}})['then'](function(_0x5be6ac){if(_0x5be6ac){return _0x5be6ac?{'count':_0x56db34,'rows':_0x5be6ac}:null;}})[_0x47db('0x15')](respondWithResult(_0x27817c,null))[_0x47db('0x1d')](handleError(_0x27817c,null));};exports[_0x47db('0x115')]=function(_0x31fb39,_0x2777b6){var _0x3d5961=_0x31fb39[_0x47db('0x38')][_0x47db('0x116')]==='false'?_0x47db('0x117'):_0x47db('0x118');return db[_0x47db('0x31')][_0x47db('0x4c')]({'attributes':['id',_0x3d5961],'where':{'id':_0x31fb39['params']['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x2777b6,null))[_0x47db('0x15')](function(_0x54199b){if(_0x54199b){var _0x567b03=_0x54199b[_0x3d5961];var _0x4a50d7=_0x567b03&&_0x567b03[_0x47db('0x119')]?_0x567b03[_0x47db('0x119')]:[];_0x2777b6[_0x47db('0x2d')]({'fromKey':_[_0x47db('0x74')](_0x567b03[_0x47db('0x11a')])?undefined:_0x567b03[_0x47db('0x11a')],'count':_0x4a50d7[_0x47db('0x3e')],'rows':_0x4a50d7});}})[_0x47db('0x1d')](handleError(_0x2777b6,null));};exports[_0x47db('0x11b')]=function(_0x3655b4,_0x48cf7d){var _0x3ba757={'raw':![],'where':{}};var _0x3d2d7d={};var _0x1ba3b2={'count':0x0,'rows':[]};return db[_0x47db('0x31')][_0x47db('0x5e')]({'where':{'id':_0x3655b4[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x48cf7d,null))[_0x47db('0x15')](function(_0x31eed1){if(_0x31eed1){_0x3d2d7d['model']=_[_0x47db('0x39')](db['ChatOfflineMessage'][_0x47db('0x32')]);_0x3d2d7d[_0x47db('0x38')]=_[_0x47db('0x39')](_0x3655b4[_0x47db('0x38')]);_0x3d2d7d['filters']=_[_0x47db('0x3c')](_0x3d2d7d[_0x47db('0x36')],_0x3d2d7d[_0x47db('0x38')]);_0x3ba757[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x3d2d7d[_0x47db('0x36')],qs[_0x47db('0x3d')](_0x3655b4[_0x47db('0x38')][_0x47db('0x3d')]));_0x3ba757[_0x47db('0x3b')]=_0x3ba757['attributes'][_0x47db('0x3e')]?_0x3ba757[_0x47db('0x3b')]:_0x3d2d7d['model'];if(!_0x3655b4[_0x47db('0x38')][_0x47db('0x3f')](_0x47db('0x40'))){_0x3ba757['limit']=qs[_0x47db('0x21')](_0x3655b4[_0x47db('0x38')]['limit']);_0x3ba757['offset']=qs['offset'](_0x3655b4['query']['offset']);}_0x3ba757['order']=qs['sort'](_0x3655b4[_0x47db('0x38')]['sort']);_0x3ba757[_0x47db('0x43')]=qs[_0x47db('0x3a')](_['pick'](_0x3655b4[_0x47db('0x38')],_0x3d2d7d['filters']));_0x3ba757[_0x47db('0x43')][_0x47db('0x5b')]=_0x31eed1['id'];if(_0x3655b4['query']['filter']){_0x3ba757[_0x47db('0x43')]=_[_0x47db('0x45')](_0x3ba757['where'],{'$or':_[_0x47db('0x37')](_0x3ba757[_0x47db('0x3b')],function(_0x20e3e8){var _0x21a5f9={};_0x21a5f9[_0x20e3e8]={'$like':'%'+_0x3655b4[_0x47db('0x38')][_0x47db('0x44')]+'%'};return _0x21a5f9;})});}_0x3ba757=_['merge']({},_0x3ba757,_0x3655b4[_0x47db('0x47')]);return db['ChatOfflineMessage'][_0x47db('0x22')]({'where':_0x3ba757[_0x47db('0x43')]})[_0x47db('0x15')](function(_0x5d7aa1){_0x1ba3b2[_0x47db('0x22')]=_0x5d7aa1;if(_0x3655b4[_0x47db('0x38')][_0x47db('0x48')]){_0x3ba757[_0x47db('0x49')]=[{'all':!![]}];}else{_0x3ba757[_0x47db('0x49')]=[{'model':db[_0x47db('0x84')],'as':_0x47db('0xe9'),'required':![]},{'model':db['Attachment'],'as':_0x47db('0x11c'),'required':![]}];}return db[_0x47db('0xc9')][_0x47db('0x4a')](_0x3ba757);})[_0x47db('0x15')](function(_0x17ad52){_0x1ba3b2[_0x47db('0x4b')]=_0x17ad52;return _0x1ba3b2;});}})[_0x47db('0x15')](respondWithFilteredResult(_0x48cf7d,_0x3ba757))['catch'](handleError(_0x48cf7d,null));};exports[_0x47db('0x11d')]=function(_0x584a16,_0x1b7367){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x584a16[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x1b7367,null))[_0x47db('0x15')](function(_0x4824e9){if(_0x4824e9){return _0x4824e9[_0x47db('0x11d')](_0x584a16[_0x47db('0x57')]['ids'],_[_0x47db('0xe7')](_0x584a16[_0x47db('0x57')],[_0x47db('0x60'),'id'])||{})['spread'](function(_0xebc896){for(var _0x319c47=0x0;_0x319c47<_0x584a16[_0x47db('0x57')]['ids']['length'];_0x319c47+=0x1){socket['emit'](_0x47db('0x11e'),{'UserId':Number(_0x584a16[_0x47db('0x57')][_0x47db('0x60')][_0x319c47]),'ChatWebsiteId':Number(_0x584a16[_0x47db('0x58')]['id'])});}return _0xebc896;});}})['then'](respondWithResult(_0x1b7367,null))['catch'](handleError(_0x1b7367,null));};exports[_0x47db('0x11f')]=function(_0x19c764,_0x47e510){return db[_0x47db('0x31')][_0x47db('0x4c')]({'where':{'id':_0x19c764[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x47e510,null))[_0x47db('0x15')](function(_0x84849f){if(_0x84849f){return _0x84849f[_0x47db('0x11f')](_0x19c764[_0x47db('0x38')][_0x47db('0x60')])['then'](function(){if(_[_0x47db('0x120')](_0x19c764[_0x47db('0x38')][_0x47db('0x60')])){for(var _0x1301b8=0x0;_0x1301b8<_0x19c764[_0x47db('0x38')][_0x47db('0x60')][_0x47db('0x3e')];_0x1301b8+=0x1){socket[_0x47db('0x121')](_0x47db('0x122'),{'UserId':Number(_0x19c764['query']['ids'][_0x1301b8]),'ChatWebsiteId':Number(_0x19c764[_0x47db('0x58')]['id'])});}}else{socket['emit'](_0x47db('0x122'),{'UserId':Number(_0x19c764[_0x47db('0x38')][_0x47db('0x60')]),'ChatWebsiteId':Number(_0x19c764['params']['id'])});}});}})['then'](respondWithStatusCode(_0x47e510,null))[_0x47db('0x1d')](handleError(_0x47e510,null));};exports[_0x47db('0x123')]=function(_0xfdc78e,_0x3c9d69){var _0x3ad4a9={};var _0x4e8715={};var _0x1f8320;var _0x52eb5d;return db['ChatWebsite']['findOne']({'where':{'id':_0xfdc78e[_0x47db('0x58')]['id']}})[_0x47db('0x15')](handleEntityNotFound(_0x3c9d69,null))[_0x47db('0x15')](function(_0x1dd1e1){if(_0x1dd1e1){_0x1f8320=_0x1dd1e1;_0x4e8715['model']=_[_0x47db('0x39')](db[_0x47db('0xea')][_0x47db('0x32')]);_0x4e8715['query']=_['keys'](_0xfdc78e[_0x47db('0x38')]);_0x4e8715[_0x47db('0x3a')]=_[_0x47db('0x3c')](_0x4e8715[_0x47db('0x36')],_0x4e8715[_0x47db('0x38')]);_0x3ad4a9[_0x47db('0x3b')]=_[_0x47db('0x3c')](_0x4e8715[_0x47db('0x36')],qs[_0x47db('0x3d')](_0xfdc78e[_0x47db('0x38')][_0x47db('0x3d')]));_0x3ad4a9[_0x47db('0x3b')]=_0x3ad4a9['attributes'][_0x47db('0x3e')]?_0x3ad4a9[_0x47db('0x3b')]:_0x4e8715[_0x47db('0x36')];_0x3ad4a9[_0x47db('0x41')]=qs[_0x47db('0x42')](_0xfdc78e['query']['sort']);_0x3ad4a9['where']=qs['filters'](_[_0x47db('0x64')](_0xfdc78e[_0x47db('0x38')],_0x4e8715[_0x47db('0x3a')]));if(_0xfdc78e[_0x47db('0x38')]['filter']){_0x3ad4a9[_0x47db('0x43')]=_[_0x47db('0x45')](_0x3ad4a9[_0x47db('0x43')],{'$or':_[_0x47db('0x37')](_0x3ad4a9[_0x47db('0x3b')],function(_0x3d9993){var _0x480285={};_0x480285[_0x3d9993]={'$like':'%'+_0xfdc78e[_0x47db('0x38')][_0x47db('0x44')]+'%'};return _0x480285;})});}_0x3ad4a9=_['merge']({},_0x3ad4a9,_0xfdc78e[_0x47db('0x47')]);return _0x1f8320[_0x47db('0x123')](_0x3ad4a9);}})[_0x47db('0x15')](function(_0x59d1f9){if(_0x59d1f9){_0x52eb5d=_0x59d1f9['length'];if(!_0xfdc78e[_0x47db('0x38')][_0x47db('0x3f')]('nolimit')){_0x3ad4a9['limit']=qs[_0x47db('0x21')](_0xfdc78e[_0x47db('0x38')]['limit']);_0x3ad4a9['offset']=qs['offset'](_0xfdc78e[_0x47db('0x38')]['offset']);}return _0x1f8320[_0x47db('0x123')](_0x3ad4a9);}})[_0x47db('0x15')](function(_0x43e0c8){if(_0x43e0c8){return _0x43e0c8?{'count':_0x52eb5d,'rows':_0x43e0c8}:null;}})[_0x47db('0x15')](respondWithResult(_0x3c9d69,null))[_0x47db('0x1d')](handleError(_0x3c9d69,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e5b284e..7211111 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 _0x0911=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x4dcbcf,_0x2f0e36){var _0x28b21b=function(_0x2cadd3){while(--_0x2cadd3){_0x4dcbcf['push'](_0x4dcbcf['shift']());}};_0x28b21b(++_0x2f0e36);}(_0x0911,0x1a9));var _0x1091=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0x0911[_0x29ce14];return _0x48f289;};'use strict';var EventEmitter=require(_0x1091('0x0'));var ChatWebsite=require(_0x1091('0x1'))['db'][_0x1091('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1091('0x3')](0x0);var events={'afterCreate':_0x1091('0x4'),'afterUpdate':'update','afterDestroy':_0x1091('0x5')};function emitEvent(_0x580aa2){return function(_0x3a71a4,_0x58640b,_0x26a1a5){ChatWebsiteEvents[_0x1091('0x6')](_0x580aa2+':'+_0x3a71a4['id'],_0x3a71a4);ChatWebsiteEvents[_0x1091('0x6')](_0x580aa2,_0x3a71a4);_0x26a1a5(null);};}for(var e in events){if(events[_0x1091('0x7')](e)){var event=events[e];ChatWebsite[_0x1091('0x8')](e,emitEvent(event));}}module[_0x1091('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8ece=['events','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x8ece,0x195));var _0xe8ec=function(_0x4887ef,_0xf947c1){_0x4887ef=_0x4887ef-0x0;var _0x44dd61=_0x8ece[_0x4887ef];return _0x44dd61;};'use strict';var EventEmitter=require(_0xe8ec('0x0'));var ChatWebsite=require(_0xe8ec('0x1'))['db'][_0xe8ec('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe8ec('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe8ec('0x4')};function emitEvent(_0x30c05a){return function(_0x5047e7,_0x433734,_0x79f756){ChatWebsiteEvents['emit'](_0x30c05a+':'+_0x5047e7['id'],_0x5047e7);ChatWebsiteEvents[_0xe8ec('0x5')](_0x30c05a,_0x5047e7);_0x79f756(null);};}for(var e in events){if(events[_0xe8ec('0x6')](e)){var event=events[e];ChatWebsite[_0xe8ec('0x7')](e,emitEvent(event));}}module[_0xe8ec('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 a97e44e..0ff0220 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 _0xd040=['path','rimraf','../../config/environment','define','ChatWebsite','chat_websites','../../config/logger','api','bluebird','request-promise'];(function(_0x403ed0,_0x49ea6b){var _0x58137b=function(_0x42a887){while(--_0x42a887){_0x403ed0['push'](_0x403ed0['shift']());}};_0x58137b(++_0x49ea6b);}(_0xd040,0x16e));var _0x0d04=function(_0x133c61,_0x362aa2){_0x133c61=_0x133c61-0x0;var _0x4ed1aa=_0xd040[_0x133c61];return _0x4ed1aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d04('0x0'))(_0x0d04('0x1'));var moment=require('moment');var BPromise=require(_0x0d04('0x2'));var rp=require(_0x0d04('0x3'));var fs=require('fs');var path=require(_0x0d04('0x4'));var rimraf=require(_0x0d04('0x5'));var config=require(_0x0d04('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x307631,_0x3bf8f1){return _0x307631[_0x0d04('0x7')](_0x0d04('0x8'),attributes,{'tableName':_0x0d04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ff2=['chat_websites','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x3ebfee,_0x27a325){var _0x1cb7c8=function(_0xde211b){while(--_0xde211b){_0x3ebfee['push'](_0x3ebfee['shift']());}};_0x1cb7c8(++_0x27a325);}(_0x1ff2,0x83));var _0x21ff=function(_0x9227f4,_0x11cb39){_0x9227f4=_0x9227f4-0x0;var _0x20455e=_0x1ff2[_0x9227f4];return _0x20455e;};'use strict';var _=require(_0x21ff('0x0'));var util=require('util');var logger=require(_0x21ff('0x1'))('api');var moment=require('moment');var BPromise=require(_0x21ff('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21ff('0x3'));var rimraf=require(_0x21ff('0x4'));var config=require(_0x21ff('0x5'));var attributes=require(_0x21ff('0x6'));module[_0x21ff('0x7')]=function(_0x241989,_0x4324a4){return _0x241989['define'](_0x21ff('0x8'),attributes,{'tableName':_0x21ff('0x9'),'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 2517eee..0f2ed13 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 _0xb20a=['redis','defaults','localhost','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x341a08,_0x52c3f1){var _0x4b7c31=function(_0x38e383){while(--_0x38e383){_0x341a08['push'](_0x341a08['shift']());}};_0x4b7c31(++_0x52c3f1);}(_0xb20a,0x76));var _0xab20=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb20a[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0xab20('0x0'));var util=require(_0xab20('0x1'));var moment=require(_0xab20('0x2'));var BPromise=require(_0xab20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xab20('0x5'));var logger=require(_0xab20('0x6'))(_0xab20('0x7'));var config=require(_0xab20('0x8'));var jayson=require(_0xab20('0x9'));var client=jayson[_0xab20('0xa')][_0xab20('0xb')]({'port':0x232a});config[_0xab20('0xc')]=_[_0xab20('0xd')](config['redis'],{'host':_0xab20('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab20('0xc')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2a41e2,_0x42302e,_0x3dace2){return new BPromise(function(_0x413e0c,_0x5ed8e6){return client[_0xab20('0xf')](_0x2a41e2,_0x3dace2)[_0xab20('0x10')](function(_0x572ed3){logger['info'](_0xab20('0x11'),_0x42302e,_0xab20('0x12'));logger['debug'](_0xab20('0x13'),_0x42302e,_0xab20('0x12'),JSON[_0xab20('0x14')](_0x572ed3));if(_0x572ed3[_0xab20('0x15')]){if(_0x572ed3[_0xab20('0x15')][_0xab20('0x16')]===0x1f4){logger[_0xab20('0x15')](_0xab20('0x11'),_0x42302e,_0x572ed3[_0xab20('0x15')][_0xab20('0x17')]);return _0x5ed8e6(_0x572ed3[_0xab20('0x15')][_0xab20('0x17')]);}logger[_0xab20('0x15')](_0xab20('0x11'),_0x42302e,_0x572ed3[_0xab20('0x15')][_0xab20('0x17')]);return _0x413e0c(_0x572ed3[_0xab20('0x15')]['message']);}else{logger[_0xab20('0x18')](_0xab20('0x11'),_0x42302e,_0xab20('0x12'));_0x413e0c(_0x572ed3['result'][_0xab20('0x17')]);}})[_0xab20('0x19')](function(_0x23563b){logger['error'](_0xab20('0x11'),_0x42302e,_0x23563b);_0x5ed8e6(_0x23563b);});});}
\ No newline at end of file
+var _0x278c=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0x278c,0x1d6));var _0xc278=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x278c[_0x16337a];return _0x422365;};'use strict';var _=require(_0xc278('0x0'));var util=require(_0xc278('0x1'));var moment=require('moment');var BPromise=require(_0xc278('0x2'));var rs=require(_0xc278('0x3'));var fs=require('fs');var Redis=require(_0xc278('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc278('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc278('0x6'));var jayson=require(_0xc278('0x7'));var client=jayson[_0xc278('0x8')][_0xc278('0x9')]({'port':0x232a});config[_0xc278('0xa')]=_[_0xc278('0xb')](config[_0xc278('0xa')],{'host':_0xc278('0xc'),'port':0x18eb});var socket=require(_0xc278('0xd'))(new Redis(config[_0xc278('0xa')]));require('./chatWebsite.socket')[_0xc278('0xe')](socket);function respondWithRpcPromise(_0x2e0e78,_0x104a27,_0x25bb01){return new BPromise(function(_0x277b15,_0x604e83){return client[_0xc278('0xf')](_0x2e0e78,_0x25bb01)[_0xc278('0x10')](function(_0x945d68){logger['info'](_0xc278('0x11'),_0x104a27,_0xc278('0x12'));logger['debug'](_0xc278('0x13'),_0x104a27,_0xc278('0x12'),JSON[_0xc278('0x14')](_0x945d68));if(_0x945d68[_0xc278('0x15')]){if(_0x945d68[_0xc278('0x15')]['code']===0x1f4){logger[_0xc278('0x15')](_0xc278('0x11'),_0x104a27,_0x945d68[_0xc278('0x15')][_0xc278('0x16')]);return _0x604e83(_0x945d68[_0xc278('0x15')][_0xc278('0x16')]);}logger[_0xc278('0x15')](_0xc278('0x11'),_0x104a27,_0x945d68[_0xc278('0x15')][_0xc278('0x16')]);return _0x277b15(_0x945d68[_0xc278('0x15')]['message']);}else{logger[_0xc278('0x17')](_0xc278('0x11'),_0x104a27,_0xc278('0x12'));_0x277b15(_0x945d68[_0xc278('0x18')][_0xc278('0x16')]);}})[_0xc278('0x19')](function(_0x2281ce){logger[_0xc278('0x15')](_0xc278('0x11'),_0x104a27,_0x2281ce);_0x604e83(_0x2281ce);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 0d6d1b4..36bc73f 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 _0x1924=['./chatWebsite.events','save','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x35fbe5,_0x50967c){var _0x23675a=function(_0x373120){while(--_0x373120){_0x35fbe5['push'](_0x35fbe5['shift']());}};_0x23675a(++_0x50967c);}(_0x1924,0x180));var _0x4192=function(_0x5101fc,_0x745e72){_0x5101fc=_0x5101fc-0x0;var _0x2d5b10=_0x1924[_0x5101fc];return _0x2d5b10;};'use strict';var ChatWebsiteEvents=require(_0x4192('0x0'));var events=[_0x4192('0x1'),'remove',_0x4192('0x2')];function createListener(_0x286f4c,_0x25f090){return function(_0x2d6487){_0x25f090[_0x4192('0x3')](_0x286f4c,_0x2d6487);};}function removeListener(_0x4a5c06,_0x2062dd){return function(){ChatWebsiteEvents[_0x4192('0x4')](_0x4a5c06,_0x2062dd);};}exports[_0x4192('0x5')]=function(_0x546ad5){for(var _0x225abd=0x0,_0xa191f=events[_0x4192('0x6')];_0x225abd<_0xa191f;_0x225abd++){var _0x28ef47=events[_0x225abd];var _0x2876ed=createListener(_0x4192('0x7')+_0x28ef47,_0x546ad5);ChatWebsiteEvents['on'](_0x28ef47,_0x2876ed);}};
\ No newline at end of file
+var _0xc4a1=['chatWebsite:','./chatWebsite.events','remove','update','removeListener','register','length'];(function(_0x2c2a55,_0x3d6ee1){var _0xbaeaff=function(_0x30a33e){while(--_0x30a33e){_0x2c2a55['push'](_0x2c2a55['shift']());}};_0xbaeaff(++_0x3d6ee1);}(_0xc4a1,0x94));var _0x1c4a=function(_0x2d25f5,_0x42e9eb){_0x2d25f5=_0x2d25f5-0x0;var _0x55a70a=_0xc4a1[_0x2d25f5];return _0x55a70a;};'use strict';var ChatWebsiteEvents=require(_0x1c4a('0x0'));var events=['save',_0x1c4a('0x1'),_0x1c4a('0x2')];function createListener(_0xdc49a9,_0x5bfb34){return function(_0x19cf3c){_0x5bfb34['emit'](_0xdc49a9,_0x19cf3c);};}function removeListener(_0x5c74b7,_0x5228f0){return function(){ChatWebsiteEvents[_0x1c4a('0x3')](_0x5c74b7,_0x5228f0);};}exports[_0x1c4a('0x4')]=function(_0x490800){for(var _0x195acf=0x0,_0x121396=events[_0x1c4a('0x5')];_0x195acf<_0x121396;_0x195acf++){var _0x3f80cf=events[_0x195acf];var _0x31b5ea=createListener(_0x1c4a('0x6')+_0x3f80cf,_0x490800);ChatWebsiteEvents['on'](_0x3f80cf,_0x31b5ea);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 57e7a47..912a216 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 _0x8147=['/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','single','addAvatar','diskStorage','join','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','attachments','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','/:id/applications','addProactiveActions','addAgents','update','destroy','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0xc4f7c0,_0x3d731b){var _0x479501=function(_0x36a2cd){while(--_0x36a2cd){_0xc4f7c0['push'](_0xc4f7c0['shift']());}};_0x479501(++_0x3d731b);}(_0x8147,0x1a7));var _0x7814=function(_0x28644a,_0x3e1873){_0x28644a=_0x28644a-0x0;var _0x8b4c6a=_0x8147[_0x28644a];return _0x8b4c6a;};'use strict';var multer=require(_0x7814('0x0'));var util=require(_0x7814('0x1'));var path=require(_0x7814('0x2'));var timeout=require(_0x7814('0x3'));var express=require(_0x7814('0x4'));var router=express[_0x7814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7814('0x6'));var interaction=require(_0x7814('0x7'));var config=require('../../config/environment');var controller=require(_0x7814('0x8'));router[_0x7814('0x9')]('/',auth[_0x7814('0xa')](),controller['index']);router[_0x7814('0x9')](_0x7814('0xb'),auth[_0x7814('0xa')](),controller[_0x7814('0xc')]);router[_0x7814('0x9')](_0x7814('0xd'),auth[_0x7814('0xa')](),controller[_0x7814('0xe')]);router[_0x7814('0x9')](_0x7814('0xf'),auth[_0x7814('0xa')](),controller['getDispositions']);router[_0x7814('0x9')]('/:id/canned_answers',auth[_0x7814('0xa')](),controller[_0x7814('0x10')]);router['get'](_0x7814('0x11'),controller[_0x7814('0x12')]);router[_0x7814('0x9')](_0x7814('0x13'),controller[_0x7814('0x14')]);router[_0x7814('0x9')]('/:id/customer_avatar',controller[_0x7814('0x15')]);router[_0x7814('0x9')]('/:id/system_avatar',controller[_0x7814('0x16')]);router[_0x7814('0x9')]('/:id/interactions',auth[_0x7814('0xa')](),controller[_0x7814('0x17')]);router['get'](_0x7814('0x18'),controller[_0x7814('0x19')]);router['get']('/:id/applications',auth[_0x7814('0xa')](),controller[_0x7814('0x1a')]);router['get'](_0x7814('0x1b'),auth[_0x7814('0xa')](),controller['getProactiveActions']);router['get']('/:id/fields',controller[_0x7814('0x1c')]);router[_0x7814('0x9')]('/:id/offline_messages',auth[_0x7814('0xa')](),controller['getOfflineMessages']);router[_0x7814('0x9')](_0x7814('0x1d'),auth[_0x7814('0xa')](),controller[_0x7814('0x1e')]);router[_0x7814('0x1f')]('/',auth[_0x7814('0xa')](),controller[_0x7814('0x20')]);router[_0x7814('0x1f')](_0x7814('0xf'),auth['isAuthenticated'](),controller[_0x7814('0x21')]);router[_0x7814('0x1f')]('/:id/canned_answers',auth[_0x7814('0xa')](),controller[_0x7814('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2dbebb,_0x55df29,_0x3557b6){_0x3557b6(null,path['join'](config[_0x7814('0x23')],_0x7814('0x24')));},'filename':function(_0x5a89dd,_0x5227a6,_0x5523e4){_0x5523e4(null,util[_0x7814('0x25')](_0x7814('0x26'),Date[_0x7814('0x27')](),_0x5227a6[_0x7814('0x28')]));}})});router['post']('/:id/logo',upload['single'](_0x7814('0x29')),controller[_0x7814('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a7bc5,_0x5940de,_0x207ac0){_0x207ac0(null,path['join'](config[_0x7814('0x23')],'server/files/images/avatars/'));},'filename':function(_0x5ba27e,_0x492b48,_0x491e13){_0x491e13(null,util['format'](_0x7814('0x26'),Date[_0x7814('0x27')](),_0x492b48[_0x7814('0x28')]));}})});router['post'](_0x7814('0x13'),upload[_0x7814('0x2b')]('file'),controller[_0x7814('0x2c')]);var upload=multer({'storage':multer[_0x7814('0x2d')]({'destination':function(_0x114a7f,_0x1072d9,_0x2a26a5){_0x2a26a5(null,path[_0x7814('0x2e')](config[_0x7814('0x23')],_0x7814('0x2f')));},'filename':function(_0x345696,_0x69d21d,_0x26ac36){_0x26ac36(null,util[_0x7814('0x25')](_0x7814('0x26'),Date['now'](),_0x69d21d['originalname']));}})});router[_0x7814('0x1f')](_0x7814('0x30'),upload[_0x7814('0x2b')](_0x7814('0x29')),controller[_0x7814('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b9911,_0x2b2525,_0x29e776){_0x29e776(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3f85a3,_0x4142a5,_0x39f8bb){_0x39f8bb(null,util['format']('%s-%s',Date[_0x7814('0x27')](),_0x4142a5[_0x7814('0x28')]));}})});router[_0x7814('0x1f')](_0x7814('0x32'),upload[_0x7814('0x2b')](_0x7814('0x29')),controller[_0x7814('0x33')]);router['post']('/:id/notify',controller[_0x7814('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x7814('0x2d')]({'destination':function(_0x27097d,_0x5ebd8d,_0x38e0e7){const _0x2bdefb=path[_0x7814('0x2e')](config['root'],'server/files',_0x7814('0x35'),_0x7814('0x36'));fs_extra[_0x7814('0x37')](_0x2bdefb,function(){_0x38e0e7(null,_0x2bdefb);});},'filename':function(_0x2f91f3,_0x467ac4,_0x274427){const _0xc61c2b=_0x467ac4['originalname'][_0x7814('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x455dc9=path[_0x7814('0x39')](_0xc61c2b);const _0x12f05e=Date[_0x7814('0x27')]()+'-'+_0xc61c2b[_0x7814('0x38')](_0x455dc9,'')+_0x455dc9;_0x274427(null,_0x12f05e);}})});router[_0x7814('0x1f')]('/:id/offline',offlineUploadMulter[_0x7814('0x3a')](),controller[_0x7814('0x3b')]);router[_0x7814('0x1f')](_0x7814('0x3c'),auth[_0x7814('0xa')](),controller[_0x7814('0x3d')]);router['post'](_0x7814('0x3e'),auth[_0x7814('0xa')](),controller['addApplications']);router[_0x7814('0x1f')](_0x7814('0x1b'),auth[_0x7814('0xa')](),controller[_0x7814('0x3f')]);router[_0x7814('0x1f')](_0x7814('0x1d'),auth[_0x7814('0xa')](),controller[_0x7814('0x40')]);router['put'](_0x7814('0xd'),auth['isAuthenticated'](),controller[_0x7814('0x41')]);router['delete']('/:id',auth[_0x7814('0xa')](),controller[_0x7814('0x42')]);router[_0x7814('0x43')](_0x7814('0xf'),auth[_0x7814('0xa')](),controller[_0x7814('0x44')]);router[_0x7814('0x43')](_0x7814('0x45'),auth[_0x7814('0xa')](),controller[_0x7814('0x46')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x7814('0x47')]);module[_0x7814('0x48')]=router;
\ No newline at end of file
+var _0xc8b5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','now','originalname','file','addLogo','server/files/images/avatars/','%s-%s','single','addAvatar','root','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','extname','/:id/offline','any','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x3ba9f1,_0x134d3c){var _0x5b9055=function(_0x479b60){while(--_0x479b60){_0x3ba9f1['push'](_0x3ba9f1['shift']());}};_0x5b9055(++_0x134d3c);}(_0xc8b5,0xd5));var _0x5c8b=function(_0x175f7b,_0x19753b){_0x175f7b=_0x175f7b-0x0;var _0x36d75c=_0xc8b5[_0x175f7b];return _0x36d75c;};'use strict';var multer=require(_0x5c8b('0x0'));var util=require(_0x5c8b('0x1'));var path=require(_0x5c8b('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c8b('0x3'));var router=express[_0x5c8b('0x4')]();var fs_extra=require(_0x5c8b('0x5'));var auth=require(_0x5c8b('0x6'));var interaction=require(_0x5c8b('0x7'));var config=require(_0x5c8b('0x8'));var controller=require(_0x5c8b('0x9'));router[_0x5c8b('0xa')]('/',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0xc')]);router['get'](_0x5c8b('0xd'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0xe')]);router[_0x5c8b('0xa')](_0x5c8b('0xf'),auth[_0x5c8b('0xb')](),controller['show']);router['get'](_0x5c8b('0x10'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x11')]);router[_0x5c8b('0xa')](_0x5c8b('0x12'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x13')]);router[_0x5c8b('0xa')](_0x5c8b('0x14'),controller['getLogo']);router['get'](_0x5c8b('0x15'),controller[_0x5c8b('0x16')]);router[_0x5c8b('0xa')](_0x5c8b('0x17'),controller[_0x5c8b('0x18')]);router[_0x5c8b('0xa')](_0x5c8b('0x19'),controller[_0x5c8b('0x1a')]);router[_0x5c8b('0xa')](_0x5c8b('0x1b'),auth[_0x5c8b('0xb')](),controller['getInteractions']);router[_0x5c8b('0xa')](_0x5c8b('0x1c'),controller[_0x5c8b('0x1d')]);router[_0x5c8b('0xa')](_0x5c8b('0x1e'),auth[_0x5c8b('0xb')](),controller['getApplications']);router[_0x5c8b('0xa')]('/:id/proactive_actions',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x1f')]);router[_0x5c8b('0xa')](_0x5c8b('0x20'),controller[_0x5c8b('0x21')]);router[_0x5c8b('0xa')](_0x5c8b('0x22'),auth['isAuthenticated'](),controller['getOfflineMessages']);router['get'](_0x5c8b('0x23'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x24')]);router[_0x5c8b('0x25')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5c8b('0x25')]('/:id/dispositions',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x26')]);router[_0x5c8b('0x25')](_0x5c8b('0x12'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x27')]);var upload=multer({'storage':multer[_0x5c8b('0x28')]({'destination':function(_0x154d51,_0x7177f9,_0x58593f){_0x58593f(null,path[_0x5c8b('0x29')](config['root'],_0x5c8b('0x2a')));},'filename':function(_0x2607f0,_0x26f547,_0x15cf01){_0x15cf01(null,util[_0x5c8b('0x2b')]('%s-%s',Date[_0x5c8b('0x2c')](),_0x26f547[_0x5c8b('0x2d')]));}})});router[_0x5c8b('0x25')]('/:id/logo',upload['single'](_0x5c8b('0x2e')),controller[_0x5c8b('0x2f')]);var upload=multer({'storage':multer[_0x5c8b('0x28')]({'destination':function(_0x39f84b,_0x4a9a1f,_0x13e093){_0x13e093(null,path[_0x5c8b('0x29')](config['root'],_0x5c8b('0x30')));},'filename':function(_0x10e79d,_0xfe7d64,_0x592061){_0x592061(null,util[_0x5c8b('0x2b')](_0x5c8b('0x31'),Date[_0x5c8b('0x2c')](),_0xfe7d64['originalname']));}})});router[_0x5c8b('0x25')](_0x5c8b('0x15'),upload[_0x5c8b('0x32')](_0x5c8b('0x2e')),controller[_0x5c8b('0x33')]);var upload=multer({'storage':multer[_0x5c8b('0x28')]({'destination':function(_0x3a129e,_0x1c4b8,_0x22e4fa){_0x22e4fa(null,path['join'](config[_0x5c8b('0x34')],'server/files/images/avatars/'));},'filename':function(_0x46a20d,_0x945530,_0x4de0b6){_0x4de0b6(null,util[_0x5c8b('0x2b')](_0x5c8b('0x31'),Date[_0x5c8b('0x2c')](),_0x945530['originalname']));}})});router[_0x5c8b('0x25')](_0x5c8b('0x17'),upload[_0x5c8b('0x32')](_0x5c8b('0x2e')),controller[_0x5c8b('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1f9d97,_0x1cfe50,_0x440e42){_0x440e42(null,path[_0x5c8b('0x29')](config['root'],_0x5c8b('0x30')));},'filename':function(_0x21d5d5,_0xc1795e,_0x2d9a74){_0x2d9a74(null,util[_0x5c8b('0x2b')](_0x5c8b('0x31'),Date[_0x5c8b('0x2c')](),_0xc1795e[_0x5c8b('0x2d')]));}})});router[_0x5c8b('0x25')](_0x5c8b('0x19'),upload[_0x5c8b('0x32')](_0x5c8b('0x2e')),controller[_0x5c8b('0x36')]);router[_0x5c8b('0x25')]('/:id/notify',controller[_0x5c8b('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x5c8b('0x28')]({'destination':function(_0x58347a,_0x1fbfaf,_0x57d69e){const _0x472ee0=path[_0x5c8b('0x29')](config[_0x5c8b('0x34')],_0x5c8b('0x38'),'attachments',_0x5c8b('0x39'));fs_extra[_0x5c8b('0x3a')](_0x472ee0,function(){_0x57d69e(null,_0x472ee0);});},'filename':function(_0x316a1e,_0x4910ab,_0x287478){const _0x1e0473=_0x4910ab[_0x5c8b('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x386e04=path[_0x5c8b('0x3b')](_0x1e0473);const _0x58a12d=Date[_0x5c8b('0x2c')]()+'-'+_0x1e0473['replace'](_0x386e04,'')+_0x386e04;_0x287478(null,_0x58a12d);}})});router[_0x5c8b('0x25')](_0x5c8b('0x3c'),offlineUploadMulter[_0x5c8b('0x3d')](),controller['offline']);router[_0x5c8b('0x25')](_0x5c8b('0x1b'),auth[_0x5c8b('0xb')](),controller['addInteraction']);router[_0x5c8b('0x25')]('/:id/applications',auth['isAuthenticated'](),controller[_0x5c8b('0x3e')]);router[_0x5c8b('0x25')](_0x5c8b('0x3f'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x40')]);router[_0x5c8b('0x25')]('/:id/users',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x41')]);router[_0x5c8b('0x42')](_0x5c8b('0xf'),auth['isAuthenticated'](),controller[_0x5c8b('0x43')]);router[_0x5c8b('0x44')]('/:id',auth[_0x5c8b('0xb')](),controller['destroy']);router[_0x5c8b('0x44')](_0x5c8b('0x10'),auth[_0x5c8b('0xb')](),controller['removeDispositions']);router[_0x5c8b('0x44')](_0x5c8b('0x12'),auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x45')]);router['delete']('/:id/users',auth[_0x5c8b('0xb')](),controller[_0x5c8b('0x46')]);module[_0x5c8b('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 82a5152..ddcdfff 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 _0x13f5=['sequelize','exports','STRING','ENUM','Google'];(function(_0x9c607a,_0x1cb2c6){var _0x3b1311=function(_0x1b3fec){while(--_0x1b3fec){_0x9c607a['push'](_0x9c607a['shift']());}};_0x3b1311(++_0x1cb2c6);}(_0x13f5,0xc3));var _0x513f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x13f5[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x513f('0x0'));module[_0x513f('0x1')]={'name':{'type':Sequelize[_0x513f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x513f('0x3')]('AmazonAWS',_0x513f('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5fab=['AmazonAWS','Google','STRING','sequelize','exports','ENUM'];(function(_0x437aa2,_0x48d508){var _0x28ac4d=function(_0x4afc37){while(--_0x4afc37){_0x437aa2['push'](_0x437aa2['shift']());}};_0x28ac4d(++_0x48d508);}(_0x5fab,0x177));var _0xb5fa=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x5fab[_0x115d5b];return _0x6cfc50;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb5fa('0x2')](_0xb5fa('0x3'),_0xb5fa('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xb5fa('0x5')]},'data2':{'type':Sequelize[_0xb5fa('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index c194f0b..cb52fb7 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 _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14ecc8,_0x2b02ee){_0x14ecc8=_0x14ecc8-0x0;var _0x1d64b0=_0x5f2f[_0x14ecc8];return _0x1d64b0;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x471269,_0x3fafb9){var _0x5f1fcb=function(_0x48c337){while(--_0x48c337){_0x471269['push'](_0x471269['shift']());}};_0x5f1fcb(++_0x3fafb9);}(_0x7a54,0x106));var _0x47a5=function(_0x1c5a8b,_0x223ee3){_0x1c5a8b=_0x1c5a8b-0x0;var _0x2f2921=_0x7a54[_0x1c5a8b];return _0x2f2921;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index f86255c..92da18a 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 _0x22c7=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','exports'];(function(_0x34cc52,_0x493272){var _0x491c03=function(_0x58a84a){while(--_0x58a84a){_0x34cc52['push'](_0x34cc52['shift']());}};_0x491c03(++_0x493272);}(_0x22c7,0xf2));var _0x722c=function(_0x20b99b,_0x409d0e){_0x20b99b=_0x20b99b-0x0;var _0x12c7ce=_0x22c7[_0x20b99b];return _0x12c7ce;};'use strict';var _=require(_0x722c('0x0'));var util=require(_0x722c('0x1'));var logger=require(_0x722c('0x2'))(_0x722c('0x3'));var moment=require('moment');var BPromise=require(_0x722c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x722c('0x5')]=function(_0xe9ddfc,_0x1fb915){return _0xe9ddfc['define'](_0x722c('0x6'),attributes,{'tableName':_0x722c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf7bb=['rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf7bb,0x1b3));var _0xbf7b=function(_0x4b65f1,_0x3dfc92){_0x4b65f1=_0x4b65f1-0x0;var _0x4efedd=_0xf7bb[_0x4b65f1];return _0x4efedd;};'use strict';var _=require(_0xbf7b('0x0'));var util=require(_0xbf7b('0x1'));var logger=require(_0xbf7b('0x2'))(_0xbf7b('0x3'));var moment=require(_0xbf7b('0x4'));var BPromise=require(_0xbf7b('0x5'));var rp=require(_0xbf7b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf7b('0x7'));var config=require(_0xbf7b('0x8'));var attributes=require(_0xbf7b('0x9'));module[_0xbf7b('0xa')]=function(_0x32592b,_0x2af7f9){return _0x32592b['define'](_0xbf7b('0xb'),attributes,{'tableName':_0xbf7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 8ce9c71..6a86626 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 _0x4b74=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x4b74,0x103));var _0x44b7=function(_0x2a9ef1,_0x28d168){_0x2a9ef1=_0x2a9ef1-0x0;var _0x332d3d=_0x4b74[_0x2a9ef1];return _0x332d3d;};'use strict';var _=require(_0x44b7('0x0'));var util=require(_0x44b7('0x1'));var moment=require(_0x44b7('0x2'));var BPromise=require('bluebird');var rs=require(_0x44b7('0x3'));var fs=require('fs');var Redis=require(_0x44b7('0x4'));var db=require(_0x44b7('0x5'))['db'];var utils=require(_0x44b7('0x6'));var logger=require(_0x44b7('0x7'))(_0x44b7('0x8'));var config=require(_0x44b7('0x9'));var jayson=require(_0x44b7('0xa'));var client=jayson['client'][_0x44b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2174f2,_0x7b80e9,_0x4a582b){return new BPromise(function(_0x45dfbe,_0xabf05c){return client[_0x44b7('0xc')](_0x2174f2,_0x4a582b)['then'](function(_0x7d4b17){logger[_0x44b7('0xd')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x44b7('0xe'));logger[_0x44b7('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x7b80e9,_0x44b7('0xe'),JSON[_0x44b7('0x10')](_0x7d4b17));if(_0x7d4b17[_0x44b7('0x11')]){if(_0x7d4b17['error'][_0x44b7('0x12')]===0x1f4){logger[_0x44b7('0x11')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x7d4b17[_0x44b7('0x11')]['message']);return _0xabf05c(_0x7d4b17[_0x44b7('0x11')][_0x44b7('0x13')]);}logger[_0x44b7('0x11')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x7d4b17['error'][_0x44b7('0x13')]);return _0x45dfbe(_0x7d4b17['error']['message']);}else{logger['info'](_0x44b7('0x14'),_0x7b80e9,_0x44b7('0xe'));_0x45dfbe(_0x7d4b17['result'][_0x44b7('0x13')]);}})[_0x44b7('0x15')](function(_0x3528c8){logger[_0x44b7('0x11')](_0x44b7('0x14'),_0x7b80e9,_0x3528c8);_0xabf05c(_0x3528c8);});});}
\ No newline at end of file
+var _0x414f=['then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x414f,0x13f));var _0xf414=function(_0x2bcf3b,_0x2443d7){_0x2bcf3b=_0x2bcf3b-0x0;var _0x1d2898=_0x414f[_0x2bcf3b];return _0x1d2898;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var moment=require(_0xf414('0x1'));var BPromise=require(_0xf414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf414('0x3'));var db=require(_0xf414('0x4'))['db'];var utils=require(_0xf414('0x5'));var logger=require(_0xf414('0x6'))(_0xf414('0x7'));var config=require(_0xf414('0x8'));var jayson=require(_0xf414('0x9'));var client=jayson['client'][_0xf414('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cdcdb,_0x34c4d0,_0x2306e5){return new BPromise(function(_0xad732,_0x5194e5){return client['request'](_0x4cdcdb,_0x2306e5)[_0xf414('0xb')](function(_0x2bbf01){logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));logger[_0xf414('0xf')](_0xf414('0x10'),_0x34c4d0,_0xf414('0xe'),JSON['stringify'](_0x2bbf01));if(_0x2bbf01['error']){if(_0x2bbf01[_0xf414('0x11')][_0xf414('0x12')]===0x1f4){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0x5194e5(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x2bbf01[_0xf414('0x11')]['message']);return _0xad732(_0x2bbf01[_0xf414('0x11')][_0xf414('0x13')]);}else{logger[_0xf414('0xc')](_0xf414('0xd'),_0x34c4d0,_0xf414('0xe'));_0xad732(_0x2bbf01[_0xf414('0x14')][_0xf414('0x13')]);}})[_0xf414('0x15')](function(_0x483e29){logger[_0xf414('0x11')](_0xf414('0xd'),_0x34c4d0,_0x483e29);_0x5194e5(_0x483e29);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index b621e35..8e3fff2 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 _0x4874=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cloudProvider.controller','get'];(function(_0x30c400,_0x36123a){var _0x234819=function(_0x1ecd03){while(--_0x1ecd03){_0x30c400['push'](_0x30c400['shift']());}};_0x234819(++_0x36123a);}(_0x4874,0x12a));var _0x4487=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4874[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4487('0x0'));var timeout=require(_0x4487('0x1'));var express=require(_0x4487('0x2'));var router=express[_0x4487('0x3')]();var fs_extra=require(_0x4487('0x4'));var auth=require(_0x4487('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4487('0x6'));router[_0x4487('0x7')]('/',auth[_0x4487('0x8')](),controller[_0x4487('0x9')]);router['get'](_0x4487('0xa'),auth[_0x4487('0x8')](),controller[_0x4487('0xb')]);router[_0x4487('0xc')]('/',auth[_0x4487('0x8')](),controller[_0x4487('0xd')]);router[_0x4487('0xe')](_0x4487('0xa'),auth[_0x4487('0x8')](),controller[_0x4487('0xf')]);router[_0x4487('0x10')](_0x4487('0xa'),auth[_0x4487('0x8')](),controller[_0x4487('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x2f1c=['index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cloudProvider.controller','get'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2f1c,0x68));var _0xc2f1=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0x2f1c[_0x3dc538];return _0x72c2fd;};'use strict';var multer=require(_0xc2f1('0x0'));var util=require(_0xc2f1('0x1'));var path=require(_0xc2f1('0x2'));var timeout=require(_0xc2f1('0x3'));var express=require(_0xc2f1('0x4'));var router=express[_0xc2f1('0x5')]();var fs_extra=require(_0xc2f1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc2f1('0x7'));var controller=require(_0xc2f1('0x8'));router[_0xc2f1('0x9')]('/',auth['isAuthenticated'](),controller[_0xc2f1('0xa')]);router['get'](_0xc2f1('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc2f1('0xc')](),controller[_0xc2f1('0xd')]);router[_0xc2f1('0xe')](_0xc2f1('0xb'),auth[_0xc2f1('0xc')](),controller[_0xc2f1('0xf')]);router[_0xc2f1('0x10')](_0xc2f1('0xb'),auth[_0xc2f1('0xc')](),controller[_0xc2f1('0x11')]);module[_0xc2f1('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9df91d0..0fdff0a 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 _0xd529=['name','sequelize','exports','STRING'];(function(_0x25f1bf,_0x1c78d8){var _0x5705c1=function(_0x229b78){while(--_0x229b78){_0x25f1bf['push'](_0x25f1bf['shift']());}};_0x5705c1(++_0x1c78d8);}(_0xd529,0x1c9));var _0x9d52=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd529[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x9d52('0x0'));module[_0x9d52('0x1')]={'name':{'type':Sequelize[_0x9d52('0x2')],'unique':_0x9d52('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9d52('0x2')]},'companyId':{'type':Sequelize[_0x9d52('0x2')]},'website':{'type':Sequelize[_0x9d52('0x2')]},'phone':{'type':Sequelize[_0x9d52('0x2')]},'fax':{'type':Sequelize[_0x9d52('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9d52('0x2')]},'city':{'type':Sequelize[_0x9d52('0x2')]},'country':{'type':Sequelize[_0x9d52('0x2')]},'email':{'type':Sequelize[_0x9d52('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9d52('0x2')]},'sStreet':{'type':Sequelize[_0x9d52('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x9d52('0x2')]},'sCountry':{'type':Sequelize[_0x9d52('0x2')]},'description':{'type':Sequelize[_0x9d52('0x2')]}};
\ No newline at end of file
+var _0x22d2=['exports','STRING','sequelize'];(function(_0x2a6146,_0x3cf092){var _0x25378d=function(_0x289351){while(--_0x289351){_0x2a6146['push'](_0x2a6146['shift']());}};_0x25378d(++_0x3cf092);}(_0x22d2,0x194));var _0x222d=function(_0x22dca9,_0x2b8545){_0x22dca9=_0x22dca9-0x0;var _0x2a8d89=_0x22d2[_0x22dca9];return _0x2a8d89;};'use strict';var Sequelize=require(_0x222d('0x0'));module[_0x222d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x222d('0x2')]},'phone':{'type':Sequelize[_0x222d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x222d('0x2')]},'street':{'type':Sequelize[_0x222d('0x2')]},'postalCode':{'type':Sequelize[_0x222d('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x222d('0x2')]},'email':{'type':Sequelize[_0x222d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x222d('0x2')]},'sStreet':{'type':Sequelize[_0x222d('0x2')]},'sPostalCode':{'type':Sequelize[_0x222d('0x2')]},'sCity':{'type':Sequelize[_0x222d('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x222d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 68ff486..e81f3b6 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 _0x5b52=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','ids','findOne','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','create'];(function(_0x3f52e1,_0x12177e){var _0x3cd8b6=function(_0x2babb6){while(--_0x2babb6){_0x3f52e1['push'](_0x3f52e1['shift']());}};_0x3cd8b6(++_0x12177e);}(_0x5b52,0x17d));var _0x25b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b52[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x25b5('0x0'));var rimraf=require(_0x25b5('0x1'));var zipdir=require(_0x25b5('0x2'));var jsonpatch=require(_0x25b5('0x3'));var rp=require('request-promise');var moment=require(_0x25b5('0x4'));var BPromise=require(_0x25b5('0x5'));var Mustache=require('mustache');var util=require(_0x25b5('0x6'));var path=require(_0x25b5('0x7'));var sox=require(_0x25b5('0x8'));var csv=require(_0x25b5('0x9'));var ejs=require(_0x25b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b5('0xb'));var squel=require(_0x25b5('0xc'));var crypto=require(_0x25b5('0xd'));var jsforce=require(_0x25b5('0xe'));var deskjs=require(_0x25b5('0xf'));var toCsv=require(_0x25b5('0x9'));var querystring=require('querystring');var Papa=require(_0x25b5('0x10'));var Redis=require('ioredis');var authService=require(_0x25b5('0x11'));var qs=require(_0x25b5('0x12'));var as=require(_0x25b5('0x13'));var hardwareService=require(_0x25b5('0x14'));var logger=require('../../config/logger')(_0x25b5('0x15'));var utils=require(_0x25b5('0x16'));var config=require(_0x25b5('0x17'));var licenseUtil=require(_0x25b5('0x18'));var db=require(_0x25b5('0x19'))['db'];function respondWithStatusCode(_0x2e933f,_0xea527e){_0xea527e=_0xea527e||0xcc;return function(_0x5c6046){if(_0x5c6046){return _0x2e933f[_0x25b5('0x1a')](_0xea527e);}return _0x2e933f[_0x25b5('0x1b')](_0xea527e)[_0x25b5('0x1c')]();};}function respondWithResult(_0x12f0e0,_0x12fa5b){_0x12fa5b=_0x12fa5b||0xc8;return function(_0x3ce0dc){if(_0x3ce0dc){return _0x12f0e0[_0x25b5('0x1b')](_0x12fa5b)[_0x25b5('0x1d')](_0x3ce0dc);}};}function respondWithFilteredResult(_0x585a21,_0x1a1ff0){return function(_0x58d935){if(_0x58d935){var _0x2fbd03=typeof _0x1a1ff0['offset']===_0x25b5('0x1e')&&typeof _0x1a1ff0[_0x25b5('0x1f')]===_0x25b5('0x1e');var _0x47648c=_0x58d935[_0x25b5('0x20')];var _0x8e5c7=_0x2fbd03?0x0:_0x1a1ff0[_0x25b5('0x21')];var _0x124a8a=_0x2fbd03?_0x58d935[_0x25b5('0x20')]:_0x1a1ff0[_0x25b5('0x21')]+_0x1a1ff0[_0x25b5('0x1f')];var _0x24b7fc;if(_0x124a8a>=_0x47648c){_0x124a8a=_0x47648c;_0x24b7fc=0xc8;}else{_0x24b7fc=0xce;}_0x585a21[_0x25b5('0x1b')](_0x24b7fc);return _0x585a21[_0x25b5('0x22')](_0x25b5('0x23'),_0x8e5c7+'-'+_0x124a8a+'/'+_0x47648c)['json'](_0x58d935);}return null;};}function patchUpdates(_0x3167e9){return function(_0x18727b){try{jsonpatch[_0x25b5('0x24')](_0x18727b,_0x3167e9,!![]);}catch(_0x2b7fb0){return BPromise['reject'](_0x2b7fb0);}return _0x18727b[_0x25b5('0x25')]();};}function saveUpdates(_0x47fc8d,_0x19362d){return function(_0x22e861){if(_0x22e861){return _0x22e861[_0x25b5('0x26')](_0x47fc8d)[_0x25b5('0x27')](function(_0x3fc6c9){return _0x3fc6c9;});}return null;};}function removeEntity(_0x4076c7,_0x26f62c){return function(_0x47a7b7){if(_0x47a7b7){return _0x47a7b7[_0x25b5('0x28')]()['then'](function(){var _0x13c4c1=_0x47a7b7[_0x25b5('0x29')]({'plain':!![]});var _0x469a63=_0x25b5('0x2a');return db[_0x25b5('0x2b')]['destroy']({'where':{'type':_0x469a63,'resourceId':_0x13c4c1['id']}})['then'](function(){return _0x47a7b7;});})[_0x25b5('0x27')](function(){_0x4076c7[_0x25b5('0x1b')](0xcc)[_0x25b5('0x1c')]();});}};}function handleEntityNotFound(_0xd7b124,_0x18ba36){return function(_0x4350e4){if(!_0x4350e4){_0xd7b124[_0x25b5('0x1a')](0x194);}return _0x4350e4;};}function handleError(_0x53d3c6,_0x308308){_0x308308=_0x308308||0x1f4;return function(_0xad2c57){logger[_0x25b5('0x2c')](_0xad2c57['stack']);if(_0xad2c57[_0x25b5('0x2d')]){delete _0xad2c57[_0x25b5('0x2d')];}_0x53d3c6[_0x25b5('0x1b')](_0x308308)[_0x25b5('0x2e')](_0xad2c57);};}exports[_0x25b5('0x2f')]=function(_0x19647b,_0x40d5dc){var _0x10f966={},_0x4d0cf7={},_0x685421={'count':0x0,'rows':[]};return db[_0x25b5('0x30')][_0x25b5('0x31')]()['then'](function(_0x34ce8a){_0x4d0cf7['model']=_[_0x25b5('0x32')](_0x34ce8a);_0x4d0cf7[_0x25b5('0x33')]=_['keys'](_0x19647b[_0x25b5('0x33')]);_0x4d0cf7[_0x25b5('0x34')]=_['intersection'](_0x4d0cf7[_0x25b5('0x35')],_0x4d0cf7['query']);_0x10f966['attributes']=_[_0x25b5('0x36')](_0x4d0cf7['model'],qs[_0x25b5('0x37')](_0x19647b['query'][_0x25b5('0x37')]));_0x10f966[_0x25b5('0x38')]=_0x10f966[_0x25b5('0x38')][_0x25b5('0x39')]?_0x10f966[_0x25b5('0x38')]:_0x4d0cf7[_0x25b5('0x35')];if(!_0x19647b[_0x25b5('0x33')][_0x25b5('0x3a')](_0x25b5('0x3b'))){_0x10f966[_0x25b5('0x1f')]=qs[_0x25b5('0x1f')](_0x19647b[_0x25b5('0x33')]['limit']);_0x10f966['offset']=qs[_0x25b5('0x21')](_0x19647b['query'][_0x25b5('0x21')]);}_0x10f966[_0x25b5('0x3c')]=qs[_0x25b5('0x3d')](_0x19647b[_0x25b5('0x33')][_0x25b5('0x3d')]);_0x10f966['where']=qs[_0x25b5('0x34')](_[_0x25b5('0x3e')](_0x19647b['query'],_0x4d0cf7['filters']),_0x34ce8a);if(_0x19647b['query'][_0x25b5('0x3f')]){_0x10f966[_0x25b5('0x40')]=_['merge'](_0x10f966['where'],{'$or':_['map'](_0x10f966[_0x25b5('0x38')],function(_0x32e18f){var _0x3ff741={};_0x3ff741[_0x32e18f]={'$like':'%'+_0x19647b[_0x25b5('0x33')][_0x25b5('0x3f')]+'%'};return _0x3ff741;})});}_0x10f966=_[_0x25b5('0x41')]({},_0x10f966,_0x19647b['options']);var _0x4a4db5={'where':_0x10f966['where']};return db[_0x25b5('0x30')]['count'](_0x4a4db5)[_0x25b5('0x27')](function(_0x2fcb89){_0x685421[_0x25b5('0x20')]=_0x2fcb89;if(_0x19647b[_0x25b5('0x33')][_0x25b5('0x42')]){_0x10f966[_0x25b5('0x43')]=[{'all':!![]}];}return db['CmCompany'][_0x25b5('0x44')](_0x10f966);})[_0x25b5('0x27')](function(_0xe66c18){_0x685421[_0x25b5('0x45')]=_0xe66c18;return _0x685421;})[_0x25b5('0x27')](respondWithFilteredResult(_0x40d5dc,_0x10f966))[_0x25b5('0x46')](handleError(_0x40d5dc,null));})[_0x25b5('0x46')](handleError(_0x40d5dc,null));};exports[_0x25b5('0x47')]=function(_0x548ab3,_0x22b861){var _0x426e1e={'raw':![],'where':{'id':_0x548ab3['params']['id']}},_0x23ff5d={};_0x23ff5d[_0x25b5('0x35')]=_['keys'](db[_0x25b5('0x30')][_0x25b5('0x48')]);_0x23ff5d[_0x25b5('0x33')]=_[_0x25b5('0x32')](_0x548ab3[_0x25b5('0x33')]);_0x23ff5d[_0x25b5('0x34')]=_['intersection'](_0x23ff5d[_0x25b5('0x35')],_0x23ff5d[_0x25b5('0x33')]);_0x426e1e[_0x25b5('0x38')]=_['intersection'](_0x23ff5d[_0x25b5('0x35')],qs[_0x25b5('0x37')](_0x548ab3[_0x25b5('0x33')]['fields']));_0x426e1e[_0x25b5('0x38')]=_0x426e1e[_0x25b5('0x38')][_0x25b5('0x39')]?_0x426e1e[_0x25b5('0x38')]:_0x23ff5d['model'];if(_0x548ab3[_0x25b5('0x33')]['includeAll']){_0x426e1e[_0x25b5('0x43')]=[{'all':!![]}];}_0x426e1e=_[_0x25b5('0x41')]({},_0x426e1e,_0x548ab3['options']);return db['CmCompany']['find'](_0x426e1e)[_0x25b5('0x27')](handleEntityNotFound(_0x22b861,null))['then'](respondWithResult(_0x22b861,null))[_0x25b5('0x46')](handleError(_0x22b861,null));};exports[_0x25b5('0x49')]=function(_0x3d67d8,_0x33d84f){return db[_0x25b5('0x30')][_0x25b5('0x49')](_0x3d67d8[_0x25b5('0x4a')],{})[_0x25b5('0x27')](function(_0x56ba48){var _0x213443=_0x3d67d8[_0x25b5('0x4b')][_0x25b5('0x29')]({'plain':!![]});if(!_0x213443)throw new Error(_0x25b5('0x4c'));if(_0x213443[_0x25b5('0x4d')]==='user'){var _0x48d9f1=_0x56ba48[_0x25b5('0x29')]({'plain':!![]});var _0x1ac801=_0x25b5('0x2a');return db[_0x25b5('0x4e')][_0x25b5('0x4f')]({'where':{'name':_0x1ac801,'userProfileId':_0x213443[_0x25b5('0x50')]},'raw':!![]})[_0x25b5('0x27')](function(_0x3796fe){if(_0x3796fe&&_0x3796fe[_0x25b5('0x51')]===0x0){return db[_0x25b5('0x2b')]['create']({'name':_0x48d9f1[_0x25b5('0x2d')],'resourceId':_0x48d9f1['id'],'type':_0x3796fe[_0x25b5('0x2d')],'sectionId':_0x3796fe['id']},{})[_0x25b5('0x27')](function(){return _0x56ba48;});}else{return _0x56ba48;}})[_0x25b5('0x46')](function(_0x27378c){logger[_0x25b5('0x2c')](_0x25b5('0x52'),_0x27378c);throw _0x27378c;});}return _0x56ba48;})[_0x25b5('0x27')](respondWithResult(_0x33d84f,0xc9))[_0x25b5('0x46')](handleError(_0x33d84f,null));};exports[_0x25b5('0x26')]=function(_0x3e24f3,_0x17ff92){if(_0x3e24f3[_0x25b5('0x4a')]['id']){delete _0x3e24f3['body']['id'];}return db[_0x25b5('0x30')]['find']({'where':{'id':_0x3e24f3[_0x25b5('0x53')]['id']}})[_0x25b5('0x27')](handleEntityNotFound(_0x17ff92,null))[_0x25b5('0x27')](saveUpdates(_0x3e24f3[_0x25b5('0x4a')],null))[_0x25b5('0x27')](respondWithResult(_0x17ff92,null))[_0x25b5('0x46')](handleError(_0x17ff92,null));};exports['destroy']=function(_0x389a4d,_0xf0b0d1){return db['CmCompany'][_0x25b5('0x4f')]({'where':{'id':_0x389a4d[_0x25b5('0x53')]['id']}})[_0x25b5('0x27')](handleEntityNotFound(_0xf0b0d1,null))[_0x25b5('0x27')](removeEntity(_0xf0b0d1,null))['catch'](handleError(_0xf0b0d1,null));};exports['describe']=function(_0x2eb1aa,_0x11b1d1){return db[_0x25b5('0x30')]['describe']()[_0x25b5('0x27')](respondWithResult(_0x11b1d1,null))[_0x25b5('0x46')](handleError(_0x11b1d1,null));};exports[_0x25b5('0x54')]=function(_0x9dd741,_0xc75585,_0x15276e){return db[_0x25b5('0x55')]['find']({'where':{'id':_0x9dd741[_0x25b5('0x53')]['id']}})['then'](handleEntityNotFound(_0xc75585,null))['then'](function(_0x29534a){if(_0x29534a){return _0x29534a[_0x25b5('0x54')](_0x9dd741['body']['ids'],_[_0x25b5('0x56')](_0x9dd741['body'],[_0x25b5('0x57'),'id'])||{});}})[_0x25b5('0x27')](respondWithResult(_0xc75585,null))[_0x25b5('0x46')](handleError(_0xc75585,null));};exports['getContacts']=function(_0x4ea3bb,_0x539795,_0x5c4d33){var _0x2a7506={};var _0x4397f2={};var _0x20285c;var _0x1a0055;return db['CmCompany'][_0x25b5('0x58')]({'where':{'id':_0x4ea3bb[_0x25b5('0x53')]['id']}})[_0x25b5('0x27')](handleEntityNotFound(_0x539795,null))[_0x25b5('0x27')](function(_0x543c51){if(_0x543c51){_0x20285c=_0x543c51;_0x4397f2[_0x25b5('0x35')]=_[_0x25b5('0x32')](db['CmContact'][_0x25b5('0x48')]);_0x4397f2[_0x25b5('0x33')]=_[_0x25b5('0x32')](_0x4ea3bb[_0x25b5('0x33')]);_0x4397f2['filters']=_['intersection'](_0x4397f2[_0x25b5('0x35')],_0x4397f2[_0x25b5('0x33')]);_0x2a7506['attributes']=_[_0x25b5('0x36')](_0x4397f2[_0x25b5('0x35')],qs[_0x25b5('0x37')](_0x4ea3bb[_0x25b5('0x33')][_0x25b5('0x37')]));_0x2a7506[_0x25b5('0x38')]=_0x2a7506['attributes'][_0x25b5('0x39')]?_0x2a7506[_0x25b5('0x38')]:_0x4397f2[_0x25b5('0x35')];_0x2a7506[_0x25b5('0x3c')]=qs[_0x25b5('0x3d')](_0x4ea3bb['query']['sort']);_0x2a7506[_0x25b5('0x40')]=qs['filters'](_[_0x25b5('0x3e')](_0x4ea3bb[_0x25b5('0x33')],_0x4397f2[_0x25b5('0x34')]));if(_0x4ea3bb['query'][_0x25b5('0x3f')]){_0x2a7506[_0x25b5('0x40')]=_[_0x25b5('0x41')](_0x2a7506[_0x25b5('0x40')],{'$or':_[_0x25b5('0x59')](_0x2a7506[_0x25b5('0x38')],function(_0x3f4313){var _0x560531={};_0x560531[_0x3f4313]={'$like':'%'+_0x4ea3bb['query'][_0x25b5('0x3f')]+'%'};return _0x560531;})});}_0x2a7506=_[_0x25b5('0x41')]({},_0x2a7506,_0x4ea3bb['options']);return _0x20285c[_0x25b5('0x5a')](_0x2a7506);}})[_0x25b5('0x27')](function(_0x36a36b){if(_0x36a36b){_0x1a0055=_0x36a36b['length'];if(!_0x4ea3bb[_0x25b5('0x33')][_0x25b5('0x3a')](_0x25b5('0x3b'))){_0x2a7506[_0x25b5('0x1f')]=qs[_0x25b5('0x1f')](_0x4ea3bb[_0x25b5('0x33')][_0x25b5('0x1f')]);_0x2a7506[_0x25b5('0x21')]=qs['offset'](_0x4ea3bb['query'][_0x25b5('0x21')]);}return _0x20285c[_0x25b5('0x5a')](_0x2a7506);}})[_0x25b5('0x27')](function(_0xa5cb12){if(_0xa5cb12){return _0xa5cb12?{'count':_0x1a0055,'rows':_0xa5cb12}:null;}})[_0x25b5('0x27')](respondWithResult(_0x539795,null))[_0x25b5('0x46')](handleError(_0x539795,null));};
\ No newline at end of file
+var _0x46d7=['fast-json-patch','mustache','util','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','describe','addContacts','CmContact','ids','getContacts','findOne','map','eml-format','rimraf','zip-dir'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x46d7,0x159));var _0x746d=function(_0x5c54a4,_0x1028bc){_0x5c54a4=_0x5c54a4-0x0;var _0x2a713f=_0x46d7[_0x5c54a4];return _0x2a713f;};'use strict';var emlformat=require(_0x746d('0x0'));var rimraf=require(_0x746d('0x1'));var zipdir=require(_0x746d('0x2'));var jsonpatch=require(_0x746d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x746d('0x4'));var util=require(_0x746d('0x5'));var path=require(_0x746d('0x6'));var sox=require('sox');var csv=require(_0x746d('0x7'));var ejs=require(_0x746d('0x8'));var fs=require('fs');var fs_extra=require(_0x746d('0x9'));var _=require(_0x746d('0xa'));var squel=require(_0x746d('0xb'));var crypto=require(_0x746d('0xc'));var jsforce=require(_0x746d('0xd'));var deskjs=require(_0x746d('0xe'));var toCsv=require(_0x746d('0x7'));var querystring=require(_0x746d('0xf'));var Papa=require(_0x746d('0x10'));var Redis=require(_0x746d('0x11'));var authService=require(_0x746d('0x12'));var qs=require(_0x746d('0x13'));var as=require(_0x746d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x746d('0x15'))(_0x746d('0x16'));var utils=require(_0x746d('0x17'));var config=require(_0x746d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x746d('0x19'))['db'];function respondWithStatusCode(_0x2272bf,_0x14363b){_0x14363b=_0x14363b||0xcc;return function(_0x53f84f){if(_0x53f84f){return _0x2272bf['sendStatus'](_0x14363b);}return _0x2272bf[_0x746d('0x1a')](_0x14363b)['end']();};}function respondWithResult(_0x1bf4f3,_0x328ccb){_0x328ccb=_0x328ccb||0xc8;return function(_0x258649){if(_0x258649){return _0x1bf4f3[_0x746d('0x1a')](_0x328ccb)[_0x746d('0x1b')](_0x258649);}};}function respondWithFilteredResult(_0x1b1bc2,_0x3f50bb){return function(_0x1bda16){if(_0x1bda16){var _0x4e4928=typeof _0x3f50bb[_0x746d('0x1c')]===_0x746d('0x1d')&&typeof _0x3f50bb[_0x746d('0x1e')]===_0x746d('0x1d');var _0x4486f3=_0x1bda16[_0x746d('0x1f')];var _0x1649ea=_0x4e4928?0x0:_0x3f50bb[_0x746d('0x1c')];var _0x54fdfb=_0x4e4928?_0x1bda16['count']:_0x3f50bb[_0x746d('0x1c')]+_0x3f50bb['limit'];var _0x1b6687;if(_0x54fdfb>=_0x4486f3){_0x54fdfb=_0x4486f3;_0x1b6687=0xc8;}else{_0x1b6687=0xce;}_0x1b1bc2[_0x746d('0x1a')](_0x1b6687);return _0x1b1bc2[_0x746d('0x20')](_0x746d('0x21'),_0x1649ea+'-'+_0x54fdfb+'/'+_0x4486f3)[_0x746d('0x1b')](_0x1bda16);}return null;};}function patchUpdates(_0x576b17){return function(_0x17bb95){try{jsonpatch[_0x746d('0x22')](_0x17bb95,_0x576b17,!![]);}catch(_0x210e8d){return BPromise[_0x746d('0x23')](_0x210e8d);}return _0x17bb95[_0x746d('0x24')]();};}function saveUpdates(_0x16a431,_0x54870c){return function(_0x2fd321){if(_0x2fd321){return _0x2fd321[_0x746d('0x25')](_0x16a431)[_0x746d('0x26')](function(_0x1aa81b){return _0x1aa81b;});}return null;};}function removeEntity(_0x3efa3a,_0x4d080b){return function(_0x3ee6f5){if(_0x3ee6f5){return _0x3ee6f5[_0x746d('0x27')]()[_0x746d('0x26')](function(){var _0x307851=_0x3ee6f5[_0x746d('0x28')]({'plain':!![]});var _0x5e43f3=_0x746d('0x29');return db[_0x746d('0x2a')][_0x746d('0x27')]({'where':{'type':_0x5e43f3,'resourceId':_0x307851['id']}})['then'](function(){return _0x3ee6f5;});})[_0x746d('0x26')](function(){_0x3efa3a[_0x746d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f07e,_0x581202){return function(_0x15271b){if(!_0x15271b){_0x38f07e[_0x746d('0x2b')](0x194);}return _0x15271b;};}function handleError(_0x4a3542,_0x1fe682){_0x1fe682=_0x1fe682||0x1f4;return function(_0x50e27c){logger[_0x746d('0x2c')](_0x50e27c[_0x746d('0x2d')]);if(_0x50e27c[_0x746d('0x2e')]){delete _0x50e27c[_0x746d('0x2e')];}_0x4a3542['status'](_0x1fe682)[_0x746d('0x2f')](_0x50e27c);};}exports['index']=function(_0x47c653,_0x9f9cc9){var _0x52e97e={},_0x49c4fe={},_0x243c6a={'count':0x0,'rows':[]};return db[_0x746d('0x30')]['describe']()[_0x746d('0x26')](function(_0x36a606){_0x49c4fe[_0x746d('0x31')]=_[_0x746d('0x32')](_0x36a606);_0x49c4fe[_0x746d('0x33')]=_['keys'](_0x47c653['query']);_0x49c4fe[_0x746d('0x34')]=_[_0x746d('0x35')](_0x49c4fe[_0x746d('0x31')],_0x49c4fe[_0x746d('0x33')]);_0x52e97e[_0x746d('0x36')]=_[_0x746d('0x35')](_0x49c4fe[_0x746d('0x31')],qs[_0x746d('0x37')](_0x47c653[_0x746d('0x33')][_0x746d('0x37')]));_0x52e97e[_0x746d('0x36')]=_0x52e97e[_0x746d('0x36')][_0x746d('0x38')]?_0x52e97e[_0x746d('0x36')]:_0x49c4fe[_0x746d('0x31')];if(!_0x47c653[_0x746d('0x33')][_0x746d('0x39')](_0x746d('0x3a'))){_0x52e97e[_0x746d('0x1e')]=qs[_0x746d('0x1e')](_0x47c653['query'][_0x746d('0x1e')]);_0x52e97e['offset']=qs['offset'](_0x47c653['query'][_0x746d('0x1c')]);}_0x52e97e[_0x746d('0x3b')]=qs['sort'](_0x47c653['query'][_0x746d('0x3c')]);_0x52e97e[_0x746d('0x3d')]=qs[_0x746d('0x34')](_[_0x746d('0x3e')](_0x47c653[_0x746d('0x33')],_0x49c4fe['filters']),_0x36a606);if(_0x47c653['query']['filter']){_0x52e97e['where']=_[_0x746d('0x3f')](_0x52e97e['where'],{'$or':_['map'](_0x52e97e[_0x746d('0x36')],function(_0x1d80d1){var _0x119a20={};_0x119a20[_0x1d80d1]={'$like':'%'+_0x47c653[_0x746d('0x33')][_0x746d('0x40')]+'%'};return _0x119a20;})});}_0x52e97e=_[_0x746d('0x3f')]({},_0x52e97e,_0x47c653['options']);var _0x5d1a09={'where':_0x52e97e[_0x746d('0x3d')]};return db[_0x746d('0x30')][_0x746d('0x1f')](_0x5d1a09)['then'](function(_0x4436c5){_0x243c6a[_0x746d('0x1f')]=_0x4436c5;if(_0x47c653[_0x746d('0x33')]['includeAll']){_0x52e97e['include']=[{'all':!![]}];}return db['CmCompany'][_0x746d('0x41')](_0x52e97e);})[_0x746d('0x26')](function(_0x291116){_0x243c6a[_0x746d('0x42')]=_0x291116;return _0x243c6a;})[_0x746d('0x26')](respondWithFilteredResult(_0x9f9cc9,_0x52e97e))[_0x746d('0x43')](handleError(_0x9f9cc9,null));})[_0x746d('0x43')](handleError(_0x9f9cc9,null));};exports[_0x746d('0x44')]=function(_0x4eb426,_0x5dbeac){var _0x38a14a={'raw':![],'where':{'id':_0x4eb426[_0x746d('0x45')]['id']}},_0x264fd6={};_0x264fd6[_0x746d('0x31')]=_[_0x746d('0x32')](db['CmCompany'][_0x746d('0x46')]);_0x264fd6[_0x746d('0x33')]=_[_0x746d('0x32')](_0x4eb426[_0x746d('0x33')]);_0x264fd6[_0x746d('0x34')]=_['intersection'](_0x264fd6[_0x746d('0x31')],_0x264fd6[_0x746d('0x33')]);_0x38a14a[_0x746d('0x36')]=_[_0x746d('0x35')](_0x264fd6['model'],qs[_0x746d('0x37')](_0x4eb426['query'][_0x746d('0x37')]));_0x38a14a[_0x746d('0x36')]=_0x38a14a['attributes']['length']?_0x38a14a[_0x746d('0x36')]:_0x264fd6[_0x746d('0x31')];if(_0x4eb426['query'][_0x746d('0x47')]){_0x38a14a['include']=[{'all':!![]}];}_0x38a14a=_[_0x746d('0x3f')]({},_0x38a14a,_0x4eb426[_0x746d('0x48')]);return db['CmCompany'][_0x746d('0x49')](_0x38a14a)[_0x746d('0x26')](handleEntityNotFound(_0x5dbeac,null))[_0x746d('0x26')](respondWithResult(_0x5dbeac,null))[_0x746d('0x43')](handleError(_0x5dbeac,null));};exports[_0x746d('0x4a')]=function(_0x506169,_0x4041f2){return db[_0x746d('0x30')][_0x746d('0x4a')](_0x506169[_0x746d('0x4b')],{})['then'](function(_0x3d14b3){var _0x4bb09e=_0x506169[_0x746d('0x4c')][_0x746d('0x28')]({'plain':!![]});if(!_0x4bb09e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bb09e['role']===_0x746d('0x4c')){var _0x8e6ebe=_0x3d14b3[_0x746d('0x28')]({'plain':!![]});var _0x36054a='Companies';return db[_0x746d('0x4d')][_0x746d('0x49')]({'where':{'name':_0x36054a,'userProfileId':_0x4bb09e[_0x746d('0x4e')]},'raw':!![]})[_0x746d('0x26')](function(_0x3716cf){if(_0x3716cf&&_0x3716cf[_0x746d('0x4f')]===0x0){return db[_0x746d('0x2a')][_0x746d('0x4a')]({'name':_0x8e6ebe[_0x746d('0x2e')],'resourceId':_0x8e6ebe['id'],'type':_0x3716cf[_0x746d('0x2e')],'sectionId':_0x3716cf['id']},{})[_0x746d('0x26')](function(){return _0x3d14b3;});}else{return _0x3d14b3;}})[_0x746d('0x43')](function(_0x2825a5){logger[_0x746d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2825a5);throw _0x2825a5;});}return _0x3d14b3;})[_0x746d('0x26')](respondWithResult(_0x4041f2,0xc9))['catch'](handleError(_0x4041f2,null));};exports[_0x746d('0x25')]=function(_0xf285b1,_0x1ccd50){if(_0xf285b1[_0x746d('0x4b')]['id']){delete _0xf285b1[_0x746d('0x4b')]['id'];}return db[_0x746d('0x30')][_0x746d('0x49')]({'where':{'id':_0xf285b1['params']['id']}})[_0x746d('0x26')](handleEntityNotFound(_0x1ccd50,null))[_0x746d('0x26')](saveUpdates(_0xf285b1['body'],null))[_0x746d('0x26')](respondWithResult(_0x1ccd50,null))[_0x746d('0x43')](handleError(_0x1ccd50,null));};exports[_0x746d('0x27')]=function(_0x1922e7,_0x5c5a52){return db[_0x746d('0x30')][_0x746d('0x49')]({'where':{'id':_0x1922e7['params']['id']}})['then'](handleEntityNotFound(_0x5c5a52,null))[_0x746d('0x26')](removeEntity(_0x5c5a52,null))[_0x746d('0x43')](handleError(_0x5c5a52,null));};exports['describe']=function(_0x131393,_0x5bb9cb){return db[_0x746d('0x30')][_0x746d('0x50')]()[_0x746d('0x26')](respondWithResult(_0x5bb9cb,null))[_0x746d('0x43')](handleError(_0x5bb9cb,null));};exports[_0x746d('0x51')]=function(_0x46f86c,_0x4de7a7,_0x59e1bd){return db[_0x746d('0x52')]['find']({'where':{'id':_0x46f86c['params']['id']}})[_0x746d('0x26')](handleEntityNotFound(_0x4de7a7,null))[_0x746d('0x26')](function(_0x44dd21){if(_0x44dd21){return _0x44dd21['addContacts'](_0x46f86c[_0x746d('0x4b')][_0x746d('0x53')],_['omit'](_0x46f86c[_0x746d('0x4b')],['ids','id'])||{});}})[_0x746d('0x26')](respondWithResult(_0x4de7a7,null))[_0x746d('0x43')](handleError(_0x4de7a7,null));};exports[_0x746d('0x54')]=function(_0x479baf,_0x454ed4,_0x349a77){var _0x22ae27={};var _0x3719d5={};var _0x21320c;var _0x8300bd;return db[_0x746d('0x30')][_0x746d('0x55')]({'where':{'id':_0x479baf[_0x746d('0x45')]['id']}})['then'](handleEntityNotFound(_0x454ed4,null))[_0x746d('0x26')](function(_0x306632){if(_0x306632){_0x21320c=_0x306632;_0x3719d5['model']=_[_0x746d('0x32')](db[_0x746d('0x52')][_0x746d('0x46')]);_0x3719d5[_0x746d('0x33')]=_[_0x746d('0x32')](_0x479baf[_0x746d('0x33')]);_0x3719d5[_0x746d('0x34')]=_['intersection'](_0x3719d5[_0x746d('0x31')],_0x3719d5[_0x746d('0x33')]);_0x22ae27['attributes']=_[_0x746d('0x35')](_0x3719d5[_0x746d('0x31')],qs['fields'](_0x479baf['query'][_0x746d('0x37')]));_0x22ae27[_0x746d('0x36')]=_0x22ae27[_0x746d('0x36')]['length']?_0x22ae27['attributes']:_0x3719d5['model'];_0x22ae27[_0x746d('0x3b')]=qs[_0x746d('0x3c')](_0x479baf[_0x746d('0x33')][_0x746d('0x3c')]);_0x22ae27[_0x746d('0x3d')]=qs[_0x746d('0x34')](_[_0x746d('0x3e')](_0x479baf[_0x746d('0x33')],_0x3719d5[_0x746d('0x34')]));if(_0x479baf[_0x746d('0x33')][_0x746d('0x40')]){_0x22ae27[_0x746d('0x3d')]=_[_0x746d('0x3f')](_0x22ae27[_0x746d('0x3d')],{'$or':_[_0x746d('0x56')](_0x22ae27[_0x746d('0x36')],function(_0x444b02){var _0x57fe98={};_0x57fe98[_0x444b02]={'$like':'%'+_0x479baf['query'][_0x746d('0x40')]+'%'};return _0x57fe98;})});}_0x22ae27=_[_0x746d('0x3f')]({},_0x22ae27,_0x479baf[_0x746d('0x48')]);return _0x21320c[_0x746d('0x54')](_0x22ae27);}})[_0x746d('0x26')](function(_0x51d301){if(_0x51d301){_0x8300bd=_0x51d301[_0x746d('0x38')];if(!_0x479baf['query'][_0x746d('0x39')]('nolimit')){_0x22ae27[_0x746d('0x1e')]=qs[_0x746d('0x1e')](_0x479baf[_0x746d('0x33')]['limit']);_0x22ae27[_0x746d('0x1c')]=qs[_0x746d('0x1c')](_0x479baf[_0x746d('0x33')]['offset']);}return _0x21320c[_0x746d('0x54')](_0x22ae27);}})[_0x746d('0x26')](function(_0x11bf65){if(_0x11bf65){return _0x11bf65?{'count':_0x8300bd,'rows':_0x11bf65}:null;}})[_0x746d('0x26')](respondWithResult(_0x454ed4,null))[_0x746d('0x43')](handleError(_0x454ed4,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 949fc55..dede2e0 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 _0xcb2e=['rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','bluebird','path'];(function(_0x55ce52,_0x5b0650){var _0x3b1e5d=function(_0x1cf224){while(--_0x1cf224){_0x55ce52['push'](_0x55ce52['shift']());}};_0x3b1e5d(++_0x5b0650);}(_0xcb2e,0xed));var _0xecb2=function(_0x8d2c14,_0x50e164){_0x8d2c14=_0x8d2c14-0x0;var _0x3ebabb=_0xcb2e[_0x8d2c14];return _0x3ebabb;};'use strict';var _=require(_0xecb2('0x0'));var util=require('util');var logger=require(_0xecb2('0x1'))(_0xecb2('0x2'));var moment=require('moment');var BPromise=require(_0xecb2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecb2('0x4'));var rimraf=require(_0xecb2('0x5'));var config=require('../../config/environment');var attributes=require(_0xecb2('0x6'));module[_0xecb2('0x7')]=function(_0x20c384,_0x304dc7){return _0x20c384[_0xecb2('0x8')](_0xecb2('0x9'),attributes,{'tableName':_0xecb2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf40c=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1335a3,_0x52e14f){var _0x3d4e0e=function(_0x540191){while(--_0x540191){_0x1335a3['push'](_0x1335a3['shift']());}};_0x3d4e0e(++_0x52e14f);}(_0xf40c,0x89));var _0xcf40=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xf40c[_0x261e29];return _0x25ef43;};'use strict';var _=require(_0xcf40('0x0'));var util=require(_0xcf40('0x1'));var logger=require(_0xcf40('0x2'))(_0xcf40('0x3'));var moment=require('moment');var BPromise=require(_0xcf40('0x4'));var rp=require(_0xcf40('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf40('0x6'));var config=require('../../config/environment');var attributes=require(_0xcf40('0x7'));module[_0xcf40('0x8')]=function(_0x1d232c,_0x54ef17){return _0x1d232c[_0xcf40('0x9')](_0xcf40('0xa'),attributes,{'tableName':_0xcf40('0xb'),'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 22c12b7..ef5e321 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 _0x7a36=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x309e28,_0x486c36){var _0x24bf32=function(_0x418eac){while(--_0x418eac){_0x309e28['push'](_0x309e28['shift']());}};_0x24bf32(++_0x486c36);}(_0x7a36,0x18e));var _0x67a3=function(_0x320b41,_0x460866){_0x320b41=_0x320b41-0x0;var _0x5f6e6=_0x7a36[_0x320b41];return _0x5f6e6;};'use strict';var _=require(_0x67a3('0x0'));var util=require(_0x67a3('0x1'));var moment=require(_0x67a3('0x2'));var BPromise=require(_0x67a3('0x3'));var rs=require(_0x67a3('0x4'));var fs=require('fs');var Redis=require(_0x67a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x67a3('0x6'));var logger=require(_0x67a3('0x7'))(_0x67a3('0x8'));var config=require(_0x67a3('0x9'));var jayson=require(_0x67a3('0xa'));var client=jayson[_0x67a3('0xb')][_0x67a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d7376,_0x7715b9,_0x4254c2){return new BPromise(function(_0x81668c,_0x144420){return client[_0x67a3('0xd')](_0x3d7376,_0x4254c2)[_0x67a3('0xe')](function(_0x3d38a0){logger['info'](_0x67a3('0xf'),_0x7715b9,_0x67a3('0x10'));logger[_0x67a3('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x7715b9,'request\x20sent',JSON[_0x67a3('0x12')](_0x3d38a0));if(_0x3d38a0[_0x67a3('0x13')]){if(_0x3d38a0[_0x67a3('0x13')][_0x67a3('0x14')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x7715b9,_0x3d38a0[_0x67a3('0x13')][_0x67a3('0x15')]);return _0x144420(_0x3d38a0[_0x67a3('0x13')]['message']);}logger['error'](_0x67a3('0xf'),_0x7715b9,_0x3d38a0[_0x67a3('0x13')][_0x67a3('0x15')]);return _0x81668c(_0x3d38a0[_0x67a3('0x13')][_0x67a3('0x15')]);}else{logger[_0x67a3('0x16')]('CmCompany,\x20%s,\x20%s',_0x7715b9,'request\x20sent');_0x81668c(_0x3d38a0[_0x67a3('0x17')][_0x67a3('0x15')]);}})[_0x67a3('0x18')](function(_0x223ae5){logger[_0x67a3('0x13')](_0x67a3('0xf'),_0x7715b9,_0x223ae5);_0x144420(_0x223ae5);});});}
\ No newline at end of file
+var _0x2380=['client','request','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9388cb,_0x1f671b){var _0x1315a2=function(_0x3e06fc){while(--_0x3e06fc){_0x9388cb['push'](_0x9388cb['shift']());}};_0x1315a2(++_0x1f671b);}(_0x2380,0x16d));var _0x0238=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x2380[_0x9aada2];return _0x196dff;};'use strict';var _=require('lodash');var util=require(_0x0238('0x0'));var moment=require('moment');var BPromise=require(_0x0238('0x1'));var rs=require(_0x0238('0x2'));var fs=require('fs');var Redis=require(_0x0238('0x3'));var db=require(_0x0238('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0238('0x5'))(_0x0238('0x6'));var config=require(_0x0238('0x7'));var jayson=require(_0x0238('0x8'));var client=jayson[_0x0238('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58ea0e,_0x308f1b,_0x3e3d33){return new BPromise(function(_0x480c27,_0x651d25){return client[_0x0238('0xa')](_0x58ea0e,_0x3e3d33)[_0x0238('0xb')](function(_0x524643){logger[_0x0238('0xc')]('CmCompany,\x20%s,\x20%s',_0x308f1b,'request\x20sent');logger[_0x0238('0xd')](_0x0238('0xe'),_0x308f1b,_0x0238('0xf'),JSON[_0x0238('0x10')](_0x524643));if(_0x524643[_0x0238('0x11')]){if(_0x524643[_0x0238('0x11')][_0x0238('0x12')]===0x1f4){logger[_0x0238('0x11')](_0x0238('0x13'),_0x308f1b,_0x524643['error']['message']);return _0x651d25(_0x524643[_0x0238('0x11')]['message']);}logger[_0x0238('0x11')](_0x0238('0x13'),_0x308f1b,_0x524643[_0x0238('0x11')]['message']);return _0x480c27(_0x524643[_0x0238('0x11')][_0x0238('0x14')]);}else{logger[_0x0238('0xc')](_0x0238('0x13'),_0x308f1b,'request\x20sent');_0x480c27(_0x524643[_0x0238('0x15')]['message']);}})['catch'](function(_0x490b4c){logger[_0x0238('0x11')](_0x0238('0x13'),_0x308f1b,_0x490b4c);_0x651d25(_0x490b4c);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 1099604..83d9ff4 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 _0xe634=['index','/describe','describe','/:id','getContacts','post','create','addContacts','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0xc7daaf,_0x2d7456){var _0x31ee66=function(_0xc2fabe){while(--_0xc2fabe){_0xc7daaf['push'](_0xc7daaf['shift']());}};_0x31ee66(++_0x2d7456);}(_0xe634,0xf1));var _0x4e63=function(_0x48cf09,_0x3834d6){_0x48cf09=_0x48cf09-0x0;var _0x155c04=_0xe634[_0x48cf09];return _0x155c04;};'use strict';var multer=require(_0x4e63('0x0'));var util=require(_0x4e63('0x1'));var path=require(_0x4e63('0x2'));var timeout=require(_0x4e63('0x3'));var express=require(_0x4e63('0x4'));var router=express[_0x4e63('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4e63('0x6'));var interaction=require(_0x4e63('0x7'));var config=require(_0x4e63('0x8'));var controller=require(_0x4e63('0x9'));router[_0x4e63('0xa')]('/',auth[_0x4e63('0xb')](),controller[_0x4e63('0xc')]);router['get'](_0x4e63('0xd'),auth[_0x4e63('0xb')](),controller[_0x4e63('0xe')]);router[_0x4e63('0xa')](_0x4e63('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x4e63('0xa')]('/:id/contacts',auth[_0x4e63('0xb')](),controller[_0x4e63('0x10')]);router[_0x4e63('0x11')]('/',auth['isAuthenticated'](),controller[_0x4e63('0x12')]);router[_0x4e63('0x11')]('/:id/contacts',auth[_0x4e63('0xb')](),controller[_0x4e63('0x13')]);router[_0x4e63('0x14')](_0x4e63('0xf'),auth[_0x4e63('0xb')](),controller[_0x4e63('0x15')]);router['delete'](_0x4e63('0xf'),auth[_0x4e63('0xb')](),controller['destroy']);module[_0x4e63('0x16')]=router;
\ No newline at end of file
+var _0x1e17=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','/:id/contacts','put','destroy','exports','multer','util'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x1e17,0x71));var _0x71e1=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x1e17[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x71e1('0x0'));var util=require(_0x71e1('0x1'));var path=require(_0x71e1('0x2'));var timeout=require(_0x71e1('0x3'));var express=require(_0x71e1('0x4'));var router=express[_0x71e1('0x5')]();var fs_extra=require(_0x71e1('0x6'));var auth=require(_0x71e1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x71e1('0x8'));var controller=require(_0x71e1('0x9'));router[_0x71e1('0xa')]('/',auth[_0x71e1('0xb')](),controller[_0x71e1('0xc')]);router[_0x71e1('0xa')](_0x71e1('0xd'),auth[_0x71e1('0xb')](),controller[_0x71e1('0xe')]);router[_0x71e1('0xa')](_0x71e1('0xf'),auth[_0x71e1('0xb')](),controller[_0x71e1('0x10')]);router[_0x71e1('0xa')]('/:id/contacts',auth[_0x71e1('0xb')](),controller[_0x71e1('0x11')]);router[_0x71e1('0x12')]('/',auth[_0x71e1('0xb')](),controller['create']);router[_0x71e1('0x12')](_0x71e1('0x13'),auth[_0x71e1('0xb')](),controller['addContacts']);router[_0x71e1('0x14')](_0x71e1('0xf'),auth[_0x71e1('0xb')](),controller['update']);router['delete'](_0x71e1('0xf'),auth['isAuthenticated'](),controller[_0x71e1('0x15')]);module[_0x71e1('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index aa083a3..31ef9d1 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 _0xc75a=['NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc75a,0xe1));var _0xac75=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0xc75a[_0x8a30cf];return _0x20f439;};'use strict';var _=require('lodash');var Sequelize=require(_0xac75('0x0'));module[_0xac75('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xac75('0x2')]},'street':{'type':Sequelize[_0xac75('0x2')]},'postalCode':{'type':Sequelize[_0xac75('0x2')]},'city':{'type':Sequelize[_0xac75('0x2')]},'country':{'type':Sequelize[_0xac75('0x2')]},'dateOfBirth':{'type':Sequelize[_0xac75('0x2')]},'description':{'type':Sequelize[_0xac75('0x3')]},'phone':{'type':Sequelize[_0xac75('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xac75('0x2')]},'email':{'type':Sequelize[_0xac75('0x2')]},'url':{'type':Sequelize[_0xac75('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xac75('0x2')]},'skype':{'type':Sequelize[_0xac75('0x2')]},'teams':{'type':Sequelize[_0xac75('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xac75('0x2')]},'wechat':{'type':Sequelize[_0xac75('0x2')]},'telegram':{'type':Sequelize[_0xac75('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xac75('0x4')](0x2)[_0xac75('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xac75('0x6')],'defaultValue':Sequelize[_0xac75('0x7')]}};
\ No newline at end of file
+var _0xac14=['lodash','sequelize','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x3c3609,_0x3c0b19){var _0x5d2932=function(_0x4c9416){while(--_0x4c9416){_0x3c3609['push'](_0x3c3609['shift']());}};_0x5d2932(++_0x3c0b19);}(_0xac14,0x198));var _0x4ac1=function(_0x2ddfd2,_0x36f81b){_0x2ddfd2=_0x2ddfd2-0x0;var _0x5d4848=_0xac14[_0x2ddfd2];return _0x5d4848;};'use strict';var _=require(_0x4ac1('0x0'));var Sequelize=require(_0x4ac1('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4ac1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4ac1('0x2')]},'street':{'type':Sequelize[_0x4ac1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4ac1('0x2')]},'country':{'type':Sequelize[_0x4ac1('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4ac1('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4ac1('0x2')]},'mobile':{'type':Sequelize[_0x4ac1('0x2')]},'fax':{'type':Sequelize[_0x4ac1('0x2')]},'email':{'type':Sequelize[_0x4ac1('0x2')]},'url':{'type':Sequelize[_0x4ac1('0x2')]},'facebook':{'type':Sequelize[_0x4ac1('0x2')]},'fb_data':{'type':Sequelize[_0x4ac1('0x2')]},'twitter':{'type':Sequelize[_0x4ac1('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x4ac1('0x2')]},'viber':{'type':Sequelize[_0x4ac1('0x2')]},'line':{'type':Sequelize[_0x4ac1('0x2')]},'wechat':{'type':Sequelize[_0x4ac1('0x2')]},'telegram':{'type':Sequelize[_0x4ac1('0x2')]},'UserId':{'type':Sequelize[_0x4ac1('0x3')]},'priority':{'type':Sequelize[_0x4ac1('0x3')](0x2)[_0x4ac1('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4ac1('0x5')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e1069d0..3ba13e8 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 _0xe938=['value','split','map','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','DATE','start','end','hasOwnProperty','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','toString','sequelize','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','destroy','params','describe','tags','columnName','displayName','analytics','findAll','custom','values','body','get','mergeWith','isArray','join','info','CmHopper','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','catch','duplicates','show','$and','omit','pickBy','format','table','setFields','id\x20=\x20?','toParam','phone','findOne','rawAttributes','options','getTags','setTags','ids','ContactId','include','getHopperHistories','includeAll','rows','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','file','parse','meta','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','exit','error\x20child\x20process','mail','sms','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','startCase','chat','Website','Account','closed','disposition','secondDisposition','thirdDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingValue','referer','subject','openchannel','externalUrl','threadId','Interaction','flatten','sortBy','slice','util','path','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','sendStatus','error','stack','name','index','CmContact','keys','startsWith','push','CmCustomField','trimStart','cf_','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xe938,0xd2));var _0x8e93=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0xe938[_0x1bb47b];return _0x566418;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x8e93('0x0'));var path=require(_0x8e93('0x1'));var fs=require('fs');var _=require(_0x8e93('0x2'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x8e93('0x3'));var qs=require(_0x8e93('0x4'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')(_0x8e93('0x5'));var config=require(_0x8e93('0x6'));var db=require(_0x8e93('0x7'))['db'];config[_0x8e93('0x8')]=_['defaults'](config[_0x8e93('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e93('0x9'))(new Redis(config[_0x8e93('0x8')]));require(_0x8e93('0xa'))[_0x8e93('0xb')](socket);function respondWithResult(_0x43cd52,_0x5cc9a6){_0x5cc9a6=_0x5cc9a6||0xc8;return function(_0x59e70c){if(_0x59e70c){return _0x43cd52[_0x8e93('0xc')](_0x5cc9a6)[_0x8e93('0xd')](_0x59e70c);}};}function respondWithFilteredResult(_0x435694,_0x49fcae){return function(_0x2eee0c){if(_0x2eee0c){var _0x51a8f7=typeof _0x49fcae[_0x8e93('0xe')]===_0x8e93('0xf')&&typeof _0x49fcae[_0x8e93('0x10')]===_0x8e93('0xf');var _0x29f100=_0x2eee0c['count'];var _0x559663=_0x51a8f7?0x0:_0x49fcae[_0x8e93('0xe')];var _0x500c4a=_0x51a8f7?_0x2eee0c[_0x8e93('0x11')]:_0x49fcae[_0x8e93('0xe')]+_0x49fcae[_0x8e93('0x10')];var _0x4735c0;if(_0x500c4a>=_0x29f100){_0x500c4a=_0x29f100;_0x4735c0=0xc8;}else{_0x4735c0=0xce;}_0x435694['status'](_0x4735c0);return _0x435694['set'](_0x8e93('0x12'),_0x559663+'-'+_0x500c4a+'/'+_0x29f100)[_0x8e93('0xd')](_0x2eee0c);}return null;};}function saveUpdates(_0x5bb64b){return function(_0x1b17c2){if(_0x1b17c2){return _0x1b17c2[_0x8e93('0x13')](_0x5bb64b)['then'](function(_0x525c2c){return _0x525c2c;});}return null;};}function removeEntity(_0x4b60bb){return function(_0x15ac37){if(_0x15ac37){return _0x15ac37['destroy']()[_0x8e93('0x14')](function(){_0x4b60bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35cc92){return function(_0xc828c0){if(!_0xc828c0){_0x35cc92[_0x8e93('0x15')](0x194);}return _0xc828c0;};}function handleError(_0x291919,_0x22ccbc){_0x22ccbc=_0x22ccbc||0x1f4;return function(_0x43eb15){logger[_0x8e93('0x16')](_0x43eb15[_0x8e93('0x17')]);if(_0x43eb15[_0x8e93('0x18')]){delete _0x43eb15['name'];}_0x291919['status'](_0x22ccbc)['send'](_0x43eb15);};}exports[_0x8e93('0x19')]=function(_0x4266e7,_0x19663c){var _0x204f5d={},_0x382dfd={},_0x4398a6={'count':0x0,'rows':[]};return db[_0x8e93('0x1a')]['describe']()[_0x8e93('0x14')](function(_0x276f79){var _0x541533=[];for(var _0x5c1fef=0x0;_0x5c1fef
','Attachments','push','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','node-tnef'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xe9ef[_0x3a07c1];return _0x2bbe15;};'use strict';var _=require(_0xfe9e('0x0'));var moment=require('moment');var random=require(_0xfe9e('0x1'));var fs=require('fs');var path=require(_0xfe9e('0x2'));var util=require('util');var tnef=require(_0xfe9e('0x3'));var logger=require('../../../config/logger')(_0xfe9e('0x4'));var config=require(_0xfe9e('0x5'));function getAddress(_0x199f65){var _0x20d75f=_['head'](_0x199f65[_0xfe9e('0x6')]);return _0x20d75f&&_0x20d75f[_0xfe9e('0x7')]?_0x20d75f['address']:'anonymous'+random[_0xfe9e('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x4325a6){var _0xd60e70=_[_0xfe9e('0x9')](_0x4325a6['value']);if(_0xd60e70&&_0xd60e70[_0xfe9e('0xa')]){if(_0xd60e70[_0xfe9e('0xa')]==_0xd60e70[_0xfe9e('0x7')]){return _0xd60e70['name'][_0xfe9e('0xb')](0x0,_0xd60e70['name'][_0xfe9e('0xc')]('@'));}var _0x318158=_0xd60e70[_0xfe9e('0xa')][_0xfe9e('0xd')](/\s+/);return _0x318158[_0xfe9e('0xe')]>0x1?_0x318158[_0xfe9e('0xf')](0x0,-0x1)[_0xfe9e('0x10')]('\x20'):_0xd60e70[_0xfe9e('0xa')];}return _0xfe9e('0x11');}function getLastName(_0x551d72){var _0x2805cb=_[_0xfe9e('0x9')](_0x551d72['value']);if(_0x2805cb&&_0x2805cb[_0xfe9e('0xa')]){var _0x11d24e=_0x2805cb[_0xfe9e('0xa')][_0xfe9e('0xd')](/\s+/);return _0x11d24e['length']>0x1?_0x11d24e['pop']():'';}return'';}function getMails(_0x44d746,_0x463125){var _0x152d44='';for(var _0x30ad77=0x0;_0x30ad77<_0x463125['value'][_0xfe9e('0xe')];_0x30ad77+=0x1){if(_0x463125[_0xfe9e('0x6')][_0x30ad77][_0xfe9e('0x7')]!==_0x44d746){if(!_[_0xfe9e('0x12')](_0x152d44)){_0x152d44+=',';}_0x152d44+=_0x463125['value'][_0x30ad77][_0xfe9e('0xa')]||_0x463125[_0xfe9e('0x6')][_0x30ad77][_0xfe9e('0x7')]||'';_0x152d44+='\x20<';_0x152d44+=_0x463125[_0xfe9e('0x6')][_0x30ad77][_0xfe9e('0x7')]?_0x463125['value'][_0x30ad77]['address']:_0xfe9e('0x13')+random[_0xfe9e('0x8')](0x6)+_0xfe9e('0x14');_0x152d44+='>';}}return _0x152d44;}function parseEmail(_0x2a2c5d,_0x1ad37a,_0x147ae5){if(_0x1ad37a[_0xfe9e('0x15')]){var _0xb5d636=/