From: support
Date: Mon, 12 Dec 2022 12:07:30 +0000 (+0000)
Subject: Built motion from commit c738b9ac.|2.6.25
X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%22%7B%7Blicense.fax?a=commitdiff_plain;h=cfb93b9f69549d6dca0780c711e4c156973a91e9;p=motion2.git
Built motion from commit c738b9ac.|2.6.25
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 6539caf..f2aabf3 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-12-07T16:42:09.571Z",
+ "time": "2022-12-12T11:59:54.992Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 3a83087..3634c12 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-12-07T16:42:09.571Z",
+ "time": "2022-12-12T11:59:54.992Z",
"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 78022db..3bcaa63 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 _0xb0a8=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot'];(function(_0x181cf9,_0x240729){var _0x1704d8=function(_0xf0734e){while(--_0xf0734e){_0x181cf9['push'](_0x181cf9['shift']());}};_0x1704d8(++_0x240729);}(_0xb0a8,0x1c2));var _0x8b0a=function(_0x18b91c,_0x11b3b9){_0x18b91c=_0x18b91c-0x0;var _0x2e7e57=_0xb0a8[_0x18b91c];return _0x2e7e57;};'use strict';var Sequelize=require(_0x8b0a('0x0'));module[_0x8b0a('0x1')]={'name':{'type':Sequelize[_0x8b0a('0x2')],'get':function(_0x118780){return this[_0x8b0a('0x3')](_0x8b0a('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8b0a('0x5'),_0x8b0a('0x6'),_0x8b0a('0x7'),_0x8b0a('0x8'),_0x8b0a('0x9'),_0x8b0a('0xa'),_0x8b0a('0xb'),_0x8b0a('0xc')]],'msg':_0x8b0a('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x8b0a('0xe')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x8b0a('0xe')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x8b0a('0xf')},'data4':{'type':Sequelize[_0x8b0a('0xe')](0x1000),'comments':_0x8b0a('0x10')},'data5':{'type':Sequelize[_0x8b0a('0xe')](0x1000),'comments':_0x8b0a('0x11')},'data6':{'type':Sequelize[_0x8b0a('0xe')],'comments':_0x8b0a('0x12')},'data7':{'type':Sequelize[_0x8b0a('0x13')],'comments':_0x8b0a('0x14')}};
\ No newline at end of file
+var _0x72a4=['jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration'];(function(_0x2aa34a,_0x4c8fe2){var _0x1ffe88=function(_0x127172){while(--_0x127172){_0x2aa34a['push'](_0x2aa34a['shift']());}};_0x1ffe88(++_0x4c8fe2);}(_0x72a4,0x1c5));var _0x472a=function(_0x21a9cf,_0x51f954){_0x21a9cf=_0x21a9cf-0x0;var _0x5d4ba7=_0x72a4[_0x21a9cf];return _0x5d4ba7;};'use strict';var Sequelize=require('sequelize');module[_0x472a('0x0')]={'name':{'type':Sequelize[_0x472a('0x1')],'get':function(_0x305d3e){return this['getDataValue'](_0x472a('0x2'));}},'action':{'type':Sequelize[_0x472a('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x472a('0x4'),_0x472a('0x5'),'motionbar',_0x472a('0x6'),_0x472a('0x7'),_0x472a('0x8'),'bot',_0x472a('0x9')]],'msg':_0x472a('0xa')}},'comment':_0x472a('0xa')},'data1':{'type':Sequelize[_0x472a('0x3')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x472a('0xb')},'data3':{'type':Sequelize[_0x472a('0x3')](0x1000),'comment':_0x472a('0xc')},'data4':{'type':Sequelize[_0x472a('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x472a('0xd')},'data6':{'type':Sequelize['STRING'],'comments':_0x472a('0xe')},'data7':{'type':Sequelize[_0x472a('0xf')],'comments':_0x472a('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index e3e8380..86edeb2 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 _0x5682=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','body','Action','params','catch','find','rimraf','fast-json-patch','bluebird','mustache','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5682,0x115));var _0x2568=function(_0x451b1f,_0x45d602){_0x451b1f=_0x451b1f-0x0;var _0xc242fa=_0x5682[_0x451b1f];return _0xc242fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2568('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2568('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2568('0x2'));var Mustache=require(_0x2568('0x3'));var util=require(_0x2568('0x4'));var path=require(_0x2568('0x5'));var sox=require(_0x2568('0x6'));var csv=require(_0x2568('0x7'));var ejs=require(_0x2568('0x8'));var fs=require('fs');var fs_extra=require(_0x2568('0x9'));var _=require(_0x2568('0xa'));var squel=require(_0x2568('0xb'));var crypto=require(_0x2568('0xc'));var jsforce=require(_0x2568('0xd'));var deskjs=require(_0x2568('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2568('0xf'));var Papa=require('papaparse');var Redis=require(_0x2568('0x10'));var authService=require(_0x2568('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2568('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2568('0x13'));var utils=require(_0x2568('0x14'));var config=require(_0x2568('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2568('0x16'))['db'];function respondWithStatusCode(_0x462bb3,_0x5558bb){_0x5558bb=_0x5558bb||0xcc;return function(_0x5bd9dc){if(_0x5bd9dc){return _0x462bb3[_0x2568('0x17')](_0x5558bb);}return _0x462bb3[_0x2568('0x18')](_0x5558bb)[_0x2568('0x19')]();};}function respondWithResult(_0x4d115f,_0xdb3a9){_0xdb3a9=_0xdb3a9||0xc8;return function(_0x237bdd){if(_0x237bdd){return _0x4d115f[_0x2568('0x18')](_0xdb3a9)['json'](_0x237bdd);}};}function respondWithFilteredResult(_0x5fe3a2,_0x52d7c7){return function(_0x242d8f){if(_0x242d8f){var _0x19d317=typeof _0x52d7c7[_0x2568('0x1a')]===_0x2568('0x1b')&&typeof _0x52d7c7[_0x2568('0x1c')]==='undefined';var _0x31279b=_0x242d8f[_0x2568('0x1d')];var _0x1357ef=_0x19d317?0x0:_0x52d7c7[_0x2568('0x1a')];var _0x4cfa12=_0x19d317?_0x242d8f['count']:_0x52d7c7['offset']+_0x52d7c7[_0x2568('0x1c')];var _0x413e4a;if(_0x4cfa12>=_0x31279b){_0x4cfa12=_0x31279b;_0x413e4a=0xc8;}else{_0x413e4a=0xce;}_0x5fe3a2[_0x2568('0x18')](_0x413e4a);return _0x5fe3a2[_0x2568('0x1e')](_0x2568('0x1f'),_0x1357ef+'-'+_0x4cfa12+'/'+_0x31279b)[_0x2568('0x20')](_0x242d8f);}return null;};}function patchUpdates(_0x13e560){return function(_0x2d0c8c){try{jsonpatch[_0x2568('0x21')](_0x2d0c8c,_0x13e560,!![]);}catch(_0x502bc1){return BPromise[_0x2568('0x22')](_0x502bc1);}return _0x2d0c8c['save']();};}function saveUpdates(_0x391eb1,_0x53f0bd){return function(_0x5daf78){if(_0x5daf78){return _0x5daf78[_0x2568('0x23')](_0x391eb1)['then'](function(_0x189f79){return _0x189f79;});}return null;};}function removeEntity(_0x4d0ace,_0x527c2c){return function(_0x3bb0ed){if(_0x3bb0ed){return _0x3bb0ed[_0x2568('0x24')]()[_0x2568('0x25')](function(){_0x4d0ace[_0x2568('0x18')](0xcc)[_0x2568('0x19')]();});}};}function handleEntityNotFound(_0x1329c6,_0x3f2d4a){return function(_0x13dcfd){if(!_0x13dcfd){_0x1329c6[_0x2568('0x17')](0x194);}return _0x13dcfd;};}function handleError(_0x33a8ac,_0x3b644b){_0x3b644b=_0x3b644b||0x1f4;return function(_0x7d313){logger[_0x2568('0x26')](_0x7d313[_0x2568('0x27')]);if(_0x7d313[_0x2568('0x28')]){delete _0x7d313['name'];}_0x33a8ac['status'](_0x3b644b)[_0x2568('0x29')](_0x7d313);};}exports[_0x2568('0x23')]=function(_0x369a1a,_0x1aee82){if(_0x369a1a[_0x2568('0x2a')]['id']){delete _0x369a1a[_0x2568('0x2a')]['id'];}return db[_0x2568('0x2b')]['find']({'where':{'id':_0x369a1a[_0x2568('0x2c')]['id']}})[_0x2568('0x25')](handleEntityNotFound(_0x1aee82,null))[_0x2568('0x25')](saveUpdates(_0x369a1a[_0x2568('0x2a')],null))[_0x2568('0x25')](respondWithResult(_0x1aee82,null))[_0x2568('0x2d')](handleError(_0x1aee82,null));};exports[_0x2568('0x24')]=function(_0x27524d,_0x4f92d1){return db[_0x2568('0x2b')][_0x2568('0x2e')]({'where':{'id':_0x27524d['params']['id']}})[_0x2568('0x25')](handleEntityNotFound(_0x4f92d1,null))[_0x2568('0x25')](removeEntity(_0x4f92d1,null))[_0x2568('0x2d')](handleError(_0x4f92d1,null));};
\ No newline at end of file
+var _0x205b=['rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','end','sendStatus','stack','name','send','body','Action','find','params','catch','eml-format'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x205b,0x1ee));var _0xb205=function(_0x2770fe,_0x4e02ab){_0x2770fe=_0x2770fe-0x0;var _0x11c6cd=_0x205b[_0x2770fe];return _0x11c6cd;};'use strict';var emlformat=require(_0xb205('0x0'));var rimraf=require(_0xb205('0x1'));var zipdir=require(_0xb205('0x2'));var jsonpatch=require(_0xb205('0x3'));var rp=require('request-promise');var moment=require(_0xb205('0x4'));var BPromise=require(_0xb205('0x5'));var Mustache=require('mustache');var util=require(_0xb205('0x6'));var path=require('path');var sox=require(_0xb205('0x7'));var csv=require(_0xb205('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb205('0x9'));var squel=require(_0xb205('0xa'));var crypto=require(_0xb205('0xb'));var jsforce=require(_0xb205('0xc'));var deskjs=require(_0xb205('0xd'));var toCsv=require(_0xb205('0x8'));var querystring=require('querystring');var Papa=require(_0xb205('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb205('0xf'));var as=require(_0xb205('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb205('0x11'))(_0xb205('0x12'));var utils=require(_0xb205('0x13'));var config=require(_0xb205('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb205('0x15'))['db'];function respondWithStatusCode(_0x4df8fb,_0x2955d4){_0x2955d4=_0x2955d4||0xcc;return function(_0x9d4e59){if(_0x9d4e59){return _0x4df8fb['sendStatus'](_0x2955d4);}return _0x4df8fb['status'](_0x2955d4)['end']();};}function respondWithResult(_0x17ad85,_0x341a43){_0x341a43=_0x341a43||0xc8;return function(_0x208c38){if(_0x208c38){return _0x17ad85[_0xb205('0x16')](_0x341a43)[_0xb205('0x17')](_0x208c38);}};}function respondWithFilteredResult(_0x230bd7,_0x272463){return function(_0x53b122){if(_0x53b122){var _0x5588b5=typeof _0x272463['offset']===_0xb205('0x18')&&typeof _0x272463[_0xb205('0x19')]===_0xb205('0x18');var _0x3647ba=_0x53b122[_0xb205('0x1a')];var _0x3a656d=_0x5588b5?0x0:_0x272463[_0xb205('0x1b')];var _0x25b53c=_0x5588b5?_0x53b122[_0xb205('0x1a')]:_0x272463[_0xb205('0x1b')]+_0x272463['limit'];var _0x55c01d;if(_0x25b53c>=_0x3647ba){_0x25b53c=_0x3647ba;_0x55c01d=0xc8;}else{_0x55c01d=0xce;}_0x230bd7['status'](_0x55c01d);return _0x230bd7[_0xb205('0x1c')](_0xb205('0x1d'),_0x3a656d+'-'+_0x25b53c+'/'+_0x3647ba)[_0xb205('0x17')](_0x53b122);}return null;};}function patchUpdates(_0x1b88b3){return function(_0x223a2e){try{jsonpatch['apply'](_0x223a2e,_0x1b88b3,!![]);}catch(_0x26efaf){return BPromise[_0xb205('0x1e')](_0x26efaf);}return _0x223a2e[_0xb205('0x1f')]();};}function saveUpdates(_0x22cd68,_0xb784a9){return function(_0x56c1a8){if(_0x56c1a8){return _0x56c1a8[_0xb205('0x20')](_0x22cd68)['then'](function(_0x406cbf){return _0x406cbf;});}return null;};}function removeEntity(_0xaac8f3,_0x19ed30){return function(_0x110b03){if(_0x110b03){return _0x110b03[_0xb205('0x21')]()[_0xb205('0x22')](function(){_0xaac8f3['status'](0xcc)[_0xb205('0x23')]();});}};}function handleEntityNotFound(_0xea3ff3,_0x326f2a){return function(_0x109098){if(!_0x109098){_0xea3ff3[_0xb205('0x24')](0x194);}return _0x109098;};}function handleError(_0x27ac7a,_0x3767c0){_0x3767c0=_0x3767c0||0x1f4;return function(_0x47c51){logger['error'](_0x47c51[_0xb205('0x25')]);if(_0x47c51[_0xb205('0x26')]){delete _0x47c51[_0xb205('0x26')];}_0x27ac7a[_0xb205('0x16')](_0x3767c0)[_0xb205('0x27')](_0x47c51);};}exports[_0xb205('0x20')]=function(_0x5d41f3,_0x10f114){if(_0x5d41f3[_0xb205('0x28')]['id']){delete _0x5d41f3['body']['id'];}return db[_0xb205('0x29')][_0xb205('0x2a')]({'where':{'id':_0x5d41f3[_0xb205('0x2b')]['id']}})[_0xb205('0x22')](handleEntityNotFound(_0x10f114,null))[_0xb205('0x22')](saveUpdates(_0x5d41f3['body'],null))[_0xb205('0x22')](respondWithResult(_0x10f114,null))[_0xb205('0x2c')](handleError(_0x10f114,null));};exports[_0xb205('0x21')]=function(_0x4d1b3b,_0x2b2b8a){return db[_0xb205('0x29')][_0xb205('0x2a')]({'where':{'id':_0x4d1b3b[_0xb205('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2b2b8a,null))[_0xb205('0x22')](removeEntity(_0x2b2b8a,null))[_0xb205('0x2c')](handleError(_0x2b2b8a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index e7efe16..cf3dc05 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 _0x1892=['bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','../../config/logger','api'];(function(_0x1ea6e7,_0x475177){var _0x1fb0a6=function(_0x2e74d5){while(--_0x2e74d5){_0x1ea6e7['push'](_0x1ea6e7['shift']());}};_0x1fb0a6(++_0x475177);}(_0x1892,0x8d));var _0x2189=function(_0x2bcf3b,_0x2443d7){_0x2bcf3b=_0x2bcf3b-0x0;var _0x1d2898=_0x1892[_0x2bcf3b];return _0x1d2898;};'use strict';var _=require(_0x2189('0x0'));var util=require('util');var logger=require(_0x2189('0x1'))(_0x2189('0x2'));var moment=require('moment');var BPromise=require(_0x2189('0x3'));var rp=require(_0x2189('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2189('0x5'));var config=require(_0x2189('0x6'));var attributes=require(_0x2189('0x7'));module[_0x2189('0x8')]=function(_0x2370c6,_0xb42902){return _0x2370c6[_0x2189('0x9')](_0x2189('0xa'),attributes,{'tableName':_0x2189('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe211=['exports','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes'];(function(_0x183b3c,_0x34db3b){var _0x30e020=function(_0x4985ff){while(--_0x4985ff){_0x183b3c['push'](_0x183b3c['shift']());}};_0x30e020(++_0x34db3b);}(_0xe211,0xfb));var _0x1e21=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe211[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e21('0x0'));var util=require(_0x1e21('0x1'));var logger=require('../../config/logger')(_0x1e21('0x2'));var moment=require(_0x1e21('0x3'));var BPromise=require(_0x1e21('0x4'));var rp=require(_0x1e21('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e21('0x6'));var config=require(_0x1e21('0x7'));var attributes=require(_0x1e21('0x8'));module[_0x1e21('0x9')]=function(_0x21df74,_0x14f996){return _0x21df74[_0x1e21('0xa')](_0x1e21('0xb'),attributes,{'tableName':_0x1e21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 4874104..a1195dd 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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xd4029c,_0x17fb5b){var _0x1b5da2=function(_0x31b511){while(--_0x31b511){_0xd4029c['push'](_0xd4029c['shift']());}};_0x1b5da2(++_0x17fb5b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4a7cb3,_0x3ec4db){_0x4a7cb3=_0x4a7cb3-0x0;var _0x3b0f22=_0x8ef6[_0x4a7cb3];return _0x3b0f22;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Action,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Action,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x814b,0x1a2));var _0xb814=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x814b[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 64e9b98..432e009 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 _0x5301=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','delete','isAuthenticated','destroy','multer','util','path','connect-timeout','express'];(function(_0x1fec27,_0x512fcd){var _0x1ba273=function(_0x37d009){while(--_0x37d009){_0x1fec27['push'](_0x1fec27['shift']());}};_0x1ba273(++_0x512fcd);}(_0x5301,0x10b));var _0x1530=function(_0x162af8,_0x18b413){_0x162af8=_0x162af8-0x0;var _0x4216ff=_0x5301[_0x162af8];return _0x4216ff;};'use strict';var multer=require(_0x1530('0x0'));var util=require(_0x1530('0x1'));var path=require(_0x1530('0x2'));var timeout=require(_0x1530('0x3'));var express=require(_0x1530('0x4'));var router=express[_0x1530('0x5')]();var fs_extra=require(_0x1530('0x6'));var auth=require(_0x1530('0x7'));var interaction=require(_0x1530('0x8'));var config=require(_0x1530('0x9'));var controller=require(_0x1530('0xa'));router[_0x1530('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x1530('0xc')]);router[_0x1530('0xd')]('/:id',auth[_0x1530('0xe')](),controller[_0x1530('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x5016=['../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','/:id','destroy','multer','util','path','Router','fs-extra'];(function(_0x13b774,_0x20ee63){var _0x17da42=function(_0x234a4f){while(--_0x234a4f){_0x13b774['push'](_0x13b774['shift']());}};_0x17da42(++_0x20ee63);}(_0x5016,0x8a));var _0x6501=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x5016[_0x3cae69];return _0x3128eb;};'use strict';var multer=require(_0x6501('0x0'));var util=require(_0x6501('0x1'));var path=require(_0x6501('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6501('0x3')]();var fs_extra=require(_0x6501('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6501('0x5'));var config=require(_0x6501('0x6'));var controller=require(_0x6501('0x7'));router['put']('/:id',auth[_0x6501('0x8')](),controller['update']);router['delete'](_0x6501('0x9'),auth[_0x6501('0x8')](),controller[_0x6501('0xa')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 33b6a5e..3c2b8d7 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x331f75,_0x187c0f){var _0x4cf7b6=function(_0xd700c3){while(--_0xd700c3){_0x331f75['push'](_0x331f75['shift']());}};_0x4cf7b6(++_0x187c0f);}(_0xeda8,0x104));var _0x8eda=function(_0x4a57c8,_0x1edea3){_0x4a57c8=_0x4a57c8-0x0;var _0x95a17=_0xeda8[_0x4a57c8];return _0x95a17;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
+var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x55e2a7,_0x99e395){var _0x5599d5=function(_0x1025bd){while(--_0x1025bd){_0x55e2a7['push'](_0x55e2a7['shift']());}};_0x5599d5(++_0x99e395);}(_0xd8fb,0x99));var _0xbd8f=function(_0x39ba52,_0x852186){_0x39ba52=_0x39ba52-0x0;var _0x3859e2=_0xd8fb[_0x39ba52];return _0x3859e2;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 0e0c94c..324591c 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 _0x46c5=['fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','params','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','parse','debug','sequelize','cross_join','MAX(%s)','IS\x20NULL','IS\x20NOT\x20NULL','ValidationErrorItem','from','clone','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','toString','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SELECT','run','runReport','Sequelize','keyBy','groupBy','Limited\x20Query:','rimraf','zip-dir'];(function(_0x1f20b5,_0xf0a03e){var _0x45b461=function(_0x1fe923){while(--_0x1fe923){_0x1f20b5['push'](_0x1f20b5['shift']());}};_0x45b461(++_0xf0a03e);}(_0x46c5,0x14c));var _0x546c=function(_0x2a8508,_0x3c1ba1){_0x2a8508=_0x2a8508-0x0;var _0x30388a=_0x46c5[_0x2a8508];return _0x30388a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x546c('0x0'));var zipdir=require(_0x546c('0x1'));var jsonpatch=require(_0x546c('0x2'));var rp=require(_0x546c('0x3'));var moment=require(_0x546c('0x4'));var BPromise=require(_0x546c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x546c('0x6'));var csv=require('to-csv');var ejs=require(_0x546c('0x7'));var fs=require('fs');var fs_extra=require(_0x546c('0x8'));var _=require(_0x546c('0x9'));var squel=require(_0x546c('0xa'));var crypto=require(_0x546c('0xb'));var jsforce=require(_0x546c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x546c('0xd'));var querystring=require(_0x546c('0xe'));var Papa=require(_0x546c('0xf'));var Redis=require(_0x546c('0x10'));var authService=require(_0x546c('0x11'));var qs=require(_0x546c('0x12'));var as=require(_0x546c('0x13'));var hardwareService=require(_0x546c('0x14'));var logger=require(_0x546c('0x15'))(_0x546c('0x16'));var utils=require(_0x546c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x546c('0x18'));var db=require(_0x546c('0x19'))['db'];var dbH=require(_0x546c('0x19'))['dbH'];function respondWithStatusCode(_0x1a4209,_0x4c2d52){_0x4c2d52=_0x4c2d52||0xcc;return function(_0x11a785){if(_0x11a785){return _0x1a4209[_0x546c('0x1a')](_0x4c2d52);}return _0x1a4209[_0x546c('0x1b')](_0x4c2d52)['end']();};}function respondWithResult(_0x422d88,_0x563c0d){_0x563c0d=_0x563c0d||0xc8;return function(_0x170955){if(_0x170955){return _0x422d88[_0x546c('0x1b')](_0x563c0d)['json'](_0x170955);}};}function respondWithFilteredResult(_0x1f06fb,_0x25970d){return function(_0x3a86de){if(_0x3a86de){var _0x257aa9=typeof _0x25970d['offset']==='undefined'&&typeof _0x25970d[_0x546c('0x1c')]===_0x546c('0x1d');var _0x211ea6=_0x3a86de[_0x546c('0x1e')];var _0x493bc0=_0x257aa9?0x0:_0x25970d[_0x546c('0x1f')];var _0x181791=_0x257aa9?_0x3a86de[_0x546c('0x1e')]:_0x25970d['offset']+_0x25970d[_0x546c('0x1c')];var _0x131ad8;if(_0x181791>=_0x211ea6){_0x181791=_0x211ea6;_0x131ad8=0xc8;}else{_0x131ad8=0xce;}_0x1f06fb[_0x546c('0x1b')](_0x131ad8);return _0x1f06fb[_0x546c('0x20')](_0x546c('0x21'),_0x493bc0+'-'+_0x181791+'/'+_0x211ea6)['json'](_0x3a86de);}return null;};}function patchUpdates(_0x520b1b){return function(_0x32aeb3){try{jsonpatch[_0x546c('0x22')](_0x32aeb3,_0x520b1b,!![]);}catch(_0x13381d){return BPromise['reject'](_0x13381d);}return _0x32aeb3[_0x546c('0x23')]();};}function saveUpdates(_0xf7f2c3,_0x2e708e){return function(_0x3e022d){if(_0x3e022d){return _0x3e022d[_0x546c('0x24')](_0xf7f2c3)[_0x546c('0x25')](function(_0x48ab17){return _0x48ab17;});}return null;};}function removeEntity(_0x81be4c,_0x120b80){return function(_0x451379){if(_0x451379){return _0x451379[_0x546c('0x26')]()['then'](function(){var _0x55308b=_0x451379[_0x546c('0x27')]({'plain':!![]});var _0x51aa05=_0x546c('0x28');return db[_0x546c('0x29')][_0x546c('0x26')]({'where':{'type':_0x51aa05,'resourceId':_0x55308b['id']}})['then'](function(){return _0x451379;});})[_0x546c('0x25')](function(){_0x81be4c[_0x546c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48d124,_0x57aeb3){return function(_0x2cd5e0){if(!_0x2cd5e0){_0x48d124[_0x546c('0x1a')](0x194);}return _0x2cd5e0;};}function handleError(_0x45350c,_0x3f9503){_0x3f9503=_0x3f9503||0x1f4;return function(_0x11c7a3){logger[_0x546c('0x2a')](_0x11c7a3['stack']);if(_0x11c7a3[_0x546c('0x2b')]){delete _0x11c7a3[_0x546c('0x2b')];}_0x45350c['status'](_0x3f9503)[_0x546c('0x2c')](_0x11c7a3);};}exports['index']=function(_0x12f1e5,_0x3e4ef3){var _0x32f5d6={},_0x52bca9={},_0xc603a1={'count':0x0,'rows':[]};var _0xddddb3=_[_0x546c('0x2d')](db[_0x546c('0x2e')][_0x546c('0x2f')],function(_0x15c1bf){return{'name':_0x15c1bf[_0x546c('0x30')],'type':_0x15c1bf[_0x546c('0x31')]['key']};});_0x52bca9[_0x546c('0x32')]=_[_0x546c('0x2d')](_0xddddb3,'name');_0x52bca9[_0x546c('0x33')]=_[_0x546c('0x34')](_0x12f1e5[_0x546c('0x33')]);_0x52bca9[_0x546c('0x35')]=_[_0x546c('0x36')](_0x52bca9['model'],_0x52bca9['query']);_0x32f5d6['attributes']=_[_0x546c('0x36')](_0x52bca9[_0x546c('0x32')],qs[_0x546c('0x37')](_0x12f1e5[_0x546c('0x33')]['fields']));_0x32f5d6[_0x546c('0x38')]=_0x32f5d6[_0x546c('0x38')][_0x546c('0x39')]?_0x32f5d6['attributes']:_0x52bca9['model'];if(!_0x12f1e5[_0x546c('0x33')]['hasOwnProperty'](_0x546c('0x3a'))){_0x32f5d6[_0x546c('0x1c')]=qs['limit'](_0x12f1e5['query']['limit']);_0x32f5d6['offset']=qs['offset'](_0x12f1e5[_0x546c('0x33')][_0x546c('0x1f')]);}_0x32f5d6[_0x546c('0x3b')]=qs['sort'](_0x12f1e5[_0x546c('0x33')]['sort']);_0x32f5d6[_0x546c('0x3c')]=qs['filters'](_[_0x546c('0x3d')](_0x12f1e5['query'],_0x52bca9['filters']),_0xddddb3);if(_0x12f1e5[_0x546c('0x33')]['filter']){_0x32f5d6[_0x546c('0x3c')]=_[_0x546c('0x3e')](_0x32f5d6['where'],{'$or':_[_0x546c('0x2d')](_0xddddb3,function(_0x5c915a){if(_0x5c915a['type']!==_0x546c('0x3f')){var _0x23a68b={};_0x23a68b[_0x5c915a[_0x546c('0x2b')]]={'$like':'%'+_0x12f1e5[_0x546c('0x33')][_0x546c('0x40')]+'%'};return _0x23a68b;}})});}_0x32f5d6=_[_0x546c('0x3e')]({},_0x32f5d6,_0x12f1e5[_0x546c('0x41')]);var _0x3e8372={'where':_0x32f5d6[_0x546c('0x3c')]};return db[_0x546c('0x2e')][_0x546c('0x1e')](_0x3e8372)[_0x546c('0x25')](function(_0x123ab7){_0xc603a1['count']=_0x123ab7;if(_0x12f1e5[_0x546c('0x33')][_0x546c('0x42')]){_0x32f5d6['include']=[{'all':!![]}];}return db[_0x546c('0x2e')][_0x546c('0x43')](_0x32f5d6);})[_0x546c('0x25')](function(_0x3affe9){_0xc603a1[_0x546c('0x44')]=_0x3affe9;return _0xc603a1;})['then'](respondWithFilteredResult(_0x3e4ef3,_0x32f5d6))[_0x546c('0x45')](handleError(_0x3e4ef3,null));};exports[_0x546c('0x46')]=function(_0x28bbc2,_0x397503){var _0x2e37be={'raw':![],'where':{'id':_0x28bbc2['params']['id']}},_0x1fccf6={};_0x1fccf6[_0x546c('0x32')]=_['keys'](db['AnalyticCustomReport'][_0x546c('0x2f')]);_0x1fccf6[_0x546c('0x33')]=_[_0x546c('0x34')](_0x28bbc2[_0x546c('0x33')]);_0x1fccf6['filters']=_[_0x546c('0x36')](_0x1fccf6[_0x546c('0x32')],_0x1fccf6[_0x546c('0x33')]);_0x2e37be['attributes']=_['intersection'](_0x1fccf6[_0x546c('0x32')],qs[_0x546c('0x37')](_0x28bbc2[_0x546c('0x33')]['fields']));_0x2e37be[_0x546c('0x38')]=_0x2e37be['attributes']['length']?_0x2e37be[_0x546c('0x38')]:_0x1fccf6['model'];if(_0x28bbc2[_0x546c('0x33')][_0x546c('0x42')]){_0x2e37be[_0x546c('0x47')]=[{'all':!![]}];}_0x2e37be=_[_0x546c('0x3e')]({},_0x2e37be,_0x28bbc2[_0x546c('0x41')]);return db[_0x546c('0x2e')][_0x546c('0x48')](_0x2e37be)[_0x546c('0x25')](handleEntityNotFound(_0x397503,null))[_0x546c('0x25')](respondWithResult(_0x397503,null))['catch'](handleError(_0x397503,null));};exports[_0x546c('0x49')]=function(_0xe0c485,_0x4b46b2){return db[_0x546c('0x2e')]['create'](_0xe0c485[_0x546c('0x4a')],{})[_0x546c('0x25')](function(_0x9b71ef){var _0x4beb07=_0xe0c485[_0x546c('0x4b')][_0x546c('0x27')]({'plain':!![]});if(!_0x4beb07)throw new Error(_0x546c('0x4c'));if(_0x4beb07[_0x546c('0x4d')]===_0x546c('0x4b')){var _0x5abae5=_0x9b71ef[_0x546c('0x27')]({'plain':!![]});var _0x104116=_0x546c('0x4e');return db[_0x546c('0x4f')][_0x546c('0x48')]({'where':{'name':_0x104116,'userProfileId':_0x4beb07[_0x546c('0x50')]},'raw':!![]})[_0x546c('0x25')](function(_0x4554d8){if(_0x4554d8&&_0x4554d8[_0x546c('0x51')]===0x0){return db[_0x546c('0x29')][_0x546c('0x49')]({'name':_0x5abae5[_0x546c('0x2b')],'resourceId':_0x5abae5['id'],'type':'CustomReports','sectionId':_0x4554d8['id']},{})[_0x546c('0x25')](function(){return _0x9b71ef;});}else{return _0x9b71ef;}})[_0x546c('0x45')](function(_0x24a155){logger[_0x546c('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24a155);throw _0x24a155;});}return _0x9b71ef;})['then'](respondWithResult(_0x4b46b2,0xc9))[_0x546c('0x45')](handleError(_0x4b46b2,null));};exports[_0x546c('0x24')]=function(_0xe9cacf,_0x22ba06){if(_0xe9cacf[_0x546c('0x4a')]['id']){delete _0xe9cacf[_0x546c('0x4a')]['id'];}return db[_0x546c('0x2e')][_0x546c('0x48')]({'where':{'id':_0xe9cacf[_0x546c('0x52')]['id']}})[_0x546c('0x25')](handleEntityNotFound(_0x22ba06,null))[_0x546c('0x25')](saveUpdates(_0xe9cacf['body'],null))[_0x546c('0x25')](respondWithResult(_0x22ba06,null))['catch'](handleError(_0x22ba06,null));};exports['destroy']=function(_0x95d619,_0x24a97c){return db[_0x546c('0x2e')][_0x546c('0x48')]({'where':{'id':_0x95d619[_0x546c('0x52')]['id']}})[_0x546c('0x25')](handleEntityNotFound(_0x24a97c,null))[_0x546c('0x25')](removeEntity(_0x24a97c,null))[_0x546c('0x45')](handleError(_0x24a97c,null));};exports[_0x546c('0x53')]=function(_0x281509,_0x326d19){var _0x5bb691=0xa;var _0x35e90f=[_0x546c('0x54'),_0x546c('0x55'),_0x546c('0x56'),'cross_join'];var _0x15ace1={'SUM':_0x546c('0x57'),'COUNT':_0x546c('0x58'),'COUNT DISTINCT':_0x546c('0x59'),'MAX':'MAX(%s)','MIN':_0x546c('0x5a'),'AVG':_0x546c('0x5b'),'GROUP_CONCAT':_0x546c('0x5c'),'GROUP_CONCAT ASC':_0x546c('0x5d'),'GROUP_CONCAT DESC':_0x546c('0x5e')};var _0x4f7ce3={'SEC_TO_TIME':_0x546c('0x5f'),'DATE':_0x546c('0x60'),'HOUR':_0x546c('0x61'),'ROUND':_0x546c('0x62'),'UNIX_TIMESTAMP':_0x546c('0x63')};var _0x578ef9=function(_0x449b42){return!_[_0x546c('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x546c('0x65'),_0x546c('0x66')],_0x449b42);};var _0x1176dc=function(_0x554111){if(!_0x554111||!_0x554111[_0x546c('0x67')][_0x546c('0x39')]){return'';}for(var _0x519c63='(',_0x20e2f3=0x0;_0x20e2f3<_0x554111[_0x546c('0x67')][_0x546c('0x39')];_0x20e2f3+=0x1){_0x20e2f3>0x0&&(_0x519c63+='\x20'+_0x554111[_0x546c('0x68')]+'\x20');_0x519c63+=_0x554111[_0x546c('0x67')][_0x20e2f3]['group']?_0x1176dc(_0x554111['rules'][_0x20e2f3][_0x546c('0x69')]):_0x554111[_0x546c('0x67')][_0x20e2f3][_0x546c('0x6a')]+'\x20'+_0x554111[_0x546c('0x67')][_0x20e2f3][_0x546c('0x6b')]+(_0x578ef9(_0x554111['rules'][_0x20e2f3][_0x546c('0x6b')])?'\x20'+_0x554111[_0x546c('0x67')][_0x20e2f3][_0x546c('0x6c')]:'');}return _0x519c63+')';};var _0x34901b={'where':{'id':_0x281509[_0x546c('0x52')]['id']}},_0x124f6b,_0x1a53f8,_0x4caf33,_0xf931ea,_0x11b133;_0x34901b=_[_0x546c('0x3e')]({},_0x34901b,_0x281509[_0x546c('0x41')]);return db[_0x546c('0x2e')][_0x546c('0x48')](_0x34901b)['then'](function(_0x1d5bd6){if(_0x1d5bd6){_0x124f6b=_0x1d5bd6;return _0x1d5bd6[_0x546c('0x6d')]();}return null;})[_0x546c('0x25')](function(_0x2530d5){if(_0x2530d5){if(!_0x2530d5[_0x546c('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x546c('0x6e'),0x193);}_0x1a53f8=_0x2530d5;return db[_0x546c('0x6f')][_0x546c('0x43')]({'raw':!![]});}return null;})['then'](function(_0x29f1ca){if(_0x29f1ca){_0x4caf33=_['keyBy'](_0x29f1ca,'id');var _0x3558ed;var _0xc3d45c=squel[_0x546c('0x70')]();_0xc3d45c['from'](_0x124f6b['table']);for(var _0x3d0177=0x0;_0x3d0177<_0x1a53f8['length'];_0x3d0177+=0x1){_0x3558ed=_0x1a53f8[_0x3d0177][_0x546c('0x71')]?_0x4caf33[_0x1a53f8[_0x3d0177][_0x546c('0x71')]][_0x546c('0x72')]:_0x1a53f8[_0x3d0177]['field'];_0x3558ed=_0x1a53f8[_0x3d0177][_0x546c('0x73')]?_['replace'](_0x15ace1[_0x1a53f8[_0x3d0177][_0x546c('0x73')]],'%s',_0x3558ed):_0x3558ed;_0x3558ed=_0x1a53f8[_0x3d0177][_0x546c('0x74')]?_[_0x546c('0x75')](_0x4f7ce3[_0x1a53f8[_0x3d0177][_0x546c('0x74')]],'%s',_0x3558ed):_0x3558ed;if(_0x1a53f8[_0x3d0177]['groupBy']){_0xc3d45c[_0x546c('0x69')](_0x3558ed);}_0x1a53f8[_0x3d0177][_0x546c('0x76')]&&_0xc3d45c[_0x546c('0x3b')](_0x3558ed,_0x1a53f8[_0x3d0177][_0x546c('0x76')]===_0x546c('0x77')?![]:!![]);_0xc3d45c[_0x546c('0x6a')](_0x3558ed,_0x1a53f8[_0x3d0177][_0x546c('0x78')]||_0x3558ed);}if(_0x124f6b[_0x546c('0x79')]){_0x124f6b[_0x546c('0x79')]=JSON['parse'](_0x124f6b[_0x546c('0x79')]);for(var _0x32f059=0x0;_0x32f059<_0x124f6b[_0x546c('0x79')][_0x546c('0x39')];_0x32f059+=0x1){if(_0x124f6b[_0x546c('0x79')][_0x32f059][_0x546c('0x31')]&&_['includes'](_0x35e90f,_0x124f6b[_0x546c('0x79')][_0x32f059][_0x546c('0x31')])&&_0x124f6b[_0x546c('0x79')][_0x32f059]['parentKey']&&_0x124f6b['joins'][_0x32f059][_0x546c('0x7a')]&&_0x124f6b[_0x546c('0x79')][_0x32f059][_0x546c('0x7b')]){_0xc3d45c[_0x124f6b[_0x546c('0x79')][_0x32f059][_0x546c('0x31')]](_0x124f6b[_0x546c('0x79')][_0x32f059][_0x546c('0x7a')],null,util[_0x546c('0x74')](_0x546c('0x7c'),_0x124f6b[_0x546c('0x7d')],_0x124f6b[_0x546c('0x79')][_0x32f059][_0x546c('0x7e')],_0x124f6b[_0x546c('0x79')][_0x32f059][_0x546c('0x7a')],_0x124f6b[_0x546c('0x79')][_0x32f059][_0x546c('0x7b')]));}}}if(_0x124f6b[_0x546c('0x7f')]){_0x124f6b[_0x546c('0x7f')]=JSON[_0x546c('0x80')](_0x124f6b[_0x546c('0x7f')]);_0xc3d45c[_0x546c('0x3c')](_0x1176dc(_0x124f6b['conditions'][_0x546c('0x69')]));}_0x11b133=_0xc3d45c['clone']();_0xc3d45c['limit'](_0x5bb691);_0xc3d45c['offset'](0x0);logger[_0x546c('0x81')]('Limited\x20Query:',_0xc3d45c['toString']());return dbH['sequelize'][_0x546c('0x33')](_0xc3d45c['toString'](),{'type':dbH[_0x546c('0x82')]['QueryTypes']['SELECT']});}})[_0x546c('0x25')](respondWithResult(_0x326d19,null))[_0x546c('0x45')](handleError(_0x326d19,null));};function runReport(_0x5c186e,_0x14c4b5,_0x18a9c0){var _0x10aab2=_0x14c4b5[_0x546c('0x2b')];var _0x5625d4=0xa;var _0xb27452=[_0x546c('0x54'),_0x546c('0x55'),_0x546c('0x56'),_0x546c('0x83')];var _0x51f805={'SUM':_0x546c('0x57'),'COUNT':_0x546c('0x58'),'COUNT DISTINCT':_0x546c('0x59'),'MAX':_0x546c('0x84'),'MIN':_0x546c('0x5a'),'AVG':_0x546c('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x546c('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x48b8a6={'SEC_TO_TIME':_0x546c('0x5f'),'DATE':'DATE(%s)','HOUR':_0x546c('0x61'),'ROUND':_0x546c('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1a08b6=function(_0x44ad9d){return!_[_0x546c('0x64')]([_0x546c('0x85'),_0x546c('0x86'),_0x546c('0x65'),_0x546c('0x66')],_0x44ad9d);};var _0x3ececa=function(_0x4cbdb0){if(!_0x4cbdb0||!_0x4cbdb0[_0x546c('0x67')]['length']){return'';}for(var _0x1f42a7='(',_0x3298d6=0x0;_0x3298d6<_0x4cbdb0['rules'][_0x546c('0x39')];_0x3298d6+=0x1){_0x3298d6>0x0&&(_0x1f42a7+='\x20'+_0x4cbdb0[_0x546c('0x68')]+'\x20');_0x1f42a7+=_0x4cbdb0[_0x546c('0x67')][_0x3298d6][_0x546c('0x69')]?_0x3ececa(_0x4cbdb0[_0x546c('0x67')][_0x3298d6]['group']):_0x4cbdb0[_0x546c('0x67')][_0x3298d6]['field']+'\x20'+_0x4cbdb0[_0x546c('0x67')][_0x3298d6]['condition']+(_0x1a08b6(_0x4cbdb0['rules'][_0x3298d6][_0x546c('0x6b')])?'\x20'+_0x4cbdb0['rules'][_0x3298d6]['value']:'');}return _0x1f42a7+')';};var _0xcba2c2={'where':{'id':_0x5c186e['id']}},_0x227bca,_0x45fd1d,_0x48fa7c,_0x582184,_0x458248;_0xcba2c2=_[_0x546c('0x3e')]({},_0xcba2c2,_0x18a9c0);return db[_0x546c('0x2e')][_0x546c('0x48')](_0xcba2c2)[_0x546c('0x25')](function(_0x11f294){if(_0x11f294){_0x227bca=_0x11f294;return _0x11f294[_0x546c('0x6d')]();}return null;})['then'](function(_0x3e4cc1){if(_0x3e4cc1){if(!_0x3e4cc1[_0x546c('0x39')]){throw new db['Sequelize'][(_0x546c('0x87'))](_0x546c('0x6e'),0x193);}_0x45fd1d=_0x3e4cc1;return db[_0x546c('0x6f')][_0x546c('0x43')]({'raw':!![]});}return null;})[_0x546c('0x25')](function(_0x24bd54){if(_0x24bd54){_0x48fa7c=_['keyBy'](_0x24bd54,'id');var _0x230666;var _0x17ae05=squel[_0x546c('0x70')]();_0x17ae05[_0x546c('0x88')](_0x227bca[_0x546c('0x7d')]);for(var _0x433e48=0x0;_0x433e48<_0x45fd1d['length'];_0x433e48+=0x1){_0x230666=_0x45fd1d[_0x433e48]['MetricId']?_0x48fa7c[_0x45fd1d[_0x433e48]['MetricId']][_0x546c('0x72')]:_0x45fd1d[_0x433e48][_0x546c('0x6a')];_0x230666=_0x45fd1d[_0x433e48][_0x546c('0x73')]?_[_0x546c('0x75')](_0x51f805[_0x45fd1d[_0x433e48][_0x546c('0x73')]],'%s',_0x230666):_0x230666;_0x230666=_0x45fd1d[_0x433e48][_0x546c('0x74')]?_[_0x546c('0x75')](_0x48b8a6[_0x45fd1d[_0x433e48][_0x546c('0x74')]],'%s',_0x230666):_0x230666;if(_0x45fd1d[_0x433e48]['groupBy']){_0x17ae05[_0x546c('0x69')](_0x230666);}_0x45fd1d[_0x433e48][_0x546c('0x76')]&&_0x17ae05['order'](_0x230666,_0x45fd1d[_0x433e48]['orderBy']==='DESC'?![]:!![]);_0x17ae05['field'](_0x230666,_0x45fd1d[_0x433e48][_0x546c('0x78')]||_0x230666);}if(_0x227bca[_0x546c('0x79')]){_0x227bca[_0x546c('0x79')]=JSON[_0x546c('0x80')](_0x227bca['joins']);for(var _0x4e0b0f=0x0;_0x4e0b0f<_0x227bca['joins'][_0x546c('0x39')];_0x4e0b0f+=0x1){if(_0x227bca[_0x546c('0x79')][_0x4e0b0f]['type']&&_[_0x546c('0x64')](_0xb27452,_0x227bca[_0x546c('0x79')][_0x4e0b0f]['type'])&&_0x227bca['joins'][_0x4e0b0f]['parentKey']&&_0x227bca['joins'][_0x4e0b0f]['foreignTable']&&_0x227bca[_0x546c('0x79')][_0x4e0b0f][_0x546c('0x7b')]){_0x17ae05[_0x227bca['joins'][_0x4e0b0f]['type']](_0x227bca[_0x546c('0x79')][_0x4e0b0f][_0x546c('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x227bca[_0x546c('0x7d')],_0x227bca[_0x546c('0x79')][_0x4e0b0f][_0x546c('0x7e')],_0x227bca['joins'][_0x4e0b0f][_0x546c('0x7a')],_0x227bca[_0x546c('0x79')][_0x4e0b0f]['foreignKey']));}}}if(_0x227bca['conditions']){_0x227bca[_0x546c('0x7f')]=JSON[_0x546c('0x80')](_0x227bca['conditions']);_0x17ae05[_0x546c('0x3c')](_0x3ececa(_0x227bca[_0x546c('0x7f')][_0x546c('0x69')]));}_0x458248=_0x17ae05[_0x546c('0x89')]();_0x17ae05[_0x546c('0x1c')](_0x5625d4);_0x17ae05[_0x546c('0x1f')](0x0);return;}})[_0x546c('0x25')](function(){if(_0x14c4b5[_0x546c('0x8a')]===_0x546c('0x8b')){return null;}var _0x30391b=_[_0x546c('0x3e')](_0x14c4b5,{'name':_0x14c4b5[_0x546c('0x8c')]||_0x14c4b5['name']||_0x227bca['name'],'basename':_0x10aab2,'savename':util[_0x546c('0x74')](_0x546c('0x8d'),_0x14c4b5[_0x546c('0x2b')]||_0x227bca['name'],require(_0x546c('0x8e'))['generate'](0x4),_0x14c4b5[_0x546c('0x8a')]||_0x546c('0x8f')),'reportId':_0x227bca['id'],'reportType':_0x546c('0x90')});return db[_0x546c('0x91')]['create'](_0x30391b,{'raw':!![]});})['then'](function(_0x395c6d){if(_0x227bca[_0x546c('0x7d')]===_0x546c('0x92')){_0x458248[_0x546c('0x3c')](_0x227bca[_0x546c('0x7d')]+_0x546c('0x93'),_0x14c4b5[_0x546c('0x94')],_0x14c4b5['endDate']);}else{_0x458248[_0x546c('0x3c')](_0x227bca[_0x546c('0x7d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14c4b5['startDate'],_0x14c4b5[_0x546c('0x95')]);}if(_0x395c6d){logger[_0x546c('0x96')]('Run\x20Query:',_0x458248['toString']());require(_0x546c('0x97'))[_0x546c('0x98')](path[_0x546c('0x54')](__dirname,_0x546c('0x99'),_0x395c6d[_0x546c('0x8a')]),[_0x395c6d['id'],_0x458248[_0x546c('0x9a')](),path[_0x546c('0x54')](__dirname,_0x546c('0x9b'),_0x395c6d[_0x546c('0x9c')]),_0x10aab2]);return _0x395c6d;}else{var _0x189eba=squel[_0x546c('0x70')]();_0x189eba[_0x546c('0x88')]('('+_0x458248[_0x546c('0x9a')]()+')',_0x546c('0x9d'));_0x189eba[_0x546c('0x6a')](_0x546c('0x9e'),_0x546c('0x1e'));_0x458248[_0x546c('0x1c')](_0x14c4b5[_0x546c('0x1c')]||_0x5625d4);_0x458248['offset'](_0x14c4b5['offset']||0x0);return dbH[_0x546c('0x82')]['query'](_0x189eba[_0x546c('0x9a')](),{'type':dbH[_0x546c('0x82')][_0x546c('0x9f')][_0x546c('0xa0')]})[_0x546c('0x25')](function(_0x5d72f5){if(!_0x5d72f5['length']){_0x582184=0x0;}else{_0x582184=_0x5d72f5[0x0][_0x546c('0x1e')]||0x0;}return dbH[_0x546c('0x82')][_0x546c('0x33')](_0x458248[_0x546c('0x9a')](),{'type':dbH[_0x546c('0x82')]['QueryTypes']['SELECT']});})[_0x546c('0x25')](function(_0x16a6d4){return{'rows':_0x16a6d4||[],'count':_0x582184};});}});}exports[_0x546c('0xa1')]=function(_0x4044f6,_0x3f05aa){return runReport(_0x4044f6[_0x546c('0x52')],_0x4044f6[_0x546c('0x33')],_0x4044f6[_0x546c('0x41')])[_0x546c('0x25')](respondWithResult(_0x3f05aa,null))[_0x546c('0x45')](handleError(_0x3f05aa,null));};exports[_0x546c('0xa2')]=runReport;exports[_0x546c('0x33')]=function(_0x2ec883,_0x332718){var _0xf67203=0xa;var _0x1353ca=[_0x546c('0x54'),_0x546c('0x55'),_0x546c('0x56'),'cross_join'];var _0x570af3={'SUM':_0x546c('0x57'),'COUNT':_0x546c('0x58'),'COUNT DISTINCT':_0x546c('0x59'),'MAX':_0x546c('0x84'),'MIN':_0x546c('0x5a'),'AVG':_0x546c('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x546c('0x5d'),'GROUP_CONCAT DESC':_0x546c('0x5e')};var _0x203d87={'SEC_TO_TIME':_0x546c('0x5f'),'DATE':_0x546c('0x60'),'HOUR':_0x546c('0x61'),'ROUND':_0x546c('0x62'),'UNIX_TIMESTAMP':_0x546c('0x63')};var _0x22ef10=function(_0x143c47){return!_[_0x546c('0x64')]([_0x546c('0x85'),_0x546c('0x86'),_0x546c('0x65'),_0x546c('0x66')],_0x143c47);};var _0x496471=function(_0xb90d8f){if(!_0xb90d8f||!_0xb90d8f[_0x546c('0x67')][_0x546c('0x39')]){return'';}for(var _0x3c6713='(',_0x446d91=0x0;_0x446d91<_0xb90d8f[_0x546c('0x67')][_0x546c('0x39')];_0x446d91+=0x1){_0x446d91>0x0&&(_0x3c6713+='\x20'+_0xb90d8f[_0x546c('0x68')]+'\x20');_0x3c6713+=_0xb90d8f[_0x546c('0x67')][_0x446d91][_0x546c('0x69')]?_0x496471(_0xb90d8f[_0x546c('0x67')][_0x446d91][_0x546c('0x69')]):_0xb90d8f[_0x546c('0x67')][_0x446d91][_0x546c('0x6a')]+'\x20'+_0xb90d8f[_0x546c('0x67')][_0x446d91]['condition']+(_0x22ef10(_0xb90d8f[_0x546c('0x67')][_0x446d91]['condition'])?'\x20'+_0xb90d8f[_0x546c('0x67')][_0x446d91][_0x546c('0x6c')]:'');}return _0x3c6713+')';};var _0x3d5df9={'where':{'id':_0x2ec883[_0x546c('0x52')]['id']}},_0x4f1939,_0x33389f,_0x33568c,_0x3aaa01,_0x118608;_0x3d5df9=_[_0x546c('0x3e')]({},_0x3d5df9,_0x2ec883[_0x546c('0x41')]);return db[_0x546c('0x2e')][_0x546c('0x48')](_0x3d5df9)[_0x546c('0x25')](function(_0x4c5a42){if(_0x4c5a42){_0x4f1939=_0x4c5a42;return _0x4c5a42[_0x546c('0x6d')]();}return null;})['then'](function(_0x264ed7){if(_0x264ed7){if(!_0x264ed7['length']){throw new db[(_0x546c('0xa3'))][(_0x546c('0x87'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x33389f=_0x264ed7;return db[_0x546c('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x546c('0x25')](function(_0x7d2dc8){if(_0x7d2dc8){_0x33568c=_[_0x546c('0xa4')](_0x7d2dc8,'id');var _0x13a573;var _0x59644e=squel[_0x546c('0x70')]();_0x59644e[_0x546c('0x88')](_0x4f1939['table']);for(var _0x2d955b=0x0;_0x2d955b<_0x33389f[_0x546c('0x39')];_0x2d955b+=0x1){_0x13a573=_0x33389f[_0x2d955b]['MetricId']?_0x33568c[_0x33389f[_0x2d955b][_0x546c('0x71')]][_0x546c('0x72')]:_0x33389f[_0x2d955b][_0x546c('0x6a')];_0x13a573=_0x33389f[_0x2d955b][_0x546c('0x73')]?_[_0x546c('0x75')](_0x570af3[_0x33389f[_0x2d955b]['function']],'%s',_0x13a573):_0x13a573;_0x13a573=_0x33389f[_0x2d955b][_0x546c('0x74')]?_[_0x546c('0x75')](_0x203d87[_0x33389f[_0x2d955b][_0x546c('0x74')]],'%s',_0x13a573):_0x13a573;if(_0x33389f[_0x2d955b][_0x546c('0xa5')]){_0x59644e['group'](_0x13a573);}_0x33389f[_0x2d955b]['orderBy']&&_0x59644e[_0x546c('0x3b')](_0x13a573,_0x33389f[_0x2d955b]['orderBy']===_0x546c('0x77')?![]:!![]);_0x59644e['field'](_0x13a573,_0x33389f[_0x2d955b][_0x546c('0x78')]||_0x13a573);}if(_0x4f1939[_0x546c('0x79')]){_0x4f1939[_0x546c('0x79')]=JSON[_0x546c('0x80')](_0x4f1939[_0x546c('0x79')]);for(var _0xc136e3=0x0;_0xc136e3<_0x4f1939['joins'][_0x546c('0x39')];_0xc136e3+=0x1){if(_0x4f1939[_0x546c('0x79')][_0xc136e3][_0x546c('0x31')]&&_[_0x546c('0x64')](_0x1353ca,_0x4f1939[_0x546c('0x79')][_0xc136e3][_0x546c('0x31')])&&_0x4f1939[_0x546c('0x79')][_0xc136e3][_0x546c('0x7e')]&&_0x4f1939[_0x546c('0x79')][_0xc136e3][_0x546c('0x7a')]&&_0x4f1939[_0x546c('0x79')][_0xc136e3][_0x546c('0x7b')]){_0x59644e[_0x4f1939[_0x546c('0x79')][_0xc136e3][_0x546c('0x31')]](_0x4f1939[_0x546c('0x79')][_0xc136e3][_0x546c('0x7a')],null,util[_0x546c('0x74')](_0x546c('0x7c'),_0x4f1939[_0x546c('0x7d')],_0x4f1939[_0x546c('0x79')][_0xc136e3][_0x546c('0x7e')],_0x4f1939['joins'][_0xc136e3]['foreignTable'],_0x4f1939[_0x546c('0x79')][_0xc136e3]['foreignKey']));}}}if(_0x4f1939['conditions']){_0x4f1939['conditions']=JSON['parse'](_0x4f1939[_0x546c('0x7f')]);_0x59644e[_0x546c('0x3c')](_0x496471(_0x4f1939[_0x546c('0x7f')][_0x546c('0x69')]));}_0x118608=_0x59644e[_0x546c('0x89')]();_0x59644e[_0x546c('0x1c')](_0xf67203);_0x59644e[_0x546c('0x1f')](0x0);logger[_0x546c('0x81')](_0x546c('0xa6'),_0x59644e[_0x546c('0x9a')]());return dbH['sequelize'][_0x546c('0x33')](_0x59644e[_0x546c('0x9a')](),{'type':dbH[_0x546c('0x82')]['QueryTypes'][_0x546c('0xa0')]});}})['then'](function(){return{'sql':_0x118608[_0x546c('0x9a')]()};})[_0x546c('0x25')](respondWithResult(_0x332718,null))[_0x546c('0x45')](handleError(_0x332718,null));};
\ No newline at end of file
+var _0xe3e7=['value','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','UNIX_TIMESTAMP(%s)','operator','getFields','Sequelize','metric','DESC','web','fullPath','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','COUNT(DISTINCT\x20%s)','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','Content-Range','apply','reject','then','destroy','CustomReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition'];(function(_0x3fc287,_0x5c3f36){var _0x33af9f=function(_0x27cfc6){while(--_0x27cfc6){_0x3fc287['push'](_0x3fc287['shift']());}};_0x33af9f(++_0x5c3f36);}(_0xe3e7,0xe0));var _0x7e3e=function(_0x4a3f01,_0x20687d){_0x4a3f01=_0x4a3f01-0x0;var _0x14fd54=_0xe3e7[_0x4a3f01];return _0x14fd54;};'use strict';var emlformat=require(_0x7e3e('0x0'));var rimraf=require(_0x7e3e('0x1'));var zipdir=require(_0x7e3e('0x2'));var jsonpatch=require(_0x7e3e('0x3'));var rp=require(_0x7e3e('0x4'));var moment=require(_0x7e3e('0x5'));var BPromise=require(_0x7e3e('0x6'));var Mustache=require('mustache');var util=require(_0x7e3e('0x7'));var path=require(_0x7e3e('0x8'));var sox=require(_0x7e3e('0x9'));var csv=require(_0x7e3e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e3e('0xb'));var _=require(_0x7e3e('0xc'));var squel=require(_0x7e3e('0xd'));var crypto=require(_0x7e3e('0xe'));var jsforce=require(_0x7e3e('0xf'));var deskjs=require(_0x7e3e('0x10'));var toCsv=require(_0x7e3e('0xa'));var querystring=require(_0x7e3e('0x11'));var Papa=require(_0x7e3e('0x12'));var Redis=require(_0x7e3e('0x13'));var authService=require(_0x7e3e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7e3e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e3e('0x16'))(_0x7e3e('0x17'));var utils=require(_0x7e3e('0x18'));var config=require(_0x7e3e('0x19'));var licenseUtil=require(_0x7e3e('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require(_0x7e3e('0x1b'))['dbH'];function respondWithStatusCode(_0x29d33e,_0x4e65a5){_0x4e65a5=_0x4e65a5||0xcc;return function(_0x3005e9){if(_0x3005e9){return _0x29d33e['sendStatus'](_0x4e65a5);}return _0x29d33e['status'](_0x4e65a5)['end']();};}function respondWithResult(_0xd7edff,_0x59d785){_0x59d785=_0x59d785||0xc8;return function(_0xc0f7ca){if(_0xc0f7ca){return _0xd7edff[_0x7e3e('0x1c')](_0x59d785)[_0x7e3e('0x1d')](_0xc0f7ca);}};}function respondWithFilteredResult(_0x3c7313,_0xa62ace){return function(_0x4757fe){if(_0x4757fe){var _0x5bf61e=typeof _0xa62ace[_0x7e3e('0x1e')]===_0x7e3e('0x1f')&&typeof _0xa62ace['limit']==='undefined';var _0x47c04c=_0x4757fe[_0x7e3e('0x20')];var _0x368288=_0x5bf61e?0x0:_0xa62ace[_0x7e3e('0x1e')];var _0x15fba6=_0x5bf61e?_0x4757fe[_0x7e3e('0x20')]:_0xa62ace[_0x7e3e('0x1e')]+_0xa62ace['limit'];var _0x272cff;if(_0x15fba6>=_0x47c04c){_0x15fba6=_0x47c04c;_0x272cff=0xc8;}else{_0x272cff=0xce;}_0x3c7313[_0x7e3e('0x1c')](_0x272cff);return _0x3c7313['set'](_0x7e3e('0x21'),_0x368288+'-'+_0x15fba6+'/'+_0x47c04c)[_0x7e3e('0x1d')](_0x4757fe);}return null;};}function patchUpdates(_0x172997){return function(_0x47b832){try{jsonpatch[_0x7e3e('0x22')](_0x47b832,_0x172997,!![]);}catch(_0x18d1a9){return BPromise[_0x7e3e('0x23')](_0x18d1a9);}return _0x47b832['save']();};}function saveUpdates(_0x2b94a7,_0x4a3a6f){return function(_0x506e5c){if(_0x506e5c){return _0x506e5c['update'](_0x2b94a7)[_0x7e3e('0x24')](function(_0x353f30){return _0x353f30;});}return null;};}function removeEntity(_0x1a1854,_0x3a723f){return function(_0x1e82ab){if(_0x1e82ab){return _0x1e82ab[_0x7e3e('0x25')]()[_0x7e3e('0x24')](function(){var _0x11deea=_0x1e82ab['get']({'plain':!![]});var _0x3fb5d3=_0x7e3e('0x26');return db[_0x7e3e('0x27')]['destroy']({'where':{'type':_0x3fb5d3,'resourceId':_0x11deea['id']}})[_0x7e3e('0x24')](function(){return _0x1e82ab;});})[_0x7e3e('0x24')](function(){_0x1a1854[_0x7e3e('0x1c')](0xcc)[_0x7e3e('0x28')]();});}};}function handleEntityNotFound(_0x567040,_0x16361d){return function(_0x1fefc0){if(!_0x1fefc0){_0x567040[_0x7e3e('0x29')](0x194);}return _0x1fefc0;};}function handleError(_0x5e38de,_0x4f44a0){_0x4f44a0=_0x4f44a0||0x1f4;return function(_0x1bd40e){logger[_0x7e3e('0x2a')](_0x1bd40e[_0x7e3e('0x2b')]);if(_0x1bd40e[_0x7e3e('0x2c')]){delete _0x1bd40e['name'];}_0x5e38de[_0x7e3e('0x1c')](_0x4f44a0)[_0x7e3e('0x2d')](_0x1bd40e);};}exports[_0x7e3e('0x2e')]=function(_0x4a4b7d,_0x4e2d89){var _0x3e75ab={},_0x72a15f={},_0x34b68f={'count':0x0,'rows':[]};var _0x1624a4=_[_0x7e3e('0x2f')](db[_0x7e3e('0x30')][_0x7e3e('0x31')],function(_0x417585){return{'name':_0x417585[_0x7e3e('0x32')],'type':_0x417585['type'][_0x7e3e('0x33')]};});_0x72a15f[_0x7e3e('0x34')]=_[_0x7e3e('0x2f')](_0x1624a4,_0x7e3e('0x2c'));_0x72a15f[_0x7e3e('0x35')]=_[_0x7e3e('0x36')](_0x4a4b7d[_0x7e3e('0x35')]);_0x72a15f[_0x7e3e('0x37')]=_[_0x7e3e('0x38')](_0x72a15f[_0x7e3e('0x34')],_0x72a15f['query']);_0x3e75ab['attributes']=_['intersection'](_0x72a15f[_0x7e3e('0x34')],qs[_0x7e3e('0x39')](_0x4a4b7d[_0x7e3e('0x35')]['fields']));_0x3e75ab['attributes']=_0x3e75ab['attributes']['length']?_0x3e75ab[_0x7e3e('0x3a')]:_0x72a15f[_0x7e3e('0x34')];if(!_0x4a4b7d[_0x7e3e('0x35')][_0x7e3e('0x3b')](_0x7e3e('0x3c'))){_0x3e75ab[_0x7e3e('0x3d')]=qs[_0x7e3e('0x3d')](_0x4a4b7d['query'][_0x7e3e('0x3d')]);_0x3e75ab[_0x7e3e('0x1e')]=qs[_0x7e3e('0x1e')](_0x4a4b7d[_0x7e3e('0x35')][_0x7e3e('0x1e')]);}_0x3e75ab[_0x7e3e('0x3e')]=qs[_0x7e3e('0x3f')](_0x4a4b7d[_0x7e3e('0x35')][_0x7e3e('0x3f')]);_0x3e75ab[_0x7e3e('0x40')]=qs[_0x7e3e('0x37')](_['pick'](_0x4a4b7d[_0x7e3e('0x35')],_0x72a15f[_0x7e3e('0x37')]),_0x1624a4);if(_0x4a4b7d[_0x7e3e('0x35')][_0x7e3e('0x41')]){_0x3e75ab[_0x7e3e('0x40')]=_[_0x7e3e('0x42')](_0x3e75ab[_0x7e3e('0x40')],{'$or':_[_0x7e3e('0x2f')](_0x1624a4,function(_0x5a16bc){if(_0x5a16bc[_0x7e3e('0x43')]!==_0x7e3e('0x44')){var _0x4e91c0={};_0x4e91c0[_0x5a16bc['name']]={'$like':'%'+_0x4a4b7d[_0x7e3e('0x35')]['filter']+'%'};return _0x4e91c0;}})});}_0x3e75ab=_['merge']({},_0x3e75ab,_0x4a4b7d[_0x7e3e('0x45')]);var _0x1dedc9={'where':_0x3e75ab[_0x7e3e('0x40')]};return db[_0x7e3e('0x30')][_0x7e3e('0x20')](_0x1dedc9)[_0x7e3e('0x24')](function(_0x871427){_0x34b68f['count']=_0x871427;if(_0x4a4b7d[_0x7e3e('0x35')]['includeAll']){_0x3e75ab[_0x7e3e('0x46')]=[{'all':!![]}];}return db[_0x7e3e('0x30')][_0x7e3e('0x47')](_0x3e75ab);})[_0x7e3e('0x24')](function(_0x2662a9){_0x34b68f[_0x7e3e('0x48')]=_0x2662a9;return _0x34b68f;})[_0x7e3e('0x24')](respondWithFilteredResult(_0x4e2d89,_0x3e75ab))[_0x7e3e('0x49')](handleError(_0x4e2d89,null));};exports['show']=function(_0x557f10,_0x5158a0){var _0x5f44bd={'raw':![],'where':{'id':_0x557f10[_0x7e3e('0x4a')]['id']}},_0x37729f={};_0x37729f[_0x7e3e('0x34')]=_['keys'](db['AnalyticCustomReport'][_0x7e3e('0x31')]);_0x37729f[_0x7e3e('0x35')]=_['keys'](_0x557f10[_0x7e3e('0x35')]);_0x37729f[_0x7e3e('0x37')]=_[_0x7e3e('0x38')](_0x37729f[_0x7e3e('0x34')],_0x37729f[_0x7e3e('0x35')]);_0x5f44bd[_0x7e3e('0x3a')]=_['intersection'](_0x37729f[_0x7e3e('0x34')],qs[_0x7e3e('0x39')](_0x557f10[_0x7e3e('0x35')][_0x7e3e('0x39')]));_0x5f44bd['attributes']=_0x5f44bd['attributes']['length']?_0x5f44bd['attributes']:_0x37729f[_0x7e3e('0x34')];if(_0x557f10['query'][_0x7e3e('0x4b')]){_0x5f44bd[_0x7e3e('0x46')]=[{'all':!![]}];}_0x5f44bd=_[_0x7e3e('0x42')]({},_0x5f44bd,_0x557f10['options']);return db[_0x7e3e('0x30')][_0x7e3e('0x4c')](_0x5f44bd)[_0x7e3e('0x24')](handleEntityNotFound(_0x5158a0,null))[_0x7e3e('0x24')](respondWithResult(_0x5158a0,null))['catch'](handleError(_0x5158a0,null));};exports['create']=function(_0x436743,_0x3144a6){return db[_0x7e3e('0x30')][_0x7e3e('0x4d')](_0x436743[_0x7e3e('0x4e')],{})[_0x7e3e('0x24')](function(_0x561501){var _0x42b7f7=_0x436743[_0x7e3e('0x4f')][_0x7e3e('0x50')]({'plain':!![]});if(!_0x42b7f7)throw new Error(_0x7e3e('0x51'));if(_0x42b7f7['role']===_0x7e3e('0x4f')){var _0x745c6d=_0x561501[_0x7e3e('0x50')]({'plain':!![]});var _0x199f0c=_0x7e3e('0x52');return db[_0x7e3e('0x53')][_0x7e3e('0x4c')]({'where':{'name':_0x199f0c,'userProfileId':_0x42b7f7['userProfileId']},'raw':!![]})[_0x7e3e('0x24')](function(_0x3f1caf){if(_0x3f1caf&&_0x3f1caf[_0x7e3e('0x54')]===0x0){return db[_0x7e3e('0x27')][_0x7e3e('0x4d')]({'name':_0x745c6d[_0x7e3e('0x2c')],'resourceId':_0x745c6d['id'],'type':_0x7e3e('0x26'),'sectionId':_0x3f1caf['id']},{})['then'](function(){return _0x561501;});}else{return _0x561501;}})[_0x7e3e('0x49')](function(_0x1ce5b2){logger[_0x7e3e('0x2a')](_0x7e3e('0x55'),_0x1ce5b2);throw _0x1ce5b2;});}return _0x561501;})['then'](respondWithResult(_0x3144a6,0xc9))[_0x7e3e('0x49')](handleError(_0x3144a6,null));};exports['update']=function(_0x48aaf8,_0x472679){if(_0x48aaf8['body']['id']){delete _0x48aaf8[_0x7e3e('0x4e')]['id'];}return db[_0x7e3e('0x30')][_0x7e3e('0x4c')]({'where':{'id':_0x48aaf8[_0x7e3e('0x4a')]['id']}})[_0x7e3e('0x24')](handleEntityNotFound(_0x472679,null))['then'](saveUpdates(_0x48aaf8[_0x7e3e('0x4e')],null))[_0x7e3e('0x24')](respondWithResult(_0x472679,null))[_0x7e3e('0x49')](handleError(_0x472679,null));};exports['destroy']=function(_0x371844,_0x5bc668){return db[_0x7e3e('0x30')][_0x7e3e('0x4c')]({'where':{'id':_0x371844['params']['id']}})[_0x7e3e('0x24')](handleEntityNotFound(_0x5bc668,null))['then'](removeEntity(_0x5bc668,null))['catch'](handleError(_0x5bc668,null));};exports['preview']=function(_0x3a650c,_0x277577){var _0x523360=0xa;var _0x18c115=[_0x7e3e('0x56'),'left_join',_0x7e3e('0x57'),_0x7e3e('0x58')];var _0x504896={'SUM':_0x7e3e('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7e3e('0x5a'),'MIN':_0x7e3e('0x5b'),'AVG':_0x7e3e('0x5c'),'GROUP_CONCAT':_0x7e3e('0x5d'),'GROUP_CONCAT ASC':_0x7e3e('0x5e'),'GROUP_CONCAT DESC':_0x7e3e('0x5f')};var _0x15273a={'SEC_TO_TIME':_0x7e3e('0x60'),'DATE':_0x7e3e('0x61'),'HOUR':_0x7e3e('0x62'),'ROUND':_0x7e3e('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x416cc7=function(_0x145889){return!_[_0x7e3e('0x64')]([_0x7e3e('0x65'),_0x7e3e('0x66'),'IS\x20EMPTY',_0x7e3e('0x67')],_0x145889);};var _0x263f72=function(_0x778929){if(!_0x778929||!_0x778929[_0x7e3e('0x68')][_0x7e3e('0x69')]){return'';}for(var _0x1a5ad6='(',_0x27d987=0x0;_0x27d987<_0x778929[_0x7e3e('0x68')][_0x7e3e('0x69')];_0x27d987+=0x1){_0x27d987>0x0&&(_0x1a5ad6+='\x20'+_0x778929['operator']+'\x20');_0x1a5ad6+=_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6a')]?_0x263f72(_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6a')]):_0x778929['rules'][_0x27d987]['field']+'\x20'+_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6b')]+(_0x416cc7(_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6b')])?'\x20'+_0x778929[_0x7e3e('0x68')][_0x27d987][_0x7e3e('0x6c')]:'');}return _0x1a5ad6+')';};var _0x4881d3={'where':{'id':_0x3a650c[_0x7e3e('0x4a')]['id']}},_0x243f98,_0xa2f3c0,_0x544cd3,_0x37efac,_0x31dcc3;_0x4881d3=_[_0x7e3e('0x42')]({},_0x4881d3,_0x3a650c[_0x7e3e('0x45')]);return db[_0x7e3e('0x30')]['find'](_0x4881d3)[_0x7e3e('0x24')](function(_0x57ceb9){if(_0x57ceb9){_0x243f98=_0x57ceb9;return _0x57ceb9['getFields']();}return null;})[_0x7e3e('0x24')](function(_0xa3c747){if(_0xa3c747){if(!_0xa3c747[_0x7e3e('0x69')]){throw new db['Sequelize'][(_0x7e3e('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xa2f3c0=_0xa3c747;return db[_0x7e3e('0x6e')][_0x7e3e('0x47')]({'raw':!![]});}return null;})[_0x7e3e('0x24')](function(_0x7074ee){if(_0x7074ee){_0x544cd3=_[_0x7e3e('0x6f')](_0x7074ee,'id');var _0x1ef028;var _0x2d6f44=squel[_0x7e3e('0x70')]();_0x2d6f44[_0x7e3e('0x71')](_0x243f98[_0x7e3e('0x72')]);for(var _0x31328f=0x0;_0x31328f<_0xa2f3c0[_0x7e3e('0x69')];_0x31328f+=0x1){_0x1ef028=_0xa2f3c0[_0x31328f][_0x7e3e('0x73')]?_0x544cd3[_0xa2f3c0[_0x31328f][_0x7e3e('0x73')]]['metric']:_0xa2f3c0[_0x31328f][_0x7e3e('0x74')];_0x1ef028=_0xa2f3c0[_0x31328f][_0x7e3e('0x75')]?_[_0x7e3e('0x76')](_0x504896[_0xa2f3c0[_0x31328f][_0x7e3e('0x75')]],'%s',_0x1ef028):_0x1ef028;_0x1ef028=_0xa2f3c0[_0x31328f]['format']?_['replace'](_0x15273a[_0xa2f3c0[_0x31328f][_0x7e3e('0x77')]],'%s',_0x1ef028):_0x1ef028;if(_0xa2f3c0[_0x31328f][_0x7e3e('0x78')]){_0x2d6f44[_0x7e3e('0x6a')](_0x1ef028);}_0xa2f3c0[_0x31328f][_0x7e3e('0x79')]&&_0x2d6f44[_0x7e3e('0x3e')](_0x1ef028,_0xa2f3c0[_0x31328f]['orderBy']==='DESC'?![]:!![]);_0x2d6f44['field'](_0x1ef028,_0xa2f3c0[_0x31328f][_0x7e3e('0x7a')]||_0x1ef028);}if(_0x243f98['joins']){_0x243f98[_0x7e3e('0x7b')]=JSON[_0x7e3e('0x7c')](_0x243f98['joins']);for(var _0x4b2296=0x0;_0x4b2296<_0x243f98[_0x7e3e('0x7b')][_0x7e3e('0x69')];_0x4b2296+=0x1){if(_0x243f98[_0x7e3e('0x7b')][_0x4b2296]['type']&&_[_0x7e3e('0x64')](_0x18c115,_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x43')])&&_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7d')]&&_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7e')]&&_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7f')]){_0x2d6f44[_0x243f98['joins'][_0x4b2296]['type']](_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7e')],null,util[_0x7e3e('0x77')](_0x7e3e('0x80'),_0x243f98[_0x7e3e('0x72')],_0x243f98['joins'][_0x4b2296][_0x7e3e('0x7d')],_0x243f98[_0x7e3e('0x7b')][_0x4b2296]['foreignTable'],_0x243f98[_0x7e3e('0x7b')][_0x4b2296][_0x7e3e('0x7f')]));}}}if(_0x243f98[_0x7e3e('0x81')]){_0x243f98[_0x7e3e('0x81')]=JSON['parse'](_0x243f98[_0x7e3e('0x81')]);_0x2d6f44[_0x7e3e('0x40')](_0x263f72(_0x243f98[_0x7e3e('0x81')][_0x7e3e('0x6a')]));}_0x31dcc3=_0x2d6f44[_0x7e3e('0x82')]();_0x2d6f44[_0x7e3e('0x3d')](_0x523360);_0x2d6f44[_0x7e3e('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x2d6f44[_0x7e3e('0x83')]());return dbH[_0x7e3e('0x84')][_0x7e3e('0x35')](_0x2d6f44['toString'](),{'type':dbH['sequelize'][_0x7e3e('0x85')][_0x7e3e('0x86')]});}})[_0x7e3e('0x24')](respondWithResult(_0x277577,null))[_0x7e3e('0x49')](handleError(_0x277577,null));};function runReport(_0x5ac425,_0x3bb96d,_0x3ec1c2){var _0x31ff60=_0x3bb96d['name'];var _0x3a6056=0xa;var _0x57939b=['join','left_join','right_join',_0x7e3e('0x58')];var _0x111cd0={'SUM':_0x7e3e('0x59'),'COUNT':_0x7e3e('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7e3e('0x5a'),'MIN':_0x7e3e('0x5b'),'AVG':_0x7e3e('0x5c'),'GROUP_CONCAT':_0x7e3e('0x5d'),'GROUP_CONCAT ASC':_0x7e3e('0x5e'),'GROUP_CONCAT DESC':_0x7e3e('0x5f')};var _0x443439={'SEC_TO_TIME':_0x7e3e('0x60'),'DATE':'DATE(%s)','HOUR':_0x7e3e('0x62'),'ROUND':_0x7e3e('0x63'),'UNIX_TIMESTAMP':_0x7e3e('0x88')};var _0x2f7659=function(_0x11529c){return!_[_0x7e3e('0x64')]([_0x7e3e('0x65'),_0x7e3e('0x66'),'IS\x20EMPTY',_0x7e3e('0x67')],_0x11529c);};var _0x3c6988=function(_0x57bb00){if(!_0x57bb00||!_0x57bb00[_0x7e3e('0x68')]['length']){return'';}for(var _0x5a767e='(',_0x283f4f=0x0;_0x283f4f<_0x57bb00[_0x7e3e('0x68')][_0x7e3e('0x69')];_0x283f4f+=0x1){_0x283f4f>0x0&&(_0x5a767e+='\x20'+_0x57bb00[_0x7e3e('0x89')]+'\x20');_0x5a767e+=_0x57bb00[_0x7e3e('0x68')][_0x283f4f]['group']?_0x3c6988(_0x57bb00[_0x7e3e('0x68')][_0x283f4f]['group']):_0x57bb00[_0x7e3e('0x68')][_0x283f4f][_0x7e3e('0x74')]+'\x20'+_0x57bb00[_0x7e3e('0x68')][_0x283f4f][_0x7e3e('0x6b')]+(_0x2f7659(_0x57bb00[_0x7e3e('0x68')][_0x283f4f][_0x7e3e('0x6b')])?'\x20'+_0x57bb00[_0x7e3e('0x68')][_0x283f4f]['value']:'');}return _0x5a767e+')';};var _0xa1e13e={'where':{'id':_0x5ac425['id']}},_0x36df4b,_0x251633,_0x3f0eec,_0x3bc987,_0x3fc085;_0xa1e13e=_[_0x7e3e('0x42')]({},_0xa1e13e,_0x3ec1c2);return db[_0x7e3e('0x30')]['find'](_0xa1e13e)[_0x7e3e('0x24')](function(_0x44a558){if(_0x44a558){_0x36df4b=_0x44a558;return _0x44a558[_0x7e3e('0x8a')]();}return null;})[_0x7e3e('0x24')](function(_0x39bf5e){if(_0x39bf5e){if(!_0x39bf5e[_0x7e3e('0x69')]){throw new db[(_0x7e3e('0x8b'))][(_0x7e3e('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x251633=_0x39bf5e;return db['AnalyticMetric'][_0x7e3e('0x47')]({'raw':!![]});}return null;})[_0x7e3e('0x24')](function(_0x5492e6){if(_0x5492e6){_0x3f0eec=_[_0x7e3e('0x6f')](_0x5492e6,'id');var _0x10b209;var _0x3a91d4=squel[_0x7e3e('0x70')]();_0x3a91d4['from'](_0x36df4b[_0x7e3e('0x72')]);for(var _0x369ae4=0x0;_0x369ae4<_0x251633[_0x7e3e('0x69')];_0x369ae4+=0x1){_0x10b209=_0x251633[_0x369ae4]['MetricId']?_0x3f0eec[_0x251633[_0x369ae4][_0x7e3e('0x73')]][_0x7e3e('0x8c')]:_0x251633[_0x369ae4]['field'];_0x10b209=_0x251633[_0x369ae4][_0x7e3e('0x75')]?_[_0x7e3e('0x76')](_0x111cd0[_0x251633[_0x369ae4][_0x7e3e('0x75')]],'%s',_0x10b209):_0x10b209;_0x10b209=_0x251633[_0x369ae4][_0x7e3e('0x77')]?_['replace'](_0x443439[_0x251633[_0x369ae4]['format']],'%s',_0x10b209):_0x10b209;if(_0x251633[_0x369ae4]['groupBy']){_0x3a91d4[_0x7e3e('0x6a')](_0x10b209);}_0x251633[_0x369ae4][_0x7e3e('0x79')]&&_0x3a91d4['order'](_0x10b209,_0x251633[_0x369ae4]['orderBy']===_0x7e3e('0x8d')?![]:!![]);_0x3a91d4[_0x7e3e('0x74')](_0x10b209,_0x251633[_0x369ae4][_0x7e3e('0x7a')]||_0x10b209);}if(_0x36df4b[_0x7e3e('0x7b')]){_0x36df4b[_0x7e3e('0x7b')]=JSON[_0x7e3e('0x7c')](_0x36df4b['joins']);for(var _0x4fabcc=0x0;_0x4fabcc<_0x36df4b[_0x7e3e('0x7b')]['length'];_0x4fabcc+=0x1){if(_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x43')]&&_[_0x7e3e('0x64')](_0x57939b,_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x43')])&&_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7d')]&&_0x36df4b['joins'][_0x4fabcc][_0x7e3e('0x7e')]&&_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7f')]){_0x3a91d4[_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x43')]](_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7e')],null,util['format'](_0x7e3e('0x80'),_0x36df4b[_0x7e3e('0x72')],_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7d')],_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7e')],_0x36df4b[_0x7e3e('0x7b')][_0x4fabcc][_0x7e3e('0x7f')]));}}}if(_0x36df4b[_0x7e3e('0x81')]){_0x36df4b['conditions']=JSON[_0x7e3e('0x7c')](_0x36df4b[_0x7e3e('0x81')]);_0x3a91d4[_0x7e3e('0x40')](_0x3c6988(_0x36df4b[_0x7e3e('0x81')][_0x7e3e('0x6a')]));}_0x3fc085=_0x3a91d4[_0x7e3e('0x82')]();_0x3a91d4[_0x7e3e('0x3d')](_0x3a6056);_0x3a91d4[_0x7e3e('0x1e')](0x0);return;}})[_0x7e3e('0x24')](function(){if(_0x3bb96d['output']===_0x7e3e('0x8e')){return null;}var _0xb76605=_[_0x7e3e('0x42')](_0x3bb96d,{'name':_0x3bb96d[_0x7e3e('0x8f')]||_0x3bb96d[_0x7e3e('0x2c')]||_0x36df4b[_0x7e3e('0x2c')],'basename':_0x31ff60,'savename':util[_0x7e3e('0x77')]('%s-%s.%s',_0x3bb96d[_0x7e3e('0x2c')]||_0x36df4b['name'],require(_0x7e3e('0x90'))[_0x7e3e('0x91')](0x4),_0x3bb96d[_0x7e3e('0x92')]||_0x7e3e('0x93')),'reportId':_0x36df4b['id'],'reportType':_0x7e3e('0x94')});return db[_0x7e3e('0x95')][_0x7e3e('0x4d')](_0xb76605,{'raw':!![]});})[_0x7e3e('0x24')](function(_0x49d1ac){if(_0x36df4b[_0x7e3e('0x72')]===_0x7e3e('0x96')){_0x3fc085['where'](_0x36df4b['table']+_0x7e3e('0x97'),_0x3bb96d[_0x7e3e('0x98')],_0x3bb96d['endDate']);}else{_0x3fc085[_0x7e3e('0x40')](_0x36df4b[_0x7e3e('0x72')]+_0x7e3e('0x99'),_0x3bb96d[_0x7e3e('0x98')],_0x3bb96d[_0x7e3e('0x9a')]);}if(_0x49d1ac){logger[_0x7e3e('0x9b')](_0x7e3e('0x9c'),_0x3fc085[_0x7e3e('0x83')]());require(_0x7e3e('0x9d'))[_0x7e3e('0x9e')](path[_0x7e3e('0x56')](__dirname,'../../components/export/',_0x49d1ac[_0x7e3e('0x92')]),[_0x49d1ac['id'],_0x3fc085[_0x7e3e('0x83')](),path[_0x7e3e('0x56')](__dirname,_0x7e3e('0x9f'),_0x49d1ac[_0x7e3e('0xa0')]),_0x31ff60]);return _0x49d1ac;}else{var _0x53ce02=squel[_0x7e3e('0x70')]();_0x53ce02[_0x7e3e('0x71')]('('+_0x3fc085[_0x7e3e('0x83')]()+')',_0x7e3e('0xa1'));_0x53ce02['field'](_0x7e3e('0xa2'),_0x7e3e('0x20'));_0x3fc085['limit'](_0x3bb96d[_0x7e3e('0x3d')]||_0x3a6056);_0x3fc085[_0x7e3e('0x1e')](_0x3bb96d['offset']||0x0);return dbH[_0x7e3e('0x84')][_0x7e3e('0x35')](_0x53ce02[_0x7e3e('0x83')](),{'type':dbH[_0x7e3e('0x84')][_0x7e3e('0x85')][_0x7e3e('0x86')]})[_0x7e3e('0x24')](function(_0x302003){if(!_0x302003['length']){_0x3bc987=0x0;}else{_0x3bc987=_0x302003[0x0][_0x7e3e('0x20')]||0x0;}return dbH[_0x7e3e('0x84')][_0x7e3e('0x35')](_0x3fc085[_0x7e3e('0x83')](),{'type':dbH[_0x7e3e('0x84')]['QueryTypes'][_0x7e3e('0x86')]});})[_0x7e3e('0x24')](function(_0x422aa7){return{'rows':_0x422aa7||[],'count':_0x3bc987};});}});}exports[_0x7e3e('0xa3')]=function(_0x31b506,_0x1d73a6){return runReport(_0x31b506[_0x7e3e('0x4a')],_0x31b506[_0x7e3e('0x35')],_0x31b506[_0x7e3e('0x45')])[_0x7e3e('0x24')](respondWithResult(_0x1d73a6,null))[_0x7e3e('0x49')](handleError(_0x1d73a6,null));};exports['runReport']=runReport;exports[_0x7e3e('0x35')]=function(_0x498fab,_0x1d5200){var _0x572f3f=0xa;var _0x29fe13=[_0x7e3e('0x56'),'left_join',_0x7e3e('0x57'),_0x7e3e('0x58')];var _0x370e92={'SUM':_0x7e3e('0x59'),'COUNT':_0x7e3e('0x87'),'COUNT DISTINCT':_0x7e3e('0xa4'),'MAX':_0x7e3e('0x5a'),'MIN':_0x7e3e('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7e3e('0x5d'),'GROUP_CONCAT ASC':_0x7e3e('0x5e'),'GROUP_CONCAT DESC':_0x7e3e('0x5f')};var _0xc221f={'SEC_TO_TIME':_0x7e3e('0x60'),'DATE':_0x7e3e('0x61'),'HOUR':_0x7e3e('0x62'),'ROUND':_0x7e3e('0x63'),'UNIX_TIMESTAMP':_0x7e3e('0x88')};var _0x221511=function(_0x1020c6){return!_[_0x7e3e('0x64')]([_0x7e3e('0x65'),_0x7e3e('0x66'),_0x7e3e('0xa5'),_0x7e3e('0x67')],_0x1020c6);};var _0x53afe7=function(_0x32d65c){if(!_0x32d65c||!_0x32d65c['rules'][_0x7e3e('0x69')]){return'';}for(var _0x90fcd2='(',_0x48ed9e=0x0;_0x48ed9e<_0x32d65c[_0x7e3e('0x68')]['length'];_0x48ed9e+=0x1){_0x48ed9e>0x0&&(_0x90fcd2+='\x20'+_0x32d65c[_0x7e3e('0x89')]+'\x20');_0x90fcd2+=_0x32d65c['rules'][_0x48ed9e]['group']?_0x53afe7(_0x32d65c[_0x7e3e('0x68')][_0x48ed9e][_0x7e3e('0x6a')]):_0x32d65c[_0x7e3e('0x68')][_0x48ed9e][_0x7e3e('0x74')]+'\x20'+_0x32d65c[_0x7e3e('0x68')][_0x48ed9e][_0x7e3e('0x6b')]+(_0x221511(_0x32d65c['rules'][_0x48ed9e][_0x7e3e('0x6b')])?'\x20'+_0x32d65c['rules'][_0x48ed9e]['value']:'');}return _0x90fcd2+')';};var _0x460b07={'where':{'id':_0x498fab[_0x7e3e('0x4a')]['id']}},_0x17f769,_0x27b1a8,_0x14b123,_0x238495,_0x1dd59e;_0x460b07=_[_0x7e3e('0x42')]({},_0x460b07,_0x498fab[_0x7e3e('0x45')]);return db[_0x7e3e('0x30')][_0x7e3e('0x4c')](_0x460b07)[_0x7e3e('0x24')](function(_0x2edc81){if(_0x2edc81){_0x17f769=_0x2edc81;return _0x2edc81[_0x7e3e('0x8a')]();}return null;})['then'](function(_0x280031){if(_0x280031){if(!_0x280031[_0x7e3e('0x69')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27b1a8=_0x280031;return db[_0x7e3e('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x7e3e('0x24')](function(_0x4dc56e){if(_0x4dc56e){_0x14b123=_['keyBy'](_0x4dc56e,'id');var _0x26133f;var _0x492aaa=squel[_0x7e3e('0x70')]();_0x492aaa['from'](_0x17f769[_0x7e3e('0x72')]);for(var _0xf21490=0x0;_0xf21490<_0x27b1a8[_0x7e3e('0x69')];_0xf21490+=0x1){_0x26133f=_0x27b1a8[_0xf21490][_0x7e3e('0x73')]?_0x14b123[_0x27b1a8[_0xf21490][_0x7e3e('0x73')]][_0x7e3e('0x8c')]:_0x27b1a8[_0xf21490][_0x7e3e('0x74')];_0x26133f=_0x27b1a8[_0xf21490]['function']?_[_0x7e3e('0x76')](_0x370e92[_0x27b1a8[_0xf21490][_0x7e3e('0x75')]],'%s',_0x26133f):_0x26133f;_0x26133f=_0x27b1a8[_0xf21490]['format']?_[_0x7e3e('0x76')](_0xc221f[_0x27b1a8[_0xf21490]['format']],'%s',_0x26133f):_0x26133f;if(_0x27b1a8[_0xf21490][_0x7e3e('0x78')]){_0x492aaa[_0x7e3e('0x6a')](_0x26133f);}_0x27b1a8[_0xf21490][_0x7e3e('0x79')]&&_0x492aaa['order'](_0x26133f,_0x27b1a8[_0xf21490][_0x7e3e('0x79')]===_0x7e3e('0x8d')?![]:!![]);_0x492aaa[_0x7e3e('0x74')](_0x26133f,_0x27b1a8[_0xf21490][_0x7e3e('0x7a')]||_0x26133f);}if(_0x17f769[_0x7e3e('0x7b')]){_0x17f769[_0x7e3e('0x7b')]=JSON[_0x7e3e('0x7c')](_0x17f769[_0x7e3e('0x7b')]);for(var _0x123e20=0x0;_0x123e20<_0x17f769['joins']['length'];_0x123e20+=0x1){if(_0x17f769['joins'][_0x123e20][_0x7e3e('0x43')]&&_['includes'](_0x29fe13,_0x17f769['joins'][_0x123e20][_0x7e3e('0x43')])&&_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x7d')]&&_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x7e')]&&_0x17f769['joins'][_0x123e20][_0x7e3e('0x7f')]){_0x492aaa[_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x43')]](_0x17f769[_0x7e3e('0x7b')][_0x123e20]['foreignTable'],null,util[_0x7e3e('0x77')](_0x7e3e('0x80'),_0x17f769[_0x7e3e('0x72')],_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x7d')],_0x17f769[_0x7e3e('0x7b')][_0x123e20]['foreignTable'],_0x17f769[_0x7e3e('0x7b')][_0x123e20][_0x7e3e('0x7f')]));}}}if(_0x17f769[_0x7e3e('0x81')]){_0x17f769[_0x7e3e('0x81')]=JSON['parse'](_0x17f769['conditions']);_0x492aaa[_0x7e3e('0x40')](_0x53afe7(_0x17f769[_0x7e3e('0x81')][_0x7e3e('0x6a')]));}_0x1dd59e=_0x492aaa[_0x7e3e('0x82')]();_0x492aaa[_0x7e3e('0x3d')](_0x572f3f);_0x492aaa['offset'](0x0);logger['debug']('Limited\x20Query:',_0x492aaa[_0x7e3e('0x83')]());return dbH[_0x7e3e('0x84')][_0x7e3e('0x35')](_0x492aaa[_0x7e3e('0x83')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x7e3e('0x24')](function(){return{'sql':_0x1dd59e[_0x7e3e('0x83')]()};})[_0x7e3e('0x24')](respondWithResult(_0x1d5200,null))[_0x7e3e('0x49')](handleError(_0x1d5200,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 69c68cf..56d1def 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 _0xad7a=['util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x1b7890,_0x354ed1){var _0x5675d7=function(_0x8d13be){while(--_0x8d13be){_0x1b7890['push'](_0x1b7890['shift']());}};_0x5675d7(++_0x354ed1);}(_0xad7a,0x196));var _0xaad7=function(_0x141297,_0xc9ba96){_0x141297=_0x141297-0x0;var _0x237cfa=_0xad7a[_0x141297];return _0x237cfa;};'use strict';var _=require(_0xaad7('0x0'));var util=require(_0xaad7('0x1'));var logger=require(_0xaad7('0x2'))(_0xaad7('0x3'));var moment=require(_0xaad7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaad7('0x5'));var config=require(_0xaad7('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xaad7('0x7')]=function(_0x4d8f3b,_0x1d2ee5){return _0x4d8f3b[_0xaad7('0x8')](_0xaad7('0x9'),attributes,{'tableName':_0xaad7('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd502=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','../../config/logger','moment'];(function(_0x597e6c,_0x37ddaa){var _0x10bc1c=function(_0x1a5fda){while(--_0x1a5fda){_0x597e6c['push'](_0x597e6c['shift']());}};_0x10bc1c(++_0x37ddaa);}(_0xd502,0x135));var _0x2d50=function(_0x5c8628,_0x2fc5f5){_0x5c8628=_0x5c8628-0x0;var _0xcbd50e=_0xd502[_0x5c8628];return _0xcbd50e;};'use strict';var _=require(_0x2d50('0x0'));var util=require('util');var logger=require(_0x2d50('0x1'))('api');var moment=require(_0x2d50('0x2'));var BPromise=require(_0x2d50('0x3'));var rp=require(_0x2d50('0x4'));var fs=require('fs');var path=require(_0x2d50('0x5'));var rimraf=require(_0x2d50('0x6'));var config=require(_0x2d50('0x7'));var attributes=require(_0x2d50('0x8'));module[_0x2d50('0x9')]=function(_0x137dce,_0x1e6624){return _0x137dce[_0x2d50('0xa')](_0x2d50('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 0ba3c04..b738d66 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 _0xa8f8=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xa8f8,0x71));var _0x8a8f=function(_0x23d0a1,_0x5011a){_0x23d0a1=_0x23d0a1-0x0;var _0x1ef866=_0xa8f8[_0x23d0a1];return _0x1ef866;};'use strict';var _=require(_0x8a8f('0x0'));var util=require(_0x8a8f('0x1'));var moment=require('moment');var BPromise=require(_0x8a8f('0x2'));var rs=require(_0x8a8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a8f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a8f('0x5'))(_0x8a8f('0x6'));var config=require(_0x8a8f('0x7'));var jayson=require(_0x8a8f('0x8'));var client=jayson[_0x8a8f('0x9')][_0x8a8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45ce76,_0x198340,_0x27f074){return new BPromise(function(_0x33edd1,_0x3f4d16){return client[_0x8a8f('0xb')](_0x45ce76,_0x27f074)['then'](function(_0x29652f){logger['info'](_0x8a8f('0xc'),_0x198340,_0x8a8f('0xd'));logger[_0x8a8f('0xe')](_0x8a8f('0xf'),_0x198340,_0x8a8f('0xd'),JSON[_0x8a8f('0x10')](_0x29652f));if(_0x29652f[_0x8a8f('0x11')]){if(_0x29652f[_0x8a8f('0x11')][_0x8a8f('0x12')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x198340,_0x29652f[_0x8a8f('0x11')][_0x8a8f('0x13')]);return _0x3f4d16(_0x29652f[_0x8a8f('0x11')][_0x8a8f('0x13')]);}logger[_0x8a8f('0x11')](_0x8a8f('0xc'),_0x198340,_0x29652f['error'][_0x8a8f('0x13')]);return _0x33edd1(_0x29652f[_0x8a8f('0x11')][_0x8a8f('0x13')]);}else{logger[_0x8a8f('0x14')](_0x8a8f('0xc'),_0x198340,_0x8a8f('0xd'));_0x33edd1(_0x29652f[_0x8a8f('0x15')][_0x8a8f('0x13')]);}})[_0x8a8f('0x16')](function(_0x4e0884){logger[_0x8a8f('0x11')](_0x8a8f('0xc'),_0x198340,_0x4e0884);_0x3f4d16(_0x4e0884);});});}
\ No newline at end of file
+var _0xbf37=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf37,0xfd));var _0x7bf3=function(_0x105a77,_0x39b87b){_0x105a77=_0x105a77-0x0;var _0x3e8155=_0xbf37[_0x105a77];return _0x3e8155;};'use strict';var _=require(_0x7bf3('0x0'));var util=require(_0x7bf3('0x1'));var moment=require(_0x7bf3('0x2'));var BPromise=require(_0x7bf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf3('0x4'));var db=require(_0x7bf3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bf3('0x6'))(_0x7bf3('0x7'));var config=require('../../config/environment');var jayson=require(_0x7bf3('0x8'));var client=jayson[_0x7bf3('0x9')][_0x7bf3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x386b07,_0x2da045,_0x2ed1de){return new BPromise(function(_0x39a35f,_0x5a5063){return client['request'](_0x386b07,_0x2ed1de)[_0x7bf3('0xb')](function(_0x248bcf){logger[_0x7bf3('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2da045,'request\x20sent');logger['debug'](_0x7bf3('0xd'),_0x2da045,_0x7bf3('0xe'),JSON['stringify'](_0x248bcf));if(_0x248bcf[_0x7bf3('0xf')]){if(_0x248bcf[_0x7bf3('0xf')][_0x7bf3('0x10')]===0x1f4){logger[_0x7bf3('0xf')](_0x7bf3('0x11'),_0x2da045,_0x248bcf[_0x7bf3('0xf')][_0x7bf3('0x12')]);return _0x5a5063(_0x248bcf[_0x7bf3('0xf')][_0x7bf3('0x12')]);}logger[_0x7bf3('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2da045,_0x248bcf[_0x7bf3('0xf')][_0x7bf3('0x12')]);return _0x39a35f(_0x248bcf['error'][_0x7bf3('0x12')]);}else{logger[_0x7bf3('0xc')](_0x7bf3('0x11'),_0x2da045,_0x7bf3('0xe'));_0x39a35f(_0x248bcf[_0x7bf3('0x13')]['message']);}})[_0x7bf3('0x14')](function(_0x81a9eb){logger[_0x7bf3('0xf')](_0x7bf3('0x11'),_0x2da045,_0x81a9eb);_0x5a5063(_0x81a9eb);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 367de83..4c80a16 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 _0x6177=['fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3b6873,_0x5eef7f){var _0x322c5e=function(_0x187a5b){while(--_0x187a5b){_0x3b6873['push'](_0x3b6873['shift']());}};_0x322c5e(++_0x5eef7f);}(_0x6177,0xf6));var _0x7617=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x6177[_0x55abd9];return _0x3e5669;};'use strict';var multer=require(_0x7617('0x0'));var util=require(_0x7617('0x1'));var path=require(_0x7617('0x2'));var timeout=require(_0x7617('0x3'));var express=require(_0x7617('0x4'));var router=express[_0x7617('0x5')]();var fs_extra=require(_0x7617('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7617('0x7'));var config=require(_0x7617('0x8'));var controller=require(_0x7617('0x9'));router[_0x7617('0xa')]('/',auth[_0x7617('0xb')](),controller[_0x7617('0xc')]);router['get'](_0x7617('0xd'),auth[_0x7617('0xb')](),controller[_0x7617('0xe')]);router[_0x7617('0xa')](_0x7617('0xf'),auth['isAuthenticated'](),controller[_0x7617('0x10')]);router[_0x7617('0xa')](_0x7617('0x11'),auth['isAuthenticated'](),controller[_0x7617('0x12')]);router[_0x7617('0xa')](_0x7617('0x13'),auth['isAuthenticated'](),controller[_0x7617('0x14')]);router[_0x7617('0x15')]('/',auth[_0x7617('0xb')](),controller[_0x7617('0x16')]);router[_0x7617('0x17')](_0x7617('0xd'),auth[_0x7617('0xb')](),controller[_0x7617('0x18')]);router[_0x7617('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x7617('0x1a')]);module[_0x7617('0x1b')]=router;
\ No newline at end of file
+var _0x4134=['get','show','preview','isAuthenticated','run','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x4134,0x139));var _0x4413=function(_0x13056b,_0x14fe2b){_0x13056b=_0x13056b-0x0;var _0x38b789=_0x4134[_0x13056b];return _0x38b789;};'use strict';var multer=require(_0x4413('0x0'));var util=require(_0x4413('0x1'));var path=require(_0x4413('0x2'));var timeout=require(_0x4413('0x3'));var express=require(_0x4413('0x4'));var router=express['Router']();var fs_extra=require(_0x4413('0x5'));var auth=require(_0x4413('0x6'));var interaction=require(_0x4413('0x7'));var config=require('../../config/environment');var controller=require(_0x4413('0x8'));router[_0x4413('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4413('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4413('0xa')]);router[_0x4413('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0x4413('0xb')]);router[_0x4413('0x9')]('/:id/run',auth[_0x4413('0xc')](),controller[_0x4413('0xd')]);router[_0x4413('0x9')]('/:id/query',auth[_0x4413('0xc')](),controller[_0x4413('0xe')]);router[_0x4413('0xf')]('/',auth[_0x4413('0xc')](),controller[_0x4413('0x10')]);router[_0x4413('0x11')](_0x4413('0x12'),auth[_0x4413('0xc')](),controller[_0x4413('0x13')]);router[_0x4413('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x4413('0x15')]);module[_0x4413('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index cc3b698..ea522e1 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 _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x270dba,_0x1817d2){var _0x36b83b=function(_0x15a276){while(--_0x15a276){_0x270dba['push'](_0x270dba['shift']());}};_0x36b83b(++_0x1817d2);}(_0x5075,0x73));var _0x5507=function(_0x2bf5bd,_0x120787){_0x2bf5bd=_0x2bf5bd-0x0;var _0xc810c0=_0x5075[_0x2bf5bd];return _0xc810c0;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x038b=['exports','STRING','TEXT'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x038b,0x114));var _0xb038=function(_0x31ffde,_0x212061){_0x31ffde=_0x31ffde-0x0;var _0x4ea5dc=_0x038b[_0x31ffde];return _0x4ea5dc;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 922b5d0..e68b6cb 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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x179630,_0x2929e1){var _0x1d5ee0=function(_0x30c6c7){while(--_0x30c6c7){_0x179630['push'](_0x179630['shift']());}};_0x1d5ee0(++_0x2929e1);}(_0x2675,0x75));var _0x5267=function(_0x3fbc8f,_0x22fc47){_0x3fbc8f=_0x3fbc8f-0x0;var _0x2b6e81=_0x2675[_0x3fbc8f];return _0x2b6e81;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
+var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x39f11f,_0xa18250){var _0x387198=function(_0x4d0b1f){while(--_0x4d0b1f){_0x39f11f['push'](_0x39f11f['shift']());}};_0x387198(++_0xa18250);}(_0x187d,0x93));var _0xd187=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x187d[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a25ab0a..aedc5a1 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 _0x9ad9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','../../config/logger'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0x9ad9,0xbe));var _0x99ad=function(_0x1188a8,_0xc1498d){_0x1188a8=_0x1188a8-0x0;var _0x50c1c1=_0x9ad9[_0x1188a8];return _0x50c1c1;};'use strict';var _=require(_0x99ad('0x0'));var util=require('util');var logger=require(_0x99ad('0x1'))('api');var moment=require(_0x99ad('0x2'));var BPromise=require(_0x99ad('0x3'));var rp=require(_0x99ad('0x4'));var fs=require('fs');var path=require(_0x99ad('0x5'));var rimraf=require(_0x99ad('0x6'));var config=require(_0x99ad('0x7'));var attributes=require(_0x99ad('0x8'));module[_0x99ad('0x9')]=function(_0x538573,_0x2b49ff){return _0x538573[_0x99ad('0xa')](_0x99ad('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b10=['analytics_default_reports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0xd31621,_0x17b567){var _0x2e7ac0=function(_0x3c5a8d){while(--_0x3c5a8d){_0xd31621['push'](_0xd31621['shift']());}};_0x2e7ac0(++_0x17b567);}(_0x6b10,0x115));var _0x06b1=function(_0x1bac6b,_0x4891cd){_0x1bac6b=_0x1bac6b-0x0;var _0x6a71be=_0x6b10[_0x1bac6b];return _0x6a71be;};'use strict';var _=require(_0x06b1('0x0'));var util=require('util');var logger=require(_0x06b1('0x1'))('api');var moment=require(_0x06b1('0x2'));var BPromise=require(_0x06b1('0x3'));var rp=require(_0x06b1('0x4'));var fs=require('fs');var path=require(_0x06b1('0x5'));var rimraf=require(_0x06b1('0x6'));var config=require(_0x06b1('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x06b1('0x8')]=function(_0x53fbff,_0x1a0334){return _0x53fbff[_0x06b1('0x9')](_0x06b1('0xa'),attributes,{'tableName':_0x06b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index f49f689..a41a2a3 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 _0x11a2=['ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x43be21,_0x1a1140){var _0x535370=function(_0x5a8d39){while(--_0x5a8d39){_0x43be21['push'](_0x43be21['shift']());}};_0x535370(++_0x1a1140);}(_0x11a2,0x1b0));var _0x211a=function(_0x286ce6,_0xba727b){_0x286ce6=_0x286ce6-0x0;var _0x1b53a4=_0x11a2[_0x286ce6];return _0x1b53a4;};'use strict';var _=require(_0x211a('0x0'));var util=require(_0x211a('0x1'));var moment=require(_0x211a('0x2'));var BPromise=require(_0x211a('0x3'));var rs=require(_0x211a('0x4'));var fs=require('fs');var Redis=require(_0x211a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x211a('0x6'))('rpc');var config=require(_0x211a('0x7'));var jayson=require(_0x211a('0x8'));var client=jayson['client'][_0x211a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5963d2,_0x416e15,_0x83d36c){return new BPromise(function(_0x1a2d64,_0x8da155){return client[_0x211a('0xa')](_0x5963d2,_0x83d36c)[_0x211a('0xb')](function(_0xc8697d){logger['info'](_0x211a('0xc'),_0x416e15,_0x211a('0xd'));logger[_0x211a('0xe')](_0x211a('0xf'),_0x416e15,_0x211a('0xd'),JSON[_0x211a('0x10')](_0xc8697d));if(_0xc8697d[_0x211a('0x11')]){if(_0xc8697d[_0x211a('0x11')][_0x211a('0x12')]===0x1f4){logger[_0x211a('0x11')](_0x211a('0xc'),_0x416e15,_0xc8697d[_0x211a('0x11')][_0x211a('0x13')]);return _0x8da155(_0xc8697d[_0x211a('0x11')][_0x211a('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x416e15,_0xc8697d[_0x211a('0x11')]['message']);return _0x1a2d64(_0xc8697d[_0x211a('0x11')][_0x211a('0x13')]);}else{logger[_0x211a('0x14')](_0x211a('0xc'),_0x416e15,_0x211a('0xd'));_0x1a2d64(_0xc8697d[_0x211a('0x15')][_0x211a('0x13')]);}})[_0x211a('0x16')](function(_0x3b2bb0){logger[_0x211a('0x11')](_0x211a('0xc'),_0x416e15,_0x3b2bb0);_0x8da155(_0x3b2bb0);});});}
\ No newline at end of file
+var _0x3c00=['jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x3c00,0x1d4));var _0x03c0=function(_0x86782f,_0x436231){_0x86782f=_0x86782f-0x0;var _0x2d50b5=_0x3c00[_0x86782f];return _0x2d50b5;};'use strict';var _=require('lodash');var util=require(_0x03c0('0x0'));var moment=require(_0x03c0('0x1'));var BPromise=require(_0x03c0('0x2'));var rs=require(_0x03c0('0x3'));var fs=require('fs');var Redis=require(_0x03c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x03c0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x03c0('0x6'));var jayson=require(_0x03c0('0x7'));var client=jayson[_0x03c0('0x8')][_0x03c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b4827,_0x2bbb03,_0x3dd539){return new BPromise(function(_0x2bdb2e,_0x22730b){return client[_0x03c0('0xa')](_0x1b4827,_0x3dd539)[_0x03c0('0xb')](function(_0x4e5048){logger[_0x03c0('0xc')](_0x03c0('0xd'),_0x2bbb03,'request\x20sent');logger[_0x03c0('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2bbb03,'request\x20sent',JSON['stringify'](_0x4e5048));if(_0x4e5048['error']){if(_0x4e5048[_0x03c0('0xf')][_0x03c0('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2bbb03,_0x4e5048['error']['message']);return _0x22730b(_0x4e5048[_0x03c0('0xf')][_0x03c0('0x11')]);}logger[_0x03c0('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2bbb03,_0x4e5048[_0x03c0('0xf')][_0x03c0('0x11')]);return _0x2bdb2e(_0x4e5048['error'][_0x03c0('0x11')]);}else{logger[_0x03c0('0xc')](_0x03c0('0xd'),_0x2bbb03,_0x03c0('0x12'));_0x2bdb2e(_0x4e5048['result']['message']);}})['catch'](function(_0x18d3ca){logger[_0x03c0('0xf')](_0x03c0('0xd'),_0x2bbb03,_0x18d3ca);_0x22730b(_0x18d3ca);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 92724ec..516b22f 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 _0x3b1a=['/:id/run','run','query','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview'];(function(_0x3751d3,_0x78104d){var _0xa19b11=function(_0x4da3c6){while(--_0x4da3c6){_0x3751d3['push'](_0x3751d3['shift']());}};_0xa19b11(++_0x78104d);}(_0x3b1a,0x9e));var _0xa3b1=function(_0xf98ec1,_0x4c73b8){_0xf98ec1=_0xf98ec1-0x0;var _0x514b6a=_0x3b1a[_0xf98ec1];return _0x514b6a;};'use strict';var multer=require(_0xa3b1('0x0'));var util=require(_0xa3b1('0x1'));var path=require(_0xa3b1('0x2'));var timeout=require(_0xa3b1('0x3'));var express=require(_0xa3b1('0x4'));var router=express[_0xa3b1('0x5')]();var fs_extra=require(_0xa3b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa3b1('0x7'));var config=require(_0xa3b1('0x8'));var controller=require(_0xa3b1('0x9'));router['get']('/',auth[_0xa3b1('0xa')](),controller[_0xa3b1('0xb')]);router[_0xa3b1('0xc')](_0xa3b1('0xd'),auth[_0xa3b1('0xa')](),controller[_0xa3b1('0xe')]);router[_0xa3b1('0xc')](_0xa3b1('0xf'),auth[_0xa3b1('0xa')](),controller[_0xa3b1('0x10')]);router[_0xa3b1('0xc')](_0xa3b1('0x11'),auth['isAuthenticated'](),controller[_0xa3b1('0x12')]);router[_0xa3b1('0xc')]('/:id/query',auth[_0xa3b1('0xa')](),controller[_0xa3b1('0x13')]);router['post']('/',auth[_0xa3b1('0xa')](),controller[_0xa3b1('0x14')]);router[_0xa3b1('0x15')](_0xa3b1('0xd'),auth[_0xa3b1('0xa')](),controller[_0xa3b1('0x16')]);router[_0xa3b1('0x17')](_0xa3b1('0xd'),auth['isAuthenticated'](),controller[_0xa3b1('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xb344=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','run','query','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b6983,_0x53d5f9){var _0x1e2978=function(_0x44f668){while(--_0x44f668){_0x5b6983['push'](_0x5b6983['shift']());}};_0x1e2978(++_0x53d5f9);}(_0xb344,0x152));var _0x4b34=function(_0x59aecc,_0x255014){_0x59aecc=_0x59aecc-0x0;var _0x46b112=_0xb344[_0x59aecc];return _0x46b112;};'use strict';var multer=require(_0x4b34('0x0'));var util=require(_0x4b34('0x1'));var path=require(_0x4b34('0x2'));var timeout=require(_0x4b34('0x3'));var express=require(_0x4b34('0x4'));var router=express[_0x4b34('0x5')]();var fs_extra=require(_0x4b34('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4b34('0x7'));var config=require(_0x4b34('0x8'));var controller=require(_0x4b34('0x9'));router['get']('/',auth[_0x4b34('0xa')](),controller[_0x4b34('0xb')]);router['get'](_0x4b34('0xc'),auth['isAuthenticated'](),controller[_0x4b34('0xd')]);router[_0x4b34('0xe')]('/:id/preview',auth[_0x4b34('0xa')](),controller['preview']);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x4b34('0xf')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x4b34('0x10')]);router[_0x4b34('0x11')]('/',auth[_0x4b34('0xa')](),controller[_0x4b34('0x12')]);router[_0x4b34('0x13')](_0x4b34('0xc'),auth[_0x4b34('0xa')](),controller[_0x4b34('0x14')]);router[_0x4b34('0x15')](_0x4b34('0xc'),auth[_0x4b34('0xa')](),controller['destroy']);module[_0x4b34('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 12a7c29..c55b90d 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 _0x60d7=['Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','DATE'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x60d7,0x131));var _0x760d=function(_0x5468c2,_0x22dd1e){_0x5468c2=_0x5468c2-0x0;var _0x445aa3=_0x60d7[_0x5468c2];return _0x445aa3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x760d('0x0'));module[_0x760d('0x1')]={'name':{'type':Sequelize[_0x760d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x760d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x760d('0x3')](_0x760d('0x4'),_0x760d('0x5'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x760d('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x760d('0x7')},'type':{'type':Sequelize[_0x760d('0x3')](_0x760d('0x8'),_0x760d('0x9')),'allowNull':![],'defaultValue':_0x760d('0x8')},'reportId':{'type':Sequelize[_0x760d('0xa')](0xb)[_0x760d('0xb')]},'reportType':{'type':Sequelize[_0x760d('0x2')]}};
\ No newline at end of file
+var _0xbed8=['csv','pdf','xlsx','DATE','Loading','scheduled','manual','UNSIGNED','sequelize','moment','STRING','ENUM'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xbed8,0x80));var _0x8bed=function(_0x398d85,_0x2465d7){_0x398d85=_0x398d85-0x0;var _0x33c2bb=_0xbed8[_0x398d85];return _0x33c2bb;};'use strict';var Sequelize=require(_0x8bed('0x0'));var moment=require(_0x8bed('0x1'));module['exports']={'name':{'type':Sequelize[_0x8bed('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8bed('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8bed('0x3')](_0x8bed('0x4'),_0x8bed('0x5'),_0x8bed('0x6')),'allowNull':![],'defaultValue':_0x8bed('0x4')},'savename':{'type':Sequelize[_0x8bed('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8bed('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x8bed('0x8')},'type':{'type':Sequelize[_0x8bed('0x3')]('manual',_0x8bed('0x9')),'allowNull':![],'defaultValue':_0x8bed('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8bed('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index aa28a5b..c14ef58 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 _0xf368=['limit','offset','count','Content-Range','apply','update','destroy','then','get','UserProfileResource','stack','name','send','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','role','user','ExtractedReports','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xf368,0x1bd));var _0x8f36=function(_0xe34682,_0x1da5bd){_0xe34682=_0xe34682-0x0;var _0x48490c=_0xf368[_0xe34682];return _0x48490c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f36('0x0'));var zipdir=require(_0x8f36('0x1'));var jsonpatch=require(_0x8f36('0x2'));var rp=require(_0x8f36('0x3'));var moment=require(_0x8f36('0x4'));var BPromise=require(_0x8f36('0x5'));var Mustache=require(_0x8f36('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8f36('0x7'));var csv=require(_0x8f36('0x8'));var ejs=require(_0x8f36('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f36('0xa'));var squel=require(_0x8f36('0xb'));var crypto=require(_0x8f36('0xc'));var jsforce=require(_0x8f36('0xd'));var deskjs=require(_0x8f36('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f36('0xf'));var Redis=require(_0x8f36('0x10'));var authService=require(_0x8f36('0x11'));var qs=require(_0x8f36('0x12'));var as=require(_0x8f36('0x13'));var hardwareService=require(_0x8f36('0x14'));var logger=require('../../config/logger')(_0x8f36('0x15'));var utils=require(_0x8f36('0x16'));var config=require(_0x8f36('0x17'));var licenseUtil=require(_0x8f36('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a5c3a,_0x3013de){_0x3013de=_0x3013de||0xcc;return function(_0x4f3de7){if(_0x4f3de7){return _0x2a5c3a[_0x8f36('0x19')](_0x3013de);}return _0x2a5c3a['status'](_0x3013de)[_0x8f36('0x1a')]();};}function respondWithResult(_0x6e24af,_0x1d5e21){_0x1d5e21=_0x1d5e21||0xc8;return function(_0x545bc7){if(_0x545bc7){return _0x6e24af[_0x8f36('0x1b')](_0x1d5e21)[_0x8f36('0x1c')](_0x545bc7);}};}function respondWithFilteredResult(_0x5c6bd5,_0x58fb35){return function(_0xf03ea0){if(_0xf03ea0){var _0x84f1d9=typeof _0x58fb35['offset']===_0x8f36('0x1d')&&typeof _0x58fb35[_0x8f36('0x1e')]===_0x8f36('0x1d');var _0x2b6951=_0xf03ea0['count'];var _0x1bcbcc=_0x84f1d9?0x0:_0x58fb35[_0x8f36('0x1f')];var _0x14fd8e=_0x84f1d9?_0xf03ea0[_0x8f36('0x20')]:_0x58fb35['offset']+_0x58fb35[_0x8f36('0x1e')];var _0x33fd84;if(_0x14fd8e>=_0x2b6951){_0x14fd8e=_0x2b6951;_0x33fd84=0xc8;}else{_0x33fd84=0xce;}_0x5c6bd5[_0x8f36('0x1b')](_0x33fd84);return _0x5c6bd5['set'](_0x8f36('0x21'),_0x1bcbcc+'-'+_0x14fd8e+'/'+_0x2b6951)[_0x8f36('0x1c')](_0xf03ea0);}return null;};}function patchUpdates(_0x185a76){return function(_0x95c50e){try{jsonpatch[_0x8f36('0x22')](_0x95c50e,_0x185a76,!![]);}catch(_0xd71f55){return BPromise['reject'](_0xd71f55);}return _0x95c50e['save']();};}function saveUpdates(_0x3046a3,_0x110009){return function(_0x44d534){if(_0x44d534){return _0x44d534[_0x8f36('0x23')](_0x3046a3)['then'](function(_0x563338){return _0x563338;});}return null;};}function removeEntity(_0x7cd973,_0x3bcb6b){return function(_0x4bd83f){if(_0x4bd83f){return _0x4bd83f[_0x8f36('0x24')]()[_0x8f36('0x25')](function(){var _0x20ad72=_0x4bd83f[_0x8f36('0x26')]({'plain':!![]});var _0x3fa817='ExtractedReports';return db[_0x8f36('0x27')][_0x8f36('0x24')]({'where':{'type':_0x3fa817,'resourceId':_0x20ad72['id']}})[_0x8f36('0x25')](function(){return _0x4bd83f;});})[_0x8f36('0x25')](function(){_0x7cd973[_0x8f36('0x1b')](0xcc)[_0x8f36('0x1a')]();});}};}function handleEntityNotFound(_0x22d21b,_0x175ae0){return function(_0xa09196){if(!_0xa09196){_0x22d21b[_0x8f36('0x19')](0x194);}return _0xa09196;};}function handleError(_0x2d0ff8,_0x3259e9){_0x3259e9=_0x3259e9||0x1f4;return function(_0x166f11){logger['error'](_0x166f11[_0x8f36('0x28')]);if(_0x166f11[_0x8f36('0x29')]){delete _0x166f11[_0x8f36('0x29')];}_0x2d0ff8['status'](_0x3259e9)[_0x8f36('0x2a')](_0x166f11);};}exports['index']=function(_0x27b8d3,_0x17bfcf){var _0x16de3f={},_0x554176={},_0x197079={'count':0x0,'rows':[]};var _0x2f1967=_[_0x8f36('0x2b')](db[_0x8f36('0x2c')]['rawAttributes'],function(_0x54a4b1){return{'name':_0x54a4b1[_0x8f36('0x2d')],'type':_0x54a4b1[_0x8f36('0x2e')][_0x8f36('0x2f')]};});_0x554176[_0x8f36('0x30')]=_['map'](_0x2f1967,'name');_0x554176[_0x8f36('0x31')]=_[_0x8f36('0x32')](_0x27b8d3['query']);_0x554176[_0x8f36('0x33')]=_[_0x8f36('0x34')](_0x554176[_0x8f36('0x30')],_0x554176['query']);_0x16de3f['attributes']=_[_0x8f36('0x34')](_0x554176[_0x8f36('0x30')],qs[_0x8f36('0x35')](_0x27b8d3[_0x8f36('0x31')][_0x8f36('0x35')]));_0x16de3f['attributes']=_0x16de3f[_0x8f36('0x36')][_0x8f36('0x37')]?_0x16de3f[_0x8f36('0x36')]:_0x554176[_0x8f36('0x30')];if(!_0x27b8d3['query'][_0x8f36('0x38')](_0x8f36('0x39'))){_0x16de3f['limit']=qs['limit'](_0x27b8d3[_0x8f36('0x31')][_0x8f36('0x1e')]);_0x16de3f[_0x8f36('0x1f')]=qs[_0x8f36('0x1f')](_0x27b8d3['query'][_0x8f36('0x1f')]);}_0x16de3f['order']=qs[_0x8f36('0x3a')](_0x27b8d3['query']['sort']);_0x16de3f[_0x8f36('0x3b')]=qs[_0x8f36('0x33')](_['pick'](_0x27b8d3[_0x8f36('0x31')],_0x554176[_0x8f36('0x33')]),_0x2f1967);if(_0x27b8d3[_0x8f36('0x31')]['filter']){_0x16de3f[_0x8f36('0x3b')]=_[_0x8f36('0x3c')](_0x16de3f['where'],{'$or':_[_0x8f36('0x2b')](_0x2f1967,function(_0x418143){if(_0x418143['type']!==_0x8f36('0x3d')){var _0x1fe6de={};_0x1fe6de[_0x418143[_0x8f36('0x29')]]={'$like':'%'+_0x27b8d3[_0x8f36('0x31')][_0x8f36('0x3e')]+'%'};return _0x1fe6de;}})});}_0x16de3f=_[_0x8f36('0x3c')]({},_0x16de3f,_0x27b8d3[_0x8f36('0x3f')]);var _0x148590={'where':_0x16de3f[_0x8f36('0x3b')]};return db[_0x8f36('0x2c')][_0x8f36('0x20')](_0x148590)['then'](function(_0x256fd3){_0x197079[_0x8f36('0x20')]=_0x256fd3;if(_0x27b8d3[_0x8f36('0x31')][_0x8f36('0x40')]){_0x16de3f[_0x8f36('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x16de3f);})[_0x8f36('0x25')](function(_0x4cfc95){_0x197079[_0x8f36('0x42')]=_0x4cfc95;return _0x197079;})[_0x8f36('0x25')](respondWithFilteredResult(_0x17bfcf,_0x16de3f))['catch'](handleError(_0x17bfcf,null));};exports[_0x8f36('0x43')]=function(_0x2fc67e,_0xff83bb){var _0x45aece={'raw':!![],'where':{'id':_0x2fc67e[_0x8f36('0x44')]['id']}},_0x137b6c={};_0x137b6c[_0x8f36('0x30')]=_[_0x8f36('0x32')](db[_0x8f36('0x2c')][_0x8f36('0x45')]);_0x137b6c['query']=_[_0x8f36('0x32')](_0x2fc67e['query']);_0x137b6c[_0x8f36('0x33')]=_['intersection'](_0x137b6c[_0x8f36('0x30')],_0x137b6c['query']);_0x45aece[_0x8f36('0x36')]=_[_0x8f36('0x34')](_0x137b6c[_0x8f36('0x30')],qs[_0x8f36('0x35')](_0x2fc67e[_0x8f36('0x31')][_0x8f36('0x35')]));_0x45aece[_0x8f36('0x36')]=_0x45aece[_0x8f36('0x36')]['length']?_0x45aece['attributes']:_0x137b6c[_0x8f36('0x30')];if(_0x2fc67e[_0x8f36('0x31')]['includeAll']){_0x45aece[_0x8f36('0x41')]=[{'all':!![]}];}_0x45aece=_[_0x8f36('0x3c')]({},_0x45aece,_0x2fc67e[_0x8f36('0x3f')]);return db[_0x8f36('0x2c')][_0x8f36('0x46')](_0x45aece)['then'](handleEntityNotFound(_0xff83bb,null))[_0x8f36('0x25')](respondWithResult(_0xff83bb,null))[_0x8f36('0x47')](handleError(_0xff83bb,null));};exports[_0x8f36('0x48')]=function(_0x314d5a,_0x3c06f8){return db[_0x8f36('0x2c')]['create'](_0x314d5a['body'],{})[_0x8f36('0x25')](function(_0x1b6991){var _0x154384=_0x314d5a['user'][_0x8f36('0x26')]({'plain':!![]});if(!_0x154384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x154384[_0x8f36('0x49')]===_0x8f36('0x4a')){var _0x4a670b=_0x1b6991[_0x8f36('0x26')]({'plain':!![]});var _0x1a5ead=_0x8f36('0x4b');return db['UserProfileSection'][_0x8f36('0x46')]({'where':{'name':_0x1a5ead,'userProfileId':_0x154384[_0x8f36('0x4c')]},'raw':!![]})['then'](function(_0x4b8ff2){if(_0x4b8ff2&&_0x4b8ff2[_0x8f36('0x4d')]===0x0){return db[_0x8f36('0x27')][_0x8f36('0x48')]({'name':_0x4a670b[_0x8f36('0x29')],'resourceId':_0x4a670b['id'],'type':_0x4b8ff2[_0x8f36('0x29')],'sectionId':_0x4b8ff2['id']},{})[_0x8f36('0x25')](function(){return _0x1b6991;});}else{return _0x1b6991;}})[_0x8f36('0x47')](function(_0x48cf95){logger[_0x8f36('0x4e')](_0x8f36('0x4f'),_0x48cf95);throw _0x48cf95;});}return _0x1b6991;})[_0x8f36('0x25')](respondWithResult(_0x3c06f8,0xc9))[_0x8f36('0x47')](handleError(_0x3c06f8,null));};exports[_0x8f36('0x23')]=function(_0x22851e,_0x3343db){if(_0x22851e[_0x8f36('0x50')]['id']){delete _0x22851e['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x22851e[_0x8f36('0x44')]['id']}})[_0x8f36('0x25')](handleEntityNotFound(_0x3343db,null))['then'](saveUpdates(_0x22851e[_0x8f36('0x50')],null))[_0x8f36('0x25')](respondWithResult(_0x3343db,null))[_0x8f36('0x47')](handleError(_0x3343db,null));};exports[_0x8f36('0x24')]=function(_0x10105a,_0x3f896c){return db[_0x8f36('0x2c')]['find']({'where':{'id':_0x10105a[_0x8f36('0x44')]['id']}})[_0x8f36('0x25')](handleEntityNotFound(_0x3f896c,null))[_0x8f36('0x25')](removeEntity(_0x3f896c,null))[_0x8f36('0x47')](handleError(_0x3f896c,null));};exports[_0x8f36('0x51')]=function(_0x417470,_0x4ab7e6,_0x1b35a6){return db[_0x8f36('0x2c')][_0x8f36('0x46')]({'where':{'id':_0x417470[_0x8f36('0x44')]['id']},'attributes':[_0x8f36('0x29'),_0x8f36('0x52'),'savename',_0x8f36('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x4ab7e6,null))[_0x8f36('0x25')](function(_0xc70224){if(_0xc70224){if(!fs[_0x8f36('0x54')](path[_0x8f36('0x55')](config[_0x8f36('0x56')],_0x8f36('0x57'),_0xc70224[_0x8f36('0x58')]))){throw new db[(_0x8f36('0x59'))][(_0x8f36('0x5a'))](_0x8f36('0x5b'));}if(_0x417470['query'][_0x8f36('0x5c')]){return _0x4ab7e6[_0x8f36('0x19')](0xc8);}return _0x4ab7e6[_0x8f36('0x51')](path[_0x8f36('0x55')](config[_0x8f36('0x56')],_0x8f36('0x57'),_0xc70224[_0x8f36('0x58')]),util['format'](_0x8f36('0x5d'),_0xc70224[_0x8f36('0x52')]||_0xc70224['name'],_0xc70224[_0x8f36('0x53')][_0x8f36('0x5e')]()));}})['catch'](handleError(_0x4ab7e6,null));};
\ No newline at end of file
+var _0x57f4=['set','apply','reject','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','AnalyticExtractedReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','download','params','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','root','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit'];(function(_0x8f4ca2,_0xc4ac52){var _0x126663=function(_0x1eebee){while(--_0x1eebee){_0x8f4ca2['push'](_0x8f4ca2['shift']());}};_0x126663(++_0xc4ac52);}(_0x57f4,0x1b6));var _0x457f=function(_0x5b872c,_0x521dc6){_0x5b872c=_0x5b872c-0x0;var _0x4ffc94=_0x57f4[_0x5b872c];return _0x4ffc94;};'use strict';var emlformat=require(_0x457f('0x0'));var rimraf=require(_0x457f('0x1'));var zipdir=require(_0x457f('0x2'));var jsonpatch=require(_0x457f('0x3'));var rp=require(_0x457f('0x4'));var moment=require(_0x457f('0x5'));var BPromise=require(_0x457f('0x6'));var Mustache=require(_0x457f('0x7'));var util=require(_0x457f('0x8'));var path=require('path');var sox=require(_0x457f('0x9'));var csv=require('to-csv');var ejs=require(_0x457f('0xa'));var fs=require('fs');var fs_extra=require(_0x457f('0xb'));var _=require(_0x457f('0xc'));var squel=require('squel');var crypto=require(_0x457f('0xd'));var jsforce=require(_0x457f('0xe'));var deskjs=require(_0x457f('0xf'));var toCsv=require(_0x457f('0x10'));var querystring=require(_0x457f('0x11'));var Papa=require(_0x457f('0x12'));var Redis=require(_0x457f('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x457f('0x14'));var logger=require(_0x457f('0x15'))('api');var utils=require(_0x457f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x457f('0x17'))['db'];function respondWithStatusCode(_0x59d093,_0x561e52){_0x561e52=_0x561e52||0xcc;return function(_0x1ffc30){if(_0x1ffc30){return _0x59d093[_0x457f('0x18')](_0x561e52);}return _0x59d093[_0x457f('0x19')](_0x561e52)[_0x457f('0x1a')]();};}function respondWithResult(_0x1acb6a,_0x492708){_0x492708=_0x492708||0xc8;return function(_0x36d745){if(_0x36d745){return _0x1acb6a[_0x457f('0x19')](_0x492708)[_0x457f('0x1b')](_0x36d745);}};}function respondWithFilteredResult(_0x2499a9,_0x5d7d0f){return function(_0x476838){if(_0x476838){var _0x92b8e0=typeof _0x5d7d0f['offset']===_0x457f('0x1c')&&typeof _0x5d7d0f['limit']===_0x457f('0x1c');var _0x12c6bd=_0x476838[_0x457f('0x1d')];var _0x47b349=_0x92b8e0?0x0:_0x5d7d0f[_0x457f('0x1e')];var _0x2abd3f=_0x92b8e0?_0x476838[_0x457f('0x1d')]:_0x5d7d0f[_0x457f('0x1e')]+_0x5d7d0f[_0x457f('0x1f')];var _0xc6b218;if(_0x2abd3f>=_0x12c6bd){_0x2abd3f=_0x12c6bd;_0xc6b218=0xc8;}else{_0xc6b218=0xce;}_0x2499a9[_0x457f('0x19')](_0xc6b218);return _0x2499a9[_0x457f('0x20')]('Content-Range',_0x47b349+'-'+_0x2abd3f+'/'+_0x12c6bd)[_0x457f('0x1b')](_0x476838);}return null;};}function patchUpdates(_0xfc9273){return function(_0x202183){try{jsonpatch[_0x457f('0x21')](_0x202183,_0xfc9273,!![]);}catch(_0x1ac777){return BPromise[_0x457f('0x22')](_0x1ac777);}return _0x202183['save']();};}function saveUpdates(_0x436cdd,_0x2b555c){return function(_0x496cf1){if(_0x496cf1){return _0x496cf1[_0x457f('0x23')](_0x436cdd)[_0x457f('0x24')](function(_0x2319d7){return _0x2319d7;});}return null;};}function removeEntity(_0x471fac,_0xe44762){return function(_0x111aeb){if(_0x111aeb){return _0x111aeb[_0x457f('0x25')]()[_0x457f('0x24')](function(){var _0x18447a=_0x111aeb[_0x457f('0x26')]({'plain':!![]});var _0x1753af=_0x457f('0x27');return db['UserProfileResource'][_0x457f('0x25')]({'where':{'type':_0x1753af,'resourceId':_0x18447a['id']}})['then'](function(){return _0x111aeb;});})[_0x457f('0x24')](function(){_0x471fac[_0x457f('0x19')](0xcc)[_0x457f('0x1a')]();});}};}function handleEntityNotFound(_0x5c951b,_0x4a4364){return function(_0x1e6e81){if(!_0x1e6e81){_0x5c951b['sendStatus'](0x194);}return _0x1e6e81;};}function handleError(_0x2148a5,_0x16b947){_0x16b947=_0x16b947||0x1f4;return function(_0xd330e4){logger[_0x457f('0x28')](_0xd330e4[_0x457f('0x29')]);if(_0xd330e4[_0x457f('0x2a')]){delete _0xd330e4[_0x457f('0x2a')];}_0x2148a5['status'](_0x16b947)[_0x457f('0x2b')](_0xd330e4);};}exports[_0x457f('0x2c')]=function(_0x41bda9,_0x28f3d3){var _0x57f9de={},_0x3def51={},_0xe96095={'count':0x0,'rows':[]};var _0x21a148=_['map'](db[_0x457f('0x2d')]['rawAttributes'],function(_0x3354af){return{'name':_0x3354af['fieldName'],'type':_0x3354af[_0x457f('0x2e')][_0x457f('0x2f')]};});_0x3def51[_0x457f('0x30')]=_['map'](_0x21a148,_0x457f('0x2a'));_0x3def51[_0x457f('0x31')]=_[_0x457f('0x32')](_0x41bda9[_0x457f('0x31')]);_0x3def51[_0x457f('0x33')]=_[_0x457f('0x34')](_0x3def51[_0x457f('0x30')],_0x3def51['query']);_0x57f9de[_0x457f('0x35')]=_[_0x457f('0x34')](_0x3def51[_0x457f('0x30')],qs[_0x457f('0x36')](_0x41bda9[_0x457f('0x31')][_0x457f('0x36')]));_0x57f9de['attributes']=_0x57f9de[_0x457f('0x35')][_0x457f('0x37')]?_0x57f9de[_0x457f('0x35')]:_0x3def51['model'];if(!_0x41bda9[_0x457f('0x31')][_0x457f('0x38')](_0x457f('0x39'))){_0x57f9de['limit']=qs['limit'](_0x41bda9[_0x457f('0x31')][_0x457f('0x1f')]);_0x57f9de[_0x457f('0x1e')]=qs[_0x457f('0x1e')](_0x41bda9[_0x457f('0x31')][_0x457f('0x1e')]);}_0x57f9de[_0x457f('0x3a')]=qs[_0x457f('0x3b')](_0x41bda9[_0x457f('0x31')][_0x457f('0x3b')]);_0x57f9de[_0x457f('0x3c')]=qs[_0x457f('0x33')](_[_0x457f('0x3d')](_0x41bda9[_0x457f('0x31')],_0x3def51[_0x457f('0x33')]),_0x21a148);if(_0x41bda9['query'][_0x457f('0x3e')]){_0x57f9de[_0x457f('0x3c')]=_[_0x457f('0x3f')](_0x57f9de['where'],{'$or':_[_0x457f('0x40')](_0x21a148,function(_0x4c7126){if(_0x4c7126[_0x457f('0x2e')]!==_0x457f('0x41')){var _0x34e466={};_0x34e466[_0x4c7126['name']]={'$like':'%'+_0x41bda9[_0x457f('0x31')][_0x457f('0x3e')]+'%'};return _0x34e466;}})});}_0x57f9de=_[_0x457f('0x3f')]({},_0x57f9de,_0x41bda9[_0x457f('0x42')]);var _0x1fbf17={'where':_0x57f9de[_0x457f('0x3c')]};return db[_0x457f('0x2d')]['count'](_0x1fbf17)['then'](function(_0x27eadb){_0xe96095[_0x457f('0x1d')]=_0x27eadb;if(_0x41bda9['query'][_0x457f('0x43')]){_0x57f9de['include']=[{'all':!![]}];}return db[_0x457f('0x2d')][_0x457f('0x44')](_0x57f9de);})[_0x457f('0x24')](function(_0x320154){_0xe96095['rows']=_0x320154;return _0xe96095;})[_0x457f('0x24')](respondWithFilteredResult(_0x28f3d3,_0x57f9de))[_0x457f('0x45')](handleError(_0x28f3d3,null));};exports[_0x457f('0x46')]=function(_0x1d7d5d,_0x5483d2){var _0x27bb2f={'raw':!![],'where':{'id':_0x1d7d5d['params']['id']}},_0x2d448e={};_0x2d448e[_0x457f('0x30')]=_[_0x457f('0x32')](db['AnalyticExtractedReport']['rawAttributes']);_0x2d448e[_0x457f('0x31')]=_[_0x457f('0x32')](_0x1d7d5d[_0x457f('0x31')]);_0x2d448e['filters']=_[_0x457f('0x34')](_0x2d448e[_0x457f('0x30')],_0x2d448e['query']);_0x27bb2f['attributes']=_['intersection'](_0x2d448e[_0x457f('0x30')],qs[_0x457f('0x36')](_0x1d7d5d[_0x457f('0x31')][_0x457f('0x36')]));_0x27bb2f[_0x457f('0x35')]=_0x27bb2f[_0x457f('0x35')]['length']?_0x27bb2f[_0x457f('0x35')]:_0x2d448e[_0x457f('0x30')];if(_0x1d7d5d['query']['includeAll']){_0x27bb2f[_0x457f('0x47')]=[{'all':!![]}];}_0x27bb2f=_[_0x457f('0x3f')]({},_0x27bb2f,_0x1d7d5d[_0x457f('0x42')]);return db['AnalyticExtractedReport'][_0x457f('0x48')](_0x27bb2f)[_0x457f('0x24')](handleEntityNotFound(_0x5483d2,null))[_0x457f('0x24')](respondWithResult(_0x5483d2,null))[_0x457f('0x45')](handleError(_0x5483d2,null));};exports['create']=function(_0x5ae21c,_0x1174d6){return db[_0x457f('0x2d')][_0x457f('0x49')](_0x5ae21c[_0x457f('0x4a')],{})[_0x457f('0x24')](function(_0x132b40){var _0x3a4fa3=_0x5ae21c[_0x457f('0x4b')]['get']({'plain':!![]});if(!_0x3a4fa3)throw new Error(_0x457f('0x4c'));if(_0x3a4fa3['role']===_0x457f('0x4b')){var _0x4ec2d8=_0x132b40['get']({'plain':!![]});var _0x236464=_0x457f('0x27');return db[_0x457f('0x4d')][_0x457f('0x48')]({'where':{'name':_0x236464,'userProfileId':_0x3a4fa3[_0x457f('0x4e')]},'raw':!![]})[_0x457f('0x24')](function(_0x13ff08){if(_0x13ff08&&_0x13ff08[_0x457f('0x4f')]===0x0){return db[_0x457f('0x50')]['create']({'name':_0x4ec2d8[_0x457f('0x2a')],'resourceId':_0x4ec2d8['id'],'type':_0x13ff08[_0x457f('0x2a')],'sectionId':_0x13ff08['id']},{})['then'](function(){return _0x132b40;});}else{return _0x132b40;}})[_0x457f('0x45')](function(_0x1dea73){logger[_0x457f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1dea73);throw _0x1dea73;});}return _0x132b40;})['then'](respondWithResult(_0x1174d6,0xc9))[_0x457f('0x45')](handleError(_0x1174d6,null));};exports[_0x457f('0x23')]=function(_0x4aa58b,_0x160dce){if(_0x4aa58b[_0x457f('0x4a')]['id']){delete _0x4aa58b[_0x457f('0x4a')]['id'];}return db[_0x457f('0x2d')][_0x457f('0x48')]({'where':{'id':_0x4aa58b['params']['id']}})['then'](handleEntityNotFound(_0x160dce,null))[_0x457f('0x24')](saveUpdates(_0x4aa58b[_0x457f('0x4a')],null))[_0x457f('0x24')](respondWithResult(_0x160dce,null))[_0x457f('0x45')](handleError(_0x160dce,null));};exports[_0x457f('0x25')]=function(_0x1044e9,_0x6e2881){return db['AnalyticExtractedReport'][_0x457f('0x48')]({'where':{'id':_0x1044e9['params']['id']}})[_0x457f('0x24')](handleEntityNotFound(_0x6e2881,null))[_0x457f('0x24')](removeEntity(_0x6e2881,null))[_0x457f('0x45')](handleError(_0x6e2881,null));};exports[_0x457f('0x51')]=function(_0x4b673b,_0x5680d5,_0x5173d2){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4b673b[_0x457f('0x52')]['id']},'attributes':[_0x457f('0x2a'),_0x457f('0x53'),_0x457f('0x54'),_0x457f('0x55')],'raw':!![]})[_0x457f('0x24')](handleEntityNotFound(_0x5680d5,null))[_0x457f('0x24')](function(_0x2683f2){if(_0x2683f2){if(!fs[_0x457f('0x56')](path[_0x457f('0x57')](config['root'],_0x457f('0x58'),_0x2683f2['savename']))){throw new db[(_0x457f('0x59'))][(_0x457f('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4b673b['query']['exists']){return _0x5680d5[_0x457f('0x18')](0xc8);}return _0x5680d5[_0x457f('0x51')](path[_0x457f('0x57')](config[_0x457f('0x5b')],_0x457f('0x58'),_0x2683f2[_0x457f('0x54')]),util[_0x457f('0x5c')](_0x457f('0x5d'),_0x2683f2['basename']||_0x2683f2[_0x457f('0x2a')],_0x2683f2[_0x457f('0x55')]['toLowerCase']()));}})['catch'](handleError(_0x5680d5,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 9635658..e4dbdc4 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 _0x3767=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x1cc1fd,_0x33f9f1){var _0x5e3d41=function(_0x356881){while(--_0x356881){_0x1cc1fd['push'](_0x1cc1fd['shift']());}};_0x5e3d41(++_0x33f9f1);}(_0x3767,0xdc));var _0x7376=function(_0x5b3566,_0x204f01){_0x5b3566=_0x5b3566-0x0;var _0xea8eb2=_0x3767[_0x5b3566];return _0xea8eb2;};'use strict';var _=require(_0x7376('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7376('0x1'));var moment=require('moment');var BPromise=require(_0x7376('0x2'));var rp=require(_0x7376('0x3'));var fs=require('fs');var path=require(_0x7376('0x4'));var rimraf=require(_0x7376('0x5'));var config=require(_0x7376('0x6'));var attributes=require(_0x7376('0x7'));module[_0x7376('0x8')]=function(_0x2f89b0,_0x7d9242){return _0x2f89b0[_0x7376('0x9')](_0x7376('0xa'),attributes,{'tableName':_0x7376('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab3a=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x39d711,_0xe11eb7){var _0xee1d0c=function(_0x457e08){while(--_0x457e08){_0x39d711['push'](_0x39d711['shift']());}};_0xee1d0c(++_0xe11eb7);}(_0xab3a,0xb9));var _0xaab3=function(_0x4452a1,_0x1d50fa){_0x4452a1=_0x4452a1-0x0;var _0x2e5604=_0xab3a[_0x4452a1];return _0x2e5604;};'use strict';var _=require(_0xaab3('0x0'));var util=require('util');var logger=require(_0xaab3('0x1'))(_0xaab3('0x2'));var moment=require(_0xaab3('0x3'));var BPromise=require('bluebird');var rp=require(_0xaab3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaab3('0x5'));var config=require(_0xaab3('0x6'));var attributes=require(_0xaab3('0x7'));module[_0xaab3('0x8')]=function(_0x30a442,_0x315675){return _0x30a442[_0xaab3('0x9')](_0xaab3('0xa'),attributes,{'tableName':_0xaab3('0xb'),'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 2ce6109..6bf1bb6 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 _0x8ce1=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xf2d3c2,_0x4d39ca){var _0x277ca1=function(_0x302918){while(--_0x302918){_0xf2d3c2['push'](_0xf2d3c2['shift']());}};_0x277ca1(++_0x4d39ca);}(_0x8ce1,0xc7));var _0x18ce=function(_0x3711a2,_0x15047d){_0x3711a2=_0x3711a2-0x0;var _0x43d931=_0x8ce1[_0x3711a2];return _0x43d931;};'use strict';var _=require(_0x18ce('0x0'));var util=require('util');var moment=require(_0x18ce('0x1'));var BPromise=require(_0x18ce('0x2'));var rs=require(_0x18ce('0x3'));var fs=require('fs');var Redis=require(_0x18ce('0x4'));var db=require(_0x18ce('0x5'))['db'];var utils=require(_0x18ce('0x6'));var logger=require(_0x18ce('0x7'))(_0x18ce('0x8'));var config=require('../../config/environment');var jayson=require(_0x18ce('0x9'));var client=jayson[_0x18ce('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31f7c4,_0x37334e,_0x5843b1){return new BPromise(function(_0x367129,_0x2a5a41){return client[_0x18ce('0xb')](_0x31f7c4,_0x5843b1)['then'](function(_0x437b22){logger[_0x18ce('0xc')](_0x18ce('0xd'),_0x37334e,_0x18ce('0xe'));logger[_0x18ce('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x37334e,_0x18ce('0xe'),JSON[_0x18ce('0x10')](_0x437b22));if(_0x437b22[_0x18ce('0x11')]){if(_0x437b22[_0x18ce('0x11')][_0x18ce('0x12')]===0x1f4){logger[_0x18ce('0x11')](_0x18ce('0xd'),_0x37334e,_0x437b22[_0x18ce('0x11')]['message']);return _0x2a5a41(_0x437b22[_0x18ce('0x11')][_0x18ce('0x13')]);}logger['error'](_0x18ce('0xd'),_0x37334e,_0x437b22[_0x18ce('0x11')]['message']);return _0x367129(_0x437b22[_0x18ce('0x11')][_0x18ce('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x37334e,'request\x20sent');_0x367129(_0x437b22[_0x18ce('0x14')][_0x18ce('0x13')]);}})[_0x18ce('0x15')](function(_0x2f33cc){logger[_0x18ce('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x37334e,_0x2f33cc);_0x2a5a41(_0x2f33cc);});});}
\ No newline at end of file
+var _0x87ed=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x17bb5b,_0x36806f){var _0x3dddc8=function(_0x3084d4){while(--_0x3084d4){_0x17bb5b['push'](_0x17bb5b['shift']());}};_0x3dddc8(++_0x36806f);}(_0x87ed,0x88));var _0xd87e=function(_0x16946b,_0x5ea65a){_0x16946b=_0x16946b-0x0;var _0x322ea3=_0x87ed[_0x16946b];return _0x322ea3;};'use strict';var _=require(_0xd87e('0x0'));var util=require(_0xd87e('0x1'));var moment=require(_0xd87e('0x2'));var BPromise=require('bluebird');var rs=require(_0xd87e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd87e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd87e('0x5'));var jayson=require(_0xd87e('0x6'));var client=jayson['client'][_0xd87e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c43f2,_0x22073e,_0x275705){return new BPromise(function(_0x52d938,_0x55bbf3){return client[_0xd87e('0x8')](_0x4c43f2,_0x275705)['then'](function(_0x436bb6){logger[_0xd87e('0x9')](_0xd87e('0xa'),_0x22073e,_0xd87e('0xb'));logger[_0xd87e('0xc')](_0xd87e('0xd'),_0x22073e,_0xd87e('0xb'),JSON['stringify'](_0x436bb6));if(_0x436bb6[_0xd87e('0xe')]){if(_0x436bb6['error'][_0xd87e('0xf')]===0x1f4){logger[_0xd87e('0xe')](_0xd87e('0xa'),_0x22073e,_0x436bb6['error'][_0xd87e('0x10')]);return _0x55bbf3(_0x436bb6['error'][_0xd87e('0x10')]);}logger['error'](_0xd87e('0xa'),_0x22073e,_0x436bb6[_0xd87e('0xe')][_0xd87e('0x10')]);return _0x52d938(_0x436bb6[_0xd87e('0xe')][_0xd87e('0x10')]);}else{logger['info'](_0xd87e('0xa'),_0x22073e,_0xd87e('0xb'));_0x52d938(_0x436bb6[_0xd87e('0x11')]['message']);}})[_0xd87e('0x12')](function(_0xed36a4){logger[_0xd87e('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x22073e,_0xed36a4);_0x55bbf3(_0xed36a4);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index ec009f1..067c981 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 _0xed63=['isAuthenticated','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','/:id','show','get','download','post'];(function(_0x216e9a,_0x4b4bca){var _0xe0ac8c=function(_0x182483){while(--_0x182483){_0x216e9a['push'](_0x216e9a['shift']());}};_0xe0ac8c(++_0x4b4bca);}(_0xed63,0x124));var _0x3ed6=function(_0x27ff11,_0x2f5554){_0x27ff11=_0x27ff11-0x0;var _0x205817=_0xed63[_0x27ff11];return _0x205817;};'use strict';var multer=require(_0x3ed6('0x0'));var util=require('util');var path=require(_0x3ed6('0x1'));var timeout=require(_0x3ed6('0x2'));var express=require(_0x3ed6('0x3'));var router=express[_0x3ed6('0x4')]();var fs_extra=require(_0x3ed6('0x5'));var auth=require(_0x3ed6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3ed6('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3ed6('0x8')]);router['get'](_0x3ed6('0x9'),auth['isAuthenticated'](),controller[_0x3ed6('0xa')]);router[_0x3ed6('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x3ed6('0xc')]);router[_0x3ed6('0xd')]('/',auth[_0x3ed6('0xe')](),controller['create']);router[_0x3ed6('0xf')](_0x3ed6('0x9'),auth[_0x3ed6('0xe')](),controller[_0x3ed6('0x10')]);router['delete'](_0x3ed6('0x9'),auth[_0x3ed6('0xe')](),controller['destroy']);module[_0x3ed6('0x11')]=router;
\ No newline at end of file
+var _0xeca1=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller'];(function(_0x28449c,_0x40bdbd){var _0x96cc9e=function(_0x15667b){while(--_0x15667b){_0x28449c['push'](_0x28449c['shift']());}};_0x96cc9e(++_0x40bdbd);}(_0xeca1,0x85));var _0x1eca=function(_0x40724e,_0x23f01c){_0x40724e=_0x40724e-0x0;var _0x42b101=_0xeca1[_0x40724e];return _0x42b101;};'use strict';var multer=require(_0x1eca('0x0'));var util=require(_0x1eca('0x1'));var path=require(_0x1eca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1eca('0x3'));var auth=require(_0x1eca('0x4'));var interaction=require(_0x1eca('0x5'));var config=require('../../config/environment');var controller=require(_0x1eca('0x6'));router[_0x1eca('0x7')]('/',auth[_0x1eca('0x8')](),controller[_0x1eca('0x9')]);router[_0x1eca('0x7')](_0x1eca('0xa'),auth[_0x1eca('0x8')](),controller[_0x1eca('0xb')]);router[_0x1eca('0x7')](_0x1eca('0xc'),auth['isAuthenticated'](),controller[_0x1eca('0xd')]);router[_0x1eca('0xe')]('/',auth[_0x1eca('0x8')](),controller[_0x1eca('0xf')]);router[_0x1eca('0x10')](_0x1eca('0xa'),auth['isAuthenticated'](),controller[_0x1eca('0x11')]);router['delete'](_0x1eca('0xa'),auth['isAuthenticated'](),controller[_0x1eca('0x12')]);module[_0x1eca('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 337732b..afaec42 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 _0x4df4=['BOOLEAN','sequelize','exports','STRING'];(function(_0x302b76,_0x1b4466){var _0x296a6b=function(_0x328098){while(--_0x328098){_0x302b76['push'](_0x302b76['shift']());}};_0x296a6b(++_0x1b4466);}(_0x4df4,0x169));var _0x44df=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x4df4[_0x13187a];return _0x65b85f;};'use strict';var Sequelize=require(_0x44df('0x0'));module[_0x44df('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x44df('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x44df('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x44df('0x2')]},'custom':{'type':Sequelize[_0x44df('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xaf80=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x42004d,_0x127961){var _0xb47cd4=function(_0x5a3b8d){while(--_0x5a3b8d){_0x42004d['push'](_0x42004d['shift']());}};_0xb47cd4(++_0x127961);}(_0xaf80,0x92));var _0x0af8=function(_0x1f12a9,_0x3457fc){_0x1f12a9=_0x1f12a9-0x0;var _0x1e3b99=_0xaf80[_0x1f12a9];return _0x1e3b99;};'use strict';var Sequelize=require(_0x0af8('0x0'));module['exports']={'field':{'type':Sequelize[_0x0af8('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0af8('0x2')]},'format':{'type':Sequelize[_0x0af8('0x2')]},'groupBy':{'type':Sequelize[_0x0af8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0af8('0x2')]},'custom':{'type':Sequelize[_0x0af8('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 de77364..f8f2293 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 _0x0df3=['create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','AnalyticFieldReport','includeAll','rows','catch','show','params','include','find'];(function(_0x4ee2b7,_0x1d9273){var _0x11a40e=function(_0x58e930){while(--_0x58e930){_0x4ee2b7['push'](_0x4ee2b7['shift']());}};_0x11a40e(++_0x1d9273);}(_0x0df3,0x14b));var _0x30df=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x0df3[_0x15ea09];return _0x3e9c78;};'use strict';var emlformat=require(_0x30df('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x30df('0x1'));var rp=require(_0x30df('0x2'));var moment=require(_0x30df('0x3'));var BPromise=require(_0x30df('0x4'));var Mustache=require(_0x30df('0x5'));var util=require(_0x30df('0x6'));var path=require('path');var sox=require(_0x30df('0x7'));var csv=require(_0x30df('0x8'));var ejs=require(_0x30df('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30df('0xa'));var squel=require(_0x30df('0xb'));var crypto=require(_0x30df('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x30df('0x8'));var querystring=require(_0x30df('0xd'));var Papa=require(_0x30df('0xe'));var Redis=require('ioredis');var authService=require(_0x30df('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x30df('0x10'));var hardwareService=require(_0x30df('0x11'));var logger=require(_0x30df('0x12'))('api');var utils=require(_0x30df('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x30df('0x14'));var db=require(_0x30df('0x15'))['db'];function respondWithStatusCode(_0x3dfd11,_0x381457){_0x381457=_0x381457||0xcc;return function(_0x25fc48){if(_0x25fc48){return _0x3dfd11[_0x30df('0x16')](_0x381457);}return _0x3dfd11['status'](_0x381457)[_0x30df('0x17')]();};}function respondWithResult(_0x3930e2,_0x4ae6df){_0x4ae6df=_0x4ae6df||0xc8;return function(_0x5840ba){if(_0x5840ba){return _0x3930e2[_0x30df('0x18')](_0x4ae6df)[_0x30df('0x19')](_0x5840ba);}};}function respondWithFilteredResult(_0x118fa5,_0xf6a888){return function(_0xe230d5){if(_0xe230d5){var _0x279bc5=typeof _0xf6a888[_0x30df('0x1a')]==='undefined'&&typeof _0xf6a888[_0x30df('0x1b')]===_0x30df('0x1c');var _0x34b8ab=_0xe230d5['count'];var _0x1ab648=_0x279bc5?0x0:_0xf6a888[_0x30df('0x1a')];var _0x3159a5=_0x279bc5?_0xe230d5[_0x30df('0x1d')]:_0xf6a888[_0x30df('0x1a')]+_0xf6a888[_0x30df('0x1b')];var _0xa2bca6;if(_0x3159a5>=_0x34b8ab){_0x3159a5=_0x34b8ab;_0xa2bca6=0xc8;}else{_0xa2bca6=0xce;}_0x118fa5[_0x30df('0x18')](_0xa2bca6);return _0x118fa5[_0x30df('0x1e')](_0x30df('0x1f'),_0x1ab648+'-'+_0x3159a5+'/'+_0x34b8ab)[_0x30df('0x19')](_0xe230d5);}return null;};}function patchUpdates(_0x304f04){return function(_0x2aaee8){try{jsonpatch[_0x30df('0x20')](_0x2aaee8,_0x304f04,!![]);}catch(_0x28b514){return BPromise[_0x30df('0x21')](_0x28b514);}return _0x2aaee8['save']();};}function saveUpdates(_0x50d01d,_0x3bb072){return function(_0x18459e){if(_0x18459e){return _0x18459e['update'](_0x50d01d)['then'](function(_0x586721){return _0x586721;});}return null;};}function removeEntity(_0x17f0b9,_0xb6b87e){return function(_0x225fd5){if(_0x225fd5){return _0x225fd5[_0x30df('0x22')]()[_0x30df('0x23')](function(){_0x17f0b9[_0x30df('0x18')](0xcc)[_0x30df('0x17')]();});}};}function handleEntityNotFound(_0x6d1f7f,_0x16527e){return function(_0x5dbe90){if(!_0x5dbe90){_0x6d1f7f[_0x30df('0x16')](0x194);}return _0x5dbe90;};}function handleError(_0x515dcf,_0x11ab36){_0x11ab36=_0x11ab36||0x1f4;return function(_0x3a4984){logger['error'](_0x3a4984[_0x30df('0x24')]);if(_0x3a4984['name']){delete _0x3a4984[_0x30df('0x25')];}_0x515dcf['status'](_0x11ab36)['send'](_0x3a4984);};}exports[_0x30df('0x26')]=function(_0x271bd4,_0x3c2b28){var _0x4d7438={},_0x371bc7={},_0x1f6fa6={'count':0x0,'rows':[]};var _0x1cc2c1=_[_0x30df('0x27')](db['AnalyticFieldReport'][_0x30df('0x28')],function(_0x11c909){return{'name':_0x11c909[_0x30df('0x29')],'type':_0x11c909[_0x30df('0x2a')][_0x30df('0x2b')]};});_0x371bc7['model']=_[_0x30df('0x27')](_0x1cc2c1,'name');_0x371bc7['query']=_[_0x30df('0x2c')](_0x271bd4[_0x30df('0x2d')]);_0x371bc7['filters']=_[_0x30df('0x2e')](_0x371bc7[_0x30df('0x2f')],_0x371bc7['query']);_0x4d7438['attributes']=_[_0x30df('0x2e')](_0x371bc7[_0x30df('0x2f')],qs[_0x30df('0x30')](_0x271bd4[_0x30df('0x2d')][_0x30df('0x30')]));_0x4d7438[_0x30df('0x31')]=_0x4d7438[_0x30df('0x31')][_0x30df('0x32')]?_0x4d7438[_0x30df('0x31')]:_0x371bc7['model'];if(!_0x271bd4[_0x30df('0x2d')][_0x30df('0x33')]('nolimit')){_0x4d7438[_0x30df('0x1b')]=qs[_0x30df('0x1b')](_0x271bd4[_0x30df('0x2d')][_0x30df('0x1b')]);_0x4d7438[_0x30df('0x1a')]=qs[_0x30df('0x1a')](_0x271bd4['query'][_0x30df('0x1a')]);}_0x4d7438[_0x30df('0x34')]=qs[_0x30df('0x35')](_0x271bd4['query'][_0x30df('0x35')]);_0x4d7438[_0x30df('0x36')]=qs[_0x30df('0x37')](_[_0x30df('0x38')](_0x271bd4['query'],_0x371bc7[_0x30df('0x37')]),_0x1cc2c1);if(_0x271bd4[_0x30df('0x2d')][_0x30df('0x39')]){_0x4d7438[_0x30df('0x36')]=_['merge'](_0x4d7438[_0x30df('0x36')],{'$or':_[_0x30df('0x27')](_0x1cc2c1,function(_0x11f9ea){if(_0x11f9ea['type']!==_0x30df('0x3a')){var _0x2fbb04={};_0x2fbb04[_0x11f9ea[_0x30df('0x25')]]={'$like':'%'+_0x271bd4['query'][_0x30df('0x39')]+'%'};return _0x2fbb04;}})});}_0x4d7438=_[_0x30df('0x3b')]({},_0x4d7438,_0x271bd4[_0x30df('0x3c')]);var _0x31c924={'where':_0x4d7438['where']};return db[_0x30df('0x3d')]['count'](_0x31c924)[_0x30df('0x23')](function(_0x2c18b0){_0x1f6fa6['count']=_0x2c18b0;if(_0x271bd4[_0x30df('0x2d')][_0x30df('0x3e')]){_0x4d7438['include']=[{'all':!![]}];}return db[_0x30df('0x3d')]['findAll'](_0x4d7438);})[_0x30df('0x23')](function(_0x41c8ab){_0x1f6fa6[_0x30df('0x3f')]=_0x41c8ab;return _0x1f6fa6;})['then'](respondWithFilteredResult(_0x3c2b28,_0x4d7438))[_0x30df('0x40')](handleError(_0x3c2b28,null));};exports[_0x30df('0x41')]=function(_0x2f2f75,_0x2c6280){var _0x3dea55={'raw':![],'where':{'id':_0x2f2f75[_0x30df('0x42')]['id']}},_0x20af54={};_0x20af54[_0x30df('0x2f')]=_[_0x30df('0x2c')](db['AnalyticFieldReport'][_0x30df('0x28')]);_0x20af54['query']=_[_0x30df('0x2c')](_0x2f2f75[_0x30df('0x2d')]);_0x20af54[_0x30df('0x37')]=_[_0x30df('0x2e')](_0x20af54[_0x30df('0x2f')],_0x20af54[_0x30df('0x2d')]);_0x3dea55[_0x30df('0x31')]=_[_0x30df('0x2e')](_0x20af54[_0x30df('0x2f')],qs['fields'](_0x2f2f75['query'][_0x30df('0x30')]));_0x3dea55[_0x30df('0x31')]=_0x3dea55['attributes'][_0x30df('0x32')]?_0x3dea55['attributes']:_0x20af54[_0x30df('0x2f')];if(_0x2f2f75['query'][_0x30df('0x3e')]){_0x3dea55[_0x30df('0x43')]=[{'all':!![]}];}_0x3dea55=_['merge']({},_0x3dea55,_0x2f2f75[_0x30df('0x3c')]);return db[_0x30df('0x3d')][_0x30df('0x44')](_0x3dea55)[_0x30df('0x23')](handleEntityNotFound(_0x2c6280,null))[_0x30df('0x23')](respondWithResult(_0x2c6280,null))[_0x30df('0x40')](handleError(_0x2c6280,null));};exports[_0x30df('0x45')]=function(_0x3904aa,_0x3a4f28){return db[_0x30df('0x3d')]['create'](_0x3904aa[_0x30df('0x46')],{})['then'](respondWithResult(_0x3a4f28,0xc9))[_0x30df('0x40')](handleError(_0x3a4f28,null));};exports[_0x30df('0x47')]=function(_0x26fb74,_0x52f66f){return db[_0x30df('0x3d')][_0x30df('0x47')](_0x26fb74[_0x30df('0x46')],{'raw':![],'individualHooks':!![]})[_0x30df('0x23')](respondWithResult(_0x52f66f,0xc9))['catch'](handleError(_0x52f66f,null));};exports['update']=function(_0x51c9d5,_0x53bde5){if(_0x51c9d5[_0x30df('0x46')]['id']){delete _0x51c9d5['body']['id'];}return db[_0x30df('0x3d')][_0x30df('0x44')]({'where':{'id':_0x51c9d5[_0x30df('0x42')]['id']}})['then'](handleEntityNotFound(_0x53bde5,null))[_0x30df('0x23')](saveUpdates(_0x51c9d5['body'],null))[_0x30df('0x23')](respondWithResult(_0x53bde5,null))[_0x30df('0x40')](handleError(_0x53bde5,null));};exports[_0x30df('0x22')]=function(_0x2bdf5b,_0x4439ef){return db[_0x30df('0x3d')]['find']({'where':{'id':_0x2bdf5b[_0x30df('0x42')]['id']}})[_0x30df('0x23')](handleEntityNotFound(_0x4439ef,null))[_0x30df('0x23')](removeEntity(_0x4439ef,null))[_0x30df('0x40')](handleError(_0x4439ef,null));};exports[_0x30df('0x48')]=function(_0x384b52,_0x57505d){return db[_0x30df('0x3d')][_0x30df('0x22')]({'where':{'id':_0x384b52[_0x30df('0x2d')][_0x30df('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x30df('0x23')](respondWithResult(_0x57505d,0xcc))[_0x30df('0x40')](handleError(_0x57505d,null));};exports[_0x30df('0x4a')]=function(_0x4bfe12,_0x46e2e9,_0xd0ed84){return db[_0x30df('0x4b')][_0x30df('0x4c')]({'where':{'id':_0x4bfe12['params']['id']}})[_0x30df('0x23')](handleEntityNotFound(_0x46e2e9,null))[_0x30df('0x23')](function(_0x5d678e){if(_0x5d678e){return db[_0x30df('0x4d')][_0x30df('0x4e')](function(_0x21e508){return db[_0x30df('0x3d')]['destroy']({'where':{'CustomReportId':_0x4bfe12[_0x30df('0x42')]['id']},'transaction':_0x21e508})[_0x30df('0x23')](function(_0x351292){var _0x4ea476=_[_0x30df('0x27')](_0x4bfe12[_0x30df('0x46')],function(_0x959fa8){delete _0x959fa8['id'];_0x959fa8[_0x30df('0x4f')]=_0x4bfe12[_0x30df('0x42')]['id'];return _0x959fa8;});return db['AnalyticFieldReport'][_0x30df('0x47')](_0x4ea476,{'transaction':_0x21e508});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x4bfe12['params']['id']}});});}})[_0x30df('0x23')](respondWithResult(_0x46e2e9,null))[_0x30df('0x40')](handleError(_0x46e2e9,null));};
\ No newline at end of file
+var _0xebd5=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','bulkCreate','body','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','save','then','destroy','error','name','send','index','map','AnalyticFieldReport'];(function(_0x1d4934,_0x273e2b){var _0x3603f7=function(_0x41f762){while(--_0x41f762){_0x1d4934['push'](_0x1d4934['shift']());}};_0x3603f7(++_0x273e2b);}(_0xebd5,0x71));var _0x5ebd=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xebd5[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x5ebd('0x0'));var rimraf=require(_0x5ebd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5ebd('0x2'));var moment=require(_0x5ebd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5ebd('0x4'));var path=require(_0x5ebd('0x5'));var sox=require(_0x5ebd('0x6'));var csv=require('to-csv');var ejs=require(_0x5ebd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ebd('0x8'));var squel=require('squel');var crypto=require(_0x5ebd('0x9'));var jsforce=require(_0x5ebd('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ebd('0xb'));var Papa=require(_0x5ebd('0xc'));var Redis=require(_0x5ebd('0xd'));var authService=require(_0x5ebd('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5ebd('0xf'));var hardwareService=require(_0x5ebd('0x10'));var logger=require('../../config/logger')(_0x5ebd('0x11'));var utils=require(_0x5ebd('0x12'));var config=require(_0x5ebd('0x13'));var licenseUtil=require(_0x5ebd('0x14'));var db=require(_0x5ebd('0x15'))['db'];function respondWithStatusCode(_0x315f39,_0x30c24f){_0x30c24f=_0x30c24f||0xcc;return function(_0x5c9925){if(_0x5c9925){return _0x315f39[_0x5ebd('0x16')](_0x30c24f);}return _0x315f39['status'](_0x30c24f)[_0x5ebd('0x17')]();};}function respondWithResult(_0x3d6b1a,_0x3481db){_0x3481db=_0x3481db||0xc8;return function(_0x4ce10a){if(_0x4ce10a){return _0x3d6b1a['status'](_0x3481db)[_0x5ebd('0x18')](_0x4ce10a);}};}function respondWithFilteredResult(_0x12c306,_0x3f9ab3){return function(_0x981d23){if(_0x981d23){var _0x47a85c=typeof _0x3f9ab3[_0x5ebd('0x19')]===_0x5ebd('0x1a')&&typeof _0x3f9ab3['limit']===_0x5ebd('0x1a');var _0x155e88=_0x981d23[_0x5ebd('0x1b')];var _0x18217f=_0x47a85c?0x0:_0x3f9ab3[_0x5ebd('0x19')];var _0x28308d=_0x47a85c?_0x981d23[_0x5ebd('0x1b')]:_0x3f9ab3[_0x5ebd('0x19')]+_0x3f9ab3[_0x5ebd('0x1c')];var _0x2a06e8;if(_0x28308d>=_0x155e88){_0x28308d=_0x155e88;_0x2a06e8=0xc8;}else{_0x2a06e8=0xce;}_0x12c306[_0x5ebd('0x1d')](_0x2a06e8);return _0x12c306[_0x5ebd('0x1e')](_0x5ebd('0x1f'),_0x18217f+'-'+_0x28308d+'/'+_0x155e88)[_0x5ebd('0x18')](_0x981d23);}return null;};}function patchUpdates(_0x30547b){return function(_0xdac639){try{jsonpatch['apply'](_0xdac639,_0x30547b,!![]);}catch(_0x55be72){return BPromise['reject'](_0x55be72);}return _0xdac639[_0x5ebd('0x20')]();};}function saveUpdates(_0x43e542,_0x39eff1){return function(_0x151ffa){if(_0x151ffa){return _0x151ffa['update'](_0x43e542)[_0x5ebd('0x21')](function(_0x338f97){return _0x338f97;});}return null;};}function removeEntity(_0x4ddcc2,_0x160509){return function(_0x6e869b){if(_0x6e869b){return _0x6e869b[_0x5ebd('0x22')]()[_0x5ebd('0x21')](function(){_0x4ddcc2[_0x5ebd('0x1d')](0xcc)[_0x5ebd('0x17')]();});}};}function handleEntityNotFound(_0x59cc2e,_0x547f35){return function(_0x35f1c4){if(!_0x35f1c4){_0x59cc2e[_0x5ebd('0x16')](0x194);}return _0x35f1c4;};}function handleError(_0x3ebc2c,_0x4614f1){_0x4614f1=_0x4614f1||0x1f4;return function(_0x25e6f9){logger[_0x5ebd('0x23')](_0x25e6f9['stack']);if(_0x25e6f9[_0x5ebd('0x24')]){delete _0x25e6f9[_0x5ebd('0x24')];}_0x3ebc2c['status'](_0x4614f1)[_0x5ebd('0x25')](_0x25e6f9);};}exports[_0x5ebd('0x26')]=function(_0x4fd9bd,_0x3e8e28){var _0x7128e9={},_0x2ed99b={},_0x11c38a={'count':0x0,'rows':[]};var _0x1128b5=_[_0x5ebd('0x27')](db[_0x5ebd('0x28')]['rawAttributes'],function(_0x5665a9){return{'name':_0x5665a9[_0x5ebd('0x29')],'type':_0x5665a9[_0x5ebd('0x2a')]['key']};});_0x2ed99b[_0x5ebd('0x2b')]=_['map'](_0x1128b5,_0x5ebd('0x24'));_0x2ed99b[_0x5ebd('0x2c')]=_[_0x5ebd('0x2d')](_0x4fd9bd['query']);_0x2ed99b[_0x5ebd('0x2e')]=_[_0x5ebd('0x2f')](_0x2ed99b['model'],_0x2ed99b[_0x5ebd('0x2c')]);_0x7128e9[_0x5ebd('0x30')]=_[_0x5ebd('0x2f')](_0x2ed99b[_0x5ebd('0x2b')],qs[_0x5ebd('0x31')](_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x31')]));_0x7128e9[_0x5ebd('0x30')]=_0x7128e9[_0x5ebd('0x30')]['length']?_0x7128e9[_0x5ebd('0x30')]:_0x2ed99b[_0x5ebd('0x2b')];if(!_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x32')](_0x5ebd('0x33'))){_0x7128e9['limit']=qs['limit'](_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x1c')]);_0x7128e9['offset']=qs[_0x5ebd('0x19')](_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x19')]);}_0x7128e9[_0x5ebd('0x34')]=qs['sort'](_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x35')]);_0x7128e9[_0x5ebd('0x36')]=qs['filters'](_[_0x5ebd('0x37')](_0x4fd9bd['query'],_0x2ed99b[_0x5ebd('0x2e')]),_0x1128b5);if(_0x4fd9bd[_0x5ebd('0x2c')][_0x5ebd('0x38')]){_0x7128e9[_0x5ebd('0x36')]=_[_0x5ebd('0x39')](_0x7128e9['where'],{'$or':_[_0x5ebd('0x27')](_0x1128b5,function(_0x380310){if(_0x380310[_0x5ebd('0x2a')]!==_0x5ebd('0x3a')){var _0x247f04={};_0x247f04[_0x380310['name']]={'$like':'%'+_0x4fd9bd['query'][_0x5ebd('0x38')]+'%'};return _0x247f04;}})});}_0x7128e9=_[_0x5ebd('0x39')]({},_0x7128e9,_0x4fd9bd[_0x5ebd('0x3b')]);var _0x5970a0={'where':_0x7128e9[_0x5ebd('0x36')]};return db[_0x5ebd('0x28')][_0x5ebd('0x1b')](_0x5970a0)[_0x5ebd('0x21')](function(_0x45fe2f){_0x11c38a[_0x5ebd('0x1b')]=_0x45fe2f;if(_0x4fd9bd['query'][_0x5ebd('0x3c')]){_0x7128e9[_0x5ebd('0x3d')]=[{'all':!![]}];}return db[_0x5ebd('0x28')]['findAll'](_0x7128e9);})[_0x5ebd('0x21')](function(_0x108cf8){_0x11c38a[_0x5ebd('0x3e')]=_0x108cf8;return _0x11c38a;})[_0x5ebd('0x21')](respondWithFilteredResult(_0x3e8e28,_0x7128e9))[_0x5ebd('0x3f')](handleError(_0x3e8e28,null));};exports[_0x5ebd('0x40')]=function(_0x20be2d,_0x25d7c7){var _0x58f29b={'raw':![],'where':{'id':_0x20be2d[_0x5ebd('0x41')]['id']}},_0x130c42={};_0x130c42[_0x5ebd('0x2b')]=_[_0x5ebd('0x2d')](db['AnalyticFieldReport'][_0x5ebd('0x42')]);_0x130c42['query']=_['keys'](_0x20be2d[_0x5ebd('0x2c')]);_0x130c42[_0x5ebd('0x2e')]=_[_0x5ebd('0x2f')](_0x130c42[_0x5ebd('0x2b')],_0x130c42['query']);_0x58f29b[_0x5ebd('0x30')]=_[_0x5ebd('0x2f')](_0x130c42[_0x5ebd('0x2b')],qs[_0x5ebd('0x31')](_0x20be2d['query'][_0x5ebd('0x31')]));_0x58f29b['attributes']=_0x58f29b['attributes']['length']?_0x58f29b['attributes']:_0x130c42['model'];if(_0x20be2d['query'][_0x5ebd('0x3c')]){_0x58f29b[_0x5ebd('0x3d')]=[{'all':!![]}];}_0x58f29b=_[_0x5ebd('0x39')]({},_0x58f29b,_0x20be2d['options']);return db[_0x5ebd('0x28')][_0x5ebd('0x43')](_0x58f29b)['then'](handleEntityNotFound(_0x25d7c7,null))['then'](respondWithResult(_0x25d7c7,null))[_0x5ebd('0x3f')](handleError(_0x25d7c7,null));};exports[_0x5ebd('0x44')]=function(_0x1cd137,_0x33f94d){return db[_0x5ebd('0x28')][_0x5ebd('0x44')](_0x1cd137['body'],{})[_0x5ebd('0x21')](respondWithResult(_0x33f94d,0xc9))['catch'](handleError(_0x33f94d,null));};exports['bulkCreate']=function(_0x758bfa,_0x2bf8f5){return db[_0x5ebd('0x28')][_0x5ebd('0x45')](_0x758bfa[_0x5ebd('0x46')],{'raw':![],'individualHooks':!![]})[_0x5ebd('0x21')](respondWithResult(_0x2bf8f5,0xc9))[_0x5ebd('0x3f')](handleError(_0x2bf8f5,null));};exports['update']=function(_0xaad01,_0x288a92){if(_0xaad01[_0x5ebd('0x46')]['id']){delete _0xaad01[_0x5ebd('0x46')]['id'];}return db[_0x5ebd('0x28')][_0x5ebd('0x43')]({'where':{'id':_0xaad01['params']['id']}})[_0x5ebd('0x21')](handleEntityNotFound(_0x288a92,null))[_0x5ebd('0x21')](saveUpdates(_0xaad01[_0x5ebd('0x46')],null))['then'](respondWithResult(_0x288a92,null))['catch'](handleError(_0x288a92,null));};exports[_0x5ebd('0x22')]=function(_0x42c793,_0x1b96c0){return db['AnalyticFieldReport'][_0x5ebd('0x43')]({'where':{'id':_0x42c793[_0x5ebd('0x41')]['id']}})[_0x5ebd('0x21')](handleEntityNotFound(_0x1b96c0,null))[_0x5ebd('0x21')](removeEntity(_0x1b96c0,null))[_0x5ebd('0x3f')](handleError(_0x1b96c0,null));};exports['bulkDestroy']=function(_0x3812a3,_0x20b6b7){return db[_0x5ebd('0x28')][_0x5ebd('0x22')]({'where':{'id':_0x3812a3[_0x5ebd('0x2c')][_0x5ebd('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x5ebd('0x21')](respondWithResult(_0x20b6b7,0xcc))['catch'](handleError(_0x20b6b7,null));};exports[_0x5ebd('0x48')]=function(_0x3edf69,_0x52223a,_0xe92951){return db[_0x5ebd('0x49')]['findOne']({'where':{'id':_0x3edf69['params']['id']}})[_0x5ebd('0x21')](handleEntityNotFound(_0x52223a,null))['then'](function(_0x456a99){if(_0x456a99){return db[_0x5ebd('0x4a')][_0x5ebd('0x4b')](function(_0x2d3bac){return db[_0x5ebd('0x28')]['destroy']({'where':{'CustomReportId':_0x3edf69[_0x5ebd('0x41')]['id']},'transaction':_0x2d3bac})['then'](function(_0x43c1a3){var _0x2c3f2f=_[_0x5ebd('0x27')](_0x3edf69[_0x5ebd('0x46')],function(_0x125e32){delete _0x125e32['id'];_0x125e32[_0x5ebd('0x4c')]=_0x3edf69[_0x5ebd('0x41')]['id'];return _0x125e32;});return db[_0x5ebd('0x28')][_0x5ebd('0x45')](_0x2c3f2f,{'transaction':_0x2d3bac});});})['then'](function(){return db[_0x5ebd('0x28')]['findAll']({'where':{'CustomReportId':_0x3edf69['params']['id']}});});}})[_0x5ebd('0x21')](respondWithResult(_0x52223a,null))[_0x5ebd('0x3f')](handleError(_0x52223a,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index cae9df2..ede983f 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 _0x2066=['AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x561f8b,_0x403380){var _0x56b1e3=function(_0x1341c1){while(--_0x1341c1){_0x561f8b['push'](_0x561f8b['shift']());}};_0x56b1e3(++_0x403380);}(_0x2066,0xda));var _0x6206=function(_0x3d1463,_0xe10dab){_0x3d1463=_0x3d1463-0x0;var _0x2d2616=_0x2066[_0x3d1463];return _0x2d2616;};'use strict';var _=require(_0x6206('0x0'));var util=require('util');var logger=require(_0x6206('0x1'))(_0x6206('0x2'));var moment=require(_0x6206('0x3'));var BPromise=require(_0x6206('0x4'));var rp=require(_0x6206('0x5'));var fs=require('fs');var path=require(_0x6206('0x6'));var rimraf=require(_0x6206('0x7'));var config=require(_0x6206('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0x6206('0x9')]=function(_0x41bd4e,_0x505a30){return _0x41bd4e['define'](_0x6206('0xa'),attributes,{'tableName':_0x6206('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x20c3=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4c179f,_0x4b6186){var _0x500640=function(_0x1e486b){while(--_0x1e486b){_0x4c179f['push'](_0x4c179f['shift']());}};_0x500640(++_0x4b6186);}(_0x20c3,0x70));var _0x320c=function(_0x220253,_0x408ef7){_0x220253=_0x220253-0x0;var _0x1ce4a0=_0x20c3[_0x220253];return _0x1ce4a0;};'use strict';var _=require(_0x320c('0x0'));var util=require(_0x320c('0x1'));var logger=require(_0x320c('0x2'))(_0x320c('0x3'));var moment=require(_0x320c('0x4'));var BPromise=require(_0x320c('0x5'));var rp=require(_0x320c('0x6'));var fs=require('fs');var path=require(_0x320c('0x7'));var rimraf=require(_0x320c('0x8'));var config=require(_0x320c('0x9'));var attributes=require(_0x320c('0xa'));module[_0x320c('0xb')]=function(_0x19832e,_0x525ebd){return _0x19832e[_0x320c('0xc')](_0x320c('0xd'),attributes,{'tableName':_0x320c('0xe'),'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 79c6529..c7cc69a 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 _0x1552=['stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x125a62,_0x34e156){var _0x497b28=function(_0x504bbf){while(--_0x504bbf){_0x125a62['push'](_0x125a62['shift']());}};_0x497b28(++_0x34e156);}(_0x1552,0x97));var _0x2155=function(_0x284d8f,_0x1afc9e){_0x284d8f=_0x284d8f-0x0;var _0x6acf64=_0x1552[_0x284d8f];return _0x6acf64;};'use strict';var _=require(_0x2155('0x0'));var util=require(_0x2155('0x1'));var moment=require(_0x2155('0x2'));var BPromise=require('bluebird');var rs=require(_0x2155('0x3'));var fs=require('fs');var Redis=require(_0x2155('0x4'));var db=require(_0x2155('0x5'))['db'];var utils=require(_0x2155('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2155('0x7'));var jayson=require(_0x2155('0x8'));var client=jayson[_0x2155('0x9')][_0x2155('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2873a1,_0x2c2a75,_0x2deacf){return new BPromise(function(_0x81ecff,_0x5c25e1){return client['request'](_0x2873a1,_0x2deacf)[_0x2155('0xb')](function(_0x29e119){logger[_0x2155('0xc')](_0x2155('0xd'),_0x2c2a75,_0x2155('0xe'));logger[_0x2155('0xf')](_0x2155('0x10'),_0x2c2a75,_0x2155('0xe'),JSON[_0x2155('0x11')](_0x29e119));if(_0x29e119[_0x2155('0x12')]){if(_0x29e119[_0x2155('0x12')]['code']===0x1f4){logger[_0x2155('0x12')](_0x2155('0xd'),_0x2c2a75,_0x29e119[_0x2155('0x12')][_0x2155('0x13')]);return _0x5c25e1(_0x29e119[_0x2155('0x12')]['message']);}logger[_0x2155('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2c2a75,_0x29e119['error']['message']);return _0x81ecff(_0x29e119['error'][_0x2155('0x13')]);}else{logger[_0x2155('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2c2a75,_0x2155('0xe'));_0x81ecff(_0x29e119[_0x2155('0x14')]['message']);}})['catch'](function(_0xfdd0f8){logger[_0x2155('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2c2a75,_0xfdd0f8);_0x5c25e1(_0xfdd0f8);});});}
\ No newline at end of file
+var _0xabcc=['request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x7e6cf7,_0x4c8e23){var _0x18d4ee=function(_0x14b2fc){while(--_0x14b2fc){_0x7e6cf7['push'](_0x7e6cf7['shift']());}};_0x18d4ee(++_0x4c8e23);}(_0xabcc,0x7b));var _0xcabc=function(_0x1f2941,_0x3544ce){_0x1f2941=_0x1f2941-0x0;var _0x31e313=_0xabcc[_0x1f2941];return _0x31e313;};'use strict';var _=require('lodash');var util=require(_0xcabc('0x0'));var moment=require(_0xcabc('0x1'));var BPromise=require(_0xcabc('0x2'));var rs=require(_0xcabc('0x3'));var fs=require('fs');var Redis=require(_0xcabc('0x4'));var db=require(_0xcabc('0x5'))['db'];var utils=require(_0xcabc('0x6'));var logger=require(_0xcabc('0x7'))(_0xcabc('0x8'));var config=require(_0xcabc('0x9'));var jayson=require(_0xcabc('0xa'));var client=jayson[_0xcabc('0xb')][_0xcabc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5df19b,_0x6f7393,_0x596ef9){return new BPromise(function(_0x234d01,_0x23fb36){return client[_0xcabc('0xd')](_0x5df19b,_0x596ef9)['then'](function(_0xe97cd2){logger['info'](_0xcabc('0xe'),_0x6f7393,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x6f7393,_0xcabc('0xf'),JSON[_0xcabc('0x10')](_0xe97cd2));if(_0xe97cd2[_0xcabc('0x11')]){if(_0xe97cd2[_0xcabc('0x11')][_0xcabc('0x12')]===0x1f4){logger[_0xcabc('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x6f7393,_0xe97cd2[_0xcabc('0x11')]['message']);return _0x23fb36(_0xe97cd2[_0xcabc('0x11')][_0xcabc('0x13')]);}logger[_0xcabc('0x11')](_0xcabc('0xe'),_0x6f7393,_0xe97cd2[_0xcabc('0x11')]['message']);return _0x234d01(_0xe97cd2[_0xcabc('0x11')][_0xcabc('0x13')]);}else{logger[_0xcabc('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x6f7393,_0xcabc('0xf'));_0x234d01(_0xe97cd2[_0xcabc('0x15')]['message']);}})[_0xcabc('0x16')](function(_0x4d9738){logger[_0xcabc('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x6f7393,_0x4d9738);_0x23fb36(_0x4d9738);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index f7c5283..367c0e2 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(_0x581f95,_0x341948){var _0x1c57f9=function(_0x1f943b){while(--_0x1f943b){_0x581f95['push'](_0x581f95['shift']());}};_0x1c57f9(++_0x341948);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x13bbf5,_0x3c3cc2){var _0x2d9e20=function(_0x31ff82){while(--_0x31ff82){_0x13bbf5['push'](_0x13bbf5['shift']());}};_0x2d9e20(++_0x3c3cc2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 b5ee246..cecb3d4 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 _0x9e9b=['name','STRING','TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x9e9b[_0x28d225];return _0x1f79e1;};'use strict';var Sequelize=require(_0xb9e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb9e9('0x1')},'table':{'type':Sequelize[_0xb9e9('0x2')]},'metric':{'type':Sequelize[_0xb9e9('0x3')]},'description':{'type':Sequelize[_0xb9e9('0x2')]}};
\ No newline at end of file
+var _0xbee0=['STRING','name','TEXT','exports'];(function(_0x204774,_0x572ffc){var _0x9f6e47=function(_0x590321){while(--_0x590321){_0x204774['push'](_0x204774['shift']());}};_0x9f6e47(++_0x572ffc);}(_0xbee0,0x147));var _0x0bee=function(_0x3fa4ec,_0x3387d3){_0x3fa4ec=_0x3fa4ec-0x0;var _0x4df5f0=_0xbee0[_0x3fa4ec];return _0x4df5f0;};'use strict';var Sequelize=require('sequelize');module[_0x0bee('0x0')]={'name':{'type':Sequelize[_0x0bee('0x1')],'allowNull':![],'unique':_0x0bee('0x2')},'table':{'type':Sequelize[_0x0bee('0x1')]},'metric':{'type':Sequelize[_0x0bee('0x3')]},'description':{'type':Sequelize[_0x0bee('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index e21dbca..7e9f8e0 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 _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x5c2e2a,_0x468cb1){var _0x172203=function(_0x29e8e8){while(--_0x29e8e8){_0x5c2e2a['push'](_0x5c2e2a['shift']());}};_0x172203(++_0x468cb1);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x28c03c,_0x299fd3){_0x28c03c=_0x28c03c-0x0;var _0x1f5454=_0xd6d6[_0x28c03c];return _0x1f5454;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));};
\ No newline at end of file
+var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xc187f4,_0x406145){var _0x1dc539=function(_0x48fc22){while(--_0x48fc22){_0xc187f4['push'](_0xc187f4['shift']());}};_0x1dc539(++_0x406145);}(_0x8ef6,0xf2));var _0x68ef=function(_0x57f20c,_0x33aa60){_0x57f20c=_0x57f20c-0x0;var _0x3e36e9=_0x8ef6[_0x57f20c];return _0x3e36e9;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 4e71227..2d2f477 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 _0xbea5=['moment','bluebird','request-promise','path','./analyticMetric.attributes','AnalyticMetric','lodash','util','api'];(function(_0x50b1f0,_0x39b616){var _0x347b7c=function(_0x15e3de){while(--_0x15e3de){_0x50b1f0['push'](_0x50b1f0['shift']());}};_0x347b7c(++_0x39b616);}(_0xbea5,0x177));var _0x5bea=function(_0x3ee1fe,_0x59f2a1){_0x3ee1fe=_0x3ee1fe-0x0;var _0x1ae57a=_0xbea5[_0x3ee1fe];return _0x1ae57a;};'use strict';var _=require(_0x5bea('0x0'));var util=require(_0x5bea('0x1'));var logger=require('../../config/logger')(_0x5bea('0x2'));var moment=require(_0x5bea('0x3'));var BPromise=require(_0x5bea('0x4'));var rp=require(_0x5bea('0x5'));var fs=require('fs');var path=require(_0x5bea('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5bea('0x7'));module['exports']=function(_0x156737,_0x51ac31){return _0x156737['define'](_0x5bea('0x8'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb091=['moment','request-promise','../../config/environment','./analyticMetric.attributes','define','analytics_metrics','util','../../config/logger','api'];(function(_0x2d0057,_0x24db80){var _0x2881ca=function(_0x42c8a4){while(--_0x42c8a4){_0x2d0057['push'](_0x2d0057['shift']());}};_0x2881ca(++_0x24db80);}(_0xb091,0x16e));var _0x1b09=function(_0x486876,_0x76fa8a){_0x486876=_0x486876-0x0;var _0x1dc1c2=_0xb091[_0x486876];return _0x1dc1c2;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var logger=require(_0x1b09('0x1'))(_0x1b09('0x2'));var moment=require(_0x1b09('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b09('0x5'));var attributes=require(_0x1b09('0x6'));module['exports']=function(_0xda8caa,_0x5fa348){return _0xda8caa[_0x1b09('0x7')]('AnalyticMetric',attributes,{'tableName':_0x1b09('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 35d2d70..4007d93 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 _0xddc2=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x445e32,_0x178189){var _0xa4bef0=function(_0x8c8565){while(--_0x8c8565){_0x445e32['push'](_0x445e32['shift']());}};_0xa4bef0(++_0x178189);}(_0xddc2,0x17b));var _0x2ddc=function(_0x431e18,_0x35c3a0){_0x431e18=_0x431e18-0x0;var _0x466f84=_0xddc2[_0x431e18];return _0x466f84;};'use strict';var _=require('lodash');var util=require(_0x2ddc('0x0'));var moment=require(_0x2ddc('0x1'));var BPromise=require(_0x2ddc('0x2'));var rs=require(_0x2ddc('0x3'));var fs=require('fs');var Redis=require(_0x2ddc('0x4'));var db=require(_0x2ddc('0x5'))['db'];var utils=require(_0x2ddc('0x6'));var logger=require(_0x2ddc('0x7'))(_0x2ddc('0x8'));var config=require(_0x2ddc('0x9'));var jayson=require(_0x2ddc('0xa'));var client=jayson['client'][_0x2ddc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa07d3a,_0x5e61b5,_0x4dc4ba){return new BPromise(function(_0x240b7c,_0xc8f21f){return client[_0x2ddc('0xc')](_0xa07d3a,_0x4dc4ba)[_0x2ddc('0xd')](function(_0x47e754){logger[_0x2ddc('0xe')](_0x2ddc('0xf'),_0x5e61b5,_0x2ddc('0x10'));logger[_0x2ddc('0x11')](_0x2ddc('0x12'),_0x5e61b5,_0x2ddc('0x10'),JSON[_0x2ddc('0x13')](_0x47e754));if(_0x47e754[_0x2ddc('0x14')]){if(_0x47e754['error'][_0x2ddc('0x15')]===0x1f4){logger[_0x2ddc('0x14')](_0x2ddc('0xf'),_0x5e61b5,_0x47e754[_0x2ddc('0x14')]['message']);return _0xc8f21f(_0x47e754[_0x2ddc('0x14')][_0x2ddc('0x16')]);}logger['error'](_0x2ddc('0xf'),_0x5e61b5,_0x47e754['error'][_0x2ddc('0x16')]);return _0x240b7c(_0x47e754['error'][_0x2ddc('0x16')]);}else{logger[_0x2ddc('0xe')](_0x2ddc('0xf'),_0x5e61b5,_0x2ddc('0x10'));_0x240b7c(_0x47e754[_0x2ddc('0x17')][_0x2ddc('0x16')]);}})[_0x2ddc('0x18')](function(_0x54284b){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x5e61b5,_0x54284b);_0xc8f21f(_0x54284b);});});}
\ No newline at end of file
+var _0xa3f8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','lodash','bluebird','randomstring','ioredis'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xa3f8,0x1df));var _0x8a3f=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0xa3f8[_0x55fb83];return _0x59a87a;};'use strict';var _=require(_0x8a3f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a3f('0x1'));var rs=require(_0x8a3f('0x2'));var fs=require('fs');var Redis=require(_0x8a3f('0x3'));var db=require(_0x8a3f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a3f('0x5'))(_0x8a3f('0x6'));var config=require(_0x8a3f('0x7'));var jayson=require(_0x8a3f('0x8'));var client=jayson[_0x8a3f('0x9')][_0x8a3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8c8a81,_0x3f5cc9,_0x1c457a){return new BPromise(function(_0x19b46f,_0x1a7a3a){return client[_0x8a3f('0xb')](_0x8c8a81,_0x1c457a)[_0x8a3f('0xc')](function(_0x315b7c){logger[_0x8a3f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3f5cc9,_0x8a3f('0xe'));logger[_0x8a3f('0xf')](_0x8a3f('0x10'),_0x3f5cc9,_0x8a3f('0xe'),JSON['stringify'](_0x315b7c));if(_0x315b7c[_0x8a3f('0x11')]){if(_0x315b7c[_0x8a3f('0x11')][_0x8a3f('0x12')]===0x1f4){logger[_0x8a3f('0x11')](_0x8a3f('0x13'),_0x3f5cc9,_0x315b7c[_0x8a3f('0x11')][_0x8a3f('0x14')]);return _0x1a7a3a(_0x315b7c[_0x8a3f('0x11')][_0x8a3f('0x14')]);}logger[_0x8a3f('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x3f5cc9,_0x315b7c['error']['message']);return _0x19b46f(_0x315b7c[_0x8a3f('0x11')][_0x8a3f('0x14')]);}else{logger[_0x8a3f('0xd')](_0x8a3f('0x13'),_0x3f5cc9,'request\x20sent');_0x19b46f(_0x315b7c['result'][_0x8a3f('0x14')]);}})['catch'](function(_0x33e575){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3f5cc9,_0x33e575);_0x1a7a3a(_0x33e575);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 3f6cf11..b7d5b2e 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 _0x8a8b=['get','isAuthenticated','post','create','/:id','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./analyticMetric.controller'];(function(_0x183f49,_0x21a84b){var _0x17d97c=function(_0x432668){while(--_0x432668){_0x183f49['push'](_0x183f49['shift']());}};_0x17d97c(++_0x21a84b);}(_0x8a8b,0xae));var _0xb8a8=function(_0x5e8ea0,_0x4a9a8a){_0x5e8ea0=_0x5e8ea0-0x0;var _0x5b0619=_0x8a8b[_0x5e8ea0];return _0x5b0619;};'use strict';var multer=require(_0xb8a8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb8a8('0x1'));var express=require(_0xb8a8('0x2'));var router=express['Router']();var fs_extra=require(_0xb8a8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb8a8('0x4'));var config=require('../../config/environment');var controller=require(_0xb8a8('0x5'));router[_0xb8a8('0x6')]('/',auth[_0xb8a8('0x7')](),controller['index']);router[_0xb8a8('0x6')]('/:id',auth[_0xb8a8('0x7')](),controller['show']);router[_0xb8a8('0x8')]('/',auth[_0xb8a8('0x7')](),controller[_0xb8a8('0x9')]);router['put'](_0xb8a8('0xa'),auth[_0xb8a8('0x7')](),controller[_0xb8a8('0xb')]);router[_0xb8a8('0xc')](_0xb8a8('0xa'),auth[_0xb8a8('0x7')](),controller[_0xb8a8('0xd')]);module[_0xb8a8('0xe')]=router;
\ No newline at end of file
+var _0xdbf7=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xf9a547,_0x40ab32){var _0x573d08=function(_0x4b23ef){while(--_0x4b23ef){_0xf9a547['push'](_0xf9a547['shift']());}};_0x573d08(++_0x40ab32);}(_0xdbf7,0x8d));var _0x7dbf=function(_0x188ee2,_0xb845f6){_0x188ee2=_0x188ee2-0x0;var _0x336576=_0xdbf7[_0x188ee2];return _0x336576;};'use strict';var multer=require(_0x7dbf('0x0'));var util=require(_0x7dbf('0x1'));var path=require(_0x7dbf('0x2'));var timeout=require(_0x7dbf('0x3'));var express=require(_0x7dbf('0x4'));var router=express[_0x7dbf('0x5')]();var fs_extra=require(_0x7dbf('0x6'));var auth=require(_0x7dbf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7dbf('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x7dbf('0x9')](),controller[_0x7dbf('0xa')]);router[_0x7dbf('0xb')](_0x7dbf('0xc'),auth[_0x7dbf('0x9')](),controller[_0x7dbf('0xd')]);router[_0x7dbf('0xe')]('/',auth[_0x7dbf('0x9')](),controller[_0x7dbf('0xf')]);router[_0x7dbf('0x10')](_0x7dbf('0xc'),auth[_0x7dbf('0x9')](),controller[_0x7dbf('0x11')]);router[_0x7dbf('0x12')](_0x7dbf('0xc'),auth['isAuthenticated'](),controller[_0x7dbf('0x13')]);module[_0x7dbf('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 354fe70..beac5fb 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 _0xa610=['TEXT','sequelize','exports'];(function(_0x5483cc,_0x494e01){var _0xe66a31=function(_0xf17e2b){while(--_0xf17e2b){_0x5483cc['push'](_0x5483cc['shift']());}};_0xe66a31(++_0x494e01);}(_0xa610,0x6a));var _0x0a61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa610[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0a61('0x0'));module[_0x0a61('0x1')]={'tree':{'type':Sequelize[_0x0a61('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x9c08=['sequelize','exports','TEXT'];(function(_0x47d69f,_0x460801){var _0xd1a4b5=function(_0x51a661){while(--_0x51a661){_0x47d69f['push'](_0x47d69f['shift']());}};_0xd1a4b5(++_0x460801);}(_0x9c08,0x147));var _0x89c0=function(_0x5c425d,_0x12caad){_0x5c425d=_0x5c425d-0x0;var _0x21b646=_0x9c08[_0x5c425d];return _0x21b646;};'use strict';var Sequelize=require(_0x89c0('0x0'));module[_0x89c0('0x1')]={'tree':{'type':Sequelize[_0x89c0('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 17bd9b6..3296c61 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 _0xdd3c=['mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','then','rows','catch','params','options','find','create','body','destroy','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x236b34,_0x298581){var _0x5da74d=function(_0x26c81d){while(--_0x26c81d){_0x236b34['push'](_0x236b34['shift']());}};_0x5da74d(++_0x298581);}(_0xdd3c,0x87));var _0xcdd3=function(_0x2a1ebb,_0x5d4d0e){_0x2a1ebb=_0x2a1ebb-0x0;var _0x3f70c5=_0xdd3c[_0x2a1ebb];return _0x3f70c5;};'use strict';var emlformat=require(_0xcdd3('0x0'));var rimraf=require(_0xcdd3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcdd3('0x2'));var moment=require(_0xcdd3('0x3'));var BPromise=require(_0xcdd3('0x4'));var Mustache=require(_0xcdd3('0x5'));var util=require(_0xcdd3('0x6'));var path=require(_0xcdd3('0x7'));var sox=require(_0xcdd3('0x8'));var csv=require('to-csv');var ejs=require(_0xcdd3('0x9'));var fs=require('fs');var fs_extra=require(_0xcdd3('0xa'));var _=require('lodash');var squel=require(_0xcdd3('0xb'));var crypto=require(_0xcdd3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcdd3('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdd3('0xe'));var authService=require(_0xcdd3('0xf'));var qs=require(_0xcdd3('0x10'));var as=require(_0xcdd3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcdd3('0x12'));var utils=require(_0xcdd3('0x13'));var config=require(_0xcdd3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcdd3('0x15'))['db'];function respondWithStatusCode(_0x55d7e9,_0x55c92c){_0x55c92c=_0x55c92c||0xcc;return function(_0x1f175e){if(_0x1f175e){return _0x55d7e9[_0xcdd3('0x16')](_0x55c92c);}return _0x55d7e9[_0xcdd3('0x17')](_0x55c92c)[_0xcdd3('0x18')]();};}function respondWithResult(_0x24e668,_0x2ccfa2){_0x2ccfa2=_0x2ccfa2||0xc8;return function(_0xe1038f){if(_0xe1038f){return _0x24e668[_0xcdd3('0x17')](_0x2ccfa2)['json'](_0xe1038f);}};}function respondWithFilteredResult(_0x590c82,_0x242ae1){return function(_0x2b0adf){if(_0x2b0adf){var _0x4dcfc1=typeof _0x242ae1[_0xcdd3('0x19')]===_0xcdd3('0x1a')&&typeof _0x242ae1['limit']===_0xcdd3('0x1a');var _0x22c109=_0x2b0adf[_0xcdd3('0x1b')];var _0x2cd860=_0x4dcfc1?0x0:_0x242ae1[_0xcdd3('0x19')];var _0x5b5082=_0x4dcfc1?_0x2b0adf[_0xcdd3('0x1b')]:_0x242ae1['offset']+_0x242ae1[_0xcdd3('0x1c')];var _0x555198;if(_0x5b5082>=_0x22c109){_0x5b5082=_0x22c109;_0x555198=0xc8;}else{_0x555198=0xce;}_0x590c82['status'](_0x555198);return _0x590c82[_0xcdd3('0x1d')](_0xcdd3('0x1e'),_0x2cd860+'-'+_0x5b5082+'/'+_0x22c109)['json'](_0x2b0adf);}return null;};}function patchUpdates(_0x5d9038){return function(_0x26dc07){try{jsonpatch[_0xcdd3('0x1f')](_0x26dc07,_0x5d9038,!![]);}catch(_0x3cc575){return BPromise[_0xcdd3('0x20')](_0x3cc575);}return _0x26dc07[_0xcdd3('0x21')]();};}function saveUpdates(_0x2613eb,_0x66f7e){return function(_0x23f8a7){if(_0x23f8a7){return _0x23f8a7[_0xcdd3('0x22')](_0x2613eb)['then'](function(_0x483a0a){return _0x483a0a;});}return null;};}function removeEntity(_0x172ae9,_0xd6a9ad){return function(_0x169049){if(_0x169049){return _0x169049['destroy']()['then'](function(){_0x172ae9['status'](0xcc)[_0xcdd3('0x18')]();});}};}function handleEntityNotFound(_0x202b1e,_0x5c20e5){return function(_0xb03647){if(!_0xb03647){_0x202b1e[_0xcdd3('0x16')](0x194);}return _0xb03647;};}function handleError(_0x522971,_0x57202a){_0x57202a=_0x57202a||0x1f4;return function(_0x403353){logger['error'](_0x403353['stack']);if(_0x403353[_0xcdd3('0x23')]){delete _0x403353['name'];}_0x522971[_0xcdd3('0x17')](_0x57202a)[_0xcdd3('0x24')](_0x403353);};}exports[_0xcdd3('0x25')]=function(_0x430150,_0x2c0991){var _0x4e0eaf={},_0x523932={},_0x544f23={'count':0x0,'rows':[]};var _0x440d0c=_[_0xcdd3('0x26')](db[_0xcdd3('0x27')][_0xcdd3('0x28')],function(_0x427615){return{'name':_0x427615['fieldName'],'type':_0x427615[_0xcdd3('0x29')][_0xcdd3('0x2a')]};});_0x523932[_0xcdd3('0x2b')]=_[_0xcdd3('0x26')](_0x440d0c,_0xcdd3('0x23'));_0x523932[_0xcdd3('0x2c')]=_[_0xcdd3('0x2d')](_0x430150[_0xcdd3('0x2c')]);_0x523932[_0xcdd3('0x2e')]=_[_0xcdd3('0x2f')](_0x523932[_0xcdd3('0x2b')],_0x523932[_0xcdd3('0x2c')]);_0x4e0eaf['attributes']=_['intersection'](_0x523932[_0xcdd3('0x2b')],qs[_0xcdd3('0x30')](_0x430150['query'][_0xcdd3('0x30')]));_0x4e0eaf[_0xcdd3('0x31')]=_0x4e0eaf[_0xcdd3('0x31')][_0xcdd3('0x32')]?_0x4e0eaf['attributes']:_0x523932[_0xcdd3('0x2b')];if(!_0x430150[_0xcdd3('0x2c')][_0xcdd3('0x33')](_0xcdd3('0x34'))){_0x4e0eaf[_0xcdd3('0x1c')]=qs[_0xcdd3('0x1c')](_0x430150[_0xcdd3('0x2c')]['limit']);_0x4e0eaf[_0xcdd3('0x19')]=qs[_0xcdd3('0x19')](_0x430150['query'][_0xcdd3('0x19')]);}_0x4e0eaf[_0xcdd3('0x35')]=qs[_0xcdd3('0x36')](_0x430150[_0xcdd3('0x2c')][_0xcdd3('0x36')]);_0x4e0eaf[_0xcdd3('0x37')]=qs['filters'](_['pick'](_0x430150[_0xcdd3('0x2c')],_0x523932[_0xcdd3('0x2e')]),_0x440d0c);if(_0x430150[_0xcdd3('0x2c')][_0xcdd3('0x38')]){_0x4e0eaf[_0xcdd3('0x37')]=_[_0xcdd3('0x39')](_0x4e0eaf[_0xcdd3('0x37')],{'$or':_[_0xcdd3('0x26')](_0x440d0c,function(_0x53545e){if(_0x53545e[_0xcdd3('0x29')]!=='VIRTUAL'){var _0x4cb4f8={};_0x4cb4f8[_0x53545e[_0xcdd3('0x23')]]={'$like':'%'+_0x430150[_0xcdd3('0x2c')][_0xcdd3('0x38')]+'%'};return _0x4cb4f8;}})});}_0x4e0eaf=_['merge']({},_0x4e0eaf,_0x430150['options']);var _0x1b0819={'where':_0x4e0eaf[_0xcdd3('0x37')]};return db[_0xcdd3('0x27')][_0xcdd3('0x1b')](_0x1b0819)['then'](function(_0x551d21){_0x544f23['count']=_0x551d21;if(_0x430150['query'][_0xcdd3('0x3a')]){_0x4e0eaf[_0xcdd3('0x3b')]=[{'all':!![]}];}return db[_0xcdd3('0x27')][_0xcdd3('0x3c')](_0x4e0eaf);})[_0xcdd3('0x3d')](function(_0x2cb821){_0x544f23[_0xcdd3('0x3e')]=_0x2cb821;return _0x544f23;})[_0xcdd3('0x3d')](respondWithFilteredResult(_0x2c0991,_0x4e0eaf))[_0xcdd3('0x3f')](handleError(_0x2c0991,null));};exports['show']=function(_0x558f73,_0x153051){var _0x115258={'raw':!![],'where':{'id':_0x558f73[_0xcdd3('0x40')]['id']}},_0x2fbc58={};_0x2fbc58[_0xcdd3('0x2b')]=_['keys'](db[_0xcdd3('0x27')][_0xcdd3('0x28')]);_0x2fbc58[_0xcdd3('0x2c')]=_[_0xcdd3('0x2d')](_0x558f73['query']);_0x2fbc58[_0xcdd3('0x2e')]=_['intersection'](_0x2fbc58['model'],_0x2fbc58[_0xcdd3('0x2c')]);_0x115258[_0xcdd3('0x31')]=_['intersection'](_0x2fbc58[_0xcdd3('0x2b')],qs[_0xcdd3('0x30')](_0x558f73['query'][_0xcdd3('0x30')]));_0x115258[_0xcdd3('0x31')]=_0x115258['attributes']['length']?_0x115258[_0xcdd3('0x31')]:_0x2fbc58['model'];if(_0x558f73['query']['includeAll']){_0x115258['include']=[{'all':!![]}];}_0x115258=_['merge']({},_0x115258,_0x558f73[_0xcdd3('0x41')]);return db[_0xcdd3('0x27')][_0xcdd3('0x42')](_0x115258)[_0xcdd3('0x3d')](handleEntityNotFound(_0x153051,null))['then'](respondWithResult(_0x153051,null))[_0xcdd3('0x3f')](handleError(_0x153051,null));};exports[_0xcdd3('0x43')]=function(_0x50d422,_0x277a94){return db[_0xcdd3('0x27')]['create'](_0x50d422['body'],{})[_0xcdd3('0x3d')](respondWithResult(_0x277a94,0xc9))[_0xcdd3('0x3f')](handleError(_0x277a94,null));};exports[_0xcdd3('0x22')]=function(_0x38a952,_0x2dcd51){if(_0x38a952['body']['id']){delete _0x38a952[_0xcdd3('0x44')]['id'];}return db[_0xcdd3('0x27')][_0xcdd3('0x42')]({'where':{'id':_0x38a952[_0xcdd3('0x40')]['id']}})[_0xcdd3('0x3d')](handleEntityNotFound(_0x2dcd51,null))[_0xcdd3('0x3d')](saveUpdates(_0x38a952[_0xcdd3('0x44')],null))[_0xcdd3('0x3d')](respondWithResult(_0x2dcd51,null))['catch'](handleError(_0x2dcd51,null));};exports[_0xcdd3('0x45')]=function(_0x385991,_0x80cf29){return db[_0xcdd3('0x27')][_0xcdd3('0x42')]({'where':{'id':_0x385991[_0xcdd3('0x40')]['id']}})[_0xcdd3('0x3d')](handleEntityNotFound(_0x80cf29,null))[_0xcdd3('0x3d')](removeEntity(_0x80cf29,null))['catch'](handleError(_0x80cf29,null));};
\ No newline at end of file
+var _0xd64f=['body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','update','destroy','then','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','options','includeAll','include','findAll','catch','show','params','keys','create'];(function(_0x33e5fe,_0x307a4b){var _0x195b9a=function(_0x48c555){while(--_0x48c555){_0x33e5fe['push'](_0x33e5fe['shift']());}};_0x195b9a(++_0x307a4b);}(_0xd64f,0x1ac));var _0xfd64=function(_0x1492f9,_0xfe7389){_0x1492f9=_0x1492f9-0x0;var _0x1dc8a8=_0xd64f[_0x1492f9];return _0x1dc8a8;};'use strict';var emlformat=require(_0xfd64('0x0'));var rimraf=require(_0xfd64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd64('0x2'));var rp=require(_0xfd64('0x3'));var moment=require(_0xfd64('0x4'));var BPromise=require(_0xfd64('0x5'));var Mustache=require(_0xfd64('0x6'));var util=require(_0xfd64('0x7'));var path=require(_0xfd64('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd64('0x9'));var squel=require('squel');var crypto=require(_0xfd64('0xa'));var jsforce=require(_0xfd64('0xb'));var deskjs=require(_0xfd64('0xc'));var toCsv=require(_0xfd64('0xd'));var querystring=require(_0xfd64('0xe'));var Papa=require(_0xfd64('0xf'));var Redis=require(_0xfd64('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfd64('0x11'));var as=require(_0xfd64('0x12'));var hardwareService=require(_0xfd64('0x13'));var logger=require(_0xfd64('0x14'))('api');var utils=require(_0xfd64('0x15'));var config=require(_0xfd64('0x16'));var licenseUtil=require(_0xfd64('0x17'));var db=require(_0xfd64('0x18'))['db'];function respondWithStatusCode(_0x5cf0d7,_0x47017f){_0x47017f=_0x47017f||0xcc;return function(_0x329a4a){if(_0x329a4a){return _0x5cf0d7[_0xfd64('0x19')](_0x47017f);}return _0x5cf0d7['status'](_0x47017f)[_0xfd64('0x1a')]();};}function respondWithResult(_0xcb3cb3,_0x198a75){_0x198a75=_0x198a75||0xc8;return function(_0x3d700d){if(_0x3d700d){return _0xcb3cb3[_0xfd64('0x1b')](_0x198a75)[_0xfd64('0x1c')](_0x3d700d);}};}function respondWithFilteredResult(_0x3ab6d8,_0x36d48a){return function(_0x3f7217){if(_0x3f7217){var _0xadf334=typeof _0x36d48a['offset']==='undefined'&&typeof _0x36d48a[_0xfd64('0x1d')]===_0xfd64('0x1e');var _0x366944=_0x3f7217[_0xfd64('0x1f')];var _0x136990=_0xadf334?0x0:_0x36d48a[_0xfd64('0x20')];var _0x4cc9c2=_0xadf334?_0x3f7217[_0xfd64('0x1f')]:_0x36d48a['offset']+_0x36d48a[_0xfd64('0x1d')];var _0x19cac7;if(_0x4cc9c2>=_0x366944){_0x4cc9c2=_0x366944;_0x19cac7=0xc8;}else{_0x19cac7=0xce;}_0x3ab6d8[_0xfd64('0x1b')](_0x19cac7);return _0x3ab6d8['set'](_0xfd64('0x21'),_0x136990+'-'+_0x4cc9c2+'/'+_0x366944)[_0xfd64('0x1c')](_0x3f7217);}return null;};}function patchUpdates(_0x5ab395){return function(_0x95d98f){try{jsonpatch[_0xfd64('0x22')](_0x95d98f,_0x5ab395,!![]);}catch(_0x447a04){return BPromise['reject'](_0x447a04);}return _0x95d98f['save']();};}function saveUpdates(_0x694a83,_0x1ec056){return function(_0x5c8fd){if(_0x5c8fd){return _0x5c8fd[_0xfd64('0x23')](_0x694a83)['then'](function(_0x853463){return _0x853463;});}return null;};}function removeEntity(_0x45dba0,_0x1a33f7){return function(_0x2d2273){if(_0x2d2273){return _0x2d2273[_0xfd64('0x24')]()[_0xfd64('0x25')](function(){_0x45dba0['status'](0xcc)[_0xfd64('0x1a')]();});}};}function handleEntityNotFound(_0x47e6fd,_0x1eb6f9){return function(_0x52218a){if(!_0x52218a){_0x47e6fd[_0xfd64('0x19')](0x194);}return _0x52218a;};}function handleError(_0x2cba05,_0x323f62){_0x323f62=_0x323f62||0x1f4;return function(_0x104e77){logger[_0xfd64('0x26')](_0x104e77[_0xfd64('0x27')]);if(_0x104e77['name']){delete _0x104e77[_0xfd64('0x28')];}_0x2cba05[_0xfd64('0x1b')](_0x323f62)['send'](_0x104e77);};}exports[_0xfd64('0x29')]=function(_0x237e6d,_0x41da45){var _0x211501={},_0x2ea267={},_0x49b43a={'count':0x0,'rows':[]};var _0x15dd5f=_[_0xfd64('0x2a')](db[_0xfd64('0x2b')][_0xfd64('0x2c')],function(_0x4ab988){return{'name':_0x4ab988['fieldName'],'type':_0x4ab988['type']['key']};});_0x2ea267['model']=_['map'](_0x15dd5f,_0xfd64('0x28'));_0x2ea267[_0xfd64('0x2d')]=_['keys'](_0x237e6d[_0xfd64('0x2d')]);_0x2ea267[_0xfd64('0x2e')]=_[_0xfd64('0x2f')](_0x2ea267[_0xfd64('0x30')],_0x2ea267[_0xfd64('0x2d')]);_0x211501[_0xfd64('0x31')]=_[_0xfd64('0x2f')](_0x2ea267['model'],qs[_0xfd64('0x32')](_0x237e6d['query']['fields']));_0x211501['attributes']=_0x211501[_0xfd64('0x31')][_0xfd64('0x33')]?_0x211501['attributes']:_0x2ea267['model'];if(!_0x237e6d['query'][_0xfd64('0x34')]('nolimit')){_0x211501['limit']=qs[_0xfd64('0x1d')](_0x237e6d[_0xfd64('0x2d')][_0xfd64('0x1d')]);_0x211501[_0xfd64('0x20')]=qs[_0xfd64('0x20')](_0x237e6d[_0xfd64('0x2d')]['offset']);}_0x211501[_0xfd64('0x35')]=qs[_0xfd64('0x36')](_0x237e6d['query'][_0xfd64('0x36')]);_0x211501['where']=qs['filters'](_[_0xfd64('0x37')](_0x237e6d[_0xfd64('0x2d')],_0x2ea267[_0xfd64('0x2e')]),_0x15dd5f);if(_0x237e6d[_0xfd64('0x2d')][_0xfd64('0x38')]){_0x211501['where']=_[_0xfd64('0x39')](_0x211501[_0xfd64('0x3a')],{'$or':_[_0xfd64('0x2a')](_0x15dd5f,function(_0x5ac6a5){if(_0x5ac6a5[_0xfd64('0x3b')]!=='VIRTUAL'){var _0x314080={};_0x314080[_0x5ac6a5[_0xfd64('0x28')]]={'$like':'%'+_0x237e6d[_0xfd64('0x2d')][_0xfd64('0x38')]+'%'};return _0x314080;}})});}_0x211501=_['merge']({},_0x211501,_0x237e6d[_0xfd64('0x3c')]);var _0x21abbc={'where':_0x211501[_0xfd64('0x3a')]};return db[_0xfd64('0x2b')][_0xfd64('0x1f')](_0x21abbc)['then'](function(_0x44340a){_0x49b43a[_0xfd64('0x1f')]=_0x44340a;if(_0x237e6d['query'][_0xfd64('0x3d')]){_0x211501[_0xfd64('0x3e')]=[{'all':!![]}];}return db[_0xfd64('0x2b')][_0xfd64('0x3f')](_0x211501);})[_0xfd64('0x25')](function(_0x5876e0){_0x49b43a['rows']=_0x5876e0;return _0x49b43a;})['then'](respondWithFilteredResult(_0x41da45,_0x211501))[_0xfd64('0x40')](handleError(_0x41da45,null));};exports[_0xfd64('0x41')]=function(_0xd49fc9,_0x14506a){var _0x24f2a2={'raw':!![],'where':{'id':_0xd49fc9[_0xfd64('0x42')]['id']}},_0xa6a7d0={};_0xa6a7d0['model']=_[_0xfd64('0x43')](db[_0xfd64('0x2b')]['rawAttributes']);_0xa6a7d0['query']=_[_0xfd64('0x43')](_0xd49fc9[_0xfd64('0x2d')]);_0xa6a7d0['filters']=_['intersection'](_0xa6a7d0[_0xfd64('0x30')],_0xa6a7d0['query']);_0x24f2a2['attributes']=_[_0xfd64('0x2f')](_0xa6a7d0[_0xfd64('0x30')],qs['fields'](_0xd49fc9['query'][_0xfd64('0x32')]));_0x24f2a2['attributes']=_0x24f2a2[_0xfd64('0x31')][_0xfd64('0x33')]?_0x24f2a2[_0xfd64('0x31')]:_0xa6a7d0[_0xfd64('0x30')];if(_0xd49fc9[_0xfd64('0x2d')][_0xfd64('0x3d')]){_0x24f2a2[_0xfd64('0x3e')]=[{'all':!![]}];}_0x24f2a2=_[_0xfd64('0x39')]({},_0x24f2a2,_0xd49fc9['options']);return db[_0xfd64('0x2b')]['find'](_0x24f2a2)[_0xfd64('0x25')](handleEntityNotFound(_0x14506a,null))['then'](respondWithResult(_0x14506a,null))[_0xfd64('0x40')](handleError(_0x14506a,null));};exports[_0xfd64('0x44')]=function(_0x3d0f97,_0xe2dd37){return db[_0xfd64('0x2b')]['create'](_0x3d0f97[_0xfd64('0x45')],{})[_0xfd64('0x25')](respondWithResult(_0xe2dd37,0xc9))[_0xfd64('0x40')](handleError(_0xe2dd37,null));};exports[_0xfd64('0x23')]=function(_0x54dcb9,_0xa69fba){if(_0x54dcb9['body']['id']){delete _0x54dcb9[_0xfd64('0x45')]['id'];}return db[_0xfd64('0x2b')][_0xfd64('0x46')]({'where':{'id':_0x54dcb9[_0xfd64('0x42')]['id']}})[_0xfd64('0x25')](handleEntityNotFound(_0xa69fba,null))[_0xfd64('0x25')](saveUpdates(_0x54dcb9[_0xfd64('0x45')],null))[_0xfd64('0x25')](respondWithResult(_0xa69fba,null))[_0xfd64('0x40')](handleError(_0xa69fba,null));};exports[_0xfd64('0x24')]=function(_0x4f97e2,_0x5d4ff1){return db['AnalyticTreeReport'][_0xfd64('0x46')]({'where':{'id':_0x4f97e2['params']['id']}})[_0xfd64('0x25')](handleEntityNotFound(_0x5d4ff1,null))[_0xfd64('0x25')](removeEntity(_0x5d4ff1,null))['catch'](handleError(_0x5d4ff1,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 9b6466f..0995fc8 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 _0xee23=['api','bluebird','request-promise','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0xee23,0x1d7));var _0x3ee2=function(_0x4a80a0,_0x21eea3){_0x4a80a0=_0x4a80a0-0x0;var _0x2a04f2=_0xee23[_0x4a80a0];return _0x2a04f2;};'use strict';var _=require(_0x3ee2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3ee2('0x1'));var moment=require('moment');var BPromise=require(_0x3ee2('0x2'));var rp=require(_0x3ee2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3ee2('0x4'));module[_0x3ee2('0x5')]=function(_0x39f4d7,_0x264860){return _0x39f4d7[_0x3ee2('0x6')]('AnalyticTreeReport',attributes,{'tableName':_0x3ee2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11f3=['../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3828e2,_0x2ef6d6){var _0x2fa385=function(_0x2b8040){while(--_0x2b8040){_0x3828e2['push'](_0x3828e2['shift']());}};_0x2fa385(++_0x2ef6d6);}(_0x11f3,0x118));var _0x311f=function(_0x3a7bdf,_0x58bdd8){_0x3a7bdf=_0x3a7bdf-0x0;var _0x35a9a8=_0x11f3[_0x3a7bdf];return _0x35a9a8;};'use strict';var _=require(_0x311f('0x0'));var util=require('util');var logger=require(_0x311f('0x1'))(_0x311f('0x2'));var moment=require(_0x311f('0x3'));var BPromise=require(_0x311f('0x4'));var rp=require(_0x311f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x311f('0x6'));var attributes=require(_0x311f('0x7'));module['exports']=function(_0x49d494,_0x1539be){return _0x49d494[_0x311f('0x8')](_0x311f('0x9'),attributes,{'tableName':_0x311f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 4789c36..2711899 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x329908,_0x14e1ca){var _0x22e271=function(_0x4915c3){while(--_0x4915c3){_0x329908['push'](_0x329908['shift']());}};_0x22e271(++_0x14e1ca);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0xad82c8,_0x5bc74a){_0xad82c8=_0xad82c8-0x0;var _0x43b405=_0x7a54[_0xad82c8];return _0x43b405;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 1b94d9b..424d726 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 _0x4e9a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xc3c34c,_0x7d58c2){var _0x3300e4=function(_0x564389){while(--_0x564389){_0xc3c34c['push'](_0xc3c34c['shift']());}};_0x3300e4(++_0x7d58c2);}(_0x4e9a,0x1df));var _0xa4e9=function(_0x381017,_0x1c5974){_0x381017=_0x381017-0x0;var _0x3fb76d=_0x4e9a[_0x381017];return _0x3fb76d;};'use strict';var multer=require(_0xa4e9('0x0'));var util=require(_0xa4e9('0x1'));var path=require(_0xa4e9('0x2'));var timeout=require(_0xa4e9('0x3'));var express=require(_0xa4e9('0x4'));var router=express[_0xa4e9('0x5')]();var fs_extra=require(_0xa4e9('0x6'));var auth=require(_0xa4e9('0x7'));var interaction=require(_0xa4e9('0x8'));var config=require(_0xa4e9('0x9'));var controller=require(_0xa4e9('0xa'));router['get']('/',auth[_0xa4e9('0xb')](),controller[_0xa4e9('0xc')]);router[_0xa4e9('0xd')](_0xa4e9('0xe'),auth[_0xa4e9('0xb')](),controller[_0xa4e9('0xf')]);router[_0xa4e9('0x10')]('/',auth[_0xa4e9('0xb')](),controller[_0xa4e9('0x11')]);router[_0xa4e9('0x12')](_0xa4e9('0xe'),auth[_0xa4e9('0xb')](),controller[_0xa4e9('0x13')]);router['delete'](_0xa4e9('0xe'),auth[_0xa4e9('0xb')](),controller[_0xa4e9('0x14')]);module[_0xa4e9('0x15')]=router;
\ No newline at end of file
+var _0xe81f=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe81f,0x126));var _0xfe81=function(_0x3071b5,_0xa4b97d){_0x3071b5=_0x3071b5-0x0;var _0x43af37=_0xe81f[_0x3071b5];return _0x43af37;};'use strict';var multer=require(_0xfe81('0x0'));var util=require('util');var path=require(_0xfe81('0x1'));var timeout=require(_0xfe81('0x2'));var express=require('express');var router=express[_0xfe81('0x3')]();var fs_extra=require(_0xfe81('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe81('0x5'));var config=require(_0xfe81('0x6'));var controller=require(_0xfe81('0x7'));router[_0xfe81('0x8')]('/',auth[_0xfe81('0x9')](),controller['index']);router[_0xfe81('0x8')](_0xfe81('0xa'),auth[_0xfe81('0x9')](),controller[_0xfe81('0xb')]);router['post']('/',auth[_0xfe81('0x9')](),controller['create']);router[_0xfe81('0xc')](_0xfe81('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xfe81('0xd')](_0xfe81('0xa'),auth['isAuthenticated'](),controller[_0xfe81('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index a4cbc3b..b408ea1 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 _0x7f42=['STRING','sequelize'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7f42,0x1dd));var _0x27f4=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7f42[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x27f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x27f4('0x1')]},'basename':{'type':Sequelize[_0x27f4('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8135=['STRING','exports'];(function(_0x1b22b3,_0x99ea09){var _0x1678f1=function(_0x4fc986){while(--_0x4fc986){_0x1b22b3['push'](_0x1b22b3['shift']());}};_0x1678f1(++_0x99ea09);}(_0x8135,0x99));var _0x5813=function(_0x3725fc,_0x98ba1e){_0x3725fc=_0x3725fc-0x0;var _0xe49d8d=_0x8135[_0x3725fc];return _0xe49d8d;};'use strict';var Sequelize=require('sequelize');module[_0x5813('0x0')]={'name':{'type':Sequelize[_0x5813('0x1')]},'basename':{'type':Sequelize[_0x5813('0x1')]},'type':{'type':Sequelize[_0x5813('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 42445cb..0cb9d55 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 _0xa9a6=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','find','clone','params','options','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','findOne','join','root','offline-chat/','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa9a6,0xaa));var _0x6a9a=function(_0x146c59,_0xf9ea1d){_0x146c59=_0x146c59-0x0;var _0x46d7c1=_0xa9a6[_0x146c59];return _0x46d7c1;};'use strict';var emlformat=require(_0x6a9a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a9a('0x1'));var jsonpatch=require(_0x6a9a('0x2'));var rp=require(_0x6a9a('0x3'));var moment=require(_0x6a9a('0x4'));var BPromise=require(_0x6a9a('0x5'));var Mustache=require(_0x6a9a('0x6'));var util=require(_0x6a9a('0x7'));var path=require(_0x6a9a('0x8'));var sox=require('sox');var csv=require(_0x6a9a('0x9'));var ejs=require(_0x6a9a('0xa'));var fs=require('fs');var fs_extra=require(_0x6a9a('0xb'));var _=require(_0x6a9a('0xc'));var squel=require(_0x6a9a('0xd'));var crypto=require(_0x6a9a('0xe'));var jsforce=require(_0x6a9a('0xf'));var deskjs=require(_0x6a9a('0x10'));var toCsv=require(_0x6a9a('0x9'));var querystring=require(_0x6a9a('0x11'));var Papa=require(_0x6a9a('0x12'));var Redis=require('ioredis');var authService=require(_0x6a9a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a9a('0x14'));var logger=require(_0x6a9a('0x15'))('api');var utils=require(_0x6a9a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6a9a('0x17'));var db=require(_0x6a9a('0x18'))['db'];function respondWithStatusCode(_0x47ed9c,_0x18c9f4){_0x18c9f4=_0x18c9f4||0xcc;return function(_0x3e5b11){if(_0x3e5b11){return _0x47ed9c[_0x6a9a('0x19')](_0x18c9f4);}return _0x47ed9c['status'](_0x18c9f4)[_0x6a9a('0x1a')]();};}function respondWithResult(_0x728b08,_0x9156cb){_0x9156cb=_0x9156cb||0xc8;return function(_0x35fbcf){if(_0x35fbcf){return _0x728b08[_0x6a9a('0x1b')](_0x9156cb)[_0x6a9a('0x1c')](_0x35fbcf);}};}function respondWithFilteredResult(_0x152cf7,_0x4d45a8){return function(_0xe95188){if(_0xe95188){var _0x2502bc=typeof _0x4d45a8[_0x6a9a('0x1d')]===_0x6a9a('0x1e')&&typeof _0x4d45a8[_0x6a9a('0x1f')]===_0x6a9a('0x1e');var _0x58c255=_0xe95188[_0x6a9a('0x20')];var _0x275bd6=_0x2502bc?0x0:_0x4d45a8[_0x6a9a('0x1d')];var _0x197032=_0x2502bc?_0xe95188['count']:_0x4d45a8[_0x6a9a('0x1d')]+_0x4d45a8['limit'];var _0x4c2f9d;if(_0x197032>=_0x58c255){_0x197032=_0x58c255;_0x4c2f9d=0xc8;}else{_0x4c2f9d=0xce;}_0x152cf7[_0x6a9a('0x1b')](_0x4c2f9d);return _0x152cf7['set'](_0x6a9a('0x21'),_0x275bd6+'-'+_0x197032+'/'+_0x58c255)[_0x6a9a('0x1c')](_0xe95188);}return null;};}function patchUpdates(_0x205e1b){return function(_0x2d525b){try{jsonpatch[_0x6a9a('0x22')](_0x2d525b,_0x205e1b,!![]);}catch(_0x147d0b){return BPromise[_0x6a9a('0x23')](_0x147d0b);}return _0x2d525b[_0x6a9a('0x24')]();};}function saveUpdates(_0x1f56c1,_0xb37d){return function(_0x23fa82){if(_0x23fa82){return _0x23fa82[_0x6a9a('0x25')](_0x1f56c1)[_0x6a9a('0x26')](function(_0x5b7e55){return _0x5b7e55;});}return null;};}function removeEntity(_0x16b616,_0x203eb4){return function(_0x3a1f31){if(_0x3a1f31){return _0x3a1f31[_0x6a9a('0x27')]()[_0x6a9a('0x26')](function(){_0x16b616[_0x6a9a('0x1b')](0xcc)[_0x6a9a('0x1a')]();});}};}function handleEntityNotFound(_0x7d8236,_0x53bdce){return function(_0x35385d){if(!_0x35385d){_0x7d8236[_0x6a9a('0x19')](0x194);}return _0x35385d;};}function handleError(_0x3919d5,_0x516eab){_0x516eab=_0x516eab||0x1f4;return function(_0x1ed93e){logger['error'](_0x1ed93e[_0x6a9a('0x28')]);if(_0x1ed93e['name']){delete _0x1ed93e[_0x6a9a('0x29')];}_0x3919d5[_0x6a9a('0x1b')](_0x516eab)['send'](_0x1ed93e);};}exports[_0x6a9a('0x2a')]=function(_0x397eaa,_0x26b551){var _0x13001c={},_0x5c7293={},_0x39f23={'count':0x0,'rows':[]};var _0x283012=_[_0x6a9a('0x2b')](db[_0x6a9a('0x2c')][_0x6a9a('0x2d')],function(_0x55fffb){return{'name':_0x55fffb[_0x6a9a('0x2e')],'type':_0x55fffb[_0x6a9a('0x2f')][_0x6a9a('0x30')]};});_0x5c7293[_0x6a9a('0x31')]=_[_0x6a9a('0x2b')](_0x283012,_0x6a9a('0x29'));_0x5c7293[_0x6a9a('0x32')]=_['keys'](_0x397eaa['query']);_0x5c7293[_0x6a9a('0x33')]=_['intersection'](_0x5c7293[_0x6a9a('0x31')],_0x5c7293[_0x6a9a('0x32')]);_0x13001c[_0x6a9a('0x34')]=_[_0x6a9a('0x35')](_0x5c7293[_0x6a9a('0x31')],qs[_0x6a9a('0x36')](_0x397eaa[_0x6a9a('0x32')][_0x6a9a('0x36')]));_0x13001c[_0x6a9a('0x34')]=_0x13001c['attributes'][_0x6a9a('0x37')]?_0x13001c[_0x6a9a('0x34')]:_0x5c7293[_0x6a9a('0x31')];if(!_0x397eaa[_0x6a9a('0x32')][_0x6a9a('0x38')](_0x6a9a('0x39'))){_0x13001c[_0x6a9a('0x1f')]=qs[_0x6a9a('0x1f')](_0x397eaa['query'][_0x6a9a('0x1f')]);_0x13001c[_0x6a9a('0x1d')]=qs[_0x6a9a('0x1d')](_0x397eaa[_0x6a9a('0x32')][_0x6a9a('0x1d')]);}_0x13001c[_0x6a9a('0x3a')]=qs[_0x6a9a('0x3b')](_0x397eaa[_0x6a9a('0x32')][_0x6a9a('0x3b')]);_0x13001c[_0x6a9a('0x3c')]=qs['filters'](_[_0x6a9a('0x3d')](_0x397eaa[_0x6a9a('0x32')],_0x5c7293[_0x6a9a('0x33')]),_0x283012);if(_0x397eaa[_0x6a9a('0x32')][_0x6a9a('0x3e')]){_0x13001c['where']=_[_0x6a9a('0x3f')](_0x13001c[_0x6a9a('0x3c')],{'$or':_['map'](_0x283012,function(_0x23c0ec){if(_0x23c0ec[_0x6a9a('0x2f')]!==_0x6a9a('0x40')){var _0x515cd5={};_0x515cd5[_0x23c0ec[_0x6a9a('0x29')]]={'$like':'%'+_0x397eaa['query']['filter']+'%'};return _0x515cd5;}})});}_0x13001c=_[_0x6a9a('0x3f')]({},_0x13001c,_0x397eaa['options']);var _0x4f6702={'where':_0x13001c[_0x6a9a('0x3c')]};return db[_0x6a9a('0x2c')][_0x6a9a('0x20')](_0x4f6702)[_0x6a9a('0x26')](function(_0x214569){_0x39f23[_0x6a9a('0x20')]=_0x214569;if(_0x397eaa[_0x6a9a('0x32')][_0x6a9a('0x41')]){_0x13001c[_0x6a9a('0x42')]=[{'all':!![]}];}return db[_0x6a9a('0x2c')]['findAll'](_0x13001c);})['then'](function(_0x5299bf){_0x39f23[_0x6a9a('0x43')]=_0x5299bf;return _0x39f23;})['then'](respondWithFilteredResult(_0x26b551,_0x13001c))[_0x6a9a('0x44')](handleError(_0x26b551,null));};exports[_0x6a9a('0x45')]=function(_0x43bd78,_0x15ddba){var _0x44f8fd={'raw':!![],'where':{'id':_0x43bd78['params']['id']}},_0x5a936b={};_0x5a936b[_0x6a9a('0x31')]=_[_0x6a9a('0x46')](db[_0x6a9a('0x2c')][_0x6a9a('0x2d')]);_0x5a936b[_0x6a9a('0x32')]=_['keys'](_0x43bd78[_0x6a9a('0x32')]);_0x5a936b[_0x6a9a('0x33')]=_[_0x6a9a('0x35')](_0x5a936b[_0x6a9a('0x31')],_0x5a936b['query']);_0x44f8fd['attributes']=_[_0x6a9a('0x35')](_0x5a936b['model'],qs[_0x6a9a('0x36')](_0x43bd78[_0x6a9a('0x32')]['fields']));_0x44f8fd[_0x6a9a('0x34')]=_0x44f8fd['attributes'][_0x6a9a('0x37')]?_0x44f8fd[_0x6a9a('0x34')]:_0x5a936b['model'];if(_0x43bd78[_0x6a9a('0x32')][_0x6a9a('0x41')]){_0x44f8fd[_0x6a9a('0x42')]=[{'all':!![]}];}_0x44f8fd=_['merge']({},_0x44f8fd,_0x43bd78['options']);return db[_0x6a9a('0x2c')][_0x6a9a('0x47')](_0x44f8fd)[_0x6a9a('0x26')](handleEntityNotFound(_0x15ddba,null))['then'](respondWithResult(_0x15ddba,null))[_0x6a9a('0x44')](handleError(_0x15ddba,null));};exports[_0x6a9a('0x48')]=function(_0x2d0602,_0x3d17f8){var _0x632adc={'where':{'id':_0x2d0602[_0x6a9a('0x49')]['id']}},_0x160312={};_0x160312[_0x6a9a('0x31')]=_['keys'](db[_0x6a9a('0x2c')][_0x6a9a('0x2d')]);_0x632adc[_0x6a9a('0x34')]=_['intersection'](_0x160312['model'],qs[_0x6a9a('0x36')](_0x2d0602[_0x6a9a('0x32')][_0x6a9a('0x36')]));_0x632adc[_0x6a9a('0x34')]=_0x632adc['attributes']['length']?_0x632adc[_0x6a9a('0x34')]:_0x160312[_0x6a9a('0x31')];if(_0x2d0602['query'][_0x6a9a('0x41')]){_0x632adc['include']=[{'all':!![]}];}_0x632adc=_['merge']({},_0x632adc,_0x2d0602[_0x6a9a('0x4a')]);return db[_0x6a9a('0x2c')][_0x6a9a('0x47')](_0x632adc)['then'](handleEntityNotFound(_0x3d17f8,null))[_0x6a9a('0x26')](function(_0x45e350){if(_0x45e350){var _0x519f57=_0x45e350[_0x6a9a('0x4b')]({'plain':!![]});_0x519f57=qs[_0x6a9a('0x4c')](_0x519f57,['id',_0x6a9a('0x4d'),_0x6a9a('0x4e')]);_0x2d0602['body']=_['omit'](_0x2d0602[_0x6a9a('0x4f')],['id','createdAt',_0x6a9a('0x4e')]);return db[_0x6a9a('0x2c')][_0x6a9a('0x50')](_[_0x6a9a('0x3f')](_0x519f57,_0x2d0602[_0x6a9a('0x4f')]),{'include':_0x2d0602[_0x6a9a('0x32')][_0x6a9a('0x41')]?[{'all':!![]}]:undefined});}})[_0x6a9a('0x26')](respondWithResult(_0x3d17f8,0xc9))['catch'](handleError(_0x3d17f8,null));};exports['update']=function(_0xf76359,_0x3f27d7){if(_0xf76359[_0x6a9a('0x4f')]['id']){delete _0xf76359[_0x6a9a('0x4f')]['id'];}return db[_0x6a9a('0x2c')][_0x6a9a('0x47')]({'where':{'id':_0xf76359[_0x6a9a('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f27d7,null))[_0x6a9a('0x26')](saveUpdates(_0xf76359[_0x6a9a('0x4f')],null))['then'](respondWithResult(_0x3f27d7,null))[_0x6a9a('0x44')](handleError(_0x3f27d7,null));};exports[_0x6a9a('0x27')]=function(_0x25cce3,_0x151eb6){return db[_0x6a9a('0x2c')][_0x6a9a('0x47')]({'where':{'id':_0x25cce3[_0x6a9a('0x49')]['id']}})[_0x6a9a('0x26')](handleEntityNotFound(_0x151eb6,null))[_0x6a9a('0x26')](removeEntity(_0x151eb6,null))['catch'](handleError(_0x151eb6,null));};exports['create']=function(_0x253167,_0x4e2d58,_0x20a8d6){_0x253167[_0x6a9a('0x4f')][_0x6a9a('0x29')]=_0x253167[_0x6a9a('0x51')][_0x6a9a('0x52')];_0x253167['body'][_0x6a9a('0x53')]=_0x253167[_0x6a9a('0x51')][_0x6a9a('0x54')];_0x253167['body']['type']=_0x253167['file']['mimetype'];return db[_0x6a9a('0x2c')][_0x6a9a('0x50')](_0x253167[_0x6a9a('0x4f')])[_0x6a9a('0x26')](respondWithResult(_0x4e2d58,0xc9))['catch'](handleError(_0x4e2d58,null));};exports['download']=function(_0x59be96,_0x1c9ab3,_0x4bc08f){return db[_0x6a9a('0x2c')][_0x6a9a('0x55')]({'where':{'id':_0x59be96[_0x6a9a('0x49')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1c9ab3,null))[_0x6a9a('0x26')](function(_0x5d4356){if(_0x5d4356){var _0x3b3820=_0x5d4356['ChatOfflineMessageId']!==null;var _0x58e4c2=path[_0x6a9a('0x56')](config[_0x6a9a('0x57')],'server/files/attachments/');if(_0x3b3820){_0x58e4c2=path['join'](_0x58e4c2,_0x6a9a('0x58'));}var _0x564fa2=path['join'](_0x58e4c2,_0x5d4356[_0x6a9a('0x53')]);return _0x1c9ab3[_0x6a9a('0x59')](_0x564fa2);}})[_0x6a9a('0x44')](handleError(_0x1c9ab3,null));};
\ No newline at end of file
+var _0xefb5=['show','params','rawAttributes','find','omit','body','create','file','originalname','type','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','Attachment','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x278111,_0x44e763){var _0x34edb0=function(_0x585faf){while(--_0x585faf){_0x278111['push'](_0x278111['shift']());}};_0x34edb0(++_0x44e763);}(_0xefb5,0x10b));var _0x5efb=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xefb5[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require(_0x5efb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5efb('0x1'));var jsonpatch=require(_0x5efb('0x2'));var rp=require(_0x5efb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5efb('0x4'));var util=require('util');var path=require(_0x5efb('0x5'));var sox=require(_0x5efb('0x6'));var csv=require(_0x5efb('0x7'));var ejs=require(_0x5efb('0x8'));var fs=require('fs');var fs_extra=require(_0x5efb('0x9'));var _=require('lodash');var squel=require(_0x5efb('0xa'));var crypto=require(_0x5efb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5efb('0xc'));var toCsv=require(_0x5efb('0x7'));var querystring=require(_0x5efb('0xd'));var Papa=require(_0x5efb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5efb('0xf'));var as=require(_0x5efb('0x10'));var hardwareService=require(_0x5efb('0x11'));var logger=require(_0x5efb('0x12'))(_0x5efb('0x13'));var utils=require('../../config/utils');var config=require(_0x5efb('0x14'));var licenseUtil=require(_0x5efb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16351f,_0x5cd8f8){_0x5cd8f8=_0x5cd8f8||0xcc;return function(_0x4e8c2a){if(_0x4e8c2a){return _0x16351f[_0x5efb('0x16')](_0x5cd8f8);}return _0x16351f[_0x5efb('0x17')](_0x5cd8f8)[_0x5efb('0x18')]();};}function respondWithResult(_0x2641ef,_0x5c1732){_0x5c1732=_0x5c1732||0xc8;return function(_0x4b0328){if(_0x4b0328){return _0x2641ef[_0x5efb('0x17')](_0x5c1732)[_0x5efb('0x19')](_0x4b0328);}};}function respondWithFilteredResult(_0x255365,_0xf415f0){return function(_0xc49129){if(_0xc49129){var _0x2b0ab9=typeof _0xf415f0[_0x5efb('0x1a')]===_0x5efb('0x1b')&&typeof _0xf415f0[_0x5efb('0x1c')]===_0x5efb('0x1b');var _0x324f4d=_0xc49129[_0x5efb('0x1d')];var _0x2a591a=_0x2b0ab9?0x0:_0xf415f0[_0x5efb('0x1a')];var _0x35ff7d=_0x2b0ab9?_0xc49129[_0x5efb('0x1d')]:_0xf415f0[_0x5efb('0x1a')]+_0xf415f0[_0x5efb('0x1c')];var _0x3c3e7a;if(_0x35ff7d>=_0x324f4d){_0x35ff7d=_0x324f4d;_0x3c3e7a=0xc8;}else{_0x3c3e7a=0xce;}_0x255365[_0x5efb('0x17')](_0x3c3e7a);return _0x255365[_0x5efb('0x1e')](_0x5efb('0x1f'),_0x2a591a+'-'+_0x35ff7d+'/'+_0x324f4d)[_0x5efb('0x19')](_0xc49129);}return null;};}function patchUpdates(_0x3da8d7){return function(_0xc9a640){try{jsonpatch[_0x5efb('0x20')](_0xc9a640,_0x3da8d7,!![]);}catch(_0xf8a70c){return BPromise[_0x5efb('0x21')](_0xf8a70c);}return _0xc9a640['save']();};}function saveUpdates(_0x4f3b80,_0x4badd8){return function(_0xee5caf){if(_0xee5caf){return _0xee5caf[_0x5efb('0x22')](_0x4f3b80)['then'](function(_0x58247a){return _0x58247a;});}return null;};}function removeEntity(_0x267932,_0xe5de8a){return function(_0x2e1f09){if(_0x2e1f09){return _0x2e1f09[_0x5efb('0x23')]()[_0x5efb('0x24')](function(){_0x267932[_0x5efb('0x17')](0xcc)[_0x5efb('0x18')]();});}};}function handleEntityNotFound(_0x5714fd,_0x1411b0){return function(_0x2f4a17){if(!_0x2f4a17){_0x5714fd['sendStatus'](0x194);}return _0x2f4a17;};}function handleError(_0x240189,_0x4ed1b7){_0x4ed1b7=_0x4ed1b7||0x1f4;return function(_0xc0d95f){logger['error'](_0xc0d95f[_0x5efb('0x25')]);if(_0xc0d95f[_0x5efb('0x26')]){delete _0xc0d95f[_0x5efb('0x26')];}_0x240189[_0x5efb('0x17')](_0x4ed1b7)[_0x5efb('0x27')](_0xc0d95f);};}exports[_0x5efb('0x28')]=function(_0x2886cd,_0x6cc841){var _0xc560b1={},_0x208bfe={},_0x6b0356={'count':0x0,'rows':[]};var _0x4dfc2c=_['map'](db[_0x5efb('0x29')]['rawAttributes'],function(_0x3c88ba){return{'name':_0x3c88ba['fieldName'],'type':_0x3c88ba['type'][_0x5efb('0x2a')]};});_0x208bfe[_0x5efb('0x2b')]=_[_0x5efb('0x2c')](_0x4dfc2c,'name');_0x208bfe[_0x5efb('0x2d')]=_[_0x5efb('0x2e')](_0x2886cd['query']);_0x208bfe[_0x5efb('0x2f')]=_['intersection'](_0x208bfe['model'],_0x208bfe[_0x5efb('0x2d')]);_0xc560b1[_0x5efb('0x30')]=_[_0x5efb('0x31')](_0x208bfe[_0x5efb('0x2b')],qs[_0x5efb('0x32')](_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x32')]));_0xc560b1[_0x5efb('0x30')]=_0xc560b1['attributes'][_0x5efb('0x33')]?_0xc560b1['attributes']:_0x208bfe[_0x5efb('0x2b')];if(!_0x2886cd[_0x5efb('0x2d')]['hasOwnProperty'](_0x5efb('0x34'))){_0xc560b1[_0x5efb('0x1c')]=qs[_0x5efb('0x1c')](_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x1c')]);_0xc560b1[_0x5efb('0x1a')]=qs[_0x5efb('0x1a')](_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x1a')]);}_0xc560b1[_0x5efb('0x35')]=qs[_0x5efb('0x36')](_0x2886cd['query'][_0x5efb('0x36')]);_0xc560b1[_0x5efb('0x37')]=qs[_0x5efb('0x2f')](_[_0x5efb('0x38')](_0x2886cd[_0x5efb('0x2d')],_0x208bfe[_0x5efb('0x2f')]),_0x4dfc2c);if(_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x39')]){_0xc560b1[_0x5efb('0x37')]=_[_0x5efb('0x3a')](_0xc560b1[_0x5efb('0x37')],{'$or':_[_0x5efb('0x2c')](_0x4dfc2c,function(_0x2a68f6){if(_0x2a68f6['type']!==_0x5efb('0x3b')){var _0x5718ff={};_0x5718ff[_0x2a68f6[_0x5efb('0x26')]]={'$like':'%'+_0x2886cd['query'][_0x5efb('0x39')]+'%'};return _0x5718ff;}})});}_0xc560b1=_[_0x5efb('0x3a')]({},_0xc560b1,_0x2886cd[_0x5efb('0x3c')]);var _0x127163={'where':_0xc560b1['where']};return db[_0x5efb('0x29')]['count'](_0x127163)['then'](function(_0x3b9602){_0x6b0356[_0x5efb('0x1d')]=_0x3b9602;if(_0x2886cd[_0x5efb('0x2d')][_0x5efb('0x3d')]){_0xc560b1[_0x5efb('0x3e')]=[{'all':!![]}];}return db[_0x5efb('0x29')][_0x5efb('0x3f')](_0xc560b1);})[_0x5efb('0x24')](function(_0xb4c804){_0x6b0356['rows']=_0xb4c804;return _0x6b0356;})[_0x5efb('0x24')](respondWithFilteredResult(_0x6cc841,_0xc560b1))[_0x5efb('0x40')](handleError(_0x6cc841,null));};exports[_0x5efb('0x41')]=function(_0x4c6fa0,_0x172f53){var _0x2e91c7={'raw':!![],'where':{'id':_0x4c6fa0[_0x5efb('0x42')]['id']}},_0x30d9f0={};_0x30d9f0['model']=_['keys'](db['Attachment'][_0x5efb('0x43')]);_0x30d9f0[_0x5efb('0x2d')]=_['keys'](_0x4c6fa0[_0x5efb('0x2d')]);_0x30d9f0[_0x5efb('0x2f')]=_[_0x5efb('0x31')](_0x30d9f0[_0x5efb('0x2b')],_0x30d9f0['query']);_0x2e91c7['attributes']=_['intersection'](_0x30d9f0[_0x5efb('0x2b')],qs[_0x5efb('0x32')](_0x4c6fa0[_0x5efb('0x2d')][_0x5efb('0x32')]));_0x2e91c7['attributes']=_0x2e91c7[_0x5efb('0x30')][_0x5efb('0x33')]?_0x2e91c7[_0x5efb('0x30')]:_0x30d9f0[_0x5efb('0x2b')];if(_0x4c6fa0[_0x5efb('0x2d')][_0x5efb('0x3d')]){_0x2e91c7[_0x5efb('0x3e')]=[{'all':!![]}];}_0x2e91c7=_[_0x5efb('0x3a')]({},_0x2e91c7,_0x4c6fa0[_0x5efb('0x3c')]);return db[_0x5efb('0x29')]['find'](_0x2e91c7)[_0x5efb('0x24')](handleEntityNotFound(_0x172f53,null))[_0x5efb('0x24')](respondWithResult(_0x172f53,null))[_0x5efb('0x40')](handleError(_0x172f53,null));};exports['clone']=function(_0x195bd2,_0x3058ae){var _0x1ab7aa={'where':{'id':_0x195bd2[_0x5efb('0x42')]['id']}},_0x5370b2={};_0x5370b2[_0x5efb('0x2b')]=_[_0x5efb('0x2e')](db[_0x5efb('0x29')][_0x5efb('0x43')]);_0x1ab7aa['attributes']=_[_0x5efb('0x31')](_0x5370b2['model'],qs['fields'](_0x195bd2['query'][_0x5efb('0x32')]));_0x1ab7aa[_0x5efb('0x30')]=_0x1ab7aa[_0x5efb('0x30')][_0x5efb('0x33')]?_0x1ab7aa['attributes']:_0x5370b2[_0x5efb('0x2b')];if(_0x195bd2[_0x5efb('0x2d')]['includeAll']){_0x1ab7aa['include']=[{'all':!![]}];}_0x1ab7aa=_[_0x5efb('0x3a')]({},_0x1ab7aa,_0x195bd2['options']);return db['Attachment'][_0x5efb('0x44')](_0x1ab7aa)[_0x5efb('0x24')](handleEntityNotFound(_0x3058ae,null))[_0x5efb('0x24')](function(_0x204433){if(_0x204433){var _0x25fc97=_0x204433['get']({'plain':!![]});_0x25fc97=qs[_0x5efb('0x45')](_0x25fc97,['id','createdAt','updatedAt']);_0x195bd2['body']=_[_0x5efb('0x45')](_0x195bd2[_0x5efb('0x46')],['id','createdAt','updatedAt']);return db[_0x5efb('0x29')][_0x5efb('0x47')](_[_0x5efb('0x3a')](_0x25fc97,_0x195bd2[_0x5efb('0x46')]),{'include':_0x195bd2['query'][_0x5efb('0x3d')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3058ae,0xc9))[_0x5efb('0x40')](handleError(_0x3058ae,null));};exports[_0x5efb('0x22')]=function(_0x134a96,_0x479720){if(_0x134a96[_0x5efb('0x46')]['id']){delete _0x134a96['body']['id'];}return db[_0x5efb('0x29')][_0x5efb('0x44')]({'where':{'id':_0x134a96['params']['id']}})[_0x5efb('0x24')](handleEntityNotFound(_0x479720,null))[_0x5efb('0x24')](saveUpdates(_0x134a96[_0x5efb('0x46')],null))[_0x5efb('0x24')](respondWithResult(_0x479720,null))['catch'](handleError(_0x479720,null));};exports[_0x5efb('0x23')]=function(_0xc8ed46,_0x33639e){return db[_0x5efb('0x29')][_0x5efb('0x44')]({'where':{'id':_0xc8ed46[_0x5efb('0x42')]['id']}})[_0x5efb('0x24')](handleEntityNotFound(_0x33639e,null))[_0x5efb('0x24')](removeEntity(_0x33639e,null))[_0x5efb('0x40')](handleError(_0x33639e,null));};exports['create']=function(_0x3b8516,_0x12eac6,_0x3c1c24){_0x3b8516['body'][_0x5efb('0x26')]=_0x3b8516[_0x5efb('0x48')][_0x5efb('0x49')];_0x3b8516[_0x5efb('0x46')]['basename']=_0x3b8516['file']['filename'];_0x3b8516[_0x5efb('0x46')][_0x5efb('0x4a')]=_0x3b8516[_0x5efb('0x48')][_0x5efb('0x4b')];return db[_0x5efb('0x29')][_0x5efb('0x47')](_0x3b8516['body'])[_0x5efb('0x24')](respondWithResult(_0x12eac6,0xc9))['catch'](handleError(_0x12eac6,null));};exports[_0x5efb('0x4c')]=function(_0x549309,_0x5be08f,_0xf96c67){return db['Attachment'][_0x5efb('0x4d')]({'where':{'id':_0x549309[_0x5efb('0x42')]['id']},'raw':!![]})[_0x5efb('0x24')](handleEntityNotFound(_0x5be08f,null))['then'](function(_0x22a3da){if(_0x22a3da){var _0x2f587e=_0x22a3da[_0x5efb('0x4e')]!==null;var _0xfe62ec=path[_0x5efb('0x4f')](config['root'],_0x5efb('0x50'));if(_0x2f587e){_0xfe62ec=path[_0x5efb('0x4f')](_0xfe62ec,_0x5efb('0x51'));}var _0x250f19=path[_0x5efb('0x4f')](_0xfe62ec,_0x22a3da[_0x5efb('0x52')]);return _0x5be08f[_0x5efb('0x4c')](_0x250f19);}})[_0x5efb('0x40')](handleError(_0x5be08f,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0edf7b9..8455976 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 _0x59c9=['define','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4eec16,_0x4339c7){var _0x33e9ce=function(_0x40274b){while(--_0x40274b){_0x4eec16['push'](_0x4eec16['shift']());}};_0x33e9ce(++_0x4339c7);}(_0x59c9,0x1c9));var _0x959c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x59c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x959c('0x0'));var util=require(_0x959c('0x1'));var logger=require(_0x959c('0x2'))(_0x959c('0x3'));var moment=require(_0x959c('0x4'));var BPromise=require(_0x959c('0x5'));var rp=require(_0x959c('0x6'));var fs=require('fs');var path=require(_0x959c('0x7'));var rimraf=require(_0x959c('0x8'));var config=require(_0x959c('0x9'));var attributes=require('./attachment.attributes');module[_0x959c('0xa')]=function(_0x17e391,_0x365b16){return _0x17e391[_0x959c('0xb')]('Attachment',attributes,{'tableName':_0x959c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e1a=['api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger'];(function(_0x1f9c93,_0x533398){var _0x226ac2=function(_0x24412c){while(--_0x24412c){_0x1f9c93['push'](_0x1f9c93['shift']());}};_0x226ac2(++_0x533398);}(_0x7e1a,0x195));var _0xa7e1=function(_0x316da5,_0x34ddb6){_0x316da5=_0x316da5-0x0;var _0xbd1248=_0x7e1a[_0x316da5];return _0xbd1248;};'use strict';var _=require(_0xa7e1('0x0'));var util=require(_0xa7e1('0x1'));var logger=require(_0xa7e1('0x2'))(_0xa7e1('0x3'));var moment=require('moment');var BPromise=require(_0xa7e1('0x4'));var rp=require(_0xa7e1('0x5'));var fs=require('fs');var path=require(_0xa7e1('0x6'));var rimraf=require(_0xa7e1('0x7'));var config=require('../../config/environment');var attributes=require(_0xa7e1('0x8'));module[_0xa7e1('0x9')]=function(_0x334c92,_0x49e036){return _0x334c92[_0xa7e1('0xa')]('Attachment',attributes,{'tableName':_0xa7e1('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 6d312b4..fc78d03 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 _0x202c=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','Attachment','options','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x256b67,_0x14e47b){var _0x3e2d99=function(_0x4a4c5f){while(--_0x4a4c5f){_0x256b67['push'](_0x256b67['shift']());}};_0x3e2d99(++_0x14e47b);}(_0x202c,0x178));var _0xc202=function(_0x567fb5,_0x143dde){_0x567fb5=_0x567fb5-0x0;var _0x3d3977=_0x202c[_0x567fb5];return _0x3d3977;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Attachment,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});}exports[_0xc202('0x16')]=function(_0x9620a0){var _0x591ecc=this;return new Promise(function(_0x16ec7c,_0x2c5557){return db[_0xc202('0x17')]['create'](_0x9620a0['body'],{'raw':_0x9620a0[_0xc202('0x18')]?_0x9620a0[_0xc202('0x18')][_0xc202('0x19')]===undefined?!![]:![]:!![]})[_0xc202('0xb')](function(_0x2ae3c1){logger['info']('CreateAttachment',_0x9620a0);logger[_0xc202('0xf')]('CreateAttachment',_0x9620a0,JSON[_0xc202('0x11')](_0x2ae3c1));_0x16ec7c(_0x2ae3c1);})[_0xc202('0x15')](function(_0x56e979){logger['error'](_0xc202('0x16'),_0x56e979['message'],_0x9620a0);_0x2c5557(_0x591ecc[_0xc202('0x12')](0x1f4,_0x56e979[_0xc202('0x14')]));});});};
\ No newline at end of file
+var _0x4fef=['debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw'];(function(_0x569b7a,_0x377a61){var _0x39d00a=function(_0x1ee0bc){while(--_0x1ee0bc){_0x569b7a['push'](_0x569b7a['shift']());}};_0x39d00a(++_0x377a61);}(_0x4fef,0x10f));var _0xf4fe=function(_0x196b4b,_0x41613f){_0x196b4b=_0x196b4b-0x0;var _0xefe3b0=_0x4fef[_0x196b4b];return _0xefe3b0;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var moment=require('moment');var BPromise=require(_0xf4fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4fe('0x3'));var db=require(_0xf4fe('0x4'))['db'];var utils=require(_0xf4fe('0x5'));var logger=require(_0xf4fe('0x6'))(_0xf4fe('0x7'));var config=require(_0xf4fe('0x8'));var jayson=require(_0xf4fe('0x9'));var client=jayson[_0xf4fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363096,_0x3e844d,_0x4805b0){return new BPromise(function(_0x23b761,_0x1e858f){return client[_0xf4fe('0xb')](_0x363096,_0x4805b0)[_0xf4fe('0xc')](function(_0xdec534){logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,_0xf4fe('0xf'));logger['debug'](_0xf4fe('0x10'),_0x3e844d,'request\x20sent',JSON[_0xf4fe('0x11')](_0xdec534));if(_0xdec534[_0xf4fe('0x12')]){if(_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x13')]===0x1f4){logger[_0xf4fe('0x12')]('Attachment,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x1e858f(_0xdec534[_0xf4fe('0x12')]['message']);}logger[_0xf4fe('0x12')]('Attachment,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x23b761(_0xdec534[_0xf4fe('0x12')]['message']);}else{logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,'request\x20sent');_0x23b761(_0xdec534[_0xf4fe('0x15')][_0xf4fe('0x14')]);}})[_0xf4fe('0x16')](function(_0x565dc6){logger['error'](_0xf4fe('0xe'),_0x3e844d,_0x565dc6);_0x1e858f(_0x565dc6);});});}exports[_0xf4fe('0x17')]=function(_0x5ad86c){var _0x519f1d=this;return new Promise(function(_0x24c818,_0x2b58dd){return db[_0xf4fe('0x18')][_0xf4fe('0x19')](_0x5ad86c[_0xf4fe('0x1a')],{'raw':_0x5ad86c[_0xf4fe('0x1b')]?_0x5ad86c[_0xf4fe('0x1b')][_0xf4fe('0x1c')]===undefined?!![]:![]:!![]})[_0xf4fe('0xc')](function(_0x223676){logger[_0xf4fe('0xd')](_0xf4fe('0x17'),_0x5ad86c);logger[_0xf4fe('0x1d')](_0xf4fe('0x17'),_0x5ad86c,JSON['stringify'](_0x223676));_0x24c818(_0x223676);})[_0xf4fe('0x16')](function(_0x5e8e18){logger['error']('CreateAttachment',_0x5e8e18[_0xf4fe('0x14')],_0x5ad86c);_0x2b58dd(_0x519f1d['error'](0x1f4,_0x5e8e18['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 057bb42..ba61bc8 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x3d7076,_0x4d777a){var _0x588fc8=function(_0xbbc87c){while(--_0xbbc87c){_0x3d7076['push'](_0x3d7076['shift']());}};_0x588fc8(++_0x4d777a);}(_0xadb5,0xad));var _0x5adb=function(_0x11a23b,_0x4c797b){_0x11a23b=_0x11a23b-0x0;var _0x6cb5f0=_0xadb5[_0x11a23b];return _0x6cb5f0;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x28fd8c,_0x6826b2){var _0x26bd61=function(_0x3d717b){while(--_0x3d717b){_0x28fd8c['push'](_0x28fd8c['shift']());}};_0x26bd61(++_0x6826b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x595151,_0x1f1f72){_0x595151=_0x595151-0x0;var _0x5776df=_0xb10b[_0x595151];return _0x5776df;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index e0046d1..f2de981 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 _0x85a1=['admin','user','agent','then','blockDuration','add','minutes','clearBlockUser','getLicense','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','name','password','salt','disabled','blocked','blockedAt','online'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0x85a1,0x1f2));var _0x185a=function(_0x55c291,_0x54188b){_0x55c291=_0x55c291-0x0;var _0x275ea9=_0x85a1[_0x55c291];return _0x275ea9;};'use strict';var passport=require(_0x185a('0x0'));var LocalStrategy=require(_0x185a('0x1'))[_0x185a('0x2')];var moment=require(_0x185a('0x3'));var ActiveDirectory=require(_0x185a('0x4'));var BPromise=require(_0x185a('0x5'));var util=require(_0x185a('0x6'));var db=require(_0x185a('0x7'))['db'];var authService=require(_0x185a('0x8'));var utils=require('../../config/utils');var config=require(_0x185a('0x9'));var logger=require(_0x185a('0xa'))(_0x185a('0xb'));function isActiveDirectoryConfigured(_0x4cde5c){var _0x13ae4c=![];if(typeof _0x4cde5c[_0x185a('0xc')]!==_0x185a('0xd')){_0x13ae4c=_0x4cde5c[_0x185a('0xc')][_0x185a('0xe')]&&_0x4cde5c['activedirectory'][_0x185a('0xf')]&&_0x4cde5c['activedirectory'][_0x185a('0x10')];}return _0x13ae4c;}function adAuthenticate(_0x49b6f5,_0x3530de,_0x47a23a){return new BPromise(function(_0x583555,_0x1ab3a4){try{var _0x3de8e8=new ActiveDirectory(_0x49b6f5);_0x3de8e8[_0x185a('0x11')](_0x3530de,_0x47a23a,function(_0x19ec03,_0x5ddf3b){if(_0x19ec03){logger[_0x185a('0x12')]('Error\x20authenticate\x20%s:\x20%s',_0x3530de,util['inspect'](_0x19ec03,{'showHidden':![],'depth':null}));_0x1ab3a4(_0x185a('0x13'));}else if(!_0x5ddf3b){logger[_0x185a('0x12')](_0x185a('0x14'),_0x3530de);_0x1ab3a4(_0x185a('0x13'));}else{_0x583555(_0x5ddf3b);}});}catch(_0x380345){_0x1ab3a4(_0x380345);}});}function ActiveDirectoryAuthenticate(_0xe6bef1,_0x8622d1,_0x4885e9,_0x166c33){var _0x3fbb9d,_0x3beebd;if(!isActiveDirectoryConfigured(config)){logger[_0x185a('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x8622d1);return _0x166c33(null,![],{'message':_0x185a('0x13')});}return db['Setting'][_0x185a('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})['then'](function(_0x11b2a7){_0x3fbb9d=_0x11b2a7;if(!_0x3fbb9d[_0x185a('0x16')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x8622d1);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0xe6bef1[_0x185a('0x15')]({'attributes':['id',_0x185a('0x17'),_0x185a('0x18'),_0x185a('0x19'),'role',_0x185a('0x1a'),_0x185a('0x1b'),_0x185a('0x1c'),_0x185a('0x1d')],'where':{'name':_0x8622d1,'role':{'$or':[_0x185a('0x1e'),_0x185a('0x1f'),_0x185a('0x20')]},'adSsoEnabled':!![]}});})[_0x185a('0x21')](function(_0x5be0f){if(!_0x5be0f||_0x5be0f&&_0x5be0f[_0x185a('0x17')]!==_0x8622d1){throw new Error(_0x185a('0x13'));}_0x3beebd=_0x5be0f;var _0x305e4a=_0x3beebd['name']+'@'+config[_0x185a('0xc')]['domain'];return adAuthenticate(config[_0x185a('0xc')],_0x305e4a,_0x4885e9);})['then'](function(_0x5ee30c){if(_0x3beebd[_0x185a('0x1a')]){throw new Error(_0x185a('0x13'));}if(_0x3fbb9d[_0x185a('0x22')]>0x0){if(_0x3beebd['blocked']){if(moment(_0x3beebd[_0x185a('0x1c')])[_0x185a('0x23')](_0x3fbb9d[_0x185a('0x22')],_0x185a('0x24'))>moment()){throw new Error(_0x185a('0x13'));}return utils[_0x185a('0x25')](_0x3beebd,0x0,![],null)[_0x185a('0x21')](function(){return utils['getLicense'](_0x3beebd);})[_0x185a('0x21')](function(){return _0x166c33(null,_0x3beebd);});}else{return utils['getLicense'](_0x3beebd)[_0x185a('0x21')](function(){return _0x166c33(null,_0x3beebd);});}}else{return utils[_0x185a('0x26')](_0x3beebd)['then'](function(){return _0x166c33(null,_0x3beebd);});}})['catch'](function(_0x2d18e9){return _0x166c33(null,![],_0x2d18e9);});}function handleError(_0x38d67f,_0x28bd9f,_0x183a68){return _0x38d67f['status'](_0x28bd9f||0x1f4)[_0x185a('0x27')]({'message':_0x183a68?_0x183a68[_0x185a('0x28')]||_0x183a68:''});}exports[_0x185a('0x29')]=function(_0x4c7869,_0x233652,_0x2cf117){passport[_0x185a('0x11')](_0x185a('0x2a'),function(_0x40e5a9,_0x105dae,_0x38f7be){var _0x4bac33=_0x40e5a9||_0x38f7be;if(_0x4bac33){return handleError(_0x233652,0x191,_0x4bac33);}if(!_0x105dae){return handleError(_0x233652,0x194,{'message':_0x185a('0x2b')});}else{var _0x313f27={'payload':{'id':_0x105dae['id'],'role':_0x105dae[_0x185a('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0x185a('0x2d')](_0x313f27)[_0x185a('0x21')](function(_0xebbe3f){_0x233652[_0x185a('0x2e')]({'id':_0x105dae['id'],'token':_0xebbe3f,'statusCall':'','isAlreadyLogged':_0x105dae['online']});});}})(_0x4c7869,_0x233652,_0x2cf117);};passport[_0x185a('0x2f')]('ad-login',new LocalStrategy({'usernameField':_0x185a('0x17'),'passwordField':_0x185a('0x18')},function(_0x37a110,_0x21f2a4,_0x33646c){return ActiveDirectoryAuthenticate(db['User'],_0x37a110,_0x21f2a4,_0x33646c);}));
\ No newline at end of file
+var _0x7355=['role','json','online','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','findOne','name','password','salt','blocked','blockedAt','admin','user','agent','then','disabled','add','getLicense','catch','send','message','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x2000c8,_0x4550cc){var _0x39e30c=function(_0x2d79a4){while(--_0x2d79a4){_0x2000c8['push'](_0x2000c8['shift']());}};_0x39e30c(++_0x4550cc);}(_0x7355,0x91));var _0x5735=function(_0x1035c3,_0x1072dc){_0x1035c3=_0x1035c3-0x0;var _0x2aeba6=_0x7355[_0x1035c3];return _0x2aeba6;};'use strict';var passport=require(_0x5735('0x0'));var LocalStrategy=require(_0x5735('0x1'))[_0x5735('0x2')];var moment=require(_0x5735('0x3'));var ActiveDirectory=require(_0x5735('0x4'));var BPromise=require(_0x5735('0x5'));var util=require('util');var db=require(_0x5735('0x6'))['db'];var authService=require(_0x5735('0x7'));var utils=require(_0x5735('0x8'));var config=require(_0x5735('0x9'));var logger=require(_0x5735('0xa'))(_0x5735('0xb'));function isActiveDirectoryConfigured(_0x2c1aa3){var _0x186b2a=![];if(typeof _0x2c1aa3[_0x5735('0xc')]!==_0x5735('0xd')){_0x186b2a=_0x2c1aa3[_0x5735('0xc')][_0x5735('0xe')]&&_0x2c1aa3[_0x5735('0xc')]['url']&&_0x2c1aa3['activedirectory'][_0x5735('0xf')];}return _0x186b2a;}function adAuthenticate(_0x391f7d,_0x1cd8dd,_0x257a8e){return new BPromise(function(_0x52967e,_0x38b5f3){try{var _0x5c9bd9=new ActiveDirectory(_0x391f7d);_0x5c9bd9['authenticate'](_0x1cd8dd,_0x257a8e,function(_0x520186,_0x51172a){if(_0x520186){logger['error'](_0x5735('0x10'),_0x1cd8dd,util[_0x5735('0x11')](_0x520186,{'showHidden':![],'depth':null}));_0x38b5f3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x51172a){logger[_0x5735('0x12')](_0x5735('0x13'),_0x1cd8dd);_0x38b5f3(_0x5735('0x14'));}else{_0x52967e(_0x51172a);}});}catch(_0x25f5d1){_0x38b5f3(_0x25f5d1);}});}function ActiveDirectoryAuthenticate(_0x377850,_0x1d4793,_0x2b5988,_0x12e200){var _0x295472,_0x184e0b;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x5735('0x15'),_0x1d4793);return _0x12e200(null,![],{'message':_0x5735('0x14')});}return db[_0x5735('0x16')]['findOne']({'where':{'id':0x1},'attributes':[_0x5735('0x17'),_0x5735('0x18')],'raw':!![]})['then'](function(_0x24314a){_0x295472=_0x24314a;if(!_0x295472[_0x5735('0x17')]){logger[_0x5735('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x1d4793);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x377850[_0x5735('0x19')]({'attributes':['id',_0x5735('0x1a'),_0x5735('0x1b'),_0x5735('0x1c'),'role','disabled',_0x5735('0x1d'),_0x5735('0x1e'),'online'],'where':{'name':_0x1d4793,'role':{'$or':[_0x5735('0x1f'),_0x5735('0x20'),_0x5735('0x21')]},'adSsoEnabled':!![]}});})[_0x5735('0x22')](function(_0x1838eb){if(!_0x1838eb||_0x1838eb&&_0x1838eb['name']!==_0x1d4793){throw new Error(_0x5735('0x14'));}_0x184e0b=_0x1838eb;var _0x4b1242=_0x184e0b['name']+'@'+config[_0x5735('0xc')][_0x5735('0xf')];return adAuthenticate(config[_0x5735('0xc')],_0x4b1242,_0x2b5988);})[_0x5735('0x22')](function(_0x5d855a){if(_0x184e0b[_0x5735('0x23')]){throw new Error(_0x5735('0x14'));}if(_0x295472[_0x5735('0x18')]>0x0){if(_0x184e0b[_0x5735('0x1d')]){if(moment(_0x184e0b['blockedAt'])[_0x5735('0x24')](_0x295472[_0x5735('0x18')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x184e0b,0x0,![],null)['then'](function(){return utils[_0x5735('0x25')](_0x184e0b);})[_0x5735('0x22')](function(){return _0x12e200(null,_0x184e0b);});}else{return utils['getLicense'](_0x184e0b)[_0x5735('0x22')](function(){return _0x12e200(null,_0x184e0b);});}}else{return utils[_0x5735('0x25')](_0x184e0b)[_0x5735('0x22')](function(){return _0x12e200(null,_0x184e0b);});}})[_0x5735('0x26')](function(_0x315e1f){return _0x12e200(null,![],_0x315e1f);});}function handleError(_0x45f6b0,_0x37a04b,_0x384f53){return _0x45f6b0['status'](_0x37a04b||0x1f4)[_0x5735('0x27')]({'message':_0x384f53?_0x384f53[_0x5735('0x28')]||_0x384f53:''});}exports['login']=function(_0x185627,_0x11c6f6,_0x55c3e9){passport[_0x5735('0x29')]('ad-login',function(_0x1d70b2,_0x5dbf35,_0x552349){var _0x5bcf77=_0x1d70b2||_0x552349;if(_0x5bcf77){return handleError(_0x11c6f6,0x191,_0x5bcf77);}if(!_0x5dbf35){return handleError(_0x11c6f6,0x194,{'message':_0x5735('0x2a')});}else{var _0x5303af={'payload':{'id':_0x5dbf35['id'],'role':_0x5dbf35[_0x5735('0x2b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5303af)[_0x5735('0x22')](function(_0x8e2547){_0x11c6f6[_0x5735('0x2c')]({'id':_0x5dbf35['id'],'token':_0x8e2547,'statusCall':'','isAlreadyLogged':_0x5dbf35[_0x5735('0x2d')]});});}})(_0x185627,_0x11c6f6,_0x55c3e9);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0x5735('0x1a'),'passwordField':_0x5735('0x1b')},function(_0x18e17f,_0x35fb01,_0x5a383a){return ActiveDirectoryAuthenticate(db[_0x5735('0x2e')],_0x18e17f,_0x35fb01,_0x5a383a);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 47e8338..d55faba 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 _0xff0d=['exports','express','Router','./authActiveDirectory.controller'];(function(_0x3e4fbe,_0x1a550d){var _0x158ba5=function(_0x446f40){while(--_0x446f40){_0x3e4fbe['push'](_0x3e4fbe['shift']());}};_0x158ba5(++_0x1a550d);}(_0xff0d,0x1b5));var _0xdff0=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xff0d[_0x365e54];return _0x13317a;};'use strict';var express=require(_0xdff0('0x0'));var router=express[_0xdff0('0x1')]();var controller=require(_0xdff0('0x2'));router['post']('/',controller['login']);module[_0xdff0('0x3')]=router;
\ No newline at end of file
+var _0x81c3=['./authActiveDirectory.controller','post','exports','express'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x81c3,0x18b));var _0x381c=function(_0x5d9b60,_0x11579a){_0x5d9b60=_0x5d9b60-0x0;var _0x8b8632=_0x81c3[_0x5d9b60];return _0x8b8632;};'use strict';var express=require(_0x381c('0x0'));var router=express['Router']();var controller=require(_0x381c('0x1'));router[_0x381c('0x2')]('/',controller['login']);module[_0x381c('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index dd8c206..c730952 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(_0x56accf,_0xe7b533){var _0x1770c8=function(_0x57798b){while(--_0x57798b){_0x56accf['push'](_0x56accf['shift']());}};_0x1770c8(++_0xe7b533);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7a54,0x106));var _0x47a5=function(_0x26db4b,_0x314d28){_0x26db4b=_0x26db4b-0x0;var _0x1f64c9=_0x7a54[_0x26db4b];return _0x1f64c9;};'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 48aa9cd..842fc58 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 _0x0677=['express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie'];(function(_0x56b352,_0x329a00){var _0x4c7f22=function(_0x3ab334){while(--_0x3ab334){_0x56b352['push'](_0x56b352['shift']());}};_0x4c7f22(++_0x329a00);}(_0x0677,0x105));var _0x7067=function(_0x4018d0,_0x10df66){_0x4018d0=_0x4018d0-0x0;var _0x229c58=_0x0677[_0x4018d0];return _0x229c58;};'use strict';var express=require(_0x7067('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x7067('0x1'));var userController=require(_0x7067('0x2'));var authService=require(_0x7067('0x3'));router[_0x7067('0x4')]('/',controller[_0x7067('0x5')]);router[_0x7067('0x4')](_0x7067('0x6'),controller['callback'],authService[_0x7067('0x7')],userController['login'],authService[_0x7067('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x9d5d=['login','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../../components/auth/service','get'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x9d5d,0x1bd));var _0xd9d5=function(_0x38ca9d,_0x3118ff){_0x38ca9d=_0x38ca9d-0x0;var _0x573132=_0x9d5d[_0x38ca9d];return _0x573132;};'use strict';var express=require(_0xd9d5('0x0'));var passport=require(_0xd9d5('0x1'));var router=express['Router']();var controller=require(_0xd9d5('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xd9d5('0x3'));router[_0xd9d5('0x4')]('/',controller[_0xd9d5('0x5')]);router['get']('/callback',controller['callback'],authService[_0xd9d5('0x6')],userController[_0xd9d5('0x5')],authService[_0xd9d5('0x7')]);module[_0xd9d5('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 23f2b12..787edd2 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 _0x5b97=['SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','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://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','use','util','passport','passport-local','Strategy','jayson/promise','moment','../../mysqldb','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blockedAt','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','name','email','Smtp','CloudProvider','getSmtpOptions','merge','format','request'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x5b97,0x1d6));var _0x75b9=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0x5b97[_0x2442b9];return _0x31b571;};'use strict';var util=require(_0x75b9('0x0'));var passport=require(_0x75b9('0x1'));var LocalStrategy=require(_0x75b9('0x2'))[_0x75b9('0x3')];var jayson=require(_0x75b9('0x4'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x75b9('0x5'));var db=require(_0x75b9('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x75b9('0x7')][_0x75b9('0x8')]({'port':0x232b});function localAuthenticate(_0x10faca,_0x24ce05,_0x40e514,_0x4d5fec){var _0x202161,_0x1e2c39;return db[_0x75b9('0x9')][_0x75b9('0xa')]({'where':{'id':0x1},'attributes':[_0x75b9('0xb'),_0x75b9('0xc')],'raw':!![]})['then'](function(_0x2c9ce4){_0x202161=_0x2c9ce4;return _0x10faca[_0x75b9('0xa')]({'attributes':['id','name',_0x75b9('0xd'),_0x75b9('0xe'),_0x75b9('0xf'),_0x75b9('0x10'),'blocked',_0x75b9('0x11'),'loginAttempts'],'where':{'name':_0x24ce05,'role':{'$or':[_0x75b9('0x12'),_0x75b9('0x13'),_0x75b9('0x14')]}}});})[_0x75b9('0x15')](function(_0x5d69a3){if(!_0x5d69a3||_0x5d69a3&&_0x5d69a3['name']!==_0x24ce05){throw new Error(_0x75b9('0x16'));}else{_0x1e2c39=_0x5d69a3;return _0x1e2c39;}})[_0x75b9('0x15')](function(){_0x1e2c39['authenticate'](_0x40e514,function(_0x41a9cc,_0x21f536){var _0x7fe96b=_0x1e2c39[_0x75b9('0x17')]+0x1;if(_0x41a9cc){return _0x4d5fec(_0x41a9cc);}else if(!_0x21f536){if(_0x1e2c39[_0x75b9('0x10')]){return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});}else if(_0x202161[_0x75b9('0xb')]>0x0){if(_0x1e2c39[_0x75b9('0x18')]){if(_0x202161['blockDuration']>0x0){if(moment(_0x1e2c39[_0x75b9('0x11')])[_0x75b9('0x19')](_0x202161[_0x75b9('0xc')],_0x75b9('0x1a'))>moment()){return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});}else{return utils['clearBlockUser'](_0x1e2c39,_0x7fe96b,![],null)[_0x75b9('0x15')](function(){return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});});}}else{return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});}}else{if(_0x7fe96b>=_0x202161['allowedLoginAttempts']){return utils['clearBlockUser'](_0x1e2c39,0x0,!![],moment())[_0x75b9('0x15')](function(){return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});});}else{return utils[_0x75b9('0x1b')](_0x1e2c39,_0x7fe96b,![],null)[_0x75b9('0x15')](function(){return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});});}}}else{return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});}}else{if(_0x1e2c39[_0x75b9('0x10')]){return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});}else if(_0x202161[_0x75b9('0xb')]>0x0){if(_0x1e2c39[_0x75b9('0x18')]){if(_0x202161[_0x75b9('0xc')]>0x0){if(moment(_0x1e2c39[_0x75b9('0x11')])[_0x75b9('0x19')](_0x202161[_0x75b9('0xc')],_0x75b9('0x1a'))>moment()){return _0x4d5fec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x75b9('0x1b')](_0x1e2c39,0x0,![],null)['then'](function(){return utils[_0x75b9('0x1c')](_0x1e2c39);})[_0x75b9('0x15')](function(){return _0x4d5fec(null,_0x1e2c39);});}}else{return _0x4d5fec(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x75b9('0x1b')](_0x1e2c39,0x0,![],null)[_0x75b9('0x15')](function(){return utils[_0x75b9('0x1c')](_0x1e2c39);})['then'](function(){return _0x4d5fec(null,_0x1e2c39);})[_0x75b9('0x1d')](function(_0x26e4fc){return _0x4d5fec(null,![],_0x26e4fc);});}}else{if(_0x1e2c39[_0x75b9('0x18')]){return _0x4d5fec(null,![],{'message':_0x75b9('0x16')});}else{return utils[_0x75b9('0x1c')](_0x1e2c39)[_0x75b9('0x15')](function(){return _0x4d5fec(null,_0x1e2c39);});}}}});})['catch'](function(_0x3789f7){return _0x4d5fec(null,![],_0x3789f7);});}function sendServiceMail(_0x43d2f0){return db[_0x75b9('0x1e')][_0x75b9('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x75b9('0x20'),_0x75b9('0x21')],'include':[{'model':db['MailServerOut'],'as':_0x75b9('0x22'),'include':[{'model':db[_0x75b9('0x23')],'as':_0x75b9('0x23')}]}]})['then'](function(_0x2fc919){if(!_0x2fc919){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x134812=_0x2fc919[_0x75b9('0x24')]();var _0x5889e1={'account':_0x134812,'message':_[_0x75b9('0x25')]({'from':util[_0x75b9('0x26')]('\x22%s\x22\x20<%s>',_0x2fc919[_0x75b9('0x20')],_0x2fc919['email']||_0x2fc919[_0x75b9('0x22')][_0x75b9('0x13')])},_0x43d2f0)};return client[_0x75b9('0x27')](_0x75b9('0x28'),_0x5889e1);})[_0x75b9('0x15')](function(_0x3ad13e){if(_0x3ad13e[_0x75b9('0x29')]){throw new Error(util['format'](_0x75b9('0x2a'),_0x3ad13e[_0x75b9('0x29')][_0x75b9('0x2b')]||JSON[_0x75b9('0x2c')](_0x3ad13e[_0x75b9('0x29')])));}return!![];});}function handleError(_0x17f8e3,_0x3f115f,_0x54a3cd){return _0x17f8e3['status'](_0x3f115f||0x1f4)[_0x75b9('0x2d')]({'message':_0x54a3cd?_0x54a3cd['message']||_0x54a3cd:''});}exports['login']=function(_0x3ada18,_0x2e42a8,_0x56b626){passport[_0x75b9('0x2e')](_0x75b9('0x2f'),function(_0x5eb7fa,_0x466533,_0x59c8a9){var _0x385141=_0x5eb7fa||_0x59c8a9;if(_0x385141){return handleError(_0x2e42a8,0x191,_0x385141);}if(!_0x466533){return handleError(_0x2e42a8,0x194,{'message':_0x75b9('0x30')});}else{var _0x30f30e={'payload':{'id':_0x466533['id'],'role':_0x466533[_0x75b9('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x75b9('0x31')](_0x30f30e)['then'](function(_0x1a1c09){_0x2e42a8[_0x75b9('0x32')]({'id':_0x466533['id'],'token':_0x1a1c09,'statusCall':'','isAlreadyLogged':_0x466533[_0x75b9('0x33')]});});}})(_0x3ada18,_0x2e42a8,_0x56b626);};exports[_0x75b9('0x34')]=function(_0x7c1d0f,_0x3df744){if(!_0x7c1d0f['body'][_0x75b9('0x21')]){return handleError(_0x3df744,0x1f4,{'message':_0x75b9('0x35')});}var _0x3b6c25=rs[_0x75b9('0x36')]();_0x7c1d0f[_0x75b9('0x37')][_0x75b9('0x21')]=_0x7c1d0f[_0x75b9('0x37')]['email'][_0x75b9('0x38')]()[_0x75b9('0x39')]();var _0x4e4c93;return db['Setting'][_0x75b9('0xa')]({'where':{'id':0x1},'attributes':[_0x75b9('0xb'),_0x75b9('0xc')],'raw':!![]})[_0x75b9('0x15')](function(_0x11f822){_0x4e4c93=_0x11f822;return db[_0x75b9('0x3a')][_0x75b9('0x1f')]({'where':{'email':_0x7c1d0f[_0x75b9('0x37')][_0x75b9('0x21')]}});})['then'](function(_0x638c80){if(!_0x638c80){throw new Error(_0x75b9('0x3b'));}if(_0x638c80[_0x75b9('0x10')]){throw new Error(_0x75b9('0x3c'));}if(_0x638c80[_0x75b9('0x18')]){if(moment(_0x638c80[_0x75b9('0x11')])[_0x75b9('0x19')](_0x4e4c93[_0x75b9('0xc')],_0x75b9('0x1a'))>moment()){throw new Error(_0x75b9('0x3d'));}else{_0x638c80[_0x75b9('0x18')]=![];_0x638c80[_0x75b9('0x11')]=null;}}_0x638c80[_0x75b9('0x3e')]=_0x3b6c25;_0x638c80['resetPasswordExpires']=Date[_0x75b9('0x3f')]()+0x36ee80;return _0x638c80[_0x75b9('0x40')]();})[_0x75b9('0x15')](function(){return sendServiceMail({'to':_0x7c1d0f['body'][_0x75b9('0x21')],'subject':_0x75b9('0x41'),'text':_0x75b9('0x42')+_0x75b9('0x43')+_0x75b9('0x44')+_0x7c1d0f[_0x75b9('0x45')][_0x75b9('0x46')]+_0x75b9('0x47')+_0x3b6c25+'\x0a\x0a'+_0x75b9('0x48')});})[_0x75b9('0x15')](function(){_0x3df744[_0x75b9('0x49')](0xc8)[_0x75b9('0x2d')]({'message':'Reset\x20Email\x20sent!'});})[_0x75b9('0x1d')](function(_0x437d22){return handleError(_0x3df744,0x1f4,_0x437d22);});};exports[_0x75b9('0x4a')]=function(_0x240711,_0x208629){return db['User'][_0x75b9('0x1f')]({'where':{'resetPasswordToken':_0x240711[_0x75b9('0x4b')]['token'],'resetPasswordExpires':{'$gt':Date[_0x75b9('0x3f')]()}}})[_0x75b9('0x15')](function(_0x236dab){if(!_0x236dab){throw new Error(_0x75b9('0x4c'));}return db[_0x75b9('0x9')]['findOne']({'attributes':['id',_0x75b9('0x4d'),_0x75b9('0x4e'),_0x75b9('0x4f')]})[_0x75b9('0x15')](function(_0x55cc5e){if(_0x55cc5e[_0x75b9('0x4d')])authService[_0x75b9('0x50')](_0x240711[_0x75b9('0x37')][_0x75b9('0xd')]);if(!_0x55cc5e[_0x75b9('0x4e')]||!_0x236dab[_0x75b9('0x51')])return _0x236dab;authService[_0x75b9('0x52')](_0x240711[_0x75b9('0x37')][_0x75b9('0xd')],_0x236dab[_0x75b9('0x51')],_0x55cc5e['passwordHistoryLimit']);return _0x236dab;})[_0x75b9('0x15')](function(){_0x236dab[_0x75b9('0xd')]=_0x240711['body'][_0x75b9('0xd')];_0x236dab[_0x75b9('0x3e')]=null;_0x236dab[_0x75b9('0x53')]=null;return _0x236dab['save']();});})[_0x75b9('0x15')](function(){_0x208629[_0x75b9('0x49')](0xc8)[_0x75b9('0x2d')]({'message':'Password\x20reset!'});})[_0x75b9('0x1d')](function(_0x1d473b){return handleError(_0x208629,0x1f4,_0x1d473b);});};passport[_0x75b9('0x54')](_0x75b9('0x2f'),new LocalStrategy({'usernameField':_0x75b9('0x20'),'passwordField':_0x75b9('0xd')},function(_0x286f6e,_0x1884b9,_0xa7d257){return localAuthenticate(db[_0x75b9('0x3a')],_0x286f6e,_0x1884b9,_0xa7d257);}));
\ No newline at end of file
+var _0x94e1=['body','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','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/','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','allowedLoginAttempts','blockDuration','findOne','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','then','add','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','send','local-login','signToken','forgot','generate'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x94e1,0x1e1));var _0x194e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94e1[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x194e('0x0'));var passport=require(_0x194e('0x1'));var LocalStrategy=require(_0x194e('0x2'))[_0x194e('0x3')];var jayson=require(_0x194e('0x4'));var _=require(_0x194e('0x5'));var rs=require(_0x194e('0x6'));var moment=require(_0x194e('0x7'));var db=require(_0x194e('0x8'))['db'];var authService=require(_0x194e('0x9'));var utils=require('../../config/utils');var client=jayson[_0x194e('0xa')]['http']({'port':0x232b});function localAuthenticate(_0xebafa0,_0x118a27,_0x51c941,_0x3d99cd){var _0x56007b,_0x3c065a;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x194e('0xb'),_0x194e('0xc')],'raw':!![]})['then'](function(_0x1d647b){_0x56007b=_0x1d647b;return _0xebafa0[_0x194e('0xd')]({'attributes':['id',_0x194e('0xe'),_0x194e('0xf'),'salt',_0x194e('0x10'),_0x194e('0x11'),_0x194e('0x12'),_0x194e('0x13'),_0x194e('0x14')],'where':{'name':_0x118a27,'role':{'$or':[_0x194e('0x15'),_0x194e('0x16'),'agent']}}});})['then'](function(_0xcb40f4){if(!_0xcb40f4||_0xcb40f4&&_0xcb40f4[_0x194e('0xe')]!==_0x118a27){throw new Error(_0x194e('0x17'));}else{_0x3c065a=_0xcb40f4;return _0x3c065a;}})['then'](function(){_0x3c065a[_0x194e('0x18')](_0x51c941,function(_0x5adcf8,_0x2f26a1){var _0x131b15=_0x3c065a[_0x194e('0x14')]+0x1;if(_0x5adcf8){return _0x3d99cd(_0x5adcf8);}else if(!_0x2f26a1){if(_0x3c065a[_0x194e('0x11')]){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else if(_0x56007b[_0x194e('0xb')]>0x0){if(_0x3c065a[_0x194e('0x12')]){if(_0x56007b[_0x194e('0xc')]>0x0){if(moment(_0x3c065a[_0x194e('0x13')])['add'](_0x56007b['blockDuration'],_0x194e('0x19'))>moment()){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else{return utils[_0x194e('0x1a')](_0x3c065a,_0x131b15,![],null)['then'](function(){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});});}}else{return _0x3d99cd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x131b15>=_0x56007b[_0x194e('0xb')]){return utils[_0x194e('0x1a')](_0x3c065a,0x0,!![],moment())[_0x194e('0x1b')](function(){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});});}else{return utils[_0x194e('0x1a')](_0x3c065a,_0x131b15,![],null)[_0x194e('0x1b')](function(){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});});}}}else{return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}}else{if(_0x3c065a[_0x194e('0x11')]){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else if(_0x56007b[_0x194e('0xb')]>0x0){if(_0x3c065a[_0x194e('0x12')]){if(_0x56007b[_0x194e('0xc')]>0x0){if(moment(_0x3c065a[_0x194e('0x13')])[_0x194e('0x1c')](_0x56007b['blockDuration'],'minutes')>moment()){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else{return utils[_0x194e('0x1a')](_0x3c065a,0x0,![],null)[_0x194e('0x1b')](function(){return utils[_0x194e('0x1d')](_0x3c065a);})['then'](function(){return _0x3d99cd(null,_0x3c065a);});}}else{return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}}else{return utils['clearBlockUser'](_0x3c065a,0x0,![],null)[_0x194e('0x1b')](function(){return utils[_0x194e('0x1d')](_0x3c065a);})['then'](function(){return _0x3d99cd(null,_0x3c065a);})[_0x194e('0x1e')](function(_0x30fae9){return _0x3d99cd(null,![],_0x30fae9);});}}else{if(_0x3c065a[_0x194e('0x12')]){return _0x3d99cd(null,![],{'message':_0x194e('0x17')});}else{return utils[_0x194e('0x1d')](_0x3c065a)[_0x194e('0x1b')](function(){return _0x3d99cd(null,_0x3c065a);});}}}});})[_0x194e('0x1e')](function(_0x271c23){return _0x3d99cd(null,![],_0x271c23);});}function sendServiceMail(_0x250a37){return db['MailAccount'][_0x194e('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x194e('0xe'),_0x194e('0x20')],'include':[{'model':db[_0x194e('0x21')],'as':_0x194e('0x22'),'include':[{'model':db[_0x194e('0x23')],'as':'CloudProvider'}]}]})[_0x194e('0x1b')](function(_0x1871f5){if(!_0x1871f5){throw new Error(_0x194e('0x24'));}var _0x14c06c=_0x1871f5[_0x194e('0x25')]();var _0x572753={'account':_0x14c06c,'message':_['merge']({'from':util[_0x194e('0x26')](_0x194e('0x27'),_0x1871f5[_0x194e('0xe')],_0x1871f5[_0x194e('0x20')]||_0x1871f5[_0x194e('0x22')][_0x194e('0x16')])},_0x250a37)};return client[_0x194e('0x28')](_0x194e('0x29'),_0x572753);})[_0x194e('0x1b')](function(_0x1b4a09){if(_0x1b4a09['error']){throw new Error(util[_0x194e('0x26')](_0x194e('0x2a'),_0x1b4a09[_0x194e('0x2b')][_0x194e('0x2c')]||JSON['stringify'](_0x1b4a09['error'])));}return!![];});}function handleError(_0x2e10f5,_0x3a1c49,_0x3c4e79){return _0x2e10f5[_0x194e('0x2d')](_0x3a1c49||0x1f4)[_0x194e('0x2e')]({'message':_0x3c4e79?_0x3c4e79['message']||_0x3c4e79:''});}exports['login']=function(_0x4d50b3,_0x4cca9b,_0x25add5){passport[_0x194e('0x18')](_0x194e('0x2f'),function(_0x2e69d5,_0x590292,_0x25d138){var _0x1565de=_0x2e69d5||_0x25d138;if(_0x1565de){return handleError(_0x4cca9b,0x191,_0x1565de);}if(!_0x590292){return handleError(_0x4cca9b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x117a1b={'payload':{'id':_0x590292['id'],'role':_0x590292[_0x194e('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x194e('0x30')](_0x117a1b)[_0x194e('0x1b')](function(_0xc3c53e){_0x4cca9b['json']({'id':_0x590292['id'],'token':_0xc3c53e,'statusCall':'','isAlreadyLogged':_0x590292['online']});});}})(_0x4d50b3,_0x4cca9b,_0x25add5);};exports[_0x194e('0x31')]=function(_0x30c2a9,_0x2c54b5){if(!_0x30c2a9['body'][_0x194e('0x20')]){return handleError(_0x2c54b5,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1abdf9=rs[_0x194e('0x32')]();_0x30c2a9['body'][_0x194e('0x20')]=_0x30c2a9[_0x194e('0x33')][_0x194e('0x20')]['trim']()[_0x194e('0x34')]();var _0x3f2e26;return db[_0x194e('0x35')][_0x194e('0xd')]({'where':{'id':0x1},'attributes':[_0x194e('0xb'),_0x194e('0xc')],'raw':!![]})[_0x194e('0x1b')](function(_0x5ad9ba){_0x3f2e26=_0x5ad9ba;return db[_0x194e('0x36')][_0x194e('0x1f')]({'where':{'email':_0x30c2a9[_0x194e('0x33')][_0x194e('0x20')]}});})[_0x194e('0x1b')](function(_0x33b01b){if(!_0x33b01b){throw new Error(_0x194e('0x37'));}if(_0x33b01b[_0x194e('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x33b01b['blocked']){if(moment(_0x33b01b[_0x194e('0x13')])['add'](_0x3f2e26['blockDuration'],_0x194e('0x19'))>moment()){throw new Error(_0x194e('0x38'));}else{_0x33b01b[_0x194e('0x12')]=![];_0x33b01b['blockedAt']=null;}}_0x33b01b['resetPasswordToken']=_0x1abdf9;_0x33b01b[_0x194e('0x39')]=Date[_0x194e('0x3a')]()+0x36ee80;return _0x33b01b[_0x194e('0x3b')]();})[_0x194e('0x1b')](function(){return sendServiceMail({'to':_0x30c2a9[_0x194e('0x33')][_0x194e('0x20')],'subject':_0x194e('0x3c'),'text':_0x194e('0x3d')+_0x194e('0x3e')+_0x194e('0x3f')+_0x30c2a9['headers']['host']+_0x194e('0x40')+_0x1abdf9+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x194e('0x1b')](function(){_0x2c54b5['status'](0xc8)[_0x194e('0x2e')]({'message':_0x194e('0x41')});})['catch'](function(_0x474dd1){return handleError(_0x2c54b5,0x1f4,_0x474dd1);});};exports['reset']=function(_0x12e97b,_0x526790){return db[_0x194e('0x36')]['find']({'where':{'resetPasswordToken':_0x12e97b[_0x194e('0x42')][_0x194e('0x43')],'resetPasswordExpires':{'$gt':Date[_0x194e('0x3a')]()}}})[_0x194e('0x1b')](function(_0x1aad56){if(!_0x1aad56){throw new Error(_0x194e('0x44'));}return db[_0x194e('0x35')][_0x194e('0xd')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x194e('0x45')]})[_0x194e('0x1b')](function(_0x190443){if(_0x190443[_0x194e('0x46')])authService[_0x194e('0x47')](_0x12e97b[_0x194e('0x33')][_0x194e('0xf')]);if(!_0x190443[_0x194e('0x48')]||!_0x1aad56[_0x194e('0x49')])return _0x1aad56;authService['validatePasswordHistory'](_0x12e97b[_0x194e('0x33')][_0x194e('0xf')],_0x1aad56[_0x194e('0x49')],_0x190443[_0x194e('0x45')]);return _0x1aad56;})['then'](function(){_0x1aad56[_0x194e('0xf')]=_0x12e97b[_0x194e('0x33')][_0x194e('0xf')];_0x1aad56['resetPasswordToken']=null;_0x1aad56['resetPasswordExpires']=null;return _0x1aad56[_0x194e('0x3b')]();});})['then'](function(){_0x526790[_0x194e('0x2d')](0xc8)[_0x194e('0x2e')]({'message':_0x194e('0x4a')});})[_0x194e('0x1e')](function(_0x369310){return handleError(_0x526790,0x1f4,_0x369310);});};passport[_0x194e('0x4b')](_0x194e('0x2f'),new LocalStrategy({'usernameField':_0x194e('0xe'),'passwordField':_0x194e('0xf')},function(_0x57b09c,_0x7c3dd0,_0x1ae8a0){return localAuthenticate(db['User'],_0x57b09c,_0x7c3dd0,_0x1ae8a0);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a999974..93efb4b 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 _0x171e=['post','login','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller'];(function(_0xd8e9f5,_0x29df60){var _0x4b915e=function(_0xb395cb){while(--_0xb395cb){_0xd8e9f5['push'](_0xd8e9f5['shift']());}};_0x4b915e(++_0x29df60);}(_0x171e,0x1c8));var _0xe171=function(_0x2cb521,_0x14f3f1){_0x2cb521=_0x2cb521-0x0;var _0x2db33e=_0x171e[_0x2cb521];return _0x2db33e;};'use strict';var express=require(_0xe171('0x0'));var router=express[_0xe171('0x1')]();var controller=require(_0xe171('0x2'));router[_0xe171('0x3')]('/',controller[_0xe171('0x4')]);router['post'](_0xe171('0x5'),controller[_0xe171('0x6')]);router[_0xe171('0x3')](_0xe171('0x7'),controller[_0xe171('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0xd335=['/reset/:token','exports','express','Router','login','post','/forgot','forgot'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xd335,0x19a));var _0x5d33=function(_0x229b9e,_0x4e863a){_0x229b9e=_0x229b9e-0x0;var _0x3ae42d=_0xd335[_0x229b9e];return _0x3ae42d;};'use strict';var express=require(_0x5d33('0x0'));var router=express[_0x5d33('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x5d33('0x2')]);router[_0x5d33('0x3')](_0x5d33('0x4'),controller[_0x5d33('0x5')]);router[_0x5d33('0x3')](_0x5d33('0x6'),controller['reset']);module[_0x5d33('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 039d5eb..34246f7 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 _0x63bd=['INTEGER','STRING','BOOLEAN'];(function(_0x48d7ca,_0x2a0874){var _0x39caf9=function(_0x2fc780){while(--_0x2fc780){_0x48d7ca['push'](_0x48d7ca['shift']());}};_0x39caf9(++_0x2a0874);}(_0x63bd,0x181));var _0xd63b=function(_0x427174,_0x4334ea){_0x427174=_0x427174-0x0;var _0x32775a=_0x63bd[_0x427174];return _0x32775a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xd63b('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd63b('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd63b('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x062a=['INTEGER','STRING'];(function(_0x3fd7ab,_0x3dd0bc){var _0x56cb4b=function(_0x2cd862){while(--_0x2cd862){_0x3fd7ab['push'](_0x3fd7ab['shift']());}};_0x56cb4b(++_0x3dd0bc);}(_0x062a,0x16b));var _0xa062=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x062a[_0x1ed116];return _0x574066;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa062('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0xa062('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa062('0x1')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 7c3d506..cdcd911 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 _0x5fdc=['attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Automation','count','includeAll','include','rows','show','params','create','body','catch','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','find','getActions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','error','stack','name','send','rawAttributes','type','key','map','query','keys','filters','model'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5fdc,0x121));var _0xc5fd=function(_0x569d33,_0x161576){_0x569d33=_0x569d33-0x0;var _0x3bab14=_0x5fdc[_0x569d33];return _0x3bab14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5fd('0x0'));var zipdir=require(_0xc5fd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5fd('0x2'));var moment=require(_0xc5fd('0x3'));var BPromise=require(_0xc5fd('0x4'));var Mustache=require(_0xc5fd('0x5'));var util=require(_0xc5fd('0x6'));var path=require(_0xc5fd('0x7'));var sox=require(_0xc5fd('0x8'));var csv=require(_0xc5fd('0x9'));var ejs=require(_0xc5fd('0xa'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xb'));var _=require('lodash');var squel=require(_0xc5fd('0xc'));var crypto=require(_0xc5fd('0xd'));var jsforce=require(_0xc5fd('0xe'));var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0x9'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require(_0xc5fd('0x12'));var authService=require(_0xc5fd('0x13'));var qs=require(_0xc5fd('0x14'));var as=require(_0xc5fd('0x15'));var hardwareService=require(_0xc5fd('0x16'));var logger=require(_0xc5fd('0x17'))('api');var utils=require(_0xc5fd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3de768,_0x248a96){_0x248a96=_0x248a96||0xcc;return function(_0x5f0b83){if(_0x5f0b83){return _0x3de768[_0xc5fd('0x1a')](_0x248a96);}return _0x3de768[_0xc5fd('0x1b')](_0x248a96)['end']();};}function respondWithResult(_0x143551,_0x18d96f){_0x18d96f=_0x18d96f||0xc8;return function(_0x319eb5){if(_0x319eb5){return _0x143551[_0xc5fd('0x1b')](_0x18d96f)[_0xc5fd('0x1c')](_0x319eb5);}};}function respondWithFilteredResult(_0x3b7f09,_0x1c5835){return function(_0x3c07c1){if(_0x3c07c1){var _0x11a104=typeof _0x1c5835[_0xc5fd('0x1d')]===_0xc5fd('0x1e')&&typeof _0x1c5835[_0xc5fd('0x1f')]===_0xc5fd('0x1e');var _0x2aeb31=_0x3c07c1['count'];var _0x3f393b=_0x11a104?0x0:_0x1c5835['offset'];var _0x1cd1f7=_0x11a104?_0x3c07c1['count']:_0x1c5835[_0xc5fd('0x1d')]+_0x1c5835[_0xc5fd('0x1f')];var _0x23f654;if(_0x1cd1f7>=_0x2aeb31){_0x1cd1f7=_0x2aeb31;_0x23f654=0xc8;}else{_0x23f654=0xce;}_0x3b7f09[_0xc5fd('0x1b')](_0x23f654);return _0x3b7f09['set']('Content-Range',_0x3f393b+'-'+_0x1cd1f7+'/'+_0x2aeb31)[_0xc5fd('0x1c')](_0x3c07c1);}return null;};}function patchUpdates(_0x1b91ee){return function(_0x577c2c){try{jsonpatch[_0xc5fd('0x20')](_0x577c2c,_0x1b91ee,!![]);}catch(_0x22de03){return BPromise[_0xc5fd('0x21')](_0x22de03);}return _0x577c2c[_0xc5fd('0x22')]();};}function saveUpdates(_0x5e08ab,_0x42acf0){return function(_0x56f29a){if(_0x56f29a){return _0x56f29a[_0xc5fd('0x23')](_0x5e08ab)['then'](function(_0x59dabb){return _0x59dabb;});}return null;};}function removeEntity(_0x44bcca,_0x6dff8){return function(_0x3f6850){if(_0x3f6850){return _0x3f6850[_0xc5fd('0x24')]()[_0xc5fd('0x25')](function(){_0x44bcca[_0xc5fd('0x1b')](0xcc)[_0xc5fd('0x26')]();});}};}function handleEntityNotFound(_0x3bb30e,_0x1e1ca){return function(_0x332816){if(!_0x332816){_0x3bb30e[_0xc5fd('0x1a')](0x194);}return _0x332816;};}function handleError(_0x2c59b3,_0x206a37){_0x206a37=_0x206a37||0x1f4;return function(_0x506525){logger[_0xc5fd('0x27')](_0x506525[_0xc5fd('0x28')]);if(_0x506525[_0xc5fd('0x29')]){delete _0x506525[_0xc5fd('0x29')];}_0x2c59b3['status'](_0x206a37)[_0xc5fd('0x2a')](_0x506525);};}exports['index']=function(_0x1bfc86,_0x3e9c13){var _0x3018a8={},_0x211ffe={},_0x2cc442={'count':0x0,'rows':[]};var _0x13e84d=_['map'](db['Automation'][_0xc5fd('0x2b')],function(_0x235397){return{'name':_0x235397['fieldName'],'type':_0x235397[_0xc5fd('0x2c')][_0xc5fd('0x2d')]};});_0x211ffe['model']=_[_0xc5fd('0x2e')](_0x13e84d,_0xc5fd('0x29'));_0x211ffe[_0xc5fd('0x2f')]=_[_0xc5fd('0x30')](_0x1bfc86[_0xc5fd('0x2f')]);_0x211ffe[_0xc5fd('0x31')]=_['intersection'](_0x211ffe[_0xc5fd('0x32')],_0x211ffe[_0xc5fd('0x2f')]);_0x3018a8[_0xc5fd('0x33')]=_[_0xc5fd('0x34')](_0x211ffe[_0xc5fd('0x32')],qs[_0xc5fd('0x35')](_0x1bfc86[_0xc5fd('0x2f')][_0xc5fd('0x35')]));_0x3018a8[_0xc5fd('0x33')]=_0x3018a8[_0xc5fd('0x33')][_0xc5fd('0x36')]?_0x3018a8[_0xc5fd('0x33')]:_0x211ffe[_0xc5fd('0x32')];if(!_0x1bfc86[_0xc5fd('0x2f')][_0xc5fd('0x37')]('nolimit')){_0x3018a8[_0xc5fd('0x1f')]=qs[_0xc5fd('0x1f')](_0x1bfc86['query'][_0xc5fd('0x1f')]);_0x3018a8['offset']=qs[_0xc5fd('0x1d')](_0x1bfc86[_0xc5fd('0x2f')][_0xc5fd('0x1d')]);}_0x3018a8[_0xc5fd('0x38')]=qs['sort'](_0x1bfc86['query'][_0xc5fd('0x39')]);_0x3018a8[_0xc5fd('0x3a')]=qs[_0xc5fd('0x31')](_[_0xc5fd('0x3b')](_0x1bfc86[_0xc5fd('0x2f')],_0x211ffe['filters']),_0x13e84d);if(_0x1bfc86[_0xc5fd('0x2f')][_0xc5fd('0x3c')]){_0x3018a8[_0xc5fd('0x3a')]=_[_0xc5fd('0x3d')](_0x3018a8[_0xc5fd('0x3a')],{'$or':_[_0xc5fd('0x2e')](_0x13e84d,function(_0x5a27ad){if(_0x5a27ad[_0xc5fd('0x2c')]!==_0xc5fd('0x3e')){var _0x28deee={};_0x28deee[_0x5a27ad[_0xc5fd('0x29')]]={'$like':'%'+_0x1bfc86['query'][_0xc5fd('0x3c')]+'%'};return _0x28deee;}})});}_0x3018a8=_[_0xc5fd('0x3d')]({},_0x3018a8,_0x1bfc86[_0xc5fd('0x3f')]);var _0x57b07a={'where':_0x3018a8[_0xc5fd('0x3a')]};return db[_0xc5fd('0x40')][_0xc5fd('0x41')](_0x57b07a)[_0xc5fd('0x25')](function(_0x581640){_0x2cc442[_0xc5fd('0x41')]=_0x581640;if(_0x1bfc86[_0xc5fd('0x2f')][_0xc5fd('0x42')]){_0x3018a8[_0xc5fd('0x43')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x3018a8);})[_0xc5fd('0x25')](function(_0x5e0291){_0x2cc442[_0xc5fd('0x44')]=_0x5e0291;return _0x2cc442;})[_0xc5fd('0x25')](respondWithFilteredResult(_0x3e9c13,_0x3018a8))['catch'](handleError(_0x3e9c13,null));};exports[_0xc5fd('0x45')]=function(_0xbc999c,_0x4f8868){var _0xefe27a={'raw':![],'where':{'id':_0xbc999c[_0xc5fd('0x46')]['id']}},_0x5e5423={};_0x5e5423[_0xc5fd('0x32')]=_[_0xc5fd('0x30')](db[_0xc5fd('0x40')][_0xc5fd('0x2b')]);_0x5e5423[_0xc5fd('0x2f')]=_[_0xc5fd('0x30')](_0xbc999c[_0xc5fd('0x2f')]);_0x5e5423['filters']=_['intersection'](_0x5e5423['model'],_0x5e5423[_0xc5fd('0x2f')]);_0xefe27a[_0xc5fd('0x33')]=_[_0xc5fd('0x34')](_0x5e5423[_0xc5fd('0x32')],qs[_0xc5fd('0x35')](_0xbc999c[_0xc5fd('0x2f')][_0xc5fd('0x35')]));_0xefe27a[_0xc5fd('0x33')]=_0xefe27a[_0xc5fd('0x33')][_0xc5fd('0x36')]?_0xefe27a[_0xc5fd('0x33')]:_0x5e5423[_0xc5fd('0x32')];if(_0xbc999c[_0xc5fd('0x2f')][_0xc5fd('0x42')]){_0xefe27a[_0xc5fd('0x43')]=[{'all':!![]}];}_0xefe27a=_[_0xc5fd('0x3d')]({},_0xefe27a,_0xbc999c[_0xc5fd('0x3f')]);return db[_0xc5fd('0x40')]['find'](_0xefe27a)['then'](handleEntityNotFound(_0x4f8868,null))['then'](respondWithResult(_0x4f8868,null))['catch'](handleError(_0x4f8868,null));};exports[_0xc5fd('0x47')]=function(_0x22230b,_0x288a89){return db[_0xc5fd('0x40')][_0xc5fd('0x47')](_0x22230b[_0xc5fd('0x48')],{})[_0xc5fd('0x25')](respondWithResult(_0x288a89,0xc9))[_0xc5fd('0x49')](handleError(_0x288a89,null));};exports[_0xc5fd('0x23')]=function(_0x3c47e4,_0x2ac430){if(_0x3c47e4[_0xc5fd('0x48')]['id']){delete _0x3c47e4[_0xc5fd('0x48')]['id'];}return db['Automation']['find']({'where':{'id':_0x3c47e4[_0xc5fd('0x46')]['id']}})[_0xc5fd('0x25')](handleEntityNotFound(_0x2ac430,null))[_0xc5fd('0x25')](saveUpdates(_0x3c47e4[_0xc5fd('0x48')],null))[_0xc5fd('0x25')](respondWithResult(_0x2ac430,null))[_0xc5fd('0x49')](handleError(_0x2ac430,null));};exports[_0xc5fd('0x24')]=function(_0x28df45,_0xf640f5){return db['Automation']['find']({'where':{'id':_0x28df45[_0xc5fd('0x46')]['id']}})['then'](handleEntityNotFound(_0xf640f5,null))[_0xc5fd('0x25')](removeEntity(_0xf640f5,null))[_0xc5fd('0x49')](handleError(_0xf640f5,null));};exports[_0xc5fd('0x4a')]=function(_0xc2237e,_0x263501,_0x58774b){return db[_0xc5fd('0x4b')]['find']({'where':{'id':_0xc2237e[_0xc5fd('0x46')]['id']}})['then'](handleEntityNotFound(_0x263501,null))[_0xc5fd('0x25')](function(_0x292f5b){if(_0x292f5b){return _0x292f5b[_0xc5fd('0x4a')](_0xc2237e[_0xc5fd('0x48')][_0xc5fd('0x4c')],_[_0xc5fd('0x4d')](_0xc2237e[_0xc5fd('0x48')],[_0xc5fd('0x4c'),'id'])||{});}})[_0xc5fd('0x25')](respondWithResult(_0x263501,null))[_0xc5fd('0x49')](handleError(_0x263501,null));};exports[_0xc5fd('0x4e')]=function(_0x12a059,_0x459aa5,_0x112f39){var _0x14bcb7={};var _0x575bdb={};var _0x1615e0;var _0x7b6883;return db[_0xc5fd('0x40')][_0xc5fd('0x4f')]({'where':{'id':_0x12a059[_0xc5fd('0x46')]['id']}})[_0xc5fd('0x25')](handleEntityNotFound(_0x459aa5,null))[_0xc5fd('0x25')](function(_0x212e2f){if(_0x212e2f){_0x1615e0=_0x212e2f;_0x575bdb['model']=_[_0xc5fd('0x30')](db[_0xc5fd('0x4b')][_0xc5fd('0x2b')]);_0x575bdb[_0xc5fd('0x2f')]=_[_0xc5fd('0x30')](_0x12a059['query']);_0x575bdb[_0xc5fd('0x31')]=_[_0xc5fd('0x34')](_0x575bdb[_0xc5fd('0x32')],_0x575bdb[_0xc5fd('0x2f')]);_0x14bcb7[_0xc5fd('0x33')]=_['intersection'](_0x575bdb[_0xc5fd('0x32')],qs[_0xc5fd('0x35')](_0x12a059[_0xc5fd('0x2f')][_0xc5fd('0x35')]));_0x14bcb7[_0xc5fd('0x33')]=_0x14bcb7[_0xc5fd('0x33')][_0xc5fd('0x36')]?_0x14bcb7[_0xc5fd('0x33')]:_0x575bdb[_0xc5fd('0x32')];_0x14bcb7['order']=qs['sort'](_0x12a059[_0xc5fd('0x2f')][_0xc5fd('0x39')]);_0x14bcb7[_0xc5fd('0x3a')]=qs[_0xc5fd('0x31')](_[_0xc5fd('0x3b')](_0x12a059[_0xc5fd('0x2f')],_0x575bdb[_0xc5fd('0x31')]));if(_0x12a059[_0xc5fd('0x2f')][_0xc5fd('0x3c')]){_0x14bcb7[_0xc5fd('0x3a')]=_['merge'](_0x14bcb7['where'],{'$or':_[_0xc5fd('0x2e')](_0x14bcb7[_0xc5fd('0x33')],function(_0x4e8413){var _0x1a9840={};_0x1a9840[_0x4e8413]={'$like':'%'+_0x12a059[_0xc5fd('0x2f')][_0xc5fd('0x3c')]+'%'};return _0x1a9840;})});}_0x14bcb7=_[_0xc5fd('0x3d')]({},_0x14bcb7,_0x12a059[_0xc5fd('0x3f')]);return _0x1615e0[_0xc5fd('0x4e')](_0x14bcb7);}})[_0xc5fd('0x25')](function(_0x416314){if(_0x416314){_0x7b6883=_0x416314['length'];if(!_0x12a059[_0xc5fd('0x2f')][_0xc5fd('0x37')](_0xc5fd('0x50'))){_0x14bcb7[_0xc5fd('0x1f')]=qs[_0xc5fd('0x1f')](_0x12a059[_0xc5fd('0x2f')]['limit']);_0x14bcb7['offset']=qs[_0xc5fd('0x1d')](_0x12a059['query'][_0xc5fd('0x1d')]);}return _0x1615e0[_0xc5fd('0x4e')](_0x14bcb7);}})[_0xc5fd('0x25')](function(_0xcf0fd1){if(_0xcf0fd1){return _0xcf0fd1?{'count':_0x7b6883,'rows':_0xcf0fd1}:null;}})[_0xc5fd('0x25')](respondWithResult(_0x459aa5,null))['catch'](handleError(_0x459aa5,null));};exports[_0xc5fd('0x51')]=function(_0xa9cc4c,_0x2e8255,_0x1b1860){return db[_0xc5fd('0x52')][_0xc5fd('0x53')]({'where':{'id':_0xa9cc4c[_0xc5fd('0x46')]['id']}})[_0xc5fd('0x25')](handleEntityNotFound(_0x2e8255,null))[_0xc5fd('0x25')](function(_0x2dcb8c){if(_0x2dcb8c){return _0x2dcb8c[_0xc5fd('0x51')](_0xa9cc4c[_0xc5fd('0x48')][_0xc5fd('0x4c')],_['omit'](_0xa9cc4c['body'],[_0xc5fd('0x4c'),'id'])||{});}})[_0xc5fd('0x25')](respondWithResult(_0x2e8255,null))[_0xc5fd('0x49')](handleError(_0x2e8255,null));};exports[_0xc5fd('0x54')]=function(_0x5f53b0,_0x38c403,_0x2c0511){var _0x1d01ab={};var _0x14c54a={};var _0x47f930;var _0x1cd17b;return db['Automation'][_0xc5fd('0x4f')]({'where':{'id':_0x5f53b0[_0xc5fd('0x46')]['id']}})[_0xc5fd('0x25')](handleEntityNotFound(_0x38c403,null))[_0xc5fd('0x25')](function(_0x19758a){if(_0x19758a){_0x47f930=_0x19758a;_0x14c54a[_0xc5fd('0x32')]=_[_0xc5fd('0x30')](db['Action'][_0xc5fd('0x2b')]);_0x14c54a['query']=_[_0xc5fd('0x30')](_0x5f53b0[_0xc5fd('0x2f')]);_0x14c54a['filters']=_['intersection'](_0x14c54a[_0xc5fd('0x32')],_0x14c54a[_0xc5fd('0x2f')]);_0x1d01ab[_0xc5fd('0x33')]=_[_0xc5fd('0x34')](_0x14c54a['model'],qs[_0xc5fd('0x35')](_0x5f53b0[_0xc5fd('0x2f')][_0xc5fd('0x35')]));_0x1d01ab['attributes']=_0x1d01ab[_0xc5fd('0x33')][_0xc5fd('0x36')]?_0x1d01ab[_0xc5fd('0x33')]:_0x14c54a['model'];_0x1d01ab[_0xc5fd('0x38')]=qs[_0xc5fd('0x39')](_0x5f53b0['query'][_0xc5fd('0x39')]);_0x1d01ab[_0xc5fd('0x3a')]=qs[_0xc5fd('0x31')](_[_0xc5fd('0x3b')](_0x5f53b0[_0xc5fd('0x2f')],_0x14c54a[_0xc5fd('0x31')]));if(_0x5f53b0[_0xc5fd('0x2f')][_0xc5fd('0x3c')]){_0x1d01ab['where']=_[_0xc5fd('0x3d')](_0x1d01ab[_0xc5fd('0x3a')],{'$or':_['map'](_0x1d01ab['attributes'],function(_0x5abc76){var _0x56cd85={};_0x56cd85[_0x5abc76]={'$like':'%'+_0x5f53b0[_0xc5fd('0x2f')][_0xc5fd('0x3c')]+'%'};return _0x56cd85;})});}_0x1d01ab=_['merge']({},_0x1d01ab,_0x5f53b0[_0xc5fd('0x3f')]);return _0x47f930[_0xc5fd('0x54')](_0x1d01ab);}})[_0xc5fd('0x25')](function(_0xed0b2f){if(_0xed0b2f){_0x1cd17b=_0xed0b2f[_0xc5fd('0x36')];if(!_0x5f53b0[_0xc5fd('0x2f')][_0xc5fd('0x37')](_0xc5fd('0x50'))){_0x1d01ab['limit']=qs[_0xc5fd('0x1f')](_0x5f53b0[_0xc5fd('0x2f')][_0xc5fd('0x1f')]);_0x1d01ab[_0xc5fd('0x1d')]=qs[_0xc5fd('0x1d')](_0x5f53b0['query'][_0xc5fd('0x1d')]);}return _0x47f930[_0xc5fd('0x54')](_0x1d01ab);}})[_0xc5fd('0x25')](function(_0x3565a4){if(_0x3565a4){return _0x3565a4?{'count':_0x1cd17b,'rows':_0x3565a4}:null;}})[_0xc5fd('0x25')](respondWithResult(_0x38c403,null))[_0xc5fd('0x49')](handleError(_0x38c403,null));};
\ No newline at end of file
+var _0xe545=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','keys','intersection','query','attributes','fields','model','nolimit','order','sort','where','pick','filters','merge','options','count','includeAll','include','findAll','catch','params','length','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','filter','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe545,0x17f));var _0x5e54=function(_0x3e3ba7,_0x531288){_0x3e3ba7=_0x3e3ba7-0x0;var _0x2f6d9d=_0xe545[_0x3e3ba7];return _0x2f6d9d;};'use strict';var emlformat=require(_0x5e54('0x0'));var rimraf=require(_0x5e54('0x1'));var zipdir=require(_0x5e54('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e54('0x3'));var moment=require(_0x5e54('0x4'));var BPromise=require(_0x5e54('0x5'));var Mustache=require(_0x5e54('0x6'));var util=require(_0x5e54('0x7'));var path=require('path');var sox=require(_0x5e54('0x8'));var csv=require('to-csv');var ejs=require(_0x5e54('0x9'));var fs=require('fs');var fs_extra=require(_0x5e54('0xa'));var _=require('lodash');var squel=require(_0x5e54('0xb'));var crypto=require(_0x5e54('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5e54('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5e54('0xe'));var Papa=require(_0x5e54('0xf'));var Redis=require(_0x5e54('0x10'));var authService=require(_0x5e54('0x11'));var qs=require(_0x5e54('0x12'));var as=require(_0x5e54('0x13'));var hardwareService=require(_0x5e54('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e54('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dc37a,_0x1acb17){_0x1acb17=_0x1acb17||0xcc;return function(_0x3dee05){if(_0x3dee05){return _0x1dc37a[_0x5e54('0x16')](_0x1acb17);}return _0x1dc37a[_0x5e54('0x17')](_0x1acb17)[_0x5e54('0x18')]();};}function respondWithResult(_0x1053e1,_0x4cba04){_0x4cba04=_0x4cba04||0xc8;return function(_0x1bfaa5){if(_0x1bfaa5){return _0x1053e1[_0x5e54('0x17')](_0x4cba04)['json'](_0x1bfaa5);}};}function respondWithFilteredResult(_0x2c1a3b,_0x31dc8c){return function(_0x538336){if(_0x538336){var _0x29ee90=typeof _0x31dc8c[_0x5e54('0x19')]===_0x5e54('0x1a')&&typeof _0x31dc8c['limit']==='undefined';var _0x1af620=_0x538336['count'];var _0x35d1b5=_0x29ee90?0x0:_0x31dc8c[_0x5e54('0x19')];var _0x4b5625=_0x29ee90?_0x538336['count']:_0x31dc8c[_0x5e54('0x19')]+_0x31dc8c[_0x5e54('0x1b')];var _0x4fa4f3;if(_0x4b5625>=_0x1af620){_0x4b5625=_0x1af620;_0x4fa4f3=0xc8;}else{_0x4fa4f3=0xce;}_0x2c1a3b['status'](_0x4fa4f3);return _0x2c1a3b['set'](_0x5e54('0x1c'),_0x35d1b5+'-'+_0x4b5625+'/'+_0x1af620)[_0x5e54('0x1d')](_0x538336);}return null;};}function patchUpdates(_0x1b7d06){return function(_0x438fdf){try{jsonpatch[_0x5e54('0x1e')](_0x438fdf,_0x1b7d06,!![]);}catch(_0x5a6967){return BPromise[_0x5e54('0x1f')](_0x5a6967);}return _0x438fdf['save']();};}function saveUpdates(_0x506afe,_0x4f0b65){return function(_0x3b0772){if(_0x3b0772){return _0x3b0772[_0x5e54('0x20')](_0x506afe)[_0x5e54('0x21')](function(_0x3f9c62){return _0x3f9c62;});}return null;};}function removeEntity(_0x4e1ed7,_0x353570){return function(_0x444c9c){if(_0x444c9c){return _0x444c9c[_0x5e54('0x22')]()[_0x5e54('0x21')](function(){_0x4e1ed7[_0x5e54('0x17')](0xcc)[_0x5e54('0x18')]();});}};}function handleEntityNotFound(_0x441f25,_0x10a9f6){return function(_0x15c738){if(!_0x15c738){_0x441f25[_0x5e54('0x16')](0x194);}return _0x15c738;};}function handleError(_0x555716,_0x27b073){_0x27b073=_0x27b073||0x1f4;return function(_0x46a02f){logger[_0x5e54('0x23')](_0x46a02f[_0x5e54('0x24')]);if(_0x46a02f['name']){delete _0x46a02f[_0x5e54('0x25')];}_0x555716['status'](_0x27b073)[_0x5e54('0x26')](_0x46a02f);};}exports[_0x5e54('0x27')]=function(_0x284ed8,_0x4ee581){var _0x1ab497={},_0x2bb8e2={},_0x5b303d={'count':0x0,'rows':[]};var _0x2d28c0=_[_0x5e54('0x28')](db[_0x5e54('0x29')][_0x5e54('0x2a')],function(_0x17bb90){return{'name':_0x17bb90[_0x5e54('0x2b')],'type':_0x17bb90[_0x5e54('0x2c')]['key']};});_0x2bb8e2['model']=_['map'](_0x2d28c0,_0x5e54('0x25'));_0x2bb8e2['query']=_[_0x5e54('0x2d')](_0x284ed8['query']);_0x2bb8e2['filters']=_[_0x5e54('0x2e')](_0x2bb8e2['model'],_0x2bb8e2[_0x5e54('0x2f')]);_0x1ab497[_0x5e54('0x30')]=_['intersection'](_0x2bb8e2['model'],qs[_0x5e54('0x31')](_0x284ed8['query'][_0x5e54('0x31')]));_0x1ab497[_0x5e54('0x30')]=_0x1ab497[_0x5e54('0x30')]['length']?_0x1ab497[_0x5e54('0x30')]:_0x2bb8e2[_0x5e54('0x32')];if(!_0x284ed8[_0x5e54('0x2f')]['hasOwnProperty'](_0x5e54('0x33'))){_0x1ab497[_0x5e54('0x1b')]=qs[_0x5e54('0x1b')](_0x284ed8['query']['limit']);_0x1ab497[_0x5e54('0x19')]=qs[_0x5e54('0x19')](_0x284ed8[_0x5e54('0x2f')][_0x5e54('0x19')]);}_0x1ab497[_0x5e54('0x34')]=qs['sort'](_0x284ed8['query'][_0x5e54('0x35')]);_0x1ab497[_0x5e54('0x36')]=qs['filters'](_[_0x5e54('0x37')](_0x284ed8[_0x5e54('0x2f')],_0x2bb8e2[_0x5e54('0x38')]),_0x2d28c0);if(_0x284ed8['query']['filter']){_0x1ab497[_0x5e54('0x36')]=_[_0x5e54('0x39')](_0x1ab497[_0x5e54('0x36')],{'$or':_[_0x5e54('0x28')](_0x2d28c0,function(_0x5e49d8){if(_0x5e49d8['type']!=='VIRTUAL'){var _0x2e9752={};_0x2e9752[_0x5e49d8[_0x5e54('0x25')]]={'$like':'%'+_0x284ed8[_0x5e54('0x2f')]['filter']+'%'};return _0x2e9752;}})});}_0x1ab497=_['merge']({},_0x1ab497,_0x284ed8[_0x5e54('0x3a')]);var _0x1173cd={'where':_0x1ab497['where']};return db[_0x5e54('0x29')][_0x5e54('0x3b')](_0x1173cd)[_0x5e54('0x21')](function(_0x218c11){_0x5b303d[_0x5e54('0x3b')]=_0x218c11;if(_0x284ed8[_0x5e54('0x2f')][_0x5e54('0x3c')]){_0x1ab497[_0x5e54('0x3d')]=[{'all':!![]}];}return db[_0x5e54('0x29')][_0x5e54('0x3e')](_0x1ab497);})[_0x5e54('0x21')](function(_0x523487){_0x5b303d['rows']=_0x523487;return _0x5b303d;})[_0x5e54('0x21')](respondWithFilteredResult(_0x4ee581,_0x1ab497))[_0x5e54('0x3f')](handleError(_0x4ee581,null));};exports['show']=function(_0x55aa73,_0x3a89fc){var _0x22f4a5={'raw':![],'where':{'id':_0x55aa73[_0x5e54('0x40')]['id']}},_0x7a288b={};_0x7a288b[_0x5e54('0x32')]=_[_0x5e54('0x2d')](db[_0x5e54('0x29')][_0x5e54('0x2a')]);_0x7a288b[_0x5e54('0x2f')]=_[_0x5e54('0x2d')](_0x55aa73[_0x5e54('0x2f')]);_0x7a288b[_0x5e54('0x38')]=_[_0x5e54('0x2e')](_0x7a288b[_0x5e54('0x32')],_0x7a288b[_0x5e54('0x2f')]);_0x22f4a5[_0x5e54('0x30')]=_[_0x5e54('0x2e')](_0x7a288b[_0x5e54('0x32')],qs[_0x5e54('0x31')](_0x55aa73[_0x5e54('0x2f')]['fields']));_0x22f4a5[_0x5e54('0x30')]=_0x22f4a5[_0x5e54('0x30')][_0x5e54('0x41')]?_0x22f4a5['attributes']:_0x7a288b['model'];if(_0x55aa73[_0x5e54('0x2f')][_0x5e54('0x3c')]){_0x22f4a5[_0x5e54('0x3d')]=[{'all':!![]}];}_0x22f4a5=_[_0x5e54('0x39')]({},_0x22f4a5,_0x55aa73[_0x5e54('0x3a')]);return db[_0x5e54('0x29')][_0x5e54('0x42')](_0x22f4a5)['then'](handleEntityNotFound(_0x3a89fc,null))[_0x5e54('0x21')](respondWithResult(_0x3a89fc,null))['catch'](handleError(_0x3a89fc,null));};exports[_0x5e54('0x43')]=function(_0xa70f22,_0x40412c){return db[_0x5e54('0x29')][_0x5e54('0x43')](_0xa70f22[_0x5e54('0x44')],{})['then'](respondWithResult(_0x40412c,0xc9))[_0x5e54('0x3f')](handleError(_0x40412c,null));};exports[_0x5e54('0x20')]=function(_0x4312b2,_0x54cdd1){if(_0x4312b2[_0x5e54('0x44')]['id']){delete _0x4312b2[_0x5e54('0x44')]['id'];}return db['Automation']['find']({'where':{'id':_0x4312b2['params']['id']}})[_0x5e54('0x21')](handleEntityNotFound(_0x54cdd1,null))[_0x5e54('0x21')](saveUpdates(_0x4312b2[_0x5e54('0x44')],null))[_0x5e54('0x21')](respondWithResult(_0x54cdd1,null))['catch'](handleError(_0x54cdd1,null));};exports[_0x5e54('0x22')]=function(_0x41d468,_0x558891){return db[_0x5e54('0x29')]['find']({'where':{'id':_0x41d468[_0x5e54('0x40')]['id']}})[_0x5e54('0x21')](handleEntityNotFound(_0x558891,null))['then'](removeEntity(_0x558891,null))[_0x5e54('0x3f')](handleError(_0x558891,null));};exports[_0x5e54('0x45')]=function(_0x78cbc2,_0x5cb661,_0xebdee1){return db[_0x5e54('0x46')]['find']({'where':{'id':_0x78cbc2[_0x5e54('0x40')]['id']}})[_0x5e54('0x21')](handleEntityNotFound(_0x5cb661,null))[_0x5e54('0x21')](function(_0x4633bf){if(_0x4633bf){return _0x4633bf[_0x5e54('0x45')](_0x78cbc2[_0x5e54('0x44')][_0x5e54('0x47')],_[_0x5e54('0x48')](_0x78cbc2[_0x5e54('0x44')],[_0x5e54('0x47'),'id'])||{});}})[_0x5e54('0x21')](respondWithResult(_0x5cb661,null))['catch'](handleError(_0x5cb661,null));};exports[_0x5e54('0x49')]=function(_0x327216,_0x28c193,_0x108224){var _0x12ad30={};var _0x7547b2={};var _0x29d410;var _0x154537;return db[_0x5e54('0x29')][_0x5e54('0x4a')]({'where':{'id':_0x327216[_0x5e54('0x40')]['id']}})['then'](handleEntityNotFound(_0x28c193,null))['then'](function(_0x2e0fe7){if(_0x2e0fe7){_0x29d410=_0x2e0fe7;_0x7547b2[_0x5e54('0x32')]=_[_0x5e54('0x2d')](db[_0x5e54('0x46')][_0x5e54('0x2a')]);_0x7547b2[_0x5e54('0x2f')]=_['keys'](_0x327216[_0x5e54('0x2f')]);_0x7547b2['filters']=_[_0x5e54('0x2e')](_0x7547b2['model'],_0x7547b2['query']);_0x12ad30[_0x5e54('0x30')]=_['intersection'](_0x7547b2['model'],qs[_0x5e54('0x31')](_0x327216[_0x5e54('0x2f')][_0x5e54('0x31')]));_0x12ad30[_0x5e54('0x30')]=_0x12ad30[_0x5e54('0x30')]['length']?_0x12ad30[_0x5e54('0x30')]:_0x7547b2[_0x5e54('0x32')];_0x12ad30[_0x5e54('0x34')]=qs[_0x5e54('0x35')](_0x327216[_0x5e54('0x2f')][_0x5e54('0x35')]);_0x12ad30[_0x5e54('0x36')]=qs['filters'](_[_0x5e54('0x37')](_0x327216['query'],_0x7547b2['filters']));if(_0x327216[_0x5e54('0x2f')][_0x5e54('0x4b')]){_0x12ad30[_0x5e54('0x36')]=_['merge'](_0x12ad30[_0x5e54('0x36')],{'$or':_[_0x5e54('0x28')](_0x12ad30['attributes'],function(_0x1e5192){var _0x2cefb1={};_0x2cefb1[_0x1e5192]={'$like':'%'+_0x327216[_0x5e54('0x2f')]['filter']+'%'};return _0x2cefb1;})});}_0x12ad30=_[_0x5e54('0x39')]({},_0x12ad30,_0x327216[_0x5e54('0x3a')]);return _0x29d410[_0x5e54('0x49')](_0x12ad30);}})[_0x5e54('0x21')](function(_0x1e1eee){if(_0x1e1eee){_0x154537=_0x1e1eee[_0x5e54('0x41')];if(!_0x327216[_0x5e54('0x2f')][_0x5e54('0x4c')](_0x5e54('0x33'))){_0x12ad30[_0x5e54('0x1b')]=qs['limit'](_0x327216[_0x5e54('0x2f')]['limit']);_0x12ad30[_0x5e54('0x19')]=qs[_0x5e54('0x19')](_0x327216[_0x5e54('0x2f')]['offset']);}return _0x29d410[_0x5e54('0x49')](_0x12ad30);}})[_0x5e54('0x21')](function(_0x213898){if(_0x213898){return _0x213898?{'count':_0x154537,'rows':_0x213898}:null;}})['then'](respondWithResult(_0x28c193,null))[_0x5e54('0x3f')](handleError(_0x28c193,null));};exports[_0x5e54('0x4d')]=function(_0x62770f,_0x59796c,_0x80ca22){return db[_0x5e54('0x4e')][_0x5e54('0x42')]({'where':{'id':_0x62770f[_0x5e54('0x40')]['id']}})['then'](handleEntityNotFound(_0x59796c,null))[_0x5e54('0x21')](function(_0x563c05){if(_0x563c05){return _0x563c05[_0x5e54('0x4d')](_0x62770f[_0x5e54('0x44')][_0x5e54('0x47')],_[_0x5e54('0x48')](_0x62770f['body'],[_0x5e54('0x47'),'id'])||{});}})['then'](respondWithResult(_0x59796c,null))[_0x5e54('0x3f')](handleError(_0x59796c,null));};exports[_0x5e54('0x4f')]=function(_0x5c0794,_0x48f8fc,_0x11ef9f){var _0x5170e9={};var _0x18942d={};var _0x331eab;var _0x2b4536;return db[_0x5e54('0x29')][_0x5e54('0x4a')]({'where':{'id':_0x5c0794[_0x5e54('0x40')]['id']}})[_0x5e54('0x21')](handleEntityNotFound(_0x48f8fc,null))[_0x5e54('0x21')](function(_0x2ae7a1){if(_0x2ae7a1){_0x331eab=_0x2ae7a1;_0x18942d[_0x5e54('0x32')]=_[_0x5e54('0x2d')](db['Action'][_0x5e54('0x2a')]);_0x18942d[_0x5e54('0x2f')]=_['keys'](_0x5c0794[_0x5e54('0x2f')]);_0x18942d[_0x5e54('0x38')]=_[_0x5e54('0x2e')](_0x18942d[_0x5e54('0x32')],_0x18942d[_0x5e54('0x2f')]);_0x5170e9['attributes']=_['intersection'](_0x18942d['model'],qs['fields'](_0x5c0794['query']['fields']));_0x5170e9[_0x5e54('0x30')]=_0x5170e9[_0x5e54('0x30')][_0x5e54('0x41')]?_0x5170e9[_0x5e54('0x30')]:_0x18942d[_0x5e54('0x32')];_0x5170e9[_0x5e54('0x34')]=qs[_0x5e54('0x35')](_0x5c0794[_0x5e54('0x2f')][_0x5e54('0x35')]);_0x5170e9[_0x5e54('0x36')]=qs['filters'](_['pick'](_0x5c0794[_0x5e54('0x2f')],_0x18942d[_0x5e54('0x38')]));if(_0x5c0794[_0x5e54('0x2f')][_0x5e54('0x4b')]){_0x5170e9[_0x5e54('0x36')]=_[_0x5e54('0x39')](_0x5170e9[_0x5e54('0x36')],{'$or':_[_0x5e54('0x28')](_0x5170e9['attributes'],function(_0x467847){var _0x1df71f={};_0x1df71f[_0x467847]={'$like':'%'+_0x5c0794['query'][_0x5e54('0x4b')]+'%'};return _0x1df71f;})});}_0x5170e9=_['merge']({},_0x5170e9,_0x5c0794[_0x5e54('0x3a')]);return _0x331eab[_0x5e54('0x4f')](_0x5170e9);}})[_0x5e54('0x21')](function(_0x1d8118){if(_0x1d8118){_0x2b4536=_0x1d8118['length'];if(!_0x5c0794[_0x5e54('0x2f')][_0x5e54('0x4c')](_0x5e54('0x33'))){_0x5170e9[_0x5e54('0x1b')]=qs['limit'](_0x5c0794[_0x5e54('0x2f')]['limit']);_0x5170e9[_0x5e54('0x19')]=qs[_0x5e54('0x19')](_0x5c0794[_0x5e54('0x2f')][_0x5e54('0x19')]);}return _0x331eab[_0x5e54('0x4f')](_0x5170e9);}})['then'](function(_0x2226c4){if(_0x2226c4){return _0x2226c4?{'count':_0x2b4536,'rows':_0x2226c4}:null;}})['then'](respondWithResult(_0x48f8fc,null))[_0x5e54('0x3f')](handleError(_0x48f8fc,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 9d729c9..4ba50cd 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 _0xcb45=['bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb45,0x11c));var _0x5cb4=function(_0x431876,_0x5c896a){_0x431876=_0x431876-0x0;var _0x157c61=_0xcb45[_0x431876];return _0x157c61;};'use strict';var _=require(_0x5cb4('0x0'));var util=require(_0x5cb4('0x1'));var logger=require('../../config/logger')(_0x5cb4('0x2'));var moment=require(_0x5cb4('0x3'));var BPromise=require(_0x5cb4('0x4'));var rp=require(_0x5cb4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5cb4('0x6'));var config=require(_0x5cb4('0x7'));var attributes=require(_0x5cb4('0x8'));module['exports']=function(_0x39041b,_0x7d0e18){return _0x39041b[_0x5cb4('0x9')](_0x5cb4('0xa'),attributes,{'tableName':_0x5cb4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ea7=['lodash','../../config/logger','request-promise','path','../../config/environment','./automation.attributes','define'];(function(_0x288a14,_0x5300db){var _0x1e15f2=function(_0x30fb34){while(--_0x30fb34){_0x288a14['push'](_0x288a14['shift']());}};_0x1e15f2(++_0x5300db);}(_0x9ea7,0x165));var _0x79ea=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x9ea7[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0x79ea('0x0'));var util=require('util');var logger=require(_0x79ea('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79ea('0x2'));var fs=require('fs');var path=require(_0x79ea('0x3'));var rimraf=require('rimraf');var config=require(_0x79ea('0x4'));var attributes=require(_0x79ea('0x5'));module['exports']=function(_0x32938b,_0x5cd579){return _0x32938b[_0x79ea('0x6')]('Automation',attributes,{'tableName':'tools_automations','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 1d44177..1abe74d 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 _0x6bab=['../../config/logger','rpc','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x6bab[_0x16337a];return _0x422365;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var moment=require(_0xb6ba('0x2'));var BPromise=require(_0xb6ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ba('0x4'));var db=require(_0xb6ba('0x5'))['db'];var utils=require(_0xb6ba('0x6'));var logger=require(_0xb6ba('0x7'))(_0xb6ba('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6ba('0x9'));var client=jayson['client'][_0xb6ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x389a0d,_0x3fd283,_0xbce6f){return new BPromise(function(_0xa0b5c7,_0x469e81){return client[_0xb6ba('0xb')](_0x389a0d,_0xbce6f)[_0xb6ba('0xc')](function(_0x36bdc2){logger['info'](_0xb6ba('0xd'),_0x3fd283,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3fd283,_0xb6ba('0xe'),JSON[_0xb6ba('0xf')](_0x36bdc2));if(_0x36bdc2[_0xb6ba('0x10')]){if(_0x36bdc2['error'][_0xb6ba('0x11')]===0x1f4){logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0x469e81(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0xa0b5c7(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}else{logger[_0xb6ba('0x13')](_0xb6ba('0xd'),_0x3fd283,_0xb6ba('0xe'));_0xa0b5c7(_0x36bdc2[_0xb6ba('0x14')][_0xb6ba('0x12')]);}})[_0xb6ba('0x15')](function(_0x5313d4){logger[_0xb6ba('0x10')]('Automation,\x20%s,\x20%s',_0x3fd283,_0x5313d4);_0x469e81(_0x5313d4);});});}
\ No newline at end of file
+var _0x1410=['jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1410,0x130));var _0x0141=function(_0x39153c,_0x293109){_0x39153c=_0x39153c-0x0;var _0x246bac=_0x1410[_0x39153c];return _0x246bac;};'use strict';var _=require(_0x0141('0x0'));var util=require(_0x0141('0x1'));var moment=require(_0x0141('0x2'));var BPromise=require(_0x0141('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0141('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0141('0x5'));var logger=require('../../config/logger')(_0x0141('0x6'));var config=require(_0x0141('0x7'));var jayson=require(_0x0141('0x8'));var client=jayson[_0x0141('0x9')][_0x0141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24f701,_0x22b566,_0x25511f){return new BPromise(function(_0x2d8f15,_0x57cfbb){return client[_0x0141('0xb')](_0x24f701,_0x25511f)[_0x0141('0xc')](function(_0x2b4f13){logger[_0x0141('0xd')](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));logger[_0x0141('0x10')](_0x0141('0x11'),_0x22b566,'request\x20sent',JSON[_0x0141('0x12')](_0x2b4f13));if(_0x2b4f13[_0x0141('0x13')]){if(_0x2b4f13[_0x0141('0x13')][_0x0141('0x14')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x57cfbb(_0x2b4f13['error'][_0x0141('0x15')]);}logger[_0x0141('0x13')](_0x0141('0xe'),_0x22b566,_0x2b4f13[_0x0141('0x13')][_0x0141('0x15')]);return _0x2d8f15(_0x2b4f13['error'][_0x0141('0x15')]);}else{logger['info'](_0x0141('0xe'),_0x22b566,_0x0141('0xf'));_0x2d8f15(_0x2b4f13[_0x0141('0x16')][_0x0141('0x15')]);}})[_0x0141('0x17')](function(_0x3c91e8){logger['error']('Automation,\x20%s,\x20%s',_0x22b566,_0x3c91e8);_0x57cfbb(_0x3c91e8);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index c38187a..5ee12f0 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 _0xe57e=['update','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','/:id/actions','getActions','post','create','addConditions','addActions'];(function(_0x53a6e4,_0x1e2424){var _0x40896a=function(_0x5fc1aa){while(--_0x5fc1aa){_0x53a6e4['push'](_0x53a6e4['shift']());}};_0x40896a(++_0x1e2424);}(_0xe57e,0xf2));var _0xee57=function(_0x2f4205,_0x1993b1){_0x2f4205=_0x2f4205-0x0;var _0x40d284=_0xe57e[_0x2f4205];return _0x40d284;};'use strict';var multer=require(_0xee57('0x0'));var util=require('util');var path=require(_0xee57('0x1'));var timeout=require(_0xee57('0x2'));var express=require(_0xee57('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xee57('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xee57('0x5'));var controller=require(_0xee57('0x6'));router[_0xee57('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xee57('0x7')](_0xee57('0x8'),auth[_0xee57('0x9')](),controller[_0xee57('0xa')]);router[_0xee57('0x7')](_0xee57('0xb'),auth[_0xee57('0x9')](),controller['getConditions']);router['get'](_0xee57('0xc'),auth[_0xee57('0x9')](),controller[_0xee57('0xd')]);router[_0xee57('0xe')]('/',auth[_0xee57('0x9')](),controller[_0xee57('0xf')]);router[_0xee57('0xe')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xee57('0x10')]);router[_0xee57('0xe')](_0xee57('0xc'),auth[_0xee57('0x9')](),controller[_0xee57('0x11')]);router['put'](_0xee57('0x8'),auth['isAuthenticated'](),controller[_0xee57('0x12')]);router['delete'](_0xee57('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xee57('0x13')]=router;
\ No newline at end of file
+var _0xbbb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x51d26e,_0x5bc3ae){var _0x10c10a=function(_0x21a675){while(--_0x21a675){_0x51d26e['push'](_0x51d26e['shift']());}};_0x10c10a(++_0x5bc3ae);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x113dfd,_0x48eae8){_0x113dfd=_0x113dfd-0x0;var _0xb7a4ed=_0xbbb8[_0x113dfd];return _0xb7a4ed;};'use strict';var multer=require(_0x8bbb('0x0'));var util=require(_0x8bbb('0x1'));var path=require('path');var timeout=require(_0x8bbb('0x2'));var express=require(_0x8bbb('0x3'));var router=express['Router']();var fs_extra=require(_0x8bbb('0x4'));var auth=require(_0x8bbb('0x5'));var interaction=require(_0x8bbb('0x6'));var config=require(_0x8bbb('0x7'));var controller=require(_0x8bbb('0x8'));router[_0x8bbb('0x9')]('/',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xb')]);router[_0x8bbb('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8bbb('0x9')](_0x8bbb('0xc'),auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xd')]);router[_0x8bbb('0x9')](_0x8bbb('0xe'),auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xf')]);router['post']('/',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x10')]);router[_0x8bbb('0x11')]('/:id/conditions',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x12')]);router[_0x8bbb('0x11')]('/:id/actions',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x13')]);router[_0x8bbb('0x14')](_0x8bbb('0x15'),auth['isAuthenticated'](),controller[_0x8bbb('0x16')]);router[_0x8bbb('0x17')]('/:id',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x18')]);module[_0x8bbb('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index fb5056b..e75626f 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 _0x84a3=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x51e6a2,_0x3652ae){var _0xaf39a2=function(_0x4d2cd){while(--_0x4d2cd){_0x51e6a2['push'](_0x51e6a2['shift']());}};_0xaf39a2(++_0x3652ae);}(_0x84a3,0x189));var _0x384a=function(_0x4c0db8,_0x15f00d){_0x4c0db8=_0x4c0db8-0x0;var _0x431184=_0x84a3[_0x4c0db8];return _0x431184;};'use strict';var Sequelize=require(_0x384a('0x0'));module[_0x384a('0x1')]={'name':{'type':Sequelize[_0x384a('0x2')],'unique':_0x384a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x384a('0x4')](_0x384a('0x5')),'allowNull':![],'defaultValue':_0x384a('0x5')},'description':{'type':Sequelize[_0x384a('0x2')]},'active':{'type':Sequelize[_0x384a('0x6')],'defaultValue':0x0,'comment':_0x384a('0x7')},'limitCalls':{'type':Sequelize[_0x384a('0x8')](0x4)[_0x384a('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x384a('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x384a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x384a('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x384a('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x384a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x384a('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x384a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x384a('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x384a('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'defaultValue':0x3,'comment':_0x384a('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x384a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x384a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x384a('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x384a('0x4')](_0x384a('0x10'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x384a('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x384a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x384a('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x384a('0x8')](0x9)[_0x384a('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x384a('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x384a('0x8')](0x9)[_0x384a('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x384a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x384a('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x384a('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x384a('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x384a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x384a('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x384a('0x8')](0x5)[_0x384a('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x384a('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x384a('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x384a('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x384a('0x19'),_0x384a('0x1a')),'defaultValue':_0x384a('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x384a('0x1b')},'dialCutDigit':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x384a('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x384a('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x384a('0x8')](0x5)[_0x384a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x384a('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x384a('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x384a('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x384a('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x384a('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x384a('0x8')](0x3)[_0x384a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x384a('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x384a('0x8')](0x5)[_0x384a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x384a('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x384a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x384a('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x384a('0x8')](0x5)[_0x384a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x048e=['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\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen'];(function(_0x2f1696,_0x429c06){var _0x2f08e4=function(_0x36bef6){while(--_0x36bef6){_0x2f1696['push'](_0x2f1696['shift']());}};_0x2f08e4(++_0x429c06);}(_0x048e,0x1aa));var _0xe048=function(_0x59dfe7,_0x925008){_0x59dfe7=_0x59dfe7-0x0;var _0x572f2e=_0x048e[_0x59dfe7];return _0x572f2e;};'use strict';var Sequelize=require(_0xe048('0x0'));module['exports']={'name':{'type':Sequelize[_0xe048('0x1')],'unique':_0xe048('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe048('0x3')](_0xe048('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xe048('0x1')]},'active':{'type':Sequelize[_0xe048('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xe048('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe048('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe048('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe048('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe048('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe048('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe048('0xe')},'dialTimezone':{'type':Sequelize[_0xe048('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe048('0x1')],'defaultValue':_0xe048('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xe048('0x10'),'never',_0xe048('0x11')),'defaultValue':_0xe048('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe048('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xe048('0x9')](0x9)[_0xe048('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe048('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe048('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe048('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe048('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe048('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe048('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe048('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xe048('0x9')](0x9)[_0xe048('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe048('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe048('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe048('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe048('0x9')](0x9)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe048('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe048('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe048('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe048('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe048('0x3')](_0xe048('0x1c'),_0xe048('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xe048('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe048('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xe048('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe048('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe048('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe048('0x9')](0x3)[_0xe048('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe048('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe048('0x9')](0x5)[_0xe048('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe048('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index ba32a8c..4ef6578 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 _0x6a47=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','end','error','name','send','index','map','Campaign','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','nolimit','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper','fromQuery','ListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x39a610,_0x36ca88){var _0x5942c3=function(_0x5bbd58){while(--_0x5bbd58){_0x39a610['push'](_0x39a610['shift']());}};_0x5942c3(++_0x36ca88);}(_0x6a47,0x112));var _0x76a4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6a47[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x76a4('0x0'));var rimraf=require(_0x76a4('0x1'));var zipdir=require(_0x76a4('0x2'));var jsonpatch=require(_0x76a4('0x3'));var rp=require(_0x76a4('0x4'));var moment=require('moment');var BPromise=require(_0x76a4('0x5'));var Mustache=require(_0x76a4('0x6'));var util=require('util');var path=require(_0x76a4('0x7'));var sox=require(_0x76a4('0x8'));var csv=require('to-csv');var ejs=require(_0x76a4('0x9'));var fs=require('fs');var fs_extra=require(_0x76a4('0xa'));var _=require('lodash');var squel=require(_0x76a4('0xb'));var crypto=require(_0x76a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x76a4('0xd'));var toCsv=require(_0x76a4('0xe'));var querystring=require(_0x76a4('0xf'));var Papa=require('papaparse');var Redis=require(_0x76a4('0x10'));var authService=require(_0x76a4('0x11'));var qs=require(_0x76a4('0x12'));var as=require(_0x76a4('0x13'));var hardwareService=require(_0x76a4('0x14'));var logger=require(_0x76a4('0x15'))(_0x76a4('0x16'));var utils=require(_0x76a4('0x17'));var config=require(_0x76a4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x76a4('0x19'))['db'];function respondWithStatusCode(_0xfe603f,_0x421ed2){_0x421ed2=_0x421ed2||0xcc;return function(_0x48e8a7){if(_0x48e8a7){return _0xfe603f[_0x76a4('0x1a')](_0x421ed2);}return _0xfe603f[_0x76a4('0x1b')](_0x421ed2)['end']();};}function respondWithResult(_0x3ec54f,_0x42e0c2){_0x42e0c2=_0x42e0c2||0xc8;return function(_0x5a729a){if(_0x5a729a){return _0x3ec54f['status'](_0x42e0c2)[_0x76a4('0x1c')](_0x5a729a);}};}function respondWithFilteredResult(_0x6213d3,_0x5261de){return function(_0x1ecb5c){if(_0x1ecb5c){var _0x3aed77=typeof _0x5261de[_0x76a4('0x1d')]===_0x76a4('0x1e')&&typeof _0x5261de[_0x76a4('0x1f')]===_0x76a4('0x1e');var _0x147a68=_0x1ecb5c[_0x76a4('0x20')];var _0x52e81f=_0x3aed77?0x0:_0x5261de[_0x76a4('0x1d')];var _0x52cc5f=_0x3aed77?_0x1ecb5c[_0x76a4('0x20')]:_0x5261de['offset']+_0x5261de['limit'];var _0x297064;if(_0x52cc5f>=_0x147a68){_0x52cc5f=_0x147a68;_0x297064=0xc8;}else{_0x297064=0xce;}_0x6213d3['status'](_0x297064);return _0x6213d3[_0x76a4('0x21')](_0x76a4('0x22'),_0x52e81f+'-'+_0x52cc5f+'/'+_0x147a68)[_0x76a4('0x1c')](_0x1ecb5c);}return null;};}function patchUpdates(_0x30c770){return function(_0x18fa98){try{jsonpatch['apply'](_0x18fa98,_0x30c770,!![]);}catch(_0x5a52c7){return BPromise[_0x76a4('0x23')](_0x5a52c7);}return _0x18fa98[_0x76a4('0x24')]();};}function saveUpdates(_0x5ab74a,_0xae96cc){return function(_0x3eee72){if(_0x3eee72){return _0x3eee72[_0x76a4('0x25')](_0x5ab74a)[_0x76a4('0x26')](function(_0x2892f2){return _0x2892f2;});}return null;};}function removeEntity(_0x367164,_0x229cbe){return function(_0x53ec55){if(_0x53ec55){return _0x53ec55['destroy']()['then'](function(){var _0x4fd6eb=_0x53ec55[_0x76a4('0x27')]({'plain':!![]});var _0x4570a0=_0x76a4('0x28');return db[_0x76a4('0x29')][_0x76a4('0x2a')]({'where':{'type':_0x4570a0,'resourceId':_0x4fd6eb['id']}})['then'](function(){return _0x53ec55;});})['then'](function(){_0x367164[_0x76a4('0x1b')](0xcc)[_0x76a4('0x2b')]();});}};}function handleEntityNotFound(_0x4a2b41,_0x5b2e28){return function(_0x41d8f8){if(!_0x41d8f8){_0x4a2b41[_0x76a4('0x1a')](0x194);}return _0x41d8f8;};}function handleError(_0x43ce16,_0x6f89b4){_0x6f89b4=_0x6f89b4||0x1f4;return function(_0x228c34){logger[_0x76a4('0x2c')](_0x228c34['stack']);if(_0x228c34['name']){delete _0x228c34[_0x76a4('0x2d')];}_0x43ce16[_0x76a4('0x1b')](_0x6f89b4)[_0x76a4('0x2e')](_0x228c34);};}exports[_0x76a4('0x2f')]=function(_0x183f0b,_0x3ba49c){var _0x78ce67={},_0x4afff6={},_0x553738={'count':0x0,'rows':[]};var _0x16dc67=_[_0x76a4('0x30')](db[_0x76a4('0x31')][_0x76a4('0x32')],function(_0x65eb1f){return{'name':_0x65eb1f[_0x76a4('0x33')],'type':_0x65eb1f[_0x76a4('0x34')]['key']};});_0x4afff6['model']=_[_0x76a4('0x30')](_0x16dc67,_0x76a4('0x2d'));_0x4afff6[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x183f0b['query']);_0x4afff6[_0x76a4('0x37')]=_[_0x76a4('0x38')](_0x4afff6[_0x76a4('0x39')],_0x4afff6[_0x76a4('0x35')]);_0x78ce67[_0x76a4('0x3a')]=_[_0x76a4('0x38')](_0x4afff6['model'],qs[_0x76a4('0x3b')](_0x183f0b['query'][_0x76a4('0x3b')]));_0x78ce67[_0x76a4('0x3a')]=_0x78ce67['attributes'][_0x76a4('0x3c')]?_0x78ce67[_0x76a4('0x3a')]:_0x4afff6[_0x76a4('0x39')];if(!_0x183f0b[_0x76a4('0x35')][_0x76a4('0x3d')]('nolimit')){_0x78ce67['limit']=qs[_0x76a4('0x1f')](_0x183f0b['query'][_0x76a4('0x1f')]);_0x78ce67[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x183f0b[_0x76a4('0x35')][_0x76a4('0x1d')]);}_0x78ce67[_0x76a4('0x3e')]=qs['sort'](_0x183f0b['query'][_0x76a4('0x3f')]);_0x78ce67[_0x76a4('0x40')]=qs['filters'](_[_0x76a4('0x41')](_0x183f0b[_0x76a4('0x35')],_0x4afff6[_0x76a4('0x37')]),_0x16dc67);if(_0x183f0b['query'][_0x76a4('0x42')]){_0x78ce67[_0x76a4('0x40')]=_['merge'](_0x78ce67[_0x76a4('0x40')],{'$or':_[_0x76a4('0x30')](_0x16dc67,function(_0x91df79){if(_0x91df79['type']!=='VIRTUAL'){var _0x3b149a={};_0x3b149a[_0x91df79['name']]={'$like':'%'+_0x183f0b['query'][_0x76a4('0x42')]+'%'};return _0x3b149a;}})});}_0x78ce67=_['merge']({},_0x78ce67,_0x183f0b[_0x76a4('0x43')]);var _0x3b7c6b={'where':_0x78ce67[_0x76a4('0x40')]};return db['Campaign'][_0x76a4('0x20')](_0x3b7c6b)[_0x76a4('0x26')](function(_0x51d94b){_0x553738[_0x76a4('0x20')]=_0x51d94b;if(_0x183f0b[_0x76a4('0x35')][_0x76a4('0x44')]){_0x78ce67[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x31')][_0x76a4('0x46')](_0x78ce67);})[_0x76a4('0x26')](function(_0x361abe){_0x553738[_0x76a4('0x47')]=_0x361abe;return _0x553738;})[_0x76a4('0x26')](respondWithFilteredResult(_0x3ba49c,_0x78ce67))[_0x76a4('0x48')](handleError(_0x3ba49c,null));};exports[_0x76a4('0x49')]=function(_0x442431,_0x26ed8f){var _0x51f8b7={'raw':![],'where':{'id':_0x442431[_0x76a4('0x4a')]['id']}},_0x193ad1={};_0x193ad1[_0x76a4('0x39')]=_[_0x76a4('0x36')](db[_0x76a4('0x31')][_0x76a4('0x32')]);_0x193ad1[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x442431['query']);_0x193ad1[_0x76a4('0x37')]=_['intersection'](_0x193ad1[_0x76a4('0x39')],_0x193ad1['query']);_0x51f8b7[_0x76a4('0x3a')]=_[_0x76a4('0x38')](_0x193ad1['model'],qs[_0x76a4('0x3b')](_0x442431['query'][_0x76a4('0x3b')]));_0x51f8b7['attributes']=_0x51f8b7['attributes'][_0x76a4('0x3c')]?_0x51f8b7[_0x76a4('0x3a')]:_0x193ad1['model'];if(_0x442431[_0x76a4('0x35')][_0x76a4('0x44')]){_0x51f8b7['include']=[{'all':!![]}];}_0x51f8b7=_[_0x76a4('0x4b')]({},_0x51f8b7,_0x442431[_0x76a4('0x43')]);return db[_0x76a4('0x31')][_0x76a4('0x4c')](_0x51f8b7)['then'](handleEntityNotFound(_0x26ed8f,null))[_0x76a4('0x26')](respondWithResult(_0x26ed8f,null))['catch'](handleError(_0x26ed8f,null));};exports['create']=function(_0x4275ff,_0x1dea2d){return db[_0x76a4('0x31')][_0x76a4('0x4d')](_0x4275ff[_0x76a4('0x4e')],{})[_0x76a4('0x26')](function(_0x5687b3){var _0x180761=_0x4275ff[_0x76a4('0x4f')][_0x76a4('0x27')]({'plain':!![]});if(!_0x180761)throw new Error(_0x76a4('0x50'));if(_0x180761[_0x76a4('0x51')]===_0x76a4('0x4f')){var _0x513325=_0x5687b3[_0x76a4('0x27')]({'plain':!![]});var _0xdf968b='IvrCampaigns';return db[_0x76a4('0x52')][_0x76a4('0x4c')]({'where':{'name':_0xdf968b,'userProfileId':_0x180761[_0x76a4('0x53')]},'raw':!![]})[_0x76a4('0x26')](function(_0x2f9abf){if(_0x2f9abf&&_0x2f9abf[_0x76a4('0x54')]===0x0){return db[_0x76a4('0x29')][_0x76a4('0x4d')]({'name':_0x513325['name'],'resourceId':_0x513325['id'],'type':_0x2f9abf[_0x76a4('0x2d')],'sectionId':_0x2f9abf['id']},{})[_0x76a4('0x26')](function(){return _0x5687b3;});}else{return _0x5687b3;}})[_0x76a4('0x48')](function(_0x2cac9c){logger[_0x76a4('0x2c')](_0x76a4('0x55'),_0x2cac9c);throw _0x2cac9c;});}return _0x5687b3;})[_0x76a4('0x26')](respondWithResult(_0x1dea2d,0xc9))[_0x76a4('0x48')](handleError(_0x1dea2d,null));};exports[_0x76a4('0x56')]=function(_0x1512b2,_0x3a6f9d){var _0x6a2ec0={'where':{'id':_0x1512b2[_0x76a4('0x4a')]['id']}},_0x576c0c={};_0x576c0c['model']=_[_0x76a4('0x36')](db[_0x76a4('0x31')][_0x76a4('0x32')]);_0x6a2ec0[_0x76a4('0x3a')]=_[_0x76a4('0x38')](_0x576c0c['model'],qs[_0x76a4('0x3b')](_0x1512b2[_0x76a4('0x35')][_0x76a4('0x3b')]));_0x6a2ec0['attributes']=_0x6a2ec0[_0x76a4('0x3a')]['length']?_0x6a2ec0['attributes']:_0x576c0c[_0x76a4('0x39')];if(_0x1512b2[_0x76a4('0x35')]['includeAll']){_0x6a2ec0[_0x76a4('0x45')]=[{'all':!![]}];}_0x6a2ec0=_[_0x76a4('0x4b')]({},_0x6a2ec0,_0x1512b2[_0x76a4('0x43')]);return db[_0x76a4('0x31')][_0x76a4('0x4c')](_0x6a2ec0)[_0x76a4('0x26')](handleEntityNotFound(_0x3a6f9d,null))[_0x76a4('0x26')](function(_0x554b83){if(_0x554b83){var _0x1a5478=_0x554b83['get']({'plain':!![]});_0x1a5478=qs[_0x76a4('0x57')](_0x1a5478,['id',_0x76a4('0x58'),_0x76a4('0x59')]);_0x1512b2[_0x76a4('0x4e')]=_[_0x76a4('0x57')](_0x1512b2[_0x76a4('0x4e')],['id',_0x76a4('0x58'),'updatedAt']);return db['Campaign'][_0x76a4('0x4d')](_[_0x76a4('0x4b')](_0x1a5478,_0x1512b2[_0x76a4('0x4e')]),{'include':_0x1512b2[_0x76a4('0x35')][_0x76a4('0x44')]?[{'all':!![]}]:undefined})[_0x76a4('0x26')](function(_0x581886){var _0x4298ba=_0x1512b2[_0x76a4('0x4f')]['get']({'plain':!![]});if(!_0x4298ba)throw new Error(_0x76a4('0x50'));if(_0x4298ba[_0x76a4('0x51')]===_0x76a4('0x4f')){var _0xc2a60b=_0x581886['get']({'plain':!![]});var _0x194ebc='IvrCampaigns';return db[_0x76a4('0x52')][_0x76a4('0x4c')]({'where':{'name':_0x194ebc,'userProfileId':_0x4298ba['userProfileId']},'raw':!![]})[_0x76a4('0x26')](function(_0x5d112a){if(_0x5d112a&&_0x5d112a[_0x76a4('0x54')]===0x0){return db['UserProfileResource'][_0x76a4('0x4d')]({'name':_0xc2a60b['name'],'resourceId':_0xc2a60b['id'],'type':_0x5d112a['name'],'sectionId':_0x5d112a['id']},{})[_0x76a4('0x26')](function(){return _0x581886;});}else{return _0x581886;}})[_0x76a4('0x48')](function(_0x396eb4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x396eb4);throw _0x396eb4;});}return _0x581886;});}})['then'](respondWithResult(_0x3a6f9d,0xc9))[_0x76a4('0x48')](handleError(_0x3a6f9d,null));};exports[_0x76a4('0x25')]=function(_0x5d1dda,_0x394a52){if(_0x5d1dda['body']['id']){delete _0x5d1dda[_0x76a4('0x4e')]['id'];}return db[_0x76a4('0x31')][_0x76a4('0x4c')]({'where':{'id':_0x5d1dda[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x394a52,null))['then'](saveUpdates(_0x5d1dda[_0x76a4('0x4e')],null))[_0x76a4('0x26')](respondWithResult(_0x394a52,null))[_0x76a4('0x48')](handleError(_0x394a52,null));};exports[_0x76a4('0x2a')]=function(_0x533999,_0x3c60a7){return db[_0x76a4('0x31')][_0x76a4('0x4c')]({'where':{'id':_0x533999[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x3c60a7,null))[_0x76a4('0x26')](removeEntity(_0x3c60a7,null))[_0x76a4('0x48')](handleError(_0x3c60a7,null));};exports[_0x76a4('0x5a')]=function(_0x45719b,_0x3eacdb,_0x401289){var _0x52c468={'raw':!![],'where':{}};var _0x39a6e4={};var _0x4972ed={'count':0x0,'rows':[]};return db[_0x76a4('0x31')][_0x76a4('0x5b')]({'where':{'id':_0x45719b[_0x76a4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3eacdb,null))[_0x76a4('0x26')](function(_0x2ec71f){if(_0x2ec71f){_0x39a6e4[_0x76a4('0x39')]=_[_0x76a4('0x36')](db[_0x76a4('0x5c')][_0x76a4('0x32')]);_0x39a6e4[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x45719b[_0x76a4('0x35')]);_0x39a6e4[_0x76a4('0x37')]=_['intersection'](_0x39a6e4[_0x76a4('0x39')],_0x39a6e4['query']);_0x52c468['attributes']=_['intersection'](_0x39a6e4['model'],qs['fields'](_0x45719b[_0x76a4('0x35')]['fields']));_0x52c468[_0x76a4('0x3a')]=_0x52c468[_0x76a4('0x3a')][_0x76a4('0x3c')]?_0x52c468[_0x76a4('0x3a')]:_0x39a6e4[_0x76a4('0x39')];if(!_0x45719b[_0x76a4('0x35')]['hasOwnProperty'](_0x76a4('0x5d'))){_0x52c468['limit']=qs[_0x76a4('0x1f')](_0x45719b['query'][_0x76a4('0x1f')]);_0x52c468[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x45719b[_0x76a4('0x35')]['offset']);}_0x52c468[_0x76a4('0x3e')]=qs['sort'](_0x45719b['query'][_0x76a4('0x3f')]);_0x52c468[_0x76a4('0x40')]=qs[_0x76a4('0x37')](_[_0x76a4('0x41')](_0x45719b[_0x76a4('0x35')],_0x39a6e4[_0x76a4('0x37')]));_0x52c468[_0x76a4('0x40')][_0x76a4('0x5e')]=_0x2ec71f['id'];if(_0x45719b[_0x76a4('0x35')][_0x76a4('0x42')]){_0x52c468[_0x76a4('0x40')]=_['merge'](_0x52c468[_0x76a4('0x40')],{'$or':_[_0x76a4('0x30')](_0x52c468[_0x76a4('0x3a')],function(_0x572566){var _0x44017f={};_0x44017f[_0x572566]={'$like':'%'+_0x45719b[_0x76a4('0x35')]['filter']+'%'};return _0x44017f;})});}_0x52c468=_['merge']({},_0x52c468,_0x45719b[_0x76a4('0x43')]);return db[_0x76a4('0x5c')][_0x76a4('0x20')]({'where':_0x52c468['where']})[_0x76a4('0x26')](function(_0x5e6b39){_0x4972ed[_0x76a4('0x20')]=_0x5e6b39;if(_0x45719b[_0x76a4('0x35')][_0x76a4('0x44')]){_0x52c468[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x5c')][_0x76a4('0x46')](_0x52c468);})[_0x76a4('0x26')](function(_0x4d2e02){_0x4972ed[_0x76a4('0x47')]=_0x4d2e02;return _0x4972ed;});}})[_0x76a4('0x26')](respondWithFilteredResult(_0x3eacdb,_0x52c468))[_0x76a4('0x48')](handleError(_0x3eacdb,null));};exports['getHopperHistories']=function(_0x490f07,_0x2d39b8,_0xed0ab4){var _0x2ffd0b={'raw':!![],'where':{}};var _0x12ca48={};var _0x464855={'count':0x0,'rows':[]};return db[_0x76a4('0x31')]['findOne']({'where':{'id':_0x490f07[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x2d39b8,null))[_0x76a4('0x26')](function(_0x4bcca7){if(_0x4bcca7){_0x12ca48[_0x76a4('0x39')]=_['keys'](db[_0x76a4('0x5f')][_0x76a4('0x32')]);_0x12ca48[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x490f07['query']);_0x12ca48[_0x76a4('0x37')]=_[_0x76a4('0x38')](_0x12ca48['model'],_0x12ca48[_0x76a4('0x35')]);_0x2ffd0b['attributes']=_[_0x76a4('0x38')](_0x12ca48[_0x76a4('0x39')],qs[_0x76a4('0x3b')](_0x490f07[_0x76a4('0x35')][_0x76a4('0x3b')]));_0x2ffd0b['attributes']=_0x2ffd0b['attributes'][_0x76a4('0x3c')]?_0x2ffd0b[_0x76a4('0x3a')]:_0x12ca48[_0x76a4('0x39')];if(!_0x490f07[_0x76a4('0x35')][_0x76a4('0x3d')](_0x76a4('0x5d'))){_0x2ffd0b['limit']=qs[_0x76a4('0x1f')](_0x490f07[_0x76a4('0x35')][_0x76a4('0x1f')]);_0x2ffd0b[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x490f07[_0x76a4('0x35')][_0x76a4('0x1d')]);}_0x2ffd0b[_0x76a4('0x3e')]=qs[_0x76a4('0x3f')](_0x490f07[_0x76a4('0x35')]['sort']);_0x2ffd0b[_0x76a4('0x40')]=qs[_0x76a4('0x37')](_['pick'](_0x490f07[_0x76a4('0x35')],_0x12ca48['filters']));_0x2ffd0b['where'][_0x76a4('0x5e')]=_0x4bcca7['id'];if(_0x490f07['query'][_0x76a4('0x42')]){_0x2ffd0b[_0x76a4('0x40')]=_['merge'](_0x2ffd0b['where'],{'$or':_[_0x76a4('0x30')](_0x2ffd0b[_0x76a4('0x3a')],function(_0x5b5db8){var _0x4160d1={};_0x4160d1[_0x5b5db8]={'$like':'%'+_0x490f07[_0x76a4('0x35')][_0x76a4('0x42')]+'%'};return _0x4160d1;})});}_0x2ffd0b=_[_0x76a4('0x4b')]({},_0x2ffd0b,_0x490f07[_0x76a4('0x43')]);return db['CmHopperHistory'][_0x76a4('0x20')]({'where':_0x2ffd0b[_0x76a4('0x40')]})[_0x76a4('0x26')](function(_0x2e8399){_0x464855['count']=_0x2e8399;if(_0x490f07['query']['includeAll']){_0x2ffd0b[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x5f')][_0x76a4('0x46')](_0x2ffd0b);})[_0x76a4('0x26')](function(_0x66b40){_0x464855[_0x76a4('0x47')]=_0x66b40;return _0x464855;});}})[_0x76a4('0x26')](respondWithFilteredResult(_0x2d39b8,_0x2ffd0b))[_0x76a4('0x48')](handleError(_0x2d39b8,null));};exports[_0x76a4('0x60')]=function(_0x280e10,_0x5c27e0,_0xa49a50){var _0x44c0f3={'raw':!![],'where':{}};var _0xe9fd35={};var _0x231c5a={'count':0x0,'rows':[]};return db['Campaign'][_0x76a4('0x5b')]({'where':{'id':_0x280e10[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x5c27e0,null))[_0x76a4('0x26')](function(_0x5b5268){if(_0x5b5268){_0xe9fd35[_0x76a4('0x39')]=_['keys'](db[_0x76a4('0x61')][_0x76a4('0x32')]);_0xe9fd35[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x280e10[_0x76a4('0x35')]);_0xe9fd35['filters']=_[_0x76a4('0x38')](_0xe9fd35[_0x76a4('0x39')],_0xe9fd35[_0x76a4('0x35')]);_0x44c0f3[_0x76a4('0x3a')]=_['intersection'](_0xe9fd35['model'],qs['fields'](_0x280e10['query'][_0x76a4('0x3b')]));_0x44c0f3[_0x76a4('0x3a')]=_0x44c0f3[_0x76a4('0x3a')][_0x76a4('0x3c')]?_0x44c0f3[_0x76a4('0x3a')]:_0xe9fd35[_0x76a4('0x39')];if(!_0x280e10[_0x76a4('0x35')][_0x76a4('0x3d')]('nolimit')){_0x44c0f3[_0x76a4('0x1f')]=qs[_0x76a4('0x1f')](_0x280e10['query'][_0x76a4('0x1f')]);_0x44c0f3[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x280e10['query'][_0x76a4('0x1d')]);}_0x44c0f3['order']=qs[_0x76a4('0x3f')](_0x280e10[_0x76a4('0x35')][_0x76a4('0x3f')]);_0x44c0f3[_0x76a4('0x40')]=qs[_0x76a4('0x37')](_[_0x76a4('0x41')](_0x280e10[_0x76a4('0x35')],_0xe9fd35[_0x76a4('0x37')]));_0x44c0f3[_0x76a4('0x40')][_0x76a4('0x5e')]=_0x5b5268['id'];if(_0x280e10[_0x76a4('0x35')][_0x76a4('0x42')]){_0x44c0f3['where']=_['merge'](_0x44c0f3[_0x76a4('0x40')],{'$or':_[_0x76a4('0x30')](_0x44c0f3['attributes'],function(_0x459c23){var _0xb00b69={};_0xb00b69[_0x459c23]={'$like':'%'+_0x280e10['query'][_0x76a4('0x42')]+'%'};return _0xb00b69;})});}_0x44c0f3=_[_0x76a4('0x4b')]({},_0x44c0f3,_0x280e10[_0x76a4('0x43')]);return db[_0x76a4('0x61')]['count']({'where':_0x44c0f3[_0x76a4('0x40')]})[_0x76a4('0x26')](function(_0x78152b){_0x231c5a[_0x76a4('0x20')]=_0x78152b;if(_0x280e10['query'][_0x76a4('0x44')]){_0x44c0f3[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x61')][_0x76a4('0x46')](_0x44c0f3);})[_0x76a4('0x26')](function(_0x2828aa){_0x231c5a['rows']=_0x2828aa;return _0x231c5a;});}})['then'](respondWithFilteredResult(_0x5c27e0,_0x44c0f3))[_0x76a4('0x48')](handleError(_0x5c27e0,null));};exports[_0x76a4('0x62')]=function(_0x7e94bf,_0x1c4dd5,_0x52482c){var _0x448fec={'raw':!![],'where':{}};var _0x519bf6={};var _0x22fd87={'count':0x0,'rows':[]};return db[_0x76a4('0x31')][_0x76a4('0x5b')]({'where':{'id':_0x7e94bf[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x1c4dd5,null))[_0x76a4('0x26')](function(_0x574e4e){if(_0x574e4e){_0x519bf6[_0x76a4('0x39')]=_['keys'](db['CmHopperBlack'][_0x76a4('0x32')]);_0x519bf6[_0x76a4('0x35')]=_['keys'](_0x7e94bf[_0x76a4('0x35')]);_0x519bf6[_0x76a4('0x37')]=_['intersection'](_0x519bf6[_0x76a4('0x39')],_0x519bf6[_0x76a4('0x35')]);_0x448fec[_0x76a4('0x3a')]=_['intersection'](_0x519bf6[_0x76a4('0x39')],qs[_0x76a4('0x3b')](_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x3b')]));_0x448fec[_0x76a4('0x3a')]=_0x448fec['attributes'][_0x76a4('0x3c')]?_0x448fec['attributes']:_0x519bf6[_0x76a4('0x39')];if(!_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x3d')](_0x76a4('0x5d'))){_0x448fec[_0x76a4('0x1f')]=qs['limit'](_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x1f')]);_0x448fec[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x1d')]);}_0x448fec['order']=qs[_0x76a4('0x3f')](_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x3f')]);_0x448fec[_0x76a4('0x40')]=qs['filters'](_[_0x76a4('0x41')](_0x7e94bf[_0x76a4('0x35')],_0x519bf6['filters']));_0x448fec[_0x76a4('0x40')][_0x76a4('0x5e')]=_0x574e4e['id'];if(_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x42')]){_0x448fec[_0x76a4('0x40')]=_[_0x76a4('0x4b')](_0x448fec[_0x76a4('0x40')],{'$or':_['map'](_0x448fec['attributes'],function(_0x18f4f7){var _0x5e3e70={};_0x5e3e70[_0x18f4f7]={'$like':'%'+_0x7e94bf[_0x76a4('0x35')]['filter']+'%'};return _0x5e3e70;})});}_0x448fec=_[_0x76a4('0x4b')]({},_0x448fec,_0x7e94bf[_0x76a4('0x43')]);return db[_0x76a4('0x63')][_0x76a4('0x20')]({'where':_0x448fec[_0x76a4('0x40')]})['then'](function(_0x55e39c){_0x22fd87['count']=_0x55e39c;if(_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x44')]){_0x448fec[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x63')][_0x76a4('0x46')](_0x448fec);})[_0x76a4('0x26')](function(_0x1923a8){_0x22fd87['rows']=_0x1923a8;return _0x22fd87;});}})[_0x76a4('0x26')](respondWithFilteredResult(_0x1c4dd5,_0x448fec))[_0x76a4('0x48')](handleError(_0x1c4dd5,null));};exports['getLists']=function(_0x4f0aa2,_0x11bcba,_0x1b0c2e){var _0x1ca3a0={};var _0x24fcd1={};var _0xb26574;var _0xfe873;return db['Campaign']['findOne']({'where':{'id':_0x4f0aa2['params']['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x11bcba,null))[_0x76a4('0x26')](function(_0x2cbfbd){if(_0x2cbfbd){_0xb26574=_0x2cbfbd;_0x24fcd1[_0x76a4('0x39')]=_[_0x76a4('0x36')](db[_0x76a4('0x64')]['rawAttributes']);_0x24fcd1[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x4f0aa2['query']);_0x24fcd1[_0x76a4('0x37')]=_[_0x76a4('0x38')](_0x24fcd1['model'],_0x24fcd1[_0x76a4('0x35')]);_0x1ca3a0[_0x76a4('0x3a')]=_['intersection'](_0x24fcd1[_0x76a4('0x39')],qs[_0x76a4('0x3b')](_0x4f0aa2['query'][_0x76a4('0x3b')]));_0x1ca3a0['attributes']=_0x1ca3a0[_0x76a4('0x3a')][_0x76a4('0x3c')]?_0x1ca3a0[_0x76a4('0x3a')]:_0x24fcd1[_0x76a4('0x39')];_0x1ca3a0[_0x76a4('0x3e')]=qs[_0x76a4('0x3f')](_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x3f')]);_0x1ca3a0[_0x76a4('0x40')]=qs['filters'](_[_0x76a4('0x41')](_0x4f0aa2[_0x76a4('0x35')],_0x24fcd1[_0x76a4('0x37')]));if(_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x42')]){_0x1ca3a0[_0x76a4('0x40')]=_[_0x76a4('0x4b')](_0x1ca3a0[_0x76a4('0x40')],{'$or':_[_0x76a4('0x30')](_0x1ca3a0['attributes'],function(_0x2b0cad){var _0xb9c2ce={};_0xb9c2ce[_0x2b0cad]={'$like':'%'+_0x4f0aa2[_0x76a4('0x35')]['filter']+'%'};return _0xb9c2ce;})});}_0x1ca3a0=_['merge']({},_0x1ca3a0,_0x4f0aa2['options']);return _0xb26574[_0x76a4('0x65')](_0x1ca3a0);}})['then'](function(_0x10dd3f){if(_0x10dd3f){_0xfe873=_0x10dd3f[_0x76a4('0x3c')];if(!_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x3d')](_0x76a4('0x5d'))){_0x1ca3a0[_0x76a4('0x1f')]=qs[_0x76a4('0x1f')](_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x1f')]);_0x1ca3a0[_0x76a4('0x1d')]=qs['offset'](_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x1d')]);}return _0xb26574['getLists'](_0x1ca3a0);}})[_0x76a4('0x26')](function(_0xeb9dd5){if(_0xeb9dd5){return _0xeb9dd5?{'count':_0xfe873,'rows':_0xeb9dd5}:null;}})['then'](respondWithResult(_0x11bcba,null))[_0x76a4('0x48')](handleError(_0x11bcba,null));};exports['addLists']=function(_0xc1abde,_0x5184de,_0x2e8095){var _0x3e0d0b,_0x18bf06;var _0x529699=[];var _0x294ebe=moment()[_0x76a4('0x66')](_0x76a4('0x67'));return db[_0x76a4('0x31')]['find']({'where':{'id':_0xc1abde['params']['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x5184de,null))[_0x76a4('0x26')](function(_0x24278c){if(_0x24278c){_0x18bf06=_0x24278c;return _0x24278c[_0x76a4('0x68')](_0xc1abde[_0x76a4('0x4e')][_0x76a4('0x69')],_['omit'](_0xc1abde[_0x76a4('0x4e')],[_0x76a4('0x69'),'id'])||{});}return null;})[_0x76a4('0x6a')](function(_0xa161a4){var _0x351c9f;var _0xb948a9;_0x3e0d0b=_0xa161a4||[];var _0x5e58da=[];if(_0xa161a4){for(var _0x23a24e=0x0;_0x23a24e<_0xa161a4[_0x76a4('0x3c')];_0x23a24e+=0x1){var _0x39b005=_0xa161a4[_0x23a24e][_0x76a4('0x27')]({'plain':!![]});_0x18bf06[_0x76a4('0x6b')]=_0xc1abde[_0x76a4('0x4e')][_0x76a4('0x6b')]?_0xc1abde['body'][_0x76a4('0x6b')]:_0x18bf06[_0x76a4('0x6b')];switch(_0x18bf06[_0x76a4('0x6b')]){case _0x76a4('0x6c'):_0x351c9f=squel[_0x76a4('0x6d')]()[_0x76a4('0x6e')]('cm_hopper')['fromQuery']([_0x76a4('0x6f'),_0x76a4('0x70'),_0x76a4('0x71'),'ListId',_0x76a4('0x5e'),_0x76a4('0x58'),'updatedAt'],squel[_0x76a4('0x72')]()[_0x76a4('0x73')](_0x76a4('0x6f'),'phone')[_0x76a4('0x73')](_0x76a4('0x74'),_0x76a4('0x70'))[_0x76a4('0x73')]('id',_0x76a4('0x71'))[_0x76a4('0x73')](_0x39b005['CmListId']['toString'](),'ListId')[_0x76a4('0x73')](_0xc1abde['params']['id'][_0x76a4('0x75')](),_0x76a4('0x5e'))[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27',_0x76a4('0x58'))[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27',_0x76a4('0x59'))[_0x76a4('0x76')](_0x76a4('0x77'))[_0x76a4('0x40')](_0x76a4('0x78'))[_0x76a4('0x40')](_0x76a4('0x79'),_0x39b005[_0x76a4('0x7a')]['toString']())[_0x76a4('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x76a4('0x40')](_0x76a4('0x7b'),squel[_0x76a4('0x72')]()[_0x76a4('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0x76a4('0x76')]('cm_hopper_final')[_0x76a4('0x40')]('CampaignId\x20=\x20?',_0xc1abde[_0x76a4('0x4a')]['id'][_0x76a4('0x75')]()))['where'](_0x76a4('0x7b'),squel[_0x76a4('0x72')]()[_0x76a4('0x73')](_0x76a4('0x7c'))[_0x76a4('0x76')]('cm_hopper')['where'](_0x76a4('0x7d'),_0xc1abde[_0x76a4('0x4a')]['id']['toString']())))[_0x76a4('0x75')]();break;case _0x76a4('0x7e'):_0x351c9f=squel['insert']()[_0x76a4('0x6e')](_0x76a4('0x7f'))[_0x76a4('0x80')](['phone',_0x76a4('0x70'),_0x76a4('0x71'),_0x76a4('0x81'),_0x76a4('0x5e'),_0x76a4('0x58'),'updatedAt'],squel[_0x76a4('0x72')]()[_0x76a4('0x73')](_0x76a4('0x6f'),_0x76a4('0x6f'))[_0x76a4('0x73')](_0x76a4('0x74'),'scheduledAt')['field']('id',_0x76a4('0x71'))[_0x76a4('0x73')](_0x39b005['CmListId'][_0x76a4('0x75')](),'ListId')[_0x76a4('0x73')](_0xc1abde['params']['id'][_0x76a4('0x75')](),_0x76a4('0x5e'))[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27',_0x76a4('0x58'))[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27','updatedAt')[_0x76a4('0x76')](_0x76a4('0x77'))['where'](_0x76a4('0x78'))[_0x76a4('0x40')]('ListId\x20=\x20?',_0x39b005['CmListId']['toString']())[_0x76a4('0x40')](_0x76a4('0x82'))[_0x76a4('0x40')](_0x76a4('0x7b'),squel[_0x76a4('0x72')]()[_0x76a4('0x73')](_0x76a4('0x7c'))[_0x76a4('0x76')](_0x76a4('0x7f'))[_0x76a4('0x40')]('CampaignId\x20=\x20?',_0xc1abde[_0x76a4('0x4a')]['id'][_0x76a4('0x75')]())))['toString']();break;default:_0x351c9f=squel[_0x76a4('0x6d')]()[_0x76a4('0x6e')](_0x76a4('0x7f'))[_0x76a4('0x80')]([_0x76a4('0x6f'),_0x76a4('0x70'),_0x76a4('0x71'),'ListId','CampaignId',_0x76a4('0x58'),'updatedAt'],squel['select']()['field'](_0x76a4('0x6f'),_0x76a4('0x6f'))[_0x76a4('0x73')]('NOW()',_0x76a4('0x70'))['field']('id','ContactId')[_0x76a4('0x73')](_0x39b005[_0x76a4('0x7a')][_0x76a4('0x75')](),_0x76a4('0x81'))[_0x76a4('0x73')](_0xc1abde[_0x76a4('0x4a')]['id'][_0x76a4('0x75')](),'CampaignId')[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27','createdAt')[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27','updatedAt')[_0x76a4('0x76')]('cm_contacts')[_0x76a4('0x40')](_0x76a4('0x78'))[_0x76a4('0x40')]('ListId\x20=\x20?',_0x39b005[_0x76a4('0x7a')]['toString']())[_0x76a4('0x40')](_0x76a4('0x82')))[_0x76a4('0x75')]();}_0xb948a9=squel[_0x76a4('0x6d')]()[_0x76a4('0x6e')](_0x76a4('0x83'))[_0x76a4('0x80')](['cmHopperId','scheduledAt',_0x76a4('0x6f'),_0x76a4('0x84'),_0x76a4('0x58'),_0x76a4('0x59')],squel['select']()['field'](_0x76a4('0x85'),'id')[_0x76a4('0x73')]('NOW()',_0x76a4('0x70'))[_0x76a4('0x73')](_0x76a4('0x86'),_0x76a4('0x6f'))[_0x76a4('0x73')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x294ebe+'\x27','createdAt')[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27',_0x76a4('0x59'))['from'](_0x76a4('0x87'),'ci')[_0x76a4('0x88')](_0x76a4('0x7f'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x76a4('0x40')](_0x76a4('0x89'),_0x39b005[_0x76a4('0x7a')][_0x76a4('0x75')]())[_0x76a4('0x40')](_0x76a4('0x8a'),_0xc1abde[_0x76a4('0x4a')]['id'][_0x76a4('0x75')]())[_0x76a4('0x40')](_0x76a4('0x8b'),_0x294ebe))[_0x76a4('0x75')]();_0x5e58da[_0x76a4('0x8c')](db['sequelize'][_0x76a4('0x35')](_0x351c9f));_0x529699[_0x76a4('0x8c')](db[_0x76a4('0x8d')][_0x76a4('0x35')](_0xb948a9));}return BPromise[_0x76a4('0x8e')](_0x5e58da);}})[_0x76a4('0x26')](function(){return BPromise['all'](_0x529699);})[_0x76a4('0x26')](function(){return _0x3e0d0b;})[_0x76a4('0x26')](respondWithResult(_0x5184de,null))['catch'](handleError(_0x5184de,null));};exports[_0x76a4('0x8f')]=function(_0x450518,_0x139892,_0x2a01e4){return db['Campaign'][_0x76a4('0x4c')]({'where':{'id':_0x450518[_0x76a4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x139892,null))[_0x76a4('0x26')](function(_0xf7c07a){if(_0xf7c07a){return _0xf7c07a[_0x76a4('0x8f')](_0x450518[_0x76a4('0x35')]['ids']);}})[_0x76a4('0x26')](function(_0x1aa7f0){if(_0x1aa7f0){return db['CmHopper'][_0x76a4('0x2a')]({'where':{'ListId':_0x450518[_0x76a4('0x35')][_0x76a4('0x69')],'CampaignId':_0x450518['params']['id']}})[_0x76a4('0x26')](function(){return _0x1aa7f0;});}})[_0x76a4('0x26')](respondWithStatusCode(_0x139892,null))[_0x76a4('0x48')](handleError(_0x139892,null));};exports['getBlackLists']=function(_0x3110f5,_0x2f2fe2,_0x745983){var _0x5c808d={};var _0x543219={};var _0x4db85d;var _0x100da3;return db[_0x76a4('0x31')]['findOne']({'where':{'id':_0x3110f5[_0x76a4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f2fe2,null))[_0x76a4('0x26')](function(_0x5f0167){if(_0x5f0167){_0x4db85d=_0x5f0167;_0x543219[_0x76a4('0x39')]=_[_0x76a4('0x36')](db[_0x76a4('0x64')]['rawAttributes']);_0x543219[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x3110f5[_0x76a4('0x35')]);_0x543219[_0x76a4('0x37')]=_[_0x76a4('0x38')](_0x543219[_0x76a4('0x39')],_0x543219[_0x76a4('0x35')]);_0x5c808d['attributes']=_[_0x76a4('0x38')](_0x543219[_0x76a4('0x39')],qs['fields'](_0x3110f5[_0x76a4('0x35')][_0x76a4('0x3b')]));_0x5c808d['attributes']=_0x5c808d[_0x76a4('0x3a')][_0x76a4('0x3c')]?_0x5c808d[_0x76a4('0x3a')]:_0x543219['model'];_0x5c808d[_0x76a4('0x3e')]=qs[_0x76a4('0x3f')](_0x3110f5[_0x76a4('0x35')]['sort']);_0x5c808d[_0x76a4('0x40')]=qs[_0x76a4('0x37')](_[_0x76a4('0x41')](_0x3110f5[_0x76a4('0x35')],_0x543219[_0x76a4('0x37')]));if(_0x3110f5[_0x76a4('0x35')][_0x76a4('0x42')]){_0x5c808d[_0x76a4('0x40')]=_[_0x76a4('0x4b')](_0x5c808d[_0x76a4('0x40')],{'$or':_['map'](_0x5c808d[_0x76a4('0x3a')],function(_0x522f64){var _0x417a7d={};_0x417a7d[_0x522f64]={'$like':'%'+_0x3110f5[_0x76a4('0x35')][_0x76a4('0x42')]+'%'};return _0x417a7d;})});}_0x5c808d=_[_0x76a4('0x4b')]({},_0x5c808d,_0x3110f5[_0x76a4('0x43')]);return _0x4db85d['getBlackLists'](_0x5c808d);}})[_0x76a4('0x26')](function(_0x2b116a){if(_0x2b116a){_0x100da3=_0x2b116a[_0x76a4('0x3c')];if(!_0x3110f5[_0x76a4('0x35')]['hasOwnProperty'](_0x76a4('0x5d'))){_0x5c808d[_0x76a4('0x1f')]=qs[_0x76a4('0x1f')](_0x3110f5['query']['limit']);_0x5c808d['offset']=qs[_0x76a4('0x1d')](_0x3110f5['query']['offset']);}return _0x4db85d[_0x76a4('0x90')](_0x5c808d);}})[_0x76a4('0x26')](function(_0x2094ed){if(_0x2094ed){return _0x2094ed?{'count':_0x100da3,'rows':_0x2094ed}:null;}})['then'](respondWithResult(_0x2f2fe2,null))[_0x76a4('0x48')](handleError(_0x2f2fe2,null));};exports[_0x76a4('0x91')]=function(_0x29c2ab,_0x2a204a,_0x18cdaa){var _0x3a7c01,_0xc07122;var _0x30c180=[];var _0x1834f3=moment()[_0x76a4('0x66')](_0x76a4('0x67'));return db[_0x76a4('0x31')][_0x76a4('0x4c')]({'where':{'id':_0x29c2ab[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x2a204a,null))[_0x76a4('0x26')](function(_0x51f367){if(_0x51f367){_0xc07122=_0x51f367;return _0x51f367[_0x76a4('0x91')](_0x29c2ab[_0x76a4('0x4e')][_0x76a4('0x69')],_[_0x76a4('0x57')](_0x29c2ab[_0x76a4('0x4e')],[_0x76a4('0x69'),'id'])||{});}return null;})[_0x76a4('0x6a')](function(_0x528ae2){var _0xcd1023;var _0x123d0a;_0x3a7c01=_0x528ae2||[];var _0x46433e=[];if(_0x528ae2){for(var _0x5a2b88=0x0;_0x5a2b88<_0x528ae2['length'];_0x5a2b88+=0x1){var _0x347f68=_0x528ae2[_0x5a2b88]['get']({'plain':!![]});_0xcd1023=squel[_0x76a4('0x6d')]()[_0x76a4('0x6e')](_0x76a4('0x92'))['fromQuery']([_0x76a4('0x6f'),_0x76a4('0x71'),'ListId',_0x76a4('0x5e'),_0x76a4('0x58'),'updatedAt'],squel[_0x76a4('0x72')]()['field'](_0x76a4('0x6f'),_0x76a4('0x6f'))[_0x76a4('0x73')]('id',_0x76a4('0x71'))[_0x76a4('0x73')](_0x347f68['CmListId'][_0x76a4('0x75')](),_0x76a4('0x81'))[_0x76a4('0x73')](_0x29c2ab[_0x76a4('0x4a')]['id'][_0x76a4('0x75')](),_0x76a4('0x5e'))[_0x76a4('0x73')](_0x76a4('0x74'),_0x76a4('0x58'))[_0x76a4('0x73')]('NOW()',_0x76a4('0x59'))['from'](_0x76a4('0x77'))[_0x76a4('0x40')](_0x76a4('0x78'))['where'](_0x76a4('0x79'),_0x347f68[_0x76a4('0x7a')][_0x76a4('0x75')]())[_0x76a4('0x40')](_0x76a4('0x82')))[_0x76a4('0x75')]();_0x46433e[_0x76a4('0x8c')](db[_0x76a4('0x8d')]['query'](_0xcd1023));}return BPromise[_0x76a4('0x8e')](_0x46433e);}})[_0x76a4('0x26')](function(){return _0x3a7c01;})[_0x76a4('0x26')](respondWithResult(_0x2a204a,null))[_0x76a4('0x48')](handleError(_0x2a204a,null));};exports[_0x76a4('0x93')]=function(_0x5114a0,_0x2d8f1a,_0xdf273b){return db[_0x76a4('0x31')][_0x76a4('0x4c')]({'where':{'id':_0x5114a0['params']['id']}})['then'](handleEntityNotFound(_0x2d8f1a,null))[_0x76a4('0x26')](function(_0xa23a02){if(_0xa23a02){return _0xa23a02[_0x76a4('0x93')](_0x5114a0[_0x76a4('0x35')][_0x76a4('0x69')]);}})[_0x76a4('0x26')](function(_0x27502d){if(_0x27502d){return db[_0x76a4('0x63')]['destroy']({'where':{'ListId':_0x5114a0[_0x76a4('0x35')][_0x76a4('0x69')],'CampaignId':_0x5114a0['params']['id']}})['then'](function(){return _0x27502d;});}})[_0x76a4('0x26')](respondWithStatusCode(_0x2d8f1a,null))[_0x76a4('0x48')](handleError(_0x2d8f1a,null));};
\ No newline at end of file
+var _0x7543=['createdAt','updatedAt','role','userProfileId','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','include','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into','cm_hopper','scheduledAt','ContactId','ListId','select','field','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','insert','fromQuery','NOW()','ListId\x20=\x20?','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','status','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','Campaign','includeAll','rows','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7543,0xca));var _0x3754=function(_0x2052cc,_0x4f76dc){_0x2052cc=_0x2052cc-0x0;var _0x58609f=_0x7543[_0x2052cc];return _0x58609f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3754('0x0'));var zipdir=require(_0x3754('0x1'));var jsonpatch=require(_0x3754('0x2'));var rp=require(_0x3754('0x3'));var moment=require(_0x3754('0x4'));var BPromise=require(_0x3754('0x5'));var Mustache=require(_0x3754('0x6'));var util=require(_0x3754('0x7'));var path=require(_0x3754('0x8'));var sox=require(_0x3754('0x9'));var csv=require(_0x3754('0xa'));var ejs=require(_0x3754('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3754('0xc'));var squel=require(_0x3754('0xd'));var crypto=require(_0x3754('0xe'));var jsforce=require(_0x3754('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3754('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3754('0x10'));var authService=require(_0x3754('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3754('0x12'));var hardwareService=require(_0x3754('0x13'));var logger=require(_0x3754('0x14'))(_0x3754('0x15'));var utils=require(_0x3754('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3754('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318523,_0x416fd8){_0x416fd8=_0x416fd8||0xcc;return function(_0x4879da){if(_0x4879da){return _0x318523['sendStatus'](_0x416fd8);}return _0x318523['status'](_0x416fd8)['end']();};}function respondWithResult(_0x367e4a,_0x5c5152){_0x5c5152=_0x5c5152||0xc8;return function(_0x46d0e3){if(_0x46d0e3){return _0x367e4a['status'](_0x5c5152)[_0x3754('0x18')](_0x46d0e3);}};}function respondWithFilteredResult(_0x24a2a5,_0x5cb2a5){return function(_0x89d91f){if(_0x89d91f){var _0x5ce0d0=typeof _0x5cb2a5[_0x3754('0x19')]===_0x3754('0x1a')&&typeof _0x5cb2a5[_0x3754('0x1b')]===_0x3754('0x1a');var _0x208200=_0x89d91f[_0x3754('0x1c')];var _0x571225=_0x5ce0d0?0x0:_0x5cb2a5[_0x3754('0x19')];var _0x4983cc=_0x5ce0d0?_0x89d91f[_0x3754('0x1c')]:_0x5cb2a5['offset']+_0x5cb2a5[_0x3754('0x1b')];var _0x36f2b1;if(_0x4983cc>=_0x208200){_0x4983cc=_0x208200;_0x36f2b1=0xc8;}else{_0x36f2b1=0xce;}_0x24a2a5['status'](_0x36f2b1);return _0x24a2a5[_0x3754('0x1d')](_0x3754('0x1e'),_0x571225+'-'+_0x4983cc+'/'+_0x208200)[_0x3754('0x18')](_0x89d91f);}return null;};}function patchUpdates(_0x5762cc){return function(_0x31999f){try{jsonpatch[_0x3754('0x1f')](_0x31999f,_0x5762cc,!![]);}catch(_0xbe0cfc){return BPromise[_0x3754('0x20')](_0xbe0cfc);}return _0x31999f['save']();};}function saveUpdates(_0x1d3f2f,_0x24bd78){return function(_0x20ed49){if(_0x20ed49){return _0x20ed49[_0x3754('0x21')](_0x1d3f2f)[_0x3754('0x22')](function(_0x41e49d){return _0x41e49d;});}return null;};}function removeEntity(_0x17ce16,_0x4ff03d){return function(_0x2751f1){if(_0x2751f1){return _0x2751f1[_0x3754('0x23')]()['then'](function(){var _0x43a878=_0x2751f1[_0x3754('0x24')]({'plain':!![]});var _0x1ca092=_0x3754('0x25');return db[_0x3754('0x26')][_0x3754('0x23')]({'where':{'type':_0x1ca092,'resourceId':_0x43a878['id']}})[_0x3754('0x22')](function(){return _0x2751f1;});})['then'](function(){_0x17ce16[_0x3754('0x27')](0xcc)[_0x3754('0x28')]();});}};}function handleEntityNotFound(_0x78f082,_0x16d172){return function(_0x510783){if(!_0x510783){_0x78f082[_0x3754('0x29')](0x194);}return _0x510783;};}function handleError(_0x29c3b9,_0x2a4d0c){_0x2a4d0c=_0x2a4d0c||0x1f4;return function(_0x27a327){logger[_0x3754('0x2a')](_0x27a327[_0x3754('0x2b')]);if(_0x27a327['name']){delete _0x27a327[_0x3754('0x2c')];}_0x29c3b9[_0x3754('0x27')](_0x2a4d0c)[_0x3754('0x2d')](_0x27a327);};}exports[_0x3754('0x2e')]=function(_0x335f4e,_0x181977){var _0x5311a6={},_0x578958={},_0x2fe498={'count':0x0,'rows':[]};var _0x1688eb=_[_0x3754('0x2f')](db['Campaign'][_0x3754('0x30')],function(_0x48426c){return{'name':_0x48426c[_0x3754('0x31')],'type':_0x48426c[_0x3754('0x32')][_0x3754('0x33')]};});_0x578958[_0x3754('0x34')]=_[_0x3754('0x2f')](_0x1688eb,_0x3754('0x2c'));_0x578958[_0x3754('0x35')]=_['keys'](_0x335f4e[_0x3754('0x35')]);_0x578958['filters']=_[_0x3754('0x36')](_0x578958['model'],_0x578958[_0x3754('0x35')]);_0x5311a6[_0x3754('0x37')]=_[_0x3754('0x36')](_0x578958[_0x3754('0x34')],qs[_0x3754('0x38')](_0x335f4e['query'][_0x3754('0x38')]));_0x5311a6[_0x3754('0x37')]=_0x5311a6[_0x3754('0x37')][_0x3754('0x39')]?_0x5311a6[_0x3754('0x37')]:_0x578958[_0x3754('0x34')];if(!_0x335f4e[_0x3754('0x35')][_0x3754('0x3a')](_0x3754('0x3b'))){_0x5311a6[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x335f4e['query'][_0x3754('0x1b')]);_0x5311a6[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x335f4e[_0x3754('0x35')][_0x3754('0x19')]);}_0x5311a6[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x335f4e[_0x3754('0x35')][_0x3754('0x3d')]);_0x5311a6[_0x3754('0x3e')]=qs[_0x3754('0x3f')](_[_0x3754('0x40')](_0x335f4e[_0x3754('0x35')],_0x578958[_0x3754('0x3f')]),_0x1688eb);if(_0x335f4e[_0x3754('0x35')]['filter']){_0x5311a6[_0x3754('0x3e')]=_[_0x3754('0x41')](_0x5311a6[_0x3754('0x3e')],{'$or':_['map'](_0x1688eb,function(_0xa95b07){if(_0xa95b07['type']!=='VIRTUAL'){var _0x55c205={};_0x55c205[_0xa95b07['name']]={'$like':'%'+_0x335f4e[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x55c205;}})});}_0x5311a6=_[_0x3754('0x41')]({},_0x5311a6,_0x335f4e[_0x3754('0x43')]);var _0x3a60c5={'where':_0x5311a6[_0x3754('0x3e')]};return db[_0x3754('0x44')][_0x3754('0x1c')](_0x3a60c5)['then'](function(_0x54bd3a){_0x2fe498[_0x3754('0x1c')]=_0x54bd3a;if(_0x335f4e[_0x3754('0x35')][_0x3754('0x45')]){_0x5311a6['include']=[{'all':!![]}];}return db[_0x3754('0x44')]['findAll'](_0x5311a6);})[_0x3754('0x22')](function(_0x5e41c4){_0x2fe498[_0x3754('0x46')]=_0x5e41c4;return _0x2fe498;})[_0x3754('0x22')](respondWithFilteredResult(_0x181977,_0x5311a6))['catch'](handleError(_0x181977,null));};exports['show']=function(_0x1b4f9c,_0x3e54b7){var _0x3b881e={'raw':![],'where':{'id':_0x1b4f9c[_0x3754('0x47')]['id']}},_0x2b06e1={};_0x2b06e1[_0x3754('0x34')]=_[_0x3754('0x48')](db[_0x3754('0x44')][_0x3754('0x30')]);_0x2b06e1['query']=_['keys'](_0x1b4f9c[_0x3754('0x35')]);_0x2b06e1[_0x3754('0x3f')]=_[_0x3754('0x36')](_0x2b06e1['model'],_0x2b06e1[_0x3754('0x35')]);_0x3b881e['attributes']=_[_0x3754('0x36')](_0x2b06e1[_0x3754('0x34')],qs[_0x3754('0x38')](_0x1b4f9c[_0x3754('0x35')][_0x3754('0x38')]));_0x3b881e[_0x3754('0x37')]=_0x3b881e[_0x3754('0x37')][_0x3754('0x39')]?_0x3b881e[_0x3754('0x37')]:_0x2b06e1[_0x3754('0x34')];if(_0x1b4f9c[_0x3754('0x35')][_0x3754('0x45')]){_0x3b881e['include']=[{'all':!![]}];}_0x3b881e=_['merge']({},_0x3b881e,_0x1b4f9c[_0x3754('0x43')]);return db['Campaign'][_0x3754('0x49')](_0x3b881e)[_0x3754('0x22')](handleEntityNotFound(_0x3e54b7,null))['then'](respondWithResult(_0x3e54b7,null))[_0x3754('0x4a')](handleError(_0x3e54b7,null));};exports[_0x3754('0x4b')]=function(_0xad7f3a,_0x4d9d89){return db[_0x3754('0x44')]['create'](_0xad7f3a[_0x3754('0x4c')],{})[_0x3754('0x22')](function(_0x4648d1){var _0x440893=_0xad7f3a[_0x3754('0x4d')][_0x3754('0x24')]({'plain':!![]});if(!_0x440893)throw new Error(_0x3754('0x4e'));if(_0x440893['role']==='user'){var _0x42ab00=_0x4648d1[_0x3754('0x24')]({'plain':!![]});var _0x218b7b='IvrCampaigns';return db[_0x3754('0x4f')][_0x3754('0x49')]({'where':{'name':_0x218b7b,'userProfileId':_0x440893['userProfileId']},'raw':!![]})[_0x3754('0x22')](function(_0x38a4f7){if(_0x38a4f7&&_0x38a4f7[_0x3754('0x50')]===0x0){return db[_0x3754('0x26')]['create']({'name':_0x42ab00[_0x3754('0x2c')],'resourceId':_0x42ab00['id'],'type':_0x38a4f7[_0x3754('0x2c')],'sectionId':_0x38a4f7['id']},{})[_0x3754('0x22')](function(){return _0x4648d1;});}else{return _0x4648d1;}})[_0x3754('0x4a')](function(_0x4a6f88){logger[_0x3754('0x2a')](_0x3754('0x51'),_0x4a6f88);throw _0x4a6f88;});}return _0x4648d1;})[_0x3754('0x22')](respondWithResult(_0x4d9d89,0xc9))[_0x3754('0x4a')](handleError(_0x4d9d89,null));};exports[_0x3754('0x52')]=function(_0x284e8e,_0x4e2cbd){var _0x5deb09={'where':{'id':_0x284e8e['params']['id']}},_0x38e1fc={};_0x38e1fc['model']=_[_0x3754('0x48')](db[_0x3754('0x44')][_0x3754('0x30')]);_0x5deb09[_0x3754('0x37')]=_[_0x3754('0x36')](_0x38e1fc[_0x3754('0x34')],qs['fields'](_0x284e8e[_0x3754('0x35')][_0x3754('0x38')]));_0x5deb09['attributes']=_0x5deb09[_0x3754('0x37')][_0x3754('0x39')]?_0x5deb09[_0x3754('0x37')]:_0x38e1fc['model'];if(_0x284e8e[_0x3754('0x35')]['includeAll']){_0x5deb09['include']=[{'all':!![]}];}_0x5deb09=_[_0x3754('0x41')]({},_0x5deb09,_0x284e8e['options']);return db[_0x3754('0x44')][_0x3754('0x49')](_0x5deb09)[_0x3754('0x22')](handleEntityNotFound(_0x4e2cbd,null))[_0x3754('0x22')](function(_0x1d683b){if(_0x1d683b){var _0x3f4540=_0x1d683b[_0x3754('0x24')]({'plain':!![]});_0x3f4540=qs[_0x3754('0x53')](_0x3f4540,['id',_0x3754('0x54'),_0x3754('0x55')]);_0x284e8e['body']=_[_0x3754('0x53')](_0x284e8e['body'],['id',_0x3754('0x54'),_0x3754('0x55')]);return db['Campaign']['create'](_[_0x3754('0x41')](_0x3f4540,_0x284e8e[_0x3754('0x4c')]),{'include':_0x284e8e[_0x3754('0x35')][_0x3754('0x45')]?[{'all':!![]}]:undefined})[_0x3754('0x22')](function(_0x12e47f){var _0x1cf88c=_0x284e8e['user']['get']({'plain':!![]});if(!_0x1cf88c)throw new Error(_0x3754('0x4e'));if(_0x1cf88c[_0x3754('0x56')]===_0x3754('0x4d')){var _0x36922e=_0x12e47f['get']({'plain':!![]});var _0x584d40=_0x3754('0x25');return db[_0x3754('0x4f')]['find']({'where':{'name':_0x584d40,'userProfileId':_0x1cf88c[_0x3754('0x57')]},'raw':!![]})[_0x3754('0x22')](function(_0x4915f9){if(_0x4915f9&&_0x4915f9[_0x3754('0x50')]===0x0){return db['UserProfileResource'][_0x3754('0x4b')]({'name':_0x36922e['name'],'resourceId':_0x36922e['id'],'type':_0x4915f9[_0x3754('0x2c')],'sectionId':_0x4915f9['id']},{})[_0x3754('0x22')](function(){return _0x12e47f;});}else{return _0x12e47f;}})[_0x3754('0x4a')](function(_0x56edc8){logger[_0x3754('0x2a')](_0x3754('0x51'),_0x56edc8);throw _0x56edc8;});}return _0x12e47f;});}})[_0x3754('0x22')](respondWithResult(_0x4e2cbd,0xc9))[_0x3754('0x4a')](handleError(_0x4e2cbd,null));};exports[_0x3754('0x21')]=function(_0x3ac683,_0x307ade){if(_0x3ac683[_0x3754('0x4c')]['id']){delete _0x3ac683['body']['id'];}return db[_0x3754('0x44')][_0x3754('0x49')]({'where':{'id':_0x3ac683[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x307ade,null))['then'](saveUpdates(_0x3ac683[_0x3754('0x4c')],null))[_0x3754('0x22')](respondWithResult(_0x307ade,null))[_0x3754('0x4a')](handleError(_0x307ade,null));};exports['destroy']=function(_0x19670a,_0x298ef1){return db[_0x3754('0x44')][_0x3754('0x49')]({'where':{'id':_0x19670a[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x298ef1,null))['then'](removeEntity(_0x298ef1,null))[_0x3754('0x4a')](handleError(_0x298ef1,null));};exports[_0x3754('0x58')]=function(_0x2f9418,_0x59ca00,_0xda5db3){var _0x46ec64={'raw':!![],'where':{}};var _0x4d6db2={};var _0x1832e9={'count':0x0,'rows':[]};return db[_0x3754('0x44')][_0x3754('0x59')]({'where':{'id':_0x2f9418[_0x3754('0x47')]['id']}})['then'](handleEntityNotFound(_0x59ca00,null))[_0x3754('0x22')](function(_0x395760){if(_0x395760){_0x4d6db2[_0x3754('0x34')]=_[_0x3754('0x48')](db[_0x3754('0x5a')][_0x3754('0x30')]);_0x4d6db2['query']=_[_0x3754('0x48')](_0x2f9418[_0x3754('0x35')]);_0x4d6db2[_0x3754('0x3f')]=_[_0x3754('0x36')](_0x4d6db2[_0x3754('0x34')],_0x4d6db2[_0x3754('0x35')]);_0x46ec64[_0x3754('0x37')]=_['intersection'](_0x4d6db2[_0x3754('0x34')],qs[_0x3754('0x38')](_0x2f9418['query'][_0x3754('0x38')]));_0x46ec64[_0x3754('0x37')]=_0x46ec64[_0x3754('0x37')][_0x3754('0x39')]?_0x46ec64['attributes']:_0x4d6db2[_0x3754('0x34')];if(!_0x2f9418[_0x3754('0x35')][_0x3754('0x3a')](_0x3754('0x3b'))){_0x46ec64['limit']=qs[_0x3754('0x1b')](_0x2f9418[_0x3754('0x35')][_0x3754('0x1b')]);_0x46ec64[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x2f9418['query'][_0x3754('0x19')]);}_0x46ec64[_0x3754('0x3c')]=qs['sort'](_0x2f9418[_0x3754('0x35')]['sort']);_0x46ec64['where']=qs['filters'](_[_0x3754('0x40')](_0x2f9418[_0x3754('0x35')],_0x4d6db2['filters']));_0x46ec64[_0x3754('0x3e')][_0x3754('0x5b')]=_0x395760['id'];if(_0x2f9418[_0x3754('0x35')][_0x3754('0x42')]){_0x46ec64[_0x3754('0x3e')]=_[_0x3754('0x41')](_0x46ec64['where'],{'$or':_[_0x3754('0x2f')](_0x46ec64[_0x3754('0x37')],function(_0x546d3a){var _0x4edcc={};_0x4edcc[_0x546d3a]={'$like':'%'+_0x2f9418[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x4edcc;})});}_0x46ec64=_[_0x3754('0x41')]({},_0x46ec64,_0x2f9418['options']);return db[_0x3754('0x5a')][_0x3754('0x1c')]({'where':_0x46ec64[_0x3754('0x3e')]})[_0x3754('0x22')](function(_0x33236c){_0x1832e9[_0x3754('0x1c')]=_0x33236c;if(_0x2f9418['query'][_0x3754('0x45')]){_0x46ec64['include']=[{'all':!![]}];}return db[_0x3754('0x5a')][_0x3754('0x5c')](_0x46ec64);})['then'](function(_0x57d507){_0x1832e9['rows']=_0x57d507;return _0x1832e9;});}})[_0x3754('0x22')](respondWithFilteredResult(_0x59ca00,_0x46ec64))['catch'](handleError(_0x59ca00,null));};exports[_0x3754('0x5d')]=function(_0x5dda69,_0x2c3733,_0x4668a3){var _0xeeffed={'raw':!![],'where':{}};var _0x3a4d3e={};var _0x2df519={'count':0x0,'rows':[]};return db['Campaign'][_0x3754('0x59')]({'where':{'id':_0x5dda69[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x2c3733,null))[_0x3754('0x22')](function(_0x287028){if(_0x287028){_0x3a4d3e['model']=_[_0x3754('0x48')](db['CmHopperHistory']['rawAttributes']);_0x3a4d3e[_0x3754('0x35')]=_[_0x3754('0x48')](_0x5dda69['query']);_0x3a4d3e['filters']=_[_0x3754('0x36')](_0x3a4d3e['model'],_0x3a4d3e[_0x3754('0x35')]);_0xeeffed['attributes']=_[_0x3754('0x36')](_0x3a4d3e['model'],qs[_0x3754('0x38')](_0x5dda69[_0x3754('0x35')][_0x3754('0x38')]));_0xeeffed[_0x3754('0x37')]=_0xeeffed['attributes']['length']?_0xeeffed['attributes']:_0x3a4d3e[_0x3754('0x34')];if(!_0x5dda69['query']['hasOwnProperty']('nolimit')){_0xeeffed['limit']=qs[_0x3754('0x1b')](_0x5dda69[_0x3754('0x35')][_0x3754('0x1b')]);_0xeeffed[_0x3754('0x19')]=qs['offset'](_0x5dda69[_0x3754('0x35')][_0x3754('0x19')]);}_0xeeffed[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x5dda69[_0x3754('0x35')][_0x3754('0x3d')]);_0xeeffed['where']=qs['filters'](_[_0x3754('0x40')](_0x5dda69[_0x3754('0x35')],_0x3a4d3e[_0x3754('0x3f')]));_0xeeffed[_0x3754('0x3e')]['CampaignId']=_0x287028['id'];if(_0x5dda69[_0x3754('0x35')][_0x3754('0x42')]){_0xeeffed[_0x3754('0x3e')]=_['merge'](_0xeeffed[_0x3754('0x3e')],{'$or':_['map'](_0xeeffed[_0x3754('0x37')],function(_0x30499e){var _0x4c4e86={};_0x4c4e86[_0x30499e]={'$like':'%'+_0x5dda69[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x4c4e86;})});}_0xeeffed=_[_0x3754('0x41')]({},_0xeeffed,_0x5dda69[_0x3754('0x43')]);return db[_0x3754('0x5e')][_0x3754('0x1c')]({'where':_0xeeffed[_0x3754('0x3e')]})[_0x3754('0x22')](function(_0x491261){_0x2df519[_0x3754('0x1c')]=_0x491261;if(_0x5dda69[_0x3754('0x35')]['includeAll']){_0xeeffed['include']=[{'all':!![]}];}return db[_0x3754('0x5e')]['findAll'](_0xeeffed);})[_0x3754('0x22')](function(_0x2f65bd){_0x2df519['rows']=_0x2f65bd;return _0x2df519;});}})['then'](respondWithFilteredResult(_0x2c3733,_0xeeffed))[_0x3754('0x4a')](handleError(_0x2c3733,null));};exports[_0x3754('0x5f')]=function(_0x2ceb89,_0x5d96f2,_0x66703f){var _0x2c90d1={'raw':!![],'where':{}};var _0x136107={};var _0x11516e={'count':0x0,'rows':[]};return db[_0x3754('0x44')][_0x3754('0x59')]({'where':{'id':_0x2ceb89[_0x3754('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d96f2,null))[_0x3754('0x22')](function(_0x3409ed){if(_0x3409ed){_0x136107['model']=_['keys'](db[_0x3754('0x60')][_0x3754('0x30')]);_0x136107[_0x3754('0x35')]=_[_0x3754('0x48')](_0x2ceb89[_0x3754('0x35')]);_0x136107[_0x3754('0x3f')]=_[_0x3754('0x36')](_0x136107[_0x3754('0x34')],_0x136107[_0x3754('0x35')]);_0x2c90d1[_0x3754('0x37')]=_[_0x3754('0x36')](_0x136107[_0x3754('0x34')],qs[_0x3754('0x38')](_0x2ceb89[_0x3754('0x35')]['fields']));_0x2c90d1['attributes']=_0x2c90d1[_0x3754('0x37')][_0x3754('0x39')]?_0x2c90d1[_0x3754('0x37')]:_0x136107[_0x3754('0x34')];if(!_0x2ceb89[_0x3754('0x35')][_0x3754('0x3a')](_0x3754('0x3b'))){_0x2c90d1[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x2ceb89[_0x3754('0x35')]['limit']);_0x2c90d1[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x2ceb89[_0x3754('0x35')][_0x3754('0x19')]);}_0x2c90d1[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x2ceb89[_0x3754('0x35')]['sort']);_0x2c90d1[_0x3754('0x3e')]=qs['filters'](_[_0x3754('0x40')](_0x2ceb89[_0x3754('0x35')],_0x136107[_0x3754('0x3f')]));_0x2c90d1[_0x3754('0x3e')][_0x3754('0x5b')]=_0x3409ed['id'];if(_0x2ceb89[_0x3754('0x35')][_0x3754('0x42')]){_0x2c90d1[_0x3754('0x3e')]=_['merge'](_0x2c90d1['where'],{'$or':_['map'](_0x2c90d1[_0x3754('0x37')],function(_0x2f6b4e){var _0x4afb7e={};_0x4afb7e[_0x2f6b4e]={'$like':'%'+_0x2ceb89[_0x3754('0x35')]['filter']+'%'};return _0x4afb7e;})});}_0x2c90d1=_[_0x3754('0x41')]({},_0x2c90d1,_0x2ceb89[_0x3754('0x43')]);return db[_0x3754('0x60')][_0x3754('0x1c')]({'where':_0x2c90d1[_0x3754('0x3e')]})['then'](function(_0x4025e0){_0x11516e['count']=_0x4025e0;if(_0x2ceb89[_0x3754('0x35')][_0x3754('0x45')]){_0x2c90d1[_0x3754('0x61')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3754('0x5c')](_0x2c90d1);})[_0x3754('0x22')](function(_0x53d0b7){_0x11516e['rows']=_0x53d0b7;return _0x11516e;});}})[_0x3754('0x22')](respondWithFilteredResult(_0x5d96f2,_0x2c90d1))[_0x3754('0x4a')](handleError(_0x5d96f2,null));};exports['getHopperBlacks']=function(_0x5665d5,_0x2a48ce,_0x5f1a4d){var _0x23b949={'raw':!![],'where':{}};var _0x3b2249={};var _0x50b74a={'count':0x0,'rows':[]};return db['Campaign'][_0x3754('0x59')]({'where':{'id':_0x5665d5['params']['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x2a48ce,null))[_0x3754('0x22')](function(_0x4b3810){if(_0x4b3810){_0x3b2249[_0x3754('0x34')]=_[_0x3754('0x48')](db['CmHopperBlack'][_0x3754('0x30')]);_0x3b2249[_0x3754('0x35')]=_[_0x3754('0x48')](_0x5665d5[_0x3754('0x35')]);_0x3b2249[_0x3754('0x3f')]=_[_0x3754('0x36')](_0x3b2249[_0x3754('0x34')],_0x3b2249['query']);_0x23b949[_0x3754('0x37')]=_[_0x3754('0x36')](_0x3b2249[_0x3754('0x34')],qs[_0x3754('0x38')](_0x5665d5[_0x3754('0x35')][_0x3754('0x38')]));_0x23b949['attributes']=_0x23b949[_0x3754('0x37')][_0x3754('0x39')]?_0x23b949[_0x3754('0x37')]:_0x3b2249[_0x3754('0x34')];if(!_0x5665d5['query'][_0x3754('0x3a')]('nolimit')){_0x23b949[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x5665d5[_0x3754('0x35')][_0x3754('0x1b')]);_0x23b949[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x5665d5['query'][_0x3754('0x19')]);}_0x23b949['order']=qs[_0x3754('0x3d')](_0x5665d5[_0x3754('0x35')][_0x3754('0x3d')]);_0x23b949[_0x3754('0x3e')]=qs['filters'](_['pick'](_0x5665d5['query'],_0x3b2249[_0x3754('0x3f')]));_0x23b949[_0x3754('0x3e')][_0x3754('0x5b')]=_0x4b3810['id'];if(_0x5665d5[_0x3754('0x35')]['filter']){_0x23b949[_0x3754('0x3e')]=_['merge'](_0x23b949['where'],{'$or':_[_0x3754('0x2f')](_0x23b949[_0x3754('0x37')],function(_0x1b43d9){var _0x51374c={};_0x51374c[_0x1b43d9]={'$like':'%'+_0x5665d5[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x51374c;})});}_0x23b949=_[_0x3754('0x41')]({},_0x23b949,_0x5665d5[_0x3754('0x43')]);return db[_0x3754('0x62')][_0x3754('0x1c')]({'where':_0x23b949['where']})[_0x3754('0x22')](function(_0x239b57){_0x50b74a[_0x3754('0x1c')]=_0x239b57;if(_0x5665d5['query'][_0x3754('0x45')]){_0x23b949[_0x3754('0x61')]=[{'all':!![]}];}return db[_0x3754('0x62')][_0x3754('0x5c')](_0x23b949);})[_0x3754('0x22')](function(_0x40c5f9){_0x50b74a[_0x3754('0x46')]=_0x40c5f9;return _0x50b74a;});}})['then'](respondWithFilteredResult(_0x2a48ce,_0x23b949))[_0x3754('0x4a')](handleError(_0x2a48ce,null));};exports[_0x3754('0x63')]=function(_0x27a6a2,_0x5adb27,_0x4501fc){var _0x9aa437={};var _0x4f8ade={};var _0x239a2d;var _0x480e8b;return db[_0x3754('0x44')][_0x3754('0x59')]({'where':{'id':_0x27a6a2[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x5adb27,null))['then'](function(_0xc1a9){if(_0xc1a9){_0x239a2d=_0xc1a9;_0x4f8ade[_0x3754('0x34')]=_['keys'](db[_0x3754('0x64')][_0x3754('0x30')]);_0x4f8ade[_0x3754('0x35')]=_[_0x3754('0x48')](_0x27a6a2[_0x3754('0x35')]);_0x4f8ade[_0x3754('0x3f')]=_['intersection'](_0x4f8ade[_0x3754('0x34')],_0x4f8ade['query']);_0x9aa437[_0x3754('0x37')]=_[_0x3754('0x36')](_0x4f8ade['model'],qs['fields'](_0x27a6a2[_0x3754('0x35')]['fields']));_0x9aa437['attributes']=_0x9aa437[_0x3754('0x37')][_0x3754('0x39')]?_0x9aa437[_0x3754('0x37')]:_0x4f8ade['model'];_0x9aa437[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x27a6a2[_0x3754('0x35')][_0x3754('0x3d')]);_0x9aa437['where']=qs['filters'](_[_0x3754('0x40')](_0x27a6a2[_0x3754('0x35')],_0x4f8ade[_0x3754('0x3f')]));if(_0x27a6a2['query'][_0x3754('0x42')]){_0x9aa437['where']=_[_0x3754('0x41')](_0x9aa437[_0x3754('0x3e')],{'$or':_[_0x3754('0x2f')](_0x9aa437[_0x3754('0x37')],function(_0x24398c){var _0x33ee06={};_0x33ee06[_0x24398c]={'$like':'%'+_0x27a6a2[_0x3754('0x35')][_0x3754('0x42')]+'%'};return _0x33ee06;})});}_0x9aa437=_['merge']({},_0x9aa437,_0x27a6a2[_0x3754('0x43')]);return _0x239a2d[_0x3754('0x63')](_0x9aa437);}})[_0x3754('0x22')](function(_0x35c428){if(_0x35c428){_0x480e8b=_0x35c428[_0x3754('0x39')];if(!_0x27a6a2[_0x3754('0x35')][_0x3754('0x3a')]('nolimit')){_0x9aa437[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x27a6a2[_0x3754('0x35')][_0x3754('0x1b')]);_0x9aa437[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x27a6a2[_0x3754('0x35')]['offset']);}return _0x239a2d[_0x3754('0x63')](_0x9aa437);}})[_0x3754('0x22')](function(_0x454664){if(_0x454664){return _0x454664?{'count':_0x480e8b,'rows':_0x454664}:null;}})[_0x3754('0x22')](respondWithResult(_0x5adb27,null))[_0x3754('0x4a')](handleError(_0x5adb27,null));};exports[_0x3754('0x65')]=function(_0x459c3d,_0xb4a03b,_0x56947a){var _0x3f6b0c,_0xf4d907;var _0x1d906a=[];var _0x18f7fa=moment()[_0x3754('0x66')](_0x3754('0x67'));return db['Campaign']['find']({'where':{'id':_0x459c3d[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0xb4a03b,null))[_0x3754('0x22')](function(_0x13bed4){if(_0x13bed4){_0xf4d907=_0x13bed4;return _0x13bed4[_0x3754('0x65')](_0x459c3d[_0x3754('0x4c')]['ids'],_[_0x3754('0x53')](_0x459c3d[_0x3754('0x4c')],[_0x3754('0x68'),'id'])||{});}return null;})[_0x3754('0x69')](function(_0x5a4e12){var _0x24e85a;var _0x487f75;_0x3f6b0c=_0x5a4e12||[];var _0x101fa8=[];if(_0x5a4e12){for(var _0x4f4a9f=0x0;_0x4f4a9f<_0x5a4e12['length'];_0x4f4a9f+=0x1){var _0x472e03=_0x5a4e12[_0x4f4a9f]['get']({'plain':!![]});_0xf4d907['dialCheckDuplicateType']=_0x459c3d[_0x3754('0x4c')]['dialCheckDuplicateType']?_0x459c3d[_0x3754('0x4c')][_0x3754('0x6a')]:_0xf4d907[_0x3754('0x6a')];switch(_0xf4d907[_0x3754('0x6a')]){case'always':_0x24e85a=squel['insert']()[_0x3754('0x6b')](_0x3754('0x6c'))['fromQuery'](['phone',_0x3754('0x6d'),_0x3754('0x6e'),_0x3754('0x6f'),_0x3754('0x5b'),_0x3754('0x54'),_0x3754('0x55')],squel[_0x3754('0x70')]()[_0x3754('0x71')](_0x3754('0x72'),'phone')[_0x3754('0x71')]('NOW()','scheduledAt')[_0x3754('0x71')]('id',_0x3754('0x6e'))[_0x3754('0x71')](_0x472e03[_0x3754('0x73')][_0x3754('0x74')](),_0x3754('0x6f'))[_0x3754('0x71')](_0x459c3d[_0x3754('0x47')]['id'][_0x3754('0x74')](),_0x3754('0x5b'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27','createdAt')['field']('\x27'+_0x18f7fa+'\x27',_0x3754('0x55'))[_0x3754('0x75')](_0x3754('0x76'))[_0x3754('0x3e')](_0x3754('0x77'))[_0x3754('0x3e')]('ListId\x20=\x20?',_0x472e03[_0x3754('0x73')][_0x3754('0x74')]())[_0x3754('0x3e')](_0x3754('0x78'))['where'](_0x3754('0x79'),squel['select']()[_0x3754('0x71')](_0x3754('0x7a'))[_0x3754('0x75')](_0x3754('0x7b'))[_0x3754('0x3e')]('CampaignId\x20=\x20?',_0x459c3d['params']['id']['toString']()))[_0x3754('0x3e')](_0x3754('0x79'),squel['select']()[_0x3754('0x71')](_0x3754('0x7c'))[_0x3754('0x75')](_0x3754('0x6c'))[_0x3754('0x3e')]('CampaignId\x20=\x20?',_0x459c3d[_0x3754('0x47')]['id'][_0x3754('0x74')]())))[_0x3754('0x74')]();break;case'onlyIfOpen':_0x24e85a=squel[_0x3754('0x7d')]()[_0x3754('0x6b')]('cm_hopper')[_0x3754('0x7e')]([_0x3754('0x72'),_0x3754('0x6d'),_0x3754('0x6e'),_0x3754('0x6f'),_0x3754('0x5b'),_0x3754('0x54'),_0x3754('0x55')],squel[_0x3754('0x70')]()['field'](_0x3754('0x72'),_0x3754('0x72'))[_0x3754('0x71')](_0x3754('0x7f'),'scheduledAt')['field']('id',_0x3754('0x6e'))['field'](_0x472e03['CmListId'][_0x3754('0x74')](),_0x3754('0x6f'))[_0x3754('0x71')](_0x459c3d[_0x3754('0x47')]['id']['toString'](),'CampaignId')[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x54'))['field']('\x27'+_0x18f7fa+'\x27',_0x3754('0x55'))[_0x3754('0x75')](_0x3754('0x76'))[_0x3754('0x3e')](_0x3754('0x77'))[_0x3754('0x3e')](_0x3754('0x80'),_0x472e03[_0x3754('0x73')]['toString']())[_0x3754('0x3e')](_0x3754('0x78'))[_0x3754('0x3e')](_0x3754('0x79'),squel[_0x3754('0x70')]()[_0x3754('0x71')](_0x3754('0x7c'))['from'](_0x3754('0x6c'))[_0x3754('0x3e')]('CampaignId\x20=\x20?',_0x459c3d['params']['id'][_0x3754('0x74')]())))[_0x3754('0x74')]();break;default:_0x24e85a=squel[_0x3754('0x7d')]()[_0x3754('0x6b')](_0x3754('0x6c'))['fromQuery']([_0x3754('0x72'),_0x3754('0x6d'),_0x3754('0x6e'),_0x3754('0x6f'),_0x3754('0x5b'),'createdAt',_0x3754('0x55')],squel['select']()[_0x3754('0x71')](_0x3754('0x72'),_0x3754('0x72'))['field'](_0x3754('0x7f'),_0x3754('0x6d'))[_0x3754('0x71')]('id','ContactId')['field'](_0x472e03[_0x3754('0x73')]['toString'](),_0x3754('0x6f'))['field'](_0x459c3d['params']['id'][_0x3754('0x74')](),_0x3754('0x5b'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x54'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x55'))[_0x3754('0x75')](_0x3754('0x76'))[_0x3754('0x3e')]('deletedAt\x20IS\x20NULL')[_0x3754('0x3e')](_0x3754('0x80'),_0x472e03['CmListId'][_0x3754('0x74')]())['where'](_0x3754('0x78')))[_0x3754('0x74')]();}_0x487f75=squel[_0x3754('0x7d')]()[_0x3754('0x6b')]('cm_hopper_additional_phones')['fromQuery']([_0x3754('0x81'),_0x3754('0x6d'),_0x3754('0x72'),_0x3754('0x82'),'createdAt','updatedAt'],squel[_0x3754('0x70')]()[_0x3754('0x71')]('h.id','id')[_0x3754('0x71')](_0x3754('0x7f'),'scheduledAt')['field']('ci.item',_0x3754('0x72'))[_0x3754('0x71')](_0x3754('0x83'),_0x3754('0x82'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x54'))[_0x3754('0x71')]('\x27'+_0x18f7fa+'\x27',_0x3754('0x55'))[_0x3754('0x75')](_0x3754('0x84'),'ci')[_0x3754('0x85')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x3754('0x3e')]('h.ListId\x20=\x20?',_0x472e03[_0x3754('0x73')][_0x3754('0x74')]())[_0x3754('0x3e')](_0x3754('0x86'),_0x459c3d[_0x3754('0x47')]['id']['toString']())[_0x3754('0x3e')](_0x3754('0x87'),_0x18f7fa))[_0x3754('0x74')]();_0x101fa8[_0x3754('0x88')](db[_0x3754('0x89')][_0x3754('0x35')](_0x24e85a));_0x1d906a[_0x3754('0x88')](db[_0x3754('0x89')][_0x3754('0x35')](_0x487f75));}return BPromise['all'](_0x101fa8);}})[_0x3754('0x22')](function(){return BPromise[_0x3754('0x8a')](_0x1d906a);})[_0x3754('0x22')](function(){return _0x3f6b0c;})['then'](respondWithResult(_0xb4a03b,null))[_0x3754('0x4a')](handleError(_0xb4a03b,null));};exports['removeLists']=function(_0xed1e23,_0x33f9ac,_0x104c22){return db[_0x3754('0x44')][_0x3754('0x49')]({'where':{'id':_0xed1e23['params']['id']}})['then'](handleEntityNotFound(_0x33f9ac,null))[_0x3754('0x22')](function(_0x4f2436){if(_0x4f2436){return _0x4f2436['removeLists'](_0xed1e23[_0x3754('0x35')][_0x3754('0x68')]);}})[_0x3754('0x22')](function(_0x5580a0){if(_0x5580a0){return db[_0x3754('0x5a')]['destroy']({'where':{'ListId':_0xed1e23[_0x3754('0x35')][_0x3754('0x68')],'CampaignId':_0xed1e23['params']['id']}})[_0x3754('0x22')](function(){return _0x5580a0;});}})[_0x3754('0x22')](respondWithStatusCode(_0x33f9ac,null))[_0x3754('0x4a')](handleError(_0x33f9ac,null));};exports['getBlackLists']=function(_0x32a77e,_0x332db5,_0x4c5979){var _0x49c99b={};var _0x337729={};var _0x54edb3;var _0x59c5f3;return db[_0x3754('0x44')][_0x3754('0x59')]({'where':{'id':_0x32a77e[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x332db5,null))['then'](function(_0x3820ef){if(_0x3820ef){_0x54edb3=_0x3820ef;_0x337729[_0x3754('0x34')]=_[_0x3754('0x48')](db[_0x3754('0x64')][_0x3754('0x30')]);_0x337729[_0x3754('0x35')]=_[_0x3754('0x48')](_0x32a77e[_0x3754('0x35')]);_0x337729[_0x3754('0x3f')]=_['intersection'](_0x337729[_0x3754('0x34')],_0x337729[_0x3754('0x35')]);_0x49c99b[_0x3754('0x37')]=_['intersection'](_0x337729[_0x3754('0x34')],qs[_0x3754('0x38')](_0x32a77e[_0x3754('0x35')][_0x3754('0x38')]));_0x49c99b[_0x3754('0x37')]=_0x49c99b['attributes'][_0x3754('0x39')]?_0x49c99b['attributes']:_0x337729['model'];_0x49c99b[_0x3754('0x3c')]=qs[_0x3754('0x3d')](_0x32a77e[_0x3754('0x35')][_0x3754('0x3d')]);_0x49c99b[_0x3754('0x3e')]=qs['filters'](_[_0x3754('0x40')](_0x32a77e['query'],_0x337729['filters']));if(_0x32a77e['query'][_0x3754('0x42')]){_0x49c99b[_0x3754('0x3e')]=_[_0x3754('0x41')](_0x49c99b['where'],{'$or':_['map'](_0x49c99b[_0x3754('0x37')],function(_0x3f2448){var _0x275cc0={};_0x275cc0[_0x3f2448]={'$like':'%'+_0x32a77e['query'][_0x3754('0x42')]+'%'};return _0x275cc0;})});}_0x49c99b=_[_0x3754('0x41')]({},_0x49c99b,_0x32a77e[_0x3754('0x43')]);return _0x54edb3[_0x3754('0x8b')](_0x49c99b);}})[_0x3754('0x22')](function(_0x47f680){if(_0x47f680){_0x59c5f3=_0x47f680['length'];if(!_0x32a77e['query'][_0x3754('0x3a')](_0x3754('0x3b'))){_0x49c99b[_0x3754('0x1b')]=qs[_0x3754('0x1b')](_0x32a77e[_0x3754('0x35')][_0x3754('0x1b')]);_0x49c99b[_0x3754('0x19')]=qs[_0x3754('0x19')](_0x32a77e[_0x3754('0x35')][_0x3754('0x19')]);}return _0x54edb3[_0x3754('0x8b')](_0x49c99b);}})['then'](function(_0x349e62){if(_0x349e62){return _0x349e62?{'count':_0x59c5f3,'rows':_0x349e62}:null;}})[_0x3754('0x22')](respondWithResult(_0x332db5,null))[_0x3754('0x4a')](handleError(_0x332db5,null));};exports[_0x3754('0x8c')]=function(_0x15dbd4,_0x3ca8f2,_0x1d5560){var _0x1d4776,_0xdebc6c;var _0x5edf22=[];var _0x1a8d1d=moment()[_0x3754('0x66')](_0x3754('0x67'));return db[_0x3754('0x44')][_0x3754('0x49')]({'where':{'id':_0x15dbd4[_0x3754('0x47')]['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x3ca8f2,null))[_0x3754('0x22')](function(_0x9357c2){if(_0x9357c2){_0xdebc6c=_0x9357c2;return _0x9357c2[_0x3754('0x8c')](_0x15dbd4[_0x3754('0x4c')][_0x3754('0x68')],_[_0x3754('0x53')](_0x15dbd4[_0x3754('0x4c')],['ids','id'])||{});}return null;})['spread'](function(_0x5215bc){var _0x2ccd63;var _0x39c621;_0x1d4776=_0x5215bc||[];var _0x5150fc=[];if(_0x5215bc){for(var _0xd77e01=0x0;_0xd77e01<_0x5215bc[_0x3754('0x39')];_0xd77e01+=0x1){var _0x31e5f4=_0x5215bc[_0xd77e01][_0x3754('0x24')]({'plain':!![]});_0x2ccd63=squel['insert']()[_0x3754('0x6b')](_0x3754('0x8d'))['fromQuery'](['phone','ContactId','ListId',_0x3754('0x5b'),'createdAt',_0x3754('0x55')],squel[_0x3754('0x70')]()['field'](_0x3754('0x72'),'phone')[_0x3754('0x71')]('id',_0x3754('0x6e'))[_0x3754('0x71')](_0x31e5f4['CmListId']['toString'](),_0x3754('0x6f'))[_0x3754('0x71')](_0x15dbd4[_0x3754('0x47')]['id'][_0x3754('0x74')](),'CampaignId')[_0x3754('0x71')](_0x3754('0x7f'),_0x3754('0x54'))[_0x3754('0x71')](_0x3754('0x7f'),'updatedAt')[_0x3754('0x75')](_0x3754('0x76'))['where'](_0x3754('0x77'))[_0x3754('0x3e')](_0x3754('0x80'),_0x31e5f4['CmListId']['toString']())['where'](_0x3754('0x78')))[_0x3754('0x74')]();_0x5150fc[_0x3754('0x88')](db[_0x3754('0x89')][_0x3754('0x35')](_0x2ccd63));}return BPromise['all'](_0x5150fc);}})[_0x3754('0x22')](function(){return _0x1d4776;})['then'](respondWithResult(_0x3ca8f2,null))[_0x3754('0x4a')](handleError(_0x3ca8f2,null));};exports[_0x3754('0x8e')]=function(_0x4fa2fa,_0x294b20,_0x526138){return db['Campaign']['find']({'where':{'id':_0x4fa2fa['params']['id']}})[_0x3754('0x22')](handleEntityNotFound(_0x294b20,null))[_0x3754('0x22')](function(_0x2aff7c){if(_0x2aff7c){return _0x2aff7c[_0x3754('0x8e')](_0x4fa2fa[_0x3754('0x35')][_0x3754('0x68')]);}})[_0x3754('0x22')](function(_0x5f04f0){if(_0x5f04f0){return db['CmHopperBlack'][_0x3754('0x23')]({'where':{'ListId':_0x4fa2fa[_0x3754('0x35')][_0x3754('0x68')],'CampaignId':_0x4fa2fa['params']['id']}})[_0x3754('0x22')](function(){return _0x5f04f0;});}})[_0x3754('0x22')](respondWithStatusCode(_0x294b20,null))['catch'](handleError(_0x294b20,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index de050e4..7b48770 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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xb509c2,_0xc778dd){var _0x1a63e1=function(_0x29b224){while(--_0x29b224){_0xb509c2['push'](_0xb509c2['shift']());}};_0x1a63e1(++_0xc778dd);}(_0x7a54,0x106));var _0x47a5=function(_0x192b30,_0x5c7525){_0x192b30=_0x192b30-0x0;var _0x1873fb=_0x7a54[_0x192b30];return _0x1873fb;};'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 0694116..112f5f9 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 _0x18a9=['raw','where','attributes','include','model','map','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','options'];(function(_0x4c4d44,_0x199ab7){var _0x23af06=function(_0x1168c6){while(--_0x1168c6){_0x4c4d44['push'](_0x4c4d44['shift']());}};_0x23af06(++_0x199ab7);}(_0x18a9,0x15b));var _0x918a=function(_0x57d41c,_0x4a16e8){_0x57d41c=_0x57d41c-0x0;var _0x5d9d9e=_0x18a9[_0x57d41c];return _0x5d9d9e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x918a('0x0'));var BPromise=require(_0x918a('0x1'));var rs=require(_0x918a('0x2'));var fs=require('fs');var Redis=require(_0x918a('0x3'));var db=require(_0x918a('0x4'))['db'];var utils=require(_0x918a('0x5'));var logger=require(_0x918a('0x6'))(_0x918a('0x7'));var config=require(_0x918a('0x8'));var jayson=require(_0x918a('0x9'));var client=jayson[_0x918a('0xa')][_0x918a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492c39,_0xdb8dd8,_0x266256){return new BPromise(function(_0x51caca,_0x40518f){return client[_0x918a('0xc')](_0x492c39,_0x266256)[_0x918a('0xd')](function(_0x224a87){logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,_0x918a('0x10'));logger['debug'](_0x918a('0x11'),_0xdb8dd8,_0x918a('0x10'),JSON[_0x918a('0x12')](_0x224a87));if(_0x224a87[_0x918a('0x13')]){if(_0x224a87['error'][_0x918a('0x14')]===0x1f4){logger[_0x918a('0x13')]('Campaign,\x20%s,\x20%s',_0xdb8dd8,_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);return _0x40518f(_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);}logger['error'](_0x918a('0xf'),_0xdb8dd8,_0x224a87['error'][_0x918a('0x15')]);return _0x51caca(_0x224a87['error']['message']);}else{logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,'request\x20sent');_0x51caca(_0x224a87[_0x918a('0x16')]['message']);}})[_0x918a('0x17')](function(_0x17f988){logger[_0x918a('0x13')]('Campaign,\x20%s,\x20%s',_0xdb8dd8,_0x17f988);_0x40518f(_0x17f988);});});}exports[_0x918a('0x18')]=function(_0x51e467){var _0x199eb1=this;return new Promise(function(_0x22e347,_0x38ca45){return db[_0x918a('0x19')]['findAll']({'raw':_0x51e467[_0x918a('0x1a')]?_0x51e467[_0x918a('0x1a')][_0x918a('0x1b')]===undefined?!![]:![]:!![],'where':_0x51e467[_0x918a('0x1a')]?_0x51e467[_0x918a('0x1a')][_0x918a('0x1c')]||null:null,'attributes':_0x51e467[_0x918a('0x1a')]?_0x51e467['options'][_0x918a('0x1d')]||null:null,'limit':_0x51e467['options']?_0x51e467[_0x918a('0x1a')]['limit']||null:null,'include':_0x51e467['options']?_0x51e467['options'][_0x918a('0x1e')]?_['map'](_0x51e467[_0x918a('0x1a')][_0x918a('0x1e')],function(_0xadd3bc){return{'model':db[_0xadd3bc[_0x918a('0x1f')]],'as':_0xadd3bc['as'],'attributes':_0xadd3bc[_0x918a('0x1d')],'include':_0xadd3bc[_0x918a('0x1e')]?_[_0x918a('0x20')](_0xadd3bc[_0x918a('0x1e')],function(_0xfdad4a){return{'model':db[_0xfdad4a[_0x918a('0x1f')]],'as':_0xfdad4a['as'],'attributes':_0xfdad4a['attributes'],'include':_0xfdad4a[_0x918a('0x1e')]?_[_0x918a('0x20')](_0xfdad4a[_0x918a('0x1e')],function(_0x4a77c6){return{'model':db[_0x4a77c6[_0x918a('0x1f')]],'as':_0x4a77c6['as'],'attributes':_0x4a77c6[_0x918a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x918a('0xd')](function(_0x549cb4){logger[_0x918a('0xe')](_0x918a('0x18'),_0x51e467);logger[_0x918a('0x21')](_0x918a('0x18'),_0x51e467,JSON[_0x918a('0x12')](_0x549cb4));_0x22e347(_0x549cb4);})[_0x918a('0x17')](function(_0x51361c){logger['error']('GetCampaign',_0x51361c[_0x918a('0x15')],_0x51e467);_0x38ca45(_0x199eb1[_0x918a('0x13')](0x1f4,_0x51361c['message']));});});};
\ No newline at end of file
+var _0x4156=['request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','raw','options','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x580843,_0x1840bb){var _0x12a1e2=function(_0x5f02c5){while(--_0x5f02c5){_0x580843['push'](_0x580843['shift']());}};_0x12a1e2(++_0x1840bb);}(_0x4156,0xf1));var _0x6415=function(_0x359055,_0x20f62d){_0x359055=_0x359055-0x0;var _0xc50b4b=_0x4156[_0x359055];return _0xc50b4b;};'use strict';var _=require(_0x6415('0x0'));var util=require(_0x6415('0x1'));var moment=require(_0x6415('0x2'));var BPromise=require(_0x6415('0x3'));var rs=require(_0x6415('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6415('0x5'))['db'];var utils=require(_0x6415('0x6'));var logger=require(_0x6415('0x7'))(_0x6415('0x8'));var config=require(_0x6415('0x9'));var jayson=require(_0x6415('0xa'));var client=jayson[_0x6415('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24cb0,_0x47ec13,_0x4045ec){return new BPromise(function(_0x266237,_0x5bc51b){return client[_0x6415('0xc')](_0x24cb0,_0x4045ec)[_0x6415('0xd')](function(_0x3383d2){logger[_0x6415('0xe')]('Campaign,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'),JSON[_0x6415('0x10')](_0x3383d2));if(_0x3383d2[_0x6415('0x11')]){if(_0x3383d2[_0x6415('0x11')][_0x6415('0x12')]===0x1f4){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2['error']['message']);return _0x5bc51b(_0x3383d2[_0x6415('0x11')][_0x6415('0x14')]);}logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2[_0x6415('0x11')]['message']);return _0x266237(_0x3383d2['error'][_0x6415('0x14')]);}else{logger[_0x6415('0xe')]('Campaign,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));_0x266237(_0x3383d2[_0x6415('0x15')]['message']);}})['catch'](function(_0x352a04){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x352a04);_0x5bc51b(_0x352a04);});});}exports[_0x6415('0x16')]=function(_0x2ef73b){var _0xa3d00a=this;return new Promise(function(_0x2c74c6,_0x468dc2){return db[_0x6415('0x17')]['findAll']({'raw':_0x2ef73b['options']?_0x2ef73b['options'][_0x6415('0x18')]===undefined?!![]:![]:!![],'where':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1a')]||null:null,'attributes':_0x2ef73b['options']?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1b')]||null:null,'limit':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b['options'][_0x6415('0x1c')]||null:null,'include':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x2ef73b[_0x6415('0x19')][_0x6415('0x1d')],function(_0x41c266){return{'model':db[_0x41c266[_0x6415('0x1f')]],'as':_0x41c266['as'],'attributes':_0x41c266['attributes'],'include':_0x41c266[_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x41c266['include'],function(_0x15be31){return{'model':db[_0x15be31[_0x6415('0x1f')]],'as':_0x15be31['as'],'attributes':_0x15be31[_0x6415('0x1b')],'include':_0x15be31[_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x15be31['include'],function(_0x30d857){return{'model':db[_0x30d857['model']],'as':_0x30d857['as'],'attributes':_0x30d857[_0x6415('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6415('0xd')](function(_0x25d459){logger['info']('GetCampaign',_0x2ef73b);logger['debug'](_0x6415('0x16'),_0x2ef73b,JSON[_0x6415('0x10')](_0x25d459));_0x2c74c6(_0x25d459);})['catch'](function(_0x5bf08d){logger[_0x6415('0x11')](_0x6415('0x16'),_0x5bf08d[_0x6415('0x14')],_0x2ef73b);_0x468dc2(_0xa3d00a[_0x6415('0x11')](0x1f4,_0x5bf08d[_0x6415('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index e50392b..7f7e6ad 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 _0x436b=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','destroy','delete','exports','util'];(function(_0x49a438,_0xc61035){var _0xb10dea=function(_0x1e8710){while(--_0x1e8710){_0x49a438['push'](_0x49a438['shift']());}};_0xb10dea(++_0xc61035);}(_0x436b,0x9a));var _0xb436=function(_0x3fa59c,_0x2302f9){_0x3fa59c=_0x3fa59c-0x0;var _0x239a2c=_0x436b[_0x3fa59c];return _0x239a2c;};'use strict';var multer=require('multer');var util=require(_0xb436('0x0'));var path=require(_0xb436('0x1'));var timeout=require(_0xb436('0x2'));var express=require(_0xb436('0x3'));var router=express['Router']();var fs_extra=require(_0xb436('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb436('0x5'));var config=require(_0xb436('0x6'));var controller=require(_0xb436('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb436('0x8')](_0xb436('0x9'),auth[_0xb436('0xa')](),controller['show']);router[_0xb436('0x8')]('/:id/hoppers',auth[_0xb436('0xa')](),controller[_0xb436('0xb')]);router[_0xb436('0x8')](_0xb436('0xc'),auth[_0xb436('0xa')](),controller['getHopperHistories']);router[_0xb436('0x8')](_0xb436('0xd'),auth[_0xb436('0xa')](),controller[_0xb436('0xe')]);router['get']('/:id/hopper_black',auth[_0xb436('0xa')](),controller[_0xb436('0xf')]);router[_0xb436('0x8')]('/:id/lists',auth[_0xb436('0xa')](),controller[_0xb436('0x10')]);router[_0xb436('0x8')](_0xb436('0x11'),auth['isAuthenticated'](),controller[_0xb436('0x12')]);router[_0xb436('0x13')]('/',auth['isAuthenticated'](),controller[_0xb436('0x14')]);router[_0xb436('0x13')](_0xb436('0x15'),auth[_0xb436('0xa')](),controller[_0xb436('0x16')]);router[_0xb436('0x13')](_0xb436('0x17'),auth[_0xb436('0xa')](),controller[_0xb436('0x18')]);router[_0xb436('0x13')](_0xb436('0x11'),auth['isAuthenticated'](),controller[_0xb436('0x19')]);router[_0xb436('0x1a')]('/:id',auth[_0xb436('0xa')](),controller[_0xb436('0x1b')]);router['delete'](_0xb436('0x9'),auth[_0xb436('0xa')](),controller[_0xb436('0x1c')]);router[_0xb436('0x1d')](_0xb436('0x17'),auth['isAuthenticated'](),controller['removeLists']);router[_0xb436('0x1d')](_0xb436('0x11'),auth[_0xb436('0xa')](),controller['removeBlackLists']);module[_0xb436('0x1e')]=router;
\ No newline at end of file
+var _0xb722=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addLists','/:id/blacklists','put','update','destroy','delete','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x4ca602,_0x330765){var _0xefb7f7=function(_0x2ef10a){while(--_0x2ef10a){_0x4ca602['push'](_0x4ca602['shift']());}};_0xefb7f7(++_0x330765);}(_0xb722,0x191));var _0x2b72=function(_0xf5190e,_0xad681){_0xf5190e=_0xf5190e-0x0;var _0x3d6caa=_0xb722[_0xf5190e];return _0x3d6caa;};'use strict';var multer=require(_0x2b72('0x0'));var util=require('util');var path=require(_0x2b72('0x1'));var timeout=require(_0x2b72('0x2'));var express=require(_0x2b72('0x3'));var router=express[_0x2b72('0x4')]();var fs_extra=require(_0x2b72('0x5'));var auth=require(_0x2b72('0x6'));var interaction=require(_0x2b72('0x7'));var config=require('../../config/environment');var controller=require(_0x2b72('0x8'));router[_0x2b72('0x9')]('/',auth[_0x2b72('0xa')](),controller[_0x2b72('0xb')]);router[_0x2b72('0x9')](_0x2b72('0xc'),auth[_0x2b72('0xa')](),controller[_0x2b72('0xd')]);router['get'](_0x2b72('0xe'),auth[_0x2b72('0xa')](),controller[_0x2b72('0xf')]);router[_0x2b72('0x9')](_0x2b72('0x10'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x11')]);router[_0x2b72('0x9')](_0x2b72('0x12'),auth[_0x2b72('0xa')](),controller['getHopperFinals']);router[_0x2b72('0x9')](_0x2b72('0x13'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x14')]);router[_0x2b72('0x9')](_0x2b72('0x15'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x16')]);router[_0x2b72('0x9')]('/:id/blacklists',auth[_0x2b72('0xa')](),controller[_0x2b72('0x17')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2b72('0x18')](_0x2b72('0x19'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x1a')]);router[_0x2b72('0x18')]('/:id/lists',auth['isAuthenticated'](),controller[_0x2b72('0x1b')]);router['post'](_0x2b72('0x1c'),auth[_0x2b72('0xa')](),controller['addBlackLists']);router[_0x2b72('0x1d')](_0x2b72('0xc'),auth['isAuthenticated'](),controller[_0x2b72('0x1e')]);router['delete']('/:id',auth[_0x2b72('0xa')](),controller[_0x2b72('0x1f')]);router[_0x2b72('0x20')](_0x2b72('0x15'),auth[_0x2b72('0xa')](),controller[_0x2b72('0x21')]);router[_0x2b72('0x20')](_0x2b72('0x1c'),auth[_0x2b72('0xa')](),controller['removeBlackLists']);module[_0x2b72('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 7ccda98..6ec1554 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 _0xc94a=['sequelize','exports','STRING','TEXT','getDataValue','key'];(function(_0x5e3ef6,_0x20d4f4){var _0x1fdc92=function(_0x1d68d4){while(--_0x1d68d4){_0x5e3ef6['push'](_0x5e3ef6['shift']());}};_0x1fdc92(++_0x20d4f4);}(_0xc94a,0x66));var _0xac94=function(_0x188822,_0x3e6635){_0x188822=_0x188822-0x0;var _0x426c69=_0xc94a[_0x188822];return _0x426c69;};'use strict';var Sequelize=require(_0xac94('0x0'));module[_0xac94('0x1')]={'key':{'type':Sequelize[_0xac94('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xac94('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0xac94('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xac94('0x4')](_0xac94('0x5'));}}};
\ No newline at end of file
+var _0x0448=['key','sequelize','exports','STRING','medium','VIRTUAL','getDataValue'];(function(_0x79b25c,_0x280b81){var _0x16d6c4=function(_0x23ae51){while(--_0x23ae51){_0x79b25c['push'](_0x79b25c['shift']());}};_0x16d6c4(++_0x280b81);}(_0x0448,0x16d));var _0x8044=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x0448[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0x8044('0x0'));module[_0x8044('0x1')]={'key':{'type':Sequelize[_0x8044('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x8044('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8044('0x2')]},'name':{'type':Sequelize[_0x8044('0x4')],'get':function(){return this[_0x8044('0x5')](_0x8044('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 503534b..9ae4a2f 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 _0x90d7=['crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','set','Content-Range','json','apply','reject','save','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','count','findAll','rows','catch','show','params','includeAll','find','update','body','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','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel'];(function(_0x2769e6,_0x38ef8d){var _0x1211d2=function(_0x4f6c98){while(--_0x4f6c98){_0x2769e6['push'](_0x2769e6['shift']());}};_0x1211d2(++_0x38ef8d);}(_0x90d7,0xfc));var _0x790d=function(_0x5b77df,_0xe63706){_0x5b77df=_0x5b77df-0x0;var _0xabcf56=_0x90d7[_0x5b77df];return _0xabcf56;};'use strict';var emlformat=require(_0x790d('0x0'));var rimraf=require(_0x790d('0x1'));var zipdir=require(_0x790d('0x2'));var jsonpatch=require(_0x790d('0x3'));var rp=require(_0x790d('0x4'));var moment=require(_0x790d('0x5'));var BPromise=require(_0x790d('0x6'));var Mustache=require('mustache');var util=require(_0x790d('0x7'));var path=require('path');var sox=require(_0x790d('0x8'));var csv=require(_0x790d('0x9'));var ejs=require(_0x790d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x790d('0xb'));var crypto=require(_0x790d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x790d('0x9'));var querystring=require('querystring');var Papa=require(_0x790d('0xd'));var Redis=require(_0x790d('0xe'));var authService=require(_0x790d('0xf'));var qs=require(_0x790d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x790d('0x11'));var utils=require(_0x790d('0x12'));var config=require(_0x790d('0x13'));var licenseUtil=require(_0x790d('0x14'));var db=require(_0x790d('0x15'))['db'];function respondWithStatusCode(_0x20420d,_0x588477){_0x588477=_0x588477||0xcc;return function(_0x4591ad){if(_0x4591ad){return _0x20420d[_0x790d('0x16')](_0x588477);}return _0x20420d[_0x790d('0x17')](_0x588477)[_0x790d('0x18')]();};}function respondWithResult(_0x1df5c4,_0x52f31f){_0x52f31f=_0x52f31f||0xc8;return function(_0x1894ab){if(_0x1894ab){return _0x1df5c4[_0x790d('0x17')](_0x52f31f)['json'](_0x1894ab);}};}function respondWithFilteredResult(_0x1951cc,_0xfeee96){return function(_0x3c62cf){if(_0x3c62cf){var _0x2ecb7a=typeof _0xfeee96[_0x790d('0x19')]===_0x790d('0x1a')&&typeof _0xfeee96['limit']===_0x790d('0x1a');var _0x5b45b7=_0x3c62cf['count'];var _0x400990=_0x2ecb7a?0x0:_0xfeee96[_0x790d('0x19')];var _0x760331=_0x2ecb7a?_0x3c62cf['count']:_0xfeee96[_0x790d('0x19')]+_0xfeee96['limit'];var _0x421c09;if(_0x760331>=_0x5b45b7){_0x760331=_0x5b45b7;_0x421c09=0xc8;}else{_0x421c09=0xce;}_0x1951cc[_0x790d('0x17')](_0x421c09);return _0x1951cc[_0x790d('0x1b')](_0x790d('0x1c'),_0x400990+'-'+_0x760331+'/'+_0x5b45b7)[_0x790d('0x1d')](_0x3c62cf);}return null;};}function patchUpdates(_0xeeb62d){return function(_0x3bbad8){try{jsonpatch[_0x790d('0x1e')](_0x3bbad8,_0xeeb62d,!![]);}catch(_0x585959){return BPromise[_0x790d('0x1f')](_0x585959);}return _0x3bbad8[_0x790d('0x20')]();};}function saveUpdates(_0x5ef190,_0x17b660){return function(_0x46b1e6){if(_0x46b1e6){return _0x46b1e6['update'](_0x5ef190)[_0x790d('0x21')](function(_0x5d66f3){return _0x5d66f3;});}return null;};}function removeEntity(_0x587358,_0x6594f){return function(_0x4b1a3a){if(_0x4b1a3a){return _0x4b1a3a['destroy']()[_0x790d('0x21')](function(){var _0x3e6585=_0x4b1a3a[_0x790d('0x22')]({'plain':!![]});var _0x5c576a=_0x790d('0x23');return db[_0x790d('0x24')][_0x790d('0x25')]({'where':{'type':_0x5c576a,'resourceId':_0x3e6585['id']}})[_0x790d('0x21')](function(){return _0x4b1a3a;});})[_0x790d('0x21')](function(){_0x587358[_0x790d('0x17')](0xcc)[_0x790d('0x18')]();});}};}function handleEntityNotFound(_0x35d8cc,_0x65e8b9){return function(_0xc463d1){if(!_0xc463d1){_0x35d8cc[_0x790d('0x16')](0x194);}return _0xc463d1;};}function handleError(_0x21cd8e,_0x37f083){_0x37f083=_0x37f083||0x1f4;return function(_0x5101b0){logger['error'](_0x5101b0[_0x790d('0x26')]);if(_0x5101b0[_0x790d('0x27')]){delete _0x5101b0[_0x790d('0x27')];}_0x21cd8e[_0x790d('0x17')](_0x37f083)[_0x790d('0x28')](_0x5101b0);};}exports[_0x790d('0x29')]=function(_0x5b7e18,_0x17f7d8){var _0x116e51={},_0x1cab50={},_0x234c3e={'count':0x0,'rows':[]};var _0x2914ec=_[_0x790d('0x2a')](db[_0x790d('0x2b')][_0x790d('0x2c')],function(_0x375439){return{'name':_0x375439['fieldName'],'type':_0x375439[_0x790d('0x2d')][_0x790d('0x2e')]};});_0x1cab50['model']=_[_0x790d('0x2a')](_0x2914ec,'name');_0x1cab50[_0x790d('0x2f')]=_[_0x790d('0x30')](_0x5b7e18['query']);_0x1cab50[_0x790d('0x31')]=_['intersection'](_0x1cab50[_0x790d('0x32')],_0x1cab50['query']);_0x116e51[_0x790d('0x33')]=_[_0x790d('0x34')](_0x1cab50['model'],qs[_0x790d('0x35')](_0x5b7e18['query'][_0x790d('0x35')]));_0x116e51['attributes']=_0x116e51[_0x790d('0x33')][_0x790d('0x36')]?_0x116e51[_0x790d('0x33')]:_0x1cab50[_0x790d('0x32')];if(!_0x5b7e18[_0x790d('0x2f')][_0x790d('0x37')](_0x790d('0x38'))){_0x116e51[_0x790d('0x39')]=qs[_0x790d('0x39')](_0x5b7e18['query'][_0x790d('0x39')]);_0x116e51[_0x790d('0x19')]=qs[_0x790d('0x19')](_0x5b7e18[_0x790d('0x2f')]['offset']);}_0x116e51[_0x790d('0x3a')]=qs[_0x790d('0x3b')](_0x5b7e18['query'][_0x790d('0x3b')]);_0x116e51[_0x790d('0x3c')]=qs[_0x790d('0x31')](_['pick'](_0x5b7e18['query'],_0x1cab50[_0x790d('0x31')]),_0x2914ec);if(_0x5b7e18[_0x790d('0x2f')][_0x790d('0x3d')]){_0x116e51[_0x790d('0x3c')]=_[_0x790d('0x3e')](_0x116e51[_0x790d('0x3c')],{'$or':[{'key':{'$like':'%'+_0x5b7e18['query'][_0x790d('0x3d')]+'%'}},{'value':{'$like':'%'+_0x5b7e18[_0x790d('0x2f')]['filter']+'%'}}]});}_0x116e51=_[_0x790d('0x3e')]({},_0x116e51,_0x5b7e18[_0x790d('0x3f')]);var _0x4ba941={'where':_0x116e51[_0x790d('0x3c')]};return db[_0x790d('0x2b')]['count'](_0x4ba941)[_0x790d('0x21')](function(_0x3c157b){_0x234c3e[_0x790d('0x40')]=_0x3c157b;if(_0x5b7e18['query']['includeAll']){_0x116e51['include']=[{'all':!![]}];}return db[_0x790d('0x2b')][_0x790d('0x41')](_0x116e51);})[_0x790d('0x21')](function(_0x3085ba){_0x234c3e[_0x790d('0x42')]=_0x3085ba;return _0x234c3e;})[_0x790d('0x21')](respondWithFilteredResult(_0x17f7d8,_0x116e51))[_0x790d('0x43')](handleError(_0x17f7d8,null));};exports[_0x790d('0x44')]=function(_0x1b3a72,_0x16ed43){var _0x213e65={'raw':!![],'where':{'id':_0x1b3a72[_0x790d('0x45')]['id']}},_0x99c39e={};_0x99c39e['model']=_[_0x790d('0x30')](db[_0x790d('0x2b')][_0x790d('0x2c')]);_0x99c39e[_0x790d('0x2f')]=_[_0x790d('0x30')](_0x1b3a72[_0x790d('0x2f')]);_0x99c39e[_0x790d('0x31')]=_[_0x790d('0x34')](_0x99c39e[_0x790d('0x32')],_0x99c39e['query']);_0x213e65['attributes']=_[_0x790d('0x34')](_0x99c39e['model'],qs[_0x790d('0x35')](_0x1b3a72[_0x790d('0x2f')][_0x790d('0x35')]));_0x213e65[_0x790d('0x33')]=_0x213e65[_0x790d('0x33')][_0x790d('0x36')]?_0x213e65[_0x790d('0x33')]:_0x99c39e[_0x790d('0x32')];if(_0x1b3a72[_0x790d('0x2f')][_0x790d('0x46')]){_0x213e65['include']=[{'all':!![]}];}_0x213e65=_[_0x790d('0x3e')]({},_0x213e65,_0x1b3a72['options']);return db[_0x790d('0x2b')][_0x790d('0x47')](_0x213e65)[_0x790d('0x21')](handleEntityNotFound(_0x16ed43,null))[_0x790d('0x21')](respondWithResult(_0x16ed43,null))[_0x790d('0x43')](handleError(_0x16ed43,null));};exports[_0x790d('0x48')]=function(_0x10ccbb,_0x229b3f){if(_0x10ccbb[_0x790d('0x49')]['id']){delete _0x10ccbb[_0x790d('0x49')]['id'];}return db['CannedAnswer'][_0x790d('0x47')]({'where':{'id':_0x10ccbb['params']['id']}})['then'](handleEntityNotFound(_0x229b3f,null))[_0x790d('0x21')](saveUpdates(_0x10ccbb[_0x790d('0x49')],null))[_0x790d('0x21')](respondWithResult(_0x229b3f,null))['catch'](handleError(_0x229b3f,null));};exports[_0x790d('0x25')]=function(_0x1c25ea,_0x4ca87a){return db[_0x790d('0x2b')]['find']({'where':{'id':_0x1c25ea[_0x790d('0x45')]['id']}})[_0x790d('0x21')](handleEntityNotFound(_0x4ca87a,null))[_0x790d('0x21')](removeEntity(_0x4ca87a,null))[_0x790d('0x43')](handleError(_0x4ca87a,null));};exports[_0x790d('0x4a')]=function(_0x2bde73,_0xe6c84f){var _0x5a35f1={'key':_0x2bde73[_0x790d('0x49')][_0x790d('0x2e')]};if(_0x2bde73[_0x790d('0x49')][_0x790d('0x4b')]){_0x5a35f1[_0x790d('0x4b')]=_0x2bde73[_0x790d('0x49')][_0x790d('0x4b')];}else if(_0x2bde73[_0x790d('0x49')][_0x790d('0x4c')]){_0x5a35f1['SmsAccountId']=_0x2bde73['body'][_0x790d('0x4c')];}else if(_0x2bde73[_0x790d('0x49')][_0x790d('0x4d')]){_0x5a35f1[_0x790d('0x4d')]=_0x2bde73[_0x790d('0x49')][_0x790d('0x4d')];}else if(_0x2bde73['body'][_0x790d('0x4e')]){_0x5a35f1[_0x790d('0x4e')]=_0x2bde73['body'][_0x790d('0x4e')];}return db[_0x790d('0x2b')]['find']({'where':_0x5a35f1})['then'](function(_0x446ff5){if(_0x446ff5){throw new db['Sequelize'][(_0x790d('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x790d('0x2b')]['create'](_0x2bde73[_0x790d('0x49')]);})['then'](function(_0x1219e1){var _0x38b47f=_0x2bde73[_0x790d('0x50')]['get']({'plain':!![]});if(!_0x38b47f)throw new Error(_0x790d('0x51'));if(_0x38b47f[_0x790d('0x52')]===_0x790d('0x50')){var _0x5d6687=_0x1219e1[_0x790d('0x22')]({'plain':!![]});return db[_0x790d('0x53')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x38b47f[_0x790d('0x54')]},'raw':!![]})['then'](function(_0xafd5e9){if(_0xafd5e9&&_0xafd5e9[_0x790d('0x55')]===0x0){return db[_0x790d('0x24')][_0x790d('0x4a')]({'name':_0x5d6687[_0x790d('0x27')],'resourceId':_0x5d6687['id'],'type':_0xafd5e9[_0x790d('0x27')],'sectionId':_0xafd5e9['id']},{})[_0x790d('0x21')](function(){return _0x1219e1;});}else{return _0x1219e1;}})[_0x790d('0x43')](function(_0x2ae6dd){logger[_0x790d('0x56')](_0x790d('0x57'),_0x2ae6dd);throw _0x2ae6dd;});}return _0x1219e1;})['then'](respondWithResult(_0xe6c84f,0xc9))[_0x790d('0x43')](handleError(_0xe6c84f,null));};
\ No newline at end of file
+var _0x519b=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','name','send','index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','CannedAnswer','include','findAll','rows','catch','show','params','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','status','end','json','offset','undefined'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x519b,0x19d));var _0xb519=function(_0x449b54,_0x3776f3){_0x449b54=_0x449b54-0x0;var _0x32d6b9=_0x519b[_0x449b54];return _0x32d6b9;};'use strict';var emlformat=require(_0xb519('0x0'));var rimraf=require(_0xb519('0x1'));var zipdir=require(_0xb519('0x2'));var jsonpatch=require(_0xb519('0x3'));var rp=require(_0xb519('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb519('0x5'));var util=require(_0xb519('0x6'));var path=require(_0xb519('0x7'));var sox=require(_0xb519('0x8'));var csv=require(_0xb519('0x9'));var ejs=require(_0xb519('0xa'));var fs=require('fs');var fs_extra=require(_0xb519('0xb'));var _=require(_0xb519('0xc'));var squel=require(_0xb519('0xd'));var crypto=require(_0xb519('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb519('0xf'));var toCsv=require(_0xb519('0x9'));var querystring=require(_0xb519('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb519('0x11'));var qs=require(_0xb519('0x12'));var as=require(_0xb519('0x13'));var hardwareService=require(_0xb519('0x14'));var logger=require(_0xb519('0x15'))(_0xb519('0x16'));var utils=require(_0xb519('0x17'));var config=require(_0xb519('0x18'));var licenseUtil=require(_0xb519('0x19'));var db=require(_0xb519('0x1a'))['db'];function respondWithStatusCode(_0x3f99a0,_0x17d365){_0x17d365=_0x17d365||0xcc;return function(_0x4dd12a){if(_0x4dd12a){return _0x3f99a0['sendStatus'](_0x17d365);}return _0x3f99a0[_0xb519('0x1b')](_0x17d365)[_0xb519('0x1c')]();};}function respondWithResult(_0x45f63c,_0x34a076){_0x34a076=_0x34a076||0xc8;return function(_0x8e82a3){if(_0x8e82a3){return _0x45f63c[_0xb519('0x1b')](_0x34a076)[_0xb519('0x1d')](_0x8e82a3);}};}function respondWithFilteredResult(_0x276c6f,_0x224200){return function(_0x124965){if(_0x124965){var _0x44a882=typeof _0x224200[_0xb519('0x1e')]===_0xb519('0x1f')&&typeof _0x224200[_0xb519('0x20')]===_0xb519('0x1f');var _0x1258f7=_0x124965[_0xb519('0x21')];var _0x11f96c=_0x44a882?0x0:_0x224200[_0xb519('0x1e')];var _0x35cb95=_0x44a882?_0x124965[_0xb519('0x21')]:_0x224200['offset']+_0x224200[_0xb519('0x20')];var _0x4bf1a9;if(_0x35cb95>=_0x1258f7){_0x35cb95=_0x1258f7;_0x4bf1a9=0xc8;}else{_0x4bf1a9=0xce;}_0x276c6f[_0xb519('0x1b')](_0x4bf1a9);return _0x276c6f[_0xb519('0x22')](_0xb519('0x23'),_0x11f96c+'-'+_0x35cb95+'/'+_0x1258f7)[_0xb519('0x1d')](_0x124965);}return null;};}function patchUpdates(_0x4b4398){return function(_0x4a7e54){try{jsonpatch[_0xb519('0x24')](_0x4a7e54,_0x4b4398,!![]);}catch(_0x970e97){return BPromise[_0xb519('0x25')](_0x970e97);}return _0x4a7e54[_0xb519('0x26')]();};}function saveUpdates(_0x54352a,_0x13a7d1){return function(_0x182842){if(_0x182842){return _0x182842[_0xb519('0x27')](_0x54352a)[_0xb519('0x28')](function(_0xd16956){return _0xd16956;});}return null;};}function removeEntity(_0x251ef5,_0x3d4d0e){return function(_0x2bb354){if(_0x2bb354){return _0x2bb354[_0xb519('0x29')]()[_0xb519('0x28')](function(){var _0x2db1ec=_0x2bb354['get']({'plain':!![]});var _0x2b90b1=_0xb519('0x2a');return db['UserProfileResource'][_0xb519('0x29')]({'where':{'type':_0x2b90b1,'resourceId':_0x2db1ec['id']}})[_0xb519('0x28')](function(){return _0x2bb354;});})['then'](function(){_0x251ef5[_0xb519('0x1b')](0xcc)[_0xb519('0x1c')]();});}};}function handleEntityNotFound(_0x1eceb4,_0x68acef){return function(_0x5da2fb){if(!_0x5da2fb){_0x1eceb4['sendStatus'](0x194);}return _0x5da2fb;};}function handleError(_0x4a1cc4,_0x4e1fd2){_0x4e1fd2=_0x4e1fd2||0x1f4;return function(_0x52e493){logger['error'](_0x52e493['stack']);if(_0x52e493[_0xb519('0x2b')]){delete _0x52e493[_0xb519('0x2b')];}_0x4a1cc4['status'](_0x4e1fd2)[_0xb519('0x2c')](_0x52e493);};}exports[_0xb519('0x2d')]=function(_0x8f29f3,_0x4ecebb){var _0x537143={},_0x29ed43={},_0x5c3892={'count':0x0,'rows':[]};var _0x52f992=_[_0xb519('0x2e')](db['CannedAnswer'][_0xb519('0x2f')],function(_0x54118b){return{'name':_0x54118b[_0xb519('0x30')],'type':_0x54118b['type'][_0xb519('0x31')]};});_0x29ed43[_0xb519('0x32')]=_[_0xb519('0x2e')](_0x52f992,_0xb519('0x2b'));_0x29ed43['query']=_[_0xb519('0x33')](_0x8f29f3['query']);_0x29ed43['filters']=_[_0xb519('0x34')](_0x29ed43[_0xb519('0x32')],_0x29ed43[_0xb519('0x35')]);_0x537143[_0xb519('0x36')]=_['intersection'](_0x29ed43['model'],qs[_0xb519('0x37')](_0x8f29f3[_0xb519('0x35')]['fields']));_0x537143[_0xb519('0x36')]=_0x537143[_0xb519('0x36')][_0xb519('0x38')]?_0x537143[_0xb519('0x36')]:_0x29ed43['model'];if(!_0x8f29f3['query']['hasOwnProperty'](_0xb519('0x39'))){_0x537143[_0xb519('0x20')]=qs[_0xb519('0x20')](_0x8f29f3[_0xb519('0x35')][_0xb519('0x20')]);_0x537143[_0xb519('0x1e')]=qs['offset'](_0x8f29f3[_0xb519('0x35')]['offset']);}_0x537143[_0xb519('0x3a')]=qs[_0xb519('0x3b')](_0x8f29f3['query'][_0xb519('0x3b')]);_0x537143[_0xb519('0x3c')]=qs['filters'](_['pick'](_0x8f29f3[_0xb519('0x35')],_0x29ed43[_0xb519('0x3d')]),_0x52f992);if(_0x8f29f3['query'][_0xb519('0x3e')]){_0x537143['where']=_[_0xb519('0x3f')](_0x537143[_0xb519('0x3c')],{'$or':[{'key':{'$like':'%'+_0x8f29f3[_0xb519('0x35')][_0xb519('0x3e')]+'%'}},{'value':{'$like':'%'+_0x8f29f3[_0xb519('0x35')][_0xb519('0x3e')]+'%'}}]});}_0x537143=_['merge']({},_0x537143,_0x8f29f3[_0xb519('0x40')]);var _0x5030fc={'where':_0x537143[_0xb519('0x3c')]};return db[_0xb519('0x41')]['count'](_0x5030fc)[_0xb519('0x28')](function(_0x255310){_0x5c3892[_0xb519('0x21')]=_0x255310;if(_0x8f29f3[_0xb519('0x35')]['includeAll']){_0x537143[_0xb519('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb519('0x43')](_0x537143);})[_0xb519('0x28')](function(_0x5f190a){_0x5c3892[_0xb519('0x44')]=_0x5f190a;return _0x5c3892;})[_0xb519('0x28')](respondWithFilteredResult(_0x4ecebb,_0x537143))[_0xb519('0x45')](handleError(_0x4ecebb,null));};exports[_0xb519('0x46')]=function(_0x4d94d9,_0xa5d370){var _0x1c083d={'raw':!![],'where':{'id':_0x4d94d9[_0xb519('0x47')]['id']}},_0x11a4d5={};_0x11a4d5[_0xb519('0x32')]=_['keys'](db['CannedAnswer'][_0xb519('0x2f')]);_0x11a4d5[_0xb519('0x35')]=_[_0xb519('0x33')](_0x4d94d9['query']);_0x11a4d5[_0xb519('0x3d')]=_[_0xb519('0x34')](_0x11a4d5[_0xb519('0x32')],_0x11a4d5[_0xb519('0x35')]);_0x1c083d[_0xb519('0x36')]=_[_0xb519('0x34')](_0x11a4d5[_0xb519('0x32')],qs[_0xb519('0x37')](_0x4d94d9[_0xb519('0x35')][_0xb519('0x37')]));_0x1c083d[_0xb519('0x36')]=_0x1c083d[_0xb519('0x36')][_0xb519('0x38')]?_0x1c083d[_0xb519('0x36')]:_0x11a4d5[_0xb519('0x32')];if(_0x4d94d9[_0xb519('0x35')][_0xb519('0x48')]){_0x1c083d[_0xb519('0x42')]=[{'all':!![]}];}_0x1c083d=_[_0xb519('0x3f')]({},_0x1c083d,_0x4d94d9['options']);return db[_0xb519('0x41')][_0xb519('0x49')](_0x1c083d)[_0xb519('0x28')](handleEntityNotFound(_0xa5d370,null))[_0xb519('0x28')](respondWithResult(_0xa5d370,null))['catch'](handleError(_0xa5d370,null));};exports[_0xb519('0x27')]=function(_0x213c77,_0x259b90){if(_0x213c77['body']['id']){delete _0x213c77[_0xb519('0x4a')]['id'];}return db[_0xb519('0x41')][_0xb519('0x49')]({'where':{'id':_0x213c77[_0xb519('0x47')]['id']}})['then'](handleEntityNotFound(_0x259b90,null))[_0xb519('0x28')](saveUpdates(_0x213c77[_0xb519('0x4a')],null))[_0xb519('0x28')](respondWithResult(_0x259b90,null))[_0xb519('0x45')](handleError(_0x259b90,null));};exports[_0xb519('0x29')]=function(_0x85f790,_0x4b04bc){return db[_0xb519('0x41')][_0xb519('0x49')]({'where':{'id':_0x85f790['params']['id']}})['then'](handleEntityNotFound(_0x4b04bc,null))['then'](removeEntity(_0x4b04bc,null))[_0xb519('0x45')](handleError(_0x4b04bc,null));};exports['create']=function(_0xb028b7,_0xa360c6){var _0x27680f={'key':_0xb028b7[_0xb519('0x4a')][_0xb519('0x31')]};if(_0xb028b7[_0xb519('0x4a')][_0xb519('0x4b')]){_0x27680f['MailAccountId']=_0xb028b7['body'][_0xb519('0x4b')];}else if(_0xb028b7[_0xb519('0x4a')][_0xb519('0x4c')]){_0x27680f[_0xb519('0x4c')]=_0xb028b7['body']['SmsAccountId'];}else if(_0xb028b7[_0xb519('0x4a')][_0xb519('0x4d')]){_0x27680f[_0xb519('0x4d')]=_0xb028b7['body']['OpenchannelAccountId'];}else if(_0xb028b7['body'][_0xb519('0x4e')]){_0x27680f['ChatWebsiteId']=_0xb028b7[_0xb519('0x4a')][_0xb519('0x4e')];}return db[_0xb519('0x41')]['find']({'where':_0x27680f})[_0xb519('0x28')](function(_0x3c0e96){if(_0x3c0e96){throw new db['Sequelize'][(_0xb519('0x4f'))](_0xb519('0x50'));}return db[_0xb519('0x41')]['create'](_0xb028b7[_0xb519('0x4a')]);})[_0xb519('0x28')](function(_0x1afa81){var _0x3221c6=_0xb028b7[_0xb519('0x51')][_0xb519('0x52')]({'plain':!![]});if(!_0x3221c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3221c6[_0xb519('0x53')]===_0xb519('0x51')){var _0x368165=_0x1afa81[_0xb519('0x52')]({'plain':!![]});return db[_0xb519('0x54')][_0xb519('0x49')]({'where':{'name':_0xb519('0x2a'),'userProfileId':_0x3221c6[_0xb519('0x55')]},'raw':!![]})[_0xb519('0x28')](function(_0x54fd04){if(_0x54fd04&&_0x54fd04['autoAssociation']===0x0){return db['UserProfileResource'][_0xb519('0x56')]({'name':_0x368165[_0xb519('0x2b')],'resourceId':_0x368165['id'],'type':_0x54fd04[_0xb519('0x2b')],'sectionId':_0x54fd04['id']},{})[_0xb519('0x28')](function(){return _0x1afa81;});}else{return _0x1afa81;}})[_0xb519('0x45')](function(_0x166977){logger[_0xb519('0x57')](_0xb519('0x58'),_0x166977);throw _0x166977;});}return _0x1afa81;})[_0xb519('0x28')](respondWithResult(_0xa360c6,0xc9))[_0xb519('0x45')](handleError(_0xa360c6,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 680e44d..5eefd35 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 _0x8d44=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x1d61de,_0x2a303d){var _0x446d8f=function(_0xee1c0d){while(--_0xee1c0d){_0x1d61de['push'](_0x1d61de['shift']());}};_0x446d8f(++_0x2a303d);}(_0x8d44,0x161));var _0x48d4=function(_0xad23c5,_0x2d7c1e){_0xad23c5=_0xad23c5-0x0;var _0x3d1c3d=_0x8d44[_0xad23c5];return _0x3d1c3d;};'use strict';var _=require(_0x48d4('0x0'));var util=require(_0x48d4('0x1'));var logger=require('../../config/logger')(_0x48d4('0x2'));var moment=require(_0x48d4('0x3'));var BPromise=require(_0x48d4('0x4'));var rp=require(_0x48d4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48d4('0x6'));var config=require('../../config/environment');var attributes=require(_0x48d4('0x7'));module[_0x48d4('0x8')]=function(_0x4c7a24,_0x32354d){return _0x4c7a24[_0x48d4('0x9')](_0x48d4('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x48d4('0xb'),'collate':_0x48d4('0xc')});};
\ No newline at end of file
+var _0x39aa=['moment','bluebird','request-promise','path','rimraf','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x47cd82,_0x526cc0){var _0x32ad55=function(_0x18ca6f){while(--_0x18ca6f){_0x47cd82['push'](_0x47cd82['shift']());}};_0x32ad55(++_0x526cc0);}(_0x39aa,0x11b));var _0xa39a=function(_0x2e846d,_0x370cd6){_0x2e846d=_0x2e846d-0x0;var _0x10a6ab=_0x39aa[_0x2e846d];return _0x10a6ab;};'use strict';var _=require(_0xa39a('0x0'));var util=require(_0xa39a('0x1'));var logger=require('../../config/logger')(_0xa39a('0x2'));var moment=require(_0xa39a('0x3'));var BPromise=require(_0xa39a('0x4'));var rp=require(_0xa39a('0x5'));var fs=require('fs');var path=require(_0xa39a('0x6'));var rimraf=require(_0xa39a('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x3dba2c,_0x911d67){return _0x3dba2c[_0xa39a('0x8')](_0xa39a('0x9'),attributes,{'tableName':_0xa39a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa39a('0xb'),'collate':_0xa39a('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 861e689..d8cdc5e 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(_0xad034c,_0x3cf087){var _0x34b2d8=function(_0xf90315){while(--_0xf90315){_0xad034c['push'](_0xad034c['shift']());}};_0x34b2d8(++_0x3cf087);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x3284fd,_0x547a9e){var _0x506e20=function(_0x26cc53){while(--_0x26cc53){_0x3284fd['push'](_0x3284fd['shift']());}};_0x506e20(++_0x547a9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 15cc6c3..5370a54 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 _0xe40a=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','../../components/auth/service'];(function(_0x1bc762,_0x523eb3){var _0x40f70c=function(_0x3c206e){while(--_0x3c206e){_0x1bc762['push'](_0x1bc762['shift']());}};_0x40f70c(++_0x523eb3);}(_0xe40a,0x140));var _0xae40=function(_0x2e835b,_0x337521){_0x2e835b=_0x2e835b-0x0;var _0x1749cb=_0xe40a[_0x2e835b];return _0x1749cb;};'use strict';var multer=require(_0xae40('0x0'));var util=require(_0xae40('0x1'));var path=require(_0xae40('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xae40('0x3'));var interaction=require(_0xae40('0x4'));var config=require(_0xae40('0x5'));var controller=require(_0xae40('0x6'));router[_0xae40('0x7')]('/',auth['isAuthenticated'](),controller[_0xae40('0x8')]);router[_0xae40('0x7')](_0xae40('0x9'),auth[_0xae40('0xa')](),controller[_0xae40('0xb')]);router[_0xae40('0xc')]('/',auth[_0xae40('0xa')](),controller[_0xae40('0xd')]);router[_0xae40('0xe')](_0xae40('0x9'),auth[_0xae40('0xa')](),controller['update']);router[_0xae40('0xf')](_0xae40('0x9'),auth[_0xae40('0xa')](),controller[_0xae40('0x10')]);module[_0xae40('0x11')]=router;
\ No newline at end of file
+var _0x6717=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','destroy','exports','multer'];(function(_0x631c23,_0x3e18bc){var _0x37f536=function(_0x2a0d53){while(--_0x2a0d53){_0x631c23['push'](_0x631c23['shift']());}};_0x37f536(++_0x3e18bc);}(_0x6717,0x1ef));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7671('0x0'));var util=require('util');var path=require(_0x7671('0x1'));var timeout=require(_0x7671('0x2'));var express=require('express');var router=express[_0x7671('0x3')]();var fs_extra=require(_0x7671('0x4'));var auth=require(_0x7671('0x5'));var interaction=require(_0x7671('0x6'));var config=require('../../config/environment');var controller=require(_0x7671('0x7'));router[_0x7671('0x8')]('/',auth[_0x7671('0x9')](),controller[_0x7671('0xa')]);router['get'](_0x7671('0xb'),auth[_0x7671('0x9')](),controller[_0x7671('0xc')]);router['post']('/',auth[_0x7671('0x9')](),controller[_0x7671('0xd')]);router['put'](_0x7671('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7671('0xb'),auth[_0x7671('0x9')](),controller[_0x7671('0xe')]);module[_0x7671('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 3eca3f9..6a74431 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 _0x8801=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x583ceb,_0x28ed3e){var _0x446926=function(_0x400b5c){while(--_0x400b5c){_0x583ceb['push'](_0x583ceb['shift']());}};_0x446926(++_0x28ed3e);}(_0x8801,0x116));var _0x1880=function(_0x5def8c,_0x38cf36){_0x5def8c=_0x5def8c-0x0;var _0x14caae=_0x8801[_0x5def8c];return _0x14caae;};'use strict';var Sequelize=require(_0x1880('0x0'));module[_0x1880('0x1')]={'calldate':{'type':Sequelize[_0x1880('0x2')],'allowNull':![],'defaultValue':_0x1880('0x3')},'clid':{'type':Sequelize[_0x1880('0x4')]},'src':{'type':Sequelize[_0x1880('0x4')]},'dst':{'type':Sequelize[_0x1880('0x4')]},'dcontext':{'type':Sequelize[_0x1880('0x4')]},'channel':{'type':Sequelize[_0x1880('0x4')]},'dstchannel':{'type':Sequelize[_0x1880('0x4')]},'lastapp':{'type':Sequelize[_0x1880('0x4')]},'lastdata':{'type':Sequelize[_0x1880('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1880('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1880('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1880('0x4')]},'userfield':{'type':Sequelize[_0x1880('0x4')]},'uniqueid':{'type':Sequelize[_0x1880('0x4')]},'linkedid':{'type':Sequelize[_0x1880('0x4')]},'sequence':{'type':Sequelize[_0x1880('0x4')]},'peeraccount':{'type':Sequelize[_0x1880('0x4')]},'type':{'type':Sequelize[_0x1880('0x4')]},'tag':{'type':Sequelize[_0x1880('0x4')]}};
\ No newline at end of file
+var _0xda1c=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x4c8c4d,_0x170fc3){var _0x7c72d2=function(_0x249fd1){while(--_0x249fd1){_0x4c8c4d['push'](_0x4c8c4d['shift']());}};_0x7c72d2(++_0x170fc3);}(_0xda1c,0x68));var _0xcda1=function(_0x136a97,_0x140d35){_0x136a97=_0x136a97-0x0;var _0x42f478=_0xda1c[_0x136a97];return _0x42f478;};'use strict';var Sequelize=require(_0xcda1('0x0'));module[_0xcda1('0x1')]={'calldate':{'type':Sequelize[_0xcda1('0x2')],'allowNull':![],'defaultValue':_0xcda1('0x3')},'clid':{'type':Sequelize[_0xcda1('0x4')]},'src':{'type':Sequelize[_0xcda1('0x4')]},'dst':{'type':Sequelize[_0xcda1('0x4')]},'dcontext':{'type':Sequelize[_0xcda1('0x4')]},'channel':{'type':Sequelize[_0xcda1('0x4')]},'dstchannel':{'type':Sequelize[_0xcda1('0x4')]},'lastapp':{'type':Sequelize[_0xcda1('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xcda1('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xcda1('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xcda1('0x4')]},'amaflags':{'type':Sequelize[_0xcda1('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xcda1('0x4')]},'userfield':{'type':Sequelize[_0xcda1('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xcda1('0x4')]},'sequence':{'type':Sequelize[_0xcda1('0x4')]},'peeraccount':{'type':Sequelize[_0xcda1('0x4')]},'type':{'type':Sequelize[_0xcda1('0x4')]},'tag':{'type':Sequelize[_0xcda1('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 97822ae..2860f77 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 _0x6eed=['stack','name','index','map','Cdr','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','params','rawAttributes','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','end','error'];(function(_0x38946c,_0x5bccfc){var _0x33cdb3=function(_0x1a8217){while(--_0x1a8217){_0x38946c['push'](_0x38946c['shift']());}};_0x33cdb3(++_0x5bccfc);}(_0x6eed,0xff));var _0xd6ee=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x6eed[_0x280f4a];return _0x1bb157;};'use strict';var emlformat=require(_0xd6ee('0x0'));var rimraf=require(_0xd6ee('0x1'));var zipdir=require(_0xd6ee('0x2'));var jsonpatch=require(_0xd6ee('0x3'));var rp=require(_0xd6ee('0x4'));var moment=require('moment');var BPromise=require(_0xd6ee('0x5'));var Mustache=require(_0xd6ee('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd6ee('0x7'));var csv=require(_0xd6ee('0x8'));var ejs=require(_0xd6ee('0x9'));var fs=require('fs');var fs_extra=require(_0xd6ee('0xa'));var _=require(_0xd6ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6ee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6ee('0xd'));var Redis=require(_0xd6ee('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd6ee('0xf'));var as=require(_0xd6ee('0x10'));var hardwareService=require(_0xd6ee('0x11'));var logger=require(_0xd6ee('0x12'))('api');var utils=require(_0xd6ee('0x13'));var config=require(_0xd6ee('0x14'));var licenseUtil=require(_0xd6ee('0x15'));var db=require(_0xd6ee('0x16'))['db'];function respondWithStatusCode(_0x268dd1,_0x3fd1df){_0x3fd1df=_0x3fd1df||0xcc;return function(_0x48be63){if(_0x48be63){return _0x268dd1[_0xd6ee('0x17')](_0x3fd1df);}return _0x268dd1[_0xd6ee('0x18')](_0x3fd1df)['end']();};}function respondWithResult(_0x369b4a,_0x15918d){_0x15918d=_0x15918d||0xc8;return function(_0x2bf3b2){if(_0x2bf3b2){return _0x369b4a[_0xd6ee('0x18')](_0x15918d)[_0xd6ee('0x19')](_0x2bf3b2);}};}function respondWithFilteredResult(_0xe66d0d,_0x49bafc){return function(_0x1c2e51){if(_0x1c2e51){var _0xb99b70=typeof _0x49bafc[_0xd6ee('0x1a')]==='undefined'&&typeof _0x49bafc[_0xd6ee('0x1b')]==='undefined';var _0x3a82bf=_0x1c2e51[_0xd6ee('0x1c')];var _0x81d533=_0xb99b70?0x0:_0x49bafc['offset'];var _0x8a2718=_0xb99b70?_0x1c2e51['count']:_0x49bafc[_0xd6ee('0x1a')]+_0x49bafc['limit'];var _0x31ae0f;if(_0x8a2718>=_0x3a82bf){_0x8a2718=_0x3a82bf;_0x31ae0f=0xc8;}else{_0x31ae0f=0xce;}_0xe66d0d[_0xd6ee('0x18')](_0x31ae0f);return _0xe66d0d[_0xd6ee('0x1d')](_0xd6ee('0x1e'),_0x81d533+'-'+_0x8a2718+'/'+_0x3a82bf)[_0xd6ee('0x19')](_0x1c2e51);}return null;};}function patchUpdates(_0x4b33f1){return function(_0xe2f8c4){try{jsonpatch['apply'](_0xe2f8c4,_0x4b33f1,!![]);}catch(_0x17e011){return BPromise[_0xd6ee('0x1f')](_0x17e011);}return _0xe2f8c4[_0xd6ee('0x20')]();};}function saveUpdates(_0x1abedc,_0xec9287){return function(_0x48e6ad){if(_0x48e6ad){return _0x48e6ad['update'](_0x1abedc)[_0xd6ee('0x21')](function(_0x511c18){return _0x511c18;});}return null;};}function removeEntity(_0x2bae66,_0x519373){return function(_0x391844){if(_0x391844){return _0x391844[_0xd6ee('0x22')]()[_0xd6ee('0x21')](function(){_0x2bae66[_0xd6ee('0x18')](0xcc)[_0xd6ee('0x23')]();});}};}function handleEntityNotFound(_0x5476f2,_0x4b1926){return function(_0x2f438c){if(!_0x2f438c){_0x5476f2[_0xd6ee('0x17')](0x194);}return _0x2f438c;};}function handleError(_0x4edb7d,_0x2c9b30){_0x2c9b30=_0x2c9b30||0x1f4;return function(_0xa1e700){logger[_0xd6ee('0x24')](_0xa1e700[_0xd6ee('0x25')]);if(_0xa1e700[_0xd6ee('0x26')]){delete _0xa1e700[_0xd6ee('0x26')];}_0x4edb7d[_0xd6ee('0x18')](_0x2c9b30)['send'](_0xa1e700);};}exports[_0xd6ee('0x27')]=function(_0x124ab7,_0x50b786){var _0x5bcdd6={},_0x1578b3={},_0x4580a7={'count':0x0,'rows':[]};var _0xddca=_[_0xd6ee('0x28')](db[_0xd6ee('0x29')]['rawAttributes'],function(_0x414015){return{'name':_0x414015[_0xd6ee('0x2a')],'type':_0x414015[_0xd6ee('0x2b')]['key']};});_0x1578b3[_0xd6ee('0x2c')]=_[_0xd6ee('0x28')](_0xddca,_0xd6ee('0x26'));_0x1578b3['query']=_[_0xd6ee('0x2d')](_0x124ab7[_0xd6ee('0x2e')]);_0x1578b3[_0xd6ee('0x2f')]=_[_0xd6ee('0x30')](_0x1578b3[_0xd6ee('0x2c')],_0x1578b3[_0xd6ee('0x2e')]);_0x5bcdd6['attributes']=_[_0xd6ee('0x30')](_0x1578b3[_0xd6ee('0x2c')],qs[_0xd6ee('0x31')](_0x124ab7[_0xd6ee('0x2e')]['fields']));_0x5bcdd6[_0xd6ee('0x32')]=_0x5bcdd6[_0xd6ee('0x32')][_0xd6ee('0x33')]?_0x5bcdd6['attributes']:_0x1578b3['model'];if(!_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x34')](_0xd6ee('0x35'))){_0x5bcdd6[_0xd6ee('0x1b')]=qs[_0xd6ee('0x1b')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x1b')]);_0x5bcdd6[_0xd6ee('0x1a')]=qs[_0xd6ee('0x1a')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x1a')]);}_0x5bcdd6[_0xd6ee('0x36')]=qs[_0xd6ee('0x37')](_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x37')]);_0x5bcdd6['where']=qs[_0xd6ee('0x2f')](_[_0xd6ee('0x38')](_0x124ab7[_0xd6ee('0x2e')],_0x1578b3['filters']),_0xddca);if(_0x124ab7['query']['filter']){_0x5bcdd6['where']=_[_0xd6ee('0x39')](_0x5bcdd6[_0xd6ee('0x3a')],{'$or':_[_0xd6ee('0x28')](_0xddca,function(_0x2a6d2f){if(_0x2a6d2f[_0xd6ee('0x2b')]!==_0xd6ee('0x3b')){var _0x2c975a={};_0x2c975a[_0x2a6d2f['name']]={'$like':'%'+_0x124ab7[_0xd6ee('0x2e')][_0xd6ee('0x3c')]+'%'};return _0x2c975a;}})});}_0x5bcdd6=_[_0xd6ee('0x39')]({},_0x5bcdd6,_0x124ab7[_0xd6ee('0x3d')]);var _0x407748={'where':_0x5bcdd6[_0xd6ee('0x3a')]};return db[_0xd6ee('0x29')][_0xd6ee('0x1c')](_0x407748)[_0xd6ee('0x21')](function(_0x24a7cb){_0x4580a7['count']=_0x24a7cb;if(_0x124ab7['query']['includeAll']){_0x5bcdd6[_0xd6ee('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0xd6ee('0x3f')](_0x5bcdd6);})[_0xd6ee('0x21')](function(_0x96aa7f){_0x4580a7[_0xd6ee('0x40')]=_0x96aa7f;return _0x4580a7;})[_0xd6ee('0x21')](respondWithFilteredResult(_0x50b786,_0x5bcdd6))['catch'](handleError(_0x50b786,null));};exports['show']=function(_0x4db1e9,_0x557936){var _0x3337a1={'raw':!![],'where':{'id':_0x4db1e9[_0xd6ee('0x41')]['id']}},_0xf38fc4={};_0xf38fc4[_0xd6ee('0x2c')]=_[_0xd6ee('0x2d')](db[_0xd6ee('0x29')][_0xd6ee('0x42')]);_0xf38fc4[_0xd6ee('0x2e')]=_[_0xd6ee('0x2d')](_0x4db1e9['query']);_0xf38fc4[_0xd6ee('0x2f')]=_[_0xd6ee('0x30')](_0xf38fc4['model'],_0xf38fc4[_0xd6ee('0x2e')]);_0x3337a1['attributes']=_['intersection'](_0xf38fc4[_0xd6ee('0x2c')],qs[_0xd6ee('0x31')](_0x4db1e9[_0xd6ee('0x2e')][_0xd6ee('0x31')]));_0x3337a1[_0xd6ee('0x32')]=_0x3337a1[_0xd6ee('0x32')]['length']?_0x3337a1['attributes']:_0xf38fc4[_0xd6ee('0x2c')];if(_0x4db1e9[_0xd6ee('0x2e')]['includeAll']){_0x3337a1[_0xd6ee('0x3e')]=[{'all':!![]}];}_0x3337a1=_['merge']({},_0x3337a1,_0x4db1e9[_0xd6ee('0x3d')]);return db[_0xd6ee('0x29')][_0xd6ee('0x43')](_0x3337a1)[_0xd6ee('0x21')](handleEntityNotFound(_0x557936,null))[_0xd6ee('0x21')](respondWithResult(_0x557936,null))[_0xd6ee('0x44')](handleError(_0x557936,null));};exports[_0xd6ee('0x45')]=function(_0x1b02c4,_0x37c3ba){return db[_0xd6ee('0x29')][_0xd6ee('0x45')](_0x1b02c4['body'],{})[_0xd6ee('0x21')](respondWithResult(_0x37c3ba,0xc9))[_0xd6ee('0x44')](handleError(_0x37c3ba,null));};exports[_0xd6ee('0x46')]=function(_0x360e34,_0x418680){if(_0x360e34[_0xd6ee('0x47')]['id']){delete _0x360e34[_0xd6ee('0x47')]['id'];}return db[_0xd6ee('0x29')][_0xd6ee('0x43')]({'where':{'id':_0x360e34[_0xd6ee('0x41')]['id']}})[_0xd6ee('0x21')](handleEntityNotFound(_0x418680,null))[_0xd6ee('0x21')](saveUpdates(_0x360e34['body'],null))[_0xd6ee('0x21')](respondWithResult(_0x418680,null))[_0xd6ee('0x44')](handleError(_0x418680,null));};exports[_0xd6ee('0x22')]=function(_0x52dfd3,_0x2f1bef){return db['Cdr'][_0xd6ee('0x43')]({'where':{'id':_0x52dfd3['params']['id']}})[_0xd6ee('0x21')](handleEntityNotFound(_0x2f1bef,null))[_0xd6ee('0x21')](removeEntity(_0x2f1bef,null))['catch'](handleError(_0x2f1bef,null));};exports[_0xd6ee('0x48')]=function(_0x164df4,_0xaef499){return db['Cdr'][_0xd6ee('0x48')]()[_0xd6ee('0x21')](respondWithResult(_0xaef499,null))['catch'](handleError(_0xaef499,null));};
\ No newline at end of file
+var _0x0e85=['json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x1dda71,_0x2bb545){var _0x5f2f56=function(_0x12b250){while(--_0x12b250){_0x1dda71['push'](_0x1dda71['shift']());}};_0x5f2f56(++_0x2bb545);}(_0x0e85,0x7c));var _0x50e8=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0e85[_0x31a371];return _0x2a5bd6;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['map'](_0x126c99,'name');_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x30fedf[_0x50e8('0x2e')]);_0x4f0b88['filters']=_['intersection'](_0x4f0b88[_0x50e8('0x2d')],_0x4f0b88[_0x50e8('0x2e')]);_0x42bbef['attributes']=_[_0x50e8('0x30')](_0x4f0b88[_0x50e8('0x2d')],qs[_0x50e8('0x31')](_0x30fedf[_0x50e8('0x2e')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef['attributes'][_0x50e8('0x33')]?_0x42bbef[_0x50e8('0x32')]:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf['query'][_0x50e8('0x34')](_0x50e8('0x35'))){_0x42bbef['limit']=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1d')]);_0x42bbef[_0x50e8('0x1b')]=qs['offset'](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1b')]);}_0x42bbef[_0x50e8('0x36')]=qs[_0x50e8('0x37')](_0x30fedf['query'][_0x50e8('0x37')]);_0x42bbef[_0x50e8('0x38')]=qs[_0x50e8('0x39')](_['pick'](_0x30fedf['query'],_0x4f0b88['filters']),_0x126c99);if(_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]){_0x42bbef[_0x50e8('0x38')]=_[_0x50e8('0x3b')](_0x42bbef[_0x50e8('0x38')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0xb566c2){if(_0xb566c2[_0x50e8('0x3c')]!==_0x50e8('0x3d')){var _0x3a1b4d={};_0x3a1b4d[_0xb566c2['name']]={'$like':'%'+_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]+'%'};return _0x3a1b4d;}})});}_0x42bbef=_[_0x50e8('0x3b')]({},_0x42bbef,_0x30fedf[_0x50e8('0x3e')]);var _0x5dbbe1={'where':_0x42bbef[_0x50e8('0x38')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x5dbbe1)[_0x50e8('0x23')](function(_0x8e8a97){_0x1041b9['count']=_0x8e8a97;if(_0x30fedf['query'][_0x50e8('0x3f')]){_0x42bbef[_0x50e8('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x50e8('0x41')](_0x42bbef);})[_0x50e8('0x23')](function(_0x3db1ab){_0x1041b9[_0x50e8('0x42')]=_0x3db1ab;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x43')](handleError(_0x39c0c6,null));};exports[_0x50e8('0x44')]=function(_0x172049,_0x5e9da3){var _0x3d26bd={'raw':!![],'where':{'id':_0x172049[_0x50e8('0x45')]['id']}},_0x44e0ca={};_0x44e0ca[_0x50e8('0x2d')]=_['keys'](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x44e0ca[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x172049['query']);_0x44e0ca[_0x50e8('0x39')]=_['intersection'](_0x44e0ca['model'],_0x44e0ca['query']);_0x3d26bd[_0x50e8('0x32')]=_[_0x50e8('0x30')](_0x44e0ca['model'],qs[_0x50e8('0x31')](_0x172049[_0x50e8('0x2e')][_0x50e8('0x31')]));_0x3d26bd[_0x50e8('0x32')]=_0x3d26bd[_0x50e8('0x32')][_0x50e8('0x33')]?_0x3d26bd['attributes']:_0x44e0ca[_0x50e8('0x2d')];if(_0x172049['query'][_0x50e8('0x3f')]){_0x3d26bd[_0x50e8('0x40')]=[{'all':!![]}];}_0x3d26bd=_['merge']({},_0x3d26bd,_0x172049[_0x50e8('0x3e')]);return db['Cdr'][_0x50e8('0x46')](_0x3d26bd)[_0x50e8('0x23')](handleEntityNotFound(_0x5e9da3,null))[_0x50e8('0x23')](respondWithResult(_0x5e9da3,null))[_0x50e8('0x43')](handleError(_0x5e9da3,null));};exports[_0x50e8('0x47')]=function(_0x3f72ea,_0x229d60){return db[_0x50e8('0x29')][_0x50e8('0x47')](_0x3f72ea[_0x50e8('0x48')],{})[_0x50e8('0x23')](respondWithResult(_0x229d60,0xc9))['catch'](handleError(_0x229d60,null));};exports[_0x50e8('0x22')]=function(_0x275a1b,_0x479431){if(_0x275a1b[_0x50e8('0x48')]['id']){delete _0x275a1b['body']['id'];}return db[_0x50e8('0x29')]['find']({'where':{'id':_0x275a1b[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x479431,null))[_0x50e8('0x23')](saveUpdates(_0x275a1b[_0x50e8('0x48')],null))[_0x50e8('0x23')](respondWithResult(_0x479431,null))[_0x50e8('0x43')](handleError(_0x479431,null));};exports[_0x50e8('0x49')]=function(_0x5f256a,_0x3410f3){return db[_0x50e8('0x29')][_0x50e8('0x46')]({'where':{'id':_0x5f256a[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x3410f3,null))[_0x50e8('0x23')](removeEntity(_0x3410f3,null))['catch'](handleError(_0x3410f3,null));};exports[_0x50e8('0x4a')]=function(_0x250b28,_0xff2e24){return db[_0x50e8('0x29')]['describe']()[_0x50e8('0x23')](respondWithResult(_0xff2e24,null))[_0x50e8('0x43')](handleError(_0xff2e24,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 2f1bf92..ec10ab3 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(_0x9b51cd,_0x11c283){var _0x1613af=function(_0x591678){while(--_0x591678){_0x9b51cd['push'](_0x9b51cd['shift']());}};_0x1613af(++_0x11c283);}(_0x7a54,0x106));var _0x47a5=function(_0x1c69e0,_0x611d3f){_0x1c69e0=_0x1c69e0-0x0;var _0x241a55=_0x7a54[_0x1c69e0];return _0x241a55;};'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(_0x3b49ee,_0x4c25f5){var _0x3e07b5=function(_0x38bed4){while(--_0x38bed4){_0x3b49ee['push'](_0x3b49ee['shift']());}};_0x3e07b5(++_0x4c25f5);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 a964793..eb3b12e 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 _0xd5f1=['../../config/environment','jayson/promise','client','request','Cdr,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x73862b,_0x53772f){var _0x5616b1=function(_0x276e16){while(--_0x276e16){_0x73862b['push'](_0x73862b['shift']());}};_0x5616b1(++_0x53772f);}(_0xd5f1,0xb4));var _0x1d5f=function(_0x4108e9,_0x58da63){_0x4108e9=_0x4108e9-0x0;var _0x369cc4=_0xd5f1[_0x4108e9];return _0x369cc4;};'use strict';var _=require(_0x1d5f('0x0'));var util=require(_0x1d5f('0x1'));var moment=require('moment');var BPromise=require(_0x1d5f('0x2'));var rs=require(_0x1d5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d5f('0x4'))['db'];var utils=require(_0x1d5f('0x5'));var logger=require(_0x1d5f('0x6'))('rpc');var config=require(_0x1d5f('0x7'));var jayson=require(_0x1d5f('0x8'));var client=jayson[_0x1d5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26496f,_0x11c2c7,_0x54e033){return new BPromise(function(_0x15813d,_0xcfe34e){return client[_0x1d5f('0xa')](_0x26496f,_0x54e033)['then'](function(_0x4ed6f2){logger['info'](_0x1d5f('0xb'),_0x11c2c7,_0x1d5f('0xc'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x11c2c7,_0x1d5f('0xc'),JSON['stringify'](_0x4ed6f2));if(_0x4ed6f2[_0x1d5f('0xd')]){if(_0x4ed6f2[_0x1d5f('0xd')][_0x1d5f('0xe')]===0x1f4){logger[_0x1d5f('0xd')](_0x1d5f('0xb'),_0x11c2c7,_0x4ed6f2[_0x1d5f('0xd')][_0x1d5f('0xf')]);return _0xcfe34e(_0x4ed6f2[_0x1d5f('0xd')][_0x1d5f('0xf')]);}logger[_0x1d5f('0xd')](_0x1d5f('0xb'),_0x11c2c7,_0x4ed6f2[_0x1d5f('0xd')][_0x1d5f('0xf')]);return _0x15813d(_0x4ed6f2[_0x1d5f('0xd')][_0x1d5f('0xf')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x11c2c7,_0x1d5f('0xc'));_0x15813d(_0x4ed6f2[_0x1d5f('0x10')][_0x1d5f('0xf')]);}})['catch'](function(_0x5cd938){logger[_0x1d5f('0xd')](_0x1d5f('0xb'),_0x11c2c7,_0x5cd938);_0xcfe34e(_0x5cd938);});});}
\ No newline at end of file
+var _0xe852=['info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xe852,0x15a));var _0x2e85=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xe852[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x2e85('0x0'));var util=require(_0x2e85('0x1'));var moment=require('moment');var BPromise=require(_0x2e85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2e85('0x3'));var logger=require(_0x2e85('0x4'))(_0x2e85('0x5'));var config=require(_0x2e85('0x6'));var jayson=require(_0x2e85('0x7'));var client=jayson[_0x2e85('0x8')][_0x2e85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8907ba,_0x3778ad,_0x388fd6){return new BPromise(function(_0x520552,_0x2efc7c){return client[_0x2e85('0xa')](_0x8907ba,_0x388fd6)['then'](function(_0x2f7237){logger[_0x2e85('0xb')]('Cdr,\x20%s,\x20%s',_0x3778ad,_0x2e85('0xc'));logger[_0x2e85('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x3778ad,'request\x20sent',JSON[_0x2e85('0xe')](_0x2f7237));if(_0x2f7237[_0x2e85('0xf')]){if(_0x2f7237[_0x2e85('0xf')][_0x2e85('0x10')]===0x1f4){logger['error'](_0x2e85('0x11'),_0x3778ad,_0x2f7237['error'][_0x2e85('0x12')]);return _0x2efc7c(_0x2f7237[_0x2e85('0xf')][_0x2e85('0x12')]);}logger[_0x2e85('0xf')](_0x2e85('0x11'),_0x3778ad,_0x2f7237[_0x2e85('0xf')][_0x2e85('0x12')]);return _0x520552(_0x2f7237[_0x2e85('0xf')][_0x2e85('0x12')]);}else{logger[_0x2e85('0xb')]('Cdr,\x20%s,\x20%s',_0x3778ad,_0x2e85('0xc'));_0x520552(_0x2f7237[_0x2e85('0x13')][_0x2e85('0x12')]);}})[_0x2e85('0x14')](function(_0x18004d){logger[_0x2e85('0xf')](_0x2e85('0x11'),_0x3778ad,_0x18004d);_0x2efc7c(_0x18004d);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 27c4845..c3ee563 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2d595f,_0xdfdb46){var _0x1e26a2=function(_0x17f26a){while(--_0x17f26a){_0x2d595f['push'](_0x2d595f['shift']());}};_0x1e26a2(++_0xdfdb46);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x437ea9,_0x55c4cd){var _0x5c04b4=function(_0x8d7a4a){while(--_0x8d7a4a){_0x437ea9['push'](_0x437ea9['shift']());}};_0x5c04b4(++_0x55c4cd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 548ea8a..cabdbdd 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 _0xa128=['INTEGER','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x17b9b7,_0x4e4f73){var _0x8b11f7=function(_0xb599cb){while(--_0xb599cb){_0x17b9b7['push'](_0x17b9b7['shift']());}};_0x8b11f7(++_0x4e4f73);}(_0xa128,0x16c));var _0x8a12=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa128[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x8a12('0x0'));module[_0x8a12('0x1')]={'priority':{'type':Sequelize[_0x8a12('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8a12('0x3')]()},'description':{'type':Sequelize[_0x8a12('0x4')]},'interval':{'type':Sequelize[_0x8a12('0x4')],'defaultValue':_0x8a12('0x5')}};
\ No newline at end of file
+var _0x874b=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x874b,0x147));var _0xb874=function(_0x9166ea,_0x1f21b0){_0x9166ea=_0x9166ea-0x0;var _0xdceec9=_0x874b[_0x9166ea];return _0xdceec9;};'use strict';var Sequelize=require(_0xb874('0x0'));module[_0xb874('0x1')]={'priority':{'type':Sequelize[_0xb874('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb874('0x3')]()},'description':{'type':Sequelize[_0xb874('0x4')]},'interval':{'type':Sequelize[_0xb874('0x4')],'defaultValue':_0xb874('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index aed48b7..f6590ca 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 _0x7035=['then','error','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','attributes','fields','includeAll','include','merge','find','catch','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x7035,0x15e));var _0x5703=function(_0x21d4b3,_0x965f71){_0x21d4b3=_0x21d4b3-0x0;var _0x367832=_0x7035[_0x21d4b3];return _0x367832;};'use strict';var emlformat=require(_0x5703('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5703('0x1'));var jsonpatch=require(_0x5703('0x2'));var rp=require('request-promise');var moment=require(_0x5703('0x3'));var BPromise=require(_0x5703('0x4'));var Mustache=require(_0x5703('0x5'));var util=require(_0x5703('0x6'));var path=require(_0x5703('0x7'));var sox=require('sox');var csv=require(_0x5703('0x8'));var ejs=require(_0x5703('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5703('0xa'));var squel=require(_0x5703('0xb'));var crypto=require(_0x5703('0xc'));var jsforce=require(_0x5703('0xd'));var deskjs=require(_0x5703('0xe'));var toCsv=require(_0x5703('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5703('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5703('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5703('0x11'))(_0x5703('0x12'));var utils=require(_0x5703('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5703('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36b5b4,_0x360cc8){_0x360cc8=_0x360cc8||0xcc;return function(_0x4868ad){if(_0x4868ad){return _0x36b5b4[_0x5703('0x15')](_0x360cc8);}return _0x36b5b4[_0x5703('0x16')](_0x360cc8)[_0x5703('0x17')]();};}function respondWithResult(_0xac9482,_0x3e0cac){_0x3e0cac=_0x3e0cac||0xc8;return function(_0x2e845b){if(_0x2e845b){return _0xac9482[_0x5703('0x16')](_0x3e0cac)[_0x5703('0x18')](_0x2e845b);}};}function respondWithFilteredResult(_0x4a3e78,_0x6dbb73){return function(_0x2f6305){if(_0x2f6305){var _0x46dbca=typeof _0x6dbb73[_0x5703('0x19')]===_0x5703('0x1a')&&typeof _0x6dbb73[_0x5703('0x1b')]===_0x5703('0x1a');var _0x8d0996=_0x2f6305[_0x5703('0x1c')];var _0x595fca=_0x46dbca?0x0:_0x6dbb73[_0x5703('0x19')];var _0xba6348=_0x46dbca?_0x2f6305['count']:_0x6dbb73['offset']+_0x6dbb73[_0x5703('0x1b')];var _0x9ab50a;if(_0xba6348>=_0x8d0996){_0xba6348=_0x8d0996;_0x9ab50a=0xc8;}else{_0x9ab50a=0xce;}_0x4a3e78['status'](_0x9ab50a);return _0x4a3e78[_0x5703('0x1d')]('Content-Range',_0x595fca+'-'+_0xba6348+'/'+_0x8d0996)[_0x5703('0x18')](_0x2f6305);}return null;};}function patchUpdates(_0x33d30a){return function(_0x1d5a40){try{jsonpatch[_0x5703('0x1e')](_0x1d5a40,_0x33d30a,!![]);}catch(_0x2a23a3){return BPromise[_0x5703('0x1f')](_0x2a23a3);}return _0x1d5a40[_0x5703('0x20')]();};}function saveUpdates(_0x4f5ebe,_0x4f90e7){return function(_0x2f4d83){if(_0x2f4d83){return _0x2f4d83[_0x5703('0x21')](_0x4f5ebe)['then'](function(_0x28ff84){return _0x28ff84;});}return null;};}function removeEntity(_0x245abf,_0x48746a){return function(_0x27da08){if(_0x27da08){return _0x27da08[_0x5703('0x22')]()[_0x5703('0x23')](function(){_0x245abf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5326dc,_0x1dbf0d){return function(_0x495db2){if(!_0x495db2){_0x5326dc[_0x5703('0x15')](0x194);}return _0x495db2;};}function handleError(_0x1c1e18,_0x46ad74){_0x46ad74=_0x46ad74||0x1f4;return function(_0x25e518){logger[_0x5703('0x24')](_0x25e518['stack']);if(_0x25e518[_0x5703('0x25')]){delete _0x25e518['name'];}_0x1c1e18[_0x5703('0x16')](_0x46ad74)[_0x5703('0x26')](_0x25e518);};}exports[_0x5703('0x27')]=function(_0x4b23ed,_0x4352c1){var _0x2e2a25={'raw':!![],'where':{'id':_0x4b23ed[_0x5703('0x28')]['id']}},_0x4c1bcd={};_0x4c1bcd[_0x5703('0x29')]=_[_0x5703('0x2a')](db[_0x5703('0x2b')]['rawAttributes']);_0x4c1bcd['query']=_[_0x5703('0x2a')](_0x4b23ed[_0x5703('0x2c')]);_0x4c1bcd[_0x5703('0x2d')]=_[_0x5703('0x2e')](_0x4c1bcd[_0x5703('0x29')],_0x4c1bcd[_0x5703('0x2c')]);_0x2e2a25[_0x5703('0x2f')]=_[_0x5703('0x2e')](_0x4c1bcd[_0x5703('0x29')],qs[_0x5703('0x30')](_0x4b23ed[_0x5703('0x2c')][_0x5703('0x30')]));_0x2e2a25[_0x5703('0x2f')]=_0x2e2a25['attributes']['length']?_0x2e2a25['attributes']:_0x4c1bcd[_0x5703('0x29')];if(_0x4b23ed[_0x5703('0x2c')][_0x5703('0x31')]){_0x2e2a25[_0x5703('0x32')]=[{'all':!![]}];}_0x2e2a25=_[_0x5703('0x33')]({},_0x2e2a25,_0x4b23ed['options']);return db[_0x5703('0x2b')][_0x5703('0x34')](_0x2e2a25)[_0x5703('0x23')](handleEntityNotFound(_0x4352c1,null))['then'](respondWithResult(_0x4352c1,null))[_0x5703('0x35')](handleError(_0x4352c1,null));};exports[_0x5703('0x21')]=function(_0x2351ac,_0x2eab10){if(_0x2351ac['body']['id']){delete _0x2351ac[_0x5703('0x36')]['id'];}return db[_0x5703('0x2b')]['find']({'where':{'id':_0x2351ac[_0x5703('0x28')]['id']}})[_0x5703('0x23')](handleEntityNotFound(_0x2eab10,null))[_0x5703('0x23')](saveUpdates(_0x2351ac['body'],null))[_0x5703('0x23')](respondWithResult(_0x2eab10,null))['catch'](handleError(_0x2eab10,null));};exports[_0x5703('0x22')]=function(_0x319aa6,_0x171748){return db[_0x5703('0x2b')]['find']({'where':{'id':_0x319aa6['params']['id']}})[_0x5703('0x23')](handleEntityNotFound(_0x171748,null))[_0x5703('0x23')](removeEntity(_0x171748,null))[_0x5703('0x35')](handleError(_0x171748,null));};
\ No newline at end of file
+var _0xdb76=['Content-Range','apply','reject','save','then','destroy','end','error','stack','send','show','params','model','ChatApplication','query','keys','filters','attributes','intersection','fields','length','includeAll','merge','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x2a033e,_0x150109){var _0xed1d3c=function(_0x5e8c88){while(--_0x5e8c88){_0x2a033e['push'](_0x2a033e['shift']());}};_0xed1d3c(++_0x150109);}(_0xdb76,0x1be));var _0x6db7=function(_0x3de5ab,_0x40a1d8){_0x3de5ab=_0x3de5ab-0x0;var _0x28be50=_0xdb76[_0x3de5ab];return _0x28be50;};'use strict';var emlformat=require(_0x6db7('0x0'));var rimraf=require(_0x6db7('0x1'));var zipdir=require(_0x6db7('0x2'));var jsonpatch=require(_0x6db7('0x3'));var rp=require(_0x6db7('0x4'));var moment=require('moment');var BPromise=require(_0x6db7('0x5'));var Mustache=require(_0x6db7('0x6'));var util=require(_0x6db7('0x7'));var path=require(_0x6db7('0x8'));var sox=require('sox');var csv=require(_0x6db7('0x9'));var ejs=require(_0x6db7('0xa'));var fs=require('fs');var fs_extra=require(_0x6db7('0xb'));var _=require(_0x6db7('0xc'));var squel=require(_0x6db7('0xd'));var crypto=require('crypto');var jsforce=require(_0x6db7('0xe'));var deskjs=require(_0x6db7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6db7('0x10'));var Papa=require(_0x6db7('0x11'));var Redis=require(_0x6db7('0x12'));var authService=require(_0x6db7('0x13'));var qs=require(_0x6db7('0x14'));var as=require(_0x6db7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6db7('0x16'));var utils=require(_0x6db7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6db7('0x18'));var db=require(_0x6db7('0x19'))['db'];function respondWithStatusCode(_0x421d28,_0x1658dd){_0x1658dd=_0x1658dd||0xcc;return function(_0x375f4a){if(_0x375f4a){return _0x421d28[_0x6db7('0x1a')](_0x1658dd);}return _0x421d28['status'](_0x1658dd)['end']();};}function respondWithResult(_0x426d31,_0x348ccf){_0x348ccf=_0x348ccf||0xc8;return function(_0x167384){if(_0x167384){return _0x426d31[_0x6db7('0x1b')](_0x348ccf)[_0x6db7('0x1c')](_0x167384);}};}function respondWithFilteredResult(_0x28dd67,_0x144684){return function(_0x43f66c){if(_0x43f66c){var _0x1432ac=typeof _0x144684[_0x6db7('0x1d')]===_0x6db7('0x1e')&&typeof _0x144684[_0x6db7('0x1f')]==='undefined';var _0x3c97b2=_0x43f66c[_0x6db7('0x20')];var _0x331e92=_0x1432ac?0x0:_0x144684[_0x6db7('0x1d')];var _0x37ffe3=_0x1432ac?_0x43f66c[_0x6db7('0x20')]:_0x144684[_0x6db7('0x1d')]+_0x144684[_0x6db7('0x1f')];var _0x3f8575;if(_0x37ffe3>=_0x3c97b2){_0x37ffe3=_0x3c97b2;_0x3f8575=0xc8;}else{_0x3f8575=0xce;}_0x28dd67[_0x6db7('0x1b')](_0x3f8575);return _0x28dd67[_0x6db7('0x21')](_0x6db7('0x22'),_0x331e92+'-'+_0x37ffe3+'/'+_0x3c97b2)['json'](_0x43f66c);}return null;};}function patchUpdates(_0x1cae66){return function(_0x206aa2){try{jsonpatch[_0x6db7('0x23')](_0x206aa2,_0x1cae66,!![]);}catch(_0x46a383){return BPromise[_0x6db7('0x24')](_0x46a383);}return _0x206aa2[_0x6db7('0x25')]();};}function saveUpdates(_0x4a78f7,_0x1b0f04){return function(_0x2795ab){if(_0x2795ab){return _0x2795ab['update'](_0x4a78f7)[_0x6db7('0x26')](function(_0x1ba956){return _0x1ba956;});}return null;};}function removeEntity(_0x7ca54f,_0x48e3af){return function(_0x24d818){if(_0x24d818){return _0x24d818[_0x6db7('0x27')]()['then'](function(){_0x7ca54f[_0x6db7('0x1b')](0xcc)[_0x6db7('0x28')]();});}};}function handleEntityNotFound(_0x2d6fca,_0x558d58){return function(_0x559e14){if(!_0x559e14){_0x2d6fca[_0x6db7('0x1a')](0x194);}return _0x559e14;};}function handleError(_0x105b81,_0xdbd9f1){_0xdbd9f1=_0xdbd9f1||0x1f4;return function(_0x4f28e9){logger[_0x6db7('0x29')](_0x4f28e9[_0x6db7('0x2a')]);if(_0x4f28e9['name']){delete _0x4f28e9['name'];}_0x105b81[_0x6db7('0x1b')](_0xdbd9f1)[_0x6db7('0x2b')](_0x4f28e9);};}exports[_0x6db7('0x2c')]=function(_0x3890f0,_0x11185d){var _0xc4f615={'raw':!![],'where':{'id':_0x3890f0[_0x6db7('0x2d')]['id']}},_0x4fb6dd={};_0x4fb6dd[_0x6db7('0x2e')]=_['keys'](db[_0x6db7('0x2f')]['rawAttributes']);_0x4fb6dd[_0x6db7('0x30')]=_[_0x6db7('0x31')](_0x3890f0[_0x6db7('0x30')]);_0x4fb6dd[_0x6db7('0x32')]=_['intersection'](_0x4fb6dd[_0x6db7('0x2e')],_0x4fb6dd[_0x6db7('0x30')]);_0xc4f615[_0x6db7('0x33')]=_[_0x6db7('0x34')](_0x4fb6dd[_0x6db7('0x2e')],qs['fields'](_0x3890f0[_0x6db7('0x30')][_0x6db7('0x35')]));_0xc4f615[_0x6db7('0x33')]=_0xc4f615['attributes'][_0x6db7('0x36')]?_0xc4f615[_0x6db7('0x33')]:_0x4fb6dd[_0x6db7('0x2e')];if(_0x3890f0['query'][_0x6db7('0x37')]){_0xc4f615['include']=[{'all':!![]}];}_0xc4f615=_[_0x6db7('0x38')]({},_0xc4f615,_0x3890f0['options']);return db['ChatApplication'][_0x6db7('0x39')](_0xc4f615)[_0x6db7('0x26')](handleEntityNotFound(_0x11185d,null))[_0x6db7('0x26')](respondWithResult(_0x11185d,null))[_0x6db7('0x3a')](handleError(_0x11185d,null));};exports['update']=function(_0x5cfca3,_0x3f7973){if(_0x5cfca3[_0x6db7('0x3b')]['id']){delete _0x5cfca3['body']['id'];}return db[_0x6db7('0x2f')]['find']({'where':{'id':_0x5cfca3[_0x6db7('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3f7973,null))[_0x6db7('0x26')](saveUpdates(_0x5cfca3['body'],null))['then'](respondWithResult(_0x3f7973,null))[_0x6db7('0x3a')](handleError(_0x3f7973,null));};exports[_0x6db7('0x27')]=function(_0x384fbf,_0x20b875){return db[_0x6db7('0x2f')]['find']({'where':{'id':_0x384fbf[_0x6db7('0x2d')]['id']}})[_0x6db7('0x26')](handleEntityNotFound(_0x20b875,null))[_0x6db7('0x26')](removeEntity(_0x20b875,null))[_0x6db7('0x3a')](handleError(_0x20b875,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 2fd5d84..4bc71df 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 _0x5a8b=['request-promise','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','util','../../config/logger','api','moment','bluebird'];(function(_0x5df5e1,_0x3e0305){var _0x2fffd3=function(_0x532a7c){while(--_0x532a7c){_0x5df5e1['push'](_0x5df5e1['shift']());}};_0x2fffd3(++_0x3e0305);}(_0x5a8b,0x103));var _0xb5a8=function(_0x3f7a65,_0x284f1c){_0x3f7a65=_0x3f7a65-0x0;var _0x1915f5=_0x5a8b[_0x3f7a65];return _0x1915f5;};'use strict';var _=require('lodash');var util=require(_0xb5a8('0x0'));var logger=require(_0xb5a8('0x1'))(_0xb5a8('0x2'));var moment=require(_0xb5a8('0x3'));var BPromise=require(_0xb5a8('0x4'));var rp=require(_0xb5a8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb5a8('0x6'));var attributes=require(_0xb5a8('0x7'));module[_0xb5a8('0x8')]=function(_0x7acf58,_0x36de42){return _0x7acf58['define'](_0xb5a8('0x9'),attributes,{'tableName':_0xb5a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb5a8('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9ef8=['util','api','moment','bluebird','path','rimraf','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1cf825,_0x35f9ae){var _0x3f739f=function(_0x573ca3){while(--_0x573ca3){_0x1cf825['push'](_0x1cf825['shift']());}};_0x3f739f(++_0x35f9ae);}(_0x9ef8,0x17f));var _0x89ef=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0x9ef8[_0x16dbcd];return _0x34706e;};'use strict';var _=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var logger=require('../../config/logger')(_0x89ef('0x2'));var moment=require(_0x89ef('0x3'));var BPromise=require(_0x89ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ef('0x5'));var rimraf=require(_0x89ef('0x6'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x383019,_0x2e117e){return _0x383019[_0x89ef('0x7')](_0x89ef('0x8'),attributes,{'tableName':_0x89ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x89ef('0xa'),'collate':_0x89ef('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 52a2f12..9c23ac2 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 _0x6ea4=['ChatApplication,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0x6ea4,0x1ac));var _0x46ea=function(_0x47fd6e,_0x4e4e0c){_0x47fd6e=_0x47fd6e-0x0;var _0x4ca7ca=_0x6ea4[_0x47fd6e];return _0x4ca7ca;};'use strict';var _=require(_0x46ea('0x0'));var util=require('util');var moment=require(_0x46ea('0x1'));var BPromise=require(_0x46ea('0x2'));var rs=require(_0x46ea('0x3'));var fs=require('fs');var Redis=require(_0x46ea('0x4'));var db=require(_0x46ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46ea('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x46ea('0x7'));var client=jayson[_0x46ea('0x8')][_0x46ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x330559,_0x2dfd19,_0x2bbce){return new BPromise(function(_0x39237e,_0x29d1e7){return client[_0x46ea('0xa')](_0x330559,_0x2bbce)[_0x46ea('0xb')](function(_0x2d8ccf){logger['info'](_0x46ea('0xc'),_0x2dfd19,'request\x20sent');logger[_0x46ea('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2dfd19,_0x46ea('0xe'),JSON['stringify'](_0x2d8ccf));if(_0x2d8ccf[_0x46ea('0xf')]){if(_0x2d8ccf[_0x46ea('0xf')]['code']===0x1f4){logger[_0x46ea('0xf')](_0x46ea('0xc'),_0x2dfd19,_0x2d8ccf[_0x46ea('0xf')][_0x46ea('0x10')]);return _0x29d1e7(_0x2d8ccf['error'][_0x46ea('0x10')]);}logger['error'](_0x46ea('0xc'),_0x2dfd19,_0x2d8ccf[_0x46ea('0xf')][_0x46ea('0x10')]);return _0x39237e(_0x2d8ccf[_0x46ea('0xf')][_0x46ea('0x10')]);}else{logger[_0x46ea('0x11')](_0x46ea('0xc'),_0x2dfd19,_0x46ea('0xe'));_0x39237e(_0x2d8ccf[_0x46ea('0x12')]['message']);}})[_0x46ea('0x13')](function(_0x16654d){logger[_0x46ea('0xf')]('ChatApplication,\x20%s,\x20%s',_0x2dfd19,_0x16654d);_0x29d1e7(_0x16654d);});});}
\ No newline at end of file
+var _0x1b51=['stringify','error','code','message','info','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x4aae6b,_0x386b16){var _0x22bc72=function(_0x309479){while(--_0x309479){_0x4aae6b['push'](_0x4aae6b['shift']());}};_0x22bc72(++_0x386b16);}(_0x1b51,0xed));var _0x11b5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1b51[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x11b5('0x0'));var util=require('util');var moment=require(_0x11b5('0x1'));var BPromise=require('bluebird');var rs=require(_0x11b5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11b5('0x3'))['db'];var utils=require(_0x11b5('0x4'));var logger=require('../../config/logger')(_0x11b5('0x5'));var config=require(_0x11b5('0x6'));var jayson=require(_0x11b5('0x7'));var client=jayson[_0x11b5('0x8')][_0x11b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2020e5,_0x1a498b,_0x8d461a){return new BPromise(function(_0x5e90d3,_0x121be4){return client['request'](_0x2020e5,_0x8d461a)[_0x11b5('0xa')](function(_0x1a6000){logger['info'](_0x11b5('0xb'),_0x1a498b,_0x11b5('0xc'));logger[_0x11b5('0xd')](_0x11b5('0xe'),_0x1a498b,_0x11b5('0xc'),JSON[_0x11b5('0xf')](_0x1a6000));if(_0x1a6000[_0x11b5('0x10')]){if(_0x1a6000[_0x11b5('0x10')][_0x11b5('0x11')]===0x1f4){logger[_0x11b5('0x10')]('ChatApplication,\x20%s,\x20%s',_0x1a498b,_0x1a6000['error'][_0x11b5('0x12')]);return _0x121be4(_0x1a6000[_0x11b5('0x10')][_0x11b5('0x12')]);}logger['error'](_0x11b5('0xb'),_0x1a498b,_0x1a6000[_0x11b5('0x10')][_0x11b5('0x12')]);return _0x5e90d3(_0x1a6000['error']['message']);}else{logger[_0x11b5('0x13')](_0x11b5('0xb'),_0x1a498b,_0x11b5('0xc'));_0x5e90d3(_0x1a6000['result'][_0x11b5('0x12')]);}})[_0x11b5('0x14')](function(_0x47ca8e){logger[_0x11b5('0x10')](_0x11b5('0xb'),_0x1a498b,_0x47ca8e);_0x121be4(_0x47ca8e);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index b55442e..397a97e 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 _0xaad5=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3ad55b,_0x53df62){var _0x239956=function(_0x249bb8){while(--_0x249bb8){_0x3ad55b['push'](_0x3ad55b['shift']());}};_0x239956(++_0x53df62);}(_0xaad5,0x13c));var _0x5aad=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xaad5[_0x609988];return _0x159984;};'use strict';var multer=require(_0x5aad('0x0'));var util=require(_0x5aad('0x1'));var path=require(_0x5aad('0x2'));var timeout=require('connect-timeout');var express=require(_0x5aad('0x3'));var router=express[_0x5aad('0x4')]();var fs_extra=require(_0x5aad('0x5'));var auth=require(_0x5aad('0x6'));var interaction=require(_0x5aad('0x7'));var config=require(_0x5aad('0x8'));var controller=require(_0x5aad('0x9'));router[_0x5aad('0xa')](_0x5aad('0xb'),auth[_0x5aad('0xc')](),controller[_0x5aad('0xd')]);router[_0x5aad('0xe')](_0x5aad('0xb'),auth[_0x5aad('0xc')](),controller[_0x5aad('0xf')]);router['delete'](_0x5aad('0xb'),auth['isAuthenticated'](),controller[_0x5aad('0x10')]);module[_0x5aad('0x11')]=router;
\ No newline at end of file
+var _0xbd4e=['update','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbd4e,0x7b));var _0xebd4=function(_0x32365c,_0x453f9f){_0x32365c=_0x32365c-0x0;var _0x34ff18=_0xbd4e[_0x32365c];return _0x34ff18;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xebd4('0x0'));var router=express[_0xebd4('0x1')]();var fs_extra=require(_0xebd4('0x2'));var auth=require(_0xebd4('0x3'));var interaction=require(_0xebd4('0x4'));var config=require(_0xebd4('0x5'));var controller=require(_0xebd4('0x6'));router[_0xebd4('0x7')](_0xebd4('0x8'),auth[_0xebd4('0x9')](),controller[_0xebd4('0xa')]);router[_0xebd4('0xb')](_0xebd4('0x8'),auth[_0xebd4('0x9')](),controller[_0xebd4('0xc')]);router['delete'](_0xebd4('0x8'),auth[_0xebd4('0x9')](),controller[_0xebd4('0xd')]);module[_0xebd4('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4d9ccec..f916ad0 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 _0x62fd=['BOOLEAN','sequelize','STRING'];(function(_0x57ff9f,_0x43f627){var _0x14be3d=function(_0x2a21eb){while(--_0x2a21eb){_0x57ff9f['push'](_0x57ff9f['shift']());}};_0x14be3d(++_0x43f627);}(_0x62fd,0x14b));var _0xd62f=function(_0x51effc,_0x49310e){_0x51effc=_0x51effc-0x0;var _0x13e119=_0x62fd[_0x51effc];return _0x13e119;};'use strict';var Sequelize=require(_0xd62f('0x0'));module['exports']={'name':{'type':Sequelize[_0xd62f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xd62f('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2b0a=['sequelize','exports','STRING'];(function(_0x687c0a,_0x3aac82){var _0x8fdcb5=function(_0x318f0b){while(--_0x318f0b){_0x687c0a['push'](_0x687c0a['shift']());}};_0x8fdcb5(++_0x3aac82);}(_0x2b0a,0x84));var _0xa2b0=function(_0x1ac237,_0x515063){_0x1ac237=_0x1ac237-0x0;var _0x752098=_0x2b0a[_0x1ac237];return _0x752098;};'use strict';var Sequelize=require(_0xa2b0('0x0'));module[_0xa2b0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa2b0('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index d33317a..3a790ee 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 _0xcd9a=['YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','filter','VIRTUAL','merge','ChatGroup','includeAll','include','findAll','rows','show','params','length','options','find','create','body','catch','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','order','$gte','split','format'];(function(_0x4fb485,_0x11f189){var _0x5c9872=function(_0x2a3fe0){while(--_0x2a3fe0){_0x4fb485['push'](_0x4fb485['shift']());}};_0x5c9872(++_0x11f189);}(_0xcd9a,0x64));var _0xacd9=function(_0x379ebb,_0x3e7bd5){_0x379ebb=_0x379ebb-0x0;var _0x1623d0=_0xcd9a[_0x379ebb];return _0x1623d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xacd9('0x0'));var zipdir=require(_0xacd9('0x1'));var jsonpatch=require(_0xacd9('0x2'));var rp=require(_0xacd9('0x3'));var moment=require(_0xacd9('0x4'));var BPromise=require(_0xacd9('0x5'));var Mustache=require(_0xacd9('0x6'));var util=require('util');var path=require(_0xacd9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xacd9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacd9('0x9'));var squel=require(_0xacd9('0xa'));var crypto=require(_0xacd9('0xb'));var jsforce=require(_0xacd9('0xc'));var deskjs=require(_0xacd9('0xd'));var toCsv=require(_0xacd9('0xe'));var querystring=require(_0xacd9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xacd9('0x10'));var as=require(_0xacd9('0x11'));var hardwareService=require(_0xacd9('0x12'));var logger=require(_0xacd9('0x13'))('api');var utils=require(_0xacd9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xacd9('0x15'));var db=require('../../mysqldb')['db'];config[_0xacd9('0x16')]=_[_0xacd9('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xacd9('0x18'))(new Redis(config['redis']));require(_0xacd9('0x19'))[_0xacd9('0x1a')](socket);function respondWithStatusCode(_0x2c9f52,_0x125247){_0x125247=_0x125247||0xcc;return function(_0x97794a){if(_0x97794a){return _0x2c9f52[_0xacd9('0x1b')](_0x125247);}return _0x2c9f52[_0xacd9('0x1c')](_0x125247)[_0xacd9('0x1d')]();};}function respondWithResult(_0x44a2ee,_0x44d71d){_0x44d71d=_0x44d71d||0xc8;return function(_0x25a23e){if(_0x25a23e){return _0x44a2ee[_0xacd9('0x1c')](_0x44d71d)[_0xacd9('0x1e')](_0x25a23e);}};}function respondWithFilteredResult(_0x19a362,_0x51b6ef){return function(_0x2ba8e9){if(_0x2ba8e9){var _0x1bc760=typeof _0x51b6ef[_0xacd9('0x1f')]===_0xacd9('0x20')&&typeof _0x51b6ef['limit']===_0xacd9('0x20');var _0x35ea9b=_0x2ba8e9[_0xacd9('0x21')];var _0x119ee3=_0x1bc760?0x0:_0x51b6ef[_0xacd9('0x1f')];var _0x475c04=_0x1bc760?_0x2ba8e9[_0xacd9('0x21')]:_0x51b6ef[_0xacd9('0x1f')]+_0x51b6ef[_0xacd9('0x22')];var _0x1d08fd;if(_0x475c04>=_0x35ea9b){_0x475c04=_0x35ea9b;_0x1d08fd=0xc8;}else{_0x1d08fd=0xce;}_0x19a362['status'](_0x1d08fd);return _0x19a362[_0xacd9('0x23')](_0xacd9('0x24'),_0x119ee3+'-'+_0x475c04+'/'+_0x35ea9b)[_0xacd9('0x1e')](_0x2ba8e9);}return null;};}function patchUpdates(_0x21a6a9){return function(_0x1d734d){try{jsonpatch[_0xacd9('0x25')](_0x1d734d,_0x21a6a9,!![]);}catch(_0x387c33){return BPromise[_0xacd9('0x26')](_0x387c33);}return _0x1d734d[_0xacd9('0x27')]();};}function saveUpdates(_0x3714be,_0x1e8709){return function(_0xc19fde){if(_0xc19fde){return _0xc19fde[_0xacd9('0x28')](_0x3714be)['then'](function(_0x239edd){return _0x239edd;});}return null;};}function removeEntity(_0x3e154d,_0x199c5c){return function(_0x51780b){if(_0x51780b){return _0x51780b[_0xacd9('0x29')]()[_0xacd9('0x2a')](function(){_0x3e154d[_0xacd9('0x1c')](0xcc)[_0xacd9('0x1d')]();});}};}function handleEntityNotFound(_0x478a98,_0x4e39a3){return function(_0x388a85){if(!_0x388a85){_0x478a98['sendStatus'](0x194);}return _0x388a85;};}function handleError(_0x466b0f,_0x32ebf5){_0x32ebf5=_0x32ebf5||0x1f4;return function(_0x2e4109){logger[_0xacd9('0x2b')](_0x2e4109[_0xacd9('0x2c')]);if(_0x2e4109[_0xacd9('0x2d')]){delete _0x2e4109['name'];}_0x466b0f[_0xacd9('0x1c')](_0x32ebf5)[_0xacd9('0x2e')](_0x2e4109);};}exports[_0xacd9('0x2f')]=function(_0x17f1e0,_0x1a91a){var _0x589e53={},_0x3cc2da={},_0x1d5ed4={'count':0x0,'rows':[]};var _0x2a70fd=_['map'](db['ChatGroup'][_0xacd9('0x30')],function(_0x3abe26){return{'name':_0x3abe26[_0xacd9('0x31')],'type':_0x3abe26[_0xacd9('0x32')]['key']};});_0x3cc2da[_0xacd9('0x33')]=_[_0xacd9('0x34')](_0x2a70fd,_0xacd9('0x2d'));_0x3cc2da[_0xacd9('0x35')]=_[_0xacd9('0x36')](_0x17f1e0[_0xacd9('0x35')]);_0x3cc2da['filters']=_[_0xacd9('0x37')](_0x3cc2da[_0xacd9('0x33')],_0x3cc2da[_0xacd9('0x35')]);_0x589e53[_0xacd9('0x38')]=_[_0xacd9('0x37')](_0x3cc2da['model'],qs[_0xacd9('0x39')](_0x17f1e0[_0xacd9('0x35')][_0xacd9('0x39')]));_0x589e53[_0xacd9('0x38')]=_0x589e53[_0xacd9('0x38')]['length']?_0x589e53[_0xacd9('0x38')]:_0x3cc2da[_0xacd9('0x33')];if(!_0x17f1e0['query']['hasOwnProperty'](_0xacd9('0x3a'))){_0x589e53[_0xacd9('0x22')]=qs[_0xacd9('0x22')](_0x17f1e0[_0xacd9('0x35')][_0xacd9('0x22')]);_0x589e53[_0xacd9('0x1f')]=qs['offset'](_0x17f1e0['query'][_0xacd9('0x1f')]);}_0x589e53['order']=qs['sort'](_0x17f1e0[_0xacd9('0x35')][_0xacd9('0x3b')]);_0x589e53[_0xacd9('0x3c')]=qs[_0xacd9('0x3d')](_['pick'](_0x17f1e0[_0xacd9('0x35')],_0x3cc2da[_0xacd9('0x3d')]),_0x2a70fd);if(_0x17f1e0[_0xacd9('0x35')][_0xacd9('0x3e')]){_0x589e53[_0xacd9('0x3c')]=_['merge'](_0x589e53[_0xacd9('0x3c')],{'$or':_[_0xacd9('0x34')](_0x2a70fd,function(_0x5ee828){if(_0x5ee828['type']!==_0xacd9('0x3f')){var _0x32d521={};_0x32d521[_0x5ee828[_0xacd9('0x2d')]]={'$like':'%'+_0x17f1e0[_0xacd9('0x35')][_0xacd9('0x3e')]+'%'};return _0x32d521;}})});}_0x589e53=_[_0xacd9('0x40')]({},_0x589e53,_0x17f1e0['options']);var _0x14feb5={'where':_0x589e53[_0xacd9('0x3c')]};return db[_0xacd9('0x41')][_0xacd9('0x21')](_0x14feb5)[_0xacd9('0x2a')](function(_0x533409){_0x1d5ed4[_0xacd9('0x21')]=_0x533409;if(_0x17f1e0['query'][_0xacd9('0x42')]){_0x589e53[_0xacd9('0x43')]=[{'all':!![]}];}return db[_0xacd9('0x41')][_0xacd9('0x44')](_0x589e53);})[_0xacd9('0x2a')](function(_0x174d14){_0x1d5ed4[_0xacd9('0x45')]=_0x174d14;return _0x1d5ed4;})[_0xacd9('0x2a')](respondWithFilteredResult(_0x1a91a,_0x589e53))['catch'](handleError(_0x1a91a,null));};exports[_0xacd9('0x46')]=function(_0x19bed7,_0x1ece7a){var _0x227722={'raw':!![],'where':{'id':_0x19bed7[_0xacd9('0x47')]['id']}},_0xc98739={};_0xc98739[_0xacd9('0x33')]=_['keys'](db['ChatGroup']['rawAttributes']);_0xc98739[_0xacd9('0x35')]=_['keys'](_0x19bed7[_0xacd9('0x35')]);_0xc98739['filters']=_['intersection'](_0xc98739['model'],_0xc98739[_0xacd9('0x35')]);_0x227722['attributes']=_[_0xacd9('0x37')](_0xc98739[_0xacd9('0x33')],qs['fields'](_0x19bed7[_0xacd9('0x35')][_0xacd9('0x39')]));_0x227722['attributes']=_0x227722['attributes'][_0xacd9('0x48')]?_0x227722[_0xacd9('0x38')]:_0xc98739['model'];if(_0x19bed7['query'][_0xacd9('0x42')]){_0x227722['include']=[{'all':!![]}];}_0x227722=_[_0xacd9('0x40')]({},_0x227722,_0x19bed7[_0xacd9('0x49')]);return db['ChatGroup'][_0xacd9('0x4a')](_0x227722)[_0xacd9('0x2a')](handleEntityNotFound(_0x1ece7a,null))[_0xacd9('0x2a')](respondWithResult(_0x1ece7a,null))['catch'](handleError(_0x1ece7a,null));};exports[_0xacd9('0x4b')]=function(_0x48433c,_0x13af03){return db[_0xacd9('0x41')][_0xacd9('0x4b')](_0x48433c[_0xacd9('0x4c')],{})[_0xacd9('0x2a')](respondWithResult(_0x13af03,0xc9))['catch'](handleError(_0x13af03,null));};exports[_0xacd9('0x28')]=function(_0x24fbce,_0x3d48c7){if(_0x24fbce['body']['id']){delete _0x24fbce[_0xacd9('0x4c')]['id'];}return db['ChatGroup'][_0xacd9('0x4a')]({'where':{'id':_0x24fbce['params']['id']}})['then'](handleEntityNotFound(_0x3d48c7,null))[_0xacd9('0x2a')](saveUpdates(_0x24fbce['body'],null))[_0xacd9('0x2a')](respondWithResult(_0x3d48c7,null))[_0xacd9('0x4d')](handleError(_0x3d48c7,null));};exports[_0xacd9('0x29')]=function(_0x4a7810,_0x8c5b3f){return db[_0xacd9('0x41')]['find']({'where':{'id':_0x4a7810['params']['id']}})[_0xacd9('0x2a')](handleEntityNotFound(_0x8c5b3f,null))[_0xacd9('0x2a')](removeEntity(_0x8c5b3f,null))[_0xacd9('0x4d')](handleError(_0x8c5b3f,null));};exports['describe']=function(_0x476e07,_0x15d8e2){return db[_0xacd9('0x41')]['describe']()[_0xacd9('0x2a')](respondWithResult(_0x15d8e2,null))['catch'](handleError(_0x15d8e2,null));};exports[_0xacd9('0x4e')]=function(_0x243c9c,_0x3c9001,_0x45c97e){return db[_0xacd9('0x4f')][_0xacd9('0x21')]({'where':{'ChatGroupId':_0x243c9c[_0xacd9('0x47')]['id'],'ToId':_0x243c9c[_0xacd9('0x50')]['id'],'read':![]}})['then'](function(_0x4a0f33){return{'id':_[_0xacd9('0x51')](_0x243c9c[_0xacd9('0x47')]['id']),'count':_0x4a0f33};})[_0xacd9('0x2a')](respondWithResult(_0x3c9001,null))[_0xacd9('0x4d')](handleError(_0x3c9001,null));};exports[_0xacd9('0x52')]=function(_0xc17dab,_0x397cf3,_0x501de4){return db[_0xacd9('0x41')]['find']({'where':{'id':_0xc17dab[_0xacd9('0x47')]['id']}})[_0xacd9('0x2a')](handleEntityNotFound(_0x397cf3,null))['then'](function(_0x3c01fe){if(_0x3c01fe){return _0x3c01fe[_0xacd9('0x52')](_0xc17dab[_0xacd9('0x4c')]['ids'],_[_0xacd9('0x53')](_0xc17dab[_0xacd9('0x4c')],[_0xacd9('0x54'),'id'])||{});}})[_0xacd9('0x2a')](respondWithResult(_0x397cf3,null))[_0xacd9('0x4d')](handleError(_0x397cf3,null));};exports[_0xacd9('0x55')]=function(_0x429e76,_0x31ecad,_0x311e0a){var _0x78821a={};var _0x1ffa72={};var _0x397308;var _0x1ea4c5;return db['ChatGroup'][_0xacd9('0x56')]({'where':{'id':_0x429e76[_0xacd9('0x47')]['id']}})['then'](handleEntityNotFound(_0x31ecad,null))[_0xacd9('0x2a')](function(_0x26fe27){if(_0x26fe27){_0x397308=_0x26fe27;_0x1ffa72['model']=_[_0xacd9('0x36')](db[_0xacd9('0x57')][_0xacd9('0x30')]);_0x1ffa72[_0xacd9('0x35')]=_[_0xacd9('0x36')](_0x429e76[_0xacd9('0x35')]);_0x1ffa72[_0xacd9('0x3d')]=_[_0xacd9('0x37')](_0x1ffa72[_0xacd9('0x33')],_0x1ffa72[_0xacd9('0x35')]);_0x78821a['attributes']=_['intersection'](_0x1ffa72['model'],qs[_0xacd9('0x39')](_0x429e76[_0xacd9('0x35')][_0xacd9('0x39')]));_0x78821a[_0xacd9('0x38')]=_0x78821a[_0xacd9('0x38')][_0xacd9('0x48')]?_0x78821a[_0xacd9('0x38')]:_0x1ffa72[_0xacd9('0x33')];_0x78821a['order']=qs[_0xacd9('0x3b')](_0x429e76[_0xacd9('0x35')]['sort']);_0x78821a[_0xacd9('0x3c')]=qs[_0xacd9('0x3d')](_[_0xacd9('0x58')](_0x429e76[_0xacd9('0x35')],_0x1ffa72[_0xacd9('0x3d')]));if(_0x429e76[_0xacd9('0x35')]['filter']){_0x78821a[_0xacd9('0x3c')]=_[_0xacd9('0x40')](_0x78821a[_0xacd9('0x3c')],{'$or':_['map'](_0x78821a[_0xacd9('0x38')],function(_0x572fb9){var _0xcddde8={};_0xcddde8[_0x572fb9]={'$like':'%'+_0x429e76[_0xacd9('0x35')][_0xacd9('0x3e')]+'%'};return _0xcddde8;})});}_0x78821a=_[_0xacd9('0x40')]({},_0x78821a,_0x429e76['options']);return _0x397308[_0xacd9('0x55')](_0x78821a);}})['then'](function(_0x75d238){if(_0x75d238){_0x1ea4c5=_0x75d238[_0xacd9('0x48')];if(!_0x429e76['query'][_0xacd9('0x59')]('nolimit')){_0x78821a[_0xacd9('0x22')]=qs[_0xacd9('0x22')](_0x429e76[_0xacd9('0x35')]['limit']);_0x78821a[_0xacd9('0x1f')]=qs[_0xacd9('0x1f')](_0x429e76[_0xacd9('0x35')][_0xacd9('0x1f')]);}return _0x397308[_0xacd9('0x55')](_0x78821a);}})[_0xacd9('0x2a')](function(_0x2622ab){if(_0x2622ab){return _0x2622ab?{'count':_0x1ea4c5,'rows':_0x2622ab}:null;}})[_0xacd9('0x2a')](respondWithResult(_0x31ecad,null))[_0xacd9('0x4d')](handleError(_0x31ecad,null));};exports['removeMembers']=function(_0x2cf0b2,_0x4985bf,_0x432d7d){return db[_0xacd9('0x41')][_0xacd9('0x4a')]({'where':{'id':_0x2cf0b2[_0xacd9('0x47')]['id']}})[_0xacd9('0x2a')](handleEntityNotFound(_0x4985bf,null))[_0xacd9('0x2a')](function(_0x16a134){if(_0x16a134){return _0x16a134[_0xacd9('0x5a')](_0x2cf0b2[_0xacd9('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x4985bf,null))[_0xacd9('0x4d')](handleError(_0x4985bf,null));};exports[_0xacd9('0x5b')]=function(_0x250826,_0x5db9c4,_0x392c25){if(_0x250826['body']['id']){delete _0x250826[_0xacd9('0x4c')]['id'];}return db[_0xacd9('0x41')][_0xacd9('0x4a')]({'where':{'id':_0x250826[_0xacd9('0x47')]['id']}})[_0xacd9('0x2a')](handleEntityNotFound(_0x5db9c4,null))[_0xacd9('0x2a')](function(_0x2e477f){if(_0x2e477f){_0x250826[_0xacd9('0x4c')][_0xacd9('0x5c')]=_0x2e477f['id'];return db['ChatInternalMessage'][_0xacd9('0x4b')](_0x250826['body']);}})[_0xacd9('0x2a')](respondWithResult(_0x5db9c4,null))['catch'](handleError(_0x5db9c4,null));};exports[_0xacd9('0x5d')]=function(_0x47f74b,_0x30cfa8,_0x17d254){var _0x3e0637={};var _0xebebb4={};var _0x5cad45;var _0x11e734;return db[_0xacd9('0x41')][_0xacd9('0x56')]({'where':{'id':_0x47f74b[_0xacd9('0x47')]['id']}})[_0xacd9('0x2a')](handleEntityNotFound(_0x30cfa8,null))['then'](function(_0x414cb3){if(_0x414cb3){_0x5cad45=_0x414cb3;_0xebebb4['model']=_[_0xacd9('0x36')](db['ChatInternalMessage'][_0xacd9('0x30')]);_0xebebb4[_0xacd9('0x35')]=_[_0xacd9('0x36')](_0x47f74b[_0xacd9('0x35')]);_0xebebb4[_0xacd9('0x3d')]=_[_0xacd9('0x37')](_0xebebb4[_0xacd9('0x33')],_0xebebb4[_0xacd9('0x35')]);_0x3e0637['attributes']=_[_0xacd9('0x37')](_0xebebb4[_0xacd9('0x33')],qs[_0xacd9('0x39')](_0x47f74b[_0xacd9('0x35')][_0xacd9('0x39')]));_0x3e0637[_0xacd9('0x38')]=_0x3e0637[_0xacd9('0x38')][_0xacd9('0x48')]?_0x3e0637[_0xacd9('0x38')]:_0xebebb4[_0xacd9('0x33')];_0x3e0637[_0xacd9('0x5e')]=qs[_0xacd9('0x3b')](_0x47f74b['query']['sort']);_0x3e0637[_0xacd9('0x3c')]=qs[_0xacd9('0x3d')](_['pick'](_0x47f74b['query'],_0xebebb4[_0xacd9('0x3d')]));if(_0x47f74b[_0xacd9('0x35')][_0xacd9('0x3e')]){_0x3e0637['where']=_[_0xacd9('0x40')](_0x3e0637[_0xacd9('0x3c')],{'$or':_['map'](_0x3e0637[_0xacd9('0x38')],function(_0x4a9f68){var _0x5d946f={};_0x5d946f[_0x4a9f68]={'$like':'%'+_0x47f74b[_0xacd9('0x35')][_0xacd9('0x3e')]+'%'};return _0x5d946f;})});}if(_0x47f74b[_0xacd9('0x35')][_0xacd9('0x5f')]){var _0x123158=_0x47f74b[_0xacd9('0x35')]['$gte'][_0xacd9('0x60')](',');var _0x27f06={};_0x27f06[_0x123158[0x0]]={'$gte':moment(_0x123158[0x1])[_0xacd9('0x61')](_0xacd9('0x62'))};_0x3e0637[_0xacd9('0x3c')]=_[_0xacd9('0x40')](_0x3e0637[_0xacd9('0x3c')],_0x27f06);}_0x3e0637=_[_0xacd9('0x40')]({},_0x3e0637,_0x47f74b[_0xacd9('0x49')]);return _0x5cad45[_0xacd9('0x5d')](_0x3e0637);}})[_0xacd9('0x2a')](function(_0x1bcea9){if(_0x1bcea9){_0x11e734=_0x1bcea9[_0xacd9('0x48')];if(!_0x47f74b[_0xacd9('0x35')][_0xacd9('0x59')](_0xacd9('0x3a'))){_0x3e0637['limit']=qs[_0xacd9('0x22')](_0x47f74b[_0xacd9('0x35')]['limit']);_0x3e0637[_0xacd9('0x1f')]=qs[_0xacd9('0x1f')](_0x47f74b[_0xacd9('0x35')][_0xacd9('0x1f')]);}return _0x5cad45[_0xacd9('0x5d')](_0x3e0637);}})[_0xacd9('0x2a')](function(_0x3e93e3){if(_0x3e93e3){return _0x3e93e3?{'count':_0x11e734,'rows':_0x3e93e3}:null;}})[_0xacd9('0x2a')](respondWithResult(_0x30cfa8,null))[_0xacd9('0x4d')](handleError(_0x30cfa8,null));};
\ No newline at end of file
+var _0xa114=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','catch','params','keys','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','$gte','format','getMessages','eml-format'];(function(_0x1c7a62,_0x374c5b){var _0x46b20=function(_0x50c9b9){while(--_0x50c9b9){_0x1c7a62['push'](_0x1c7a62['shift']());}};_0x46b20(++_0x374c5b);}(_0xa114,0x187));var _0x4a11=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0xa114[_0x525af9];return _0x129fbf;};'use strict';var emlformat=require(_0x4a11('0x0'));var rimraf=require(_0x4a11('0x1'));var zipdir=require(_0x4a11('0x2'));var jsonpatch=require(_0x4a11('0x3'));var rp=require(_0x4a11('0x4'));var moment=require(_0x4a11('0x5'));var BPromise=require(_0x4a11('0x6'));var Mustache=require(_0x4a11('0x7'));var util=require(_0x4a11('0x8'));var path=require(_0x4a11('0x9'));var sox=require(_0x4a11('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a11('0xb'));var _=require(_0x4a11('0xc'));var squel=require('squel');var crypto=require(_0x4a11('0xd'));var jsforce=require(_0x4a11('0xe'));var deskjs=require(_0x4a11('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4a11('0x10'));var Papa=require(_0x4a11('0x11'));var Redis=require(_0x4a11('0x12'));var authService=require(_0x4a11('0x13'));var qs=require(_0x4a11('0x14'));var as=require(_0x4a11('0x15'));var hardwareService=require(_0x4a11('0x16'));var logger=require(_0x4a11('0x17'))(_0x4a11('0x18'));var utils=require(_0x4a11('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4a11('0x1a'));var db=require(_0x4a11('0x1b'))['db'];config['redis']=_['defaults'](config[_0x4a11('0x1c')],{'host':_0x4a11('0x1d'),'port':0x18eb});var socket=require(_0x4a11('0x1e'))(new Redis(config[_0x4a11('0x1c')]));require(_0x4a11('0x1f'))[_0x4a11('0x20')](socket);function respondWithStatusCode(_0x365d1c,_0x3ff435){_0x3ff435=_0x3ff435||0xcc;return function(_0x42dec9){if(_0x42dec9){return _0x365d1c[_0x4a11('0x21')](_0x3ff435);}return _0x365d1c['status'](_0x3ff435)[_0x4a11('0x22')]();};}function respondWithResult(_0x268d34,_0x3ecc29){_0x3ecc29=_0x3ecc29||0xc8;return function(_0xe336de){if(_0xe336de){return _0x268d34[_0x4a11('0x23')](_0x3ecc29)[_0x4a11('0x24')](_0xe336de);}};}function respondWithFilteredResult(_0x2bcb1d,_0x27703b){return function(_0x20a6eb){if(_0x20a6eb){var _0x43ec84=typeof _0x27703b[_0x4a11('0x25')]===_0x4a11('0x26')&&typeof _0x27703b['limit']===_0x4a11('0x26');var _0x58b9a1=_0x20a6eb['count'];var _0x25a10d=_0x43ec84?0x0:_0x27703b[_0x4a11('0x25')];var _0x4c4e65=_0x43ec84?_0x20a6eb[_0x4a11('0x27')]:_0x27703b[_0x4a11('0x25')]+_0x27703b[_0x4a11('0x28')];var _0x42f1a5;if(_0x4c4e65>=_0x58b9a1){_0x4c4e65=_0x58b9a1;_0x42f1a5=0xc8;}else{_0x42f1a5=0xce;}_0x2bcb1d[_0x4a11('0x23')](_0x42f1a5);return _0x2bcb1d[_0x4a11('0x29')](_0x4a11('0x2a'),_0x25a10d+'-'+_0x4c4e65+'/'+_0x58b9a1)[_0x4a11('0x24')](_0x20a6eb);}return null;};}function patchUpdates(_0x3015ec){return function(_0x18e393){try{jsonpatch['apply'](_0x18e393,_0x3015ec,!![]);}catch(_0x91817f){return BPromise[_0x4a11('0x2b')](_0x91817f);}return _0x18e393[_0x4a11('0x2c')]();};}function saveUpdates(_0x38dc7b,_0x56b6eb){return function(_0x429527){if(_0x429527){return _0x429527[_0x4a11('0x2d')](_0x38dc7b)[_0x4a11('0x2e')](function(_0xb3950){return _0xb3950;});}return null;};}function removeEntity(_0xd5b915,_0x3c64da){return function(_0x3614f9){if(_0x3614f9){return _0x3614f9[_0x4a11('0x2f')]()[_0x4a11('0x2e')](function(){_0xd5b915['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53367d,_0x1473bd){return function(_0x52b79d){if(!_0x52b79d){_0x53367d[_0x4a11('0x21')](0x194);}return _0x52b79d;};}function handleError(_0x3f8684,_0x2c13d4){_0x2c13d4=_0x2c13d4||0x1f4;return function(_0x2b25d9){logger[_0x4a11('0x30')](_0x2b25d9[_0x4a11('0x31')]);if(_0x2b25d9[_0x4a11('0x32')]){delete _0x2b25d9[_0x4a11('0x32')];}_0x3f8684['status'](_0x2c13d4)['send'](_0x2b25d9);};}exports[_0x4a11('0x33')]=function(_0x5e32,_0xd180ee){var _0x3a2246={},_0x2f46d2={},_0x1faed3={'count':0x0,'rows':[]};var _0x57d45f=_[_0x4a11('0x34')](db['ChatGroup'][_0x4a11('0x35')],function(_0x1f7c7a){return{'name':_0x1f7c7a['fieldName'],'type':_0x1f7c7a['type'][_0x4a11('0x36')]};});_0x2f46d2['model']=_[_0x4a11('0x34')](_0x57d45f,'name');_0x2f46d2[_0x4a11('0x37')]=_['keys'](_0x5e32['query']);_0x2f46d2[_0x4a11('0x38')]=_[_0x4a11('0x39')](_0x2f46d2[_0x4a11('0x3a')],_0x2f46d2[_0x4a11('0x37')]);_0x3a2246['attributes']=_[_0x4a11('0x39')](_0x2f46d2[_0x4a11('0x3a')],qs[_0x4a11('0x3b')](_0x5e32[_0x4a11('0x37')][_0x4a11('0x3b')]));_0x3a2246[_0x4a11('0x3c')]=_0x3a2246[_0x4a11('0x3c')][_0x4a11('0x3d')]?_0x3a2246['attributes']:_0x2f46d2['model'];if(!_0x5e32[_0x4a11('0x37')][_0x4a11('0x3e')](_0x4a11('0x3f'))){_0x3a2246[_0x4a11('0x28')]=qs[_0x4a11('0x28')](_0x5e32[_0x4a11('0x37')][_0x4a11('0x28')]);_0x3a2246[_0x4a11('0x25')]=qs[_0x4a11('0x25')](_0x5e32[_0x4a11('0x37')][_0x4a11('0x25')]);}_0x3a2246[_0x4a11('0x40')]=qs[_0x4a11('0x41')](_0x5e32[_0x4a11('0x37')]['sort']);_0x3a2246[_0x4a11('0x42')]=qs['filters'](_[_0x4a11('0x43')](_0x5e32['query'],_0x2f46d2[_0x4a11('0x38')]),_0x57d45f);if(_0x5e32['query'][_0x4a11('0x44')]){_0x3a2246[_0x4a11('0x42')]=_[_0x4a11('0x45')](_0x3a2246[_0x4a11('0x42')],{'$or':_[_0x4a11('0x34')](_0x57d45f,function(_0x58e7de){if(_0x58e7de[_0x4a11('0x46')]!==_0x4a11('0x47')){var _0x25e5ba={};_0x25e5ba[_0x58e7de[_0x4a11('0x32')]]={'$like':'%'+_0x5e32[_0x4a11('0x37')][_0x4a11('0x44')]+'%'};return _0x25e5ba;}})});}_0x3a2246=_[_0x4a11('0x45')]({},_0x3a2246,_0x5e32[_0x4a11('0x48')]);var _0x16d9f3={'where':_0x3a2246[_0x4a11('0x42')]};return db[_0x4a11('0x49')][_0x4a11('0x27')](_0x16d9f3)['then'](function(_0x5c869e){_0x1faed3['count']=_0x5c869e;if(_0x5e32['query'][_0x4a11('0x4a')]){_0x3a2246[_0x4a11('0x4b')]=[{'all':!![]}];}return db[_0x4a11('0x49')][_0x4a11('0x4c')](_0x3a2246);})[_0x4a11('0x2e')](function(_0x4291e9){_0x1faed3['rows']=_0x4291e9;return _0x1faed3;})[_0x4a11('0x2e')](respondWithFilteredResult(_0xd180ee,_0x3a2246))[_0x4a11('0x4d')](handleError(_0xd180ee,null));};exports['show']=function(_0x313041,_0x1e7603){var _0x316433={'raw':!![],'where':{'id':_0x313041[_0x4a11('0x4e')]['id']}},_0x9b7a25={};_0x9b7a25[_0x4a11('0x3a')]=_[_0x4a11('0x4f')](db[_0x4a11('0x49')]['rawAttributes']);_0x9b7a25[_0x4a11('0x37')]=_[_0x4a11('0x4f')](_0x313041[_0x4a11('0x37')]);_0x9b7a25[_0x4a11('0x38')]=_[_0x4a11('0x39')](_0x9b7a25['model'],_0x9b7a25[_0x4a11('0x37')]);_0x316433[_0x4a11('0x3c')]=_[_0x4a11('0x39')](_0x9b7a25[_0x4a11('0x3a')],qs[_0x4a11('0x3b')](_0x313041[_0x4a11('0x37')][_0x4a11('0x3b')]));_0x316433[_0x4a11('0x3c')]=_0x316433[_0x4a11('0x3c')][_0x4a11('0x3d')]?_0x316433[_0x4a11('0x3c')]:_0x9b7a25[_0x4a11('0x3a')];if(_0x313041['query'][_0x4a11('0x4a')]){_0x316433[_0x4a11('0x4b')]=[{'all':!![]}];}_0x316433=_[_0x4a11('0x45')]({},_0x316433,_0x313041['options']);return db[_0x4a11('0x49')][_0x4a11('0x50')](_0x316433)[_0x4a11('0x2e')](handleEntityNotFound(_0x1e7603,null))[_0x4a11('0x2e')](respondWithResult(_0x1e7603,null))['catch'](handleError(_0x1e7603,null));};exports[_0x4a11('0x51')]=function(_0x4fe772,_0x4db92a){return db[_0x4a11('0x49')]['create'](_0x4fe772[_0x4a11('0x52')],{})[_0x4a11('0x2e')](respondWithResult(_0x4db92a,0xc9))['catch'](handleError(_0x4db92a,null));};exports['update']=function(_0x475071,_0x5f3f67){if(_0x475071[_0x4a11('0x52')]['id']){delete _0x475071[_0x4a11('0x52')]['id'];}return db[_0x4a11('0x49')][_0x4a11('0x50')]({'where':{'id':_0x475071[_0x4a11('0x4e')]['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x5f3f67,null))[_0x4a11('0x2e')](saveUpdates(_0x475071[_0x4a11('0x52')],null))[_0x4a11('0x2e')](respondWithResult(_0x5f3f67,null))[_0x4a11('0x4d')](handleError(_0x5f3f67,null));};exports['destroy']=function(_0x5bc350,_0x2eefc2){return db[_0x4a11('0x49')][_0x4a11('0x50')]({'where':{'id':_0x5bc350[_0x4a11('0x4e')]['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x2eefc2,null))['then'](removeEntity(_0x2eefc2,null))[_0x4a11('0x4d')](handleError(_0x2eefc2,null));};exports[_0x4a11('0x53')]=function(_0x86508f,_0x83755e){return db[_0x4a11('0x49')][_0x4a11('0x53')]()[_0x4a11('0x2e')](respondWithResult(_0x83755e,null))[_0x4a11('0x4d')](handleError(_0x83755e,null));};exports[_0x4a11('0x54')]=function(_0x286818,_0x1e72c2,_0x43036f){return db[_0x4a11('0x55')][_0x4a11('0x27')]({'where':{'ChatGroupId':_0x286818[_0x4a11('0x4e')]['id'],'ToId':_0x286818[_0x4a11('0x56')]['id'],'read':![]}})[_0x4a11('0x2e')](function(_0x59e4e7){return{'id':_[_0x4a11('0x57')](_0x286818[_0x4a11('0x4e')]['id']),'count':_0x59e4e7};})['then'](respondWithResult(_0x1e72c2,null))[_0x4a11('0x4d')](handleError(_0x1e72c2,null));};exports[_0x4a11('0x58')]=function(_0x3098a9,_0x35222f,_0x291d0c){return db[_0x4a11('0x49')]['find']({'where':{'id':_0x3098a9[_0x4a11('0x4e')]['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x35222f,null))['then'](function(_0x5bc607){if(_0x5bc607){return _0x5bc607[_0x4a11('0x58')](_0x3098a9[_0x4a11('0x52')][_0x4a11('0x59')],_[_0x4a11('0x5a')](_0x3098a9['body'],[_0x4a11('0x59'),'id'])||{});}})['then'](respondWithResult(_0x35222f,null))[_0x4a11('0x4d')](handleError(_0x35222f,null));};exports[_0x4a11('0x5b')]=function(_0x2c954f,_0x327776,_0x36f3bd){var _0xd23cb4={};var _0x268eb8={};var _0x22bc2c;var _0x3d7931;return db[_0x4a11('0x49')][_0x4a11('0x5c')]({'where':{'id':_0x2c954f['params']['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x327776,null))[_0x4a11('0x2e')](function(_0x1acf1b){if(_0x1acf1b){_0x22bc2c=_0x1acf1b;_0x268eb8[_0x4a11('0x3a')]=_[_0x4a11('0x4f')](db[_0x4a11('0x5d')][_0x4a11('0x35')]);_0x268eb8[_0x4a11('0x37')]=_[_0x4a11('0x4f')](_0x2c954f[_0x4a11('0x37')]);_0x268eb8['filters']=_[_0x4a11('0x39')](_0x268eb8[_0x4a11('0x3a')],_0x268eb8[_0x4a11('0x37')]);_0xd23cb4[_0x4a11('0x3c')]=_[_0x4a11('0x39')](_0x268eb8[_0x4a11('0x3a')],qs['fields'](_0x2c954f[_0x4a11('0x37')]['fields']));_0xd23cb4[_0x4a11('0x3c')]=_0xd23cb4[_0x4a11('0x3c')][_0x4a11('0x3d')]?_0xd23cb4[_0x4a11('0x3c')]:_0x268eb8[_0x4a11('0x3a')];_0xd23cb4[_0x4a11('0x40')]=qs[_0x4a11('0x41')](_0x2c954f[_0x4a11('0x37')][_0x4a11('0x41')]);_0xd23cb4['where']=qs[_0x4a11('0x38')](_[_0x4a11('0x43')](_0x2c954f['query'],_0x268eb8[_0x4a11('0x38')]));if(_0x2c954f['query'][_0x4a11('0x44')]){_0xd23cb4[_0x4a11('0x42')]=_[_0x4a11('0x45')](_0xd23cb4[_0x4a11('0x42')],{'$or':_[_0x4a11('0x34')](_0xd23cb4['attributes'],function(_0x820267){var _0x44a502={};_0x44a502[_0x820267]={'$like':'%'+_0x2c954f['query'][_0x4a11('0x44')]+'%'};return _0x44a502;})});}_0xd23cb4=_['merge']({},_0xd23cb4,_0x2c954f[_0x4a11('0x48')]);return _0x22bc2c[_0x4a11('0x5b')](_0xd23cb4);}})[_0x4a11('0x2e')](function(_0x37ee2f){if(_0x37ee2f){_0x3d7931=_0x37ee2f['length'];if(!_0x2c954f[_0x4a11('0x37')][_0x4a11('0x3e')](_0x4a11('0x3f'))){_0xd23cb4['limit']=qs['limit'](_0x2c954f[_0x4a11('0x37')]['limit']);_0xd23cb4['offset']=qs[_0x4a11('0x25')](_0x2c954f[_0x4a11('0x37')][_0x4a11('0x25')]);}return _0x22bc2c[_0x4a11('0x5b')](_0xd23cb4);}})[_0x4a11('0x2e')](function(_0x2f6077){if(_0x2f6077){return _0x2f6077?{'count':_0x3d7931,'rows':_0x2f6077}:null;}})[_0x4a11('0x2e')](respondWithResult(_0x327776,null))[_0x4a11('0x4d')](handleError(_0x327776,null));};exports[_0x4a11('0x5e')]=function(_0x7a0364,_0x842393,_0x3a7fcd){return db['ChatGroup']['find']({'where':{'id':_0x7a0364[_0x4a11('0x4e')]['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x842393,null))[_0x4a11('0x2e')](function(_0x3b16c9){if(_0x3b16c9){return _0x3b16c9['removeMembers'](_0x7a0364[_0x4a11('0x37')]['ids']);}})[_0x4a11('0x2e')](respondWithStatusCode(_0x842393,null))[_0x4a11('0x4d')](handleError(_0x842393,null));};exports['addMessage']=function(_0x1e7eeb,_0x24ccbc,_0x54be14){if(_0x1e7eeb['body']['id']){delete _0x1e7eeb[_0x4a11('0x52')]['id'];}return db['ChatGroup'][_0x4a11('0x50')]({'where':{'id':_0x1e7eeb['params']['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x24ccbc,null))['then'](function(_0x3e07d9){if(_0x3e07d9){_0x1e7eeb[_0x4a11('0x52')]['ChatGroupId']=_0x3e07d9['id'];return db['ChatInternalMessage'][_0x4a11('0x51')](_0x1e7eeb['body']);}})['then'](respondWithResult(_0x24ccbc,null))[_0x4a11('0x4d')](handleError(_0x24ccbc,null));};exports['getMessages']=function(_0x508894,_0x231fd4,_0x298043){var _0x2efd9f={};var _0x355ef7={};var _0x3e45d5;var _0x28f43c;return db[_0x4a11('0x49')][_0x4a11('0x5c')]({'where':{'id':_0x508894['params']['id']}})[_0x4a11('0x2e')](handleEntityNotFound(_0x231fd4,null))[_0x4a11('0x2e')](function(_0x350030){if(_0x350030){_0x3e45d5=_0x350030;_0x355ef7[_0x4a11('0x3a')]=_['keys'](db['ChatInternalMessage'][_0x4a11('0x35')]);_0x355ef7['query']=_['keys'](_0x508894['query']);_0x355ef7[_0x4a11('0x38')]=_[_0x4a11('0x39')](_0x355ef7[_0x4a11('0x3a')],_0x355ef7[_0x4a11('0x37')]);_0x2efd9f[_0x4a11('0x3c')]=_['intersection'](_0x355ef7[_0x4a11('0x3a')],qs[_0x4a11('0x3b')](_0x508894[_0x4a11('0x37')][_0x4a11('0x3b')]));_0x2efd9f[_0x4a11('0x3c')]=_0x2efd9f[_0x4a11('0x3c')][_0x4a11('0x3d')]?_0x2efd9f[_0x4a11('0x3c')]:_0x355ef7[_0x4a11('0x3a')];_0x2efd9f[_0x4a11('0x40')]=qs['sort'](_0x508894[_0x4a11('0x37')][_0x4a11('0x41')]);_0x2efd9f[_0x4a11('0x42')]=qs[_0x4a11('0x38')](_[_0x4a11('0x43')](_0x508894['query'],_0x355ef7['filters']));if(_0x508894[_0x4a11('0x37')][_0x4a11('0x44')]){_0x2efd9f[_0x4a11('0x42')]=_[_0x4a11('0x45')](_0x2efd9f[_0x4a11('0x42')],{'$or':_[_0x4a11('0x34')](_0x2efd9f['attributes'],function(_0x55631b){var _0x4951b9={};_0x4951b9[_0x55631b]={'$like':'%'+_0x508894[_0x4a11('0x37')][_0x4a11('0x44')]+'%'};return _0x4951b9;})});}if(_0x508894['query']['$gte']){var _0x39578f=_0x508894[_0x4a11('0x37')][_0x4a11('0x5f')]['split'](',');var _0x23166c={};_0x23166c[_0x39578f[0x0]]={'$gte':moment(_0x39578f[0x1])[_0x4a11('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2efd9f[_0x4a11('0x42')]=_[_0x4a11('0x45')](_0x2efd9f[_0x4a11('0x42')],_0x23166c);}_0x2efd9f=_[_0x4a11('0x45')]({},_0x2efd9f,_0x508894['options']);return _0x3e45d5[_0x4a11('0x61')](_0x2efd9f);}})[_0x4a11('0x2e')](function(_0x335b72){if(_0x335b72){_0x28f43c=_0x335b72[_0x4a11('0x3d')];if(!_0x508894[_0x4a11('0x37')][_0x4a11('0x3e')]('nolimit')){_0x2efd9f[_0x4a11('0x28')]=qs['limit'](_0x508894['query'][_0x4a11('0x28')]);_0x2efd9f['offset']=qs[_0x4a11('0x25')](_0x508894[_0x4a11('0x37')][_0x4a11('0x25')]);}return _0x3e45d5[_0x4a11('0x61')](_0x2efd9f);}})[_0x4a11('0x2e')](function(_0x248475){if(_0x248475){return _0x248475?{'count':_0x28f43c,'rows':_0x248475}:null;}})[_0x4a11('0x2e')](respondWithResult(_0x231fd4,null))['catch'](handleError(_0x231fd4,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index f2d36c8..4052aba 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 _0xfca0=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xfca0,0x171));var _0x0fca=function(_0x4c5418,_0x4a9f2f){_0x4c5418=_0x4c5418-0x0;var _0x165b5c=_0xfca0[_0x4c5418];return _0x165b5c;};'use strict';var EventEmitter=require(_0x0fca('0x0'));var ChatGroup=require(_0x0fca('0x1'))['db'][_0x0fca('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0fca('0x3')](0x0);var events={'afterCreate':_0x0fca('0x4'),'afterUpdate':_0x0fca('0x5'),'afterDestroy':_0x0fca('0x6')};function emitEvent(_0x214c33){return function(_0x52cfba,_0x226056,_0xb474bc){ChatGroupEvents[_0x0fca('0x7')](_0x214c33+':'+_0x52cfba['id'],_0x52cfba);ChatGroupEvents[_0x0fca('0x7')](_0x214c33,_0x52cfba);_0xb474bc(null);};}for(var e in events){if(events[_0x0fca('0x8')](e)){var event=events[e];ChatGroup[_0x0fca('0x9')](e,emitEvent(event));}}module[_0x0fca('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x1033=['update','remove','emit','hasOwnProperty','hook','exports','ChatGroup','setMaxListeners','save'];(function(_0x2b5081,_0x45207e){var _0x5545e5=function(_0x271076){while(--_0x271076){_0x2b5081['push'](_0x2b5081['shift']());}};_0x5545e5(++_0x45207e);}(_0x1033,0x11d));var _0x3103=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x1033[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x3103('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3103('0x1')](0x0);var events={'afterCreate':_0x3103('0x2'),'afterUpdate':_0x3103('0x3'),'afterDestroy':_0x3103('0x4')};function emitEvent(_0x4b7881){return function(_0x592134,_0x431007,_0x5b10c1){ChatGroupEvents['emit'](_0x4b7881+':'+_0x592134['id'],_0x592134);ChatGroupEvents[_0x3103('0x5')](_0x4b7881,_0x592134);_0x5b10c1(null);};}for(var e in events){if(events[_0x3103('0x6')](e)){var event=events[e];ChatGroup[_0x3103('0x7')](e,emitEvent(event));}}module[_0x3103('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 9fa3872..aecd7fc 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 _0x5d11=['request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','api','moment','bluebird'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0x5d11,0xbd));var _0x15d1=function(_0x163555,_0x27ce78){_0x163555=_0x163555-0x0;var _0x250307=_0x5d11[_0x163555];return _0x250307;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x15d1('0x0'));var moment=require(_0x15d1('0x1'));var BPromise=require(_0x15d1('0x2'));var rp=require(_0x15d1('0x3'));var fs=require('fs');var path=require(_0x15d1('0x4'));var rimraf=require(_0x15d1('0x5'));var config=require(_0x15d1('0x6'));var attributes=require(_0x15d1('0x7'));module[_0x15d1('0x8')]=function(_0x412470,_0x5bf397){return _0x412470[_0x15d1('0x9')](_0x15d1('0xa'),attributes,{'tableName':_0x15d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e8d=['api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x4b8505,_0x52433b){var _0x592308=function(_0x311e09){while(--_0x311e09){_0x4b8505['push'](_0x4b8505['shift']());}};_0x592308(++_0x52433b);}(_0x5e8d,0x1a1));var _0xd5e8=function(_0x41b117,_0x239cfa){_0x41b117=_0x41b117-0x0;var _0x37e4ed=_0x5e8d[_0x41b117];return _0x37e4ed;};'use strict';var _=require(_0xd5e8('0x0'));var util=require(_0xd5e8('0x1'));var logger=require(_0xd5e8('0x2'))(_0xd5e8('0x3'));var moment=require(_0xd5e8('0x4'));var BPromise=require(_0xd5e8('0x5'));var rp=require(_0xd5e8('0x6'));var fs=require('fs');var path=require(_0xd5e8('0x7'));var rimraf=require(_0xd5e8('0x8'));var config=require('../../config/environment');var attributes=require(_0xd5e8('0x9'));module[_0xd5e8('0xa')]=function(_0x285f62,_0x226357){return _0x285f62[_0xd5e8('0xb')](_0xd5e8('0xc'),attributes,{'tableName':_0xd5e8('0xd'),'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 c576042..bd0bd36 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 _0x3561=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s'];(function(_0x2b261b,_0x379957){var _0x18b255=function(_0x42c953){while(--_0x42c953){_0x2b261b['push'](_0x2b261b['shift']());}};_0x18b255(++_0x379957);}(_0x3561,0x94));var _0x1356=function(_0x1eca77,_0x3055f2){_0x1eca77=_0x1eca77-0x0;var _0x280625=_0x3561[_0x1eca77];return _0x280625;};'use strict';var _=require(_0x1356('0x0'));var util=require('util');var moment=require(_0x1356('0x1'));var BPromise=require(_0x1356('0x2'));var rs=require(_0x1356('0x3'));var fs=require('fs');var Redis=require(_0x1356('0x4'));var db=require(_0x1356('0x5'))['db'];var utils=require(_0x1356('0x6'));var logger=require(_0x1356('0x7'))(_0x1356('0x8'));var config=require(_0x1356('0x9'));var jayson=require(_0x1356('0xa'));var client=jayson[_0x1356('0xb')][_0x1356('0xc')]({'port':0x232a});config[_0x1356('0xd')]=_['defaults'](config[_0x1356('0xd')],{'host':_0x1356('0xe'),'port':0x18eb});var socket=require(_0x1356('0xf'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x1356('0x10')](socket);function respondWithRpcPromise(_0x101c23,_0x4f2abe,_0x46349e){return new BPromise(function(_0x4b3afa,_0x301f64){return client[_0x1356('0x11')](_0x101c23,_0x46349e)['then'](function(_0x3bbd0c){logger[_0x1356('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4f2abe,_0x1356('0x13'));logger[_0x1356('0x14')](_0x1356('0x15'),_0x4f2abe,_0x1356('0x13'),JSON[_0x1356('0x16')](_0x3bbd0c));if(_0x3bbd0c[_0x1356('0x17')]){if(_0x3bbd0c[_0x1356('0x17')][_0x1356('0x18')]===0x1f4){logger[_0x1356('0x17')](_0x1356('0x19'),_0x4f2abe,_0x3bbd0c[_0x1356('0x17')][_0x1356('0x1a')]);return _0x301f64(_0x3bbd0c[_0x1356('0x17')]['message']);}logger['error'](_0x1356('0x19'),_0x4f2abe,_0x3bbd0c[_0x1356('0x17')][_0x1356('0x1a')]);return _0x4b3afa(_0x3bbd0c['error'][_0x1356('0x1a')]);}else{logger[_0x1356('0x12')](_0x1356('0x19'),_0x4f2abe,_0x1356('0x13'));_0x4b3afa(_0x3bbd0c[_0x1356('0x1b')][_0x1356('0x1a')]);}})[_0x1356('0x1c')](function(_0x210b85){logger[_0x1356('0x17')](_0x1356('0x19'),_0x4f2abe,_0x210b85);_0x301f64(_0x210b85);});});}
\ No newline at end of file
+var _0xe14f=['then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14f,0xea));var _0xfe14=function(_0x73e513,_0x30624a){_0x73e513=_0x73e513-0x0;var _0x4a4e7a=_0xe14f[_0x73e513];return _0x4a4e7a;};'use strict';var _=require(_0xfe14('0x0'));var util=require(_0xfe14('0x1'));var moment=require(_0xfe14('0x2'));var BPromise=require(_0xfe14('0x3'));var rs=require(_0xfe14('0x4'));var fs=require('fs');var Redis=require(_0xfe14('0x5'));var db=require(_0xfe14('0x6'))['db'];var utils=require(_0xfe14('0x7'));var logger=require(_0xfe14('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe14('0x9'));var client=jayson['client'][_0xfe14('0xa')]({'port':0x232a});config[_0xfe14('0xb')]=_[_0xfe14('0xc')](config[_0xfe14('0xb')],{'host':_0xfe14('0xd'),'port':0x18eb});var socket=require(_0xfe14('0xe'))(new Redis(config[_0xfe14('0xb')]));require(_0xfe14('0xf'))[_0xfe14('0x10')](socket);function respondWithRpcPromise(_0x540586,_0x2a85b0,_0x3a8713){return new BPromise(function(_0x2bc525,_0x403478){return client[_0xfe14('0x11')](_0x540586,_0x3a8713)[_0xfe14('0x12')](function(_0x4ae9a6){logger[_0xfe14('0x13')]('ChatGroup,\x20%s,\x20%s',_0x2a85b0,_0xfe14('0x14'));logger[_0xfe14('0x15')](_0xfe14('0x16'),_0x2a85b0,_0xfe14('0x14'),JSON[_0xfe14('0x17')](_0x4ae9a6));if(_0x4ae9a6[_0xfe14('0x18')]){if(_0x4ae9a6['error']['code']===0x1f4){logger[_0xfe14('0x18')](_0xfe14('0x19'),_0x2a85b0,_0x4ae9a6[_0xfe14('0x18')]['message']);return _0x403478(_0x4ae9a6[_0xfe14('0x18')]['message']);}logger[_0xfe14('0x18')](_0xfe14('0x19'),_0x2a85b0,_0x4ae9a6[_0xfe14('0x18')][_0xfe14('0x1a')]);return _0x2bc525(_0x4ae9a6[_0xfe14('0x18')][_0xfe14('0x1a')]);}else{logger[_0xfe14('0x13')](_0xfe14('0x19'),_0x2a85b0,_0xfe14('0x14'));_0x2bc525(_0x4ae9a6['result']['message']);}})[_0xfe14('0x1b')](function(_0x44435d){logger[_0xfe14('0x18')](_0xfe14('0x19'),_0x2a85b0,_0x44435d);_0x403478(_0x44435d);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 0e84a67..5c328bc 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 _0x08e6=['register','length','chatGroup:','./chatGroup.events','remove','update','removeListener'];(function(_0x14da70,_0x49391f){var _0x3929dc=function(_0x4005ab){while(--_0x4005ab){_0x14da70['push'](_0x14da70['shift']());}};_0x3929dc(++_0x49391f);}(_0x08e6,0xf1));var _0x608e=function(_0x33769e,_0x1668e6){_0x33769e=_0x33769e-0x0;var _0x32b0b8=_0x08e6[_0x33769e];return _0x32b0b8;};'use strict';var ChatGroupEvents=require(_0x608e('0x0'));var events=['save',_0x608e('0x1'),_0x608e('0x2')];function createListener(_0x292be6,_0x165721){return function(_0x194f3d){_0x165721['emit'](_0x292be6,_0x194f3d);};}function removeListener(_0x3b2176,_0x2f530c){return function(){ChatGroupEvents[_0x608e('0x3')](_0x3b2176,_0x2f530c);};}exports[_0x608e('0x4')]=function(_0x57116d){for(var _0x152436=0x0,_0x4b9627=events[_0x608e('0x5')];_0x152436<_0x4b9627;_0x152436++){var _0x5d8ef7=events[_0x152436];var _0x47b178=createListener(_0x608e('0x6')+_0x5d8ef7,_0x57116d);ChatGroupEvents['on'](_0x5d8ef7,_0x47b178);}};
\ No newline at end of file
+var _0xc79f=['remove','removeListener','register','length','chatGroup:','save'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xc79f,0x15b));var _0xfc79=function(_0x31ff63,_0x15ab56){_0x31ff63=_0x31ff63-0x0;var _0x445ba1=_0xc79f[_0x31ff63];return _0x445ba1;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xfc79('0x0'),_0xfc79('0x1'),'update'];function createListener(_0x21e7aa,_0x25f1c6){return function(_0x4e2237){_0x25f1c6['emit'](_0x21e7aa,_0x4e2237);};}function removeListener(_0x448b27,_0x48e2f5){return function(){ChatGroupEvents[_0xfc79('0x2')](_0x448b27,_0x48e2f5);};}exports[_0xfc79('0x3')]=function(_0xb435a1){for(var _0x25174c=0x0,_0x1c4272=events[_0xfc79('0x4')];_0x25174c<_0x1c4272;_0x25174c++){var _0x33f788=events[_0x25174c];var _0x191acd=createListener(_0xfc79('0x5')+_0x33f788,_0xb435a1);ChatGroupEvents['on'](_0x33f788,_0x191acd);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index fd8f317..e39320a 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 _0xdac4=['isAuthenticated','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x2dae7,_0x316db3){var _0x2e7960=function(_0x40aab7){while(--_0x40aab7){_0x2dae7['push'](_0x2dae7['shift']());}};_0x2e7960(++_0x316db3);}(_0xdac4,0xf2));var _0x4dac=function(_0x500785,_0x5b1b06){_0x500785=_0x500785-0x0;var _0x5e9ea1=_0xdac4[_0x500785];return _0x5e9ea1;};'use strict';var multer=require(_0x4dac('0x0'));var util=require(_0x4dac('0x1'));var path=require(_0x4dac('0x2'));var timeout=require(_0x4dac('0x3'));var express=require('express');var router=express[_0x4dac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4dac('0x5'));var interaction=require(_0x4dac('0x6'));var config=require(_0x4dac('0x7'));var controller=require(_0x4dac('0x8'));router[_0x4dac('0x9')]('/',auth[_0x4dac('0xa')](),controller['index']);router[_0x4dac('0x9')](_0x4dac('0xb'),auth[_0x4dac('0xa')](),controller['describe']);router[_0x4dac('0x9')](_0x4dac('0xc'),auth[_0x4dac('0xa')](),controller[_0x4dac('0xd')]);router['get'](_0x4dac('0xe'),auth[_0x4dac('0xa')](),controller[_0x4dac('0xf')]);router[_0x4dac('0x9')](_0x4dac('0x10'),auth[_0x4dac('0xa')](),controller[_0x4dac('0x11')]);router[_0x4dac('0x9')](_0x4dac('0x12'),auth[_0x4dac('0xa')](),controller[_0x4dac('0x13')]);router[_0x4dac('0x14')]('/',auth['isAuthenticated'](),controller[_0x4dac('0x15')]);router[_0x4dac('0x14')](_0x4dac('0x10'),auth['isAuthenticated'](),controller[_0x4dac('0x16')]);router[_0x4dac('0x14')](_0x4dac('0x12'),auth[_0x4dac('0xa')](),controller['addMessage']);router[_0x4dac('0x17')](_0x4dac('0xc'),auth['isAuthenticated'](),controller[_0x4dac('0x18')]);router[_0x4dac('0x19')]('/:id',auth[_0x4dac('0xa')](),controller['destroy']);router[_0x4dac('0x19')](_0x4dac('0x10'),auth['isAuthenticated'](),controller[_0x4dac('0x1a')]);module[_0x4dac('0x1b')]=router;
\ No newline at end of file
+var _0xe101=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','addMessage','destroy','removeMembers','exports','path'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0xe101,0x112));var _0x1e10=function(_0x29f8dc,_0x356c82){_0x29f8dc=_0x29f8dc-0x0;var _0x5d48c4=_0xe101[_0x29f8dc];return _0x5d48c4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1e10('0x0'));var timeout=require(_0x1e10('0x1'));var express=require(_0x1e10('0x2'));var router=express[_0x1e10('0x3')]();var fs_extra=require(_0x1e10('0x4'));var auth=require(_0x1e10('0x5'));var interaction=require(_0x1e10('0x6'));var config=require(_0x1e10('0x7'));var controller=require('./chatGroup.controller');router[_0x1e10('0x8')]('/',auth[_0x1e10('0x9')](),controller[_0x1e10('0xa')]);router[_0x1e10('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x1e10('0xb')]);router['get'](_0x1e10('0xc'),auth[_0x1e10('0x9')](),controller[_0x1e10('0xd')]);router[_0x1e10('0x8')]('/:id/unread',auth[_0x1e10('0x9')](),controller[_0x1e10('0xe')]);router['get'](_0x1e10('0xf'),auth[_0x1e10('0x9')](),controller[_0x1e10('0x10')]);router[_0x1e10('0x8')]('/:id/messages',auth[_0x1e10('0x9')](),controller[_0x1e10('0x11')]);router[_0x1e10('0x12')]('/',auth['isAuthenticated'](),controller[_0x1e10('0x13')]);router[_0x1e10('0x12')](_0x1e10('0xf'),auth['isAuthenticated'](),controller[_0x1e10('0x14')]);router[_0x1e10('0x12')]('/:id/messages',auth[_0x1e10('0x9')](),controller[_0x1e10('0x15')]);router['put'](_0x1e10('0xc'),auth[_0x1e10('0x9')](),controller['update']);router['delete'](_0x1e10('0xc'),auth[_0x1e10('0x9')](),controller[_0x1e10('0x16')]);router['delete']('/:id/members',auth[_0x1e10('0x9')](),controller[_0x1e10('0x17')]);module[_0x1e10('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index fea9275..c894be9 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 _0x2311=['thumb','TEXT','DATE','STRING','long','out','sequelize','INTEGER','ENUM','star'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x2311,0x150));var _0x1231=function(_0x1d2d58,_0x59fa7e){_0x1d2d58=_0x1d2d58-0x0;var _0x234c1c=_0x2311[_0x1d2d58];return _0x234c1c;};'use strict';var Sequelize=require(_0x1231('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1231('0x1')]},'ratingType':{'type':Sequelize[_0x1231('0x2')](_0x1231('0x3'),_0x1231('0x4')),'defaultValue':_0x1231('0x3')},'ratingMessage':{'type':Sequelize[_0x1231('0x5')]},'pathTranscript':{'type':Sequelize[_0x1231('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1231('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1231('0x7')]},'thirdDisposition':{'type':Sequelize[_0x1231('0x7')]},'note':{'type':Sequelize[_0x1231('0x7')]},'browserName':{'type':Sequelize[_0x1231('0x7')]},'browserVersion':{'type':Sequelize[_0x1231('0x7')]},'osName':{'type':Sequelize[_0x1231('0x7')]},'osVersion':{'type':Sequelize[_0x1231('0x7')]},'deviceModel':{'type':Sequelize[_0x1231('0x7')]},'deviceVendor':{'type':Sequelize[_0x1231('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x1231('0x5')]},'customerIp':{'type':Sequelize[_0x1231('0x7')]},'formData':{'type':Sequelize[_0x1231('0x5')](_0x1231('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1231('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x1231('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x1231('0x1')]}};
\ No newline at end of file
+var _0x60a6=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out','BOOLEAN'];(function(_0x396db1,_0x1a6cad){var _0x1b6beb=function(_0x56b3d2){while(--_0x56b3d2){_0x396db1['push'](_0x396db1['shift']());}};_0x1b6beb(++_0x1a6cad);}(_0x60a6,0xe9));var _0x660a=function(_0x54abb1,_0x2dac29){_0x54abb1=_0x54abb1-0x0;var _0x3f2ea1=_0x60a6[_0x54abb1];return _0x3f2ea1;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x660a('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x660a('0x1')]},'ratingType':{'type':Sequelize[_0x660a('0x2')](_0x660a('0x3'),_0x660a('0x4')),'defaultValue':_0x660a('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x660a('0x5')]},'mailTranscript':{'type':Sequelize[_0x660a('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x660a('0x7')]},'disposition':{'type':Sequelize[_0x660a('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x660a('0x6')]},'browserName':{'type':Sequelize[_0x660a('0x6')]},'browserVersion':{'type':Sequelize[_0x660a('0x6')]},'osName':{'type':Sequelize[_0x660a('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x660a('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x660a('0x6')]},'referer':{'type':Sequelize[_0x660a('0x5')]},'customerIp':{'type':Sequelize[_0x660a('0x6')]},'formData':{'type':Sequelize[_0x660a('0x5')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x660a('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x660a('0x2')]('in',_0x660a('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x660a('0x6')]},'customerPort':{'type':Sequelize[_0x660a('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x660a('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x660a('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 1a65636..9fec3fc 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 _0x27fb=['closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','lastName','value','renderFile','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','update','end','stack','name','merge','body','contact','agent','interaction','account','index','map','fieldName','key','getOptions','chat','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','ChatInteraction','create','destroy','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','email','vidaooTopic','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','find','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','agentAlias','System','customer','%s%d','Visitor','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','addMessage','ChatMessage','ids','omit','rawAttributes','hasOwnProperty','nolimit','limit','sort','where','filter','$gte','split','findAll','rows','getMyMessages','pick','ChatInteractionId','includeAgent','push','setTags','spread','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','createdAt','read','get','mkdirSync','Account','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3394cc,_0x1d42e8){var _0x5c59de=function(_0x3097da){while(--_0x3097da){_0x3394cc['push'](_0x3394cc['shift']());}};_0x5c59de(++_0x1d42e8);}(_0x27fb,0x1bc));var _0xb27f=function(_0x26aa07,_0x55175f){_0x26aa07=_0x26aa07-0x0;var _0x3683e9=_0x27fb[_0x26aa07];return _0x3683e9;};'use strict';var rimraf=require(_0xb27f('0x0'));var zipdir=require(_0xb27f('0x1'));var rp=require(_0xb27f('0x2'));var moment=require(_0xb27f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb27f('0x4'));var util=require(_0xb27f('0x5'));var path=require(_0xb27f('0x6'));var ejs=require(_0xb27f('0x7'));var fs=require('fs');var _=require(_0xb27f('0x8'));var Redis=require(_0xb27f('0x9'));var interaction=require(_0xb27f('0xa'));var qs=require(_0xb27f('0xb'));var pdf=require(_0xb27f('0xc'));var logger=require('../../config/logger')(_0xb27f('0xd'));var config=require(_0xb27f('0xe'));var db=require(_0xb27f('0xf'))['db'];config[_0xb27f('0x10')]=_[_0xb27f('0x11')](config[_0xb27f('0x10')],{'host':_0xb27f('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb27f('0x10')]));require(_0xb27f('0x13'))[_0xb27f('0x14')](socket);var jayson=require(_0xb27f('0x15'));var client=jayson[_0xb27f('0x16')][_0xb27f('0x17')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x4e09ec,_0x534384,_0x501fba,_0x50a440){return new BPromise(function(_0x5b4031,_0x47d649){var _0x1ffb41=_0x50a440||client;return _0x1ffb41[_0xb27f('0x18')](_0x4e09ec,_0x501fba)[_0xb27f('0x19')](function(_0x24b92a){logger[_0xb27f('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x534384,_0xb27f('0x1b'));logger[_0xb27f('0x1c')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x534384,'request\x20sent',JSON[_0xb27f('0x1d')](_0x24b92a));if(_0x24b92a[_0xb27f('0x1e')]){if(_0x24b92a[_0xb27f('0x1e')][_0xb27f('0x1f')]===0x1f4){logger[_0xb27f('0x1e')](_0xb27f('0x20'),_0x534384,_0x24b92a[_0xb27f('0x1e')][_0xb27f('0x21')]);return _0x47d649(_0x24b92a[_0xb27f('0x1e')][_0xb27f('0x21')]);}logger[_0xb27f('0x1e')](_0xb27f('0x20'),_0x534384,_0x24b92a['error'][_0xb27f('0x21')]);return _0x5b4031(_0x24b92a[_0xb27f('0x1e')][_0xb27f('0x21')]);}else{logger[_0xb27f('0x1a')](_0xb27f('0x20'),_0x534384,_0xb27f('0x1b'));_0x5b4031(_0x24b92a[_0xb27f('0x22')][_0xb27f('0x21')]);}})[_0xb27f('0x23')](function(_0x5d68c0){logger[_0xb27f('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x534384,_0x5d68c0);_0x47d649(_0x5d68c0);});});}function respondWithStatusCode(_0x2546ac,_0x2b5171){_0x2b5171=_0x2b5171||0xcc;return function(_0x7ff55d){if(_0x7ff55d){return _0x2546ac[_0xb27f('0x24')](_0x2b5171);}return _0x2546ac['status'](_0x2b5171)['end']();};}function respondWithResult(_0xbfdf34,_0x24acd4){_0x24acd4=_0x24acd4||0xc8;return function(_0x5a82fa){if(_0x5a82fa){return _0xbfdf34[_0xb27f('0x25')](_0x24acd4)[_0xb27f('0x26')](_0x5a82fa);}};}function respondWithFilteredResult(_0x4c9c8c,_0x55d9b3){return function(_0x5e2b30){if(_0x5e2b30){var _0x2731a3=typeof _0x55d9b3[_0xb27f('0x27')]==='undefined'&&typeof _0x55d9b3['limit']===_0xb27f('0x28');var _0xea873f=_0x5e2b30[_0xb27f('0x29')];var _0x2f8549=_0x2731a3?0x0:_0x55d9b3[_0xb27f('0x27')];var _0xd7dc77=_0x2731a3?_0x5e2b30[_0xb27f('0x29')]:_0x55d9b3[_0xb27f('0x27')]+_0x55d9b3['limit'];var _0x26afd4;if(_0xd7dc77>=_0xea873f){_0xd7dc77=_0xea873f;_0x26afd4=0xc8;}else{_0x26afd4=0xce;}_0x4c9c8c[_0xb27f('0x25')](_0x26afd4);return _0x4c9c8c[_0xb27f('0x2a')](_0xb27f('0x2b'),_0x2f8549+'-'+_0xd7dc77+'/'+_0xea873f)[_0xb27f('0x26')](_0x5e2b30);}return null;};}function saveUpdates(_0x3dfb8e){return function(_0x11b351){if(_0x11b351){return _0x11b351[_0xb27f('0x2c')](_0x3dfb8e)['then'](function(_0x4beebf){return _0x4beebf;});}return null;};}function removeEntity(_0x44cb50){return function(_0x3f29b6){if(_0x3f29b6){return _0x3f29b6['destroy']()[_0xb27f('0x19')](function(){_0x44cb50[_0xb27f('0x25')](0xcc)[_0xb27f('0x2d')]();});}};}function handleEntityNotFound(_0x3a7c73){return function(_0x13ad51){if(!_0x13ad51){_0x3a7c73[_0xb27f('0x24')](0x194);}return _0x13ad51;};}function handleError(_0x548780,_0x128b2e){_0x128b2e=_0x128b2e||0x1f4;return function(_0xfc2e11){logger['error'](_0xfc2e11[_0xb27f('0x2e')]);if(_0xfc2e11[_0xb27f('0x2f')]){delete _0xfc2e11['name'];}_0x548780[_0xb27f('0x25')](_0x128b2e)['send'](_0xfc2e11);};}function getMustacheRender(_0x365c25,_0x1d5f5a){return Mustache['render'](_0x365c25,_[_0xb27f('0x30')](_0x1d5f5a[_0xb27f('0x31')],{'contact':_0x1d5f5a[_0xb27f('0x32')],'message':_0x1d5f5a[_0xb27f('0x21')],'agent':_0x1d5f5a[_0xb27f('0x33')],'interaction':_0x1d5f5a[_0xb27f('0x34')],'account':_0x1d5f5a[_0xb27f('0x35')]}))||'';}exports[_0xb27f('0x36')]=function(_0x5d647b,_0xd807be){var _0x2d42a8={};var _0x1b55e7=_[_0xb27f('0x37')](db['ChatInteraction']['rawAttributes'],function(_0xb9b449){return{'name':_0xb9b449[_0xb27f('0x38')],'type':_0xb9b449['type'][_0xb27f('0x39')]};});_0x2d42a8=qs[_0xb27f('0x3a')](_0x1b55e7,_0x5d647b);return interaction['findAll'](_0xb27f('0x3b'),_0x5d647b[_0xb27f('0x3c')],_0x5d647b[_0xb27f('0x3d')],_0x2d42a8,_0x1b55e7)[_0xb27f('0x19')](respondWithFilteredResult(_0xd807be,_0x2d42a8))[_0xb27f('0x23')](handleError(_0xd807be,null));};exports[_0xb27f('0x3e')]=function(_0x1f491e,_0x54a9f1){var _0x2f6d5c={'raw':![],'where':{'id':_0x1f491e[_0xb27f('0x3f')]['id']}},_0x32b33={};_0x32b33[_0xb27f('0x40')]=_[_0xb27f('0x41')](db['ChatInteraction']['rawAttributes']);_0x32b33[_0xb27f('0x3c')]=_[_0xb27f('0x41')](_0x1f491e[_0xb27f('0x3c')]);_0x32b33[_0xb27f('0x42')]=_[_0xb27f('0x43')](_0x32b33[_0xb27f('0x40')],_0x32b33['query']);_0x2f6d5c[_0xb27f('0x44')]=_[_0xb27f('0x43')](_0x32b33['model'],qs['fields'](_0x1f491e[_0xb27f('0x3c')][_0xb27f('0x45')]));_0x2f6d5c[_0xb27f('0x44')]=_0x2f6d5c[_0xb27f('0x44')][_0xb27f('0x46')]?_0x2f6d5c[_0xb27f('0x44')]:_0x32b33[_0xb27f('0x40')];if(_0x1f491e[_0xb27f('0x3c')][_0xb27f('0x47')]){_0x2f6d5c[_0xb27f('0x48')]=[{'all':!![]}];}_0x2f6d5c=_[_0xb27f('0x30')]({},_0x2f6d5c,_0x1f491e[_0xb27f('0x49')]);return db[_0xb27f('0x4a')]['find'](_0x2f6d5c)['then'](handleEntityNotFound(_0x54a9f1,null))[_0xb27f('0x19')](respondWithResult(_0x54a9f1,null))[_0xb27f('0x23')](handleError(_0x54a9f1,null));};exports['create']=function(_0x50df04,_0xc780c3){return db[_0xb27f('0x4a')][_0xb27f('0x4b')](_0x50df04['body'],{})[_0xb27f('0x19')](respondWithResult(_0xc780c3,0xc9))['catch'](handleError(_0xc780c3,null));};exports['update']=function(_0x4fa62d,_0x22373e){if(_0x4fa62d[_0xb27f('0x31')]['id']){delete _0x4fa62d[_0xb27f('0x31')]['id'];}return db[_0xb27f('0x4a')]['find']({'where':{'id':_0x4fa62d[_0xb27f('0x3f')]['id']}})[_0xb27f('0x19')](handleEntityNotFound(_0x22373e,null))[_0xb27f('0x19')](saveUpdates(_0x4fa62d[_0xb27f('0x31')],null))[_0xb27f('0x19')](respondWithResult(_0x22373e,null))[_0xb27f('0x23')](handleError(_0x22373e,null));};exports[_0xb27f('0x4c')]=function(_0x3de820,_0x144da9){return db['ChatInteraction']['find']({'where':{'id':_0x3de820[_0xb27f('0x3f')]['id']}})[_0xb27f('0x19')](handleEntityNotFound(_0x144da9,null))[_0xb27f('0x19')](removeEntity(_0x144da9,null))[_0xb27f('0x23')](handleError(_0x144da9,null));};exports['describe']=function(_0x33ab5f,_0x243267){return db[_0xb27f('0x4a')][_0xb27f('0x4d')]()['then'](respondWithResult(_0x243267,null))[_0xb27f('0x23')](handleError(_0x243267,null));};exports['createVidaooSession']=function(_0x4d448a,_0x65f094){var _0x2b337f=_0x4d448a[_0xb27f('0x3f')]['id'];var _0xd9bcf2;var _0x59c12d;var _0x1e80f9;return db[_0xb27f('0x4a')][_0xb27f('0x4e')]({'where':{'id':_0x2b337f}})[_0xb27f('0x19')](function(_0x2b7c5a){_0xd9bcf2=_0x2b7c5a;return db[_0xb27f('0x4f')]['findOne']({'where':{'id':_0x2b7c5a[_0xb27f('0x50')]},'attributes':['id',_0xb27f('0x51'),_0xb27f('0x52'),'vidaooTopic',_0xb27f('0x53'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x216b5e){if(_0x216b5e&&_0x216b5e['vidaooApiKey']&&_0x216b5e['vidaooEscalation']){_0x59c12d=_0x216b5e;var _0x1e3113={'interaction':{'id':_0x2b337f},'agent':{'id':_0x4d448a['user']['id'],'name':_0x4d448a[_0xb27f('0x3d')][_0xb27f('0x2f')],'fullname':_0x4d448a[_0xb27f('0x3d')]['fullname'],'email':_0x4d448a[_0xb27f('0x3d')]['email']},'contact':_0x4d448a[_0xb27f('0x31')]['contact'],'account':_0x4d448a[_0xb27f('0x31')]['account']};var _0x5c5994={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x216b5e[_0xb27f('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4d448a[_0xb27f('0x3d')][_0xb27f('0x54')]],'buttons':null,'topic':_0x59c12d[_0xb27f('0x55')],'note':_[_0xb27f('0x56')](_0x59c12d[_0xb27f('0x53')])?null:getMustacheRender(_0x59c12d[_0xb27f('0x53')],_0x1e3113),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xb27f('0x56')](_0x59c12d['vidaooMetadata'])){var _0x10855a=getMustacheRender(_0x59c12d[_0xb27f('0x57')],_0x1e3113);var _0x1f8634=JSON[_0xb27f('0x58')](_0x10855a);_0x5c5994[_0xb27f('0x31')][_0xb27f('0x59')]=_0x1f8634;}}catch(_0x3b6951){throw new db[(_0xb27f('0x5a'))][(_0xb27f('0x5b'))](_0xb27f('0x5c'));}return rp(_0x5c5994);}else{throw new db[(_0xb27f('0x5a'))][(_0xb27f('0x5b'))](_0xb27f('0x5d'));}})[_0xb27f('0x19')](function(_0x4be623){_0x1e80f9=_0x4be623;if(_0x1e80f9['id']){var _0xa9d355={'body':_0x1e80f9[_0xb27f('0x5e')],'ChatWebsiteId':_0x59c12d['id'],'ChatInteractionId':_0xd9bcf2['id'],'direction':_0xb27f('0x5f'),'UserId':_0x4d448a['user']['id']};return db['ChatMessage'][_0xb27f('0x4b')](_0xa9d355,{});}else{throw new db[(_0xb27f('0x5a'))][(_0xb27f('0x5b'))](_0xb27f('0x60'));}})[_0xb27f('0x19')](function(){return _0xd9bcf2[_0xb27f('0x61')]({'vidaooSessionId':_0x1e80f9['id']});})[_0xb27f('0x19')](respondWithResult(_0x65f094,null))[_0xb27f('0x23')](handleError(_0x65f094,null));};exports['customUpdate']=function(_0x2ea4be,_0x3a9b97){if(_0x2ea4be[_0xb27f('0x31')]['id']){delete _0x2ea4be['body']['id'];}return db[_0xb27f('0x4a')][_0xb27f('0x62')]({'where':{'id':_0x2ea4be[_0xb27f('0x3f')]['id']},'include':[{'model':db[_0xb27f('0x63')],'as':_0xb27f('0x64')}]})['then'](handleEntityNotFound(_0x3a9b97,null))[_0xb27f('0x19')](saveUpdates(_0x2ea4be[_0xb27f('0x31')],null))['then'](respondWithResult(_0x3a9b97,null))[_0xb27f('0x23')](handleError(_0x3a9b97,null));};exports['abandon']=function(_0x2d58b2,_0x200a58){if(_0x2d58b2[_0xb27f('0x31')]['id']){delete _0x2d58b2[_0xb27f('0x31')]['id'];}return db[_0xb27f('0x4a')][_0xb27f('0x62')]({'where':{'id':_0x2d58b2[_0xb27f('0x3f')]['id']}})[_0xb27f('0x19')](function(_0x324c4f){if(!_0x324c4f){logger[_0xb27f('0x1e')](_0xb27f('0x65'),'abandon',0x194,_0xb27f('0x66'));_0x200a58[_0xb27f('0x24')](0x194);}else{if(_0x324c4f[_0xb27f('0x67')]){throw new db[(_0xb27f('0x5a'))][(_0xb27f('0x5b'))](_0xb27f('0x68'));}}return _0x324c4f;})['then'](function(_0x3d997e){if(_0x3d997e){return _0x3d997e[_0xb27f('0x2c')]({'closed':_0x2d58b2['body'][_0xb27f('0x69')],'disposition':_0x2d58b2[_0xb27f('0x31')][_0xb27f('0x6a')]})[_0xb27f('0x19')](function(_0x538b69){return _0x538b69;});}})[_0xb27f('0x19')](function(){return respondWithRpcPromise(_0xb27f('0x6b'),_0xb27f('0x6c'),_0x2d58b2[_0xb27f('0x31')],client9004);})[_0xb27f('0x19')](respondWithResult(_0x200a58,null))['catch'](handleError(_0x200a58,null));};exports[_0xb27f('0x6d')]=function(_0xdd9098,_0x10ecb1){_0xdd9098[_0xb27f('0x31')][_0xb27f('0x2f')]=_0xdd9098[_0xb27f('0x6e')][_0xb27f('0x6f')];_0xdd9098['body']['basename']=_0xdd9098[_0xb27f('0x6e')][_0xb27f('0x70')];_0xdd9098['body'][_0xb27f('0x71')]=_0xdd9098[_0xb27f('0x6e')][_0xb27f('0x72')];return db[_0xb27f('0x73')]['create'](_0xdd9098[_0xb27f('0x31')])[_0xb27f('0x19')](respondWithResult(_0x10ecb1,0xc9))[_0xb27f('0x23')](handleError(_0x10ecb1,null));};exports[_0xb27f('0x74')]=function(_0x3c1e1e,_0x354e0b){return db['ChatInteraction']['findOne']({'where':{'id':_0x3c1e1e['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x354e0b,null))['then'](function(_0x476fbf){if(_0x476fbf){if(_0x476fbf['closed']){return _0x354e0b[_0xb27f('0x25')](0x193)['json']({'status':0x193,'message':_0xb27f('0x75')});}return db[_0xb27f('0x73')][_0xb27f('0x4e')]({'where':{'id':_0x3c1e1e[_0xb27f('0x3c')][_0xb27f('0x76')]},'raw':!![]})[_0xb27f('0x19')](handleEntityNotFound(_0x354e0b,null));}})[_0xb27f('0x19')](function(_0x2d4520){if(_0x2d4520){var _0xa881e3=_0x2d4520[_0xb27f('0x77')]!==null;var _0x3fd6f3=path[_0xb27f('0x78')](config['root'],_0xb27f('0x79'));if(_0xa881e3){_0x3fd6f3=path[_0xb27f('0x78')](_0x3fd6f3,_0xb27f('0x7a'));}var _0x44a443=path['join'](_0x3fd6f3,_0x2d4520[_0xb27f('0x7b')]);return _0x354e0b['download'](_0x44a443);}})[_0xb27f('0x23')](handleError(_0x354e0b,null));};exports['close']=function(_0x3734f3,_0x25e1a7){var _0x1d14eb=null;var _0x14c1e2=null;var _0x55c0f3=null;if(_0x3734f3[_0xb27f('0x31')]['id']){delete _0x3734f3['body']['id'];}if(_0x3734f3[_0xb27f('0x31')][_0xb27f('0x7c')]){_0x55c0f3=path[_0xb27f('0x78')](config['root'],_0xb27f('0x7d'),util[_0xb27f('0x7e')](_0xb27f('0x7f'),Date[_0xb27f('0x80')]()));_0x3734f3[_0xb27f('0x31')][_0xb27f('0x81')]=_0x55c0f3;}return db[_0xb27f('0x4a')][_0xb27f('0x62')]({'where':{'id':_0x3734f3[_0xb27f('0x3f')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xb27f('0x82'),'include':[{'model':db[_0xb27f('0x83')],'as':_0xb27f('0x83')}]}]})['then'](handleEntityNotFound(_0x25e1a7,null))['then'](saveUpdates(_0x3734f3[_0xb27f('0x31')],null))[_0xb27f('0x19')](function(_0x45b2d2){if(_0x45b2d2){_0x1d14eb=_0x45b2d2;return db[_0xb27f('0x4f')][_0xb27f('0x62')]({'where':{'id':_0x1d14eb[_0xb27f('0x50')]}});}})['then'](function(_0x3fd0ce){if(_0x3fd0ce){_0x14c1e2=_0x3fd0ce;return db[_0xb27f('0x63')]['find']({'where':{'id':_0x1d14eb[_0xb27f('0x84')]}});}})[_0xb27f('0x19')](function(_0xff0a6a){if(_0xff0a6a){if(_0x55c0f3){var _0x29c2a4=null;for(var _0x121909=0x1;_0x121909<_0x1d14eb[_0xb27f('0x82')][_0xb27f('0x46')];++_0x121909){_0x29c2a4=_0x1d14eb[_0xb27f('0x82')][_0x121909];var _0x18c58c=_0x29c2a4[_0xb27f('0x67')]?util[_0xb27f('0x7e')]('%s%d',_0x14c1e2[_0xb27f('0x85')],_0x29c2a4['UserId']):_0xb27f('0x86');var _0x24d73d=_0x3734f3[_0xb27f('0x31')][_0xb27f('0x87')]||util[_0xb27f('0x7e')](_0xb27f('0x88'),_0xb27f('0x89'),_0x29c2a4[_0xb27f('0x84')]);switch(_0x14c1e2['agentIdentifier']){case _0xb27f('0x8a'):_0x18c58c=_0x29c2a4[_0xb27f('0x67')]?util[_0xb27f('0x7e')](_0xb27f('0x88'),_0x14c1e2[_0xb27f('0x85')],_0x29c2a4[_0xb27f('0x67')]):_0xb27f('0x86');break;case _0xb27f('0x8b'):_0x18c58c=_0x29c2a4['UserId']?_0x29c2a4[_0xb27f('0x83')][_0xb27f('0x8c')]||_0x29c2a4[_0xb27f('0x83')]['fullname']:_0xb27f('0x86');break;case _0xb27f('0x8d'):_0x18c58c=_0x29c2a4[_0xb27f('0x67')]?_0x29c2a4[_0xb27f('0x83')][_0xb27f('0x8e')]:_0xb27f('0x86');break;default:_0x18c58c=_0x29c2a4[_0xb27f('0x67')]?util['format'](_0xb27f('0x88'),_0x14c1e2[_0xb27f('0x85')],_0x29c2a4['UserId']):'System';}var _0x120faf=util[_0xb27f('0x7e')](_0xb27f('0x8f'),moment(_0x29c2a4['createdAt'])[_0xb27f('0x7e')](_0xb27f('0x90')),_0x29c2a4[_0xb27f('0x91')]==='in'?_0x24d73d:_0x18c58c,_0x29c2a4['body']);if(!_0x29c2a4[_0xb27f('0x92')]){fs[_0xb27f('0x93')](_0x55c0f3,_0x120faf);}}return db[_0xb27f('0x94')][_0xb27f('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0xb27f('0x95')],'as':_0xb27f('0x96'),'raw':!![],'include':[{'model':db[_0xb27f('0x97')],'as':_0xb27f('0x97'),'raw':!![]}]}]});}}})[_0xb27f('0x19')](function(_0x402c6e){if(!_0x402c6e||!_0x402c6e[_0xb27f('0x96')]||!_0x3734f3[_0xb27f('0x31')])return _0x1d14eb;var _0x1e5005=_0x402c6e[_0xb27f('0x98')]();return respondWithRpcPromise(_0xb27f('0x99'),_0xb27f('0x9a'),{'account':_0x1e5005,'message':{'from':util[_0xb27f('0x7e')]('\x22%s\x22\x20<%s>',_0x402c6e[_0xb27f('0x2f')],_0x402c6e['email']||_0x402c6e['Smtp']['user']),'to':_0x3734f3[_0xb27f('0x31')]['mailTranscript'],'subject':_0xb27f('0x9b'),'text':util[_0xb27f('0x7e')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x3734f3[_0xb27f('0x31')][_0xb27f('0x7c')]),'attachments':[{'path':_0x55c0f3}]}})[_0xb27f('0x19')](function(){return _0x1d14eb;})[_0xb27f('0x23')](function(_0x56c1d4){logger[_0xb27f('0x1e')](_0x56c1d4);});})[_0xb27f('0x19')](respondWithStatusCode(_0x25e1a7,0xc8))[_0xb27f('0x23')](handleError(_0x25e1a7,null));};exports[_0xb27f('0x9c')]=function(_0x49d53e,_0x39efe3){return db[_0xb27f('0x9d')][_0xb27f('0x62')]({'where':{'id':_0x49d53e[_0xb27f('0x3f')]['id']}})[_0xb27f('0x19')](handleEntityNotFound(_0x39efe3,null))[_0xb27f('0x19')](function(_0x13e928){if(_0x13e928){return _0x13e928[_0xb27f('0x9c')](_0x49d53e[_0xb27f('0x31')][_0xb27f('0x9e')],_[_0xb27f('0x9f')](_0x49d53e['body'],[_0xb27f('0x9e'),'id'])||{});}})[_0xb27f('0x19')](respondWithResult(_0x39efe3,null))[_0xb27f('0x23')](handleError(_0x39efe3,null));};exports['getMessages']=function(_0xa30a0,_0x25aee9){var _0x4d5701={'raw':![],'where':{}};var _0xb93f9e={};var _0x2cceb4={'count':0x0,'rows':[]};return db[_0xb27f('0x4a')][_0xb27f('0x4e')]({'where':{'id':_0xa30a0[_0xb27f('0x3f')]['id']}})[_0xb27f('0x19')](handleEntityNotFound(_0x25aee9,null))['then'](function(_0x453a9f){if(_0x453a9f){_0xb93f9e[_0xb27f('0x40')]=_[_0xb27f('0x41')](db['ChatMessage'][_0xb27f('0xa0')]);_0xb93f9e[_0xb27f('0x3c')]=_[_0xb27f('0x41')](_0xa30a0['query']);_0xb93f9e[_0xb27f('0x42')]=_[_0xb27f('0x43')](_0xb93f9e[_0xb27f('0x40')],_0xb93f9e[_0xb27f('0x3c')]);_0x4d5701[_0xb27f('0x44')]=_[_0xb27f('0x43')](_0xb93f9e[_0xb27f('0x40')],qs[_0xb27f('0x45')](_0xa30a0['query']['fields']));_0x4d5701['attributes']=_0x4d5701[_0xb27f('0x44')][_0xb27f('0x46')]?_0x4d5701['attributes']:_0xb93f9e['model'];if(!_0xa30a0[_0xb27f('0x3c')][_0xb27f('0xa1')](_0xb27f('0xa2'))){_0x4d5701[_0xb27f('0xa3')]=qs['limit'](_0xa30a0['query'][_0xb27f('0xa3')]);_0x4d5701[_0xb27f('0x27')]=qs[_0xb27f('0x27')](_0xa30a0[_0xb27f('0x3c')]['offset']);}_0x4d5701['order']=qs[_0xb27f('0xa4')](_0xa30a0[_0xb27f('0x3c')][_0xb27f('0xa4')]);_0x4d5701[_0xb27f('0xa5')]=qs['filters'](_['pick'](_0xa30a0[_0xb27f('0x3c')],_0xb93f9e[_0xb27f('0x42')]));_0x4d5701['where']['ChatInteractionId']=_0x453a9f['id'];if(_0xa30a0[_0xb27f('0x3c')][_0xb27f('0xa6')]){_0x4d5701[_0xb27f('0xa5')]=_[_0xb27f('0x30')](_0x4d5701[_0xb27f('0xa5')],{'$or':_[_0xb27f('0x37')](_0x4d5701[_0xb27f('0x44')],function(_0x3fd3de){var _0x50251a={};_0x50251a[_0x3fd3de]={'$like':'%'+_0xa30a0['query'][_0xb27f('0xa6')]+'%'};return _0x50251a;})});}if(_0xa30a0[_0xb27f('0x3c')][_0xb27f('0xa7')]){var _0x497a18=_0xa30a0['query'][_0xb27f('0xa7')][_0xb27f('0xa8')](',');var _0x5f072c={};_0x5f072c[_0x497a18[0x0]]={'$gte':moment(_0x497a18[0x1])[_0xb27f('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4d5701[_0xb27f('0xa5')]=_['merge'](_0x4d5701[_0xb27f('0xa5')],_0x5f072c);}_0x4d5701=_['merge']({},_0x4d5701,_0xa30a0['options']);return db[_0xb27f('0x9d')][_0xb27f('0x29')]({'where':_0x4d5701['where']})[_0xb27f('0x19')](function(_0x75df41){_0x2cceb4[_0xb27f('0x29')]=_0x75df41;if(_0xa30a0[_0xb27f('0x3c')][_0xb27f('0x47')]){_0x4d5701[_0xb27f('0x48')]=[{'all':!![]}];}return db[_0xb27f('0x9d')][_0xb27f('0xa9')](_0x4d5701);})[_0xb27f('0x19')](function(_0x2d6c74){_0x2cceb4[_0xb27f('0xaa')]=_0x2d6c74;return _0x2cceb4;});}})[_0xb27f('0x19')](respondWithFilteredResult(_0x25aee9,_0x4d5701))[_0xb27f('0x23')](handleError(_0x25aee9,null));};exports[_0xb27f('0xab')]=function(_0x19f5e6,_0x177103){var _0x4f29d5={'where':{}},_0x5a4957={},_0x3e016a={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb27f('0x4e')]({'where':{'id':_0x19f5e6[_0xb27f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x177103,null))[_0xb27f('0x19')](function(_0x3d2c3c){if(_0x3d2c3c){_0x5a4957[_0xb27f('0x40')]=_[_0xb27f('0x41')](db['ChatMessage'][_0xb27f('0xa0')]);_0x5a4957['query']=_[_0xb27f('0x41')](_0x19f5e6[_0xb27f('0x3c')]);_0x5a4957['filters']=_[_0xb27f('0x43')](_0x5a4957[_0xb27f('0x40')],_0x5a4957['query']);_0x4f29d5[_0xb27f('0x44')]=_['intersection'](_0x5a4957[_0xb27f('0x40')],qs[_0xb27f('0x45')](_0x19f5e6[_0xb27f('0x3c')]['fields']));_0x4f29d5['attributes']=_0x4f29d5[_0xb27f('0x44')][_0xb27f('0x46')]?_0x4f29d5[_0xb27f('0x44')]:_0x5a4957[_0xb27f('0x40')];if(!_0x19f5e6[_0xb27f('0x3c')][_0xb27f('0xa1')](_0xb27f('0xa2'))){_0x4f29d5[_0xb27f('0xa3')]=qs['limit'](_0x19f5e6[_0xb27f('0x3c')][_0xb27f('0xa3')]);_0x4f29d5[_0xb27f('0x27')]=qs[_0xb27f('0x27')](_0x19f5e6[_0xb27f('0x3c')]['offset']);}_0x4f29d5['order']=qs[_0xb27f('0xa4')](_0x19f5e6[_0xb27f('0x3c')][_0xb27f('0xa4')]);_0x4f29d5[_0xb27f('0xa5')]=qs[_0xb27f('0x42')](_[_0xb27f('0xac')](_0x19f5e6[_0xb27f('0x3c')],_0x5a4957[_0xb27f('0x42')]));_0x4f29d5[_0xb27f('0xa5')][_0xb27f('0xad')]=_0x3d2c3c['id'];if(_0x19f5e6[_0xb27f('0x3c')]['filter']){_0x4f29d5['where']=_['merge'](_0x4f29d5[_0xb27f('0xa5')],{'$or':_[_0xb27f('0x37')](_0x4f29d5[_0xb27f('0x44')],function(_0x34694f){var _0x249885={};_0x249885[_0x34694f]={'$like':'%'+_0x19f5e6[_0xb27f('0x3c')]['filter']+'%'};return _0x249885;})});}_0x4f29d5[_0xb27f('0xa5')]['secret']=![];if(_0x19f5e6[_0xb27f('0x3c')]['id']){_0x4f29d5[_0xb27f('0xa5')]['id']={'$gt':_0x19f5e6[_0xb27f('0x3c')]['id']};}_0x4f29d5=_['merge']({},_0x4f29d5,_0x19f5e6[_0xb27f('0x49')]);return db['ChatMessage'][_0xb27f('0x29')]({'where':_0x4f29d5[_0xb27f('0xa5')]})[_0xb27f('0x19')](function(_0x42dfd3){_0x3e016a[_0xb27f('0x29')]=_0x42dfd3;_0x4f29d5[_0xb27f('0x48')]=[];if(_0x19f5e6[_0xb27f('0x3c')][_0xb27f('0xae')]){_0x4f29d5[_0xb27f('0x48')][_0xb27f('0xaf')]({'model':db['User'],'as':_0xb27f('0x83'),'attributes':['id',_0xb27f('0x8e'),'alias']});}if(_0x19f5e6[_0xb27f('0x3c')][_0xb27f('0x47')]){_0x4f29d5[_0xb27f('0x48')]=[{'all':!![]}];}return db[_0xb27f('0x9d')][_0xb27f('0xa9')](_0x4f29d5);})[_0xb27f('0x19')](function(_0x325af3){_0x3e016a['rows']=_0x325af3;return _0x3e016a;});}})['then'](respondWithFilteredResult(_0x177103,_0x4f29d5))[_0xb27f('0x23')](handleError(_0x177103,null));};exports['addTags']=function(_0x4ce46d,_0x29d0f5){return db['ChatInteraction'][_0xb27f('0x62')]({'where':{'id':_0x4ce46d[_0xb27f('0x3f')]['id']}})[_0xb27f('0x19')](handleEntityNotFound(_0x29d0f5,null))[_0xb27f('0x19')](function(_0x446370){if(_0x446370){return _0x446370[_0xb27f('0xb0')](_0x4ce46d[_0xb27f('0x31')][_0xb27f('0x9e')],_[_0xb27f('0x9f')](_0x4ce46d[_0xb27f('0x31')],[_0xb27f('0x9e'),'id'])||{})[_0xb27f('0xb1')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xb27f('0xb2')],'where':{'id':_0x4ce46d['body']['ids']}});})[_0xb27f('0x19')](function(_0x11cb83){socket[_0xb27f('0xb3')](_0xb27f('0xb4'),{'id':Number(_0x4ce46d[_0xb27f('0x3f')]['id']),'tags':_0x11cb83||[]});return{'id':Number(_0x4ce46d[_0xb27f('0x3f')]['id']),'tags':_0x11cb83||[]};});}})['then'](respondWithResult(_0x29d0f5,null))[_0xb27f('0x23')](handleError(_0x29d0f5,null));};exports[_0xb27f('0xb5')]=function(_0x452966,_0x130cec){return db[_0xb27f('0x4a')]['find']({'where':{'id':_0x452966[_0xb27f('0x3f')]['id']}})[_0xb27f('0x19')](handleEntityNotFound(_0x130cec,null))[_0xb27f('0x19')](function(_0x1ed471){if(_0x1ed471){return _0x1ed471['removeTags'](_0x452966[_0xb27f('0x3c')][_0xb27f('0x9e')]);}})['then'](respondWithStatusCode(_0x130cec,null))['catch'](handleError(_0x130cec,null));};exports[_0xb27f('0xb6')]=function(_0x5817ae,_0x5168a0){var _0x4630ce=moment()[_0xb27f('0xb7')]()[_0xb27f('0xb8')]();var _0x11d114=path[_0xb27f('0x78')](config[_0xb27f('0xb9')],_0xb27f('0xba'),_0xb27f('0xbb'),_0xb27f('0xbc'));var _0x10eb8a=path[_0xb27f('0x78')](config['root'],_0xb27f('0xba'),_0xb27f('0xbb'),_0xb27f('0xbd'));var _0x58ec98=path[_0xb27f('0x78')](_0x11d114,_0x4630ce);var _0x38cc29=util['format'](_0xb27f('0xbe'),_0x5817ae['params']['id'],_0x4630ce);var _0x2712c7=path[_0xb27f('0x78')](_0x11d114,_0x38cc29);var _0x28b6cf=[];_0x28b6cf['push']({'model':db[_0xb27f('0x83')],'as':_0xb27f('0x83'),'attributes':['id',_0xb27f('0x8e')],'raw':!![]});_0x28b6cf[_0xb27f('0xaf')]({'model':db[_0xb27f('0x63')],'as':_0xb27f('0x64'),'attributes':['id',_0xb27f('0xbf'),'lastName'],'raw':!![]});if(_0x5817ae[_0xb27f('0x3c')]['attachments']){_0x28b6cf[_0xb27f('0xaf')]({'model':db[_0xb27f('0x73')],'as':_0xb27f('0x73'),'raw':!![]});}var _0x1e65aa=[{'model':db[_0xb27f('0x9d')],'as':_0xb27f('0x82'),'attributes':['id',_0xb27f('0x31'),_0xb27f('0xc0'),_0xb27f('0x91'),_0xb27f('0x92'),_0xb27f('0xc1')],'include':_0x28b6cf}];_0x1e65aa[_0xb27f('0xaf')]({'model':db[_0xb27f('0x4f')],'as':'Account','attributes':['id',_0xb27f('0x2f')]});_0x1e65aa[_0xb27f('0xaf')]({'model':db[_0xb27f('0x83')],'as':'Owner','attributes':['id',_0xb27f('0x8e')]});return db['ChatInteraction'][_0xb27f('0x62')]({'where':{'id':_0x5817ae['params']['id']},'include':_0x1e65aa})[_0xb27f('0x19')](handleEntityNotFound(_0x5168a0,null))['then'](function(_0x401b38){if(_0x401b38){var _0x23ed52=_0x401b38[_0xb27f('0xc2')]({'plain':!![]});fs[_0xb27f('0xc3')](_0x58ec98);var _0x24101d={'channel':'Chat','account':_0x23ed52[_0xb27f('0xc4')][_0xb27f('0x2f')],'agent':_0x23ed52['Owner']?_0x23ed52['Owner'][_0xb27f('0x8e')]:'N.A.','createdAt':moment(_0x23ed52[_0xb27f('0xc0')])[_0xb27f('0x7e')](_0xb27f('0xc5'))[_0xb27f('0xb8')](),'closedAt':_0x23ed52[_0xb27f('0x69')]?moment(_0x23ed52[_0xb27f('0xc6')])[_0xb27f('0x7e')](_0xb27f('0xc5'))[_0xb27f('0xb8')]():'','disposition':_0x23ed52[_0xb27f('0x6a')],'chatInfo':{'browser':_0x23ed52[_0xb27f('0xc7')],'os':_0x23ed52[_0xb27f('0xc8')],'referer':_0x23ed52[_0xb27f('0xc9')],'customerIp':_0x23ed52['customerIp'],'customerPort':_0x23ed52['customerPort']?_0x23ed52[_0xb27f('0xca')]:'N.A.'},'messages':_(_0x23ed52[_0xb27f('0x82')])['tail']()[_0xb27f('0xa6')]({'secret':![]})['map'](function(_0x478ec3){if(_0x478ec3[_0xb27f('0x73')]){var _0x48bba0=path[_0xb27f('0x78')](_0x10eb8a,_0x478ec3[_0xb27f('0x73')][_0xb27f('0x7b')]);if(fs[_0xb27f('0xcb')](_0x48bba0)){fs[_0xb27f('0xcc')](_0x48bba0)[_0xb27f('0xcd')](fs['createWriteStream'](path['join'](_0x58ec98,_0x478ec3[_0xb27f('0x73')][_0xb27f('0x7b')])));}}return{'date':moment(_0x478ec3[_0xb27f('0xc0')])[_0xb27f('0x7e')](_0xb27f('0xc5'))['toString'](),'sender':_0x478ec3[_0xb27f('0x91')]===_0xb27f('0x5f')?_0x478ec3[_0xb27f('0x83')]?_0x478ec3[_0xb27f('0x83')]['fullname']:_0xb27f('0x86'):_0x478ec3[_0xb27f('0x64')][_0xb27f('0xbf')]+(_0x478ec3[_0xb27f('0x64')][_0xb27f('0xce')]?'\x20'+_0x478ec3[_0xb27f('0x64')][_0xb27f('0xce')]:''),'body':_0x478ec3['Attachment']?_0x478ec3[_0xb27f('0x73')]['basename']:_0x478ec3[_0xb27f('0x31')],'direction':_0x478ec3[_0xb27f('0x91')]===_0xb27f('0x5f')?'A':'C','secret':_0x478ec3[_0xb27f('0x92')],'read':_0x478ec3[_0xb27f('0xc1')],'attachment':_0x478ec3[_0xb27f('0x73')]};})[_0xb27f('0xcf')]()};return ejs[_0xb27f('0xd0')](path[_0xb27f('0x78')](config[_0xb27f('0xb9')],_0xb27f('0xba'),'views',_0xb27f('0xd1')),{'interaction':_0x24101d})['then'](function(_0x139767){var _0x5a5306=path[_0xb27f('0x78')](_0x58ec98,'transcript-'+_0x23ed52['id']+'-'+_0x4630ce+_0xb27f('0xd2'));var _0x1389c4={'path':_0x5a5306,'channel':_0xb27f('0xd3'),'interactionId':_0x23ed52['id']};return pdf[_0xb27f('0xd4')](_0x139767,_0x1389c4);})[_0xb27f('0x19')](function(){return new Promise(function(_0x8e4bdb,_0x4c488b){zipdir(_0x58ec98,{'saveTo':_0x2712c7},function(_0x5ab579,_0x55bc5c){if(_0x5ab579)return _0x4c488b(_0x5ab579);return _0x8e4bdb(_0x55bc5c);});})[_0xb27f('0x19')](function(){return new BPromise(function(_0x1d5ece,_0x58198e){rimraf(_0x58ec98,function(_0x28e5d6){if(_0x28e5d6)_0x58198e(_0x28e5d6);return _0x1d5ece();});});})[_0xb27f('0x19')](function(){return _0x5168a0[_0xb27f('0xb6')](_0x2712c7,_0x38cc29,function(_0x206c1c){if(_0x206c1c){logger[_0xb27f('0x1e')](_0xb27f('0xd5'),_0x206c1c);}else{fs['unlinkSync'](_0x2712c7);}});});});}else{return _0x5168a0[_0xb27f('0x24')](0xc8);}})[_0xb27f('0x23')](handleError(_0x5168a0,null));};
\ No newline at end of file
+var _0x3acb=['value','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','end','stack','name','body','index','map','ChatInteraction','rawAttributes','fieldName','key','getOptions','findAll','chat','show','model','query','keys','filters','intersection','attributes','fields','length','include','merge','options','create','params','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooApiKey','user','fullname','email','contact','account','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','follow','isNull','parse','metadata','Sequelize','ValidationError','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','filename','mimetype','Attachment','ChatOfflineMessageId','join','root','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','ContactId','format','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','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','omit','hasOwnProperty','nolimit','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','order','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','Chat','N.A.','toString','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createWriteStream','out','basename'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3acb,0x19a));var _0xb3ac=function(_0x4c12a8,_0x55d973){_0x4c12a8=_0x4c12a8-0x0;var _0x177947=_0x3acb[_0x4c12a8];return _0x177947;};'use strict';var rimraf=require(_0xb3ac('0x0'));var zipdir=require(_0xb3ac('0x1'));var rp=require(_0xb3ac('0x2'));var moment=require(_0xb3ac('0x3'));var BPromise=require(_0xb3ac('0x4'));var Mustache=require(_0xb3ac('0x5'));var util=require('util');var path=require(_0xb3ac('0x6'));var ejs=require(_0xb3ac('0x7'));var fs=require('fs');var _=require(_0xb3ac('0x8'));var Redis=require(_0xb3ac('0x9'));var interaction=require(_0xb3ac('0xa'));var qs=require(_0xb3ac('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0xb3ac('0xc'))(_0xb3ac('0xd'));var config=require(_0xb3ac('0xe'));var db=require(_0xb3ac('0xf'))['db'];config['redis']=_[_0xb3ac('0x10')](config[_0xb3ac('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xb3ac('0x12'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xb3ac('0x13')](socket);var jayson=require(_0xb3ac('0x14'));var client=jayson[_0xb3ac('0x15')][_0xb3ac('0x16')]({'port':0x232b});var client9004=jayson[_0xb3ac('0x15')][_0xb3ac('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x20ab48,_0x585e2d,_0x357417,_0x3451ef){return new BPromise(function(_0x4499d1,_0x4fa2e7){var _0x4b41a5=_0x3451ef||client;return _0x4b41a5['request'](_0x20ab48,_0x357417)[_0xb3ac('0x17')](function(_0x333ec0){logger[_0xb3ac('0x18')](_0xb3ac('0x19'),_0x585e2d,_0xb3ac('0x1a'));logger[_0xb3ac('0x1b')](_0xb3ac('0x1c'),_0x585e2d,_0xb3ac('0x1a'),JSON['stringify'](_0x333ec0));if(_0x333ec0[_0xb3ac('0x1d')]){if(_0x333ec0[_0xb3ac('0x1d')]['code']===0x1f4){logger[_0xb3ac('0x1d')](_0xb3ac('0x19'),_0x585e2d,_0x333ec0[_0xb3ac('0x1d')][_0xb3ac('0x1e')]);return _0x4fa2e7(_0x333ec0[_0xb3ac('0x1d')][_0xb3ac('0x1e')]);}logger[_0xb3ac('0x1d')](_0xb3ac('0x19'),_0x585e2d,_0x333ec0['error'][_0xb3ac('0x1e')]);return _0x4499d1(_0x333ec0[_0xb3ac('0x1d')][_0xb3ac('0x1e')]);}else{logger['info'](_0xb3ac('0x19'),_0x585e2d,_0xb3ac('0x1a'));_0x4499d1(_0x333ec0[_0xb3ac('0x1f')]['message']);}})[_0xb3ac('0x20')](function(_0x54178d){logger[_0xb3ac('0x1d')](_0xb3ac('0x19'),_0x585e2d,_0x54178d);_0x4fa2e7(_0x54178d);});});}function respondWithStatusCode(_0x2dee1b,_0x5ef209){_0x5ef209=_0x5ef209||0xcc;return function(_0x5574f8){if(_0x5574f8){return _0x2dee1b[_0xb3ac('0x21')](_0x5ef209);}return _0x2dee1b[_0xb3ac('0x22')](_0x5ef209)['end']();};}function respondWithResult(_0x160453,_0x1f4479){_0x1f4479=_0x1f4479||0xc8;return function(_0x3353e6){if(_0x3353e6){return _0x160453[_0xb3ac('0x22')](_0x1f4479)[_0xb3ac('0x23')](_0x3353e6);}};}function respondWithFilteredResult(_0x2e336b,_0x50d730){return function(_0x226444){if(_0x226444){var _0x1a50d2=typeof _0x50d730[_0xb3ac('0x24')]===_0xb3ac('0x25')&&typeof _0x50d730[_0xb3ac('0x26')]===_0xb3ac('0x25');var _0x97292=_0x226444['count'];var _0x24cfd0=_0x1a50d2?0x0:_0x50d730[_0xb3ac('0x24')];var _0x24ca0c=_0x1a50d2?_0x226444[_0xb3ac('0x27')]:_0x50d730['offset']+_0x50d730[_0xb3ac('0x26')];var _0x3dec8e;if(_0x24ca0c>=_0x97292){_0x24ca0c=_0x97292;_0x3dec8e=0xc8;}else{_0x3dec8e=0xce;}_0x2e336b['status'](_0x3dec8e);return _0x2e336b[_0xb3ac('0x28')](_0xb3ac('0x29'),_0x24cfd0+'-'+_0x24ca0c+'/'+_0x97292)[_0xb3ac('0x23')](_0x226444);}return null;};}function saveUpdates(_0xa58835){return function(_0xb15e34){if(_0xb15e34){return _0xb15e34[_0xb3ac('0x2a')](_0xa58835)[_0xb3ac('0x17')](function(_0x9d2b80){return _0x9d2b80;});}return null;};}function removeEntity(_0x3138d3){return function(_0x38375c){if(_0x38375c){return _0x38375c['destroy']()[_0xb3ac('0x17')](function(){_0x3138d3[_0xb3ac('0x22')](0xcc)[_0xb3ac('0x2b')]();});}};}function handleEntityNotFound(_0x15e530){return function(_0x441c99){if(!_0x441c99){_0x15e530['sendStatus'](0x194);}return _0x441c99;};}function handleError(_0x2300e0,_0x4edf99){_0x4edf99=_0x4edf99||0x1f4;return function(_0x188a15){logger['error'](_0x188a15[_0xb3ac('0x2c')]);if(_0x188a15['name']){delete _0x188a15[_0xb3ac('0x2d')];}_0x2300e0['status'](_0x4edf99)['send'](_0x188a15);};}function getMustacheRender(_0xcd85bf,_0x4703a7){return Mustache['render'](_0xcd85bf,_['merge'](_0x4703a7[_0xb3ac('0x2e')],{'contact':_0x4703a7['contact'],'message':_0x4703a7[_0xb3ac('0x1e')],'agent':_0x4703a7['agent'],'interaction':_0x4703a7['interaction'],'account':_0x4703a7['account']}))||'';}exports[_0xb3ac('0x2f')]=function(_0x21d3c9,_0xb93fc6){var _0x28be53={};var _0x3347e0=_[_0xb3ac('0x30')](db[_0xb3ac('0x31')][_0xb3ac('0x32')],function(_0x5c28d9){return{'name':_0x5c28d9[_0xb3ac('0x33')],'type':_0x5c28d9['type'][_0xb3ac('0x34')]};});_0x28be53=qs[_0xb3ac('0x35')](_0x3347e0,_0x21d3c9);return interaction[_0xb3ac('0x36')](_0xb3ac('0x37'),_0x21d3c9['query'],_0x21d3c9['user'],_0x28be53,_0x3347e0)[_0xb3ac('0x17')](respondWithFilteredResult(_0xb93fc6,_0x28be53))[_0xb3ac('0x20')](handleError(_0xb93fc6,null));};exports[_0xb3ac('0x38')]=function(_0x21e678,_0x31bff6){var _0x229fbf={'raw':![],'where':{'id':_0x21e678['params']['id']}},_0x5972d3={};_0x5972d3[_0xb3ac('0x39')]=_['keys'](db[_0xb3ac('0x31')][_0xb3ac('0x32')]);_0x5972d3[_0xb3ac('0x3a')]=_[_0xb3ac('0x3b')](_0x21e678[_0xb3ac('0x3a')]);_0x5972d3[_0xb3ac('0x3c')]=_[_0xb3ac('0x3d')](_0x5972d3[_0xb3ac('0x39')],_0x5972d3['query']);_0x229fbf[_0xb3ac('0x3e')]=_['intersection'](_0x5972d3['model'],qs[_0xb3ac('0x3f')](_0x21e678[_0xb3ac('0x3a')][_0xb3ac('0x3f')]));_0x229fbf['attributes']=_0x229fbf[_0xb3ac('0x3e')][_0xb3ac('0x40')]?_0x229fbf[_0xb3ac('0x3e')]:_0x5972d3['model'];if(_0x21e678[_0xb3ac('0x3a')]['includeAll']){_0x229fbf[_0xb3ac('0x41')]=[{'all':!![]}];}_0x229fbf=_[_0xb3ac('0x42')]({},_0x229fbf,_0x21e678[_0xb3ac('0x43')]);return db[_0xb3ac('0x31')]['find'](_0x229fbf)[_0xb3ac('0x17')](handleEntityNotFound(_0x31bff6,null))[_0xb3ac('0x17')](respondWithResult(_0x31bff6,null))[_0xb3ac('0x20')](handleError(_0x31bff6,null));};exports[_0xb3ac('0x44')]=function(_0x10be85,_0x26f382){return db['ChatInteraction'][_0xb3ac('0x44')](_0x10be85[_0xb3ac('0x2e')],{})[_0xb3ac('0x17')](respondWithResult(_0x26f382,0xc9))[_0xb3ac('0x20')](handleError(_0x26f382,null));};exports[_0xb3ac('0x2a')]=function(_0x2ed300,_0x5bccf1){if(_0x2ed300[_0xb3ac('0x2e')]['id']){delete _0x2ed300[_0xb3ac('0x2e')]['id'];}return db[_0xb3ac('0x31')]['find']({'where':{'id':_0x2ed300[_0xb3ac('0x45')]['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x5bccf1,null))['then'](saveUpdates(_0x2ed300[_0xb3ac('0x2e')],null))[_0xb3ac('0x17')](respondWithResult(_0x5bccf1,null))[_0xb3ac('0x20')](handleError(_0x5bccf1,null));};exports['destroy']=function(_0x516d6c,_0x4112af){return db[_0xb3ac('0x31')][_0xb3ac('0x46')]({'where':{'id':_0x516d6c[_0xb3ac('0x45')]['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x4112af,null))[_0xb3ac('0x17')](removeEntity(_0x4112af,null))[_0xb3ac('0x20')](handleError(_0x4112af,null));};exports[_0xb3ac('0x47')]=function(_0x18594a,_0x4fe068){return db[_0xb3ac('0x31')]['describe']()[_0xb3ac('0x17')](respondWithResult(_0x4fe068,null))[_0xb3ac('0x20')](handleError(_0x4fe068,null));};exports['createVidaooSession']=function(_0x178e8a,_0x56d61b){var _0x6b2e32=_0x178e8a[_0xb3ac('0x45')]['id'];var _0x408551;var _0x42592c;var _0x26d748;return db[_0xb3ac('0x31')][_0xb3ac('0x48')]({'where':{'id':_0x6b2e32}})[_0xb3ac('0x17')](function(_0x58932e){_0x408551=_0x58932e;return db[_0xb3ac('0x49')][_0xb3ac('0x48')]({'where':{'id':_0x58932e[_0xb3ac('0x4a')]},'attributes':['id','vidaooApiKey',_0xb3ac('0x4b'),'vidaooTopic','vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xb3ac('0x17')](function(_0x39518e){if(_0x39518e&&_0x39518e[_0xb3ac('0x4c')]&&_0x39518e[_0xb3ac('0x4b')]){_0x42592c=_0x39518e;var _0x454e13={'interaction':{'id':_0x6b2e32},'agent':{'id':_0x178e8a[_0xb3ac('0x4d')]['id'],'name':_0x178e8a['user']['name'],'fullname':_0x178e8a[_0xb3ac('0x4d')][_0xb3ac('0x4e')],'email':_0x178e8a[_0xb3ac('0x4d')][_0xb3ac('0x4f')]},'contact':_0x178e8a['body'][_0xb3ac('0x50')],'account':_0x178e8a[_0xb3ac('0x2e')][_0xb3ac('0x51')]};var _0x495f2b={'rejectUnauthorized':![],'method':'POST','url':_0xb3ac('0x52'),'headers':{'X-APIKEY':_0x39518e[_0xb3ac('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x178e8a[_0xb3ac('0x4d')][_0xb3ac('0x4f')]],'buttons':null,'topic':_0x42592c['vidaooTopic'],'note':_['isNull'](_0x42592c['vidaooNote'])?null:getMustacheRender(_0x42592c[_0xb3ac('0x53')],_0x454e13),'metadata':null},'redirect':_0xb3ac('0x54'),'json':!![]};try{if(!_[_0xb3ac('0x55')](_0x42592c['vidaooMetadata'])){var _0x11f437=getMustacheRender(_0x42592c['vidaooMetadata'],_0x454e13);var _0x12877d=JSON[_0xb3ac('0x56')](_0x11f437);_0x495f2b[_0xb3ac('0x2e')][_0xb3ac('0x57')]=_0x12877d;}}catch(_0x4c2b7c){throw new db[(_0xb3ac('0x58'))][(_0xb3ac('0x59'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x495f2b);}else{throw new db[(_0xb3ac('0x58'))][(_0xb3ac('0x59'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xb3ac('0x17')](function(_0x2ffc33){_0x26d748=_0x2ffc33;if(_0x26d748['id']){var _0x52dd94={'body':_0x26d748['join_url'],'ChatWebsiteId':_0x42592c['id'],'ChatInteractionId':_0x408551['id'],'direction':'out','UserId':_0x178e8a['user']['id']};return db[_0xb3ac('0x5a')][_0xb3ac('0x44')](_0x52dd94,{});}else{throw new db[(_0xb3ac('0x58'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xb3ac('0x17')](function(){return _0x408551[_0xb3ac('0x5b')]({'vidaooSessionId':_0x26d748['id']});})[_0xb3ac('0x17')](respondWithResult(_0x56d61b,null))[_0xb3ac('0x20')](handleError(_0x56d61b,null));};exports[_0xb3ac('0x5c')]=function(_0x55d0db,_0x4d679d){if(_0x55d0db['body']['id']){delete _0x55d0db[_0xb3ac('0x2e')]['id'];}return db[_0xb3ac('0x31')][_0xb3ac('0x46')]({'where':{'id':_0x55d0db[_0xb3ac('0x45')]['id']},'include':[{'model':db[_0xb3ac('0x5d')],'as':_0xb3ac('0x5e')}]})[_0xb3ac('0x17')](handleEntityNotFound(_0x4d679d,null))[_0xb3ac('0x17')](saveUpdates(_0x55d0db[_0xb3ac('0x2e')],null))[_0xb3ac('0x17')](respondWithResult(_0x4d679d,null))['catch'](handleError(_0x4d679d,null));};exports[_0xb3ac('0x5f')]=function(_0x3adcee,_0x43f19f){if(_0x3adcee[_0xb3ac('0x2e')]['id']){delete _0x3adcee[_0xb3ac('0x2e')]['id'];}return db[_0xb3ac('0x31')]['find']({'where':{'id':_0x3adcee[_0xb3ac('0x45')]['id']}})['then'](function(_0x3b8589){if(!_0x3b8589){logger[_0xb3ac('0x1d')](_0xb3ac('0x60'),'abandon',0x194,_0xb3ac('0x61'));_0x43f19f[_0xb3ac('0x21')](0x194);}else{if(_0x3b8589[_0xb3ac('0x62')]){throw new db[(_0xb3ac('0x58'))][(_0xb3ac('0x59'))](_0xb3ac('0x63'));}}return _0x3b8589;})[_0xb3ac('0x17')](function(_0x1967c2){if(_0x1967c2){return _0x1967c2[_0xb3ac('0x2a')]({'closed':_0x3adcee[_0xb3ac('0x2e')][_0xb3ac('0x64')],'disposition':_0x3adcee[_0xb3ac('0x2e')]['disposition']})[_0xb3ac('0x17')](function(_0x22a03a){return _0x22a03a;});}})[_0xb3ac('0x17')](function(){return respondWithRpcPromise('AbandonInteraction',_0xb3ac('0x5f'),_0x3adcee['body'],client9004);})[_0xb3ac('0x17')](respondWithResult(_0x43f19f,null))['catch'](handleError(_0x43f19f,null));};exports[_0xb3ac('0x65')]=function(_0x4ca5b3,_0xc6db11){_0x4ca5b3[_0xb3ac('0x2e')]['name']=_0x4ca5b3[_0xb3ac('0x66')][_0xb3ac('0x67')];_0x4ca5b3['body']['basename']=_0x4ca5b3[_0xb3ac('0x66')][_0xb3ac('0x68')];_0x4ca5b3['body']['type']=_0x4ca5b3[_0xb3ac('0x66')][_0xb3ac('0x69')];return db[_0xb3ac('0x6a')][_0xb3ac('0x44')](_0x4ca5b3['body'])['then'](respondWithResult(_0xc6db11,0xc9))[_0xb3ac('0x20')](handleError(_0xc6db11,null));};exports['attachmentDownload']=function(_0x42a3ac,_0x50006c){return db[_0xb3ac('0x31')][_0xb3ac('0x48')]({'where':{'id':_0x42a3ac['params']['id']},'raw':!![]})[_0xb3ac('0x17')](handleEntityNotFound(_0x50006c,null))['then'](function(_0x26a6be){if(_0x26a6be){if(_0x26a6be[_0xb3ac('0x64')]){return _0x50006c[_0xb3ac('0x22')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xb3ac('0x6a')][_0xb3ac('0x48')]({'where':{'id':_0x42a3ac['query']['attachId']},'raw':!![]})[_0xb3ac('0x17')](handleEntityNotFound(_0x50006c,null));}})['then'](function(_0x3e9d2b){if(_0x3e9d2b){var _0x1e0056=_0x3e9d2b[_0xb3ac('0x6b')]!==null;var _0x2c3271=path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],'server/files/attachments/');if(_0x1e0056){_0x2c3271=path[_0xb3ac('0x6c')](_0x2c3271,'offline-chat/');}var _0x3a4acc=path[_0xb3ac('0x6c')](_0x2c3271,_0x3e9d2b['basename']);return _0x50006c[_0xb3ac('0x6e')](_0x3a4acc);}})['catch'](handleError(_0x50006c,null));};exports[_0xb3ac('0x6f')]=function(_0x23973b,_0x2c3af3){var _0x1b23c9=null;var _0x52811=null;var _0x1337fb=null;if(_0x23973b['body']['id']){delete _0x23973b[_0xb3ac('0x2e')]['id'];}if(_0x23973b[_0xb3ac('0x2e')][_0xb3ac('0x70')]){_0x1337fb=path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],_0xb3ac('0x71'),util['format'](_0xb3ac('0x72'),Date[_0xb3ac('0x73')]()));_0x23973b[_0xb3ac('0x2e')]['pathTranscript']=_0x1337fb;}return db['ChatInteraction'][_0xb3ac('0x46')]({'where':{'id':_0x23973b[_0xb3ac('0x45')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xb3ac('0x74'),'include':[{'model':db[_0xb3ac('0x75')],'as':_0xb3ac('0x75')}]}]})[_0xb3ac('0x17')](handleEntityNotFound(_0x2c3af3,null))[_0xb3ac('0x17')](saveUpdates(_0x23973b[_0xb3ac('0x2e')],null))['then'](function(_0x31991c){if(_0x31991c){_0x1b23c9=_0x31991c;return db[_0xb3ac('0x49')][_0xb3ac('0x46')]({'where':{'id':_0x1b23c9[_0xb3ac('0x4a')]}});}})['then'](function(_0x27f1c4){if(_0x27f1c4){_0x52811=_0x27f1c4;return db[_0xb3ac('0x5d')][_0xb3ac('0x46')]({'where':{'id':_0x1b23c9[_0xb3ac('0x76')]}});}})[_0xb3ac('0x17')](function(_0x2579df){if(_0x2579df){if(_0x1337fb){var _0x5e5a37=null;for(var _0x3729dc=0x1;_0x3729dc<_0x1b23c9['Messages'][_0xb3ac('0x40')];++_0x3729dc){_0x5e5a37=_0x1b23c9[_0xb3ac('0x74')][_0x3729dc];var _0x198853=_0x5e5a37[_0xb3ac('0x62')]?util[_0xb3ac('0x77')](_0xb3ac('0x78'),_0x52811[_0xb3ac('0x79')],_0x5e5a37[_0xb3ac('0x62')]):_0xb3ac('0x7a');var _0x44a6b3=_0x23973b[_0xb3ac('0x2e')]['customer']||util[_0xb3ac('0x77')]('%s%d',_0xb3ac('0x7b'),_0x5e5a37[_0xb3ac('0x76')]);switch(_0x52811[_0xb3ac('0x7c')]){case _0xb3ac('0x7d'):_0x198853=_0x5e5a37[_0xb3ac('0x62')]?util[_0xb3ac('0x77')](_0xb3ac('0x78'),_0x52811[_0xb3ac('0x79')],_0x5e5a37[_0xb3ac('0x62')]):_0xb3ac('0x7a');break;case _0xb3ac('0x7e'):_0x198853=_0x5e5a37['UserId']?_0x5e5a37[_0xb3ac('0x75')]['alias']||_0x5e5a37[_0xb3ac('0x75')]['fullname']:_0xb3ac('0x7a');break;case _0xb3ac('0x7f'):_0x198853=_0x5e5a37[_0xb3ac('0x62')]?_0x5e5a37[_0xb3ac('0x75')][_0xb3ac('0x4e')]:_0xb3ac('0x7a');break;default:_0x198853=_0x5e5a37[_0xb3ac('0x62')]?util['format'](_0xb3ac('0x78'),_0x52811[_0xb3ac('0x79')],_0x5e5a37['UserId']):_0xb3ac('0x7a');}var _0x37d8bf=util[_0xb3ac('0x77')](_0xb3ac('0x80'),moment(_0x5e5a37[_0xb3ac('0x81')])[_0xb3ac('0x77')](_0xb3ac('0x82')),_0x5e5a37[_0xb3ac('0x83')]==='in'?_0x44a6b3:_0x198853,_0x5e5a37['body']);if(!_0x5e5a37[_0xb3ac('0x84')]){fs[_0xb3ac('0x85')](_0x1337fb,_0x37d8bf);}}return db[_0xb3ac('0x86')][_0xb3ac('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0xb3ac('0x87')],'as':_0xb3ac('0x88'),'raw':!![],'include':[{'model':db[_0xb3ac('0x89')],'as':_0xb3ac('0x89'),'raw':!![]}]}]});}}})['then'](function(_0x1774c8){if(!_0x1774c8||!_0x1774c8[_0xb3ac('0x88')]||!_0x23973b['body'])return _0x1b23c9;var _0x132788=_0x1774c8[_0xb3ac('0x8a')]();return respondWithRpcPromise(_0xb3ac('0x8b'),'sendMail',{'account':_0x132788,'message':{'from':util[_0xb3ac('0x77')](_0xb3ac('0x8c'),_0x1774c8[_0xb3ac('0x2d')],_0x1774c8['email']||_0x1774c8[_0xb3ac('0x88')][_0xb3ac('0x4d')]),'to':_0x23973b['body'][_0xb3ac('0x70')],'subject':_0xb3ac('0x8d'),'text':util[_0xb3ac('0x77')](_0xb3ac('0x8e'),_0x23973b[_0xb3ac('0x2e')]['mailTranscript']),'attachments':[{'path':_0x1337fb}]}})[_0xb3ac('0x17')](function(){return _0x1b23c9;})[_0xb3ac('0x20')](function(_0x344255){logger['error'](_0x344255);});})[_0xb3ac('0x17')](respondWithStatusCode(_0x2c3af3,0xc8))[_0xb3ac('0x20')](handleError(_0x2c3af3,null));};exports[_0xb3ac('0x8f')]=function(_0x1518fb,_0x4cd2b7){return db['ChatMessage']['find']({'where':{'id':_0x1518fb[_0xb3ac('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cd2b7,null))[_0xb3ac('0x17')](function(_0x3976db){if(_0x3976db){return _0x3976db[_0xb3ac('0x8f')](_0x1518fb[_0xb3ac('0x2e')][_0xb3ac('0x90')],_[_0xb3ac('0x91')](_0x1518fb[_0xb3ac('0x2e')],[_0xb3ac('0x90'),'id'])||{});}})[_0xb3ac('0x17')](respondWithResult(_0x4cd2b7,null))[_0xb3ac('0x20')](handleError(_0x4cd2b7,null));};exports['getMessages']=function(_0x5d23b6,_0x2896f1){var _0xfc9245={'raw':![],'where':{}};var _0x125d90={};var _0x57ebc1={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb3ac('0x48')]({'where':{'id':_0x5d23b6[_0xb3ac('0x45')]['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x2896f1,null))['then'](function(_0x372480){if(_0x372480){_0x125d90['model']=_[_0xb3ac('0x3b')](db[_0xb3ac('0x5a')][_0xb3ac('0x32')]);_0x125d90[_0xb3ac('0x3a')]=_[_0xb3ac('0x3b')](_0x5d23b6[_0xb3ac('0x3a')]);_0x125d90[_0xb3ac('0x3c')]=_[_0xb3ac('0x3d')](_0x125d90[_0xb3ac('0x39')],_0x125d90[_0xb3ac('0x3a')]);_0xfc9245[_0xb3ac('0x3e')]=_[_0xb3ac('0x3d')](_0x125d90[_0xb3ac('0x39')],qs[_0xb3ac('0x3f')](_0x5d23b6[_0xb3ac('0x3a')]['fields']));_0xfc9245[_0xb3ac('0x3e')]=_0xfc9245[_0xb3ac('0x3e')][_0xb3ac('0x40')]?_0xfc9245[_0xb3ac('0x3e')]:_0x125d90[_0xb3ac('0x39')];if(!_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x92')](_0xb3ac('0x93'))){_0xfc9245['limit']=qs[_0xb3ac('0x26')](_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x26')]);_0xfc9245[_0xb3ac('0x24')]=qs[_0xb3ac('0x24')](_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x24')]);}_0xfc9245['order']=qs[_0xb3ac('0x94')](_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x94')]);_0xfc9245['where']=qs['filters'](_[_0xb3ac('0x95')](_0x5d23b6[_0xb3ac('0x3a')],_0x125d90['filters']));_0xfc9245[_0xb3ac('0x96')][_0xb3ac('0x97')]=_0x372480['id'];if(_0x5d23b6[_0xb3ac('0x3a')]['filter']){_0xfc9245[_0xb3ac('0x96')]=_[_0xb3ac('0x42')](_0xfc9245[_0xb3ac('0x96')],{'$or':_[_0xb3ac('0x30')](_0xfc9245[_0xb3ac('0x3e')],function(_0x1c6c41){var _0x21a76b={};_0x21a76b[_0x1c6c41]={'$like':'%'+_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x98')]+'%'};return _0x21a76b;})});}if(_0x5d23b6[_0xb3ac('0x3a')][_0xb3ac('0x99')]){var _0x4d1113=_0x5d23b6[_0xb3ac('0x3a')]['$gte'][_0xb3ac('0x9a')](',');var _0x5f37bb={};_0x5f37bb[_0x4d1113[0x0]]={'$gte':moment(_0x4d1113[0x1])[_0xb3ac('0x77')](_0xb3ac('0x9b'))};_0xfc9245[_0xb3ac('0x96')]=_['merge'](_0xfc9245[_0xb3ac('0x96')],_0x5f37bb);}_0xfc9245=_[_0xb3ac('0x42')]({},_0xfc9245,_0x5d23b6[_0xb3ac('0x43')]);return db[_0xb3ac('0x5a')][_0xb3ac('0x27')]({'where':_0xfc9245[_0xb3ac('0x96')]})[_0xb3ac('0x17')](function(_0x5828f5){_0x57ebc1['count']=_0x5828f5;if(_0x5d23b6['query']['includeAll']){_0xfc9245['include']=[{'all':!![]}];}return db[_0xb3ac('0x5a')]['findAll'](_0xfc9245);})[_0xb3ac('0x17')](function(_0x1a5bb4){_0x57ebc1['rows']=_0x1a5bb4;return _0x57ebc1;});}})[_0xb3ac('0x17')](respondWithFilteredResult(_0x2896f1,_0xfc9245))[_0xb3ac('0x20')](handleError(_0x2896f1,null));};exports[_0xb3ac('0x9c')]=function(_0x20e8e6,_0x539907){var _0x1f5bb2={'where':{}},_0x538f83={},_0x2eb1d5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb3ac('0x48')]({'where':{'id':_0x20e8e6[_0xb3ac('0x45')]['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x539907,null))['then'](function(_0xb0e600){if(_0xb0e600){_0x538f83[_0xb3ac('0x39')]=_['keys'](db[_0xb3ac('0x5a')][_0xb3ac('0x32')]);_0x538f83[_0xb3ac('0x3a')]=_[_0xb3ac('0x3b')](_0x20e8e6[_0xb3ac('0x3a')]);_0x538f83[_0xb3ac('0x3c')]=_[_0xb3ac('0x3d')](_0x538f83[_0xb3ac('0x39')],_0x538f83[_0xb3ac('0x3a')]);_0x1f5bb2['attributes']=_[_0xb3ac('0x3d')](_0x538f83[_0xb3ac('0x39')],qs['fields'](_0x20e8e6[_0xb3ac('0x3a')][_0xb3ac('0x3f')]));_0x1f5bb2['attributes']=_0x1f5bb2[_0xb3ac('0x3e')][_0xb3ac('0x40')]?_0x1f5bb2['attributes']:_0x538f83['model'];if(!_0x20e8e6[_0xb3ac('0x3a')]['hasOwnProperty'](_0xb3ac('0x93'))){_0x1f5bb2[_0xb3ac('0x26')]=qs['limit'](_0x20e8e6['query']['limit']);_0x1f5bb2[_0xb3ac('0x24')]=qs[_0xb3ac('0x24')](_0x20e8e6['query'][_0xb3ac('0x24')]);}_0x1f5bb2[_0xb3ac('0x9d')]=qs[_0xb3ac('0x94')](_0x20e8e6['query']['sort']);_0x1f5bb2[_0xb3ac('0x96')]=qs['filters'](_[_0xb3ac('0x95')](_0x20e8e6['query'],_0x538f83[_0xb3ac('0x3c')]));_0x1f5bb2[_0xb3ac('0x96')][_0xb3ac('0x97')]=_0xb0e600['id'];if(_0x20e8e6[_0xb3ac('0x3a')][_0xb3ac('0x98')]){_0x1f5bb2['where']=_[_0xb3ac('0x42')](_0x1f5bb2[_0xb3ac('0x96')],{'$or':_[_0xb3ac('0x30')](_0x1f5bb2[_0xb3ac('0x3e')],function(_0x4a6db7){var _0x17a267={};_0x17a267[_0x4a6db7]={'$like':'%'+_0x20e8e6['query'][_0xb3ac('0x98')]+'%'};return _0x17a267;})});}_0x1f5bb2['where'][_0xb3ac('0x84')]=![];if(_0x20e8e6['query']['id']){_0x1f5bb2[_0xb3ac('0x96')]['id']={'$gt':_0x20e8e6[_0xb3ac('0x3a')]['id']};}_0x1f5bb2=_['merge']({},_0x1f5bb2,_0x20e8e6['options']);return db['ChatMessage'][_0xb3ac('0x27')]({'where':_0x1f5bb2[_0xb3ac('0x96')]})[_0xb3ac('0x17')](function(_0x1b8dbb){_0x2eb1d5[_0xb3ac('0x27')]=_0x1b8dbb;_0x1f5bb2[_0xb3ac('0x41')]=[];if(_0x20e8e6['query'][_0xb3ac('0x9e')]){_0x1f5bb2[_0xb3ac('0x41')][_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x75')],'as':_0xb3ac('0x75'),'attributes':['id','fullname','alias']});}if(_0x20e8e6[_0xb3ac('0x3a')]['includeAll']){_0x1f5bb2['include']=[{'all':!![]}];}return db[_0xb3ac('0x5a')][_0xb3ac('0x36')](_0x1f5bb2);})[_0xb3ac('0x17')](function(_0x38dedd){_0x2eb1d5[_0xb3ac('0xa0')]=_0x38dedd;return _0x2eb1d5;});}})[_0xb3ac('0x17')](respondWithFilteredResult(_0x539907,_0x1f5bb2))['catch'](handleError(_0x539907,null));};exports[_0xb3ac('0xa1')]=function(_0x456e3c,_0x5975b2){return db[_0xb3ac('0x31')]['find']({'where':{'id':_0x456e3c['params']['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x5975b2,null))['then'](function(_0x25d731){if(_0x25d731){return _0x25d731[_0xb3ac('0xa2')](_0x456e3c[_0xb3ac('0x2e')][_0xb3ac('0x90')],_[_0xb3ac('0x91')](_0x456e3c['body'],['ids','id'])||{})[_0xb3ac('0xa3')](function(){return db[_0xb3ac('0xa4')][_0xb3ac('0x36')]({'attributes':['id',_0xb3ac('0x2d'),_0xb3ac('0xa5')],'where':{'id':_0x456e3c[_0xb3ac('0x2e')][_0xb3ac('0x90')]}});})[_0xb3ac('0x17')](function(_0x40c627){socket[_0xb3ac('0xa6')](_0xb3ac('0xa7'),{'id':Number(_0x456e3c[_0xb3ac('0x45')]['id']),'tags':_0x40c627||[]});return{'id':Number(_0x456e3c[_0xb3ac('0x45')]['id']),'tags':_0x40c627||[]};});}})[_0xb3ac('0x17')](respondWithResult(_0x5975b2,null))[_0xb3ac('0x20')](handleError(_0x5975b2,null));};exports[_0xb3ac('0xa8')]=function(_0x278530,_0x4848cc){return db[_0xb3ac('0x31')][_0xb3ac('0x46')]({'where':{'id':_0x278530['params']['id']}})[_0xb3ac('0x17')](handleEntityNotFound(_0x4848cc,null))[_0xb3ac('0x17')](function(_0x562411){if(_0x562411){return _0x562411['removeTags'](_0x278530[_0xb3ac('0x3a')][_0xb3ac('0x90')]);}})[_0xb3ac('0x17')](respondWithStatusCode(_0x4848cc,null))[_0xb3ac('0x20')](handleError(_0x4848cc,null));};exports[_0xb3ac('0x6e')]=function(_0x4114bb,_0x1cc0f2){var _0xcb9495=moment()[_0xb3ac('0xa9')]()['toString']();var _0x48c21e=path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],'server',_0xb3ac('0xaa'),_0xb3ac('0xab'));var _0x32dc8d=path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],'server','files',_0xb3ac('0xac'));var _0x1f7118=path[_0xb3ac('0x6c')](_0x48c21e,_0xcb9495);var _0x30a678=util['format'](_0xb3ac('0xad'),_0x4114bb['params']['id'],_0xcb9495);var _0x3ad17f=path[_0xb3ac('0x6c')](_0x48c21e,_0x30a678);var _0x220b35=[];_0x220b35[_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x75')],'as':_0xb3ac('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x220b35[_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x5d')],'as':_0xb3ac('0x5e'),'attributes':['id',_0xb3ac('0xae'),_0xb3ac('0xaf')],'raw':!![]});if(_0x4114bb[_0xb3ac('0x3a')][_0xb3ac('0xac')]){_0x220b35[_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x6a')],'as':_0xb3ac('0x6a'),'raw':!![]});}var _0x2d3f7a=[{'model':db[_0xb3ac('0x5a')],'as':_0xb3ac('0x74'),'attributes':['id',_0xb3ac('0x2e'),_0xb3ac('0x81'),_0xb3ac('0x83'),_0xb3ac('0x84'),_0xb3ac('0xb0')],'include':_0x220b35}];_0x2d3f7a['push']({'model':db[_0xb3ac('0x49')],'as':_0xb3ac('0xb1'),'attributes':['id',_0xb3ac('0x2d')]});_0x2d3f7a[_0xb3ac('0x9f')]({'model':db[_0xb3ac('0x75')],'as':_0xb3ac('0xb2'),'attributes':['id',_0xb3ac('0x4e')]});return db[_0xb3ac('0x31')][_0xb3ac('0x46')]({'where':{'id':_0x4114bb[_0xb3ac('0x45')]['id']},'include':_0x2d3f7a})[_0xb3ac('0x17')](handleEntityNotFound(_0x1cc0f2,null))[_0xb3ac('0x17')](function(_0x442b98){if(_0x442b98){var _0x223ee9=_0x442b98[_0xb3ac('0xb3')]({'plain':!![]});fs['mkdirSync'](_0x1f7118);var _0x426b1d={'channel':_0xb3ac('0xb4'),'account':_0x223ee9['Account'][_0xb3ac('0x2d')],'agent':_0x223ee9[_0xb3ac('0xb2')]?_0x223ee9[_0xb3ac('0xb2')][_0xb3ac('0x4e')]:_0xb3ac('0xb5'),'createdAt':moment(_0x223ee9[_0xb3ac('0x81')])[_0xb3ac('0x77')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb3ac('0xb6')](),'closedAt':_0x223ee9[_0xb3ac('0x64')]?moment(_0x223ee9[_0xb3ac('0xb7')])['format'](_0xb3ac('0x9b'))[_0xb3ac('0xb6')]():'','disposition':_0x223ee9['disposition'],'chatInfo':{'browser':_0x223ee9[_0xb3ac('0xb8')],'os':_0x223ee9[_0xb3ac('0xb9')],'referer':_0x223ee9[_0xb3ac('0xba')],'customerIp':_0x223ee9[_0xb3ac('0xbb')],'customerPort':_0x223ee9[_0xb3ac('0xbc')]?_0x223ee9[_0xb3ac('0xbc')]:_0xb3ac('0xb5')},'messages':_(_0x223ee9['Messages'])[_0xb3ac('0xbd')]()[_0xb3ac('0x98')]({'secret':![]})[_0xb3ac('0x30')](function(_0x50cb12){if(_0x50cb12[_0xb3ac('0x6a')]){var _0x3c5c85=path[_0xb3ac('0x6c')](_0x32dc8d,_0x50cb12['Attachment']['basename']);if(fs['existsSync'](_0x3c5c85)){fs['createReadStream'](_0x3c5c85)['pipe'](fs[_0xb3ac('0xbe')](path[_0xb3ac('0x6c')](_0x1f7118,_0x50cb12[_0xb3ac('0x6a')]['basename'])));}}return{'date':moment(_0x50cb12[_0xb3ac('0x81')])['format'](_0xb3ac('0x9b'))[_0xb3ac('0xb6')](),'sender':_0x50cb12['direction']===_0xb3ac('0xbf')?_0x50cb12['User']?_0x50cb12[_0xb3ac('0x75')]['fullname']:'System':_0x50cb12[_0xb3ac('0x5e')][_0xb3ac('0xae')]+(_0x50cb12['Contact'][_0xb3ac('0xaf')]?'\x20'+_0x50cb12['Contact'][_0xb3ac('0xaf')]:''),'body':_0x50cb12[_0xb3ac('0x6a')]?_0x50cb12[_0xb3ac('0x6a')][_0xb3ac('0xc0')]:_0x50cb12['body'],'direction':_0x50cb12['direction']===_0xb3ac('0xbf')?'A':'C','secret':_0x50cb12[_0xb3ac('0x84')],'read':_0x50cb12[_0xb3ac('0xb0')],'attachment':_0x50cb12['Attachment']};})[_0xb3ac('0xc1')]()};return ejs['renderFile'](path[_0xb3ac('0x6c')](config[_0xb3ac('0x6d')],_0xb3ac('0xc2'),_0xb3ac('0xc3'),_0xb3ac('0xc4')),{'interaction':_0x426b1d})[_0xb3ac('0x17')](function(_0x268a55){var _0xc23090=path['join'](_0x1f7118,_0xb3ac('0xc5')+_0x223ee9['id']+'-'+_0xcb9495+_0xb3ac('0xc6'));var _0x54bf2c={'path':_0xc23090,'channel':_0xb3ac('0xb4'),'interactionId':_0x223ee9['id']};return pdf[_0xb3ac('0xc7')](_0x268a55,_0x54bf2c);})[_0xb3ac('0x17')](function(){return new Promise(function(_0x19c6f6,_0x1fa70b){zipdir(_0x1f7118,{'saveTo':_0x3ad17f},function(_0x52b735,_0x2599da){if(_0x52b735)return _0x1fa70b(_0x52b735);return _0x19c6f6(_0x2599da);});})['then'](function(){return new BPromise(function(_0x4dbe77,_0x545f41){rimraf(_0x1f7118,function(_0x2d7a6a){if(_0x2d7a6a)_0x545f41(_0x2d7a6a);return _0x4dbe77();});});})[_0xb3ac('0x17')](function(){return _0x1cc0f2[_0xb3ac('0x6e')](_0x3ad17f,_0x30a678,function(_0x2871a9){if(_0x2871a9){logger[_0xb3ac('0x1d')](_0xb3ac('0xc8'),_0x2871a9);}else{fs['unlinkSync'](_0x3ad17f);}});});});}else{return _0x1cc0f2[_0xb3ac('0x21')](0xc8);}})[_0xb3ac('0x20')](handleError(_0x1cc0f2,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d289eb7..49ab354 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 _0x8b21=['then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','getUsers'];(function(_0x14aec5,_0x3d93f5){var _0x3f0d77=function(_0x5af2d5){while(--_0x5af2d5){_0x14aec5['push'](_0x14aec5['shift']());}};_0x3f0d77(++_0x3d93f5);}(_0x8b21,0x1a2));var _0x18b2=function(_0x3cb11d,_0x1d44bd){_0x3cb11d=_0x3cb11d-0x0;var _0x3e2c4c=_0x8b21[_0x3cb11d];return _0x3e2c4c;};'use strict';var EventEmitter=require(_0x18b2('0x0'));var ChatInteraction=require(_0x18b2('0x1'))['db'][_0x18b2('0x2')];var ChatMessage=require(_0x18b2('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x18b2('0x3')](0x0);var events={'afterCreate':_0x18b2('0x4'),'afterUpdate':_0x18b2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41976f){return function(_0xbdb845,_0x46aa1a,_0x3006d7){_0xbdb845[_0x18b2('0x6')]({'attributes':['id'],'raw':!![]})[_0x18b2('0x7')](function(_0x5f31d9){_0xbdb845[_0x18b2('0x8')](_0x18b2('0x9'),_0x5f31d9[_0x18b2('0xa')](function(_0x28a7d4){return{'id':_0x28a7d4['id']};}));return ChatMessage[_0x18b2('0xb')]({'where':{'ChatInteractionId':_0xbdb845['id'],'direction':'in','read':![]},'raw':!![]});})[_0x18b2('0x7')](function(_0x4f5d8f){_0xbdb845['setDataValue']('unreadMessages',_0x4f5d8f[_0x18b2('0xc')]);ChatInteractionEvents[_0x18b2('0xd')](_0x41976f+':'+_0xbdb845['id'],_0xbdb845);ChatInteractionEvents[_0x18b2('0xd')](_0x41976f,_0xbdb845);_0x3006d7(null);})[_0x18b2('0xe')](_0x3006d7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x18b2('0xf')](e,emitEvent(event));}}module[_0x18b2('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xbabf=['map','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x40a726,_0x1664ff){var _0x3bcb60=function(_0x11aadd){while(--_0x11aadd){_0x40a726['push'](_0x40a726['shift']());}};_0x3bcb60(++_0x1664ff);}(_0xbabf,0xbd));var _0xfbab=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xbabf[_0xc4001c];return _0x49f7bc;};'use strict';var EventEmitter=require(_0xfbab('0x0'));var ChatInteraction=require(_0xfbab('0x1'))['db'][_0xfbab('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xfbab('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfbab('0x4')](0x0);var events={'afterCreate':_0xfbab('0x5'),'afterUpdate':'update','afterDestroy':_0xfbab('0x6')};function emitEvent(_0x4138e7){return function(_0x5ccf8d,_0x257411,_0x4a39b4){_0x5ccf8d[_0xfbab('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x178932){_0x5ccf8d[_0xfbab('0x8')]('Users',_0x178932[_0xfbab('0x9')](function(_0x2182ce){return{'id':_0x2182ce['id']};}));return ChatMessage[_0xfbab('0xa')]({'where':{'ChatInteractionId':_0x5ccf8d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfbab('0xb')](function(_0x2226bb){_0x5ccf8d['setDataValue']('unreadMessages',_0x2226bb[_0xfbab('0xc')]);ChatInteractionEvents['emit'](_0x4138e7+':'+_0x5ccf8d['id'],_0x5ccf8d);ChatInteractionEvents[_0xfbab('0xd')](_0x4138e7,_0x5ccf8d);_0x4a39b4(null);})[_0xfbab('0xe')](_0x4a39b4(null));};}for(var e in events){if(events[_0xfbab('0xf')](e)){var event=events[e];ChatInteraction[_0xfbab('0x10')](e,emitEvent(event));}}module[_0xfbab('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 1329a12..a80d4eb 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 _0x01f2=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x23069e,_0x2cfdb4){var _0x47649c=function(_0x14df37){while(--_0x14df37){_0x23069e['push'](_0x23069e['shift']());}};_0x47649c(++_0x2cfdb4);}(_0x01f2,0x111));var _0x201f=function(_0x440496,_0x49e03b){_0x440496=_0x440496-0x0;var _0x444630=_0x01f2[_0x440496];return _0x444630;};'use strict';var _=require(_0x201f('0x0'));var util=require(_0x201f('0x1'));var logger=require('../../config/logger')(_0x201f('0x2'));var moment=require(_0x201f('0x3'));var BPromise=require(_0x201f('0x4'));var rp=require(_0x201f('0x5'));var fs=require('fs');var path=require(_0x201f('0x6'));var rimraf=require('rimraf');var config=require(_0x201f('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x201f('0x8')]=function(_0x3a1db2,_0x38546d){return _0x3a1db2[_0x201f('0x9')](_0x201f('0xa'),attributes,{'tableName':_0x201f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb5d654,_0x430c14,_0x51c774){if(_0xb5d654[_0x201f('0xc')](_0x201f('0xd'))){_0xb5d654[_0x201f('0xe')]=moment()[_0x201f('0xf')](_0x201f('0x10'));}_0x51c774(null,_0xb5d654);}},'charset':_0x201f('0x11'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x11b2=['rimraf','../../config/environment','exports','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x11b2,0x1a2));var _0x211b=function(_0x512363,_0x44048d){_0x512363=_0x512363-0x0;var _0x38d1fd=_0x11b2[_0x512363];return _0x38d1fd;};'use strict';var _=require(_0x211b('0x0'));var util=require(_0x211b('0x1'));var logger=require(_0x211b('0x2'))('api');var moment=require(_0x211b('0x3'));var BPromise=require(_0x211b('0x4'));var rp=require(_0x211b('0x5'));var fs=require('fs');var path=require(_0x211b('0x6'));var rimraf=require(_0x211b('0x7'));var config=require(_0x211b('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x211b('0x9')]=function(_0x4ca473,_0x46795f){return _0x4ca473[_0x211b('0xa')](_0x211b('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x95ea11,_0x583e18,_0x33d673){if(_0x95ea11[_0x211b('0xc')](_0x211b('0xd'))){_0x95ea11[_0x211b('0xe')]=moment()['format'](_0x211b('0xf'));}_0x33d673(null,_0x95ea11);}},'charset':_0x211b('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 47513c8..c1e1c87 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 _0x4620=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','options','raw','attributes','UpdateChatInteraction','debug','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','util','moment','randomstring'];(function(_0x21a268,_0x57219b){var _0x573dfb=function(_0x36372b){while(--_0x36372b){_0x21a268['push'](_0x21a268['shift']());}};_0x573dfb(++_0x57219b);}(_0x4620,0x78));var _0x0462=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x4620[_0x11ca63];return _0x41f1f6;};'use strict';var _=require('lodash');var util=require(_0x0462('0x0'));var moment=require(_0x0462('0x1'));var BPromise=require('bluebird');var rs=require(_0x0462('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0462('0x3'))['db'];var utils=require(_0x0462('0x4'));var logger=require(_0x0462('0x5'))(_0x0462('0x6'));var config=require(_0x0462('0x7'));var jayson=require(_0x0462('0x8'));var client=jayson[_0x0462('0x9')][_0x0462('0xa')]({'port':0x232a});config[_0x0462('0xb')]=_[_0x0462('0xc')](config[_0x0462('0xb')],{'host':_0x0462('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0462('0xe'))['register'](socket);function respondWithRpcPromise(_0x1b7a38,_0x53c6e8,_0x1138fa){return new BPromise(function(_0x1b57a5,_0xa88c21){return client[_0x0462('0xf')](_0x1b7a38,_0x1138fa)[_0x0462('0x10')](function(_0x28f95f){logger[_0x0462('0x11')](_0x0462('0x12'),_0x53c6e8,_0x0462('0x13'));logger['debug'](_0x0462('0x14'),_0x53c6e8,'request\x20sent',JSON[_0x0462('0x15')](_0x28f95f));if(_0x28f95f[_0x0462('0x16')]){if(_0x28f95f[_0x0462('0x16')][_0x0462('0x17')]===0x1f4){logger[_0x0462('0x16')](_0x0462('0x12'),_0x53c6e8,_0x28f95f['error'][_0x0462('0x18')]);return _0xa88c21(_0x28f95f[_0x0462('0x16')][_0x0462('0x18')]);}logger[_0x0462('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x53c6e8,_0x28f95f[_0x0462('0x16')][_0x0462('0x18')]);return _0x1b57a5(_0x28f95f[_0x0462('0x16')][_0x0462('0x18')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x53c6e8,'request\x20sent');_0x1b57a5(_0x28f95f[_0x0462('0x19')]['message']);}})[_0x0462('0x1a')](function(_0x4db2a1){logger[_0x0462('0x16')](_0x0462('0x12'),_0x53c6e8,_0x4db2a1);_0xa88c21(_0x4db2a1);});});}exports['UpdateChatInteraction']=function(_0x465259){var _0x4bfc39=this;return new Promise(function(_0x4a6cce,_0x278cf3){return db[_0x0462('0x1b')]['update'](_0x465259['body'],{'raw':_0x465259[_0x0462('0x1c')]?_0x465259[_0x0462('0x1c')][_0x0462('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x465259['options']?_0x465259[_0x0462('0x1c')]['where']||null:null,'attributes':_0x465259[_0x0462('0x1c')]?_0x465259['options'][_0x0462('0x1e')]||null:null,'limit':_0x465259[_0x0462('0x1c')]?_0x465259[_0x0462('0x1c')]['limit']||null:null})['then'](function(_0x4aab7c){logger[_0x0462('0x11')](_0x0462('0x1f'),_0x465259);logger[_0x0462('0x20')](_0x0462('0x1f'),_0x465259,JSON[_0x0462('0x15')](_0x4aab7c));_0x4a6cce(_0x4aab7c);})['catch'](function(_0x5ee94c){logger[_0x0462('0x16')]('UpdateChatInteraction',_0x5ee94c['message'],_0x465259);_0x278cf3(_0x4bfc39[_0x0462('0x16')](0x1f4,_0x5ee94c['message']));});});};exports[_0x0462('0x21')]=function(_0x1ad819){return new Promise(function(_0x5e640a,_0x3cab5a){return db[_0x0462('0x1b')][_0x0462('0x22')]({'where':_0x1ad819[_0x0462('0x1c')]?_0x1ad819[_0x0462('0x1c')][_0x0462('0x23')]||null:null})['then'](function(_0x276305){if(_0x276305){return _0x276305[_0x0462('0x24')](_0x1ad819['body'][_0x0462('0x25')],_[_0x0462('0x26')](_0x1ad819['body'],[_0x0462('0x25'),'id'])||{});}})[_0x0462('0x27')](function(_0x446eb0){logger[_0x0462('0x11')](_0x0462('0x28'),_0x1ad819);logger[_0x0462('0x20')]('AddTags',_0x1ad819,JSON[_0x0462('0x15')](_0x446eb0));_0x5e640a(_0x446eb0);})[_0x0462('0x1a')](function(_0x178db6){logger[_0x0462('0x16')]('AddTags',_0x178db6[_0x0462('0x18')],_0x1ad819);_0x3cab5a(_this[_0x0462('0x16')](0x1f4,_0x178db6[_0x0462('0x18')]));});});};
\ No newline at end of file
+var _0xebce=['register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','attributes','limit','AddTagsToChatInteraction','find','where','body','omit','ids','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x49c481,_0x1f5ec5){var _0x58e5d3=function(_0x5f090d){while(--_0x5f090d){_0x49c481['push'](_0x49c481['shift']());}};_0x58e5d3(++_0x1f5ec5);}(_0xebce,0x118));var _0xeebc=function(_0x4a77e4,_0x556f71){_0x4a77e4=_0x4a77e4-0x0;var _0x1c68d8=_0xebce[_0x4a77e4];return _0x1c68d8;};'use strict';var _=require('lodash');var util=require(_0xeebc('0x0'));var moment=require(_0xeebc('0x1'));var BPromise=require(_0xeebc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeebc('0x3'));var db=require(_0xeebc('0x4'))['db'];var utils=require(_0xeebc('0x5'));var logger=require(_0xeebc('0x6'))('rpc');var config=require(_0xeebc('0x7'));var jayson=require(_0xeebc('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xeebc('0x9')]=_[_0xeebc('0xa')](config['redis'],{'host':_0xeebc('0xb'),'port':0x18eb});var socket=require(_0xeebc('0xc'))(new Redis(config[_0xeebc('0x9')]));require(_0xeebc('0xd'))[_0xeebc('0xe')](socket);function respondWithRpcPromise(_0x49286d,_0x3e8cfa,_0x4f22aa){return new BPromise(function(_0x52bd87,_0x56a0be){return client[_0xeebc('0xf')](_0x49286d,_0x4f22aa)[_0xeebc('0x10')](function(_0x20cf3c){logger[_0xeebc('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x3e8cfa,_0xeebc('0x12'));logger[_0xeebc('0x13')](_0xeebc('0x14'),_0x3e8cfa,_0xeebc('0x12'),JSON[_0xeebc('0x15')](_0x20cf3c));if(_0x20cf3c[_0xeebc('0x16')]){if(_0x20cf3c['error'][_0xeebc('0x17')]===0x1f4){logger[_0xeebc('0x16')](_0xeebc('0x18'),_0x3e8cfa,_0x20cf3c[_0xeebc('0x16')][_0xeebc('0x19')]);return _0x56a0be(_0x20cf3c[_0xeebc('0x16')]['message']);}logger['error'](_0xeebc('0x18'),_0x3e8cfa,_0x20cf3c[_0xeebc('0x16')][_0xeebc('0x19')]);return _0x52bd87(_0x20cf3c[_0xeebc('0x16')]['message']);}else{logger[_0xeebc('0x11')](_0xeebc('0x18'),_0x3e8cfa,_0xeebc('0x12'));_0x52bd87(_0x20cf3c[_0xeebc('0x1a')]['message']);}})[_0xeebc('0x1b')](function(_0x232845){logger[_0xeebc('0x16')](_0xeebc('0x18'),_0x3e8cfa,_0x232845);_0x56a0be(_0x232845);});});}exports[_0xeebc('0x1c')]=function(_0x428830){var _0x385395=this;return new Promise(function(_0x3c702f,_0x2c1acc){return db[_0xeebc('0x1d')][_0xeebc('0x1e')](_0x428830['body'],{'raw':_0x428830[_0xeebc('0x1f')]?_0x428830['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x428830[_0xeebc('0x1f')]?_0x428830['options']['where']||null:null,'attributes':_0x428830['options']?_0x428830['options'][_0xeebc('0x20')]||null:null,'limit':_0x428830[_0xeebc('0x1f')]?_0x428830[_0xeebc('0x1f')][_0xeebc('0x21')]||null:null})[_0xeebc('0x10')](function(_0x5ed569){logger[_0xeebc('0x11')](_0xeebc('0x1c'),_0x428830);logger['debug'](_0xeebc('0x1c'),_0x428830,JSON['stringify'](_0x5ed569));_0x3c702f(_0x5ed569);})[_0xeebc('0x1b')](function(_0x41c2b3){logger['error'](_0xeebc('0x1c'),_0x41c2b3[_0xeebc('0x19')],_0x428830);_0x2c1acc(_0x385395[_0xeebc('0x16')](0x1f4,_0x41c2b3[_0xeebc('0x19')]));});});};exports[_0xeebc('0x22')]=function(_0x37600c){return new Promise(function(_0x4f231c,_0x162244){return db[_0xeebc('0x1d')][_0xeebc('0x23')]({'where':_0x37600c[_0xeebc('0x1f')]?_0x37600c[_0xeebc('0x1f')][_0xeebc('0x24')]||null:null})[_0xeebc('0x10')](function(_0xa687fb){if(_0xa687fb){return _0xa687fb['addTags'](_0x37600c[_0xeebc('0x25')]['ids'],_[_0xeebc('0x26')](_0x37600c['body'],[_0xeebc('0x27'),'id'])||{});}})[_0xeebc('0x28')](function(_0xb1ad6b){logger[_0xeebc('0x11')]('AddTags',_0x37600c);logger['debug'](_0xeebc('0x29'),_0x37600c,JSON['stringify'](_0xb1ad6b));_0x4f231c(_0xb1ad6b);})[_0xeebc('0x1b')](function(_0x3850eb){logger['error'](_0xeebc('0x29'),_0x3850eb[_0xeebc('0x19')],_0x37600c);_0x162244(_this[_0xeebc('0x16')](0x1f4,_0x3850eb[_0xeebc('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 47c2df6..d782db7 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 _0xfb31=['save','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x1a1e44,_0x502559){var _0x1caa60=function(_0x196636){while(--_0x196636){_0x1a1e44['push'](_0x1a1e44['shift']());}};_0x1caa60(++_0x502559);}(_0xfb31,0x14f));var _0x1fb3=function(_0x44707a,_0x561498){_0x44707a=_0x44707a-0x0;var _0x1084b7=_0xfb31[_0x44707a];return _0x1084b7;};'use strict';var ChatInteractionEvents=require(_0x1fb3('0x0'));var events=[_0x1fb3('0x1'),'remove',_0x1fb3('0x2')];function createListener(_0x25290f,_0x20d0d6){return function(_0x1e71bf){_0x20d0d6[_0x1fb3('0x3')](_0x25290f,_0x1e71bf);};}function removeListener(_0xb17f0b,_0x4913a9){return function(){ChatInteractionEvents[_0x1fb3('0x4')](_0xb17f0b,_0x4913a9);};}exports[_0x1fb3('0x5')]=function(_0x5ce233){for(var _0x463c60=0x0,_0x16fbfb=events[_0x1fb3('0x6')];_0x463c60<_0x16fbfb;_0x463c60++){var _0x4cd848=events[_0x463c60];var _0x2e0c82=createListener(_0x1fb3('0x7')+_0x4cd848,_0x5ce233);ChatInteractionEvents['on'](_0x4cd848,_0x2e0c82);}};
\ No newline at end of file
+var _0x0f9b=['remove','update','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x4183ea,_0xeb7bb3){var _0x3873e4=function(_0x40efd6){while(--_0x40efd6){_0x4183ea['push'](_0x4183ea['shift']());}};_0x3873e4(++_0xeb7bb3);}(_0x0f9b,0xd7));var _0xb0f9=function(_0x328b7a,_0x20d32c){_0x328b7a=_0x328b7a-0x0;var _0x22e45a=_0x0f9b[_0x328b7a];return _0x22e45a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xb0f9('0x0'),_0xb0f9('0x1'),_0xb0f9('0x2')];function createListener(_0xd0ae53,_0x3ba07b){return function(_0x17d3f3){_0x3ba07b[_0xb0f9('0x3')](_0xd0ae53,_0x17d3f3);};}function removeListener(_0x5e5ebf,_0x16dd2){return function(){ChatInteractionEvents[_0xb0f9('0x4')](_0x5e5ebf,_0x16dd2);};}exports[_0xb0f9('0x5')]=function(_0x59efb3){for(var _0x1cdacb=0x0,_0x2dc803=events[_0xb0f9('0x6')];_0x1cdacb<_0x2dc803;_0x1cdacb++){var _0x58739e=events[_0x1cdacb];var _0x3ab299=createListener(_0xb0f9('0x7')+_0x58739e,_0x59efb3);ChatInteractionEvents['on'](_0x58739e,_0x3ab299);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index bff4d68..7de1e72 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 _0x15b6=['createVidaooSession','join','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo'];(function(_0x506e4e,_0x1e893b){var _0x23719c=function(_0x33e3c0){while(--_0x33e3c0){_0x506e4e['push'](_0x506e4e['shift']());}};_0x23719c(++_0x1e893b);}(_0x15b6,0x119));var _0x615b=function(_0xfb6a2b,_0x2626b8){_0xfb6a2b=_0xfb6a2b-0x0;var _0x27902f=_0x15b6[_0xfb6a2b];return _0x27902f;};'use strict';var multer=require(_0x615b('0x0'));var util=require(_0x615b('0x1'));var path=require(_0x615b('0x2'));var timeout=require(_0x615b('0x3'));var express=require(_0x615b('0x4'));var router=express['Router']();var fs_extra=require(_0x615b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x615b('0x6'));var config=require(_0x615b('0x7'));var controller=require(_0x615b('0x8'));router['get']('/',auth[_0x615b('0x9')](),controller[_0x615b('0xa')]);router[_0x615b('0xb')](_0x615b('0xc'),auth[_0x615b('0x9')](),controller[_0x615b('0xd')]);router[_0x615b('0xb')](_0x615b('0xe'),auth[_0x615b('0xf')](),controller[_0x615b('0x10')]);router[_0x615b('0xb')](_0x615b('0x11'),auth[_0x615b('0xf')](),controller['attachmentDownload']);router[_0x615b('0xb')](_0x615b('0x12'),auth[_0x615b('0x9')](),controller['getMessages']);router[_0x615b('0xb')]('/:id/my_messages',auth[_0x615b('0xf')](),controller[_0x615b('0x13')]);router['get'](_0x615b('0x14'),auth[_0x615b('0x9')](),controller[_0x615b('0x15')]);router['post']('/',auth[_0x615b('0x9')](),controller[_0x615b('0x16')]);router[_0x615b('0x17')](_0x615b('0x18'),auth['isAuthenticated'](),controller[_0x615b('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5659db,_0x170ae9,_0x9b4301){_0x9b4301(null,path[_0x615b('0x1a')](config['root'],_0x615b('0x1b')));},'filename':function(_0xe4bf91,_0x512733,_0x237844){_0x237844(null,util[_0x615b('0x1c')]('%s-%s',Date['now'](),_0x512733[_0x615b('0x1d')][_0x615b('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x615b('0x17')](_0x615b('0x1f'),upload['single']('file'),controller[_0x615b('0x20')]);router[_0x615b('0x17')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x615b('0x21')]);router['post'](_0x615b('0x22'),auth[_0x615b('0x9')](),interaction[_0x615b('0x23')](_0x615b('0x24'),_0x615b('0x25')),controller[_0x615b('0x26')]);router[_0x615b('0x27')](_0x615b('0xe'),auth[_0x615b('0x9')](),interaction[_0x615b('0x23')]('chat',_0x615b('0x28')),controller['update']);router[_0x615b('0x27')](_0x615b('0x29'),controller[_0x615b('0x2a')]);router[_0x615b('0x27')](_0x615b('0x2b'),auth[_0x615b('0xf')](),controller[_0x615b('0x2c')]);router[_0x615b('0x27')](_0x615b('0x2d'),controller[_0x615b('0x2e')]);router[_0x615b('0x2f')](_0x615b('0xe'),auth['isAuthenticated'](),interaction[_0x615b('0x23')](_0x615b('0x24'),_0x615b('0x30')),controller[_0x615b('0x31')]);router['delete'](_0x615b('0x22'),auth['isAuthenticated'](),controller[_0x615b('0x32')]);module['exports']=router;
\ No newline at end of file
+var _0x942d=['file','attachmentUpload','addMessage','chat','chatinteraction:addtags','put','tracked','chatinteraction:update','update','/:id/custom_update','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','download','post','create','/:id/vidaoo','diskStorage','join','root','format','now','originalname','replace','/:id/attachment_upload','single'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x942d,0xe2));var _0xd942=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x942d[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xd942('0x0'));var util=require(_0xd942('0x1'));var path=require('path');var timeout=require(_0xd942('0x2'));var express=require(_0xd942('0x3'));var router=express[_0xd942('0x4')]();var fs_extra=require(_0xd942('0x5'));var auth=require(_0xd942('0x6'));var interaction=require(_0xd942('0x7'));var config=require(_0xd942('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xd942('0x9')](),controller[_0xd942('0xa')]);router[_0xd942('0xb')](_0xd942('0xc'),auth[_0xd942('0x9')](),controller[_0xd942('0xd')]);router['get'](_0xd942('0xe'),auth[_0xd942('0xf')](),controller[_0xd942('0x10')]);router[_0xd942('0xb')](_0xd942('0x11'),auth[_0xd942('0xf')](),controller[_0xd942('0x12')]);router[_0xd942('0xb')](_0xd942('0x13'),auth[_0xd942('0x9')](),controller['getMessages']);router[_0xd942('0xb')]('/:id/my_messages',auth[_0xd942('0xf')](),controller[_0xd942('0x14')]);router[_0xd942('0xb')]('/:id/download',auth[_0xd942('0x9')](),controller[_0xd942('0x15')]);router[_0xd942('0x16')]('/',auth[_0xd942('0x9')](),controller[_0xd942('0x17')]);router['post'](_0xd942('0x18'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd942('0x19')]({'destination':function(_0x17c6b4,_0x1f7d59,_0x3de292){_0x3de292(null,path[_0xd942('0x1a')](config[_0xd942('0x1b')],'server/files/attachments/'));},'filename':function(_0x22f6f1,_0x5a5612,_0xf423b9){_0xf423b9(null,util[_0xd942('0x1c')]('%s-%s',Date[_0xd942('0x1d')](),_0x5a5612[_0xd942('0x1e')][_0xd942('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd942('0x16')](_0xd942('0x20'),upload[_0xd942('0x21')](_0xd942('0x22')),controller[_0xd942('0x23')]);router[_0xd942('0x16')]('/:id/messages',auth[_0xd942('0xf')](),controller[_0xd942('0x24')]);router[_0xd942('0x16')]('/:id/tags',auth[_0xd942('0x9')](),interaction['tracked'](_0xd942('0x25'),_0xd942('0x26')),controller['addTags']);router[_0xd942('0x27')](_0xd942('0xe'),auth[_0xd942('0x9')](),interaction[_0xd942('0x28')](_0xd942('0x25'),_0xd942('0x29')),controller[_0xd942('0x2a')]);router[_0xd942('0x27')](_0xd942('0x2b'),controller['customUpdate']);router[_0xd942('0x27')]('/:id/abandon',auth[_0xd942('0xf')](),controller[_0xd942('0x2c')]);router[_0xd942('0x27')](_0xd942('0x2d'),controller[_0xd942('0x2e')]);router[_0xd942('0x2f')](_0xd942('0xe'),auth[_0xd942('0x9')](),interaction['tracked'](_0xd942('0x25'),_0xd942('0x30')),controller[_0xd942('0x31')]);router[_0xd942('0x2f')](_0xd942('0x32'),auth[_0xd942('0x9')](),controller['removeTags']);module[_0xd942('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 5be6ff8..7200730 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 _0x8adb=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x4f8f23,_0x1178e8){var _0x251c3a=function(_0x5dffd4){while(--_0x5dffd4){_0x4f8f23['push'](_0x4f8f23['shift']());}};_0x251c3a(++_0x1178e8);}(_0x8adb,0xe7));var _0xb8ad=function(_0x24383a,_0x298ec7){_0x24383a=_0x24383a-0x0;var _0x2a713f=_0x8adb[_0x24383a];return _0x2a713f;};'use strict';var Sequelize=require(_0xb8ad('0x0'));module[_0xb8ad('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb8ad('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb8ad('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb8ad('0x4')]}};
\ No newline at end of file
+var _0x6121=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x4a2183,_0x53e74d){var _0xc7c01d=function(_0x526d67){while(--_0x526d67){_0x4a2183['push'](_0x4a2183['shift']());}};_0xc7c01d(++_0x53e74d);}(_0x6121,0x1b5));var _0x1612=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6121[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x1612('0x0'));module[_0x1612('0x1')]={'body':{'type':Sequelize[_0x1612('0x2')](_0x1612('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1612('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1612('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 2efc775..a59c331 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 _0x7a8b=['hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','ChatInternalMessage','then','include','findAll','catch','show','rawAttributes','options','find','create','params','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','fullname','role','userpic','internal','online','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','update','error','stack','name','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a8b,0x1d5));var _0xb7a8=function(_0xf70963,_0x5b55fa){_0xf70963=_0xf70963-0x0;var _0x5eac14=_0x7a8b[_0xf70963];return _0x5eac14;};'use strict';var emlformat=require(_0xb7a8('0x0'));var rimraf=require(_0xb7a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7a8('0x2'));var rp=require(_0xb7a8('0x3'));var moment=require(_0xb7a8('0x4'));var BPromise=require(_0xb7a8('0x5'));var Mustache=require(_0xb7a8('0x6'));var util=require(_0xb7a8('0x7'));var path=require(_0xb7a8('0x8'));var sox=require(_0xb7a8('0x9'));var csv=require(_0xb7a8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7a8('0xb'));var _=require('lodash');var squel=require(_0xb7a8('0xc'));var crypto=require('crypto');var jsforce=require(_0xb7a8('0xd'));var deskjs=require(_0xb7a8('0xe'));var toCsv=require(_0xb7a8('0xa'));var querystring=require(_0xb7a8('0xf'));var Papa=require('papaparse');var Redis=require(_0xb7a8('0x10'));var authService=require(_0xb7a8('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7a8('0x12'));var logger=require(_0xb7a8('0x13'))('api');var utils=require(_0xb7a8('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb7a8('0x15'))['db'];config[_0xb7a8('0x16')]=_[_0xb7a8('0x17')](config[_0xb7a8('0x16')],{'host':_0xb7a8('0x18'),'port':0x18eb});var socket=require(_0xb7a8('0x19'))(new Redis(config[_0xb7a8('0x16')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x185f84,_0x20ccad){_0x20ccad=_0x20ccad||0xcc;return function(_0x3f89cc){if(_0x3f89cc){return _0x185f84[_0xb7a8('0x1a')](_0x20ccad);}return _0x185f84[_0xb7a8('0x1b')](_0x20ccad)['end']();};}function respondWithResult(_0x2eb927,_0x3abfee){_0x3abfee=_0x3abfee||0xc8;return function(_0x49458c){if(_0x49458c){return _0x2eb927[_0xb7a8('0x1b')](_0x3abfee)['json'](_0x49458c);}};}function respondWithFilteredResult(_0x142d56,_0x586fe1){return function(_0x1a6420){if(_0x1a6420){var _0x62657e=typeof _0x586fe1['offset']===_0xb7a8('0x1c')&&typeof _0x586fe1[_0xb7a8('0x1d')]===_0xb7a8('0x1c');var _0x4b993f=_0x1a6420[_0xb7a8('0x1e')];var _0xa2e189=_0x62657e?0x0:_0x586fe1[_0xb7a8('0x1f')];var _0xcb9fb5=_0x62657e?_0x1a6420[_0xb7a8('0x1e')]:_0x586fe1[_0xb7a8('0x1f')]+_0x586fe1[_0xb7a8('0x1d')];var _0xc6a3c4;if(_0xcb9fb5>=_0x4b993f){_0xcb9fb5=_0x4b993f;_0xc6a3c4=0xc8;}else{_0xc6a3c4=0xce;}_0x142d56['status'](_0xc6a3c4);return _0x142d56[_0xb7a8('0x20')](_0xb7a8('0x21'),_0xa2e189+'-'+_0xcb9fb5+'/'+_0x4b993f)[_0xb7a8('0x22')](_0x1a6420);}return null;};}function patchUpdates(_0x101af0){return function(_0x248a7f){try{jsonpatch[_0xb7a8('0x23')](_0x248a7f,_0x101af0,!![]);}catch(_0x4ab709){return BPromise['reject'](_0x4ab709);}return _0x248a7f['save']();};}function saveUpdates(_0x4cfd87,_0x43e3de){return function(_0x5bd236){if(_0x5bd236){return _0x5bd236[_0xb7a8('0x24')](_0x4cfd87)['then'](function(_0x46ba0f){return _0x46ba0f;});}return null;};}function removeEntity(_0x461257,_0x5b08f2){return function(_0x3e298f){if(_0x3e298f){return _0x3e298f['destroy']()['then'](function(){_0x461257[_0xb7a8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5acef9,_0xe684a9){return function(_0x48d16d){if(!_0x48d16d){_0x5acef9[_0xb7a8('0x1a')](0x194);}return _0x48d16d;};}function handleError(_0x52ee87,_0x5d574c){_0x5d574c=_0x5d574c||0x1f4;return function(_0x18d167){logger[_0xb7a8('0x25')](_0x18d167[_0xb7a8('0x26')]);if(_0x18d167['name']){delete _0x18d167[_0xb7a8('0x27')];}_0x52ee87[_0xb7a8('0x1b')](_0x5d574c)['send'](_0x18d167);};}exports['index']=function(_0x1b668c,_0x382b88){var _0x47748a={},_0x3bcb4c={},_0x220c88={'count':0x0,'rows':[]};var _0xc344e=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x3daf49){return{'name':_0x3daf49[_0xb7a8('0x28')],'type':_0x3daf49[_0xb7a8('0x29')][_0xb7a8('0x2a')]};});_0x3bcb4c[_0xb7a8('0x2b')]=_[_0xb7a8('0x2c')](_0xc344e,_0xb7a8('0x27'));_0x3bcb4c[_0xb7a8('0x2d')]=_[_0xb7a8('0x2e')](_0x1b668c[_0xb7a8('0x2d')]);_0x3bcb4c['filters']=_['intersection'](_0x3bcb4c['model'],_0x3bcb4c[_0xb7a8('0x2d')]);_0x47748a[_0xb7a8('0x2f')]=_[_0xb7a8('0x30')](_0x3bcb4c[_0xb7a8('0x2b')],qs[_0xb7a8('0x31')](_0x1b668c[_0xb7a8('0x2d')][_0xb7a8('0x31')]));_0x47748a[_0xb7a8('0x2f')]=_0x47748a[_0xb7a8('0x2f')][_0xb7a8('0x32')]?_0x47748a['attributes']:_0x3bcb4c[_0xb7a8('0x2b')];if(!_0x1b668c[_0xb7a8('0x2d')][_0xb7a8('0x33')](_0xb7a8('0x34'))){_0x47748a[_0xb7a8('0x1d')]=qs[_0xb7a8('0x1d')](_0x1b668c['query'][_0xb7a8('0x1d')]);_0x47748a['offset']=qs[_0xb7a8('0x1f')](_0x1b668c[_0xb7a8('0x2d')][_0xb7a8('0x1f')]);}_0x47748a['order']=qs[_0xb7a8('0x35')](_0x1b668c['query'][_0xb7a8('0x35')]);_0x47748a[_0xb7a8('0x36')]=qs[_0xb7a8('0x37')](_[_0xb7a8('0x38')](_0x1b668c[_0xb7a8('0x2d')],_0x3bcb4c[_0xb7a8('0x37')]),_0xc344e);if(_0x1b668c[_0xb7a8('0x2d')][_0xb7a8('0x39')]){_0x47748a[_0xb7a8('0x36')]=_[_0xb7a8('0x3a')](_0x47748a['where'],{'$or':_[_0xb7a8('0x2c')](_0xc344e,function(_0x35dc87){if(_0x35dc87[_0xb7a8('0x29')]!==_0xb7a8('0x3b')){var _0x2ced68={};_0x2ced68[_0x35dc87[_0xb7a8('0x27')]]={'$like':'%'+_0x1b668c[_0xb7a8('0x2d')][_0xb7a8('0x39')]+'%'};return _0x2ced68;}})});}_0x47748a=_[_0xb7a8('0x3a')]({},_0x47748a,_0x1b668c['options']);var _0x39cbb4={'where':_0x47748a[_0xb7a8('0x36')]};return db[_0xb7a8('0x3c')][_0xb7a8('0x1e')](_0x39cbb4)[_0xb7a8('0x3d')](function(_0x58503d){_0x220c88['count']=_0x58503d;if(_0x1b668c[_0xb7a8('0x2d')]['includeAll']){_0x47748a[_0xb7a8('0x3e')]=[{'all':!![]}];}return db[_0xb7a8('0x3c')][_0xb7a8('0x3f')](_0x47748a);})[_0xb7a8('0x3d')](function(_0x189a9e){_0x220c88['rows']=_0x189a9e;return _0x220c88;})['then'](respondWithFilteredResult(_0x382b88,_0x47748a))[_0xb7a8('0x40')](handleError(_0x382b88,null));};exports[_0xb7a8('0x41')]=function(_0x22d6bb,_0x5b4ffb){var _0x59b9e1={'raw':!![],'where':{'id':_0x22d6bb['params']['id']}},_0x8ab1b0={};_0x8ab1b0[_0xb7a8('0x2b')]=_[_0xb7a8('0x2e')](db[_0xb7a8('0x3c')][_0xb7a8('0x42')]);_0x8ab1b0[_0xb7a8('0x2d')]=_[_0xb7a8('0x2e')](_0x22d6bb[_0xb7a8('0x2d')]);_0x8ab1b0[_0xb7a8('0x37')]=_[_0xb7a8('0x30')](_0x8ab1b0[_0xb7a8('0x2b')],_0x8ab1b0[_0xb7a8('0x2d')]);_0x59b9e1[_0xb7a8('0x2f')]=_[_0xb7a8('0x30')](_0x8ab1b0[_0xb7a8('0x2b')],qs['fields'](_0x22d6bb[_0xb7a8('0x2d')][_0xb7a8('0x31')]));_0x59b9e1['attributes']=_0x59b9e1[_0xb7a8('0x2f')][_0xb7a8('0x32')]?_0x59b9e1[_0xb7a8('0x2f')]:_0x8ab1b0[_0xb7a8('0x2b')];if(_0x22d6bb[_0xb7a8('0x2d')]['includeAll']){_0x59b9e1[_0xb7a8('0x3e')]=[{'all':!![]}];}_0x59b9e1=_[_0xb7a8('0x3a')]({},_0x59b9e1,_0x22d6bb[_0xb7a8('0x43')]);return db[_0xb7a8('0x3c')][_0xb7a8('0x44')](_0x59b9e1)[_0xb7a8('0x3d')](handleEntityNotFound(_0x5b4ffb,null))[_0xb7a8('0x3d')](respondWithResult(_0x5b4ffb,null))['catch'](handleError(_0x5b4ffb,null));};exports['create']=function(_0x5325be,_0xa99f28){return db[_0xb7a8('0x3c')][_0xb7a8('0x45')](_0x5325be['body'],{})[_0xb7a8('0x3d')](respondWithResult(_0xa99f28,0xc9))[_0xb7a8('0x40')](handleError(_0xa99f28,null));};exports[_0xb7a8('0x24')]=function(_0x564c67,_0x971620){if(_0x564c67['body']['id']){delete _0x564c67['body']['id'];}return db['ChatInternalMessage'][_0xb7a8('0x44')]({'where':{'id':_0x564c67[_0xb7a8('0x46')]['id']}})[_0xb7a8('0x3d')](handleEntityNotFound(_0x971620,null))[_0xb7a8('0x3d')](saveUpdates(_0x564c67[_0xb7a8('0x47')],null))[_0xb7a8('0x3d')](respondWithResult(_0x971620,null))['catch'](handleError(_0x971620,null));};exports[_0xb7a8('0x48')]=function(_0x45176c,_0x36820b){return db[_0xb7a8('0x3c')]['find']({'where':{'id':_0x45176c[_0xb7a8('0x46')]['id']}})[_0xb7a8('0x3d')](handleEntityNotFound(_0x36820b,null))[_0xb7a8('0x3d')](removeEntity(_0x36820b,null))[_0xb7a8('0x40')](handleError(_0x36820b,null));};exports[_0xb7a8('0x49')]=function(_0x158e47,_0x1e6da7){return db[_0xb7a8('0x3c')]['describe']()[_0xb7a8('0x3d')](respondWithResult(_0x1e6da7,null))[_0xb7a8('0x40')](handleError(_0x1e6da7,null));};function wrapUser(_0x13962e){return function(_0x4a86d1){var _0xcb37e0=_0x13962e[_0xb7a8('0x4a')]({'plain':!![]});_0xcb37e0[_0xb7a8('0x4b')]=[];if(_0x4a86d1){_0xcb37e0[_0xb7a8('0x4c')]=_0x4a86d1[_0xb7a8('0x4d')];_0xcb37e0[_0xb7a8('0x4e')]=_0x4a86d1;}else{_0xcb37e0[_0xb7a8('0x4c')]=moment(0x0)[_0xb7a8('0x4f')](_0xb7a8('0x50'));_0xcb37e0[_0xb7a8('0x4e')]={};}return _0xcb37e0;};}exports['getUsers']=function(_0x1d4b7c,_0x3bee70,_0x8ee3e5){var _0x5b1c54=[];return db[_0xb7a8('0x51')][_0xb7a8('0x3f')]({'where':{'role':[_0xb7a8('0x52'),_0xb7a8('0x53'),'user']},'attributes':['id',_0xb7a8('0x54'),'name',_0xb7a8('0x55'),_0xb7a8('0x56'),_0xb7a8('0x57'),_0xb7a8('0x58'),'lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0xb7a8('0x35')](_0xb7a8('0x59')),'include':[{'model':db[_0xb7a8('0x5a')],'as':_0xb7a8('0x5b'),'attributes':['id',_0xb7a8('0x27'),_0xb7a8('0x29')],'through':{'attributes':[]}}]})['then'](function(_0x42746d){if(_0x42746d){var _0x569531=_0x1d4b7c['user'][_0xb7a8('0x4a')]({'plain':!![]});if(!_0x569531)throw new Error(_0xb7a8('0x5c'));if(_0x569531[_0xb7a8('0x55')]===_0xb7a8('0x5d')){return db[_0xb7a8('0x5e')][_0xb7a8('0x44')]({'where':{'name':_0xb7a8('0x5f'),'userProfileId':_0x569531[_0xb7a8('0x60')]},'raw':!![]})[_0xb7a8('0x3d')](function(_0x420eb6){if(_0x420eb6){if(_0x420eb6[_0xb7a8('0x61')]===0x0){return db[_0xb7a8('0x62')]['findAll']({'where':{'sectionId':_0x420eb6['id']},'raw':!![]})['then'](function(_0x4e7183){var _0x190122=[];if(_[_0xb7a8('0x63')](_0x4e7183)){_0x190122=_[_0xb7a8('0x39')](_0x42746d,function(_0x97322){if(_0x97322[_0xb7a8('0x55')]!==_0xb7a8('0x52')){return _0x97322;}});return _0x190122;}else{for(var _0x491ea3=0x0;_0x491ea3<_0x42746d[_0xb7a8('0x32')];_0x491ea3++){var _0x541747=_0x42746d[_0x491ea3];if(_0x541747[_0xb7a8('0x55')]===_0xb7a8('0x52')){var _0x2b3ce5=_[_0xb7a8('0x44')](_0x4e7183,function(_0x179401){return _0x179401['resourceId']===_0x541747['id'];});if(_0x2b3ce5)_0x190122['push'](_0x541747);}else{_0x190122[_0xb7a8('0x64')](_0x541747);}}return _0x190122;}});}else{return _0x42746d;}}else{var _0x46928f=_['filter'](_0x42746d,function(_0x207621){if(_0x207621['role']!==_0xb7a8('0x52')){return _0x207621;}});return _0x46928f;}});}else{return _0x42746d;}}})[_0xb7a8('0x3d')](function(_0x344c9e){var _0x4ce92f=[];if(_0x344c9e){_0x5b1c54=_0x344c9e;for(var _0x101aed=0x0;_0x101aed<_0x344c9e['length'];_0x101aed+=0x1){_0x5b1c54[_0x101aed][_0xb7a8('0x4b')]=[];_0x4ce92f[_0xb7a8('0x64')](db['ChatInternalMessage'][_0xb7a8('0x44')]({'where':{'FromId':[_0x1d4b7c[_0xb7a8('0x5d')]['id'],_0x344c9e[_0x101aed]['id']],'ToId':[_0x1d4b7c['user']['id'],_0x344c9e[_0x101aed]['id']],'ChatGroupId':null},'attributes':['id',_0xb7a8('0x4d'),_0xb7a8('0x65'),_0xb7a8('0x66'),_0xb7a8('0x67'),_0xb7a8('0x47')],'order':qs[_0xb7a8('0x35')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb7a8('0x3d')](wrapUser(_0x344c9e[_0x101aed])));}return BPromise['all'](_0x4ce92f);}return[];})[_0xb7a8('0x3d')](function(_0x1edcc6){return{'rows':_0x1edcc6,'count':_0x1edcc6['length']};})[_0xb7a8('0x3d')](respondWithResult(_0x3bee70,null))[_0xb7a8('0x40')](handleError(_0x3bee70,null));};
\ No newline at end of file
+var _0x9708=['format','getUsers','agent','admin','user','fullname','lastLoginAt','allowmessenger','showWebBar','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','isEmpty','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','name','send','index','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','map','type','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','describe','messages','createdAt','lastMessageAt'];(function(_0x416bb4,_0x3e9428){var _0x27ddf6=function(_0x41eb9f){while(--_0x41eb9f){_0x416bb4['push'](_0x416bb4['shift']());}};_0x27ddf6(++_0x3e9428);}(_0x9708,0x14d));var _0x8970=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0x9708[_0x100682];return _0xcb6e87;};'use strict';var emlformat=require(_0x8970('0x0'));var rimraf=require(_0x8970('0x1'));var zipdir=require(_0x8970('0x2'));var jsonpatch=require(_0x8970('0x3'));var rp=require(_0x8970('0x4'));var moment=require(_0x8970('0x5'));var BPromise=require(_0x8970('0x6'));var Mustache=require(_0x8970('0x7'));var util=require(_0x8970('0x8'));var path=require('path');var sox=require(_0x8970('0x9'));var csv=require(_0x8970('0xa'));var ejs=require(_0x8970('0xb'));var fs=require('fs');var fs_extra=require(_0x8970('0xc'));var _=require(_0x8970('0xd'));var squel=require(_0x8970('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8970('0xf'));var toCsv=require(_0x8970('0xa'));var querystring=require(_0x8970('0x10'));var Papa=require(_0x8970('0x11'));var Redis=require(_0x8970('0x12'));var authService=require(_0x8970('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8970('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8970('0x15'))(_0x8970('0x16'));var utils=require(_0x8970('0x17'));var config=require(_0x8970('0x18'));var licenseUtil=require(_0x8970('0x19'));var db=require(_0x8970('0x1a'))['db'];config[_0x8970('0x1b')]=_[_0x8970('0x1c')](config['redis'],{'host':_0x8970('0x1d'),'port':0x18eb});var socket=require(_0x8970('0x1e'))(new Redis(config[_0x8970('0x1b')]));require(_0x8970('0x1f'))[_0x8970('0x20')](socket);function respondWithStatusCode(_0x23e152,_0x513719){_0x513719=_0x513719||0xcc;return function(_0x540981){if(_0x540981){return _0x23e152[_0x8970('0x21')](_0x513719);}return _0x23e152[_0x8970('0x22')](_0x513719)[_0x8970('0x23')]();};}function respondWithResult(_0x149fdb,_0xe74c6b){_0xe74c6b=_0xe74c6b||0xc8;return function(_0x30418f){if(_0x30418f){return _0x149fdb[_0x8970('0x22')](_0xe74c6b)['json'](_0x30418f);}};}function respondWithFilteredResult(_0x32dc12,_0x485f42){return function(_0x1abd90){if(_0x1abd90){var _0x57fc41=typeof _0x485f42[_0x8970('0x24')]===_0x8970('0x25')&&typeof _0x485f42[_0x8970('0x26')]===_0x8970('0x25');var _0x536c25=_0x1abd90[_0x8970('0x27')];var _0x2155cd=_0x57fc41?0x0:_0x485f42[_0x8970('0x24')];var _0x32871e=_0x57fc41?_0x1abd90[_0x8970('0x27')]:_0x485f42[_0x8970('0x24')]+_0x485f42['limit'];var _0x1b46fa;if(_0x32871e>=_0x536c25){_0x32871e=_0x536c25;_0x1b46fa=0xc8;}else{_0x1b46fa=0xce;}_0x32dc12[_0x8970('0x22')](_0x1b46fa);return _0x32dc12['set'](_0x8970('0x28'),_0x2155cd+'-'+_0x32871e+'/'+_0x536c25)['json'](_0x1abd90);}return null;};}function patchUpdates(_0x350d51){return function(_0x5675ea){try{jsonpatch['apply'](_0x5675ea,_0x350d51,!![]);}catch(_0x5b4cb7){return BPromise[_0x8970('0x29')](_0x5b4cb7);}return _0x5675ea[_0x8970('0x2a')]();};}function saveUpdates(_0x1f39f4,_0x361d5e){return function(_0x593a25){if(_0x593a25){return _0x593a25[_0x8970('0x2b')](_0x1f39f4)['then'](function(_0x1eaa52){return _0x1eaa52;});}return null;};}function removeEntity(_0x572f0b,_0x67ebef){return function(_0x2fd3cf){if(_0x2fd3cf){return _0x2fd3cf['destroy']()[_0x8970('0x2c')](function(){_0x572f0b[_0x8970('0x22')](0xcc)[_0x8970('0x23')]();});}};}function handleEntityNotFound(_0x3e9d6c,_0x52dd03){return function(_0x344404){if(!_0x344404){_0x3e9d6c['sendStatus'](0x194);}return _0x344404;};}function handleError(_0x1f2c09,_0x317e33){_0x317e33=_0x317e33||0x1f4;return function(_0x1fb90b){logger[_0x8970('0x2d')](_0x1fb90b['stack']);if(_0x1fb90b[_0x8970('0x2e')]){delete _0x1fb90b['name'];}_0x1f2c09[_0x8970('0x22')](_0x317e33)[_0x8970('0x2f')](_0x1fb90b);};}exports[_0x8970('0x30')]=function(_0x32aab6,_0x4b7f5a){var _0x356e53={},_0x5b17a6={},_0x4cdc63={'count':0x0,'rows':[]};var _0x5e205d=_['map'](db['ChatInternalMessage'][_0x8970('0x31')],function(_0x498076){return{'name':_0x498076[_0x8970('0x32')],'type':_0x498076['type']['key']};});_0x5b17a6[_0x8970('0x33')]=_['map'](_0x5e205d,_0x8970('0x2e'));_0x5b17a6[_0x8970('0x34')]=_[_0x8970('0x35')](_0x32aab6['query']);_0x5b17a6['filters']=_[_0x8970('0x36')](_0x5b17a6[_0x8970('0x33')],_0x5b17a6[_0x8970('0x34')]);_0x356e53['attributes']=_[_0x8970('0x36')](_0x5b17a6['model'],qs[_0x8970('0x37')](_0x32aab6[_0x8970('0x34')]['fields']));_0x356e53[_0x8970('0x38')]=_0x356e53[_0x8970('0x38')][_0x8970('0x39')]?_0x356e53[_0x8970('0x38')]:_0x5b17a6[_0x8970('0x33')];if(!_0x32aab6['query']['hasOwnProperty']('nolimit')){_0x356e53['limit']=qs[_0x8970('0x26')](_0x32aab6['query'][_0x8970('0x26')]);_0x356e53[_0x8970('0x24')]=qs[_0x8970('0x24')](_0x32aab6[_0x8970('0x34')][_0x8970('0x24')]);}_0x356e53['order']=qs[_0x8970('0x3a')](_0x32aab6[_0x8970('0x34')][_0x8970('0x3a')]);_0x356e53[_0x8970('0x3b')]=qs[_0x8970('0x3c')](_[_0x8970('0x3d')](_0x32aab6[_0x8970('0x34')],_0x5b17a6[_0x8970('0x3c')]),_0x5e205d);if(_0x32aab6[_0x8970('0x34')][_0x8970('0x3e')]){_0x356e53[_0x8970('0x3b')]=_[_0x8970('0x3f')](_0x356e53[_0x8970('0x3b')],{'$or':_[_0x8970('0x40')](_0x5e205d,function(_0x4a9683){if(_0x4a9683[_0x8970('0x41')]!=='VIRTUAL'){var _0x32f810={};_0x32f810[_0x4a9683[_0x8970('0x2e')]]={'$like':'%'+_0x32aab6[_0x8970('0x34')][_0x8970('0x3e')]+'%'};return _0x32f810;}})});}_0x356e53=_['merge']({},_0x356e53,_0x32aab6[_0x8970('0x42')]);var _0xb9c3dc={'where':_0x356e53[_0x8970('0x3b')]};return db[_0x8970('0x43')]['count'](_0xb9c3dc)[_0x8970('0x2c')](function(_0x221aa6){_0x4cdc63[_0x8970('0x27')]=_0x221aa6;if(_0x32aab6[_0x8970('0x34')][_0x8970('0x44')]){_0x356e53[_0x8970('0x45')]=[{'all':!![]}];}return db[_0x8970('0x43')][_0x8970('0x46')](_0x356e53);})[_0x8970('0x2c')](function(_0x52e475){_0x4cdc63[_0x8970('0x47')]=_0x52e475;return _0x4cdc63;})[_0x8970('0x2c')](respondWithFilteredResult(_0x4b7f5a,_0x356e53))[_0x8970('0x48')](handleError(_0x4b7f5a,null));};exports[_0x8970('0x49')]=function(_0x4b322f,_0x1a7a8a){var _0x1eb453={'raw':!![],'where':{'id':_0x4b322f['params']['id']}},_0x32874c={};_0x32874c[_0x8970('0x33')]=_[_0x8970('0x35')](db[_0x8970('0x43')]['rawAttributes']);_0x32874c[_0x8970('0x34')]=_['keys'](_0x4b322f[_0x8970('0x34')]);_0x32874c[_0x8970('0x3c')]=_[_0x8970('0x36')](_0x32874c['model'],_0x32874c['query']);_0x1eb453[_0x8970('0x38')]=_[_0x8970('0x36')](_0x32874c['model'],qs['fields'](_0x4b322f[_0x8970('0x34')][_0x8970('0x37')]));_0x1eb453[_0x8970('0x38')]=_0x1eb453[_0x8970('0x38')]['length']?_0x1eb453[_0x8970('0x38')]:_0x32874c[_0x8970('0x33')];if(_0x4b322f['query'][_0x8970('0x44')]){_0x1eb453[_0x8970('0x45')]=[{'all':!![]}];}_0x1eb453=_[_0x8970('0x3f')]({},_0x1eb453,_0x4b322f[_0x8970('0x42')]);return db[_0x8970('0x43')][_0x8970('0x4a')](_0x1eb453)[_0x8970('0x2c')](handleEntityNotFound(_0x1a7a8a,null))[_0x8970('0x2c')](respondWithResult(_0x1a7a8a,null))[_0x8970('0x48')](handleError(_0x1a7a8a,null));};exports['create']=function(_0x3a155b,_0x4e028a){return db[_0x8970('0x43')][_0x8970('0x4b')](_0x3a155b[_0x8970('0x4c')],{})[_0x8970('0x2c')](respondWithResult(_0x4e028a,0xc9))[_0x8970('0x48')](handleError(_0x4e028a,null));};exports[_0x8970('0x2b')]=function(_0x370633,_0x35e5a0){if(_0x370633[_0x8970('0x4c')]['id']){delete _0x370633[_0x8970('0x4c')]['id'];}return db['ChatInternalMessage'][_0x8970('0x4a')]({'where':{'id':_0x370633['params']['id']}})[_0x8970('0x2c')](handleEntityNotFound(_0x35e5a0,null))[_0x8970('0x2c')](saveUpdates(_0x370633[_0x8970('0x4c')],null))['then'](respondWithResult(_0x35e5a0,null))['catch'](handleError(_0x35e5a0,null));};exports[_0x8970('0x4d')]=function(_0x2412f4,_0x26db24){return db[_0x8970('0x43')][_0x8970('0x4a')]({'where':{'id':_0x2412f4[_0x8970('0x4e')]['id']}})[_0x8970('0x2c')](handleEntityNotFound(_0x26db24,null))[_0x8970('0x2c')](removeEntity(_0x26db24,null))[_0x8970('0x48')](handleError(_0x26db24,null));};exports['describe']=function(_0x49f5be,_0xea9f72){return db[_0x8970('0x43')][_0x8970('0x4f')]()['then'](respondWithResult(_0xea9f72,null))[_0x8970('0x48')](handleError(_0xea9f72,null));};function wrapUser(_0x226110){return function(_0x194636){var _0x195a02=_0x226110['get']({'plain':!![]});_0x195a02[_0x8970('0x50')]=[];if(_0x194636){_0x195a02['lastMessageAt']=_0x194636[_0x8970('0x51')];_0x195a02['lastMessage']=_0x194636;}else{_0x195a02[_0x8970('0x52')]=moment(0x0)[_0x8970('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x195a02['lastMessage']={};}return _0x195a02;};}exports[_0x8970('0x54')]=function(_0x5f4e9e,_0x46e7a3,_0x77879f){var _0x338cec=[];return db['User'][_0x8970('0x46')]({'where':{'role':[_0x8970('0x55'),_0x8970('0x56'),_0x8970('0x57')]},'attributes':['id',_0x8970('0x58'),_0x8970('0x2e'),'role','userpic','internal','online',_0x8970('0x59'),_0x8970('0x5a'),_0x8970('0x5b')],'order':qs[_0x8970('0x3a')]('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0x8970('0x41')],'through':{'attributes':[]}}]})[_0x8970('0x2c')](function(_0x45be82){if(_0x45be82){var _0x2adf9c=_0x5f4e9e[_0x8970('0x57')][_0x8970('0x5c')]({'plain':!![]});if(!_0x2adf9c)throw new Error(_0x8970('0x5d'));if(_0x2adf9c[_0x8970('0x5e')]===_0x8970('0x57')){return db[_0x8970('0x5f')][_0x8970('0x4a')]({'where':{'name':_0x8970('0x60'),'userProfileId':_0x2adf9c[_0x8970('0x61')]},'raw':!![]})[_0x8970('0x2c')](function(_0x2950f4){if(_0x2950f4){if(_0x2950f4['autoAssociation']===0x0){return db['UserProfileResource'][_0x8970('0x46')]({'where':{'sectionId':_0x2950f4['id']},'raw':!![]})[_0x8970('0x2c')](function(_0x8eb506){var _0x6ab893=[];if(_[_0x8970('0x62')](_0x8eb506)){_0x6ab893=_[_0x8970('0x3e')](_0x45be82,function(_0x451d97){if(_0x451d97[_0x8970('0x5e')]!=='agent'){return _0x451d97;}});return _0x6ab893;}else{for(var _0x12ef43=0x0;_0x12ef43<_0x45be82['length'];_0x12ef43++){var _0x18227a=_0x45be82[_0x12ef43];if(_0x18227a[_0x8970('0x5e')]==='agent'){var _0x2042bf=_[_0x8970('0x4a')](_0x8eb506,function(_0x1033f3){return _0x1033f3['resourceId']===_0x18227a['id'];});if(_0x2042bf)_0x6ab893[_0x8970('0x63')](_0x18227a);}else{_0x6ab893[_0x8970('0x63')](_0x18227a);}}return _0x6ab893;}});}else{return _0x45be82;}}else{var _0x58e892=_[_0x8970('0x3e')](_0x45be82,function(_0x509023){if(_0x509023[_0x8970('0x5e')]!==_0x8970('0x55')){return _0x509023;}});return _0x58e892;}});}else{return _0x45be82;}}})[_0x8970('0x2c')](function(_0x23c076){var _0x444a6e=[];if(_0x23c076){_0x338cec=_0x23c076;for(var _0x2ce70f=0x0;_0x2ce70f<_0x23c076[_0x8970('0x39')];_0x2ce70f+=0x1){_0x338cec[_0x2ce70f]['messages']=[];_0x444a6e[_0x8970('0x63')](db[_0x8970('0x43')][_0x8970('0x4a')]({'where':{'FromId':[_0x5f4e9e[_0x8970('0x57')]['id'],_0x23c076[_0x2ce70f]['id']],'ToId':[_0x5f4e9e['user']['id'],_0x23c076[_0x2ce70f]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x8970('0x64'),_0x8970('0x65'),_0x8970('0x4c')],'order':qs[_0x8970('0x3a')](_0x8970('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x23c076[_0x2ce70f])));}return BPromise[_0x8970('0x67')](_0x444a6e);}return[];})[_0x8970('0x2c')](function(_0x330a2e){return{'rows':_0x330a2e,'count':_0x330a2e[_0x8970('0x39')]};})[_0x8970('0x2c')](respondWithResult(_0x46e7a3,null))[_0x8970('0x48')](handleError(_0x46e7a3,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index f51630b..f059aa8 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 _0xb7ad=['save','update','remove','emit','hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners'];(function(_0x5e206f,_0x29329d){var _0x175691=function(_0x1567f9){while(--_0x1567f9){_0x5e206f['push'](_0x5e206f['shift']());}};_0x175691(++_0x29329d);}(_0xb7ad,0x11d));var _0xdb7a=function(_0x2e4795,_0x400e7d){_0x2e4795=_0x2e4795-0x0;var _0x3d88bc=_0xb7ad[_0x2e4795];return _0x3d88bc;};'use strict';var EventEmitter=require(_0xdb7a('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xdb7a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xdb7a('0x2')](0x0);var events={'afterCreate':_0xdb7a('0x3'),'afterUpdate':_0xdb7a('0x4'),'afterDestroy':_0xdb7a('0x5')};function emitEvent(_0x5356a5){return function(_0xfcc7a8,_0x143698,_0x4f8416){ChatInternalMessageEvents[_0xdb7a('0x6')](_0x5356a5+':'+_0xfcc7a8['id'],_0xfcc7a8);ChatInternalMessageEvents[_0xdb7a('0x6')](_0x5356a5,_0xfcc7a8);_0x4f8416(null);};}for(var e in events){if(events[_0xdb7a('0x7')](e)){var event=events[e];ChatInternalMessage[_0xdb7a('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xf920=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x5aa04c,_0x453a5e){var _0xe2999c=function(_0x5662c2){while(--_0x5662c2){_0x5aa04c['push'](_0x5aa04c['shift']());}};_0xe2999c(++_0x453a5e);}(_0xf920,0x1e5));var _0x0f92=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0xf920[_0x59342a];return _0x17abc9;};'use strict';var EventEmitter=require(_0x0f92('0x0'));var ChatInternalMessage=require(_0x0f92('0x1'))['db'][_0x0f92('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0f92('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f92('0x4'),'afterDestroy':_0x0f92('0x5')};function emitEvent(_0x29bb21){return function(_0x768fd7,_0x28555a,_0x24caf3){ChatInternalMessageEvents['emit'](_0x29bb21+':'+_0x768fd7['id'],_0x768fd7);ChatInternalMessageEvents[_0x0f92('0x6')](_0x29bb21,_0x768fd7);_0x24caf3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0f92('0x7')](e,emitEvent(event));}}module[_0x0f92('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index c66dc96..b62b4b6 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 _0x9551=['request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x3417dd,_0x226510){var _0x50914e=function(_0x4981b4){while(--_0x4981b4){_0x3417dd['push'](_0x3417dd['shift']());}};_0x50914e(++_0x226510);}(_0x9551,0x80));var _0x1955=function(_0x3ef8a9,_0x59a7c2){_0x3ef8a9=_0x3ef8a9-0x0;var _0x424f63=_0x9551[_0x3ef8a9];return _0x424f63;};'use strict';var _=require('lodash');var util=require(_0x1955('0x0'));var logger=require(_0x1955('0x1'))(_0x1955('0x2'));var moment=require(_0x1955('0x3'));var BPromise=require('bluebird');var rp=require(_0x1955('0x4'));var fs=require('fs');var path=require(_0x1955('0x5'));var rimraf=require('rimraf');var config=require(_0x1955('0x6'));var attributes=require(_0x1955('0x7'));module[_0x1955('0x8')]=function(_0x3751a4,_0x4477e1){return _0x3751a4[_0x1955('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x1955('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1955('0xb')});};
\ No newline at end of file
+var _0x0190=['path','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x0190,0x1e7));var _0x0019=function(_0xe1a284,_0x583d4d){_0xe1a284=_0xe1a284-0x0;var _0x25231c=_0x0190[_0xe1a284];return _0x25231c;};'use strict';var _=require(_0x0019('0x0'));var util=require('util');var logger=require(_0x0019('0x1'))(_0x0019('0x2'));var moment=require('moment');var BPromise=require(_0x0019('0x3'));var rp=require(_0x0019('0x4'));var fs=require('fs');var path=require(_0x0019('0x5'));var rimraf=require('rimraf');var config=require(_0x0019('0x6'));var attributes=require(_0x0019('0x7'));module[_0x0019('0x8')]=function(_0xa88eca,_0x1b0ad3){return _0xa88eca[_0x0019('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x0019('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0019('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 260c1d4..e5dec98 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 _0xab5b=['debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xab5b,0x11a));var _0xbab5=function(_0x250008,_0x572a9e){_0x250008=_0x250008-0x0;var _0x2cd369=_0xab5b[_0x250008];return _0x2cd369;};'use strict';var _=require(_0xbab5('0x0'));var util=require(_0xbab5('0x1'));var moment=require('moment');var BPromise=require(_0xbab5('0x2'));var rs=require(_0xbab5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbab5('0x4'));var logger=require('../../config/logger')(_0xbab5('0x5'));var config=require(_0xbab5('0x6'));var jayson=require(_0xbab5('0x7'));var client=jayson[_0xbab5('0x8')][_0xbab5('0x9')]({'port':0x232a});config['redis']=_[_0xbab5('0xa')](config[_0xbab5('0xb')],{'host':_0xbab5('0xc'),'port':0x18eb});var socket=require(_0xbab5('0xd'))(new Redis(config[_0xbab5('0xb')]));require('./chatInternalMessage.socket')[_0xbab5('0xe')](socket);function respondWithRpcPromise(_0x31f54b,_0x37ccba,_0x4c9350){return new BPromise(function(_0x226c55,_0xfbb62c){return client['request'](_0x31f54b,_0x4c9350)[_0xbab5('0xf')](function(_0x20b3fb){logger[_0xbab5('0x10')](_0xbab5('0x11'),_0x37ccba,'request\x20sent');logger[_0xbab5('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x37ccba,_0xbab5('0x13'),JSON[_0xbab5('0x14')](_0x20b3fb));if(_0x20b3fb[_0xbab5('0x15')]){if(_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x16')]===0x1f4){logger['error'](_0xbab5('0x11'),_0x37ccba,_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);return _0xfbb62c(_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);}logger[_0xbab5('0x15')](_0xbab5('0x11'),_0x37ccba,_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);return _0x226c55(_0x20b3fb['error'][_0xbab5('0x17')]);}else{logger[_0xbab5('0x10')](_0xbab5('0x11'),_0x37ccba,'request\x20sent');_0x226c55(_0x20b3fb['result'][_0xbab5('0x17')]);}})[_0xbab5('0x18')](function(_0x25fbf1){logger[_0xbab5('0x15')](_0xbab5('0x11'),_0x37ccba,_0x25fbf1);_0xfbb62c(_0x25fbf1);});});}
\ No newline at end of file
+var _0x5acd=['code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x172780,_0x2672e7){var _0x54df9e=function(_0x585f34){while(--_0x585f34){_0x172780['push'](_0x172780['shift']());}};_0x54df9e(++_0x2672e7);}(_0x5acd,0x1f1));var _0xd5ac=function(_0x45839f,_0x522c19){_0x45839f=_0x45839f-0x0;var _0x40de77=_0x5acd[_0x45839f];return _0x40de77;};'use strict';var _=require(_0xd5ac('0x0'));var util=require(_0xd5ac('0x1'));var moment=require(_0xd5ac('0x2'));var BPromise=require(_0xd5ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5ac('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd5ac('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd5ac('0x7')]['http']({'port':0x232a});config[_0xd5ac('0x8')]=_[_0xd5ac('0x9')](config[_0xd5ac('0x8')],{'host':_0xd5ac('0xa'),'port':0x18eb});var socket=require(_0xd5ac('0xb'))(new Redis(config[_0xd5ac('0x8')]));require(_0xd5ac('0xc'))[_0xd5ac('0xd')](socket);function respondWithRpcPromise(_0x7fe90b,_0x393f7b,_0x3a08c7){return new BPromise(function(_0x3250e1,_0x1b5c03){return client[_0xd5ac('0xe')](_0x7fe90b,_0x3a08c7)[_0xd5ac('0xf')](function(_0x3885c7){logger[_0xd5ac('0x10')](_0xd5ac('0x11'),_0x393f7b,_0xd5ac('0x12'));logger[_0xd5ac('0x13')](_0xd5ac('0x14'),_0x393f7b,_0xd5ac('0x12'),JSON[_0xd5ac('0x15')](_0x3885c7));if(_0x3885c7[_0xd5ac('0x16')]){if(_0x3885c7[_0xd5ac('0x16')][_0xd5ac('0x17')]===0x1f4){logger[_0xd5ac('0x16')](_0xd5ac('0x11'),_0x393f7b,_0x3885c7[_0xd5ac('0x16')][_0xd5ac('0x18')]);return _0x1b5c03(_0x3885c7[_0xd5ac('0x16')][_0xd5ac('0x18')]);}logger[_0xd5ac('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x393f7b,_0x3885c7['error'][_0xd5ac('0x18')]);return _0x3250e1(_0x3885c7['error']['message']);}else{logger[_0xd5ac('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x393f7b,_0xd5ac('0x12'));_0x3250e1(_0x3885c7[_0xd5ac('0x19')][_0xd5ac('0x18')]);}})['catch'](function(_0x3ca925){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x393f7b,_0x3ca925);_0x1b5c03(_0x3ca925);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 9559e24..e31dcd6 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 _0x5a22=['./chatInternalMessage.events','save','remove','update','emit','removeListener','register','chatInternalMessage:'];(function(_0x16bf05,_0x4f70da){var _0xbcf546=function(_0x70b01d){while(--_0x70b01d){_0x16bf05['push'](_0x16bf05['shift']());}};_0xbcf546(++_0x4f70da);}(_0x5a22,0x1b8));var _0x25a2=function(_0x3def1b,_0x56f748){_0x3def1b=_0x3def1b-0x0;var _0x57340e=_0x5a22[_0x3def1b];return _0x57340e;};'use strict';var ChatInternalMessageEvents=require(_0x25a2('0x0'));var events=[_0x25a2('0x1'),_0x25a2('0x2'),_0x25a2('0x3')];function createListener(_0x35f89e,_0x4f730f){return function(_0x49c991){_0x4f730f[_0x25a2('0x4')](_0x35f89e,_0x49c991);};}function removeListener(_0x3fd5bb,_0x114bc4){return function(){ChatInternalMessageEvents[_0x25a2('0x5')](_0x3fd5bb,_0x114bc4);};}exports[_0x25a2('0x6')]=function(_0x4581cf){for(var _0x24f8f1=0x0,_0x537e6c=events['length'];_0x24f8f1<_0x537e6c;_0x24f8f1++){var _0x400da7=events[_0x24f8f1];var _0x4ec299=createListener(_0x25a2('0x7')+_0x400da7,_0x4581cf);ChatInternalMessageEvents['on'](_0x400da7,_0x4ec299);}};
\ No newline at end of file
+var _0xe7d2=['removeListener','register','length','./chatInternalMessage.events'];(function(_0x56402c,_0x2a8c8b){var _0x1b33da=function(_0x4af5a7){while(--_0x4af5a7){_0x56402c['push'](_0x56402c['shift']());}};_0x1b33da(++_0x2a8c8b);}(_0xe7d2,0x16b));var _0x2e7d=function(_0x825d19,_0x4fe030){_0x825d19=_0x825d19-0x0;var _0x2e7502=_0xe7d2[_0x825d19];return _0x2e7502;};'use strict';var ChatInternalMessageEvents=require(_0x2e7d('0x0'));var events=['save','remove','update'];function createListener(_0x2f72b9,_0x4b5229){return function(_0x420e3f){_0x4b5229['emit'](_0x2f72b9,_0x420e3f);};}function removeListener(_0x3871b5,_0x4c1015){return function(){ChatInternalMessageEvents[_0x2e7d('0x1')](_0x3871b5,_0x4c1015);};}exports[_0x2e7d('0x2')]=function(_0x4ddb1f){for(var _0x2ad851=0x0,_0x23fdf8=events[_0x2e7d('0x3')];_0x2ad851<_0x23fdf8;_0x2ad851++){var _0x1589b0=events[_0x2ad851];var _0x1ff055=createListener('chatInternalMessage:'+_0x1589b0,_0x4ddb1f);ChatInternalMessageEvents['on'](_0x1589b0,_0x1ff055);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 82d07fe..da7f147 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 _0x67fe=['get','/describe','describe','/users','isAuthenticated','getUsers','/:id','show','post','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x15df98,_0xf3c3ad){var _0x3bcfb2=function(_0x19b65d){while(--_0x19b65d){_0x15df98['push'](_0x15df98['shift']());}};_0x3bcfb2(++_0xf3c3ad);}(_0x67fe,0x189));var _0xe67f=function(_0x29ddb1,_0x374564){_0x29ddb1=_0x29ddb1-0x0;var _0x42739e=_0x67fe[_0x29ddb1];return _0x42739e;};'use strict';var multer=require(_0xe67f('0x0'));var util=require(_0xe67f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe67f('0x2'));var router=express[_0xe67f('0x3')]();var fs_extra=require(_0xe67f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe67f('0x5'));var config=require(_0xe67f('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xe67f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe67f('0x7')](_0xe67f('0x8'),auth['isAuthenticated'](),controller[_0xe67f('0x9')]);router[_0xe67f('0x7')](_0xe67f('0xa'),auth[_0xe67f('0xb')](),controller[_0xe67f('0xc')]);router[_0xe67f('0x7')](_0xe67f('0xd'),auth[_0xe67f('0xb')](),controller[_0xe67f('0xe')]);router[_0xe67f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe67f('0x10')](_0xe67f('0xd'),controller['update']);router[_0xe67f('0x11')](_0xe67f('0xd'),auth[_0xe67f('0xb')](),controller[_0xe67f('0x12')]);module[_0xe67f('0x13')]=router;
\ No newline at end of file
+var _0x361a=['isAuthenticated','getUsers','show','post','create','put','/:id','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','/describe','describe','/users'];(function(_0x2263cc,_0x2e1dc9){var _0x1ba214=function(_0x2c4fe3){while(--_0x2c4fe3){_0x2263cc['push'](_0x2263cc['shift']());}};_0x1ba214(++_0x2e1dc9);}(_0x361a,0x8e));var _0xa361=function(_0x38fc0f,_0x4658a5){_0x38fc0f=_0x38fc0f-0x0;var _0x23c7c4=_0x361a[_0x38fc0f];return _0x23c7c4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa361('0x0'));var express=require(_0xa361('0x1'));var router=express[_0xa361('0x2')]();var fs_extra=require(_0xa361('0x3'));var auth=require(_0xa361('0x4'));var interaction=require(_0xa361('0x5'));var config=require(_0xa361('0x6'));var controller=require(_0xa361('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa361('0x8')]);router['get'](_0xa361('0x9'),auth['isAuthenticated'](),controller[_0xa361('0xa')]);router['get'](_0xa361('0xb'),auth[_0xa361('0xc')](),controller[_0xa361('0xd')]);router['get']('/:id',auth[_0xa361('0xc')](),controller[_0xa361('0xe')]);router[_0xa361('0xf')]('/',auth['isAuthenticated'](),controller[_0xa361('0x10')]);router[_0xa361('0x11')](_0xa361('0x12'),controller['update']);router[_0xa361('0x13')](_0xa361('0x12'),auth[_0xa361('0xc')](),controller[_0xa361('0x14')]);module[_0xa361('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 7b91607..426671f 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 _0x7708=['DATE','TEXT','sequelize','exports','medium','out'];(function(_0x193e07,_0x3c96b8){var _0x3b0663=function(_0x45717c){while(--_0x45717c){_0x193e07['push'](_0x193e07['shift']());}};_0x3b0663(++_0x3c96b8);}(_0x7708,0x188));var _0x8770=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0x7708[_0x705b98];return _0x47b72f;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8770('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x8770('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8770('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x8770('0x5')]}};
\ No newline at end of file
+var _0xed3c=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0xeba5c0,_0x54381f){var _0x35b566=function(_0x136f70){while(--_0x136f70){_0xeba5c0['push'](_0xeba5c0['shift']());}};_0x35b566(++_0x54381f);}(_0xed3c,0x1a6));var _0xced3=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0xed3c[_0x297dcf];return _0xe1699b;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'body':{'type':Sequelize[_0xced3('0x2')](_0xced3('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xced3('0x5')]('in',_0xced3('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xced3('0x7')]},'providerResponse':{'type':Sequelize[_0xced3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 7e3cbc6..32be132 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 _0x4134=['rejectMessage','SELECT','User','email','internal','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','params','options','find','create','body','describe','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','parse','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage'];(function(_0x3ac16c,_0x54c187){var _0x1204e6=function(_0x25cf2c){while(--_0x25cf2c){_0x3ac16c['push'](_0x3ac16c['shift']());}};_0x1204e6(++_0x54c187);}(_0x4134,0x114));var _0x4413=function(_0x111f0d,_0x37dbc2){_0x111f0d=_0x111f0d-0x0;var _0x108418=_0x4134[_0x111f0d];return _0x108418;};'use strict';var emlformat=require(_0x4413('0x0'));var rimraf=require(_0x4413('0x1'));var zipdir=require(_0x4413('0x2'));var jsonpatch=require(_0x4413('0x3'));var rp=require(_0x4413('0x4'));var moment=require(_0x4413('0x5'));var BPromise=require(_0x4413('0x6'));var Mustache=require(_0x4413('0x7'));var util=require(_0x4413('0x8'));var path=require(_0x4413('0x9'));var sox=require(_0x4413('0xa'));var csv=require('to-csv');var ejs=require(_0x4413('0xb'));var fs=require('fs');var fs_extra=require(_0x4413('0xc'));var _=require('lodash');var squel=require(_0x4413('0xd'));var crypto=require(_0x4413('0xe'));var jsforce=require(_0x4413('0xf'));var deskjs=require(_0x4413('0x10'));var toCsv=require(_0x4413('0x11'));var querystring=require('querystring');var Papa=require(_0x4413('0x12'));var Redis=require('ioredis');var authService=require(_0x4413('0x13'));var qs=require(_0x4413('0x14'));var as=require(_0x4413('0x15'));var hardwareService=require(_0x4413('0x16'));var logger=require(_0x4413('0x17'))(_0x4413('0x18'));var utils=require('../../config/utils');var config=require(_0x4413('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4413('0x1a'))['db'];config[_0x4413('0x1b')]=_[_0x4413('0x1c')](config['redis'],{'host':_0x4413('0x1d'),'port':0x18eb});var socket=require(_0x4413('0x1e'))(new Redis(config[_0x4413('0x1b')]));require(_0x4413('0x1f'))[_0x4413('0x20')](socket);var jayson=require(_0x4413('0x21'));var client=jayson[_0x4413('0x22')]['http']({'port':0x232c});var client9002=jayson['client'][_0x4413('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x7b93c8,_0x48ebe1,_0x41e05f,_0x49366a){return new BPromise(function(_0x290019,_0x18abfe){var _0x1b3489=_0x49366a||client;return _0x1b3489['request'](_0x7b93c8,_0x41e05f)[_0x4413('0x24')](function(_0x149fcb){logger[_0x4413('0x25')](_0x4413('0x26'),_0x48ebe1,'request\x20sent');logger[_0x4413('0x27')](_0x4413('0x28'),_0x48ebe1,'request\x20sent',JSON[_0x4413('0x29')](_0x149fcb));if(_0x149fcb[_0x4413('0x2a')]){if(_0x149fcb['error']['code']===0x1f4){logger[_0x4413('0x2a')](_0x4413('0x26'),_0x48ebe1,_0x149fcb[_0x4413('0x2a')][_0x4413('0x2b')]);return _0x18abfe(_0x149fcb[_0x4413('0x2a')]['message']);}logger[_0x4413('0x2a')](_0x4413('0x26'),_0x48ebe1,_0x149fcb['error'][_0x4413('0x2b')]);return _0x290019(_0x149fcb['error'][_0x4413('0x2b')]);}else{logger['info'](_0x4413('0x26'),_0x48ebe1,_0x4413('0x2c'));_0x290019(_0x149fcb[_0x4413('0x2d')]['message']);}})[_0x4413('0x2e')](function(_0x1af010){logger[_0x4413('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x48ebe1,_0x1af010);_0x18abfe(_0x1af010);});});}function respondWithStatusCode(_0x3782ff,_0x265e1c){_0x265e1c=_0x265e1c||0xcc;return function(_0x26e725){if(_0x26e725){return _0x3782ff['sendStatus'](_0x265e1c);}return _0x3782ff[_0x4413('0x2f')](_0x265e1c)['end']();};}function respondWithResult(_0x1f7d0a,_0x2c3c0b){_0x2c3c0b=_0x2c3c0b||0xc8;return function(_0x57aa55){if(_0x57aa55){return _0x1f7d0a[_0x4413('0x2f')](_0x2c3c0b)[_0x4413('0x30')](_0x57aa55);}};}function respondWithFilteredResult(_0xefe1f2,_0x184fed){return function(_0x30a03c){if(_0x30a03c){var _0x2e69b1=typeof _0x184fed[_0x4413('0x31')]===_0x4413('0x32')&&typeof _0x184fed['limit']===_0x4413('0x32');var _0x3bf4d3=_0x30a03c[_0x4413('0x33')];var _0x283480=_0x2e69b1?0x0:_0x184fed['offset'];var _0x2bf04f=_0x2e69b1?_0x30a03c[_0x4413('0x33')]:_0x184fed[_0x4413('0x31')]+_0x184fed[_0x4413('0x34')];var _0x25bfbf;if(_0x2bf04f>=_0x3bf4d3){_0x2bf04f=_0x3bf4d3;_0x25bfbf=0xc8;}else{_0x25bfbf=0xce;}_0xefe1f2[_0x4413('0x2f')](_0x25bfbf);return _0xefe1f2[_0x4413('0x35')](_0x4413('0x36'),_0x283480+'-'+_0x2bf04f+'/'+_0x3bf4d3)[_0x4413('0x30')](_0x30a03c);}return null;};}function patchUpdates(_0x3f37de){return function(_0x11e72b){try{jsonpatch['apply'](_0x11e72b,_0x3f37de,!![]);}catch(_0xd8516c){return BPromise[_0x4413('0x37')](_0xd8516c);}return _0x11e72b[_0x4413('0x38')]();};}function saveUpdates(_0x2d1c61,_0x5cb3b1){return function(_0x579fcf){if(_0x579fcf){return _0x579fcf[_0x4413('0x39')](_0x2d1c61)[_0x4413('0x24')](function(_0x167106){return _0x167106;});}return null;};}function removeEntity(_0x343dde,_0x1a480e){return function(_0x53237a){if(_0x53237a){return _0x53237a[_0x4413('0x3a')]()[_0x4413('0x24')](function(){_0x343dde[_0x4413('0x2f')](0xcc)[_0x4413('0x3b')]();});}};}function handleEntityNotFound(_0xfd317d,_0x1092d7){return function(_0x351830){if(!_0x351830){_0xfd317d[_0x4413('0x3c')](0x194);}return _0x351830;};}function handleError(_0x4f70f0,_0x36e761){_0x36e761=_0x36e761||0x1f4;return function(_0x481c03){logger['error'](_0x481c03[_0x4413('0x3d')]);if(_0x481c03[_0x4413('0x3e')]){delete _0x481c03['name'];}_0x4f70f0['status'](_0x36e761)[_0x4413('0x3f')](_0x481c03);};}exports['index']=function(_0x25b081,_0x2f0391){var _0x525486={},_0x53a9dc={},_0x3b2a2f={'count':0x0,'rows':[]};var _0x167e17=_[_0x4413('0x40')](db[_0x4413('0x41')][_0x4413('0x42')],function(_0x2c3922){return{'name':_0x2c3922[_0x4413('0x43')],'type':_0x2c3922[_0x4413('0x44')][_0x4413('0x45')]};});_0x53a9dc[_0x4413('0x46')]=_[_0x4413('0x40')](_0x167e17,_0x4413('0x3e'));_0x53a9dc[_0x4413('0x47')]=_[_0x4413('0x48')](_0x25b081[_0x4413('0x47')]);_0x53a9dc[_0x4413('0x49')]=_['intersection'](_0x53a9dc[_0x4413('0x46')],_0x53a9dc['query']);_0x525486[_0x4413('0x4a')]=_[_0x4413('0x4b')](_0x53a9dc['model'],qs[_0x4413('0x4c')](_0x25b081[_0x4413('0x47')][_0x4413('0x4c')]));_0x525486[_0x4413('0x4a')]=_0x525486[_0x4413('0x4a')][_0x4413('0x4d')]?_0x525486[_0x4413('0x4a')]:_0x53a9dc[_0x4413('0x46')];if(!_0x25b081['query'][_0x4413('0x4e')](_0x4413('0x4f'))){_0x525486[_0x4413('0x34')]=qs[_0x4413('0x34')](_0x25b081[_0x4413('0x47')][_0x4413('0x34')]);_0x525486[_0x4413('0x31')]=qs[_0x4413('0x31')](_0x25b081[_0x4413('0x47')]['offset']);}_0x525486[_0x4413('0x50')]=qs[_0x4413('0x51')](_0x25b081['query'][_0x4413('0x51')]);_0x525486[_0x4413('0x52')]=qs[_0x4413('0x49')](_[_0x4413('0x53')](_0x25b081[_0x4413('0x47')],_0x53a9dc[_0x4413('0x49')]),_0x167e17);if(_0x25b081[_0x4413('0x47')][_0x4413('0x54')]){_0x525486[_0x4413('0x52')]=_[_0x4413('0x55')](_0x525486[_0x4413('0x52')],{'$or':_['map'](_0x167e17,function(_0x5aae7a){if(_0x5aae7a[_0x4413('0x44')]!=='VIRTUAL'){var _0x41c8fe={};_0x41c8fe[_0x5aae7a[_0x4413('0x3e')]]={'$like':'%'+_0x25b081[_0x4413('0x47')]['filter']+'%'};return _0x41c8fe;}})});}_0x525486=_['merge']({},_0x525486,_0x25b081['options']);var _0x562c35={'where':_0x525486[_0x4413('0x52')]};return db[_0x4413('0x41')]['count'](_0x562c35)[_0x4413('0x24')](function(_0x56fa74){_0x3b2a2f['count']=_0x56fa74;if(_0x25b081[_0x4413('0x47')][_0x4413('0x56')]){_0x525486[_0x4413('0x57')]=[{'all':!![]}];}return db[_0x4413('0x41')][_0x4413('0x58')](_0x525486);})[_0x4413('0x24')](function(_0x2fd12d){_0x3b2a2f['rows']=_0x2fd12d;return _0x3b2a2f;})[_0x4413('0x24')](respondWithFilteredResult(_0x2f0391,_0x525486))[_0x4413('0x2e')](handleError(_0x2f0391,null));};exports['show']=function(_0x185b46,_0x52d8bc){var _0xd524c1={'raw':!![],'where':{'id':_0x185b46[_0x4413('0x59')]['id']}},_0x25b909={};_0x25b909[_0x4413('0x46')]=_[_0x4413('0x48')](db[_0x4413('0x41')][_0x4413('0x42')]);_0x25b909['query']=_[_0x4413('0x48')](_0x185b46[_0x4413('0x47')]);_0x25b909[_0x4413('0x49')]=_[_0x4413('0x4b')](_0x25b909['model'],_0x25b909[_0x4413('0x47')]);_0xd524c1[_0x4413('0x4a')]=_[_0x4413('0x4b')](_0x25b909['model'],qs[_0x4413('0x4c')](_0x185b46['query'][_0x4413('0x4c')]));_0xd524c1[_0x4413('0x4a')]=_0xd524c1[_0x4413('0x4a')]['length']?_0xd524c1[_0x4413('0x4a')]:_0x25b909[_0x4413('0x46')];if(_0x185b46[_0x4413('0x47')]['includeAll']){_0xd524c1['include']=[{'all':!![]}];}_0xd524c1=_[_0x4413('0x55')]({},_0xd524c1,_0x185b46[_0x4413('0x5a')]);return db[_0x4413('0x41')][_0x4413('0x5b')](_0xd524c1)[_0x4413('0x24')](handleEntityNotFound(_0x52d8bc,null))[_0x4413('0x24')](respondWithResult(_0x52d8bc,null))[_0x4413('0x2e')](handleError(_0x52d8bc,null));};exports[_0x4413('0x5c')]=function(_0x42fd67,_0x322b5a){return db[_0x4413('0x41')]['create'](_0x42fd67['body'],{})[_0x4413('0x24')](respondWithResult(_0x322b5a,0xc9))[_0x4413('0x2e')](handleError(_0x322b5a,null));};exports[_0x4413('0x39')]=function(_0xe9f437,_0x2d1c09){if(_0xe9f437[_0x4413('0x5d')]['id']){delete _0xe9f437[_0x4413('0x5d')]['id'];}return db[_0x4413('0x41')][_0x4413('0x5b')]({'where':{'id':_0xe9f437[_0x4413('0x59')]['id']}})[_0x4413('0x24')](handleEntityNotFound(_0x2d1c09,null))[_0x4413('0x24')](saveUpdates(_0xe9f437[_0x4413('0x5d')],null))[_0x4413('0x24')](respondWithResult(_0x2d1c09,null))[_0x4413('0x2e')](handleError(_0x2d1c09,null));};exports[_0x4413('0x3a')]=function(_0x3c65eb,_0x6aaefd){return db[_0x4413('0x41')][_0x4413('0x5b')]({'where':{'id':_0x3c65eb[_0x4413('0x59')]['id']}})[_0x4413('0x24')](handleEntityNotFound(_0x6aaefd,null))['then'](removeEntity(_0x6aaefd,null))[_0x4413('0x2e')](handleError(_0x6aaefd,null));};exports['describe']=function(_0x1cab2f,_0x57a86a){return db['ChatMessage'][_0x4413('0x5e')]()['then'](respondWithResult(_0x57a86a,null))[_0x4413('0x2e')](handleError(_0x57a86a,null));};var interaction_log=require(_0x4413('0x17'))('chat-interactions');exports[_0x4413('0x5f')]=function(_0x277070,_0x2578a7,_0x5a4bff){var _0x10bffa={'agent':{},'channel':_0x4413('0x60')};if(_0x277070['body']['id']){delete _0x277070[_0x4413('0x5d')]['id'];}_0x277070[_0x4413('0x5d')]['read']=!![];_0x277070[_0x4413('0x5d')][_0x4413('0x61')]=moment()[_0x4413('0x62')](_0x4413('0x63'));_0x277070[_0x4413('0x5d')][_0x4413('0x64')]=_0x277070[_0x4413('0x5d')][_0x4413('0x64')]||_0x277070[_0x4413('0x65')]['id'];_0x10bffa[_0x4413('0x66')]['id']=_0x277070[_0x4413('0x5d')][_0x4413('0x64')];return db[_0x4413('0x41')]['find']({'where':{'id':_0x277070[_0x4413('0x59')]['id'],'UserId':null}})[_0x4413('0x24')](handleEntityNotFound(_0x2578a7,null))[_0x4413('0x24')](saveUpdates(_0x277070[_0x4413('0x5d')],null))[_0x4413('0x24')](function(_0x49bf2c){if(_0x49bf2c){_0x10bffa['message']=_0x49bf2c[_0x4413('0x67')]({'plain':!![]});return db[_0x4413('0x68')][_0x4413('0x5b')]({'where':{'id':_0x49bf2c[_0x4413('0x69')]}});}return null;})[_0x4413('0x24')](handleEntityNotFound(_0x2578a7,null))[_0x4413('0x24')](function(_0x5c9a22){if(_0x5c9a22){return _0x5c9a22['update']({'UserId':_0x277070[_0x4413('0x5d')]['UserId'],'read1stAt':_['isNil'](_0x5c9a22['read1stAt'])?moment()[_0x4413('0x62')](_0x4413('0x63')):undefined});}return null;})['then'](function(_0x2b1883){if(_0x2b1883){_0x10bffa['interaction']=_0x2b1883[_0x4413('0x67')]({'plain':!![]});interaction_log[_0x4413('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x277070[_0x4413('0x65')]['id'],_0x277070[_0x4413('0x65')][_0x4413('0x3e')],_0x277070[_0x4413('0x65')][_0x4413('0x6a')],_0x10bffa[_0x4413('0x6b')]['id'],_0x277070[_0x4413('0x5d')]?JSON[_0x4413('0x29')](_0x277070[_0x4413('0x5d')]):_0x4413('0x6c'));return respondWithRpcPromise(_0x4413('0x6d'),_0x4413('0x6e'),_0x10bffa);}return null;})[_0x4413('0x24')](function(_0xc95074){var _0x2e9541=_0x4413('0x6f')+_0xc95074[_0x4413('0x2b')][_0x4413('0x70')];return db[_0x4413('0x71')]['query'](_0x2e9541,{'type':db[_0x4413('0x72')][_0x4413('0x73')]['SELECT'],'raw':!![]})[_0x4413('0x24')](function(_0x4baf00){return _0x4baf00;});})[_0x4413('0x24')](function(_0x43114b){if(_0x43114b){_0x10bffa[_0x4413('0x2b')][_0x4413('0x74')]=_0x43114b[0x0];if(!_0x277070[_0x4413('0x5d')][_0x4413('0x64')])return;return db['User'][_0x4413('0x5b')]({'where':{'id':_0x277070['body'][_0x4413('0x64')],'role':_0x4413('0x66')},'attributes':['id','name',_0x4413('0x75'),'email','internal'],'raw':!![]});}return null;})[_0x4413('0x24')](function(_0x2736dc){if(!_0x2736dc)return null;_0x10bffa[_0x4413('0x2b')][_0x4413('0x66')]=_0x2736dc;return _0x10bffa;})[_0x4413('0x24')](function(_0x35165a){if(_0x35165a){if(_0x277070['body']['manual']){_0x10bffa['message'][_0x4413('0x76')]=util[_0x4413('0x62')](_0x4413('0x77'),_0x277070[_0x4413('0x65')][_0x4413('0x3e')]);_0x10bffa['message']['channel']=_0x10bffa['channel'];_0x10bffa[_0x4413('0x2b')][_0x4413('0x78')]=_0x10bffa[_0x4413('0x79')];_0x10bffa[_0x4413('0x2b')][_0x4413('0x7a')]=_0x4413('0x5f');return respondWithRpcPromise(_0x4413('0x7b'),_0x4413('0x7b'),{'event':_0x4413('0x7c'),'message':_[_0x4413('0x55')](_0x10bffa[_0x4413('0x2b')],JSON[_0x4413('0x7d')](_0x10bffa[_0x4413('0x6b')]['formData']))},client9002)[_0x4413('0x24')](function(){return _0x10bffa;});}return _0x10bffa;}return null;})['then'](respondWithResult(_0x2578a7,null))[_0x4413('0x2e')](handleError(_0x2578a7,null));};var interaction_log=require('../../config/logger')(_0x4413('0x7e'));exports[_0x4413('0x37')]=function(_0x24ee95,_0x25411e,_0x1ec83c){var _0x184f71={'agent':{},'channel':_0x4413('0x60')};if(_0x24ee95[_0x4413('0x5d')]['id']){delete _0x24ee95[_0x4413('0x5d')]['id'];}_0x24ee95[_0x4413('0x5d')][_0x4413('0x64')]=_0x24ee95[_0x4413('0x5d')][_0x4413('0x64')]||_0x24ee95[_0x4413('0x65')]['id'];_0x184f71[_0x4413('0x66')]['id']=_0x24ee95['body'][_0x4413('0x64')];return db[_0x4413('0x41')][_0x4413('0x5b')]({'where':{'id':_0x24ee95['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x25411e,null))['then'](function(_0x58d9a3){if(_0x58d9a3){_0x184f71['message']=_0x58d9a3[_0x4413('0x67')]({'plain':!![]});return db[_0x4413('0x68')][_0x4413('0x5b')]({'where':{'id':_0x58d9a3[_0x4413('0x69')]}});}return null;})[_0x4413('0x24')](handleEntityNotFound(_0x25411e,null))[_0x4413('0x24')](function(_0x3b21e1){if(_0x3b21e1){_0x184f71[_0x4413('0x6b')]=_0x3b21e1[_0x4413('0x67')]({'plain':!![]});interaction_log['info'](_0x4413('0x7f'),_0x24ee95[_0x4413('0x65')]['id'],_0x24ee95[_0x4413('0x65')][_0x4413('0x3e')],_0x24ee95['user'][_0x4413('0x6a')],_0x184f71[_0x4413('0x6b')]['id'],_0x24ee95[_0x4413('0x5d')]?JSON['stringify'](_0x24ee95[_0x4413('0x5d')]):'null');return respondWithRpcPromise(_0x4413('0x80'),_0x4413('0x81'),_0x184f71);}return null;})['then'](function(_0x1164e1){var _0x11b455=_0x4413('0x6f')+_0x1164e1[_0x4413('0x2b')][_0x4413('0x70')];return db[_0x4413('0x71')][_0x4413('0x47')](_0x11b455,{'type':db[_0x4413('0x72')][_0x4413('0x73')][_0x4413('0x82')],'raw':!![]})[_0x4413('0x24')](function(_0x445df9){return _0x445df9;});})[_0x4413('0x24')](function(_0x136063){if(_0x136063){_0x184f71[_0x4413('0x2b')][_0x4413('0x74')]=_0x136063[0x0];if(!_0x24ee95[_0x4413('0x5d')][_0x4413('0x64')])return;return db[_0x4413('0x83')][_0x4413('0x5b')]({'where':{'id':_0x24ee95['body'][_0x4413('0x64')],'role':'agent'},'attributes':['id','name',_0x4413('0x75'),_0x4413('0x84'),_0x4413('0x85')],'raw':!![]});}return null;})[_0x4413('0x24')](function(_0x127830){if(!_0x127830)return null;_0x184f71[_0x4413('0x2b')][_0x4413('0x66')]=_0x127830;return _0x184f71;})[_0x4413('0x24')](function(_0x3363bd){if(_0x3363bd){_0x3363bd['message'][_0x4413('0x76')]=util[_0x4413('0x62')](_0x4413('0x77'),_0x24ee95[_0x4413('0x65')][_0x4413('0x3e')]);_0x3363bd[_0x4413('0x2b')][_0x4413('0x79')]=_0x184f71['channel'];_0x3363bd[_0x4413('0x2b')]['motionChannel']=_0x184f71[_0x4413('0x79')];_0x3363bd['message'][_0x4413('0x7a')]=_0x4413('0x37');respondWithRpcPromise('EventManager',_0x4413('0x7b'),{'event':'rejectmessage','message':_[_0x4413('0x55')](_0x184f71[_0x4413('0x2b')],JSON[_0x4413('0x7d')](_0x184f71[_0x4413('0x6b')][_0x4413('0x86')]))},client9002);return _0x184f71;}return null;})[_0x4413('0x24')](respondWithResult(_0x25411e,null))[_0x4413('0x2e')](handleError(_0x25411e,null));};
\ No newline at end of file
+var _0x219e=['../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','find','create','body','params','describe','../../config/logger','accept','chat','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','RejectMessage','sequelize','Sequelize','SELECT','formData','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api'];(function(_0xcd3e25,_0x3778c5){var _0x7164ce=function(_0x360b82){while(--_0x360b82){_0xcd3e25['push'](_0xcd3e25['shift']());}};_0x7164ce(++_0x3778c5);}(_0x219e,0x172));var _0xe219=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x219e[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0xe219('0x0'));var rimraf=require(_0xe219('0x1'));var zipdir=require(_0xe219('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe219('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe219('0x4'));var util=require(_0xe219('0x5'));var path=require(_0xe219('0x6'));var sox=require(_0xe219('0x7'));var csv=require('to-csv');var ejs=require(_0xe219('0x8'));var fs=require('fs');var fs_extra=require(_0xe219('0x9'));var _=require(_0xe219('0xa'));var squel=require(_0xe219('0xb'));var crypto=require('crypto');var jsforce=require(_0xe219('0xc'));var deskjs=require(_0xe219('0xd'));var toCsv=require(_0xe219('0xe'));var querystring=require(_0xe219('0xf'));var Papa=require(_0xe219('0x10'));var Redis=require(_0xe219('0x11'));var authService=require(_0xe219('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe219('0x13'));var utils=require(_0xe219('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe219('0x15'))['db'];config[_0xe219('0x16')]=_[_0xe219('0x17')](config[_0xe219('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xe219('0x18'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xe219('0x19')](socket);var jayson=require(_0xe219('0x1a'));var client=jayson[_0xe219('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xe219('0x1b')][_0xe219('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1cc791,_0x37fcc6,_0x121059,_0x1c6aea){return new BPromise(function(_0x28f9e4,_0x6ea9be){var _0x3c78ad=_0x1c6aea||client;return _0x3c78ad[_0xe219('0x1d')](_0x1cc791,_0x121059)['then'](function(_0x5adbe9){logger[_0xe219('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x37fcc6,_0xe219('0x1f'));logger[_0xe219('0x20')](_0xe219('0x21'),_0x37fcc6,'request\x20sent',JSON[_0xe219('0x22')](_0x5adbe9));if(_0x5adbe9['error']){if(_0x5adbe9[_0xe219('0x23')][_0xe219('0x24')]===0x1f4){logger['error'](_0xe219('0x25'),_0x37fcc6,_0x5adbe9[_0xe219('0x23')][_0xe219('0x26')]);return _0x6ea9be(_0x5adbe9['error'][_0xe219('0x26')]);}logger[_0xe219('0x23')](_0xe219('0x25'),_0x37fcc6,_0x5adbe9['error'][_0xe219('0x26')]);return _0x28f9e4(_0x5adbe9['error'][_0xe219('0x26')]);}else{logger[_0xe219('0x1e')](_0xe219('0x25'),_0x37fcc6,_0xe219('0x1f'));_0x28f9e4(_0x5adbe9[_0xe219('0x27')][_0xe219('0x26')]);}})[_0xe219('0x28')](function(_0x1dab92){logger['error'](_0xe219('0x25'),_0x37fcc6,_0x1dab92);_0x6ea9be(_0x1dab92);});});}function respondWithStatusCode(_0x1483b6,_0x2adb15){_0x2adb15=_0x2adb15||0xcc;return function(_0x73611e){if(_0x73611e){return _0x1483b6[_0xe219('0x29')](_0x2adb15);}return _0x1483b6[_0xe219('0x2a')](_0x2adb15)[_0xe219('0x2b')]();};}function respondWithResult(_0x319763,_0x43d2b0){_0x43d2b0=_0x43d2b0||0xc8;return function(_0x145082){if(_0x145082){return _0x319763[_0xe219('0x2a')](_0x43d2b0)[_0xe219('0x2c')](_0x145082);}};}function respondWithFilteredResult(_0x1aee9e,_0x2b042a){return function(_0x8ea90){if(_0x8ea90){var _0x4ce0bc=typeof _0x2b042a['offset']===_0xe219('0x2d')&&typeof _0x2b042a[_0xe219('0x2e')]===_0xe219('0x2d');var _0x1367b3=_0x8ea90[_0xe219('0x2f')];var _0x173e3b=_0x4ce0bc?0x0:_0x2b042a[_0xe219('0x30')];var _0x58d368=_0x4ce0bc?_0x8ea90[_0xe219('0x2f')]:_0x2b042a[_0xe219('0x30')]+_0x2b042a[_0xe219('0x2e')];var _0x4cc639;if(_0x58d368>=_0x1367b3){_0x58d368=_0x1367b3;_0x4cc639=0xc8;}else{_0x4cc639=0xce;}_0x1aee9e[_0xe219('0x2a')](_0x4cc639);return _0x1aee9e[_0xe219('0x31')](_0xe219('0x32'),_0x173e3b+'-'+_0x58d368+'/'+_0x1367b3)[_0xe219('0x2c')](_0x8ea90);}return null;};}function patchUpdates(_0x2f5b25){return function(_0x38e4fe){try{jsonpatch[_0xe219('0x33')](_0x38e4fe,_0x2f5b25,!![]);}catch(_0xab7136){return BPromise[_0xe219('0x34')](_0xab7136);}return _0x38e4fe[_0xe219('0x35')]();};}function saveUpdates(_0x29bc4b,_0x3a43de){return function(_0xd7cc54){if(_0xd7cc54){return _0xd7cc54[_0xe219('0x36')](_0x29bc4b)['then'](function(_0x3e9115){return _0x3e9115;});}return null;};}function removeEntity(_0x4120ff,_0x57b40a){return function(_0x2294a4){if(_0x2294a4){return _0x2294a4['destroy']()[_0xe219('0x37')](function(){_0x4120ff[_0xe219('0x2a')](0xcc)[_0xe219('0x2b')]();});}};}function handleEntityNotFound(_0x4462d3,_0x1d7845){return function(_0x58a4cf){if(!_0x58a4cf){_0x4462d3[_0xe219('0x29')](0x194);}return _0x58a4cf;};}function handleError(_0x4225a7,_0xe66907){_0xe66907=_0xe66907||0x1f4;return function(_0x368798){logger[_0xe219('0x23')](_0x368798[_0xe219('0x38')]);if(_0x368798[_0xe219('0x39')]){delete _0x368798['name'];}_0x4225a7[_0xe219('0x2a')](_0xe66907)['send'](_0x368798);};}exports[_0xe219('0x3a')]=function(_0x3ea303,_0x1f5ef4){var _0x409003={},_0x46d55f={},_0x35c4a8={'count':0x0,'rows':[]};var _0x5ef2ea=_[_0xe219('0x3b')](db[_0xe219('0x3c')][_0xe219('0x3d')],function(_0x2eedaf){return{'name':_0x2eedaf[_0xe219('0x3e')],'type':_0x2eedaf[_0xe219('0x3f')][_0xe219('0x40')]};});_0x46d55f[_0xe219('0x41')]=_[_0xe219('0x3b')](_0x5ef2ea,_0xe219('0x39'));_0x46d55f[_0xe219('0x42')]=_[_0xe219('0x43')](_0x3ea303[_0xe219('0x42')]);_0x46d55f[_0xe219('0x44')]=_[_0xe219('0x45')](_0x46d55f[_0xe219('0x41')],_0x46d55f[_0xe219('0x42')]);_0x409003[_0xe219('0x46')]=_[_0xe219('0x45')](_0x46d55f[_0xe219('0x41')],qs[_0xe219('0x47')](_0x3ea303[_0xe219('0x42')][_0xe219('0x47')]));_0x409003[_0xe219('0x46')]=_0x409003['attributes'][_0xe219('0x48')]?_0x409003[_0xe219('0x46')]:_0x46d55f['model'];if(!_0x3ea303[_0xe219('0x42')]['hasOwnProperty'](_0xe219('0x49'))){_0x409003['limit']=qs[_0xe219('0x2e')](_0x3ea303[_0xe219('0x42')][_0xe219('0x2e')]);_0x409003[_0xe219('0x30')]=qs[_0xe219('0x30')](_0x3ea303[_0xe219('0x42')]['offset']);}_0x409003[_0xe219('0x4a')]=qs['sort'](_0x3ea303['query'][_0xe219('0x4b')]);_0x409003[_0xe219('0x4c')]=qs[_0xe219('0x44')](_[_0xe219('0x4d')](_0x3ea303[_0xe219('0x42')],_0x46d55f[_0xe219('0x44')]),_0x5ef2ea);if(_0x3ea303['query'][_0xe219('0x4e')]){_0x409003[_0xe219('0x4c')]=_[_0xe219('0x4f')](_0x409003[_0xe219('0x4c')],{'$or':_[_0xe219('0x3b')](_0x5ef2ea,function(_0x5767c5){if(_0x5767c5[_0xe219('0x3f')]!=='VIRTUAL'){var _0x44547a={};_0x44547a[_0x5767c5[_0xe219('0x39')]]={'$like':'%'+_0x3ea303[_0xe219('0x42')][_0xe219('0x4e')]+'%'};return _0x44547a;}})});}_0x409003=_[_0xe219('0x4f')]({},_0x409003,_0x3ea303[_0xe219('0x50')]);var _0x2be226={'where':_0x409003[_0xe219('0x4c')]};return db[_0xe219('0x3c')][_0xe219('0x2f')](_0x2be226)[_0xe219('0x37')](function(_0x2675b2){_0x35c4a8[_0xe219('0x2f')]=_0x2675b2;if(_0x3ea303[_0xe219('0x42')][_0xe219('0x51')]){_0x409003[_0xe219('0x52')]=[{'all':!![]}];}return db['ChatMessage'][_0xe219('0x53')](_0x409003);})['then'](function(_0x96ae8a){_0x35c4a8['rows']=_0x96ae8a;return _0x35c4a8;})['then'](respondWithFilteredResult(_0x1f5ef4,_0x409003))[_0xe219('0x28')](handleError(_0x1f5ef4,null));};exports[_0xe219('0x54')]=function(_0x241532,_0x5e6053){var _0x35f9e5={'raw':!![],'where':{'id':_0x241532['params']['id']}},_0x56c9b9={};_0x56c9b9[_0xe219('0x41')]=_[_0xe219('0x43')](db['ChatMessage'][_0xe219('0x3d')]);_0x56c9b9[_0xe219('0x42')]=_[_0xe219('0x43')](_0x241532[_0xe219('0x42')]);_0x56c9b9[_0xe219('0x44')]=_[_0xe219('0x45')](_0x56c9b9[_0xe219('0x41')],_0x56c9b9[_0xe219('0x42')]);_0x35f9e5['attributes']=_['intersection'](_0x56c9b9[_0xe219('0x41')],qs[_0xe219('0x47')](_0x241532[_0xe219('0x42')][_0xe219('0x47')]));_0x35f9e5[_0xe219('0x46')]=_0x35f9e5[_0xe219('0x46')][_0xe219('0x48')]?_0x35f9e5[_0xe219('0x46')]:_0x56c9b9[_0xe219('0x41')];if(_0x241532[_0xe219('0x42')][_0xe219('0x51')]){_0x35f9e5[_0xe219('0x52')]=[{'all':!![]}];}_0x35f9e5=_[_0xe219('0x4f')]({},_0x35f9e5,_0x241532['options']);return db[_0xe219('0x3c')][_0xe219('0x55')](_0x35f9e5)[_0xe219('0x37')](handleEntityNotFound(_0x5e6053,null))['then'](respondWithResult(_0x5e6053,null))[_0xe219('0x28')](handleError(_0x5e6053,null));};exports[_0xe219('0x56')]=function(_0x2108b5,_0x595b49){return db['ChatMessage'][_0xe219('0x56')](_0x2108b5['body'],{})[_0xe219('0x37')](respondWithResult(_0x595b49,0xc9))[_0xe219('0x28')](handleError(_0x595b49,null));};exports['update']=function(_0x14fd8b,_0x19a671){if(_0x14fd8b[_0xe219('0x57')]['id']){delete _0x14fd8b[_0xe219('0x57')]['id'];}return db['ChatMessage'][_0xe219('0x55')]({'where':{'id':_0x14fd8b['params']['id']}})[_0xe219('0x37')](handleEntityNotFound(_0x19a671,null))[_0xe219('0x37')](saveUpdates(_0x14fd8b['body'],null))[_0xe219('0x37')](respondWithResult(_0x19a671,null))[_0xe219('0x28')](handleError(_0x19a671,null));};exports['destroy']=function(_0x4ba463,_0x4f8949){return db[_0xe219('0x3c')][_0xe219('0x55')]({'where':{'id':_0x4ba463[_0xe219('0x58')]['id']}})[_0xe219('0x37')](handleEntityNotFound(_0x4f8949,null))['then'](removeEntity(_0x4f8949,null))['catch'](handleError(_0x4f8949,null));};exports[_0xe219('0x59')]=function(_0x374db7,_0x51ba18){return db[_0xe219('0x3c')]['describe']()[_0xe219('0x37')](respondWithResult(_0x51ba18,null))[_0xe219('0x28')](handleError(_0x51ba18,null));};var interaction_log=require(_0xe219('0x5a'))('chat-interactions');exports[_0xe219('0x5b')]=function(_0x1be055,_0x54ee10,_0xf8511e){var _0x6007ae={'agent':{},'channel':_0xe219('0x5c')};if(_0x1be055[_0xe219('0x57')]['id']){delete _0x1be055['body']['id'];}_0x1be055['body']['read']=!![];_0x1be055[_0xe219('0x57')][_0xe219('0x5d')]=moment()[_0xe219('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1be055[_0xe219('0x57')][_0xe219('0x5f')]=_0x1be055[_0xe219('0x57')][_0xe219('0x5f')]||_0x1be055[_0xe219('0x60')]['id'];_0x6007ae[_0xe219('0x61')]['id']=_0x1be055[_0xe219('0x57')][_0xe219('0x5f')];return db['ChatMessage']['find']({'where':{'id':_0x1be055[_0xe219('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x54ee10,null))[_0xe219('0x37')](saveUpdates(_0x1be055[_0xe219('0x57')],null))['then'](function(_0x248d58){if(_0x248d58){_0x6007ae[_0xe219('0x26')]=_0x248d58[_0xe219('0x62')]({'plain':!![]});return db[_0xe219('0x63')][_0xe219('0x55')]({'where':{'id':_0x248d58[_0xe219('0x64')]}});}return null;})[_0xe219('0x37')](handleEntityNotFound(_0x54ee10,null))[_0xe219('0x37')](function(_0x23725e){if(_0x23725e){return _0x23725e['update']({'UserId':_0x1be055[_0xe219('0x57')][_0xe219('0x5f')],'read1stAt':_[_0xe219('0x65')](_0x23725e[_0xe219('0x66')])?moment()[_0xe219('0x5e')](_0xe219('0x67')):undefined});}return null;})['then'](function(_0x439b6a){if(_0x439b6a){_0x6007ae[_0xe219('0x68')]=_0x439b6a['get']({'plain':!![]});interaction_log[_0xe219('0x1e')](_0xe219('0x69'),_0x1be055['user']['id'],_0x1be055['user'][_0xe219('0x39')],_0x1be055[_0xe219('0x60')][_0xe219('0x6a')],_0x6007ae[_0xe219('0x68')]['id'],_0x1be055['body']?JSON[_0xe219('0x22')](_0x1be055[_0xe219('0x57')]):_0xe219('0x6b'));return respondWithRpcPromise(_0xe219('0x6c'),_0xe219('0x6d'),_0x6007ae);}return null;})[_0xe219('0x37')](function(_0x1d882b){var _0xb615ea='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1d882b[_0xe219('0x26')]['ContactId'];return db['sequelize'][_0xe219('0x42')](_0xb615ea,{'type':db['Sequelize'][_0xe219('0x6e')]['SELECT'],'raw':!![]})[_0xe219('0x37')](function(_0x24703f){return _0x24703f;});})['then'](function(_0x197878){if(_0x197878){_0x6007ae[_0xe219('0x26')][_0xe219('0x6f')]=_0x197878[0x0];if(!_0x1be055[_0xe219('0x57')][_0xe219('0x5f')])return;return db[_0xe219('0x70')][_0xe219('0x55')]({'where':{'id':_0x1be055[_0xe219('0x57')][_0xe219('0x5f')],'role':_0xe219('0x61')},'attributes':['id',_0xe219('0x39'),_0xe219('0x71'),_0xe219('0x72'),_0xe219('0x73')],'raw':!![]});}return null;})['then'](function(_0x27840a){if(!_0x27840a)return null;_0x6007ae[_0xe219('0x26')][_0xe219('0x61')]=_0x27840a;return _0x6007ae;})[_0xe219('0x37')](function(_0x20bee7){if(_0x20bee7){if(_0x1be055[_0xe219('0x57')]['manual']){_0x6007ae['message'][_0xe219('0x74')]=util[_0xe219('0x5e')](_0xe219('0x75'),_0x1be055[_0xe219('0x60')]['name']);_0x6007ae[_0xe219('0x26')][_0xe219('0x76')]=_0x6007ae['channel'];_0x6007ae['message'][_0xe219('0x77')]=_0x6007ae['channel'];_0x6007ae[_0xe219('0x26')][_0xe219('0x78')]='accept';return respondWithRpcPromise(_0xe219('0x79'),_0xe219('0x79'),{'event':_0xe219('0x7a'),'message':_[_0xe219('0x4f')](_0x6007ae['message'],JSON[_0xe219('0x7b')](_0x6007ae[_0xe219('0x68')]['formData']))},client9002)['then'](function(){return _0x6007ae;});}return _0x6007ae;}return null;})[_0xe219('0x37')](respondWithResult(_0x54ee10,null))['catch'](handleError(_0x54ee10,null));};var interaction_log=require(_0xe219('0x5a'))(_0xe219('0x7c'));exports[_0xe219('0x34')]=function(_0x5bdb8e,_0x3c9e92,_0x519d69){var _0x13a16c={'agent':{},'channel':_0xe219('0x5c')};if(_0x5bdb8e[_0xe219('0x57')]['id']){delete _0x5bdb8e[_0xe219('0x57')]['id'];}_0x5bdb8e['body'][_0xe219('0x5f')]=_0x5bdb8e['body'][_0xe219('0x5f')]||_0x5bdb8e['user']['id'];_0x13a16c[_0xe219('0x61')]['id']=_0x5bdb8e[_0xe219('0x57')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x5bdb8e[_0xe219('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c9e92,null))[_0xe219('0x37')](function(_0x329050){if(_0x329050){_0x13a16c[_0xe219('0x26')]=_0x329050[_0xe219('0x62')]({'plain':!![]});return db[_0xe219('0x63')]['find']({'where':{'id':_0x329050['ChatInteractionId']}});}return null;})[_0xe219('0x37')](handleEntityNotFound(_0x3c9e92,null))[_0xe219('0x37')](function(_0x43a2e1){if(_0x43a2e1){_0x13a16c[_0xe219('0x68')]=_0x43a2e1[_0xe219('0x62')]({'plain':!![]});interaction_log[_0xe219('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bdb8e[_0xe219('0x60')]['id'],_0x5bdb8e[_0xe219('0x60')][_0xe219('0x39')],_0x5bdb8e[_0xe219('0x60')][_0xe219('0x6a')],_0x13a16c[_0xe219('0x68')]['id'],_0x5bdb8e[_0xe219('0x57')]?JSON[_0xe219('0x22')](_0x5bdb8e[_0xe219('0x57')]):_0xe219('0x6b'));return respondWithRpcPromise(_0xe219('0x7d'),'rejectMessage',_0x13a16c);}return null;})['then'](function(_0x49d161){var _0x4075ac='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49d161[_0xe219('0x26')]['ContactId'];return db[_0xe219('0x7e')][_0xe219('0x42')](_0x4075ac,{'type':db[_0xe219('0x7f')][_0xe219('0x6e')][_0xe219('0x80')],'raw':!![]})['then'](function(_0x7e46cb){return _0x7e46cb;});})[_0xe219('0x37')](function(_0x47a05e){if(_0x47a05e){_0x13a16c[_0xe219('0x26')][_0xe219('0x6f')]=_0x47a05e[0x0];if(!_0x5bdb8e[_0xe219('0x57')][_0xe219('0x5f')])return;return db[_0xe219('0x70')][_0xe219('0x55')]({'where':{'id':_0x5bdb8e[_0xe219('0x57')][_0xe219('0x5f')],'role':'agent'},'attributes':['id',_0xe219('0x39'),_0xe219('0x71'),_0xe219('0x72'),_0xe219('0x73')],'raw':!![]});}return null;})[_0xe219('0x37')](function(_0x25a36c){if(!_0x25a36c)return null;_0x13a16c[_0xe219('0x26')][_0xe219('0x61')]=_0x25a36c;return _0x13a16c;})[_0xe219('0x37')](function(_0xbd40a9){if(_0xbd40a9){_0xbd40a9['message']['interface']=util[_0xe219('0x5e')]('SIP/%s',_0x5bdb8e[_0xe219('0x60')][_0xe219('0x39')]);_0xbd40a9['message'][_0xe219('0x76')]=_0x13a16c[_0xe219('0x76')];_0xbd40a9['message'][_0xe219('0x77')]=_0x13a16c[_0xe219('0x76')];_0xbd40a9[_0xe219('0x26')][_0xe219('0x78')]=_0xe219('0x34');respondWithRpcPromise(_0xe219('0x79'),'EventManager',{'event':'rejectmessage','message':_[_0xe219('0x4f')](_0x13a16c[_0xe219('0x26')],JSON[_0xe219('0x7b')](_0x13a16c[_0xe219('0x68')][_0xe219('0x81')]))},client9002);return _0x13a16c;}return null;})[_0xe219('0x37')](respondWithResult(_0x3c9e92,null))[_0xe219('0x28')](handleError(_0x3c9e92,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index a13ae20..3fed642 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 _0xa0d0=['exports','../../mysqldb','ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x5436a4,_0x34ebc3){var _0x4b04b5=function(_0x3941c3){while(--_0x3941c3){_0x5436a4['push'](_0x5436a4['shift']());}};_0x4b04b5(++_0x34ebc3);}(_0xa0d0,0x141));var _0x0a0d=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa0d0[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0a0d('0x0'))['db'][_0x0a0d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0a0d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a0d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4b807c){return function(_0x5e67be,_0x215a10,_0x1c97c0){ChatMessageEvents[_0x0a0d('0x4')](_0x4b807c+':'+_0x5e67be['id'],_0x5e67be);ChatMessageEvents[_0x0a0d('0x4')](_0x4b807c,_0x5e67be);_0x1c97c0(null);};}for(var e in events){if(events[_0x0a0d('0x5')](e)){var event=events[e];ChatMessage[_0x0a0d('0x6')](e,emitEvent(event));}}module[_0x0a0d('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xceeb=['remove','emit','hook','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x4b9488,_0x4544d2){var _0x5f59b8=function(_0x275d00){while(--_0x275d00){_0x4b9488['push'](_0x4b9488['shift']());}};_0x5f59b8(++_0x4544d2);}(_0xceeb,0xb3));var _0xbcee=function(_0x50e38a,_0x10ae4e){_0x50e38a=_0x50e38a-0x0;var _0x1c4785=_0xceeb[_0x50e38a];return _0x1c4785;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xbcee('0x0'))['db'][_0xbcee('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbcee('0x2')](0x0);var events={'afterCreate':_0xbcee('0x3'),'afterUpdate':_0xbcee('0x4'),'afterDestroy':_0xbcee('0x5')};function emitEvent(_0x41def0){return function(_0x27ef66,_0x5295d2,_0x51ed81){ChatMessageEvents[_0xbcee('0x6')](_0x41def0+':'+_0x27ef66['id'],_0x27ef66);ChatMessageEvents[_0xbcee('0x6')](_0x41def0,_0x27ef66);_0x51ed81(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xbcee('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 5262be6..2d409fd 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 _0xd609=['chat_messages','fti_chat_messages','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xd609,0x10b));var _0x9d60=function(_0x3e5fc4,_0x4020d0){_0x3e5fc4=_0x3e5fc4-0x0;var _0x46a24f=_0xd609[_0x3e5fc4];return _0x46a24f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d60('0x0'))('api');var moment=require('moment');var BPromise=require(_0x9d60('0x1'));var rp=require(_0x9d60('0x2'));var fs=require('fs');var path=require(_0x9d60('0x3'));var rimraf=require(_0x9d60('0x4'));var config=require(_0x9d60('0x5'));var attributes=require('./chatMessage.attributes');module[_0x9d60('0x6')]=function(_0x43cabe,_0x43e863){return _0x43cabe[_0x9d60('0x7')]('ChatMessage',attributes,{'tableName':_0x9d60('0x8'),'paranoid':![],'indexes':[{'name':_0x9d60('0x9'),'fields':['body'],'type':_0x9d60('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ec976,_0x394c5a,_0x1e4777){var _0xea8934=_0x43cabe['models'];var _0x482528=_0x1ec976[_0x9d60('0xb')]({'plain':!![]});if(_0x482528['direction'][_0x9d60('0xc')]()==='in'||_0x482528[_0x9d60('0xd')]['toLowerCase']()===_0x9d60('0xe')&&!_0x482528[_0x9d60('0xf')]&&!_[_0x9d60('0x10')](_0x482528[_0x9d60('0x11')])){_0xea8934[_0x9d60('0x12')][_0x9d60('0x13')]({'where':{'id':_0x482528[_0x9d60('0x14')]}})[_0x9d60('0x15')](function(_0x1fe20d){if(_0x1fe20d){_0x1fe20d['update']({'lastMsgAt':_0x482528[_0x9d60('0x16')],'lastMsgDirection':_0x482528[_0x9d60('0xd')][_0x9d60('0xc')]()});}})[_0x9d60('0x17')](function(_0x5b080e){console['error'](_0x5b080e);});}_0x1e4777();}},'charset':_0x9d60('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xdade=['then','utf8mb4','lodash','api','moment','path','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId'];(function(_0x5d61e3,_0x5dd19a){var _0xc18c02=function(_0x1809c2){while(--_0x1809c2){_0x5d61e3['push'](_0x5d61e3['shift']());}};_0xc18c02(++_0x5dd19a);}(_0xdade,0x1e6));var _0xedad=function(_0x2467b8,_0x584199){_0x2467b8=_0x2467b8-0x0;var _0x5d3095=_0xdade[_0x2467b8];return _0x5d3095;};'use strict';var _=require(_0xedad('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xedad('0x1'));var moment=require(_0xedad('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xedad('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xedad('0x4'));module[_0xedad('0x5')]=function(_0x3ab906,_0x4df785){return _0x3ab906['define'](_0xedad('0x6'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xedad('0x7'),'fields':[_0xedad('0x8')],'type':_0xedad('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35df2d,_0x1486a0,_0x3f913e){var _0x4f5a21=_0x3ab906[_0xedad('0xa')];var _0x46d5f5=_0x35df2d[_0xedad('0xb')]({'plain':!![]});if(_0x46d5f5[_0xedad('0xc')][_0xedad('0xd')]()==='in'||_0x46d5f5[_0xedad('0xc')][_0xedad('0xd')]()===_0xedad('0xe')&&!_0x46d5f5[_0xedad('0xf')]&&!_[_0xedad('0x10')](_0x46d5f5[_0xedad('0x11')])){_0x4f5a21['ChatInteraction'][_0xedad('0x12')]({'where':{'id':_0x46d5f5[_0xedad('0x13')]}})[_0xedad('0x14')](function(_0x46074c){if(_0x46074c){_0x46074c['update']({'lastMsgAt':_0x46d5f5['createdAt'],'lastMsgDirection':_0x46d5f5[_0xedad('0xc')]['toLowerCase']()});}})['catch'](function(_0x31b750){console['error'](_0x31b750);});}_0x3f913e();}},'charset':_0xedad('0x15'),'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 eb0f9cc..2b5e621 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 _0xe27a=['error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','body','options','raw','then','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatMessage.socket','register','request','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x49e132,_0xaf827a){var _0x6403c2=function(_0x49888b){while(--_0x49888b){_0x49e132['push'](_0x49e132['shift']());}};_0x6403c2(++_0xaf827a);}(_0xe27a,0x6f));var _0xae27=function(_0x5d9089,_0x400e04){_0x5d9089=_0x5d9089-0x0;var _0x47191a=_0xe27a[_0x5d9089];return _0x47191a;};'use strict';var _=require(_0xae27('0x0'));var util=require(_0xae27('0x1'));var moment=require(_0xae27('0x2'));var BPromise=require(_0xae27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae27('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xae27('0x5'));var logger=require(_0xae27('0x6'))(_0xae27('0x7'));var config=require(_0xae27('0x8'));var jayson=require(_0xae27('0x9'));var client=jayson['client'][_0xae27('0xa')]({'port':0x232a});config['redis']=_[_0xae27('0xb')](config[_0xae27('0xc')],{'host':_0xae27('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xae27('0xe'))[_0xae27('0xf')](socket);function respondWithRpcPromise(_0xea2711,_0x152b64,_0x18c9c6){return new BPromise(function(_0x49c7a4,_0x3050ca){return client[_0xae27('0x10')](_0xea2711,_0x18c9c6)['then'](function(_0x5529df){logger['info']('ChatMessage,\x20%s,\x20%s',_0x152b64,'request\x20sent');logger[_0xae27('0x11')](_0xae27('0x12'),_0x152b64,_0xae27('0x13'),JSON[_0xae27('0x14')](_0x5529df));if(_0x5529df[_0xae27('0x15')]){if(_0x5529df['error'][_0xae27('0x16')]===0x1f4){logger[_0xae27('0x15')](_0xae27('0x17'),_0x152b64,_0x5529df[_0xae27('0x15')][_0xae27('0x18')]);return _0x3050ca(_0x5529df['error'][_0xae27('0x18')]);}logger[_0xae27('0x15')]('ChatMessage,\x20%s,\x20%s',_0x152b64,_0x5529df['error'][_0xae27('0x18')]);return _0x49c7a4(_0x5529df[_0xae27('0x15')][_0xae27('0x18')]);}else{logger[_0xae27('0x19')](_0xae27('0x17'),_0x152b64,'request\x20sent');_0x49c7a4(_0x5529df[_0xae27('0x1a')][_0xae27('0x18')]);}})[_0xae27('0x1b')](function(_0x40d7af){logger[_0xae27('0x15')]('ChatMessage,\x20%s,\x20%s',_0x152b64,_0x40d7af);_0x3050ca(_0x40d7af);});});}exports[_0xae27('0x1c')]=function(_0x362370){var _0x3c876b=this;return new Promise(function(_0x3dbda2,_0x54d099){return db['ChatMessage']['create'](_0x362370[_0xae27('0x1d')],{'raw':_0x362370[_0xae27('0x1e')]?_0x362370[_0xae27('0x1e')][_0xae27('0x1f')]===undefined?!![]:![]:!![]})[_0xae27('0x20')](function(_0x588777){logger[_0xae27('0x19')]('CreateChatMessage',_0x362370);logger[_0xae27('0x11')](_0xae27('0x1c'),_0x362370,JSON[_0xae27('0x14')](_0x588777));_0x3dbda2(_0x588777);})[_0xae27('0x1b')](function(_0x10c90b){logger[_0xae27('0x15')](_0xae27('0x1c'),_0x10c90b[_0xae27('0x18')],_0x362370);_0x54d099(_0x3c876b[_0xae27('0x15')](0x1f4,_0x10c90b[_0xae27('0x18')]));});});};
\ No newline at end of file
+var _0xf39e=['socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','then','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','defaults','redis','localhost'];(function(_0x437e08,_0x1cab6c){var _0xcf57f2=function(_0x2ef02e){while(--_0x2ef02e){_0x437e08['push'](_0x437e08['shift']());}};_0xcf57f2(++_0x1cab6c);}(_0xf39e,0x18b));var _0xef39=function(_0x258df0,_0x31ce33){_0x258df0=_0x258df0-0x0;var _0x2a96fe=_0xf39e[_0x258df0];return _0x2a96fe;};'use strict';var _=require(_0xef39('0x0'));var util=require(_0xef39('0x1'));var moment=require(_0xef39('0x2'));var BPromise=require('bluebird');var rs=require(_0xef39('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef39('0x4'))['db'];var utils=require(_0xef39('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xef39('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xef39('0x7')]['http']({'port':0x232a});config['redis']=_[_0xef39('0x8')](config[_0xef39('0x9')],{'host':_0xef39('0xa'),'port':0x18eb});var socket=require(_0xef39('0xb'))(new Redis(config[_0xef39('0x9')]));require(_0xef39('0xc'))[_0xef39('0xd')](socket);function respondWithRpcPromise(_0x475324,_0x4f5bf0,_0x22dcab){return new BPromise(function(_0x7db2cb,_0x6b306c){return client['request'](_0x475324,_0x22dcab)['then'](function(_0x236ef4){logger[_0xef39('0xe')](_0xef39('0xf'),_0x4f5bf0,'request\x20sent');logger['debug'](_0xef39('0x10'),_0x4f5bf0,_0xef39('0x11'),JSON['stringify'](_0x236ef4));if(_0x236ef4[_0xef39('0x12')]){if(_0x236ef4[_0xef39('0x12')]['code']===0x1f4){logger[_0xef39('0x12')](_0xef39('0xf'),_0x4f5bf0,_0x236ef4[_0xef39('0x12')][_0xef39('0x13')]);return _0x6b306c(_0x236ef4[_0xef39('0x12')][_0xef39('0x13')]);}logger[_0xef39('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4f5bf0,_0x236ef4[_0xef39('0x12')][_0xef39('0x13')]);return _0x7db2cb(_0x236ef4['error'][_0xef39('0x13')]);}else{logger['info'](_0xef39('0xf'),_0x4f5bf0,_0xef39('0x11'));_0x7db2cb(_0x236ef4[_0xef39('0x14')][_0xef39('0x13')]);}})[_0xef39('0x15')](function(_0x56d97a){logger[_0xef39('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4f5bf0,_0x56d97a);_0x6b306c(_0x56d97a);});});}exports[_0xef39('0x16')]=function(_0x79c8b2){var _0x1fec7f=this;return new Promise(function(_0x1bc3e8,_0x6ab6eb){return db[_0xef39('0x17')][_0xef39('0x18')](_0x79c8b2['body'],{'raw':_0x79c8b2[_0xef39('0x19')]?_0x79c8b2['options'][_0xef39('0x1a')]===undefined?!![]:![]:!![]})[_0xef39('0x1b')](function(_0x211abe){logger[_0xef39('0xe')](_0xef39('0x16'),_0x79c8b2);logger[_0xef39('0x1c')](_0xef39('0x16'),_0x79c8b2,JSON['stringify'](_0x211abe));_0x1bc3e8(_0x211abe);})[_0xef39('0x15')](function(_0x40a942){logger['error'](_0xef39('0x16'),_0x40a942[_0xef39('0x13')],_0x79c8b2);_0x6ab6eb(_0x1fec7f['error'](0x1f4,_0x40a942[_0xef39('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 998c6d5..5ee359e 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 _0x9f5a=['update','emit','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x379e3e,_0x5a7950){var _0x367c49=function(_0x1e2c8e){while(--_0x1e2c8e){_0x379e3e['push'](_0x379e3e['shift']());}};_0x367c49(++_0x5a7950);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x1f3074,_0x526a33){_0x1f3074=_0x1f3074-0x0;var _0x4c537f=_0x9f5a[_0x1f3074];return _0x4c537f;};'use strict';var ChatMessageEvents=require(_0xa9f5('0x0'));var events=[_0xa9f5('0x1'),_0xa9f5('0x2'),_0xa9f5('0x3')];function createListener(_0x546306,_0x4268b0){return function(_0x45e3f5){_0x4268b0[_0xa9f5('0x4')](_0x546306,_0x45e3f5);};}function removeListener(_0x4eeedd,_0x20f51f){return function(){ChatMessageEvents['removeListener'](_0x4eeedd,_0x20f51f);};}exports[_0xa9f5('0x5')]=function(_0x219e89){for(var _0x49e337=0x0,_0x6c040d=events[_0xa9f5('0x6')];_0x49e337<_0x6c040d;_0x49e337++){var _0x3f644f=events[_0x49e337];var _0x1f6c78=createListener(_0xa9f5('0x7')+_0x3f644f,_0x219e89);ChatMessageEvents['on'](_0x3f644f,_0x1f6c78);}};
\ No newline at end of file
+var _0x448b=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x1f5738,_0x351b9d){var _0x4e0aa3=function(_0x21614f){while(--_0x21614f){_0x1f5738['push'](_0x1f5738['shift']());}};_0x4e0aa3(++_0x351b9d);}(_0x448b,0x125));var _0xb448=function(_0x4095ab,_0x5f0de7){_0x4095ab=_0x4095ab-0x0;var _0x54dcd0=_0x448b[_0x4095ab];return _0x54dcd0;};'use strict';var ChatMessageEvents=require(_0xb448('0x0'));var events=[_0xb448('0x1'),_0xb448('0x2'),_0xb448('0x3')];function createListener(_0x422fa2,_0x51583a){return function(_0x5bf7db){_0x51583a[_0xb448('0x4')](_0x422fa2,_0x5bf7db);};}function removeListener(_0x32bcae,_0x172a89){return function(){ChatMessageEvents[_0xb448('0x5')](_0x32bcae,_0x172a89);};}exports[_0xb448('0x6')]=function(_0x276466){for(var _0x3670cb=0x0,_0x5993ad=events[_0xb448('0x7')];_0x3670cb<_0x5993ad;_0x3670cb++){var _0x2f6f82=events[_0x3670cb];var _0x2c2bdd=createListener(_0xb448('0x8')+_0x2f6f82,_0x276466);ChatMessageEvents['on'](_0x2f6f82,_0x2c2bdd);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 990b0ee..5de8cb8 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 _0x35a8=['../../config/environment','isAuthenticated','index','get','/:id','post','tracked','chat','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x35a8,0x1c1));var _0x835a=function(_0x41915e,_0x40be18){_0x41915e=_0x41915e-0x0;var _0x507810=_0x35a8[_0x41915e];return _0x507810;};'use strict';var multer=require(_0x835a('0x0'));var util=require(_0x835a('0x1'));var path=require(_0x835a('0x2'));var timeout=require(_0x835a('0x3'));var express=require(_0x835a('0x4'));var router=express['Router']();var fs_extra=require(_0x835a('0x5'));var auth=require(_0x835a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x835a('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x835a('0x8')](),controller[_0x835a('0x9')]);router[_0x835a('0xa')]('/describe',auth[_0x835a('0x8')](),controller['describe']);router[_0x835a('0xa')](_0x835a('0xb'),auth[_0x835a('0x8')](),controller['show']);router[_0x835a('0xc')]('/',auth[_0x835a('0x8')](),interaction[_0x835a('0xd')](_0x835a('0xe'),'chatmessage:create'),controller[_0x835a('0xf')]);router[_0x835a('0x10')]('/:id',controller[_0x835a('0x11')]);router[_0x835a('0x10')]('/:id/accept',auth['isAuthenticated'](),controller[_0x835a('0x12')]);router[_0x835a('0x10')](_0x835a('0x13'),auth['isAuthenticated'](),controller[_0x835a('0x14')]);router[_0x835a('0x15')](_0x835a('0xb'),auth['isAuthenticated'](),controller[_0x835a('0x16')]);module[_0x835a('0x17')]=router;
\ No newline at end of file
+var _0x464d=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','chatmessage:create','create','update','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x177b7b,_0x319e32){var _0x54e536=function(_0x1d2f05){while(--_0x1d2f05){_0x177b7b['push'](_0x177b7b['shift']());}};_0x54e536(++_0x319e32);}(_0x464d,0x15e));var _0xd464=function(_0x2a71d2,_0x35bcda){_0x2a71d2=_0x2a71d2-0x0;var _0x200112=_0x464d[_0x2a71d2];return _0x200112;};'use strict';var multer=require('multer');var util=require(_0xd464('0x0'));var path=require(_0xd464('0x1'));var timeout=require(_0xd464('0x2'));var express=require('express');var router=express[_0xd464('0x3')]();var fs_extra=require(_0xd464('0x4'));var auth=require(_0xd464('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd464('0x6'));var controller=require(_0xd464('0x7'));router['get']('/',auth[_0xd464('0x8')](),controller[_0xd464('0x9')]);router[_0xd464('0xa')](_0xd464('0xb'),auth[_0xd464('0x8')](),controller[_0xd464('0xc')]);router[_0xd464('0xa')](_0xd464('0xd'),auth['isAuthenticated'](),controller[_0xd464('0xe')]);router['post']('/',auth[_0xd464('0x8')](),interaction[_0xd464('0xf')]('chat',_0xd464('0x10')),controller[_0xd464('0x11')]);router['put'](_0xd464('0xd'),controller[_0xd464('0x12')]);router['put']('/:id/accept',auth[_0xd464('0x8')](),controller[_0xd464('0x13')]);router['put'](_0xd464('0x14'),auth['isAuthenticated'](),controller[_0xd464('0x15')]);router[_0xd464('0x16')](_0xd464('0xd'),auth[_0xd464('0x8')](),controller[_0xd464('0x17')]);module[_0xd464('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b63e8ae..4cbefb6 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x2ca200,_0x1e7fcd){var _0x4ef3d8=function(_0x3af46f){while(--_0x3af46f){_0x2ca200['push'](_0x2ca200['shift']());}};_0x4ef3d8(++_0x1e7fcd);}(_0xb10b,0x12a));var _0xbb10=function(_0x586115,_0x283bd2){_0x586115=_0x586115-0x0;var _0x221bac=_0xb10b[_0x586115];return _0x221bac;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x1f8e45,_0x386c27){var _0x41d697=function(_0x4d213b){while(--_0x4d213b){_0x1f8e45['push'](_0x1f8e45['shift']());}};_0x41d697(++_0x386c27);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f4d7f,_0x62f4b7){_0x2f4d7f=_0x2f4d7f-0x0;var _0x147ba1=_0xb10b[_0x2f4d7f];return _0x147ba1;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index cb503f2..222016f 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(_0x1b4bdb,_0x2eb3da){var _0x2097ca=function(_0x282e2f){while(--_0x282e2f){_0x1b4bdb['push'](_0x1b4bdb['shift']());}};_0x2097ca(++_0x2eb3da);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x47561b,_0x5d97db){var _0x218acd=function(_0xd0d9ac){while(--_0xd0d9ac){_0x47561b['push'](_0x47561b['shift']());}};_0x218acd(++_0x5d97db);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 56b5908..c63d6d3 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 _0x3432=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3432,0x199));var _0x2343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3432[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x2343('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x2343('0x1')](0x0);var events={'afterCreate':_0x2343('0x2'),'afterUpdate':_0x2343('0x3'),'afterDestroy':_0x2343('0x4')};function emitEvent(_0x54139b){return function(_0x3a26d0,_0x5d47b3,_0x27eecc){ChatOfflineMessageEvents['emit'](_0x54139b+':'+_0x3a26d0['id'],_0x3a26d0);ChatOfflineMessageEvents[_0x2343('0x5')](_0x54139b,_0x3a26d0);_0x27eecc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x2343('0x6')](e,emitEvent(event));}}module[_0x2343('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xd035=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x376ed9,_0x10d4c0){var _0x1cb970=function(_0xb9f837){while(--_0xb9f837){_0x376ed9['push'](_0x376ed9['shift']());}};_0x1cb970(++_0x10d4c0);}(_0xd035,0xdc));var _0x5d03=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0xd035[_0xdd0313];return _0x2bd7e8;};'use strict';var EventEmitter=require(_0x5d03('0x0'));var ChatOfflineMessage=require(_0x5d03('0x1'))['db'][_0x5d03('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5d03('0x3')](0x0);var events={'afterCreate':_0x5d03('0x4'),'afterUpdate':_0x5d03('0x5'),'afterDestroy':_0x5d03('0x6')};function emitEvent(_0x433e55){return function(_0x112aa1,_0x3c0aba,_0x33ddd8){ChatOfflineMessageEvents[_0x5d03('0x7')](_0x433e55+':'+_0x112aa1['id'],_0x112aa1);ChatOfflineMessageEvents['emit'](_0x433e55,_0x112aa1);_0x33ddd8(null);};}for(var e in events){if(events[_0x5d03('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x5d03('0x9')](e,emitEvent(event));}}module[_0x5d03('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 13f0ee4..48b75d2 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 _0xef19=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x33e4bb,_0x29c467){var _0x1be299=function(_0x1fbf59){while(--_0x1fbf59){_0x33e4bb['push'](_0x33e4bb['shift']());}};_0x1be299(++_0x29c467);}(_0xef19,0x162));var _0x9ef1=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0xef19[_0x3a8db5];return _0x2c03cd;};'use strict';var attributes=require(_0x9ef1('0x0'));module[_0x9ef1('0x1')]=function(_0x55a85c){return _0x55a85c['define'](_0x9ef1('0x2'),attributes,{'tableName':_0x9ef1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ef1('0x4'),'collate':_0x9ef1('0x5')});};
\ No newline at end of file
+var _0xf5c8=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf5c8,0xd1));var _0x8f5c=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0xf5c8[_0x211632];return _0x5a1da1;};'use strict';var attributes=require(_0x8f5c('0x0'));module['exports']=function(_0x52db7b){return _0x52db7b['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8f5c('0x1'),'collate':_0x8f5c('0x2')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 9d4f0cf..7c30969 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 _0x2882=['request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x1f0e64,_0x97f73f){var _0xab203c=function(_0x16a85a){while(--_0x16a85a){_0x1f0e64['push'](_0x1f0e64['shift']());}};_0xab203c(++_0x97f73f);}(_0x2882,0x1db));var _0x2288=function(_0x2b0a75,_0x9c00a4){_0x2b0a75=_0x2b0a75-0x0;var _0x29e278=_0x2882[_0x2b0a75];return _0x29e278;};'use strict';var _=require(_0x2288('0x0'));var util=require('util');var moment=require(_0x2288('0x1'));var BPromise=require(_0x2288('0x2'));var rs=require(_0x2288('0x3'));var fs=require('fs');var Redis=require(_0x2288('0x4'));var db=require(_0x2288('0x5'))['db'];var utils=require(_0x2288('0x6'));var logger=require(_0x2288('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2288('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x162771,_0x35acd6,_0x2d84ff){return new BPromise(function(_0x5ea93d,_0x4d251b){return client['request'](_0x162771,_0x2d84ff)['then'](function(_0x42f1b0){logger[_0x2288('0x9')](_0x2288('0xa'),_0x35acd6,_0x2288('0xb'));logger[_0x2288('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x35acd6,_0x2288('0xb'),JSON['stringify'](_0x42f1b0));if(_0x42f1b0['error']){if(_0x42f1b0[_0x2288('0xd')][_0x2288('0xe')]===0x1f4){logger[_0x2288('0xd')](_0x2288('0xa'),_0x35acd6,_0x42f1b0[_0x2288('0xd')][_0x2288('0xf')]);return _0x4d251b(_0x42f1b0[_0x2288('0xd')][_0x2288('0xf')]);}logger[_0x2288('0xd')](_0x2288('0xa'),_0x35acd6,_0x42f1b0[_0x2288('0xd')]['message']);return _0x5ea93d(_0x42f1b0[_0x2288('0xd')][_0x2288('0xf')]);}else{logger[_0x2288('0x9')](_0x2288('0xa'),_0x35acd6,_0x2288('0xb'));_0x5ea93d(_0x42f1b0[_0x2288('0x10')][_0x2288('0xf')]);}})[_0x2288('0x11')](function(_0x39805d){logger['error'](_0x2288('0xa'),_0x35acd6,_0x39805d);_0x4d251b(_0x39805d);});});}
\ No newline at end of file
+var _0xa4c2=['http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1a9740,_0x3cfd32){var _0x383ff6=function(_0x1dd73c){while(--_0x1dd73c){_0x1a9740['push'](_0x1a9740['shift']());}};_0x383ff6(++_0x3cfd32);}(_0xa4c2,0xc1));var _0x2a4c=function(_0x246694,_0x50cae1){_0x246694=_0x246694-0x0;var _0x38f821=_0xa4c2[_0x246694];return _0x38f821;};'use strict';var _=require(_0x2a4c('0x0'));var util=require('util');var moment=require(_0x2a4c('0x1'));var BPromise=require('bluebird');var rs=require(_0x2a4c('0x2'));var fs=require('fs');var Redis=require(_0x2a4c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2a4c('0x4'))('rpc');var config=require(_0x2a4c('0x5'));var jayson=require(_0x2a4c('0x6'));var client=jayson['client'][_0x2a4c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d2511,_0x9f8993,_0x41dfad){return new BPromise(function(_0x1f86e5,_0x25f1d3){return client['request'](_0x3d2511,_0x41dfad)[_0x2a4c('0x8')](function(_0x37f2c4){logger[_0x2a4c('0x9')](_0x2a4c('0xa'),_0x9f8993,_0x2a4c('0xb'));logger[_0x2a4c('0xc')](_0x2a4c('0xd'),_0x9f8993,'request\x20sent',JSON[_0x2a4c('0xe')](_0x37f2c4));if(_0x37f2c4['error']){if(_0x37f2c4['error'][_0x2a4c('0xf')]===0x1f4){logger[_0x2a4c('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x9f8993,_0x37f2c4[_0x2a4c('0x10')][_0x2a4c('0x11')]);return _0x25f1d3(_0x37f2c4['error'][_0x2a4c('0x11')]);}logger['error'](_0x2a4c('0xa'),_0x9f8993,_0x37f2c4['error'][_0x2a4c('0x11')]);return _0x1f86e5(_0x37f2c4[_0x2a4c('0x10')]['message']);}else{logger[_0x2a4c('0x9')](_0x2a4c('0xa'),_0x9f8993,'request\x20sent');_0x1f86e5(_0x37f2c4[_0x2a4c('0x12')][_0x2a4c('0x11')]);}})[_0x2a4c('0x13')](function(_0x47921d){logger[_0x2a4c('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x9f8993,_0x47921d);_0x25f1d3(_0x47921d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 8eec4fd..cb2edb0 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 _0x23b5=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x149383,_0x1ced93){var _0x3d1893=function(_0x778422){while(--_0x778422){_0x149383['push'](_0x149383['shift']());}};_0x3d1893(++_0x1ced93);}(_0x23b5,0x104));var _0x523b=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0x23b5[_0xf168d3];return _0x17fb54;};'use strict';var multer=require('multer');var util=require(_0x523b('0x0'));var path=require(_0x523b('0x1'));var timeout=require('connect-timeout');var express=require(_0x523b('0x2'));var router=express[_0x523b('0x3')]();var fs_extra=require(_0x523b('0x4'));var auth=require(_0x523b('0x5'));var interaction=require(_0x523b('0x6'));var config=require(_0x523b('0x7'));var controller=require(_0x523b('0x8'));router[_0x523b('0x9')]('/',auth[_0x523b('0xa')](),controller[_0x523b('0xb')]);router['get'](_0x523b('0xc'),auth[_0x523b('0xa')](),controller['describe']);router[_0x523b('0x9')](_0x523b('0xd'),auth[_0x523b('0xa')](),controller['show']);router['post']('/',auth[_0x523b('0xa')](),controller[_0x523b('0xe')]);router[_0x523b('0xf')](_0x523b('0xd'),auth[_0x523b('0xa')](),controller[_0x523b('0x10')]);router['delete'](_0x523b('0xd'),auth['isAuthenticated'](),controller[_0x523b('0x11')]);module[_0x523b('0x12')]=router;
\ No newline at end of file
+var _0x824c=['create','put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x342628,_0xf4352e){var _0x3affa7=function(_0x179e0c){while(--_0x179e0c){_0x342628['push'](_0x342628['shift']());}};_0x3affa7(++_0xf4352e);}(_0x824c,0x6d));var _0xc824=function(_0x2b6730,_0x1bab44){_0x2b6730=_0x2b6730-0x0;var _0x5b6403=_0x824c[_0x2b6730];return _0x5b6403;};'use strict';var multer=require(_0xc824('0x0'));var util=require(_0xc824('0x1'));var path=require(_0xc824('0x2'));var timeout=require(_0xc824('0x3'));var express=require(_0xc824('0x4'));var router=express['Router']();var fs_extra=require(_0xc824('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc824('0x6'));var config=require(_0xc824('0x7'));var controller=require(_0xc824('0x8'));router[_0xc824('0x9')]('/',auth[_0xc824('0xa')](),controller[_0xc824('0xb')]);router[_0xc824('0x9')](_0xc824('0xc'),auth[_0xc824('0xa')](),controller[_0xc824('0xd')]);router[_0xc824('0x9')](_0xc824('0xe'),auth[_0xc824('0xa')](),controller[_0xc824('0xf')]);router[_0xc824('0x10')]('/',auth[_0xc824('0xa')](),controller[_0xc824('0x11')]);router[_0xc824('0x12')](_0xc824('0xe'),auth[_0xc824('0xa')](),controller['update']);router[_0xc824('0x13')]('/:id',auth[_0xc824('0xa')](),controller[_0xc824('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 83a1b0b..f463d89 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 _0x793c=['timeout','INTEGER','exports','STRING','mouseOver'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x793c,0x124));var _0xc793=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x793c[_0x411017];return _0x2adeea;};'use strict';var Sequelize=require('sequelize');module[_0xc793('0x0')]={'name':{'type':Sequelize[_0xc793('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc793('0x2'),_0xc793('0x3')),'defaultValue':_0xc793('0x2')},'selector':{'type':Sequelize[_0xc793('0x1')]},'timeout':{'type':Sequelize[_0xc793('0x4')]}};
\ No newline at end of file
+var _0x9c1f=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x3aa2f5,_0x286fa0){var _0x43cf17=function(_0x7695f5){while(--_0x7695f5){_0x3aa2f5['push'](_0x3aa2f5['shift']());}};_0x43cf17(++_0x286fa0);}(_0x9c1f,0xa2));var _0xf9c1=function(_0x1a6ef7,_0x6bb449){_0x1a6ef7=_0x1a6ef7-0x0;var _0x4f0d4b=_0x9c1f[_0x1a6ef7];return _0x4f0d4b;};'use strict';var Sequelize=require(_0xf9c1('0x0'));module[_0xf9c1('0x1')]={'name':{'type':Sequelize[_0xf9c1('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf9c1('0x3'),_0xf9c1('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xf9c1('0x2')]},'timeout':{'type':Sequelize[_0xf9c1('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index aff85bb..e6f63b3 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 _0x6726=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','sendStatus','error','name','params','keys','rawAttributes','query','filters','model','intersection','fields','attributes','length','include','options','ChatProactiveAction','find','catch','body','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x90795c,_0x1ddffe){var _0x51a942=function(_0x3eb04d){while(--_0x3eb04d){_0x90795c['push'](_0x90795c['shift']());}};_0x51a942(++_0x1ddffe);}(_0x6726,0xdb));var _0x6672=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x6726[_0x15fc7a];return _0x3aa9f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6672('0x0'));var zipdir=require(_0x6672('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6672('0x2'));var moment=require(_0x6672('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6672('0x4'));var util=require('util');var path=require(_0x6672('0x5'));var sox=require(_0x6672('0x6'));var csv=require(_0x6672('0x7'));var ejs=require(_0x6672('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6672('0x9'));var squel=require(_0x6672('0xa'));var crypto=require(_0x6672('0xb'));var jsforce=require(_0x6672('0xc'));var deskjs=require(_0x6672('0xd'));var toCsv=require(_0x6672('0x7'));var querystring=require(_0x6672('0xe'));var Papa=require(_0x6672('0xf'));var Redis=require(_0x6672('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6672('0x11'));var as=require(_0x6672('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6672('0x13'))(_0x6672('0x14'));var utils=require(_0x6672('0x15'));var config=require(_0x6672('0x16'));var licenseUtil=require(_0x6672('0x17'));var db=require(_0x6672('0x18'))['db'];function respondWithStatusCode(_0x182b77,_0x2dbf18){_0x2dbf18=_0x2dbf18||0xcc;return function(_0x2ec0bd){if(_0x2ec0bd){return _0x182b77['sendStatus'](_0x2dbf18);}return _0x182b77[_0x6672('0x19')](_0x2dbf18)[_0x6672('0x1a')]();};}function respondWithResult(_0x3e45de,_0x40f310){_0x40f310=_0x40f310||0xc8;return function(_0x1e3eb0){if(_0x1e3eb0){return _0x3e45de[_0x6672('0x19')](_0x40f310)[_0x6672('0x1b')](_0x1e3eb0);}};}function respondWithFilteredResult(_0x514097,_0xbf2cce){return function(_0x3261c9){if(_0x3261c9){var _0x46b6cb=typeof _0xbf2cce[_0x6672('0x1c')]===_0x6672('0x1d')&&typeof _0xbf2cce[_0x6672('0x1e')]===_0x6672('0x1d');var _0x184a79=_0x3261c9['count'];var _0x1a6d2a=_0x46b6cb?0x0:_0xbf2cce[_0x6672('0x1c')];var _0x344300=_0x46b6cb?_0x3261c9[_0x6672('0x1f')]:_0xbf2cce['offset']+_0xbf2cce[_0x6672('0x1e')];var _0x52b617;if(_0x344300>=_0x184a79){_0x344300=_0x184a79;_0x52b617=0xc8;}else{_0x52b617=0xce;}_0x514097[_0x6672('0x19')](_0x52b617);return _0x514097['set'](_0x6672('0x20'),_0x1a6d2a+'-'+_0x344300+'/'+_0x184a79)[_0x6672('0x1b')](_0x3261c9);}return null;};}function patchUpdates(_0x50e8c2){return function(_0x636fed){try{jsonpatch[_0x6672('0x21')](_0x636fed,_0x50e8c2,!![]);}catch(_0x3c23d5){return BPromise['reject'](_0x3c23d5);}return _0x636fed['save']();};}function saveUpdates(_0x1b221c,_0x12fa16){return function(_0x255212){if(_0x255212){return _0x255212[_0x6672('0x22')](_0x1b221c)[_0x6672('0x23')](function(_0xd2d057){return _0xd2d057;});}return null;};}function removeEntity(_0x35e285,_0x124bb5){return function(_0x1252de){if(_0x1252de){return _0x1252de[_0x6672('0x24')]()[_0x6672('0x23')](function(){_0x35e285[_0x6672('0x19')](0xcc)[_0x6672('0x1a')]();});}};}function handleEntityNotFound(_0x1c2886,_0x387614){return function(_0x37e76e){if(!_0x37e76e){_0x1c2886[_0x6672('0x25')](0x194);}return _0x37e76e;};}function handleError(_0x19d58c,_0x1f4c29){_0x1f4c29=_0x1f4c29||0x1f4;return function(_0x4ed516){logger[_0x6672('0x26')](_0x4ed516['stack']);if(_0x4ed516[_0x6672('0x27')]){delete _0x4ed516['name'];}_0x19d58c[_0x6672('0x19')](_0x1f4c29)['send'](_0x4ed516);};}exports['show']=function(_0x4fcd14,_0x302306){var _0x39da71={'raw':!![],'where':{'id':_0x4fcd14[_0x6672('0x28')]['id']}},_0x2a3e42={};_0x2a3e42['model']=_[_0x6672('0x29')](db['ChatProactiveAction'][_0x6672('0x2a')]);_0x2a3e42[_0x6672('0x2b')]=_[_0x6672('0x29')](_0x4fcd14['query']);_0x2a3e42[_0x6672('0x2c')]=_['intersection'](_0x2a3e42[_0x6672('0x2d')],_0x2a3e42['query']);_0x39da71['attributes']=_[_0x6672('0x2e')](_0x2a3e42[_0x6672('0x2d')],qs[_0x6672('0x2f')](_0x4fcd14[_0x6672('0x2b')][_0x6672('0x2f')]));_0x39da71[_0x6672('0x30')]=_0x39da71[_0x6672('0x30')][_0x6672('0x31')]?_0x39da71[_0x6672('0x30')]:_0x2a3e42[_0x6672('0x2d')];if(_0x4fcd14[_0x6672('0x2b')]['includeAll']){_0x39da71[_0x6672('0x32')]=[{'all':!![]}];}_0x39da71=_['merge']({},_0x39da71,_0x4fcd14[_0x6672('0x33')]);return db[_0x6672('0x34')][_0x6672('0x35')](_0x39da71)['then'](handleEntityNotFound(_0x302306,null))[_0x6672('0x23')](respondWithResult(_0x302306,null))[_0x6672('0x36')](handleError(_0x302306,null));};exports['create']=function(_0x4c5849,_0x4fbe1a){return db['ChatProactiveAction']['create'](_0x4c5849['body'],{})['then'](respondWithResult(_0x4fbe1a,0xc9))[_0x6672('0x36')](handleError(_0x4fbe1a,null));};exports[_0x6672('0x22')]=function(_0x21571e,_0x3da7b8){if(_0x21571e[_0x6672('0x37')]['id']){delete _0x21571e['body']['id'];}return db[_0x6672('0x34')][_0x6672('0x35')]({'where':{'id':_0x21571e['params']['id']}})[_0x6672('0x23')](handleEntityNotFound(_0x3da7b8,null))['then'](saveUpdates(_0x21571e[_0x6672('0x37')],null))['then'](respondWithResult(_0x3da7b8,null))['catch'](handleError(_0x3da7b8,null));};exports[_0x6672('0x24')]=function(_0x2856be,_0x53a382){return db[_0x6672('0x34')]['find']({'where':{'id':_0x2856be[_0x6672('0x28')]['id']}})[_0x6672('0x23')](handleEntityNotFound(_0x53a382,null))[_0x6672('0x23')](removeEntity(_0x53a382,null))['catch'](handleError(_0x53a382,null));};
\ No newline at end of file
+var _0xce1a=['name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','create','body','find','params','eml-format','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce1a,0xbf));var _0xace1=function(_0xdd5f90,_0x39278f){_0xdd5f90=_0xdd5f90-0x0;var _0x1df94d=_0xce1a[_0xdd5f90];return _0x1df94d;};'use strict';var emlformat=require(_0xace1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xace1('0x1'));var moment=require(_0xace1('0x2'));var BPromise=require(_0xace1('0x3'));var Mustache=require(_0xace1('0x4'));var util=require(_0xace1('0x5'));var path=require('path');var sox=require(_0xace1('0x6'));var csv=require('to-csv');var ejs=require(_0xace1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xace1('0x8'));var squel=require(_0xace1('0x9'));var crypto=require(_0xace1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xace1('0xb'));var querystring=require('querystring');var Papa=require(_0xace1('0xc'));var Redis=require(_0xace1('0xd'));var authService=require(_0xace1('0xe'));var qs=require(_0xace1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xace1('0x10'));var logger=require(_0xace1('0x11'))('api');var utils=require(_0xace1('0x12'));var config=require(_0xace1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d771,_0x2e1d19){_0x2e1d19=_0x2e1d19||0xcc;return function(_0x2f59f3){if(_0x2f59f3){return _0x56d771[_0xace1('0x14')](_0x2e1d19);}return _0x56d771['status'](_0x2e1d19)['end']();};}function respondWithResult(_0x4e8389,_0x319d1a){_0x319d1a=_0x319d1a||0xc8;return function(_0x18d9ce){if(_0x18d9ce){return _0x4e8389[_0xace1('0x15')](_0x319d1a)[_0xace1('0x16')](_0x18d9ce);}};}function respondWithFilteredResult(_0x248193,_0x303080){return function(_0x25114d){if(_0x25114d){var _0x6cc04e=typeof _0x303080['offset']==='undefined'&&typeof _0x303080[_0xace1('0x17')]===_0xace1('0x18');var _0x49cb73=_0x25114d[_0xace1('0x19')];var _0x162a79=_0x6cc04e?0x0:_0x303080[_0xace1('0x1a')];var _0x45541e=_0x6cc04e?_0x25114d[_0xace1('0x19')]:_0x303080['offset']+_0x303080['limit'];var _0x1781aa;if(_0x45541e>=_0x49cb73){_0x45541e=_0x49cb73;_0x1781aa=0xc8;}else{_0x1781aa=0xce;}_0x248193['status'](_0x1781aa);return _0x248193[_0xace1('0x1b')](_0xace1('0x1c'),_0x162a79+'-'+_0x45541e+'/'+_0x49cb73)[_0xace1('0x16')](_0x25114d);}return null;};}function patchUpdates(_0x4fe2ba){return function(_0x183941){try{jsonpatch[_0xace1('0x1d')](_0x183941,_0x4fe2ba,!![]);}catch(_0x4fce58){return BPromise[_0xace1('0x1e')](_0x4fce58);}return _0x183941[_0xace1('0x1f')]();};}function saveUpdates(_0xe0bda8,_0x41ab2b){return function(_0x484ac1){if(_0x484ac1){return _0x484ac1[_0xace1('0x20')](_0xe0bda8)[_0xace1('0x21')](function(_0x15f2fb){return _0x15f2fb;});}return null;};}function removeEntity(_0x324b52,_0x120c33){return function(_0x9ff8a0){if(_0x9ff8a0){return _0x9ff8a0[_0xace1('0x22')]()[_0xace1('0x21')](function(){_0x324b52[_0xace1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e99f5,_0x49cacb){return function(_0x937188){if(!_0x937188){_0x5e99f5[_0xace1('0x14')](0x194);}return _0x937188;};}function handleError(_0x4985b2,_0xe8723c){_0xe8723c=_0xe8723c||0x1f4;return function(_0x51ab2c){logger[_0xace1('0x23')](_0x51ab2c[_0xace1('0x24')]);if(_0x51ab2c[_0xace1('0x25')]){delete _0x51ab2c[_0xace1('0x25')];}_0x4985b2['status'](_0xe8723c)['send'](_0x51ab2c);};}exports[_0xace1('0x26')]=function(_0x455286,_0x1dacd0){var _0x2677da={'raw':!![],'where':{'id':_0x455286['params']['id']}},_0x4f52a9={};_0x4f52a9[_0xace1('0x27')]=_[_0xace1('0x28')](db[_0xace1('0x29')][_0xace1('0x2a')]);_0x4f52a9[_0xace1('0x2b')]=_[_0xace1('0x28')](_0x455286[_0xace1('0x2b')]);_0x4f52a9[_0xace1('0x2c')]=_[_0xace1('0x2d')](_0x4f52a9[_0xace1('0x27')],_0x4f52a9[_0xace1('0x2b')]);_0x2677da[_0xace1('0x2e')]=_[_0xace1('0x2d')](_0x4f52a9[_0xace1('0x27')],qs['fields'](_0x455286['query'][_0xace1('0x2f')]));_0x2677da['attributes']=_0x2677da[_0xace1('0x2e')][_0xace1('0x30')]?_0x2677da[_0xace1('0x2e')]:_0x4f52a9[_0xace1('0x27')];if(_0x455286[_0xace1('0x2b')][_0xace1('0x31')]){_0x2677da['include']=[{'all':!![]}];}_0x2677da=_[_0xace1('0x32')]({},_0x2677da,_0x455286[_0xace1('0x33')]);return db[_0xace1('0x29')]['find'](_0x2677da)['then'](handleEntityNotFound(_0x1dacd0,null))[_0xace1('0x21')](respondWithResult(_0x1dacd0,null))[_0xace1('0x34')](handleError(_0x1dacd0,null));};exports[_0xace1('0x35')]=function(_0x626aea,_0x37757a){return db[_0xace1('0x29')][_0xace1('0x35')](_0x626aea[_0xace1('0x36')],{})[_0xace1('0x21')](respondWithResult(_0x37757a,0xc9))[_0xace1('0x34')](handleError(_0x37757a,null));};exports[_0xace1('0x20')]=function(_0x3b6557,_0x374a11){if(_0x3b6557['body']['id']){delete _0x3b6557['body']['id'];}return db['ChatProactiveAction'][_0xace1('0x37')]({'where':{'id':_0x3b6557[_0xace1('0x38')]['id']}})['then'](handleEntityNotFound(_0x374a11,null))[_0xace1('0x21')](saveUpdates(_0x3b6557[_0xace1('0x36')],null))[_0xace1('0x21')](respondWithResult(_0x374a11,null))[_0xace1('0x34')](handleError(_0x374a11,null));};exports[_0xace1('0x22')]=function(_0x5308da,_0x5112dc){return db['ChatProactiveAction'][_0xace1('0x37')]({'where':{'id':_0x5308da[_0xace1('0x38')]['id']}})[_0xace1('0x21')](handleEntityNotFound(_0x5112dc,null))[_0xace1('0x21')](removeEntity(_0x5112dc,null))['catch'](handleError(_0x5112dc,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7a10ddc..6c45b58 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 _0x86c0=['bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x40e870,_0x36d230){var _0x39f73e=function(_0x4feb39){while(--_0x4feb39){_0x40e870['push'](_0x40e870['shift']());}};_0x39f73e(++_0x36d230);}(_0x86c0,0x181));var _0x086c=function(_0x29ecdd,_0x22df23){_0x29ecdd=_0x29ecdd-0x0;var _0x5718ee=_0x86c0[_0x29ecdd];return _0x5718ee;};'use strict';var _=require(_0x086c('0x0'));var util=require(_0x086c('0x1'));var logger=require(_0x086c('0x2'))(_0x086c('0x3'));var moment=require(_0x086c('0x4'));var BPromise=require(_0x086c('0x5'));var rp=require(_0x086c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x086c('0x7'));var config=require(_0x086c('0x8'));var attributes=require(_0x086c('0x9'));module[_0x086c('0xa')]=function(_0x46b7c9,_0x50f8e5){return _0x46b7c9[_0x086c('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x086c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x504b=['moment','request-promise','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x262baa,_0x283058){var _0x4f2257=function(_0x2cd1c6){while(--_0x2cd1c6){_0x262baa['push'](_0x262baa['shift']());}};_0x4f2257(++_0x283058);}(_0x504b,0x97));var _0xb504=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x504b[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb504('0x0'));var util=require(_0xb504('0x1'));var logger=require(_0xb504('0x2'))('api');var moment=require(_0xb504('0x3'));var BPromise=require('bluebird');var rp=require(_0xb504('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb504('0x5'));var config=require(_0xb504('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0xb504('0x7')]=function(_0x6319e7,_0x2b6627){return _0x6319e7[_0xb504('0x8')](_0xb504('0x9'),attributes,{'tableName':_0xb504('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index a7dbd4a..2bc943e 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 _0x9450=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x1f9f0e,_0x27547b){var _0x521d92=function(_0x5e0978){while(--_0x5e0978){_0x1f9f0e['push'](_0x1f9f0e['shift']());}};_0x521d92(++_0x27547b);}(_0x9450,0xcd));var _0x0945=function(_0x23ea67,_0x4774c3){_0x23ea67=_0x23ea67-0x0;var _0x234ff6=_0x9450[_0x23ea67];return _0x234ff6;};'use strict';var _=require(_0x0945('0x0'));var util=require('util');var moment=require(_0x0945('0x1'));var BPromise=require(_0x0945('0x2'));var rs=require(_0x0945('0x3'));var fs=require('fs');var Redis=require(_0x0945('0x4'));var db=require(_0x0945('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0945('0x6'))(_0x0945('0x7'));var config=require(_0x0945('0x8'));var jayson=require(_0x0945('0x9'));var client=jayson[_0x0945('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe6127f,_0x200b8f,_0x2aad7c){return new BPromise(function(_0x17101b,_0x47e813){return client[_0x0945('0xb')](_0xe6127f,_0x2aad7c)[_0x0945('0xc')](function(_0x4779c7){logger[_0x0945('0xd')](_0x0945('0xe'),_0x200b8f,_0x0945('0xf'));logger[_0x0945('0x10')](_0x0945('0x11'),_0x200b8f,_0x0945('0xf'),JSON[_0x0945('0x12')](_0x4779c7));if(_0x4779c7['error']){if(_0x4779c7[_0x0945('0x13')]['code']===0x1f4){logger[_0x0945('0x13')](_0x0945('0xe'),_0x200b8f,_0x4779c7[_0x0945('0x13')][_0x0945('0x14')]);return _0x47e813(_0x4779c7[_0x0945('0x13')][_0x0945('0x14')]);}logger[_0x0945('0x13')](_0x0945('0xe'),_0x200b8f,_0x4779c7[_0x0945('0x13')][_0x0945('0x14')]);return _0x17101b(_0x4779c7[_0x0945('0x13')]['message']);}else{logger[_0x0945('0xd')](_0x0945('0xe'),_0x200b8f,'request\x20sent');_0x17101b(_0x4779c7[_0x0945('0x15')][_0x0945('0x14')]);}})['catch'](function(_0x3758ed){logger[_0x0945('0x13')](_0x0945('0xe'),_0x200b8f,_0x3758ed);_0x47e813(_0x3758ed);});});}
\ No newline at end of file
+var _0x663d=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3c7ee5,_0x11bc4c){var _0x202a66=function(_0x1fe31d){while(--_0x1fe31d){_0x3c7ee5['push'](_0x3c7ee5['shift']());}};_0x202a66(++_0x11bc4c);}(_0x663d,0x1d2));var _0xd663=function(_0xdb94db,_0x281c43){_0xdb94db=_0xdb94db-0x0;var _0x567bdb=_0x663d[_0xdb94db];return _0x567bdb;};'use strict';var _=require(_0xd663('0x0'));var util=require(_0xd663('0x1'));var moment=require(_0xd663('0x2'));var BPromise=require(_0xd663('0x3'));var rs=require(_0xd663('0x4'));var fs=require('fs');var Redis=require(_0xd663('0x5'));var db=require(_0xd663('0x6'))['db'];var utils=require(_0xd663('0x7'));var logger=require(_0xd663('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd663('0x9')][_0xd663('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x66a9b8,_0x2a6b93,_0x231932){return new BPromise(function(_0x407088,_0x159cc1){return client['request'](_0x66a9b8,_0x231932)[_0xd663('0xb')](function(_0x2b0244){logger[_0xd663('0xc')](_0xd663('0xd'),_0x2a6b93,_0xd663('0xe'));logger[_0xd663('0xf')](_0xd663('0x10'),_0x2a6b93,_0xd663('0xe'),JSON[_0xd663('0x11')](_0x2b0244));if(_0x2b0244[_0xd663('0x12')]){if(_0x2b0244[_0xd663('0x12')][_0xd663('0x13')]===0x1f4){logger[_0xd663('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2a6b93,_0x2b0244[_0xd663('0x12')][_0xd663('0x14')]);return _0x159cc1(_0x2b0244[_0xd663('0x12')][_0xd663('0x14')]);}logger[_0xd663('0x12')](_0xd663('0xd'),_0x2a6b93,_0x2b0244[_0xd663('0x12')]['message']);return _0x407088(_0x2b0244[_0xd663('0x12')][_0xd663('0x14')]);}else{logger[_0xd663('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x2a6b93,_0xd663('0xe'));_0x407088(_0x2b0244[_0xd663('0x15')]['message']);}})['catch'](function(_0x59ea3d){logger[_0xd663('0x12')](_0xd663('0xd'),_0x2a6b93,_0x59ea3d);_0x159cc1(_0x59ea3d);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 636eb86..6d2dfce 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 _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x2133a1,_0x561b0a){var _0x4773e7=function(_0x2f2008){while(--_0x2f2008){_0x2133a1['push'](_0x2133a1['shift']());}};_0x4773e7(++_0x561b0a);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x37b196,_0x352342){_0x37b196=_0x37b196-0x0;var _0x1c0119=_0xdbf5[_0x37b196];return _0x1c0119;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x3d43c4,_0x3e421b){var _0x382f66=function(_0x432e65){while(--_0x432e65){_0x3d43c4['push'](_0x3d43c4['shift']());}};_0x382f66(++_0x3e421b);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);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 4345da9..8c57c95 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 _0x77ab=['sequelize','exports','name','STRING','ENUM','rrmemory','roundrobin'];(function(_0x2b232b,_0x74a60c){var _0x1b0e8f=function(_0x56d511){while(--_0x56d511){_0x2b232b['push'](_0x2b232b['shift']());}};_0x1b0e8f(++_0x74a60c);}(_0x77ab,0x181));var _0xb77a=function(_0x2c2897,_0x40e227){_0x2c2897=_0x2c2897-0x0;var _0x164e24=_0x77ab[_0x2c2897];return _0x164e24;};'use strict';var Sequelize=require(_0xb77a('0x0'));module[_0xb77a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb77a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb77a('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb77a('0x4')](_0xb77a('0x5'),'beepall',_0xb77a('0x6'))}};
\ No newline at end of file
+var _0xf008=['beepall','roundrobin','sequelize','exports','name','STRING','ENUM'];(function(_0x2e8f7b,_0x4121a7){var _0x398c1b=function(_0x104e13){while(--_0x104e13){_0x2e8f7b['push'](_0x2e8f7b['shift']());}};_0x398c1b(++_0x4121a7);}(_0xf008,0xfe));var _0x8f00=function(_0x2a47b5,_0x4d472c){_0x2a47b5=_0x2a47b5-0x0;var _0x1b6764=_0xf008[_0x2a47b5];return _0x1b6764;};'use strict';var Sequelize=require(_0x8f00('0x0'));module[_0x8f00('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8f00('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8f00('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f00('0x4')]('rrmemory',_0x8f00('0x5'),_0x8f00('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 95ab76f..2477b0c 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 _0x2621=['UserChatQueue','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','pick','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','value','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','getOptions','where','ChatQueue','include','query','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','order','sort','ChatQueueId','filter','merge','options'];(function(_0xbec196,_0x1e46a6){var _0x10972b=function(_0x4da5f5){while(--_0x4da5f5){_0xbec196['push'](_0xbec196['shift']());}};_0x10972b(++_0x1e46a6);}(_0x2621,0x1ae));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x1262('0x0'));var util=require(_0x1262('0x1'));var _=require(_0x1262('0x2'));var squel=require('squel');var Redis=require(_0x1262('0x3'));var qs=require(_0x1262('0x4'));var logger=require(_0x1262('0x5'))(_0x1262('0x6'));var config=require(_0x1262('0x7'));var db=require(_0x1262('0x8'))['db'];config['redis']=_[_0x1262('0x9')](config[_0x1262('0xa')],{'host':_0x1262('0xb'),'port':0x18eb});var socket=require(_0x1262('0xc'))(new Redis(config[_0x1262('0xa')]));require(_0x1262('0xd'))[_0x1262('0xe')](socket);function respondWithStatusCode(_0x22a42c,_0x11dbc7){_0x11dbc7=_0x11dbc7||0xcc;return function(_0x5d94e1){if(_0x5d94e1){return _0x22a42c[_0x1262('0xf')](_0x11dbc7);}return _0x22a42c[_0x1262('0x10')](_0x11dbc7)[_0x1262('0x11')]();};}function respondWithResult(_0x42fa86,_0x2c5bb){_0x2c5bb=_0x2c5bb||0xc8;return function(_0x2b461e){if(_0x2b461e){return _0x42fa86[_0x1262('0x10')](_0x2c5bb)['json'](_0x2b461e);}};}function respondWithFilteredResult(_0x527a0b,_0xabf2f2){return function(_0x3658ba){if(_0x3658ba){var _0x346da9=typeof _0xabf2f2['offset']===_0x1262('0x12')&&typeof _0xabf2f2[_0x1262('0x13')]===_0x1262('0x12');var _0x464da8=_0x3658ba['count'];var _0x37df81=_0x346da9?0x0:_0xabf2f2[_0x1262('0x14')];var _0x25303d=_0x346da9?_0x3658ba[_0x1262('0x15')]:_0xabf2f2[_0x1262('0x14')]+_0xabf2f2['limit'];var _0x1ddea8;if(_0x25303d>=_0x464da8){_0x25303d=_0x464da8;_0x1ddea8=0xc8;}else{_0x1ddea8=0xce;}_0x527a0b['status'](_0x1ddea8);return _0x527a0b[_0x1262('0x16')](_0x1262('0x17'),_0x37df81+'-'+_0x25303d+'/'+_0x464da8)[_0x1262('0x18')](_0x3658ba);}return null;};}function saveUpdates(_0x58ecfe){return function(_0x40aa28){if(_0x40aa28){return _0x40aa28[_0x1262('0x19')](_0x58ecfe)[_0x1262('0x1a')](function(_0x552de1){return _0x552de1;});}return null;};}function removeEntity(_0x456016){return function(_0x237364){if(_0x237364){return _0x237364[_0x1262('0x1b')]()[_0x1262('0x1a')](function(){var _0x165514=_0x237364[_0x1262('0x1c')]({'plain':!![]});var _0x501710=_0x1262('0x1d');return db[_0x1262('0x1e')][_0x1262('0x1b')]({'where':{'type':_0x501710,'resourceId':_0x165514['id']}})['then'](function(){return _0x237364;});})['then'](function(){_0x456016[_0x1262('0x10')](0xcc)[_0x1262('0x11')]();});}};}function handleEntityNotFound(_0x3416dc){return function(_0x35ea8f){if(!_0x35ea8f){_0x3416dc['sendStatus'](0x194);}return _0x35ea8f;};}function handleError(_0x3a6c0f,_0x5aa7b){_0x5aa7b=_0x5aa7b||0x1f4;return function(_0x3e36b2){logger['error'](_0x3e36b2[_0x1262('0x1f')]);if(_0x3e36b2[_0x1262('0x20')]){delete _0x3e36b2[_0x1262('0x20')];}_0x3a6c0f[_0x1262('0x10')](_0x5aa7b)[_0x1262('0x21')](_0x3e36b2);};}exports[_0x1262('0x22')]=function(_0x1cd854,_0x5323b5){var _0x17e1bb={};var _0x1d9663={'count':0x0,'rows':[]};var _0xfa6d05=_[_0x1262('0x23')](db['ChatQueue'][_0x1262('0x24')],function(_0x2d0f55){return{'name':_0x2d0f55[_0x1262('0x25')],'type':_0x2d0f55['type']['key']};});_0x17e1bb=qs[_0x1262('0x26')](_0xfa6d05,_0x1cd854);var _0x5827cd={'where':_0x17e1bb[_0x1262('0x27')]};return db[_0x1262('0x28')][_0x1262('0x15')](_0x5827cd)[_0x1262('0x1a')](function(_0x1547a5){_0x1d9663[_0x1262('0x15')]=_0x1547a5;_0x17e1bb[_0x1262('0x29')]=qs[_0x1262('0x29')](_0x1cd854[_0x1262('0x2a')]);return db[_0x1262('0x28')]['findAll'](_0x17e1bb);})['then'](function(_0xe4191e){_0x1d9663[_0x1262('0x2b')]=_0xe4191e;return _0x1d9663;})[_0x1262('0x1a')](respondWithFilteredResult(_0x5323b5,_0x17e1bb))[_0x1262('0x2c')](handleError(_0x5323b5,null));};exports[_0x1262('0x2d')]=function(_0x22d240,_0x5aee9c){var _0x30d359={'raw':!![],'where':{'id':_0x22d240[_0x1262('0x2e')]['id']}},_0x22bc32={};_0x22bc32[_0x1262('0x2f')]=_[_0x1262('0x30')](db['ChatQueue'][_0x1262('0x24')]);_0x22bc32[_0x1262('0x2a')]=_[_0x1262('0x30')](_0x22d240[_0x1262('0x2a')]);_0x22bc32[_0x1262('0x31')]=_[_0x1262('0x32')](_0x22bc32[_0x1262('0x2f')],_0x22bc32[_0x1262('0x2a')]);_0x30d359['attributes']=_['intersection'](_0x22bc32[_0x1262('0x2f')],qs[_0x1262('0x33')](_0x22d240[_0x1262('0x2a')][_0x1262('0x33')]));_0x30d359[_0x1262('0x34')]=_0x30d359[_0x1262('0x34')][_0x1262('0x35')]?_0x30d359['attributes']:_0x22bc32['model'];if(_0x22d240[_0x1262('0x2a')][_0x1262('0x36')]){_0x30d359[_0x1262('0x29')]=[{'all':!![]}];}_0x30d359=_['merge']({},_0x30d359,_0x22d240['options']);return db[_0x1262('0x28')][_0x1262('0x37')](_0x30d359)[_0x1262('0x1a')](handleEntityNotFound(_0x5aee9c,null))[_0x1262('0x1a')](respondWithResult(_0x5aee9c,null))['catch'](handleError(_0x5aee9c,null));};exports[_0x1262('0x38')]=function(_0x47e35b,_0x104cb3){return db[_0x1262('0x28')][_0x1262('0x38')](_0x47e35b[_0x1262('0x39')],{})[_0x1262('0x1a')](function(_0x17323c){var _0x11da5e=_0x47e35b[_0x1262('0x3a')]['get']({'plain':!![]});if(!_0x11da5e)throw new Error(_0x1262('0x3b'));if(_0x11da5e['role']===_0x1262('0x3a')){var _0x20edd7=_0x17323c[_0x1262('0x1c')]({'plain':!![]});var _0xd61cf='ChatQueues';return db[_0x1262('0x3c')]['find']({'where':{'name':_0xd61cf,'userProfileId':_0x11da5e[_0x1262('0x3d')]},'raw':!![]})[_0x1262('0x1a')](function(_0x1d8a6c){if(_0x1d8a6c&&_0x1d8a6c['autoAssociation']===0x0){return db[_0x1262('0x1e')][_0x1262('0x38')]({'name':_0x20edd7[_0x1262('0x20')],'resourceId':_0x20edd7['id'],'type':_0x1d8a6c[_0x1262('0x20')],'sectionId':_0x1d8a6c['id']},{})[_0x1262('0x1a')](function(){return _0x17323c;});}else{return _0x17323c;}})[_0x1262('0x2c')](function(_0x4dd62a){logger[_0x1262('0x3e')](_0x1262('0x3f'),_0x4dd62a);throw _0x4dd62a;});}return _0x17323c;})[_0x1262('0x1a')](respondWithResult(_0x104cb3,0xc9))[_0x1262('0x2c')](handleError(_0x104cb3,null));};exports[_0x1262('0x19')]=function(_0x414739,_0xe7f9f4){if(_0x414739[_0x1262('0x39')]['id']){delete _0x414739['body']['id'];}return db[_0x1262('0x28')][_0x1262('0x37')]({'where':{'id':_0x414739[_0x1262('0x2e')]['id']}})['then'](handleEntityNotFound(_0xe7f9f4,null))[_0x1262('0x1a')](saveUpdates(_0x414739[_0x1262('0x39')],null))[_0x1262('0x1a')](respondWithResult(_0xe7f9f4,null))[_0x1262('0x2c')](handleError(_0xe7f9f4,null));};exports[_0x1262('0x1b')]=function(_0x5c20c0,_0xfe19e4){return db[_0x1262('0x28')][_0x1262('0x37')]({'where':{'id':_0x5c20c0[_0x1262('0x2e')]['id']}})[_0x1262('0x1a')](handleEntityNotFound(_0xfe19e4,null))[_0x1262('0x1a')](removeEntity(_0xfe19e4,null))[_0x1262('0x2c')](handleError(_0xfe19e4,null));};exports[_0x1262('0x40')]=function(_0x564c13,_0xde2a6c){return db[_0x1262('0x28')][_0x1262('0x40')]()['then'](respondWithResult(_0xde2a6c,null))[_0x1262('0x2c')](handleError(_0xde2a6c,null));};exports[_0x1262('0x41')]=function(_0x5a647f,_0x1a6b88){var _0xa832bc={'raw':!![],'where':{}},_0x5d0be3={},_0x3f0f25;return db[_0x1262('0x28')][_0x1262('0x42')]({'where':{'id':_0x5a647f[_0x1262('0x2e')]['id']}})[_0x1262('0x1a')](handleEntityNotFound(_0x1a6b88,null))[_0x1262('0x1a')](function(_0x5afcbc){if(_0x5afcbc){_0x3f0f25=_0x5afcbc[_0x1262('0x1c')]({'plain':!![]});_0x5d0be3[_0x1262('0x2f')]=_[_0x1262('0x30')](db['UserChatQueue'][_0x1262('0x24')]);_0x5d0be3[_0x1262('0x2a')]=_[_0x1262('0x30')](_0x5a647f['query']);_0x5d0be3[_0x1262('0x31')]=_[_0x1262('0x32')](_0x5d0be3[_0x1262('0x2f')],_0x5d0be3[_0x1262('0x2a')]);_0xa832bc['attributes']=_[_0x1262('0x32')](_0x5d0be3[_0x1262('0x2f')],qs['fields'](_0x5a647f[_0x1262('0x2a')]['fields']));_0xa832bc['attributes']=_0xa832bc['attributes'][_0x1262('0x35')]?_0xa832bc[_0x1262('0x34')]:_0x5d0be3[_0x1262('0x2f')];if(!_0x5a647f[_0x1262('0x2a')][_0x1262('0x43')]('nolimit')){_0xa832bc[_0x1262('0x13')]=qs[_0x1262('0x13')](_0x5a647f['query'][_0x1262('0x13')]);_0xa832bc[_0x1262('0x14')]=qs[_0x1262('0x14')](_0x5a647f['query'][_0x1262('0x14')]);}_0xa832bc[_0x1262('0x44')]=qs[_0x1262('0x45')](_0x5a647f[_0x1262('0x2a')][_0x1262('0x45')]);_0xa832bc[_0x1262('0x27')]=qs[_0x1262('0x31')](_['pick'](_0x5a647f[_0x1262('0x2a')],_0x5d0be3[_0x1262('0x31')]));_0xa832bc[_0x1262('0x27')][_0x1262('0x46')]=_0x5afcbc['id'];if(_0x5a647f[_0x1262('0x2a')][_0x1262('0x47')]){_0xa832bc[_0x1262('0x27')]=_['merge'](_0xa832bc[_0x1262('0x27')],{'$or':_[_0x1262('0x23')](_0xa832bc[_0x1262('0x34')],function(_0x32e6db){var _0x2f5c9f={};_0x2f5c9f[_0x32e6db]={'$like':'%'+_0x5a647f[_0x1262('0x2a')]['filter']+'%'};return _0x2f5c9f;})});}_0xa832bc=_[_0x1262('0x48')]({},_0xa832bc,_0x5a647f[_0x1262('0x49')]);return db[_0x1262('0x4a')][_0x1262('0x4b')](_0xa832bc);}})[_0x1262('0x1a')](function(_0x42611d){if(_0x42611d){return db[_0x1262('0x4c')][_0x1262('0x4d')]({'where':{'id':_[_0x1262('0x23')](_0x42611d,_0x1262('0x4e')),'role':_0x1262('0x4f')},'attributes':['id','name',_0x1262('0x50'),_0x1262('0x51'),_0x1262('0x52')]});}})[_0x1262('0x1a')](function(_0x4f6c9c){if(_0x4f6c9c){return{'count':_0x4f6c9c['count'],'rows':_[_0x1262('0x23')](_0x4f6c9c[_0x1262('0x2b')],function(_0x3c03d9){return{'membername':_0x3c03d9[_0x1262('0x20')],'UserId':_0x3c03d9['id'],'queue_name':_0x3f0f25[_0x1262('0x20')],'ChatQueueId':_0x3f0f25['id'],'interface':util[_0x1262('0x53')]('%s/%s',_0x1262('0x54'),_0x3c03d9[_0x1262('0x20')]),'penalty':0x0,'paused':_0x3c03d9[_0x1262('0x50')],'createdAt':_0x3c03d9[_0x1262('0x52')],'updatedAt':_0x3c03d9['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x1262('0x1a')](respondWithFilteredResult(_0x1a6b88,_0xa832bc))['catch'](handleError(_0x1a6b88,null));};exports[_0x1262('0x55')]=function(_0x3843e2,_0x5bdc87){var _0x40bd54={};var _0x825a42={};var _0x320490;var _0x5607f1;return db['ChatQueue'][_0x1262('0x42')]({'where':{'id':_0x3843e2['params']['id']}})['then'](handleEntityNotFound(_0x5bdc87,null))[_0x1262('0x1a')](function(_0x1733e6){if(_0x1733e6){_0x320490=_0x1733e6;_0x825a42[_0x1262('0x2f')]=_[_0x1262('0x30')](db[_0x1262('0x56')][_0x1262('0x24')]);_0x825a42[_0x1262('0x2a')]=_[_0x1262('0x30')](_0x3843e2[_0x1262('0x2a')]);_0x825a42[_0x1262('0x31')]=_[_0x1262('0x32')](_0x825a42[_0x1262('0x2f')],_0x825a42['query']);_0x40bd54[_0x1262('0x34')]=_[_0x1262('0x32')](_0x825a42['model'],qs[_0x1262('0x33')](_0x3843e2[_0x1262('0x2a')][_0x1262('0x33')]));_0x40bd54[_0x1262('0x34')]=_0x40bd54[_0x1262('0x34')][_0x1262('0x35')]?_0x40bd54['attributes']:_0x825a42['model'];_0x40bd54[_0x1262('0x44')]=qs[_0x1262('0x45')](_0x3843e2[_0x1262('0x2a')]['sort']);_0x40bd54[_0x1262('0x27')]=qs[_0x1262('0x31')](_[_0x1262('0x57')](_0x3843e2['query'],_0x825a42[_0x1262('0x31')]));if(_0x3843e2['query'][_0x1262('0x47')]){_0x40bd54[_0x1262('0x27')]=_['merge'](_0x40bd54[_0x1262('0x27')],{'$or':_[_0x1262('0x23')](_0x40bd54[_0x1262('0x34')],function(_0x836849){var _0x2194a3={};_0x2194a3[_0x836849]={'$like':'%'+_0x3843e2[_0x1262('0x2a')][_0x1262('0x47')]+'%'};return _0x2194a3;})});}_0x40bd54=_[_0x1262('0x48')]({},_0x40bd54,_0x3843e2[_0x1262('0x49')]);return _0x320490[_0x1262('0x55')](_0x40bd54);}})['then'](function(_0x47c3da){if(_0x47c3da){_0x5607f1=_0x47c3da[_0x1262('0x35')];if(!_0x3843e2['query'][_0x1262('0x43')](_0x1262('0x58'))){_0x40bd54['limit']=qs['limit'](_0x3843e2[_0x1262('0x2a')][_0x1262('0x13')]);_0x40bd54[_0x1262('0x14')]=qs[_0x1262('0x14')](_0x3843e2[_0x1262('0x2a')][_0x1262('0x14')]);}return _0x320490[_0x1262('0x55')](_0x40bd54);}})['then'](function(_0x3e178f){if(_0x3e178f){return _0x3e178f?{'count':_0x5607f1,'rows':_0x3e178f}:null;}})[_0x1262('0x1a')](respondWithResult(_0x5bdc87,null))[_0x1262('0x2c')](handleError(_0x5bdc87,null));};exports[_0x1262('0x59')]=function(_0x3a8309,_0x248e4b){var _0x4363c2=_0x3a8309[_0x1262('0x39')][_0x1262('0x5a')];return db[_0x1262('0x56')][_0x1262('0x4b')]({'where':{'id':_0x4363c2},'attributes':['id'],'include':[{'model':db[_0x1262('0x4c')],'as':_0x1262('0x5b'),'attributes':['id',_0x1262('0x20'),_0x1262('0x5c'),_0x1262('0x5d'),_0x1262('0x5e')],'raw':!![]}]})[_0x1262('0x1a')](function(_0x242367){if(_0x242367){var _0x534fd9=_[_0x1262('0x5f')](_0x242367,function(_0x54fb80){var _0x142b6d=_0x54fb80[_0x1262('0x1c')]({'plain':!![]});return _0x142b6d[_0x1262('0x5b')];});return db[_0x1262('0x28')]['find']({'where':{'id':_0x3a8309[_0x1262('0x2e')]['id']}})['then'](function(_0x583cf1){return db['sequelize'][_0x1262('0x60')](function(_0x526835){return _0x583cf1[_0x1262('0x59')](_0x4363c2,{'transaction':_0x526835})[_0x1262('0x1a')](function(){return BPromise[_0x1262('0x61')](_0x534fd9,function(_0x474c7f){return db[_0x1262('0x4a')]['findOrCreate']({'where':{'UserId':_0x474c7f['id'],'ChatQueueId':_0x3a8309['params']['id']},'transaction':_0x526835});});})[_0x1262('0x1a')](function(){_0x534fd9[_0x1262('0x62')](function(_0x46d148){socket[_0x1262('0x63')](_0x1262('0x64'),{'UserId':_0x46d148['id'],'ChatQueueId':_0x583cf1['id']});});});});});}})['then'](respondWithStatusCode(_0x248e4b,null))[_0x1262('0x2c')](handleError(_0x248e4b,null));};exports[_0x1262('0x65')]=function(_0x54b0b6,_0x2ca424){return db['Team'][_0x1262('0x4b')]({'where':{'id':_0x54b0b6['query'][_0x1262('0x5a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1262('0x5b'),'attributes':['id'],'raw':!![]}]})[_0x1262('0x1a')](handleEntityNotFound(_0x2ca424,null))['then'](function(_0x1c83d0){var _0x4b21cf=_[_0x1262('0x23')](_0x1c83d0,'id');var _0x2bacf9=[];var _0x24393d=[];var _0x456f06=squel['select']();_0x456f06[_0x1262('0x66')](_0x1262('0x67'))[_0x1262('0x68')](_0x1262('0x69'),'tq')[_0x1262('0x6a')](_0x1262('0x6b'),'ut',_0x1262('0x6c'))[_0x1262('0x27')](_0x1262('0x6d'),_0x54b0b6['params']['id']);for(var _0x459cef=0x0;_0x459cef<_0x1c83d0['length'];_0x459cef+=0x1){let _0x52fc1f=_0x1c83d0[_0x459cef];for(var _0x2e461d=0x0;_0x2e461d<_0x52fc1f['Agents']['length'];_0x2e461d+=0x1){let _0x32bb46=_0x52fc1f['Agents'][_0x2e461d];var _0x3e94b0=_0x456f06['clone']();_0x3e94b0[_0x1262('0x27')]('ut.UserId\x20=\x20?',_0x32bb46['id']);_0x24393d['push'](db[_0x1262('0x6e')][_0x1262('0x2a')](_0x3e94b0[_0x1262('0x6f')](),{'type':db['sequelize'][_0x1262('0x70')]['SELECT']})[_0x1262('0x1a')](function(_0x330919){if(_0x330919[_0x1262('0x35')]===0x1){return _0x32bb46['id'];}else{var _0x59030f=_[_0x1262('0x71')](_[_0x1262('0x23')](_0x330919,_0x1262('0x72')),function(_0x507885){return _['includes'](_0x4b21cf,_0x507885);});if(_0x59030f){return _0x32bb46['id'];}}}));}}return BPromise[_0x1262('0x73')](_0x24393d)[_0x1262('0x1a')](function(_0x3fa698){_0x2bacf9=_(_0x2bacf9)[_0x1262('0x74')](_0x3fa698)[_0x1262('0x75')]()[_0x1262('0x76')]();return db[_0x1262('0x28')][_0x1262('0x37')]({'where':{'id':_0x54b0b6[_0x1262('0x2e')]['id']}})[_0x1262('0x1a')](function(_0xb7dae){return db[_0x1262('0x6e')]['transaction'](function(_0x70943d){return _0xb7dae['removeTeams'](_0x54b0b6[_0x1262('0x2a')]['ids'],{'transaction':_0x70943d})[_0x1262('0x1a')](function(){if(!_['isEmpty'](_0x2bacf9)){return _0xb7dae[_0x1262('0x77')](_0x2bacf9,{'transaction':_0x70943d});}})[_0x1262('0x1a')](function(){_0x2bacf9['forEach'](function(_0xa5dff4){socket[_0x1262('0x63')]('userChatQueue:remove',{'UserId':_0xa5dff4,'ChatQueueId':_0xb7dae['id']});});});});});});})[_0x1262('0x1a')](respondWithStatusCode(_0x2ca424,null))[_0x1262('0x2c')](handleError(_0x2ca424,null));};exports[_0x1262('0x78')]=function(_0x36282b,_0x4c44b9){return db['ChatQueue'][_0x1262('0x37')]({'where':{'id':_0x36282b[_0x1262('0x2e')]['id']}})[_0x1262('0x1a')](handleEntityNotFound(_0x4c44b9,null))[_0x1262('0x1a')](function(_0x17c42c){if(_0x17c42c){return _0x17c42c[_0x1262('0x78')](_0x36282b[_0x1262('0x39')]['ids'],_[_0x1262('0x79')](_0x36282b['body'],[_0x1262('0x5a'),'id'])||{})[_0x1262('0x7a')](function(_0x4beb67){for(var _0x335118=0x0;_0x335118<_0x36282b['body']['ids']['length'];_0x335118+=0x1){socket[_0x1262('0x63')](_0x1262('0x64'),{'UserId':Number(_0x36282b['body']['ids'][_0x335118]),'ChatQueueId':Number(_0x36282b['params']['id'])});}return _0x4beb67;});}})[_0x1262('0x1a')](respondWithResult(_0x4c44b9,null))[_0x1262('0x2c')](handleError(_0x4c44b9,null));};exports['removeAgents']=function(_0x175dce,_0x165f9e){return db[_0x1262('0x28')]['find']({'where':{'id':_0x175dce[_0x1262('0x2e')]['id']}})['then'](handleEntityNotFound(_0x165f9e,null))['then'](function(_0x412919){if(_0x412919){return _0x412919[_0x1262('0x77')](_0x175dce[_0x1262('0x2a')][_0x1262('0x5a')])[_0x1262('0x1a')](function(){if(_[_0x1262('0x7b')](_0x175dce['query'][_0x1262('0x5a')])){for(var _0xad0de2=0x0;_0xad0de2<_0x175dce[_0x1262('0x2a')][_0x1262('0x5a')][_0x1262('0x35')];_0xad0de2+=0x1){socket[_0x1262('0x63')]('userChatQueue:remove',{'UserId':Number(_0x175dce['query'][_0x1262('0x5a')][_0xad0de2]),'ChatQueueId':Number(_0x175dce['params']['id'])});}}else{socket[_0x1262('0x63')](_0x1262('0x7c'),{'UserId':Number(_0x175dce[_0x1262('0x2a')][_0x1262('0x5a')]),'ChatQueueId':Number(_0x175dce[_0x1262('0x2e')]['id'])});}});}})[_0x1262('0x1a')](respondWithStatusCode(_0x165f9e,null))[_0x1262('0x2c')](handleError(_0x165f9e,null));};exports[_0x1262('0x7d')]=function(_0x30fd12,_0x4c4805){var _0x7bb51a={};var _0x4513c8={};var _0x248308;var _0x520e77;return db[_0x1262('0x28')][_0x1262('0x42')]({'where':{'id':_0x30fd12[_0x1262('0x2e')]['id']}})['then'](handleEntityNotFound(_0x4c4805,null))[_0x1262('0x1a')](function(_0x220b80){if(_0x220b80){_0x248308=_0x220b80;_0x4513c8[_0x1262('0x2f')]=_[_0x1262('0x30')](db[_0x1262('0x4c')][_0x1262('0x24')]);_0x4513c8[_0x1262('0x2a')]=_['keys'](_0x30fd12[_0x1262('0x2a')]);_0x4513c8[_0x1262('0x31')]=_[_0x1262('0x32')](_0x4513c8[_0x1262('0x2f')],_0x4513c8['query']);_0x7bb51a[_0x1262('0x34')]=_[_0x1262('0x32')](_0x4513c8[_0x1262('0x2f')],qs['fields'](_0x30fd12[_0x1262('0x2a')][_0x1262('0x33')]));_0x7bb51a['attributes']=_0x7bb51a[_0x1262('0x34')][_0x1262('0x35')]?_0x7bb51a[_0x1262('0x34')]:_0x4513c8['model'];_0x7bb51a[_0x1262('0x44')]=qs['sort'](_0x30fd12[_0x1262('0x2a')]['sort']);_0x7bb51a['where']=qs[_0x1262('0x31')](_['pick'](_0x30fd12[_0x1262('0x2a')],_0x4513c8[_0x1262('0x31')]));if(_0x30fd12[_0x1262('0x2a')][_0x1262('0x47')]){_0x7bb51a[_0x1262('0x27')]=_['merge'](_0x7bb51a[_0x1262('0x27')],{'$or':_[_0x1262('0x23')](_0x7bb51a['attributes'],function(_0x50fcb7){var _0x44e70b={};_0x44e70b[_0x50fcb7]={'$like':'%'+_0x30fd12['query'][_0x1262('0x47')]+'%'};return _0x44e70b;})});}_0x7bb51a=_['merge']({},_0x7bb51a,_0x30fd12[_0x1262('0x49')]);return _0x248308[_0x1262('0x7d')](_0x7bb51a);}})[_0x1262('0x1a')](function(_0x59f6ca){if(_0x59f6ca){_0x520e77=_0x59f6ca[_0x1262('0x35')];if(!_0x30fd12[_0x1262('0x2a')]['hasOwnProperty'](_0x1262('0x58'))){_0x7bb51a[_0x1262('0x13')]=qs[_0x1262('0x13')](_0x30fd12[_0x1262('0x2a')][_0x1262('0x13')]);_0x7bb51a[_0x1262('0x14')]=qs['offset'](_0x30fd12[_0x1262('0x2a')][_0x1262('0x14')]);}return _0x248308[_0x1262('0x7d')](_0x7bb51a);}})['then'](function(_0x3b4928){if(_0x3b4928){return _0x3b4928?{'count':_0x520e77,'rows':_0x3b4928}:null;}})['then'](respondWithResult(_0x4c4805,null))['catch'](handleError(_0x4c4805,null));};
\ No newline at end of file
+var _0x01f1=['updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','interface','flatMap','sequelize','forEach','userChatQueue:save','ids','select','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','transaction','removeTeams','isEmpty','removeAgents','emit','addAgents','userChatQueue:remove','getAgents','order','bluebird','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','update','then','get','error','stack','name','send','map','ChatQueue','fieldName','type','getOptions','where','findAll','catch','show','model','rawAttributes','query','keys','filters','fields','length','attributes','includeAll','include','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','describe','getMembers','findOne','UserChatQueue','intersection','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','User','UserId','agent','chatPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01f1,0x114));var _0x101f=function(_0x3ff2f9,_0x544ba1){_0x3ff2f9=_0x3ff2f9-0x0;var _0x3b0913=_0x01f1[_0x3ff2f9];return _0x3b0913;};'use strict';var BPromise=require(_0x101f('0x0'));var util=require('util');var _=require(_0x101f('0x1'));var squel=require(_0x101f('0x2'));var Redis=require(_0x101f('0x3'));var qs=require(_0x101f('0x4'));var logger=require('../../config/logger')(_0x101f('0x5'));var config=require(_0x101f('0x6'));var db=require('../../mysqldb')['db'];config[_0x101f('0x7')]=_[_0x101f('0x8')](config[_0x101f('0x7')],{'host':_0x101f('0x9'),'port':0x18eb});var socket=require(_0x101f('0xa'))(new Redis(config[_0x101f('0x7')]));require('./chatQueue.socket')[_0x101f('0xb')](socket);function respondWithStatusCode(_0x53b4fe,_0x17388f){_0x17388f=_0x17388f||0xcc;return function(_0x250b19){if(_0x250b19){return _0x53b4fe[_0x101f('0xc')](_0x17388f);}return _0x53b4fe[_0x101f('0xd')](_0x17388f)['end']();};}function respondWithResult(_0x513695,_0x1ecc5c){_0x1ecc5c=_0x1ecc5c||0xc8;return function(_0x56d6dc){if(_0x56d6dc){return _0x513695[_0x101f('0xd')](_0x1ecc5c)[_0x101f('0xe')](_0x56d6dc);}};}function respondWithFilteredResult(_0x243808,_0x43b920){return function(_0x5cab52){if(_0x5cab52){var _0xf4cb95=typeof _0x43b920[_0x101f('0xf')]===_0x101f('0x10')&&typeof _0x43b920[_0x101f('0x11')]==='undefined';var _0x14ceea=_0x5cab52[_0x101f('0x12')];var _0x5df555=_0xf4cb95?0x0:_0x43b920[_0x101f('0xf')];var _0x5dbba4=_0xf4cb95?_0x5cab52[_0x101f('0x12')]:_0x43b920['offset']+_0x43b920[_0x101f('0x11')];var _0x598e90;if(_0x5dbba4>=_0x14ceea){_0x5dbba4=_0x14ceea;_0x598e90=0xc8;}else{_0x598e90=0xce;}_0x243808['status'](_0x598e90);return _0x243808[_0x101f('0x13')]('Content-Range',_0x5df555+'-'+_0x5dbba4+'/'+_0x14ceea)[_0x101f('0xe')](_0x5cab52);}return null;};}function saveUpdates(_0x2efa9f){return function(_0x4d4643){if(_0x4d4643){return _0x4d4643[_0x101f('0x14')](_0x2efa9f)[_0x101f('0x15')](function(_0x52fc68){return _0x52fc68;});}return null;};}function removeEntity(_0x1e10ad){return function(_0x464429){if(_0x464429){return _0x464429['destroy']()[_0x101f('0x15')](function(){var _0x30254=_0x464429[_0x101f('0x16')]({'plain':!![]});var _0x412b59='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x412b59,'resourceId':_0x30254['id']}})['then'](function(){return _0x464429;});})[_0x101f('0x15')](function(){_0x1e10ad[_0x101f('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9cee){return function(_0x14088d){if(!_0x14088d){_0x2d9cee[_0x101f('0xc')](0x194);}return _0x14088d;};}function handleError(_0x52061a,_0x29d638){_0x29d638=_0x29d638||0x1f4;return function(_0x1d7dd9){logger[_0x101f('0x17')](_0x1d7dd9[_0x101f('0x18')]);if(_0x1d7dd9['name']){delete _0x1d7dd9[_0x101f('0x19')];}_0x52061a[_0x101f('0xd')](_0x29d638)[_0x101f('0x1a')](_0x1d7dd9);};}exports['index']=function(_0x387b0c,_0x5460de){var _0x30fd4f={};var _0x5dea3d={'count':0x0,'rows':[]};var _0x441c4c=_[_0x101f('0x1b')](db[_0x101f('0x1c')]['rawAttributes'],function(_0x2930f){return{'name':_0x2930f[_0x101f('0x1d')],'type':_0x2930f[_0x101f('0x1e')]['key']};});_0x30fd4f=qs[_0x101f('0x1f')](_0x441c4c,_0x387b0c);var _0x1945b4={'where':_0x30fd4f[_0x101f('0x20')]};return db['ChatQueue']['count'](_0x1945b4)[_0x101f('0x15')](function(_0x5bf754){_0x5dea3d[_0x101f('0x12')]=_0x5bf754;_0x30fd4f['include']=qs['include'](_0x387b0c['query']);return db[_0x101f('0x1c')][_0x101f('0x21')](_0x30fd4f);})['then'](function(_0x1e4111){_0x5dea3d['rows']=_0x1e4111;return _0x5dea3d;})['then'](respondWithFilteredResult(_0x5460de,_0x30fd4f))[_0x101f('0x22')](handleError(_0x5460de,null));};exports[_0x101f('0x23')]=function(_0x2cfa66,_0x1bb2db){var _0x4bd791={'raw':!![],'where':{'id':_0x2cfa66['params']['id']}},_0x17127a={};_0x17127a[_0x101f('0x24')]=_['keys'](db[_0x101f('0x1c')][_0x101f('0x25')]);_0x17127a[_0x101f('0x26')]=_[_0x101f('0x27')](_0x2cfa66['query']);_0x17127a[_0x101f('0x28')]=_['intersection'](_0x17127a[_0x101f('0x24')],_0x17127a[_0x101f('0x26')]);_0x4bd791['attributes']=_['intersection'](_0x17127a[_0x101f('0x24')],qs[_0x101f('0x29')](_0x2cfa66[_0x101f('0x26')][_0x101f('0x29')]));_0x4bd791['attributes']=_0x4bd791['attributes'][_0x101f('0x2a')]?_0x4bd791[_0x101f('0x2b')]:_0x17127a[_0x101f('0x24')];if(_0x2cfa66[_0x101f('0x26')][_0x101f('0x2c')]){_0x4bd791[_0x101f('0x2d')]=[{'all':!![]}];}_0x4bd791=_[_0x101f('0x2e')]({},_0x4bd791,_0x2cfa66[_0x101f('0x2f')]);return db[_0x101f('0x1c')][_0x101f('0x30')](_0x4bd791)[_0x101f('0x15')](handleEntityNotFound(_0x1bb2db,null))[_0x101f('0x15')](respondWithResult(_0x1bb2db,null))['catch'](handleError(_0x1bb2db,null));};exports[_0x101f('0x31')]=function(_0x5385fd,_0x10beea){return db[_0x101f('0x1c')][_0x101f('0x31')](_0x5385fd[_0x101f('0x32')],{})[_0x101f('0x15')](function(_0x5a7d34){var _0xa4d4fb=_0x5385fd[_0x101f('0x33')][_0x101f('0x16')]({'plain':!![]});if(!_0xa4d4fb)throw new Error(_0x101f('0x34'));if(_0xa4d4fb['role']===_0x101f('0x33')){var _0x505433=_0x5a7d34[_0x101f('0x16')]({'plain':!![]});var _0x55290e=_0x101f('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x55290e,'userProfileId':_0xa4d4fb[_0x101f('0x36')]},'raw':!![]})['then'](function(_0x2770b6){if(_0x2770b6&&_0x2770b6[_0x101f('0x37')]===0x0){return db[_0x101f('0x38')]['create']({'name':_0x505433[_0x101f('0x19')],'resourceId':_0x505433['id'],'type':_0x2770b6[_0x101f('0x19')],'sectionId':_0x2770b6['id']},{})[_0x101f('0x15')](function(){return _0x5a7d34;});}else{return _0x5a7d34;}})[_0x101f('0x22')](function(_0x5dcc14){logger[_0x101f('0x17')](_0x101f('0x39'),_0x5dcc14);throw _0x5dcc14;});}return _0x5a7d34;})[_0x101f('0x15')](respondWithResult(_0x10beea,0xc9))[_0x101f('0x22')](handleError(_0x10beea,null));};exports[_0x101f('0x14')]=function(_0x4f0bba,_0x26d86f){if(_0x4f0bba['body']['id']){delete _0x4f0bba[_0x101f('0x32')]['id'];}return db[_0x101f('0x1c')]['find']({'where':{'id':_0x4f0bba['params']['id']}})[_0x101f('0x15')](handleEntityNotFound(_0x26d86f,null))['then'](saveUpdates(_0x4f0bba[_0x101f('0x32')],null))['then'](respondWithResult(_0x26d86f,null))[_0x101f('0x22')](handleError(_0x26d86f,null));};exports[_0x101f('0x3a')]=function(_0x51ac53,_0x57a17a){return db[_0x101f('0x1c')][_0x101f('0x30')]({'where':{'id':_0x51ac53[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](handleEntityNotFound(_0x57a17a,null))[_0x101f('0x15')](removeEntity(_0x57a17a,null))[_0x101f('0x22')](handleError(_0x57a17a,null));};exports[_0x101f('0x3c')]=function(_0x23c78e,_0x5af813){return db[_0x101f('0x1c')][_0x101f('0x3c')]()[_0x101f('0x15')](respondWithResult(_0x5af813,null))[_0x101f('0x22')](handleError(_0x5af813,null));};exports[_0x101f('0x3d')]=function(_0x67dfdb,_0x354ddc){var _0x71a761={'raw':!![],'where':{}},_0x30200b={},_0xbaeb1d;return db[_0x101f('0x1c')][_0x101f('0x3e')]({'where':{'id':_0x67dfdb[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](handleEntityNotFound(_0x354ddc,null))[_0x101f('0x15')](function(_0x4c23b2){if(_0x4c23b2){_0xbaeb1d=_0x4c23b2[_0x101f('0x16')]({'plain':!![]});_0x30200b[_0x101f('0x24')]=_['keys'](db[_0x101f('0x3f')]['rawAttributes']);_0x30200b[_0x101f('0x26')]=_['keys'](_0x67dfdb[_0x101f('0x26')]);_0x30200b[_0x101f('0x28')]=_[_0x101f('0x40')](_0x30200b[_0x101f('0x24')],_0x30200b[_0x101f('0x26')]);_0x71a761[_0x101f('0x2b')]=_[_0x101f('0x40')](_0x30200b['model'],qs['fields'](_0x67dfdb['query'][_0x101f('0x29')]));_0x71a761[_0x101f('0x2b')]=_0x71a761['attributes']['length']?_0x71a761['attributes']:_0x30200b[_0x101f('0x24')];if(!_0x67dfdb[_0x101f('0x26')][_0x101f('0x41')](_0x101f('0x42'))){_0x71a761[_0x101f('0x11')]=qs['limit'](_0x67dfdb['query'][_0x101f('0x11')]);_0x71a761[_0x101f('0xf')]=qs['offset'](_0x67dfdb['query'][_0x101f('0xf')]);}_0x71a761['order']=qs[_0x101f('0x43')](_0x67dfdb[_0x101f('0x26')][_0x101f('0x43')]);_0x71a761[_0x101f('0x20')]=qs[_0x101f('0x28')](_[_0x101f('0x44')](_0x67dfdb['query'],_0x30200b[_0x101f('0x28')]));_0x71a761[_0x101f('0x20')][_0x101f('0x45')]=_0x4c23b2['id'];if(_0x67dfdb[_0x101f('0x26')][_0x101f('0x46')]){_0x71a761[_0x101f('0x20')]=_['merge'](_0x71a761[_0x101f('0x20')],{'$or':_[_0x101f('0x1b')](_0x71a761[_0x101f('0x2b')],function(_0x243741){var _0x5ad259={};_0x5ad259[_0x243741]={'$like':'%'+_0x67dfdb[_0x101f('0x26')][_0x101f('0x46')]+'%'};return _0x5ad259;})});}_0x71a761=_[_0x101f('0x2e')]({},_0x71a761,_0x67dfdb[_0x101f('0x2f')]);return db[_0x101f('0x3f')][_0x101f('0x21')](_0x71a761);}})[_0x101f('0x15')](function(_0x4c81da){if(_0x4c81da){return db[_0x101f('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x4c81da,_0x101f('0x48')),'role':_0x101f('0x49')},'attributes':['id',_0x101f('0x19'),_0x101f('0x4a'),_0x101f('0x4b'),_0x101f('0x4c')]});}})[_0x101f('0x15')](function(_0x2e5c82){if(_0x2e5c82){return{'count':_0x2e5c82[_0x101f('0x12')],'rows':_[_0x101f('0x1b')](_0x2e5c82['rows'],function(_0x444315){return{'membername':_0x444315['name'],'UserId':_0x444315['id'],'queue_name':_0xbaeb1d[_0x101f('0x19')],'ChatQueueId':_0xbaeb1d['id'],'interface':util[_0x101f('0x4d')](_0x101f('0x4e'),_0x101f('0x4f'),_0x444315[_0x101f('0x19')]),'penalty':0x0,'paused':_0x444315[_0x101f('0x4a')],'createdAt':_0x444315['createdAt'],'updatedAt':_0x444315[_0x101f('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x354ddc,_0x71a761))[_0x101f('0x22')](handleError(_0x354ddc,null));};exports[_0x101f('0x50')]=function(_0x40b82f,_0xb7db8d){var _0x3cc5a1={};var _0x7470e3={};var _0x4dad0e;var _0x432652;return db[_0x101f('0x1c')][_0x101f('0x3e')]({'where':{'id':_0x40b82f[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](handleEntityNotFound(_0xb7db8d,null))[_0x101f('0x15')](function(_0x1d20e2){if(_0x1d20e2){_0x4dad0e=_0x1d20e2;_0x7470e3['model']=_['keys'](db[_0x101f('0x51')][_0x101f('0x25')]);_0x7470e3['query']=_[_0x101f('0x27')](_0x40b82f['query']);_0x7470e3['filters']=_[_0x101f('0x40')](_0x7470e3[_0x101f('0x24')],_0x7470e3[_0x101f('0x26')]);_0x3cc5a1[_0x101f('0x2b')]=_['intersection'](_0x7470e3[_0x101f('0x24')],qs[_0x101f('0x29')](_0x40b82f[_0x101f('0x26')][_0x101f('0x29')]));_0x3cc5a1[_0x101f('0x2b')]=_0x3cc5a1[_0x101f('0x2b')]['length']?_0x3cc5a1[_0x101f('0x2b')]:_0x7470e3[_0x101f('0x24')];_0x3cc5a1['order']=qs[_0x101f('0x43')](_0x40b82f[_0x101f('0x26')][_0x101f('0x43')]);_0x3cc5a1[_0x101f('0x20')]=qs['filters'](_[_0x101f('0x44')](_0x40b82f[_0x101f('0x26')],_0x7470e3[_0x101f('0x28')]));if(_0x40b82f[_0x101f('0x26')][_0x101f('0x46')]){_0x3cc5a1[_0x101f('0x20')]=_[_0x101f('0x2e')](_0x3cc5a1['where'],{'$or':_[_0x101f('0x1b')](_0x3cc5a1[_0x101f('0x2b')],function(_0x2d9fae){var _0x3b179e={};_0x3b179e[_0x2d9fae]={'$like':'%'+_0x40b82f[_0x101f('0x26')][_0x101f('0x46')]+'%'};return _0x3b179e;})});}_0x3cc5a1=_[_0x101f('0x2e')]({},_0x3cc5a1,_0x40b82f[_0x101f('0x2f')]);return _0x4dad0e['getTeams'](_0x3cc5a1);}})[_0x101f('0x15')](function(_0xb69fff){if(_0xb69fff){_0x432652=_0xb69fff[_0x101f('0x2a')];if(!_0x40b82f[_0x101f('0x26')][_0x101f('0x41')](_0x101f('0x42'))){_0x3cc5a1[_0x101f('0x11')]=qs[_0x101f('0x11')](_0x40b82f['query'][_0x101f('0x11')]);_0x3cc5a1['offset']=qs['offset'](_0x40b82f[_0x101f('0x26')][_0x101f('0xf')]);}return _0x4dad0e['getTeams'](_0x3cc5a1);}})[_0x101f('0x15')](function(_0x1f4cf2){if(_0x1f4cf2){return _0x1f4cf2?{'count':_0x432652,'rows':_0x1f4cf2}:null;}})[_0x101f('0x15')](respondWithResult(_0xb7db8d,null))[_0x101f('0x22')](handleError(_0xb7db8d,null));};exports[_0x101f('0x52')]=function(_0x1415e9,_0x2e7a88){var _0x382fc6=_0x1415e9['body']['ids'];return db[_0x101f('0x51')][_0x101f('0x21')]({'where':{'id':_0x382fc6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x101f('0x53'),'attributes':['id',_0x101f('0x19'),_0x101f('0x54'),'voicePause',_0x101f('0x55')],'raw':!![]}]})['then'](function(_0x183a58){if(_0x183a58){var _0x47b292=_[_0x101f('0x56')](_0x183a58,function(_0xd3e3a8){var _0x431955=_0xd3e3a8[_0x101f('0x16')]({'plain':!![]});return _0x431955[_0x101f('0x53')];});return db['ChatQueue'][_0x101f('0x30')]({'where':{'id':_0x1415e9[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](function(_0x360ba8){return db[_0x101f('0x57')]['transaction'](function(_0x2c44e8){return _0x360ba8[_0x101f('0x52')](_0x382fc6,{'transaction':_0x2c44e8})[_0x101f('0x15')](function(){return BPromise['each'](_0x47b292,function(_0x4b38fc){return db[_0x101f('0x3f')]['findOrCreate']({'where':{'UserId':_0x4b38fc['id'],'ChatQueueId':_0x1415e9[_0x101f('0x3b')]['id']},'transaction':_0x2c44e8});});})[_0x101f('0x15')](function(){_0x47b292[_0x101f('0x58')](function(_0x4f4ca0){socket['emit'](_0x101f('0x59'),{'UserId':_0x4f4ca0['id'],'ChatQueueId':_0x360ba8['id']});});});});});}})['then'](respondWithStatusCode(_0x2e7a88,null))['catch'](handleError(_0x2e7a88,null));};exports['removeTeams']=function(_0x37c5d0,_0x2b3cb9){return db[_0x101f('0x51')][_0x101f('0x21')]({'where':{'id':_0x37c5d0['query'][_0x101f('0x5a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x101f('0x53'),'attributes':['id'],'raw':!![]}]})[_0x101f('0x15')](handleEntityNotFound(_0x2b3cb9,null))['then'](function(_0x2f803f){var _0x129e43=_[_0x101f('0x1b')](_0x2f803f,'id');var _0x5b9995=[];var _0x3ef2cd=[];var _0x1365f1=squel[_0x101f('0x5b')]();_0x1365f1['field']('tq.TeamId')['from'](_0x101f('0x5c'),'tq')[_0x101f('0x5d')](_0x101f('0x5e'),'ut',_0x101f('0x5f'))[_0x101f('0x20')](_0x101f('0x60'),_0x37c5d0['params']['id']);for(var _0x3856c9=0x0;_0x3856c9<_0x2f803f[_0x101f('0x2a')];_0x3856c9+=0x1){let _0x255e49=_0x2f803f[_0x3856c9];for(var _0x3894dc=0x0;_0x3894dc<_0x255e49[_0x101f('0x53')][_0x101f('0x2a')];_0x3894dc+=0x1){let _0x4e4fd0=_0x255e49[_0x101f('0x53')][_0x3894dc];var _0x5133dd=_0x1365f1[_0x101f('0x61')]();_0x5133dd[_0x101f('0x20')](_0x101f('0x62'),_0x4e4fd0['id']);_0x3ef2cd[_0x101f('0x63')](db['sequelize']['query'](_0x5133dd[_0x101f('0x64')](),{'type':db[_0x101f('0x57')][_0x101f('0x65')][_0x101f('0x66')]})[_0x101f('0x15')](function(_0x2a8123){if(_0x2a8123[_0x101f('0x2a')]===0x1){return _0x4e4fd0['id'];}else{var _0xd5ee2=_[_0x101f('0x67')](_[_0x101f('0x1b')](_0x2a8123,_0x101f('0x68')),function(_0x203347){return _['includes'](_0x129e43,_0x203347);});if(_0xd5ee2){return _0x4e4fd0['id'];}}}));}}return BPromise[_0x101f('0x69')](_0x3ef2cd)[_0x101f('0x15')](function(_0x53e7ca){_0x5b9995=_(_0x5b9995)[_0x101f('0x6a')](_0x53e7ca)[_0x101f('0x6b')]()['value']();return db[_0x101f('0x1c')]['find']({'where':{'id':_0x37c5d0[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](function(_0x1e3d08){return db[_0x101f('0x57')][_0x101f('0x6c')](function(_0x115cd9){return _0x1e3d08[_0x101f('0x6d')](_0x37c5d0['query']['ids'],{'transaction':_0x115cd9})[_0x101f('0x15')](function(){if(!_[_0x101f('0x6e')](_0x5b9995)){return _0x1e3d08[_0x101f('0x6f')](_0x5b9995,{'transaction':_0x115cd9});}})[_0x101f('0x15')](function(){_0x5b9995[_0x101f('0x58')](function(_0x44d8ee){socket[_0x101f('0x70')]('userChatQueue:remove',{'UserId':_0x44d8ee,'ChatQueueId':_0x1e3d08['id']});});});});});});})[_0x101f('0x15')](respondWithStatusCode(_0x2b3cb9,null))[_0x101f('0x22')](handleError(_0x2b3cb9,null));};exports[_0x101f('0x71')]=function(_0x26cb19,_0xbc177a){return db['ChatQueue'][_0x101f('0x30')]({'where':{'id':_0x26cb19[_0x101f('0x3b')]['id']}})[_0x101f('0x15')](handleEntityNotFound(_0xbc177a,null))['then'](function(_0x16d8b7){if(_0x16d8b7){return _0x16d8b7[_0x101f('0x71')](_0x26cb19[_0x101f('0x32')][_0x101f('0x5a')],_['omit'](_0x26cb19[_0x101f('0x32')],[_0x101f('0x5a'),'id'])||{})['spread'](function(_0x16f83c){for(var _0x546be6=0x0;_0x546be6<_0x26cb19[_0x101f('0x32')][_0x101f('0x5a')][_0x101f('0x2a')];_0x546be6+=0x1){socket[_0x101f('0x70')](_0x101f('0x59'),{'UserId':Number(_0x26cb19[_0x101f('0x32')][_0x101f('0x5a')][_0x546be6]),'ChatQueueId':Number(_0x26cb19[_0x101f('0x3b')]['id'])});}return _0x16f83c;});}})[_0x101f('0x15')](respondWithResult(_0xbc177a,null))[_0x101f('0x22')](handleError(_0xbc177a,null));};exports['removeAgents']=function(_0x4382d,_0x135150){return db[_0x101f('0x1c')][_0x101f('0x30')]({'where':{'id':_0x4382d[_0x101f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x135150,null))[_0x101f('0x15')](function(_0x2d441a){if(_0x2d441a){return _0x2d441a[_0x101f('0x6f')](_0x4382d[_0x101f('0x26')][_0x101f('0x5a')])[_0x101f('0x15')](function(){if(_['isArray'](_0x4382d[_0x101f('0x26')][_0x101f('0x5a')])){for(var _0x184964=0x0;_0x184964<_0x4382d['query'][_0x101f('0x5a')][_0x101f('0x2a')];_0x184964+=0x1){socket[_0x101f('0x70')](_0x101f('0x72'),{'UserId':Number(_0x4382d[_0x101f('0x26')][_0x101f('0x5a')][_0x184964]),'ChatQueueId':Number(_0x4382d[_0x101f('0x3b')]['id'])});}}else{socket[_0x101f('0x70')](_0x101f('0x72'),{'UserId':Number(_0x4382d['query'][_0x101f('0x5a')]),'ChatQueueId':Number(_0x4382d['params']['id'])});}});}})[_0x101f('0x15')](respondWithStatusCode(_0x135150,null))['catch'](handleError(_0x135150,null));};exports[_0x101f('0x73')]=function(_0x12234f,_0x2b1131){var _0x1a90ac={};var _0x42c31e={};var _0x2596c3;var _0x48b2c0;return db[_0x101f('0x1c')][_0x101f('0x3e')]({'where':{'id':_0x12234f[_0x101f('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2b1131,null))[_0x101f('0x15')](function(_0x439378){if(_0x439378){_0x2596c3=_0x439378;_0x42c31e[_0x101f('0x24')]=_[_0x101f('0x27')](db[_0x101f('0x47')][_0x101f('0x25')]);_0x42c31e[_0x101f('0x26')]=_[_0x101f('0x27')](_0x12234f[_0x101f('0x26')]);_0x42c31e['filters']=_['intersection'](_0x42c31e[_0x101f('0x24')],_0x42c31e[_0x101f('0x26')]);_0x1a90ac[_0x101f('0x2b')]=_['intersection'](_0x42c31e['model'],qs[_0x101f('0x29')](_0x12234f[_0x101f('0x26')][_0x101f('0x29')]));_0x1a90ac[_0x101f('0x2b')]=_0x1a90ac[_0x101f('0x2b')]['length']?_0x1a90ac[_0x101f('0x2b')]:_0x42c31e[_0x101f('0x24')];_0x1a90ac[_0x101f('0x74')]=qs['sort'](_0x12234f[_0x101f('0x26')][_0x101f('0x43')]);_0x1a90ac[_0x101f('0x20')]=qs[_0x101f('0x28')](_[_0x101f('0x44')](_0x12234f[_0x101f('0x26')],_0x42c31e[_0x101f('0x28')]));if(_0x12234f[_0x101f('0x26')]['filter']){_0x1a90ac[_0x101f('0x20')]=_[_0x101f('0x2e')](_0x1a90ac['where'],{'$or':_[_0x101f('0x1b')](_0x1a90ac[_0x101f('0x2b')],function(_0x2492f7){var _0x42c465={};_0x42c465[_0x2492f7]={'$like':'%'+_0x12234f[_0x101f('0x26')][_0x101f('0x46')]+'%'};return _0x42c465;})});}_0x1a90ac=_[_0x101f('0x2e')]({},_0x1a90ac,_0x12234f[_0x101f('0x2f')]);return _0x2596c3['getAgents'](_0x1a90ac);}})[_0x101f('0x15')](function(_0x562951){if(_0x562951){_0x48b2c0=_0x562951[_0x101f('0x2a')];if(!_0x12234f[_0x101f('0x26')][_0x101f('0x41')](_0x101f('0x42'))){_0x1a90ac[_0x101f('0x11')]=qs['limit'](_0x12234f['query']['limit']);_0x1a90ac['offset']=qs[_0x101f('0xf')](_0x12234f[_0x101f('0x26')][_0x101f('0xf')]);}return _0x2596c3['getAgents'](_0x1a90ac);}})[_0x101f('0x15')](function(_0xba2d3f){if(_0xba2d3f){return _0xba2d3f?{'count':_0x48b2c0,'rows':_0xba2d3f}:null;}})['then'](respondWithResult(_0x2b1131,null))[_0x101f('0x22')](handleError(_0x2b1131,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 1d32b42..b2c6bec 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 _0x3d4a=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x17df1b,_0x4cf1d7){var _0x297263=function(_0x46c3a5){while(--_0x46c3a5){_0x17df1b['push'](_0x17df1b['shift']());}};_0x297263(++_0x4cf1d7);}(_0x3d4a,0x1e6));var _0xa3d4=function(_0x391d16,_0x387823){_0x391d16=_0x391d16-0x0;var _0x21eee6=_0x3d4a[_0x391d16];return _0x21eee6;};'use strict';var EventEmitter=require(_0xa3d4('0x0'));var ChatQueue=require(_0xa3d4('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa3d4('0x2')](0x0);var events={'afterCreate':_0xa3d4('0x3'),'afterUpdate':'update','afterDestroy':_0xa3d4('0x4')};function emitEvent(_0x27f5a6){return function(_0x3597cb,_0x5da5ee,_0x144d85){ChatQueueEvents[_0xa3d4('0x5')](_0x27f5a6+':'+_0x3597cb['id'],_0x3597cb);ChatQueueEvents[_0xa3d4('0x5')](_0x27f5a6,_0x3597cb);_0x144d85(null);};}for(var e in events){if(events[_0xa3d4('0x6')](e)){var event=events[e];ChatQueue[_0xa3d4('0x7')](e,emitEvent(event));}}module[_0xa3d4('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xb776=['exports','events','../../mysqldb','ChatQueue','save','update','remove','emit','hook'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xb776,0x1cc));var _0x6b77=function(_0x59ab10,_0x538141){_0x59ab10=_0x59ab10-0x0;var _0x383f73=_0xb776[_0x59ab10];return _0x383f73;};'use strict';var EventEmitter=require(_0x6b77('0x0'));var ChatQueue=require(_0x6b77('0x1'))['db'][_0x6b77('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b77('0x3'),'afterUpdate':_0x6b77('0x4'),'afterDestroy':_0x6b77('0x5')};function emitEvent(_0x35789c){return function(_0x3663c7,_0xb8ebde,_0x383a47){ChatQueueEvents[_0x6b77('0x6')](_0x35789c+':'+_0x3663c7['id'],_0x3663c7);ChatQueueEvents[_0x6b77('0x6')](_0x35789c,_0x3663c7);_0x383a47(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x6b77('0x7')](e,emitEvent(event));}}module[_0x6b77('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 35d22ae..9bd8aa5 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 _0x8d8a=['ChatQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports'];(function(_0x39cc78,_0x19616b){var _0x21ab23=function(_0x177c92){while(--_0x177c92){_0x39cc78['push'](_0x39cc78['shift']());}};_0x21ab23(++_0x19616b);}(_0x8d8a,0x79));var _0xa8d8=function(_0x579f88,_0xb8632d){_0x579f88=_0x579f88-0x0;var _0xcff854=_0x8d8a[_0x579f88];return _0xcff854;};'use strict';var _=require(_0xa8d8('0x0'));var util=require(_0xa8d8('0x1'));var logger=require(_0xa8d8('0x2'))(_0xa8d8('0x3'));var moment=require('moment');var BPromise=require(_0xa8d8('0x4'));var rp=require(_0xa8d8('0x5'));var fs=require('fs');var path=require(_0xa8d8('0x6'));var rimraf=require(_0xa8d8('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xa8d8('0x8')]=function(_0x270541,_0x1e70ec){return _0x270541['define'](_0xa8d8('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d2c=['../../config/logger','api','moment','bluebird','request-promise','path','./chatQueue.attributes','exports','lodash','util'];(function(_0x452558,_0x565159){var _0x3027f7=function(_0x198dc7){while(--_0x198dc7){_0x452558['push'](_0x452558['shift']());}};_0x3027f7(++_0x565159);}(_0x7d2c,0x184));var _0xc7d2=function(_0x3c42f0,_0x421a98){_0x3c42f0=_0x3c42f0-0x0;var _0x2e39da=_0x7d2c[_0x3c42f0];return _0x2e39da;};'use strict';var _=require(_0xc7d2('0x0'));var util=require(_0xc7d2('0x1'));var logger=require(_0xc7d2('0x2'))(_0xc7d2('0x3'));var moment=require(_0xc7d2('0x4'));var BPromise=require(_0xc7d2('0x5'));var rp=require(_0xc7d2('0x6'));var fs=require('fs');var path=require(_0xc7d2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc7d2('0x8'));module[_0xc7d2('0x9')]=function(_0x188d37,_0x49c3bc){return _0x188d37['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 4e87acc..7428814 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 _0x47d6=['ChatQueue','raw','options','where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetChatQueue'];(function(_0x1f0a78,_0x54ae1f){var _0x2a706d=function(_0x23bf96){while(--_0x23bf96){_0x1f0a78['push'](_0x1f0a78['shift']());}};_0x2a706d(++_0x54ae1f);}(_0x47d6,0x13f));var _0x647d=function(_0x3787e1,_0x325e8c){_0x3787e1=_0x3787e1-0x0;var _0x348771=_0x47d6[_0x3787e1];return _0x348771;};'use strict';var _=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var moment=require(_0x647d('0x2'));var BPromise=require(_0x647d('0x3'));var rs=require(_0x647d('0x4'));var fs=require('fs');var Redis=require(_0x647d('0x5'));var db=require(_0x647d('0x6'))['db'];var utils=require(_0x647d('0x7'));var logger=require(_0x647d('0x8'))(_0x647d('0x9'));var config=require(_0x647d('0xa'));var jayson=require(_0x647d('0xb'));var client=jayson[_0x647d('0xc')][_0x647d('0xd')]({'port':0x232a});config[_0x647d('0xe')]=_[_0x647d('0xf')](config['redis'],{'host':_0x647d('0x10'),'port':0x18eb});var socket=require(_0x647d('0x11'))(new Redis(config[_0x647d('0xe')]));require(_0x647d('0x12'))[_0x647d('0x13')](socket);function respondWithRpcPromise(_0x28bd9b,_0x1984c6,_0x9bd2a3){return new BPromise(function(_0x16ff20,_0xd7db22){return client[_0x647d('0x14')](_0x28bd9b,_0x9bd2a3)[_0x647d('0x15')](function(_0x4c2ae1){logger['info'](_0x647d('0x16'),_0x1984c6,_0x647d('0x17'));logger[_0x647d('0x18')](_0x647d('0x19'),_0x1984c6,_0x647d('0x17'),JSON[_0x647d('0x1a')](_0x4c2ae1));if(_0x4c2ae1[_0x647d('0x1b')]){if(_0x4c2ae1[_0x647d('0x1b')]['code']===0x1f4){logger[_0x647d('0x1b')](_0x647d('0x16'),_0x1984c6,_0x4c2ae1['error'][_0x647d('0x1c')]);return _0xd7db22(_0x4c2ae1[_0x647d('0x1b')][_0x647d('0x1c')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1984c6,_0x4c2ae1[_0x647d('0x1b')][_0x647d('0x1c')]);return _0x16ff20(_0x4c2ae1[_0x647d('0x1b')]['message']);}else{logger[_0x647d('0x1d')](_0x647d('0x16'),_0x1984c6,'request\x20sent');_0x16ff20(_0x4c2ae1[_0x647d('0x1e')][_0x647d('0x1c')]);}})[_0x647d('0x1f')](function(_0x53000c){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1984c6,_0x53000c);_0xd7db22(_0x53000c);});});}exports[_0x647d('0x20')]=function(_0x3954c5){var _0xd64335=this;return new Promise(function(_0x4991ab,_0x16a1de){return db[_0x647d('0x21')]['findAll']({'raw':_0x3954c5['options']?_0x3954c5['options'][_0x647d('0x22')]===undefined?!![]:![]:!![],'where':_0x3954c5[_0x647d('0x23')]?_0x3954c5['options'][_0x647d('0x24')]||null:null,'attributes':_0x3954c5[_0x647d('0x23')]?_0x3954c5[_0x647d('0x23')][_0x647d('0x25')]||null:null,'limit':_0x3954c5['options']?_0x3954c5['options'][_0x647d('0x26')]||null:null,'include':_0x3954c5['options']?_0x3954c5[_0x647d('0x23')][_0x647d('0x27')]?_[_0x647d('0x28')](_0x3954c5[_0x647d('0x23')][_0x647d('0x27')],function(_0x36cb9f){return{'model':db[_0x36cb9f[_0x647d('0x29')]],'as':_0x36cb9f['as'],'attributes':_0x36cb9f[_0x647d('0x25')],'include':_0x36cb9f[_0x647d('0x27')]?_[_0x647d('0x28')](_0x36cb9f[_0x647d('0x27')],function(_0x11a0c1){return{'model':db[_0x11a0c1[_0x647d('0x29')]],'as':_0x11a0c1['as'],'attributes':_0x11a0c1[_0x647d('0x25')],'include':_0x11a0c1[_0x647d('0x27')]?_[_0x647d('0x28')](_0x11a0c1['include'],function(_0x5b418e){return{'model':db[_0x5b418e['model']],'as':_0x5b418e['as'],'attributes':_0x5b418e[_0x647d('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcd3151){logger[_0x647d('0x1d')]('GetChatQueue',_0x3954c5);logger[_0x647d('0x18')](_0x647d('0x20'),_0x3954c5,JSON[_0x647d('0x1a')](_0xcd3151));_0x4991ab(_0xcd3151);})['catch'](function(_0x45391f){logger[_0x647d('0x1b')](_0x647d('0x20'),_0x45391f['message'],_0x3954c5);_0x16a1de(_0xd64335['error'](0x1f4,_0x45391f[_0x647d('0x1c')]));});});};exports[_0x647d('0x2a')]=function(_0x102f76){var _0x4a220e=this;return new Promise(function(_0x31009c,_0x11c9e8){return db[_0x647d('0x21')][_0x647d('0x2b')]({'raw':_0x102f76[_0x647d('0x23')]?_0x102f76[_0x647d('0x23')][_0x647d('0x22')]===undefined?!![]:![]:!![],'where':_0x102f76[_0x647d('0x23')]?_0x102f76[_0x647d('0x23')][_0x647d('0x24')]||null:null,'attributes':_0x102f76[_0x647d('0x23')]?_0x102f76['options'][_0x647d('0x25')]||null:null,'include':_0x102f76[_0x647d('0x23')]?_0x102f76[_0x647d('0x23')][_0x647d('0x27')]?_[_0x647d('0x28')](_0x102f76[_0x647d('0x23')][_0x647d('0x27')],function(_0xa5baf){return{'model':db[_0xa5baf['model']],'as':_0xa5baf['as'],'attributes':_0xa5baf['attributes'],'include':_0xa5baf[_0x647d('0x27')]?_[_0x647d('0x28')](_0xa5baf[_0x647d('0x27')],function(_0x4624ff){return{'model':db[_0x4624ff['model']],'as':_0x4624ff['as'],'attributes':_0x4624ff[_0x647d('0x25')],'include':_0x4624ff[_0x647d('0x27')]?_['map'](_0x4624ff[_0x647d('0x27')],function(_0x24d363){return{'model':db[_0x24d363['model']],'as':_0x24d363['as'],'attributes':_0x24d363[_0x647d('0x25')]};}):[]};}):[]};}):[]:[]})[_0x647d('0x15')](function(_0x380d4e){logger[_0x647d('0x1d')](_0x647d('0x2a'),_0x102f76);logger[_0x647d('0x18')](_0x647d('0x2a'),_0x102f76,JSON[_0x647d('0x1a')](_0x380d4e));_0x31009c(_0x380d4e);})[_0x647d('0x1f')](function(_0x24470c){logger[_0x647d('0x1b')](_0x647d('0x2a'),_0x24470c[_0x647d('0x1c')],_0x102f76);_0x11c9e8(_0x4a220e[_0x647d('0x1b')](0x1f4,_0x24470c[_0x647d('0x1c')]));});});};
\ No newline at end of file
+var _0x236c=['error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','info','debug','find','ShowChatQueue','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1aaa19,_0x3e7c58){var _0x1dd09e=function(_0x60a6fe){while(--_0x60a6fe){_0x1aaa19['push'](_0x1aaa19['shift']());}};_0x1dd09e(++_0x3e7c58);}(_0x236c,0x155));var _0xc236=function(_0x1fc619,_0x29ad91){_0x1fc619=_0x1fc619-0x0;var _0x3a5129=_0x236c[_0x1fc619];return _0x3a5129;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});config['redis']=_[_0xc236('0xc')](config[_0xc236('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc236('0xe'))['register'](socket);function respondWithRpcPromise(_0x30a28d,_0x381ed1,_0x18f33b){return new BPromise(function(_0x2f8b72,_0xaf651b){return client['request'](_0x30a28d,_0x18f33b)[_0xc236('0xf')](function(_0x3311f7){logger['info'](_0xc236('0x10'),_0x381ed1,_0xc236('0x11'));logger['debug'](_0xc236('0x12'),_0x381ed1,'request\x20sent',JSON['stringify'](_0x3311f7));if(_0x3311f7[_0xc236('0x13')]){if(_0x3311f7[_0xc236('0x13')][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('ChatQueue,\x20%s,\x20%s',_0x381ed1,_0x3311f7[_0xc236('0x13')]['message']);return _0xaf651b(_0x3311f7['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0x10'),_0x381ed1,_0x3311f7[_0xc236('0x13')][_0xc236('0x15')]);return _0x2f8b72(_0x3311f7['error']['message']);}else{logger['info'](_0xc236('0x10'),_0x381ed1,_0xc236('0x11'));_0x2f8b72(_0x3311f7[_0xc236('0x16')]['message']);}})[_0xc236('0x17')](function(_0x506974){logger['error'](_0xc236('0x10'),_0x381ed1,_0x506974);_0xaf651b(_0x506974);});});}exports[_0xc236('0x18')]=function(_0x3a6183){var _0x46bc69=this;return new Promise(function(_0x2b6d3f,_0x27c6ab){return db[_0xc236('0x19')][_0xc236('0x1a')]({'raw':_0x3a6183[_0xc236('0x1b')]?_0x3a6183[_0xc236('0x1b')][_0xc236('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a6183['options']?_0x3a6183[_0xc236('0x1b')][_0xc236('0x1d')]||null:null,'attributes':_0x3a6183[_0xc236('0x1b')]?_0x3a6183[_0xc236('0x1b')][_0xc236('0x1e')]||null:null,'limit':_0x3a6183[_0xc236('0x1b')]?_0x3a6183[_0xc236('0x1b')][_0xc236('0x1f')]||null:null,'include':_0x3a6183[_0xc236('0x1b')]?_0x3a6183[_0xc236('0x1b')][_0xc236('0x20')]?_['map'](_0x3a6183[_0xc236('0x1b')][_0xc236('0x20')],function(_0x356042){return{'model':db[_0x356042[_0xc236('0x21')]],'as':_0x356042['as'],'attributes':_0x356042['attributes'],'include':_0x356042[_0xc236('0x20')]?_['map'](_0x356042['include'],function(_0x15ead8){return{'model':db[_0x15ead8['model']],'as':_0x15ead8['as'],'attributes':_0x15ead8[_0xc236('0x1e')],'include':_0x15ead8['include']?_[_0xc236('0x22')](_0x15ead8['include'],function(_0x423842){return{'model':db[_0x423842[_0xc236('0x21')]],'as':_0x423842['as'],'attributes':_0x423842['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x265c8d){logger[_0xc236('0x23')](_0xc236('0x18'),_0x3a6183);logger[_0xc236('0x24')]('GetChatQueue',_0x3a6183,JSON['stringify'](_0x265c8d));_0x2b6d3f(_0x265c8d);})[_0xc236('0x17')](function(_0x53b767){logger[_0xc236('0x13')]('GetChatQueue',_0x53b767[_0xc236('0x15')],_0x3a6183);_0x27c6ab(_0x46bc69[_0xc236('0x13')](0x1f4,_0x53b767['message']));});});};exports['ShowChatQueue']=function(_0x2537f9){var _0x3053a3=this;return new Promise(function(_0xbda858,_0x2f64bd){return db[_0xc236('0x19')][_0xc236('0x25')]({'raw':_0x2537f9[_0xc236('0x1b')]?_0x2537f9[_0xc236('0x1b')][_0xc236('0x1c')]===undefined?!![]:![]:!![],'where':_0x2537f9['options']?_0x2537f9['options']['where']||null:null,'attributes':_0x2537f9[_0xc236('0x1b')]?_0x2537f9[_0xc236('0x1b')][_0xc236('0x1e')]||null:null,'include':_0x2537f9[_0xc236('0x1b')]?_0x2537f9[_0xc236('0x1b')][_0xc236('0x20')]?_[_0xc236('0x22')](_0x2537f9['options'][_0xc236('0x20')],function(_0x3f9b1d){return{'model':db[_0x3f9b1d[_0xc236('0x21')]],'as':_0x3f9b1d['as'],'attributes':_0x3f9b1d['attributes'],'include':_0x3f9b1d[_0xc236('0x20')]?_[_0xc236('0x22')](_0x3f9b1d[_0xc236('0x20')],function(_0x281137){return{'model':db[_0x281137['model']],'as':_0x281137['as'],'attributes':_0x281137[_0xc236('0x1e')],'include':_0x281137[_0xc236('0x20')]?_[_0xc236('0x22')](_0x281137[_0xc236('0x20')],function(_0x3f3785){return{'model':db[_0x3f3785[_0xc236('0x21')]],'as':_0x3f3785['as'],'attributes':_0x3f3785[_0xc236('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc236('0xf')](function(_0x131212){logger[_0xc236('0x23')](_0xc236('0x26'),_0x2537f9);logger[_0xc236('0x24')](_0xc236('0x26'),_0x2537f9,JSON[_0xc236('0x27')](_0x131212));_0xbda858(_0x131212);})[_0xc236('0x17')](function(_0x3973be){logger[_0xc236('0x13')]('ShowChatQueue',_0x3973be['message'],_0x2537f9);_0x2f64bd(_0x3053a3['error'](0x1f4,_0x3973be['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index f7f0b03..f9f2cc5 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(_0x28c03c,_0x649360){var _0x3f1235=function(_0x1dbb9c){while(--_0x1dbb9c){_0x28c03c['push'](_0x28c03c['shift']());}};_0x3f1235(++_0x649360);}(_0xe14d,0x1ee));var _0xde14=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xe14d[_0x45e98e];return _0x374dba;};'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 _0xb7c8=['chatQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x2a9831,_0x599826){var _0x4df16c=function(_0x27bea6){while(--_0x27bea6){_0x2a9831['push'](_0x2a9831['shift']());}};_0x4df16c(++_0x599826);}(_0xb7c8,0x119));var _0x8b7c=function(_0x5bd86b,_0x504b7b){_0x5bd86b=_0x5bd86b-0x0;var _0x74090a=_0xb7c8[_0x5bd86b];return _0x74090a;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8b7c('0x0'),_0x8b7c('0x1'),_0x8b7c('0x2')];function createListener(_0x3a84fc,_0x1dceff){return function(_0x31ad24){_0x1dceff[_0x8b7c('0x3')](_0x3a84fc,_0x31ad24);};}function removeListener(_0x50113e,_0x38672b){return function(){ChatQueueEvents[_0x8b7c('0x4')](_0x50113e,_0x38672b);};}exports[_0x8b7c('0x5')]=function(_0x440900){for(var _0x107428=0x0,_0x12665c=events[_0x8b7c('0x6')];_0x107428<_0x12665c;_0x107428++){var _0x3c8fd6=events[_0x107428];var _0x6afb55=createListener(_0x8b7c('0x7')+_0x3c8fd6,_0x440900);ChatQueueEvents['on'](_0x3c8fd6,_0x6afb55);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 856fa0c..b89264f 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5f3f9e,_0x110096){var _0x97dd1a=function(_0x584630){while(--_0x584630){_0x5f3f9e['push'](_0x5f3f9e['shift']());}};_0x97dd1a(++_0x110096);}(_0x7217,0x19e));var _0x7721=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7217[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5dd5d9,_0x1e4895){var _0xbbeaa7=function(_0x24f203){while(--_0x24f203){_0x5dd5d9['push'](_0x5dd5d9['shift']());}};_0xbbeaa7(++_0x1e4895);}(_0xe14b,0x93));var _0xbe14=function(_0x49d259,_0x297ed6){_0x49d259=_0x49d259-0x0;var _0x11c87e=_0xe14b[_0x49d259];return _0x11c87e;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e993f68..d05947b 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 _0x7710=['DATE','sequelize','STRING'];(function(_0x1d3787,_0xe1bbc1){var _0x49bf22=function(_0x23e30b){while(--_0x23e30b){_0x1d3787['push'](_0x1d3787['shift']());}};_0x49bf22(++_0xe1bbc1);}(_0x7710,0x130));var _0x0771=function(_0x4d5d0a,_0x4148dd){_0x4d5d0a=_0x4d5d0a-0x0;var _0x502c59=_0x7710[_0x4d5d0a];return _0x502c59;};'use strict';var moment=require('moment');var Sequelize=require(_0x0771('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0771('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x0771('0x1')]},'joinAt':{'type':Sequelize[_0x0771('0x2')]},'leaveAt':{'type':Sequelize[_0x0771('0x2')]},'acceptAt':{'type':Sequelize[_0x0771('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1ac3=['STRING','DATE','moment','sequelize','exports'];(function(_0x6cfb8a,_0x53be6f){var _0x29ba1d=function(_0x104303){while(--_0x104303){_0x6cfb8a['push'](_0x6cfb8a['shift']());}};_0x29ba1d(++_0x53be6f);}(_0x1ac3,0x129));var _0x31ac=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x1ac3[_0x5bd426];return _0x23a7eb;};'use strict';var moment=require(_0x31ac('0x0'));var Sequelize=require(_0x31ac('0x1'));module[_0x31ac('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x31ac('0x3')]},'joinAt':{'type':Sequelize[_0x31ac('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x31ac('0x4')]},'reason':{'type':Sequelize[_0x31ac('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 5fd8e75..6fe45e3 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 _0x014c=['order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','name','send','map','ChatQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x179636,_0x3c3b50){var _0x168ec9=function(_0x38e960){while(--_0x38e960){_0x179636['push'](_0x179636['shift']());}};_0x168ec9(++_0x3c3b50);}(_0x014c,0x17b));var _0xc014=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x014c[_0x229d7e];return _0xa78280;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc014('0x1'));var rp=require(_0xc014('0x2'));var moment=require(_0xc014('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc014('0x4'));var path=require(_0xc014('0x5'));var sox=require(_0xc014('0x6'));var csv=require(_0xc014('0x7'));var ejs=require(_0xc014('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc014('0x9'));var squel=require(_0xc014('0xa'));var crypto=require('crypto');var jsforce=require(_0xc014('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc014('0x7'));var querystring=require(_0xc014('0xc'));var Papa=require(_0xc014('0xd'));var Redis=require('ioredis');var authService=require(_0xc014('0xe'));var qs=require(_0xc014('0xf'));var as=require(_0xc014('0x10'));var hardwareService=require(_0xc014('0x11'));var logger=require('../../config/logger')(_0xc014('0x12'));var utils=require('../../config/utils');var config=require(_0xc014('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc014('0x14'))['db'];function respondWithStatusCode(_0xcde2d3,_0x2f8ac9){_0x2f8ac9=_0x2f8ac9||0xcc;return function(_0x1686f1){if(_0x1686f1){return _0xcde2d3['sendStatus'](_0x2f8ac9);}return _0xcde2d3[_0xc014('0x15')](_0x2f8ac9)[_0xc014('0x16')]();};}function respondWithResult(_0xe86dd,_0x5ced7d){_0x5ced7d=_0x5ced7d||0xc8;return function(_0x36b26e){if(_0x36b26e){return _0xe86dd['status'](_0x5ced7d)[_0xc014('0x17')](_0x36b26e);}};}function respondWithFilteredResult(_0x1c4d3b,_0x25fdf6){return function(_0x26f264){if(_0x26f264){var _0x9f6a26=typeof _0x25fdf6[_0xc014('0x18')]==='undefined'&&typeof _0x25fdf6[_0xc014('0x19')]===_0xc014('0x1a');var _0x263ad0=_0x26f264[_0xc014('0x1b')];var _0x5a2be0=_0x9f6a26?0x0:_0x25fdf6['offset'];var _0x42f93d=_0x9f6a26?_0x26f264['count']:_0x25fdf6['offset']+_0x25fdf6[_0xc014('0x19')];var _0x4287fe;if(_0x42f93d>=_0x263ad0){_0x42f93d=_0x263ad0;_0x4287fe=0xc8;}else{_0x4287fe=0xce;}_0x1c4d3b['status'](_0x4287fe);return _0x1c4d3b[_0xc014('0x1c')](_0xc014('0x1d'),_0x5a2be0+'-'+_0x42f93d+'/'+_0x263ad0)[_0xc014('0x17')](_0x26f264);}return null;};}function patchUpdates(_0x2dac66){return function(_0x1078c4){try{jsonpatch['apply'](_0x1078c4,_0x2dac66,!![]);}catch(_0xc8b0fb){return BPromise[_0xc014('0x1e')](_0xc8b0fb);}return _0x1078c4[_0xc014('0x1f')]();};}function saveUpdates(_0x3c58cc,_0x450b22){return function(_0x3f28b6){if(_0x3f28b6){return _0x3f28b6[_0xc014('0x20')](_0x3c58cc)['then'](function(_0x1089c6){return _0x1089c6;});}return null;};}function removeEntity(_0x1b905d,_0x16d8f9){return function(_0x174b46){if(_0x174b46){return _0x174b46[_0xc014('0x21')]()[_0xc014('0x22')](function(){_0x1b905d[_0xc014('0x15')](0xcc)[_0xc014('0x16')]();});}};}function handleEntityNotFound(_0xe4c68,_0x2e5c30){return function(_0x4850bb){if(!_0x4850bb){_0xe4c68[_0xc014('0x23')](0x194);}return _0x4850bb;};}function handleError(_0x17b6b4,_0x36b663){_0x36b663=_0x36b663||0x1f4;return function(_0x7f47ef){logger[_0xc014('0x24')](_0x7f47ef['stack']);if(_0x7f47ef[_0xc014('0x25')]){delete _0x7f47ef[_0xc014('0x25')];}_0x17b6b4[_0xc014('0x15')](_0x36b663)[_0xc014('0x26')](_0x7f47ef);};}exports['index']=function(_0x43af57,_0x40cf7c){var _0x151705={},_0x30e97a={},_0x21cd81={'count':0x0,'rows':[]};var _0x289f92=_[_0xc014('0x27')](db[_0xc014('0x28')][_0xc014('0x29')],function(_0x330869){return{'name':_0x330869[_0xc014('0x2a')],'type':_0x330869['type'][_0xc014('0x2b')]};});_0x30e97a['model']=_['map'](_0x289f92,'name');_0x30e97a[_0xc014('0x2c')]=_[_0xc014('0x2d')](_0x43af57['query']);_0x30e97a[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],_0x30e97a[_0xc014('0x2c')]);_0x151705[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],qs[_0xc014('0x32')](_0x43af57[_0xc014('0x2c')][_0xc014('0x32')]));_0x151705[_0xc014('0x31')]=_0x151705[_0xc014('0x31')]['length']?_0x151705[_0xc014('0x31')]:_0x30e97a['model'];if(!_0x43af57[_0xc014('0x2c')][_0xc014('0x33')](_0xc014('0x34'))){_0x151705[_0xc014('0x19')]=qs[_0xc014('0x19')](_0x43af57[_0xc014('0x2c')][_0xc014('0x19')]);_0x151705['offset']=qs[_0xc014('0x18')](_0x43af57['query'][_0xc014('0x18')]);}_0x151705[_0xc014('0x35')]=qs[_0xc014('0x36')](_0x43af57[_0xc014('0x2c')][_0xc014('0x36')]);_0x151705[_0xc014('0x37')]=qs[_0xc014('0x2e')](_['pick'](_0x43af57[_0xc014('0x2c')],_0x30e97a[_0xc014('0x2e')]),_0x289f92);if(_0x43af57[_0xc014('0x2c')]['filter']){_0x151705[_0xc014('0x37')]=_[_0xc014('0x38')](_0x151705[_0xc014('0x37')],{'$or':_['map'](_0x289f92,function(_0x473754){if(_0x473754['type']!==_0xc014('0x39')){var _0x19d374={};_0x19d374[_0x473754[_0xc014('0x25')]]={'$like':'%'+_0x43af57[_0xc014('0x2c')][_0xc014('0x3a')]+'%'};return _0x19d374;}})});}_0x151705=_[_0xc014('0x38')]({},_0x151705,_0x43af57[_0xc014('0x3b')]);var _0xb0149e={'where':_0x151705[_0xc014('0x37')]};return db[_0xc014('0x28')][_0xc014('0x1b')](_0xb0149e)[_0xc014('0x22')](function(_0x565433){_0x21cd81[_0xc014('0x1b')]=_0x565433;if(_0x43af57[_0xc014('0x2c')][_0xc014('0x3c')]){_0x151705[_0xc014('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xc014('0x3e')](_0x151705);})['then'](function(_0x3a7f90){_0x21cd81[_0xc014('0x3f')]=_0x3a7f90;return _0x21cd81;})[_0xc014('0x22')](respondWithFilteredResult(_0x40cf7c,_0x151705))[_0xc014('0x40')](handleError(_0x40cf7c,null));};exports[_0xc014('0x41')]=function(_0x46ea1c,_0x1f7dfb){var _0x2a0265={'raw':!![],'where':{'id':_0x46ea1c[_0xc014('0x42')]['id']}},_0x84720d={};_0x84720d[_0xc014('0x30')]=_['keys'](db[_0xc014('0x28')]['rawAttributes']);_0x84720d['query']=_[_0xc014('0x2d')](_0x46ea1c[_0xc014('0x2c')]);_0x84720d[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x84720d[_0xc014('0x30')],_0x84720d['query']);_0x2a0265[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x84720d['model'],qs[_0xc014('0x32')](_0x46ea1c[_0xc014('0x2c')][_0xc014('0x32')]));_0x2a0265[_0xc014('0x31')]=_0x2a0265[_0xc014('0x31')][_0xc014('0x43')]?_0x2a0265[_0xc014('0x31')]:_0x84720d[_0xc014('0x30')];if(_0x46ea1c[_0xc014('0x2c')]['includeAll']){_0x2a0265[_0xc014('0x3d')]=[{'all':!![]}];}_0x2a0265=_[_0xc014('0x38')]({},_0x2a0265,_0x46ea1c[_0xc014('0x3b')]);return db[_0xc014('0x28')][_0xc014('0x44')](_0x2a0265)[_0xc014('0x22')](handleEntityNotFound(_0x1f7dfb,null))[_0xc014('0x22')](respondWithResult(_0x1f7dfb,null))[_0xc014('0x40')](handleError(_0x1f7dfb,null));};exports[_0xc014('0x45')]=function(_0x541ad6,_0x2ce299){return db['ChatQueueReport']['create'](_0x541ad6[_0xc014('0x46')],{})['then'](respondWithResult(_0x2ce299,0xc9))[_0xc014('0x40')](handleError(_0x2ce299,null));};exports[_0xc014('0x20')]=function(_0x56595e,_0x359c24){if(_0x56595e[_0xc014('0x46')]['id']){delete _0x56595e[_0xc014('0x46')]['id'];}return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x56595e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x359c24,null))[_0xc014('0x22')](saveUpdates(_0x56595e[_0xc014('0x46')],null))[_0xc014('0x22')](respondWithResult(_0x359c24,null))[_0xc014('0x40')](handleError(_0x359c24,null));};exports[_0xc014('0x21')]=function(_0x464d3e,_0x255a3b){return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x464d3e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x255a3b,null))[_0xc014('0x22')](removeEntity(_0x255a3b,null))[_0xc014('0x40')](handleError(_0x255a3b,null));};exports[_0xc014('0x47')]=function(_0x1d37be,_0x53676a){return db[_0xc014('0x28')][_0xc014('0x47')]()[_0xc014('0x22')](respondWithResult(_0x53676a,null))[_0xc014('0x40')](handleError(_0x53676a,null));};
\ No newline at end of file
+var _0xf562=['map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','ChatQueueReport','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','fieldName','type','key','model'];(function(_0x2ffd34,_0xc660c9){var _0x9d8e89=function(_0x5609fd){while(--_0x5609fd){_0x2ffd34['push'](_0x2ffd34['shift']());}};_0x9d8e89(++_0xc660c9);}(_0xf562,0x100));var _0x2f56=function(_0x3ba963,_0x26436b){_0x3ba963=_0x3ba963-0x0;var _0x5d0bc4=_0xf562[_0x3ba963];return _0x5d0bc4;};'use strict';var emlformat=require(_0x2f56('0x0'));var rimraf=require(_0x2f56('0x1'));var zipdir=require(_0x2f56('0x2'));var jsonpatch=require(_0x2f56('0x3'));var rp=require(_0x2f56('0x4'));var moment=require(_0x2f56('0x5'));var BPromise=require(_0x2f56('0x6'));var Mustache=require(_0x2f56('0x7'));var util=require(_0x2f56('0x8'));var path=require('path');var sox=require(_0x2f56('0x9'));var csv=require('to-csv');var ejs=require(_0x2f56('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f56('0xb'));var squel=require(_0x2f56('0xc'));var crypto=require(_0x2f56('0xd'));var jsforce=require(_0x2f56('0xe'));var deskjs=require(_0x2f56('0xf'));var toCsv=require(_0x2f56('0x10'));var querystring=require(_0x2f56('0x11'));var Papa=require(_0x2f56('0x12'));var Redis=require(_0x2f56('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f56('0x14'));var as=require(_0x2f56('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f56('0x16'))(_0x2f56('0x17'));var utils=require('../../config/utils');var config=require(_0x2f56('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f56('0x19'))['db'];function respondWithStatusCode(_0x519c81,_0xa190b0){_0xa190b0=_0xa190b0||0xcc;return function(_0x3bec3f){if(_0x3bec3f){return _0x519c81[_0x2f56('0x1a')](_0xa190b0);}return _0x519c81[_0x2f56('0x1b')](_0xa190b0)[_0x2f56('0x1c')]();};}function respondWithResult(_0x69fc74,_0x37e55f){_0x37e55f=_0x37e55f||0xc8;return function(_0x3d9cb3){if(_0x3d9cb3){return _0x69fc74['status'](_0x37e55f)[_0x2f56('0x1d')](_0x3d9cb3);}};}function respondWithFilteredResult(_0x42a056,_0x11dd1e){return function(_0x1d2463){if(_0x1d2463){var _0x341045=typeof _0x11dd1e['offset']===_0x2f56('0x1e')&&typeof _0x11dd1e[_0x2f56('0x1f')]===_0x2f56('0x1e');var _0x3e3165=_0x1d2463[_0x2f56('0x20')];var _0x59db1d=_0x341045?0x0:_0x11dd1e[_0x2f56('0x21')];var _0x33b43f=_0x341045?_0x1d2463[_0x2f56('0x20')]:_0x11dd1e[_0x2f56('0x21')]+_0x11dd1e[_0x2f56('0x1f')];var _0x562cea;if(_0x33b43f>=_0x3e3165){_0x33b43f=_0x3e3165;_0x562cea=0xc8;}else{_0x562cea=0xce;}_0x42a056[_0x2f56('0x1b')](_0x562cea);return _0x42a056[_0x2f56('0x22')](_0x2f56('0x23'),_0x59db1d+'-'+_0x33b43f+'/'+_0x3e3165)[_0x2f56('0x1d')](_0x1d2463);}return null;};}function patchUpdates(_0x33dc10){return function(_0x27613f){try{jsonpatch[_0x2f56('0x24')](_0x27613f,_0x33dc10,!![]);}catch(_0x349d55){return BPromise['reject'](_0x349d55);}return _0x27613f[_0x2f56('0x25')]();};}function saveUpdates(_0x497d3f,_0x5bac85){return function(_0x297827){if(_0x297827){return _0x297827[_0x2f56('0x26')](_0x497d3f)[_0x2f56('0x27')](function(_0x4ee4c9){return _0x4ee4c9;});}return null;};}function removeEntity(_0x21f4b0,_0x433f0b){return function(_0x2db586){if(_0x2db586){return _0x2db586['destroy']()['then'](function(){_0x21f4b0[_0x2f56('0x1b')](0xcc)[_0x2f56('0x1c')]();});}};}function handleEntityNotFound(_0x38b366,_0x3e047b){return function(_0x4406ff){if(!_0x4406ff){_0x38b366['sendStatus'](0x194);}return _0x4406ff;};}function handleError(_0x2641d9,_0xaec9e8){_0xaec9e8=_0xaec9e8||0x1f4;return function(_0x861e9c){logger[_0x2f56('0x28')](_0x861e9c[_0x2f56('0x29')]);if(_0x861e9c[_0x2f56('0x2a')]){delete _0x861e9c[_0x2f56('0x2a')];}_0x2641d9[_0x2f56('0x1b')](_0xaec9e8)[_0x2f56('0x2b')](_0x861e9c);};}exports['index']=function(_0x44ff58,_0x49b89c){var _0x4e6dbc={},_0x284252={},_0x60a325={'count':0x0,'rows':[]};var _0x288019=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x61a170){return{'name':_0x61a170[_0x2f56('0x2c')],'type':_0x61a170[_0x2f56('0x2d')][_0x2f56('0x2e')]};});_0x284252[_0x2f56('0x2f')]=_[_0x2f56('0x30')](_0x288019,_0x2f56('0x2a'));_0x284252['query']=_[_0x2f56('0x31')](_0x44ff58[_0x2f56('0x32')]);_0x284252[_0x2f56('0x33')]=_['intersection'](_0x284252[_0x2f56('0x2f')],_0x284252[_0x2f56('0x32')]);_0x4e6dbc[_0x2f56('0x34')]=_[_0x2f56('0x35')](_0x284252[_0x2f56('0x2f')],qs[_0x2f56('0x36')](_0x44ff58[_0x2f56('0x32')]['fields']));_0x4e6dbc[_0x2f56('0x34')]=_0x4e6dbc[_0x2f56('0x34')]['length']?_0x4e6dbc[_0x2f56('0x34')]:_0x284252[_0x2f56('0x2f')];if(!_0x44ff58['query'][_0x2f56('0x37')]('nolimit')){_0x4e6dbc['limit']=qs[_0x2f56('0x1f')](_0x44ff58[_0x2f56('0x32')][_0x2f56('0x1f')]);_0x4e6dbc['offset']=qs[_0x2f56('0x21')](_0x44ff58['query'][_0x2f56('0x21')]);}_0x4e6dbc['order']=qs[_0x2f56('0x38')](_0x44ff58[_0x2f56('0x32')][_0x2f56('0x38')]);_0x4e6dbc['where']=qs[_0x2f56('0x33')](_[_0x2f56('0x39')](_0x44ff58[_0x2f56('0x32')],_0x284252[_0x2f56('0x33')]),_0x288019);if(_0x44ff58[_0x2f56('0x32')][_0x2f56('0x3a')]){_0x4e6dbc['where']=_[_0x2f56('0x3b')](_0x4e6dbc[_0x2f56('0x3c')],{'$or':_[_0x2f56('0x30')](_0x288019,function(_0x27c4ce){if(_0x27c4ce[_0x2f56('0x2d')]!==_0x2f56('0x3d')){var _0x141c09={};_0x141c09[_0x27c4ce[_0x2f56('0x2a')]]={'$like':'%'+_0x44ff58[_0x2f56('0x32')]['filter']+'%'};return _0x141c09;}})});}_0x4e6dbc=_[_0x2f56('0x3b')]({},_0x4e6dbc,_0x44ff58['options']);var _0x12032c={'where':_0x4e6dbc[_0x2f56('0x3c')]};return db[_0x2f56('0x3e')][_0x2f56('0x20')](_0x12032c)[_0x2f56('0x27')](function(_0x197bcc){_0x60a325[_0x2f56('0x20')]=_0x197bcc;if(_0x44ff58['query']['includeAll']){_0x4e6dbc[_0x2f56('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x2f56('0x40')](_0x4e6dbc);})[_0x2f56('0x27')](function(_0x1d3efa){_0x60a325[_0x2f56('0x41')]=_0x1d3efa;return _0x60a325;})[_0x2f56('0x27')](respondWithFilteredResult(_0x49b89c,_0x4e6dbc))[_0x2f56('0x42')](handleError(_0x49b89c,null));};exports[_0x2f56('0x43')]=function(_0x18464b,_0x1de6a7){var _0x5cf160={'raw':!![],'where':{'id':_0x18464b[_0x2f56('0x44')]['id']}},_0x5779a6={};_0x5779a6['model']=_[_0x2f56('0x31')](db[_0x2f56('0x3e')][_0x2f56('0x45')]);_0x5779a6[_0x2f56('0x32')]=_[_0x2f56('0x31')](_0x18464b[_0x2f56('0x32')]);_0x5779a6['filters']=_['intersection'](_0x5779a6['model'],_0x5779a6[_0x2f56('0x32')]);_0x5cf160['attributes']=_[_0x2f56('0x35')](_0x5779a6[_0x2f56('0x2f')],qs['fields'](_0x18464b[_0x2f56('0x32')]['fields']));_0x5cf160[_0x2f56('0x34')]=_0x5cf160['attributes'][_0x2f56('0x46')]?_0x5cf160[_0x2f56('0x34')]:_0x5779a6[_0x2f56('0x2f')];if(_0x18464b[_0x2f56('0x32')]['includeAll']){_0x5cf160[_0x2f56('0x3f')]=[{'all':!![]}];}_0x5cf160=_[_0x2f56('0x3b')]({},_0x5cf160,_0x18464b[_0x2f56('0x47')]);return db[_0x2f56('0x3e')][_0x2f56('0x48')](_0x5cf160)['then'](handleEntityNotFound(_0x1de6a7,null))[_0x2f56('0x27')](respondWithResult(_0x1de6a7,null))[_0x2f56('0x42')](handleError(_0x1de6a7,null));};exports[_0x2f56('0x49')]=function(_0x519790,_0x3218eb){return db['ChatQueueReport'][_0x2f56('0x49')](_0x519790[_0x2f56('0x4a')],{})['then'](respondWithResult(_0x3218eb,0xc9))['catch'](handleError(_0x3218eb,null));};exports[_0x2f56('0x26')]=function(_0x338324,_0x215215){if(_0x338324[_0x2f56('0x4a')]['id']){delete _0x338324[_0x2f56('0x4a')]['id'];}return db['ChatQueueReport'][_0x2f56('0x48')]({'where':{'id':_0x338324[_0x2f56('0x44')]['id']}})[_0x2f56('0x27')](handleEntityNotFound(_0x215215,null))['then'](saveUpdates(_0x338324[_0x2f56('0x4a')],null))[_0x2f56('0x27')](respondWithResult(_0x215215,null))[_0x2f56('0x42')](handleError(_0x215215,null));};exports[_0x2f56('0x4b')]=function(_0x4ad9bf,_0x2e0311){return db[_0x2f56('0x3e')][_0x2f56('0x48')]({'where':{'id':_0x4ad9bf[_0x2f56('0x44')]['id']}})[_0x2f56('0x27')](handleEntityNotFound(_0x2e0311,null))[_0x2f56('0x27')](removeEntity(_0x2e0311,null))[_0x2f56('0x42')](handleError(_0x2e0311,null));};exports['describe']=function(_0x3a4cf4,_0x213d99){return db['ChatQueueReport']['describe']()[_0x2f56('0x27')](respondWithResult(_0x213d99,null))[_0x2f56('0x42')](handleError(_0x213d99,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index f7f9cd0..3c140fa 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0xd0a290,_0x55cb33){var _0x377b3d=function(_0x56d2e0){while(--_0x56d2e0){_0xd0a290['push'](_0xd0a290['shift']());}};_0x377b3d(++_0x55cb33);}(_0xb10b,0x12a));var _0xbb10=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0xb10b[_0x386525];return _0x14d015;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x2f3623,_0x34a5ed){var _0x51e1b3=function(_0x6d6200){while(--_0x6d6200){_0x2f3623['push'](_0x2f3623['shift']());}};_0x51e1b3(++_0x34a5ed);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0xcb91[_0x53bcc3];return _0x47c959;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 74b5940..12d2e34 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 _0xd6f7=['http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','options','raw','UpdateChatQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x957c5f,_0x2ec4ae){var _0x42c7cb=function(_0x12adb0){while(--_0x12adb0){_0x957c5f['push'](_0x957c5f['shift']());}};_0x42c7cb(++_0x2ec4ae);}(_0xd6f7,0xed));var _0x7d6f=function(_0x4ec7f2,_0x3d92d2){_0x4ec7f2=_0x4ec7f2-0x0;var _0x118004=_0xd6f7[_0x4ec7f2];return _0x118004;};'use strict';var _=require(_0x7d6f('0x0'));var util=require(_0x7d6f('0x1'));var moment=require(_0x7d6f('0x2'));var BPromise=require(_0x7d6f('0x3'));var rs=require(_0x7d6f('0x4'));var fs=require('fs');var Redis=require(_0x7d6f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d6f('0x6'));var logger=require('../../config/logger')(_0x7d6f('0x7'));var config=require(_0x7d6f('0x8'));var jayson=require(_0x7d6f('0x9'));var client=jayson[_0x7d6f('0xa')][_0x7d6f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe5f837,_0x5aef59,_0xc5f0be){return new BPromise(function(_0x31b9a9,_0x1ebcb3){return client[_0x7d6f('0xc')](_0xe5f837,_0xc5f0be)[_0x7d6f('0xd')](function(_0x4884d2){logger[_0x7d6f('0xe')](_0x7d6f('0xf'),_0x5aef59,_0x7d6f('0x10'));logger[_0x7d6f('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5aef59,_0x7d6f('0x10'),JSON[_0x7d6f('0x12')](_0x4884d2));if(_0x4884d2[_0x7d6f('0x13')]){if(_0x4884d2[_0x7d6f('0x13')]['code']===0x1f4){logger[_0x7d6f('0x13')](_0x7d6f('0xf'),_0x5aef59,_0x4884d2[_0x7d6f('0x13')][_0x7d6f('0x14')]);return _0x1ebcb3(_0x4884d2[_0x7d6f('0x13')][_0x7d6f('0x14')]);}logger['error'](_0x7d6f('0xf'),_0x5aef59,_0x4884d2[_0x7d6f('0x13')][_0x7d6f('0x14')]);return _0x31b9a9(_0x4884d2[_0x7d6f('0x13')][_0x7d6f('0x14')]);}else{logger[_0x7d6f('0xe')](_0x7d6f('0xf'),_0x5aef59,_0x7d6f('0x10'));_0x31b9a9(_0x4884d2[_0x7d6f('0x15')][_0x7d6f('0x14')]);}})[_0x7d6f('0x16')](function(_0x39e631){logger[_0x7d6f('0x13')](_0x7d6f('0xf'),_0x5aef59,_0x39e631);_0x1ebcb3(_0x39e631);});});}exports[_0x7d6f('0x17')]=function(_0x27082d){var _0x32ad57=this;return new Promise(function(_0x1d8f6d,_0x28df1d){return db[_0x7d6f('0x18')]['create'](_0x27082d['body'],{'raw':_0x27082d['options']?_0x27082d[_0x7d6f('0x19')][_0x7d6f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4a0c06){logger[_0x7d6f('0xe')](_0x7d6f('0x17'),_0x27082d);logger[_0x7d6f('0x11')](_0x7d6f('0x17'),_0x27082d,JSON[_0x7d6f('0x12')](_0x4a0c06));_0x1d8f6d(_0x4a0c06);})[_0x7d6f('0x16')](function(_0x560158){logger['error'](_0x7d6f('0x17'),_0x560158[_0x7d6f('0x14')],_0x27082d);_0x28df1d(_0x32ad57[_0x7d6f('0x13')](0x1f4,_0x560158[_0x7d6f('0x14')]));});});};exports[_0x7d6f('0x1b')]=function(_0x1f3673){var _0x50cbc8=this;return new Promise(function(_0x12183e,_0x2b8754){return db[_0x7d6f('0x18')][_0x7d6f('0x1c')](_0x1f3673['body'],{'raw':_0x1f3673[_0x7d6f('0x19')]?_0x1f3673[_0x7d6f('0x19')][_0x7d6f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3673[_0x7d6f('0x19')]?_0x1f3673['options'][_0x7d6f('0x1d')]||null:null,'attributes':_0x1f3673[_0x7d6f('0x19')]?_0x1f3673[_0x7d6f('0x19')][_0x7d6f('0x1e')]||null:null,'limit':_0x1f3673[_0x7d6f('0x19')]?_0x1f3673[_0x7d6f('0x19')]['limit']||null:null})[_0x7d6f('0xd')](function(_0x4b1f7b){logger[_0x7d6f('0xe')]('UpdateChatQueueReport',_0x1f3673);logger[_0x7d6f('0x11')]('UpdateChatQueueReport',_0x1f3673,JSON['stringify'](_0x4b1f7b));_0x12183e(_0x4b1f7b);})[_0x7d6f('0x16')](function(_0x5b4d01){logger['error'](_0x7d6f('0x1b'),_0x5b4d01[_0x7d6f('0x14')],_0x1f3673);_0x2b8754(_0x50cbc8[_0x7d6f('0x13')](0x1f4,_0x5b4d01['message']));});});};
\ No newline at end of file
+var _0xa8f0=['CreateChatQueueReport','options','raw','stringify','UpdateChatQueueReport','body','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','catch'];(function(_0xb51261,_0x51a20c){var _0x217382=function(_0x5e0c81){while(--_0x5e0c81){_0xb51261['push'](_0xb51261['shift']());}};_0x217382(++_0x51a20c);}(_0xa8f0,0x173));var _0x0a8f=function(_0x4d093a,_0x15d59c){_0x4d093a=_0x4d093a-0x0;var _0x5d7227=_0xa8f0[_0x4d093a];return _0x5d7227;};'use strict';var _=require('lodash');var util=require(_0x0a8f('0x0'));var moment=require(_0x0a8f('0x1'));var BPromise=require(_0x0a8f('0x2'));var rs=require(_0x0a8f('0x3'));var fs=require('fs');var Redis=require(_0x0a8f('0x4'));var db=require(_0x0a8f('0x5'))['db'];var utils=require(_0x0a8f('0x6'));var logger=require(_0x0a8f('0x7'))('rpc');var config=require(_0x0a8f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a8f('0x9')][_0x0a8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xca44d2,_0x65bd19,_0x54f2d6){return new BPromise(function(_0x430f12,_0x228e64){return client['request'](_0xca44d2,_0x54f2d6)[_0x0a8f('0xb')](function(_0x128683){logger[_0x0a8f('0xc')](_0x0a8f('0xd'),_0x65bd19,_0x0a8f('0xe'));logger[_0x0a8f('0xf')](_0x0a8f('0x10'),_0x65bd19,_0x0a8f('0xe'),JSON['stringify'](_0x128683));if(_0x128683['error']){if(_0x128683['error'][_0x0a8f('0x11')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x65bd19,_0x128683[_0x0a8f('0x12')][_0x0a8f('0x13')]);return _0x228e64(_0x128683[_0x0a8f('0x12')][_0x0a8f('0x13')]);}logger[_0x0a8f('0x12')](_0x0a8f('0xd'),_0x65bd19,_0x128683[_0x0a8f('0x12')]['message']);return _0x430f12(_0x128683[_0x0a8f('0x12')][_0x0a8f('0x13')]);}else{logger[_0x0a8f('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x65bd19,'request\x20sent');_0x430f12(_0x128683['result'][_0x0a8f('0x13')]);}})[_0x0a8f('0x14')](function(_0x251e6e){logger[_0x0a8f('0x12')](_0x0a8f('0xd'),_0x65bd19,_0x251e6e);_0x228e64(_0x251e6e);});});}exports[_0x0a8f('0x15')]=function(_0x56ec8e){var _0x40c859=this;return new Promise(function(_0x2c2e2d,_0x58d493){return db['ChatQueueReport']['create'](_0x56ec8e['body'],{'raw':_0x56ec8e[_0x0a8f('0x16')]?_0x56ec8e[_0x0a8f('0x16')][_0x0a8f('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bc61c){logger[_0x0a8f('0xc')](_0x0a8f('0x15'),_0x56ec8e);logger[_0x0a8f('0xf')](_0x0a8f('0x15'),_0x56ec8e,JSON[_0x0a8f('0x18')](_0x3bc61c));_0x2c2e2d(_0x3bc61c);})['catch'](function(_0x743a91){logger[_0x0a8f('0x12')]('CreateChatQueueReport',_0x743a91['message'],_0x56ec8e);_0x58d493(_0x40c859['error'](0x1f4,_0x743a91[_0x0a8f('0x13')]));});});};exports[_0x0a8f('0x19')]=function(_0x43c9c3){var _0x41ccf2=this;return new Promise(function(_0x263a2c,_0xbbd479){return db['ChatQueueReport']['update'](_0x43c9c3[_0x0a8f('0x1a')],{'raw':_0x43c9c3[_0x0a8f('0x16')]?_0x43c9c3[_0x0a8f('0x16')][_0x0a8f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43c9c3[_0x0a8f('0x16')]?_0x43c9c3['options'][_0x0a8f('0x1b')]||null:null,'attributes':_0x43c9c3[_0x0a8f('0x16')]?_0x43c9c3[_0x0a8f('0x16')]['attributes']||null:null,'limit':_0x43c9c3[_0x0a8f('0x16')]?_0x43c9c3[_0x0a8f('0x16')]['limit']||null:null})[_0x0a8f('0xb')](function(_0x78e1b5){logger[_0x0a8f('0xc')](_0x0a8f('0x19'),_0x43c9c3);logger['debug']('UpdateChatQueueReport',_0x43c9c3,JSON[_0x0a8f('0x18')](_0x78e1b5));_0x263a2c(_0x78e1b5);})['catch'](function(_0x48e8d1){logger[_0x0a8f('0x12')]('UpdateChatQueueReport',_0x48e8d1[_0x0a8f('0x13')],_0x43c9c3);_0xbbd479(_0x41ccf2['error'](0x1f4,_0x48e8d1['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 1083fce..c0c836e 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 _0xd5b9=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x4f79bb,_0x2c1762){var _0x8ba35c=function(_0x462470){while(--_0x462470){_0x4f79bb['push'](_0x4f79bb['shift']());}};_0x8ba35c(++_0x2c1762);}(_0xd5b9,0x1c5));var _0x9d5b=function(_0x34e9ec,_0x39831a){_0x34e9ec=_0x34e9ec-0x0;var _0x46e122=_0xd5b9[_0x34e9ec];return _0x46e122;};'use strict';var multer=require(_0x9d5b('0x0'));var util=require('util');var path=require(_0x9d5b('0x1'));var timeout=require(_0x9d5b('0x2'));var express=require(_0x9d5b('0x3'));var router=express[_0x9d5b('0x4')]();var fs_extra=require(_0x9d5b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9d5b('0x6'));var config=require(_0x9d5b('0x7'));var controller=require(_0x9d5b('0x8'));router[_0x9d5b('0x9')]('/',auth[_0x9d5b('0xa')](),controller[_0x9d5b('0xb')]);router[_0x9d5b('0x9')](_0x9d5b('0xc'),auth[_0x9d5b('0xa')](),controller[_0x9d5b('0xd')]);router['get'](_0x9d5b('0xe'),auth['isAuthenticated'](),controller[_0x9d5b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9d5b('0x10')]);router[_0x9d5b('0x11')](_0x9d5b('0xe'),auth[_0x9d5b('0xa')](),controller['update']);router[_0x9d5b('0x12')]('/:id',auth[_0x9d5b('0xa')](),controller[_0x9d5b('0x13')]);module[_0x9d5b('0x14')]=router;
\ No newline at end of file
+var _0x5dd3=['/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index'];(function(_0x2dcb28,_0x26b688){var _0x314ba5=function(_0x2cf325){while(--_0x2cf325){_0x2dcb28['push'](_0x2dcb28['shift']());}};_0x314ba5(++_0x26b688);}(_0x5dd3,0x1af));var _0x35dd=function(_0x3526a5,_0x56825d){_0x3526a5=_0x3526a5-0x0;var _0x44f869=_0x5dd3[_0x3526a5];return _0x44f869;};'use strict';var multer=require('multer');var util=require(_0x35dd('0x0'));var path=require(_0x35dd('0x1'));var timeout=require(_0x35dd('0x2'));var express=require('express');var router=express[_0x35dd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x35dd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x35dd('0x5'));var controller=require(_0x35dd('0x6'));router[_0x35dd('0x7')]('/',auth['isAuthenticated'](),controller[_0x35dd('0x8')]);router[_0x35dd('0x7')](_0x35dd('0x9'),auth[_0x35dd('0xa')](),controller[_0x35dd('0xb')]);router[_0x35dd('0x7')](_0x35dd('0xc'),auth[_0x35dd('0xa')](),controller['show']);router[_0x35dd('0xd')]('/',auth[_0x35dd('0xa')](),controller[_0x35dd('0xe')]);router[_0x35dd('0xf')](_0x35dd('0xc'),auth['isAuthenticated'](),controller[_0x35dd('0x10')]);router[_0x35dd('0x11')](_0x35dd('0xc'),auth[_0x35dd('0xa')](),controller[_0x35dd('0x12')]);module[_0x35dd('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index c4317df..0f15a12 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3ac16e,_0x39776c){var _0x57afcb=function(_0x4ebed2){while(--_0x4ebed2){_0x3ac16e['push'](_0x3ac16e['shift']());}};_0x57afcb(++_0x39776c);}(_0x70e0,0x17b));var _0x070e=function(_0x57d3d5,_0x360475){_0x57d3d5=_0x57d3d5-0x0;var _0x21a326=_0x70e0[_0x57d3d5];return _0x21a326;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x230a9b,_0x3bbee7){var _0x28dfd1=function(_0x18f00a){while(--_0x18f00a){_0x230a9b['push'](_0x230a9b['shift']());}};_0x28dfd1(++_0x3bbee7);}(_0x4b84,0x1cc));var _0x44b8=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x4b84[_0x56482c];return _0x5aae7a;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 1a6ec38..664b2e1 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 _0xa98c=['reject','save','update','then','destroy','stack','name','send','index','map','ChatTransferReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','pick','filter','merge','where','type','VIRTUAL','options','include','rows','show','params','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','Content-Range'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0xa98c,0xbd));var _0xca98=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xa98c[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0xca98('0x0'));var rimraf=require(_0xca98('0x1'));var zipdir=require(_0xca98('0x2'));var jsonpatch=require(_0xca98('0x3'));var rp=require(_0xca98('0x4'));var moment=require(_0xca98('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xca98('0x6'));var util=require(_0xca98('0x7'));var path=require('path');var sox=require(_0xca98('0x8'));var csv=require(_0xca98('0x9'));var ejs=require(_0xca98('0xa'));var fs=require('fs');var fs_extra=require(_0xca98('0xb'));var _=require(_0xca98('0xc'));var squel=require(_0xca98('0xd'));var crypto=require(_0xca98('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xca98('0xf'));var toCsv=require(_0xca98('0x9'));var querystring=require('querystring');var Papa=require(_0xca98('0x10'));var Redis=require(_0xca98('0x11'));var authService=require(_0xca98('0x12'));var qs=require(_0xca98('0x13'));var as=require(_0xca98('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca98('0x15'))(_0xca98('0x16'));var utils=require(_0xca98('0x17'));var config=require(_0xca98('0x18'));var licenseUtil=require(_0xca98('0x19'));var db=require(_0xca98('0x1a'))['db'];function respondWithStatusCode(_0x250617,_0x306ba0){_0x306ba0=_0x306ba0||0xcc;return function(_0x3f212f){if(_0x3f212f){return _0x250617[_0xca98('0x1b')](_0x306ba0);}return _0x250617['status'](_0x306ba0)[_0xca98('0x1c')]();};}function respondWithResult(_0x5f0877,_0x4cfadd){_0x4cfadd=_0x4cfadd||0xc8;return function(_0x4884ae){if(_0x4884ae){return _0x5f0877[_0xca98('0x1d')](_0x4cfadd)[_0xca98('0x1e')](_0x4884ae);}};}function respondWithFilteredResult(_0x319162,_0x1c3cf7){return function(_0x4b0533){if(_0x4b0533){var _0x4e5d74=typeof _0x1c3cf7['offset']===_0xca98('0x1f')&&typeof _0x1c3cf7['limit']===_0xca98('0x1f');var _0x501be0=_0x4b0533['count'];var _0x4e8778=_0x4e5d74?0x0:_0x1c3cf7[_0xca98('0x20')];var _0x2b79b8=_0x4e5d74?_0x4b0533[_0xca98('0x21')]:_0x1c3cf7[_0xca98('0x20')]+_0x1c3cf7[_0xca98('0x22')];var _0x77f13b;if(_0x2b79b8>=_0x501be0){_0x2b79b8=_0x501be0;_0x77f13b=0xc8;}else{_0x77f13b=0xce;}_0x319162[_0xca98('0x1d')](_0x77f13b);return _0x319162['set'](_0xca98('0x23'),_0x4e8778+'-'+_0x2b79b8+'/'+_0x501be0)[_0xca98('0x1e')](_0x4b0533);}return null;};}function patchUpdates(_0x10fec6){return function(_0x4885cc){try{jsonpatch['apply'](_0x4885cc,_0x10fec6,!![]);}catch(_0x376050){return BPromise[_0xca98('0x24')](_0x376050);}return _0x4885cc[_0xca98('0x25')]();};}function saveUpdates(_0x2bd1c3,_0x407ba3){return function(_0x24e299){if(_0x24e299){return _0x24e299[_0xca98('0x26')](_0x2bd1c3)[_0xca98('0x27')](function(_0x41f20d){return _0x41f20d;});}return null;};}function removeEntity(_0x5d0630,_0x15ac5d){return function(_0x24e698){if(_0x24e698){return _0x24e698[_0xca98('0x28')]()[_0xca98('0x27')](function(){_0x5d0630[_0xca98('0x1d')](0xcc)[_0xca98('0x1c')]();});}};}function handleEntityNotFound(_0x3ce0aa,_0xa5c493){return function(_0xe6d4c6){if(!_0xe6d4c6){_0x3ce0aa[_0xca98('0x1b')](0x194);}return _0xe6d4c6;};}function handleError(_0x507664,_0x2c5235){_0x2c5235=_0x2c5235||0x1f4;return function(_0x3c8f8d){logger['error'](_0x3c8f8d[_0xca98('0x29')]);if(_0x3c8f8d[_0xca98('0x2a')]){delete _0x3c8f8d[_0xca98('0x2a')];}_0x507664[_0xca98('0x1d')](_0x2c5235)[_0xca98('0x2b')](_0x3c8f8d);};}exports[_0xca98('0x2c')]=function(_0x3231d1,_0x1e035c){var _0x4b369a={},_0xc31a44={},_0x441f3b={'count':0x0,'rows':[]};var _0x565c27=_[_0xca98('0x2d')](db[_0xca98('0x2e')]['rawAttributes'],function(_0x26ded9){return{'name':_0x26ded9[_0xca98('0x2f')],'type':_0x26ded9['type'][_0xca98('0x30')]};});_0xc31a44[_0xca98('0x31')]=_[_0xca98('0x2d')](_0x565c27,'name');_0xc31a44[_0xca98('0x32')]=_[_0xca98('0x33')](_0x3231d1['query']);_0xc31a44[_0xca98('0x34')]=_[_0xca98('0x35')](_0xc31a44['model'],_0xc31a44['query']);_0x4b369a[_0xca98('0x36')]=_['intersection'](_0xc31a44[_0xca98('0x31')],qs[_0xca98('0x37')](_0x3231d1[_0xca98('0x32')]['fields']));_0x4b369a[_0xca98('0x36')]=_0x4b369a[_0xca98('0x36')]['length']?_0x4b369a['attributes']:_0xc31a44[_0xca98('0x31')];if(!_0x3231d1[_0xca98('0x32')][_0xca98('0x38')](_0xca98('0x39'))){_0x4b369a['limit']=qs['limit'](_0x3231d1[_0xca98('0x32')]['limit']);_0x4b369a[_0xca98('0x20')]=qs[_0xca98('0x20')](_0x3231d1[_0xca98('0x32')]['offset']);}_0x4b369a['order']=qs['sort'](_0x3231d1[_0xca98('0x32')]['sort']);_0x4b369a['where']=qs[_0xca98('0x34')](_[_0xca98('0x3a')](_0x3231d1[_0xca98('0x32')],_0xc31a44['filters']),_0x565c27);if(_0x3231d1['query'][_0xca98('0x3b')]){_0x4b369a['where']=_[_0xca98('0x3c')](_0x4b369a[_0xca98('0x3d')],{'$or':_[_0xca98('0x2d')](_0x565c27,function(_0x5a59b2){if(_0x5a59b2[_0xca98('0x3e')]!==_0xca98('0x3f')){var _0x3e6eef={};_0x3e6eef[_0x5a59b2[_0xca98('0x2a')]]={'$like':'%'+_0x3231d1[_0xca98('0x32')]['filter']+'%'};return _0x3e6eef;}})});}_0x4b369a=_[_0xca98('0x3c')]({},_0x4b369a,_0x3231d1[_0xca98('0x40')]);var _0x18cb62={'where':_0x4b369a['where']};return db[_0xca98('0x2e')]['count'](_0x18cb62)[_0xca98('0x27')](function(_0x4483bd){_0x441f3b['count']=_0x4483bd;if(_0x3231d1[_0xca98('0x32')]['includeAll']){_0x4b369a[_0xca98('0x41')]=[{'all':!![]}];}return db[_0xca98('0x2e')]['findAll'](_0x4b369a);})['then'](function(_0x1f33ec){_0x441f3b[_0xca98('0x42')]=_0x1f33ec;return _0x441f3b;})[_0xca98('0x27')](respondWithFilteredResult(_0x1e035c,_0x4b369a))['catch'](handleError(_0x1e035c,null));};exports[_0xca98('0x43')]=function(_0x44aa2c,_0x20b782){var _0x39a5b4={'raw':!![],'where':{'id':_0x44aa2c[_0xca98('0x44')]['id']}},_0xcc02d={};_0xcc02d[_0xca98('0x31')]=_[_0xca98('0x33')](db['ChatTransferReport']['rawAttributes']);_0xcc02d['query']=_[_0xca98('0x33')](_0x44aa2c[_0xca98('0x32')]);_0xcc02d[_0xca98('0x34')]=_[_0xca98('0x35')](_0xcc02d[_0xca98('0x31')],_0xcc02d[_0xca98('0x32')]);_0x39a5b4[_0xca98('0x36')]=_[_0xca98('0x35')](_0xcc02d[_0xca98('0x31')],qs[_0xca98('0x37')](_0x44aa2c[_0xca98('0x32')][_0xca98('0x37')]));_0x39a5b4[_0xca98('0x36')]=_0x39a5b4[_0xca98('0x36')][_0xca98('0x45')]?_0x39a5b4[_0xca98('0x36')]:_0xcc02d['model'];if(_0x44aa2c[_0xca98('0x32')]['includeAll']){_0x39a5b4[_0xca98('0x41')]=[{'all':!![]}];}_0x39a5b4=_[_0xca98('0x3c')]({},_0x39a5b4,_0x44aa2c['options']);return db['ChatTransferReport'][_0xca98('0x46')](_0x39a5b4)['then'](handleEntityNotFound(_0x20b782,null))['then'](respondWithResult(_0x20b782,null))[_0xca98('0x47')](handleError(_0x20b782,null));};exports['create']=function(_0x1a82cd,_0x25c974){return db[_0xca98('0x2e')][_0xca98('0x48')](_0x1a82cd[_0xca98('0x49')],{})[_0xca98('0x27')](respondWithResult(_0x25c974,0xc9))[_0xca98('0x47')](handleError(_0x25c974,null));};exports[_0xca98('0x26')]=function(_0x3fea84,_0x330c3a){if(_0x3fea84[_0xca98('0x49')]['id']){delete _0x3fea84['body']['id'];}return db[_0xca98('0x2e')][_0xca98('0x46')]({'where':{'id':_0x3fea84[_0xca98('0x44')]['id']}})[_0xca98('0x27')](handleEntityNotFound(_0x330c3a,null))['then'](saveUpdates(_0x3fea84[_0xca98('0x49')],null))[_0xca98('0x27')](respondWithResult(_0x330c3a,null))[_0xca98('0x47')](handleError(_0x330c3a,null));};exports[_0xca98('0x28')]=function(_0x489253,_0x216901){return db[_0xca98('0x2e')][_0xca98('0x46')]({'where':{'id':_0x489253[_0xca98('0x44')]['id']}})['then'](handleEntityNotFound(_0x216901,null))[_0xca98('0x27')](removeEntity(_0x216901,null))[_0xca98('0x47')](handleError(_0x216901,null));};exports[_0xca98('0x4a')]=function(_0x54c06f,_0x1adb29){return db['ChatTransferReport'][_0xca98('0x4a')]()[_0xca98('0x27')](respondWithResult(_0x1adb29,null))[_0xca98('0x47')](handleError(_0x1adb29,null));};
\ No newline at end of file
+var _0x2ea2=['undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','name','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','params','include','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2199db,_0x64fe69){var _0x1823bc=function(_0x4f849b){while(--_0x4f849b){_0x2199db['push'](_0x2199db['shift']());}};_0x1823bc(++_0x64fe69);}(_0x2ea2,0x73));var _0x22ea=function(_0x23ca4a,_0x491470){_0x23ca4a=_0x23ca4a-0x0;var _0x392a33=_0x2ea2[_0x23ca4a];return _0x392a33;};'use strict';var emlformat=require(_0x22ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22ea('0x1'));var jsonpatch=require(_0x22ea('0x2'));var rp=require(_0x22ea('0x3'));var moment=require(_0x22ea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x22ea('0x5'));var util=require('util');var path=require('path');var sox=require(_0x22ea('0x6'));var csv=require(_0x22ea('0x7'));var ejs=require(_0x22ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x22ea('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x22ea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x22ea('0x7'));var querystring=require('querystring');var Papa=require(_0x22ea('0xb'));var Redis=require(_0x22ea('0xc'));var authService=require(_0x22ea('0xd'));var qs=require(_0x22ea('0xe'));var as=require(_0x22ea('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22ea('0x10'))(_0x22ea('0x11'));var utils=require(_0x22ea('0x12'));var config=require(_0x22ea('0x13'));var licenseUtil=require(_0x22ea('0x14'));var db=require(_0x22ea('0x15'))['db'];function respondWithStatusCode(_0x1f6f1c,_0x18b0c0){_0x18b0c0=_0x18b0c0||0xcc;return function(_0x444d9f){if(_0x444d9f){return _0x1f6f1c[_0x22ea('0x16')](_0x18b0c0);}return _0x1f6f1c[_0x22ea('0x17')](_0x18b0c0)[_0x22ea('0x18')]();};}function respondWithResult(_0x4b203e,_0x2a245b){_0x2a245b=_0x2a245b||0xc8;return function(_0x3d8982){if(_0x3d8982){return _0x4b203e['status'](_0x2a245b)[_0x22ea('0x19')](_0x3d8982);}};}function respondWithFilteredResult(_0x36d354,_0x307593){return function(_0x2263f7){if(_0x2263f7){var _0xbed39a=typeof _0x307593[_0x22ea('0x1a')]===_0x22ea('0x1b')&&typeof _0x307593[_0x22ea('0x1c')]===_0x22ea('0x1b');var _0x45a6e2=_0x2263f7[_0x22ea('0x1d')];var _0x56b35f=_0xbed39a?0x0:_0x307593[_0x22ea('0x1a')];var _0x152b86=_0xbed39a?_0x2263f7[_0x22ea('0x1d')]:_0x307593['offset']+_0x307593[_0x22ea('0x1c')];var _0x57b0ad;if(_0x152b86>=_0x45a6e2){_0x152b86=_0x45a6e2;_0x57b0ad=0xc8;}else{_0x57b0ad=0xce;}_0x36d354[_0x22ea('0x17')](_0x57b0ad);return _0x36d354['set'](_0x22ea('0x1e'),_0x56b35f+'-'+_0x152b86+'/'+_0x45a6e2)['json'](_0x2263f7);}return null;};}function patchUpdates(_0x4786b4){return function(_0x27cea7){try{jsonpatch[_0x22ea('0x1f')](_0x27cea7,_0x4786b4,!![]);}catch(_0x1b0377){return BPromise[_0x22ea('0x20')](_0x1b0377);}return _0x27cea7[_0x22ea('0x21')]();};}function saveUpdates(_0x4e5e80,_0x12bdf2){return function(_0x486870){if(_0x486870){return _0x486870[_0x22ea('0x22')](_0x4e5e80)['then'](function(_0x4b03eb){return _0x4b03eb;});}return null;};}function removeEntity(_0x4d3f4b,_0x1aa13c){return function(_0x5f0dce){if(_0x5f0dce){return _0x5f0dce[_0x22ea('0x23')]()[_0x22ea('0x24')](function(){_0x4d3f4b[_0x22ea('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217474,_0x12e51e){return function(_0x758b73){if(!_0x758b73){_0x217474[_0x22ea('0x16')](0x194);}return _0x758b73;};}function handleError(_0x124f7a,_0x255801){_0x255801=_0x255801||0x1f4;return function(_0x4f4d82){logger[_0x22ea('0x25')](_0x4f4d82['stack']);if(_0x4f4d82[_0x22ea('0x26')]){delete _0x4f4d82['name'];}_0x124f7a[_0x22ea('0x17')](_0x255801)['send'](_0x4f4d82);};}exports['index']=function(_0xf3aa34,_0x27ca1b){var _0x1af2b1={},_0x2cb7ce={},_0x31f537={'count':0x0,'rows':[]};var _0x2dfc60=_[_0x22ea('0x27')](db[_0x22ea('0x28')][_0x22ea('0x29')],function(_0x213d9a){return{'name':_0x213d9a[_0x22ea('0x2a')],'type':_0x213d9a[_0x22ea('0x2b')][_0x22ea('0x2c')]};});_0x2cb7ce[_0x22ea('0x2d')]=_[_0x22ea('0x27')](_0x2dfc60,'name');_0x2cb7ce['query']=_[_0x22ea('0x2e')](_0xf3aa34[_0x22ea('0x2f')]);_0x2cb7ce['filters']=_[_0x22ea('0x30')](_0x2cb7ce[_0x22ea('0x2d')],_0x2cb7ce[_0x22ea('0x2f')]);_0x1af2b1['attributes']=_[_0x22ea('0x30')](_0x2cb7ce[_0x22ea('0x2d')],qs['fields'](_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x31')]));_0x1af2b1[_0x22ea('0x32')]=_0x1af2b1['attributes'][_0x22ea('0x33')]?_0x1af2b1['attributes']:_0x2cb7ce['model'];if(!_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x34')]('nolimit')){_0x1af2b1['limit']=qs['limit'](_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x1c')]);_0x1af2b1[_0x22ea('0x1a')]=qs[_0x22ea('0x1a')](_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x1a')]);}_0x1af2b1['order']=qs['sort'](_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x35')]);_0x1af2b1[_0x22ea('0x36')]=qs[_0x22ea('0x37')](_[_0x22ea('0x38')](_0xf3aa34[_0x22ea('0x2f')],_0x2cb7ce[_0x22ea('0x37')]),_0x2dfc60);if(_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x39')]){_0x1af2b1[_0x22ea('0x36')]=_['merge'](_0x1af2b1[_0x22ea('0x36')],{'$or':_[_0x22ea('0x27')](_0x2dfc60,function(_0x5d2a8e){if(_0x5d2a8e['type']!==_0x22ea('0x3a')){var _0x2018fe={};_0x2018fe[_0x5d2a8e[_0x22ea('0x26')]]={'$like':'%'+_0xf3aa34['query']['filter']+'%'};return _0x2018fe;}})});}_0x1af2b1=_['merge']({},_0x1af2b1,_0xf3aa34[_0x22ea('0x3b')]);var _0x1e74ff={'where':_0x1af2b1[_0x22ea('0x36')]};return db[_0x22ea('0x28')]['count'](_0x1e74ff)[_0x22ea('0x24')](function(_0x24a82c){_0x31f537[_0x22ea('0x1d')]=_0x24a82c;if(_0xf3aa34[_0x22ea('0x2f')][_0x22ea('0x3c')]){_0x1af2b1['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x22ea('0x3d')](_0x1af2b1);})[_0x22ea('0x24')](function(_0x3d98cf){_0x31f537['rows']=_0x3d98cf;return _0x31f537;})[_0x22ea('0x24')](respondWithFilteredResult(_0x27ca1b,_0x1af2b1))[_0x22ea('0x3e')](handleError(_0x27ca1b,null));};exports[_0x22ea('0x3f')]=function(_0x350ed9,_0x49d5ab){var _0x28be64={'raw':!![],'where':{'id':_0x350ed9[_0x22ea('0x40')]['id']}},_0x582862={};_0x582862[_0x22ea('0x2d')]=_[_0x22ea('0x2e')](db[_0x22ea('0x28')][_0x22ea('0x29')]);_0x582862[_0x22ea('0x2f')]=_[_0x22ea('0x2e')](_0x350ed9[_0x22ea('0x2f')]);_0x582862[_0x22ea('0x37')]=_['intersection'](_0x582862[_0x22ea('0x2d')],_0x582862['query']);_0x28be64['attributes']=_[_0x22ea('0x30')](_0x582862[_0x22ea('0x2d')],qs['fields'](_0x350ed9['query'][_0x22ea('0x31')]));_0x28be64['attributes']=_0x28be64[_0x22ea('0x32')][_0x22ea('0x33')]?_0x28be64['attributes']:_0x582862[_0x22ea('0x2d')];if(_0x350ed9[_0x22ea('0x2f')]['includeAll']){_0x28be64[_0x22ea('0x41')]=[{'all':!![]}];}_0x28be64=_[_0x22ea('0x42')]({},_0x28be64,_0x350ed9[_0x22ea('0x3b')]);return db['ChatTransferReport'][_0x22ea('0x43')](_0x28be64)[_0x22ea('0x24')](handleEntityNotFound(_0x49d5ab,null))[_0x22ea('0x24')](respondWithResult(_0x49d5ab,null))['catch'](handleError(_0x49d5ab,null));};exports[_0x22ea('0x44')]=function(_0x7f625e,_0x3d3944){return db[_0x22ea('0x28')]['create'](_0x7f625e['body'],{})[_0x22ea('0x24')](respondWithResult(_0x3d3944,0xc9))['catch'](handleError(_0x3d3944,null));};exports[_0x22ea('0x22')]=function(_0x1c108b,_0x2cad54){if(_0x1c108b[_0x22ea('0x45')]['id']){delete _0x1c108b[_0x22ea('0x45')]['id'];}return db[_0x22ea('0x28')][_0x22ea('0x43')]({'where':{'id':_0x1c108b[_0x22ea('0x40')]['id']}})[_0x22ea('0x24')](handleEntityNotFound(_0x2cad54,null))[_0x22ea('0x24')](saveUpdates(_0x1c108b['body'],null))[_0x22ea('0x24')](respondWithResult(_0x2cad54,null))[_0x22ea('0x3e')](handleError(_0x2cad54,null));};exports[_0x22ea('0x23')]=function(_0x64993b,_0xa1eeca){return db[_0x22ea('0x28')][_0x22ea('0x43')]({'where':{'id':_0x64993b[_0x22ea('0x40')]['id']}})[_0x22ea('0x24')](handleEntityNotFound(_0xa1eeca,null))[_0x22ea('0x24')](removeEntity(_0xa1eeca,null))[_0x22ea('0x3e')](handleError(_0xa1eeca,null));};exports[_0x22ea('0x46')]=function(_0x15c8da,_0x381e31){return db[_0x22ea('0x28')]['describe']()[_0x22ea('0x24')](respondWithResult(_0x381e31,null))[_0x22ea('0x3e')](handleError(_0x381e31,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 8de4639..ae9b666 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 _0x3c4e=['../../config/logger','api','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x14ebc1,_0x50e244){var _0x25b70f=function(_0x1b3965){while(--_0x1b3965){_0x14ebc1['push'](_0x14ebc1['shift']());}};_0x25b70f(++_0x50e244);}(_0x3c4e,0x184));var _0xe3c4=function(_0x489b27,_0x1131a0){_0x489b27=_0x489b27-0x0;var _0x39cb1b=_0x3c4e[_0x489b27];return _0x39cb1b;};'use strict';var _=require(_0xe3c4('0x0'));var util=require(_0xe3c4('0x1'));var logger=require(_0xe3c4('0x2'))(_0xe3c4('0x3'));var moment=require('moment');var BPromise=require(_0xe3c4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3c4('0x5'));var rimraf=require('rimraf');var config=require(_0xe3c4('0x6'));var attributes=require(_0xe3c4('0x7'));module[_0xe3c4('0x8')]=function(_0x567cf6,_0x2e31a4){return _0x567cf6[_0xe3c4('0x9')](_0xe3c4('0xa'),attributes,{'tableName':_0xe3c4('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe3c4('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9160=['rimraf','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x41c19c,_0x43f4ef){var _0x14e900=function(_0xff3679){while(--_0xff3679){_0x41c19c['push'](_0x41c19c['shift']());}};_0x14e900(++_0x43f4ef);}(_0x9160,0x1c2));var _0x0916=function(_0x5df47d,_0x56b70d){_0x5df47d=_0x5df47d-0x0;var _0x503d79=_0x9160[_0x5df47d];return _0x503d79;};'use strict';var _=require(_0x0916('0x0'));var util=require(_0x0916('0x1'));var logger=require(_0x0916('0x2'))(_0x0916('0x3'));var moment=require(_0x0916('0x4'));var BPromise=require('bluebird');var rp=require(_0x0916('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0916('0x6'));var config=require(_0x0916('0x7'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3214ae,_0x5dacc){return _0x3214ae[_0x0916('0x8')](_0x0916('0x9'),attributes,{'tableName':_0x0916('0xa'),'paranoid':![],'indexes':[{'name':_0x0916('0xb'),'fields':[_0x0916('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 25bc8fd..9e33598 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 _0x12a0=['request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x12a0,0x90));var _0x012a=function(_0x325bb1,_0x5e82d7){_0x325bb1=_0x325bb1-0x0;var _0x402ab0=_0x12a0[_0x325bb1];return _0x402ab0;};'use strict';var _=require('lodash');var util=require(_0x012a('0x0'));var moment=require(_0x012a('0x1'));var BPromise=require(_0x012a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x012a('0x3'));var db=require(_0x012a('0x4'))['db'];var utils=require(_0x012a('0x5'));var logger=require(_0x012a('0x6'))('rpc');var config=require(_0x012a('0x7'));var jayson=require(_0x012a('0x8'));var client=jayson[_0x012a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18bb00,_0x59ccae,_0x185e10){return new BPromise(function(_0x35dab6,_0x58e59a){return client[_0x012a('0xa')](_0x18bb00,_0x185e10)['then'](function(_0x4e8c21){logger[_0x012a('0xb')](_0x012a('0xc'),_0x59ccae,'request\x20sent');logger[_0x012a('0xd')](_0x012a('0xe'),_0x59ccae,_0x012a('0xf'),JSON[_0x012a('0x10')](_0x4e8c21));if(_0x4e8c21[_0x012a('0x11')]){if(_0x4e8c21['error'][_0x012a('0x12')]===0x1f4){logger['error'](_0x012a('0xc'),_0x59ccae,_0x4e8c21[_0x012a('0x11')][_0x012a('0x13')]);return _0x58e59a(_0x4e8c21[_0x012a('0x11')][_0x012a('0x13')]);}logger[_0x012a('0x11')](_0x012a('0xc'),_0x59ccae,_0x4e8c21[_0x012a('0x11')]['message']);return _0x35dab6(_0x4e8c21['error'][_0x012a('0x13')]);}else{logger[_0x012a('0xb')](_0x012a('0xc'),_0x59ccae,'request\x20sent');_0x35dab6(_0x4e8c21[_0x012a('0x14')][_0x012a('0x13')]);}})[_0x012a('0x15')](function(_0x5791d9){logger['error'](_0x012a('0xc'),_0x59ccae,_0x5791d9);_0x58e59a(_0x5791d9);});});}
\ No newline at end of file
+var _0x9487=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x9487,0x6c));var _0x7948=function(_0x21f7ee,_0x5c38f0){_0x21f7ee=_0x21f7ee-0x0;var _0x12079a=_0x9487[_0x21f7ee];return _0x12079a;};'use strict';var _=require(_0x7948('0x0'));var util=require('util');var moment=require(_0x7948('0x1'));var BPromise=require(_0x7948('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7948('0x3'))['db'];var utils=require(_0x7948('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7948('0x5'));var client=jayson[_0x7948('0x6')][_0x7948('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c7366,_0x5b399d,_0x1e2368){return new BPromise(function(_0x5ad6f1,_0x2f1e1d){return client[_0x7948('0x8')](_0x4c7366,_0x1e2368)[_0x7948('0x9')](function(_0x9ae07a){logger['info'](_0x7948('0xa'),_0x5b399d,_0x7948('0xb'));logger[_0x7948('0xc')](_0x7948('0xd'),_0x5b399d,_0x7948('0xb'),JSON[_0x7948('0xe')](_0x9ae07a));if(_0x9ae07a[_0x7948('0xf')]){if(_0x9ae07a[_0x7948('0xf')][_0x7948('0x10')]===0x1f4){logger[_0x7948('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x5b399d,_0x9ae07a[_0x7948('0xf')][_0x7948('0x11')]);return _0x2f1e1d(_0x9ae07a[_0x7948('0xf')][_0x7948('0x11')]);}logger[_0x7948('0xf')](_0x7948('0xa'),_0x5b399d,_0x9ae07a[_0x7948('0xf')][_0x7948('0x11')]);return _0x5ad6f1(_0x9ae07a[_0x7948('0xf')][_0x7948('0x11')]);}else{logger[_0x7948('0x12')](_0x7948('0xa'),_0x5b399d,_0x7948('0xb'));_0x5ad6f1(_0x9ae07a['result']['message']);}})[_0x7948('0x13')](function(_0x277395){logger[_0x7948('0xf')](_0x7948('0xa'),_0x5b399d,_0x277395);_0x2f1e1d(_0x277395);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 64127e8..4a50d47 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 _0x11c7=['get','isAuthenticated','/describe','describe','post','create','put','/:id','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0x11c7,0x187));var _0x711c=function(_0x18f0f2,_0xae74ba){_0x18f0f2=_0x18f0f2-0x0;var _0x30d497=_0x11c7[_0x18f0f2];return _0x30d497;};'use strict';var multer=require(_0x711c('0x0'));var util=require(_0x711c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x711c('0x2'));var router=express['Router']();var fs_extra=require(_0x711c('0x3'));var auth=require(_0x711c('0x4'));var interaction=require(_0x711c('0x5'));var config=require(_0x711c('0x6'));var controller=require(_0x711c('0x7'));router[_0x711c('0x8')]('/',auth[_0x711c('0x9')](),controller['index']);router['get'](_0x711c('0xa'),auth['isAuthenticated'](),controller[_0x711c('0xb')]);router[_0x711c('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x711c('0xc')]('/',auth[_0x711c('0x9')](),controller[_0x711c('0xd')]);router[_0x711c('0xe')](_0x711c('0xf'),auth[_0x711c('0x9')](),controller[_0x711c('0x10')]);router['delete'](_0x711c('0xf'),auth['isAuthenticated'](),controller[_0x711c('0x11')]);module[_0x711c('0x12')]=router;
\ No newline at end of file
+var _0x0f1f=['index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x41fad2,_0xe2dc0e){var _0x67dac0=function(_0x3271a2){while(--_0x3271a2){_0x41fad2['push'](_0x41fad2['shift']());}};_0x67dac0(++_0xe2dc0e);}(_0x0f1f,0x69));var _0xf0f1=function(_0x464507,_0x28b145){_0x464507=_0x464507-0x0;var _0x3f6072=_0x0f1f[_0x464507];return _0x3f6072;};'use strict';var multer=require('multer');var util=require(_0xf0f1('0x0'));var path=require(_0xf0f1('0x1'));var timeout=require(_0xf0f1('0x2'));var express=require('express');var router=express[_0xf0f1('0x3')]();var fs_extra=require(_0xf0f1('0x4'));var auth=require(_0xf0f1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf0f1('0x6'));var controller=require('./chatTransferReport.controller');router[_0xf0f1('0x7')]('/',auth[_0xf0f1('0x8')](),controller[_0xf0f1('0x9')]);router[_0xf0f1('0x7')]('/describe',auth[_0xf0f1('0x8')](),controller['describe']);router[_0xf0f1('0x7')](_0xf0f1('0xa'),auth[_0xf0f1('0x8')](),controller[_0xf0f1('0xb')]);router[_0xf0f1('0xc')]('/',auth['isAuthenticated'](),controller[_0xf0f1('0xd')]);router[_0xf0f1('0xe')](_0xf0f1('0xa'),auth[_0xf0f1('0x8')](),controller[_0xf0f1('0xf')]);router[_0xf0f1('0x10')](_0xf0f1('0xa'),auth[_0xf0f1('0x8')](),controller[_0xf0f1('0x11')]);module[_0xf0f1('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index f16c8e1..6d61783 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 _0xb86c=['#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','#011F6A'];(function(_0x1989af,_0x14c79e){var _0x442b7d=function(_0x3771a2){while(--_0x3771a2){_0x1989af['push'](_0x1989af['shift']());}};_0x442b7d(++_0x14c79e);}(_0xb86c,0x18b));var _0xcb86=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xb86c[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xcb86('0x0'));module['exports']={'name':{'type':Sequelize[_0xcb86('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xcb86('0x1')],'allowNull':![],'unique':_0xcb86('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x3')},'mapKeyOffline':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':'email'},'key':{'type':Sequelize[_0xcb86('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xcb86('0x1')],'allowNull':![],'defaultValue':_0xcb86('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xcb86('0x1')],'allowNull':![],'defaultValue':_0xcb86('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xcb86('0x1')],'allowNull':![],'defaultValue':_0xcb86('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcb86('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xcb86('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xcb86('0x1')]},'animation':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xcb86('0x8')](_0xcb86('0x9'),_0xcb86('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0xb')},'start_chat_button':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0xc')},'offline_chat_button':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0xd')},'header_offline':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xcb86('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xcb86('0xf')]},'closingQuestion':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x12')},'closingMessage':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x13')},'closingMessageButton':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0xd')},'skipMessageButton':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x14')},'conditionAgreement':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x15')},'ratingType':{'type':Sequelize[_0xcb86('0x8')]('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xcb86('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xcb86('0xf')],'defaultValue':function(){return JSON[_0xcb86('0x16')]({'items':[{'type':_0xcb86('0x17'),'variable':null,'config':{'placeholder':_0xcb86('0x18'),'type':_0xcb86('0x19'),'required':!![]},'props':{'title':_0xcb86('0x18'),'helpText':''}},{'type':_0xcb86('0x17'),'props':{'title':_0xcb86('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xcb86('0x3'),'type':_0xcb86('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xcb86('0x1a')]('onlineForm')?JSON[_0xcb86('0x1b')](this[_0xcb86('0x1a')](_0xcb86('0x1c'))):{};},'set':function(_0x618788){return this[_0xcb86('0x1d')](_0xcb86('0x1c'),JSON[_0xcb86('0x16')](_0x618788));}},'offlineForm':{'type':Sequelize[_0xcb86('0xf')],'defaultValue':function(){return JSON[_0xcb86('0x16')]({'items':[{'type':_0xcb86('0x17'),'props':{'title':_0xcb86('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xcb86('0x3'),'type':_0xcb86('0x3')},'variable':null},{'type':_0xcb86('0x1e'),'config':{'placeholder':_0xcb86('0x1f')},'props':{'title':_0xcb86('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xcb86('0x1a')]('offlineForm')?JSON[_0xcb86('0x1b')](this[_0xcb86('0x1a')](_0xcb86('0x20'))):{};},'set':function(_0x1f9893){return this[_0xcb86('0x1d')](_0xcb86('0x20'),JSON[_0xcb86('0x16')](_0x1f9893));}},'token':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':function(){return rs[_0xcb86('0x21')]();}},'autoclose':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xcb86('0x1')]},'forwardOffline':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xcb86('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xcb86('0x22')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xcb86('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x24')},'offlineMessageBody':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xcb86('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xcb86('0x14')},'sendUnmanaged':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xcb86('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xcb86('0x1')]},'notificationTemplate':{'type':Sequelize[_0xcb86('0xf')],'defaultValue':function(){return _0xcb86('0x27');}},'notificationSound':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xcb86('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xcb86('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xcb86('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x29')},'verticalAlignment':{'type':Sequelize[_0xcb86('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xcb86('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xcb86('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xcb86('0x1')],'allowNull':![],'defaultValue':_0xcb86('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcb86('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xcb86('0x1')],'defaultValue':_0xcb86('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xcb86('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcb86('0x2d'),'set':function(_0x79998f){if(!_0x79998f)this[_0xcb86('0x1d')](_0xcb86('0x2e'),null);this[_0xcb86('0x1d')](_0xcb86('0x2f'),_0x79998f);}},'vidaooEscalation':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xcb86('0x1')]},'vidaooTopic':{'type':Sequelize[_0xcb86('0x1')],'allowNull':![],'defaultValue':_0xcb86('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xcb86('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xcb86('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x0aa5=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','onlineForm','getDataValue','setDataValue','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId'];(function(_0x2971e6,_0x4a962e){var _0x5e6392=function(_0x16e6cf){while(--_0x16e6cf){_0x2971e6['push'](_0x2971e6['shift']());}};_0x5e6392(++_0x4a962e);}(_0x0aa5,0x11b));var _0x50aa=function(_0x54ac7c,_0x219d13){_0x54ac7c=_0x54ac7c-0x0;var _0xa4b01c=_0x0aa5[_0x54ac7c];return _0xa4b01c;};'use strict';var Sequelize=require(_0x50aa('0x0'));var rs=require(_0x50aa('0x1'));module['exports']={'name':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'unique':_0x50aa('0x3')},'description':{'type':Sequelize[_0x50aa('0x2')]},'mapKey':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x4')},'mapKeyOffline':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x4')},'key':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x5')},'customerAlias':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'defaultValue':_0x50aa('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50aa('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'defaultValue':_0x50aa('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'defaultValue':_0x50aa('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x50aa('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x50aa('0xa'),_0x50aa('0xb')),'defaultValue':_0x50aa('0xa')},'header_online':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xc')},'start_chat_button':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xd')},'offline_chat_button':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xe')},'header_offline':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xf')},'download_transcript':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x50aa('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x50aa('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x12')},'placeholderMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x13')},'closingMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x14')},'closingMessageButton':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xe')},'skipMessageButton':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x15')},'conditionAgreement':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x50aa('0x17'),_0x50aa('0x18')),'defaultValue':_0x50aa('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x50aa('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x50aa('0x10')],'defaultValue':function(){return JSON[_0x50aa('0x19')]({'items':[{'type':_0x50aa('0x1a'),'variable':null,'config':{'placeholder':_0x50aa('0x1b'),'type':'text','required':!![]},'props':{'title':_0x50aa('0x1b'),'helpText':''}},{'type':_0x50aa('0x1a'),'props':{'title':_0x50aa('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50aa('0x4'),'type':_0x50aa('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x50aa('0x1c'))?JSON['parse'](this[_0x50aa('0x1d')]('onlineForm')):{};},'set':function(_0x4ab514){return this[_0x50aa('0x1e')](_0x50aa('0x1c'),JSON[_0x50aa('0x19')](_0x4ab514));}},'offlineForm':{'type':Sequelize[_0x50aa('0x10')],'defaultValue':function(){return JSON[_0x50aa('0x19')]({'items':[{'type':_0x50aa('0x1a'),'props':{'title':_0x50aa('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50aa('0x4'),'type':'email'},'variable':null},{'type':_0x50aa('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x50aa('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x50aa('0x1d')](_0x50aa('0x21'))?JSON['parse'](this[_0x50aa('0x1d')]('offlineForm')):{};},'set':function(_0x29f9ec){return this[_0x50aa('0x1e')](_0x50aa('0x21'),JSON[_0x50aa('0x19')](_0x29f9ec));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x50aa('0x22')]();}},'autoclose':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x50aa('0x2')]},'forwardOffline':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x50aa('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x26')},'skipUnmanaged':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x15')},'sendUnmanaged':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x50aa('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x50aa('0x2')]},'notificationTemplate':{'type':Sequelize[_0x50aa('0x10')],'defaultValue':function(){return _0x50aa('0x27');}},'notificationSound':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x50aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x50aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x50aa('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x50aa('0x29')},'messagesAlignment':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':_0x50aa('0x2a')},'defaultTitle':{'type':Sequelize[_0x50aa('0x2')]},'customerAvatar':{'type':Sequelize[_0x50aa('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x50aa('0x2')],'allowNull':![],'defaultValue':_0x50aa('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x50aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x50aa('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x50aa('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50aa('0x8')],'comment':_0x50aa('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4ccaab){if(!_0x4ccaab)this[_0x50aa('0x1e')](_0x50aa('0x2d'),null);this['setDataValue']('mandatoryDisposition',_0x4ccaab);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x50aa('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x50aa('0x2')],'defaultValue':function(){return _0x50aa('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x50aa('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x50aa('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x50aa('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 34f3475..cb33853 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 _0xa571=['stringify','error','code','message','info','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','device','model','%s\x20%s\x20%s','type','vendor','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','ChatWebsite','includeAll','findAll','rows','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','body','describe','Disposition','getDispositions','findOne','nolimit','pick','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','include','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','systemAvatar','chat','from','From\x20is\x20mandatory','Body\x20is\x20mandatory','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','mapKey','List','Contacts','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','ifTime','account','list','orderBy','priority','asc','CmContact','contact','headers','threadId','closed','ChatInteraction','externalUrl','interaction','lastName','messageId','created','applications','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','Sequelize','ValidationError','no\x20available\x20attributes','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','fromString','mimetype','server','files','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','User','Owner','fullname','Tag','Tags','color','tag','getSnippet','getProactiveActions','getLicense','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','utf8','URL','address','3.8.1','x-real-ip','connection','remoteAddress','virtual','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','ISOLATION_LEVELS','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','false','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa571,0x107));var _0x1a57=function(_0x3e57cb,_0xb023b8){_0x3e57cb=_0x3e57cb-0x0;var _0x21468f=_0xa571[_0x3e57cb];return _0x21468f;};'use strict';var Mustache=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var ejs=require(_0x1a57('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a57('0x4'));var querystring=require(_0x1a57('0x5'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var jayson=require(_0x1a57('0x6'));var url=require('url');var qs=require(_0x1a57('0x7'));var logger=require(_0x1a57('0x8'))(_0x1a57('0x9'));var config=require(_0x1a57('0xa'));var APIBadRequestError=require(_0x1a57('0xb'))[_0x1a57('0xc')];var APINotFoundError=require('../../errors/api')[_0x1a57('0xd')];var APIOutOfIntervalError=require(_0x1a57('0xb'))[_0x1a57('0xe')];var APIHandleError=require('../../errors/api')[_0x1a57('0xf')];var APIConflictError=require(_0x1a57('0xb'))[_0x1a57('0x10')];var db=require(_0x1a57('0x11'))['db'];config[_0x1a57('0x12')]=_[_0x1a57('0x13')](config[_0x1a57('0x12')],{'host':_0x1a57('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1a57('0x15'))[_0x1a57('0x16')](socket);var client=jayson[_0x1a57('0x17')]['http']({'port':0x232c});var client9002=jayson[_0x1a57('0x17')][_0x1a57('0x18')]({'port':0x232a});var client9003=jayson['client'][_0x1a57('0x18')]({'port':0x232b});var client9001=jayson['client'][_0x1a57('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x17434c,_0x27e824,_0x153d01,_0x5802d6){return new Promise(function(_0x20f7ad,_0x53c61f){var _0x49ee05=_0x5802d6||client;return _0x49ee05[_0x1a57('0x19')](_0x17434c,_0x153d01)[_0x1a57('0x1a')](function(_0x22f400){logger['info'](_0x1a57('0x1b'),_0x27e824,_0x1a57('0x1c'));logger[_0x1a57('0x1d')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x27e824,_0x1a57('0x1c'),JSON[_0x1a57('0x1e')](_0x22f400));if(_0x22f400[_0x1a57('0x1f')]){if(_0x22f400[_0x1a57('0x1f')][_0x1a57('0x20')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x27e824,_0x22f400[_0x1a57('0x1f')][_0x1a57('0x21')]);return _0x53c61f(_0x22f400[_0x1a57('0x1f')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x27e824,_0x22f400[_0x1a57('0x1f')][_0x1a57('0x21')]);return _0x20f7ad(_0x22f400[_0x1a57('0x1f')][_0x1a57('0x21')]);}else{logger[_0x1a57('0x22')](_0x1a57('0x1b'),_0x27e824,_0x1a57('0x1c'));_0x20f7ad(_0x22f400[_0x1a57('0x23')][_0x1a57('0x21')]);}})[_0x1a57('0x24')](function(_0x29e7cd){logger[_0x1a57('0x1f')](_0x1a57('0x1b'),_0x27e824,_0x29e7cd);_0x53c61f(_0x29e7cd);});});}function respondWithStatusCode(_0x1b4cb5,_0x2f9454){_0x2f9454=_0x2f9454||0xcc;return function(_0x182649){if(_0x182649){return _0x1b4cb5[_0x1a57('0x25')](_0x2f9454);}return _0x1b4cb5[_0x1a57('0x26')](_0x2f9454)[_0x1a57('0x27')]();};}function respondWithResult(_0xf6ffef,_0x26584b){_0x26584b=_0x26584b||0xc8;return function(_0x1dd939){if(_0x1dd939){return _0xf6ffef['status'](_0x26584b)['json'](_0x1dd939);}};}function respondWithFilteredResult(_0x139d8c,_0x22549f){return function(_0x545041){if(_0x545041){var _0x46dac6=typeof _0x22549f['offset']===_0x1a57('0x28')&&typeof _0x22549f[_0x1a57('0x29')]==='undefined';var _0x8179a4=_0x545041[_0x1a57('0x2a')];var _0x30527c=_0x46dac6?0x0:_0x22549f[_0x1a57('0x2b')];var _0x492b90=_0x46dac6?_0x545041[_0x1a57('0x2a')]:_0x22549f[_0x1a57('0x2b')]+_0x22549f[_0x1a57('0x29')];var _0x160536;if(_0x492b90>=_0x8179a4){_0x492b90=_0x8179a4;_0x160536=0xc8;}else{_0x160536=0xce;}_0x139d8c['status'](_0x160536);return _0x139d8c[_0x1a57('0x2c')](_0x1a57('0x2d'),_0x30527c+'-'+_0x492b90+'/'+_0x8179a4)[_0x1a57('0x2e')](_0x545041);}return null;};}function saveUpdates(_0x32f79f){return function(_0x3ac6ff){if(_0x3ac6ff){return _0x3ac6ff[_0x1a57('0x2f')](_0x32f79f)[_0x1a57('0x1a')](function(_0x1e7f0d){return _0x1e7f0d;});}return null;};}function removeEntity(_0x154cba){return function(_0x4c1acc){if(_0x4c1acc){return _0x4c1acc[_0x1a57('0x30')]()[_0x1a57('0x1a')](function(){var _0x497488=_0x4c1acc['get']({'plain':!![]});var _0x17b12e=_0x1a57('0x31');return db[_0x1a57('0x32')][_0x1a57('0x30')]({'where':{'type':_0x17b12e,'resourceId':_0x497488['id']}})[_0x1a57('0x1a')](function(){return _0x4c1acc;});})[_0x1a57('0x1a')](function(){_0x154cba[_0x1a57('0x26')](0xcc)[_0x1a57('0x27')]();});}};}function handleEntityNotFound(_0x3f14ca){return function(_0x2a6feb){if(!_0x2a6feb){_0x3f14ca[_0x1a57('0x25')](0x194);}return _0x2a6feb;};}function handleError(_0x24025c,_0x12f3a7){_0x12f3a7=_0x12f3a7||0x1f4;return function(_0x1a6231){logger[_0x1a57('0x1f')](_0x1a6231[_0x1a57('0x33')]);if(_0x1a6231[_0x1a57('0x34')]){delete _0x1a6231[_0x1a57('0x34')];}_0x24025c['status'](_0x12f3a7)[_0x1a57('0x35')](_0x1a6231);};}function createInteractionObject(_0x173671,_0x137920,_0x3dad7c,_0x58b7dc){var _0xf64cb5=require(_0x1a57('0x36'));var _0x23d087=new _0xf64cb5();var _0x1b6514=_0x23d087['setUA'](_0x3dad7c['user-agent'])['getResult']();var _0x50a38c=_0x137920[_0x1a57('0x37')];if(_0x3dad7c[_0x1a57('0x38')]){_0x50a38c=_0x3dad7c[_0x1a57('0x38')];}else if(_0x3dad7c['x-forwarded-for']){_0x50a38c=_[_0x1a57('0x39')](_0x3dad7c[_0x1a57('0x3a')][_0x1a57('0x3b')](','));}return{'ContactId':_0x58b7dc['id'],'ChatWebsiteId':_0x173671,'from':(_0x58b7dc[_0x1a57('0x3c')]||'')+'\x20'+(_0x58b7dc['lastName']||''),'customerIp':_0x50a38c,'customerPort':_0x3dad7c[_0x1a57('0x3d')]?_0x3dad7c['x-real-port']:null,'referer':_0x137920[_0x1a57('0x3e')],'browserName':_0x1b6514[_0x1a57('0x3f')][_0x1a57('0x34')]&&_0x1b6514['browser'][_0x1a57('0x40')]?util[_0x1a57('0x41')](_0x1a57('0x42'),_0x1b6514[_0x1a57('0x3f')][_0x1a57('0x34')],_0x1b6514['browser'][_0x1a57('0x40')]):'unknown','browserVersion':_0x1b6514['browser'][_0x1a57('0x40')]||'unknown','osName':util[_0x1a57('0x41')](_0x1a57('0x42'),_0x1b6514['os'][_0x1a57('0x34')],_0x1b6514['os']['version']),'osVersion':_0x1b6514['os'][_0x1a57('0x40')],'deviceModel':_0x1b6514[_0x1a57('0x43')][_0x1a57('0x44')]&&_0x1b6514[_0x1a57('0x43')]['vendor']?util[_0x1a57('0x41')](_0x1a57('0x45'),_0x1b6514['device'][_0x1a57('0x44')],_0x1b6514['device']['vendor'],_0x1b6514[_0x1a57('0x43')][_0x1a57('0x46')]):null,'deviceVendor':_0x1b6514[_0x1a57('0x43')][_0x1a57('0x47')],'deviceType':_0x1b6514['device'][_0x1a57('0x46')],'formData':JSON[_0x1a57('0x1e')](_0x137920)};}exports[_0x1a57('0x48')]=function(_0x1b4231,_0x473524){var _0x498b30={'include':[{'model':db[_0x1a57('0x49')],'as':_0x1a57('0x4a')}]},_0x400ac3={},_0x1175ca={'count':0x0,'rows':[]};var _0x4e540d=_[_0x1a57('0x4b')](db['ChatWebsite'][_0x1a57('0x4c')],function(_0x36f8dc){return{'name':_0x36f8dc[_0x1a57('0x4d')],'type':_0x36f8dc[_0x1a57('0x46')][_0x1a57('0x4e')]};});_0x400ac3[_0x1a57('0x44')]=_[_0x1a57('0x4b')](_0x4e540d,_0x1a57('0x34'));_0x400ac3[_0x1a57('0x4f')]=_[_0x1a57('0x50')](_0x1b4231[_0x1a57('0x4f')]);_0x400ac3[_0x1a57('0x51')]=_[_0x1a57('0x52')](_0x400ac3['model'],_0x400ac3[_0x1a57('0x4f')]);_0x498b30[_0x1a57('0x53')]=_[_0x1a57('0x52')](_0x400ac3[_0x1a57('0x44')],qs[_0x1a57('0x54')](_0x1b4231[_0x1a57('0x4f')][_0x1a57('0x54')]));_0x498b30[_0x1a57('0x53')]=_0x498b30[_0x1a57('0x53')][_0x1a57('0x55')]?_0x498b30[_0x1a57('0x53')]:_0x400ac3['model'];if(!_0x1b4231[_0x1a57('0x4f')][_0x1a57('0x56')]('nolimit')){_0x498b30[_0x1a57('0x29')]=qs[_0x1a57('0x29')](_0x1b4231['query'][_0x1a57('0x29')]);_0x498b30[_0x1a57('0x2b')]=qs['offset'](_0x1b4231['query']['offset']);}_0x498b30[_0x1a57('0x57')]=qs[_0x1a57('0x58')](_0x1b4231['query'][_0x1a57('0x58')]);_0x498b30[_0x1a57('0x59')]=qs['filters'](_['pick'](_0x1b4231['query'],_0x400ac3[_0x1a57('0x51')]),_0x4e540d);if(_0x1b4231[_0x1a57('0x4f')][_0x1a57('0x5a')]){_0x498b30[_0x1a57('0x59')]=_[_0x1a57('0x5b')](_0x498b30[_0x1a57('0x59')],{'$or':_[_0x1a57('0x4b')](_0x4e540d,function(_0x1f705b){if(_0x1f705b['type']!=='VIRTUAL'){var _0x48308b={};_0x48308b[_0x1f705b['name']]={'$like':'%'+_0x1b4231['query'][_0x1a57('0x5a')]+'%'};return _0x48308b;}})});}_0x498b30=_[_0x1a57('0x5b')]({},_0x498b30,_0x1b4231[_0x1a57('0x5c')]);var _0xeaa3d4={'where':_0x498b30[_0x1a57('0x59')]};return db[_0x1a57('0x5d')][_0x1a57('0x2a')](_0xeaa3d4)[_0x1a57('0x1a')](function(_0x4b20ed){_0x1175ca['count']=_0x4b20ed;if(_0x1b4231['query'][_0x1a57('0x5e')]){_0x498b30['include']=[{'all':!![]}];}return db[_0x1a57('0x5d')][_0x1a57('0x5f')](_0x498b30);})[_0x1a57('0x1a')](function(_0x352aca){_0x1175ca[_0x1a57('0x60')]=_0x352aca;return _0x1175ca;})[_0x1a57('0x1a')](respondWithFilteredResult(_0x473524,_0x498b30))[_0x1a57('0x24')](handleError(_0x473524,null));};exports['show']=function(_0x4e56b5,_0x4d5b1d){var _0xc936a7={'raw':![],'where':{'id':_0x4e56b5[_0x1a57('0x61')]['id']},'include':[{'model':db[_0x1a57('0x49')],'as':_0x1a57('0x4a')}]},_0x562775={};_0x562775[_0x1a57('0x44')]=_[_0x1a57('0x50')](db['ChatWebsite']['rawAttributes']);_0x562775[_0x1a57('0x4f')]=_[_0x1a57('0x50')](_0x4e56b5[_0x1a57('0x4f')]);_0x562775[_0x1a57('0x51')]=_[_0x1a57('0x52')](_0x562775[_0x1a57('0x44')],_0x562775['query']);_0xc936a7['attributes']=_[_0x1a57('0x52')](_0x562775[_0x1a57('0x44')],qs['fields'](_0x4e56b5['query'][_0x1a57('0x54')]));_0xc936a7[_0x1a57('0x53')]=_0xc936a7[_0x1a57('0x53')][_0x1a57('0x55')]?_0xc936a7[_0x1a57('0x53')]:_0x562775[_0x1a57('0x44')];if(_0x4e56b5[_0x1a57('0x4f')]['includeAll']){_0xc936a7['include']=[{'all':!![]}];}_0xc936a7=_[_0x1a57('0x5b')]({},_0xc936a7,_0x4e56b5[_0x1a57('0x5c')]);return db[_0x1a57('0x5d')][_0x1a57('0x62')](_0xc936a7)['then'](handleEntityNotFound(_0x4d5b1d,null))[_0x1a57('0x1a')](respondWithResult(_0x4d5b1d,null))[_0x1a57('0x24')](handleError(_0x4d5b1d,null));};exports[_0x1a57('0x63')]=function(_0x33c8d4,_0x1f4371){return db['ChatWebsite']['create'](_0x33c8d4['body'],{})[_0x1a57('0x1a')](function(_0x223ba5){var _0x1e2df1=_0x33c8d4[_0x1a57('0x64')][_0x1a57('0x65')]({'plain':!![]});if(!_0x1e2df1)throw new Error(_0x1a57('0x66'));if(_0x1e2df1[_0x1a57('0x67')]===_0x1a57('0x64')){var _0x482508=_0x223ba5[_0x1a57('0x65')]({'plain':!![]});var _0x39399b='ChatWebsites';return db['UserProfileSection'][_0x1a57('0x62')]({'where':{'name':_0x39399b,'userProfileId':_0x1e2df1['userProfileId']},'raw':!![]})[_0x1a57('0x1a')](function(_0x9379e3){if(_0x9379e3&&_0x9379e3[_0x1a57('0x68')]===0x0){return db[_0x1a57('0x32')][_0x1a57('0x63')]({'name':_0x482508[_0x1a57('0x34')],'resourceId':_0x482508['id'],'type':_0x9379e3[_0x1a57('0x34')],'sectionId':_0x9379e3['id']},{})[_0x1a57('0x1a')](function(){return _0x223ba5;});}else{return _0x223ba5;}})['catch'](function(_0x7783ec){logger[_0x1a57('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7783ec);throw _0x7783ec;});}return _0x223ba5;})[_0x1a57('0x1a')](respondWithResult(_0x1f4371,0xc9))[_0x1a57('0x24')](handleError(_0x1f4371,null));};exports[_0x1a57('0x2f')]=function(_0x570674,_0x5c3eb8){if(_0x570674[_0x1a57('0x69')]['id']){delete _0x570674[_0x1a57('0x69')]['id'];}return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0x570674['params']['id']},'include':[{'model':db[_0x1a57('0x49')],'as':_0x1a57('0x4a')}]})[_0x1a57('0x1a')](handleEntityNotFound(_0x5c3eb8,null))[_0x1a57('0x1a')](saveUpdates(_0x570674[_0x1a57('0x69')],null))['then'](respondWithResult(_0x5c3eb8,null))[_0x1a57('0x24')](handleError(_0x5c3eb8,null));};exports[_0x1a57('0x30')]=function(_0x3dfe14,_0x2fde6f){return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0x3dfe14[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x2fde6f,null))[_0x1a57('0x1a')](removeEntity(_0x2fde6f,null))[_0x1a57('0x24')](handleError(_0x2fde6f,null));};exports[_0x1a57('0x6a')]=function(_0x48a10e,_0xd99f23){return db[_0x1a57('0x5d')]['describe']()[_0x1a57('0x1a')](respondWithResult(_0xd99f23,null))[_0x1a57('0x24')](handleError(_0xd99f23,null));};exports['addDisposition']=function(_0x1d9a08,_0x28dd36){if(_0x1d9a08[_0x1a57('0x69')]['id']){delete _0x1d9a08[_0x1a57('0x69')]['id'];}return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0x1d9a08[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x28dd36,null))['then'](function(_0x190631){if(_0x190631){_0x1d9a08[_0x1a57('0x69')]['ChatWebsiteId']=_0x190631['id'];return db[_0x1a57('0x6b')][_0x1a57('0x63')](_0x1d9a08[_0x1a57('0x69')]);}})[_0x1a57('0x1a')](respondWithResult(_0x28dd36,null))[_0x1a57('0x24')](handleError(_0x28dd36,null));};exports[_0x1a57('0x6c')]=function(_0x220725,_0xf61c1d){var _0x44969b={'raw':![],'where':{}};var _0x58bc70={};var _0x3ebec={'count':0x0,'rows':[]};return db[_0x1a57('0x5d')][_0x1a57('0x6d')]({'where':{'id':_0x220725[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0xf61c1d,null))['then'](function(_0x46ab91){if(_0x46ab91){_0x58bc70[_0x1a57('0x44')]=_[_0x1a57('0x50')](db[_0x1a57('0x6b')][_0x1a57('0x4c')]);_0x58bc70[_0x1a57('0x4f')]=_[_0x1a57('0x50')](_0x220725[_0x1a57('0x4f')]);_0x58bc70['filters']=_[_0x1a57('0x52')](_0x58bc70[_0x1a57('0x44')],_0x58bc70[_0x1a57('0x4f')]);_0x44969b[_0x1a57('0x53')]=_['intersection'](_0x58bc70['model'],qs['fields'](_0x220725['query']['fields']));_0x44969b[_0x1a57('0x53')]=_0x44969b[_0x1a57('0x53')]['length']?_0x44969b[_0x1a57('0x53')]:_0x58bc70[_0x1a57('0x44')];if(!_0x220725['query'][_0x1a57('0x56')](_0x1a57('0x6e'))){_0x44969b[_0x1a57('0x29')]=qs[_0x1a57('0x29')](_0x220725['query'][_0x1a57('0x29')]);_0x44969b[_0x1a57('0x2b')]=qs['offset'](_0x220725[_0x1a57('0x4f')][_0x1a57('0x2b')]);}_0x44969b[_0x1a57('0x57')]=qs[_0x1a57('0x58')](_0x220725[_0x1a57('0x4f')][_0x1a57('0x58')]);_0x44969b[_0x1a57('0x59')]=qs['filters'](_[_0x1a57('0x6f')](_0x220725['query'],_0x58bc70[_0x1a57('0x51')]));_0x44969b[_0x1a57('0x59')][_0x1a57('0x70')]=_0x46ab91['id'];if(_0x220725[_0x1a57('0x4f')]['filter']){_0x44969b[_0x1a57('0x59')]=_[_0x1a57('0x5b')](_0x44969b[_0x1a57('0x59')],{'$or':_['map'](_0x44969b[_0x1a57('0x53')],function(_0x37b681){var _0x3bb5d={};_0x3bb5d[_0x37b681]={'$like':'%'+_0x220725['query'][_0x1a57('0x5a')]+'%'};return _0x3bb5d;})});}_0x44969b=_[_0x1a57('0x5b')]({},_0x44969b,_0x220725[_0x1a57('0x5c')]);return db[_0x1a57('0x6b')][_0x1a57('0x2a')]({'where':_0x44969b[_0x1a57('0x59')]})[_0x1a57('0x1a')](function(_0x3b6a65){_0x3ebec[_0x1a57('0x2a')]=_0x3b6a65;if(_0x220725[_0x1a57('0x4f')][_0x1a57('0x5e')]){_0x44969b['include']=[{'all':!![]}];}return db[_0x1a57('0x6b')]['findAll'](_0x44969b);})[_0x1a57('0x1a')](function(_0x5a6dfd){_0x3ebec['rows']=_0x5a6dfd;return _0x3ebec;});}})['then'](respondWithFilteredResult(_0xf61c1d,_0x44969b))['catch'](handleError(_0xf61c1d,null));};exports[_0x1a57('0x71')]=function(_0x9bb457,_0x361c20){return db['ChatWebsite'][_0x1a57('0x62')]({'where':{'id':_0x9bb457['params']['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x361c20,null))[_0x1a57('0x1a')](function(_0x33317c){if(_0x33317c){return _0x33317c[_0x1a57('0x71')](_0x9bb457[_0x1a57('0x4f')][_0x1a57('0x72')]);}})['then'](respondWithStatusCode(_0x361c20,null))['catch'](handleError(_0x361c20,null));};exports[_0x1a57('0x73')]=function(_0x59c9ce,_0x149f8d){if(_0x59c9ce[_0x1a57('0x69')]['id']){delete _0x59c9ce['body']['id'];}return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0x59c9ce['params']['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x149f8d,null))[_0x1a57('0x1a')](function(_0x5d5982){if(_0x5d5982){_0x59c9ce['body'][_0x1a57('0x70')]=_0x5d5982['id'];return db['CannedAnswer'][_0x1a57('0x63')](_0x59c9ce[_0x1a57('0x69')]);}})[_0x1a57('0x1a')](respondWithResult(_0x149f8d,null))[_0x1a57('0x24')](handleError(_0x149f8d,null));};exports[_0x1a57('0x74')]=function(_0x46337f,_0x3770b9){var _0x4db879={'raw':![],'where':{}};var _0xe7a762={};var _0x272589={'count':0x0,'rows':[]};return db[_0x1a57('0x5d')]['findOne']({'where':{'id':_0x46337f['params']['id']}})['then'](handleEntityNotFound(_0x3770b9,null))[_0x1a57('0x1a')](function(_0x297300){if(_0x297300){_0xe7a762['model']=_['keys'](db[_0x1a57('0x75')][_0x1a57('0x4c')]);_0xe7a762[_0x1a57('0x4f')]=_['keys'](_0x46337f[_0x1a57('0x4f')]);_0xe7a762[_0x1a57('0x51')]=_[_0x1a57('0x52')](_0xe7a762[_0x1a57('0x44')],_0xe7a762['query']);_0x4db879[_0x1a57('0x53')]=_[_0x1a57('0x52')](_0xe7a762[_0x1a57('0x44')],qs[_0x1a57('0x54')](_0x46337f[_0x1a57('0x4f')][_0x1a57('0x54')]));_0x4db879[_0x1a57('0x53')]=_0x4db879[_0x1a57('0x53')][_0x1a57('0x55')]?_0x4db879['attributes']:_0xe7a762[_0x1a57('0x44')];if(!_0x46337f[_0x1a57('0x4f')][_0x1a57('0x56')](_0x1a57('0x6e'))){_0x4db879[_0x1a57('0x29')]=qs[_0x1a57('0x29')](_0x46337f[_0x1a57('0x4f')][_0x1a57('0x29')]);_0x4db879[_0x1a57('0x2b')]=qs[_0x1a57('0x2b')](_0x46337f[_0x1a57('0x4f')][_0x1a57('0x2b')]);}_0x4db879[_0x1a57('0x57')]=qs['sort'](_0x46337f[_0x1a57('0x4f')][_0x1a57('0x58')]);_0x4db879[_0x1a57('0x59')]=qs[_0x1a57('0x51')](_[_0x1a57('0x6f')](_0x46337f[_0x1a57('0x4f')],_0xe7a762['filters']));_0x4db879[_0x1a57('0x59')][_0x1a57('0x70')]=_0x297300['id'];if(_0x46337f[_0x1a57('0x4f')][_0x1a57('0x5a')]){_0x4db879[_0x1a57('0x59')]=_['merge'](_0x4db879[_0x1a57('0x59')],{'$or':_[_0x1a57('0x4b')](_0x4db879['attributes'],function(_0x29bdca){var _0x350dbd={};_0x350dbd[_0x29bdca]={'$like':'%'+_0x46337f[_0x1a57('0x4f')][_0x1a57('0x5a')]+'%'};return _0x350dbd;})});}_0x4db879=_['merge']({},_0x4db879,_0x46337f['options']);return db[_0x1a57('0x75')][_0x1a57('0x2a')]({'where':_0x4db879['where']})[_0x1a57('0x1a')](function(_0x67d85){_0x272589[_0x1a57('0x2a')]=_0x67d85;if(_0x46337f[_0x1a57('0x4f')][_0x1a57('0x5e')]){_0x4db879[_0x1a57('0x76')]=[{'all':!![]}];}return db[_0x1a57('0x75')][_0x1a57('0x5f')](_0x4db879);})[_0x1a57('0x1a')](function(_0x26d7b8){_0x272589[_0x1a57('0x60')]=_0x26d7b8;return _0x272589;});}})[_0x1a57('0x1a')](respondWithFilteredResult(_0x3770b9,_0x4db879))['catch'](handleError(_0x3770b9,null));};exports[_0x1a57('0x77')]=function(_0x31805d,_0x30295e){return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0x31805d[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x30295e,null))[_0x1a57('0x1a')](function(_0x39534c){if(_0x39534c){return _0x39534c['removeAnswers'](_0x31805d[_0x1a57('0x4f')][_0x1a57('0x72')]);}})[_0x1a57('0x1a')](respondWithStatusCode(_0x30295e,null))[_0x1a57('0x24')](handleError(_0x30295e,null));};exports[_0x1a57('0x78')]=function(_0x39c13e,_0x3d3d46){_0x39c13e['body'][_0x1a57('0x79')]=_0x39c13e[_0x1a57('0x7a')][_0x1a57('0x7b')];return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0x39c13e[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x3d3d46,null))[_0x1a57('0x1a')](saveUpdates(_0x39c13e[_0x1a57('0x69')],null))[_0x1a57('0x1a')](respondWithResult(_0x3d3d46,null))[_0x1a57('0x24')](handleError(_0x3d3d46,null));};exports['addAvatar']=function(_0x500b80,_0x3b979a){_0x500b80['body'][_0x1a57('0x7c')]=_0x500b80[_0x1a57('0x7a')][_0x1a57('0x7b')];return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0x500b80[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x3b979a,null))[_0x1a57('0x1a')](saveUpdates(_0x500b80[_0x1a57('0x69')],null))[_0x1a57('0x1a')](respondWithResult(_0x3b979a,null))[_0x1a57('0x24')](handleError(_0x3b979a,null));};exports[_0x1a57('0x7d')]=function(_0x3957c7,_0x4f3349){_0x3957c7['body'][_0x1a57('0x7e')]=_0x3957c7['file'][_0x1a57('0x7b')];return db[_0x1a57('0x5d')]['find']({'where':{'id':_0x3957c7[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x4f3349,null))[_0x1a57('0x1a')](saveUpdates(_0x3957c7[_0x1a57('0x69')],null))[_0x1a57('0x1a')](respondWithResult(_0x4f3349,null))[_0x1a57('0x24')](handleError(_0x4f3349,null));};exports[_0x1a57('0x7f')]=function(_0x519b73,_0x410898){_0x519b73[_0x1a57('0x69')]['systemAvatar']=_0x519b73[_0x1a57('0x7a')][_0x1a57('0x7b')];return db[_0x1a57('0x5d')]['find']({'where':{'id':_0x519b73[_0x1a57('0x61')]['id']}})['then'](handleEntityNotFound(_0x410898,null))['then'](saveUpdates(_0x519b73[_0x1a57('0x69')],null))['then'](respondWithResult(_0x410898,null))['catch'](handleError(_0x410898,null));};exports[_0x1a57('0x80')]=function(_0x2a1245,_0x6f8f41){var _0x2f039e=path['join'](config[_0x1a57('0x81')],_0x1a57('0x82'));var _0x4a6ae2={'where':{'id':_0x2a1245[_0x1a57('0x61')]['id']},'attributes':['id',_0x1a57('0x79')],'raw':!![]};var _0x3a813a=![];return require(_0x1a57('0x83'))['getLicense']()['then'](function(_0x2dbb1e){if(_0x2dbb1e){_0x3a813a=_0x2dbb1e[_0x1a57('0x84')];}})[_0x1a57('0x1a')](function(){return db[_0x1a57('0x5d')]['find'](_0x4a6ae2);})['then'](handleEntityNotFound(_0x6f8f41,null))[_0x1a57('0x1a')](function(_0x57a81e){if(_0x57a81e){if(!_['isNil'](_0x57a81e[_0x1a57('0x79')])){if(fs[_0x1a57('0x85')](path[_0x1a57('0x86')](config[_0x1a57('0x81')],_0x1a57('0x87'),_0x57a81e[_0x1a57('0x79')]))&&_0x3a813a){_0x2f039e=path[_0x1a57('0x86')](config[_0x1a57('0x81')],_0x1a57('0x87'),_0x57a81e[_0x1a57('0x79')]);}}return _0x6f8f41[_0x1a57('0x88')](_0x2f039e);}})[_0x1a57('0x24')](handleError(_0x6f8f41,null));};exports[_0x1a57('0x89')]=function(_0x502cc3,_0x304f50){var _0x272be=path[_0x1a57('0x86')](config[_0x1a57('0x81')],_0x1a57('0x8a'));var _0x51e165={'where':{'id':_0x502cc3[_0x1a57('0x61')]['id']},'attributes':['id',_0x1a57('0x7c')],'raw':!![]};return db[_0x1a57('0x5d')][_0x1a57('0x62')](_0x51e165)['then'](handleEntityNotFound(_0x304f50,null))[_0x1a57('0x1a')](function(_0x3b2982){if(_0x3b2982){if(!_[_0x1a57('0x8b')](_0x3b2982[_0x1a57('0x7c')])){if(fs[_0x1a57('0x85')](path[_0x1a57('0x86')](config[_0x1a57('0x81')],_0x1a57('0x8c'),_0x3b2982['agentAvatar']))){_0x272be=path[_0x1a57('0x86')](config[_0x1a57('0x81')],'server/files/images/avatars/',_0x3b2982[_0x1a57('0x7c')]);}}return _0x304f50[_0x1a57('0x88')](_0x272be);}})[_0x1a57('0x24')](handleError(_0x304f50,null));};exports['getCustomerAvatar']=function(_0xdaf58b,_0x5247c5){var _0x44229f=path[_0x1a57('0x86')](config[_0x1a57('0x81')],_0x1a57('0x8d'));var _0x7cc8f5={'where':{'id':_0xdaf58b['params']['id']},'attributes':['id',_0x1a57('0x7e'),_0x1a57('0x8e')],'raw':!![]};return db[_0x1a57('0x5d')][_0x1a57('0x62')](_0x7cc8f5)[_0x1a57('0x1a')](handleEntityNotFound(_0x5247c5,null))[_0x1a57('0x1a')](function(_0xbf80e9){if(_0xbf80e9){if(!_[_0x1a57('0x8b')](_0xbf80e9[_0x1a57('0x7e')])){if(fs[_0x1a57('0x85')](path[_0x1a57('0x86')](config[_0x1a57('0x81')],'server/files/images/avatars/',_0xbf80e9['customerAvatar']))&&_0xbf80e9[_0x1a57('0x8e')]){_0x44229f=path['join'](config[_0x1a57('0x81')],_0x1a57('0x8c'),_0xbf80e9['customerAvatar']);}}return _0x5247c5[_0x1a57('0x88')](_0x44229f);}})[_0x1a57('0x24')](handleError(_0x5247c5,null));};exports['getSystemAvatar']=function(_0x30c86b,_0x584f30){var _0x38d08b=path[_0x1a57('0x86')](config[_0x1a57('0x81')],'server/files/images/avatars/system_avatar.png');var _0x41d6be={'where':{'id':_0x30c86b[_0x1a57('0x61')]['id']},'attributes':['id',_0x1a57('0x8f')],'raw':!![]};return db[_0x1a57('0x5d')]['find'](_0x41d6be)[_0x1a57('0x1a')](handleEntityNotFound(_0x584f30,null))[_0x1a57('0x1a')](function(_0x540e2c){if(_0x540e2c){if(!_[_0x1a57('0x8b')](_0x540e2c[_0x1a57('0x8f')])){if(fs[_0x1a57('0x85')](path[_0x1a57('0x86')](config['root'],_0x1a57('0x8c'),_0x540e2c[_0x1a57('0x8f')]))){_0x38d08b=path[_0x1a57('0x86')](config['root'],_0x1a57('0x8c'),_0x540e2c[_0x1a57('0x8f')]);}}return _0x584f30[_0x1a57('0x88')](_0x38d08b);}})['catch'](handleError(_0x584f30,null));};exports['notify']=function(_0x34c427,_0x37a1c3){var _0x45715f={'body':_0x34c427['body'],'channel':_0x1a57('0x90')};var _0x52e50b=[];var _0x2439b5=[];var _0x5ddb78={};var _0x5c4b93=![];if(_0x34c427[_0x1a57('0x69')]['id']){delete _0x34c427[_0x1a57('0x69')]['id'];}if(_[_0x1a57('0x8b')](_0x34c427[_0x1a57('0x69')][_0x1a57('0x91')])){throw new APIBadRequestError(_0x1a57('0x92'));}if(_[_0x1a57('0x8b')](_0x34c427[_0x1a57('0x69')]['mapKey'])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_['isEmpty'](_0x34c427[_0x1a57('0x69')]['body'])){throw new APIBadRequestError(_0x1a57('0x93'));}return db['CmContact'][_0x1a57('0x6a')]()[_0x1a57('0x1a')](function(_0x3640e5){if(!_0x3640e5){throw new Error(_0x1a57('0x94'));}_0x52e50b=Object[_0x1a57('0x50')](_0x3640e5)[_0x1a57('0x5a')](function(_0x5c926e){return![_0x1a57('0x95'),_0x1a57('0x96')][_0x1a57('0x97')](_0x5c926e);});_0x2439b5=Object[_0x1a57('0x50')](_0x3640e5)[_0x1a57('0x5a')](function(_0x58d092){return![_0x1a57('0x95'),'updatedAt',_0x1a57('0x98'),_0x1a57('0x99')][_0x1a57('0x97')](_0x58d092);});if(!_[_0x1a57('0x97')](_0x2439b5,_0x34c427['body'][_0x1a57('0x9a')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x2439b5['join'](',\x20'));}_0x5ddb78[_0x34c427[_0x1a57('0x69')][_0x1a57('0x9a')]]=_0x34c427[_0x1a57('0x69')][_0x1a57('0x91')];})['then'](function(){return db['ChatWebsite'][_0x1a57('0x62')]({'where':{'id':_0x34c427[_0x1a57('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0x1a57('0x9b'),'include':[{'model':db['CmContact'],'as':_0x1a57('0x9c'),'where':_0x5ddb78,'limit':0x1,'order':[[_0x1a57('0x96'),_0x1a57('0x9d')]]}]},{'model':db[_0x1a57('0x9e')],'as':_0x1a57('0x9f')},{'model':db[_0x1a57('0xa0')],'as':_0x1a57('0xa0'),'include':[{'model':db[_0x1a57('0xa0')],'as':_0x1a57('0xa1'),'attributes':['id',_0x1a57('0xa2')],'raw':!![]}]}]});})[_0x1a57('0x1a')](function(_0x39836d){if(!_0x39836d){throw new APINotFoundError(util[_0x1a57('0x41')](_0x1a57('0xa3'),_0x34c427[_0x1a57('0x61')]['id']));}var _0x54a32e=_0x39836d['Interval'];if(_0x54a32e){var _0x4ad389=_0x39836d[_0x1a57('0xa4')]||undefined;return _0x54a32e[_0x1a57('0xa5')](_0x4ad389)[_0x1a57('0x1a')](function(_0x53c2c8){if(!_0x53c2c8){throw new APIOutOfIntervalError();}return _0x39836d;});}else{return _0x39836d;}})['then'](function(_0x23187d){if(!_0x23187d[_0x1a57('0x9b')]){return;}_0x45715f[_0x1a57('0xa6')]=_0x23187d;_0x45715f[_0x1a57('0xa7')]=_0x23187d[_0x1a57('0x9b')];_0x45715f['applications']=_[_0x1a57('0xa8')](_0x23187d[_0x1a57('0x9f')],[_0x1a57('0xa9')],[_0x1a57('0xaa')]);if(_0x45715f[_0x1a57('0xa6')][_0x1a57('0x9f')]){delete _0x45715f[_0x1a57('0xa6')][_0x1a57('0x9f')];}if(_0x45715f['account']['List']&&_0x45715f['account'][_0x1a57('0x9b')][_0x1a57('0x9c')][_0x1a57('0x55')]){return _0x45715f[_0x1a57('0xa6')][_0x1a57('0x9b')][_0x1a57('0x9c')][0x0];}var _0x32c497=_[_0x1a57('0x13')](_0x34c427[_0x1a57('0x69')],{'firstName':_0x34c427['body'][_0x1a57('0x91')],'ListId':_0x23187d[_0x1a57('0x99')]});_0x32c497[_0x34c427[_0x1a57('0x69')][_0x1a57('0x9a')]]=_0x34c427['body'][_0x1a57('0x91')];return db[_0x1a57('0xab')]['create'](_0x32c497,{'fields':_0x52e50b,'raw':!![]});})[_0x1a57('0x1a')](function(_0x3b0bb6){_0x45715f[_0x1a57('0xac')]=_0x3b0bb6;var _0x4cf0c6=createInteractionObject(_0x34c427['params']['id'],_0x34c427[_0x1a57('0x69')],_0x34c427[_0x1a57('0xad')],_0x3b0bb6);var _0x8450fd={'ChatWebsiteId':_0x34c427[_0x1a57('0x61')]['id']};if(_0x34c427[_0x1a57('0x69')][_0x1a57('0xae')]){_0x8450fd[_0x1a57('0xae')]=_0x34c427['body'][_0x1a57('0xae')];_0x8450fd[_0x1a57('0xaf')]=![];return db[_0x1a57('0xb0')][_0x1a57('0x62')]({'where':_0x8450fd})[_0x1a57('0x1a')](function(_0x59b14d){var _0x57773b=_0x34c427[_0x1a57('0x69')][_0x1a57('0x37')]&&_0x34c427[_0x1a57('0x69')][_0x1a57('0x3e')];if(_0x59b14d){_0x5c4b93=!![];return _0x59b14d;}else if(!_0x57773b&&_0x59b14d&&_0x59b14d[_0x1a57('0xaf')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x4cf0c6[_0x1a57('0xae')]=_0x34c427[_0x1a57('0x69')][_0x1a57('0xae')];_0x4cf0c6[_0x1a57('0xb1')]=_0x34c427[_0x1a57('0x69')][_0x1a57('0xb1')];return db[_0x1a57('0xb0')][_0x1a57('0x63')](_0x4cf0c6);});}_0x8450fd['ContactId']=_0x3b0bb6['id'];if(_0x34c427['body'][_0x1a57('0xb2')]&&_0x34c427[_0x1a57('0x69')][_0x1a57('0xb2')]['id']){_0x8450fd['id']=_0x34c427[_0x1a57('0x69')][_0x1a57('0xb2')]['id'];return db['ChatInteraction']['find']({'where':_0x8450fd})[_0x1a57('0x1a')](function(_0x2f9c6a){if(_0x2f9c6a){_0x5c4b93=!![];return _0x2f9c6a;}return db[_0x1a57('0xb0')][_0x1a57('0x63')](_0x4cf0c6);});}return db['ChatInteraction']['create'](_0x4cf0c6);})[_0x1a57('0x1a')](function(_0x134919){if(!_0x5c4b93){return _0x134919;}var _0x23c4bc={'from':(_0x45715f[_0x1a57('0xac')][_0x1a57('0x3c')]||'')+'\x20'+(_0x45715f[_0x1a57('0xac')][_0x1a57('0xb3')]||'')};if(_0x34c427['body'][_0x1a57('0xae')]&&_0x34c427['body'][_0x1a57('0xb4')]&&_0x34c427[_0x1a57('0x69')][_0x1a57('0xae')]!=_0x34c427[_0x1a57('0x69')][_0x1a57('0xb4')]){_0x23c4bc[_0x1a57('0xae')]=_0x34c427['body'][_0x1a57('0xb4')];}return _0x134919['update'](_0x23c4bc);})[_0x1a57('0x1a')](function(_0x4b8712){_0x45715f[_0x1a57('0xb2')]=_0x4b8712[_0x1a57('0x65')]({'plain':!![]});_0x45715f['interaction'][_0x1a57('0xb5')]=!_0x5c4b93;if(_0x45715f[_0x1a57('0xb2')][_0x1a57('0xb5')]){if(_0x45715f[_0x1a57('0xa6')]['autoclose']){_0x45715f[_0x1a57('0xb6')][_0x1a57('0xb7')]({'id':0x0,'priority':_0x45715f[_0x1a57('0xb6')][_0x1a57('0x55')]+0x1,'app':_0x1a57('0xb8'),'appdata':'unmanaged','interval':_0x1a57('0xb9')});}}return db[_0x1a57('0xba')][_0x1a57('0x63')]({'body':_0x34c427[_0x1a57('0x69')][_0x1a57('0x69')],'ChatWebsiteId':_0x34c427[_0x1a57('0x61')]['id'],'ChatInteractionId':_0x4b8712['id'],'direction':'in','ContactId':_0x45715f[_0x1a57('0xac')]['id'],'AttachmentId':_0x34c427[_0x1a57('0x69')][_0x1a57('0xbb')]});})['then'](function(_0x347b3f){_0x45715f['message']=_0x347b3f;if(!_0x45715f[_0x1a57('0xb2')][_0x1a57('0xbc')]){return;}return db['User'][_0x1a57('0x62')]({'attributes':['id',_0x1a57('0x34')],'where':{'id':_0x45715f[_0x1a57('0xb2')][_0x1a57('0xbc')]}});})['then'](function(_0x9235df){if(_0x9235df){_0x45715f[_0x1a57('0xb6')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1a57('0xbd'),'appdata':_0x9235df[_0x1a57('0x34')]+','+(_0x45715f[_0x1a57('0xa6')][_0x1a57('0xbe')]||0xa),'interval':_0x1a57('0xb9')});_0x45715f[_0x1a57('0xbf')]=!![];}if(!_0x45715f[_0x1a57('0xb2')][_0x1a57('0xc0')]){return;}return db['ChatQueue'][_0x1a57('0x62')]({'attributes':['id','name'],'where':{'id':_0x45715f[_0x1a57('0xb2')][_0x1a57('0xc0')]}});})[_0x1a57('0x1a')](function(_0x12ed7f){if(_0x12ed7f){_0x45715f[_0x1a57('0xb6')][_0x1a57('0xc1')]({'id':0x0,'priority':0x1,'app':_0x1a57('0xc2'),'appdata':_0x12ed7f[_0x1a57('0x34')]+','+(_0x45715f['account'][_0x1a57('0xc3')]||0x12c),'interval':_0x1a57('0xb9')});}return respondWithRpcPromise(_0x1a57('0xc4'),_0x1a57('0xc5'),_0x45715f);})[_0x1a57('0x1a')](function(_0x4896da){respondWithRpcPromise('EventManager',_0x1a57('0xc6'),{'event':_0x1a57('0xc7'),'message':_0x4896da},client9002);return _0x4896da;})[_0x1a57('0x1a')](respondWithResult(_0x37a1c3,null))[_0x1a57('0x24')](APIHandleError(_0x37a1c3));};exports['offline']=function(_0x3c0f17,_0x169d6b){var _0x4a82dc,_0x42f21b,_0x4920b8;var _0x4d7d88=[];var _0x1861ff={};var _0xebc968=_0x3c0f17['files']||[];var _0x722d99=[];var _0x2f033d;return db[_0x1a57('0xab')][_0x1a57('0x6a')]()[_0x1a57('0x1a')](function(_0x224b64){if(!_0x224b64){throw new db[(_0x1a57('0xc8'))][(_0x1a57('0xc9'))](_0x1a57('0xca'));}_0x4d7d88=_['difference'](_[_0x1a57('0x50')](_0x224b64),[_0x1a57('0x95'),_0x1a57('0x96'),_0x1a57('0x98'),_0x1a57('0x99')]);if(_0x3c0f17[_0x1a57('0x69')]['id']){delete _0x3c0f17[_0x1a57('0x69')]['id'];}if(_['isNil'](_0x3c0f17[_0x1a57('0x69')][_0x1a57('0x91')])){throw _0x169d6b[_0x1a57('0x26')](0x1f4)['send'](new db[(_0x1a57('0xc8'))][(_0x1a57('0xc9'))](_0x1a57('0xcb')));}if(_['isNil'](_0x3c0f17[_0x1a57('0x69')]['body'])||_0x3c0f17['body']['body']===''){throw _0x169d6b[_0x1a57('0x26')](0x1f4)[_0x1a57('0x35')](new db[(_0x1a57('0xc8'))][(_0x1a57('0xc9'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1a57('0x8b')](_0x3c0f17[_0x1a57('0x69')][_0x1a57('0xcc')])){throw _0x169d6b['status'](0x1f4)[_0x1a57('0x35')](new db[(_0x1a57('0xc8'))][(_0x1a57('0xc9'))](_0x1a57('0xcd')+_0x4d7d88));}if(!_['includes'](_0x4d7d88,_0x3c0f17[_0x1a57('0x69')][_0x1a57('0xcc')])){throw _0x169d6b[_0x1a57('0x26')](0x1f4)['send'](new db[(_0x1a57('0xc8'))][(_0x1a57('0xc9'))](_0x1a57('0xce')+_0x4d7d88));}_0x1861ff[_0x3c0f17[_0x1a57('0x69')][_0x1a57('0xcc')]]=_0x3c0f17[_0x1a57('0x69')][_0x1a57('0x91')];})[_0x1a57('0x1a')](function(){return db['ChatWebsite'][_0x1a57('0x62')]({'where':{'id':_0x3c0f17[_0x1a57('0x61')]['id']},'include':[{'model':db[_0x1a57('0xcf')],'as':_0x1a57('0x9b')},{'model':db[_0x1a57('0xd0')],'as':'MailAccount'}]});})[_0x1a57('0x1a')](handleEntityNotFound(_0x169d6b,null))['then'](function(_0x2f2698){if(_0x2f2698&&_0x2f2698[_0x1a57('0x9b')]){_0x42f21b=_0x2f2698;var _0x412c11=_[_0x1a57('0x13')](_0x3c0f17[_0x1a57('0x69')],{'firstName':_0x3c0f17['body']['from'],'phone':_0x3c0f17[_0x1a57('0x69')][_0x1a57('0x91')],'ListId':_0x2f2698['ListId']});_0x412c11[_0x3c0f17[_0x1a57('0x69')][_0x1a57('0xcc')]]=_0x3c0f17[_0x1a57('0x69')]['from'];return db['CmContact']['findOrCreate']({'where':_0x1861ff,'defaults':_0x412c11});}})[_0x1a57('0xd1')](function(_0x55fe63){if(_0x55fe63){_0x4920b8=_0x55fe63;var _0x41d89a=fs['readFileSync'](path[_0x1a57('0x86')](config[_0x1a57('0x81')],_0x1a57('0xd2')),'utf8');var _0x549e65=ejs[_0x1a57('0xd3')](_0x41d89a,{'body':_[_0x1a57('0xd4')](_0x3c0f17[_0x1a57('0x69')][_0x1a57('0x69')]),'bodyTitle':_0x42f21b['offlineMessageBody']});return db['ChatOfflineMessage'][_0x1a57('0x63')]({'body':_0x549e65,'plainBody':htmlToText[_0x1a57('0xd5')](_0x549e65),'ContactId':_0x55fe63['id'],'ChatWebsiteId':_0x42f21b['id']});}})['then'](function(_0x40af41){_0x2f033d=_0x40af41;if(_0xebc968[_0x1a57('0x55')]){var _0x2405b0=_0xebc968[_0x1a57('0x4b')](function(_0x19faff){return{'name':_0x19faff['originalname'],'basename':_0x19faff['filename'],'type':_0x19faff[_0x1a57('0xd6')],'ChatOfflineMessageId':_0x40af41['id']};});_0x722d99=_0x2405b0[_0x1a57('0x4b')](_0x5df6d5=>{var _0x1138c3={'filename':_0x5df6d5['name'],'path':path['join'](config[_0x1a57('0x81')],_0x1a57('0xd7'),_0x1a57('0xd8'),_0x1a57('0xd9'),'offline-chat',_0x5df6d5[_0x1a57('0xda')])};return _0x1138c3;});if(!_0x42f21b[_0x1a57('0xdb')]){return db[_0x1a57('0xdc')][_0x1a57('0xdd')](function(_0x558d10){return db[_0x1a57('0xde')][_0x1a57('0xdf')](_0x2405b0,{'transaction':_0x558d10});});}}})[_0x1a57('0x1a')](function(){if(_0x2f033d){_0x4a82dc=_0x2f033d;return db[_0x1a57('0xd0')][_0x1a57('0x6d')]({'where':{'service':!![]},'include':[{'model':db[_0x1a57('0xe0')],'as':_0x1a57('0xe1'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1a57('0xe2'),'raw':!![]}]}]});}})[_0x1a57('0x1a')](function(_0x19200f){if(_0x19200f&&_0x19200f[_0x1a57('0xe1')]&&_0x42f21b['forwardOffline']&&_0x42f21b['forwardOfflineAddress']){var _0x1c27ce=_0x19200f[_0x1a57('0xe3')]();return respondWithRpcPromise(_0x1a57('0xe4'),_0x1a57('0xe5'),{'account':_0x1c27ce,'message':{'from':util[_0x1a57('0x41')](_0x1a57('0xe6'),_0x19200f[_0x1a57('0x34')],_0x19200f[_0x1a57('0xe7')]||_0x19200f['Smtp']['user']),'to':_0x42f21b['forwardOfflineAddress'],'subject':_0x42f21b['offlineMessageSubject'],'html':_0x4a82dc[_0x1a57('0x69')],'attachments':_0x722d99}},client9003)[_0x1a57('0x1a')](function(){return _0x4a82dc;})['catch'](function(_0x1db211){logger[_0x1a57('0x1f')](_0x1db211);});}})[_0x1a57('0x1a')](function(){if(_0x42f21b&&_0x42f21b[_0x1a57('0xdb')]&&_0x42f21b[_0x1a57('0xe8')]){var _0x1f4e77=[];if(_0xebc968[_0x1a57('0x55')]){_0x1f4e77=_0xebc968[_0x1a57('0x4b')](function(_0x2e6b2c){return{'name':_0x2e6b2c[_0x1a57('0xe9')],'basename':_0x2e6b2c[_0x1a57('0x7b')],'type':_0x2e6b2c[_0x1a57('0xd6')],'ChatOfflineMessageId':_0x2f033d['id']};});}var _0xc94180;if(!_[_0x1a57('0x8b')](_0x42f21b[_0x1a57('0xea')])){var _0x8ae8b9=_[_0x1a57('0x4b')](_0x3c0f17['body'],function(_0x3088d0){return _0x3088d0;});var _0x127a5d=_[_0x1a57('0xeb')](_0x8ae8b9)[0x0];var _0x5c0ce9=_['mapValues'](_0x127a5d,function(_0x29cdcb){return _0x29cdcb;});_0xc94180=_0x5c0ce9[0x1][_0x42f21b[_0x1a57('0xea')]];}var _0x3a2416={'from':_0x4920b8[_0x1a57('0xe7')],'firstName':_0x4920b8[_0x1a57('0x3c')],'lastName':_0x4920b8['lastName'],'mapKey':_0x1a57('0xe7'),'message':{'from':_0x4920b8[_0x1a57('0xe7')],'to':_0x42f21b[_0x1a57('0xd0')]['email'],'cc':'','subject':_['isNil'](_0xc94180)?_0x42f21b[_0x1a57('0xec')]:_0xc94180,'messageId':'','sentAt':new Date(),'attach':_0x1f4e77[_0x1a57('0x55')],'attachments':_0x1f4e77,'originChannel':_0x1a57('0xed'),'ChatWebsiteId':_0x42f21b['id'],'ChatOfflineMessageId':_0x4a82dc['id'],'originTo':_0x42f21b[_0x1a57('0xd0')][_0x1a57('0xe7')]},'body':_0x4a82dc[_0x1a57('0x69')]};var _0x3711b9={'account':{'id':_0x42f21b[_0x1a57('0xe8')]},'body':_0x3a2416,'log':_0x1a57('0xee')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x3711b9,client9001)['then'](function(){return _0x4a82dc;})[_0x1a57('0x24')](function(_0x40a62){logger[_0x1a57('0x1f')](_0x40a62);});}return;})[_0x1a57('0x1a')](function(){if(_0x4a82dc){return _0x4a82dc;}})[_0x1a57('0x1a')](respondWithResult(_0x169d6b,null))[_0x1a57('0x24')](function(){for(var _0x1ca03e of _0xebc968){var _0x3d5ab2=path[_0x1a57('0x86')](config[_0x1a57('0x81')],_0x1a57('0xd7'),_0x1a57('0xd8'),_0x1a57('0xd9'),_0x1a57('0xef'),_0x1ca03e[_0x1a57('0x7b')]);fs_extra[_0x1a57('0xf0')](_0x3d5ab2)[_0x1a57('0x24')](function(_0x4b9c98){logger[_0x1a57('0x1f')](_0x1a57('0xf1'),_0x3d5ab2,_0x4b9c98);});}});};exports['addInteraction']=function(_0x1805bc,_0x14c4a0){return db['ChatInteraction'][_0x1a57('0x62')]({'where':{'id':_0x1805bc['params']['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x14c4a0,null))[_0x1a57('0x1a')](function(_0x1b2e59){if(_0x1b2e59){return _0x1b2e59[_0x1a57('0xf2')](_0x1805bc['body'][_0x1a57('0x72')],_[_0x1a57('0xf3')](_0x1805bc[_0x1a57('0x69')],['ids','id'])||{});}})[_0x1a57('0x1a')](respondWithResult(_0x14c4a0,null))[_0x1a57('0x24')](handleError(_0x14c4a0,null));};exports['getInteractions']=function(_0x9a0693,_0x24c43b){var _0x1a6eaf={'raw':![],'where':{}};var _0x5cbd09={};var _0x4ba4d0={'count':0x0,'rows':[]};return db[_0x1a57('0x5d')]['findOne']({'where':{'id':_0x9a0693[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x24c43b,null))[_0x1a57('0x1a')](function(_0x3083e4){if(_0x3083e4){_0x5cbd09[_0x1a57('0x44')]=_['keys'](db[_0x1a57('0xb0')][_0x1a57('0x4c')]);_0x5cbd09[_0x1a57('0x4f')]=_['keys'](_0x9a0693[_0x1a57('0x4f')]);_0x5cbd09[_0x1a57('0x51')]=_[_0x1a57('0x52')](_0x5cbd09[_0x1a57('0x44')],_0x5cbd09['query']);_0x1a6eaf[_0x1a57('0x53')]=_[_0x1a57('0x52')](_0x5cbd09[_0x1a57('0x44')],qs[_0x1a57('0x54')](_0x9a0693[_0x1a57('0x4f')][_0x1a57('0x54')]));_0x1a6eaf[_0x1a57('0x53')]=_0x1a6eaf['attributes'][_0x1a57('0x55')]?_0x1a6eaf['attributes']:_0x5cbd09[_0x1a57('0x44')];if(!_0x9a0693[_0x1a57('0x4f')][_0x1a57('0x56')](_0x1a57('0x6e'))){_0x1a6eaf[_0x1a57('0x29')]=qs[_0x1a57('0x29')](_0x9a0693[_0x1a57('0x4f')][_0x1a57('0x29')]);_0x1a6eaf['offset']=qs[_0x1a57('0x2b')](_0x9a0693[_0x1a57('0x4f')][_0x1a57('0x2b')]);}_0x1a6eaf[_0x1a57('0x57')]=qs[_0x1a57('0x58')](_0x9a0693[_0x1a57('0x4f')][_0x1a57('0x58')]);_0x1a6eaf[_0x1a57('0x59')]=qs[_0x1a57('0x51')](_[_0x1a57('0x6f')](_0x9a0693[_0x1a57('0x4f')],_0x5cbd09[_0x1a57('0x51')]));_0x1a6eaf[_0x1a57('0x59')]['ChatWebsiteId']=_0x3083e4['id'];if(_0x9a0693[_0x1a57('0x4f')][_0x1a57('0x5a')]){_0x1a6eaf['where']=_[_0x1a57('0x5b')](_0x1a6eaf[_0x1a57('0x59')],{'$or':_[_0x1a57('0x4b')](_0x1a6eaf['attributes'],function(_0x2be3b8){var _0x3f854c={};_0x3f854c[_0x2be3b8]={'$like':'%'+_0x9a0693[_0x1a57('0x4f')][_0x1a57('0x5a')]+'%'};return _0x3f854c;})});}_0x1a6eaf=_[_0x1a57('0x5b')]({},_0x1a6eaf,_0x9a0693[_0x1a57('0x5c')]);return db[_0x1a57('0xb0')]['count']({'where':_0x1a6eaf[_0x1a57('0x59')]})['then'](function(_0x8ac81c){_0x4ba4d0[_0x1a57('0x2a')]=_0x8ac81c;if(_0x9a0693['query']['includeAll']){_0x1a6eaf[_0x1a57('0x76')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x1a57('0xf4')],'as':_0x1a57('0xf5'),'attributes':[_0x1a57('0x34'),_0x1a57('0xf6'),'internal'],'required':![]},{'model':db[_0x1a57('0xf7')],'as':_0x1a57('0xf8'),'attributes':['id',_0x1a57('0x34'),_0x1a57('0xf9')],'where':_0x9a0693[_0x1a57('0x4f')][_0x1a57('0xfa')]?{'id':_0x9a0693[_0x1a57('0x4f')][_0x1a57('0xfa')]}:undefined,'required':_0x9a0693[_0x1a57('0x4f')]['tag']?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x1a6eaf);})[_0x1a57('0x1a')](function(_0x427e5d){_0x4ba4d0['rows']=_0x427e5d;return _0x4ba4d0;});}})[_0x1a57('0x1a')](respondWithFilteredResult(_0x24c43b,_0x1a6eaf))[_0x1a57('0x24')](handleError(_0x24c43b,null));};exports[_0x1a57('0xfb')]=function(_0x2e4aab,_0x94a873){var _0x294457=0x0;var _0x412658=0x0;var _0x4b2364=![];var _0x3a58c1;var _0x4987fc;return db['ChatWebsite']['find']({'where':{'id':_0x2e4aab[_0x1a57('0x61')]['id']},'include':[{'model':db[_0x1a57('0xa0')],'as':_0x1a57('0xa0'),'include':[{'model':db['Interval'],'as':_0x1a57('0xa1'),'attributes':['id',_0x1a57('0xa2')]}]}]})[_0x1a57('0x1a')](handleEntityNotFound(_0x94a873,null))[_0x1a57('0x1a')](function(_0x53947f){if(_0x53947f){_0x3a58c1=_0x53947f;return _0x53947f[_0x1a57('0xfc')]({'raw':!![]});}})['then'](function(_0x48e53f){if(_0x3a58c1){if(_0x48e53f){_0x4987fc=_0x48e53f;}}return require('../../config/license/util')[_0x1a57('0xfd')]();})['then'](function(_0x44b0b4){if(_0x44b0b4){_0x412658=_0x44b0b4['virtual'];_0x4b2364=_0x44b0b4['custom'];}})['then'](function(){return db['ChatInteraction'][_0x1a57('0x2a')]({'where':{'closed':![]}});})['then'](function(_0x3c8e60){_0x294457=_0x3c8e60;if(_0x412658&&_0x3c8e60>_0x412658){return db['License'][_0x1a57('0x6d')]({'where':{'id':0x1}})[_0x1a57('0x1a')](function(_0x4e605f){if(_0x4e605f){_0x4e605f[_0x1a57('0xfe')](_0x1a57('0xff'));}});}})[_0x1a57('0x1a')](function(){var _0x1bf023=_0x3a58c1['Interval'];var _0x35ac22=_0x3a58c1['timezone']||undefined;return _0x1bf023?_0x1bf023['ifTime'](_0x35ac22):!![];})[_0x1a57('0x1a')](function(_0x4cf396){var _0x442de0=fs[_0x1a57('0x100')](path['join'](config[_0x1a57('0x81')],_0x1a57('0x101')),_0x1a57('0x102'));var _0x28b99b=new url[(_0x1a57('0x103'))](_0x3a58c1[_0x1a57('0x104')])['origin'];var _0x5e65b8=_0x1a57('0x105');var _0x161c5c=![];var _0x3b1e44={'chatVersion':_0x5e65b8,'chatWebsiteAddressOrigin':_0x28b99b,'remote':_0x3a58c1['remote'],'query':querystring[_0x1a57('0x1e')](_['merge'](_0x3a58c1[_0x1a57('0x65')]({'plain':!![]}),{'customerIp':_0x2e4aab[_0x1a57('0xad')][_0x1a57('0x3a')]||_0x2e4aab[_0x1a57('0xad')][_0x1a57('0x106')]||_0x2e4aab[_0x1a57('0x107')][_0x1a57('0x108')]||_0x2e4aab['ip'],'referer':_0x2e4aab[_0x1a57('0xad')][_0x1a57('0x3e')],'openedInteractions':_0x294457,'maxInteractions':_0x412658,'virtual':_0x4b2364[_0x1a57('0x109')],'online':_0x4cf396,'custom':_0x4b2364}))['replace'](/'/g,'\x5c\x27')};_0x94a873[_0x1a57('0x35')](ejs['render'](Mustache[_0x1a57('0xd3')](_0x442de0,_0x3b1e44),{'proactiveActions':_0x4987fc,'alignment':_0x3a58c1[_0x1a57('0x10a')],'verticalAlignment':_0x3a58c1[_0x1a57('0x10b')],'div_color':_0x3a58c1[_0x1a57('0xf9')],'labelText':_0x3a58c1[_0x1a57('0x10c')],'text_color':_0x3a58c1[_0x1a57('0x10d')],'text_button_color':_0x3a58c1[_0x1a57('0x10e')],'button_color':_0x3a58c1[_0x1a57('0x10f')],'background_color':_0x3a58c1['backgroundColor'],'hideWhenOffline':_0x3a58c1[_0x1a57('0x110')],'intervalId':_0x3a58c1[_0x1a57('0x111')],'isDevelopment':_0x161c5c,'chatVersion':_0x5e65b8}));})[_0x1a57('0x24')](handleError(_0x94a873,null));};exports['addApplications']=function(_0xaa5427,_0x3e7d1f){var _0x15cdc4=_0xaa5427[_0x1a57('0x61')]['id'];var _0xecdf2=_0xaa5427['body'];var _0x299755=0xc8;var _0x5a5528=null;return db[_0x1a57('0xdc')][_0x1a57('0xdd')]({'isolationLevel':db['sequelize']['Transaction'][_0x1a57('0x112')]['READ_COMMITTED']},function(_0x42a2e7){return db['ChatWebsite'][_0x1a57('0x6d')]({'where':{'id':_0x15cdc4},'transaction':_0x42a2e7})['then'](function(_0x4e36a7){if(_0x4e36a7){return db['ChatApplication'][_0x1a57('0x30')]({'where':{'ChatWebsiteId':_0x15cdc4},'transaction':_0x42a2e7})[_0x1a57('0x1a')](function(){var _0x3ac99a=_[_0x1a57('0x4b')](_0xecdf2,function(_0x51b545){_0x51b545[_0x1a57('0x70')]=_0x15cdc4;return _0x51b545;});return db['ChatApplication'][_0x1a57('0xdf')](_0x3ac99a,{'transaction':_0x42a2e7});});}else{_0x299755=0x194;_0x5a5528=[];}});})[_0x1a57('0x1a')](function(){if(_0x299755!==0x194){return db[_0x1a57('0x9e')][_0x1a57('0x113')]({'where':{'ChatWebsiteId':_0x15cdc4},'order':_0x1a57('0xa9')})[_0x1a57('0x1a')](function(_0x41e08a){_0x5a5528=_0x41e08a;});}})[_0x1a57('0x24')](function(_0x50b3d2){_0x299755=0x1f4;logger[_0x1a57('0x1f')](_0x50b3d2['stack']);if(_0x50b3d2[_0x1a57('0x34')]){delete _0x50b3d2[_0x1a57('0x34')];}_0x5a5528=_0x50b3d2;})['finally'](function(){if(_0x5a5528===null){_0x3e7d1f[_0x1a57('0x25')](_0x299755);}else{if(_0x299755===0x1f4){_0x3e7d1f[_0x1a57('0x26')](_0x299755)[_0x1a57('0x35')](_0x5a5528);}else{_0x3e7d1f[_0x1a57('0x26')](_0x299755)[_0x1a57('0x2e')](_0x5a5528);}}});};exports[_0x1a57('0x114')]=function(_0x354b61,_0x2c73a8){var _0x92494d={};var _0x1f40b5={};var _0x41d3dc;var _0x30b3c4;return db[_0x1a57('0x5d')]['findOne']({'where':{'id':_0x354b61[_0x1a57('0x61')]['id']}})['then'](handleEntityNotFound(_0x2c73a8,null))[_0x1a57('0x1a')](function(_0x5b24c6){if(_0x5b24c6){_0x41d3dc=_0x5b24c6;_0x1f40b5[_0x1a57('0x44')]=_[_0x1a57('0x50')](db[_0x1a57('0x9e')][_0x1a57('0x4c')]);_0x1f40b5[_0x1a57('0x4f')]=_[_0x1a57('0x50')](_0x354b61[_0x1a57('0x4f')]);_0x1f40b5['filters']=_[_0x1a57('0x52')](_0x1f40b5[_0x1a57('0x44')],_0x1f40b5[_0x1a57('0x4f')]);_0x92494d['attributes']=_[_0x1a57('0x52')](_0x1f40b5[_0x1a57('0x44')],qs[_0x1a57('0x54')](_0x354b61[_0x1a57('0x4f')][_0x1a57('0x54')]));_0x92494d[_0x1a57('0x53')]=_0x92494d[_0x1a57('0x53')][_0x1a57('0x55')]?_0x92494d[_0x1a57('0x53')]:_0x1f40b5['model'];_0x92494d[_0x1a57('0x57')]=qs[_0x1a57('0x58')](_0x354b61['query'][_0x1a57('0x58')]);_0x92494d[_0x1a57('0x59')]=qs[_0x1a57('0x51')](_['pick'](_0x354b61[_0x1a57('0x4f')],_0x1f40b5['filters']));if(_0x354b61[_0x1a57('0x4f')][_0x1a57('0x5a')]){_0x92494d[_0x1a57('0x59')]=_[_0x1a57('0x5b')](_0x92494d[_0x1a57('0x59')],{'$or':_[_0x1a57('0x4b')](_0x92494d['attributes'],function(_0x44d402){var _0x50c74d={};_0x50c74d[_0x44d402]={'$like':'%'+_0x354b61[_0x1a57('0x4f')]['filter']+'%'};return _0x50c74d;})});}_0x92494d=_[_0x1a57('0x5b')]({},_0x92494d,_0x354b61['options']);return _0x41d3dc[_0x1a57('0x114')](_0x92494d);}})[_0x1a57('0x1a')](function(_0x5f1c31){if(_0x5f1c31){_0x30b3c4=_0x5f1c31['length'];if(!_0x354b61[_0x1a57('0x4f')]['hasOwnProperty']('nolimit')){_0x92494d[_0x1a57('0x29')]=qs[_0x1a57('0x29')](_0x354b61[_0x1a57('0x4f')][_0x1a57('0x29')]);_0x92494d[_0x1a57('0x2b')]=qs[_0x1a57('0x2b')](_0x354b61[_0x1a57('0x4f')][_0x1a57('0x2b')]);}return _0x41d3dc[_0x1a57('0x114')](_0x92494d);}})[_0x1a57('0x1a')](function(_0x276ad3){if(_0x276ad3){return _0x276ad3?{'count':_0x30b3c4,'rows':_0x276ad3}:null;}})[_0x1a57('0x1a')](respondWithResult(_0x2c73a8,null))[_0x1a57('0x24')](handleError(_0x2c73a8,null));};exports[_0x1a57('0x115')]=function(_0x57c1ff,_0x16f92b){return db[_0x1a57('0x116')][_0x1a57('0x62')]({'where':{'id':_0x57c1ff[_0x1a57('0x61')]['id']}})['then'](handleEntityNotFound(_0x16f92b,null))[_0x1a57('0x1a')](function(_0x4a8ce2){if(_0x4a8ce2){return _0x4a8ce2[_0x1a57('0x115')](_0x57c1ff[_0x1a57('0x69')]['ids'],_['omit'](_0x57c1ff[_0x1a57('0x69')],[_0x1a57('0x72'),'id'])||{});}})['then'](respondWithResult(_0x16f92b,null))[_0x1a57('0x24')](handleError(_0x16f92b,null));};exports['getProactiveActions']=function(_0x2fcec7,_0x162f4c){var _0x261110={};var _0x58b675={};var _0xa53aae;var _0x33c1b4;return db[_0x1a57('0x5d')][_0x1a57('0x6d')]({'where':{'id':_0x2fcec7[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x162f4c,null))[_0x1a57('0x1a')](function(_0x5f573c){if(_0x5f573c){_0xa53aae=_0x5f573c;_0x58b675[_0x1a57('0x44')]=_['keys'](db[_0x1a57('0x117')][_0x1a57('0x4c')]);_0x58b675[_0x1a57('0x4f')]=_[_0x1a57('0x50')](_0x2fcec7[_0x1a57('0x4f')]);_0x58b675['filters']=_[_0x1a57('0x52')](_0x58b675[_0x1a57('0x44')],_0x58b675[_0x1a57('0x4f')]);_0x261110[_0x1a57('0x53')]=_['intersection'](_0x58b675['model'],qs['fields'](_0x2fcec7[_0x1a57('0x4f')][_0x1a57('0x54')]));_0x261110[_0x1a57('0x53')]=_0x261110[_0x1a57('0x53')]['length']?_0x261110[_0x1a57('0x53')]:_0x58b675[_0x1a57('0x44')];_0x261110[_0x1a57('0x57')]=qs[_0x1a57('0x58')](_0x2fcec7['query'][_0x1a57('0x58')]);_0x261110[_0x1a57('0x59')]=qs['filters'](_[_0x1a57('0x6f')](_0x2fcec7['query'],_0x58b675[_0x1a57('0x51')]));if(_0x2fcec7[_0x1a57('0x4f')]['filter']){_0x261110[_0x1a57('0x59')]=_[_0x1a57('0x5b')](_0x261110[_0x1a57('0x59')],{'$or':_['map'](_0x261110[_0x1a57('0x53')],function(_0x2c5125){var _0x477841={};_0x477841[_0x2c5125]={'$like':'%'+_0x2fcec7['query']['filter']+'%'};return _0x477841;})});}_0x261110=_[_0x1a57('0x5b')]({},_0x261110,_0x2fcec7[_0x1a57('0x5c')]);return _0xa53aae[_0x1a57('0xfc')](_0x261110);}})[_0x1a57('0x1a')](function(_0x408278){if(_0x408278){_0x33c1b4=_0x408278['length'];if(!_0x2fcec7[_0x1a57('0x4f')][_0x1a57('0x56')](_0x1a57('0x6e'))){_0x261110[_0x1a57('0x29')]=qs[_0x1a57('0x29')](_0x2fcec7[_0x1a57('0x4f')][_0x1a57('0x29')]);_0x261110[_0x1a57('0x2b')]=qs['offset'](_0x2fcec7[_0x1a57('0x4f')][_0x1a57('0x2b')]);}return _0xa53aae[_0x1a57('0xfc')](_0x261110);}})['then'](function(_0x5234d2){if(_0x5234d2){return _0x5234d2?{'count':_0x33c1b4,'rows':_0x5234d2}:null;}})[_0x1a57('0x1a')](respondWithResult(_0x162f4c,null))['catch'](handleError(_0x162f4c,null));};exports['getFields']=function(_0x20fb8c,_0x21ef14){var _0x557f51=_0x20fb8c['query']['online']===_0x1a57('0x118')?'offlineForm':'onlineForm';return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'attributes':['id',_0x557f51],'where':{'id':_0x20fb8c[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x21ef14,null))[_0x1a57('0x1a')](function(_0x209280){if(_0x209280){var _0x598583=_0x209280[_0x557f51];var _0x37bdcf=_0x598583&&_0x598583[_0x1a57('0x119')]?_0x598583[_0x1a57('0x119')]:[];_0x21ef14[_0x1a57('0x35')]({'fromKey':_['isNil'](_0x598583[_0x1a57('0x11a')])?undefined:_0x598583[_0x1a57('0x11a')],'count':_0x37bdcf[_0x1a57('0x55')],'rows':_0x37bdcf});}})[_0x1a57('0x24')](handleError(_0x21ef14,null));};exports[_0x1a57('0x11b')]=function(_0x5d11a8,_0x233a03){var _0x5e58e3={'raw':![],'where':{}};var _0x22bbc5={};var _0x5498fc={'count':0x0,'rows':[]};return db[_0x1a57('0x5d')][_0x1a57('0x6d')]({'where':{'id':_0x5d11a8[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x233a03,null))[_0x1a57('0x1a')](function(_0x4f612a){if(_0x4f612a){_0x22bbc5[_0x1a57('0x44')]=_[_0x1a57('0x50')](db[_0x1a57('0x11c')][_0x1a57('0x4c')]);_0x22bbc5[_0x1a57('0x4f')]=_['keys'](_0x5d11a8[_0x1a57('0x4f')]);_0x22bbc5['filters']=_['intersection'](_0x22bbc5[_0x1a57('0x44')],_0x22bbc5['query']);_0x5e58e3[_0x1a57('0x53')]=_[_0x1a57('0x52')](_0x22bbc5[_0x1a57('0x44')],qs[_0x1a57('0x54')](_0x5d11a8[_0x1a57('0x4f')]['fields']));_0x5e58e3[_0x1a57('0x53')]=_0x5e58e3[_0x1a57('0x53')][_0x1a57('0x55')]?_0x5e58e3[_0x1a57('0x53')]:_0x22bbc5['model'];if(!_0x5d11a8[_0x1a57('0x4f')][_0x1a57('0x56')](_0x1a57('0x6e'))){_0x5e58e3[_0x1a57('0x29')]=qs[_0x1a57('0x29')](_0x5d11a8['query']['limit']);_0x5e58e3[_0x1a57('0x2b')]=qs[_0x1a57('0x2b')](_0x5d11a8[_0x1a57('0x4f')][_0x1a57('0x2b')]);}_0x5e58e3['order']=qs[_0x1a57('0x58')](_0x5d11a8[_0x1a57('0x4f')]['sort']);_0x5e58e3[_0x1a57('0x59')]=qs['filters'](_[_0x1a57('0x6f')](_0x5d11a8['query'],_0x22bbc5['filters']));_0x5e58e3[_0x1a57('0x59')][_0x1a57('0x70')]=_0x4f612a['id'];if(_0x5d11a8['query'][_0x1a57('0x5a')]){_0x5e58e3[_0x1a57('0x59')]=_[_0x1a57('0x5b')](_0x5e58e3[_0x1a57('0x59')],{'$or':_[_0x1a57('0x4b')](_0x5e58e3['attributes'],function(_0x1738d7){var _0x4bb4b1={};_0x4bb4b1[_0x1738d7]={'$like':'%'+_0x5d11a8[_0x1a57('0x4f')][_0x1a57('0x5a')]+'%'};return _0x4bb4b1;})});}_0x5e58e3=_[_0x1a57('0x5b')]({},_0x5e58e3,_0x5d11a8[_0x1a57('0x5c')]);return db['ChatOfflineMessage'][_0x1a57('0x2a')]({'where':_0x5e58e3[_0x1a57('0x59')]})[_0x1a57('0x1a')](function(_0xc7079e){_0x5498fc[_0x1a57('0x2a')]=_0xc7079e;if(_0x5d11a8[_0x1a57('0x4f')][_0x1a57('0x5e')]){_0x5e58e3['include']=[{'all':!![]}];}else{_0x5e58e3[_0x1a57('0x76')]=[{'model':db[_0x1a57('0xab')],'as':_0x1a57('0x11d'),'required':![]},{'model':db[_0x1a57('0xde')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x1a57('0x5f')](_0x5e58e3);})[_0x1a57('0x1a')](function(_0x4e0170){_0x5498fc[_0x1a57('0x60')]=_0x4e0170;return _0x5498fc;});}})[_0x1a57('0x1a')](respondWithFilteredResult(_0x233a03,_0x5e58e3))[_0x1a57('0x24')](handleError(_0x233a03,null));};exports['addAgents']=function(_0x12b08f,_0x413be0){return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0x12b08f[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0x413be0,null))['then'](function(_0x332662){if(_0x332662){return _0x332662[_0x1a57('0x11e')](_0x12b08f[_0x1a57('0x69')][_0x1a57('0x72')],_[_0x1a57('0xf3')](_0x12b08f['body'],[_0x1a57('0x72'),'id'])||{})['spread'](function(_0x54f82f){for(var _0x308945=0x0;_0x308945<_0x12b08f[_0x1a57('0x69')]['ids']['length'];_0x308945+=0x1){socket[_0x1a57('0x11f')](_0x1a57('0x120'),{'UserId':Number(_0x12b08f[_0x1a57('0x69')][_0x1a57('0x72')][_0x308945]),'ChatWebsiteId':Number(_0x12b08f['params']['id'])});}return _0x54f82f;});}})[_0x1a57('0x1a')](respondWithResult(_0x413be0,null))[_0x1a57('0x24')](handleError(_0x413be0,null));};exports[_0x1a57('0x121')]=function(_0xc9e6e5,_0x227c43){return db[_0x1a57('0x5d')][_0x1a57('0x62')]({'where':{'id':_0xc9e6e5[_0x1a57('0x61')]['id']}})['then'](handleEntityNotFound(_0x227c43,null))[_0x1a57('0x1a')](function(_0x54a80f){if(_0x54a80f){return _0x54a80f['removeAgents'](_0xc9e6e5[_0x1a57('0x4f')]['ids'])[_0x1a57('0x1a')](function(){if(_[_0x1a57('0x122')](_0xc9e6e5[_0x1a57('0x4f')][_0x1a57('0x72')])){for(var _0x24ad71=0x0;_0x24ad71<_0xc9e6e5[_0x1a57('0x4f')][_0x1a57('0x72')][_0x1a57('0x55')];_0x24ad71+=0x1){socket['emit'](_0x1a57('0x123'),{'UserId':Number(_0xc9e6e5[_0x1a57('0x4f')][_0x1a57('0x72')][_0x24ad71]),'ChatWebsiteId':Number(_0xc9e6e5[_0x1a57('0x61')]['id'])});}}else{socket[_0x1a57('0x11f')]('userChatWebsite:remove',{'UserId':Number(_0xc9e6e5['query'][_0x1a57('0x72')]),'ChatWebsiteId':Number(_0xc9e6e5[_0x1a57('0x61')]['id'])});}});}})[_0x1a57('0x1a')](respondWithStatusCode(_0x227c43,null))[_0x1a57('0x24')](handleError(_0x227c43,null));};exports['getAgents']=function(_0x4b4000,_0xcefe06){var _0x28a02e={};var _0x4ef607={};var _0x4d04b2;var _0x5951a7;return db[_0x1a57('0x5d')][_0x1a57('0x6d')]({'where':{'id':_0x4b4000[_0x1a57('0x61')]['id']}})[_0x1a57('0x1a')](handleEntityNotFound(_0xcefe06,null))['then'](function(_0x385fbf){if(_0x385fbf){_0x4d04b2=_0x385fbf;_0x4ef607['model']=_[_0x1a57('0x50')](db[_0x1a57('0xf4')][_0x1a57('0x4c')]);_0x4ef607[_0x1a57('0x4f')]=_[_0x1a57('0x50')](_0x4b4000['query']);_0x4ef607['filters']=_[_0x1a57('0x52')](_0x4ef607['model'],_0x4ef607[_0x1a57('0x4f')]);_0x28a02e['attributes']=_[_0x1a57('0x52')](_0x4ef607['model'],qs[_0x1a57('0x54')](_0x4b4000[_0x1a57('0x4f')]['fields']));_0x28a02e[_0x1a57('0x53')]=_0x28a02e['attributes'][_0x1a57('0x55')]?_0x28a02e[_0x1a57('0x53')]:_0x4ef607[_0x1a57('0x44')];_0x28a02e['order']=qs[_0x1a57('0x58')](_0x4b4000[_0x1a57('0x4f')]['sort']);_0x28a02e['where']=qs[_0x1a57('0x51')](_['pick'](_0x4b4000[_0x1a57('0x4f')],_0x4ef607[_0x1a57('0x51')]));if(_0x4b4000[_0x1a57('0x4f')][_0x1a57('0x5a')]){_0x28a02e[_0x1a57('0x59')]=_[_0x1a57('0x5b')](_0x28a02e['where'],{'$or':_['map'](_0x28a02e[_0x1a57('0x53')],function(_0x3d3bcc){var _0xa575c4={};_0xa575c4[_0x3d3bcc]={'$like':'%'+_0x4b4000[_0x1a57('0x4f')][_0x1a57('0x5a')]+'%'};return _0xa575c4;})});}_0x28a02e=_[_0x1a57('0x5b')]({},_0x28a02e,_0x4b4000[_0x1a57('0x5c')]);return _0x4d04b2[_0x1a57('0x124')](_0x28a02e);}})[_0x1a57('0x1a')](function(_0x2cf8f8){if(_0x2cf8f8){_0x5951a7=_0x2cf8f8['length'];if(!_0x4b4000[_0x1a57('0x4f')][_0x1a57('0x56')](_0x1a57('0x6e'))){_0x28a02e[_0x1a57('0x29')]=qs[_0x1a57('0x29')](_0x4b4000['query'][_0x1a57('0x29')]);_0x28a02e['offset']=qs['offset'](_0x4b4000[_0x1a57('0x4f')][_0x1a57('0x2b')]);}return _0x4d04b2[_0x1a57('0x124')](_0x28a02e);}})[_0x1a57('0x1a')](function(_0x4909d5){if(_0x4909d5){return _0x4909d5?{'count':_0x5951a7,'rows':_0x4909d5}:null;}})[_0x1a57('0x1a')](respondWithResult(_0xcefe06,null))['catch'](handleError(_0xcefe06,null));};
\ No newline at end of file
+var _0x1224=['getDispositions','findOne','Disposition','nolimit','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','getSystemAvatar','server/files/images/avatars/system_avatar.png','existsSync','notify','chat','from','mapKey','isEmpty','Body\x20is\x20mandatory','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmContact','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','ifTime','List','account','list','orderBy','priority','asc','Contacts','contact','threadId','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ChatInteraction','interaction','messageId','created','autoclose','push','applications','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','difference','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','../../config/license/util','virtual','custom','License','increment','server/files/chat/iframe.ejs','utf8','origin','remote','headers','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','offlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','querystring','html-to-text','ioredis','../../components/parsers/qs','api','../../config/environment','APIBadRequestError','APINotFoundError','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','redis','defaults','socket.io-emitter','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','offset','limit','count','set','Content-Range','json','destroy','get','ChatWebsites','sendStatus','stack','name','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','device','vendor','model','type','index','Pause','mandatoryDispositionPause','ChatWebsite','fieldName','key','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','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','update','describe','addDisposition','body','ChatWebsiteId'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1224,0xc6));var _0x4122=function(_0x4f02a5,_0x154972){_0x4f02a5=_0x4f02a5-0x0;var _0x23ca4f=_0x1224[_0x4f02a5];return _0x23ca4f;};'use strict';var Mustache=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var path=require(_0x4122('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x4122('0x3'));var htmlToText=require(_0x4122('0x4'));var Redis=require(_0x4122('0x5'));var jayson=require('jayson/promise');var url=require('url');var qs=require(_0x4122('0x6'));var logger=require('../../config/logger')(_0x4122('0x7'));var config=require(_0x4122('0x8'));var APIBadRequestError=require('../../errors/api')[_0x4122('0x9')];var APINotFoundError=require('../../errors/api')[_0x4122('0xa')];var APIOutOfIntervalError=require(_0x4122('0xb'))[_0x4122('0xc')];var APIHandleError=require(_0x4122('0xb'))[_0x4122('0xd')];var APIConflictError=require(_0x4122('0xb'))[_0x4122('0xe')];var db=require('../../mysqldb')['db'];config[_0x4122('0xf')]=_[_0x4122('0x10')](config[_0x4122('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x4122('0x11'))(new Redis(config[_0x4122('0xf')]));require('./chatWebsite.socket')[_0x4122('0x12')](socket);var client=jayson[_0x4122('0x13')][_0x4122('0x14')]({'port':0x232c});var client9002=jayson[_0x4122('0x13')]['http']({'port':0x232a});var client9003=jayson[_0x4122('0x13')][_0x4122('0x14')]({'port':0x232b});var client9001=jayson['client'][_0x4122('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x384641,_0x254e35,_0x5d17a6,_0x3b55d9){return new Promise(function(_0x412a1e,_0x457d11){var _0x587c3c=_0x3b55d9||client;return _0x587c3c['request'](_0x384641,_0x5d17a6)[_0x4122('0x15')](function(_0x4c7236){logger[_0x4122('0x16')](_0x4122('0x17'),_0x254e35,_0x4122('0x18'));logger[_0x4122('0x19')](_0x4122('0x1a'),_0x254e35,_0x4122('0x18'),JSON[_0x4122('0x1b')](_0x4c7236));if(_0x4c7236[_0x4122('0x1c')]){if(_0x4c7236[_0x4122('0x1c')][_0x4122('0x1d')]===0x1f4){logger[_0x4122('0x1c')](_0x4122('0x17'),_0x254e35,_0x4c7236[_0x4122('0x1c')][_0x4122('0x1e')]);return _0x457d11(_0x4c7236[_0x4122('0x1c')][_0x4122('0x1e')]);}logger['error'](_0x4122('0x17'),_0x254e35,_0x4c7236[_0x4122('0x1c')][_0x4122('0x1e')]);return _0x412a1e(_0x4c7236['error'][_0x4122('0x1e')]);}else{logger[_0x4122('0x16')](_0x4122('0x17'),_0x254e35,_0x4122('0x18'));_0x412a1e(_0x4c7236[_0x4122('0x1f')][_0x4122('0x1e')]);}})[_0x4122('0x20')](function(_0x2da1d1){logger[_0x4122('0x1c')](_0x4122('0x17'),_0x254e35,_0x2da1d1);_0x457d11(_0x2da1d1);});});}function respondWithStatusCode(_0x52f531,_0x34f5ea){_0x34f5ea=_0x34f5ea||0xcc;return function(_0x5446ce){if(_0x5446ce){return _0x52f531['sendStatus'](_0x34f5ea);}return _0x52f531['status'](_0x34f5ea)[_0x4122('0x21')]();};}function respondWithResult(_0x4e8c7d,_0x2e32f7){_0x2e32f7=_0x2e32f7||0xc8;return function(_0x1c5b14){if(_0x1c5b14){return _0x4e8c7d[_0x4122('0x22')](_0x2e32f7)['json'](_0x1c5b14);}};}function respondWithFilteredResult(_0xbb939f,_0x3691ed){return function(_0x1a11c){if(_0x1a11c){var _0xbf64db=typeof _0x3691ed[_0x4122('0x23')]==='undefined'&&typeof _0x3691ed[_0x4122('0x24')]==='undefined';var _0x518aaa=_0x1a11c[_0x4122('0x25')];var _0x3cbe98=_0xbf64db?0x0:_0x3691ed['offset'];var _0x156fe6=_0xbf64db?_0x1a11c['count']:_0x3691ed[_0x4122('0x23')]+_0x3691ed['limit'];var _0x148a7d;if(_0x156fe6>=_0x518aaa){_0x156fe6=_0x518aaa;_0x148a7d=0xc8;}else{_0x148a7d=0xce;}_0xbb939f[_0x4122('0x22')](_0x148a7d);return _0xbb939f[_0x4122('0x26')](_0x4122('0x27'),_0x3cbe98+'-'+_0x156fe6+'/'+_0x518aaa)[_0x4122('0x28')](_0x1a11c);}return null;};}function saveUpdates(_0x168af5){return function(_0x2881a4){if(_0x2881a4){return _0x2881a4['update'](_0x168af5)[_0x4122('0x15')](function(_0x2e7fce){return _0x2e7fce;});}return null;};}function removeEntity(_0xa8ce1e){return function(_0x58df9c){if(_0x58df9c){return _0x58df9c[_0x4122('0x29')]()[_0x4122('0x15')](function(){var _0x29c0d6=_0x58df9c[_0x4122('0x2a')]({'plain':!![]});var _0x57f13f=_0x4122('0x2b');return db['UserProfileResource'][_0x4122('0x29')]({'where':{'type':_0x57f13f,'resourceId':_0x29c0d6['id']}})['then'](function(){return _0x58df9c;});})[_0x4122('0x15')](function(){_0xa8ce1e[_0x4122('0x22')](0xcc)[_0x4122('0x21')]();});}};}function handleEntityNotFound(_0xa373c6){return function(_0x10379b){if(!_0x10379b){_0xa373c6[_0x4122('0x2c')](0x194);}return _0x10379b;};}function handleError(_0x21257d,_0x1dc688){_0x1dc688=_0x1dc688||0x1f4;return function(_0x594e9c){logger['error'](_0x594e9c[_0x4122('0x2d')]);if(_0x594e9c[_0x4122('0x2e')]){delete _0x594e9c['name'];}_0x21257d['status'](_0x1dc688)['send'](_0x594e9c);};}function createInteractionObject(_0x55707a,_0x2fd4ff,_0x16bd08,_0x219424){var _0x4e9fc5=require(_0x4122('0x2f'));var _0x1cfb27=new _0x4e9fc5();var _0x54030b=_0x1cfb27[_0x4122('0x30')](_0x16bd08[_0x4122('0x31')])[_0x4122('0x32')]();var _0x31168d=_0x2fd4ff[_0x4122('0x33')];if(_0x16bd08['cf-connecting-ip']){_0x31168d=_0x16bd08[_0x4122('0x34')];}else if(_0x16bd08[_0x4122('0x35')]){_0x31168d=_[_0x4122('0x36')](_0x16bd08['x-forwarded-for'][_0x4122('0x37')](','));}return{'ContactId':_0x219424['id'],'ChatWebsiteId':_0x55707a,'from':(_0x219424[_0x4122('0x38')]||'')+'\x20'+(_0x219424[_0x4122('0x39')]||''),'customerIp':_0x31168d,'customerPort':_0x16bd08[_0x4122('0x3a')]?_0x16bd08[_0x4122('0x3a')]:null,'referer':_0x2fd4ff[_0x4122('0x3b')],'browserName':_0x54030b[_0x4122('0x3c')][_0x4122('0x2e')]&&_0x54030b[_0x4122('0x3c')][_0x4122('0x3d')]?util[_0x4122('0x3e')]('%s\x20%s',_0x54030b[_0x4122('0x3c')][_0x4122('0x2e')],_0x54030b[_0x4122('0x3c')]['version']):'unknown','browserVersion':_0x54030b[_0x4122('0x3c')][_0x4122('0x3d')]||_0x4122('0x3f'),'osName':util['format']('%s\x20%s',_0x54030b['os'][_0x4122('0x2e')],_0x54030b['os'][_0x4122('0x3d')]),'osVersion':_0x54030b['os']['version'],'deviceModel':_0x54030b[_0x4122('0x40')]['model']&&_0x54030b['device'][_0x4122('0x41')]?util[_0x4122('0x3e')]('%s\x20%s\x20%s',_0x54030b[_0x4122('0x40')][_0x4122('0x42')],_0x54030b[_0x4122('0x40')][_0x4122('0x41')],_0x54030b[_0x4122('0x40')][_0x4122('0x43')]):null,'deviceVendor':_0x54030b[_0x4122('0x40')]['vendor'],'deviceType':_0x54030b[_0x4122('0x40')][_0x4122('0x43')],'formData':JSON[_0x4122('0x1b')](_0x2fd4ff)};}exports[_0x4122('0x44')]=function(_0x12e99f,_0x2d6ccd){var _0x4bb6ca={'include':[{'model':db[_0x4122('0x45')],'as':_0x4122('0x46')}]},_0x47334e={},_0x19539e={'count':0x0,'rows':[]};var _0x2d86bf=_['map'](db[_0x4122('0x47')]['rawAttributes'],function(_0x242993){return{'name':_0x242993[_0x4122('0x48')],'type':_0x242993['type'][_0x4122('0x49')]};});_0x47334e['model']=_[_0x4122('0x4a')](_0x2d86bf,_0x4122('0x2e'));_0x47334e[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x12e99f[_0x4122('0x4b')]);_0x47334e[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x47334e[_0x4122('0x42')],_0x47334e[_0x4122('0x4b')]);_0x4bb6ca[_0x4122('0x4f')]=_['intersection'](_0x47334e[_0x4122('0x42')],qs[_0x4122('0x50')](_0x12e99f['query']['fields']));_0x4bb6ca[_0x4122('0x4f')]=_0x4bb6ca[_0x4122('0x4f')][_0x4122('0x51')]?_0x4bb6ca[_0x4122('0x4f')]:_0x47334e['model'];if(!_0x12e99f[_0x4122('0x4b')][_0x4122('0x52')]('nolimit')){_0x4bb6ca[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x12e99f[_0x4122('0x4b')]['limit']);_0x4bb6ca[_0x4122('0x23')]=qs[_0x4122('0x23')](_0x12e99f['query'][_0x4122('0x23')]);}_0x4bb6ca[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x12e99f[_0x4122('0x4b')][_0x4122('0x54')]);_0x4bb6ca['where']=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x12e99f[_0x4122('0x4b')],_0x47334e[_0x4122('0x4d')]),_0x2d86bf);if(_0x12e99f[_0x4122('0x4b')][_0x4122('0x56')]){_0x4bb6ca[_0x4122('0x57')]=_[_0x4122('0x58')](_0x4bb6ca[_0x4122('0x57')],{'$or':_[_0x4122('0x4a')](_0x2d86bf,function(_0x436f7c){if(_0x436f7c[_0x4122('0x43')]!==_0x4122('0x59')){var _0x54d733={};_0x54d733[_0x436f7c['name']]={'$like':'%'+_0x12e99f['query'][_0x4122('0x56')]+'%'};return _0x54d733;}})});}_0x4bb6ca=_[_0x4122('0x58')]({},_0x4bb6ca,_0x12e99f[_0x4122('0x5a')]);var _0x372d5a={'where':_0x4bb6ca[_0x4122('0x57')]};return db['ChatWebsite'][_0x4122('0x25')](_0x372d5a)['then'](function(_0x12be15){_0x19539e[_0x4122('0x25')]=_0x12be15;if(_0x12e99f['query']['includeAll']){_0x4bb6ca[_0x4122('0x5b')]=[{'all':!![]}];}return db['ChatWebsite'][_0x4122('0x5c')](_0x4bb6ca);})[_0x4122('0x15')](function(_0x4b7491){_0x19539e['rows']=_0x4b7491;return _0x19539e;})['then'](respondWithFilteredResult(_0x2d6ccd,_0x4bb6ca))[_0x4122('0x20')](handleError(_0x2d6ccd,null));};exports[_0x4122('0x5d')]=function(_0x4625aa,_0x3e256){var _0x51633a={'raw':![],'where':{'id':_0x4625aa[_0x4122('0x5e')]['id']},'include':[{'model':db[_0x4122('0x45')],'as':_0x4122('0x46')}]},_0x5cdbc9={};_0x5cdbc9[_0x4122('0x42')]=_['keys'](db[_0x4122('0x47')][_0x4122('0x5f')]);_0x5cdbc9[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x4625aa[_0x4122('0x4b')]);_0x5cdbc9['filters']=_[_0x4122('0x4e')](_0x5cdbc9[_0x4122('0x42')],_0x5cdbc9['query']);_0x51633a['attributes']=_[_0x4122('0x4e')](_0x5cdbc9[_0x4122('0x42')],qs[_0x4122('0x50')](_0x4625aa[_0x4122('0x4b')]['fields']));_0x51633a[_0x4122('0x4f')]=_0x51633a[_0x4122('0x4f')][_0x4122('0x51')]?_0x51633a[_0x4122('0x4f')]:_0x5cdbc9[_0x4122('0x42')];if(_0x4625aa[_0x4122('0x4b')]['includeAll']){_0x51633a[_0x4122('0x5b')]=[{'all':!![]}];}_0x51633a=_[_0x4122('0x58')]({},_0x51633a,_0x4625aa[_0x4122('0x5a')]);return db['ChatWebsite']['find'](_0x51633a)[_0x4122('0x15')](handleEntityNotFound(_0x3e256,null))['then'](respondWithResult(_0x3e256,null))[_0x4122('0x20')](handleError(_0x3e256,null));};exports[_0x4122('0x60')]=function(_0xed30b6,_0x4f8ee1){return db[_0x4122('0x47')][_0x4122('0x60')](_0xed30b6['body'],{})[_0x4122('0x15')](function(_0x3157fa){var _0x58566c=_0xed30b6['user']['get']({'plain':!![]});if(!_0x58566c)throw new Error(_0x4122('0x61'));if(_0x58566c[_0x4122('0x62')]===_0x4122('0x63')){var _0x44fcee=_0x3157fa['get']({'plain':!![]});var _0xf41526=_0x4122('0x2b');return db[_0x4122('0x64')][_0x4122('0x65')]({'where':{'name':_0xf41526,'userProfileId':_0x58566c[_0x4122('0x66')]},'raw':!![]})['then'](function(_0x2fa300){if(_0x2fa300&&_0x2fa300[_0x4122('0x67')]===0x0){return db[_0x4122('0x68')][_0x4122('0x60')]({'name':_0x44fcee[_0x4122('0x2e')],'resourceId':_0x44fcee['id'],'type':_0x2fa300['name'],'sectionId':_0x2fa300['id']},{})[_0x4122('0x15')](function(){return _0x3157fa;});}else{return _0x3157fa;}})[_0x4122('0x20')](function(_0x4e4364){logger[_0x4122('0x1c')](_0x4122('0x69'),_0x4e4364);throw _0x4e4364;});}return _0x3157fa;})[_0x4122('0x15')](respondWithResult(_0x4f8ee1,0xc9))[_0x4122('0x20')](handleError(_0x4f8ee1,null));};exports[_0x4122('0x6a')]=function(_0x3ae015,_0x49d273){if(_0x3ae015['body']['id']){delete _0x3ae015['body']['id'];}return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x3ae015[_0x4122('0x5e')]['id']},'include':[{'model':db[_0x4122('0x45')],'as':_0x4122('0x46')}]})[_0x4122('0x15')](handleEntityNotFound(_0x49d273,null))[_0x4122('0x15')](saveUpdates(_0x3ae015['body'],null))[_0x4122('0x15')](respondWithResult(_0x49d273,null))['catch'](handleError(_0x49d273,null));};exports[_0x4122('0x29')]=function(_0x3376ca,_0x2cc75a){return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x3376ca[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x2cc75a,null))['then'](removeEntity(_0x2cc75a,null))['catch'](handleError(_0x2cc75a,null));};exports[_0x4122('0x6b')]=function(_0x5bbfaf,_0x5cc276){return db[_0x4122('0x47')][_0x4122('0x6b')]()['then'](respondWithResult(_0x5cc276,null))['catch'](handleError(_0x5cc276,null));};exports[_0x4122('0x6c')]=function(_0x300254,_0x44b90c){if(_0x300254[_0x4122('0x6d')]['id']){delete _0x300254[_0x4122('0x6d')]['id'];}return db['ChatWebsite'][_0x4122('0x65')]({'where':{'id':_0x300254[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x44b90c,null))[_0x4122('0x15')](function(_0x1c051d){if(_0x1c051d){_0x300254[_0x4122('0x6d')][_0x4122('0x6e')]=_0x1c051d['id'];return db['Disposition'][_0x4122('0x60')](_0x300254['body']);}})[_0x4122('0x15')](respondWithResult(_0x44b90c,null))[_0x4122('0x20')](handleError(_0x44b90c,null));};exports[_0x4122('0x6f')]=function(_0x3270d9,_0x3747e8){var _0x376ddf={'raw':![],'where':{}};var _0x122a84={};var _0x57409e={'count':0x0,'rows':[]};return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x3270d9[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x3747e8,null))[_0x4122('0x15')](function(_0x452094){if(_0x452094){_0x122a84[_0x4122('0x42')]=_['keys'](db[_0x4122('0x71')][_0x4122('0x5f')]);_0x122a84[_0x4122('0x4b')]=_['keys'](_0x3270d9[_0x4122('0x4b')]);_0x122a84[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x122a84[_0x4122('0x42')],_0x122a84[_0x4122('0x4b')]);_0x376ddf[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0x122a84[_0x4122('0x42')],qs[_0x4122('0x50')](_0x3270d9['query']['fields']));_0x376ddf['attributes']=_0x376ddf[_0x4122('0x4f')]['length']?_0x376ddf[_0x4122('0x4f')]:_0x122a84[_0x4122('0x42')];if(!_0x3270d9[_0x4122('0x4b')]['hasOwnProperty'](_0x4122('0x72'))){_0x376ddf[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x3270d9['query'][_0x4122('0x24')]);_0x376ddf[_0x4122('0x23')]=qs['offset'](_0x3270d9[_0x4122('0x4b')]['offset']);}_0x376ddf['order']=qs['sort'](_0x3270d9[_0x4122('0x4b')]['sort']);_0x376ddf[_0x4122('0x57')]=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x3270d9[_0x4122('0x4b')],_0x122a84[_0x4122('0x4d')]));_0x376ddf[_0x4122('0x57')]['ChatWebsiteId']=_0x452094['id'];if(_0x3270d9[_0x4122('0x4b')][_0x4122('0x56')]){_0x376ddf['where']=_['merge'](_0x376ddf['where'],{'$or':_[_0x4122('0x4a')](_0x376ddf['attributes'],function(_0x909ac0){var _0x5de7fa={};_0x5de7fa[_0x909ac0]={'$like':'%'+_0x3270d9[_0x4122('0x4b')][_0x4122('0x56')]+'%'};return _0x5de7fa;})});}_0x376ddf=_[_0x4122('0x58')]({},_0x376ddf,_0x3270d9[_0x4122('0x5a')]);return db[_0x4122('0x71')]['count']({'where':_0x376ddf[_0x4122('0x57')]})[_0x4122('0x15')](function(_0x3357a8){_0x57409e[_0x4122('0x25')]=_0x3357a8;if(_0x3270d9[_0x4122('0x4b')][_0x4122('0x73')]){_0x376ddf[_0x4122('0x5b')]=[{'all':!![]}];}return db[_0x4122('0x71')][_0x4122('0x5c')](_0x376ddf);})[_0x4122('0x15')](function(_0x15dede){_0x57409e['rows']=_0x15dede;return _0x57409e;});}})['then'](respondWithFilteredResult(_0x3747e8,_0x376ddf))['catch'](handleError(_0x3747e8,null));};exports[_0x4122('0x74')]=function(_0x2d3a6a,_0x5f5c67){return db['ChatWebsite'][_0x4122('0x65')]({'where':{'id':_0x2d3a6a[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x5f5c67,null))['then'](function(_0x1e186e){if(_0x1e186e){return _0x1e186e[_0x4122('0x74')](_0x2d3a6a[_0x4122('0x4b')][_0x4122('0x75')]);}})[_0x4122('0x15')](respondWithStatusCode(_0x5f5c67,null))[_0x4122('0x20')](handleError(_0x5f5c67,null));};exports[_0x4122('0x76')]=function(_0x2e497a,_0x4308e8){if(_0x2e497a[_0x4122('0x6d')]['id']){delete _0x2e497a['body']['id'];}return db['ChatWebsite'][_0x4122('0x65')]({'where':{'id':_0x2e497a[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4308e8,null))['then'](function(_0x29a62a){if(_0x29a62a){_0x2e497a[_0x4122('0x6d')][_0x4122('0x6e')]=_0x29a62a['id'];return db[_0x4122('0x77')][_0x4122('0x60')](_0x2e497a[_0x4122('0x6d')]);}})['then'](respondWithResult(_0x4308e8,null))['catch'](handleError(_0x4308e8,null));};exports[_0x4122('0x78')]=function(_0x2c6b16,_0x284fda){var _0x1d29b4={'raw':![],'where':{}};var _0xaa0c38={};var _0x2324c6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4122('0x70')]({'where':{'id':_0x2c6b16[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x284fda,null))[_0x4122('0x15')](function(_0x157c6a){if(_0x157c6a){_0xaa0c38[_0x4122('0x42')]=_[_0x4122('0x4c')](db[_0x4122('0x77')][_0x4122('0x5f')]);_0xaa0c38['query']=_[_0x4122('0x4c')](_0x2c6b16[_0x4122('0x4b')]);_0xaa0c38[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0xaa0c38['model'],_0xaa0c38[_0x4122('0x4b')]);_0x1d29b4[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0xaa0c38['model'],qs['fields'](_0x2c6b16[_0x4122('0x4b')]['fields']));_0x1d29b4[_0x4122('0x4f')]=_0x1d29b4[_0x4122('0x4f')][_0x4122('0x51')]?_0x1d29b4[_0x4122('0x4f')]:_0xaa0c38[_0x4122('0x42')];if(!_0x2c6b16['query'][_0x4122('0x52')](_0x4122('0x72'))){_0x1d29b4[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x2c6b16[_0x4122('0x4b')][_0x4122('0x24')]);_0x1d29b4[_0x4122('0x23')]=qs[_0x4122('0x23')](_0x2c6b16[_0x4122('0x4b')][_0x4122('0x23')]);}_0x1d29b4[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x2c6b16[_0x4122('0x4b')][_0x4122('0x54')]);_0x1d29b4[_0x4122('0x57')]=qs['filters'](_[_0x4122('0x55')](_0x2c6b16['query'],_0xaa0c38[_0x4122('0x4d')]));_0x1d29b4[_0x4122('0x57')][_0x4122('0x6e')]=_0x157c6a['id'];if(_0x2c6b16['query'][_0x4122('0x56')]){_0x1d29b4['where']=_[_0x4122('0x58')](_0x1d29b4[_0x4122('0x57')],{'$or':_['map'](_0x1d29b4['attributes'],function(_0x5ba438){var _0x205457={};_0x205457[_0x5ba438]={'$like':'%'+_0x2c6b16[_0x4122('0x4b')]['filter']+'%'};return _0x205457;})});}_0x1d29b4=_[_0x4122('0x58')]({},_0x1d29b4,_0x2c6b16[_0x4122('0x5a')]);return db[_0x4122('0x77')][_0x4122('0x25')]({'where':_0x1d29b4[_0x4122('0x57')]})[_0x4122('0x15')](function(_0x49d235){_0x2324c6[_0x4122('0x25')]=_0x49d235;if(_0x2c6b16[_0x4122('0x4b')][_0x4122('0x73')]){_0x1d29b4[_0x4122('0x5b')]=[{'all':!![]}];}return db[_0x4122('0x77')][_0x4122('0x5c')](_0x1d29b4);})[_0x4122('0x15')](function(_0x2b841f){_0x2324c6[_0x4122('0x79')]=_0x2b841f;return _0x2324c6;});}})['then'](respondWithFilteredResult(_0x284fda,_0x1d29b4))[_0x4122('0x20')](handleError(_0x284fda,null));};exports['removeAnswers']=function(_0x4eb3da,_0x4d91a6){return db['ChatWebsite'][_0x4122('0x65')]({'where':{'id':_0x4eb3da[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x4d91a6,null))[_0x4122('0x15')](function(_0x51fb2d){if(_0x51fb2d){return _0x51fb2d['removeAnswers'](_0x4eb3da['query'][_0x4122('0x75')]);}})[_0x4122('0x15')](respondWithStatusCode(_0x4d91a6,null))[_0x4122('0x20')](handleError(_0x4d91a6,null));};exports[_0x4122('0x7a')]=function(_0x102854,_0x5e3c0f){_0x102854[_0x4122('0x6d')][_0x4122('0x7b')]=_0x102854[_0x4122('0x7c')][_0x4122('0x7d')];return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x102854[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x5e3c0f,null))['then'](saveUpdates(_0x102854[_0x4122('0x6d')],null))[_0x4122('0x15')](respondWithResult(_0x5e3c0f,null))[_0x4122('0x20')](handleError(_0x5e3c0f,null));};exports[_0x4122('0x7e')]=function(_0x24b499,_0x2060eb){_0x24b499[_0x4122('0x6d')][_0x4122('0x7f')]=_0x24b499['file'][_0x4122('0x7d')];return db[_0x4122('0x47')]['find']({'where':{'id':_0x24b499['params']['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x2060eb,null))[_0x4122('0x15')](saveUpdates(_0x24b499[_0x4122('0x6d')],null))[_0x4122('0x15')](respondWithResult(_0x2060eb,null))[_0x4122('0x20')](handleError(_0x2060eb,null));};exports[_0x4122('0x80')]=function(_0x1489f7,_0x152426){_0x1489f7[_0x4122('0x6d')][_0x4122('0x81')]=_0x1489f7['file'][_0x4122('0x7d')];return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x1489f7[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x152426,null))['then'](saveUpdates(_0x1489f7[_0x4122('0x6d')],null))[_0x4122('0x15')](respondWithResult(_0x152426,null))[_0x4122('0x20')](handleError(_0x152426,null));};exports[_0x4122('0x82')]=function(_0x1fc2e6,_0x29e7a2){_0x1fc2e6[_0x4122('0x6d')][_0x4122('0x83')]=_0x1fc2e6['file'][_0x4122('0x7d')];return db[_0x4122('0x47')]['find']({'where':{'id':_0x1fc2e6[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x29e7a2,null))[_0x4122('0x15')](saveUpdates(_0x1fc2e6[_0x4122('0x6d')],null))[_0x4122('0x15')](respondWithResult(_0x29e7a2,null))[_0x4122('0x20')](handleError(_0x29e7a2,null));};exports[_0x4122('0x84')]=function(_0x5b3b35,_0x5e812e){var _0x338382=path[_0x4122('0x85')](config[_0x4122('0x86')],'server/files/images/logos/default_logo.svg');var _0x4eb5c1={'where':{'id':_0x5b3b35[_0x4122('0x5e')]['id']},'attributes':['id',_0x4122('0x7b')],'raw':!![]};var _0x1005a8=![];return require('../../config/license/util')[_0x4122('0x87')]()['then'](function(_0x790b9c){if(_0x790b9c){_0x1005a8=_0x790b9c['custom'];}})[_0x4122('0x15')](function(){return db[_0x4122('0x47')]['find'](_0x4eb5c1);})[_0x4122('0x15')](handleEntityNotFound(_0x5e812e,null))[_0x4122('0x15')](function(_0xea2df4){if(_0xea2df4){if(!_['isNil'](_0xea2df4['sitepic'])){if(fs['existsSync'](path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x88'),_0xea2df4[_0x4122('0x7b')]))&&_0x1005a8){_0x338382=path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x88'),_0xea2df4[_0x4122('0x7b')]);}}return _0x5e812e[_0x4122('0x89')](_0x338382);}})[_0x4122('0x20')](handleError(_0x5e812e,null));};exports[_0x4122('0x8a')]=function(_0xbffd65,_0x39ed0a){var _0xabc7a=path['join'](config[_0x4122('0x86')],'server/files/images/avatars/default_avatar.png');var _0x294f6c={'where':{'id':_0xbffd65[_0x4122('0x5e')]['id']},'attributes':['id',_0x4122('0x7f')],'raw':!![]};return db[_0x4122('0x47')][_0x4122('0x65')](_0x294f6c)[_0x4122('0x15')](handleEntityNotFound(_0x39ed0a,null))[_0x4122('0x15')](function(_0x4b8af0){if(_0x4b8af0){if(!_['isNil'](_0x4b8af0['agentAvatar'])){if(fs['existsSync'](path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x8b'),_0x4b8af0['agentAvatar']))){_0xabc7a=path['join'](config[_0x4122('0x86')],_0x4122('0x8b'),_0x4b8af0[_0x4122('0x7f')]);}}return _0x39ed0a[_0x4122('0x89')](_0xabc7a);}})[_0x4122('0x20')](handleError(_0x39ed0a,null));};exports[_0x4122('0x8c')]=function(_0x3ddf4c,_0x2c3f0d){var _0x105186=path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x8d'));var _0x38eff7={'where':{'id':_0x3ddf4c[_0x4122('0x5e')]['id']},'attributes':['id',_0x4122('0x81'),_0x4122('0x8e')],'raw':!![]};return db['ChatWebsite'][_0x4122('0x65')](_0x38eff7)['then'](handleEntityNotFound(_0x2c3f0d,null))[_0x4122('0x15')](function(_0x26033d){if(_0x26033d){if(!_[_0x4122('0x8f')](_0x26033d[_0x4122('0x81')])){if(fs['existsSync'](path[_0x4122('0x85')](config[_0x4122('0x86')],'server/files/images/avatars/',_0x26033d[_0x4122('0x81')]))&&_0x26033d[_0x4122('0x8e')]){_0x105186=path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x8b'),_0x26033d[_0x4122('0x81')]);}}return _0x2c3f0d[_0x4122('0x89')](_0x105186);}})[_0x4122('0x20')](handleError(_0x2c3f0d,null));};exports[_0x4122('0x90')]=function(_0x539163,_0x5c78c0){var _0xdb77eb=path['join'](config['root'],_0x4122('0x91'));var _0x1cc890={'where':{'id':_0x539163[_0x4122('0x5e')]['id']},'attributes':['id',_0x4122('0x83')],'raw':!![]};return db[_0x4122('0x47')][_0x4122('0x65')](_0x1cc890)[_0x4122('0x15')](handleEntityNotFound(_0x5c78c0,null))[_0x4122('0x15')](function(_0x10e93d){if(_0x10e93d){if(!_['isNil'](_0x10e93d[_0x4122('0x83')])){if(fs[_0x4122('0x92')](path['join'](config[_0x4122('0x86')],_0x4122('0x8b'),_0x10e93d[_0x4122('0x83')]))){_0xdb77eb=path['join'](config[_0x4122('0x86')],_0x4122('0x8b'),_0x10e93d['systemAvatar']);}}return _0x5c78c0['download'](_0xdb77eb);}})[_0x4122('0x20')](handleError(_0x5c78c0,null));};exports[_0x4122('0x93')]=function(_0xb9b23b,_0x3a5d97){var _0x1f2b80={'body':_0xb9b23b[_0x4122('0x6d')],'channel':_0x4122('0x94')};var _0x3d905f=[];var _0x1609fd=[];var _0x1c81f4={};var _0x1cdd7a=![];if(_0xb9b23b['body']['id']){delete _0xb9b23b[_0x4122('0x6d')]['id'];}if(_[_0x4122('0x8f')](_0xb9b23b[_0x4122('0x6d')][_0x4122('0x95')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x4122('0x8f')](_0xb9b23b[_0x4122('0x6d')][_0x4122('0x96')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x4122('0x97')](_0xb9b23b[_0x4122('0x6d')]['body'])){throw new APIBadRequestError(_0x4122('0x98'));}return db['CmContact'][_0x4122('0x6b')]()[_0x4122('0x15')](function(_0x171926){if(!_0x171926){throw new Error(_0x4122('0x99'));}_0x3d905f=Object[_0x4122('0x4c')](_0x171926)[_0x4122('0x56')](function(_0x4ae150){return![_0x4122('0x9a'),'updatedAt']['includes'](_0x4ae150);});_0x1609fd=Object[_0x4122('0x4c')](_0x171926)['filter'](function(_0x3aac12){return!['createdAt',_0x4122('0x9b'),_0x4122('0x9c'),_0x4122('0x9d')][_0x4122('0x9e')](_0x3aac12);});if(!_['includes'](_0x1609fd,_0xb9b23b[_0x4122('0x6d')][_0x4122('0x96')])){throw new APIBadRequestError(_0x4122('0x9f')+_0x1609fd[_0x4122('0x85')](',\x20'));}_0x1c81f4[_0xb9b23b['body']['mapKey']]=_0xb9b23b[_0x4122('0x6d')][_0x4122('0x95')];})[_0x4122('0x15')](function(){return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0xb9b23b['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4122('0xa0')],'as':'Contacts','where':_0x1c81f4,'limit':0x1,'order':[[_0x4122('0x9b'),_0x4122('0xa1')]]}]},{'model':db[_0x4122('0xa2')],'as':_0x4122('0xa3')},{'model':db[_0x4122('0xa4')],'as':_0x4122('0xa4'),'include':[{'model':db[_0x4122('0xa4')],'as':_0x4122('0xa5'),'attributes':['id',_0x4122('0xa6')],'raw':!![]}]}]});})[_0x4122('0x15')](function(_0xac7866){if(!_0xac7866){throw new APINotFoundError(util[_0x4122('0x3e')](_0x4122('0xa7'),_0xb9b23b[_0x4122('0x5e')]['id']));}var _0x530878=_0xac7866[_0x4122('0xa4')];if(_0x530878){var _0x3a9445=_0xac7866[_0x4122('0xa8')]||undefined;return _0x530878[_0x4122('0xa9')](_0x3a9445)['then'](function(_0x355157){if(!_0x355157){throw new APIOutOfIntervalError();}return _0xac7866;});}else{return _0xac7866;}})[_0x4122('0x15')](function(_0x67d048){if(!_0x67d048[_0x4122('0xaa')]){return;}_0x1f2b80[_0x4122('0xab')]=_0x67d048;_0x1f2b80[_0x4122('0xac')]=_0x67d048['List'];_0x1f2b80['applications']=_[_0x4122('0xad')](_0x67d048[_0x4122('0xa3')],[_0x4122('0xae')],[_0x4122('0xaf')]);if(_0x1f2b80[_0x4122('0xab')]['Applications']){delete _0x1f2b80['account'][_0x4122('0xa3')];}if(_0x1f2b80[_0x4122('0xab')][_0x4122('0xaa')]&&_0x1f2b80[_0x4122('0xab')][_0x4122('0xaa')][_0x4122('0xb0')]['length']){return _0x1f2b80[_0x4122('0xab')][_0x4122('0xaa')][_0x4122('0xb0')][0x0];}var _0x4ebef5=_[_0x4122('0x10')](_0xb9b23b[_0x4122('0x6d')],{'firstName':_0xb9b23b[_0x4122('0x6d')][_0x4122('0x95')],'ListId':_0x67d048[_0x4122('0x9d')]});_0x4ebef5[_0xb9b23b['body'][_0x4122('0x96')]]=_0xb9b23b[_0x4122('0x6d')][_0x4122('0x95')];return db[_0x4122('0xa0')]['create'](_0x4ebef5,{'fields':_0x3d905f,'raw':!![]});})['then'](function(_0x4d8630){_0x1f2b80[_0x4122('0xb1')]=_0x4d8630;var _0x5a7f9a=createInteractionObject(_0xb9b23b[_0x4122('0x5e')]['id'],_0xb9b23b['body'],_0xb9b23b['headers'],_0x4d8630);var _0x164c12={'ChatWebsiteId':_0xb9b23b[_0x4122('0x5e')]['id']};if(_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb2')]){_0x164c12[_0x4122('0xb2')]=_0xb9b23b[_0x4122('0x6d')]['threadId'];_0x164c12[_0x4122('0xb3')]=![];return db['ChatInteraction']['find']({'where':_0x164c12})['then'](function(_0x2e77f4){var _0xb215b8=_0xb9b23b[_0x4122('0x6d')][_0x4122('0x33')]&&_0xb9b23b[_0x4122('0x6d')]['referer'];if(_0x2e77f4){_0x1cdd7a=!![];return _0x2e77f4;}else if(!_0xb215b8&&_0x2e77f4&&_0x2e77f4[_0x4122('0xb3')]){throw new APIConflictError(_0x4122('0xb4'));}_0x5a7f9a[_0x4122('0xb2')]=_0xb9b23b[_0x4122('0x6d')]['threadId'];_0x5a7f9a[_0x4122('0xb5')]=_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb5')];return db[_0x4122('0xb6')][_0x4122('0x60')](_0x5a7f9a);});}_0x164c12['ContactId']=_0x4d8630['id'];if(_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb7')]&&_0xb9b23b['body'][_0x4122('0xb7')]['id']){_0x164c12['id']=_0xb9b23b['body'][_0x4122('0xb7')]['id'];return db[_0x4122('0xb6')]['find']({'where':_0x164c12})[_0x4122('0x15')](function(_0x5aec89){var _0xddf209=_0xb9b23b[_0x4122('0x6d')][_0x4122('0x33')]&&_0xb9b23b[_0x4122('0x6d')][_0x4122('0x3b')];if(!_0xddf209&&_0x5aec89&&_0x5aec89[_0x4122('0xb3')]){throw new APIConflictError(_0x4122('0xb4'));}else if(_0x5aec89){_0x1cdd7a=!![];return _0x5aec89;}else{return db[_0x4122('0xb6')][_0x4122('0x60')](_0x5a7f9a);}});}return db[_0x4122('0xb6')][_0x4122('0x60')](_0x5a7f9a);})[_0x4122('0x15')](function(_0x14b404){if(!_0x1cdd7a){return _0x14b404;}var _0x28a0fb={'from':(_0x1f2b80['contact'][_0x4122('0x38')]||'')+'\x20'+(_0x1f2b80[_0x4122('0xb1')][_0x4122('0x39')]||'')};if(_0xb9b23b['body'][_0x4122('0xb2')]&&_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb8')]&&_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb2')]!=_0xb9b23b[_0x4122('0x6d')][_0x4122('0xb8')]){_0x28a0fb[_0x4122('0xb2')]=_0xb9b23b[_0x4122('0x6d')]['messageId'];}return _0x14b404['update'](_0x28a0fb);})[_0x4122('0x15')](function(_0x1e88b5){_0x1f2b80[_0x4122('0xb7')]=_0x1e88b5[_0x4122('0x2a')]({'plain':!![]});_0x1f2b80[_0x4122('0xb7')][_0x4122('0xb9')]=!_0x1cdd7a;if(_0x1f2b80[_0x4122('0xb7')][_0x4122('0xb9')]){if(_0x1f2b80[_0x4122('0xab')][_0x4122('0xba')]){_0x1f2b80['applications'][_0x4122('0xbb')]({'id':0x0,'priority':_0x1f2b80[_0x4122('0xbc')]['length']+0x1,'app':_0x4122('0xbd'),'appdata':_0x4122('0xbe'),'interval':_0x4122('0xbf')});}}return db[_0x4122('0xc0')][_0x4122('0x60')]({'body':_0xb9b23b['body'][_0x4122('0x6d')],'ChatWebsiteId':_0xb9b23b[_0x4122('0x5e')]['id'],'ChatInteractionId':_0x1e88b5['id'],'direction':'in','ContactId':_0x1f2b80[_0x4122('0xb1')]['id'],'AttachmentId':_0xb9b23b[_0x4122('0x6d')][_0x4122('0xc1')]});})['then'](function(_0x230f2b){_0x1f2b80['message']=_0x230f2b;if(!_0x1f2b80[_0x4122('0xb7')][_0x4122('0xc2')]){return;}return db[_0x4122('0xc3')][_0x4122('0x65')]({'attributes':['id',_0x4122('0x2e')],'where':{'id':_0x1f2b80[_0x4122('0xb7')][_0x4122('0xc2')]}});})[_0x4122('0x15')](function(_0x1f9496){if(_0x1f9496){_0x1f2b80[_0x4122('0xbc')][_0x4122('0xc4')]({'id':0x0,'priority':0x0,'app':_0x4122('0xc5'),'appdata':_0x1f9496[_0x4122('0x2e')]+','+(_0x1f2b80['account'][_0x4122('0xc6')]||0xa),'interval':_0x4122('0xbf')});_0x1f2b80[_0x4122('0xc7')]=!![];}if(!_0x1f2b80[_0x4122('0xb7')][_0x4122('0xc8')]){return;}return db[_0x4122('0xc9')][_0x4122('0x65')]({'attributes':['id',_0x4122('0x2e')],'where':{'id':_0x1f2b80[_0x4122('0xb7')]['queueId']}});})['then'](function(_0x517373){if(_0x517373){_0x1f2b80[_0x4122('0xbc')]['unshift']({'id':0x0,'priority':0x1,'app':_0x4122('0xca'),'appdata':_0x517373['name']+','+(_0x1f2b80[_0x4122('0xab')][_0x4122('0xcb')]||0x12c),'interval':_0x4122('0xbf')});}return respondWithRpcPromise(_0x4122('0xcc'),_0x4122('0xcd'),_0x1f2b80);})['then'](function(_0x287dcc){respondWithRpcPromise(_0x4122('0xce'),_0x4122('0xce'),{'event':_0x4122('0x93'),'message':_0x287dcc},client9002);return _0x287dcc;})[_0x4122('0x15')](respondWithResult(_0x3a5d97,null))['catch'](APIHandleError(_0x3a5d97));};exports[_0x4122('0xcf')]=function(_0x49570d,_0x4bbde1){var _0x4f5f47,_0x4caa8c,_0x4a12a6;var _0x34bfa1=[];var _0x8d2161={};var _0x5911c6=_0x49570d[_0x4122('0xd0')]||[];var _0x203510=[];var _0x4cafd4;return db['CmContact'][_0x4122('0x6b')]()[_0x4122('0x15')](function(_0x3fb236){if(!_0x3fb236){throw new db[(_0x4122('0xd1'))]['ValidationError']('no\x20available\x20attributes');}_0x34bfa1=_[_0x4122('0xd2')](_['keys'](_0x3fb236),[_0x4122('0x9a'),_0x4122('0x9b'),'CompanyId',_0x4122('0x9d')]);if(_0x49570d[_0x4122('0x6d')]['id']){delete _0x49570d['body']['id'];}if(_['isNil'](_0x49570d[_0x4122('0x6d')][_0x4122('0x95')])){throw _0x4bbde1[_0x4122('0x22')](0x1f4)['send'](new db[(_0x4122('0xd1'))][(_0x4122('0xd3'))](_0x4122('0xd4')));}if(_[_0x4122('0x8f')](_0x49570d['body'][_0x4122('0x6d')])||_0x49570d[_0x4122('0x6d')][_0x4122('0x6d')]===''){throw _0x4bbde1[_0x4122('0x22')](0x1f4)['send'](new db[(_0x4122('0xd1'))][(_0x4122('0xd3'))](_0x4122('0xd5')));}if(_[_0x4122('0x8f')](_0x49570d[_0x4122('0x6d')][_0x4122('0xd6')])){throw _0x4bbde1[_0x4122('0x22')](0x1f4)[_0x4122('0xd7')](new db[(_0x4122('0xd1'))][(_0x4122('0xd3'))](_0x4122('0xd8')+_0x34bfa1));}if(!_[_0x4122('0x9e')](_0x34bfa1,_0x49570d[_0x4122('0x6d')][_0x4122('0xd6')])){throw _0x4bbde1[_0x4122('0x22')](0x1f4)[_0x4122('0xd7')](new db[(_0x4122('0xd1'))][(_0x4122('0xd3'))](_0x4122('0xd9')+_0x34bfa1));}_0x8d2161[_0x49570d[_0x4122('0x6d')][_0x4122('0xd6')]]=_0x49570d[_0x4122('0x6d')][_0x4122('0x95')];})['then'](function(){return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x49570d['params']['id']},'include':[{'model':db[_0x4122('0xda')],'as':'List'},{'model':db[_0x4122('0xdb')],'as':'MailAccount'}]});})[_0x4122('0x15')](handleEntityNotFound(_0x4bbde1,null))[_0x4122('0x15')](function(_0x521816){if(_0x521816&&_0x521816[_0x4122('0xaa')]){_0x4caa8c=_0x521816;var _0x35e9a3=_[_0x4122('0x10')](_0x49570d[_0x4122('0x6d')],{'firstName':_0x49570d['body'][_0x4122('0x95')],'phone':_0x49570d[_0x4122('0x6d')]['from'],'ListId':_0x521816[_0x4122('0x9d')]});_0x35e9a3[_0x49570d[_0x4122('0x6d')][_0x4122('0xd6')]]=_0x49570d[_0x4122('0x6d')][_0x4122('0x95')];return db[_0x4122('0xa0')][_0x4122('0xdc')]({'where':_0x8d2161,'defaults':_0x35e9a3});}})[_0x4122('0xdd')](function(_0x1a98a1){if(_0x1a98a1){_0x4a12a6=_0x1a98a1;var _0x15ac3f=fs[_0x4122('0xde')](path['join'](config['root'],_0x4122('0xdf')),'utf8');var _0x51d120=ejs[_0x4122('0xe0')](_0x15ac3f,{'body':_[_0x4122('0xe1')](_0x49570d[_0x4122('0x6d')][_0x4122('0x6d')]),'bodyTitle':_0x4caa8c[_0x4122('0xe2')]});return db[_0x4122('0xe3')][_0x4122('0x60')]({'body':_0x51d120,'plainBody':htmlToText[_0x4122('0xe4')](_0x51d120),'ContactId':_0x1a98a1['id'],'ChatWebsiteId':_0x4caa8c['id']});}})[_0x4122('0x15')](function(_0x6ddac0){_0x4cafd4=_0x6ddac0;if(_0x5911c6[_0x4122('0x51')]){var _0x1747ac=_0x5911c6[_0x4122('0x4a')](function(_0x144fa0){return{'name':_0x144fa0[_0x4122('0xe5')],'basename':_0x144fa0[_0x4122('0x7d')],'type':_0x144fa0[_0x4122('0xe6')],'ChatOfflineMessageId':_0x6ddac0['id']};});_0x203510=_0x1747ac[_0x4122('0x4a')](_0xfbe78d=>{var _0x4390da={'filename':_0xfbe78d[_0x4122('0x2e')],'path':path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0xe7'),_0x4122('0xd0'),_0x4122('0xe8'),_0x4122('0xe9'),_0xfbe78d[_0x4122('0xea')])};return _0x4390da;});if(!_0x4caa8c['openNewInteraction']){return db[_0x4122('0xeb')][_0x4122('0xec')](function(_0x59108b){return db[_0x4122('0xed')][_0x4122('0xee')](_0x1747ac,{'transaction':_0x59108b});});}}})[_0x4122('0x15')](function(){if(_0x4cafd4){_0x4f5f47=_0x4cafd4;return db[_0x4122('0xdb')][_0x4122('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x4122('0xef')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4122('0xf0')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x4122('0x15')](function(_0x496112){if(_0x496112&&_0x496112[_0x4122('0xf1')]&&_0x4caa8c[_0x4122('0xf2')]&&_0x4caa8c['forwardOfflineAddress']){var _0x5b617c=_0x496112[_0x4122('0xf3')]();return respondWithRpcPromise(_0x4122('0xf4'),_0x4122('0xf5'),{'account':_0x5b617c,'message':{'from':util['format'](_0x4122('0xf6'),_0x496112[_0x4122('0x2e')],_0x496112[_0x4122('0xf7')]||_0x496112[_0x4122('0xf1')][_0x4122('0x63')]),'to':_0x4caa8c[_0x4122('0xf8')],'subject':_0x4caa8c[_0x4122('0xf9')],'html':_0x4f5f47[_0x4122('0x6d')],'attachments':_0x203510}},client9003)['then'](function(){return _0x4f5f47;})[_0x4122('0x20')](function(_0x952fe1){logger[_0x4122('0x1c')](_0x952fe1);});}})[_0x4122('0x15')](function(){if(_0x4caa8c&&_0x4caa8c[_0x4122('0xfa')]&&_0x4caa8c[_0x4122('0xfb')]){var _0x1037b0=[];if(_0x5911c6['length']){_0x1037b0=_0x5911c6[_0x4122('0x4a')](function(_0x43c964){return{'name':_0x43c964['originalname'],'basename':_0x43c964[_0x4122('0x7d')],'type':_0x43c964[_0x4122('0xe6')],'ChatOfflineMessageId':_0x4cafd4['id']};});}var _0x32b5ae;if(!_[_0x4122('0x8f')](_0x4caa8c[_0x4122('0xfc')])){var _0x4f0c78=_[_0x4122('0x4a')](_0x49570d['body'],function(_0x873052){return _0x873052;});var _0x4a2338=_[_0x4122('0xfd')](_0x4f0c78)[0x0];var _0x3638b8=_[_0x4122('0xfe')](_0x4a2338,function(_0x5315c8){return _0x5315c8;});_0x32b5ae=_0x3638b8[0x1][_0x4caa8c[_0x4122('0xfc')]];}var _0x287946={'from':_0x4a12a6['email'],'firstName':_0x4a12a6[_0x4122('0x38')],'lastName':_0x4a12a6[_0x4122('0x39')],'mapKey':_0x4122('0xf7'),'message':{'from':_0x4a12a6[_0x4122('0xf7')],'to':_0x4caa8c[_0x4122('0xdb')][_0x4122('0xf7')],'cc':'','subject':_[_0x4122('0x8f')](_0x32b5ae)?_0x4caa8c[_0x4122('0xf9')]:_0x32b5ae,'messageId':'','sentAt':new Date(),'attach':_0x1037b0['length'],'attachments':_0x1037b0,'originChannel':_0x4122('0xff'),'ChatWebsiteId':_0x4caa8c['id'],'ChatOfflineMessageId':_0x4f5f47['id'],'originTo':_0x4caa8c[_0x4122('0xdb')][_0x4122('0xf7')]},'body':_0x4f5f47[_0x4122('0x6d')]};var _0x3d2f91={'account':{'id':_0x4caa8c[_0x4122('0xfb')]},'body':_0x287946,'log':_0x4122('0x100')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x3d2f91,client9001)[_0x4122('0x15')](function(){return _0x4f5f47;})['catch'](function(_0x468460){logger['error'](_0x468460);});}return;})[_0x4122('0x15')](function(){if(_0x4f5f47){return _0x4f5f47;}})[_0x4122('0x15')](respondWithResult(_0x4bbde1,null))[_0x4122('0x20')](function(){for(var _0xc9a468 of _0x5911c6){var _0x4b94f4=path[_0x4122('0x85')](config['root'],_0x4122('0xe7'),_0x4122('0xd0'),_0x4122('0xe8'),'offline-chat',_0xc9a468[_0x4122('0x7d')]);fs_extra['remove'](_0x4b94f4)[_0x4122('0x20')](function(_0x16e1fd){logger[_0x4122('0x1c')]('Could\x20not\x20remove\x20attachment\x20file',_0x4b94f4,_0x16e1fd);});}});};exports[_0x4122('0x101')]=function(_0x370266,_0x589870){return db[_0x4122('0xb6')][_0x4122('0x65')]({'where':{'id':_0x370266['params']['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x589870,null))['then'](function(_0x5d5155){if(_0x5d5155){return _0x5d5155['addInteraction'](_0x370266[_0x4122('0x6d')][_0x4122('0x75')],_[_0x4122('0x102')](_0x370266[_0x4122('0x6d')],[_0x4122('0x75'),'id'])||{});}})[_0x4122('0x15')](respondWithResult(_0x589870,null))['catch'](handleError(_0x589870,null));};exports[_0x4122('0x103')]=function(_0x55ce4a,_0x39d1bc){var _0x224a86={'raw':![],'where':{}};var _0x409bad={};var _0x1bde17={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x55ce4a[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x39d1bc,null))['then'](function(_0x3c4d9a){if(_0x3c4d9a){_0x409bad[_0x4122('0x42')]=_[_0x4122('0x4c')](db['ChatInteraction'][_0x4122('0x5f')]);_0x409bad[_0x4122('0x4b')]=_['keys'](_0x55ce4a['query']);_0x409bad['filters']=_[_0x4122('0x4e')](_0x409bad[_0x4122('0x42')],_0x409bad[_0x4122('0x4b')]);_0x224a86[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0x409bad[_0x4122('0x42')],qs[_0x4122('0x50')](_0x55ce4a['query'][_0x4122('0x50')]));_0x224a86[_0x4122('0x4f')]=_0x224a86[_0x4122('0x4f')][_0x4122('0x51')]?_0x224a86[_0x4122('0x4f')]:_0x409bad[_0x4122('0x42')];if(!_0x55ce4a[_0x4122('0x4b')]['hasOwnProperty']('nolimit')){_0x224a86['limit']=qs['limit'](_0x55ce4a[_0x4122('0x4b')][_0x4122('0x24')]);_0x224a86[_0x4122('0x23')]=qs[_0x4122('0x23')](_0x55ce4a[_0x4122('0x4b')][_0x4122('0x23')]);}_0x224a86['order']=qs['sort'](_0x55ce4a['query'][_0x4122('0x54')]);_0x224a86[_0x4122('0x57')]=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x55ce4a['query'],_0x409bad['filters']));_0x224a86['where'][_0x4122('0x6e')]=_0x3c4d9a['id'];if(_0x55ce4a['query']['filter']){_0x224a86['where']=_[_0x4122('0x58')](_0x224a86[_0x4122('0x57')],{'$or':_['map'](_0x224a86[_0x4122('0x4f')],function(_0x989f7){var _0x2e9c92={};_0x2e9c92[_0x989f7]={'$like':'%'+_0x55ce4a[_0x4122('0x4b')][_0x4122('0x56')]+'%'};return _0x2e9c92;})});}_0x224a86=_[_0x4122('0x58')]({},_0x224a86,_0x55ce4a[_0x4122('0x5a')]);return db[_0x4122('0xb6')][_0x4122('0x25')]({'where':_0x224a86[_0x4122('0x57')]})['then'](function(_0x24102e){_0x1bde17['count']=_0x24102e;if(_0x55ce4a[_0x4122('0x4b')][_0x4122('0x73')]){_0x224a86['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4122('0xc3')],'as':_0x4122('0x104'),'attributes':['name',_0x4122('0x105'),_0x4122('0x106')],'required':![]},{'model':db[_0x4122('0x107')],'as':_0x4122('0x108'),'attributes':['id','name',_0x4122('0x109')],'where':_0x55ce4a['query'][_0x4122('0x10a')]?{'id':_0x55ce4a[_0x4122('0x4b')]['tag']}:undefined,'required':_0x55ce4a[_0x4122('0x4b')][_0x4122('0x10a')]?!![]:![]}];}return db[_0x4122('0xb6')]['findAll'](_0x224a86);})['then'](function(_0x297958){_0x1bde17['rows']=_0x297958;return _0x1bde17;});}})[_0x4122('0x15')](respondWithFilteredResult(_0x39d1bc,_0x224a86))['catch'](handleError(_0x39d1bc,null));};exports['getSnippet']=function(_0x15031a,_0x1579ad){var _0x430c5f=0x0;var _0xa3b6bb=0x0;var _0x4f108f=![];var _0x423f9c;var _0x1505f1;return db['ChatWebsite']['find']({'where':{'id':_0x15031a['params']['id']},'include':[{'model':db[_0x4122('0xa4')],'as':_0x4122('0xa4'),'include':[{'model':db[_0x4122('0xa4')],'as':'Intervals','attributes':['id',_0x4122('0xa6')]}]}]})[_0x4122('0x15')](handleEntityNotFound(_0x1579ad,null))[_0x4122('0x15')](function(_0x19837f){if(_0x19837f){_0x423f9c=_0x19837f;return _0x19837f[_0x4122('0x10b')]({'raw':!![]});}})[_0x4122('0x15')](function(_0x30eb51){if(_0x423f9c){if(_0x30eb51){_0x1505f1=_0x30eb51;}}return require(_0x4122('0x10c'))[_0x4122('0x87')]();})['then'](function(_0x3b0aee){if(_0x3b0aee){_0xa3b6bb=_0x3b0aee[_0x4122('0x10d')];_0x4f108f=_0x3b0aee[_0x4122('0x10e')];}})[_0x4122('0x15')](function(){return db[_0x4122('0xb6')][_0x4122('0x25')]({'where':{'closed':![]}});})[_0x4122('0x15')](function(_0x1dbb7a){_0x430c5f=_0x1dbb7a;if(_0xa3b6bb&&_0x1dbb7a>_0xa3b6bb){return db[_0x4122('0x10f')][_0x4122('0x70')]({'where':{'id':0x1}})[_0x4122('0x15')](function(_0x408182){if(_0x408182){_0x408182[_0x4122('0x110')]('chatLicenseExceeded');}});}})['then'](function(){var _0x9d9d73=_0x423f9c[_0x4122('0xa4')];var _0x3fe22e=_0x423f9c[_0x4122('0xa8')]||undefined;return _0x9d9d73?_0x9d9d73[_0x4122('0xa9')](_0x3fe22e):!![];})[_0x4122('0x15')](function(_0xb39b79){var _0x10fbbb=fs[_0x4122('0xde')](path[_0x4122('0x85')](config[_0x4122('0x86')],_0x4122('0x111')),_0x4122('0x112'));var _0x3da13c=new url['URL'](_0x423f9c['address'])[_0x4122('0x113')];var _0x315a59='3.8.1';var _0x31a4cc=![];var _0x2fe24f={'chatVersion':_0x315a59,'chatWebsiteAddressOrigin':_0x3da13c,'remote':_0x423f9c[_0x4122('0x114')],'query':querystring['stringify'](_[_0x4122('0x58')](_0x423f9c[_0x4122('0x2a')]({'plain':!![]}),{'customerIp':_0x15031a['headers'][_0x4122('0x35')]||_0x15031a[_0x4122('0x115')]['x-real-ip']||_0x15031a[_0x4122('0x116')][_0x4122('0x117')]||_0x15031a['ip'],'referer':_0x15031a['headers'][_0x4122('0x3b')],'openedInteractions':_0x430c5f,'maxInteractions':_0xa3b6bb,'virtual':_0x4f108f['virtual'],'online':_0xb39b79,'custom':_0x4f108f}))['replace'](/'/g,'\x5c\x27')};_0x1579ad[_0x4122('0xd7')](ejs[_0x4122('0xe0')](Mustache[_0x4122('0xe0')](_0x10fbbb,_0x2fe24f),{'proactiveActions':_0x1505f1,'alignment':_0x423f9c[_0x4122('0x118')],'verticalAlignment':_0x423f9c[_0x4122('0x119')],'div_color':_0x423f9c[_0x4122('0x109')],'labelText':_0x423f9c[_0x4122('0x11a')],'text_color':_0x423f9c[_0x4122('0x11b')],'text_button_color':_0x423f9c[_0x4122('0x11c')],'button_color':_0x423f9c['color_button'],'background_color':_0x423f9c[_0x4122('0x11d')],'hideWhenOffline':_0x423f9c[_0x4122('0x11e')],'intervalId':_0x423f9c[_0x4122('0x11f')],'isDevelopment':_0x31a4cc,'chatVersion':_0x315a59}));})['catch'](handleError(_0x1579ad,null));};exports[_0x4122('0x120')]=function(_0x18e1c6,_0x540a1d){var _0x1f2086=_0x18e1c6[_0x4122('0x5e')]['id'];var _0x2af064=_0x18e1c6[_0x4122('0x6d')];var _0x202c62=0xc8;var _0x57d164=null;return db[_0x4122('0xeb')][_0x4122('0xec')]({'isolationLevel':db[_0x4122('0xeb')][_0x4122('0x121')]['ISOLATION_LEVELS'][_0x4122('0x122')]},function(_0x4d6344){return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x1f2086},'transaction':_0x4d6344})[_0x4122('0x15')](function(_0x1c99e4){if(_0x1c99e4){return db[_0x4122('0xa2')][_0x4122('0x29')]({'where':{'ChatWebsiteId':_0x1f2086},'transaction':_0x4d6344})['then'](function(){var _0x4fe8b8=_[_0x4122('0x4a')](_0x2af064,function(_0x34760f){_0x34760f[_0x4122('0x6e')]=_0x1f2086;return _0x34760f;});return db[_0x4122('0xa2')]['bulkCreate'](_0x4fe8b8,{'transaction':_0x4d6344});});}else{_0x202c62=0x194;_0x57d164=[];}});})[_0x4122('0x15')](function(){if(_0x202c62!==0x194){return db[_0x4122('0xa2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1f2086},'order':'priority'})[_0x4122('0x15')](function(_0xd6ba5c){_0x57d164=_0xd6ba5c;});}})[_0x4122('0x20')](function(_0x41d402){_0x202c62=0x1f4;logger['error'](_0x41d402['stack']);if(_0x41d402['name']){delete _0x41d402['name'];}_0x57d164=_0x41d402;})[_0x4122('0x123')](function(){if(_0x57d164===null){_0x540a1d[_0x4122('0x2c')](_0x202c62);}else{if(_0x202c62===0x1f4){_0x540a1d['status'](_0x202c62)['send'](_0x57d164);}else{_0x540a1d[_0x4122('0x22')](_0x202c62)['json'](_0x57d164);}}});};exports[_0x4122('0x124')]=function(_0x5481d7,_0x2badbc){var _0x508af0={};var _0x8c8072={};var _0x534ed3;var _0x405fff;return db['ChatWebsite']['findOne']({'where':{'id':_0x5481d7[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x2badbc,null))[_0x4122('0x15')](function(_0x7a24e3){if(_0x7a24e3){_0x534ed3=_0x7a24e3;_0x8c8072[_0x4122('0x42')]=_[_0x4122('0x4c')](db[_0x4122('0xa2')]['rawAttributes']);_0x8c8072[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x5481d7['query']);_0x8c8072[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x8c8072['model'],_0x8c8072[_0x4122('0x4b')]);_0x508af0[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0x8c8072['model'],qs[_0x4122('0x50')](_0x5481d7['query'][_0x4122('0x50')]));_0x508af0[_0x4122('0x4f')]=_0x508af0['attributes'][_0x4122('0x51')]?_0x508af0[_0x4122('0x4f')]:_0x8c8072[_0x4122('0x42')];_0x508af0[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x5481d7['query'][_0x4122('0x54')]);_0x508af0['where']=qs['filters'](_['pick'](_0x5481d7[_0x4122('0x4b')],_0x8c8072['filters']));if(_0x5481d7[_0x4122('0x4b')]['filter']){_0x508af0[_0x4122('0x57')]=_[_0x4122('0x58')](_0x508af0[_0x4122('0x57')],{'$or':_[_0x4122('0x4a')](_0x508af0[_0x4122('0x4f')],function(_0x2bfd89){var _0x26f7b1={};_0x26f7b1[_0x2bfd89]={'$like':'%'+_0x5481d7['query'][_0x4122('0x56')]+'%'};return _0x26f7b1;})});}_0x508af0=_['merge']({},_0x508af0,_0x5481d7['options']);return _0x534ed3[_0x4122('0x124')](_0x508af0);}})[_0x4122('0x15')](function(_0x4d428c){if(_0x4d428c){_0x405fff=_0x4d428c[_0x4122('0x51')];if(!_0x5481d7[_0x4122('0x4b')][_0x4122('0x52')](_0x4122('0x72'))){_0x508af0[_0x4122('0x24')]=qs['limit'](_0x5481d7[_0x4122('0x4b')][_0x4122('0x24')]);_0x508af0[_0x4122('0x23')]=qs['offset'](_0x5481d7[_0x4122('0x4b')][_0x4122('0x23')]);}return _0x534ed3[_0x4122('0x124')](_0x508af0);}})['then'](function(_0x2684bd){if(_0x2684bd){return _0x2684bd?{'count':_0x405fff,'rows':_0x2684bd}:null;}})[_0x4122('0x15')](respondWithResult(_0x2badbc,null))['catch'](handleError(_0x2badbc,null));};exports['addProactiveActions']=function(_0x1a03c2,_0x260b3b){return db[_0x4122('0x125')][_0x4122('0x65')]({'where':{'id':_0x1a03c2[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x260b3b,null))[_0x4122('0x15')](function(_0x2d2f31){if(_0x2d2f31){return _0x2d2f31[_0x4122('0x126')](_0x1a03c2['body'][_0x4122('0x75')],_['omit'](_0x1a03c2[_0x4122('0x6d')],[_0x4122('0x75'),'id'])||{});}})[_0x4122('0x15')](respondWithResult(_0x260b3b,null))[_0x4122('0x20')](handleError(_0x260b3b,null));};exports[_0x4122('0x10b')]=function(_0x3c1256,_0x1b8840){var _0x52adcc={};var _0x49875f={};var _0x59cf79;var _0x15826a;return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x3c1256[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x1b8840,null))['then'](function(_0x1df890){if(_0x1df890){_0x59cf79=_0x1df890;_0x49875f[_0x4122('0x42')]=_['keys'](db[_0x4122('0x127')][_0x4122('0x5f')]);_0x49875f[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x3c1256[_0x4122('0x4b')]);_0x49875f[_0x4122('0x4d')]=_['intersection'](_0x49875f[_0x4122('0x42')],_0x49875f[_0x4122('0x4b')]);_0x52adcc[_0x4122('0x4f')]=_[_0x4122('0x4e')](_0x49875f[_0x4122('0x42')],qs['fields'](_0x3c1256[_0x4122('0x4b')][_0x4122('0x50')]));_0x52adcc['attributes']=_0x52adcc[_0x4122('0x4f')][_0x4122('0x51')]?_0x52adcc['attributes']:_0x49875f[_0x4122('0x42')];_0x52adcc[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x3c1256['query'][_0x4122('0x54')]);_0x52adcc[_0x4122('0x57')]=qs[_0x4122('0x4d')](_['pick'](_0x3c1256[_0x4122('0x4b')],_0x49875f[_0x4122('0x4d')]));if(_0x3c1256[_0x4122('0x4b')][_0x4122('0x56')]){_0x52adcc['where']=_[_0x4122('0x58')](_0x52adcc[_0x4122('0x57')],{'$or':_['map'](_0x52adcc[_0x4122('0x4f')],function(_0x564a9b){var _0x2c2522={};_0x2c2522[_0x564a9b]={'$like':'%'+_0x3c1256[_0x4122('0x4b')][_0x4122('0x56')]+'%'};return _0x2c2522;})});}_0x52adcc=_[_0x4122('0x58')]({},_0x52adcc,_0x3c1256[_0x4122('0x5a')]);return _0x59cf79[_0x4122('0x10b')](_0x52adcc);}})[_0x4122('0x15')](function(_0x26fed7){if(_0x26fed7){_0x15826a=_0x26fed7['length'];if(!_0x3c1256[_0x4122('0x4b')][_0x4122('0x52')](_0x4122('0x72'))){_0x52adcc[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x3c1256[_0x4122('0x4b')][_0x4122('0x24')]);_0x52adcc[_0x4122('0x23')]=qs['offset'](_0x3c1256[_0x4122('0x4b')][_0x4122('0x23')]);}return _0x59cf79[_0x4122('0x10b')](_0x52adcc);}})[_0x4122('0x15')](function(_0x1a9d51){if(_0x1a9d51){return _0x1a9d51?{'count':_0x15826a,'rows':_0x1a9d51}:null;}})[_0x4122('0x15')](respondWithResult(_0x1b8840,null))[_0x4122('0x20')](handleError(_0x1b8840,null));};exports[_0x4122('0x128')]=function(_0xbd985d,_0x311464){var _0x1d4714=_0xbd985d['query']['online']==='false'?_0x4122('0x129'):'onlineForm';return db['ChatWebsite'][_0x4122('0x65')]({'attributes':['id',_0x1d4714],'where':{'id':_0xbd985d[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x311464,null))[_0x4122('0x15')](function(_0x1f01a3){if(_0x1f01a3){var _0x4ecbf5=_0x1f01a3[_0x1d4714];var _0x19f6c2=_0x4ecbf5&&_0x4ecbf5[_0x4122('0x12a')]?_0x4ecbf5['items']:[];_0x311464[_0x4122('0xd7')]({'fromKey':_[_0x4122('0x8f')](_0x4ecbf5['fromKey'])?undefined:_0x4ecbf5[_0x4122('0x12b')],'count':_0x19f6c2[_0x4122('0x51')],'rows':_0x19f6c2});}})[_0x4122('0x20')](handleError(_0x311464,null));};exports[_0x4122('0x12c')]=function(_0x19214c,_0x46f8a2){var _0x3fc21c={'raw':![],'where':{}};var _0x4f2c96={};var _0x32b626={'count':0x0,'rows':[]};return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x19214c[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x46f8a2,null))['then'](function(_0x4c6cca){if(_0x4c6cca){_0x4f2c96[_0x4122('0x42')]=_[_0x4122('0x4c')](db[_0x4122('0xe3')][_0x4122('0x5f')]);_0x4f2c96[_0x4122('0x4b')]=_[_0x4122('0x4c')](_0x19214c[_0x4122('0x4b')]);_0x4f2c96[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x4f2c96[_0x4122('0x42')],_0x4f2c96['query']);_0x3fc21c['attributes']=_[_0x4122('0x4e')](_0x4f2c96[_0x4122('0x42')],qs[_0x4122('0x50')](_0x19214c['query']['fields']));_0x3fc21c[_0x4122('0x4f')]=_0x3fc21c[_0x4122('0x4f')][_0x4122('0x51')]?_0x3fc21c[_0x4122('0x4f')]:_0x4f2c96['model'];if(!_0x19214c[_0x4122('0x4b')][_0x4122('0x52')](_0x4122('0x72'))){_0x3fc21c[_0x4122('0x24')]=qs[_0x4122('0x24')](_0x19214c[_0x4122('0x4b')]['limit']);_0x3fc21c['offset']=qs[_0x4122('0x23')](_0x19214c[_0x4122('0x4b')][_0x4122('0x23')]);}_0x3fc21c[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x19214c[_0x4122('0x4b')][_0x4122('0x54')]);_0x3fc21c['where']=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x19214c[_0x4122('0x4b')],_0x4f2c96['filters']));_0x3fc21c[_0x4122('0x57')][_0x4122('0x6e')]=_0x4c6cca['id'];if(_0x19214c[_0x4122('0x4b')]['filter']){_0x3fc21c[_0x4122('0x57')]=_[_0x4122('0x58')](_0x3fc21c[_0x4122('0x57')],{'$or':_[_0x4122('0x4a')](_0x3fc21c[_0x4122('0x4f')],function(_0x27441d){var _0x2d8d35={};_0x2d8d35[_0x27441d]={'$like':'%'+_0x19214c[_0x4122('0x4b')]['filter']+'%'};return _0x2d8d35;})});}_0x3fc21c=_[_0x4122('0x58')]({},_0x3fc21c,_0x19214c[_0x4122('0x5a')]);return db['ChatOfflineMessage'][_0x4122('0x25')]({'where':_0x3fc21c[_0x4122('0x57')]})[_0x4122('0x15')](function(_0xd7fdde){_0x32b626[_0x4122('0x25')]=_0xd7fdde;if(_0x19214c[_0x4122('0x4b')]['includeAll']){_0x3fc21c[_0x4122('0x5b')]=[{'all':!![]}];}else{_0x3fc21c[_0x4122('0x5b')]=[{'model':db[_0x4122('0xa0')],'as':_0x4122('0x12d'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x4122('0xe3')]['findAll'](_0x3fc21c);})[_0x4122('0x15')](function(_0x1c23e8){_0x32b626[_0x4122('0x79')]=_0x1c23e8;return _0x32b626;});}})[_0x4122('0x15')](respondWithFilteredResult(_0x46f8a2,_0x3fc21c))[_0x4122('0x20')](handleError(_0x46f8a2,null));};exports[_0x4122('0x12e')]=function(_0x281bd1,_0x5e55e2){return db[_0x4122('0x47')][_0x4122('0x65')]({'where':{'id':_0x281bd1[_0x4122('0x5e')]['id']}})[_0x4122('0x15')](handleEntityNotFound(_0x5e55e2,null))[_0x4122('0x15')](function(_0xa2300c){if(_0xa2300c){return _0xa2300c[_0x4122('0x12e')](_0x281bd1['body'][_0x4122('0x75')],_[_0x4122('0x102')](_0x281bd1[_0x4122('0x6d')],['ids','id'])||{})[_0x4122('0xdd')](function(_0x49b039){for(var _0x107443=0x0;_0x107443<_0x281bd1['body'][_0x4122('0x75')][_0x4122('0x51')];_0x107443+=0x1){socket[_0x4122('0x12f')](_0x4122('0x130'),{'UserId':Number(_0x281bd1[_0x4122('0x6d')]['ids'][_0x107443]),'ChatWebsiteId':Number(_0x281bd1[_0x4122('0x5e')]['id'])});}return _0x49b039;});}})[_0x4122('0x15')](respondWithResult(_0x5e55e2,null))[_0x4122('0x20')](handleError(_0x5e55e2,null));};exports[_0x4122('0x131')]=function(_0x4485b4,_0x219331){return db['ChatWebsite']['find']({'where':{'id':_0x4485b4[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x219331,null))[_0x4122('0x15')](function(_0x437970){if(_0x437970){return _0x437970[_0x4122('0x131')](_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')])[_0x4122('0x15')](function(){if(_[_0x4122('0x132')](_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')])){for(var _0x326c20=0x0;_0x326c20<_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')]['length'];_0x326c20+=0x1){socket[_0x4122('0x12f')](_0x4122('0x133'),{'UserId':Number(_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')][_0x326c20]),'ChatWebsiteId':Number(_0x4485b4[_0x4122('0x5e')]['id'])});}}else{socket['emit'](_0x4122('0x133'),{'UserId':Number(_0x4485b4[_0x4122('0x4b')][_0x4122('0x75')]),'ChatWebsiteId':Number(_0x4485b4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x219331,null))[_0x4122('0x20')](handleError(_0x219331,null));};exports[_0x4122('0x134')]=function(_0x13fad9,_0x1d666e){var _0x58fe14={};var _0x1eed2e={};var _0x29b38e;var _0x33225f;return db[_0x4122('0x47')][_0x4122('0x70')]({'where':{'id':_0x13fad9[_0x4122('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1d666e,null))[_0x4122('0x15')](function(_0x3c3bc6){if(_0x3c3bc6){_0x29b38e=_0x3c3bc6;_0x1eed2e[_0x4122('0x42')]=_[_0x4122('0x4c')](db[_0x4122('0xc3')][_0x4122('0x5f')]);_0x1eed2e[_0x4122('0x4b')]=_['keys'](_0x13fad9[_0x4122('0x4b')]);_0x1eed2e[_0x4122('0x4d')]=_[_0x4122('0x4e')](_0x1eed2e[_0x4122('0x42')],_0x1eed2e[_0x4122('0x4b')]);_0x58fe14[_0x4122('0x4f')]=_['intersection'](_0x1eed2e[_0x4122('0x42')],qs[_0x4122('0x50')](_0x13fad9[_0x4122('0x4b')][_0x4122('0x50')]));_0x58fe14[_0x4122('0x4f')]=_0x58fe14[_0x4122('0x4f')][_0x4122('0x51')]?_0x58fe14['attributes']:_0x1eed2e[_0x4122('0x42')];_0x58fe14[_0x4122('0x53')]=qs[_0x4122('0x54')](_0x13fad9['query'][_0x4122('0x54')]);_0x58fe14['where']=qs[_0x4122('0x4d')](_[_0x4122('0x55')](_0x13fad9[_0x4122('0x4b')],_0x1eed2e[_0x4122('0x4d')]));if(_0x13fad9[_0x4122('0x4b')][_0x4122('0x56')]){_0x58fe14[_0x4122('0x57')]=_['merge'](_0x58fe14[_0x4122('0x57')],{'$or':_[_0x4122('0x4a')](_0x58fe14['attributes'],function(_0x1688eb){var _0x2d6c25={};_0x2d6c25[_0x1688eb]={'$like':'%'+_0x13fad9[_0x4122('0x4b')][_0x4122('0x56')]+'%'};return _0x2d6c25;})});}_0x58fe14=_[_0x4122('0x58')]({},_0x58fe14,_0x13fad9['options']);return _0x29b38e[_0x4122('0x134')](_0x58fe14);}})[_0x4122('0x15')](function(_0x2f8e72){if(_0x2f8e72){_0x33225f=_0x2f8e72[_0x4122('0x51')];if(!_0x13fad9[_0x4122('0x4b')][_0x4122('0x52')](_0x4122('0x72'))){_0x58fe14['limit']=qs[_0x4122('0x24')](_0x13fad9[_0x4122('0x4b')][_0x4122('0x24')]);_0x58fe14[_0x4122('0x23')]=qs[_0x4122('0x23')](_0x13fad9[_0x4122('0x4b')][_0x4122('0x23')]);}return _0x29b38e[_0x4122('0x134')](_0x58fe14);}})['then'](function(_0x30e0b0){if(_0x30e0b0){return _0x30e0b0?{'count':_0x33225f,'rows':_0x30e0b0}:null;}})[_0x4122('0x15')](respondWithResult(_0x1d666e,null))['catch'](handleError(_0x1d666e,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 9ab3906..5404aa0 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 _0x50a6=['hasOwnProperty','hook','exports','events','../../mysqldb','save','remove'];(function(_0x593351,_0x23c222){var _0x3bb878=function(_0x5cf063){while(--_0x5cf063){_0x593351['push'](_0x593351['shift']());}};_0x3bb878(++_0x23c222);}(_0x50a6,0xa4));var _0x650a=function(_0x131eb1,_0x55b270){_0x131eb1=_0x131eb1-0x0;var _0x3a3b7a=_0x50a6[_0x131eb1];return _0x3a3b7a;};'use strict';var EventEmitter=require(_0x650a('0x0'));var ChatWebsite=require(_0x650a('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x650a('0x2'),'afterUpdate':'update','afterDestroy':_0x650a('0x3')};function emitEvent(_0x15dd02){return function(_0x2c71ba,_0x4a0147,_0xa3311){ChatWebsiteEvents['emit'](_0x15dd02+':'+_0x2c71ba['id'],_0x2c71ba);ChatWebsiteEvents['emit'](_0x15dd02,_0x2c71ba);_0xa3311(null);};}for(var e in events){if(events[_0x650a('0x4')](e)){var event=events[e];ChatWebsite[_0x650a('0x5')](e,emitEvent(event));}}module[_0x650a('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x6c96=['exports','events','ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c96,0x1c1));var _0x66c9=function(_0x5ab2e6,_0x150c3a){_0x5ab2e6=_0x5ab2e6-0x0;var _0x329b44=_0x6c96[_0x5ab2e6];return _0x329b44;};'use strict';var EventEmitter=require(_0x66c9('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x66c9('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x66c9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x66c9('0x3'),'afterDestroy':_0x66c9('0x4')};function emitEvent(_0x3c2e67){return function(_0x37e814,_0x35b830,_0x15aaa6){ChatWebsiteEvents[_0x66c9('0x5')](_0x3c2e67+':'+_0x37e814['id'],_0x37e814);ChatWebsiteEvents['emit'](_0x3c2e67,_0x37e814);_0x15aaa6(null);};}for(var e in events){if(events[_0x66c9('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x66c9('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 802ad08..d83f80b 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 _0x091e=['./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x48f1f2,_0x108484){var _0x3737e8=function(_0x1fb48e){while(--_0x1fb48e){_0x48f1f2['push'](_0x48f1f2['shift']());}};_0x3737e8(++_0x108484);}(_0x091e,0x190));var _0xe091=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x091e[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xe091('0x0'));var util=require(_0xe091('0x1'));var logger=require(_0xe091('0x2'))(_0xe091('0x3'));var moment=require(_0xe091('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe091('0x5'));var config=require(_0xe091('0x6'));var attributes=require(_0xe091('0x7'));module[_0xe091('0x8')]=function(_0x4f18e1,_0x23fbd3){return _0x4f18e1['define'](_0xe091('0x9'),attributes,{'tableName':_0xe091('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf668=['util','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf668,0x1b7));var _0x8f66=function(_0x4f73f5,_0x13bb5e){_0x4f73f5=_0x4f73f5-0x0;var _0x5f3974=_0xf668[_0x4f73f5];return _0x5f3974;};'use strict';var _=require(_0x8f66('0x0'));var util=require(_0x8f66('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8f66('0x2'));var rp=require(_0x8f66('0x3'));var fs=require('fs');var path=require(_0x8f66('0x4'));var rimraf=require('rimraf');var config=require(_0x8f66('0x5'));var attributes=require(_0x8f66('0x6'));module[_0x8f66('0x7')]=function(_0x5053cf,_0x332073){return _0x5053cf[_0x8f66('0x8')](_0x8f66('0x9'),attributes,{'tableName':_0x8f66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index a78d4e2..2980b7b 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 _0xf6fc=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then'];(function(_0x47cc86,_0x2b31cf){var _0x27f733=function(_0x2bdeaf){while(--_0x2bdeaf){_0x47cc86['push'](_0x47cc86['shift']());}};_0x27f733(++_0x2b31cf);}(_0xf6fc,0x10f));var _0xcf6f=function(_0x587e16,_0x434bb2){_0x587e16=_0x587e16-0x0;var _0x18d56c=_0xf6fc[_0x587e16];return _0x18d56c;};'use strict';var _=require(_0xcf6f('0x0'));var util=require(_0xcf6f('0x1'));var moment=require(_0xcf6f('0x2'));var BPromise=require(_0xcf6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcf6f('0x4'));var logger=require('../../config/logger')(_0xcf6f('0x5'));var config=require(_0xcf6f('0x6'));var jayson=require(_0xcf6f('0x7'));var client=jayson['client'][_0xcf6f('0x8')]({'port':0x232a});config['redis']=_[_0xcf6f('0x9')](config[_0xcf6f('0xa')],{'host':_0xcf6f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf6f('0xa')]));require('./chatWebsite.socket')[_0xcf6f('0xc')](socket);function respondWithRpcPromise(_0x1f892c,_0x54216a,_0x504195){return new BPromise(function(_0x4de57e,_0x58a194){return client[_0xcf6f('0xd')](_0x1f892c,_0x504195)[_0xcf6f('0xe')](function(_0x3d3e87){logger[_0xcf6f('0xf')](_0xcf6f('0x10'),_0x54216a,_0xcf6f('0x11'));logger[_0xcf6f('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x54216a,_0xcf6f('0x11'),JSON['stringify'](_0x3d3e87));if(_0x3d3e87[_0xcf6f('0x13')]){if(_0x3d3e87[_0xcf6f('0x13')]['code']===0x1f4){logger[_0xcf6f('0x13')](_0xcf6f('0x10'),_0x54216a,_0x3d3e87[_0xcf6f('0x13')][_0xcf6f('0x14')]);return _0x58a194(_0x3d3e87['error'][_0xcf6f('0x14')]);}logger[_0xcf6f('0x13')](_0xcf6f('0x10'),_0x54216a,_0x3d3e87[_0xcf6f('0x13')][_0xcf6f('0x14')]);return _0x4de57e(_0x3d3e87['error']['message']);}else{logger[_0xcf6f('0xf')](_0xcf6f('0x10'),_0x54216a,_0xcf6f('0x11'));_0x4de57e(_0x3d3e87[_0xcf6f('0x15')][_0xcf6f('0x14')]);}})['catch'](function(_0x54edaa){logger['error'](_0xcf6f('0x10'),_0x54216a,_0x54edaa);_0x58a194(_0x54edaa);});});}
\ No newline at end of file
+var _0x24c6=['then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatWebsite.socket','register','request'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x24c6,0xa6));var _0x624c=function(_0x159259,_0x5d97a8){_0x159259=_0x159259-0x0;var _0x5e01cd=_0x24c6[_0x159259];return _0x5e01cd;};'use strict';var _=require(_0x624c('0x0'));var util=require(_0x624c('0x1'));var moment=require(_0x624c('0x2'));var BPromise=require(_0x624c('0x3'));var rs=require(_0x624c('0x4'));var fs=require('fs');var Redis=require(_0x624c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x624c('0x6'))(_0x624c('0x7'));var config=require(_0x624c('0x8'));var jayson=require(_0x624c('0x9'));var client=jayson[_0x624c('0xa')][_0x624c('0xb')]({'port':0x232a});config[_0x624c('0xc')]=_['defaults'](config[_0x624c('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x624c('0xc')]));require(_0x624c('0xd'))[_0x624c('0xe')](socket);function respondWithRpcPromise(_0x28b2c2,_0x4b7206,_0x14e6bb){return new BPromise(function(_0x34f426,_0x31b5bc){return client[_0x624c('0xf')](_0x28b2c2,_0x14e6bb)[_0x624c('0x10')](function(_0x150022){logger[_0x624c('0x11')](_0x624c('0x12'),_0x4b7206,'request\x20sent');logger[_0x624c('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4b7206,_0x624c('0x14'),JSON[_0x624c('0x15')](_0x150022));if(_0x150022[_0x624c('0x16')]){if(_0x150022[_0x624c('0x16')][_0x624c('0x17')]===0x1f4){logger['error'](_0x624c('0x12'),_0x4b7206,_0x150022['error'][_0x624c('0x18')]);return _0x31b5bc(_0x150022[_0x624c('0x16')][_0x624c('0x18')]);}logger[_0x624c('0x16')](_0x624c('0x12'),_0x4b7206,_0x150022[_0x624c('0x16')]['message']);return _0x34f426(_0x150022[_0x624c('0x16')][_0x624c('0x18')]);}else{logger[_0x624c('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4b7206,_0x624c('0x14'));_0x34f426(_0x150022['result'][_0x624c('0x18')]);}})[_0x624c('0x19')](function(_0x545018){logger['error'](_0x624c('0x12'),_0x4b7206,_0x545018);_0x31b5bc(_0x545018);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 79a57ee..3f6d405 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 _0x8280=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x2dfe1c,_0x52165a){var _0x251ca2=function(_0x5ba9ec){while(--_0x5ba9ec){_0x2dfe1c['push'](_0x2dfe1c['shift']());}};_0x251ca2(++_0x52165a);}(_0x8280,0x1ea));var _0x0828=function(_0x988118,_0x34b743){_0x988118=_0x988118-0x0;var _0x48d871=_0x8280[_0x988118];return _0x48d871;};'use strict';var ChatWebsiteEvents=require(_0x0828('0x0'));var events=[_0x0828('0x1'),_0x0828('0x2'),_0x0828('0x3')];function createListener(_0x3410c6,_0x3a1547){return function(_0x5833ac){_0x3a1547[_0x0828('0x4')](_0x3410c6,_0x5833ac);};}function removeListener(_0x2fe2b4,_0x54b723){return function(){ChatWebsiteEvents[_0x0828('0x5')](_0x2fe2b4,_0x54b723);};}exports[_0x0828('0x6')]=function(_0x25e8b3){for(var _0x1931e1=0x0,_0x3b3fb1=events[_0x0828('0x7')];_0x1931e1<_0x3b3fb1;_0x1931e1++){var _0x42a993=events[_0x1931e1];var _0x4bd730=createListener(_0x0828('0x8')+_0x42a993,_0x25e8b3);ChatWebsiteEvents['on'](_0x42a993,_0x4bd730);}};
\ No newline at end of file
+var _0x0ff2=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x17ead7,_0x2e8a8a){var _0x44990d=function(_0x52214e){while(--_0x52214e){_0x17ead7['push'](_0x17ead7['shift']());}};_0x44990d(++_0x2e8a8a);}(_0x0ff2,0x137));var _0x20ff=function(_0x27d30a,_0x52eb35){_0x27d30a=_0x27d30a-0x0;var _0x3ee370=_0x0ff2[_0x27d30a];return _0x3ee370;};'use strict';var ChatWebsiteEvents=require(_0x20ff('0x0'));var events=['save',_0x20ff('0x1'),_0x20ff('0x2')];function createListener(_0x36df08,_0x5be3b3){return function(_0x33d52b){_0x5be3b3[_0x20ff('0x3')](_0x36df08,_0x33d52b);};}function removeListener(_0x2321ea,_0x1a0a17){return function(){ChatWebsiteEvents[_0x20ff('0x4')](_0x2321ea,_0x1a0a17);};}exports[_0x20ff('0x5')]=function(_0x450e3e){for(var _0x12346c=0x0,_0x17adaa=events[_0x20ff('0x6')];_0x12346c<_0x17adaa;_0x12346c++){var _0xb1fc09=events[_0x12346c];var _0x42edb6=createListener(_0x20ff('0x7')+_0xb1fc09,_0x450e3e);ChatWebsiteEvents['on'](_0xb1fc09,_0x42edb6);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index dac0fcc..9820ddc 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 _0xceda=['offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','update','destroy','removeDispositions','delete','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','addLogo','addAvatar','server/files/images/avatars/','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any'];(function(_0x2357c5,_0x39950d){var _0x5bd44c=function(_0x138cb1){while(--_0x138cb1){_0x2357c5['push'](_0x2357c5['shift']());}};_0x5bd44c(++_0x39950d);}(_0xceda,0x1b5));var _0xaced=function(_0x4670cf,_0xc8d12b){_0x4670cf=_0x4670cf-0x0;var _0x234fe9=_0xceda[_0x4670cf];return _0x234fe9;};'use strict';var multer=require(_0xaced('0x0'));var util=require('util');var path=require(_0xaced('0x1'));var timeout=require(_0xaced('0x2'));var express=require(_0xaced('0x3'));var router=express[_0xaced('0x4')]();var fs_extra=require(_0xaced('0x5'));var auth=require(_0xaced('0x6'));var interaction=require(_0xaced('0x7'));var config=require('../../config/environment');var controller=require(_0xaced('0x8'));router[_0xaced('0x9')]('/',auth[_0xaced('0xa')](),controller[_0xaced('0xb')]);router[_0xaced('0x9')]('/describe',auth[_0xaced('0xa')](),controller['describe']);router[_0xaced('0x9')](_0xaced('0xc'),auth[_0xaced('0xa')](),controller[_0xaced('0xd')]);router['get']('/:id/dispositions',auth[_0xaced('0xa')](),controller[_0xaced('0xe')]);router['get'](_0xaced('0xf'),auth[_0xaced('0xa')](),controller[_0xaced('0x10')]);router['get']('/:id/logo',controller[_0xaced('0x11')]);router['get'](_0xaced('0x12'),controller[_0xaced('0x13')]);router['get'](_0xaced('0x14'),controller['getCustomerAvatar']);router[_0xaced('0x9')](_0xaced('0x15'),controller['getSystemAvatar']);router[_0xaced('0x9')](_0xaced('0x16'),auth[_0xaced('0xa')](),controller['getInteractions']);router['get'](_0xaced('0x17'),controller['getSnippet']);router[_0xaced('0x9')](_0xaced('0x18'),auth['isAuthenticated'](),controller[_0xaced('0x19')]);router[_0xaced('0x9')]('/:id/proactive_actions',auth[_0xaced('0xa')](),controller[_0xaced('0x1a')]);router['get'](_0xaced('0x1b'),controller[_0xaced('0x1c')]);router[_0xaced('0x9')](_0xaced('0x1d'),auth[_0xaced('0xa')](),controller[_0xaced('0x1e')]);router[_0xaced('0x9')](_0xaced('0x1f'),auth[_0xaced('0xa')](),controller[_0xaced('0x20')]);router[_0xaced('0x21')]('/',auth[_0xaced('0xa')](),controller[_0xaced('0x22')]);router[_0xaced('0x21')](_0xaced('0x23'),auth['isAuthenticated'](),controller[_0xaced('0x24')]);router['post'](_0xaced('0xf'),auth[_0xaced('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xaced('0x25')]({'destination':function(_0x58e045,_0x5aba11,_0x4bf55f){_0x4bf55f(null,path[_0xaced('0x26')](config[_0xaced('0x27')],_0xaced('0x28')));},'filename':function(_0x908a37,_0x2c94cf,_0x9ccca4){_0x9ccca4(null,util[_0xaced('0x29')](_0xaced('0x2a'),Date[_0xaced('0x2b')](),_0x2c94cf[_0xaced('0x2c')]));}})});router[_0xaced('0x21')](_0xaced('0x2d'),upload[_0xaced('0x2e')](_0xaced('0x2f')),controller[_0xaced('0x30')]);var upload=multer({'storage':multer[_0xaced('0x25')]({'destination':function(_0x43669a,_0x4ada3e,_0x128b57){_0x128b57(null,path[_0xaced('0x26')](config[_0xaced('0x27')],'server/files/images/avatars/'));},'filename':function(_0x188650,_0x154077,_0x51bd7b){_0x51bd7b(null,util[_0xaced('0x29')]('%s-%s',Date[_0xaced('0x2b')](),_0x154077[_0xaced('0x2c')]));}})});router[_0xaced('0x21')](_0xaced('0x12'),upload[_0xaced('0x2e')](_0xaced('0x2f')),controller[_0xaced('0x31')]);var upload=multer({'storage':multer[_0xaced('0x25')]({'destination':function(_0x1108a1,_0x3a437c,_0x5cb14a){_0x5cb14a(null,path['join'](config[_0xaced('0x27')],_0xaced('0x32')));},'filename':function(_0x4ab4e7,_0x92d7ec,_0x2847cb){_0x2847cb(null,util[_0xaced('0x29')]('%s-%s',Date['now'](),_0x92d7ec[_0xaced('0x2c')]));}})});router[_0xaced('0x21')](_0xaced('0x14'),upload[_0xaced('0x2e')](_0xaced('0x2f')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xaced('0x25')]({'destination':function(_0x4a2633,_0x7bcbb4,_0x539a92){_0x539a92(null,path[_0xaced('0x26')](config[_0xaced('0x27')],_0xaced('0x32')));},'filename':function(_0x4ccf61,_0x3dfe3d,_0x58ef31){_0x58ef31(null,util[_0xaced('0x29')]('%s-%s',Date[_0xaced('0x2b')](),_0x3dfe3d[_0xaced('0x2c')]));}})});router[_0xaced('0x21')]('/:id/system_avatar',upload['single'](_0xaced('0x2f')),controller['addSystemAvatar']);router[_0xaced('0x21')](_0xaced('0x33'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xaced('0x25')]({'destination':function(_0x238e36,_0x16e05c,_0x5d5304){const _0x540adc=path[_0xaced('0x26')](config['root'],_0xaced('0x34'),_0xaced('0x35'),_0xaced('0x36'));fs_extra[_0xaced('0x37')](_0x540adc,function(){_0x5d5304(null,_0x540adc);});},'filename':function(_0x450975,_0x54ab77,_0x3dfa98){const _0x5d086a=_0x54ab77[_0xaced('0x2c')][_0xaced('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x26306c=path[_0xaced('0x39')](_0x5d086a);const _0x3184d2=Date['now']()+'-'+_0x5d086a[_0xaced('0x38')](_0x26306c,'')+_0x26306c;_0x3dfa98(null,_0x3184d2);}})});router[_0xaced('0x21')](_0xaced('0x3a'),offlineUploadMulter[_0xaced('0x3b')](),controller[_0xaced('0x3c')]);router['post'](_0xaced('0x16'),auth[_0xaced('0xa')](),controller[_0xaced('0x3d')]);router[_0xaced('0x21')](_0xaced('0x18'),auth[_0xaced('0xa')](),controller[_0xaced('0x3e')]);router[_0xaced('0x21')](_0xaced('0x3f'),auth[_0xaced('0xa')](),controller[_0xaced('0x40')]);router['post']('/:id/users',auth[_0xaced('0xa')](),controller[_0xaced('0x41')]);router['put']('/:id',auth[_0xaced('0xa')](),controller[_0xaced('0x42')]);router['delete'](_0xaced('0xc'),auth[_0xaced('0xa')](),controller[_0xaced('0x43')]);router['delete'](_0xaced('0x23'),auth[_0xaced('0xa')](),controller[_0xaced('0x44')]);router[_0xaced('0x45')](_0xaced('0xf'),auth['isAuthenticated'](),controller[_0xaced('0x46')]);router[_0xaced('0x45')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xab0f=['update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','create','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','single','server/files/images/avatars/','originalname','file','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','any','offline','addApplications','/:id/users','addAgents'];(function(_0x4ec945,_0xe9fb7f){var _0x4eb0be=function(_0x4738a9){while(--_0x4738a9){_0x4ec945['push'](_0x4ec945['shift']());}};_0x4eb0be(++_0xe9fb7f);}(_0xab0f,0x118));var _0xfab0=function(_0x3e7346,_0x4f4f45){_0x3e7346=_0x3e7346-0x0;var _0x16bec5=_0xab0f[_0x3e7346];return _0x16bec5;};'use strict';var multer=require(_0xfab0('0x0'));var util=require(_0xfab0('0x1'));var path=require('path');var timeout=require(_0xfab0('0x2'));var express=require('express');var router=express[_0xfab0('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfab0('0x4'));var config=require('../../config/environment');var controller=require(_0xfab0('0x5'));router[_0xfab0('0x6')]('/',auth[_0xfab0('0x7')](),controller[_0xfab0('0x8')]);router[_0xfab0('0x6')](_0xfab0('0x9'),auth['isAuthenticated'](),controller[_0xfab0('0xa')]);router[_0xfab0('0x6')](_0xfab0('0xb'),auth[_0xfab0('0x7')](),controller['show']);router[_0xfab0('0x6')]('/:id/dispositions',auth[_0xfab0('0x7')](),controller[_0xfab0('0xc')]);router[_0xfab0('0x6')](_0xfab0('0xd'),auth[_0xfab0('0x7')](),controller[_0xfab0('0xe')]);router['get']('/:id/logo',controller[_0xfab0('0xf')]);router[_0xfab0('0x6')](_0xfab0('0x10'),controller[_0xfab0('0x11')]);router[_0xfab0('0x6')]('/:id/customer_avatar',controller[_0xfab0('0x12')]);router['get'](_0xfab0('0x13'),controller[_0xfab0('0x14')]);router[_0xfab0('0x6')](_0xfab0('0x15'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x16')]);router['get'](_0xfab0('0x17'),controller['getSnippet']);router[_0xfab0('0x6')](_0xfab0('0x18'),auth['isAuthenticated'](),controller[_0xfab0('0x19')]);router['get'](_0xfab0('0x1a'),auth['isAuthenticated'](),controller[_0xfab0('0x1b')]);router[_0xfab0('0x6')](_0xfab0('0x1c'),controller['getFields']);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xfab0('0x1d')]);router['get']('/:id/users',auth[_0xfab0('0x7')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xfab0('0x1e')]);router[_0xfab0('0x1f')]('/:id/dispositions',auth[_0xfab0('0x7')](),controller['addDisposition']);router[_0xfab0('0x1f')]('/:id/canned_answers',auth[_0xfab0('0x7')](),controller[_0xfab0('0x20')]);var upload=multer({'storage':multer[_0xfab0('0x21')]({'destination':function(_0xe85233,_0x49dae8,_0x21b330){_0x21b330(null,path[_0xfab0('0x22')](config[_0xfab0('0x23')],_0xfab0('0x24')));},'filename':function(_0x2744cc,_0x55988d,_0x32d3dc){_0x32d3dc(null,util[_0xfab0('0x25')](_0xfab0('0x26'),Date[_0xfab0('0x27')](),_0x55988d['originalname']));}})});router[_0xfab0('0x1f')](_0xfab0('0x28'),upload[_0xfab0('0x29')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xfab0('0x21')]({'destination':function(_0x15ad99,_0x39b226,_0x377387){_0x377387(null,path[_0xfab0('0x22')](config[_0xfab0('0x23')],_0xfab0('0x2a')));},'filename':function(_0x154005,_0x6fea44,_0x473ef7){_0x473ef7(null,util[_0xfab0('0x25')](_0xfab0('0x26'),Date[_0xfab0('0x27')](),_0x6fea44[_0xfab0('0x2b')]));}})});router[_0xfab0('0x1f')](_0xfab0('0x10'),upload[_0xfab0('0x29')](_0xfab0('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0xfab0('0x21')]({'destination':function(_0x397efb,_0x166ce2,_0x49e025){_0x49e025(null,path['join'](config[_0xfab0('0x23')],_0xfab0('0x2a')));},'filename':function(_0x4cad54,_0x5260d4,_0x148863){_0x148863(null,util[_0xfab0('0x25')](_0xfab0('0x26'),Date[_0xfab0('0x27')](),_0x5260d4[_0xfab0('0x2b')]));}})});router['post'](_0xfab0('0x2d'),upload[_0xfab0('0x29')](_0xfab0('0x2c')),controller[_0xfab0('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x361d80,_0x4c76ed,_0x31c351){_0x31c351(null,path[_0xfab0('0x22')](config['root'],_0xfab0('0x2a')));},'filename':function(_0x1a4688,_0x2dc0db,_0x525eba){_0x525eba(null,util[_0xfab0('0x25')](_0xfab0('0x26'),Date[_0xfab0('0x27')](),_0x2dc0db[_0xfab0('0x2b')]));}})});router[_0xfab0('0x1f')](_0xfab0('0x13'),upload[_0xfab0('0x29')](_0xfab0('0x2c')),controller[_0xfab0('0x2f')]);router[_0xfab0('0x1f')](_0xfab0('0x30'),controller[_0xfab0('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0xfab0('0x21')]({'destination':function(_0x57f7f1,_0x258e12,_0xd5c598){const _0x7a0359=path[_0xfab0('0x22')](config['root'],_0xfab0('0x32'),_0xfab0('0x33'),'offline-chat');fs_extra['ensureDir'](_0x7a0359,function(){_0xd5c598(null,_0x7a0359);});},'filename':function(_0x41501f,_0x203262,_0x1b0cbd){const _0xe7084a=_0x203262[_0xfab0('0x2b')][_0xfab0('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x52e06a=path[_0xfab0('0x35')](_0xe7084a);const _0x14b508=Date[_0xfab0('0x27')]()+'-'+_0xe7084a[_0xfab0('0x34')](_0x52e06a,'')+_0x52e06a;_0x1b0cbd(null,_0x14b508);}})});router[_0xfab0('0x1f')](_0xfab0('0x36'),offlineUploadMulter[_0xfab0('0x37')](),controller[_0xfab0('0x38')]);router[_0xfab0('0x1f')](_0xfab0('0x15'),auth[_0xfab0('0x7')](),controller['addInteraction']);router[_0xfab0('0x1f')](_0xfab0('0x18'),auth['isAuthenticated'](),controller[_0xfab0('0x39')]);router[_0xfab0('0x1f')](_0xfab0('0x1a'),auth[_0xfab0('0x7')](),controller['addProactiveActions']);router[_0xfab0('0x1f')](_0xfab0('0x3a'),auth['isAuthenticated'](),controller[_0xfab0('0x3b')]);router['put'](_0xfab0('0xb'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x3c')]);router[_0xfab0('0x3d')](_0xfab0('0xb'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x3e')]);router['delete'](_0xfab0('0x3f'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x40')]);router[_0xfab0('0x3d')](_0xfab0('0xd'),auth[_0xfab0('0x7')](),controller[_0xfab0('0x41')]);router[_0xfab0('0x3d')](_0xfab0('0x3a'),auth['isAuthenticated'](),controller[_0xfab0('0x42')]);module[_0xfab0('0x43')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index ff0b1fe..f003a18 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c46=['app','get','client-side-logger','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','express','Router','env','production'];(function(_0x435a9f,_0x29c0d1){var _0x34cd48=function(_0x3886a4){while(--_0x3886a4){_0x435a9f['push'](_0x435a9f['shift']());}};_0x34cd48(++_0x29c0d1);}(_0x9c46,0x19f));var _0x69c4=function(_0x503061,_0x2ec426){_0x503061=_0x503061-0x0;var _0x386ebc=_0x9c46[_0x503061];return _0x386ebc;};var beaverLogger=require(_0x69c4('0x0'));var express=require(_0x69c4('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x69c4('0x2')]();var isProduction=config[_0x69c4('0x3')]===_0x69c4('0x4')||![];function clientSideLogs(_0x5393fa,_0x1aac4f,_0x5316da){var _0x1d0b9b=_0x5393fa[_0x69c4('0x5')][_0x69c4('0x6')](_0x69c4('0x7'));if(!_0x1d0b9b){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x69c4('0x8')]({'uri':_0x69c4('0x9'),'logger':_0x1d0b9b,'enableCors':!isProduction})(_0x5393fa,_0x1aac4f,_0x5316da);}router['use'](auth[_0x69c4('0xa')](),clientSideLogs);module[_0x69c4('0xb')]=router;
\ No newline at end of file
+var _0xf550=['expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x14767e,_0x33a047){var _0x2abce9=function(_0x5527b4){while(--_0x5527b4){_0x14767e['push'](_0x14767e['shift']());}};_0x2abce9(++_0x33a047);}(_0xf550,0x1d9));var _0x0f55=function(_0x53f402,_0x326920){_0x53f402=_0x53f402-0x0;var _0x45a76d=_0xf550[_0x53f402];return _0x45a76d;};var beaverLogger=require(_0x0f55('0x0'));var express=require(_0x0f55('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x0f55('0x2')]();var isProduction=config[_0x0f55('0x3')]===_0x0f55('0x4')||![];function clientSideLogs(_0x5e59ac,_0x44e3bc,_0x24f0ac){var _0x3c3e52=_0x5e59ac[_0x0f55('0x5')]['get'](_0x0f55('0x6'));if(!_0x3c3e52){throw new Error(_0x0f55('0x7'));}return beaverLogger[_0x0f55('0x8')]({'uri':_0x0f55('0x9'),'logger':_0x3c3e52,'enableCors':!isProduction})(_0x5e59ac,_0x44e3bc,_0x24f0ac);}router[_0x0f55('0xa')](auth[_0x0f55('0xb')](),clientSideLogs);module[_0x0f55('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 448c92c..e1288ca 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 _0xc417=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','AmazonAWS','Google','Outlook365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token'];(function(_0x5d62f2,_0x17511a){var _0x9a497=function(_0x551be1){while(--_0x551be1){_0x5d62f2['push'](_0x5d62f2['shift']());}};_0x9a497(++_0x17511a);}(_0xc417,0xea));var _0x7c41=function(_0x4b104a,_0x53fd06){_0x4b104a=_0x4b104a-0x0;var _0x5e486c=_0xc417[_0x4b104a];return _0x5e486c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x7c41('0x0'),_0x7c41('0x1'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x7c41('0x2'),'Dynamics365')},'data1':{'type':Sequelize[_0x7c41('0x3')],'comment':_0x7c41('0x4')},'data2':{'type':Sequelize[_0x7c41('0x3')],'comment':_0x7c41('0x5')},'data3':{'type':Sequelize[_0x7c41('0x3')],'comment':_0x7c41('0x6')},'data4':{'type':Sequelize[_0x7c41('0x3')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x7c41('0x7')},'data6':{'type':Sequelize[_0x7c41('0x8')],'comment':_0x7c41('0x9')},'data7':{'type':Sequelize['TEXT'],'comment':_0x7c41('0xa')}};
\ No newline at end of file
+var _0xaa04=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING'];(function(_0x571fdd,_0x2bc60a){var _0x4f92e7=function(_0x1b7f3b){while(--_0x1b7f3b){_0x571fdd['push'](_0x571fdd['shift']());}};_0x4f92e7(++_0x2bc60a);}(_0xaa04,0x118));var _0x4aa0=function(_0x476dd4,_0x1a59cb){_0x476dd4=_0x476dd4-0x0;var _0x801ef2=_0xaa04[_0x476dd4];return _0x801ef2;};'use strict';var Sequelize=require('sequelize');module[_0x4aa0('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4aa0('0x1')](_0x4aa0('0x2'),_0x4aa0('0x3'),_0x4aa0('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4aa0('0x1')]('Outlook365',_0x4aa0('0x5'))},'data1':{'type':Sequelize['STRING'],'comment':_0x4aa0('0x6')},'data2':{'type':Sequelize[_0x4aa0('0x7')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x4aa0('0x8')},'data4':{'type':Sequelize[_0x4aa0('0x7')],'comment':_0x4aa0('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x4aa0('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x4aa0('0xa')],'comment':_0x4aa0('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 0785ea4..c3323da 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 _0x1c2e=['../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','status','end','json','offset','limit','count','Content-Range','update','then','destroy','sendStatus','error','stack','name','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','join','encryptString','create','find','oauth2MicrosoftAuthorize','findOne','user','get','state','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','ioredis'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x1c2e,0x15f));var _0xe1c2=function(_0x24318c,_0x11ec34){_0x24318c=_0x24318c-0x0;var _0x540315=_0x1c2e[_0x24318c];return _0x540315;};'use strict';var _=require('lodash');var Redis=require(_0xe1c2('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xe1c2('0x1'));var config=require(_0xe1c2('0x2'));var logger=require('../../config/logger')('api');var db=require(_0xe1c2('0x3'))['db'];var oauth=require(_0xe1c2('0x4'));config['redis']=_[_0xe1c2('0x5')](config[_0xe1c2('0x6')],{'host':_0xe1c2('0x7'),'port':0x18eb});var socket=require(_0xe1c2('0x8'))(new Redis(config[_0xe1c2('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x2dd30c,_0x407299){_0x407299=_0x407299||0xcc;return function(_0x2316ed){if(_0x2316ed){return _0x2dd30c['sendStatus'](_0x407299);}return _0x2dd30c[_0xe1c2('0x9')](_0x407299)[_0xe1c2('0xa')]();};}function respondWithResult(_0x5ec26a,_0x5b7209){_0x5b7209=_0x5b7209||0xc8;return function(_0x42674b){if(_0x42674b){return _0x5ec26a['status'](_0x5b7209)[_0xe1c2('0xb')](_0x42674b);}};}function respondWithFilteredResult(_0x4075ba,_0x4b2dac){return function(_0x2eef57){if(_0x2eef57){var _0x305281=typeof _0x4b2dac[_0xe1c2('0xc')]==='undefined'&&typeof _0x4b2dac[_0xe1c2('0xd')]==='undefined';var _0x3d879e=_0x2eef57[_0xe1c2('0xe')];var _0x4559a2=_0x305281?0x0:_0x4b2dac['offset'];var _0x185a4b=_0x305281?_0x2eef57[_0xe1c2('0xe')]:_0x4b2dac[_0xe1c2('0xc')]+_0x4b2dac[_0xe1c2('0xd')];var _0x52157c;if(_0x185a4b>=_0x3d879e){_0x185a4b=_0x3d879e;_0x52157c=0xc8;}else{_0x52157c=0xce;}_0x4075ba[_0xe1c2('0x9')](_0x52157c);return _0x4075ba['set'](_0xe1c2('0xf'),_0x4559a2+'-'+_0x185a4b+'/'+_0x3d879e)[_0xe1c2('0xb')](_0x2eef57);}return null;};}function saveUpdates(_0xb7b966){return function(_0x73dab2){if(_0x73dab2){return _0x73dab2[_0xe1c2('0x10')](_0xb7b966)[_0xe1c2('0x11')](function(_0x32c6bb){return _0x32c6bb;});}return null;};}function removeEntity(_0x30932f){return function(_0x171ff6){if(_0x171ff6){return _0x171ff6[_0xe1c2('0x12')]()[_0xe1c2('0x11')](function(){_0x30932f[_0xe1c2('0x9')](0xcc)[_0xe1c2('0xa')]();});}};}function handleEntityNotFound(_0x1a7928){return function(_0x2f722c){if(!_0x2f722c){_0x1a7928[_0xe1c2('0x13')](0x194);}return _0x2f722c;};}function handleError(_0x3e50c3,_0x1f14f4){_0x1f14f4=_0x1f14f4||0x1f4;return function(_0xe2db85){logger[_0xe1c2('0x14')](_0xe2db85[_0xe1c2('0x15')]);if(_0xe2db85[_0xe1c2('0x16')]){delete _0xe2db85[_0xe1c2('0x16')];}_0x3e50c3[_0xe1c2('0x9')](_0x1f14f4)['send'](_0xe2db85);};}function maskClientSecret(_0x58d996){return _[_0xe1c2('0x17')](_0x58d996[_0xe1c2('0x18')](0x0,0x3),0x14,'*');}exports[_0xe1c2('0x19')]=function(_0x21a3eb,_0x906464){var _0x51868e={},_0x507091={},_0x5c9c55={'count':0x0,'rows':[]};var _0x140ea8=_['map'](db[_0xe1c2('0x1a')][_0xe1c2('0x1b')],function(_0x384d06){return{'name':_0x384d06[_0xe1c2('0x1c')],'type':_0x384d06[_0xe1c2('0x1d')]['key']};});_0x507091[_0xe1c2('0x1e')]=_['map'](_0x140ea8,_0xe1c2('0x16'));_0x507091[_0xe1c2('0x1f')]=_[_0xe1c2('0x20')](_0x21a3eb['query']);_0x507091[_0xe1c2('0x21')]=_[_0xe1c2('0x22')](_0x507091[_0xe1c2('0x1e')],_0x507091[_0xe1c2('0x1f')]);_0x51868e['attributes']=_[_0xe1c2('0x22')](_0x507091[_0xe1c2('0x1e')],qs[_0xe1c2('0x23')](_0x21a3eb['query'][_0xe1c2('0x23')]));_0x51868e['attributes']=_0x51868e[_0xe1c2('0x24')][_0xe1c2('0x25')]?_0x51868e[_0xe1c2('0x24')]:_0x507091[_0xe1c2('0x1e')];if(!_0x21a3eb[_0xe1c2('0x1f')]['hasOwnProperty'](_0xe1c2('0x26'))){_0x51868e[_0xe1c2('0xd')]=qs[_0xe1c2('0xd')](_0x21a3eb[_0xe1c2('0x1f')][_0xe1c2('0xd')]);_0x51868e[_0xe1c2('0xc')]=qs[_0xe1c2('0xc')](_0x21a3eb['query'][_0xe1c2('0xc')]);}_0x51868e[_0xe1c2('0x27')]=qs['sort'](_0x21a3eb[_0xe1c2('0x1f')][_0xe1c2('0x28')]);_0x51868e[_0xe1c2('0x29')]=qs['filters'](_[_0xe1c2('0x2a')](_0x21a3eb[_0xe1c2('0x1f')],_0x507091[_0xe1c2('0x21')]),_0x140ea8);if(_0x21a3eb[_0xe1c2('0x1f')][_0xe1c2('0x2b')]){_0x51868e['where']=_[_0xe1c2('0x2c')](_0x51868e[_0xe1c2('0x29')],{'$or':_[_0xe1c2('0x2d')](_0x140ea8,function(_0x5142b0){if(_0x5142b0['type']!=='VIRTUAL'){var _0x132b65={};_0x132b65[_0x5142b0[_0xe1c2('0x16')]]={'$like':'%'+_0x21a3eb[_0xe1c2('0x1f')][_0xe1c2('0x2b')]+'%'};return _0x132b65;}})});}_0x51868e=_[_0xe1c2('0x2c')]({},_0x51868e,_0x21a3eb[_0xe1c2('0x2e')]);var _0x5ca94f={'where':_0x51868e[_0xe1c2('0x29')]};return db[_0xe1c2('0x1a')]['count'](_0x5ca94f)[_0xe1c2('0x11')](function(_0x19a78e){_0x5c9c55['count']=_0x19a78e;if(_0x21a3eb[_0xe1c2('0x1f')][_0xe1c2('0x2f')]){_0x51868e[_0xe1c2('0x30')]=[{'all':!![]}];}return db[_0xe1c2('0x1a')][_0xe1c2('0x31')](_0x51868e);})['then'](function(_0x2a62a5){_0x5c9c55[_0xe1c2('0x32')]=_[_0xe1c2('0x2d')](_0x2a62a5,function(_0x2ec065){if(_0x2ec065[_0xe1c2('0x33')]===_0xe1c2('0x34')){var _0x16f58f=encryptor[_0xe1c2('0x35')](_0x2ec065[_0xe1c2('0x36')]);_0x2ec065[_0xe1c2('0x36')]=maskClientSecret(_0x16f58f);}return _0x2ec065;});return _0x5c9c55;})['then'](respondWithFilteredResult(_0x906464,_0x51868e))[_0xe1c2('0x37')](handleError(_0x906464,null));};exports[_0xe1c2('0x38')]=function(_0x3e3be3,_0x5d5b1d){var _0x35a082={'raw':!![],'where':{'id':_0x3e3be3[_0xe1c2('0x39')]['id']}},_0x4668cf={};_0x4668cf[_0xe1c2('0x1e')]=_[_0xe1c2('0x20')](db[_0xe1c2('0x1a')][_0xe1c2('0x1b')]);_0x4668cf[_0xe1c2('0x1f')]=_[_0xe1c2('0x20')](_0x3e3be3[_0xe1c2('0x1f')]);_0x4668cf['filters']=_[_0xe1c2('0x22')](_0x4668cf[_0xe1c2('0x1e')],_0x4668cf[_0xe1c2('0x1f')]);_0x35a082[_0xe1c2('0x24')]=_['intersection'](_0x4668cf[_0xe1c2('0x1e')],qs['fields'](_0x3e3be3[_0xe1c2('0x1f')][_0xe1c2('0x23')]));_0x35a082[_0xe1c2('0x24')]=_0x35a082[_0xe1c2('0x24')][_0xe1c2('0x25')]?_0x35a082[_0xe1c2('0x24')]:_0x4668cf[_0xe1c2('0x1e')];if(_0x3e3be3[_0xe1c2('0x1f')][_0xe1c2('0x2f')]){_0x35a082[_0xe1c2('0x30')]=[{'all':!![]}];}_0x35a082=_[_0xe1c2('0x2c')]({},_0x35a082,_0x3e3be3[_0xe1c2('0x2e')]);return db[_0xe1c2('0x1a')]['find'](_0x35a082)[_0xe1c2('0x11')](handleEntityNotFound(_0x5d5b1d,null))[_0xe1c2('0x11')](function(_0x3a9b99){if(_0x3a9b99[_0xe1c2('0x33')]===_0xe1c2('0x34')){var _0x3003ee=encryptor[_0xe1c2('0x35')](_0x3a9b99['data3']);_0x3a9b99[_0xe1c2('0x36')]=maskClientSecret(_0x3003ee);}return _0x3a9b99;})[_0xe1c2('0x11')](respondWithResult(_0x5d5b1d,null))['catch'](handleError(_0x5d5b1d,null));};exports['create']=function(_0x2595ed,_0x2c34a7){if(!_0x2595ed[_0xe1c2('0x3a')][_0xe1c2('0x16')])throw new Error(_0xe1c2('0x3b'));if(!_0x2595ed[_0xe1c2('0x3a')][_0xe1c2('0x33')])throw new Error(_0xe1c2('0x3c'));var _0x2e2f99=db[_0xe1c2('0x1a')][_0xe1c2('0x1b')][_0xe1c2('0x33')]['values'];if(!_0x2e2f99[_0xe1c2('0x3d')](_0x2595ed[_0xe1c2('0x3a')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2e2f99[_0xe1c2('0x3e')](',\x20'));if(_0x2595ed['body'][_0xe1c2('0x33')]==='MicrosoftAzure'&&_0x2595ed['body']['data3']){_0x2595ed[_0xe1c2('0x3a')][_0xe1c2('0x36')]=encryptor[_0xe1c2('0x3f')](_0x2595ed[_0xe1c2('0x3a')][_0xe1c2('0x36')]);}return db['CloudProvider'][_0xe1c2('0x40')](_0x2595ed['body'],{})[_0xe1c2('0x11')](respondWithResult(_0x2c34a7,0xc9))[_0xe1c2('0x37')](handleError(_0x2c34a7,null));};exports[_0xe1c2('0x10')]=function(_0x4fd15f,_0xf6d3b7){if(_0x4fd15f[_0xe1c2('0x3a')]['id']){delete _0x4fd15f[_0xe1c2('0x3a')]['id'];}return db['CloudProvider'][_0xe1c2('0x41')]({'where':{'id':_0x4fd15f[_0xe1c2('0x39')]['id']}})[_0xe1c2('0x11')](handleEntityNotFound(_0xf6d3b7,null))[_0xe1c2('0x11')](function(_0x4893fc){if(_0x4893fc['service']==='MicrosoftAzure'&&_0x4fd15f[_0xe1c2('0x3a')][_0xe1c2('0x36')]){_0x4fd15f[_0xe1c2('0x3a')][_0xe1c2('0x36')]=encryptor[_0xe1c2('0x3f')](_0x4fd15f[_0xe1c2('0x3a')][_0xe1c2('0x36')]);}return _0x4893fc;})[_0xe1c2('0x11')](saveUpdates(_0x4fd15f[_0xe1c2('0x3a')],null))['then'](respondWithResult(_0xf6d3b7,null))[_0xe1c2('0x37')](handleError(_0xf6d3b7,null));};exports[_0xe1c2('0x12')]=function(_0x2a3cf6,_0x5ed654){return db[_0xe1c2('0x1a')][_0xe1c2('0x41')]({'where':{'id':_0x2a3cf6[_0xe1c2('0x39')]['id']}})[_0xe1c2('0x11')](handleEntityNotFound(_0x5ed654,null))[_0xe1c2('0x11')](removeEntity(_0x5ed654,null))[_0xe1c2('0x37')](handleError(_0x5ed654,null));};exports[_0xe1c2('0x42')]=function(_0x4c330e,_0x889157){return db['CloudProvider'][_0xe1c2('0x43')]({'where':{'id':_0x4c330e[_0xe1c2('0x39')]['id']},'raw':!![]})[_0xe1c2('0x11')](function(_0x3b19ec){if(!_0x3b19ec)return _0x889157[_0xe1c2('0x13')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3b19ec,_0x4c330e[_0xe1c2('0x44')]['id'])};})['then'](respondWithResult(_0x889157,null))['catch'](handleError(_0x889157,null));};exports['oauth2MicrosoftCallback']=function(_0x482140,_0xfea8d5){var _0x39319d=_0x482140['body'];var _0x11c0c6;var _0x7bfefa;if(_0x39319d[_0xe1c2('0x14')])throw _0x39319d;redis[_0xe1c2('0x45')](_0x39319d[_0xe1c2('0x46')])[_0xe1c2('0x11')](function(_0x2eca90){if(!_0x2eca90)throw new Error('Invalid\x20state\x20parameter');_0x11c0c6=JSON['parse'](_0x2eca90);var _0x41be2d=Buffer[_0xe1c2('0x47')](_0x39319d[_0xe1c2('0x46')],'base64')[_0xe1c2('0x48')](_0xe1c2('0x49'));_0x7bfefa=JSON['parse'](_0x41be2d);if(!oauth[_0xe1c2('0x4a')](_0x39319d[_0xe1c2('0x4b')],_0x11c0c6[_0xe1c2('0x4c')]))throw new Error(_0xe1c2('0x4d'));redis[_0xe1c2('0x4e')](_0x39319d[_0xe1c2('0x46')]);return oauth['getOauth2MicrosoftAccessToken'](_0x39319d[_0xe1c2('0x4f')],_0x11c0c6);})[_0xe1c2('0x11')](function(_0x28c8a0){_0x11c0c6[_0xe1c2('0x50')]=_0x28c8a0['access_token'];_0x11c0c6[_0xe1c2('0x51')]=_0x28c8a0[_0xe1c2('0x52')];return db['CloudProvider'][_0xe1c2('0x10')]({'data5':_0x11c0c6[_0xe1c2('0x50')],'data6':_0x11c0c6[_0xe1c2('0x51')]},{'where':{'id':_0x11c0c6['id']}});})[_0xe1c2('0x11')](function(){oauth[_0xe1c2('0x53')](_0x11c0c6);socket['emit']('microsoftAuthorization:success',{'id':_0x7bfefa['id']});return;})[_0xe1c2('0x11')](respondWithStatusCode(_0xfea8d5,null))[_0xe1c2('0x37')](function(_0x1f674e){if(_0x7bfefa){socket['emit'](_0xe1c2('0x54'),{'id':_0x7bfefa['id']});}if(!_0x11c0c6){logger['error'](_0xe1c2('0x55'),_0x1f674e);return _0xfea8d5[_0xe1c2('0x9')](0x1f4)[_0xe1c2('0x56')](_0x1f674e[_0xe1c2('0x57')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x11c0c6['id'],JSON['stringify'](_0x1f674e));});};
\ No newline at end of file
+var _0x0d27=['Name\x20parameter\x20not\x20specified','service','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','from','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','access_token','data6','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','CloudProvider','includeAll','include','rows','MicrosoftAzure','decryptString','data3','catch','length','find','create','body'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0x0d27,0x189));var _0x70d2=function(_0x135b97,_0x44bee8){_0x135b97=_0x135b97-0x0;var _0x8f5004=_0x0d27[_0x135b97];return _0x8f5004;};'use strict';var _=require(_0x70d2('0x0'));var Redis=require(_0x70d2('0x1'));var qs=require(_0x70d2('0x2'));var encryptor=require(_0x70d2('0x3'));var config=require('../../config/environment');var logger=require(_0x70d2('0x4'))(_0x70d2('0x5'));var db=require(_0x70d2('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x70d2('0x7')]=_[_0x70d2('0x8')](config['redis'],{'host':_0x70d2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70d2('0x7')]));var redis=new Redis(config[_0x70d2('0x7')]);function respondWithStatusCode(_0x43eac9,_0x1febcd){_0x1febcd=_0x1febcd||0xcc;return function(_0x37b481){if(_0x37b481){return _0x43eac9[_0x70d2('0xa')](_0x1febcd);}return _0x43eac9[_0x70d2('0xb')](_0x1febcd)[_0x70d2('0xc')]();};}function respondWithResult(_0x1c6d8d,_0x54e4f1){_0x54e4f1=_0x54e4f1||0xc8;return function(_0x42940f){if(_0x42940f){return _0x1c6d8d[_0x70d2('0xb')](_0x54e4f1)[_0x70d2('0xd')](_0x42940f);}};}function respondWithFilteredResult(_0x391a72,_0x31ad9a){return function(_0x459884){if(_0x459884){var _0x26f496=typeof _0x31ad9a[_0x70d2('0xe')]==='undefined'&&typeof _0x31ad9a['limit']===_0x70d2('0xf');var _0x4a63d3=_0x459884[_0x70d2('0x10')];var _0x2827a2=_0x26f496?0x0:_0x31ad9a['offset'];var _0x1cd305=_0x26f496?_0x459884['count']:_0x31ad9a[_0x70d2('0xe')]+_0x31ad9a[_0x70d2('0x11')];var _0x49dd5e;if(_0x1cd305>=_0x4a63d3){_0x1cd305=_0x4a63d3;_0x49dd5e=0xc8;}else{_0x49dd5e=0xce;}_0x391a72[_0x70d2('0xb')](_0x49dd5e);return _0x391a72[_0x70d2('0x12')](_0x70d2('0x13'),_0x2827a2+'-'+_0x1cd305+'/'+_0x4a63d3)[_0x70d2('0xd')](_0x459884);}return null;};}function saveUpdates(_0x385d46){return function(_0x3501f2){if(_0x3501f2){return _0x3501f2[_0x70d2('0x14')](_0x385d46)['then'](function(_0x12315d){return _0x12315d;});}return null;};}function removeEntity(_0x528e3d){return function(_0x2ee6a9){if(_0x2ee6a9){return _0x2ee6a9[_0x70d2('0x15')]()[_0x70d2('0x16')](function(){_0x528e3d[_0x70d2('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b71c6){return function(_0x3afe50){if(!_0x3afe50){_0x2b71c6['sendStatus'](0x194);}return _0x3afe50;};}function handleError(_0x2fde8c,_0x26a5f3){_0x26a5f3=_0x26a5f3||0x1f4;return function(_0x4bf77d){logger[_0x70d2('0x17')](_0x4bf77d[_0x70d2('0x18')]);if(_0x4bf77d[_0x70d2('0x19')]){delete _0x4bf77d[_0x70d2('0x19')];}_0x2fde8c[_0x70d2('0xb')](_0x26a5f3)[_0x70d2('0x1a')](_0x4bf77d);};}function maskClientSecret(_0x590e14){return _['padEnd'](_0x590e14['slice'](0x0,0x3),0x14,'*');}exports[_0x70d2('0x1b')]=function(_0x373bc9,_0x49f1bd){var _0x191c1d={},_0x34d472={},_0x11626f={'count':0x0,'rows':[]};var _0x57555a=_[_0x70d2('0x1c')](db['CloudProvider'][_0x70d2('0x1d')],function(_0x32d670){return{'name':_0x32d670['fieldName'],'type':_0x32d670[_0x70d2('0x1e')]['key']};});_0x34d472[_0x70d2('0x1f')]=_[_0x70d2('0x1c')](_0x57555a,_0x70d2('0x19'));_0x34d472[_0x70d2('0x20')]=_[_0x70d2('0x21')](_0x373bc9['query']);_0x34d472[_0x70d2('0x22')]=_[_0x70d2('0x23')](_0x34d472[_0x70d2('0x1f')],_0x34d472[_0x70d2('0x20')]);_0x191c1d[_0x70d2('0x24')]=_[_0x70d2('0x23')](_0x34d472[_0x70d2('0x1f')],qs[_0x70d2('0x25')](_0x373bc9[_0x70d2('0x20')][_0x70d2('0x25')]));_0x191c1d[_0x70d2('0x24')]=_0x191c1d[_0x70d2('0x24')]['length']?_0x191c1d[_0x70d2('0x24')]:_0x34d472['model'];if(!_0x373bc9[_0x70d2('0x20')][_0x70d2('0x26')]('nolimit')){_0x191c1d[_0x70d2('0x11')]=qs[_0x70d2('0x11')](_0x373bc9['query'][_0x70d2('0x11')]);_0x191c1d['offset']=qs[_0x70d2('0xe')](_0x373bc9['query'][_0x70d2('0xe')]);}_0x191c1d['order']=qs[_0x70d2('0x27')](_0x373bc9[_0x70d2('0x20')][_0x70d2('0x27')]);_0x191c1d[_0x70d2('0x28')]=qs[_0x70d2('0x22')](_[_0x70d2('0x29')](_0x373bc9[_0x70d2('0x20')],_0x34d472[_0x70d2('0x22')]),_0x57555a);if(_0x373bc9[_0x70d2('0x20')]['filter']){_0x191c1d[_0x70d2('0x28')]=_['merge'](_0x191c1d[_0x70d2('0x28')],{'$or':_[_0x70d2('0x1c')](_0x57555a,function(_0x25d6ac){if(_0x25d6ac[_0x70d2('0x1e')]!=='VIRTUAL'){var _0x55c11e={};_0x55c11e[_0x25d6ac[_0x70d2('0x19')]]={'$like':'%'+_0x373bc9[_0x70d2('0x20')][_0x70d2('0x2a')]+'%'};return _0x55c11e;}})});}_0x191c1d=_[_0x70d2('0x2b')]({},_0x191c1d,_0x373bc9[_0x70d2('0x2c')]);var _0x1289e5={'where':_0x191c1d[_0x70d2('0x28')]};return db[_0x70d2('0x2d')][_0x70d2('0x10')](_0x1289e5)[_0x70d2('0x16')](function(_0xef81f4){_0x11626f[_0x70d2('0x10')]=_0xef81f4;if(_0x373bc9[_0x70d2('0x20')][_0x70d2('0x2e')]){_0x191c1d[_0x70d2('0x2f')]=[{'all':!![]}];}return db[_0x70d2('0x2d')]['findAll'](_0x191c1d);})['then'](function(_0x4f2c07){_0x11626f[_0x70d2('0x30')]=_[_0x70d2('0x1c')](_0x4f2c07,function(_0x516fc4){if(_0x516fc4['service']===_0x70d2('0x31')){var _0x494a15=encryptor[_0x70d2('0x32')](_0x516fc4['data3']);_0x516fc4[_0x70d2('0x33')]=maskClientSecret(_0x494a15);}return _0x516fc4;});return _0x11626f;})[_0x70d2('0x16')](respondWithFilteredResult(_0x49f1bd,_0x191c1d))[_0x70d2('0x34')](handleError(_0x49f1bd,null));};exports['show']=function(_0x478ac3,_0x41963d){var _0x288b6c={'raw':!![],'where':{'id':_0x478ac3['params']['id']}},_0x3d4aad={};_0x3d4aad[_0x70d2('0x1f')]=_['keys'](db['CloudProvider']['rawAttributes']);_0x3d4aad[_0x70d2('0x20')]=_['keys'](_0x478ac3[_0x70d2('0x20')]);_0x3d4aad[_0x70d2('0x22')]=_[_0x70d2('0x23')](_0x3d4aad[_0x70d2('0x1f')],_0x3d4aad['query']);_0x288b6c[_0x70d2('0x24')]=_['intersection'](_0x3d4aad[_0x70d2('0x1f')],qs[_0x70d2('0x25')](_0x478ac3[_0x70d2('0x20')][_0x70d2('0x25')]));_0x288b6c['attributes']=_0x288b6c[_0x70d2('0x24')][_0x70d2('0x35')]?_0x288b6c[_0x70d2('0x24')]:_0x3d4aad[_0x70d2('0x1f')];if(_0x478ac3[_0x70d2('0x20')][_0x70d2('0x2e')]){_0x288b6c[_0x70d2('0x2f')]=[{'all':!![]}];}_0x288b6c=_[_0x70d2('0x2b')]({},_0x288b6c,_0x478ac3['options']);return db['CloudProvider'][_0x70d2('0x36')](_0x288b6c)['then'](handleEntityNotFound(_0x41963d,null))[_0x70d2('0x16')](function(_0x300d0d){if(_0x300d0d['service']===_0x70d2('0x31')){var _0x2e1819=encryptor[_0x70d2('0x32')](_0x300d0d['data3']);_0x300d0d[_0x70d2('0x33')]=maskClientSecret(_0x2e1819);}return _0x300d0d;})['then'](respondWithResult(_0x41963d,null))[_0x70d2('0x34')](handleError(_0x41963d,null));};exports[_0x70d2('0x37')]=function(_0x5292db,_0x1c1932){if(!_0x5292db[_0x70d2('0x38')][_0x70d2('0x19')])throw new Error(_0x70d2('0x39'));if(!_0x5292db['body'][_0x70d2('0x3a')])throw new Error(_0x70d2('0x3b'));var _0x825ed2=db[_0x70d2('0x2d')][_0x70d2('0x1d')][_0x70d2('0x3a')][_0x70d2('0x3c')];if(!_0x825ed2[_0x70d2('0x3d')](_0x5292db['body'][_0x70d2('0x3a')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x825ed2[_0x70d2('0x3e')](',\x20'));if(_0x5292db['body']['service']===_0x70d2('0x31')&&_0x5292db['body'][_0x70d2('0x33')]){_0x5292db[_0x70d2('0x38')][_0x70d2('0x33')]=encryptor[_0x70d2('0x3f')](_0x5292db[_0x70d2('0x38')][_0x70d2('0x33')]);}return db[_0x70d2('0x2d')]['create'](_0x5292db[_0x70d2('0x38')],{})[_0x70d2('0x16')](respondWithResult(_0x1c1932,0xc9))[_0x70d2('0x34')](handleError(_0x1c1932,null));};exports[_0x70d2('0x14')]=function(_0x5bfc5d,_0x4577db){if(_0x5bfc5d[_0x70d2('0x38')]['id']){delete _0x5bfc5d[_0x70d2('0x38')]['id'];}return db[_0x70d2('0x2d')][_0x70d2('0x36')]({'where':{'id':_0x5bfc5d['params']['id']}})[_0x70d2('0x16')](handleEntityNotFound(_0x4577db,null))['then'](function(_0x5bcd2b){if(_0x5bcd2b['service']==='MicrosoftAzure'&&_0x5bfc5d[_0x70d2('0x38')][_0x70d2('0x33')]){_0x5bfc5d[_0x70d2('0x38')][_0x70d2('0x33')]=encryptor[_0x70d2('0x3f')](_0x5bfc5d['body'][_0x70d2('0x33')]);}return _0x5bcd2b;})[_0x70d2('0x16')](saveUpdates(_0x5bfc5d[_0x70d2('0x38')],null))[_0x70d2('0x16')](respondWithResult(_0x4577db,null))['catch'](handleError(_0x4577db,null));};exports['destroy']=function(_0x2893dc,_0x48ce66){return db[_0x70d2('0x2d')][_0x70d2('0x36')]({'where':{'id':_0x2893dc[_0x70d2('0x40')]['id']}})[_0x70d2('0x16')](handleEntityNotFound(_0x48ce66,null))[_0x70d2('0x16')](removeEntity(_0x48ce66,null))[_0x70d2('0x34')](handleError(_0x48ce66,null));};exports[_0x70d2('0x41')]=function(_0x32c95d,_0x489f9e){return db[_0x70d2('0x2d')][_0x70d2('0x42')]({'where':{'id':_0x32c95d[_0x70d2('0x40')]['id']},'raw':!![]})[_0x70d2('0x16')](function(_0x52fbd7){if(!_0x52fbd7)return _0x489f9e[_0x70d2('0xa')](0x194);return{'url':oauth[_0x70d2('0x43')](_0x52fbd7,_0x32c95d[_0x70d2('0x44')]['id'])};})[_0x70d2('0x16')](respondWithResult(_0x489f9e,null))[_0x70d2('0x34')](handleError(_0x489f9e,null));};exports[_0x70d2('0x45')]=function(_0x2028cf,_0x394199){var _0x43092c=_0x2028cf[_0x70d2('0x38')];var _0x5a330a;var _0x6e4d31;if(_0x43092c['error'])throw _0x43092c;redis['get'](_0x43092c[_0x70d2('0x46')])['then'](function(_0x2e8e6e){if(!_0x2e8e6e)throw new Error('Invalid\x20state\x20parameter');_0x5a330a=JSON['parse'](_0x2e8e6e);var _0x1bf41e=Buffer[_0x70d2('0x47')](_0x43092c[_0x70d2('0x46')],_0x70d2('0x48'))[_0x70d2('0x49')](_0x70d2('0x4a'));_0x6e4d31=JSON[_0x70d2('0x4b')](_0x1bf41e);if(!oauth['isValidIdToken'](_0x43092c[_0x70d2('0x4c')],_0x5a330a[_0x70d2('0x4d')]))throw new Error(_0x70d2('0x4e'));redis['del'](_0x43092c['state']);return oauth[_0x70d2('0x4f')](_0x43092c['code'],_0x5a330a);})[_0x70d2('0x16')](function(_0x1007a3){_0x5a330a[_0x70d2('0x50')]=_0x1007a3[_0x70d2('0x51')];_0x5a330a[_0x70d2('0x52')]=_0x1007a3['refresh_token'];return db['CloudProvider']['update']({'data5':_0x5a330a[_0x70d2('0x50')],'data6':_0x5a330a[_0x70d2('0x52')]},{'where':{'id':_0x5a330a['id']}});})[_0x70d2('0x16')](function(){oauth[_0x70d2('0x53')](_0x5a330a);socket['emit'](_0x70d2('0x54'),{'id':_0x6e4d31['id']});return;})[_0x70d2('0x16')](respondWithStatusCode(_0x394199,null))['catch'](function(_0x2d838a){if(_0x6e4d31){socket['emit'](_0x70d2('0x55'),{'id':_0x6e4d31['id']});}if(!_0x5a330a){logger[_0x70d2('0x17')](_0x70d2('0x56'),_0x2d838a);return _0x394199[_0x70d2('0xb')](0x1f4)['send'](_0x2d838a[_0x70d2('0x57')]);}logger[_0x70d2('0x17')](_0x70d2('0x58'),_0x5a330a['id'],JSON[_0x70d2('0x59')](_0x2d838a));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 0dd5223..45bb5d4 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 _0x1546=['moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider'];(function(_0x3253ef,_0x29d2c9){var _0x39d2c0=function(_0x4fb9d8){while(--_0x4fb9d8){_0x3253ef['push'](_0x3253ef['shift']());}};_0x39d2c0(++_0x29d2c9);}(_0x1546,0x170));var _0x6154=function(_0x5bfd11,_0x26490b){_0x5bfd11=_0x5bfd11-0x0;var _0x996e58=_0x1546[_0x5bfd11];return _0x996e58;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6154('0x0'));var BPromise=require(_0x6154('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6154('0x2'));var rimraf=require(_0x6154('0x3'));var config=require(_0x6154('0x4'));var attributes=require(_0x6154('0x5'));module[_0x6154('0x6')]=function(_0x389919,_0x9daa18){return _0x389919['define'](_0x6154('0x7'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe8e=['./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4cdd96,_0x373b18){var _0x48fe61=function(_0x24dd3e){while(--_0x24dd3e){_0x4cdd96['push'](_0x4cdd96['shift']());}};_0x48fe61(++_0x373b18);}(_0xfe8e,0x148));var _0xefe8=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xfe8e[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0xefe8('0x0'));var util=require(_0xefe8('0x1'));var logger=require(_0xefe8('0x2'))(_0xefe8('0x3'));var moment=require(_0xefe8('0x4'));var BPromise=require('bluebird');var rp=require(_0xefe8('0x5'));var fs=require('fs');var path=require(_0xefe8('0x6'));var rimraf=require(_0xefe8('0x7'));var config=require('../../config/environment');var attributes=require(_0xefe8('0x8'));module[_0xefe8('0x9')]=function(_0x2854b9,_0x3d7630){return _0x2854b9[_0xefe8('0xa')](_0xefe8('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 34a0e1a..1c66106 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05b0=['decryptString','POST','access_token','data6','update','data5','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','data2','intervals','bind','findAll','all','inspect','error','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','map','type','Dynamics365','push','data7','/.default','code','stringify','base64','randomBytes','toString','hex','client_id','data1','join','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token'];(function(_0x117a44,_0x5dabdc){var _0x2a03c9=function(_0x4516d7){while(--_0x4516d7){_0x117a44['push'](_0x117a44['shift']());}};_0x2a03c9(++_0x5dabdc);}(_0x05b0,0x67));var _0x005b=function(_0x345858,_0x5b0103){_0x345858=_0x345858-0x0;var _0x531ffe=_0x05b0[_0x345858];return _0x531ffe;};'use strict';var _=require(_0x005b('0x0'));var crypto=require(_0x005b('0x1'));var jwt=require(_0x005b('0x2'));var moment=require(_0x005b('0x3'));var Redis=require(_0x005b('0x4'));var rp=require(_0x005b('0x5'));var util=require(_0x005b('0x6'));var encryptor=require(_0x005b('0x7'));var config=require(_0x005b('0x8'));var logger=require(_0x005b('0x9'))(_0x005b('0xa'));var schedule=require(_0x005b('0xb'));var db=require(_0x005b('0xc'))['db'];config[_0x005b('0xd')]=_[_0x005b('0xe')](config[_0x005b('0xd')],{'host':_0x005b('0xf'),'port':0x18eb});var redis=new Redis(config[_0x005b('0xd')]);var MICROSOFT_AUTH_URL=_0x005b('0x10');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x005b('0x11'),_0x005b('0x12'),_0x005b('0x13'),_0x005b('0x14'),_0x005b('0x15'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x005b('0x16'),_0x005b('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x005b('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0x005b('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xad8f47){var _0x19cb75=_[_0x005b('0x19')](AZURE_AUTH_SCOPES[_0xad8f47[_0x005b('0x1a')]]);if(_0xad8f47[_0x005b('0x1a')]===_0x005b('0x1b'))_0x19cb75[_0x005b('0x1c')](_0xad8f47[_0x005b('0x1d')]+_0x005b('0x1e'));return _0x19cb75['join']('\x20');}function getAccessTokenScope(_0x57da9a){if(_0x57da9a['type']==='Outlook365')return _0x005b('0x14');if(_0x57da9a['type']===_0x005b('0x1b'))return _0x57da9a[_0x005b('0x1d')]+_0x005b('0x1e');}function generateMicrosoftAuthorizationUrl(_0x17f607,_0x4a5eb4){var _0x529a0a=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x17f607['data2']);var _0x345b4a=[_0x005b('0x1f'),'id_token'];var _0x35594e=Buffer['from'](JSON[_0x005b('0x20')]({'id':_0x4a5eb4}))['toString'](_0x005b('0x21'));var _0x2083cc=crypto[_0x005b('0x22')](0x10)[_0x005b('0x23')](_0x005b('0x24'));var _0x5214a2=getAuthorizationScopes(_0x17f607);var _0x5869af=[{'key':_0x005b('0x25'),'value':_0x17f607[_0x005b('0x26')]},{'key':'response_type','value':encodeURIComponent(_0x345b4a[_0x005b('0x27')]('\x20'))},{'key':'redirect_uri','value':_0x17f607['data4']},{'key':_0x005b('0x28'),'value':_0x005b('0x29')},{'key':_0x005b('0x2a'),'value':encodeURIComponent(_0x5214a2)},{'key':_0x005b('0x2b'),'value':_0x35594e},{'key':_0x005b('0x2c'),'value':_0x2083cc},{'key':_0x005b('0x2d'),'value':_0x005b('0x2e')}];var _0x38be49=_0x529a0a+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x005b('0x19')](_0x5869af,function(_0x37c0ed){return _0x37c0ed[_0x005b('0x2f')]+'='+_0x37c0ed[_0x005b('0x30')];})['join']('&');_0x17f607[_0x005b('0x31')]={'issuer':_0x529a0a[_0x005b('0x32')](_0x005b('0x33'),''),'audience':_0x17f607[_0x005b('0x26')],'state':_0x35594e,'nonce':_0x2083cc};redis[_0x005b('0x34')](_0x35594e,JSON[_0x005b('0x20')](_0x17f607));return _0x38be49;}function isValidIdToken(_0x15aa61,_0x16cbdd){try{var _0x283ffa=jwt[_0x005b('0x35')](_0x15aa61,{'complete':!![]});var _0x22ba24=_0x283ffa[_0x005b('0x36')];if(_0x22ba24[_0x005b('0x37')]!==_0x16cbdd['issuer'])return![];if(_0x22ba24[_0x005b('0x38')]!==_0x16cbdd[_0x005b('0x39')])return![];if(_0x22ba24[_0x005b('0x2c')]!==_0x16cbdd['nonce'])return![];if(moment()[_0x005b('0x3a')](moment[_0x005b('0x3b')](_0x22ba24[_0x005b('0x3c')])))return![];return!![];}catch(_0x4a4fef){throw _0x4a4fef;}}function refreshOauth2MicrosoftAccessToken(_0x462417){return Promise[_0x005b('0x3d')]()[_0x005b('0x3e')](function(){if(_0x462417[_0x005b('0x3f')])return _0x462417;return db[_0x005b('0x40')][_0x005b('0x41')]({'where':{'id':_0x462417['id']},'raw':!![]});})[_0x005b('0x3e')](function(_0x720679){var _0x47318d={'grant_type':_0x005b('0x42'),'refresh_token':_0x720679['data6'],'scope':getAccessTokenScope(_0x720679),'redirect_uri':_0x720679['data4'],'client_id':_0x720679['data1'],'client_secret':encryptor[_0x005b('0x43')](_0x720679[_0x005b('0x3f')])};var _0x34e601={'method':_0x005b('0x44'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x720679['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x47318d,'json':!![]};return rp(_0x34e601);})[_0x005b('0x3e')](function(_0x45ed63){_0x462417['data5']=_0x45ed63[_0x005b('0x45')];_0x462417[_0x005b('0x46')]=_0x45ed63[_0x005b('0x42')];return db['CloudProvider'][_0x005b('0x47')]({'data5':_0x462417[_0x005b('0x48')],'data6':_0x462417[_0x005b('0x46')]},{'where':{'id':_0x462417['id']}});})[_0x005b('0x3e')](function(){return _0x462417;})[_0x005b('0x49')](function(_0x3aef7f){logger['error'](_0x005b('0x4a'),_0x462417['id'],_0x3aef7f);});}function getOauth2MicrosoftAccessToken(_0x536053,_0x4ebff1){var _0x3f228a={'grant_type':_0x005b('0x4b'),'code':_0x536053,'scope':getAccessTokenScope(_0x4ebff1),'redirect_uri':_0x4ebff1[_0x005b('0x4c')],'client_id':_0x4ebff1[_0x005b('0x26')],'client_secret':encryptor[_0x005b('0x43')](_0x4ebff1['data3'])};var _0x1f984a={'method':_0x005b('0x44'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x4ebff1[_0x005b('0x4d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f228a,'json':!![]};return rp(_0x1f984a);}function startRefreshInterval(_0x5d0e3b){var _0x366ced=schedule[_0x005b('0x4e')];if(_0x366ced[_0x5d0e3b['id']])clearInterval(_0x366ced[_0x5d0e3b['id']]);_0x366ced[_0x5d0e3b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x005b('0x4f')](this,{'id':_0x5d0e3b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x366ced;}function startAllRefreshIntervals(){return db[_0x005b('0x40')][_0x005b('0x50')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x005b('0x3e')](function(_0x5ac3ec){var _0x140b44=_0x5ac3ec[_0x005b('0x19')](function(_0x36f028){return refreshOauth2MicrosoftAccessToken(_0x36f028)[_0x005b('0x3e')](function(_0x8654b8){startRefreshInterval(_0x8654b8);});});return Promise[_0x005b('0x51')](_0x140b44);})[_0x005b('0x49')](function(_0x4c0e68){var _0xbad772=_0x4c0e68?util[_0x005b('0x52')](_0x4c0e68,{'showHidden':![],'depth':null}):'';logger[_0x005b('0x53')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0xbad772);});}module[_0x005b('0x54')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xaf24=['refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','join','Outlook365','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','response_mode','scope','state','prompt','key','oauth2/','set','decode','payload','iss','issuer','aud','nonce','unix','data3','CloudProvider','findOne','then'];(function(_0x40a206,_0x46f2c2){var _0x52dabc=function(_0x5c354b){while(--_0x5c354b){_0x40a206['push'](_0x40a206['shift']());}};_0x52dabc(++_0x46f2c2);}(_0xaf24,0x18d));var _0x4af2=function(_0x55b728,_0xe943c2){_0x55b728=_0x55b728-0x0;var _0x54773f=_0xaf24[_0x55b728];return _0x54773f;};'use strict';var _=require(_0x4af2('0x0'));var crypto=require(_0x4af2('0x1'));var jwt=require(_0x4af2('0x2'));var moment=require(_0x4af2('0x3'));var Redis=require('ioredis');var rp=require(_0x4af2('0x4'));var util=require(_0x4af2('0x5'));var encryptor=require(_0x4af2('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x4af2('0x7'));var schedule=require(_0x4af2('0x8'));var db=require(_0x4af2('0x9'))['db'];config[_0x4af2('0xa')]=_[_0x4af2('0xb')](config[_0x4af2('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x4af2('0xa')]);var MICROSOFT_AUTH_URL=_0x4af2('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4af2('0xd'),_0x4af2('0xe'),'email',_0x4af2('0xf'),_0x4af2('0x10'),_0x4af2('0x11'),_0x4af2('0x12')],'Dynamics365':[_0x4af2('0xd'),_0x4af2('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x4af2('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x82b3b2){var _0x5ec76b=_[_0x4af2('0x14')](AZURE_AUTH_SCOPES[_0x82b3b2[_0x4af2('0x15')]]);if(_0x82b3b2[_0x4af2('0x15')]===_0x4af2('0x16'))_0x5ec76b[_0x4af2('0x17')](_0x82b3b2[_0x4af2('0x18')]+'/.default');return _0x5ec76b[_0x4af2('0x19')]('\x20');}function getAccessTokenScope(_0x41b8b7){if(_0x41b8b7[_0x4af2('0x15')]===_0x4af2('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x41b8b7[_0x4af2('0x15')]===_0x4af2('0x16'))return _0x41b8b7['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x533031,_0x464129){var _0x676bfa=MICROSOFT_AUTH_URL[_0x4af2('0x1b')]('{TENANT_ID}',_0x533031[_0x4af2('0x1c')]);var _0x345d40=[_0x4af2('0x1d'),_0x4af2('0x1e')];var _0x17c20c=Buffer[_0x4af2('0x1f')](JSON[_0x4af2('0x20')]({'id':_0x464129}))[_0x4af2('0x21')](_0x4af2('0x22'));var _0x2f07d2=crypto[_0x4af2('0x23')](0x10)[_0x4af2('0x21')](_0x4af2('0x24'));var _0x2e54cc=getAuthorizationScopes(_0x533031);var _0x431b98=[{'key':_0x4af2('0x25'),'value':_0x533031[_0x4af2('0x26')]},{'key':_0x4af2('0x27'),'value':encodeURIComponent(_0x345d40['join']('\x20'))},{'key':'redirect_uri','value':_0x533031[_0x4af2('0x28')]},{'key':_0x4af2('0x29'),'value':'form_post'},{'key':_0x4af2('0x2a'),'value':encodeURIComponent(_0x2e54cc)},{'key':_0x4af2('0x2b'),'value':_0x17c20c},{'key':'nonce','value':_0x2f07d2},{'key':_0x4af2('0x2c'),'value':'login'}];var _0xf810a=_0x676bfa+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4af2('0x14')](_0x431b98,function(_0x3b896e){return _0x3b896e[_0x4af2('0x2d')]+'='+_0x3b896e['value'];})[_0x4af2('0x19')]('&');_0x533031['oauth2Claims']={'issuer':_0x676bfa[_0x4af2('0x1b')](_0x4af2('0x2e'),''),'audience':_0x533031[_0x4af2('0x26')],'state':_0x17c20c,'nonce':_0x2f07d2};redis[_0x4af2('0x2f')](_0x17c20c,JSON[_0x4af2('0x20')](_0x533031));return _0xf810a;}function isValidIdToken(_0x9f4dfe,_0x49f395){try{var _0x356bcb=jwt[_0x4af2('0x30')](_0x9f4dfe,{'complete':!![]});var _0x50ea97=_0x356bcb[_0x4af2('0x31')];if(_0x50ea97[_0x4af2('0x32')]!==_0x49f395[_0x4af2('0x33')])return![];if(_0x50ea97[_0x4af2('0x34')]!==_0x49f395['audience'])return![];if(_0x50ea97[_0x4af2('0x35')]!==_0x49f395[_0x4af2('0x35')])return![];if(moment()['isAfter'](moment[_0x4af2('0x36')](_0x50ea97['exp'])))return![];return!![];}catch(_0x5ee3e9){throw _0x5ee3e9;}}function refreshOauth2MicrosoftAccessToken(_0x100129){return Promise['resolve']()['then'](function(){if(_0x100129[_0x4af2('0x37')])return _0x100129;return db[_0x4af2('0x38')][_0x4af2('0x39')]({'where':{'id':_0x100129['id']},'raw':!![]});})[_0x4af2('0x3a')](function(_0x8c9fc0){var _0x59fa10={'grant_type':_0x4af2('0x3b'),'refresh_token':_0x8c9fc0[_0x4af2('0x3c')],'scope':getAccessTokenScope(_0x8c9fc0),'redirect_uri':_0x8c9fc0['data4'],'client_id':_0x8c9fc0[_0x4af2('0x26')],'client_secret':encryptor[_0x4af2('0x3d')](_0x8c9fc0[_0x4af2('0x37')])};var _0x443e6b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x4af2('0x1b')](_0x4af2('0x3e'),_0x8c9fc0[_0x4af2('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x59fa10,'json':!![]};return rp(_0x443e6b);})[_0x4af2('0x3a')](function(_0x4ff0d1){_0x100129[_0x4af2('0x3f')]=_0x4ff0d1[_0x4af2('0x40')];_0x100129[_0x4af2('0x3c')]=_0x4ff0d1[_0x4af2('0x3b')];return db[_0x4af2('0x38')][_0x4af2('0x41')]({'data5':_0x100129[_0x4af2('0x3f')],'data6':_0x100129[_0x4af2('0x3c')]},{'where':{'id':_0x100129['id']}});})[_0x4af2('0x3a')](function(){return _0x100129;})[_0x4af2('0x42')](function(_0x139d20){logger[_0x4af2('0x43')](_0x4af2('0x44'),_0x100129['id'],_0x139d20);});}function getOauth2MicrosoftAccessToken(_0x461c7a,_0x21501b){var _0xf711c5={'grant_type':_0x4af2('0x45'),'code':_0x461c7a,'scope':getAccessTokenScope(_0x21501b),'redirect_uri':_0x21501b[_0x4af2('0x28')],'client_id':_0x21501b[_0x4af2('0x26')],'client_secret':encryptor['decryptString'](_0x21501b[_0x4af2('0x37')])};var _0x1069ee={'method':_0x4af2('0x46'),'uri':MICROSOFT_AUTH_URL[_0x4af2('0x1b')]('{TENANT_ID}',_0x21501b[_0x4af2('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf711c5,'json':!![]};return rp(_0x1069ee);}function startRefreshInterval(_0x1fabad){var _0x41d9fd=schedule[_0x4af2('0x47')];if(_0x41d9fd[_0x1fabad['id']])clearInterval(_0x41d9fd[_0x1fabad['id']]);_0x41d9fd[_0x1fabad['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4af2('0x48')](this,{'id':_0x1fabad['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x41d9fd;}function startAllRefreshIntervals(){return db[_0x4af2('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4af2('0x3a')](function(_0x11095e){var _0x32ac8d=_0x11095e[_0x4af2('0x14')](function(_0x10974b){return refreshOauth2MicrosoftAccessToken(_0x10974b)[_0x4af2('0x3a')](function(_0x4f156b){startRefreshInterval(_0x4f156b);});});return Promise[_0x4af2('0x49')](_0x32ac8d);})[_0x4af2('0x42')](function(_0x17c225){var _0x5c9c4e=_0x17c225?util[_0x4af2('0x4a')](_0x17c225,{'showHidden':![],'depth':null}):'';logger[_0x4af2('0x43')](_0x4af2('0x4b'),_0x5c9c4e);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index b126d55..1aee72e 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 _0x964b=['../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0xd5009a,_0x2a0b5b){var _0x34953f=function(_0x55373c){while(--_0x55373c){_0xd5009a['push'](_0xd5009a['shift']());}};_0x34953f(++_0x2a0b5b);}(_0x964b,0x112));var _0xb964=function(_0x4bb8a6,_0x4ee996){_0x4bb8a6=_0x4bb8a6-0x0;var _0x2b5ea2=_0x964b[_0x4bb8a6];return _0x2b5ea2;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var moment=require('moment');var BPromise=require(_0xb964('0x2'));var rs=require(_0xb964('0x3'));var fs=require('fs');var Redis=require(_0xb964('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb964('0x5'))('rpc');var config=require(_0xb964('0x6'));var jayson=require(_0xb964('0x7'));var client=jayson[_0xb964('0x8')][_0xb964('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x204c7d,_0xde47d5,_0x3fe401){return new BPromise(function(_0x53b463,_0x58e49e){return client[_0xb964('0xa')](_0x204c7d,_0x3fe401)['then'](function(_0x55e697){logger[_0xb964('0xb')](_0xb964('0xc'),_0xde47d5,_0xb964('0xd'));logger[_0xb964('0xe')](_0xb964('0xf'),_0xde47d5,_0xb964('0xd'),JSON['stringify'](_0x55e697));if(_0x55e697[_0xb964('0x10')]){if(_0x55e697[_0xb964('0x10')][_0xb964('0x11')]===0x1f4){logger[_0xb964('0x10')]('CloudProvider,\x20%s,\x20%s',_0xde47d5,_0x55e697[_0xb964('0x10')]['message']);return _0x58e49e(_0x55e697['error'][_0xb964('0x12')]);}logger[_0xb964('0x10')](_0xb964('0xc'),_0xde47d5,_0x55e697[_0xb964('0x10')][_0xb964('0x12')]);return _0x53b463(_0x55e697[_0xb964('0x10')][_0xb964('0x12')]);}else{logger['info'](_0xb964('0xc'),_0xde47d5,'request\x20sent');_0x53b463(_0x55e697['result'][_0xb964('0x12')]);}})[_0xb964('0x13')](function(_0x26aa2c){logger[_0xb964('0x10')](_0xb964('0xc'),_0xde47d5,_0x26aa2c);_0x58e49e(_0x26aa2c);});});}
\ No newline at end of file
+var _0x3c91=['client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x3c91,0x1af));var _0x13c9=function(_0x4c45d4,_0x388987){_0x4c45d4=_0x4c45d4-0x0;var _0x1ee8be=_0x3c91[_0x4c45d4];return _0x1ee8be;};'use strict';var _=require(_0x13c9('0x0'));var util=require(_0x13c9('0x1'));var moment=require(_0x13c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c9('0x3'));var db=require(_0x13c9('0x4'))['db'];var utils=require(_0x13c9('0x5'));var logger=require('../../config/logger')(_0x13c9('0x6'));var config=require(_0x13c9('0x7'));var jayson=require(_0x13c9('0x8'));var client=jayson[_0x13c9('0x9')][_0x13c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4332,_0x58b610,_0x44243f){return new BPromise(function(_0x196c2a,_0x5fd23){return client[_0x13c9('0xb')](_0x4c4332,_0x44243f)[_0x13c9('0xc')](function(_0x5370dd){logger['info'](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58b610,_0x13c9('0xe'),JSON[_0x13c9('0xf')](_0x5370dd));if(_0x5370dd[_0x13c9('0x10')]){if(_0x5370dd[_0x13c9('0x10')][_0x13c9('0x11')]===0x1f4){logger[_0x13c9('0x10')](_0x13c9('0xd'),_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x5fd23(_0x5370dd['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58b610,_0x5370dd['error'][_0x13c9('0x12')]);return _0x196c2a(_0x5370dd[_0x13c9('0x10')]['message']);}else{logger[_0x13c9('0x13')](_0x13c9('0xd'),_0x58b610,_0x13c9('0xe'));_0x196c2a(_0x5370dd[_0x13c9('0x14')][_0x13c9('0x12')]);}})[_0x13c9('0x15')](function(_0x238952){logger['error']('CloudProvider,\x20%s,\x20%s',_0x58b610,_0x238952);_0x5fd23(_0x238952);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 0f71324..5b05a45 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x5f2f,0x73));var _0xf5f2=function(_0x466994,_0x29ebad){_0x466994=_0x466994-0x0;var _0x5157de=_0x5f2f[_0x466994];return _0x5157de;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x11fc7b,_0x1434e6){var _0x4080e6=function(_0x54ccb0){while(--_0x54ccb0){_0x11fc7b['push'](_0x11fc7b['shift']());}};_0x4080e6(++_0x1434e6);}(_0xdb28,0x106));var _0x8db2=function(_0x4b1edb,_0x39f6d6){_0x4b1edb=_0x4b1edb-0x0;var _0x1c7bb9=_0xdb28[_0x4b1edb];return _0x1c7bb9;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index afd1baa..b965a78 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 _0x8137=['STRING','sequelize'];(function(_0x527628,_0x52c09d){var _0x2d67fd=function(_0x1fe6ec){while(--_0x1fe6ec){_0x527628['push'](_0x527628['shift']());}};_0x2d67fd(++_0x52c09d);}(_0x8137,0x16b));var _0x7813=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x8137[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0x7813('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x7813('0x1')]},'website':{'type':Sequelize[_0x7813('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7813('0x1')]},'city':{'type':Sequelize[_0x7813('0x1')]},'country':{'type':Sequelize[_0x7813('0x1')]},'email':{'type':Sequelize[_0x7813('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7813('0x1')]},'sStreet':{'type':Sequelize[_0x7813('0x1')]},'sPostalCode':{'type':Sequelize[_0x7813('0x1')]},'sCity':{'type':Sequelize[_0x7813('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd6b4=['sequelize','exports','STRING'];(function(_0xd8fc2d,_0x1c3f81){var _0x281c9e=function(_0x4df715){while(--_0x4df715){_0xd8fc2d['push'](_0xd8fc2d['shift']());}};_0x281c9e(++_0x1c3f81);}(_0xd6b4,0xb4));var _0x4d6b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd6b4[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x4d6b('0x0'));module[_0x4d6b('0x1')]={'name':{'type':Sequelize[_0x4d6b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4d6b('0x2')]},'companyId':{'type':Sequelize[_0x4d6b('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4d6b('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4d6b('0x2')]},'street':{'type':Sequelize[_0x4d6b('0x2')]},'postalCode':{'type':Sequelize[_0x4d6b('0x2')]},'city':{'type':Sequelize[_0x4d6b('0x2')]},'country':{'type':Sequelize[_0x4d6b('0x2')]},'email':{'type':Sequelize[_0x4d6b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4d6b('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4d6b('0x2')]},'sCountry':{'type':Sequelize[_0x4d6b('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 2a23534..b959d78 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 _0x1cd3=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','stack','name','send','index','CmCompany','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','model','fields','length','options','find'];(function(_0x38855c,_0x2d9ec8){var _0x2fa7f8=function(_0x1295c9){while(--_0x1295c9){_0x38855c['push'](_0x38855c['shift']());}};_0x2fa7f8(++_0x2d9ec8);}(_0x1cd3,0xbf));var _0x31cd=function(_0x5e9a7e,_0x531ed7){_0x5e9a7e=_0x5e9a7e-0x0;var _0x1ec42c=_0x1cd3[_0x5e9a7e];return _0x1ec42c;};'use strict';var emlformat=require(_0x31cd('0x0'));var rimraf=require(_0x31cd('0x1'));var zipdir=require(_0x31cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31cd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x31cd('0x4'));var util=require(_0x31cd('0x5'));var path=require(_0x31cd('0x6'));var sox=require(_0x31cd('0x7'));var csv=require(_0x31cd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x31cd('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x31cd('0xa'));var deskjs=require(_0x31cd('0xb'));var toCsv=require(_0x31cd('0x8'));var querystring=require('querystring');var Papa=require(_0x31cd('0xc'));var Redis=require(_0x31cd('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x31cd('0xe'));var hardwareService=require(_0x31cd('0xf'));var logger=require(_0x31cd('0x10'))(_0x31cd('0x11'));var utils=require('../../config/utils');var config=require(_0x31cd('0x12'));var licenseUtil=require(_0x31cd('0x13'));var db=require(_0x31cd('0x14'))['db'];function respondWithStatusCode(_0x24268f,_0x937e5c){_0x937e5c=_0x937e5c||0xcc;return function(_0x163e51){if(_0x163e51){return _0x24268f['sendStatus'](_0x937e5c);}return _0x24268f['status'](_0x937e5c)['end']();};}function respondWithResult(_0x19706d,_0x4eb70d){_0x4eb70d=_0x4eb70d||0xc8;return function(_0x1f3cb8){if(_0x1f3cb8){return _0x19706d[_0x31cd('0x15')](_0x4eb70d)[_0x31cd('0x16')](_0x1f3cb8);}};}function respondWithFilteredResult(_0x246522,_0x573ca6){return function(_0x4450e2){if(_0x4450e2){var _0x3a9dc9=typeof _0x573ca6[_0x31cd('0x17')]===_0x31cd('0x18')&&typeof _0x573ca6[_0x31cd('0x19')]===_0x31cd('0x18');var _0x549573=_0x4450e2['count'];var _0x4efb28=_0x3a9dc9?0x0:_0x573ca6[_0x31cd('0x17')];var _0x20f92e=_0x3a9dc9?_0x4450e2['count']:_0x573ca6[_0x31cd('0x17')]+_0x573ca6[_0x31cd('0x19')];var _0x26b1f9;if(_0x20f92e>=_0x549573){_0x20f92e=_0x549573;_0x26b1f9=0xc8;}else{_0x26b1f9=0xce;}_0x246522[_0x31cd('0x15')](_0x26b1f9);return _0x246522[_0x31cd('0x1a')](_0x31cd('0x1b'),_0x4efb28+'-'+_0x20f92e+'/'+_0x549573)[_0x31cd('0x16')](_0x4450e2);}return null;};}function patchUpdates(_0x276a13){return function(_0x21bd1d){try{jsonpatch['apply'](_0x21bd1d,_0x276a13,!![]);}catch(_0x3e2bd4){return BPromise[_0x31cd('0x1c')](_0x3e2bd4);}return _0x21bd1d[_0x31cd('0x1d')]();};}function saveUpdates(_0x5e8d41,_0x5041e6){return function(_0x135c39){if(_0x135c39){return _0x135c39[_0x31cd('0x1e')](_0x5e8d41)[_0x31cd('0x1f')](function(_0x3928b3){return _0x3928b3;});}return null;};}function removeEntity(_0x535cb1,_0x233ac2){return function(_0x334a02){if(_0x334a02){return _0x334a02[_0x31cd('0x20')]()[_0x31cd('0x1f')](function(){var _0x4b3237=_0x334a02[_0x31cd('0x21')]({'plain':!![]});var _0x5499e2=_0x31cd('0x22');return db[_0x31cd('0x23')]['destroy']({'where':{'type':_0x5499e2,'resourceId':_0x4b3237['id']}})[_0x31cd('0x1f')](function(){return _0x334a02;});})[_0x31cd('0x1f')](function(){_0x535cb1['status'](0xcc)[_0x31cd('0x24')]();});}};}function handleEntityNotFound(_0x1db61a,_0x5d60b9){return function(_0x2b423e){if(!_0x2b423e){_0x1db61a['sendStatus'](0x194);}return _0x2b423e;};}function handleError(_0x1a4aaa,_0xa2fa87){_0xa2fa87=_0xa2fa87||0x1f4;return function(_0x20ea31){logger['error'](_0x20ea31[_0x31cd('0x25')]);if(_0x20ea31['name']){delete _0x20ea31[_0x31cd('0x26')];}_0x1a4aaa[_0x31cd('0x15')](_0xa2fa87)[_0x31cd('0x27')](_0x20ea31);};}exports[_0x31cd('0x28')]=function(_0x15d675,_0x44b59d){var _0x131816={},_0x3e174c={},_0x2909d2={'count':0x0,'rows':[]};return db[_0x31cd('0x29')]['describe']()[_0x31cd('0x1f')](function(_0x10f453){_0x3e174c['model']=_[_0x31cd('0x2a')](_0x10f453);_0x3e174c[_0x31cd('0x2b')]=_['keys'](_0x15d675['query']);_0x3e174c[_0x31cd('0x2c')]=_[_0x31cd('0x2d')](_0x3e174c['model'],_0x3e174c[_0x31cd('0x2b')]);_0x131816['attributes']=_['intersection'](_0x3e174c['model'],qs['fields'](_0x15d675[_0x31cd('0x2b')]['fields']));_0x131816[_0x31cd('0x2e')]=_0x131816['attributes']['length']?_0x131816[_0x31cd('0x2e')]:_0x3e174c['model'];if(!_0x15d675[_0x31cd('0x2b')][_0x31cd('0x2f')](_0x31cd('0x30'))){_0x131816[_0x31cd('0x19')]=qs[_0x31cd('0x19')](_0x15d675['query']['limit']);_0x131816['offset']=qs[_0x31cd('0x17')](_0x15d675[_0x31cd('0x2b')][_0x31cd('0x17')]);}_0x131816[_0x31cd('0x31')]=qs[_0x31cd('0x32')](_0x15d675['query'][_0x31cd('0x32')]);_0x131816[_0x31cd('0x33')]=qs[_0x31cd('0x2c')](_[_0x31cd('0x34')](_0x15d675[_0x31cd('0x2b')],_0x3e174c[_0x31cd('0x2c')]),_0x10f453);if(_0x15d675[_0x31cd('0x2b')][_0x31cd('0x35')]){_0x131816[_0x31cd('0x33')]=_[_0x31cd('0x36')](_0x131816[_0x31cd('0x33')],{'$or':_[_0x31cd('0x37')](_0x131816[_0x31cd('0x2e')],function(_0x20254c){var _0x3fe8c2={};_0x3fe8c2[_0x20254c]={'$like':'%'+_0x15d675['query']['filter']+'%'};return _0x3fe8c2;})});}_0x131816=_[_0x31cd('0x36')]({},_0x131816,_0x15d675['options']);var _0xb359d6={'where':_0x131816[_0x31cd('0x33')]};return db['CmCompany'][_0x31cd('0x38')](_0xb359d6)['then'](function(_0x2cbdff){_0x2909d2[_0x31cd('0x38')]=_0x2cbdff;if(_0x15d675[_0x31cd('0x2b')][_0x31cd('0x39')]){_0x131816[_0x31cd('0x3a')]=[{'all':!![]}];}return db[_0x31cd('0x29')][_0x31cd('0x3b')](_0x131816);})[_0x31cd('0x1f')](function(_0x41c895){_0x2909d2[_0x31cd('0x3c')]=_0x41c895;return _0x2909d2;})[_0x31cd('0x1f')](respondWithFilteredResult(_0x44b59d,_0x131816))[_0x31cd('0x3d')](handleError(_0x44b59d,null));})['catch'](handleError(_0x44b59d,null));};exports[_0x31cd('0x3e')]=function(_0x3fa0c1,_0x2ff4cf){var _0x2dd58e={'raw':![],'where':{'id':_0x3fa0c1[_0x31cd('0x3f')]['id']}},_0x124b9d={};_0x124b9d['model']=_['keys'](db[_0x31cd('0x29')][_0x31cd('0x40')]);_0x124b9d[_0x31cd('0x2b')]=_['keys'](_0x3fa0c1['query']);_0x124b9d['filters']=_['intersection'](_0x124b9d[_0x31cd('0x41')],_0x124b9d['query']);_0x2dd58e[_0x31cd('0x2e')]=_[_0x31cd('0x2d')](_0x124b9d[_0x31cd('0x41')],qs[_0x31cd('0x42')](_0x3fa0c1['query'][_0x31cd('0x42')]));_0x2dd58e['attributes']=_0x2dd58e[_0x31cd('0x2e')][_0x31cd('0x43')]?_0x2dd58e['attributes']:_0x124b9d['model'];if(_0x3fa0c1[_0x31cd('0x2b')][_0x31cd('0x39')]){_0x2dd58e[_0x31cd('0x3a')]=[{'all':!![]}];}_0x2dd58e=_[_0x31cd('0x36')]({},_0x2dd58e,_0x3fa0c1[_0x31cd('0x44')]);return db[_0x31cd('0x29')][_0x31cd('0x45')](_0x2dd58e)[_0x31cd('0x1f')](handleEntityNotFound(_0x2ff4cf,null))[_0x31cd('0x1f')](respondWithResult(_0x2ff4cf,null))[_0x31cd('0x3d')](handleError(_0x2ff4cf,null));};exports[_0x31cd('0x46')]=function(_0x4beb14,_0x4eb6b0){return db[_0x31cd('0x29')][_0x31cd('0x46')](_0x4beb14[_0x31cd('0x47')],{})['then'](function(_0x18ba8b){var _0x213190=_0x4beb14[_0x31cd('0x48')][_0x31cd('0x21')]({'plain':!![]});if(!_0x213190)throw new Error(_0x31cd('0x49'));if(_0x213190[_0x31cd('0x4a')]===_0x31cd('0x48')){var _0x4bc398=_0x18ba8b[_0x31cd('0x21')]({'plain':!![]});var _0x39b572=_0x31cd('0x22');return db[_0x31cd('0x4b')]['find']({'where':{'name':_0x39b572,'userProfileId':_0x213190[_0x31cd('0x4c')]},'raw':!![]})['then'](function(_0x5296d0){if(_0x5296d0&&_0x5296d0[_0x31cd('0x4d')]===0x0){return db['UserProfileResource'][_0x31cd('0x46')]({'name':_0x4bc398[_0x31cd('0x26')],'resourceId':_0x4bc398['id'],'type':_0x5296d0[_0x31cd('0x26')],'sectionId':_0x5296d0['id']},{})[_0x31cd('0x1f')](function(){return _0x18ba8b;});}else{return _0x18ba8b;}})[_0x31cd('0x3d')](function(_0x2873b9){logger[_0x31cd('0x4e')](_0x31cd('0x4f'),_0x2873b9);throw _0x2873b9;});}return _0x18ba8b;})[_0x31cd('0x1f')](respondWithResult(_0x4eb6b0,0xc9))['catch'](handleError(_0x4eb6b0,null));};exports[_0x31cd('0x1e')]=function(_0x295ea9,_0x56be05){if(_0x295ea9[_0x31cd('0x47')]['id']){delete _0x295ea9[_0x31cd('0x47')]['id'];}return db[_0x31cd('0x29')][_0x31cd('0x45')]({'where':{'id':_0x295ea9[_0x31cd('0x3f')]['id']}})[_0x31cd('0x1f')](handleEntityNotFound(_0x56be05,null))['then'](saveUpdates(_0x295ea9[_0x31cd('0x47')],null))[_0x31cd('0x1f')](respondWithResult(_0x56be05,null))[_0x31cd('0x3d')](handleError(_0x56be05,null));};exports[_0x31cd('0x20')]=function(_0x88dd47,_0x174d98){return db['CmCompany']['find']({'where':{'id':_0x88dd47[_0x31cd('0x3f')]['id']}})[_0x31cd('0x1f')](handleEntityNotFound(_0x174d98,null))[_0x31cd('0x1f')](removeEntity(_0x174d98,null))['catch'](handleError(_0x174d98,null));};exports['describe']=function(_0x59fc08,_0x536c81){return db[_0x31cd('0x29')][_0x31cd('0x50')]()['then'](respondWithResult(_0x536c81,null))['catch'](handleError(_0x536c81,null));};exports[_0x31cd('0x51')]=function(_0xfbdb35,_0x19dd68,_0x333bd8){return db[_0x31cd('0x52')][_0x31cd('0x45')]({'where':{'id':_0xfbdb35['params']['id']}})[_0x31cd('0x1f')](handleEntityNotFound(_0x19dd68,null))[_0x31cd('0x1f')](function(_0x59c362){if(_0x59c362){return _0x59c362['addContacts'](_0xfbdb35[_0x31cd('0x47')][_0x31cd('0x53')],_[_0x31cd('0x54')](_0xfbdb35[_0x31cd('0x47')],[_0x31cd('0x53'),'id'])||{});}})['then'](respondWithResult(_0x19dd68,null))[_0x31cd('0x3d')](handleError(_0x19dd68,null));};exports[_0x31cd('0x55')]=function(_0x4e6664,_0x26c0ef,_0x48ab97){var _0x584efe={};var _0x24d455={};var _0x54c1fb;var _0x413726;return db['CmCompany'][_0x31cd('0x56')]({'where':{'id':_0x4e6664[_0x31cd('0x3f')]['id']}})['then'](handleEntityNotFound(_0x26c0ef,null))['then'](function(_0x5c7c4e){if(_0x5c7c4e){_0x54c1fb=_0x5c7c4e;_0x24d455[_0x31cd('0x41')]=_[_0x31cd('0x2a')](db['CmContact'][_0x31cd('0x40')]);_0x24d455[_0x31cd('0x2b')]=_['keys'](_0x4e6664['query']);_0x24d455[_0x31cd('0x2c')]=_[_0x31cd('0x2d')](_0x24d455[_0x31cd('0x41')],_0x24d455[_0x31cd('0x2b')]);_0x584efe[_0x31cd('0x2e')]=_[_0x31cd('0x2d')](_0x24d455[_0x31cd('0x41')],qs[_0x31cd('0x42')](_0x4e6664['query'][_0x31cd('0x42')]));_0x584efe[_0x31cd('0x2e')]=_0x584efe[_0x31cd('0x2e')][_0x31cd('0x43')]?_0x584efe[_0x31cd('0x2e')]:_0x24d455[_0x31cd('0x41')];_0x584efe['order']=qs[_0x31cd('0x32')](_0x4e6664[_0x31cd('0x2b')][_0x31cd('0x32')]);_0x584efe[_0x31cd('0x33')]=qs[_0x31cd('0x2c')](_[_0x31cd('0x34')](_0x4e6664[_0x31cd('0x2b')],_0x24d455[_0x31cd('0x2c')]));if(_0x4e6664[_0x31cd('0x2b')][_0x31cd('0x35')]){_0x584efe[_0x31cd('0x33')]=_[_0x31cd('0x36')](_0x584efe[_0x31cd('0x33')],{'$or':_[_0x31cd('0x37')](_0x584efe[_0x31cd('0x2e')],function(_0x3c5e31){var _0xe7f42e={};_0xe7f42e[_0x3c5e31]={'$like':'%'+_0x4e6664[_0x31cd('0x2b')][_0x31cd('0x35')]+'%'};return _0xe7f42e;})});}_0x584efe=_[_0x31cd('0x36')]({},_0x584efe,_0x4e6664[_0x31cd('0x44')]);return _0x54c1fb[_0x31cd('0x55')](_0x584efe);}})[_0x31cd('0x1f')](function(_0x44d75a){if(_0x44d75a){_0x413726=_0x44d75a[_0x31cd('0x43')];if(!_0x4e6664[_0x31cd('0x2b')][_0x31cd('0x2f')](_0x31cd('0x30'))){_0x584efe[_0x31cd('0x19')]=qs[_0x31cd('0x19')](_0x4e6664[_0x31cd('0x2b')][_0x31cd('0x19')]);_0x584efe[_0x31cd('0x17')]=qs['offset'](_0x4e6664['query']['offset']);}return _0x54c1fb[_0x31cd('0x55')](_0x584efe);}})[_0x31cd('0x1f')](function(_0x3b31b6){if(_0x3b31b6){return _0x3b31b6?{'count':_0x413726,'rows':_0x3b31b6}:null;}})[_0x31cd('0x1f')](respondWithResult(_0x26c0ef,null))['catch'](handleError(_0x26c0ef,null));};
\ No newline at end of file
+var _0x99ee=['role','userProfileId','autoAssociation','UserProfileResource','params','addContacts','CmContact','ids','getContacts','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','destroy','get','Companies','then','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x522a0c,_0x32ba4e){var _0x194106=function(_0x5691ac){while(--_0x5691ac){_0x522a0c['push'](_0x522a0c['shift']());}};_0x194106(++_0x32ba4e);}(_0x99ee,0x157));var _0xe99e=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x99ee[_0xaa6a4];return _0xdc31a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe99e('0x0'));var zipdir=require(_0xe99e('0x1'));var jsonpatch=require(_0xe99e('0x2'));var rp=require(_0xe99e('0x3'));var moment=require('moment');var BPromise=require(_0xe99e('0x4'));var Mustache=require('mustache');var util=require(_0xe99e('0x5'));var path=require('path');var sox=require(_0xe99e('0x6'));var csv=require(_0xe99e('0x7'));var ejs=require(_0xe99e('0x8'));var fs=require('fs');var fs_extra=require(_0xe99e('0x9'));var _=require(_0xe99e('0xa'));var squel=require('squel');var crypto=require(_0xe99e('0xb'));var jsforce=require(_0xe99e('0xc'));var deskjs=require(_0xe99e('0xd'));var toCsv=require(_0xe99e('0x7'));var querystring=require('querystring');var Papa=require(_0xe99e('0xe'));var Redis=require(_0xe99e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe99e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe99e('0x11'))(_0xe99e('0x12'));var utils=require(_0xe99e('0x13'));var config=require(_0xe99e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe99e('0x15'))['db'];function respondWithStatusCode(_0x2aa1d9,_0x33ea2a){_0x33ea2a=_0x33ea2a||0xcc;return function(_0x27a3d4){if(_0x27a3d4){return _0x2aa1d9[_0xe99e('0x16')](_0x33ea2a);}return _0x2aa1d9[_0xe99e('0x17')](_0x33ea2a)[_0xe99e('0x18')]();};}function respondWithResult(_0x2c8f53,_0x53da2e){_0x53da2e=_0x53da2e||0xc8;return function(_0x2c3299){if(_0x2c3299){return _0x2c8f53['status'](_0x53da2e)['json'](_0x2c3299);}};}function respondWithFilteredResult(_0x1fb223,_0x17e057){return function(_0x528a05){if(_0x528a05){var _0x4b0ad6=typeof _0x17e057[_0xe99e('0x19')]===_0xe99e('0x1a')&&typeof _0x17e057[_0xe99e('0x1b')]===_0xe99e('0x1a');var _0x3156d3=_0x528a05['count'];var _0x54688f=_0x4b0ad6?0x0:_0x17e057[_0xe99e('0x19')];var _0x5e252c=_0x4b0ad6?_0x528a05[_0xe99e('0x1c')]:_0x17e057[_0xe99e('0x19')]+_0x17e057['limit'];var _0x540733;if(_0x5e252c>=_0x3156d3){_0x5e252c=_0x3156d3;_0x540733=0xc8;}else{_0x540733=0xce;}_0x1fb223['status'](_0x540733);return _0x1fb223['set'](_0xe99e('0x1d'),_0x54688f+'-'+_0x5e252c+'/'+_0x3156d3)['json'](_0x528a05);}return null;};}function patchUpdates(_0x29d840){return function(_0x33785f){try{jsonpatch['apply'](_0x33785f,_0x29d840,!![]);}catch(_0x28cff8){return BPromise[_0xe99e('0x1e')](_0x28cff8);}return _0x33785f[_0xe99e('0x1f')]();};}function saveUpdates(_0x10a9ec,_0x5cfd97){return function(_0xf32ac){if(_0xf32ac){return _0xf32ac['update'](_0x10a9ec)['then'](function(_0x271f28){return _0x271f28;});}return null;};}function removeEntity(_0xabe043,_0x432ce1){return function(_0x43360b){if(_0x43360b){return _0x43360b[_0xe99e('0x20')]()['then'](function(){var _0x442365=_0x43360b[_0xe99e('0x21')]({'plain':!![]});var _0x3b3a9a=_0xe99e('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b3a9a,'resourceId':_0x442365['id']}})[_0xe99e('0x23')](function(){return _0x43360b;});})[_0xe99e('0x23')](function(){_0xabe043['status'](0xcc)[_0xe99e('0x18')]();});}};}function handleEntityNotFound(_0x209ea7,_0x54a5ba){return function(_0x12bf5c){if(!_0x12bf5c){_0x209ea7[_0xe99e('0x16')](0x194);}return _0x12bf5c;};}function handleError(_0x21711b,_0x79edd9){_0x79edd9=_0x79edd9||0x1f4;return function(_0x139ab3){logger[_0xe99e('0x24')](_0x139ab3[_0xe99e('0x25')]);if(_0x139ab3[_0xe99e('0x26')]){delete _0x139ab3['name'];}_0x21711b[_0xe99e('0x17')](_0x79edd9)[_0xe99e('0x27')](_0x139ab3);};}exports[_0xe99e('0x28')]=function(_0x566e39,_0x38082e){var _0x9da73d={},_0x2c8c62={},_0x37a374={'count':0x0,'rows':[]};return db[_0xe99e('0x29')][_0xe99e('0x2a')]()[_0xe99e('0x23')](function(_0x2e0c54){_0x2c8c62[_0xe99e('0x2b')]=_['keys'](_0x2e0c54);_0x2c8c62[_0xe99e('0x2c')]=_[_0xe99e('0x2d')](_0x566e39[_0xe99e('0x2c')]);_0x2c8c62[_0xe99e('0x2e')]=_[_0xe99e('0x2f')](_0x2c8c62[_0xe99e('0x2b')],_0x2c8c62[_0xe99e('0x2c')]);_0x9da73d['attributes']=_[_0xe99e('0x2f')](_0x2c8c62[_0xe99e('0x2b')],qs[_0xe99e('0x30')](_0x566e39['query'][_0xe99e('0x30')]));_0x9da73d[_0xe99e('0x31')]=_0x9da73d['attributes'][_0xe99e('0x32')]?_0x9da73d[_0xe99e('0x31')]:_0x2c8c62[_0xe99e('0x2b')];if(!_0x566e39[_0xe99e('0x2c')][_0xe99e('0x33')]('nolimit')){_0x9da73d[_0xe99e('0x1b')]=qs[_0xe99e('0x1b')](_0x566e39['query'][_0xe99e('0x1b')]);_0x9da73d[_0xe99e('0x19')]=qs[_0xe99e('0x19')](_0x566e39[_0xe99e('0x2c')][_0xe99e('0x19')]);}_0x9da73d[_0xe99e('0x34')]=qs[_0xe99e('0x35')](_0x566e39['query'][_0xe99e('0x35')]);_0x9da73d[_0xe99e('0x36')]=qs[_0xe99e('0x2e')](_[_0xe99e('0x37')](_0x566e39['query'],_0x2c8c62[_0xe99e('0x2e')]),_0x2e0c54);if(_0x566e39[_0xe99e('0x2c')][_0xe99e('0x38')]){_0x9da73d[_0xe99e('0x36')]=_[_0xe99e('0x39')](_0x9da73d[_0xe99e('0x36')],{'$or':_[_0xe99e('0x3a')](_0x9da73d[_0xe99e('0x31')],function(_0x21fa60){var _0x49c70a={};_0x49c70a[_0x21fa60]={'$like':'%'+_0x566e39['query']['filter']+'%'};return _0x49c70a;})});}_0x9da73d=_['merge']({},_0x9da73d,_0x566e39[_0xe99e('0x3b')]);var _0x411e5a={'where':_0x9da73d['where']};return db[_0xe99e('0x29')][_0xe99e('0x1c')](_0x411e5a)[_0xe99e('0x23')](function(_0x4b788b){_0x37a374['count']=_0x4b788b;if(_0x566e39[_0xe99e('0x2c')][_0xe99e('0x3c')]){_0x9da73d[_0xe99e('0x3d')]=[{'all':!![]}];}return db[_0xe99e('0x29')][_0xe99e('0x3e')](_0x9da73d);})[_0xe99e('0x23')](function(_0x1f5af4){_0x37a374[_0xe99e('0x3f')]=_0x1f5af4;return _0x37a374;})[_0xe99e('0x23')](respondWithFilteredResult(_0x38082e,_0x9da73d))[_0xe99e('0x40')](handleError(_0x38082e,null));})['catch'](handleError(_0x38082e,null));};exports[_0xe99e('0x41')]=function(_0xdc4438,_0x4408fe){var _0x3cced4={'raw':![],'where':{'id':_0xdc4438['params']['id']}},_0x5c124d={};_0x5c124d[_0xe99e('0x2b')]=_[_0xe99e('0x2d')](db['CmCompany'][_0xe99e('0x42')]);_0x5c124d[_0xe99e('0x2c')]=_[_0xe99e('0x2d')](_0xdc4438['query']);_0x5c124d['filters']=_[_0xe99e('0x2f')](_0x5c124d[_0xe99e('0x2b')],_0x5c124d[_0xe99e('0x2c')]);_0x3cced4['attributes']=_[_0xe99e('0x2f')](_0x5c124d[_0xe99e('0x2b')],qs[_0xe99e('0x30')](_0xdc4438[_0xe99e('0x2c')][_0xe99e('0x30')]));_0x3cced4[_0xe99e('0x31')]=_0x3cced4[_0xe99e('0x31')]['length']?_0x3cced4[_0xe99e('0x31')]:_0x5c124d[_0xe99e('0x2b')];if(_0xdc4438[_0xe99e('0x2c')]['includeAll']){_0x3cced4[_0xe99e('0x3d')]=[{'all':!![]}];}_0x3cced4=_[_0xe99e('0x39')]({},_0x3cced4,_0xdc4438[_0xe99e('0x3b')]);return db[_0xe99e('0x29')][_0xe99e('0x43')](_0x3cced4)['then'](handleEntityNotFound(_0x4408fe,null))[_0xe99e('0x23')](respondWithResult(_0x4408fe,null))['catch'](handleError(_0x4408fe,null));};exports[_0xe99e('0x44')]=function(_0x52a010,_0x55ffc8){return db[_0xe99e('0x29')]['create'](_0x52a010[_0xe99e('0x45')],{})[_0xe99e('0x23')](function(_0x12554f){var _0xd558c4=_0x52a010[_0xe99e('0x46')][_0xe99e('0x21')]({'plain':!![]});if(!_0xd558c4)throw new Error(_0xe99e('0x47'));if(_0xd558c4[_0xe99e('0x48')]==='user'){var _0x71aa43=_0x12554f['get']({'plain':!![]});var _0x35f231=_0xe99e('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x35f231,'userProfileId':_0xd558c4[_0xe99e('0x49')]},'raw':!![]})[_0xe99e('0x23')](function(_0x9058d9){if(_0x9058d9&&_0x9058d9[_0xe99e('0x4a')]===0x0){return db[_0xe99e('0x4b')][_0xe99e('0x44')]({'name':_0x71aa43[_0xe99e('0x26')],'resourceId':_0x71aa43['id'],'type':_0x9058d9[_0xe99e('0x26')],'sectionId':_0x9058d9['id']},{})[_0xe99e('0x23')](function(){return _0x12554f;});}else{return _0x12554f;}})[_0xe99e('0x40')](function(_0x342fc0){logger[_0xe99e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x342fc0);throw _0x342fc0;});}return _0x12554f;})[_0xe99e('0x23')](respondWithResult(_0x55ffc8,0xc9))[_0xe99e('0x40')](handleError(_0x55ffc8,null));};exports['update']=function(_0x5928f3,_0x121492){if(_0x5928f3[_0xe99e('0x45')]['id']){delete _0x5928f3[_0xe99e('0x45')]['id'];}return db[_0xe99e('0x29')][_0xe99e('0x43')]({'where':{'id':_0x5928f3['params']['id']}})[_0xe99e('0x23')](handleEntityNotFound(_0x121492,null))[_0xe99e('0x23')](saveUpdates(_0x5928f3[_0xe99e('0x45')],null))[_0xe99e('0x23')](respondWithResult(_0x121492,null))['catch'](handleError(_0x121492,null));};exports[_0xe99e('0x20')]=function(_0xffa9e6,_0x36ad97){return db[_0xe99e('0x29')]['find']({'where':{'id':_0xffa9e6[_0xe99e('0x4c')]['id']}})[_0xe99e('0x23')](handleEntityNotFound(_0x36ad97,null))[_0xe99e('0x23')](removeEntity(_0x36ad97,null))['catch'](handleError(_0x36ad97,null));};exports['describe']=function(_0xd77be9,_0x230f02){return db[_0xe99e('0x29')]['describe']()[_0xe99e('0x23')](respondWithResult(_0x230f02,null))[_0xe99e('0x40')](handleError(_0x230f02,null));};exports[_0xe99e('0x4d')]=function(_0x27593e,_0x37cc70,_0x488457){return db[_0xe99e('0x4e')][_0xe99e('0x43')]({'where':{'id':_0x27593e[_0xe99e('0x4c')]['id']}})[_0xe99e('0x23')](handleEntityNotFound(_0x37cc70,null))[_0xe99e('0x23')](function(_0x155656){if(_0x155656){return _0x155656[_0xe99e('0x4d')](_0x27593e[_0xe99e('0x45')]['ids'],_['omit'](_0x27593e[_0xe99e('0x45')],[_0xe99e('0x4f'),'id'])||{});}})[_0xe99e('0x23')](respondWithResult(_0x37cc70,null))[_0xe99e('0x40')](handleError(_0x37cc70,null));};exports[_0xe99e('0x50')]=function(_0x199566,_0x28c495,_0x34b871){var _0x24ee36={};var _0x440343={};var _0x430678;var _0x23bc14;return db[_0xe99e('0x29')][_0xe99e('0x51')]({'where':{'id':_0x199566[_0xe99e('0x4c')]['id']}})[_0xe99e('0x23')](handleEntityNotFound(_0x28c495,null))[_0xe99e('0x23')](function(_0x32a3e7){if(_0x32a3e7){_0x430678=_0x32a3e7;_0x440343[_0xe99e('0x2b')]=_['keys'](db[_0xe99e('0x4e')][_0xe99e('0x42')]);_0x440343[_0xe99e('0x2c')]=_[_0xe99e('0x2d')](_0x199566[_0xe99e('0x2c')]);_0x440343[_0xe99e('0x2e')]=_[_0xe99e('0x2f')](_0x440343[_0xe99e('0x2b')],_0x440343[_0xe99e('0x2c')]);_0x24ee36[_0xe99e('0x31')]=_[_0xe99e('0x2f')](_0x440343[_0xe99e('0x2b')],qs[_0xe99e('0x30')](_0x199566[_0xe99e('0x2c')][_0xe99e('0x30')]));_0x24ee36['attributes']=_0x24ee36['attributes']['length']?_0x24ee36[_0xe99e('0x31')]:_0x440343['model'];_0x24ee36[_0xe99e('0x34')]=qs['sort'](_0x199566[_0xe99e('0x2c')][_0xe99e('0x35')]);_0x24ee36[_0xe99e('0x36')]=qs[_0xe99e('0x2e')](_['pick'](_0x199566['query'],_0x440343['filters']));if(_0x199566['query']['filter']){_0x24ee36[_0xe99e('0x36')]=_[_0xe99e('0x39')](_0x24ee36[_0xe99e('0x36')],{'$or':_['map'](_0x24ee36[_0xe99e('0x31')],function(_0x378753){var _0x42c9d1={};_0x42c9d1[_0x378753]={'$like':'%'+_0x199566[_0xe99e('0x2c')][_0xe99e('0x38')]+'%'};return _0x42c9d1;})});}_0x24ee36=_['merge']({},_0x24ee36,_0x199566[_0xe99e('0x3b')]);return _0x430678['getContacts'](_0x24ee36);}})[_0xe99e('0x23')](function(_0x5a7ea5){if(_0x5a7ea5){_0x23bc14=_0x5a7ea5[_0xe99e('0x32')];if(!_0x199566[_0xe99e('0x2c')][_0xe99e('0x33')](_0xe99e('0x52'))){_0x24ee36[_0xe99e('0x1b')]=qs['limit'](_0x199566[_0xe99e('0x2c')][_0xe99e('0x1b')]);_0x24ee36[_0xe99e('0x19')]=qs[_0xe99e('0x19')](_0x199566[_0xe99e('0x2c')][_0xe99e('0x19')]);}return _0x430678[_0xe99e('0x50')](_0x24ee36);}})[_0xe99e('0x23')](function(_0x308d20){if(_0x308d20){return _0x308d20?{'count':_0x23bc14,'rows':_0x308d20}:null;}})[_0xe99e('0x23')](respondWithResult(_0x28c495,null))[_0xe99e('0x40')](handleError(_0x28c495,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 7ee02bd..753c040 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 _0x6ad4=['util','../../config/logger','api','moment','request-promise','path','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x55d244,_0x3bf14d){var _0x422d81=function(_0x1bc601){while(--_0x1bc601){_0x55d244['push'](_0x55d244['shift']());}};_0x422d81(++_0x3bf14d);}(_0x6ad4,0xb0));var _0x46ad=function(_0x713a7a,_0x1b8603){_0x713a7a=_0x713a7a-0x0;var _0x5cd8b6=_0x6ad4[_0x713a7a];return _0x5cd8b6;};'use strict';var _=require('lodash');var util=require(_0x46ad('0x0'));var logger=require(_0x46ad('0x1'))(_0x46ad('0x2'));var moment=require(_0x46ad('0x3'));var BPromise=require('bluebird');var rp=require(_0x46ad('0x4'));var fs=require('fs');var path=require(_0x46ad('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x46ad('0x6'));module[_0x46ad('0x7')]=function(_0x2c0ae9,_0x2c54fd){return _0x2c0ae9[_0x46ad('0x8')](_0x46ad('0x9'),attributes,{'tableName':_0x46ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x49e9=['util','../../config/logger','request-promise','path','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x482ea4,_0x38e290){var _0x3e7cef=function(_0x41a909){while(--_0x41a909){_0x482ea4['push'](_0x482ea4['shift']());}};_0x3e7cef(++_0x38e290);}(_0x49e9,0x117));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var logger=require(_0x949e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x949e('0x3'));var fs=require('fs');var path=require(_0x949e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x949e('0x5'));module[_0x949e('0x6')]=function(_0x3e97da,_0x1958a2){return _0x3e97da[_0x949e('0x7')](_0x949e('0x8'),attributes,{'tableName':_0x949e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 9144cd7..57f0240 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 _0x6c04=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_0x6c04,0x78));var _0x46c0=function(_0x1aa188,_0x5a2c1b){_0x1aa188=_0x1aa188-0x0;var _0x40a8e3=_0x6c04[_0x1aa188];return _0x40a8e3;};'use strict';var _=require('lodash');var util=require(_0x46c0('0x0'));var moment=require(_0x46c0('0x1'));var BPromise=require(_0x46c0('0x2'));var rs=require(_0x46c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c0('0x4'))['db'];var utils=require(_0x46c0('0x5'));var logger=require(_0x46c0('0x6'))('rpc');var config=require(_0x46c0('0x7'));var jayson=require(_0x46c0('0x8'));var client=jayson['client'][_0x46c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x75c20b,_0x24f51f,_0x310f96){return new BPromise(function(_0x8f03b2,_0x3900fe){return client[_0x46c0('0xa')](_0x75c20b,_0x310f96)['then'](function(_0x4a6000){logger[_0x46c0('0xb')](_0x46c0('0xc'),_0x24f51f,_0x46c0('0xd'));logger[_0x46c0('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x24f51f,_0x46c0('0xd'),JSON['stringify'](_0x4a6000));if(_0x4a6000[_0x46c0('0xf')]){if(_0x4a6000[_0x46c0('0xf')][_0x46c0('0x10')]===0x1f4){logger[_0x46c0('0xf')]('CmCompany,\x20%s,\x20%s',_0x24f51f,_0x4a6000[_0x46c0('0xf')][_0x46c0('0x11')]);return _0x3900fe(_0x4a6000['error']['message']);}logger['error'](_0x46c0('0xc'),_0x24f51f,_0x4a6000[_0x46c0('0xf')][_0x46c0('0x11')]);return _0x8f03b2(_0x4a6000['error']['message']);}else{logger['info'](_0x46c0('0xc'),_0x24f51f,_0x46c0('0xd'));_0x8f03b2(_0x4a6000[_0x46c0('0x12')][_0x46c0('0x11')]);}})[_0x46c0('0x13')](function(_0x3a7c45){logger['error']('CmCompany,\x20%s,\x20%s',_0x24f51f,_0x3a7c45);_0x3900fe(_0x3a7c45);});});}
\ No newline at end of file
+var _0x7b4b=['http','then','info','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x49e5bc,_0x22576f){var _0x27c672=function(_0x185798){while(--_0x185798){_0x49e5bc['push'](_0x49e5bc['shift']());}};_0x27c672(++_0x22576f);}(_0x7b4b,0x1ad));var _0xb7b4=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x7b4b[_0x557fd2];return _0x1b54a2;};'use strict';var _=require(_0xb7b4('0x0'));var util=require(_0xb7b4('0x1'));var moment=require(_0xb7b4('0x2'));var BPromise=require(_0xb7b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b4('0x4'))['db'];var utils=require(_0xb7b4('0x5'));var logger=require(_0xb7b4('0x6'))(_0xb7b4('0x7'));var config=require(_0xb7b4('0x8'));var jayson=require(_0xb7b4('0x9'));var client=jayson[_0xb7b4('0xa')][_0xb7b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x203f2f,_0x5a4ee5,_0x69de6f){return new BPromise(function(_0x864ce9,_0x448747){return client['request'](_0x203f2f,_0x69de6f)[_0xb7b4('0xc')](function(_0x670b20){logger[_0xb7b4('0xd')]('CmCompany,\x20%s,\x20%s',_0x5a4ee5,'request\x20sent');logger['debug'](_0xb7b4('0xe'),_0x5a4ee5,_0xb7b4('0xf'),JSON['stringify'](_0x670b20));if(_0x670b20[_0xb7b4('0x10')]){if(_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x11')]===0x1f4){logger[_0xb7b4('0x10')](_0xb7b4('0x12'),_0x5a4ee5,_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x13')]);return _0x448747(_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x13')]);}logger[_0xb7b4('0x10')](_0xb7b4('0x12'),_0x5a4ee5,_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x13')]);return _0x864ce9(_0x670b20[_0xb7b4('0x10')][_0xb7b4('0x13')]);}else{logger['info'](_0xb7b4('0x12'),_0x5a4ee5,_0xb7b4('0xf'));_0x864ce9(_0x670b20[_0xb7b4('0x14')][_0xb7b4('0x13')]);}})[_0xb7b4('0x15')](function(_0x2d70a5){logger[_0xb7b4('0x10')](_0xb7b4('0x12'),_0x5a4ee5,_0x2d70a5);_0x448747(_0x2d70a5);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 1f05343..1b6b960 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 _0x003f=['index','get','/describe','describe','/:id','show','getContacts','post','/:id/contacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x003f,0x16c));var _0xf003=function(_0x2046b8,_0x310c75){_0x2046b8=_0x2046b8-0x0;var _0x5ceb92=_0x003f[_0x2046b8];return _0x5ceb92;};'use strict';var multer=require(_0xf003('0x0'));var util=require(_0xf003('0x1'));var path=require(_0xf003('0x2'));var timeout=require(_0xf003('0x3'));var express=require(_0xf003('0x4'));var router=express[_0xf003('0x5')]();var fs_extra=require(_0xf003('0x6'));var auth=require(_0xf003('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf003('0x8'));var controller=require(_0xf003('0x9'));router['get']('/',auth[_0xf003('0xa')](),controller[_0xf003('0xb')]);router[_0xf003('0xc')](_0xf003('0xd'),auth[_0xf003('0xa')](),controller[_0xf003('0xe')]);router['get'](_0xf003('0xf'),auth[_0xf003('0xa')](),controller[_0xf003('0x10')]);router[_0xf003('0xc')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xf003('0x11')]);router[_0xf003('0x12')]('/',auth[_0xf003('0xa')](),controller['create']);router[_0xf003('0x12')](_0xf003('0x13'),auth[_0xf003('0xa')](),controller['addContacts']);router[_0xf003('0x14')](_0xf003('0xf'),auth[_0xf003('0xa')](),controller[_0xf003('0x15')]);router[_0xf003('0x16')](_0xf003('0xf'),auth[_0xf003('0xa')](),controller[_0xf003('0x17')]);module[_0xf003('0x18')]=router;
\ No newline at end of file
+var _0x7cf6=['create','addContacts','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id/contacts','getContacts','post'];(function(_0xe9c732,_0x125b29){var _0x2e6559=function(_0x1463d5){while(--_0x1463d5){_0xe9c732['push'](_0xe9c732['shift']());}};_0x2e6559(++_0x125b29);}(_0x7cf6,0x125));var _0x67cf=function(_0x2a5297,_0x577f67){_0x2a5297=_0x2a5297-0x0;var _0x261070=_0x7cf6[_0x2a5297];return _0x261070;};'use strict';var multer=require(_0x67cf('0x0'));var util=require('util');var path=require(_0x67cf('0x1'));var timeout=require(_0x67cf('0x2'));var express=require(_0x67cf('0x3'));var router=express['Router']();var fs_extra=require(_0x67cf('0x4'));var auth=require(_0x67cf('0x5'));var interaction=require(_0x67cf('0x6'));var config=require(_0x67cf('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x67cf('0x8')]);router[_0x67cf('0x9')]('/describe',auth[_0x67cf('0xa')](),controller[_0x67cf('0xb')]);router[_0x67cf('0x9')]('/:id',auth[_0x67cf('0xa')](),controller['show']);router[_0x67cf('0x9')](_0x67cf('0xc'),auth[_0x67cf('0xa')](),controller[_0x67cf('0xd')]);router[_0x67cf('0xe')]('/',auth[_0x67cf('0xa')](),controller[_0x67cf('0xf')]);router[_0x67cf('0xe')](_0x67cf('0xc'),auth[_0x67cf('0xa')](),controller[_0x67cf('0x10')]);router['put'](_0x67cf('0x11'),auth[_0x67cf('0xa')](),controller[_0x67cf('0x12')]);router[_0x67cf('0x13')](_0x67cf('0x11'),auth[_0x67cf('0xa')](),controller[_0x67cf('0x14')]);module[_0x67cf('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 00f81e7..632fd09 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 _0xe185=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe185,0xd9));var _0x5e18=function(_0x32126f,_0x23446b){_0x32126f=_0x32126f-0x0;var _0x9af1be=_0xe185[_0x32126f];return _0x9af1be;};'use strict';var _=require(_0x5e18('0x0'));var Sequelize=require(_0x5e18('0x1'));module[_0x5e18('0x2')]={'firstName':{'type':Sequelize[_0x5e18('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5e18('0x3')]},'street':{'type':Sequelize[_0x5e18('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5e18('0x3')]},'country':{'type':Sequelize[_0x5e18('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5e18('0x3')]},'description':{'type':Sequelize[_0x5e18('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x5e18('0x3')]},'fax':{'type':Sequelize[_0x5e18('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x5e18('0x3')]},'facebook':{'type':Sequelize[_0x5e18('0x3')]},'fb_data':{'type':Sequelize[_0x5e18('0x3')]},'twitter':{'type':Sequelize[_0x5e18('0x3')]},'skype':{'type':Sequelize[_0x5e18('0x3')]},'teams':{'type':Sequelize[_0x5e18('0x3')]},'viber':{'type':Sequelize[_0x5e18('0x3')]},'line':{'type':Sequelize[_0x5e18('0x3')]},'wechat':{'type':Sequelize[_0x5e18('0x3')]},'telegram':{'type':Sequelize[_0x5e18('0x3')]},'UserId':{'type':Sequelize[_0x5e18('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x5e18('0x3')]},'priority':{'type':Sequelize[_0x5e18('0x5')](0x2)[_0x5e18('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5e18('0x7')],'defaultValue':Sequelize[_0x5e18('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa4d1=['UNSIGNED','DATE','NOW','STRING','TEXT','INTEGER'];(function(_0x468e6c,_0x5e150b){var _0x54c64b=function(_0x44559f){while(--_0x44559f){_0x468e6c['push'](_0x468e6c['shift']());}};_0x54c64b(++_0x5e150b);}(_0xa4d1,0x17d));var _0x1a4d=function(_0x26764f,_0x43f4e7){_0x26764f=_0x26764f-0x0;var _0x53c715=_0xa4d1[_0x26764f];return _0x53c715;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x1a4d('0x0')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1a4d('0x0')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1a4d('0x0')]},'city':{'type':Sequelize[_0x1a4d('0x0')]},'country':{'type':Sequelize[_0x1a4d('0x0')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a4d('0x1')]},'phone':{'type':Sequelize[_0x1a4d('0x0')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1a4d('0x0')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x1a4d('0x0')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1a4d('0x0')]},'viber':{'type':Sequelize[_0x1a4d('0x0')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x1a4d('0x0')]},'telegram':{'type':Sequelize[_0x1a4d('0x0')]},'UserId':{'type':Sequelize[_0x1a4d('0x2')]},'AdditionalPhones':{'type':Sequelize[_0x1a4d('0x0')]},'priority':{'type':Sequelize[_0x1a4d('0x2')](0x2)[_0x1a4d('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1a4d('0x4')],'defaultValue':Sequelize[_0x1a4d('0x5')]},'dialTimezone':{'type':Sequelize[_0x1a4d('0x0')]},'utcOffset':{'type':Sequelize[_0x1a4d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index b151fa6..9ef9a4d 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 _0x87b8=['all','Tag','Tags','color','CmContactHasItem','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','get','$and','map','format','cf_%d','omit','pickBy','startsWith','isEmpty','cm_contacts','setFields','id\x20=\x20?','toParam','sequelize','text','phone','CmHopper','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','options','nolimit','ids','OrderBy','items','item_types','ItemTypeId','description','item','PHONE','`ItemType`.OrderBy','CmHopperId','CmHopperAdditionalPhone','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','includeAll','rows','getHopperHistories','include','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','file','import','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','child_process','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','parse','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','alias','createdAt','DESC','VoiceCallReport','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','limit','count','set','update','then','destroy','sendStatus','error','stack','name','send','index','describe','getOptions','query','user','catch','CmContact','find','params','tags','keys','cf_','columnName','displayName','analytics','CmCustomField','findAll','custom','type','values','info','forEach','hasOwnProperty','merge','body','length','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isArray','isNil','dialTimezone','timezones','utcOffset','create','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId','spread','contact'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x87b8,0x1a9));var _0x887b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x87b8[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x887b('0x0'));var BPromise=require(_0x887b('0x1'));var util=require(_0x887b('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x887b('0x3'));var squel=require(_0x887b('0x4'));var Papa=require(_0x887b('0x5'));var Redis=require(_0x887b('0x6'));var contacts=require('../../components/contacts');var qs=require(_0x887b('0x7'));var logger=require(_0x887b('0x8'))(_0x887b('0x9'));var config=require(_0x887b('0xa'));var shared=require('../../config/environment/shared');var db=require(_0x887b('0xb'))['db'];config[_0x887b('0xc')]=_[_0x887b('0xd')](config[_0x887b('0xc')],{'host':_0x887b('0xe'),'port':0x18eb});var socket=require(_0x887b('0xf'))(new Redis(config[_0x887b('0xc')]));require(_0x887b('0x10'))[_0x887b('0x11')](socket);function respondWithResult(_0xc4eae5,_0x108261){_0x108261=_0x108261||0xc8;return function(_0x4b47d9){if(_0x4b47d9){return _0xc4eae5[_0x887b('0x12')](_0x108261)[_0x887b('0x13')](_0x4b47d9);}};}function respondWithFilteredResult(_0x59cdf3,_0x295ec6){return function(_0x3746a9){if(_0x3746a9){var _0x9d7929=typeof _0x295ec6[_0x887b('0x14')]==='undefined'&&typeof _0x295ec6[_0x887b('0x15')]==='undefined';var _0x29f35c=_0x3746a9[_0x887b('0x16')];var _0xe58c50=_0x9d7929?0x0:_0x295ec6['offset'];var _0x278ed8=_0x9d7929?_0x3746a9[_0x887b('0x16')]:_0x295ec6[_0x887b('0x14')]+_0x295ec6['limit'];var _0x114dde;if(_0x278ed8>=_0x29f35c){_0x278ed8=_0x29f35c;_0x114dde=0xc8;}else{_0x114dde=0xce;}_0x59cdf3[_0x887b('0x12')](_0x114dde);return _0x59cdf3[_0x887b('0x17')]('Content-Range',_0xe58c50+'-'+_0x278ed8+'/'+_0x29f35c)[_0x887b('0x13')](_0x3746a9);}return null;};}function saveUpdates(_0x58697f){return function(_0x44e68f){if(_0x44e68f){return _0x44e68f[_0x887b('0x18')](_0x58697f)[_0x887b('0x19')](function(_0x3acbe4){return _0x3acbe4;});}return null;};}function removeEntity(_0x572c2e){return function(_0x306333){if(_0x306333){return _0x306333[_0x887b('0x1a')]()[_0x887b('0x19')](function(){_0x572c2e[_0x887b('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43318a){return function(_0x676317){if(!_0x676317){_0x43318a[_0x887b('0x1b')](0x194);}return _0x676317;};}function handleError(_0x151b77,_0x441ca7){_0x441ca7=_0x441ca7||0x1f4;return function(_0x4cfbe7){logger[_0x887b('0x1c')](_0x4cfbe7[_0x887b('0x1d')]);if(_0x4cfbe7[_0x887b('0x1e')]){delete _0x4cfbe7[_0x887b('0x1e')];}_0x151b77['status'](_0x441ca7)[_0x887b('0x1f')](_0x4cfbe7);};}exports[_0x887b('0x20')]=function(_0x411720,_0x46a145){var _0x384c3f={};return contacts[_0x887b('0x21')]()[_0x887b('0x19')](function(_0x86d671){_0x384c3f=qs[_0x887b('0x22')](_0x86d671,_0x411720);return contacts['findAll'](_0x411720[_0x887b('0x23')],_0x411720[_0x887b('0x24')],_0x384c3f,_0x86d671);})[_0x887b('0x19')](respondWithFilteredResult(_0x46a145,_0x384c3f))[_0x887b('0x25')](handleError(_0x46a145,null));};exports[_0x887b('0x1a')]=function(_0x9d5611,_0x512f0d){return db[_0x887b('0x26')][_0x887b('0x27')]({'where':{'id':_0x9d5611[_0x887b('0x28')]['id']}})[_0x887b('0x19')](handleEntityNotFound(_0x512f0d,null))['then'](removeEntity(_0x512f0d,null))[_0x887b('0x25')](handleError(_0x512f0d,null));};exports['describe']=function(_0x54f683,_0x2c467a){return db[_0x887b('0x26')]['describe']()['then'](function(_0x2b5b82){delete _0x2b5b82[_0x887b('0x29')];for(var _0x3f8bf1=0x0;_0x3f8bf1
'];(function(_0x23aa6c,_0x215c2d){var _0x2e5277=function(_0x21f5a2){while(--_0x21f5a2){_0x23aa6c['push'](_0x23aa6c['shift']());}};_0x2e5277(++_0x215c2d);}(_0x2306,0x17c));var _0x6230=function(_0x4c1672,_0x279631){_0x4c1672=_0x4c1672-0x0;var _0x170dc7=_0x2306[_0x4c1672];return _0x170dc7;};'use strict';var _=require(_0x6230('0x0'));var moment=require(_0x6230('0x1'));var random=require(_0x6230('0x2'));var fs=require('fs');var path=require(_0x6230('0x3'));var util=require('util');var tnef=require(_0x6230('0x4'));var logger=require('../../../config/logger')(_0x6230('0x5'));var config=require(_0x6230('0x6'));function getAddress(_0x12bb61){var _0x5d3bb6=_[_0x6230('0x7')](_0x12bb61[_0x6230('0x8')]);return _0x5d3bb6&&_0x5d3bb6[_0x6230('0x9')]?_0x5d3bb6['address']:'anonymous'+random[_0x6230('0xa')](0x6)+_0x6230('0xb');}function getFirstName(_0x4b57a9){var _0x6625a7=_[_0x6230('0x7')](_0x4b57a9[_0x6230('0x8')]);if(_0x6625a7&&_0x6625a7[_0x6230('0xc')]){if(_0x6625a7['name']==_0x6625a7['address']){return _0x6625a7[_0x6230('0xc')]['substring'](0x0,_0x6625a7[_0x6230('0xc')]['indexOf']('@'));}var _0x3e0dc6=_0x6625a7[_0x6230('0xc')][_0x6230('0xd')](/\s+/);return _0x3e0dc6[_0x6230('0xe')]>0x1?_0x3e0dc6[_0x6230('0xf')](0x0,-0x1)[_0x6230('0x10')]('\x20'):_0x6625a7[_0x6230('0xc')];}return _0x6230('0x11');}function getLastName(_0xfb3bc0){var _0x3f30c9=_[_0x6230('0x7')](_0xfb3bc0[_0x6230('0x8')]);if(_0x3f30c9&&_0x3f30c9[_0x6230('0xc')]){var _0x349a67=_0x3f30c9[_0x6230('0xc')]['split'](/\s+/);return _0x349a67['length']>0x1?_0x349a67['pop']():'';}return'';}function getMails(_0x571132,_0x5d5a8d){var _0xa529ea='';for(var _0x2bf58e=0x0;_0x2bf58e<_0x5d5a8d[_0x6230('0x8')][_0x6230('0xe')];_0x2bf58e+=0x1){if(_0x5d5a8d[_0x6230('0x8')][_0x2bf58e][_0x6230('0x9')]!==_0x571132){if(!_[_0x6230('0x12')](_0xa529ea)){_0xa529ea+=',';}_0xa529ea+=_0x5d5a8d[_0x6230('0x8')][_0x2bf58e]['name']||_0x5d5a8d[_0x6230('0x8')][_0x2bf58e][_0x6230('0x9')]||'';_0xa529ea+='\x20<';_0xa529ea+=_0x5d5a8d[_0x6230('0x8')][_0x2bf58e][_0x6230('0x9')]?_0x5d5a8d[_0x6230('0x8')][_0x2bf58e][_0x6230('0x9')]:_0x6230('0x13')+random[_0x6230('0xa')](0x6)+_0x6230('0xb');_0xa529ea+='>';}}return _0xa529ea;}function parseEmail(_0xa2d19d,_0x598733,_0x37f678){if(_0x598733['html']){var _0x5e06e0=/