From: support
Date: Thu, 13 Oct 2022 15:12:44 +0000 (+0000)
Subject: Built motion from commit 6dca1c86.|2.6.19
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=b724c9ea67d005bb85b8a7cfd4336773436cfa22;p=motion2.git
Built motion from commit 6dca1c86.|2.6.19
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 12837bb..347d714 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-10-13T13:41:37.222Z",
+ "time": "2022-10-13T15:04:39.893Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 826b4e2..e33f6da 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-13T13:41:37.222Z",
+ "time": "2022-10-13T15:04:39.893Z",
"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 48f5fb7..4b2f297 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 _0xc8ed=['jscripty','urlForward','bot','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[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration'];(function(_0x2bd669,_0x387154){var _0x3f2537=function(_0x604734){while(--_0x604734){_0x2bd669['push'](_0x2bd669['shift']());}};_0x3f2537(++_0x387154);}(_0xc8ed,0x1c4));var _0xdc8e=function(_0x1f708c,_0x351786){_0x1f708c=_0x1f708c-0x0;var _0x35b1ea=_0xc8ed[_0x1f708c];return _0x35b1ea;};'use strict';var Sequelize=require(_0xdc8e('0x0'));module[_0xdc8e('0x1')]={'name':{'type':Sequelize[_0xdc8e('0x2')],'get':function(_0x241173){return this[_0xdc8e('0x3')](_0xdc8e('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xdc8e('0x5'),_0xdc8e('0x6'),'motionbar',_0xdc8e('0x7'),_0xdc8e('0x8'),'browser',_0xdc8e('0x9'),_0xdc8e('0xa')]],'msg':_0xdc8e('0xb')}},'comment':_0xdc8e('0xb')},'data1':{'type':Sequelize[_0xdc8e('0xc')](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[_0xdc8e('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xdc8e('0xc')](0x1000),'comment':_0xdc8e('0xd')},'data4':{'type':Sequelize[_0xdc8e('0xc')](0x1000),'comments':_0xdc8e('0xe')},'data5':{'type':Sequelize[_0xdc8e('0xc')](0x1000),'comments':_0xdc8e('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0xdc8e('0x10')}};
\ No newline at end of file
+var _0x3b6d=['exports','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0x3b6d,0xd2));var _0xd3b6=function(_0x5ce7d7,_0x304af4){_0x5ce7d7=_0x5ce7d7-0x0;var _0x42a5e0=_0x3b6d[_0x5ce7d7];return _0x42a5e0;};'use strict';var Sequelize=require('sequelize');module[_0xd3b6('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5244ee){return this['getDataValue'](_0xd3b6('0x1'));}},'action':{'type':Sequelize[_0xd3b6('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd3b6('0x3'),'integration',_0xd3b6('0x4'),_0xd3b6('0x5'),_0xd3b6('0x6'),_0xd3b6('0x7'),_0xd3b6('0x8'),_0xd3b6('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xd3b6('0xa')},'data1':{'type':Sequelize[_0xd3b6('0x2')](0x1000),'comment':_0xd3b6('0xb')},'data2':{'type':Sequelize[_0xd3b6('0x2')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xd3b6('0x2')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xd3b6('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xd3b6('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0xd3b6('0xc')},'data7':{'type':Sequelize[_0xd3b6('0xd')],'comments':_0xd3b6('0xe')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 43e1cf9..efc1c02 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 _0xdc8d=['then','catch','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','offset','limit','undefined','count','status','set','json','apply','reject','save','destroy','end','stack','name','send','update','body','Action','find'];(function(_0x4354d3,_0x59d9b5){var _0x515f78=function(_0x519719){while(--_0x519719){_0x4354d3['push'](_0x4354d3['shift']());}};_0x515f78(++_0x59d9b5);}(_0xdc8d,0xbb));var _0xddc8=function(_0x38514a,_0x3a97c0){_0x38514a=_0x38514a-0x0;var _0x5d68ee=_0xdc8d[_0x38514a];return _0x5d68ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddc8('0x0'));var zipdir=require(_0xddc8('0x1'));var jsonpatch=require(_0xddc8('0x2'));var rp=require('request-promise');var moment=require(_0xddc8('0x3'));var BPromise=require(_0xddc8('0x4'));var Mustache=require('mustache');var util=require(_0xddc8('0x5'));var path=require('path');var sox=require(_0xddc8('0x6'));var csv=require(_0xddc8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddc8('0x8'));var _=require('lodash');var squel=require(_0xddc8('0x9'));var crypto=require('crypto');var jsforce=require(_0xddc8('0xa'));var deskjs=require(_0xddc8('0xb'));var toCsv=require(_0xddc8('0x7'));var querystring=require(_0xddc8('0xc'));var Papa=require(_0xddc8('0xd'));var Redis=require('ioredis');var authService=require(_0xddc8('0xe'));var qs=require(_0xddc8('0xf'));var as=require(_0xddc8('0x10'));var hardwareService=require(_0xddc8('0x11'));var logger=require(_0xddc8('0x12'))(_0xddc8('0x13'));var utils=require(_0xddc8('0x14'));var config=require(_0xddc8('0x15'));var licenseUtil=require(_0xddc8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5580b2,_0x4cd7f5){_0x4cd7f5=_0x4cd7f5||0xcc;return function(_0x2e3063){if(_0x2e3063){return _0x5580b2[_0xddc8('0x17')](_0x4cd7f5);}return _0x5580b2['status'](_0x4cd7f5)['end']();};}function respondWithResult(_0x5681a9,_0xf083e6){_0xf083e6=_0xf083e6||0xc8;return function(_0x3a03f7){if(_0x3a03f7){return _0x5681a9['status'](_0xf083e6)['json'](_0x3a03f7);}};}function respondWithFilteredResult(_0x4be9ad,_0x2a2244){return function(_0x5a79a7){if(_0x5a79a7){var _0x2d461e=typeof _0x2a2244[_0xddc8('0x18')]==='undefined'&&typeof _0x2a2244[_0xddc8('0x19')]===_0xddc8('0x1a');var _0x1feec8=_0x5a79a7[_0xddc8('0x1b')];var _0x522f9f=_0x2d461e?0x0:_0x2a2244[_0xddc8('0x18')];var _0x304adf=_0x2d461e?_0x5a79a7[_0xddc8('0x1b')]:_0x2a2244[_0xddc8('0x18')]+_0x2a2244['limit'];var _0x6d9faa;if(_0x304adf>=_0x1feec8){_0x304adf=_0x1feec8;_0x6d9faa=0xc8;}else{_0x6d9faa=0xce;}_0x4be9ad[_0xddc8('0x1c')](_0x6d9faa);return _0x4be9ad[_0xddc8('0x1d')]('Content-Range',_0x522f9f+'-'+_0x304adf+'/'+_0x1feec8)[_0xddc8('0x1e')](_0x5a79a7);}return null;};}function patchUpdates(_0x1358ce){return function(_0x5a1977){try{jsonpatch[_0xddc8('0x1f')](_0x5a1977,_0x1358ce,!![]);}catch(_0x1f0c25){return BPromise[_0xddc8('0x20')](_0x1f0c25);}return _0x5a1977[_0xddc8('0x21')]();};}function saveUpdates(_0x483522,_0x301fe2){return function(_0x552309){if(_0x552309){return _0x552309['update'](_0x483522)['then'](function(_0x2cfb5c){return _0x2cfb5c;});}return null;};}function removeEntity(_0x1de5f7,_0x188f02){return function(_0xd09779){if(_0xd09779){return _0xd09779[_0xddc8('0x22')]()['then'](function(){_0x1de5f7['status'](0xcc)[_0xddc8('0x23')]();});}};}function handleEntityNotFound(_0x20ac20,_0x30cf43){return function(_0x40407a){if(!_0x40407a){_0x20ac20['sendStatus'](0x194);}return _0x40407a;};}function handleError(_0x2dec27,_0x414ad0){_0x414ad0=_0x414ad0||0x1f4;return function(_0x13ecaf){logger['error'](_0x13ecaf[_0xddc8('0x24')]);if(_0x13ecaf[_0xddc8('0x25')]){delete _0x13ecaf[_0xddc8('0x25')];}_0x2dec27[_0xddc8('0x1c')](_0x414ad0)[_0xddc8('0x26')](_0x13ecaf);};}exports[_0xddc8('0x27')]=function(_0xe9b0ef,_0x3fc739){if(_0xe9b0ef['body']['id']){delete _0xe9b0ef[_0xddc8('0x28')]['id'];}return db[_0xddc8('0x29')][_0xddc8('0x2a')]({'where':{'id':_0xe9b0ef['params']['id']}})['then'](handleEntityNotFound(_0x3fc739,null))['then'](saveUpdates(_0xe9b0ef['body'],null))[_0xddc8('0x2b')](respondWithResult(_0x3fc739,null))[_0xddc8('0x2c')](handleError(_0x3fc739,null));};exports[_0xddc8('0x22')]=function(_0x679cc5,_0x193f2f){return db[_0xddc8('0x29')][_0xddc8('0x2a')]({'where':{'id':_0x679cc5[_0xddc8('0x2d')]['id']}})[_0xddc8('0x2b')](handleEntityNotFound(_0x193f2f,null))[_0xddc8('0x2b')](removeEntity(_0x193f2f,null))['catch'](handleError(_0x193f2f,null));};
\ No newline at end of file
+var _0x0804=['zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','reject','update','destroy','name','send','body','Action','find','params','then','catch'];(function(_0x2311dc,_0x3e0d56){var _0x11836c=function(_0xf4cc4d){while(--_0xf4cc4d){_0x2311dc['push'](_0x2311dc['shift']());}};_0x11836c(++_0x3e0d56);}(_0x0804,0x150));var _0x4080=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x0804[_0xd0b415];return _0x2bdf2c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4080('0x0'));var jsonpatch=require(_0x4080('0x1'));var rp=require('request-promise');var moment=require(_0x4080('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4080('0x3'));var util=require(_0x4080('0x4'));var path=require('path');var sox=require(_0x4080('0x5'));var csv=require(_0x4080('0x6'));var ejs=require(_0x4080('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4080('0x8'));var squel=require(_0x4080('0x9'));var crypto=require('crypto');var jsforce=require(_0x4080('0xa'));var deskjs=require(_0x4080('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4080('0xc'));var Papa=require('papaparse');var Redis=require(_0x4080('0xd'));var authService=require(_0x4080('0xe'));var qs=require(_0x4080('0xf'));var as=require(_0x4080('0x10'));var hardwareService=require(_0x4080('0x11'));var logger=require(_0x4080('0x12'))(_0x4080('0x13'));var utils=require(_0x4080('0x14'));var config=require(_0x4080('0x15'));var licenseUtil=require(_0x4080('0x16'));var db=require(_0x4080('0x17'))['db'];function respondWithStatusCode(_0x3f12a8,_0x3e8098){_0x3e8098=_0x3e8098||0xcc;return function(_0x3aef08){if(_0x3aef08){return _0x3f12a8[_0x4080('0x18')](_0x3e8098);}return _0x3f12a8['status'](_0x3e8098)['end']();};}function respondWithResult(_0x572d24,_0x56811b){_0x56811b=_0x56811b||0xc8;return function(_0x37e51d){if(_0x37e51d){return _0x572d24[_0x4080('0x19')](_0x56811b)['json'](_0x37e51d);}};}function respondWithFilteredResult(_0x49326e,_0x28abab){return function(_0x233391){if(_0x233391){var _0x4d0f10=typeof _0x28abab[_0x4080('0x1a')]===_0x4080('0x1b')&&typeof _0x28abab['limit']===_0x4080('0x1b');var _0x37344b=_0x233391[_0x4080('0x1c')];var _0x5c98e2=_0x4d0f10?0x0:_0x28abab[_0x4080('0x1a')];var _0x4adbaa=_0x4d0f10?_0x233391[_0x4080('0x1c')]:_0x28abab[_0x4080('0x1a')]+_0x28abab['limit'];var _0x20ddcd;if(_0x4adbaa>=_0x37344b){_0x4adbaa=_0x37344b;_0x20ddcd=0xc8;}else{_0x20ddcd=0xce;}_0x49326e[_0x4080('0x19')](_0x20ddcd);return _0x49326e['set'](_0x4080('0x1d'),_0x5c98e2+'-'+_0x4adbaa+'/'+_0x37344b)[_0x4080('0x1e')](_0x233391);}return null;};}function patchUpdates(_0x30034b){return function(_0x210e6f){try{jsonpatch['apply'](_0x210e6f,_0x30034b,!![]);}catch(_0x38600d){return BPromise[_0x4080('0x1f')](_0x38600d);}return _0x210e6f['save']();};}function saveUpdates(_0x1a01d1,_0x1130ed){return function(_0x43d8ef){if(_0x43d8ef){return _0x43d8ef[_0x4080('0x20')](_0x1a01d1)['then'](function(_0x5b556f){return _0x5b556f;});}return null;};}function removeEntity(_0x536714,_0x391b38){return function(_0x34ce24){if(_0x34ce24){return _0x34ce24[_0x4080('0x21')]()['then'](function(){_0x536714[_0x4080('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c198d,_0x23f3cf){return function(_0x24c9e7){if(!_0x24c9e7){_0x1c198d[_0x4080('0x18')](0x194);}return _0x24c9e7;};}function handleError(_0x56de50,_0x2c448e){_0x2c448e=_0x2c448e||0x1f4;return function(_0x808934){logger['error'](_0x808934['stack']);if(_0x808934[_0x4080('0x22')]){delete _0x808934[_0x4080('0x22')];}_0x56de50[_0x4080('0x19')](_0x2c448e)[_0x4080('0x23')](_0x808934);};}exports['update']=function(_0x5b44ec,_0x5e1c23){if(_0x5b44ec[_0x4080('0x24')]['id']){delete _0x5b44ec[_0x4080('0x24')]['id'];}return db[_0x4080('0x25')][_0x4080('0x26')]({'where':{'id':_0x5b44ec[_0x4080('0x27')]['id']}})['then'](handleEntityNotFound(_0x5e1c23,null))[_0x4080('0x28')](saveUpdates(_0x5b44ec[_0x4080('0x24')],null))[_0x4080('0x28')](respondWithResult(_0x5e1c23,null))[_0x4080('0x29')](handleError(_0x5e1c23,null));};exports['destroy']=function(_0x3f264b,_0x4aa68d){return db[_0x4080('0x25')][_0x4080('0x26')]({'where':{'id':_0x3f264b[_0x4080('0x27')]['id']}})[_0x4080('0x28')](handleEntityNotFound(_0x4aa68d,null))[_0x4080('0x28')](removeEntity(_0x4aa68d,null))[_0x4080('0x29')](handleError(_0x4aa68d,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 32b5a37..4065ef0 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 _0xffee=['rimraf','../../config/environment','./action.attributes','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11c4fa,_0x3d68f0){var _0x12e9aa=function(_0x417aa1){while(--_0x417aa1){_0x11c4fa['push'](_0x11c4fa['shift']());}};_0x12e9aa(++_0x3d68f0);}(_0xffee,0x131));var _0xeffe=function(_0x430c62,_0x129472){_0x430c62=_0x430c62-0x0;var _0x4ec150=_0xffee[_0x430c62];return _0x4ec150;};'use strict';var _=require(_0xeffe('0x0'));var util=require('util');var logger=require(_0xeffe('0x1'))(_0xeffe('0x2'));var moment=require(_0xeffe('0x3'));var BPromise=require(_0xeffe('0x4'));var rp=require(_0xeffe('0x5'));var fs=require('fs');var path=require(_0xeffe('0x6'));var rimraf=require(_0xeffe('0x7'));var config=require(_0xeffe('0x8'));var attributes=require(_0xeffe('0x9'));module['exports']=function(_0xd870cf,_0x542835){return _0xd870cf['define'](_0xeffe('0xa'),attributes,{'tableName':_0xeffe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc1ec=['define','Action','tools_actions','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x4aabc6,_0x348818){var _0xf26471=function(_0x1416c6){while(--_0x1416c6){_0x4aabc6['push'](_0x4aabc6['shift']());}};_0xf26471(++_0x348818);}(_0xc1ec,0x117));var _0xcc1e=function(_0x58f207,_0x564979){_0x58f207=_0x58f207-0x0;var _0x1c025a=_0xc1ec[_0x58f207];return _0x1c025a;};'use strict';var _=require(_0xcc1e('0x0'));var util=require(_0xcc1e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcc1e('0x2'));var BPromise=require(_0xcc1e('0x3'));var rp=require(_0xcc1e('0x4'));var fs=require('fs');var path=require(_0xcc1e('0x5'));var rimraf=require(_0xcc1e('0x6'));var config=require(_0xcc1e('0x7'));var attributes=require(_0xcc1e('0x8'));module['exports']=function(_0x42ca26,_0x37af1d){return _0x42ca26[_0xcc1e('0x9')](_0xcc1e('0xa'),attributes,{'tableName':_0xcc1e('0xb'),'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 46d183d..25cc3d1 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4e6bd8,_0x3de9c1){var _0x1b5877=function(_0x266955){while(--_0x266955){_0x4e6bd8['push'](_0x4e6bd8['shift']());}};_0x1b5877(++_0x3de9c1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x5fc3[_0x5948dd];return _0xb1f8be;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x550f06,_0x47162d){var _0x2c352d=function(_0x1b02b5){while(--_0x1b02b5){_0x550f06['push'](_0x550f06['shift']());}};_0x2c352d(++_0x47162d);}(_0x1261,0x144));var _0x1126=function(_0x20a590,_0x1e8a6d){_0x20a590=_0x20a590-0x0;var _0x2e1b41=_0x1261[_0x20a590];return _0x2e1b41;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 2bdb5c6..4dca5f6 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 _0x6f73=['delete','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./action.controller','/:id','isAuthenticated','update'];(function(_0x11df96,_0x549a45){var _0x5d3015=function(_0x52f2f6){while(--_0x52f2f6){_0x11df96['push'](_0x11df96['shift']());}};_0x5d3015(++_0x549a45);}(_0x6f73,0x85));var _0x36f7=function(_0x565ba6,_0x49b8f8){_0x565ba6=_0x565ba6-0x0;var _0xf0f461=_0x6f73[_0x565ba6];return _0xf0f461;};'use strict';var multer=require(_0x36f7('0x0'));var util=require(_0x36f7('0x1'));var path=require('path');var timeout=require(_0x36f7('0x2'));var express=require(_0x36f7('0x3'));var router=express[_0x36f7('0x4')]();var fs_extra=require(_0x36f7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36f7('0x6'));var controller=require(_0x36f7('0x7'));router['put'](_0x36f7('0x8'),auth[_0x36f7('0x9')](),controller[_0x36f7('0xa')]);router[_0x36f7('0xb')]('/:id',auth[_0x36f7('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe972=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','delete','isAuthenticated','exports','multer'];(function(_0x36b59c,_0x4b4c30){var _0x156bbe=function(_0x58d2e9){while(--_0x58d2e9){_0x36b59c['push'](_0x36b59c['shift']());}};_0x156bbe(++_0x4b4c30);}(_0xe972,0x9b));var _0x2e97=function(_0xcdeada,_0x35a8c4){_0xcdeada=_0xcdeada-0x0;var _0x378843=_0xe972[_0xcdeada];return _0x378843;};'use strict';var multer=require(_0x2e97('0x0'));var util=require(_0x2e97('0x1'));var path=require('path');var timeout=require(_0x2e97('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2e97('0x3'));var auth=require(_0x2e97('0x4'));var interaction=require(_0x2e97('0x5'));var config=require(_0x2e97('0x6'));var controller=require(_0x2e97('0x7'));router[_0x2e97('0x8')](_0x2e97('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x2e97('0xa')](_0x2e97('0x9'),auth[_0x2e97('0xb')](),controller['destroy']);module[_0x2e97('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index b0d9543..df94f24 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x127f3f,_0x3eb1f4){var _0x1e4c40=function(_0x470300){while(--_0x470300){_0x127f3f['push'](_0x127f3f['shift']());}};_0x1e4c40(++_0x3eb1f4);}(_0x6f47,0xc7));var _0x76f4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6f47[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x7da7[_0x3c04ef];return _0x6a3a69;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index a66e31b..1842f9d 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 _0xfe53=['runReport','debug','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','sendStatus','stack','name','index','map','AnalyticCustomReport','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','right_join','cross_join','SUM(%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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','SEC_TO_TIME(%s)','operator','field','AnalyticMetric','format','output','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../files/reports','savename','select','countTable','COUNT(*)','run'];(function(_0x244207,_0x2995b8){var _0x7e31c=function(_0x3474e9){while(--_0x3474e9){_0x244207['push'](_0x244207['shift']());}};_0x7e31c(++_0x2995b8);}(_0xfe53,0x146));var _0x3fe5=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0xfe53[_0x516927];return _0x30749b;};'use strict';var emlformat=require(_0x3fe5('0x0'));var rimraf=require(_0x3fe5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fe5('0x2'));var rp=require(_0x3fe5('0x3'));var moment=require(_0x3fe5('0x4'));var BPromise=require(_0x3fe5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3fe5('0x6'));var ejs=require(_0x3fe5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fe5('0x8'));var squel=require(_0x3fe5('0x9'));var crypto=require('crypto');var jsforce=require(_0x3fe5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3fe5('0x6'));var querystring=require(_0x3fe5('0xb'));var Papa=require(_0x3fe5('0xc'));var Redis=require(_0x3fe5('0xd'));var authService=require(_0x3fe5('0xe'));var qs=require(_0x3fe5('0xf'));var as=require(_0x3fe5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fe5('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3fe5('0x12'));var licenseUtil=require(_0x3fe5('0x13'));var db=require(_0x3fe5('0x14'))['db'];var dbH=require(_0x3fe5('0x14'))[_0x3fe5('0x15')];function respondWithStatusCode(_0x595e72,_0x22a3d6){_0x22a3d6=_0x22a3d6||0xcc;return function(_0xd5b83e){if(_0xd5b83e){return _0x595e72['sendStatus'](_0x22a3d6);}return _0x595e72[_0x3fe5('0x16')](_0x22a3d6)['end']();};}function respondWithResult(_0x457988,_0x11e82e){_0x11e82e=_0x11e82e||0xc8;return function(_0x1e82b0){if(_0x1e82b0){return _0x457988[_0x3fe5('0x16')](_0x11e82e)[_0x3fe5('0x17')](_0x1e82b0);}};}function respondWithFilteredResult(_0x3a5622,_0x39b354){return function(_0x3f9409){if(_0x3f9409){var _0x55f58f=typeof _0x39b354[_0x3fe5('0x18')]===_0x3fe5('0x19')&&typeof _0x39b354['limit']==='undefined';var _0xaf6d38=_0x3f9409[_0x3fe5('0x1a')];var _0x517cf3=_0x55f58f?0x0:_0x39b354[_0x3fe5('0x18')];var _0x48bf03=_0x55f58f?_0x3f9409[_0x3fe5('0x1a')]:_0x39b354[_0x3fe5('0x18')]+_0x39b354[_0x3fe5('0x1b')];var _0xc4e55b;if(_0x48bf03>=_0xaf6d38){_0x48bf03=_0xaf6d38;_0xc4e55b=0xc8;}else{_0xc4e55b=0xce;}_0x3a5622['status'](_0xc4e55b);return _0x3a5622[_0x3fe5('0x1c')](_0x3fe5('0x1d'),_0x517cf3+'-'+_0x48bf03+'/'+_0xaf6d38)['json'](_0x3f9409);}return null;};}function patchUpdates(_0x56675c){return function(_0x58a8bc){try{jsonpatch[_0x3fe5('0x1e')](_0x58a8bc,_0x56675c,!![]);}catch(_0x5a39b9){return BPromise['reject'](_0x5a39b9);}return _0x58a8bc['save']();};}function saveUpdates(_0x20827b,_0x23ff20){return function(_0x3b4d0c){if(_0x3b4d0c){return _0x3b4d0c[_0x3fe5('0x1f')](_0x20827b)[_0x3fe5('0x20')](function(_0x37a453){return _0x37a453;});}return null;};}function removeEntity(_0x1ae1ee,_0x4b98c4){return function(_0x19eca8){if(_0x19eca8){return _0x19eca8[_0x3fe5('0x21')]()[_0x3fe5('0x20')](function(){var _0x1b71a8=_0x19eca8['get']({'plain':!![]});var _0x28e2d9='CustomReports';return db['UserProfileResource'][_0x3fe5('0x21')]({'where':{'type':_0x28e2d9,'resourceId':_0x1b71a8['id']}})[_0x3fe5('0x20')](function(){return _0x19eca8;});})[_0x3fe5('0x20')](function(){_0x1ae1ee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd081b2,_0x213014){return function(_0x5e010a){if(!_0x5e010a){_0xd081b2[_0x3fe5('0x22')](0x194);}return _0x5e010a;};}function handleError(_0x4d5d74,_0x381eb8){_0x381eb8=_0x381eb8||0x1f4;return function(_0x523c8f){logger['error'](_0x523c8f[_0x3fe5('0x23')]);if(_0x523c8f[_0x3fe5('0x24')]){delete _0x523c8f['name'];}_0x4d5d74[_0x3fe5('0x16')](_0x381eb8)['send'](_0x523c8f);};}exports[_0x3fe5('0x25')]=function(_0x220e2c,_0x160975){var _0x3fda2e={},_0x11cd2b={},_0x5c2694={'count':0x0,'rows':[]};var _0x13314d=_[_0x3fe5('0x26')](db[_0x3fe5('0x27')][_0x3fe5('0x28')],function(_0x4828fb){return{'name':_0x4828fb['fieldName'],'type':_0x4828fb[_0x3fe5('0x29')][_0x3fe5('0x2a')]};});_0x11cd2b[_0x3fe5('0x2b')]=_[_0x3fe5('0x26')](_0x13314d,_0x3fe5('0x24'));_0x11cd2b['query']=_[_0x3fe5('0x2c')](_0x220e2c[_0x3fe5('0x2d')]);_0x11cd2b['filters']=_['intersection'](_0x11cd2b[_0x3fe5('0x2b')],_0x11cd2b['query']);_0x3fda2e[_0x3fe5('0x2e')]=_[_0x3fe5('0x2f')](_0x11cd2b['model'],qs[_0x3fe5('0x30')](_0x220e2c['query'][_0x3fe5('0x30')]));_0x3fda2e[_0x3fe5('0x2e')]=_0x3fda2e['attributes']['length']?_0x3fda2e[_0x3fe5('0x2e')]:_0x11cd2b[_0x3fe5('0x2b')];if(!_0x220e2c[_0x3fe5('0x2d')][_0x3fe5('0x31')](_0x3fe5('0x32'))){_0x3fda2e['limit']=qs[_0x3fe5('0x1b')](_0x220e2c['query'][_0x3fe5('0x1b')]);_0x3fda2e[_0x3fe5('0x18')]=qs[_0x3fe5('0x18')](_0x220e2c['query']['offset']);}_0x3fda2e[_0x3fe5('0x33')]=qs[_0x3fe5('0x34')](_0x220e2c[_0x3fe5('0x2d')][_0x3fe5('0x34')]);_0x3fda2e[_0x3fe5('0x35')]=qs[_0x3fe5('0x36')](_[_0x3fe5('0x37')](_0x220e2c[_0x3fe5('0x2d')],_0x11cd2b[_0x3fe5('0x36')]),_0x13314d);if(_0x220e2c[_0x3fe5('0x2d')][_0x3fe5('0x38')]){_0x3fda2e[_0x3fe5('0x35')]=_[_0x3fe5('0x39')](_0x3fda2e[_0x3fe5('0x35')],{'$or':_[_0x3fe5('0x26')](_0x13314d,function(_0x1d6751){if(_0x1d6751[_0x3fe5('0x29')]!==_0x3fe5('0x3a')){var _0x393af3={};_0x393af3[_0x1d6751[_0x3fe5('0x24')]]={'$like':'%'+_0x220e2c[_0x3fe5('0x2d')][_0x3fe5('0x38')]+'%'};return _0x393af3;}})});}_0x3fda2e=_['merge']({},_0x3fda2e,_0x220e2c[_0x3fe5('0x3b')]);var _0x3b402d={'where':_0x3fda2e[_0x3fe5('0x35')]};return db[_0x3fe5('0x27')][_0x3fe5('0x1a')](_0x3b402d)[_0x3fe5('0x20')](function(_0x948a13){_0x5c2694[_0x3fe5('0x1a')]=_0x948a13;if(_0x220e2c[_0x3fe5('0x2d')][_0x3fe5('0x3c')]){_0x3fda2e[_0x3fe5('0x3d')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x3fda2e);})[_0x3fe5('0x20')](function(_0x1f8345){_0x5c2694[_0x3fe5('0x3e')]=_0x1f8345;return _0x5c2694;})[_0x3fe5('0x20')](respondWithFilteredResult(_0x160975,_0x3fda2e))['catch'](handleError(_0x160975,null));};exports[_0x3fe5('0x3f')]=function(_0x9e532e,_0x1f1385){var _0x229686={'raw':![],'where':{'id':_0x9e532e[_0x3fe5('0x40')]['id']}},_0x3851dd={};_0x3851dd[_0x3fe5('0x2b')]=_[_0x3fe5('0x2c')](db['AnalyticCustomReport'][_0x3fe5('0x28')]);_0x3851dd['query']=_[_0x3fe5('0x2c')](_0x9e532e[_0x3fe5('0x2d')]);_0x3851dd['filters']=_[_0x3fe5('0x2f')](_0x3851dd[_0x3fe5('0x2b')],_0x3851dd['query']);_0x229686[_0x3fe5('0x2e')]=_['intersection'](_0x3851dd[_0x3fe5('0x2b')],qs[_0x3fe5('0x30')](_0x9e532e[_0x3fe5('0x2d')][_0x3fe5('0x30')]));_0x229686[_0x3fe5('0x2e')]=_0x229686['attributes'][_0x3fe5('0x41')]?_0x229686[_0x3fe5('0x2e')]:_0x3851dd[_0x3fe5('0x2b')];if(_0x9e532e[_0x3fe5('0x2d')][_0x3fe5('0x3c')]){_0x229686[_0x3fe5('0x3d')]=[{'all':!![]}];}_0x229686=_[_0x3fe5('0x39')]({},_0x229686,_0x9e532e['options']);return db[_0x3fe5('0x27')][_0x3fe5('0x42')](_0x229686)[_0x3fe5('0x20')](handleEntityNotFound(_0x1f1385,null))[_0x3fe5('0x20')](respondWithResult(_0x1f1385,null))['catch'](handleError(_0x1f1385,null));};exports['create']=function(_0xffa83,_0x524373){return db[_0x3fe5('0x27')][_0x3fe5('0x43')](_0xffa83[_0x3fe5('0x44')],{})['then'](function(_0x33e53d){var _0x1b479d=_0xffa83['user'][_0x3fe5('0x45')]({'plain':!![]});if(!_0x1b479d)throw new Error(_0x3fe5('0x46'));if(_0x1b479d['role']===_0x3fe5('0x47')){var _0x295200=_0x33e53d[_0x3fe5('0x45')]({'plain':!![]});var _0x548a72=_0x3fe5('0x48');return db[_0x3fe5('0x49')][_0x3fe5('0x42')]({'where':{'name':_0x548a72,'userProfileId':_0x1b479d[_0x3fe5('0x4a')]},'raw':!![]})['then'](function(_0x263b74){if(_0x263b74&&_0x263b74[_0x3fe5('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x295200[_0x3fe5('0x24')],'resourceId':_0x295200['id'],'type':_0x3fe5('0x4c'),'sectionId':_0x263b74['id']},{})['then'](function(){return _0x33e53d;});}else{return _0x33e53d;}})['catch'](function(_0x2451b8){logger[_0x3fe5('0x4d')](_0x3fe5('0x4e'),_0x2451b8);throw _0x2451b8;});}return _0x33e53d;})[_0x3fe5('0x20')](respondWithResult(_0x524373,0xc9))[_0x3fe5('0x4f')](handleError(_0x524373,null));};exports[_0x3fe5('0x1f')]=function(_0x216671,_0x31a9d8){if(_0x216671[_0x3fe5('0x44')]['id']){delete _0x216671[_0x3fe5('0x44')]['id'];}return db[_0x3fe5('0x27')][_0x3fe5('0x42')]({'where':{'id':_0x216671['params']['id']}})['then'](handleEntityNotFound(_0x31a9d8,null))['then'](saveUpdates(_0x216671[_0x3fe5('0x44')],null))[_0x3fe5('0x20')](respondWithResult(_0x31a9d8,null))[_0x3fe5('0x4f')](handleError(_0x31a9d8,null));};exports[_0x3fe5('0x21')]=function(_0xd6c261,_0x1c846e){return db[_0x3fe5('0x27')][_0x3fe5('0x42')]({'where':{'id':_0xd6c261[_0x3fe5('0x40')]['id']}})[_0x3fe5('0x20')](handleEntityNotFound(_0x1c846e,null))[_0x3fe5('0x20')](removeEntity(_0x1c846e,null))[_0x3fe5('0x4f')](handleError(_0x1c846e,null));};exports[_0x3fe5('0x50')]=function(_0x2c4be8,_0x38f842){var _0x14110e=0xa;var _0x298528=[_0x3fe5('0x51'),_0x3fe5('0x52'),_0x3fe5('0x53'),_0x3fe5('0x54')];var _0x2431b6={'SUM':_0x3fe5('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3fe5('0x56'),'MAX':_0x3fe5('0x57'),'MIN':_0x3fe5('0x58'),'AVG':_0x3fe5('0x59'),'GROUP_CONCAT':_0x3fe5('0x5a'),'GROUP_CONCAT ASC':_0x3fe5('0x5b'),'GROUP_CONCAT DESC':_0x3fe5('0x5c')};var _0x12e23e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3fe5('0x5d'),'HOUR':_0x3fe5('0x5e'),'ROUND':_0x3fe5('0x5f'),'UNIX_TIMESTAMP':_0x3fe5('0x60')};var _0x150b3b=function(_0x5631db){return!_[_0x3fe5('0x61')]([_0x3fe5('0x62'),_0x3fe5('0x63'),_0x3fe5('0x64'),_0x3fe5('0x65')],_0x5631db);};var _0x41d71d=function(_0x26e221){if(!_0x26e221||!_0x26e221['rules']['length']){return'';}for(var _0xd2a24f='(',_0x5371cc=0x0;_0x5371cc<_0x26e221[_0x3fe5('0x66')][_0x3fe5('0x41')];_0x5371cc+=0x1){_0x5371cc>0x0&&(_0xd2a24f+='\x20'+_0x26e221['operator']+'\x20');_0xd2a24f+=_0x26e221[_0x3fe5('0x66')][_0x5371cc]['group']?_0x41d71d(_0x26e221[_0x3fe5('0x66')][_0x5371cc][_0x3fe5('0x67')]):_0x26e221[_0x3fe5('0x66')][_0x5371cc]['field']+'\x20'+_0x26e221[_0x3fe5('0x66')][_0x5371cc]['condition']+(_0x150b3b(_0x26e221[_0x3fe5('0x66')][_0x5371cc][_0x3fe5('0x68')])?'\x20'+_0x26e221[_0x3fe5('0x66')][_0x5371cc]['value']:'');}return _0xd2a24f+')';};var _0x1ec3c7={'where':{'id':_0x2c4be8[_0x3fe5('0x40')]['id']}},_0xb978fb,_0x18c7e2,_0x4754cb,_0x2394ec,_0x2ba8bb;_0x1ec3c7=_[_0x3fe5('0x39')]({},_0x1ec3c7,_0x2c4be8[_0x3fe5('0x3b')]);return db[_0x3fe5('0x27')][_0x3fe5('0x42')](_0x1ec3c7)[_0x3fe5('0x20')](function(_0x3c2a30){if(_0x3c2a30){_0xb978fb=_0x3c2a30;return _0x3c2a30[_0x3fe5('0x69')]();}return null;})[_0x3fe5('0x20')](function(_0x222ab6){if(_0x222ab6){if(!_0x222ab6[_0x3fe5('0x41')]){throw new db[(_0x3fe5('0x6a'))][(_0x3fe5('0x6b'))](_0x3fe5('0x6c'),0x193);}_0x18c7e2=_0x222ab6;return db['AnalyticMetric'][_0x3fe5('0x6d')]({'raw':!![]});}return null;})[_0x3fe5('0x20')](function(_0x5326f6){if(_0x5326f6){_0x4754cb=_[_0x3fe5('0x6e')](_0x5326f6,'id');var _0x31f57e;var _0x23dec5=squel['select']();_0x23dec5[_0x3fe5('0x6f')](_0xb978fb[_0x3fe5('0x70')]);for(var _0x57f23f=0x0;_0x57f23f<_0x18c7e2['length'];_0x57f23f+=0x1){_0x31f57e=_0x18c7e2[_0x57f23f][_0x3fe5('0x71')]?_0x4754cb[_0x18c7e2[_0x57f23f][_0x3fe5('0x71')]][_0x3fe5('0x72')]:_0x18c7e2[_0x57f23f]['field'];_0x31f57e=_0x18c7e2[_0x57f23f][_0x3fe5('0x73')]?_[_0x3fe5('0x74')](_0x2431b6[_0x18c7e2[_0x57f23f][_0x3fe5('0x73')]],'%s',_0x31f57e):_0x31f57e;_0x31f57e=_0x18c7e2[_0x57f23f]['format']?_[_0x3fe5('0x74')](_0x12e23e[_0x18c7e2[_0x57f23f]['format']],'%s',_0x31f57e):_0x31f57e;if(_0x18c7e2[_0x57f23f][_0x3fe5('0x75')]){_0x23dec5['group'](_0x31f57e);}_0x18c7e2[_0x57f23f][_0x3fe5('0x76')]&&_0x23dec5[_0x3fe5('0x33')](_0x31f57e,_0x18c7e2[_0x57f23f][_0x3fe5('0x76')]===_0x3fe5('0x77')?![]:!![]);_0x23dec5['field'](_0x31f57e,_0x18c7e2[_0x57f23f][_0x3fe5('0x78')]||_0x31f57e);}if(_0xb978fb['joins']){_0xb978fb[_0x3fe5('0x79')]=JSON[_0x3fe5('0x7a')](_0xb978fb[_0x3fe5('0x79')]);for(var _0x42c9fd=0x0;_0x42c9fd<_0xb978fb[_0x3fe5('0x79')][_0x3fe5('0x41')];_0x42c9fd+=0x1){if(_0xb978fb[_0x3fe5('0x79')][_0x42c9fd][_0x3fe5('0x29')]&&_[_0x3fe5('0x61')](_0x298528,_0xb978fb[_0x3fe5('0x79')][_0x42c9fd][_0x3fe5('0x29')])&&_0xb978fb['joins'][_0x42c9fd][_0x3fe5('0x7b')]&&_0xb978fb[_0x3fe5('0x79')][_0x42c9fd][_0x3fe5('0x7c')]&&_0xb978fb[_0x3fe5('0x79')][_0x42c9fd][_0x3fe5('0x7d')]){_0x23dec5[_0xb978fb['joins'][_0x42c9fd][_0x3fe5('0x29')]](_0xb978fb[_0x3fe5('0x79')][_0x42c9fd]['foreignTable'],null,util['format'](_0x3fe5('0x7e'),_0xb978fb['table'],_0xb978fb[_0x3fe5('0x79')][_0x42c9fd][_0x3fe5('0x7b')],_0xb978fb['joins'][_0x42c9fd]['foreignTable'],_0xb978fb[_0x3fe5('0x79')][_0x42c9fd][_0x3fe5('0x7d')]));}}}if(_0xb978fb['conditions']){_0xb978fb[_0x3fe5('0x7f')]=JSON[_0x3fe5('0x7a')](_0xb978fb['conditions']);_0x23dec5[_0x3fe5('0x35')](_0x41d71d(_0xb978fb[_0x3fe5('0x7f')][_0x3fe5('0x67')]));}_0x2ba8bb=_0x23dec5[_0x3fe5('0x80')]();_0x23dec5[_0x3fe5('0x1b')](_0x14110e);_0x23dec5[_0x3fe5('0x18')](0x0);logger['debug'](_0x3fe5('0x81'),_0x23dec5[_0x3fe5('0x82')]());return dbH['sequelize'][_0x3fe5('0x2d')](_0x23dec5[_0x3fe5('0x82')](),{'type':dbH[_0x3fe5('0x83')][_0x3fe5('0x84')][_0x3fe5('0x85')]});}})[_0x3fe5('0x20')](respondWithResult(_0x38f842,null))[_0x3fe5('0x4f')](handleError(_0x38f842,null));};function runReport(_0x5ee2e9,_0xae1e2a,_0x21f322){var _0x4da436=_0xae1e2a['name'];var _0x412ab4=0xa;var _0x26089c=[_0x3fe5('0x51'),_0x3fe5('0x52'),'right_join','cross_join'];var _0x4084a4={'SUM':_0x3fe5('0x55'),'COUNT':_0x3fe5('0x86'),'COUNT DISTINCT':_0x3fe5('0x56'),'MAX':_0x3fe5('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x3fe5('0x5a'),'GROUP_CONCAT ASC':_0x3fe5('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x108bec={'SEC_TO_TIME':_0x3fe5('0x87'),'DATE':_0x3fe5('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0x3fe5('0x5f'),'UNIX_TIMESTAMP':_0x3fe5('0x60')};var _0x1a65da=function(_0x34d679){return!_[_0x3fe5('0x61')](['IS\x20NULL',_0x3fe5('0x63'),'IS\x20EMPTY',_0x3fe5('0x65')],_0x34d679);};var _0x338acb=function(_0x28a74c){if(!_0x28a74c||!_0x28a74c[_0x3fe5('0x66')][_0x3fe5('0x41')]){return'';}for(var _0x196d8e='(',_0x4bdab6=0x0;_0x4bdab6<_0x28a74c[_0x3fe5('0x66')][_0x3fe5('0x41')];_0x4bdab6+=0x1){_0x4bdab6>0x0&&(_0x196d8e+='\x20'+_0x28a74c[_0x3fe5('0x88')]+'\x20');_0x196d8e+=_0x28a74c['rules'][_0x4bdab6][_0x3fe5('0x67')]?_0x338acb(_0x28a74c[_0x3fe5('0x66')][_0x4bdab6]['group']):_0x28a74c[_0x3fe5('0x66')][_0x4bdab6][_0x3fe5('0x89')]+'\x20'+_0x28a74c[_0x3fe5('0x66')][_0x4bdab6][_0x3fe5('0x68')]+(_0x1a65da(_0x28a74c[_0x3fe5('0x66')][_0x4bdab6][_0x3fe5('0x68')])?'\x20'+_0x28a74c['rules'][_0x4bdab6]['value']:'');}return _0x196d8e+')';};var _0x3baf3f={'where':{'id':_0x5ee2e9['id']}},_0x40b390,_0x4c6d11,_0x457584,_0x699ee7,_0x2a2db4;_0x3baf3f=_[_0x3fe5('0x39')]({},_0x3baf3f,_0x21f322);return db['AnalyticCustomReport'][_0x3fe5('0x42')](_0x3baf3f)['then'](function(_0x54ff50){if(_0x54ff50){_0x40b390=_0x54ff50;return _0x54ff50[_0x3fe5('0x69')]();}return null;})[_0x3fe5('0x20')](function(_0x58fef9){if(_0x58fef9){if(!_0x58fef9[_0x3fe5('0x41')]){throw new db[(_0x3fe5('0x6a'))]['ValidationErrorItem'](_0x3fe5('0x6c'),0x193);}_0x4c6d11=_0x58fef9;return db[_0x3fe5('0x8a')][_0x3fe5('0x6d')]({'raw':!![]});}return null;})[_0x3fe5('0x20')](function(_0x3df72c){if(_0x3df72c){_0x457584=_[_0x3fe5('0x6e')](_0x3df72c,'id');var _0x318499;var _0x3c974a=squel['select']();_0x3c974a['from'](_0x40b390['table']);for(var _0x501134=0x0;_0x501134<_0x4c6d11[_0x3fe5('0x41')];_0x501134+=0x1){_0x318499=_0x4c6d11[_0x501134][_0x3fe5('0x71')]?_0x457584[_0x4c6d11[_0x501134][_0x3fe5('0x71')]][_0x3fe5('0x72')]:_0x4c6d11[_0x501134][_0x3fe5('0x89')];_0x318499=_0x4c6d11[_0x501134][_0x3fe5('0x73')]?_[_0x3fe5('0x74')](_0x4084a4[_0x4c6d11[_0x501134][_0x3fe5('0x73')]],'%s',_0x318499):_0x318499;_0x318499=_0x4c6d11[_0x501134]['format']?_[_0x3fe5('0x74')](_0x108bec[_0x4c6d11[_0x501134][_0x3fe5('0x8b')]],'%s',_0x318499):_0x318499;if(_0x4c6d11[_0x501134]['groupBy']){_0x3c974a[_0x3fe5('0x67')](_0x318499);}_0x4c6d11[_0x501134][_0x3fe5('0x76')]&&_0x3c974a[_0x3fe5('0x33')](_0x318499,_0x4c6d11[_0x501134]['orderBy']===_0x3fe5('0x77')?![]:!![]);_0x3c974a[_0x3fe5('0x89')](_0x318499,_0x4c6d11[_0x501134][_0x3fe5('0x78')]||_0x318499);}if(_0x40b390[_0x3fe5('0x79')]){_0x40b390[_0x3fe5('0x79')]=JSON[_0x3fe5('0x7a')](_0x40b390[_0x3fe5('0x79')]);for(var _0x2daaaa=0x0;_0x2daaaa<_0x40b390[_0x3fe5('0x79')][_0x3fe5('0x41')];_0x2daaaa+=0x1){if(_0x40b390[_0x3fe5('0x79')][_0x2daaaa]['type']&&_[_0x3fe5('0x61')](_0x26089c,_0x40b390[_0x3fe5('0x79')][_0x2daaaa][_0x3fe5('0x29')])&&_0x40b390[_0x3fe5('0x79')][_0x2daaaa][_0x3fe5('0x7b')]&&_0x40b390[_0x3fe5('0x79')][_0x2daaaa][_0x3fe5('0x7c')]&&_0x40b390[_0x3fe5('0x79')][_0x2daaaa][_0x3fe5('0x7d')]){_0x3c974a[_0x40b390[_0x3fe5('0x79')][_0x2daaaa][_0x3fe5('0x29')]](_0x40b390[_0x3fe5('0x79')][_0x2daaaa]['foreignTable'],null,util[_0x3fe5('0x8b')](_0x3fe5('0x7e'),_0x40b390[_0x3fe5('0x70')],_0x40b390[_0x3fe5('0x79')][_0x2daaaa][_0x3fe5('0x7b')],_0x40b390[_0x3fe5('0x79')][_0x2daaaa][_0x3fe5('0x7c')],_0x40b390[_0x3fe5('0x79')][_0x2daaaa]['foreignKey']));}}}if(_0x40b390[_0x3fe5('0x7f')]){_0x40b390['conditions']=JSON[_0x3fe5('0x7a')](_0x40b390[_0x3fe5('0x7f')]);_0x3c974a['where'](_0x338acb(_0x40b390[_0x3fe5('0x7f')][_0x3fe5('0x67')]));}_0x2a2db4=_0x3c974a[_0x3fe5('0x80')]();_0x3c974a[_0x3fe5('0x1b')](_0x412ab4);_0x3c974a[_0x3fe5('0x18')](0x0);return;}})['then'](function(){if(_0xae1e2a[_0x3fe5('0x8c')]==='web'){return null;}var _0xdbdb88=_[_0x3fe5('0x39')](_0xae1e2a,{'name':_0xae1e2a['fullPath']||_0xae1e2a['name']||_0x40b390['name'],'basename':_0x4da436,'savename':util[_0x3fe5('0x8b')](_0x3fe5('0x8d'),_0xae1e2a[_0x3fe5('0x24')]||_0x40b390[_0x3fe5('0x24')],require('randomstring')[_0x3fe5('0x8e')](0x4),_0xae1e2a['output']||_0x3fe5('0x8f')),'reportId':_0x40b390['id'],'reportType':_0x3fe5('0x90')});return db[_0x3fe5('0x91')][_0x3fe5('0x43')](_0xdbdb88,{'raw':!![]});})['then'](function(_0x5e20a6){if(_0x40b390[_0x3fe5('0x70')]===_0x3fe5('0x92')){_0x2a2db4['where'](_0x40b390[_0x3fe5('0x70')]+_0x3fe5('0x93'),_0xae1e2a[_0x3fe5('0x94')],_0xae1e2a[_0x3fe5('0x95')]);}else{_0x2a2db4[_0x3fe5('0x35')](_0x40b390[_0x3fe5('0x70')]+_0x3fe5('0x96'),_0xae1e2a[_0x3fe5('0x94')],_0xae1e2a[_0x3fe5('0x95')]);}if(_0x5e20a6){logger[_0x3fe5('0x97')](_0x3fe5('0x98'),_0x2a2db4[_0x3fe5('0x82')]());require(_0x3fe5('0x99'))['fork'](path[_0x3fe5('0x51')](__dirname,'../../components/export/',_0x5e20a6[_0x3fe5('0x8c')]),[_0x5e20a6['id'],_0x2a2db4[_0x3fe5('0x82')](),path[_0x3fe5('0x51')](__dirname,_0x3fe5('0x9a'),_0x5e20a6[_0x3fe5('0x9b')]),_0x4da436]);return _0x5e20a6;}else{var _0x41b937=squel[_0x3fe5('0x9c')]();_0x41b937['from']('('+_0x2a2db4['toString']()+')',_0x3fe5('0x9d'));_0x41b937[_0x3fe5('0x89')](_0x3fe5('0x9e'),'count');_0x2a2db4[_0x3fe5('0x1b')](_0xae1e2a[_0x3fe5('0x1b')]||_0x412ab4);_0x2a2db4['offset'](_0xae1e2a[_0x3fe5('0x18')]||0x0);return dbH[_0x3fe5('0x83')][_0x3fe5('0x2d')](_0x41b937[_0x3fe5('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0x3fe5('0x85')]})[_0x3fe5('0x20')](function(_0x57a356){if(!_0x57a356[_0x3fe5('0x41')]){_0x699ee7=0x0;}else{_0x699ee7=_0x57a356[0x0][_0x3fe5('0x1a')]||0x0;}return dbH['sequelize'][_0x3fe5('0x2d')](_0x2a2db4[_0x3fe5('0x82')](),{'type':dbH['sequelize'][_0x3fe5('0x84')]['SELECT']});})[_0x3fe5('0x20')](function(_0x583ce3){return{'rows':_0x583ce3||[],'count':_0x699ee7};});}});}exports[_0x3fe5('0x9f')]=function(_0x12c750,_0x1ddc27){return runReport(_0x12c750['params'],_0x12c750['query'],_0x12c750[_0x3fe5('0x3b')])['then'](respondWithResult(_0x1ddc27,null))[_0x3fe5('0x4f')](handleError(_0x1ddc27,null));};exports[_0x3fe5('0xa0')]=runReport;exports[_0x3fe5('0x2d')]=function(_0x22d82d,_0x5a5173){var _0x1f9f4c=0xa;var _0x11842f=[_0x3fe5('0x51'),_0x3fe5('0x52'),'right_join','cross_join'];var _0x145f09={'SUM':_0x3fe5('0x55'),'COUNT':_0x3fe5('0x86'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3fe5('0x57'),'MIN':'MIN(%s)','AVG':_0x3fe5('0x59'),'GROUP_CONCAT':_0x3fe5('0x5a'),'GROUP_CONCAT ASC':_0x3fe5('0x5b'),'GROUP_CONCAT DESC':_0x3fe5('0x5c')};var _0x3e75d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x3fe5('0x5e'),'ROUND':_0x3fe5('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x40cd79=function(_0x475e90){return!_[_0x3fe5('0x61')]([_0x3fe5('0x62'),_0x3fe5('0x63'),_0x3fe5('0x64'),_0x3fe5('0x65')],_0x475e90);};var _0x4f87df=function(_0x545823){if(!_0x545823||!_0x545823[_0x3fe5('0x66')][_0x3fe5('0x41')]){return'';}for(var _0x2f47f8='(',_0x503b39=0x0;_0x503b39<_0x545823[_0x3fe5('0x66')]['length'];_0x503b39+=0x1){_0x503b39>0x0&&(_0x2f47f8+='\x20'+_0x545823[_0x3fe5('0x88')]+'\x20');_0x2f47f8+=_0x545823['rules'][_0x503b39][_0x3fe5('0x67')]?_0x4f87df(_0x545823[_0x3fe5('0x66')][_0x503b39]['group']):_0x545823[_0x3fe5('0x66')][_0x503b39][_0x3fe5('0x89')]+'\x20'+_0x545823[_0x3fe5('0x66')][_0x503b39][_0x3fe5('0x68')]+(_0x40cd79(_0x545823[_0x3fe5('0x66')][_0x503b39][_0x3fe5('0x68')])?'\x20'+_0x545823[_0x3fe5('0x66')][_0x503b39]['value']:'');}return _0x2f47f8+')';};var _0x4a4a67={'where':{'id':_0x22d82d[_0x3fe5('0x40')]['id']}},_0x20a918,_0xd0dcf,_0x471623,_0x2795a6,_0x33e61c;_0x4a4a67=_['merge']({},_0x4a4a67,_0x22d82d[_0x3fe5('0x3b')]);return db[_0x3fe5('0x27')][_0x3fe5('0x42')](_0x4a4a67)['then'](function(_0x46ace7){if(_0x46ace7){_0x20a918=_0x46ace7;return _0x46ace7[_0x3fe5('0x69')]();}return null;})[_0x3fe5('0x20')](function(_0x1bec7b){if(_0x1bec7b){if(!_0x1bec7b['length']){throw new db[(_0x3fe5('0x6a'))][(_0x3fe5('0x6b'))](_0x3fe5('0x6c'),0x193);}_0xd0dcf=_0x1bec7b;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x3fe5('0x20')](function(_0x9cbf8e){if(_0x9cbf8e){_0x471623=_[_0x3fe5('0x6e')](_0x9cbf8e,'id');var _0x530318;var _0xcb59f7=squel[_0x3fe5('0x9c')]();_0xcb59f7['from'](_0x20a918[_0x3fe5('0x70')]);for(var _0x2ba808=0x0;_0x2ba808<_0xd0dcf[_0x3fe5('0x41')];_0x2ba808+=0x1){_0x530318=_0xd0dcf[_0x2ba808][_0x3fe5('0x71')]?_0x471623[_0xd0dcf[_0x2ba808][_0x3fe5('0x71')]][_0x3fe5('0x72')]:_0xd0dcf[_0x2ba808][_0x3fe5('0x89')];_0x530318=_0xd0dcf[_0x2ba808][_0x3fe5('0x73')]?_[_0x3fe5('0x74')](_0x145f09[_0xd0dcf[_0x2ba808]['function']],'%s',_0x530318):_0x530318;_0x530318=_0xd0dcf[_0x2ba808][_0x3fe5('0x8b')]?_[_0x3fe5('0x74')](_0x3e75d2[_0xd0dcf[_0x2ba808][_0x3fe5('0x8b')]],'%s',_0x530318):_0x530318;if(_0xd0dcf[_0x2ba808]['groupBy']){_0xcb59f7['group'](_0x530318);}_0xd0dcf[_0x2ba808]['orderBy']&&_0xcb59f7[_0x3fe5('0x33')](_0x530318,_0xd0dcf[_0x2ba808][_0x3fe5('0x76')]===_0x3fe5('0x77')?![]:!![]);_0xcb59f7[_0x3fe5('0x89')](_0x530318,_0xd0dcf[_0x2ba808]['alias']||_0x530318);}if(_0x20a918[_0x3fe5('0x79')]){_0x20a918[_0x3fe5('0x79')]=JSON[_0x3fe5('0x7a')](_0x20a918[_0x3fe5('0x79')]);for(var _0x3929b6=0x0;_0x3929b6<_0x20a918[_0x3fe5('0x79')][_0x3fe5('0x41')];_0x3929b6+=0x1){if(_0x20a918[_0x3fe5('0x79')][_0x3929b6][_0x3fe5('0x29')]&&_[_0x3fe5('0x61')](_0x11842f,_0x20a918['joins'][_0x3929b6][_0x3fe5('0x29')])&&_0x20a918['joins'][_0x3929b6]['parentKey']&&_0x20a918[_0x3fe5('0x79')][_0x3929b6][_0x3fe5('0x7c')]&&_0x20a918[_0x3fe5('0x79')][_0x3929b6]['foreignKey']){_0xcb59f7[_0x20a918['joins'][_0x3929b6][_0x3fe5('0x29')]](_0x20a918[_0x3fe5('0x79')][_0x3929b6][_0x3fe5('0x7c')],null,util[_0x3fe5('0x8b')]('%s.%s\x20=\x20%s.%s',_0x20a918[_0x3fe5('0x70')],_0x20a918[_0x3fe5('0x79')][_0x3929b6][_0x3fe5('0x7b')],_0x20a918[_0x3fe5('0x79')][_0x3929b6][_0x3fe5('0x7c')],_0x20a918[_0x3fe5('0x79')][_0x3929b6][_0x3fe5('0x7d')]));}}}if(_0x20a918[_0x3fe5('0x7f')]){_0x20a918[_0x3fe5('0x7f')]=JSON[_0x3fe5('0x7a')](_0x20a918[_0x3fe5('0x7f')]);_0xcb59f7[_0x3fe5('0x35')](_0x4f87df(_0x20a918[_0x3fe5('0x7f')][_0x3fe5('0x67')]));}_0x33e61c=_0xcb59f7[_0x3fe5('0x80')]();_0xcb59f7[_0x3fe5('0x1b')](_0x1f9f4c);_0xcb59f7[_0x3fe5('0x18')](0x0);logger[_0x3fe5('0xa1')](_0x3fe5('0x81'),_0xcb59f7['toString']());return dbH[_0x3fe5('0x83')][_0x3fe5('0x2d')](_0xcb59f7[_0x3fe5('0x82')](),{'type':dbH[_0x3fe5('0x83')][_0x3fe5('0x84')][_0x3fe5('0x85')]});}})[_0x3fe5('0x20')](function(){return{'sql':_0x33e61c[_0x3fe5('0x82')]()};})['then'](respondWithResult(_0x5a5173,null))[_0x3fe5('0x4f')](handleError(_0x5a5173,null));};
\ No newline at end of file
+var _0x9136=['limit','count','set','Content-Range','json','apply','reject','save','destroy','then','get','CustomReports','UserProfileResource','status','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','create','error','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','select','metric','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','offset','undefined'];(function(_0xcb20f4,_0x1b4313){var _0x36f3b1=function(_0x18f7d1){while(--_0x18f7d1){_0xcb20f4['push'](_0xcb20f4['shift']());}};_0x36f3b1(++_0x1b4313);}(_0x9136,0x138));var _0x6913=function(_0x371bc3,_0x413268){_0x371bc3=_0x371bc3-0x0;var _0x5002b2=_0x9136[_0x371bc3];return _0x5002b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6913('0x0'));var zipdir=require(_0x6913('0x1'));var jsonpatch=require(_0x6913('0x2'));var rp=require(_0x6913('0x3'));var moment=require(_0x6913('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6913('0x5'));var util=require(_0x6913('0x6'));var path=require('path');var sox=require(_0x6913('0x7'));var csv=require('to-csv');var ejs=require(_0x6913('0x8'));var fs=require('fs');var fs_extra=require(_0x6913('0x9'));var _=require('lodash');var squel=require(_0x6913('0xa'));var crypto=require(_0x6913('0xb'));var jsforce=require(_0x6913('0xc'));var deskjs=require(_0x6913('0xd'));var toCsv=require(_0x6913('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6913('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6913('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6913('0x11'));var logger=require(_0x6913('0x12'))(_0x6913('0x13'));var utils=require(_0x6913('0x14'));var config=require(_0x6913('0x15'));var licenseUtil=require(_0x6913('0x16'));var db=require(_0x6913('0x17'))['db'];var dbH=require('../../mysqldb')[_0x6913('0x18')];function respondWithStatusCode(_0x536d4c,_0x3c0fa9){_0x3c0fa9=_0x3c0fa9||0xcc;return function(_0x1944bd){if(_0x1944bd){return _0x536d4c[_0x6913('0x19')](_0x3c0fa9);}return _0x536d4c['status'](_0x3c0fa9)['end']();};}function respondWithResult(_0x5b6128,_0x4702ce){_0x4702ce=_0x4702ce||0xc8;return function(_0x1774c2){if(_0x1774c2){return _0x5b6128['status'](_0x4702ce)['json'](_0x1774c2);}};}function respondWithFilteredResult(_0x35f7db,_0x1292e7){return function(_0x4c89ae){if(_0x4c89ae){var _0x4e7779=typeof _0x1292e7[_0x6913('0x1a')]===_0x6913('0x1b')&&typeof _0x1292e7[_0x6913('0x1c')]===_0x6913('0x1b');var _0x3564be=_0x4c89ae[_0x6913('0x1d')];var _0x1d1bb1=_0x4e7779?0x0:_0x1292e7[_0x6913('0x1a')];var _0x493183=_0x4e7779?_0x4c89ae[_0x6913('0x1d')]:_0x1292e7[_0x6913('0x1a')]+_0x1292e7[_0x6913('0x1c')];var _0x272914;if(_0x493183>=_0x3564be){_0x493183=_0x3564be;_0x272914=0xc8;}else{_0x272914=0xce;}_0x35f7db['status'](_0x272914);return _0x35f7db[_0x6913('0x1e')](_0x6913('0x1f'),_0x1d1bb1+'-'+_0x493183+'/'+_0x3564be)[_0x6913('0x20')](_0x4c89ae);}return null;};}function patchUpdates(_0x79a955){return function(_0x256029){try{jsonpatch[_0x6913('0x21')](_0x256029,_0x79a955,!![]);}catch(_0x303628){return BPromise[_0x6913('0x22')](_0x303628);}return _0x256029[_0x6913('0x23')]();};}function saveUpdates(_0x10ca15,_0x3bc34f){return function(_0x18748e){if(_0x18748e){return _0x18748e['update'](_0x10ca15)['then'](function(_0x33bb8c){return _0x33bb8c;});}return null;};}function removeEntity(_0x3c9f0a,_0x44e010){return function(_0x321efd){if(_0x321efd){return _0x321efd[_0x6913('0x24')]()[_0x6913('0x25')](function(){var _0x4321f1=_0x321efd[_0x6913('0x26')]({'plain':!![]});var _0x1d7cfc=_0x6913('0x27');return db[_0x6913('0x28')][_0x6913('0x24')]({'where':{'type':_0x1d7cfc,'resourceId':_0x4321f1['id']}})[_0x6913('0x25')](function(){return _0x321efd;});})[_0x6913('0x25')](function(){_0x3c9f0a[_0x6913('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x114d5b,_0x4f59af){return function(_0x161844){if(!_0x161844){_0x114d5b[_0x6913('0x19')](0x194);}return _0x161844;};}function handleError(_0x39bba6,_0xc3b9be){_0xc3b9be=_0xc3b9be||0x1f4;return function(_0x95228b){logger['error'](_0x95228b['stack']);if(_0x95228b[_0x6913('0x2a')]){delete _0x95228b[_0x6913('0x2a')];}_0x39bba6[_0x6913('0x29')](_0xc3b9be)[_0x6913('0x2b')](_0x95228b);};}exports['index']=function(_0x4231c5,_0x3e0001){var _0x3b75c2={},_0x9f7704={},_0x4a73ed={'count':0x0,'rows':[]};var _0x2bbfb3=_[_0x6913('0x2c')](db[_0x6913('0x2d')][_0x6913('0x2e')],function(_0x37fad7){return{'name':_0x37fad7[_0x6913('0x2f')],'type':_0x37fad7[_0x6913('0x30')]['key']};});_0x9f7704[_0x6913('0x31')]=_['map'](_0x2bbfb3,_0x6913('0x2a'));_0x9f7704['query']=_[_0x6913('0x32')](_0x4231c5['query']);_0x9f7704[_0x6913('0x33')]=_[_0x6913('0x34')](_0x9f7704[_0x6913('0x31')],_0x9f7704[_0x6913('0x35')]);_0x3b75c2[_0x6913('0x36')]=_[_0x6913('0x34')](_0x9f7704[_0x6913('0x31')],qs[_0x6913('0x37')](_0x4231c5[_0x6913('0x35')][_0x6913('0x37')]));_0x3b75c2[_0x6913('0x36')]=_0x3b75c2[_0x6913('0x36')][_0x6913('0x38')]?_0x3b75c2['attributes']:_0x9f7704['model'];if(!_0x4231c5['query'][_0x6913('0x39')](_0x6913('0x3a'))){_0x3b75c2[_0x6913('0x1c')]=qs[_0x6913('0x1c')](_0x4231c5[_0x6913('0x35')]['limit']);_0x3b75c2[_0x6913('0x1a')]=qs[_0x6913('0x1a')](_0x4231c5[_0x6913('0x35')][_0x6913('0x1a')]);}_0x3b75c2[_0x6913('0x3b')]=qs[_0x6913('0x3c')](_0x4231c5[_0x6913('0x35')][_0x6913('0x3c')]);_0x3b75c2[_0x6913('0x3d')]=qs[_0x6913('0x33')](_[_0x6913('0x3e')](_0x4231c5['query'],_0x9f7704['filters']),_0x2bbfb3);if(_0x4231c5['query'][_0x6913('0x3f')]){_0x3b75c2[_0x6913('0x3d')]=_[_0x6913('0x40')](_0x3b75c2[_0x6913('0x3d')],{'$or':_['map'](_0x2bbfb3,function(_0x1f984d){if(_0x1f984d[_0x6913('0x30')]!==_0x6913('0x41')){var _0x40013f={};_0x40013f[_0x1f984d[_0x6913('0x2a')]]={'$like':'%'+_0x4231c5[_0x6913('0x35')][_0x6913('0x3f')]+'%'};return _0x40013f;}})});}_0x3b75c2=_[_0x6913('0x40')]({},_0x3b75c2,_0x4231c5['options']);var _0x56e501={'where':_0x3b75c2[_0x6913('0x3d')]};return db[_0x6913('0x2d')][_0x6913('0x1d')](_0x56e501)['then'](function(_0x145226){_0x4a73ed[_0x6913('0x1d')]=_0x145226;if(_0x4231c5[_0x6913('0x35')][_0x6913('0x42')]){_0x3b75c2[_0x6913('0x43')]=[{'all':!![]}];}return db[_0x6913('0x2d')]['findAll'](_0x3b75c2);})[_0x6913('0x25')](function(_0x24bf9c){_0x4a73ed[_0x6913('0x44')]=_0x24bf9c;return _0x4a73ed;})['then'](respondWithFilteredResult(_0x3e0001,_0x3b75c2))[_0x6913('0x45')](handleError(_0x3e0001,null));};exports[_0x6913('0x46')]=function(_0x5ce945,_0x5dfa75){var _0x249598={'raw':![],'where':{'id':_0x5ce945[_0x6913('0x47')]['id']}},_0x2eae09={};_0x2eae09[_0x6913('0x31')]=_[_0x6913('0x32')](db[_0x6913('0x2d')]['rawAttributes']);_0x2eae09['query']=_['keys'](_0x5ce945[_0x6913('0x35')]);_0x2eae09[_0x6913('0x33')]=_[_0x6913('0x34')](_0x2eae09[_0x6913('0x31')],_0x2eae09['query']);_0x249598[_0x6913('0x36')]=_[_0x6913('0x34')](_0x2eae09[_0x6913('0x31')],qs[_0x6913('0x37')](_0x5ce945['query'][_0x6913('0x37')]));_0x249598[_0x6913('0x36')]=_0x249598['attributes'][_0x6913('0x38')]?_0x249598['attributes']:_0x2eae09['model'];if(_0x5ce945[_0x6913('0x35')][_0x6913('0x42')]){_0x249598[_0x6913('0x43')]=[{'all':!![]}];}_0x249598=_[_0x6913('0x40')]({},_0x249598,_0x5ce945[_0x6913('0x48')]);return db['AnalyticCustomReport'][_0x6913('0x49')](_0x249598)[_0x6913('0x25')](handleEntityNotFound(_0x5dfa75,null))[_0x6913('0x25')](respondWithResult(_0x5dfa75,null))[_0x6913('0x45')](handleError(_0x5dfa75,null));};exports['create']=function(_0x1acab2,_0x58412c){return db[_0x6913('0x2d')]['create'](_0x1acab2[_0x6913('0x4a')],{})[_0x6913('0x25')](function(_0x33e3c6){var _0x3b8354=_0x1acab2[_0x6913('0x4b')]['get']({'plain':!![]});if(!_0x3b8354)throw new Error(_0x6913('0x4c'));if(_0x3b8354[_0x6913('0x4d')]===_0x6913('0x4b')){var _0x1bd8bb=_0x33e3c6[_0x6913('0x26')]({'plain':!![]});var _0x35535e=_0x6913('0x4e');return db[_0x6913('0x4f')][_0x6913('0x49')]({'where':{'name':_0x35535e,'userProfileId':_0x3b8354[_0x6913('0x50')]},'raw':!![]})[_0x6913('0x25')](function(_0x25955c){if(_0x25955c&&_0x25955c[_0x6913('0x51')]===0x0){return db[_0x6913('0x28')][_0x6913('0x52')]({'name':_0x1bd8bb[_0x6913('0x2a')],'resourceId':_0x1bd8bb['id'],'type':_0x6913('0x27'),'sectionId':_0x25955c['id']},{})[_0x6913('0x25')](function(){return _0x33e3c6;});}else{return _0x33e3c6;}})[_0x6913('0x45')](function(_0x9e2b77){logger[_0x6913('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9e2b77);throw _0x9e2b77;});}return _0x33e3c6;})[_0x6913('0x25')](respondWithResult(_0x58412c,0xc9))[_0x6913('0x45')](handleError(_0x58412c,null));};exports[_0x6913('0x54')]=function(_0x1aa168,_0x21dba2){if(_0x1aa168['body']['id']){delete _0x1aa168[_0x6913('0x4a')]['id'];}return db[_0x6913('0x2d')][_0x6913('0x49')]({'where':{'id':_0x1aa168['params']['id']}})[_0x6913('0x25')](handleEntityNotFound(_0x21dba2,null))['then'](saveUpdates(_0x1aa168[_0x6913('0x4a')],null))[_0x6913('0x25')](respondWithResult(_0x21dba2,null))[_0x6913('0x45')](handleError(_0x21dba2,null));};exports[_0x6913('0x24')]=function(_0x39ff22,_0x4d715e){return db['AnalyticCustomReport'][_0x6913('0x49')]({'where':{'id':_0x39ff22[_0x6913('0x47')]['id']}})[_0x6913('0x25')](handleEntityNotFound(_0x4d715e,null))[_0x6913('0x25')](removeEntity(_0x4d715e,null))[_0x6913('0x45')](handleError(_0x4d715e,null));};exports[_0x6913('0x55')]=function(_0x2967c7,_0x2b3c83){var _0x2a900b=0xa;var _0x3be128=[_0x6913('0x56'),_0x6913('0x57'),_0x6913('0x58'),_0x6913('0x59')];var _0x15c8a3={'SUM':_0x6913('0x5a'),'COUNT':_0x6913('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6913('0x5c'),'MIN':_0x6913('0x5d'),'AVG':_0x6913('0x5e'),'GROUP_CONCAT':_0x6913('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6913('0x60')};var _0x280e54={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6913('0x61'),'HOUR':_0x6913('0x62'),'ROUND':_0x6913('0x63'),'UNIX_TIMESTAMP':_0x6913('0x64')};var _0x560deb=function(_0x249575){return!_[_0x6913('0x65')]([_0x6913('0x66'),_0x6913('0x67'),_0x6913('0x68'),'IS\x20NOT\x20EMPTY'],_0x249575);};var _0x5999c0=function(_0x66abba){if(!_0x66abba||!_0x66abba[_0x6913('0x69')][_0x6913('0x38')]){return'';}for(var _0x427495='(',_0x17c3f2=0x0;_0x17c3f2<_0x66abba[_0x6913('0x69')][_0x6913('0x38')];_0x17c3f2+=0x1){_0x17c3f2>0x0&&(_0x427495+='\x20'+_0x66abba[_0x6913('0x6a')]+'\x20');_0x427495+=_0x66abba['rules'][_0x17c3f2][_0x6913('0x6b')]?_0x5999c0(_0x66abba[_0x6913('0x69')][_0x17c3f2][_0x6913('0x6b')]):_0x66abba[_0x6913('0x69')][_0x17c3f2]['field']+'\x20'+_0x66abba['rules'][_0x17c3f2][_0x6913('0x6c')]+(_0x560deb(_0x66abba[_0x6913('0x69')][_0x17c3f2][_0x6913('0x6c')])?'\x20'+_0x66abba['rules'][_0x17c3f2][_0x6913('0x6d')]:'');}return _0x427495+')';};var _0x3c53be={'where':{'id':_0x2967c7[_0x6913('0x47')]['id']}},_0x6fff63,_0x3c6565,_0x24cae3,_0x2143d0,_0x46af80;_0x3c53be=_[_0x6913('0x40')]({},_0x3c53be,_0x2967c7[_0x6913('0x48')]);return db[_0x6913('0x2d')][_0x6913('0x49')](_0x3c53be)[_0x6913('0x25')](function(_0x5a6fbe){if(_0x5a6fbe){_0x6fff63=_0x5a6fbe;return _0x5a6fbe[_0x6913('0x6e')]();}return null;})['then'](function(_0x1a260b){if(_0x1a260b){if(!_0x1a260b[_0x6913('0x38')]){throw new db[(_0x6913('0x6f'))][(_0x6913('0x70'))](_0x6913('0x71'),0x193);}_0x3c6565=_0x1a260b;return db[_0x6913('0x72')][_0x6913('0x73')]({'raw':!![]});}return null;})['then'](function(_0x890518){if(_0x890518){_0x24cae3=_[_0x6913('0x74')](_0x890518,'id');var _0x249929;var _0x284960=squel['select']();_0x284960[_0x6913('0x75')](_0x6fff63[_0x6913('0x76')]);for(var _0x51c02a=0x0;_0x51c02a<_0x3c6565[_0x6913('0x38')];_0x51c02a+=0x1){_0x249929=_0x3c6565[_0x51c02a][_0x6913('0x77')]?_0x24cae3[_0x3c6565[_0x51c02a][_0x6913('0x77')]]['metric']:_0x3c6565[_0x51c02a][_0x6913('0x78')];_0x249929=_0x3c6565[_0x51c02a][_0x6913('0x79')]?_[_0x6913('0x7a')](_0x15c8a3[_0x3c6565[_0x51c02a]['function']],'%s',_0x249929):_0x249929;_0x249929=_0x3c6565[_0x51c02a][_0x6913('0x7b')]?_[_0x6913('0x7a')](_0x280e54[_0x3c6565[_0x51c02a][_0x6913('0x7b')]],'%s',_0x249929):_0x249929;if(_0x3c6565[_0x51c02a][_0x6913('0x7c')]){_0x284960[_0x6913('0x6b')](_0x249929);}_0x3c6565[_0x51c02a][_0x6913('0x7d')]&&_0x284960[_0x6913('0x3b')](_0x249929,_0x3c6565[_0x51c02a]['orderBy']===_0x6913('0x7e')?![]:!![]);_0x284960[_0x6913('0x78')](_0x249929,_0x3c6565[_0x51c02a][_0x6913('0x7f')]||_0x249929);}if(_0x6fff63[_0x6913('0x80')]){_0x6fff63[_0x6913('0x80')]=JSON[_0x6913('0x81')](_0x6fff63['joins']);for(var _0x43c990=0x0;_0x43c990<_0x6fff63[_0x6913('0x80')]['length'];_0x43c990+=0x1){if(_0x6fff63[_0x6913('0x80')][_0x43c990][_0x6913('0x30')]&&_[_0x6913('0x65')](_0x3be128,_0x6fff63[_0x6913('0x80')][_0x43c990][_0x6913('0x30')])&&_0x6fff63[_0x6913('0x80')][_0x43c990][_0x6913('0x82')]&&_0x6fff63[_0x6913('0x80')][_0x43c990][_0x6913('0x83')]&&_0x6fff63[_0x6913('0x80')][_0x43c990][_0x6913('0x84')]){_0x284960[_0x6fff63[_0x6913('0x80')][_0x43c990][_0x6913('0x30')]](_0x6fff63['joins'][_0x43c990][_0x6913('0x83')],null,util[_0x6913('0x7b')]('%s.%s\x20=\x20%s.%s',_0x6fff63[_0x6913('0x76')],_0x6fff63[_0x6913('0x80')][_0x43c990][_0x6913('0x82')],_0x6fff63[_0x6913('0x80')][_0x43c990][_0x6913('0x83')],_0x6fff63['joins'][_0x43c990]['foreignKey']));}}}if(_0x6fff63[_0x6913('0x85')]){_0x6fff63[_0x6913('0x85')]=JSON[_0x6913('0x81')](_0x6fff63[_0x6913('0x85')]);_0x284960[_0x6913('0x3d')](_0x5999c0(_0x6fff63['conditions']['group']));}_0x46af80=_0x284960[_0x6913('0x86')]();_0x284960['limit'](_0x2a900b);_0x284960['offset'](0x0);logger[_0x6913('0x87')](_0x6913('0x88'),_0x284960[_0x6913('0x89')]());return dbH[_0x6913('0x8a')][_0x6913('0x35')](_0x284960[_0x6913('0x89')](),{'type':dbH[_0x6913('0x8a')]['QueryTypes'][_0x6913('0x8b')]});}})[_0x6913('0x25')](respondWithResult(_0x2b3c83,null))[_0x6913('0x45')](handleError(_0x2b3c83,null));};function runReport(_0x320255,_0x20d93c,_0x54032e){var _0x5608bd=_0x20d93c[_0x6913('0x2a')];var _0x35a924=0xa;var _0x5c35f3=[_0x6913('0x56'),_0x6913('0x57'),'right_join',_0x6913('0x59')];var _0xe014db={'SUM':_0x6913('0x5a'),'COUNT':_0x6913('0x5b'),'COUNT DISTINCT':_0x6913('0x8c'),'MAX':_0x6913('0x5c'),'MIN':'MIN(%s)','AVG':_0x6913('0x5e'),'GROUP_CONCAT':_0x6913('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6913('0x60')};var _0x2a71c7={'SEC_TO_TIME':_0x6913('0x8d'),'DATE':_0x6913('0x61'),'HOUR':_0x6913('0x62'),'ROUND':_0x6913('0x63'),'UNIX_TIMESTAMP':_0x6913('0x64')};var _0x5a9c52=function(_0x169082){return!_['includes']([_0x6913('0x66'),_0x6913('0x67'),'IS\x20EMPTY',_0x6913('0x8e')],_0x169082);};var _0x35b8b8=function(_0x59d3d1){if(!_0x59d3d1||!_0x59d3d1[_0x6913('0x69')][_0x6913('0x38')]){return'';}for(var _0x502da0='(',_0x42271c=0x0;_0x42271c<_0x59d3d1[_0x6913('0x69')][_0x6913('0x38')];_0x42271c+=0x1){_0x42271c>0x0&&(_0x502da0+='\x20'+_0x59d3d1[_0x6913('0x6a')]+'\x20');_0x502da0+=_0x59d3d1['rules'][_0x42271c][_0x6913('0x6b')]?_0x35b8b8(_0x59d3d1[_0x6913('0x69')][_0x42271c][_0x6913('0x6b')]):_0x59d3d1['rules'][_0x42271c]['field']+'\x20'+_0x59d3d1[_0x6913('0x69')][_0x42271c]['condition']+(_0x5a9c52(_0x59d3d1[_0x6913('0x69')][_0x42271c][_0x6913('0x6c')])?'\x20'+_0x59d3d1[_0x6913('0x69')][_0x42271c][_0x6913('0x6d')]:'');}return _0x502da0+')';};var _0x40c791={'where':{'id':_0x320255['id']}},_0x42f9ba,_0x51d978,_0x450889,_0x5b1290,_0x2b2811;_0x40c791=_['merge']({},_0x40c791,_0x54032e);return db[_0x6913('0x2d')]['find'](_0x40c791)[_0x6913('0x25')](function(_0x542fb8){if(_0x542fb8){_0x42f9ba=_0x542fb8;return _0x542fb8[_0x6913('0x6e')]();}return null;})[_0x6913('0x25')](function(_0xb1e98b){if(_0xb1e98b){if(!_0xb1e98b[_0x6913('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0x6913('0x71'),0x193);}_0x51d978=_0xb1e98b;return db[_0x6913('0x72')][_0x6913('0x73')]({'raw':!![]});}return null;})[_0x6913('0x25')](function(_0x349c0){if(_0x349c0){_0x450889=_[_0x6913('0x74')](_0x349c0,'id');var _0x533958;var _0x412fc8=squel[_0x6913('0x8f')]();_0x412fc8[_0x6913('0x75')](_0x42f9ba[_0x6913('0x76')]);for(var _0x3a8d39=0x0;_0x3a8d39<_0x51d978[_0x6913('0x38')];_0x3a8d39+=0x1){_0x533958=_0x51d978[_0x3a8d39]['MetricId']?_0x450889[_0x51d978[_0x3a8d39][_0x6913('0x77')]][_0x6913('0x90')]:_0x51d978[_0x3a8d39]['field'];_0x533958=_0x51d978[_0x3a8d39][_0x6913('0x79')]?_[_0x6913('0x7a')](_0xe014db[_0x51d978[_0x3a8d39][_0x6913('0x79')]],'%s',_0x533958):_0x533958;_0x533958=_0x51d978[_0x3a8d39][_0x6913('0x7b')]?_['replace'](_0x2a71c7[_0x51d978[_0x3a8d39][_0x6913('0x7b')]],'%s',_0x533958):_0x533958;if(_0x51d978[_0x3a8d39][_0x6913('0x7c')]){_0x412fc8[_0x6913('0x6b')](_0x533958);}_0x51d978[_0x3a8d39]['orderBy']&&_0x412fc8['order'](_0x533958,_0x51d978[_0x3a8d39]['orderBy']===_0x6913('0x7e')?![]:!![]);_0x412fc8[_0x6913('0x78')](_0x533958,_0x51d978[_0x3a8d39]['alias']||_0x533958);}if(_0x42f9ba[_0x6913('0x80')]){_0x42f9ba[_0x6913('0x80')]=JSON[_0x6913('0x81')](_0x42f9ba[_0x6913('0x80')]);for(var _0x4b4598=0x0;_0x4b4598<_0x42f9ba[_0x6913('0x80')][_0x6913('0x38')];_0x4b4598+=0x1){if(_0x42f9ba['joins'][_0x4b4598][_0x6913('0x30')]&&_[_0x6913('0x65')](_0x5c35f3,_0x42f9ba[_0x6913('0x80')][_0x4b4598][_0x6913('0x30')])&&_0x42f9ba[_0x6913('0x80')][_0x4b4598][_0x6913('0x82')]&&_0x42f9ba['joins'][_0x4b4598]['foreignTable']&&_0x42f9ba[_0x6913('0x80')][_0x4b4598][_0x6913('0x84')]){_0x412fc8[_0x42f9ba[_0x6913('0x80')][_0x4b4598][_0x6913('0x30')]](_0x42f9ba['joins'][_0x4b4598]['foreignTable'],null,util[_0x6913('0x7b')](_0x6913('0x91'),_0x42f9ba['table'],_0x42f9ba[_0x6913('0x80')][_0x4b4598][_0x6913('0x82')],_0x42f9ba[_0x6913('0x80')][_0x4b4598][_0x6913('0x83')],_0x42f9ba[_0x6913('0x80')][_0x4b4598][_0x6913('0x84')]));}}}if(_0x42f9ba[_0x6913('0x85')]){_0x42f9ba[_0x6913('0x85')]=JSON[_0x6913('0x81')](_0x42f9ba['conditions']);_0x412fc8[_0x6913('0x3d')](_0x35b8b8(_0x42f9ba['conditions']['group']));}_0x2b2811=_0x412fc8[_0x6913('0x86')]();_0x412fc8[_0x6913('0x1c')](_0x35a924);_0x412fc8[_0x6913('0x1a')](0x0);return;}})['then'](function(){if(_0x20d93c[_0x6913('0x92')]===_0x6913('0x93')){return null;}var _0x14f6f5=_[_0x6913('0x40')](_0x20d93c,{'name':_0x20d93c[_0x6913('0x94')]||_0x20d93c[_0x6913('0x2a')]||_0x42f9ba[_0x6913('0x2a')],'basename':_0x5608bd,'savename':util[_0x6913('0x7b')](_0x6913('0x95'),_0x20d93c[_0x6913('0x2a')]||_0x42f9ba[_0x6913('0x2a')],require(_0x6913('0x96'))[_0x6913('0x97')](0x4),_0x20d93c[_0x6913('0x92')]||_0x6913('0x98')),'reportId':_0x42f9ba['id'],'reportType':_0x6913('0x99')});return db[_0x6913('0x9a')]['create'](_0x14f6f5,{'raw':!![]});})[_0x6913('0x25')](function(_0x371139){if(_0x42f9ba[_0x6913('0x76')]===_0x6913('0x9b')){_0x2b2811['where'](_0x42f9ba[_0x6913('0x76')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x20d93c[_0x6913('0x9c')],_0x20d93c['endDate']);}else{_0x2b2811[_0x6913('0x3d')](_0x42f9ba['table']+_0x6913('0x9d'),_0x20d93c[_0x6913('0x9c')],_0x20d93c[_0x6913('0x9e')]);}if(_0x371139){logger[_0x6913('0x9f')](_0x6913('0xa0'),_0x2b2811[_0x6913('0x89')]());require(_0x6913('0xa1'))[_0x6913('0xa2')](path['join'](__dirname,_0x6913('0xa3'),_0x371139[_0x6913('0x92')]),[_0x371139['id'],_0x2b2811[_0x6913('0x89')](),path['join'](__dirname,_0x6913('0xa4'),_0x371139[_0x6913('0xa5')]),_0x5608bd]);return _0x371139;}else{var _0x2e72e7=squel[_0x6913('0x8f')]();_0x2e72e7['from']('('+_0x2b2811[_0x6913('0x89')]()+')',_0x6913('0xa6'));_0x2e72e7[_0x6913('0x78')]('COUNT(*)','count');_0x2b2811[_0x6913('0x1c')](_0x20d93c[_0x6913('0x1c')]||_0x35a924);_0x2b2811['offset'](_0x20d93c[_0x6913('0x1a')]||0x0);return dbH[_0x6913('0x8a')][_0x6913('0x35')](_0x2e72e7[_0x6913('0x89')](),{'type':dbH[_0x6913('0x8a')][_0x6913('0xa7')]['SELECT']})[_0x6913('0x25')](function(_0x2cfb66){if(!_0x2cfb66[_0x6913('0x38')]){_0x5b1290=0x0;}else{_0x5b1290=_0x2cfb66[0x0][_0x6913('0x1d')]||0x0;}return dbH['sequelize'][_0x6913('0x35')](_0x2b2811['toString'](),{'type':dbH['sequelize'][_0x6913('0xa7')][_0x6913('0x8b')]});})[_0x6913('0x25')](function(_0x56325f){return{'rows':_0x56325f||[],'count':_0x5b1290};});}});}exports['run']=function(_0x5821f5,_0x1c4133){return runReport(_0x5821f5[_0x6913('0x47')],_0x5821f5[_0x6913('0x35')],_0x5821f5['options'])['then'](respondWithResult(_0x1c4133,null))['catch'](handleError(_0x1c4133,null));};exports[_0x6913('0xa8')]=runReport;exports[_0x6913('0x35')]=function(_0x299745,_0x29265d){var _0x32336d=0xa;var _0x578718=[_0x6913('0x56'),'left_join',_0x6913('0x58'),_0x6913('0x59')];var _0x70db70={'SUM':_0x6913('0x5a'),'COUNT':_0x6913('0x5b'),'COUNT DISTINCT':_0x6913('0x8c'),'MAX':'MAX(%s)','MIN':_0x6913('0x5d'),'AVG':_0x6913('0x5e'),'GROUP_CONCAT':_0x6913('0x5f'),'GROUP_CONCAT ASC':_0x6913('0xa9'),'GROUP_CONCAT DESC':_0x6913('0x60')};var _0x517547={'SEC_TO_TIME':_0x6913('0x8d'),'DATE':_0x6913('0x61'),'HOUR':_0x6913('0x62'),'ROUND':_0x6913('0x63'),'UNIX_TIMESTAMP':_0x6913('0x64')};var _0x44a321=function(_0x5ecd43){return!_[_0x6913('0x65')](['IS\x20NULL',_0x6913('0x67'),'IS\x20EMPTY',_0x6913('0x8e')],_0x5ecd43);};var _0x13698b=function(_0x5afd89){if(!_0x5afd89||!_0x5afd89[_0x6913('0x69')]['length']){return'';}for(var _0x53b9c3='(',_0x42d342=0x0;_0x42d342<_0x5afd89[_0x6913('0x69')][_0x6913('0x38')];_0x42d342+=0x1){_0x42d342>0x0&&(_0x53b9c3+='\x20'+_0x5afd89[_0x6913('0x6a')]+'\x20');_0x53b9c3+=_0x5afd89[_0x6913('0x69')][_0x42d342][_0x6913('0x6b')]?_0x13698b(_0x5afd89[_0x6913('0x69')][_0x42d342][_0x6913('0x6b')]):_0x5afd89['rules'][_0x42d342][_0x6913('0x78')]+'\x20'+_0x5afd89[_0x6913('0x69')][_0x42d342][_0x6913('0x6c')]+(_0x44a321(_0x5afd89[_0x6913('0x69')][_0x42d342]['condition'])?'\x20'+_0x5afd89[_0x6913('0x69')][_0x42d342][_0x6913('0x6d')]:'');}return _0x53b9c3+')';};var _0x5085e9={'where':{'id':_0x299745['params']['id']}},_0x54318b,_0x87cb7f,_0x497d33,_0x4cc5e7,_0x427528;_0x5085e9=_[_0x6913('0x40')]({},_0x5085e9,_0x299745[_0x6913('0x48')]);return db[_0x6913('0x2d')]['find'](_0x5085e9)[_0x6913('0x25')](function(_0x3c6641){if(_0x3c6641){_0x54318b=_0x3c6641;return _0x3c6641[_0x6913('0x6e')]();}return null;})[_0x6913('0x25')](function(_0x19dfd5){if(_0x19dfd5){if(!_0x19dfd5['length']){throw new db['Sequelize'][(_0x6913('0x70'))](_0x6913('0x71'),0x193);}_0x87cb7f=_0x19dfd5;return db[_0x6913('0x72')][_0x6913('0x73')]({'raw':!![]});}return null;})[_0x6913('0x25')](function(_0x563100){if(_0x563100){_0x497d33=_['keyBy'](_0x563100,'id');var _0x2695fa;var _0x565a8f=squel[_0x6913('0x8f')]();_0x565a8f[_0x6913('0x75')](_0x54318b[_0x6913('0x76')]);for(var _0x4e1327=0x0;_0x4e1327<_0x87cb7f[_0x6913('0x38')];_0x4e1327+=0x1){_0x2695fa=_0x87cb7f[_0x4e1327][_0x6913('0x77')]?_0x497d33[_0x87cb7f[_0x4e1327]['MetricId']][_0x6913('0x90')]:_0x87cb7f[_0x4e1327][_0x6913('0x78')];_0x2695fa=_0x87cb7f[_0x4e1327][_0x6913('0x79')]?_['replace'](_0x70db70[_0x87cb7f[_0x4e1327][_0x6913('0x79')]],'%s',_0x2695fa):_0x2695fa;_0x2695fa=_0x87cb7f[_0x4e1327][_0x6913('0x7b')]?_['replace'](_0x517547[_0x87cb7f[_0x4e1327][_0x6913('0x7b')]],'%s',_0x2695fa):_0x2695fa;if(_0x87cb7f[_0x4e1327][_0x6913('0x7c')]){_0x565a8f[_0x6913('0x6b')](_0x2695fa);}_0x87cb7f[_0x4e1327]['orderBy']&&_0x565a8f[_0x6913('0x3b')](_0x2695fa,_0x87cb7f[_0x4e1327][_0x6913('0x7d')]===_0x6913('0x7e')?![]:!![]);_0x565a8f['field'](_0x2695fa,_0x87cb7f[_0x4e1327][_0x6913('0x7f')]||_0x2695fa);}if(_0x54318b['joins']){_0x54318b[_0x6913('0x80')]=JSON[_0x6913('0x81')](_0x54318b[_0x6913('0x80')]);for(var _0x418584=0x0;_0x418584<_0x54318b['joins'][_0x6913('0x38')];_0x418584+=0x1){if(_0x54318b[_0x6913('0x80')][_0x418584][_0x6913('0x30')]&&_[_0x6913('0x65')](_0x578718,_0x54318b[_0x6913('0x80')][_0x418584][_0x6913('0x30')])&&_0x54318b[_0x6913('0x80')][_0x418584][_0x6913('0x82')]&&_0x54318b[_0x6913('0x80')][_0x418584][_0x6913('0x83')]&&_0x54318b[_0x6913('0x80')][_0x418584][_0x6913('0x84')]){_0x565a8f[_0x54318b['joins'][_0x418584][_0x6913('0x30')]](_0x54318b[_0x6913('0x80')][_0x418584][_0x6913('0x83')],null,util[_0x6913('0x7b')]('%s.%s\x20=\x20%s.%s',_0x54318b['table'],_0x54318b[_0x6913('0x80')][_0x418584]['parentKey'],_0x54318b[_0x6913('0x80')][_0x418584]['foreignTable'],_0x54318b[_0x6913('0x80')][_0x418584][_0x6913('0x84')]));}}}if(_0x54318b['conditions']){_0x54318b['conditions']=JSON[_0x6913('0x81')](_0x54318b['conditions']);_0x565a8f[_0x6913('0x3d')](_0x13698b(_0x54318b[_0x6913('0x85')][_0x6913('0x6b')]));}_0x427528=_0x565a8f['clone']();_0x565a8f[_0x6913('0x1c')](_0x32336d);_0x565a8f[_0x6913('0x1a')](0x0);logger[_0x6913('0x87')](_0x6913('0x88'),_0x565a8f['toString']());return dbH[_0x6913('0x8a')][_0x6913('0x35')](_0x565a8f[_0x6913('0x89')](),{'type':dbH['sequelize'][_0x6913('0xa7')][_0x6913('0x8b')]});}})['then'](function(){return{'sql':_0x427528[_0x6913('0x89')]()};})['then'](respondWithResult(_0x29265d,null))[_0x6913('0x45')](handleError(_0x29265d,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 06c275c..f5ef24c 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 _0x78c2=['exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x596284,_0x1cd02b){var _0x5313c6=function(_0x77db49){while(--_0x77db49){_0x596284['push'](_0x596284['shift']());}};_0x5313c6(++_0x1cd02b);}(_0x78c2,0x1b1));var _0x278c=function(_0x2ce175,_0x10a0d2){_0x2ce175=_0x2ce175-0x0;var _0xbf859c=_0x78c2[_0x2ce175];return _0xbf859c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x278c('0x0'))(_0x278c('0x1'));var moment=require(_0x278c('0x2'));var BPromise=require(_0x278c('0x3'));var rp=require(_0x278c('0x4'));var fs=require('fs');var path=require(_0x278c('0x5'));var rimraf=require('rimraf');var config=require(_0x278c('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0x278c('0x7')]=function(_0x3afa0e,_0x385b06){return _0x3afa0e[_0x278c('0x8')](_0x278c('0x9'),attributes,{'tableName':_0x278c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf0bf=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0bf,0x105));var _0xff0b=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0xf0bf[_0x2ca9d4];return _0x258956;};'use strict';var _=require(_0xff0b('0x0'));var util=require(_0xff0b('0x1'));var logger=require(_0xff0b('0x2'))(_0xff0b('0x3'));var moment=require('moment');var BPromise=require(_0xff0b('0x4'));var rp=require(_0xff0b('0x5'));var fs=require('fs');var path=require(_0xff0b('0x6'));var rimraf=require(_0xff0b('0x7'));var config=require(_0xff0b('0x8'));var attributes=require(_0xff0b('0x9'));module[_0xff0b('0xa')]=function(_0x2f47dd,_0x4430d9){return _0x2f47dd[_0xff0b('0xb')](_0xff0b('0xc'),attributes,{'tableName':_0xff0b('0xd'),'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 a0e4bdd..34df568 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 _0xf575=['http','request','debug','request\x20sent','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3d7595,_0x23bf60){var _0x163d06=function(_0x2c3a21){while(--_0x2c3a21){_0x3d7595['push'](_0x3d7595['shift']());}};_0x163d06(++_0x23bf60);}(_0xf575,0xf1));var _0x5f57=function(_0x1e3ca5,_0x548838){_0x1e3ca5=_0x1e3ca5-0x0;var _0x3898fc=_0xf575[_0x1e3ca5];return _0x3898fc;};'use strict';var _=require(_0x5f57('0x0'));var util=require(_0x5f57('0x1'));var moment=require(_0x5f57('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f57('0x3'));var fs=require('fs');var Redis=require(_0x5f57('0x4'));var db=require(_0x5f57('0x5'))['db'];var utils=require(_0x5f57('0x6'));var logger=require(_0x5f57('0x7'))(_0x5f57('0x8'));var config=require(_0x5f57('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5f57('0xa')][_0x5f57('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x145ead,_0x36106d,_0x502118){return new BPromise(function(_0x44f344,_0x54a06c){return client[_0x5f57('0xc')](_0x145ead,_0x502118)['then'](function(_0x2761bd){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x36106d,'request\x20sent');logger[_0x5f57('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x36106d,_0x5f57('0xe'),JSON['stringify'](_0x2761bd));if(_0x2761bd[_0x5f57('0xf')]){if(_0x2761bd['error'][_0x5f57('0x10')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x36106d,_0x2761bd[_0x5f57('0xf')][_0x5f57('0x11')]);return _0x54a06c(_0x2761bd['error'][_0x5f57('0x11')]);}logger[_0x5f57('0xf')](_0x5f57('0x12'),_0x36106d,_0x2761bd[_0x5f57('0xf')]['message']);return _0x44f344(_0x2761bd[_0x5f57('0xf')][_0x5f57('0x11')]);}else{logger[_0x5f57('0x13')](_0x5f57('0x12'),_0x36106d,_0x5f57('0xe'));_0x44f344(_0x2761bd[_0x5f57('0x14')][_0x5f57('0x11')]);}})['catch'](function(_0x3b6512){logger[_0x5f57('0xf')](_0x5f57('0x12'),_0x36106d,_0x3b6512);_0x54a06c(_0x3b6512);});});}
\ No newline at end of file
+var _0xe7b5=['../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x115a0f,_0x46c0ae){var _0x2b53a0=function(_0x5ad110){while(--_0x5ad110){_0x115a0f['push'](_0x115a0f['shift']());}};_0x2b53a0(++_0x46c0ae);}(_0xe7b5,0xeb));var _0x5e7b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe7b5[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x5e7b('0x0'));var util=require(_0x5e7b('0x1'));var moment=require(_0x5e7b('0x2'));var BPromise=require(_0x5e7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e7b('0x4'));var db=require(_0x5e7b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e7b('0x6'))('rpc');var config=require(_0x5e7b('0x7'));var jayson=require(_0x5e7b('0x8'));var client=jayson[_0x5e7b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30592b,_0x19d228,_0x572043){return new BPromise(function(_0x289726,_0x3db952){return client[_0x5e7b('0xa')](_0x30592b,_0x572043)[_0x5e7b('0xb')](function(_0x3957ba){logger[_0x5e7b('0xc')](_0x5e7b('0xd'),_0x19d228,_0x5e7b('0xe'));logger['debug'](_0x5e7b('0xf'),_0x19d228,_0x5e7b('0xe'),JSON[_0x5e7b('0x10')](_0x3957ba));if(_0x3957ba['error']){if(_0x3957ba[_0x5e7b('0x11')][_0x5e7b('0x12')]===0x1f4){logger[_0x5e7b('0x11')](_0x5e7b('0xd'),_0x19d228,_0x3957ba['error']['message']);return _0x3db952(_0x3957ba[_0x5e7b('0x11')][_0x5e7b('0x13')]);}logger[_0x5e7b('0x11')](_0x5e7b('0xd'),_0x19d228,_0x3957ba[_0x5e7b('0x11')][_0x5e7b('0x13')]);return _0x289726(_0x3957ba['error'][_0x5e7b('0x13')]);}else{logger['info'](_0x5e7b('0xd'),_0x19d228,_0x5e7b('0xe'));_0x289726(_0x3957ba[_0x5e7b('0x14')]['message']);}})[_0x5e7b('0x15')](function(_0x1936e3){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x19d228,_0x1936e3);_0x3db952(_0x1936e3);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index d451736..406c05c 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 _0x5b3b=['query','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query'];(function(_0x194a9d,_0x1b2b7e){var _0x39c13a=function(_0x5429bd){while(--_0x5429bd){_0x194a9d['push'](_0x194a9d['shift']());}};_0x39c13a(++_0x1b2b7e);}(_0x5b3b,0x1d3));var _0xb5b3=function(_0x29fdb7,_0x4f08b3){_0x29fdb7=_0x29fdb7-0x0;var _0x11a098=_0x5b3b[_0x29fdb7];return _0x11a098;};'use strict';var multer=require(_0xb5b3('0x0'));var util=require('util');var path=require(_0xb5b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xb5b3('0x2'));var router=express[_0xb5b3('0x3')]();var fs_extra=require(_0xb5b3('0x4'));var auth=require(_0xb5b3('0x5'));var interaction=require(_0xb5b3('0x6'));var config=require(_0xb5b3('0x7'));var controller=require(_0xb5b3('0x8'));router[_0xb5b3('0x9')]('/',auth['isAuthenticated'](),controller[_0xb5b3('0xa')]);router[_0xb5b3('0x9')](_0xb5b3('0xb'),auth[_0xb5b3('0xc')](),controller[_0xb5b3('0xd')]);router[_0xb5b3('0x9')](_0xb5b3('0xe'),auth[_0xb5b3('0xc')](),controller[_0xb5b3('0xf')]);router[_0xb5b3('0x9')](_0xb5b3('0x10'),auth['isAuthenticated'](),controller[_0xb5b3('0x11')]);router['get'](_0xb5b3('0x12'),auth[_0xb5b3('0xc')](),controller[_0xb5b3('0x13')]);router[_0xb5b3('0x14')]('/',auth[_0xb5b3('0xc')](),controller[_0xb5b3('0x15')]);router[_0xb5b3('0x16')](_0xb5b3('0xb'),auth[_0xb5b3('0xc')](),controller[_0xb5b3('0x17')]);router[_0xb5b3('0x18')](_0xb5b3('0xb'),auth['isAuthenticated'](),controller[_0xb5b3('0x19')]);module[_0xb5b3('0x1a')]=router;
\ No newline at end of file
+var _0xd82c=['index','get','/:id','preview','/:id/run','run','query','post','create','put','update','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated'];(function(_0x3e0d64,_0x41399b){var _0xc44ce8=function(_0x36d302){while(--_0x36d302){_0x3e0d64['push'](_0x3e0d64['shift']());}};_0xc44ce8(++_0x41399b);}(_0xd82c,0xd1));var _0xcd82=function(_0x126d54,_0x9d5649){_0x126d54=_0x126d54-0x0;var _0x5eb26c=_0xd82c[_0x126d54];return _0x5eb26c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcd82('0x0'));var timeout=require(_0xcd82('0x1'));var express=require(_0xcd82('0x2'));var router=express[_0xcd82('0x3')]();var fs_extra=require(_0xcd82('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd82('0x5'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xcd82('0x6')](),controller[_0xcd82('0x7')]);router[_0xcd82('0x8')](_0xcd82('0x9'),auth[_0xcd82('0x6')](),controller['show']);router[_0xcd82('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0xcd82('0xa')]);router[_0xcd82('0x8')](_0xcd82('0xb'),auth[_0xcd82('0x6')](),controller[_0xcd82('0xc')]);router['get']('/:id/query',auth[_0xcd82('0x6')](),controller[_0xcd82('0xd')]);router[_0xcd82('0xe')]('/',auth[_0xcd82('0x6')](),controller[_0xcd82('0xf')]);router[_0xcd82('0x10')]('/:id',auth[_0xcd82('0x6')](),controller[_0xcd82('0x11')]);router['delete']('/:id',auth[_0xcd82('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index eb476fa..a90e77a 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x44a554,_0x18e60b){var _0x1dde7f=function(_0x461ff8){while(--_0x461ff8){_0x44a554['push'](_0x44a554['shift']());}};_0x1dde7f(++_0x18e60b);}(_0x425d,0x1e0));var _0xd425=function(_0x235ad6,_0x5e4437){_0x235ad6=_0x235ad6-0x0;var _0x2885d9=_0x425d[_0x235ad6];return _0x2885d9;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}};
\ No newline at end of file
+var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x1d3647,_0x358d0c){var _0x2bd681=function(_0x1e82b5){while(--_0x1e82b5){_0x1d3647['push'](_0x1d3647['shift']());}};_0x2bd681(++_0x358d0c);}(_0xeff8,0x186));var _0x8eff=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xeff8[_0x166d93];return _0xba708;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 43e0d76..84ccdff 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x461935,_0xeaeb6e){var _0x1f809f=function(_0x56c009){while(--_0x56c009){_0x461935['push'](_0x461935['shift']());}};_0x1f809f(++_0xeaeb6e);}(_0x4819,0xcd));var _0x9481=function(_0x275d85,_0x5a883e){_0x275d85=_0x275d85-0x0;var _0x3cd754=_0x4819[_0x275d85];return _0x3cd754;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x114211,_0x38ec1d){var _0x1c5440=function(_0x117b08){while(--_0x117b08){_0x114211['push'](_0x114211['shift']());}};_0x1c5440(++_0x38ec1d);}(_0x53ec,0x192));var _0xc53e=function(_0x20025e,_0x44c8e1){_0x20025e=_0x20025e-0x0;var _0x4a5ac4=_0x53ec[_0x20025e];return _0x4a5ac4;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 83b122a..8d02ce0 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 _0x874c=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x3c78cb,_0x1fd4c5){var _0x5efe93=function(_0x192ccc){while(--_0x192ccc){_0x3c78cb['push'](_0x3c78cb['shift']());}};_0x5efe93(++_0x1fd4c5);}(_0x874c,0x184));var _0xc874=function(_0x398d54,_0x1e0366){_0x398d54=_0x398d54-0x0;var _0x2b2526=_0x874c[_0x398d54];return _0x2b2526;};'use strict';var _=require(_0xc874('0x0'));var util=require(_0xc874('0x1'));var logger=require(_0xc874('0x2'))('api');var moment=require(_0xc874('0x3'));var BPromise=require('bluebird');var rp=require(_0xc874('0x4'));var fs=require('fs');var path=require(_0xc874('0x5'));var rimraf=require(_0xc874('0x6'));var config=require(_0xc874('0x7'));var attributes=require(_0xc874('0x8'));module[_0xc874('0x9')]=function(_0x2aabc3,_0x402609){return _0x2aabc3[_0xc874('0xa')](_0xc874('0xb'),attributes,{'tableName':_0xc874('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c89=['lodash','util','moment','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports'];(function(_0x7e6b82,_0x3fe61c){var _0x55c104=function(_0x2a8535){while(--_0x2a8535){_0x7e6b82['push'](_0x7e6b82['shift']());}};_0x55c104(++_0x3fe61c);}(_0x1c89,0xd8));var _0x91c8=function(_0x12a57d,_0x738bd1){_0x12a57d=_0x12a57d-0x0;var _0x4b26f6=_0x1c89[_0x12a57d];return _0x4b26f6;};'use strict';var _=require(_0x91c8('0x0'));var util=require(_0x91c8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x91c8('0x2'));var BPromise=require(_0x91c8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x91c8('0x4'));var config=require(_0x91c8('0x5'));var attributes=require(_0x91c8('0x6'));module[_0x91c8('0x7')]=function(_0x21fb1c,_0x67564a){return _0x21fb1c['define']('AnalyticDefaultReport',attributes,{'tableName':_0x91c8('0x8'),'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 04bae2e..9f08a16 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 _0x4201=['../../config/logger','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x573e20,_0x1191f7){var _0x5037e7=function(_0x17f069){while(--_0x17f069){_0x573e20['push'](_0x573e20['shift']());}};_0x5037e7(++_0x1191f7);}(_0x4201,0x9a));var _0x1420=function(_0x4c978c,_0xbd7d69){_0x4c978c=_0x4c978c-0x0;var _0x48db9c=_0x4201[_0x4c978c];return _0x48db9c;};'use strict';var _=require('lodash');var util=require(_0x1420('0x0'));var moment=require('moment');var BPromise=require(_0x1420('0x1'));var rs=require(_0x1420('0x2'));var fs=require('fs');var Redis=require(_0x1420('0x3'));var db=require(_0x1420('0x4'))['db'];var utils=require(_0x1420('0x5'));var logger=require(_0x1420('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1420('0x7'));var client=jayson[_0x1420('0x8')][_0x1420('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf87a70,_0x335738,_0x2bb5f8){return new BPromise(function(_0x5cabec,_0x37b666){return client['request'](_0xf87a70,_0x2bb5f8)[_0x1420('0xa')](function(_0x5ef510){logger[_0x1420('0xb')](_0x1420('0xc'),_0x335738,_0x1420('0xd'));logger[_0x1420('0xe')](_0x1420('0xf'),_0x335738,_0x1420('0xd'),JSON[_0x1420('0x10')](_0x5ef510));if(_0x5ef510[_0x1420('0x11')]){if(_0x5ef510[_0x1420('0x11')][_0x1420('0x12')]===0x1f4){logger['error'](_0x1420('0xc'),_0x335738,_0x5ef510['error'][_0x1420('0x13')]);return _0x37b666(_0x5ef510[_0x1420('0x11')][_0x1420('0x13')]);}logger[_0x1420('0x11')](_0x1420('0xc'),_0x335738,_0x5ef510['error'][_0x1420('0x13')]);return _0x5cabec(_0x5ef510[_0x1420('0x11')][_0x1420('0x13')]);}else{logger[_0x1420('0xb')](_0x1420('0xc'),_0x335738,_0x1420('0xd'));_0x5cabec(_0x5ef510['result'][_0x1420('0x13')]);}})['catch'](function(_0xccd28){logger[_0x1420('0x11')](_0x1420('0xc'),_0x335738,_0xccd28);_0x37b666(_0xccd28);});});}
\ No newline at end of file
+var _0xd0c0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','moment'];(function(_0x476ff5,_0x3240f5){var _0x26f2d1=function(_0x409093){while(--_0x409093){_0x476ff5['push'](_0x476ff5['shift']());}};_0x26f2d1(++_0x3240f5);}(_0xd0c0,0x1df));var _0x0d0c=function(_0x442fe7,_0x53a4bd){_0x442fe7=_0x442fe7-0x0;var _0x267e76=_0xd0c0[_0x442fe7];return _0x267e76;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0d0c('0x0'));var BPromise=require(_0x0d0c('0x1'));var rs=require(_0x0d0c('0x2'));var fs=require('fs');var Redis=require(_0x0d0c('0x3'));var db=require(_0x0d0c('0x4'))['db'];var utils=require(_0x0d0c('0x5'));var logger=require(_0x0d0c('0x6'))(_0x0d0c('0x7'));var config=require(_0x0d0c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0d0c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20f81a,_0x5bb79b,_0x5be63b){return new BPromise(function(_0x5cccf7,_0x3c9bae){return client['request'](_0x20f81a,_0x5be63b)[_0x0d0c('0xa')](function(_0x1c6e4c){logger[_0x0d0c('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5bb79b,'request\x20sent');logger[_0x0d0c('0xc')](_0x0d0c('0xd'),_0x5bb79b,_0x0d0c('0xe'),JSON[_0x0d0c('0xf')](_0x1c6e4c));if(_0x1c6e4c[_0x0d0c('0x10')]){if(_0x1c6e4c[_0x0d0c('0x10')][_0x0d0c('0x11')]===0x1f4){logger[_0x0d0c('0x10')](_0x0d0c('0x12'),_0x5bb79b,_0x1c6e4c[_0x0d0c('0x10')][_0x0d0c('0x13')]);return _0x3c9bae(_0x1c6e4c['error'][_0x0d0c('0x13')]);}logger[_0x0d0c('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5bb79b,_0x1c6e4c[_0x0d0c('0x10')][_0x0d0c('0x13')]);return _0x5cccf7(_0x1c6e4c['error']['message']);}else{logger[_0x0d0c('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5bb79b,_0x0d0c('0xe'));_0x5cccf7(_0x1c6e4c['result'][_0x0d0c('0x13')]);}})['catch'](function(_0x36717e){logger[_0x0d0c('0x10')](_0x0d0c('0x12'),_0x5bb79b,_0x36717e);_0x3c9bae(_0x36717e);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 2d673a4..0a6adf1 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 _0x561d=['isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x4cd447,_0x2f047b){var _0xd869b6=function(_0x2d1245){while(--_0x2d1245){_0x4cd447['push'](_0x4cd447['shift']());}};_0xd869b6(++_0x2f047b);}(_0x561d,0x1f1));var _0xd561=function(_0x1478c3,_0x1b85c1){_0x1478c3=_0x1478c3-0x0;var _0x4c4900=_0x561d[_0x1478c3];return _0x4c4900;};'use strict';var multer=require(_0xd561('0x0'));var util=require(_0xd561('0x1'));var path=require(_0xd561('0x2'));var timeout=require(_0xd561('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd561('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd561('0x5'));var config=require(_0xd561('0x6'));var controller=require(_0xd561('0x7'));router[_0xd561('0x8')]('/',auth[_0xd561('0x9')](),controller['index']);router[_0xd561('0x8')](_0xd561('0xa'),auth[_0xd561('0x9')](),controller[_0xd561('0xb')]);router[_0xd561('0x8')](_0xd561('0xc'),auth[_0xd561('0x9')](),controller[_0xd561('0xd')]);router['get'](_0xd561('0xe'),auth[_0xd561('0x9')](),controller[_0xd561('0xf')]);router[_0xd561('0x8')](_0xd561('0x10'),auth['isAuthenticated'](),controller[_0xd561('0x11')]);router[_0xd561('0x12')]('/',auth[_0xd561('0x9')](),controller[_0xd561('0x13')]);router[_0xd561('0x14')](_0xd561('0xa'),auth[_0xd561('0x9')](),controller['update']);router[_0xd561('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xd561('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x727a=['/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x4498b9,_0x46369){var _0x5db5c6=function(_0x425868){while(--_0x425868){_0x4498b9['push'](_0x4498b9['shift']());}};_0x5db5c6(++_0x46369);}(_0x727a,0x95));var _0xa727=function(_0x44d6e7,_0xba3d1c){_0x44d6e7=_0x44d6e7-0x0;var _0x13df55=_0x727a[_0x44d6e7];return _0x13df55;};'use strict';var multer=require(_0xa727('0x0'));var util=require(_0xa727('0x1'));var path=require(_0xa727('0x2'));var timeout=require(_0xa727('0x3'));var express=require(_0xa727('0x4'));var router=express[_0xa727('0x5')]();var fs_extra=require(_0xa727('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa727('0x7'));var config=require(_0xa727('0x8'));var controller=require(_0xa727('0x9'));router[_0xa727('0xa')]('/',auth[_0xa727('0xb')](),controller[_0xa727('0xc')]);router[_0xa727('0xa')](_0xa727('0xd'),auth[_0xa727('0xb')](),controller[_0xa727('0xe')]);router[_0xa727('0xa')](_0xa727('0xf'),auth[_0xa727('0xb')](),controller[_0xa727('0x10')]);router[_0xa727('0xa')](_0xa727('0x11'),auth[_0xa727('0xb')](),controller['run']);router[_0xa727('0xa')](_0xa727('0x12'),auth[_0xa727('0xb')](),controller[_0xa727('0x13')]);router[_0xa727('0x14')]('/',auth[_0xa727('0xb')](),controller[_0xa727('0x15')]);router[_0xa727('0x16')](_0xa727('0xd'),auth[_0xa727('0xb')](),controller[_0xa727('0x17')]);router[_0xa727('0x18')](_0xa727('0xd'),auth[_0xa727('0xb')](),controller[_0xa727('0x19')]);module[_0xa727('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 990965e..de94a76 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 _0x500c=['UNSIGNED','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','scheduled','manual'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x500c,0x8d));var _0xc500=function(_0x59c5b5,_0x4be69d){_0x59c5b5=_0x59c5b5-0x0;var _0x5f1787=_0x500c[_0x59c5b5];return _0x5f1787;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xc500('0x0')],'allowNull':![]},'basename':{'type':Sequelize[_0xc500('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0xc500('0x1')]('csv',_0xc500('0x2'),_0xc500('0x3')),'allowNull':![],'defaultValue':_0xc500('0x4')},'savename':{'type':Sequelize[_0xc500('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc500('0x5')]},'endDate':{'type':Sequelize[_0xc500('0x5')]},'status':{'type':Sequelize[_0xc500('0x0')],'defaultValue':_0xc500('0x6')},'type':{'type':Sequelize['ENUM']('manual',_0xc500('0x7')),'allowNull':![],'defaultValue':_0xc500('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xc500('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x311d=['INTEGER','UNSIGNED','sequelize','moment','csv','pdf','xlsx','STRING','DATE','Loading','ENUM','manual','scheduled'];(function(_0x8cf7f3,_0x512510){var _0x2a9c72=function(_0x1682ba){while(--_0x1682ba){_0x8cf7f3['push'](_0x8cf7f3['shift']());}};_0x2a9c72(++_0x512510);}(_0x311d,0x120));var _0xd311=function(_0x238504,_0x2acd03){_0x238504=_0x238504-0x0;var _0x1e627f=_0x311d[_0x238504];return _0x1e627f;};'use strict';var Sequelize=require(_0xd311('0x0'));var moment=require(_0xd311('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd311('0x2'),_0xd311('0x3'),_0xd311('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd311('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd311('0x6')]},'endDate':{'type':Sequelize[_0xd311('0x6')]},'status':{'type':Sequelize[_0xd311('0x5')],'defaultValue':_0xd311('0x7')},'type':{'type':Sequelize[_0xd311('0x8')](_0xd311('0x9'),_0xd311('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xd311('0xb')](0xb)[_0xd311('0xc')]},'reportType':{'type':Sequelize[_0xd311('0x5')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index c3a5c69..a2f67cd 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 _0x4196=['server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','ExtractedReports','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','body','params','download','basename','savename','output','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root'];(function(_0x296363,_0x23a01c){var _0xae8db0=function(_0x247cb7){while(--_0x247cb7){_0x296363['push'](_0x296363['shift']());}};_0xae8db0(++_0x23a01c);}(_0x4196,0x12f));var _0x6419=function(_0x8d065b,_0x4c6115){_0x8d065b=_0x8d065b-0x0;var _0x1244e3=_0x4196[_0x8d065b];return _0x1244e3;};'use strict';var emlformat=require(_0x6419('0x0'));var rimraf=require(_0x6419('0x1'));var zipdir=require(_0x6419('0x2'));var jsonpatch=require(_0x6419('0x3'));var rp=require(_0x6419('0x4'));var moment=require(_0x6419('0x5'));var BPromise=require(_0x6419('0x6'));var Mustache=require(_0x6419('0x7'));var util=require(_0x6419('0x8'));var path=require(_0x6419('0x9'));var sox=require(_0x6419('0xa'));var csv=require(_0x6419('0xb'));var ejs=require(_0x6419('0xc'));var fs=require('fs');var fs_extra=require(_0x6419('0xd'));var _=require(_0x6419('0xe'));var squel=require(_0x6419('0xf'));var crypto=require(_0x6419('0x10'));var jsforce=require(_0x6419('0x11'));var deskjs=require(_0x6419('0x12'));var toCsv=require(_0x6419('0xb'));var querystring=require(_0x6419('0x13'));var Papa=require(_0x6419('0x14'));var Redis=require(_0x6419('0x15'));var authService=require(_0x6419('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0x6419('0x17'));var hardwareService=require(_0x6419('0x18'));var logger=require('../../config/logger')(_0x6419('0x19'));var utils=require('../../config/utils');var config=require(_0x6419('0x1a'));var licenseUtil=require(_0x6419('0x1b'));var db=require(_0x6419('0x1c'))['db'];function respondWithStatusCode(_0x405bca,_0x141176){_0x141176=_0x141176||0xcc;return function(_0x206484){if(_0x206484){return _0x405bca[_0x6419('0x1d')](_0x141176);}return _0x405bca['status'](_0x141176)['end']();};}function respondWithResult(_0x48fe26,_0x45c3a0){_0x45c3a0=_0x45c3a0||0xc8;return function(_0x37f085){if(_0x37f085){return _0x48fe26[_0x6419('0x1e')](_0x45c3a0)[_0x6419('0x1f')](_0x37f085);}};}function respondWithFilteredResult(_0x5c3486,_0x1cba5e){return function(_0x5d5304){if(_0x5d5304){var _0x59098f=typeof _0x1cba5e[_0x6419('0x20')]===_0x6419('0x21')&&typeof _0x1cba5e[_0x6419('0x22')]==='undefined';var _0x1effb6=_0x5d5304['count'];var _0x260bbe=_0x59098f?0x0:_0x1cba5e[_0x6419('0x20')];var _0x517d89=_0x59098f?_0x5d5304[_0x6419('0x23')]:_0x1cba5e[_0x6419('0x20')]+_0x1cba5e[_0x6419('0x22')];var _0x29146e;if(_0x517d89>=_0x1effb6){_0x517d89=_0x1effb6;_0x29146e=0xc8;}else{_0x29146e=0xce;}_0x5c3486['status'](_0x29146e);return _0x5c3486[_0x6419('0x24')](_0x6419('0x25'),_0x260bbe+'-'+_0x517d89+'/'+_0x1effb6)[_0x6419('0x1f')](_0x5d5304);}return null;};}function patchUpdates(_0x2ef5bd){return function(_0x198a09){try{jsonpatch[_0x6419('0x26')](_0x198a09,_0x2ef5bd,!![]);}catch(_0x5472db){return BPromise[_0x6419('0x27')](_0x5472db);}return _0x198a09['save']();};}function saveUpdates(_0x19c1b9,_0x547c43){return function(_0x4c0be4){if(_0x4c0be4){return _0x4c0be4[_0x6419('0x28')](_0x19c1b9)[_0x6419('0x29')](function(_0x491572){return _0x491572;});}return null;};}function removeEntity(_0x687412,_0x20d3dc){return function(_0x5a2335){if(_0x5a2335){return _0x5a2335[_0x6419('0x2a')]()[_0x6419('0x29')](function(){var _0x1468ef=_0x5a2335['get']({'plain':!![]});var _0x258f5b=_0x6419('0x2b');return db['UserProfileResource'][_0x6419('0x2a')]({'where':{'type':_0x258f5b,'resourceId':_0x1468ef['id']}})[_0x6419('0x29')](function(){return _0x5a2335;});})[_0x6419('0x29')](function(){_0x687412[_0x6419('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e22ae,_0x593ce1){return function(_0x3c48a2){if(!_0x3c48a2){_0x2e22ae[_0x6419('0x1d')](0x194);}return _0x3c48a2;};}function handleError(_0x596234,_0x18e866){_0x18e866=_0x18e866||0x1f4;return function(_0x4283d5){logger[_0x6419('0x2c')](_0x4283d5['stack']);if(_0x4283d5[_0x6419('0x2d')]){delete _0x4283d5['name'];}_0x596234[_0x6419('0x1e')](_0x18e866)[_0x6419('0x2e')](_0x4283d5);};}exports[_0x6419('0x2f')]=function(_0x2ae9f1,_0x2d92d4){var _0x27c763={},_0x2a60be={},_0x32b943={'count':0x0,'rows':[]};var _0xdc6b89=_[_0x6419('0x30')](db[_0x6419('0x31')][_0x6419('0x32')],function(_0x54b3fc){return{'name':_0x54b3fc['fieldName'],'type':_0x54b3fc[_0x6419('0x33')]['key']};});_0x2a60be[_0x6419('0x34')]=_['map'](_0xdc6b89,_0x6419('0x2d'));_0x2a60be['query']=_[_0x6419('0x35')](_0x2ae9f1[_0x6419('0x36')]);_0x2a60be['filters']=_[_0x6419('0x37')](_0x2a60be[_0x6419('0x34')],_0x2a60be[_0x6419('0x36')]);_0x27c763[_0x6419('0x38')]=_[_0x6419('0x37')](_0x2a60be[_0x6419('0x34')],qs[_0x6419('0x39')](_0x2ae9f1['query'][_0x6419('0x39')]));_0x27c763[_0x6419('0x38')]=_0x27c763[_0x6419('0x38')][_0x6419('0x3a')]?_0x27c763[_0x6419('0x38')]:_0x2a60be[_0x6419('0x34')];if(!_0x2ae9f1[_0x6419('0x36')]['hasOwnProperty'](_0x6419('0x3b'))){_0x27c763[_0x6419('0x22')]=qs['limit'](_0x2ae9f1[_0x6419('0x36')][_0x6419('0x22')]);_0x27c763[_0x6419('0x20')]=qs['offset'](_0x2ae9f1[_0x6419('0x36')]['offset']);}_0x27c763[_0x6419('0x3c')]=qs[_0x6419('0x3d')](_0x2ae9f1[_0x6419('0x36')]['sort']);_0x27c763[_0x6419('0x3e')]=qs[_0x6419('0x3f')](_[_0x6419('0x40')](_0x2ae9f1['query'],_0x2a60be[_0x6419('0x3f')]),_0xdc6b89);if(_0x2ae9f1[_0x6419('0x36')][_0x6419('0x41')]){_0x27c763[_0x6419('0x3e')]=_[_0x6419('0x42')](_0x27c763[_0x6419('0x3e')],{'$or':_[_0x6419('0x30')](_0xdc6b89,function(_0x2ebb9f){if(_0x2ebb9f[_0x6419('0x33')]!==_0x6419('0x43')){var _0x152187={};_0x152187[_0x2ebb9f[_0x6419('0x2d')]]={'$like':'%'+_0x2ae9f1['query'][_0x6419('0x41')]+'%'};return _0x152187;}})});}_0x27c763=_['merge']({},_0x27c763,_0x2ae9f1[_0x6419('0x44')]);var _0x3cc8b4={'where':_0x27c763[_0x6419('0x3e')]};return db[_0x6419('0x31')][_0x6419('0x23')](_0x3cc8b4)[_0x6419('0x29')](function(_0x503c8d){_0x32b943['count']=_0x503c8d;if(_0x2ae9f1[_0x6419('0x36')][_0x6419('0x45')]){_0x27c763[_0x6419('0x46')]=[{'all':!![]}];}return db[_0x6419('0x31')][_0x6419('0x47')](_0x27c763);})[_0x6419('0x29')](function(_0xb8a0fd){_0x32b943[_0x6419('0x48')]=_0xb8a0fd;return _0x32b943;})['then'](respondWithFilteredResult(_0x2d92d4,_0x27c763))[_0x6419('0x49')](handleError(_0x2d92d4,null));};exports[_0x6419('0x4a')]=function(_0x5832c0,_0x4f0ff3){var _0x5d92c5={'raw':!![],'where':{'id':_0x5832c0['params']['id']}},_0x3bc34d={};_0x3bc34d[_0x6419('0x34')]=_[_0x6419('0x35')](db['AnalyticExtractedReport'][_0x6419('0x32')]);_0x3bc34d[_0x6419('0x36')]=_[_0x6419('0x35')](_0x5832c0[_0x6419('0x36')]);_0x3bc34d[_0x6419('0x3f')]=_[_0x6419('0x37')](_0x3bc34d[_0x6419('0x34')],_0x3bc34d['query']);_0x5d92c5['attributes']=_[_0x6419('0x37')](_0x3bc34d[_0x6419('0x34')],qs[_0x6419('0x39')](_0x5832c0[_0x6419('0x36')][_0x6419('0x39')]));_0x5d92c5[_0x6419('0x38')]=_0x5d92c5['attributes'][_0x6419('0x3a')]?_0x5d92c5[_0x6419('0x38')]:_0x3bc34d['model'];if(_0x5832c0[_0x6419('0x36')][_0x6419('0x45')]){_0x5d92c5[_0x6419('0x46')]=[{'all':!![]}];}_0x5d92c5=_[_0x6419('0x42')]({},_0x5d92c5,_0x5832c0['options']);return db['AnalyticExtractedReport']['find'](_0x5d92c5)[_0x6419('0x29')](handleEntityNotFound(_0x4f0ff3,null))[_0x6419('0x29')](respondWithResult(_0x4f0ff3,null))[_0x6419('0x49')](handleError(_0x4f0ff3,null));};exports[_0x6419('0x4b')]=function(_0x5314a8,_0x1a21d5){return db[_0x6419('0x31')][_0x6419('0x4b')](_0x5314a8['body'],{})[_0x6419('0x29')](function(_0x4f438d){var _0x3d7cb2=_0x5314a8[_0x6419('0x4c')][_0x6419('0x4d')]({'plain':!![]});if(!_0x3d7cb2)throw new Error(_0x6419('0x4e'));if(_0x3d7cb2[_0x6419('0x4f')]===_0x6419('0x4c')){var _0xa557c3=_0x4f438d[_0x6419('0x4d')]({'plain':!![]});var _0x265f8d=_0x6419('0x2b');return db[_0x6419('0x50')][_0x6419('0x51')]({'where':{'name':_0x265f8d,'userProfileId':_0x3d7cb2[_0x6419('0x52')]},'raw':!![]})['then'](function(_0x112221){if(_0x112221&&_0x112221[_0x6419('0x53')]===0x0){return db[_0x6419('0x54')][_0x6419('0x4b')]({'name':_0xa557c3[_0x6419('0x2d')],'resourceId':_0xa557c3['id'],'type':_0x112221[_0x6419('0x2d')],'sectionId':_0x112221['id']},{})[_0x6419('0x29')](function(){return _0x4f438d;});}else{return _0x4f438d;}})[_0x6419('0x49')](function(_0x53a9f6){logger[_0x6419('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53a9f6);throw _0x53a9f6;});}return _0x4f438d;})[_0x6419('0x29')](respondWithResult(_0x1a21d5,0xc9))[_0x6419('0x49')](handleError(_0x1a21d5,null));};exports[_0x6419('0x28')]=function(_0x523a87,_0x1e1668){if(_0x523a87[_0x6419('0x55')]['id']){delete _0x523a87['body']['id'];}return db[_0x6419('0x31')]['find']({'where':{'id':_0x523a87['params']['id']}})['then'](handleEntityNotFound(_0x1e1668,null))[_0x6419('0x29')](saveUpdates(_0x523a87['body'],null))[_0x6419('0x29')](respondWithResult(_0x1e1668,null))[_0x6419('0x49')](handleError(_0x1e1668,null));};exports['destroy']=function(_0x4c7d9f,_0x57295f){return db[_0x6419('0x31')][_0x6419('0x51')]({'where':{'id':_0x4c7d9f[_0x6419('0x56')]['id']}})[_0x6419('0x29')](handleEntityNotFound(_0x57295f,null))[_0x6419('0x29')](removeEntity(_0x57295f,null))['catch'](handleError(_0x57295f,null));};exports[_0x6419('0x57')]=function(_0x1956db,_0x3bf3cc,_0x5e2cdb){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1956db[_0x6419('0x56')]['id']},'attributes':[_0x6419('0x2d'),_0x6419('0x58'),_0x6419('0x59'),_0x6419('0x5a')],'raw':!![]})[_0x6419('0x29')](handleEntityNotFound(_0x3bf3cc,null))[_0x6419('0x29')](function(_0x31755b){if(_0x31755b){if(!fs['existsSync'](path[_0x6419('0x5b')](config['root'],'server/files/reports',_0x31755b[_0x6419('0x59')]))){throw new db[(_0x6419('0x5c'))][(_0x6419('0x5d'))](_0x6419('0x5e'));}if(_0x1956db[_0x6419('0x36')][_0x6419('0x5f')]){return _0x3bf3cc[_0x6419('0x1d')](0xc8);}return _0x3bf3cc[_0x6419('0x57')](path[_0x6419('0x5b')](config[_0x6419('0x60')],_0x6419('0x61'),_0x31755b['savename']),util[_0x6419('0x62')](_0x6419('0x63'),_0x31755b['basename']||_0x31755b[_0x6419('0x2d')],_0x31755b['output']['toLowerCase']()));}})['catch'](handleError(_0x3bf3cc,null));};
\ No newline at end of file
+var _0x1a1d=['query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','AnalyticExtractedReport','include','rows','show','includeAll','find','catch','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','status','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model'];(function(_0x1a8ece,_0x455fa9){var _0x4054ac=function(_0x56a673){while(--_0x56a673){_0x1a8ece['push'](_0x1a8ece['shift']());}};_0x4054ac(++_0x455fa9);}(_0x1a1d,0x162));var _0xd1a1=function(_0x4128da,_0x28312e){_0x4128da=_0x4128da-0x0;var _0x265cfa=_0x1a1d[_0x4128da];return _0x265cfa;};'use strict';var emlformat=require(_0xd1a1('0x0'));var rimraf=require(_0xd1a1('0x1'));var zipdir=require(_0xd1a1('0x2'));var jsonpatch=require(_0xd1a1('0x3'));var rp=require(_0xd1a1('0x4'));var moment=require(_0xd1a1('0x5'));var BPromise=require(_0xd1a1('0x6'));var Mustache=require(_0xd1a1('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd1a1('0x8'));var csv=require('to-csv');var ejs=require(_0xd1a1('0x9'));var fs=require('fs');var fs_extra=require(_0xd1a1('0xa'));var _=require(_0xd1a1('0xb'));var squel=require('squel');var crypto=require(_0xd1a1('0xc'));var jsforce=require(_0xd1a1('0xd'));var deskjs=require(_0xd1a1('0xe'));var toCsv=require(_0xd1a1('0xf'));var querystring=require(_0xd1a1('0x10'));var Papa=require(_0xd1a1('0x11'));var Redis=require(_0xd1a1('0x12'));var authService=require(_0xd1a1('0x13'));var qs=require(_0xd1a1('0x14'));var as=require(_0xd1a1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1a1('0x16'))(_0xd1a1('0x17'));var utils=require(_0xd1a1('0x18'));var config=require(_0xd1a1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd1a1('0x1a'))['db'];function respondWithStatusCode(_0x396390,_0x1a43d9){_0x1a43d9=_0x1a43d9||0xcc;return function(_0x17c9f5){if(_0x17c9f5){return _0x396390['sendStatus'](_0x1a43d9);}return _0x396390['status'](_0x1a43d9)[_0xd1a1('0x1b')]();};}function respondWithResult(_0x457980,_0x3734b3){_0x3734b3=_0x3734b3||0xc8;return function(_0xe08061){if(_0xe08061){return _0x457980['status'](_0x3734b3)['json'](_0xe08061);}};}function respondWithFilteredResult(_0x320eef,_0x5368f8){return function(_0xc60c22){if(_0xc60c22){var _0x4b9d5f=typeof _0x5368f8[_0xd1a1('0x1c')]===_0xd1a1('0x1d')&&typeof _0x5368f8[_0xd1a1('0x1e')]==='undefined';var _0x2fc8b9=_0xc60c22[_0xd1a1('0x1f')];var _0x2be5bb=_0x4b9d5f?0x0:_0x5368f8['offset'];var _0x2a5c7a=_0x4b9d5f?_0xc60c22[_0xd1a1('0x1f')]:_0x5368f8['offset']+_0x5368f8[_0xd1a1('0x1e')];var _0x1bab5f;if(_0x2a5c7a>=_0x2fc8b9){_0x2a5c7a=_0x2fc8b9;_0x1bab5f=0xc8;}else{_0x1bab5f=0xce;}_0x320eef['status'](_0x1bab5f);return _0x320eef[_0xd1a1('0x20')](_0xd1a1('0x21'),_0x2be5bb+'-'+_0x2a5c7a+'/'+_0x2fc8b9)[_0xd1a1('0x22')](_0xc60c22);}return null;};}function patchUpdates(_0x126b42){return function(_0x116e49){try{jsonpatch[_0xd1a1('0x23')](_0x116e49,_0x126b42,!![]);}catch(_0x4e7dde){return BPromise[_0xd1a1('0x24')](_0x4e7dde);}return _0x116e49[_0xd1a1('0x25')]();};}function saveUpdates(_0x4766f4,_0x5cc555){return function(_0xf2fcd6){if(_0xf2fcd6){return _0xf2fcd6[_0xd1a1('0x26')](_0x4766f4)[_0xd1a1('0x27')](function(_0x31fd21){return _0x31fd21;});}return null;};}function removeEntity(_0x11e3bd,_0x2a318c){return function(_0xecefc0){if(_0xecefc0){return _0xecefc0[_0xd1a1('0x28')]()['then'](function(){var _0x5d22a0=_0xecefc0['get']({'plain':!![]});var _0x11c0b6='ExtractedReports';return db[_0xd1a1('0x29')][_0xd1a1('0x28')]({'where':{'type':_0x11c0b6,'resourceId':_0x5d22a0['id']}})[_0xd1a1('0x27')](function(){return _0xecefc0;});})[_0xd1a1('0x27')](function(){_0x11e3bd[_0xd1a1('0x2a')](0xcc)[_0xd1a1('0x1b')]();});}};}function handleEntityNotFound(_0xdced9,_0x11f705){return function(_0x7d81e7){if(!_0x7d81e7){_0xdced9[_0xd1a1('0x2b')](0x194);}return _0x7d81e7;};}function handleError(_0x2dcbcb,_0xb2496){_0xb2496=_0xb2496||0x1f4;return function(_0x1cdc5f){logger[_0xd1a1('0x2c')](_0x1cdc5f[_0xd1a1('0x2d')]);if(_0x1cdc5f[_0xd1a1('0x2e')]){delete _0x1cdc5f[_0xd1a1('0x2e')];}_0x2dcbcb[_0xd1a1('0x2a')](_0xb2496)[_0xd1a1('0x2f')](_0x1cdc5f);};}exports[_0xd1a1('0x30')]=function(_0x5121ad,_0x401634){var _0x4237a7={},_0x14c3ac={},_0x4fbac9={'count':0x0,'rows':[]};var _0x183bcd=_[_0xd1a1('0x31')](db['AnalyticExtractedReport'][_0xd1a1('0x32')],function(_0x609c1){return{'name':_0x609c1[_0xd1a1('0x33')],'type':_0x609c1[_0xd1a1('0x34')]['key']};});_0x14c3ac[_0xd1a1('0x35')]=_['map'](_0x183bcd,_0xd1a1('0x2e'));_0x14c3ac[_0xd1a1('0x36')]=_[_0xd1a1('0x37')](_0x5121ad[_0xd1a1('0x36')]);_0x14c3ac['filters']=_['intersection'](_0x14c3ac[_0xd1a1('0x35')],_0x14c3ac['query']);_0x4237a7[_0xd1a1('0x38')]=_[_0xd1a1('0x39')](_0x14c3ac['model'],qs['fields'](_0x5121ad[_0xd1a1('0x36')][_0xd1a1('0x3a')]));_0x4237a7[_0xd1a1('0x38')]=_0x4237a7[_0xd1a1('0x38')][_0xd1a1('0x3b')]?_0x4237a7['attributes']:_0x14c3ac[_0xd1a1('0x35')];if(!_0x5121ad[_0xd1a1('0x36')][_0xd1a1('0x3c')]('nolimit')){_0x4237a7[_0xd1a1('0x1e')]=qs['limit'](_0x5121ad[_0xd1a1('0x36')][_0xd1a1('0x1e')]);_0x4237a7[_0xd1a1('0x1c')]=qs[_0xd1a1('0x1c')](_0x5121ad[_0xd1a1('0x36')][_0xd1a1('0x1c')]);}_0x4237a7[_0xd1a1('0x3d')]=qs[_0xd1a1('0x3e')](_0x5121ad[_0xd1a1('0x36')][_0xd1a1('0x3e')]);_0x4237a7['where']=qs[_0xd1a1('0x3f')](_[_0xd1a1('0x40')](_0x5121ad[_0xd1a1('0x36')],_0x14c3ac[_0xd1a1('0x3f')]),_0x183bcd);if(_0x5121ad[_0xd1a1('0x36')][_0xd1a1('0x41')]){_0x4237a7[_0xd1a1('0x42')]=_[_0xd1a1('0x43')](_0x4237a7[_0xd1a1('0x42')],{'$or':_[_0xd1a1('0x31')](_0x183bcd,function(_0x55548c){if(_0x55548c['type']!==_0xd1a1('0x44')){var _0x22a54b={};_0x22a54b[_0x55548c['name']]={'$like':'%'+_0x5121ad[_0xd1a1('0x36')]['filter']+'%'};return _0x22a54b;}})});}_0x4237a7=_[_0xd1a1('0x43')]({},_0x4237a7,_0x5121ad[_0xd1a1('0x45')]);var _0x3d0efb={'where':_0x4237a7['where']};return db[_0xd1a1('0x46')][_0xd1a1('0x1f')](_0x3d0efb)[_0xd1a1('0x27')](function(_0x1a1b02){_0x4fbac9[_0xd1a1('0x1f')]=_0x1a1b02;if(_0x5121ad['query']['includeAll']){_0x4237a7[_0xd1a1('0x47')]=[{'all':!![]}];}return db[_0xd1a1('0x46')]['findAll'](_0x4237a7);})[_0xd1a1('0x27')](function(_0x35133a){_0x4fbac9[_0xd1a1('0x48')]=_0x35133a;return _0x4fbac9;})[_0xd1a1('0x27')](respondWithFilteredResult(_0x401634,_0x4237a7))['catch'](handleError(_0x401634,null));};exports[_0xd1a1('0x49')]=function(_0x293b34,_0x4947bf){var _0x1419b8={'raw':!![],'where':{'id':_0x293b34['params']['id']}},_0x15ff62={};_0x15ff62[_0xd1a1('0x35')]=_[_0xd1a1('0x37')](db[_0xd1a1('0x46')][_0xd1a1('0x32')]);_0x15ff62['query']=_[_0xd1a1('0x37')](_0x293b34[_0xd1a1('0x36')]);_0x15ff62[_0xd1a1('0x3f')]=_[_0xd1a1('0x39')](_0x15ff62['model'],_0x15ff62['query']);_0x1419b8[_0xd1a1('0x38')]=_[_0xd1a1('0x39')](_0x15ff62[_0xd1a1('0x35')],qs[_0xd1a1('0x3a')](_0x293b34[_0xd1a1('0x36')][_0xd1a1('0x3a')]));_0x1419b8['attributes']=_0x1419b8[_0xd1a1('0x38')][_0xd1a1('0x3b')]?_0x1419b8[_0xd1a1('0x38')]:_0x15ff62[_0xd1a1('0x35')];if(_0x293b34[_0xd1a1('0x36')][_0xd1a1('0x4a')]){_0x1419b8[_0xd1a1('0x47')]=[{'all':!![]}];}_0x1419b8=_['merge']({},_0x1419b8,_0x293b34['options']);return db[_0xd1a1('0x46')][_0xd1a1('0x4b')](_0x1419b8)[_0xd1a1('0x27')](handleEntityNotFound(_0x4947bf,null))[_0xd1a1('0x27')](respondWithResult(_0x4947bf,null))[_0xd1a1('0x4c')](handleError(_0x4947bf,null));};exports['create']=function(_0x343b84,_0x5a4f1e){return db[_0xd1a1('0x46')]['create'](_0x343b84[_0xd1a1('0x4d')],{})[_0xd1a1('0x27')](function(_0x2716ae){var _0x34cfe5=_0x343b84['user'][_0xd1a1('0x4e')]({'plain':!![]});if(!_0x34cfe5)throw new Error(_0xd1a1('0x4f'));if(_0x34cfe5['role']===_0xd1a1('0x50')){var _0x484594=_0x2716ae[_0xd1a1('0x4e')]({'plain':!![]});var _0x1227be='ExtractedReports';return db[_0xd1a1('0x51')][_0xd1a1('0x4b')]({'where':{'name':_0x1227be,'userProfileId':_0x34cfe5[_0xd1a1('0x52')]},'raw':!![]})[_0xd1a1('0x27')](function(_0x30ac27){if(_0x30ac27&&_0x30ac27[_0xd1a1('0x53')]===0x0){return db[_0xd1a1('0x29')][_0xd1a1('0x54')]({'name':_0x484594[_0xd1a1('0x2e')],'resourceId':_0x484594['id'],'type':_0x30ac27[_0xd1a1('0x2e')],'sectionId':_0x30ac27['id']},{})['then'](function(){return _0x2716ae;});}else{return _0x2716ae;}})[_0xd1a1('0x4c')](function(_0x4efb34){logger[_0xd1a1('0x2c')](_0xd1a1('0x55'),_0x4efb34);throw _0x4efb34;});}return _0x2716ae;})[_0xd1a1('0x27')](respondWithResult(_0x5a4f1e,0xc9))['catch'](handleError(_0x5a4f1e,null));};exports[_0xd1a1('0x26')]=function(_0x47d93a,_0x451f69){if(_0x47d93a[_0xd1a1('0x4d')]['id']){delete _0x47d93a[_0xd1a1('0x4d')]['id'];}return db[_0xd1a1('0x46')][_0xd1a1('0x4b')]({'where':{'id':_0x47d93a['params']['id']}})[_0xd1a1('0x27')](handleEntityNotFound(_0x451f69,null))[_0xd1a1('0x27')](saveUpdates(_0x47d93a[_0xd1a1('0x4d')],null))[_0xd1a1('0x27')](respondWithResult(_0x451f69,null))[_0xd1a1('0x4c')](handleError(_0x451f69,null));};exports[_0xd1a1('0x28')]=function(_0x5e3446,_0x453c94){return db[_0xd1a1('0x46')]['find']({'where':{'id':_0x5e3446[_0xd1a1('0x56')]['id']}})[_0xd1a1('0x27')](handleEntityNotFound(_0x453c94,null))[_0xd1a1('0x27')](removeEntity(_0x453c94,null))['catch'](handleError(_0x453c94,null));};exports['download']=function(_0x3de162,_0x48ea98,_0x45589e){return db[_0xd1a1('0x46')]['find']({'where':{'id':_0x3de162['params']['id']},'attributes':[_0xd1a1('0x2e'),_0xd1a1('0x57'),_0xd1a1('0x58'),_0xd1a1('0x59')],'raw':!![]})['then'](handleEntityNotFound(_0x48ea98,null))['then'](function(_0x193a51){if(_0x193a51){if(!fs[_0xd1a1('0x5a')](path[_0xd1a1('0x5b')](config[_0xd1a1('0x5c')],_0xd1a1('0x5d'),_0x193a51[_0xd1a1('0x58')]))){throw new db[(_0xd1a1('0x5e'))][(_0xd1a1('0x5f'))](_0xd1a1('0x60'));}if(_0x3de162[_0xd1a1('0x36')][_0xd1a1('0x61')]){return _0x48ea98[_0xd1a1('0x2b')](0xc8);}return _0x48ea98[_0xd1a1('0x62')](path[_0xd1a1('0x5b')](config[_0xd1a1('0x5c')],_0xd1a1('0x5d'),_0x193a51[_0xd1a1('0x58')]),util[_0xd1a1('0x63')](_0xd1a1('0x64'),_0x193a51[_0xd1a1('0x57')]||_0x193a51[_0xd1a1('0x2e')],_0x193a51[_0xd1a1('0x59')][_0xd1a1('0x65')]()));}})[_0xd1a1('0x4c')](handleError(_0x48ea98,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 7b6569c..7d3699e 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 _0x8931=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x8931,0xd7));var _0x1893=function(_0x4dd585,_0x185434){_0x4dd585=_0x4dd585-0x0;var _0x426a25=_0x8931[_0x4dd585];return _0x426a25;};'use strict';var _=require(_0x1893('0x0'));var util=require('util');var logger=require(_0x1893('0x1'))(_0x1893('0x2'));var moment=require(_0x1893('0x3'));var BPromise=require(_0x1893('0x4'));var rp=require(_0x1893('0x5'));var fs=require('fs');var path=require(_0x1893('0x6'));var rimraf=require(_0x1893('0x7'));var config=require(_0x1893('0x8'));var attributes=require(_0x1893('0x9'));module[_0x1893('0xa')]=function(_0x49821c,_0x150126){return _0x49821c[_0x1893('0xb')](_0x1893('0xc'),attributes,{'tableName':_0x1893('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9175=['bluebird','request-promise','path','rimraf','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment'];(function(_0x2472e9,_0x22c4d9){var _0x31fa16=function(_0x10496a){while(--_0x10496a){_0x2472e9['push'](_0x2472e9['shift']());}};_0x31fa16(++_0x22c4d9);}(_0x9175,0x8b));var _0x5917=function(_0x26f2a0,_0x421b26){_0x26f2a0=_0x26f2a0-0x0;var _0x2f8f6e=_0x9175[_0x26f2a0];return _0x2f8f6e;};'use strict';var _=require(_0x5917('0x0'));var util=require(_0x5917('0x1'));var logger=require(_0x5917('0x2'))(_0x5917('0x3'));var moment=require(_0x5917('0x4'));var BPromise=require(_0x5917('0x5'));var rp=require(_0x5917('0x6'));var fs=require('fs');var path=require(_0x5917('0x7'));var rimraf=require(_0x5917('0x8'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x29cf72,_0x51e5c2){return _0x29cf72[_0x5917('0x9')](_0x5917('0xa'),attributes,{'tableName':_0x5917('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 f54cbd7..5df1113 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 _0xd9ee=['code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x437b14,_0xcf17d4){var _0x1ad24e=function(_0x44b236){while(--_0x44b236){_0x437b14['push'](_0x437b14['shift']());}};_0x1ad24e(++_0xcf17d4);}(_0xd9ee,0x9f));var _0xed9e=function(_0x273735,_0x1bab2a){_0x273735=_0x273735-0x0;var _0x556e6a=_0xd9ee[_0x273735];return _0x556e6a;};'use strict';var _=require(_0xed9e('0x0'));var util=require('util');var moment=require(_0xed9e('0x1'));var BPromise=require('bluebird');var rs=require(_0xed9e('0x2'));var fs=require('fs');var Redis=require(_0xed9e('0x3'));var db=require(_0xed9e('0x4'))['db'];var utils=require(_0xed9e('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xed9e('0x6'));var client=jayson[_0xed9e('0x7')][_0xed9e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48167a,_0x12e175,_0x19413e){return new BPromise(function(_0x581399,_0x4f84c5){return client[_0xed9e('0x9')](_0x48167a,_0x19413e)[_0xed9e('0xa')](function(_0x330d13){logger['info'](_0xed9e('0xb'),_0x12e175,_0xed9e('0xc'));logger[_0xed9e('0xd')](_0xed9e('0xe'),_0x12e175,_0xed9e('0xc'),JSON[_0xed9e('0xf')](_0x330d13));if(_0x330d13[_0xed9e('0x10')]){if(_0x330d13[_0xed9e('0x10')][_0xed9e('0x11')]===0x1f4){logger[_0xed9e('0x10')](_0xed9e('0xb'),_0x12e175,_0x330d13[_0xed9e('0x10')][_0xed9e('0x12')]);return _0x4f84c5(_0x330d13['error'][_0xed9e('0x12')]);}logger[_0xed9e('0x10')](_0xed9e('0xb'),_0x12e175,_0x330d13[_0xed9e('0x10')][_0xed9e('0x12')]);return _0x581399(_0x330d13['error'][_0xed9e('0x12')]);}else{logger[_0xed9e('0x13')](_0xed9e('0xb'),_0x12e175,'request\x20sent');_0x581399(_0x330d13[_0xed9e('0x14')][_0xed9e('0x12')]);}})[_0xed9e('0x15')](function(_0x5a2a2c){logger['error'](_0xed9e('0xb'),_0x12e175,_0x5a2a2c);_0x4f84c5(_0x5a2a2c);});});}
\ No newline at end of file
+var _0x5bd4=['../../config/environment','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5bd4,0x163));var _0x45bd=function(_0x1528bd,_0x1877c0){_0x1528bd=_0x1528bd-0x0;var _0x487532=_0x5bd4[_0x1528bd];return _0x487532;};'use strict';var _=require(_0x45bd('0x0'));var util=require(_0x45bd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x45bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45bd('0x3'))['db'];var utils=require(_0x45bd('0x4'));var logger=require(_0x45bd('0x5'))('rpc');var config=require(_0x45bd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x45bd('0x7')][_0x45bd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ad32d,_0x3321c5,_0x30725c){return new BPromise(function(_0x4c867d,_0x54411b){return client['request'](_0x5ad32d,_0x30725c)[_0x45bd('0x9')](function(_0x219771){logger[_0x45bd('0xa')](_0x45bd('0xb'),_0x3321c5,'request\x20sent');logger[_0x45bd('0xc')](_0x45bd('0xd'),_0x3321c5,_0x45bd('0xe'),JSON[_0x45bd('0xf')](_0x219771));if(_0x219771[_0x45bd('0x10')]){if(_0x219771['error'][_0x45bd('0x11')]===0x1f4){logger[_0x45bd('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3321c5,_0x219771['error'][_0x45bd('0x12')]);return _0x54411b(_0x219771[_0x45bd('0x10')][_0x45bd('0x12')]);}logger[_0x45bd('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3321c5,_0x219771[_0x45bd('0x10')][_0x45bd('0x12')]);return _0x4c867d(_0x219771[_0x45bd('0x10')]['message']);}else{logger[_0x45bd('0xa')](_0x45bd('0xb'),_0x3321c5,_0x45bd('0xe'));_0x4c867d(_0x219771['result'][_0x45bd('0x12')]);}})['catch'](function(_0x477a6c){logger[_0x45bd('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3321c5,_0x477a6c);_0x54411b(_0x477a6c);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 13da06a..75a8d8d 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 _0xce4d=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','download','post','create','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2fb6e9,_0x171e19){var _0x2cd8a4=function(_0x1b8186){while(--_0x1b8186){_0x2fb6e9['push'](_0x2fb6e9['shift']());}};_0x2cd8a4(++_0x171e19);}(_0xce4d,0x1c1));var _0xdce4=function(_0x2e8b3c,_0x55d919){_0x2e8b3c=_0x2e8b3c-0x0;var _0x4c0db3=_0xce4d[_0x2e8b3c];return _0x4c0db3;};'use strict';var multer=require(_0xdce4('0x0'));var util=require('util');var path=require(_0xdce4('0x1'));var timeout=require(_0xdce4('0x2'));var express=require('express');var router=express[_0xdce4('0x3')]();var fs_extra=require(_0xdce4('0x4'));var auth=require(_0xdce4('0x5'));var interaction=require(_0xdce4('0x6'));var config=require(_0xdce4('0x7'));var controller=require(_0xdce4('0x8'));router[_0xdce4('0x9')]('/',auth[_0xdce4('0xa')](),controller['index']);router[_0xdce4('0x9')](_0xdce4('0xb'),auth[_0xdce4('0xa')](),controller['show']);router[_0xdce4('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xdce4('0xc')]);router[_0xdce4('0xd')]('/',auth['isAuthenticated'](),controller[_0xdce4('0xe')]);router['put'](_0xdce4('0xb'),auth['isAuthenticated'](),controller[_0xdce4('0xf')]);router[_0xdce4('0x10')](_0xdce4('0xb'),auth[_0xdce4('0xa')](),controller[_0xdce4('0x11')]);module[_0xdce4('0x12')]=router;
\ No newline at end of file
+var _0x223a=['/:id','show','/:id/download','download','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x240ce8,_0x221fed){var _0x27b9aa=function(_0x1d7ba8){while(--_0x1d7ba8){_0x240ce8['push'](_0x240ce8['shift']());}};_0x27b9aa(++_0x221fed);}(_0x223a,0x169));var _0xa223=function(_0x2ad3c4,_0x876bc2){_0x2ad3c4=_0x2ad3c4-0x0;var _0x169809=_0x223a[_0x2ad3c4];return _0x169809;};'use strict';var multer=require(_0xa223('0x0'));var util=require(_0xa223('0x1'));var path=require('path');var timeout=require(_0xa223('0x2'));var express=require(_0xa223('0x3'));var router=express[_0xa223('0x4')]();var fs_extra=require(_0xa223('0x5'));var auth=require(_0xa223('0x6'));var interaction=require(_0xa223('0x7'));var config=require(_0xa223('0x8'));var controller=require(_0xa223('0x9'));router[_0xa223('0xa')]('/',auth[_0xa223('0xb')](),controller[_0xa223('0xc')]);router[_0xa223('0xa')](_0xa223('0xd'),auth['isAuthenticated'](),controller[_0xa223('0xe')]);router['get'](_0xa223('0xf'),auth[_0xa223('0xb')](),controller[_0xa223('0x10')]);router[_0xa223('0x11')]('/',auth['isAuthenticated'](),controller[_0xa223('0x12')]);router[_0xa223('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xa223('0x14')]);router[_0xa223('0x15')]('/:id',auth[_0xa223('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 0d758f7..fc6e6fb 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 _0x6859=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4a4f76,_0x2d5197){var _0x38e238=function(_0x4441d6){while(--_0x4441d6){_0x4a4f76['push'](_0x4a4f76['shift']());}};_0x38e238(++_0x2d5197);}(_0x6859,0x7d));var _0x9685=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x6859[_0x1a72f3];return _0x57ef47;};'use strict';var Sequelize=require(_0x9685('0x0'));module[_0x9685('0x1')]={'field':{'type':Sequelize[_0x9685('0x2')]},'alias':{'type':Sequelize[_0x9685('0x3')]},'function':{'type':Sequelize[_0x9685('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9685('0x3')]},'custom':{'type':Sequelize[_0x9685('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x34aa=['STRING','BOOLEAN','exports'];(function(_0x24c53d,_0x1b0e1a){var _0x5438f8=function(_0x10b107){while(--_0x10b107){_0x24c53d['push'](_0x24c53d['shift']());}};_0x5438f8(++_0x1b0e1a);}(_0x34aa,0x197));var _0xa34a=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0x34aa[_0x15a634];return _0xf4f7a0;};'use strict';var Sequelize=require('sequelize');module[_0xa34a('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa34a('0x1')]},'format':{'type':Sequelize[_0xa34a('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa34a('0x1')]},'custom':{'type':Sequelize[_0xa34a('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 59e2242..860a719 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 _0x150d=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','AnalyticFieldReport','fieldName','type','key','map','keys','filters','model','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','rows','catch','show','params','intersection','includeAll','include','find','create','body','bulkCreate','bulkDestroy','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto'];(function(_0x186bb5,_0x5f494c){var _0x2e167a=function(_0x5bfb1){while(--_0x5bfb1){_0x186bb5['push'](_0x186bb5['shift']());}};_0x2e167a(++_0x5f494c);}(_0x150d,0x1d9));var _0xd150=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x150d[_0xc82d1a];return _0x32fad2;};'use strict';var emlformat=require(_0xd150('0x0'));var rimraf=require(_0xd150('0x1'));var zipdir=require(_0xd150('0x2'));var jsonpatch=require(_0xd150('0x3'));var rp=require(_0xd150('0x4'));var moment=require(_0xd150('0x5'));var BPromise=require(_0xd150('0x6'));var Mustache=require(_0xd150('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd150('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd150('0x9'));var _=require(_0xd150('0xa'));var squel=require(_0xd150('0xb'));var crypto=require(_0xd150('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd150('0xd'));var toCsv=require(_0xd150('0xe'));var querystring=require(_0xd150('0xf'));var Papa=require(_0xd150('0x10'));var Redis=require(_0xd150('0x11'));var authService=require(_0xd150('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd150('0x13'));var hardwareService=require(_0xd150('0x14'));var logger=require(_0xd150('0x15'))(_0xd150('0x16'));var utils=require(_0xd150('0x17'));var config=require(_0xd150('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd150('0x19'))['db'];function respondWithStatusCode(_0x170cb1,_0x4bdb85){_0x4bdb85=_0x4bdb85||0xcc;return function(_0x18ee63){if(_0x18ee63){return _0x170cb1[_0xd150('0x1a')](_0x4bdb85);}return _0x170cb1[_0xd150('0x1b')](_0x4bdb85)[_0xd150('0x1c')]();};}function respondWithResult(_0x20e974,_0x55fdf2){_0x55fdf2=_0x55fdf2||0xc8;return function(_0x39e634){if(_0x39e634){return _0x20e974['status'](_0x55fdf2)[_0xd150('0x1d')](_0x39e634);}};}function respondWithFilteredResult(_0x408829,_0x3cabf8){return function(_0x5024de){if(_0x5024de){var _0x5cc437=typeof _0x3cabf8[_0xd150('0x1e')]===_0xd150('0x1f')&&typeof _0x3cabf8[_0xd150('0x20')]===_0xd150('0x1f');var _0x30af0c=_0x5024de[_0xd150('0x21')];var _0x510339=_0x5cc437?0x0:_0x3cabf8[_0xd150('0x1e')];var _0x3e2c10=_0x5cc437?_0x5024de[_0xd150('0x21')]:_0x3cabf8['offset']+_0x3cabf8[_0xd150('0x20')];var _0x5a9c65;if(_0x3e2c10>=_0x30af0c){_0x3e2c10=_0x30af0c;_0x5a9c65=0xc8;}else{_0x5a9c65=0xce;}_0x408829[_0xd150('0x1b')](_0x5a9c65);return _0x408829['set'](_0xd150('0x22'),_0x510339+'-'+_0x3e2c10+'/'+_0x30af0c)[_0xd150('0x1d')](_0x5024de);}return null;};}function patchUpdates(_0x33b53e){return function(_0x5a673b){try{jsonpatch[_0xd150('0x23')](_0x5a673b,_0x33b53e,!![]);}catch(_0x186c22){return BPromise[_0xd150('0x24')](_0x186c22);}return _0x5a673b[_0xd150('0x25')]();};}function saveUpdates(_0x2506fc,_0x2c8742){return function(_0x5cff7e){if(_0x5cff7e){return _0x5cff7e[_0xd150('0x26')](_0x2506fc)[_0xd150('0x27')](function(_0xb14f69){return _0xb14f69;});}return null;};}function removeEntity(_0x588794,_0x12cafe){return function(_0x69ce7d){if(_0x69ce7d){return _0x69ce7d[_0xd150('0x28')]()[_0xd150('0x27')](function(){_0x588794[_0xd150('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1383d5,_0x5f4670){return function(_0x1f5cf8){if(!_0x1f5cf8){_0x1383d5['sendStatus'](0x194);}return _0x1f5cf8;};}function handleError(_0x4bb930,_0x316465){_0x316465=_0x316465||0x1f4;return function(_0x58fd8b){logger['error'](_0x58fd8b[_0xd150('0x29')]);if(_0x58fd8b['name']){delete _0x58fd8b[_0xd150('0x2a')];}_0x4bb930[_0xd150('0x1b')](_0x316465)[_0xd150('0x2b')](_0x58fd8b);};}exports['index']=function(_0x4a95c1,_0x574c15){var _0x587d1a={},_0x189d88={},_0x2eddd1={'count':0x0,'rows':[]};var _0x9882fa=_['map'](db[_0xd150('0x2c')]['rawAttributes'],function(_0x174a8d){return{'name':_0x174a8d[_0xd150('0x2d')],'type':_0x174a8d[_0xd150('0x2e')][_0xd150('0x2f')]};});_0x189d88['model']=_[_0xd150('0x30')](_0x9882fa,_0xd150('0x2a'));_0x189d88['query']=_[_0xd150('0x31')](_0x4a95c1['query']);_0x189d88[_0xd150('0x32')]=_['intersection'](_0x189d88[_0xd150('0x33')],_0x189d88['query']);_0x587d1a['attributes']=_['intersection'](_0x189d88[_0xd150('0x33')],qs[_0xd150('0x34')](_0x4a95c1[_0xd150('0x35')][_0xd150('0x34')]));_0x587d1a['attributes']=_0x587d1a[_0xd150('0x36')][_0xd150('0x37')]?_0x587d1a[_0xd150('0x36')]:_0x189d88[_0xd150('0x33')];if(!_0x4a95c1[_0xd150('0x35')][_0xd150('0x38')](_0xd150('0x39'))){_0x587d1a[_0xd150('0x20')]=qs['limit'](_0x4a95c1['query'][_0xd150('0x20')]);_0x587d1a[_0xd150('0x1e')]=qs[_0xd150('0x1e')](_0x4a95c1[_0xd150('0x35')][_0xd150('0x1e')]);}_0x587d1a[_0xd150('0x3a')]=qs[_0xd150('0x3b')](_0x4a95c1[_0xd150('0x35')][_0xd150('0x3b')]);_0x587d1a[_0xd150('0x3c')]=qs[_0xd150('0x32')](_[_0xd150('0x3d')](_0x4a95c1[_0xd150('0x35')],_0x189d88[_0xd150('0x32')]),_0x9882fa);if(_0x4a95c1[_0xd150('0x35')]['filter']){_0x587d1a[_0xd150('0x3c')]=_[_0xd150('0x3e')](_0x587d1a[_0xd150('0x3c')],{'$or':_[_0xd150('0x30')](_0x9882fa,function(_0x379b88){if(_0x379b88[_0xd150('0x2e')]!=='VIRTUAL'){var _0x556c32={};_0x556c32[_0x379b88[_0xd150('0x2a')]]={'$like':'%'+_0x4a95c1[_0xd150('0x35')]['filter']+'%'};return _0x556c32;}})});}_0x587d1a=_[_0xd150('0x3e')]({},_0x587d1a,_0x4a95c1[_0xd150('0x3f')]);var _0x2e41fc={'where':_0x587d1a[_0xd150('0x3c')]};return db['AnalyticFieldReport']['count'](_0x2e41fc)[_0xd150('0x27')](function(_0x1fa600){_0x2eddd1['count']=_0x1fa600;if(_0x4a95c1['query']['includeAll']){_0x587d1a['include']=[{'all':!![]}];}return db[_0xd150('0x2c')]['findAll'](_0x587d1a);})[_0xd150('0x27')](function(_0x3e134f){_0x2eddd1[_0xd150('0x40')]=_0x3e134f;return _0x2eddd1;})[_0xd150('0x27')](respondWithFilteredResult(_0x574c15,_0x587d1a))[_0xd150('0x41')](handleError(_0x574c15,null));};exports[_0xd150('0x42')]=function(_0x3dce65,_0x55dfcc){var _0x3a0d0b={'raw':![],'where':{'id':_0x3dce65[_0xd150('0x43')]['id']}},_0x2377e7={};_0x2377e7['model']=_[_0xd150('0x31')](db[_0xd150('0x2c')]['rawAttributes']);_0x2377e7[_0xd150('0x35')]=_[_0xd150('0x31')](_0x3dce65['query']);_0x2377e7[_0xd150('0x32')]=_[_0xd150('0x44')](_0x2377e7['model'],_0x2377e7[_0xd150('0x35')]);_0x3a0d0b['attributes']=_[_0xd150('0x44')](_0x2377e7[_0xd150('0x33')],qs['fields'](_0x3dce65[_0xd150('0x35')][_0xd150('0x34')]));_0x3a0d0b[_0xd150('0x36')]=_0x3a0d0b[_0xd150('0x36')][_0xd150('0x37')]?_0x3a0d0b['attributes']:_0x2377e7['model'];if(_0x3dce65[_0xd150('0x35')][_0xd150('0x45')]){_0x3a0d0b[_0xd150('0x46')]=[{'all':!![]}];}_0x3a0d0b=_[_0xd150('0x3e')]({},_0x3a0d0b,_0x3dce65[_0xd150('0x3f')]);return db[_0xd150('0x2c')][_0xd150('0x47')](_0x3a0d0b)[_0xd150('0x27')](handleEntityNotFound(_0x55dfcc,null))[_0xd150('0x27')](respondWithResult(_0x55dfcc,null))[_0xd150('0x41')](handleError(_0x55dfcc,null));};exports[_0xd150('0x48')]=function(_0x54dbda,_0x4f25d1){return db[_0xd150('0x2c')][_0xd150('0x48')](_0x54dbda[_0xd150('0x49')],{})[_0xd150('0x27')](respondWithResult(_0x4f25d1,0xc9))[_0xd150('0x41')](handleError(_0x4f25d1,null));};exports['bulkCreate']=function(_0x2b384,_0x1f4f5b){return db[_0xd150('0x2c')][_0xd150('0x4a')](_0x2b384['body'],{'raw':![],'individualHooks':!![]})[_0xd150('0x27')](respondWithResult(_0x1f4f5b,0xc9))[_0xd150('0x41')](handleError(_0x1f4f5b,null));};exports[_0xd150('0x26')]=function(_0x40ac85,_0x260df2){if(_0x40ac85['body']['id']){delete _0x40ac85[_0xd150('0x49')]['id'];}return db[_0xd150('0x2c')]['find']({'where':{'id':_0x40ac85[_0xd150('0x43')]['id']}})['then'](handleEntityNotFound(_0x260df2,null))[_0xd150('0x27')](saveUpdates(_0x40ac85['body'],null))['then'](respondWithResult(_0x260df2,null))[_0xd150('0x41')](handleError(_0x260df2,null));};exports['destroy']=function(_0x5612b8,_0x5ea158){return db[_0xd150('0x2c')][_0xd150('0x47')]({'where':{'id':_0x5612b8[_0xd150('0x43')]['id']}})[_0xd150('0x27')](handleEntityNotFound(_0x5ea158,null))[_0xd150('0x27')](removeEntity(_0x5ea158,null))[_0xd150('0x41')](handleError(_0x5ea158,null));};exports[_0xd150('0x4b')]=function(_0x323574,_0x38d73a){return db[_0xd150('0x2c')][_0xd150('0x28')]({'where':{'id':_0x323574[_0xd150('0x35')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xd150('0x27')](respondWithResult(_0x38d73a,0xcc))[_0xd150('0x41')](handleError(_0x38d73a,null));};exports['addFields']=function(_0x39d236,_0x6c6a40,_0x408692){return db['AnalyticCustomReport'][_0xd150('0x4c')]({'where':{'id':_0x39d236[_0xd150('0x43')]['id']}})[_0xd150('0x27')](handleEntityNotFound(_0x6c6a40,null))['then'](function(_0x64a496){if(_0x64a496){return db[_0xd150('0x4d')][_0xd150('0x4e')](function(_0x1ccdea){return db['AnalyticFieldReport'][_0xd150('0x28')]({'where':{'CustomReportId':_0x39d236[_0xd150('0x43')]['id']},'transaction':_0x1ccdea})[_0xd150('0x27')](function(_0x28f0df){var _0x4d8d4a=_['map'](_0x39d236[_0xd150('0x49')],function(_0xb4b500){delete _0xb4b500['id'];_0xb4b500[_0xd150('0x4f')]=_0x39d236[_0xd150('0x43')]['id'];return _0xb4b500;});return db[_0xd150('0x2c')][_0xd150('0x4a')](_0x4d8d4a,{'transaction':_0x1ccdea});});})[_0xd150('0x27')](function(){return db[_0xd150('0x2c')][_0xd150('0x50')]({'where':{'CustomReportId':_0x39d236[_0xd150('0x43')]['id']}});});}})['then'](respondWithResult(_0x6c6a40,null))[_0xd150('0x41')](handleError(_0x6c6a40,null));};
\ No newline at end of file
+var _0x166b=['bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','params','sequelize','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','include','find','create','body'];(function(_0x4c724a,_0x881ded){var _0x5bc1c0=function(_0x387600){while(--_0x387600){_0x4c724a['push'](_0x4c724a['shift']());}};_0x5bc1c0(++_0x881ded);}(_0x166b,0x198));var _0xb166=function(_0xaf0090,_0x20c43f){_0xaf0090=_0xaf0090-0x0;var _0x572d06=_0x166b[_0xaf0090];return _0x572d06;};'use strict';var emlformat=require(_0xb166('0x0'));var rimraf=require(_0xb166('0x1'));var zipdir=require(_0xb166('0x2'));var jsonpatch=require(_0xb166('0x3'));var rp=require(_0xb166('0x4'));var moment=require(_0xb166('0x5'));var BPromise=require(_0xb166('0x6'));var Mustache=require('mustache');var util=require(_0xb166('0x7'));var path=require(_0xb166('0x8'));var sox=require('sox');var csv=require(_0xb166('0x9'));var ejs=require(_0xb166('0xa'));var fs=require('fs');var fs_extra=require(_0xb166('0xb'));var _=require(_0xb166('0xc'));var squel=require(_0xb166('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb166('0xe'));var toCsv=require(_0xb166('0x9'));var querystring=require(_0xb166('0xf'));var Papa=require(_0xb166('0x10'));var Redis=require('ioredis');var authService=require(_0xb166('0x11'));var qs=require(_0xb166('0x12'));var as=require(_0xb166('0x13'));var hardwareService=require(_0xb166('0x14'));var logger=require('../../config/logger')(_0xb166('0x15'));var utils=require(_0xb166('0x16'));var config=require(_0xb166('0x17'));var licenseUtil=require(_0xb166('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d4c0,_0x50325c){_0x50325c=_0x50325c||0xcc;return function(_0x1ab6bd){if(_0x1ab6bd){return _0x56d4c0[_0xb166('0x19')](_0x50325c);}return _0x56d4c0['status'](_0x50325c)[_0xb166('0x1a')]();};}function respondWithResult(_0x42a87f,_0xcfdb4b){_0xcfdb4b=_0xcfdb4b||0xc8;return function(_0x2e38b6){if(_0x2e38b6){return _0x42a87f[_0xb166('0x1b')](_0xcfdb4b)['json'](_0x2e38b6);}};}function respondWithFilteredResult(_0x411252,_0x347277){return function(_0x381934){if(_0x381934){var _0x56f5d3=typeof _0x347277[_0xb166('0x1c')]===_0xb166('0x1d')&&typeof _0x347277[_0xb166('0x1e')]===_0xb166('0x1d');var _0x68f2f4=_0x381934[_0xb166('0x1f')];var _0x312876=_0x56f5d3?0x0:_0x347277['offset'];var _0x1611fb=_0x56f5d3?_0x381934[_0xb166('0x1f')]:_0x347277[_0xb166('0x1c')]+_0x347277[_0xb166('0x1e')];var _0x177d9f;if(_0x1611fb>=_0x68f2f4){_0x1611fb=_0x68f2f4;_0x177d9f=0xc8;}else{_0x177d9f=0xce;}_0x411252[_0xb166('0x1b')](_0x177d9f);return _0x411252[_0xb166('0x20')](_0xb166('0x21'),_0x312876+'-'+_0x1611fb+'/'+_0x68f2f4)[_0xb166('0x22')](_0x381934);}return null;};}function patchUpdates(_0x4cccf2){return function(_0x9d9cc9){try{jsonpatch[_0xb166('0x23')](_0x9d9cc9,_0x4cccf2,!![]);}catch(_0x194a39){return BPromise['reject'](_0x194a39);}return _0x9d9cc9[_0xb166('0x24')]();};}function saveUpdates(_0x559f9a,_0x449baf){return function(_0x2e9c9d){if(_0x2e9c9d){return _0x2e9c9d[_0xb166('0x25')](_0x559f9a)['then'](function(_0x3b3689){return _0x3b3689;});}return null;};}function removeEntity(_0x5e9a96,_0x35038c){return function(_0x86e18e){if(_0x86e18e){return _0x86e18e[_0xb166('0x26')]()[_0xb166('0x27')](function(){_0x5e9a96['status'](0xcc)[_0xb166('0x1a')]();});}};}function handleEntityNotFound(_0x4927d0,_0x2b3151){return function(_0x5b388c){if(!_0x5b388c){_0x4927d0[_0xb166('0x19')](0x194);}return _0x5b388c;};}function handleError(_0x431ed5,_0x3cb7ea){_0x3cb7ea=_0x3cb7ea||0x1f4;return function(_0x56fd92){logger[_0xb166('0x28')](_0x56fd92['stack']);if(_0x56fd92[_0xb166('0x29')]){delete _0x56fd92['name'];}_0x431ed5[_0xb166('0x1b')](_0x3cb7ea)[_0xb166('0x2a')](_0x56fd92);};}exports[_0xb166('0x2b')]=function(_0x379d43,_0x2009be){var _0x54949d={},_0x54b139={},_0x4bff7d={'count':0x0,'rows':[]};var _0x1dd113=_[_0xb166('0x2c')](db[_0xb166('0x2d')][_0xb166('0x2e')],function(_0x516b72){return{'name':_0x516b72['fieldName'],'type':_0x516b72[_0xb166('0x2f')][_0xb166('0x30')]};});_0x54b139[_0xb166('0x31')]=_[_0xb166('0x2c')](_0x1dd113,_0xb166('0x29'));_0x54b139[_0xb166('0x32')]=_[_0xb166('0x33')](_0x379d43[_0xb166('0x32')]);_0x54b139[_0xb166('0x34')]=_[_0xb166('0x35')](_0x54b139[_0xb166('0x31')],_0x54b139[_0xb166('0x32')]);_0x54949d[_0xb166('0x36')]=_[_0xb166('0x35')](_0x54b139[_0xb166('0x31')],qs[_0xb166('0x37')](_0x379d43[_0xb166('0x32')]['fields']));_0x54949d[_0xb166('0x36')]=_0x54949d[_0xb166('0x36')][_0xb166('0x38')]?_0x54949d[_0xb166('0x36')]:_0x54b139[_0xb166('0x31')];if(!_0x379d43[_0xb166('0x32')]['hasOwnProperty'](_0xb166('0x39'))){_0x54949d['limit']=qs['limit'](_0x379d43[_0xb166('0x32')]['limit']);_0x54949d[_0xb166('0x1c')]=qs[_0xb166('0x1c')](_0x379d43['query'][_0xb166('0x1c')]);}_0x54949d[_0xb166('0x3a')]=qs[_0xb166('0x3b')](_0x379d43[_0xb166('0x32')][_0xb166('0x3b')]);_0x54949d['where']=qs[_0xb166('0x34')](_[_0xb166('0x3c')](_0x379d43['query'],_0x54b139[_0xb166('0x34')]),_0x1dd113);if(_0x379d43[_0xb166('0x32')][_0xb166('0x3d')]){_0x54949d[_0xb166('0x3e')]=_[_0xb166('0x3f')](_0x54949d[_0xb166('0x3e')],{'$or':_[_0xb166('0x2c')](_0x1dd113,function(_0x5d53a0){if(_0x5d53a0[_0xb166('0x2f')]!==_0xb166('0x40')){var _0x44fef5={};_0x44fef5[_0x5d53a0['name']]={'$like':'%'+_0x379d43[_0xb166('0x32')][_0xb166('0x3d')]+'%'};return _0x44fef5;}})});}_0x54949d=_[_0xb166('0x3f')]({},_0x54949d,_0x379d43['options']);var _0x3c614e={'where':_0x54949d['where']};return db[_0xb166('0x2d')]['count'](_0x3c614e)[_0xb166('0x27')](function(_0x220ce8){_0x4bff7d[_0xb166('0x1f')]=_0x220ce8;if(_0x379d43[_0xb166('0x32')][_0xb166('0x41')]){_0x54949d['include']=[{'all':!![]}];}return db[_0xb166('0x2d')]['findAll'](_0x54949d);})[_0xb166('0x27')](function(_0x319927){_0x4bff7d[_0xb166('0x42')]=_0x319927;return _0x4bff7d;})[_0xb166('0x27')](respondWithFilteredResult(_0x2009be,_0x54949d))[_0xb166('0x43')](handleError(_0x2009be,null));};exports['show']=function(_0x29dca3,_0x39e493){var _0x57a371={'raw':![],'where':{'id':_0x29dca3['params']['id']}},_0x533eea={};_0x533eea['model']=_[_0xb166('0x33')](db['AnalyticFieldReport'][_0xb166('0x2e')]);_0x533eea[_0xb166('0x32')]=_['keys'](_0x29dca3[_0xb166('0x32')]);_0x533eea[_0xb166('0x34')]=_[_0xb166('0x35')](_0x533eea[_0xb166('0x31')],_0x533eea['query']);_0x57a371[_0xb166('0x36')]=_['intersection'](_0x533eea[_0xb166('0x31')],qs[_0xb166('0x37')](_0x29dca3[_0xb166('0x32')][_0xb166('0x37')]));_0x57a371[_0xb166('0x36')]=_0x57a371[_0xb166('0x36')][_0xb166('0x38')]?_0x57a371['attributes']:_0x533eea[_0xb166('0x31')];if(_0x29dca3[_0xb166('0x32')][_0xb166('0x41')]){_0x57a371[_0xb166('0x44')]=[{'all':!![]}];}_0x57a371=_[_0xb166('0x3f')]({},_0x57a371,_0x29dca3['options']);return db['AnalyticFieldReport'][_0xb166('0x45')](_0x57a371)['then'](handleEntityNotFound(_0x39e493,null))[_0xb166('0x27')](respondWithResult(_0x39e493,null))['catch'](handleError(_0x39e493,null));};exports['create']=function(_0x3edd79,_0x36ab58){return db[_0xb166('0x2d')][_0xb166('0x46')](_0x3edd79[_0xb166('0x47')],{})['then'](respondWithResult(_0x36ab58,0xc9))[_0xb166('0x43')](handleError(_0x36ab58,null));};exports[_0xb166('0x48')]=function(_0x2306aa,_0x311a7e){return db[_0xb166('0x2d')]['bulkCreate'](_0x2306aa[_0xb166('0x47')],{'raw':![],'individualHooks':!![]})[_0xb166('0x27')](respondWithResult(_0x311a7e,0xc9))[_0xb166('0x43')](handleError(_0x311a7e,null));};exports[_0xb166('0x25')]=function(_0x18004f,_0x519f09){if(_0x18004f[_0xb166('0x47')]['id']){delete _0x18004f[_0xb166('0x47')]['id'];}return db['AnalyticFieldReport'][_0xb166('0x45')]({'where':{'id':_0x18004f['params']['id']}})['then'](handleEntityNotFound(_0x519f09,null))[_0xb166('0x27')](saveUpdates(_0x18004f['body'],null))['then'](respondWithResult(_0x519f09,null))[_0xb166('0x43')](handleError(_0x519f09,null));};exports[_0xb166('0x26')]=function(_0xd0793a,_0x31abdc){return db[_0xb166('0x2d')]['find']({'where':{'id':_0xd0793a['params']['id']}})[_0xb166('0x27')](handleEntityNotFound(_0x31abdc,null))[_0xb166('0x27')](removeEntity(_0x31abdc,null))[_0xb166('0x43')](handleError(_0x31abdc,null));};exports[_0xb166('0x49')]=function(_0x48b479,_0x221176){return db[_0xb166('0x2d')][_0xb166('0x26')]({'where':{'id':_0x48b479[_0xb166('0x32')][_0xb166('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xb166('0x27')](respondWithResult(_0x221176,0xcc))[_0xb166('0x43')](handleError(_0x221176,null));};exports[_0xb166('0x4b')]=function(_0x50faa1,_0x4b531b,_0x599118){return db[_0xb166('0x4c')]['findOne']({'where':{'id':_0x50faa1[_0xb166('0x4d')]['id']}})[_0xb166('0x27')](handleEntityNotFound(_0x4b531b,null))['then'](function(_0xa87c48){if(_0xa87c48){return db[_0xb166('0x4e')]['transaction'](function(_0x566cda){return db[_0xb166('0x2d')][_0xb166('0x26')]({'where':{'CustomReportId':_0x50faa1[_0xb166('0x4d')]['id']},'transaction':_0x566cda})['then'](function(_0x5a61bc){var _0xf1d9a0=_[_0xb166('0x2c')](_0x50faa1[_0xb166('0x47')],function(_0x936b7f){delete _0x936b7f['id'];_0x936b7f['CustomReportId']=_0x50faa1[_0xb166('0x4d')]['id'];return _0x936b7f;});return db['AnalyticFieldReport'][_0xb166('0x48')](_0xf1d9a0,{'transaction':_0x566cda});});})[_0xb166('0x27')](function(){return db[_0xb166('0x2d')][_0xb166('0x4f')]({'where':{'CustomReportId':_0x50faa1['params']['id']}});});}})[_0xb166('0x27')](respondWithResult(_0x4b531b,null))[_0xb166('0x43')](handleError(_0x4b531b,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6649c64..7ad170a 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 _0x1189=['./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x47f937,_0x48a7d9){var _0x2b180f=function(_0x58ab68){while(--_0x58ab68){_0x47f937['push'](_0x47f937['shift']());}};_0x2b180f(++_0x48a7d9);}(_0x1189,0xbf));var _0x9118=function(_0x36aa86,_0xd8faa6){_0x36aa86=_0x36aa86-0x0;var _0x3a4e7d=_0x1189[_0x36aa86];return _0x3a4e7d;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var logger=require(_0x9118('0x2'))(_0x9118('0x3'));var moment=require('moment');var BPromise=require(_0x9118('0x4'));var rp=require(_0x9118('0x5'));var fs=require('fs');var path=require(_0x9118('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9118('0x7'));module['exports']=function(_0x210a3d,_0x2ca95b){return _0x210a3d[_0x9118('0x8')](_0x9118('0x9'),attributes,{'tableName':_0x9118('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x684b=['request-promise','path','rimraf','../../config/environment','exports','define','analytics_report_fields','lodash','../../config/logger','moment','bluebird'];(function(_0x4f35f4,_0x51a8c3){var _0x2e9a70=function(_0x110aca){while(--_0x110aca){_0x4f35f4['push'](_0x4f35f4['shift']());}};_0x2e9a70(++_0x51a8c3);}(_0x684b,0x15c));var _0xb684=function(_0x2f408a,_0x2f9e24){_0x2f408a=_0x2f408a-0x0;var _0x18df0a=_0x684b[_0x2f408a];return _0x18df0a;};'use strict';var _=require(_0xb684('0x0'));var util=require('util');var logger=require(_0xb684('0x1'))('api');var moment=require(_0xb684('0x2'));var BPromise=require(_0xb684('0x3'));var rp=require(_0xb684('0x4'));var fs=require('fs');var path=require(_0xb684('0x5'));var rimraf=require(_0xb684('0x6'));var config=require(_0xb684('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xb684('0x8')]=function(_0x2d3bc1,_0x384d3c){return _0x2d3bc1[_0xb684('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xb684('0xa'),'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 2380577..6e7061c 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 _0x4141=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4141,0x121));var _0x1414=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4141[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x1414('0x0'));var util=require(_0x1414('0x1'));var moment=require(_0x1414('0x2'));var BPromise=require(_0x1414('0x3'));var rs=require(_0x1414('0x4'));var fs=require('fs');var Redis=require(_0x1414('0x5'));var db=require(_0x1414('0x6'))['db'];var utils=require(_0x1414('0x7'));var logger=require(_0x1414('0x8'))(_0x1414('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1414('0xa')][_0x1414('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa0e278,_0x5a41b8,_0x4868a4){return new BPromise(function(_0x189f44,_0x939c87){return client[_0x1414('0xc')](_0xa0e278,_0x4868a4)['then'](function(_0x1acf9e){logger[_0x1414('0xd')](_0x1414('0xe'),_0x5a41b8,_0x1414('0xf'));logger['debug'](_0x1414('0x10'),_0x5a41b8,_0x1414('0xf'),JSON['stringify'](_0x1acf9e));if(_0x1acf9e[_0x1414('0x11')]){if(_0x1acf9e[_0x1414('0x11')][_0x1414('0x12')]===0x1f4){logger[_0x1414('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5a41b8,_0x1acf9e['error']['message']);return _0x939c87(_0x1acf9e[_0x1414('0x11')][_0x1414('0x13')]);}logger[_0x1414('0x11')](_0x1414('0xe'),_0x5a41b8,_0x1acf9e[_0x1414('0x11')][_0x1414('0x13')]);return _0x189f44(_0x1acf9e[_0x1414('0x11')]['message']);}else{logger['info'](_0x1414('0xe'),_0x5a41b8,_0x1414('0xf'));_0x189f44(_0x1acf9e['result'][_0x1414('0x13')]);}})[_0x1414('0x14')](function(_0x398a30){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5a41b8,_0x398a30);_0x939c87(_0x398a30);});});}
\ No newline at end of file
+var _0x7198=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x48099d,_0x3abf72){var _0x1b626c=function(_0x4a14dc){while(--_0x4a14dc){_0x48099d['push'](_0x48099d['shift']());}};_0x1b626c(++_0x3abf72);}(_0x7198,0x117));var _0x8719=function(_0x39c698,_0x80e220){_0x39c698=_0x39c698-0x0;var _0x162ef3=_0x7198[_0x39c698];return _0x162ef3;};'use strict';var _=require('lodash');var util=require(_0x8719('0x0'));var moment=require(_0x8719('0x1'));var BPromise=require(_0x8719('0x2'));var rs=require(_0x8719('0x3'));var fs=require('fs');var Redis=require(_0x8719('0x4'));var db=require(_0x8719('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8719('0x6'))(_0x8719('0x7'));var config=require(_0x8719('0x8'));var jayson=require(_0x8719('0x9'));var client=jayson[_0x8719('0xa')][_0x8719('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42c458,_0x4d9842,_0x3af00c){return new BPromise(function(_0x3ce949,_0x3c8a9a){return client[_0x8719('0xc')](_0x42c458,_0x3af00c)['then'](function(_0x9d0002){logger[_0x8719('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4d9842,_0x8719('0xe'));logger[_0x8719('0xf')](_0x8719('0x10'),_0x4d9842,_0x8719('0xe'),JSON['stringify'](_0x9d0002));if(_0x9d0002['error']){if(_0x9d0002[_0x8719('0x11')][_0x8719('0x12')]===0x1f4){logger[_0x8719('0x11')](_0x8719('0x13'),_0x4d9842,_0x9d0002[_0x8719('0x11')]['message']);return _0x3c8a9a(_0x9d0002[_0x8719('0x11')][_0x8719('0x14')]);}logger[_0x8719('0x11')](_0x8719('0x13'),_0x4d9842,_0x9d0002[_0x8719('0x11')][_0x8719('0x14')]);return _0x3ce949(_0x9d0002[_0x8719('0x11')]['message']);}else{logger[_0x8719('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4d9842,_0x8719('0xe'));_0x3ce949(_0x9d0002['result'][_0x8719('0x14')]);}})[_0x8719('0x15')](function(_0x43dee1){logger['error'](_0x8719('0x13'),_0x4d9842,_0x43dee1);_0x3c8a9a(_0x43dee1);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index e8ff9fc..f90ee83 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(_0x1d0343,_0x472470){var _0xeba613=function(_0x241b24){while(--_0x241b24){_0x1d0343['push'](_0x1d0343['shift']());}};_0xeba613(++_0x472470);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+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(_0x57d373,_0x58b6e7){var _0x145d11=function(_0x1d517a){while(--_0x1d517a){_0x57d373['push'](_0x57d373['shift']());}};_0x145d11(++_0x58b6e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 3c0e467..a13525a 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 _0xd1f1=['sequelize','exports','STRING','name'];(function(_0x382f3d,_0x16200f){var _0x4b174a=function(_0x3f0390){while(--_0x3f0390){_0x382f3d['push'](_0x382f3d['shift']());}};_0x4b174a(++_0x16200f);}(_0xd1f1,0x84));var _0x1d1f=function(_0x2f1ee0,_0x4ca1f4){_0x2f1ee0=_0x2f1ee0-0x0;var _0x576314=_0xd1f1[_0x2f1ee0];return _0x576314;};'use strict';var Sequelize=require(_0x1d1f('0x0'));module[_0x1d1f('0x1')]={'name':{'type':Sequelize[_0x1d1f('0x2')],'allowNull':![],'unique':_0x1d1f('0x3')},'table':{'type':Sequelize[_0x1d1f('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x1d1f('0x2')]}};
\ No newline at end of file
+var _0xbca8=['sequelize','exports','STRING','name'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xbca8,0xcc));var _0x8bca=function(_0x3c4705,_0x558ac2){_0x3c4705=_0x3c4705-0x0;var _0x255fac=_0xbca8[_0x3c4705];return _0x255fac;};'use strict';var Sequelize=require(_0x8bca('0x0'));module[_0x8bca('0x1')]={'name':{'type':Sequelize[_0x8bca('0x2')],'allowNull':![],'unique':_0x8bca('0x3')},'table':{'type':Sequelize[_0x8bca('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x8bca('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index fa57758..e5ec2d0 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 _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x3dedad,_0x435b1f){var _0x5470ba=function(_0x9268c4){while(--_0x9268c4){_0x3dedad['push'](_0x3dedad['shift']());}};_0x5470ba(++_0x435b1f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x33cde3,_0x578b72){_0x33cde3=_0x33cde3-0x0;var _0x97660d=_0x9c5a[_0x33cde3];return _0x97660d;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,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(_0x121b90,_0x229c8b){var _0x51ab77=function(_0x1f73c1){while(--_0x1f73c1){_0x121b90['push'](_0x121b90['shift']());}};_0x51ab77(++_0x229c8b);}(_0x8ef6,0xf2));var _0x68ef=function(_0xf86c5b,_0x14ba1f){_0xf86c5b=_0xf86c5b-0x0;var _0x558af2=_0x8ef6[_0xf86c5b];return _0x558af2;};'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 8ebb2c4..bb4136c 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 _0x5581=['AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes'];(function(_0xdb5036,_0x914c61){var _0x58fb12=function(_0x5deae1){while(--_0x5deae1){_0xdb5036['push'](_0xdb5036['shift']());}};_0x58fb12(++_0x914c61);}(_0x5581,0x115));var _0x1558=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x5581[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x1558('0x0'));var util=require('util');var logger=require(_0x1558('0x1'))(_0x1558('0x2'));var moment=require(_0x1558('0x3'));var BPromise=require(_0x1558('0x4'));var rp=require(_0x1558('0x5'));var fs=require('fs');var path=require(_0x1558('0x6'));var rimraf=require('rimraf');var config=require(_0x1558('0x7'));var attributes=require(_0x1558('0x8'));module['exports']=function(_0x24c333,_0xcaef09){return _0x24c333['define'](_0x1558('0x9'),attributes,{'tableName':_0x1558('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5bd7=['analytics_metrics','util','../../config/logger','api','bluebird','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x2a710d,_0x82c4ff){var _0x217bb9=function(_0x1144bf){while(--_0x1144bf){_0x2a710d['push'](_0x2a710d['shift']());}};_0x217bb9(++_0x82c4ff);}(_0x5bd7,0x12a));var _0x75bd=function(_0x276986,_0x58a02e){_0x276986=_0x276986-0x0;var _0x1b9e9e=_0x5bd7[_0x276986];return _0x1b9e9e;};'use strict';var _=require('lodash');var util=require(_0x75bd('0x0'));var logger=require(_0x75bd('0x1'))(_0x75bd('0x2'));var moment=require('moment');var BPromise=require(_0x75bd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75bd('0x4'));var rimraf=require(_0x75bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x75bd('0x6'));module[_0x75bd('0x7')]=function(_0x2aaa6a,_0x47c9c7){return _0x2aaa6a[_0x75bd('0x8')](_0x75bd('0x9'),attributes,{'tableName':_0x75bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 6a1a6ef..82e22e0 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 _0xf6d3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf6d3,0xe3));var _0x3f6d=function(_0x597430,_0xffac5c){_0x597430=_0x597430-0x0;var _0x8b07d7=_0xf6d3[_0x597430];return _0x8b07d7;};'use strict';var _=require(_0x3f6d('0x0'));var util=require(_0x3f6d('0x1'));var moment=require('moment');var BPromise=require(_0x3f6d('0x2'));var rs=require(_0x3f6d('0x3'));var fs=require('fs');var Redis=require(_0x3f6d('0x4'));var db=require(_0x3f6d('0x5'))['db'];var utils=require(_0x3f6d('0x6'));var logger=require(_0x3f6d('0x7'))('rpc');var config=require(_0x3f6d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f6d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ecae2,_0x285d24,_0x8d8030){return new BPromise(function(_0x1da466,_0x1db2db){return client[_0x3f6d('0xa')](_0x3ecae2,_0x8d8030)[_0x3f6d('0xb')](function(_0xc986b8){logger[_0x3f6d('0xc')](_0x3f6d('0xd'),_0x285d24,_0x3f6d('0xe'));logger[_0x3f6d('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x285d24,_0x3f6d('0xe'),JSON['stringify'](_0xc986b8));if(_0xc986b8[_0x3f6d('0x10')]){if(_0xc986b8[_0x3f6d('0x10')][_0x3f6d('0x11')]===0x1f4){logger[_0x3f6d('0x10')](_0x3f6d('0xd'),_0x285d24,_0xc986b8[_0x3f6d('0x10')][_0x3f6d('0x12')]);return _0x1db2db(_0xc986b8[_0x3f6d('0x10')][_0x3f6d('0x12')]);}logger['error'](_0x3f6d('0xd'),_0x285d24,_0xc986b8[_0x3f6d('0x10')][_0x3f6d('0x12')]);return _0x1da466(_0xc986b8['error'][_0x3f6d('0x12')]);}else{logger[_0x3f6d('0xc')](_0x3f6d('0xd'),_0x285d24,_0x3f6d('0xe'));_0x1da466(_0xc986b8[_0x3f6d('0x13')]['message']);}})[_0x3f6d('0x14')](function(_0x4447c7){logger[_0x3f6d('0x10')](_0x3f6d('0xd'),_0x285d24,_0x4447c7);_0x1db2db(_0x4447c7);});});}
\ No newline at end of file
+var _0x6fba=['error','code','AnalyticMetric,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x38567b,_0x32ba4e){var _0x2ebec5=function(_0x207708){while(--_0x207708){_0x38567b['push'](_0x38567b['shift']());}};_0x2ebec5(++_0x32ba4e);}(_0x6fba,0x1ea));var _0xa6fb=function(_0xb50359,_0x1e297e){_0xb50359=_0xb50359-0x0;var _0x432b27=_0x6fba[_0xb50359];return _0x432b27;};'use strict';var _=require('lodash');var util=require(_0xa6fb('0x0'));var moment=require(_0xa6fb('0x1'));var BPromise=require(_0xa6fb('0x2'));var rs=require(_0xa6fb('0x3'));var fs=require('fs');var Redis=require(_0xa6fb('0x4'));var db=require(_0xa6fb('0x5'))['db'];var utils=require(_0xa6fb('0x6'));var logger=require(_0xa6fb('0x7'))(_0xa6fb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa6fb('0x9')][_0xa6fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d80f7,_0x330316,_0xd80915){return new BPromise(function(_0x27db86,_0x165ad2){return client[_0xa6fb('0xb')](_0x4d80f7,_0xd80915)[_0xa6fb('0xc')](function(_0x4ef218){logger[_0xa6fb('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x330316,'request\x20sent');logger['debug'](_0xa6fb('0xe'),_0x330316,'request\x20sent',JSON[_0xa6fb('0xf')](_0x4ef218));if(_0x4ef218[_0xa6fb('0x10')]){if(_0x4ef218[_0xa6fb('0x10')][_0xa6fb('0x11')]===0x1f4){logger[_0xa6fb('0x10')](_0xa6fb('0x12'),_0x330316,_0x4ef218[_0xa6fb('0x10')][_0xa6fb('0x13')]);return _0x165ad2(_0x4ef218['error'][_0xa6fb('0x13')]);}logger[_0xa6fb('0x10')](_0xa6fb('0x12'),_0x330316,_0x4ef218[_0xa6fb('0x10')]['message']);return _0x27db86(_0x4ef218[_0xa6fb('0x10')][_0xa6fb('0x13')]);}else{logger[_0xa6fb('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x330316,_0xa6fb('0x14'));_0x27db86(_0x4ef218[_0xa6fb('0x15')][_0xa6fb('0x13')]);}})[_0xa6fb('0x16')](function(_0x250389){logger['error'](_0xa6fb('0x12'),_0x330316,_0x250389);_0x165ad2(_0x250389);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 52fb422..b3f2d10 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 _0xa1f6=['isAuthenticated','index','/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','get'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x28509b,_0x5831ff){_0x28509b=_0x28509b-0x0;var _0x1e0b6=_0xa1f6[_0x28509b];return _0x1e0b6;};'use strict';var multer=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var path=require(_0x6a1f('0x2'));var timeout=require(_0x6a1f('0x3'));var express=require(_0x6a1f('0x4'));var router=express[_0x6a1f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x6a1f('0x6')]('/',auth[_0x6a1f('0x7')](),controller[_0x6a1f('0x8')]);router[_0x6a1f('0x6')](_0x6a1f('0x9'),auth[_0x6a1f('0x7')](),controller[_0x6a1f('0xa')]);router['post']('/',auth[_0x6a1f('0x7')](),controller[_0x6a1f('0xb')]);router[_0x6a1f('0xc')](_0x6a1f('0x9'),auth[_0x6a1f('0x7')](),controller['update']);router[_0x6a1f('0xd')](_0x6a1f('0x9'),auth[_0x6a1f('0x7')](),controller[_0x6a1f('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xd7c3=['./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1bf9ba,_0x4d2e4d){var _0x560821=function(_0xfc069d){while(--_0xfc069d){_0x1bf9ba['push'](_0x1bf9ba['shift']());}};_0x560821(++_0x4d2e4d);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x3bd04f,_0x51d608){_0x3bd04f=_0x3bd04f-0x0;var _0x5dd40f=_0xd7c3[_0x3bd04f];return _0x5dd40f;};'use strict';var multer=require(_0x3d7c('0x0'));var util=require(_0x3d7c('0x1'));var path=require(_0x3d7c('0x2'));var timeout=require(_0x3d7c('0x3'));var express=require(_0x3d7c('0x4'));var router=express[_0x3d7c('0x5')]();var fs_extra=require(_0x3d7c('0x6'));var auth=require(_0x3d7c('0x7'));var interaction=require(_0x3d7c('0x8'));var config=require('../../config/environment');var controller=require(_0x3d7c('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3d7c('0xa')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0xd')]);router[_0x3d7c('0xe')]('/',auth[_0x3d7c('0xc')](),controller[_0x3d7c('0xf')]);router[_0x3d7c('0x10')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0x11')]);router[_0x3d7c('0x12')](_0x3d7c('0xb'),auth[_0x3d7c('0xc')](),controller[_0x3d7c('0x13')]);module[_0x3d7c('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 41e44c9..5583223 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 _0x6de8=['exports'];(function(_0x7eee7,_0x3779a1){var _0x469f62=function(_0x553717){while(--_0x553717){_0x7eee7['push'](_0x7eee7['shift']());}};_0x469f62(++_0x3779a1);}(_0x6de8,0x126));var _0x86de=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0x6de8[_0x289a67];return _0x572b49;};'use strict';var Sequelize=require('sequelize');module[_0x86de('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x59ae=['sequelize','exports'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0x59ae,0x132));var _0xe59a=function(_0x2a2d5c,_0x3c3d36){_0x2a2d5c=_0x2a2d5c-0x0;var _0x45509a=_0x59ae[_0x2a2d5c];return _0x45509a;};'use strict';var Sequelize=require(_0xe59a('0x0'));module[_0xe59a('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index c57a6f0..f7dd23c 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 _0xaa23=['nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','rows','catch','show','params','includeAll','find','body','rimraf','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','reject','save','update','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x21c283,_0x4f748a){var _0x25bc0d=function(_0x293b59){while(--_0x293b59){_0x21c283['push'](_0x21c283['shift']());}};_0x25bc0d(++_0x4f748a);}(_0xaa23,0x165));var _0x3aa2=function(_0x34e46d,_0x5df86a){_0x34e46d=_0x34e46d-0x0;var _0x1cc6aa=_0xaa23[_0x34e46d];return _0x1cc6aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3aa2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3aa2('0x1'));var Mustache=require('mustache');var util=require(_0x3aa2('0x2'));var path=require(_0x3aa2('0x3'));var sox=require(_0x3aa2('0x4'));var csv=require(_0x3aa2('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3aa2('0x6'));var _=require(_0x3aa2('0x7'));var squel=require(_0x3aa2('0x8'));var crypto=require('crypto');var jsforce=require(_0x3aa2('0x9'));var deskjs=require(_0x3aa2('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3aa2('0xb'));var Papa=require(_0x3aa2('0xc'));var Redis=require(_0x3aa2('0xd'));var authService=require(_0x3aa2('0xe'));var qs=require(_0x3aa2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3aa2('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x3aa2('0x11'));var config=require(_0x3aa2('0x12'));var licenseUtil=require(_0x3aa2('0x13'));var db=require(_0x3aa2('0x14'))['db'];function respondWithStatusCode(_0x58da8a,_0x34530d){_0x34530d=_0x34530d||0xcc;return function(_0x9830b3){if(_0x9830b3){return _0x58da8a[_0x3aa2('0x15')](_0x34530d);}return _0x58da8a[_0x3aa2('0x16')](_0x34530d)[_0x3aa2('0x17')]();};}function respondWithResult(_0xb0c8b6,_0x29cf0d){_0x29cf0d=_0x29cf0d||0xc8;return function(_0x2f40f4){if(_0x2f40f4){return _0xb0c8b6[_0x3aa2('0x16')](_0x29cf0d)['json'](_0x2f40f4);}};}function respondWithFilteredResult(_0x483536,_0x372207){return function(_0x43167d){if(_0x43167d){var _0x2ea162=typeof _0x372207[_0x3aa2('0x18')]===_0x3aa2('0x19')&&typeof _0x372207['limit']===_0x3aa2('0x19');var _0x550939=_0x43167d[_0x3aa2('0x1a')];var _0x4c6eae=_0x2ea162?0x0:_0x372207[_0x3aa2('0x18')];var _0x2bba01=_0x2ea162?_0x43167d[_0x3aa2('0x1a')]:_0x372207[_0x3aa2('0x18')]+_0x372207[_0x3aa2('0x1b')];var _0xd2ba6b;if(_0x2bba01>=_0x550939){_0x2bba01=_0x550939;_0xd2ba6b=0xc8;}else{_0xd2ba6b=0xce;}_0x483536[_0x3aa2('0x16')](_0xd2ba6b);return _0x483536['set'](_0x3aa2('0x1c'),_0x4c6eae+'-'+_0x2bba01+'/'+_0x550939)['json'](_0x43167d);}return null;};}function patchUpdates(_0x43a00f){return function(_0x356856){try{jsonpatch['apply'](_0x356856,_0x43a00f,!![]);}catch(_0x3c80ac){return BPromise[_0x3aa2('0x1d')](_0x3c80ac);}return _0x356856[_0x3aa2('0x1e')]();};}function saveUpdates(_0x2ce340,_0x28b1b0){return function(_0x22bb98){if(_0x22bb98){return _0x22bb98[_0x3aa2('0x1f')](_0x2ce340)[_0x3aa2('0x20')](function(_0x98f4b){return _0x98f4b;});}return null;};}function removeEntity(_0x4e3f4a,_0x28b05c){return function(_0x2a9d5d){if(_0x2a9d5d){return _0x2a9d5d['destroy']()[_0x3aa2('0x20')](function(){_0x4e3f4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x351a42,_0x13e3a0){return function(_0x407550){if(!_0x407550){_0x351a42[_0x3aa2('0x15')](0x194);}return _0x407550;};}function handleError(_0x4706f0,_0x25c1f7){_0x25c1f7=_0x25c1f7||0x1f4;return function(_0x85ea51){logger[_0x3aa2('0x21')](_0x85ea51[_0x3aa2('0x22')]);if(_0x85ea51[_0x3aa2('0x23')]){delete _0x85ea51[_0x3aa2('0x23')];}_0x4706f0[_0x3aa2('0x16')](_0x25c1f7)[_0x3aa2('0x24')](_0x85ea51);};}exports[_0x3aa2('0x25')]=function(_0x4b901d,_0x1feb9e){var _0x35c6ce={},_0x161c61={},_0x49d371={'count':0x0,'rows':[]};var _0x357fdc=_['map'](db[_0x3aa2('0x26')][_0x3aa2('0x27')],function(_0x258638){return{'name':_0x258638['fieldName'],'type':_0x258638[_0x3aa2('0x28')][_0x3aa2('0x29')]};});_0x161c61[_0x3aa2('0x2a')]=_[_0x3aa2('0x2b')](_0x357fdc,'name');_0x161c61[_0x3aa2('0x2c')]=_[_0x3aa2('0x2d')](_0x4b901d[_0x3aa2('0x2c')]);_0x161c61['filters']=_['intersection'](_0x161c61[_0x3aa2('0x2a')],_0x161c61[_0x3aa2('0x2c')]);_0x35c6ce[_0x3aa2('0x2e')]=_[_0x3aa2('0x2f')](_0x161c61['model'],qs[_0x3aa2('0x30')](_0x4b901d[_0x3aa2('0x2c')][_0x3aa2('0x30')]));_0x35c6ce['attributes']=_0x35c6ce[_0x3aa2('0x2e')][_0x3aa2('0x31')]?_0x35c6ce[_0x3aa2('0x2e')]:_0x161c61[_0x3aa2('0x2a')];if(!_0x4b901d[_0x3aa2('0x2c')][_0x3aa2('0x32')](_0x3aa2('0x33'))){_0x35c6ce[_0x3aa2('0x1b')]=qs['limit'](_0x4b901d[_0x3aa2('0x2c')]['limit']);_0x35c6ce[_0x3aa2('0x18')]=qs[_0x3aa2('0x18')](_0x4b901d[_0x3aa2('0x2c')][_0x3aa2('0x18')]);}_0x35c6ce[_0x3aa2('0x34')]=qs[_0x3aa2('0x35')](_0x4b901d[_0x3aa2('0x2c')][_0x3aa2('0x35')]);_0x35c6ce[_0x3aa2('0x36')]=qs[_0x3aa2('0x37')](_['pick'](_0x4b901d[_0x3aa2('0x2c')],_0x161c61[_0x3aa2('0x37')]),_0x357fdc);if(_0x4b901d[_0x3aa2('0x2c')][_0x3aa2('0x38')]){_0x35c6ce[_0x3aa2('0x36')]=_['merge'](_0x35c6ce['where'],{'$or':_['map'](_0x357fdc,function(_0x5771e9){if(_0x5771e9[_0x3aa2('0x28')]!==_0x3aa2('0x39')){var _0x104527={};_0x104527[_0x5771e9[_0x3aa2('0x23')]]={'$like':'%'+_0x4b901d[_0x3aa2('0x2c')][_0x3aa2('0x38')]+'%'};return _0x104527;}})});}_0x35c6ce=_[_0x3aa2('0x3a')]({},_0x35c6ce,_0x4b901d[_0x3aa2('0x3b')]);var _0x3b3f6e={'where':_0x35c6ce[_0x3aa2('0x36')]};return db[_0x3aa2('0x26')][_0x3aa2('0x1a')](_0x3b3f6e)['then'](function(_0x55fb27){_0x49d371[_0x3aa2('0x1a')]=_0x55fb27;if(_0x4b901d[_0x3aa2('0x2c')]['includeAll']){_0x35c6ce[_0x3aa2('0x3c')]=[{'all':!![]}];}return db[_0x3aa2('0x26')]['findAll'](_0x35c6ce);})[_0x3aa2('0x20')](function(_0x50786a){_0x49d371[_0x3aa2('0x3d')]=_0x50786a;return _0x49d371;})[_0x3aa2('0x20')](respondWithFilteredResult(_0x1feb9e,_0x35c6ce))[_0x3aa2('0x3e')](handleError(_0x1feb9e,null));};exports[_0x3aa2('0x3f')]=function(_0x5a722b,_0x4c8bf8){var _0x285058={'raw':!![],'where':{'id':_0x5a722b[_0x3aa2('0x40')]['id']}},_0x10f4cf={};_0x10f4cf[_0x3aa2('0x2a')]=_[_0x3aa2('0x2d')](db[_0x3aa2('0x26')][_0x3aa2('0x27')]);_0x10f4cf[_0x3aa2('0x2c')]=_[_0x3aa2('0x2d')](_0x5a722b[_0x3aa2('0x2c')]);_0x10f4cf['filters']=_[_0x3aa2('0x2f')](_0x10f4cf[_0x3aa2('0x2a')],_0x10f4cf[_0x3aa2('0x2c')]);_0x285058['attributes']=_['intersection'](_0x10f4cf[_0x3aa2('0x2a')],qs['fields'](_0x5a722b[_0x3aa2('0x2c')][_0x3aa2('0x30')]));_0x285058[_0x3aa2('0x2e')]=_0x285058[_0x3aa2('0x2e')][_0x3aa2('0x31')]?_0x285058[_0x3aa2('0x2e')]:_0x10f4cf[_0x3aa2('0x2a')];if(_0x5a722b[_0x3aa2('0x2c')][_0x3aa2('0x41')]){_0x285058[_0x3aa2('0x3c')]=[{'all':!![]}];}_0x285058=_['merge']({},_0x285058,_0x5a722b['options']);return db[_0x3aa2('0x26')][_0x3aa2('0x42')](_0x285058)[_0x3aa2('0x20')](handleEntityNotFound(_0x4c8bf8,null))['then'](respondWithResult(_0x4c8bf8,null))['catch'](handleError(_0x4c8bf8,null));};exports['create']=function(_0x1ffcdf,_0x23b5d9){return db['AnalyticTreeReport']['create'](_0x1ffcdf[_0x3aa2('0x43')],{})[_0x3aa2('0x20')](respondWithResult(_0x23b5d9,0xc9))['catch'](handleError(_0x23b5d9,null));};exports[_0x3aa2('0x1f')]=function(_0x430410,_0x3a5e8e){if(_0x430410[_0x3aa2('0x43')]['id']){delete _0x430410[_0x3aa2('0x43')]['id'];}return db[_0x3aa2('0x26')]['find']({'where':{'id':_0x430410[_0x3aa2('0x40')]['id']}})[_0x3aa2('0x20')](handleEntityNotFound(_0x3a5e8e,null))[_0x3aa2('0x20')](saveUpdates(_0x430410[_0x3aa2('0x43')],null))[_0x3aa2('0x20')](respondWithResult(_0x3a5e8e,null))[_0x3aa2('0x3e')](handleError(_0x3a5e8e,null));};exports['destroy']=function(_0x3e91bd,_0x538a05){return db[_0x3aa2('0x26')][_0x3aa2('0x42')]({'where':{'id':_0x3e91bd['params']['id']}})[_0x3aa2('0x20')](handleEntityNotFound(_0x538a05,null))[_0x3aa2('0x20')](removeEntity(_0x538a05,null))[_0x3aa2('0x3e')](handleError(_0x538a05,null));};
\ No newline at end of file
+var _0x1ebf=['body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','sort','pick','where','merge','filter','options','includeAll','catch','params','keys','include','find','create'];(function(_0x402951,_0x49e5e1){var _0x6c8aab=function(_0xfde8ff){while(--_0xfde8ff){_0x402951['push'](_0x402951['shift']());}};_0x6c8aab(++_0x49e5e1);}(_0x1ebf,0x16e));var _0xf1eb=function(_0x342bce,_0x746aa){_0x342bce=_0x342bce-0x0;var _0x53e4f7=_0x1ebf[_0x342bce];return _0x53e4f7;};'use strict';var emlformat=require(_0xf1eb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf1eb('0x1'));var rp=require(_0xf1eb('0x2'));var moment=require(_0xf1eb('0x3'));var BPromise=require(_0xf1eb('0x4'));var Mustache=require(_0xf1eb('0x5'));var util=require(_0xf1eb('0x6'));var path=require(_0xf1eb('0x7'));var sox=require(_0xf1eb('0x8'));var csv=require(_0xf1eb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1eb('0xa'));var squel=require(_0xf1eb('0xb'));var crypto=require(_0xf1eb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf1eb('0xd'));var toCsv=require(_0xf1eb('0x9'));var querystring=require(_0xf1eb('0xe'));var Papa=require(_0xf1eb('0xf'));var Redis=require(_0xf1eb('0x10'));var authService=require(_0xf1eb('0x11'));var qs=require(_0xf1eb('0x12'));var as=require(_0xf1eb('0x13'));var hardwareService=require(_0xf1eb('0x14'));var logger=require(_0xf1eb('0x15'))(_0xf1eb('0x16'));var utils=require(_0xf1eb('0x17'));var config=require(_0xf1eb('0x18'));var licenseUtil=require(_0xf1eb('0x19'));var db=require(_0xf1eb('0x1a'))['db'];function respondWithStatusCode(_0x2aa5cc,_0x5e6f88){_0x5e6f88=_0x5e6f88||0xcc;return function(_0x4f518c){if(_0x4f518c){return _0x2aa5cc[_0xf1eb('0x1b')](_0x5e6f88);}return _0x2aa5cc['status'](_0x5e6f88)[_0xf1eb('0x1c')]();};}function respondWithResult(_0x4bcf89,_0x49d710){_0x49d710=_0x49d710||0xc8;return function(_0x2dd607){if(_0x2dd607){return _0x4bcf89['status'](_0x49d710)[_0xf1eb('0x1d')](_0x2dd607);}};}function respondWithFilteredResult(_0x5e8dd2,_0x41ed68){return function(_0x24bd04){if(_0x24bd04){var _0xd125fa=typeof _0x41ed68[_0xf1eb('0x1e')]===_0xf1eb('0x1f')&&typeof _0x41ed68[_0xf1eb('0x20')]==='undefined';var _0x370606=_0x24bd04[_0xf1eb('0x21')];var _0x232804=_0xd125fa?0x0:_0x41ed68['offset'];var _0x2aa181=_0xd125fa?_0x24bd04['count']:_0x41ed68[_0xf1eb('0x1e')]+_0x41ed68[_0xf1eb('0x20')];var _0x36f869;if(_0x2aa181>=_0x370606){_0x2aa181=_0x370606;_0x36f869=0xc8;}else{_0x36f869=0xce;}_0x5e8dd2[_0xf1eb('0x22')](_0x36f869);return _0x5e8dd2['set'](_0xf1eb('0x23'),_0x232804+'-'+_0x2aa181+'/'+_0x370606)['json'](_0x24bd04);}return null;};}function patchUpdates(_0x4a1edc){return function(_0x163d28){try{jsonpatch[_0xf1eb('0x24')](_0x163d28,_0x4a1edc,!![]);}catch(_0x54e333){return BPromise[_0xf1eb('0x25')](_0x54e333);}return _0x163d28['save']();};}function saveUpdates(_0xd3eca5,_0x3ada40){return function(_0x4b8191){if(_0x4b8191){return _0x4b8191['update'](_0xd3eca5)[_0xf1eb('0x26')](function(_0x5a4bb9){return _0x5a4bb9;});}return null;};}function removeEntity(_0x317c58,_0x1f95fb){return function(_0x2160d8){if(_0x2160d8){return _0x2160d8[_0xf1eb('0x27')]()[_0xf1eb('0x26')](function(){_0x317c58[_0xf1eb('0x22')](0xcc)[_0xf1eb('0x1c')]();});}};}function handleEntityNotFound(_0x26c949,_0x2cc384){return function(_0x4f10e7){if(!_0x4f10e7){_0x26c949[_0xf1eb('0x1b')](0x194);}return _0x4f10e7;};}function handleError(_0x303c84,_0x479a12){_0x479a12=_0x479a12||0x1f4;return function(_0x3b0126){logger[_0xf1eb('0x28')](_0x3b0126[_0xf1eb('0x29')]);if(_0x3b0126[_0xf1eb('0x2a')]){delete _0x3b0126[_0xf1eb('0x2a')];}_0x303c84['status'](_0x479a12)[_0xf1eb('0x2b')](_0x3b0126);};}exports[_0xf1eb('0x2c')]=function(_0x1520da,_0x2c2d20){var _0x416ef6={},_0x3bf7d6={},_0x4ffa0c={'count':0x0,'rows':[]};var _0x4a9f33=_[_0xf1eb('0x2d')](db[_0xf1eb('0x2e')][_0xf1eb('0x2f')],function(_0x491c46){return{'name':_0x491c46[_0xf1eb('0x30')],'type':_0x491c46[_0xf1eb('0x31')][_0xf1eb('0x32')]};});_0x3bf7d6['model']=_[_0xf1eb('0x2d')](_0x4a9f33,_0xf1eb('0x2a'));_0x3bf7d6[_0xf1eb('0x33')]=_['keys'](_0x1520da['query']);_0x3bf7d6[_0xf1eb('0x34')]=_['intersection'](_0x3bf7d6['model'],_0x3bf7d6[_0xf1eb('0x33')]);_0x416ef6[_0xf1eb('0x35')]=_[_0xf1eb('0x36')](_0x3bf7d6[_0xf1eb('0x37')],qs['fields'](_0x1520da[_0xf1eb('0x33')][_0xf1eb('0x38')]));_0x416ef6['attributes']=_0x416ef6[_0xf1eb('0x35')][_0xf1eb('0x39')]?_0x416ef6[_0xf1eb('0x35')]:_0x3bf7d6[_0xf1eb('0x37')];if(!_0x1520da[_0xf1eb('0x33')][_0xf1eb('0x3a')]('nolimit')){_0x416ef6[_0xf1eb('0x20')]=qs[_0xf1eb('0x20')](_0x1520da[_0xf1eb('0x33')]['limit']);_0x416ef6[_0xf1eb('0x1e')]=qs[_0xf1eb('0x1e')](_0x1520da['query'][_0xf1eb('0x1e')]);}_0x416ef6['order']=qs[_0xf1eb('0x3b')](_0x1520da[_0xf1eb('0x33')][_0xf1eb('0x3b')]);_0x416ef6['where']=qs[_0xf1eb('0x34')](_[_0xf1eb('0x3c')](_0x1520da['query'],_0x3bf7d6['filters']),_0x4a9f33);if(_0x1520da[_0xf1eb('0x33')]['filter']){_0x416ef6[_0xf1eb('0x3d')]=_[_0xf1eb('0x3e')](_0x416ef6[_0xf1eb('0x3d')],{'$or':_[_0xf1eb('0x2d')](_0x4a9f33,function(_0x1fe773){if(_0x1fe773[_0xf1eb('0x31')]!=='VIRTUAL'){var _0x40a2cb={};_0x40a2cb[_0x1fe773[_0xf1eb('0x2a')]]={'$like':'%'+_0x1520da[_0xf1eb('0x33')][_0xf1eb('0x3f')]+'%'};return _0x40a2cb;}})});}_0x416ef6=_[_0xf1eb('0x3e')]({},_0x416ef6,_0x1520da[_0xf1eb('0x40')]);var _0x2e4a03={'where':_0x416ef6[_0xf1eb('0x3d')]};return db['AnalyticTreeReport'][_0xf1eb('0x21')](_0x2e4a03)['then'](function(_0x23fc93){_0x4ffa0c[_0xf1eb('0x21')]=_0x23fc93;if(_0x1520da[_0xf1eb('0x33')][_0xf1eb('0x41')]){_0x416ef6['include']=[{'all':!![]}];}return db[_0xf1eb('0x2e')]['findAll'](_0x416ef6);})[_0xf1eb('0x26')](function(_0x3541cf){_0x4ffa0c['rows']=_0x3541cf;return _0x4ffa0c;})[_0xf1eb('0x26')](respondWithFilteredResult(_0x2c2d20,_0x416ef6))[_0xf1eb('0x42')](handleError(_0x2c2d20,null));};exports['show']=function(_0x126cd8,_0x5d40d8){var _0x1d2e36={'raw':!![],'where':{'id':_0x126cd8[_0xf1eb('0x43')]['id']}},_0x40e4ce={};_0x40e4ce['model']=_['keys'](db[_0xf1eb('0x2e')]['rawAttributes']);_0x40e4ce['query']=_[_0xf1eb('0x44')](_0x126cd8['query']);_0x40e4ce[_0xf1eb('0x34')]=_['intersection'](_0x40e4ce['model'],_0x40e4ce[_0xf1eb('0x33')]);_0x1d2e36['attributes']=_[_0xf1eb('0x36')](_0x40e4ce[_0xf1eb('0x37')],qs[_0xf1eb('0x38')](_0x126cd8[_0xf1eb('0x33')][_0xf1eb('0x38')]));_0x1d2e36[_0xf1eb('0x35')]=_0x1d2e36[_0xf1eb('0x35')]['length']?_0x1d2e36[_0xf1eb('0x35')]:_0x40e4ce['model'];if(_0x126cd8['query'][_0xf1eb('0x41')]){_0x1d2e36[_0xf1eb('0x45')]=[{'all':!![]}];}_0x1d2e36=_['merge']({},_0x1d2e36,_0x126cd8[_0xf1eb('0x40')]);return db['AnalyticTreeReport'][_0xf1eb('0x46')](_0x1d2e36)['then'](handleEntityNotFound(_0x5d40d8,null))[_0xf1eb('0x26')](respondWithResult(_0x5d40d8,null))['catch'](handleError(_0x5d40d8,null));};exports[_0xf1eb('0x47')]=function(_0x1eec20,_0x41b19b){return db[_0xf1eb('0x2e')][_0xf1eb('0x47')](_0x1eec20[_0xf1eb('0x48')],{})[_0xf1eb('0x26')](respondWithResult(_0x41b19b,0xc9))[_0xf1eb('0x42')](handleError(_0x41b19b,null));};exports['update']=function(_0x1e822d,_0x399c38){if(_0x1e822d[_0xf1eb('0x48')]['id']){delete _0x1e822d[_0xf1eb('0x48')]['id'];}return db[_0xf1eb('0x2e')][_0xf1eb('0x46')]({'where':{'id':_0x1e822d[_0xf1eb('0x43')]['id']}})[_0xf1eb('0x26')](handleEntityNotFound(_0x399c38,null))['then'](saveUpdates(_0x1e822d[_0xf1eb('0x48')],null))[_0xf1eb('0x26')](respondWithResult(_0x399c38,null))[_0xf1eb('0x42')](handleError(_0x399c38,null));};exports[_0xf1eb('0x27')]=function(_0x568339,_0x2be065){return db[_0xf1eb('0x2e')][_0xf1eb('0x46')]({'where':{'id':_0x568339['params']['id']}})[_0xf1eb('0x26')](handleEntityNotFound(_0x2be065,null))[_0xf1eb('0x26')](removeEntity(_0x2be065,null))[_0xf1eb('0x42')](handleError(_0x2be065,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 63ae6e0..77795d6 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 _0xe7cf=['request-promise','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird'];(function(_0x233f5a,_0x6dc40c){var _0x23531e=function(_0x4bf560){while(--_0x4bf560){_0x233f5a['push'](_0x233f5a['shift']());}};_0x23531e(++_0x6dc40c);}(_0xe7cf,0x13a));var _0xfe7c=function(_0x458ed6,_0x504646){_0x458ed6=_0x458ed6-0x0;var _0xa5dfd9=_0xe7cf[_0x458ed6];return _0xa5dfd9;};'use strict';var _=require('lodash');var util=require(_0xfe7c('0x0'));var logger=require(_0xfe7c('0x1'))(_0xfe7c('0x2'));var moment=require(_0xfe7c('0x3'));var BPromise=require(_0xfe7c('0x4'));var rp=require(_0xfe7c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe7c('0x6'));var config=require('../../config/environment');var attributes=require(_0xfe7c('0x7'));module[_0xfe7c('0x8')]=function(_0x4e7c96,_0x302d5a){return _0x4e7c96[_0xfe7c('0x9')](_0xfe7c('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd78=['moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api'];(function(_0x450178,_0x345f80){var _0x7ccf19=function(_0x50803b){while(--_0x50803b){_0x450178['push'](_0x450178['shift']());}};_0x7ccf19(++_0x345f80);}(_0xfd78,0x165));var _0x8fd7=function(_0x146f34,_0x415049){_0x146f34=_0x146f34-0x0;var _0x3a5a9a=_0xfd78[_0x146f34];return _0x3a5a9a;};'use strict';var _=require(_0x8fd7('0x0'));var util=require('util');var logger=require(_0x8fd7('0x1'))(_0x8fd7('0x2'));var moment=require(_0x8fd7('0x3'));var BPromise=require(_0x8fd7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fd7('0x5'));var rimraf=require(_0x8fd7('0x6'));var config=require(_0x8fd7('0x7'));var attributes=require(_0x8fd7('0x8'));module['exports']=function(_0x5c6d8d,_0x192159){return _0x5c6d8d[_0x8fd7('0x9')](_0x8fd7('0xa'),attributes,{'tableName':_0x8fd7('0xb'),'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 1cd631a..39009cf 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x627a78,_0x1ef671){var _0x59c479=function(_0x12909a){while(--_0x12909a){_0x627a78['push'](_0x627a78['shift']());}};_0x59c479(++_0x1ef671);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2a9cc1,_0x5ce0a6){_0x2a9cc1=_0x2a9cc1-0x0;var _0x3f2a35=_0x5f2f[_0x2a9cc1];return _0x3f2a35;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1c9ee5,_0x1c6e8b){var _0x2edc21=function(_0x5b5ea1){while(--_0x5b5ea1){_0x1c9ee5['push'](_0x1c9ee5['shift']());}};_0x2edc21(++_0x1c6e8b);}(_0x1261,0x144));var _0x1126=function(_0x15f27e,_0x547fea){_0x15f27e=_0x15f27e-0x0;var _0x18da4f=_0x1261[_0x15f27e];return _0x18da4f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index c496715..f1331dc 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 _0x0d8a=['exports','multer','connect-timeout','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','show','put','/:id','delete'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x0d8a,0xf1));var _0xa0d8=function(_0x20ecd8,_0x18dde6){_0x20ecd8=_0x20ecd8-0x0;var _0x5c2824=_0x0d8a[_0x20ecd8];return _0x5c2824;};'use strict';var multer=require(_0xa0d8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa0d8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0d8('0x2'));var controller=require(_0xa0d8('0x3'));router['get']('/',auth[_0xa0d8('0x4')](),controller[_0xa0d8('0x5')]);router[_0xa0d8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xa0d8('0x7')]);router['post']('/',auth[_0xa0d8('0x4')](),controller['create']);router[_0xa0d8('0x8')](_0xa0d8('0x9'),auth[_0xa0d8('0x4')](),controller['update']);router[_0xa0d8('0xa')]('/:id',auth[_0xa0d8('0x4')](),controller['destroy']);module[_0xa0d8('0xb')]=router;
\ No newline at end of file
+var _0xf3d2=['destroy','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x340f49,_0xec45c5){var _0xd5cd44=function(_0x32e242){while(--_0x32e242){_0x340f49['push'](_0x340f49['shift']());}};_0xd5cd44(++_0xec45c5);}(_0xf3d2,0xab));var _0x2f3d=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xf3d2[_0x3e32a8];return _0x2997b0;};'use strict';var multer=require('multer');var util=require(_0x2f3d('0x0'));var path=require(_0x2f3d('0x1'));var timeout=require('connect-timeout');var express=require(_0x2f3d('0x2'));var router=express['Router']();var fs_extra=require(_0x2f3d('0x3'));var auth=require(_0x2f3d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2f3d('0x5'));var controller=require(_0x2f3d('0x6'));router[_0x2f3d('0x7')]('/',auth[_0x2f3d('0x8')](),controller[_0x2f3d('0x9')]);router[_0x2f3d('0x7')](_0x2f3d('0xa'),auth[_0x2f3d('0x8')](),controller[_0x2f3d('0xb')]);router[_0x2f3d('0xc')]('/',auth['isAuthenticated'](),controller[_0x2f3d('0xd')]);router['put'](_0x2f3d('0xa'),auth['isAuthenticated'](),controller[_0x2f3d('0xe')]);router[_0x2f3d('0xf')](_0x2f3d('0xa'),auth['isAuthenticated'](),controller[_0x2f3d('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 573cb2b..bff7e28 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 _0x25b0=['exports','STRING','sequelize'];(function(_0x9553a2,_0x5424d9){var _0x3e398c=function(_0x5e0e68){while(--_0x5e0e68){_0x9553a2['push'](_0x9553a2['shift']());}};_0x3e398c(++_0x5424d9);}(_0x25b0,0x140));var _0x025b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x25b0[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x025b('0x0'));module[_0x025b('0x1')]={'name':{'type':Sequelize[_0x025b('0x2')]},'basename':{'type':Sequelize[_0x025b('0x2')]},'type':{'type':Sequelize[_0x025b('0x2')]}};
\ No newline at end of file
+var _0x238f=['sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x238f,0xa5));var _0xf238=function(_0x6bb392,_0x4bc05e){_0x6bb392=_0x6bb392-0x0;var _0x2cf8e2=_0x238f[_0x6bb392];return _0x2cf8e2;};'use strict';var Sequelize=require(_0xf238('0x0'));module[_0xf238('0x1')]={'name':{'type':Sequelize[_0xf238('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf238('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index c9afb92..d05cbfc 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 _0xa508=['json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','name','send','index','Attachment','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0xa508,0x8f));var _0x8a50=function(_0x2fcf27,_0x2b79ba){_0x2fcf27=_0x2fcf27-0x0;var _0x5f0fb0=_0xa508[_0x2fcf27];return _0x5f0fb0;};'use strict';var emlformat=require(_0x8a50('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a50('0x1'));var jsonpatch=require(_0x8a50('0x2'));var rp=require('request-promise');var moment=require(_0x8a50('0x3'));var BPromise=require(_0x8a50('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8a50('0x5'));var sox=require(_0x8a50('0x6'));var csv=require('to-csv');var ejs=require(_0x8a50('0x7'));var fs=require('fs');var fs_extra=require(_0x8a50('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a50('0x9'));var deskjs=require(_0x8a50('0xa'));var toCsv=require(_0x8a50('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a50('0xc'));var authService=require(_0x8a50('0xd'));var qs=require(_0x8a50('0xe'));var as=require(_0x8a50('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a50('0x10'))(_0x8a50('0x11'));var utils=require(_0x8a50('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a50('0x13'))['db'];function respondWithStatusCode(_0x1a1d33,_0x409050){_0x409050=_0x409050||0xcc;return function(_0x25d377){if(_0x25d377){return _0x1a1d33[_0x8a50('0x14')](_0x409050);}return _0x1a1d33[_0x8a50('0x15')](_0x409050)[_0x8a50('0x16')]();};}function respondWithResult(_0x3daa46,_0x161eb5){_0x161eb5=_0x161eb5||0xc8;return function(_0x171f2f){if(_0x171f2f){return _0x3daa46['status'](_0x161eb5)[_0x8a50('0x17')](_0x171f2f);}};}function respondWithFilteredResult(_0x410341,_0x1c4ee1){return function(_0x45654f){if(_0x45654f){var _0x2ca268=typeof _0x1c4ee1[_0x8a50('0x18')]===_0x8a50('0x19')&&typeof _0x1c4ee1[_0x8a50('0x1a')]===_0x8a50('0x19');var _0xb8d6cd=_0x45654f['count'];var _0x55a70a=_0x2ca268?0x0:_0x1c4ee1[_0x8a50('0x18')];var _0x34ccec=_0x2ca268?_0x45654f[_0x8a50('0x1b')]:_0x1c4ee1[_0x8a50('0x18')]+_0x1c4ee1[_0x8a50('0x1a')];var _0x318fc9;if(_0x34ccec>=_0xb8d6cd){_0x34ccec=_0xb8d6cd;_0x318fc9=0xc8;}else{_0x318fc9=0xce;}_0x410341[_0x8a50('0x15')](_0x318fc9);return _0x410341['set'](_0x8a50('0x1c'),_0x55a70a+'-'+_0x34ccec+'/'+_0xb8d6cd)[_0x8a50('0x17')](_0x45654f);}return null;};}function patchUpdates(_0x1a95ea){return function(_0x19bf97){try{jsonpatch[_0x8a50('0x1d')](_0x19bf97,_0x1a95ea,!![]);}catch(_0x3a0db2){return BPromise['reject'](_0x3a0db2);}return _0x19bf97[_0x8a50('0x1e')]();};}function saveUpdates(_0x28a8bc,_0x5d20f2){return function(_0x1c6139){if(_0x1c6139){return _0x1c6139[_0x8a50('0x1f')](_0x28a8bc)[_0x8a50('0x20')](function(_0x5955e8){return _0x5955e8;});}return null;};}function removeEntity(_0x3d6f82,_0x2ff9e0){return function(_0x1250f9){if(_0x1250f9){return _0x1250f9[_0x8a50('0x21')]()[_0x8a50('0x20')](function(){_0x3d6f82[_0x8a50('0x15')](0xcc)[_0x8a50('0x16')]();});}};}function handleEntityNotFound(_0x251203,_0x7db50b){return function(_0xe5c9ab){if(!_0xe5c9ab){_0x251203[_0x8a50('0x14')](0x194);}return _0xe5c9ab;};}function handleError(_0x5acfe2,_0x33c377){_0x33c377=_0x33c377||0x1f4;return function(_0x409a36){logger['error'](_0x409a36['stack']);if(_0x409a36[_0x8a50('0x22')]){delete _0x409a36[_0x8a50('0x22')];}_0x5acfe2['status'](_0x33c377)[_0x8a50('0x23')](_0x409a36);};}exports[_0x8a50('0x24')]=function(_0x36fe98,_0x1c994e){var _0x292cb6={},_0x2bbdfa={},_0x41d6ec={'count':0x0,'rows':[]};var _0x2a4da4=_['map'](db[_0x8a50('0x25')][_0x8a50('0x26')],function(_0x52a057){return{'name':_0x52a057[_0x8a50('0x27')],'type':_0x52a057[_0x8a50('0x28')][_0x8a50('0x29')]};});_0x2bbdfa['model']=_[_0x8a50('0x2a')](_0x2a4da4,_0x8a50('0x22'));_0x2bbdfa['query']=_['keys'](_0x36fe98[_0x8a50('0x2b')]);_0x2bbdfa['filters']=_[_0x8a50('0x2c')](_0x2bbdfa[_0x8a50('0x2d')],_0x2bbdfa[_0x8a50('0x2b')]);_0x292cb6['attributes']=_[_0x8a50('0x2c')](_0x2bbdfa[_0x8a50('0x2d')],qs['fields'](_0x36fe98['query'][_0x8a50('0x2e')]));_0x292cb6['attributes']=_0x292cb6['attributes'][_0x8a50('0x2f')]?_0x292cb6[_0x8a50('0x30')]:_0x2bbdfa['model'];if(!_0x36fe98['query'][_0x8a50('0x31')]('nolimit')){_0x292cb6[_0x8a50('0x1a')]=qs[_0x8a50('0x1a')](_0x36fe98[_0x8a50('0x2b')][_0x8a50('0x1a')]);_0x292cb6[_0x8a50('0x18')]=qs[_0x8a50('0x18')](_0x36fe98['query']['offset']);}_0x292cb6[_0x8a50('0x32')]=qs['sort'](_0x36fe98[_0x8a50('0x2b')][_0x8a50('0x33')]);_0x292cb6['where']=qs[_0x8a50('0x34')](_[_0x8a50('0x35')](_0x36fe98[_0x8a50('0x2b')],_0x2bbdfa[_0x8a50('0x34')]),_0x2a4da4);if(_0x36fe98[_0x8a50('0x2b')][_0x8a50('0x36')]){_0x292cb6[_0x8a50('0x37')]=_[_0x8a50('0x38')](_0x292cb6[_0x8a50('0x37')],{'$or':_[_0x8a50('0x2a')](_0x2a4da4,function(_0xc68ad2){if(_0xc68ad2[_0x8a50('0x28')]!==_0x8a50('0x39')){var _0x583587={};_0x583587[_0xc68ad2[_0x8a50('0x22')]]={'$like':'%'+_0x36fe98[_0x8a50('0x2b')][_0x8a50('0x36')]+'%'};return _0x583587;}})});}_0x292cb6=_['merge']({},_0x292cb6,_0x36fe98[_0x8a50('0x3a')]);var _0x2eb861={'where':_0x292cb6['where']};return db[_0x8a50('0x25')][_0x8a50('0x1b')](_0x2eb861)[_0x8a50('0x20')](function(_0x15993e){_0x41d6ec[_0x8a50('0x1b')]=_0x15993e;if(_0x36fe98[_0x8a50('0x2b')][_0x8a50('0x3b')]){_0x292cb6[_0x8a50('0x3c')]=[{'all':!![]}];}return db[_0x8a50('0x25')]['findAll'](_0x292cb6);})[_0x8a50('0x20')](function(_0x277d5a){_0x41d6ec[_0x8a50('0x3d')]=_0x277d5a;return _0x41d6ec;})[_0x8a50('0x20')](respondWithFilteredResult(_0x1c994e,_0x292cb6))[_0x8a50('0x3e')](handleError(_0x1c994e,null));};exports[_0x8a50('0x3f')]=function(_0x5919ed,_0x19dc38){var _0x51c066={'raw':!![],'where':{'id':_0x5919ed[_0x8a50('0x40')]['id']}},_0x225378={};_0x225378[_0x8a50('0x2d')]=_[_0x8a50('0x41')](db[_0x8a50('0x25')]['rawAttributes']);_0x225378['query']=_[_0x8a50('0x41')](_0x5919ed[_0x8a50('0x2b')]);_0x225378['filters']=_[_0x8a50('0x2c')](_0x225378[_0x8a50('0x2d')],_0x225378[_0x8a50('0x2b')]);_0x51c066['attributes']=_[_0x8a50('0x2c')](_0x225378[_0x8a50('0x2d')],qs[_0x8a50('0x2e')](_0x5919ed[_0x8a50('0x2b')][_0x8a50('0x2e')]));_0x51c066[_0x8a50('0x30')]=_0x51c066[_0x8a50('0x30')]['length']?_0x51c066[_0x8a50('0x30')]:_0x225378[_0x8a50('0x2d')];if(_0x5919ed[_0x8a50('0x2b')][_0x8a50('0x3b')]){_0x51c066[_0x8a50('0x3c')]=[{'all':!![]}];}_0x51c066=_[_0x8a50('0x38')]({},_0x51c066,_0x5919ed['options']);return db[_0x8a50('0x25')][_0x8a50('0x42')](_0x51c066)['then'](handleEntityNotFound(_0x19dc38,null))[_0x8a50('0x20')](respondWithResult(_0x19dc38,null))[_0x8a50('0x3e')](handleError(_0x19dc38,null));};exports['clone']=function(_0x5f288d,_0x41892c){var _0xe027e6={'where':{'id':_0x5f288d[_0x8a50('0x40')]['id']}},_0xfbd7f6={};_0xfbd7f6['model']=_[_0x8a50('0x41')](db[_0x8a50('0x25')][_0x8a50('0x26')]);_0xe027e6[_0x8a50('0x30')]=_[_0x8a50('0x2c')](_0xfbd7f6[_0x8a50('0x2d')],qs[_0x8a50('0x2e')](_0x5f288d[_0x8a50('0x2b')][_0x8a50('0x2e')]));_0xe027e6[_0x8a50('0x30')]=_0xe027e6[_0x8a50('0x30')][_0x8a50('0x2f')]?_0xe027e6[_0x8a50('0x30')]:_0xfbd7f6['model'];if(_0x5f288d[_0x8a50('0x2b')][_0x8a50('0x3b')]){_0xe027e6[_0x8a50('0x3c')]=[{'all':!![]}];}_0xe027e6=_[_0x8a50('0x38')]({},_0xe027e6,_0x5f288d[_0x8a50('0x3a')]);return db[_0x8a50('0x25')][_0x8a50('0x42')](_0xe027e6)[_0x8a50('0x20')](handleEntityNotFound(_0x41892c,null))[_0x8a50('0x20')](function(_0xede329){if(_0xede329){var _0x780b7b=_0xede329[_0x8a50('0x43')]({'plain':!![]});_0x780b7b=qs[_0x8a50('0x44')](_0x780b7b,['id',_0x8a50('0x45'),_0x8a50('0x46')]);_0x5f288d[_0x8a50('0x47')]=_['omit'](_0x5f288d['body'],['id',_0x8a50('0x45'),'updatedAt']);return db[_0x8a50('0x25')][_0x8a50('0x48')](_[_0x8a50('0x38')](_0x780b7b,_0x5f288d[_0x8a50('0x47')]),{'include':_0x5f288d[_0x8a50('0x2b')][_0x8a50('0x3b')]?[{'all':!![]}]:undefined});}})[_0x8a50('0x20')](respondWithResult(_0x41892c,0xc9))[_0x8a50('0x3e')](handleError(_0x41892c,null));};exports[_0x8a50('0x1f')]=function(_0x330c04,_0x5141ba){if(_0x330c04[_0x8a50('0x47')]['id']){delete _0x330c04['body']['id'];}return db[_0x8a50('0x25')][_0x8a50('0x42')]({'where':{'id':_0x330c04[_0x8a50('0x40')]['id']}})[_0x8a50('0x20')](handleEntityNotFound(_0x5141ba,null))['then'](saveUpdates(_0x330c04[_0x8a50('0x47')],null))['then'](respondWithResult(_0x5141ba,null))[_0x8a50('0x3e')](handleError(_0x5141ba,null));};exports[_0x8a50('0x21')]=function(_0x1f0282,_0x26b084){return db['Attachment'][_0x8a50('0x42')]({'where':{'id':_0x1f0282[_0x8a50('0x40')]['id']}})[_0x8a50('0x20')](handleEntityNotFound(_0x26b084,null))['then'](removeEntity(_0x26b084,null))[_0x8a50('0x3e')](handleError(_0x26b084,null));};exports[_0x8a50('0x48')]=function(_0x5db12b,_0x1c7b5c,_0x3873ea){_0x5db12b[_0x8a50('0x47')][_0x8a50('0x22')]=_0x5db12b[_0x8a50('0x49')][_0x8a50('0x4a')];_0x5db12b[_0x8a50('0x47')][_0x8a50('0x4b')]=_0x5db12b[_0x8a50('0x49')][_0x8a50('0x4c')];_0x5db12b[_0x8a50('0x47')][_0x8a50('0x28')]=_0x5db12b['file']['mimetype'];return db[_0x8a50('0x25')][_0x8a50('0x48')](_0x5db12b[_0x8a50('0x47')])['then'](respondWithResult(_0x1c7b5c,0xc9))[_0x8a50('0x3e')](handleError(_0x1c7b5c,null));};exports['download']=function(_0x241a2c,_0x3b7d23,_0xbe4738){return db[_0x8a50('0x25')][_0x8a50('0x4d')]({'where':{'id':_0x241a2c[_0x8a50('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3b7d23,null))[_0x8a50('0x20')](function(_0x2b21a9){if(_0x2b21a9){var _0x20f3eb=_0x2b21a9[_0x8a50('0x4e')]!==null;var _0x42b730=path[_0x8a50('0x4f')](config[_0x8a50('0x50')],_0x8a50('0x51'));if(_0x20f3eb){_0x42b730=path[_0x8a50('0x4f')](_0x42b730,_0x8a50('0x52'));}var _0x2eb40a=path[_0x8a50('0x4f')](_0x42b730,_0x2b21a9['basename']);return _0x3b7d23['download'](_0x2eb40a);}})[_0x8a50('0x3e')](handleError(_0x3b7d23,null));};
\ No newline at end of file
+var _0xf91a=['stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','clone','get','omit','body','createdAt','updatedAt','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','root','join','offline-chat/','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x466e89,_0x237ae3){var _0x580986=function(_0x1ca46d){while(--_0x1ca46d){_0x466e89['push'](_0x466e89['shift']());}};_0x580986(++_0x237ae3);}(_0xf91a,0x155));var _0xaf91=function(_0x5e63c9,_0x252353){_0x5e63c9=_0x5e63c9-0x0;var _0x38878f=_0xf91a[_0x5e63c9];return _0x38878f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf91('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf91('0x1'));var rp=require(_0xaf91('0x2'));var moment=require(_0xaf91('0x3'));var BPromise=require(_0xaf91('0x4'));var Mustache=require(_0xaf91('0x5'));var util=require(_0xaf91('0x6'));var path=require(_0xaf91('0x7'));var sox=require(_0xaf91('0x8'));var csv=require('to-csv');var ejs=require(_0xaf91('0x9'));var fs=require('fs');var fs_extra=require(_0xaf91('0xa'));var _=require(_0xaf91('0xb'));var squel=require(_0xaf91('0xc'));var crypto=require(_0xaf91('0xd'));var jsforce=require(_0xaf91('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf91('0xf'));var querystring=require(_0xaf91('0x10'));var Papa=require(_0xaf91('0x11'));var Redis=require(_0xaf91('0x12'));var authService=require(_0xaf91('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xaf91('0x14'));var hardwareService=require(_0xaf91('0x15'));var logger=require(_0xaf91('0x16'))(_0xaf91('0x17'));var utils=require(_0xaf91('0x18'));var config=require(_0xaf91('0x19'));var licenseUtil=require(_0xaf91('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42c08e,_0x44bcd7){_0x44bcd7=_0x44bcd7||0xcc;return function(_0x263c54){if(_0x263c54){return _0x42c08e['sendStatus'](_0x44bcd7);}return _0x42c08e[_0xaf91('0x1b')](_0x44bcd7)[_0xaf91('0x1c')]();};}function respondWithResult(_0x2d913d,_0x3af7dc){_0x3af7dc=_0x3af7dc||0xc8;return function(_0x2f4814){if(_0x2f4814){return _0x2d913d[_0xaf91('0x1b')](_0x3af7dc)[_0xaf91('0x1d')](_0x2f4814);}};}function respondWithFilteredResult(_0x28db0d,_0x28a77d){return function(_0x24ce71){if(_0x24ce71){var _0x3270e8=typeof _0x28a77d[_0xaf91('0x1e')]===_0xaf91('0x1f')&&typeof _0x28a77d['limit']===_0xaf91('0x1f');var _0x42d670=_0x24ce71[_0xaf91('0x20')];var _0x4b9a2b=_0x3270e8?0x0:_0x28a77d[_0xaf91('0x1e')];var _0x4411c7=_0x3270e8?_0x24ce71['count']:_0x28a77d[_0xaf91('0x1e')]+_0x28a77d['limit'];var _0x4e758d;if(_0x4411c7>=_0x42d670){_0x4411c7=_0x42d670;_0x4e758d=0xc8;}else{_0x4e758d=0xce;}_0x28db0d[_0xaf91('0x1b')](_0x4e758d);return _0x28db0d[_0xaf91('0x21')](_0xaf91('0x22'),_0x4b9a2b+'-'+_0x4411c7+'/'+_0x42d670)[_0xaf91('0x1d')](_0x24ce71);}return null;};}function patchUpdates(_0x19e28b){return function(_0x4d045b){try{jsonpatch[_0xaf91('0x23')](_0x4d045b,_0x19e28b,!![]);}catch(_0x3a71a2){return BPromise[_0xaf91('0x24')](_0x3a71a2);}return _0x4d045b[_0xaf91('0x25')]();};}function saveUpdates(_0x7d3d41,_0x1f3b93){return function(_0xc55759){if(_0xc55759){return _0xc55759[_0xaf91('0x26')](_0x7d3d41)[_0xaf91('0x27')](function(_0x5163c9){return _0x5163c9;});}return null;};}function removeEntity(_0x4df8fd,_0x2e1904){return function(_0x24337d){if(_0x24337d){return _0x24337d[_0xaf91('0x28')]()[_0xaf91('0x27')](function(){_0x4df8fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b27e8,_0x253528){return function(_0x2a353d){if(!_0x2a353d){_0x2b27e8[_0xaf91('0x29')](0x194);}return _0x2a353d;};}function handleError(_0x5e8de7,_0x3deb43){_0x3deb43=_0x3deb43||0x1f4;return function(_0x40ac7f){logger[_0xaf91('0x2a')](_0x40ac7f[_0xaf91('0x2b')]);if(_0x40ac7f[_0xaf91('0x2c')]){delete _0x40ac7f[_0xaf91('0x2c')];}_0x5e8de7[_0xaf91('0x1b')](_0x3deb43)[_0xaf91('0x2d')](_0x40ac7f);};}exports[_0xaf91('0x2e')]=function(_0x4aff87,_0x1cb6f2){var _0x10e3fb={},_0x45e113={},_0x44e12a={'count':0x0,'rows':[]};var _0x2eba50=_[_0xaf91('0x2f')](db[_0xaf91('0x30')][_0xaf91('0x31')],function(_0x5f4124){return{'name':_0x5f4124[_0xaf91('0x32')],'type':_0x5f4124['type'][_0xaf91('0x33')]};});_0x45e113[_0xaf91('0x34')]=_[_0xaf91('0x2f')](_0x2eba50,_0xaf91('0x2c'));_0x45e113[_0xaf91('0x35')]=_[_0xaf91('0x36')](_0x4aff87['query']);_0x45e113[_0xaf91('0x37')]=_[_0xaf91('0x38')](_0x45e113[_0xaf91('0x34')],_0x45e113[_0xaf91('0x35')]);_0x10e3fb[_0xaf91('0x39')]=_[_0xaf91('0x38')](_0x45e113['model'],qs[_0xaf91('0x3a')](_0x4aff87[_0xaf91('0x35')][_0xaf91('0x3a')]));_0x10e3fb[_0xaf91('0x39')]=_0x10e3fb[_0xaf91('0x39')][_0xaf91('0x3b')]?_0x10e3fb[_0xaf91('0x39')]:_0x45e113['model'];if(!_0x4aff87[_0xaf91('0x35')][_0xaf91('0x3c')](_0xaf91('0x3d'))){_0x10e3fb['limit']=qs[_0xaf91('0x3e')](_0x4aff87[_0xaf91('0x35')]['limit']);_0x10e3fb[_0xaf91('0x1e')]=qs[_0xaf91('0x1e')](_0x4aff87[_0xaf91('0x35')][_0xaf91('0x1e')]);}_0x10e3fb[_0xaf91('0x3f')]=qs[_0xaf91('0x40')](_0x4aff87[_0xaf91('0x35')][_0xaf91('0x40')]);_0x10e3fb[_0xaf91('0x41')]=qs[_0xaf91('0x37')](_[_0xaf91('0x42')](_0x4aff87[_0xaf91('0x35')],_0x45e113[_0xaf91('0x37')]),_0x2eba50);if(_0x4aff87['query'][_0xaf91('0x43')]){_0x10e3fb['where']=_[_0xaf91('0x44')](_0x10e3fb[_0xaf91('0x41')],{'$or':_[_0xaf91('0x2f')](_0x2eba50,function(_0x1130e1){if(_0x1130e1[_0xaf91('0x45')]!=='VIRTUAL'){var _0xf7f705={};_0xf7f705[_0x1130e1[_0xaf91('0x2c')]]={'$like':'%'+_0x4aff87[_0xaf91('0x35')]['filter']+'%'};return _0xf7f705;}})});}_0x10e3fb=_[_0xaf91('0x44')]({},_0x10e3fb,_0x4aff87[_0xaf91('0x46')]);var _0x3dfc78={'where':_0x10e3fb['where']};return db[_0xaf91('0x30')][_0xaf91('0x20')](_0x3dfc78)[_0xaf91('0x27')](function(_0x472ed4){_0x44e12a['count']=_0x472ed4;if(_0x4aff87['query'][_0xaf91('0x47')]){_0x10e3fb[_0xaf91('0x48')]=[{'all':!![]}];}return db[_0xaf91('0x30')][_0xaf91('0x49')](_0x10e3fb);})[_0xaf91('0x27')](function(_0x238d63){_0x44e12a[_0xaf91('0x4a')]=_0x238d63;return _0x44e12a;})[_0xaf91('0x27')](respondWithFilteredResult(_0x1cb6f2,_0x10e3fb))['catch'](handleError(_0x1cb6f2,null));};exports[_0xaf91('0x4b')]=function(_0x4c53b8,_0x160c8e){var _0x33d027={'raw':!![],'where':{'id':_0x4c53b8[_0xaf91('0x4c')]['id']}},_0x28d078={};_0x28d078[_0xaf91('0x34')]=_[_0xaf91('0x36')](db[_0xaf91('0x30')][_0xaf91('0x31')]);_0x28d078[_0xaf91('0x35')]=_[_0xaf91('0x36')](_0x4c53b8['query']);_0x28d078[_0xaf91('0x37')]=_[_0xaf91('0x38')](_0x28d078[_0xaf91('0x34')],_0x28d078['query']);_0x33d027[_0xaf91('0x39')]=_['intersection'](_0x28d078['model'],qs['fields'](_0x4c53b8[_0xaf91('0x35')]['fields']));_0x33d027[_0xaf91('0x39')]=_0x33d027[_0xaf91('0x39')]['length']?_0x33d027[_0xaf91('0x39')]:_0x28d078['model'];if(_0x4c53b8[_0xaf91('0x35')][_0xaf91('0x47')]){_0x33d027[_0xaf91('0x48')]=[{'all':!![]}];}_0x33d027=_['merge']({},_0x33d027,_0x4c53b8[_0xaf91('0x46')]);return db[_0xaf91('0x30')][_0xaf91('0x4d')](_0x33d027)[_0xaf91('0x27')](handleEntityNotFound(_0x160c8e,null))[_0xaf91('0x27')](respondWithResult(_0x160c8e,null))[_0xaf91('0x4e')](handleError(_0x160c8e,null));};exports[_0xaf91('0x4f')]=function(_0x195c66,_0x59babd){var _0x96853f={'where':{'id':_0x195c66[_0xaf91('0x4c')]['id']}},_0x2a502d={};_0x2a502d[_0xaf91('0x34')]=_[_0xaf91('0x36')](db[_0xaf91('0x30')][_0xaf91('0x31')]);_0x96853f[_0xaf91('0x39')]=_[_0xaf91('0x38')](_0x2a502d[_0xaf91('0x34')],qs['fields'](_0x195c66[_0xaf91('0x35')][_0xaf91('0x3a')]));_0x96853f[_0xaf91('0x39')]=_0x96853f['attributes'][_0xaf91('0x3b')]?_0x96853f[_0xaf91('0x39')]:_0x2a502d[_0xaf91('0x34')];if(_0x195c66[_0xaf91('0x35')][_0xaf91('0x47')]){_0x96853f[_0xaf91('0x48')]=[{'all':!![]}];}_0x96853f=_['merge']({},_0x96853f,_0x195c66['options']);return db[_0xaf91('0x30')]['find'](_0x96853f)[_0xaf91('0x27')](handleEntityNotFound(_0x59babd,null))['then'](function(_0x4175df){if(_0x4175df){var _0x3ff74f=_0x4175df[_0xaf91('0x50')]({'plain':!![]});_0x3ff74f=qs[_0xaf91('0x51')](_0x3ff74f,['id','createdAt','updatedAt']);_0x195c66[_0xaf91('0x52')]=_[_0xaf91('0x51')](_0x195c66[_0xaf91('0x52')],['id',_0xaf91('0x53'),_0xaf91('0x54')]);return db[_0xaf91('0x30')][_0xaf91('0x55')](_[_0xaf91('0x44')](_0x3ff74f,_0x195c66[_0xaf91('0x52')]),{'include':_0x195c66[_0xaf91('0x35')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xaf91('0x27')](respondWithResult(_0x59babd,0xc9))[_0xaf91('0x4e')](handleError(_0x59babd,null));};exports[_0xaf91('0x26')]=function(_0x235370,_0x14c4f7){if(_0x235370[_0xaf91('0x52')]['id']){delete _0x235370[_0xaf91('0x52')]['id'];}return db[_0xaf91('0x30')][_0xaf91('0x4d')]({'where':{'id':_0x235370[_0xaf91('0x4c')]['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x14c4f7,null))[_0xaf91('0x27')](saveUpdates(_0x235370[_0xaf91('0x52')],null))[_0xaf91('0x27')](respondWithResult(_0x14c4f7,null))['catch'](handleError(_0x14c4f7,null));};exports[_0xaf91('0x28')]=function(_0x4c3bc8,_0x2ab281){return db[_0xaf91('0x30')][_0xaf91('0x4d')]({'where':{'id':_0x4c3bc8['params']['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x2ab281,null))[_0xaf91('0x27')](removeEntity(_0x2ab281,null))[_0xaf91('0x4e')](handleError(_0x2ab281,null));};exports[_0xaf91('0x55')]=function(_0x4c39a8,_0x2f36c7,_0x13600d){_0x4c39a8[_0xaf91('0x52')][_0xaf91('0x2c')]=_0x4c39a8[_0xaf91('0x56')][_0xaf91('0x57')];_0x4c39a8[_0xaf91('0x52')][_0xaf91('0x58')]=_0x4c39a8['file']['filename'];_0x4c39a8[_0xaf91('0x52')]['type']=_0x4c39a8[_0xaf91('0x56')][_0xaf91('0x59')];return db[_0xaf91('0x30')][_0xaf91('0x55')](_0x4c39a8[_0xaf91('0x52')])[_0xaf91('0x27')](respondWithResult(_0x2f36c7,0xc9))['catch'](handleError(_0x2f36c7,null));};exports[_0xaf91('0x5a')]=function(_0x15f1ae,_0x4c49b2,_0x42d014){return db[_0xaf91('0x30')][_0xaf91('0x5b')]({'where':{'id':_0x15f1ae['params']['id']},'raw':!![]})[_0xaf91('0x27')](handleEntityNotFound(_0x4c49b2,null))[_0xaf91('0x27')](function(_0x7edea6){if(_0x7edea6){var _0x54f632=_0x7edea6[_0xaf91('0x5c')]!==null;var _0xd153d5=path['join'](config[_0xaf91('0x5d')],'server/files/attachments/');if(_0x54f632){_0xd153d5=path[_0xaf91('0x5e')](_0xd153d5,_0xaf91('0x5f'));}var _0x1302fd=path[_0xaf91('0x5e')](_0xd153d5,_0x7edea6[_0xaf91('0x58')]);return _0x4c49b2[_0xaf91('0x5a')](_0x1302fd);}})['catch'](handleError(_0x4c49b2,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a49a097..b316884 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 _0x964b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util'];(function(_0x1ed922,_0x34830d){var _0x282899=function(_0x458b67){while(--_0x458b67){_0x1ed922['push'](_0x1ed922['shift']());}};_0x282899(++_0x34830d);}(_0x964b,0xc2));var _0xb964=function(_0x55d70d,_0x5a40cb){_0x55d70d=_0x55d70d-0x0;var _0x471f38=_0x964b[_0x55d70d];return _0x471f38;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var logger=require('../../config/logger')(_0xb964('0x2'));var moment=require(_0xb964('0x3'));var BPromise=require(_0xb964('0x4'));var rp=require(_0xb964('0x5'));var fs=require('fs');var path=require(_0xb964('0x6'));var rimraf=require(_0xb964('0x7'));var config=require(_0xb964('0x8'));var attributes=require(_0xb964('0x9'));module[_0xb964('0xa')]=function(_0x13c8f8,_0x52b48b){return _0x13c8f8[_0xb964('0xb')](_0xb964('0xc'),attributes,{'tableName':_0xb964('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5094=['../../config/environment','./attachment.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd07e81,_0x1ccacd){var _0x379364=function(_0x8f8eec){while(--_0x8f8eec){_0xd07e81['push'](_0xd07e81['shift']());}};_0x379364(++_0x1ccacd);}(_0x5094,0x1a8));var _0x4509=function(_0x5b1b21,_0x26c3e8){_0x5b1b21=_0x5b1b21-0x0;var _0x4e0d1a=_0x5094[_0x5b1b21];return _0x4e0d1a;};'use strict';var _=require(_0x4509('0x0'));var util=require(_0x4509('0x1'));var logger=require('../../config/logger')(_0x4509('0x2'));var moment=require(_0x4509('0x3'));var BPromise=require(_0x4509('0x4'));var rp=require(_0x4509('0x5'));var fs=require('fs');var path=require(_0x4509('0x6'));var rimraf=require(_0x4509('0x7'));var config=require(_0x4509('0x8'));var attributes=require(_0x4509('0x9'));module[_0x4509('0xa')]=function(_0xbb02c0,_0x407bb8){return _0xbb02c0[_0x4509('0xb')]('Attachment',attributes,{'tableName':'attachments','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 a2dcaa9..e962738 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 _0x559a=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x4ed5e6,_0x366905){var _0x4249f9=function(_0x505fbe){while(--_0x505fbe){_0x4ed5e6['push'](_0x4ed5e6['shift']());}};_0x4249f9(++_0x366905);}(_0x559a,0xb3));var _0xa559=function(_0x31220a,_0x153982){_0x31220a=_0x31220a-0x0;var _0x334907=_0x559a[_0x31220a];return _0x334907;};'use strict';var _=require(_0xa559('0x0'));var util=require(_0xa559('0x1'));var moment=require('moment');var BPromise=require(_0xa559('0x2'));var rs=require(_0xa559('0x3'));var fs=require('fs');var Redis=require(_0xa559('0x4'));var db=require(_0xa559('0x5'))['db'];var utils=require(_0xa559('0x6'));var logger=require(_0xa559('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa559('0x8'));var client=jayson[_0xa559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2edab4,_0x1a5cec,_0x4eada1){return new BPromise(function(_0xb8055,_0x218e3b){return client[_0xa559('0xa')](_0x2edab4,_0x4eada1)[_0xa559('0xb')](function(_0x48aa9a){logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,_0xa559('0xe'));logger[_0xa559('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1a5cec,'request\x20sent',JSON[_0xa559('0x10')](_0x48aa9a));if(_0x48aa9a[_0xa559('0x11')]){if(_0x48aa9a['error'][_0xa559('0x12')]===0x1f4){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a['error'][_0xa559('0x13')]);return _0x218e3b(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a[_0xa559('0x11')]['message']);return _0xb8055(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}else{logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,'request\x20sent');_0xb8055(_0x48aa9a[_0xa559('0x14')]['message']);}})[_0xa559('0x15')](function(_0x1387b6){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x1387b6);_0x218e3b(_0x1387b6);});});}exports[_0xa559('0x16')]=function(_0x163405){var _0xd21ebf=this;return new Promise(function(_0x1a4c42,_0x16f090){return db[_0xa559('0x17')][_0xa559('0x18')](_0x163405[_0xa559('0x19')],{'raw':_0x163405[_0xa559('0x1a')]?_0x163405['options']['raw']===undefined?!![]:![]:!![]})[_0xa559('0xb')](function(_0x3aa532){logger['info'](_0xa559('0x16'),_0x163405);logger[_0xa559('0xf')](_0xa559('0x16'),_0x163405,JSON[_0xa559('0x10')](_0x3aa532));_0x1a4c42(_0x3aa532);})[_0xa559('0x15')](function(_0x2dd8cf){logger['error'](_0xa559('0x16'),_0x2dd8cf['message'],_0x163405);_0x16f090(_0xd21ebf[_0xa559('0x11')](0x1f4,_0x2dd8cf[_0xa559('0x13')]));});});};
\ No newline at end of file
+var _0xde50=['randomstring','ioredis','../../config/utils','rpc','http','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','moment','bluebird'];(function(_0x1b2627,_0x234fbd){var _0x4cb0a4=function(_0x253f71){while(--_0x253f71){_0x1b2627['push'](_0x1b2627['shift']());}};_0x4cb0a4(++_0x234fbd);}(_0xde50,0x140));var _0x0de5=function(_0xdaf978,_0x3772a2){_0xdaf978=_0xdaf978-0x0;var _0x2b15e0=_0xde50[_0xdaf978];return _0x2b15e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0de5('0x0'));var BPromise=require(_0x0de5('0x1'));var rs=require(_0x0de5('0x2'));var fs=require('fs');var Redis=require(_0x0de5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0de5('0x4'));var logger=require('../../config/logger')(_0x0de5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0de5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2714e3,_0x2a5d94,_0x57410e){return new BPromise(function(_0xe3ac44,_0x4d5f0e){return client['request'](_0x2714e3,_0x57410e)['then'](function(_0x396293){logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,'request\x20sent');logger[_0x0de5('0x9')](_0x0de5('0xa'),_0x2a5d94,'request\x20sent',JSON[_0x0de5('0xb')](_0x396293));if(_0x396293[_0x0de5('0xc')]){if(_0x396293[_0x0de5('0xc')]['code']===0x1f4){logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);return _0x4d5f0e(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}logger['error'](_0x0de5('0x8'),_0x2a5d94,_0x396293['error']['message']);return _0xe3ac44(_0x396293[_0x0de5('0xc')][_0x0de5('0xd')]);}else{logger[_0x0de5('0x7')](_0x0de5('0x8'),_0x2a5d94,_0x0de5('0xe'));_0xe3ac44(_0x396293[_0x0de5('0xf')]['message']);}})[_0x0de5('0x10')](function(_0xeb58e1){logger[_0x0de5('0xc')](_0x0de5('0x8'),_0x2a5d94,_0xeb58e1);_0x4d5f0e(_0xeb58e1);});});}exports[_0x0de5('0x11')]=function(_0x2860e8){var _0x58ce66=this;return new Promise(function(_0x21e4b6,_0x48ba4e){return db[_0x0de5('0x12')][_0x0de5('0x13')](_0x2860e8[_0x0de5('0x14')],{'raw':_0x2860e8[_0x0de5('0x15')]?_0x2860e8['options'][_0x0de5('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x2a2abc){logger[_0x0de5('0x7')](_0x0de5('0x11'),_0x2860e8);logger['debug'](_0x0de5('0x11'),_0x2860e8,JSON[_0x0de5('0xb')](_0x2a2abc));_0x21e4b6(_0x2a2abc);})[_0x0de5('0x10')](function(_0x224745){logger['error'](_0x0de5('0x11'),_0x224745['message'],_0x2860e8);_0x48ba4e(_0x58ce66[_0x0de5('0xc')](0x1f4,_0x224745[_0x0de5('0xd')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 087f678..6fd1c71 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x497bf4,_0x1446d6){var _0x2185c0=function(_0x4f79e8){while(--_0x4f79e8){_0x497bf4['push'](_0x497bf4['shift']());}};_0x2185c0(++_0x1446d6);}(_0x5f2f,0x73));var _0xf5f2=function(_0xdeece,_0x9a85f7){_0xdeece=_0xdeece-0x0;var _0x3ee945=_0x5f2f[_0xdeece];return _0x3ee945;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x3bcffb,_0x2317da){var _0x157bad=function(_0x17e9c9){while(--_0x17e9c9){_0x3bcffb['push'](_0x3bcffb['shift']());}};_0x157bad(++_0x2317da);}(_0x5f2f,0x73));var _0xf5f2=function(_0x55b9f2,_0x2cc49a){_0x55b9f2=_0x55b9f2-0x0;var _0x2d8b05=_0x5f2f[_0x55b9f2];return _0x2d8b05;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('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 0e7289b..b72ebd6 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 _0xb76f=['then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','role','blocked','online','admin','blockedAt','minutes','clearBlockUser','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration'];(function(_0x46f571,_0x249aa9){var _0x5b08ae=function(_0x12abb2){while(--_0x12abb2){_0x46f571['push'](_0x46f571['shift']());}};_0x5b08ae(++_0x249aa9);}(_0xb76f,0x94));var _0xfb76=function(_0x3e78df,_0x9be1d5){_0x3e78df=_0x3e78df-0x0;var _0x2db8f8=_0xb76f[_0x3e78df];return _0x2db8f8;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xfb76('0x0'))[_0xfb76('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xfb76('0x2'));var BPromise=require(_0xfb76('0x3'));var util=require('util');var db=require(_0xfb76('0x4'))['db'];var authService=require(_0xfb76('0x5'));var utils=require(_0xfb76('0x6'));var config=require(_0xfb76('0x7'));var logger=require(_0xfb76('0x8'))(_0xfb76('0x9'));function isActiveDirectoryConfigured(_0x5216aa){var _0x2ae776=![];if(typeof _0x5216aa[_0xfb76('0xa')]!==_0xfb76('0xb')){_0x2ae776=_0x5216aa['activedirectory'][_0xfb76('0xc')]&&_0x5216aa[_0xfb76('0xa')][_0xfb76('0xd')]&&_0x5216aa[_0xfb76('0xa')][_0xfb76('0xe')];}return _0x2ae776;}function adAuthenticate(_0x2246c7,_0x53f439,_0x4dfada){return new BPromise(function(_0x4c3f13,_0x333f03){try{var _0x613854=new ActiveDirectory(_0x2246c7);_0x613854[_0xfb76('0xf')](_0x53f439,_0x4dfada,function(_0x3ff56a,_0x2b45bb){if(_0x3ff56a){logger[_0xfb76('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x53f439,util[_0xfb76('0x11')](_0x3ff56a,{'showHidden':![],'depth':null}));_0x333f03(_0xfb76('0x12'));}else if(!_0x2b45bb){logger[_0xfb76('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x53f439);_0x333f03(_0xfb76('0x12'));}else{_0x4c3f13(_0x2b45bb);}});}catch(_0x56cbab){_0x333f03(_0x56cbab);}});}function ActiveDirectoryAuthenticate(_0x104834,_0x2155cd,_0x441e1c,_0x4f249f){var _0x54c7d3,_0x5af4e7;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xfb76('0x13'),_0x2155cd);return _0x4f249f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xfb76('0x14')][_0xfb76('0x15')]({'where':{'id':0x1},'attributes':[_0xfb76('0x16'),_0xfb76('0x17')],'raw':!![]})[_0xfb76('0x18')](function(_0x35b75a){_0x54c7d3=_0x35b75a;if(!_0x54c7d3['adSsoEnabled']){logger[_0xfb76('0x10')](_0xfb76('0x19'),_0x2155cd);throw new Error(_0xfb76('0x12'));}return _0x104834[_0xfb76('0x15')]({'attributes':['id',_0xfb76('0x1a'),'password','salt',_0xfb76('0x1b'),'disabled',_0xfb76('0x1c'),'blockedAt',_0xfb76('0x1d')],'where':{'name':_0x2155cd,'role':{'$or':[_0xfb76('0x1e'),'user','agent']},'adSsoEnabled':!![]}});})[_0xfb76('0x18')](function(_0x349cef){if(!_0x349cef||_0x349cef&&_0x349cef[_0xfb76('0x1a')]!==_0x2155cd){throw new Error(_0xfb76('0x12'));}_0x5af4e7=_0x349cef;var _0x2c47bb=_0x5af4e7[_0xfb76('0x1a')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config['activedirectory'],_0x2c47bb,_0x441e1c);})['then'](function(_0x3e2e93){if(_0x5af4e7['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x54c7d3[_0xfb76('0x17')]>0x0){if(_0x5af4e7['blocked']){if(moment(_0x5af4e7[_0xfb76('0x1f')])['add'](_0x54c7d3['blockDuration'],_0xfb76('0x20'))>moment()){throw new Error(_0xfb76('0x12'));}return utils[_0xfb76('0x21')](_0x5af4e7,0x0,![],null)['then'](function(){return utils[_0xfb76('0x22')](_0x5af4e7);})[_0xfb76('0x18')](function(){return _0x4f249f(null,_0x5af4e7);});}else{return utils[_0xfb76('0x22')](_0x5af4e7)[_0xfb76('0x18')](function(){return _0x4f249f(null,_0x5af4e7);});}}else{return utils[_0xfb76('0x22')](_0x5af4e7)[_0xfb76('0x18')](function(){return _0x4f249f(null,_0x5af4e7);});}})[_0xfb76('0x23')](function(_0x1dbd36){return _0x4f249f(null,![],_0x1dbd36);});}function handleError(_0x7ff865,_0x1977b2,_0x236e46){return _0x7ff865['status'](_0x1977b2||0x1f4)['send']({'message':_0x236e46?_0x236e46[_0xfb76('0x24')]||_0x236e46:''});}exports[_0xfb76('0x25')]=function(_0x2bc520,_0x40ceef,_0x5f2230){passport[_0xfb76('0xf')](_0xfb76('0x26'),function(_0x1c7ad3,_0xab168c,_0x372d75){var _0x2c6bf2=_0x1c7ad3||_0x372d75;if(_0x2c6bf2){return handleError(_0x40ceef,0x191,_0x2c6bf2);}if(!_0xab168c){return handleError(_0x40ceef,0x194,{'message':_0xfb76('0x27')});}else{var _0x2a950f={'payload':{'id':_0xab168c['id'],'role':_0xab168c[_0xfb76('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xfb76('0x28')](_0x2a950f)[_0xfb76('0x18')](function(_0x45ca6d){_0x40ceef['json']({'id':_0xab168c['id'],'token':_0x45ca6d,'statusCall':'','isAlreadyLogged':_0xab168c[_0xfb76('0x1d')]});});}})(_0x2bc520,_0x40ceef,_0x5f2230);};passport[_0xfb76('0x29')](_0xfb76('0x26'),new LocalStrategy({'usernameField':_0xfb76('0x1a'),'passwordField':'password'},function(_0x1f6b2d,_0x452777,_0x151c6d){return ActiveDirectoryAuthenticate(db[_0xfb76('0x2a')],_0x1f6b2d,_0x452777,_0x151c6d);}));
\ No newline at end of file
+var _0x3ae7=['error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','disabled','blocked','blockedAt','online','admin','user','agent','then','name','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','role','signToken','json','use','User','passport','passport-local','Strategy','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','activedirectory','domain','authenticate'];(function(_0x15d3be,_0x5e81f1){var _0x21afca=function(_0x43f32d){while(--_0x43f32d){_0x15d3be['push'](_0x15d3be['shift']());}};_0x21afca(++_0x5e81f1);}(_0x3ae7,0x1e4));var _0x73ae=function(_0x4a8e8,_0x2c6004){_0x4a8e8=_0x4a8e8-0x0;var _0x56528f=_0x3ae7[_0x4a8e8];return _0x56528f;};'use strict';var passport=require(_0x73ae('0x0'));var LocalStrategy=require(_0x73ae('0x1'))[_0x73ae('0x2')];var moment=require(_0x73ae('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x73ae('0x4'));var util=require('util');var db=require(_0x73ae('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x73ae('0x6'));var config=require(_0x73ae('0x7'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0xd95e74){var _0x17784e=![];if(typeof _0xd95e74[_0x73ae('0x8')]!=='undefined'){_0x17784e=_0xd95e74['activedirectory']['baseDN']&&_0xd95e74[_0x73ae('0x8')]['url']&&_0xd95e74[_0x73ae('0x8')][_0x73ae('0x9')];}return _0x17784e;}function adAuthenticate(_0x2931b0,_0x4049ed,_0x335df2){return new BPromise(function(_0x18bd5f,_0xa6f5ca){try{var _0x3b1492=new ActiveDirectory(_0x2931b0);_0x3b1492[_0x73ae('0xa')](_0x4049ed,_0x335df2,function(_0x371dfe,_0x358feb){if(_0x371dfe){logger[_0x73ae('0xb')]('Error\x20authenticate\x20%s:\x20%s',_0x4049ed,util[_0x73ae('0xc')](_0x371dfe,{'showHidden':![],'depth':null}));_0xa6f5ca(_0x73ae('0xd'));}else if(!_0x358feb){logger['error'](_0x73ae('0xe'),_0x4049ed);_0xa6f5ca(_0x73ae('0xd'));}else{_0x18bd5f(_0x358feb);}});}catch(_0xf74ec0){_0xa6f5ca(_0xf74ec0);}});}function ActiveDirectoryAuthenticate(_0x55b327,_0x1ead7c,_0x1cf05c,_0x3ea32a){var _0x32699a,_0x417030;if(!isActiveDirectoryConfigured(config)){logger[_0x73ae('0xb')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x1ead7c);return _0x3ea32a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0x73ae('0xf')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x73ae('0x10')],'raw':!![]})['then'](function(_0x43bd33){_0x32699a=_0x43bd33;if(!_0x32699a[_0x73ae('0x11')]){logger[_0x73ae('0xb')](_0x73ae('0x12'),_0x1ead7c);throw new Error(_0x73ae('0xd'));}return _0x55b327['findOne']({'attributes':['id','name',_0x73ae('0x13'),_0x73ae('0x14'),'role',_0x73ae('0x15'),_0x73ae('0x16'),_0x73ae('0x17'),_0x73ae('0x18')],'where':{'name':_0x1ead7c,'role':{'$or':[_0x73ae('0x19'),_0x73ae('0x1a'),_0x73ae('0x1b')]},'adSsoEnabled':!![]}});})[_0x73ae('0x1c')](function(_0x2ff41c){if(!_0x2ff41c||_0x2ff41c&&_0x2ff41c[_0x73ae('0x1d')]!==_0x1ead7c){throw new Error(_0x73ae('0xd'));}_0x417030=_0x2ff41c;var _0x3b8bee=_0x417030[_0x73ae('0x1d')]+'@'+config[_0x73ae('0x8')][_0x73ae('0x9')];return adAuthenticate(config['activedirectory'],_0x3b8bee,_0x1cf05c);})['then'](function(_0x586380){if(_0x417030['disabled']){throw new Error(_0x73ae('0xd'));}if(_0x32699a[_0x73ae('0x10')]>0x0){if(_0x417030[_0x73ae('0x16')]){if(moment(_0x417030[_0x73ae('0x17')])[_0x73ae('0x1e')](_0x32699a['blockDuration'],_0x73ae('0x1f'))>moment()){throw new Error(_0x73ae('0xd'));}return utils[_0x73ae('0x20')](_0x417030,0x0,![],null)[_0x73ae('0x1c')](function(){return utils[_0x73ae('0x21')](_0x417030);})[_0x73ae('0x1c')](function(){return _0x3ea32a(null,_0x417030);});}else{return utils[_0x73ae('0x21')](_0x417030)[_0x73ae('0x1c')](function(){return _0x3ea32a(null,_0x417030);});}}else{return utils['getLicense'](_0x417030)[_0x73ae('0x1c')](function(){return _0x3ea32a(null,_0x417030);});}})[_0x73ae('0x22')](function(_0x2170ae){return _0x3ea32a(null,![],_0x2170ae);});}function handleError(_0x5687d7,_0x2b276b,_0x1f09e1){return _0x5687d7[_0x73ae('0x23')](_0x2b276b||0x1f4)[_0x73ae('0x24')]({'message':_0x1f09e1?_0x1f09e1[_0x73ae('0x25')]||_0x1f09e1:''});}exports[_0x73ae('0x26')]=function(_0x254a07,_0x3fbb1f,_0x3b0d75){passport[_0x73ae('0xa')](_0x73ae('0x27'),function(_0xcd5b27,_0x5dafcf,_0x1d5170){var _0x537a64=_0xcd5b27||_0x1d5170;if(_0x537a64){return handleError(_0x3fbb1f,0x191,_0x537a64);}if(!_0x5dafcf){return handleError(_0x3fbb1f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x107d75={'payload':{'id':_0x5dafcf['id'],'role':_0x5dafcf[_0x73ae('0x28')]},'options':{'expiresIn':0x15180}};return authService[_0x73ae('0x29')](_0x107d75)[_0x73ae('0x1c')](function(_0xf8ce51){_0x3fbb1f[_0x73ae('0x2a')]({'id':_0x5dafcf['id'],'token':_0xf8ce51,'statusCall':'','isAlreadyLogged':_0x5dafcf[_0x73ae('0x18')]});});}})(_0x254a07,_0x3fbb1f,_0x3b0d75);};passport[_0x73ae('0x2b')](_0x73ae('0x27'),new LocalStrategy({'usernameField':_0x73ae('0x1d'),'passwordField':_0x73ae('0x13')},function(_0x3c0dea,_0x1978e2,_0x14c49e){return ActiveDirectoryAuthenticate(db[_0x73ae('0x2c')],_0x3c0dea,_0x1978e2,_0x14c49e);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index a008a2e..d5a8347 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 _0x73b0=['express','Router','post','login','exports'];(function(_0x490b47,_0x4dc33f){var _0x554703=function(_0x557c3a){while(--_0x557c3a){_0x490b47['push'](_0x490b47['shift']());}};_0x554703(++_0x4dc33f);}(_0x73b0,0xd2));var _0x073b=function(_0x480eb7,_0x2546cf){_0x480eb7=_0x480eb7-0x0;var _0x5aee29=_0x73b0[_0x480eb7];return _0x5aee29;};'use strict';var express=require(_0x073b('0x0'));var router=express[_0x073b('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x073b('0x2')]('/',controller[_0x073b('0x3')]);module[_0x073b('0x4')]=router;
\ No newline at end of file
+var _0x95bb=['exports','express','Router','login'];(function(_0x272e18,_0x75e43c){var _0x572ca9=function(_0xf2b51a){while(--_0xf2b51a){_0x272e18['push'](_0x272e18['shift']());}};_0x572ca9(++_0x75e43c);}(_0x95bb,0x18d));var _0xb95b=function(_0x41a011,_0x23dcef){_0x41a011=_0x41a011-0x0;var _0x3553c8=_0x95bb[_0x41a011];return _0x3553c8;};'use strict';var express=require(_0xb95b('0x0'));var router=express[_0xb95b('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xb95b('0x2')]);module[_0xb95b('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 aabed0a..14e2507 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(_0x1ae639,_0x97624a){var _0x1e472d=function(_0xd04f6f){while(--_0xd04f6f){_0x1ae639['push'](_0x1ae639['shift']());}};_0x1e472d(++_0x97624a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 _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(_0x277f05,_0x5a7774){var _0x52cf27=function(_0x3d4553){while(--_0x3d4553){_0x277f05['push'](_0x277f05['shift']());}};_0x52cf27(++_0x5a7774);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index bb0588c..90dfc31 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 _0xe1e8=['get','login','/callback','callback','isMiddleware','exports','express','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x42afde,_0x377195){var _0x5e9990=function(_0x157ea9){while(--_0x157ea9){_0x42afde['push'](_0x42afde['shift']());}};_0x5e9990(++_0x377195);}(_0xe1e8,0xba));var _0x8e1e=function(_0x352f69,_0xb0cf44){_0x352f69=_0x352f69-0x0;var _0x5d5cfc=_0xe1e8[_0x352f69];return _0x5d5cfc;};'use strict';var express=require(_0x8e1e('0x0'));var passport=require('passport');var router=express[_0x8e1e('0x1')]();var controller=require(_0x8e1e('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x8e1e('0x3'));router[_0x8e1e('0x4')]('/',controller[_0x8e1e('0x5')]);router[_0x8e1e('0x4')](_0x8e1e('0x6'),controller[_0x8e1e('0x7')],authService[_0x8e1e('0x8')],userController[_0x8e1e('0x5')],authService['setTokenCookie']);module[_0x8e1e('0x9')]=router;
\ No newline at end of file
+var _0xecc0=['../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','express','passport','Router'];(function(_0x4ee097,_0x33a051){var _0x120fda=function(_0x52bb87){while(--_0x52bb87){_0x4ee097['push'](_0x4ee097['shift']());}};_0x120fda(++_0x33a051);}(_0xecc0,0x9d));var _0x0ecc=function(_0x2c8735,_0x27684e){_0x2c8735=_0x2c8735-0x0;var _0x416b72=_0xecc0[_0x2c8735];return _0x416b72;};'use strict';var express=require(_0x0ecc('0x0'));var passport=require(_0x0ecc('0x1'));var router=express[_0x0ecc('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x0ecc('0x3'));var authService=require(_0x0ecc('0x4'));router['get']('/',controller[_0x0ecc('0x5')]);router[_0x0ecc('0x6')](_0x0ecc('0x7'),controller[_0x0ecc('0x8')],authService[_0x0ecc('0x9')],userController[_0x0ecc('0x5')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 64b6770..2c95d76 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 _0x00b4=['getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','disabled','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser'];(function(_0x3029ac,_0x6fb135){var _0x221da5=function(_0x3dc293){while(--_0x3dc293){_0x3029ac['push'](_0x3029ac['shift']());}};_0x221da5(++_0x6fb135);}(_0x00b4,0x1c0));var _0x400b=function(_0x17b77e,_0x5dee5d){_0x17b77e=_0x17b77e-0x0;var _0x34d015=_0x00b4[_0x17b77e];return _0x34d015;};'use strict';var util=require(_0x400b('0x0'));var passport=require('passport');var LocalStrategy=require(_0x400b('0x1'))[_0x400b('0x2')];var jayson=require(_0x400b('0x3'));var _=require(_0x400b('0x4'));var rs=require(_0x400b('0x5'));var moment=require('moment');var db=require(_0x400b('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x400b('0x7'));var client=jayson['client'][_0x400b('0x8')]({'port':0x232b});function localAuthenticate(_0x5230d3,_0x451a22,_0x2bee08,_0x5d7d98){var _0x864e89,_0x5381a9;return db[_0x400b('0x9')][_0x400b('0xa')]({'where':{'id':0x1},'attributes':[_0x400b('0xb'),_0x400b('0xc')],'raw':!![]})[_0x400b('0xd')](function(_0x6a9628){_0x864e89=_0x6a9628;return _0x5230d3[_0x400b('0xa')]({'attributes':['id',_0x400b('0xe'),_0x400b('0xf'),'salt','role',_0x400b('0x10'),'blocked',_0x400b('0x11'),_0x400b('0x12')],'where':{'name':_0x451a22,'role':{'$or':['admin',_0x400b('0x13'),_0x400b('0x14')]}}});})[_0x400b('0xd')](function(_0x3171b8){if(!_0x3171b8||_0x3171b8&&_0x3171b8[_0x400b('0xe')]!==_0x451a22){throw new Error(_0x400b('0x15'));}else{_0x5381a9=_0x3171b8;return _0x5381a9;}})['then'](function(){_0x5381a9['authenticate'](_0x2bee08,function(_0x48bba3,_0x1f05c6){var _0x220598=_0x5381a9[_0x400b('0x12')]+0x1;if(_0x48bba3){return _0x5d7d98(_0x48bba3);}else if(!_0x1f05c6){if(_0x5381a9[_0x400b('0x10')]){return _0x5d7d98(null,![],{'message':_0x400b('0x15')});}else if(_0x864e89[_0x400b('0xb')]>0x0){if(_0x5381a9[_0x400b('0x16')]){if(_0x864e89['blockDuration']>0x0){if(moment(_0x5381a9[_0x400b('0x11')])[_0x400b('0x17')](_0x864e89['blockDuration'],_0x400b('0x18'))>moment()){return _0x5d7d98(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x400b('0x19')](_0x5381a9,_0x220598,![],null)['then'](function(){return _0x5d7d98(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5d7d98(null,![],{'message':_0x400b('0x15')});}}else{if(_0x220598>=_0x864e89[_0x400b('0xb')]){return utils[_0x400b('0x19')](_0x5381a9,0x0,!![],moment())[_0x400b('0xd')](function(){return _0x5d7d98(null,![],{'message':_0x400b('0x15')});});}else{return utils[_0x400b('0x19')](_0x5381a9,_0x220598,![],null)[_0x400b('0xd')](function(){return _0x5d7d98(null,![],{'message':_0x400b('0x15')});});}}}else{return _0x5d7d98(null,![],{'message':_0x400b('0x15')});}}else{if(_0x5381a9[_0x400b('0x10')]){return _0x5d7d98(null,![],{'message':_0x400b('0x15')});}else if(_0x864e89[_0x400b('0xb')]>0x0){if(_0x5381a9['blocked']){if(_0x864e89[_0x400b('0xc')]>0x0){if(moment(_0x5381a9[_0x400b('0x11')])[_0x400b('0x17')](_0x864e89['blockDuration'],_0x400b('0x18'))>moment()){return _0x5d7d98(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x400b('0x19')](_0x5381a9,0x0,![],null)[_0x400b('0xd')](function(){return utils[_0x400b('0x1a')](_0x5381a9);})['then'](function(){return _0x5d7d98(null,_0x5381a9);});}}else{return _0x5d7d98(null,![],{'message':_0x400b('0x15')});}}else{return utils['clearBlockUser'](_0x5381a9,0x0,![],null)[_0x400b('0xd')](function(){return utils[_0x400b('0x1a')](_0x5381a9);})['then'](function(){return _0x5d7d98(null,_0x5381a9);})[_0x400b('0x1b')](function(_0x25e1e9){return _0x5d7d98(null,![],_0x25e1e9);});}}else{if(_0x5381a9[_0x400b('0x16')]){return _0x5d7d98(null,![],{'message':_0x400b('0x15')});}else{return utils['getLicense'](_0x5381a9)[_0x400b('0xd')](function(){return _0x5d7d98(null,_0x5381a9);});}}}});})[_0x400b('0x1b')](function(_0x1c5f80){return _0x5d7d98(null,![],_0x1c5f80);});}function sendServiceMail(_0x1b480d){return db[_0x400b('0x1c')][_0x400b('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x400b('0xe'),_0x400b('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x400b('0x1f'),'include':[{'model':db[_0x400b('0x20')],'as':_0x400b('0x20')}]}]})[_0x400b('0xd')](function(_0x480bea){if(!_0x480bea){throw new Error(_0x400b('0x21'));}var _0x387fd4=_0x480bea[_0x400b('0x22')]();var _0x127e2b={'account':_0x387fd4,'message':_[_0x400b('0x23')]({'from':util['format'](_0x400b('0x24'),_0x480bea['name'],_0x480bea[_0x400b('0x1e')]||_0x480bea['Smtp'][_0x400b('0x13')])},_0x1b480d)};return client[_0x400b('0x25')](_0x400b('0x26'),_0x127e2b);})[_0x400b('0xd')](function(_0x29f845){if(_0x29f845[_0x400b('0x27')]){throw new Error(util[_0x400b('0x28')](_0x400b('0x29'),_0x29f845[_0x400b('0x27')]['message']||JSON[_0x400b('0x2a')](_0x29f845[_0x400b('0x27')])));}return!![];});}function handleError(_0x519a,_0x5cc997,_0x2afb7b){return _0x519a['status'](_0x5cc997||0x1f4)[_0x400b('0x2b')]({'message':_0x2afb7b?_0x2afb7b[_0x400b('0x2c')]||_0x2afb7b:''});}exports['login']=function(_0x589e66,_0x3bd829,_0x39ddcb){passport[_0x400b('0x2d')](_0x400b('0x2e'),function(_0x2eb82a,_0x548172,_0x3d1fe2){var _0x5be208=_0x2eb82a||_0x3d1fe2;if(_0x5be208){return handleError(_0x3bd829,0x191,_0x5be208);}if(!_0x548172){return handleError(_0x3bd829,0x194,{'message':_0x400b('0x2f')});}else{var _0x4f064d={'payload':{'id':_0x548172['id'],'role':_0x548172[_0x400b('0x30')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4f064d)[_0x400b('0xd')](function(_0x5d6d92){_0x3bd829[_0x400b('0x31')]({'id':_0x548172['id'],'token':_0x5d6d92,'statusCall':'','isAlreadyLogged':_0x548172[_0x400b('0x32')]});});}})(_0x589e66,_0x3bd829,_0x39ddcb);};exports[_0x400b('0x33')]=function(_0x66857a,_0x4d9863){if(!_0x66857a[_0x400b('0x34')][_0x400b('0x1e')]){return handleError(_0x4d9863,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1cfacf=rs[_0x400b('0x35')]();_0x66857a['body'][_0x400b('0x1e')]=_0x66857a[_0x400b('0x34')][_0x400b('0x1e')][_0x400b('0x36')]()[_0x400b('0x37')]();var _0x31b43f;return db[_0x400b('0x9')][_0x400b('0xa')]({'where':{'id':0x1},'attributes':[_0x400b('0xb'),_0x400b('0xc')],'raw':!![]})[_0x400b('0xd')](function(_0x19cb77){_0x31b43f=_0x19cb77;return db[_0x400b('0x38')][_0x400b('0x1d')]({'where':{'email':_0x66857a['body'][_0x400b('0x1e')]}});})[_0x400b('0xd')](function(_0x5612a1){if(!_0x5612a1){throw new Error(_0x400b('0x39'));}if(_0x5612a1[_0x400b('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5612a1['blocked']){if(moment(_0x5612a1[_0x400b('0x11')])[_0x400b('0x17')](_0x31b43f[_0x400b('0xc')],_0x400b('0x18'))>moment()){throw new Error(_0x400b('0x3a'));}else{_0x5612a1[_0x400b('0x16')]=![];_0x5612a1[_0x400b('0x11')]=null;}}_0x5612a1[_0x400b('0x3b')]=_0x1cfacf;_0x5612a1[_0x400b('0x3c')]=Date[_0x400b('0x3d')]()+0x36ee80;return _0x5612a1['save']();})[_0x400b('0xd')](function(){return sendServiceMail({'to':_0x66857a[_0x400b('0x34')][_0x400b('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x400b('0x3e')+_0x400b('0x3f')+'https://'+_0x66857a['headers'][_0x400b('0x40')]+_0x400b('0x41')+_0x1cfacf+'\x0a\x0a'+_0x400b('0x42')});})[_0x400b('0xd')](function(){_0x4d9863[_0x400b('0x43')](0xc8)[_0x400b('0x2b')]({'message':'Reset\x20Email\x20sent!'});})[_0x400b('0x1b')](function(_0x5efd64){return handleError(_0x4d9863,0x1f4,_0x5efd64);});};exports['reset']=function(_0x4a6bfe,_0x14eb2a){return db['User'][_0x400b('0x1d')]({'where':{'resetPasswordToken':_0x4a6bfe[_0x400b('0x44')][_0x400b('0x45')],'resetPasswordExpires':{'$gt':Date[_0x400b('0x3d')]()}}})[_0x400b('0xd')](function(_0x5067ab){if(!_0x5067ab){throw new Error(_0x400b('0x46'));}return db[_0x400b('0x9')][_0x400b('0xa')]({'attributes':['id',_0x400b('0x47'),_0x400b('0x48'),'passwordHistoryLimit']})[_0x400b('0xd')](function(_0x2b2767){if(_0x2b2767[_0x400b('0x47')])authService['validatePasswordPattern'](_0x4a6bfe['body'][_0x400b('0xf')]);if(!_0x2b2767[_0x400b('0x48')]||!_0x5067ab[_0x400b('0x49')])return _0x5067ab;authService[_0x400b('0x4a')](_0x4a6bfe[_0x400b('0x34')]['password'],_0x5067ab[_0x400b('0x49')],_0x2b2767[_0x400b('0x4b')]);return _0x5067ab;})[_0x400b('0xd')](function(){_0x5067ab[_0x400b('0xf')]=_0x4a6bfe[_0x400b('0x34')]['password'];_0x5067ab[_0x400b('0x3b')]=null;_0x5067ab[_0x400b('0x3c')]=null;return _0x5067ab[_0x400b('0x4c')]();});})[_0x400b('0xd')](function(){_0x14eb2a[_0x400b('0x43')](0xc8)['send']({'message':_0x400b('0x4d')});})[_0x400b('0x1b')](function(_0x3a9e17){return handleError(_0x14eb2a,0x1f4,_0x3a9e17);});};passport[_0x400b('0x4e')](_0x400b('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0x400b('0xf')},function(_0xaf5ae9,_0x41692b,_0x12a063){return localAuthenticate(db[_0x400b('0x38')],_0xaf5ae9,_0x41692b,_0x12a063);}));
\ No newline at end of file
+var _0xa589=['find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','blockDuration','minutes','clearBlockUser','getLicense','catch','MailAccount'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa589,0x17b));var _0x9a58=function(_0x2f4d7f,_0x62f4b7){_0x2f4d7f=_0x2f4d7f-0x0;var _0x147ba1=_0xa589[_0x2f4d7f];return _0x147ba1;};'use strict';var util=require('util');var passport=require(_0x9a58('0x0'));var LocalStrategy=require(_0x9a58('0x1'))[_0x9a58('0x2')];var jayson=require('jayson/promise');var _=require(_0x9a58('0x3'));var rs=require(_0x9a58('0x4'));var moment=require(_0x9a58('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x9a58('0x6'));var utils=require(_0x9a58('0x7'));var client=jayson[_0x9a58('0x8')][_0x9a58('0x9')]({'port':0x232b});function localAuthenticate(_0x4e9096,_0x272ded,_0x35ce11,_0x22c574){var _0x34ce69,_0x12e1f3;return db[_0x9a58('0xa')][_0x9a58('0xb')]({'where':{'id':0x1},'attributes':[_0x9a58('0xc'),'blockDuration'],'raw':!![]})[_0x9a58('0xd')](function(_0xdb8deb){_0x34ce69=_0xdb8deb;return _0x4e9096['findOne']({'attributes':['id',_0x9a58('0xe'),'password','salt','role',_0x9a58('0xf'),_0x9a58('0x10'),_0x9a58('0x11'),_0x9a58('0x12')],'where':{'name':_0x272ded,'role':{'$or':[_0x9a58('0x13'),_0x9a58('0x14'),_0x9a58('0x15')]}}});})[_0x9a58('0xd')](function(_0x3be7d7){if(!_0x3be7d7||_0x3be7d7&&_0x3be7d7['name']!==_0x272ded){throw new Error(_0x9a58('0x16'));}else{_0x12e1f3=_0x3be7d7;return _0x12e1f3;}})[_0x9a58('0xd')](function(){_0x12e1f3[_0x9a58('0x17')](_0x35ce11,function(_0x57ec4d,_0x1f7fe6){var _0x4941ae=_0x12e1f3[_0x9a58('0x12')]+0x1;if(_0x57ec4d){return _0x22c574(_0x57ec4d);}else if(!_0x1f7fe6){if(_0x12e1f3['disabled']){return _0x22c574(null,![],{'message':_0x9a58('0x16')});}else if(_0x34ce69[_0x9a58('0xc')]>0x0){if(_0x12e1f3[_0x9a58('0x10')]){if(_0x34ce69['blockDuration']>0x0){if(moment(_0x12e1f3[_0x9a58('0x11')])[_0x9a58('0x18')](_0x34ce69[_0x9a58('0x19')],_0x9a58('0x1a'))>moment()){return _0x22c574(null,![],{'message':_0x9a58('0x16')});}else{return utils[_0x9a58('0x1b')](_0x12e1f3,_0x4941ae,![],null)[_0x9a58('0xd')](function(){return _0x22c574(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x22c574(null,![],{'message':_0x9a58('0x16')});}}else{if(_0x4941ae>=_0x34ce69[_0x9a58('0xc')]){return utils['clearBlockUser'](_0x12e1f3,0x0,!![],moment())[_0x9a58('0xd')](function(){return _0x22c574(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9a58('0x1b')](_0x12e1f3,_0x4941ae,![],null)[_0x9a58('0xd')](function(){return _0x22c574(null,![],{'message':_0x9a58('0x16')});});}}}else{return _0x22c574(null,![],{'message':_0x9a58('0x16')});}}else{if(_0x12e1f3[_0x9a58('0xf')]){return _0x22c574(null,![],{'message':_0x9a58('0x16')});}else if(_0x34ce69['allowedLoginAttempts']>0x0){if(_0x12e1f3[_0x9a58('0x10')]){if(_0x34ce69[_0x9a58('0x19')]>0x0){if(moment(_0x12e1f3[_0x9a58('0x11')])['add'](_0x34ce69[_0x9a58('0x19')],'minutes')>moment()){return _0x22c574(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x12e1f3,0x0,![],null)['then'](function(){return utils['getLicense'](_0x12e1f3);})[_0x9a58('0xd')](function(){return _0x22c574(null,_0x12e1f3);});}}else{return _0x22c574(null,![],{'message':_0x9a58('0x16')});}}else{return utils[_0x9a58('0x1b')](_0x12e1f3,0x0,![],null)[_0x9a58('0xd')](function(){return utils['getLicense'](_0x12e1f3);})['then'](function(){return _0x22c574(null,_0x12e1f3);})['catch'](function(_0x1db40a){return _0x22c574(null,![],_0x1db40a);});}}else{if(_0x12e1f3[_0x9a58('0x10')]){return _0x22c574(null,![],{'message':_0x9a58('0x16')});}else{return utils[_0x9a58('0x1c')](_0x12e1f3)[_0x9a58('0xd')](function(){return _0x22c574(null,_0x12e1f3);});}}}});})[_0x9a58('0x1d')](function(_0x1a7faf){return _0x22c574(null,![],_0x1a7faf);});}function sendServiceMail(_0x4b9293){return db[_0x9a58('0x1e')][_0x9a58('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x9a58('0xe'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x9a58('0x20'),'include':[{'model':db[_0x9a58('0x21')],'as':'CloudProvider'}]}]})[_0x9a58('0xd')](function(_0xa75e7b){if(!_0xa75e7b){throw new Error(_0x9a58('0x22'));}var _0x3ffdbc=_0xa75e7b[_0x9a58('0x23')]();var _0x33701c={'account':_0x3ffdbc,'message':_[_0x9a58('0x24')]({'from':util[_0x9a58('0x25')](_0x9a58('0x26'),_0xa75e7b['name'],_0xa75e7b[_0x9a58('0x27')]||_0xa75e7b[_0x9a58('0x20')][_0x9a58('0x14')])},_0x4b9293)};return client[_0x9a58('0x28')](_0x9a58('0x29'),_0x33701c);})[_0x9a58('0xd')](function(_0x13200e){if(_0x13200e[_0x9a58('0x2a')]){throw new Error(util[_0x9a58('0x25')](_0x9a58('0x2b'),_0x13200e[_0x9a58('0x2a')][_0x9a58('0x2c')]||JSON[_0x9a58('0x2d')](_0x13200e[_0x9a58('0x2a')])));}return!![];});}function handleError(_0x50ab64,_0x3329aa,_0xbef655){return _0x50ab64[_0x9a58('0x2e')](_0x3329aa||0x1f4)[_0x9a58('0x2f')]({'message':_0xbef655?_0xbef655[_0x9a58('0x2c')]||_0xbef655:''});}exports[_0x9a58('0x30')]=function(_0x5885de,_0x34e472,_0x4909ba){passport[_0x9a58('0x17')](_0x9a58('0x31'),function(_0x3673b3,_0x375b74,_0x1a3578){var _0x3c4207=_0x3673b3||_0x1a3578;if(_0x3c4207){return handleError(_0x34e472,0x191,_0x3c4207);}if(!_0x375b74){return handleError(_0x34e472,0x194,{'message':_0x9a58('0x32')});}else{var _0x37e4bc={'payload':{'id':_0x375b74['id'],'role':_0x375b74['role']},'options':{'expiresIn':0x15180}};return authService[_0x9a58('0x33')](_0x37e4bc)[_0x9a58('0xd')](function(_0x18b789){_0x34e472[_0x9a58('0x34')]({'id':_0x375b74['id'],'token':_0x18b789,'statusCall':'','isAlreadyLogged':_0x375b74[_0x9a58('0x35')]});});}})(_0x5885de,_0x34e472,_0x4909ba);};exports['forgot']=function(_0x3129fe,_0x278f93){if(!_0x3129fe[_0x9a58('0x36')]['email']){return handleError(_0x278f93,0x1f4,{'message':_0x9a58('0x37')});}var _0x448c37=rs['generate']();_0x3129fe[_0x9a58('0x36')][_0x9a58('0x27')]=_0x3129fe['body'][_0x9a58('0x27')][_0x9a58('0x38')]()['toLowerCase']();var _0x75ea72;return db[_0x9a58('0xa')][_0x9a58('0xb')]({'where':{'id':0x1},'attributes':[_0x9a58('0xc'),_0x9a58('0x19')],'raw':!![]})['then'](function(_0x3504c8){_0x75ea72=_0x3504c8;return db[_0x9a58('0x39')]['find']({'where':{'email':_0x3129fe[_0x9a58('0x36')][_0x9a58('0x27')]}});})[_0x9a58('0xd')](function(_0x3a9a58){if(!_0x3a9a58){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3a9a58[_0x9a58('0xf')]){throw new Error(_0x9a58('0x3a'));}if(_0x3a9a58['blocked']){if(moment(_0x3a9a58[_0x9a58('0x11')])[_0x9a58('0x18')](_0x75ea72[_0x9a58('0x19')],'minutes')>moment()){throw new Error(_0x9a58('0x3b'));}else{_0x3a9a58['blocked']=![];_0x3a9a58['blockedAt']=null;}}_0x3a9a58[_0x9a58('0x3c')]=_0x448c37;_0x3a9a58[_0x9a58('0x3d')]=Date[_0x9a58('0x3e')]()+0x36ee80;return _0x3a9a58['save']();})[_0x9a58('0xd')](function(){return sendServiceMail({'to':_0x3129fe[_0x9a58('0x36')][_0x9a58('0x27')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x9a58('0x3f')+_0x9a58('0x40')+_0x9a58('0x41')+_0x3129fe['headers'][_0x9a58('0x42')]+_0x9a58('0x43')+_0x448c37+'\x0a\x0a'+_0x9a58('0x44')});})[_0x9a58('0xd')](function(){_0x278f93[_0x9a58('0x2e')](0xc8)[_0x9a58('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0x9a58('0x1d')](function(_0x24e695){return handleError(_0x278f93,0x1f4,_0x24e695);});};exports[_0x9a58('0x45')]=function(_0x161a01,_0x169c38){return db['User'][_0x9a58('0x1f')]({'where':{'resetPasswordToken':_0x161a01[_0x9a58('0x46')][_0x9a58('0x47')],'resetPasswordExpires':{'$gt':Date[_0x9a58('0x3e')]()}}})[_0x9a58('0xd')](function(_0x2f3e89){if(!_0x2f3e89){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x9a58('0xa')][_0x9a58('0xb')]({'attributes':['id','securePassword',_0x9a58('0x48'),_0x9a58('0x49')]})[_0x9a58('0xd')](function(_0x45475f){if(_0x45475f[_0x9a58('0x4a')])authService[_0x9a58('0x4b')](_0x161a01[_0x9a58('0x36')][_0x9a58('0x4c')]);if(!_0x45475f[_0x9a58('0x48')]||!_0x2f3e89[_0x9a58('0x4d')])return _0x2f3e89;authService[_0x9a58('0x4e')](_0x161a01[_0x9a58('0x36')][_0x9a58('0x4c')],_0x2f3e89['previousPasswords'],_0x45475f[_0x9a58('0x49')]);return _0x2f3e89;})['then'](function(){_0x2f3e89[_0x9a58('0x4c')]=_0x161a01['body'][_0x9a58('0x4c')];_0x2f3e89[_0x9a58('0x3c')]=null;_0x2f3e89['resetPasswordExpires']=null;return _0x2f3e89[_0x9a58('0x4f')]();});})[_0x9a58('0xd')](function(){_0x169c38[_0x9a58('0x2e')](0xc8)[_0x9a58('0x2f')]({'message':_0x9a58('0x50')});})[_0x9a58('0x1d')](function(_0x41914c){return handleError(_0x169c38,0x1f4,_0x41914c);});};passport[_0x9a58('0x51')](_0x9a58('0x31'),new LocalStrategy({'usernameField':_0x9a58('0xe'),'passwordField':_0x9a58('0x4c')},function(_0x4ad1fb,_0x37061b,_0x20739d){return localAuthenticate(db['User'],_0x4ad1fb,_0x37061b,_0x20739d);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index f696677..e16c90c 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 _0x7deb=['/reset/:token','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0x2c8350,_0x5126ed){var _0x4d5530=function(_0x42b164){while(--_0x42b164){_0x2c8350['push'](_0x2c8350['shift']());}};_0x4d5530(++_0x5126ed);}(_0x7deb,0xca));var _0xb7de=function(_0x3da707,_0x30c36d){_0x3da707=_0x3da707-0x0;var _0x342ee7=_0x7deb[_0x3da707];return _0x342ee7;};'use strict';var express=require(_0xb7de('0x0'));var router=express[_0xb7de('0x1')]();var controller=require(_0xb7de('0x2'));router[_0xb7de('0x3')]('/',controller[_0xb7de('0x4')]);router['post']('/forgot',controller[_0xb7de('0x5')]);router[_0xb7de('0x3')](_0xb7de('0x6'),controller['reset']);module[_0xb7de('0x7')]=router;
\ No newline at end of file
+var _0xff03=['forgot','reset','exports','Router','./authLocal.controller','post','login','/forgot'];(function(_0x3fe497,_0x5f299f){var _0x46f039=function(_0x188a69){while(--_0x188a69){_0x3fe497['push'](_0x3fe497['shift']());}};_0x46f039(++_0x5f299f);}(_0xff03,0xcb));var _0x3ff0=function(_0x5420c8,_0x56915d){_0x5420c8=_0x5420c8-0x0;var _0x5068ba=_0xff03[_0x5420c8];return _0x5068ba;};'use strict';var express=require('express');var router=express[_0x3ff0('0x0')]();var controller=require(_0x3ff0('0x1'));router[_0x3ff0('0x2')]('/',controller[_0x3ff0('0x3')]);router['post'](_0x3ff0('0x4'),controller[_0x3ff0('0x5')]);router['post']('/reset/:token',controller[_0x3ff0('0x6')]);module[_0x3ff0('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 8989bfc..64e3d82 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 _0xef4b=['sequelize','exports','STRING','INTEGER'];(function(_0x2ff1e1,_0x1f5d39){var _0xcdae4f=function(_0x3781b2){while(--_0x3781b2){_0x2ff1e1['push'](_0x2ff1e1['shift']());}};_0xcdae4f(++_0x1f5d39);}(_0xef4b,0xc8));var _0xbef4=function(_0x1808b2,_0x35f5a6){_0x1808b2=_0x1808b2-0x0;var _0x498147=_0xef4b[_0x1808b2];return _0x498147;};'use strict';var Sequelize=require(_0xbef4('0x0'));module[_0xbef4('0x1')]={'name':{'type':Sequelize[_0xbef4('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xbef4('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbef4('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5926=['sequelize','STRING','BOOLEAN'];(function(_0x3e01b8,_0x2e5717){var _0x5d4fdf=function(_0x21b4f5){while(--_0x21b4f5){_0x3e01b8['push'](_0x3e01b8['shift']());}};_0x5d4fdf(++_0x2e5717);}(_0x5926,0x90));var _0x6592=function(_0x57ad0b,_0x5aa20e){_0x57ad0b=_0x57ad0b-0x0;var _0x31ee65=_0x5926[_0x57ad0b];return _0x31ee65;};'use strict';var Sequelize=require(_0x6592('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x6592('0x1')]},'description':{'type':Sequelize[_0x6592('0x1')]},'status':{'type':Sequelize[_0x6592('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 d970b0a..d828280 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 _0xf341=['map','Automation','rawAttributes','fieldName','type','key','model','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','query','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','intersection','find','catch','create','body','Condition','ids','omit','findOne','getConditions','Action','addActions','getActions','eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','name','send','index'];(function(_0x389d85,_0x2a7b2d){var _0x2e39cb=function(_0x3b7eab){while(--_0x3b7eab){_0x389d85['push'](_0x389d85['shift']());}};_0x2e39cb(++_0x2a7b2d);}(_0xf341,0xcb));var _0x1f34=function(_0x57df09,_0x2ae59f){_0x57df09=_0x57df09-0x0;var _0x59dbf0=_0xf341[_0x57df09];return _0x59dbf0;};'use strict';var emlformat=require(_0x1f34('0x0'));var rimraf=require(_0x1f34('0x1'));var zipdir=require(_0x1f34('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1f34('0x3'));var util=require(_0x1f34('0x4'));var path=require(_0x1f34('0x5'));var sox=require(_0x1f34('0x6'));var csv=require(_0x1f34('0x7'));var ejs=require(_0x1f34('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f34('0x9'));var squel=require(_0x1f34('0xa'));var crypto=require(_0x1f34('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1f34('0xc'));var toCsv=require(_0x1f34('0x7'));var querystring=require(_0x1f34('0xd'));var Papa=require(_0x1f34('0xe'));var Redis=require(_0x1f34('0xf'));var authService=require(_0x1f34('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f34('0x11'));var logger=require(_0x1f34('0x12'))(_0x1f34('0x13'));var utils=require('../../config/utils');var config=require(_0x1f34('0x14'));var licenseUtil=require(_0x1f34('0x15'));var db=require(_0x1f34('0x16'))['db'];function respondWithStatusCode(_0x46b7e3,_0x932767){_0x932767=_0x932767||0xcc;return function(_0x564c85){if(_0x564c85){return _0x46b7e3[_0x1f34('0x17')](_0x932767);}return _0x46b7e3[_0x1f34('0x18')](_0x932767)['end']();};}function respondWithResult(_0x121242,_0x258f8a){_0x258f8a=_0x258f8a||0xc8;return function(_0x3d4179){if(_0x3d4179){return _0x121242[_0x1f34('0x18')](_0x258f8a)[_0x1f34('0x19')](_0x3d4179);}};}function respondWithFilteredResult(_0x18292a,_0x13265a){return function(_0x3527db){if(_0x3527db){var _0x4910a1=typeof _0x13265a[_0x1f34('0x1a')]===_0x1f34('0x1b')&&typeof _0x13265a[_0x1f34('0x1c')]===_0x1f34('0x1b');var _0x3278ff=_0x3527db[_0x1f34('0x1d')];var _0x18ee1a=_0x4910a1?0x0:_0x13265a['offset'];var _0x545db9=_0x4910a1?_0x3527db[_0x1f34('0x1d')]:_0x13265a[_0x1f34('0x1a')]+_0x13265a['limit'];var _0x4d48b5;if(_0x545db9>=_0x3278ff){_0x545db9=_0x3278ff;_0x4d48b5=0xc8;}else{_0x4d48b5=0xce;}_0x18292a['status'](_0x4d48b5);return _0x18292a['set'](_0x1f34('0x1e'),_0x18ee1a+'-'+_0x545db9+'/'+_0x3278ff)[_0x1f34('0x19')](_0x3527db);}return null;};}function patchUpdates(_0x1a5ce7){return function(_0x26a633){try{jsonpatch['apply'](_0x26a633,_0x1a5ce7,!![]);}catch(_0x396849){return BPromise[_0x1f34('0x1f')](_0x396849);}return _0x26a633[_0x1f34('0x20')]();};}function saveUpdates(_0x35a99f,_0x2542a3){return function(_0x32a76f){if(_0x32a76f){return _0x32a76f[_0x1f34('0x21')](_0x35a99f)['then'](function(_0x19bbaf){return _0x19bbaf;});}return null;};}function removeEntity(_0x28e439,_0x294da7){return function(_0x49ec9e){if(_0x49ec9e){return _0x49ec9e[_0x1f34('0x22')]()[_0x1f34('0x23')](function(){_0x28e439['status'](0xcc)[_0x1f34('0x24')]();});}};}function handleEntityNotFound(_0x51478a,_0x303c65){return function(_0x5e978b){if(!_0x5e978b){_0x51478a[_0x1f34('0x17')](0x194);}return _0x5e978b;};}function handleError(_0x47c0bf,_0x4519a8){_0x4519a8=_0x4519a8||0x1f4;return function(_0x491667){logger['error'](_0x491667['stack']);if(_0x491667[_0x1f34('0x25')]){delete _0x491667[_0x1f34('0x25')];}_0x47c0bf[_0x1f34('0x18')](_0x4519a8)[_0x1f34('0x26')](_0x491667);};}exports[_0x1f34('0x27')]=function(_0x29e9fd,_0x329ef2){var _0x1e2dc7={},_0x561638={},_0x411e4a={'count':0x0,'rows':[]};var _0x1a9dda=_[_0x1f34('0x28')](db[_0x1f34('0x29')][_0x1f34('0x2a')],function(_0x1e70e4){return{'name':_0x1e70e4[_0x1f34('0x2b')],'type':_0x1e70e4[_0x1f34('0x2c')][_0x1f34('0x2d')]};});_0x561638[_0x1f34('0x2e')]=_[_0x1f34('0x28')](_0x1a9dda,_0x1f34('0x25'));_0x561638['query']=_[_0x1f34('0x2f')](_0x29e9fd['query']);_0x561638[_0x1f34('0x30')]=_['intersection'](_0x561638[_0x1f34('0x2e')],_0x561638['query']);_0x1e2dc7['attributes']=_['intersection'](_0x561638[_0x1f34('0x2e')],qs[_0x1f34('0x31')](_0x29e9fd['query']['fields']));_0x1e2dc7[_0x1f34('0x32')]=_0x1e2dc7[_0x1f34('0x32')][_0x1f34('0x33')]?_0x1e2dc7[_0x1f34('0x32')]:_0x561638['model'];if(!_0x29e9fd['query'][_0x1f34('0x34')](_0x1f34('0x35'))){_0x1e2dc7[_0x1f34('0x1c')]=qs[_0x1f34('0x1c')](_0x29e9fd['query'][_0x1f34('0x1c')]);_0x1e2dc7[_0x1f34('0x1a')]=qs[_0x1f34('0x1a')](_0x29e9fd[_0x1f34('0x36')][_0x1f34('0x1a')]);}_0x1e2dc7[_0x1f34('0x37')]=qs[_0x1f34('0x38')](_0x29e9fd[_0x1f34('0x36')][_0x1f34('0x38')]);_0x1e2dc7[_0x1f34('0x39')]=qs[_0x1f34('0x30')](_[_0x1f34('0x3a')](_0x29e9fd[_0x1f34('0x36')],_0x561638[_0x1f34('0x30')]),_0x1a9dda);if(_0x29e9fd[_0x1f34('0x36')]['filter']){_0x1e2dc7[_0x1f34('0x39')]=_[_0x1f34('0x3b')](_0x1e2dc7['where'],{'$or':_[_0x1f34('0x28')](_0x1a9dda,function(_0x3c3249){if(_0x3c3249[_0x1f34('0x2c')]!==_0x1f34('0x3c')){var _0x346225={};_0x346225[_0x3c3249[_0x1f34('0x25')]]={'$like':'%'+_0x29e9fd[_0x1f34('0x36')][_0x1f34('0x3d')]+'%'};return _0x346225;}})});}_0x1e2dc7=_[_0x1f34('0x3b')]({},_0x1e2dc7,_0x29e9fd[_0x1f34('0x3e')]);var _0x4771c1={'where':_0x1e2dc7[_0x1f34('0x39')]};return db['Automation'][_0x1f34('0x1d')](_0x4771c1)[_0x1f34('0x23')](function(_0x57b1f7){_0x411e4a[_0x1f34('0x1d')]=_0x57b1f7;if(_0x29e9fd[_0x1f34('0x36')][_0x1f34('0x3f')]){_0x1e2dc7[_0x1f34('0x40')]=[{'all':!![]}];}return db[_0x1f34('0x29')][_0x1f34('0x41')](_0x1e2dc7);})[_0x1f34('0x23')](function(_0x1e3e29){_0x411e4a['rows']=_0x1e3e29;return _0x411e4a;})['then'](respondWithFilteredResult(_0x329ef2,_0x1e2dc7))['catch'](handleError(_0x329ef2,null));};exports[_0x1f34('0x42')]=function(_0x47ffe8,_0x42aa5c){var _0x217f4f={'raw':![],'where':{'id':_0x47ffe8[_0x1f34('0x43')]['id']}},_0x430cee={};_0x430cee[_0x1f34('0x2e')]=_[_0x1f34('0x2f')](db[_0x1f34('0x29')][_0x1f34('0x2a')]);_0x430cee['query']=_[_0x1f34('0x2f')](_0x47ffe8[_0x1f34('0x36')]);_0x430cee[_0x1f34('0x30')]=_[_0x1f34('0x44')](_0x430cee['model'],_0x430cee['query']);_0x217f4f[_0x1f34('0x32')]=_[_0x1f34('0x44')](_0x430cee[_0x1f34('0x2e')],qs['fields'](_0x47ffe8['query'][_0x1f34('0x31')]));_0x217f4f[_0x1f34('0x32')]=_0x217f4f[_0x1f34('0x32')][_0x1f34('0x33')]?_0x217f4f['attributes']:_0x430cee['model'];if(_0x47ffe8[_0x1f34('0x36')][_0x1f34('0x3f')]){_0x217f4f[_0x1f34('0x40')]=[{'all':!![]}];}_0x217f4f=_[_0x1f34('0x3b')]({},_0x217f4f,_0x47ffe8[_0x1f34('0x3e')]);return db['Automation'][_0x1f34('0x45')](_0x217f4f)['then'](handleEntityNotFound(_0x42aa5c,null))[_0x1f34('0x23')](respondWithResult(_0x42aa5c,null))[_0x1f34('0x46')](handleError(_0x42aa5c,null));};exports[_0x1f34('0x47')]=function(_0x3c43a3,_0x5f0b05){return db[_0x1f34('0x29')]['create'](_0x3c43a3[_0x1f34('0x48')],{})['then'](respondWithResult(_0x5f0b05,0xc9))[_0x1f34('0x46')](handleError(_0x5f0b05,null));};exports[_0x1f34('0x21')]=function(_0x21e2b0,_0x2ff51d){if(_0x21e2b0[_0x1f34('0x48')]['id']){delete _0x21e2b0[_0x1f34('0x48')]['id'];}return db[_0x1f34('0x29')][_0x1f34('0x45')]({'where':{'id':_0x21e2b0['params']['id']}})[_0x1f34('0x23')](handleEntityNotFound(_0x2ff51d,null))[_0x1f34('0x23')](saveUpdates(_0x21e2b0['body'],null))[_0x1f34('0x23')](respondWithResult(_0x2ff51d,null))[_0x1f34('0x46')](handleError(_0x2ff51d,null));};exports[_0x1f34('0x22')]=function(_0x11d611,_0x518b9f){return db[_0x1f34('0x29')][_0x1f34('0x45')]({'where':{'id':_0x11d611[_0x1f34('0x43')]['id']}})[_0x1f34('0x23')](handleEntityNotFound(_0x518b9f,null))[_0x1f34('0x23')](removeEntity(_0x518b9f,null))[_0x1f34('0x46')](handleError(_0x518b9f,null));};exports['addConditions']=function(_0x195638,_0x7ee1d0,_0x2e38ce){return db[_0x1f34('0x49')][_0x1f34('0x45')]({'where':{'id':_0x195638[_0x1f34('0x43')]['id']}})[_0x1f34('0x23')](handleEntityNotFound(_0x7ee1d0,null))[_0x1f34('0x23')](function(_0x3b00cd){if(_0x3b00cd){return _0x3b00cd['addConditions'](_0x195638['body'][_0x1f34('0x4a')],_[_0x1f34('0x4b')](_0x195638[_0x1f34('0x48')],[_0x1f34('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x7ee1d0,null))['catch'](handleError(_0x7ee1d0,null));};exports['getConditions']=function(_0x19d996,_0x5a9500,_0x1b9163){var _0x487276={};var _0x2be4ad={};var _0x529cbb;var _0x1ddb9d;return db[_0x1f34('0x29')][_0x1f34('0x4c')]({'where':{'id':_0x19d996[_0x1f34('0x43')]['id']}})[_0x1f34('0x23')](handleEntityNotFound(_0x5a9500,null))['then'](function(_0x5c045c){if(_0x5c045c){_0x529cbb=_0x5c045c;_0x2be4ad[_0x1f34('0x2e')]=_[_0x1f34('0x2f')](db[_0x1f34('0x49')]['rawAttributes']);_0x2be4ad[_0x1f34('0x36')]=_[_0x1f34('0x2f')](_0x19d996[_0x1f34('0x36')]);_0x2be4ad[_0x1f34('0x30')]=_[_0x1f34('0x44')](_0x2be4ad[_0x1f34('0x2e')],_0x2be4ad[_0x1f34('0x36')]);_0x487276[_0x1f34('0x32')]=_[_0x1f34('0x44')](_0x2be4ad[_0x1f34('0x2e')],qs[_0x1f34('0x31')](_0x19d996[_0x1f34('0x36')][_0x1f34('0x31')]));_0x487276[_0x1f34('0x32')]=_0x487276[_0x1f34('0x32')][_0x1f34('0x33')]?_0x487276[_0x1f34('0x32')]:_0x2be4ad[_0x1f34('0x2e')];_0x487276[_0x1f34('0x37')]=qs['sort'](_0x19d996['query'][_0x1f34('0x38')]);_0x487276[_0x1f34('0x39')]=qs['filters'](_[_0x1f34('0x3a')](_0x19d996[_0x1f34('0x36')],_0x2be4ad[_0x1f34('0x30')]));if(_0x19d996[_0x1f34('0x36')][_0x1f34('0x3d')]){_0x487276[_0x1f34('0x39')]=_[_0x1f34('0x3b')](_0x487276['where'],{'$or':_[_0x1f34('0x28')](_0x487276[_0x1f34('0x32')],function(_0x567bff){var _0x487724={};_0x487724[_0x567bff]={'$like':'%'+_0x19d996[_0x1f34('0x36')][_0x1f34('0x3d')]+'%'};return _0x487724;})});}_0x487276=_[_0x1f34('0x3b')]({},_0x487276,_0x19d996['options']);return _0x529cbb[_0x1f34('0x4d')](_0x487276);}})[_0x1f34('0x23')](function(_0x56b520){if(_0x56b520){_0x1ddb9d=_0x56b520[_0x1f34('0x33')];if(!_0x19d996[_0x1f34('0x36')][_0x1f34('0x34')](_0x1f34('0x35'))){_0x487276[_0x1f34('0x1c')]=qs[_0x1f34('0x1c')](_0x19d996[_0x1f34('0x36')]['limit']);_0x487276[_0x1f34('0x1a')]=qs[_0x1f34('0x1a')](_0x19d996[_0x1f34('0x36')][_0x1f34('0x1a')]);}return _0x529cbb[_0x1f34('0x4d')](_0x487276);}})[_0x1f34('0x23')](function(_0x350b97){if(_0x350b97){return _0x350b97?{'count':_0x1ddb9d,'rows':_0x350b97}:null;}})['then'](respondWithResult(_0x5a9500,null))['catch'](handleError(_0x5a9500,null));};exports['addActions']=function(_0x20e990,_0x36524a,_0x3c7a90){return db[_0x1f34('0x4e')][_0x1f34('0x45')]({'where':{'id':_0x20e990[_0x1f34('0x43')]['id']}})[_0x1f34('0x23')](handleEntityNotFound(_0x36524a,null))[_0x1f34('0x23')](function(_0x12175f){if(_0x12175f){return _0x12175f[_0x1f34('0x4f')](_0x20e990[_0x1f34('0x48')]['ids'],_['omit'](_0x20e990[_0x1f34('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x36524a,null))['catch'](handleError(_0x36524a,null));};exports['getActions']=function(_0x41f31d,_0x2639ca,_0x4fd592){var _0x56d121={};var _0xc42a78={};var _0x542bc9;var _0x2224a2;return db[_0x1f34('0x29')][_0x1f34('0x4c')]({'where':{'id':_0x41f31d['params']['id']}})[_0x1f34('0x23')](handleEntityNotFound(_0x2639ca,null))[_0x1f34('0x23')](function(_0x19d45f){if(_0x19d45f){_0x542bc9=_0x19d45f;_0xc42a78[_0x1f34('0x2e')]=_['keys'](db[_0x1f34('0x4e')][_0x1f34('0x2a')]);_0xc42a78['query']=_[_0x1f34('0x2f')](_0x41f31d[_0x1f34('0x36')]);_0xc42a78[_0x1f34('0x30')]=_[_0x1f34('0x44')](_0xc42a78[_0x1f34('0x2e')],_0xc42a78[_0x1f34('0x36')]);_0x56d121[_0x1f34('0x32')]=_[_0x1f34('0x44')](_0xc42a78[_0x1f34('0x2e')],qs[_0x1f34('0x31')](_0x41f31d[_0x1f34('0x36')]['fields']));_0x56d121[_0x1f34('0x32')]=_0x56d121['attributes'][_0x1f34('0x33')]?_0x56d121[_0x1f34('0x32')]:_0xc42a78[_0x1f34('0x2e')];_0x56d121['order']=qs[_0x1f34('0x38')](_0x41f31d[_0x1f34('0x36')]['sort']);_0x56d121[_0x1f34('0x39')]=qs[_0x1f34('0x30')](_['pick'](_0x41f31d[_0x1f34('0x36')],_0xc42a78[_0x1f34('0x30')]));if(_0x41f31d['query'][_0x1f34('0x3d')]){_0x56d121[_0x1f34('0x39')]=_[_0x1f34('0x3b')](_0x56d121[_0x1f34('0x39')],{'$or':_[_0x1f34('0x28')](_0x56d121[_0x1f34('0x32')],function(_0x9ac485){var _0x39b52c={};_0x39b52c[_0x9ac485]={'$like':'%'+_0x41f31d['query'][_0x1f34('0x3d')]+'%'};return _0x39b52c;})});}_0x56d121=_[_0x1f34('0x3b')]({},_0x56d121,_0x41f31d[_0x1f34('0x3e')]);return _0x542bc9['getActions'](_0x56d121);}})[_0x1f34('0x23')](function(_0x49d64c){if(_0x49d64c){_0x2224a2=_0x49d64c[_0x1f34('0x33')];if(!_0x41f31d['query'][_0x1f34('0x34')](_0x1f34('0x35'))){_0x56d121[_0x1f34('0x1c')]=qs[_0x1f34('0x1c')](_0x41f31d[_0x1f34('0x36')][_0x1f34('0x1c')]);_0x56d121[_0x1f34('0x1a')]=qs[_0x1f34('0x1a')](_0x41f31d[_0x1f34('0x36')]['offset']);}return _0x542bc9[_0x1f34('0x50')](_0x56d121);}})['then'](function(_0xbc2d12){if(_0xbc2d12){return _0xbc2d12?{'count':_0x2224a2,'rows':_0xbc2d12}:null;}})['then'](respondWithResult(_0x2639ca,null))[_0x1f34('0x46')](handleError(_0x2639ca,null));};
\ No newline at end of file
+var _0x918a=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','error','stack','name','map','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Automation','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x918a,0x188));var _0xa918=function(_0x34b02a,_0xc897da){_0x34b02a=_0x34b02a-0x0;var _0x393178=_0x918a[_0x34b02a];return _0x393178;};'use strict';var emlformat=require(_0xa918('0x0'));var rimraf=require(_0xa918('0x1'));var zipdir=require(_0xa918('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa918('0x3'));var moment=require(_0xa918('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa918('0x5'));var util=require(_0xa918('0x6'));var path=require(_0xa918('0x7'));var sox=require(_0xa918('0x8'));var csv=require(_0xa918('0x9'));var ejs=require(_0xa918('0xa'));var fs=require('fs');var fs_extra=require(_0xa918('0xb'));var _=require(_0xa918('0xc'));var squel=require(_0xa918('0xd'));var crypto=require('crypto');var jsforce=require(_0xa918('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa918('0x9'));var querystring=require(_0xa918('0xf'));var Papa=require(_0xa918('0x10'));var Redis=require(_0xa918('0x11'));var authService=require(_0xa918('0x12'));var qs=require(_0xa918('0x13'));var as=require(_0xa918('0x14'));var hardwareService=require(_0xa918('0x15'));var logger=require(_0xa918('0x16'))('api');var utils=require(_0xa918('0x17'));var config=require(_0xa918('0x18'));var licenseUtil=require(_0xa918('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3522d3,_0x2d78c5){_0x2d78c5=_0x2d78c5||0xcc;return function(_0x473ed7){if(_0x473ed7){return _0x3522d3[_0xa918('0x1a')](_0x2d78c5);}return _0x3522d3[_0xa918('0x1b')](_0x2d78c5)[_0xa918('0x1c')]();};}function respondWithResult(_0x1a1e15,_0x53be22){_0x53be22=_0x53be22||0xc8;return function(_0x5e04ae){if(_0x5e04ae){return _0x1a1e15[_0xa918('0x1b')](_0x53be22)[_0xa918('0x1d')](_0x5e04ae);}};}function respondWithFilteredResult(_0x1e4087,_0x4afcc9){return function(_0x5918c8){if(_0x5918c8){var _0x11e523=typeof _0x4afcc9[_0xa918('0x1e')]==='undefined'&&typeof _0x4afcc9[_0xa918('0x1f')]===_0xa918('0x20');var _0x5a2201=_0x5918c8[_0xa918('0x21')];var _0x57d606=_0x11e523?0x0:_0x4afcc9[_0xa918('0x1e')];var _0x3727c7=_0x11e523?_0x5918c8[_0xa918('0x21')]:_0x4afcc9[_0xa918('0x1e')]+_0x4afcc9['limit'];var _0x1bb312;if(_0x3727c7>=_0x5a2201){_0x3727c7=_0x5a2201;_0x1bb312=0xc8;}else{_0x1bb312=0xce;}_0x1e4087['status'](_0x1bb312);return _0x1e4087['set'](_0xa918('0x22'),_0x57d606+'-'+_0x3727c7+'/'+_0x5a2201)['json'](_0x5918c8);}return null;};}function patchUpdates(_0x51c49d){return function(_0x1d2023){try{jsonpatch['apply'](_0x1d2023,_0x51c49d,!![]);}catch(_0x1679c9){return BPromise[_0xa918('0x23')](_0x1679c9);}return _0x1d2023['save']();};}function saveUpdates(_0x2adf9e,_0x4b0e81){return function(_0x5658b2){if(_0x5658b2){return _0x5658b2[_0xa918('0x24')](_0x2adf9e)[_0xa918('0x25')](function(_0xbabcaf){return _0xbabcaf;});}return null;};}function removeEntity(_0x135b70,_0x7f8c0){return function(_0x53fc90){if(_0x53fc90){return _0x53fc90['destroy']()['then'](function(){_0x135b70[_0xa918('0x1b')](0xcc)[_0xa918('0x1c')]();});}};}function handleEntityNotFound(_0x62416,_0x11f677){return function(_0xa4e3c2){if(!_0xa4e3c2){_0x62416[_0xa918('0x1a')](0x194);}return _0xa4e3c2;};}function handleError(_0x5ce113,_0x1aa8be){_0x1aa8be=_0x1aa8be||0x1f4;return function(_0x193208){logger[_0xa918('0x26')](_0x193208[_0xa918('0x27')]);if(_0x193208['name']){delete _0x193208[_0xa918('0x28')];}_0x5ce113[_0xa918('0x1b')](_0x1aa8be)['send'](_0x193208);};}exports['index']=function(_0x38beed,_0x1f250c){var _0x9acf74={},_0x1cf2f0={},_0x1a87c4={'count':0x0,'rows':[]};var _0x43a2b2=_[_0xa918('0x29')](db['Automation']['rawAttributes'],function(_0x3c874b){return{'name':_0x3c874b['fieldName'],'type':_0x3c874b['type'][_0xa918('0x2a')]};});_0x1cf2f0['model']=_[_0xa918('0x29')](_0x43a2b2,_0xa918('0x28'));_0x1cf2f0['query']=_[_0xa918('0x2b')](_0x38beed[_0xa918('0x2c')]);_0x1cf2f0[_0xa918('0x2d')]=_[_0xa918('0x2e')](_0x1cf2f0[_0xa918('0x2f')],_0x1cf2f0['query']);_0x9acf74[_0xa918('0x30')]=_['intersection'](_0x1cf2f0[_0xa918('0x2f')],qs[_0xa918('0x31')](_0x38beed['query'][_0xa918('0x31')]));_0x9acf74[_0xa918('0x30')]=_0x9acf74[_0xa918('0x30')][_0xa918('0x32')]?_0x9acf74[_0xa918('0x30')]:_0x1cf2f0['model'];if(!_0x38beed[_0xa918('0x2c')][_0xa918('0x33')](_0xa918('0x34'))){_0x9acf74[_0xa918('0x1f')]=qs[_0xa918('0x1f')](_0x38beed[_0xa918('0x2c')][_0xa918('0x1f')]);_0x9acf74[_0xa918('0x1e')]=qs[_0xa918('0x1e')](_0x38beed[_0xa918('0x2c')][_0xa918('0x1e')]);}_0x9acf74[_0xa918('0x35')]=qs[_0xa918('0x36')](_0x38beed[_0xa918('0x2c')][_0xa918('0x36')]);_0x9acf74[_0xa918('0x37')]=qs[_0xa918('0x2d')](_[_0xa918('0x38')](_0x38beed[_0xa918('0x2c')],_0x1cf2f0['filters']),_0x43a2b2);if(_0x38beed[_0xa918('0x2c')][_0xa918('0x39')]){_0x9acf74[_0xa918('0x37')]=_[_0xa918('0x3a')](_0x9acf74['where'],{'$or':_[_0xa918('0x29')](_0x43a2b2,function(_0x49524a){if(_0x49524a['type']!==_0xa918('0x3b')){var _0x500f23={};_0x500f23[_0x49524a['name']]={'$like':'%'+_0x38beed['query'][_0xa918('0x39')]+'%'};return _0x500f23;}})});}_0x9acf74=_[_0xa918('0x3a')]({},_0x9acf74,_0x38beed[_0xa918('0x3c')]);var _0x38d5f9={'where':_0x9acf74[_0xa918('0x37')]};return db[_0xa918('0x3d')][_0xa918('0x21')](_0x38d5f9)[_0xa918('0x25')](function(_0xbc317e){_0x1a87c4[_0xa918('0x21')]=_0xbc317e;if(_0x38beed[_0xa918('0x2c')]['includeAll']){_0x9acf74[_0xa918('0x3e')]=[{'all':!![]}];}return db[_0xa918('0x3d')][_0xa918('0x3f')](_0x9acf74);})[_0xa918('0x25')](function(_0x385113){_0x1a87c4[_0xa918('0x40')]=_0x385113;return _0x1a87c4;})['then'](respondWithFilteredResult(_0x1f250c,_0x9acf74))[_0xa918('0x41')](handleError(_0x1f250c,null));};exports[_0xa918('0x42')]=function(_0x310995,_0x18a154){var _0x32a754={'raw':![],'where':{'id':_0x310995[_0xa918('0x43')]['id']}},_0x5730b5={};_0x5730b5['model']=_['keys'](db[_0xa918('0x3d')][_0xa918('0x44')]);_0x5730b5[_0xa918('0x2c')]=_[_0xa918('0x2b')](_0x310995['query']);_0x5730b5[_0xa918('0x2d')]=_['intersection'](_0x5730b5['model'],_0x5730b5[_0xa918('0x2c')]);_0x32a754[_0xa918('0x30')]=_[_0xa918('0x2e')](_0x5730b5['model'],qs[_0xa918('0x31')](_0x310995['query'][_0xa918('0x31')]));_0x32a754['attributes']=_0x32a754[_0xa918('0x30')][_0xa918('0x32')]?_0x32a754[_0xa918('0x30')]:_0x5730b5[_0xa918('0x2f')];if(_0x310995['query'][_0xa918('0x45')]){_0x32a754[_0xa918('0x3e')]=[{'all':!![]}];}_0x32a754=_[_0xa918('0x3a')]({},_0x32a754,_0x310995[_0xa918('0x3c')]);return db['Automation'][_0xa918('0x46')](_0x32a754)['then'](handleEntityNotFound(_0x18a154,null))[_0xa918('0x25')](respondWithResult(_0x18a154,null))[_0xa918('0x41')](handleError(_0x18a154,null));};exports[_0xa918('0x47')]=function(_0x1e4a7c,_0x387e0d){return db['Automation']['create'](_0x1e4a7c[_0xa918('0x48')],{})['then'](respondWithResult(_0x387e0d,0xc9))[_0xa918('0x41')](handleError(_0x387e0d,null));};exports['update']=function(_0xdb44f9,_0x45d981){if(_0xdb44f9[_0xa918('0x48')]['id']){delete _0xdb44f9[_0xa918('0x48')]['id'];}return db[_0xa918('0x3d')][_0xa918('0x46')]({'where':{'id':_0xdb44f9[_0xa918('0x43')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x45d981,null))[_0xa918('0x25')](saveUpdates(_0xdb44f9[_0xa918('0x48')],null))[_0xa918('0x25')](respondWithResult(_0x45d981,null))[_0xa918('0x41')](handleError(_0x45d981,null));};exports[_0xa918('0x49')]=function(_0x551b06,_0x2fbd96){return db[_0xa918('0x3d')][_0xa918('0x46')]({'where':{'id':_0x551b06['params']['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x2fbd96,null))['then'](removeEntity(_0x2fbd96,null))[_0xa918('0x41')](handleError(_0x2fbd96,null));};exports[_0xa918('0x4a')]=function(_0x23f78a,_0xe4b37a,_0xd05143){return db[_0xa918('0x4b')][_0xa918('0x46')]({'where':{'id':_0x23f78a['params']['id']}})[_0xa918('0x25')](handleEntityNotFound(_0xe4b37a,null))[_0xa918('0x25')](function(_0xc17901){if(_0xc17901){return _0xc17901[_0xa918('0x4a')](_0x23f78a[_0xa918('0x48')][_0xa918('0x4c')],_[_0xa918('0x4d')](_0x23f78a[_0xa918('0x48')],['ids','id'])||{});}})[_0xa918('0x25')](respondWithResult(_0xe4b37a,null))[_0xa918('0x41')](handleError(_0xe4b37a,null));};exports[_0xa918('0x4e')]=function(_0x214ffc,_0x514f2d,_0x5116cb){var _0x122802={};var _0x56610c={};var _0x4f3a8c;var _0x2c8d58;return db['Automation'][_0xa918('0x4f')]({'where':{'id':_0x214ffc[_0xa918('0x43')]['id']}})[_0xa918('0x25')](handleEntityNotFound(_0x514f2d,null))[_0xa918('0x25')](function(_0x514186){if(_0x514186){_0x4f3a8c=_0x514186;_0x56610c[_0xa918('0x2f')]=_['keys'](db[_0xa918('0x4b')]['rawAttributes']);_0x56610c['query']=_[_0xa918('0x2b')](_0x214ffc[_0xa918('0x2c')]);_0x56610c[_0xa918('0x2d')]=_[_0xa918('0x2e')](_0x56610c[_0xa918('0x2f')],_0x56610c[_0xa918('0x2c')]);_0x122802[_0xa918('0x30')]=_[_0xa918('0x2e')](_0x56610c[_0xa918('0x2f')],qs[_0xa918('0x31')](_0x214ffc[_0xa918('0x2c')][_0xa918('0x31')]));_0x122802['attributes']=_0x122802['attributes'][_0xa918('0x32')]?_0x122802[_0xa918('0x30')]:_0x56610c[_0xa918('0x2f')];_0x122802[_0xa918('0x35')]=qs['sort'](_0x214ffc[_0xa918('0x2c')][_0xa918('0x36')]);_0x122802['where']=qs[_0xa918('0x2d')](_['pick'](_0x214ffc[_0xa918('0x2c')],_0x56610c[_0xa918('0x2d')]));if(_0x214ffc['query'][_0xa918('0x39')]){_0x122802['where']=_[_0xa918('0x3a')](_0x122802[_0xa918('0x37')],{'$or':_[_0xa918('0x29')](_0x122802[_0xa918('0x30')],function(_0xb21ad6){var _0x147e21={};_0x147e21[_0xb21ad6]={'$like':'%'+_0x214ffc['query'][_0xa918('0x39')]+'%'};return _0x147e21;})});}_0x122802=_[_0xa918('0x3a')]({},_0x122802,_0x214ffc[_0xa918('0x3c')]);return _0x4f3a8c['getConditions'](_0x122802);}})['then'](function(_0x3327bd){if(_0x3327bd){_0x2c8d58=_0x3327bd[_0xa918('0x32')];if(!_0x214ffc[_0xa918('0x2c')]['hasOwnProperty'](_0xa918('0x34'))){_0x122802['limit']=qs['limit'](_0x214ffc[_0xa918('0x2c')][_0xa918('0x1f')]);_0x122802['offset']=qs[_0xa918('0x1e')](_0x214ffc[_0xa918('0x2c')][_0xa918('0x1e')]);}return _0x4f3a8c[_0xa918('0x4e')](_0x122802);}})[_0xa918('0x25')](function(_0x2f8aa0){if(_0x2f8aa0){return _0x2f8aa0?{'count':_0x2c8d58,'rows':_0x2f8aa0}:null;}})['then'](respondWithResult(_0x514f2d,null))[_0xa918('0x41')](handleError(_0x514f2d,null));};exports[_0xa918('0x50')]=function(_0x41f627,_0x4d6a6e,_0x2a391f){return db[_0xa918('0x51')][_0xa918('0x46')]({'where':{'id':_0x41f627[_0xa918('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d6a6e,null))['then'](function(_0x5d398a){if(_0x5d398a){return _0x5d398a[_0xa918('0x50')](_0x41f627[_0xa918('0x48')]['ids'],_[_0xa918('0x4d')](_0x41f627['body'],[_0xa918('0x4c'),'id'])||{});}})[_0xa918('0x25')](respondWithResult(_0x4d6a6e,null))['catch'](handleError(_0x4d6a6e,null));};exports[_0xa918('0x52')]=function(_0x1ba386,_0x4fb4d6,_0x44bd18){var _0x52de3f={};var _0x83ecdc={};var _0x3fa30e;var _0x1639ff;return db[_0xa918('0x3d')]['findOne']({'where':{'id':_0x1ba386[_0xa918('0x43')]['id']}})['then'](handleEntityNotFound(_0x4fb4d6,null))[_0xa918('0x25')](function(_0x27d4af){if(_0x27d4af){_0x3fa30e=_0x27d4af;_0x83ecdc['model']=_[_0xa918('0x2b')](db['Action'][_0xa918('0x44')]);_0x83ecdc[_0xa918('0x2c')]=_['keys'](_0x1ba386[_0xa918('0x2c')]);_0x83ecdc['filters']=_[_0xa918('0x2e')](_0x83ecdc['model'],_0x83ecdc['query']);_0x52de3f[_0xa918('0x30')]=_['intersection'](_0x83ecdc['model'],qs[_0xa918('0x31')](_0x1ba386[_0xa918('0x2c')][_0xa918('0x31')]));_0x52de3f[_0xa918('0x30')]=_0x52de3f[_0xa918('0x30')][_0xa918('0x32')]?_0x52de3f['attributes']:_0x83ecdc['model'];_0x52de3f[_0xa918('0x35')]=qs[_0xa918('0x36')](_0x1ba386[_0xa918('0x2c')][_0xa918('0x36')]);_0x52de3f[_0xa918('0x37')]=qs[_0xa918('0x2d')](_[_0xa918('0x38')](_0x1ba386[_0xa918('0x2c')],_0x83ecdc[_0xa918('0x2d')]));if(_0x1ba386[_0xa918('0x2c')][_0xa918('0x39')]){_0x52de3f[_0xa918('0x37')]=_[_0xa918('0x3a')](_0x52de3f[_0xa918('0x37')],{'$or':_[_0xa918('0x29')](_0x52de3f[_0xa918('0x30')],function(_0x2dd290){var _0x43e661={};_0x43e661[_0x2dd290]={'$like':'%'+_0x1ba386[_0xa918('0x2c')][_0xa918('0x39')]+'%'};return _0x43e661;})});}_0x52de3f=_[_0xa918('0x3a')]({},_0x52de3f,_0x1ba386[_0xa918('0x3c')]);return _0x3fa30e[_0xa918('0x52')](_0x52de3f);}})[_0xa918('0x25')](function(_0x5ef3b0){if(_0x5ef3b0){_0x1639ff=_0x5ef3b0['length'];if(!_0x1ba386[_0xa918('0x2c')][_0xa918('0x33')](_0xa918('0x34'))){_0x52de3f[_0xa918('0x1f')]=qs[_0xa918('0x1f')](_0x1ba386[_0xa918('0x2c')]['limit']);_0x52de3f['offset']=qs['offset'](_0x1ba386[_0xa918('0x2c')][_0xa918('0x1e')]);}return _0x3fa30e[_0xa918('0x52')](_0x52de3f);}})[_0xa918('0x25')](function(_0x212af2){if(_0x212af2){return _0x212af2?{'count':_0x1639ff,'rows':_0x212af2}:null;}})[_0xa918('0x25')](respondWithResult(_0x4fb4d6,null))[_0xa918('0x41')](handleError(_0x4fb4d6,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index dfb6391..4d5fd98 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 _0xeb60=['lodash','util','moment','rimraf','./automation.attributes','exports','define','Automation'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0xeb60,0x1a0));var _0x0eb6=function(_0x1bfa0f,_0x2b36d3){_0x1bfa0f=_0x1bfa0f-0x0;var _0x4c727f=_0xeb60[_0x1bfa0f];return _0x4c727f;};'use strict';var _=require(_0x0eb6('0x0'));var util=require(_0x0eb6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0eb6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0eb6('0x3'));var config=require('../../config/environment');var attributes=require(_0x0eb6('0x4'));module[_0x0eb6('0x5')]=function(_0x3cc298,_0x59ea31){return _0x3cc298[_0x0eb6('0x6')](_0x0eb6('0x7'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8095=['lodash','util','moment','path','define','Automation','tools_automations'];(function(_0x494f6f,_0x180cbd){var _0x117ae3=function(_0x4488e2){while(--_0x4488e2){_0x494f6f['push'](_0x494f6f['shift']());}};_0x117ae3(++_0x180cbd);}(_0x8095,0x15e));var _0x5809=function(_0x46b77b,_0x413e47){_0x46b77b=_0x46b77b-0x0;var _0x4e56ab=_0x8095[_0x46b77b];return _0x4e56ab;};'use strict';var _=require(_0x5809('0x0'));var util=require(_0x5809('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5809('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5809('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x290769,_0x3155eb){return _0x290769[_0x5809('0x4')](_0x5809('0x5'),attributes,{'tableName':_0x5809('0x6'),'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 0447c6d..a028889 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 _0x30fc=['Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3cae79,_0x56281c){var _0x3465be=function(_0x3110a7){while(--_0x3110a7){_0x3cae79['push'](_0x3cae79['shift']());}};_0x3465be(++_0x56281c);}(_0x30fc,0x64));var _0xc30f=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x30fc[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0xc30f('0x0'));var util=require(_0xc30f('0x1'));var moment=require('moment');var BPromise=require(_0xc30f('0x2'));var rs=require(_0xc30f('0x3'));var fs=require('fs');var Redis=require(_0xc30f('0x4'));var db=require(_0xc30f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc30f('0x6'))(_0xc30f('0x7'));var config=require(_0xc30f('0x8'));var jayson=require(_0xc30f('0x9'));var client=jayson[_0xc30f('0xa')][_0xc30f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54c174,_0x23528c,_0x325a64){return new BPromise(function(_0x33a769,_0x3d2167){return client[_0xc30f('0xc')](_0x54c174,_0x325a64)[_0xc30f('0xd')](function(_0x436059){logger[_0xc30f('0xe')](_0xc30f('0xf'),_0x23528c,'request\x20sent');logger[_0xc30f('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x23528c,_0xc30f('0x11'),JSON[_0xc30f('0x12')](_0x436059));if(_0x436059[_0xc30f('0x13')]){if(_0x436059[_0xc30f('0x13')][_0xc30f('0x14')]===0x1f4){logger[_0xc30f('0x13')]('Automation,\x20%s,\x20%s',_0x23528c,_0x436059['error'][_0xc30f('0x15')]);return _0x3d2167(_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);}logger[_0xc30f('0x13')]('Automation,\x20%s,\x20%s',_0x23528c,_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);return _0x33a769(_0x436059[_0xc30f('0x13')][_0xc30f('0x15')]);}else{logger[_0xc30f('0xe')](_0xc30f('0xf'),_0x23528c,_0xc30f('0x11'));_0x33a769(_0x436059['result']['message']);}})[_0xc30f('0x16')](function(_0x1b02c5){logger[_0xc30f('0x13')](_0xc30f('0xf'),_0x23528c,_0x1b02c5);_0x3d2167(_0x1b02c5);});});}
\ No newline at end of file
+var _0xc664=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc664,0x90));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c66('0x0'));var util=require(_0x4c66('0x1'));var moment=require('moment');var BPromise=require(_0x4c66('0x2'));var rs=require(_0x4c66('0x3'));var fs=require('fs');var Redis=require(_0x4c66('0x4'));var db=require(_0x4c66('0x5'))['db'];var utils=require(_0x4c66('0x6'));var logger=require('../../config/logger')(_0x4c66('0x7'));var config=require(_0x4c66('0x8'));var jayson=require(_0x4c66('0x9'));var client=jayson[_0x4c66('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14ceba,_0x3528ee,_0x406aec){return new BPromise(function(_0x47fb8e,_0x4aa737){return client[_0x4c66('0xb')](_0x14ceba,_0x406aec)[_0x4c66('0xc')](function(_0xb870a5){logger[_0x4c66('0xd')]('Automation,\x20%s,\x20%s',_0x3528ee,_0x4c66('0xe'));logger[_0x4c66('0xf')](_0x4c66('0x10'),_0x3528ee,_0x4c66('0xe'),JSON[_0x4c66('0x11')](_0xb870a5));if(_0xb870a5[_0x4c66('0x12')]){if(_0xb870a5[_0x4c66('0x12')][_0x4c66('0x13')]===0x1f4){logger[_0x4c66('0x12')]('Automation,\x20%s,\x20%s',_0x3528ee,_0xb870a5['error']['message']);return _0x4aa737(_0xb870a5['error'][_0x4c66('0x14')]);}logger[_0x4c66('0x12')](_0x4c66('0x15'),_0x3528ee,_0xb870a5[_0x4c66('0x12')][_0x4c66('0x14')]);return _0x47fb8e(_0xb870a5[_0x4c66('0x12')][_0x4c66('0x14')]);}else{logger[_0x4c66('0xd')](_0x4c66('0x15'),_0x3528ee,_0x4c66('0xe'));_0x47fb8e(_0xb870a5[_0x4c66('0x16')][_0x4c66('0x14')]);}})[_0x4c66('0x17')](function(_0x144982){logger[_0x4c66('0x12')]('Automation,\x20%s,\x20%s',_0x3528ee,_0x144982);_0x4aa737(_0x144982);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index eb9fd0a..6e99453 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 _0x9ca8=['isAuthenticated','index','/:id','/:id/conditions','/:id/actions','post','create','addConditions','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x9ca8,0x123));var _0x89ca=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x9ca8[_0x3cb6dc];return _0x47ec89;};'use strict';var multer=require('multer');var util=require(_0x89ca('0x0'));var path=require('path');var timeout=require(_0x89ca('0x1'));var express=require(_0x89ca('0x2'));var router=express[_0x89ca('0x3')]();var fs_extra=require(_0x89ca('0x4'));var auth=require(_0x89ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89ca('0x6'));var controller=require(_0x89ca('0x7'));router[_0x89ca('0x8')]('/',auth[_0x89ca('0x9')](),controller[_0x89ca('0xa')]);router[_0x89ca('0x8')](_0x89ca('0xb'),auth[_0x89ca('0x9')](),controller['show']);router['get'](_0x89ca('0xc'),auth['isAuthenticated'](),controller['getConditions']);router[_0x89ca('0x8')](_0x89ca('0xd'),auth[_0x89ca('0x9')](),controller['getActions']);router[_0x89ca('0xe')]('/',auth[_0x89ca('0x9')](),controller[_0x89ca('0xf')]);router[_0x89ca('0xe')](_0x89ca('0xc'),auth[_0x89ca('0x9')](),controller[_0x89ca('0x10')]);router[_0x89ca('0xe')](_0x89ca('0xd'),auth[_0x89ca('0x9')](),controller['addActions']);router['put'](_0x89ca('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x89ca('0x11')](_0x89ca('0xb'),auth[_0x89ca('0x9')](),controller[_0x89ca('0x12')]);module[_0x89ca('0x13')]=router;
\ No newline at end of file
+var _0x92e0=['isAuthenticated','getConditions','post','addConditions','/:id/actions','addActions','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id'];(function(_0xa7bbae,_0x268932){var _0x2d5bdf=function(_0x3feddd){while(--_0x3feddd){_0xa7bbae['push'](_0xa7bbae['shift']());}};_0x2d5bdf(++_0x268932);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x092e('0x0'));var util=require('util');var path=require(_0x092e('0x1'));var timeout=require(_0x092e('0x2'));var express=require(_0x092e('0x3'));var router=express[_0x092e('0x4')]();var fs_extra=require(_0x092e('0x5'));var auth=require(_0x092e('0x6'));var interaction=require(_0x092e('0x7'));var config=require(_0x092e('0x8'));var controller=require(_0x092e('0x9'));router[_0x092e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x092e('0xa')](_0x092e('0xb'),auth[_0x092e('0xc')](),controller['show']);router[_0x092e('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x092e('0xd')]);router[_0x092e('0xa')]('/:id/actions',auth[_0x092e('0xc')](),controller['getActions']);router['post']('/',auth[_0x092e('0xc')](),controller['create']);router[_0x092e('0xe')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x092e('0xf')]);router['post'](_0x092e('0x10'),auth[_0x092e('0xc')](),controller[_0x092e('0x11')]);router[_0x092e('0x12')](_0x092e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x092e('0x13')](_0x092e('0xb'),auth['isAuthenticated'](),controller[_0x092e('0x14')]);module[_0x092e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index b6ed0c4..8e3e35a 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 _0xdb28=['#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xdb28,0x106));var _0x8db2=function(_0x53edfb,_0x1f6cef){_0x53edfb=_0x53edfb-0x0;var _0x24ec51=_0xdb28[_0x53edfb];return _0x24ec51;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'name':{'type':Sequelize[_0x8db2('0x2')],'unique':_0x8db2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x8db2('0x4')),'allowNull':![],'defaultValue':_0x8db2('0x4')},'description':{'type':Sequelize[_0x8db2('0x2')]},'active':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':0x0,'comment':_0x8db2('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x8db2('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8db2('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x8db2('0x9')](0x3)[_0x8db2('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8db2('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8db2('0x9')](0x3)[_0x8db2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8db2('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8db2('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8db2('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x8db2('0x9')](0x3)[_0x8db2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8db2('0x9')](0x5)[_0x8db2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8db2('0x9')](0x3)[_0x8db2('0x7')],'defaultValue':0x3,'comment':_0x8db2('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8db2('0x9')](0x5)[_0x8db2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8db2('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8db2('0xe')},'dialTimezone':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':_0x8db2('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x8db2('0x10')](_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0x13')),'defaultValue':_0x8db2('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8db2('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x8db2('0x9')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8db2('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x8db2('0x9')](0x9)[_0x8db2('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8db2('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8db2('0x9')](0x9)[_0x8db2('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x8db2('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8db2('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x8db2('0x9')](0x9)[_0x8db2('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8db2('0x9')](0x9)[_0x8db2('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8db2('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8db2('0x9')](0x9)[_0x8db2('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8db2('0x9')](0x5)[_0x8db2('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8db2('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8db2('0x9')](0x9)[_0x8db2('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8db2('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8db2('0x10')]('DESC',_0x8db2('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8db2('0x1c')},'dialCutDigit':{'type':Sequelize[_0x8db2('0x9')](0x3)[_0x8db2('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8db2('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8db2('0x9')](0x3)[_0x8db2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8db2('0x9')](0x5)[_0x8db2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8db2('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x8db2('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8db2('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x8db2('0x9')](0x5)[_0x8db2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8db2('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8db2('0x9')](0x3)[_0x8db2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8db2('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8db2('0x9')](0x5)[_0x8db2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8db2('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8db2('0x9')](0x5)[_0x8db2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8db2('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8db2('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8db2('0x9')](0x5)[_0x8db2('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8db2('0x23')}};
\ No newline at end of file
+var _0x9ee6=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x4d2a06,_0x540d6e){var _0x139f1b=function(_0x253c39){while(--_0x253c39){_0x4d2a06['push'](_0x4d2a06['shift']());}};_0x139f1b(++_0x540d6e);}(_0x9ee6,0x84));var _0x69ee=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0x9ee6[_0x4179e2];return _0x24cb50;};'use strict';var Sequelize=require(_0x69ee('0x0'));module[_0x69ee('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x69ee('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x69ee('0x3')](_0x69ee('0x4')),'allowNull':![],'defaultValue':_0x69ee('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x69ee('0x5')],'defaultValue':0x0,'comment':_0x69ee('0x6')},'limitCalls':{'type':Sequelize[_0x69ee('0x7')](0x4)[_0x69ee('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x69ee('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x69ee('0xa')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x69ee('0xa')]},'dialOriginateTimeout':{'type':Sequelize[_0x69ee('0x7')](0x3)[_0x69ee('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69ee('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x69ee('0x7')](0x3)[_0x69ee('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69ee('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x69ee('0x7')](0x5)[_0x69ee('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69ee('0xd')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x69ee('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69ee('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x69ee('0x7')](0x3)[_0x69ee('0x8')],'defaultValue':0x3,'comment':_0x69ee('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69ee('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69ee('0x10')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x69ee('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x69ee('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x69ee('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x69ee('0x3')](_0x69ee('0x13'),_0x69ee('0x14'),_0x69ee('0x15')),'defaultValue':_0x69ee('0x13')},'dialAMDActive':{'type':Sequelize[_0x69ee('0x5')],'defaultValue':0x0,'comment':_0x69ee('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0x69ee('0x7')](0x9)[_0x69ee('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x69ee('0x17')},'dialAMDGreeting':{'type':Sequelize[_0x69ee('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x69ee('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x69ee('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x69ee('0x7')](0x9)[_0x69ee('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x69ee('0x19')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x69ee('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x69ee('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x69ee('0x7')](0x9)[_0x69ee('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x69ee('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x69ee('0x7')](0x9)[_0x69ee('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x69ee('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x69ee('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x69ee('0x7')](0x9)[_0x69ee('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x69ee('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x69ee('0x3')]('DESC',_0x69ee('0x1e')),'defaultValue':_0x69ee('0x1f')},'dialPrefix':{'type':Sequelize[_0x69ee('0xa')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x69ee('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x69ee('0x20')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x69ee('0x7')](0x3)[_0x69ee('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x69ee('0x7')](0x5)[_0x69ee('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69ee('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x69ee('0x7')](0x3)[_0x69ee('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69ee('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69ee('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x69ee('0x7')](0x3)[_0x69ee('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69ee('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69ee('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x69ee('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69ee('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x69ee('0x7')](0x5)[_0x69ee('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69ee('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x69ee('0x7')](0x3)[_0x69ee('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69ee('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x69ee('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69ee('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 51493ed..eee81ef 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 _0xcb49=['findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','IvrCampaigns','end','error','stack','name','send','index','map','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','merge','filter','includeAll','include','Campaign','findAll','catch','params','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','omit','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmHopper','hasOwnProperty','pick','CampaignId','rows','getHopperHistories'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0xcb49,0x156));var _0x9cb4=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0xcb49[_0x421e36];return _0x20b3e3;};'use strict';var emlformat=require(_0x9cb4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9cb4('0x1'));var jsonpatch=require(_0x9cb4('0x2'));var rp=require(_0x9cb4('0x3'));var moment=require(_0x9cb4('0x4'));var BPromise=require(_0x9cb4('0x5'));var Mustache=require(_0x9cb4('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9cb4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9cb4('0x8'));var squel=require('squel');var crypto=require(_0x9cb4('0x9'));var jsforce=require(_0x9cb4('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9cb4('0xb'));var Papa=require('papaparse');var Redis=require(_0x9cb4('0xc'));var authService=require(_0x9cb4('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cb4('0xe'));var logger=require(_0x9cb4('0xf'))(_0x9cb4('0x10'));var utils=require(_0x9cb4('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x9cb4('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x465871,_0x411902){_0x411902=_0x411902||0xcc;return function(_0x243f61){if(_0x243f61){return _0x465871[_0x9cb4('0x13')](_0x411902);}return _0x465871[_0x9cb4('0x14')](_0x411902)['end']();};}function respondWithResult(_0x2ce130,_0x22b994){_0x22b994=_0x22b994||0xc8;return function(_0x47f68b){if(_0x47f68b){return _0x2ce130[_0x9cb4('0x14')](_0x22b994)['json'](_0x47f68b);}};}function respondWithFilteredResult(_0x57daf1,_0xf169bf){return function(_0x1a9245){if(_0x1a9245){var _0x33c673=typeof _0xf169bf[_0x9cb4('0x15')]==='undefined'&&typeof _0xf169bf[_0x9cb4('0x16')]===_0x9cb4('0x17');var _0x35c0eb=_0x1a9245[_0x9cb4('0x18')];var _0x520165=_0x33c673?0x0:_0xf169bf[_0x9cb4('0x15')];var _0x461430=_0x33c673?_0x1a9245[_0x9cb4('0x18')]:_0xf169bf['offset']+_0xf169bf['limit'];var _0x1ef211;if(_0x461430>=_0x35c0eb){_0x461430=_0x35c0eb;_0x1ef211=0xc8;}else{_0x1ef211=0xce;}_0x57daf1['status'](_0x1ef211);return _0x57daf1[_0x9cb4('0x19')]('Content-Range',_0x520165+'-'+_0x461430+'/'+_0x35c0eb)[_0x9cb4('0x1a')](_0x1a9245);}return null;};}function patchUpdates(_0x5b90d4){return function(_0x37ee39){try{jsonpatch[_0x9cb4('0x1b')](_0x37ee39,_0x5b90d4,!![]);}catch(_0x28ca7b){return BPromise[_0x9cb4('0x1c')](_0x28ca7b);}return _0x37ee39[_0x9cb4('0x1d')]();};}function saveUpdates(_0xe4fdb7,_0x5eafaf){return function(_0x25f263){if(_0x25f263){return _0x25f263[_0x9cb4('0x1e')](_0xe4fdb7)[_0x9cb4('0x1f')](function(_0x38be6d){return _0x38be6d;});}return null;};}function removeEntity(_0x18b4c1,_0x2d9c06){return function(_0x3f9437){if(_0x3f9437){return _0x3f9437[_0x9cb4('0x20')]()[_0x9cb4('0x1f')](function(){var _0x1a6c1e=_0x3f9437['get']({'plain':!![]});var _0x9abb58=_0x9cb4('0x21');return db['UserProfileResource'][_0x9cb4('0x20')]({'where':{'type':_0x9abb58,'resourceId':_0x1a6c1e['id']}})[_0x9cb4('0x1f')](function(){return _0x3f9437;});})[_0x9cb4('0x1f')](function(){_0x18b4c1['status'](0xcc)[_0x9cb4('0x22')]();});}};}function handleEntityNotFound(_0x2b7894,_0x4f0e2f){return function(_0xc17d4b){if(!_0xc17d4b){_0x2b7894[_0x9cb4('0x13')](0x194);}return _0xc17d4b;};}function handleError(_0x33526b,_0x27e7a0){_0x27e7a0=_0x27e7a0||0x1f4;return function(_0x286714){logger[_0x9cb4('0x23')](_0x286714[_0x9cb4('0x24')]);if(_0x286714[_0x9cb4('0x25')]){delete _0x286714['name'];}_0x33526b['status'](_0x27e7a0)[_0x9cb4('0x26')](_0x286714);};}exports[_0x9cb4('0x27')]=function(_0x8959e2,_0x5529f7){var _0x2ddfef={},_0x1f5671={},_0x3d47aa={'count':0x0,'rows':[]};var _0xc2be0a=_[_0x9cb4('0x28')](db['Campaign']['rawAttributes'],function(_0x4f79e5){return{'name':_0x4f79e5[_0x9cb4('0x29')],'type':_0x4f79e5[_0x9cb4('0x2a')][_0x9cb4('0x2b')]};});_0x1f5671['model']=_[_0x9cb4('0x28')](_0xc2be0a,'name');_0x1f5671['query']=_[_0x9cb4('0x2c')](_0x8959e2['query']);_0x1f5671[_0x9cb4('0x2d')]=_[_0x9cb4('0x2e')](_0x1f5671[_0x9cb4('0x2f')],_0x1f5671[_0x9cb4('0x30')]);_0x2ddfef[_0x9cb4('0x31')]=_[_0x9cb4('0x2e')](_0x1f5671[_0x9cb4('0x2f')],qs[_0x9cb4('0x32')](_0x8959e2[_0x9cb4('0x30')][_0x9cb4('0x32')]));_0x2ddfef[_0x9cb4('0x31')]=_0x2ddfef[_0x9cb4('0x31')][_0x9cb4('0x33')]?_0x2ddfef[_0x9cb4('0x31')]:_0x1f5671[_0x9cb4('0x2f')];if(!_0x8959e2['query']['hasOwnProperty'](_0x9cb4('0x34'))){_0x2ddfef[_0x9cb4('0x16')]=qs['limit'](_0x8959e2[_0x9cb4('0x30')][_0x9cb4('0x16')]);_0x2ddfef[_0x9cb4('0x15')]=qs[_0x9cb4('0x15')](_0x8959e2[_0x9cb4('0x30')][_0x9cb4('0x15')]);}_0x2ddfef[_0x9cb4('0x35')]=qs[_0x9cb4('0x36')](_0x8959e2[_0x9cb4('0x30')][_0x9cb4('0x36')]);_0x2ddfef[_0x9cb4('0x37')]=qs['filters'](_['pick'](_0x8959e2[_0x9cb4('0x30')],_0x1f5671[_0x9cb4('0x2d')]),_0xc2be0a);if(_0x8959e2['query']['filter']){_0x2ddfef[_0x9cb4('0x37')]=_[_0x9cb4('0x38')](_0x2ddfef[_0x9cb4('0x37')],{'$or':_['map'](_0xc2be0a,function(_0x3290c9){if(_0x3290c9['type']!=='VIRTUAL'){var _0x370ed4={};_0x370ed4[_0x3290c9[_0x9cb4('0x25')]]={'$like':'%'+_0x8959e2[_0x9cb4('0x30')][_0x9cb4('0x39')]+'%'};return _0x370ed4;}})});}_0x2ddfef=_[_0x9cb4('0x38')]({},_0x2ddfef,_0x8959e2['options']);var _0x128dc6={'where':_0x2ddfef['where']};return db['Campaign'][_0x9cb4('0x18')](_0x128dc6)['then'](function(_0x8154ba){_0x3d47aa['count']=_0x8154ba;if(_0x8959e2[_0x9cb4('0x30')][_0x9cb4('0x3a')]){_0x2ddfef[_0x9cb4('0x3b')]=[{'all':!![]}];}return db[_0x9cb4('0x3c')][_0x9cb4('0x3d')](_0x2ddfef);})[_0x9cb4('0x1f')](function(_0x259e2d){_0x3d47aa['rows']=_0x259e2d;return _0x3d47aa;})['then'](respondWithFilteredResult(_0x5529f7,_0x2ddfef))[_0x9cb4('0x3e')](handleError(_0x5529f7,null));};exports['show']=function(_0x45c87a,_0x4181af){var _0x2122ce={'raw':![],'where':{'id':_0x45c87a[_0x9cb4('0x3f')]['id']}},_0x17c3c0={};_0x17c3c0['model']=_[_0x9cb4('0x2c')](db[_0x9cb4('0x3c')][_0x9cb4('0x40')]);_0x17c3c0['query']=_[_0x9cb4('0x2c')](_0x45c87a[_0x9cb4('0x30')]);_0x17c3c0[_0x9cb4('0x2d')]=_[_0x9cb4('0x2e')](_0x17c3c0[_0x9cb4('0x2f')],_0x17c3c0[_0x9cb4('0x30')]);_0x2122ce['attributes']=_['intersection'](_0x17c3c0['model'],qs[_0x9cb4('0x32')](_0x45c87a['query'][_0x9cb4('0x32')]));_0x2122ce[_0x9cb4('0x31')]=_0x2122ce[_0x9cb4('0x31')]['length']?_0x2122ce['attributes']:_0x17c3c0[_0x9cb4('0x2f')];if(_0x45c87a['query']['includeAll']){_0x2122ce['include']=[{'all':!![]}];}_0x2122ce=_[_0x9cb4('0x38')]({},_0x2122ce,_0x45c87a[_0x9cb4('0x41')]);return db[_0x9cb4('0x3c')][_0x9cb4('0x42')](_0x2122ce)[_0x9cb4('0x1f')](handleEntityNotFound(_0x4181af,null))[_0x9cb4('0x1f')](respondWithResult(_0x4181af,null))[_0x9cb4('0x3e')](handleError(_0x4181af,null));};exports[_0x9cb4('0x43')]=function(_0x2b89e8,_0x2537b5){return db['Campaign'][_0x9cb4('0x43')](_0x2b89e8[_0x9cb4('0x44')],{})[_0x9cb4('0x1f')](function(_0x5a3591){var _0x18cb75=_0x2b89e8[_0x9cb4('0x45')][_0x9cb4('0x46')]({'plain':!![]});if(!_0x18cb75)throw new Error(_0x9cb4('0x47'));if(_0x18cb75[_0x9cb4('0x48')]==='user'){var _0x2b7add=_0x5a3591['get']({'plain':!![]});var _0xb1bd11=_0x9cb4('0x21');return db[_0x9cb4('0x49')][_0x9cb4('0x42')]({'where':{'name':_0xb1bd11,'userProfileId':_0x18cb75[_0x9cb4('0x4a')]},'raw':!![]})['then'](function(_0x6f6fc8){if(_0x6f6fc8&&_0x6f6fc8[_0x9cb4('0x4b')]===0x0){return db[_0x9cb4('0x4c')][_0x9cb4('0x43')]({'name':_0x2b7add[_0x9cb4('0x25')],'resourceId':_0x2b7add['id'],'type':_0x6f6fc8[_0x9cb4('0x25')],'sectionId':_0x6f6fc8['id']},{})['then'](function(){return _0x5a3591;});}else{return _0x5a3591;}})['catch'](function(_0x416deb){logger[_0x9cb4('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x416deb);throw _0x416deb;});}return _0x5a3591;})[_0x9cb4('0x1f')](respondWithResult(_0x2537b5,0xc9))[_0x9cb4('0x3e')](handleError(_0x2537b5,null));};exports[_0x9cb4('0x4d')]=function(_0x1c48a6,_0x459dd3){var _0x2bb706={'where':{'id':_0x1c48a6[_0x9cb4('0x3f')]['id']}},_0x47dc70={};_0x47dc70['model']=_[_0x9cb4('0x2c')](db['Campaign'][_0x9cb4('0x40')]);_0x2bb706[_0x9cb4('0x31')]=_[_0x9cb4('0x2e')](_0x47dc70['model'],qs['fields'](_0x1c48a6[_0x9cb4('0x30')]['fields']));_0x2bb706[_0x9cb4('0x31')]=_0x2bb706[_0x9cb4('0x31')][_0x9cb4('0x33')]?_0x2bb706[_0x9cb4('0x31')]:_0x47dc70[_0x9cb4('0x2f')];if(_0x1c48a6['query']['includeAll']){_0x2bb706[_0x9cb4('0x3b')]=[{'all':!![]}];}_0x2bb706=_[_0x9cb4('0x38')]({},_0x2bb706,_0x1c48a6[_0x9cb4('0x41')]);return db[_0x9cb4('0x3c')][_0x9cb4('0x42')](_0x2bb706)['then'](handleEntityNotFound(_0x459dd3,null))['then'](function(_0x4e779f){if(_0x4e779f){var _0x1c6dec=_0x4e779f[_0x9cb4('0x46')]({'plain':!![]});_0x1c6dec=qs[_0x9cb4('0x4e')](_0x1c6dec,['id','createdAt','updatedAt']);_0x1c48a6[_0x9cb4('0x44')]=_[_0x9cb4('0x4e')](_0x1c48a6[_0x9cb4('0x44')],['id','createdAt',_0x9cb4('0x4f')]);return db[_0x9cb4('0x3c')]['create'](_[_0x9cb4('0x38')](_0x1c6dec,_0x1c48a6[_0x9cb4('0x44')]),{'include':_0x1c48a6[_0x9cb4('0x30')][_0x9cb4('0x3a')]?[{'all':!![]}]:undefined})[_0x9cb4('0x1f')](function(_0x1ec64c){var _0x258b48=_0x1c48a6[_0x9cb4('0x45')][_0x9cb4('0x46')]({'plain':!![]});if(!_0x258b48)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x258b48[_0x9cb4('0x48')]===_0x9cb4('0x45')){var _0x4efbaa=_0x1ec64c['get']({'plain':!![]});var _0x177bab=_0x9cb4('0x21');return db[_0x9cb4('0x49')]['find']({'where':{'name':_0x177bab,'userProfileId':_0x258b48[_0x9cb4('0x4a')]},'raw':!![]})[_0x9cb4('0x1f')](function(_0x504c9a){if(_0x504c9a&&_0x504c9a[_0x9cb4('0x4b')]===0x0){return db[_0x9cb4('0x4c')][_0x9cb4('0x43')]({'name':_0x4efbaa[_0x9cb4('0x25')],'resourceId':_0x4efbaa['id'],'type':_0x504c9a[_0x9cb4('0x25')],'sectionId':_0x504c9a['id']},{})['then'](function(){return _0x1ec64c;});}else{return _0x1ec64c;}})['catch'](function(_0x3d9d55){logger['error'](_0x9cb4('0x50'),_0x3d9d55);throw _0x3d9d55;});}return _0x1ec64c;});}})[_0x9cb4('0x1f')](respondWithResult(_0x459dd3,0xc9))[_0x9cb4('0x3e')](handleError(_0x459dd3,null));};exports[_0x9cb4('0x1e')]=function(_0x4a92f3,_0x1fd9e6){if(_0x4a92f3[_0x9cb4('0x44')]['id']){delete _0x4a92f3[_0x9cb4('0x44')]['id'];}return db[_0x9cb4('0x3c')][_0x9cb4('0x42')]({'where':{'id':_0x4a92f3[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x1fd9e6,null))[_0x9cb4('0x1f')](saveUpdates(_0x4a92f3[_0x9cb4('0x44')],null))[_0x9cb4('0x1f')](respondWithResult(_0x1fd9e6,null))['catch'](handleError(_0x1fd9e6,null));};exports[_0x9cb4('0x20')]=function(_0x2b7989,_0x21ae91){return db[_0x9cb4('0x3c')]['find']({'where':{'id':_0x2b7989[_0x9cb4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x21ae91,null))[_0x9cb4('0x1f')](removeEntity(_0x21ae91,null))[_0x9cb4('0x3e')](handleError(_0x21ae91,null));};exports['getHoppers']=function(_0x3a5015,_0x50d853,_0x253d28){var _0x2941df={'raw':!![],'where':{}};var _0x5dfbd1={};var _0x40af33={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3a5015[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x50d853,null))['then'](function(_0x47d96d){if(_0x47d96d){_0x5dfbd1[_0x9cb4('0x2f')]=_[_0x9cb4('0x2c')](db[_0x9cb4('0x51')]['rawAttributes']);_0x5dfbd1[_0x9cb4('0x30')]=_[_0x9cb4('0x2c')](_0x3a5015[_0x9cb4('0x30')]);_0x5dfbd1[_0x9cb4('0x2d')]=_[_0x9cb4('0x2e')](_0x5dfbd1[_0x9cb4('0x2f')],_0x5dfbd1[_0x9cb4('0x30')]);_0x2941df[_0x9cb4('0x31')]=_[_0x9cb4('0x2e')](_0x5dfbd1[_0x9cb4('0x2f')],qs[_0x9cb4('0x32')](_0x3a5015[_0x9cb4('0x30')]['fields']));_0x2941df[_0x9cb4('0x31')]=_0x2941df['attributes']['length']?_0x2941df[_0x9cb4('0x31')]:_0x5dfbd1[_0x9cb4('0x2f')];if(!_0x3a5015[_0x9cb4('0x30')][_0x9cb4('0x52')](_0x9cb4('0x34'))){_0x2941df[_0x9cb4('0x16')]=qs[_0x9cb4('0x16')](_0x3a5015[_0x9cb4('0x30')][_0x9cb4('0x16')]);_0x2941df['offset']=qs[_0x9cb4('0x15')](_0x3a5015[_0x9cb4('0x30')][_0x9cb4('0x15')]);}_0x2941df['order']=qs[_0x9cb4('0x36')](_0x3a5015[_0x9cb4('0x30')][_0x9cb4('0x36')]);_0x2941df[_0x9cb4('0x37')]=qs[_0x9cb4('0x2d')](_[_0x9cb4('0x53')](_0x3a5015[_0x9cb4('0x30')],_0x5dfbd1[_0x9cb4('0x2d')]));_0x2941df['where'][_0x9cb4('0x54')]=_0x47d96d['id'];if(_0x3a5015['query']['filter']){_0x2941df[_0x9cb4('0x37')]=_[_0x9cb4('0x38')](_0x2941df['where'],{'$or':_[_0x9cb4('0x28')](_0x2941df[_0x9cb4('0x31')],function(_0x22507c){var _0xcba21={};_0xcba21[_0x22507c]={'$like':'%'+_0x3a5015['query'][_0x9cb4('0x39')]+'%'};return _0xcba21;})});}_0x2941df=_[_0x9cb4('0x38')]({},_0x2941df,_0x3a5015[_0x9cb4('0x41')]);return db[_0x9cb4('0x51')][_0x9cb4('0x18')]({'where':_0x2941df[_0x9cb4('0x37')]})[_0x9cb4('0x1f')](function(_0x59a5f8){_0x40af33[_0x9cb4('0x18')]=_0x59a5f8;if(_0x3a5015[_0x9cb4('0x30')][_0x9cb4('0x3a')]){_0x2941df[_0x9cb4('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0x9cb4('0x3d')](_0x2941df);})[_0x9cb4('0x1f')](function(_0x56af1c){_0x40af33[_0x9cb4('0x55')]=_0x56af1c;return _0x40af33;});}})[_0x9cb4('0x1f')](respondWithFilteredResult(_0x50d853,_0x2941df))[_0x9cb4('0x3e')](handleError(_0x50d853,null));};exports[_0x9cb4('0x56')]=function(_0x37db01,_0x1e693f,_0x303046){var _0x59d3b5={'raw':!![],'where':{}};var _0x25de0e={};var _0x384559={'count':0x0,'rows':[]};return db[_0x9cb4('0x3c')][_0x9cb4('0x57')]({'where':{'id':_0x37db01[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x1e693f,null))[_0x9cb4('0x1f')](function(_0x389c41){if(_0x389c41){_0x25de0e['model']=_[_0x9cb4('0x2c')](db[_0x9cb4('0x58')][_0x9cb4('0x40')]);_0x25de0e[_0x9cb4('0x30')]=_[_0x9cb4('0x2c')](_0x37db01[_0x9cb4('0x30')]);_0x25de0e[_0x9cb4('0x2d')]=_[_0x9cb4('0x2e')](_0x25de0e[_0x9cb4('0x2f')],_0x25de0e['query']);_0x59d3b5[_0x9cb4('0x31')]=_[_0x9cb4('0x2e')](_0x25de0e[_0x9cb4('0x2f')],qs[_0x9cb4('0x32')](_0x37db01[_0x9cb4('0x30')][_0x9cb4('0x32')]));_0x59d3b5[_0x9cb4('0x31')]=_0x59d3b5[_0x9cb4('0x31')]['length']?_0x59d3b5[_0x9cb4('0x31')]:_0x25de0e[_0x9cb4('0x2f')];if(!_0x37db01[_0x9cb4('0x30')][_0x9cb4('0x52')](_0x9cb4('0x34'))){_0x59d3b5[_0x9cb4('0x16')]=qs[_0x9cb4('0x16')](_0x37db01[_0x9cb4('0x30')][_0x9cb4('0x16')]);_0x59d3b5[_0x9cb4('0x15')]=qs[_0x9cb4('0x15')](_0x37db01[_0x9cb4('0x30')]['offset']);}_0x59d3b5[_0x9cb4('0x35')]=qs['sort'](_0x37db01[_0x9cb4('0x30')][_0x9cb4('0x36')]);_0x59d3b5[_0x9cb4('0x37')]=qs[_0x9cb4('0x2d')](_['pick'](_0x37db01[_0x9cb4('0x30')],_0x25de0e[_0x9cb4('0x2d')]));_0x59d3b5[_0x9cb4('0x37')][_0x9cb4('0x54')]=_0x389c41['id'];if(_0x37db01[_0x9cb4('0x30')]['filter']){_0x59d3b5[_0x9cb4('0x37')]=_[_0x9cb4('0x38')](_0x59d3b5[_0x9cb4('0x37')],{'$or':_['map'](_0x59d3b5['attributes'],function(_0x515d73){var _0x496ab0={};_0x496ab0[_0x515d73]={'$like':'%'+_0x37db01['query'][_0x9cb4('0x39')]+'%'};return _0x496ab0;})});}_0x59d3b5=_['merge']({},_0x59d3b5,_0x37db01[_0x9cb4('0x41')]);return db[_0x9cb4('0x58')][_0x9cb4('0x18')]({'where':_0x59d3b5[_0x9cb4('0x37')]})[_0x9cb4('0x1f')](function(_0x269ca2){_0x384559[_0x9cb4('0x18')]=_0x269ca2;if(_0x37db01[_0x9cb4('0x30')][_0x9cb4('0x3a')]){_0x59d3b5[_0x9cb4('0x3b')]=[{'all':!![]}];}return db[_0x9cb4('0x58')][_0x9cb4('0x3d')](_0x59d3b5);})[_0x9cb4('0x1f')](function(_0x187dd3){_0x384559[_0x9cb4('0x55')]=_0x187dd3;return _0x384559;});}})['then'](respondWithFilteredResult(_0x1e693f,_0x59d3b5))[_0x9cb4('0x3e')](handleError(_0x1e693f,null));};exports['getHopperFinals']=function(_0x3016f5,_0x316263,_0x516ac7){var _0x4be60b={'raw':!![],'where':{}};var _0x241b59={};var _0x347211={'count':0x0,'rows':[]};return db[_0x9cb4('0x3c')][_0x9cb4('0x57')]({'where':{'id':_0x3016f5[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x316263,null))[_0x9cb4('0x1f')](function(_0xf5abe8){if(_0xf5abe8){_0x241b59[_0x9cb4('0x2f')]=_[_0x9cb4('0x2c')](db[_0x9cb4('0x59')][_0x9cb4('0x40')]);_0x241b59[_0x9cb4('0x30')]=_['keys'](_0x3016f5[_0x9cb4('0x30')]);_0x241b59[_0x9cb4('0x2d')]=_[_0x9cb4('0x2e')](_0x241b59['model'],_0x241b59[_0x9cb4('0x30')]);_0x4be60b['attributes']=_['intersection'](_0x241b59[_0x9cb4('0x2f')],qs['fields'](_0x3016f5[_0x9cb4('0x30')][_0x9cb4('0x32')]));_0x4be60b[_0x9cb4('0x31')]=_0x4be60b[_0x9cb4('0x31')][_0x9cb4('0x33')]?_0x4be60b['attributes']:_0x241b59[_0x9cb4('0x2f')];if(!_0x3016f5[_0x9cb4('0x30')][_0x9cb4('0x52')](_0x9cb4('0x34'))){_0x4be60b[_0x9cb4('0x16')]=qs['limit'](_0x3016f5[_0x9cb4('0x30')]['limit']);_0x4be60b[_0x9cb4('0x15')]=qs[_0x9cb4('0x15')](_0x3016f5['query'][_0x9cb4('0x15')]);}_0x4be60b['order']=qs[_0x9cb4('0x36')](_0x3016f5['query'][_0x9cb4('0x36')]);_0x4be60b[_0x9cb4('0x37')]=qs['filters'](_[_0x9cb4('0x53')](_0x3016f5[_0x9cb4('0x30')],_0x241b59[_0x9cb4('0x2d')]));_0x4be60b['where'][_0x9cb4('0x54')]=_0xf5abe8['id'];if(_0x3016f5[_0x9cb4('0x30')][_0x9cb4('0x39')]){_0x4be60b[_0x9cb4('0x37')]=_[_0x9cb4('0x38')](_0x4be60b[_0x9cb4('0x37')],{'$or':_['map'](_0x4be60b[_0x9cb4('0x31')],function(_0x2c7aa0){var _0x17a45d={};_0x17a45d[_0x2c7aa0]={'$like':'%'+_0x3016f5[_0x9cb4('0x30')][_0x9cb4('0x39')]+'%'};return _0x17a45d;})});}_0x4be60b=_[_0x9cb4('0x38')]({},_0x4be60b,_0x3016f5[_0x9cb4('0x41')]);return db[_0x9cb4('0x59')]['count']({'where':_0x4be60b[_0x9cb4('0x37')]})[_0x9cb4('0x1f')](function(_0x1dd074){_0x347211[_0x9cb4('0x18')]=_0x1dd074;if(_0x3016f5[_0x9cb4('0x30')][_0x9cb4('0x3a')]){_0x4be60b[_0x9cb4('0x3b')]=[{'all':!![]}];}return db[_0x9cb4('0x59')][_0x9cb4('0x3d')](_0x4be60b);})['then'](function(_0x2198f7){_0x347211[_0x9cb4('0x55')]=_0x2198f7;return _0x347211;});}})[_0x9cb4('0x1f')](respondWithFilteredResult(_0x316263,_0x4be60b))[_0x9cb4('0x3e')](handleError(_0x316263,null));};exports[_0x9cb4('0x5a')]=function(_0x56d56d,_0x2148ad,_0x53f4eb){var _0x555aea={'raw':!![],'where':{}};var _0x205f78={};var _0x17b469={'count':0x0,'rows':[]};return db[_0x9cb4('0x3c')][_0x9cb4('0x57')]({'where':{'id':_0x56d56d[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x2148ad,null))[_0x9cb4('0x1f')](function(_0x4a8c68){if(_0x4a8c68){_0x205f78[_0x9cb4('0x2f')]=_[_0x9cb4('0x2c')](db[_0x9cb4('0x5b')]['rawAttributes']);_0x205f78['query']=_['keys'](_0x56d56d[_0x9cb4('0x30')]);_0x205f78[_0x9cb4('0x2d')]=_['intersection'](_0x205f78['model'],_0x205f78[_0x9cb4('0x30')]);_0x555aea['attributes']=_[_0x9cb4('0x2e')](_0x205f78[_0x9cb4('0x2f')],qs[_0x9cb4('0x32')](_0x56d56d[_0x9cb4('0x30')][_0x9cb4('0x32')]));_0x555aea[_0x9cb4('0x31')]=_0x555aea[_0x9cb4('0x31')][_0x9cb4('0x33')]?_0x555aea[_0x9cb4('0x31')]:_0x205f78[_0x9cb4('0x2f')];if(!_0x56d56d[_0x9cb4('0x30')]['hasOwnProperty']('nolimit')){_0x555aea[_0x9cb4('0x16')]=qs['limit'](_0x56d56d[_0x9cb4('0x30')][_0x9cb4('0x16')]);_0x555aea[_0x9cb4('0x15')]=qs['offset'](_0x56d56d[_0x9cb4('0x30')][_0x9cb4('0x15')]);}_0x555aea[_0x9cb4('0x35')]=qs[_0x9cb4('0x36')](_0x56d56d[_0x9cb4('0x30')][_0x9cb4('0x36')]);_0x555aea[_0x9cb4('0x37')]=qs[_0x9cb4('0x2d')](_[_0x9cb4('0x53')](_0x56d56d[_0x9cb4('0x30')],_0x205f78[_0x9cb4('0x2d')]));_0x555aea[_0x9cb4('0x37')]['CampaignId']=_0x4a8c68['id'];if(_0x56d56d['query']['filter']){_0x555aea[_0x9cb4('0x37')]=_[_0x9cb4('0x38')](_0x555aea[_0x9cb4('0x37')],{'$or':_[_0x9cb4('0x28')](_0x555aea[_0x9cb4('0x31')],function(_0x57ef36){var _0x2a0e6c={};_0x2a0e6c[_0x57ef36]={'$like':'%'+_0x56d56d['query'][_0x9cb4('0x39')]+'%'};return _0x2a0e6c;})});}_0x555aea=_[_0x9cb4('0x38')]({},_0x555aea,_0x56d56d[_0x9cb4('0x41')]);return db[_0x9cb4('0x5b')]['count']({'where':_0x555aea[_0x9cb4('0x37')]})['then'](function(_0x54bf52){_0x17b469[_0x9cb4('0x18')]=_0x54bf52;if(_0x56d56d[_0x9cb4('0x30')]['includeAll']){_0x555aea[_0x9cb4('0x3b')]=[{'all':!![]}];}return db[_0x9cb4('0x5b')][_0x9cb4('0x3d')](_0x555aea);})[_0x9cb4('0x1f')](function(_0x58a5d5){_0x17b469[_0x9cb4('0x55')]=_0x58a5d5;return _0x17b469;});}})[_0x9cb4('0x1f')](respondWithFilteredResult(_0x2148ad,_0x555aea))[_0x9cb4('0x3e')](handleError(_0x2148ad,null));};exports['getLists']=function(_0x3c8fc6,_0x572ad0,_0x58903a){var _0x5d61c1={};var _0x2b16c7={};var _0x31d43d;var _0x7aaaec;return db[_0x9cb4('0x3c')][_0x9cb4('0x57')]({'where':{'id':_0x3c8fc6[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x572ad0,null))[_0x9cb4('0x1f')](function(_0x5770a2){if(_0x5770a2){_0x31d43d=_0x5770a2;_0x2b16c7[_0x9cb4('0x2f')]=_[_0x9cb4('0x2c')](db['CmList'][_0x9cb4('0x40')]);_0x2b16c7[_0x9cb4('0x30')]=_['keys'](_0x3c8fc6['query']);_0x2b16c7['filters']=_[_0x9cb4('0x2e')](_0x2b16c7['model'],_0x2b16c7['query']);_0x5d61c1[_0x9cb4('0x31')]=_['intersection'](_0x2b16c7[_0x9cb4('0x2f')],qs['fields'](_0x3c8fc6[_0x9cb4('0x30')][_0x9cb4('0x32')]));_0x5d61c1['attributes']=_0x5d61c1[_0x9cb4('0x31')]['length']?_0x5d61c1[_0x9cb4('0x31')]:_0x2b16c7[_0x9cb4('0x2f')];_0x5d61c1['order']=qs['sort'](_0x3c8fc6['query'][_0x9cb4('0x36')]);_0x5d61c1['where']=qs[_0x9cb4('0x2d')](_[_0x9cb4('0x53')](_0x3c8fc6[_0x9cb4('0x30')],_0x2b16c7['filters']));if(_0x3c8fc6[_0x9cb4('0x30')][_0x9cb4('0x39')]){_0x5d61c1['where']=_[_0x9cb4('0x38')](_0x5d61c1[_0x9cb4('0x37')],{'$or':_[_0x9cb4('0x28')](_0x5d61c1[_0x9cb4('0x31')],function(_0x4cfa33){var _0x17f8c1={};_0x17f8c1[_0x4cfa33]={'$like':'%'+_0x3c8fc6['query']['filter']+'%'};return _0x17f8c1;})});}_0x5d61c1=_['merge']({},_0x5d61c1,_0x3c8fc6[_0x9cb4('0x41')]);return _0x31d43d[_0x9cb4('0x5c')](_0x5d61c1);}})[_0x9cb4('0x1f')](function(_0x30c736){if(_0x30c736){_0x7aaaec=_0x30c736[_0x9cb4('0x33')];if(!_0x3c8fc6[_0x9cb4('0x30')][_0x9cb4('0x52')](_0x9cb4('0x34'))){_0x5d61c1[_0x9cb4('0x16')]=qs['limit'](_0x3c8fc6[_0x9cb4('0x30')][_0x9cb4('0x16')]);_0x5d61c1['offset']=qs['offset'](_0x3c8fc6['query'][_0x9cb4('0x15')]);}return _0x31d43d[_0x9cb4('0x5c')](_0x5d61c1);}})[_0x9cb4('0x1f')](function(_0x4d4dd2){if(_0x4d4dd2){return _0x4d4dd2?{'count':_0x7aaaec,'rows':_0x4d4dd2}:null;}})[_0x9cb4('0x1f')](respondWithResult(_0x572ad0,null))[_0x9cb4('0x3e')](handleError(_0x572ad0,null));};exports['addLists']=function(_0x4b0520,_0x13dd92,_0x3fb2a6){var _0x861838,_0x5b3863;var _0x25c554=[];var _0x2188ef=moment()[_0x9cb4('0x5d')](_0x9cb4('0x5e'));return db[_0x9cb4('0x3c')]['find']({'where':{'id':_0x4b0520['params']['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x13dd92,null))['then'](function(_0x2f1edd){if(_0x2f1edd){_0x5b3863=_0x2f1edd;return _0x2f1edd[_0x9cb4('0x5f')](_0x4b0520[_0x9cb4('0x44')]['ids'],_[_0x9cb4('0x4e')](_0x4b0520[_0x9cb4('0x44')],[_0x9cb4('0x60'),'id'])||{});}return null;})[_0x9cb4('0x61')](function(_0x1954a2){var _0x5bcda0;var _0x5d81ee;_0x861838=_0x1954a2||[];var _0x239c84=[];if(_0x1954a2){for(var _0x443fb1=0x0;_0x443fb1<_0x1954a2[_0x9cb4('0x33')];_0x443fb1+=0x1){var _0x2a6b2f=_0x1954a2[_0x443fb1][_0x9cb4('0x46')]({'plain':!![]});_0x5b3863[_0x9cb4('0x62')]=_0x4b0520[_0x9cb4('0x44')]['dialCheckDuplicateType']?_0x4b0520[_0x9cb4('0x44')][_0x9cb4('0x62')]:_0x5b3863[_0x9cb4('0x62')];switch(_0x5b3863[_0x9cb4('0x62')]){case _0x9cb4('0x63'):_0x5bcda0=squel[_0x9cb4('0x64')]()['into'](_0x9cb4('0x65'))[_0x9cb4('0x66')]([_0x9cb4('0x67'),_0x9cb4('0x68'),_0x9cb4('0x69'),_0x9cb4('0x6a'),_0x9cb4('0x54'),_0x9cb4('0x6b'),_0x9cb4('0x4f')],squel['select']()[_0x9cb4('0x6c')](_0x9cb4('0x67'),_0x9cb4('0x67'))['field'](_0x9cb4('0x6d'),_0x9cb4('0x68'))['field']('id','ContactId')[_0x9cb4('0x6c')](_0x2a6b2f[_0x9cb4('0x6e')][_0x9cb4('0x6f')](),_0x9cb4('0x6a'))[_0x9cb4('0x6c')](_0x4b0520[_0x9cb4('0x3f')]['id']['toString'](),'CampaignId')[_0x9cb4('0x6c')]('\x27'+_0x2188ef+'\x27',_0x9cb4('0x6b'))['field']('\x27'+_0x2188ef+'\x27',_0x9cb4('0x4f'))['from'](_0x9cb4('0x70'))['where'](_0x9cb4('0x71'))['where'](_0x9cb4('0x72'),_0x2a6b2f[_0x9cb4('0x6e')][_0x9cb4('0x6f')]())[_0x9cb4('0x37')](_0x9cb4('0x73'))[_0x9cb4('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9cb4('0x74')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x9cb4('0x75')](_0x9cb4('0x76'))[_0x9cb4('0x37')](_0x9cb4('0x77'),_0x4b0520[_0x9cb4('0x3f')]['id']['toString']()))['where'](_0x9cb4('0x78'),squel[_0x9cb4('0x74')]()[_0x9cb4('0x6c')](_0x9cb4('0x79'))[_0x9cb4('0x75')]('cm_hopper')['where'](_0x9cb4('0x77'),_0x4b0520[_0x9cb4('0x3f')]['id'][_0x9cb4('0x6f')]())))[_0x9cb4('0x6f')]();break;case _0x9cb4('0x7a'):_0x5bcda0=squel[_0x9cb4('0x64')]()[_0x9cb4('0x7b')](_0x9cb4('0x65'))[_0x9cb4('0x66')](['phone','scheduledAt','ContactId','ListId',_0x9cb4('0x54'),'createdAt',_0x9cb4('0x4f')],squel[_0x9cb4('0x74')]()[_0x9cb4('0x6c')](_0x9cb4('0x67'),_0x9cb4('0x67'))[_0x9cb4('0x6c')](_0x9cb4('0x6d'),'scheduledAt')[_0x9cb4('0x6c')]('id','ContactId')[_0x9cb4('0x6c')](_0x2a6b2f[_0x9cb4('0x6e')]['toString'](),_0x9cb4('0x6a'))['field'](_0x4b0520[_0x9cb4('0x3f')]['id'][_0x9cb4('0x6f')](),_0x9cb4('0x54'))[_0x9cb4('0x6c')]('\x27'+_0x2188ef+'\x27',_0x9cb4('0x6b'))[_0x9cb4('0x6c')]('\x27'+_0x2188ef+'\x27',_0x9cb4('0x4f'))[_0x9cb4('0x75')](_0x9cb4('0x70'))[_0x9cb4('0x37')](_0x9cb4('0x71'))['where']('ListId\x20=\x20?',_0x2a6b2f[_0x9cb4('0x6e')][_0x9cb4('0x6f')]())[_0x9cb4('0x37')](_0x9cb4('0x73'))[_0x9cb4('0x37')](_0x9cb4('0x78'),squel[_0x9cb4('0x74')]()[_0x9cb4('0x6c')](_0x9cb4('0x79'))[_0x9cb4('0x75')](_0x9cb4('0x65'))[_0x9cb4('0x37')](_0x9cb4('0x77'),_0x4b0520[_0x9cb4('0x3f')]['id'][_0x9cb4('0x6f')]())))['toString']();break;default:_0x5bcda0=squel[_0x9cb4('0x64')]()[_0x9cb4('0x7b')](_0x9cb4('0x65'))['fromQuery'](['phone',_0x9cb4('0x68'),'ContactId',_0x9cb4('0x6a'),_0x9cb4('0x54'),_0x9cb4('0x6b'),'updatedAt'],squel[_0x9cb4('0x74')]()['field']('phone','phone')['field']('NOW()',_0x9cb4('0x68'))[_0x9cb4('0x6c')]('id',_0x9cb4('0x69'))['field'](_0x2a6b2f['CmListId'][_0x9cb4('0x6f')](),_0x9cb4('0x6a'))[_0x9cb4('0x6c')](_0x4b0520[_0x9cb4('0x3f')]['id'][_0x9cb4('0x6f')](),'CampaignId')[_0x9cb4('0x6c')]('\x27'+_0x2188ef+'\x27',_0x9cb4('0x6b'))[_0x9cb4('0x6c')]('\x27'+_0x2188ef+'\x27',_0x9cb4('0x4f'))['from']('cm_contacts')[_0x9cb4('0x37')](_0x9cb4('0x71'))[_0x9cb4('0x37')](_0x9cb4('0x72'),_0x2a6b2f['CmListId'][_0x9cb4('0x6f')]())[_0x9cb4('0x37')]('phone\x20IS\x20NOT\x20NULL'))[_0x9cb4('0x6f')]();}_0x5d81ee=squel[_0x9cb4('0x64')]()[_0x9cb4('0x7b')](_0x9cb4('0x7c'))['fromQuery']([_0x9cb4('0x7d'),_0x9cb4('0x68'),_0x9cb4('0x67'),_0x9cb4('0x7e'),'createdAt','updatedAt'],squel[_0x9cb4('0x74')]()[_0x9cb4('0x6c')](_0x9cb4('0x7f'),'id')[_0x9cb4('0x6c')](_0x9cb4('0x6d'),_0x9cb4('0x68'))[_0x9cb4('0x6c')](_0x9cb4('0x80'),'phone')['field'](_0x9cb4('0x81'),_0x9cb4('0x7e'))[_0x9cb4('0x6c')]('\x27'+_0x2188ef+'\x27',_0x9cb4('0x6b'))[_0x9cb4('0x6c')]('\x27'+_0x2188ef+'\x27','updatedAt')[_0x9cb4('0x75')](_0x9cb4('0x82'),'ci')['join'](_0x9cb4('0x65'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x9cb4('0x37')](_0x9cb4('0x83'),_0x2a6b2f[_0x9cb4('0x6e')][_0x9cb4('0x6f')]())[_0x9cb4('0x37')](_0x9cb4('0x84'),_0x4b0520[_0x9cb4('0x3f')]['id'][_0x9cb4('0x6f')]())[_0x9cb4('0x37')](_0x9cb4('0x85'),_0x2188ef))[_0x9cb4('0x6f')]();_0x239c84[_0x9cb4('0x86')](db[_0x9cb4('0x87')][_0x9cb4('0x30')](_0x5bcda0));_0x25c554[_0x9cb4('0x86')](db[_0x9cb4('0x87')][_0x9cb4('0x30')](_0x5d81ee));}return BPromise[_0x9cb4('0x88')](_0x239c84);}})['then'](function(){return BPromise['all'](_0x25c554);})[_0x9cb4('0x1f')](function(){return _0x861838;})[_0x9cb4('0x1f')](respondWithResult(_0x13dd92,null))['catch'](handleError(_0x13dd92,null));};exports[_0x9cb4('0x89')]=function(_0x3638ad,_0x865972,_0x27df73){return db[_0x9cb4('0x3c')][_0x9cb4('0x42')]({'where':{'id':_0x3638ad[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x865972,null))['then'](function(_0xa55e0a){if(_0xa55e0a){return _0xa55e0a[_0x9cb4('0x89')](_0x3638ad[_0x9cb4('0x30')][_0x9cb4('0x60')]);}})['then'](function(_0x372a77){if(_0x372a77){return db[_0x9cb4('0x51')]['destroy']({'where':{'ListId':_0x3638ad['query'][_0x9cb4('0x60')],'CampaignId':_0x3638ad[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](function(){return _0x372a77;});}})[_0x9cb4('0x1f')](respondWithStatusCode(_0x865972,null))[_0x9cb4('0x3e')](handleError(_0x865972,null));};exports[_0x9cb4('0x8a')]=function(_0x2d0eff,_0xdb342,_0x4535cb){var _0x138ad5={};var _0x57ab0d={};var _0x25f630;var _0x44f089;return db[_0x9cb4('0x3c')][_0x9cb4('0x57')]({'where':{'id':_0x2d0eff['params']['id']}})['then'](handleEntityNotFound(_0xdb342,null))['then'](function(_0x5a8560){if(_0x5a8560){_0x25f630=_0x5a8560;_0x57ab0d[_0x9cb4('0x2f')]=_[_0x9cb4('0x2c')](db[_0x9cb4('0x8b')][_0x9cb4('0x40')]);_0x57ab0d[_0x9cb4('0x30')]=_[_0x9cb4('0x2c')](_0x2d0eff[_0x9cb4('0x30')]);_0x57ab0d[_0x9cb4('0x2d')]=_['intersection'](_0x57ab0d[_0x9cb4('0x2f')],_0x57ab0d['query']);_0x138ad5[_0x9cb4('0x31')]=_[_0x9cb4('0x2e')](_0x57ab0d[_0x9cb4('0x2f')],qs[_0x9cb4('0x32')](_0x2d0eff['query']['fields']));_0x138ad5[_0x9cb4('0x31')]=_0x138ad5[_0x9cb4('0x31')][_0x9cb4('0x33')]?_0x138ad5[_0x9cb4('0x31')]:_0x57ab0d[_0x9cb4('0x2f')];_0x138ad5[_0x9cb4('0x35')]=qs[_0x9cb4('0x36')](_0x2d0eff[_0x9cb4('0x30')][_0x9cb4('0x36')]);_0x138ad5[_0x9cb4('0x37')]=qs[_0x9cb4('0x2d')](_['pick'](_0x2d0eff[_0x9cb4('0x30')],_0x57ab0d['filters']));if(_0x2d0eff[_0x9cb4('0x30')][_0x9cb4('0x39')]){_0x138ad5[_0x9cb4('0x37')]=_[_0x9cb4('0x38')](_0x138ad5[_0x9cb4('0x37')],{'$or':_[_0x9cb4('0x28')](_0x138ad5['attributes'],function(_0x58e43c){var _0x370bcd={};_0x370bcd[_0x58e43c]={'$like':'%'+_0x2d0eff[_0x9cb4('0x30')][_0x9cb4('0x39')]+'%'};return _0x370bcd;})});}_0x138ad5=_[_0x9cb4('0x38')]({},_0x138ad5,_0x2d0eff['options']);return _0x25f630[_0x9cb4('0x8a')](_0x138ad5);}})['then'](function(_0x5a575a){if(_0x5a575a){_0x44f089=_0x5a575a[_0x9cb4('0x33')];if(!_0x2d0eff[_0x9cb4('0x30')][_0x9cb4('0x52')](_0x9cb4('0x34'))){_0x138ad5[_0x9cb4('0x16')]=qs['limit'](_0x2d0eff[_0x9cb4('0x30')][_0x9cb4('0x16')]);_0x138ad5[_0x9cb4('0x15')]=qs['offset'](_0x2d0eff[_0x9cb4('0x30')][_0x9cb4('0x15')]);}return _0x25f630[_0x9cb4('0x8a')](_0x138ad5);}})[_0x9cb4('0x1f')](function(_0x24fb89){if(_0x24fb89){return _0x24fb89?{'count':_0x44f089,'rows':_0x24fb89}:null;}})[_0x9cb4('0x1f')](respondWithResult(_0xdb342,null))[_0x9cb4('0x3e')](handleError(_0xdb342,null));};exports['addBlackLists']=function(_0x503c55,_0x3874af,_0x1872ed){var _0xe9a8c,_0x3cf5a1;var _0x46b6f3=[];var _0x201de4=moment()[_0x9cb4('0x5d')](_0x9cb4('0x5e'));return db['Campaign'][_0x9cb4('0x42')]({'where':{'id':_0x503c55[_0x9cb4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3874af,null))[_0x9cb4('0x1f')](function(_0x16b4b7){if(_0x16b4b7){_0x3cf5a1=_0x16b4b7;return _0x16b4b7[_0x9cb4('0x8c')](_0x503c55[_0x9cb4('0x44')][_0x9cb4('0x60')],_[_0x9cb4('0x4e')](_0x503c55['body'],[_0x9cb4('0x60'),'id'])||{});}return null;})[_0x9cb4('0x61')](function(_0x47268a){var _0x377160;var _0x55fd5a;_0xe9a8c=_0x47268a||[];var _0x174901=[];if(_0x47268a){for(var _0x3f9630=0x0;_0x3f9630<_0x47268a[_0x9cb4('0x33')];_0x3f9630+=0x1){var _0x3055e7=_0x47268a[_0x3f9630][_0x9cb4('0x46')]({'plain':!![]});_0x377160=squel[_0x9cb4('0x64')]()[_0x9cb4('0x7b')](_0x9cb4('0x8d'))['fromQuery']([_0x9cb4('0x67'),_0x9cb4('0x69'),_0x9cb4('0x6a'),'CampaignId',_0x9cb4('0x6b'),_0x9cb4('0x4f')],squel[_0x9cb4('0x74')]()[_0x9cb4('0x6c')](_0x9cb4('0x67'),_0x9cb4('0x67'))[_0x9cb4('0x6c')]('id',_0x9cb4('0x69'))['field'](_0x3055e7['CmListId'][_0x9cb4('0x6f')](),_0x9cb4('0x6a'))[_0x9cb4('0x6c')](_0x503c55[_0x9cb4('0x3f')]['id'][_0x9cb4('0x6f')](),_0x9cb4('0x54'))[_0x9cb4('0x6c')](_0x9cb4('0x6d'),_0x9cb4('0x6b'))[_0x9cb4('0x6c')](_0x9cb4('0x6d'),_0x9cb4('0x4f'))[_0x9cb4('0x75')](_0x9cb4('0x70'))['where']('deletedAt\x20IS\x20NULL')[_0x9cb4('0x37')](_0x9cb4('0x72'),_0x3055e7[_0x9cb4('0x6e')][_0x9cb4('0x6f')]())[_0x9cb4('0x37')](_0x9cb4('0x73')))[_0x9cb4('0x6f')]();_0x174901[_0x9cb4('0x86')](db[_0x9cb4('0x87')][_0x9cb4('0x30')](_0x377160));}return BPromise[_0x9cb4('0x88')](_0x174901);}})[_0x9cb4('0x1f')](function(){return _0xe9a8c;})[_0x9cb4('0x1f')](respondWithResult(_0x3874af,null))[_0x9cb4('0x3e')](handleError(_0x3874af,null));};exports['removeBlackLists']=function(_0x20c5bd,_0x5e7325,_0x13f7a9){return db[_0x9cb4('0x3c')][_0x9cb4('0x42')]({'where':{'id':_0x20c5bd[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](handleEntityNotFound(_0x5e7325,null))[_0x9cb4('0x1f')](function(_0x30fea4){if(_0x30fea4){return _0x30fea4[_0x9cb4('0x8e')](_0x20c5bd[_0x9cb4('0x30')][_0x9cb4('0x60')]);}})[_0x9cb4('0x1f')](function(_0x3f3190){if(_0x3f3190){return db['CmHopperBlack'][_0x9cb4('0x20')]({'where':{'ListId':_0x20c5bd['query'][_0x9cb4('0x60')],'CampaignId':_0x20c5bd[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x1f')](function(){return _0x3f3190;});}})['then'](respondWithStatusCode(_0x5e7325,null))[_0x9cb4('0x3e')](handleError(_0x5e7325,null));};
\ No newline at end of file
+var _0x3eae=['util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','IvrCampaigns','end','error','stack','name','send','index','map','Campaign','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','order','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x215e4e,_0x206bbb){var _0x4b47d4=function(_0x5827d9){while(--_0x5827d9){_0x215e4e['push'](_0x215e4e['shift']());}};_0x4b47d4(++_0x206bbb);}(_0x3eae,0x126));var _0xe3ea=function(_0x414655,_0x79d916){_0x414655=_0x414655-0x0;var _0x237884=_0x3eae[_0x414655];return _0x237884;};'use strict';var emlformat=require(_0xe3ea('0x0'));var rimraf=require(_0xe3ea('0x1'));var zipdir=require(_0xe3ea('0x2'));var jsonpatch=require(_0xe3ea('0x3'));var rp=require('request-promise');var moment=require(_0xe3ea('0x4'));var BPromise=require(_0xe3ea('0x5'));var Mustache=require('mustache');var util=require(_0xe3ea('0x6'));var path=require(_0xe3ea('0x7'));var sox=require(_0xe3ea('0x8'));var csv=require('to-csv');var ejs=require(_0xe3ea('0x9'));var fs=require('fs');var fs_extra=require(_0xe3ea('0xa'));var _=require(_0xe3ea('0xb'));var squel=require(_0xe3ea('0xc'));var crypto=require(_0xe3ea('0xd'));var jsforce=require(_0xe3ea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe3ea('0xf'));var querystring=require(_0xe3ea('0x10'));var Papa=require('papaparse');var Redis=require(_0xe3ea('0x11'));var authService=require(_0xe3ea('0x12'));var qs=require(_0xe3ea('0x13'));var as=require(_0xe3ea('0x14'));var hardwareService=require(_0xe3ea('0x15'));var logger=require('../../config/logger')(_0xe3ea('0x16'));var utils=require(_0xe3ea('0x17'));var config=require(_0xe3ea('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3ea('0x19'))['db'];function respondWithStatusCode(_0x3fa991,_0x470912){_0x470912=_0x470912||0xcc;return function(_0x1312e0){if(_0x1312e0){return _0x3fa991[_0xe3ea('0x1a')](_0x470912);}return _0x3fa991[_0xe3ea('0x1b')](_0x470912)['end']();};}function respondWithResult(_0x544dfe,_0x1701d3){_0x1701d3=_0x1701d3||0xc8;return function(_0x335689){if(_0x335689){return _0x544dfe[_0xe3ea('0x1b')](_0x1701d3)[_0xe3ea('0x1c')](_0x335689);}};}function respondWithFilteredResult(_0x45ba02,_0x4ac0ea){return function(_0x4c92b2){if(_0x4c92b2){var _0x27885e=typeof _0x4ac0ea[_0xe3ea('0x1d')]==='undefined'&&typeof _0x4ac0ea[_0xe3ea('0x1e')]===_0xe3ea('0x1f');var _0x4af35e=_0x4c92b2['count'];var _0x2af916=_0x27885e?0x0:_0x4ac0ea[_0xe3ea('0x1d')];var _0x417b88=_0x27885e?_0x4c92b2[_0xe3ea('0x20')]:_0x4ac0ea[_0xe3ea('0x1d')]+_0x4ac0ea[_0xe3ea('0x1e')];var _0x4d611a;if(_0x417b88>=_0x4af35e){_0x417b88=_0x4af35e;_0x4d611a=0xc8;}else{_0x4d611a=0xce;}_0x45ba02['status'](_0x4d611a);return _0x45ba02[_0xe3ea('0x21')]('Content-Range',_0x2af916+'-'+_0x417b88+'/'+_0x4af35e)['json'](_0x4c92b2);}return null;};}function patchUpdates(_0xcbb4db){return function(_0xe8e88){try{jsonpatch[_0xe3ea('0x22')](_0xe8e88,_0xcbb4db,!![]);}catch(_0x181720){return BPromise[_0xe3ea('0x23')](_0x181720);}return _0xe8e88[_0xe3ea('0x24')]();};}function saveUpdates(_0x161c0e,_0x2f763b){return function(_0x342192){if(_0x342192){return _0x342192[_0xe3ea('0x25')](_0x161c0e)[_0xe3ea('0x26')](function(_0x37be78){return _0x37be78;});}return null;};}function removeEntity(_0x196fac,_0x580da3){return function(_0x3f728c){if(_0x3f728c){return _0x3f728c[_0xe3ea('0x27')]()[_0xe3ea('0x26')](function(){var _0x21082d=_0x3f728c[_0xe3ea('0x28')]({'plain':!![]});var _0x3c7131=_0xe3ea('0x29');return db['UserProfileResource'][_0xe3ea('0x27')]({'where':{'type':_0x3c7131,'resourceId':_0x21082d['id']}})[_0xe3ea('0x26')](function(){return _0x3f728c;});})['then'](function(){_0x196fac[_0xe3ea('0x1b')](0xcc)[_0xe3ea('0x2a')]();});}};}function handleEntityNotFound(_0x218dcb,_0x30c2be){return function(_0x54bc71){if(!_0x54bc71){_0x218dcb['sendStatus'](0x194);}return _0x54bc71;};}function handleError(_0x3e9c65,_0x4df0aa){_0x4df0aa=_0x4df0aa||0x1f4;return function(_0x3032b1){logger[_0xe3ea('0x2b')](_0x3032b1[_0xe3ea('0x2c')]);if(_0x3032b1['name']){delete _0x3032b1[_0xe3ea('0x2d')];}_0x3e9c65['status'](_0x4df0aa)[_0xe3ea('0x2e')](_0x3032b1);};}exports[_0xe3ea('0x2f')]=function(_0x45a01b,_0x530948){var _0x451cfe={},_0x56be4a={},_0x264e44={'count':0x0,'rows':[]};var _0x1f4685=_[_0xe3ea('0x30')](db[_0xe3ea('0x31')]['rawAttributes'],function(_0x4bf1fa){return{'name':_0x4bf1fa[_0xe3ea('0x32')],'type':_0x4bf1fa[_0xe3ea('0x33')][_0xe3ea('0x34')]};});_0x56be4a[_0xe3ea('0x35')]=_[_0xe3ea('0x30')](_0x1f4685,'name');_0x56be4a[_0xe3ea('0x36')]=_['keys'](_0x45a01b['query']);_0x56be4a[_0xe3ea('0x37')]=_[_0xe3ea('0x38')](_0x56be4a['model'],_0x56be4a['query']);_0x451cfe[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x56be4a[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x3a')]));_0x451cfe['attributes']=_0x451cfe[_0xe3ea('0x39')][_0xe3ea('0x3b')]?_0x451cfe[_0xe3ea('0x39')]:_0x56be4a[_0xe3ea('0x35')];if(!_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x451cfe[_0xe3ea('0x1e')]=qs[_0xe3ea('0x1e')](_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x1e')]);_0x451cfe[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x45a01b[_0xe3ea('0x36')]['offset']);}_0x451cfe['order']=qs[_0xe3ea('0x3e')](_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x3e')]);_0x451cfe['where']=qs[_0xe3ea('0x37')](_[_0xe3ea('0x3f')](_0x45a01b[_0xe3ea('0x36')],_0x56be4a[_0xe3ea('0x37')]),_0x1f4685);if(_0x45a01b[_0xe3ea('0x36')]['filter']){_0x451cfe[_0xe3ea('0x40')]=_['merge'](_0x451cfe['where'],{'$or':_[_0xe3ea('0x30')](_0x1f4685,function(_0xc675ce){if(_0xc675ce[_0xe3ea('0x33')]!==_0xe3ea('0x41')){var _0x235a64={};_0x235a64[_0xc675ce[_0xe3ea('0x2d')]]={'$like':'%'+_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x42')]+'%'};return _0x235a64;}})});}_0x451cfe=_['merge']({},_0x451cfe,_0x45a01b['options']);var _0x2f5533={'where':_0x451cfe[_0xe3ea('0x40')]};return db[_0xe3ea('0x31')]['count'](_0x2f5533)[_0xe3ea('0x26')](function(_0x58df4e){_0x264e44[_0xe3ea('0x20')]=_0x58df4e;if(_0x45a01b[_0xe3ea('0x36')]['includeAll']){_0x451cfe['include']=[{'all':!![]}];}return db[_0xe3ea('0x31')][_0xe3ea('0x43')](_0x451cfe);})[_0xe3ea('0x26')](function(_0x5d18ec){_0x264e44[_0xe3ea('0x44')]=_0x5d18ec;return _0x264e44;})['then'](respondWithFilteredResult(_0x530948,_0x451cfe))[_0xe3ea('0x45')](handleError(_0x530948,null));};exports[_0xe3ea('0x46')]=function(_0x4c3f20,_0x34fd9c){var _0x536d73={'raw':![],'where':{'id':_0x4c3f20[_0xe3ea('0x47')]['id']}},_0x4fa668={};_0x4fa668[_0xe3ea('0x35')]=_[_0xe3ea('0x48')](db[_0xe3ea('0x31')][_0xe3ea('0x49')]);_0x4fa668[_0xe3ea('0x36')]=_[_0xe3ea('0x48')](_0x4c3f20['query']);_0x4fa668[_0xe3ea('0x37')]=_[_0xe3ea('0x38')](_0x4fa668['model'],_0x4fa668[_0xe3ea('0x36')]);_0x536d73[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x4fa668[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x4c3f20['query'][_0xe3ea('0x3a')]));_0x536d73[_0xe3ea('0x39')]=_0x536d73[_0xe3ea('0x39')]['length']?_0x536d73['attributes']:_0x4fa668['model'];if(_0x4c3f20[_0xe3ea('0x36')][_0xe3ea('0x4a')]){_0x536d73['include']=[{'all':!![]}];}_0x536d73=_[_0xe3ea('0x4b')]({},_0x536d73,_0x4c3f20[_0xe3ea('0x4c')]);return db[_0xe3ea('0x31')][_0xe3ea('0x4d')](_0x536d73)[_0xe3ea('0x26')](handleEntityNotFound(_0x34fd9c,null))[_0xe3ea('0x26')](respondWithResult(_0x34fd9c,null))['catch'](handleError(_0x34fd9c,null));};exports[_0xe3ea('0x4e')]=function(_0x4d71a9,_0x3b9e62){return db['Campaign'][_0xe3ea('0x4e')](_0x4d71a9[_0xe3ea('0x4f')],{})['then'](function(_0xb69b73){var _0x3263ea=_0x4d71a9[_0xe3ea('0x50')][_0xe3ea('0x28')]({'plain':!![]});if(!_0x3263ea)throw new Error(_0xe3ea('0x51'));if(_0x3263ea[_0xe3ea('0x52')]===_0xe3ea('0x50')){var _0x41c1a7=_0xb69b73[_0xe3ea('0x28')]({'plain':!![]});var _0x4008e6=_0xe3ea('0x29');return db[_0xe3ea('0x53')][_0xe3ea('0x4d')]({'where':{'name':_0x4008e6,'userProfileId':_0x3263ea['userProfileId']},'raw':!![]})[_0xe3ea('0x26')](function(_0x348939){if(_0x348939&&_0x348939['autoAssociation']===0x0){return db[_0xe3ea('0x54')][_0xe3ea('0x4e')]({'name':_0x41c1a7[_0xe3ea('0x2d')],'resourceId':_0x41c1a7['id'],'type':_0x348939[_0xe3ea('0x2d')],'sectionId':_0x348939['id']},{})[_0xe3ea('0x26')](function(){return _0xb69b73;});}else{return _0xb69b73;}})[_0xe3ea('0x45')](function(_0x2a39fa){logger['error'](_0xe3ea('0x55'),_0x2a39fa);throw _0x2a39fa;});}return _0xb69b73;})[_0xe3ea('0x26')](respondWithResult(_0x3b9e62,0xc9))[_0xe3ea('0x45')](handleError(_0x3b9e62,null));};exports[_0xe3ea('0x56')]=function(_0x3ff403,_0x11cef2){var _0x29b170={'where':{'id':_0x3ff403[_0xe3ea('0x47')]['id']}},_0x3742ab={};_0x3742ab['model']=_['keys'](db[_0xe3ea('0x31')][_0xe3ea('0x49')]);_0x29b170[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x3742ab[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x3ff403[_0xe3ea('0x36')][_0xe3ea('0x3a')]));_0x29b170[_0xe3ea('0x39')]=_0x29b170['attributes'][_0xe3ea('0x3b')]?_0x29b170[_0xe3ea('0x39')]:_0x3742ab[_0xe3ea('0x35')];if(_0x3ff403['query'][_0xe3ea('0x4a')]){_0x29b170[_0xe3ea('0x57')]=[{'all':!![]}];}_0x29b170=_['merge']({},_0x29b170,_0x3ff403[_0xe3ea('0x4c')]);return db[_0xe3ea('0x31')][_0xe3ea('0x4d')](_0x29b170)[_0xe3ea('0x26')](handleEntityNotFound(_0x11cef2,null))['then'](function(_0xf41294){if(_0xf41294){var _0x21240c=_0xf41294[_0xe3ea('0x28')]({'plain':!![]});_0x21240c=qs[_0xe3ea('0x58')](_0x21240c,['id','createdAt','updatedAt']);_0x3ff403[_0xe3ea('0x4f')]=_[_0xe3ea('0x58')](_0x3ff403[_0xe3ea('0x4f')],['id',_0xe3ea('0x59'),_0xe3ea('0x5a')]);return db[_0xe3ea('0x31')][_0xe3ea('0x4e')](_['merge'](_0x21240c,_0x3ff403['body']),{'include':_0x3ff403[_0xe3ea('0x36')][_0xe3ea('0x4a')]?[{'all':!![]}]:undefined})[_0xe3ea('0x26')](function(_0x28121f){var _0x5abbd9=_0x3ff403[_0xe3ea('0x50')][_0xe3ea('0x28')]({'plain':!![]});if(!_0x5abbd9)throw new Error(_0xe3ea('0x51'));if(_0x5abbd9['role']===_0xe3ea('0x50')){var _0x1e9f1e=_0x28121f['get']({'plain':!![]});var _0x4df5ac='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x4df5ac,'userProfileId':_0x5abbd9[_0xe3ea('0x5b')]},'raw':!![]})[_0xe3ea('0x26')](function(_0x3d14be){if(_0x3d14be&&_0x3d14be[_0xe3ea('0x5c')]===0x0){return db[_0xe3ea('0x54')]['create']({'name':_0x1e9f1e[_0xe3ea('0x2d')],'resourceId':_0x1e9f1e['id'],'type':_0x3d14be['name'],'sectionId':_0x3d14be['id']},{})[_0xe3ea('0x26')](function(){return _0x28121f;});}else{return _0x28121f;}})[_0xe3ea('0x45')](function(_0x53dd48){logger[_0xe3ea('0x2b')](_0xe3ea('0x55'),_0x53dd48);throw _0x53dd48;});}return _0x28121f;});}})['then'](respondWithResult(_0x11cef2,0xc9))[_0xe3ea('0x45')](handleError(_0x11cef2,null));};exports[_0xe3ea('0x25')]=function(_0x3179e4,_0x5a7222){if(_0x3179e4[_0xe3ea('0x4f')]['id']){delete _0x3179e4[_0xe3ea('0x4f')]['id'];}return db[_0xe3ea('0x31')][_0xe3ea('0x4d')]({'where':{'id':_0x3179e4[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x5a7222,null))[_0xe3ea('0x26')](saveUpdates(_0x3179e4[_0xe3ea('0x4f')],null))[_0xe3ea('0x26')](respondWithResult(_0x5a7222,null))[_0xe3ea('0x45')](handleError(_0x5a7222,null));};exports['destroy']=function(_0x33d7f8,_0x137ade){return db[_0xe3ea('0x31')][_0xe3ea('0x4d')]({'where':{'id':_0x33d7f8[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x137ade,null))[_0xe3ea('0x26')](removeEntity(_0x137ade,null))[_0xe3ea('0x45')](handleError(_0x137ade,null));};exports[_0xe3ea('0x5d')]=function(_0x30d733,_0x4a7882,_0x372ff5){var _0x3007a5={'raw':!![],'where':{}};var _0x4cb1c3={};var _0x4b9b1a={'count':0x0,'rows':[]};return db[_0xe3ea('0x31')][_0xe3ea('0x5e')]({'where':{'id':_0x30d733[_0xe3ea('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a7882,null))[_0xe3ea('0x26')](function(_0x460cd3){if(_0x460cd3){_0x4cb1c3[_0xe3ea('0x35')]=_['keys'](db[_0xe3ea('0x5f')][_0xe3ea('0x49')]);_0x4cb1c3['query']=_['keys'](_0x30d733[_0xe3ea('0x36')]);_0x4cb1c3[_0xe3ea('0x37')]=_[_0xe3ea('0x38')](_0x4cb1c3[_0xe3ea('0x35')],_0x4cb1c3[_0xe3ea('0x36')]);_0x3007a5[_0xe3ea('0x39')]=_['intersection'](_0x4cb1c3['model'],qs[_0xe3ea('0x3a')](_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x3a')]));_0x3007a5[_0xe3ea('0x39')]=_0x3007a5[_0xe3ea('0x39')][_0xe3ea('0x3b')]?_0x3007a5[_0xe3ea('0x39')]:_0x4cb1c3[_0xe3ea('0x35')];if(!_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x3007a5[_0xe3ea('0x1e')]=qs[_0xe3ea('0x1e')](_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x1e')]);_0x3007a5[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x30d733['query'][_0xe3ea('0x1d')]);}_0x3007a5[_0xe3ea('0x60')]=qs[_0xe3ea('0x3e')](_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x3e')]);_0x3007a5[_0xe3ea('0x40')]=qs[_0xe3ea('0x37')](_['pick'](_0x30d733['query'],_0x4cb1c3[_0xe3ea('0x37')]));_0x3007a5[_0xe3ea('0x40')]['CampaignId']=_0x460cd3['id'];if(_0x30d733['query'][_0xe3ea('0x42')]){_0x3007a5[_0xe3ea('0x40')]=_['merge'](_0x3007a5['where'],{'$or':_['map'](_0x3007a5[_0xe3ea('0x39')],function(_0x3cabcb){var _0x4ccee8={};_0x4ccee8[_0x3cabcb]={'$like':'%'+_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x42')]+'%'};return _0x4ccee8;})});}_0x3007a5=_[_0xe3ea('0x4b')]({},_0x3007a5,_0x30d733['options']);return db[_0xe3ea('0x5f')][_0xe3ea('0x20')]({'where':_0x3007a5[_0xe3ea('0x40')]})['then'](function(_0x506491){_0x4b9b1a[_0xe3ea('0x20')]=_0x506491;if(_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x4a')]){_0x3007a5['include']=[{'all':!![]}];}return db[_0xe3ea('0x5f')][_0xe3ea('0x43')](_0x3007a5);})[_0xe3ea('0x26')](function(_0x49143d){_0x4b9b1a['rows']=_0x49143d;return _0x4b9b1a;});}})[_0xe3ea('0x26')](respondWithFilteredResult(_0x4a7882,_0x3007a5))[_0xe3ea('0x45')](handleError(_0x4a7882,null));};exports['getHopperHistories']=function(_0x35f1fe,_0x1c2c03,_0x30ab5b){var _0x1967c3={'raw':!![],'where':{}};var _0x39280c={};var _0x38117c={'count':0x0,'rows':[]};return db['Campaign'][_0xe3ea('0x5e')]({'where':{'id':_0x35f1fe[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x1c2c03,null))[_0xe3ea('0x26')](function(_0x4db7ae){if(_0x4db7ae){_0x39280c['model']=_['keys'](db[_0xe3ea('0x61')][_0xe3ea('0x49')]);_0x39280c['query']=_[_0xe3ea('0x48')](_0x35f1fe[_0xe3ea('0x36')]);_0x39280c['filters']=_[_0xe3ea('0x38')](_0x39280c[_0xe3ea('0x35')],_0x39280c[_0xe3ea('0x36')]);_0x1967c3[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x39280c['model'],qs[_0xe3ea('0x3a')](_0x35f1fe['query'][_0xe3ea('0x3a')]));_0x1967c3[_0xe3ea('0x39')]=_0x1967c3[_0xe3ea('0x39')][_0xe3ea('0x3b')]?_0x1967c3[_0xe3ea('0x39')]:_0x39280c[_0xe3ea('0x35')];if(!_0x35f1fe['query'][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x1967c3[_0xe3ea('0x1e')]=qs[_0xe3ea('0x1e')](_0x35f1fe[_0xe3ea('0x36')]['limit']);_0x1967c3[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x35f1fe[_0xe3ea('0x36')][_0xe3ea('0x1d')]);}_0x1967c3[_0xe3ea('0x60')]=qs[_0xe3ea('0x3e')](_0x35f1fe[_0xe3ea('0x36')][_0xe3ea('0x3e')]);_0x1967c3[_0xe3ea('0x40')]=qs[_0xe3ea('0x37')](_[_0xe3ea('0x3f')](_0x35f1fe[_0xe3ea('0x36')],_0x39280c['filters']));_0x1967c3['where'][_0xe3ea('0x62')]=_0x4db7ae['id'];if(_0x35f1fe[_0xe3ea('0x36')][_0xe3ea('0x42')]){_0x1967c3[_0xe3ea('0x40')]=_[_0xe3ea('0x4b')](_0x1967c3[_0xe3ea('0x40')],{'$or':_['map'](_0x1967c3[_0xe3ea('0x39')],function(_0x436b03){var _0x9c714e={};_0x9c714e[_0x436b03]={'$like':'%'+_0x35f1fe['query']['filter']+'%'};return _0x9c714e;})});}_0x1967c3=_['merge']({},_0x1967c3,_0x35f1fe[_0xe3ea('0x4c')]);return db[_0xe3ea('0x61')][_0xe3ea('0x20')]({'where':_0x1967c3[_0xe3ea('0x40')]})[_0xe3ea('0x26')](function(_0x543de9){_0x38117c['count']=_0x543de9;if(_0x35f1fe[_0xe3ea('0x36')][_0xe3ea('0x4a')]){_0x1967c3[_0xe3ea('0x57')]=[{'all':!![]}];}return db[_0xe3ea('0x61')][_0xe3ea('0x43')](_0x1967c3);})[_0xe3ea('0x26')](function(_0x321baf){_0x38117c['rows']=_0x321baf;return _0x38117c;});}})[_0xe3ea('0x26')](respondWithFilteredResult(_0x1c2c03,_0x1967c3))[_0xe3ea('0x45')](handleError(_0x1c2c03,null));};exports[_0xe3ea('0x63')]=function(_0x4d3930,_0x564260,_0x46a6b7){var _0x2cd60d={'raw':!![],'where':{}};var _0xbcb4aa={};var _0x18a22e={'count':0x0,'rows':[]};return db['Campaign'][_0xe3ea('0x5e')]({'where':{'id':_0x4d3930['params']['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x564260,null))[_0xe3ea('0x26')](function(_0x61e7e3){if(_0x61e7e3){_0xbcb4aa[_0xe3ea('0x35')]=_[_0xe3ea('0x48')](db['CmHopperFinal'][_0xe3ea('0x49')]);_0xbcb4aa[_0xe3ea('0x36')]=_['keys'](_0x4d3930['query']);_0xbcb4aa[_0xe3ea('0x37')]=_[_0xe3ea('0x38')](_0xbcb4aa[_0xe3ea('0x35')],_0xbcb4aa[_0xe3ea('0x36')]);_0x2cd60d[_0xe3ea('0x39')]=_['intersection'](_0xbcb4aa[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x4d3930[_0xe3ea('0x36')]['fields']));_0x2cd60d[_0xe3ea('0x39')]=_0x2cd60d[_0xe3ea('0x39')][_0xe3ea('0x3b')]?_0x2cd60d['attributes']:_0xbcb4aa[_0xe3ea('0x35')];if(!_0x4d3930[_0xe3ea('0x36')][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x2cd60d[_0xe3ea('0x1e')]=qs[_0xe3ea('0x1e')](_0x4d3930[_0xe3ea('0x36')][_0xe3ea('0x1e')]);_0x2cd60d['offset']=qs['offset'](_0x4d3930[_0xe3ea('0x36')][_0xe3ea('0x1d')]);}_0x2cd60d[_0xe3ea('0x60')]=qs[_0xe3ea('0x3e')](_0x4d3930[_0xe3ea('0x36')][_0xe3ea('0x3e')]);_0x2cd60d['where']=qs[_0xe3ea('0x37')](_[_0xe3ea('0x3f')](_0x4d3930[_0xe3ea('0x36')],_0xbcb4aa[_0xe3ea('0x37')]));_0x2cd60d[_0xe3ea('0x40')][_0xe3ea('0x62')]=_0x61e7e3['id'];if(_0x4d3930[_0xe3ea('0x36')]['filter']){_0x2cd60d[_0xe3ea('0x40')]=_['merge'](_0x2cd60d[_0xe3ea('0x40')],{'$or':_[_0xe3ea('0x30')](_0x2cd60d[_0xe3ea('0x39')],function(_0x3883a3){var _0xe5b3b1={};_0xe5b3b1[_0x3883a3]={'$like':'%'+_0x4d3930[_0xe3ea('0x36')][_0xe3ea('0x42')]+'%'};return _0xe5b3b1;})});}_0x2cd60d=_[_0xe3ea('0x4b')]({},_0x2cd60d,_0x4d3930['options']);return db[_0xe3ea('0x64')][_0xe3ea('0x20')]({'where':_0x2cd60d[_0xe3ea('0x40')]})[_0xe3ea('0x26')](function(_0x558bc6){_0x18a22e[_0xe3ea('0x20')]=_0x558bc6;if(_0x4d3930['query']['includeAll']){_0x2cd60d['include']=[{'all':!![]}];}return db[_0xe3ea('0x64')]['findAll'](_0x2cd60d);})[_0xe3ea('0x26')](function(_0x16682e){_0x18a22e[_0xe3ea('0x44')]=_0x16682e;return _0x18a22e;});}})[_0xe3ea('0x26')](respondWithFilteredResult(_0x564260,_0x2cd60d))['catch'](handleError(_0x564260,null));};exports['getHopperBlacks']=function(_0x20f5d4,_0x40ed34,_0x2fbf5b){var _0x387ee0={'raw':!![],'where':{}};var _0x209619={};var _0x533b7a={'count':0x0,'rows':[]};return db[_0xe3ea('0x31')][_0xe3ea('0x5e')]({'where':{'id':_0x20f5d4['params']['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x40ed34,null))[_0xe3ea('0x26')](function(_0x58abe9){if(_0x58abe9){_0x209619[_0xe3ea('0x35')]=_[_0xe3ea('0x48')](db[_0xe3ea('0x65')]['rawAttributes']);_0x209619[_0xe3ea('0x36')]=_[_0xe3ea('0x48')](_0x20f5d4[_0xe3ea('0x36')]);_0x209619[_0xe3ea('0x37')]=_[_0xe3ea('0x38')](_0x209619[_0xe3ea('0x35')],_0x209619['query']);_0x387ee0[_0xe3ea('0x39')]=_['intersection'](_0x209619['model'],qs[_0xe3ea('0x3a')](_0x20f5d4[_0xe3ea('0x36')]['fields']));_0x387ee0[_0xe3ea('0x39')]=_0x387ee0['attributes']['length']?_0x387ee0[_0xe3ea('0x39')]:_0x209619[_0xe3ea('0x35')];if(!_0x20f5d4[_0xe3ea('0x36')][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x387ee0[_0xe3ea('0x1e')]=qs['limit'](_0x20f5d4[_0xe3ea('0x36')]['limit']);_0x387ee0['offset']=qs[_0xe3ea('0x1d')](_0x20f5d4[_0xe3ea('0x36')]['offset']);}_0x387ee0[_0xe3ea('0x60')]=qs[_0xe3ea('0x3e')](_0x20f5d4[_0xe3ea('0x36')][_0xe3ea('0x3e')]);_0x387ee0[_0xe3ea('0x40')]=qs[_0xe3ea('0x37')](_[_0xe3ea('0x3f')](_0x20f5d4[_0xe3ea('0x36')],_0x209619[_0xe3ea('0x37')]));_0x387ee0['where'][_0xe3ea('0x62')]=_0x58abe9['id'];if(_0x20f5d4[_0xe3ea('0x36')][_0xe3ea('0x42')]){_0x387ee0['where']=_[_0xe3ea('0x4b')](_0x387ee0[_0xe3ea('0x40')],{'$or':_[_0xe3ea('0x30')](_0x387ee0['attributes'],function(_0x1c1beb){var _0x1ca25a={};_0x1ca25a[_0x1c1beb]={'$like':'%'+_0x20f5d4['query'][_0xe3ea('0x42')]+'%'};return _0x1ca25a;})});}_0x387ee0=_[_0xe3ea('0x4b')]({},_0x387ee0,_0x20f5d4[_0xe3ea('0x4c')]);return db[_0xe3ea('0x65')][_0xe3ea('0x20')]({'where':_0x387ee0[_0xe3ea('0x40')]})[_0xe3ea('0x26')](function(_0x1593d6){_0x533b7a[_0xe3ea('0x20')]=_0x1593d6;if(_0x20f5d4['query'][_0xe3ea('0x4a')]){_0x387ee0[_0xe3ea('0x57')]=[{'all':!![]}];}return db[_0xe3ea('0x65')]['findAll'](_0x387ee0);})[_0xe3ea('0x26')](function(_0x282704){_0x533b7a['rows']=_0x282704;return _0x533b7a;});}})['then'](respondWithFilteredResult(_0x40ed34,_0x387ee0))[_0xe3ea('0x45')](handleError(_0x40ed34,null));};exports['getLists']=function(_0x39caa1,_0x12c535,_0x3a5714){var _0xc35d6b={};var _0x57dd4f={};var _0x51d77d;var _0x290da5;return db['Campaign']['findOne']({'where':{'id':_0x39caa1[_0xe3ea('0x47')]['id']}})['then'](handleEntityNotFound(_0x12c535,null))['then'](function(_0x48cf3c){if(_0x48cf3c){_0x51d77d=_0x48cf3c;_0x57dd4f[_0xe3ea('0x35')]=_[_0xe3ea('0x48')](db['CmList'][_0xe3ea('0x49')]);_0x57dd4f[_0xe3ea('0x36')]=_[_0xe3ea('0x48')](_0x39caa1[_0xe3ea('0x36')]);_0x57dd4f['filters']=_[_0xe3ea('0x38')](_0x57dd4f[_0xe3ea('0x35')],_0x57dd4f['query']);_0xc35d6b['attributes']=_[_0xe3ea('0x38')](_0x57dd4f[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x39caa1[_0xe3ea('0x36')][_0xe3ea('0x3a')]));_0xc35d6b[_0xe3ea('0x39')]=_0xc35d6b['attributes'][_0xe3ea('0x3b')]?_0xc35d6b['attributes']:_0x57dd4f[_0xe3ea('0x35')];_0xc35d6b[_0xe3ea('0x60')]=qs[_0xe3ea('0x3e')](_0x39caa1['query'][_0xe3ea('0x3e')]);_0xc35d6b[_0xe3ea('0x40')]=qs[_0xe3ea('0x37')](_[_0xe3ea('0x3f')](_0x39caa1[_0xe3ea('0x36')],_0x57dd4f[_0xe3ea('0x37')]));if(_0x39caa1[_0xe3ea('0x36')][_0xe3ea('0x42')]){_0xc35d6b[_0xe3ea('0x40')]=_[_0xe3ea('0x4b')](_0xc35d6b['where'],{'$or':_[_0xe3ea('0x30')](_0xc35d6b[_0xe3ea('0x39')],function(_0x2e879d){var _0x4ccb19={};_0x4ccb19[_0x2e879d]={'$like':'%'+_0x39caa1[_0xe3ea('0x36')][_0xe3ea('0x42')]+'%'};return _0x4ccb19;})});}_0xc35d6b=_[_0xe3ea('0x4b')]({},_0xc35d6b,_0x39caa1[_0xe3ea('0x4c')]);return _0x51d77d[_0xe3ea('0x66')](_0xc35d6b);}})[_0xe3ea('0x26')](function(_0x1055bf){if(_0x1055bf){_0x290da5=_0x1055bf['length'];if(!_0x39caa1[_0xe3ea('0x36')][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0xc35d6b['limit']=qs['limit'](_0x39caa1[_0xe3ea('0x36')][_0xe3ea('0x1e')]);_0xc35d6b[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x39caa1[_0xe3ea('0x36')][_0xe3ea('0x1d')]);}return _0x51d77d[_0xe3ea('0x66')](_0xc35d6b);}})[_0xe3ea('0x26')](function(_0x58fe2a){if(_0x58fe2a){return _0x58fe2a?{'count':_0x290da5,'rows':_0x58fe2a}:null;}})[_0xe3ea('0x26')](respondWithResult(_0x12c535,null))['catch'](handleError(_0x12c535,null));};exports[_0xe3ea('0x67')]=function(_0x3133d6,_0x598f7f,_0x17e1dd){var _0x1111c2,_0xed7ad6;var _0x59608d=[];var _0x12ebfa=moment()[_0xe3ea('0x68')](_0xe3ea('0x69'));return db['Campaign'][_0xe3ea('0x4d')]({'where':{'id':_0x3133d6[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x598f7f,null))[_0xe3ea('0x26')](function(_0xe64320){if(_0xe64320){_0xed7ad6=_0xe64320;return _0xe64320['addLists'](_0x3133d6[_0xe3ea('0x4f')][_0xe3ea('0x6a')],_[_0xe3ea('0x58')](_0x3133d6[_0xe3ea('0x4f')],[_0xe3ea('0x6a'),'id'])||{});}return null;})['spread'](function(_0x85858f){var _0x2f7b94;var _0x56dd91;_0x1111c2=_0x85858f||[];var _0x23da49=[];if(_0x85858f){for(var _0xbf2267=0x0;_0xbf2267<_0x85858f['length'];_0xbf2267+=0x1){var _0x15fc1b=_0x85858f[_0xbf2267]['get']({'plain':!![]});_0xed7ad6[_0xe3ea('0x6b')]=_0x3133d6[_0xe3ea('0x4f')]['dialCheckDuplicateType']?_0x3133d6[_0xe3ea('0x4f')][_0xe3ea('0x6b')]:_0xed7ad6[_0xe3ea('0x6b')];switch(_0xed7ad6[_0xe3ea('0x6b')]){case _0xe3ea('0x6c'):_0x2f7b94=squel['insert']()[_0xe3ea('0x6d')]('cm_hopper')[_0xe3ea('0x6e')]([_0xe3ea('0x6f'),_0xe3ea('0x70'),_0xe3ea('0x71'),_0xe3ea('0x72'),_0xe3ea('0x62'),'createdAt',_0xe3ea('0x5a')],squel[_0xe3ea('0x73')]()[_0xe3ea('0x74')](_0xe3ea('0x6f'),'phone')[_0xe3ea('0x74')](_0xe3ea('0x75'),_0xe3ea('0x70'))[_0xe3ea('0x74')]('id','ContactId')[_0xe3ea('0x74')](_0x15fc1b[_0xe3ea('0x76')]['toString'](),_0xe3ea('0x72'))[_0xe3ea('0x74')](_0x3133d6['params']['id'][_0xe3ea('0x77')](),_0xe3ea('0x62'))[_0xe3ea('0x74')]('\x27'+_0x12ebfa+'\x27',_0xe3ea('0x59'))[_0xe3ea('0x74')]('\x27'+_0x12ebfa+'\x27',_0xe3ea('0x5a'))[_0xe3ea('0x78')](_0xe3ea('0x79'))[_0xe3ea('0x40')](_0xe3ea('0x7a'))[_0xe3ea('0x40')](_0xe3ea('0x7b'),_0x15fc1b['CmListId'][_0xe3ea('0x77')]())['where'](_0xe3ea('0x7c'))[_0xe3ea('0x40')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe3ea('0x74')]('COALESCE(calleridnum,\x27\x27)')[_0xe3ea('0x78')](_0xe3ea('0x7d'))[_0xe3ea('0x40')](_0xe3ea('0x7e'),_0x3133d6[_0xe3ea('0x47')]['id']['toString']()))['where'](_0xe3ea('0x7f'),squel[_0xe3ea('0x73')]()[_0xe3ea('0x74')](_0xe3ea('0x80'))[_0xe3ea('0x78')](_0xe3ea('0x81'))[_0xe3ea('0x40')]('CampaignId\x20=\x20?',_0x3133d6[_0xe3ea('0x47')]['id']['toString']())))[_0xe3ea('0x77')]();break;case _0xe3ea('0x82'):_0x2f7b94=squel[_0xe3ea('0x83')]()[_0xe3ea('0x6d')](_0xe3ea('0x81'))[_0xe3ea('0x6e')]([_0xe3ea('0x6f'),'scheduledAt','ContactId',_0xe3ea('0x72'),_0xe3ea('0x62'),_0xe3ea('0x59'),_0xe3ea('0x5a')],squel[_0xe3ea('0x73')]()[_0xe3ea('0x74')](_0xe3ea('0x6f'),_0xe3ea('0x6f'))[_0xe3ea('0x74')]('NOW()',_0xe3ea('0x70'))[_0xe3ea('0x74')]('id','ContactId')[_0xe3ea('0x74')](_0x15fc1b['CmListId'][_0xe3ea('0x77')](),_0xe3ea('0x72'))[_0xe3ea('0x74')](_0x3133d6[_0xe3ea('0x47')]['id'][_0xe3ea('0x77')](),'CampaignId')[_0xe3ea('0x74')]('\x27'+_0x12ebfa+'\x27',_0xe3ea('0x59'))[_0xe3ea('0x74')]('\x27'+_0x12ebfa+'\x27',_0xe3ea('0x5a'))['from'](_0xe3ea('0x79'))['where'](_0xe3ea('0x7a'))[_0xe3ea('0x40')]('ListId\x20=\x20?',_0x15fc1b[_0xe3ea('0x76')][_0xe3ea('0x77')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe3ea('0x40')](_0xe3ea('0x7f'),squel[_0xe3ea('0x73')]()[_0xe3ea('0x74')](_0xe3ea('0x80'))[_0xe3ea('0x78')](_0xe3ea('0x81'))[_0xe3ea('0x40')](_0xe3ea('0x7e'),_0x3133d6[_0xe3ea('0x47')]['id'][_0xe3ea('0x77')]())))[_0xe3ea('0x77')]();break;default:_0x2f7b94=squel[_0xe3ea('0x83')]()[_0xe3ea('0x6d')](_0xe3ea('0x81'))['fromQuery']([_0xe3ea('0x6f'),_0xe3ea('0x70'),_0xe3ea('0x71'),_0xe3ea('0x72'),_0xe3ea('0x62'),_0xe3ea('0x59'),'updatedAt'],squel['select']()[_0xe3ea('0x74')](_0xe3ea('0x6f'),_0xe3ea('0x6f'))[_0xe3ea('0x74')]('NOW()','scheduledAt')['field']('id',_0xe3ea('0x71'))['field'](_0x15fc1b[_0xe3ea('0x76')][_0xe3ea('0x77')](),_0xe3ea('0x72'))[_0xe3ea('0x74')](_0x3133d6[_0xe3ea('0x47')]['id']['toString'](),'CampaignId')[_0xe3ea('0x74')]('\x27'+_0x12ebfa+'\x27',_0xe3ea('0x59'))[_0xe3ea('0x74')]('\x27'+_0x12ebfa+'\x27',_0xe3ea('0x5a'))['from'](_0xe3ea('0x79'))[_0xe3ea('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0xe3ea('0x7b'),_0x15fc1b['CmListId'][_0xe3ea('0x77')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xe3ea('0x77')]();}_0x56dd91=squel[_0xe3ea('0x83')]()[_0xe3ea('0x6d')](_0xe3ea('0x84'))[_0xe3ea('0x6e')]([_0xe3ea('0x85'),_0xe3ea('0x70'),'phone',_0xe3ea('0x86'),_0xe3ea('0x59'),_0xe3ea('0x5a')],squel['select']()['field'](_0xe3ea('0x87'),'id')[_0xe3ea('0x74')](_0xe3ea('0x75'),_0xe3ea('0x70'))[_0xe3ea('0x74')](_0xe3ea('0x88'),_0xe3ea('0x6f'))['field']('ci.OrderBY','OrderBy')[_0xe3ea('0x74')]('\x27'+_0x12ebfa+'\x27','createdAt')[_0xe3ea('0x74')]('\x27'+_0x12ebfa+'\x27',_0xe3ea('0x5a'))[_0xe3ea('0x78')]('cm_contact_has_items','ci')[_0xe3ea('0x89')](_0xe3ea('0x81'),'h',_0xe3ea('0x8a'))['where'](_0xe3ea('0x8b'),_0x15fc1b[_0xe3ea('0x76')][_0xe3ea('0x77')]())[_0xe3ea('0x40')](_0xe3ea('0x8c'),_0x3133d6[_0xe3ea('0x47')]['id']['toString']())['where'](_0xe3ea('0x8d'),_0x12ebfa))[_0xe3ea('0x77')]();_0x23da49[_0xe3ea('0x8e')](db[_0xe3ea('0x8f')][_0xe3ea('0x36')](_0x2f7b94));_0x59608d[_0xe3ea('0x8e')](db[_0xe3ea('0x8f')][_0xe3ea('0x36')](_0x56dd91));}return BPromise['all'](_0x23da49);}})[_0xe3ea('0x26')](function(){return BPromise['all'](_0x59608d);})['then'](function(){return _0x1111c2;})[_0xe3ea('0x26')](respondWithResult(_0x598f7f,null))[_0xe3ea('0x45')](handleError(_0x598f7f,null));};exports['removeLists']=function(_0xae0b7b,_0x45baef,_0x3cc76d){return db[_0xe3ea('0x31')][_0xe3ea('0x4d')]({'where':{'id':_0xae0b7b[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x45baef,null))[_0xe3ea('0x26')](function(_0x49ca06){if(_0x49ca06){return _0x49ca06[_0xe3ea('0x90')](_0xae0b7b['query']['ids']);}})[_0xe3ea('0x26')](function(_0x4540ac){if(_0x4540ac){return db[_0xe3ea('0x5f')][_0xe3ea('0x27')]({'where':{'ListId':_0xae0b7b[_0xe3ea('0x36')][_0xe3ea('0x6a')],'CampaignId':_0xae0b7b[_0xe3ea('0x47')]['id']}})['then'](function(){return _0x4540ac;});}})['then'](respondWithStatusCode(_0x45baef,null))[_0xe3ea('0x45')](handleError(_0x45baef,null));};exports[_0xe3ea('0x91')]=function(_0x4285b9,_0x1fe9a2,_0x3a8692){var _0x517d14={};var _0x164414={};var _0x5f4e3b;var _0x416aec;return db[_0xe3ea('0x31')]['findOne']({'where':{'id':_0x4285b9[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x1fe9a2,null))['then'](function(_0x3af8c4){if(_0x3af8c4){_0x5f4e3b=_0x3af8c4;_0x164414['model']=_['keys'](db[_0xe3ea('0x92')]['rawAttributes']);_0x164414[_0xe3ea('0x36')]=_[_0xe3ea('0x48')](_0x4285b9[_0xe3ea('0x36')]);_0x164414[_0xe3ea('0x37')]=_['intersection'](_0x164414[_0xe3ea('0x35')],_0x164414['query']);_0x517d14[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x164414[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x4285b9['query']['fields']));_0x517d14[_0xe3ea('0x39')]=_0x517d14[_0xe3ea('0x39')][_0xe3ea('0x3b')]?_0x517d14[_0xe3ea('0x39')]:_0x164414[_0xe3ea('0x35')];_0x517d14[_0xe3ea('0x60')]=qs['sort'](_0x4285b9['query'][_0xe3ea('0x3e')]);_0x517d14[_0xe3ea('0x40')]=qs[_0xe3ea('0x37')](_['pick'](_0x4285b9['query'],_0x164414['filters']));if(_0x4285b9['query'][_0xe3ea('0x42')]){_0x517d14[_0xe3ea('0x40')]=_['merge'](_0x517d14['where'],{'$or':_['map'](_0x517d14[_0xe3ea('0x39')],function(_0x101c4b){var _0x16ae9b={};_0x16ae9b[_0x101c4b]={'$like':'%'+_0x4285b9[_0xe3ea('0x36')]['filter']+'%'};return _0x16ae9b;})});}_0x517d14=_['merge']({},_0x517d14,_0x4285b9['options']);return _0x5f4e3b[_0xe3ea('0x91')](_0x517d14);}})[_0xe3ea('0x26')](function(_0x5cc331){if(_0x5cc331){_0x416aec=_0x5cc331[_0xe3ea('0x3b')];if(!_0x4285b9['query'][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x517d14['limit']=qs[_0xe3ea('0x1e')](_0x4285b9[_0xe3ea('0x36')]['limit']);_0x517d14[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x4285b9[_0xe3ea('0x36')]['offset']);}return _0x5f4e3b['getBlackLists'](_0x517d14);}})[_0xe3ea('0x26')](function(_0x36b7ca){if(_0x36b7ca){return _0x36b7ca?{'count':_0x416aec,'rows':_0x36b7ca}:null;}})['then'](respondWithResult(_0x1fe9a2,null))[_0xe3ea('0x45')](handleError(_0x1fe9a2,null));};exports[_0xe3ea('0x93')]=function(_0x34eca8,_0x3f56cb,_0x301e2c){var _0x4aed51,_0x1e0a47;var _0x9a9cf3=[];var _0x3dc00d=moment()['format'](_0xe3ea('0x69'));return db[_0xe3ea('0x31')][_0xe3ea('0x4d')]({'where':{'id':_0x34eca8[_0xe3ea('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f56cb,null))['then'](function(_0x3f1343){if(_0x3f1343){_0x1e0a47=_0x3f1343;return _0x3f1343[_0xe3ea('0x93')](_0x34eca8['body'][_0xe3ea('0x6a')],_[_0xe3ea('0x58')](_0x34eca8[_0xe3ea('0x4f')],['ids','id'])||{});}return null;})['spread'](function(_0x528119){var _0x1ab70a;var _0x149b90;_0x4aed51=_0x528119||[];var _0x25b4f5=[];if(_0x528119){for(var _0x3ff4c8=0x0;_0x3ff4c8<_0x528119[_0xe3ea('0x3b')];_0x3ff4c8+=0x1){var _0x56b4a6=_0x528119[_0x3ff4c8][_0xe3ea('0x28')]({'plain':!![]});_0x1ab70a=squel[_0xe3ea('0x83')]()['into']('cm_hopper_black')[_0xe3ea('0x6e')]([_0xe3ea('0x6f'),_0xe3ea('0x71'),_0xe3ea('0x72'),_0xe3ea('0x62'),'createdAt',_0xe3ea('0x5a')],squel[_0xe3ea('0x73')]()[_0xe3ea('0x74')](_0xe3ea('0x6f'),_0xe3ea('0x6f'))[_0xe3ea('0x74')]('id',_0xe3ea('0x71'))[_0xe3ea('0x74')](_0x56b4a6[_0xe3ea('0x76')][_0xe3ea('0x77')](),_0xe3ea('0x72'))[_0xe3ea('0x74')](_0x34eca8['params']['id'][_0xe3ea('0x77')](),'CampaignId')[_0xe3ea('0x74')](_0xe3ea('0x75'),_0xe3ea('0x59'))[_0xe3ea('0x74')](_0xe3ea('0x75'),_0xe3ea('0x5a'))[_0xe3ea('0x78')](_0xe3ea('0x79'))[_0xe3ea('0x40')](_0xe3ea('0x7a'))[_0xe3ea('0x40')](_0xe3ea('0x7b'),_0x56b4a6[_0xe3ea('0x76')]['toString']())[_0xe3ea('0x40')](_0xe3ea('0x7c')))[_0xe3ea('0x77')]();_0x25b4f5[_0xe3ea('0x8e')](db['sequelize'][_0xe3ea('0x36')](_0x1ab70a));}return BPromise[_0xe3ea('0x94')](_0x25b4f5);}})[_0xe3ea('0x26')](function(){return _0x4aed51;})['then'](respondWithResult(_0x3f56cb,null))[_0xe3ea('0x45')](handleError(_0x3f56cb,null));};exports['removeBlackLists']=function(_0x61286c,_0x27fd11,_0x434651){return db['Campaign']['find']({'where':{'id':_0x61286c[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x27fd11,null))[_0xe3ea('0x26')](function(_0x42bb21){if(_0x42bb21){return _0x42bb21[_0xe3ea('0x95')](_0x61286c['query'][_0xe3ea('0x6a')]);}})['then'](function(_0x5b3f71){if(_0x5b3f71){return db[_0xe3ea('0x65')][_0xe3ea('0x27')]({'where':{'ListId':_0x61286c[_0xe3ea('0x36')][_0xe3ea('0x6a')],'CampaignId':_0x61286c[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](function(){return _0x5b3f71;});}})[_0xe3ea('0x26')](respondWithStatusCode(_0x27fd11,null))[_0xe3ea('0x45')](handleError(_0x27fd11,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 0ccb757..1ea2e66 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1e2de4,_0x22d700){var _0x4a5929=function(_0x5acb56){while(--_0x5acb56){_0x1e2de4['push'](_0x1e2de4['shift']());}};_0x4a5929(++_0x22d700);}(_0x7a54,0x106));var _0x47a5=function(_0x12263a,_0x5f944f){_0x12263a=_0x12263a-0x0;var _0x1fb3b8=_0x7a54[_0x12263a];return _0x1fb3b8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x422344,_0x276567){var _0x20efc8=function(_0x275ce9){while(--_0x275ce9){_0x422344['push'](_0x422344['shift']());}};_0x20efc8(++_0x276567);}(_0x7a54,0x106));var _0x47a5=function(_0x109162,_0x87f933){_0x109162=_0x109162-0x0;var _0x3c619c=_0x7a54[_0x109162];return _0x3c619c;};'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 cc90a59..190b29b 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 _0xfc4c=['util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','info','Campaign,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','then','lodash'];(function(_0x416d19,_0x26f9c4){var _0x5b5788=function(_0x34350a){while(--_0x34350a){_0x416d19['push'](_0x416d19['shift']());}};_0x5b5788(++_0x26f9c4);}(_0xfc4c,0xca));var _0xcfc4=function(_0x37a4ef,_0x499eb0){_0x37a4ef=_0x37a4ef-0x0;var _0x534207=_0xfc4c[_0x37a4ef];return _0x534207;};'use strict';var _=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var moment=require(_0xcfc4('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfc4('0x3'));var fs=require('fs');var Redis=require(_0xcfc4('0x4'));var db=require(_0xcfc4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcfc4('0x6'));var config=require(_0xcfc4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfc4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53486d,_0x560b1c,_0x4578f4){return new BPromise(function(_0x520566,_0x13b9f6){return client['request'](_0x53486d,_0x4578f4)['then'](function(_0x49b787){logger[_0xcfc4('0x9')](_0xcfc4('0xa'),_0x560b1c,'request\x20sent');logger[_0xcfc4('0xb')]('Campaign,\x20%s,\x20%s,\x20%s',_0x560b1c,'request\x20sent',JSON[_0xcfc4('0xc')](_0x49b787));if(_0x49b787[_0xcfc4('0xd')]){if(_0x49b787[_0xcfc4('0xd')][_0xcfc4('0xe')]===0x1f4){logger[_0xcfc4('0xd')]('Campaign,\x20%s,\x20%s',_0x560b1c,_0x49b787[_0xcfc4('0xd')]['message']);return _0x13b9f6(_0x49b787[_0xcfc4('0xd')]['message']);}logger[_0xcfc4('0xd')]('Campaign,\x20%s,\x20%s',_0x560b1c,_0x49b787['error'][_0xcfc4('0xf')]);return _0x520566(_0x49b787[_0xcfc4('0xd')]['message']);}else{logger[_0xcfc4('0x9')](_0xcfc4('0xa'),_0x560b1c,_0xcfc4('0x10'));_0x520566(_0x49b787['result']['message']);}})[_0xcfc4('0x11')](function(_0x47db36){logger['error']('Campaign,\x20%s,\x20%s',_0x560b1c,_0x47db36);_0x13b9f6(_0x47db36);});});}exports[_0xcfc4('0x12')]=function(_0x52cd7b){var _0x472694=this;return new Promise(function(_0x19887b,_0x5ac260){return db[_0xcfc4('0x13')][_0xcfc4('0x14')]({'raw':_0x52cd7b[_0xcfc4('0x15')]?_0x52cd7b['options'][_0xcfc4('0x16')]===undefined?!![]:![]:!![],'where':_0x52cd7b[_0xcfc4('0x15')]?_0x52cd7b[_0xcfc4('0x15')]['where']||null:null,'attributes':_0x52cd7b[_0xcfc4('0x15')]?_0x52cd7b[_0xcfc4('0x15')][_0xcfc4('0x17')]||null:null,'limit':_0x52cd7b[_0xcfc4('0x15')]?_0x52cd7b[_0xcfc4('0x15')][_0xcfc4('0x18')]||null:null,'include':_0x52cd7b[_0xcfc4('0x15')]?_0x52cd7b[_0xcfc4('0x15')][_0xcfc4('0x19')]?_[_0xcfc4('0x1a')](_0x52cd7b[_0xcfc4('0x15')]['include'],function(_0x393d09){return{'model':db[_0x393d09[_0xcfc4('0x1b')]],'as':_0x393d09['as'],'attributes':_0x393d09[_0xcfc4('0x17')],'include':_0x393d09['include']?_[_0xcfc4('0x1a')](_0x393d09['include'],function(_0x10aa76){return{'model':db[_0x10aa76[_0xcfc4('0x1b')]],'as':_0x10aa76['as'],'attributes':_0x10aa76[_0xcfc4('0x17')],'include':_0x10aa76[_0xcfc4('0x19')]?_[_0xcfc4('0x1a')](_0x10aa76[_0xcfc4('0x19')],function(_0x4fdb59){return{'model':db[_0x4fdb59[_0xcfc4('0x1b')]],'as':_0x4fdb59['as'],'attributes':_0x4fdb59[_0xcfc4('0x17')]};}):[]};}):[]};}):[]:[]})[_0xcfc4('0x1c')](function(_0x1495db){logger[_0xcfc4('0x9')]('GetCampaign',_0x52cd7b);logger[_0xcfc4('0xb')](_0xcfc4('0x12'),_0x52cd7b,JSON[_0xcfc4('0xc')](_0x1495db));_0x19887b(_0x1495db);})[_0xcfc4('0x11')](function(_0x59dd2d){logger['error']('GetCampaign',_0x59dd2d[_0xcfc4('0xf')],_0x52cd7b);_0x5ac260(_0x472694[_0xcfc4('0xd')](0x1f4,_0x59dd2d[_0xcfc4('0xf')]));});});};
\ No newline at end of file
+var _0x8ccb=['GetCampaign','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','debug','Campaign,\x20%s,\x20%s,\x20%s','error','Campaign,\x20%s,\x20%s','message','request\x20sent','result','Campaign','options','raw','where','attributes','limit','include','map','model'];(function(_0x4d4af4,_0x3e0c8c){var _0x22f9db=function(_0x25763a){while(--_0x25763a){_0x4d4af4['push'](_0x4d4af4['shift']());}};_0x22f9db(++_0x3e0c8c);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0x8ccb[_0x4d2f00];return _0x2d7b7f;};'use strict';var _=require(_0xb8cc('0x0'));var util=require(_0xb8cc('0x1'));var moment=require('moment');var BPromise=require(_0xb8cc('0x2'));var rs=require(_0xb8cc('0x3'));var fs=require('fs');var Redis=require(_0xb8cc('0x4'));var db=require(_0xb8cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb8cc('0x6'));var config=require(_0xb8cc('0x7'));var jayson=require(_0xb8cc('0x8'));var client=jayson['client'][_0xb8cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x349552,_0x139945,_0x56951f){return new BPromise(function(_0x35c86d,_0x2c338f){return client[_0xb8cc('0xa')](_0x349552,_0x56951f)['then'](function(_0x175473){logger[_0xb8cc('0xb')]('Campaign,\x20%s,\x20%s',_0x139945,'request\x20sent');logger[_0xb8cc('0xc')](_0xb8cc('0xd'),_0x139945,'request\x20sent',JSON['stringify'](_0x175473));if(_0x175473[_0xb8cc('0xe')]){if(_0x175473[_0xb8cc('0xe')]['code']===0x1f4){logger[_0xb8cc('0xe')](_0xb8cc('0xf'),_0x139945,_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);return _0x2c338f(_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);}logger[_0xb8cc('0xe')]('Campaign,\x20%s,\x20%s',_0x139945,_0x175473[_0xb8cc('0xe')]['message']);return _0x35c86d(_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);}else{logger[_0xb8cc('0xb')]('Campaign,\x20%s,\x20%s',_0x139945,_0xb8cc('0x11'));_0x35c86d(_0x175473[_0xb8cc('0x12')][_0xb8cc('0x10')]);}})['catch'](function(_0x2ba498){logger['error'](_0xb8cc('0xf'),_0x139945,_0x2ba498);_0x2c338f(_0x2ba498);});});}exports['GetCampaign']=function(_0x2ac4cc){var _0x259708=this;return new Promise(function(_0x2b7130,_0x3e1ba7){return db[_0xb8cc('0x13')]['findAll']({'raw':_0x2ac4cc[_0xb8cc('0x14')]?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x15')]===undefined?!![]:![]:!![],'where':_0x2ac4cc['options']?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x16')]||null:null,'attributes':_0x2ac4cc['options']?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x17')]||null:null,'limit':_0x2ac4cc['options']?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x18')]||null:null,'include':_0x2ac4cc[_0xb8cc('0x14')]?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x19')]?_[_0xb8cc('0x1a')](_0x2ac4cc[_0xb8cc('0x14')]['include'],function(_0x50aa38){return{'model':db[_0x50aa38[_0xb8cc('0x1b')]],'as':_0x50aa38['as'],'attributes':_0x50aa38['attributes'],'include':_0x50aa38[_0xb8cc('0x19')]?_['map'](_0x50aa38[_0xb8cc('0x19')],function(_0xbb1918){return{'model':db[_0xbb1918[_0xb8cc('0x1b')]],'as':_0xbb1918['as'],'attributes':_0xbb1918[_0xb8cc('0x17')],'include':_0xbb1918['include']?_[_0xb8cc('0x1a')](_0xbb1918[_0xb8cc('0x19')],function(_0x400de6){return{'model':db[_0x400de6[_0xb8cc('0x1b')]],'as':_0x400de6['as'],'attributes':_0x400de6[_0xb8cc('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50ed6f){logger[_0xb8cc('0xb')](_0xb8cc('0x1c'),_0x2ac4cc);logger['debug'](_0xb8cc('0x1c'),_0x2ac4cc,JSON['stringify'](_0x50ed6f));_0x2b7130(_0x50ed6f);})[_0xb8cc('0x1d')](function(_0x2634a4){logger[_0xb8cc('0xe')](_0xb8cc('0x1c'),_0x2634a4['message'],_0x2ac4cc);_0x3e1ba7(_0x259708[_0xb8cc('0xe')](0x1f4,_0x2634a4[_0xb8cc('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index e6af627..40a1411 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 _0xf14b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xf14b,0xdd));var _0xbf14=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0xf14b[_0x1d5a32];return _0x361ca0;};'use strict';var multer=require(_0xbf14('0x0'));var util=require(_0xbf14('0x1'));var path=require(_0xbf14('0x2'));var timeout=require(_0xbf14('0x3'));var express=require(_0xbf14('0x4'));var router=express[_0xbf14('0x5')]();var fs_extra=require(_0xbf14('0x6'));var auth=require(_0xbf14('0x7'));var interaction=require(_0xbf14('0x8'));var config=require(_0xbf14('0x9'));var controller=require('./campaign.controller');router[_0xbf14('0xa')]('/',auth[_0xbf14('0xb')](),controller[_0xbf14('0xc')]);router[_0xbf14('0xa')](_0xbf14('0xd'),auth[_0xbf14('0xb')](),controller[_0xbf14('0xe')]);router['get'](_0xbf14('0xf'),auth[_0xbf14('0xb')](),controller[_0xbf14('0x10')]);router['get']('/:id/hopper_histories',auth[_0xbf14('0xb')](),controller[_0xbf14('0x11')]);router[_0xbf14('0xa')](_0xbf14('0x12'),auth[_0xbf14('0xb')](),controller[_0xbf14('0x13')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xbf14('0x14')]);router[_0xbf14('0xa')](_0xbf14('0x15'),auth[_0xbf14('0xb')](),controller[_0xbf14('0x16')]);router[_0xbf14('0xa')](_0xbf14('0x17'),auth[_0xbf14('0xb')](),controller[_0xbf14('0x18')]);router[_0xbf14('0x19')]('/',auth['isAuthenticated'](),controller[_0xbf14('0x1a')]);router[_0xbf14('0x19')](_0xbf14('0x1b'),auth['isAuthenticated'](),controller[_0xbf14('0x1c')]);router[_0xbf14('0x19')]('/:id/lists',auth[_0xbf14('0xb')](),controller[_0xbf14('0x1d')]);router[_0xbf14('0x19')](_0xbf14('0x17'),auth['isAuthenticated'](),controller[_0xbf14('0x1e')]);router[_0xbf14('0x1f')](_0xbf14('0xd'),auth['isAuthenticated'](),controller[_0xbf14('0x20')]);router[_0xbf14('0x21')](_0xbf14('0xd'),auth[_0xbf14('0xb')](),controller[_0xbf14('0x22')]);router[_0xbf14('0x21')]('/:id/lists',auth[_0xbf14('0xb')](),controller['removeLists']);router[_0xbf14('0x21')](_0xbf14('0x17'),auth[_0xbf14('0xb')](),controller[_0xbf14('0x23')]);module[_0xbf14('0x24')]=router;
\ No newline at end of file
+var _0xf33f=['addLists','addBlackLists','put','update','delete','destroy','removeLists','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperBlacks','/:id/lists','/:id/blacklists','post','/:id/clone','clone'];(function(_0x1c7bd0,_0x2b9e52){var _0x5de853=function(_0x5bbc45){while(--_0x5bbc45){_0x1c7bd0['push'](_0x1c7bd0['shift']());}};_0x5de853(++_0x2b9e52);}(_0xf33f,0x13d));var _0xff33=function(_0x37371d,_0x2f0c46){_0x37371d=_0x37371d-0x0;var _0x279daa=_0xf33f[_0x37371d];return _0x279daa;};'use strict';var multer=require(_0xff33('0x0'));var util=require(_0xff33('0x1'));var path=require(_0xff33('0x2'));var timeout=require(_0xff33('0x3'));var express=require('express');var router=express[_0xff33('0x4')]();var fs_extra=require(_0xff33('0x5'));var auth=require(_0xff33('0x6'));var interaction=require(_0xff33('0x7'));var config=require(_0xff33('0x8'));var controller=require(_0xff33('0x9'));router[_0xff33('0xa')]('/',auth[_0xff33('0xb')](),controller[_0xff33('0xc')]);router['get'](_0xff33('0xd'),auth[_0xff33('0xb')](),controller[_0xff33('0xe')]);router[_0xff33('0xa')](_0xff33('0xf'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xff33('0xa')](_0xff33('0x10'),auth['isAuthenticated'](),controller[_0xff33('0x11')]);router[_0xff33('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xff33('0xb')](),controller[_0xff33('0x12')]);router[_0xff33('0xa')](_0xff33('0x13'),auth[_0xff33('0xb')](),controller['getLists']);router[_0xff33('0xa')](_0xff33('0x14'),auth[_0xff33('0xb')](),controller['getBlackLists']);router[_0xff33('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0xff33('0x15')](_0xff33('0x16'),auth['isAuthenticated'](),controller[_0xff33('0x17')]);router[_0xff33('0x15')]('/:id/lists',auth[_0xff33('0xb')](),controller[_0xff33('0x18')]);router[_0xff33('0x15')](_0xff33('0x14'),auth['isAuthenticated'](),controller[_0xff33('0x19')]);router[_0xff33('0x1a')](_0xff33('0xd'),auth[_0xff33('0xb')](),controller[_0xff33('0x1b')]);router[_0xff33('0x1c')](_0xff33('0xd'),auth[_0xff33('0xb')](),controller[_0xff33('0x1d')]);router['delete'](_0xff33('0x13'),auth[_0xff33('0xb')](),controller[_0xff33('0x1e')]);router[_0xff33('0x1c')](_0xff33('0x14'),auth[_0xff33('0xb')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 4ad7ff4..416b823 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 _0x9780=['medium','VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x467856,_0x87b18d){var _0x272113=function(_0x455b81){while(--_0x455b81){_0x467856['push'](_0x467856['shift']());}};_0x272113(++_0x87b18d);}(_0x9780,0x10c));var _0x0978=function(_0x1761f0,_0x27fe8b){_0x1761f0=_0x1761f0-0x0;var _0x371d9f=_0x9780[_0x1761f0];return _0x371d9f;};'use strict';var Sequelize=require(_0x0978('0x0'));module[_0x0978('0x1')]={'key':{'type':Sequelize[_0x0978('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0978('0x3')],'length':_0x0978('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x0978('0x2')]},'name':{'type':Sequelize[_0x0978('0x5')],'get':function(){return this[_0x0978('0x6')](_0x0978('0x7'));}}};
\ No newline at end of file
+var _0xd2e2=['medium','sequelize','exports','STRING','TEXT'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd2e2,0x1d2));var _0x2d2e=function(_0x524d9d,_0xf645eb){_0x524d9d=_0x524d9d-0x0;var _0x141f65=_0xd2e2[_0x524d9d];return _0x141f65;};'use strict';var Sequelize=require(_0x2d2e('0x0'));module[_0x2d2e('0x1')]={'key':{'type':Sequelize[_0x2d2e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2d2e('0x3')],'length':_0x2d2e('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x2d2e('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index b79488e..ffba27a 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 _0xff74=['limit','count','set','Content-Range','reject','then','CannedAnswers','destroy','end','sendStatus','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xff74,0x1e4));var _0x4ff7=function(_0x12aa66,_0x2d35c1){_0x12aa66=_0x12aa66-0x0;var _0x53dfe9=_0xff74[_0x12aa66];return _0x53dfe9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ff7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4ff7('0x1'));var moment=require('moment');var BPromise=require(_0x4ff7('0x2'));var Mustache=require(_0x4ff7('0x3'));var util=require('util');var path=require(_0x4ff7('0x4'));var sox=require(_0x4ff7('0x5'));var csv=require('to-csv');var ejs=require(_0x4ff7('0x6'));var fs=require('fs');var fs_extra=require(_0x4ff7('0x7'));var _=require('lodash');var squel=require(_0x4ff7('0x8'));var crypto=require('crypto');var jsforce=require(_0x4ff7('0x9'));var deskjs=require(_0x4ff7('0xa'));var toCsv=require(_0x4ff7('0xb'));var querystring=require(_0x4ff7('0xc'));var Papa=require(_0x4ff7('0xd'));var Redis=require('ioredis');var authService=require(_0x4ff7('0xe'));var qs=require(_0x4ff7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ff7('0x10'));var logger=require('../../config/logger')(_0x4ff7('0x11'));var utils=require(_0x4ff7('0x12'));var config=require(_0x4ff7('0x13'));var licenseUtil=require(_0x4ff7('0x14'));var db=require(_0x4ff7('0x15'))['db'];function respondWithStatusCode(_0xb61da,_0x28c7ee){_0x28c7ee=_0x28c7ee||0xcc;return function(_0x321b3b){if(_0x321b3b){return _0xb61da['sendStatus'](_0x28c7ee);}return _0xb61da[_0x4ff7('0x16')](_0x28c7ee)['end']();};}function respondWithResult(_0xc9631,_0x15f4f3){_0x15f4f3=_0x15f4f3||0xc8;return function(_0x30cd88){if(_0x30cd88){return _0xc9631['status'](_0x15f4f3)[_0x4ff7('0x17')](_0x30cd88);}};}function respondWithFilteredResult(_0x332d6b,_0x33c3e9){return function(_0x2faf2f){if(_0x2faf2f){var _0x37e1bf=typeof _0x33c3e9[_0x4ff7('0x18')]===_0x4ff7('0x19')&&typeof _0x33c3e9[_0x4ff7('0x1a')]==='undefined';var _0x1ee871=_0x2faf2f['count'];var _0x595e02=_0x37e1bf?0x0:_0x33c3e9[_0x4ff7('0x18')];var _0x29bd8a=_0x37e1bf?_0x2faf2f[_0x4ff7('0x1b')]:_0x33c3e9[_0x4ff7('0x18')]+_0x33c3e9[_0x4ff7('0x1a')];var _0x24537b;if(_0x29bd8a>=_0x1ee871){_0x29bd8a=_0x1ee871;_0x24537b=0xc8;}else{_0x24537b=0xce;}_0x332d6b[_0x4ff7('0x16')](_0x24537b);return _0x332d6b[_0x4ff7('0x1c')](_0x4ff7('0x1d'),_0x595e02+'-'+_0x29bd8a+'/'+_0x1ee871)[_0x4ff7('0x17')](_0x2faf2f);}return null;};}function patchUpdates(_0x2e4a8f){return function(_0xf9affb){try{jsonpatch['apply'](_0xf9affb,_0x2e4a8f,!![]);}catch(_0x343fc6){return BPromise[_0x4ff7('0x1e')](_0x343fc6);}return _0xf9affb['save']();};}function saveUpdates(_0x5ed333,_0x1064e7){return function(_0x57970d){if(_0x57970d){return _0x57970d['update'](_0x5ed333)['then'](function(_0x54fedb){return _0x54fedb;});}return null;};}function removeEntity(_0x359a22,_0x3f36e6){return function(_0xd02daa){if(_0xd02daa){return _0xd02daa['destroy']()[_0x4ff7('0x1f')](function(){var _0x37ee40=_0xd02daa['get']({'plain':!![]});var _0x4e5c96=_0x4ff7('0x20');return db['UserProfileResource'][_0x4ff7('0x21')]({'where':{'type':_0x4e5c96,'resourceId':_0x37ee40['id']}})[_0x4ff7('0x1f')](function(){return _0xd02daa;});})[_0x4ff7('0x1f')](function(){_0x359a22[_0x4ff7('0x16')](0xcc)[_0x4ff7('0x22')]();});}};}function handleEntityNotFound(_0x2a6829,_0x56ca99){return function(_0x137180){if(!_0x137180){_0x2a6829[_0x4ff7('0x23')](0x194);}return _0x137180;};}function handleError(_0x50df4d,_0x5b0394){_0x5b0394=_0x5b0394||0x1f4;return function(_0x25ecbf){logger[_0x4ff7('0x24')](_0x25ecbf[_0x4ff7('0x25')]);if(_0x25ecbf[_0x4ff7('0x26')]){delete _0x25ecbf[_0x4ff7('0x26')];}_0x50df4d['status'](_0x5b0394)[_0x4ff7('0x27')](_0x25ecbf);};}exports['index']=function(_0x4c6aaa,_0x5a4fe3){var _0x1f717b={},_0x37f855={},_0x4c72fc={'count':0x0,'rows':[]};var _0x4ebb4f=_[_0x4ff7('0x28')](db[_0x4ff7('0x29')][_0x4ff7('0x2a')],function(_0x59b552){return{'name':_0x59b552[_0x4ff7('0x2b')],'type':_0x59b552[_0x4ff7('0x2c')][_0x4ff7('0x2d')]};});_0x37f855[_0x4ff7('0x2e')]=_[_0x4ff7('0x28')](_0x4ebb4f,_0x4ff7('0x26'));_0x37f855[_0x4ff7('0x2f')]=_[_0x4ff7('0x30')](_0x4c6aaa[_0x4ff7('0x2f')]);_0x37f855[_0x4ff7('0x31')]=_['intersection'](_0x37f855[_0x4ff7('0x2e')],_0x37f855['query']);_0x1f717b[_0x4ff7('0x32')]=_[_0x4ff7('0x33')](_0x37f855[_0x4ff7('0x2e')],qs[_0x4ff7('0x34')](_0x4c6aaa[_0x4ff7('0x2f')][_0x4ff7('0x34')]));_0x1f717b[_0x4ff7('0x32')]=_0x1f717b['attributes']['length']?_0x1f717b[_0x4ff7('0x32')]:_0x37f855[_0x4ff7('0x2e')];if(!_0x4c6aaa['query'][_0x4ff7('0x35')]('nolimit')){_0x1f717b['limit']=qs[_0x4ff7('0x1a')](_0x4c6aaa[_0x4ff7('0x2f')]['limit']);_0x1f717b[_0x4ff7('0x18')]=qs['offset'](_0x4c6aaa['query'][_0x4ff7('0x18')]);}_0x1f717b[_0x4ff7('0x36')]=qs[_0x4ff7('0x37')](_0x4c6aaa['query'][_0x4ff7('0x37')]);_0x1f717b[_0x4ff7('0x38')]=qs[_0x4ff7('0x31')](_['pick'](_0x4c6aaa[_0x4ff7('0x2f')],_0x37f855['filters']),_0x4ebb4f);if(_0x4c6aaa[_0x4ff7('0x2f')][_0x4ff7('0x39')]){_0x1f717b[_0x4ff7('0x38')]=_[_0x4ff7('0x3a')](_0x1f717b[_0x4ff7('0x38')],{'$or':[{'key':{'$like':'%'+_0x4c6aaa[_0x4ff7('0x2f')][_0x4ff7('0x39')]+'%'}},{'value':{'$like':'%'+_0x4c6aaa[_0x4ff7('0x2f')][_0x4ff7('0x39')]+'%'}}]});}_0x1f717b=_[_0x4ff7('0x3a')]({},_0x1f717b,_0x4c6aaa[_0x4ff7('0x3b')]);var _0x1e9cd9={'where':_0x1f717b[_0x4ff7('0x38')]};return db['CannedAnswer'][_0x4ff7('0x1b')](_0x1e9cd9)[_0x4ff7('0x1f')](function(_0x319314){_0x4c72fc[_0x4ff7('0x1b')]=_0x319314;if(_0x4c6aaa[_0x4ff7('0x2f')][_0x4ff7('0x3c')]){_0x1f717b[_0x4ff7('0x3d')]=[{'all':!![]}];}return db[_0x4ff7('0x29')][_0x4ff7('0x3e')](_0x1f717b);})[_0x4ff7('0x1f')](function(_0x297047){_0x4c72fc[_0x4ff7('0x3f')]=_0x297047;return _0x4c72fc;})[_0x4ff7('0x1f')](respondWithFilteredResult(_0x5a4fe3,_0x1f717b))[_0x4ff7('0x40')](handleError(_0x5a4fe3,null));};exports[_0x4ff7('0x41')]=function(_0x42ce8d,_0x4884e4){var _0x28653d={'raw':!![],'where':{'id':_0x42ce8d[_0x4ff7('0x42')]['id']}},_0x2ae320={};_0x2ae320['model']=_[_0x4ff7('0x30')](db[_0x4ff7('0x29')][_0x4ff7('0x2a')]);_0x2ae320['query']=_['keys'](_0x42ce8d[_0x4ff7('0x2f')]);_0x2ae320['filters']=_[_0x4ff7('0x33')](_0x2ae320[_0x4ff7('0x2e')],_0x2ae320[_0x4ff7('0x2f')]);_0x28653d['attributes']=_[_0x4ff7('0x33')](_0x2ae320['model'],qs[_0x4ff7('0x34')](_0x42ce8d[_0x4ff7('0x2f')]['fields']));_0x28653d[_0x4ff7('0x32')]=_0x28653d[_0x4ff7('0x32')][_0x4ff7('0x43')]?_0x28653d[_0x4ff7('0x32')]:_0x2ae320['model'];if(_0x42ce8d[_0x4ff7('0x2f')][_0x4ff7('0x3c')]){_0x28653d[_0x4ff7('0x3d')]=[{'all':!![]}];}_0x28653d=_[_0x4ff7('0x3a')]({},_0x28653d,_0x42ce8d[_0x4ff7('0x3b')]);return db[_0x4ff7('0x29')][_0x4ff7('0x44')](_0x28653d)['then'](handleEntityNotFound(_0x4884e4,null))[_0x4ff7('0x1f')](respondWithResult(_0x4884e4,null))[_0x4ff7('0x40')](handleError(_0x4884e4,null));};exports[_0x4ff7('0x45')]=function(_0x4381d8,_0x501afd){if(_0x4381d8[_0x4ff7('0x46')]['id']){delete _0x4381d8[_0x4ff7('0x46')]['id'];}return db[_0x4ff7('0x29')][_0x4ff7('0x44')]({'where':{'id':_0x4381d8[_0x4ff7('0x42')]['id']}})[_0x4ff7('0x1f')](handleEntityNotFound(_0x501afd,null))[_0x4ff7('0x1f')](saveUpdates(_0x4381d8[_0x4ff7('0x46')],null))[_0x4ff7('0x1f')](respondWithResult(_0x501afd,null))['catch'](handleError(_0x501afd,null));};exports[_0x4ff7('0x21')]=function(_0x108d97,_0x1e4564){return db[_0x4ff7('0x29')][_0x4ff7('0x44')]({'where':{'id':_0x108d97[_0x4ff7('0x42')]['id']}})[_0x4ff7('0x1f')](handleEntityNotFound(_0x1e4564,null))[_0x4ff7('0x1f')](removeEntity(_0x1e4564,null))['catch'](handleError(_0x1e4564,null));};exports[_0x4ff7('0x47')]=function(_0x5c066f,_0x2976da){var _0x7166ad={'key':_0x5c066f[_0x4ff7('0x46')][_0x4ff7('0x2d')]};if(_0x5c066f[_0x4ff7('0x46')][_0x4ff7('0x48')]){_0x7166ad['MailAccountId']=_0x5c066f[_0x4ff7('0x46')][_0x4ff7('0x48')];}else if(_0x5c066f[_0x4ff7('0x46')]['SmsAccountId']){_0x7166ad['SmsAccountId']=_0x5c066f[_0x4ff7('0x46')][_0x4ff7('0x49')];}else if(_0x5c066f[_0x4ff7('0x46')][_0x4ff7('0x4a')]){_0x7166ad[_0x4ff7('0x4a')]=_0x5c066f[_0x4ff7('0x46')]['OpenchannelAccountId'];}else if(_0x5c066f[_0x4ff7('0x46')][_0x4ff7('0x4b')]){_0x7166ad[_0x4ff7('0x4b')]=_0x5c066f['body'][_0x4ff7('0x4b')];}return db['CannedAnswer'][_0x4ff7('0x44')]({'where':_0x7166ad})[_0x4ff7('0x1f')](function(_0x5702ac){if(_0x5702ac){throw new db[(_0x4ff7('0x4c'))][(_0x4ff7('0x4d'))](_0x4ff7('0x4e'));}return db[_0x4ff7('0x29')][_0x4ff7('0x47')](_0x5c066f[_0x4ff7('0x46')]);})[_0x4ff7('0x1f')](function(_0x149b6f){var _0x49f1cd=_0x5c066f['user'][_0x4ff7('0x4f')]({'plain':!![]});if(!_0x49f1cd)throw new Error(_0x4ff7('0x50'));if(_0x49f1cd['role']===_0x4ff7('0x51')){var _0x5effdd=_0x149b6f[_0x4ff7('0x4f')]({'plain':!![]});return db[_0x4ff7('0x52')][_0x4ff7('0x44')]({'where':{'name':_0x4ff7('0x20'),'userProfileId':_0x49f1cd['userProfileId']},'raw':!![]})[_0x4ff7('0x1f')](function(_0x53dfdd){if(_0x53dfdd&&_0x53dfdd[_0x4ff7('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x5effdd['name'],'resourceId':_0x5effdd['id'],'type':_0x53dfdd[_0x4ff7('0x26')],'sectionId':_0x53dfdd['id']},{})['then'](function(){return _0x149b6f;});}else{return _0x149b6f;}})['catch'](function(_0x58d172){logger[_0x4ff7('0x24')](_0x4ff7('0x54'),_0x58d172);throw _0x58d172;});}return _0x149b6f;})['then'](respondWithResult(_0x2976da,0xc9))['catch'](handleError(_0x2976da,null));};
\ No newline at end of file
+var _0x85e3=['set','json','apply','reject','save','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','update','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit'];(function(_0x6d21a1,_0x5edd09){var _0x1551f2=function(_0x34bd63){while(--_0x34bd63){_0x6d21a1['push'](_0x6d21a1['shift']());}};_0x1551f2(++_0x5edd09);}(_0x85e3,0x91));var _0x385e=function(_0x5d136f,_0x3f0c95){_0x5d136f=_0x5d136f-0x0;var _0x56c7e4=_0x85e3[_0x5d136f];return _0x56c7e4;};'use strict';var emlformat=require(_0x385e('0x0'));var rimraf=require(_0x385e('0x1'));var zipdir=require(_0x385e('0x2'));var jsonpatch=require(_0x385e('0x3'));var rp=require(_0x385e('0x4'));var moment=require(_0x385e('0x5'));var BPromise=require(_0x385e('0x6'));var Mustache=require(_0x385e('0x7'));var util=require(_0x385e('0x8'));var path=require(_0x385e('0x9'));var sox=require(_0x385e('0xa'));var csv=require(_0x385e('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x385e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x385e('0xd'));var deskjs=require(_0x385e('0xe'));var toCsv=require(_0x385e('0xb'));var querystring=require(_0x385e('0xf'));var Papa=require(_0x385e('0x10'));var Redis=require(_0x385e('0x11'));var authService=require(_0x385e('0x12'));var qs=require(_0x385e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x385e('0x14'))(_0x385e('0x15'));var utils=require('../../config/utils');var config=require(_0x385e('0x16'));var licenseUtil=require(_0x385e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x576a26,_0x301500){_0x301500=_0x301500||0xcc;return function(_0x535013){if(_0x535013){return _0x576a26[_0x385e('0x18')](_0x301500);}return _0x576a26[_0x385e('0x19')](_0x301500)[_0x385e('0x1a')]();};}function respondWithResult(_0x29e828,_0xaa2f8f){_0xaa2f8f=_0xaa2f8f||0xc8;return function(_0x1834d7){if(_0x1834d7){return _0x29e828[_0x385e('0x19')](_0xaa2f8f)['json'](_0x1834d7);}};}function respondWithFilteredResult(_0x550309,_0x13a2f0){return function(_0x5bb84c){if(_0x5bb84c){var _0x19e541=typeof _0x13a2f0['offset']===_0x385e('0x1b')&&typeof _0x13a2f0['limit']===_0x385e('0x1b');var _0x2454b2=_0x5bb84c[_0x385e('0x1c')];var _0x2acf8a=_0x19e541?0x0:_0x13a2f0['offset'];var _0x4ee494=_0x19e541?_0x5bb84c[_0x385e('0x1c')]:_0x13a2f0[_0x385e('0x1d')]+_0x13a2f0[_0x385e('0x1e')];var _0x31c2de;if(_0x4ee494>=_0x2454b2){_0x4ee494=_0x2454b2;_0x31c2de=0xc8;}else{_0x31c2de=0xce;}_0x550309['status'](_0x31c2de);return _0x550309[_0x385e('0x1f')]('Content-Range',_0x2acf8a+'-'+_0x4ee494+'/'+_0x2454b2)[_0x385e('0x20')](_0x5bb84c);}return null;};}function patchUpdates(_0x2fd289){return function(_0x4fbe34){try{jsonpatch[_0x385e('0x21')](_0x4fbe34,_0x2fd289,!![]);}catch(_0x385489){return BPromise[_0x385e('0x22')](_0x385489);}return _0x4fbe34[_0x385e('0x23')]();};}function saveUpdates(_0x12bf89,_0x542905){return function(_0x3ce845){if(_0x3ce845){return _0x3ce845['update'](_0x12bf89)['then'](function(_0x3b5528){return _0x3b5528;});}return null;};}function removeEntity(_0x465f78,_0x36ef94){return function(_0x3f0520){if(_0x3f0520){return _0x3f0520[_0x385e('0x24')]()[_0x385e('0x25')](function(){var _0x53588e=_0x3f0520[_0x385e('0x26')]({'plain':!![]});var _0x6d5978=_0x385e('0x27');return db[_0x385e('0x28')][_0x385e('0x24')]({'where':{'type':_0x6d5978,'resourceId':_0x53588e['id']}})[_0x385e('0x25')](function(){return _0x3f0520;});})[_0x385e('0x25')](function(){_0x465f78[_0x385e('0x19')](0xcc)[_0x385e('0x1a')]();});}};}function handleEntityNotFound(_0x2ca29a,_0x2ca57){return function(_0x450460){if(!_0x450460){_0x2ca29a[_0x385e('0x18')](0x194);}return _0x450460;};}function handleError(_0x274e11,_0x49e949){_0x49e949=_0x49e949||0x1f4;return function(_0x339709){logger[_0x385e('0x29')](_0x339709[_0x385e('0x2a')]);if(_0x339709[_0x385e('0x2b')]){delete _0x339709['name'];}_0x274e11[_0x385e('0x19')](_0x49e949)[_0x385e('0x2c')](_0x339709);};}exports[_0x385e('0x2d')]=function(_0x3ebc8f,_0xb8e22e){var _0x58a05e={},_0x59e44c={},_0x889f6e={'count':0x0,'rows':[]};var _0x3413a2=_[_0x385e('0x2e')](db[_0x385e('0x2f')][_0x385e('0x30')],function(_0x5cac25){return{'name':_0x5cac25[_0x385e('0x31')],'type':_0x5cac25['type']['key']};});_0x59e44c[_0x385e('0x32')]=_['map'](_0x3413a2,_0x385e('0x2b'));_0x59e44c[_0x385e('0x33')]=_[_0x385e('0x34')](_0x3ebc8f['query']);_0x59e44c[_0x385e('0x35')]=_['intersection'](_0x59e44c[_0x385e('0x32')],_0x59e44c[_0x385e('0x33')]);_0x58a05e[_0x385e('0x36')]=_[_0x385e('0x37')](_0x59e44c[_0x385e('0x32')],qs['fields'](_0x3ebc8f[_0x385e('0x33')][_0x385e('0x38')]));_0x58a05e[_0x385e('0x36')]=_0x58a05e[_0x385e('0x36')][_0x385e('0x39')]?_0x58a05e[_0x385e('0x36')]:_0x59e44c[_0x385e('0x32')];if(!_0x3ebc8f[_0x385e('0x33')][_0x385e('0x3a')](_0x385e('0x3b'))){_0x58a05e['limit']=qs[_0x385e('0x1e')](_0x3ebc8f['query']['limit']);_0x58a05e[_0x385e('0x1d')]=qs[_0x385e('0x1d')](_0x3ebc8f[_0x385e('0x33')][_0x385e('0x1d')]);}_0x58a05e['order']=qs[_0x385e('0x3c')](_0x3ebc8f[_0x385e('0x33')][_0x385e('0x3c')]);_0x58a05e[_0x385e('0x3d')]=qs[_0x385e('0x35')](_[_0x385e('0x3e')](_0x3ebc8f['query'],_0x59e44c[_0x385e('0x35')]),_0x3413a2);if(_0x3ebc8f['query'][_0x385e('0x3f')]){_0x58a05e['where']=_['merge'](_0x58a05e[_0x385e('0x3d')],{'$or':[{'key':{'$like':'%'+_0x3ebc8f[_0x385e('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x3ebc8f[_0x385e('0x33')]['filter']+'%'}}]});}_0x58a05e=_[_0x385e('0x40')]({},_0x58a05e,_0x3ebc8f[_0x385e('0x41')]);var _0x129cf9={'where':_0x58a05e['where']};return db[_0x385e('0x2f')]['count'](_0x129cf9)[_0x385e('0x25')](function(_0x31698d){_0x889f6e[_0x385e('0x1c')]=_0x31698d;if(_0x3ebc8f['query'][_0x385e('0x42')]){_0x58a05e[_0x385e('0x43')]=[{'all':!![]}];}return db[_0x385e('0x2f')][_0x385e('0x44')](_0x58a05e);})['then'](function(_0x494c5e){_0x889f6e[_0x385e('0x45')]=_0x494c5e;return _0x889f6e;})[_0x385e('0x25')](respondWithFilteredResult(_0xb8e22e,_0x58a05e))['catch'](handleError(_0xb8e22e,null));};exports['show']=function(_0x19548a,_0x553af9){var _0x3502d7={'raw':!![],'where':{'id':_0x19548a[_0x385e('0x46')]['id']}},_0x269c69={};_0x269c69['model']=_[_0x385e('0x34')](db[_0x385e('0x2f')][_0x385e('0x30')]);_0x269c69[_0x385e('0x33')]=_['keys'](_0x19548a['query']);_0x269c69[_0x385e('0x35')]=_[_0x385e('0x37')](_0x269c69[_0x385e('0x32')],_0x269c69[_0x385e('0x33')]);_0x3502d7['attributes']=_[_0x385e('0x37')](_0x269c69['model'],qs[_0x385e('0x38')](_0x19548a[_0x385e('0x33')]['fields']));_0x3502d7['attributes']=_0x3502d7[_0x385e('0x36')][_0x385e('0x39')]?_0x3502d7[_0x385e('0x36')]:_0x269c69[_0x385e('0x32')];if(_0x19548a[_0x385e('0x33')][_0x385e('0x42')]){_0x3502d7[_0x385e('0x43')]=[{'all':!![]}];}_0x3502d7=_[_0x385e('0x40')]({},_0x3502d7,_0x19548a['options']);return db[_0x385e('0x2f')][_0x385e('0x47')](_0x3502d7)[_0x385e('0x25')](handleEntityNotFound(_0x553af9,null))[_0x385e('0x25')](respondWithResult(_0x553af9,null))[_0x385e('0x48')](handleError(_0x553af9,null));};exports[_0x385e('0x49')]=function(_0x5ca954,_0xe91692){if(_0x5ca954['body']['id']){delete _0x5ca954[_0x385e('0x4a')]['id'];}return db['CannedAnswer'][_0x385e('0x47')]({'where':{'id':_0x5ca954[_0x385e('0x46')]['id']}})[_0x385e('0x25')](handleEntityNotFound(_0xe91692,null))[_0x385e('0x25')](saveUpdates(_0x5ca954[_0x385e('0x4a')],null))[_0x385e('0x25')](respondWithResult(_0xe91692,null))[_0x385e('0x48')](handleError(_0xe91692,null));};exports['destroy']=function(_0x2dca7f,_0x457d97){return db[_0x385e('0x2f')][_0x385e('0x47')]({'where':{'id':_0x2dca7f[_0x385e('0x46')]['id']}})['then'](handleEntityNotFound(_0x457d97,null))[_0x385e('0x25')](removeEntity(_0x457d97,null))['catch'](handleError(_0x457d97,null));};exports[_0x385e('0x4b')]=function(_0x5266db,_0x3e20c8){var _0x55456e={'key':_0x5266db['body'][_0x385e('0x4c')]};if(_0x5266db[_0x385e('0x4a')][_0x385e('0x4d')]){_0x55456e['MailAccountId']=_0x5266db[_0x385e('0x4a')][_0x385e('0x4d')];}else if(_0x5266db['body']['SmsAccountId']){_0x55456e[_0x385e('0x4e')]=_0x5266db[_0x385e('0x4a')]['SmsAccountId'];}else if(_0x5266db['body'][_0x385e('0x4f')]){_0x55456e[_0x385e('0x4f')]=_0x5266db[_0x385e('0x4a')][_0x385e('0x4f')];}else if(_0x5266db['body'][_0x385e('0x50')]){_0x55456e[_0x385e('0x50')]=_0x5266db['body'][_0x385e('0x50')];}return db[_0x385e('0x2f')][_0x385e('0x47')]({'where':_0x55456e})[_0x385e('0x25')](function(_0xdab304){if(_0xdab304){throw new db['Sequelize']['ValidationError'](_0x385e('0x51'));}return db[_0x385e('0x2f')]['create'](_0x5266db[_0x385e('0x4a')]);})['then'](function(_0x220d38){var _0x3b76bb=_0x5266db[_0x385e('0x52')][_0x385e('0x26')]({'plain':!![]});if(!_0x3b76bb)throw new Error(_0x385e('0x53'));if(_0x3b76bb[_0x385e('0x54')]==='user'){var _0x10ccb4=_0x220d38[_0x385e('0x26')]({'plain':!![]});return db[_0x385e('0x55')][_0x385e('0x47')]({'where':{'name':_0x385e('0x27'),'userProfileId':_0x3b76bb[_0x385e('0x56')]},'raw':!![]})[_0x385e('0x25')](function(_0x5d75f0){if(_0x5d75f0&&_0x5d75f0['autoAssociation']===0x0){return db[_0x385e('0x28')][_0x385e('0x4b')]({'name':_0x10ccb4[_0x385e('0x2b')],'resourceId':_0x10ccb4['id'],'type':_0x5d75f0['name'],'sectionId':_0x5d75f0['id']},{})['then'](function(){return _0x220d38;});}else{return _0x220d38;}})['catch'](function(_0x2cc624){logger[_0x385e('0x29')](_0x385e('0x57'),_0x2cc624);throw _0x2cc624;});}return _0x220d38;})[_0x385e('0x25')](respondWithResult(_0x3e20c8,0xc9))['catch'](handleError(_0x3e20c8,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 92790fc..598f5a0 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 _0x3cab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','utf8mb4_unicode_ci'];(function(_0x280aec,_0xfa1614){var _0x443a19=function(_0x369720){while(--_0x369720){_0x280aec['push'](_0x280aec['shift']());}};_0x443a19(++_0xfa1614);}(_0x3cab,0x1bc));var _0xb3ca=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x3cab[_0x5959c9];return _0x4ffcbc;};'use strict';var _=require(_0xb3ca('0x0'));var util=require(_0xb3ca('0x1'));var logger=require(_0xb3ca('0x2'))(_0xb3ca('0x3'));var moment=require(_0xb3ca('0x4'));var BPromise=require(_0xb3ca('0x5'));var rp=require(_0xb3ca('0x6'));var fs=require('fs');var path=require(_0xb3ca('0x7'));var rimraf=require('rimraf');var config=require(_0xb3ca('0x8'));var attributes=require(_0xb3ca('0x9'));module[_0xb3ca('0xa')]=function(_0x462312,_0x327f7f){return _0x462312['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb3ca('0xb')});};
\ No newline at end of file
+var _0xc5bd=['tools_canned_answers','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x4b484f,_0xac18d){var _0x39c8e7=function(_0x5b4822){while(--_0x5b4822){_0x4b484f['push'](_0x4b484f['shift']());}};_0x39c8e7(++_0xac18d);}(_0xc5bd,0xc1));var _0xdc5b=function(_0x3686f2,_0x37205f){_0x3686f2=_0x3686f2-0x0;var _0x4edf4a=_0xc5bd[_0x3686f2];return _0x4edf4a;};'use strict';var _=require(_0xdc5b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdc5b('0x1'));var moment=require(_0xdc5b('0x2'));var BPromise=require(_0xdc5b('0x3'));var rp=require(_0xdc5b('0x4'));var fs=require('fs');var path=require(_0xdc5b('0x5'));var rimraf=require('rimraf');var config=require(_0xdc5b('0x6'));var attributes=require(_0xdc5b('0x7'));module[_0xdc5b('0x8')]=function(_0x417f84,_0x2159a1){return _0x417f84[_0xdc5b('0x9')](_0xdc5b('0xa'),attributes,{'tableName':_0xdc5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index ac9397a..56eb117 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(_0xbeafa0,_0x3ce883){var _0xd26056=function(_0x2dbc5a){while(--_0x2dbc5a){_0xbeafa0['push'](_0xbeafa0['shift']());}};_0xd26056(++_0x3ce883);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x1a5ad0,_0x52029d){var _0x113de4=function(_0x4c7973){while(--_0x4c7973){_0x1a5ad0['push'](_0x1a5ad0['shift']());}};_0x113de4(++_0x52029d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 3f91a20..3a0557a 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 _0x035b=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x42d000,_0xe5ff9d){var _0x34955b=function(_0xa94dc6){while(--_0xa94dc6){_0x42d000['push'](_0x42d000['shift']());}};_0x34955b(++_0xe5ff9d);}(_0x035b,0x11d));var _0xb035=function(_0x42c92d,_0x183b56){_0x42c92d=_0x42c92d-0x0;var _0x5de097=_0x035b[_0x42c92d];return _0x5de097;};'use strict';var multer=require(_0xb035('0x0'));var util=require(_0xb035('0x1'));var path=require(_0xb035('0x2'));var timeout=require('connect-timeout');var express=require(_0xb035('0x3'));var router=express[_0xb035('0x4')]();var fs_extra=require(_0xb035('0x5'));var auth=require(_0xb035('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb035('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xb035('0x8')](),controller[_0xb035('0x9')]);router[_0xb035('0xa')](_0xb035('0xb'),auth[_0xb035('0x8')](),controller[_0xb035('0xc')]);router[_0xb035('0xd')]('/',auth['isAuthenticated'](),controller[_0xb035('0xe')]);router[_0xb035('0xf')](_0xb035('0xb'),auth[_0xb035('0x8')](),controller[_0xb035('0x10')]);router[_0xb035('0x11')](_0xb035('0xb'),auth[_0xb035('0x8')](),controller[_0xb035('0x12')]);module[_0xb035('0x13')]=router;
\ No newline at end of file
+var _0x0e18=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout','express','fs-extra'];(function(_0x4603b4,_0xb3ba9f){var _0x29607b=function(_0x409818){while(--_0x409818){_0x4603b4['push'](_0x4603b4['shift']());}};_0x29607b(++_0xb3ba9f);}(_0x0e18,0x164));var _0x80e1=function(_0x284e7e,_0x1675c1){_0x284e7e=_0x284e7e-0x0;var _0x2c5fa6=_0x0e18[_0x284e7e];return _0x2c5fa6;};'use strict';var multer=require(_0x80e1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x80e1('0x1'));var express=require(_0x80e1('0x2'));var router=express['Router']();var fs_extra=require(_0x80e1('0x3'));var auth=require(_0x80e1('0x4'));var interaction=require(_0x80e1('0x5'));var config=require(_0x80e1('0x6'));var controller=require(_0x80e1('0x7'));router[_0x80e1('0x8')]('/',auth[_0x80e1('0x9')](),controller[_0x80e1('0xa')]);router['get'](_0x80e1('0xb'),auth[_0x80e1('0x9')](),controller[_0x80e1('0xc')]);router[_0x80e1('0xd')]('/',auth[_0x80e1('0x9')](),controller['create']);router[_0x80e1('0xe')](_0x80e1('0xb'),auth['isAuthenticated'](),controller[_0x80e1('0xf')]);router[_0x80e1('0x10')](_0x80e1('0xb'),auth[_0x80e1('0x9')](),controller[_0x80e1('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index d8be32b..2f129fa 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 _0x01bb=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x1e9467,_0x2c8f00){var _0x2ff9e0=function(_0x1a5be8){while(--_0x1a5be8){_0x1e9467['push'](_0x1e9467['shift']());}};_0x2ff9e0(++_0x2c8f00);}(_0x01bb,0x171));var _0xb01b=function(_0x24ba3d,_0x45c8be){_0x24ba3d=_0x24ba3d-0x0;var _0x21ea8e=_0x01bb[_0x24ba3d];return _0x21ea8e;};'use strict';var Sequelize=require(_0xb01b('0x0'));module[_0xb01b('0x1')]={'calldate':{'type':Sequelize[_0xb01b('0x2')],'allowNull':![],'defaultValue':_0xb01b('0x3')},'clid':{'type':Sequelize[_0xb01b('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb01b('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb01b('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xb01b('0x4')]},'duration':{'type':Sequelize[_0xb01b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb01b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb01b('0x4')]},'amaflags':{'type':Sequelize[_0xb01b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb01b('0x4')]},'userfield':{'type':Sequelize[_0xb01b('0x4')]},'uniqueid':{'type':Sequelize[_0xb01b('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xb01b('0x4')]},'peeraccount':{'type':Sequelize[_0xb01b('0x4')]},'type':{'type':Sequelize[_0xb01b('0x4')]},'tag':{'type':Sequelize[_0xb01b('0x4')]}};
\ No newline at end of file
+var _0xea1a=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xea1a,0x158));var _0xaea1=function(_0x369799,_0x2ae723){_0x369799=_0x369799-0x0;var _0x1bcd73=_0xea1a[_0x369799];return _0x1bcd73;};'use strict';var Sequelize=require(_0xaea1('0x0'));module[_0xaea1('0x1')]={'calldate':{'type':Sequelize[_0xaea1('0x2')],'allowNull':![],'defaultValue':_0xaea1('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xaea1('0x4')]},'dst':{'type':Sequelize[_0xaea1('0x4')]},'dcontext':{'type':Sequelize[_0xaea1('0x4')]},'channel':{'type':Sequelize[_0xaea1('0x4')]},'dstchannel':{'type':Sequelize[_0xaea1('0x4')]},'lastapp':{'type':Sequelize[_0xaea1('0x4')]},'lastdata':{'type':Sequelize[_0xaea1('0x4')]},'duration':{'type':Sequelize[_0xaea1('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaea1('0x4')]},'amaflags':{'type':Sequelize[_0xaea1('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaea1('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xaea1('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xaea1('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaea1('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 02011cd..ec7067e 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 _0xa3e6=['offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Cdr','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x50a135,_0xb52816){var _0x50dc88=function(_0x1927f1){while(--_0x1927f1){_0x50a135['push'](_0x50a135['shift']());}};_0x50dc88(++_0xb52816);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x229107,_0x49a4e3){_0x229107=_0x229107-0x0;var _0x537417=_0xa3e6[_0x229107];return _0x537417;};'use strict';var emlformat=require(_0x6a3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a3e('0x2'));var moment=require(_0x6a3e('0x3'));var BPromise=require(_0x6a3e('0x4'));var Mustache=require('mustache');var util=require(_0x6a3e('0x5'));var path=require('path');var sox=require(_0x6a3e('0x6'));var csv=require(_0x6a3e('0x7'));var ejs=require(_0x6a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x6a3e('0x9'));var _=require(_0x6a3e('0xa'));var squel=require('squel');var crypto=require(_0x6a3e('0xb'));var jsforce=require(_0x6a3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a3e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a3e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6a3e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a3e('0x10'))(_0x6a3e('0x11'));var utils=require(_0x6a3e('0x12'));var config=require(_0x6a3e('0x13'));var licenseUtil=require(_0x6a3e('0x14'));var db=require(_0x6a3e('0x15'))['db'];function respondWithStatusCode(_0x4a3a97,_0x27e169){_0x27e169=_0x27e169||0xcc;return function(_0x385c29){if(_0x385c29){return _0x4a3a97[_0x6a3e('0x16')](_0x27e169);}return _0x4a3a97[_0x6a3e('0x17')](_0x27e169)[_0x6a3e('0x18')]();};}function respondWithResult(_0x31aefa,_0x222f7c){_0x222f7c=_0x222f7c||0xc8;return function(_0x4bd05f){if(_0x4bd05f){return _0x31aefa[_0x6a3e('0x17')](_0x222f7c)[_0x6a3e('0x19')](_0x4bd05f);}};}function respondWithFilteredResult(_0x8ed74b,_0x2a62a8){return function(_0x500ccd){if(_0x500ccd){var _0x462b8d=typeof _0x2a62a8[_0x6a3e('0x1a')]==='undefined'&&typeof _0x2a62a8['limit']==='undefined';var _0x58b221=_0x500ccd['count'];var _0x3693a2=_0x462b8d?0x0:_0x2a62a8[_0x6a3e('0x1a')];var _0x31a190=_0x462b8d?_0x500ccd[_0x6a3e('0x1b')]:_0x2a62a8[_0x6a3e('0x1a')]+_0x2a62a8[_0x6a3e('0x1c')];var _0x1d6ccc;if(_0x31a190>=_0x58b221){_0x31a190=_0x58b221;_0x1d6ccc=0xc8;}else{_0x1d6ccc=0xce;}_0x8ed74b[_0x6a3e('0x17')](_0x1d6ccc);return _0x8ed74b['set'](_0x6a3e('0x1d'),_0x3693a2+'-'+_0x31a190+'/'+_0x58b221)['json'](_0x500ccd);}return null;};}function patchUpdates(_0xc0452f){return function(_0x5ae73b){try{jsonpatch[_0x6a3e('0x1e')](_0x5ae73b,_0xc0452f,!![]);}catch(_0x131d80){return BPromise[_0x6a3e('0x1f')](_0x131d80);}return _0x5ae73b[_0x6a3e('0x20')]();};}function saveUpdates(_0x58721c,_0x4f7507){return function(_0x215ac1){if(_0x215ac1){return _0x215ac1[_0x6a3e('0x21')](_0x58721c)[_0x6a3e('0x22')](function(_0x4687d0){return _0x4687d0;});}return null;};}function removeEntity(_0x4e5a25,_0x1ae966){return function(_0x21b5aa){if(_0x21b5aa){return _0x21b5aa[_0x6a3e('0x23')]()[_0x6a3e('0x22')](function(){_0x4e5a25[_0x6a3e('0x17')](0xcc)[_0x6a3e('0x18')]();});}};}function handleEntityNotFound(_0x359460,_0x83e681){return function(_0x25fc14){if(!_0x25fc14){_0x359460[_0x6a3e('0x16')](0x194);}return _0x25fc14;};}function handleError(_0x5b1ed9,_0x4ec834){_0x4ec834=_0x4ec834||0x1f4;return function(_0x150992){logger[_0x6a3e('0x24')](_0x150992[_0x6a3e('0x25')]);if(_0x150992[_0x6a3e('0x26')]){delete _0x150992[_0x6a3e('0x26')];}_0x5b1ed9[_0x6a3e('0x17')](_0x4ec834)[_0x6a3e('0x27')](_0x150992);};}exports[_0x6a3e('0x28')]=function(_0xd87198,_0x436169){var _0x3a831b={},_0x508a55={},_0x4eec67={'count':0x0,'rows':[]};var _0x2a2b2a=_['map'](db[_0x6a3e('0x29')]['rawAttributes'],function(_0x553fc5){return{'name':_0x553fc5[_0x6a3e('0x2a')],'type':_0x553fc5[_0x6a3e('0x2b')]['key']};});_0x508a55['model']=_[_0x6a3e('0x2c')](_0x2a2b2a,_0x6a3e('0x26'));_0x508a55[_0x6a3e('0x2d')]=_[_0x6a3e('0x2e')](_0xd87198['query']);_0x508a55['filters']=_[_0x6a3e('0x2f')](_0x508a55[_0x6a3e('0x30')],_0x508a55[_0x6a3e('0x2d')]);_0x3a831b[_0x6a3e('0x31')]=_['intersection'](_0x508a55[_0x6a3e('0x30')],qs[_0x6a3e('0x32')](_0xd87198['query']['fields']));_0x3a831b['attributes']=_0x3a831b[_0x6a3e('0x31')][_0x6a3e('0x33')]?_0x3a831b[_0x6a3e('0x31')]:_0x508a55[_0x6a3e('0x30')];if(!_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x34')](_0x6a3e('0x35'))){_0x3a831b[_0x6a3e('0x1c')]=qs[_0x6a3e('0x1c')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x1c')]);_0x3a831b[_0x6a3e('0x1a')]=qs[_0x6a3e('0x1a')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x1a')]);}_0x3a831b['order']=qs[_0x6a3e('0x36')](_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x36')]);_0x3a831b['where']=qs[_0x6a3e('0x37')](_[_0x6a3e('0x38')](_0xd87198['query'],_0x508a55[_0x6a3e('0x37')]),_0x2a2b2a);if(_0xd87198[_0x6a3e('0x2d')][_0x6a3e('0x39')]){_0x3a831b['where']=_[_0x6a3e('0x3a')](_0x3a831b[_0x6a3e('0x3b')],{'$or':_[_0x6a3e('0x2c')](_0x2a2b2a,function(_0x3e604c){if(_0x3e604c[_0x6a3e('0x2b')]!==_0x6a3e('0x3c')){var _0x5f4ff5={};_0x5f4ff5[_0x3e604c[_0x6a3e('0x26')]]={'$like':'%'+_0xd87198['query']['filter']+'%'};return _0x5f4ff5;}})});}_0x3a831b=_['merge']({},_0x3a831b,_0xd87198[_0x6a3e('0x3d')]);var _0x4bb1ba={'where':_0x3a831b[_0x6a3e('0x3b')]};return db[_0x6a3e('0x29')][_0x6a3e('0x1b')](_0x4bb1ba)[_0x6a3e('0x22')](function(_0xca83d2){_0x4eec67[_0x6a3e('0x1b')]=_0xca83d2;if(_0xd87198['query']['includeAll']){_0x3a831b[_0x6a3e('0x3e')]=[{'all':!![]}];}return db[_0x6a3e('0x29')][_0x6a3e('0x3f')](_0x3a831b);})[_0x6a3e('0x22')](function(_0x1dd524){_0x4eec67['rows']=_0x1dd524;return _0x4eec67;})[_0x6a3e('0x22')](respondWithFilteredResult(_0x436169,_0x3a831b))[_0x6a3e('0x40')](handleError(_0x436169,null));};exports['show']=function(_0x35c927,_0x417f8a){var _0x35c836={'raw':!![],'where':{'id':_0x35c927[_0x6a3e('0x41')]['id']}},_0x53ad48={};_0x53ad48[_0x6a3e('0x30')]=_[_0x6a3e('0x2e')](db[_0x6a3e('0x29')][_0x6a3e('0x42')]);_0x53ad48[_0x6a3e('0x2d')]=_['keys'](_0x35c927[_0x6a3e('0x2d')]);_0x53ad48[_0x6a3e('0x37')]=_[_0x6a3e('0x2f')](_0x53ad48['model'],_0x53ad48[_0x6a3e('0x2d')]);_0x35c836['attributes']=_['intersection'](_0x53ad48[_0x6a3e('0x30')],qs[_0x6a3e('0x32')](_0x35c927[_0x6a3e('0x2d')]['fields']));_0x35c836['attributes']=_0x35c836[_0x6a3e('0x31')][_0x6a3e('0x33')]?_0x35c836[_0x6a3e('0x31')]:_0x53ad48[_0x6a3e('0x30')];if(_0x35c927[_0x6a3e('0x2d')][_0x6a3e('0x43')]){_0x35c836['include']=[{'all':!![]}];}_0x35c836=_[_0x6a3e('0x3a')]({},_0x35c836,_0x35c927[_0x6a3e('0x3d')]);return db[_0x6a3e('0x29')][_0x6a3e('0x44')](_0x35c836)[_0x6a3e('0x22')](handleEntityNotFound(_0x417f8a,null))[_0x6a3e('0x22')](respondWithResult(_0x417f8a,null))[_0x6a3e('0x40')](handleError(_0x417f8a,null));};exports[_0x6a3e('0x45')]=function(_0x2d0685,_0x4d36e2){return db[_0x6a3e('0x29')][_0x6a3e('0x45')](_0x2d0685['body'],{})[_0x6a3e('0x22')](respondWithResult(_0x4d36e2,0xc9))['catch'](handleError(_0x4d36e2,null));};exports[_0x6a3e('0x21')]=function(_0x10cd8e,_0x28a3e9){if(_0x10cd8e['body']['id']){delete _0x10cd8e[_0x6a3e('0x46')]['id'];}return db[_0x6a3e('0x29')]['find']({'where':{'id':_0x10cd8e['params']['id']}})['then'](handleEntityNotFound(_0x28a3e9,null))[_0x6a3e('0x22')](saveUpdates(_0x10cd8e[_0x6a3e('0x46')],null))[_0x6a3e('0x22')](respondWithResult(_0x28a3e9,null))[_0x6a3e('0x40')](handleError(_0x28a3e9,null));};exports[_0x6a3e('0x23')]=function(_0x448e46,_0x404473){return db[_0x6a3e('0x29')][_0x6a3e('0x44')]({'where':{'id':_0x448e46[_0x6a3e('0x41')]['id']}})[_0x6a3e('0x22')](handleEntityNotFound(_0x404473,null))['then'](removeEntity(_0x404473,null))[_0x6a3e('0x40')](handleError(_0x404473,null));};exports[_0x6a3e('0x47')]=function(_0x3fabf8,_0x21ba7b){return db[_0x6a3e('0x29')]['describe']()[_0x6a3e('0x22')](respondWithResult(_0x21ba7b,null))['catch'](handleError(_0x21ba7b,null));};
\ No newline at end of file
+var _0xae24=['destroy','stack','name','send','index','map','Cdr','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','findAll','catch','params','rawAttributes','fields','length','includeAll','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then'];(function(_0x3755be,_0x31d4e7){var _0x7996af=function(_0x1524a5){while(--_0x1524a5){_0x3755be['push'](_0x3755be['shift']());}};_0x7996af(++_0x31d4e7);}(_0xae24,0x182));var _0x4ae2=function(_0x5aa226,_0x75f26c){_0x5aa226=_0x5aa226-0x0;var _0x537fc3=_0xae24[_0x5aa226];return _0x537fc3;};'use strict';var emlformat=require(_0x4ae2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ae2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ae2('0x2'));var moment=require(_0x4ae2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ae2('0x4'));var path=require('path');var sox=require(_0x4ae2('0x5'));var csv=require(_0x4ae2('0x6'));var ejs=require(_0x4ae2('0x7'));var fs=require('fs');var fs_extra=require(_0x4ae2('0x8'));var _=require(_0x4ae2('0x9'));var squel=require(_0x4ae2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ae2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ae2('0xc'));var Redis=require(_0x4ae2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4ae2('0xe'));var as=require(_0x4ae2('0xf'));var hardwareService=require(_0x4ae2('0x10'));var logger=require(_0x4ae2('0x11'))('api');var utils=require(_0x4ae2('0x12'));var config=require(_0x4ae2('0x13'));var licenseUtil=require(_0x4ae2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d2b4,_0x22ac1e){_0x22ac1e=_0x22ac1e||0xcc;return function(_0x30d6c4){if(_0x30d6c4){return _0x25d2b4[_0x4ae2('0x15')](_0x22ac1e);}return _0x25d2b4[_0x4ae2('0x16')](_0x22ac1e)[_0x4ae2('0x17')]();};}function respondWithResult(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0xc8;return function(_0xd527a0){if(_0xd527a0){return _0x145287['status'](_0x3cabc9)['json'](_0xd527a0);}};}function respondWithFilteredResult(_0x4d5cab,_0x2f3936){return function(_0xf834a1){if(_0xf834a1){var _0x5f447a=typeof _0x2f3936[_0x4ae2('0x18')]===_0x4ae2('0x19')&&typeof _0x2f3936[_0x4ae2('0x1a')]===_0x4ae2('0x19');var _0x428d24=_0xf834a1[_0x4ae2('0x1b')];var _0x3d4259=_0x5f447a?0x0:_0x2f3936[_0x4ae2('0x18')];var _0x41b672=_0x5f447a?_0xf834a1[_0x4ae2('0x1b')]:_0x2f3936['offset']+_0x2f3936['limit'];var _0x44a2d3;if(_0x41b672>=_0x428d24){_0x41b672=_0x428d24;_0x44a2d3=0xc8;}else{_0x44a2d3=0xce;}_0x4d5cab[_0x4ae2('0x16')](_0x44a2d3);return _0x4d5cab['set'](_0x4ae2('0x1c'),_0x3d4259+'-'+_0x41b672+'/'+_0x428d24)[_0x4ae2('0x1d')](_0xf834a1);}return null;};}function patchUpdates(_0xccb3b){return function(_0x2ad222){try{jsonpatch[_0x4ae2('0x1e')](_0x2ad222,_0xccb3b,!![]);}catch(_0x497218){return BPromise[_0x4ae2('0x1f')](_0x497218);}return _0x2ad222['save']();};}function saveUpdates(_0x522165,_0x2ceec4){return function(_0x151b70){if(_0x151b70){return _0x151b70[_0x4ae2('0x20')](_0x522165)[_0x4ae2('0x21')](function(_0xca16bf){return _0xca16bf;});}return null;};}function removeEntity(_0x526768,_0x1005e0){return function(_0x4a0ddb){if(_0x4a0ddb){return _0x4a0ddb[_0x4ae2('0x22')]()[_0x4ae2('0x21')](function(){_0x526768[_0x4ae2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43f112,_0x6f0cc6){return function(_0x2454b3){if(!_0x2454b3){_0x43f112[_0x4ae2('0x15')](0x194);}return _0x2454b3;};}function handleError(_0x1c2934,_0x255772){_0x255772=_0x255772||0x1f4;return function(_0x5b2e65){logger['error'](_0x5b2e65[_0x4ae2('0x23')]);if(_0x5b2e65[_0x4ae2('0x24')]){delete _0x5b2e65[_0x4ae2('0x24')];}_0x1c2934[_0x4ae2('0x16')](_0x255772)[_0x4ae2('0x25')](_0x5b2e65);};}exports[_0x4ae2('0x26')]=function(_0x57a377,_0x5ec1fd){var _0x3e2666={},_0x4e7741={},_0x554cff={'count':0x0,'rows':[]};var _0x5e9f03=_[_0x4ae2('0x27')](db[_0x4ae2('0x28')]['rawAttributes'],function(_0x883fd5){return{'name':_0x883fd5[_0x4ae2('0x29')],'type':_0x883fd5[_0x4ae2('0x2a')][_0x4ae2('0x2b')]};});_0x4e7741[_0x4ae2('0x2c')]=_[_0x4ae2('0x27')](_0x5e9f03,_0x4ae2('0x24'));_0x4e7741[_0x4ae2('0x2d')]=_[_0x4ae2('0x2e')](_0x57a377[_0x4ae2('0x2d')]);_0x4e7741[_0x4ae2('0x2f')]=_[_0x4ae2('0x30')](_0x4e7741[_0x4ae2('0x2c')],_0x4e7741[_0x4ae2('0x2d')]);_0x3e2666[_0x4ae2('0x31')]=_[_0x4ae2('0x30')](_0x4e7741[_0x4ae2('0x2c')],qs['fields'](_0x57a377[_0x4ae2('0x2d')]['fields']));_0x3e2666[_0x4ae2('0x31')]=_0x3e2666[_0x4ae2('0x31')]['length']?_0x3e2666[_0x4ae2('0x31')]:_0x4e7741[_0x4ae2('0x2c')];if(!_0x57a377[_0x4ae2('0x2d')][_0x4ae2('0x32')]('nolimit')){_0x3e2666[_0x4ae2('0x1a')]=qs[_0x4ae2('0x1a')](_0x57a377[_0x4ae2('0x2d')][_0x4ae2('0x1a')]);_0x3e2666[_0x4ae2('0x18')]=qs[_0x4ae2('0x18')](_0x57a377[_0x4ae2('0x2d')][_0x4ae2('0x18')]);}_0x3e2666[_0x4ae2('0x33')]=qs['sort'](_0x57a377[_0x4ae2('0x2d')]['sort']);_0x3e2666[_0x4ae2('0x34')]=qs[_0x4ae2('0x2f')](_[_0x4ae2('0x35')](_0x57a377[_0x4ae2('0x2d')],_0x4e7741[_0x4ae2('0x2f')]),_0x5e9f03);if(_0x57a377[_0x4ae2('0x2d')]['filter']){_0x3e2666[_0x4ae2('0x34')]=_[_0x4ae2('0x36')](_0x3e2666[_0x4ae2('0x34')],{'$or':_[_0x4ae2('0x27')](_0x5e9f03,function(_0x49baf9){if(_0x49baf9[_0x4ae2('0x2a')]!==_0x4ae2('0x37')){var _0x2f0d83={};_0x2f0d83[_0x49baf9[_0x4ae2('0x24')]]={'$like':'%'+_0x57a377[_0x4ae2('0x2d')][_0x4ae2('0x38')]+'%'};return _0x2f0d83;}})});}_0x3e2666=_[_0x4ae2('0x36')]({},_0x3e2666,_0x57a377[_0x4ae2('0x39')]);var _0x1d5888={'where':_0x3e2666[_0x4ae2('0x34')]};return db[_0x4ae2('0x28')]['count'](_0x1d5888)[_0x4ae2('0x21')](function(_0x3f0b3f){_0x554cff[_0x4ae2('0x1b')]=_0x3f0b3f;if(_0x57a377[_0x4ae2('0x2d')]['includeAll']){_0x3e2666['include']=[{'all':!![]}];}return db[_0x4ae2('0x28')][_0x4ae2('0x3a')](_0x3e2666);})[_0x4ae2('0x21')](function(_0x3cdf23){_0x554cff['rows']=_0x3cdf23;return _0x554cff;})[_0x4ae2('0x21')](respondWithFilteredResult(_0x5ec1fd,_0x3e2666))[_0x4ae2('0x3b')](handleError(_0x5ec1fd,null));};exports['show']=function(_0x230030,_0x2a85eb){var _0x11a5d9={'raw':!![],'where':{'id':_0x230030[_0x4ae2('0x3c')]['id']}},_0x5a9126={};_0x5a9126[_0x4ae2('0x2c')]=_[_0x4ae2('0x2e')](db[_0x4ae2('0x28')][_0x4ae2('0x3d')]);_0x5a9126[_0x4ae2('0x2d')]=_[_0x4ae2('0x2e')](_0x230030[_0x4ae2('0x2d')]);_0x5a9126['filters']=_[_0x4ae2('0x30')](_0x5a9126[_0x4ae2('0x2c')],_0x5a9126['query']);_0x11a5d9[_0x4ae2('0x31')]=_[_0x4ae2('0x30')](_0x5a9126['model'],qs[_0x4ae2('0x3e')](_0x230030[_0x4ae2('0x2d')]['fields']));_0x11a5d9[_0x4ae2('0x31')]=_0x11a5d9[_0x4ae2('0x31')][_0x4ae2('0x3f')]?_0x11a5d9['attributes']:_0x5a9126['model'];if(_0x230030[_0x4ae2('0x2d')][_0x4ae2('0x40')]){_0x11a5d9[_0x4ae2('0x41')]=[{'all':!![]}];}_0x11a5d9=_[_0x4ae2('0x36')]({},_0x11a5d9,_0x230030['options']);return db[_0x4ae2('0x28')][_0x4ae2('0x42')](_0x11a5d9)[_0x4ae2('0x21')](handleEntityNotFound(_0x2a85eb,null))['then'](respondWithResult(_0x2a85eb,null))[_0x4ae2('0x3b')](handleError(_0x2a85eb,null));};exports[_0x4ae2('0x43')]=function(_0x443548,_0x4e9b6e){return db[_0x4ae2('0x28')][_0x4ae2('0x43')](_0x443548[_0x4ae2('0x44')],{})[_0x4ae2('0x21')](respondWithResult(_0x4e9b6e,0xc9))[_0x4ae2('0x3b')](handleError(_0x4e9b6e,null));};exports[_0x4ae2('0x20')]=function(_0x7f288e,_0x2fe532){if(_0x7f288e[_0x4ae2('0x44')]['id']){delete _0x7f288e[_0x4ae2('0x44')]['id'];}return db['Cdr'][_0x4ae2('0x42')]({'where':{'id':_0x7f288e[_0x4ae2('0x3c')]['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0x2fe532,null))[_0x4ae2('0x21')](saveUpdates(_0x7f288e[_0x4ae2('0x44')],null))[_0x4ae2('0x21')](respondWithResult(_0x2fe532,null))[_0x4ae2('0x3b')](handleError(_0x2fe532,null));};exports[_0x4ae2('0x22')]=function(_0x4ffe8d,_0xe58384){return db[_0x4ae2('0x28')]['find']({'where':{'id':_0x4ffe8d[_0x4ae2('0x3c')]['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0xe58384,null))['then'](removeEntity(_0xe58384,null))[_0x4ae2('0x3b')](handleError(_0xe58384,null));};exports['describe']=function(_0x426d29,_0x5e1c80){return db[_0x4ae2('0x28')][_0x4ae2('0x45')]()[_0x4ae2('0x21')](respondWithResult(_0x5e1c80,null))[_0x4ae2('0x3b')](handleError(_0x5e1c80,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 289065c..3b999ac 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x243f9a,_0x19e8da){var _0x35c86a=function(_0x3bc288){while(--_0x3bc288){_0x243f9a['push'](_0x243f9a['shift']());}};_0x35c86a(++_0x19e8da);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3d6f7a,_0x3da829){var _0x8ac6e7=function(_0x47d1c4){while(--_0x47d1c4){_0x3d6f7a['push'](_0x3d6f7a['shift']());}};_0x8ac6e7(++_0x3da829);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 9f7db2b..1e79d9d 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 _0x0a42=['debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x1021c6,_0x56ecb0){var _0x20a561=function(_0x1f6a74){while(--_0x1f6a74){_0x1021c6['push'](_0x1021c6['shift']());}};_0x20a561(++_0x56ecb0);}(_0x0a42,0x13d));var _0x20a4=function(_0xfb7bc0,_0x44ef58){_0xfb7bc0=_0xfb7bc0-0x0;var _0x40b7ee=_0x0a42[_0xfb7bc0];return _0x40b7ee;};'use strict';var _=require('lodash');var util=require(_0x20a4('0x0'));var moment=require(_0x20a4('0x1'));var BPromise=require(_0x20a4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20a4('0x3'))['db'];var utils=require(_0x20a4('0x4'));var logger=require(_0x20a4('0x5'))(_0x20a4('0x6'));var config=require(_0x20a4('0x7'));var jayson=require(_0x20a4('0x8'));var client=jayson['client'][_0x20a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb9528a,_0x3984eb,_0xd6c2cf){return new BPromise(function(_0x7133ed,_0x37f408){return client[_0x20a4('0xa')](_0xb9528a,_0xd6c2cf)['then'](function(_0x6ae005){logger['info'](_0x20a4('0xb'),_0x3984eb,_0x20a4('0xc'));logger[_0x20a4('0xd')](_0x20a4('0xe'),_0x3984eb,'request\x20sent',JSON[_0x20a4('0xf')](_0x6ae005));if(_0x6ae005['error']){if(_0x6ae005[_0x20a4('0x10')][_0x20a4('0x11')]===0x1f4){logger[_0x20a4('0x10')](_0x20a4('0xb'),_0x3984eb,_0x6ae005[_0x20a4('0x10')][_0x20a4('0x12')]);return _0x37f408(_0x6ae005[_0x20a4('0x10')]['message']);}logger[_0x20a4('0x10')]('Cdr,\x20%s,\x20%s',_0x3984eb,_0x6ae005[_0x20a4('0x10')][_0x20a4('0x12')]);return _0x7133ed(_0x6ae005[_0x20a4('0x10')][_0x20a4('0x12')]);}else{logger[_0x20a4('0x13')]('Cdr,\x20%s,\x20%s',_0x3984eb,'request\x20sent');_0x7133ed(_0x6ae005[_0x20a4('0x14')][_0x20a4('0x12')]);}})[_0x20a4('0x15')](function(_0x91ed5){logger[_0x20a4('0x10')](_0x20a4('0xb'),_0x3984eb,_0x91ed5);_0x37f408(_0x91ed5);});});}
\ No newline at end of file
+var _0x2184=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x2184,0xd2));var _0x4218=function(_0x26b76e,_0x10c9c1){_0x26b76e=_0x26b76e-0x0;var _0x37cb0e=_0x2184[_0x26b76e];return _0x37cb0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4218('0x0'));var BPromise=require('bluebird');var rs=require(_0x4218('0x1'));var fs=require('fs');var Redis=require(_0x4218('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4218('0x3'));var logger=require(_0x4218('0x4'))(_0x4218('0x5'));var config=require(_0x4218('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4218('0x7')][_0x4218('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48d4d4,_0x1411c5,_0x2796bd){return new BPromise(function(_0x39372c,_0x49a8ae){return client[_0x4218('0x9')](_0x48d4d4,_0x2796bd)[_0x4218('0xa')](function(_0xd7d2c){logger[_0x4218('0xb')](_0x4218('0xc'),_0x1411c5,_0x4218('0xd'));logger[_0x4218('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x1411c5,_0x4218('0xd'),JSON[_0x4218('0xf')](_0xd7d2c));if(_0xd7d2c[_0x4218('0x10')]){if(_0xd7d2c[_0x4218('0x10')][_0x4218('0x11')]===0x1f4){logger[_0x4218('0x10')](_0x4218('0xc'),_0x1411c5,_0xd7d2c[_0x4218('0x10')]['message']);return _0x49a8ae(_0xd7d2c['error'][_0x4218('0x12')]);}logger[_0x4218('0x10')]('Cdr,\x20%s,\x20%s',_0x1411c5,_0xd7d2c[_0x4218('0x10')]['message']);return _0x39372c(_0xd7d2c['error'][_0x4218('0x12')]);}else{logger[_0x4218('0xb')]('Cdr,\x20%s,\x20%s',_0x1411c5,'request\x20sent');_0x39372c(_0xd7d2c[_0x4218('0x13')][_0x4218('0x12')]);}})[_0x4218('0x14')](function(_0x3733b6){logger[_0x4218('0x10')](_0x4218('0xc'),_0x1411c5,_0x3733b6);_0x49a8ae(_0x3733b6);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3e99dba..ff64abb 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(_0x4879f7,_0x33749d){var _0x41771a=function(_0x456a6a){while(--_0x456a6a){_0x4879f7['push'](_0x4879f7['shift']());}};_0x41771a(++_0x33749d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x11356d,_0x26feca){var _0x128ee9=function(_0x621ae2){while(--_0x621ae2){_0x11356d['push'](_0x11356d['shift']());}};_0x128ee9(++_0x26feca);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c97c8,_0x28d564){_0x1c97c8=_0x1c97c8-0x0;var _0x2c096d=_0xb10b[_0x1c97c8];return _0x2c096d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index e26919f..c4e3d29 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 _0x473a=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0xb73200,_0x4344df){var _0x1dec72=function(_0x190bde){while(--_0x190bde){_0xb73200['push'](_0xb73200['shift']());}};_0x1dec72(++_0x4344df);}(_0x473a,0x1b9));var _0xa473=function(_0x2ff5b0,_0x4cfb33){_0x2ff5b0=_0x2ff5b0-0x0;var _0x5a86cc=_0x473a[_0x2ff5b0];return _0x5a86cc;};'use strict';var Sequelize=require(_0xa473('0x0'));module[_0xa473('0x1')]={'priority':{'type':Sequelize[_0xa473('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa473('0x3')],'allowNull':![],'defaultValue':_0xa473('0x4')},'appdata':{'type':Sequelize[_0xa473('0x5')]()},'description':{'type':Sequelize[_0xa473('0x3')]},'interval':{'type':Sequelize[_0xa473('0x3')],'defaultValue':_0xa473('0x6')}};
\ No newline at end of file
+var _0xc005=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0xc005,0x9d));var _0x5c00=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0xc005[_0x3b2369];return _0x5a1367;};'use strict';var Sequelize=require(_0x5c00('0x0'));module[_0x5c00('0x1')]={'priority':{'type':Sequelize[_0x5c00('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5c00('0x3')],'allowNull':![],'defaultValue':_0x5c00('0x4')},'appdata':{'type':Sequelize[_0x5c00('0x5')]()},'description':{'type':Sequelize[_0x5c00('0x3')]},'interval':{'type':Sequelize[_0x5c00('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index ff1ef51..ad2f23a 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 _0xb677=['merge','ChatApplication','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include'];(function(_0x438945,_0x51ddc8){var _0x19f72e=function(_0x45a262){while(--_0x45a262){_0x438945['push'](_0x438945['shift']());}};_0x19f72e(++_0x51ddc8);}(_0xb677,0x119));var _0x7b67=function(_0x4aeb7,_0x596e86){_0x4aeb7=_0x4aeb7-0x0;var _0x891d62=_0xb677[_0x4aeb7];return _0x891d62;};'use strict';var emlformat=require(_0x7b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b67('0x1'));var jsonpatch=require(_0x7b67('0x2'));var rp=require(_0x7b67('0x3'));var moment=require(_0x7b67('0x4'));var BPromise=require(_0x7b67('0x5'));var Mustache=require(_0x7b67('0x6'));var util=require(_0x7b67('0x7'));var path=require(_0x7b67('0x8'));var sox=require('sox');var csv=require(_0x7b67('0x9'));var ejs=require(_0x7b67('0xa'));var fs=require('fs');var fs_extra=require(_0x7b67('0xb'));var _=require(_0x7b67('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b67('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7b67('0xe'));var Papa=require('papaparse');var Redis=require(_0x7b67('0xf'));var authService=require(_0x7b67('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b67('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b67('0x12'))(_0x7b67('0x13'));var utils=require(_0x7b67('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25b402,_0x454df4){_0x454df4=_0x454df4||0xcc;return function(_0x1e17fc){if(_0x1e17fc){return _0x25b402[_0x7b67('0x15')](_0x454df4);}return _0x25b402[_0x7b67('0x16')](_0x454df4)[_0x7b67('0x17')]();};}function respondWithResult(_0x4f15f5,_0x37eb7a){_0x37eb7a=_0x37eb7a||0xc8;return function(_0x473d10){if(_0x473d10){return _0x4f15f5[_0x7b67('0x16')](_0x37eb7a)[_0x7b67('0x18')](_0x473d10);}};}function respondWithFilteredResult(_0x377208,_0x309f1c){return function(_0x1861d1){if(_0x1861d1){var _0xf99987=typeof _0x309f1c['offset']===_0x7b67('0x19')&&typeof _0x309f1c[_0x7b67('0x1a')]===_0x7b67('0x19');var _0x41e23d=_0x1861d1[_0x7b67('0x1b')];var _0x18d9da=_0xf99987?0x0:_0x309f1c['offset'];var _0x33f462=_0xf99987?_0x1861d1[_0x7b67('0x1b')]:_0x309f1c[_0x7b67('0x1c')]+_0x309f1c[_0x7b67('0x1a')];var _0x4732dc;if(_0x33f462>=_0x41e23d){_0x33f462=_0x41e23d;_0x4732dc=0xc8;}else{_0x4732dc=0xce;}_0x377208[_0x7b67('0x16')](_0x4732dc);return _0x377208[_0x7b67('0x1d')](_0x7b67('0x1e'),_0x18d9da+'-'+_0x33f462+'/'+_0x41e23d)[_0x7b67('0x18')](_0x1861d1);}return null;};}function patchUpdates(_0x8f1cbe){return function(_0x5ddb36){try{jsonpatch[_0x7b67('0x1f')](_0x5ddb36,_0x8f1cbe,!![]);}catch(_0x16bc9b){return BPromise['reject'](_0x16bc9b);}return _0x5ddb36['save']();};}function saveUpdates(_0x48cd2e,_0x48944a){return function(_0x44b951){if(_0x44b951){return _0x44b951[_0x7b67('0x20')](_0x48cd2e)[_0x7b67('0x21')](function(_0x3042fe){return _0x3042fe;});}return null;};}function removeEntity(_0x2c3f11,_0x56b952){return function(_0x3b4fea){if(_0x3b4fea){return _0x3b4fea[_0x7b67('0x22')]()[_0x7b67('0x21')](function(){_0x2c3f11[_0x7b67('0x16')](0xcc)[_0x7b67('0x17')]();});}};}function handleEntityNotFound(_0x3e9630,_0x2b6da7){return function(_0x50e71c){if(!_0x50e71c){_0x3e9630[_0x7b67('0x15')](0x194);}return _0x50e71c;};}function handleError(_0x4b29e0,_0x45da6b){_0x45da6b=_0x45da6b||0x1f4;return function(_0x2f1e62){logger[_0x7b67('0x23')](_0x2f1e62[_0x7b67('0x24')]);if(_0x2f1e62['name']){delete _0x2f1e62[_0x7b67('0x25')];}_0x4b29e0[_0x7b67('0x16')](_0x45da6b)[_0x7b67('0x26')](_0x2f1e62);};}exports['show']=function(_0x5e35c9,_0x5ac43f){var _0x8649ec={'raw':!![],'where':{'id':_0x5e35c9['params']['id']}},_0x4bd8b7={};_0x4bd8b7[_0x7b67('0x27')]=_[_0x7b67('0x28')](db['ChatApplication'][_0x7b67('0x29')]);_0x4bd8b7['query']=_['keys'](_0x5e35c9[_0x7b67('0x2a')]);_0x4bd8b7[_0x7b67('0x2b')]=_[_0x7b67('0x2c')](_0x4bd8b7[_0x7b67('0x27')],_0x4bd8b7[_0x7b67('0x2a')]);_0x8649ec[_0x7b67('0x2d')]=_[_0x7b67('0x2c')](_0x4bd8b7[_0x7b67('0x27')],qs[_0x7b67('0x2e')](_0x5e35c9[_0x7b67('0x2a')][_0x7b67('0x2e')]));_0x8649ec[_0x7b67('0x2d')]=_0x8649ec[_0x7b67('0x2d')][_0x7b67('0x2f')]?_0x8649ec[_0x7b67('0x2d')]:_0x4bd8b7[_0x7b67('0x27')];if(_0x5e35c9[_0x7b67('0x2a')]['includeAll']){_0x8649ec[_0x7b67('0x30')]=[{'all':!![]}];}_0x8649ec=_[_0x7b67('0x31')]({},_0x8649ec,_0x5e35c9['options']);return db[_0x7b67('0x32')][_0x7b67('0x33')](_0x8649ec)[_0x7b67('0x21')](handleEntityNotFound(_0x5ac43f,null))[_0x7b67('0x21')](respondWithResult(_0x5ac43f,null))[_0x7b67('0x34')](handleError(_0x5ac43f,null));};exports[_0x7b67('0x20')]=function(_0x30fa40,_0x3a9bc9){if(_0x30fa40[_0x7b67('0x35')]['id']){delete _0x30fa40[_0x7b67('0x35')]['id'];}return db[_0x7b67('0x32')][_0x7b67('0x33')]({'where':{'id':_0x30fa40[_0x7b67('0x36')]['id']}})['then'](handleEntityNotFound(_0x3a9bc9,null))[_0x7b67('0x21')](saveUpdates(_0x30fa40[_0x7b67('0x35')],null))[_0x7b67('0x21')](respondWithResult(_0x3a9bc9,null))[_0x7b67('0x34')](handleError(_0x3a9bc9,null));};exports['destroy']=function(_0xc080e4,_0x17fe14){return db[_0x7b67('0x32')][_0x7b67('0x33')]({'where':{'id':_0xc080e4[_0x7b67('0x36')]['id']}})['then'](handleEntityNotFound(_0x17fe14,null))[_0x7b67('0x21')](removeEntity(_0x17fe14,null))[_0x7b67('0x34')](handleError(_0x17fe14,null));};
\ No newline at end of file
+var _0x9147=['util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','update','body','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x563a8e,_0x4dd781){var _0x45baa0=function(_0x36fbf9){while(--_0x36fbf9){_0x563a8e['push'](_0x563a8e['shift']());}};_0x45baa0(++_0x4dd781);}(_0x9147,0x7b));var _0x7914=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9147[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7914('0x0'));var rimraf=require(_0x7914('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7914('0x2'));var rp=require('request-promise');var moment=require(_0x7914('0x3'));var BPromise=require(_0x7914('0x4'));var Mustache=require('mustache');var util=require(_0x7914('0x5'));var path=require(_0x7914('0x6'));var sox=require(_0x7914('0x7'));var csv=require('to-csv');var ejs=require(_0x7914('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7914('0x9'));var squel=require('squel');var crypto=require(_0x7914('0xa'));var jsforce=require(_0x7914('0xb'));var deskjs=require(_0x7914('0xc'));var toCsv=require(_0x7914('0xd'));var querystring=require(_0x7914('0xe'));var Papa=require(_0x7914('0xf'));var Redis=require(_0x7914('0x10'));var authService=require(_0x7914('0x11'));var qs=require(_0x7914('0x12'));var as=require(_0x7914('0x13'));var hardwareService=require(_0x7914('0x14'));var logger=require(_0x7914('0x15'))(_0x7914('0x16'));var utils=require(_0x7914('0x17'));var config=require(_0x7914('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7914('0x19'))['db'];function respondWithStatusCode(_0x29050a,_0x1c47ad){_0x1c47ad=_0x1c47ad||0xcc;return function(_0x1e6768){if(_0x1e6768){return _0x29050a[_0x7914('0x1a')](_0x1c47ad);}return _0x29050a['status'](_0x1c47ad)[_0x7914('0x1b')]();};}function respondWithResult(_0x30d365,_0x2dd5a1){_0x2dd5a1=_0x2dd5a1||0xc8;return function(_0x5a8574){if(_0x5a8574){return _0x30d365[_0x7914('0x1c')](_0x2dd5a1)['json'](_0x5a8574);}};}function respondWithFilteredResult(_0xc2acd1,_0x12a59b){return function(_0x57e5b1){if(_0x57e5b1){var _0x1bc814=typeof _0x12a59b[_0x7914('0x1d')]===_0x7914('0x1e')&&typeof _0x12a59b[_0x7914('0x1f')]===_0x7914('0x1e');var _0x4cb627=_0x57e5b1[_0x7914('0x20')];var _0x438a91=_0x1bc814?0x0:_0x12a59b[_0x7914('0x1d')];var _0x305923=_0x1bc814?_0x57e5b1['count']:_0x12a59b['offset']+_0x12a59b[_0x7914('0x1f')];var _0x5098c3;if(_0x305923>=_0x4cb627){_0x305923=_0x4cb627;_0x5098c3=0xc8;}else{_0x5098c3=0xce;}_0xc2acd1[_0x7914('0x1c')](_0x5098c3);return _0xc2acd1[_0x7914('0x21')](_0x7914('0x22'),_0x438a91+'-'+_0x305923+'/'+_0x4cb627)[_0x7914('0x23')](_0x57e5b1);}return null;};}function patchUpdates(_0xfe14de){return function(_0x585898){try{jsonpatch[_0x7914('0x24')](_0x585898,_0xfe14de,!![]);}catch(_0xca996f){return BPromise[_0x7914('0x25')](_0xca996f);}return _0x585898[_0x7914('0x26')]();};}function saveUpdates(_0x552d24,_0x46da43){return function(_0xbc979){if(_0xbc979){return _0xbc979['update'](_0x552d24)[_0x7914('0x27')](function(_0x7777f9){return _0x7777f9;});}return null;};}function removeEntity(_0x1fb96b,_0x138aa0){return function(_0x5ce556){if(_0x5ce556){return _0x5ce556['destroy']()['then'](function(){_0x1fb96b[_0x7914('0x1c')](0xcc)[_0x7914('0x1b')]();});}};}function handleEntityNotFound(_0x76084c,_0x3aef36){return function(_0x483824){if(!_0x483824){_0x76084c[_0x7914('0x1a')](0x194);}return _0x483824;};}function handleError(_0x1154fa,_0xb3fc3e){_0xb3fc3e=_0xb3fc3e||0x1f4;return function(_0x1bcd29){logger[_0x7914('0x28')](_0x1bcd29[_0x7914('0x29')]);if(_0x1bcd29[_0x7914('0x2a')]){delete _0x1bcd29[_0x7914('0x2a')];}_0x1154fa['status'](_0xb3fc3e)[_0x7914('0x2b')](_0x1bcd29);};}exports[_0x7914('0x2c')]=function(_0x40fcaf,_0x2dfcf7){var _0x4988a4={'raw':!![],'where':{'id':_0x40fcaf[_0x7914('0x2d')]['id']}},_0x241feb={};_0x241feb[_0x7914('0x2e')]=_['keys'](db[_0x7914('0x2f')][_0x7914('0x30')]);_0x241feb[_0x7914('0x31')]=_[_0x7914('0x32')](_0x40fcaf[_0x7914('0x31')]);_0x241feb[_0x7914('0x33')]=_['intersection'](_0x241feb[_0x7914('0x2e')],_0x241feb['query']);_0x4988a4['attributes']=_[_0x7914('0x34')](_0x241feb[_0x7914('0x2e')],qs[_0x7914('0x35')](_0x40fcaf[_0x7914('0x31')][_0x7914('0x35')]));_0x4988a4['attributes']=_0x4988a4[_0x7914('0x36')][_0x7914('0x37')]?_0x4988a4[_0x7914('0x36')]:_0x241feb['model'];if(_0x40fcaf[_0x7914('0x31')][_0x7914('0x38')]){_0x4988a4[_0x7914('0x39')]=[{'all':!![]}];}_0x4988a4=_[_0x7914('0x3a')]({},_0x4988a4,_0x40fcaf[_0x7914('0x3b')]);return db[_0x7914('0x2f')][_0x7914('0x3c')](_0x4988a4)['then'](handleEntityNotFound(_0x2dfcf7,null))[_0x7914('0x27')](respondWithResult(_0x2dfcf7,null))[_0x7914('0x3d')](handleError(_0x2dfcf7,null));};exports[_0x7914('0x3e')]=function(_0x3aff0e,_0x1a5674){if(_0x3aff0e[_0x7914('0x3f')]['id']){delete _0x3aff0e[_0x7914('0x3f')]['id'];}return db['ChatApplication'][_0x7914('0x3c')]({'where':{'id':_0x3aff0e['params']['id']}})[_0x7914('0x27')](handleEntityNotFound(_0x1a5674,null))[_0x7914('0x27')](saveUpdates(_0x3aff0e[_0x7914('0x3f')],null))[_0x7914('0x27')](respondWithResult(_0x1a5674,null))[_0x7914('0x3d')](handleError(_0x1a5674,null));};exports['destroy']=function(_0x1019b0,_0x123d79){return db[_0x7914('0x2f')][_0x7914('0x3c')]({'where':{'id':_0x1019b0[_0x7914('0x2d')]['id']}})['then'](handleEntityNotFound(_0x123d79,null))[_0x7914('0x27')](removeEntity(_0x123d79,null))[_0x7914('0x3d')](handleError(_0x123d79,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 50bb07e..fca4099 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 _0x8cec=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x51e5bd,_0x3c2cf1){var _0x250aed=function(_0x17120c){while(--_0x17120c){_0x51e5bd['push'](_0x51e5bd['shift']());}};_0x250aed(++_0x3c2cf1);}(_0x8cec,0x104));var _0xc8ce=function(_0x5135ba,_0x5049bb){_0x5135ba=_0x5135ba-0x0;var _0x2dd42c=_0x8cec[_0x5135ba];return _0x2dd42c;};'use strict';var _=require(_0xc8ce('0x0'));var util=require('util');var logger=require(_0xc8ce('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc8ce('0x2'));var rp=require(_0xc8ce('0x3'));var fs=require('fs');var path=require(_0xc8ce('0x4'));var rimraf=require(_0xc8ce('0x5'));var config=require(_0xc8ce('0x6'));var attributes=require(_0xc8ce('0x7'));module[_0xc8ce('0x8')]=function(_0x8f677c,_0x4662bb){return _0x8f677c[_0xc8ce('0x9')](_0xc8ce('0xa'),attributes,{'tableName':_0xc8ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8ce('0xc'),'collate':_0xc8ce('0xd')});};
\ No newline at end of file
+var _0x280f=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','chat_applications'];(function(_0x175290,_0x42e572){var _0x52bd78=function(_0xea7cc7){while(--_0xea7cc7){_0x175290['push'](_0x175290['shift']());}};_0x52bd78(++_0x42e572);}(_0x280f,0xe2));var _0xf280=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x280f[_0x2f3ecd];return _0xffdc44;};'use strict';var _=require(_0xf280('0x0'));var util=require('util');var logger=require(_0xf280('0x1'))(_0xf280('0x2'));var moment=require(_0xf280('0x3'));var BPromise=require(_0xf280('0x4'));var rp=require(_0xf280('0x5'));var fs=require('fs');var path=require(_0xf280('0x6'));var rimraf=require(_0xf280('0x7'));var config=require('../../config/environment');var attributes=require(_0xf280('0x8'));module[_0xf280('0x9')]=function(_0x23925d,_0x34eef7){return _0x23925d[_0xf280('0xa')]('ChatApplication',attributes,{'tableName':_0xf280('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf280('0xc'),'collate':_0xf280('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index bccd897..073241f 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 _0x9be4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x516c1f,_0x2aa7eb){var _0x9c709d=function(_0x41665c){while(--_0x41665c){_0x516c1f['push'](_0x516c1f['shift']());}};_0x9c709d(++_0x2aa7eb);}(_0x9be4,0x9b));var _0x49be=function(_0x3c8ead,_0xb3b3ef){_0x3c8ead=_0x3c8ead-0x0;var _0x3db404=_0x9be4[_0x3c8ead];return _0x3db404;};'use strict';var _=require(_0x49be('0x0'));var util=require(_0x49be('0x1'));var moment=require(_0x49be('0x2'));var BPromise=require('bluebird');var rs=require(_0x49be('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49be('0x4'))['db'];var utils=require(_0x49be('0x5'));var logger=require(_0x49be('0x6'))(_0x49be('0x7'));var config=require(_0x49be('0x8'));var jayson=require(_0x49be('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xad6d9b,_0x4a5498,_0xca0bc0){return new BPromise(function(_0x30723d,_0x459c1e){return client[_0x49be('0xa')](_0xad6d9b,_0xca0bc0)['then'](function(_0x26853f){logger['info'](_0x49be('0xb'),_0x4a5498,_0x49be('0xc'));logger['debug'](_0x49be('0xd'),_0x4a5498,_0x49be('0xc'),JSON[_0x49be('0xe')](_0x26853f));if(_0x26853f[_0x49be('0xf')]){if(_0x26853f[_0x49be('0xf')][_0x49be('0x10')]===0x1f4){logger[_0x49be('0xf')](_0x49be('0xb'),_0x4a5498,_0x26853f[_0x49be('0xf')][_0x49be('0x11')]);return _0x459c1e(_0x26853f['error']['message']);}logger[_0x49be('0xf')](_0x49be('0xb'),_0x4a5498,_0x26853f[_0x49be('0xf')][_0x49be('0x11')]);return _0x30723d(_0x26853f[_0x49be('0xf')][_0x49be('0x11')]);}else{logger[_0x49be('0x12')](_0x49be('0xb'),_0x4a5498,_0x49be('0xc'));_0x30723d(_0x26853f[_0x49be('0x13')]['message']);}})['catch'](function(_0x4135e0){logger[_0x49be('0xf')](_0x49be('0xb'),_0x4a5498,_0x4135e0);_0x459c1e(_0x4135e0);});});}
\ No newline at end of file
+var _0x3b3b=['message','info','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x3b3b,0x1bc));var _0xb3b3=function(_0x17bd9d,_0x518dcf){_0x17bd9d=_0x17bd9d-0x0;var _0x1aad9b=_0x3b3b[_0x17bd9d];return _0x1aad9b;};'use strict';var _=require(_0xb3b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb3b3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3b3('0x2'));var db=require(_0xb3b3('0x3'))['db'];var utils=require(_0xb3b3('0x4'));var logger=require(_0xb3b3('0x5'))(_0xb3b3('0x6'));var config=require(_0xb3b3('0x7'));var jayson=require(_0xb3b3('0x8'));var client=jayson[_0xb3b3('0x9')][_0xb3b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x118f2d,_0x35daad,_0x20fb7c){return new BPromise(function(_0x5b31cd,_0x319478){return client[_0xb3b3('0xb')](_0x118f2d,_0x20fb7c)[_0xb3b3('0xc')](function(_0x888ad5){logger['info']('ChatApplication,\x20%s,\x20%s',_0x35daad,_0xb3b3('0xd'));logger['debug'](_0xb3b3('0xe'),_0x35daad,_0xb3b3('0xd'),JSON['stringify'](_0x888ad5));if(_0x888ad5[_0xb3b3('0xf')]){if(_0x888ad5['error'][_0xb3b3('0x10')]===0x1f4){logger[_0xb3b3('0xf')](_0xb3b3('0x11'),_0x35daad,_0x888ad5[_0xb3b3('0xf')][_0xb3b3('0x12')]);return _0x319478(_0x888ad5[_0xb3b3('0xf')][_0xb3b3('0x12')]);}logger[_0xb3b3('0xf')]('ChatApplication,\x20%s,\x20%s',_0x35daad,_0x888ad5[_0xb3b3('0xf')]['message']);return _0x5b31cd(_0x888ad5[_0xb3b3('0xf')][_0xb3b3('0x12')]);}else{logger[_0xb3b3('0x13')]('ChatApplication,\x20%s,\x20%s',_0x35daad,_0xb3b3('0xd'));_0x5b31cd(_0x888ad5['result'][_0xb3b3('0x12')]);}})[_0xb3b3('0x14')](function(_0x110c53){logger[_0xb3b3('0xf')]('ChatApplication,\x20%s,\x20%s',_0x35daad,_0x110c53);_0x319478(_0x110c53);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index f48abb4..7cb10b0 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 _0x1bfe=['get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1bfe,0x1d4));var _0xe1bf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1bfe[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xe1bf('0x0'));var util=require(_0xe1bf('0x1'));var path=require('path');var timeout=require(_0xe1bf('0x2'));var express=require(_0xe1bf('0x3'));var router=express[_0xe1bf('0x4')]();var fs_extra=require(_0xe1bf('0x5'));var auth=require(_0xe1bf('0x6'));var interaction=require(_0xe1bf('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xe1bf('0x8')](_0xe1bf('0x9'),auth[_0xe1bf('0xa')](),controller[_0xe1bf('0xb')]);router[_0xe1bf('0xc')](_0xe1bf('0x9'),auth[_0xe1bf('0xa')](),controller[_0xe1bf('0xd')]);router[_0xe1bf('0xe')](_0xe1bf('0x9'),auth[_0xe1bf('0xa')](),controller[_0xe1bf('0xf')]);module[_0xe1bf('0x10')]=router;
\ No newline at end of file
+var _0x05bf=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','delete','destroy'];(function(_0x4e314f,_0xfe7dee){var _0x15f4d7=function(_0x34cee9){while(--_0x34cee9){_0x4e314f['push'](_0x4e314f['shift']());}};_0x15f4d7(++_0xfe7dee);}(_0x05bf,0x1e1));var _0xf05b=function(_0x22041b,_0x15a8b0){_0x22041b=_0x22041b-0x0;var _0x4fa12b=_0x05bf[_0x22041b];return _0x4fa12b;};'use strict';var multer=require(_0xf05b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf05b('0x1'));var express=require(_0xf05b('0x2'));var router=express[_0xf05b('0x3')]();var fs_extra=require(_0xf05b('0x4'));var auth=require(_0xf05b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf05b('0x6'));var controller=require(_0xf05b('0x7'));router['get'](_0xf05b('0x8'),auth[_0xf05b('0x9')](),controller[_0xf05b('0xa')]);router[_0xf05b('0xb')](_0xf05b('0x8'),auth[_0xf05b('0x9')](),controller['update']);router[_0xf05b('0xc')]('/:id',auth[_0xf05b('0x9')](),controller[_0xf05b('0xd')]);module[_0xf05b('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 86b124c..addb9ae 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 _0xb0b3=['exports','STRING','BOOLEAN','sequelize'];(function(_0x36fecd,_0x116aa6){var _0x3cad6d=function(_0x82aa09){while(--_0x82aa09){_0x36fecd['push'](_0x36fecd['shift']());}};_0x3cad6d(++_0x116aa6);}(_0xb0b3,0x1bf));var _0x3b0b=function(_0x23732e,_0x47989b){_0x23732e=_0x23732e-0x0;var _0x28ca3d=_0xb0b3[_0x23732e];return _0x28ca3d;};'use strict';var Sequelize=require(_0x3b0b('0x0'));module[_0x3b0b('0x1')]={'name':{'type':Sequelize[_0x3b0b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3b0b('0x2')]},'write':{'type':Sequelize[_0x3b0b('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2a8b=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4b3803,_0x5c7ff3){var _0x2f7d0f=function(_0x192c4a){while(--_0x192c4a){_0x4b3803['push'](_0x4b3803['shift']());}};_0x2f7d0f(++_0x5c7ff3);}(_0x2a8b,0x10a));var _0xb2a8=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x2a8b[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0xb2a8('0x0'));module[_0xb2a8('0x1')]={'name':{'type':Sequelize[_0xb2a8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb2a8('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index e150516..8cb0957 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 _0x0526=['addMembers','ids','omit','getMembers','findOne','User','pick','hasOwnProperty','addMessage','ChatGroupId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','create','body','find','params','describe','ChatInternalMessage','user','toInteger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0526,0x18b));var _0x6052=function(_0x312b01,_0x1b5f53){_0x312b01=_0x312b01-0x0;var _0x50734e=_0x0526[_0x312b01];return _0x50734e;};'use strict';var emlformat=require(_0x6052('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6052('0x1'));var jsonpatch=require(_0x6052('0x2'));var rp=require(_0x6052('0x3'));var moment=require(_0x6052('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6052('0x5'));var util=require(_0x6052('0x6'));var path=require(_0x6052('0x7'));var sox=require('sox');var csv=require(_0x6052('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6052('0x9'));var _=require('lodash');var squel=require(_0x6052('0xa'));var crypto=require(_0x6052('0xb'));var jsforce=require(_0x6052('0xc'));var deskjs=require(_0x6052('0xd'));var toCsv=require(_0x6052('0x8'));var querystring=require('querystring');var Papa=require(_0x6052('0xe'));var Redis=require(_0x6052('0xf'));var authService=require(_0x6052('0x10'));var qs=require(_0x6052('0x11'));var as=require(_0x6052('0x12'));var hardwareService=require(_0x6052('0x13'));var logger=require(_0x6052('0x14'))(_0x6052('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6052('0x16'));var db=require(_0x6052('0x17'))['db'];config[_0x6052('0x18')]=_[_0x6052('0x19')](config['redis'],{'host':_0x6052('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6052('0x18')]));require(_0x6052('0x1b'))[_0x6052('0x1c')](socket);function respondWithStatusCode(_0x19a209,_0x20fead){_0x20fead=_0x20fead||0xcc;return function(_0x1d4ede){if(_0x1d4ede){return _0x19a209[_0x6052('0x1d')](_0x20fead);}return _0x19a209[_0x6052('0x1e')](_0x20fead)[_0x6052('0x1f')]();};}function respondWithResult(_0x3a7806,_0x1347e1){_0x1347e1=_0x1347e1||0xc8;return function(_0xb232d){if(_0xb232d){return _0x3a7806[_0x6052('0x1e')](_0x1347e1)[_0x6052('0x20')](_0xb232d);}};}function respondWithFilteredResult(_0x183085,_0x13cb9c){return function(_0x1ce033){if(_0x1ce033){var _0x587cb1=typeof _0x13cb9c[_0x6052('0x21')]===_0x6052('0x22')&&typeof _0x13cb9c[_0x6052('0x23')]===_0x6052('0x22');var _0x3a58e0=_0x1ce033[_0x6052('0x24')];var _0x1b6dde=_0x587cb1?0x0:_0x13cb9c[_0x6052('0x21')];var _0x4dfb5a=_0x587cb1?_0x1ce033[_0x6052('0x24')]:_0x13cb9c[_0x6052('0x21')]+_0x13cb9c[_0x6052('0x23')];var _0x10ac80;if(_0x4dfb5a>=_0x3a58e0){_0x4dfb5a=_0x3a58e0;_0x10ac80=0xc8;}else{_0x10ac80=0xce;}_0x183085[_0x6052('0x1e')](_0x10ac80);return _0x183085[_0x6052('0x25')](_0x6052('0x26'),_0x1b6dde+'-'+_0x4dfb5a+'/'+_0x3a58e0)['json'](_0x1ce033);}return null;};}function patchUpdates(_0x1bb77e){return function(_0x2e3e12){try{jsonpatch[_0x6052('0x27')](_0x2e3e12,_0x1bb77e,!![]);}catch(_0xa6f68){return BPromise['reject'](_0xa6f68);}return _0x2e3e12[_0x6052('0x28')]();};}function saveUpdates(_0x1f5e5d,_0x4a87a1){return function(_0x3320ed){if(_0x3320ed){return _0x3320ed[_0x6052('0x29')](_0x1f5e5d)[_0x6052('0x2a')](function(_0x36fd6a){return _0x36fd6a;});}return null;};}function removeEntity(_0x291dfe,_0x59d82d){return function(_0x1ad233){if(_0x1ad233){return _0x1ad233[_0x6052('0x2b')]()[_0x6052('0x2a')](function(){_0x291dfe[_0x6052('0x1e')](0xcc)[_0x6052('0x1f')]();});}};}function handleEntityNotFound(_0x34399a,_0x799d71){return function(_0x56d32d){if(!_0x56d32d){_0x34399a[_0x6052('0x1d')](0x194);}return _0x56d32d;};}function handleError(_0x5d3171,_0x177300){_0x177300=_0x177300||0x1f4;return function(_0x496db4){logger['error'](_0x496db4[_0x6052('0x2c')]);if(_0x496db4['name']){delete _0x496db4[_0x6052('0x2d')];}_0x5d3171['status'](_0x177300)[_0x6052('0x2e')](_0x496db4);};}exports[_0x6052('0x2f')]=function(_0x480bea,_0x1ba0db){var _0x4f0a1a={},_0x4b1faa={},_0x16f5e4={'count':0x0,'rows':[]};var _0x2620b9=_[_0x6052('0x30')](db[_0x6052('0x31')][_0x6052('0x32')],function(_0x341b23){return{'name':_0x341b23['fieldName'],'type':_0x341b23[_0x6052('0x33')][_0x6052('0x34')]};});_0x4b1faa[_0x6052('0x35')]=_['map'](_0x2620b9,_0x6052('0x2d'));_0x4b1faa['query']=_['keys'](_0x480bea[_0x6052('0x36')]);_0x4b1faa[_0x6052('0x37')]=_[_0x6052('0x38')](_0x4b1faa[_0x6052('0x35')],_0x4b1faa[_0x6052('0x36')]);_0x4f0a1a[_0x6052('0x39')]=_[_0x6052('0x38')](_0x4b1faa[_0x6052('0x35')],qs[_0x6052('0x3a')](_0x480bea[_0x6052('0x36')][_0x6052('0x3a')]));_0x4f0a1a[_0x6052('0x39')]=_0x4f0a1a[_0x6052('0x39')][_0x6052('0x3b')]?_0x4f0a1a['attributes']:_0x4b1faa[_0x6052('0x35')];if(!_0x480bea['query']['hasOwnProperty']('nolimit')){_0x4f0a1a[_0x6052('0x23')]=qs[_0x6052('0x23')](_0x480bea[_0x6052('0x36')][_0x6052('0x23')]);_0x4f0a1a[_0x6052('0x21')]=qs[_0x6052('0x21')](_0x480bea[_0x6052('0x36')][_0x6052('0x21')]);}_0x4f0a1a[_0x6052('0x3c')]=qs[_0x6052('0x3d')](_0x480bea[_0x6052('0x36')]['sort']);_0x4f0a1a[_0x6052('0x3e')]=qs[_0x6052('0x37')](_['pick'](_0x480bea[_0x6052('0x36')],_0x4b1faa[_0x6052('0x37')]),_0x2620b9);if(_0x480bea[_0x6052('0x36')][_0x6052('0x3f')]){_0x4f0a1a[_0x6052('0x3e')]=_[_0x6052('0x40')](_0x4f0a1a[_0x6052('0x3e')],{'$or':_[_0x6052('0x30')](_0x2620b9,function(_0x50ff64){if(_0x50ff64[_0x6052('0x33')]!==_0x6052('0x41')){var _0x901e7a={};_0x901e7a[_0x50ff64[_0x6052('0x2d')]]={'$like':'%'+_0x480bea[_0x6052('0x36')][_0x6052('0x3f')]+'%'};return _0x901e7a;}})});}_0x4f0a1a=_['merge']({},_0x4f0a1a,_0x480bea[_0x6052('0x42')]);var _0x43948b={'where':_0x4f0a1a['where']};return db[_0x6052('0x31')][_0x6052('0x24')](_0x43948b)['then'](function(_0xda7b6){_0x16f5e4['count']=_0xda7b6;if(_0x480bea[_0x6052('0x36')][_0x6052('0x43')]){_0x4f0a1a[_0x6052('0x44')]=[{'all':!![]}];}return db[_0x6052('0x31')]['findAll'](_0x4f0a1a);})[_0x6052('0x2a')](function(_0x492d72){_0x16f5e4['rows']=_0x492d72;return _0x16f5e4;})[_0x6052('0x2a')](respondWithFilteredResult(_0x1ba0db,_0x4f0a1a))[_0x6052('0x45')](handleError(_0x1ba0db,null));};exports[_0x6052('0x46')]=function(_0x2113f6,_0x96c50e){var _0x14ce9e={'raw':!![],'where':{'id':_0x2113f6['params']['id']}},_0x57e6b3={};_0x57e6b3[_0x6052('0x35')]=_[_0x6052('0x47')](db[_0x6052('0x31')][_0x6052('0x32')]);_0x57e6b3[_0x6052('0x36')]=_[_0x6052('0x47')](_0x2113f6['query']);_0x57e6b3[_0x6052('0x37')]=_['intersection'](_0x57e6b3['model'],_0x57e6b3[_0x6052('0x36')]);_0x14ce9e[_0x6052('0x39')]=_['intersection'](_0x57e6b3['model'],qs[_0x6052('0x3a')](_0x2113f6['query']['fields']));_0x14ce9e[_0x6052('0x39')]=_0x14ce9e[_0x6052('0x39')][_0x6052('0x3b')]?_0x14ce9e[_0x6052('0x39')]:_0x57e6b3[_0x6052('0x35')];if(_0x2113f6[_0x6052('0x36')]['includeAll']){_0x14ce9e['include']=[{'all':!![]}];}_0x14ce9e=_[_0x6052('0x40')]({},_0x14ce9e,_0x2113f6[_0x6052('0x42')]);return db[_0x6052('0x31')]['find'](_0x14ce9e)[_0x6052('0x2a')](handleEntityNotFound(_0x96c50e,null))[_0x6052('0x2a')](respondWithResult(_0x96c50e,null))['catch'](handleError(_0x96c50e,null));};exports[_0x6052('0x48')]=function(_0x120b51,_0x357f6a){return db[_0x6052('0x31')][_0x6052('0x48')](_0x120b51[_0x6052('0x49')],{})['then'](respondWithResult(_0x357f6a,0xc9))[_0x6052('0x45')](handleError(_0x357f6a,null));};exports[_0x6052('0x29')]=function(_0x18a574,_0x57ab9d){if(_0x18a574[_0x6052('0x49')]['id']){delete _0x18a574['body']['id'];}return db[_0x6052('0x31')][_0x6052('0x4a')]({'where':{'id':_0x18a574[_0x6052('0x4b')]['id']}})[_0x6052('0x2a')](handleEntityNotFound(_0x57ab9d,null))[_0x6052('0x2a')](saveUpdates(_0x18a574['body'],null))[_0x6052('0x2a')](respondWithResult(_0x57ab9d,null))['catch'](handleError(_0x57ab9d,null));};exports['destroy']=function(_0x218c04,_0x18ea07){return db[_0x6052('0x31')]['find']({'where':{'id':_0x218c04[_0x6052('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18ea07,null))[_0x6052('0x2a')](removeEntity(_0x18ea07,null))[_0x6052('0x45')](handleError(_0x18ea07,null));};exports[_0x6052('0x4c')]=function(_0x113708,_0x74b614){return db['ChatGroup']['describe']()[_0x6052('0x2a')](respondWithResult(_0x74b614,null))[_0x6052('0x45')](handleError(_0x74b614,null));};exports['getUnread']=function(_0x4527df,_0x1e2a43,_0xca240b){return db[_0x6052('0x4d')][_0x6052('0x24')]({'where':{'ChatGroupId':_0x4527df[_0x6052('0x4b')]['id'],'ToId':_0x4527df[_0x6052('0x4e')]['id'],'read':![]}})[_0x6052('0x2a')](function(_0x471dda){return{'id':_[_0x6052('0x4f')](_0x4527df[_0x6052('0x4b')]['id']),'count':_0x471dda};})[_0x6052('0x2a')](respondWithResult(_0x1e2a43,null))[_0x6052('0x45')](handleError(_0x1e2a43,null));};exports['addMembers']=function(_0x2c2173,_0x4b88f9,_0x2c37b1){return db[_0x6052('0x31')][_0x6052('0x4a')]({'where':{'id':_0x2c2173['params']['id']}})[_0x6052('0x2a')](handleEntityNotFound(_0x4b88f9,null))[_0x6052('0x2a')](function(_0x1a6835){if(_0x1a6835){return _0x1a6835[_0x6052('0x50')](_0x2c2173[_0x6052('0x49')][_0x6052('0x51')],_[_0x6052('0x52')](_0x2c2173[_0x6052('0x49')],['ids','id'])||{});}})[_0x6052('0x2a')](respondWithResult(_0x4b88f9,null))[_0x6052('0x45')](handleError(_0x4b88f9,null));};exports[_0x6052('0x53')]=function(_0x1a62ee,_0x4ff1ec,_0x201640){var _0x10583a={};var _0x4afb4e={};var _0x594bcb;var _0x3737c1;return db[_0x6052('0x31')][_0x6052('0x54')]({'where':{'id':_0x1a62ee['params']['id']}})[_0x6052('0x2a')](handleEntityNotFound(_0x4ff1ec,null))['then'](function(_0x9190a2){if(_0x9190a2){_0x594bcb=_0x9190a2;_0x4afb4e[_0x6052('0x35')]=_[_0x6052('0x47')](db[_0x6052('0x55')]['rawAttributes']);_0x4afb4e[_0x6052('0x36')]=_[_0x6052('0x47')](_0x1a62ee[_0x6052('0x36')]);_0x4afb4e[_0x6052('0x37')]=_[_0x6052('0x38')](_0x4afb4e[_0x6052('0x35')],_0x4afb4e[_0x6052('0x36')]);_0x10583a[_0x6052('0x39')]=_[_0x6052('0x38')](_0x4afb4e['model'],qs['fields'](_0x1a62ee[_0x6052('0x36')][_0x6052('0x3a')]));_0x10583a[_0x6052('0x39')]=_0x10583a[_0x6052('0x39')]['length']?_0x10583a[_0x6052('0x39')]:_0x4afb4e[_0x6052('0x35')];_0x10583a['order']=qs[_0x6052('0x3d')](_0x1a62ee[_0x6052('0x36')]['sort']);_0x10583a[_0x6052('0x3e')]=qs[_0x6052('0x37')](_[_0x6052('0x56')](_0x1a62ee[_0x6052('0x36')],_0x4afb4e[_0x6052('0x37')]));if(_0x1a62ee['query']['filter']){_0x10583a['where']=_['merge'](_0x10583a[_0x6052('0x3e')],{'$or':_['map'](_0x10583a[_0x6052('0x39')],function(_0x2bb7bc){var _0x4baf2d={};_0x4baf2d[_0x2bb7bc]={'$like':'%'+_0x1a62ee[_0x6052('0x36')][_0x6052('0x3f')]+'%'};return _0x4baf2d;})});}_0x10583a=_[_0x6052('0x40')]({},_0x10583a,_0x1a62ee[_0x6052('0x42')]);return _0x594bcb['getMembers'](_0x10583a);}})[_0x6052('0x2a')](function(_0x23797e){if(_0x23797e){_0x3737c1=_0x23797e[_0x6052('0x3b')];if(!_0x1a62ee['query'][_0x6052('0x57')]('nolimit')){_0x10583a[_0x6052('0x23')]=qs[_0x6052('0x23')](_0x1a62ee[_0x6052('0x36')][_0x6052('0x23')]);_0x10583a['offset']=qs[_0x6052('0x21')](_0x1a62ee[_0x6052('0x36')][_0x6052('0x21')]);}return _0x594bcb[_0x6052('0x53')](_0x10583a);}})[_0x6052('0x2a')](function(_0x48b202){if(_0x48b202){return _0x48b202?{'count':_0x3737c1,'rows':_0x48b202}:null;}})[_0x6052('0x2a')](respondWithResult(_0x4ff1ec,null))[_0x6052('0x45')](handleError(_0x4ff1ec,null));};exports['removeMembers']=function(_0x48bc75,_0x1cb979,_0x2ac38d){return db[_0x6052('0x31')][_0x6052('0x4a')]({'where':{'id':_0x48bc75[_0x6052('0x4b')]['id']}})[_0x6052('0x2a')](handleEntityNotFound(_0x1cb979,null))[_0x6052('0x2a')](function(_0x2fa597){if(_0x2fa597){return _0x2fa597['removeMembers'](_0x48bc75[_0x6052('0x36')][_0x6052('0x51')]);}})[_0x6052('0x2a')](respondWithStatusCode(_0x1cb979,null))[_0x6052('0x45')](handleError(_0x1cb979,null));};exports[_0x6052('0x58')]=function(_0x2feb2b,_0x88a207,_0x4601f3){if(_0x2feb2b[_0x6052('0x49')]['id']){delete _0x2feb2b[_0x6052('0x49')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2feb2b[_0x6052('0x4b')]['id']}})[_0x6052('0x2a')](handleEntityNotFound(_0x88a207,null))['then'](function(_0xfe4ce2){if(_0xfe4ce2){_0x2feb2b[_0x6052('0x49')][_0x6052('0x59')]=_0xfe4ce2['id'];return db['ChatInternalMessage'][_0x6052('0x48')](_0x2feb2b[_0x6052('0x49')]);}})['then'](respondWithResult(_0x88a207,null))[_0x6052('0x45')](handleError(_0x88a207,null));};exports['getMessages']=function(_0x134088,_0x5e7b7f,_0x328875){var _0x41cfac={};var _0x28ab7e={};var _0x32841b;var _0xc9b330;return db[_0x6052('0x31')]['findOne']({'where':{'id':_0x134088[_0x6052('0x4b')]['id']}})[_0x6052('0x2a')](handleEntityNotFound(_0x5e7b7f,null))['then'](function(_0x3e70c8){if(_0x3e70c8){_0x32841b=_0x3e70c8;_0x28ab7e[_0x6052('0x35')]=_[_0x6052('0x47')](db[_0x6052('0x4d')][_0x6052('0x32')]);_0x28ab7e['query']=_[_0x6052('0x47')](_0x134088[_0x6052('0x36')]);_0x28ab7e[_0x6052('0x37')]=_[_0x6052('0x38')](_0x28ab7e[_0x6052('0x35')],_0x28ab7e[_0x6052('0x36')]);_0x41cfac['attributes']=_['intersection'](_0x28ab7e['model'],qs[_0x6052('0x3a')](_0x134088['query'][_0x6052('0x3a')]));_0x41cfac[_0x6052('0x39')]=_0x41cfac['attributes'][_0x6052('0x3b')]?_0x41cfac[_0x6052('0x39')]:_0x28ab7e[_0x6052('0x35')];_0x41cfac[_0x6052('0x3c')]=qs[_0x6052('0x3d')](_0x134088[_0x6052('0x36')][_0x6052('0x3d')]);_0x41cfac[_0x6052('0x3e')]=qs[_0x6052('0x37')](_[_0x6052('0x56')](_0x134088[_0x6052('0x36')],_0x28ab7e[_0x6052('0x37')]));if(_0x134088[_0x6052('0x36')][_0x6052('0x3f')]){_0x41cfac[_0x6052('0x3e')]=_['merge'](_0x41cfac[_0x6052('0x3e')],{'$or':_[_0x6052('0x30')](_0x41cfac[_0x6052('0x39')],function(_0x162ab1){var _0xb858d1={};_0xb858d1[_0x162ab1]={'$like':'%'+_0x134088[_0x6052('0x36')][_0x6052('0x3f')]+'%'};return _0xb858d1;})});}if(_0x134088[_0x6052('0x36')][_0x6052('0x5a')]){var _0x5a95e9=_0x134088[_0x6052('0x36')][_0x6052('0x5a')][_0x6052('0x5b')](',');var _0x2ebbda={};_0x2ebbda[_0x5a95e9[0x0]]={'$gte':moment(_0x5a95e9[0x1])['format'](_0x6052('0x5c'))};_0x41cfac[_0x6052('0x3e')]=_[_0x6052('0x40')](_0x41cfac[_0x6052('0x3e')],_0x2ebbda);}_0x41cfac=_[_0x6052('0x40')]({},_0x41cfac,_0x134088[_0x6052('0x42')]);return _0x32841b[_0x6052('0x5d')](_0x41cfac);}})[_0x6052('0x2a')](function(_0x2e3691){if(_0x2e3691){_0xc9b330=_0x2e3691['length'];if(!_0x134088[_0x6052('0x36')][_0x6052('0x57')](_0x6052('0x5e'))){_0x41cfac[_0x6052('0x23')]=qs[_0x6052('0x23')](_0x134088[_0x6052('0x36')][_0x6052('0x23')]);_0x41cfac[_0x6052('0x21')]=qs[_0x6052('0x21')](_0x134088[_0x6052('0x36')]['offset']);}return _0x32841b[_0x6052('0x5d')](_0x41cfac);}})[_0x6052('0x2a')](function(_0x37d01d){if(_0x37d01d){return _0x37d01d?{'count':_0xc9b330,'rows':_0x37d01d}:null;}})['then'](respondWithResult(_0x5e7b7f,null))[_0x6052('0x45')](handleError(_0x5e7b7f,null));};
\ No newline at end of file
+var _0xbc5a=['bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatGroup.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','destroy','then','end','error','stack','name','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','update','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','getMessages','$gte','format','zip-dir','fast-json-patch','moment'];(function(_0xd7823b,_0x5da4e8){var _0x3229ee=function(_0x2b3ea2){while(--_0x2b3ea2){_0xd7823b['push'](_0xd7823b['shift']());}};_0x3229ee(++_0x5da4e8);}(_0xbc5a,0x1d3));var _0xabc5=function(_0x5d10c2,_0x4b0a49){_0x5d10c2=_0x5d10c2-0x0;var _0x57c7c4=_0xbc5a[_0x5d10c2];return _0x57c7c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xabc5('0x0'));var jsonpatch=require(_0xabc5('0x1'));var rp=require('request-promise');var moment=require(_0xabc5('0x2'));var BPromise=require(_0xabc5('0x3'));var Mustache=require(_0xabc5('0x4'));var util=require('util');var path=require(_0xabc5('0x5'));var sox=require(_0xabc5('0x6'));var csv=require('to-csv');var ejs=require(_0xabc5('0x7'));var fs=require('fs');var fs_extra=require(_0xabc5('0x8'));var _=require('lodash');var squel=require(_0xabc5('0x9'));var crypto=require(_0xabc5('0xa'));var jsforce=require(_0xabc5('0xb'));var deskjs=require(_0xabc5('0xc'));var toCsv=require(_0xabc5('0xd'));var querystring=require(_0xabc5('0xe'));var Papa=require(_0xabc5('0xf'));var Redis=require(_0xabc5('0x10'));var authService=require(_0xabc5('0x11'));var qs=require(_0xabc5('0x12'));var as=require(_0xabc5('0x13'));var hardwareService=require(_0xabc5('0x14'));var logger=require(_0xabc5('0x15'))(_0xabc5('0x16'));var utils=require(_0xabc5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xabc5('0x18'));var db=require(_0xabc5('0x19'))['db'];config[_0xabc5('0x1a')]=_['defaults'](config[_0xabc5('0x1a')],{'host':_0xabc5('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabc5('0x1a')]));require(_0xabc5('0x1c'))[_0xabc5('0x1d')](socket);function respondWithStatusCode(_0x4d896d,_0x3090c3){_0x3090c3=_0x3090c3||0xcc;return function(_0x4a0ffc){if(_0x4a0ffc){return _0x4d896d[_0xabc5('0x1e')](_0x3090c3);}return _0x4d896d['status'](_0x3090c3)['end']();};}function respondWithResult(_0x22eca5,_0x5db277){_0x5db277=_0x5db277||0xc8;return function(_0x123d10){if(_0x123d10){return _0x22eca5[_0xabc5('0x1f')](_0x5db277)[_0xabc5('0x20')](_0x123d10);}};}function respondWithFilteredResult(_0x36f824,_0x560d11){return function(_0x3be089){if(_0x3be089){var _0x2e1bec=typeof _0x560d11[_0xabc5('0x21')]==='undefined'&&typeof _0x560d11[_0xabc5('0x22')]===_0xabc5('0x23');var _0x24fe0a=_0x3be089['count'];var _0x2d2391=_0x2e1bec?0x0:_0x560d11['offset'];var _0xf20e28=_0x2e1bec?_0x3be089[_0xabc5('0x24')]:_0x560d11[_0xabc5('0x21')]+_0x560d11[_0xabc5('0x22')];var _0x51ef01;if(_0xf20e28>=_0x24fe0a){_0xf20e28=_0x24fe0a;_0x51ef01=0xc8;}else{_0x51ef01=0xce;}_0x36f824['status'](_0x51ef01);return _0x36f824[_0xabc5('0x25')](_0xabc5('0x26'),_0x2d2391+'-'+_0xf20e28+'/'+_0x24fe0a)[_0xabc5('0x20')](_0x3be089);}return null;};}function patchUpdates(_0x29edff){return function(_0x1b52ae){try{jsonpatch[_0xabc5('0x27')](_0x1b52ae,_0x29edff,!![]);}catch(_0x21e2ac){return BPromise['reject'](_0x21e2ac);}return _0x1b52ae['save']();};}function saveUpdates(_0x11097a,_0x3614b3){return function(_0x512192){if(_0x512192){return _0x512192['update'](_0x11097a)['then'](function(_0x41ac85){return _0x41ac85;});}return null;};}function removeEntity(_0x2fefb6,_0x76327f){return function(_0x4884d4){if(_0x4884d4){return _0x4884d4[_0xabc5('0x28')]()[_0xabc5('0x29')](function(){_0x2fefb6[_0xabc5('0x1f')](0xcc)[_0xabc5('0x2a')]();});}};}function handleEntityNotFound(_0x4528cd,_0x561e0a){return function(_0x4979a0){if(!_0x4979a0){_0x4528cd[_0xabc5('0x1e')](0x194);}return _0x4979a0;};}function handleError(_0x564af0,_0x9d6c27){_0x9d6c27=_0x9d6c27||0x1f4;return function(_0x829771){logger[_0xabc5('0x2b')](_0x829771[_0xabc5('0x2c')]);if(_0x829771[_0xabc5('0x2d')]){delete _0x829771['name'];}_0x564af0[_0xabc5('0x1f')](_0x9d6c27)['send'](_0x829771);};}exports[_0xabc5('0x2e')]=function(_0x8be813,_0x37342e){var _0x1b5c12={},_0x54e2fd={},_0x326dbe={'count':0x0,'rows':[]};var _0x51be3e=_[_0xabc5('0x2f')](db['ChatGroup']['rawAttributes'],function(_0x429fe6){return{'name':_0x429fe6['fieldName'],'type':_0x429fe6[_0xabc5('0x30')][_0xabc5('0x31')]};});_0x54e2fd[_0xabc5('0x32')]=_[_0xabc5('0x2f')](_0x51be3e,'name');_0x54e2fd[_0xabc5('0x33')]=_[_0xabc5('0x34')](_0x8be813['query']);_0x54e2fd[_0xabc5('0x35')]=_[_0xabc5('0x36')](_0x54e2fd['model'],_0x54e2fd['query']);_0x1b5c12[_0xabc5('0x37')]=_[_0xabc5('0x36')](_0x54e2fd[_0xabc5('0x32')],qs[_0xabc5('0x38')](_0x8be813[_0xabc5('0x33')]['fields']));_0x1b5c12['attributes']=_0x1b5c12[_0xabc5('0x37')][_0xabc5('0x39')]?_0x1b5c12[_0xabc5('0x37')]:_0x54e2fd['model'];if(!_0x8be813[_0xabc5('0x33')][_0xabc5('0x3a')](_0xabc5('0x3b'))){_0x1b5c12[_0xabc5('0x22')]=qs['limit'](_0x8be813[_0xabc5('0x33')][_0xabc5('0x22')]);_0x1b5c12[_0xabc5('0x21')]=qs[_0xabc5('0x21')](_0x8be813[_0xabc5('0x33')][_0xabc5('0x21')]);}_0x1b5c12[_0xabc5('0x3c')]=qs['sort'](_0x8be813[_0xabc5('0x33')][_0xabc5('0x3d')]);_0x1b5c12[_0xabc5('0x3e')]=qs[_0xabc5('0x35')](_[_0xabc5('0x3f')](_0x8be813[_0xabc5('0x33')],_0x54e2fd['filters']),_0x51be3e);if(_0x8be813[_0xabc5('0x33')][_0xabc5('0x40')]){_0x1b5c12[_0xabc5('0x3e')]=_[_0xabc5('0x41')](_0x1b5c12[_0xabc5('0x3e')],{'$or':_[_0xabc5('0x2f')](_0x51be3e,function(_0x362534){if(_0x362534[_0xabc5('0x30')]!==_0xabc5('0x42')){var _0x42b6ed={};_0x42b6ed[_0x362534[_0xabc5('0x2d')]]={'$like':'%'+_0x8be813['query'][_0xabc5('0x40')]+'%'};return _0x42b6ed;}})});}_0x1b5c12=_[_0xabc5('0x41')]({},_0x1b5c12,_0x8be813[_0xabc5('0x43')]);var _0x21c89f={'where':_0x1b5c12['where']};return db[_0xabc5('0x44')][_0xabc5('0x24')](_0x21c89f)[_0xabc5('0x29')](function(_0x26746f){_0x326dbe['count']=_0x26746f;if(_0x8be813[_0xabc5('0x33')]['includeAll']){_0x1b5c12[_0xabc5('0x45')]=[{'all':!![]}];}return db[_0xabc5('0x44')][_0xabc5('0x46')](_0x1b5c12);})[_0xabc5('0x29')](function(_0x2938c8){_0x326dbe['rows']=_0x2938c8;return _0x326dbe;})[_0xabc5('0x29')](respondWithFilteredResult(_0x37342e,_0x1b5c12))[_0xabc5('0x47')](handleError(_0x37342e,null));};exports[_0xabc5('0x48')]=function(_0x1805f8,_0x5df7a0){var _0x5a2b7c={'raw':!![],'where':{'id':_0x1805f8[_0xabc5('0x49')]['id']}},_0x3377a6={};_0x3377a6['model']=_[_0xabc5('0x34')](db[_0xabc5('0x44')][_0xabc5('0x4a')]);_0x3377a6[_0xabc5('0x33')]=_[_0xabc5('0x34')](_0x1805f8[_0xabc5('0x33')]);_0x3377a6[_0xabc5('0x35')]=_[_0xabc5('0x36')](_0x3377a6[_0xabc5('0x32')],_0x3377a6[_0xabc5('0x33')]);_0x5a2b7c[_0xabc5('0x37')]=_[_0xabc5('0x36')](_0x3377a6['model'],qs[_0xabc5('0x38')](_0x1805f8['query'][_0xabc5('0x38')]));_0x5a2b7c[_0xabc5('0x37')]=_0x5a2b7c[_0xabc5('0x37')]['length']?_0x5a2b7c[_0xabc5('0x37')]:_0x3377a6[_0xabc5('0x32')];if(_0x1805f8[_0xabc5('0x33')][_0xabc5('0x4b')]){_0x5a2b7c['include']=[{'all':!![]}];}_0x5a2b7c=_[_0xabc5('0x41')]({},_0x5a2b7c,_0x1805f8['options']);return db['ChatGroup'][_0xabc5('0x4c')](_0x5a2b7c)[_0xabc5('0x29')](handleEntityNotFound(_0x5df7a0,null))['then'](respondWithResult(_0x5df7a0,null))['catch'](handleError(_0x5df7a0,null));};exports[_0xabc5('0x4d')]=function(_0x2725a1,_0x8f85fb){return db[_0xabc5('0x44')][_0xabc5('0x4d')](_0x2725a1['body'],{})[_0xabc5('0x29')](respondWithResult(_0x8f85fb,0xc9))[_0xabc5('0x47')](handleError(_0x8f85fb,null));};exports[_0xabc5('0x4e')]=function(_0x5acc2f,_0x23376a){if(_0x5acc2f[_0xabc5('0x4f')]['id']){delete _0x5acc2f[_0xabc5('0x4f')]['id'];}return db[_0xabc5('0x44')][_0xabc5('0x4c')]({'where':{'id':_0x5acc2f['params']['id']}})[_0xabc5('0x29')](handleEntityNotFound(_0x23376a,null))[_0xabc5('0x29')](saveUpdates(_0x5acc2f[_0xabc5('0x4f')],null))[_0xabc5('0x29')](respondWithResult(_0x23376a,null))['catch'](handleError(_0x23376a,null));};exports[_0xabc5('0x28')]=function(_0x50bec3,_0x334ca5){return db[_0xabc5('0x44')]['find']({'where':{'id':_0x50bec3[_0xabc5('0x49')]['id']}})[_0xabc5('0x29')](handleEntityNotFound(_0x334ca5,null))[_0xabc5('0x29')](removeEntity(_0x334ca5,null))[_0xabc5('0x47')](handleError(_0x334ca5,null));};exports[_0xabc5('0x50')]=function(_0x5c6b6b,_0x2a0213){return db[_0xabc5('0x44')][_0xabc5('0x50')]()[_0xabc5('0x29')](respondWithResult(_0x2a0213,null))[_0xabc5('0x47')](handleError(_0x2a0213,null));};exports[_0xabc5('0x51')]=function(_0x230a2e,_0x1feafc,_0x228da4){return db[_0xabc5('0x52')][_0xabc5('0x24')]({'where':{'ChatGroupId':_0x230a2e[_0xabc5('0x49')]['id'],'ToId':_0x230a2e['user']['id'],'read':![]}})[_0xabc5('0x29')](function(_0x42a0bb){return{'id':_[_0xabc5('0x53')](_0x230a2e['params']['id']),'count':_0x42a0bb};})['then'](respondWithResult(_0x1feafc,null))['catch'](handleError(_0x1feafc,null));};exports['addMembers']=function(_0x18087a,_0x5916bd,_0x562309){return db['ChatGroup'][_0xabc5('0x4c')]({'where':{'id':_0x18087a[_0xabc5('0x49')]['id']}})['then'](handleEntityNotFound(_0x5916bd,null))['then'](function(_0x4824fa){if(_0x4824fa){return _0x4824fa[_0xabc5('0x54')](_0x18087a[_0xabc5('0x4f')][_0xabc5('0x55')],_['omit'](_0x18087a['body'],[_0xabc5('0x55'),'id'])||{});}})[_0xabc5('0x29')](respondWithResult(_0x5916bd,null))[_0xabc5('0x47')](handleError(_0x5916bd,null));};exports[_0xabc5('0x56')]=function(_0x51f8ad,_0x1b3589,_0x504065){var _0x2b0eda={};var _0x5e715b={};var _0x58fa82;var _0xfa454b;return db[_0xabc5('0x44')][_0xabc5('0x57')]({'where':{'id':_0x51f8ad[_0xabc5('0x49')]['id']}})[_0xabc5('0x29')](handleEntityNotFound(_0x1b3589,null))['then'](function(_0x403151){if(_0x403151){_0x58fa82=_0x403151;_0x5e715b[_0xabc5('0x32')]=_[_0xabc5('0x34')](db[_0xabc5('0x58')]['rawAttributes']);_0x5e715b['query']=_[_0xabc5('0x34')](_0x51f8ad['query']);_0x5e715b[_0xabc5('0x35')]=_[_0xabc5('0x36')](_0x5e715b[_0xabc5('0x32')],_0x5e715b[_0xabc5('0x33')]);_0x2b0eda[_0xabc5('0x37')]=_[_0xabc5('0x36')](_0x5e715b[_0xabc5('0x32')],qs[_0xabc5('0x38')](_0x51f8ad[_0xabc5('0x33')]['fields']));_0x2b0eda['attributes']=_0x2b0eda[_0xabc5('0x37')][_0xabc5('0x39')]?_0x2b0eda['attributes']:_0x5e715b['model'];_0x2b0eda[_0xabc5('0x3c')]=qs[_0xabc5('0x3d')](_0x51f8ad[_0xabc5('0x33')]['sort']);_0x2b0eda['where']=qs[_0xabc5('0x35')](_[_0xabc5('0x3f')](_0x51f8ad[_0xabc5('0x33')],_0x5e715b[_0xabc5('0x35')]));if(_0x51f8ad[_0xabc5('0x33')]['filter']){_0x2b0eda[_0xabc5('0x3e')]=_['merge'](_0x2b0eda[_0xabc5('0x3e')],{'$or':_[_0xabc5('0x2f')](_0x2b0eda[_0xabc5('0x37')],function(_0x3a3386){var _0x142e4b={};_0x142e4b[_0x3a3386]={'$like':'%'+_0x51f8ad[_0xabc5('0x33')][_0xabc5('0x40')]+'%'};return _0x142e4b;})});}_0x2b0eda=_[_0xabc5('0x41')]({},_0x2b0eda,_0x51f8ad[_0xabc5('0x43')]);return _0x58fa82['getMembers'](_0x2b0eda);}})[_0xabc5('0x29')](function(_0x3960a7){if(_0x3960a7){_0xfa454b=_0x3960a7[_0xabc5('0x39')];if(!_0x51f8ad[_0xabc5('0x33')]['hasOwnProperty'](_0xabc5('0x3b'))){_0x2b0eda['limit']=qs[_0xabc5('0x22')](_0x51f8ad[_0xabc5('0x33')]['limit']);_0x2b0eda['offset']=qs[_0xabc5('0x21')](_0x51f8ad['query'][_0xabc5('0x21')]);}return _0x58fa82['getMembers'](_0x2b0eda);}})[_0xabc5('0x29')](function(_0x419000){if(_0x419000){return _0x419000?{'count':_0xfa454b,'rows':_0x419000}:null;}})[_0xabc5('0x29')](respondWithResult(_0x1b3589,null))[_0xabc5('0x47')](handleError(_0x1b3589,null));};exports[_0xabc5('0x59')]=function(_0x514dd5,_0x204884,_0x4b6fef){return db[_0xabc5('0x44')][_0xabc5('0x4c')]({'where':{'id':_0x514dd5[_0xabc5('0x49')]['id']}})[_0xabc5('0x29')](handleEntityNotFound(_0x204884,null))[_0xabc5('0x29')](function(_0x5608c9){if(_0x5608c9){return _0x5608c9[_0xabc5('0x59')](_0x514dd5[_0xabc5('0x33')][_0xabc5('0x55')]);}})[_0xabc5('0x29')](respondWithStatusCode(_0x204884,null))[_0xabc5('0x47')](handleError(_0x204884,null));};exports[_0xabc5('0x5a')]=function(_0x1352a9,_0x523209,_0x1910e4){if(_0x1352a9[_0xabc5('0x4f')]['id']){delete _0x1352a9[_0xabc5('0x4f')]['id'];}return db[_0xabc5('0x44')][_0xabc5('0x4c')]({'where':{'id':_0x1352a9[_0xabc5('0x49')]['id']}})[_0xabc5('0x29')](handleEntityNotFound(_0x523209,null))[_0xabc5('0x29')](function(_0x2efba7){if(_0x2efba7){_0x1352a9[_0xabc5('0x4f')]['ChatGroupId']=_0x2efba7['id'];return db[_0xabc5('0x52')][_0xabc5('0x4d')](_0x1352a9['body']);}})[_0xabc5('0x29')](respondWithResult(_0x523209,null))[_0xabc5('0x47')](handleError(_0x523209,null));};exports[_0xabc5('0x5b')]=function(_0xcab2d8,_0x2d9fad,_0x4e5b58){var _0x40bd9d={};var _0x1f3f59={};var _0x1a41f2;var _0x239635;return db['ChatGroup']['findOne']({'where':{'id':_0xcab2d8['params']['id']}})[_0xabc5('0x29')](handleEntityNotFound(_0x2d9fad,null))[_0xabc5('0x29')](function(_0x1a3d55){if(_0x1a3d55){_0x1a41f2=_0x1a3d55;_0x1f3f59[_0xabc5('0x32')]=_[_0xabc5('0x34')](db['ChatInternalMessage'][_0xabc5('0x4a')]);_0x1f3f59[_0xabc5('0x33')]=_[_0xabc5('0x34')](_0xcab2d8[_0xabc5('0x33')]);_0x1f3f59[_0xabc5('0x35')]=_[_0xabc5('0x36')](_0x1f3f59['model'],_0x1f3f59['query']);_0x40bd9d['attributes']=_['intersection'](_0x1f3f59[_0xabc5('0x32')],qs[_0xabc5('0x38')](_0xcab2d8['query'][_0xabc5('0x38')]));_0x40bd9d[_0xabc5('0x37')]=_0x40bd9d[_0xabc5('0x37')][_0xabc5('0x39')]?_0x40bd9d[_0xabc5('0x37')]:_0x1f3f59['model'];_0x40bd9d['order']=qs[_0xabc5('0x3d')](_0xcab2d8[_0xabc5('0x33')][_0xabc5('0x3d')]);_0x40bd9d[_0xabc5('0x3e')]=qs[_0xabc5('0x35')](_[_0xabc5('0x3f')](_0xcab2d8[_0xabc5('0x33')],_0x1f3f59['filters']));if(_0xcab2d8['query'][_0xabc5('0x40')]){_0x40bd9d['where']=_[_0xabc5('0x41')](_0x40bd9d[_0xabc5('0x3e')],{'$or':_['map'](_0x40bd9d[_0xabc5('0x37')],function(_0x40f3f0){var _0x49a8d6={};_0x49a8d6[_0x40f3f0]={'$like':'%'+_0xcab2d8['query'][_0xabc5('0x40')]+'%'};return _0x49a8d6;})});}if(_0xcab2d8[_0xabc5('0x33')]['$gte']){var _0x15aae6=_0xcab2d8[_0xabc5('0x33')][_0xabc5('0x5c')]['split'](',');var _0x4187f1={};_0x4187f1[_0x15aae6[0x0]]={'$gte':moment(_0x15aae6[0x1])[_0xabc5('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x40bd9d[_0xabc5('0x3e')]=_[_0xabc5('0x41')](_0x40bd9d[_0xabc5('0x3e')],_0x4187f1);}_0x40bd9d=_['merge']({},_0x40bd9d,_0xcab2d8['options']);return _0x1a41f2[_0xabc5('0x5b')](_0x40bd9d);}})[_0xabc5('0x29')](function(_0x8a1a24){if(_0x8a1a24){_0x239635=_0x8a1a24['length'];if(!_0xcab2d8[_0xabc5('0x33')][_0xabc5('0x3a')](_0xabc5('0x3b'))){_0x40bd9d[_0xabc5('0x22')]=qs[_0xabc5('0x22')](_0xcab2d8[_0xabc5('0x33')][_0xabc5('0x22')]);_0x40bd9d[_0xabc5('0x21')]=qs[_0xabc5('0x21')](_0xcab2d8[_0xabc5('0x33')][_0xabc5('0x21')]);}return _0x1a41f2[_0xabc5('0x5b')](_0x40bd9d);}})[_0xabc5('0x29')](function(_0x4ed50d){if(_0x4ed50d){return _0x4ed50d?{'count':_0x239635,'rows':_0x4ed50d}:null;}})['then'](respondWithResult(_0x2d9fad,null))['catch'](handleError(_0x2d9fad,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index e8718ba..e9753a5 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 _0xeeb4=['events','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x44aeb3,_0x56e4bb){var _0x5bc8dd=function(_0x3b749e){while(--_0x3b749e){_0x44aeb3['push'](_0x44aeb3['shift']());}};_0x5bc8dd(++_0x56e4bb);}(_0xeeb4,0x1f1));var _0x4eeb=function(_0x258c1c,_0x1e2696){_0x258c1c=_0x258c1c-0x0;var _0x4ac65f=_0xeeb4[_0x258c1c];return _0x4ac65f;};'use strict';var EventEmitter=require(_0x4eeb('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4eeb('0x1')](0x0);var events={'afterCreate':_0x4eeb('0x2'),'afterUpdate':_0x4eeb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44afd4){return function(_0xc14d71,_0x23e194,_0x32f49d){ChatGroupEvents[_0x4eeb('0x4')](_0x44afd4+':'+_0xc14d71['id'],_0xc14d71);ChatGroupEvents[_0x4eeb('0x4')](_0x44afd4,_0xc14d71);_0x32f49d(null);};}for(var e in events){if(events[_0x4eeb('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x4eeb('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x7782=['ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x33b2a4,_0xdb7db0){var _0x51b7ad=function(_0x4a5bb2){while(--_0x4a5bb2){_0x33b2a4['push'](_0x33b2a4['shift']());}};_0x51b7ad(++_0xdb7db0);}(_0x7782,0x134));var _0x2778=function(_0x360cad,_0x54285f){_0x360cad=_0x360cad-0x0;var _0xd9a0ba=_0x7782[_0x360cad];return _0xd9a0ba;};'use strict';var EventEmitter=require(_0x2778('0x0'));var ChatGroup=require(_0x2778('0x1'))['db'][_0x2778('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2778('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2778('0x4'),'afterDestroy':_0x2778('0x5')};function emitEvent(_0x450524){return function(_0x1d8bd8,_0x124b71,_0x45ccda){ChatGroupEvents[_0x2778('0x6')](_0x450524+':'+_0x1d8bd8['id'],_0x1d8bd8);ChatGroupEvents[_0x2778('0x6')](_0x450524,_0x1d8bd8);_0x45ccda(null);};}for(var e in events){if(events[_0x2778('0x7')](e)){var event=events[e];ChatGroup[_0x2778('0x8')](e,emitEvent(event));}}module[_0x2778('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 408bc63..c2b7935 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 _0x82ee=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x82ee,0xdb));var _0xe82e=function(_0x5a444d,_0xff2d5){_0x5a444d=_0x5a444d-0x0;var _0x1140e9=_0x82ee[_0x5a444d];return _0x1140e9;};'use strict';var _=require(_0xe82e('0x0'));var util=require('util');var logger=require(_0xe82e('0x1'))('api');var moment=require(_0xe82e('0x2'));var BPromise=require(_0xe82e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe82e('0x4'));var config=require(_0xe82e('0x5'));var attributes=require(_0xe82e('0x6'));module[_0xe82e('0x7')]=function(_0x139991,_0x1553c8){return _0x139991[_0xe82e('0x8')](_0xe82e('0x9'),attributes,{'tableName':_0xe82e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7737=['./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xe485c4,_0x3d0f36){var _0x24cb58=function(_0x492673){while(--_0x492673){_0xe485c4['push'](_0xe485c4['shift']());}};_0x24cb58(++_0x3d0f36);}(_0x7737,0x1f2));var _0x7773=function(_0x7b8b47,_0x274711){_0x7b8b47=_0x7b8b47-0x0;var _0x5b3c2a=_0x7737[_0x7b8b47];return _0x5b3c2a;};'use strict';var _=require(_0x7773('0x0'));var util=require(_0x7773('0x1'));var logger=require(_0x7773('0x2'))('api');var moment=require(_0x7773('0x3'));var BPromise=require(_0x7773('0x4'));var rp=require(_0x7773('0x5'));var fs=require('fs');var path=require(_0x7773('0x6'));var rimraf=require(_0x7773('0x7'));var config=require(_0x7773('0x8'));var attributes=require(_0x7773('0x9'));module[_0x7773('0xa')]=function(_0xf883ad,_0x3012e9){return _0xf883ad[_0x7773('0xb')](_0x7773('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 59cb91c..9e5b926 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 _0x2e78=['request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatGroup.socket','register','request','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ChatGroup,\x20%s,\x20%s'];(function(_0x46e4fd,_0x88bd23){var _0x365075=function(_0x3fa0ec){while(--_0x3fa0ec){_0x46e4fd['push'](_0x46e4fd['shift']());}};_0x365075(++_0x88bd23);}(_0x2e78,0xab));var _0x82e7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2e78[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x82e7('0x0'));var util=require(_0x82e7('0x1'));var moment=require(_0x82e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x82e7('0x3'));var fs=require('fs');var Redis=require(_0x82e7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x82e7('0x5'));var logger=require('../../config/logger')(_0x82e7('0x6'));var config=require(_0x82e7('0x7'));var jayson=require(_0x82e7('0x8'));var client=jayson[_0x82e7('0x9')][_0x82e7('0xa')]({'port':0x232a});config[_0x82e7('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x82e7('0xc'))(new Redis(config[_0x82e7('0xb')]));require(_0x82e7('0xd'))[_0x82e7('0xe')](socket);function respondWithRpcPromise(_0xba46f6,_0x359c45,_0x5c8b9e){return new BPromise(function(_0x22d49a,_0x4eb759){return client[_0x82e7('0xf')](_0xba46f6,_0x5c8b9e)[_0x82e7('0x10')](function(_0x4e0855){logger['info']('ChatGroup,\x20%s,\x20%s',_0x359c45,'request\x20sent');logger[_0x82e7('0x11')](_0x82e7('0x12'),_0x359c45,'request\x20sent',JSON[_0x82e7('0x13')](_0x4e0855));if(_0x4e0855['error']){if(_0x4e0855[_0x82e7('0x14')][_0x82e7('0x15')]===0x1f4){logger[_0x82e7('0x14')]('ChatGroup,\x20%s,\x20%s',_0x359c45,_0x4e0855[_0x82e7('0x14')]['message']);return _0x4eb759(_0x4e0855['error'][_0x82e7('0x16')]);}logger[_0x82e7('0x14')]('ChatGroup,\x20%s,\x20%s',_0x359c45,_0x4e0855[_0x82e7('0x14')][_0x82e7('0x16')]);return _0x22d49a(_0x4e0855[_0x82e7('0x14')][_0x82e7('0x16')]);}else{logger[_0x82e7('0x17')](_0x82e7('0x18'),_0x359c45,_0x82e7('0x19'));_0x22d49a(_0x4e0855[_0x82e7('0x1a')][_0x82e7('0x16')]);}})[_0x82e7('0x1b')](function(_0x5bbc4b){logger[_0x82e7('0x14')](_0x82e7('0x18'),_0x359c45,_0x5bbc4b);_0x4eb759(_0x5bbc4b);});});}
\ No newline at end of file
+var _0x39a9=['request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x1b231d,_0x2e6d98){var _0x41b34c=function(_0x4d406e){while(--_0x4d406e){_0x1b231d['push'](_0x1b231d['shift']());}};_0x41b34c(++_0x2e6d98);}(_0x39a9,0x1d0));var _0x939a=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x39a9[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0x939a('0x0'));var util=require(_0x939a('0x1'));var moment=require(_0x939a('0x2'));var BPromise=require(_0x939a('0x3'));var rs=require(_0x939a('0x4'));var fs=require('fs');var Redis=require(_0x939a('0x5'));var db=require(_0x939a('0x6'))['db'];var utils=require(_0x939a('0x7'));var logger=require(_0x939a('0x8'))(_0x939a('0x9'));var config=require(_0x939a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x939a('0xb')][_0x939a('0xc')]({'port':0x232a});config[_0x939a('0xd')]=_[_0x939a('0xe')](config[_0x939a('0xd')],{'host':_0x939a('0xf'),'port':0x18eb});var socket=require(_0x939a('0x10'))(new Redis(config[_0x939a('0xd')]));require('./chatGroup.socket')[_0x939a('0x11')](socket);function respondWithRpcPromise(_0x19e985,_0x27fc39,_0x5e81d6){return new BPromise(function(_0x11d9db,_0x41bb74){return client[_0x939a('0x12')](_0x19e985,_0x5e81d6)['then'](function(_0x3032c4){logger[_0x939a('0x13')](_0x939a('0x14'),_0x27fc39,'request\x20sent');logger['debug'](_0x939a('0x15'),_0x27fc39,_0x939a('0x16'),JSON[_0x939a('0x17')](_0x3032c4));if(_0x3032c4['error']){if(_0x3032c4[_0x939a('0x18')][_0x939a('0x19')]===0x1f4){logger[_0x939a('0x18')](_0x939a('0x14'),_0x27fc39,_0x3032c4[_0x939a('0x18')][_0x939a('0x1a')]);return _0x41bb74(_0x3032c4[_0x939a('0x18')]['message']);}logger[_0x939a('0x18')]('ChatGroup,\x20%s,\x20%s',_0x27fc39,_0x3032c4[_0x939a('0x18')]['message']);return _0x11d9db(_0x3032c4[_0x939a('0x18')][_0x939a('0x1a')]);}else{logger[_0x939a('0x13')](_0x939a('0x14'),_0x27fc39,'request\x20sent');_0x11d9db(_0x3032c4['result'][_0x939a('0x1a')]);}})['catch'](function(_0x5648d5){logger[_0x939a('0x18')](_0x939a('0x14'),_0x27fc39,_0x5648d5);_0x41bb74(_0x5648d5);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 377e4a8..e93e29b 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 _0x52d6=['remove','update','removeListener','length','chatGroup:','./chatGroup.events','save'];(function(_0x219824,_0x300659){var _0x182994=function(_0x1fce9f){while(--_0x1fce9f){_0x219824['push'](_0x219824['shift']());}};_0x182994(++_0x300659);}(_0x52d6,0x1da));var _0x652d=function(_0x5a449f,_0x1b39db){_0x5a449f=_0x5a449f-0x0;var _0x12a4d5=_0x52d6[_0x5a449f];return _0x12a4d5;};'use strict';var ChatGroupEvents=require(_0x652d('0x0'));var events=[_0x652d('0x1'),_0x652d('0x2'),_0x652d('0x3')];function createListener(_0x50b90d,_0x21bcc9){return function(_0x58b876){_0x21bcc9['emit'](_0x50b90d,_0x58b876);};}function removeListener(_0x17d2f3,_0x248623){return function(){ChatGroupEvents[_0x652d('0x4')](_0x17d2f3,_0x248623);};}exports['register']=function(_0x5dbd73){for(var _0x4432c7=0x0,_0x4b41fe=events[_0x652d('0x5')];_0x4432c7<_0x4b41fe;_0x4432c7++){var _0x4fdd67=events[_0x4432c7];var _0x171afa=createListener(_0x652d('0x6')+_0x4fdd67,_0x5dbd73);ChatGroupEvents['on'](_0x4fdd67,_0x171afa);}};
\ No newline at end of file
+var _0xb9cc=['update','emit','removeListener','chatGroup:','./chatGroup.events','save','remove'];(function(_0x5a7fdb,_0x529eb3){var _0x5205c2=function(_0x113e55){while(--_0x113e55){_0x5a7fdb['push'](_0x5a7fdb['shift']());}};_0x5205c2(++_0x529eb3);}(_0xb9cc,0xdd));var _0xcb9c=function(_0x56dd19,_0x22a622){_0x56dd19=_0x56dd19-0x0;var _0x5655fe=_0xb9cc[_0x56dd19];return _0x5655fe;};'use strict';var ChatGroupEvents=require(_0xcb9c('0x0'));var events=[_0xcb9c('0x1'),_0xcb9c('0x2'),_0xcb9c('0x3')];function createListener(_0x49b344,_0x3eecea){return function(_0x229aca){_0x3eecea[_0xcb9c('0x4')](_0x49b344,_0x229aca);};}function removeListener(_0x220bda,_0x351a4b){return function(){ChatGroupEvents[_0xcb9c('0x5')](_0x220bda,_0x351a4b);};}exports['register']=function(_0x7107fb){for(var _0x498ef2=0x0,_0xc6a03f=events['length'];_0x498ef2<_0xc6a03f;_0x498ef2++){var _0x5a7bcf=events[_0x498ef2];var _0x490b5b=createListener(_0xcb9c('0x6')+_0x5a7bcf,_0x7107fb);ChatGroupEvents['on'](_0x5a7bcf,_0x490b5b);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 9758cda..2cf4710 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 _0xffe7=['./chatGroup.controller','isAuthenticated','get','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMessages','post','create','addMembers','/:id/messages','addMessage','put','/:id','update','destroy','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x376597,_0x3ded84){var _0x4d47d1=function(_0x1fffb1){while(--_0x1fffb1){_0x376597['push'](_0x376597['shift']());}};_0x4d47d1(++_0x3ded84);}(_0xffe7,0x1e7));var _0x7ffe=function(_0x1a9f68,_0x14497e){_0x1a9f68=_0x1a9f68-0x0;var _0x293c7b=_0xffe7[_0x1a9f68];return _0x293c7b;};'use strict';var multer=require(_0x7ffe('0x0'));var util=require(_0x7ffe('0x1'));var path=require(_0x7ffe('0x2'));var timeout=require(_0x7ffe('0x3'));var express=require(_0x7ffe('0x4'));var router=express[_0x7ffe('0x5')]();var fs_extra=require(_0x7ffe('0x6'));var auth=require(_0x7ffe('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7ffe('0x8'));var controller=require(_0x7ffe('0x9'));router['get']('/',auth[_0x7ffe('0xa')](),controller['index']);router[_0x7ffe('0xb')](_0x7ffe('0xc'),auth[_0x7ffe('0xa')](),controller[_0x7ffe('0xd')]);router['get']('/:id',auth[_0x7ffe('0xa')](),controller[_0x7ffe('0xe')]);router[_0x7ffe('0xb')](_0x7ffe('0xf'),auth['isAuthenticated'](),controller[_0x7ffe('0x10')]);router[_0x7ffe('0xb')](_0x7ffe('0x11'),auth[_0x7ffe('0xa')](),controller['getMembers']);router['get']('/:id/messages',auth[_0x7ffe('0xa')](),controller[_0x7ffe('0x12')]);router[_0x7ffe('0x13')]('/',auth[_0x7ffe('0xa')](),controller[_0x7ffe('0x14')]);router[_0x7ffe('0x13')](_0x7ffe('0x11'),auth['isAuthenticated'](),controller[_0x7ffe('0x15')]);router[_0x7ffe('0x13')](_0x7ffe('0x16'),auth[_0x7ffe('0xa')](),controller[_0x7ffe('0x17')]);router[_0x7ffe('0x18')](_0x7ffe('0x19'),auth['isAuthenticated'](),controller[_0x7ffe('0x1a')]);router['delete'](_0x7ffe('0x19'),auth[_0x7ffe('0xa')](),controller[_0x7ffe('0x1b')]);router[_0x7ffe('0x1c')](_0x7ffe('0x11'),auth[_0x7ffe('0xa')](),controller[_0x7ffe('0x1d')]);module[_0x7ffe('0x1e')]=router;
\ No newline at end of file
+var _0x8dd5=['getMembers','/:id/messages','create','post','/:id/members','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','index','get','/:id','isAuthenticated','/:id/unread','getUnread'];(function(_0x387651,_0x1704ba){var _0x291aa0=function(_0x545bb6){while(--_0x545bb6){_0x387651['push'](_0x387651['shift']());}};_0x291aa0(++_0x1704ba);}(_0x8dd5,0x1ac));var _0x58dd=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x8dd5[_0x20a558];return _0x53d3f7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x58dd('0x0'));var timeout=require(_0x58dd('0x1'));var express=require(_0x58dd('0x2'));var router=express['Router']();var fs_extra=require(_0x58dd('0x3'));var auth=require(_0x58dd('0x4'));var interaction=require(_0x58dd('0x5'));var config=require('../../config/environment');var controller=require(_0x58dd('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x58dd('0x7')]);router[_0x58dd('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x58dd('0x8')](_0x58dd('0x9'),auth[_0x58dd('0xa')](),controller['show']);router[_0x58dd('0x8')](_0x58dd('0xb'),auth[_0x58dd('0xa')](),controller[_0x58dd('0xc')]);router[_0x58dd('0x8')]('/:id/members',auth[_0x58dd('0xa')](),controller[_0x58dd('0xd')]);router[_0x58dd('0x8')](_0x58dd('0xe'),auth[_0x58dd('0xa')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x58dd('0xf')]);router[_0x58dd('0x10')](_0x58dd('0x11'),auth[_0x58dd('0xa')](),controller['addMembers']);router['post'](_0x58dd('0xe'),auth[_0x58dd('0xa')](),controller['addMessage']);router['put']('/:id',auth[_0x58dd('0xa')](),controller[_0x58dd('0x12')]);router['delete']('/:id',auth[_0x58dd('0xa')](),controller[_0x58dd('0x13')]);router['delete'](_0x58dd('0x11'),auth[_0x58dd('0xa')](),controller['removeMembers']);module[_0x58dd('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 4a54bf3..a3e9e25 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 _0xa902=['BOOLEAN','INTEGER','ENUM','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x4432b5,_0x2bd03f){var _0x1cecdf=function(_0x14154e){while(--_0x14154e){_0x4432b5['push'](_0x4432b5['shift']());}};_0x1cecdf(++_0x2bd03f);}(_0xa902,0x8d));var _0x2a90=function(_0x4f0dd8,_0x299400){_0x4f0dd8=_0x4f0dd8-0x0;var _0x48f875=_0xa902[_0x4f0dd8];return _0x48f875;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'closed':{'type':Sequelize[_0x2a90('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2a90('0x3')]},'ratingType':{'type':Sequelize[_0x2a90('0x4')]('star',_0x2a90('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2a90('0x6')]},'mailTranscript':{'type':Sequelize[_0x2a90('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2a90('0x8')]},'disposition':{'type':Sequelize[_0x2a90('0x7')]},'secondDisposition':{'type':Sequelize[_0x2a90('0x7')]},'thirdDisposition':{'type':Sequelize[_0x2a90('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2a90('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2a90('0x7')]},'deviceModel':{'type':Sequelize[_0x2a90('0x7')]},'deviceVendor':{'type':Sequelize[_0x2a90('0x7')]},'deviceType':{'type':Sequelize[_0x2a90('0x7')]},'referer':{'type':Sequelize[_0x2a90('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2a90('0x6')](_0x2a90('0x9'))},'read1stAt':{'type':Sequelize[_0x2a90('0x8')]},'lastMsgAt':{'type':Sequelize[_0x2a90('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2a90('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2a90('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x2a90('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7be1=['ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x7be1,0x165));var _0x17be=function(_0x11fe8d,_0x19aba4){_0x11fe8d=_0x11fe8d-0x0;var _0x356099=_0x7be1[_0x11fe8d];return _0x356099;};'use strict';var Sequelize=require(_0x17be('0x0'));module[_0x17be('0x1')]={'closed':{'type':Sequelize[_0x17be('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x17be('0x3')](_0x17be('0x4'),_0x17be('0x5')),'defaultValue':_0x17be('0x4')},'ratingMessage':{'type':Sequelize[_0x17be('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x17be('0x7')]},'secondDisposition':{'type':Sequelize[_0x17be('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x17be('0x7')]},'browserName':{'type':Sequelize[_0x17be('0x7')]},'browserVersion':{'type':Sequelize[_0x17be('0x7')]},'osName':{'type':Sequelize[_0x17be('0x7')]},'osVersion':{'type':Sequelize[_0x17be('0x7')]},'deviceModel':{'type':Sequelize[_0x17be('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x17be('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x17be('0x7')]},'formData':{'type':Sequelize[_0x17be('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x17be('0x8')]},'lastMsgAt':{'type':Sequelize[_0x17be('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x17be('0x3')]('in',_0x17be('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x17be('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x17be('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 9d79cd8..5685c65 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 _0x2975=['filter','map','$gte','rows','options','includeAgent','push','spread','Tag','color','emit','removeTags','unix','toString','files','tmp','server','attachments','transcript-%d-%s.zip','lastName','read','Account','Owner','Chat','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','firstName','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','update','destroy','stack','name','send','render','contact','agent','interaction','account','ChatInteraction','rawAttributes','key','getOptions','findAll','user','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','describe','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','type','mimetype','attachmentDownload','closed','Attachment','attachId','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','basename','download','close','mailTranscript','root','format','transcript-%s.txt','now','pathTranscript','User','ChatWebsiteId','ContactId','Messages','Visitor','website_alias','%s%d','agentAlias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','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','getMessages','nolimit','order','sort','where','pick','ChatInteractionId'];(function(_0x5303a2,_0x49716b){var _0x448ac5=function(_0xff8c40){while(--_0xff8c40){_0x5303a2['push'](_0x5303a2['shift']());}};_0x448ac5(++_0x49716b);}(_0x2975,0x1c7));var _0x5297=function(_0x143619,_0x45d113){_0x143619=_0x143619-0x0;var _0x8e5ebe=_0x2975[_0x143619];return _0x8e5ebe;};'use strict';var rimraf=require(_0x5297('0x0'));var zipdir=require(_0x5297('0x1'));var rp=require(_0x5297('0x2'));var moment=require('moment');var BPromise=require(_0x5297('0x3'));var Mustache=require(_0x5297('0x4'));var util=require(_0x5297('0x5'));var path=require(_0x5297('0x6'));var ejs=require(_0x5297('0x7'));var fs=require('fs');var _=require(_0x5297('0x8'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x5297('0x9'));var logger=require(_0x5297('0xa'))(_0x5297('0xb'));var config=require(_0x5297('0xc'));var db=require(_0x5297('0xd'))['db'];config[_0x5297('0xe')]=_['defaults'](config[_0x5297('0xe')],{'host':_0x5297('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5297('0xe')]));require('./chatInteraction.socket')[_0x5297('0x10')](socket);var jayson=require(_0x5297('0x11'));var client=jayson[_0x5297('0x12')][_0x5297('0x13')]({'port':0x232b});var client9004=jayson['client'][_0x5297('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x42770b,_0x8ab6a8,_0xf905a4,_0xb7903b){return new BPromise(function(_0x517110,_0x4c5ba7){var _0x5cc371=_0xb7903b||client;return _0x5cc371[_0x5297('0x14')](_0x42770b,_0xf905a4)[_0x5297('0x15')](function(_0x10df5a){logger[_0x5297('0x16')](_0x5297('0x17'),_0x8ab6a8,_0x5297('0x18'));logger[_0x5297('0x19')](_0x5297('0x1a'),_0x8ab6a8,_0x5297('0x18'),JSON[_0x5297('0x1b')](_0x10df5a));if(_0x10df5a[_0x5297('0x1c')]){if(_0x10df5a[_0x5297('0x1c')][_0x5297('0x1d')]===0x1f4){logger[_0x5297('0x1c')](_0x5297('0x17'),_0x8ab6a8,_0x10df5a[_0x5297('0x1c')]['message']);return _0x4c5ba7(_0x10df5a[_0x5297('0x1c')][_0x5297('0x1e')]);}logger[_0x5297('0x1c')](_0x5297('0x17'),_0x8ab6a8,_0x10df5a[_0x5297('0x1c')][_0x5297('0x1e')]);return _0x517110(_0x10df5a[_0x5297('0x1c')]['message']);}else{logger['info'](_0x5297('0x17'),_0x8ab6a8,'request\x20sent');_0x517110(_0x10df5a[_0x5297('0x1f')][_0x5297('0x1e')]);}})[_0x5297('0x20')](function(_0x3a1fec){logger[_0x5297('0x1c')](_0x5297('0x17'),_0x8ab6a8,_0x3a1fec);_0x4c5ba7(_0x3a1fec);});});}function respondWithStatusCode(_0x2b7821,_0x595f15){_0x595f15=_0x595f15||0xcc;return function(_0x535612){if(_0x535612){return _0x2b7821[_0x5297('0x21')](_0x595f15);}return _0x2b7821[_0x5297('0x22')](_0x595f15)[_0x5297('0x23')]();};}function respondWithResult(_0x3cfdb4,_0x4e7f36){_0x4e7f36=_0x4e7f36||0xc8;return function(_0x31e6e9){if(_0x31e6e9){return _0x3cfdb4[_0x5297('0x22')](_0x4e7f36)[_0x5297('0x24')](_0x31e6e9);}};}function respondWithFilteredResult(_0x202e34,_0x2055bb){return function(_0x47c2b7){if(_0x47c2b7){var _0x4371de=typeof _0x2055bb['offset']==='undefined'&&typeof _0x2055bb['limit']===_0x5297('0x25');var _0x271af4=_0x47c2b7[_0x5297('0x26')];var _0x14f389=_0x4371de?0x0:_0x2055bb[_0x5297('0x27')];var _0x4ba8f9=_0x4371de?_0x47c2b7['count']:_0x2055bb[_0x5297('0x27')]+_0x2055bb[_0x5297('0x28')];var _0x3c1ab0;if(_0x4ba8f9>=_0x271af4){_0x4ba8f9=_0x271af4;_0x3c1ab0=0xc8;}else{_0x3c1ab0=0xce;}_0x202e34[_0x5297('0x22')](_0x3c1ab0);return _0x202e34[_0x5297('0x29')]('Content-Range',_0x14f389+'-'+_0x4ba8f9+'/'+_0x271af4)[_0x5297('0x24')](_0x47c2b7);}return null;};}function saveUpdates(_0x41760d){return function(_0x45982d){if(_0x45982d){return _0x45982d[_0x5297('0x2a')](_0x41760d)[_0x5297('0x15')](function(_0x5d9025){return _0x5d9025;});}return null;};}function removeEntity(_0x397b33){return function(_0x1afbe9){if(_0x1afbe9){return _0x1afbe9[_0x5297('0x2b')]()[_0x5297('0x15')](function(){_0x397b33['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x225ec4){return function(_0x4efe9c){if(!_0x4efe9c){_0x225ec4[_0x5297('0x21')](0x194);}return _0x4efe9c;};}function handleError(_0x5c2d16,_0x478619){_0x478619=_0x478619||0x1f4;return function(_0x4d909f){logger[_0x5297('0x1c')](_0x4d909f[_0x5297('0x2c')]);if(_0x4d909f['name']){delete _0x4d909f[_0x5297('0x2d')];}_0x5c2d16['status'](_0x478619)[_0x5297('0x2e')](_0x4d909f);};}function getMustacheRender(_0x54616c,_0x4f420a){return Mustache[_0x5297('0x2f')](_0x54616c,_['merge'](_0x4f420a['body'],{'contact':_0x4f420a[_0x5297('0x30')],'message':_0x4f420a[_0x5297('0x1e')],'agent':_0x4f420a[_0x5297('0x31')],'interaction':_0x4f420a[_0x5297('0x32')],'account':_0x4f420a[_0x5297('0x33')]}))||'';}exports['index']=function(_0x1d065b,_0x5a3683){var _0x30dbca={};var _0x3bda6e=_['map'](db[_0x5297('0x34')][_0x5297('0x35')],function(_0x3f285c){return{'name':_0x3f285c['fieldName'],'type':_0x3f285c['type'][_0x5297('0x36')]};});_0x30dbca=qs[_0x5297('0x37')](_0x3bda6e,_0x1d065b);return interaction[_0x5297('0x38')]('chat',_0x1d065b['query'],_0x1d065b[_0x5297('0x39')],_0x30dbca,_0x3bda6e)[_0x5297('0x15')](respondWithFilteredResult(_0x5a3683,_0x30dbca))[_0x5297('0x20')](handleError(_0x5a3683,null));};exports['show']=function(_0x350f31,_0x14d5d8){var _0x3ade06={'raw':![],'where':{'id':_0x350f31[_0x5297('0x3a')]['id']}},_0x12afce={};_0x12afce[_0x5297('0x3b')]=_[_0x5297('0x3c')](db[_0x5297('0x34')][_0x5297('0x35')]);_0x12afce[_0x5297('0x3d')]=_[_0x5297('0x3c')](_0x350f31[_0x5297('0x3d')]);_0x12afce[_0x5297('0x3e')]=_[_0x5297('0x3f')](_0x12afce['model'],_0x12afce[_0x5297('0x3d')]);_0x3ade06[_0x5297('0x40')]=_[_0x5297('0x3f')](_0x12afce['model'],qs[_0x5297('0x41')](_0x350f31[_0x5297('0x3d')][_0x5297('0x41')]));_0x3ade06['attributes']=_0x3ade06[_0x5297('0x40')][_0x5297('0x42')]?_0x3ade06['attributes']:_0x12afce['model'];if(_0x350f31['query'][_0x5297('0x43')]){_0x3ade06[_0x5297('0x44')]=[{'all':!![]}];}_0x3ade06=_[_0x5297('0x45')]({},_0x3ade06,_0x350f31['options']);return db[_0x5297('0x34')][_0x5297('0x46')](_0x3ade06)[_0x5297('0x15')](handleEntityNotFound(_0x14d5d8,null))[_0x5297('0x15')](respondWithResult(_0x14d5d8,null))[_0x5297('0x20')](handleError(_0x14d5d8,null));};exports[_0x5297('0x47')]=function(_0x358abb,_0x471f9e){return db[_0x5297('0x34')][_0x5297('0x47')](_0x358abb[_0x5297('0x48')],{})[_0x5297('0x15')](respondWithResult(_0x471f9e,0xc9))['catch'](handleError(_0x471f9e,null));};exports['update']=function(_0x3b035b,_0x1f310a){if(_0x3b035b['body']['id']){delete _0x3b035b[_0x5297('0x48')]['id'];}return db['ChatInteraction'][_0x5297('0x46')]({'where':{'id':_0x3b035b[_0x5297('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1f310a,null))[_0x5297('0x15')](saveUpdates(_0x3b035b[_0x5297('0x48')],null))[_0x5297('0x15')](respondWithResult(_0x1f310a,null))[_0x5297('0x20')](handleError(_0x1f310a,null));};exports[_0x5297('0x2b')]=function(_0xffeae,_0x31abe8){return db[_0x5297('0x34')]['find']({'where':{'id':_0xffeae[_0x5297('0x3a')]['id']}})[_0x5297('0x15')](handleEntityNotFound(_0x31abe8,null))['then'](removeEntity(_0x31abe8,null))[_0x5297('0x20')](handleError(_0x31abe8,null));};exports['describe']=function(_0x50e8c7,_0x384052){return db[_0x5297('0x34')][_0x5297('0x49')]()['then'](respondWithResult(_0x384052,null))[_0x5297('0x20')](handleError(_0x384052,null));};exports['createVidaooSession']=function(_0x4f8023,_0x314d8a){var _0x8caaae=_0x4f8023[_0x5297('0x3a')]['id'];var _0x45b167;var _0x350345;var _0xebbcaf;return db[_0x5297('0x34')][_0x5297('0x4a')]({'where':{'id':_0x8caaae}})['then'](function(_0x16ee6b){_0x45b167=_0x16ee6b;return db[_0x5297('0x4b')][_0x5297('0x4a')]({'where':{'id':_0x16ee6b['ChatWebsiteId']},'attributes':['id',_0x5297('0x4c'),'vidaooEscalation',_0x5297('0x4d'),_0x5297('0x4e'),_0x5297('0x4f')],'raw':!![]});})[_0x5297('0x15')](function(_0x255cb8){if(_0x255cb8&&_0x255cb8[_0x5297('0x4c')]&&_0x255cb8[_0x5297('0x50')]){_0x350345=_0x255cb8;var _0x3b4814={'interaction':{'id':_0x8caaae},'agent':{'id':_0x4f8023[_0x5297('0x39')]['id'],'name':_0x4f8023[_0x5297('0x39')]['name'],'fullname':_0x4f8023[_0x5297('0x39')][_0x5297('0x51')],'email':_0x4f8023[_0x5297('0x39')][_0x5297('0x52')]},'contact':_0x4f8023[_0x5297('0x48')][_0x5297('0x30')],'account':_0x4f8023['body'][_0x5297('0x33')]};var _0x220dd2={'rejectUnauthorized':![],'method':_0x5297('0x53'),'url':_0x5297('0x54'),'headers':{'X-APIKEY':_0x255cb8[_0x5297('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4f8023[_0x5297('0x39')][_0x5297('0x52')]],'buttons':null,'topic':_0x350345[_0x5297('0x4d')],'note':_['isNull'](_0x350345[_0x5297('0x4e')])?null:getMustacheRender(_0x350345[_0x5297('0x4e')],_0x3b4814),'metadata':null},'redirect':_0x5297('0x55'),'json':!![]};try{if(!_[_0x5297('0x56')](_0x350345['vidaooMetadata'])){var _0xe9e1d2=getMustacheRender(_0x350345[_0x5297('0x4f')],_0x3b4814);var _0x25f0a3=JSON[_0x5297('0x57')](_0xe9e1d2);_0x220dd2[_0x5297('0x48')][_0x5297('0x58')]=_0x25f0a3;}}catch(_0x49da91){throw new db[(_0x5297('0x59'))][(_0x5297('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x220dd2);}else{throw new db[(_0x5297('0x59'))][(_0x5297('0x5a'))](_0x5297('0x5b'));}})[_0x5297('0x15')](function(_0x353d5d){_0xebbcaf=_0x353d5d;if(_0xebbcaf['id']){var _0x2607b5={'body':_0xebbcaf['join_url'],'ChatWebsiteId':_0x350345['id'],'ChatInteractionId':_0x45b167['id'],'direction':_0x5297('0x5c'),'UserId':_0x4f8023[_0x5297('0x39')]['id']};return db[_0x5297('0x5d')][_0x5297('0x47')](_0x2607b5,{});}else{throw new db[(_0x5297('0x59'))][(_0x5297('0x5a'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x5297('0x15')](function(){return _0x45b167[_0x5297('0x5e')]({'vidaooSessionId':_0xebbcaf['id']});})['then'](respondWithResult(_0x314d8a,null))['catch'](handleError(_0x314d8a,null));};exports[_0x5297('0x5f')]=function(_0x30deb8,_0x52726f){if(_0x30deb8[_0x5297('0x48')]['id']){delete _0x30deb8[_0x5297('0x48')]['id'];}return db[_0x5297('0x34')][_0x5297('0x46')]({'where':{'id':_0x30deb8[_0x5297('0x3a')]['id']},'include':[{'model':db[_0x5297('0x60')],'as':_0x5297('0x61')}]})[_0x5297('0x15')](handleEntityNotFound(_0x52726f,null))[_0x5297('0x15')](saveUpdates(_0x30deb8[_0x5297('0x48')],null))['then'](respondWithResult(_0x52726f,null))[_0x5297('0x20')](handleError(_0x52726f,null));};exports['abandon']=function(_0x331cfd,_0x180e5e){if(_0x331cfd[_0x5297('0x48')]['id']){delete _0x331cfd['body']['id'];}return db[_0x5297('0x34')]['find']({'where':{'id':_0x331cfd[_0x5297('0x3a')]['id']}})[_0x5297('0x15')](function(_0x2fb6f9){if(!_0x2fb6f9){logger['error'](_0x5297('0x62'),_0x5297('0x63'),0x194,_0x5297('0x64'));_0x180e5e['sendStatus'](0x194);}else{if(_0x2fb6f9[_0x5297('0x65')]){throw new db[(_0x5297('0x59'))][(_0x5297('0x5a'))](_0x5297('0x66'));}}return _0x2fb6f9;})[_0x5297('0x15')](function(_0x38c403){if(_0x38c403){return _0x38c403[_0x5297('0x2a')]({'closed':_0x331cfd[_0x5297('0x48')]['closed'],'disposition':_0x331cfd['body'][_0x5297('0x67')]})[_0x5297('0x15')](function(_0x236995){return _0x236995;});}})[_0x5297('0x15')](function(){return respondWithRpcPromise(_0x5297('0x68'),_0x5297('0x63'),_0x331cfd['body'],client9004);})[_0x5297('0x15')](respondWithResult(_0x180e5e,null))[_0x5297('0x20')](handleError(_0x180e5e,null));};exports[_0x5297('0x69')]=function(_0x368efa,_0x3e2283){_0x368efa[_0x5297('0x48')][_0x5297('0x2d')]=_0x368efa[_0x5297('0x6a')][_0x5297('0x6b')];_0x368efa[_0x5297('0x48')]['basename']=_0x368efa['file']['filename'];_0x368efa[_0x5297('0x48')][_0x5297('0x6c')]=_0x368efa[_0x5297('0x6a')][_0x5297('0x6d')];return db['Attachment'][_0x5297('0x47')](_0x368efa[_0x5297('0x48')])[_0x5297('0x15')](respondWithResult(_0x3e2283,0xc9))['catch'](handleError(_0x3e2283,null));};exports[_0x5297('0x6e')]=function(_0x3edc6e,_0x15c0ad){return db[_0x5297('0x34')][_0x5297('0x4a')]({'where':{'id':_0x3edc6e[_0x5297('0x3a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x15c0ad,null))[_0x5297('0x15')](function(_0xbfa74){if(_0xbfa74){if(_0xbfa74[_0x5297('0x6f')]){return _0x15c0ad[_0x5297('0x22')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x5297('0x70')]['findOne']({'where':{'id':_0x3edc6e['query'][_0x5297('0x71')]},'raw':!![]})[_0x5297('0x15')](handleEntityNotFound(_0x15c0ad,null));}})[_0x5297('0x15')](function(_0x38c9f3){if(_0x38c9f3){var _0x2c4c2b=_0x38c9f3[_0x5297('0x72')]!==null;var _0x1248be=path['join'](config['root'],_0x5297('0x73'));if(_0x2c4c2b){_0x1248be=path['join'](_0x1248be,_0x5297('0x74'));}var _0x45aa1a=path[_0x5297('0x75')](_0x1248be,_0x38c9f3[_0x5297('0x76')]);return _0x15c0ad[_0x5297('0x77')](_0x45aa1a);}})['catch'](handleError(_0x15c0ad,null));};exports[_0x5297('0x78')]=function(_0x2d9613,_0x4ca5cb){var _0x2016b6=null;var _0x196ede=null;var _0x14e5ca=null;if(_0x2d9613[_0x5297('0x48')]['id']){delete _0x2d9613[_0x5297('0x48')]['id'];}if(_0x2d9613[_0x5297('0x48')][_0x5297('0x79')]){_0x14e5ca=path['join'](config[_0x5297('0x7a')],'server/files/chat/upload/',util[_0x5297('0x7b')](_0x5297('0x7c'),Date[_0x5297('0x7d')]()));_0x2d9613[_0x5297('0x48')][_0x5297('0x7e')]=_0x14e5ca;}return db[_0x5297('0x34')]['find']({'where':{'id':_0x2d9613['params']['id']},'include':[{'model':db[_0x5297('0x5d')],'as':'Messages','include':[{'model':db[_0x5297('0x7f')],'as':_0x5297('0x7f')}]}]})[_0x5297('0x15')](handleEntityNotFound(_0x4ca5cb,null))[_0x5297('0x15')](saveUpdates(_0x2d9613[_0x5297('0x48')],null))[_0x5297('0x15')](function(_0x371b7b){if(_0x371b7b){_0x2016b6=_0x371b7b;return db[_0x5297('0x4b')][_0x5297('0x46')]({'where':{'id':_0x2016b6[_0x5297('0x80')]}});}})[_0x5297('0x15')](function(_0xe49aaa){if(_0xe49aaa){_0x196ede=_0xe49aaa;return db[_0x5297('0x60')][_0x5297('0x46')]({'where':{'id':_0x2016b6[_0x5297('0x81')]}});}})[_0x5297('0x15')](function(_0xeaa6a3){if(_0xeaa6a3){if(_0x14e5ca){var _0x8a9697=null;for(var _0x2d0512=0x1;_0x2d0512<_0x2016b6[_0x5297('0x82')][_0x5297('0x42')];++_0x2d0512){_0x8a9697=_0x2016b6['Messages'][_0x2d0512];var _0x2498cc=_0x8a9697[_0x5297('0x65')]?util[_0x5297('0x7b')]('%s%d',_0x196ede['agentAlias'],_0x8a9697[_0x5297('0x65')]):'System';var _0x3a28e4=_0x2d9613[_0x5297('0x48')]['customer']||util[_0x5297('0x7b')]('%s%d',_0x5297('0x83'),_0x8a9697['ContactId']);switch(_0x196ede['agentIdentifier']){case _0x5297('0x84'):_0x2498cc=_0x8a9697[_0x5297('0x65')]?util['format'](_0x5297('0x85'),_0x196ede[_0x5297('0x86')],_0x8a9697[_0x5297('0x65')]):_0x5297('0x87');break;case _0x5297('0x88'):_0x2498cc=_0x8a9697['UserId']?_0x8a9697['User'][_0x5297('0x89')]||_0x8a9697[_0x5297('0x7f')][_0x5297('0x51')]:_0x5297('0x87');break;case'agent_fullname':_0x2498cc=_0x8a9697[_0x5297('0x65')]?_0x8a9697[_0x5297('0x7f')]['fullname']:_0x5297('0x87');break;default:_0x2498cc=_0x8a9697['UserId']?util[_0x5297('0x7b')](_0x5297('0x85'),_0x196ede[_0x5297('0x86')],_0x8a9697[_0x5297('0x65')]):_0x5297('0x87');}var _0x782cb5=util[_0x5297('0x7b')](_0x5297('0x8a'),moment(_0x8a9697['createdAt'])['format'](_0x5297('0x8b')),_0x8a9697[_0x5297('0x8c')]==='in'?_0x3a28e4:_0x2498cc,_0x8a9697['body']);if(!_0x8a9697[_0x5297('0x8d')]){fs['appendFileSync'](_0x14e5ca,_0x782cb5);}}return db[_0x5297('0x8e')][_0x5297('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0x5297('0x8f')],'as':_0x5297('0x90'),'raw':!![],'include':[{'model':db[_0x5297('0x91')],'as':_0x5297('0x91'),'raw':!![]}]}]});}}})[_0x5297('0x15')](function(_0x133ebe){if(!_0x133ebe||!_0x133ebe[_0x5297('0x90')]||!_0x2d9613['body'])return _0x2016b6;var _0xd96f21=_0x133ebe[_0x5297('0x92')]();return respondWithRpcPromise('SendMail',_0x5297('0x93'),{'account':_0xd96f21,'message':{'from':util[_0x5297('0x7b')](_0x5297('0x94'),_0x133ebe[_0x5297('0x2d')],_0x133ebe[_0x5297('0x52')]||_0x133ebe[_0x5297('0x90')][_0x5297('0x39')]),'to':_0x2d9613['body'][_0x5297('0x79')],'subject':_0x5297('0x95'),'text':util[_0x5297('0x7b')](_0x5297('0x96'),_0x2d9613['body']['mailTranscript']),'attachments':[{'path':_0x14e5ca}]}})['then'](function(){return _0x2016b6;})[_0x5297('0x20')](function(_0x4dd7d1){logger[_0x5297('0x1c')](_0x4dd7d1);});})[_0x5297('0x15')](respondWithStatusCode(_0x4ca5cb,0xc8))[_0x5297('0x20')](handleError(_0x4ca5cb,null));};exports[_0x5297('0x97')]=function(_0x3d0fd4,_0xf41871){return db[_0x5297('0x5d')][_0x5297('0x46')]({'where':{'id':_0x3d0fd4[_0x5297('0x3a')]['id']}})[_0x5297('0x15')](handleEntityNotFound(_0xf41871,null))[_0x5297('0x15')](function(_0x5b056b){if(_0x5b056b){return _0x5b056b[_0x5297('0x97')](_0x3d0fd4['body']['ids'],_['omit'](_0x3d0fd4[_0x5297('0x48')],[_0x5297('0x98'),'id'])||{});}})[_0x5297('0x15')](respondWithResult(_0xf41871,null))[_0x5297('0x20')](handleError(_0xf41871,null));};exports[_0x5297('0x99')]=function(_0xffff2e,_0x245a2e){var _0x61664d={'raw':![],'where':{}};var _0x57a5ca={};var _0x182c19={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xffff2e[_0x5297('0x3a')]['id']}})['then'](handleEntityNotFound(_0x245a2e,null))[_0x5297('0x15')](function(_0x44fee3){if(_0x44fee3){_0x57a5ca['model']=_[_0x5297('0x3c')](db['ChatMessage']['rawAttributes']);_0x57a5ca[_0x5297('0x3d')]=_[_0x5297('0x3c')](_0xffff2e[_0x5297('0x3d')]);_0x57a5ca['filters']=_[_0x5297('0x3f')](_0x57a5ca[_0x5297('0x3b')],_0x57a5ca['query']);_0x61664d[_0x5297('0x40')]=_[_0x5297('0x3f')](_0x57a5ca['model'],qs[_0x5297('0x41')](_0xffff2e[_0x5297('0x3d')][_0x5297('0x41')]));_0x61664d[_0x5297('0x40')]=_0x61664d['attributes'][_0x5297('0x42')]?_0x61664d[_0x5297('0x40')]:_0x57a5ca[_0x5297('0x3b')];if(!_0xffff2e[_0x5297('0x3d')]['hasOwnProperty'](_0x5297('0x9a'))){_0x61664d[_0x5297('0x28')]=qs[_0x5297('0x28')](_0xffff2e['query'][_0x5297('0x28')]);_0x61664d[_0x5297('0x27')]=qs[_0x5297('0x27')](_0xffff2e[_0x5297('0x3d')][_0x5297('0x27')]);}_0x61664d[_0x5297('0x9b')]=qs[_0x5297('0x9c')](_0xffff2e['query'][_0x5297('0x9c')]);_0x61664d[_0x5297('0x9d')]=qs[_0x5297('0x3e')](_[_0x5297('0x9e')](_0xffff2e[_0x5297('0x3d')],_0x57a5ca[_0x5297('0x3e')]));_0x61664d['where'][_0x5297('0x9f')]=_0x44fee3['id'];if(_0xffff2e[_0x5297('0x3d')][_0x5297('0xa0')]){_0x61664d[_0x5297('0x9d')]=_['merge'](_0x61664d['where'],{'$or':_[_0x5297('0xa1')](_0x61664d[_0x5297('0x40')],function(_0x2af30e){var _0x4fff88={};_0x4fff88[_0x2af30e]={'$like':'%'+_0xffff2e[_0x5297('0x3d')][_0x5297('0xa0')]+'%'};return _0x4fff88;})});}if(_0xffff2e[_0x5297('0x3d')][_0x5297('0xa2')]){var _0x3c66cb=_0xffff2e[_0x5297('0x3d')][_0x5297('0xa2')]['split'](',');var _0x3e78cf={};_0x3e78cf[_0x3c66cb[0x0]]={'$gte':moment(_0x3c66cb[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x61664d['where']=_[_0x5297('0x45')](_0x61664d['where'],_0x3e78cf);}_0x61664d=_[_0x5297('0x45')]({},_0x61664d,_0xffff2e['options']);return db[_0x5297('0x5d')][_0x5297('0x26')]({'where':_0x61664d[_0x5297('0x9d')]})['then'](function(_0x58f608){_0x182c19[_0x5297('0x26')]=_0x58f608;if(_0xffff2e['query'][_0x5297('0x43')]){_0x61664d[_0x5297('0x44')]=[{'all':!![]}];}return db['ChatMessage'][_0x5297('0x38')](_0x61664d);})[_0x5297('0x15')](function(_0xedce0f){_0x182c19[_0x5297('0xa3')]=_0xedce0f;return _0x182c19;});}})[_0x5297('0x15')](respondWithFilteredResult(_0x245a2e,_0x61664d))['catch'](handleError(_0x245a2e,null));};exports['getMyMessages']=function(_0x347151,_0x37ee31){var _0x1f0199={'where':{}},_0x4087f5={},_0x46b322={'count':0x0,'rows':[]};return db[_0x5297('0x34')][_0x5297('0x4a')]({'where':{'id':_0x347151['params']['id']}})[_0x5297('0x15')](handleEntityNotFound(_0x37ee31,null))[_0x5297('0x15')](function(_0x2a7c30){if(_0x2a7c30){_0x4087f5[_0x5297('0x3b')]=_[_0x5297('0x3c')](db[_0x5297('0x5d')][_0x5297('0x35')]);_0x4087f5[_0x5297('0x3d')]=_[_0x5297('0x3c')](_0x347151[_0x5297('0x3d')]);_0x4087f5[_0x5297('0x3e')]=_[_0x5297('0x3f')](_0x4087f5[_0x5297('0x3b')],_0x4087f5[_0x5297('0x3d')]);_0x1f0199[_0x5297('0x40')]=_[_0x5297('0x3f')](_0x4087f5['model'],qs[_0x5297('0x41')](_0x347151[_0x5297('0x3d')]['fields']));_0x1f0199[_0x5297('0x40')]=_0x1f0199[_0x5297('0x40')][_0x5297('0x42')]?_0x1f0199[_0x5297('0x40')]:_0x4087f5[_0x5297('0x3b')];if(!_0x347151[_0x5297('0x3d')]['hasOwnProperty'](_0x5297('0x9a'))){_0x1f0199[_0x5297('0x28')]=qs[_0x5297('0x28')](_0x347151[_0x5297('0x3d')][_0x5297('0x28')]);_0x1f0199[_0x5297('0x27')]=qs[_0x5297('0x27')](_0x347151[_0x5297('0x3d')][_0x5297('0x27')]);}_0x1f0199[_0x5297('0x9b')]=qs['sort'](_0x347151['query'][_0x5297('0x9c')]);_0x1f0199[_0x5297('0x9d')]=qs[_0x5297('0x3e')](_['pick'](_0x347151['query'],_0x4087f5[_0x5297('0x3e')]));_0x1f0199[_0x5297('0x9d')][_0x5297('0x9f')]=_0x2a7c30['id'];if(_0x347151[_0x5297('0x3d')][_0x5297('0xa0')]){_0x1f0199[_0x5297('0x9d')]=_[_0x5297('0x45')](_0x1f0199[_0x5297('0x9d')],{'$or':_['map'](_0x1f0199[_0x5297('0x40')],function(_0xf432dd){var _0x3cbe80={};_0x3cbe80[_0xf432dd]={'$like':'%'+_0x347151[_0x5297('0x3d')][_0x5297('0xa0')]+'%'};return _0x3cbe80;})});}_0x1f0199[_0x5297('0x9d')][_0x5297('0x8d')]=![];if(_0x347151[_0x5297('0x3d')]['id']){_0x1f0199[_0x5297('0x9d')]['id']={'$gt':_0x347151[_0x5297('0x3d')]['id']};}_0x1f0199=_[_0x5297('0x45')]({},_0x1f0199,_0x347151[_0x5297('0xa4')]);return db[_0x5297('0x5d')][_0x5297('0x26')]({'where':_0x1f0199[_0x5297('0x9d')]})[_0x5297('0x15')](function(_0x1e7e83){_0x46b322[_0x5297('0x26')]=_0x1e7e83;_0x1f0199['include']=[];if(_0x347151[_0x5297('0x3d')][_0x5297('0xa5')]){_0x1f0199[_0x5297('0x44')][_0x5297('0xa6')]({'model':db[_0x5297('0x7f')],'as':_0x5297('0x7f'),'attributes':['id',_0x5297('0x51'),'alias']});}if(_0x347151['query'][_0x5297('0x43')]){_0x1f0199[_0x5297('0x44')]=[{'all':!![]}];}return db[_0x5297('0x5d')][_0x5297('0x38')](_0x1f0199);})[_0x5297('0x15')](function(_0x3ce509){_0x46b322[_0x5297('0xa3')]=_0x3ce509;return _0x46b322;});}})[_0x5297('0x15')](respondWithFilteredResult(_0x37ee31,_0x1f0199))[_0x5297('0x20')](handleError(_0x37ee31,null));};exports['addTags']=function(_0x57ee25,_0x562531){return db[_0x5297('0x34')][_0x5297('0x46')]({'where':{'id':_0x57ee25[_0x5297('0x3a')]['id']}})['then'](handleEntityNotFound(_0x562531,null))[_0x5297('0x15')](function(_0x1b9b96){if(_0x1b9b96){return _0x1b9b96['setTags'](_0x57ee25[_0x5297('0x48')][_0x5297('0x98')],_['omit'](_0x57ee25['body'],['ids','id'])||{})[_0x5297('0xa7')](function(){return db[_0x5297('0xa8')][_0x5297('0x38')]({'attributes':['id','name',_0x5297('0xa9')],'where':{'id':_0x57ee25[_0x5297('0x48')][_0x5297('0x98')]}});})[_0x5297('0x15')](function(_0x2bfea0){socket[_0x5297('0xaa')]('chatInteractionTags:save',{'id':Number(_0x57ee25[_0x5297('0x3a')]['id']),'tags':_0x2bfea0||[]});return{'id':Number(_0x57ee25[_0x5297('0x3a')]['id']),'tags':_0x2bfea0||[]};});}})[_0x5297('0x15')](respondWithResult(_0x562531,null))[_0x5297('0x20')](handleError(_0x562531,null));};exports['removeTags']=function(_0x1421d2,_0x3393aa){return db[_0x5297('0x34')][_0x5297('0x46')]({'where':{'id':_0x1421d2['params']['id']}})[_0x5297('0x15')](handleEntityNotFound(_0x3393aa,null))[_0x5297('0x15')](function(_0x390937){if(_0x390937){return _0x390937[_0x5297('0xab')](_0x1421d2[_0x5297('0x3d')][_0x5297('0x98')]);}})[_0x5297('0x15')](respondWithStatusCode(_0x3393aa,null))[_0x5297('0x20')](handleError(_0x3393aa,null));};exports[_0x5297('0x77')]=function(_0x495dd2,_0x400789){var _0x2831a7=moment()[_0x5297('0xac')]()[_0x5297('0xad')]();var _0x1e6f8c=path[_0x5297('0x75')](config['root'],'server',_0x5297('0xae'),_0x5297('0xaf'));var _0x57f3a3=path[_0x5297('0x75')](config['root'],_0x5297('0xb0'),_0x5297('0xae'),_0x5297('0xb1'));var _0x2d4b67=path[_0x5297('0x75')](_0x1e6f8c,_0x2831a7);var _0x51e432=util[_0x5297('0x7b')](_0x5297('0xb2'),_0x495dd2['params']['id'],_0x2831a7);var _0x53b64b=path[_0x5297('0x75')](_0x1e6f8c,_0x51e432);var _0x141c86=[];_0x141c86[_0x5297('0xa6')]({'model':db[_0x5297('0x7f')],'as':_0x5297('0x7f'),'attributes':['id',_0x5297('0x51')],'raw':!![]});_0x141c86[_0x5297('0xa6')]({'model':db['CmContact'],'as':_0x5297('0x61'),'attributes':['id','firstName',_0x5297('0xb3')],'raw':!![]});if(_0x495dd2[_0x5297('0x3d')][_0x5297('0xb1')]){_0x141c86['push']({'model':db[_0x5297('0x70')],'as':_0x5297('0x70'),'raw':!![]});}var _0x133ffa=[{'model':db['ChatMessage'],'as':_0x5297('0x82'),'attributes':['id','body','createdAt',_0x5297('0x8c'),_0x5297('0x8d'),_0x5297('0xb4')],'include':_0x141c86}];_0x133ffa[_0x5297('0xa6')]({'model':db[_0x5297('0x4b')],'as':_0x5297('0xb5'),'attributes':['id',_0x5297('0x2d')]});_0x133ffa[_0x5297('0xa6')]({'model':db[_0x5297('0x7f')],'as':_0x5297('0xb6'),'attributes':['id','fullname']});return db[_0x5297('0x34')][_0x5297('0x46')]({'where':{'id':_0x495dd2['params']['id']},'include':_0x133ffa})[_0x5297('0x15')](handleEntityNotFound(_0x400789,null))['then'](function(_0x378c8f){if(_0x378c8f){var _0x544b3e=_0x378c8f['get']({'plain':!![]});fs['mkdirSync'](_0x2d4b67);var _0xad150a={'channel':_0x5297('0xb7'),'account':_0x544b3e[_0x5297('0xb5')][_0x5297('0x2d')],'agent':_0x544b3e[_0x5297('0xb6')]?_0x544b3e[_0x5297('0xb6')][_0x5297('0x51')]:_0x5297('0xb8'),'createdAt':moment(_0x544b3e[_0x5297('0xb9')])[_0x5297('0x7b')](_0x5297('0xba'))[_0x5297('0xad')](),'closedAt':_0x544b3e[_0x5297('0x6f')]?moment(_0x544b3e[_0x5297('0xbb')])['format'](_0x5297('0xba'))['toString']():'','disposition':_0x544b3e[_0x5297('0x67')],'chatInfo':{'browser':_0x544b3e[_0x5297('0xbc')],'os':_0x544b3e['osName'],'referer':_0x544b3e[_0x5297('0xbd')],'customerIp':_0x544b3e[_0x5297('0xbe')],'customerPort':_0x544b3e[_0x5297('0xbf')]?_0x544b3e[_0x5297('0xbf')]:_0x5297('0xb8')},'messages':_(_0x544b3e[_0x5297('0x82')])[_0x5297('0xc0')]()[_0x5297('0xa0')]({'secret':![]})[_0x5297('0xa1')](function(_0xfb47ce){if(_0xfb47ce[_0x5297('0x70')]){var _0x485edb=path[_0x5297('0x75')](_0x57f3a3,_0xfb47ce[_0x5297('0x70')]['basename']);if(fs[_0x5297('0xc1')](_0x485edb)){fs[_0x5297('0xc2')](_0x485edb)[_0x5297('0xc3')](fs[_0x5297('0xc4')](path['join'](_0x2d4b67,_0xfb47ce[_0x5297('0x70')]['basename'])));}}return{'date':moment(_0xfb47ce['createdAt'])[_0x5297('0x7b')](_0x5297('0xba'))[_0x5297('0xad')](),'sender':_0xfb47ce[_0x5297('0x8c')]===_0x5297('0x5c')?_0xfb47ce[_0x5297('0x7f')]?_0xfb47ce[_0x5297('0x7f')]['fullname']:_0x5297('0x87'):_0xfb47ce[_0x5297('0x61')][_0x5297('0xc5')]+(_0xfb47ce['Contact'][_0x5297('0xb3')]?'\x20'+_0xfb47ce[_0x5297('0x61')]['lastName']:''),'body':_0xfb47ce[_0x5297('0x70')]?_0xfb47ce[_0x5297('0x70')][_0x5297('0x76')]:_0xfb47ce[_0x5297('0x48')],'direction':_0xfb47ce['direction']===_0x5297('0x5c')?'A':'C','secret':_0xfb47ce[_0x5297('0x8d')],'read':_0xfb47ce['read'],'attachment':_0xfb47ce['Attachment']};})[_0x5297('0xc6')]()};return ejs[_0x5297('0xc7')](path['join'](config[_0x5297('0x7a')],_0x5297('0xb0'),'views',_0x5297('0xc8')),{'interaction':_0xad150a})['then'](function(_0x555cf1){var _0x44f3e9=path['join'](_0x2d4b67,_0x5297('0xc9')+_0x544b3e['id']+'-'+_0x2831a7+_0x5297('0xca'));var _0x35572a={'path':_0x44f3e9,'channel':_0x5297('0xb7'),'interactionId':_0x544b3e['id']};return pdf['createPdfFromHTML'](_0x555cf1,_0x35572a);})[_0x5297('0x15')](function(){return new Promise(function(_0x3cc729,_0x482690){zipdir(_0x2d4b67,{'saveTo':_0x53b64b},function(_0x593859,_0x960586){if(_0x593859)return _0x482690(_0x593859);return _0x3cc729(_0x960586);});})['then'](function(){return new BPromise(function(_0x5108d3,_0x134928){rimraf(_0x2d4b67,function(_0x553e90){if(_0x553e90)_0x134928(_0x553e90);return _0x5108d3();});});})[_0x5297('0x15')](function(){return _0x400789[_0x5297('0x77')](_0x53b64b,_0x51e432,function(_0x16c9c8){if(_0x16c9c8){logger[_0x5297('0x1c')](_0x5297('0xcb'),_0x16c9c8);}else{fs[_0x5297('0xcc')](_0x53b64b);}});});});}else{return _0x400789['sendStatus'](0xc8);}})[_0x5297('0x20')](handleError(_0x400789,null));};
\ No newline at end of file
+var _0x22eb=['jayson/promise','client','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','limit','undefined','count','set','update','then','end','stack','render','body','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','query','user','catch','model','keys','filters','attributes','intersection','fields','includeAll','include','options','params','destroy','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','fullname','email','contact','isNull','vidaooNote','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','attachmentUpload','name','file','originalname','filename','attachmentDownload','closed','Attachment','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','length','%s%d','agentAlias','System','Visitor','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','nolimit','order','sort','where','pick','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','hasOwnProperty','ChatInteractionId','includeAgent','addTags','spread','Tag','findAll','color','emit','removeTags','server','files','attachments','transcript-%d-%s.zip','push','firstName','read','Account','Owner','mkdirSync','N.A.','toString','closedAt','osName','customerIp','customerPort','existsSync','createReadStream','createWriteStream','Contact','lastName','value','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register'];(function(_0x84fdd8,_0x187bac){var _0x59ab14=function(_0x31dfa2){while(--_0x31dfa2){_0x84fdd8['push'](_0x84fdd8['shift']());}};_0x59ab14(++_0x187bac);}(_0x22eb,0xb7));var _0xb22e=function(_0x3bc3b7,_0x4f12c7){_0x3bc3b7=_0x3bc3b7-0x0;var _0x4127d8=_0x22eb[_0x3bc3b7];return _0x4127d8;};'use strict';var rimraf=require(_0xb22e('0x0'));var zipdir=require(_0xb22e('0x1'));var rp=require(_0xb22e('0x2'));var moment=require('moment');var BPromise=require(_0xb22e('0x3'));var Mustache=require(_0xb22e('0x4'));var util=require(_0xb22e('0x5'));var path=require(_0xb22e('0x6'));var ejs=require(_0xb22e('0x7'));var fs=require('fs');var _=require(_0xb22e('0x8'));var Redis=require(_0xb22e('0x9'));var interaction=require(_0xb22e('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0xb22e('0xb'));var logger=require('../../config/logger')(_0xb22e('0xc'));var config=require(_0xb22e('0xd'));var db=require(_0xb22e('0xe'))['db'];config[_0xb22e('0xf')]=_['defaults'](config[_0xb22e('0xf')],{'host':_0xb22e('0x10'),'port':0x18eb});var socket=require(_0xb22e('0x11'))(new Redis(config[_0xb22e('0xf')]));require('./chatInteraction.socket')[_0xb22e('0x12')](socket);var jayson=require(_0xb22e('0x13'));var client=jayson[_0xb22e('0x14')][_0xb22e('0x15')]({'port':0x232b});var client9004=jayson[_0xb22e('0x14')][_0xb22e('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x4e1677,_0x3792ec,_0x233be5,_0x120590){return new BPromise(function(_0x9d04ae,_0x2a3c3b){var _0x2a4d4b=_0x120590||client;return _0x2a4d4b[_0xb22e('0x16')](_0x4e1677,_0x233be5)['then'](function(_0x33e426){logger[_0xb22e('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x3792ec,_0xb22e('0x18'));logger[_0xb22e('0x19')](_0xb22e('0x1a'),_0x3792ec,'request\x20sent',JSON['stringify'](_0x33e426));if(_0x33e426[_0xb22e('0x1b')]){if(_0x33e426[_0xb22e('0x1b')][_0xb22e('0x1c')]===0x1f4){logger[_0xb22e('0x1b')](_0xb22e('0x1d'),_0x3792ec,_0x33e426[_0xb22e('0x1b')][_0xb22e('0x1e')]);return _0x2a3c3b(_0x33e426[_0xb22e('0x1b')][_0xb22e('0x1e')]);}logger[_0xb22e('0x1b')](_0xb22e('0x1d'),_0x3792ec,_0x33e426[_0xb22e('0x1b')]['message']);return _0x9d04ae(_0x33e426['error']['message']);}else{logger[_0xb22e('0x17')](_0xb22e('0x1d'),_0x3792ec,_0xb22e('0x18'));_0x9d04ae(_0x33e426[_0xb22e('0x1f')][_0xb22e('0x1e')]);}})['catch'](function(_0x3617ab){logger[_0xb22e('0x1b')](_0xb22e('0x1d'),_0x3792ec,_0x3617ab);_0x2a3c3b(_0x3617ab);});});}function respondWithStatusCode(_0x3b6ac0,_0x2b3b5e){_0x2b3b5e=_0x2b3b5e||0xcc;return function(_0xe5244a){if(_0xe5244a){return _0x3b6ac0[_0xb22e('0x20')](_0x2b3b5e);}return _0x3b6ac0[_0xb22e('0x21')](_0x2b3b5e)['end']();};}function respondWithResult(_0x30e7be,_0x46cd37){_0x46cd37=_0x46cd37||0xc8;return function(_0x3e9d1e){if(_0x3e9d1e){return _0x30e7be['status'](_0x46cd37)[_0xb22e('0x22')](_0x3e9d1e);}};}function respondWithFilteredResult(_0x46e80b,_0x4fd053){return function(_0xca303f){if(_0xca303f){var _0x2acf40=typeof _0x4fd053[_0xb22e('0x23')]==='undefined'&&typeof _0x4fd053[_0xb22e('0x24')]===_0xb22e('0x25');var _0xaa8894=_0xca303f[_0xb22e('0x26')];var _0x4f7a93=_0x2acf40?0x0:_0x4fd053[_0xb22e('0x23')];var _0x4e67c3=_0x2acf40?_0xca303f[_0xb22e('0x26')]:_0x4fd053[_0xb22e('0x23')]+_0x4fd053[_0xb22e('0x24')];var _0x1fb61;if(_0x4e67c3>=_0xaa8894){_0x4e67c3=_0xaa8894;_0x1fb61=0xc8;}else{_0x1fb61=0xce;}_0x46e80b[_0xb22e('0x21')](_0x1fb61);return _0x46e80b[_0xb22e('0x27')]('Content-Range',_0x4f7a93+'-'+_0x4e67c3+'/'+_0xaa8894)[_0xb22e('0x22')](_0xca303f);}return null;};}function saveUpdates(_0x4074fe){return function(_0x1dbcec){if(_0x1dbcec){return _0x1dbcec[_0xb22e('0x28')](_0x4074fe)[_0xb22e('0x29')](function(_0x454342){return _0x454342;});}return null;};}function removeEntity(_0x52b853){return function(_0x2c1061){if(_0x2c1061){return _0x2c1061['destroy']()['then'](function(){_0x52b853[_0xb22e('0x21')](0xcc)[_0xb22e('0x2a')]();});}};}function handleEntityNotFound(_0x5080de){return function(_0x1aa966){if(!_0x1aa966){_0x5080de[_0xb22e('0x20')](0x194);}return _0x1aa966;};}function handleError(_0x4a86da,_0x28b083){_0x28b083=_0x28b083||0x1f4;return function(_0x449319){logger[_0xb22e('0x1b')](_0x449319[_0xb22e('0x2b')]);if(_0x449319['name']){delete _0x449319['name'];}_0x4a86da['status'](_0x28b083)['send'](_0x449319);};}function getMustacheRender(_0x59ccb7,_0x31a273){return Mustache[_0xb22e('0x2c')](_0x59ccb7,_['merge'](_0x31a273[_0xb22e('0x2d')],{'contact':_0x31a273['contact'],'message':_0x31a273[_0xb22e('0x1e')],'agent':_0x31a273[_0xb22e('0x2e')],'interaction':_0x31a273[_0xb22e('0x2f')],'account':_0x31a273['account']}))||'';}exports[_0xb22e('0x30')]=function(_0x32e583,_0x2fefdb){var _0x4d6774={};var _0x1310bf=_[_0xb22e('0x31')](db[_0xb22e('0x32')][_0xb22e('0x33')],function(_0xe321f5){return{'name':_0xe321f5[_0xb22e('0x34')],'type':_0xe321f5[_0xb22e('0x35')][_0xb22e('0x36')]};});_0x4d6774=qs['getOptions'](_0x1310bf,_0x32e583);return interaction['findAll']('chat',_0x32e583[_0xb22e('0x37')],_0x32e583[_0xb22e('0x38')],_0x4d6774,_0x1310bf)['then'](respondWithFilteredResult(_0x2fefdb,_0x4d6774))[_0xb22e('0x39')](handleError(_0x2fefdb,null));};exports['show']=function(_0x48a8f7,_0x510276){var _0x142645={'raw':![],'where':{'id':_0x48a8f7['params']['id']}},_0x1b7c55={};_0x1b7c55[_0xb22e('0x3a')]=_[_0xb22e('0x3b')](db[_0xb22e('0x32')]['rawAttributes']);_0x1b7c55[_0xb22e('0x37')]=_[_0xb22e('0x3b')](_0x48a8f7[_0xb22e('0x37')]);_0x1b7c55[_0xb22e('0x3c')]=_['intersection'](_0x1b7c55[_0xb22e('0x3a')],_0x1b7c55[_0xb22e('0x37')]);_0x142645[_0xb22e('0x3d')]=_[_0xb22e('0x3e')](_0x1b7c55['model'],qs[_0xb22e('0x3f')](_0x48a8f7[_0xb22e('0x37')][_0xb22e('0x3f')]));_0x142645[_0xb22e('0x3d')]=_0x142645['attributes']['length']?_0x142645[_0xb22e('0x3d')]:_0x1b7c55[_0xb22e('0x3a')];if(_0x48a8f7[_0xb22e('0x37')][_0xb22e('0x40')]){_0x142645[_0xb22e('0x41')]=[{'all':!![]}];}_0x142645=_['merge']({},_0x142645,_0x48a8f7[_0xb22e('0x42')]);return db[_0xb22e('0x32')]['find'](_0x142645)[_0xb22e('0x29')](handleEntityNotFound(_0x510276,null))[_0xb22e('0x29')](respondWithResult(_0x510276,null))[_0xb22e('0x39')](handleError(_0x510276,null));};exports['create']=function(_0x22cea7,_0x44f8ad){return db['ChatInteraction']['create'](_0x22cea7[_0xb22e('0x2d')],{})[_0xb22e('0x29')](respondWithResult(_0x44f8ad,0xc9))[_0xb22e('0x39')](handleError(_0x44f8ad,null));};exports['update']=function(_0x4bb9d2,_0x17da81){if(_0x4bb9d2[_0xb22e('0x2d')]['id']){delete _0x4bb9d2[_0xb22e('0x2d')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x4bb9d2[_0xb22e('0x43')]['id']}})[_0xb22e('0x29')](handleEntityNotFound(_0x17da81,null))['then'](saveUpdates(_0x4bb9d2[_0xb22e('0x2d')],null))[_0xb22e('0x29')](respondWithResult(_0x17da81,null))[_0xb22e('0x39')](handleError(_0x17da81,null));};exports[_0xb22e('0x44')]=function(_0x642d12,_0x14a292){return db['ChatInteraction'][_0xb22e('0x45')]({'where':{'id':_0x642d12[_0xb22e('0x43')]['id']}})['then'](handleEntityNotFound(_0x14a292,null))['then'](removeEntity(_0x14a292,null))[_0xb22e('0x39')](handleError(_0x14a292,null));};exports[_0xb22e('0x46')]=function(_0x45115c,_0x48b4a8){return db[_0xb22e('0x32')][_0xb22e('0x46')]()[_0xb22e('0x29')](respondWithResult(_0x48b4a8,null))[_0xb22e('0x39')](handleError(_0x48b4a8,null));};exports[_0xb22e('0x47')]=function(_0x34a77d,_0x597802){var _0xf4fcf2=_0x34a77d['params']['id'];var _0x3f7d3b;var _0x16d751;var _0x523fab;return db[_0xb22e('0x32')][_0xb22e('0x48')]({'where':{'id':_0xf4fcf2}})[_0xb22e('0x29')](function(_0x254c0d){_0x3f7d3b=_0x254c0d;return db[_0xb22e('0x49')][_0xb22e('0x48')]({'where':{'id':_0x254c0d[_0xb22e('0x4a')]},'attributes':['id',_0xb22e('0x4b'),'vidaooEscalation',_0xb22e('0x4c'),'vidaooNote',_0xb22e('0x4d')],'raw':!![]});})[_0xb22e('0x29')](function(_0x2b5cf7){if(_0x2b5cf7&&_0x2b5cf7['vidaooApiKey']&&_0x2b5cf7[_0xb22e('0x4e')]){_0x16d751=_0x2b5cf7;var _0x5415ab={'interaction':{'id':_0xf4fcf2},'agent':{'id':_0x34a77d[_0xb22e('0x38')]['id'],'name':_0x34a77d['user']['name'],'fullname':_0x34a77d[_0xb22e('0x38')][_0xb22e('0x4f')],'email':_0x34a77d[_0xb22e('0x38')][_0xb22e('0x50')]},'contact':_0x34a77d['body'][_0xb22e('0x51')],'account':_0x34a77d[_0xb22e('0x2d')]['account']};var _0x12f19c={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2b5cf7['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x34a77d[_0xb22e('0x38')]['email']],'buttons':null,'topic':_0x16d751[_0xb22e('0x4c')],'note':_[_0xb22e('0x52')](_0x16d751[_0xb22e('0x53')])?null:getMustacheRender(_0x16d751[_0xb22e('0x53')],_0x5415ab),'metadata':null},'redirect':_0xb22e('0x54'),'json':!![]};try{if(!_[_0xb22e('0x52')](_0x16d751[_0xb22e('0x4d')])){var _0x8ca2a7=getMustacheRender(_0x16d751[_0xb22e('0x4d')],_0x5415ab);var _0x5c3dba=JSON[_0xb22e('0x55')](_0x8ca2a7);_0x12f19c['body'][_0xb22e('0x56')]=_0x5c3dba;}}catch(_0x1988b6){throw new db[(_0xb22e('0x57'))][(_0xb22e('0x58'))](_0xb22e('0x59'));}return rp(_0x12f19c);}else{throw new db[(_0xb22e('0x57'))][(_0xb22e('0x58'))](_0xb22e('0x5a'));}})[_0xb22e('0x29')](function(_0x3ae25e){_0x523fab=_0x3ae25e;if(_0x523fab['id']){var _0x237e7a={'body':_0x523fab[_0xb22e('0x5b')],'ChatWebsiteId':_0x16d751['id'],'ChatInteractionId':_0x3f7d3b['id'],'direction':_0xb22e('0x5c'),'UserId':_0x34a77d[_0xb22e('0x38')]['id']};return db[_0xb22e('0x5d')][_0xb22e('0x5e')](_0x237e7a,{});}else{throw new db[(_0xb22e('0x57'))]['ValidationError'](_0xb22e('0x5f'));}})[_0xb22e('0x29')](function(){return _0x3f7d3b[_0xb22e('0x60')]({'vidaooSessionId':_0x523fab['id']});})[_0xb22e('0x29')](respondWithResult(_0x597802,null))[_0xb22e('0x39')](handleError(_0x597802,null));};exports[_0xb22e('0x61')]=function(_0x1479f0,_0x124810){if(_0x1479f0[_0xb22e('0x2d')]['id']){delete _0x1479f0['body']['id'];}return db[_0xb22e('0x32')][_0xb22e('0x45')]({'where':{'id':_0x1479f0[_0xb22e('0x43')]['id']},'include':[{'model':db[_0xb22e('0x62')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x124810,null))[_0xb22e('0x29')](saveUpdates(_0x1479f0[_0xb22e('0x2d')],null))[_0xb22e('0x29')](respondWithResult(_0x124810,null))[_0xb22e('0x39')](handleError(_0x124810,null));};exports[_0xb22e('0x63')]=function(_0x66d54c,_0x238c16){if(_0x66d54c[_0xb22e('0x2d')]['id']){delete _0x66d54c[_0xb22e('0x2d')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x66d54c['params']['id']}})[_0xb22e('0x29')](function(_0xc889f2){if(!_0xc889f2){logger[_0xb22e('0x1b')](_0xb22e('0x64'),'abandon',0x194,_0xb22e('0x65'));_0x238c16[_0xb22e('0x20')](0x194);}else{if(_0xc889f2[_0xb22e('0x66')]){throw new db[(_0xb22e('0x57'))][(_0xb22e('0x58'))](_0xb22e('0x67'));}}return _0xc889f2;})['then'](function(_0x51abaf){if(_0x51abaf){return _0x51abaf[_0xb22e('0x28')]({'closed':_0x66d54c[_0xb22e('0x2d')]['closed'],'disposition':_0x66d54c[_0xb22e('0x2d')]['disposition']})[_0xb22e('0x29')](function(_0x1d9606){return _0x1d9606;});}})[_0xb22e('0x29')](function(){return respondWithRpcPromise('AbandonInteraction',_0xb22e('0x63'),_0x66d54c[_0xb22e('0x2d')],client9004);})[_0xb22e('0x29')](respondWithResult(_0x238c16,null))[_0xb22e('0x39')](handleError(_0x238c16,null));};exports[_0xb22e('0x68')]=function(_0x1a105b,_0x175c13){_0x1a105b[_0xb22e('0x2d')][_0xb22e('0x69')]=_0x1a105b[_0xb22e('0x6a')][_0xb22e('0x6b')];_0x1a105b[_0xb22e('0x2d')]['basename']=_0x1a105b['file'][_0xb22e('0x6c')];_0x1a105b['body'][_0xb22e('0x35')]=_0x1a105b[_0xb22e('0x6a')]['mimetype'];return db['Attachment'][_0xb22e('0x5e')](_0x1a105b['body'])[_0xb22e('0x29')](respondWithResult(_0x175c13,0xc9))[_0xb22e('0x39')](handleError(_0x175c13,null));};exports[_0xb22e('0x6d')]=function(_0x34d8bf,_0x250e8a){return db[_0xb22e('0x32')][_0xb22e('0x48')]({'where':{'id':_0x34d8bf[_0xb22e('0x43')]['id']},'raw':!![]})[_0xb22e('0x29')](handleEntityNotFound(_0x250e8a,null))[_0xb22e('0x29')](function(_0x9b6b8a){if(_0x9b6b8a){if(_0x9b6b8a[_0xb22e('0x6e')]){return _0x250e8a[_0xb22e('0x21')](0x193)[_0xb22e('0x22')]({'status':0x193,'message':'Unauthorized'});}return db[_0xb22e('0x6f')][_0xb22e('0x48')]({'where':{'id':_0x34d8bf['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x250e8a,null));}})['then'](function(_0xf2e878){if(_0xf2e878){var _0x5928de=_0xf2e878[_0xb22e('0x70')]!==null;var _0x575db4=path[_0xb22e('0x71')](config[_0xb22e('0x72')],_0xb22e('0x73'));if(_0x5928de){_0x575db4=path[_0xb22e('0x71')](_0x575db4,_0xb22e('0x74'));}var _0x578769=path[_0xb22e('0x71')](_0x575db4,_0xf2e878[_0xb22e('0x75')]);return _0x250e8a[_0xb22e('0x76')](_0x578769);}})[_0xb22e('0x39')](handleError(_0x250e8a,null));};exports[_0xb22e('0x77')]=function(_0x1216b8,_0x52c365){var _0x184ba3=null;var _0xc281af=null;var _0x568015=null;if(_0x1216b8[_0xb22e('0x2d')]['id']){delete _0x1216b8['body']['id'];}if(_0x1216b8[_0xb22e('0x2d')]['mailTranscript']){_0x568015=path[_0xb22e('0x71')](config[_0xb22e('0x72')],'server/files/chat/upload/',util[_0xb22e('0x78')](_0xb22e('0x79'),Date[_0xb22e('0x7a')]()));_0x1216b8[_0xb22e('0x2d')][_0xb22e('0x7b')]=_0x568015;}return db['ChatInteraction']['find']({'where':{'id':_0x1216b8[_0xb22e('0x43')]['id']},'include':[{'model':db[_0xb22e('0x5d')],'as':'Messages','include':[{'model':db[_0xb22e('0x7c')],'as':'User'}]}]})[_0xb22e('0x29')](handleEntityNotFound(_0x52c365,null))[_0xb22e('0x29')](saveUpdates(_0x1216b8[_0xb22e('0x2d')],null))[_0xb22e('0x29')](function(_0x2e3c8b){if(_0x2e3c8b){_0x184ba3=_0x2e3c8b;return db[_0xb22e('0x49')][_0xb22e('0x45')]({'where':{'id':_0x184ba3['ChatWebsiteId']}});}})[_0xb22e('0x29')](function(_0x589c67){if(_0x589c67){_0xc281af=_0x589c67;return db[_0xb22e('0x62')]['find']({'where':{'id':_0x184ba3[_0xb22e('0x7d')]}});}})[_0xb22e('0x29')](function(_0x2fd219){if(_0x2fd219){if(_0x568015){var _0x549916=null;for(var _0x2c77ad=0x1;_0x2c77ad<_0x184ba3[_0xb22e('0x7e')][_0xb22e('0x7f')];++_0x2c77ad){_0x549916=_0x184ba3['Messages'][_0x2c77ad];var _0x4cd9d1=_0x549916['UserId']?util[_0xb22e('0x78')](_0xb22e('0x80'),_0xc281af[_0xb22e('0x81')],_0x549916['UserId']):_0xb22e('0x82');var _0x313151=_0x1216b8[_0xb22e('0x2d')]['customer']||util[_0xb22e('0x78')](_0xb22e('0x80'),_0xb22e('0x83'),_0x549916[_0xb22e('0x7d')]);switch(_0xc281af['agentIdentifier']){case _0xb22e('0x84'):_0x4cd9d1=_0x549916[_0xb22e('0x66')]?util[_0xb22e('0x78')](_0xb22e('0x80'),_0xc281af[_0xb22e('0x81')],_0x549916['UserId']):'System';break;case _0xb22e('0x85'):_0x4cd9d1=_0x549916[_0xb22e('0x66')]?_0x549916[_0xb22e('0x7c')][_0xb22e('0x86')]||_0x549916['User'][_0xb22e('0x4f')]:'System';break;case'agent_fullname':_0x4cd9d1=_0x549916['UserId']?_0x549916[_0xb22e('0x7c')]['fullname']:_0xb22e('0x82');break;default:_0x4cd9d1=_0x549916[_0xb22e('0x66')]?util[_0xb22e('0x78')](_0xb22e('0x80'),_0xc281af['agentAlias'],_0x549916[_0xb22e('0x66')]):_0xb22e('0x82');}var _0x457def=util[_0xb22e('0x78')](_0xb22e('0x87'),moment(_0x549916[_0xb22e('0x88')])['format'](_0xb22e('0x89')),_0x549916[_0xb22e('0x8a')]==='in'?_0x313151:_0x4cd9d1,_0x549916['body']);if(!_0x549916[_0xb22e('0x8b')]){fs[_0xb22e('0x8c')](_0x568015,_0x457def);}}return db[_0xb22e('0x8d')][_0xb22e('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0xb22e('0x8e')],'as':_0xb22e('0x8f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xb22e('0x90'),'raw':!![]}]}]});}}})['then'](function(_0x52b316){if(!_0x52b316||!_0x52b316['Smtp']||!_0x1216b8['body'])return _0x184ba3;var _0x149b14=_0x52b316[_0xb22e('0x91')]();return respondWithRpcPromise(_0xb22e('0x92'),_0xb22e('0x93'),{'account':_0x149b14,'message':{'from':util['format'](_0xb22e('0x94'),_0x52b316['name'],_0x52b316[_0xb22e('0x50')]||_0x52b316[_0xb22e('0x8f')][_0xb22e('0x38')]),'to':_0x1216b8[_0xb22e('0x2d')][_0xb22e('0x95')],'subject':'Mail\x20Transcript','text':util[_0xb22e('0x78')](_0xb22e('0x96'),_0x1216b8[_0xb22e('0x2d')][_0xb22e('0x95')]),'attachments':[{'path':_0x568015}]}})[_0xb22e('0x29')](function(){return _0x184ba3;})[_0xb22e('0x39')](function(_0xe9d3e0){logger[_0xb22e('0x1b')](_0xe9d3e0);});})[_0xb22e('0x29')](respondWithStatusCode(_0x52c365,0xc8))[_0xb22e('0x39')](handleError(_0x52c365,null));};exports[_0xb22e('0x97')]=function(_0x244905,_0x381b56){return db['ChatMessage'][_0xb22e('0x45')]({'where':{'id':_0x244905[_0xb22e('0x43')]['id']}})[_0xb22e('0x29')](handleEntityNotFound(_0x381b56,null))['then'](function(_0x5e0e65){if(_0x5e0e65){return _0x5e0e65[_0xb22e('0x97')](_0x244905[_0xb22e('0x2d')][_0xb22e('0x98')],_['omit'](_0x244905[_0xb22e('0x2d')],['ids','id'])||{});}})['then'](respondWithResult(_0x381b56,null))['catch'](handleError(_0x381b56,null));};exports['getMessages']=function(_0xfbe8f0,_0x3bb1b7){var _0x5c27d9={'raw':![],'where':{}};var _0x38d422={};var _0x58cd4a={'count':0x0,'rows':[]};return db[_0xb22e('0x32')]['findOne']({'where':{'id':_0xfbe8f0['params']['id']}})['then'](handleEntityNotFound(_0x3bb1b7,null))[_0xb22e('0x29')](function(_0x3f02c5){if(_0x3f02c5){_0x38d422[_0xb22e('0x3a')]=_[_0xb22e('0x3b')](db[_0xb22e('0x5d')][_0xb22e('0x33')]);_0x38d422[_0xb22e('0x37')]=_['keys'](_0xfbe8f0[_0xb22e('0x37')]);_0x38d422[_0xb22e('0x3c')]=_[_0xb22e('0x3e')](_0x38d422[_0xb22e('0x3a')],_0x38d422[_0xb22e('0x37')]);_0x5c27d9[_0xb22e('0x3d')]=_[_0xb22e('0x3e')](_0x38d422[_0xb22e('0x3a')],qs[_0xb22e('0x3f')](_0xfbe8f0[_0xb22e('0x37')][_0xb22e('0x3f')]));_0x5c27d9['attributes']=_0x5c27d9[_0xb22e('0x3d')][_0xb22e('0x7f')]?_0x5c27d9[_0xb22e('0x3d')]:_0x38d422['model'];if(!_0xfbe8f0[_0xb22e('0x37')]['hasOwnProperty'](_0xb22e('0x99'))){_0x5c27d9['limit']=qs[_0xb22e('0x24')](_0xfbe8f0[_0xb22e('0x37')][_0xb22e('0x24')]);_0x5c27d9[_0xb22e('0x23')]=qs[_0xb22e('0x23')](_0xfbe8f0['query'][_0xb22e('0x23')]);}_0x5c27d9[_0xb22e('0x9a')]=qs[_0xb22e('0x9b')](_0xfbe8f0[_0xb22e('0x37')]['sort']);_0x5c27d9[_0xb22e('0x9c')]=qs[_0xb22e('0x3c')](_[_0xb22e('0x9d')](_0xfbe8f0['query'],_0x38d422[_0xb22e('0x3c')]));_0x5c27d9[_0xb22e('0x9c')]['ChatInteractionId']=_0x3f02c5['id'];if(_0xfbe8f0[_0xb22e('0x37')][_0xb22e('0x9e')]){_0x5c27d9[_0xb22e('0x9c')]=_[_0xb22e('0x9f')](_0x5c27d9[_0xb22e('0x9c')],{'$or':_[_0xb22e('0x31')](_0x5c27d9[_0xb22e('0x3d')],function(_0x36a14c){var _0x1b980f={};_0x1b980f[_0x36a14c]={'$like':'%'+_0xfbe8f0[_0xb22e('0x37')][_0xb22e('0x9e')]+'%'};return _0x1b980f;})});}if(_0xfbe8f0[_0xb22e('0x37')][_0xb22e('0xa0')]){var _0x46cd39=_0xfbe8f0[_0xb22e('0x37')][_0xb22e('0xa0')][_0xb22e('0xa1')](',');var _0x1ed602={};_0x1ed602[_0x46cd39[0x0]]={'$gte':moment(_0x46cd39[0x1])[_0xb22e('0x78')](_0xb22e('0xa2'))};_0x5c27d9['where']=_[_0xb22e('0x9f')](_0x5c27d9[_0xb22e('0x9c')],_0x1ed602);}_0x5c27d9=_['merge']({},_0x5c27d9,_0xfbe8f0['options']);return db[_0xb22e('0x5d')]['count']({'where':_0x5c27d9[_0xb22e('0x9c')]})[_0xb22e('0x29')](function(_0x4295b1){_0x58cd4a['count']=_0x4295b1;if(_0xfbe8f0[_0xb22e('0x37')][_0xb22e('0x40')]){_0x5c27d9[_0xb22e('0x41')]=[{'all':!![]}];}return db[_0xb22e('0x5d')]['findAll'](_0x5c27d9);})['then'](function(_0x5a3cac){_0x58cd4a[_0xb22e('0xa3')]=_0x5a3cac;return _0x58cd4a;});}})[_0xb22e('0x29')](respondWithFilteredResult(_0x3bb1b7,_0x5c27d9))['catch'](handleError(_0x3bb1b7,null));};exports['getMyMessages']=function(_0x43ce7d,_0x3d4e44){var _0x5a1322={'where':{}},_0x4cdca8={},_0x3b9912={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb22e('0x48')]({'where':{'id':_0x43ce7d[_0xb22e('0x43')]['id']}})[_0xb22e('0x29')](handleEntityNotFound(_0x3d4e44,null))[_0xb22e('0x29')](function(_0x409671){if(_0x409671){_0x4cdca8['model']=_[_0xb22e('0x3b')](db['ChatMessage'][_0xb22e('0x33')]);_0x4cdca8[_0xb22e('0x37')]=_[_0xb22e('0x3b')](_0x43ce7d[_0xb22e('0x37')]);_0x4cdca8[_0xb22e('0x3c')]=_[_0xb22e('0x3e')](_0x4cdca8[_0xb22e('0x3a')],_0x4cdca8[_0xb22e('0x37')]);_0x5a1322[_0xb22e('0x3d')]=_[_0xb22e('0x3e')](_0x4cdca8[_0xb22e('0x3a')],qs[_0xb22e('0x3f')](_0x43ce7d['query']['fields']));_0x5a1322['attributes']=_0x5a1322[_0xb22e('0x3d')][_0xb22e('0x7f')]?_0x5a1322[_0xb22e('0x3d')]:_0x4cdca8[_0xb22e('0x3a')];if(!_0x43ce7d['query'][_0xb22e('0xa4')](_0xb22e('0x99'))){_0x5a1322[_0xb22e('0x24')]=qs[_0xb22e('0x24')](_0x43ce7d[_0xb22e('0x37')][_0xb22e('0x24')]);_0x5a1322[_0xb22e('0x23')]=qs[_0xb22e('0x23')](_0x43ce7d[_0xb22e('0x37')][_0xb22e('0x23')]);}_0x5a1322['order']=qs['sort'](_0x43ce7d[_0xb22e('0x37')]['sort']);_0x5a1322[_0xb22e('0x9c')]=qs[_0xb22e('0x3c')](_[_0xb22e('0x9d')](_0x43ce7d[_0xb22e('0x37')],_0x4cdca8[_0xb22e('0x3c')]));_0x5a1322['where'][_0xb22e('0xa5')]=_0x409671['id'];if(_0x43ce7d[_0xb22e('0x37')][_0xb22e('0x9e')]){_0x5a1322[_0xb22e('0x9c')]=_[_0xb22e('0x9f')](_0x5a1322['where'],{'$or':_[_0xb22e('0x31')](_0x5a1322[_0xb22e('0x3d')],function(_0x4b6e8a){var _0x3522bd={};_0x3522bd[_0x4b6e8a]={'$like':'%'+_0x43ce7d[_0xb22e('0x37')][_0xb22e('0x9e')]+'%'};return _0x3522bd;})});}_0x5a1322[_0xb22e('0x9c')]['secret']=![];if(_0x43ce7d[_0xb22e('0x37')]['id']){_0x5a1322['where']['id']={'$gt':_0x43ce7d[_0xb22e('0x37')]['id']};}_0x5a1322=_[_0xb22e('0x9f')]({},_0x5a1322,_0x43ce7d[_0xb22e('0x42')]);return db['ChatMessage']['count']({'where':_0x5a1322[_0xb22e('0x9c')]})[_0xb22e('0x29')](function(_0x345e9a){_0x3b9912[_0xb22e('0x26')]=_0x345e9a;_0x5a1322[_0xb22e('0x41')]=[];if(_0x43ce7d[_0xb22e('0x37')][_0xb22e('0xa6')]){_0x5a1322[_0xb22e('0x41')]['push']({'model':db['User'],'as':_0xb22e('0x7c'),'attributes':['id','fullname',_0xb22e('0x86')]});}if(_0x43ce7d[_0xb22e('0x37')][_0xb22e('0x40')]){_0x5a1322[_0xb22e('0x41')]=[{'all':!![]}];}return db[_0xb22e('0x5d')]['findAll'](_0x5a1322);})[_0xb22e('0x29')](function(_0x3e603f){_0x3b9912[_0xb22e('0xa3')]=_0x3e603f;return _0x3b9912;});}})[_0xb22e('0x29')](respondWithFilteredResult(_0x3d4e44,_0x5a1322))[_0xb22e('0x39')](handleError(_0x3d4e44,null));};exports[_0xb22e('0xa7')]=function(_0x3ddaea,_0x33df70){return db[_0xb22e('0x32')][_0xb22e('0x45')]({'where':{'id':_0x3ddaea[_0xb22e('0x43')]['id']}})['then'](handleEntityNotFound(_0x33df70,null))[_0xb22e('0x29')](function(_0x526b72){if(_0x526b72){return _0x526b72['setTags'](_0x3ddaea['body']['ids'],_['omit'](_0x3ddaea[_0xb22e('0x2d')],[_0xb22e('0x98'),'id'])||{})[_0xb22e('0xa8')](function(){return db[_0xb22e('0xa9')][_0xb22e('0xaa')]({'attributes':['id',_0xb22e('0x69'),_0xb22e('0xab')],'where':{'id':_0x3ddaea[_0xb22e('0x2d')][_0xb22e('0x98')]}});})[_0xb22e('0x29')](function(_0x29e30e){socket[_0xb22e('0xac')]('chatInteractionTags:save',{'id':Number(_0x3ddaea[_0xb22e('0x43')]['id']),'tags':_0x29e30e||[]});return{'id':Number(_0x3ddaea['params']['id']),'tags':_0x29e30e||[]};});}})['then'](respondWithResult(_0x33df70,null))['catch'](handleError(_0x33df70,null));};exports[_0xb22e('0xad')]=function(_0x7b2461,_0x2a6386){return db[_0xb22e('0x32')][_0xb22e('0x45')]({'where':{'id':_0x7b2461['params']['id']}})[_0xb22e('0x29')](handleEntityNotFound(_0x2a6386,null))[_0xb22e('0x29')](function(_0x2344f4){if(_0x2344f4){return _0x2344f4[_0xb22e('0xad')](_0x7b2461[_0xb22e('0x37')][_0xb22e('0x98')]);}})[_0xb22e('0x29')](respondWithStatusCode(_0x2a6386,null))[_0xb22e('0x39')](handleError(_0x2a6386,null));};exports[_0xb22e('0x76')]=function(_0x4b6902,_0x367382){var _0x271e98=moment()['unix']()['toString']();var _0x48ed5a=path['join'](config[_0xb22e('0x72')],_0xb22e('0xae'),_0xb22e('0xaf'),'tmp');var _0xae1e00=path[_0xb22e('0x71')](config[_0xb22e('0x72')],_0xb22e('0xae'),_0xb22e('0xaf'),_0xb22e('0xb0'));var _0x1d99cd=path['join'](_0x48ed5a,_0x271e98);var _0x45391e=util[_0xb22e('0x78')](_0xb22e('0xb1'),_0x4b6902['params']['id'],_0x271e98);var _0x3ca3a=path['join'](_0x48ed5a,_0x45391e);var _0x482af0=[];_0x482af0['push']({'model':db[_0xb22e('0x7c')],'as':_0xb22e('0x7c'),'attributes':['id',_0xb22e('0x4f')],'raw':!![]});_0x482af0[_0xb22e('0xb2')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xb22e('0xb3'),'lastName'],'raw':!![]});if(_0x4b6902['query'][_0xb22e('0xb0')]){_0x482af0[_0xb22e('0xb2')]({'model':db[_0xb22e('0x6f')],'as':_0xb22e('0x6f'),'raw':!![]});}var _0x460fc5=[{'model':db[_0xb22e('0x5d')],'as':_0xb22e('0x7e'),'attributes':['id',_0xb22e('0x2d'),'createdAt',_0xb22e('0x8a'),'secret',_0xb22e('0xb4')],'include':_0x482af0}];_0x460fc5[_0xb22e('0xb2')]({'model':db[_0xb22e('0x49')],'as':_0xb22e('0xb5'),'attributes':['id',_0xb22e('0x69')]});_0x460fc5[_0xb22e('0xb2')]({'model':db[_0xb22e('0x7c')],'as':_0xb22e('0xb6'),'attributes':['id',_0xb22e('0x4f')]});return db['ChatInteraction']['find']({'where':{'id':_0x4b6902[_0xb22e('0x43')]['id']},'include':_0x460fc5})['then'](handleEntityNotFound(_0x367382,null))[_0xb22e('0x29')](function(_0x4feb0c){if(_0x4feb0c){var _0x10cb34=_0x4feb0c['get']({'plain':!![]});fs[_0xb22e('0xb7')](_0x1d99cd);var _0x3e0ed7={'channel':'Chat','account':_0x10cb34['Account']['name'],'agent':_0x10cb34[_0xb22e('0xb6')]?_0x10cb34[_0xb22e('0xb6')]['fullname']:_0xb22e('0xb8'),'createdAt':moment(_0x10cb34[_0xb22e('0x88')])[_0xb22e('0x78')](_0xb22e('0xa2'))[_0xb22e('0xb9')](),'closedAt':_0x10cb34[_0xb22e('0x6e')]?moment(_0x10cb34[_0xb22e('0xba')])[_0xb22e('0x78')](_0xb22e('0xa2'))[_0xb22e('0xb9')]():'','disposition':_0x10cb34['disposition'],'chatInfo':{'browser':_0x10cb34['browserName'],'os':_0x10cb34[_0xb22e('0xbb')],'referer':_0x10cb34['referer'],'customerIp':_0x10cb34[_0xb22e('0xbc')],'customerPort':_0x10cb34['customerPort']?_0x10cb34[_0xb22e('0xbd')]:_0xb22e('0xb8')},'messages':_(_0x10cb34[_0xb22e('0x7e')])['tail']()[_0xb22e('0x9e')]({'secret':![]})[_0xb22e('0x31')](function(_0x5fadb6){if(_0x5fadb6[_0xb22e('0x6f')]){var _0xa9c005=path['join'](_0xae1e00,_0x5fadb6[_0xb22e('0x6f')]['basename']);if(fs[_0xb22e('0xbe')](_0xa9c005)){fs[_0xb22e('0xbf')](_0xa9c005)['pipe'](fs[_0xb22e('0xc0')](path[_0xb22e('0x71')](_0x1d99cd,_0x5fadb6[_0xb22e('0x6f')]['basename'])));}}return{'date':moment(_0x5fadb6[_0xb22e('0x88')])['format'](_0xb22e('0xa2'))[_0xb22e('0xb9')](),'sender':_0x5fadb6['direction']===_0xb22e('0x5c')?_0x5fadb6['User']?_0x5fadb6[_0xb22e('0x7c')][_0xb22e('0x4f')]:_0xb22e('0x82'):_0x5fadb6['Contact']['firstName']+(_0x5fadb6[_0xb22e('0xc1')][_0xb22e('0xc2')]?'\x20'+_0x5fadb6[_0xb22e('0xc1')][_0xb22e('0xc2')]:''),'body':_0x5fadb6[_0xb22e('0x6f')]?_0x5fadb6[_0xb22e('0x6f')]['basename']:_0x5fadb6[_0xb22e('0x2d')],'direction':_0x5fadb6[_0xb22e('0x8a')]==='out'?'A':'C','secret':_0x5fadb6[_0xb22e('0x8b')],'read':_0x5fadb6[_0xb22e('0xb4')],'attachment':_0x5fadb6[_0xb22e('0x6f')]};})[_0xb22e('0xc3')]()};return ejs[_0xb22e('0xc4')](path['join'](config[_0xb22e('0x72')],_0xb22e('0xae'),'views','downloadInteraction.ejs'),{'interaction':_0x3e0ed7})[_0xb22e('0x29')](function(_0x58266b){var _0x4d39c7=path[_0xb22e('0x71')](_0x1d99cd,_0xb22e('0xc5')+_0x10cb34['id']+'-'+_0x271e98+_0xb22e('0xc6'));var _0x4b43e2={'path':_0x4d39c7,'channel':'Chat','interactionId':_0x10cb34['id']};return pdf[_0xb22e('0xc7')](_0x58266b,_0x4b43e2);})['then'](function(){return new Promise(function(_0x3973d5,_0x12d3c5){zipdir(_0x1d99cd,{'saveTo':_0x3ca3a},function(_0xaaa65c,_0x2928ad){if(_0xaaa65c)return _0x12d3c5(_0xaaa65c);return _0x3973d5(_0x2928ad);});})[_0xb22e('0x29')](function(){return new BPromise(function(_0x2174f0,_0x229c0e){rimraf(_0x1d99cd,function(_0x3e3f61){if(_0x3e3f61)_0x229c0e(_0x3e3f61);return _0x2174f0();});});})[_0xb22e('0x29')](function(){return _0x367382[_0xb22e('0x76')](_0x3ca3a,_0x45391e,function(_0x1718fc){if(_0x1718fc){logger[_0xb22e('0x1b')](_0xb22e('0xc8'),_0x1718fc);}else{fs[_0xb22e('0xc9')](_0x3ca3a);}});});});}else{return _0x367382[_0xb22e('0x20')](0xc8);}})[_0xb22e('0x39')](handleError(_0x367382,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 5f9529d..f48ccd3 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 _0x844a=['unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','map','findAll','then'];(function(_0x2a0d34,_0x41aaee){var _0x5dd1aa=function(_0x283087){while(--_0x283087){_0x2a0d34['push'](_0x2a0d34['shift']());}};_0x5dd1aa(++_0x41aaee);}(_0x844a,0x116));var _0xa844=function(_0x37635e,_0x556f60){_0x37635e=_0x37635e-0x0;var _0x1486b0=_0x844a[_0x37635e];return _0x1486b0;};'use strict';var EventEmitter=require(_0xa844('0x0'));var ChatInteraction=require(_0xa844('0x1'))['db'][_0xa844('0x2')];var ChatMessage=require(_0xa844('0x1'))['db'][_0xa844('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa844('0x4')](0x0);var events={'afterCreate':_0xa844('0x5'),'afterUpdate':_0xa844('0x6'),'afterDestroy':'remove'};function emitEvent(_0x307274){return function(_0x2d8620,_0x2f3d3a,_0x56d716){_0x2d8620['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x354697){_0x2d8620['setDataValue']('Users',_0x354697[_0xa844('0x7')](function(_0x42e7cc){return{'id':_0x42e7cc['id']};}));return ChatMessage[_0xa844('0x8')]({'where':{'ChatInteractionId':_0x2d8620['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa844('0x9')](function(_0x4c063b){_0x2d8620['setDataValue'](_0xa844('0xa'),_0x4c063b[_0xa844('0xb')]);ChatInteractionEvents['emit'](_0x307274+':'+_0x2d8620['id'],_0x2d8620);ChatInteractionEvents[_0xa844('0xc')](_0x307274,_0x2d8620);_0x56d716(null);})['catch'](_0x56d716(null));};}for(var e in events){if(events[_0xa844('0xd')](e)){var event=events[e];ChatInteraction[_0xa844('0xe')](e,emitEvent(event));}}module[_0xa844('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xf052=['getUsers','then','setDataValue','Users','map','findAll','emit','catch','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove'];(function(_0x33a750,_0x23e437){var _0x36de2c=function(_0x4f81e9){while(--_0x4f81e9){_0x33a750['push'](_0x33a750['shift']());}};_0x36de2c(++_0x23e437);}(_0xf052,0x169));var _0x2f05=function(_0x2aa87d,_0x1aa073){_0x2aa87d=_0x2aa87d-0x0;var _0x3a1812=_0xf052[_0x2aa87d];return _0x3a1812;};'use strict';var EventEmitter=require(_0x2f05('0x0'));var ChatInteraction=require(_0x2f05('0x1'))['db'][_0x2f05('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x2f05('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2f05('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2f05('0x5'),'afterDestroy':_0x2f05('0x6')};function emitEvent(_0x44ca1f){return function(_0x2974e3,_0x10744f,_0x13869a){_0x2974e3[_0x2f05('0x7')]({'attributes':['id'],'raw':!![]})[_0x2f05('0x8')](function(_0x4394b9){_0x2974e3[_0x2f05('0x9')](_0x2f05('0xa'),_0x4394b9[_0x2f05('0xb')](function(_0x10b273){return{'id':_0x10b273['id']};}));return ChatMessage[_0x2f05('0xc')]({'where':{'ChatInteractionId':_0x2974e3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2f05('0x8')](function(_0x4f67eb){_0x2974e3['setDataValue']('unreadMessages',_0x4f67eb['length']);ChatInteractionEvents[_0x2f05('0xd')](_0x44ca1f+':'+_0x2974e3['id'],_0x2974e3);ChatInteractionEvents[_0x2f05('0xd')](_0x44ca1f,_0x2974e3);_0x13869a(null);})[_0x2f05('0xe')](_0x13869a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x2f05('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 8236e09..83265a4 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 _0x3df5=['../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x44f9ae,_0x27f80a){var _0x7fcd7=function(_0x41cfe6){while(--_0x41cfe6){_0x44f9ae['push'](_0x44f9ae['shift']());}};_0x7fcd7(++_0x27f80a);}(_0x3df5,0x159));var _0x53df=function(_0x2d40b9,_0x2aa430){_0x2d40b9=_0x2d40b9-0x0;var _0x118c40=_0x3df5[_0x2d40b9];return _0x118c40;};'use strict';var _=require(_0x53df('0x0'));var util=require(_0x53df('0x1'));var logger=require(_0x53df('0x2'))(_0x53df('0x3'));var moment=require(_0x53df('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x53df('0x5'));var attributes=require(_0x53df('0x6'));module[_0x53df('0x7')]=function(_0x20966d,_0x168357){return _0x20966d['define'](_0x53df('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21698f,_0x5388fa,_0x1a1868){if(_0x21698f['changed'](_0x53df('0x9'))){_0x21698f[_0x53df('0xa')]=moment()['format'](_0x53df('0xb'));}_0x1a1868(null,_0x21698f);}},'charset':_0x53df('0xc'),'collate':_0x53df('0xd')});};
\ No newline at end of file
+var _0x086f=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','define','chat_interactions','changed','closed'];(function(_0x127074,_0x3bd855){var _0x4c9463=function(_0xf337a6){while(--_0xf337a6){_0x127074['push'](_0x127074['shift']());}};_0x4c9463(++_0x3bd855);}(_0x086f,0x17b));var _0xf086=function(_0x2f7004,_0x247a56){_0x2f7004=_0x2f7004-0x0;var _0x4a2c4c=_0x086f[_0x2f7004];return _0x4a2c4c;};'use strict';var _=require(_0xf086('0x0'));var util=require(_0xf086('0x1'));var logger=require(_0xf086('0x2'))(_0xf086('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf086('0x4'));var fs=require('fs');var path=require(_0xf086('0x5'));var rimraf=require(_0xf086('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x6239b4,_0x17e67c){return _0x6239b4[_0xf086('0x7')]('ChatInteraction',attributes,{'tableName':_0xf086('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b77c2,_0x491519,_0x3eab7e){if(_0x1b77c2[_0xf086('0x9')](_0xf086('0xa'))){_0x1b77c2[_0xf086('0xb')]=moment()['format'](_0xf086('0xc'));}_0x3eab7e(null,_0x1b77c2);}},'charset':_0xf086('0xd'),'collate':_0xf086('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 6f940ba..5daa53c 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 _0x646a=['body','options','raw','where','attributes','limit','debug','addTags','ids','omit','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','UpdateChatInteraction','ChatInteraction','update'];(function(_0x4d9767,_0x4a0490){var _0x43bab4=function(_0x140682){while(--_0x140682){_0x4d9767['push'](_0x4d9767['shift']());}};_0x43bab4(++_0x4a0490);}(_0x646a,0xd4));var _0xa646=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x646a[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xa646('0x0'));var util=require(_0xa646('0x1'));var moment=require(_0xa646('0x2'));var BPromise=require(_0xa646('0x3'));var rs=require(_0xa646('0x4'));var fs=require('fs');var Redis=require(_0xa646('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa646('0x6'));var logger=require(_0xa646('0x7'))('rpc');var config=require(_0xa646('0x8'));var jayson=require(_0xa646('0x9'));var client=jayson[_0xa646('0xa')][_0xa646('0xb')]({'port':0x232a});config[_0xa646('0xc')]=_[_0xa646('0xd')](config[_0xa646('0xc')],{'host':_0xa646('0xe'),'port':0x18eb});var socket=require(_0xa646('0xf'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xa646('0x10')](socket);function respondWithRpcPromise(_0x24633c,_0xddb1f8,_0x44bab9){return new BPromise(function(_0x5eef5d,_0x440433){return client['request'](_0x24633c,_0x44bab9)[_0xa646('0x11')](function(_0x21c64b){logger['info'](_0xa646('0x12'),_0xddb1f8,'request\x20sent');logger['debug'](_0xa646('0x13'),_0xddb1f8,_0xa646('0x14'),JSON[_0xa646('0x15')](_0x21c64b));if(_0x21c64b[_0xa646('0x16')]){if(_0x21c64b[_0xa646('0x16')]['code']===0x1f4){logger[_0xa646('0x16')](_0xa646('0x12'),_0xddb1f8,_0x21c64b[_0xa646('0x16')]['message']);return _0x440433(_0x21c64b['error']['message']);}logger[_0xa646('0x16')](_0xa646('0x12'),_0xddb1f8,_0x21c64b['error'][_0xa646('0x17')]);return _0x5eef5d(_0x21c64b[_0xa646('0x16')][_0xa646('0x17')]);}else{logger[_0xa646('0x18')](_0xa646('0x12'),_0xddb1f8,'request\x20sent');_0x5eef5d(_0x21c64b['result'][_0xa646('0x17')]);}})['catch'](function(_0x4bd409){logger[_0xa646('0x16')]('ChatInteraction,\x20%s,\x20%s',_0xddb1f8,_0x4bd409);_0x440433(_0x4bd409);});});}exports[_0xa646('0x19')]=function(_0x5066db){var _0x3407d8=this;return new Promise(function(_0x21eee8,_0x59efac){return db[_0xa646('0x1a')][_0xa646('0x1b')](_0x5066db[_0xa646('0x1c')],{'raw':_0x5066db['options']?_0x5066db[_0xa646('0x1d')][_0xa646('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5066db[_0xa646('0x1d')]?_0x5066db['options'][_0xa646('0x1f')]||null:null,'attributes':_0x5066db[_0xa646('0x1d')]?_0x5066db['options'][_0xa646('0x20')]||null:null,'limit':_0x5066db[_0xa646('0x1d')]?_0x5066db['options'][_0xa646('0x21')]||null:null})[_0xa646('0x11')](function(_0x4ae873){logger[_0xa646('0x18')](_0xa646('0x19'),_0x5066db);logger[_0xa646('0x22')](_0xa646('0x19'),_0x5066db,JSON[_0xa646('0x15')](_0x4ae873));_0x21eee8(_0x4ae873);})['catch'](function(_0x270419){logger[_0xa646('0x16')](_0xa646('0x19'),_0x270419[_0xa646('0x17')],_0x5066db);_0x59efac(_0x3407d8[_0xa646('0x16')](0x1f4,_0x270419[_0xa646('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x5cd92c){return new Promise(function(_0x4a3463,_0x61552c){return db[_0xa646('0x1a')]['find']({'where':_0x5cd92c['options']?_0x5cd92c[_0xa646('0x1d')][_0xa646('0x1f')]||null:null})[_0xa646('0x11')](function(_0x1253ea){if(_0x1253ea){return _0x1253ea[_0xa646('0x23')](_0x5cd92c['body'][_0xa646('0x24')],_[_0xa646('0x25')](_0x5cd92c[_0xa646('0x1c')],[_0xa646('0x24'),'id'])||{});}})['spread'](function(_0x3b66a6){logger['info']('AddTags',_0x5cd92c);logger[_0xa646('0x22')](_0xa646('0x26'),_0x5cd92c,JSON[_0xa646('0x15')](_0x3b66a6));_0x4a3463(_0x3b66a6);})[_0xa646('0x27')](function(_0x5df30c){logger[_0xa646('0x16')]('AddTags',_0x5df30c['message'],_0x5cd92c);_0x61552c(_this[_0xa646('0x16')](0x1f4,_0x5df30c[_0xa646('0x17')]));});});};
\ No newline at end of file
+var _0xc9f3=['ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','UpdateChatInteraction','options','raw','where','attributes','info','debug','AddTagsToChatInteraction','ChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s'];(function(_0xb99bf8,_0x8eb729){var _0x102498=function(_0x153573){while(--_0x153573){_0xb99bf8['push'](_0xb99bf8['shift']());}};_0x102498(++_0x8eb729);}(_0xc9f3,0x101));var _0x3c9f=function(_0x27ff1e,_0x54d492){_0x27ff1e=_0x27ff1e-0x0;var _0x267326=_0xc9f3[_0x27ff1e];return _0x267326;};'use strict';var _=require(_0x3c9f('0x0'));var util=require('util');var moment=require(_0x3c9f('0x1'));var BPromise=require(_0x3c9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c9f('0x3'));var db=require(_0x3c9f('0x4'))['db'];var utils=require(_0x3c9f('0x5'));var logger=require(_0x3c9f('0x6'))(_0x3c9f('0x7'));var config=require(_0x3c9f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3c9f('0x9')][_0x3c9f('0xa')]({'port':0x232a});config[_0x3c9f('0xb')]=_[_0x3c9f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c9f('0xb')]));require(_0x3c9f('0xd'))['register'](socket);function respondWithRpcPromise(_0x10badd,_0x5434ec,_0x2982e4){return new BPromise(function(_0x3eac73,_0x13df03){return client['request'](_0x10badd,_0x2982e4)[_0x3c9f('0xe')](function(_0x2513c0){logger['info'](_0x3c9f('0xf'),_0x5434ec,'request\x20sent');logger['debug'](_0x3c9f('0x10'),_0x5434ec,_0x3c9f('0x11'),JSON[_0x3c9f('0x12')](_0x2513c0));if(_0x2513c0['error']){if(_0x2513c0['error'][_0x3c9f('0x13')]===0x1f4){logger[_0x3c9f('0x14')](_0x3c9f('0xf'),_0x5434ec,_0x2513c0[_0x3c9f('0x14')]['message']);return _0x13df03(_0x2513c0['error'][_0x3c9f('0x15')]);}logger[_0x3c9f('0x14')](_0x3c9f('0xf'),_0x5434ec,_0x2513c0[_0x3c9f('0x14')]['message']);return _0x3eac73(_0x2513c0['error'][_0x3c9f('0x15')]);}else{logger['info'](_0x3c9f('0xf'),_0x5434ec,'request\x20sent');_0x3eac73(_0x2513c0[_0x3c9f('0x16')]['message']);}})[_0x3c9f('0x17')](function(_0x537aef){logger[_0x3c9f('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5434ec,_0x537aef);_0x13df03(_0x537aef);});});}exports[_0x3c9f('0x18')]=function(_0x4a4354){var _0x2c2562=this;return new Promise(function(_0x1c6ff3,_0x4812b1){return db['ChatInteraction']['update'](_0x4a4354['body'],{'raw':_0x4a4354[_0x3c9f('0x19')]?_0x4a4354[_0x3c9f('0x19')][_0x3c9f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a4354['options']?_0x4a4354[_0x3c9f('0x19')][_0x3c9f('0x1b')]||null:null,'attributes':_0x4a4354[_0x3c9f('0x19')]?_0x4a4354[_0x3c9f('0x19')][_0x3c9f('0x1c')]||null:null,'limit':_0x4a4354[_0x3c9f('0x19')]?_0x4a4354[_0x3c9f('0x19')]['limit']||null:null})[_0x3c9f('0xe')](function(_0x323e81){logger[_0x3c9f('0x1d')](_0x3c9f('0x18'),_0x4a4354);logger[_0x3c9f('0x1e')](_0x3c9f('0x18'),_0x4a4354,JSON['stringify'](_0x323e81));_0x1c6ff3(_0x323e81);})[_0x3c9f('0x17')](function(_0x4c9826){logger[_0x3c9f('0x14')]('UpdateChatInteraction',_0x4c9826[_0x3c9f('0x15')],_0x4a4354);_0x4812b1(_0x2c2562[_0x3c9f('0x14')](0x1f4,_0x4c9826[_0x3c9f('0x15')]));});});};exports[_0x3c9f('0x1f')]=function(_0x42fcf2){return new Promise(function(_0x1abc65,_0x4b78f3){return db[_0x3c9f('0x20')]['find']({'where':_0x42fcf2[_0x3c9f('0x19')]?_0x42fcf2['options'][_0x3c9f('0x1b')]||null:null})[_0x3c9f('0xe')](function(_0x4f8f8a){if(_0x4f8f8a){return _0x4f8f8a[_0x3c9f('0x21')](_0x42fcf2[_0x3c9f('0x22')][_0x3c9f('0x23')],_[_0x3c9f('0x24')](_0x42fcf2[_0x3c9f('0x22')],[_0x3c9f('0x23'),'id'])||{});}})[_0x3c9f('0x25')](function(_0x227b4e){logger['info'](_0x3c9f('0x26'),_0x42fcf2);logger[_0x3c9f('0x1e')]('AddTags',_0x42fcf2,JSON[_0x3c9f('0x12')](_0x227b4e));_0x1abc65(_0x227b4e);})[_0x3c9f('0x17')](function(_0x5145a3){logger[_0x3c9f('0x14')]('AddTags',_0x5145a3[_0x3c9f('0x15')],_0x42fcf2);_0x4b78f3(_this['error'](0x1f4,_0x5145a3[_0x3c9f('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 5b6e2e9..3945103 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 _0x666b=['emit','register','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x4c2ad3,_0x5d5b68){var _0x2723bc=function(_0x64a073){while(--_0x64a073){_0x4c2ad3['push'](_0x4c2ad3['shift']());}};_0x2723bc(++_0x5d5b68);}(_0x666b,0x129));var _0xb666=function(_0x30add5,_0x6dfba2){_0x30add5=_0x30add5-0x0;var _0x2b5904=_0x666b[_0x30add5];return _0x2b5904;};'use strict';var ChatInteractionEvents=require(_0xb666('0x0'));var events=[_0xb666('0x1'),_0xb666('0x2'),_0xb666('0x3')];function createListener(_0x1fa7a8,_0x4fefb0){return function(_0x5eb0f5){_0x4fefb0[_0xb666('0x4')](_0x1fa7a8,_0x5eb0f5);};}function removeListener(_0x3e0b02,_0x2860d9){return function(){ChatInteractionEvents['removeListener'](_0x3e0b02,_0x2860d9);};}exports[_0xb666('0x5')]=function(_0x2dc0d2){for(var _0xd987a2=0x0,_0xea61a6=events['length'];_0xd987a2<_0xea61a6;_0xd987a2++){var _0x2a78c1=events[_0xd987a2];var _0xafa6fb=createListener(_0xb666('0x6')+_0x2a78c1,_0x2dc0d2);ChatInteractionEvents['on'](_0x2a78c1,_0xafa6fb);}};
\ No newline at end of file
+var _0xe566=['length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x530df4,_0x1eb32d){var _0x5aed62=function(_0x398598){while(--_0x398598){_0x530df4['push'](_0x530df4['shift']());}};_0x5aed62(++_0x1eb32d);}(_0xe566,0x170));var _0x6e56=function(_0xa3e7f1,_0x426c18){_0xa3e7f1=_0xa3e7f1-0x0;var _0x4b877c=_0xe566[_0xa3e7f1];return _0x4b877c;};'use strict';var ChatInteractionEvents=require(_0x6e56('0x0'));var events=[_0x6e56('0x1'),_0x6e56('0x2'),_0x6e56('0x3')];function createListener(_0x5a3ac9,_0x1767d4){return function(_0x2a038e){_0x1767d4['emit'](_0x5a3ac9,_0x2a038e);};}function removeListener(_0x5cd320,_0x36e2b1){return function(){ChatInteractionEvents['removeListener'](_0x5cd320,_0x36e2b1);};}exports['register']=function(_0x4ab21d){for(var _0x1f56f1=0x0,_0x558283=events[_0x6e56('0x4')];_0x1f56f1<_0x558283;_0x1f56f1++){var _0x2126da=events[_0x1f56f1];var _0x4f5668=createListener(_0x6e56('0x5')+_0x2126da,_0x4ab21d);ChatInteractionEvents['on'](_0x2126da,_0x4f5668);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 77c4f53..43b540e 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 _0x3a65=['diskStorage','join','format','replace','single','file','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession'];(function(_0x115fdd,_0x1abca6){var _0x3a5270=function(_0x20571f){while(--_0x20571f){_0x115fdd['push'](_0x115fdd['shift']());}};_0x3a5270(++_0x1abca6);}(_0x3a65,0xee));var _0x53a6=function(_0x3f0f1f,_0x327cb4){_0x3f0f1f=_0x3f0f1f-0x0;var _0x1e5de6=_0x3a65[_0x3f0f1f];return _0x1e5de6;};'use strict';var multer=require(_0x53a6('0x0'));var util=require(_0x53a6('0x1'));var path=require(_0x53a6('0x2'));var timeout=require(_0x53a6('0x3'));var express=require(_0x53a6('0x4'));var router=express['Router']();var fs_extra=require(_0x53a6('0x5'));var auth=require(_0x53a6('0x6'));var interaction=require(_0x53a6('0x7'));var config=require(_0x53a6('0x8'));var controller=require(_0x53a6('0x9'));router[_0x53a6('0xa')]('/',auth[_0x53a6('0xb')](),controller[_0x53a6('0xc')]);router['get']('/describe',auth[_0x53a6('0xb')](),controller[_0x53a6('0xd')]);router[_0x53a6('0xa')](_0x53a6('0xe'),auth[_0x53a6('0xf')](),controller['show']);router[_0x53a6('0xa')](_0x53a6('0x10'),auth[_0x53a6('0xf')](),controller[_0x53a6('0x11')]);router['get'](_0x53a6('0x12'),auth[_0x53a6('0xb')](),controller[_0x53a6('0x13')]);router[_0x53a6('0xa')](_0x53a6('0x14'),auth[_0x53a6('0xf')](),controller['getMyMessages']);router[_0x53a6('0xa')](_0x53a6('0x15'),auth[_0x53a6('0xb')](),controller[_0x53a6('0x16')]);router[_0x53a6('0x17')]('/',auth[_0x53a6('0xb')](),controller[_0x53a6('0x18')]);router[_0x53a6('0x17')](_0x53a6('0x19'),auth[_0x53a6('0xb')](),controller[_0x53a6('0x1a')]);var upload=multer({'storage':multer[_0x53a6('0x1b')]({'destination':function(_0x3bd931,_0x2781f3,_0x4705d0){_0x4705d0(null,path[_0x53a6('0x1c')](config['root'],'server/files/attachments/'));},'filename':function(_0x1a80d2,_0x2be374,_0x55d761){_0x55d761(null,util[_0x53a6('0x1d')]('%s-%s',Date['now'](),_0x2be374['originalname'][_0x53a6('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x53a6('0x17')]('/:id/attachment_upload',upload[_0x53a6('0x1f')](_0x53a6('0x20')),controller[_0x53a6('0x21')]);router[_0x53a6('0x17')](_0x53a6('0x12'),auth[_0x53a6('0xf')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x53a6('0xb')](),interaction[_0x53a6('0x22')](_0x53a6('0x23'),_0x53a6('0x24')),controller[_0x53a6('0x25')]);router[_0x53a6('0x26')](_0x53a6('0xe'),auth[_0x53a6('0xb')](),interaction[_0x53a6('0x22')](_0x53a6('0x23'),_0x53a6('0x27')),controller[_0x53a6('0x28')]);router['put'](_0x53a6('0x29'),controller[_0x53a6('0x2a')]);router[_0x53a6('0x26')](_0x53a6('0x2b'),auth[_0x53a6('0xf')](),controller[_0x53a6('0x2c')]);router[_0x53a6('0x26')](_0x53a6('0x2d'),controller[_0x53a6('0x2e')]);router[_0x53a6('0x2f')](_0x53a6('0xe'),auth[_0x53a6('0xb')](),interaction[_0x53a6('0x22')](_0x53a6('0x23'),_0x53a6('0x30')),controller[_0x53a6('0x31')]);router['delete'](_0x53a6('0x32'),auth['isAuthenticated'](),controller[_0x53a6('0x33')]);module[_0x53a6('0x34')]=router;
\ No newline at end of file
+var _0x50d7=['/:id/vidaoo','createVidaooSession','diskStorage','join','root','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','tracked','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','fs-extra','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/my_messages','getMyMessages','/:id/download','download','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50d7,0x114));var _0x750d=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x50d7[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x750d('0x0'));var util=require(_0x750d('0x1'));var path=require(_0x750d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x750d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x750d('0x4'));var config=require('../../config/environment');var controller=require(_0x750d('0x5'));router[_0x750d('0x6')]('/',auth[_0x750d('0x7')](),controller[_0x750d('0x8')]);router[_0x750d('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x750d('0x6')](_0x750d('0x9'),auth[_0x750d('0xa')](),controller[_0x750d('0xb')]);router['get']('/:id/attachment_download',auth[_0x750d('0xa')](),controller[_0x750d('0xc')]);router[_0x750d('0x6')]('/:id/messages',auth[_0x750d('0x7')](),controller['getMessages']);router['get'](_0x750d('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x750d('0xe')]);router['get'](_0x750d('0xf'),auth['isAuthenticated'](),controller[_0x750d('0x10')]);router['post']('/',auth[_0x750d('0x7')](),controller['create']);router[_0x750d('0x11')](_0x750d('0x12'),auth[_0x750d('0x7')](),controller[_0x750d('0x13')]);var upload=multer({'storage':multer[_0x750d('0x14')]({'destination':function(_0x5c44e4,_0x336409,_0x27623b){_0x27623b(null,path[_0x750d('0x15')](config[_0x750d('0x16')],'server/files/attachments/'));},'filename':function(_0x376a02,_0x309ef3,_0x155a47){_0x155a47(null,util['format'](_0x750d('0x17'),Date['now'](),_0x309ef3[_0x750d('0x18')][_0x750d('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x750d('0x11')](_0x750d('0x1a'),upload[_0x750d('0x1b')](_0x750d('0x1c')),controller[_0x750d('0x1d')]);router[_0x750d('0x11')]('/:id/messages',auth[_0x750d('0xa')](),controller[_0x750d('0x1e')]);router[_0x750d('0x11')](_0x750d('0x1f'),auth[_0x750d('0x7')](),interaction['tracked'](_0x750d('0x20'),_0x750d('0x21')),controller[_0x750d('0x22')]);router[_0x750d('0x23')](_0x750d('0x9'),auth[_0x750d('0x7')](),interaction['tracked'](_0x750d('0x20'),_0x750d('0x24')),controller[_0x750d('0x25')]);router['put'](_0x750d('0x26'),controller[_0x750d('0x27')]);router[_0x750d('0x23')](_0x750d('0x28'),auth['isChatInteractionAuthorized'](),controller[_0x750d('0x29')]);router[_0x750d('0x23')](_0x750d('0x2a'),controller['close']);router[_0x750d('0x2b')]('/:id',auth['isAuthenticated'](),interaction[_0x750d('0x2c')](_0x750d('0x20'),_0x750d('0x2d')),controller[_0x750d('0x2e')]);router[_0x750d('0x2b')]('/:id/tags',auth[_0x750d('0x7')](),controller[_0x750d('0x2f')]);module[_0x750d('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index cab170a..3869130 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 _0x82f0=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x82f0,0x72));var _0x082f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x82f0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x082f('0x0'));module[_0x082f('0x1')]={'body':{'type':Sequelize[_0x082f('0x2')](_0x082f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x082f('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x082f('0x5')]}};
\ No newline at end of file
+var _0xb57b=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xb57b,0x17c));var _0xbb57=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xb57b[_0x37bd26];return _0xe83dc4;};'use strict';var Sequelize=require(_0xbb57('0x0'));module[_0xbb57('0x1')]={'body':{'type':Sequelize[_0xbb57('0x2')](_0xbb57('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbb57('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xbb57('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 4f4ad4b..56df9b1 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 _0x3789=['UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','query','sort','where','pick','filter','merge','options','include','rows','catch','params','find','create','body','describe','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x2f3f96,_0x1c0d73){var _0x51f17b=function(_0x3300af){while(--_0x3300af){_0x2f3f96['push'](_0x2f3f96['shift']());}};_0x51f17b(++_0x1c0d73);}(_0x3789,0x7d));var _0x9378=function(_0x18c612,_0x59b9e4){_0x18c612=_0x18c612-0x0;var _0x1c3d83=_0x3789[_0x18c612];return _0x1c3d83;};'use strict';var emlformat=require(_0x9378('0x0'));var rimraf=require(_0x9378('0x1'));var zipdir=require(_0x9378('0x2'));var jsonpatch=require(_0x9378('0x3'));var rp=require('request-promise');var moment=require(_0x9378('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9378('0x5'));var util=require(_0x9378('0x6'));var path=require('path');var sox=require(_0x9378('0x7'));var csv=require(_0x9378('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9378('0x9'));var _=require(_0x9378('0xa'));var squel=require(_0x9378('0xb'));var crypto=require(_0x9378('0xc'));var jsforce=require(_0x9378('0xd'));var deskjs=require(_0x9378('0xe'));var toCsv=require(_0x9378('0x8'));var querystring=require(_0x9378('0xf'));var Papa=require(_0x9378('0x10'));var Redis=require(_0x9378('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9378('0x12'));var logger=require('../../config/logger')(_0x9378('0x13'));var utils=require(_0x9378('0x14'));var config=require(_0x9378('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9378('0x16'))['db'];config['redis']=_[_0x9378('0x17')](config[_0x9378('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9378('0x19'))(new Redis(config[_0x9378('0x18')]));require(_0x9378('0x1a'))[_0x9378('0x1b')](socket);function respondWithStatusCode(_0x1e85bc,_0x411773){_0x411773=_0x411773||0xcc;return function(_0x2d726f){if(_0x2d726f){return _0x1e85bc[_0x9378('0x1c')](_0x411773);}return _0x1e85bc['status'](_0x411773)[_0x9378('0x1d')]();};}function respondWithResult(_0x318f49,_0xea40e0){_0xea40e0=_0xea40e0||0xc8;return function(_0x4318c8){if(_0x4318c8){return _0x318f49['status'](_0xea40e0)[_0x9378('0x1e')](_0x4318c8);}};}function respondWithFilteredResult(_0x29ac3c,_0x5ee91a){return function(_0x2f2ab3){if(_0x2f2ab3){var _0x58fbdf=typeof _0x5ee91a[_0x9378('0x1f')]===_0x9378('0x20')&&typeof _0x5ee91a[_0x9378('0x21')]===_0x9378('0x20');var _0x30af3d=_0x2f2ab3[_0x9378('0x22')];var _0x105161=_0x58fbdf?0x0:_0x5ee91a['offset'];var _0x4bee3e=_0x58fbdf?_0x2f2ab3[_0x9378('0x22')]:_0x5ee91a['offset']+_0x5ee91a['limit'];var _0x5aa924;if(_0x4bee3e>=_0x30af3d){_0x4bee3e=_0x30af3d;_0x5aa924=0xc8;}else{_0x5aa924=0xce;}_0x29ac3c[_0x9378('0x23')](_0x5aa924);return _0x29ac3c[_0x9378('0x24')](_0x9378('0x25'),_0x105161+'-'+_0x4bee3e+'/'+_0x30af3d)[_0x9378('0x1e')](_0x2f2ab3);}return null;};}function patchUpdates(_0x3fc6e9){return function(_0x1b9747){try{jsonpatch[_0x9378('0x26')](_0x1b9747,_0x3fc6e9,!![]);}catch(_0x456491){return BPromise[_0x9378('0x27')](_0x456491);}return _0x1b9747['save']();};}function saveUpdates(_0x49d6bc,_0x47fa3c){return function(_0x1d8b07){if(_0x1d8b07){return _0x1d8b07[_0x9378('0x28')](_0x49d6bc)[_0x9378('0x29')](function(_0x5f2347){return _0x5f2347;});}return null;};}function removeEntity(_0x5983c9,_0x4a0c14){return function(_0x4285e1){if(_0x4285e1){return _0x4285e1[_0x9378('0x2a')]()[_0x9378('0x29')](function(){_0x5983c9[_0x9378('0x23')](0xcc)[_0x9378('0x1d')]();});}};}function handleEntityNotFound(_0x3f3be3,_0x507c80){return function(_0xcf2774){if(!_0xcf2774){_0x3f3be3[_0x9378('0x1c')](0x194);}return _0xcf2774;};}function handleError(_0x421fdb,_0x2a0754){_0x2a0754=_0x2a0754||0x1f4;return function(_0x6dadb6){logger[_0x9378('0x2b')](_0x6dadb6[_0x9378('0x2c')]);if(_0x6dadb6[_0x9378('0x2d')]){delete _0x6dadb6[_0x9378('0x2d')];}_0x421fdb['status'](_0x2a0754)[_0x9378('0x2e')](_0x6dadb6);};}exports[_0x9378('0x2f')]=function(_0x14fad0,_0x3e855b){var _0x5aa7eb={},_0x4a3b72={},_0x521c08={'count':0x0,'rows':[]};var _0x3dec3c=_[_0x9378('0x30')](db[_0x9378('0x31')][_0x9378('0x32')],function(_0x472909){return{'name':_0x472909[_0x9378('0x33')],'type':_0x472909[_0x9378('0x34')][_0x9378('0x35')]};});_0x4a3b72[_0x9378('0x36')]=_[_0x9378('0x30')](_0x3dec3c,_0x9378('0x2d'));_0x4a3b72['query']=_[_0x9378('0x37')](_0x14fad0['query']);_0x4a3b72[_0x9378('0x38')]=_[_0x9378('0x39')](_0x4a3b72[_0x9378('0x36')],_0x4a3b72['query']);_0x5aa7eb['attributes']=_[_0x9378('0x39')](_0x4a3b72['model'],qs[_0x9378('0x3a')](_0x14fad0['query'][_0x9378('0x3a')]));_0x5aa7eb[_0x9378('0x3b')]=_0x5aa7eb[_0x9378('0x3b')][_0x9378('0x3c')]?_0x5aa7eb[_0x9378('0x3b')]:_0x4a3b72[_0x9378('0x36')];if(!_0x14fad0['query'][_0x9378('0x3d')](_0x9378('0x3e'))){_0x5aa7eb[_0x9378('0x21')]=qs[_0x9378('0x21')](_0x14fad0[_0x9378('0x3f')][_0x9378('0x21')]);_0x5aa7eb['offset']=qs[_0x9378('0x1f')](_0x14fad0[_0x9378('0x3f')][_0x9378('0x1f')]);}_0x5aa7eb['order']=qs[_0x9378('0x40')](_0x14fad0[_0x9378('0x3f')][_0x9378('0x40')]);_0x5aa7eb[_0x9378('0x41')]=qs[_0x9378('0x38')](_[_0x9378('0x42')](_0x14fad0[_0x9378('0x3f')],_0x4a3b72[_0x9378('0x38')]),_0x3dec3c);if(_0x14fad0[_0x9378('0x3f')][_0x9378('0x43')]){_0x5aa7eb[_0x9378('0x41')]=_[_0x9378('0x44')](_0x5aa7eb['where'],{'$or':_[_0x9378('0x30')](_0x3dec3c,function(_0x3817c4){if(_0x3817c4['type']!=='VIRTUAL'){var _0x547f94={};_0x547f94[_0x3817c4[_0x9378('0x2d')]]={'$like':'%'+_0x14fad0[_0x9378('0x3f')][_0x9378('0x43')]+'%'};return _0x547f94;}})});}_0x5aa7eb=_[_0x9378('0x44')]({},_0x5aa7eb,_0x14fad0[_0x9378('0x45')]);var _0x2f038b={'where':_0x5aa7eb[_0x9378('0x41')]};return db[_0x9378('0x31')]['count'](_0x2f038b)[_0x9378('0x29')](function(_0x5caae0){_0x521c08['count']=_0x5caae0;if(_0x14fad0[_0x9378('0x3f')]['includeAll']){_0x5aa7eb[_0x9378('0x46')]=[{'all':!![]}];}return db[_0x9378('0x31')]['findAll'](_0x5aa7eb);})[_0x9378('0x29')](function(_0x57a050){_0x521c08[_0x9378('0x47')]=_0x57a050;return _0x521c08;})[_0x9378('0x29')](respondWithFilteredResult(_0x3e855b,_0x5aa7eb))[_0x9378('0x48')](handleError(_0x3e855b,null));};exports['show']=function(_0x339e93,_0x86cf1f){var _0xe71abc={'raw':!![],'where':{'id':_0x339e93[_0x9378('0x49')]['id']}},_0x3b420f={};_0x3b420f[_0x9378('0x36')]=_[_0x9378('0x37')](db[_0x9378('0x31')][_0x9378('0x32')]);_0x3b420f['query']=_[_0x9378('0x37')](_0x339e93['query']);_0x3b420f[_0x9378('0x38')]=_[_0x9378('0x39')](_0x3b420f['model'],_0x3b420f[_0x9378('0x3f')]);_0xe71abc[_0x9378('0x3b')]=_[_0x9378('0x39')](_0x3b420f[_0x9378('0x36')],qs[_0x9378('0x3a')](_0x339e93[_0x9378('0x3f')][_0x9378('0x3a')]));_0xe71abc[_0x9378('0x3b')]=_0xe71abc['attributes']['length']?_0xe71abc[_0x9378('0x3b')]:_0x3b420f[_0x9378('0x36')];if(_0x339e93['query']['includeAll']){_0xe71abc[_0x9378('0x46')]=[{'all':!![]}];}_0xe71abc=_[_0x9378('0x44')]({},_0xe71abc,_0x339e93['options']);return db[_0x9378('0x31')][_0x9378('0x4a')](_0xe71abc)['then'](handleEntityNotFound(_0x86cf1f,null))[_0x9378('0x29')](respondWithResult(_0x86cf1f,null))['catch'](handleError(_0x86cf1f,null));};exports[_0x9378('0x4b')]=function(_0x21c262,_0x548f5e){return db[_0x9378('0x31')]['create'](_0x21c262[_0x9378('0x4c')],{})[_0x9378('0x29')](respondWithResult(_0x548f5e,0xc9))[_0x9378('0x48')](handleError(_0x548f5e,null));};exports[_0x9378('0x28')]=function(_0x25ed6b,_0x183a91){if(_0x25ed6b[_0x9378('0x4c')]['id']){delete _0x25ed6b[_0x9378('0x4c')]['id'];}return db[_0x9378('0x31')][_0x9378('0x4a')]({'where':{'id':_0x25ed6b[_0x9378('0x49')]['id']}})[_0x9378('0x29')](handleEntityNotFound(_0x183a91,null))[_0x9378('0x29')](saveUpdates(_0x25ed6b[_0x9378('0x4c')],null))[_0x9378('0x29')](respondWithResult(_0x183a91,null))[_0x9378('0x48')](handleError(_0x183a91,null));};exports[_0x9378('0x2a')]=function(_0x4c9c05,_0x79bded){return db['ChatInternalMessage'][_0x9378('0x4a')]({'where':{'id':_0x4c9c05[_0x9378('0x49')]['id']}})[_0x9378('0x29')](handleEntityNotFound(_0x79bded,null))[_0x9378('0x29')](removeEntity(_0x79bded,null))[_0x9378('0x48')](handleError(_0x79bded,null));};exports[_0x9378('0x4d')]=function(_0x469a4c,_0x498b26){return db[_0x9378('0x31')][_0x9378('0x4d')]()[_0x9378('0x29')](respondWithResult(_0x498b26,null))[_0x9378('0x48')](handleError(_0x498b26,null));};function wrapUser(_0xabc1e0){return function(_0x72ed42){var _0x30cd0f=_0xabc1e0['get']({'plain':!![]});_0x30cd0f['messages']=[];if(_0x72ed42){_0x30cd0f[_0x9378('0x4e')]=_0x72ed42[_0x9378('0x4f')];_0x30cd0f['lastMessage']=_0x72ed42;}else{_0x30cd0f[_0x9378('0x4e')]=moment(0x0)[_0x9378('0x50')](_0x9378('0x51'));_0x30cd0f[_0x9378('0x52')]={};}return _0x30cd0f;};}exports[_0x9378('0x53')]=function(_0x2fc4cf,_0x1bfe41,_0x643dce){var _0x4bb1db=[];return db[_0x9378('0x54')][_0x9378('0x55')]({'where':{'role':[_0x9378('0x56'),_0x9378('0x57'),_0x9378('0x58')]},'attributes':['id',_0x9378('0x59'),_0x9378('0x2d'),_0x9378('0x5a'),_0x9378('0x5b'),_0x9378('0x5c'),_0x9378('0x5d'),_0x9378('0x5e'),'allowmessenger',_0x9378('0x5f')],'order':qs[_0x9378('0x40')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x9378('0x60'),'attributes':['id','name',_0x9378('0x34')],'through':{'attributes':[]}}]})[_0x9378('0x29')](function(_0xede5cf){if(_0xede5cf){var _0x19c310=_0x2fc4cf[_0x9378('0x58')][_0x9378('0x61')]({'plain':!![]});if(!_0x19c310)throw new Error(_0x9378('0x62'));if(_0x19c310[_0x9378('0x5a')]===_0x9378('0x58')){return db[_0x9378('0x63')][_0x9378('0x4a')]({'where':{'name':_0x9378('0x64'),'userProfileId':_0x19c310[_0x9378('0x65')]},'raw':!![]})[_0x9378('0x29')](function(_0x4823fc){if(_0x4823fc){if(_0x4823fc['autoAssociation']===0x0){return db[_0x9378('0x66')]['findAll']({'where':{'sectionId':_0x4823fc['id']},'raw':!![]})[_0x9378('0x29')](function(_0x28a5e7){var _0x434fc9=[];if(_[_0x9378('0x67')](_0x28a5e7)){_0x434fc9=_[_0x9378('0x43')](_0xede5cf,function(_0x5c474a){if(_0x5c474a[_0x9378('0x5a')]!==_0x9378('0x56')){return _0x5c474a;}});return _0x434fc9;}else{for(var _0x4a5804=0x0;_0x4a5804<_0xede5cf['length'];_0x4a5804++){var _0xad7b39=_0xede5cf[_0x4a5804];if(_0xad7b39[_0x9378('0x5a')]==='agent'){var _0x7c5111=_[_0x9378('0x4a')](_0x28a5e7,function(_0x3ebc74){return _0x3ebc74[_0x9378('0x68')]===_0xad7b39['id'];});if(_0x7c5111)_0x434fc9[_0x9378('0x69')](_0xad7b39);}else{_0x434fc9[_0x9378('0x69')](_0xad7b39);}}return _0x434fc9;}});}else{return _0xede5cf;}}else{var _0x3475fb=_[_0x9378('0x43')](_0xede5cf,function(_0x388370){if(_0x388370[_0x9378('0x5a')]!==_0x9378('0x56')){return _0x388370;}});return _0x3475fb;}});}else{return _0xede5cf;}}})[_0x9378('0x29')](function(_0x39a4d9){var _0x5e8f85=[];if(_0x39a4d9){_0x4bb1db=_0x39a4d9;for(var _0x39782d=0x0;_0x39782d<_0x39a4d9[_0x9378('0x3c')];_0x39782d+=0x1){_0x4bb1db[_0x39782d][_0x9378('0x6a')]=[];_0x5e8f85[_0x9378('0x69')](db[_0x9378('0x31')][_0x9378('0x4a')]({'where':{'FromId':[_0x2fc4cf['user']['id'],_0x39a4d9[_0x39782d]['id']],'ToId':[_0x2fc4cf[_0x9378('0x58')]['id'],_0x39a4d9[_0x39782d]['id']],'ChatGroupId':null},'attributes':['id',_0x9378('0x4f'),_0x9378('0x6b'),_0x9378('0x6c'),_0x9378('0x6d'),_0x9378('0x4c')],'order':qs[_0x9378('0x40')](_0x9378('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9378('0x29')](wrapUser(_0x39a4d9[_0x39782d])));}return BPromise[_0x9378('0x6f')](_0x5e8f85);}return[];})[_0x9378('0x29')](function(_0x93ea40){return{'rows':_0x93ea40,'count':_0x93ea40[_0x9378('0x3c')]};})[_0x9378('0x29')](respondWithResult(_0x1bfe41,null))[_0x9378('0x48')](handleError(_0x1bfe41,null));};
\ No newline at end of file
+var _0xa8d4=['fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','end','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','eml-format','zip-dir','moment','bluebird','mustache','util','sox','ejs'];(function(_0x46760b,_0x8f72d3){var _0x1e632c=function(_0x337312){while(--_0x337312){_0x46760b['push'](_0x46760b['shift']());}};_0x1e632c(++_0x8f72d3);}(_0xa8d4,0x145));var _0x4a8d=function(_0x9be28f,_0x231334){_0x9be28f=_0x9be28f-0x0;var _0xa9f52d=_0xa8d4[_0x9be28f];return _0xa9f52d;};'use strict';var emlformat=require(_0x4a8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a8d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4a8d('0x2'));var BPromise=require(_0x4a8d('0x3'));var Mustache=require(_0x4a8d('0x4'));var util=require(_0x4a8d('0x5'));var path=require('path');var sox=require(_0x4a8d('0x6'));var csv=require('to-csv');var ejs=require(_0x4a8d('0x7'));var fs=require('fs');var fs_extra=require(_0x4a8d('0x8'));var _=require(_0x4a8d('0x9'));var squel=require(_0x4a8d('0xa'));var crypto=require(_0x4a8d('0xb'));var jsforce=require(_0x4a8d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4a8d('0xd'));var querystring=require(_0x4a8d('0xe'));var Papa=require(_0x4a8d('0xf'));var Redis=require(_0x4a8d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4a8d('0x11'));var as=require(_0x4a8d('0x12'));var hardwareService=require(_0x4a8d('0x13'));var logger=require(_0x4a8d('0x14'))(_0x4a8d('0x15'));var utils=require(_0x4a8d('0x16'));var config=require(_0x4a8d('0x17'));var licenseUtil=require(_0x4a8d('0x18'));var db=require(_0x4a8d('0x19'))['db'];config['redis']=_['defaults'](config[_0x4a8d('0x1a')],{'host':_0x4a8d('0x1b'),'port':0x18eb});var socket=require(_0x4a8d('0x1c'))(new Redis(config[_0x4a8d('0x1a')]));require(_0x4a8d('0x1d'))[_0x4a8d('0x1e')](socket);function respondWithStatusCode(_0x2f0453,_0xc405da){_0xc405da=_0xc405da||0xcc;return function(_0x163ca1){if(_0x163ca1){return _0x2f0453[_0x4a8d('0x1f')](_0xc405da);}return _0x2f0453[_0x4a8d('0x20')](_0xc405da)['end']();};}function respondWithResult(_0xe30a44,_0x4e2a6c){_0x4e2a6c=_0x4e2a6c||0xc8;return function(_0x361360){if(_0x361360){return _0xe30a44['status'](_0x4e2a6c)[_0x4a8d('0x21')](_0x361360);}};}function respondWithFilteredResult(_0x20e77a,_0x45cd9b){return function(_0x56245d){if(_0x56245d){var _0x4b0492=typeof _0x45cd9b[_0x4a8d('0x22')]===_0x4a8d('0x23')&&typeof _0x45cd9b[_0x4a8d('0x24')]==='undefined';var _0xd5680c=_0x56245d[_0x4a8d('0x25')];var _0x3a3fdf=_0x4b0492?0x0:_0x45cd9b[_0x4a8d('0x22')];var _0x5c02af=_0x4b0492?_0x56245d['count']:_0x45cd9b[_0x4a8d('0x22')]+_0x45cd9b[_0x4a8d('0x24')];var _0x74aab3;if(_0x5c02af>=_0xd5680c){_0x5c02af=_0xd5680c;_0x74aab3=0xc8;}else{_0x74aab3=0xce;}_0x20e77a['status'](_0x74aab3);return _0x20e77a[_0x4a8d('0x26')]('Content-Range',_0x3a3fdf+'-'+_0x5c02af+'/'+_0xd5680c)['json'](_0x56245d);}return null;};}function patchUpdates(_0x1675ff){return function(_0x33a592){try{jsonpatch[_0x4a8d('0x27')](_0x33a592,_0x1675ff,!![]);}catch(_0x4d889d){return BPromise['reject'](_0x4d889d);}return _0x33a592['save']();};}function saveUpdates(_0x1a6797,_0x185a80){return function(_0x55ba52){if(_0x55ba52){return _0x55ba52[_0x4a8d('0x28')](_0x1a6797)[_0x4a8d('0x29')](function(_0x383156){return _0x383156;});}return null;};}function removeEntity(_0x33c0d5,_0x303347){return function(_0xe74964){if(_0xe74964){return _0xe74964['destroy']()[_0x4a8d('0x29')](function(){_0x33c0d5[_0x4a8d('0x20')](0xcc)[_0x4a8d('0x2a')]();});}};}function handleEntityNotFound(_0x537784,_0x39c3b7){return function(_0x433b27){if(!_0x433b27){_0x537784['sendStatus'](0x194);}return _0x433b27;};}function handleError(_0x327cfc,_0x3f468b){_0x3f468b=_0x3f468b||0x1f4;return function(_0xe9cc35){logger['error'](_0xe9cc35[_0x4a8d('0x2b')]);if(_0xe9cc35[_0x4a8d('0x2c')]){delete _0xe9cc35[_0x4a8d('0x2c')];}_0x327cfc[_0x4a8d('0x20')](_0x3f468b)[_0x4a8d('0x2d')](_0xe9cc35);};}exports[_0x4a8d('0x2e')]=function(_0x2634ad,_0x1da09){var _0x489042={},_0x8bac1d={},_0x2fb848={'count':0x0,'rows':[]};var _0x5ef3ce=_['map'](db[_0x4a8d('0x2f')][_0x4a8d('0x30')],function(_0x95f5){return{'name':_0x95f5[_0x4a8d('0x31')],'type':_0x95f5[_0x4a8d('0x32')][_0x4a8d('0x33')]};});_0x8bac1d['model']=_[_0x4a8d('0x34')](_0x5ef3ce,_0x4a8d('0x2c'));_0x8bac1d[_0x4a8d('0x35')]=_['keys'](_0x2634ad[_0x4a8d('0x35')]);_0x8bac1d[_0x4a8d('0x36')]=_[_0x4a8d('0x37')](_0x8bac1d[_0x4a8d('0x38')],_0x8bac1d[_0x4a8d('0x35')]);_0x489042[_0x4a8d('0x39')]=_[_0x4a8d('0x37')](_0x8bac1d[_0x4a8d('0x38')],qs[_0x4a8d('0x3a')](_0x2634ad[_0x4a8d('0x35')]['fields']));_0x489042['attributes']=_0x489042['attributes']['length']?_0x489042[_0x4a8d('0x39')]:_0x8bac1d[_0x4a8d('0x38')];if(!_0x2634ad[_0x4a8d('0x35')][_0x4a8d('0x3b')]('nolimit')){_0x489042['limit']=qs['limit'](_0x2634ad[_0x4a8d('0x35')][_0x4a8d('0x24')]);_0x489042[_0x4a8d('0x22')]=qs['offset'](_0x2634ad[_0x4a8d('0x35')][_0x4a8d('0x22')]);}_0x489042[_0x4a8d('0x3c')]=qs[_0x4a8d('0x3d')](_0x2634ad[_0x4a8d('0x35')][_0x4a8d('0x3d')]);_0x489042[_0x4a8d('0x3e')]=qs[_0x4a8d('0x36')](_[_0x4a8d('0x3f')](_0x2634ad[_0x4a8d('0x35')],_0x8bac1d[_0x4a8d('0x36')]),_0x5ef3ce);if(_0x2634ad[_0x4a8d('0x35')][_0x4a8d('0x40')]){_0x489042[_0x4a8d('0x3e')]=_[_0x4a8d('0x41')](_0x489042[_0x4a8d('0x3e')],{'$or':_['map'](_0x5ef3ce,function(_0x354cba){if(_0x354cba['type']!==_0x4a8d('0x42')){var _0x252d47={};_0x252d47[_0x354cba['name']]={'$like':'%'+_0x2634ad[_0x4a8d('0x35')]['filter']+'%'};return _0x252d47;}})});}_0x489042=_[_0x4a8d('0x41')]({},_0x489042,_0x2634ad[_0x4a8d('0x43')]);var _0x1a7b1a={'where':_0x489042[_0x4a8d('0x3e')]};return db[_0x4a8d('0x2f')]['count'](_0x1a7b1a)[_0x4a8d('0x29')](function(_0x50eb3f){_0x2fb848[_0x4a8d('0x25')]=_0x50eb3f;if(_0x2634ad[_0x4a8d('0x35')][_0x4a8d('0x44')]){_0x489042[_0x4a8d('0x45')]=[{'all':!![]}];}return db[_0x4a8d('0x2f')][_0x4a8d('0x46')](_0x489042);})[_0x4a8d('0x29')](function(_0x2a94de){_0x2fb848[_0x4a8d('0x47')]=_0x2a94de;return _0x2fb848;})[_0x4a8d('0x29')](respondWithFilteredResult(_0x1da09,_0x489042))[_0x4a8d('0x48')](handleError(_0x1da09,null));};exports[_0x4a8d('0x49')]=function(_0x31b20d,_0x1d9459){var _0x41b5f9={'raw':!![],'where':{'id':_0x31b20d['params']['id']}},_0x51015d={};_0x51015d[_0x4a8d('0x38')]=_[_0x4a8d('0x4a')](db['ChatInternalMessage'][_0x4a8d('0x30')]);_0x51015d[_0x4a8d('0x35')]=_[_0x4a8d('0x4a')](_0x31b20d[_0x4a8d('0x35')]);_0x51015d[_0x4a8d('0x36')]=_[_0x4a8d('0x37')](_0x51015d[_0x4a8d('0x38')],_0x51015d[_0x4a8d('0x35')]);_0x41b5f9['attributes']=_[_0x4a8d('0x37')](_0x51015d[_0x4a8d('0x38')],qs[_0x4a8d('0x3a')](_0x31b20d[_0x4a8d('0x35')][_0x4a8d('0x3a')]));_0x41b5f9[_0x4a8d('0x39')]=_0x41b5f9[_0x4a8d('0x39')][_0x4a8d('0x4b')]?_0x41b5f9['attributes']:_0x51015d['model'];if(_0x31b20d['query'][_0x4a8d('0x44')]){_0x41b5f9['include']=[{'all':!![]}];}_0x41b5f9=_[_0x4a8d('0x41')]({},_0x41b5f9,_0x31b20d['options']);return db[_0x4a8d('0x2f')][_0x4a8d('0x4c')](_0x41b5f9)[_0x4a8d('0x29')](handleEntityNotFound(_0x1d9459,null))['then'](respondWithResult(_0x1d9459,null))[_0x4a8d('0x48')](handleError(_0x1d9459,null));};exports[_0x4a8d('0x4d')]=function(_0xee17d3,_0x726bae){return db[_0x4a8d('0x2f')][_0x4a8d('0x4d')](_0xee17d3[_0x4a8d('0x4e')],{})[_0x4a8d('0x29')](respondWithResult(_0x726bae,0xc9))[_0x4a8d('0x48')](handleError(_0x726bae,null));};exports[_0x4a8d('0x28')]=function(_0x4964aa,_0x1a6698){if(_0x4964aa[_0x4a8d('0x4e')]['id']){delete _0x4964aa[_0x4a8d('0x4e')]['id'];}return db[_0x4a8d('0x2f')][_0x4a8d('0x4c')]({'where':{'id':_0x4964aa['params']['id']}})['then'](handleEntityNotFound(_0x1a6698,null))[_0x4a8d('0x29')](saveUpdates(_0x4964aa['body'],null))[_0x4a8d('0x29')](respondWithResult(_0x1a6698,null))['catch'](handleError(_0x1a6698,null));};exports['destroy']=function(_0x5ab2b1,_0x20313a){return db['ChatInternalMessage'][_0x4a8d('0x4c')]({'where':{'id':_0x5ab2b1[_0x4a8d('0x4f')]['id']}})[_0x4a8d('0x29')](handleEntityNotFound(_0x20313a,null))['then'](removeEntity(_0x20313a,null))[_0x4a8d('0x48')](handleError(_0x20313a,null));};exports[_0x4a8d('0x50')]=function(_0x323846,_0x2cbd6b){return db[_0x4a8d('0x2f')]['describe']()[_0x4a8d('0x29')](respondWithResult(_0x2cbd6b,null))[_0x4a8d('0x48')](handleError(_0x2cbd6b,null));};function wrapUser(_0x49427d){return function(_0x583883){var _0x3e03ef=_0x49427d[_0x4a8d('0x51')]({'plain':!![]});_0x3e03ef[_0x4a8d('0x52')]=[];if(_0x583883){_0x3e03ef['lastMessageAt']=_0x583883[_0x4a8d('0x53')];_0x3e03ef[_0x4a8d('0x54')]=_0x583883;}else{_0x3e03ef[_0x4a8d('0x55')]=moment(0x0)[_0x4a8d('0x56')](_0x4a8d('0x57'));_0x3e03ef['lastMessage']={};}return _0x3e03ef;};}exports[_0x4a8d('0x58')]=function(_0x6c5817,_0x49e090,_0x342a49){var _0x2222ac=[];return db['User']['findAll']({'where':{'role':[_0x4a8d('0x59'),'admin',_0x4a8d('0x5a')]},'attributes':['id',_0x4a8d('0x5b'),'name',_0x4a8d('0x5c'),_0x4a8d('0x5d'),_0x4a8d('0x5e'),'online',_0x4a8d('0x5f'),_0x4a8d('0x60'),_0x4a8d('0x61')],'order':qs[_0x4a8d('0x3d')](_0x4a8d('0x62')),'include':[{'model':db[_0x4a8d('0x63')],'as':_0x4a8d('0x64'),'attributes':['id',_0x4a8d('0x2c'),_0x4a8d('0x32')],'through':{'attributes':[]}}]})[_0x4a8d('0x29')](function(_0x1722f5){if(_0x1722f5){var _0x57fb80=_0x6c5817[_0x4a8d('0x5a')][_0x4a8d('0x51')]({'plain':!![]});if(!_0x57fb80)throw new Error(_0x4a8d('0x65'));if(_0x57fb80[_0x4a8d('0x5c')]===_0x4a8d('0x5a')){return db[_0x4a8d('0x66')][_0x4a8d('0x4c')]({'where':{'name':_0x4a8d('0x67'),'userProfileId':_0x57fb80['userProfileId']},'raw':!![]})[_0x4a8d('0x29')](function(_0x2b7314){if(_0x2b7314){if(_0x2b7314['autoAssociation']===0x0){return db[_0x4a8d('0x68')]['findAll']({'where':{'sectionId':_0x2b7314['id']},'raw':!![]})[_0x4a8d('0x29')](function(_0x14d618){var _0x1c2c29=[];if(_[_0x4a8d('0x69')](_0x14d618)){_0x1c2c29=_[_0x4a8d('0x40')](_0x1722f5,function(_0x308caa){if(_0x308caa['role']!==_0x4a8d('0x59')){return _0x308caa;}});return _0x1c2c29;}else{for(var _0x94807d=0x0;_0x94807d<_0x1722f5[_0x4a8d('0x4b')];_0x94807d++){var _0x521e02=_0x1722f5[_0x94807d];if(_0x521e02[_0x4a8d('0x5c')]===_0x4a8d('0x59')){var _0x19a276=_[_0x4a8d('0x4c')](_0x14d618,function(_0x5355d4){return _0x5355d4[_0x4a8d('0x6a')]===_0x521e02['id'];});if(_0x19a276)_0x1c2c29[_0x4a8d('0x6b')](_0x521e02);}else{_0x1c2c29[_0x4a8d('0x6b')](_0x521e02);}}return _0x1c2c29;}});}else{return _0x1722f5;}}else{var _0x4f8b4a=_[_0x4a8d('0x40')](_0x1722f5,function(_0xf279ee){if(_0xf279ee[_0x4a8d('0x5c')]!=='agent'){return _0xf279ee;}});return _0x4f8b4a;}});}else{return _0x1722f5;}}})['then'](function(_0x4c90f0){var _0x5a8ee8=[];if(_0x4c90f0){_0x2222ac=_0x4c90f0;for(var _0x3a7aa2=0x0;_0x3a7aa2<_0x4c90f0[_0x4a8d('0x4b')];_0x3a7aa2+=0x1){_0x2222ac[_0x3a7aa2][_0x4a8d('0x52')]=[];_0x5a8ee8[_0x4a8d('0x6b')](db[_0x4a8d('0x2f')][_0x4a8d('0x4c')]({'where':{'FromId':[_0x6c5817[_0x4a8d('0x5a')]['id'],_0x4c90f0[_0x3a7aa2]['id']],'ToId':[_0x6c5817['user']['id'],_0x4c90f0[_0x3a7aa2]['id']],'ChatGroupId':null},'attributes':['id',_0x4a8d('0x53'),_0x4a8d('0x6c'),'ToId',_0x4a8d('0x6d'),_0x4a8d('0x4e')],'order':qs[_0x4a8d('0x3d')](_0x4a8d('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4a8d('0x29')](wrapUser(_0x4c90f0[_0x3a7aa2])));}return BPromise['all'](_0x5a8ee8);}return[];})[_0x4a8d('0x29')](function(_0x450519){return{'rows':_0x450519,'count':_0x450519[_0x4a8d('0x4b')]};})[_0x4a8d('0x29')](respondWithResult(_0x49e090,null))[_0x4a8d('0x48')](handleError(_0x49e090,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index c2a83ed..436a0df 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 _0x4ea0=['events','../../mysqldb','ChatInternalMessage','save','update','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4ea0,0x1c7));var _0x04ea=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0x4ea0[_0x190ff6];return _0x5356d2;};'use strict';var EventEmitter=require(_0x04ea('0x0'));var ChatInternalMessage=require(_0x04ea('0x1'))['db'][_0x04ea('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x04ea('0x3'),'afterUpdate':_0x04ea('0x4'),'afterDestroy':_0x04ea('0x5')};function emitEvent(_0x5c0d47){return function(_0x208c50,_0x4e988c,_0x223c46){ChatInternalMessageEvents['emit'](_0x5c0d47+':'+_0x208c50['id'],_0x208c50);ChatInternalMessageEvents[_0x04ea('0x6')](_0x5c0d47,_0x208c50);_0x223c46(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x57d4=['remove','emit','hasOwnProperty','exports','ChatInternalMessage','setMaxListeners'];(function(_0x48bd63,_0x5f8e86){var _0x4eaade=function(_0x5cf196){while(--_0x5cf196){_0x48bd63['push'](_0x48bd63['shift']());}};_0x4eaade(++_0x5f8e86);}(_0x57d4,0x130));var _0x457d=function(_0x2c88cb,_0x5cd141){_0x2c88cb=_0x2c88cb-0x0;var _0x4703b7=_0x57d4[_0x2c88cb];return _0x4703b7;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x457d('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x457d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x457d('0x2')};function emitEvent(_0x592e30){return function(_0x2c21d6,_0x472a03,_0x846aa7){ChatInternalMessageEvents['emit'](_0x592e30+':'+_0x2c21d6['id'],_0x2c21d6);ChatInternalMessageEvents[_0x457d('0x3')](_0x592e30,_0x2c21d6);_0x846aa7(null);};}for(var e in events){if(events[_0x457d('0x4')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x457d('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index e2090a6..6b3951c 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 _0xada6=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','moment','request-promise','rimraf','../../config/environment'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xada6,0x1d5));var _0x6ada=function(_0x4de416,_0x497025){_0x4de416=_0x4de416-0x0;var _0x40a82e=_0xada6[_0x4de416];return _0x40a82e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6ada('0x0'));var BPromise=require('bluebird');var rp=require(_0x6ada('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ada('0x2'));var config=require(_0x6ada('0x3'));var attributes=require(_0x6ada('0x4'));module[_0x6ada('0x5')]=function(_0x252901,_0x1320ea){return _0x252901[_0x6ada('0x6')](_0x6ada('0x7'),attributes,{'tableName':_0x6ada('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ada('0x9'),'collate':_0x6ada('0xa')});};
\ No newline at end of file
+var _0x4c40=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x39fa5a,_0x641751){var _0x231ba6=function(_0x4c0fe5){while(--_0x4c0fe5){_0x39fa5a['push'](_0x39fa5a['shift']());}};_0x231ba6(++_0x641751);}(_0x4c40,0xeb));var _0x04c4=function(_0x48bcb7,_0x482f77){_0x48bcb7=_0x48bcb7-0x0;var _0x3c39a6=_0x4c40[_0x48bcb7];return _0x3c39a6;};'use strict';var _=require(_0x04c4('0x0'));var util=require(_0x04c4('0x1'));var logger=require(_0x04c4('0x2'))(_0x04c4('0x3'));var moment=require(_0x04c4('0x4'));var BPromise=require(_0x04c4('0x5'));var rp=require(_0x04c4('0x6'));var fs=require('fs');var path=require(_0x04c4('0x7'));var rimraf=require(_0x04c4('0x8'));var config=require(_0x04c4('0x9'));var attributes=require(_0x04c4('0xa'));module['exports']=function(_0x546b28,_0x5ee999){return _0x546b28[_0x04c4('0xb')](_0x04c4('0xc'),attributes,{'tableName':_0x04c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x04c4('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 1132d62..e2429dc 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 _0xcc92=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','register','request','then'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0xcc92,0x141));var _0x2cc9=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0xcc92[_0x3a9661];return _0x5bb119;};'use strict';var _=require(_0x2cc9('0x0'));var util=require(_0x2cc9('0x1'));var moment=require(_0x2cc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x2cc9('0x3'));var fs=require('fs');var Redis=require(_0x2cc9('0x4'));var db=require(_0x2cc9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2cc9('0x6'));var config=require(_0x2cc9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cc9('0x8')]['http']({'port':0x232a});config[_0x2cc9('0x9')]=_[_0x2cc9('0xa')](config[_0x2cc9('0x9')],{'host':_0x2cc9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2cc9('0x9')]));require('./chatInternalMessage.socket')[_0x2cc9('0xc')](socket);function respondWithRpcPromise(_0xeff44e,_0x59c85c,_0x4ea8c9){return new BPromise(function(_0x1e3624,_0x3a3edc){return client[_0x2cc9('0xd')](_0xeff44e,_0x4ea8c9)[_0x2cc9('0xe')](function(_0x1f7a50){logger[_0x2cc9('0xf')](_0x2cc9('0x10'),_0x59c85c,_0x2cc9('0x11'));logger[_0x2cc9('0x12')](_0x2cc9('0x13'),_0x59c85c,_0x2cc9('0x11'),JSON[_0x2cc9('0x14')](_0x1f7a50));if(_0x1f7a50['error']){if(_0x1f7a50[_0x2cc9('0x15')][_0x2cc9('0x16')]===0x1f4){logger[_0x2cc9('0x15')](_0x2cc9('0x10'),_0x59c85c,_0x1f7a50['error'][_0x2cc9('0x17')]);return _0x3a3edc(_0x1f7a50[_0x2cc9('0x15')][_0x2cc9('0x17')]);}logger[_0x2cc9('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x59c85c,_0x1f7a50[_0x2cc9('0x15')][_0x2cc9('0x17')]);return _0x1e3624(_0x1f7a50[_0x2cc9('0x15')]['message']);}else{logger[_0x2cc9('0xf')](_0x2cc9('0x10'),_0x59c85c,'request\x20sent');_0x1e3624(_0x1f7a50['result'][_0x2cc9('0x17')]);}})['catch'](function(_0x228cf6){logger['error'](_0x2cc9('0x10'),_0x59c85c,_0x228cf6);_0x3a3edc(_0x228cf6);});});}
\ No newline at end of file
+var _0xf461=['client','http','redis','localhost','register','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf461,0xba));var _0x1f46=function(_0x325d5a,_0xe51a22){_0x325d5a=_0x325d5a-0x0;var _0x1ffeac=_0xf461[_0x325d5a];return _0x1ffeac;};'use strict';var _=require(_0x1f46('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1f46('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1f46('0x2'))(_0x1f46('0x3'));var config=require(_0x1f46('0x4'));var jayson=require(_0x1f46('0x5'));var client=jayson[_0x1f46('0x6')][_0x1f46('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1f46('0x8')],{'host':_0x1f46('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x1f46('0xa')](socket);function respondWithRpcPromise(_0x316199,_0x3f98dd,_0x10091d){return new BPromise(function(_0x3e60d4,_0x40a9bc){return client[_0x1f46('0xb')](_0x316199,_0x10091d)[_0x1f46('0xc')](function(_0x8c143d){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x3f98dd,_0x1f46('0xd'));logger[_0x1f46('0xe')](_0x1f46('0xf'),_0x3f98dd,_0x1f46('0xd'),JSON[_0x1f46('0x10')](_0x8c143d));if(_0x8c143d['error']){if(_0x8c143d[_0x1f46('0x11')][_0x1f46('0x12')]===0x1f4){logger[_0x1f46('0x11')](_0x1f46('0x13'),_0x3f98dd,_0x8c143d[_0x1f46('0x11')][_0x1f46('0x14')]);return _0x40a9bc(_0x8c143d[_0x1f46('0x11')][_0x1f46('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x3f98dd,_0x8c143d[_0x1f46('0x11')][_0x1f46('0x14')]);return _0x3e60d4(_0x8c143d['error']['message']);}else{logger[_0x1f46('0x15')](_0x1f46('0x13'),_0x3f98dd,_0x1f46('0xd'));_0x3e60d4(_0x8c143d[_0x1f46('0x16')]['message']);}})[_0x1f46('0x17')](function(_0x36e39c){logger[_0x1f46('0x11')](_0x1f46('0x13'),_0x3f98dd,_0x36e39c);_0x40a9bc(_0x36e39c);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 18692f6..94acf8a 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 _0x5be7=['emit','removeListener','length','chatInternalMessage:','save','remove'];(function(_0x562914,_0x5d1db2){var _0x5306ec=function(_0x3a7e87){while(--_0x3a7e87){_0x562914['push'](_0x562914['shift']());}};_0x5306ec(++_0x5d1db2);}(_0x5be7,0xb2));var _0x75be=function(_0xa012f7,_0x44d927){_0xa012f7=_0xa012f7-0x0;var _0x3c7e92=_0x5be7[_0xa012f7];return _0x3c7e92;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x75be('0x0'),_0x75be('0x1'),'update'];function createListener(_0x217ede,_0x2675e4){return function(_0x1ecbeb){_0x2675e4[_0x75be('0x2')](_0x217ede,_0x1ecbeb);};}function removeListener(_0x319708,_0x509f2c){return function(){ChatInternalMessageEvents[_0x75be('0x3')](_0x319708,_0x509f2c);};}exports['register']=function(_0x405736){for(var _0x281918=0x0,_0x44de99=events[_0x75be('0x4')];_0x281918<_0x44de99;_0x281918++){var _0x1e26f4=events[_0x281918];var _0x1959a5=createListener(_0x75be('0x5')+_0x1e26f4,_0x405736);ChatInternalMessageEvents['on'](_0x1e26f4,_0x1959a5);}};
\ No newline at end of file
+var _0x87c6=['emit','removeListener','length','./chatInternalMessage.events','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87c6,0xdb));var _0x687c=function(_0xbc5a36,_0x1e5aa1){_0xbc5a36=_0xbc5a36-0x0;var _0x43ccf2=_0x87c6[_0xbc5a36];return _0x43ccf2;};'use strict';var ChatInternalMessageEvents=require(_0x687c('0x0'));var events=[_0x687c('0x1'),_0x687c('0x2'),'update'];function createListener(_0x4977a7,_0xf3f687){return function(_0x1adb2b){_0xf3f687[_0x687c('0x3')](_0x4977a7,_0x1adb2b);};}function removeListener(_0x5d5c0c,_0x253da9){return function(){ChatInternalMessageEvents[_0x687c('0x4')](_0x5d5c0c,_0x253da9);};}exports['register']=function(_0x238104){for(var _0x42eca8=0x0,_0x3be413=events[_0x687c('0x5')];_0x42eca8<_0x3be413;_0x42eca8++){var _0xdbc2c9=events[_0x42eca8];var _0x3c2982=createListener('chatInternalMessage:'+_0xdbc2c9,_0x238104);ChatInternalMessageEvents['on'](_0xdbc2c9,_0x3c2982);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index b05c195..9c21466 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 _0xf759=['path','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete','multer','util'];(function(_0x197ee4,_0xe37cf3){var _0x311891=function(_0x2fe664){while(--_0x2fe664){_0x197ee4['push'](_0x197ee4['shift']());}};_0x311891(++_0xe37cf3);}(_0xf759,0x11b));var _0x9f75=function(_0x524ca0,_0x3252cd){_0x524ca0=_0x524ca0-0x0;var _0x265bdc=_0xf759[_0x524ca0];return _0x265bdc;};'use strict';var multer=require(_0x9f75('0x0'));var util=require(_0x9f75('0x1'));var path=require(_0x9f75('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f75('0x3'));var interaction=require(_0x9f75('0x4'));var config=require('../../config/environment');var controller=require(_0x9f75('0x5'));router[_0x9f75('0x6')]('/',auth[_0x9f75('0x7')](),controller[_0x9f75('0x8')]);router[_0x9f75('0x6')](_0x9f75('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x9f75('0x6')]('/users',auth[_0x9f75('0x7')](),controller['getUsers']);router[_0x9f75('0x6')](_0x9f75('0xa'),auth['isAuthenticated'](),controller[_0x9f75('0xb')]);router['post']('/',auth[_0x9f75('0x7')](),controller[_0x9f75('0xc')]);router[_0x9f75('0xd')](_0x9f75('0xa'),controller['update']);router[_0x9f75('0xe')](_0x9f75('0xa'),auth[_0x9f75('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc874=['post','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show'];(function(_0x10bf5d,_0x10a3a9){var _0x27f511=function(_0x209cf3){while(--_0x209cf3){_0x10bf5d['push'](_0x10bf5d['shift']());}};_0x27f511(++_0x10a3a9);}(_0xc874,0x10e));var _0x4c87=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc874[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x4c87('0x0'));var util=require(_0x4c87('0x1'));var path=require('path');var timeout=require(_0x4c87('0x2'));var express=require(_0x4c87('0x3'));var router=express['Router']();var fs_extra=require(_0x4c87('0x4'));var auth=require(_0x4c87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4c87('0x6'));var controller=require(_0x4c87('0x7'));router[_0x4c87('0x8')]('/',auth[_0x4c87('0x9')](),controller[_0x4c87('0xa')]);router['get']('/describe',auth[_0x4c87('0x9')](),controller[_0x4c87('0xb')]);router[_0x4c87('0x8')](_0x4c87('0xc'),auth[_0x4c87('0x9')](),controller[_0x4c87('0xd')]);router[_0x4c87('0x8')](_0x4c87('0xe'),auth[_0x4c87('0x9')](),controller[_0x4c87('0xf')]);router[_0x4c87('0x10')]('/',auth['isAuthenticated'](),controller[_0x4c87('0x11')]);router[_0x4c87('0x12')](_0x4c87('0xe'),controller[_0x4c87('0x13')]);router['delete'](_0x4c87('0xe'),auth['isAuthenticated'](),controller[_0x4c87('0x14')]);module[_0x4c87('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 a13335d..3b36865 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 _0xd4f4=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x259aaf,_0x5dbec1){var _0x366663=function(_0x24a61a){while(--_0x24a61a){_0x259aaf['push'](_0x259aaf['shift']());}};_0x366663(++_0x5dbec1);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x230dad,_0x23f4fa){_0x230dad=_0x230dad-0x0;var _0xa632ca=_0xd4f4[_0x230dad];return _0xa632ca;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'body':{'type':Sequelize[_0x4d4f('0x2')](_0x4d4f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4d4f('0x5')]('in',_0x4d4f('0x6')),'defaultValue':_0x4d4f('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4d4f('0x7')]},'providerName':{'type':Sequelize[_0x4d4f('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x93e6=['BOOLEAN','out','DATE','TEXT','sequelize','medium'];(function(_0x4aa7eb,_0x5d3857){var _0x97cbb9=function(_0x410d6e){while(--_0x410d6e){_0x4aa7eb['push'](_0x4aa7eb['shift']());}};_0x97cbb9(++_0x5d3857);}(_0x93e6,0x11e));var _0x693e=function(_0xa92ea7,_0x47d6c2){_0xa92ea7=_0xa92ea7-0x0;var _0x2441ff=_0x93e6[_0xa92ea7];return _0x2441ff;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x693e('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x693e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x693e('0x3')),'defaultValue':_0x693e('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x693e('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x693e('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 2601f00..6957df4 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 _0x76c9=['model','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','intersection','length','include','create','body','destroy','describe','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','find','update','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','parse','chat','ChatInteractionId','role','RejectMessage','rejectMessage','QueryTypes','fullname','event','rejectmessage','formData','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','keys','query'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x76c9,0x1de));var _0x976c=function(_0xb42193,_0x2ad6d9){_0xb42193=_0xb42193-0x0;var _0xc55acd=_0x76c9[_0xb42193];return _0xc55acd;};'use strict';var emlformat=require(_0x976c('0x0'));var rimraf=require(_0x976c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x976c('0x2'));var rp=require('request-promise');var moment=require(_0x976c('0x3'));var BPromise=require(_0x976c('0x4'));var Mustache=require(_0x976c('0x5'));var util=require(_0x976c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x976c('0x7'));var ejs=require(_0x976c('0x8'));var fs=require('fs');var fs_extra=require(_0x976c('0x9'));var _=require(_0x976c('0xa'));var squel=require(_0x976c('0xb'));var crypto=require(_0x976c('0xc'));var jsforce=require(_0x976c('0xd'));var deskjs=require(_0x976c('0xe'));var toCsv=require(_0x976c('0x7'));var querystring=require(_0x976c('0xf'));var Papa=require('papaparse');var Redis=require(_0x976c('0x10'));var authService=require(_0x976c('0x11'));var qs=require(_0x976c('0x12'));var as=require(_0x976c('0x13'));var hardwareService=require(_0x976c('0x14'));var logger=require(_0x976c('0x15'))(_0x976c('0x16'));var utils=require('../../config/utils');var config=require(_0x976c('0x17'));var licenseUtil=require(_0x976c('0x18'));var db=require(_0x976c('0x19'))['db'];config[_0x976c('0x1a')]=_[_0x976c('0x1b')](config[_0x976c('0x1a')],{'host':_0x976c('0x1c'),'port':0x18eb});var socket=require(_0x976c('0x1d'))(new Redis(config[_0x976c('0x1a')]));require(_0x976c('0x1e'))[_0x976c('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x976c('0x20')][_0x976c('0x21')]({'port':0x232c});var client9002=jayson[_0x976c('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb56c2b,_0x37b795,_0x157d3a,_0x152027){return new BPromise(function(_0x221e8c,_0x38b0a0){var _0x5c1fd3=_0x152027||client;return _0x5c1fd3['request'](_0xb56c2b,_0x157d3a)[_0x976c('0x22')](function(_0x1829fc){logger[_0x976c('0x23')](_0x976c('0x24'),_0x37b795,_0x976c('0x25'));logger[_0x976c('0x26')](_0x976c('0x27'),_0x37b795,_0x976c('0x25'),JSON[_0x976c('0x28')](_0x1829fc));if(_0x1829fc[_0x976c('0x29')]){if(_0x1829fc['error'][_0x976c('0x2a')]===0x1f4){logger[_0x976c('0x29')](_0x976c('0x24'),_0x37b795,_0x1829fc['error'][_0x976c('0x2b')]);return _0x38b0a0(_0x1829fc[_0x976c('0x29')][_0x976c('0x2b')]);}logger['error'](_0x976c('0x24'),_0x37b795,_0x1829fc[_0x976c('0x29')][_0x976c('0x2b')]);return _0x221e8c(_0x1829fc['error'][_0x976c('0x2b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x37b795,'request\x20sent');_0x221e8c(_0x1829fc[_0x976c('0x2c')]['message']);}})[_0x976c('0x2d')](function(_0x434e0d){logger[_0x976c('0x29')](_0x976c('0x24'),_0x37b795,_0x434e0d);_0x38b0a0(_0x434e0d);});});}function respondWithStatusCode(_0x57a6c6,_0x466e0d){_0x466e0d=_0x466e0d||0xcc;return function(_0x4915ae){if(_0x4915ae){return _0x57a6c6[_0x976c('0x2e')](_0x466e0d);}return _0x57a6c6[_0x976c('0x2f')](_0x466e0d)[_0x976c('0x30')]();};}function respondWithResult(_0x7b7ba1,_0x401c9f){_0x401c9f=_0x401c9f||0xc8;return function(_0x2357b6){if(_0x2357b6){return _0x7b7ba1[_0x976c('0x2f')](_0x401c9f)[_0x976c('0x31')](_0x2357b6);}};}function respondWithFilteredResult(_0xbabcd3,_0x3dc3ba){return function(_0x4f26da){if(_0x4f26da){var _0x5ac8ab=typeof _0x3dc3ba[_0x976c('0x32')]===_0x976c('0x33')&&typeof _0x3dc3ba['limit']==='undefined';var _0x3591f1=_0x4f26da[_0x976c('0x34')];var _0xbb4264=_0x5ac8ab?0x0:_0x3dc3ba[_0x976c('0x32')];var _0x13ccd4=_0x5ac8ab?_0x4f26da[_0x976c('0x34')]:_0x3dc3ba[_0x976c('0x32')]+_0x3dc3ba[_0x976c('0x35')];var _0x80cb60;if(_0x13ccd4>=_0x3591f1){_0x13ccd4=_0x3591f1;_0x80cb60=0xc8;}else{_0x80cb60=0xce;}_0xbabcd3[_0x976c('0x2f')](_0x80cb60);return _0xbabcd3[_0x976c('0x36')](_0x976c('0x37'),_0xbb4264+'-'+_0x13ccd4+'/'+_0x3591f1)[_0x976c('0x31')](_0x4f26da);}return null;};}function patchUpdates(_0x23c5cb){return function(_0x57971d){try{jsonpatch[_0x976c('0x38')](_0x57971d,_0x23c5cb,!![]);}catch(_0x26ef2c){return BPromise['reject'](_0x26ef2c);}return _0x57971d[_0x976c('0x39')]();};}function saveUpdates(_0x5741b6,_0x977e71){return function(_0x3f62d1){if(_0x3f62d1){return _0x3f62d1['update'](_0x5741b6)[_0x976c('0x22')](function(_0x28e1de){return _0x28e1de;});}return null;};}function removeEntity(_0x1d8f9a,_0xba9df3){return function(_0x17b288){if(_0x17b288){return _0x17b288['destroy']()[_0x976c('0x22')](function(){_0x1d8f9a[_0x976c('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36af1b,_0x5e89d9){return function(_0x285bcc){if(!_0x285bcc){_0x36af1b[_0x976c('0x2e')](0x194);}return _0x285bcc;};}function handleError(_0x246a6a,_0x49c6b5){_0x49c6b5=_0x49c6b5||0x1f4;return function(_0x1e988a){logger[_0x976c('0x29')](_0x1e988a[_0x976c('0x3a')]);if(_0x1e988a['name']){delete _0x1e988a[_0x976c('0x3b')];}_0x246a6a[_0x976c('0x2f')](_0x49c6b5)[_0x976c('0x3c')](_0x1e988a);};}exports[_0x976c('0x3d')]=function(_0x4c28a9,_0x4a78b0){var _0x231107={},_0x57d8e1={},_0x57afaa={'count':0x0,'rows':[]};var _0x25eb6d=_[_0x976c('0x3e')](db[_0x976c('0x3f')][_0x976c('0x40')],function(_0x3a1492){return{'name':_0x3a1492[_0x976c('0x41')],'type':_0x3a1492[_0x976c('0x42')][_0x976c('0x43')]};});_0x57d8e1['model']=_[_0x976c('0x3e')](_0x25eb6d,'name');_0x57d8e1['query']=_[_0x976c('0x44')](_0x4c28a9[_0x976c('0x45')]);_0x57d8e1['filters']=_['intersection'](_0x57d8e1['model'],_0x57d8e1['query']);_0x231107['attributes']=_['intersection'](_0x57d8e1[_0x976c('0x46')],qs[_0x976c('0x47')](_0x4c28a9[_0x976c('0x45')][_0x976c('0x47')]));_0x231107[_0x976c('0x48')]=_0x231107[_0x976c('0x48')]['length']?_0x231107[_0x976c('0x48')]:_0x57d8e1['model'];if(!_0x4c28a9[_0x976c('0x45')][_0x976c('0x49')]('nolimit')){_0x231107['limit']=qs[_0x976c('0x35')](_0x4c28a9[_0x976c('0x45')][_0x976c('0x35')]);_0x231107[_0x976c('0x32')]=qs[_0x976c('0x32')](_0x4c28a9[_0x976c('0x45')][_0x976c('0x32')]);}_0x231107[_0x976c('0x4a')]=qs[_0x976c('0x4b')](_0x4c28a9['query'][_0x976c('0x4b')]);_0x231107[_0x976c('0x4c')]=qs[_0x976c('0x4d')](_[_0x976c('0x4e')](_0x4c28a9[_0x976c('0x45')],_0x57d8e1['filters']),_0x25eb6d);if(_0x4c28a9['query'][_0x976c('0x4f')]){_0x231107['where']=_[_0x976c('0x50')](_0x231107['where'],{'$or':_[_0x976c('0x3e')](_0x25eb6d,function(_0x381606){if(_0x381606[_0x976c('0x42')]!==_0x976c('0x51')){var _0x2d37f4={};_0x2d37f4[_0x381606[_0x976c('0x3b')]]={'$like':'%'+_0x4c28a9[_0x976c('0x45')][_0x976c('0x4f')]+'%'};return _0x2d37f4;}})});}_0x231107=_[_0x976c('0x50')]({},_0x231107,_0x4c28a9[_0x976c('0x52')]);var _0x3b53f3={'where':_0x231107[_0x976c('0x4c')]};return db[_0x976c('0x3f')][_0x976c('0x34')](_0x3b53f3)[_0x976c('0x22')](function(_0x44ec9e){_0x57afaa[_0x976c('0x34')]=_0x44ec9e;if(_0x4c28a9[_0x976c('0x45')][_0x976c('0x53')]){_0x231107['include']=[{'all':!![]}];}return db[_0x976c('0x3f')][_0x976c('0x54')](_0x231107);})[_0x976c('0x22')](function(_0x4aac2e){_0x57afaa['rows']=_0x4aac2e;return _0x57afaa;})[_0x976c('0x22')](respondWithFilteredResult(_0x4a78b0,_0x231107))[_0x976c('0x2d')](handleError(_0x4a78b0,null));};exports[_0x976c('0x55')]=function(_0x2ee0fa,_0x2c9c3a){var _0x5deff6={'raw':!![],'where':{'id':_0x2ee0fa[_0x976c('0x56')]['id']}},_0x4e8aa3={};_0x4e8aa3[_0x976c('0x46')]=_[_0x976c('0x44')](db[_0x976c('0x3f')][_0x976c('0x40')]);_0x4e8aa3['query']=_['keys'](_0x2ee0fa[_0x976c('0x45')]);_0x4e8aa3[_0x976c('0x4d')]=_[_0x976c('0x57')](_0x4e8aa3[_0x976c('0x46')],_0x4e8aa3[_0x976c('0x45')]);_0x5deff6[_0x976c('0x48')]=_[_0x976c('0x57')](_0x4e8aa3['model'],qs[_0x976c('0x47')](_0x2ee0fa['query'][_0x976c('0x47')]));_0x5deff6[_0x976c('0x48')]=_0x5deff6[_0x976c('0x48')][_0x976c('0x58')]?_0x5deff6[_0x976c('0x48')]:_0x4e8aa3[_0x976c('0x46')];if(_0x2ee0fa[_0x976c('0x45')]['includeAll']){_0x5deff6[_0x976c('0x59')]=[{'all':!![]}];}_0x5deff6=_[_0x976c('0x50')]({},_0x5deff6,_0x2ee0fa[_0x976c('0x52')]);return db[_0x976c('0x3f')]['find'](_0x5deff6)[_0x976c('0x22')](handleEntityNotFound(_0x2c9c3a,null))[_0x976c('0x22')](respondWithResult(_0x2c9c3a,null))[_0x976c('0x2d')](handleError(_0x2c9c3a,null));};exports[_0x976c('0x5a')]=function(_0x163212,_0x414f9b){return db[_0x976c('0x3f')]['create'](_0x163212['body'],{})['then'](respondWithResult(_0x414f9b,0xc9))[_0x976c('0x2d')](handleError(_0x414f9b,null));};exports['update']=function(_0x31e33a,_0x255909){if(_0x31e33a[_0x976c('0x5b')]['id']){delete _0x31e33a[_0x976c('0x5b')]['id'];}return db[_0x976c('0x3f')]['find']({'where':{'id':_0x31e33a[_0x976c('0x56')]['id']}})[_0x976c('0x22')](handleEntityNotFound(_0x255909,null))['then'](saveUpdates(_0x31e33a[_0x976c('0x5b')],null))[_0x976c('0x22')](respondWithResult(_0x255909,null))[_0x976c('0x2d')](handleError(_0x255909,null));};exports[_0x976c('0x5c')]=function(_0x26e7bf,_0x50b7e6){return db[_0x976c('0x3f')]['find']({'where':{'id':_0x26e7bf[_0x976c('0x56')]['id']}})[_0x976c('0x22')](handleEntityNotFound(_0x50b7e6,null))[_0x976c('0x22')](removeEntity(_0x50b7e6,null))['catch'](handleError(_0x50b7e6,null));};exports[_0x976c('0x5d')]=function(_0x55a16a,_0x42a305){return db[_0x976c('0x3f')][_0x976c('0x5d')]()['then'](respondWithResult(_0x42a305,null))[_0x976c('0x2d')](handleError(_0x42a305,null));};var interaction_log=require(_0x976c('0x15'))(_0x976c('0x5e'));exports['accept']=function(_0x577a2f,_0x2cf036,_0x5acf2f){var _0x311f7b={'agent':{},'channel':'chat'};if(_0x577a2f[_0x976c('0x5b')]['id']){delete _0x577a2f[_0x976c('0x5b')]['id'];}_0x577a2f[_0x976c('0x5b')][_0x976c('0x5f')]=!![];_0x577a2f['body'][_0x976c('0x60')]=moment()[_0x976c('0x61')](_0x976c('0x62'));_0x577a2f[_0x976c('0x5b')][_0x976c('0x63')]=_0x577a2f[_0x976c('0x5b')][_0x976c('0x63')]||_0x577a2f[_0x976c('0x64')]['id'];_0x311f7b[_0x976c('0x65')]['id']=_0x577a2f[_0x976c('0x5b')][_0x976c('0x63')];return db['ChatMessage']['find']({'where':{'id':_0x577a2f[_0x976c('0x56')]['id'],'UserId':null}})[_0x976c('0x22')](handleEntityNotFound(_0x2cf036,null))[_0x976c('0x22')](saveUpdates(_0x577a2f[_0x976c('0x5b')],null))['then'](function(_0x496c2c){if(_0x496c2c){_0x311f7b[_0x976c('0x2b')]=_0x496c2c[_0x976c('0x66')]({'plain':!![]});return db[_0x976c('0x67')][_0x976c('0x68')]({'where':{'id':_0x496c2c['ChatInteractionId']}});}return null;})[_0x976c('0x22')](handleEntityNotFound(_0x2cf036,null))[_0x976c('0x22')](function(_0x7d5087){if(_0x7d5087){return _0x7d5087[_0x976c('0x69')]({'UserId':_0x577a2f[_0x976c('0x5b')]['UserId'],'read1stAt':_[_0x976c('0x6a')](_0x7d5087[_0x976c('0x6b')])?moment()[_0x976c('0x61')](_0x976c('0x62')):undefined});}return null;})[_0x976c('0x22')](function(_0x5620d9){if(_0x5620d9){_0x311f7b['interaction']=_0x5620d9['get']({'plain':!![]});interaction_log[_0x976c('0x23')](_0x976c('0x6c'),_0x577a2f[_0x976c('0x64')]['id'],_0x577a2f[_0x976c('0x64')][_0x976c('0x3b')],_0x577a2f[_0x976c('0x64')]['role'],_0x311f7b[_0x976c('0x6d')]['id'],_0x577a2f[_0x976c('0x5b')]?JSON[_0x976c('0x28')](_0x577a2f[_0x976c('0x5b')]):_0x976c('0x6e'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x311f7b);}return null;})[_0x976c('0x22')](function(_0x59b264){var _0x89e0fa=_0x976c('0x6f')+_0x59b264[_0x976c('0x2b')][_0x976c('0x70')];return db[_0x976c('0x71')]['query'](_0x89e0fa,{'type':db['Sequelize']['QueryTypes'][_0x976c('0x72')],'raw':!![]})[_0x976c('0x22')](function(_0x563f2d){return _0x563f2d;});})['then'](function(_0x260517){if(_0x260517){_0x311f7b[_0x976c('0x2b')][_0x976c('0x73')]=_0x260517[0x0];if(!_0x577a2f[_0x976c('0x5b')][_0x976c('0x63')])return;return db[_0x976c('0x74')][_0x976c('0x68')]({'where':{'id':_0x577a2f[_0x976c('0x5b')][_0x976c('0x63')],'role':_0x976c('0x65')},'attributes':['id',_0x976c('0x3b'),'fullname','email',_0x976c('0x75')],'raw':!![]});}return null;})[_0x976c('0x22')](function(_0x31607b){if(!_0x31607b)return null;_0x311f7b[_0x976c('0x2b')]['agent']=_0x31607b;return _0x311f7b;})['then'](function(_0x5ce2bf){if(_0x5ce2bf){if(_0x577a2f[_0x976c('0x5b')][_0x976c('0x76')]){_0x311f7b[_0x976c('0x2b')][_0x976c('0x77')]=util[_0x976c('0x61')](_0x976c('0x78'),_0x577a2f['user'][_0x976c('0x3b')]);_0x311f7b[_0x976c('0x2b')][_0x976c('0x79')]=_0x311f7b[_0x976c('0x79')];_0x311f7b[_0x976c('0x2b')][_0x976c('0x7a')]=_0x311f7b['channel'];_0x311f7b[_0x976c('0x2b')]['event']=_0x976c('0x7b');return respondWithRpcPromise(_0x976c('0x7c'),_0x976c('0x7c'),{'event':_0x976c('0x7d'),'message':_[_0x976c('0x50')](_0x311f7b['message'],JSON[_0x976c('0x7e')](_0x311f7b[_0x976c('0x6d')]['formData']))},client9002)[_0x976c('0x22')](function(){return _0x311f7b;});}return _0x311f7b;}return null;})[_0x976c('0x22')](respondWithResult(_0x2cf036,null))[_0x976c('0x2d')](handleError(_0x2cf036,null));};var interaction_log=require(_0x976c('0x15'))(_0x976c('0x5e'));exports['reject']=function(_0xe53dd4,_0x52bd30,_0x23f3a3){var _0x254bb2={'agent':{},'channel':_0x976c('0x7f')};if(_0xe53dd4[_0x976c('0x5b')]['id']){delete _0xe53dd4[_0x976c('0x5b')]['id'];}_0xe53dd4[_0x976c('0x5b')][_0x976c('0x63')]=_0xe53dd4[_0x976c('0x5b')][_0x976c('0x63')]||_0xe53dd4[_0x976c('0x64')]['id'];_0x254bb2[_0x976c('0x65')]['id']=_0xe53dd4[_0x976c('0x5b')][_0x976c('0x63')];return db[_0x976c('0x3f')][_0x976c('0x68')]({'where':{'id':_0xe53dd4[_0x976c('0x56')]['id'],'UserId':null}})[_0x976c('0x22')](handleEntityNotFound(_0x52bd30,null))['then'](function(_0x156351){if(_0x156351){_0x254bb2[_0x976c('0x2b')]=_0x156351[_0x976c('0x66')]({'plain':!![]});return db[_0x976c('0x67')]['find']({'where':{'id':_0x156351[_0x976c('0x80')]}});}return null;})[_0x976c('0x22')](handleEntityNotFound(_0x52bd30,null))['then'](function(_0x3eba2a){if(_0x3eba2a){_0x254bb2[_0x976c('0x6d')]=_0x3eba2a[_0x976c('0x66')]({'plain':!![]});interaction_log[_0x976c('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe53dd4[_0x976c('0x64')]['id'],_0xe53dd4[_0x976c('0x64')][_0x976c('0x3b')],_0xe53dd4[_0x976c('0x64')][_0x976c('0x81')],_0x254bb2[_0x976c('0x6d')]['id'],_0xe53dd4[_0x976c('0x5b')]?JSON['stringify'](_0xe53dd4[_0x976c('0x5b')]):_0x976c('0x6e'));return respondWithRpcPromise(_0x976c('0x82'),_0x976c('0x83'),_0x254bb2);}return null;})['then'](function(_0x3f6ab4){var _0xf01b46=_0x976c('0x6f')+_0x3f6ab4[_0x976c('0x2b')][_0x976c('0x70')];return db['sequelize'][_0x976c('0x45')](_0xf01b46,{'type':db['Sequelize'][_0x976c('0x84')][_0x976c('0x72')],'raw':!![]})[_0x976c('0x22')](function(_0x1d75f1){return _0x1d75f1;});})[_0x976c('0x22')](function(_0x19d4ca){if(_0x19d4ca){_0x254bb2[_0x976c('0x2b')][_0x976c('0x73')]=_0x19d4ca[0x0];if(!_0xe53dd4[_0x976c('0x5b')][_0x976c('0x63')])return;return db[_0x976c('0x74')][_0x976c('0x68')]({'where':{'id':_0xe53dd4[_0x976c('0x5b')][_0x976c('0x63')],'role':_0x976c('0x65')},'attributes':['id',_0x976c('0x3b'),_0x976c('0x85'),'email',_0x976c('0x75')],'raw':!![]});}return null;})[_0x976c('0x22')](function(_0x4ddd1c){if(!_0x4ddd1c)return null;_0x254bb2['message'][_0x976c('0x65')]=_0x4ddd1c;return _0x254bb2;})[_0x976c('0x22')](function(_0x5b483a){if(_0x5b483a){_0x5b483a['message'][_0x976c('0x77')]=util[_0x976c('0x61')]('SIP/%s',_0xe53dd4[_0x976c('0x64')][_0x976c('0x3b')]);_0x5b483a[_0x976c('0x2b')][_0x976c('0x79')]=_0x254bb2[_0x976c('0x79')];_0x5b483a[_0x976c('0x2b')][_0x976c('0x7a')]=_0x254bb2[_0x976c('0x79')];_0x5b483a[_0x976c('0x2b')][_0x976c('0x86')]='reject';respondWithRpcPromise('EventManager',_0x976c('0x7c'),{'event':_0x976c('0x87'),'message':_[_0x976c('0x50')](_0x254bb2['message'],JSON['parse'](_0x254bb2[_0x976c('0x6d')][_0x976c('0x88')]))},client9002);return _0x254bb2;}return null;})['then'](respondWithResult(_0x52bd30,null))[_0x976c('0x2d')](handleError(_0x52bd30,null));};
\ No newline at end of file
+var _0x8b98=['get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./chatMessage.socket','jayson/promise','client','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','reject','update','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','sort','where','merge','VIRTUAL','options','includeAll','include','rows','show','find','create','body','destroy','params','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent'];(function(_0x45542e,_0xf51a9f){var _0x447b10=function(_0x7a7d53){while(--_0x7a7d53){_0x45542e['push'](_0x45542e['shift']());}};_0x447b10(++_0xf51a9f);}(_0x8b98,0x1a4));var _0x88b9=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x8b98[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x88b9('0x0'));var rimraf=require(_0x88b9('0x1'));var zipdir=require(_0x88b9('0x2'));var jsonpatch=require(_0x88b9('0x3'));var rp=require(_0x88b9('0x4'));var moment=require(_0x88b9('0x5'));var BPromise=require(_0x88b9('0x6'));var Mustache=require('mustache');var util=require(_0x88b9('0x7'));var path=require(_0x88b9('0x8'));var sox=require(_0x88b9('0x9'));var csv=require('to-csv');var ejs=require(_0x88b9('0xa'));var fs=require('fs');var fs_extra=require(_0x88b9('0xb'));var _=require(_0x88b9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x88b9('0xd'));var querystring=require(_0x88b9('0xe'));var Papa=require(_0x88b9('0xf'));var Redis=require(_0x88b9('0x10'));var authService=require(_0x88b9('0x11'));var qs=require(_0x88b9('0x12'));var as=require(_0x88b9('0x13'));var hardwareService=require(_0x88b9('0x14'));var logger=require(_0x88b9('0x15'))(_0x88b9('0x16'));var utils=require(_0x88b9('0x17'));var config=require(_0x88b9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x88b9('0x19'))['db'];config['redis']=_[_0x88b9('0x1a')](config[_0x88b9('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88b9('0x1b')]));require(_0x88b9('0x1c'))['register'](socket);var jayson=require(_0x88b9('0x1d'));var client=jayson[_0x88b9('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x88b9('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f2387,_0x24cb81,_0x2db9e1,_0x3cae8d){return new BPromise(function(_0x2f39da,_0x18a078){var _0xd596d2=_0x3cae8d||client;return _0xd596d2['request'](_0x5f2387,_0x2db9e1)[_0x88b9('0x1f')](function(_0x36e28d){logger['info']('ChatMessage,\x20%s,\x20%s',_0x24cb81,'request\x20sent');logger[_0x88b9('0x20')](_0x88b9('0x21'),_0x24cb81,_0x88b9('0x22'),JSON[_0x88b9('0x23')](_0x36e28d));if(_0x36e28d[_0x88b9('0x24')]){if(_0x36e28d[_0x88b9('0x24')][_0x88b9('0x25')]===0x1f4){logger[_0x88b9('0x24')](_0x88b9('0x26'),_0x24cb81,_0x36e28d[_0x88b9('0x24')][_0x88b9('0x27')]);return _0x18a078(_0x36e28d[_0x88b9('0x24')][_0x88b9('0x27')]);}logger[_0x88b9('0x24')](_0x88b9('0x26'),_0x24cb81,_0x36e28d['error']['message']);return _0x2f39da(_0x36e28d[_0x88b9('0x24')][_0x88b9('0x27')]);}else{logger[_0x88b9('0x28')](_0x88b9('0x26'),_0x24cb81,_0x88b9('0x22'));_0x2f39da(_0x36e28d[_0x88b9('0x29')][_0x88b9('0x27')]);}})[_0x88b9('0x2a')](function(_0x3d0d54){logger[_0x88b9('0x24')](_0x88b9('0x26'),_0x24cb81,_0x3d0d54);_0x18a078(_0x3d0d54);});});}function respondWithStatusCode(_0x3c080c,_0x4db6fa){_0x4db6fa=_0x4db6fa||0xcc;return function(_0x3da1fa){if(_0x3da1fa){return _0x3c080c[_0x88b9('0x2b')](_0x4db6fa);}return _0x3c080c['status'](_0x4db6fa)[_0x88b9('0x2c')]();};}function respondWithResult(_0x124f5e,_0x320cc6){_0x320cc6=_0x320cc6||0xc8;return function(_0x510504){if(_0x510504){return _0x124f5e[_0x88b9('0x2d')](_0x320cc6)[_0x88b9('0x2e')](_0x510504);}};}function respondWithFilteredResult(_0x2e20d4,_0x5d1def){return function(_0x1552a5){if(_0x1552a5){var _0x34727c=typeof _0x5d1def['offset']==='undefined'&&typeof _0x5d1def[_0x88b9('0x2f')]===_0x88b9('0x30');var _0x3149a6=_0x1552a5[_0x88b9('0x31')];var _0x3485a7=_0x34727c?0x0:_0x5d1def[_0x88b9('0x32')];var _0x3b96f0=_0x34727c?_0x1552a5[_0x88b9('0x31')]:_0x5d1def[_0x88b9('0x32')]+_0x5d1def[_0x88b9('0x2f')];var _0x2690f2;if(_0x3b96f0>=_0x3149a6){_0x3b96f0=_0x3149a6;_0x2690f2=0xc8;}else{_0x2690f2=0xce;}_0x2e20d4[_0x88b9('0x2d')](_0x2690f2);return _0x2e20d4[_0x88b9('0x33')]('Content-Range',_0x3485a7+'-'+_0x3b96f0+'/'+_0x3149a6)[_0x88b9('0x2e')](_0x1552a5);}return null;};}function patchUpdates(_0x56b827){return function(_0x67c19f){try{jsonpatch['apply'](_0x67c19f,_0x56b827,!![]);}catch(_0x140f0b){return BPromise[_0x88b9('0x34')](_0x140f0b);}return _0x67c19f['save']();};}function saveUpdates(_0x366dc6,_0x4987f9){return function(_0x1da781){if(_0x1da781){return _0x1da781[_0x88b9('0x35')](_0x366dc6)['then'](function(_0x5053a0){return _0x5053a0;});}return null;};}function removeEntity(_0xb69621,_0x2860ac){return function(_0x1674a3){if(_0x1674a3){return _0x1674a3['destroy']()['then'](function(){_0xb69621['status'](0xcc)[_0x88b9('0x2c')]();});}};}function handleEntityNotFound(_0x27e958,_0x4fb340){return function(_0x586543){if(!_0x586543){_0x27e958[_0x88b9('0x2b')](0x194);}return _0x586543;};}function handleError(_0x476780,_0x435ef6){_0x435ef6=_0x435ef6||0x1f4;return function(_0x54537d){logger['error'](_0x54537d[_0x88b9('0x36')]);if(_0x54537d[_0x88b9('0x37')]){delete _0x54537d[_0x88b9('0x37')];}_0x476780['status'](_0x435ef6)[_0x88b9('0x38')](_0x54537d);};}exports[_0x88b9('0x39')]=function(_0x2b9d52,_0x37c9e0){var _0x2605c2={},_0x514350={},_0x52646f={'count':0x0,'rows':[]};var _0x17247e=_['map'](db[_0x88b9('0x3a')][_0x88b9('0x3b')],function(_0x3a6d43){return{'name':_0x3a6d43[_0x88b9('0x3c')],'type':_0x3a6d43[_0x88b9('0x3d')]['key']};});_0x514350['model']=_[_0x88b9('0x3e')](_0x17247e,_0x88b9('0x37'));_0x514350[_0x88b9('0x3f')]=_[_0x88b9('0x40')](_0x2b9d52[_0x88b9('0x3f')]);_0x514350[_0x88b9('0x41')]=_['intersection'](_0x514350[_0x88b9('0x42')],_0x514350[_0x88b9('0x3f')]);_0x2605c2[_0x88b9('0x43')]=_[_0x88b9('0x44')](_0x514350[_0x88b9('0x42')],qs['fields'](_0x2b9d52[_0x88b9('0x3f')][_0x88b9('0x45')]));_0x2605c2[_0x88b9('0x43')]=_0x2605c2['attributes'][_0x88b9('0x46')]?_0x2605c2[_0x88b9('0x43')]:_0x514350[_0x88b9('0x42')];if(!_0x2b9d52[_0x88b9('0x3f')]['hasOwnProperty']('nolimit')){_0x2605c2[_0x88b9('0x2f')]=qs[_0x88b9('0x2f')](_0x2b9d52[_0x88b9('0x3f')][_0x88b9('0x2f')]);_0x2605c2[_0x88b9('0x32')]=qs[_0x88b9('0x32')](_0x2b9d52[_0x88b9('0x3f')][_0x88b9('0x32')]);}_0x2605c2['order']=qs[_0x88b9('0x47')](_0x2b9d52[_0x88b9('0x3f')][_0x88b9('0x47')]);_0x2605c2[_0x88b9('0x48')]=qs[_0x88b9('0x41')](_['pick'](_0x2b9d52[_0x88b9('0x3f')],_0x514350[_0x88b9('0x41')]),_0x17247e);if(_0x2b9d52[_0x88b9('0x3f')]['filter']){_0x2605c2[_0x88b9('0x48')]=_[_0x88b9('0x49')](_0x2605c2[_0x88b9('0x48')],{'$or':_[_0x88b9('0x3e')](_0x17247e,function(_0x48ebc8){if(_0x48ebc8['type']!==_0x88b9('0x4a')){var _0xd9385a={};_0xd9385a[_0x48ebc8[_0x88b9('0x37')]]={'$like':'%'+_0x2b9d52[_0x88b9('0x3f')]['filter']+'%'};return _0xd9385a;}})});}_0x2605c2=_['merge']({},_0x2605c2,_0x2b9d52[_0x88b9('0x4b')]);var _0x2344e9={'where':_0x2605c2[_0x88b9('0x48')]};return db[_0x88b9('0x3a')][_0x88b9('0x31')](_0x2344e9)[_0x88b9('0x1f')](function(_0x1908e8){_0x52646f[_0x88b9('0x31')]=_0x1908e8;if(_0x2b9d52[_0x88b9('0x3f')][_0x88b9('0x4c')]){_0x2605c2[_0x88b9('0x4d')]=[{'all':!![]}];}return db[_0x88b9('0x3a')]['findAll'](_0x2605c2);})[_0x88b9('0x1f')](function(_0x30d152){_0x52646f[_0x88b9('0x4e')]=_0x30d152;return _0x52646f;})[_0x88b9('0x1f')](respondWithFilteredResult(_0x37c9e0,_0x2605c2))[_0x88b9('0x2a')](handleError(_0x37c9e0,null));};exports[_0x88b9('0x4f')]=function(_0x23e4ca,_0x4eabf1){var _0x2bb1f9={'raw':!![],'where':{'id':_0x23e4ca['params']['id']}},_0x49a40c={};_0x49a40c['model']=_[_0x88b9('0x40')](db[_0x88b9('0x3a')]['rawAttributes']);_0x49a40c['query']=_[_0x88b9('0x40')](_0x23e4ca[_0x88b9('0x3f')]);_0x49a40c[_0x88b9('0x41')]=_[_0x88b9('0x44')](_0x49a40c[_0x88b9('0x42')],_0x49a40c[_0x88b9('0x3f')]);_0x2bb1f9['attributes']=_[_0x88b9('0x44')](_0x49a40c['model'],qs[_0x88b9('0x45')](_0x23e4ca['query'][_0x88b9('0x45')]));_0x2bb1f9[_0x88b9('0x43')]=_0x2bb1f9['attributes']['length']?_0x2bb1f9[_0x88b9('0x43')]:_0x49a40c[_0x88b9('0x42')];if(_0x23e4ca[_0x88b9('0x3f')]['includeAll']){_0x2bb1f9['include']=[{'all':!![]}];}_0x2bb1f9=_['merge']({},_0x2bb1f9,_0x23e4ca[_0x88b9('0x4b')]);return db[_0x88b9('0x3a')][_0x88b9('0x50')](_0x2bb1f9)[_0x88b9('0x1f')](handleEntityNotFound(_0x4eabf1,null))[_0x88b9('0x1f')](respondWithResult(_0x4eabf1,null))[_0x88b9('0x2a')](handleError(_0x4eabf1,null));};exports[_0x88b9('0x51')]=function(_0x2ff80f,_0x269d97){return db[_0x88b9('0x3a')][_0x88b9('0x51')](_0x2ff80f[_0x88b9('0x52')],{})[_0x88b9('0x1f')](respondWithResult(_0x269d97,0xc9))[_0x88b9('0x2a')](handleError(_0x269d97,null));};exports[_0x88b9('0x35')]=function(_0x4fd9ea,_0x5e223b){if(_0x4fd9ea['body']['id']){delete _0x4fd9ea[_0x88b9('0x52')]['id'];}return db[_0x88b9('0x3a')][_0x88b9('0x50')]({'where':{'id':_0x4fd9ea['params']['id']}})['then'](handleEntityNotFound(_0x5e223b,null))[_0x88b9('0x1f')](saveUpdates(_0x4fd9ea[_0x88b9('0x52')],null))[_0x88b9('0x1f')](respondWithResult(_0x5e223b,null))[_0x88b9('0x2a')](handleError(_0x5e223b,null));};exports[_0x88b9('0x53')]=function(_0x5c865e,_0x2f5764){return db['ChatMessage'][_0x88b9('0x50')]({'where':{'id':_0x5c865e[_0x88b9('0x54')]['id']}})[_0x88b9('0x1f')](handleEntityNotFound(_0x2f5764,null))[_0x88b9('0x1f')](removeEntity(_0x2f5764,null))['catch'](handleError(_0x2f5764,null));};exports[_0x88b9('0x55')]=function(_0xfb7618,_0x509a90){return db[_0x88b9('0x3a')]['describe']()[_0x88b9('0x1f')](respondWithResult(_0x509a90,null))['catch'](handleError(_0x509a90,null));};var interaction_log=require(_0x88b9('0x15'))(_0x88b9('0x56'));exports[_0x88b9('0x57')]=function(_0x2c5cd8,_0xfee436,_0x443b2f){var _0x4934e5={'agent':{},'channel':_0x88b9('0x58')};if(_0x2c5cd8[_0x88b9('0x52')]['id']){delete _0x2c5cd8[_0x88b9('0x52')]['id'];}_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x59')]=!![];_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x5a')]=moment()[_0x88b9('0x5b')](_0x88b9('0x5c'));_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x5d')]=_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x5d')]||_0x2c5cd8[_0x88b9('0x5e')]['id'];_0x4934e5[_0x88b9('0x5f')]['id']=_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x5d')];return db[_0x88b9('0x3a')]['find']({'where':{'id':_0x2c5cd8[_0x88b9('0x54')]['id'],'UserId':null}})[_0x88b9('0x1f')](handleEntityNotFound(_0xfee436,null))[_0x88b9('0x1f')](saveUpdates(_0x2c5cd8['body'],null))[_0x88b9('0x1f')](function(_0x345613){if(_0x345613){_0x4934e5[_0x88b9('0x27')]=_0x345613[_0x88b9('0x60')]({'plain':!![]});return db[_0x88b9('0x61')][_0x88b9('0x50')]({'where':{'id':_0x345613[_0x88b9('0x62')]}});}return null;})['then'](handleEntityNotFound(_0xfee436,null))[_0x88b9('0x1f')](function(_0x446434){if(_0x446434){return _0x446434[_0x88b9('0x35')]({'UserId':_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x5d')],'read1stAt':_['isNil'](_0x446434[_0x88b9('0x63')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x88b9('0x1f')](function(_0x521022){if(_0x521022){_0x4934e5[_0x88b9('0x64')]=_0x521022[_0x88b9('0x60')]({'plain':!![]});interaction_log[_0x88b9('0x28')](_0x88b9('0x65'),_0x2c5cd8[_0x88b9('0x5e')]['id'],_0x2c5cd8[_0x88b9('0x5e')]['name'],_0x2c5cd8[_0x88b9('0x5e')][_0x88b9('0x66')],_0x4934e5[_0x88b9('0x64')]['id'],_0x2c5cd8[_0x88b9('0x52')]?JSON[_0x88b9('0x23')](_0x2c5cd8[_0x88b9('0x52')]):_0x88b9('0x67'));return respondWithRpcPromise(_0x88b9('0x68'),'acceptMessage',_0x4934e5);}return null;})[_0x88b9('0x1f')](function(_0x48a237){var _0x42e182=_0x88b9('0x69')+_0x48a237[_0x88b9('0x27')][_0x88b9('0x6a')];return db['sequelize'][_0x88b9('0x3f')](_0x42e182,{'type':db['Sequelize'][_0x88b9('0x6b')][_0x88b9('0x6c')],'raw':!![]})[_0x88b9('0x1f')](function(_0x2a3704){return _0x2a3704;});})['then'](function(_0x20b622){if(_0x20b622){_0x4934e5[_0x88b9('0x27')][_0x88b9('0x6d')]=_0x20b622[0x0];if(!_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x5d')])return;return db[_0x88b9('0x6e')][_0x88b9('0x50')]({'where':{'id':_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x5d')],'role':_0x88b9('0x5f')},'attributes':['id',_0x88b9('0x37'),_0x88b9('0x6f'),_0x88b9('0x70'),_0x88b9('0x71')],'raw':!![]});}return null;})[_0x88b9('0x1f')](function(_0x552923){if(!_0x552923)return null;_0x4934e5[_0x88b9('0x27')][_0x88b9('0x5f')]=_0x552923;return _0x4934e5;})[_0x88b9('0x1f')](function(_0x19c193){if(_0x19c193){if(_0x2c5cd8[_0x88b9('0x52')][_0x88b9('0x72')]){_0x4934e5[_0x88b9('0x27')][_0x88b9('0x73')]=util[_0x88b9('0x5b')](_0x88b9('0x74'),_0x2c5cd8[_0x88b9('0x5e')][_0x88b9('0x37')]);_0x4934e5[_0x88b9('0x27')][_0x88b9('0x75')]=_0x4934e5['channel'];_0x4934e5['message']['motionChannel']=_0x4934e5['channel'];_0x4934e5[_0x88b9('0x27')][_0x88b9('0x76')]=_0x88b9('0x57');return respondWithRpcPromise(_0x88b9('0x77'),_0x88b9('0x77'),{'event':_0x88b9('0x78'),'message':_[_0x88b9('0x49')](_0x4934e5[_0x88b9('0x27')],JSON[_0x88b9('0x79')](_0x4934e5['interaction'][_0x88b9('0x7a')]))},client9002)[_0x88b9('0x1f')](function(){return _0x4934e5;});}return _0x4934e5;}return null;})[_0x88b9('0x1f')](respondWithResult(_0xfee436,null))[_0x88b9('0x2a')](handleError(_0xfee436,null));};var interaction_log=require(_0x88b9('0x15'))(_0x88b9('0x56'));exports[_0x88b9('0x34')]=function(_0x410e83,_0x3d551a,_0x57eb16){var _0x2fc887={'agent':{},'channel':_0x88b9('0x58')};if(_0x410e83['body']['id']){delete _0x410e83[_0x88b9('0x52')]['id'];}_0x410e83['body']['UserId']=_0x410e83[_0x88b9('0x52')][_0x88b9('0x5d')]||_0x410e83[_0x88b9('0x5e')]['id'];_0x2fc887[_0x88b9('0x5f')]['id']=_0x410e83[_0x88b9('0x52')][_0x88b9('0x5d')];return db[_0x88b9('0x3a')][_0x88b9('0x50')]({'where':{'id':_0x410e83['params']['id'],'UserId':null}})[_0x88b9('0x1f')](handleEntityNotFound(_0x3d551a,null))['then'](function(_0x1ae77c){if(_0x1ae77c){_0x2fc887[_0x88b9('0x27')]=_0x1ae77c[_0x88b9('0x60')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x1ae77c['ChatInteractionId']}});}return null;})[_0x88b9('0x1f')](handleEntityNotFound(_0x3d551a,null))[_0x88b9('0x1f')](function(_0x5411cd){if(_0x5411cd){_0x2fc887[_0x88b9('0x64')]=_0x5411cd[_0x88b9('0x60')]({'plain':!![]});interaction_log[_0x88b9('0x28')](_0x88b9('0x7b'),_0x410e83[_0x88b9('0x5e')]['id'],_0x410e83[_0x88b9('0x5e')][_0x88b9('0x37')],_0x410e83['user'][_0x88b9('0x66')],_0x2fc887[_0x88b9('0x64')]['id'],_0x410e83[_0x88b9('0x52')]?JSON[_0x88b9('0x23')](_0x410e83[_0x88b9('0x52')]):_0x88b9('0x67'));return respondWithRpcPromise(_0x88b9('0x7c'),_0x88b9('0x7d'),_0x2fc887);}return null;})[_0x88b9('0x1f')](function(_0x2c7d18){var _0xf06a07=_0x88b9('0x69')+_0x2c7d18['message'][_0x88b9('0x6a')];return db['sequelize'][_0x88b9('0x3f')](_0xf06a07,{'type':db[_0x88b9('0x7e')][_0x88b9('0x6b')][_0x88b9('0x6c')],'raw':!![]})[_0x88b9('0x1f')](function(_0xe8eae2){return _0xe8eae2;});})['then'](function(_0x13f5d9){if(_0x13f5d9){_0x2fc887[_0x88b9('0x27')][_0x88b9('0x6d')]=_0x13f5d9[0x0];if(!_0x410e83[_0x88b9('0x52')]['UserId'])return;return db[_0x88b9('0x6e')]['find']({'where':{'id':_0x410e83[_0x88b9('0x52')][_0x88b9('0x5d')],'role':_0x88b9('0x5f')},'attributes':['id',_0x88b9('0x37'),'fullname','email',_0x88b9('0x71')],'raw':!![]});}return null;})[_0x88b9('0x1f')](function(_0x2d196){if(!_0x2d196)return null;_0x2fc887[_0x88b9('0x27')][_0x88b9('0x5f')]=_0x2d196;return _0x2fc887;})[_0x88b9('0x1f')](function(_0x4c398e){if(_0x4c398e){_0x4c398e[_0x88b9('0x27')][_0x88b9('0x73')]=util[_0x88b9('0x5b')](_0x88b9('0x74'),_0x410e83[_0x88b9('0x5e')][_0x88b9('0x37')]);_0x4c398e['message'][_0x88b9('0x75')]=_0x2fc887['channel'];_0x4c398e[_0x88b9('0x27')][_0x88b9('0x7f')]=_0x2fc887['channel'];_0x4c398e['message']['event']=_0x88b9('0x34');respondWithRpcPromise('EventManager',_0x88b9('0x77'),{'event':_0x88b9('0x80'),'message':_[_0x88b9('0x49')](_0x2fc887[_0x88b9('0x27')],JSON['parse'](_0x2fc887[_0x88b9('0x64')][_0x88b9('0x7a')]))},client9002);return _0x2fc887;}return null;})[_0x88b9('0x1f')](respondWithResult(_0x3d551a,null))[_0x88b9('0x2a')](handleError(_0x3d551a,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index d47f49c..f53cf63 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 _0xb03a=['setMaxListeners','save','update','remove','emit','exports','../../mysqldb','ChatMessage'];(function(_0x3e806a,_0xa4b9fa){var _0x477105=function(_0x119821){while(--_0x119821){_0x3e806a['push'](_0x3e806a['shift']());}};_0x477105(++_0xa4b9fa);}(_0xb03a,0xae));var _0xab03=function(_0x4ac904,_0x220b19){_0x4ac904=_0x4ac904-0x0;var _0x342680=_0xb03a[_0x4ac904];return _0x342680;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xab03('0x0'))['db'][_0xab03('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xab03('0x2')](0x0);var events={'afterCreate':_0xab03('0x3'),'afterUpdate':_0xab03('0x4'),'afterDestroy':_0xab03('0x5')};function emitEvent(_0x40a8d6){return function(_0x19b437,_0x364174,_0x58c264){ChatMessageEvents[_0xab03('0x6')](_0x40a8d6+':'+_0x19b437['id'],_0x19b437);ChatMessageEvents[_0xab03('0x6')](_0x40a8d6,_0x19b437);_0x58c264(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xab03('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x610a=['hasOwnProperty','exports','events','../../mysqldb','ChatMessage','update','emit'];(function(_0x48dad1,_0x4da5b5){var _0x2a0f28=function(_0x38a073){while(--_0x38a073){_0x48dad1['push'](_0x48dad1['shift']());}};_0x2a0f28(++_0x4da5b5);}(_0x610a,0x12f));var _0xa610=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x610a[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xa610('0x0'));var ChatMessage=require(_0xa610('0x1'))['db'][_0xa610('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa610('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2504b0){return function(_0x59645a,_0x24e9eb,_0x158f3a){ChatMessageEvents[_0xa610('0x4')](_0x2504b0+':'+_0x59645a['id'],_0x59645a);ChatMessageEvents[_0xa610('0x4')](_0x2504b0,_0x59645a);_0x158f3a(null);};}for(var e in events){if(events[_0xa610('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xa610('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 4fb85ac..484ac0b 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 _0x0c10=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4521e3,_0x10a8a4){var _0x46a272=function(_0x2f4c64){while(--_0x2f4c64){_0x4521e3['push'](_0x4521e3['shift']());}};_0x46a272(++_0x10a8a4);}(_0x0c10,0xf0));var _0x00c1=function(_0x5d8084,_0x1947e9){_0x5d8084=_0x5d8084-0x0;var _0x4c0147=_0x0c10[_0x5d8084];return _0x4c0147;};'use strict';var _=require('lodash');var util=require(_0x00c1('0x0'));var logger=require(_0x00c1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x00c1('0x2'));var rp=require(_0x00c1('0x3'));var fs=require('fs');var path=require(_0x00c1('0x4'));var rimraf=require(_0x00c1('0x5'));var config=require(_0x00c1('0x6'));var attributes=require(_0x00c1('0x7'));module[_0x00c1('0x8')]=function(_0x358109,_0x5b3287){return _0x358109[_0x00c1('0x9')](_0x00c1('0xa'),attributes,{'tableName':_0x00c1('0xb'),'paranoid':![],'indexes':[{'name':_0x00c1('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x26bdfe,_0x455554,_0x518d82){var _0x3225d7=_0x358109[_0x00c1('0xd')];var _0x51d3d4=_0x26bdfe[_0x00c1('0xe')]({'plain':!![]});if(_0x51d3d4[_0x00c1('0xf')][_0x00c1('0x10')]()==='in'||_0x51d3d4['direction'][_0x00c1('0x10')]()===_0x00c1('0x11')&&!_0x51d3d4[_0x00c1('0x12')]&&!_[_0x00c1('0x13')](_0x51d3d4[_0x00c1('0x14')])){_0x3225d7[_0x00c1('0x15')][_0x00c1('0x16')]({'where':{'id':_0x51d3d4[_0x00c1('0x17')]}})[_0x00c1('0x18')](function(_0x437040){if(_0x437040){_0x437040['update']({'lastMsgAt':_0x51d3d4[_0x00c1('0x19')],'lastMsgDirection':_0x51d3d4[_0x00c1('0xf')][_0x00c1('0x10')]()});}})[_0x00c1('0x1a')](function(_0x24e489){console[_0x00c1('0x1b')](_0x24e489);});}_0x518d82();}},'charset':_0x00c1('0x1c'),'collate':_0x00c1('0x1d')});};
\ No newline at end of file
+var _0x3f32=['./chatMessage.attributes','exports','define','ChatMessage','chat_messages','FULLTEXT','models','get','direction','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x152e48,_0x25f775){var _0x30b1a4=function(_0x5dcbf3){while(--_0x5dcbf3){_0x152e48['push'](_0x152e48['shift']());}};_0x30b1a4(++_0x25f775);}(_0x3f32,0x160));var _0x23f3=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0x3f32[_0x212bf5];return _0xfcad21;};'use strict';var _=require(_0x23f3('0x0'));var util=require(_0x23f3('0x1'));var logger=require(_0x23f3('0x2'))('api');var moment=require(_0x23f3('0x3'));var BPromise=require(_0x23f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x23f3('0x5'));var rimraf=require(_0x23f3('0x6'));var config=require(_0x23f3('0x7'));var attributes=require(_0x23f3('0x8'));module[_0x23f3('0x9')]=function(_0xdb2c19,_0x20ba9d){return _0xdb2c19[_0x23f3('0xa')](_0x23f3('0xb'),attributes,{'tableName':_0x23f3('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x23f3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x113d8c,_0x2af775,_0x2ca94b){var _0x1111e8=_0xdb2c19[_0x23f3('0xe')];var _0x1fdea5=_0x113d8c[_0x23f3('0xf')]({'plain':!![]});if(_0x1fdea5[_0x23f3('0x10')]['toLowerCase']()==='in'||_0x1fdea5[_0x23f3('0x10')]['toLowerCase']()===_0x23f3('0x11')&&!_0x1fdea5[_0x23f3('0x12')]&&!_['isNil'](_0x1fdea5[_0x23f3('0x13')])){_0x1111e8[_0x23f3('0x14')][_0x23f3('0x15')]({'where':{'id':_0x1fdea5[_0x23f3('0x16')]}})['then'](function(_0x4035c4){if(_0x4035c4){_0x4035c4[_0x23f3('0x17')]({'lastMsgAt':_0x1fdea5[_0x23f3('0x18')],'lastMsgDirection':_0x1fdea5[_0x23f3('0x10')][_0x23f3('0x19')]()});}})[_0x23f3('0x1a')](function(_0x536006){console[_0x23f3('0x1b')](_0x536006);});}_0x2ca94b();}},'charset':_0x23f3('0x1c'),'collate':_0x23f3('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 0dd19da..04495d0 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 _0x20e1=['request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','ChatMessage','create','body','options','raw','then','CreateChatMessage','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x20e1,0x9b));var _0x120e=function(_0x4a010b,_0x3523b3){_0x4a010b=_0x4a010b-0x0;var _0xe0b19b=_0x20e1[_0x4a010b];return _0xe0b19b;};'use strict';var _=require(_0x120e('0x0'));var util=require(_0x120e('0x1'));var moment=require(_0x120e('0x2'));var BPromise=require(_0x120e('0x3'));var rs=require(_0x120e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x120e('0x5'));var logger=require(_0x120e('0x6'))(_0x120e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x120e('0x8')][_0x120e('0x9')]({'port':0x232a});config[_0x120e('0xa')]=_[_0x120e('0xb')](config[_0x120e('0xa')],{'host':_0x120e('0xc'),'port':0x18eb});var socket=require(_0x120e('0xd'))(new Redis(config[_0x120e('0xa')]));require('./chatMessage.socket')[_0x120e('0xe')](socket);function respondWithRpcPromise(_0xc50d3,_0x4f59ce,_0x53400c){return new BPromise(function(_0x188a10,_0x27076f){return client[_0x120e('0xf')](_0xc50d3,_0x53400c)['then'](function(_0x3b7560){logger[_0x120e('0x10')]('ChatMessage,\x20%s,\x20%s',_0x4f59ce,_0x120e('0x11'));logger[_0x120e('0x12')](_0x120e('0x13'),_0x4f59ce,_0x120e('0x11'),JSON[_0x120e('0x14')](_0x3b7560));if(_0x3b7560[_0x120e('0x15')]){if(_0x3b7560['error'][_0x120e('0x16')]===0x1f4){logger[_0x120e('0x15')]('ChatMessage,\x20%s,\x20%s',_0x4f59ce,_0x3b7560[_0x120e('0x15')][_0x120e('0x17')]);return _0x27076f(_0x3b7560['error'][_0x120e('0x17')]);}logger[_0x120e('0x15')](_0x120e('0x18'),_0x4f59ce,_0x3b7560['error'][_0x120e('0x17')]);return _0x188a10(_0x3b7560[_0x120e('0x15')][_0x120e('0x17')]);}else{logger[_0x120e('0x10')](_0x120e('0x18'),_0x4f59ce,_0x120e('0x11'));_0x188a10(_0x3b7560[_0x120e('0x19')][_0x120e('0x17')]);}})[_0x120e('0x1a')](function(_0x3fa941){logger[_0x120e('0x15')](_0x120e('0x18'),_0x4f59ce,_0x3fa941);_0x27076f(_0x3fa941);});});}exports['CreateChatMessage']=function(_0x4e2d27){var _0x44233d=this;return new Promise(function(_0x4ae22a,_0x390c5d){return db[_0x120e('0x1b')][_0x120e('0x1c')](_0x4e2d27[_0x120e('0x1d')],{'raw':_0x4e2d27['options']?_0x4e2d27[_0x120e('0x1e')][_0x120e('0x1f')]===undefined?!![]:![]:!![]})[_0x120e('0x20')](function(_0x2cff52){logger['info']('CreateChatMessage',_0x4e2d27);logger[_0x120e('0x12')](_0x120e('0x21'),_0x4e2d27,JSON[_0x120e('0x14')](_0x2cff52));_0x4ae22a(_0x2cff52);})[_0x120e('0x1a')](function(_0x57d5b8){logger[_0x120e('0x15')](_0x120e('0x21'),_0x57d5b8[_0x120e('0x17')],_0x4e2d27);_0x390c5d(_0x44233d[_0x120e('0x15')](0x1f4,_0x57d5b8[_0x120e('0x17')]));});});};
\ No newline at end of file
+var _0x8b70=['raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','./chatMessage.socket','register','then','info','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8b70,0x1c2));var _0x08b7=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x8b70[_0x81dcac];return _0xc7803b;};'use strict';var _=require(_0x08b7('0x0'));var util=require(_0x08b7('0x1'));var moment=require(_0x08b7('0x2'));var BPromise=require(_0x08b7('0x3'));var rs=require(_0x08b7('0x4'));var fs=require('fs');var Redis=require(_0x08b7('0x5'));var db=require(_0x08b7('0x6'))['db'];var utils=require(_0x08b7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x08b7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x08b7('0x9')]['http']({'port':0x232a});config[_0x08b7('0xa')]=_[_0x08b7('0xb')](config[_0x08b7('0xa')],{'host':_0x08b7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x08b7('0xa')]));require(_0x08b7('0xd'))[_0x08b7('0xe')](socket);function respondWithRpcPromise(_0x46553d,_0x2aca8c,_0x470291){return new BPromise(function(_0x3bccaf,_0x31cf24){return client['request'](_0x46553d,_0x470291)[_0x08b7('0xf')](function(_0x305782){logger[_0x08b7('0x10')]('ChatMessage,\x20%s,\x20%s',_0x2aca8c,_0x08b7('0x11'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2aca8c,_0x08b7('0x11'),JSON[_0x08b7('0x12')](_0x305782));if(_0x305782[_0x08b7('0x13')]){if(_0x305782[_0x08b7('0x13')][_0x08b7('0x14')]===0x1f4){logger[_0x08b7('0x13')](_0x08b7('0x15'),_0x2aca8c,_0x305782[_0x08b7('0x13')][_0x08b7('0x16')]);return _0x31cf24(_0x305782[_0x08b7('0x13')][_0x08b7('0x16')]);}logger[_0x08b7('0x13')](_0x08b7('0x15'),_0x2aca8c,_0x305782[_0x08b7('0x13')][_0x08b7('0x16')]);return _0x3bccaf(_0x305782[_0x08b7('0x13')]['message']);}else{logger[_0x08b7('0x10')](_0x08b7('0x15'),_0x2aca8c,_0x08b7('0x11'));_0x3bccaf(_0x305782[_0x08b7('0x17')][_0x08b7('0x16')]);}})[_0x08b7('0x18')](function(_0x52c392){logger[_0x08b7('0x13')](_0x08b7('0x15'),_0x2aca8c,_0x52c392);_0x31cf24(_0x52c392);});});}exports[_0x08b7('0x19')]=function(_0x3ec61b){var _0x3a77b8=this;return new Promise(function(_0x4ded1a,_0x1dd31a){return db[_0x08b7('0x1a')][_0x08b7('0x1b')](_0x3ec61b[_0x08b7('0x1c')],{'raw':_0x3ec61b[_0x08b7('0x1d')]?_0x3ec61b[_0x08b7('0x1d')][_0x08b7('0x1e')]===undefined?!![]:![]:!![]})[_0x08b7('0xf')](function(_0x26c43e){logger['info'](_0x08b7('0x19'),_0x3ec61b);logger[_0x08b7('0x1f')]('CreateChatMessage',_0x3ec61b,JSON[_0x08b7('0x12')](_0x26c43e));_0x4ded1a(_0x26c43e);})['catch'](function(_0x29988f){logger[_0x08b7('0x13')](_0x08b7('0x19'),_0x29988f['message'],_0x3ec61b);_0x1dd31a(_0x3a77b8[_0x08b7('0x13')](0x1f4,_0x29988f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 45f3d8d..a53cd44 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 _0x826a=['update','emit','removeListener','register','length','chatMessage:','save'];(function(_0x378ea6,_0x36818e){var _0x601e23=function(_0x9375db){while(--_0x9375db){_0x378ea6['push'](_0x378ea6['shift']());}};_0x601e23(++_0x36818e);}(_0x826a,0x1aa));var _0xa826=function(_0xbe92e8,_0x336106){_0xbe92e8=_0xbe92e8-0x0;var _0x5d49d1=_0x826a[_0xbe92e8];return _0x5d49d1;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatMessageEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatMessageEvents['on'](_0x4339f9,_0x14c2ba);}};
\ No newline at end of file
+var _0x5ad3=['register','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x5ad3[_0x152678];return _0x311a9;};'use strict';var ChatMessageEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatMessageEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatMessageEvents['on'](_0x292521,_0x3cec3e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 48f60dc..c450e8c 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 _0x4906=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','show','post','tracked','chat','chatmessage:create','create','put','/:id','update','accept','/:id/reject','delete','destroy'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x4906,0xbe));var _0x6490=function(_0x3ce300,_0x3cfe99){_0x3ce300=_0x3ce300-0x0;var _0xb2a9f2=_0x4906[_0x3ce300];return _0xb2a9f2;};'use strict';var multer=require(_0x6490('0x0'));var util=require(_0x6490('0x1'));var path=require(_0x6490('0x2'));var timeout=require(_0x6490('0x3'));var express=require('express');var router=express[_0x6490('0x4')]();var fs_extra=require(_0x6490('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6490('0x6'));var config=require('../../config/environment');var controller=require(_0x6490('0x7'));router[_0x6490('0x8')]('/',auth['isAuthenticated'](),controller[_0x6490('0x9')]);router[_0x6490('0x8')](_0x6490('0xa'),auth[_0x6490('0xb')](),controller[_0x6490('0xc')]);router[_0x6490('0x8')]('/:id',auth[_0x6490('0xb')](),controller[_0x6490('0xd')]);router[_0x6490('0xe')]('/',auth[_0x6490('0xb')](),interaction[_0x6490('0xf')](_0x6490('0x10'),_0x6490('0x11')),controller[_0x6490('0x12')]);router[_0x6490('0x13')](_0x6490('0x14'),controller[_0x6490('0x15')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x6490('0x16')]);router[_0x6490('0x13')](_0x6490('0x17'),auth[_0x6490('0xb')](),controller['reject']);router[_0x6490('0x18')]('/:id',auth[_0x6490('0xb')](),controller[_0x6490('0x19')]);module[_0x6490('0x1a')]=router;
\ No newline at end of file
+var _0xce82=['path','connect-timeout','express','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','/describe','/:id','show','chat','chatmessage:create','create','update','put','/:id/accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xce82,0x82));var _0x2ce8=function(_0x26aa3e,_0x2b65d3){_0x26aa3e=_0x26aa3e-0x0;var _0x5a4755=_0xce82[_0x26aa3e];return _0x5a4755;};'use strict';var multer=require(_0x2ce8('0x0'));var util=require(_0x2ce8('0x1'));var path=require(_0x2ce8('0x2'));var timeout=require(_0x2ce8('0x3'));var express=require(_0x2ce8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2ce8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2ce8('0x6'));router[_0x2ce8('0x7')]('/',auth[_0x2ce8('0x8')](),controller['index']);router[_0x2ce8('0x7')](_0x2ce8('0x9'),auth[_0x2ce8('0x8')](),controller['describe']);router[_0x2ce8('0x7')](_0x2ce8('0xa'),auth['isAuthenticated'](),controller[_0x2ce8('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x2ce8('0xc'),_0x2ce8('0xd')),controller[_0x2ce8('0xe')]);router['put'](_0x2ce8('0xa'),controller[_0x2ce8('0xf')]);router[_0x2ce8('0x10')](_0x2ce8('0x11'),auth[_0x2ce8('0x8')](),controller['accept']);router['put'](_0x2ce8('0x12'),auth[_0x2ce8('0x8')](),controller[_0x2ce8('0x13')]);router['delete'](_0x2ce8('0xa'),auth[_0x2ce8('0x8')](),controller[_0x2ce8('0x14')]);module[_0x2ce8('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 13a6ea0..9e1360a 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x4a3650,_0x41569c){var _0x34c712=function(_0x5ee572){while(--_0x5ee572){_0x4a3650['push'](_0x4a3650['shift']());}};_0x34c712(++_0x41569c);}(_0xdb28,0x106));var _0x8db2=function(_0x2a57d1,_0x11c4b1){_0x2a57d1=_0x2a57d1-0x0;var _0x1316b8=_0xdb28[_0x2a57d1];return _0x1316b8;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x4a715c,_0x57165f){var _0x168cfe=function(_0x3ad3ab){while(--_0x3ad3ab){_0x4a715c['push'](_0x4a715c['shift']());}};_0x168cfe(++_0x57165f);}(_0x2032,0xd9));var _0x2203=function(_0x2eaed0,_0x279127){_0x2eaed0=_0x2eaed0-0x0;var _0xa472d0=_0x2032[_0x2eaed0];return _0xa472d0;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 39c65d9..781c755 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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x7a54,0x106));var _0x47a5=function(_0x2dc55a,_0x517166){_0x2dc55a=_0x2dc55a-0x0;var _0x44fb20=_0x7a54[_0x2dc55a];return _0x44fb20;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x2a3696,_0x4c4c97){_0x2a3696=_0x2a3696-0x0;var _0x345208=_0x7a54[_0x2a3696];return _0x345208;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 4ed2bff..166e5c5 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 _0xfd4c=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x22f790,_0x14be30){var _0x54a889=function(_0x3f4dbc){while(--_0x3f4dbc){_0x22f790['push'](_0x22f790['shift']());}};_0x54a889(++_0x14be30);}(_0xfd4c,0x17b));var _0xcfd4=function(_0x3115f8,_0x22f2b8){_0x3115f8=_0x3115f8-0x0;var _0x3ac562=_0xfd4c[_0x3115f8];return _0x3ac562;};'use strict';var EventEmitter=require(_0xcfd4('0x0'));var ChatOfflineMessage=require(_0xcfd4('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcfd4('0x2')](0x0);var events={'afterCreate':_0xcfd4('0x3'),'afterUpdate':_0xcfd4('0x4'),'afterDestroy':_0xcfd4('0x5')};function emitEvent(_0x1b3dc3){return function(_0x4f780c,_0xacc03c,_0x2f7e8b){ChatOfflineMessageEvents[_0xcfd4('0x6')](_0x1b3dc3+':'+_0x4f780c['id'],_0x4f780c);ChatOfflineMessageEvents[_0xcfd4('0x6')](_0x1b3dc3,_0x4f780c);_0x2f7e8b(null);};}for(var e in events){if(events[_0xcfd4('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xcfd4('0x8')](e,emitEvent(event));}}module[_0xcfd4('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x7ebb=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x7ebb,0x161));var _0xb7eb=function(_0x5bdb83,_0x3605de){_0x5bdb83=_0x5bdb83-0x0;var _0x1986bb=_0x7ebb[_0x5bdb83];return _0x1986bb;};'use strict';var EventEmitter=require(_0xb7eb('0x0'));var ChatOfflineMessage=require(_0xb7eb('0x1'))['db'][_0xb7eb('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xb7eb('0x3')](0x0);var events={'afterCreate':_0xb7eb('0x4'),'afterUpdate':_0xb7eb('0x5'),'afterDestroy':_0xb7eb('0x6')};function emitEvent(_0x544428){return function(_0x2d63cf,_0x2b664d,_0x28a59f){ChatOfflineMessageEvents[_0xb7eb('0x7')](_0x544428+':'+_0x2d63cf['id'],_0x2d63cf);ChatOfflineMessageEvents[_0xb7eb('0x7')](_0x544428,_0x2d63cf);_0x28a59f(null);};}for(var e in events){if(events[_0xb7eb('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xb7eb('0x9')](e,emitEvent(event));}}module[_0xb7eb('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 4786160..dee1452 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 _0x5d8a=['./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x558e6f,_0x9f9bf2){var _0x3963d2=function(_0x1ebb10){while(--_0x1ebb10){_0x558e6f['push'](_0x558e6f['shift']());}};_0x3963d2(++_0x9f9bf2);}(_0x5d8a,0x1c7));var _0xa5d8=function(_0x208c3d,_0x98456e){_0x208c3d=_0x208c3d-0x0;var _0x465437=_0x5d8a[_0x208c3d];return _0x465437;};'use strict';var attributes=require(_0xa5d8('0x0'));module[_0xa5d8('0x1')]=function(_0x11d915){return _0x11d915['define']('ChatOfflineMessage',attributes,{'tableName':_0xa5d8('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5d8('0x3'),'collate':_0xa5d8('0x4')});};
\ No newline at end of file
+var _0x2968=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0xbf1875,_0x34b144){var _0x2e598b=function(_0xd104ec){while(--_0xd104ec){_0xbf1875['push'](_0xbf1875['shift']());}};_0x2e598b(++_0x34b144);}(_0x2968,0x19e));var _0x8296=function(_0x12b74e,_0x1f0d54){_0x12b74e=_0x12b74e-0x0;var _0x511e55=_0x2968[_0x12b74e];return _0x511e55;};'use strict';var attributes=require(_0x8296('0x0'));module[_0x8296('0x1')]=function(_0x1af581){return _0x1af581[_0x8296('0x2')](_0x8296('0x3'),attributes,{'tableName':_0x8296('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8296('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index a5af9f7..fbf2113 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 _0x0d6a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x299c3e,_0x501381){var _0x3ca85f=function(_0x27bb14){while(--_0x27bb14){_0x299c3e['push'](_0x299c3e['shift']());}};_0x3ca85f(++_0x501381);}(_0x0d6a,0xc9));var _0xa0d6=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x0d6a[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require(_0xa0d6('0x0'));var util=require(_0xa0d6('0x1'));var moment=require('moment');var BPromise=require(_0xa0d6('0x2'));var rs=require(_0xa0d6('0x3'));var fs=require('fs');var Redis=require(_0xa0d6('0x4'));var db=require(_0xa0d6('0x5'))['db'];var utils=require(_0xa0d6('0x6'));var logger=require(_0xa0d6('0x7'))(_0xa0d6('0x8'));var config=require(_0xa0d6('0x9'));var jayson=require(_0xa0d6('0xa'));var client=jayson[_0xa0d6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14dbe7,_0x382f7f,_0xba6194){return new BPromise(function(_0x11f5f9,_0x228a57){return client['request'](_0x14dbe7,_0xba6194)[_0xa0d6('0xc')](function(_0x54c2bc){logger[_0xa0d6('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x382f7f,_0xa0d6('0xe'));logger['debug'](_0xa0d6('0xf'),_0x382f7f,_0xa0d6('0xe'),JSON[_0xa0d6('0x10')](_0x54c2bc));if(_0x54c2bc[_0xa0d6('0x11')]){if(_0x54c2bc[_0xa0d6('0x11')][_0xa0d6('0x12')]===0x1f4){logger['error'](_0xa0d6('0x13'),_0x382f7f,_0x54c2bc[_0xa0d6('0x11')][_0xa0d6('0x14')]);return _0x228a57(_0x54c2bc['error'][_0xa0d6('0x14')]);}logger[_0xa0d6('0x11')](_0xa0d6('0x13'),_0x382f7f,_0x54c2bc[_0xa0d6('0x11')][_0xa0d6('0x14')]);return _0x11f5f9(_0x54c2bc[_0xa0d6('0x11')][_0xa0d6('0x14')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x382f7f,_0xa0d6('0xe'));_0x11f5f9(_0x54c2bc[_0xa0d6('0x15')][_0xa0d6('0x14')]);}})[_0xa0d6('0x16')](function(_0x1e8b82){logger[_0xa0d6('0x11')](_0xa0d6('0x13'),_0x382f7f,_0x1e8b82);_0x228a57(_0x1e8b82);});});}
\ No newline at end of file
+var _0x6b13=['jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x6b13,0xd0));var _0x36b1=function(_0x3f7982,_0x24c737){_0x3f7982=_0x3f7982-0x0;var _0x4e6a0d=_0x6b13[_0x3f7982];return _0x4e6a0d;};'use strict';var _=require('lodash');var util=require(_0x36b1('0x0'));var moment=require(_0x36b1('0x1'));var BPromise=require(_0x36b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36b1('0x3'));var db=require(_0x36b1('0x4'))['db'];var utils=require(_0x36b1('0x5'));var logger=require(_0x36b1('0x6'))(_0x36b1('0x7'));var config=require('../../config/environment');var jayson=require(_0x36b1('0x8'));var client=jayson[_0x36b1('0x9')][_0x36b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44e7b8,_0x3ff1d7,_0x11a9df){return new BPromise(function(_0x4964ef,_0x44b19b){return client[_0x36b1('0xb')](_0x44e7b8,_0x11a9df)[_0x36b1('0xc')](function(_0x5999fa){logger[_0x36b1('0xd')](_0x36b1('0xe'),_0x3ff1d7,_0x36b1('0xf'));logger[_0x36b1('0x10')](_0x36b1('0x11'),_0x3ff1d7,_0x36b1('0xf'),JSON[_0x36b1('0x12')](_0x5999fa));if(_0x5999fa['error']){if(_0x5999fa[_0x36b1('0x13')][_0x36b1('0x14')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3ff1d7,_0x5999fa[_0x36b1('0x13')][_0x36b1('0x15')]);return _0x44b19b(_0x5999fa[_0x36b1('0x13')]['message']);}logger[_0x36b1('0x13')](_0x36b1('0xe'),_0x3ff1d7,_0x5999fa['error']['message']);return _0x4964ef(_0x5999fa['error']['message']);}else{logger[_0x36b1('0xd')](_0x36b1('0xe'),_0x3ff1d7,_0x36b1('0xf'));_0x4964ef(_0x5999fa[_0x36b1('0x16')][_0x36b1('0x15')]);}})[_0x36b1('0x17')](function(_0x5828be){logger[_0x36b1('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3ff1d7,_0x5828be);_0x44b19b(_0x5828be);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 7de0c6e..bee6168 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 _0xa90d=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0xa90d,0x7f));var _0xda90=function(_0x17ce0b,_0x40fb10){_0x17ce0b=_0x17ce0b-0x0;var _0x1fbef3=_0xa90d[_0x17ce0b];return _0x1fbef3;};'use strict';var multer=require(_0xda90('0x0'));var util=require('util');var path=require(_0xda90('0x1'));var timeout=require(_0xda90('0x2'));var express=require(_0xda90('0x3'));var router=express['Router']();var fs_extra=require(_0xda90('0x4'));var auth=require(_0xda90('0x5'));var interaction=require(_0xda90('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xda90('0x7')]('/',auth[_0xda90('0x8')](),controller[_0xda90('0x9')]);router['get']('/describe',auth[_0xda90('0x8')](),controller['describe']);router[_0xda90('0x7')](_0xda90('0xa'),auth['isAuthenticated'](),controller[_0xda90('0xb')]);router[_0xda90('0xc')]('/',auth[_0xda90('0x8')](),controller[_0xda90('0xd')]);router[_0xda90('0xe')](_0xda90('0xa'),auth['isAuthenticated'](),controller[_0xda90('0xf')]);router[_0xda90('0x10')](_0xda90('0xa'),auth[_0xda90('0x8')](),controller[_0xda90('0x11')]);module[_0xda90('0x12')]=router;
\ No newline at end of file
+var _0x6831=['destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','describe','get','/:id','post','put','update','delete'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6831,0x92));var _0x1683=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x6831[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1683('0x0'));var timeout=require('connect-timeout');var express=require(_0x1683('0x1'));var router=express[_0x1683('0x2')]();var fs_extra=require(_0x1683('0x3'));var auth=require(_0x1683('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1683('0x5'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x1683('0x6')](),controller['index']);router['get']('/describe',auth[_0x1683('0x6')](),controller[_0x1683('0x7')]);router[_0x1683('0x8')](_0x1683('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1683('0xa')]('/',auth[_0x1683('0x6')](),controller['create']);router[_0x1683('0xb')]('/:id',auth[_0x1683('0x6')](),controller[_0x1683('0xc')]);router[_0x1683('0xd')]('/:id',auth[_0x1683('0x6')](),controller[_0x1683('0xe')]);module[_0x1683('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 1f5a899..d0ef845 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 _0x4efd=['timeout','sequelize','ENUM','mouseOver'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x4efd,0xbd));var _0xd4ef=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x4efd[_0xe8129c];return _0x709fc5;};'use strict';var Sequelize=require(_0xd4ef('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd4ef('0x1')](_0xd4ef('0x2'),_0xd4ef('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x33a3=['INTEGER','sequelize','STRING','mouseOver'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x33a3,0x9d));var _0x333a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x33a3[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x333a('0x0'));module['exports']={'name':{'type':Sequelize[_0x333a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x333a('0x2')},'selector':{'type':Sequelize[_0x333a('0x1')]},'timeout':{'type':Sequelize[_0x333a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 8bc7975..a4ec0be 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 _0x861a=['../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','show','params','model','keys','filters','intersection','query','fields','attributes','length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment'];(function(_0x798923,_0x3f3fd4){var _0x5b8cc3=function(_0x2aa105){while(--_0x2aa105){_0x798923['push'](_0x798923['shift']());}};_0x5b8cc3(++_0x3f3fd4);}(_0x861a,0x194));var _0xa861=function(_0x419065,_0x18ee93){_0x419065=_0x419065-0x0;var _0x4ef044=_0x861a[_0x419065];return _0x4ef044;};'use strict';var emlformat=require(_0xa861('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa861('0x1'));var jsonpatch=require(_0xa861('0x2'));var rp=require(_0xa861('0x3'));var moment=require(_0xa861('0x4'));var BPromise=require(_0xa861('0x5'));var Mustache=require(_0xa861('0x6'));var util=require('util');var path=require(_0xa861('0x7'));var sox=require(_0xa861('0x8'));var csv=require(_0xa861('0x9'));var ejs=require(_0xa861('0xa'));var fs=require('fs');var fs_extra=require(_0xa861('0xb'));var _=require('lodash');var squel=require(_0xa861('0xc'));var crypto=require(_0xa861('0xd'));var jsforce=require(_0xa861('0xe'));var deskjs=require(_0xa861('0xf'));var toCsv=require(_0xa861('0x9'));var querystring=require(_0xa861('0x10'));var Papa=require(_0xa861('0x11'));var Redis=require(_0xa861('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa861('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa861('0x14'));var utils=require(_0xa861('0x15'));var config=require(_0xa861('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa861('0x17'))['db'];function respondWithStatusCode(_0xf01095,_0x44c425){_0x44c425=_0x44c425||0xcc;return function(_0x35f59b){if(_0x35f59b){return _0xf01095[_0xa861('0x18')](_0x44c425);}return _0xf01095['status'](_0x44c425)['end']();};}function respondWithResult(_0x8b05bd,_0x4df9aa){_0x4df9aa=_0x4df9aa||0xc8;return function(_0x4a7f27){if(_0x4a7f27){return _0x8b05bd[_0xa861('0x19')](_0x4df9aa)[_0xa861('0x1a')](_0x4a7f27);}};}function respondWithFilteredResult(_0x405e23,_0xb5ce78){return function(_0x4792d3){if(_0x4792d3){var _0x2e69c1=typeof _0xb5ce78['offset']==='undefined'&&typeof _0xb5ce78[_0xa861('0x1b')]===_0xa861('0x1c');var _0x18c897=_0x4792d3['count'];var _0xc85eb3=_0x2e69c1?0x0:_0xb5ce78[_0xa861('0x1d')];var _0x2cbdae=_0x2e69c1?_0x4792d3[_0xa861('0x1e')]:_0xb5ce78[_0xa861('0x1d')]+_0xb5ce78['limit'];var _0x20e465;if(_0x2cbdae>=_0x18c897){_0x2cbdae=_0x18c897;_0x20e465=0xc8;}else{_0x20e465=0xce;}_0x405e23[_0xa861('0x19')](_0x20e465);return _0x405e23[_0xa861('0x1f')](_0xa861('0x20'),_0xc85eb3+'-'+_0x2cbdae+'/'+_0x18c897)[_0xa861('0x1a')](_0x4792d3);}return null;};}function patchUpdates(_0x52ca65){return function(_0x398e49){try{jsonpatch[_0xa861('0x21')](_0x398e49,_0x52ca65,!![]);}catch(_0x2437ad){return BPromise['reject'](_0x2437ad);}return _0x398e49[_0xa861('0x22')]();};}function saveUpdates(_0x353299,_0x58270d){return function(_0x24e305){if(_0x24e305){return _0x24e305[_0xa861('0x23')](_0x353299)[_0xa861('0x24')](function(_0x53d561){return _0x53d561;});}return null;};}function removeEntity(_0x3fd022,_0x225d1f){return function(_0x59bc73){if(_0x59bc73){return _0x59bc73[_0xa861('0x25')]()[_0xa861('0x24')](function(){_0x3fd022['status'](0xcc)[_0xa861('0x26')]();});}};}function handleEntityNotFound(_0x133c81,_0x1653a1){return function(_0x598b72){if(!_0x598b72){_0x133c81[_0xa861('0x18')](0x194);}return _0x598b72;};}function handleError(_0x358915,_0x364589){_0x364589=_0x364589||0x1f4;return function(_0x2176d3){logger[_0xa861('0x27')](_0x2176d3[_0xa861('0x28')]);if(_0x2176d3[_0xa861('0x29')]){delete _0x2176d3['name'];}_0x358915[_0xa861('0x19')](_0x364589)[_0xa861('0x2a')](_0x2176d3);};}exports[_0xa861('0x2b')]=function(_0x58a58c,_0x332f41){var _0x27d3fd={'raw':!![],'where':{'id':_0x58a58c[_0xa861('0x2c')]['id']}},_0x332fad={};_0x332fad[_0xa861('0x2d')]=_[_0xa861('0x2e')](db['ChatProactiveAction']['rawAttributes']);_0x332fad['query']=_[_0xa861('0x2e')](_0x58a58c['query']);_0x332fad[_0xa861('0x2f')]=_[_0xa861('0x30')](_0x332fad[_0xa861('0x2d')],_0x332fad[_0xa861('0x31')]);_0x27d3fd['attributes']=_[_0xa861('0x30')](_0x332fad[_0xa861('0x2d')],qs[_0xa861('0x32')](_0x58a58c[_0xa861('0x31')]['fields']));_0x27d3fd[_0xa861('0x33')]=_0x27d3fd['attributes'][_0xa861('0x34')]?_0x27d3fd[_0xa861('0x33')]:_0x332fad[_0xa861('0x2d')];if(_0x58a58c[_0xa861('0x31')][_0xa861('0x35')]){_0x27d3fd[_0xa861('0x36')]=[{'all':!![]}];}_0x27d3fd=_['merge']({},_0x27d3fd,_0x58a58c[_0xa861('0x37')]);return db[_0xa861('0x38')][_0xa861('0x39')](_0x27d3fd)[_0xa861('0x24')](handleEntityNotFound(_0x332f41,null))[_0xa861('0x24')](respondWithResult(_0x332f41,null))[_0xa861('0x3a')](handleError(_0x332f41,null));};exports[_0xa861('0x3b')]=function(_0xe49c5d,_0x23fd41){return db[_0xa861('0x38')][_0xa861('0x3b')](_0xe49c5d[_0xa861('0x3c')],{})[_0xa861('0x24')](respondWithResult(_0x23fd41,0xc9))[_0xa861('0x3a')](handleError(_0x23fd41,null));};exports[_0xa861('0x23')]=function(_0x1416c1,_0xd8b83e){if(_0x1416c1[_0xa861('0x3c')]['id']){delete _0x1416c1[_0xa861('0x3c')]['id'];}return db['ChatProactiveAction'][_0xa861('0x39')]({'where':{'id':_0x1416c1[_0xa861('0x2c')]['id']}})['then'](handleEntityNotFound(_0xd8b83e,null))[_0xa861('0x24')](saveUpdates(_0x1416c1[_0xa861('0x3c')],null))[_0xa861('0x24')](respondWithResult(_0xd8b83e,null))[_0xa861('0x3a')](handleError(_0xd8b83e,null));};exports[_0xa861('0x25')]=function(_0x4ca347,_0x32d495){return db[_0xa861('0x38')][_0xa861('0x39')]({'where':{'id':_0x4ca347[_0xa861('0x2c')]['id']}})['then'](handleEntityNotFound(_0x32d495,null))[_0xa861('0x24')](removeEntity(_0x32d495,null))[_0xa861('0x3a')](handleError(_0x32d495,null));};
\ No newline at end of file
+var _0xa1f6=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv'];(function(_0x5da75a,_0x588bc4){var _0x3a5efe=function(_0x275328){while(--_0x275328){_0x5da75a['push'](_0x5da75a['shift']());}};_0x3a5efe(++_0x588bc4);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0xa1f6[_0x261522];return _0x98a25a;};'use strict';var emlformat=require(_0x6a1f('0x0'));var rimraf=require(_0x6a1f('0x1'));var zipdir=require(_0x6a1f('0x2'));var jsonpatch=require(_0x6a1f('0x3'));var rp=require(_0x6a1f('0x4'));var moment=require(_0x6a1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a1f('0x6'));var ejs=require(_0x6a1f('0x7'));var fs=require('fs');var fs_extra=require(_0x6a1f('0x8'));var _=require(_0x6a1f('0x9'));var squel=require(_0x6a1f('0xa'));var crypto=require(_0x6a1f('0xb'));var jsforce=require(_0x6a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a1f('0x6'));var querystring=require(_0x6a1f('0xd'));var Papa=require(_0x6a1f('0xe'));var Redis=require(_0x6a1f('0xf'));var authService=require(_0x6a1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6a1f('0x11'));var hardwareService=require(_0x6a1f('0x12'));var logger=require(_0x6a1f('0x13'))(_0x6a1f('0x14'));var utils=require('../../config/utils');var config=require(_0x6a1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x16'))['db'];function respondWithStatusCode(_0x17edb6,_0x2a4e94){_0x2a4e94=_0x2a4e94||0xcc;return function(_0x442576){if(_0x442576){return _0x17edb6[_0x6a1f('0x17')](_0x2a4e94);}return _0x17edb6[_0x6a1f('0x18')](_0x2a4e94)[_0x6a1f('0x19')]();};}function respondWithResult(_0x8c3a36,_0x1918c6){_0x1918c6=_0x1918c6||0xc8;return function(_0x27d8f8){if(_0x27d8f8){return _0x8c3a36[_0x6a1f('0x18')](_0x1918c6)[_0x6a1f('0x1a')](_0x27d8f8);}};}function respondWithFilteredResult(_0x253305,_0x2677c1){return function(_0x14ecec){if(_0x14ecec){var _0x11ee0e=typeof _0x2677c1[_0x6a1f('0x1b')]===_0x6a1f('0x1c')&&typeof _0x2677c1[_0x6a1f('0x1d')]==='undefined';var _0x392ccb=_0x14ecec[_0x6a1f('0x1e')];var _0x1ccbed=_0x11ee0e?0x0:_0x2677c1[_0x6a1f('0x1b')];var _0x21d268=_0x11ee0e?_0x14ecec[_0x6a1f('0x1e')]:_0x2677c1[_0x6a1f('0x1b')]+_0x2677c1[_0x6a1f('0x1d')];var _0x5cb044;if(_0x21d268>=_0x392ccb){_0x21d268=_0x392ccb;_0x5cb044=0xc8;}else{_0x5cb044=0xce;}_0x253305[_0x6a1f('0x18')](_0x5cb044);return _0x253305['set'](_0x6a1f('0x1f'),_0x1ccbed+'-'+_0x21d268+'/'+_0x392ccb)[_0x6a1f('0x1a')](_0x14ecec);}return null;};}function patchUpdates(_0x3c7ed0){return function(_0x1b5856){try{jsonpatch[_0x6a1f('0x20')](_0x1b5856,_0x3c7ed0,!![]);}catch(_0x4eae7f){return BPromise[_0x6a1f('0x21')](_0x4eae7f);}return _0x1b5856[_0x6a1f('0x22')]();};}function saveUpdates(_0xa43cd5,_0x1be0c3){return function(_0x312e75){if(_0x312e75){return _0x312e75[_0x6a1f('0x23')](_0xa43cd5)[_0x6a1f('0x24')](function(_0x2736ab){return _0x2736ab;});}return null;};}function removeEntity(_0x53229b,_0x1eb146){return function(_0x3d953d){if(_0x3d953d){return _0x3d953d['destroy']()['then'](function(){_0x53229b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea158,_0x5e6013){return function(_0x5abe40){if(!_0x5abe40){_0x3ea158[_0x6a1f('0x17')](0x194);}return _0x5abe40;};}function handleError(_0x286d1d,_0x2b53ca){_0x2b53ca=_0x2b53ca||0x1f4;return function(_0x1e8db8){logger[_0x6a1f('0x25')](_0x1e8db8[_0x6a1f('0x26')]);if(_0x1e8db8[_0x6a1f('0x27')]){delete _0x1e8db8[_0x6a1f('0x27')];}_0x286d1d['status'](_0x2b53ca)[_0x6a1f('0x28')](_0x1e8db8);};}exports[_0x6a1f('0x29')]=function(_0x3f0730,_0x574d80){var _0x1e951c={'raw':!![],'where':{'id':_0x3f0730[_0x6a1f('0x2a')]['id']}},_0x155c58={};_0x155c58[_0x6a1f('0x2b')]=_[_0x6a1f('0x2c')](db[_0x6a1f('0x2d')][_0x6a1f('0x2e')]);_0x155c58['query']=_['keys'](_0x3f0730[_0x6a1f('0x2f')]);_0x155c58[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x155c58[_0x6a1f('0x2b')],_0x155c58[_0x6a1f('0x2f')]);_0x1e951c[_0x6a1f('0x32')]=_[_0x6a1f('0x31')](_0x155c58['model'],qs[_0x6a1f('0x33')](_0x3f0730[_0x6a1f('0x2f')]['fields']));_0x1e951c[_0x6a1f('0x32')]=_0x1e951c[_0x6a1f('0x32')][_0x6a1f('0x34')]?_0x1e951c['attributes']:_0x155c58['model'];if(_0x3f0730[_0x6a1f('0x2f')][_0x6a1f('0x35')]){_0x1e951c[_0x6a1f('0x36')]=[{'all':!![]}];}_0x1e951c=_['merge']({},_0x1e951c,_0x3f0730['options']);return db[_0x6a1f('0x2d')][_0x6a1f('0x37')](_0x1e951c)[_0x6a1f('0x24')](handleEntityNotFound(_0x574d80,null))[_0x6a1f('0x24')](respondWithResult(_0x574d80,null))[_0x6a1f('0x38')](handleError(_0x574d80,null));};exports[_0x6a1f('0x39')]=function(_0x1ac8cf,_0x5dfc6f){return db[_0x6a1f('0x2d')]['create'](_0x1ac8cf[_0x6a1f('0x3a')],{})[_0x6a1f('0x24')](respondWithResult(_0x5dfc6f,0xc9))['catch'](handleError(_0x5dfc6f,null));};exports[_0x6a1f('0x23')]=function(_0x72ec84,_0x49065f){if(_0x72ec84[_0x6a1f('0x3a')]['id']){delete _0x72ec84['body']['id'];}return db[_0x6a1f('0x2d')]['find']({'where':{'id':_0x72ec84[_0x6a1f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x49065f,null))[_0x6a1f('0x24')](saveUpdates(_0x72ec84[_0x6a1f('0x3a')],null))['then'](respondWithResult(_0x49065f,null))[_0x6a1f('0x38')](handleError(_0x49065f,null));};exports[_0x6a1f('0x3b')]=function(_0x5ec8cb,_0x5beb28){return db[_0x6a1f('0x2d')][_0x6a1f('0x37')]({'where':{'id':_0x5ec8cb[_0x6a1f('0x2a')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x5beb28,null))[_0x6a1f('0x24')](removeEntity(_0x5beb28,null))[_0x6a1f('0x38')](handleError(_0x5beb28,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 92a6b0a..dcd35dd 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 _0xacf2=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xacf2,0xcc));var _0x2acf=function(_0x3c2efd,_0x405f28){_0x3c2efd=_0x3c2efd-0x0;var _0x433b01=_0xacf2[_0x3c2efd];return _0x433b01;};'use strict';var _=require(_0x2acf('0x0'));var util=require(_0x2acf('0x1'));var logger=require(_0x2acf('0x2'))(_0x2acf('0x3'));var moment=require(_0x2acf('0x4'));var BPromise=require(_0x2acf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2acf('0x6'));var rimraf=require('rimraf');var config=require(_0x2acf('0x7'));var attributes=require(_0x2acf('0x8'));module[_0x2acf('0x9')]=function(_0x2bab77,_0x20b6c9){return _0x2bab77['define'](_0x2acf('0xa'),attributes,{'tableName':_0x2acf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9404=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5e21c1,_0x40d43a){var _0x5cb6f1=function(_0x58cec0){while(--_0x58cec0){_0x5e21c1['push'](_0x5e21c1['shift']());}};_0x5cb6f1(++_0x40d43a);}(_0x9404,0xd9));var _0x4940=function(_0x4575e1,_0x9a3579){_0x4575e1=_0x4575e1-0x0;var _0xb478e1=_0x9404[_0x4575e1];return _0xb478e1;};'use strict';var _=require(_0x4940('0x0'));var util=require(_0x4940('0x1'));var logger=require(_0x4940('0x2'))(_0x4940('0x3'));var moment=require(_0x4940('0x4'));var BPromise=require(_0x4940('0x5'));var rp=require(_0x4940('0x6'));var fs=require('fs');var path=require(_0x4940('0x7'));var rimraf=require(_0x4940('0x8'));var config=require(_0x4940('0x9'));var attributes=require('./chatProactiveAction.attributes');module[_0x4940('0xa')]=function(_0x549370,_0x14e0c1){return _0x549370['define']('ChatProactiveAction',attributes,{'tableName':_0x4940('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 50a07aa..e12ab0f 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 _0x8eb8=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','error','code','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x2e4481,_0xd520da){var _0x2d29c9=function(_0x1012aa){while(--_0x1012aa){_0x2e4481['push'](_0x2e4481['shift']());}};_0x2d29c9(++_0xd520da);}(_0x8eb8,0xc9));var _0x88eb=function(_0x32fc67,_0x8b24e6){_0x32fc67=_0x32fc67-0x0;var _0xca5341=_0x8eb8[_0x32fc67];return _0xca5341;};'use strict';var _=require(_0x88eb('0x0'));var util=require(_0x88eb('0x1'));var moment=require(_0x88eb('0x2'));var BPromise=require(_0x88eb('0x3'));var rs=require(_0x88eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x88eb('0x5'))('rpc');var config=require(_0x88eb('0x6'));var jayson=require(_0x88eb('0x7'));var client=jayson[_0x88eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x84659f,_0x1ad8ce,_0x3e52e7){return new BPromise(function(_0x1025f7,_0x4784b1){return client[_0x88eb('0x9')](_0x84659f,_0x3e52e7)['then'](function(_0x2fc1df){logger[_0x88eb('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x1ad8ce,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1ad8ce,_0x88eb('0xb'),JSON['stringify'](_0x2fc1df));if(_0x2fc1df[_0x88eb('0xc')]){if(_0x2fc1df[_0x88eb('0xc')][_0x88eb('0xd')]===0x1f4){logger[_0x88eb('0xc')](_0x88eb('0xe'),_0x1ad8ce,_0x2fc1df[_0x88eb('0xc')][_0x88eb('0xf')]);return _0x4784b1(_0x2fc1df[_0x88eb('0xc')][_0x88eb('0xf')]);}logger[_0x88eb('0xc')](_0x88eb('0xe'),_0x1ad8ce,_0x2fc1df[_0x88eb('0xc')]['message']);return _0x1025f7(_0x2fc1df[_0x88eb('0xc')][_0x88eb('0xf')]);}else{logger['info'](_0x88eb('0xe'),_0x1ad8ce,'request\x20sent');_0x1025f7(_0x2fc1df[_0x88eb('0x10')][_0x88eb('0xf')]);}})[_0x88eb('0x11')](function(_0x13e0c0){logger[_0x88eb('0xc')](_0x88eb('0xe'),_0x1ad8ce,_0x13e0c0);_0x4784b1(_0x13e0c0);});});}
\ No newline at end of file
+var _0xce3f=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xce3f,0x170));var _0xfce3=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xce3f[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xfce3('0x0'));var util=require(_0xfce3('0x1'));var moment=require(_0xfce3('0x2'));var BPromise=require('bluebird');var rs=require(_0xfce3('0x3'));var fs=require('fs');var Redis=require(_0xfce3('0x4'));var db=require(_0xfce3('0x5'))['db'];var utils=require(_0xfce3('0x6'));var logger=require(_0xfce3('0x7'))('rpc');var config=require(_0xfce3('0x8'));var jayson=require(_0xfce3('0x9'));var client=jayson[_0xfce3('0xa')][_0xfce3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2da248,_0x25edba,_0x51da69){return new BPromise(function(_0xa9a368,_0x58baac){return client[_0xfce3('0xc')](_0x2da248,_0x51da69)[_0xfce3('0xd')](function(_0x5cf7b2){logger['info'](_0xfce3('0xe'),_0x25edba,_0xfce3('0xf'));logger['debug'](_0xfce3('0x10'),_0x25edba,'request\x20sent',JSON[_0xfce3('0x11')](_0x5cf7b2));if(_0x5cf7b2[_0xfce3('0x12')]){if(_0x5cf7b2[_0xfce3('0x12')][_0xfce3('0x13')]===0x1f4){logger[_0xfce3('0x12')](_0xfce3('0xe'),_0x25edba,_0x5cf7b2[_0xfce3('0x12')][_0xfce3('0x14')]);return _0x58baac(_0x5cf7b2[_0xfce3('0x12')][_0xfce3('0x14')]);}logger[_0xfce3('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x25edba,_0x5cf7b2[_0xfce3('0x12')][_0xfce3('0x14')]);return _0xa9a368(_0x5cf7b2[_0xfce3('0x12')][_0xfce3('0x14')]);}else{logger[_0xfce3('0x15')](_0xfce3('0xe'),_0x25edba,_0xfce3('0xf'));_0xa9a368(_0x5cf7b2[_0xfce3('0x16')]['message']);}})[_0xfce3('0x17')](function(_0x480e9e){logger[_0xfce3('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x25edba,_0x480e9e);_0x58baac(_0x480e9e);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 36f5aa5..be9b53c 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 _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x40adf9,_0x4157de){var _0x51b1ec=function(_0x4acf19){while(--_0x4acf19){_0x40adf9['push'](_0x40adf9['shift']());}};_0x51b1ec(++_0x4157de);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1c996e,_0x2933f4){_0x1c996e=_0x1c996e-0x0;var _0x567c6b=_0xdc97[_0x1c996e];return _0x567c6b;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router;
\ No newline at end of file
+var _0x425d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425d,0x1e0));var _0xd425=function(_0x495707,_0x2d72eb){_0x495707=_0x495707-0x0;var _0x269dc4=_0x425d[_0x495707];return _0x269dc4;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0xc')]);router[_0xd425('0xd')]('/',auth['isAuthenticated'](),controller[_0xd425('0xe')]);router[_0xd425('0xf')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x10')]);router[_0xd425('0x11')](_0xd425('0xa'),auth[_0xd425('0xb')](),controller[_0xd425('0x12')]);module[_0xd425('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 515bdea..d3aff01 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 _0xafb1=['roundrobin','sequelize','name','STRING','rrmemory'];(function(_0x47c0a5,_0x21fb53){var _0x50878c=function(_0xa930){while(--_0xa930){_0x47c0a5['push'](_0x47c0a5['shift']());}};_0x50878c(++_0x21fb53);}(_0xafb1,0x1cd));var _0x1afb=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0xafb1[_0x10d670];return _0x20d6f8;};'use strict';var Sequelize=require(_0x1afb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1afb('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1afb('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1afb('0x3'),'beepall',_0x1afb('0x4'))}};
\ No newline at end of file
+var _0xdee6=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x2e2b00,_0x167bad){var _0x28b207=function(_0x10aa97){while(--_0x10aa97){_0x2e2b00['push'](_0x2e2b00['shift']());}};_0x28b207(++_0x167bad);}(_0xdee6,0xf1));var _0x6dee=function(_0x3dff97,_0x171b0b){_0x3dff97=_0x3dff97-0x0;var _0x17708f=_0xdee6[_0x3dff97];return _0x17708f;};'use strict';var Sequelize=require(_0x6dee('0x0'));module[_0x6dee('0x1')]={'name':{'type':Sequelize[_0x6dee('0x2')],'unique':_0x6dee('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6dee('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6dee('0x5')](_0x6dee('0x6'),_0x6dee('0x7'),_0x6dee('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c1209e4..e5d182d 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 _0x7cd2=['%s/%s','getTeams','Team','order','sort','ids','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','select','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','includes','all','union','value','removeTeams','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','nolimit','bluebird','util','ioredis','../../components/parsers/qs','api','defaults','redis','localhost','./chatQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','type','key','getOptions','where','ChatQueue','include','query','findAll','rows','catch','show','params','model','keys','rawAttributes','filters','attributes','intersection','fields','length','merge','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','pick','filter','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format'];(function(_0x34ecb6,_0x5ee425){var _0xce47f7=function(_0x40818a){while(--_0x40818a){_0x34ecb6['push'](_0x34ecb6['shift']());}};_0xce47f7(++_0x5ee425);}(_0x7cd2,0x107));var _0x27cd=function(_0x34ef0c,_0x354b30){_0x34ef0c=_0x34ef0c-0x0;var _0x21e732=_0x7cd2[_0x34ef0c];return _0x21e732;};'use strict';var BPromise=require(_0x27cd('0x0'));var util=require(_0x27cd('0x1'));var _=require('lodash');var squel=require('squel');var Redis=require(_0x27cd('0x2'));var qs=require(_0x27cd('0x3'));var logger=require('../../config/logger')(_0x27cd('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x27cd('0x5')](config[_0x27cd('0x6')],{'host':_0x27cd('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x27cd('0x6')]));require(_0x27cd('0x8'))[_0x27cd('0x9')](socket);function respondWithStatusCode(_0x46f4ce,_0x1a4ae2){_0x1a4ae2=_0x1a4ae2||0xcc;return function(_0x309829){if(_0x309829){return _0x46f4ce['sendStatus'](_0x1a4ae2);}return _0x46f4ce[_0x27cd('0xa')](_0x1a4ae2)[_0x27cd('0xb')]();};}function respondWithResult(_0x2266cc,_0x18c9cd){_0x18c9cd=_0x18c9cd||0xc8;return function(_0x5a5825){if(_0x5a5825){return _0x2266cc[_0x27cd('0xa')](_0x18c9cd)[_0x27cd('0xc')](_0x5a5825);}};}function respondWithFilteredResult(_0x47b440,_0x56ac75){return function(_0x567369){if(_0x567369){var _0x4b140e=typeof _0x56ac75[_0x27cd('0xd')]===_0x27cd('0xe')&&typeof _0x56ac75[_0x27cd('0xf')]===_0x27cd('0xe');var _0x51a7df=_0x567369[_0x27cd('0x10')];var _0x4e20b5=_0x4b140e?0x0:_0x56ac75[_0x27cd('0xd')];var _0xfc507c=_0x4b140e?_0x567369[_0x27cd('0x10')]:_0x56ac75['offset']+_0x56ac75[_0x27cd('0xf')];var _0x3d23c8;if(_0xfc507c>=_0x51a7df){_0xfc507c=_0x51a7df;_0x3d23c8=0xc8;}else{_0x3d23c8=0xce;}_0x47b440[_0x27cd('0xa')](_0x3d23c8);return _0x47b440[_0x27cd('0x11')](_0x27cd('0x12'),_0x4e20b5+'-'+_0xfc507c+'/'+_0x51a7df)[_0x27cd('0xc')](_0x567369);}return null;};}function saveUpdates(_0x52af15){return function(_0x5b3d13){if(_0x5b3d13){return _0x5b3d13[_0x27cd('0x13')](_0x52af15)[_0x27cd('0x14')](function(_0x362703){return _0x362703;});}return null;};}function removeEntity(_0x13c0ef){return function(_0x4560c3){if(_0x4560c3){return _0x4560c3[_0x27cd('0x15')]()[_0x27cd('0x14')](function(){var _0x443133=_0x4560c3[_0x27cd('0x16')]({'plain':!![]});var _0xd6b861=_0x27cd('0x17');return db[_0x27cd('0x18')][_0x27cd('0x15')]({'where':{'type':_0xd6b861,'resourceId':_0x443133['id']}})[_0x27cd('0x14')](function(){return _0x4560c3;});})[_0x27cd('0x14')](function(){_0x13c0ef['status'](0xcc)[_0x27cd('0xb')]();});}};}function handleEntityNotFound(_0x4f3703){return function(_0x2e9543){if(!_0x2e9543){_0x4f3703['sendStatus'](0x194);}return _0x2e9543;};}function handleError(_0x5c0e77,_0x1f41cb){_0x1f41cb=_0x1f41cb||0x1f4;return function(_0x10c58d){logger['error'](_0x10c58d['stack']);if(_0x10c58d[_0x27cd('0x19')]){delete _0x10c58d[_0x27cd('0x19')];}_0x5c0e77[_0x27cd('0xa')](_0x1f41cb)[_0x27cd('0x1a')](_0x10c58d);};}exports[_0x27cd('0x1b')]=function(_0x56be21,_0x4bc0b2){var _0x9193de={};var _0x121bd4={'count':0x0,'rows':[]};var _0x30afbb=_[_0x27cd('0x1c')](db['ChatQueue']['rawAttributes'],function(_0x2f4c12){return{'name':_0x2f4c12['fieldName'],'type':_0x2f4c12[_0x27cd('0x1d')][_0x27cd('0x1e')]};});_0x9193de=qs[_0x27cd('0x1f')](_0x30afbb,_0x56be21);var _0x1be40b={'where':_0x9193de[_0x27cd('0x20')]};return db[_0x27cd('0x21')][_0x27cd('0x10')](_0x1be40b)[_0x27cd('0x14')](function(_0x165a6f){_0x121bd4[_0x27cd('0x10')]=_0x165a6f;_0x9193de[_0x27cd('0x22')]=qs[_0x27cd('0x22')](_0x56be21[_0x27cd('0x23')]);return db[_0x27cd('0x21')][_0x27cd('0x24')](_0x9193de);})[_0x27cd('0x14')](function(_0x2ca4ae){_0x121bd4[_0x27cd('0x25')]=_0x2ca4ae;return _0x121bd4;})[_0x27cd('0x14')](respondWithFilteredResult(_0x4bc0b2,_0x9193de))[_0x27cd('0x26')](handleError(_0x4bc0b2,null));};exports[_0x27cd('0x27')]=function(_0x1bbeea,_0x24ae00){var _0x5d267b={'raw':!![],'where':{'id':_0x1bbeea[_0x27cd('0x28')]['id']}},_0x4d576b={};_0x4d576b[_0x27cd('0x29')]=_[_0x27cd('0x2a')](db['ChatQueue'][_0x27cd('0x2b')]);_0x4d576b[_0x27cd('0x23')]=_[_0x27cd('0x2a')](_0x1bbeea[_0x27cd('0x23')]);_0x4d576b[_0x27cd('0x2c')]=_['intersection'](_0x4d576b[_0x27cd('0x29')],_0x4d576b[_0x27cd('0x23')]);_0x5d267b[_0x27cd('0x2d')]=_[_0x27cd('0x2e')](_0x4d576b[_0x27cd('0x29')],qs[_0x27cd('0x2f')](_0x1bbeea[_0x27cd('0x23')]['fields']));_0x5d267b[_0x27cd('0x2d')]=_0x5d267b[_0x27cd('0x2d')][_0x27cd('0x30')]?_0x5d267b[_0x27cd('0x2d')]:_0x4d576b[_0x27cd('0x29')];if(_0x1bbeea['query']['includeAll']){_0x5d267b[_0x27cd('0x22')]=[{'all':!![]}];}_0x5d267b=_[_0x27cd('0x31')]({},_0x5d267b,_0x1bbeea[_0x27cd('0x32')]);return db['ChatQueue'][_0x27cd('0x33')](_0x5d267b)[_0x27cd('0x14')](handleEntityNotFound(_0x24ae00,null))[_0x27cd('0x14')](respondWithResult(_0x24ae00,null))[_0x27cd('0x26')](handleError(_0x24ae00,null));};exports['create']=function(_0x5247a7,_0x4e8432){return db[_0x27cd('0x21')]['create'](_0x5247a7[_0x27cd('0x34')],{})[_0x27cd('0x14')](function(_0x37d6fd){var _0x22fe16=_0x5247a7[_0x27cd('0x35')]['get']({'plain':!![]});if(!_0x22fe16)throw new Error(_0x27cd('0x36'));if(_0x22fe16[_0x27cd('0x37')]===_0x27cd('0x35')){var _0x5058ae=_0x37d6fd[_0x27cd('0x16')]({'plain':!![]});var _0x21c491='ChatQueues';return db['UserProfileSection'][_0x27cd('0x33')]({'where':{'name':_0x21c491,'userProfileId':_0x22fe16[_0x27cd('0x38')]},'raw':!![]})['then'](function(_0x358588){if(_0x358588&&_0x358588[_0x27cd('0x39')]===0x0){return db[_0x27cd('0x18')]['create']({'name':_0x5058ae[_0x27cd('0x19')],'resourceId':_0x5058ae['id'],'type':_0x358588[_0x27cd('0x19')],'sectionId':_0x358588['id']},{})[_0x27cd('0x14')](function(){return _0x37d6fd;});}else{return _0x37d6fd;}})[_0x27cd('0x26')](function(_0x574f73){logger['error'](_0x27cd('0x3a'),_0x574f73);throw _0x574f73;});}return _0x37d6fd;})[_0x27cd('0x14')](respondWithResult(_0x4e8432,0xc9))['catch'](handleError(_0x4e8432,null));};exports[_0x27cd('0x13')]=function(_0x9b0907,_0x39f5e6){if(_0x9b0907[_0x27cd('0x34')]['id']){delete _0x9b0907[_0x27cd('0x34')]['id'];}return db['ChatQueue'][_0x27cd('0x33')]({'where':{'id':_0x9b0907['params']['id']}})[_0x27cd('0x14')](handleEntityNotFound(_0x39f5e6,null))[_0x27cd('0x14')](saveUpdates(_0x9b0907[_0x27cd('0x34')],null))[_0x27cd('0x14')](respondWithResult(_0x39f5e6,null))[_0x27cd('0x26')](handleError(_0x39f5e6,null));};exports[_0x27cd('0x15')]=function(_0x64da3,_0x52a593){return db[_0x27cd('0x21')][_0x27cd('0x33')]({'where':{'id':_0x64da3[_0x27cd('0x28')]['id']}})[_0x27cd('0x14')](handleEntityNotFound(_0x52a593,null))[_0x27cd('0x14')](removeEntity(_0x52a593,null))[_0x27cd('0x26')](handleError(_0x52a593,null));};exports[_0x27cd('0x3b')]=function(_0x28203c,_0x152c44){return db[_0x27cd('0x21')][_0x27cd('0x3b')]()[_0x27cd('0x14')](respondWithResult(_0x152c44,null))[_0x27cd('0x26')](handleError(_0x152c44,null));};exports[_0x27cd('0x3c')]=function(_0xf990e4,_0xf054d2){var _0x10a449={'raw':!![],'where':{}},_0x2a904={},_0x4dbb61;return db['ChatQueue'][_0x27cd('0x3d')]({'where':{'id':_0xf990e4[_0x27cd('0x28')]['id']}})[_0x27cd('0x14')](handleEntityNotFound(_0xf054d2,null))[_0x27cd('0x14')](function(_0x46c2f9){if(_0x46c2f9){_0x4dbb61=_0x46c2f9[_0x27cd('0x16')]({'plain':!![]});_0x2a904['model']=_[_0x27cd('0x2a')](db[_0x27cd('0x3e')][_0x27cd('0x2b')]);_0x2a904[_0x27cd('0x23')]=_['keys'](_0xf990e4['query']);_0x2a904[_0x27cd('0x2c')]=_['intersection'](_0x2a904[_0x27cd('0x29')],_0x2a904[_0x27cd('0x23')]);_0x10a449[_0x27cd('0x2d')]=_[_0x27cd('0x2e')](_0x2a904[_0x27cd('0x29')],qs[_0x27cd('0x2f')](_0xf990e4[_0x27cd('0x23')]['fields']));_0x10a449[_0x27cd('0x2d')]=_0x10a449[_0x27cd('0x2d')]['length']?_0x10a449[_0x27cd('0x2d')]:_0x2a904[_0x27cd('0x29')];if(!_0xf990e4['query'][_0x27cd('0x3f')]('nolimit')){_0x10a449[_0x27cd('0xf')]=qs[_0x27cd('0xf')](_0xf990e4[_0x27cd('0x23')]['limit']);_0x10a449[_0x27cd('0xd')]=qs[_0x27cd('0xd')](_0xf990e4[_0x27cd('0x23')]['offset']);}_0x10a449['order']=qs['sort'](_0xf990e4[_0x27cd('0x23')]['sort']);_0x10a449['where']=qs[_0x27cd('0x2c')](_[_0x27cd('0x40')](_0xf990e4[_0x27cd('0x23')],_0x2a904[_0x27cd('0x2c')]));_0x10a449[_0x27cd('0x20')]['ChatQueueId']=_0x46c2f9['id'];if(_0xf990e4[_0x27cd('0x23')][_0x27cd('0x41')]){_0x10a449['where']=_[_0x27cd('0x31')](_0x10a449[_0x27cd('0x20')],{'$or':_[_0x27cd('0x1c')](_0x10a449['attributes'],function(_0xda7f03){var _0x5c1895={};_0x5c1895[_0xda7f03]={'$like':'%'+_0xf990e4['query'][_0x27cd('0x41')]+'%'};return _0x5c1895;})});}_0x10a449=_[_0x27cd('0x31')]({},_0x10a449,_0xf990e4[_0x27cd('0x32')]);return db[_0x27cd('0x3e')][_0x27cd('0x24')](_0x10a449);}})[_0x27cd('0x14')](function(_0x4382c9){if(_0x4382c9){return db[_0x27cd('0x42')][_0x27cd('0x43')]({'where':{'id':_[_0x27cd('0x1c')](_0x4382c9,'UserId'),'role':_0x27cd('0x44')},'attributes':['id',_0x27cd('0x19'),_0x27cd('0x45'),_0x27cd('0x46'),_0x27cd('0x47')]});}})[_0x27cd('0x14')](function(_0x11a91c){if(_0x11a91c){return{'count':_0x11a91c[_0x27cd('0x10')],'rows':_[_0x27cd('0x1c')](_0x11a91c['rows'],function(_0x29d76d){return{'membername':_0x29d76d[_0x27cd('0x19')],'UserId':_0x29d76d['id'],'queue_name':_0x4dbb61['name'],'ChatQueueId':_0x4dbb61['id'],'interface':util[_0x27cd('0x48')](_0x27cd('0x49'),'SIP',_0x29d76d['name']),'penalty':0x0,'paused':_0x29d76d[_0x27cd('0x45')],'createdAt':_0x29d76d[_0x27cd('0x47')],'updatedAt':_0x29d76d[_0x27cd('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x27cd('0x14')](respondWithFilteredResult(_0xf054d2,_0x10a449))[_0x27cd('0x26')](handleError(_0xf054d2,null));};exports[_0x27cd('0x4a')]=function(_0x199606,_0x469e32){var _0x2e5398={};var _0x15c2a8={};var _0x208866;var _0xefc301;return db[_0x27cd('0x21')][_0x27cd('0x3d')]({'where':{'id':_0x199606[_0x27cd('0x28')]['id']}})[_0x27cd('0x14')](handleEntityNotFound(_0x469e32,null))[_0x27cd('0x14')](function(_0x3778c0){if(_0x3778c0){_0x208866=_0x3778c0;_0x15c2a8[_0x27cd('0x29')]=_[_0x27cd('0x2a')](db[_0x27cd('0x4b')][_0x27cd('0x2b')]);_0x15c2a8[_0x27cd('0x23')]=_[_0x27cd('0x2a')](_0x199606[_0x27cd('0x23')]);_0x15c2a8['filters']=_['intersection'](_0x15c2a8[_0x27cd('0x29')],_0x15c2a8[_0x27cd('0x23')]);_0x2e5398[_0x27cd('0x2d')]=_[_0x27cd('0x2e')](_0x15c2a8[_0x27cd('0x29')],qs[_0x27cd('0x2f')](_0x199606['query'][_0x27cd('0x2f')]));_0x2e5398[_0x27cd('0x2d')]=_0x2e5398['attributes'][_0x27cd('0x30')]?_0x2e5398[_0x27cd('0x2d')]:_0x15c2a8[_0x27cd('0x29')];_0x2e5398[_0x27cd('0x4c')]=qs[_0x27cd('0x4d')](_0x199606[_0x27cd('0x23')][_0x27cd('0x4d')]);_0x2e5398[_0x27cd('0x20')]=qs[_0x27cd('0x2c')](_[_0x27cd('0x40')](_0x199606[_0x27cd('0x23')],_0x15c2a8[_0x27cd('0x2c')]));if(_0x199606['query']['filter']){_0x2e5398[_0x27cd('0x20')]=_['merge'](_0x2e5398[_0x27cd('0x20')],{'$or':_[_0x27cd('0x1c')](_0x2e5398[_0x27cd('0x2d')],function(_0x5d3ee8){var _0x48535a={};_0x48535a[_0x5d3ee8]={'$like':'%'+_0x199606[_0x27cd('0x23')]['filter']+'%'};return _0x48535a;})});}_0x2e5398=_[_0x27cd('0x31')]({},_0x2e5398,_0x199606[_0x27cd('0x32')]);return _0x208866[_0x27cd('0x4a')](_0x2e5398);}})[_0x27cd('0x14')](function(_0x5eaab4){if(_0x5eaab4){_0xefc301=_0x5eaab4[_0x27cd('0x30')];if(!_0x199606[_0x27cd('0x23')]['hasOwnProperty']('nolimit')){_0x2e5398[_0x27cd('0xf')]=qs['limit'](_0x199606[_0x27cd('0x23')][_0x27cd('0xf')]);_0x2e5398['offset']=qs[_0x27cd('0xd')](_0x199606['query'][_0x27cd('0xd')]);}return _0x208866['getTeams'](_0x2e5398);}})[_0x27cd('0x14')](function(_0x1d5c4c){if(_0x1d5c4c){return _0x1d5c4c?{'count':_0xefc301,'rows':_0x1d5c4c}:null;}})[_0x27cd('0x14')](respondWithResult(_0x469e32,null))['catch'](handleError(_0x469e32,null));};exports['addTeams']=function(_0x4ef199,_0xddd182){var _0x577540=_0x4ef199[_0x27cd('0x34')][_0x27cd('0x4e')];return db[_0x27cd('0x4b')]['findAll']({'where':{'id':_0x577540},'attributes':['id'],'include':[{'model':db[_0x27cd('0x42')],'as':_0x27cd('0x4f'),'attributes':['id','name',_0x27cd('0x50'),'voicePause',_0x27cd('0x51')],'raw':!![]}]})['then'](function(_0x5207fc){if(_0x5207fc){var _0x43466b=_[_0x27cd('0x52')](_0x5207fc,function(_0x232060){var _0x103cf9=_0x232060[_0x27cd('0x16')]({'plain':!![]});return _0x103cf9[_0x27cd('0x4f')];});return db[_0x27cd('0x21')]['find']({'where':{'id':_0x4ef199[_0x27cd('0x28')]['id']}})[_0x27cd('0x14')](function(_0xf96a57){return db[_0x27cd('0x53')][_0x27cd('0x54')](function(_0x49c287){return _0xf96a57[_0x27cd('0x55')](_0x577540,{'transaction':_0x49c287})[_0x27cd('0x14')](function(){return BPromise[_0x27cd('0x56')](_0x43466b,function(_0x2df54f){return db[_0x27cd('0x3e')]['findOrCreate']({'where':{'UserId':_0x2df54f['id'],'ChatQueueId':_0x4ef199[_0x27cd('0x28')]['id']},'transaction':_0x49c287});});})[_0x27cd('0x14')](function(){_0x43466b[_0x27cd('0x57')](function(_0x3b0055){socket[_0x27cd('0x58')]('userChatQueue:save',{'UserId':_0x3b0055['id'],'ChatQueueId':_0xf96a57['id']});});});});});}})['then'](respondWithStatusCode(_0xddd182,null))['catch'](handleError(_0xddd182,null));};exports['removeTeams']=function(_0x3cee66,_0x225676){return db['Team']['findAll']({'where':{'id':_0x3cee66['query'][_0x27cd('0x4e')]},'attributes':['id'],'include':[{'model':db[_0x27cd('0x42')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x27cd('0x14')](handleEntityNotFound(_0x225676,null))[_0x27cd('0x14')](function(_0x584c48){var _0x2559aa=_[_0x27cd('0x1c')](_0x584c48,'id');var _0x4efb91=[];var _0x2bc126=[];var _0x3c147b=squel[_0x27cd('0x59')]();_0x3c147b['field']('tq.TeamId')[_0x27cd('0x5a')](_0x27cd('0x5b'),'tq')[_0x27cd('0x5c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x27cd('0x20')](_0x27cd('0x5d'),_0x3cee66[_0x27cd('0x28')]['id']);for(var _0x2c875=0x0;_0x2c875<_0x584c48[_0x27cd('0x30')];_0x2c875+=0x1){let _0x11b0b8=_0x584c48[_0x2c875];for(var _0x415c0c=0x0;_0x415c0c<_0x11b0b8[_0x27cd('0x4f')][_0x27cd('0x30')];_0x415c0c+=0x1){let _0x3935e9=_0x11b0b8['Agents'][_0x415c0c];var _0x4a0d3c=_0x3c147b[_0x27cd('0x5e')]();_0x4a0d3c[_0x27cd('0x20')](_0x27cd('0x5f'),_0x3935e9['id']);_0x2bc126[_0x27cd('0x60')](db['sequelize'][_0x27cd('0x23')](_0x4a0d3c[_0x27cd('0x61')](),{'type':db[_0x27cd('0x53')]['QueryTypes']['SELECT']})[_0x27cd('0x14')](function(_0x4cdb20){if(_0x4cdb20[_0x27cd('0x30')]===0x1){return _0x3935e9['id'];}else{var _0x5264c0=_[_0x27cd('0x62')](_['map'](_0x4cdb20,'TeamId'),function(_0x539eea){return _[_0x27cd('0x63')](_0x2559aa,_0x539eea);});if(_0x5264c0){return _0x3935e9['id'];}}}));}}return BPromise[_0x27cd('0x64')](_0x2bc126)[_0x27cd('0x14')](function(_0x39b7fe){_0x4efb91=_(_0x4efb91)[_0x27cd('0x65')](_0x39b7fe)['compact']()[_0x27cd('0x66')]();return db[_0x27cd('0x21')][_0x27cd('0x33')]({'where':{'id':_0x3cee66['params']['id']}})[_0x27cd('0x14')](function(_0x2bf3ad){return db['sequelize'][_0x27cd('0x54')](function(_0x2e1c61){return _0x2bf3ad[_0x27cd('0x67')](_0x3cee66[_0x27cd('0x23')][_0x27cd('0x4e')],{'transaction':_0x2e1c61})[_0x27cd('0x14')](function(){if(!_['isEmpty'](_0x4efb91)){return _0x2bf3ad[_0x27cd('0x68')](_0x4efb91,{'transaction':_0x2e1c61});}})[_0x27cd('0x14')](function(){_0x4efb91[_0x27cd('0x57')](function(_0x391e5e){socket[_0x27cd('0x58')]('userChatQueue:remove',{'UserId':_0x391e5e,'ChatQueueId':_0x2bf3ad['id']});});});});});});})[_0x27cd('0x14')](respondWithStatusCode(_0x225676,null))[_0x27cd('0x26')](handleError(_0x225676,null));};exports['addAgents']=function(_0x3afccb,_0x1ad269){return db['ChatQueue'][_0x27cd('0x33')]({'where':{'id':_0x3afccb[_0x27cd('0x28')]['id']}})[_0x27cd('0x14')](handleEntityNotFound(_0x1ad269,null))[_0x27cd('0x14')](function(_0x53b848){if(_0x53b848){return _0x53b848[_0x27cd('0x69')](_0x3afccb[_0x27cd('0x34')][_0x27cd('0x4e')],_[_0x27cd('0x6a')](_0x3afccb['body'],[_0x27cd('0x4e'),'id'])||{})[_0x27cd('0x6b')](function(_0x189854){for(var _0x12b719=0x0;_0x12b719<_0x3afccb[_0x27cd('0x34')][_0x27cd('0x4e')][_0x27cd('0x30')];_0x12b719+=0x1){socket[_0x27cd('0x58')]('userChatQueue:save',{'UserId':Number(_0x3afccb['body']['ids'][_0x12b719]),'ChatQueueId':Number(_0x3afccb[_0x27cd('0x28')]['id'])});}return _0x189854;});}})[_0x27cd('0x14')](respondWithResult(_0x1ad269,null))[_0x27cd('0x26')](handleError(_0x1ad269,null));};exports[_0x27cd('0x68')]=function(_0x30467d,_0x104e0b){return db[_0x27cd('0x21')]['find']({'where':{'id':_0x30467d[_0x27cd('0x28')]['id']}})['then'](handleEntityNotFound(_0x104e0b,null))[_0x27cd('0x14')](function(_0x11c0ed){if(_0x11c0ed){return _0x11c0ed[_0x27cd('0x68')](_0x30467d[_0x27cd('0x23')]['ids'])[_0x27cd('0x14')](function(){if(_[_0x27cd('0x6c')](_0x30467d[_0x27cd('0x23')][_0x27cd('0x4e')])){for(var _0x3e4c1b=0x0;_0x3e4c1b<_0x30467d['query']['ids'][_0x27cd('0x30')];_0x3e4c1b+=0x1){socket[_0x27cd('0x58')](_0x27cd('0x6d'),{'UserId':Number(_0x30467d['query'][_0x27cd('0x4e')][_0x3e4c1b]),'ChatQueueId':Number(_0x30467d[_0x27cd('0x28')]['id'])});}}else{socket['emit'](_0x27cd('0x6d'),{'UserId':Number(_0x30467d['query']['ids']),'ChatQueueId':Number(_0x30467d[_0x27cd('0x28')]['id'])});}});}})[_0x27cd('0x14')](respondWithStatusCode(_0x104e0b,null))[_0x27cd('0x26')](handleError(_0x104e0b,null));};exports[_0x27cd('0x6e')]=function(_0x6f62e6,_0x42f5a6){var _0x46bc61={};var _0x7b0e61={};var _0x4622a1;var _0x4c5f61;return db[_0x27cd('0x21')][_0x27cd('0x3d')]({'where':{'id':_0x6f62e6['params']['id']}})[_0x27cd('0x14')](handleEntityNotFound(_0x42f5a6,null))['then'](function(_0xdcba05){if(_0xdcba05){_0x4622a1=_0xdcba05;_0x7b0e61[_0x27cd('0x29')]=_[_0x27cd('0x2a')](db[_0x27cd('0x42')][_0x27cd('0x2b')]);_0x7b0e61[_0x27cd('0x23')]=_[_0x27cd('0x2a')](_0x6f62e6[_0x27cd('0x23')]);_0x7b0e61['filters']=_[_0x27cd('0x2e')](_0x7b0e61[_0x27cd('0x29')],_0x7b0e61[_0x27cd('0x23')]);_0x46bc61[_0x27cd('0x2d')]=_['intersection'](_0x7b0e61[_0x27cd('0x29')],qs[_0x27cd('0x2f')](_0x6f62e6[_0x27cd('0x23')][_0x27cd('0x2f')]));_0x46bc61[_0x27cd('0x2d')]=_0x46bc61[_0x27cd('0x2d')]['length']?_0x46bc61[_0x27cd('0x2d')]:_0x7b0e61['model'];_0x46bc61[_0x27cd('0x4c')]=qs['sort'](_0x6f62e6[_0x27cd('0x23')][_0x27cd('0x4d')]);_0x46bc61[_0x27cd('0x20')]=qs[_0x27cd('0x2c')](_[_0x27cd('0x40')](_0x6f62e6['query'],_0x7b0e61[_0x27cd('0x2c')]));if(_0x6f62e6[_0x27cd('0x23')][_0x27cd('0x41')]){_0x46bc61['where']=_[_0x27cd('0x31')](_0x46bc61[_0x27cd('0x20')],{'$or':_[_0x27cd('0x1c')](_0x46bc61[_0x27cd('0x2d')],function(_0x299fdb){var _0x109f71={};_0x109f71[_0x299fdb]={'$like':'%'+_0x6f62e6[_0x27cd('0x23')]['filter']+'%'};return _0x109f71;})});}_0x46bc61=_[_0x27cd('0x31')]({},_0x46bc61,_0x6f62e6[_0x27cd('0x32')]);return _0x4622a1[_0x27cd('0x6e')](_0x46bc61);}})['then'](function(_0x1794f5){if(_0x1794f5){_0x4c5f61=_0x1794f5[_0x27cd('0x30')];if(!_0x6f62e6[_0x27cd('0x23')]['hasOwnProperty'](_0x27cd('0x6f'))){_0x46bc61[_0x27cd('0xf')]=qs[_0x27cd('0xf')](_0x6f62e6[_0x27cd('0x23')][_0x27cd('0xf')]);_0x46bc61['offset']=qs[_0x27cd('0xd')](_0x6f62e6['query'][_0x27cd('0xd')]);}return _0x4622a1[_0x27cd('0x6e')](_0x46bc61);}})[_0x27cd('0x14')](function(_0x5b994c){if(_0x5b994c){return _0x5b994c?{'count':_0x4c5f61,'rows':_0x5b994c}:null;}})[_0x27cd('0x14')](respondWithResult(_0x42f5a6,null))[_0x27cd('0x26')](handleError(_0x42f5a6,null));};
\ No newline at end of file
+var _0x8386=['send','index','map','rawAttributes','fieldName','key','getOptions','where','ChatQueue','include','findAll','rows','show','params','model','query','keys','filters','intersection','fields','attributes','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','UserChatQueue','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','bluebird','util','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','UserProfileResource','end','error'];(function(_0x442409,_0x2e37c6){var _0x58718f=function(_0x5647ae){while(--_0x5647ae){_0x442409['push'](_0x442409['shift']());}};_0x58718f(++_0x2e37c6);}(_0x8386,0x1e7));var _0x6838=function(_0x4ca001,_0x2b049c){_0x4ca001=_0x4ca001-0x0;var _0x429381=_0x8386[_0x4ca001];return _0x429381;};'use strict';var BPromise=require(_0x6838('0x0'));var util=require(_0x6838('0x1'));var _=require(_0x6838('0x2'));var squel=require('squel');var Redis=require(_0x6838('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x6838('0x4'))(_0x6838('0x5'));var config=require(_0x6838('0x6'));var db=require(_0x6838('0x7'))['db'];config[_0x6838('0x8')]=_[_0x6838('0x9')](config[_0x6838('0x8')],{'host':_0x6838('0xa'),'port':0x18eb});var socket=require(_0x6838('0xb'))(new Redis(config['redis']));require(_0x6838('0xc'))[_0x6838('0xd')](socket);function respondWithStatusCode(_0x4a8b0d,_0x43f239){_0x43f239=_0x43f239||0xcc;return function(_0x4f2b2b){if(_0x4f2b2b){return _0x4a8b0d[_0x6838('0xe')](_0x43f239);}return _0x4a8b0d[_0x6838('0xf')](_0x43f239)['end']();};}function respondWithResult(_0x55d587,_0x6c30c8){_0x6c30c8=_0x6c30c8||0xc8;return function(_0x20cdba){if(_0x20cdba){return _0x55d587[_0x6838('0xf')](_0x6c30c8)[_0x6838('0x10')](_0x20cdba);}};}function respondWithFilteredResult(_0x382af9,_0x382b04){return function(_0x2708f8){if(_0x2708f8){var _0x373fdf=typeof _0x382b04[_0x6838('0x11')]==='undefined'&&typeof _0x382b04['limit']===_0x6838('0x12');var _0x40bb94=_0x2708f8[_0x6838('0x13')];var _0x18107c=_0x373fdf?0x0:_0x382b04[_0x6838('0x11')];var _0x87994f=_0x373fdf?_0x2708f8[_0x6838('0x13')]:_0x382b04[_0x6838('0x11')]+_0x382b04[_0x6838('0x14')];var _0x325c06;if(_0x87994f>=_0x40bb94){_0x87994f=_0x40bb94;_0x325c06=0xc8;}else{_0x325c06=0xce;}_0x382af9['status'](_0x325c06);return _0x382af9[_0x6838('0x15')](_0x6838('0x16'),_0x18107c+'-'+_0x87994f+'/'+_0x40bb94)['json'](_0x2708f8);}return null;};}function saveUpdates(_0x40716e){return function(_0x425ca0){if(_0x425ca0){return _0x425ca0[_0x6838('0x17')](_0x40716e)[_0x6838('0x18')](function(_0x2182c4){return _0x2182c4;});}return null;};}function removeEntity(_0x2e343a){return function(_0x5f07fc){if(_0x5f07fc){return _0x5f07fc['destroy']()[_0x6838('0x18')](function(){var _0x552c0f=_0x5f07fc[_0x6838('0x19')]({'plain':!![]});var _0x3bfde8='ChatQueues';return db[_0x6838('0x1a')]['destroy']({'where':{'type':_0x3bfde8,'resourceId':_0x552c0f['id']}})[_0x6838('0x18')](function(){return _0x5f07fc;});})[_0x6838('0x18')](function(){_0x2e343a[_0x6838('0xf')](0xcc)[_0x6838('0x1b')]();});}};}function handleEntityNotFound(_0xe5eee2){return function(_0x3f9531){if(!_0x3f9531){_0xe5eee2['sendStatus'](0x194);}return _0x3f9531;};}function handleError(_0x446303,_0x1c8d5c){_0x1c8d5c=_0x1c8d5c||0x1f4;return function(_0x5bf17d){logger[_0x6838('0x1c')](_0x5bf17d['stack']);if(_0x5bf17d['name']){delete _0x5bf17d['name'];}_0x446303[_0x6838('0xf')](_0x1c8d5c)[_0x6838('0x1d')](_0x5bf17d);};}exports[_0x6838('0x1e')]=function(_0x374b53,_0xd73a51){var _0x9d9dc={};var _0x20d8b9={'count':0x0,'rows':[]};var _0xdd153d=_[_0x6838('0x1f')](db['ChatQueue'][_0x6838('0x20')],function(_0x5110a8){return{'name':_0x5110a8[_0x6838('0x21')],'type':_0x5110a8['type'][_0x6838('0x22')]};});_0x9d9dc=qs[_0x6838('0x23')](_0xdd153d,_0x374b53);var _0x233313={'where':_0x9d9dc[_0x6838('0x24')]};return db[_0x6838('0x25')][_0x6838('0x13')](_0x233313)[_0x6838('0x18')](function(_0x370a41){_0x20d8b9['count']=_0x370a41;_0x9d9dc[_0x6838('0x26')]=qs[_0x6838('0x26')](_0x374b53['query']);return db[_0x6838('0x25')][_0x6838('0x27')](_0x9d9dc);})[_0x6838('0x18')](function(_0x26231d){_0x20d8b9[_0x6838('0x28')]=_0x26231d;return _0x20d8b9;})[_0x6838('0x18')](respondWithFilteredResult(_0xd73a51,_0x9d9dc))['catch'](handleError(_0xd73a51,null));};exports[_0x6838('0x29')]=function(_0x1b7ee9,_0x202aed){var _0xedd0b7={'raw':!![],'where':{'id':_0x1b7ee9[_0x6838('0x2a')]['id']}},_0x2d79b7={};_0x2d79b7[_0x6838('0x2b')]=_['keys'](db['ChatQueue'][_0x6838('0x20')]);_0x2d79b7[_0x6838('0x2c')]=_[_0x6838('0x2d')](_0x1b7ee9[_0x6838('0x2c')]);_0x2d79b7[_0x6838('0x2e')]=_[_0x6838('0x2f')](_0x2d79b7['model'],_0x2d79b7['query']);_0xedd0b7['attributes']=_[_0x6838('0x2f')](_0x2d79b7['model'],qs['fields'](_0x1b7ee9[_0x6838('0x2c')][_0x6838('0x30')]));_0xedd0b7[_0x6838('0x31')]=_0xedd0b7[_0x6838('0x31')][_0x6838('0x32')]?_0xedd0b7[_0x6838('0x31')]:_0x2d79b7[_0x6838('0x2b')];if(_0x1b7ee9['query']['includeAll']){_0xedd0b7[_0x6838('0x26')]=[{'all':!![]}];}_0xedd0b7=_[_0x6838('0x33')]({},_0xedd0b7,_0x1b7ee9[_0x6838('0x34')]);return db[_0x6838('0x25')][_0x6838('0x35')](_0xedd0b7)[_0x6838('0x18')](handleEntityNotFound(_0x202aed,null))[_0x6838('0x18')](respondWithResult(_0x202aed,null))['catch'](handleError(_0x202aed,null));};exports[_0x6838('0x36')]=function(_0x14145a,_0x3c944a){return db['ChatQueue'][_0x6838('0x36')](_0x14145a[_0x6838('0x37')],{})[_0x6838('0x18')](function(_0x3d7a02){var _0x12b2b7=_0x14145a[_0x6838('0x38')]['get']({'plain':!![]});if(!_0x12b2b7)throw new Error(_0x6838('0x39'));if(_0x12b2b7[_0x6838('0x3a')]===_0x6838('0x38')){var _0x15fed5=_0x3d7a02[_0x6838('0x19')]({'plain':!![]});var _0x496521='ChatQueues';return db[_0x6838('0x3b')][_0x6838('0x35')]({'where':{'name':_0x496521,'userProfileId':_0x12b2b7[_0x6838('0x3c')]},'raw':!![]})[_0x6838('0x18')](function(_0x2a838e){if(_0x2a838e&&_0x2a838e[_0x6838('0x3d')]===0x0){return db[_0x6838('0x1a')][_0x6838('0x36')]({'name':_0x15fed5[_0x6838('0x3e')],'resourceId':_0x15fed5['id'],'type':_0x2a838e[_0x6838('0x3e')],'sectionId':_0x2a838e['id']},{})[_0x6838('0x18')](function(){return _0x3d7a02;});}else{return _0x3d7a02;}})[_0x6838('0x3f')](function(_0x4971eb){logger[_0x6838('0x1c')](_0x6838('0x40'),_0x4971eb);throw _0x4971eb;});}return _0x3d7a02;})[_0x6838('0x18')](respondWithResult(_0x3c944a,0xc9))[_0x6838('0x3f')](handleError(_0x3c944a,null));};exports[_0x6838('0x17')]=function(_0x3dde4b,_0x2fc728){if(_0x3dde4b[_0x6838('0x37')]['id']){delete _0x3dde4b[_0x6838('0x37')]['id'];}return db[_0x6838('0x25')][_0x6838('0x35')]({'where':{'id':_0x3dde4b[_0x6838('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2fc728,null))[_0x6838('0x18')](saveUpdates(_0x3dde4b[_0x6838('0x37')],null))['then'](respondWithResult(_0x2fc728,null))[_0x6838('0x3f')](handleError(_0x2fc728,null));};exports[_0x6838('0x41')]=function(_0x20b5e3,_0x4374fc){return db[_0x6838('0x25')][_0x6838('0x35')]({'where':{'id':_0x20b5e3[_0x6838('0x2a')]['id']}})[_0x6838('0x18')](handleEntityNotFound(_0x4374fc,null))['then'](removeEntity(_0x4374fc,null))[_0x6838('0x3f')](handleError(_0x4374fc,null));};exports[_0x6838('0x42')]=function(_0x2b538d,_0x5c07c6){return db[_0x6838('0x25')][_0x6838('0x42')]()[_0x6838('0x18')](respondWithResult(_0x5c07c6,null))[_0x6838('0x3f')](handleError(_0x5c07c6,null));};exports[_0x6838('0x43')]=function(_0x490240,_0x5cee27){var _0x193bd0={'raw':!![],'where':{}},_0x40ab0d={},_0x38af80;return db[_0x6838('0x25')][_0x6838('0x44')]({'where':{'id':_0x490240['params']['id']}})[_0x6838('0x18')](handleEntityNotFound(_0x5cee27,null))[_0x6838('0x18')](function(_0x493dd7){if(_0x493dd7){_0x38af80=_0x493dd7['get']({'plain':!![]});_0x40ab0d[_0x6838('0x2b')]=_[_0x6838('0x2d')](db['UserChatQueue'][_0x6838('0x20')]);_0x40ab0d['query']=_['keys'](_0x490240[_0x6838('0x2c')]);_0x40ab0d[_0x6838('0x2e')]=_[_0x6838('0x2f')](_0x40ab0d['model'],_0x40ab0d[_0x6838('0x2c')]);_0x193bd0[_0x6838('0x31')]=_['intersection'](_0x40ab0d[_0x6838('0x2b')],qs[_0x6838('0x30')](_0x490240[_0x6838('0x2c')][_0x6838('0x30')]));_0x193bd0[_0x6838('0x31')]=_0x193bd0['attributes']['length']?_0x193bd0[_0x6838('0x31')]:_0x40ab0d[_0x6838('0x2b')];if(!_0x490240['query'][_0x6838('0x45')](_0x6838('0x46'))){_0x193bd0['limit']=qs[_0x6838('0x14')](_0x490240['query'][_0x6838('0x14')]);_0x193bd0[_0x6838('0x11')]=qs[_0x6838('0x11')](_0x490240[_0x6838('0x2c')][_0x6838('0x11')]);}_0x193bd0[_0x6838('0x47')]=qs[_0x6838('0x48')](_0x490240[_0x6838('0x2c')]['sort']);_0x193bd0[_0x6838('0x24')]=qs[_0x6838('0x2e')](_[_0x6838('0x49')](_0x490240[_0x6838('0x2c')],_0x40ab0d['filters']));_0x193bd0['where'][_0x6838('0x4a')]=_0x493dd7['id'];if(_0x490240[_0x6838('0x2c')][_0x6838('0x4b')]){_0x193bd0[_0x6838('0x24')]=_[_0x6838('0x33')](_0x193bd0[_0x6838('0x24')],{'$or':_[_0x6838('0x1f')](_0x193bd0[_0x6838('0x31')],function(_0x24138a){var _0x58f3b5={};_0x58f3b5[_0x24138a]={'$like':'%'+_0x490240[_0x6838('0x2c')][_0x6838('0x4b')]+'%'};return _0x58f3b5;})});}_0x193bd0=_[_0x6838('0x33')]({},_0x193bd0,_0x490240[_0x6838('0x34')]);return db['UserChatQueue']['findAll'](_0x193bd0);}})[_0x6838('0x18')](function(_0x521b16){if(_0x521b16){return db[_0x6838('0x4c')][_0x6838('0x4d')]({'where':{'id':_[_0x6838('0x1f')](_0x521b16,_0x6838('0x4e')),'role':_0x6838('0x4f')},'attributes':['id',_0x6838('0x3e'),'chatPause',_0x6838('0x50'),'createdAt']});}})[_0x6838('0x18')](function(_0x2e0a28){if(_0x2e0a28){return{'count':_0x2e0a28[_0x6838('0x13')],'rows':_['map'](_0x2e0a28['rows'],function(_0x3da6d3){return{'membername':_0x3da6d3[_0x6838('0x3e')],'UserId':_0x3da6d3['id'],'queue_name':_0x38af80['name'],'ChatQueueId':_0x38af80['id'],'interface':util[_0x6838('0x51')](_0x6838('0x52'),_0x6838('0x53'),_0x3da6d3['name']),'penalty':0x0,'paused':_0x3da6d3['chatPause'],'createdAt':_0x3da6d3[_0x6838('0x54')],'updatedAt':_0x3da6d3[_0x6838('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6838('0x18')](respondWithFilteredResult(_0x5cee27,_0x193bd0))[_0x6838('0x3f')](handleError(_0x5cee27,null));};exports[_0x6838('0x55')]=function(_0x4a3713,_0x21ddbf){var _0x1b8ccb={};var _0x10cf17={};var _0x3513e6;var _0x338f8d;return db[_0x6838('0x25')][_0x6838('0x44')]({'where':{'id':_0x4a3713[_0x6838('0x2a')]['id']}})['then'](handleEntityNotFound(_0x21ddbf,null))['then'](function(_0x43efec){if(_0x43efec){_0x3513e6=_0x43efec;_0x10cf17['model']=_['keys'](db[_0x6838('0x56')][_0x6838('0x20')]);_0x10cf17[_0x6838('0x2c')]=_[_0x6838('0x2d')](_0x4a3713[_0x6838('0x2c')]);_0x10cf17[_0x6838('0x2e')]=_[_0x6838('0x2f')](_0x10cf17[_0x6838('0x2b')],_0x10cf17['query']);_0x1b8ccb[_0x6838('0x31')]=_[_0x6838('0x2f')](_0x10cf17[_0x6838('0x2b')],qs[_0x6838('0x30')](_0x4a3713[_0x6838('0x2c')][_0x6838('0x30')]));_0x1b8ccb['attributes']=_0x1b8ccb[_0x6838('0x31')][_0x6838('0x32')]?_0x1b8ccb[_0x6838('0x31')]:_0x10cf17['model'];_0x1b8ccb[_0x6838('0x47')]=qs[_0x6838('0x48')](_0x4a3713[_0x6838('0x2c')][_0x6838('0x48')]);_0x1b8ccb[_0x6838('0x24')]=qs['filters'](_[_0x6838('0x49')](_0x4a3713[_0x6838('0x2c')],_0x10cf17[_0x6838('0x2e')]));if(_0x4a3713[_0x6838('0x2c')][_0x6838('0x4b')]){_0x1b8ccb[_0x6838('0x24')]=_[_0x6838('0x33')](_0x1b8ccb[_0x6838('0x24')],{'$or':_[_0x6838('0x1f')](_0x1b8ccb[_0x6838('0x31')],function(_0x3803cf){var _0x1f67ab={};_0x1f67ab[_0x3803cf]={'$like':'%'+_0x4a3713[_0x6838('0x2c')]['filter']+'%'};return _0x1f67ab;})});}_0x1b8ccb=_['merge']({},_0x1b8ccb,_0x4a3713[_0x6838('0x34')]);return _0x3513e6[_0x6838('0x55')](_0x1b8ccb);}})[_0x6838('0x18')](function(_0x3be88c){if(_0x3be88c){_0x338f8d=_0x3be88c[_0x6838('0x32')];if(!_0x4a3713[_0x6838('0x2c')][_0x6838('0x45')]('nolimit')){_0x1b8ccb[_0x6838('0x14')]=qs[_0x6838('0x14')](_0x4a3713[_0x6838('0x2c')][_0x6838('0x14')]);_0x1b8ccb[_0x6838('0x11')]=qs[_0x6838('0x11')](_0x4a3713[_0x6838('0x2c')][_0x6838('0x11')]);}return _0x3513e6[_0x6838('0x55')](_0x1b8ccb);}})[_0x6838('0x18')](function(_0x5cd875){if(_0x5cd875){return _0x5cd875?{'count':_0x338f8d,'rows':_0x5cd875}:null;}})[_0x6838('0x18')](respondWithResult(_0x21ddbf,null))[_0x6838('0x3f')](handleError(_0x21ddbf,null));};exports[_0x6838('0x57')]=function(_0x22b406,_0x19ad4e){var _0x415948=_0x22b406[_0x6838('0x37')][_0x6838('0x58')];return db[_0x6838('0x56')][_0x6838('0x27')]({'where':{'id':_0x415948},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6838('0x59'),'attributes':['id','name',_0x6838('0x5a'),_0x6838('0x5b'),'interface'],'raw':!![]}]})[_0x6838('0x18')](function(_0x2b9332){if(_0x2b9332){var _0x216de9=_[_0x6838('0x5c')](_0x2b9332,function(_0x2a2469){var _0x15b286=_0x2a2469[_0x6838('0x19')]({'plain':!![]});return _0x15b286[_0x6838('0x59')];});return db[_0x6838('0x25')]['find']({'where':{'id':_0x22b406['params']['id']}})[_0x6838('0x18')](function(_0x107266){return db[_0x6838('0x5d')][_0x6838('0x5e')](function(_0x1829ab){return _0x107266['addTeams'](_0x415948,{'transaction':_0x1829ab})[_0x6838('0x18')](function(){return BPromise[_0x6838('0x5f')](_0x216de9,function(_0x5aefa4){return db[_0x6838('0x60')][_0x6838('0x61')]({'where':{'UserId':_0x5aefa4['id'],'ChatQueueId':_0x22b406[_0x6838('0x2a')]['id']},'transaction':_0x1829ab});});})['then'](function(){_0x216de9[_0x6838('0x62')](function(_0x100d00){socket['emit'](_0x6838('0x63'),{'UserId':_0x100d00['id'],'ChatQueueId':_0x107266['id']});});});});});}})[_0x6838('0x18')](respondWithStatusCode(_0x19ad4e,null))[_0x6838('0x3f')](handleError(_0x19ad4e,null));};exports[_0x6838('0x64')]=function(_0x227306,_0x431925){return db[_0x6838('0x56')][_0x6838('0x27')]({'where':{'id':_0x227306[_0x6838('0x2c')][_0x6838('0x58')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6838('0x59'),'attributes':['id'],'raw':!![]}]})[_0x6838('0x18')](handleEntityNotFound(_0x431925,null))[_0x6838('0x18')](function(_0xddd43a){var _0x48393e=_[_0x6838('0x1f')](_0xddd43a,'id');var _0x2e4b82=[];var _0x14bfd1=[];var _0x48acf2=squel[_0x6838('0x65')]();_0x48acf2[_0x6838('0x66')]('tq.TeamId')[_0x6838('0x67')](_0x6838('0x68'),'tq')[_0x6838('0x69')](_0x6838('0x6a'),'ut',_0x6838('0x6b'))[_0x6838('0x24')](_0x6838('0x6c'),_0x227306[_0x6838('0x2a')]['id']);for(var _0x162d2c=0x0;_0x162d2c<_0xddd43a[_0x6838('0x32')];_0x162d2c+=0x1){let _0x3a8477=_0xddd43a[_0x162d2c];for(var _0x535287=0x0;_0x535287<_0x3a8477[_0x6838('0x59')]['length'];_0x535287+=0x1){let _0x390eab=_0x3a8477[_0x6838('0x59')][_0x535287];var _0x504d74=_0x48acf2['clone']();_0x504d74[_0x6838('0x24')](_0x6838('0x6d'),_0x390eab['id']);_0x14bfd1[_0x6838('0x6e')](db['sequelize'][_0x6838('0x2c')](_0x504d74[_0x6838('0x6f')](),{'type':db[_0x6838('0x5d')][_0x6838('0x70')][_0x6838('0x71')]})['then'](function(_0x51616d){if(_0x51616d[_0x6838('0x32')]===0x1){return _0x390eab['id'];}else{var _0x4baa42=_[_0x6838('0x72')](_[_0x6838('0x1f')](_0x51616d,_0x6838('0x73')),function(_0x4e6238){return _[_0x6838('0x74')](_0x48393e,_0x4e6238);});if(_0x4baa42){return _0x390eab['id'];}}}));}}return BPromise['all'](_0x14bfd1)[_0x6838('0x18')](function(_0x2bf308){_0x2e4b82=_(_0x2e4b82)[_0x6838('0x75')](_0x2bf308)[_0x6838('0x76')]()[_0x6838('0x77')]();return db[_0x6838('0x25')][_0x6838('0x35')]({'where':{'id':_0x227306[_0x6838('0x2a')]['id']}})[_0x6838('0x18')](function(_0x306fe2){return db[_0x6838('0x5d')][_0x6838('0x5e')](function(_0xdcc116){return _0x306fe2[_0x6838('0x64')](_0x227306[_0x6838('0x2c')][_0x6838('0x58')],{'transaction':_0xdcc116})[_0x6838('0x18')](function(){if(!_[_0x6838('0x78')](_0x2e4b82)){return _0x306fe2[_0x6838('0x79')](_0x2e4b82,{'transaction':_0xdcc116});}})['then'](function(){_0x2e4b82['forEach'](function(_0x17c76a){socket['emit'](_0x6838('0x7a'),{'UserId':_0x17c76a,'ChatQueueId':_0x306fe2['id']});});});});});});})['then'](respondWithStatusCode(_0x431925,null))[_0x6838('0x3f')](handleError(_0x431925,null));};exports[_0x6838('0x7b')]=function(_0x325073,_0x443f57){return db['ChatQueue'][_0x6838('0x35')]({'where':{'id':_0x325073[_0x6838('0x2a')]['id']}})[_0x6838('0x18')](handleEntityNotFound(_0x443f57,null))[_0x6838('0x18')](function(_0xe9127d){if(_0xe9127d){return _0xe9127d[_0x6838('0x7b')](_0x325073['body'][_0x6838('0x58')],_[_0x6838('0x7c')](_0x325073[_0x6838('0x37')],[_0x6838('0x58'),'id'])||{})[_0x6838('0x7d')](function(_0xec810b){for(var _0x3aa68e=0x0;_0x3aa68e<_0x325073[_0x6838('0x37')][_0x6838('0x58')][_0x6838('0x32')];_0x3aa68e+=0x1){socket[_0x6838('0x7e')](_0x6838('0x63'),{'UserId':Number(_0x325073[_0x6838('0x37')]['ids'][_0x3aa68e]),'ChatQueueId':Number(_0x325073[_0x6838('0x2a')]['id'])});}return _0xec810b;});}})['then'](respondWithResult(_0x443f57,null))[_0x6838('0x3f')](handleError(_0x443f57,null));};exports[_0x6838('0x79')]=function(_0x2a1859,_0x6830b8){return db[_0x6838('0x25')]['find']({'where':{'id':_0x2a1859[_0x6838('0x2a')]['id']}})[_0x6838('0x18')](handleEntityNotFound(_0x6830b8,null))[_0x6838('0x18')](function(_0x1f13b2){if(_0x1f13b2){return _0x1f13b2[_0x6838('0x79')](_0x2a1859[_0x6838('0x2c')][_0x6838('0x58')])[_0x6838('0x18')](function(){if(_[_0x6838('0x7f')](_0x2a1859[_0x6838('0x2c')]['ids'])){for(var _0x2b03d8=0x0;_0x2b03d8<_0x2a1859[_0x6838('0x2c')][_0x6838('0x58')][_0x6838('0x32')];_0x2b03d8+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x2a1859[_0x6838('0x2c')][_0x6838('0x58')][_0x2b03d8]),'ChatQueueId':Number(_0x2a1859[_0x6838('0x2a')]['id'])});}}else{socket[_0x6838('0x7e')](_0x6838('0x7a'),{'UserId':Number(_0x2a1859[_0x6838('0x2c')][_0x6838('0x58')]),'ChatQueueId':Number(_0x2a1859[_0x6838('0x2a')]['id'])});}});}})[_0x6838('0x18')](respondWithStatusCode(_0x6830b8,null))[_0x6838('0x3f')](handleError(_0x6830b8,null));};exports[_0x6838('0x80')]=function(_0x18e961,_0x17d3db){var _0x1c1c4d={};var _0xd96b14={};var _0x45e7e4;var _0x5642bc;return db['ChatQueue'][_0x6838('0x44')]({'where':{'id':_0x18e961[_0x6838('0x2a')]['id']}})['then'](handleEntityNotFound(_0x17d3db,null))[_0x6838('0x18')](function(_0x74c59c){if(_0x74c59c){_0x45e7e4=_0x74c59c;_0xd96b14[_0x6838('0x2b')]=_['keys'](db['User'][_0x6838('0x20')]);_0xd96b14['query']=_['keys'](_0x18e961[_0x6838('0x2c')]);_0xd96b14['filters']=_[_0x6838('0x2f')](_0xd96b14[_0x6838('0x2b')],_0xd96b14[_0x6838('0x2c')]);_0x1c1c4d[_0x6838('0x31')]=_[_0x6838('0x2f')](_0xd96b14['model'],qs[_0x6838('0x30')](_0x18e961[_0x6838('0x2c')]['fields']));_0x1c1c4d['attributes']=_0x1c1c4d[_0x6838('0x31')][_0x6838('0x32')]?_0x1c1c4d[_0x6838('0x31')]:_0xd96b14[_0x6838('0x2b')];_0x1c1c4d[_0x6838('0x47')]=qs[_0x6838('0x48')](_0x18e961[_0x6838('0x2c')][_0x6838('0x48')]);_0x1c1c4d['where']=qs[_0x6838('0x2e')](_['pick'](_0x18e961[_0x6838('0x2c')],_0xd96b14['filters']));if(_0x18e961['query']['filter']){_0x1c1c4d[_0x6838('0x24')]=_[_0x6838('0x33')](_0x1c1c4d[_0x6838('0x24')],{'$or':_[_0x6838('0x1f')](_0x1c1c4d[_0x6838('0x31')],function(_0x43be09){var _0x3ef902={};_0x3ef902[_0x43be09]={'$like':'%'+_0x18e961['query'][_0x6838('0x4b')]+'%'};return _0x3ef902;})});}_0x1c1c4d=_['merge']({},_0x1c1c4d,_0x18e961[_0x6838('0x34')]);return _0x45e7e4[_0x6838('0x80')](_0x1c1c4d);}})['then'](function(_0x31ef4f){if(_0x31ef4f){_0x5642bc=_0x31ef4f[_0x6838('0x32')];if(!_0x18e961[_0x6838('0x2c')]['hasOwnProperty'](_0x6838('0x46'))){_0x1c1c4d[_0x6838('0x14')]=qs[_0x6838('0x14')](_0x18e961[_0x6838('0x2c')][_0x6838('0x14')]);_0x1c1c4d['offset']=qs[_0x6838('0x11')](_0x18e961[_0x6838('0x2c')][_0x6838('0x11')]);}return _0x45e7e4[_0x6838('0x80')](_0x1c1c4d);}})[_0x6838('0x18')](function(_0x366042){if(_0x366042){return _0x366042?{'count':_0x5642bc,'rows':_0x366042}:null;}})['then'](respondWithResult(_0x17d3db,null))[_0x6838('0x3f')](handleError(_0x17d3db,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e00ab5a..964458d 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 _0xe9b5=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','hasOwnProperty','hook','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xe9b5,0x1e6));var _0x5e9b=function(_0x14e193,_0x476c13){_0x14e193=_0x14e193-0x0;var _0x53892e=_0xe9b5[_0x14e193];return _0x53892e;};'use strict';var EventEmitter=require(_0x5e9b('0x0'));var ChatQueue=require(_0x5e9b('0x1'))['db'][_0x5e9b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5e9b('0x3')](0x0);var events={'afterCreate':_0x5e9b('0x4'),'afterUpdate':_0x5e9b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2ce917){return function(_0x1da942,_0x59da16,_0xf50f8d){ChatQueueEvents['emit'](_0x2ce917+':'+_0x1da942['id'],_0x1da942);ChatQueueEvents['emit'](_0x2ce917,_0x1da942);_0xf50f8d(null);};}for(var e in events){if(events[_0x5e9b('0x6')](e)){var event=events[e];ChatQueue[_0x5e9b('0x7')](e,emitEvent(event));}}module[_0x5e9b('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xfe1e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5d9a28,_0x1bf0bf){var _0x1a0fcd=function(_0x44a228){while(--_0x44a228){_0x5d9a28['push'](_0x5d9a28['shift']());}};_0x1a0fcd(++_0x1bf0bf);}(_0xfe1e,0xe3));var _0xefe1=function(_0x4bf6a3,_0x38dcca){_0x4bf6a3=_0x4bf6a3-0x0;var _0x4368cb=_0xfe1e[_0x4bf6a3];return _0x4368cb;};'use strict';var EventEmitter=require(_0xefe1('0x0'));var ChatQueue=require(_0xefe1('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xefe1('0x2')](0x0);var events={'afterCreate':_0xefe1('0x3'),'afterUpdate':_0xefe1('0x4'),'afterDestroy':_0xefe1('0x5')};function emitEvent(_0x2eb593){return function(_0xa86d7a,_0x1f8a0a,_0x580ea2){ChatQueueEvents[_0xefe1('0x6')](_0x2eb593+':'+_0xa86d7a['id'],_0xa86d7a);ChatQueueEvents['emit'](_0x2eb593,_0xa86d7a);_0x580ea2(null);};}for(var e in events){if(events[_0xefe1('0x7')](e)){var event=events[e];ChatQueue[_0xefe1('0x8')](e,emitEvent(event));}}module[_0xefe1('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 3a07861..7c2b068 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 _0x1e72=['ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./chatQueue.attributes','exports'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1e72,0x1b9));var _0x21e7=function(_0x5264df,_0x4ed625){_0x5264df=_0x5264df-0x0;var _0x38335e=_0x1e72[_0x5264df];return _0x38335e;};'use strict';var _=require(_0x21e7('0x0'));var util=require(_0x21e7('0x1'));var logger=require(_0x21e7('0x2'))(_0x21e7('0x3'));var moment=require(_0x21e7('0x4'));var BPromise=require(_0x21e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x21e7('0x6'));var config=require('../../config/environment');var attributes=require(_0x21e7('0x7'));module[_0x21e7('0x8')]=function(_0x1a8e3e,_0x5a332a){return _0x1a8e3e['define'](_0x21e7('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x50e0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x50e0,0x131));var _0x050e=function(_0x3935e1,_0x1e9d11){_0x3935e1=_0x3935e1-0x0;var _0x189e84=_0x50e0[_0x3935e1];return _0x189e84;};'use strict';var _=require(_0x050e('0x0'));var util=require(_0x050e('0x1'));var logger=require(_0x050e('0x2'))(_0x050e('0x3'));var moment=require(_0x050e('0x4'));var BPromise=require(_0x050e('0x5'));var rp=require(_0x050e('0x6'));var fs=require('fs');var path=require(_0x050e('0x7'));var rimraf=require(_0x050e('0x8'));var config=require(_0x050e('0x9'));var attributes=require(_0x050e('0xa'));module['exports']=function(_0x464c61,_0x10b8b5){return _0x464c61[_0x050e('0xb')](_0x050e('0xc'),attributes,{'tableName':_0x050e('0xd'),'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 c860a08..a06a9a1 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 _0x3306=['error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','include','map','model','debug','find','raw','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3306,0x107));var _0x6330=function(_0x112ad6,_0x1f1479){_0x112ad6=_0x112ad6-0x0;var _0x2e6412=_0x3306[_0x112ad6];return _0x2e6412;};'use strict';var _=require(_0x6330('0x0'));var util=require(_0x6330('0x1'));var moment=require(_0x6330('0x2'));var BPromise=require(_0x6330('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6330('0x4'));var db=require(_0x6330('0x5'))['db'];var utils=require(_0x6330('0x6'));var logger=require(_0x6330('0x7'))(_0x6330('0x8'));var config=require('../../config/environment');var jayson=require(_0x6330('0x9'));var client=jayson[_0x6330('0xa')][_0x6330('0xb')]({'port':0x232a});config[_0x6330('0xc')]=_[_0x6330('0xd')](config[_0x6330('0xc')],{'host':_0x6330('0xe'),'port':0x18eb});var socket=require(_0x6330('0xf'))(new Redis(config[_0x6330('0xc')]));require(_0x6330('0x10'))['register'](socket);function respondWithRpcPromise(_0x38bf84,_0x5e9d91,_0x2def1b){return new BPromise(function(_0x26ce0e,_0x20ff17){return client[_0x6330('0x11')](_0x38bf84,_0x2def1b)[_0x6330('0x12')](function(_0x1ad5c9){logger[_0x6330('0x13')](_0x6330('0x14'),_0x5e9d91,'request\x20sent');logger['debug'](_0x6330('0x15'),_0x5e9d91,_0x6330('0x16'),JSON[_0x6330('0x17')](_0x1ad5c9));if(_0x1ad5c9[_0x6330('0x18')]){if(_0x1ad5c9[_0x6330('0x18')]['code']===0x1f4){logger[_0x6330('0x18')](_0x6330('0x14'),_0x5e9d91,_0x1ad5c9[_0x6330('0x18')][_0x6330('0x19')]);return _0x20ff17(_0x1ad5c9['error']['message']);}logger[_0x6330('0x18')](_0x6330('0x14'),_0x5e9d91,_0x1ad5c9[_0x6330('0x18')]['message']);return _0x26ce0e(_0x1ad5c9[_0x6330('0x18')][_0x6330('0x19')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5e9d91,_0x6330('0x16'));_0x26ce0e(_0x1ad5c9[_0x6330('0x1a')][_0x6330('0x19')]);}})[_0x6330('0x1b')](function(_0x2c8e54){logger[_0x6330('0x18')](_0x6330('0x14'),_0x5e9d91,_0x2c8e54);_0x20ff17(_0x2c8e54);});});}exports[_0x6330('0x1c')]=function(_0x1080e9){var _0x421785=this;return new Promise(function(_0x55790e,_0x1fdc20){return db[_0x6330('0x1d')][_0x6330('0x1e')]({'raw':_0x1080e9[_0x6330('0x1f')]?_0x1080e9[_0x6330('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1080e9[_0x6330('0x1f')]?_0x1080e9[_0x6330('0x1f')][_0x6330('0x20')]||null:null,'attributes':_0x1080e9[_0x6330('0x1f')]?_0x1080e9[_0x6330('0x1f')][_0x6330('0x21')]||null:null,'limit':_0x1080e9['options']?_0x1080e9['options']['limit']||null:null,'include':_0x1080e9[_0x6330('0x1f')]?_0x1080e9[_0x6330('0x1f')][_0x6330('0x22')]?_[_0x6330('0x23')](_0x1080e9['options'][_0x6330('0x22')],function(_0x25aa25){return{'model':db[_0x25aa25[_0x6330('0x24')]],'as':_0x25aa25['as'],'attributes':_0x25aa25[_0x6330('0x21')],'include':_0x25aa25[_0x6330('0x22')]?_['map'](_0x25aa25['include'],function(_0x255861){return{'model':db[_0x255861[_0x6330('0x24')]],'as':_0x255861['as'],'attributes':_0x255861[_0x6330('0x21')],'include':_0x255861['include']?_[_0x6330('0x23')](_0x255861[_0x6330('0x22')],function(_0x325037){return{'model':db[_0x325037[_0x6330('0x24')]],'as':_0x325037['as'],'attributes':_0x325037['attributes']};}):[]};}):[]};}):[]:[]})[_0x6330('0x12')](function(_0x50ab51){logger[_0x6330('0x13')](_0x6330('0x1c'),_0x1080e9);logger[_0x6330('0x25')](_0x6330('0x1c'),_0x1080e9,JSON['stringify'](_0x50ab51));_0x55790e(_0x50ab51);})[_0x6330('0x1b')](function(_0x26a76e){logger[_0x6330('0x18')](_0x6330('0x1c'),_0x26a76e[_0x6330('0x19')],_0x1080e9);_0x1fdc20(_0x421785['error'](0x1f4,_0x26a76e[_0x6330('0x19')]));});});};exports['ShowChatQueue']=function(_0xaaf11d){var _0x5d01b3=this;return new Promise(function(_0x1ccca0,_0x4e9a28){return db['ChatQueue'][_0x6330('0x26')]({'raw':_0xaaf11d[_0x6330('0x1f')]?_0xaaf11d[_0x6330('0x1f')][_0x6330('0x27')]===undefined?!![]:![]:!![],'where':_0xaaf11d[_0x6330('0x1f')]?_0xaaf11d[_0x6330('0x1f')][_0x6330('0x20')]||null:null,'attributes':_0xaaf11d[_0x6330('0x1f')]?_0xaaf11d[_0x6330('0x1f')][_0x6330('0x21')]||null:null,'include':_0xaaf11d[_0x6330('0x1f')]?_0xaaf11d[_0x6330('0x1f')]['include']?_[_0x6330('0x23')](_0xaaf11d['options'][_0x6330('0x22')],function(_0x129175){return{'model':db[_0x129175[_0x6330('0x24')]],'as':_0x129175['as'],'attributes':_0x129175[_0x6330('0x21')],'include':_0x129175[_0x6330('0x22')]?_[_0x6330('0x23')](_0x129175[_0x6330('0x22')],function(_0x41be8f){return{'model':db[_0x41be8f[_0x6330('0x24')]],'as':_0x41be8f['as'],'attributes':_0x41be8f[_0x6330('0x21')],'include':_0x41be8f['include']?_[_0x6330('0x23')](_0x41be8f[_0x6330('0x22')],function(_0x4a4d30){return{'model':db[_0x4a4d30['model']],'as':_0x4a4d30['as'],'attributes':_0x4a4d30[_0x6330('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33354b){logger[_0x6330('0x13')](_0x6330('0x28'),_0xaaf11d);logger[_0x6330('0x25')](_0x6330('0x28'),_0xaaf11d,JSON[_0x6330('0x17')](_0x33354b));_0x1ccca0(_0x33354b);})[_0x6330('0x1b')](function(_0x30a44a){logger['error'](_0x6330('0x28'),_0x30a44a[_0x6330('0x19')],_0xaaf11d);_0x4e9a28(_0x5d01b3[_0x6330('0x18')](0x1f4,_0x30a44a['message']));});});};
\ No newline at end of file
+var _0x1e7b=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','limit','include','map','attributes','model','GetChatQueue','debug','ShowChatQueue','ChatQueue','find','where'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x23e337,_0x1e3c57){_0x23e337=_0x23e337-0x0;var _0x45facf=_0x1e7b[_0x23e337];return _0x45facf;};'use strict';var _=require(_0xb1e7('0x0'));var util=require(_0xb1e7('0x1'));var moment=require('moment');var BPromise=require(_0xb1e7('0x2'));var rs=require(_0xb1e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1e7('0x4'))['db'];var utils=require(_0xb1e7('0x5'));var logger=require(_0xb1e7('0x6'))(_0xb1e7('0x7'));var config=require('../../config/environment');var jayson=require(_0xb1e7('0x8'));var client=jayson[_0xb1e7('0x9')][_0xb1e7('0xa')]({'port':0x232a});config[_0xb1e7('0xb')]=_[_0xb1e7('0xc')](config['redis'],{'host':_0xb1e7('0xd'),'port':0x18eb});var socket=require(_0xb1e7('0xe'))(new Redis(config[_0xb1e7('0xb')]));require(_0xb1e7('0xf'))[_0xb1e7('0x10')](socket);function respondWithRpcPromise(_0x1c27e8,_0x842e0a,_0x400ad9){return new BPromise(function(_0x13af76,_0x2521e9){return client[_0xb1e7('0x11')](_0x1c27e8,_0x400ad9)[_0xb1e7('0x12')](function(_0xc7eea1){logger[_0xb1e7('0x13')](_0xb1e7('0x14'),_0x842e0a,'request\x20sent');logger['debug'](_0xb1e7('0x15'),_0x842e0a,_0xb1e7('0x16'),JSON[_0xb1e7('0x17')](_0xc7eea1));if(_0xc7eea1['error']){if(_0xc7eea1[_0xb1e7('0x18')][_0xb1e7('0x19')]===0x1f4){logger[_0xb1e7('0x18')]('ChatQueue,\x20%s,\x20%s',_0x842e0a,_0xc7eea1[_0xb1e7('0x18')][_0xb1e7('0x1a')]);return _0x2521e9(_0xc7eea1[_0xb1e7('0x18')]['message']);}logger[_0xb1e7('0x18')](_0xb1e7('0x14'),_0x842e0a,_0xc7eea1[_0xb1e7('0x18')][_0xb1e7('0x1a')]);return _0x13af76(_0xc7eea1[_0xb1e7('0x18')][_0xb1e7('0x1a')]);}else{logger[_0xb1e7('0x13')](_0xb1e7('0x14'),_0x842e0a,_0xb1e7('0x16'));_0x13af76(_0xc7eea1[_0xb1e7('0x1b')][_0xb1e7('0x1a')]);}})[_0xb1e7('0x1c')](function(_0xa1ddc){logger[_0xb1e7('0x18')](_0xb1e7('0x14'),_0x842e0a,_0xa1ddc);_0x2521e9(_0xa1ddc);});});}exports['GetChatQueue']=function(_0x30f3d2){var _0x39b2d8=this;return new Promise(function(_0x51b0e3,_0x2fbd93){return db['ChatQueue'][_0xb1e7('0x1d')]({'raw':_0x30f3d2[_0xb1e7('0x1e')]?_0x30f3d2[_0xb1e7('0x1e')][_0xb1e7('0x1f')]===undefined?!![]:![]:!![],'where':_0x30f3d2[_0xb1e7('0x1e')]?_0x30f3d2[_0xb1e7('0x1e')]['where']||null:null,'attributes':_0x30f3d2[_0xb1e7('0x1e')]?_0x30f3d2[_0xb1e7('0x1e')]['attributes']||null:null,'limit':_0x30f3d2['options']?_0x30f3d2[_0xb1e7('0x1e')][_0xb1e7('0x20')]||null:null,'include':_0x30f3d2[_0xb1e7('0x1e')]?_0x30f3d2['options'][_0xb1e7('0x21')]?_[_0xb1e7('0x22')](_0x30f3d2[_0xb1e7('0x1e')][_0xb1e7('0x21')],function(_0x5ada06){return{'model':db[_0x5ada06['model']],'as':_0x5ada06['as'],'attributes':_0x5ada06[_0xb1e7('0x23')],'include':_0x5ada06['include']?_[_0xb1e7('0x22')](_0x5ada06[_0xb1e7('0x21')],function(_0x2bc953){return{'model':db[_0x2bc953[_0xb1e7('0x24')]],'as':_0x2bc953['as'],'attributes':_0x2bc953[_0xb1e7('0x23')],'include':_0x2bc953[_0xb1e7('0x21')]?_[_0xb1e7('0x22')](_0x2bc953[_0xb1e7('0x21')],function(_0x290633){return{'model':db[_0x290633[_0xb1e7('0x24')]],'as':_0x290633['as'],'attributes':_0x290633[_0xb1e7('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb1e7('0x12')](function(_0x2a0ede){logger['info'](_0xb1e7('0x25'),_0x30f3d2);logger[_0xb1e7('0x26')](_0xb1e7('0x25'),_0x30f3d2,JSON[_0xb1e7('0x17')](_0x2a0ede));_0x51b0e3(_0x2a0ede);})['catch'](function(_0x357984){logger['error']('GetChatQueue',_0x357984[_0xb1e7('0x1a')],_0x30f3d2);_0x2fbd93(_0x39b2d8[_0xb1e7('0x18')](0x1f4,_0x357984[_0xb1e7('0x1a')]));});});};exports[_0xb1e7('0x27')]=function(_0x1f3fe8){var _0x556837=this;return new Promise(function(_0x50d432,_0x4ef31e){return db[_0xb1e7('0x28')][_0xb1e7('0x29')]({'raw':_0x1f3fe8[_0xb1e7('0x1e')]?_0x1f3fe8[_0xb1e7('0x1e')][_0xb1e7('0x1f')]===undefined?!![]:![]:!![],'where':_0x1f3fe8['options']?_0x1f3fe8[_0xb1e7('0x1e')][_0xb1e7('0x2a')]||null:null,'attributes':_0x1f3fe8[_0xb1e7('0x1e')]?_0x1f3fe8[_0xb1e7('0x1e')][_0xb1e7('0x23')]||null:null,'include':_0x1f3fe8['options']?_0x1f3fe8['options'][_0xb1e7('0x21')]?_[_0xb1e7('0x22')](_0x1f3fe8[_0xb1e7('0x1e')]['include'],function(_0xe9df78){return{'model':db[_0xe9df78[_0xb1e7('0x24')]],'as':_0xe9df78['as'],'attributes':_0xe9df78[_0xb1e7('0x23')],'include':_0xe9df78[_0xb1e7('0x21')]?_[_0xb1e7('0x22')](_0xe9df78['include'],function(_0x1fa43d){return{'model':db[_0x1fa43d[_0xb1e7('0x24')]],'as':_0x1fa43d['as'],'attributes':_0x1fa43d[_0xb1e7('0x23')],'include':_0x1fa43d[_0xb1e7('0x21')]?_[_0xb1e7('0x22')](_0x1fa43d[_0xb1e7('0x21')],function(_0x70bf72){return{'model':db[_0x70bf72[_0xb1e7('0x24')]],'as':_0x70bf72['as'],'attributes':_0x70bf72['attributes']};}):[]};}):[]};}):[]:[]})[_0xb1e7('0x12')](function(_0x86624){logger['info'](_0xb1e7('0x27'),_0x1f3fe8);logger[_0xb1e7('0x26')](_0xb1e7('0x27'),_0x1f3fe8,JSON[_0xb1e7('0x17')](_0x86624));_0x50d432(_0x86624);})[_0xb1e7('0x1c')](function(_0x40cb93){logger['error']('ShowChatQueue',_0x40cb93[_0xb1e7('0x1a')],_0x1f3fe8);_0x4ef31e(_0x556837[_0xb1e7('0x18')](0x1f4,_0x40cb93['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 6d86853..1fb10fc 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 _0x4d9e=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x4c012a,_0xf39ef4){var _0x5b6088=function(_0x5b6ded){while(--_0x5b6ded){_0x4c012a['push'](_0x4c012a['shift']());}};_0x5b6088(++_0xf39ef4);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x3b5240,_0x22e3c1){_0x3b5240=_0x3b5240-0x0;var _0x92a90c=_0x4d9e[_0x3b5240];return _0x92a90c;};'use strict';var ChatQueueEvents=require(_0xe4d9('0x0'));var events=['save','remove',_0xe4d9('0x1')];function createListener(_0x574c1d,_0x36adac){return function(_0x4d7687){_0x36adac[_0xe4d9('0x2')](_0x574c1d,_0x4d7687);};}function removeListener(_0x2deaef,_0x47a09f){return function(){ChatQueueEvents[_0xe4d9('0x3')](_0x2deaef,_0x47a09f);};}exports[_0xe4d9('0x4')]=function(_0x278035){for(var _0x34c2a2=0x0,_0x125dbc=events[_0xe4d9('0x5')];_0x34c2a2<_0x125dbc;_0x34c2a2++){var _0x54a63a=events[_0x34c2a2];var _0x36316f=createListener(_0xe4d9('0x6')+_0x54a63a,_0x278035);ChatQueueEvents['on'](_0x54a63a,_0x36316f);}};
\ No newline at end of file
+var _0x34e8=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0x34e8,0x12c));var _0x834e=function(_0x58b1b0,_0x27d317){_0x58b1b0=_0x58b1b0-0x0;var _0x52246c=_0x34e8[_0x58b1b0];return _0x52246c;};'use strict';var ChatQueueEvents=require(_0x834e('0x0'));var events=[_0x834e('0x1'),_0x834e('0x2'),_0x834e('0x3')];function createListener(_0x530939,_0x832422){return function(_0x21e2e0){_0x832422[_0x834e('0x4')](_0x530939,_0x21e2e0);};}function removeListener(_0x31bf20,_0x289ef2){return function(){ChatQueueEvents[_0x834e('0x5')](_0x31bf20,_0x289ef2);};}exports[_0x834e('0x6')]=function(_0x4a2018){for(var _0x858aa1=0x0,_0x52056d=events[_0x834e('0x7')];_0x858aa1<_0x52056d;_0x858aa1++){var _0x3cc2e3=events[_0x858aa1];var _0x3a3ef6=createListener(_0x834e('0x8')+_0x3cc2e3,_0x4a2018);ChatQueueEvents['on'](_0x3cc2e3,_0x3a3ef6);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ce0407c..dc3d608 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x384c82,_0x18c8e9){_0x384c82=_0x384c82-0x0;var _0x3dd7fb=_0x3e74[_0x384c82];return _0x3dd7fb;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5fc3,0xa8));var _0x35fc=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0x5fc3[_0x592d48];return _0x5d789e;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 6d71ec2..7773634 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 _0x61eb=['exports','STRING','DATE','moment','sequelize'];(function(_0x5e647c,_0x2a2890){var _0x1f9724=function(_0x18ca2a){while(--_0x18ca2a){_0x5e647c['push'](_0x5e647c['shift']());}};_0x1f9724(++_0x2a2890);}(_0x61eb,0x14d));var _0xb61e=function(_0x355814,_0x29403b){_0x355814=_0x355814-0x0;var _0x9b6c5d=_0x61eb[_0x355814];return _0x9b6c5d;};'use strict';var moment=require(_0xb61e('0x0'));var Sequelize=require(_0xb61e('0x1'));module[_0xb61e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb61e('0x3')]},'joinAt':{'type':Sequelize[_0xb61e('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb61e('0x4')]},'reason':{'type':Sequelize[_0xb61e('0x3')]}};
\ No newline at end of file
+var _0xd33e=['exports','STRING','DATE','moment'];(function(_0x378fe1,_0x3fd068){var _0x2ac3db=function(_0x5297c5){while(--_0x5297c5){_0x378fe1['push'](_0x378fe1['shift']());}};_0x2ac3db(++_0x3fd068);}(_0xd33e,0x1b7));var _0xed33=function(_0x4ffee4,_0x1db54d){_0x4ffee4=_0x4ffee4-0x0;var _0x5e9fe4=_0xd33e[_0x4ffee4];return _0x5e9fe4;};'use strict';var moment=require(_0xed33('0x0'));var Sequelize=require('sequelize');module[_0xed33('0x1')]={'uniqueid':{'type':Sequelize[_0xed33('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xed33('0x2')]},'joinAt':{'type':Sequelize[_0xed33('0x3')]},'leaveAt':{'type':Sequelize[_0xed33('0x3')]},'acceptAt':{'type':Sequelize[_0xed33('0x3')]},'exitAt':{'type':Sequelize[_0xed33('0x3')]},'reason':{'type':Sequelize[_0xed33('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index e6a879e..a05af2b 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 _0xfcbe=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','ChatQueueReport','rows','catch','show','params','includeAll','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x57de4c,_0x3ee219){var _0x3089b4=function(_0x1a65dd){while(--_0x1a65dd){_0x57de4c['push'](_0x57de4c['shift']());}};_0x3089b4(++_0x3ee219);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x577dd2,_0x2643e1){_0x577dd2=_0x577dd2-0x0;var _0x445004=_0xfcbe[_0x577dd2];return _0x445004;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefcb('0x0'));var zipdir=require(_0xefcb('0x1'));var jsonpatch=require(_0xefcb('0x2'));var rp=require(_0xefcb('0x3'));var moment=require(_0xefcb('0x4'));var BPromise=require(_0xefcb('0x5'));var Mustache=require('mustache');var util=require(_0xefcb('0x6'));var path=require(_0xefcb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefcb('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xefcb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xefcb('0xa'));var toCsv=require(_0xefcb('0xb'));var querystring=require(_0xefcb('0xc'));var Papa=require('papaparse');var Redis=require(_0xefcb('0xd'));var authService=require(_0xefcb('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefcb('0xf'));var logger=require(_0xefcb('0x10'))(_0xefcb('0x11'));var utils=require(_0xefcb('0x12'));var config=require(_0xefcb('0x13'));var licenseUtil=require(_0xefcb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x92bb0c,_0x163012){_0x163012=_0x163012||0xcc;return function(_0x2c77dd){if(_0x2c77dd){return _0x92bb0c[_0xefcb('0x15')](_0x163012);}return _0x92bb0c[_0xefcb('0x16')](_0x163012)['end']();};}function respondWithResult(_0x585355,_0x24ac43){_0x24ac43=_0x24ac43||0xc8;return function(_0xd13e37){if(_0xd13e37){return _0x585355['status'](_0x24ac43)[_0xefcb('0x17')](_0xd13e37);}};}function respondWithFilteredResult(_0x565c13,_0x3946ef){return function(_0x565fae){if(_0x565fae){var _0x172816=typeof _0x3946ef[_0xefcb('0x18')]===_0xefcb('0x19')&&typeof _0x3946ef[_0xefcb('0x1a')]===_0xefcb('0x19');var _0x13d883=_0x565fae['count'];var _0x15fbec=_0x172816?0x0:_0x3946ef[_0xefcb('0x18')];var _0xe922c7=_0x172816?_0x565fae[_0xefcb('0x1b')]:_0x3946ef[_0xefcb('0x18')]+_0x3946ef[_0xefcb('0x1a')];var _0x3a3ffe;if(_0xe922c7>=_0x13d883){_0xe922c7=_0x13d883;_0x3a3ffe=0xc8;}else{_0x3a3ffe=0xce;}_0x565c13['status'](_0x3a3ffe);return _0x565c13[_0xefcb('0x1c')](_0xefcb('0x1d'),_0x15fbec+'-'+_0xe922c7+'/'+_0x13d883)['json'](_0x565fae);}return null;};}function patchUpdates(_0x12a93f){return function(_0x51c2e){try{jsonpatch[_0xefcb('0x1e')](_0x51c2e,_0x12a93f,!![]);}catch(_0x2b0be0){return BPromise[_0xefcb('0x1f')](_0x2b0be0);}return _0x51c2e['save']();};}function saveUpdates(_0x10c662,_0x33641c){return function(_0x2ab79d){if(_0x2ab79d){return _0x2ab79d[_0xefcb('0x20')](_0x10c662)[_0xefcb('0x21')](function(_0x345629){return _0x345629;});}return null;};}function removeEntity(_0x129817,_0x2a74f6){return function(_0x52e7dd){if(_0x52e7dd){return _0x52e7dd['destroy']()['then'](function(){_0x129817[_0xefcb('0x16')](0xcc)[_0xefcb('0x22')]();});}};}function handleEntityNotFound(_0x457ff6,_0x1717b7){return function(_0x20f51f){if(!_0x20f51f){_0x457ff6[_0xefcb('0x15')](0x194);}return _0x20f51f;};}function handleError(_0x22e2c6,_0x52ce86){_0x52ce86=_0x52ce86||0x1f4;return function(_0x3029d1){logger[_0xefcb('0x23')](_0x3029d1[_0xefcb('0x24')]);if(_0x3029d1[_0xefcb('0x25')]){delete _0x3029d1[_0xefcb('0x25')];}_0x22e2c6[_0xefcb('0x16')](_0x52ce86)[_0xefcb('0x26')](_0x3029d1);};}exports[_0xefcb('0x27')]=function(_0x1c7ee1,_0xe2c2c8){var _0x124546={},_0x160782={},_0xccac33={'count':0x0,'rows':[]};var _0x43fb58=_[_0xefcb('0x28')](db['ChatQueueReport'][_0xefcb('0x29')],function(_0x3995cc){return{'name':_0x3995cc[_0xefcb('0x2a')],'type':_0x3995cc[_0xefcb('0x2b')][_0xefcb('0x2c')]};});_0x160782[_0xefcb('0x2d')]=_[_0xefcb('0x28')](_0x43fb58,'name');_0x160782['query']=_[_0xefcb('0x2e')](_0x1c7ee1[_0xefcb('0x2f')]);_0x160782['filters']=_[_0xefcb('0x30')](_0x160782[_0xefcb('0x2d')],_0x160782[_0xefcb('0x2f')]);_0x124546['attributes']=_[_0xefcb('0x30')](_0x160782[_0xefcb('0x2d')],qs[_0xefcb('0x31')](_0x1c7ee1['query']['fields']));_0x124546['attributes']=_0x124546['attributes'][_0xefcb('0x32')]?_0x124546[_0xefcb('0x33')]:_0x160782[_0xefcb('0x2d')];if(!_0x1c7ee1[_0xefcb('0x2f')][_0xefcb('0x34')](_0xefcb('0x35'))){_0x124546[_0xefcb('0x1a')]=qs[_0xefcb('0x1a')](_0x1c7ee1[_0xefcb('0x2f')][_0xefcb('0x1a')]);_0x124546[_0xefcb('0x18')]=qs[_0xefcb('0x18')](_0x1c7ee1[_0xefcb('0x2f')][_0xefcb('0x18')]);}_0x124546[_0xefcb('0x36')]=qs[_0xefcb('0x37')](_0x1c7ee1['query'][_0xefcb('0x37')]);_0x124546[_0xefcb('0x38')]=qs[_0xefcb('0x39')](_[_0xefcb('0x3a')](_0x1c7ee1['query'],_0x160782[_0xefcb('0x39')]),_0x43fb58);if(_0x1c7ee1['query'][_0xefcb('0x3b')]){_0x124546[_0xefcb('0x38')]=_[_0xefcb('0x3c')](_0x124546[_0xefcb('0x38')],{'$or':_['map'](_0x43fb58,function(_0x167dac){if(_0x167dac[_0xefcb('0x2b')]!==_0xefcb('0x3d')){var _0x5ba923={};_0x5ba923[_0x167dac[_0xefcb('0x25')]]={'$like':'%'+_0x1c7ee1[_0xefcb('0x2f')][_0xefcb('0x3b')]+'%'};return _0x5ba923;}})});}_0x124546=_['merge']({},_0x124546,_0x1c7ee1['options']);var _0x183bbd={'where':_0x124546['where']};return db['ChatQueueReport'][_0xefcb('0x1b')](_0x183bbd)[_0xefcb('0x21')](function(_0x2b354a){_0xccac33['count']=_0x2b354a;if(_0x1c7ee1['query']['includeAll']){_0x124546[_0xefcb('0x3e')]=[{'all':!![]}];}return db[_0xefcb('0x3f')]['findAll'](_0x124546);})[_0xefcb('0x21')](function(_0x5ae48d){_0xccac33[_0xefcb('0x40')]=_0x5ae48d;return _0xccac33;})[_0xefcb('0x21')](respondWithFilteredResult(_0xe2c2c8,_0x124546))[_0xefcb('0x41')](handleError(_0xe2c2c8,null));};exports[_0xefcb('0x42')]=function(_0x35d208,_0x5619d1){var _0x594207={'raw':!![],'where':{'id':_0x35d208[_0xefcb('0x43')]['id']}},_0x13dc1b={};_0x13dc1b['model']=_['keys'](db['ChatQueueReport'][_0xefcb('0x29')]);_0x13dc1b[_0xefcb('0x2f')]=_['keys'](_0x35d208[_0xefcb('0x2f')]);_0x13dc1b['filters']=_[_0xefcb('0x30')](_0x13dc1b[_0xefcb('0x2d')],_0x13dc1b[_0xefcb('0x2f')]);_0x594207[_0xefcb('0x33')]=_[_0xefcb('0x30')](_0x13dc1b['model'],qs[_0xefcb('0x31')](_0x35d208['query'][_0xefcb('0x31')]));_0x594207['attributes']=_0x594207[_0xefcb('0x33')]['length']?_0x594207[_0xefcb('0x33')]:_0x13dc1b['model'];if(_0x35d208[_0xefcb('0x2f')][_0xefcb('0x44')]){_0x594207[_0xefcb('0x3e')]=[{'all':!![]}];}_0x594207=_[_0xefcb('0x3c')]({},_0x594207,_0x35d208[_0xefcb('0x45')]);return db[_0xefcb('0x3f')]['find'](_0x594207)[_0xefcb('0x21')](handleEntityNotFound(_0x5619d1,null))['then'](respondWithResult(_0x5619d1,null))[_0xefcb('0x41')](handleError(_0x5619d1,null));};exports[_0xefcb('0x46')]=function(_0x3f990e,_0x32b0a2){return db[_0xefcb('0x3f')][_0xefcb('0x46')](_0x3f990e['body'],{})[_0xefcb('0x21')](respondWithResult(_0x32b0a2,0xc9))[_0xefcb('0x41')](handleError(_0x32b0a2,null));};exports[_0xefcb('0x20')]=function(_0x53c7d6,_0x4bdcc0){if(_0x53c7d6[_0xefcb('0x47')]['id']){delete _0x53c7d6[_0xefcb('0x47')]['id'];}return db['ChatQueueReport'][_0xefcb('0x48')]({'where':{'id':_0x53c7d6[_0xefcb('0x43')]['id']}})[_0xefcb('0x21')](handleEntityNotFound(_0x4bdcc0,null))[_0xefcb('0x21')](saveUpdates(_0x53c7d6[_0xefcb('0x47')],null))[_0xefcb('0x21')](respondWithResult(_0x4bdcc0,null))['catch'](handleError(_0x4bdcc0,null));};exports[_0xefcb('0x49')]=function(_0x42a580,_0x363284){return db[_0xefcb('0x3f')][_0xefcb('0x48')]({'where':{'id':_0x42a580[_0xefcb('0x43')]['id']}})[_0xefcb('0x21')](handleEntityNotFound(_0x363284,null))['then'](removeEntity(_0x363284,null))[_0xefcb('0x41')](handleError(_0x363284,null));};exports[_0xefcb('0x4a')]=function(_0x369833,_0x447bd8){return db[_0xefcb('0x3f')][_0xefcb('0x4a')]()[_0xefcb('0x21')](respondWithResult(_0x447bd8,null))[_0xefcb('0x41')](handleError(_0x447bd8,null));};
\ No newline at end of file
+var _0xf0f4=['find','create','catch','body','destroy','describe','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','ChatQueueReport','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params'];(function(_0x25c61b,_0xfe829e){var _0x2a6b3f=function(_0x5de7b2){while(--_0x5de7b2){_0x25c61b['push'](_0x25c61b['shift']());}};_0x2a6b3f(++_0xfe829e);}(_0xf0f4,0x182));var _0x4f0f=function(_0x33a543,_0x2737fb){_0x33a543=_0x33a543-0x0;var _0x2778ba=_0xf0f4[_0x33a543];return _0x2778ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f0f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4f0f('0x3'));var util=require(_0x4f0f('0x4'));var path=require(_0x4f0f('0x5'));var sox=require(_0x4f0f('0x6'));var csv=require(_0x4f0f('0x7'));var ejs=require(_0x4f0f('0x8'));var fs=require('fs');var fs_extra=require(_0x4f0f('0x9'));var _=require('lodash');var squel=require(_0x4f0f('0xa'));var crypto=require(_0x4f0f('0xb'));var jsforce=require(_0x4f0f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f0f('0x7'));var querystring=require(_0x4f0f('0xd'));var Papa=require(_0x4f0f('0xe'));var Redis=require(_0x4f0f('0xf'));var authService=require(_0x4f0f('0x10'));var qs=require(_0x4f0f('0x11'));var as=require(_0x4f0f('0x12'));var hardwareService=require(_0x4f0f('0x13'));var logger=require('../../config/logger')(_0x4f0f('0x14'));var utils=require(_0x4f0f('0x15'));var config=require(_0x4f0f('0x16'));var licenseUtil=require(_0x4f0f('0x17'));var db=require(_0x4f0f('0x18'))['db'];function respondWithStatusCode(_0x1a1b94,_0x123845){_0x123845=_0x123845||0xcc;return function(_0x11749b){if(_0x11749b){return _0x1a1b94[_0x4f0f('0x19')](_0x123845);}return _0x1a1b94[_0x4f0f('0x1a')](_0x123845)[_0x4f0f('0x1b')]();};}function respondWithResult(_0x4e1e26,_0xebecc0){_0xebecc0=_0xebecc0||0xc8;return function(_0x447238){if(_0x447238){return _0x4e1e26[_0x4f0f('0x1a')](_0xebecc0)[_0x4f0f('0x1c')](_0x447238);}};}function respondWithFilteredResult(_0x51a713,_0xd9ad12){return function(_0x46d7cf){if(_0x46d7cf){var _0x5783=typeof _0xd9ad12[_0x4f0f('0x1d')]===_0x4f0f('0x1e')&&typeof _0xd9ad12['limit']===_0x4f0f('0x1e');var _0x1942cf=_0x46d7cf[_0x4f0f('0x1f')];var _0x566049=_0x5783?0x0:_0xd9ad12[_0x4f0f('0x1d')];var _0x86186f=_0x5783?_0x46d7cf[_0x4f0f('0x1f')]:_0xd9ad12['offset']+_0xd9ad12[_0x4f0f('0x20')];var _0x2455f9;if(_0x86186f>=_0x1942cf){_0x86186f=_0x1942cf;_0x2455f9=0xc8;}else{_0x2455f9=0xce;}_0x51a713[_0x4f0f('0x1a')](_0x2455f9);return _0x51a713[_0x4f0f('0x21')](_0x4f0f('0x22'),_0x566049+'-'+_0x86186f+'/'+_0x1942cf)[_0x4f0f('0x1c')](_0x46d7cf);}return null;};}function patchUpdates(_0x537074){return function(_0x276387){try{jsonpatch['apply'](_0x276387,_0x537074,!![]);}catch(_0x3a6f22){return BPromise[_0x4f0f('0x23')](_0x3a6f22);}return _0x276387['save']();};}function saveUpdates(_0x4e4b28,_0x1bdfb4){return function(_0x55d318){if(_0x55d318){return _0x55d318[_0x4f0f('0x24')](_0x4e4b28)[_0x4f0f('0x25')](function(_0x18abde){return _0x18abde;});}return null;};}function removeEntity(_0x17f10c,_0x454720){return function(_0x17a9e9){if(_0x17a9e9){return _0x17a9e9['destroy']()[_0x4f0f('0x25')](function(){_0x17f10c[_0x4f0f('0x1a')](0xcc)[_0x4f0f('0x1b')]();});}};}function handleEntityNotFound(_0x3bc77d,_0xe969c7){return function(_0x3e6b72){if(!_0x3e6b72){_0x3bc77d[_0x4f0f('0x19')](0x194);}return _0x3e6b72;};}function handleError(_0x419986,_0x17cf17){_0x17cf17=_0x17cf17||0x1f4;return function(_0xb20be9){logger[_0x4f0f('0x26')](_0xb20be9[_0x4f0f('0x27')]);if(_0xb20be9[_0x4f0f('0x28')]){delete _0xb20be9['name'];}_0x419986[_0x4f0f('0x1a')](_0x17cf17)[_0x4f0f('0x29')](_0xb20be9);};}exports[_0x4f0f('0x2a')]=function(_0x58ec43,_0xa8a240){var _0x4e5f0d={},_0x449788={},_0x1f4e1d={'count':0x0,'rows':[]};var _0x5ada54=_['map'](db[_0x4f0f('0x2b')]['rawAttributes'],function(_0x1a005e){return{'name':_0x1a005e[_0x4f0f('0x2c')],'type':_0x1a005e['type'][_0x4f0f('0x2d')]};});_0x449788[_0x4f0f('0x2e')]=_[_0x4f0f('0x2f')](_0x5ada54,_0x4f0f('0x28'));_0x449788['query']=_[_0x4f0f('0x30')](_0x58ec43[_0x4f0f('0x31')]);_0x449788[_0x4f0f('0x32')]=_[_0x4f0f('0x33')](_0x449788['model'],_0x449788[_0x4f0f('0x31')]);_0x4e5f0d[_0x4f0f('0x34')]=_[_0x4f0f('0x33')](_0x449788['model'],qs[_0x4f0f('0x35')](_0x58ec43[_0x4f0f('0x31')]['fields']));_0x4e5f0d[_0x4f0f('0x34')]=_0x4e5f0d[_0x4f0f('0x34')][_0x4f0f('0x36')]?_0x4e5f0d[_0x4f0f('0x34')]:_0x449788['model'];if(!_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x37')](_0x4f0f('0x38'))){_0x4e5f0d[_0x4f0f('0x20')]=qs[_0x4f0f('0x20')](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x20')]);_0x4e5f0d[_0x4f0f('0x1d')]=qs['offset'](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x1d')]);}_0x4e5f0d[_0x4f0f('0x39')]=qs[_0x4f0f('0x3a')](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x3a')]);_0x4e5f0d[_0x4f0f('0x3b')]=qs['filters'](_[_0x4f0f('0x3c')](_0x58ec43[_0x4f0f('0x31')],_0x449788[_0x4f0f('0x32')]),_0x5ada54);if(_0x58ec43['query'][_0x4f0f('0x3d')]){_0x4e5f0d['where']=_[_0x4f0f('0x3e')](_0x4e5f0d['where'],{'$or':_[_0x4f0f('0x2f')](_0x5ada54,function(_0x27b5bf){if(_0x27b5bf['type']!==_0x4f0f('0x3f')){var _0x2d58b0={};_0x2d58b0[_0x27b5bf[_0x4f0f('0x28')]]={'$like':'%'+_0x58ec43['query'][_0x4f0f('0x3d')]+'%'};return _0x2d58b0;}})});}_0x4e5f0d=_[_0x4f0f('0x3e')]({},_0x4e5f0d,_0x58ec43[_0x4f0f('0x40')]);var _0x1b91d7={'where':_0x4e5f0d[_0x4f0f('0x3b')]};return db[_0x4f0f('0x2b')][_0x4f0f('0x1f')](_0x1b91d7)[_0x4f0f('0x25')](function(_0x2659b0){_0x1f4e1d[_0x4f0f('0x1f')]=_0x2659b0;if(_0x58ec43[_0x4f0f('0x31')]['includeAll']){_0x4e5f0d[_0x4f0f('0x41')]=[{'all':!![]}];}return db[_0x4f0f('0x2b')][_0x4f0f('0x42')](_0x4e5f0d);})[_0x4f0f('0x25')](function(_0x419cb4){_0x1f4e1d[_0x4f0f('0x43')]=_0x419cb4;return _0x1f4e1d;})[_0x4f0f('0x25')](respondWithFilteredResult(_0xa8a240,_0x4e5f0d))['catch'](handleError(_0xa8a240,null));};exports[_0x4f0f('0x44')]=function(_0x2e30d6,_0x1d8017){var _0x2bf0b3={'raw':!![],'where':{'id':_0x2e30d6[_0x4f0f('0x45')]['id']}},_0x1744f9={};_0x1744f9['model']=_[_0x4f0f('0x30')](db[_0x4f0f('0x2b')]['rawAttributes']);_0x1744f9['query']=_[_0x4f0f('0x30')](_0x2e30d6[_0x4f0f('0x31')]);_0x1744f9[_0x4f0f('0x32')]=_['intersection'](_0x1744f9[_0x4f0f('0x2e')],_0x1744f9['query']);_0x2bf0b3['attributes']=_[_0x4f0f('0x33')](_0x1744f9[_0x4f0f('0x2e')],qs[_0x4f0f('0x35')](_0x2e30d6[_0x4f0f('0x31')][_0x4f0f('0x35')]));_0x2bf0b3[_0x4f0f('0x34')]=_0x2bf0b3['attributes']['length']?_0x2bf0b3[_0x4f0f('0x34')]:_0x1744f9[_0x4f0f('0x2e')];if(_0x2e30d6[_0x4f0f('0x31')]['includeAll']){_0x2bf0b3[_0x4f0f('0x41')]=[{'all':!![]}];}_0x2bf0b3=_[_0x4f0f('0x3e')]({},_0x2bf0b3,_0x2e30d6[_0x4f0f('0x40')]);return db['ChatQueueReport'][_0x4f0f('0x46')](_0x2bf0b3)['then'](handleEntityNotFound(_0x1d8017,null))[_0x4f0f('0x25')](respondWithResult(_0x1d8017,null))['catch'](handleError(_0x1d8017,null));};exports[_0x4f0f('0x47')]=function(_0x3f2c6e,_0x2b0d3e){return db[_0x4f0f('0x2b')][_0x4f0f('0x47')](_0x3f2c6e['body'],{})['then'](respondWithResult(_0x2b0d3e,0xc9))[_0x4f0f('0x48')](handleError(_0x2b0d3e,null));};exports['update']=function(_0x12e587,_0x32d298){if(_0x12e587[_0x4f0f('0x49')]['id']){delete _0x12e587[_0x4f0f('0x49')]['id'];}return db[_0x4f0f('0x2b')][_0x4f0f('0x46')]({'where':{'id':_0x12e587[_0x4f0f('0x45')]['id']}})[_0x4f0f('0x25')](handleEntityNotFound(_0x32d298,null))['then'](saveUpdates(_0x12e587[_0x4f0f('0x49')],null))[_0x4f0f('0x25')](respondWithResult(_0x32d298,null))[_0x4f0f('0x48')](handleError(_0x32d298,null));};exports[_0x4f0f('0x4a')]=function(_0x355517,_0x3262a6){return db[_0x4f0f('0x2b')][_0x4f0f('0x46')]({'where':{'id':_0x355517[_0x4f0f('0x45')]['id']}})[_0x4f0f('0x25')](handleEntityNotFound(_0x3262a6,null))['then'](removeEntity(_0x3262a6,null))[_0x4f0f('0x48')](handleError(_0x3262a6,null));};exports['describe']=function(_0x3909c0,_0x36d13a){return db['ChatQueueReport'][_0x4f0f('0x4b')]()[_0x4f0f('0x25')](respondWithResult(_0x36d13a,null))[_0x4f0f('0x48')](handleError(_0x36d13a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 0c7742e..dee1a6c 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x4c34d8,_0x383073){var _0x4c21df=function(_0x36150e){while(--_0x36150e){_0x4c34d8['push'](_0x4c34d8['shift']());}};_0x4c21df(++_0x383073);}(_0xe706,0xa3));var _0x6e70=function(_0xd6db21,_0x1d08f3){_0xd6db21=_0xd6db21-0x0;var _0x3b96a0=_0xe706[_0xd6db21];return _0x3b96a0;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 57a3cde..bf18c62 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 _0x397a=['options','raw','UpdateChatQueueReport','ChatQueueReport','update','attributes','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','body'];(function(_0x5e75af,_0x3095f4){var _0xb5d271=function(_0x43155f){while(--_0x43155f){_0x5e75af['push'](_0x5e75af['shift']());}};_0xb5d271(++_0x3095f4);}(_0x397a,0x1b9));var _0xa397=function(_0x7f38f1,_0x5f10e4){_0x7f38f1=_0x7f38f1-0x0;var _0xf7aec5=_0x397a[_0x7f38f1];return _0xf7aec5;};'use strict';var _=require(_0xa397('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa397('0x1'));var rs=require(_0xa397('0x2'));var fs=require('fs');var Redis=require(_0xa397('0x3'));var db=require(_0xa397('0x4'))['db'];var utils=require(_0xa397('0x5'));var logger=require(_0xa397('0x6'))(_0xa397('0x7'));var config=require(_0xa397('0x8'));var jayson=require(_0xa397('0x9'));var client=jayson[_0xa397('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca07d,_0x4b2863,_0x3e9c24){return new BPromise(function(_0x2c8f90,_0x285d10){return client[_0xa397('0xb')](_0x4ca07d,_0x3e9c24)[_0xa397('0xc')](function(_0x38dada){logger[_0xa397('0xd')](_0xa397('0xe'),_0x4b2863,_0xa397('0xf'));logger['debug'](_0xa397('0x10'),_0x4b2863,'request\x20sent',JSON[_0xa397('0x11')](_0x38dada));if(_0x38dada[_0xa397('0x12')]){if(_0x38dada[_0xa397('0x12')]['code']===0x1f4){logger[_0xa397('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x4b2863,_0x38dada[_0xa397('0x12')]['message']);return _0x285d10(_0x38dada[_0xa397('0x12')][_0xa397('0x13')]);}logger[_0xa397('0x12')](_0xa397('0xe'),_0x4b2863,_0x38dada[_0xa397('0x12')][_0xa397('0x13')]);return _0x2c8f90(_0x38dada['error'][_0xa397('0x13')]);}else{logger[_0xa397('0xd')](_0xa397('0xe'),_0x4b2863,_0xa397('0xf'));_0x2c8f90(_0x38dada[_0xa397('0x14')][_0xa397('0x13')]);}})[_0xa397('0x15')](function(_0xf868c3){logger[_0xa397('0x12')](_0xa397('0xe'),_0x4b2863,_0xf868c3);_0x285d10(_0xf868c3);});});}exports[_0xa397('0x16')]=function(_0x239172){var _0x57e55d=this;return new Promise(function(_0x217f44,_0x2bd065){return db['ChatQueueReport']['create'](_0x239172[_0xa397('0x17')],{'raw':_0x239172[_0xa397('0x18')]?_0x239172['options'][_0xa397('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x39b373){logger['info'](_0xa397('0x16'),_0x239172);logger['debug']('CreateChatQueueReport',_0x239172,JSON[_0xa397('0x11')](_0x39b373));_0x217f44(_0x39b373);})[_0xa397('0x15')](function(_0x47ed89){logger[_0xa397('0x12')](_0xa397('0x16'),_0x47ed89[_0xa397('0x13')],_0x239172);_0x2bd065(_0x57e55d[_0xa397('0x12')](0x1f4,_0x47ed89[_0xa397('0x13')]));});});};exports[_0xa397('0x1a')]=function(_0x377ecc){var _0x5de296=this;return new Promise(function(_0x4c16c9,_0x5d3e23){return db[_0xa397('0x1b')][_0xa397('0x1c')](_0x377ecc[_0xa397('0x17')],{'raw':_0x377ecc[_0xa397('0x18')]?_0x377ecc['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377ecc[_0xa397('0x18')]?_0x377ecc[_0xa397('0x18')]['where']||null:null,'attributes':_0x377ecc[_0xa397('0x18')]?_0x377ecc[_0xa397('0x18')][_0xa397('0x1d')]||null:null,'limit':_0x377ecc['options']?_0x377ecc[_0xa397('0x18')]['limit']||null:null})[_0xa397('0xc')](function(_0x227be4){logger[_0xa397('0xd')](_0xa397('0x1a'),_0x377ecc);logger[_0xa397('0x1e')]('UpdateChatQueueReport',_0x377ecc,JSON[_0xa397('0x11')](_0x227be4));_0x4c16c9(_0x227be4);})[_0xa397('0x15')](function(_0x55762c){logger[_0xa397('0x12')]('UpdateChatQueueReport',_0x55762c[_0xa397('0x13')],_0x377ecc);_0x5d3e23(_0x5de296[_0xa397('0x12')](0x1f4,_0x55762c[_0xa397('0x13')]));});});};
\ No newline at end of file
+var _0x7113=['stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','CreateChatQueueReport','ChatQueueReport','body','options','raw','info','debug','catch','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x401974,_0x10b6ea){var _0x38b6c7=function(_0xb05ad6){while(--_0xb05ad6){_0x401974['push'](_0x401974['shift']());}};_0x38b6c7(++_0x10b6ea);}(_0x7113,0x19e));var _0x3711=function(_0x4681f4,_0xf1477c){_0x4681f4=_0x4681f4-0x0;var _0xf6db13=_0x7113[_0x4681f4];return _0xf6db13;};'use strict';var _=require(_0x3711('0x0'));var util=require(_0x3711('0x1'));var moment=require(_0x3711('0x2'));var BPromise=require('bluebird');var rs=require(_0x3711('0x3'));var fs=require('fs');var Redis=require(_0x3711('0x4'));var db=require(_0x3711('0x5'))['db'];var utils=require(_0x3711('0x6'));var logger=require(_0x3711('0x7'))(_0x3711('0x8'));var config=require(_0x3711('0x9'));var jayson=require(_0x3711('0xa'));var client=jayson[_0x3711('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5302,_0x1cc4ba,_0x319855){return new BPromise(function(_0x1221fb,_0x27b0be){return client['request'](_0x3a5302,_0x319855)[_0x3711('0xc')](function(_0x5f0806){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x1cc4ba,_0x3711('0xd'));logger['debug'](_0x3711('0xe'),_0x1cc4ba,_0x3711('0xd'),JSON[_0x3711('0xf')](_0x5f0806));if(_0x5f0806['error']){if(_0x5f0806[_0x3711('0x10')][_0x3711('0x11')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x1cc4ba,_0x5f0806[_0x3711('0x10')][_0x3711('0x12')]);return _0x27b0be(_0x5f0806[_0x3711('0x10')][_0x3711('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x1cc4ba,_0x5f0806[_0x3711('0x10')]['message']);return _0x1221fb(_0x5f0806['error']['message']);}else{logger['info'](_0x3711('0x13'),_0x1cc4ba,_0x3711('0xd'));_0x1221fb(_0x5f0806[_0x3711('0x14')]['message']);}})['catch'](function(_0x8e9042){logger[_0x3711('0x10')](_0x3711('0x13'),_0x1cc4ba,_0x8e9042);_0x27b0be(_0x8e9042);});});}exports[_0x3711('0x15')]=function(_0x3a3bf6){var _0x27238d=this;return new Promise(function(_0x55eaa2,_0x166303){return db[_0x3711('0x16')]['create'](_0x3a3bf6[_0x3711('0x17')],{'raw':_0x3a3bf6[_0x3711('0x18')]?_0x3a3bf6[_0x3711('0x18')][_0x3711('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xe1afda){logger[_0x3711('0x1a')](_0x3711('0x15'),_0x3a3bf6);logger[_0x3711('0x1b')](_0x3711('0x15'),_0x3a3bf6,JSON[_0x3711('0xf')](_0xe1afda));_0x55eaa2(_0xe1afda);})[_0x3711('0x1c')](function(_0x4739b3){logger[_0x3711('0x10')](_0x3711('0x15'),_0x4739b3[_0x3711('0x12')],_0x3a3bf6);_0x166303(_0x27238d[_0x3711('0x10')](0x1f4,_0x4739b3['message']));});});};exports[_0x3711('0x1d')]=function(_0x1f6b7c){var _0x670182=this;return new Promise(function(_0x344abc,_0x48236f){return db[_0x3711('0x16')][_0x3711('0x1e')](_0x1f6b7c[_0x3711('0x17')],{'raw':_0x1f6b7c['options']?_0x1f6b7c[_0x3711('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f6b7c['options']?_0x1f6b7c[_0x3711('0x18')]['where']||null:null,'attributes':_0x1f6b7c[_0x3711('0x18')]?_0x1f6b7c[_0x3711('0x18')][_0x3711('0x1f')]||null:null,'limit':_0x1f6b7c['options']?_0x1f6b7c['options'][_0x3711('0x20')]||null:null})[_0x3711('0xc')](function(_0xc4ade7){logger[_0x3711('0x1a')](_0x3711('0x1d'),_0x1f6b7c);logger[_0x3711('0x1b')](_0x3711('0x1d'),_0x1f6b7c,JSON[_0x3711('0xf')](_0xc4ade7));_0x344abc(_0xc4ade7);})[_0x3711('0x1c')](function(_0xf5b9ac){logger['error'](_0x3711('0x1d'),_0xf5b9ac[_0x3711('0x12')],_0x1f6b7c);_0x48236f(_0x670182['error'](0x1f4,_0xf5b9ac[_0x3711('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 25d898e..a889718 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 _0xb5bb=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','delete','destroy'];(function(_0x4a489f,_0x5402ab){var _0x4a4137=function(_0x4e35f3){while(--_0x4e35f3){_0x4a489f['push'](_0x4a489f['shift']());}};_0x4a4137(++_0x5402ab);}(_0xb5bb,0x1cd));var _0xbb5b=function(_0x5131d6,_0x7d0af2){_0x5131d6=_0x5131d6-0x0;var _0xde5e11=_0xb5bb[_0x5131d6];return _0xde5e11;};'use strict';var multer=require(_0xbb5b('0x0'));var util=require(_0xbb5b('0x1'));var path=require(_0xbb5b('0x2'));var timeout=require(_0xbb5b('0x3'));var express=require(_0xbb5b('0x4'));var router=express[_0xbb5b('0x5')]();var fs_extra=require(_0xbb5b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbb5b('0x7'));var controller=require(_0xbb5b('0x8'));router[_0xbb5b('0x9')]('/',auth[_0xbb5b('0xa')](),controller[_0xbb5b('0xb')]);router[_0xbb5b('0x9')](_0xbb5b('0xc'),auth[_0xbb5b('0xa')](),controller['describe']);router[_0xbb5b('0x9')](_0xbb5b('0xd'),auth[_0xbb5b('0xa')](),controller[_0xbb5b('0xe')]);router[_0xbb5b('0xf')]('/',auth[_0xbb5b('0xa')](),controller[_0xbb5b('0x10')]);router['put'](_0xbb5b('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xbb5b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbb5b('0x12')]);module[_0xbb5b('0x13')]=router;
\ No newline at end of file
+var _0xcf2a=['get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','util','connect-timeout','express','Router','../../components/auth/service','./chatQueueReport.controller'];(function(_0x3d90b4,_0x1e2fc6){var _0x4c65d3=function(_0x311abc){while(--_0x311abc){_0x3d90b4['push'](_0x3d90b4['shift']());}};_0x4c65d3(++_0x1e2fc6);}(_0xcf2a,0xd2));var _0xacf2=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xcf2a[_0x2b91c5];return _0xbd5531;};'use strict';var multer=require('multer');var util=require(_0xacf2('0x0'));var path=require('path');var timeout=require(_0xacf2('0x1'));var express=require(_0xacf2('0x2'));var router=express[_0xacf2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xacf2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xacf2('0x5'));router[_0xacf2('0x6')]('/',auth[_0xacf2('0x7')](),controller[_0xacf2('0x8')]);router[_0xacf2('0x6')](_0xacf2('0x9'),auth[_0xacf2('0x7')](),controller[_0xacf2('0xa')]);router[_0xacf2('0x6')]('/:id',auth[_0xacf2('0x7')](),controller[_0xacf2('0xb')]);router[_0xacf2('0xc')]('/',auth[_0xacf2('0x7')](),controller[_0xacf2('0xd')]);router[_0xacf2('0xe')](_0xacf2('0xf'),auth[_0xacf2('0x7')](),controller[_0xacf2('0x10')]);router[_0xacf2('0x11')](_0xacf2('0xf'),auth[_0xacf2('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index c5b3b7e..848046d 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x24a43a,_0xc7767c){var _0x4afb06=function(_0x6c8806){while(--_0x6c8806){_0x24a43a['push'](_0x24a43a['shift']());}};_0x4afb06(++_0xc7767c);}(_0xedd9,0xfc));var _0x9edd=function(_0x4b4c52,_0x387ec2){_0x4b4c52=_0x4b4c52-0x0;var _0x4d0dec=_0xedd9[_0x4b4c52];return _0x4d0dec;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x5287a5,_0x3ff0ad){var _0x158a73=function(_0x351f02){while(--_0x351f02){_0x5287a5['push'](_0x5287a5['shift']());}};_0x158a73(++_0x3ff0ad);}(_0x54ef,0x112));var _0xf54e=function(_0x41cd58,_0x41a9a8){_0x41cd58=_0x41cd58-0x0;var _0x5b8e70=_0x54ef[_0x41cd58];return _0x5b8e70;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index c4f796d..55908fc 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 _0x8ae9=['bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','send','index','map','rawAttributes','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','find','catch','create','update','body','params','describe','eml-format','rimraf','moment'];(function(_0x525ca2,_0x2fb2b8){var _0x3fa129=function(_0x14a150){while(--_0x14a150){_0x525ca2['push'](_0x525ca2['shift']());}};_0x3fa129(++_0x2fb2b8);}(_0x8ae9,0x179));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x98ae('0x0'));var rimraf=require(_0x98ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98ae('0x2'));var BPromise=require(_0x98ae('0x3'));var Mustache=require(_0x98ae('0x4'));var util=require('util');var path=require('path');var sox=require(_0x98ae('0x5'));var csv=require(_0x98ae('0x6'));var ejs=require(_0x98ae('0x7'));var fs=require('fs');var fs_extra=require(_0x98ae('0x8'));var _=require('lodash');var squel=require(_0x98ae('0x9'));var crypto=require(_0x98ae('0xa'));var jsforce=require(_0x98ae('0xb'));var deskjs=require(_0x98ae('0xc'));var toCsv=require('to-csv');var querystring=require(_0x98ae('0xd'));var Papa=require(_0x98ae('0xe'));var Redis=require(_0x98ae('0xf'));var authService=require(_0x98ae('0x10'));var qs=require(_0x98ae('0x11'));var as=require(_0x98ae('0x12'));var hardwareService=require(_0x98ae('0x13'));var logger=require(_0x98ae('0x14'))(_0x98ae('0x15'));var utils=require('../../config/utils');var config=require(_0x98ae('0x16'));var licenseUtil=require(_0x98ae('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c85a2,_0x1637d7){_0x1637d7=_0x1637d7||0xcc;return function(_0x1e4575){if(_0x1e4575){return _0x1c85a2[_0x98ae('0x18')](_0x1637d7);}return _0x1c85a2['status'](_0x1637d7)[_0x98ae('0x19')]();};}function respondWithResult(_0x4431f4,_0x5bc227){_0x5bc227=_0x5bc227||0xc8;return function(_0x42fbbf){if(_0x42fbbf){return _0x4431f4[_0x98ae('0x1a')](_0x5bc227)[_0x98ae('0x1b')](_0x42fbbf);}};}function respondWithFilteredResult(_0x5e7578,_0x3d3861){return function(_0x53604e){if(_0x53604e){var _0x3476f1=typeof _0x3d3861['offset']==='undefined'&&typeof _0x3d3861[_0x98ae('0x1c')]===_0x98ae('0x1d');var _0x1b6e20=_0x53604e[_0x98ae('0x1e')];var _0x47cfdc=_0x3476f1?0x0:_0x3d3861[_0x98ae('0x1f')];var _0x56cf48=_0x3476f1?_0x53604e[_0x98ae('0x1e')]:_0x3d3861[_0x98ae('0x1f')]+_0x3d3861[_0x98ae('0x1c')];var _0x4804f5;if(_0x56cf48>=_0x1b6e20){_0x56cf48=_0x1b6e20;_0x4804f5=0xc8;}else{_0x4804f5=0xce;}_0x5e7578['status'](_0x4804f5);return _0x5e7578[_0x98ae('0x20')](_0x98ae('0x21'),_0x47cfdc+'-'+_0x56cf48+'/'+_0x1b6e20)[_0x98ae('0x1b')](_0x53604e);}return null;};}function patchUpdates(_0x521314){return function(_0x828d9){try{jsonpatch[_0x98ae('0x22')](_0x828d9,_0x521314,!![]);}catch(_0x29bb80){return BPromise['reject'](_0x29bb80);}return _0x828d9[_0x98ae('0x23')]();};}function saveUpdates(_0x4721dd,_0x198491){return function(_0x54b7fd){if(_0x54b7fd){return _0x54b7fd['update'](_0x4721dd)[_0x98ae('0x24')](function(_0x6b7ee0){return _0x6b7ee0;});}return null;};}function removeEntity(_0x455449,_0x47efeb){return function(_0x122d22){if(_0x122d22){return _0x122d22[_0x98ae('0x25')]()[_0x98ae('0x24')](function(){_0x455449['status'](0xcc)[_0x98ae('0x19')]();});}};}function handleEntityNotFound(_0x1c46da,_0x4aa449){return function(_0x59146a){if(!_0x59146a){_0x1c46da['sendStatus'](0x194);}return _0x59146a;};}function handleError(_0x587ca8,_0x3f308e){_0x3f308e=_0x3f308e||0x1f4;return function(_0x1b96d8){logger[_0x98ae('0x26')](_0x1b96d8[_0x98ae('0x27')]);if(_0x1b96d8['name']){delete _0x1b96d8['name'];}_0x587ca8[_0x98ae('0x1a')](_0x3f308e)[_0x98ae('0x28')](_0x1b96d8);};}exports[_0x98ae('0x29')]=function(_0x45a0e3,_0xd42fa){var _0xc2a637={},_0x2c43f0={},_0x25f782={'count':0x0,'rows':[]};var _0x4560ae=_[_0x98ae('0x2a')](db['ChatTransferReport'][_0x98ae('0x2b')],function(_0x239d35){return{'name':_0x239d35['fieldName'],'type':_0x239d35['type'][_0x98ae('0x2c')]};});_0x2c43f0[_0x98ae('0x2d')]=_[_0x98ae('0x2a')](_0x4560ae,_0x98ae('0x2e'));_0x2c43f0[_0x98ae('0x2f')]=_[_0x98ae('0x30')](_0x45a0e3[_0x98ae('0x2f')]);_0x2c43f0[_0x98ae('0x31')]=_['intersection'](_0x2c43f0[_0x98ae('0x2d')],_0x2c43f0[_0x98ae('0x2f')]);_0xc2a637[_0x98ae('0x32')]=_[_0x98ae('0x33')](_0x2c43f0[_0x98ae('0x2d')],qs[_0x98ae('0x34')](_0x45a0e3['query'][_0x98ae('0x34')]));_0xc2a637[_0x98ae('0x32')]=_0xc2a637[_0x98ae('0x32')][_0x98ae('0x35')]?_0xc2a637['attributes']:_0x2c43f0[_0x98ae('0x2d')];if(!_0x45a0e3['query'][_0x98ae('0x36')](_0x98ae('0x37'))){_0xc2a637['limit']=qs[_0x98ae('0x1c')](_0x45a0e3[_0x98ae('0x2f')]['limit']);_0xc2a637[_0x98ae('0x1f')]=qs[_0x98ae('0x1f')](_0x45a0e3['query'][_0x98ae('0x1f')]);}_0xc2a637[_0x98ae('0x38')]=qs[_0x98ae('0x39')](_0x45a0e3[_0x98ae('0x2f')][_0x98ae('0x39')]);_0xc2a637[_0x98ae('0x3a')]=qs[_0x98ae('0x31')](_['pick'](_0x45a0e3[_0x98ae('0x2f')],_0x2c43f0[_0x98ae('0x31')]),_0x4560ae);if(_0x45a0e3['query'][_0x98ae('0x3b')]){_0xc2a637['where']=_[_0x98ae('0x3c')](_0xc2a637[_0x98ae('0x3a')],{'$or':_[_0x98ae('0x2a')](_0x4560ae,function(_0xe0e73e){if(_0xe0e73e[_0x98ae('0x3d')]!==_0x98ae('0x3e')){var _0x333e0f={};_0x333e0f[_0xe0e73e[_0x98ae('0x2e')]]={'$like':'%'+_0x45a0e3[_0x98ae('0x2f')][_0x98ae('0x3b')]+'%'};return _0x333e0f;}})});}_0xc2a637=_['merge']({},_0xc2a637,_0x45a0e3[_0x98ae('0x3f')]);var _0x11da84={'where':_0xc2a637['where']};return db[_0x98ae('0x40')]['count'](_0x11da84)[_0x98ae('0x24')](function(_0x597d8f){_0x25f782[_0x98ae('0x1e')]=_0x597d8f;if(_0x45a0e3['query'][_0x98ae('0x41')]){_0xc2a637[_0x98ae('0x42')]=[{'all':!![]}];}return db[_0x98ae('0x40')][_0x98ae('0x43')](_0xc2a637);})['then'](function(_0x3ddf84){_0x25f782[_0x98ae('0x44')]=_0x3ddf84;return _0x25f782;})['then'](respondWithFilteredResult(_0xd42fa,_0xc2a637))['catch'](handleError(_0xd42fa,null));};exports['show']=function(_0x51af6e,_0x39f94b){var _0x39293b={'raw':!![],'where':{'id':_0x51af6e['params']['id']}},_0x363cb0={};_0x363cb0[_0x98ae('0x2d')]=_['keys'](db[_0x98ae('0x40')][_0x98ae('0x2b')]);_0x363cb0[_0x98ae('0x2f')]=_[_0x98ae('0x30')](_0x51af6e[_0x98ae('0x2f')]);_0x363cb0[_0x98ae('0x31')]=_['intersection'](_0x363cb0[_0x98ae('0x2d')],_0x363cb0['query']);_0x39293b[_0x98ae('0x32')]=_[_0x98ae('0x33')](_0x363cb0['model'],qs[_0x98ae('0x34')](_0x51af6e[_0x98ae('0x2f')][_0x98ae('0x34')]));_0x39293b[_0x98ae('0x32')]=_0x39293b[_0x98ae('0x32')][_0x98ae('0x35')]?_0x39293b[_0x98ae('0x32')]:_0x363cb0[_0x98ae('0x2d')];if(_0x51af6e[_0x98ae('0x2f')][_0x98ae('0x41')]){_0x39293b[_0x98ae('0x42')]=[{'all':!![]}];}_0x39293b=_['merge']({},_0x39293b,_0x51af6e[_0x98ae('0x3f')]);return db['ChatTransferReport'][_0x98ae('0x45')](_0x39293b)[_0x98ae('0x24')](handleEntityNotFound(_0x39f94b,null))[_0x98ae('0x24')](respondWithResult(_0x39f94b,null))[_0x98ae('0x46')](handleError(_0x39f94b,null));};exports[_0x98ae('0x47')]=function(_0x2e7b9e,_0x2ed29a){return db['ChatTransferReport'][_0x98ae('0x47')](_0x2e7b9e['body'],{})['then'](respondWithResult(_0x2ed29a,0xc9))[_0x98ae('0x46')](handleError(_0x2ed29a,null));};exports[_0x98ae('0x48')]=function(_0x52a33c,_0x2b76b0){if(_0x52a33c[_0x98ae('0x49')]['id']){delete _0x52a33c[_0x98ae('0x49')]['id'];}return db[_0x98ae('0x40')][_0x98ae('0x45')]({'where':{'id':_0x52a33c['params']['id']}})[_0x98ae('0x24')](handleEntityNotFound(_0x2b76b0,null))['then'](saveUpdates(_0x52a33c[_0x98ae('0x49')],null))[_0x98ae('0x24')](respondWithResult(_0x2b76b0,null))[_0x98ae('0x46')](handleError(_0x2b76b0,null));};exports[_0x98ae('0x25')]=function(_0x2f3173,_0xa4e569){return db[_0x98ae('0x40')][_0x98ae('0x45')]({'where':{'id':_0x2f3173[_0x98ae('0x4a')]['id']}})[_0x98ae('0x24')](handleEntityNotFound(_0xa4e569,null))[_0x98ae('0x24')](removeEntity(_0xa4e569,null))[_0x98ae('0x46')](handleError(_0xa4e569,null));};exports['describe']=function(_0x1bfa95,_0x4dae2c){return db[_0x98ae('0x40')][_0x98ae('0x4b')]()[_0x98ae('0x24')](respondWithResult(_0x4dae2c,null))[_0x98ae('0x46')](handleError(_0x4dae2c,null));};
\ No newline at end of file
+var _0x195e=['hasOwnProperty','order','sort','filters','pick','merge','VIRTUAL','name','filter','where','catch','show','includeAll','include','options','find','create','body','params','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length'];(function(_0x44dbea,_0x1db45d){var _0x47c705=function(_0x1622b4){while(--_0x1622b4){_0x44dbea['push'](_0x44dbea['shift']());}};_0x47c705(++_0x1db45d);}(_0x195e,0xf2));var _0xe195=function(_0x4be30e,_0x5e98b9){_0x4be30e=_0x4be30e-0x0;var _0x37e375=_0x195e[_0x4be30e];return _0x37e375;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe195('0x0'));var zipdir=require(_0xe195('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe195('0x2'));var moment=require('moment');var BPromise=require(_0xe195('0x3'));var Mustache=require(_0xe195('0x4'));var util=require(_0xe195('0x5'));var path=require('path');var sox=require(_0xe195('0x6'));var csv=require('to-csv');var ejs=require(_0xe195('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe195('0x8'));var squel=require(_0xe195('0x9'));var crypto=require(_0xe195('0xa'));var jsforce=require(_0xe195('0xb'));var deskjs=require(_0xe195('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe195('0xd'));var Papa=require(_0xe195('0xe'));var Redis=require(_0xe195('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe195('0x10'));var as=require(_0xe195('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe195('0x12'))('api');var utils=require(_0xe195('0x13'));var config=require(_0xe195('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe195('0x15'))['db'];function respondWithStatusCode(_0xb6142f,_0x332c43){_0x332c43=_0x332c43||0xcc;return function(_0x258b02){if(_0x258b02){return _0xb6142f['sendStatus'](_0x332c43);}return _0xb6142f[_0xe195('0x16')](_0x332c43)[_0xe195('0x17')]();};}function respondWithResult(_0x7331dd,_0x1b7cd5){_0x1b7cd5=_0x1b7cd5||0xc8;return function(_0x28dc85){if(_0x28dc85){return _0x7331dd[_0xe195('0x16')](_0x1b7cd5)[_0xe195('0x18')](_0x28dc85);}};}function respondWithFilteredResult(_0x420481,_0x12df12){return function(_0x234152){if(_0x234152){var _0x496580=typeof _0x12df12[_0xe195('0x19')]===_0xe195('0x1a')&&typeof _0x12df12['limit']===_0xe195('0x1a');var _0xc7dc28=_0x234152['count'];var _0x4e5299=_0x496580?0x0:_0x12df12[_0xe195('0x19')];var _0x428f68=_0x496580?_0x234152[_0xe195('0x1b')]:_0x12df12['offset']+_0x12df12[_0xe195('0x1c')];var _0x44a53f;if(_0x428f68>=_0xc7dc28){_0x428f68=_0xc7dc28;_0x44a53f=0xc8;}else{_0x44a53f=0xce;}_0x420481[_0xe195('0x16')](_0x44a53f);return _0x420481[_0xe195('0x1d')](_0xe195('0x1e'),_0x4e5299+'-'+_0x428f68+'/'+_0xc7dc28)[_0xe195('0x18')](_0x234152);}return null;};}function patchUpdates(_0x2c3a77){return function(_0x32e9b5){try{jsonpatch[_0xe195('0x1f')](_0x32e9b5,_0x2c3a77,!![]);}catch(_0x684d78){return BPromise[_0xe195('0x20')](_0x684d78);}return _0x32e9b5[_0xe195('0x21')]();};}function saveUpdates(_0x52ae8d,_0x289c67){return function(_0xd8c662){if(_0xd8c662){return _0xd8c662[_0xe195('0x22')](_0x52ae8d)[_0xe195('0x23')](function(_0x3bb32c){return _0x3bb32c;});}return null;};}function removeEntity(_0x297e6d,_0x468021){return function(_0x4e72c8){if(_0x4e72c8){return _0x4e72c8[_0xe195('0x24')]()['then'](function(){_0x297e6d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38aa58,_0x121e52){return function(_0x50bfdd){if(!_0x50bfdd){_0x38aa58[_0xe195('0x25')](0x194);}return _0x50bfdd;};}function handleError(_0x13e130,_0x4a0b47){_0x4a0b47=_0x4a0b47||0x1f4;return function(_0x2fc75d){logger[_0xe195('0x26')](_0x2fc75d[_0xe195('0x27')]);if(_0x2fc75d['name']){delete _0x2fc75d['name'];}_0x13e130[_0xe195('0x16')](_0x4a0b47)['send'](_0x2fc75d);};}exports[_0xe195('0x28')]=function(_0x36aac3,_0x3c3a11){var _0xb3a8cd={},_0x102770={},_0x12a736={'count':0x0,'rows':[]};var _0x8bec4f=_[_0xe195('0x29')](db[_0xe195('0x2a')][_0xe195('0x2b')],function(_0x4c6a8c){return{'name':_0x4c6a8c[_0xe195('0x2c')],'type':_0x4c6a8c[_0xe195('0x2d')][_0xe195('0x2e')]};});_0x102770['model']=_[_0xe195('0x29')](_0x8bec4f,'name');_0x102770['query']=_[_0xe195('0x2f')](_0x36aac3[_0xe195('0x30')]);_0x102770['filters']=_[_0xe195('0x31')](_0x102770[_0xe195('0x32')],_0x102770[_0xe195('0x30')]);_0xb3a8cd['attributes']=_[_0xe195('0x31')](_0x102770['model'],qs[_0xe195('0x33')](_0x36aac3['query'][_0xe195('0x33')]));_0xb3a8cd[_0xe195('0x34')]=_0xb3a8cd[_0xe195('0x34')][_0xe195('0x35')]?_0xb3a8cd['attributes']:_0x102770[_0xe195('0x32')];if(!_0x36aac3[_0xe195('0x30')][_0xe195('0x36')]('nolimit')){_0xb3a8cd['limit']=qs[_0xe195('0x1c')](_0x36aac3[_0xe195('0x30')][_0xe195('0x1c')]);_0xb3a8cd['offset']=qs[_0xe195('0x19')](_0x36aac3[_0xe195('0x30')][_0xe195('0x19')]);}_0xb3a8cd[_0xe195('0x37')]=qs[_0xe195('0x38')](_0x36aac3[_0xe195('0x30')]['sort']);_0xb3a8cd['where']=qs[_0xe195('0x39')](_[_0xe195('0x3a')](_0x36aac3['query'],_0x102770[_0xe195('0x39')]),_0x8bec4f);if(_0x36aac3[_0xe195('0x30')]['filter']){_0xb3a8cd['where']=_[_0xe195('0x3b')](_0xb3a8cd['where'],{'$or':_[_0xe195('0x29')](_0x8bec4f,function(_0x2c6576){if(_0x2c6576['type']!==_0xe195('0x3c')){var _0x433dc2={};_0x433dc2[_0x2c6576[_0xe195('0x3d')]]={'$like':'%'+_0x36aac3['query'][_0xe195('0x3e')]+'%'};return _0x433dc2;}})});}_0xb3a8cd=_[_0xe195('0x3b')]({},_0xb3a8cd,_0x36aac3['options']);var _0x2d68d8={'where':_0xb3a8cd[_0xe195('0x3f')]};return db['ChatTransferReport'][_0xe195('0x1b')](_0x2d68d8)['then'](function(_0x2a5f23){_0x12a736[_0xe195('0x1b')]=_0x2a5f23;if(_0x36aac3[_0xe195('0x30')]['includeAll']){_0xb3a8cd['include']=[{'all':!![]}];}return db[_0xe195('0x2a')]['findAll'](_0xb3a8cd);})[_0xe195('0x23')](function(_0x4139f0){_0x12a736['rows']=_0x4139f0;return _0x12a736;})[_0xe195('0x23')](respondWithFilteredResult(_0x3c3a11,_0xb3a8cd))[_0xe195('0x40')](handleError(_0x3c3a11,null));};exports[_0xe195('0x41')]=function(_0x138e97,_0x4f6be4){var _0x471b32={'raw':!![],'where':{'id':_0x138e97['params']['id']}},_0x712cfa={};_0x712cfa[_0xe195('0x32')]=_['keys'](db[_0xe195('0x2a')][_0xe195('0x2b')]);_0x712cfa['query']=_[_0xe195('0x2f')](_0x138e97[_0xe195('0x30')]);_0x712cfa['filters']=_['intersection'](_0x712cfa['model'],_0x712cfa[_0xe195('0x30')]);_0x471b32[_0xe195('0x34')]=_[_0xe195('0x31')](_0x712cfa[_0xe195('0x32')],qs['fields'](_0x138e97[_0xe195('0x30')]['fields']));_0x471b32[_0xe195('0x34')]=_0x471b32[_0xe195('0x34')][_0xe195('0x35')]?_0x471b32[_0xe195('0x34')]:_0x712cfa['model'];if(_0x138e97[_0xe195('0x30')][_0xe195('0x42')]){_0x471b32[_0xe195('0x43')]=[{'all':!![]}];}_0x471b32=_[_0xe195('0x3b')]({},_0x471b32,_0x138e97[_0xe195('0x44')]);return db[_0xe195('0x2a')][_0xe195('0x45')](_0x471b32)['then'](handleEntityNotFound(_0x4f6be4,null))['then'](respondWithResult(_0x4f6be4,null))[_0xe195('0x40')](handleError(_0x4f6be4,null));};exports['create']=function(_0xb92e3c,_0x4cb542){return db[_0xe195('0x2a')][_0xe195('0x46')](_0xb92e3c['body'],{})['then'](respondWithResult(_0x4cb542,0xc9))['catch'](handleError(_0x4cb542,null));};exports['update']=function(_0x109411,_0x4bba5e){if(_0x109411[_0xe195('0x47')]['id']){delete _0x109411[_0xe195('0x47')]['id'];}return db['ChatTransferReport'][_0xe195('0x45')]({'where':{'id':_0x109411[_0xe195('0x48')]['id']}})[_0xe195('0x23')](handleEntityNotFound(_0x4bba5e,null))[_0xe195('0x23')](saveUpdates(_0x109411[_0xe195('0x47')],null))[_0xe195('0x23')](respondWithResult(_0x4bba5e,null))['catch'](handleError(_0x4bba5e,null));};exports[_0xe195('0x24')]=function(_0x3aebf7,_0x2e032d){return db['ChatTransferReport'][_0xe195('0x45')]({'where':{'id':_0x3aebf7[_0xe195('0x48')]['id']}})[_0xe195('0x23')](handleEntityNotFound(_0x2e032d,null))[_0xe195('0x23')](removeEntity(_0x2e032d,null))[_0xe195('0x40')](handleError(_0x2e032d,null));};exports['describe']=function(_0x537a0b,_0x32a144){return db['ChatTransferReport'][_0xe195('0x49')]()['then'](respondWithResult(_0x32a144,null))[_0xe195('0x40')](handleError(_0x32a144,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index ca6daac..f6e3dfb 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 _0xc3b1=['request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4291b9,_0x52f3bd){var _0x1ab77a=function(_0x2b30bd){while(--_0x2b30bd){_0x4291b9['push'](_0x4291b9['shift']());}};_0x1ab77a(++_0x52f3bd);}(_0xc3b1,0x158));var _0x1c3b=function(_0x279b83,_0x1eeb64){_0x279b83=_0x279b83-0x0;var _0x3696be=_0xc3b1[_0x279b83];return _0x3696be;};'use strict';var _=require(_0x1c3b('0x0'));var util=require(_0x1c3b('0x1'));var logger=require(_0x1c3b('0x2'))(_0x1c3b('0x3'));var moment=require(_0x1c3b('0x4'));var BPromise=require(_0x1c3b('0x5'));var rp=require(_0x1c3b('0x6'));var fs=require('fs');var path=require(_0x1c3b('0x7'));var rimraf=require('rimraf');var config=require(_0x1c3b('0x8'));var attributes=require(_0x1c3b('0x9'));module[_0x1c3b('0xa')]=function(_0x83c234,_0x1ba6b){return _0x83c234[_0x1c3b('0xb')]('ChatTransferReport',attributes,{'tableName':_0x1c3b('0xc'),'paranoid':![],'indexes':[{'name':_0x1c3b('0xd'),'fields':[_0x1c3b('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc83=['bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment'];(function(_0x44a72f,_0x7de5b3){var _0x56ff98=function(_0x398574){while(--_0x398574){_0x44a72f['push'](_0x44a72f['shift']());}};_0x56ff98(++_0x7de5b3);}(_0xcc83,0x1d8));var _0x3cc8=function(_0x69936b,_0x98c9f2){_0x69936b=_0x69936b-0x0;var _0x5c91c9=_0xcc83[_0x69936b];return _0x5c91c9;};'use strict';var _=require(_0x3cc8('0x0'));var util=require(_0x3cc8('0x1'));var logger=require('../../config/logger')(_0x3cc8('0x2'));var moment=require(_0x3cc8('0x3'));var BPromise=require(_0x3cc8('0x4'));var rp=require(_0x3cc8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cc8('0x6'));var config=require(_0x3cc8('0x7'));var attributes=require(_0x3cc8('0x8'));module[_0x3cc8('0x9')]=function(_0x35979d,_0x442fd1){return _0x35979d[_0x3cc8('0xa')](_0x3cc8('0xb'),attributes,{'tableName':_0x3cc8('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3cc8('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index d00581b..dd17ffc 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 _0x691c=['rpc','../../config/environment','jayson/promise','client','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x691c,0xc3));var _0xc691=function(_0x79ef34,_0x42d1a1){_0x79ef34=_0x79ef34-0x0;var _0x43d708=_0x691c[_0x79ef34];return _0x43d708;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc691('0x0'));var BPromise=require(_0xc691('0x1'));var rs=require(_0xc691('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc691('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc691('0x4'))(_0xc691('0x5'));var config=require(_0xc691('0x6'));var jayson=require(_0xc691('0x7'));var client=jayson[_0xc691('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e413,_0x209ba9,_0x2bf1b7){return new BPromise(function(_0x1e119e,_0x3f0a25){return client['request'](_0x39e413,_0x2bf1b7)[_0xc691('0x9')](function(_0x359ba9){logger['info'](_0xc691('0xa'),_0x209ba9,'request\x20sent');logger[_0xc691('0xb')](_0xc691('0xc'),_0x209ba9,_0xc691('0xd'),JSON['stringify'](_0x359ba9));if(_0x359ba9[_0xc691('0xe')]){if(_0x359ba9[_0xc691('0xe')][_0xc691('0xf')]===0x1f4){logger[_0xc691('0xe')](_0xc691('0xa'),_0x209ba9,_0x359ba9[_0xc691('0xe')][_0xc691('0x10')]);return _0x3f0a25(_0x359ba9[_0xc691('0xe')]['message']);}logger[_0xc691('0xe')](_0xc691('0xa'),_0x209ba9,_0x359ba9[_0xc691('0xe')][_0xc691('0x10')]);return _0x1e119e(_0x359ba9['error']['message']);}else{logger[_0xc691('0x11')](_0xc691('0xa'),_0x209ba9,'request\x20sent');_0x1e119e(_0x359ba9[_0xc691('0x12')]['message']);}})[_0xc691('0x13')](function(_0x5adf80){logger[_0xc691('0xe')](_0xc691('0xa'),_0x209ba9,_0x5adf80);_0x3f0a25(_0x5adf80);});});}
\ No newline at end of file
+var _0x694d=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','bluebird','randomstring'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x694d,0xba));var _0xd694=function(_0x92a846,_0x45ee42){_0x92a846=_0x92a846-0x0;var _0x1d39cb=_0x694d[_0x92a846];return _0x1d39cb;};'use strict';var _=require('lodash');var util=require(_0xd694('0x0'));var moment=require('moment');var BPromise=require(_0xd694('0x1'));var rs=require(_0xd694('0x2'));var fs=require('fs');var Redis=require(_0xd694('0x3'));var db=require(_0xd694('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd694('0x5'))('rpc');var config=require(_0xd694('0x6'));var jayson=require(_0xd694('0x7'));var client=jayson[_0xd694('0x8')][_0xd694('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x272a87,_0x40f131,_0x54766a){return new BPromise(function(_0x350992,_0x2346af){return client[_0xd694('0xa')](_0x272a87,_0x54766a)['then'](function(_0x1a7215){logger['info'](_0xd694('0xb'),_0x40f131,_0xd694('0xc'));logger[_0xd694('0xd')](_0xd694('0xe'),_0x40f131,_0xd694('0xc'),JSON['stringify'](_0x1a7215));if(_0x1a7215[_0xd694('0xf')]){if(_0x1a7215[_0xd694('0xf')][_0xd694('0x10')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x40f131,_0x1a7215[_0xd694('0xf')][_0xd694('0x11')]);return _0x2346af(_0x1a7215[_0xd694('0xf')]['message']);}logger[_0xd694('0xf')](_0xd694('0xb'),_0x40f131,_0x1a7215[_0xd694('0xf')][_0xd694('0x11')]);return _0x350992(_0x1a7215[_0xd694('0xf')][_0xd694('0x11')]);}else{logger[_0xd694('0x12')](_0xd694('0xb'),_0x40f131,_0xd694('0xc'));_0x350992(_0x1a7215[_0xd694('0x13')]['message']);}})[_0xd694('0x14')](function(_0x2db9a0){logger[_0xd694('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x40f131,_0x2db9a0);_0x2346af(_0x2db9a0);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 0b0d196..634f5f4 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 _0x3e53=['/describe','describe','/:id','post','create','put','update','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0x3e53,0xd4));var _0x33e5=function(_0x1e1c0d,_0x419274){_0x1e1c0d=_0x1e1c0d-0x0;var _0x34c723=_0x3e53[_0x1e1c0d];return _0x34c723;};'use strict';var multer=require(_0x33e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x33e5('0x1'));var express=require(_0x33e5('0x2'));var router=express['Router']();var fs_extra=require(_0x33e5('0x3'));var auth=require(_0x33e5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x33e5('0x5'));var controller=require('./chatTransferReport.controller');router[_0x33e5('0x6')]('/',auth[_0x33e5('0x7')](),controller[_0x33e5('0x8')]);router[_0x33e5('0x6')](_0x33e5('0x9'),auth[_0x33e5('0x7')](),controller[_0x33e5('0xa')]);router[_0x33e5('0x6')](_0x33e5('0xb'),auth[_0x33e5('0x7')](),controller['show']);router[_0x33e5('0xc')]('/',auth[_0x33e5('0x7')](),controller[_0x33e5('0xd')]);router[_0x33e5('0xe')](_0x33e5('0xb'),auth[_0x33e5('0x7')](),controller[_0x33e5('0xf')]);router['delete'](_0x33e5('0xb'),auth[_0x33e5('0x7')](),controller['destroy']);module[_0x33e5('0x10')]=router;
\ No newline at end of file
+var _0xf6c7=['../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x19acb3,_0x561ce3){var _0x5cc4de=function(_0x33e6a9){while(--_0x33e6a9){_0x19acb3['push'](_0x19acb3['shift']());}};_0x5cc4de(++_0x561ce3);}(_0xf6c7,0xea));var _0x7f6c=function(_0x5b3233,_0x9b356e){_0x5b3233=_0x5b3233-0x0;var _0x541848=_0xf6c7[_0x5b3233];return _0x541848;};'use strict';var multer=require(_0x7f6c('0x0'));var util=require(_0x7f6c('0x1'));var path=require(_0x7f6c('0x2'));var timeout=require(_0x7f6c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7f6c('0x4'));var interaction=require(_0x7f6c('0x5'));var config=require(_0x7f6c('0x6'));var controller=require(_0x7f6c('0x7'));router['get']('/',auth[_0x7f6c('0x8')](),controller[_0x7f6c('0x9')]);router[_0x7f6c('0xa')](_0x7f6c('0xb'),auth[_0x7f6c('0x8')](),controller['describe']);router['get'](_0x7f6c('0xc'),auth[_0x7f6c('0x8')](),controller[_0x7f6c('0xd')]);router[_0x7f6c('0xe')]('/',auth[_0x7f6c('0x8')](),controller[_0x7f6c('0xf')]);router[_0x7f6c('0x10')](_0x7f6c('0xc'),auth[_0x7f6c('0x8')](),controller[_0x7f6c('0x11')]);router['delete'](_0x7f6c('0xc'),auth[_0x7f6c('0x8')](),controller[_0x7f6c('0x12')]);module[_0x7f6c('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 0db3c47..04549b4 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 _0x22fb=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','TEXT','stringify','input','name','text','getDataValue','parse','setDataValue','textarea','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.','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','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address'];(function(_0x21dfb7,_0x35ece2){var _0x49303c=function(_0xb99328){while(--_0xb99328){_0x21dfb7['push'](_0x21dfb7['shift']());}};_0x49303c(++_0x35ece2);}(_0x22fb,0x192));var _0xb22f=function(_0x367fa3,_0x515fb1){_0x367fa3=_0x367fa3-0x0;var _0x49b581=_0x22fb[_0x367fa3];return _0x49b581;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb22f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'unique':_0xb22f('0x2')},'description':{'type':Sequelize[_0xb22f('0x1')]},'mapKey':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x3')},'key':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x4')},'customerAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb22f('0x1')]},'animation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xc')},'header_offline':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xd')},'download_transcript':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xf')},'noteTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x10')},'closingMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'skipMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x12')},'ratingType':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0x13'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'variable':null,'config':{'placeholder':_0xb22f('0x17'),'type':_0xb22f('0x18'),'required':!![]},'props':{'title':_0xb22f('0x17'),'helpText':''}},{'type':_0xb22f('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb22f('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb22f('0x19')]('onlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')]('onlineForm')):{};},'set':function(_0x4687f2){return this[_0xb22f('0x1b')]('onlineForm',JSON[_0xb22f('0x15')](_0x4687f2));}},'offlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'props':{'title':_0xb22f('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb22f('0x3'),'type':_0xb22f('0x3')},'variable':null},{'type':_0xb22f('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb22f('0x19')]('offlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')](_0xb22f('0x1d'))):{};},'set':function(_0x413575){return this[_0xb22f('0x1b')]('offlineForm',JSON['stringify'](_0x413575));}},'token':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return rs[_0xb22f('0x1e')]();}},'autoclose':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb22f('0x1')]},'forwardOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x1f')},'waitingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x22')},'skipUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'sendUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return _0xb22f('0x23');}},'notificationSound':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb22f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x25')},'verticalAlignment':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xb22f('0x1')]},'customerAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb22f('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb22f('0x7')],'comment':_0xb22f('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb22f('0x29'),'set':function(_0x2d265c){if(!_0x2d265c)this[_0xb22f('0x1b')]('mandatoryDispositionPauseId',null);this[_0xb22f('0x1b')](_0xb22f('0x2a'),_0x2d265c);}},'vidaooEscalation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb22f('0x1')]},'vidaooTopic':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x2b')},'vidaooNote':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return _0xb22f('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xf4eb=['squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM','star','thumb','TEXT','stringify','input','text','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN'];(function(_0x19db65,_0x542112){var _0x5ce1fe=function(_0xe9496b){while(--_0xe9496b){_0x19db65['push'](_0x19db65['shift']());}};_0x5ce1fe(++_0x542112);}(_0xf4eb,0xec));var _0xbf4e=function(_0x409039,_0x49e370){_0x409039=_0x409039-0x0;var _0x340755=_0xf4eb[_0x409039];return _0x340755;};'use strict';var Sequelize=require(_0xbf4e('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbf4e('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x2')},'mapKeyOffline':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2')},'key':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x4')},'customerAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbf4e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbf4e('0x3')]},'animation':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xbf4e('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xc')},'download_transcript':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xf')},'noteTitle':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x12')},'conditionAgreement':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x13')},'ratingType':{'type':Sequelize[_0xbf4e('0x14')](_0xbf4e('0x15'),_0xbf4e('0x16')),'defaultValue':_0xbf4e('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':function(){return JSON[_0xbf4e('0x18')]({'items':[{'type':_0xbf4e('0x19'),'variable':null,'config':{'placeholder':'name','type':_0xbf4e('0x1a'),'required':!![]},'props':{'title':_0xbf4e('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0xbf4e('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xbf4e('0x2'),'type':_0xbf4e('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbf4e('0x1c')](_0xbf4e('0x1d'))?JSON['parse'](this[_0xbf4e('0x1c')](_0xbf4e('0x1d'))):{};},'set':function(_0x3d6863){return this['setDataValue'](_0xbf4e('0x1d'),JSON['stringify'](_0x3d6863));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbf4e('0x18')]({'items':[{'type':'input','props':{'title':_0xbf4e('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xbf4e('0x2'),'type':_0xbf4e('0x2')},'variable':null},{'type':_0xbf4e('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':_0xbf4e('0x1f'),'helpText':_0xbf4e('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xbf4e('0x1c')]('offlineForm')?JSON[_0xbf4e('0x21')](this['getDataValue'](_0xbf4e('0x22'))):{};},'set':function(_0x1421e1){return this[_0xbf4e('0x23')]('offlineForm',JSON[_0xbf4e('0x18')](_0x1421e1));}},'token':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':function(){return rs[_0xbf4e('0x24')]();}},'autoclose':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbf4e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x25')},'waitingMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x27')},'enableCustomerAttachment':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbf4e('0x3')]},'notificationTemplate':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':function(){return _0xbf4e('0x28');}},'notificationSound':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x29')},'verticalAlignment':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2a')},'messagesAlignment':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2b')},'defaultTitle':{'type':Sequelize[_0xbf4e('0x3')]},'customerAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2d')},'systemAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbf4e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![],'comment':_0xbf4e('0x2e'),'set':function(_0x3aa308){if(!_0x3aa308)this[_0xbf4e('0x23')]('mandatoryDispositionPauseId',null);this[_0xbf4e('0x23')](_0xbf4e('0x2f'),_0x3aa308);}},'vidaooEscalation':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbf4e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x30')},'vidaooNote':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 343c0a1..1bc20bc 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 _0x8664=['isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmContact','Contacts','DESC','ChatApplication','Applications','List','account','list','orderBy','applications','priority','defaults','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','autoclose','push','close','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','attachments','basename','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','MailAccountId','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','readFileSync','origin','remote','remoteAddress','replace','alignment','textColor','textButtonColor','color_button','hideWhenOffline','addApplications','sequelize','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','url','redis','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatWebsites','stack','name','Pause','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','include','ChatWebsite','findAll','rows','catch','show','params','includeAll','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','pick','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x8664,0xb6));var _0x4866=function(_0x3b7998,_0x30087c){_0x3b7998=_0x3b7998-0x0;var _0x46f5f3=_0x8664[_0x3b7998];return _0x46f5f3;};'use strict';var BPromise=require(_0x4866('0x0'));var Mustache=require(_0x4866('0x1'));var util=require('util');var path=require(_0x4866('0x2'));var ejs=require(_0x4866('0x3'));var fs=require('fs');var fs_extra=require(_0x4866('0x4'));var _=require('lodash');var querystring=require(_0x4866('0x5'));var Redis=require(_0x4866('0x6'));var qs=require(_0x4866('0x7'));var logger=require('../../config/logger')(_0x4866('0x8'));var config=require(_0x4866('0x9'));var url=require(_0x4866('0xa'));var db=require('../../mysqldb')['db'];config[_0x4866('0xb')]=_['defaults'](config[_0x4866('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4866('0xb')]));require('./chatWebsite.socket')[_0x4866('0xc')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x4866('0xd')][_0x4866('0xe')]({'port':0x232c});var client9002=jayson['client'][_0x4866('0xe')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x4866('0xd')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4d005c,_0x48077b,_0x3c811e,_0x1a3403){return new BPromise(function(_0x86b59d,_0x6a84a9){var _0x18ea2c=_0x1a3403||client;return _0x18ea2c[_0x4866('0xf')](_0x4d005c,_0x3c811e)['then'](function(_0x5889db){logger[_0x4866('0x10')](_0x4866('0x11'),_0x48077b,_0x4866('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x48077b,_0x4866('0x12'),JSON[_0x4866('0x13')](_0x5889db));if(_0x5889db[_0x4866('0x14')]){if(_0x5889db[_0x4866('0x14')][_0x4866('0x15')]===0x1f4){logger[_0x4866('0x14')](_0x4866('0x11'),_0x48077b,_0x5889db['error'][_0x4866('0x16')]);return _0x6a84a9(_0x5889db[_0x4866('0x14')]['message']);}logger[_0x4866('0x14')](_0x4866('0x11'),_0x48077b,_0x5889db[_0x4866('0x14')][_0x4866('0x16')]);return _0x86b59d(_0x5889db['error'][_0x4866('0x16')]);}else{logger[_0x4866('0x10')](_0x4866('0x11'),_0x48077b,_0x4866('0x12'));_0x86b59d(_0x5889db[_0x4866('0x17')][_0x4866('0x16')]);}})['catch'](function(_0x3368a6){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x48077b,_0x3368a6);_0x6a84a9(_0x3368a6);});});}function respondWithStatusCode(_0x5649e1,_0x2110d4){_0x2110d4=_0x2110d4||0xcc;return function(_0x67f148){if(_0x67f148){return _0x5649e1[_0x4866('0x18')](_0x2110d4);}return _0x5649e1['status'](_0x2110d4)[_0x4866('0x19')]();};}function respondWithResult(_0x1d4527,_0x15c9cf){_0x15c9cf=_0x15c9cf||0xc8;return function(_0x4db85e){if(_0x4db85e){return _0x1d4527[_0x4866('0x1a')](_0x15c9cf)[_0x4866('0x1b')](_0x4db85e);}};}function respondWithFilteredResult(_0x49c10a,_0x399be9){return function(_0x4b60af){if(_0x4b60af){var _0x2d6800=typeof _0x399be9[_0x4866('0x1c')]===_0x4866('0x1d')&&typeof _0x399be9[_0x4866('0x1e')]===_0x4866('0x1d');var _0x54bf30=_0x4b60af[_0x4866('0x1f')];var _0x185576=_0x2d6800?0x0:_0x399be9[_0x4866('0x1c')];var _0x4b37cf=_0x2d6800?_0x4b60af[_0x4866('0x1f')]:_0x399be9[_0x4866('0x1c')]+_0x399be9['limit'];var _0x3c53d8;if(_0x4b37cf>=_0x54bf30){_0x4b37cf=_0x54bf30;_0x3c53d8=0xc8;}else{_0x3c53d8=0xce;}_0x49c10a[_0x4866('0x1a')](_0x3c53d8);return _0x49c10a[_0x4866('0x20')](_0x4866('0x21'),_0x185576+'-'+_0x4b37cf+'/'+_0x54bf30)[_0x4866('0x1b')](_0x4b60af);}return null;};}function saveUpdates(_0x4060fe){return function(_0x324c4d){if(_0x324c4d){return _0x324c4d[_0x4866('0x22')](_0x4060fe)[_0x4866('0x23')](function(_0x14e0cb){return _0x14e0cb;});}return null;};}function removeEntity(_0x3999e4){return function(_0x50d365){if(_0x50d365){return _0x50d365[_0x4866('0x24')]()[_0x4866('0x23')](function(){var _0x5318ec=_0x50d365[_0x4866('0x25')]({'plain':!![]});var _0x18ef43=_0x4866('0x26');return db['UserProfileResource'][_0x4866('0x24')]({'where':{'type':_0x18ef43,'resourceId':_0x5318ec['id']}})[_0x4866('0x23')](function(){return _0x50d365;});})[_0x4866('0x23')](function(){_0x3999e4[_0x4866('0x1a')](0xcc)[_0x4866('0x19')]();});}};}function handleEntityNotFound(_0x2e96f2){return function(_0x41511d){if(!_0x41511d){_0x2e96f2[_0x4866('0x18')](0x194);}return _0x41511d;};}function handleError(_0x1ec5b8,_0x1491e9){_0x1491e9=_0x1491e9||0x1f4;return function(_0x44d2b3){logger[_0x4866('0x14')](_0x44d2b3[_0x4866('0x27')]);if(_0x44d2b3[_0x4866('0x28')]){delete _0x44d2b3['name'];}_0x1ec5b8[_0x4866('0x1a')](_0x1491e9)['send'](_0x44d2b3);};}exports['index']=function(_0x249416,_0x2a30de){var _0x4aee5d={'include':[{'model':db[_0x4866('0x29')],'as':'mandatoryDispositionPause'}]},_0x27cbd1={},_0x391d2b={'count':0x0,'rows':[]};var _0x1dd600=_['map'](db['ChatWebsite'][_0x4866('0x2a')],function(_0xa2ea4f){return{'name':_0xa2ea4f[_0x4866('0x2b')],'type':_0xa2ea4f[_0x4866('0x2c')]['key']};});_0x27cbd1[_0x4866('0x2d')]=_[_0x4866('0x2e')](_0x1dd600,_0x4866('0x28'));_0x27cbd1[_0x4866('0x2f')]=_[_0x4866('0x30')](_0x249416[_0x4866('0x2f')]);_0x27cbd1[_0x4866('0x31')]=_[_0x4866('0x32')](_0x27cbd1[_0x4866('0x2d')],_0x27cbd1[_0x4866('0x2f')]);_0x4aee5d[_0x4866('0x33')]=_[_0x4866('0x32')](_0x27cbd1[_0x4866('0x2d')],qs[_0x4866('0x34')](_0x249416[_0x4866('0x2f')][_0x4866('0x34')]));_0x4aee5d[_0x4866('0x33')]=_0x4aee5d[_0x4866('0x33')][_0x4866('0x35')]?_0x4aee5d[_0x4866('0x33')]:_0x27cbd1[_0x4866('0x2d')];if(!_0x249416['query'][_0x4866('0x36')]('nolimit')){_0x4aee5d[_0x4866('0x1e')]=qs[_0x4866('0x1e')](_0x249416[_0x4866('0x2f')][_0x4866('0x1e')]);_0x4aee5d[_0x4866('0x1c')]=qs[_0x4866('0x1c')](_0x249416[_0x4866('0x2f')][_0x4866('0x1c')]);}_0x4aee5d[_0x4866('0x37')]=qs[_0x4866('0x38')](_0x249416[_0x4866('0x2f')]['sort']);_0x4aee5d['where']=qs['filters'](_['pick'](_0x249416[_0x4866('0x2f')],_0x27cbd1[_0x4866('0x31')]),_0x1dd600);if(_0x249416[_0x4866('0x2f')][_0x4866('0x39')]){_0x4aee5d[_0x4866('0x3a')]=_[_0x4866('0x3b')](_0x4aee5d[_0x4866('0x3a')],{'$or':_[_0x4866('0x2e')](_0x1dd600,function(_0x4aeaa0){if(_0x4aeaa0[_0x4866('0x2c')]!==_0x4866('0x3c')){var _0x48dbfd={};_0x48dbfd[_0x4aeaa0[_0x4866('0x28')]]={'$like':'%'+_0x249416[_0x4866('0x2f')][_0x4866('0x39')]+'%'};return _0x48dbfd;}})});}_0x4aee5d=_[_0x4866('0x3b')]({},_0x4aee5d,_0x249416[_0x4866('0x3d')]);var _0x1e0cce={'where':_0x4aee5d['where']};return db['ChatWebsite'][_0x4866('0x1f')](_0x1e0cce)[_0x4866('0x23')](function(_0x29df23){_0x391d2b[_0x4866('0x1f')]=_0x29df23;if(_0x249416[_0x4866('0x2f')]['includeAll']){_0x4aee5d[_0x4866('0x3e')]=[{'all':!![]}];}return db[_0x4866('0x3f')][_0x4866('0x40')](_0x4aee5d);})['then'](function(_0x1e7810){_0x391d2b[_0x4866('0x41')]=_0x1e7810;return _0x391d2b;})[_0x4866('0x23')](respondWithFilteredResult(_0x2a30de,_0x4aee5d))[_0x4866('0x42')](handleError(_0x2a30de,null));};exports[_0x4866('0x43')]=function(_0x24f9cd,_0x1219e0){var _0x1aaf24={'raw':![],'where':{'id':_0x24f9cd[_0x4866('0x44')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5e67c4={};_0x5e67c4[_0x4866('0x2d')]=_[_0x4866('0x30')](db[_0x4866('0x3f')][_0x4866('0x2a')]);_0x5e67c4['query']=_[_0x4866('0x30')](_0x24f9cd['query']);_0x5e67c4[_0x4866('0x31')]=_[_0x4866('0x32')](_0x5e67c4['model'],_0x5e67c4[_0x4866('0x2f')]);_0x1aaf24[_0x4866('0x33')]=_[_0x4866('0x32')](_0x5e67c4[_0x4866('0x2d')],qs[_0x4866('0x34')](_0x24f9cd[_0x4866('0x2f')][_0x4866('0x34')]));_0x1aaf24[_0x4866('0x33')]=_0x1aaf24[_0x4866('0x33')][_0x4866('0x35')]?_0x1aaf24[_0x4866('0x33')]:_0x5e67c4['model'];if(_0x24f9cd[_0x4866('0x2f')][_0x4866('0x45')]){_0x1aaf24[_0x4866('0x3e')]=[{'all':!![]}];}_0x1aaf24=_[_0x4866('0x3b')]({},_0x1aaf24,_0x24f9cd[_0x4866('0x3d')]);return db[_0x4866('0x3f')][_0x4866('0x46')](_0x1aaf24)[_0x4866('0x23')](handleEntityNotFound(_0x1219e0,null))[_0x4866('0x23')](respondWithResult(_0x1219e0,null))[_0x4866('0x42')](handleError(_0x1219e0,null));};exports[_0x4866('0x47')]=function(_0x4b8878,_0x50853b){return db['ChatWebsite'][_0x4866('0x47')](_0x4b8878['body'],{})[_0x4866('0x23')](function(_0x3940d9){var _0x51d6ec=_0x4b8878[_0x4866('0x48')][_0x4866('0x25')]({'plain':!![]});if(!_0x51d6ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51d6ec[_0x4866('0x49')]===_0x4866('0x48')){var _0x861972=_0x3940d9[_0x4866('0x25')]({'plain':!![]});var _0x276b95=_0x4866('0x26');return db['UserProfileSection'][_0x4866('0x46')]({'where':{'name':_0x276b95,'userProfileId':_0x51d6ec['userProfileId']},'raw':!![]})[_0x4866('0x23')](function(_0x4c2ef0){if(_0x4c2ef0&&_0x4c2ef0[_0x4866('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x861972['name'],'resourceId':_0x861972['id'],'type':_0x4c2ef0['name'],'sectionId':_0x4c2ef0['id']},{})['then'](function(){return _0x3940d9;});}else{return _0x3940d9;}})[_0x4866('0x42')](function(_0x472847){logger['error'](_0x4866('0x4b'),_0x472847);throw _0x472847;});}return _0x3940d9;})[_0x4866('0x23')](respondWithResult(_0x50853b,0xc9))['catch'](handleError(_0x50853b,null));};exports['update']=function(_0x499a92,_0x367684){if(_0x499a92[_0x4866('0x4c')]['id']){delete _0x499a92['body']['id'];}return db[_0x4866('0x3f')]['find']({'where':{'id':_0x499a92['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x4866('0x23')](handleEntityNotFound(_0x367684,null))[_0x4866('0x23')](saveUpdates(_0x499a92['body'],null))[_0x4866('0x23')](respondWithResult(_0x367684,null))[_0x4866('0x42')](handleError(_0x367684,null));};exports[_0x4866('0x24')]=function(_0x3562fe,_0x318478){return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x3562fe['params']['id']}})['then'](handleEntityNotFound(_0x318478,null))[_0x4866('0x23')](removeEntity(_0x318478,null))[_0x4866('0x42')](handleError(_0x318478,null));};exports[_0x4866('0x4d')]=function(_0x233fd6,_0x892bb2){return db[_0x4866('0x3f')][_0x4866('0x4d')]()['then'](respondWithResult(_0x892bb2,null))[_0x4866('0x42')](handleError(_0x892bb2,null));};exports[_0x4866('0x4e')]=function(_0x4c12c5,_0x583096){if(_0x4c12c5['body']['id']){delete _0x4c12c5[_0x4866('0x4c')]['id'];}return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x4c12c5[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x583096,null))[_0x4866('0x23')](function(_0x1c2983){if(_0x1c2983){_0x4c12c5[_0x4866('0x4c')]['ChatWebsiteId']=_0x1c2983['id'];return db[_0x4866('0x4f')]['create'](_0x4c12c5[_0x4866('0x4c')]);}})['then'](respondWithResult(_0x583096,null))[_0x4866('0x42')](handleError(_0x583096,null));};exports[_0x4866('0x50')]=function(_0x453429,_0x1d58de){var _0x133a86={'raw':![],'where':{}};var _0x975267={};var _0x3fe43c={'count':0x0,'rows':[]};return db[_0x4866('0x3f')][_0x4866('0x51')]({'where':{'id':_0x453429[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x1d58de,null))[_0x4866('0x23')](function(_0x4b8e68){if(_0x4b8e68){_0x975267['model']=_[_0x4866('0x30')](db[_0x4866('0x4f')]['rawAttributes']);_0x975267['query']=_['keys'](_0x453429[_0x4866('0x2f')]);_0x975267['filters']=_[_0x4866('0x32')](_0x975267['model'],_0x975267[_0x4866('0x2f')]);_0x133a86[_0x4866('0x33')]=_[_0x4866('0x32')](_0x975267[_0x4866('0x2d')],qs[_0x4866('0x34')](_0x453429[_0x4866('0x2f')]['fields']));_0x133a86[_0x4866('0x33')]=_0x133a86[_0x4866('0x33')][_0x4866('0x35')]?_0x133a86[_0x4866('0x33')]:_0x975267[_0x4866('0x2d')];if(!_0x453429[_0x4866('0x2f')][_0x4866('0x36')]('nolimit')){_0x133a86[_0x4866('0x1e')]=qs[_0x4866('0x1e')](_0x453429[_0x4866('0x2f')]['limit']);_0x133a86['offset']=qs[_0x4866('0x1c')](_0x453429[_0x4866('0x2f')][_0x4866('0x1c')]);}_0x133a86[_0x4866('0x37')]=qs[_0x4866('0x38')](_0x453429[_0x4866('0x2f')]['sort']);_0x133a86[_0x4866('0x3a')]=qs[_0x4866('0x31')](_[_0x4866('0x52')](_0x453429[_0x4866('0x2f')],_0x975267[_0x4866('0x31')]));_0x133a86[_0x4866('0x3a')][_0x4866('0x53')]=_0x4b8e68['id'];if(_0x453429[_0x4866('0x2f')][_0x4866('0x39')]){_0x133a86[_0x4866('0x3a')]=_[_0x4866('0x3b')](_0x133a86[_0x4866('0x3a')],{'$or':_[_0x4866('0x2e')](_0x133a86['attributes'],function(_0x4d508d){var _0xbc6a63={};_0xbc6a63[_0x4d508d]={'$like':'%'+_0x453429['query'][_0x4866('0x39')]+'%'};return _0xbc6a63;})});}_0x133a86=_[_0x4866('0x3b')]({},_0x133a86,_0x453429[_0x4866('0x3d')]);return db[_0x4866('0x4f')]['count']({'where':_0x133a86[_0x4866('0x3a')]})[_0x4866('0x23')](function(_0x433859){_0x3fe43c[_0x4866('0x1f')]=_0x433859;if(_0x453429[_0x4866('0x2f')][_0x4866('0x45')]){_0x133a86[_0x4866('0x3e')]=[{'all':!![]}];}return db[_0x4866('0x4f')]['findAll'](_0x133a86);})[_0x4866('0x23')](function(_0x3ae8d5){_0x3fe43c[_0x4866('0x41')]=_0x3ae8d5;return _0x3fe43c;});}})['then'](respondWithFilteredResult(_0x1d58de,_0x133a86))[_0x4866('0x42')](handleError(_0x1d58de,null));};exports['removeDispositions']=function(_0x7431cd,_0x35f907){return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x7431cd['params']['id']}})['then'](handleEntityNotFound(_0x35f907,null))[_0x4866('0x23')](function(_0x4ed755){if(_0x4ed755){return _0x4ed755[_0x4866('0x54')](_0x7431cd['query'][_0x4866('0x55')]);}})['then'](respondWithStatusCode(_0x35f907,null))[_0x4866('0x42')](handleError(_0x35f907,null));};exports[_0x4866('0x56')]=function(_0x4d2d05,_0x46f3db){if(_0x4d2d05[_0x4866('0x4c')]['id']){delete _0x4d2d05[_0x4866('0x4c')]['id'];}return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x4d2d05[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x46f3db,null))[_0x4866('0x23')](function(_0x270c7f){if(_0x270c7f){_0x4d2d05['body']['ChatWebsiteId']=_0x270c7f['id'];return db[_0x4866('0x57')]['create'](_0x4d2d05[_0x4866('0x4c')]);}})[_0x4866('0x23')](respondWithResult(_0x46f3db,null))['catch'](handleError(_0x46f3db,null));};exports[_0x4866('0x58')]=function(_0x44a8bf,_0x316f7e){var _0x14b8c7={'raw':![],'where':{}};var _0x3ca0c7={};var _0x41cff9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4866('0x51')]({'where':{'id':_0x44a8bf[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x316f7e,null))[_0x4866('0x23')](function(_0x12e652){if(_0x12e652){_0x3ca0c7[_0x4866('0x2d')]=_[_0x4866('0x30')](db[_0x4866('0x57')][_0x4866('0x2a')]);_0x3ca0c7['query']=_[_0x4866('0x30')](_0x44a8bf['query']);_0x3ca0c7[_0x4866('0x31')]=_[_0x4866('0x32')](_0x3ca0c7['model'],_0x3ca0c7[_0x4866('0x2f')]);_0x14b8c7[_0x4866('0x33')]=_[_0x4866('0x32')](_0x3ca0c7['model'],qs[_0x4866('0x34')](_0x44a8bf[_0x4866('0x2f')][_0x4866('0x34')]));_0x14b8c7['attributes']=_0x14b8c7[_0x4866('0x33')]['length']?_0x14b8c7['attributes']:_0x3ca0c7[_0x4866('0x2d')];if(!_0x44a8bf[_0x4866('0x2f')][_0x4866('0x36')](_0x4866('0x59'))){_0x14b8c7[_0x4866('0x1e')]=qs[_0x4866('0x1e')](_0x44a8bf[_0x4866('0x2f')][_0x4866('0x1e')]);_0x14b8c7[_0x4866('0x1c')]=qs[_0x4866('0x1c')](_0x44a8bf[_0x4866('0x2f')][_0x4866('0x1c')]);}_0x14b8c7[_0x4866('0x37')]=qs['sort'](_0x44a8bf[_0x4866('0x2f')][_0x4866('0x38')]);_0x14b8c7['where']=qs[_0x4866('0x31')](_[_0x4866('0x52')](_0x44a8bf[_0x4866('0x2f')],_0x3ca0c7[_0x4866('0x31')]));_0x14b8c7[_0x4866('0x3a')][_0x4866('0x53')]=_0x12e652['id'];if(_0x44a8bf['query'][_0x4866('0x39')]){_0x14b8c7[_0x4866('0x3a')]=_[_0x4866('0x3b')](_0x14b8c7['where'],{'$or':_[_0x4866('0x2e')](_0x14b8c7[_0x4866('0x33')],function(_0x2afaab){var _0x2344a8={};_0x2344a8[_0x2afaab]={'$like':'%'+_0x44a8bf[_0x4866('0x2f')][_0x4866('0x39')]+'%'};return _0x2344a8;})});}_0x14b8c7=_[_0x4866('0x3b')]({},_0x14b8c7,_0x44a8bf['options']);return db[_0x4866('0x57')]['count']({'where':_0x14b8c7[_0x4866('0x3a')]})[_0x4866('0x23')](function(_0x538c41){_0x41cff9[_0x4866('0x1f')]=_0x538c41;if(_0x44a8bf[_0x4866('0x2f')][_0x4866('0x45')]){_0x14b8c7[_0x4866('0x3e')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x14b8c7);})['then'](function(_0x5759d1){_0x41cff9['rows']=_0x5759d1;return _0x41cff9;});}})[_0x4866('0x23')](respondWithFilteredResult(_0x316f7e,_0x14b8c7))[_0x4866('0x42')](handleError(_0x316f7e,null));};exports[_0x4866('0x5a')]=function(_0x3a2e21,_0x2f9058){return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x3a2e21['params']['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x2f9058,null))[_0x4866('0x23')](function(_0x7e8378){if(_0x7e8378){return _0x7e8378[_0x4866('0x5a')](_0x3a2e21[_0x4866('0x2f')][_0x4866('0x55')]);}})[_0x4866('0x23')](respondWithStatusCode(_0x2f9058,null))[_0x4866('0x42')](handleError(_0x2f9058,null));};exports[_0x4866('0x5b')]=function(_0x21ab1a,_0x407ee2){_0x21ab1a[_0x4866('0x4c')][_0x4866('0x5c')]=_0x21ab1a[_0x4866('0x5d')][_0x4866('0x5e')];return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x21ab1a['params']['id']}})['then'](handleEntityNotFound(_0x407ee2,null))[_0x4866('0x23')](saveUpdates(_0x21ab1a[_0x4866('0x4c')],null))[_0x4866('0x23')](respondWithResult(_0x407ee2,null))[_0x4866('0x42')](handleError(_0x407ee2,null));};exports['addAvatar']=function(_0x160667,_0x3096e1){_0x160667['body'][_0x4866('0x5f')]=_0x160667[_0x4866('0x5d')]['filename'];return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x160667[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x3096e1,null))[_0x4866('0x23')](saveUpdates(_0x160667['body'],null))[_0x4866('0x23')](respondWithResult(_0x3096e1,null))['catch'](handleError(_0x3096e1,null));};exports[_0x4866('0x60')]=function(_0x56c84e,_0x693922){_0x56c84e[_0x4866('0x4c')]['customerAvatar']=_0x56c84e[_0x4866('0x5d')]['filename'];return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x56c84e[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x693922,null))[_0x4866('0x23')](saveUpdates(_0x56c84e[_0x4866('0x4c')],null))[_0x4866('0x23')](respondWithResult(_0x693922,null))[_0x4866('0x42')](handleError(_0x693922,null));};exports['addSystemAvatar']=function(_0x3eb0d0,_0x49cb29){_0x3eb0d0[_0x4866('0x4c')][_0x4866('0x61')]=_0x3eb0d0[_0x4866('0x5d')][_0x4866('0x5e')];return db[_0x4866('0x3f')]['find']({'where':{'id':_0x3eb0d0['params']['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x49cb29,null))[_0x4866('0x23')](saveUpdates(_0x3eb0d0[_0x4866('0x4c')],null))[_0x4866('0x23')](respondWithResult(_0x49cb29,null))['catch'](handleError(_0x49cb29,null));};exports[_0x4866('0x62')]=function(_0xf4edfa,_0x1c0487){var _0x37ab49=path['join'](config[_0x4866('0x63')],'server/files/images/logos/default_logo.svg');var _0x8a2b2e={'where':{'id':_0xf4edfa[_0x4866('0x44')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1ada6f=![];return require(_0x4866('0x64'))[_0x4866('0x65')]()[_0x4866('0x23')](function(_0x590e03){if(_0x590e03){_0x1ada6f=_0x590e03[_0x4866('0x66')];}})['then'](function(){return db[_0x4866('0x3f')][_0x4866('0x46')](_0x8a2b2e);})[_0x4866('0x23')](handleEntityNotFound(_0x1c0487,null))[_0x4866('0x23')](function(_0x3708a0){if(_0x3708a0){if(!_[_0x4866('0x67')](_0x3708a0['sitepic'])){if(fs[_0x4866('0x68')](path['join'](config[_0x4866('0x63')],'server/files/images/logos/',_0x3708a0[_0x4866('0x5c')]))&&_0x1ada6f){_0x37ab49=path[_0x4866('0x69')](config['root'],_0x4866('0x6a'),_0x3708a0[_0x4866('0x5c')]);}}return _0x1c0487[_0x4866('0x6b')](_0x37ab49);}})[_0x4866('0x42')](handleError(_0x1c0487,null));};exports[_0x4866('0x6c')]=function(_0x184295,_0x44ebdd){var _0xc0a499=path[_0x4866('0x69')](config[_0x4866('0x63')],_0x4866('0x6d'));var _0x44af44={'where':{'id':_0x184295[_0x4866('0x44')]['id']},'attributes':['id',_0x4866('0x5f')],'raw':!![]};return db[_0x4866('0x3f')]['find'](_0x44af44)['then'](handleEntityNotFound(_0x44ebdd,null))[_0x4866('0x23')](function(_0x1b4500){if(_0x1b4500){if(!_['isNil'](_0x1b4500[_0x4866('0x5f')])){if(fs[_0x4866('0x68')](path[_0x4866('0x69')](config[_0x4866('0x63')],_0x4866('0x6e'),_0x1b4500[_0x4866('0x5f')]))){_0xc0a499=path['join'](config['root'],_0x4866('0x6e'),_0x1b4500[_0x4866('0x5f')]);}}return _0x44ebdd['download'](_0xc0a499);}})[_0x4866('0x42')](handleError(_0x44ebdd,null));};exports['getCustomerAvatar']=function(_0x41f6e6,_0x4b7042){var _0xd1d3cf=path[_0x4866('0x69')](config['root'],_0x4866('0x6f'));var _0x503e7a={'where':{'id':_0x41f6e6['params']['id']},'attributes':['id',_0x4866('0x70'),_0x4866('0x71')],'raw':!![]};return db[_0x4866('0x3f')][_0x4866('0x46')](_0x503e7a)['then'](handleEntityNotFound(_0x4b7042,null))[_0x4866('0x23')](function(_0x2606ef){if(_0x2606ef){if(!_[_0x4866('0x67')](_0x2606ef[_0x4866('0x70')])){if(fs[_0x4866('0x68')](path[_0x4866('0x69')](config['root'],_0x4866('0x6e'),_0x2606ef[_0x4866('0x70')]))&&_0x2606ef['showCustomerAvatar']){_0xd1d3cf=path[_0x4866('0x69')](config[_0x4866('0x63')],_0x4866('0x6e'),_0x2606ef['customerAvatar']);}}return _0x4b7042[_0x4866('0x6b')](_0xd1d3cf);}})[_0x4866('0x42')](handleError(_0x4b7042,null));};exports[_0x4866('0x72')]=function(_0x2bb5f6,_0x23f0f8){var _0x1bd267=path[_0x4866('0x69')](config[_0x4866('0x63')],_0x4866('0x73'));var _0x2fa9eb={'where':{'id':_0x2bb5f6['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x4866('0x3f')]['find'](_0x2fa9eb)[_0x4866('0x23')](handleEntityNotFound(_0x23f0f8,null))[_0x4866('0x23')](function(_0x316215){if(_0x316215){if(!_[_0x4866('0x67')](_0x316215['systemAvatar'])){if(fs[_0x4866('0x68')](path['join'](config[_0x4866('0x63')],_0x4866('0x6e'),_0x316215[_0x4866('0x61')]))){_0x1bd267=path[_0x4866('0x69')](config[_0x4866('0x63')],_0x4866('0x6e'),_0x316215[_0x4866('0x61')]);}}return _0x23f0f8[_0x4866('0x6b')](_0x1bd267);}})[_0x4866('0x42')](handleError(_0x23f0f8,null));};exports[_0x4866('0x74')]=function(_0x2434dd,_0x4febf7){var _0x66645b=require(_0x4866('0x75'));var _0x55e412=new _0x66645b();var _0x3d20e4=_0x55e412[_0x4866('0x76')](_0x2434dd[_0x4866('0x77')][_0x4866('0x78')])[_0x4866('0x79')]();var _0x3c634f={'body':_0x2434dd['body'],'channel':'chat'};var _0x5a1043=[];var _0x279cb3=[];var _0x51572c={};var _0x1a291b=![];return db['CmContact'][_0x4866('0x4d')]()[_0x4866('0x23')](function(_0x2de7c2){if(!_0x2de7c2){throw new db[(_0x4866('0x7a'))][(_0x4866('0x7b'))](_0x4866('0x7c'));}_0x5a1043=_[_0x4866('0x7d')](_['keys'](_0x2de7c2),['createdAt','updatedAt']);_0x279cb3=_[_0x4866('0x7d')](_[_0x4866('0x30')](_0x2de7c2),[_0x4866('0x7e'),_0x4866('0x7f'),_0x4866('0x80'),_0x4866('0x81')]);if(_0x2434dd['body']['id']){delete _0x2434dd[_0x4866('0x4c')]['id'];}if(_['isNil'](_0x2434dd['body']['from'])){throw new db[(_0x4866('0x7a'))][(_0x4866('0x7b'))](_0x4866('0x82'));}if(_['isNil'](_0x2434dd[_0x4866('0x4c')][_0x4866('0x4c')])||_0x2434dd[_0x4866('0x4c')][_0x4866('0x4c')]===''){throw new db[(_0x4866('0x7a'))]['ValidationError'](_0x4866('0x83'));}if(_[_0x4866('0x67')](_0x2434dd['body'][_0x4866('0x84')])){throw new db[(_0x4866('0x7a'))][(_0x4866('0x7b'))](_0x4866('0x85')+_0x279cb3);}if(!_[_0x4866('0x86')](_0x279cb3,_0x2434dd[_0x4866('0x4c')][_0x4866('0x84')])){throw new db[(_0x4866('0x7a'))][(_0x4866('0x7b'))](_0x4866('0x87')+_0x279cb3);}_0x51572c[_0x2434dd[_0x4866('0x4c')][_0x4866('0x84')]]=_0x2434dd[_0x4866('0x4c')][_0x4866('0x88')];})['then'](function(){return db[_0x4866('0x3f')]['find']({'where':{'id':_0x2434dd[_0x4866('0x44')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4866('0x89')],'as':_0x4866('0x8a'),'where':_0x51572c,'limit':0x1,'order':[[_0x4866('0x7f'),_0x4866('0x8b')]]}]},{'model':db[_0x4866('0x8c')],'as':_0x4866('0x8d')}]});})[_0x4866('0x23')](handleEntityNotFound(_0x4febf7,null))[_0x4866('0x23')](function(_0x399f45){if(_0x399f45&&_0x399f45[_0x4866('0x8e')]){_0x3c634f[_0x4866('0x8f')]=_0x399f45;_0x3c634f['applications']=_0x399f45[_0x4866('0x8d')];_0x3c634f[_0x4866('0x90')]=_0x399f45[_0x4866('0x8e')];_0x3c634f['applications']=_[_0x4866('0x91')](_0x3c634f[_0x4866('0x92')],[_0x4866('0x93')],['asc']);if(_0x3c634f[_0x4866('0x8f')]['Applications']){delete _0x3c634f[_0x4866('0x8f')][_0x4866('0x8d')];}if(_0x3c634f['account'][_0x4866('0x8e')]&&_0x3c634f['account'][_0x4866('0x8e')][_0x4866('0x8a')]['length']){return _0x3c634f[_0x4866('0x8f')][_0x4866('0x8e')][_0x4866('0x8a')][0x0];}var _0x4aa42c=_[_0x4866('0x94')](_0x2434dd[_0x4866('0x4c')],{'firstName':_0x2434dd[_0x4866('0x4c')][_0x4866('0x88')],'ListId':_0x399f45['ListId']});_0x4aa42c[_0x2434dd[_0x4866('0x4c')][_0x4866('0x84')]]=_0x2434dd[_0x4866('0x4c')]['from'];return db['CmContact'][_0x4866('0x47')](_0x4aa42c,{'fields':_0x5a1043,'raw':!![]});}})[_0x4866('0x23')](handleEntityNotFound(_0x4febf7,null))[_0x4866('0x23')](function(_0x5593d){_0x3c634f[_0x4866('0x95')]=_0x5593d;var _0x4157cf=_0x2434dd[_0x4866('0x4c')][_0x4866('0x96')];if(_0x2434dd[_0x4866('0x77')][_0x4866('0x97')]){_0x4157cf=_0x2434dd['headers'][_0x4866('0x97')];}else if(_0x2434dd[_0x4866('0x77')]['x-forwarded-for']){_0x4157cf=_[_0x4866('0x98')](_0x2434dd[_0x4866('0x77')][_0x4866('0x99')][_0x4866('0x9a')](','));}if(_0x5593d){var _0x17ee53={'ContactId':_0x5593d['id'],'ChatWebsiteId':_0x2434dd[_0x4866('0x44')]['id'],'from':(_0x5593d[_0x4866('0x9b')]||'')+'\x20'+(_0x5593d['lastName']||''),'customerIp':_0x4157cf,'customerPort':_0x2434dd['headers']['x-real-port']?_0x2434dd[_0x4866('0x77')][_0x4866('0x9c')]:null,'referer':_0x2434dd[_0x4866('0x4c')][_0x4866('0x9d')],'browserName':_0x3d20e4[_0x4866('0x9e')]['name']&&_0x3d20e4[_0x4866('0x9e')][_0x4866('0x9f')]?util[_0x4866('0xa0')]('%s\x20%s',_0x3d20e4[_0x4866('0x9e')][_0x4866('0x28')],_0x3d20e4[_0x4866('0x9e')][_0x4866('0x9f')]):_0x4866('0xa1'),'browserVersion':_0x3d20e4[_0x4866('0x9e')][_0x4866('0x9f')]||_0x4866('0xa1'),'osName':util['format'](_0x4866('0xa2'),_0x3d20e4['os']['name'],_0x3d20e4['os'][_0x4866('0x9f')]),'osVersion':_0x3d20e4['os'][_0x4866('0x9f')],'deviceModel':_0x3d20e4[_0x4866('0xa3')][_0x4866('0x2d')]&&_0x3d20e4[_0x4866('0xa3')][_0x4866('0xa4')]?util[_0x4866('0xa0')](_0x4866('0xa5'),_0x3d20e4[_0x4866('0xa3')][_0x4866('0x2d')],_0x3d20e4['device']['vendor'],_0x3d20e4[_0x4866('0xa3')][_0x4866('0x2c')]):null,'deviceVendor':_0x3d20e4[_0x4866('0xa3')][_0x4866('0xa4')],'deviceType':_0x3d20e4[_0x4866('0xa3')][_0x4866('0x2c')],'formData':JSON['stringify'](_0x2434dd[_0x4866('0x4c')])};var _0x2208ab={'ChatWebsiteId':_0x2434dd[_0x4866('0x44')]['id'],'closed':![]};if(_0x2434dd['body'][_0x4866('0xa6')]){_0x2208ab[_0x4866('0xa6')]=_0x2434dd[_0x4866('0x4c')][_0x4866('0xa6')];return db[_0x4866('0xa7')]['find']({'where':_0x2208ab})['then'](function(_0x50d337){if(_0x50d337){return[_0x50d337,![]];}_0x17ee53[_0x4866('0xa6')]=_0x2434dd[_0x4866('0x4c')][_0x4866('0xa6')];_0x17ee53['externalUrl']=_0x2434dd[_0x4866('0x4c')][_0x4866('0xa8')];return db[_0x4866('0xa7')][_0x4866('0x47')](_0x17ee53)['then'](function(_0x250ebe){return[_0x250ebe,!![]];});});}_0x2208ab[_0x4866('0xa9')]=_0x5593d['id'];if(_0x2434dd[_0x4866('0x4c')][_0x4866('0xaa')]&&_0x2434dd[_0x4866('0x4c')][_0x4866('0xaa')]['id']){_0x2208ab['id']=_0x2434dd[_0x4866('0x4c')][_0x4866('0xaa')]['id'];return db[_0x4866('0xa7')][_0x4866('0x46')]({'where':_0x2208ab})[_0x4866('0x23')](function(_0x32071c){if(_0x32071c){return[_0x32071c,![]];}return db[_0x4866('0xa7')][_0x4866('0x47')](_0x17ee53)[_0x4866('0x23')](function(_0x5d9f3b){return[_0x5d9f3b,!![]];});});}return db[_0x4866('0xa7')]['create'](_0x17ee53)[_0x4866('0x23')](function(_0xf00195){return[_0xf00195,!![]];});}})[_0x4866('0xab')](function(_0x549bd4,_0x388666){if(_0x549bd4){_0x1a291b=_0x388666;if(!_0x388666){var _0x5c67e5={'from':(_0x3c634f[_0x4866('0x95')][_0x4866('0x9b')]||'')+'\x20'+(_0x3c634f[_0x4866('0x95')][_0x4866('0xac')]||'')};if(_0x2434dd[_0x4866('0x4c')]['threadId']&&_0x2434dd[_0x4866('0x4c')][_0x4866('0xad')]&&_0x2434dd[_0x4866('0x4c')][_0x4866('0xa6')]!=_0x2434dd[_0x4866('0x4c')][_0x4866('0xad')]){_0x5c67e5['threadId']=_0x2434dd[_0x4866('0x4c')]['messageId'];}return _0x549bd4[_0x4866('0x22')](_0x5c67e5);}else{return _0x549bd4;}}})[_0x4866('0x23')](function(_0x2f69c8){_0x3c634f['interaction']=_0x2f69c8[_0x4866('0x25')]({'plain':!![]});_0x3c634f[_0x4866('0xaa')]['created']=_0x1a291b;if(_0x3c634f[_0x4866('0xaa')]['created']){if(_0x3c634f[_0x4866('0x8f')][_0x4866('0xae')]){_0x3c634f[_0x4866('0x92')][_0x4866('0xaf')]({'id':0x0,'priority':_0x3c634f[_0x4866('0x92')][_0x4866('0x35')]+0x1,'app':_0x4866('0xb0'),'appdata':_0x4866('0xb1'),'interval':'*,*,*,*'});}}return db[_0x4866('0xb2')][_0x4866('0x47')]({'body':_0x2434dd['body']['body'],'ChatWebsiteId':_0x2434dd[_0x4866('0x44')]['id'],'ChatInteractionId':_0x2f69c8['id'],'direction':'in','ContactId':_0x3c634f[_0x4866('0x95')]['id'],'AttachmentId':_0x2434dd[_0x4866('0x4c')]['AttachmentId']});})[_0x4866('0x23')](function(_0x369b23){_0x3c634f['message']=_0x369b23;if(_0x3c634f[_0x4866('0xaa')][_0x4866('0xb3')]){return db[_0x4866('0xb4')][_0x4866('0x46')]({'attributes':['id',_0x4866('0x28')],'where':{'id':_0x3c634f[_0x4866('0xaa')][_0x4866('0xb3')]}})[_0x4866('0x23')](function(_0x4de984){if(_0x4de984){_0x3c634f['applications'][_0x4866('0xb5')]({'id':0x0,'priority':0x0,'app':_0x4866('0xb6'),'appdata':_0x4de984['name']+','+(_0x3c634f[_0x4866('0x8f')][_0x4866('0xb7')]||0xa),'interval':_0x4866('0xb8')});_0x3c634f[_0x4866('0xb9')]=!![];}return respondWithRpcPromise(_0x4866('0xba'),'startRouting',_0x3c634f);});}return respondWithRpcPromise(_0x4866('0xba'),'startRouting',_0x3c634f);})['then'](function(_0x452c08){respondWithRpcPromise('EventManager','EventManager',{'event':_0x4866('0x74'),'message':_0x452c08},client9002);return _0x452c08;})['then'](respondWithResult(_0x4febf7,null))[_0x4866('0x42')](handleError(_0x4febf7,null));};exports['offline']=function(_0x5cf873,_0x1acb00){var _0x4cae76,_0x153964,_0x5b327a;var _0x393a85=[];var _0x32b970={};var _0x34da31=_0x5cf873[_0x4866('0xbb')]||[];var _0x2d5aba=[];var _0x463a31;return db[_0x4866('0x89')][_0x4866('0x4d')]()['then'](function(_0x229388){if(!_0x229388){throw new db[(_0x4866('0x7a'))][(_0x4866('0x7b'))]('no\x20available\x20attributes');}_0x393a85=_[_0x4866('0x7d')](_[_0x4866('0x30')](_0x229388),[_0x4866('0x7e'),_0x4866('0x7f'),_0x4866('0x80'),_0x4866('0x81')]);if(_0x5cf873[_0x4866('0x4c')]['id']){delete _0x5cf873[_0x4866('0x4c')]['id'];}if(_['isNil'](_0x5cf873[_0x4866('0x4c')]['from'])){throw _0x1acb00[_0x4866('0x1a')](0x1f4)[_0x4866('0xbc')](new db[(_0x4866('0x7a'))][(_0x4866('0x7b'))](_0x4866('0x82')));}if(_['isNil'](_0x5cf873['body']['body'])||_0x5cf873[_0x4866('0x4c')][_0x4866('0x4c')]===''){throw _0x1acb00[_0x4866('0x1a')](0x1f4)[_0x4866('0xbc')](new db[(_0x4866('0x7a'))][(_0x4866('0x7b'))](_0x4866('0x83')));}if(_[_0x4866('0x67')](_0x5cf873[_0x4866('0x4c')][_0x4866('0xbd')])){throw _0x1acb00[_0x4866('0x1a')](0x1f4)[_0x4866('0xbc')](new db['Sequelize'][(_0x4866('0x7b'))](_0x4866('0xbe')+_0x393a85));}if(!_[_0x4866('0x86')](_0x393a85,_0x5cf873[_0x4866('0x4c')][_0x4866('0xbd')])){throw _0x1acb00[_0x4866('0x1a')](0x1f4)['send'](new db['Sequelize'][(_0x4866('0x7b'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x393a85));}_0x32b970[_0x5cf873[_0x4866('0x4c')][_0x4866('0xbd')]]=_0x5cf873[_0x4866('0x4c')][_0x4866('0x88')];})[_0x4866('0x23')](function(){return db[_0x4866('0x3f')]['find']({'where':{'id':_0x5cf873[_0x4866('0x44')]['id']},'include':[{'model':db[_0x4866('0xbf')],'as':_0x4866('0x8e')},{'model':db[_0x4866('0xc0')],'as':_0x4866('0xc0')}]});})[_0x4866('0x23')](handleEntityNotFound(_0x1acb00,null))[_0x4866('0x23')](function(_0x12b7a1){if(_0x12b7a1&&_0x12b7a1[_0x4866('0x8e')]){_0x153964=_0x12b7a1;var _0x476e8a=_[_0x4866('0x94')](_0x5cf873[_0x4866('0x4c')],{'firstName':_0x5cf873[_0x4866('0x4c')][_0x4866('0x88')],'phone':_0x5cf873[_0x4866('0x4c')][_0x4866('0x88')],'ListId':_0x12b7a1['ListId']});_0x476e8a[_0x5cf873[_0x4866('0x4c')][_0x4866('0xbd')]]=_0x5cf873[_0x4866('0x4c')][_0x4866('0x88')];return db[_0x4866('0x89')][_0x4866('0xc1')]({'where':_0x32b970,'defaults':_0x476e8a});}})[_0x4866('0xab')](function(_0x35ae57){if(_0x35ae57){_0x5b327a=_0x35ae57;var _0x52f37a=fs['readFileSync'](path[_0x4866('0x69')](config[_0x4866('0x63')],'server/files/templates/chatOfflineMessage.ejs'),_0x4866('0xc2'));var _0x82101b=ejs[_0x4866('0xc3')](_0x52f37a,{'body':_[_0x4866('0xc4')](_0x5cf873[_0x4866('0x4c')][_0x4866('0x4c')]),'bodyTitle':_0x153964['offlineMessageBody']});return db[_0x4866('0xc5')][_0x4866('0x47')]({'body':_0x82101b,'plainBody':htmlToText[_0x4866('0xc6')](_0x82101b),'ContactId':_0x35ae57['id'],'ChatWebsiteId':_0x153964['id']});}})['then'](function(_0x2458ca){_0x463a31=_0x2458ca;if(_0x34da31[_0x4866('0x35')]){var _0x39e1bd=_0x34da31['map'](function(_0x6ad3df){return{'name':_0x6ad3df[_0x4866('0xc7')],'basename':_0x6ad3df[_0x4866('0x5e')],'type':_0x6ad3df[_0x4866('0xc8')],'ChatOfflineMessageId':_0x2458ca['id']};});_0x2d5aba=_0x39e1bd[_0x4866('0x2e')](_0x3804ae=>{var _0x3d9840={'filename':_0x3804ae['name'],'path':path['join'](config[_0x4866('0x63')],'server',_0x4866('0xbb'),_0x4866('0xc9'),'offline-chat',_0x3804ae[_0x4866('0xca')])};return _0x3d9840;});if(!_0x153964[_0x4866('0xcb')]){return db['sequelize'][_0x4866('0xcc')](function(_0x3093f5){return db['Attachment'][_0x4866('0xcd')](_0x39e1bd,{'transaction':_0x3093f5});});}}})['then'](function(){if(_0x463a31){_0x4cae76=_0x463a31;return db[_0x4866('0xc0')][_0x4866('0x51')]({'where':{'service':!![]},'include':[{'model':db[_0x4866('0xce')],'as':_0x4866('0xcf'),'raw':!![],'include':[{'model':db[_0x4866('0xd0')],'as':_0x4866('0xd0'),'raw':!![]}]}]});}})[_0x4866('0x23')](function(_0x480b3f){if(_0x480b3f&&_0x480b3f[_0x4866('0xcf')]&&_0x153964['forwardOffline']&&_0x153964['forwardOfflineAddress']){var _0x241f96=_0x480b3f[_0x4866('0xd1')]();return respondWithRpcPromise(_0x4866('0xd2'),_0x4866('0xd3'),{'account':_0x241f96,'message':{'from':util['format'](_0x4866('0xd4'),_0x480b3f['name'],_0x480b3f['email']||_0x480b3f[_0x4866('0xcf')][_0x4866('0x48')]),'to':_0x153964['forwardOfflineAddress'],'subject':_0x153964['offlineMessageSubject'],'html':_0x4cae76[_0x4866('0x4c')],'attachments':_0x2d5aba}},client9003)[_0x4866('0x23')](function(){return _0x4cae76;})[_0x4866('0x42')](function(_0x13b180){logger[_0x4866('0x14')](_0x13b180);});}})[_0x4866('0x23')](function(){if(_0x153964&&_0x153964[_0x4866('0xcb')]&&_0x153964[_0x4866('0xd5')]){var _0x47946e=[];if(_0x34da31[_0x4866('0x35')]){_0x47946e=_0x34da31[_0x4866('0x2e')](function(_0x43d5c9){return{'name':_0x43d5c9['originalname'],'basename':_0x43d5c9['filename'],'type':_0x43d5c9[_0x4866('0xc8')],'ChatOfflineMessageId':_0x463a31['id']};});}var _0x22f623;if(!_[_0x4866('0x67')](_0x153964[_0x4866('0xd6')])){var _0x22785d=_['map'](_0x5cf873['body'],function(_0x57d19c){return _0x57d19c;});var _0x3d164f=_[_0x4866('0xd7')](_0x22785d)[0x0];var _0x21d02a=_[_0x4866('0xd8')](_0x3d164f,function(_0x417183){return _0x417183;});_0x22f623=_0x21d02a[0x1][_0x153964[_0x4866('0xd6')]];}var _0x1e563f={'from':_0x5b327a[_0x4866('0xd9')],'firstName':_0x5b327a['firstName'],'lastName':_0x5b327a['lastName'],'mapKey':_0x4866('0xd9'),'message':{'from':_0x5b327a[_0x4866('0xd9')],'to':_0x153964[_0x4866('0xc0')][_0x4866('0xd9')],'cc':'','subject':_[_0x4866('0x67')](_0x22f623)?_0x153964[_0x4866('0xda')]:_0x22f623,'messageId':'','sentAt':new Date(),'attach':_0x47946e[_0x4866('0x35')],'attachments':_0x47946e,'originChannel':_0x4866('0xdb'),'ChatWebsiteId':_0x153964['id'],'ChatOfflineMessageId':_0x4cae76['id'],'originTo':_0x153964[_0x4866('0xc0')][_0x4866('0xd9')]},'body':_0x4cae76[_0x4866('0x4c')]};var _0x2e525a={'account':{'id':_0x153964[_0x4866('0xd5')]},'body':_0x1e563f,'log':_0x4866('0xdc')};return respondWithRpcPromise('NotifyMailAccount',_0x4866('0xdd'),_0x2e525a,client9001)['then'](function(){return _0x4cae76;})[_0x4866('0x42')](function(_0xcb5e59){logger['error'](_0xcb5e59);});}return;})['then'](function(){if(_0x4cae76){return _0x4cae76;}})[_0x4866('0x23')](respondWithResult(_0x1acb00,null))[_0x4866('0x42')](function(_0x4b1080){logger[_0x4866('0x14')](_0x4866('0x42'),_0x4b1080);for(var _0x44af95 of _0x34da31){var _0x48f0f7=path[_0x4866('0x69')](config['root'],_0x4866('0xde'),_0x4866('0xbb'),_0x4866('0xc9'),'offline-chat',_0x44af95['filename']);fs_extra['remove'](_0x48f0f7)[_0x4866('0x42')](function(_0x23236d){logger[_0x4866('0x14')](_0x4866('0xdf'),_0x48f0f7,_0x23236d);});}});};exports[_0x4866('0xe0')]=function(_0x12836b,_0x116c0c){return db['ChatInteraction']['find']({'where':{'id':_0x12836b[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x116c0c,null))[_0x4866('0x23')](function(_0xc33d89){if(_0xc33d89){return _0xc33d89['addInteraction'](_0x12836b[_0x4866('0x4c')][_0x4866('0x55')],_[_0x4866('0xe1')](_0x12836b[_0x4866('0x4c')],[_0x4866('0x55'),'id'])||{});}})['then'](respondWithResult(_0x116c0c,null))[_0x4866('0x42')](handleError(_0x116c0c,null));};exports[_0x4866('0xe2')]=function(_0x59a1d8,_0x6e7c04){var _0x59fe84={'raw':![],'where':{}};var _0x44d241={};var _0x55ddc0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4866('0x51')]({'where':{'id':_0x59a1d8[_0x4866('0x44')]['id']}})['then'](handleEntityNotFound(_0x6e7c04,null))[_0x4866('0x23')](function(_0xbf39c3){if(_0xbf39c3){_0x44d241[_0x4866('0x2d')]=_['keys'](db[_0x4866('0xa7')][_0x4866('0x2a')]);_0x44d241[_0x4866('0x2f')]=_['keys'](_0x59a1d8[_0x4866('0x2f')]);_0x44d241[_0x4866('0x31')]=_['intersection'](_0x44d241['model'],_0x44d241['query']);_0x59fe84[_0x4866('0x33')]=_['intersection'](_0x44d241[_0x4866('0x2d')],qs[_0x4866('0x34')](_0x59a1d8['query']['fields']));_0x59fe84[_0x4866('0x33')]=_0x59fe84[_0x4866('0x33')][_0x4866('0x35')]?_0x59fe84[_0x4866('0x33')]:_0x44d241['model'];if(!_0x59a1d8[_0x4866('0x2f')]['hasOwnProperty']('nolimit')){_0x59fe84[_0x4866('0x1e')]=qs[_0x4866('0x1e')](_0x59a1d8[_0x4866('0x2f')][_0x4866('0x1e')]);_0x59fe84[_0x4866('0x1c')]=qs[_0x4866('0x1c')](_0x59a1d8[_0x4866('0x2f')][_0x4866('0x1c')]);}_0x59fe84[_0x4866('0x37')]=qs[_0x4866('0x38')](_0x59a1d8[_0x4866('0x2f')][_0x4866('0x38')]);_0x59fe84[_0x4866('0x3a')]=qs['filters'](_['pick'](_0x59a1d8[_0x4866('0x2f')],_0x44d241[_0x4866('0x31')]));_0x59fe84[_0x4866('0x3a')][_0x4866('0x53')]=_0xbf39c3['id'];if(_0x59a1d8[_0x4866('0x2f')][_0x4866('0x39')]){_0x59fe84[_0x4866('0x3a')]=_[_0x4866('0x3b')](_0x59fe84['where'],{'$or':_[_0x4866('0x2e')](_0x59fe84[_0x4866('0x33')],function(_0x101ea4){var _0xf164d3={};_0xf164d3[_0x101ea4]={'$like':'%'+_0x59a1d8[_0x4866('0x2f')][_0x4866('0x39')]+'%'};return _0xf164d3;})});}_0x59fe84=_[_0x4866('0x3b')]({},_0x59fe84,_0x59a1d8[_0x4866('0x3d')]);return db[_0x4866('0xa7')][_0x4866('0x1f')]({'where':_0x59fe84['where']})[_0x4866('0x23')](function(_0x5c83d5){_0x55ddc0[_0x4866('0x1f')]=_0x5c83d5;if(_0x59a1d8['query']['includeAll']){_0x59fe84[_0x4866('0x3e')]=[{'model':db[_0x4866('0x89')],'as':_0x4866('0xe3'),'required':![]},{'model':db['User'],'as':_0x4866('0xe4'),'attributes':[_0x4866('0x28'),_0x4866('0xe5'),_0x4866('0xe6')],'required':![]},{'model':db['Tag'],'as':_0x4866('0xe7'),'attributes':['id',_0x4866('0x28'),_0x4866('0xe8')],'where':_0x59a1d8['query'][_0x4866('0xe9')]?{'id':_0x59a1d8[_0x4866('0x2f')][_0x4866('0xe9')]}:undefined,'required':_0x59a1d8[_0x4866('0x2f')]['tag']?!![]:![]}];}return db[_0x4866('0xa7')]['findAll'](_0x59fe84);})[_0x4866('0x23')](function(_0x1f82d0){_0x55ddc0['rows']=_0x1f82d0;return _0x55ddc0;});}})[_0x4866('0x23')](respondWithFilteredResult(_0x6e7c04,_0x59fe84))[_0x4866('0x42')](handleError(_0x6e7c04,null));};function iftimePromise(_0x358507,_0x543139){return respondWithRpcPromise('Command',_0x4866('0xea'),{'command':_0x543139[_0x4866('0xeb')]?util[_0x4866('0xa0')](_0x4866('0xec'),_0x358507[_0x4866('0xed')],_0x543139[_0x4866('0xeb')]):util[_0x4866('0xa0')](_0x4866('0xee'),_0x358507[_0x4866('0xed')])},client9002)[_0x4866('0x23')](function(_0x276342){var _0x2157bf=_0x276342&&_0x276342[_0x4866('0xef')](_0x4866('0xf0'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x543139['id'],_0x358507['id'],_0x358507['interval'],_0x2157bf?_0x4866('0xf1'):_0x4866('0xf2'),_0x543139[_0x4866('0xeb')]?_0x543139['timezone']:_0x4866('0xf3'));return _0x2157bf;})[_0x4866('0x42')](function(_0x243da9){logger[_0x4866('0x14')](_0x4866('0xf4'),_0x543139['id'],_0x358507['id'],_0x358507['interval'],util[_0x4866('0xf5')](_0x243da9,{'showHidden':![],'depth':null}),_0x543139[_0x4866('0xeb')]?_0x543139[_0x4866('0xeb')]:'No\x20timezone');return![];});}exports[_0x4866('0xea')]=function(_0x4abf7d,_0x539185){var _0x4812c1=0x0;var _0x50341a=0x0;var _0x325c3d=![];var _0x2f4bff;var _0x16f3f6;return db[_0x4866('0x3f')]['find']({'where':{'id':_0x4abf7d['params']['id']},'include':[{'model':db[_0x4866('0xf6')],'as':_0x4866('0xf6'),'include':[{'model':db[_0x4866('0xf6')],'as':_0x4866('0xf7'),'attributes':['id',_0x4866('0xed')],'raw':!![]}]}]})[_0x4866('0x23')](handleEntityNotFound(_0x539185,null))[_0x4866('0x23')](function(_0x1b7cfa){if(_0x1b7cfa){_0x2f4bff=_0x1b7cfa;return _0x1b7cfa[_0x4866('0xf8')]({'raw':!![]});}})[_0x4866('0x23')](function(_0x23799a){if(_0x2f4bff){if(_0x23799a){_0x16f3f6=_0x23799a;}}return require(_0x4866('0x64'))[_0x4866('0x65')]();})[_0x4866('0x23')](function(_0x13f7d0){if(_0x13f7d0){_0x50341a=_0x13f7d0[_0x4866('0xf9')];_0x325c3d=_0x13f7d0[_0x4866('0x66')];}})[_0x4866('0x23')](function(){return db[_0x4866('0xa7')]['count']({'where':{'closed':![]}});})[_0x4866('0x23')](function(_0x4469aa){_0x4812c1=_0x4469aa;if(_0x50341a&&_0x4469aa>_0x50341a){return db[_0x4866('0xfa')][_0x4866('0x51')]({'where':{'id':0x1}})[_0x4866('0x23')](function(_0x2f35ef){if(_0x2f35ef){_0x2f35ef[_0x4866('0xfb')](_0x4866('0xfc'));}});}})[_0x4866('0x23')](function(){if(_0x2f4bff['Interval']&&_0x2f4bff['Interval'][_0x4866('0xf7')]){var _0x5c3119=[];for(var _0x2db1be=0x0;_0x2db1be<_0x2f4bff[_0x4866('0xf6')][_0x4866('0xf7')][_0x4866('0x35')];_0x2db1be++){var _0x8d1883=_0x2f4bff[_0x4866('0xf6')]['Intervals'][_0x2db1be][_0x4866('0x25')]({'plain':!![]});_0x5c3119[_0x4866('0xaf')](iftimePromise(_0x8d1883,_0x2f4bff));}return BPromise[_0x4866('0xfd')](_0x5c3119)[_0x4866('0x23')](function(_0x198fce){return _['some'](_0x198fce);});}else{return!![];}})['then'](function(_0x4cc7a5){var _0x186aa6=fs[_0x4866('0xfe')](path[_0x4866('0x69')](config[_0x4866('0x63')],'server/files/chat/iframe.ejs'),_0x4866('0xc2'));var _0x859ecf=new url['URL'](_0x2f4bff['address'])[_0x4866('0xff')];var _0x32848d='3.2.0';var _0x77cf20=![];var _0x4f3efb={'chatVersion':_0x32848d,'chatWebsiteAddressOrigin':_0x859ecf,'remote':_0x2f4bff[_0x4866('0x100')],'query':querystring['stringify'](_[_0x4866('0x3b')](_0x2f4bff['get']({'plain':!![]}),{'customerIp':_0x4abf7d[_0x4866('0x77')][_0x4866('0x99')]||_0x4abf7d[_0x4866('0x77')]['x-real-ip']||_0x4abf7d['connection'][_0x4866('0x101')]||_0x4abf7d['ip'],'referer':_0x4abf7d['headers'][_0x4866('0x9d')],'openedInteractions':_0x4812c1,'maxInteractions':_0x50341a,'virtual':_0x325c3d[_0x4866('0xf9')],'online':_0x4cc7a5,'custom':_0x325c3d}))[_0x4866('0x102')](/'/g,'\x5c\x27')};_0x539185[_0x4866('0xbc')](ejs[_0x4866('0xc3')](Mustache[_0x4866('0xc3')](_0x186aa6,_0x4f3efb),{'proactiveActions':_0x16f3f6,'alignment':_0x2f4bff[_0x4866('0x103')],'verticalAlignment':_0x2f4bff['verticalAlignment'],'div_color':_0x2f4bff['color'],'labelText':_0x2f4bff['labelText'],'text_color':_0x2f4bff[_0x4866('0x104')],'text_button_color':_0x2f4bff[_0x4866('0x105')],'button_color':_0x2f4bff[_0x4866('0x106')],'background_color':_0x2f4bff['backgroundColor'],'hideWhenOffline':_0x2f4bff[_0x4866('0x107')],'intervalId':_0x2f4bff['IntervalId'],'isDevelopment':_0x77cf20,'chatVersion':_0x32848d}));})[_0x4866('0x42')](handleError(_0x539185,null));};exports[_0x4866('0x108')]=function(_0x2f92b6,_0x2bd4ec){var _0x57d717=_0x2f92b6[_0x4866('0x44')]['id'];var _0x1f3694=_0x2f92b6['body'];var _0x58c6a1=0xc8;var _0x1b1a42=null;return db[_0x4866('0x109')]['transaction']({'isolationLevel':db[_0x4866('0x109')][_0x4866('0x10a')][_0x4866('0x10b')]['READ_COMMITTED']},function(_0x291ee8){return db[_0x4866('0x3f')][_0x4866('0x51')]({'where':{'id':_0x57d717},'transaction':_0x291ee8})[_0x4866('0x23')](function(_0x12738f){if(_0x12738f){return db[_0x4866('0x8c')][_0x4866('0x24')]({'where':{'ChatWebsiteId':_0x57d717},'transaction':_0x291ee8})['then'](function(){var _0x124a3f=_[_0x4866('0x2e')](_0x1f3694,function(_0x4ab085){_0x4ab085[_0x4866('0x53')]=_0x57d717;return _0x4ab085;});return db[_0x4866('0x8c')][_0x4866('0xcd')](_0x124a3f,{'transaction':_0x291ee8});});}else{_0x58c6a1=0x194;_0x1b1a42=[];}});})[_0x4866('0x23')](function(){if(_0x58c6a1!==0x194){return db[_0x4866('0x8c')][_0x4866('0x10c')]({'where':{'ChatWebsiteId':_0x57d717},'order':_0x4866('0x93')})['then'](function(_0x5c78ba){_0x1b1a42=_0x5c78ba;});}})[_0x4866('0x42')](function(_0x4c3888){_0x58c6a1=0x1f4;logger[_0x4866('0x14')](_0x4c3888[_0x4866('0x27')]);if(_0x4c3888[_0x4866('0x28')]){delete _0x4c3888['name'];}_0x1b1a42=_0x4c3888;})[_0x4866('0x10d')](function(){if(_0x1b1a42===null){_0x2bd4ec['sendStatus'](_0x58c6a1);}else{if(_0x58c6a1===0x1f4){_0x2bd4ec[_0x4866('0x1a')](_0x58c6a1)[_0x4866('0xbc')](_0x1b1a42);}else{_0x2bd4ec[_0x4866('0x1a')](_0x58c6a1)['json'](_0x1b1a42);}}});};exports['getApplications']=function(_0x631094,_0x3e4214){var _0x53b553={};var _0x230abb={};var _0x5b2bbc;var _0x5b784e;return db[_0x4866('0x3f')]['findOne']({'where':{'id':_0x631094[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x3e4214,null))['then'](function(_0x583c41){if(_0x583c41){_0x5b2bbc=_0x583c41;_0x230abb[_0x4866('0x2d')]=_['keys'](db[_0x4866('0x8c')]['rawAttributes']);_0x230abb[_0x4866('0x2f')]=_[_0x4866('0x30')](_0x631094[_0x4866('0x2f')]);_0x230abb[_0x4866('0x31')]=_[_0x4866('0x32')](_0x230abb['model'],_0x230abb[_0x4866('0x2f')]);_0x53b553[_0x4866('0x33')]=_[_0x4866('0x32')](_0x230abb[_0x4866('0x2d')],qs[_0x4866('0x34')](_0x631094['query'][_0x4866('0x34')]));_0x53b553['attributes']=_0x53b553[_0x4866('0x33')][_0x4866('0x35')]?_0x53b553[_0x4866('0x33')]:_0x230abb[_0x4866('0x2d')];_0x53b553[_0x4866('0x37')]=qs[_0x4866('0x38')](_0x631094[_0x4866('0x2f')]['sort']);_0x53b553['where']=qs[_0x4866('0x31')](_['pick'](_0x631094['query'],_0x230abb['filters']));if(_0x631094['query'][_0x4866('0x39')]){_0x53b553[_0x4866('0x3a')]=_[_0x4866('0x3b')](_0x53b553[_0x4866('0x3a')],{'$or':_['map'](_0x53b553[_0x4866('0x33')],function(_0x312489){var _0x8de531={};_0x8de531[_0x312489]={'$like':'%'+_0x631094[_0x4866('0x2f')]['filter']+'%'};return _0x8de531;})});}_0x53b553=_[_0x4866('0x3b')]({},_0x53b553,_0x631094[_0x4866('0x3d')]);return _0x5b2bbc[_0x4866('0x10e')](_0x53b553);}})['then'](function(_0xacdfd4){if(_0xacdfd4){_0x5b784e=_0xacdfd4[_0x4866('0x35')];if(!_0x631094[_0x4866('0x2f')]['hasOwnProperty'](_0x4866('0x59'))){_0x53b553[_0x4866('0x1e')]=qs[_0x4866('0x1e')](_0x631094[_0x4866('0x2f')][_0x4866('0x1e')]);_0x53b553['offset']=qs['offset'](_0x631094[_0x4866('0x2f')][_0x4866('0x1c')]);}return _0x5b2bbc[_0x4866('0x10e')](_0x53b553);}})[_0x4866('0x23')](function(_0x307b26){if(_0x307b26){return _0x307b26?{'count':_0x5b784e,'rows':_0x307b26}:null;}})[_0x4866('0x23')](respondWithResult(_0x3e4214,null))[_0x4866('0x42')](handleError(_0x3e4214,null));};exports['addProactiveActions']=function(_0x5e7c90,_0x50801c){return db['chatProactiveAction'][_0x4866('0x46')]({'where':{'id':_0x5e7c90[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x50801c,null))[_0x4866('0x23')](function(_0x1fbb07){if(_0x1fbb07){return _0x1fbb07['addProactiveActions'](_0x5e7c90[_0x4866('0x4c')][_0x4866('0x55')],_[_0x4866('0xe1')](_0x5e7c90[_0x4866('0x4c')],[_0x4866('0x55'),'id'])||{});}})['then'](respondWithResult(_0x50801c,null))[_0x4866('0x42')](handleError(_0x50801c,null));};exports[_0x4866('0xf8')]=function(_0x4f68b8,_0x46f399){var _0x5caeca={};var _0x23ca41={};var _0x4c599c;var _0xad0308;return db['ChatWebsite'][_0x4866('0x51')]({'where':{'id':_0x4f68b8[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x46f399,null))[_0x4866('0x23')](function(_0x51e2ee){if(_0x51e2ee){_0x4c599c=_0x51e2ee;_0x23ca41[_0x4866('0x2d')]=_[_0x4866('0x30')](db[_0x4866('0x10f')][_0x4866('0x2a')]);_0x23ca41[_0x4866('0x2f')]=_[_0x4866('0x30')](_0x4f68b8[_0x4866('0x2f')]);_0x23ca41['filters']=_[_0x4866('0x32')](_0x23ca41[_0x4866('0x2d')],_0x23ca41[_0x4866('0x2f')]);_0x5caeca[_0x4866('0x33')]=_[_0x4866('0x32')](_0x23ca41[_0x4866('0x2d')],qs[_0x4866('0x34')](_0x4f68b8['query'][_0x4866('0x34')]));_0x5caeca[_0x4866('0x33')]=_0x5caeca[_0x4866('0x33')][_0x4866('0x35')]?_0x5caeca[_0x4866('0x33')]:_0x23ca41['model'];_0x5caeca['order']=qs[_0x4866('0x38')](_0x4f68b8[_0x4866('0x2f')]['sort']);_0x5caeca[_0x4866('0x3a')]=qs['filters'](_[_0x4866('0x52')](_0x4f68b8[_0x4866('0x2f')],_0x23ca41['filters']));if(_0x4f68b8[_0x4866('0x2f')][_0x4866('0x39')]){_0x5caeca[_0x4866('0x3a')]=_[_0x4866('0x3b')](_0x5caeca[_0x4866('0x3a')],{'$or':_[_0x4866('0x2e')](_0x5caeca[_0x4866('0x33')],function(_0x397424){var _0x5611a8={};_0x5611a8[_0x397424]={'$like':'%'+_0x4f68b8['query'][_0x4866('0x39')]+'%'};return _0x5611a8;})});}_0x5caeca=_[_0x4866('0x3b')]({},_0x5caeca,_0x4f68b8[_0x4866('0x3d')]);return _0x4c599c[_0x4866('0xf8')](_0x5caeca);}})['then'](function(_0x16a8ef){if(_0x16a8ef){_0xad0308=_0x16a8ef[_0x4866('0x35')];if(!_0x4f68b8[_0x4866('0x2f')][_0x4866('0x36')](_0x4866('0x59'))){_0x5caeca['limit']=qs[_0x4866('0x1e')](_0x4f68b8['query']['limit']);_0x5caeca['offset']=qs[_0x4866('0x1c')](_0x4f68b8[_0x4866('0x2f')]['offset']);}return _0x4c599c[_0x4866('0xf8')](_0x5caeca);}})['then'](function(_0x3b4821){if(_0x3b4821){return _0x3b4821?{'count':_0xad0308,'rows':_0x3b4821}:null;}})['then'](respondWithResult(_0x46f399,null))[_0x4866('0x42')](handleError(_0x46f399,null));};exports[_0x4866('0x110')]=function(_0x1c0cd9,_0x1e071b){var _0x47edb7=_0x1c0cd9['query']['online']==='false'?_0x4866('0x111'):_0x4866('0x112');return db[_0x4866('0x3f')]['find']({'attributes':['id',_0x47edb7],'where':{'id':_0x1c0cd9[_0x4866('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e071b,null))[_0x4866('0x23')](function(_0x10406a){if(_0x10406a){var _0x175903=_0x10406a[_0x47edb7];var _0x2f6074=_0x175903&&_0x175903[_0x4866('0x113')]?_0x175903[_0x4866('0x113')]:[];_0x1e071b['send']({'fromKey':_['isNil'](_0x175903[_0x4866('0x114')])?undefined:_0x175903[_0x4866('0x114')],'count':_0x2f6074[_0x4866('0x35')],'rows':_0x2f6074});}})[_0x4866('0x42')](handleError(_0x1e071b,null));};exports['getOfflineMessages']=function(_0x2a24aa,_0x44931a){var _0x4605d1={'raw':![],'where':{}};var _0x34ee81={};var _0x355643={'count':0x0,'rows':[]};return db[_0x4866('0x3f')]['findOne']({'where':{'id':_0x2a24aa[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x44931a,null))['then'](function(_0xf7ae36){if(_0xf7ae36){_0x34ee81[_0x4866('0x2d')]=_[_0x4866('0x30')](db['ChatOfflineMessage'][_0x4866('0x2a')]);_0x34ee81[_0x4866('0x2f')]=_[_0x4866('0x30')](_0x2a24aa[_0x4866('0x2f')]);_0x34ee81[_0x4866('0x31')]=_[_0x4866('0x32')](_0x34ee81[_0x4866('0x2d')],_0x34ee81[_0x4866('0x2f')]);_0x4605d1[_0x4866('0x33')]=_[_0x4866('0x32')](_0x34ee81[_0x4866('0x2d')],qs['fields'](_0x2a24aa['query'][_0x4866('0x34')]));_0x4605d1[_0x4866('0x33')]=_0x4605d1['attributes']['length']?_0x4605d1[_0x4866('0x33')]:_0x34ee81['model'];if(!_0x2a24aa['query'][_0x4866('0x36')]('nolimit')){_0x4605d1[_0x4866('0x1e')]=qs['limit'](_0x2a24aa[_0x4866('0x2f')][_0x4866('0x1e')]);_0x4605d1[_0x4866('0x1c')]=qs[_0x4866('0x1c')](_0x2a24aa[_0x4866('0x2f')]['offset']);}_0x4605d1[_0x4866('0x37')]=qs[_0x4866('0x38')](_0x2a24aa[_0x4866('0x2f')]['sort']);_0x4605d1[_0x4866('0x3a')]=qs[_0x4866('0x31')](_[_0x4866('0x52')](_0x2a24aa[_0x4866('0x2f')],_0x34ee81[_0x4866('0x31')]));_0x4605d1[_0x4866('0x3a')][_0x4866('0x53')]=_0xf7ae36['id'];if(_0x2a24aa[_0x4866('0x2f')][_0x4866('0x39')]){_0x4605d1['where']=_['merge'](_0x4605d1[_0x4866('0x3a')],{'$or':_['map'](_0x4605d1['attributes'],function(_0x5065fd){var _0x56845a={};_0x56845a[_0x5065fd]={'$like':'%'+_0x2a24aa[_0x4866('0x2f')][_0x4866('0x39')]+'%'};return _0x56845a;})});}_0x4605d1=_[_0x4866('0x3b')]({},_0x4605d1,_0x2a24aa[_0x4866('0x3d')]);return db[_0x4866('0xc5')][_0x4866('0x1f')]({'where':_0x4605d1[_0x4866('0x3a')]})[_0x4866('0x23')](function(_0x5268ac){_0x355643[_0x4866('0x1f')]=_0x5268ac;if(_0x2a24aa['query'][_0x4866('0x45')]){_0x4605d1[_0x4866('0x3e')]=[{'all':!![]}];}else{_0x4605d1[_0x4866('0x3e')]=[{'model':db[_0x4866('0x89')],'as':_0x4866('0xe3'),'required':![]},{'model':db[_0x4866('0x115')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x4605d1);})[_0x4866('0x23')](function(_0x3a8a81){_0x355643[_0x4866('0x41')]=_0x3a8a81;return _0x355643;});}})['then'](respondWithFilteredResult(_0x44931a,_0x4605d1))[_0x4866('0x42')](handleError(_0x44931a,null));};exports[_0x4866('0x116')]=function(_0x422833,_0x584eb4){return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x422833[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0x584eb4,null))[_0x4866('0x23')](function(_0x4c8b44){if(_0x4c8b44){return _0x4c8b44[_0x4866('0x116')](_0x422833['body'][_0x4866('0x55')],_[_0x4866('0xe1')](_0x422833[_0x4866('0x4c')],[_0x4866('0x55'),'id'])||{})[_0x4866('0xab')](function(_0x10272d){for(var _0x1a9535=0x0;_0x1a9535<_0x422833[_0x4866('0x4c')][_0x4866('0x55')][_0x4866('0x35')];_0x1a9535+=0x1){socket[_0x4866('0x117')](_0x4866('0x118'),{'UserId':Number(_0x422833['body'][_0x4866('0x55')][_0x1a9535]),'ChatWebsiteId':Number(_0x422833[_0x4866('0x44')]['id'])});}return _0x10272d;});}})[_0x4866('0x23')](respondWithResult(_0x584eb4,null))[_0x4866('0x42')](handleError(_0x584eb4,null));};exports[_0x4866('0x119')]=function(_0x22ff04,_0x35414f){return db[_0x4866('0x3f')][_0x4866('0x46')]({'where':{'id':_0x22ff04[_0x4866('0x44')]['id']}})['then'](handleEntityNotFound(_0x35414f,null))[_0x4866('0x23')](function(_0x3a5266){if(_0x3a5266){return _0x3a5266[_0x4866('0x119')](_0x22ff04['query'][_0x4866('0x55')])[_0x4866('0x23')](function(){if(_[_0x4866('0x11a')](_0x22ff04[_0x4866('0x2f')][_0x4866('0x55')])){for(var _0x4fc06e=0x0;_0x4fc06e<_0x22ff04['query'][_0x4866('0x55')][_0x4866('0x35')];_0x4fc06e+=0x1){socket[_0x4866('0x117')](_0x4866('0x11b'),{'UserId':Number(_0x22ff04[_0x4866('0x2f')][_0x4866('0x55')][_0x4fc06e]),'ChatWebsiteId':Number(_0x22ff04[_0x4866('0x44')]['id'])});}}else{socket[_0x4866('0x117')]('userChatWebsite:remove',{'UserId':Number(_0x22ff04['query'][_0x4866('0x55')]),'ChatWebsiteId':Number(_0x22ff04['params']['id'])});}});}})[_0x4866('0x23')](respondWithStatusCode(_0x35414f,null))[_0x4866('0x42')](handleError(_0x35414f,null));};exports[_0x4866('0x11c')]=function(_0x51bc5b,_0xa8f531){var _0x302747={};var _0x51f25c={};var _0x5db1f2;var _0x6abcf9;return db[_0x4866('0x3f')][_0x4866('0x51')]({'where':{'id':_0x51bc5b[_0x4866('0x44')]['id']}})[_0x4866('0x23')](handleEntityNotFound(_0xa8f531,null))[_0x4866('0x23')](function(_0x461d74){if(_0x461d74){_0x5db1f2=_0x461d74;_0x51f25c['model']=_['keys'](db['User'][_0x4866('0x2a')]);_0x51f25c['query']=_[_0x4866('0x30')](_0x51bc5b[_0x4866('0x2f')]);_0x51f25c['filters']=_[_0x4866('0x32')](_0x51f25c[_0x4866('0x2d')],_0x51f25c[_0x4866('0x2f')]);_0x302747[_0x4866('0x33')]=_[_0x4866('0x32')](_0x51f25c['model'],qs['fields'](_0x51bc5b[_0x4866('0x2f')][_0x4866('0x34')]));_0x302747[_0x4866('0x33')]=_0x302747[_0x4866('0x33')][_0x4866('0x35')]?_0x302747[_0x4866('0x33')]:_0x51f25c[_0x4866('0x2d')];_0x302747[_0x4866('0x37')]=qs[_0x4866('0x38')](_0x51bc5b[_0x4866('0x2f')]['sort']);_0x302747[_0x4866('0x3a')]=qs[_0x4866('0x31')](_[_0x4866('0x52')](_0x51bc5b[_0x4866('0x2f')],_0x51f25c[_0x4866('0x31')]));if(_0x51bc5b[_0x4866('0x2f')][_0x4866('0x39')]){_0x302747[_0x4866('0x3a')]=_['merge'](_0x302747[_0x4866('0x3a')],{'$or':_['map'](_0x302747['attributes'],function(_0x9be3be){var _0x23e27e={};_0x23e27e[_0x9be3be]={'$like':'%'+_0x51bc5b['query'][_0x4866('0x39')]+'%'};return _0x23e27e;})});}_0x302747=_['merge']({},_0x302747,_0x51bc5b[_0x4866('0x3d')]);return _0x5db1f2[_0x4866('0x11c')](_0x302747);}})[_0x4866('0x23')](function(_0x383ee9){if(_0x383ee9){_0x6abcf9=_0x383ee9[_0x4866('0x35')];if(!_0x51bc5b[_0x4866('0x2f')]['hasOwnProperty'](_0x4866('0x59'))){_0x302747[_0x4866('0x1e')]=qs[_0x4866('0x1e')](_0x51bc5b[_0x4866('0x2f')][_0x4866('0x1e')]);_0x302747['offset']=qs[_0x4866('0x1c')](_0x51bc5b[_0x4866('0x2f')][_0x4866('0x1c')]);}return _0x5db1f2['getAgents'](_0x302747);}})[_0x4866('0x23')](function(_0x3b93d9){if(_0x3b93d9){return _0x3b93d9?{'count':_0x6abcf9,'rows':_0x3b93d9}:null;}})[_0x4866('0x23')](respondWithResult(_0xa8f531,null))[_0x4866('0x42')](handleError(_0xa8f531,null));};
\ No newline at end of file
+var _0x111c=['internal','Tag','Tags','color','tag','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','timezone','No\x20timezone','inspect','getProactiveActions','virtual','License','chatLicenseExceeded','Interval','Intervals','all','some','readFileSync','URL','address','origin','3.2.0','x-real-ip','connection','remoteAddress','replace','verticalAlignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','update','destroy','get','ChatWebsites','stack','name','send','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','find','create','body','UserProfileSection','UserProfileResource','Pause','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','getAnswers','findOne','findAll','removeAnswers','file','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','join','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','CmContact','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','Contacts','contact','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','format','version','unknown','device','%s\x20%s\x20%s','vendor','type','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','filename','mimetype','attachments','offline-chat','basename','transaction','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','email','Smtp','user','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','server','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x111c,0x162));var _0xc111=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x111c[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require(_0xc111('0x0'));var Mustache=require(_0xc111('0x1'));var util=require('util');var path=require(_0xc111('0x2'));var ejs=require(_0xc111('0x3'));var fs=require('fs');var fs_extra=require(_0xc111('0x4'));var _=require(_0xc111('0x5'));var querystring=require(_0xc111('0x6'));var Redis=require('ioredis');var qs=require(_0xc111('0x7'));var logger=require('../../config/logger')(_0xc111('0x8'));var config=require(_0xc111('0x9'));var url=require(_0xc111('0xa'));var db=require(_0xc111('0xb'))['db'];config['redis']=_[_0xc111('0xc')](config[_0xc111('0xd')],{'host':_0xc111('0xe'),'port':0x18eb});var socket=require(_0xc111('0xf'))(new Redis(config[_0xc111('0xd')]));require(_0xc111('0x10'))[_0xc111('0x11')](socket);var htmlToText=require(_0xc111('0x12'));var jayson=require(_0xc111('0x13'));var client=jayson[_0xc111('0x14')][_0xc111('0x15')]({'port':0x232c});var client9002=jayson[_0xc111('0x14')][_0xc111('0x15')]({'port':0x232a});var client9003=jayson['client'][_0xc111('0x15')]({'port':0x232b});var client9001=jayson[_0xc111('0x14')][_0xc111('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x25db91,_0x26a8c3,_0x1ab6aa,_0x3ea9a7){return new BPromise(function(_0x13be22,_0x5c1206){var _0x4e1c1f=_0x3ea9a7||client;return _0x4e1c1f['request'](_0x25db91,_0x1ab6aa)[_0xc111('0x16')](function(_0x3469c9){logger[_0xc111('0x17')](_0xc111('0x18'),_0x26a8c3,_0xc111('0x19'));logger[_0xc111('0x1a')](_0xc111('0x1b'),_0x26a8c3,_0xc111('0x19'),JSON['stringify'](_0x3469c9));if(_0x3469c9[_0xc111('0x1c')]){if(_0x3469c9[_0xc111('0x1c')]['code']===0x1f4){logger[_0xc111('0x1c')](_0xc111('0x18'),_0x26a8c3,_0x3469c9[_0xc111('0x1c')][_0xc111('0x1d')]);return _0x5c1206(_0x3469c9['error'][_0xc111('0x1d')]);}logger[_0xc111('0x1c')](_0xc111('0x18'),_0x26a8c3,_0x3469c9[_0xc111('0x1c')]['message']);return _0x13be22(_0x3469c9['error'][_0xc111('0x1d')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x26a8c3,_0xc111('0x19'));_0x13be22(_0x3469c9[_0xc111('0x1e')]['message']);}})[_0xc111('0x1f')](function(_0x9bb9f4){logger[_0xc111('0x1c')](_0xc111('0x18'),_0x26a8c3,_0x9bb9f4);_0x5c1206(_0x9bb9f4);});});}function respondWithStatusCode(_0x52d7ee,_0x3ef248){_0x3ef248=_0x3ef248||0xcc;return function(_0x2b2ae6){if(_0x2b2ae6){return _0x52d7ee[_0xc111('0x20')](_0x3ef248);}return _0x52d7ee[_0xc111('0x21')](_0x3ef248)[_0xc111('0x22')]();};}function respondWithResult(_0x484f10,_0x304e5c){_0x304e5c=_0x304e5c||0xc8;return function(_0x57aadb){if(_0x57aadb){return _0x484f10[_0xc111('0x21')](_0x304e5c)[_0xc111('0x23')](_0x57aadb);}};}function respondWithFilteredResult(_0x3ed95d,_0x51efab){return function(_0x5c624e){if(_0x5c624e){var _0x51219b=typeof _0x51efab[_0xc111('0x24')]===_0xc111('0x25')&&typeof _0x51efab[_0xc111('0x26')]===_0xc111('0x25');var _0x4d2c5b=_0x5c624e[_0xc111('0x27')];var _0x1b0fa3=_0x51219b?0x0:_0x51efab['offset'];var _0x5d4bb9=_0x51219b?_0x5c624e[_0xc111('0x27')]:_0x51efab[_0xc111('0x24')]+_0x51efab[_0xc111('0x26')];var _0x64d761;if(_0x5d4bb9>=_0x4d2c5b){_0x5d4bb9=_0x4d2c5b;_0x64d761=0xc8;}else{_0x64d761=0xce;}_0x3ed95d['status'](_0x64d761);return _0x3ed95d['set']('Content-Range',_0x1b0fa3+'-'+_0x5d4bb9+'/'+_0x4d2c5b)[_0xc111('0x23')](_0x5c624e);}return null;};}function saveUpdates(_0x866f65){return function(_0x59c3b4){if(_0x59c3b4){return _0x59c3b4[_0xc111('0x28')](_0x866f65)[_0xc111('0x16')](function(_0x9b4426){return _0x9b4426;});}return null;};}function removeEntity(_0x534238){return function(_0x43f332){if(_0x43f332){return _0x43f332[_0xc111('0x29')]()['then'](function(){var _0x5c35ba=_0x43f332[_0xc111('0x2a')]({'plain':!![]});var _0x2f692a=_0xc111('0x2b');return db['UserProfileResource'][_0xc111('0x29')]({'where':{'type':_0x2f692a,'resourceId':_0x5c35ba['id']}})[_0xc111('0x16')](function(){return _0x43f332;});})[_0xc111('0x16')](function(){_0x534238[_0xc111('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e899){return function(_0x47081d){if(!_0x47081d){_0x29e899[_0xc111('0x20')](0x194);}return _0x47081d;};}function handleError(_0x58350d,_0x13d8ae){_0x13d8ae=_0x13d8ae||0x1f4;return function(_0x23dc3c){logger['error'](_0x23dc3c[_0xc111('0x2c')]);if(_0x23dc3c[_0xc111('0x2d')]){delete _0x23dc3c[_0xc111('0x2d')];}_0x58350d[_0xc111('0x21')](_0x13d8ae)[_0xc111('0x2e')](_0x23dc3c);};}exports['index']=function(_0x4334fb,_0x56f82d){var _0x35a920={'include':[{'model':db['Pause'],'as':_0xc111('0x2f')}]},_0x57b507={},_0x103a3b={'count':0x0,'rows':[]};var _0xd281db=_[_0xc111('0x30')](db[_0xc111('0x31')][_0xc111('0x32')],function(_0x394395){return{'name':_0x394395['fieldName'],'type':_0x394395['type'][_0xc111('0x33')]};});_0x57b507[_0xc111('0x34')]=_[_0xc111('0x30')](_0xd281db,_0xc111('0x2d'));_0x57b507[_0xc111('0x35')]=_[_0xc111('0x36')](_0x4334fb[_0xc111('0x35')]);_0x57b507[_0xc111('0x37')]=_[_0xc111('0x38')](_0x57b507[_0xc111('0x34')],_0x57b507['query']);_0x35a920[_0xc111('0x39')]=_['intersection'](_0x57b507[_0xc111('0x34')],qs[_0xc111('0x3a')](_0x4334fb[_0xc111('0x35')][_0xc111('0x3a')]));_0x35a920[_0xc111('0x39')]=_0x35a920[_0xc111('0x39')][_0xc111('0x3b')]?_0x35a920['attributes']:_0x57b507[_0xc111('0x34')];if(!_0x4334fb[_0xc111('0x35')][_0xc111('0x3c')](_0xc111('0x3d'))){_0x35a920[_0xc111('0x26')]=qs[_0xc111('0x26')](_0x4334fb[_0xc111('0x35')]['limit']);_0x35a920[_0xc111('0x24')]=qs[_0xc111('0x24')](_0x4334fb[_0xc111('0x35')]['offset']);}_0x35a920[_0xc111('0x3e')]=qs[_0xc111('0x3f')](_0x4334fb['query'][_0xc111('0x3f')]);_0x35a920['where']=qs['filters'](_[_0xc111('0x40')](_0x4334fb[_0xc111('0x35')],_0x57b507[_0xc111('0x37')]),_0xd281db);if(_0x4334fb[_0xc111('0x35')][_0xc111('0x41')]){_0x35a920['where']=_['merge'](_0x35a920[_0xc111('0x42')],{'$or':_[_0xc111('0x30')](_0xd281db,function(_0x305ca1){if(_0x305ca1['type']!==_0xc111('0x43')){var _0x4e2926={};_0x4e2926[_0x305ca1[_0xc111('0x2d')]]={'$like':'%'+_0x4334fb['query'][_0xc111('0x41')]+'%'};return _0x4e2926;}})});}_0x35a920=_[_0xc111('0x44')]({},_0x35a920,_0x4334fb[_0xc111('0x45')]);var _0xd0e9f8={'where':_0x35a920[_0xc111('0x42')]};return db[_0xc111('0x31')][_0xc111('0x27')](_0xd0e9f8)[_0xc111('0x16')](function(_0x26f596){_0x103a3b[_0xc111('0x27')]=_0x26f596;if(_0x4334fb[_0xc111('0x35')][_0xc111('0x46')]){_0x35a920[_0xc111('0x47')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x35a920);})['then'](function(_0x6d9fff){_0x103a3b[_0xc111('0x48')]=_0x6d9fff;return _0x103a3b;})[_0xc111('0x16')](respondWithFilteredResult(_0x56f82d,_0x35a920))[_0xc111('0x1f')](handleError(_0x56f82d,null));};exports['show']=function(_0x4099f6,_0x2eb36){var _0x2ead74={'raw':![],'where':{'id':_0x4099f6['params']['id']},'include':[{'model':db['Pause'],'as':_0xc111('0x2f')}]},_0x49ceed={};_0x49ceed['model']=_[_0xc111('0x36')](db[_0xc111('0x31')][_0xc111('0x32')]);_0x49ceed[_0xc111('0x35')]=_[_0xc111('0x36')](_0x4099f6['query']);_0x49ceed[_0xc111('0x37')]=_[_0xc111('0x38')](_0x49ceed[_0xc111('0x34')],_0x49ceed['query']);_0x2ead74[_0xc111('0x39')]=_[_0xc111('0x38')](_0x49ceed[_0xc111('0x34')],qs['fields'](_0x4099f6[_0xc111('0x35')][_0xc111('0x3a')]));_0x2ead74['attributes']=_0x2ead74[_0xc111('0x39')][_0xc111('0x3b')]?_0x2ead74['attributes']:_0x49ceed['model'];if(_0x4099f6[_0xc111('0x35')][_0xc111('0x46')]){_0x2ead74[_0xc111('0x47')]=[{'all':!![]}];}_0x2ead74=_[_0xc111('0x44')]({},_0x2ead74,_0x4099f6[_0xc111('0x45')]);return db['ChatWebsite'][_0xc111('0x49')](_0x2ead74)[_0xc111('0x16')](handleEntityNotFound(_0x2eb36,null))[_0xc111('0x16')](respondWithResult(_0x2eb36,null))[_0xc111('0x1f')](handleError(_0x2eb36,null));};exports[_0xc111('0x4a')]=function(_0x186489,_0x109420){return db[_0xc111('0x31')][_0xc111('0x4a')](_0x186489[_0xc111('0x4b')],{})[_0xc111('0x16')](function(_0x3ce16a){var _0x522be7=_0x186489['user']['get']({'plain':!![]});if(!_0x522be7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x522be7['role']==='user'){var _0x89c649=_0x3ce16a[_0xc111('0x2a')]({'plain':!![]});var _0x564cbf='ChatWebsites';return db[_0xc111('0x4c')][_0xc111('0x49')]({'where':{'name':_0x564cbf,'userProfileId':_0x522be7['userProfileId']},'raw':!![]})[_0xc111('0x16')](function(_0x56d580){if(_0x56d580&&_0x56d580['autoAssociation']===0x0){return db[_0xc111('0x4d')][_0xc111('0x4a')]({'name':_0x89c649['name'],'resourceId':_0x89c649['id'],'type':_0x56d580[_0xc111('0x2d')],'sectionId':_0x56d580['id']},{})[_0xc111('0x16')](function(){return _0x3ce16a;});}else{return _0x3ce16a;}})['catch'](function(_0x5e6d9e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e6d9e);throw _0x5e6d9e;});}return _0x3ce16a;})[_0xc111('0x16')](respondWithResult(_0x109420,0xc9))[_0xc111('0x1f')](handleError(_0x109420,null));};exports['update']=function(_0x524045,_0x489e3c){if(_0x524045[_0xc111('0x4b')]['id']){delete _0x524045[_0xc111('0x4b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x524045['params']['id']},'include':[{'model':db[_0xc111('0x4e')],'as':_0xc111('0x2f')}]})[_0xc111('0x16')](handleEntityNotFound(_0x489e3c,null))[_0xc111('0x16')](saveUpdates(_0x524045['body'],null))[_0xc111('0x16')](respondWithResult(_0x489e3c,null))[_0xc111('0x1f')](handleError(_0x489e3c,null));};exports[_0xc111('0x29')]=function(_0x2d7e8c,_0x1b6171){return db[_0xc111('0x31')]['find']({'where':{'id':_0x2d7e8c[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x1b6171,null))[_0xc111('0x16')](removeEntity(_0x1b6171,null))['catch'](handleError(_0x1b6171,null));};exports[_0xc111('0x50')]=function(_0x2fbbc,_0x385a2a){return db[_0xc111('0x31')][_0xc111('0x50')]()['then'](respondWithResult(_0x385a2a,null))[_0xc111('0x1f')](handleError(_0x385a2a,null));};exports[_0xc111('0x51')]=function(_0x40d9bf,_0x549c60){if(_0x40d9bf[_0xc111('0x4b')]['id']){delete _0x40d9bf[_0xc111('0x4b')]['id'];}return db[_0xc111('0x31')][_0xc111('0x49')]({'where':{'id':_0x40d9bf[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x549c60,null))[_0xc111('0x16')](function(_0x1e5ddf){if(_0x1e5ddf){_0x40d9bf['body'][_0xc111('0x52')]=_0x1e5ddf['id'];return db[_0xc111('0x53')][_0xc111('0x4a')](_0x40d9bf['body']);}})[_0xc111('0x16')](respondWithResult(_0x549c60,null))['catch'](handleError(_0x549c60,null));};exports[_0xc111('0x54')]=function(_0x1bcac3,_0x3f9892){var _0x14c4af={'raw':![],'where':{}};var _0x5e7574={};var _0x5a2e69={'count':0x0,'rows':[]};return db[_0xc111('0x31')]['findOne']({'where':{'id':_0x1bcac3[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x3f9892,null))[_0xc111('0x16')](function(_0x529add){if(_0x529add){_0x5e7574[_0xc111('0x34')]=_['keys'](db[_0xc111('0x53')][_0xc111('0x32')]);_0x5e7574['query']=_[_0xc111('0x36')](_0x1bcac3['query']);_0x5e7574[_0xc111('0x37')]=_[_0xc111('0x38')](_0x5e7574[_0xc111('0x34')],_0x5e7574[_0xc111('0x35')]);_0x14c4af[_0xc111('0x39')]=_[_0xc111('0x38')](_0x5e7574[_0xc111('0x34')],qs[_0xc111('0x3a')](_0x1bcac3['query'][_0xc111('0x3a')]));_0x14c4af[_0xc111('0x39')]=_0x14c4af[_0xc111('0x39')]['length']?_0x14c4af['attributes']:_0x5e7574[_0xc111('0x34')];if(!_0x1bcac3[_0xc111('0x35')][_0xc111('0x3c')](_0xc111('0x3d'))){_0x14c4af['limit']=qs[_0xc111('0x26')](_0x1bcac3[_0xc111('0x35')]['limit']);_0x14c4af[_0xc111('0x24')]=qs[_0xc111('0x24')](_0x1bcac3[_0xc111('0x35')][_0xc111('0x24')]);}_0x14c4af['order']=qs[_0xc111('0x3f')](_0x1bcac3[_0xc111('0x35')]['sort']);_0x14c4af['where']=qs[_0xc111('0x37')](_[_0xc111('0x40')](_0x1bcac3['query'],_0x5e7574[_0xc111('0x37')]));_0x14c4af[_0xc111('0x42')][_0xc111('0x52')]=_0x529add['id'];if(_0x1bcac3['query']['filter']){_0x14c4af[_0xc111('0x42')]=_['merge'](_0x14c4af[_0xc111('0x42')],{'$or':_[_0xc111('0x30')](_0x14c4af['attributes'],function(_0x100387){var _0x1311f6={};_0x1311f6[_0x100387]={'$like':'%'+_0x1bcac3[_0xc111('0x35')][_0xc111('0x41')]+'%'};return _0x1311f6;})});}_0x14c4af=_[_0xc111('0x44')]({},_0x14c4af,_0x1bcac3[_0xc111('0x45')]);return db[_0xc111('0x53')][_0xc111('0x27')]({'where':_0x14c4af['where']})[_0xc111('0x16')](function(_0x111af3){_0x5a2e69[_0xc111('0x27')]=_0x111af3;if(_0x1bcac3[_0xc111('0x35')][_0xc111('0x46')]){_0x14c4af[_0xc111('0x47')]=[{'all':!![]}];}return db[_0xc111('0x53')]['findAll'](_0x14c4af);})[_0xc111('0x16')](function(_0x52ffb3){_0x5a2e69[_0xc111('0x48')]=_0x52ffb3;return _0x5a2e69;});}})[_0xc111('0x16')](respondWithFilteredResult(_0x3f9892,_0x14c4af))[_0xc111('0x1f')](handleError(_0x3f9892,null));};exports[_0xc111('0x55')]=function(_0x2b5482,_0x2a3814){return db[_0xc111('0x31')]['find']({'where':{'id':_0x2b5482[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x2a3814,null))['then'](function(_0xee1bcc){if(_0xee1bcc){return _0xee1bcc[_0xc111('0x55')](_0x2b5482['query'][_0xc111('0x56')]);}})[_0xc111('0x16')](respondWithStatusCode(_0x2a3814,null))[_0xc111('0x1f')](handleError(_0x2a3814,null));};exports['addAnswer']=function(_0x33406b,_0x159c96){if(_0x33406b[_0xc111('0x4b')]['id']){delete _0x33406b[_0xc111('0x4b')]['id'];}return db[_0xc111('0x31')][_0xc111('0x49')]({'where':{'id':_0x33406b[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x159c96,null))[_0xc111('0x16')](function(_0x3cb21d){if(_0x3cb21d){_0x33406b[_0xc111('0x4b')][_0xc111('0x52')]=_0x3cb21d['id'];return db['CannedAnswer'][_0xc111('0x4a')](_0x33406b[_0xc111('0x4b')]);}})['then'](respondWithResult(_0x159c96,null))[_0xc111('0x1f')](handleError(_0x159c96,null));};exports[_0xc111('0x57')]=function(_0x11a984,_0x5c6a87){var _0x58f1e5={'raw':![],'where':{}};var _0x14bfef={};var _0x51c68d={'count':0x0,'rows':[]};return db[_0xc111('0x31')][_0xc111('0x58')]({'where':{'id':_0x11a984[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x5c6a87,null))[_0xc111('0x16')](function(_0x3aef6d){if(_0x3aef6d){_0x14bfef[_0xc111('0x34')]=_[_0xc111('0x36')](db['CannedAnswer'][_0xc111('0x32')]);_0x14bfef[_0xc111('0x35')]=_[_0xc111('0x36')](_0x11a984[_0xc111('0x35')]);_0x14bfef[_0xc111('0x37')]=_['intersection'](_0x14bfef['model'],_0x14bfef[_0xc111('0x35')]);_0x58f1e5[_0xc111('0x39')]=_[_0xc111('0x38')](_0x14bfef[_0xc111('0x34')],qs['fields'](_0x11a984['query'][_0xc111('0x3a')]));_0x58f1e5[_0xc111('0x39')]=_0x58f1e5[_0xc111('0x39')][_0xc111('0x3b')]?_0x58f1e5[_0xc111('0x39')]:_0x14bfef[_0xc111('0x34')];if(!_0x11a984[_0xc111('0x35')][_0xc111('0x3c')](_0xc111('0x3d'))){_0x58f1e5['limit']=qs[_0xc111('0x26')](_0x11a984[_0xc111('0x35')][_0xc111('0x26')]);_0x58f1e5['offset']=qs[_0xc111('0x24')](_0x11a984[_0xc111('0x35')][_0xc111('0x24')]);}_0x58f1e5['order']=qs[_0xc111('0x3f')](_0x11a984[_0xc111('0x35')][_0xc111('0x3f')]);_0x58f1e5[_0xc111('0x42')]=qs['filters'](_[_0xc111('0x40')](_0x11a984[_0xc111('0x35')],_0x14bfef[_0xc111('0x37')]));_0x58f1e5[_0xc111('0x42')][_0xc111('0x52')]=_0x3aef6d['id'];if(_0x11a984[_0xc111('0x35')][_0xc111('0x41')]){_0x58f1e5[_0xc111('0x42')]=_[_0xc111('0x44')](_0x58f1e5[_0xc111('0x42')],{'$or':_[_0xc111('0x30')](_0x58f1e5[_0xc111('0x39')],function(_0x345f0f){var _0x489992={};_0x489992[_0x345f0f]={'$like':'%'+_0x11a984[_0xc111('0x35')]['filter']+'%'};return _0x489992;})});}_0x58f1e5=_['merge']({},_0x58f1e5,_0x11a984[_0xc111('0x45')]);return db['CannedAnswer'][_0xc111('0x27')]({'where':_0x58f1e5[_0xc111('0x42')]})[_0xc111('0x16')](function(_0x3d654d){_0x51c68d[_0xc111('0x27')]=_0x3d654d;if(_0x11a984[_0xc111('0x35')][_0xc111('0x46')]){_0x58f1e5[_0xc111('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc111('0x59')](_0x58f1e5);})[_0xc111('0x16')](function(_0x409659){_0x51c68d[_0xc111('0x48')]=_0x409659;return _0x51c68d;});}})[_0xc111('0x16')](respondWithFilteredResult(_0x5c6a87,_0x58f1e5))['catch'](handleError(_0x5c6a87,null));};exports[_0xc111('0x5a')]=function(_0xa3465f,_0x8a98a8){return db[_0xc111('0x31')]['find']({'where':{'id':_0xa3465f[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x8a98a8,null))['then'](function(_0x3aa3c4){if(_0x3aa3c4){return _0x3aa3c4[_0xc111('0x5a')](_0xa3465f[_0xc111('0x35')]['ids']);}})[_0xc111('0x16')](respondWithStatusCode(_0x8a98a8,null))[_0xc111('0x1f')](handleError(_0x8a98a8,null));};exports['addLogo']=function(_0xb77b7e,_0x11ff9e){_0xb77b7e['body']['sitepic']=_0xb77b7e[_0xc111('0x5b')]['filename'];return db[_0xc111('0x31')]['find']({'where':{'id':_0xb77b7e['params']['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x11ff9e,null))[_0xc111('0x16')](saveUpdates(_0xb77b7e[_0xc111('0x4b')],null))['then'](respondWithResult(_0x11ff9e,null))[_0xc111('0x1f')](handleError(_0x11ff9e,null));};exports[_0xc111('0x5c')]=function(_0x8bcb7a,_0x1d43aa){_0x8bcb7a['body'][_0xc111('0x5d')]=_0x8bcb7a[_0xc111('0x5b')]['filename'];return db[_0xc111('0x31')]['find']({'where':{'id':_0x8bcb7a['params']['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x1d43aa,null))['then'](saveUpdates(_0x8bcb7a[_0xc111('0x4b')],null))[_0xc111('0x16')](respondWithResult(_0x1d43aa,null))['catch'](handleError(_0x1d43aa,null));};exports[_0xc111('0x5e')]=function(_0x586e7d,_0x5974ff){_0x586e7d[_0xc111('0x4b')][_0xc111('0x5f')]=_0x586e7d[_0xc111('0x5b')]['filename'];return db[_0xc111('0x31')][_0xc111('0x49')]({'where':{'id':_0x586e7d[_0xc111('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5974ff,null))[_0xc111('0x16')](saveUpdates(_0x586e7d[_0xc111('0x4b')],null))[_0xc111('0x16')](respondWithResult(_0x5974ff,null))[_0xc111('0x1f')](handleError(_0x5974ff,null));};exports[_0xc111('0x60')]=function(_0x980b74,_0x5e904e){_0x980b74['body'][_0xc111('0x61')]=_0x980b74[_0xc111('0x5b')]['filename'];return db[_0xc111('0x31')]['find']({'where':{'id':_0x980b74[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x5e904e,null))[_0xc111('0x16')](saveUpdates(_0x980b74[_0xc111('0x4b')],null))[_0xc111('0x16')](respondWithResult(_0x5e904e,null))[_0xc111('0x1f')](handleError(_0x5e904e,null));};exports['getLogo']=function(_0x2490a8,_0x995a15){var _0x18f68b=path['join'](config[_0xc111('0x62')],_0xc111('0x63'));var _0x3ebd52={'where':{'id':_0x2490a8[_0xc111('0x4f')]['id']},'attributes':['id',_0xc111('0x64')],'raw':!![]};var _0x29872c=![];return require(_0xc111('0x65'))[_0xc111('0x66')]()[_0xc111('0x16')](function(_0x1dc61f){if(_0x1dc61f){_0x29872c=_0x1dc61f[_0xc111('0x67')];}})[_0xc111('0x16')](function(){return db[_0xc111('0x31')][_0xc111('0x49')](_0x3ebd52);})['then'](handleEntityNotFound(_0x995a15,null))[_0xc111('0x16')](function(_0x4db436){if(_0x4db436){if(!_[_0xc111('0x68')](_0x4db436[_0xc111('0x64')])){if(fs['existsSync'](path[_0xc111('0x69')](config[_0xc111('0x62')],_0xc111('0x6a'),_0x4db436[_0xc111('0x64')]))&&_0x29872c){_0x18f68b=path[_0xc111('0x69')](config[_0xc111('0x62')],_0xc111('0x6a'),_0x4db436['sitepic']);}}return _0x995a15[_0xc111('0x6b')](_0x18f68b);}})['catch'](handleError(_0x995a15,null));};exports[_0xc111('0x6c')]=function(_0x1dc0ba,_0x2a1de7){var _0x3b903b=path['join'](config[_0xc111('0x62')],'server/files/images/avatars/default_avatar.png');var _0x35e3d8={'where':{'id':_0x1dc0ba['params']['id']},'attributes':['id',_0xc111('0x5d')],'raw':!![]};return db[_0xc111('0x31')][_0xc111('0x49')](_0x35e3d8)['then'](handleEntityNotFound(_0x2a1de7,null))[_0xc111('0x16')](function(_0x154d49){if(_0x154d49){if(!_['isNil'](_0x154d49[_0xc111('0x5d')])){if(fs[_0xc111('0x6d')](path[_0xc111('0x69')](config[_0xc111('0x62')],'server/files/images/avatars/',_0x154d49[_0xc111('0x5d')]))){_0x3b903b=path['join'](config[_0xc111('0x62')],_0xc111('0x6e'),_0x154d49['agentAvatar']);}}return _0x2a1de7['download'](_0x3b903b);}})[_0xc111('0x1f')](handleError(_0x2a1de7,null));};exports[_0xc111('0x6f')]=function(_0x59b450,_0x1957bd){var _0x468cad=path[_0xc111('0x69')](config[_0xc111('0x62')],'server/files/images/avatars/customer_avatar.png');var _0x51a980={'where':{'id':_0x59b450[_0xc111('0x4f')]['id']},'attributes':['id',_0xc111('0x5f'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc111('0x49')](_0x51a980)[_0xc111('0x16')](handleEntityNotFound(_0x1957bd,null))[_0xc111('0x16')](function(_0xc25a86){if(_0xc25a86){if(!_[_0xc111('0x68')](_0xc25a86[_0xc111('0x5f')])){if(fs[_0xc111('0x6d')](path[_0xc111('0x69')](config['root'],'server/files/images/avatars/',_0xc25a86[_0xc111('0x5f')]))&&_0xc25a86[_0xc111('0x70')]){_0x468cad=path[_0xc111('0x69')](config[_0xc111('0x62')],'server/files/images/avatars/',_0xc25a86[_0xc111('0x5f')]);}}return _0x1957bd[_0xc111('0x6b')](_0x468cad);}})[_0xc111('0x1f')](handleError(_0x1957bd,null));};exports['getSystemAvatar']=function(_0x526fcc,_0x28fd01){var _0x34d0b6=path[_0xc111('0x69')](config[_0xc111('0x62')],_0xc111('0x71'));var _0x2efc30={'where':{'id':_0x526fcc['params']['id']},'attributes':['id',_0xc111('0x61')],'raw':!![]};return db[_0xc111('0x31')][_0xc111('0x49')](_0x2efc30)[_0xc111('0x16')](handleEntityNotFound(_0x28fd01,null))['then'](function(_0x5f8091){if(_0x5f8091){if(!_['isNil'](_0x5f8091[_0xc111('0x61')])){if(fs[_0xc111('0x6d')](path[_0xc111('0x69')](config[_0xc111('0x62')],_0xc111('0x6e'),_0x5f8091[_0xc111('0x61')]))){_0x34d0b6=path[_0xc111('0x69')](config[_0xc111('0x62')],_0xc111('0x6e'),_0x5f8091[_0xc111('0x61')]);}}return _0x28fd01['download'](_0x34d0b6);}})[_0xc111('0x1f')](handleError(_0x28fd01,null));};exports[_0xc111('0x72')]=function(_0x149299,_0x19a573){var _0x351157=require(_0xc111('0x73'));var _0x4df410=new _0x351157();var _0x3378b7=_0x4df410[_0xc111('0x74')](_0x149299[_0xc111('0x75')][_0xc111('0x76')])[_0xc111('0x77')]();var _0x377a88={'body':_0x149299[_0xc111('0x4b')],'channel':_0xc111('0x78')};var _0x4f4ea7=[];var _0x3ab21a=[];var _0x1d17f5={};var _0x18589f=![];return db['CmContact'][_0xc111('0x50')]()[_0xc111('0x16')](function(_0x506d23){if(!_0x506d23){throw new db['Sequelize'][(_0xc111('0x79'))](_0xc111('0x7a'));}_0x4f4ea7=_[_0xc111('0x7b')](_[_0xc111('0x36')](_0x506d23),[_0xc111('0x7c'),_0xc111('0x7d')]);_0x3ab21a=_[_0xc111('0x7b')](_[_0xc111('0x36')](_0x506d23),[_0xc111('0x7c'),'updatedAt',_0xc111('0x7e'),_0xc111('0x7f')]);if(_0x149299[_0xc111('0x4b')]['id']){delete _0x149299[_0xc111('0x4b')]['id'];}if(_[_0xc111('0x68')](_0x149299['body'][_0xc111('0x80')])){throw new db['Sequelize'][(_0xc111('0x79'))](_0xc111('0x81'));}if(_[_0xc111('0x68')](_0x149299[_0xc111('0x4b')][_0xc111('0x4b')])||_0x149299[_0xc111('0x4b')][_0xc111('0x4b')]===''){throw new db[(_0xc111('0x82'))][(_0xc111('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc111('0x68')](_0x149299[_0xc111('0x4b')]['mapKey'])){throw new db[(_0xc111('0x82'))][(_0xc111('0x79'))](_0xc111('0x83')+_0x3ab21a);}if(!_[_0xc111('0x84')](_0x3ab21a,_0x149299['body'][_0xc111('0x85')])){throw new db['Sequelize'][(_0xc111('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ab21a);}_0x1d17f5[_0x149299[_0xc111('0x4b')]['mapKey']]=_0x149299[_0xc111('0x4b')][_0xc111('0x80')];})[_0xc111('0x16')](function(){return db['ChatWebsite'][_0xc111('0x49')]({'where':{'id':_0x149299[_0xc111('0x4f')]['id']},'include':[{'model':db[_0xc111('0x86')],'as':_0xc111('0x87'),'include':[{'model':db[_0xc111('0x88')],'as':'Contacts','where':_0x1d17f5,'limit':0x1,'order':[[_0xc111('0x7d'),_0xc111('0x89')]]}]},{'model':db[_0xc111('0x8a')],'as':_0xc111('0x8b')}]});})[_0xc111('0x16')](handleEntityNotFound(_0x19a573,null))[_0xc111('0x16')](function(_0x310daa){if(_0x310daa&&_0x310daa[_0xc111('0x87')]){_0x377a88[_0xc111('0x8c')]=_0x310daa;_0x377a88[_0xc111('0x8d')]=_0x310daa[_0xc111('0x8b')];_0x377a88['list']=_0x310daa[_0xc111('0x87')];_0x377a88[_0xc111('0x8d')]=_[_0xc111('0x8e')](_0x377a88[_0xc111('0x8d')],[_0xc111('0x8f')],[_0xc111('0x90')]);if(_0x377a88[_0xc111('0x8c')][_0xc111('0x8b')]){delete _0x377a88[_0xc111('0x8c')][_0xc111('0x8b')];}if(_0x377a88[_0xc111('0x8c')][_0xc111('0x87')]&&_0x377a88[_0xc111('0x8c')]['List'][_0xc111('0x91')]['length']){return _0x377a88[_0xc111('0x8c')]['List'][_0xc111('0x91')][0x0];}var _0x5e1416=_[_0xc111('0xc')](_0x149299[_0xc111('0x4b')],{'firstName':_0x149299[_0xc111('0x4b')]['from'],'ListId':_0x310daa[_0xc111('0x7f')]});_0x5e1416[_0x149299['body'][_0xc111('0x85')]]=_0x149299[_0xc111('0x4b')][_0xc111('0x80')];return db[_0xc111('0x88')]['create'](_0x5e1416,{'fields':_0x4f4ea7,'raw':!![]});}})['then'](handleEntityNotFound(_0x19a573,null))[_0xc111('0x16')](function(_0xb6afb3){_0x377a88[_0xc111('0x92')]=_0xb6afb3;var _0x503f74=_0x149299['body']['customerIp'];if(_0x149299['headers'][_0xc111('0x93')]){_0x503f74=_0x149299['headers'][_0xc111('0x93')];}else if(_0x149299[_0xc111('0x75')][_0xc111('0x94')]){_0x503f74=_['first'](_0x149299['headers'][_0xc111('0x94')]['split'](','));}if(_0xb6afb3){var _0x442a3f={'ContactId':_0xb6afb3['id'],'ChatWebsiteId':_0x149299[_0xc111('0x4f')]['id'],'from':(_0xb6afb3[_0xc111('0x95')]||'')+'\x20'+(_0xb6afb3[_0xc111('0x96')]||''),'customerIp':_0x503f74,'customerPort':_0x149299['headers']['x-real-port']?_0x149299[_0xc111('0x75')][_0xc111('0x97')]:null,'referer':_0x149299[_0xc111('0x4b')][_0xc111('0x98')],'browserName':_0x3378b7[_0xc111('0x99')][_0xc111('0x2d')]&&_0x3378b7[_0xc111('0x99')]['version']?util[_0xc111('0x9a')]('%s\x20%s',_0x3378b7[_0xc111('0x99')]['name'],_0x3378b7[_0xc111('0x99')][_0xc111('0x9b')]):_0xc111('0x9c'),'browserVersion':_0x3378b7['browser'][_0xc111('0x9b')]||_0xc111('0x9c'),'osName':util[_0xc111('0x9a')]('%s\x20%s',_0x3378b7['os'][_0xc111('0x2d')],_0x3378b7['os'][_0xc111('0x9b')]),'osVersion':_0x3378b7['os'][_0xc111('0x9b')],'deviceModel':_0x3378b7[_0xc111('0x9d')]['model']&&_0x3378b7['device']['vendor']?util[_0xc111('0x9a')](_0xc111('0x9e'),_0x3378b7[_0xc111('0x9d')][_0xc111('0x34')],_0x3378b7[_0xc111('0x9d')][_0xc111('0x9f')],_0x3378b7['device'][_0xc111('0xa0')]):null,'deviceVendor':_0x3378b7[_0xc111('0x9d')][_0xc111('0x9f')],'deviceType':_0x3378b7[_0xc111('0x9d')][_0xc111('0xa0')],'formData':JSON[_0xc111('0xa1')](_0x149299[_0xc111('0x4b')])};var _0x2cbca0={'ChatWebsiteId':_0x149299[_0xc111('0x4f')]['id'],'closed':![]};if(_0x149299[_0xc111('0x4b')][_0xc111('0xa2')]){_0x2cbca0[_0xc111('0xa2')]=_0x149299[_0xc111('0x4b')][_0xc111('0xa2')];return db[_0xc111('0xa3')]['find']({'where':_0x2cbca0})[_0xc111('0x16')](function(_0xbd317d){if(_0xbd317d){return[_0xbd317d,![]];}_0x442a3f[_0xc111('0xa2')]=_0x149299[_0xc111('0x4b')][_0xc111('0xa2')];_0x442a3f[_0xc111('0xa4')]=_0x149299['body'][_0xc111('0xa4')];return db['ChatInteraction'][_0xc111('0x4a')](_0x442a3f)[_0xc111('0x16')](function(_0x27178a){return[_0x27178a,!![]];});});}_0x2cbca0[_0xc111('0xa5')]=_0xb6afb3['id'];if(_0x149299[_0xc111('0x4b')][_0xc111('0xa6')]&&_0x149299['body']['interaction']['id']){_0x2cbca0['id']=_0x149299[_0xc111('0x4b')][_0xc111('0xa6')]['id'];return db[_0xc111('0xa3')][_0xc111('0x49')]({'where':_0x2cbca0})[_0xc111('0x16')](function(_0x326b45){if(_0x326b45){return[_0x326b45,![]];}return db['ChatInteraction'][_0xc111('0x4a')](_0x442a3f)[_0xc111('0x16')](function(_0xd45761){return[_0xd45761,!![]];});});}return db[_0xc111('0xa3')][_0xc111('0x4a')](_0x442a3f)['then'](function(_0x273c46){return[_0x273c46,!![]];});}})[_0xc111('0xa7')](function(_0x1e85e9,_0x56f92a){if(_0x1e85e9){_0x18589f=_0x56f92a;if(!_0x56f92a){var _0x2c9736={'from':(_0x377a88[_0xc111('0x92')][_0xc111('0x95')]||'')+'\x20'+(_0x377a88[_0xc111('0x92')]['lastName']||'')};if(_0x149299['body']['threadId']&&_0x149299[_0xc111('0x4b')]['messageId']&&_0x149299[_0xc111('0x4b')][_0xc111('0xa2')]!=_0x149299[_0xc111('0x4b')]['messageId']){_0x2c9736[_0xc111('0xa2')]=_0x149299[_0xc111('0x4b')][_0xc111('0xa8')];}return _0x1e85e9[_0xc111('0x28')](_0x2c9736);}else{return _0x1e85e9;}}})[_0xc111('0x16')](function(_0x11e7f2){_0x377a88['interaction']=_0x11e7f2['get']({'plain':!![]});_0x377a88[_0xc111('0xa6')][_0xc111('0xa9')]=_0x18589f;if(_0x377a88[_0xc111('0xa6')][_0xc111('0xa9')]){if(_0x377a88[_0xc111('0x8c')][_0xc111('0xaa')]){_0x377a88['applications'][_0xc111('0xab')]({'id':0x0,'priority':_0x377a88[_0xc111('0x8d')][_0xc111('0x3b')]+0x1,'app':_0xc111('0xac'),'appdata':'unmanaged','interval':_0xc111('0xad')});}}return db[_0xc111('0xae')]['create']({'body':_0x149299[_0xc111('0x4b')][_0xc111('0x4b')],'ChatWebsiteId':_0x149299['params']['id'],'ChatInteractionId':_0x11e7f2['id'],'direction':'in','ContactId':_0x377a88[_0xc111('0x92')]['id'],'AttachmentId':_0x149299['body']['AttachmentId']});})['then'](function(_0x2fdfc7){_0x377a88[_0xc111('0x1d')]=_0x2fdfc7;if(_0x377a88[_0xc111('0xa6')]['UserId']){return db[_0xc111('0xaf')][_0xc111('0x49')]({'attributes':['id',_0xc111('0x2d')],'where':{'id':_0x377a88[_0xc111('0xa6')][_0xc111('0xb0')]}})[_0xc111('0x16')](function(_0x5b6e4d){if(_0x5b6e4d){_0x377a88['applications'][_0xc111('0xb1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5b6e4d[_0xc111('0x2d')]+','+(_0x377a88['account'][_0xc111('0xb2')]||0xa),'interval':'*,*,*,*'});_0x377a88[_0xc111('0xb3')]=!![];}return respondWithRpcPromise(_0xc111('0xb4'),'startRouting',_0x377a88);});}return respondWithRpcPromise(_0xc111('0xb4'),_0xc111('0xb5'),_0x377a88);})['then'](function(_0x3b21fc){respondWithRpcPromise('EventManager',_0xc111('0xb6'),{'event':'notify','message':_0x3b21fc},client9002);return _0x3b21fc;})['then'](respondWithResult(_0x19a573,null))[_0xc111('0x1f')](handleError(_0x19a573,null));};exports[_0xc111('0xb7')]=function(_0x3ef85d,_0x4b4798){var _0x48e8fb,_0x413798,_0x3b0b13;var _0x41cf65=[];var _0x17a2d3={};var _0x41bab8=_0x3ef85d[_0xc111('0xb8')]||[];var _0x52405f=[];var _0x5cd28f;return db[_0xc111('0x88')][_0xc111('0x50')]()['then'](function(_0x2586f8){if(!_0x2586f8){throw new db[(_0xc111('0x82'))][(_0xc111('0x79'))](_0xc111('0x7a'));}_0x41cf65=_[_0xc111('0x7b')](_['keys'](_0x2586f8),[_0xc111('0x7c'),_0xc111('0x7d'),_0xc111('0x7e'),_0xc111('0x7f')]);if(_0x3ef85d[_0xc111('0x4b')]['id']){delete _0x3ef85d['body']['id'];}if(_['isNil'](_0x3ef85d[_0xc111('0x4b')][_0xc111('0x80')])){throw _0x4b4798[_0xc111('0x21')](0x1f4)[_0xc111('0x2e')](new db[(_0xc111('0x82'))][(_0xc111('0x79'))](_0xc111('0x81')));}if(_[_0xc111('0x68')](_0x3ef85d[_0xc111('0x4b')][_0xc111('0x4b')])||_0x3ef85d['body'][_0xc111('0x4b')]===''){throw _0x4b4798['status'](0x1f4)[_0xc111('0x2e')](new db[(_0xc111('0x82'))][(_0xc111('0x79'))](_0xc111('0xb9')));}if(_['isNil'](_0x3ef85d[_0xc111('0x4b')][_0xc111('0xba')])){throw _0x4b4798[_0xc111('0x21')](0x1f4)[_0xc111('0x2e')](new db['Sequelize'][(_0xc111('0x79'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x41cf65));}if(!_['includes'](_0x41cf65,_0x3ef85d[_0xc111('0x4b')][_0xc111('0xba')])){throw _0x4b4798[_0xc111('0x21')](0x1f4)[_0xc111('0x2e')](new db[(_0xc111('0x82'))][(_0xc111('0x79'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x41cf65));}_0x17a2d3[_0x3ef85d[_0xc111('0x4b')][_0xc111('0xba')]]=_0x3ef85d[_0xc111('0x4b')]['from'];})[_0xc111('0x16')](function(){return db[_0xc111('0x31')][_0xc111('0x49')]({'where':{'id':_0x3ef85d[_0xc111('0x4f')]['id']},'include':[{'model':db['CmList'],'as':_0xc111('0x87')},{'model':db[_0xc111('0xbb')],'as':'MailAccount'}]});})[_0xc111('0x16')](handleEntityNotFound(_0x4b4798,null))[_0xc111('0x16')](function(_0xe11f49){if(_0xe11f49&&_0xe11f49['List']){_0x413798=_0xe11f49;var _0x10be3c=_['defaults'](_0x3ef85d[_0xc111('0x4b')],{'firstName':_0x3ef85d[_0xc111('0x4b')][_0xc111('0x80')],'phone':_0x3ef85d[_0xc111('0x4b')][_0xc111('0x80')],'ListId':_0xe11f49[_0xc111('0x7f')]});_0x10be3c[_0x3ef85d[_0xc111('0x4b')]['mapKeyOffline']]=_0x3ef85d[_0xc111('0x4b')][_0xc111('0x80')];return db['CmContact'][_0xc111('0xbc')]({'where':_0x17a2d3,'defaults':_0x10be3c});}})[_0xc111('0xa7')](function(_0x1ea352){if(_0x1ea352){_0x3b0b13=_0x1ea352;var _0x45d1ac=fs['readFileSync'](path[_0xc111('0x69')](config['root'],_0xc111('0xbd')),_0xc111('0xbe'));var _0xc6bc96=ejs[_0xc111('0xbf')](_0x45d1ac,{'body':_[_0xc111('0xc0')](_0x3ef85d[_0xc111('0x4b')][_0xc111('0x4b')]),'bodyTitle':_0x413798['offlineMessageBody']});return db[_0xc111('0xc1')][_0xc111('0x4a')]({'body':_0xc6bc96,'plainBody':htmlToText[_0xc111('0xc2')](_0xc6bc96),'ContactId':_0x1ea352['id'],'ChatWebsiteId':_0x413798['id']});}})[_0xc111('0x16')](function(_0x10cf55){_0x5cd28f=_0x10cf55;if(_0x41bab8['length']){var _0x13bc6a=_0x41bab8['map'](function(_0x307941){return{'name':_0x307941[_0xc111('0xc3')],'basename':_0x307941[_0xc111('0xc4')],'type':_0x307941[_0xc111('0xc5')],'ChatOfflineMessageId':_0x10cf55['id']};});_0x52405f=_0x13bc6a[_0xc111('0x30')](_0x4b17a2=>{var _0x193a43={'filename':_0x4b17a2[_0xc111('0x2d')],'path':path['join'](config[_0xc111('0x62')],'server','files',_0xc111('0xc6'),_0xc111('0xc7'),_0x4b17a2[_0xc111('0xc8')])};return _0x193a43;});if(!_0x413798['openNewInteraction']){return db['sequelize'][_0xc111('0xc9')](function(_0x5f3193){return db[_0xc111('0xca')][_0xc111('0xcb')](_0x13bc6a,{'transaction':_0x5f3193});});}}})[_0xc111('0x16')](function(){if(_0x5cd28f){_0x48e8fb=_0x5cd28f;return db['MailAccount'][_0xc111('0x58')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc111('0xcc')],'as':_0xc111('0xcc'),'raw':!![]}]}]});}})[_0xc111('0x16')](function(_0x45df3a){if(_0x45df3a&&_0x45df3a['Smtp']&&_0x413798[_0xc111('0xcd')]&&_0x413798[_0xc111('0xce')]){var _0x29a32b=_0x45df3a[_0xc111('0xcf')]();return respondWithRpcPromise(_0xc111('0xd0'),'sendMail',{'account':_0x29a32b,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x45df3a[_0xc111('0x2d')],_0x45df3a[_0xc111('0xd1')]||_0x45df3a[_0xc111('0xd2')][_0xc111('0xd3')]),'to':_0x413798[_0xc111('0xce')],'subject':_0x413798[_0xc111('0xd4')],'html':_0x48e8fb[_0xc111('0x4b')],'attachments':_0x52405f}},client9003)[_0xc111('0x16')](function(){return _0x48e8fb;})['catch'](function(_0x31dbcf){logger[_0xc111('0x1c')](_0x31dbcf);});}})[_0xc111('0x16')](function(){if(_0x413798&&_0x413798[_0xc111('0xd5')]&&_0x413798[_0xc111('0xd6')]){var _0x287896=[];if(_0x41bab8['length']){_0x287896=_0x41bab8['map'](function(_0x4e51e5){return{'name':_0x4e51e5[_0xc111('0xc3')],'basename':_0x4e51e5[_0xc111('0xc4')],'type':_0x4e51e5[_0xc111('0xc5')],'ChatOfflineMessageId':_0x5cd28f['id']};});}var _0x1cb410;if(!_[_0xc111('0x68')](_0x413798[_0xc111('0xd7')])){var _0x4e6e83=_['map'](_0x3ef85d[_0xc111('0x4b')],function(_0x121dbb){return _0x121dbb;});var _0x22d022=_[_0xc111('0xd8')](_0x4e6e83)[0x0];var _0x1f4fa8=_['mapValues'](_0x22d022,function(_0x401428){return _0x401428;});_0x1cb410=_0x1f4fa8[0x1][_0x413798[_0xc111('0xd7')]];}var _0x5b8c37={'from':_0x3b0b13['email'],'firstName':_0x3b0b13['firstName'],'lastName':_0x3b0b13[_0xc111('0x96')],'mapKey':_0xc111('0xd1'),'message':{'from':_0x3b0b13[_0xc111('0xd1')],'to':_0x413798[_0xc111('0xbb')][_0xc111('0xd1')],'cc':'','subject':_[_0xc111('0x68')](_0x1cb410)?_0x413798[_0xc111('0xd4')]:_0x1cb410,'messageId':'','sentAt':new Date(),'attach':_0x287896[_0xc111('0x3b')],'attachments':_0x287896,'originChannel':_0xc111('0xd9'),'ChatWebsiteId':_0x413798['id'],'ChatOfflineMessageId':_0x48e8fb['id'],'originTo':_0x413798[_0xc111('0xbb')][_0xc111('0xd1')]},'body':_0x48e8fb['body']};var _0x4ae422={'account':{'id':_0x413798['MailAccountId']},'body':_0x5b8c37,'log':_0xc111('0xda')};return respondWithRpcPromise('NotifyMailAccount',_0xc111('0xdb'),_0x4ae422,client9001)[_0xc111('0x16')](function(){return _0x48e8fb;})[_0xc111('0x1f')](function(_0x2c2cf2){logger[_0xc111('0x1c')](_0x2c2cf2);});}return;})[_0xc111('0x16')](function(){if(_0x48e8fb){return _0x48e8fb;}})[_0xc111('0x16')](respondWithResult(_0x4b4798,null))[_0xc111('0x1f')](function(_0x309a9c){logger[_0xc111('0x1c')](_0xc111('0x1f'),_0x309a9c);for(var _0x2182d0 of _0x41bab8){var _0x27bf6d=path[_0xc111('0x69')](config[_0xc111('0x62')],_0xc111('0xdc'),_0xc111('0xb8'),_0xc111('0xc6'),'offline-chat',_0x2182d0[_0xc111('0xc4')]);fs_extra[_0xc111('0xdd')](_0x27bf6d)[_0xc111('0x1f')](function(_0x332355){logger[_0xc111('0x1c')]('Could\x20not\x20remove\x20attachment\x20file',_0x27bf6d,_0x332355);});}});};exports[_0xc111('0xde')]=function(_0x4dab1e,_0x1a8d20){return db['ChatInteraction'][_0xc111('0x49')]({'where':{'id':_0x4dab1e[_0xc111('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a8d20,null))[_0xc111('0x16')](function(_0xde0d18){if(_0xde0d18){return _0xde0d18[_0xc111('0xde')](_0x4dab1e['body']['ids'],_[_0xc111('0xdf')](_0x4dab1e[_0xc111('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x1a8d20,null))['catch'](handleError(_0x1a8d20,null));};exports[_0xc111('0xe0')]=function(_0x40e23f,_0x3441e2){var _0x36b957={'raw':![],'where':{}};var _0x1d7e5e={};var _0x2ec692={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc111('0x58')]({'where':{'id':_0x40e23f[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x3441e2,null))[_0xc111('0x16')](function(_0xe9aa76){if(_0xe9aa76){_0x1d7e5e[_0xc111('0x34')]=_[_0xc111('0x36')](db[_0xc111('0xa3')][_0xc111('0x32')]);_0x1d7e5e[_0xc111('0x35')]=_['keys'](_0x40e23f[_0xc111('0x35')]);_0x1d7e5e[_0xc111('0x37')]=_['intersection'](_0x1d7e5e['model'],_0x1d7e5e[_0xc111('0x35')]);_0x36b957[_0xc111('0x39')]=_[_0xc111('0x38')](_0x1d7e5e['model'],qs[_0xc111('0x3a')](_0x40e23f[_0xc111('0x35')]['fields']));_0x36b957[_0xc111('0x39')]=_0x36b957['attributes'][_0xc111('0x3b')]?_0x36b957['attributes']:_0x1d7e5e[_0xc111('0x34')];if(!_0x40e23f[_0xc111('0x35')][_0xc111('0x3c')](_0xc111('0x3d'))){_0x36b957['limit']=qs[_0xc111('0x26')](_0x40e23f[_0xc111('0x35')][_0xc111('0x26')]);_0x36b957[_0xc111('0x24')]=qs[_0xc111('0x24')](_0x40e23f[_0xc111('0x35')]['offset']);}_0x36b957[_0xc111('0x3e')]=qs[_0xc111('0x3f')](_0x40e23f[_0xc111('0x35')][_0xc111('0x3f')]);_0x36b957['where']=qs[_0xc111('0x37')](_[_0xc111('0x40')](_0x40e23f[_0xc111('0x35')],_0x1d7e5e['filters']));_0x36b957[_0xc111('0x42')]['ChatWebsiteId']=_0xe9aa76['id'];if(_0x40e23f['query'][_0xc111('0x41')]){_0x36b957[_0xc111('0x42')]=_[_0xc111('0x44')](_0x36b957['where'],{'$or':_[_0xc111('0x30')](_0x36b957['attributes'],function(_0x341fee){var _0x3fb9e7={};_0x3fb9e7[_0x341fee]={'$like':'%'+_0x40e23f[_0xc111('0x35')][_0xc111('0x41')]+'%'};return _0x3fb9e7;})});}_0x36b957=_[_0xc111('0x44')]({},_0x36b957,_0x40e23f[_0xc111('0x45')]);return db['ChatInteraction']['count']({'where':_0x36b957[_0xc111('0x42')]})[_0xc111('0x16')](function(_0x1ead05){_0x2ec692[_0xc111('0x27')]=_0x1ead05;if(_0x40e23f[_0xc111('0x35')][_0xc111('0x46')]){_0x36b957[_0xc111('0x47')]=[{'model':db[_0xc111('0x88')],'as':_0xc111('0xe1'),'required':![]},{'model':db['User'],'as':_0xc111('0xe2'),'attributes':['name',_0xc111('0xe3'),_0xc111('0xe4')],'required':![]},{'model':db[_0xc111('0xe5')],'as':_0xc111('0xe6'),'attributes':['id',_0xc111('0x2d'),_0xc111('0xe7')],'where':_0x40e23f[_0xc111('0x35')][_0xc111('0xe8')]?{'id':_0x40e23f[_0xc111('0x35')]['tag']}:undefined,'required':_0x40e23f['query']['tag']?!![]:![]}];}return db[_0xc111('0xa3')][_0xc111('0x59')](_0x36b957);})[_0xc111('0x16')](function(_0x20c872){_0x2ec692['rows']=_0x20c872;return _0x2ec692;});}})[_0xc111('0x16')](respondWithFilteredResult(_0x3441e2,_0x36b957))[_0xc111('0x1f')](handleError(_0x3441e2,null));};function iftimePromise(_0x5b7a64,_0x2df09a){return respondWithRpcPromise('Command',_0xc111('0xe9'),{'command':_0x2df09a['timezone']?util[_0xc111('0x9a')](_0xc111('0xea'),_0x5b7a64[_0xc111('0xeb')],_0x2df09a['timezone']):util[_0xc111('0x9a')](_0xc111('0xec'),_0x5b7a64['interval'])},client9002)[_0xc111('0x16')](function(_0x455c46){var _0x5b82be=_0x455c46&&_0x455c46[_0xc111('0xed')]('true')>=0x0?!![]:![];logger[_0xc111('0x17')](_0xc111('0xee'),_0x2df09a['id'],_0x5b7a64['id'],_0x5b7a64[_0xc111('0xeb')],_0x5b82be?_0xc111('0xef'):'OFFLINE',_0x2df09a[_0xc111('0xf0')]?_0x2df09a['timezone']:_0xc111('0xf1'));return _0x5b82be;})[_0xc111('0x1f')](function(_0x979a8b){logger[_0xc111('0x1c')](_0xc111('0xee'),_0x2df09a['id'],_0x5b7a64['id'],_0x5b7a64[_0xc111('0xeb')],util[_0xc111('0xf2')](_0x979a8b,{'showHidden':![],'depth':null}),_0x2df09a[_0xc111('0xf0')]?_0x2df09a[_0xc111('0xf0')]:_0xc111('0xf1'));return![];});}exports[_0xc111('0xe9')]=function(_0x37b9fd,_0x867a16){var _0x22f61c=0x0;var _0x31708d=0x0;var _0x365479=![];var _0x3aa662;var _0x1e1af3;return db[_0xc111('0x31')][_0xc111('0x49')]({'where':{'id':_0x37b9fd[_0xc111('0x4f')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xc111('0xeb')],'raw':!![]}]}]})[_0xc111('0x16')](handleEntityNotFound(_0x867a16,null))['then'](function(_0x3fe7e4){if(_0x3fe7e4){_0x3aa662=_0x3fe7e4;return _0x3fe7e4[_0xc111('0xf3')]({'raw':!![]});}})[_0xc111('0x16')](function(_0x137d28){if(_0x3aa662){if(_0x137d28){_0x1e1af3=_0x137d28;}}return require(_0xc111('0x65'))[_0xc111('0x66')]();})[_0xc111('0x16')](function(_0x44e5b9){if(_0x44e5b9){_0x31708d=_0x44e5b9[_0xc111('0xf4')];_0x365479=_0x44e5b9['custom'];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xc111('0x16')](function(_0x2d648a){_0x22f61c=_0x2d648a;if(_0x31708d&&_0x2d648a>_0x31708d){return db[_0xc111('0xf5')]['findOne']({'where':{'id':0x1}})[_0xc111('0x16')](function(_0x554532){if(_0x554532){_0x554532['increment'](_0xc111('0xf6'));}});}})[_0xc111('0x16')](function(){if(_0x3aa662[_0xc111('0xf7')]&&_0x3aa662[_0xc111('0xf7')]['Intervals']){var _0xfd1329=[];for(var _0xd42fd5=0x0;_0xd42fd5<_0x3aa662[_0xc111('0xf7')]['Intervals'][_0xc111('0x3b')];_0xd42fd5++){var _0x4c0ccc=_0x3aa662[_0xc111('0xf7')][_0xc111('0xf8')][_0xd42fd5]['get']({'plain':!![]});_0xfd1329[_0xc111('0xab')](iftimePromise(_0x4c0ccc,_0x3aa662));}return BPromise[_0xc111('0xf9')](_0xfd1329)[_0xc111('0x16')](function(_0x38299c){return _[_0xc111('0xfa')](_0x38299c);});}else{return!![];}})[_0xc111('0x16')](function(_0x4f8ae4){var _0x16ae8e=fs[_0xc111('0xfb')](path[_0xc111('0x69')](config[_0xc111('0x62')],'server/files/chat/iframe.ejs'),'utf8');var _0xa10f9b=new url[(_0xc111('0xfc'))](_0x3aa662[_0xc111('0xfd')])[_0xc111('0xfe')];var _0x16576d=_0xc111('0xff');var _0x101096=![];var _0xdc5e97={'chatVersion':_0x16576d,'chatWebsiteAddressOrigin':_0xa10f9b,'remote':_0x3aa662['remote'],'query':querystring[_0xc111('0xa1')](_['merge'](_0x3aa662[_0xc111('0x2a')]({'plain':!![]}),{'customerIp':_0x37b9fd[_0xc111('0x75')][_0xc111('0x94')]||_0x37b9fd['headers'][_0xc111('0x100')]||_0x37b9fd[_0xc111('0x101')][_0xc111('0x102')]||_0x37b9fd['ip'],'referer':_0x37b9fd['headers'][_0xc111('0x98')],'openedInteractions':_0x22f61c,'maxInteractions':_0x31708d,'virtual':_0x365479[_0xc111('0xf4')],'online':_0x4f8ae4,'custom':_0x365479}))[_0xc111('0x103')](/'/g,'\x5c\x27')};_0x867a16[_0xc111('0x2e')](ejs[_0xc111('0xbf')](Mustache['render'](_0x16ae8e,_0xdc5e97),{'proactiveActions':_0x1e1af3,'alignment':_0x3aa662['alignment'],'verticalAlignment':_0x3aa662[_0xc111('0x104')],'div_color':_0x3aa662[_0xc111('0xe7')],'labelText':_0x3aa662['labelText'],'text_color':_0x3aa662[_0xc111('0x105')],'text_button_color':_0x3aa662[_0xc111('0x106')],'button_color':_0x3aa662[_0xc111('0x107')],'background_color':_0x3aa662['backgroundColor'],'hideWhenOffline':_0x3aa662[_0xc111('0x108')],'intervalId':_0x3aa662[_0xc111('0x109')],'isDevelopment':_0x101096,'chatVersion':_0x16576d}));})[_0xc111('0x1f')](handleError(_0x867a16,null));};exports[_0xc111('0x10a')]=function(_0x4e1f32,_0x33093e){var _0x25bcc2=_0x4e1f32[_0xc111('0x4f')]['id'];var _0x4c9f6c=_0x4e1f32[_0xc111('0x4b')];var _0x5ecc2e=0xc8;var _0x5a0fb6=null;return db[_0xc111('0x10b')][_0xc111('0xc9')]({'isolationLevel':db[_0xc111('0x10b')][_0xc111('0x10c')][_0xc111('0x10d')][_0xc111('0x10e')]},function(_0x3dd7cc){return db[_0xc111('0x31')][_0xc111('0x58')]({'where':{'id':_0x25bcc2},'transaction':_0x3dd7cc})[_0xc111('0x16')](function(_0x306584){if(_0x306584){return db['ChatApplication'][_0xc111('0x29')]({'where':{'ChatWebsiteId':_0x25bcc2},'transaction':_0x3dd7cc})[_0xc111('0x16')](function(){var _0x12d29e=_[_0xc111('0x30')](_0x4c9f6c,function(_0xc942bc){_0xc942bc[_0xc111('0x52')]=_0x25bcc2;return _0xc942bc;});return db[_0xc111('0x8a')][_0xc111('0xcb')](_0x12d29e,{'transaction':_0x3dd7cc});});}else{_0x5ecc2e=0x194;_0x5a0fb6=[];}});})[_0xc111('0x16')](function(){if(_0x5ecc2e!==0x194){return db[_0xc111('0x8a')][_0xc111('0x10f')]({'where':{'ChatWebsiteId':_0x25bcc2},'order':_0xc111('0x8f')})[_0xc111('0x16')](function(_0x24ff1f){_0x5a0fb6=_0x24ff1f;});}})[_0xc111('0x1f')](function(_0x332ee4){_0x5ecc2e=0x1f4;logger[_0xc111('0x1c')](_0x332ee4[_0xc111('0x2c')]);if(_0x332ee4['name']){delete _0x332ee4[_0xc111('0x2d')];}_0x5a0fb6=_0x332ee4;})[_0xc111('0x110')](function(){if(_0x5a0fb6===null){_0x33093e['sendStatus'](_0x5ecc2e);}else{if(_0x5ecc2e===0x1f4){_0x33093e[_0xc111('0x21')](_0x5ecc2e)[_0xc111('0x2e')](_0x5a0fb6);}else{_0x33093e[_0xc111('0x21')](_0x5ecc2e)[_0xc111('0x23')](_0x5a0fb6);}}});};exports[_0xc111('0x111')]=function(_0x577756,_0x3362f){var _0x1800fa={};var _0x1e5a70={};var _0x22068d;var _0x463bf4;return db['ChatWebsite'][_0xc111('0x58')]({'where':{'id':_0x577756['params']['id']}})['then'](handleEntityNotFound(_0x3362f,null))[_0xc111('0x16')](function(_0x531f6c){if(_0x531f6c){_0x22068d=_0x531f6c;_0x1e5a70[_0xc111('0x34')]=_[_0xc111('0x36')](db[_0xc111('0x8a')][_0xc111('0x32')]);_0x1e5a70[_0xc111('0x35')]=_[_0xc111('0x36')](_0x577756[_0xc111('0x35')]);_0x1e5a70[_0xc111('0x37')]=_['intersection'](_0x1e5a70[_0xc111('0x34')],_0x1e5a70[_0xc111('0x35')]);_0x1800fa[_0xc111('0x39')]=_[_0xc111('0x38')](_0x1e5a70[_0xc111('0x34')],qs[_0xc111('0x3a')](_0x577756[_0xc111('0x35')][_0xc111('0x3a')]));_0x1800fa[_0xc111('0x39')]=_0x1800fa['attributes'][_0xc111('0x3b')]?_0x1800fa[_0xc111('0x39')]:_0x1e5a70[_0xc111('0x34')];_0x1800fa[_0xc111('0x3e')]=qs['sort'](_0x577756[_0xc111('0x35')][_0xc111('0x3f')]);_0x1800fa[_0xc111('0x42')]=qs[_0xc111('0x37')](_[_0xc111('0x40')](_0x577756[_0xc111('0x35')],_0x1e5a70['filters']));if(_0x577756['query'][_0xc111('0x41')]){_0x1800fa[_0xc111('0x42')]=_[_0xc111('0x44')](_0x1800fa[_0xc111('0x42')],{'$or':_[_0xc111('0x30')](_0x1800fa['attributes'],function(_0x49ba8a){var _0x137f9c={};_0x137f9c[_0x49ba8a]={'$like':'%'+_0x577756[_0xc111('0x35')][_0xc111('0x41')]+'%'};return _0x137f9c;})});}_0x1800fa=_[_0xc111('0x44')]({},_0x1800fa,_0x577756['options']);return _0x22068d['getApplications'](_0x1800fa);}})[_0xc111('0x16')](function(_0x4a1688){if(_0x4a1688){_0x463bf4=_0x4a1688[_0xc111('0x3b')];if(!_0x577756[_0xc111('0x35')][_0xc111('0x3c')](_0xc111('0x3d'))){_0x1800fa[_0xc111('0x26')]=qs[_0xc111('0x26')](_0x577756[_0xc111('0x35')]['limit']);_0x1800fa['offset']=qs['offset'](_0x577756[_0xc111('0x35')][_0xc111('0x24')]);}return _0x22068d[_0xc111('0x111')](_0x1800fa);}})[_0xc111('0x16')](function(_0x550745){if(_0x550745){return _0x550745?{'count':_0x463bf4,'rows':_0x550745}:null;}})[_0xc111('0x16')](respondWithResult(_0x3362f,null))[_0xc111('0x1f')](handleError(_0x3362f,null));};exports[_0xc111('0x112')]=function(_0x581d8f,_0x34cb82){return db[_0xc111('0x113')][_0xc111('0x49')]({'where':{'id':_0x581d8f[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x34cb82,null))[_0xc111('0x16')](function(_0xcc2acf){if(_0xcc2acf){return _0xcc2acf[_0xc111('0x112')](_0x581d8f[_0xc111('0x4b')][_0xc111('0x56')],_[_0xc111('0xdf')](_0x581d8f['body'],['ids','id'])||{});}})[_0xc111('0x16')](respondWithResult(_0x34cb82,null))[_0xc111('0x1f')](handleError(_0x34cb82,null));};exports[_0xc111('0xf3')]=function(_0xa7caf0,_0xa25616){var _0x30fc2c={};var _0x1e7417={};var _0x592858;var _0xe01e10;return db[_0xc111('0x31')][_0xc111('0x58')]({'where':{'id':_0xa7caf0[_0xc111('0x4f')]['id']}})['then'](handleEntityNotFound(_0xa25616,null))[_0xc111('0x16')](function(_0x2ae219){if(_0x2ae219){_0x592858=_0x2ae219;_0x1e7417['model']=_[_0xc111('0x36')](db[_0xc111('0x114')][_0xc111('0x32')]);_0x1e7417[_0xc111('0x35')]=_[_0xc111('0x36')](_0xa7caf0[_0xc111('0x35')]);_0x1e7417[_0xc111('0x37')]=_[_0xc111('0x38')](_0x1e7417[_0xc111('0x34')],_0x1e7417[_0xc111('0x35')]);_0x30fc2c[_0xc111('0x39')]=_[_0xc111('0x38')](_0x1e7417['model'],qs[_0xc111('0x3a')](_0xa7caf0[_0xc111('0x35')][_0xc111('0x3a')]));_0x30fc2c[_0xc111('0x39')]=_0x30fc2c[_0xc111('0x39')][_0xc111('0x3b')]?_0x30fc2c[_0xc111('0x39')]:_0x1e7417[_0xc111('0x34')];_0x30fc2c['order']=qs['sort'](_0xa7caf0['query'][_0xc111('0x3f')]);_0x30fc2c[_0xc111('0x42')]=qs[_0xc111('0x37')](_['pick'](_0xa7caf0[_0xc111('0x35')],_0x1e7417[_0xc111('0x37')]));if(_0xa7caf0[_0xc111('0x35')][_0xc111('0x41')]){_0x30fc2c[_0xc111('0x42')]=_[_0xc111('0x44')](_0x30fc2c[_0xc111('0x42')],{'$or':_['map'](_0x30fc2c[_0xc111('0x39')],function(_0x1abe06){var _0x19becb={};_0x19becb[_0x1abe06]={'$like':'%'+_0xa7caf0['query'][_0xc111('0x41')]+'%'};return _0x19becb;})});}_0x30fc2c=_['merge']({},_0x30fc2c,_0xa7caf0['options']);return _0x592858[_0xc111('0xf3')](_0x30fc2c);}})[_0xc111('0x16')](function(_0x338d27){if(_0x338d27){_0xe01e10=_0x338d27[_0xc111('0x3b')];if(!_0xa7caf0[_0xc111('0x35')]['hasOwnProperty'](_0xc111('0x3d'))){_0x30fc2c[_0xc111('0x26')]=qs[_0xc111('0x26')](_0xa7caf0[_0xc111('0x35')][_0xc111('0x26')]);_0x30fc2c[_0xc111('0x24')]=qs[_0xc111('0x24')](_0xa7caf0[_0xc111('0x35')][_0xc111('0x24')]);}return _0x592858['getProactiveActions'](_0x30fc2c);}})['then'](function(_0x1f629f){if(_0x1f629f){return _0x1f629f?{'count':_0xe01e10,'rows':_0x1f629f}:null;}})['then'](respondWithResult(_0xa25616,null))[_0xc111('0x1f')](handleError(_0xa25616,null));};exports['getFields']=function(_0x4ad580,_0x469c42){var _0xe21edf=_0x4ad580[_0xc111('0x35')][_0xc111('0x115')]===_0xc111('0x116')?'offlineForm':_0xc111('0x117');return db[_0xc111('0x31')][_0xc111('0x49')]({'attributes':['id',_0xe21edf],'where':{'id':_0x4ad580['params']['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x469c42,null))['then'](function(_0x35ec02){if(_0x35ec02){var _0x55b745=_0x35ec02[_0xe21edf];var _0x1a186e=_0x55b745&&_0x55b745[_0xc111('0x118')]?_0x55b745[_0xc111('0x118')]:[];_0x469c42[_0xc111('0x2e')]({'fromKey':_[_0xc111('0x68')](_0x55b745[_0xc111('0x119')])?undefined:_0x55b745[_0xc111('0x119')],'count':_0x1a186e['length'],'rows':_0x1a186e});}})[_0xc111('0x1f')](handleError(_0x469c42,null));};exports[_0xc111('0x11a')]=function(_0x3409bd,_0x33c8ae){var _0x1a9439={'raw':![],'where':{}};var _0x3ca826={};var _0x29633b={'count':0x0,'rows':[]};return db[_0xc111('0x31')][_0xc111('0x58')]({'where':{'id':_0x3409bd[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x33c8ae,null))[_0xc111('0x16')](function(_0x10418f){if(_0x10418f){_0x3ca826[_0xc111('0x34')]=_[_0xc111('0x36')](db['ChatOfflineMessage'][_0xc111('0x32')]);_0x3ca826[_0xc111('0x35')]=_[_0xc111('0x36')](_0x3409bd['query']);_0x3ca826[_0xc111('0x37')]=_[_0xc111('0x38')](_0x3ca826[_0xc111('0x34')],_0x3ca826['query']);_0x1a9439[_0xc111('0x39')]=_['intersection'](_0x3ca826[_0xc111('0x34')],qs[_0xc111('0x3a')](_0x3409bd['query'][_0xc111('0x3a')]));_0x1a9439[_0xc111('0x39')]=_0x1a9439[_0xc111('0x39')][_0xc111('0x3b')]?_0x1a9439['attributes']:_0x3ca826[_0xc111('0x34')];if(!_0x3409bd['query'][_0xc111('0x3c')]('nolimit')){_0x1a9439[_0xc111('0x26')]=qs[_0xc111('0x26')](_0x3409bd[_0xc111('0x35')]['limit']);_0x1a9439[_0xc111('0x24')]=qs[_0xc111('0x24')](_0x3409bd['query'][_0xc111('0x24')]);}_0x1a9439['order']=qs[_0xc111('0x3f')](_0x3409bd[_0xc111('0x35')][_0xc111('0x3f')]);_0x1a9439['where']=qs['filters'](_['pick'](_0x3409bd[_0xc111('0x35')],_0x3ca826[_0xc111('0x37')]));_0x1a9439[_0xc111('0x42')][_0xc111('0x52')]=_0x10418f['id'];if(_0x3409bd['query']['filter']){_0x1a9439[_0xc111('0x42')]=_[_0xc111('0x44')](_0x1a9439[_0xc111('0x42')],{'$or':_[_0xc111('0x30')](_0x1a9439[_0xc111('0x39')],function(_0x52ec5a){var _0x2a9650={};_0x2a9650[_0x52ec5a]={'$like':'%'+_0x3409bd['query'][_0xc111('0x41')]+'%'};return _0x2a9650;})});}_0x1a9439=_['merge']({},_0x1a9439,_0x3409bd[_0xc111('0x45')]);return db['ChatOfflineMessage'][_0xc111('0x27')]({'where':_0x1a9439['where']})[_0xc111('0x16')](function(_0x1119ee){_0x29633b[_0xc111('0x27')]=_0x1119ee;if(_0x3409bd['query'][_0xc111('0x46')]){_0x1a9439['include']=[{'all':!![]}];}else{_0x1a9439['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xc111('0xca')],'as':_0xc111('0x11b'),'required':![]}];}return db[_0xc111('0xc1')][_0xc111('0x59')](_0x1a9439);})[_0xc111('0x16')](function(_0x567ac3){_0x29633b['rows']=_0x567ac3;return _0x29633b;});}})[_0xc111('0x16')](respondWithFilteredResult(_0x33c8ae,_0x1a9439))[_0xc111('0x1f')](handleError(_0x33c8ae,null));};exports[_0xc111('0x11c')]=function(_0x4bd3e3,_0x123f4b){return db['ChatWebsite'][_0xc111('0x49')]({'where':{'id':_0x4bd3e3['params']['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x123f4b,null))['then'](function(_0x1fc271){if(_0x1fc271){return _0x1fc271[_0xc111('0x11c')](_0x4bd3e3['body'][_0xc111('0x56')],_[_0xc111('0xdf')](_0x4bd3e3[_0xc111('0x4b')],[_0xc111('0x56'),'id'])||{})['spread'](function(_0x1e1c53){for(var _0x2a751f=0x0;_0x2a751f<_0x4bd3e3[_0xc111('0x4b')][_0xc111('0x56')]['length'];_0x2a751f+=0x1){socket['emit'](_0xc111('0x11d'),{'UserId':Number(_0x4bd3e3['body']['ids'][_0x2a751f]),'ChatWebsiteId':Number(_0x4bd3e3[_0xc111('0x4f')]['id'])});}return _0x1e1c53;});}})[_0xc111('0x16')](respondWithResult(_0x123f4b,null))[_0xc111('0x1f')](handleError(_0x123f4b,null));};exports[_0xc111('0x11e')]=function(_0xb48ef3,_0x4a02a3){return db[_0xc111('0x31')][_0xc111('0x49')]({'where':{'id':_0xb48ef3[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x4a02a3,null))['then'](function(_0x4168bd){if(_0x4168bd){return _0x4168bd[_0xc111('0x11e')](_0xb48ef3['query']['ids'])[_0xc111('0x16')](function(){if(_[_0xc111('0x11f')](_0xb48ef3[_0xc111('0x35')][_0xc111('0x56')])){for(var _0x33ab85=0x0;_0x33ab85<_0xb48ef3[_0xc111('0x35')][_0xc111('0x56')][_0xc111('0x3b')];_0x33ab85+=0x1){socket['emit'](_0xc111('0x120'),{'UserId':Number(_0xb48ef3[_0xc111('0x35')]['ids'][_0x33ab85]),'ChatWebsiteId':Number(_0xb48ef3[_0xc111('0x4f')]['id'])});}}else{socket[_0xc111('0x121')](_0xc111('0x120'),{'UserId':Number(_0xb48ef3[_0xc111('0x35')][_0xc111('0x56')]),'ChatWebsiteId':Number(_0xb48ef3[_0xc111('0x4f')]['id'])});}});}})[_0xc111('0x16')](respondWithStatusCode(_0x4a02a3,null))[_0xc111('0x1f')](handleError(_0x4a02a3,null));};exports[_0xc111('0x122')]=function(_0x431ce8,_0x3bd838){var _0x14c706={};var _0x137546={};var _0x337c56;var _0x2ccbb8;return db['ChatWebsite']['findOne']({'where':{'id':_0x431ce8[_0xc111('0x4f')]['id']}})[_0xc111('0x16')](handleEntityNotFound(_0x3bd838,null))['then'](function(_0x152235){if(_0x152235){_0x337c56=_0x152235;_0x137546['model']=_[_0xc111('0x36')](db[_0xc111('0xaf')][_0xc111('0x32')]);_0x137546[_0xc111('0x35')]=_[_0xc111('0x36')](_0x431ce8[_0xc111('0x35')]);_0x137546['filters']=_[_0xc111('0x38')](_0x137546[_0xc111('0x34')],_0x137546[_0xc111('0x35')]);_0x14c706[_0xc111('0x39')]=_[_0xc111('0x38')](_0x137546[_0xc111('0x34')],qs[_0xc111('0x3a')](_0x431ce8['query'][_0xc111('0x3a')]));_0x14c706[_0xc111('0x39')]=_0x14c706['attributes'][_0xc111('0x3b')]?_0x14c706[_0xc111('0x39')]:_0x137546[_0xc111('0x34')];_0x14c706[_0xc111('0x3e')]=qs[_0xc111('0x3f')](_0x431ce8[_0xc111('0x35')]['sort']);_0x14c706[_0xc111('0x42')]=qs[_0xc111('0x37')](_[_0xc111('0x40')](_0x431ce8[_0xc111('0x35')],_0x137546['filters']));if(_0x431ce8['query'][_0xc111('0x41')]){_0x14c706[_0xc111('0x42')]=_[_0xc111('0x44')](_0x14c706[_0xc111('0x42')],{'$or':_[_0xc111('0x30')](_0x14c706[_0xc111('0x39')],function(_0x28beaa){var _0x9e9fef={};_0x9e9fef[_0x28beaa]={'$like':'%'+_0x431ce8[_0xc111('0x35')][_0xc111('0x41')]+'%'};return _0x9e9fef;})});}_0x14c706=_['merge']({},_0x14c706,_0x431ce8[_0xc111('0x45')]);return _0x337c56['getAgents'](_0x14c706);}})[_0xc111('0x16')](function(_0x47ed20){if(_0x47ed20){_0x2ccbb8=_0x47ed20[_0xc111('0x3b')];if(!_0x431ce8[_0xc111('0x35')][_0xc111('0x3c')](_0xc111('0x3d'))){_0x14c706['limit']=qs[_0xc111('0x26')](_0x431ce8[_0xc111('0x35')][_0xc111('0x26')]);_0x14c706[_0xc111('0x24')]=qs[_0xc111('0x24')](_0x431ce8['query'][_0xc111('0x24')]);}return _0x337c56[_0xc111('0x122')](_0x14c706);}})[_0xc111('0x16')](function(_0xdf70fa){if(_0xdf70fa){return _0xdf70fa?{'count':_0x2ccbb8,'rows':_0xdf70fa}:null;}})[_0xc111('0x16')](respondWithResult(_0x3bd838,null))[_0xc111('0x1f')](handleError(_0x3bd838,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e4b03d0..7cc3570 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 _0x089f=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x5a99e3,_0x500b2e){var _0x5d7124=function(_0x4bbbcb){while(--_0x4bbbcb){_0x5a99e3['push'](_0x5a99e3['shift']());}};_0x5d7124(++_0x500b2e);}(_0x089f,0x1c7));var _0xf089=function(_0x5d7371,_0x4c175d){_0x5d7371=_0x5d7371-0x0;var _0x320906=_0x089f[_0x5d7371];return _0x320906;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xf089('0x0'))['db'][_0xf089('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf089('0x2')](0x0);var events={'afterCreate':_0xf089('0x3'),'afterUpdate':_0xf089('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b7602){return function(_0x3195ed,_0x250428,_0x5ea026){ChatWebsiteEvents[_0xf089('0x5')](_0x2b7602+':'+_0x3195ed['id'],_0x3195ed);ChatWebsiteEvents[_0xf089('0x5')](_0x2b7602,_0x3195ed);_0x5ea026(null);};}for(var e in events){if(events[_0xf089('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xf089('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc6ab=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xc6ab,0x96));var _0xbc6a=function(_0x57d1d0,_0x1d6171){_0x57d1d0=_0x57d1d0-0x0;var _0x18b6b2=_0xc6ab[_0x57d1d0];return _0x18b6b2;};'use strict';var EventEmitter=require(_0xbc6a('0x0'));var ChatWebsite=require(_0xbc6a('0x1'))['db'][_0xbc6a('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbc6a('0x3')](0x0);var events={'afterCreate':_0xbc6a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xbf9d02){return function(_0x1c351c,_0x3808e0,_0x3f7109){ChatWebsiteEvents[_0xbc6a('0x5')](_0xbf9d02+':'+_0x1c351c['id'],_0x1c351c);ChatWebsiteEvents['emit'](_0xbf9d02,_0x1c351c);_0x3f7109(null);};}for(var e in events){if(events[_0xbc6a('0x6')](e)){var event=events[e];ChatWebsite[_0xbc6a('0x7')](e,emitEvent(event));}}module[_0xbc6a('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9b8ef58..3709017 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 _0x02cc=['../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4044f9,_0x4f2f51){var _0x3cfbda=function(_0x23ac21){while(--_0x23ac21){_0x4044f9['push'](_0x4044f9['shift']());}};_0x3cfbda(++_0x4f2f51);}(_0x02cc,0xe2));var _0xc02c=function(_0x3c6c7e,_0x412212){_0x3c6c7e=_0x3c6c7e-0x0;var _0x14a775=_0x02cc[_0x3c6c7e];return _0x14a775;};'use strict';var _=require(_0xc02c('0x0'));var util=require(_0xc02c('0x1'));var logger=require(_0xc02c('0x2'))(_0xc02c('0x3'));var moment=require(_0xc02c('0x4'));var BPromise=require('bluebird');var rp=require(_0xc02c('0x5'));var fs=require('fs');var path=require(_0xc02c('0x6'));var rimraf=require(_0xc02c('0x7'));var config=require(_0xc02c('0x8'));var attributes=require(_0xc02c('0x9'));module[_0xc02c('0xa')]=function(_0x5b6147,_0x5cc69b){return _0x5b6147[_0xc02c('0xb')]('ChatWebsite',attributes,{'tableName':_0xc02c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x475e=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites'];(function(_0xcf6b4d,_0x39a1c9){var _0x2073a9=function(_0x2932c6){while(--_0x2932c6){_0xcf6b4d['push'](_0xcf6b4d['shift']());}};_0x2073a9(++_0x39a1c9);}(_0x475e,0x1b0));var _0xe475=function(_0x7c439f,_0x33e90f){_0x7c439f=_0x7c439f-0x0;var _0x4ebaf1=_0x475e[_0x7c439f];return _0x4ebaf1;};'use strict';var _=require(_0xe475('0x0'));var util=require(_0xe475('0x1'));var logger=require(_0xe475('0x2'))(_0xe475('0x3'));var moment=require(_0xe475('0x4'));var BPromise=require('bluebird');var rp=require(_0xe475('0x5'));var fs=require('fs');var path=require(_0xe475('0x6'));var rimraf=require(_0xe475('0x7'));var config=require(_0xe475('0x8'));var attributes=require(_0xe475('0x9'));module[_0xe475('0xa')]=function(_0x47d0b2,_0x370138){return _0x47d0b2['define']('ChatWebsite',attributes,{'tableName':_0xe475('0xb'),'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 c8667de..dae9279 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 _0x0c67=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x3215c0,_0x459616){var _0x238271=function(_0x42e3a8){while(--_0x42e3a8){_0x3215c0['push'](_0x3215c0['shift']());}};_0x238271(++_0x459616);}(_0x0c67,0xca));var _0x70c6=function(_0x54b958,_0xa85521){_0x54b958=_0x54b958-0x0;var _0x634508=_0x0c67[_0x54b958];return _0x634508;};'use strict';var _=require(_0x70c6('0x0'));var util=require(_0x70c6('0x1'));var moment=require(_0x70c6('0x2'));var BPromise=require(_0x70c6('0x3'));var rs=require(_0x70c6('0x4'));var fs=require('fs');var Redis=require(_0x70c6('0x5'));var db=require(_0x70c6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x70c6('0x7'))('rpc');var config=require(_0x70c6('0x8'));var jayson=require(_0x70c6('0x9'));var client=jayson[_0x70c6('0xa')][_0x70c6('0xb')]({'port':0x232a});config[_0x70c6('0xc')]=_[_0x70c6('0xd')](config[_0x70c6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x70c6('0xe'))(new Redis(config[_0x70c6('0xc')]));require(_0x70c6('0xf'))[_0x70c6('0x10')](socket);function respondWithRpcPromise(_0x23d00b,_0x1b6511,_0xd55457){return new BPromise(function(_0x4fd066,_0x279bb5){return client[_0x70c6('0x11')](_0x23d00b,_0xd55457)[_0x70c6('0x12')](function(_0x38f209){logger[_0x70c6('0x13')](_0x70c6('0x14'),_0x1b6511,_0x70c6('0x15'));logger[_0x70c6('0x16')](_0x70c6('0x17'),_0x1b6511,_0x70c6('0x15'),JSON[_0x70c6('0x18')](_0x38f209));if(_0x38f209[_0x70c6('0x19')]){if(_0x38f209[_0x70c6('0x19')]['code']===0x1f4){logger[_0x70c6('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x1b6511,_0x38f209['error'][_0x70c6('0x1a')]);return _0x279bb5(_0x38f209['error']['message']);}logger[_0x70c6('0x19')](_0x70c6('0x14'),_0x1b6511,_0x38f209[_0x70c6('0x19')][_0x70c6('0x1a')]);return _0x4fd066(_0x38f209[_0x70c6('0x19')][_0x70c6('0x1a')]);}else{logger['info'](_0x70c6('0x14'),_0x1b6511,_0x70c6('0x15'));_0x4fd066(_0x38f209['result'][_0x70c6('0x1a')]);}})[_0x70c6('0x1b')](function(_0x233e43){logger['error'](_0x70c6('0x14'),_0x1b6511,_0x233e43);_0x279bb5(_0x233e43);});});}
\ No newline at end of file
+var _0xd210=['code','message','info','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x28c643,_0x439dcf){var _0x2973b2=function(_0x7212f0){while(--_0x7212f0){_0x28c643['push'](_0x28c643['shift']());}};_0x2973b2(++_0x439dcf);}(_0xd210,0xb3));var _0x0d21=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0xd210[_0x46111d];return _0xe82586;};'use strict';var _=require('lodash');var util=require(_0x0d21('0x0'));var moment=require(_0x0d21('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d21('0x2'))['db'];var utils=require(_0x0d21('0x3'));var logger=require(_0x0d21('0x4'))(_0x0d21('0x5'));var config=require(_0x0d21('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0d21('0x7')]({'port':0x232a});config[_0x0d21('0x8')]=_[_0x0d21('0x9')](config[_0x0d21('0x8')],{'host':_0x0d21('0xa'),'port':0x18eb});var socket=require(_0x0d21('0xb'))(new Redis(config[_0x0d21('0x8')]));require('./chatWebsite.socket')[_0x0d21('0xc')](socket);function respondWithRpcPromise(_0x87282b,_0x22be6d,_0x4c4486){return new BPromise(function(_0x2bebd3,_0x420173){return client[_0x0d21('0xd')](_0x87282b,_0x4c4486)[_0x0d21('0xe')](function(_0x364881){logger['info'](_0x0d21('0xf'),_0x22be6d,_0x0d21('0x10'));logger[_0x0d21('0x11')](_0x0d21('0x12'),_0x22be6d,'request\x20sent',JSON[_0x0d21('0x13')](_0x364881));if(_0x364881[_0x0d21('0x14')]){if(_0x364881['error'][_0x0d21('0x15')]===0x1f4){logger[_0x0d21('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x22be6d,_0x364881[_0x0d21('0x14')]['message']);return _0x420173(_0x364881[_0x0d21('0x14')][_0x0d21('0x16')]);}logger[_0x0d21('0x14')](_0x0d21('0xf'),_0x22be6d,_0x364881[_0x0d21('0x14')][_0x0d21('0x16')]);return _0x2bebd3(_0x364881[_0x0d21('0x14')]['message']);}else{logger[_0x0d21('0x17')](_0x0d21('0xf'),_0x22be6d,'request\x20sent');_0x2bebd3(_0x364881['result'][_0x0d21('0x16')]);}})[_0x0d21('0x18')](function(_0x2ae747){logger[_0x0d21('0x14')](_0x0d21('0xf'),_0x22be6d,_0x2ae747);_0x420173(_0x2ae747);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d232a92..f811c5b 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 _0x5ece=['emit','removeListener','register','length','chatWebsite:','save','remove','update'];(function(_0x398644,_0x3f740c){var _0x296320=function(_0x2f01f2){while(--_0x2f01f2){_0x398644['push'](_0x398644['shift']());}};_0x296320(++_0x3f740c);}(_0x5ece,0x1c5));var _0xe5ec=function(_0x56c658,_0x4edbaf){_0x56c658=_0x56c658-0x0;var _0x3a880b=_0x5ece[_0x56c658];return _0x3a880b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xe5ec('0x0'),_0xe5ec('0x1'),_0xe5ec('0x2')];function createListener(_0x2be0d2,_0x3e0d17){return function(_0x1eaab7){_0x3e0d17[_0xe5ec('0x3')](_0x2be0d2,_0x1eaab7);};}function removeListener(_0x4e88d2,_0x103acd){return function(){ChatWebsiteEvents[_0xe5ec('0x4')](_0x4e88d2,_0x103acd);};}exports[_0xe5ec('0x5')]=function(_0x4f6566){for(var _0x37b5f4=0x0,_0x407254=events[_0xe5ec('0x6')];_0x37b5f4<_0x407254;_0x37b5f4++){var _0x54117b=events[_0x37b5f4];var _0x200411=createListener(_0xe5ec('0x7')+_0x54117b,_0x4f6566);ChatWebsiteEvents['on'](_0x54117b,_0x200411);}};
\ No newline at end of file
+var _0x4f64=['./chatWebsite.events','remove','update','emit','removeListener','length'];(function(_0xd1a9e6,_0x4bc61b){var _0x8948a5=function(_0x5bba4c){while(--_0x5bba4c){_0xd1a9e6['push'](_0xd1a9e6['shift']());}};_0x8948a5(++_0x4bc61b);}(_0x4f64,0x16e));var _0x44f6=function(_0x5ea9e4,_0x234fdc){_0x5ea9e4=_0x5ea9e4-0x0;var _0x38fff0=_0x4f64[_0x5ea9e4];return _0x38fff0;};'use strict';var ChatWebsiteEvents=require(_0x44f6('0x0'));var events=['save',_0x44f6('0x1'),_0x44f6('0x2')];function createListener(_0x5d3fc4,_0x3a184a){return function(_0x5bdef6){_0x3a184a[_0x44f6('0x3')](_0x5d3fc4,_0x5bdef6);};}function removeListener(_0x2f3c,_0x267aa4){return function(){ChatWebsiteEvents[_0x44f6('0x4')](_0x2f3c,_0x267aa4);};}exports['register']=function(_0x3abdb3){for(var _0x2f4eb1=0x0,_0x257828=events[_0x44f6('0x5')];_0x2f4eb1<_0x257828;_0x2f4eb1++){var _0x46228a=events[_0x2f4eb1];var _0x44fa70=createListener('chatWebsite:'+_0x46228a,_0x3abdb3);ChatWebsiteEvents['on'](_0x46228a,_0x44fa70);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c466b04..2a0a133 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 _0xa302=['getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','diskStorage','join','root','server/files/images/logos/','%s-%s','single','file','addLogo','server/files/images/avatars/','format','now','originalname','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions'];(function(_0x13b74e,_0x375707){var _0x56863c=function(_0x1ffd60){while(--_0x1ffd60){_0x13b74e['push'](_0x13b74e['shift']());}};_0x56863c(++_0x375707);}(_0xa302,0xc6));var _0x2a30=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa302[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x2a30('0x0'));var util=require('util');var path=require(_0x2a30('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2a30('0x2')]();var fs_extra=require(_0x2a30('0x3'));var auth=require(_0x2a30('0x4'));var interaction=require(_0x2a30('0x5'));var config=require(_0x2a30('0x6'));var controller=require('./chatWebsite.controller');router[_0x2a30('0x7')]('/',auth[_0x2a30('0x8')](),controller[_0x2a30('0x9')]);router[_0x2a30('0x7')](_0x2a30('0xa'),auth[_0x2a30('0x8')](),controller[_0x2a30('0xb')]);router[_0x2a30('0x7')](_0x2a30('0xc'),auth[_0x2a30('0x8')](),controller[_0x2a30('0xd')]);router['get'](_0x2a30('0xe'),auth[_0x2a30('0x8')](),controller[_0x2a30('0xf')]);router[_0x2a30('0x7')]('/:id/canned_answers',auth[_0x2a30('0x8')](),controller['getAnswers']);router[_0x2a30('0x7')](_0x2a30('0x10'),controller[_0x2a30('0x11')]);router[_0x2a30('0x7')](_0x2a30('0x12'),controller[_0x2a30('0x13')]);router[_0x2a30('0x7')](_0x2a30('0x14'),controller[_0x2a30('0x15')]);router[_0x2a30('0x7')](_0x2a30('0x16'),controller[_0x2a30('0x17')]);router['get'](_0x2a30('0x18'),auth[_0x2a30('0x8')](),controller[_0x2a30('0x19')]);router[_0x2a30('0x7')](_0x2a30('0x1a'),controller[_0x2a30('0x1b')]);router[_0x2a30('0x7')](_0x2a30('0x1c'),auth[_0x2a30('0x8')](),controller['getApplications']);router[_0x2a30('0x7')](_0x2a30('0x1d'),auth['isAuthenticated'](),controller[_0x2a30('0x1e')]);router[_0x2a30('0x7')](_0x2a30('0x1f'),controller[_0x2a30('0x20')]);router['get'](_0x2a30('0x21'),auth[_0x2a30('0x8')](),controller[_0x2a30('0x22')]);router[_0x2a30('0x7')](_0x2a30('0x23'),auth[_0x2a30('0x8')](),controller[_0x2a30('0x24')]);router[_0x2a30('0x25')]('/',auth[_0x2a30('0x8')](),controller[_0x2a30('0x26')]);router[_0x2a30('0x25')](_0x2a30('0xe'),auth[_0x2a30('0x8')](),controller[_0x2a30('0x27')]);router[_0x2a30('0x25')](_0x2a30('0x28'),auth[_0x2a30('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x2a30('0x29')]({'destination':function(_0x2eb31b,_0x5ed3db,_0x2517dc){_0x2517dc(null,path[_0x2a30('0x2a')](config[_0x2a30('0x2b')],_0x2a30('0x2c')));},'filename':function(_0x4913d3,_0x2482c5,_0x4ebf1f){_0x4ebf1f(null,util['format'](_0x2a30('0x2d'),Date['now'](),_0x2482c5['originalname']));}})});router[_0x2a30('0x25')](_0x2a30('0x10'),upload[_0x2a30('0x2e')](_0x2a30('0x2f')),controller[_0x2a30('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22aa85,_0x4b7c0d,_0x2534d8){_0x2534d8(null,path[_0x2a30('0x2a')](config[_0x2a30('0x2b')],_0x2a30('0x31')));},'filename':function(_0x884dc4,_0x430623,_0x5aa595){_0x5aa595(null,util[_0x2a30('0x32')](_0x2a30('0x2d'),Date[_0x2a30('0x33')](),_0x430623[_0x2a30('0x34')]));}})});router[_0x2a30('0x25')](_0x2a30('0x12'),upload[_0x2a30('0x2e')]('file'),controller[_0x2a30('0x35')]);var upload=multer({'storage':multer[_0x2a30('0x29')]({'destination':function(_0x39fd65,_0x59ed54,_0x42426d){_0x42426d(null,path[_0x2a30('0x2a')](config[_0x2a30('0x2b')],_0x2a30('0x31')));},'filename':function(_0x4a189c,_0x56efa3,_0x4d3603){_0x4d3603(null,util[_0x2a30('0x32')]('%s-%s',Date[_0x2a30('0x33')](),_0x56efa3[_0x2a30('0x34')]));}})});router[_0x2a30('0x25')](_0x2a30('0x14'),upload['single'](_0x2a30('0x2f')),controller[_0x2a30('0x36')]);var upload=multer({'storage':multer[_0x2a30('0x29')]({'destination':function(_0x413d79,_0x371b67,_0x253231){_0x253231(null,path['join'](config[_0x2a30('0x2b')],_0x2a30('0x31')));},'filename':function(_0x4d4748,_0xc55fee,_0x11019c){_0x11019c(null,util[_0x2a30('0x32')](_0x2a30('0x2d'),Date[_0x2a30('0x33')](),_0xc55fee[_0x2a30('0x34')]));}})});router[_0x2a30('0x25')]('/:id/system_avatar',upload[_0x2a30('0x2e')](_0x2a30('0x2f')),controller[_0x2a30('0x37')]);router[_0x2a30('0x25')](_0x2a30('0x38'),controller[_0x2a30('0x39')]);const offlineUploadMulter=multer({'storage':multer[_0x2a30('0x29')]({'destination':function(_0x5d4f38,_0x2b1bae,_0x2e8293){const _0x32769e=path[_0x2a30('0x2a')](config[_0x2a30('0x2b')],_0x2a30('0x3a'),_0x2a30('0x3b'),_0x2a30('0x3c'));fs_extra['ensureDir'](_0x32769e,function(){_0x2e8293(null,_0x32769e);});},'filename':function(_0x4b4b11,_0x281703,_0x5f1670){const _0x226207=_0x281703['originalname'][_0x2a30('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2f1ad4=path[_0x2a30('0x3e')](_0x226207);const _0x29d136=Date[_0x2a30('0x33')]()+'-'+_0x226207['replace'](_0x2f1ad4,'')+_0x2f1ad4;_0x5f1670(null,_0x29d136);}})});router[_0x2a30('0x25')](_0x2a30('0x3f'),offlineUploadMulter[_0x2a30('0x40')](),controller[_0x2a30('0x41')]);router[_0x2a30('0x25')]('/:id/interactions',auth[_0x2a30('0x8')](),controller[_0x2a30('0x42')]);router[_0x2a30('0x25')](_0x2a30('0x1c'),auth[_0x2a30('0x8')](),controller['addApplications']);router[_0x2a30('0x25')](_0x2a30('0x1d'),auth[_0x2a30('0x8')](),controller[_0x2a30('0x43')]);router[_0x2a30('0x25')](_0x2a30('0x23'),auth[_0x2a30('0x8')](),controller[_0x2a30('0x44')]);router[_0x2a30('0x45')](_0x2a30('0xc'),auth[_0x2a30('0x8')](),controller[_0x2a30('0x46')]);router[_0x2a30('0x47')](_0x2a30('0xc'),auth[_0x2a30('0x8')](),controller[_0x2a30('0x48')]);router[_0x2a30('0x47')]('/:id/dispositions',auth[_0x2a30('0x8')](),controller[_0x2a30('0x49')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x2a30('0x47')](_0x2a30('0x23'),auth['isAuthenticated'](),controller[_0x2a30('0x4a')]);module[_0x2a30('0x4b')]=router;
\ No newline at end of file
+var _0x08cd=['/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','join','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','/describe','isAuthenticated','get','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar'];(function(_0x19fea1,_0xd3e74f){var _0x447bae=function(_0x4d4b0f){while(--_0x4d4b0f){_0x19fea1['push'](_0x19fea1['shift']());}};_0x447bae(++_0xd3e74f);}(_0x08cd,0x1d5));var _0xd08c=function(_0x519109,_0x19f3fe){_0x519109=_0x519109-0x0;var _0x180260=_0x08cd[_0x519109];return _0x180260;};'use strict';var multer=require('multer');var util=require(_0xd08c('0x0'));var path=require(_0xd08c('0x1'));var timeout=require(_0xd08c('0x2'));var express=require(_0xd08c('0x3'));var router=express[_0xd08c('0x4')]();var fs_extra=require(_0xd08c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd08c('0x6'));var config=require('../../config/environment');var controller=require(_0xd08c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd08c('0x8'),auth[_0xd08c('0x9')](),controller['describe']);router[_0xd08c('0xa')](_0xd08c('0xb'),auth[_0xd08c('0x9')](),controller['show']);router[_0xd08c('0xa')]('/:id/dispositions',auth[_0xd08c('0x9')](),controller[_0xd08c('0xc')]);router[_0xd08c('0xa')](_0xd08c('0xd'),auth[_0xd08c('0x9')](),controller[_0xd08c('0xe')]);router[_0xd08c('0xa')](_0xd08c('0xf'),controller[_0xd08c('0x10')]);router[_0xd08c('0xa')](_0xd08c('0x11'),controller['getAvatar']);router[_0xd08c('0xa')](_0xd08c('0x12'),controller[_0xd08c('0x13')]);router[_0xd08c('0xa')](_0xd08c('0x14'),controller['getSystemAvatar']);router['get'](_0xd08c('0x15'),auth[_0xd08c('0x9')](),controller[_0xd08c('0x16')]);router[_0xd08c('0xa')](_0xd08c('0x17'),controller[_0xd08c('0x18')]);router['get'](_0xd08c('0x19'),auth[_0xd08c('0x9')](),controller['getApplications']);router['get'](_0xd08c('0x1a'),auth[_0xd08c('0x9')](),controller[_0xd08c('0x1b')]);router['get'](_0xd08c('0x1c'),controller[_0xd08c('0x1d')]);router[_0xd08c('0xa')](_0xd08c('0x1e'),auth[_0xd08c('0x9')](),controller['getOfflineMessages']);router[_0xd08c('0xa')](_0xd08c('0x1f'),auth[_0xd08c('0x9')](),controller[_0xd08c('0x20')]);router[_0xd08c('0x21')]('/',auth['isAuthenticated'](),controller[_0xd08c('0x22')]);router[_0xd08c('0x21')](_0xd08c('0x23'),auth[_0xd08c('0x9')](),controller['addDisposition']);router[_0xd08c('0x21')]('/:id/canned_answers',auth[_0xd08c('0x9')](),controller[_0xd08c('0x24')]);var upload=multer({'storage':multer[_0xd08c('0x25')]({'destination':function(_0x26fa99,_0x15f3e4,_0x3b7815){_0x3b7815(null,path['join'](config[_0xd08c('0x26')],_0xd08c('0x27')));},'filename':function(_0x567cb0,_0x594a26,_0x291d18){_0x291d18(null,util[_0xd08c('0x28')](_0xd08c('0x29'),Date[_0xd08c('0x2a')](),_0x594a26[_0xd08c('0x2b')]));}})});router[_0xd08c('0x21')]('/:id/logo',upload[_0xd08c('0x2c')](_0xd08c('0x2d')),controller[_0xd08c('0x2e')]);var upload=multer({'storage':multer[_0xd08c('0x25')]({'destination':function(_0x8f35f4,_0x1651e0,_0x3aa1dc){_0x3aa1dc(null,path['join'](config[_0xd08c('0x26')],_0xd08c('0x2f')));},'filename':function(_0x2b1f63,_0x23b022,_0x43afd1){_0x43afd1(null,util[_0xd08c('0x28')]('%s-%s',Date['now'](),_0x23b022['originalname']));}})});router[_0xd08c('0x21')](_0xd08c('0x11'),upload[_0xd08c('0x2c')]('file'),controller[_0xd08c('0x30')]);var upload=multer({'storage':multer[_0xd08c('0x25')]({'destination':function(_0x4412ff,_0x3463b6,_0x591860){_0x591860(null,path[_0xd08c('0x31')](config[_0xd08c('0x26')],_0xd08c('0x2f')));},'filename':function(_0x2f3f83,_0x3f4749,_0x5ce243){_0x5ce243(null,util[_0xd08c('0x28')]('%s-%s',Date[_0xd08c('0x2a')](),_0x3f4749[_0xd08c('0x2b')]));}})});router['post'](_0xd08c('0x12'),upload[_0xd08c('0x2c')](_0xd08c('0x2d')),controller[_0xd08c('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x287d10,_0x4c17f2,_0x4c074b){_0x4c074b(null,path[_0xd08c('0x31')](config[_0xd08c('0x26')],'server/files/images/avatars/'));},'filename':function(_0xd70628,_0x4724a8,_0x13f059){_0x13f059(null,util[_0xd08c('0x28')](_0xd08c('0x29'),Date['now'](),_0x4724a8[_0xd08c('0x2b')]));}})});router[_0xd08c('0x21')](_0xd08c('0x14'),upload[_0xd08c('0x2c')](_0xd08c('0x2d')),controller[_0xd08c('0x33')]);router[_0xd08c('0x21')]('/:id/notify',controller[_0xd08c('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xd08c('0x25')]({'destination':function(_0x57292f,_0xb1e671,_0x4cb37e){const _0x543742=path[_0xd08c('0x31')](config[_0xd08c('0x26')],_0xd08c('0x35'),_0xd08c('0x36'),_0xd08c('0x37'));fs_extra[_0xd08c('0x38')](_0x543742,function(){_0x4cb37e(null,_0x543742);});},'filename':function(_0x6183d0,_0x55c0b5,_0x4486c7){const _0x174457=_0x55c0b5[_0xd08c('0x2b')][_0xd08c('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2f24fa=path[_0xd08c('0x3a')](_0x174457);const _0x4bf365=Date[_0xd08c('0x2a')]()+'-'+_0x174457[_0xd08c('0x39')](_0x2f24fa,'')+_0x2f24fa;_0x4486c7(null,_0x4bf365);}})});router['post'](_0xd08c('0x3b'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0xd08c('0x15'),auth[_0xd08c('0x9')](),controller['addInteraction']);router[_0xd08c('0x21')](_0xd08c('0x19'),auth[_0xd08c('0x9')](),controller[_0xd08c('0x3c')]);router[_0xd08c('0x21')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xd08c('0x3d')]);router['post'](_0xd08c('0x1f'),auth[_0xd08c('0x9')](),controller[_0xd08c('0x3e')]);router[_0xd08c('0x3f')]('/:id',auth[_0xd08c('0x9')](),controller[_0xd08c('0x40')]);router[_0xd08c('0x41')](_0xd08c('0xb'),auth['isAuthenticated'](),controller[_0xd08c('0x42')]);router[_0xd08c('0x41')](_0xd08c('0x23'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xd08c('0x41')](_0xd08c('0xd'),auth[_0xd08c('0x9')](),controller[_0xd08c('0x43')]);router[_0xd08c('0x41')](_0xd08c('0x1f'),auth[_0xd08c('0x9')](),controller[_0xd08c('0x44')]);module[_0xd08c('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c32c7fb..f2ffc08 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 _0x354c=['production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','Router','env'];(function(_0x9662d0,_0x35783f){var _0x4125bc=function(_0x5ee25f){while(--_0x5ee25f){_0x9662d0['push'](_0x9662d0['shift']());}};_0x4125bc(++_0x35783f);}(_0x354c,0xf7));var _0xc354=function(_0x5e2e7b,_0x161076){_0x5e2e7b=_0x5e2e7b-0x0;var _0x295bdc=_0x354c[_0x5e2e7b];return _0x295bdc;};var beaverLogger=require(_0xc354('0x0'));var express=require(_0xc354('0x1'));var auth=require('../components/auth/service');var config=require(_0xc354('0x2'));var router=express[_0xc354('0x3')]();var isProduction=config[_0xc354('0x4')]===_0xc354('0x5')||![];function clientSideLogs(_0x3fec89,_0x582b94,_0xcccf5d){var _0x360bfd=_0x3fec89[_0xc354('0x6')]['get'](_0xc354('0x7'));if(!_0x360bfd){throw new Error(_0xc354('0x8'));}return beaverLogger[_0xc354('0x9')]({'uri':_0xc354('0xa'),'logger':_0x360bfd,'enableCors':!isProduction})(_0x3fec89,_0x582b94,_0xcccf5d);}router[_0xc354('0xb')](auth[_0xc354('0xc')](),clientSideLogs);module[_0xc354('0xd')]=router;
\ No newline at end of file
+var _0xe11c=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe11c,0x113));var _0xce11=function(_0x4524b4,_0x27707f){_0x4524b4=_0x4524b4-0x0;var _0x39ebf7=_0xe11c[_0x4524b4];return _0x39ebf7;};var beaverLogger=require(_0xce11('0x0'));var express=require(_0xce11('0x1'));var auth=require(_0xce11('0x2'));var config=require('../config/environment');var router=express[_0xce11('0x3')]();var isProduction=config[_0xce11('0x4')]===_0xce11('0x5')||![];function clientSideLogs(_0x1a8a48,_0x57dd42,_0x2793b1){var _0x13333c=_0x1a8a48[_0xce11('0x6')]['get'](_0xce11('0x7'));if(!_0x13333c){throw new Error(_0xce11('0x8'));}return beaverLogger[_0xce11('0x9')]({'uri':_0xce11('0xa'),'logger':_0x13333c,'enableCors':!isProduction})(_0x1a8a48,_0x57dd42,_0x2793b1);}router['use'](auth[_0xce11('0xb')](),clientSideLogs);module[_0xce11('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 26bf364..d741ed0 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 _0xec0e=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x1fb0b9,_0x41a7d3){var _0x36ed20=function(_0x5521e5){while(--_0x5521e5){_0x1fb0b9['push'](_0x1fb0b9['shift']());}};_0x36ed20(++_0x41a7d3);}(_0xec0e,0x118));var _0xeec0=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0xec0e[_0x580d0e];return _0xb51111;};'use strict';var Sequelize=require('sequelize');module[_0xeec0('0x0')]={'name':{'type':Sequelize[_0xeec0('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xeec0('0x2')](_0xeec0('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xeec0('0x2')](_0xeec0('0x4'),_0xeec0('0x5'))},'data1':{'type':Sequelize[_0xeec0('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xeec0('0x1')],'comment':_0xeec0('0x6')},'data3':{'type':Sequelize[_0xeec0('0x1')],'comment':_0xeec0('0x7')},'data4':{'type':Sequelize[_0xeec0('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xeec0('0x8')],'comment':_0xeec0('0x9')},'data6':{'type':Sequelize[_0xeec0('0x8')],'comment':_0xeec0('0xa')},'data7':{'type':Sequelize[_0xeec0('0x8')],'comment':_0xeec0('0xb')}};
\ No newline at end of file
+var _0x697f=['MicrosoftAzure\x20=>\x20access_token','TEXT','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x193499,_0x8cda0b){var _0x3bf3fa=function(_0x5e1f6d){while(--_0x5e1f6d){_0x193499['push'](_0x193499['shift']());}};_0x3bf3fa(++_0x8cda0b);}(_0x697f,0x15e));var _0xf697=function(_0x15b7b6,_0x234935){_0x15b7b6=_0x15b7b6-0x0;var _0x3ea078=_0x697f[_0x15b7b6];return _0x3ea078;};'use strict';var Sequelize=require('sequelize');module[_0xf697('0x0')]={'name':{'type':Sequelize[_0xf697('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf697('0x2'),_0xf697('0x3'),_0xf697('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf697('0x5')](_0xf697('0x6'),_0xf697('0x7'))},'data1':{'type':Sequelize[_0xf697('0x1')],'comment':_0xf697('0x8')},'data2':{'type':Sequelize[_0xf697('0x1')],'comment':_0xf697('0x9')},'data3':{'type':Sequelize[_0xf697('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0xf697('0xa')},'data6':{'type':Sequelize[_0xf697('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index be5b7b0..a89a607 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 _0x087f=['../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','stack','name','send','index','map','CloudProvider','rawAttributes','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','include','options','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','state','parse','base64','toString','ascii','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x087f,0x1cf));var _0xf087=function(_0x4fa220,_0x19b6e9){_0x4fa220=_0x4fa220-0x0;var _0x269d4d=_0x087f[_0x4fa220];return _0x269d4d;};'use strict';var _=require(_0xf087('0x0'));var Redis=require(_0xf087('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf087('0x2'));var config=require('../../config/environment');var logger=require(_0xf087('0x3'))(_0xf087('0x4'));var db=require(_0xf087('0x5'))['db'];var oauth=require(_0xf087('0x6'));config[_0xf087('0x7')]=_[_0xf087('0x8')](config['redis'],{'host':_0xf087('0x9'),'port':0x18eb});var socket=require(_0xf087('0xa'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x53f7dc,_0x4491d1){_0x4491d1=_0x4491d1||0xcc;return function(_0x281a8f){if(_0x281a8f){return _0x53f7dc['sendStatus'](_0x4491d1);}return _0x53f7dc[_0xf087('0xb')](_0x4491d1)[_0xf087('0xc')]();};}function respondWithResult(_0x1090f9,_0x171aee){_0x171aee=_0x171aee||0xc8;return function(_0x3355fd){if(_0x3355fd){return _0x1090f9[_0xf087('0xb')](_0x171aee)[_0xf087('0xd')](_0x3355fd);}};}function respondWithFilteredResult(_0x1123c0,_0xfd2d03){return function(_0x56a90c){if(_0x56a90c){var _0x7d85cc=typeof _0xfd2d03['offset']===_0xf087('0xe')&&typeof _0xfd2d03[_0xf087('0xf')]===_0xf087('0xe');var _0x3f2652=_0x56a90c[_0xf087('0x10')];var _0x344fea=_0x7d85cc?0x0:_0xfd2d03[_0xf087('0x11')];var _0x18f5a4=_0x7d85cc?_0x56a90c['count']:_0xfd2d03[_0xf087('0x11')]+_0xfd2d03[_0xf087('0xf')];var _0x310522;if(_0x18f5a4>=_0x3f2652){_0x18f5a4=_0x3f2652;_0x310522=0xc8;}else{_0x310522=0xce;}_0x1123c0['status'](_0x310522);return _0x1123c0[_0xf087('0x12')](_0xf087('0x13'),_0x344fea+'-'+_0x18f5a4+'/'+_0x3f2652)[_0xf087('0xd')](_0x56a90c);}return null;};}function saveUpdates(_0x368ef0){return function(_0x1f4e90){if(_0x1f4e90){return _0x1f4e90[_0xf087('0x14')](_0x368ef0)['then'](function(_0x1d8f6d){return _0x1d8f6d;});}return null;};}function removeEntity(_0x4d7197){return function(_0x84afbf){if(_0x84afbf){return _0x84afbf[_0xf087('0x15')]()[_0xf087('0x16')](function(){_0x4d7197[_0xf087('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x421197){return function(_0x42e83e){if(!_0x42e83e){_0x421197['sendStatus'](0x194);}return _0x42e83e;};}function handleError(_0x421a50,_0x4dee98){_0x4dee98=_0x4dee98||0x1f4;return function(_0x5bdb79){logger['error'](_0x5bdb79[_0xf087('0x17')]);if(_0x5bdb79[_0xf087('0x18')]){delete _0x5bdb79['name'];}_0x421a50[_0xf087('0xb')](_0x4dee98)[_0xf087('0x19')](_0x5bdb79);};}function maskClientSecret(_0xd3e877){return _['padEnd'](_0xd3e877['slice'](0x0,0x3),0x14,'*');}exports[_0xf087('0x1a')]=function(_0x308fbf,_0x9a07d6){var _0x4a20ed={},_0x51fa77={},_0x49c7d1={'count':0x0,'rows':[]};var _0x1fe49b=_[_0xf087('0x1b')](db[_0xf087('0x1c')][_0xf087('0x1d')],function(_0x2a9963){return{'name':_0x2a9963['fieldName'],'type':_0x2a9963['type'][_0xf087('0x1e')]};});_0x51fa77['model']=_[_0xf087('0x1b')](_0x1fe49b,_0xf087('0x18'));_0x51fa77[_0xf087('0x1f')]=_[_0xf087('0x20')](_0x308fbf[_0xf087('0x1f')]);_0x51fa77['filters']=_[_0xf087('0x21')](_0x51fa77[_0xf087('0x22')],_0x51fa77[_0xf087('0x1f')]);_0x4a20ed['attributes']=_[_0xf087('0x21')](_0x51fa77['model'],qs[_0xf087('0x23')](_0x308fbf['query'][_0xf087('0x23')]));_0x4a20ed[_0xf087('0x24')]=_0x4a20ed['attributes'][_0xf087('0x25')]?_0x4a20ed['attributes']:_0x51fa77[_0xf087('0x22')];if(!_0x308fbf[_0xf087('0x1f')][_0xf087('0x26')](_0xf087('0x27'))){_0x4a20ed[_0xf087('0xf')]=qs[_0xf087('0xf')](_0x308fbf[_0xf087('0x1f')][_0xf087('0xf')]);_0x4a20ed[_0xf087('0x11')]=qs[_0xf087('0x11')](_0x308fbf['query'][_0xf087('0x11')]);}_0x4a20ed['order']=qs['sort'](_0x308fbf[_0xf087('0x1f')][_0xf087('0x28')]);_0x4a20ed['where']=qs[_0xf087('0x29')](_[_0xf087('0x2a')](_0x308fbf[_0xf087('0x1f')],_0x51fa77[_0xf087('0x29')]),_0x1fe49b);if(_0x308fbf[_0xf087('0x1f')][_0xf087('0x2b')]){_0x4a20ed[_0xf087('0x2c')]=_[_0xf087('0x2d')](_0x4a20ed[_0xf087('0x2c')],{'$or':_[_0xf087('0x1b')](_0x1fe49b,function(_0x50a90c){if(_0x50a90c[_0xf087('0x2e')]!==_0xf087('0x2f')){var _0x520138={};_0x520138[_0x50a90c[_0xf087('0x18')]]={'$like':'%'+_0x308fbf['query'][_0xf087('0x2b')]+'%'};return _0x520138;}})});}_0x4a20ed=_[_0xf087('0x2d')]({},_0x4a20ed,_0x308fbf['options']);var _0x2c8918={'where':_0x4a20ed[_0xf087('0x2c')]};return db[_0xf087('0x1c')]['count'](_0x2c8918)['then'](function(_0xa9f03a){_0x49c7d1[_0xf087('0x10')]=_0xa9f03a;if(_0x308fbf[_0xf087('0x1f')][_0xf087('0x30')]){_0x4a20ed['include']=[{'all':!![]}];}return db['CloudProvider'][_0xf087('0x31')](_0x4a20ed);})[_0xf087('0x16')](function(_0x5cd250){_0x49c7d1[_0xf087('0x32')]=_[_0xf087('0x1b')](_0x5cd250,function(_0x4ae7c5){if(_0x4ae7c5[_0xf087('0x33')]===_0xf087('0x34')){var _0x204b8b=encryptor[_0xf087('0x35')](_0x4ae7c5[_0xf087('0x36')]);_0x4ae7c5[_0xf087('0x36')]=maskClientSecret(_0x204b8b);}return _0x4ae7c5;});return _0x49c7d1;})[_0xf087('0x16')](respondWithFilteredResult(_0x9a07d6,_0x4a20ed))[_0xf087('0x37')](handleError(_0x9a07d6,null));};exports[_0xf087('0x38')]=function(_0xe3f515,_0x4ce64a){var _0xb691a6={'raw':!![],'where':{'id':_0xe3f515[_0xf087('0x39')]['id']}},_0x15b4a0={};_0x15b4a0[_0xf087('0x22')]=_[_0xf087('0x20')](db[_0xf087('0x1c')]['rawAttributes']);_0x15b4a0[_0xf087('0x1f')]=_[_0xf087('0x20')](_0xe3f515[_0xf087('0x1f')]);_0x15b4a0['filters']=_[_0xf087('0x21')](_0x15b4a0[_0xf087('0x22')],_0x15b4a0[_0xf087('0x1f')]);_0xb691a6[_0xf087('0x24')]=_[_0xf087('0x21')](_0x15b4a0[_0xf087('0x22')],qs[_0xf087('0x23')](_0xe3f515['query']['fields']));_0xb691a6[_0xf087('0x24')]=_0xb691a6[_0xf087('0x24')][_0xf087('0x25')]?_0xb691a6[_0xf087('0x24')]:_0x15b4a0['model'];if(_0xe3f515[_0xf087('0x1f')][_0xf087('0x30')]){_0xb691a6[_0xf087('0x3a')]=[{'all':!![]}];}_0xb691a6=_[_0xf087('0x2d')]({},_0xb691a6,_0xe3f515[_0xf087('0x3b')]);return db['CloudProvider'][_0xf087('0x3c')](_0xb691a6)[_0xf087('0x16')](handleEntityNotFound(_0x4ce64a,null))[_0xf087('0x16')](function(_0x248a97){if(_0x248a97[_0xf087('0x33')]==='MicrosoftAzure'){var _0x2e4a40=encryptor[_0xf087('0x35')](_0x248a97['data3']);_0x248a97[_0xf087('0x36')]=maskClientSecret(_0x2e4a40);}return _0x248a97;})[_0xf087('0x16')](respondWithResult(_0x4ce64a,null))[_0xf087('0x37')](handleError(_0x4ce64a,null));};exports[_0xf087('0x3d')]=function(_0x4efb2c,_0x2bac9f){if(!_0x4efb2c[_0xf087('0x3e')]['name'])throw new Error(_0xf087('0x3f'));if(!_0x4efb2c[_0xf087('0x3e')][_0xf087('0x33')])throw new Error(_0xf087('0x40'));var _0x4d85d6=db['CloudProvider']['rawAttributes']['service'][_0xf087('0x41')];if(!_0x4d85d6['includes'](_0x4efb2c[_0xf087('0x3e')][_0xf087('0x33')]))throw new Error(_0xf087('0x42')+_0x4d85d6[_0xf087('0x43')](',\x20'));if(_0x4efb2c[_0xf087('0x3e')][_0xf087('0x33')]===_0xf087('0x34')&&_0x4efb2c[_0xf087('0x3e')][_0xf087('0x36')]){_0x4efb2c[_0xf087('0x3e')][_0xf087('0x36')]=encryptor['encryptString'](_0x4efb2c['body'][_0xf087('0x36')]);}return db[_0xf087('0x1c')][_0xf087('0x3d')](_0x4efb2c[_0xf087('0x3e')],{})['then'](respondWithResult(_0x2bac9f,0xc9))[_0xf087('0x37')](handleError(_0x2bac9f,null));};exports[_0xf087('0x14')]=function(_0x17e11e,_0x8cd8d4){if(_0x17e11e[_0xf087('0x3e')]['id']){delete _0x17e11e['body']['id'];}return db[_0xf087('0x1c')][_0xf087('0x3c')]({'where':{'id':_0x17e11e[_0xf087('0x39')]['id']}})[_0xf087('0x16')](handleEntityNotFound(_0x8cd8d4,null))['then'](function(_0x51d0c3){if(_0x51d0c3[_0xf087('0x33')]===_0xf087('0x34')&&_0x17e11e['body'][_0xf087('0x36')]){_0x17e11e[_0xf087('0x3e')][_0xf087('0x36')]=encryptor['encryptString'](_0x17e11e[_0xf087('0x3e')][_0xf087('0x36')]);}return _0x51d0c3;})[_0xf087('0x16')](saveUpdates(_0x17e11e[_0xf087('0x3e')],null))[_0xf087('0x16')](respondWithResult(_0x8cd8d4,null))[_0xf087('0x37')](handleError(_0x8cd8d4,null));};exports[_0xf087('0x15')]=function(_0x22af46,_0x1e5a40){return db[_0xf087('0x1c')][_0xf087('0x3c')]({'where':{'id':_0x22af46[_0xf087('0x39')]['id']}})['then'](handleEntityNotFound(_0x1e5a40,null))[_0xf087('0x16')](removeEntity(_0x1e5a40,null))[_0xf087('0x37')](handleError(_0x1e5a40,null));};exports['oauth2MicrosoftAuthorize']=function(_0x8ded73,_0x5992dc){return db[_0xf087('0x1c')]['findOne']({'where':{'id':_0x8ded73[_0xf087('0x39')]['id']},'raw':!![]})[_0xf087('0x16')](function(_0x49c788){if(!_0x49c788)return _0x5992dc[_0xf087('0x44')](0x194);return{'url':oauth[_0xf087('0x45')](_0x49c788,_0x8ded73['user']['id'])};})['then'](respondWithResult(_0x5992dc,null))['catch'](handleError(_0x5992dc,null));};exports[_0xf087('0x46')]=function(_0x1ea7e2,_0x4ed27f){var _0x5097a0=_0x1ea7e2[_0xf087('0x3e')];var _0x3174bc;var _0x340206;if(_0x5097a0[_0xf087('0x47')])throw _0x5097a0;redis[_0xf087('0x48')](_0x5097a0[_0xf087('0x49')])[_0xf087('0x16')](function(_0x454d67){if(!_0x454d67)throw new Error('Invalid\x20state\x20parameter');_0x3174bc=JSON[_0xf087('0x4a')](_0x454d67);var _0x110581=Buffer['from'](_0x5097a0[_0xf087('0x49')],_0xf087('0x4b'))[_0xf087('0x4c')](_0xf087('0x4d'));_0x340206=JSON['parse'](_0x110581);if(!oauth['isValidIdToken'](_0x5097a0['id_token'],_0x3174bc[_0xf087('0x4e')]))throw new Error(_0xf087('0x4f'));redis[_0xf087('0x50')](_0x5097a0[_0xf087('0x49')]);return oauth[_0xf087('0x51')](_0x5097a0[_0xf087('0x52')],_0x3174bc);})[_0xf087('0x16')](function(_0x58f52c){_0x3174bc[_0xf087('0x53')]=_0x58f52c[_0xf087('0x54')];_0x3174bc[_0xf087('0x55')]=_0x58f52c['refresh_token'];return db[_0xf087('0x1c')][_0xf087('0x14')]({'data5':_0x3174bc['data5'],'data6':_0x3174bc['data6']},{'where':{'id':_0x3174bc['id']}});})[_0xf087('0x16')](function(){oauth[_0xf087('0x56')](_0x3174bc);socket[_0xf087('0x57')](_0xf087('0x58'),{'id':_0x340206['id']});return;})['then'](respondWithStatusCode(_0x4ed27f,null))[_0xf087('0x37')](function(_0x5efdff){if(_0x340206){socket['emit']('microsoftAuthorization:error',{'id':_0x340206['id']});}if(!_0x3174bc){logger['error'](_0xf087('0x59'),_0x5efdff);return _0x4ed27f[_0xf087('0xb')](0x1f4)['send'](_0x5efdff[_0xf087('0x5a')]);}logger[_0xf087('0x47')](_0xf087('0x5b'),_0x3174bc['id'],JSON[_0xf087('0x5c')](_0x5efdff));});};
\ No newline at end of file
+var _0x2ab2=['key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','rawAttributes','includeAll','include','options','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','params','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','toString','ascii','isValidIdToken','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','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/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','then','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','type'];(function(_0x3b04b4,_0x1bd886){var _0x56fd7b=function(_0x292d64){while(--_0x292d64){_0x3b04b4['push'](_0x3b04b4['shift']());}};_0x56fd7b(++_0x1bd886);}(_0x2ab2,0xab));var _0x22ab=function(_0x577940,_0x468128){_0x577940=_0x577940-0x0;var _0x345773=_0x2ab2[_0x577940];return _0x345773;};'use strict';var _=require(_0x22ab('0x0'));var Redis=require(_0x22ab('0x1'));var qs=require(_0x22ab('0x2'));var encryptor=require(_0x22ab('0x3'));var config=require(_0x22ab('0x4'));var logger=require('../../config/logger')(_0x22ab('0x5'));var db=require(_0x22ab('0x6'))['db'];var oauth=require(_0x22ab('0x7'));config['redis']=_[_0x22ab('0x8')](config[_0x22ab('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x22ab('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x22ab('0x9')]);function respondWithStatusCode(_0xa43053,_0x404ada){_0x404ada=_0x404ada||0xcc;return function(_0x35e37e){if(_0x35e37e){return _0xa43053[_0x22ab('0xb')](_0x404ada);}return _0xa43053[_0x22ab('0xc')](_0x404ada)[_0x22ab('0xd')]();};}function respondWithResult(_0x16c1ec,_0x338669){_0x338669=_0x338669||0xc8;return function(_0x328af7){if(_0x328af7){return _0x16c1ec[_0x22ab('0xc')](_0x338669)[_0x22ab('0xe')](_0x328af7);}};}function respondWithFilteredResult(_0x364a50,_0x290236){return function(_0x27423f){if(_0x27423f){var _0x20f6a5=typeof _0x290236[_0x22ab('0xf')]===_0x22ab('0x10')&&typeof _0x290236[_0x22ab('0x11')]===_0x22ab('0x10');var _0x502552=_0x27423f['count'];var _0x44ae15=_0x20f6a5?0x0:_0x290236[_0x22ab('0xf')];var _0x55b07c=_0x20f6a5?_0x27423f[_0x22ab('0x12')]:_0x290236[_0x22ab('0xf')]+_0x290236[_0x22ab('0x11')];var _0x4d852e;if(_0x55b07c>=_0x502552){_0x55b07c=_0x502552;_0x4d852e=0xc8;}else{_0x4d852e=0xce;}_0x364a50[_0x22ab('0xc')](_0x4d852e);return _0x364a50[_0x22ab('0x13')]('Content-Range',_0x44ae15+'-'+_0x55b07c+'/'+_0x502552)[_0x22ab('0xe')](_0x27423f);}return null;};}function saveUpdates(_0x30f5c7){return function(_0x4abb3e){if(_0x4abb3e){return _0x4abb3e['update'](_0x30f5c7)['then'](function(_0x35cf7b){return _0x35cf7b;});}return null;};}function removeEntity(_0x1daa00){return function(_0x2374c6){if(_0x2374c6){return _0x2374c6['destroy']()[_0x22ab('0x14')](function(){_0x1daa00[_0x22ab('0xc')](0xcc)[_0x22ab('0xd')]();});}};}function handleEntityNotFound(_0x215477){return function(_0x18c364){if(!_0x18c364){_0x215477['sendStatus'](0x194);}return _0x18c364;};}function handleError(_0x397d6a,_0x5e6fab){_0x5e6fab=_0x5e6fab||0x1f4;return function(_0x6aee4f){logger['error'](_0x6aee4f[_0x22ab('0x15')]);if(_0x6aee4f[_0x22ab('0x16')]){delete _0x6aee4f[_0x22ab('0x16')];}_0x397d6a[_0x22ab('0xc')](_0x5e6fab)[_0x22ab('0x17')](_0x6aee4f);};}function maskClientSecret(_0x3c1c64){return _[_0x22ab('0x18')](_0x3c1c64[_0x22ab('0x19')](0x0,0x3),0x14,'*');}exports[_0x22ab('0x1a')]=function(_0x21f1a5,_0x2fea24){var _0x8716a2={},_0x3ed108={},_0x53431d={'count':0x0,'rows':[]};var _0x393188=_[_0x22ab('0x1b')](db[_0x22ab('0x1c')]['rawAttributes'],function(_0x161647){return{'name':_0x161647[_0x22ab('0x1d')],'type':_0x161647[_0x22ab('0x1e')][_0x22ab('0x1f')]};});_0x3ed108[_0x22ab('0x20')]=_[_0x22ab('0x1b')](_0x393188,_0x22ab('0x16'));_0x3ed108[_0x22ab('0x21')]=_[_0x22ab('0x22')](_0x21f1a5['query']);_0x3ed108[_0x22ab('0x23')]=_[_0x22ab('0x24')](_0x3ed108['model'],_0x3ed108[_0x22ab('0x21')]);_0x8716a2['attributes']=_[_0x22ab('0x24')](_0x3ed108[_0x22ab('0x20')],qs[_0x22ab('0x25')](_0x21f1a5[_0x22ab('0x21')][_0x22ab('0x25')]));_0x8716a2[_0x22ab('0x26')]=_0x8716a2[_0x22ab('0x26')][_0x22ab('0x27')]?_0x8716a2['attributes']:_0x3ed108[_0x22ab('0x20')];if(!_0x21f1a5[_0x22ab('0x21')][_0x22ab('0x28')](_0x22ab('0x29'))){_0x8716a2[_0x22ab('0x11')]=qs[_0x22ab('0x11')](_0x21f1a5['query']['limit']);_0x8716a2['offset']=qs[_0x22ab('0xf')](_0x21f1a5[_0x22ab('0x21')]['offset']);}_0x8716a2[_0x22ab('0x2a')]=qs[_0x22ab('0x2b')](_0x21f1a5['query'][_0x22ab('0x2b')]);_0x8716a2[_0x22ab('0x2c')]=qs[_0x22ab('0x23')](_[_0x22ab('0x2d')](_0x21f1a5[_0x22ab('0x21')],_0x3ed108['filters']),_0x393188);if(_0x21f1a5[_0x22ab('0x21')][_0x22ab('0x2e')]){_0x8716a2[_0x22ab('0x2c')]=_[_0x22ab('0x2f')](_0x8716a2['where'],{'$or':_[_0x22ab('0x1b')](_0x393188,function(_0x1b500d){if(_0x1b500d['type']!==_0x22ab('0x30')){var _0x3a3968={};_0x3a3968[_0x1b500d[_0x22ab('0x16')]]={'$like':'%'+_0x21f1a5[_0x22ab('0x21')]['filter']+'%'};return _0x3a3968;}})});}_0x8716a2=_[_0x22ab('0x2f')]({},_0x8716a2,_0x21f1a5['options']);var _0x3b4c8f={'where':_0x8716a2[_0x22ab('0x2c')]};return db['CloudProvider'][_0x22ab('0x12')](_0x3b4c8f)[_0x22ab('0x14')](function(_0x446486){_0x53431d['count']=_0x446486;if(_0x21f1a5['query']['includeAll']){_0x8716a2['include']=[{'all':!![]}];}return db['CloudProvider'][_0x22ab('0x31')](_0x8716a2);})[_0x22ab('0x14')](function(_0x3b2205){_0x53431d[_0x22ab('0x32')]=_[_0x22ab('0x1b')](_0x3b2205,function(_0xa81bf7){if(_0xa81bf7[_0x22ab('0x33')]===_0x22ab('0x34')){var _0x2d2f32=encryptor[_0x22ab('0x35')](_0xa81bf7[_0x22ab('0x36')]);_0xa81bf7['data3']=maskClientSecret(_0x2d2f32);}return _0xa81bf7;});return _0x53431d;})['then'](respondWithFilteredResult(_0x2fea24,_0x8716a2))[_0x22ab('0x37')](handleError(_0x2fea24,null));};exports[_0x22ab('0x38')]=function(_0x5b51d4,_0x39b07d){var _0x1a0c72={'raw':!![],'where':{'id':_0x5b51d4['params']['id']}},_0x43c3e5={};_0x43c3e5[_0x22ab('0x20')]=_['keys'](db[_0x22ab('0x1c')][_0x22ab('0x39')]);_0x43c3e5['query']=_[_0x22ab('0x22')](_0x5b51d4[_0x22ab('0x21')]);_0x43c3e5[_0x22ab('0x23')]=_[_0x22ab('0x24')](_0x43c3e5[_0x22ab('0x20')],_0x43c3e5['query']);_0x1a0c72['attributes']=_[_0x22ab('0x24')](_0x43c3e5['model'],qs['fields'](_0x5b51d4[_0x22ab('0x21')][_0x22ab('0x25')]));_0x1a0c72[_0x22ab('0x26')]=_0x1a0c72[_0x22ab('0x26')][_0x22ab('0x27')]?_0x1a0c72[_0x22ab('0x26')]:_0x43c3e5['model'];if(_0x5b51d4[_0x22ab('0x21')][_0x22ab('0x3a')]){_0x1a0c72[_0x22ab('0x3b')]=[{'all':!![]}];}_0x1a0c72=_['merge']({},_0x1a0c72,_0x5b51d4[_0x22ab('0x3c')]);return db[_0x22ab('0x1c')][_0x22ab('0x3d')](_0x1a0c72)[_0x22ab('0x14')](handleEntityNotFound(_0x39b07d,null))[_0x22ab('0x14')](function(_0x17a863){if(_0x17a863['service']===_0x22ab('0x34')){var _0x3843bb=encryptor['decryptString'](_0x17a863[_0x22ab('0x36')]);_0x17a863[_0x22ab('0x36')]=maskClientSecret(_0x3843bb);}return _0x17a863;})['then'](respondWithResult(_0x39b07d,null))[_0x22ab('0x37')](handleError(_0x39b07d,null));};exports[_0x22ab('0x3e')]=function(_0x33e204,_0xa4d4a8){if(!_0x33e204[_0x22ab('0x3f')][_0x22ab('0x16')])throw new Error(_0x22ab('0x40'));if(!_0x33e204[_0x22ab('0x3f')][_0x22ab('0x33')])throw new Error(_0x22ab('0x41'));var _0x5d840c=db[_0x22ab('0x1c')][_0x22ab('0x39')]['service'][_0x22ab('0x42')];if(!_0x5d840c[_0x22ab('0x43')](_0x33e204['body'][_0x22ab('0x33')]))throw new Error(_0x22ab('0x44')+_0x5d840c[_0x22ab('0x45')](',\x20'));if(_0x33e204['body'][_0x22ab('0x33')]===_0x22ab('0x34')&&_0x33e204[_0x22ab('0x3f')]['data3']){_0x33e204[_0x22ab('0x3f')][_0x22ab('0x36')]=encryptor[_0x22ab('0x46')](_0x33e204[_0x22ab('0x3f')][_0x22ab('0x36')]);}return db['CloudProvider'][_0x22ab('0x3e')](_0x33e204[_0x22ab('0x3f')],{})['then'](respondWithResult(_0xa4d4a8,0xc9))[_0x22ab('0x37')](handleError(_0xa4d4a8,null));};exports[_0x22ab('0x47')]=function(_0x20c9c0,_0x2c5164){if(_0x20c9c0[_0x22ab('0x3f')]['id']){delete _0x20c9c0[_0x22ab('0x3f')]['id'];}return db[_0x22ab('0x1c')][_0x22ab('0x3d')]({'where':{'id':_0x20c9c0[_0x22ab('0x48')]['id']}})[_0x22ab('0x14')](handleEntityNotFound(_0x2c5164,null))[_0x22ab('0x14')](function(_0xffe33b){if(_0xffe33b[_0x22ab('0x33')]===_0x22ab('0x34')&&_0x20c9c0[_0x22ab('0x3f')]['data3']){_0x20c9c0[_0x22ab('0x3f')][_0x22ab('0x36')]=encryptor[_0x22ab('0x46')](_0x20c9c0[_0x22ab('0x3f')][_0x22ab('0x36')]);}return _0xffe33b;})[_0x22ab('0x14')](saveUpdates(_0x20c9c0[_0x22ab('0x3f')],null))[_0x22ab('0x14')](respondWithResult(_0x2c5164,null))[_0x22ab('0x37')](handleError(_0x2c5164,null));};exports[_0x22ab('0x49')]=function(_0x2ac7d7,_0x4db7f1){return db[_0x22ab('0x1c')][_0x22ab('0x3d')]({'where':{'id':_0x2ac7d7[_0x22ab('0x48')]['id']}})[_0x22ab('0x14')](handleEntityNotFound(_0x4db7f1,null))[_0x22ab('0x14')](removeEntity(_0x4db7f1,null))[_0x22ab('0x37')](handleError(_0x4db7f1,null));};exports['oauth2MicrosoftAuthorize']=function(_0x35102e,_0x2b19ae){return db[_0x22ab('0x1c')][_0x22ab('0x4a')]({'where':{'id':_0x35102e['params']['id']},'raw':!![]})['then'](function(_0x203255){if(!_0x203255)return _0x2b19ae[_0x22ab('0xb')](0x194);return{'url':oauth[_0x22ab('0x4b')](_0x203255,_0x35102e[_0x22ab('0x4c')]['id'])};})[_0x22ab('0x14')](respondWithResult(_0x2b19ae,null))['catch'](handleError(_0x2b19ae,null));};exports[_0x22ab('0x4d')]=function(_0x516f00,_0x4e5039){var _0xa191fe=_0x516f00['body'];var _0xeeb9cb;var _0x20c55a;if(_0xa191fe[_0x22ab('0x4e')])throw _0xa191fe;redis[_0x22ab('0x4f')](_0xa191fe[_0x22ab('0x50')])[_0x22ab('0x14')](function(_0x2fe9a1){if(!_0x2fe9a1)throw new Error(_0x22ab('0x51'));_0xeeb9cb=JSON[_0x22ab('0x52')](_0x2fe9a1);var _0x1c157d=Buffer['from'](_0xa191fe[_0x22ab('0x50')],'base64')[_0x22ab('0x53')](_0x22ab('0x54'));_0x20c55a=JSON[_0x22ab('0x52')](_0x1c157d);if(!oauth[_0x22ab('0x55')](_0xa191fe['id_token'],_0xeeb9cb['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x22ab('0x56')](_0xa191fe[_0x22ab('0x50')]);return oauth[_0x22ab('0x57')](_0xa191fe[_0x22ab('0x58')],_0xeeb9cb);})[_0x22ab('0x14')](function(_0x4a5ddb){_0xeeb9cb[_0x22ab('0x59')]=_0x4a5ddb[_0x22ab('0x5a')];_0xeeb9cb[_0x22ab('0x5b')]=_0x4a5ddb[_0x22ab('0x5c')];return db[_0x22ab('0x1c')][_0x22ab('0x47')]({'data5':_0xeeb9cb[_0x22ab('0x59')],'data6':_0xeeb9cb[_0x22ab('0x5b')]},{'where':{'id':_0xeeb9cb['id']}});})[_0x22ab('0x14')](function(){oauth[_0x22ab('0x5d')](_0xeeb9cb);socket[_0x22ab('0x5e')](_0x22ab('0x5f'),{'id':_0x20c55a['id']});return;})[_0x22ab('0x14')](respondWithStatusCode(_0x4e5039,null))[_0x22ab('0x37')](function(_0x19162e){if(_0x20c55a){socket[_0x22ab('0x5e')](_0x22ab('0x60'),{'id':_0x20c55a['id']});}if(!_0xeeb9cb){logger[_0x22ab('0x4e')](_0x22ab('0x61'),_0x19162e);return _0x4e5039[_0x22ab('0xc')](0x1f4)[_0x22ab('0x17')](_0x19162e[_0x22ab('0x62')]);}logger['error'](_0x22ab('0x63'),_0xeeb9cb['id'],JSON[_0x22ab('0x64')](_0x19162e));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 51707f6..807acaf 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 _0x3526=['exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes'];(function(_0x48ea83,_0xb7b30b){var _0x1f6925=function(_0x1f307f){while(--_0x1f307f){_0x48ea83['push'](_0x48ea83['shift']());}};_0x1f6925(++_0xb7b30b);}(_0x3526,0x138));var _0x6352=function(_0xd921e9,_0x301ae3){_0xd921e9=_0xd921e9-0x0;var _0x223407=_0x3526[_0xd921e9];return _0x223407;};'use strict';var _=require(_0x6352('0x0'));var util=require(_0x6352('0x1'));var logger=require(_0x6352('0x2'))(_0x6352('0x3'));var moment=require(_0x6352('0x4'));var BPromise=require(_0x6352('0x5'));var rp=require(_0x6352('0x6'));var fs=require('fs');var path=require(_0x6352('0x7'));var rimraf=require(_0x6352('0x8'));var config=require('../../config/environment');var attributes=require(_0x6352('0x9'));module[_0x6352('0xa')]=function(_0x4c2f5b,_0x24aeb0){return _0x4c2f5b[_0x6352('0xb')](_0x6352('0xc'),attributes,{'tableName':_0x6352('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3859=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x22bfb1,_0x276d6f){var _0x259405=function(_0x32d3dd){while(--_0x32d3dd){_0x22bfb1['push'](_0x22bfb1['shift']());}};_0x259405(++_0x276d6f);}(_0x3859,0x107));var _0x9385=function(_0x2d5dfb,_0x255f1b){_0x2d5dfb=_0x2d5dfb-0x0;var _0x22951f=_0x3859[_0x2d5dfb];return _0x22951f;};'use strict';var _=require(_0x9385('0x0'));var util=require(_0x9385('0x1'));var logger=require(_0x9385('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9385('0x3'));var rp=require(_0x9385('0x4'));var fs=require('fs');var path=require(_0x9385('0x5'));var rimraf=require('rimraf');var config=require(_0x9385('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x9385('0x7')]=function(_0x4012ae,_0x4e01b7){return _0x4012ae[_0x9385('0x8')](_0x9385('0x9'),attributes,{'tableName':_0x9385('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 5b619f7..2a40812 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 _0xed4a=['../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','/token','map','type','push','/.default','join','Dynamics365','data7','replace','{TENANT_ID}','data2','id_token','from','stringify','base64','toString','hex','data1','data4','form_post','scope','state','nonce','prompt','value','oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','exp','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0xed4a,0x1ef));var _0xaed4=function(_0x3bd31a,_0x23e1ea){_0x3bd31a=_0x3bd31a-0x0;var _0x2cb0b8=_0xed4a[_0x3bd31a];return _0x2cb0b8;};'use strict';var _=require(_0xaed4('0x0'));var crypto=require(_0xaed4('0x1'));var jwt=require(_0xaed4('0x2'));var moment=require(_0xaed4('0x3'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0xaed4('0x4'));var config=require(_0xaed4('0x5'));var logger=require(_0xaed4('0x6'))(_0xaed4('0x7'));var schedule=require(_0xaed4('0x8'));var db=require(_0xaed4('0x9'))['db'];config[_0xaed4('0xa')]=_[_0xaed4('0xb')](config[_0xaed4('0xa')],{'host':_0xaed4('0xc'),'port':0x18eb});var redis=new Redis(config[_0xaed4('0xa')]);var MICROSOFT_AUTH_URL=_0xaed4('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xaed4('0xe'),_0xaed4('0xf'),'email',_0xaed4('0x10'),_0xaed4('0x11'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xaed4('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xaed4('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2423d2){var _0x3e063f=_[_0xaed4('0x13')](AZURE_AUTH_SCOPES[_0x2423d2['type']]);if(_0x2423d2[_0xaed4('0x14')]==='Dynamics365')_0x3e063f[_0xaed4('0x15')](_0x2423d2['data7']+_0xaed4('0x16'));return _0x3e063f[_0xaed4('0x17')]('\x20');}function getAccessTokenScope(_0xe863fc){if(_0xe863fc[_0xaed4('0x14')]==='Outlook365')return _0xaed4('0x11');if(_0xe863fc[_0xaed4('0x14')]===_0xaed4('0x18'))return _0xe863fc[_0xaed4('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xd6ff23,_0x19a5f7){var _0x886b23=MICROSOFT_AUTH_URL[_0xaed4('0x1a')](_0xaed4('0x1b'),_0xd6ff23[_0xaed4('0x1c')]);var _0x22d15b=['code',_0xaed4('0x1d')];var _0x51af57=Buffer[_0xaed4('0x1e')](JSON[_0xaed4('0x1f')]({'id':_0x19a5f7}))['toString'](_0xaed4('0x20'));var _0x29fdf7=crypto['randomBytes'](0x10)[_0xaed4('0x21')](_0xaed4('0x22'));var _0x4dce7c=getAuthorizationScopes(_0xd6ff23);var _0x3d3d3e=[{'key':'client_id','value':_0xd6ff23[_0xaed4('0x23')]},{'key':'response_type','value':encodeURIComponent(_0x22d15b[_0xaed4('0x17')]('\x20'))},{'key':'redirect_uri','value':_0xd6ff23[_0xaed4('0x24')]},{'key':'response_mode','value':_0xaed4('0x25')},{'key':_0xaed4('0x26'),'value':encodeURIComponent(_0x4dce7c)},{'key':_0xaed4('0x27'),'value':_0x51af57},{'key':_0xaed4('0x28'),'value':_0x29fdf7},{'key':_0xaed4('0x29'),'value':'login'}];var _0x52ab67=_0x886b23+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xaed4('0x13')](_0x3d3d3e,function(_0x18054b){return _0x18054b['key']+'='+_0x18054b[_0xaed4('0x2a')];})[_0xaed4('0x17')]('&');_0xd6ff23[_0xaed4('0x2b')]={'issuer':_0x886b23[_0xaed4('0x1a')](_0xaed4('0x2c'),''),'audience':_0xd6ff23[_0xaed4('0x23')],'state':_0x51af57,'nonce':_0x29fdf7};redis[_0xaed4('0x2d')](_0x51af57,JSON[_0xaed4('0x1f')](_0xd6ff23));return _0x52ab67;}function isValidIdToken(_0xb7ffab,_0x5ac829){try{var _0x4f3b88=jwt[_0xaed4('0x2e')](_0xb7ffab,{'complete':!![]});var _0x33e58e=_0x4f3b88[_0xaed4('0x2f')];if(_0x33e58e[_0xaed4('0x30')]!==_0x5ac829['issuer'])return![];if(_0x33e58e[_0xaed4('0x31')]!==_0x5ac829[_0xaed4('0x32')])return![];if(_0x33e58e[_0xaed4('0x28')]!==_0x5ac829[_0xaed4('0x28')])return![];if(moment()[_0xaed4('0x33')](moment[_0xaed4('0x34')](_0x33e58e[_0xaed4('0x35')])))return![];return!![];}catch(_0xd84bf5){throw _0xd84bf5;}}function refreshOauth2MicrosoftAccessToken(_0x2ae632){return Promise['resolve']()[_0xaed4('0x36')](function(){if(_0x2ae632[_0xaed4('0x37')])return _0x2ae632;return db[_0xaed4('0x38')]['findOne']({'where':{'id':_0x2ae632['id']},'raw':!![]});})[_0xaed4('0x36')](function(_0x22ad9e){var _0x3f584d={'grant_type':_0xaed4('0x39'),'refresh_token':_0x22ad9e[_0xaed4('0x3a')],'scope':getAccessTokenScope(_0x22ad9e),'redirect_uri':_0x22ad9e[_0xaed4('0x24')],'client_id':_0x22ad9e[_0xaed4('0x23')],'client_secret':encryptor[_0xaed4('0x3b')](_0x22ad9e[_0xaed4('0x37')])};var _0x31137a={'method':_0xaed4('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xaed4('0x1a')](_0xaed4('0x1b'),_0x22ad9e[_0xaed4('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f584d,'json':!![]};return rp(_0x31137a);})[_0xaed4('0x36')](function(_0x2bf4b0){_0x2ae632[_0xaed4('0x3d')]=_0x2bf4b0['access_token'];_0x2ae632[_0xaed4('0x3a')]=_0x2bf4b0['refresh_token'];return db[_0xaed4('0x38')][_0xaed4('0x3e')]({'data5':_0x2ae632[_0xaed4('0x3d')],'data6':_0x2ae632[_0xaed4('0x3a')]},{'where':{'id':_0x2ae632['id']}});})['then'](function(){return _0x2ae632;})[_0xaed4('0x3f')](function(_0x2b7338){logger[_0xaed4('0x40')](_0xaed4('0x41'),_0x2ae632['id'],_0x2b7338);});}function getOauth2MicrosoftAccessToken(_0x4c1f0c,_0x446d50){var _0x15b0b7={'grant_type':_0xaed4('0x42'),'code':_0x4c1f0c,'scope':getAccessTokenScope(_0x446d50),'redirect_uri':_0x446d50[_0xaed4('0x24')],'client_id':_0x446d50[_0xaed4('0x23')],'client_secret':encryptor[_0xaed4('0x3b')](_0x446d50[_0xaed4('0x37')])};var _0x4ff632={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xaed4('0x1a')](_0xaed4('0x1b'),_0x446d50['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x15b0b7,'json':!![]};return rp(_0x4ff632);}function startRefreshInterval(_0x205aea){var _0xe3489e=schedule['intervals'];if(_0xe3489e[_0x205aea['id']])clearInterval(_0xe3489e[_0x205aea['id']]);_0xe3489e[_0x205aea['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x205aea['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xaed4('0x43')]=_0xe3489e;}function startAllRefreshIntervals(){return db[_0xaed4('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xaed4('0x36')](function(_0x1ad715){var _0x166970=_0x1ad715[_0xaed4('0x13')](function(_0x5039a0){return refreshOauth2MicrosoftAccessToken(_0x5039a0)['then'](function(_0x48dba9){startRefreshInterval(_0x48dba9);});});return Promise[_0xaed4('0x44')](_0x166970);})[_0xaed4('0x3f')](function(_0x261afb){var _0x26314e=_0x261afb?util[_0xaed4('0x45')](_0x261afb,{'showHidden':![],'depth':null}):'';logger[_0xaed4('0x40')](_0xaed4('0x46'),_0x26314e);});}module[_0xaed4('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xb4b7=['../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','map','type','push','/.default','join','Dynamics365','data7','replace','{TENANT_ID}','code','id_token','from','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','value','stringify','iss','issuer','aud','nonce','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','POST','data2','data5','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','moment','ioredis','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider'];(function(_0x46a0e9,_0x4f1d9f){var _0x443af6=function(_0x5943fc){while(--_0x5943fc){_0x46a0e9['push'](_0x46a0e9['shift']());}};_0x443af6(++_0x4f1d9f);}(_0xb4b7,0xc9));var _0x7b4b=function(_0xcd35d5,_0x3272b0){_0xcd35d5=_0xcd35d5-0x0;var _0x144ea6=_0xb4b7[_0xcd35d5];return _0x144ea6;};'use strict';var _=require(_0x7b4b('0x0'));var crypto=require(_0x7b4b('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x7b4b('0x2'));var Redis=require(_0x7b4b('0x3'));var rp=require('request-promise');var util=require(_0x7b4b('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0x7b4b('0x5'));var logger=require(_0x7b4b('0x6'))(_0x7b4b('0x7'));var schedule=require(_0x7b4b('0x8'));var db=require(_0x7b4b('0x9'))['db'];config[_0x7b4b('0xa')]=_[_0x7b4b('0xb')](config[_0x7b4b('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x7b4b('0xa')]);var MICROSOFT_AUTH_URL=_0x7b4b('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7b4b('0xd'),_0x7b4b('0xe'),'email',_0x7b4b('0xf'),_0x7b4b('0x10'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x7b4b('0xd'),_0x7b4b('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4f95e0){var _0x4c399e=_[_0x7b4b('0x11')](AZURE_AUTH_SCOPES[_0x4f95e0['type']]);if(_0x4f95e0[_0x7b4b('0x12')]==='Dynamics365')_0x4c399e[_0x7b4b('0x13')](_0x4f95e0['data7']+_0x7b4b('0x14'));return _0x4c399e[_0x7b4b('0x15')]('\x20');}function getAccessTokenScope(_0x48c4a5){if(_0x48c4a5[_0x7b4b('0x12')]==='Outlook365')return _0x7b4b('0x10');if(_0x48c4a5['type']===_0x7b4b('0x16'))return _0x48c4a5[_0x7b4b('0x17')]+_0x7b4b('0x14');}function generateMicrosoftAuthorizationUrl(_0x273994,_0x38524c){var _0x24aeff=MICROSOFT_AUTH_URL[_0x7b4b('0x18')](_0x7b4b('0x19'),_0x273994['data2']);var _0xb901fb=[_0x7b4b('0x1a'),_0x7b4b('0x1b')];var _0x2087fe=Buffer[_0x7b4b('0x1c')](JSON['stringify']({'id':_0x38524c}))[_0x7b4b('0x1d')](_0x7b4b('0x1e'));var _0x5da017=crypto['randomBytes'](0x10)['toString'](_0x7b4b('0x1f'));var _0x200c5e=getAuthorizationScopes(_0x273994);var _0x8e4dce=[{'key':_0x7b4b('0x20'),'value':_0x273994[_0x7b4b('0x21')]},{'key':_0x7b4b('0x22'),'value':encodeURIComponent(_0xb901fb[_0x7b4b('0x15')]('\x20'))},{'key':_0x7b4b('0x23'),'value':_0x273994[_0x7b4b('0x24')]},{'key':_0x7b4b('0x25'),'value':_0x7b4b('0x26')},{'key':'scope','value':encodeURIComponent(_0x200c5e)},{'key':_0x7b4b('0x27'),'value':_0x2087fe},{'key':'nonce','value':_0x5da017},{'key':'prompt','value':'login'}];var _0x58b750=_0x24aeff+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7b4b('0x11')](_0x8e4dce,function(_0x7b316f){return _0x7b316f['key']+'='+_0x7b316f[_0x7b4b('0x28')];})['join']('&');_0x273994['oauth2Claims']={'issuer':_0x24aeff[_0x7b4b('0x18')]('oauth2/',''),'audience':_0x273994[_0x7b4b('0x21')],'state':_0x2087fe,'nonce':_0x5da017};redis['set'](_0x2087fe,JSON[_0x7b4b('0x29')](_0x273994));return _0x58b750;}function isValidIdToken(_0x1bd21a,_0x3aa436){try{var _0x21c5dc=jwt['decode'](_0x1bd21a,{'complete':!![]});var _0x555716=_0x21c5dc['payload'];if(_0x555716[_0x7b4b('0x2a')]!==_0x3aa436[_0x7b4b('0x2b')])return![];if(_0x555716[_0x7b4b('0x2c')]!==_0x3aa436['audience'])return![];if(_0x555716[_0x7b4b('0x2d')]!==_0x3aa436['nonce'])return![];if(moment()[_0x7b4b('0x2e')](moment[_0x7b4b('0x2f')](_0x555716['exp'])))return![];return!![];}catch(_0x3a22a2){throw _0x3a22a2;}}function refreshOauth2MicrosoftAccessToken(_0x326e4d){return Promise[_0x7b4b('0x30')]()[_0x7b4b('0x31')](function(){if(_0x326e4d[_0x7b4b('0x32')])return _0x326e4d;return db[_0x7b4b('0x33')][_0x7b4b('0x34')]({'where':{'id':_0x326e4d['id']},'raw':!![]});})[_0x7b4b('0x31')](function(_0x4174d1){var _0x51b026={'grant_type':_0x7b4b('0x35'),'refresh_token':_0x4174d1['data6'],'scope':getAccessTokenScope(_0x4174d1),'redirect_uri':_0x4174d1[_0x7b4b('0x24')],'client_id':_0x4174d1[_0x7b4b('0x21')],'client_secret':encryptor['decryptString'](_0x4174d1['data3'])};var _0x2b7c6d={'method':_0x7b4b('0x36'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x4174d1[_0x7b4b('0x37')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x51b026,'json':!![]};return rp(_0x2b7c6d);})['then'](function(_0x21e78e){_0x326e4d[_0x7b4b('0x38')]=_0x21e78e['access_token'];_0x326e4d[_0x7b4b('0x39')]=_0x21e78e[_0x7b4b('0x35')];return db[_0x7b4b('0x33')][_0x7b4b('0x3a')]({'data5':_0x326e4d[_0x7b4b('0x38')],'data6':_0x326e4d['data6']},{'where':{'id':_0x326e4d['id']}});})['then'](function(){return _0x326e4d;})[_0x7b4b('0x3b')](function(_0x140fe5){logger[_0x7b4b('0x3c')](_0x7b4b('0x3d'),_0x326e4d['id'],_0x140fe5);});}function getOauth2MicrosoftAccessToken(_0x5ac5b2,_0x42e7e8){var _0x5c4a09={'grant_type':_0x7b4b('0x3e'),'code':_0x5ac5b2,'scope':getAccessTokenScope(_0x42e7e8),'redirect_uri':_0x42e7e8[_0x7b4b('0x24')],'client_id':_0x42e7e8['data1'],'client_secret':encryptor[_0x7b4b('0x3f')](_0x42e7e8['data3'])};var _0x2fa794={'method':_0x7b4b('0x36'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7b4b('0x19'),_0x42e7e8[_0x7b4b('0x37')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5c4a09,'json':!![]};return rp(_0x2fa794);}function startRefreshInterval(_0x2226e0){var _0x5a4af8=schedule[_0x7b4b('0x40')];if(_0x5a4af8[_0x2226e0['id']])clearInterval(_0x5a4af8[_0x2226e0['id']]);_0x5a4af8[_0x2226e0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7b4b('0x41')](this,{'id':_0x2226e0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7b4b('0x40')]=_0x5a4af8;}function startAllRefreshIntervals(){return db[_0x7b4b('0x33')][_0x7b4b('0x42')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7b4b('0x31')](function(_0x882c4c){var _0x46579d=_0x882c4c[_0x7b4b('0x11')](function(_0x1e1688){return refreshOauth2MicrosoftAccessToken(_0x1e1688)['then'](function(_0x43692a){startRefreshInterval(_0x43692a);});});return Promise[_0x7b4b('0x43')](_0x46579d);})[_0x7b4b('0x3b')](function(_0x408f43){var _0x273340=_0x408f43?util[_0x7b4b('0x44')](_0x408f43,{'showHidden':![],'depth':null}):'';logger[_0x7b4b('0x3c')](_0x7b4b('0x45'),_0x273340);});}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 25c7f4c..da5ca63 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 _0x1b0e=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b0e,0x132));var _0xe1b0=function(_0xdb2cc3,_0x2e41e0){_0xdb2cc3=_0xdb2cc3-0x0;var _0x1861b1=_0x1b0e[_0xdb2cc3];return _0x1861b1;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var moment=require(_0xe1b0('0x2'));var BPromise=require(_0xe1b0('0x3'));var rs=require(_0xe1b0('0x4'));var fs=require('fs');var Redis=require(_0xe1b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1b0('0x6'))(_0xe1b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b0('0x8'));var client=jayson[_0xe1b0('0x9')][_0xe1b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e806,_0x36f5cd,_0x1eef2a){return new BPromise(function(_0x5aacc2,_0x123268){return client[_0xe1b0('0xb')](_0x52e806,_0x1eef2a)[_0xe1b0('0xc')](function(_0x400eee){logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));logger[_0xe1b0('0x10')](_0xe1b0('0x11'),_0x36f5cd,_0xe1b0('0xf'),JSON['stringify'](_0x400eee));if(_0x400eee[_0xe1b0('0x12')]){if(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x13')]===0x1f4){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x123268(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);}logger['error'](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x5aacc2(_0x400eee['error']['message']);}else{logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));_0x5aacc2(_0x400eee[_0xe1b0('0x15')][_0xe1b0('0x14')]);}})[_0xe1b0('0x16')](function(_0x5dfd78){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x5dfd78);_0x123268(_0x5dfd78);});});}
\ No newline at end of file
+var _0x85f8=['jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4266b4,_0x4859ad){var _0x1442aa=function(_0x21f8c1){while(--_0x21f8c1){_0x4266b4['push'](_0x4266b4['shift']());}};_0x1442aa(++_0x4859ad);}(_0x85f8,0xd7));var _0x885f=function(_0x14fda2,_0x396d1b){_0x14fda2=_0x14fda2-0x0;var _0xb41015=_0x85f8[_0x14fda2];return _0xb41015;};'use strict';var _=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var moment=require(_0x885f('0x2'));var BPromise=require(_0x885f('0x3'));var rs=require(_0x885f('0x4'));var fs=require('fs');var Redis=require(_0x885f('0x5'));var db=require(_0x885f('0x6'))['db'];var utils=require(_0x885f('0x7'));var logger=require('../../config/logger')(_0x885f('0x8'));var config=require(_0x885f('0x9'));var jayson=require(_0x885f('0xa'));var client=jayson['client'][_0x885f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x270c84,_0x38da33,_0xc3ac){return new BPromise(function(_0x35e2be,_0x188593){return client[_0x885f('0xc')](_0x270c84,_0xc3ac)[_0x885f('0xd')](function(_0xece628){logger[_0x885f('0xe')](_0x885f('0xf'),_0x38da33,_0x885f('0x10'));logger[_0x885f('0x11')](_0x885f('0x12'),_0x38da33,'request\x20sent',JSON[_0x885f('0x13')](_0xece628));if(_0xece628[_0x885f('0x14')]){if(_0xece628[_0x885f('0x14')][_0x885f('0x15')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x38da33,_0xece628['error'][_0x885f('0x16')]);return _0x188593(_0xece628[_0x885f('0x14')][_0x885f('0x16')]);}logger['error'](_0x885f('0xf'),_0x38da33,_0xece628[_0x885f('0x14')][_0x885f('0x16')]);return _0x35e2be(_0xece628[_0x885f('0x14')][_0x885f('0x16')]);}else{logger[_0x885f('0xe')](_0x885f('0xf'),_0x38da33,'request\x20sent');_0x35e2be(_0xece628[_0x885f('0x17')][_0x885f('0x16')]);}})[_0x885f('0x18')](function(_0x3b05a3){logger[_0x885f('0x14')](_0x885f('0xf'),_0x38da33,_0x3b05a3);_0x188593(_0x3b05a3);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index ce4fbe8..9dc83ce 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x1116dd,_0x5d68e0){var _0xfefdc7=function(_0x495cc6){while(--_0x495cc6){_0x1116dd['push'](_0x1116dd['shift']());}};_0xfefdc7(++_0x5d68e0);}(_0x2ef3,0xba));var _0x32ef=function(_0x5049d9,_0x414feb){_0x5049d9=_0x5049d9-0x0;var _0x461f6e=_0x2ef3[_0x5049d9];return _0x461f6e;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x1d6ad4,_0x5bd5dc){var _0x2ab4bc=function(_0x387551){while(--_0x387551){_0x1d6ad4['push'](_0x1d6ad4['shift']());}};_0x2ab4bc(++_0x5bd5dc);}(_0x2ef3,0xba));var _0x32ef=function(_0x14bd52,_0x2a1a66){_0x14bd52=_0x14bd52-0x0;var _0xe17b4a=_0x2ef3[_0x14bd52];return _0xe17b4a;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index c06e60d..45bbe25 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 _0x5da5=['name','sequelize','exports','STRING'];(function(_0x4fbf33,_0x318fbc){var _0x1997d2=function(_0xe41ffc){while(--_0xe41ffc){_0x4fbf33['push'](_0x4fbf33['shift']());}};_0x1997d2(++_0x318fbc);}(_0x5da5,0x119));var _0x55da=function(_0x46b573,_0x89627f){_0x46b573=_0x46b573-0x0;var _0x493b16=_0x5da5[_0x46b573];return _0x493b16;};'use strict';var Sequelize=require(_0x55da('0x0'));module[_0x55da('0x1')]={'name':{'type':Sequelize[_0x55da('0x2')],'unique':_0x55da('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x55da('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x55da('0x2')]},'phone':{'type':Sequelize[_0x55da('0x2')]},'fax':{'type':Sequelize[_0x55da('0x2')]},'type':{'type':Sequelize[_0x55da('0x2')]},'street':{'type':Sequelize[_0x55da('0x2')]},'postalCode':{'type':Sequelize[_0x55da('0x2')]},'city':{'type':Sequelize[_0x55da('0x2')]},'country':{'type':Sequelize[_0x55da('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x55da('0x2')]},'sPostalCode':{'type':Sequelize[_0x55da('0x2')]},'sCity':{'type':Sequelize[_0x55da('0x2')]},'sCountry':{'type':Sequelize[_0x55da('0x2')]},'description':{'type':Sequelize[_0x55da('0x2')]}};
\ No newline at end of file
+var _0xf3c0=['STRING','name','sequelize'];(function(_0x59daa0,_0x166be0){var _0x3f5479=function(_0x498ebf){while(--_0x498ebf){_0x59daa0['push'](_0x59daa0['shift']());}};_0x3f5479(++_0x166be0);}(_0xf3c0,0x77));var _0x0f3c=function(_0x28200c,_0x20991d){_0x28200c=_0x28200c-0x0;var _0x4f8ea3=_0xf3c0[_0x28200c];return _0x4f8ea3;};'use strict';var Sequelize=require(_0x0f3c('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f3c('0x1')],'unique':_0x0f3c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0f3c('0x1')]},'phone':{'type':Sequelize[_0x0f3c('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0f3c('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0f3c('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0f3c('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0f3c('0x1')]},'sStreet':{'type':Sequelize[_0x0f3c('0x1')]},'sPostalCode':{'type':Sequelize[_0x0f3c('0x1')]},'sCity':{'type':Sequelize[_0x0f3c('0x1')]},'sCountry':{'type':Sequelize[_0x0f3c('0x1')]},'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 8730d13..e74e95d 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 _0xca09=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','merge','map','options','includeAll','findAll','rows','catch','params','fields','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','ids','CmContact','rawAttributes','pick','filter','hasOwnProperty','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x3c6d1e,_0x567a06){var _0x3c9871=function(_0xf5f3d8){while(--_0xf5f3d8){_0x3c6d1e['push'](_0x3c6d1e['shift']());}};_0x3c9871(++_0x567a06);}(_0xca09,0xfa));var _0x9ca0=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xca09[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x9ca0('0x0'));var rimraf=require(_0x9ca0('0x1'));var zipdir=require(_0x9ca0('0x2'));var jsonpatch=require(_0x9ca0('0x3'));var rp=require(_0x9ca0('0x4'));var moment=require(_0x9ca0('0x5'));var BPromise=require(_0x9ca0('0x6'));var Mustache=require('mustache');var util=require(_0x9ca0('0x7'));var path=require(_0x9ca0('0x8'));var sox=require(_0x9ca0('0x9'));var csv=require(_0x9ca0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ca0('0xb'));var _=require(_0x9ca0('0xc'));var squel=require(_0x9ca0('0xd'));var crypto=require(_0x9ca0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9ca0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9ca0('0x10'));var Papa=require(_0x9ca0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9ca0('0x12'));var as=require(_0x9ca0('0x13'));var hardwareService=require(_0x9ca0('0x14'));var logger=require(_0x9ca0('0x15'))('api');var utils=require(_0x9ca0('0x16'));var config=require(_0x9ca0('0x17'));var licenseUtil=require(_0x9ca0('0x18'));var db=require(_0x9ca0('0x19'))['db'];function respondWithStatusCode(_0x4873ab,_0x211d09){_0x211d09=_0x211d09||0xcc;return function(_0x1c0278){if(_0x1c0278){return _0x4873ab[_0x9ca0('0x1a')](_0x211d09);}return _0x4873ab[_0x9ca0('0x1b')](_0x211d09)[_0x9ca0('0x1c')]();};}function respondWithResult(_0x120bea,_0x378c92){_0x378c92=_0x378c92||0xc8;return function(_0x5625a8){if(_0x5625a8){return _0x120bea[_0x9ca0('0x1b')](_0x378c92)['json'](_0x5625a8);}};}function respondWithFilteredResult(_0x2dd28c,_0x1c6769){return function(_0x84c9){if(_0x84c9){var _0x4ea2aa=typeof _0x1c6769[_0x9ca0('0x1d')]===_0x9ca0('0x1e')&&typeof _0x1c6769[_0x9ca0('0x1f')]===_0x9ca0('0x1e');var _0x4a64eb=_0x84c9[_0x9ca0('0x20')];var _0x1c2b07=_0x4ea2aa?0x0:_0x1c6769['offset'];var _0x42bdcc=_0x4ea2aa?_0x84c9['count']:_0x1c6769[_0x9ca0('0x1d')]+_0x1c6769['limit'];var _0x306a9f;if(_0x42bdcc>=_0x4a64eb){_0x42bdcc=_0x4a64eb;_0x306a9f=0xc8;}else{_0x306a9f=0xce;}_0x2dd28c[_0x9ca0('0x1b')](_0x306a9f);return _0x2dd28c[_0x9ca0('0x21')](_0x9ca0('0x22'),_0x1c2b07+'-'+_0x42bdcc+'/'+_0x4a64eb)[_0x9ca0('0x23')](_0x84c9);}return null;};}function patchUpdates(_0x1e0c8d){return function(_0x10a919){try{jsonpatch[_0x9ca0('0x24')](_0x10a919,_0x1e0c8d,!![]);}catch(_0x358491){return BPromise['reject'](_0x358491);}return _0x10a919[_0x9ca0('0x25')]();};}function saveUpdates(_0x5dbccd,_0x110e9f){return function(_0x13203c){if(_0x13203c){return _0x13203c[_0x9ca0('0x26')](_0x5dbccd)[_0x9ca0('0x27')](function(_0x3d6050){return _0x3d6050;});}return null;};}function removeEntity(_0x31d008,_0x52c9c8){return function(_0x187210){if(_0x187210){return _0x187210[_0x9ca0('0x28')]()[_0x9ca0('0x27')](function(){var _0x23cde0=_0x187210[_0x9ca0('0x29')]({'plain':!![]});var _0x42d22f='Companies';return db['UserProfileResource'][_0x9ca0('0x28')]({'where':{'type':_0x42d22f,'resourceId':_0x23cde0['id']}})[_0x9ca0('0x27')](function(){return _0x187210;});})[_0x9ca0('0x27')](function(){_0x31d008[_0x9ca0('0x1b')](0xcc)[_0x9ca0('0x1c')]();});}};}function handleEntityNotFound(_0x555334,_0x1eca18){return function(_0x4fa7cf){if(!_0x4fa7cf){_0x555334[_0x9ca0('0x1a')](0x194);}return _0x4fa7cf;};}function handleError(_0x1ec9e2,_0x4725e7){_0x4725e7=_0x4725e7||0x1f4;return function(_0x12f99c){logger[_0x9ca0('0x2a')](_0x12f99c[_0x9ca0('0x2b')]);if(_0x12f99c['name']){delete _0x12f99c[_0x9ca0('0x2c')];}_0x1ec9e2['status'](_0x4725e7)[_0x9ca0('0x2d')](_0x12f99c);};}exports[_0x9ca0('0x2e')]=function(_0x10de85,_0x311cf7){var _0x480c48={},_0x4ee5ac={},_0x8e0a3b={'count':0x0,'rows':[]};return db[_0x9ca0('0x2f')][_0x9ca0('0x30')]()[_0x9ca0('0x27')](function(_0x33fc86){_0x4ee5ac[_0x9ca0('0x31')]=_[_0x9ca0('0x32')](_0x33fc86);_0x4ee5ac[_0x9ca0('0x33')]=_['keys'](_0x10de85['query']);_0x4ee5ac[_0x9ca0('0x34')]=_[_0x9ca0('0x35')](_0x4ee5ac[_0x9ca0('0x31')],_0x4ee5ac[_0x9ca0('0x33')]);_0x480c48['attributes']=_[_0x9ca0('0x35')](_0x4ee5ac[_0x9ca0('0x31')],qs['fields'](_0x10de85[_0x9ca0('0x33')]['fields']));_0x480c48[_0x9ca0('0x36')]=_0x480c48[_0x9ca0('0x36')][_0x9ca0('0x37')]?_0x480c48[_0x9ca0('0x36')]:_0x4ee5ac[_0x9ca0('0x31')];if(!_0x10de85[_0x9ca0('0x33')]['hasOwnProperty'](_0x9ca0('0x38'))){_0x480c48['limit']=qs[_0x9ca0('0x1f')](_0x10de85[_0x9ca0('0x33')][_0x9ca0('0x1f')]);_0x480c48[_0x9ca0('0x1d')]=qs['offset'](_0x10de85[_0x9ca0('0x33')][_0x9ca0('0x1d')]);}_0x480c48[_0x9ca0('0x39')]=qs[_0x9ca0('0x3a')](_0x10de85[_0x9ca0('0x33')][_0x9ca0('0x3a')]);_0x480c48[_0x9ca0('0x3b')]=qs[_0x9ca0('0x34')](_['pick'](_0x10de85[_0x9ca0('0x33')],_0x4ee5ac[_0x9ca0('0x34')]),_0x33fc86);if(_0x10de85['query']['filter']){_0x480c48[_0x9ca0('0x3b')]=_[_0x9ca0('0x3c')](_0x480c48[_0x9ca0('0x3b')],{'$or':_[_0x9ca0('0x3d')](_0x480c48[_0x9ca0('0x36')],function(_0x1e7f19){var _0x1bd9ea={};_0x1bd9ea[_0x1e7f19]={'$like':'%'+_0x10de85[_0x9ca0('0x33')]['filter']+'%'};return _0x1bd9ea;})});}_0x480c48=_[_0x9ca0('0x3c')]({},_0x480c48,_0x10de85[_0x9ca0('0x3e')]);var _0x5c3899={'where':_0x480c48[_0x9ca0('0x3b')]};return db[_0x9ca0('0x2f')]['count'](_0x5c3899)[_0x9ca0('0x27')](function(_0x26ef47){_0x8e0a3b[_0x9ca0('0x20')]=_0x26ef47;if(_0x10de85['query'][_0x9ca0('0x3f')]){_0x480c48['include']=[{'all':!![]}];}return db['CmCompany'][_0x9ca0('0x40')](_0x480c48);})['then'](function(_0x470bbd){_0x8e0a3b[_0x9ca0('0x41')]=_0x470bbd;return _0x8e0a3b;})[_0x9ca0('0x27')](respondWithFilteredResult(_0x311cf7,_0x480c48))[_0x9ca0('0x42')](handleError(_0x311cf7,null));})[_0x9ca0('0x42')](handleError(_0x311cf7,null));};exports['show']=function(_0x891a22,_0x29ba16){var _0x295326={'raw':![],'where':{'id':_0x891a22[_0x9ca0('0x43')]['id']}},_0x1ad9d8={};_0x1ad9d8[_0x9ca0('0x31')]=_[_0x9ca0('0x32')](db[_0x9ca0('0x2f')]['rawAttributes']);_0x1ad9d8[_0x9ca0('0x33')]=_[_0x9ca0('0x32')](_0x891a22[_0x9ca0('0x33')]);_0x1ad9d8[_0x9ca0('0x34')]=_[_0x9ca0('0x35')](_0x1ad9d8['model'],_0x1ad9d8[_0x9ca0('0x33')]);_0x295326[_0x9ca0('0x36')]=_[_0x9ca0('0x35')](_0x1ad9d8[_0x9ca0('0x31')],qs[_0x9ca0('0x44')](_0x891a22[_0x9ca0('0x33')]['fields']));_0x295326[_0x9ca0('0x36')]=_0x295326['attributes'][_0x9ca0('0x37')]?_0x295326[_0x9ca0('0x36')]:_0x1ad9d8[_0x9ca0('0x31')];if(_0x891a22['query'][_0x9ca0('0x3f')]){_0x295326[_0x9ca0('0x45')]=[{'all':!![]}];}_0x295326=_[_0x9ca0('0x3c')]({},_0x295326,_0x891a22[_0x9ca0('0x3e')]);return db['CmCompany'][_0x9ca0('0x46')](_0x295326)[_0x9ca0('0x27')](handleEntityNotFound(_0x29ba16,null))[_0x9ca0('0x27')](respondWithResult(_0x29ba16,null))['catch'](handleError(_0x29ba16,null));};exports[_0x9ca0('0x47')]=function(_0x57305d,_0x87f9d3){return db[_0x9ca0('0x2f')]['create'](_0x57305d['body'],{})[_0x9ca0('0x27')](function(_0x5b09fb){var _0x56715d=_0x57305d[_0x9ca0('0x48')][_0x9ca0('0x29')]({'plain':!![]});if(!_0x56715d)throw new Error(_0x9ca0('0x49'));if(_0x56715d['role']==='user'){var _0x2fed34=_0x5b09fb[_0x9ca0('0x29')]({'plain':!![]});var _0xc5ba41=_0x9ca0('0x4a');return db[_0x9ca0('0x4b')][_0x9ca0('0x46')]({'where':{'name':_0xc5ba41,'userProfileId':_0x56715d['userProfileId']},'raw':!![]})[_0x9ca0('0x27')](function(_0x1d2a9e){if(_0x1d2a9e&&_0x1d2a9e[_0x9ca0('0x4c')]===0x0){return db[_0x9ca0('0x4d')]['create']({'name':_0x2fed34[_0x9ca0('0x2c')],'resourceId':_0x2fed34['id'],'type':_0x1d2a9e[_0x9ca0('0x2c')],'sectionId':_0x1d2a9e['id']},{})[_0x9ca0('0x27')](function(){return _0x5b09fb;});}else{return _0x5b09fb;}})['catch'](function(_0x5d75b4){logger[_0x9ca0('0x2a')](_0x9ca0('0x4e'),_0x5d75b4);throw _0x5d75b4;});}return _0x5b09fb;})[_0x9ca0('0x27')](respondWithResult(_0x87f9d3,0xc9))['catch'](handleError(_0x87f9d3,null));};exports[_0x9ca0('0x26')]=function(_0x37bf01,_0x59d8aa){if(_0x37bf01[_0x9ca0('0x4f')]['id']){delete _0x37bf01['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x37bf01[_0x9ca0('0x43')]['id']}})['then'](handleEntityNotFound(_0x59d8aa,null))['then'](saveUpdates(_0x37bf01[_0x9ca0('0x4f')],null))[_0x9ca0('0x27')](respondWithResult(_0x59d8aa,null))[_0x9ca0('0x42')](handleError(_0x59d8aa,null));};exports[_0x9ca0('0x28')]=function(_0x36196a,_0x4978a6){return db[_0x9ca0('0x2f')][_0x9ca0('0x46')]({'where':{'id':_0x36196a[_0x9ca0('0x43')]['id']}})['then'](handleEntityNotFound(_0x4978a6,null))[_0x9ca0('0x27')](removeEntity(_0x4978a6,null))[_0x9ca0('0x42')](handleError(_0x4978a6,null));};exports[_0x9ca0('0x30')]=function(_0x574e68,_0x29b71d){return db[_0x9ca0('0x2f')][_0x9ca0('0x30')]()[_0x9ca0('0x27')](respondWithResult(_0x29b71d,null))['catch'](handleError(_0x29b71d,null));};exports['addContacts']=function(_0x89ab38,_0x941b59,_0x4f7736){return db['CmContact'][_0x9ca0('0x46')]({'where':{'id':_0x89ab38[_0x9ca0('0x43')]['id']}})[_0x9ca0('0x27')](handleEntityNotFound(_0x941b59,null))[_0x9ca0('0x27')](function(_0x2c8b07){if(_0x2c8b07){return _0x2c8b07['addContacts'](_0x89ab38[_0x9ca0('0x4f')][_0x9ca0('0x50')],_['omit'](_0x89ab38['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x941b59,null))[_0x9ca0('0x42')](handleError(_0x941b59,null));};exports['getContacts']=function(_0x49bb3f,_0x134f1e,_0x1dd7e9){var _0x3ca861={};var _0x4afee6={};var _0x54fc01;var _0x12aa00;return db['CmCompany']['findOne']({'where':{'id':_0x49bb3f[_0x9ca0('0x43')]['id']}})[_0x9ca0('0x27')](handleEntityNotFound(_0x134f1e,null))['then'](function(_0x1c5fcf){if(_0x1c5fcf){_0x54fc01=_0x1c5fcf;_0x4afee6[_0x9ca0('0x31')]=_['keys'](db[_0x9ca0('0x51')][_0x9ca0('0x52')]);_0x4afee6[_0x9ca0('0x33')]=_[_0x9ca0('0x32')](_0x49bb3f[_0x9ca0('0x33')]);_0x4afee6[_0x9ca0('0x34')]=_[_0x9ca0('0x35')](_0x4afee6[_0x9ca0('0x31')],_0x4afee6[_0x9ca0('0x33')]);_0x3ca861[_0x9ca0('0x36')]=_[_0x9ca0('0x35')](_0x4afee6[_0x9ca0('0x31')],qs['fields'](_0x49bb3f[_0x9ca0('0x33')][_0x9ca0('0x44')]));_0x3ca861[_0x9ca0('0x36')]=_0x3ca861['attributes'][_0x9ca0('0x37')]?_0x3ca861['attributes']:_0x4afee6['model'];_0x3ca861[_0x9ca0('0x39')]=qs[_0x9ca0('0x3a')](_0x49bb3f[_0x9ca0('0x33')]['sort']);_0x3ca861['where']=qs['filters'](_[_0x9ca0('0x53')](_0x49bb3f['query'],_0x4afee6[_0x9ca0('0x34')]));if(_0x49bb3f[_0x9ca0('0x33')][_0x9ca0('0x54')]){_0x3ca861[_0x9ca0('0x3b')]=_[_0x9ca0('0x3c')](_0x3ca861[_0x9ca0('0x3b')],{'$or':_[_0x9ca0('0x3d')](_0x3ca861[_0x9ca0('0x36')],function(_0x51d8b0){var _0x4a09ed={};_0x4a09ed[_0x51d8b0]={'$like':'%'+_0x49bb3f[_0x9ca0('0x33')][_0x9ca0('0x54')]+'%'};return _0x4a09ed;})});}_0x3ca861=_['merge']({},_0x3ca861,_0x49bb3f[_0x9ca0('0x3e')]);return _0x54fc01['getContacts'](_0x3ca861);}})[_0x9ca0('0x27')](function(_0x11e123){if(_0x11e123){_0x12aa00=_0x11e123[_0x9ca0('0x37')];if(!_0x49bb3f['query'][_0x9ca0('0x55')](_0x9ca0('0x38'))){_0x3ca861[_0x9ca0('0x1f')]=qs[_0x9ca0('0x1f')](_0x49bb3f[_0x9ca0('0x33')]['limit']);_0x3ca861[_0x9ca0('0x1d')]=qs[_0x9ca0('0x1d')](_0x49bb3f[_0x9ca0('0x33')][_0x9ca0('0x1d')]);}return _0x54fc01[_0x9ca0('0x56')](_0x3ca861);}})[_0x9ca0('0x27')](function(_0x3ae238){if(_0x3ae238){return _0x3ae238?{'count':_0x12aa00,'rows':_0x3ae238}:null;}})['then'](respondWithResult(_0x134f1e,null))['catch'](handleError(_0x134f1e,null));};
\ No newline at end of file
+var _0xadf3=['reject','save','update','then','destroy','get','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addContacts','ids','omit','getContacts','findOne','CmContact','nolimit','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x1614aa,_0x15f8c6){var _0x11e4bf=function(_0x2dab9f){while(--_0x2dab9f){_0x1614aa['push'](_0x1614aa['shift']());}};_0x11e4bf(++_0x15f8c6);}(_0xadf3,0x186));var _0x3adf=function(_0x2d1d55,_0x2381a6){_0x2d1d55=_0x2d1d55-0x0;var _0x1b52f3=_0xadf3[_0x2d1d55];return _0x1b52f3;};'use strict';var emlformat=require(_0x3adf('0x0'));var rimraf=require(_0x3adf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3adf('0x2'));var rp=require('request-promise');var moment=require(_0x3adf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3adf('0x4'));var util=require(_0x3adf('0x5'));var path=require('path');var sox=require(_0x3adf('0x6'));var csv=require('to-csv');var ejs=require(_0x3adf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3adf('0x8'));var squel=require(_0x3adf('0x9'));var crypto=require(_0x3adf('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3adf('0xb'));var querystring=require(_0x3adf('0xc'));var Papa=require(_0x3adf('0xd'));var Redis=require(_0x3adf('0xe'));var authService=require(_0x3adf('0xf'));var qs=require(_0x3adf('0x10'));var as=require(_0x3adf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3adf('0x12'));var utils=require(_0x3adf('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3adf('0x14'));var db=require(_0x3adf('0x15'))['db'];function respondWithStatusCode(_0x819ecb,_0x36392a){_0x36392a=_0x36392a||0xcc;return function(_0x208dd2){if(_0x208dd2){return _0x819ecb[_0x3adf('0x16')](_0x36392a);}return _0x819ecb[_0x3adf('0x17')](_0x36392a)[_0x3adf('0x18')]();};}function respondWithResult(_0x236236,_0x41cea2){_0x41cea2=_0x41cea2||0xc8;return function(_0x21c768){if(_0x21c768){return _0x236236[_0x3adf('0x17')](_0x41cea2)[_0x3adf('0x19')](_0x21c768);}};}function respondWithFilteredResult(_0x275da1,_0x46ed9e){return function(_0x4519c3){if(_0x4519c3){var _0x3ffe80=typeof _0x46ed9e['offset']===_0x3adf('0x1a')&&typeof _0x46ed9e[_0x3adf('0x1b')]===_0x3adf('0x1a');var _0x1ff416=_0x4519c3[_0x3adf('0x1c')];var _0x2a6ecd=_0x3ffe80?0x0:_0x46ed9e[_0x3adf('0x1d')];var _0x4ea3fd=_0x3ffe80?_0x4519c3['count']:_0x46ed9e[_0x3adf('0x1d')]+_0x46ed9e[_0x3adf('0x1b')];var _0xddac02;if(_0x4ea3fd>=_0x1ff416){_0x4ea3fd=_0x1ff416;_0xddac02=0xc8;}else{_0xddac02=0xce;}_0x275da1['status'](_0xddac02);return _0x275da1['set']('Content-Range',_0x2a6ecd+'-'+_0x4ea3fd+'/'+_0x1ff416)[_0x3adf('0x19')](_0x4519c3);}return null;};}function patchUpdates(_0x1ac072){return function(_0xd9c34a){try{jsonpatch['apply'](_0xd9c34a,_0x1ac072,!![]);}catch(_0x4754ab){return BPromise[_0x3adf('0x1e')](_0x4754ab);}return _0xd9c34a[_0x3adf('0x1f')]();};}function saveUpdates(_0xa5e38d,_0x9f2da0){return function(_0x140058){if(_0x140058){return _0x140058[_0x3adf('0x20')](_0xa5e38d)[_0x3adf('0x21')](function(_0xe84270){return _0xe84270;});}return null;};}function removeEntity(_0x177b60,_0x383448){return function(_0x134956){if(_0x134956){return _0x134956[_0x3adf('0x22')]()[_0x3adf('0x21')](function(){var _0x51f296=_0x134956[_0x3adf('0x23')]({'plain':!![]});var _0x156141='Companies';return db['UserProfileResource'][_0x3adf('0x22')]({'where':{'type':_0x156141,'resourceId':_0x51f296['id']}})[_0x3adf('0x21')](function(){return _0x134956;});})[_0x3adf('0x21')](function(){_0x177b60[_0x3adf('0x17')](0xcc)[_0x3adf('0x18')]();});}};}function handleEntityNotFound(_0x3c093e,_0x25751e){return function(_0x2b132c){if(!_0x2b132c){_0x3c093e[_0x3adf('0x16')](0x194);}return _0x2b132c;};}function handleError(_0x228385,_0x385609){_0x385609=_0x385609||0x1f4;return function(_0x5b3601){logger[_0x3adf('0x24')](_0x5b3601[_0x3adf('0x25')]);if(_0x5b3601[_0x3adf('0x26')]){delete _0x5b3601[_0x3adf('0x26')];}_0x228385[_0x3adf('0x17')](_0x385609)[_0x3adf('0x27')](_0x5b3601);};}exports[_0x3adf('0x28')]=function(_0xc38fb5,_0x3500da){var _0x30d556={},_0x4f25ef={},_0x57a7d2={'count':0x0,'rows':[]};return db[_0x3adf('0x29')][_0x3adf('0x2a')]()['then'](function(_0x183902){_0x4f25ef[_0x3adf('0x2b')]=_[_0x3adf('0x2c')](_0x183902);_0x4f25ef[_0x3adf('0x2d')]=_[_0x3adf('0x2c')](_0xc38fb5[_0x3adf('0x2d')]);_0x4f25ef[_0x3adf('0x2e')]=_['intersection'](_0x4f25ef[_0x3adf('0x2b')],_0x4f25ef[_0x3adf('0x2d')]);_0x30d556[_0x3adf('0x2f')]=_[_0x3adf('0x30')](_0x4f25ef['model'],qs['fields'](_0xc38fb5[_0x3adf('0x2d')][_0x3adf('0x31')]));_0x30d556['attributes']=_0x30d556[_0x3adf('0x2f')][_0x3adf('0x32')]?_0x30d556[_0x3adf('0x2f')]:_0x4f25ef[_0x3adf('0x2b')];if(!_0xc38fb5[_0x3adf('0x2d')]['hasOwnProperty']('nolimit')){_0x30d556['limit']=qs[_0x3adf('0x1b')](_0xc38fb5[_0x3adf('0x2d')][_0x3adf('0x1b')]);_0x30d556[_0x3adf('0x1d')]=qs[_0x3adf('0x1d')](_0xc38fb5[_0x3adf('0x2d')]['offset']);}_0x30d556[_0x3adf('0x33')]=qs[_0x3adf('0x34')](_0xc38fb5[_0x3adf('0x2d')][_0x3adf('0x34')]);_0x30d556[_0x3adf('0x35')]=qs[_0x3adf('0x2e')](_[_0x3adf('0x36')](_0xc38fb5[_0x3adf('0x2d')],_0x4f25ef[_0x3adf('0x2e')]),_0x183902);if(_0xc38fb5[_0x3adf('0x2d')][_0x3adf('0x37')]){_0x30d556[_0x3adf('0x35')]=_[_0x3adf('0x38')](_0x30d556[_0x3adf('0x35')],{'$or':_[_0x3adf('0x39')](_0x30d556[_0x3adf('0x2f')],function(_0x5bcf9c){var _0x2b50c9={};_0x2b50c9[_0x5bcf9c]={'$like':'%'+_0xc38fb5['query']['filter']+'%'};return _0x2b50c9;})});}_0x30d556=_[_0x3adf('0x38')]({},_0x30d556,_0xc38fb5[_0x3adf('0x3a')]);var _0xb282c={'where':_0x30d556['where']};return db[_0x3adf('0x29')][_0x3adf('0x1c')](_0xb282c)[_0x3adf('0x21')](function(_0x145b3e){_0x57a7d2['count']=_0x145b3e;if(_0xc38fb5[_0x3adf('0x2d')][_0x3adf('0x3b')]){_0x30d556[_0x3adf('0x3c')]=[{'all':!![]}];}return db[_0x3adf('0x29')][_0x3adf('0x3d')](_0x30d556);})[_0x3adf('0x21')](function(_0x47bf21){_0x57a7d2[_0x3adf('0x3e')]=_0x47bf21;return _0x57a7d2;})[_0x3adf('0x21')](respondWithFilteredResult(_0x3500da,_0x30d556))['catch'](handleError(_0x3500da,null));})[_0x3adf('0x3f')](handleError(_0x3500da,null));};exports[_0x3adf('0x40')]=function(_0x3500b3,_0x1dbfd0){var _0x1b6df5={'raw':![],'where':{'id':_0x3500b3[_0x3adf('0x41')]['id']}},_0x2437f5={};_0x2437f5[_0x3adf('0x2b')]=_[_0x3adf('0x2c')](db[_0x3adf('0x29')][_0x3adf('0x42')]);_0x2437f5[_0x3adf('0x2d')]=_['keys'](_0x3500b3[_0x3adf('0x2d')]);_0x2437f5[_0x3adf('0x2e')]=_[_0x3adf('0x30')](_0x2437f5[_0x3adf('0x2b')],_0x2437f5[_0x3adf('0x2d')]);_0x1b6df5[_0x3adf('0x2f')]=_[_0x3adf('0x30')](_0x2437f5[_0x3adf('0x2b')],qs[_0x3adf('0x31')](_0x3500b3[_0x3adf('0x2d')][_0x3adf('0x31')]));_0x1b6df5[_0x3adf('0x2f')]=_0x1b6df5[_0x3adf('0x2f')]['length']?_0x1b6df5[_0x3adf('0x2f')]:_0x2437f5[_0x3adf('0x2b')];if(_0x3500b3[_0x3adf('0x2d')][_0x3adf('0x3b')]){_0x1b6df5[_0x3adf('0x3c')]=[{'all':!![]}];}_0x1b6df5=_[_0x3adf('0x38')]({},_0x1b6df5,_0x3500b3[_0x3adf('0x3a')]);return db[_0x3adf('0x29')]['find'](_0x1b6df5)['then'](handleEntityNotFound(_0x1dbfd0,null))[_0x3adf('0x21')](respondWithResult(_0x1dbfd0,null))['catch'](handleError(_0x1dbfd0,null));};exports[_0x3adf('0x43')]=function(_0x2c426f,_0x28f07f){return db[_0x3adf('0x29')][_0x3adf('0x43')](_0x2c426f[_0x3adf('0x44')],{})['then'](function(_0x4a20df){var _0x46ce99=_0x2c426f['user'][_0x3adf('0x23')]({'plain':!![]});if(!_0x46ce99)throw new Error(_0x3adf('0x45'));if(_0x46ce99['role']===_0x3adf('0x46')){var _0x53d1b8=_0x4a20df[_0x3adf('0x23')]({'plain':!![]});var _0x4b2633=_0x3adf('0x47');return db[_0x3adf('0x48')]['find']({'where':{'name':_0x4b2633,'userProfileId':_0x46ce99[_0x3adf('0x49')]},'raw':!![]})[_0x3adf('0x21')](function(_0x246fb7){if(_0x246fb7&&_0x246fb7[_0x3adf('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x53d1b8[_0x3adf('0x26')],'resourceId':_0x53d1b8['id'],'type':_0x246fb7[_0x3adf('0x26')],'sectionId':_0x246fb7['id']},{})[_0x3adf('0x21')](function(){return _0x4a20df;});}else{return _0x4a20df;}})[_0x3adf('0x3f')](function(_0x12d306){logger['error'](_0x3adf('0x4b'),_0x12d306);throw _0x12d306;});}return _0x4a20df;})[_0x3adf('0x21')](respondWithResult(_0x28f07f,0xc9))[_0x3adf('0x3f')](handleError(_0x28f07f,null));};exports[_0x3adf('0x20')]=function(_0x24e2a1,_0x5eab31){if(_0x24e2a1[_0x3adf('0x44')]['id']){delete _0x24e2a1[_0x3adf('0x44')]['id'];}return db[_0x3adf('0x29')]['find']({'where':{'id':_0x24e2a1[_0x3adf('0x41')]['id']}})[_0x3adf('0x21')](handleEntityNotFound(_0x5eab31,null))[_0x3adf('0x21')](saveUpdates(_0x24e2a1[_0x3adf('0x44')],null))[_0x3adf('0x21')](respondWithResult(_0x5eab31,null))[_0x3adf('0x3f')](handleError(_0x5eab31,null));};exports[_0x3adf('0x22')]=function(_0x3b2fe5,_0x3c59c1){return db[_0x3adf('0x29')][_0x3adf('0x4c')]({'where':{'id':_0x3b2fe5['params']['id']}})[_0x3adf('0x21')](handleEntityNotFound(_0x3c59c1,null))[_0x3adf('0x21')](removeEntity(_0x3c59c1,null))['catch'](handleError(_0x3c59c1,null));};exports[_0x3adf('0x2a')]=function(_0xed1a2e,_0x1b6a28){return db[_0x3adf('0x29')][_0x3adf('0x2a')]()[_0x3adf('0x21')](respondWithResult(_0x1b6a28,null))[_0x3adf('0x3f')](handleError(_0x1b6a28,null));};exports[_0x3adf('0x4d')]=function(_0x4b9650,_0x14e942,_0x48c59d){return db['CmContact'][_0x3adf('0x4c')]({'where':{'id':_0x4b9650[_0x3adf('0x41')]['id']}})[_0x3adf('0x21')](handleEntityNotFound(_0x14e942,null))[_0x3adf('0x21')](function(_0x118f1c){if(_0x118f1c){return _0x118f1c[_0x3adf('0x4d')](_0x4b9650[_0x3adf('0x44')][_0x3adf('0x4e')],_[_0x3adf('0x4f')](_0x4b9650[_0x3adf('0x44')],['ids','id'])||{});}})['then'](respondWithResult(_0x14e942,null))[_0x3adf('0x3f')](handleError(_0x14e942,null));};exports[_0x3adf('0x50')]=function(_0x9d4dcf,_0x21a8fe,_0x455efe){var _0x544208={};var _0x54773c={};var _0x38a899;var _0xf14a1;return db[_0x3adf('0x29')][_0x3adf('0x51')]({'where':{'id':_0x9d4dcf[_0x3adf('0x41')]['id']}})['then'](handleEntityNotFound(_0x21a8fe,null))[_0x3adf('0x21')](function(_0x4ce790){if(_0x4ce790){_0x38a899=_0x4ce790;_0x54773c[_0x3adf('0x2b')]=_[_0x3adf('0x2c')](db[_0x3adf('0x52')][_0x3adf('0x42')]);_0x54773c[_0x3adf('0x2d')]=_['keys'](_0x9d4dcf[_0x3adf('0x2d')]);_0x54773c['filters']=_[_0x3adf('0x30')](_0x54773c['model'],_0x54773c['query']);_0x544208[_0x3adf('0x2f')]=_[_0x3adf('0x30')](_0x54773c[_0x3adf('0x2b')],qs['fields'](_0x9d4dcf[_0x3adf('0x2d')]['fields']));_0x544208[_0x3adf('0x2f')]=_0x544208['attributes'][_0x3adf('0x32')]?_0x544208['attributes']:_0x54773c[_0x3adf('0x2b')];_0x544208[_0x3adf('0x33')]=qs[_0x3adf('0x34')](_0x9d4dcf['query'][_0x3adf('0x34')]);_0x544208[_0x3adf('0x35')]=qs[_0x3adf('0x2e')](_[_0x3adf('0x36')](_0x9d4dcf[_0x3adf('0x2d')],_0x54773c[_0x3adf('0x2e')]));if(_0x9d4dcf[_0x3adf('0x2d')][_0x3adf('0x37')]){_0x544208[_0x3adf('0x35')]=_[_0x3adf('0x38')](_0x544208['where'],{'$or':_[_0x3adf('0x39')](_0x544208[_0x3adf('0x2f')],function(_0x4f4e82){var _0x1617cd={};_0x1617cd[_0x4f4e82]={'$like':'%'+_0x9d4dcf['query'][_0x3adf('0x37')]+'%'};return _0x1617cd;})});}_0x544208=_['merge']({},_0x544208,_0x9d4dcf[_0x3adf('0x3a')]);return _0x38a899['getContacts'](_0x544208);}})['then'](function(_0x40b8b2){if(_0x40b8b2){_0xf14a1=_0x40b8b2[_0x3adf('0x32')];if(!_0x9d4dcf['query']['hasOwnProperty'](_0x3adf('0x53'))){_0x544208[_0x3adf('0x1b')]=qs[_0x3adf('0x1b')](_0x9d4dcf[_0x3adf('0x2d')][_0x3adf('0x1b')]);_0x544208[_0x3adf('0x1d')]=qs[_0x3adf('0x1d')](_0x9d4dcf[_0x3adf('0x2d')][_0x3adf('0x1d')]);}return _0x38a899[_0x3adf('0x50')](_0x544208);}})[_0x3adf('0x21')](function(_0xa7b9ca){if(_0xa7b9ca){return _0xa7b9ca?{'count':_0xf14a1,'rows':_0xa7b9ca}:null;}})[_0x3adf('0x21')](respondWithResult(_0x21a8fe,null))['catch'](handleError(_0x21a8fe,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 7b0bbcc..4736aba 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 _0x0676=['./cmCompany.attributes','exports','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0676,0xa8));var _0x6067=function(_0x253709,_0x4d2971){_0x253709=_0x253709-0x0;var _0x339a00=_0x0676[_0x253709];return _0x339a00;};'use strict';var _=require(_0x6067('0x0'));var util=require('util');var logger=require(_0x6067('0x1'))(_0x6067('0x2'));var moment=require(_0x6067('0x3'));var BPromise=require(_0x6067('0x4'));var rp=require(_0x6067('0x5'));var fs=require('fs');var path=require(_0x6067('0x6'));var rimraf=require('rimraf');var config=require(_0x6067('0x7'));var attributes=require(_0x6067('0x8'));module[_0x6067('0x9')]=function(_0x19ba51,_0x12e4d1){return _0x19ba51['define']('CmCompany',attributes,{'tableName':_0x6067('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3abf=['rimraf','./cmCompany.attributes','CmCompany','cm_companies','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0x3abf,0x162));var _0xf3ab=function(_0x567c75,_0x4d1e21){_0x567c75=_0x567c75-0x0;var _0x1eed54=_0x3abf[_0x567c75];return _0x1eed54;};'use strict';var _=require(_0xf3ab('0x0'));var util=require(_0xf3ab('0x1'));var logger=require(_0xf3ab('0x2'))('api');var moment=require(_0xf3ab('0x3'));var BPromise=require('bluebird');var rp=require(_0xf3ab('0x4'));var fs=require('fs');var path=require(_0xf3ab('0x5'));var rimraf=require(_0xf3ab('0x6'));var config=require('../../config/environment');var attributes=require(_0xf3ab('0x7'));module['exports']=function(_0x4b6476,_0x40d667){return _0x4b6476['define'](_0xf3ab('0x8'),attributes,{'tableName':_0xf3ab('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 bbac788..04fe44c 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 _0xc744=['stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0xd3eee0,_0x158bc2){var _0x449aa2=function(_0xdc4490){while(--_0xdc4490){_0xd3eee0['push'](_0xd3eee0['shift']());}};_0x449aa2(++_0x158bc2);}(_0xc744,0x1bb));var _0x4c74=function(_0x55d608,_0x2e9858){_0x55d608=_0x55d608-0x0;var _0x27ff79=_0xc744[_0x55d608];return _0x27ff79;};'use strict';var _=require(_0x4c74('0x0'));var util=require(_0x4c74('0x1'));var moment=require(_0x4c74('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c74('0x3'));var fs=require('fs');var Redis=require(_0x4c74('0x4'));var db=require(_0x4c74('0x5'))['db'];var utils=require(_0x4c74('0x6'));var logger=require(_0x4c74('0x7'))(_0x4c74('0x8'));var config=require(_0x4c74('0x9'));var jayson=require(_0x4c74('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f468a,_0x26da0e,_0x348393){return new BPromise(function(_0x106f33,_0x3facea){return client[_0x4c74('0xb')](_0x2f468a,_0x348393)[_0x4c74('0xc')](function(_0x3b0a09){logger[_0x4c74('0xd')]('CmCompany,\x20%s,\x20%s',_0x26da0e,_0x4c74('0xe'));logger[_0x4c74('0xf')](_0x4c74('0x10'),_0x26da0e,_0x4c74('0xe'),JSON[_0x4c74('0x11')](_0x3b0a09));if(_0x3b0a09[_0x4c74('0x12')]){if(_0x3b0a09[_0x4c74('0x12')]['code']===0x1f4){logger['error'](_0x4c74('0x13'),_0x26da0e,_0x3b0a09[_0x4c74('0x12')][_0x4c74('0x14')]);return _0x3facea(_0x3b0a09[_0x4c74('0x12')][_0x4c74('0x14')]);}logger[_0x4c74('0x12')](_0x4c74('0x13'),_0x26da0e,_0x3b0a09[_0x4c74('0x12')][_0x4c74('0x14')]);return _0x106f33(_0x3b0a09[_0x4c74('0x12')][_0x4c74('0x14')]);}else{logger[_0x4c74('0xd')](_0x4c74('0x13'),_0x26da0e,'request\x20sent');_0x106f33(_0x3b0a09[_0x4c74('0x15')][_0x4c74('0x14')]);}})[_0x4c74('0x16')](function(_0x880a1a){logger[_0x4c74('0x12')](_0x4c74('0x13'),_0x26da0e,_0x880a1a);_0x3facea(_0x880a1a);});});}
\ No newline at end of file
+var _0x02a3=['moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x58032b,_0x573897){var _0x2a4028=function(_0x2a179e){while(--_0x2a179e){_0x58032b['push'](_0x58032b['shift']());}};_0x2a4028(++_0x573897);}(_0x02a3,0xc4));var _0x302a=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x02a3[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0x302a('0x0'));var util=require(_0x302a('0x1'));var moment=require(_0x302a('0x2'));var BPromise=require(_0x302a('0x3'));var rs=require(_0x302a('0x4'));var fs=require('fs');var Redis=require(_0x302a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x302a('0x6'));var jayson=require(_0x302a('0x7'));var client=jayson[_0x302a('0x8')][_0x302a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x413a03,_0x359a47,_0x2d2e9f){return new BPromise(function(_0x1caafb,_0x2a8596){return client['request'](_0x413a03,_0x2d2e9f)[_0x302a('0xa')](function(_0x1623bb){logger[_0x302a('0xb')](_0x302a('0xc'),_0x359a47,_0x302a('0xd'));logger[_0x302a('0xe')](_0x302a('0xf'),_0x359a47,_0x302a('0xd'),JSON[_0x302a('0x10')](_0x1623bb));if(_0x1623bb[_0x302a('0x11')]){if(_0x1623bb[_0x302a('0x11')][_0x302a('0x12')]===0x1f4){logger[_0x302a('0x11')](_0x302a('0xc'),_0x359a47,_0x1623bb[_0x302a('0x11')][_0x302a('0x13')]);return _0x2a8596(_0x1623bb[_0x302a('0x11')]['message']);}logger[_0x302a('0x11')](_0x302a('0xc'),_0x359a47,_0x1623bb[_0x302a('0x11')][_0x302a('0x13')]);return _0x1caafb(_0x1623bb[_0x302a('0x11')][_0x302a('0x13')]);}else{logger[_0x302a('0xb')](_0x302a('0xc'),_0x359a47,_0x302a('0xd'));_0x1caafb(_0x1623bb[_0x302a('0x14')][_0x302a('0x13')]);}})[_0x302a('0x15')](function(_0x2687c5){logger[_0x302a('0x11')](_0x302a('0xc'),_0x359a47,_0x2687c5);_0x2a8596(_0x2687c5);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 26ffa84..a18c9d1 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 _0x3087=['isAuthenticated','describe','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','index','/describe'];(function(_0x5357c8,_0x3e6423){var _0x5e3a96=function(_0x1964df){while(--_0x1964df){_0x5357c8['push'](_0x5357c8['shift']());}};_0x5e3a96(++_0x3e6423);}(_0x3087,0xd1));var _0x7308=function(_0x3e8deb,_0x314616){_0x3e8deb=_0x3e8deb-0x0;var _0x5a23f7=_0x3087[_0x3e8deb];return _0x5a23f7;};'use strict';var multer=require(_0x7308('0x0'));var util=require(_0x7308('0x1'));var path=require('path');var timeout=require(_0x7308('0x2'));var express=require(_0x7308('0x3'));var router=express[_0x7308('0x4')]();var fs_extra=require(_0x7308('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7308('0x6'));var controller=require(_0x7308('0x7'));router[_0x7308('0x8')]('/',auth['isAuthenticated'](),controller[_0x7308('0x9')]);router[_0x7308('0x8')](_0x7308('0xa'),auth[_0x7308('0xb')](),controller[_0x7308('0xc')]);router[_0x7308('0x8')]('/:id',auth[_0x7308('0xb')](),controller['show']);router[_0x7308('0x8')](_0x7308('0xd'),auth[_0x7308('0xb')](),controller[_0x7308('0xe')]);router[_0x7308('0xf')]('/',auth[_0x7308('0xb')](),controller[_0x7308('0x10')]);router[_0x7308('0xf')](_0x7308('0xd'),auth[_0x7308('0xb')](),controller[_0x7308('0x11')]);router[_0x7308('0x12')](_0x7308('0x13'),auth[_0x7308('0xb')](),controller[_0x7308('0x14')]);router['delete'](_0x7308('0x13'),auth[_0x7308('0xb')](),controller[_0x7308('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x0cd1=['addContacts','put','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','index','describe','/:id','isAuthenticated','show','getContacts','post','create'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x0cd1,0x131));var _0x10cd=function(_0x44ceee,_0x2a5e28){_0x44ceee=_0x44ceee-0x0;var _0x1a065c=_0x0cd1[_0x44ceee];return _0x1a065c;};'use strict';var multer=require('multer');var util=require(_0x10cd('0x0'));var path=require(_0x10cd('0x1'));var timeout=require(_0x10cd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x10cd('0x3'));var auth=require(_0x10cd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x10cd('0x5'));var controller=require('./cmCompany.controller');router[_0x10cd('0x6')]('/',auth['isAuthenticated'](),controller[_0x10cd('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x10cd('0x8')]);router[_0x10cd('0x6')](_0x10cd('0x9'),auth[_0x10cd('0xa')](),controller[_0x10cd('0xb')]);router[_0x10cd('0x6')]('/:id/contacts',auth[_0x10cd('0xa')](),controller[_0x10cd('0xc')]);router[_0x10cd('0xd')]('/',auth[_0x10cd('0xa')](),controller[_0x10cd('0xe')]);router[_0x10cd('0xd')]('/:id/contacts',auth[_0x10cd('0xa')](),controller[_0x10cd('0xf')]);router[_0x10cd('0x10')](_0x10cd('0x9'),auth[_0x10cd('0xa')](),controller['update']);router[_0x10cd('0x11')](_0x10cd('0x9'),auth[_0x10cd('0xa')](),controller[_0x10cd('0x12')]);module[_0x10cd('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index ed9a246..c8749c9 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 _0xa3cc=['UNSIGNED','DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x3a0853,_0x2c5f2a){var _0x51d3ce=function(_0x5f199e){while(--_0x5f199e){_0x3a0853['push'](_0x3a0853['shift']());}};_0x51d3ce(++_0x2c5f2a);}(_0xa3cc,0x14b));var _0xca3c=function(_0x231032,_0x1c6cf7){_0x231032=_0x231032-0x0;var _0x574762=_0xa3cc[_0x231032];return _0x574762;};'use strict';var _=require('lodash');var Sequelize=require(_0xca3c('0x0'));module[_0xca3c('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xca3c('0x2')]},'street':{'type':Sequelize[_0xca3c('0x2')]},'postalCode':{'type':Sequelize[_0xca3c('0x2')]},'city':{'type':Sequelize[_0xca3c('0x2')]},'country':{'type':Sequelize[_0xca3c('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xca3c('0x3')]},'phone':{'type':Sequelize[_0xca3c('0x2')]},'mobile':{'type':Sequelize[_0xca3c('0x2')]},'fax':{'type':Sequelize[_0xca3c('0x2')]},'email':{'type':Sequelize[_0xca3c('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xca3c('0x2')]},'fb_data':{'type':Sequelize[_0xca3c('0x2')]},'twitter':{'type':Sequelize[_0xca3c('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xca3c('0x2')]},'viber':{'type':Sequelize[_0xca3c('0x2')]},'line':{'type':Sequelize[_0xca3c('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xca3c('0x2')]},'UserId':{'type':Sequelize[_0xca3c('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xca3c('0x4')](0x2)[_0xca3c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xca3c('0x6')],'defaultValue':Sequelize[_0xca3c('0x7')]},'dialTimezone':{'type':Sequelize[_0xca3c('0x2')]},'utcOffset':{'type':Sequelize[_0xca3c('0x4')]}};
\ No newline at end of file
+var _0xc789=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0xc789,0x1ef));var _0x9c78=function(_0x40693f,_0x31791c){_0x40693f=_0x40693f-0x0;var _0x772542=_0xc789[_0x40693f];return _0x772542;};'use strict';var _=require(_0x9c78('0x0'));var Sequelize=require('sequelize');module[_0x9c78('0x1')]={'firstName':{'type':Sequelize[_0x9c78('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x9c78('0x2')]},'city':{'type':Sequelize[_0x9c78('0x2')]},'country':{'type':Sequelize[_0x9c78('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9c78('0x2')]},'description':{'type':Sequelize[_0x9c78('0x3')]},'phone':{'type':Sequelize[_0x9c78('0x2')]},'mobile':{'type':Sequelize[_0x9c78('0x2')]},'fax':{'type':Sequelize[_0x9c78('0x2')]},'email':{'type':Sequelize[_0x9c78('0x2')]},'url':{'type':Sequelize[_0x9c78('0x2')]},'facebook':{'type':Sequelize[_0x9c78('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x9c78('0x2')]},'skype':{'type':Sequelize[_0x9c78('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x9c78('0x2')]},'line':{'type':Sequelize[_0x9c78('0x2')]},'wechat':{'type':Sequelize[_0x9c78('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x9c78('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x9c78('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x9c78('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9c78('0x6')],'defaultValue':Sequelize[_0x9c78('0x7')]},'dialTimezone':{'type':Sequelize[_0x9c78('0x2')]},'utcOffset':{'type':Sequelize[_0x9c78('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e19a224..60ebdf3 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 _0x70a7=['ListId','spread','contact','show','find','Tag','Tags','name','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','where','omit','map','format','cf_%d','table','cm_contacts','setFields','params','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','sort','pick','filter','ids','all','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','CmHopperId','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','nolimit','order','options','includeAll','include','getHopperHistories','rows','getHopperFinals','CmHopperFinal','ContactId','JscriptySessionReport','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','root','file','filename','chmodSync','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','User','binding','firstName','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','agent','No\x20firstName\x20column\x20specified','../../components/import/cm/csvUpdates','getJourney','mail','chat','openchannel','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','sortBy','value','slice','bluebird','path','lodash','papaparse','ioredis','api','../../config/environment','../../config/environment/shared','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','count','status','set','update','destroy','then','end','sendStatus','stack','send','index','describe','getOptions','findAll','query','user','CmContact','catch','tags','keys','length','cf_','columnName','displayName','CmCustomField','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','WhatsappMessage','create','dialTimezone','isNil','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','$or','push'];(function(_0x3ec0e9,_0x1ea265){var _0x1af168=function(_0x4490c7){while(--_0x4490c7){_0x3ec0e9['push'](_0x3ec0e9['shift']());}};_0x1af168(++_0x1ea265);}(_0x70a7,0x9d));var _0x770a=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x70a7[_0x28aea5];return _0x6a55f9;};'use strict';var moment=require('moment');var BPromise=require(_0x770a('0x0'));var util=require('util');var path=require(_0x770a('0x1'));var fs=require('fs');var _=require(_0x770a('0x2'));var squel=require('squel');var Papa=require(_0x770a('0x3'));var Redis=require(_0x770a('0x4'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x770a('0x5'));var config=require(_0x770a('0x6'));var shared=require(_0x770a('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x770a('0x8')],{'host':_0x770a('0x9'),'port':0x18eb});var socket=require(_0x770a('0xa'))(new Redis(config[_0x770a('0x8')]));require(_0x770a('0xb'))[_0x770a('0xc')](socket);function respondWithResult(_0x452c6b,_0x1de33c){_0x1de33c=_0x1de33c||0xc8;return function(_0x190552){if(_0x190552){return _0x452c6b['status'](_0x1de33c)[_0x770a('0xd')](_0x190552);}};}function respondWithFilteredResult(_0x736eee,_0x100127){return function(_0xa3066){if(_0xa3066){var _0x1415d4=typeof _0x100127[_0x770a('0xe')]===_0x770a('0xf')&&typeof _0x100127[_0x770a('0x10')]===_0x770a('0xf');var _0x304c50=_0xa3066[_0x770a('0x11')];var _0x5c6b53=_0x1415d4?0x0:_0x100127[_0x770a('0xe')];var _0xd2388e=_0x1415d4?_0xa3066[_0x770a('0x11')]:_0x100127['offset']+_0x100127['limit'];var _0x1510b2;if(_0xd2388e>=_0x304c50){_0xd2388e=_0x304c50;_0x1510b2=0xc8;}else{_0x1510b2=0xce;}_0x736eee[_0x770a('0x12')](_0x1510b2);return _0x736eee[_0x770a('0x13')]('Content-Range',_0x5c6b53+'-'+_0xd2388e+'/'+_0x304c50)[_0x770a('0xd')](_0xa3066);}return null;};}function saveUpdates(_0x55dc5e){return function(_0x26ce22){if(_0x26ce22){return _0x26ce22[_0x770a('0x14')](_0x55dc5e)['then'](function(_0x486824){return _0x486824;});}return null;};}function removeEntity(_0x47ec62){return function(_0x57d73e){if(_0x57d73e){return _0x57d73e[_0x770a('0x15')]()[_0x770a('0x16')](function(){_0x47ec62[_0x770a('0x12')](0xcc)[_0x770a('0x17')]();});}};}function handleEntityNotFound(_0x15f89b){return function(_0x22e990){if(!_0x22e990){_0x15f89b[_0x770a('0x18')](0x194);}return _0x22e990;};}function handleError(_0x4b27a3,_0x2cbf49){_0x2cbf49=_0x2cbf49||0x1f4;return function(_0x168016){logger['error'](_0x168016[_0x770a('0x19')]);if(_0x168016['name']){delete _0x168016['name'];}_0x4b27a3[_0x770a('0x12')](_0x2cbf49)[_0x770a('0x1a')](_0x168016);};}exports[_0x770a('0x1b')]=function(_0x388b65,_0x89e54a){var _0x14d8aa={};return contacts[_0x770a('0x1c')]()['then'](function(_0x9f02ed){_0x14d8aa=qs[_0x770a('0x1d')](_0x9f02ed,_0x388b65);return contacts[_0x770a('0x1e')](_0x388b65[_0x770a('0x1f')],_0x388b65[_0x770a('0x20')],_0x14d8aa,_0x9f02ed);})['then'](respondWithFilteredResult(_0x89e54a,_0x14d8aa))['catch'](handleError(_0x89e54a,null));};exports[_0x770a('0x15')]=function(_0x5a1af1,_0x3b3c03){return db[_0x770a('0x21')]['find']({'where':{'id':_0x5a1af1['params']['id']}})[_0x770a('0x16')](handleEntityNotFound(_0x3b3c03,null))[_0x770a('0x16')](removeEntity(_0x3b3c03,null))[_0x770a('0x22')](handleError(_0x3b3c03,null));};exports[_0x770a('0x1c')]=function(_0x38f035,_0x6646fc){return db[_0x770a('0x21')][_0x770a('0x1c')]()[_0x770a('0x16')](function(_0x3eb00d){delete _0x3eb00d[_0x770a('0x23')];for(var _0x44f3a0=0x0;_0x44f3a0
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','util','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','html','test','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml'];(function(_0x110d39,_0x244722){var _0x58d934=function(_0x152bde){while(--_0x152bde){_0x110d39['push'](_0x110d39['shift']());}};_0x58d934(++_0x244722);}(_0x7e85,0x155));var _0x57e8=function(_0x1118da,_0x2fde4c){_0x1118da=_0x1118da-0x0;var _0x7374da=_0x7e85[_0x1118da];return _0x7374da;};'use strict';var _=require(_0x57e8('0x0'));var moment=require(_0x57e8('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x57e8('0x2'));var tnef=require('node-tnef');var logger=require(_0x57e8('0x3'))(_0x57e8('0x4'));var config=require(_0x57e8('0x5'));function getAddress(_0x58831b){var _0x46c5bb=_[_0x57e8('0x6')](_0x58831b[_0x57e8('0x7')]);return _0x46c5bb&&_0x46c5bb['address']?_0x46c5bb[_0x57e8('0x8')]:'anonymous'+random[_0x57e8('0x9')](0x6)+_0x57e8('0xa');}function getFirstName(_0x10c2e8){var _0x1f54ac=_[_0x57e8('0x6')](_0x10c2e8[_0x57e8('0x7')]);if(_0x1f54ac&&_0x1f54ac[_0x57e8('0xb')]){if(_0x1f54ac[_0x57e8('0xb')]==_0x1f54ac[_0x57e8('0x8')]){return _0x1f54ac[_0x57e8('0xb')]['substring'](0x0,_0x1f54ac[_0x57e8('0xb')][_0x57e8('0xc')]('@'));}var _0x1908f8=_0x1f54ac[_0x57e8('0xb')][_0x57e8('0xd')](/\s+/);return _0x1908f8[_0x57e8('0xe')]>0x1?_0x1908f8[_0x57e8('0xf')](0x0,-0x1)[_0x57e8('0x10')]('\x20'):_0x1f54ac['name'];}return _0x57e8('0x11');}function getLastName(_0x5a5b76){var _0x1833e3=_['head'](_0x5a5b76[_0x57e8('0x7')]);if(_0x1833e3&&_0x1833e3['name']){var _0x50a332=_0x1833e3[_0x57e8('0xb')][_0x57e8('0xd')](/\s+/);return _0x50a332[_0x57e8('0xe')]>0x1?_0x50a332[_0x57e8('0x12')]():'';}return'';}function getMails(_0x34e28f,_0x3ea94d){var _0x1b9ea1='';for(var _0x1d3684=0x0;_0x1d3684<_0x3ea94d[_0x57e8('0x7')][_0x57e8('0xe')];_0x1d3684+=0x1){if(_0x3ea94d[_0x57e8('0x7')][_0x1d3684][_0x57e8('0x8')]!==_0x34e28f){if(!_[_0x57e8('0x13')](_0x1b9ea1)){_0x1b9ea1+=',';}_0x1b9ea1+=_0x3ea94d[_0x57e8('0x7')][_0x1d3684][_0x57e8('0xb')]||_0x3ea94d['value'][_0x1d3684][_0x57e8('0x8')]||'';_0x1b9ea1+='\x20<';_0x1b9ea1+=_0x3ea94d[_0x57e8('0x7')][_0x1d3684][_0x57e8('0x8')]?_0x3ea94d[_0x57e8('0x7')][_0x1d3684][_0x57e8('0x8')]:_0x57e8('0x14')+random['generate'](0x6)+'@xcally.com';_0x1b9ea1+='>';}}return _0x1b9ea1;}function parseEmail(_0x146105,_0x5f56a9,_0x42275d){if(_0x5f56a9[_0x57e8('0x15')]){var _0x431384=/