From: support
Date: Wed, 23 Nov 2022 14:08:15 +0000 (+0000)
Subject: Built motion from commit 87b834ec.|2.6.23
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22javascript:void%28%27%7BtitleJs%7D%27%29/%22%22%29%20%27?a=commitdiff_plain;h=681ca19e947c3c333ed1e3f180a190d49a862ea8;p=motion2.git
Built motion from commit 87b834ec.|2.6.23
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9b67e12..10f7d00 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-11-23T08:31:00.805Z",
+ "time": "2022-11-23T13:59:53.734Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 66f912e..4bcccb2 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-23T08:31:00.805Z",
+ "time": "2022-11-23T13:59:53.734Z",
"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 3258124..0100867 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 _0xbf16=['urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x2c2b30,_0x48ed61){var _0x3b386a=function(_0x4f95ad){while(--_0x4f95ad){_0x2c2b30['push'](_0x2c2b30['shift']());}};_0x3b386a(++_0x48ed61);}(_0xbf16,0x73));var _0x6bf1=function(_0x24ae08,_0x299dee){_0x24ae08=_0x24ae08-0x0;var _0x18339c=_0xbf16[_0x24ae08];return _0x18339c;};'use strict';var Sequelize=require(_0x6bf1('0x0'));module[_0x6bf1('0x1')]={'name':{'type':Sequelize[_0x6bf1('0x2')],'get':function(_0x5525f6){return this[_0x6bf1('0x3')]('action');}},'action':{'type':Sequelize[_0x6bf1('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6bf1('0x5'),_0x6bf1('0x6'),_0x6bf1('0x7'),_0x6bf1('0x8'),'urlForward',_0x6bf1('0x9'),_0x6bf1('0xa'),_0x6bf1('0xb')]],'msg':_0x6bf1('0xc')}},'comment':_0x6bf1('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6bf1('0xd')},'data2':{'type':Sequelize[_0x6bf1('0x4')](0x1000),'comment':_0x6bf1('0xe')},'data3':{'type':Sequelize[_0x6bf1('0x4')](0x1000),'comment':_0x6bf1('0xf')},'data4':{'type':Sequelize[_0x6bf1('0x4')](0x1000),'comments':_0x6bf1('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x6bf1('0x11')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x6bf1('0x12')}};
\ No newline at end of file
+var _0xe44f=['integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','getDataValue','action','STRING','contactManager'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xe44f,0x95));var _0xfe44=function(_0x5b0c93,_0x4ca03a){_0x5b0c93=_0x5b0c93-0x0;var _0x22acb5=_0xe44f[_0x5b0c93];return _0x22acb5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x7799d9){return this[_0xfe44('0x0')](_0xfe44('0x1'));}},'action':{'type':Sequelize[_0xfe44('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfe44('0x3'),_0xfe44('0x4'),_0xfe44('0x5'),_0xfe44('0x6'),_0xfe44('0x7'),'browser',_0xfe44('0x8'),'script']],'msg':_0xfe44('0x9')}},'comment':_0xfe44('0x9')},'data1':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comment':_0xfe44('0xa')},'data2':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comment':_0xfe44('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xfe44('0xc')},'data4':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comments':_0xfe44('0xd')},'data5':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comments':_0xfe44('0xe')},'data6':{'type':Sequelize[_0xfe44('0x2')],'comments':_0xfe44('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0xfe44('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 4c27122..3384338 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 _0x2a68=['count','set','save','destroy','end','sendStatus','error','stack','name','send','body','find','params','then','catch','rimraf','fast-json-patch','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined'];(function(_0x53a625,_0xba388d){var _0x303cc0=function(_0x792727){while(--_0x792727){_0x53a625['push'](_0x53a625['shift']());}};_0x303cc0(++_0xba388d);}(_0x2a68,0x13c));var _0x82a6=function(_0xc66af2,_0x14f6d8){_0xc66af2=_0xc66af2-0x0;var _0x38d439=_0x2a68[_0xc66af2];return _0x38d439;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82a6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82a6('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x82a6('0x2'));var path=require(_0x82a6('0x3'));var sox=require('sox');var csv=require(_0x82a6('0x4'));var ejs=require(_0x82a6('0x5'));var fs=require('fs');var fs_extra=require(_0x82a6('0x6'));var _=require(_0x82a6('0x7'));var squel=require(_0x82a6('0x8'));var crypto=require('crypto');var jsforce=require(_0x82a6('0x9'));var deskjs=require(_0x82a6('0xa'));var toCsv=require(_0x82a6('0x4'));var querystring=require(_0x82a6('0xb'));var Papa=require(_0x82a6('0xc'));var Redis=require(_0x82a6('0xd'));var authService=require(_0x82a6('0xe'));var qs=require(_0x82a6('0xf'));var as=require(_0x82a6('0x10'));var hardwareService=require(_0x82a6('0x11'));var logger=require('../../config/logger')(_0x82a6('0x12'));var utils=require(_0x82a6('0x13'));var config=require(_0x82a6('0x14'));var licenseUtil=require(_0x82a6('0x15'));var db=require(_0x82a6('0x16'))['db'];function respondWithStatusCode(_0x63bb7e,_0x547fdd){_0x547fdd=_0x547fdd||0xcc;return function(_0xa91f16){if(_0xa91f16){return _0x63bb7e['sendStatus'](_0x547fdd);}return _0x63bb7e[_0x82a6('0x17')](_0x547fdd)['end']();};}function respondWithResult(_0x42a959,_0x466786){_0x466786=_0x466786||0xc8;return function(_0x4dd6f4){if(_0x4dd6f4){return _0x42a959[_0x82a6('0x17')](_0x466786)[_0x82a6('0x18')](_0x4dd6f4);}};}function respondWithFilteredResult(_0x3a9fb7,_0xb8ddeb){return function(_0x9cfff7){if(_0x9cfff7){var _0x55e48d=typeof _0xb8ddeb[_0x82a6('0x19')]==='undefined'&&typeof _0xb8ddeb[_0x82a6('0x1a')]===_0x82a6('0x1b');var _0x4f809f=_0x9cfff7[_0x82a6('0x1c')];var _0x4f263a=_0x55e48d?0x0:_0xb8ddeb['offset'];var _0x55be56=_0x55e48d?_0x9cfff7[_0x82a6('0x1c')]:_0xb8ddeb['offset']+_0xb8ddeb['limit'];var _0x32c4ab;if(_0x55be56>=_0x4f809f){_0x55be56=_0x4f809f;_0x32c4ab=0xc8;}else{_0x32c4ab=0xce;}_0x3a9fb7['status'](_0x32c4ab);return _0x3a9fb7[_0x82a6('0x1d')]('Content-Range',_0x4f263a+'-'+_0x55be56+'/'+_0x4f809f)[_0x82a6('0x18')](_0x9cfff7);}return null;};}function patchUpdates(_0x1d8a6f){return function(_0x53011e){try{jsonpatch['apply'](_0x53011e,_0x1d8a6f,!![]);}catch(_0x5419f5){return BPromise['reject'](_0x5419f5);}return _0x53011e[_0x82a6('0x1e')]();};}function saveUpdates(_0x330e91,_0x4b1db1){return function(_0x15abfa){if(_0x15abfa){return _0x15abfa['update'](_0x330e91)['then'](function(_0x51c3e2){return _0x51c3e2;});}return null;};}function removeEntity(_0x1e3934,_0x58080c){return function(_0x171320){if(_0x171320){return _0x171320[_0x82a6('0x1f')]()['then'](function(){_0x1e3934[_0x82a6('0x17')](0xcc)[_0x82a6('0x20')]();});}};}function handleEntityNotFound(_0x29d2e9,_0x3ff6fb){return function(_0x2feee4){if(!_0x2feee4){_0x29d2e9[_0x82a6('0x21')](0x194);}return _0x2feee4;};}function handleError(_0x182937,_0x103440){_0x103440=_0x103440||0x1f4;return function(_0x1083c4){logger[_0x82a6('0x22')](_0x1083c4[_0x82a6('0x23')]);if(_0x1083c4[_0x82a6('0x24')]){delete _0x1083c4['name'];}_0x182937[_0x82a6('0x17')](_0x103440)[_0x82a6('0x25')](_0x1083c4);};}exports['update']=function(_0x4b206c,_0x1a2080){if(_0x4b206c[_0x82a6('0x26')]['id']){delete _0x4b206c[_0x82a6('0x26')]['id'];}return db['Action'][_0x82a6('0x27')]({'where':{'id':_0x4b206c[_0x82a6('0x28')]['id']}})[_0x82a6('0x29')](handleEntityNotFound(_0x1a2080,null))[_0x82a6('0x29')](saveUpdates(_0x4b206c[_0x82a6('0x26')],null))[_0x82a6('0x29')](respondWithResult(_0x1a2080,null))[_0x82a6('0x2a')](handleError(_0x1a2080,null));};exports[_0x82a6('0x1f')]=function(_0x373341,_0x2e88ec){return db['Action']['find']({'where':{'id':_0x373341[_0x82a6('0x28')]['id']}})['then'](handleEntityNotFound(_0x2e88ec,null))[_0x82a6('0x29')](removeEntity(_0x2e88ec,null))[_0x82a6('0x2a')](handleError(_0x2e88ec,null));};
\ No newline at end of file
+var _0xfe91=['moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0xfe91,0xdc));var _0x1fe9=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0xfe91[_0x19ac6e];return _0x1cdcf3;};'use strict';var emlformat=require(_0x1fe9('0x0'));var rimraf=require(_0x1fe9('0x1'));var zipdir=require(_0x1fe9('0x2'));var jsonpatch=require(_0x1fe9('0x3'));var rp=require(_0x1fe9('0x4'));var moment=require(_0x1fe9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1fe9('0x6'));var path=require('path');var sox=require(_0x1fe9('0x7'));var csv=require(_0x1fe9('0x8'));var ejs=require(_0x1fe9('0x9'));var fs=require('fs');var fs_extra=require(_0x1fe9('0xa'));var _=require(_0x1fe9('0xb'));var squel=require(_0x1fe9('0xc'));var crypto=require(_0x1fe9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1fe9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1fe9('0xf'));var Papa=require('papaparse');var Redis=require(_0x1fe9('0x10'));var authService=require(_0x1fe9('0x11'));var qs=require(_0x1fe9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fe9('0x13'));var utils=require('../../config/utils');var config=require(_0x1fe9('0x14'));var licenseUtil=require(_0x1fe9('0x15'));var db=require(_0x1fe9('0x16'))['db'];function respondWithStatusCode(_0x7960cf,_0x5f39ff){_0x5f39ff=_0x5f39ff||0xcc;return function(_0xde69b8){if(_0xde69b8){return _0x7960cf[_0x1fe9('0x17')](_0x5f39ff);}return _0x7960cf[_0x1fe9('0x18')](_0x5f39ff)[_0x1fe9('0x19')]();};}function respondWithResult(_0x3c3764,_0x3f2340){_0x3f2340=_0x3f2340||0xc8;return function(_0x192031){if(_0x192031){return _0x3c3764[_0x1fe9('0x18')](_0x3f2340)[_0x1fe9('0x1a')](_0x192031);}};}function respondWithFilteredResult(_0x3dd7aa,_0x322280){return function(_0x5cf274){if(_0x5cf274){var _0x44a086=typeof _0x322280[_0x1fe9('0x1b')]===_0x1fe9('0x1c')&&typeof _0x322280[_0x1fe9('0x1d')]===_0x1fe9('0x1c');var _0x5f0b8d=_0x5cf274[_0x1fe9('0x1e')];var _0x2262a1=_0x44a086?0x0:_0x322280[_0x1fe9('0x1b')];var _0x22188f=_0x44a086?_0x5cf274['count']:_0x322280[_0x1fe9('0x1b')]+_0x322280[_0x1fe9('0x1d')];var _0x195f0b;if(_0x22188f>=_0x5f0b8d){_0x22188f=_0x5f0b8d;_0x195f0b=0xc8;}else{_0x195f0b=0xce;}_0x3dd7aa[_0x1fe9('0x18')](_0x195f0b);return _0x3dd7aa[_0x1fe9('0x1f')]('Content-Range',_0x2262a1+'-'+_0x22188f+'/'+_0x5f0b8d)[_0x1fe9('0x1a')](_0x5cf274);}return null;};}function patchUpdates(_0x238410){return function(_0x3430ff){try{jsonpatch['apply'](_0x3430ff,_0x238410,!![]);}catch(_0x544567){return BPromise[_0x1fe9('0x20')](_0x544567);}return _0x3430ff[_0x1fe9('0x21')]();};}function saveUpdates(_0x166ef5,_0x4ce214){return function(_0x24d6fb){if(_0x24d6fb){return _0x24d6fb[_0x1fe9('0x22')](_0x166ef5)[_0x1fe9('0x23')](function(_0x192d5e){return _0x192d5e;});}return null;};}function removeEntity(_0x3f9a52,_0x58aead){return function(_0xa3e335){if(_0xa3e335){return _0xa3e335[_0x1fe9('0x24')]()[_0x1fe9('0x23')](function(){_0x3f9a52[_0x1fe9('0x18')](0xcc)[_0x1fe9('0x19')]();});}};}function handleEntityNotFound(_0x4a9bbe,_0x371873){return function(_0x15768f){if(!_0x15768f){_0x4a9bbe[_0x1fe9('0x17')](0x194);}return _0x15768f;};}function handleError(_0x1b69e5,_0x25fc87){_0x25fc87=_0x25fc87||0x1f4;return function(_0x438ca4){logger['error'](_0x438ca4[_0x1fe9('0x25')]);if(_0x438ca4[_0x1fe9('0x26')]){delete _0x438ca4[_0x1fe9('0x26')];}_0x1b69e5[_0x1fe9('0x18')](_0x25fc87)[_0x1fe9('0x27')](_0x438ca4);};}exports[_0x1fe9('0x22')]=function(_0x1a00a4,_0x1a9b4d){if(_0x1a00a4['body']['id']){delete _0x1a00a4[_0x1fe9('0x28')]['id'];}return db[_0x1fe9('0x29')][_0x1fe9('0x2a')]({'where':{'id':_0x1a00a4['params']['id']}})[_0x1fe9('0x23')](handleEntityNotFound(_0x1a9b4d,null))['then'](saveUpdates(_0x1a00a4[_0x1fe9('0x28')],null))['then'](respondWithResult(_0x1a9b4d,null))['catch'](handleError(_0x1a9b4d,null));};exports[_0x1fe9('0x24')]=function(_0x3f1188,_0x3e4bcd){return db['Action']['find']({'where':{'id':_0x3f1188[_0x1fe9('0x2b')]['id']}})[_0x1fe9('0x23')](handleEntityNotFound(_0x3e4bcd,null))['then'](removeEntity(_0x3e4bcd,null))[_0x1fe9('0x2c')](handleError(_0x3e4bcd,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index cbb4449..b2bc4ef 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 _0x6f33=['request-promise','../../config/environment','exports','define','tools_actions','lodash','util','../../config/logger','bluebird'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0x6f33,0x7a));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x36f3('0x0'));var util=require(_0x36f3('0x1'));var logger=require(_0x36f3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x36f3('0x3'));var rp=require(_0x36f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x36f3('0x5'));var attributes=require('./action.attributes');module[_0x36f3('0x6')]=function(_0x54b611,_0x5c12f6){return _0x54b611[_0x36f3('0x7')]('Action',attributes,{'tableName':_0x36f3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5bf=['moment','bluebird','path','../../config/environment','./action.attributes','exports','tools_actions','lodash','../../config/logger','api'];(function(_0x34d277,_0x16ef66){var _0x5210e=function(_0x314cc4){while(--_0x314cc4){_0x34d277['push'](_0x34d277['shift']());}};_0x5210e(++_0x16ef66);}(_0xa5bf,0x101));var _0xfa5b=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xa5bf[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0xfa5b('0x0'));var util=require('util');var logger=require(_0xfa5b('0x1'))(_0xfa5b('0x2'));var moment=require(_0xfa5b('0x3'));var BPromise=require(_0xfa5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa5b('0x5'));var rimraf=require('rimraf');var config=require(_0xfa5b('0x6'));var attributes=require(_0xfa5b('0x7'));module[_0xfa5b('0x8')]=function(_0x3d46c8,_0x38d68e){return _0x3d46c8['define']('Action',attributes,{'tableName':_0xfa5b('0x9'),'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 58303fb..79edcb7 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x358b92,_0x2d671a){var _0x58f1a5=function(_0xc03bac){while(--_0xc03bac){_0x358b92['push'](_0x358b92['shift']());}};_0x58f1a5(++_0x2d671a);}(_0xe14b,0x93));var _0xbe14=function(_0x3dc439,_0x7d1ec8){_0x3dc439=_0x3dc439-0x0;var _0x3405cf=_0xe14b[_0x3dc439];return _0x3405cf;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7217,0x19e));var _0x7721=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7217[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index ca58b3f..334586c 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 _0x1c23=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c23,0x110));var _0x31c2=function(_0x3dc292,_0x5d0d37){_0x3dc292=_0x3dc292-0x0;var _0xbbe021=_0x1c23[_0x3dc292];return _0xbbe021;};'use strict';var multer=require(_0x31c2('0x0'));var util=require('util');var path=require(_0x31c2('0x1'));var timeout=require(_0x31c2('0x2'));var express=require(_0x31c2('0x3'));var router=express[_0x31c2('0x4')]();var fs_extra=require(_0x31c2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x31c2('0x6'));var config=require(_0x31c2('0x7'));var controller=require(_0x31c2('0x8'));router[_0x31c2('0x9')](_0x31c2('0xa'),auth[_0x31c2('0xb')](),controller[_0x31c2('0xc')]);router[_0x31c2('0xd')]('/:id',auth[_0x31c2('0xb')](),controller['destroy']);module[_0x31c2('0xe')]=router;
\ No newline at end of file
+var _0x764a=['../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41be4a,_0x16fb7f){var _0xfd0ae1=function(_0x3e94b6){while(--_0x3e94b6){_0x41be4a['push'](_0x41be4a['shift']());}};_0xfd0ae1(++_0x16fb7f);}(_0x764a,0x19f));var _0xa764=function(_0x3ba5fd,_0xbe4159){_0x3ba5fd=_0x3ba5fd-0x0;var _0x3574d3=_0x764a[_0x3ba5fd];return _0x3574d3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa764('0x0'));var router=express[_0xa764('0x1')]();var fs_extra=require(_0xa764('0x2'));var auth=require(_0xa764('0x3'));var interaction=require(_0xa764('0x4'));var config=require(_0xa764('0x5'));var controller=require(_0xa764('0x6'));router[_0xa764('0x7')]('/:id',auth[_0xa764('0x8')](),controller[_0xa764('0x9')]);router[_0xa764('0xa')](_0xa764('0xb'),auth[_0xa764('0x8')](),controller[_0xa764('0xc')]);module[_0xa764('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d4da8fd..5129e1d 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 _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x2f3b14,_0x554f94){var _0x20e924=function(_0x3f4c1c){while(--_0x3f4c1c){_0x2f3b14['push'](_0x2f3b14['shift']());}};_0x20e924(++_0x554f94);}(_0x5075,0x73));var _0x5507=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x5075[_0x35da42];return _0x370035;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x297259,_0x17e45d){var _0x2f137c=function(_0x5cb8bf){while(--_0x5cb8bf){_0x297259['push'](_0x297259['shift']());}};_0x2f137c(++_0x17e45d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index a684b3c..3fa351c 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 _0x58a6=['attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','findAll','rows','show','params','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','QueryTypes','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','from','clone','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','../../components/export/','../../files/reports','countTable','SELECT','run','runReport','parentKey','Limited\x20Query:','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','destroy','then','CustomReports','UserProfileResource','send','map','type','key','name','keys','filters','intersection','model','query'];(function(_0x15b1b6,_0x184912){var _0x704435=function(_0x19e530){while(--_0x19e530){_0x15b1b6['push'](_0x15b1b6['shift']());}};_0x704435(++_0x184912);}(_0x58a6,0x109));var _0x658a=function(_0x424c63,_0x49c9e4){_0x424c63=_0x424c63-0x0;var _0x27b529=_0x58a6[_0x424c63];return _0x27b529;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x658a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x658a('0x1'));var rp=require('request-promise');var moment=require(_0x658a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x658a('0x3'));var util=require(_0x658a('0x4'));var path=require(_0x658a('0x5'));var sox=require(_0x658a('0x6'));var csv=require(_0x658a('0x7'));var ejs=require(_0x658a('0x8'));var fs=require('fs');var fs_extra=require(_0x658a('0x9'));var _=require('lodash');var squel=require(_0x658a('0xa'));var crypto=require(_0x658a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x658a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x658a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x658a('0xe'));var qs=require(_0x658a('0xf'));var as=require(_0x658a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x658a('0x11'))(_0x658a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x658a('0x13'));var db=require(_0x658a('0x14'))['db'];var dbH=require(_0x658a('0x14'))[_0x658a('0x15')];function respondWithStatusCode(_0x3f2613,_0x48f1ab){_0x48f1ab=_0x48f1ab||0xcc;return function(_0x371e43){if(_0x371e43){return _0x3f2613[_0x658a('0x16')](_0x48f1ab);}return _0x3f2613[_0x658a('0x17')](_0x48f1ab)[_0x658a('0x18')]();};}function respondWithResult(_0x579b47,_0x1da786){_0x1da786=_0x1da786||0xc8;return function(_0x2ddd8c){if(_0x2ddd8c){return _0x579b47['status'](_0x1da786)['json'](_0x2ddd8c);}};}function respondWithFilteredResult(_0x2b4b6b,_0x454105){return function(_0x29009c){if(_0x29009c){var _0x9d64c9=typeof _0x454105[_0x658a('0x19')]===_0x658a('0x1a')&&typeof _0x454105[_0x658a('0x1b')]===_0x658a('0x1a');var _0x2656d8=_0x29009c[_0x658a('0x1c')];var _0x3563ae=_0x9d64c9?0x0:_0x454105['offset'];var _0x3ee499=_0x9d64c9?_0x29009c['count']:_0x454105['offset']+_0x454105[_0x658a('0x1b')];var _0x113238;if(_0x3ee499>=_0x2656d8){_0x3ee499=_0x2656d8;_0x113238=0xc8;}else{_0x113238=0xce;}_0x2b4b6b[_0x658a('0x17')](_0x113238);return _0x2b4b6b[_0x658a('0x1d')](_0x658a('0x1e'),_0x3563ae+'-'+_0x3ee499+'/'+_0x2656d8)[_0x658a('0x1f')](_0x29009c);}return null;};}function patchUpdates(_0x5d53ae){return function(_0x1ccfe7){try{jsonpatch[_0x658a('0x20')](_0x1ccfe7,_0x5d53ae,!![]);}catch(_0x328f9e){return BPromise['reject'](_0x328f9e);}return _0x1ccfe7['save']();};}function saveUpdates(_0x2b45dd,_0x46e2f4){return function(_0x309cb4){if(_0x309cb4){return _0x309cb4['update'](_0x2b45dd)['then'](function(_0x1235ed){return _0x1235ed;});}return null;};}function removeEntity(_0x638219,_0x377c8a){return function(_0x11a3fe){if(_0x11a3fe){return _0x11a3fe[_0x658a('0x21')]()[_0x658a('0x22')](function(){var _0x3956b4=_0x11a3fe['get']({'plain':!![]});var _0x44c149=_0x658a('0x23');return db[_0x658a('0x24')][_0x658a('0x21')]({'where':{'type':_0x44c149,'resourceId':_0x3956b4['id']}})[_0x658a('0x22')](function(){return _0x11a3fe;});})['then'](function(){_0x638219[_0x658a('0x17')](0xcc)[_0x658a('0x18')]();});}};}function handleEntityNotFound(_0x294626,_0x2258c6){return function(_0x4f9e50){if(!_0x4f9e50){_0x294626[_0x658a('0x16')](0x194);}return _0x4f9e50;};}function handleError(_0x25236a,_0x3fa57b){_0x3fa57b=_0x3fa57b||0x1f4;return function(_0x3d7350){logger['error'](_0x3d7350['stack']);if(_0x3d7350['name']){delete _0x3d7350['name'];}_0x25236a[_0x658a('0x17')](_0x3fa57b)[_0x658a('0x25')](_0x3d7350);};}exports['index']=function(_0x52fdaa,_0x2f6300){var _0x1fae56={},_0x41cf2d={},_0x6cf542={'count':0x0,'rows':[]};var _0x316a06=_[_0x658a('0x26')](db['AnalyticCustomReport']['rawAttributes'],function(_0x35499c){return{'name':_0x35499c['fieldName'],'type':_0x35499c[_0x658a('0x27')][_0x658a('0x28')]};});_0x41cf2d['model']=_[_0x658a('0x26')](_0x316a06,_0x658a('0x29'));_0x41cf2d['query']=_[_0x658a('0x2a')](_0x52fdaa['query']);_0x41cf2d[_0x658a('0x2b')]=_[_0x658a('0x2c')](_0x41cf2d[_0x658a('0x2d')],_0x41cf2d[_0x658a('0x2e')]);_0x1fae56[_0x658a('0x2f')]=_[_0x658a('0x2c')](_0x41cf2d[_0x658a('0x2d')],qs[_0x658a('0x30')](_0x52fdaa[_0x658a('0x2e')][_0x658a('0x30')]));_0x1fae56['attributes']=_0x1fae56[_0x658a('0x2f')][_0x658a('0x31')]?_0x1fae56[_0x658a('0x2f')]:_0x41cf2d[_0x658a('0x2d')];if(!_0x52fdaa['query']['hasOwnProperty']('nolimit')){_0x1fae56[_0x658a('0x1b')]=qs[_0x658a('0x1b')](_0x52fdaa['query'][_0x658a('0x1b')]);_0x1fae56[_0x658a('0x19')]=qs[_0x658a('0x19')](_0x52fdaa[_0x658a('0x2e')][_0x658a('0x19')]);}_0x1fae56[_0x658a('0x32')]=qs[_0x658a('0x33')](_0x52fdaa['query'][_0x658a('0x33')]);_0x1fae56[_0x658a('0x34')]=qs['filters'](_[_0x658a('0x35')](_0x52fdaa[_0x658a('0x2e')],_0x41cf2d[_0x658a('0x2b')]),_0x316a06);if(_0x52fdaa[_0x658a('0x2e')][_0x658a('0x36')]){_0x1fae56['where']=_[_0x658a('0x37')](_0x1fae56[_0x658a('0x34')],{'$or':_[_0x658a('0x26')](_0x316a06,function(_0x4d0515){if(_0x4d0515[_0x658a('0x27')]!==_0x658a('0x38')){var _0x82e405={};_0x82e405[_0x4d0515[_0x658a('0x29')]]={'$like':'%'+_0x52fdaa['query']['filter']+'%'};return _0x82e405;}})});}_0x1fae56=_['merge']({},_0x1fae56,_0x52fdaa[_0x658a('0x39')]);var _0x13da64={'where':_0x1fae56[_0x658a('0x34')]};return db[_0x658a('0x3a')]['count'](_0x13da64)['then'](function(_0x500656){_0x6cf542[_0x658a('0x1c')]=_0x500656;if(_0x52fdaa[_0x658a('0x2e')][_0x658a('0x3b')]){_0x1fae56['include']=[{'all':!![]}];}return db[_0x658a('0x3a')][_0x658a('0x3c')](_0x1fae56);})[_0x658a('0x22')](function(_0x4ff4ab){_0x6cf542[_0x658a('0x3d')]=_0x4ff4ab;return _0x6cf542;})[_0x658a('0x22')](respondWithFilteredResult(_0x2f6300,_0x1fae56))['catch'](handleError(_0x2f6300,null));};exports[_0x658a('0x3e')]=function(_0x1f217b,_0x457563){var _0x38e804={'raw':![],'where':{'id':_0x1f217b[_0x658a('0x3f')]['id']}},_0x15e4a0={};_0x15e4a0[_0x658a('0x2d')]=_[_0x658a('0x2a')](db[_0x658a('0x3a')]['rawAttributes']);_0x15e4a0['query']=_['keys'](_0x1f217b[_0x658a('0x2e')]);_0x15e4a0[_0x658a('0x2b')]=_['intersection'](_0x15e4a0[_0x658a('0x2d')],_0x15e4a0[_0x658a('0x2e')]);_0x38e804[_0x658a('0x2f')]=_[_0x658a('0x2c')](_0x15e4a0[_0x658a('0x2d')],qs[_0x658a('0x30')](_0x1f217b['query'][_0x658a('0x30')]));_0x38e804[_0x658a('0x2f')]=_0x38e804[_0x658a('0x2f')][_0x658a('0x31')]?_0x38e804[_0x658a('0x2f')]:_0x15e4a0[_0x658a('0x2d')];if(_0x1f217b[_0x658a('0x2e')][_0x658a('0x3b')]){_0x38e804[_0x658a('0x40')]=[{'all':!![]}];}_0x38e804=_['merge']({},_0x38e804,_0x1f217b[_0x658a('0x39')]);return db['AnalyticCustomReport'][_0x658a('0x41')](_0x38e804)[_0x658a('0x22')](handleEntityNotFound(_0x457563,null))['then'](respondWithResult(_0x457563,null))[_0x658a('0x42')](handleError(_0x457563,null));};exports[_0x658a('0x43')]=function(_0x31fc66,_0x501a57){return db['AnalyticCustomReport'][_0x658a('0x43')](_0x31fc66['body'],{})['then'](function(_0x226d00){var _0x114539=_0x31fc66[_0x658a('0x44')][_0x658a('0x45')]({'plain':!![]});if(!_0x114539)throw new Error(_0x658a('0x46'));if(_0x114539[_0x658a('0x47')]===_0x658a('0x44')){var _0x7426ae=_0x226d00[_0x658a('0x45')]({'plain':!![]});var _0x491de1=_0x658a('0x48');return db[_0x658a('0x49')][_0x658a('0x41')]({'where':{'name':_0x491de1,'userProfileId':_0x114539['userProfileId']},'raw':!![]})['then'](function(_0x1e7e77){if(_0x1e7e77&&_0x1e7e77[_0x658a('0x4a')]===0x0){return db[_0x658a('0x24')][_0x658a('0x43')]({'name':_0x7426ae[_0x658a('0x29')],'resourceId':_0x7426ae['id'],'type':_0x658a('0x23'),'sectionId':_0x1e7e77['id']},{})[_0x658a('0x22')](function(){return _0x226d00;});}else{return _0x226d00;}})[_0x658a('0x42')](function(_0x44b9f9){logger[_0x658a('0x4b')](_0x658a('0x4c'),_0x44b9f9);throw _0x44b9f9;});}return _0x226d00;})[_0x658a('0x22')](respondWithResult(_0x501a57,0xc9))['catch'](handleError(_0x501a57,null));};exports['update']=function(_0x4bc1ec,_0x1f3088){if(_0x4bc1ec[_0x658a('0x4d')]['id']){delete _0x4bc1ec[_0x658a('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x658a('0x41')]({'where':{'id':_0x4bc1ec[_0x658a('0x3f')]['id']}})[_0x658a('0x22')](handleEntityNotFound(_0x1f3088,null))['then'](saveUpdates(_0x4bc1ec[_0x658a('0x4d')],null))[_0x658a('0x22')](respondWithResult(_0x1f3088,null))['catch'](handleError(_0x1f3088,null));};exports[_0x658a('0x21')]=function(_0x19934c,_0x9ae3e4){return db[_0x658a('0x3a')][_0x658a('0x41')]({'where':{'id':_0x19934c[_0x658a('0x3f')]['id']}})[_0x658a('0x22')](handleEntityNotFound(_0x9ae3e4,null))[_0x658a('0x22')](removeEntity(_0x9ae3e4,null))[_0x658a('0x42')](handleError(_0x9ae3e4,null));};exports['preview']=function(_0x3d09db,_0x429dc4){var _0x24e676=0xa;var _0x1feb0b=[_0x658a('0x4e'),_0x658a('0x4f'),_0x658a('0x50'),_0x658a('0x51')];var _0x18390e={'SUM':_0x658a('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x658a('0x53'),'MAX':_0x658a('0x54'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x658a('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x658a('0x56')};var _0x35906b={'SEC_TO_TIME':_0x658a('0x57'),'DATE':_0x658a('0x58'),'HOUR':_0x658a('0x59'),'ROUND':_0x658a('0x5a'),'UNIX_TIMESTAMP':_0x658a('0x5b')};var _0x1fbd7d=function(_0x4157f9){return!_[_0x658a('0x5c')]([_0x658a('0x5d'),_0x658a('0x5e'),_0x658a('0x5f'),_0x658a('0x60')],_0x4157f9);};var _0x312239=function(_0x3ae403){if(!_0x3ae403||!_0x3ae403['rules'][_0x658a('0x31')]){return'';}for(var _0x4e8531='(',_0xff1d43=0x0;_0xff1d43<_0x3ae403[_0x658a('0x61')][_0x658a('0x31')];_0xff1d43+=0x1){_0xff1d43>0x0&&(_0x4e8531+='\x20'+_0x3ae403[_0x658a('0x62')]+'\x20');_0x4e8531+=_0x3ae403[_0x658a('0x61')][_0xff1d43]['group']?_0x312239(_0x3ae403[_0x658a('0x61')][_0xff1d43][_0x658a('0x63')]):_0x3ae403[_0x658a('0x61')][_0xff1d43][_0x658a('0x64')]+'\x20'+_0x3ae403[_0x658a('0x61')][_0xff1d43][_0x658a('0x65')]+(_0x1fbd7d(_0x3ae403['rules'][_0xff1d43]['condition'])?'\x20'+_0x3ae403[_0x658a('0x61')][_0xff1d43][_0x658a('0x66')]:'');}return _0x4e8531+')';};var _0x43540e={'where':{'id':_0x3d09db[_0x658a('0x3f')]['id']}},_0x35cf96,_0x4bf6cd,_0xf50503,_0x4eb3ac,_0x2f678f;_0x43540e=_[_0x658a('0x37')]({},_0x43540e,_0x3d09db[_0x658a('0x39')]);return db[_0x658a('0x3a')][_0x658a('0x41')](_0x43540e)[_0x658a('0x22')](function(_0x3f9ede){if(_0x3f9ede){_0x35cf96=_0x3f9ede;return _0x3f9ede[_0x658a('0x67')]();}return null;})['then'](function(_0x34d98b){if(_0x34d98b){if(!_0x34d98b[_0x658a('0x31')]){throw new db[(_0x658a('0x68'))][(_0x658a('0x69'))](_0x658a('0x6a'),0x193);}_0x4bf6cd=_0x34d98b;return db[_0x658a('0x6b')][_0x658a('0x3c')]({'raw':!![]});}return null;})[_0x658a('0x22')](function(_0x1dcdd6){if(_0x1dcdd6){_0xf50503=_[_0x658a('0x6c')](_0x1dcdd6,'id');var _0x1aa0ed;var _0x17d35f=squel[_0x658a('0x6d')]();_0x17d35f['from'](_0x35cf96[_0x658a('0x6e')]);for(var _0xfda05f=0x0;_0xfda05f<_0x4bf6cd[_0x658a('0x31')];_0xfda05f+=0x1){_0x1aa0ed=_0x4bf6cd[_0xfda05f][_0x658a('0x6f')]?_0xf50503[_0x4bf6cd[_0xfda05f]['MetricId']][_0x658a('0x70')]:_0x4bf6cd[_0xfda05f][_0x658a('0x64')];_0x1aa0ed=_0x4bf6cd[_0xfda05f]['function']?_[_0x658a('0x71')](_0x18390e[_0x4bf6cd[_0xfda05f][_0x658a('0x72')]],'%s',_0x1aa0ed):_0x1aa0ed;_0x1aa0ed=_0x4bf6cd[_0xfda05f][_0x658a('0x73')]?_[_0x658a('0x71')](_0x35906b[_0x4bf6cd[_0xfda05f]['format']],'%s',_0x1aa0ed):_0x1aa0ed;if(_0x4bf6cd[_0xfda05f][_0x658a('0x74')]){_0x17d35f[_0x658a('0x63')](_0x1aa0ed);}_0x4bf6cd[_0xfda05f][_0x658a('0x75')]&&_0x17d35f[_0x658a('0x32')](_0x1aa0ed,_0x4bf6cd[_0xfda05f]['orderBy']===_0x658a('0x76')?![]:!![]);_0x17d35f['field'](_0x1aa0ed,_0x4bf6cd[_0xfda05f][_0x658a('0x77')]||_0x1aa0ed);}if(_0x35cf96[_0x658a('0x78')]){_0x35cf96[_0x658a('0x78')]=JSON[_0x658a('0x79')](_0x35cf96[_0x658a('0x78')]);for(var _0x37f697=0x0;_0x37f697<_0x35cf96[_0x658a('0x78')][_0x658a('0x31')];_0x37f697+=0x1){if(_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x27')]&&_[_0x658a('0x5c')](_0x1feb0b,_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x27')])&&_0x35cf96[_0x658a('0x78')][_0x37f697]['parentKey']&&_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x7a')]&&_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x7b')]){_0x17d35f[_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x27')]](_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x7a')],null,util[_0x658a('0x73')](_0x658a('0x7c'),_0x35cf96[_0x658a('0x6e')],_0x35cf96[_0x658a('0x78')][_0x37f697]['parentKey'],_0x35cf96['joins'][_0x37f697]['foreignTable'],_0x35cf96['joins'][_0x37f697][_0x658a('0x7b')]));}}}if(_0x35cf96[_0x658a('0x7d')]){_0x35cf96[_0x658a('0x7d')]=JSON[_0x658a('0x79')](_0x35cf96[_0x658a('0x7d')]);_0x17d35f[_0x658a('0x34')](_0x312239(_0x35cf96[_0x658a('0x7d')]['group']));}_0x2f678f=_0x17d35f['clone']();_0x17d35f[_0x658a('0x1b')](_0x24e676);_0x17d35f[_0x658a('0x19')](0x0);logger[_0x658a('0x7e')]('Limited\x20Query:',_0x17d35f[_0x658a('0x7f')]());return dbH['sequelize'][_0x658a('0x2e')](_0x17d35f[_0x658a('0x7f')](),{'type':dbH[_0x658a('0x80')][_0x658a('0x81')]['SELECT']});}})['then'](respondWithResult(_0x429dc4,null))[_0x658a('0x42')](handleError(_0x429dc4,null));};function runReport(_0x37d5a1,_0x5b4f74,_0x173da5){var _0x494302=_0x5b4f74[_0x658a('0x29')];var _0x25008c=0xa;var _0x59c528=[_0x658a('0x4e'),_0x658a('0x4f'),_0x658a('0x50'),'cross_join'];var _0x15cb1b={'SUM':_0x658a('0x52'),'COUNT':_0x658a('0x82'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x658a('0x54'),'MIN':_0x658a('0x83'),'AVG':_0x658a('0x84'),'GROUP_CONCAT':_0x658a('0x55'),'GROUP_CONCAT ASC':_0x658a('0x85'),'GROUP_CONCAT DESC':_0x658a('0x56')};var _0x37f5a7={'SEC_TO_TIME':_0x658a('0x57'),'DATE':_0x658a('0x58'),'HOUR':_0x658a('0x59'),'ROUND':_0x658a('0x5a'),'UNIX_TIMESTAMP':_0x658a('0x5b')};var _0xca5f52=function(_0x5cf102){return!_[_0x658a('0x5c')](['IS\x20NULL',_0x658a('0x5e'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x5cf102);};var _0x17a94b=function(_0xf64188){if(!_0xf64188||!_0xf64188[_0x658a('0x61')][_0x658a('0x31')]){return'';}for(var _0x2321a9='(',_0x14e43f=0x0;_0x14e43f<_0xf64188[_0x658a('0x61')][_0x658a('0x31')];_0x14e43f+=0x1){_0x14e43f>0x0&&(_0x2321a9+='\x20'+_0xf64188[_0x658a('0x62')]+'\x20');_0x2321a9+=_0xf64188[_0x658a('0x61')][_0x14e43f][_0x658a('0x63')]?_0x17a94b(_0xf64188['rules'][_0x14e43f][_0x658a('0x63')]):_0xf64188[_0x658a('0x61')][_0x14e43f]['field']+'\x20'+_0xf64188[_0x658a('0x61')][_0x14e43f][_0x658a('0x65')]+(_0xca5f52(_0xf64188[_0x658a('0x61')][_0x14e43f][_0x658a('0x65')])?'\x20'+_0xf64188[_0x658a('0x61')][_0x14e43f][_0x658a('0x66')]:'');}return _0x2321a9+')';};var _0x46f74d={'where':{'id':_0x37d5a1['id']}},_0x57b4ba,_0x55e6a4,_0x517d56,_0x3a6d77,_0x14133e;_0x46f74d=_[_0x658a('0x37')]({},_0x46f74d,_0x173da5);return db[_0x658a('0x3a')][_0x658a('0x41')](_0x46f74d)[_0x658a('0x22')](function(_0x2b94a9){if(_0x2b94a9){_0x57b4ba=_0x2b94a9;return _0x2b94a9['getFields']();}return null;})[_0x658a('0x22')](function(_0x29a790){if(_0x29a790){if(!_0x29a790['length']){throw new db[(_0x658a('0x68'))][(_0x658a('0x69'))](_0x658a('0x6a'),0x193);}_0x55e6a4=_0x29a790;return db[_0x658a('0x6b')][_0x658a('0x3c')]({'raw':!![]});}return null;})[_0x658a('0x22')](function(_0x1e77f5){if(_0x1e77f5){_0x517d56=_[_0x658a('0x6c')](_0x1e77f5,'id');var _0xdbf012;var _0x3af52c=squel['select']();_0x3af52c[_0x658a('0x86')](_0x57b4ba[_0x658a('0x6e')]);for(var _0x2304a4=0x0;_0x2304a4<_0x55e6a4[_0x658a('0x31')];_0x2304a4+=0x1){_0xdbf012=_0x55e6a4[_0x2304a4][_0x658a('0x6f')]?_0x517d56[_0x55e6a4[_0x2304a4][_0x658a('0x6f')]][_0x658a('0x70')]:_0x55e6a4[_0x2304a4]['field'];_0xdbf012=_0x55e6a4[_0x2304a4]['function']?_['replace'](_0x15cb1b[_0x55e6a4[_0x2304a4][_0x658a('0x72')]],'%s',_0xdbf012):_0xdbf012;_0xdbf012=_0x55e6a4[_0x2304a4]['format']?_[_0x658a('0x71')](_0x37f5a7[_0x55e6a4[_0x2304a4][_0x658a('0x73')]],'%s',_0xdbf012):_0xdbf012;if(_0x55e6a4[_0x2304a4][_0x658a('0x74')]){_0x3af52c[_0x658a('0x63')](_0xdbf012);}_0x55e6a4[_0x2304a4]['orderBy']&&_0x3af52c['order'](_0xdbf012,_0x55e6a4[_0x2304a4][_0x658a('0x75')]==='DESC'?![]:!![]);_0x3af52c['field'](_0xdbf012,_0x55e6a4[_0x2304a4][_0x658a('0x77')]||_0xdbf012);}if(_0x57b4ba[_0x658a('0x78')]){_0x57b4ba['joins']=JSON[_0x658a('0x79')](_0x57b4ba[_0x658a('0x78')]);for(var _0x318314=0x0;_0x318314<_0x57b4ba[_0x658a('0x78')][_0x658a('0x31')];_0x318314+=0x1){if(_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x27')]&&_[_0x658a('0x5c')](_0x59c528,_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x27')])&&_0x57b4ba['joins'][_0x318314]['parentKey']&&_0x57b4ba['joins'][_0x318314][_0x658a('0x7a')]&&_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x7b')]){_0x3af52c[_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x27')]](_0x57b4ba[_0x658a('0x78')][_0x318314]['foreignTable'],null,util[_0x658a('0x73')](_0x658a('0x7c'),_0x57b4ba[_0x658a('0x6e')],_0x57b4ba[_0x658a('0x78')][_0x318314]['parentKey'],_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x7a')],_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x7b')]));}}}if(_0x57b4ba['conditions']){_0x57b4ba[_0x658a('0x7d')]=JSON[_0x658a('0x79')](_0x57b4ba[_0x658a('0x7d')]);_0x3af52c[_0x658a('0x34')](_0x17a94b(_0x57b4ba['conditions']['group']));}_0x14133e=_0x3af52c[_0x658a('0x87')]();_0x3af52c[_0x658a('0x1b')](_0x25008c);_0x3af52c[_0x658a('0x19')](0x0);return;}})['then'](function(){if(_0x5b4f74[_0x658a('0x88')]===_0x658a('0x89')){return null;}var _0x4faaf4=_['merge'](_0x5b4f74,{'name':_0x5b4f74[_0x658a('0x8a')]||_0x5b4f74['name']||_0x57b4ba['name'],'basename':_0x494302,'savename':util[_0x658a('0x73')]('%s-%s.%s',_0x5b4f74[_0x658a('0x29')]||_0x57b4ba['name'],require(_0x658a('0x8b'))[_0x658a('0x8c')](0x4),_0x5b4f74['output']||_0x658a('0x8d')),'reportId':_0x57b4ba['id'],'reportType':'custom'});return db[_0x658a('0x8e')][_0x658a('0x43')](_0x4faaf4,{'raw':!![]});})[_0x658a('0x22')](function(_0x486f8e){if(_0x57b4ba[_0x658a('0x6e')]==='cdr'){_0x14133e['where'](_0x57b4ba[_0x658a('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5b4f74[_0x658a('0x8f')],_0x5b4f74[_0x658a('0x90')]);}else{_0x14133e[_0x658a('0x34')](_0x57b4ba[_0x658a('0x6e')]+_0x658a('0x91'),_0x5b4f74[_0x658a('0x8f')],_0x5b4f74[_0x658a('0x90')]);}if(_0x486f8e){logger['info']('Run\x20Query:',_0x14133e[_0x658a('0x7f')]());require(_0x658a('0x92'))[_0x658a('0x93')](path['join'](__dirname,_0x658a('0x94'),_0x486f8e[_0x658a('0x88')]),[_0x486f8e['id'],_0x14133e[_0x658a('0x7f')](),path[_0x658a('0x4e')](__dirname,_0x658a('0x95'),_0x486f8e['savename']),_0x494302]);return _0x486f8e;}else{var _0x27b81f=squel[_0x658a('0x6d')]();_0x27b81f['from']('('+_0x14133e[_0x658a('0x7f')]()+')',_0x658a('0x96'));_0x27b81f['field']('COUNT(*)',_0x658a('0x1c'));_0x14133e[_0x658a('0x1b')](_0x5b4f74[_0x658a('0x1b')]||_0x25008c);_0x14133e[_0x658a('0x19')](_0x5b4f74[_0x658a('0x19')]||0x0);return dbH[_0x658a('0x80')]['query'](_0x27b81f[_0x658a('0x7f')](),{'type':dbH[_0x658a('0x80')][_0x658a('0x81')][_0x658a('0x97')]})['then'](function(_0xb743ed){if(!_0xb743ed[_0x658a('0x31')]){_0x3a6d77=0x0;}else{_0x3a6d77=_0xb743ed[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x14133e[_0x658a('0x7f')](),{'type':dbH[_0x658a('0x80')][_0x658a('0x81')][_0x658a('0x97')]});})[_0x658a('0x22')](function(_0xe51c1d){return{'rows':_0xe51c1d||[],'count':_0x3a6d77};});}});}exports[_0x658a('0x98')]=function(_0x19154e,_0x154652){return runReport(_0x19154e[_0x658a('0x3f')],_0x19154e[_0x658a('0x2e')],_0x19154e[_0x658a('0x39')])[_0x658a('0x22')](respondWithResult(_0x154652,null))[_0x658a('0x42')](handleError(_0x154652,null));};exports[_0x658a('0x99')]=runReport;exports[_0x658a('0x2e')]=function(_0x15e62f,_0x266a19){var _0x4d75b3=0xa;var _0x465f42=[_0x658a('0x4e'),_0x658a('0x4f'),_0x658a('0x50'),_0x658a('0x51')];var _0x3275a6={'SUM':'SUM(%s)','COUNT':_0x658a('0x82'),'COUNT DISTINCT':_0x658a('0x53'),'MAX':_0x658a('0x54'),'MIN':'MIN(%s)','AVG':_0x658a('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x658a('0x85'),'GROUP_CONCAT DESC':_0x658a('0x56')};var _0x5b0a55={'SEC_TO_TIME':_0x658a('0x57'),'DATE':_0x658a('0x58'),'HOUR':_0x658a('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x658a('0x5b')};var _0x3d63c8=function(_0xab1ebf){return!_[_0x658a('0x5c')]([_0x658a('0x5d'),_0x658a('0x5e'),_0x658a('0x5f'),'IS\x20NOT\x20EMPTY'],_0xab1ebf);};var _0x1f9ba5=function(_0x55115e){if(!_0x55115e||!_0x55115e[_0x658a('0x61')][_0x658a('0x31')]){return'';}for(var _0x6ab582='(',_0x1a0ab3=0x0;_0x1a0ab3<_0x55115e[_0x658a('0x61')][_0x658a('0x31')];_0x1a0ab3+=0x1){_0x1a0ab3>0x0&&(_0x6ab582+='\x20'+_0x55115e[_0x658a('0x62')]+'\x20');_0x6ab582+=_0x55115e[_0x658a('0x61')][_0x1a0ab3]['group']?_0x1f9ba5(_0x55115e['rules'][_0x1a0ab3][_0x658a('0x63')]):_0x55115e[_0x658a('0x61')][_0x1a0ab3][_0x658a('0x64')]+'\x20'+_0x55115e['rules'][_0x1a0ab3]['condition']+(_0x3d63c8(_0x55115e[_0x658a('0x61')][_0x1a0ab3][_0x658a('0x65')])?'\x20'+_0x55115e[_0x658a('0x61')][_0x1a0ab3][_0x658a('0x66')]:'');}return _0x6ab582+')';};var _0x417c5a={'where':{'id':_0x15e62f['params']['id']}},_0x5de7cb,_0x155b4b,_0x3186fc,_0x104b0e,_0x2a2bc0;_0x417c5a=_[_0x658a('0x37')]({},_0x417c5a,_0x15e62f['options']);return db['AnalyticCustomReport'][_0x658a('0x41')](_0x417c5a)[_0x658a('0x22')](function(_0x4e47d3){if(_0x4e47d3){_0x5de7cb=_0x4e47d3;return _0x4e47d3[_0x658a('0x67')]();}return null;})[_0x658a('0x22')](function(_0x28334d){if(_0x28334d){if(!_0x28334d[_0x658a('0x31')]){throw new db[(_0x658a('0x68'))][(_0x658a('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x155b4b=_0x28334d;return db[_0x658a('0x6b')][_0x658a('0x3c')]({'raw':!![]});}return null;})['then'](function(_0x7a4acf){if(_0x7a4acf){_0x3186fc=_['keyBy'](_0x7a4acf,'id');var _0x37e132;var _0x3cb72f=squel[_0x658a('0x6d')]();_0x3cb72f['from'](_0x5de7cb[_0x658a('0x6e')]);for(var _0x35078c=0x0;_0x35078c<_0x155b4b[_0x658a('0x31')];_0x35078c+=0x1){_0x37e132=_0x155b4b[_0x35078c][_0x658a('0x6f')]?_0x3186fc[_0x155b4b[_0x35078c][_0x658a('0x6f')]]['metric']:_0x155b4b[_0x35078c][_0x658a('0x64')];_0x37e132=_0x155b4b[_0x35078c][_0x658a('0x72')]?_['replace'](_0x3275a6[_0x155b4b[_0x35078c][_0x658a('0x72')]],'%s',_0x37e132):_0x37e132;_0x37e132=_0x155b4b[_0x35078c]['format']?_[_0x658a('0x71')](_0x5b0a55[_0x155b4b[_0x35078c][_0x658a('0x73')]],'%s',_0x37e132):_0x37e132;if(_0x155b4b[_0x35078c]['groupBy']){_0x3cb72f['group'](_0x37e132);}_0x155b4b[_0x35078c][_0x658a('0x75')]&&_0x3cb72f['order'](_0x37e132,_0x155b4b[_0x35078c][_0x658a('0x75')]===_0x658a('0x76')?![]:!![]);_0x3cb72f[_0x658a('0x64')](_0x37e132,_0x155b4b[_0x35078c][_0x658a('0x77')]||_0x37e132);}if(_0x5de7cb['joins']){_0x5de7cb['joins']=JSON[_0x658a('0x79')](_0x5de7cb[_0x658a('0x78')]);for(var _0x3f9c37=0x0;_0x3f9c37<_0x5de7cb[_0x658a('0x78')]['length'];_0x3f9c37+=0x1){if(_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x27')]&&_[_0x658a('0x5c')](_0x465f42,_0x5de7cb[_0x658a('0x78')][_0x3f9c37]['type'])&&_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x9a')]&&_0x5de7cb[_0x658a('0x78')][_0x3f9c37]['foreignTable']&&_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x7b')]){_0x3cb72f[_0x5de7cb['joins'][_0x3f9c37][_0x658a('0x27')]](_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5de7cb[_0x658a('0x6e')],_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x9a')],_0x5de7cb['joins'][_0x3f9c37][_0x658a('0x7a')],_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x7b')]));}}}if(_0x5de7cb[_0x658a('0x7d')]){_0x5de7cb[_0x658a('0x7d')]=JSON[_0x658a('0x79')](_0x5de7cb[_0x658a('0x7d')]);_0x3cb72f[_0x658a('0x34')](_0x1f9ba5(_0x5de7cb[_0x658a('0x7d')]['group']));}_0x2a2bc0=_0x3cb72f[_0x658a('0x87')]();_0x3cb72f[_0x658a('0x1b')](_0x4d75b3);_0x3cb72f[_0x658a('0x19')](0x0);logger['debug'](_0x658a('0x9b'),_0x3cb72f[_0x658a('0x7f')]());return dbH[_0x658a('0x80')][_0x658a('0x2e')](_0x3cb72f['toString'](),{'type':dbH['sequelize'][_0x658a('0x81')][_0x658a('0x97')]});}})[_0x658a('0x22')](function(){return{'sql':_0x2a2bc0[_0x658a('0x7f')]()};})['then'](respondWithResult(_0x266a19,null))[_0x658a('0x42')](handleError(_0x266a19,null));};
\ No newline at end of file
+var _0xceff=['foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','cross_join','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','MetricId','web','fullPath','%s-%s.%s','generate','output','csv','custom','cdr','startDate','endDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','DATE(%s)','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','AnalyticCustomReport','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','create','body','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','metric','replace','function','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey'];(function(_0x12e451,_0xd5bbdf){var _0x1cbcb7=function(_0x30c11b){while(--_0x30c11b){_0x12e451['push'](_0x12e451['shift']());}};_0x1cbcb7(++_0xd5bbdf);}(_0xceff,0xc5));var _0xfcef=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xceff[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0xfcef('0x0'));var rimraf=require(_0xfcef('0x1'));var zipdir=require(_0xfcef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcef('0x3'));var moment=require(_0xfcef('0x4'));var BPromise=require(_0xfcef('0x5'));var Mustache=require(_0xfcef('0x6'));var util=require(_0xfcef('0x7'));var path=require(_0xfcef('0x8'));var sox=require(_0xfcef('0x9'));var csv=require(_0xfcef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcef('0xb'));var _=require(_0xfcef('0xc'));var squel=require(_0xfcef('0xd'));var crypto=require(_0xfcef('0xe'));var jsforce=require(_0xfcef('0xf'));var deskjs=require(_0xfcef('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfcef('0x11'));var Papa=require('papaparse');var Redis=require(_0xfcef('0x12'));var authService=require(_0xfcef('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfcef('0x14'));var hardwareService=require(_0xfcef('0x15'));var logger=require('../../config/logger')(_0xfcef('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfcef('0x17'));var db=require(_0xfcef('0x18'))['db'];var dbH=require(_0xfcef('0x18'))['dbH'];function respondWithStatusCode(_0x306bd9,_0x122b03){_0x122b03=_0x122b03||0xcc;return function(_0x157c18){if(_0x157c18){return _0x306bd9[_0xfcef('0x19')](_0x122b03);}return _0x306bd9[_0xfcef('0x1a')](_0x122b03)[_0xfcef('0x1b')]();};}function respondWithResult(_0x557260,_0x106480){_0x106480=_0x106480||0xc8;return function(_0x5958d3){if(_0x5958d3){return _0x557260[_0xfcef('0x1a')](_0x106480)['json'](_0x5958d3);}};}function respondWithFilteredResult(_0x2a9585,_0x27c284){return function(_0x2370c4){if(_0x2370c4){var _0x5c213d=typeof _0x27c284[_0xfcef('0x1c')]==='undefined'&&typeof _0x27c284['limit']===_0xfcef('0x1d');var _0x4adace=_0x2370c4['count'];var _0x217a17=_0x5c213d?0x0:_0x27c284[_0xfcef('0x1c')];var _0x20dae4=_0x5c213d?_0x2370c4[_0xfcef('0x1e')]:_0x27c284[_0xfcef('0x1c')]+_0x27c284[_0xfcef('0x1f')];var _0x5c7d67;if(_0x20dae4>=_0x4adace){_0x20dae4=_0x4adace;_0x5c7d67=0xc8;}else{_0x5c7d67=0xce;}_0x2a9585[_0xfcef('0x1a')](_0x5c7d67);return _0x2a9585['set']('Content-Range',_0x217a17+'-'+_0x20dae4+'/'+_0x4adace)[_0xfcef('0x20')](_0x2370c4);}return null;};}function patchUpdates(_0x5d987b){return function(_0x47a10e){try{jsonpatch[_0xfcef('0x21')](_0x47a10e,_0x5d987b,!![]);}catch(_0x11f194){return BPromise[_0xfcef('0x22')](_0x11f194);}return _0x47a10e[_0xfcef('0x23')]();};}function saveUpdates(_0x59ed14,_0x122197){return function(_0x22bbd3){if(_0x22bbd3){return _0x22bbd3[_0xfcef('0x24')](_0x59ed14)[_0xfcef('0x25')](function(_0x190835){return _0x190835;});}return null;};}function removeEntity(_0xa8e476,_0x33d798){return function(_0x19179f){if(_0x19179f){return _0x19179f[_0xfcef('0x26')]()[_0xfcef('0x25')](function(){var _0x2ddcd8=_0x19179f[_0xfcef('0x27')]({'plain':!![]});var _0x2eca98=_0xfcef('0x28');return db[_0xfcef('0x29')]['destroy']({'where':{'type':_0x2eca98,'resourceId':_0x2ddcd8['id']}})[_0xfcef('0x25')](function(){return _0x19179f;});})[_0xfcef('0x25')](function(){_0xa8e476[_0xfcef('0x1a')](0xcc)[_0xfcef('0x1b')]();});}};}function handleEntityNotFound(_0x323e53,_0x3fb0f2){return function(_0x53f2ea){if(!_0x53f2ea){_0x323e53[_0xfcef('0x19')](0x194);}return _0x53f2ea;};}function handleError(_0x4d6946,_0x5beb6d){_0x5beb6d=_0x5beb6d||0x1f4;return function(_0xd0332b){logger['error'](_0xd0332b[_0xfcef('0x2a')]);if(_0xd0332b[_0xfcef('0x2b')]){delete _0xd0332b[_0xfcef('0x2b')];}_0x4d6946[_0xfcef('0x1a')](_0x5beb6d)['send'](_0xd0332b);};}exports[_0xfcef('0x2c')]=function(_0x1dada5,_0xc677a2){var _0x1a2e29={},_0x10d121={},_0x31cf07={'count':0x0,'rows':[]};var _0x2840da=_['map'](db[_0xfcef('0x2d')]['rawAttributes'],function(_0x682b8c){return{'name':_0x682b8c[_0xfcef('0x2e')],'type':_0x682b8c[_0xfcef('0x2f')][_0xfcef('0x30')]};});_0x10d121[_0xfcef('0x31')]=_[_0xfcef('0x32')](_0x2840da,_0xfcef('0x2b'));_0x10d121['query']=_[_0xfcef('0x33')](_0x1dada5[_0xfcef('0x34')]);_0x10d121['filters']=_['intersection'](_0x10d121[_0xfcef('0x31')],_0x10d121[_0xfcef('0x34')]);_0x1a2e29[_0xfcef('0x35')]=_['intersection'](_0x10d121['model'],qs[_0xfcef('0x36')](_0x1dada5[_0xfcef('0x34')]['fields']));_0x1a2e29['attributes']=_0x1a2e29['attributes'][_0xfcef('0x37')]?_0x1a2e29[_0xfcef('0x35')]:_0x10d121[_0xfcef('0x31')];if(!_0x1dada5[_0xfcef('0x34')][_0xfcef('0x38')](_0xfcef('0x39'))){_0x1a2e29[_0xfcef('0x1f')]=qs[_0xfcef('0x1f')](_0x1dada5['query'][_0xfcef('0x1f')]);_0x1a2e29['offset']=qs['offset'](_0x1dada5[_0xfcef('0x34')][_0xfcef('0x1c')]);}_0x1a2e29['order']=qs[_0xfcef('0x3a')](_0x1dada5[_0xfcef('0x34')][_0xfcef('0x3a')]);_0x1a2e29[_0xfcef('0x3b')]=qs[_0xfcef('0x3c')](_[_0xfcef('0x3d')](_0x1dada5[_0xfcef('0x34')],_0x10d121['filters']),_0x2840da);if(_0x1dada5['query']['filter']){_0x1a2e29[_0xfcef('0x3b')]=_['merge'](_0x1a2e29['where'],{'$or':_[_0xfcef('0x32')](_0x2840da,function(_0x1496d1){if(_0x1496d1['type']!==_0xfcef('0x3e')){var _0x1e8ab1={};_0x1e8ab1[_0x1496d1[_0xfcef('0x2b')]]={'$like':'%'+_0x1dada5[_0xfcef('0x34')][_0xfcef('0x3f')]+'%'};return _0x1e8ab1;}})});}_0x1a2e29=_[_0xfcef('0x40')]({},_0x1a2e29,_0x1dada5[_0xfcef('0x41')]);var _0x4ef584={'where':_0x1a2e29['where']};return db[_0xfcef('0x2d')][_0xfcef('0x1e')](_0x4ef584)[_0xfcef('0x25')](function(_0x23c44c){_0x31cf07[_0xfcef('0x1e')]=_0x23c44c;if(_0x1dada5['query'][_0xfcef('0x42')]){_0x1a2e29[_0xfcef('0x43')]=[{'all':!![]}];}return db[_0xfcef('0x2d')][_0xfcef('0x44')](_0x1a2e29);})[_0xfcef('0x25')](function(_0x240008){_0x31cf07[_0xfcef('0x45')]=_0x240008;return _0x31cf07;})[_0xfcef('0x25')](respondWithFilteredResult(_0xc677a2,_0x1a2e29))['catch'](handleError(_0xc677a2,null));};exports[_0xfcef('0x46')]=function(_0x303129,_0x128a81){var _0x559be7={'raw':![],'where':{'id':_0x303129[_0xfcef('0x47')]['id']}},_0x515ae4={};_0x515ae4[_0xfcef('0x31')]=_[_0xfcef('0x33')](db[_0xfcef('0x2d')][_0xfcef('0x48')]);_0x515ae4[_0xfcef('0x34')]=_[_0xfcef('0x33')](_0x303129[_0xfcef('0x34')]);_0x515ae4[_0xfcef('0x3c')]=_[_0xfcef('0x49')](_0x515ae4['model'],_0x515ae4[_0xfcef('0x34')]);_0x559be7['attributes']=_[_0xfcef('0x49')](_0x515ae4[_0xfcef('0x31')],qs[_0xfcef('0x36')](_0x303129[_0xfcef('0x34')]['fields']));_0x559be7[_0xfcef('0x35')]=_0x559be7['attributes']['length']?_0x559be7[_0xfcef('0x35')]:_0x515ae4[_0xfcef('0x31')];if(_0x303129[_0xfcef('0x34')]['includeAll']){_0x559be7['include']=[{'all':!![]}];}_0x559be7=_[_0xfcef('0x40')]({},_0x559be7,_0x303129[_0xfcef('0x41')]);return db['AnalyticCustomReport'][_0xfcef('0x4a')](_0x559be7)['then'](handleEntityNotFound(_0x128a81,null))[_0xfcef('0x25')](respondWithResult(_0x128a81,null))['catch'](handleError(_0x128a81,null));};exports['create']=function(_0x59c0ea,_0x5014ed){return db[_0xfcef('0x2d')][_0xfcef('0x4b')](_0x59c0ea[_0xfcef('0x4c')],{})[_0xfcef('0x25')](function(_0x2f3dc6){var _0x52440d=_0x59c0ea['user'][_0xfcef('0x27')]({'plain':!![]});if(!_0x52440d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52440d['role']==='user'){var _0x2c429d=_0x2f3dc6[_0xfcef('0x27')]({'plain':!![]});var _0x12186e='Reports';return db['UserProfileSection'][_0xfcef('0x4a')]({'where':{'name':_0x12186e,'userProfileId':_0x52440d[_0xfcef('0x4d')]},'raw':!![]})[_0xfcef('0x25')](function(_0x5e5108){if(_0x5e5108&&_0x5e5108['autoAssociation']===0x0){return db[_0xfcef('0x29')]['create']({'name':_0x2c429d[_0xfcef('0x2b')],'resourceId':_0x2c429d['id'],'type':'CustomReports','sectionId':_0x5e5108['id']},{})[_0xfcef('0x25')](function(){return _0x2f3dc6;});}else{return _0x2f3dc6;}})[_0xfcef('0x4e')](function(_0x331d3b){logger[_0xfcef('0x4f')](_0xfcef('0x50'),_0x331d3b);throw _0x331d3b;});}return _0x2f3dc6;})[_0xfcef('0x25')](respondWithResult(_0x5014ed,0xc9))[_0xfcef('0x4e')](handleError(_0x5014ed,null));};exports[_0xfcef('0x24')]=function(_0x20cc47,_0x3a2f1d){if(_0x20cc47['body']['id']){delete _0x20cc47[_0xfcef('0x4c')]['id'];}return db[_0xfcef('0x2d')][_0xfcef('0x4a')]({'where':{'id':_0x20cc47[_0xfcef('0x47')]['id']}})[_0xfcef('0x25')](handleEntityNotFound(_0x3a2f1d,null))['then'](saveUpdates(_0x20cc47['body'],null))['then'](respondWithResult(_0x3a2f1d,null))['catch'](handleError(_0x3a2f1d,null));};exports[_0xfcef('0x26')]=function(_0x19d984,_0x392296){return db[_0xfcef('0x2d')][_0xfcef('0x4a')]({'where':{'id':_0x19d984[_0xfcef('0x47')]['id']}})[_0xfcef('0x25')](handleEntityNotFound(_0x392296,null))['then'](removeEntity(_0x392296,null))[_0xfcef('0x4e')](handleError(_0x392296,null));};exports[_0xfcef('0x51')]=function(_0x4873c5,_0x3dc98b){var _0x48d05a=0xa;var _0x39e7cd=[_0xfcef('0x52'),'left_join',_0xfcef('0x53'),'cross_join'];var _0x2e3258={'SUM':'SUM(%s)','COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':'MAX(%s)','MIN':_0xfcef('0x56'),'AVG':_0xfcef('0x57'),'GROUP_CONCAT':_0xfcef('0x58'),'GROUP_CONCAT ASC':_0xfcef('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x583b85={'SEC_TO_TIME':_0xfcef('0x5a'),'DATE':'DATE(%s)','HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4040e2=function(_0x516d91){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),_0xfcef('0x61')],_0x516d91);};var _0x78eaf4=function(_0x19a2bc){if(!_0x19a2bc||!_0x19a2bc[_0xfcef('0x62')][_0xfcef('0x37')]){return'';}for(var _0x2d408d='(',_0xd9d927=0x0;_0xd9d927<_0x19a2bc[_0xfcef('0x62')][_0xfcef('0x37')];_0xd9d927+=0x1){_0xd9d927>0x0&&(_0x2d408d+='\x20'+_0x19a2bc[_0xfcef('0x63')]+'\x20');_0x2d408d+=_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x64')]?_0x78eaf4(_0x19a2bc['rules'][_0xd9d927][_0xfcef('0x64')]):_0x19a2bc['rules'][_0xd9d927][_0xfcef('0x65')]+'\x20'+_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x66')]+(_0x4040e2(_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x66')])?'\x20'+_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x67')]:'');}return _0x2d408d+')';};var _0x4818f3={'where':{'id':_0x4873c5[_0xfcef('0x47')]['id']}},_0x4a3e93,_0x400c50,_0x450b12,_0x1f13c8,_0x9bd881;_0x4818f3=_['merge']({},_0x4818f3,_0x4873c5['options']);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x4818f3)['then'](function(_0x2b727c){if(_0x2b727c){_0x4a3e93=_0x2b727c;return _0x2b727c[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x1a87c5){if(_0x1a87c5){if(!_0x1a87c5[_0xfcef('0x37')]){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x400c50=_0x1a87c5;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xfcef('0x25')](function(_0x1084a9){if(_0x1084a9){_0x450b12=_[_0xfcef('0x6d')](_0x1084a9,'id');var _0x2e2420;var _0x37fffa=squel[_0xfcef('0x6e')]();_0x37fffa[_0xfcef('0x6f')](_0x4a3e93[_0xfcef('0x70')]);for(var _0x3d7601=0x0;_0x3d7601<_0x400c50[_0xfcef('0x37')];_0x3d7601+=0x1){_0x2e2420=_0x400c50[_0x3d7601]['MetricId']?_0x450b12[_0x400c50[_0x3d7601]['MetricId']][_0xfcef('0x71')]:_0x400c50[_0x3d7601][_0xfcef('0x65')];_0x2e2420=_0x400c50[_0x3d7601]['function']?_[_0xfcef('0x72')](_0x2e3258[_0x400c50[_0x3d7601][_0xfcef('0x73')]],'%s',_0x2e2420):_0x2e2420;_0x2e2420=_0x400c50[_0x3d7601][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x583b85[_0x400c50[_0x3d7601][_0xfcef('0x74')]],'%s',_0x2e2420):_0x2e2420;if(_0x400c50[_0x3d7601][_0xfcef('0x75')]){_0x37fffa[_0xfcef('0x64')](_0x2e2420);}_0x400c50[_0x3d7601][_0xfcef('0x76')]&&_0x37fffa[_0xfcef('0x77')](_0x2e2420,_0x400c50[_0x3d7601][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x37fffa[_0xfcef('0x65')](_0x2e2420,_0x400c50[_0x3d7601][_0xfcef('0x79')]||_0x2e2420);}if(_0x4a3e93[_0xfcef('0x7a')]){_0x4a3e93[_0xfcef('0x7a')]=JSON[_0xfcef('0x7b')](_0x4a3e93[_0xfcef('0x7a')]);for(var _0x11e5ac=0x0;_0x11e5ac<_0x4a3e93[_0xfcef('0x7a')][_0xfcef('0x37')];_0x11e5ac+=0x1){if(_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x2f')]&&_[_0xfcef('0x5d')](_0x39e7cd,_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x2f')])&&_0x4a3e93['joins'][_0x11e5ac][_0xfcef('0x7c')]&&_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')]&&_0x4a3e93['joins'][_0x11e5ac]['foreignKey']){_0x37fffa[_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac]['type']](_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4a3e93[_0xfcef('0x70')],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac]['parentKey'],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7e')]));}}}if(_0x4a3e93[_0xfcef('0x7f')]){_0x4a3e93[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0x4a3e93[_0xfcef('0x7f')]);_0x37fffa[_0xfcef('0x3b')](_0x78eaf4(_0x4a3e93['conditions'][_0xfcef('0x64')]));}_0x9bd881=_0x37fffa[_0xfcef('0x80')]();_0x37fffa[_0xfcef('0x1f')](_0x48d05a);_0x37fffa['offset'](0x0);logger['debug'](_0xfcef('0x81'),_0x37fffa[_0xfcef('0x82')]());return dbH[_0xfcef('0x83')][_0xfcef('0x34')](_0x37fffa[_0xfcef('0x82')](),{'type':dbH['sequelize'][_0xfcef('0x84')]['SELECT']});}})['then'](respondWithResult(_0x3dc98b,null))[_0xfcef('0x4e')](handleError(_0x3dc98b,null));};function runReport(_0x51a700,_0x42b9b9,_0x2e232e){var _0x12af18=_0x42b9b9[_0xfcef('0x2b')];var _0x207e66=0xa;var _0x5c0030=[_0xfcef('0x52'),_0xfcef('0x85'),_0xfcef('0x53'),_0xfcef('0x86')];var _0x432719={'SUM':_0xfcef('0x87'),'COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':_0xfcef('0x88'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfcef('0x89')};var _0x5bb62c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':_0xfcef('0x8a')};var _0x19ab04=function(_0xcfba98){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),'IS\x20NOT\x20EMPTY'],_0xcfba98);};var _0x5480dc=function(_0x14d65e){if(!_0x14d65e||!_0x14d65e[_0xfcef('0x62')][_0xfcef('0x37')]){return'';}for(var _0x4ff2dc='(',_0x499471=0x0;_0x499471<_0x14d65e[_0xfcef('0x62')]['length'];_0x499471+=0x1){_0x499471>0x0&&(_0x4ff2dc+='\x20'+_0x14d65e['operator']+'\x20');_0x4ff2dc+=_0x14d65e['rules'][_0x499471][_0xfcef('0x64')]?_0x5480dc(_0x14d65e[_0xfcef('0x62')][_0x499471]['group']):_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x65')]+'\x20'+_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x66')]+(_0x19ab04(_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x66')])?'\x20'+_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x67')]:'');}return _0x4ff2dc+')';};var _0x403d45={'where':{'id':_0x51a700['id']}},_0x5548d5,_0x3d6b1b,_0x2c4a5f,_0x4e6aa4,_0x189836;_0x403d45=_['merge']({},_0x403d45,_0x2e232e);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x403d45)[_0xfcef('0x25')](function(_0x548d4f){if(_0x548d4f){_0x5548d5=_0x548d4f;return _0x548d4f[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x539bfa){if(_0x539bfa){if(!_0x539bfa[_0xfcef('0x37')]){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x3d6b1b=_0x539bfa;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x434976){if(_0x434976){_0x2c4a5f=_['keyBy'](_0x434976,'id');var _0x200549;var _0x48b0d1=squel[_0xfcef('0x6e')]();_0x48b0d1[_0xfcef('0x6f')](_0x5548d5[_0xfcef('0x70')]);for(var _0x15b836=0x0;_0x15b836<_0x3d6b1b[_0xfcef('0x37')];_0x15b836+=0x1){_0x200549=_0x3d6b1b[_0x15b836]['MetricId']?_0x2c4a5f[_0x3d6b1b[_0x15b836][_0xfcef('0x8b')]]['metric']:_0x3d6b1b[_0x15b836][_0xfcef('0x65')];_0x200549=_0x3d6b1b[_0x15b836][_0xfcef('0x73')]?_[_0xfcef('0x72')](_0x432719[_0x3d6b1b[_0x15b836][_0xfcef('0x73')]],'%s',_0x200549):_0x200549;_0x200549=_0x3d6b1b[_0x15b836][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x5bb62c[_0x3d6b1b[_0x15b836][_0xfcef('0x74')]],'%s',_0x200549):_0x200549;if(_0x3d6b1b[_0x15b836]['groupBy']){_0x48b0d1['group'](_0x200549);}_0x3d6b1b[_0x15b836][_0xfcef('0x76')]&&_0x48b0d1[_0xfcef('0x77')](_0x200549,_0x3d6b1b[_0x15b836][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x48b0d1[_0xfcef('0x65')](_0x200549,_0x3d6b1b[_0x15b836][_0xfcef('0x79')]||_0x200549);}if(_0x5548d5[_0xfcef('0x7a')]){_0x5548d5[_0xfcef('0x7a')]=JSON['parse'](_0x5548d5['joins']);for(var _0x4cb967=0x0;_0x4cb967<_0x5548d5[_0xfcef('0x7a')][_0xfcef('0x37')];_0x4cb967+=0x1){if(_0x5548d5['joins'][_0x4cb967][_0xfcef('0x2f')]&&_['includes'](_0x5c0030,_0x5548d5['joins'][_0x4cb967]['type'])&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7c')]&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7d')]&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967]['foreignKey']){_0x48b0d1[_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x2f')]](_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7d')],null,util[_0xfcef('0x74')]('%s.%s\x20=\x20%s.%s',_0x5548d5[_0xfcef('0x70')],_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7c')],_0x5548d5['joins'][_0x4cb967][_0xfcef('0x7d')],_0x5548d5[_0xfcef('0x7a')][_0x4cb967]['foreignKey']));}}}if(_0x5548d5[_0xfcef('0x7f')]){_0x5548d5[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0x5548d5['conditions']);_0x48b0d1['where'](_0x5480dc(_0x5548d5[_0xfcef('0x7f')][_0xfcef('0x64')]));}_0x189836=_0x48b0d1[_0xfcef('0x80')]();_0x48b0d1['limit'](_0x207e66);_0x48b0d1['offset'](0x0);return;}})[_0xfcef('0x25')](function(){if(_0x42b9b9['output']===_0xfcef('0x8c')){return null;}var _0x24ef3b=_['merge'](_0x42b9b9,{'name':_0x42b9b9[_0xfcef('0x8d')]||_0x42b9b9[_0xfcef('0x2b')]||_0x5548d5[_0xfcef('0x2b')],'basename':_0x12af18,'savename':util['format'](_0xfcef('0x8e'),_0x42b9b9[_0xfcef('0x2b')]||_0x5548d5[_0xfcef('0x2b')],require('randomstring')[_0xfcef('0x8f')](0x4),_0x42b9b9[_0xfcef('0x90')]||_0xfcef('0x91')),'reportId':_0x5548d5['id'],'reportType':_0xfcef('0x92')});return db['AnalyticExtractedReport'][_0xfcef('0x4b')](_0x24ef3b,{'raw':!![]});})[_0xfcef('0x25')](function(_0x48aea3){if(_0x5548d5[_0xfcef('0x70')]===_0xfcef('0x93')){_0x189836[_0xfcef('0x3b')](_0x5548d5['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x42b9b9[_0xfcef('0x94')],_0x42b9b9[_0xfcef('0x95')]);}else{_0x189836[_0xfcef('0x3b')](_0x5548d5[_0xfcef('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x42b9b9[_0xfcef('0x94')],_0x42b9b9['endDate']);}if(_0x48aea3){logger['info'](_0xfcef('0x96'),_0x189836[_0xfcef('0x82')]());require(_0xfcef('0x97'))['fork'](path['join'](__dirname,_0xfcef('0x98'),_0x48aea3[_0xfcef('0x90')]),[_0x48aea3['id'],_0x189836[_0xfcef('0x82')](),path[_0xfcef('0x52')](__dirname,_0xfcef('0x99'),_0x48aea3[_0xfcef('0x9a')]),_0x12af18]);return _0x48aea3;}else{var _0x2ced8a=squel[_0xfcef('0x6e')]();_0x2ced8a[_0xfcef('0x6f')]('('+_0x189836[_0xfcef('0x82')]()+')',_0xfcef('0x9b'));_0x2ced8a[_0xfcef('0x65')](_0xfcef('0x9c'),_0xfcef('0x1e'));_0x189836[_0xfcef('0x1f')](_0x42b9b9[_0xfcef('0x1f')]||_0x207e66);_0x189836[_0xfcef('0x1c')](_0x42b9b9[_0xfcef('0x1c')]||0x0);return dbH[_0xfcef('0x83')][_0xfcef('0x34')](_0x2ced8a[_0xfcef('0x82')](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]})[_0xfcef('0x25')](function(_0x390d87){if(!_0x390d87['length']){_0x4e6aa4=0x0;}else{_0x4e6aa4=_0x390d87[0x0][_0xfcef('0x1e')]||0x0;}return dbH['sequelize'][_0xfcef('0x34')](_0x189836['toString'](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]});})[_0xfcef('0x25')](function(_0x1a15bc){return{'rows':_0x1a15bc||[],'count':_0x4e6aa4};});}});}exports['run']=function(_0xe7d43e,_0x311f4a){return runReport(_0xe7d43e[_0xfcef('0x47')],_0xe7d43e[_0xfcef('0x34')],_0xe7d43e[_0xfcef('0x41')])[_0xfcef('0x25')](respondWithResult(_0x311f4a,null))[_0xfcef('0x4e')](handleError(_0x311f4a,null));};exports['runReport']=runReport;exports[_0xfcef('0x34')]=function(_0x3413dc,_0x5e0eb1){var _0x4fef91=0xa;var _0x2e5ab1=[_0xfcef('0x52'),_0xfcef('0x85'),_0xfcef('0x53'),'cross_join'];var _0x30622a={'SUM':_0xfcef('0x87'),'COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':_0xfcef('0x88'),'MIN':_0xfcef('0x56'),'AVG':_0xfcef('0x57'),'GROUP_CONCAT':_0xfcef('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x474dde={'SEC_TO_TIME':_0xfcef('0x5a'),'DATE':_0xfcef('0x9e'),'HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x552a79=function(_0x162a2e){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),'IS\x20NOT\x20EMPTY'],_0x162a2e);};var _0x3b163a=function(_0xa29368){if(!_0xa29368||!_0xa29368['rules'][_0xfcef('0x37')]){return'';}for(var _0x45e05f='(',_0x4b839d=0x0;_0x4b839d<_0xa29368[_0xfcef('0x62')][_0xfcef('0x37')];_0x4b839d+=0x1){_0x4b839d>0x0&&(_0x45e05f+='\x20'+_0xa29368['operator']+'\x20');_0x45e05f+=_0xa29368['rules'][_0x4b839d][_0xfcef('0x64')]?_0x3b163a(_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x64')]):_0xa29368['rules'][_0x4b839d][_0xfcef('0x65')]+'\x20'+_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x66')]+(_0x552a79(_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x66')])?'\x20'+_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x67')]:'');}return _0x45e05f+')';};var _0x50bec2={'where':{'id':_0x3413dc[_0xfcef('0x47')]['id']}},_0xd29185,_0x45dc86,_0x2f5a99,_0x182085,_0x24c580;_0x50bec2=_[_0xfcef('0x40')]({},_0x50bec2,_0x3413dc['options']);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x50bec2)[_0xfcef('0x25')](function(_0x1fce6b){if(_0x1fce6b){_0xd29185=_0x1fce6b;return _0x1fce6b[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x596499){if(_0x596499){if(!_0x596499['length']){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x45dc86=_0x596499;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x18f582){if(_0x18f582){_0x2f5a99=_['keyBy'](_0x18f582,'id');var _0x1e41ae;var _0x235173=squel['select']();_0x235173['from'](_0xd29185[_0xfcef('0x70')]);for(var _0x3a9ab4=0x0;_0x3a9ab4<_0x45dc86[_0xfcef('0x37')];_0x3a9ab4+=0x1){_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x8b')]?_0x2f5a99[_0x45dc86[_0x3a9ab4][_0xfcef('0x8b')]][_0xfcef('0x71')]:_0x45dc86[_0x3a9ab4]['field'];_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x73')]?_[_0xfcef('0x72')](_0x30622a[_0x45dc86[_0x3a9ab4][_0xfcef('0x73')]],'%s',_0x1e41ae):_0x1e41ae;_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x474dde[_0x45dc86[_0x3a9ab4][_0xfcef('0x74')]],'%s',_0x1e41ae):_0x1e41ae;if(_0x45dc86[_0x3a9ab4][_0xfcef('0x75')]){_0x235173[_0xfcef('0x64')](_0x1e41ae);}_0x45dc86[_0x3a9ab4][_0xfcef('0x76')]&&_0x235173[_0xfcef('0x77')](_0x1e41ae,_0x45dc86[_0x3a9ab4][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x235173[_0xfcef('0x65')](_0x1e41ae,_0x45dc86[_0x3a9ab4][_0xfcef('0x79')]||_0x1e41ae);}if(_0xd29185[_0xfcef('0x7a')]){_0xd29185['joins']=JSON[_0xfcef('0x7b')](_0xd29185[_0xfcef('0x7a')]);for(var _0x3d4020=0x0;_0x3d4020<_0xd29185[_0xfcef('0x7a')][_0xfcef('0x37')];_0x3d4020+=0x1){if(_0xd29185['joins'][_0x3d4020][_0xfcef('0x2f')]&&_[_0xfcef('0x5d')](_0x2e5ab1,_0xd29185['joins'][_0x3d4020][_0xfcef('0x2f')])&&_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7c')]&&_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7d')]&&_0xd29185[_0xfcef('0x7a')][_0x3d4020]['foreignKey']){_0x235173[_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x2f')]](_0xd29185[_0xfcef('0x7a')][_0x3d4020]['foreignTable'],null,util['format'](_0xfcef('0x9f'),_0xd29185[_0xfcef('0x70')],_0xd29185['joins'][_0x3d4020]['parentKey'],_0xd29185['joins'][_0x3d4020]['foreignTable'],_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7e')]));}}}if(_0xd29185[_0xfcef('0x7f')]){_0xd29185[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0xd29185[_0xfcef('0x7f')]);_0x235173[_0xfcef('0x3b')](_0x3b163a(_0xd29185[_0xfcef('0x7f')][_0xfcef('0x64')]));}_0x24c580=_0x235173[_0xfcef('0x80')]();_0x235173['limit'](_0x4fef91);_0x235173['offset'](0x0);logger[_0xfcef('0xa0')](_0xfcef('0x81'),_0x235173[_0xfcef('0x82')]());return dbH[_0xfcef('0x83')]['query'](_0x235173[_0xfcef('0x82')](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]});}})[_0xfcef('0x25')](function(){return{'sql':_0x24c580[_0xfcef('0x82')]()};})[_0xfcef('0x25')](respondWithResult(_0x5e0eb1,null))['catch'](handleError(_0x5e0eb1,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 82a9055..8dc386d 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 _0x83f0=['AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x47dec4,_0x3efca2){var _0x531676=function(_0x5689b9){while(--_0x5689b9){_0x47dec4['push'](_0x47dec4['shift']());}};_0x531676(++_0x3efca2);}(_0x83f0,0x176));var _0x083f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x83f0[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x083f('0x0'));var util=require(_0x083f('0x1'));var logger=require('../../config/logger')(_0x083f('0x2'));var moment=require(_0x083f('0x3'));var BPromise=require('bluebird');var rp=require(_0x083f('0x4'));var fs=require('fs');var path=require(_0x083f('0x5'));var rimraf=require(_0x083f('0x6'));var config=require(_0x083f('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x083f('0x8')]=function(_0x3c84be,_0x3a2c1b){return _0x3c84be[_0x083f('0x9')](_0x083f('0xa'),attributes,{'tableName':_0x083f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd129=['exports','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x463683,_0x403c60){var _0x1c7fa1=function(_0x224c11){while(--_0x224c11){_0x463683['push'](_0x463683['shift']());}};_0x1c7fa1(++_0x403c60);}(_0xd129,0x134));var _0x9d12=function(_0x32594b,_0x528a37){_0x32594b=_0x32594b-0x0;var _0x86c97=_0xd129[_0x32594b];return _0x86c97;};'use strict';var _=require(_0x9d12('0x0'));var util=require('util');var logger=require(_0x9d12('0x1'))(_0x9d12('0x2'));var moment=require(_0x9d12('0x3'));var BPromise=require(_0x9d12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d12('0x5'));var rimraf=require(_0x9d12('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x9d12('0x7')]=function(_0x44df39,_0x4ce38c){return _0x44df39['define']('AnalyticCustomReport',attributes,{'tableName':_0x9d12('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index b5aebac..5916de3 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 _0xb80d=['request\x20sent','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info'];(function(_0xd8203d,_0x454961){var _0x1a1430=function(_0x17d837){while(--_0x17d837){_0xd8203d['push'](_0xd8203d['shift']());}};_0x1a1430(++_0x454961);}(_0xb80d,0x155));var _0xdb80=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0xb80d[_0x1e9424];return _0x1bd96c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb80('0x0'));var BPromise=require(_0xdb80('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb80('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdb80('0x3'))('rpc');var config=require(_0xdb80('0x4'));var jayson=require(_0xdb80('0x5'));var client=jayson['client'][_0xdb80('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x514e7b,_0x496ec7,_0x5e3fb7){return new BPromise(function(_0x1a855,_0x13e1bc){return client['request'](_0x514e7b,_0x5e3fb7)[_0xdb80('0x7')](function(_0x6a56bb){logger['info'](_0xdb80('0x8'),_0x496ec7,'request\x20sent');logger[_0xdb80('0x9')](_0xdb80('0xa'),_0x496ec7,'request\x20sent',JSON[_0xdb80('0xb')](_0x6a56bb));if(_0x6a56bb['error']){if(_0x6a56bb['error'][_0xdb80('0xc')]===0x1f4){logger[_0xdb80('0xd')](_0xdb80('0x8'),_0x496ec7,_0x6a56bb[_0xdb80('0xd')][_0xdb80('0xe')]);return _0x13e1bc(_0x6a56bb[_0xdb80('0xd')][_0xdb80('0xe')]);}logger[_0xdb80('0xd')](_0xdb80('0x8'),_0x496ec7,_0x6a56bb[_0xdb80('0xd')]['message']);return _0x1a855(_0x6a56bb[_0xdb80('0xd')][_0xdb80('0xe')]);}else{logger[_0xdb80('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x496ec7,_0xdb80('0x10'));_0x1a855(_0x6a56bb['result']['message']);}})['catch'](function(_0x522fc5){logger[_0xdb80('0xd')](_0xdb80('0x8'),_0x496ec7,_0x522fc5);_0x13e1bc(_0x522fc5);});});}
\ No newline at end of file
+var _0x9b51=['rpc','../../config/environment','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x497acd,_0x90d88){var _0xf8e61c=function(_0xf79d5d){while(--_0xf79d5d){_0x497acd['push'](_0x497acd['shift']());}};_0xf8e61c(++_0x90d88);}(_0x9b51,0xf5));var _0x19b5=function(_0x122da1,_0x158e84){_0x122da1=_0x122da1-0x0;var _0x273065=_0x9b51[_0x122da1];return _0x273065;};'use strict';var _=require(_0x19b5('0x0'));var util=require(_0x19b5('0x1'));var moment=require(_0x19b5('0x2'));var BPromise=require(_0x19b5('0x3'));var rs=require(_0x19b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x19b5('0x5'));var logger=require(_0x19b5('0x6'))(_0x19b5('0x7'));var config=require(_0x19b5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x19b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21f004,_0x5b1637,_0x288cc0){return new BPromise(function(_0x28bc5a,_0x1b0ff7){return client[_0x19b5('0xa')](_0x21f004,_0x288cc0)['then'](function(_0x15bba2){logger[_0x19b5('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5b1637,_0x19b5('0xc'));logger[_0x19b5('0xd')](_0x19b5('0xe'),_0x5b1637,_0x19b5('0xc'),JSON[_0x19b5('0xf')](_0x15bba2));if(_0x15bba2[_0x19b5('0x10')]){if(_0x15bba2[_0x19b5('0x10')][_0x19b5('0x11')]===0x1f4){logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x15bba2[_0x19b5('0x10')]['message']);return _0x1b0ff7(_0x15bba2[_0x19b5('0x10')][_0x19b5('0x13')]);}logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x15bba2[_0x19b5('0x10')][_0x19b5('0x13')]);return _0x28bc5a(_0x15bba2['error'][_0x19b5('0x13')]);}else{logger[_0x19b5('0xb')](_0x19b5('0x12'),_0x5b1637,_0x19b5('0xc'));_0x28bc5a(_0x15bba2['result'][_0x19b5('0x13')]);}})[_0x19b5('0x14')](function(_0x4cd530){logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x4cd530);_0x1b0ff7(_0x4cd530);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index d4fad9a..db4ac21 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 _0x51f7=['run','/:id/query','query','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x2fa371,_0x50a68b){var _0x36744a=function(_0x4650bc){while(--_0x4650bc){_0x2fa371['push'](_0x2fa371['shift']());}};_0x36744a(++_0x50a68b);}(_0x51f7,0x9f));var _0x751f=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x51f7[_0x489b87];return _0x1823b6;};'use strict';var multer=require('multer');var util=require(_0x751f('0x0'));var path=require(_0x751f('0x1'));var timeout=require(_0x751f('0x2'));var express=require(_0x751f('0x3'));var router=express[_0x751f('0x4')]();var fs_extra=require(_0x751f('0x5'));var auth=require(_0x751f('0x6'));var interaction=require(_0x751f('0x7'));var config=require('../../config/environment');var controller=require(_0x751f('0x8'));router['get']('/',auth[_0x751f('0x9')](),controller['index']);router[_0x751f('0xa')](_0x751f('0xb'),auth[_0x751f('0x9')](),controller[_0x751f('0xc')]);router[_0x751f('0xa')](_0x751f('0xd'),auth[_0x751f('0x9')](),controller[_0x751f('0xe')]);router['get'](_0x751f('0xf'),auth[_0x751f('0x9')](),controller[_0x751f('0x10')]);router[_0x751f('0xa')](_0x751f('0x11'),auth['isAuthenticated'](),controller[_0x751f('0x12')]);router[_0x751f('0x13')]('/',auth[_0x751f('0x9')](),controller[_0x751f('0x14')]);router[_0x751f('0x15')](_0x751f('0xb'),auth[_0x751f('0x9')](),controller[_0x751f('0x16')]);router[_0x751f('0x17')](_0x751f('0xb'),auth[_0x751f('0x9')](),controller[_0x751f('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x9c69=['/:id/query','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','preview','/:id/run','run'];(function(_0x57ed97,_0x149ea){var _0x9cb533=function(_0x5dd737){while(--_0x5dd737){_0x57ed97['push'](_0x57ed97['shift']());}};_0x9cb533(++_0x149ea);}(_0x9c69,0x14a));var _0x99c6=function(_0x23983a,_0x38947d){_0x23983a=_0x23983a-0x0;var _0x127ff1=_0x9c69[_0x23983a];return _0x127ff1;};'use strict';var multer=require(_0x99c6('0x0'));var util=require(_0x99c6('0x1'));var path=require(_0x99c6('0x2'));var timeout=require(_0x99c6('0x3'));var express=require(_0x99c6('0x4'));var router=express[_0x99c6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x99c6('0x6'));var interaction=require(_0x99c6('0x7'));var config=require(_0x99c6('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x99c6('0x9')]('/',auth[_0x99c6('0xa')](),controller['index']);router['get']('/:id',auth[_0x99c6('0xa')](),controller[_0x99c6('0xb')]);router[_0x99c6('0x9')]('/:id/preview',auth[_0x99c6('0xa')](),controller[_0x99c6('0xc')]);router['get'](_0x99c6('0xd'),auth[_0x99c6('0xa')](),controller[_0x99c6('0xe')]);router[_0x99c6('0x9')](_0x99c6('0xf'),auth[_0x99c6('0xa')](),controller['query']);router[_0x99c6('0x10')]('/',auth['isAuthenticated'](),controller[_0x99c6('0x11')]);router[_0x99c6('0x12')](_0x99c6('0x13'),auth[_0x99c6('0xa')](),controller[_0x99c6('0x14')]);router[_0x99c6('0x15')](_0x99c6('0x13'),auth[_0x99c6('0xa')](),controller[_0x99c6('0x16')]);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 859f2b8..bcd5b1c 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x5aa9da,_0x2a08f4){var _0x412c52=function(_0xf23e19){while(--_0xf23e19){_0x5aa9da['push'](_0x5aa9da['shift']());}};_0x412c52(++_0x2a08f4);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xf2f21e,_0x966cf2){_0xf2f21e=_0xf2f21e-0x0;var _0x1c5925=_0x3eea[_0xf2f21e];return _0x1c5925;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
+var _0x4819=['TEXT','exports','STRING'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x4819,0xcd));var _0x9481=function(_0x4df671,_0x12b67f){_0x4df671=_0x4df671-0x0;var _0x3f9658=_0x4819[_0x4df671];return _0x3f9658;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 91f7786..3134b3a 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 _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','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\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6d38,0x1ef));var _0x86d3=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6d38[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
+var _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x488e86,_0x4acf5e){var _0x2c94c3=function(_0x6647f){while(--_0x6647f){_0x488e86['push'](_0x488e86['shift']());}};_0x2c94c3(++_0x4acf5e);}(_0x1261,0x144));var _0x1126=function(_0x14915a,_0x222f6b){_0x14915a=_0x14915a-0x0;var _0x2f683c=_0x1261[_0x14915a];return _0x2f683c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 31cb616..a04da64 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 _0x741d=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','moment','request-promise'];(function(_0x8f6fa5,_0x320980){var _0x2e1201=function(_0x92e939){while(--_0x92e939){_0x8f6fa5['push'](_0x8f6fa5['shift']());}};_0x2e1201(++_0x320980);}(_0x741d,0xef));var _0xd741=function(_0x57d452,_0x1c7d16){_0x57d452=_0x57d452-0x0;var _0x2e12d2=_0x741d[_0x57d452];return _0x2e12d2;};'use strict';var _=require('lodash');var util=require(_0xd741('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd741('0x1'));var BPromise=require('bluebird');var rp=require(_0xd741('0x2'));var fs=require('fs');var path=require(_0xd741('0x3'));var rimraf=require(_0xd741('0x4'));var config=require(_0xd741('0x5'));var attributes=require(_0xd741('0x6'));module[_0xd741('0x7')]=function(_0x164197,_0x5a67e4){return _0x164197[_0xd741('0x8')](_0xd741('0x9'),attributes,{'tableName':_0xd741('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7027=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util'];(function(_0x190349,_0x5b508e){var _0x1a236c=function(_0x4b1e56){while(--_0x4b1e56){_0x190349['push'](_0x190349['shift']());}};_0x1a236c(++_0x5b508e);}(_0x7027,0x1af));var _0x7702=function(_0x1076ae,_0x4da4e1){_0x1076ae=_0x1076ae-0x0;var _0x263108=_0x7027[_0x1076ae];return _0x263108;};'use strict';var _=require('lodash');var util=require(_0x7702('0x0'));var logger=require('../../config/logger')(_0x7702('0x1'));var moment=require(_0x7702('0x2'));var BPromise=require(_0x7702('0x3'));var rp=require(_0x7702('0x4'));var fs=require('fs');var path=require(_0x7702('0x5'));var rimraf=require(_0x7702('0x6'));var config=require(_0x7702('0x7'));var attributes=require(_0x7702('0x8'));module[_0x7702('0x9')]=function(_0xb07ec4,_0x1aa36a){return _0xb07ec4[_0x7702('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x7702('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 9130260..bdaf87d 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 _0xcfca=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x28ccd4,_0x83c4c){var _0x220be4=function(_0x2669db){while(--_0x2669db){_0x28ccd4['push'](_0x28ccd4['shift']());}};_0x220be4(++_0x83c4c);}(_0xcfca,0x152));var _0xacfc=function(_0x316a8c,_0x187236){_0x316a8c=_0x316a8c-0x0;var _0xf54b36=_0xcfca[_0x316a8c];return _0xf54b36;};'use strict';var _=require(_0xacfc('0x0'));var util=require(_0xacfc('0x1'));var moment=require(_0xacfc('0x2'));var BPromise=require(_0xacfc('0x3'));var rs=require(_0xacfc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xacfc('0x5'));var logger=require(_0xacfc('0x6'))(_0xacfc('0x7'));var config=require(_0xacfc('0x8'));var jayson=require(_0xacfc('0x9'));var client=jayson[_0xacfc('0xa')][_0xacfc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc9de,_0x2188da,_0x49c779){return new BPromise(function(_0x5e6e8e,_0x7263de){return client['request'](_0x5bc9de,_0x49c779)['then'](function(_0x7420b4){logger[_0xacfc('0xc')](_0xacfc('0xd'),_0x2188da,_0xacfc('0xe'));logger['debug'](_0xacfc('0xf'),_0x2188da,'request\x20sent',JSON['stringify'](_0x7420b4));if(_0x7420b4[_0xacfc('0x10')]){if(_0x7420b4[_0xacfc('0x10')][_0xacfc('0x11')]===0x1f4){logger['error'](_0xacfc('0xd'),_0x2188da,_0x7420b4[_0xacfc('0x10')][_0xacfc('0x12')]);return _0x7263de(_0x7420b4[_0xacfc('0x10')][_0xacfc('0x12')]);}logger[_0xacfc('0x10')](_0xacfc('0xd'),_0x2188da,_0x7420b4['error']['message']);return _0x5e6e8e(_0x7420b4[_0xacfc('0x10')][_0xacfc('0x12')]);}else{logger['info'](_0xacfc('0xd'),_0x2188da,_0xacfc('0xe'));_0x5e6e8e(_0x7420b4[_0xacfc('0x13')][_0xacfc('0x12')]);}})[_0xacfc('0x14')](function(_0x23a610){logger[_0xacfc('0x10')](_0xacfc('0xd'),_0x2188da,_0x23a610);_0x7263de(_0x23a610);});});}
\ No newline at end of file
+var _0xf5cc=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','then','info','debug'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf5cc,0x127));var _0xcf5c=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xf5cc[_0x571c1d];return _0x33c609;};'use strict';var _=require('lodash');var util=require(_0xcf5c('0x0'));var moment=require(_0xcf5c('0x1'));var BPromise=require(_0xcf5c('0x2'));var rs=require(_0xcf5c('0x3'));var fs=require('fs');var Redis=require(_0xcf5c('0x4'));var db=require(_0xcf5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcf5c('0x6'));var client=jayson[_0xcf5c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x263938,_0xbf6e20,_0x407c0c){return new BPromise(function(_0x26c5ca,_0x3f7d64){return client['request'](_0x263938,_0x407c0c)[_0xcf5c('0x8')](function(_0x26607c){logger[_0xcf5c('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xbf6e20,'request\x20sent');logger[_0xcf5c('0xa')](_0xcf5c('0xb'),_0xbf6e20,_0xcf5c('0xc'),JSON['stringify'](_0x26607c));if(_0x26607c[_0xcf5c('0xd')]){if(_0x26607c[_0xcf5c('0xd')][_0xcf5c('0xe')]===0x1f4){logger[_0xcf5c('0xd')](_0xcf5c('0xf'),_0xbf6e20,_0x26607c[_0xcf5c('0xd')][_0xcf5c('0x10')]);return _0x3f7d64(_0x26607c[_0xcf5c('0xd')]['message']);}logger[_0xcf5c('0xd')](_0xcf5c('0xf'),_0xbf6e20,_0x26607c[_0xcf5c('0xd')][_0xcf5c('0x10')]);return _0x26c5ca(_0x26607c['error'][_0xcf5c('0x10')]);}else{logger[_0xcf5c('0x9')](_0xcf5c('0xf'),_0xbf6e20,_0xcf5c('0xc'));_0x26c5ca(_0x26607c[_0xcf5c('0x11')]['message']);}})['catch'](function(_0x4e9817){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xbf6e20,_0x4e9817);_0x3f7d64(_0x4e9817);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 86bda7a..36e6a57 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 _0x66ef=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4581cb,_0x166469){var _0x11593f=function(_0x4447bd){while(--_0x4447bd){_0x4581cb['push'](_0x4581cb['shift']());}};_0x11593f(++_0x166469);}(_0x66ef,0x123));var _0xf66e=function(_0x2283e2,_0x49043f){_0x2283e2=_0x2283e2-0x0;var _0x1fe85b=_0x66ef[_0x2283e2];return _0x1fe85b;};'use strict';var multer=require(_0xf66e('0x0'));var util=require(_0xf66e('0x1'));var path=require(_0xf66e('0x2'));var timeout=require(_0xf66e('0x3'));var express=require(_0xf66e('0x4'));var router=express[_0xf66e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf66e('0x6'));var config=require(_0xf66e('0x7'));var controller=require(_0xf66e('0x8'));router[_0xf66e('0x9')]('/',auth[_0xf66e('0xa')](),controller[_0xf66e('0xb')]);router[_0xf66e('0x9')](_0xf66e('0xc'),auth[_0xf66e('0xa')](),controller[_0xf66e('0xd')]);router[_0xf66e('0x9')]('/:id/preview',auth[_0xf66e('0xa')](),controller[_0xf66e('0xe')]);router['get'](_0xf66e('0xf'),auth[_0xf66e('0xa')](),controller['run']);router[_0xf66e('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xf66e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf66e('0x11')]);router[_0xf66e('0x12')](_0xf66e('0xc'),auth[_0xf66e('0xa')](),controller[_0xf66e('0x13')]);router[_0xf66e('0x14')](_0xf66e('0xc'),auth[_0xf66e('0xa')](),controller[_0xf66e('0x15')]);module[_0xf66e('0x16')]=router;
\ No newline at end of file
+var _0x68fb=['put','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create'];(function(_0x5749fa,_0x57f51e){var _0x2ffe02=function(_0xb18855){while(--_0xb18855){_0x5749fa['push'](_0x5749fa['shift']());}};_0x2ffe02(++_0x57f51e);}(_0x68fb,0x1d1));var _0xb68f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68fb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb68f('0x0'));var path=require('path');var timeout=require(_0xb68f('0x1'));var express=require('express');var router=express[_0xb68f('0x2')]();var fs_extra=require(_0xb68f('0x3'));var auth=require(_0xb68f('0x4'));var interaction=require(_0xb68f('0x5'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xb68f('0x6')]('/',auth[_0xb68f('0x7')](),controller[_0xb68f('0x8')]);router[_0xb68f('0x6')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xa')]);router[_0xb68f('0x6')](_0xb68f('0xb'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xc')]);router[_0xb68f('0x6')](_0xb68f('0xd'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xe')]);router['get'](_0xb68f('0xf'),auth[_0xb68f('0x7')](),controller[_0xb68f('0x10')]);router[_0xb68f('0x11')]('/',auth[_0xb68f('0x7')](),controller[_0xb68f('0x12')]);router[_0xb68f('0x13')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller['update']);router[_0xb68f('0x14')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller['destroy']);module[_0xb68f('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c50d202..5a983fc 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 _0x0301=['sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED'];(function(_0x1a9713,_0x2197de){var _0xf59b37=function(_0x193709){while(--_0x193709){_0x1a9713['push'](_0x1a9713['shift']());}};_0xf59b37(++_0x2197de);}(_0x0301,0xe7));var _0x1030=function(_0x2cb91f,_0x406af5){_0x2cb91f=_0x2cb91f-0x0;var _0x51c7e3=_0x0301[_0x2cb91f];return _0x51c7e3;};'use strict';var Sequelize=require(_0x1030('0x0'));var moment=require(_0x1030('0x1'));module['exports']={'name':{'type':Sequelize[_0x1030('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1030('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x1030('0x3')](_0x1030('0x4'),_0x1030('0x5'),_0x1030('0x6')),'allowNull':![],'defaultValue':_0x1030('0x4')},'savename':{'type':Sequelize[_0x1030('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1030('0x7')]},'endDate':{'type':Sequelize[_0x1030('0x7')]},'status':{'type':Sequelize[_0x1030('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0x1030('0x8')},'reportId':{'type':Sequelize[_0x1030('0x9')](0xb)[_0x1030('0xa')]},'reportType':{'type':Sequelize[_0x1030('0x2')]}};
\ No newline at end of file
+var _0x156b=['manual','scheduled','INTEGER','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading','ENUM'];(function(_0x2142f0,_0x4ffea8){var _0x573b7f=function(_0x3c9853){while(--_0x3c9853){_0x2142f0['push'](_0x2142f0['shift']());}};_0x573b7f(++_0x4ffea8);}(_0x156b,0x87));var _0xb156=function(_0x1a1131,_0x404e25){_0x1a1131=_0x1a1131-0x0;var _0x2a73ee=_0x156b[_0x1a1131];return _0x2a73ee;};'use strict';var Sequelize=require(_0xb156('0x0'));var moment=require(_0xb156('0x1'));module[_0xb156('0x2')]={'name':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xb156('0x4'),_0xb156('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xb156('0x4')},'savename':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb156('0x6')]},'endDate':{'type':Sequelize[_0xb156('0x6')]},'status':{'type':Sequelize[_0xb156('0x3')],'defaultValue':_0xb156('0x7')},'type':{'type':Sequelize[_0xb156('0x8')](_0xb156('0x9'),_0xb156('0xa')),'allowNull':![],'defaultValue':_0xb156('0x9')},'reportId':{'type':Sequelize[_0xb156('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xb156('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index ef8add4..99e8a9c 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 _0xd035=['download','basename','savename','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','output','toLowerCase','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation'];(function(_0x585e6c,_0x456254){var _0x372276=function(_0x3d7e23){while(--_0x3d7e23){_0x585e6c['push'](_0x585e6c['shift']());}};_0x372276(++_0x456254);}(_0xd035,0x12c));var _0x5d03=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0xd035[_0x173452];return _0xee3fd0;};'use strict';var emlformat=require(_0x5d03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d03('0x2'));var moment=require(_0x5d03('0x3'));var BPromise=require(_0x5d03('0x4'));var Mustache=require('mustache');var util=require(_0x5d03('0x5'));var path=require(_0x5d03('0x6'));var sox=require(_0x5d03('0x7'));var csv=require('to-csv');var ejs=require(_0x5d03('0x8'));var fs=require('fs');var fs_extra=require(_0x5d03('0x9'));var _=require(_0x5d03('0xa'));var squel=require(_0x5d03('0xb'));var crypto=require(_0x5d03('0xc'));var jsforce=require(_0x5d03('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d03('0xe'));var Papa=require(_0x5d03('0xf'));var Redis=require('ioredis');var authService=require(_0x5d03('0x10'));var qs=require(_0x5d03('0x11'));var as=require(_0x5d03('0x12'));var hardwareService=require(_0x5d03('0x13'));var logger=require('../../config/logger')(_0x5d03('0x14'));var utils=require(_0x5d03('0x15'));var config=require(_0x5d03('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d03('0x17'))['db'];function respondWithStatusCode(_0x416161,_0xe259d5){_0xe259d5=_0xe259d5||0xcc;return function(_0x22ce2e){if(_0x22ce2e){return _0x416161[_0x5d03('0x18')](_0xe259d5);}return _0x416161[_0x5d03('0x19')](_0xe259d5)['end']();};}function respondWithResult(_0x3b683e,_0x1a9caa){_0x1a9caa=_0x1a9caa||0xc8;return function(_0x10595c){if(_0x10595c){return _0x3b683e['status'](_0x1a9caa)[_0x5d03('0x1a')](_0x10595c);}};}function respondWithFilteredResult(_0x3bb924,_0x36f4b5){return function(_0x30f691){if(_0x30f691){var _0x33d874=typeof _0x36f4b5[_0x5d03('0x1b')]===_0x5d03('0x1c')&&typeof _0x36f4b5['limit']==='undefined';var _0x4ec4f1=_0x30f691[_0x5d03('0x1d')];var _0x9dcf86=_0x33d874?0x0:_0x36f4b5[_0x5d03('0x1b')];var _0x3a9fab=_0x33d874?_0x30f691[_0x5d03('0x1d')]:_0x36f4b5['offset']+_0x36f4b5[_0x5d03('0x1e')];var _0x4825bd;if(_0x3a9fab>=_0x4ec4f1){_0x3a9fab=_0x4ec4f1;_0x4825bd=0xc8;}else{_0x4825bd=0xce;}_0x3bb924[_0x5d03('0x19')](_0x4825bd);return _0x3bb924[_0x5d03('0x1f')](_0x5d03('0x20'),_0x9dcf86+'-'+_0x3a9fab+'/'+_0x4ec4f1)[_0x5d03('0x1a')](_0x30f691);}return null;};}function patchUpdates(_0x43bca4){return function(_0x3c7817){try{jsonpatch[_0x5d03('0x21')](_0x3c7817,_0x43bca4,!![]);}catch(_0x1c70df){return BPromise['reject'](_0x1c70df);}return _0x3c7817[_0x5d03('0x22')]();};}function saveUpdates(_0xfae50b,_0x3e884e){return function(_0x537627){if(_0x537627){return _0x537627[_0x5d03('0x23')](_0xfae50b)[_0x5d03('0x24')](function(_0x16e033){return _0x16e033;});}return null;};}function removeEntity(_0x1e5b01,_0xe7db1){return function(_0x4f4e17){if(_0x4f4e17){return _0x4f4e17['destroy']()[_0x5d03('0x24')](function(){var _0x5a0449=_0x4f4e17[_0x5d03('0x25')]({'plain':!![]});var _0x15589d=_0x5d03('0x26');return db[_0x5d03('0x27')][_0x5d03('0x28')]({'where':{'type':_0x15589d,'resourceId':_0x5a0449['id']}})['then'](function(){return _0x4f4e17;});})[_0x5d03('0x24')](function(){_0x1e5b01[_0x5d03('0x19')](0xcc)[_0x5d03('0x29')]();});}};}function handleEntityNotFound(_0x31a03e,_0x35975f){return function(_0x38100a){if(!_0x38100a){_0x31a03e[_0x5d03('0x18')](0x194);}return _0x38100a;};}function handleError(_0x4f5eba,_0x909aaa){_0x909aaa=_0x909aaa||0x1f4;return function(_0x568b3c){logger[_0x5d03('0x2a')](_0x568b3c[_0x5d03('0x2b')]);if(_0x568b3c[_0x5d03('0x2c')]){delete _0x568b3c[_0x5d03('0x2c')];}_0x4f5eba[_0x5d03('0x19')](_0x909aaa)[_0x5d03('0x2d')](_0x568b3c);};}exports['index']=function(_0x541431,_0x38e24f){var _0x5c59c5={},_0x44f3ac={},_0x294158={'count':0x0,'rows':[]};var _0x4c0350=_[_0x5d03('0x2e')](db[_0x5d03('0x2f')][_0x5d03('0x30')],function(_0x4ab344){return{'name':_0x4ab344[_0x5d03('0x31')],'type':_0x4ab344[_0x5d03('0x32')][_0x5d03('0x33')]};});_0x44f3ac['model']=_['map'](_0x4c0350,_0x5d03('0x2c'));_0x44f3ac['query']=_['keys'](_0x541431[_0x5d03('0x34')]);_0x44f3ac[_0x5d03('0x35')]=_[_0x5d03('0x36')](_0x44f3ac[_0x5d03('0x37')],_0x44f3ac[_0x5d03('0x34')]);_0x5c59c5[_0x5d03('0x38')]=_[_0x5d03('0x36')](_0x44f3ac[_0x5d03('0x37')],qs[_0x5d03('0x39')](_0x541431[_0x5d03('0x34')][_0x5d03('0x39')]));_0x5c59c5[_0x5d03('0x38')]=_0x5c59c5[_0x5d03('0x38')][_0x5d03('0x3a')]?_0x5c59c5['attributes']:_0x44f3ac[_0x5d03('0x37')];if(!_0x541431[_0x5d03('0x34')][_0x5d03('0x3b')](_0x5d03('0x3c'))){_0x5c59c5['limit']=qs['limit'](_0x541431['query'][_0x5d03('0x1e')]);_0x5c59c5[_0x5d03('0x1b')]=qs['offset'](_0x541431[_0x5d03('0x34')][_0x5d03('0x1b')]);}_0x5c59c5[_0x5d03('0x3d')]=qs[_0x5d03('0x3e')](_0x541431[_0x5d03('0x34')]['sort']);_0x5c59c5['where']=qs['filters'](_['pick'](_0x541431[_0x5d03('0x34')],_0x44f3ac[_0x5d03('0x35')]),_0x4c0350);if(_0x541431['query'][_0x5d03('0x3f')]){_0x5c59c5[_0x5d03('0x40')]=_[_0x5d03('0x41')](_0x5c59c5[_0x5d03('0x40')],{'$or':_[_0x5d03('0x2e')](_0x4c0350,function(_0x24d68e){if(_0x24d68e['type']!==_0x5d03('0x42')){var _0xfb043a={};_0xfb043a[_0x24d68e[_0x5d03('0x2c')]]={'$like':'%'+_0x541431['query'][_0x5d03('0x3f')]+'%'};return _0xfb043a;}})});}_0x5c59c5=_['merge']({},_0x5c59c5,_0x541431[_0x5d03('0x43')]);var _0x1cce26={'where':_0x5c59c5[_0x5d03('0x40')]};return db[_0x5d03('0x2f')]['count'](_0x1cce26)[_0x5d03('0x24')](function(_0x2ca4ef){_0x294158[_0x5d03('0x1d')]=_0x2ca4ef;if(_0x541431[_0x5d03('0x34')][_0x5d03('0x44')]){_0x5c59c5[_0x5d03('0x45')]=[{'all':!![]}];}return db[_0x5d03('0x2f')][_0x5d03('0x46')](_0x5c59c5);})[_0x5d03('0x24')](function(_0x19a18d){_0x294158[_0x5d03('0x47')]=_0x19a18d;return _0x294158;})[_0x5d03('0x24')](respondWithFilteredResult(_0x38e24f,_0x5c59c5))['catch'](handleError(_0x38e24f,null));};exports[_0x5d03('0x48')]=function(_0x4347f7,_0x32d853){var _0x4aa47e={'raw':!![],'where':{'id':_0x4347f7[_0x5d03('0x49')]['id']}},_0x19b405={};_0x19b405[_0x5d03('0x37')]=_[_0x5d03('0x4a')](db['AnalyticExtractedReport'][_0x5d03('0x30')]);_0x19b405[_0x5d03('0x34')]=_['keys'](_0x4347f7[_0x5d03('0x34')]);_0x19b405['filters']=_[_0x5d03('0x36')](_0x19b405[_0x5d03('0x37')],_0x19b405[_0x5d03('0x34')]);_0x4aa47e['attributes']=_['intersection'](_0x19b405[_0x5d03('0x37')],qs[_0x5d03('0x39')](_0x4347f7[_0x5d03('0x34')][_0x5d03('0x39')]));_0x4aa47e['attributes']=_0x4aa47e[_0x5d03('0x38')]['length']?_0x4aa47e[_0x5d03('0x38')]:_0x19b405[_0x5d03('0x37')];if(_0x4347f7[_0x5d03('0x34')]['includeAll']){_0x4aa47e[_0x5d03('0x45')]=[{'all':!![]}];}_0x4aa47e=_[_0x5d03('0x41')]({},_0x4aa47e,_0x4347f7[_0x5d03('0x43')]);return db[_0x5d03('0x2f')]['find'](_0x4aa47e)[_0x5d03('0x24')](handleEntityNotFound(_0x32d853,null))['then'](respondWithResult(_0x32d853,null))[_0x5d03('0x4b')](handleError(_0x32d853,null));};exports[_0x5d03('0x4c')]=function(_0x538d13,_0x23e86e){return db['AnalyticExtractedReport'][_0x5d03('0x4c')](_0x538d13[_0x5d03('0x4d')],{})[_0x5d03('0x24')](function(_0x415a45){var _0x373c6f=_0x538d13[_0x5d03('0x4e')][_0x5d03('0x25')]({'plain':!![]});if(!_0x373c6f)throw new Error(_0x5d03('0x4f'));if(_0x373c6f[_0x5d03('0x50')]===_0x5d03('0x4e')){var _0x18e74a=_0x415a45[_0x5d03('0x25')]({'plain':!![]});var _0x35090c='ExtractedReports';return db[_0x5d03('0x51')][_0x5d03('0x52')]({'where':{'name':_0x35090c,'userProfileId':_0x373c6f['userProfileId']},'raw':!![]})[_0x5d03('0x24')](function(_0x2959cc){if(_0x2959cc&&_0x2959cc[_0x5d03('0x53')]===0x0){return db[_0x5d03('0x27')]['create']({'name':_0x18e74a['name'],'resourceId':_0x18e74a['id'],'type':_0x2959cc[_0x5d03('0x2c')],'sectionId':_0x2959cc['id']},{})[_0x5d03('0x24')](function(){return _0x415a45;});}else{return _0x415a45;}})[_0x5d03('0x4b')](function(_0x9eeb44){logger[_0x5d03('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9eeb44);throw _0x9eeb44;});}return _0x415a45;})[_0x5d03('0x24')](respondWithResult(_0x23e86e,0xc9))[_0x5d03('0x4b')](handleError(_0x23e86e,null));};exports['update']=function(_0x4f8541,_0x46cc29){if(_0x4f8541[_0x5d03('0x4d')]['id']){delete _0x4f8541['body']['id'];}return db[_0x5d03('0x2f')]['find']({'where':{'id':_0x4f8541[_0x5d03('0x49')]['id']}})[_0x5d03('0x24')](handleEntityNotFound(_0x46cc29,null))['then'](saveUpdates(_0x4f8541[_0x5d03('0x4d')],null))[_0x5d03('0x24')](respondWithResult(_0x46cc29,null))[_0x5d03('0x4b')](handleError(_0x46cc29,null));};exports[_0x5d03('0x28')]=function(_0x709ba7,_0x183711){return db[_0x5d03('0x2f')][_0x5d03('0x52')]({'where':{'id':_0x709ba7[_0x5d03('0x49')]['id']}})[_0x5d03('0x24')](handleEntityNotFound(_0x183711,null))[_0x5d03('0x24')](removeEntity(_0x183711,null))[_0x5d03('0x4b')](handleError(_0x183711,null));};exports[_0x5d03('0x54')]=function(_0x23e549,_0x38d016,_0x51a153){return db[_0x5d03('0x2f')][_0x5d03('0x52')]({'where':{'id':_0x23e549[_0x5d03('0x49')]['id']},'attributes':[_0x5d03('0x2c'),_0x5d03('0x55'),_0x5d03('0x56'),'output'],'raw':!![]})[_0x5d03('0x24')](handleEntityNotFound(_0x38d016,null))[_0x5d03('0x24')](function(_0x47924a){if(_0x47924a){if(!fs['existsSync'](path[_0x5d03('0x57')](config[_0x5d03('0x58')],_0x5d03('0x59'),_0x47924a['savename']))){throw new db[(_0x5d03('0x5a'))][(_0x5d03('0x5b'))](_0x5d03('0x5c'));}if(_0x23e549['query'][_0x5d03('0x5d')]){return _0x38d016['sendStatus'](0xc8);}return _0x38d016['download'](path['join'](config['root'],_0x5d03('0x59'),_0x47924a[_0x5d03('0x56')]),util['format']('%s.%s',_0x47924a[_0x5d03('0x55')]||_0x47924a[_0x5d03('0x2c')],_0x47924a[_0x5d03('0x5e')][_0x5d03('0x5f')]()));}})['catch'](handleError(_0x38d016,null));};
\ No newline at end of file
+var _0x1daf=['apply','reject','save','destroy','then','get','ExtractedReports','UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','update','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json'];(function(_0x2597cc,_0x40b415){var _0xaa509f=function(_0x121adf){while(--_0x121adf){_0x2597cc['push'](_0x2597cc['shift']());}};_0xaa509f(++_0x40b415);}(_0x1daf,0xa0));var _0xf1da=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1daf[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xf1da('0x0'));var rimraf=require(_0xf1da('0x1'));var zipdir=require(_0xf1da('0x2'));var jsonpatch=require(_0xf1da('0x3'));var rp=require(_0xf1da('0x4'));var moment=require(_0xf1da('0x5'));var BPromise=require(_0xf1da('0x6'));var Mustache=require(_0xf1da('0x7'));var util=require('util');var path=require(_0xf1da('0x8'));var sox=require(_0xf1da('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1da('0xa'));var _=require(_0xf1da('0xb'));var squel=require('squel');var crypto=require(_0xf1da('0xc'));var jsforce=require(_0xf1da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf1da('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf1da('0xf'));var qs=require(_0xf1da('0x10'));var as=require(_0xf1da('0x11'));var hardwareService=require(_0xf1da('0x12'));var logger=require(_0xf1da('0x13'))(_0xf1da('0x14'));var utils=require(_0xf1da('0x15'));var config=require(_0xf1da('0x16'));var licenseUtil=require(_0xf1da('0x17'));var db=require(_0xf1da('0x18'))['db'];function respondWithStatusCode(_0x17f470,_0x5a71e5){_0x5a71e5=_0x5a71e5||0xcc;return function(_0x2d5aee){if(_0x2d5aee){return _0x17f470[_0xf1da('0x19')](_0x5a71e5);}return _0x17f470[_0xf1da('0x1a')](_0x5a71e5)[_0xf1da('0x1b')]();};}function respondWithResult(_0x1944ce,_0x2e46f4){_0x2e46f4=_0x2e46f4||0xc8;return function(_0x329515){if(_0x329515){return _0x1944ce[_0xf1da('0x1a')](_0x2e46f4)['json'](_0x329515);}};}function respondWithFilteredResult(_0x1f3222,_0x14afb6){return function(_0x511ce7){if(_0x511ce7){var _0x4af491=typeof _0x14afb6['offset']===_0xf1da('0x1c')&&typeof _0x14afb6[_0xf1da('0x1d')]==='undefined';var _0x504b40=_0x511ce7[_0xf1da('0x1e')];var _0x3b1a0c=_0x4af491?0x0:_0x14afb6[_0xf1da('0x1f')];var _0x5e444b=_0x4af491?_0x511ce7['count']:_0x14afb6['offset']+_0x14afb6[_0xf1da('0x1d')];var _0x23ca7a;if(_0x5e444b>=_0x504b40){_0x5e444b=_0x504b40;_0x23ca7a=0xc8;}else{_0x23ca7a=0xce;}_0x1f3222[_0xf1da('0x1a')](_0x23ca7a);return _0x1f3222['set'](_0xf1da('0x20'),_0x3b1a0c+'-'+_0x5e444b+'/'+_0x504b40)[_0xf1da('0x21')](_0x511ce7);}return null;};}function patchUpdates(_0x5eaf15){return function(_0x34e8bd){try{jsonpatch[_0xf1da('0x22')](_0x34e8bd,_0x5eaf15,!![]);}catch(_0x4c5f4a){return BPromise[_0xf1da('0x23')](_0x4c5f4a);}return _0x34e8bd[_0xf1da('0x24')]();};}function saveUpdates(_0x1050c1,_0x46c0bd){return function(_0x111903){if(_0x111903){return _0x111903['update'](_0x1050c1)['then'](function(_0x5c7510){return _0x5c7510;});}return null;};}function removeEntity(_0x52cb0c,_0x411599){return function(_0x57e242){if(_0x57e242){return _0x57e242[_0xf1da('0x25')]()[_0xf1da('0x26')](function(){var _0x529853=_0x57e242[_0xf1da('0x27')]({'plain':!![]});var _0x109844=_0xf1da('0x28');return db[_0xf1da('0x29')][_0xf1da('0x25')]({'where':{'type':_0x109844,'resourceId':_0x529853['id']}})[_0xf1da('0x26')](function(){return _0x57e242;});})[_0xf1da('0x26')](function(){_0x52cb0c['status'](0xcc)[_0xf1da('0x1b')]();});}};}function handleEntityNotFound(_0x38407b,_0x2a7ad1){return function(_0x4af31d){if(!_0x4af31d){_0x38407b[_0xf1da('0x19')](0x194);}return _0x4af31d;};}function handleError(_0x166297,_0x4ae60e){_0x4ae60e=_0x4ae60e||0x1f4;return function(_0x5be13e){logger[_0xf1da('0x2a')](_0x5be13e['stack']);if(_0x5be13e[_0xf1da('0x2b')]){delete _0x5be13e[_0xf1da('0x2b')];}_0x166297[_0xf1da('0x1a')](_0x4ae60e)['send'](_0x5be13e);};}exports[_0xf1da('0x2c')]=function(_0x507b25,_0x23ca4e){var _0x4b667f={},_0xc09377={},_0x497e41={'count':0x0,'rows':[]};var _0xab71b=_[_0xf1da('0x2d')](db['AnalyticExtractedReport'][_0xf1da('0x2e')],function(_0x243e35){return{'name':_0x243e35[_0xf1da('0x2f')],'type':_0x243e35[_0xf1da('0x30')][_0xf1da('0x31')]};});_0xc09377[_0xf1da('0x32')]=_[_0xf1da('0x2d')](_0xab71b,_0xf1da('0x2b'));_0xc09377[_0xf1da('0x33')]=_[_0xf1da('0x34')](_0x507b25[_0xf1da('0x33')]);_0xc09377[_0xf1da('0x35')]=_[_0xf1da('0x36')](_0xc09377['model'],_0xc09377[_0xf1da('0x33')]);_0x4b667f[_0xf1da('0x37')]=_['intersection'](_0xc09377['model'],qs[_0xf1da('0x38')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x38')]));_0x4b667f[_0xf1da('0x37')]=_0x4b667f[_0xf1da('0x37')]['length']?_0x4b667f[_0xf1da('0x37')]:_0xc09377[_0xf1da('0x32')];if(!_0x507b25[_0xf1da('0x33')][_0xf1da('0x39')](_0xf1da('0x3a'))){_0x4b667f[_0xf1da('0x1d')]=qs['limit'](_0x507b25['query'][_0xf1da('0x1d')]);_0x4b667f[_0xf1da('0x1f')]=qs[_0xf1da('0x1f')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x1f')]);}_0x4b667f[_0xf1da('0x3b')]=qs[_0xf1da('0x3c')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x3c')]);_0x4b667f[_0xf1da('0x3d')]=qs[_0xf1da('0x35')](_['pick'](_0x507b25[_0xf1da('0x33')],_0xc09377[_0xf1da('0x35')]),_0xab71b);if(_0x507b25[_0xf1da('0x33')][_0xf1da('0x3e')]){_0x4b667f['where']=_[_0xf1da('0x3f')](_0x4b667f['where'],{'$or':_[_0xf1da('0x2d')](_0xab71b,function(_0x479720){if(_0x479720['type']!==_0xf1da('0x40')){var _0x3bee35={};_0x3bee35[_0x479720['name']]={'$like':'%'+_0x507b25['query'][_0xf1da('0x3e')]+'%'};return _0x3bee35;}})});}_0x4b667f=_[_0xf1da('0x3f')]({},_0x4b667f,_0x507b25['options']);var _0x475b3c={'where':_0x4b667f['where']};return db[_0xf1da('0x41')]['count'](_0x475b3c)['then'](function(_0xbf0f){_0x497e41['count']=_0xbf0f;if(_0x507b25[_0xf1da('0x33')][_0xf1da('0x42')]){_0x4b667f[_0xf1da('0x43')]=[{'all':!![]}];}return db[_0xf1da('0x41')][_0xf1da('0x44')](_0x4b667f);})['then'](function(_0x48a5d0){_0x497e41[_0xf1da('0x45')]=_0x48a5d0;return _0x497e41;})[_0xf1da('0x26')](respondWithFilteredResult(_0x23ca4e,_0x4b667f))[_0xf1da('0x46')](handleError(_0x23ca4e,null));};exports[_0xf1da('0x47')]=function(_0x6407b5,_0x2e0c35){var _0x316949={'raw':!![],'where':{'id':_0x6407b5[_0xf1da('0x48')]['id']}},_0x5a7070={};_0x5a7070[_0xf1da('0x32')]=_[_0xf1da('0x34')](db[_0xf1da('0x41')][_0xf1da('0x2e')]);_0x5a7070[_0xf1da('0x33')]=_[_0xf1da('0x34')](_0x6407b5[_0xf1da('0x33')]);_0x5a7070[_0xf1da('0x35')]=_[_0xf1da('0x36')](_0x5a7070[_0xf1da('0x32')],_0x5a7070[_0xf1da('0x33')]);_0x316949[_0xf1da('0x37')]=_[_0xf1da('0x36')](_0x5a7070[_0xf1da('0x32')],qs[_0xf1da('0x38')](_0x6407b5[_0xf1da('0x33')]['fields']));_0x316949[_0xf1da('0x37')]=_0x316949['attributes'][_0xf1da('0x49')]?_0x316949[_0xf1da('0x37')]:_0x5a7070[_0xf1da('0x32')];if(_0x6407b5['query']['includeAll']){_0x316949[_0xf1da('0x43')]=[{'all':!![]}];}_0x316949=_[_0xf1da('0x3f')]({},_0x316949,_0x6407b5['options']);return db[_0xf1da('0x41')][_0xf1da('0x4a')](_0x316949)[_0xf1da('0x26')](handleEntityNotFound(_0x2e0c35,null))[_0xf1da('0x26')](respondWithResult(_0x2e0c35,null))[_0xf1da('0x46')](handleError(_0x2e0c35,null));};exports['create']=function(_0x25f90b,_0x5d8739){return db[_0xf1da('0x41')]['create'](_0x25f90b[_0xf1da('0x4b')],{})[_0xf1da('0x26')](function(_0x6d798){var _0x4e5540=_0x25f90b[_0xf1da('0x4c')][_0xf1da('0x27')]({'plain':!![]});if(!_0x4e5540)throw new Error(_0xf1da('0x4d'));if(_0x4e5540[_0xf1da('0x4e')]===_0xf1da('0x4c')){var _0x24c714=_0x6d798['get']({'plain':!![]});var _0x1bf52a='ExtractedReports';return db[_0xf1da('0x4f')][_0xf1da('0x4a')]({'where':{'name':_0x1bf52a,'userProfileId':_0x4e5540['userProfileId']},'raw':!![]})[_0xf1da('0x26')](function(_0x22bfbd){if(_0x22bfbd&&_0x22bfbd['autoAssociation']===0x0){return db[_0xf1da('0x29')][_0xf1da('0x50')]({'name':_0x24c714[_0xf1da('0x2b')],'resourceId':_0x24c714['id'],'type':_0x22bfbd[_0xf1da('0x2b')],'sectionId':_0x22bfbd['id']},{})[_0xf1da('0x26')](function(){return _0x6d798;});}else{return _0x6d798;}})[_0xf1da('0x46')](function(_0x187672){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x187672);throw _0x187672;});}return _0x6d798;})[_0xf1da('0x26')](respondWithResult(_0x5d8739,0xc9))['catch'](handleError(_0x5d8739,null));};exports[_0xf1da('0x51')]=function(_0x24ef7a,_0x3336ee){if(_0x24ef7a['body']['id']){delete _0x24ef7a[_0xf1da('0x4b')]['id'];}return db[_0xf1da('0x41')]['find']({'where':{'id':_0x24ef7a[_0xf1da('0x48')]['id']}})[_0xf1da('0x26')](handleEntityNotFound(_0x3336ee,null))[_0xf1da('0x26')](saveUpdates(_0x24ef7a[_0xf1da('0x4b')],null))[_0xf1da('0x26')](respondWithResult(_0x3336ee,null))[_0xf1da('0x46')](handleError(_0x3336ee,null));};exports[_0xf1da('0x25')]=function(_0x3b85dd,_0x3e46c2){return db[_0xf1da('0x41')][_0xf1da('0x4a')]({'where':{'id':_0x3b85dd[_0xf1da('0x48')]['id']}})[_0xf1da('0x26')](handleEntityNotFound(_0x3e46c2,null))['then'](removeEntity(_0x3e46c2,null))['catch'](handleError(_0x3e46c2,null));};exports[_0xf1da('0x52')]=function(_0x549482,_0x254dcb,_0x77874e){return db[_0xf1da('0x41')][_0xf1da('0x4a')]({'where':{'id':_0x549482['params']['id']},'attributes':[_0xf1da('0x2b'),_0xf1da('0x53'),_0xf1da('0x54'),_0xf1da('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x254dcb,null))['then'](function(_0x197d4e){if(_0x197d4e){if(!fs[_0xf1da('0x56')](path[_0xf1da('0x57')](config[_0xf1da('0x58')],_0xf1da('0x59'),_0x197d4e[_0xf1da('0x54')]))){throw new db[(_0xf1da('0x5a'))][(_0xf1da('0x5b'))](_0xf1da('0x5c'));}if(_0x549482[_0xf1da('0x33')][_0xf1da('0x5d')]){return _0x254dcb[_0xf1da('0x19')](0xc8);}return _0x254dcb[_0xf1da('0x52')](path[_0xf1da('0x57')](config[_0xf1da('0x58')],_0xf1da('0x59'),_0x197d4e[_0xf1da('0x54')]),util[_0xf1da('0x5e')](_0xf1da('0x5f'),_0x197d4e[_0xf1da('0x53')]||_0x197d4e[_0xf1da('0x2b')],_0x197d4e['output'][_0xf1da('0x60')]()));}})[_0xf1da('0x46')](handleError(_0x254dcb,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 980590c..8b9eca2 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 _0x93f8=['AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x11154e,_0x1f6679){var _0x62962=function(_0x3943ec){while(--_0x3943ec){_0x11154e['push'](_0x11154e['shift']());}};_0x62962(++_0x1f6679);}(_0x93f8,0x1be));var _0x893f=function(_0x695762,_0x5137e1){_0x695762=_0x695762-0x0;var _0x5241c3=_0x93f8[_0x695762];return _0x5241c3;};'use strict';var _=require(_0x893f('0x0'));var util=require('util');var logger=require(_0x893f('0x1'))(_0x893f('0x2'));var moment=require('moment');var BPromise=require(_0x893f('0x3'));var rp=require(_0x893f('0x4'));var fs=require('fs');var path=require(_0x893f('0x5'));var rimraf=require(_0x893f('0x6'));var config=require(_0x893f('0x7'));var attributes=require(_0x893f('0x8'));module[_0x893f('0x9')]=function(_0xbdc308,_0x4048b1){return _0xbdc308['define'](_0x893f('0xa'),attributes,{'tableName':_0x893f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8785=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x8785,0x1ed));var _0x5878=function(_0x2c9cf1,_0x1cf0f1){_0x2c9cf1=_0x2c9cf1-0x0;var _0x133ef4=_0x8785[_0x2c9cf1];return _0x133ef4;};'use strict';var _=require(_0x5878('0x0'));var util=require(_0x5878('0x1'));var logger=require(_0x5878('0x2'))('api');var moment=require(_0x5878('0x3'));var BPromise=require(_0x5878('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5878('0x5'));var rimraf=require(_0x5878('0x6'));var config=require(_0x5878('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x5878('0x8')]=function(_0x38e90a,_0x3d85f5){return _0x38e90a[_0x5878('0x9')](_0x5878('0xa'),attributes,{'tableName':_0x5878('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 42e63eb..078d7b1 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 _0x176f=['stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x176f,0x97));var _0xf176=function(_0x41d246,_0x481f8b){_0x41d246=_0x41d246-0x0;var _0x56541d=_0x176f[_0x41d246];return _0x56541d;};'use strict';var _=require(_0xf176('0x0'));var util=require(_0xf176('0x1'));var moment=require(_0xf176('0x2'));var BPromise=require(_0xf176('0x3'));var rs=require(_0xf176('0x4'));var fs=require('fs');var Redis=require(_0xf176('0x5'));var db=require(_0xf176('0x6'))['db'];var utils=require(_0xf176('0x7'));var logger=require(_0xf176('0x8'))(_0xf176('0x9'));var config=require(_0xf176('0xa'));var jayson=require(_0xf176('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd420d0,_0xa1bd4b,_0x2b423a){return new BPromise(function(_0x37c633,_0x1f2a35){return client[_0xf176('0xc')](_0xd420d0,_0x2b423a)[_0xf176('0xd')](function(_0x3b3a5a){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0xa1bd4b,_0xf176('0xe'));logger[_0xf176('0xf')](_0xf176('0x10'),_0xa1bd4b,_0xf176('0xe'),JSON[_0xf176('0x11')](_0x3b3a5a));if(_0x3b3a5a[_0xf176('0x12')]){if(_0x3b3a5a['error'][_0xf176('0x13')]===0x1f4){logger[_0xf176('0x12')](_0xf176('0x14'),_0xa1bd4b,_0x3b3a5a[_0xf176('0x12')]['message']);return _0x1f2a35(_0x3b3a5a['error'][_0xf176('0x15')]);}logger[_0xf176('0x12')](_0xf176('0x14'),_0xa1bd4b,_0x3b3a5a[_0xf176('0x12')][_0xf176('0x15')]);return _0x37c633(_0x3b3a5a['error'][_0xf176('0x15')]);}else{logger[_0xf176('0x16')](_0xf176('0x14'),_0xa1bd4b,_0xf176('0xe'));_0x37c633(_0x3b3a5a['result'][_0xf176('0x15')]);}})[_0xf176('0x17')](function(_0xc3be2f){logger['error'](_0xf176('0x14'),_0xa1bd4b,_0xc3be2f);_0x1f2a35(_0xc3be2f);});});}
\ No newline at end of file
+var _0x4c35=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x4c35,0xd9));var _0x54c3=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x4c35[_0x342700];return _0x53406f;};'use strict';var _=require(_0x54c3('0x0'));var util=require('util');var moment=require(_0x54c3('0x1'));var BPromise=require(_0x54c3('0x2'));var rs=require(_0x54c3('0x3'));var fs=require('fs');var Redis=require(_0x54c3('0x4'));var db=require(_0x54c3('0x5'))['db'];var utils=require(_0x54c3('0x6'));var logger=require(_0x54c3('0x7'))('rpc');var config=require(_0x54c3('0x8'));var jayson=require(_0x54c3('0x9'));var client=jayson[_0x54c3('0xa')][_0x54c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc7cf,_0x5bfa2a,_0x2707c4){return new BPromise(function(_0x3488e9,_0x1c951f){return client['request'](_0x3bc7cf,_0x2707c4)[_0x54c3('0xc')](function(_0x13be2c){logger[_0x54c3('0xd')](_0x54c3('0xe'),_0x5bfa2a,_0x54c3('0xf'));logger[_0x54c3('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5bfa2a,_0x54c3('0xf'),JSON[_0x54c3('0x11')](_0x13be2c));if(_0x13be2c['error']){if(_0x13be2c[_0x54c3('0x12')][_0x54c3('0x13')]===0x1f4){logger[_0x54c3('0x12')](_0x54c3('0xe'),_0x5bfa2a,_0x13be2c['error'][_0x54c3('0x14')]);return _0x1c951f(_0x13be2c[_0x54c3('0x12')]['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bfa2a,_0x13be2c['error'][_0x54c3('0x14')]);return _0x3488e9(_0x13be2c[_0x54c3('0x12')][_0x54c3('0x14')]);}else{logger[_0x54c3('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bfa2a,_0x54c3('0xf'));_0x3488e9(_0x13be2c[_0x54c3('0x15')][_0x54c3('0x14')]);}})[_0x54c3('0x16')](function(_0x2472d3){logger[_0x54c3('0x12')](_0x54c3('0xe'),_0x5bfa2a,_0x2472d3);_0x1c951f(_0x2472d3);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index d34f778..ce40ca0 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 _0x020c=['update','delete','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','download','put'];(function(_0x12f59c,_0x13d956){var _0x2db43e=function(_0x1743fb){while(--_0x1743fb){_0x12f59c['push'](_0x12f59c['shift']());}};_0x2db43e(++_0x13d956);}(_0x020c,0x1d7));var _0xc020=function(_0x2dce5a,_0x2e992b){_0x2dce5a=_0x2dce5a-0x0;var _0x62fa90=_0x020c[_0x2dce5a];return _0x62fa90;};'use strict';var multer=require(_0xc020('0x0'));var util=require(_0xc020('0x1'));var path=require('path');var timeout=require(_0xc020('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc020('0x3'));var auth=require(_0xc020('0x4'));var interaction=require(_0xc020('0x5'));var config=require(_0xc020('0x6'));var controller=require(_0xc020('0x7'));router['get']('/',auth[_0xc020('0x8')](),controller[_0xc020('0x9')]);router[_0xc020('0xa')](_0xc020('0xb'),auth[_0xc020('0x8')](),controller['show']);router[_0xc020('0xa')](_0xc020('0xc'),auth[_0xc020('0x8')](),controller[_0xc020('0xd')]);router['post']('/',auth[_0xc020('0x8')](),controller['create']);router[_0xc020('0xe')]('/:id',auth[_0xc020('0x8')](),controller[_0xc020('0xf')]);router[_0xc020('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc020('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xef56=['isAuthenticated','index','/:id','/:id/download','download','post','create','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0xef56,0xce));var _0x6ef5=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xef56[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x6ef5('0x0'));var util=require(_0x6ef5('0x1'));var path=require(_0x6ef5('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ef5('0x3'));var router=express[_0x6ef5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ef5('0x5'));var interaction=require(_0x6ef5('0x6'));var config=require(_0x6ef5('0x7'));var controller=require(_0x6ef5('0x8'));router[_0x6ef5('0x9')]('/',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0xb')]);router[_0x6ef5('0x9')](_0x6ef5('0xc'),auth[_0x6ef5('0xa')](),controller['show']);router['get'](_0x6ef5('0xd'),auth['isAuthenticated'](),controller[_0x6ef5('0xe')]);router[_0x6ef5('0xf')]('/',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0x10')]);router['put']('/:id',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0x11')]);router['delete']('/:id',auth[_0x6ef5('0xa')](),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 957d008..502ac94 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 _0xce48=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x211711,_0x3f64af){var _0x13deec=function(_0x4f50de){while(--_0x4f50de){_0x211711['push'](_0x211711['shift']());}};_0x13deec(++_0x3f64af);}(_0xce48,0x149));var _0x8ce4=function(_0x3fb150,_0x5e32ed){_0x3fb150=_0x3fb150-0x0;var _0x56f4a8=_0xce48[_0x3fb150];return _0x56f4a8;};'use strict';var Sequelize=require(_0x8ce4('0x0'));module[_0x8ce4('0x1')]={'field':{'type':Sequelize[_0x8ce4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x8ce4('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x8ce4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8ce4('0x3')]},'custom':{'type':Sequelize[_0x8ce4('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe4eb=['exports','STRING','BOOLEAN','sequelize'];(function(_0x12a890,_0x4f3cb5){var _0x1a79ef=function(_0x5723f4){while(--_0x5723f4){_0x12a890['push'](_0x12a890['shift']());}};_0x1a79ef(++_0x4f3cb5);}(_0xe4eb,0x67));var _0xbe4e=function(_0x3a4c87,_0x3068ff){_0x3a4c87=_0x3a4c87-0x0;var _0x5ef79c=_0xe4eb[_0x3a4c87];return _0x5ef79c;};'use strict';var Sequelize=require(_0xbe4e('0x0'));module[_0xbe4e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xbe4e('0x2')]},'function':{'type':Sequelize[_0xbe4e('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe4e('0x2')]},'custom':{'type':Sequelize[_0xbe4e('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 262e24a..7e37868 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 _0x8a1f=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','destroy','CustomReportId','eml-format'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8a1f,0x1ad));var _0xf8a1=function(_0x3a5a8d,_0x22dac9){_0x3a5a8d=_0x3a5a8d-0x0;var _0x1b94b7=_0x8a1f[_0x3a5a8d];return _0x1b94b7;};'use strict';var emlformat=require(_0xf8a1('0x0'));var rimraf=require(_0xf8a1('0x1'));var zipdir=require(_0xf8a1('0x2'));var jsonpatch=require(_0xf8a1('0x3'));var rp=require(_0xf8a1('0x4'));var moment=require(_0xf8a1('0x5'));var BPromise=require(_0xf8a1('0x6'));var Mustache=require(_0xf8a1('0x7'));var util=require(_0xf8a1('0x8'));var path=require('path');var sox=require(_0xf8a1('0x9'));var csv=require(_0xf8a1('0xa'));var ejs=require(_0xf8a1('0xb'));var fs=require('fs');var fs_extra=require(_0xf8a1('0xc'));var _=require(_0xf8a1('0xd'));var squel=require(_0xf8a1('0xe'));var crypto=require(_0xf8a1('0xf'));var jsforce=require(_0xf8a1('0x10'));var deskjs=require(_0xf8a1('0x11'));var toCsv=require(_0xf8a1('0xa'));var querystring=require(_0xf8a1('0x12'));var Papa=require('papaparse');var Redis=require(_0xf8a1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf8a1('0x14'));var as=require(_0xf8a1('0x15'));var hardwareService=require(_0xf8a1('0x16'));var logger=require(_0xf8a1('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xf8a1('0x18'));var licenseUtil=require(_0xf8a1('0x19'));var db=require(_0xf8a1('0x1a'))['db'];function respondWithStatusCode(_0x4c6cee,_0x29c5f9){_0x29c5f9=_0x29c5f9||0xcc;return function(_0xa28473){if(_0xa28473){return _0x4c6cee[_0xf8a1('0x1b')](_0x29c5f9);}return _0x4c6cee[_0xf8a1('0x1c')](_0x29c5f9)[_0xf8a1('0x1d')]();};}function respondWithResult(_0x264cf0,_0x3cc7fd){_0x3cc7fd=_0x3cc7fd||0xc8;return function(_0x362650){if(_0x362650){return _0x264cf0['status'](_0x3cc7fd)[_0xf8a1('0x1e')](_0x362650);}};}function respondWithFilteredResult(_0x30b0dc,_0xaec725){return function(_0x230c16){if(_0x230c16){var _0x12b643=typeof _0xaec725['offset']===_0xf8a1('0x1f')&&typeof _0xaec725[_0xf8a1('0x20')]==='undefined';var _0x32fad6=_0x230c16['count'];var _0x317121=_0x12b643?0x0:_0xaec725['offset'];var _0x397238=_0x12b643?_0x230c16[_0xf8a1('0x21')]:_0xaec725['offset']+_0xaec725['limit'];var _0x4fe48b;if(_0x397238>=_0x32fad6){_0x397238=_0x32fad6;_0x4fe48b=0xc8;}else{_0x4fe48b=0xce;}_0x30b0dc[_0xf8a1('0x1c')](_0x4fe48b);return _0x30b0dc[_0xf8a1('0x22')](_0xf8a1('0x23'),_0x317121+'-'+_0x397238+'/'+_0x32fad6)[_0xf8a1('0x1e')](_0x230c16);}return null;};}function patchUpdates(_0x5dcb89){return function(_0x2b1d0d){try{jsonpatch[_0xf8a1('0x24')](_0x2b1d0d,_0x5dcb89,!![]);}catch(_0x1c8714){return BPromise[_0xf8a1('0x25')](_0x1c8714);}return _0x2b1d0d['save']();};}function saveUpdates(_0x200489,_0x1baeb8){return function(_0x47e575){if(_0x47e575){return _0x47e575[_0xf8a1('0x26')](_0x200489)[_0xf8a1('0x27')](function(_0x33e269){return _0x33e269;});}return null;};}function removeEntity(_0x37f7ac,_0x2396b7){return function(_0x4dace2){if(_0x4dace2){return _0x4dace2['destroy']()[_0xf8a1('0x27')](function(){_0x37f7ac[_0xf8a1('0x1c')](0xcc)[_0xf8a1('0x1d')]();});}};}function handleEntityNotFound(_0x5d8618,_0x58c449){return function(_0x293913){if(!_0x293913){_0x5d8618[_0xf8a1('0x1b')](0x194);}return _0x293913;};}function handleError(_0x1ce9f8,_0x4e0fa6){_0x4e0fa6=_0x4e0fa6||0x1f4;return function(_0x40e8b9){logger[_0xf8a1('0x28')](_0x40e8b9['stack']);if(_0x40e8b9[_0xf8a1('0x29')]){delete _0x40e8b9[_0xf8a1('0x29')];}_0x1ce9f8['status'](_0x4e0fa6)[_0xf8a1('0x2a')](_0x40e8b9);};}exports['index']=function(_0x5cdd38,_0x4fdcb1){var _0x3eaeed={},_0x29ce04={},_0x2cf506={'count':0x0,'rows':[]};var _0x585798=_[_0xf8a1('0x2b')](db[_0xf8a1('0x2c')][_0xf8a1('0x2d')],function(_0x38bd65){return{'name':_0x38bd65[_0xf8a1('0x2e')],'type':_0x38bd65[_0xf8a1('0x2f')][_0xf8a1('0x30')]};});_0x29ce04[_0xf8a1('0x31')]=_[_0xf8a1('0x2b')](_0x585798,_0xf8a1('0x29'));_0x29ce04[_0xf8a1('0x32')]=_[_0xf8a1('0x33')](_0x5cdd38['query']);_0x29ce04[_0xf8a1('0x34')]=_[_0xf8a1('0x35')](_0x29ce04[_0xf8a1('0x31')],_0x29ce04['query']);_0x3eaeed[_0xf8a1('0x36')]=_['intersection'](_0x29ce04['model'],qs['fields'](_0x5cdd38['query'][_0xf8a1('0x37')]));_0x3eaeed['attributes']=_0x3eaeed['attributes'][_0xf8a1('0x38')]?_0x3eaeed[_0xf8a1('0x36')]:_0x29ce04[_0xf8a1('0x31')];if(!_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x39')](_0xf8a1('0x3a'))){_0x3eaeed[_0xf8a1('0x20')]=qs[_0xf8a1('0x20')](_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x20')]);_0x3eaeed[_0xf8a1('0x3b')]=qs[_0xf8a1('0x3b')](_0x5cdd38['query'][_0xf8a1('0x3b')]);}_0x3eaeed[_0xf8a1('0x3c')]=qs[_0xf8a1('0x3d')](_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x3d')]);_0x3eaeed['where']=qs[_0xf8a1('0x34')](_[_0xf8a1('0x3e')](_0x5cdd38[_0xf8a1('0x32')],_0x29ce04['filters']),_0x585798);if(_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x3f')]){_0x3eaeed['where']=_[_0xf8a1('0x40')](_0x3eaeed[_0xf8a1('0x41')],{'$or':_[_0xf8a1('0x2b')](_0x585798,function(_0x36f35b){if(_0x36f35b[_0xf8a1('0x2f')]!==_0xf8a1('0x42')){var _0x5f364a={};_0x5f364a[_0x36f35b[_0xf8a1('0x29')]]={'$like':'%'+_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x3f')]+'%'};return _0x5f364a;}})});}_0x3eaeed=_[_0xf8a1('0x40')]({},_0x3eaeed,_0x5cdd38[_0xf8a1('0x43')]);var _0x15076b={'where':_0x3eaeed['where']};return db[_0xf8a1('0x2c')][_0xf8a1('0x21')](_0x15076b)['then'](function(_0xa62d37){_0x2cf506['count']=_0xa62d37;if(_0x5cdd38['query'][_0xf8a1('0x44')]){_0x3eaeed[_0xf8a1('0x45')]=[{'all':!![]}];}return db[_0xf8a1('0x2c')][_0xf8a1('0x46')](_0x3eaeed);})[_0xf8a1('0x27')](function(_0x3b4c77){_0x2cf506['rows']=_0x3b4c77;return _0x2cf506;})[_0xf8a1('0x27')](respondWithFilteredResult(_0x4fdcb1,_0x3eaeed))[_0xf8a1('0x47')](handleError(_0x4fdcb1,null));};exports['show']=function(_0x30042a,_0x5a72ad){var _0x5eec5f={'raw':![],'where':{'id':_0x30042a[_0xf8a1('0x48')]['id']}},_0x3038ca={};_0x3038ca['model']=_['keys'](db[_0xf8a1('0x2c')][_0xf8a1('0x2d')]);_0x3038ca[_0xf8a1('0x32')]=_[_0xf8a1('0x33')](_0x30042a[_0xf8a1('0x32')]);_0x3038ca['filters']=_['intersection'](_0x3038ca[_0xf8a1('0x31')],_0x3038ca[_0xf8a1('0x32')]);_0x5eec5f[_0xf8a1('0x36')]=_[_0xf8a1('0x35')](_0x3038ca[_0xf8a1('0x31')],qs[_0xf8a1('0x37')](_0x30042a['query'][_0xf8a1('0x37')]));_0x5eec5f[_0xf8a1('0x36')]=_0x5eec5f[_0xf8a1('0x36')][_0xf8a1('0x38')]?_0x5eec5f[_0xf8a1('0x36')]:_0x3038ca['model'];if(_0x30042a[_0xf8a1('0x32')][_0xf8a1('0x44')]){_0x5eec5f['include']=[{'all':!![]}];}_0x5eec5f=_['merge']({},_0x5eec5f,_0x30042a[_0xf8a1('0x43')]);return db[_0xf8a1('0x2c')][_0xf8a1('0x49')](_0x5eec5f)[_0xf8a1('0x27')](handleEntityNotFound(_0x5a72ad,null))['then'](respondWithResult(_0x5a72ad,null))[_0xf8a1('0x47')](handleError(_0x5a72ad,null));};exports[_0xf8a1('0x4a')]=function(_0x1ed6a2,_0x259161){return db[_0xf8a1('0x2c')][_0xf8a1('0x4a')](_0x1ed6a2[_0xf8a1('0x4b')],{})[_0xf8a1('0x27')](respondWithResult(_0x259161,0xc9))[_0xf8a1('0x47')](handleError(_0x259161,null));};exports[_0xf8a1('0x4c')]=function(_0xb8bc65,_0x63e338){return db[_0xf8a1('0x2c')]['bulkCreate'](_0xb8bc65[_0xf8a1('0x4b')],{'raw':![],'individualHooks':!![]})[_0xf8a1('0x27')](respondWithResult(_0x63e338,0xc9))[_0xf8a1('0x47')](handleError(_0x63e338,null));};exports[_0xf8a1('0x26')]=function(_0x21cd9f,_0x6c114){if(_0x21cd9f['body']['id']){delete _0x21cd9f[_0xf8a1('0x4b')]['id'];}return db[_0xf8a1('0x2c')][_0xf8a1('0x49')]({'where':{'id':_0x21cd9f[_0xf8a1('0x48')]['id']}})[_0xf8a1('0x27')](handleEntityNotFound(_0x6c114,null))[_0xf8a1('0x27')](saveUpdates(_0x21cd9f[_0xf8a1('0x4b')],null))[_0xf8a1('0x27')](respondWithResult(_0x6c114,null))['catch'](handleError(_0x6c114,null));};exports['destroy']=function(_0x7c5c52,_0x51c6ed){return db[_0xf8a1('0x2c')][_0xf8a1('0x49')]({'where':{'id':_0x7c5c52[_0xf8a1('0x48')]['id']}})[_0xf8a1('0x27')](handleEntityNotFound(_0x51c6ed,null))[_0xf8a1('0x27')](removeEntity(_0x51c6ed,null))[_0xf8a1('0x47')](handleError(_0x51c6ed,null));};exports[_0xf8a1('0x4d')]=function(_0x3cc71a,_0x522912){return db[_0xf8a1('0x2c')]['destroy']({'where':{'id':_0x3cc71a[_0xf8a1('0x32')][_0xf8a1('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x522912,0xcc))['catch'](handleError(_0x522912,null));};exports[_0xf8a1('0x4f')]=function(_0x24784b,_0x52a32e,_0x45d494){return db[_0xf8a1('0x50')][_0xf8a1('0x51')]({'where':{'id':_0x24784b['params']['id']}})['then'](handleEntityNotFound(_0x52a32e,null))[_0xf8a1('0x27')](function(_0x1000cd){if(_0x1000cd){return db[_0xf8a1('0x52')][_0xf8a1('0x53')](function(_0x440ace){return db[_0xf8a1('0x2c')][_0xf8a1('0x54')]({'where':{'CustomReportId':_0x24784b['params']['id']},'transaction':_0x440ace})['then'](function(_0x4a2af3){var _0x1fc043=_['map'](_0x24784b[_0xf8a1('0x4b')],function(_0x38ed01){delete _0x38ed01['id'];_0x38ed01[_0xf8a1('0x55')]=_0x24784b[_0xf8a1('0x48')]['id'];return _0x38ed01;});return db[_0xf8a1('0x2c')][_0xf8a1('0x4c')](_0x1fc043,{'transaction':_0x440ace});});})[_0xf8a1('0x27')](function(){return db[_0xf8a1('0x2c')]['findAll']({'where':{'CustomReportId':_0x24784b['params']['id']}});});}})['then'](respondWithResult(_0x52a32e,null))['catch'](handleError(_0x52a32e,null));};
\ No newline at end of file
+var _0xa0e9=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filter','merge','map','type','options','AnalyticFieldReport','findAll','catch','show','includeAll','body','bulkCreate','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes'];(function(_0x26dbc0,_0xf2424f){var _0x2a8e66=function(_0x1526d4){while(--_0x1526d4){_0x26dbc0['push'](_0x26dbc0['shift']());}};_0x2a8e66(++_0xf2424f);}(_0xa0e9,0x1eb));var _0x9a0e=function(_0x497274,_0x274702){_0x497274=_0x497274-0x0;var _0x1eb43c=_0xa0e9[_0x497274];return _0x1eb43c;};'use strict';var emlformat=require(_0x9a0e('0x0'));var rimraf=require(_0x9a0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a0e('0x2'));var moment=require(_0x9a0e('0x3'));var BPromise=require(_0x9a0e('0x4'));var Mustache=require(_0x9a0e('0x5'));var util=require(_0x9a0e('0x6'));var path=require(_0x9a0e('0x7'));var sox=require('sox');var csv=require(_0x9a0e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a0e('0x9'));var _=require('lodash');var squel=require(_0x9a0e('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a0e('0xb'));var deskjs=require(_0x9a0e('0xc'));var toCsv=require(_0x9a0e('0x8'));var querystring=require('querystring');var Papa=require(_0x9a0e('0xd'));var Redis=require(_0x9a0e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9a0e('0xf'));var hardwareService=require(_0x9a0e('0x10'));var logger=require(_0x9a0e('0x11'))(_0x9a0e('0x12'));var utils=require(_0x9a0e('0x13'));var config=require(_0x9a0e('0x14'));var licenseUtil=require(_0x9a0e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x203dec,_0x41d64d){_0x41d64d=_0x41d64d||0xcc;return function(_0x315f68){if(_0x315f68){return _0x203dec['sendStatus'](_0x41d64d);}return _0x203dec['status'](_0x41d64d)[_0x9a0e('0x16')]();};}function respondWithResult(_0x1b6132,_0x151fbb){_0x151fbb=_0x151fbb||0xc8;return function(_0x2a869){if(_0x2a869){return _0x1b6132[_0x9a0e('0x17')](_0x151fbb)[_0x9a0e('0x18')](_0x2a869);}};}function respondWithFilteredResult(_0x5a25ff,_0x1392e4){return function(_0x329c86){if(_0x329c86){var _0x238741=typeof _0x1392e4[_0x9a0e('0x19')]===_0x9a0e('0x1a')&&typeof _0x1392e4['limit']==='undefined';var _0x311cf4=_0x329c86[_0x9a0e('0x1b')];var _0x5007c4=_0x238741?0x0:_0x1392e4['offset'];var _0x41aa1c=_0x238741?_0x329c86[_0x9a0e('0x1b')]:_0x1392e4[_0x9a0e('0x19')]+_0x1392e4['limit'];var _0xc6d3f6;if(_0x41aa1c>=_0x311cf4){_0x41aa1c=_0x311cf4;_0xc6d3f6=0xc8;}else{_0xc6d3f6=0xce;}_0x5a25ff['status'](_0xc6d3f6);return _0x5a25ff[_0x9a0e('0x1c')](_0x9a0e('0x1d'),_0x5007c4+'-'+_0x41aa1c+'/'+_0x311cf4)[_0x9a0e('0x18')](_0x329c86);}return null;};}function patchUpdates(_0xf6d33){return function(_0x47f6c6){try{jsonpatch['apply'](_0x47f6c6,_0xf6d33,!![]);}catch(_0x3bc6d1){return BPromise['reject'](_0x3bc6d1);}return _0x47f6c6[_0x9a0e('0x1e')]();};}function saveUpdates(_0x28bcb4,_0x282b6){return function(_0x1cdac5){if(_0x1cdac5){return _0x1cdac5[_0x9a0e('0x1f')](_0x28bcb4)['then'](function(_0x1fd478){return _0x1fd478;});}return null;};}function removeEntity(_0x190ed2,_0x4fda96){return function(_0x599e81){if(_0x599e81){return _0x599e81[_0x9a0e('0x20')]()[_0x9a0e('0x21')](function(){_0x190ed2[_0x9a0e('0x17')](0xcc)[_0x9a0e('0x16')]();});}};}function handleEntityNotFound(_0x207aa6,_0x2a000d){return function(_0x1466df){if(!_0x1466df){_0x207aa6[_0x9a0e('0x22')](0x194);}return _0x1466df;};}function handleError(_0x1e1383,_0x5ad194){_0x5ad194=_0x5ad194||0x1f4;return function(_0x36630c){logger[_0x9a0e('0x23')](_0x36630c[_0x9a0e('0x24')]);if(_0x36630c[_0x9a0e('0x25')]){delete _0x36630c[_0x9a0e('0x25')];}_0x1e1383[_0x9a0e('0x17')](_0x5ad194)[_0x9a0e('0x26')](_0x36630c);};}exports[_0x9a0e('0x27')]=function(_0xcbbe7b,_0x2c873){var _0x1af0db={},_0x32340a={},_0x27b1c1={'count':0x0,'rows':[]};var _0x4a31d0=_['map'](db['AnalyticFieldReport'][_0x9a0e('0x28')],function(_0x373a3b){return{'name':_0x373a3b[_0x9a0e('0x29')],'type':_0x373a3b['type'][_0x9a0e('0x2a')]};});_0x32340a[_0x9a0e('0x2b')]=_['map'](_0x4a31d0,_0x9a0e('0x25'));_0x32340a[_0x9a0e('0x2c')]=_[_0x9a0e('0x2d')](_0xcbbe7b[_0x9a0e('0x2c')]);_0x32340a[_0x9a0e('0x2e')]=_[_0x9a0e('0x2f')](_0x32340a['model'],_0x32340a['query']);_0x1af0db[_0x9a0e('0x30')]=_[_0x9a0e('0x2f')](_0x32340a[_0x9a0e('0x2b')],qs[_0x9a0e('0x31')](_0xcbbe7b['query'][_0x9a0e('0x31')]));_0x1af0db[_0x9a0e('0x30')]=_0x1af0db[_0x9a0e('0x30')][_0x9a0e('0x32')]?_0x1af0db['attributes']:_0x32340a[_0x9a0e('0x2b')];if(!_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x33')]('nolimit')){_0x1af0db['limit']=qs[_0x9a0e('0x34')](_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x34')]);_0x1af0db[_0x9a0e('0x19')]=qs['offset'](_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x19')]);}_0x1af0db['order']=qs[_0x9a0e('0x35')](_0xcbbe7b['query']['sort']);_0x1af0db[_0x9a0e('0x36')]=qs[_0x9a0e('0x2e')](_['pick'](_0xcbbe7b[_0x9a0e('0x2c')],_0x32340a[_0x9a0e('0x2e')]),_0x4a31d0);if(_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x37')]){_0x1af0db[_0x9a0e('0x36')]=_[_0x9a0e('0x38')](_0x1af0db['where'],{'$or':_[_0x9a0e('0x39')](_0x4a31d0,function(_0x59163f){if(_0x59163f[_0x9a0e('0x3a')]!=='VIRTUAL'){var _0x38beea={};_0x38beea[_0x59163f[_0x9a0e('0x25')]]={'$like':'%'+_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x37')]+'%'};return _0x38beea;}})});}_0x1af0db=_[_0x9a0e('0x38')]({},_0x1af0db,_0xcbbe7b[_0x9a0e('0x3b')]);var _0xbae5e9={'where':_0x1af0db[_0x9a0e('0x36')]};return db['AnalyticFieldReport'][_0x9a0e('0x1b')](_0xbae5e9)[_0x9a0e('0x21')](function(_0x470be2){_0x27b1c1[_0x9a0e('0x1b')]=_0x470be2;if(_0xcbbe7b['query']['includeAll']){_0x1af0db['include']=[{'all':!![]}];}return db[_0x9a0e('0x3c')][_0x9a0e('0x3d')](_0x1af0db);})['then'](function(_0x2e6b88){_0x27b1c1['rows']=_0x2e6b88;return _0x27b1c1;})[_0x9a0e('0x21')](respondWithFilteredResult(_0x2c873,_0x1af0db))[_0x9a0e('0x3e')](handleError(_0x2c873,null));};exports[_0x9a0e('0x3f')]=function(_0x3094ae,_0x1258e4){var _0x291ae7={'raw':![],'where':{'id':_0x3094ae['params']['id']}},_0x279b25={};_0x279b25[_0x9a0e('0x2b')]=_['keys'](db[_0x9a0e('0x3c')][_0x9a0e('0x28')]);_0x279b25['query']=_[_0x9a0e('0x2d')](_0x3094ae[_0x9a0e('0x2c')]);_0x279b25[_0x9a0e('0x2e')]=_[_0x9a0e('0x2f')](_0x279b25['model'],_0x279b25[_0x9a0e('0x2c')]);_0x291ae7[_0x9a0e('0x30')]=_[_0x9a0e('0x2f')](_0x279b25[_0x9a0e('0x2b')],qs[_0x9a0e('0x31')](_0x3094ae['query'][_0x9a0e('0x31')]));_0x291ae7[_0x9a0e('0x30')]=_0x291ae7[_0x9a0e('0x30')]['length']?_0x291ae7[_0x9a0e('0x30')]:_0x279b25['model'];if(_0x3094ae[_0x9a0e('0x2c')][_0x9a0e('0x40')]){_0x291ae7['include']=[{'all':!![]}];}_0x291ae7=_[_0x9a0e('0x38')]({},_0x291ae7,_0x3094ae[_0x9a0e('0x3b')]);return db[_0x9a0e('0x3c')]['find'](_0x291ae7)['then'](handleEntityNotFound(_0x1258e4,null))[_0x9a0e('0x21')](respondWithResult(_0x1258e4,null))[_0x9a0e('0x3e')](handleError(_0x1258e4,null));};exports['create']=function(_0x59da81,_0x39e97f){return db[_0x9a0e('0x3c')]['create'](_0x59da81[_0x9a0e('0x41')],{})[_0x9a0e('0x21')](respondWithResult(_0x39e97f,0xc9))[_0x9a0e('0x3e')](handleError(_0x39e97f,null));};exports[_0x9a0e('0x42')]=function(_0x3285f2,_0x2bf8c5){return db['AnalyticFieldReport'][_0x9a0e('0x42')](_0x3285f2['body'],{'raw':![],'individualHooks':!![]})[_0x9a0e('0x21')](respondWithResult(_0x2bf8c5,0xc9))[_0x9a0e('0x3e')](handleError(_0x2bf8c5,null));};exports[_0x9a0e('0x1f')]=function(_0x2a2e51,_0x3d4edf){if(_0x2a2e51['body']['id']){delete _0x2a2e51[_0x9a0e('0x41')]['id'];}return db[_0x9a0e('0x3c')]['find']({'where':{'id':_0x2a2e51['params']['id']}})['then'](handleEntityNotFound(_0x3d4edf,null))['then'](saveUpdates(_0x2a2e51['body'],null))[_0x9a0e('0x21')](respondWithResult(_0x3d4edf,null))[_0x9a0e('0x3e')](handleError(_0x3d4edf,null));};exports[_0x9a0e('0x20')]=function(_0x2d6a32,_0x86d605){return db['AnalyticFieldReport'][_0x9a0e('0x43')]({'where':{'id':_0x2d6a32[_0x9a0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x86d605,null))[_0x9a0e('0x21')](removeEntity(_0x86d605,null))[_0x9a0e('0x3e')](handleError(_0x86d605,null));};exports[_0x9a0e('0x45')]=function(_0x4659bb,_0xc141f3){return db['AnalyticFieldReport'][_0x9a0e('0x20')]({'where':{'id':_0x4659bb['query'][_0x9a0e('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x9a0e('0x21')](respondWithResult(_0xc141f3,0xcc))[_0x9a0e('0x3e')](handleError(_0xc141f3,null));};exports[_0x9a0e('0x47')]=function(_0x23c737,_0x11ef9c,_0x17b2dc){return db[_0x9a0e('0x48')][_0x9a0e('0x49')]({'where':{'id':_0x23c737['params']['id']}})['then'](handleEntityNotFound(_0x11ef9c,null))[_0x9a0e('0x21')](function(_0x2c0073){if(_0x2c0073){return db['sequelize'][_0x9a0e('0x4a')](function(_0x18bd21){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x23c737[_0x9a0e('0x44')]['id']},'transaction':_0x18bd21})[_0x9a0e('0x21')](function(_0x1ef7db){var _0xa2a549=_['map'](_0x23c737['body'],function(_0x466654){delete _0x466654['id'];_0x466654[_0x9a0e('0x4b')]=_0x23c737[_0x9a0e('0x44')]['id'];return _0x466654;});return db[_0x9a0e('0x3c')][_0x9a0e('0x42')](_0xa2a549,{'transaction':_0x18bd21});});})['then'](function(){return db[_0x9a0e('0x3c')][_0x9a0e('0x3d')]({'where':{'CustomReportId':_0x23c737['params']['id']}});});}})[_0x9a0e('0x21')](respondWithResult(_0x11ef9c,null))[_0x9a0e('0x3e')](handleError(_0x11ef9c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6d479e6..cd1bb38 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 _0xa0e4=['../../config/environment','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4778ad,_0x22a372){var _0x345476=function(_0x47fd6f){while(--_0x47fd6f){_0x4778ad['push'](_0x4778ad['shift']());}};_0x345476(++_0x22a372);}(_0xa0e4,0x12c));var _0x4a0e=function(_0x435ba5,_0x55875f){_0x435ba5=_0x435ba5-0x0;var _0x5af51d=_0xa0e4[_0x435ba5];return _0x5af51d;};'use strict';var _=require(_0x4a0e('0x0'));var util=require(_0x4a0e('0x1'));var logger=require(_0x4a0e('0x2'))(_0x4a0e('0x3'));var moment=require(_0x4a0e('0x4'));var BPromise=require(_0x4a0e('0x5'));var rp=require(_0x4a0e('0x6'));var fs=require('fs');var path=require(_0x4a0e('0x7'));var rimraf=require('rimraf');var config=require(_0x4a0e('0x8'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x4ddbc4,_0x2f666d){return _0x4ddbc4[_0x4a0e('0x9')](_0x4a0e('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a55=['analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x6a55,0xeb));var _0x56a5=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x6a55[_0x29df9a];return _0x3a8e96;};'use strict';var _=require(_0x56a5('0x0'));var util=require(_0x56a5('0x1'));var logger=require(_0x56a5('0x2'))(_0x56a5('0x3'));var moment=require(_0x56a5('0x4'));var BPromise=require(_0x56a5('0x5'));var rp=require(_0x56a5('0x6'));var fs=require('fs');var path=require(_0x56a5('0x7'));var rimraf=require('rimraf');var config=require(_0x56a5('0x8'));var attributes=require(_0x56a5('0x9'));module['exports']=function(_0x178644,_0x5a3bd2){return _0x178644[_0x56a5('0xa')](_0x56a5('0xb'),attributes,{'tableName':_0x56a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index b64b613..8996da5 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 _0x8537=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x49aee4,_0x17186c){var _0x4042b7=function(_0x2d86cf){while(--_0x2d86cf){_0x49aee4['push'](_0x49aee4['shift']());}};_0x4042b7(++_0x17186c);}(_0x8537,0xe2));var _0x7853=function(_0x1c7c63,_0x5337aa){_0x1c7c63=_0x1c7c63-0x0;var _0x385f7a=_0x8537[_0x1c7c63];return _0x385f7a;};'use strict';var _=require(_0x7853('0x0'));var util=require('util');var moment=require(_0x7853('0x1'));var BPromise=require(_0x7853('0x2'));var rs=require(_0x7853('0x3'));var fs=require('fs');var Redis=require(_0x7853('0x4'));var db=require(_0x7853('0x5'))['db'];var utils=require(_0x7853('0x6'));var logger=require(_0x7853('0x7'))(_0x7853('0x8'));var config=require(_0x7853('0x9'));var jayson=require(_0x7853('0xa'));var client=jayson['client'][_0x7853('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2da0a3,_0x39ff2e,_0x5dfe39){return new BPromise(function(_0x4a6b16,_0x3f2fc7){return client['request'](_0x2da0a3,_0x5dfe39)[_0x7853('0xc')](function(_0x30e9dc){logger[_0x7853('0xd')](_0x7853('0xe'),_0x39ff2e,_0x7853('0xf'));logger[_0x7853('0x10')](_0x7853('0x11'),_0x39ff2e,_0x7853('0xf'),JSON[_0x7853('0x12')](_0x30e9dc));if(_0x30e9dc[_0x7853('0x13')]){if(_0x30e9dc[_0x7853('0x13')][_0x7853('0x14')]===0x1f4){logger[_0x7853('0x13')](_0x7853('0xe'),_0x39ff2e,_0x30e9dc[_0x7853('0x13')]['message']);return _0x3f2fc7(_0x30e9dc[_0x7853('0x13')][_0x7853('0x15')]);}logger[_0x7853('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x39ff2e,_0x30e9dc['error'][_0x7853('0x15')]);return _0x4a6b16(_0x30e9dc[_0x7853('0x13')][_0x7853('0x15')]);}else{logger[_0x7853('0xd')](_0x7853('0xe'),_0x39ff2e,_0x7853('0xf'));_0x4a6b16(_0x30e9dc[_0x7853('0x16')][_0x7853('0x15')]);}})[_0x7853('0x17')](function(_0x365fce){logger[_0x7853('0x13')](_0x7853('0xe'),_0x39ff2e,_0x365fce);_0x3f2fc7(_0x365fce);});});}
\ No newline at end of file
+var _0x3fc4=['error','code','message','result','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xdcde19,_0x224474){var _0x44200c=function(_0x39b31c){while(--_0x39b31c){_0xdcde19['push'](_0xdcde19['shift']());}};_0x44200c(++_0x224474);}(_0x3fc4,0x125));var _0x43fc=function(_0x5c66d2,_0x5f220f){_0x5c66d2=_0x5c66d2-0x0;var _0x8ed5e3=_0x3fc4[_0x5c66d2];return _0x8ed5e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x43fc('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43fc('0x1'));var db=require(_0x43fc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x43fc('0x3'))('rpc');var config=require(_0x43fc('0x4'));var jayson=require(_0x43fc('0x5'));var client=jayson[_0x43fc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe30928,_0x1be3dc,_0xdc6037){return new BPromise(function(_0x44be1f,_0x5137ea){return client[_0x43fc('0x7')](_0xe30928,_0xdc6037)[_0x43fc('0x8')](function(_0x36f347){logger[_0x43fc('0x9')](_0x43fc('0xa'),_0x1be3dc,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1be3dc,_0x43fc('0xb'),JSON[_0x43fc('0xc')](_0x36f347));if(_0x36f347[_0x43fc('0xd')]){if(_0x36f347[_0x43fc('0xd')][_0x43fc('0xe')]===0x1f4){logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x36f347[_0x43fc('0xd')][_0x43fc('0xf')]);return _0x5137ea(_0x36f347['error']['message']);}logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x36f347[_0x43fc('0xd')][_0x43fc('0xf')]);return _0x44be1f(_0x36f347['error']['message']);}else{logger[_0x43fc('0x9')](_0x43fc('0xa'),_0x1be3dc,_0x43fc('0xb'));_0x44be1f(_0x36f347[_0x43fc('0x10')][_0x43fc('0xf')]);}})['catch'](function(_0x2fa605){logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x2fa605);_0x5137ea(_0x2fa605);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b73cc21..0c5ef49 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(_0x362058,_0x446816){var _0x1e4d4b=function(_0x2d4b2a){while(--_0x2d4b2a){_0x362058['push'](_0x362058['shift']());}};_0x1e4d4b(++_0x446816);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x135c0b,_0x4a8182){var _0x3ff6be=function(_0x43ee7f){while(--_0x43ee7f){_0x135c0b['push'](_0x135c0b['shift']());}};_0x3ff6be(++_0x4a8182);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 bbe4848..a59cae4 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 _0xb077=['TEXT','STRING','sequelize','name'];(function(_0xa066f8,_0x4636af){var _0x2b5cb8=function(_0x3a4052){while(--_0x3a4052){_0xa066f8['push'](_0xa066f8['shift']());}};_0x2b5cb8(++_0x4636af);}(_0xb077,0x7a));var _0x7b07=function(_0x555e0e,_0x379d86){_0x555e0e=_0x555e0e-0x0;var _0x798715=_0xb077[_0x555e0e];return _0x798715;};'use strict';var Sequelize=require(_0x7b07('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7b07('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7b07('0x2')]},'description':{'type':Sequelize[_0x7b07('0x3')]}};
\ No newline at end of file
+var _0x0901=['STRING','name','TEXT','sequelize','exports'];(function(_0x332339,_0x3a98e1){var _0x2d78e9=function(_0x574ea5){while(--_0x574ea5){_0x332339['push'](_0x332339['shift']());}};_0x2d78e9(++_0x3a98e1);}(_0x0901,0x134));var _0x1090=function(_0x36d65a,_0x2f23e9){_0x36d65a=_0x36d65a-0x0;var _0x859c46=_0x0901[_0x36d65a];return _0x859c46;};'use strict';var Sequelize=require(_0x1090('0x0'));module[_0x1090('0x1')]={'name':{'type':Sequelize[_0x1090('0x2')],'allowNull':![],'unique':_0x1090('0x3')},'table':{'type':Sequelize[_0x1090('0x2')]},'metric':{'type':Sequelize[_0x1090('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 2a93a17..91d53e5 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 _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5ac3b7,_0x4e43a3){var _0x56b129=function(_0x2b75c0){while(--_0x2b75c0){_0x5ac3b7['push'](_0x5ac3b7['shift']());}};_0x56b129(++_0x4e43a3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x389318,_0x13a53d){_0x389318=_0x389318-0x0;var _0x7919e3=_0xf2ca[_0x389318];return _0x7919e3;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
+var _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x18001b,_0x482b75){_0x18001b=_0x18001b-0x0;var _0x16f3f3=_0x1cb9[_0x18001b];return _0x16f3f3;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d3d87c7..399f34c 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 _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8a5=['analytics_metrics','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x3b80e7,_0x8f4796){var _0x2fdca1=function(_0x446920){while(--_0x446920){_0x3b80e7['push'](_0x3b80e7['shift']());}};_0x2fdca1(++_0x8f4796);}(_0xd8a5,0x160));var _0x5d8a=function(_0x4b187b,_0x431650){_0x4b187b=_0x4b187b-0x0;var _0x321553=_0xd8a5[_0x4b187b];return _0x321553;};'use strict';var _=require(_0x5d8a('0x0'));var util=require('util');var logger=require(_0x5d8a('0x1'))(_0x5d8a('0x2'));var moment=require('moment');var BPromise=require(_0x5d8a('0x3'));var rp=require(_0x5d8a('0x4'));var fs=require('fs');var path=require(_0x5d8a('0x5'));var rimraf=require(_0x5d8a('0x6'));var config=require(_0x5d8a('0x7'));var attributes=require(_0x5d8a('0x8'));module[_0x5d8a('0x9')]=function(_0x38eaa5,_0x1ef405){return _0x38eaa5[_0x5d8a('0xa')](_0x5d8a('0xb'),attributes,{'tableName':_0x5d8a('0xc'),'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 097524e..c0057f5 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 _0x87cd=['info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc18fc0,_0x2fa31c){var _0x208c93=function(_0x58a2c0){while(--_0x58a2c0){_0xc18fc0['push'](_0xc18fc0['shift']());}};_0x208c93(++_0x2fa31c);}(_0x87cd,0xe6));var _0xd87c=function(_0xc9ed15,_0x1401a8){_0xc9ed15=_0xc9ed15-0x0;var _0x470a09=_0x87cd[_0xc9ed15];return _0x470a09;};'use strict';var _=require('lodash');var util=require(_0xd87c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd87c('0x1'));var fs=require('fs');var Redis=require(_0xd87c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd87c('0x3'));var config=require(_0xd87c('0x4'));var jayson=require(_0xd87c('0x5'));var client=jayson[_0xd87c('0x6')][_0xd87c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fe4f8,_0x4e5676,_0x1243b4){return new BPromise(function(_0x361c30,_0xf1f770){return client['request'](_0x2fe4f8,_0x1243b4)['then'](function(_0x4b13c9){logger[_0xd87c('0x8')]('AnalyticMetric,\x20%s,\x20%s',_0x4e5676,_0xd87c('0x9'));logger[_0xd87c('0xa')](_0xd87c('0xb'),_0x4e5676,'request\x20sent',JSON['stringify'](_0x4b13c9));if(_0x4b13c9['error']){if(_0x4b13c9[_0xd87c('0xc')][_0xd87c('0xd')]===0x1f4){logger[_0xd87c('0xc')](_0xd87c('0xe'),_0x4e5676,_0x4b13c9[_0xd87c('0xc')]['message']);return _0xf1f770(_0x4b13c9[_0xd87c('0xc')]['message']);}logger[_0xd87c('0xc')](_0xd87c('0xe'),_0x4e5676,_0x4b13c9['error'][_0xd87c('0xf')]);return _0x361c30(_0x4b13c9[_0xd87c('0xc')]['message']);}else{logger[_0xd87c('0x8')](_0xd87c('0xe'),_0x4e5676,_0xd87c('0x9'));_0x361c30(_0x4b13c9['result'][_0xd87c('0xf')]);}})[_0xd87c('0x10')](function(_0x23864d){logger[_0xd87c('0xc')](_0xd87c('0xe'),_0x4e5676,_0x23864d);_0xf1f770(_0x23864d);});});}
\ No newline at end of file
+var _0x4f5d=['request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4f9b56,_0x4de94e){var _0x5b1e25=function(_0x4dc9fe){while(--_0x4dc9fe){_0x4f9b56['push'](_0x4f9b56['shift']());}};_0x5b1e25(++_0x4de94e);}(_0x4f5d,0x97));var _0xd4f5=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x4f5d[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd4f5('0x0'));var BPromise=require('bluebird');var rs=require(_0xd4f5('0x1'));var fs=require('fs');var Redis=require(_0xd4f5('0x2'));var db=require(_0xd4f5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4f5('0x4'))(_0xd4f5('0x5'));var config=require(_0xd4f5('0x6'));var jayson=require(_0xd4f5('0x7'));var client=jayson['client'][_0xd4f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33ff92,_0x51f8cf,_0x1a4c53){return new BPromise(function(_0x4336f7,_0x405ae3){return client[_0xd4f5('0x9')](_0x33ff92,_0x1a4c53)[_0xd4f5('0xa')](function(_0x1f73cc){logger[_0xd4f5('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x51f8cf,_0xd4f5('0xc'));logger[_0xd4f5('0xd')](_0xd4f5('0xe'),_0x51f8cf,_0xd4f5('0xc'),JSON['stringify'](_0x1f73cc));if(_0x1f73cc['error']){if(_0x1f73cc['error']['code']===0x1f4){logger['error'](_0xd4f5('0xf'),_0x51f8cf,_0x1f73cc['error'][_0xd4f5('0x10')]);return _0x405ae3(_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);}logger[_0xd4f5('0x11')](_0xd4f5('0xf'),_0x51f8cf,_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);return _0x4336f7(_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);}else{logger[_0xd4f5('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x51f8cf,_0xd4f5('0xc'));_0x4336f7(_0x1f73cc[_0xd4f5('0x12')][_0xd4f5('0x10')]);}})[_0xd4f5('0x13')](function(_0x323a5a){logger[_0xd4f5('0x11')](_0xd4f5('0xf'),_0x51f8cf,_0x323a5a);_0x405ae3(_0x323a5a);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 1a59465..c02e9c4 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 _0x79a8=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','update','multer'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x79a8,0x1d0));var _0x879a=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0x79a8[_0xd29c88];return _0x375635;};'use strict';var multer=require(_0x879a('0x0'));var util=require('util');var path=require(_0x879a('0x1'));var timeout=require(_0x879a('0x2'));var express=require(_0x879a('0x3'));var router=express['Router']();var fs_extra=require(_0x879a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var controller=require(_0x879a('0x7'));router[_0x879a('0x8')]('/',auth[_0x879a('0x9')](),controller[_0x879a('0xa')]);router[_0x879a('0x8')](_0x879a('0xb'),auth['isAuthenticated'](),controller[_0x879a('0xc')]);router['post']('/',auth[_0x879a('0x9')](),controller[_0x879a('0xd')]);router['put'](_0x879a('0xb'),auth[_0x879a('0x9')](),controller[_0x879a('0xe')]);router['delete'](_0x879a('0xb'),auth[_0x879a('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa261=['./analyticMetric.controller','get','isAuthenticated','index','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d0cba,_0x2731b1){var _0xdc3278=function(_0x3b20f5){while(--_0x3b20f5){_0x1d0cba['push'](_0x1d0cba['shift']());}};_0xdc3278(++_0x2731b1);}(_0xa261,0x1a3));var _0x1a26=function(_0x20f563,_0x4a3bf6){_0x20f563=_0x20f563-0x0;var _0x5c15a1=_0xa261[_0x20f563];return _0x5c15a1;};'use strict';var multer=require(_0x1a26('0x0'));var util=require('util');var path=require(_0x1a26('0x1'));var timeout=require(_0x1a26('0x2'));var express=require(_0x1a26('0x3'));var router=express[_0x1a26('0x4')]();var fs_extra=require(_0x1a26('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a26('0x6'));router[_0x1a26('0x7')]('/',auth[_0x1a26('0x8')](),controller[_0x1a26('0x9')]);router[_0x1a26('0x7')]('/:id',auth[_0x1a26('0x8')](),controller['show']);router[_0x1a26('0xa')]('/',auth[_0x1a26('0x8')](),controller[_0x1a26('0xb')]);router['put'](_0x1a26('0xc'),auth[_0x1a26('0x8')](),controller[_0x1a26('0xd')]);router[_0x1a26('0xe')](_0x1a26('0xc'),auth['isAuthenticated'](),controller[_0x1a26('0xf')]);module[_0x1a26('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 8ab2944..63847d9 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 _0x8f6a=['TEXT','sequelize','exports'];(function(_0x9ae5b4,_0x139b17){var _0xa4d634=function(_0x57500e){while(--_0x57500e){_0x9ae5b4['push'](_0x9ae5b4['shift']());}};_0xa4d634(++_0x139b17);}(_0x8f6a,0x12d));var _0xa8f6=function(_0x59ddda,_0x332c06){_0x59ddda=_0x59ddda-0x0;var _0x1ab861=_0x8f6a[_0x59ddda];return _0x1ab861;};'use strict';var Sequelize=require(_0xa8f6('0x0'));module[_0xa8f6('0x1')]={'tree':{'type':Sequelize[_0xa8f6('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x4e05=['exports','sequelize'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4e05,0x193));var _0x54e0=function(_0x5cd25b,_0x950abb){_0x5cd25b=_0x5cd25b-0x0;var _0x1c57a2=_0x4e05[_0x5cd25b];return _0x1c57a2;};'use strict';var Sequelize=require(_0x54e0('0x0'));module[_0x54e0('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 29df0b9..566ddf2 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 _0x27d7=['pick','filter','merge','type','VIRTUAL','count','includeAll','catch','show','params','fields','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','AnalyticTreeReport','rawAttributes','key','map','keys','query','filters','intersection','model','attributes','length','nolimit','order','sort','where'];(function(_0x470137,_0x41829f){var _0x3737e0=function(_0x4b652e){while(--_0x4b652e){_0x470137['push'](_0x470137['shift']());}};_0x3737e0(++_0x41829f);}(_0x27d7,0xa7));var _0x727d=function(_0x51e5bd,_0x3c2cf1){_0x51e5bd=_0x51e5bd-0x0;var _0x250aed=_0x27d7[_0x51e5bd];return _0x250aed;};'use strict';var emlformat=require(_0x727d('0x0'));var rimraf=require(_0x727d('0x1'));var zipdir=require(_0x727d('0x2'));var jsonpatch=require(_0x727d('0x3'));var rp=require(_0x727d('0x4'));var moment=require('moment');var BPromise=require(_0x727d('0x5'));var Mustache=require('mustache');var util=require(_0x727d('0x6'));var path=require('path');var sox=require(_0x727d('0x7'));var csv=require(_0x727d('0x8'));var ejs=require(_0x727d('0x9'));var fs=require('fs');var fs_extra=require(_0x727d('0xa'));var _=require(_0x727d('0xb'));var squel=require(_0x727d('0xc'));var crypto=require(_0x727d('0xd'));var jsforce=require(_0x727d('0xe'));var deskjs=require(_0x727d('0xf'));var toCsv=require(_0x727d('0x8'));var querystring=require('querystring');var Papa=require(_0x727d('0x10'));var Redis=require(_0x727d('0x11'));var authService=require(_0x727d('0x12'));var qs=require(_0x727d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x727d('0x14'));var logger=require(_0x727d('0x15'))(_0x727d('0x16'));var utils=require(_0x727d('0x17'));var config=require(_0x727d('0x18'));var licenseUtil=require(_0x727d('0x19'));var db=require(_0x727d('0x1a'))['db'];function respondWithStatusCode(_0x321068,_0x1ca9c7){_0x1ca9c7=_0x1ca9c7||0xcc;return function(_0x1d860c){if(_0x1d860c){return _0x321068[_0x727d('0x1b')](_0x1ca9c7);}return _0x321068['status'](_0x1ca9c7)[_0x727d('0x1c')]();};}function respondWithResult(_0x429a79,_0x48821d){_0x48821d=_0x48821d||0xc8;return function(_0x12d790){if(_0x12d790){return _0x429a79[_0x727d('0x1d')](_0x48821d)[_0x727d('0x1e')](_0x12d790);}};}function respondWithFilteredResult(_0x11832c,_0x396d42){return function(_0x1a2467){if(_0x1a2467){var _0x303fea=typeof _0x396d42[_0x727d('0x1f')]===_0x727d('0x20')&&typeof _0x396d42[_0x727d('0x21')]==='undefined';var _0x513849=_0x1a2467['count'];var _0x403fac=_0x303fea?0x0:_0x396d42[_0x727d('0x1f')];var _0x3cc4dc=_0x303fea?_0x1a2467['count']:_0x396d42['offset']+_0x396d42[_0x727d('0x21')];var _0x594e80;if(_0x3cc4dc>=_0x513849){_0x3cc4dc=_0x513849;_0x594e80=0xc8;}else{_0x594e80=0xce;}_0x11832c[_0x727d('0x1d')](_0x594e80);return _0x11832c[_0x727d('0x22')](_0x727d('0x23'),_0x403fac+'-'+_0x3cc4dc+'/'+_0x513849)[_0x727d('0x1e')](_0x1a2467);}return null;};}function patchUpdates(_0x8b6a01){return function(_0xe32817){try{jsonpatch[_0x727d('0x24')](_0xe32817,_0x8b6a01,!![]);}catch(_0x8d51a0){return BPromise[_0x727d('0x25')](_0x8d51a0);}return _0xe32817[_0x727d('0x26')]();};}function saveUpdates(_0x5d0772,_0x22c65e){return function(_0x376e35){if(_0x376e35){return _0x376e35[_0x727d('0x27')](_0x5d0772)[_0x727d('0x28')](function(_0x20ff11){return _0x20ff11;});}return null;};}function removeEntity(_0x48ac12,_0x3d5677){return function(_0x466ced){if(_0x466ced){return _0x466ced[_0x727d('0x29')]()[_0x727d('0x28')](function(){_0x48ac12['status'](0xcc)[_0x727d('0x1c')]();});}};}function handleEntityNotFound(_0x5f19c3,_0x4055bf){return function(_0x55559e){if(!_0x55559e){_0x5f19c3[_0x727d('0x1b')](0x194);}return _0x55559e;};}function handleError(_0x1cb4fa,_0x2db44f){_0x2db44f=_0x2db44f||0x1f4;return function(_0x43fe4d){logger[_0x727d('0x2a')](_0x43fe4d['stack']);if(_0x43fe4d['name']){delete _0x43fe4d[_0x727d('0x2b')];}_0x1cb4fa[_0x727d('0x1d')](_0x2db44f)[_0x727d('0x2c')](_0x43fe4d);};}exports[_0x727d('0x2d')]=function(_0x3fc033,_0x3d1081){var _0x160bd0={},_0x1db63b={},_0x4b8e45={'count':0x0,'rows':[]};var _0x47df5d=_['map'](db[_0x727d('0x2e')][_0x727d('0x2f')],function(_0x21fc5c){return{'name':_0x21fc5c['fieldName'],'type':_0x21fc5c['type'][_0x727d('0x30')]};});_0x1db63b['model']=_[_0x727d('0x31')](_0x47df5d,_0x727d('0x2b'));_0x1db63b['query']=_[_0x727d('0x32')](_0x3fc033[_0x727d('0x33')]);_0x1db63b[_0x727d('0x34')]=_[_0x727d('0x35')](_0x1db63b[_0x727d('0x36')],_0x1db63b[_0x727d('0x33')]);_0x160bd0[_0x727d('0x37')]=_['intersection'](_0x1db63b[_0x727d('0x36')],qs['fields'](_0x3fc033[_0x727d('0x33')]['fields']));_0x160bd0[_0x727d('0x37')]=_0x160bd0[_0x727d('0x37')][_0x727d('0x38')]?_0x160bd0[_0x727d('0x37')]:_0x1db63b[_0x727d('0x36')];if(!_0x3fc033[_0x727d('0x33')]['hasOwnProperty'](_0x727d('0x39'))){_0x160bd0[_0x727d('0x21')]=qs[_0x727d('0x21')](_0x3fc033[_0x727d('0x33')][_0x727d('0x21')]);_0x160bd0[_0x727d('0x1f')]=qs[_0x727d('0x1f')](_0x3fc033[_0x727d('0x33')][_0x727d('0x1f')]);}_0x160bd0[_0x727d('0x3a')]=qs[_0x727d('0x3b')](_0x3fc033[_0x727d('0x33')][_0x727d('0x3b')]);_0x160bd0[_0x727d('0x3c')]=qs[_0x727d('0x34')](_[_0x727d('0x3d')](_0x3fc033['query'],_0x1db63b[_0x727d('0x34')]),_0x47df5d);if(_0x3fc033[_0x727d('0x33')][_0x727d('0x3e')]){_0x160bd0[_0x727d('0x3c')]=_[_0x727d('0x3f')](_0x160bd0[_0x727d('0x3c')],{'$or':_[_0x727d('0x31')](_0x47df5d,function(_0x55b1fc){if(_0x55b1fc[_0x727d('0x40')]!==_0x727d('0x41')){var _0x3c99a5={};_0x3c99a5[_0x55b1fc[_0x727d('0x2b')]]={'$like':'%'+_0x3fc033[_0x727d('0x33')][_0x727d('0x3e')]+'%'};return _0x3c99a5;}})});}_0x160bd0=_['merge']({},_0x160bd0,_0x3fc033['options']);var _0x2da1e3={'where':_0x160bd0[_0x727d('0x3c')]};return db[_0x727d('0x2e')]['count'](_0x2da1e3)[_0x727d('0x28')](function(_0x1f4a23){_0x4b8e45[_0x727d('0x42')]=_0x1f4a23;if(_0x3fc033[_0x727d('0x33')][_0x727d('0x43')]){_0x160bd0['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x160bd0);})[_0x727d('0x28')](function(_0x5e4cc3){_0x4b8e45['rows']=_0x5e4cc3;return _0x4b8e45;})[_0x727d('0x28')](respondWithFilteredResult(_0x3d1081,_0x160bd0))[_0x727d('0x44')](handleError(_0x3d1081,null));};exports[_0x727d('0x45')]=function(_0x4f8ee3,_0x15db7c){var _0x4794c0={'raw':!![],'where':{'id':_0x4f8ee3[_0x727d('0x46')]['id']}},_0x3f9dd5={};_0x3f9dd5['model']=_[_0x727d('0x32')](db['AnalyticTreeReport'][_0x727d('0x2f')]);_0x3f9dd5[_0x727d('0x33')]=_['keys'](_0x4f8ee3[_0x727d('0x33')]);_0x3f9dd5[_0x727d('0x34')]=_['intersection'](_0x3f9dd5['model'],_0x3f9dd5[_0x727d('0x33')]);_0x4794c0[_0x727d('0x37')]=_['intersection'](_0x3f9dd5[_0x727d('0x36')],qs[_0x727d('0x47')](_0x4f8ee3[_0x727d('0x33')][_0x727d('0x47')]));_0x4794c0[_0x727d('0x37')]=_0x4794c0[_0x727d('0x37')]['length']?_0x4794c0[_0x727d('0x37')]:_0x3f9dd5[_0x727d('0x36')];if(_0x4f8ee3[_0x727d('0x33')][_0x727d('0x43')]){_0x4794c0[_0x727d('0x48')]=[{'all':!![]}];}_0x4794c0=_[_0x727d('0x3f')]({},_0x4794c0,_0x4f8ee3['options']);return db[_0x727d('0x2e')][_0x727d('0x49')](_0x4794c0)['then'](handleEntityNotFound(_0x15db7c,null))[_0x727d('0x28')](respondWithResult(_0x15db7c,null))['catch'](handleError(_0x15db7c,null));};exports[_0x727d('0x4a')]=function(_0x1e5dec,_0x4699a2){return db[_0x727d('0x2e')][_0x727d('0x4a')](_0x1e5dec[_0x727d('0x4b')],{})[_0x727d('0x28')](respondWithResult(_0x4699a2,0xc9))[_0x727d('0x44')](handleError(_0x4699a2,null));};exports[_0x727d('0x27')]=function(_0x2e6407,_0x1cacd8){if(_0x2e6407['body']['id']){delete _0x2e6407[_0x727d('0x4b')]['id'];}return db[_0x727d('0x2e')]['find']({'where':{'id':_0x2e6407['params']['id']}})[_0x727d('0x28')](handleEntityNotFound(_0x1cacd8,null))[_0x727d('0x28')](saveUpdates(_0x2e6407[_0x727d('0x4b')],null))[_0x727d('0x28')](respondWithResult(_0x1cacd8,null))[_0x727d('0x44')](handleError(_0x1cacd8,null));};exports[_0x727d('0x29')]=function(_0x90c82e,_0x4d81c1){return db[_0x727d('0x2e')][_0x727d('0x49')]({'where':{'id':_0x90c82e[_0x727d('0x46')]['id']}})[_0x727d('0x28')](handleEntityNotFound(_0x4d81c1,null))['then'](removeEntity(_0x4d81c1,null))[_0x727d('0x44')](handleError(_0x4d81c1,null));};
\ No newline at end of file
+var _0x153a=['catch','keys','find','create','update','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','AnalyticTreeReport','includeAll','include','findAll','rows'];(function(_0x48c444,_0x5e2c6d){var _0x4304c7=function(_0x18136b){while(--_0x18136b){_0x48c444['push'](_0x48c444['shift']());}};_0x4304c7(++_0x5e2c6d);}(_0x153a,0x138));var _0xa153=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x153a[_0x2aea9e];return _0x430b92;};'use strict';var emlformat=require(_0xa153('0x0'));var rimraf=require(_0xa153('0x1'));var zipdir=require(_0xa153('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa153('0x3'));var moment=require(_0xa153('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa153('0x5'));var util=require(_0xa153('0x6'));var path=require('path');var sox=require(_0xa153('0x7'));var csv=require(_0xa153('0x8'));var ejs=require(_0xa153('0x9'));var fs=require('fs');var fs_extra=require(_0xa153('0xa'));var _=require(_0xa153('0xb'));var squel=require(_0xa153('0xc'));var crypto=require('crypto');var jsforce=require(_0xa153('0xd'));var deskjs=require(_0xa153('0xe'));var toCsv=require(_0xa153('0x8'));var querystring=require(_0xa153('0xf'));var Papa=require(_0xa153('0x10'));var Redis=require(_0xa153('0x11'));var authService=require(_0xa153('0x12'));var qs=require(_0xa153('0x13'));var as=require(_0xa153('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa153('0x15'))(_0xa153('0x16'));var utils=require(_0xa153('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa153('0x18'));var db=require(_0xa153('0x19'))['db'];function respondWithStatusCode(_0x3c041d,_0x412f27){_0x412f27=_0x412f27||0xcc;return function(_0x24a9c7){if(_0x24a9c7){return _0x3c041d['sendStatus'](_0x412f27);}return _0x3c041d[_0xa153('0x1a')](_0x412f27)[_0xa153('0x1b')]();};}function respondWithResult(_0x468c65,_0x2108ff){_0x2108ff=_0x2108ff||0xc8;return function(_0x10f537){if(_0x10f537){return _0x468c65[_0xa153('0x1a')](_0x2108ff)['json'](_0x10f537);}};}function respondWithFilteredResult(_0x4cd52e,_0x21ed69){return function(_0x4353be){if(_0x4353be){var _0x317943=typeof _0x21ed69[_0xa153('0x1c')]===_0xa153('0x1d')&&typeof _0x21ed69[_0xa153('0x1e')]==='undefined';var _0x41f389=_0x4353be[_0xa153('0x1f')];var _0x479bec=_0x317943?0x0:_0x21ed69[_0xa153('0x1c')];var _0xee6dab=_0x317943?_0x4353be[_0xa153('0x1f')]:_0x21ed69[_0xa153('0x1c')]+_0x21ed69['limit'];var _0x12a98e;if(_0xee6dab>=_0x41f389){_0xee6dab=_0x41f389;_0x12a98e=0xc8;}else{_0x12a98e=0xce;}_0x4cd52e['status'](_0x12a98e);return _0x4cd52e['set'](_0xa153('0x20'),_0x479bec+'-'+_0xee6dab+'/'+_0x41f389)[_0xa153('0x21')](_0x4353be);}return null;};}function patchUpdates(_0x3bd8f0){return function(_0x49fe91){try{jsonpatch[_0xa153('0x22')](_0x49fe91,_0x3bd8f0,!![]);}catch(_0x31c30d){return BPromise[_0xa153('0x23')](_0x31c30d);}return _0x49fe91[_0xa153('0x24')]();};}function saveUpdates(_0x35077d,_0x5b497c){return function(_0x3bc7ed){if(_0x3bc7ed){return _0x3bc7ed['update'](_0x35077d)[_0xa153('0x25')](function(_0x1b2e5f){return _0x1b2e5f;});}return null;};}function removeEntity(_0x214f79,_0x1fc3fb){return function(_0x2a61f4){if(_0x2a61f4){return _0x2a61f4['destroy']()[_0xa153('0x25')](function(){_0x214f79[_0xa153('0x1a')](0xcc)[_0xa153('0x1b')]();});}};}function handleEntityNotFound(_0x55d350,_0x45acf4){return function(_0x3abecd){if(!_0x3abecd){_0x55d350[_0xa153('0x26')](0x194);}return _0x3abecd;};}function handleError(_0x156f45,_0x442df1){_0x442df1=_0x442df1||0x1f4;return function(_0x734897){logger[_0xa153('0x27')](_0x734897[_0xa153('0x28')]);if(_0x734897[_0xa153('0x29')]){delete _0x734897[_0xa153('0x29')];}_0x156f45[_0xa153('0x1a')](_0x442df1)[_0xa153('0x2a')](_0x734897);};}exports[_0xa153('0x2b')]=function(_0x36f811,_0x4c20e0){var _0xbbc6ee={},_0x3ce108={},_0x3f2646={'count':0x0,'rows':[]};var _0x5d62f8=_[_0xa153('0x2c')](db['AnalyticTreeReport'][_0xa153('0x2d')],function(_0x3a2aa2){return{'name':_0x3a2aa2['fieldName'],'type':_0x3a2aa2[_0xa153('0x2e')][_0xa153('0x2f')]};});_0x3ce108[_0xa153('0x30')]=_[_0xa153('0x2c')](_0x5d62f8,_0xa153('0x29'));_0x3ce108['query']=_['keys'](_0x36f811[_0xa153('0x31')]);_0x3ce108['filters']=_[_0xa153('0x32')](_0x3ce108[_0xa153('0x30')],_0x3ce108[_0xa153('0x31')]);_0xbbc6ee['attributes']=_['intersection'](_0x3ce108[_0xa153('0x30')],qs[_0xa153('0x33')](_0x36f811[_0xa153('0x31')]['fields']));_0xbbc6ee['attributes']=_0xbbc6ee['attributes'][_0xa153('0x34')]?_0xbbc6ee[_0xa153('0x35')]:_0x3ce108['model'];if(!_0x36f811[_0xa153('0x31')][_0xa153('0x36')](_0xa153('0x37'))){_0xbbc6ee[_0xa153('0x1e')]=qs['limit'](_0x36f811[_0xa153('0x31')][_0xa153('0x1e')]);_0xbbc6ee[_0xa153('0x1c')]=qs[_0xa153('0x1c')](_0x36f811[_0xa153('0x31')][_0xa153('0x1c')]);}_0xbbc6ee['order']=qs[_0xa153('0x38')](_0x36f811[_0xa153('0x31')][_0xa153('0x38')]);_0xbbc6ee[_0xa153('0x39')]=qs[_0xa153('0x3a')](_[_0xa153('0x3b')](_0x36f811['query'],_0x3ce108[_0xa153('0x3a')]),_0x5d62f8);if(_0x36f811[_0xa153('0x31')][_0xa153('0x3c')]){_0xbbc6ee['where']=_[_0xa153('0x3d')](_0xbbc6ee['where'],{'$or':_[_0xa153('0x2c')](_0x5d62f8,function(_0x2cd152){if(_0x2cd152[_0xa153('0x2e')]!=='VIRTUAL'){var _0x478c7f={};_0x478c7f[_0x2cd152['name']]={'$like':'%'+_0x36f811[_0xa153('0x31')]['filter']+'%'};return _0x478c7f;}})});}_0xbbc6ee=_['merge']({},_0xbbc6ee,_0x36f811[_0xa153('0x3e')]);var _0x27a77c={'where':_0xbbc6ee[_0xa153('0x39')]};return db[_0xa153('0x3f')][_0xa153('0x1f')](_0x27a77c)['then'](function(_0xd3df11){_0x3f2646['count']=_0xd3df11;if(_0x36f811[_0xa153('0x31')][_0xa153('0x40')]){_0xbbc6ee[_0xa153('0x41')]=[{'all':!![]}];}return db[_0xa153('0x3f')][_0xa153('0x42')](_0xbbc6ee);})[_0xa153('0x25')](function(_0x3140a2){_0x3f2646[_0xa153('0x43')]=_0x3140a2;return _0x3f2646;})[_0xa153('0x25')](respondWithFilteredResult(_0x4c20e0,_0xbbc6ee))[_0xa153('0x44')](handleError(_0x4c20e0,null));};exports['show']=function(_0x5a70ed,_0x224afd){var _0xfa67db={'raw':!![],'where':{'id':_0x5a70ed['params']['id']}},_0x44e83d={};_0x44e83d[_0xa153('0x30')]=_[_0xa153('0x45')](db['AnalyticTreeReport'][_0xa153('0x2d')]);_0x44e83d[_0xa153('0x31')]=_[_0xa153('0x45')](_0x5a70ed[_0xa153('0x31')]);_0x44e83d[_0xa153('0x3a')]=_['intersection'](_0x44e83d[_0xa153('0x30')],_0x44e83d['query']);_0xfa67db[_0xa153('0x35')]=_['intersection'](_0x44e83d[_0xa153('0x30')],qs['fields'](_0x5a70ed[_0xa153('0x31')][_0xa153('0x33')]));_0xfa67db[_0xa153('0x35')]=_0xfa67db[_0xa153('0x35')][_0xa153('0x34')]?_0xfa67db['attributes']:_0x44e83d['model'];if(_0x5a70ed[_0xa153('0x31')][_0xa153('0x40')]){_0xfa67db[_0xa153('0x41')]=[{'all':!![]}];}_0xfa67db=_[_0xa153('0x3d')]({},_0xfa67db,_0x5a70ed[_0xa153('0x3e')]);return db['AnalyticTreeReport'][_0xa153('0x46')](_0xfa67db)['then'](handleEntityNotFound(_0x224afd,null))[_0xa153('0x25')](respondWithResult(_0x224afd,null))['catch'](handleError(_0x224afd,null));};exports[_0xa153('0x47')]=function(_0x40e46e,_0x4e7fc4){return db[_0xa153('0x3f')]['create'](_0x40e46e['body'],{})[_0xa153('0x25')](respondWithResult(_0x4e7fc4,0xc9))[_0xa153('0x44')](handleError(_0x4e7fc4,null));};exports[_0xa153('0x48')]=function(_0xd18485,_0x456fe3){if(_0xd18485[_0xa153('0x49')]['id']){delete _0xd18485['body']['id'];}return db[_0xa153('0x3f')]['find']({'where':{'id':_0xd18485[_0xa153('0x4a')]['id']}})[_0xa153('0x25')](handleEntityNotFound(_0x456fe3,null))['then'](saveUpdates(_0xd18485[_0xa153('0x49')],null))['then'](respondWithResult(_0x456fe3,null))['catch'](handleError(_0x456fe3,null));};exports[_0xa153('0x4b')]=function(_0x57e33f,_0x50f310){return db[_0xa153('0x3f')][_0xa153('0x46')]({'where':{'id':_0x57e33f['params']['id']}})[_0xa153('0x25')](handleEntityNotFound(_0x50f310,null))[_0xa153('0x25')](removeEntity(_0x50f310,null))[_0xa153('0x44')](handleError(_0x50f310,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 1b8f523..05be132 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 _0xaf96=['path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird'];(function(_0x5a5f0f,_0x197f35){var _0x5d2113=function(_0x4ea33c){while(--_0x4ea33c){_0x5a5f0f['push'](_0x5a5f0f['shift']());}};_0x5d2113(++_0x197f35);}(_0xaf96,0x8b));var _0x6af9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6af9('0x0'));var logger=require(_0x6af9('0x1'))(_0x6af9('0x2'));var moment=require(_0x6af9('0x3'));var BPromise=require(_0x6af9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6af9('0x5'));var rimraf=require('rimraf');var config=require(_0x6af9('0x6'));var attributes=require(_0x6af9('0x7'));module[_0x6af9('0x8')]=function(_0x3dd17a,_0x2939bc){return _0x3dd17a[_0x6af9('0x9')](_0x6af9('0xa'),attributes,{'tableName':_0x6af9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc6c=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','api','bluebird','request-promise','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdc6c,0x68));var _0xcdc6=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xdc6c[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0xcdc6('0x0'));var logger=require('../../config/logger')(_0xcdc6('0x1'));var moment=require('moment');var BPromise=require(_0xcdc6('0x2'));var rp=require(_0xcdc6('0x3'));var fs=require('fs');var path=require(_0xcdc6('0x4'));var rimraf=require(_0xcdc6('0x5'));var config=require(_0xcdc6('0x6'));var attributes=require(_0xcdc6('0x7'));module[_0xcdc6('0x8')]=function(_0x306308,_0x450fdf){return _0x306308[_0xcdc6('0x9')](_0xcdc6('0xa'),attributes,{'tableName':'analytics_report_trees','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 19083e7..be42a80 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5e62e9,_0x566fed){_0x5e62e9=_0x5e62e9-0x0;var _0x32271e=_0x7a54[_0x5e62e9];return _0x32271e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x97a80f,_0x3d70d7){var _0x534071=function(_0xd8966e){while(--_0xd8966e){_0x97a80f['push'](_0x97a80f['shift']());}};_0x534071(++_0x3d70d7);}(_0xadb5,0xad));var _0x5adb=function(_0x2622a3,_0x2a099e){_0x2622a3=_0x2622a3-0x0;var _0x1000e7=_0xadb5[_0x2622a3];return _0x1000e7;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 39f8526..57d26b4 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 _0xaeae=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3810f6,_0x41f38f){var _0x442125=function(_0x394205){while(--_0x394205){_0x3810f6['push'](_0x3810f6['shift']());}};_0x442125(++_0x41f38f);}(_0xaeae,0xa1));var _0xeaea=function(_0x14151d,_0x9bc455){_0x14151d=_0x14151d-0x0;var _0x371652=_0xaeae[_0x14151d];return _0x371652;};'use strict';var multer=require(_0xeaea('0x0'));var util=require(_0xeaea('0x1'));var path=require(_0xeaea('0x2'));var timeout=require(_0xeaea('0x3'));var express=require(_0xeaea('0x4'));var router=express[_0xeaea('0x5')]();var fs_extra=require(_0xeaea('0x6'));var auth=require(_0xeaea('0x7'));var interaction=require(_0xeaea('0x8'));var config=require(_0xeaea('0x9'));var controller=require(_0xeaea('0xa'));router[_0xeaea('0xb')]('/',auth[_0xeaea('0xc')](),controller[_0xeaea('0xd')]);router['get'](_0xeaea('0xe'),auth[_0xeaea('0xc')](),controller[_0xeaea('0xf')]);router[_0xeaea('0x10')]('/',auth[_0xeaea('0xc')](),controller['create']);router[_0xeaea('0x11')](_0xeaea('0xe'),auth[_0xeaea('0xc')](),controller[_0xeaea('0x12')]);router[_0xeaea('0x13')](_0xeaea('0xe'),auth['isAuthenticated'](),controller[_0xeaea('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa743=['isAuthenticated','get','/:id','show','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa743,0x86));var _0x3a74=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xa743[_0x39e283];return _0x7de89f;};'use strict';var multer=require(_0x3a74('0x0'));var util=require('util');var path=require(_0x3a74('0x1'));var timeout=require(_0x3a74('0x2'));var express=require(_0x3a74('0x3'));var router=express[_0x3a74('0x4')]();var fs_extra=require(_0x3a74('0x5'));var auth=require(_0x3a74('0x6'));var interaction=require(_0x3a74('0x7'));var config=require(_0x3a74('0x8'));var controller=require(_0x3a74('0x9'));router['get']('/',auth[_0x3a74('0xa')](),controller['index']);router[_0x3a74('0xb')](_0x3a74('0xc'),auth[_0x3a74('0xa')](),controller[_0x3a74('0xd')]);router['post']('/',auth[_0x3a74('0xa')](),controller[_0x3a74('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3a74('0xf')](_0x3a74('0xc'),auth[_0x3a74('0xa')](),controller[_0x3a74('0x10')]);module[_0x3a74('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 59bb1d7..a537755 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 _0xb6b1=['STRING','sequelize'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0xb6b1,0x17b));var _0x1b6b=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xb6b1[_0xa79977];return _0x109f10;};'use strict';var Sequelize=require(_0x1b6b('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b6b('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1b6b('0x1')]}};
\ No newline at end of file
+var _0x057a=['exports','STRING','sequelize'];(function(_0x1081f0,_0x1d5187){var _0x142afa=function(_0x5c9f4b){while(--_0x5c9f4b){_0x1081f0['push'](_0x1081f0['shift']());}};_0x142afa(++_0x1d5187);}(_0x057a,0x1a6));var _0xa057=function(_0x5d53c0,_0x2e113f){_0x5d53c0=_0x5d53c0-0x0;var _0xb29b20=_0x057a[_0x5d53c0];return _0xb29b20;};'use strict';var Sequelize=require(_0xa057('0x0'));module[_0xa057('0x1')]={'name':{'type':Sequelize[_0xa057('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa057('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index a189964..3564895 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 _0x95ae=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','Attachment','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','merge','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x95ae,0xb1));var _0xe95a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x95ae[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xe95a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe95a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe95a('0x2'));var moment=require(_0xe95a('0x3'));var BPromise=require(_0xe95a('0x4'));var Mustache=require(_0xe95a('0x5'));var util=require(_0xe95a('0x6'));var path=require(_0xe95a('0x7'));var sox=require(_0xe95a('0x8'));var csv=require('to-csv');var ejs=require(_0xe95a('0x9'));var fs=require('fs');var fs_extra=require(_0xe95a('0xa'));var _=require(_0xe95a('0xb'));var squel=require(_0xe95a('0xc'));var crypto=require(_0xe95a('0xd'));var jsforce=require(_0xe95a('0xe'));var deskjs=require(_0xe95a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe95a('0x10'));var Papa=require(_0xe95a('0x11'));var Redis=require(_0xe95a('0x12'));var authService=require(_0xe95a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe95a('0x14'));var hardwareService=require(_0xe95a('0x15'));var logger=require('../../config/logger')(_0xe95a('0x16'));var utils=require(_0xe95a('0x17'));var config=require(_0xe95a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe95a('0x19'))['db'];function respondWithStatusCode(_0x24b257,_0x564a3d){_0x564a3d=_0x564a3d||0xcc;return function(_0x15e61c){if(_0x15e61c){return _0x24b257['sendStatus'](_0x564a3d);}return _0x24b257[_0xe95a('0x1a')](_0x564a3d)[_0xe95a('0x1b')]();};}function respondWithResult(_0x1447af,_0x25ab84){_0x25ab84=_0x25ab84||0xc8;return function(_0x44c517){if(_0x44c517){return _0x1447af[_0xe95a('0x1a')](_0x25ab84)[_0xe95a('0x1c')](_0x44c517);}};}function respondWithFilteredResult(_0xe4787d,_0x482013){return function(_0x5ceb8f){if(_0x5ceb8f){var _0x45ea0c=typeof _0x482013[_0xe95a('0x1d')]===_0xe95a('0x1e')&&typeof _0x482013[_0xe95a('0x1f')]===_0xe95a('0x1e');var _0x350ce3=_0x5ceb8f[_0xe95a('0x20')];var _0x46ee37=_0x45ea0c?0x0:_0x482013[_0xe95a('0x1d')];var _0xb1e685=_0x45ea0c?_0x5ceb8f[_0xe95a('0x20')]:_0x482013[_0xe95a('0x1d')]+_0x482013['limit'];var _0x11dc7b;if(_0xb1e685>=_0x350ce3){_0xb1e685=_0x350ce3;_0x11dc7b=0xc8;}else{_0x11dc7b=0xce;}_0xe4787d[_0xe95a('0x1a')](_0x11dc7b);return _0xe4787d[_0xe95a('0x21')](_0xe95a('0x22'),_0x46ee37+'-'+_0xb1e685+'/'+_0x350ce3)[_0xe95a('0x1c')](_0x5ceb8f);}return null;};}function patchUpdates(_0x3d90ea){return function(_0x15b873){try{jsonpatch[_0xe95a('0x23')](_0x15b873,_0x3d90ea,!![]);}catch(_0x30dfe5){return BPromise[_0xe95a('0x24')](_0x30dfe5);}return _0x15b873[_0xe95a('0x25')]();};}function saveUpdates(_0x3b04f6,_0x398270){return function(_0x257b2a){if(_0x257b2a){return _0x257b2a[_0xe95a('0x26')](_0x3b04f6)[_0xe95a('0x27')](function(_0x486451){return _0x486451;});}return null;};}function removeEntity(_0x56b347,_0x157cc3){return function(_0x1668c4){if(_0x1668c4){return _0x1668c4[_0xe95a('0x28')]()[_0xe95a('0x27')](function(){_0x56b347['status'](0xcc)[_0xe95a('0x1b')]();});}};}function handleEntityNotFound(_0x4e2174,_0x61925e){return function(_0x109bad){if(!_0x109bad){_0x4e2174[_0xe95a('0x29')](0x194);}return _0x109bad;};}function handleError(_0x24377b,_0x38534d){_0x38534d=_0x38534d||0x1f4;return function(_0x2e2e5a){logger[_0xe95a('0x2a')](_0x2e2e5a[_0xe95a('0x2b')]);if(_0x2e2e5a[_0xe95a('0x2c')]){delete _0x2e2e5a[_0xe95a('0x2c')];}_0x24377b[_0xe95a('0x1a')](_0x38534d)[_0xe95a('0x2d')](_0x2e2e5a);};}exports[_0xe95a('0x2e')]=function(_0x7984ec,_0x3cb7ff){var _0x2efdee={},_0x2902d3={},_0x3dc720={'count':0x0,'rows':[]};var _0x252ab1=_['map'](db[_0xe95a('0x2f')][_0xe95a('0x30')],function(_0x2674de){return{'name':_0x2674de[_0xe95a('0x31')],'type':_0x2674de['type'][_0xe95a('0x32')]};});_0x2902d3[_0xe95a('0x33')]=_['map'](_0x252ab1,'name');_0x2902d3[_0xe95a('0x34')]=_['keys'](_0x7984ec[_0xe95a('0x34')]);_0x2902d3[_0xe95a('0x35')]=_[_0xe95a('0x36')](_0x2902d3['model'],_0x2902d3[_0xe95a('0x34')]);_0x2efdee[_0xe95a('0x37')]=_[_0xe95a('0x36')](_0x2902d3[_0xe95a('0x33')],qs['fields'](_0x7984ec['query']['fields']));_0x2efdee['attributes']=_0x2efdee['attributes'][_0xe95a('0x38')]?_0x2efdee[_0xe95a('0x37')]:_0x2902d3[_0xe95a('0x33')];if(!_0x7984ec[_0xe95a('0x34')][_0xe95a('0x39')](_0xe95a('0x3a'))){_0x2efdee['limit']=qs['limit'](_0x7984ec[_0xe95a('0x34')][_0xe95a('0x1f')]);_0x2efdee[_0xe95a('0x1d')]=qs[_0xe95a('0x1d')](_0x7984ec[_0xe95a('0x34')]['offset']);}_0x2efdee[_0xe95a('0x3b')]=qs[_0xe95a('0x3c')](_0x7984ec['query'][_0xe95a('0x3c')]);_0x2efdee['where']=qs[_0xe95a('0x35')](_[_0xe95a('0x3d')](_0x7984ec[_0xe95a('0x34')],_0x2902d3[_0xe95a('0x35')]),_0x252ab1);if(_0x7984ec['query'][_0xe95a('0x3e')]){_0x2efdee[_0xe95a('0x3f')]=_['merge'](_0x2efdee['where'],{'$or':_['map'](_0x252ab1,function(_0x5e28e8){if(_0x5e28e8[_0xe95a('0x40')]!==_0xe95a('0x41')){var _0x3a0109={};_0x3a0109[_0x5e28e8[_0xe95a('0x2c')]]={'$like':'%'+_0x7984ec[_0xe95a('0x34')][_0xe95a('0x3e')]+'%'};return _0x3a0109;}})});}_0x2efdee=_['merge']({},_0x2efdee,_0x7984ec[_0xe95a('0x42')]);var _0x19f2ec={'where':_0x2efdee[_0xe95a('0x3f')]};return db['Attachment'][_0xe95a('0x20')](_0x19f2ec)[_0xe95a('0x27')](function(_0x1cf34c){_0x3dc720[_0xe95a('0x20')]=_0x1cf34c;if(_0x7984ec[_0xe95a('0x34')]['includeAll']){_0x2efdee[_0xe95a('0x43')]=[{'all':!![]}];}return db['Attachment'][_0xe95a('0x44')](_0x2efdee);})[_0xe95a('0x27')](function(_0x5cd4ea){_0x3dc720[_0xe95a('0x45')]=_0x5cd4ea;return _0x3dc720;})['then'](respondWithFilteredResult(_0x3cb7ff,_0x2efdee))[_0xe95a('0x46')](handleError(_0x3cb7ff,null));};exports[_0xe95a('0x47')]=function(_0x2e6dea,_0x561775){var _0x7cadbc={'raw':!![],'where':{'id':_0x2e6dea[_0xe95a('0x48')]['id']}},_0x8ed769={};_0x8ed769[_0xe95a('0x33')]=_[_0xe95a('0x49')](db[_0xe95a('0x2f')]['rawAttributes']);_0x8ed769['query']=_[_0xe95a('0x49')](_0x2e6dea[_0xe95a('0x34')]);_0x8ed769[_0xe95a('0x35')]=_[_0xe95a('0x36')](_0x8ed769[_0xe95a('0x33')],_0x8ed769[_0xe95a('0x34')]);_0x7cadbc[_0xe95a('0x37')]=_[_0xe95a('0x36')](_0x8ed769[_0xe95a('0x33')],qs['fields'](_0x2e6dea['query'][_0xe95a('0x4a')]));_0x7cadbc[_0xe95a('0x37')]=_0x7cadbc[_0xe95a('0x37')]['length']?_0x7cadbc[_0xe95a('0x37')]:_0x8ed769[_0xe95a('0x33')];if(_0x2e6dea[_0xe95a('0x34')][_0xe95a('0x4b')]){_0x7cadbc['include']=[{'all':!![]}];}_0x7cadbc=_[_0xe95a('0x4c')]({},_0x7cadbc,_0x2e6dea[_0xe95a('0x42')]);return db[_0xe95a('0x2f')]['find'](_0x7cadbc)['then'](handleEntityNotFound(_0x561775,null))[_0xe95a('0x27')](respondWithResult(_0x561775,null))[_0xe95a('0x46')](handleError(_0x561775,null));};exports['clone']=function(_0x53ae61,_0x40c020){var _0x2b2689={'where':{'id':_0x53ae61[_0xe95a('0x48')]['id']}},_0x15b1be={};_0x15b1be[_0xe95a('0x33')]=_[_0xe95a('0x49')](db[_0xe95a('0x2f')][_0xe95a('0x30')]);_0x2b2689[_0xe95a('0x37')]=_[_0xe95a('0x36')](_0x15b1be[_0xe95a('0x33')],qs['fields'](_0x53ae61[_0xe95a('0x34')][_0xe95a('0x4a')]));_0x2b2689[_0xe95a('0x37')]=_0x2b2689['attributes'][_0xe95a('0x38')]?_0x2b2689[_0xe95a('0x37')]:_0x15b1be['model'];if(_0x53ae61[_0xe95a('0x34')][_0xe95a('0x4b')]){_0x2b2689[_0xe95a('0x43')]=[{'all':!![]}];}_0x2b2689=_[_0xe95a('0x4c')]({},_0x2b2689,_0x53ae61[_0xe95a('0x42')]);return db['Attachment'][_0xe95a('0x4d')](_0x2b2689)[_0xe95a('0x27')](handleEntityNotFound(_0x40c020,null))[_0xe95a('0x27')](function(_0x2d02ab){if(_0x2d02ab){var _0x5af28d=_0x2d02ab[_0xe95a('0x4e')]({'plain':!![]});_0x5af28d=qs[_0xe95a('0x4f')](_0x5af28d,['id',_0xe95a('0x50'),_0xe95a('0x51')]);_0x53ae61[_0xe95a('0x52')]=_['omit'](_0x53ae61[_0xe95a('0x52')],['id',_0xe95a('0x50'),_0xe95a('0x51')]);return db[_0xe95a('0x2f')][_0xe95a('0x53')](_[_0xe95a('0x4c')](_0x5af28d,_0x53ae61[_0xe95a('0x52')]),{'include':_0x53ae61[_0xe95a('0x34')][_0xe95a('0x4b')]?[{'all':!![]}]:undefined});}})[_0xe95a('0x27')](respondWithResult(_0x40c020,0xc9))['catch'](handleError(_0x40c020,null));};exports[_0xe95a('0x26')]=function(_0x6146a5,_0x24d347){if(_0x6146a5['body']['id']){delete _0x6146a5[_0xe95a('0x52')]['id'];}return db[_0xe95a('0x2f')][_0xe95a('0x4d')]({'where':{'id':_0x6146a5['params']['id']}})[_0xe95a('0x27')](handleEntityNotFound(_0x24d347,null))[_0xe95a('0x27')](saveUpdates(_0x6146a5[_0xe95a('0x52')],null))['then'](respondWithResult(_0x24d347,null))[_0xe95a('0x46')](handleError(_0x24d347,null));};exports['destroy']=function(_0x3aa9b2,_0x1c6f94){return db[_0xe95a('0x2f')][_0xe95a('0x4d')]({'where':{'id':_0x3aa9b2[_0xe95a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c6f94,null))['then'](removeEntity(_0x1c6f94,null))[_0xe95a('0x46')](handleError(_0x1c6f94,null));};exports[_0xe95a('0x53')]=function(_0xeaf732,_0x23114f,_0x215eec){_0xeaf732[_0xe95a('0x52')]['name']=_0xeaf732[_0xe95a('0x54')][_0xe95a('0x55')];_0xeaf732[_0xe95a('0x52')][_0xe95a('0x56')]=_0xeaf732[_0xe95a('0x54')][_0xe95a('0x57')];_0xeaf732[_0xe95a('0x52')][_0xe95a('0x40')]=_0xeaf732['file'][_0xe95a('0x58')];return db[_0xe95a('0x2f')][_0xe95a('0x53')](_0xeaf732[_0xe95a('0x52')])['then'](respondWithResult(_0x23114f,0xc9))[_0xe95a('0x46')](handleError(_0x23114f,null));};exports['download']=function(_0x44fc11,_0x373039,_0x3c7e62){return db[_0xe95a('0x2f')]['findOne']({'where':{'id':_0x44fc11[_0xe95a('0x48')]['id']},'raw':!![]})[_0xe95a('0x27')](handleEntityNotFound(_0x373039,null))['then'](function(_0x1db057){if(_0x1db057){var _0x3851b4=_0x1db057[_0xe95a('0x59')]!==null;var _0x5cab7b=path[_0xe95a('0x5a')](config[_0xe95a('0x5b')],_0xe95a('0x5c'));if(_0x3851b4){_0x5cab7b=path[_0xe95a('0x5a')](_0x5cab7b,_0xe95a('0x5d'));}var _0x4d060c=path[_0xe95a('0x5a')](_0x5cab7b,_0x1db057[_0xe95a('0x56')]);return _0x373039[_0xe95a('0x5e')](_0x4d060c);}})['catch'](handleError(_0x373039,null));};
\ No newline at end of file
+var _0x3174=['sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','clone','length','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x2ee20d,_0x354e70){var _0xade530=function(_0x1db7cc){while(--_0x1db7cc){_0x2ee20d['push'](_0x2ee20d['shift']());}};_0xade530(++_0x354e70);}(_0x3174,0x18c));var _0x4317=function(_0x50df1f,_0x45b8b1){_0x50df1f=_0x50df1f-0x0;var _0x5180e3=_0x3174[_0x50df1f];return _0x5180e3;};'use strict';var emlformat=require(_0x4317('0x0'));var rimraf=require(_0x4317('0x1'));var zipdir=require(_0x4317('0x2'));var jsonpatch=require(_0x4317('0x3'));var rp=require(_0x4317('0x4'));var moment=require('moment');var BPromise=require(_0x4317('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4317('0x6'));var sox=require(_0x4317('0x7'));var csv=require(_0x4317('0x8'));var ejs=require(_0x4317('0x9'));var fs=require('fs');var fs_extra=require(_0x4317('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4317('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4317('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4317('0xd'));var Redis=require(_0x4317('0xe'));var authService=require(_0x4317('0xf'));var qs=require(_0x4317('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4317('0x11'));var logger=require(_0x4317('0x12'))(_0x4317('0x13'));var utils=require(_0x4317('0x14'));var config=require(_0x4317('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4317('0x16'))['db'];function respondWithStatusCode(_0x18a625,_0x33fd1c){_0x33fd1c=_0x33fd1c||0xcc;return function(_0x298aed){if(_0x298aed){return _0x18a625[_0x4317('0x17')](_0x33fd1c);}return _0x18a625[_0x4317('0x18')](_0x33fd1c)[_0x4317('0x19')]();};}function respondWithResult(_0x49920a,_0x26ef32){_0x26ef32=_0x26ef32||0xc8;return function(_0x10024e){if(_0x10024e){return _0x49920a[_0x4317('0x18')](_0x26ef32)[_0x4317('0x1a')](_0x10024e);}};}function respondWithFilteredResult(_0x57901b,_0x250fc3){return function(_0x219adf){if(_0x219adf){var _0x150d36=typeof _0x250fc3[_0x4317('0x1b')]===_0x4317('0x1c')&&typeof _0x250fc3[_0x4317('0x1d')]===_0x4317('0x1c');var _0x17bcf8=_0x219adf['count'];var _0x37aa88=_0x150d36?0x0:_0x250fc3['offset'];var _0x5a4177=_0x150d36?_0x219adf[_0x4317('0x1e')]:_0x250fc3[_0x4317('0x1b')]+_0x250fc3['limit'];var _0x3a9466;if(_0x5a4177>=_0x17bcf8){_0x5a4177=_0x17bcf8;_0x3a9466=0xc8;}else{_0x3a9466=0xce;}_0x57901b[_0x4317('0x18')](_0x3a9466);return _0x57901b[_0x4317('0x1f')](_0x4317('0x20'),_0x37aa88+'-'+_0x5a4177+'/'+_0x17bcf8)[_0x4317('0x1a')](_0x219adf);}return null;};}function patchUpdates(_0x2ea18a){return function(_0xd4cb2c){try{jsonpatch[_0x4317('0x21')](_0xd4cb2c,_0x2ea18a,!![]);}catch(_0x554294){return BPromise['reject'](_0x554294);}return _0xd4cb2c['save']();};}function saveUpdates(_0x2b88cc,_0x5c495a){return function(_0x22d28){if(_0x22d28){return _0x22d28[_0x4317('0x22')](_0x2b88cc)[_0x4317('0x23')](function(_0x35855e){return _0x35855e;});}return null;};}function removeEntity(_0x30360e,_0x2a3eb0){return function(_0x407b6c){if(_0x407b6c){return _0x407b6c[_0x4317('0x24')]()[_0x4317('0x23')](function(){_0x30360e[_0x4317('0x18')](0xcc)[_0x4317('0x19')]();});}};}function handleEntityNotFound(_0x4b179e,_0x3ea927){return function(_0x15c091){if(!_0x15c091){_0x4b179e[_0x4317('0x17')](0x194);}return _0x15c091;};}function handleError(_0x97e718,_0x42c0a6){_0x42c0a6=_0x42c0a6||0x1f4;return function(_0x4c50e7){logger['error'](_0x4c50e7[_0x4317('0x25')]);if(_0x4c50e7[_0x4317('0x26')]){delete _0x4c50e7[_0x4317('0x26')];}_0x97e718[_0x4317('0x18')](_0x42c0a6)['send'](_0x4c50e7);};}exports[_0x4317('0x27')]=function(_0x14ec45,_0x18409e){var _0x36b6d1={},_0x2b21c4={},_0x5702ce={'count':0x0,'rows':[]};var _0xa5b3d3=_[_0x4317('0x28')](db[_0x4317('0x29')][_0x4317('0x2a')],function(_0x260e5f){return{'name':_0x260e5f[_0x4317('0x2b')],'type':_0x260e5f[_0x4317('0x2c')][_0x4317('0x2d')]};});_0x2b21c4['model']=_['map'](_0xa5b3d3,_0x4317('0x26'));_0x2b21c4['query']=_[_0x4317('0x2e')](_0x14ec45[_0x4317('0x2f')]);_0x2b21c4['filters']=_[_0x4317('0x30')](_0x2b21c4[_0x4317('0x31')],_0x2b21c4[_0x4317('0x2f')]);_0x36b6d1[_0x4317('0x32')]=_['intersection'](_0x2b21c4['model'],qs[_0x4317('0x33')](_0x14ec45[_0x4317('0x2f')][_0x4317('0x33')]));_0x36b6d1[_0x4317('0x32')]=_0x36b6d1[_0x4317('0x32')]['length']?_0x36b6d1['attributes']:_0x2b21c4[_0x4317('0x31')];if(!_0x14ec45['query'][_0x4317('0x34')](_0x4317('0x35'))){_0x36b6d1[_0x4317('0x1d')]=qs[_0x4317('0x1d')](_0x14ec45['query'][_0x4317('0x1d')]);_0x36b6d1[_0x4317('0x1b')]=qs[_0x4317('0x1b')](_0x14ec45[_0x4317('0x2f')][_0x4317('0x1b')]);}_0x36b6d1['order']=qs[_0x4317('0x36')](_0x14ec45[_0x4317('0x2f')]['sort']);_0x36b6d1['where']=qs[_0x4317('0x37')](_[_0x4317('0x38')](_0x14ec45[_0x4317('0x2f')],_0x2b21c4[_0x4317('0x37')]),_0xa5b3d3);if(_0x14ec45[_0x4317('0x2f')][_0x4317('0x39')]){_0x36b6d1[_0x4317('0x3a')]=_[_0x4317('0x3b')](_0x36b6d1[_0x4317('0x3a')],{'$or':_['map'](_0xa5b3d3,function(_0x3328d8){if(_0x3328d8[_0x4317('0x2c')]!==_0x4317('0x3c')){var _0xe3e1e7={};_0xe3e1e7[_0x3328d8[_0x4317('0x26')]]={'$like':'%'+_0x14ec45['query']['filter']+'%'};return _0xe3e1e7;}})});}_0x36b6d1=_['merge']({},_0x36b6d1,_0x14ec45[_0x4317('0x3d')]);var _0x344eee={'where':_0x36b6d1[_0x4317('0x3a')]};return db[_0x4317('0x29')]['count'](_0x344eee)[_0x4317('0x23')](function(_0x17a217){_0x5702ce[_0x4317('0x1e')]=_0x17a217;if(_0x14ec45[_0x4317('0x2f')][_0x4317('0x3e')]){_0x36b6d1[_0x4317('0x3f')]=[{'all':!![]}];}return db[_0x4317('0x29')][_0x4317('0x40')](_0x36b6d1);})[_0x4317('0x23')](function(_0x1732d8){_0x5702ce[_0x4317('0x41')]=_0x1732d8;return _0x5702ce;})[_0x4317('0x23')](respondWithFilteredResult(_0x18409e,_0x36b6d1))[_0x4317('0x42')](handleError(_0x18409e,null));};exports[_0x4317('0x43')]=function(_0xe3cf85,_0x5b510b){var _0xc37a78={'raw':!![],'where':{'id':_0xe3cf85[_0x4317('0x44')]['id']}},_0x52f7e0={};_0x52f7e0[_0x4317('0x31')]=_['keys'](db[_0x4317('0x29')][_0x4317('0x2a')]);_0x52f7e0[_0x4317('0x2f')]=_['keys'](_0xe3cf85['query']);_0x52f7e0[_0x4317('0x37')]=_[_0x4317('0x30')](_0x52f7e0[_0x4317('0x31')],_0x52f7e0[_0x4317('0x2f')]);_0xc37a78[_0x4317('0x32')]=_[_0x4317('0x30')](_0x52f7e0[_0x4317('0x31')],qs[_0x4317('0x33')](_0xe3cf85[_0x4317('0x2f')]['fields']));_0xc37a78[_0x4317('0x32')]=_0xc37a78[_0x4317('0x32')]['length']?_0xc37a78[_0x4317('0x32')]:_0x52f7e0[_0x4317('0x31')];if(_0xe3cf85[_0x4317('0x2f')][_0x4317('0x3e')]){_0xc37a78[_0x4317('0x3f')]=[{'all':!![]}];}_0xc37a78=_[_0x4317('0x3b')]({},_0xc37a78,_0xe3cf85[_0x4317('0x3d')]);return db['Attachment'][_0x4317('0x45')](_0xc37a78)[_0x4317('0x23')](handleEntityNotFound(_0x5b510b,null))['then'](respondWithResult(_0x5b510b,null))['catch'](handleError(_0x5b510b,null));};exports[_0x4317('0x46')]=function(_0x501991,_0x5a52a9){var _0x568750={'where':{'id':_0x501991['params']['id']}},_0xfa9647={};_0xfa9647[_0x4317('0x31')]=_[_0x4317('0x2e')](db['Attachment'][_0x4317('0x2a')]);_0x568750['attributes']=_[_0x4317('0x30')](_0xfa9647['model'],qs[_0x4317('0x33')](_0x501991[_0x4317('0x2f')]['fields']));_0x568750[_0x4317('0x32')]=_0x568750[_0x4317('0x32')][_0x4317('0x47')]?_0x568750[_0x4317('0x32')]:_0xfa9647[_0x4317('0x31')];if(_0x501991[_0x4317('0x2f')][_0x4317('0x3e')]){_0x568750[_0x4317('0x3f')]=[{'all':!![]}];}_0x568750=_['merge']({},_0x568750,_0x501991[_0x4317('0x3d')]);return db[_0x4317('0x29')][_0x4317('0x45')](_0x568750)[_0x4317('0x23')](handleEntityNotFound(_0x5a52a9,null))[_0x4317('0x23')](function(_0x41645e){if(_0x41645e){var _0x1fd5d2=_0x41645e[_0x4317('0x48')]({'plain':!![]});_0x1fd5d2=qs[_0x4317('0x49')](_0x1fd5d2,['id',_0x4317('0x4a'),_0x4317('0x4b')]);_0x501991[_0x4317('0x4c')]=_[_0x4317('0x49')](_0x501991[_0x4317('0x4c')],['id',_0x4317('0x4a'),_0x4317('0x4b')]);return db[_0x4317('0x29')][_0x4317('0x4d')](_[_0x4317('0x3b')](_0x1fd5d2,_0x501991[_0x4317('0x4c')]),{'include':_0x501991[_0x4317('0x2f')][_0x4317('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x5a52a9,0xc9))[_0x4317('0x42')](handleError(_0x5a52a9,null));};exports[_0x4317('0x22')]=function(_0x4b6176,_0x2f1b2b){if(_0x4b6176[_0x4317('0x4c')]['id']){delete _0x4b6176[_0x4317('0x4c')]['id'];}return db[_0x4317('0x29')][_0x4317('0x45')]({'where':{'id':_0x4b6176['params']['id']}})[_0x4317('0x23')](handleEntityNotFound(_0x2f1b2b,null))['then'](saveUpdates(_0x4b6176[_0x4317('0x4c')],null))[_0x4317('0x23')](respondWithResult(_0x2f1b2b,null))[_0x4317('0x42')](handleError(_0x2f1b2b,null));};exports['destroy']=function(_0x37d421,_0x80cf75){return db[_0x4317('0x29')][_0x4317('0x45')]({'where':{'id':_0x37d421[_0x4317('0x44')]['id']}})['then'](handleEntityNotFound(_0x80cf75,null))[_0x4317('0x23')](removeEntity(_0x80cf75,null))[_0x4317('0x42')](handleError(_0x80cf75,null));};exports['create']=function(_0x4cabe5,_0x345b02,_0x7183ae){_0x4cabe5['body'][_0x4317('0x26')]=_0x4cabe5[_0x4317('0x4e')][_0x4317('0x4f')];_0x4cabe5[_0x4317('0x4c')][_0x4317('0x50')]=_0x4cabe5[_0x4317('0x4e')][_0x4317('0x51')];_0x4cabe5[_0x4317('0x4c')][_0x4317('0x2c')]=_0x4cabe5['file'][_0x4317('0x52')];return db[_0x4317('0x29')][_0x4317('0x4d')](_0x4cabe5[_0x4317('0x4c')])[_0x4317('0x23')](respondWithResult(_0x345b02,0xc9))[_0x4317('0x42')](handleError(_0x345b02,null));};exports['download']=function(_0x46113e,_0x22b46e,_0x5bed47){return db[_0x4317('0x29')][_0x4317('0x53')]({'where':{'id':_0x46113e['params']['id']},'raw':!![]})[_0x4317('0x23')](handleEntityNotFound(_0x22b46e,null))[_0x4317('0x23')](function(_0x52a3f0){if(_0x52a3f0){var _0x45f418=_0x52a3f0[_0x4317('0x54')]!==null;var _0x469ea0=path[_0x4317('0x55')](config[_0x4317('0x56')],_0x4317('0x57'));if(_0x45f418){_0x469ea0=path[_0x4317('0x55')](_0x469ea0,_0x4317('0x58'));}var _0x555a16=path[_0x4317('0x55')](_0x469ea0,_0x52a3f0[_0x4317('0x50')]);return _0x22b46e[_0x4317('0x59')](_0x555a16);}})[_0x4317('0x42')](handleError(_0x22b46e,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index d1aba7c..a29b5b7 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 _0x9d83=['attachments','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x321b2f,_0x2a1ee1){var _0x18e486=function(_0x578758){while(--_0x578758){_0x321b2f['push'](_0x321b2f['shift']());}};_0x18e486(++_0x2a1ee1);}(_0x9d83,0x1d5));var _0x39d8=function(_0xd467d7,_0x2f13cd){_0xd467d7=_0xd467d7-0x0;var _0x23b23d=_0x9d83[_0xd467d7];return _0x23b23d;};'use strict';var _=require(_0x39d8('0x0'));var util=require(_0x39d8('0x1'));var logger=require('../../config/logger')(_0x39d8('0x2'));var moment=require(_0x39d8('0x3'));var BPromise=require(_0x39d8('0x4'));var rp=require(_0x39d8('0x5'));var fs=require('fs');var path=require(_0x39d8('0x6'));var rimraf=require(_0x39d8('0x7'));var config=require(_0x39d8('0x8'));var attributes=require(_0x39d8('0x9'));module[_0x39d8('0xa')]=function(_0x4e8750,_0x645c29){return _0x4e8750[_0x39d8('0xb')]('Attachment',attributes,{'tableName':_0x39d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd390=['moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util'];(function(_0x6ea56b,_0x4b98e4){var _0x2ef411=function(_0x4271dd){while(--_0x4271dd){_0x6ea56b['push'](_0x6ea56b['shift']());}};_0x2ef411(++_0x4b98e4);}(_0xd390,0x76));var _0x0d39=function(_0x54f298,_0x5681d4){_0x54f298=_0x54f298-0x0;var _0x489e44=_0xd390[_0x54f298];return _0x489e44;};'use strict';var _=require(_0x0d39('0x0'));var util=require(_0x0d39('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0d39('0x2'));var BPromise=require(_0x0d39('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d39('0x4'));var rimraf=require(_0x0d39('0x5'));var config=require(_0x0d39('0x6'));var attributes=require(_0x0d39('0x7'));module[_0x0d39('0x8')]=function(_0x4cc6e2,_0x176183){return _0x4cc6e2[_0x0d39('0x9')](_0x0d39('0xa'),attributes,{'tableName':_0x0d39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 5a22369..50a296e 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 _0x9de3=['jayson/promise','http','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','create','options','CreateAttachment','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4a1380,_0x3362cd){var _0x217ff1=function(_0x5e5abe){while(--_0x5e5abe){_0x4a1380['push'](_0x4a1380['shift']());}};_0x217ff1(++_0x3362cd);}(_0x9de3,0xea));var _0x39de=function(_0x496511,_0x449bc7){_0x496511=_0x496511-0x0;var _0x5c3fe8=_0x9de3[_0x496511];return _0x5c3fe8;};'use strict';var _=require(_0x39de('0x0'));var util=require('util');var moment=require(_0x39de('0x1'));var BPromise=require(_0x39de('0x2'));var rs=require(_0x39de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39de('0x5'))(_0x39de('0x6'));var config=require(_0x39de('0x7'));var jayson=require(_0x39de('0x8'));var client=jayson['client'][_0x39de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x185872,_0x3ed6a1,_0x87049c){return new BPromise(function(_0x2604fa,_0x59ce28){return client['request'](_0x185872,_0x87049c)['then'](function(_0x27e596){logger[_0x39de('0xa')](_0x39de('0xb'),_0x3ed6a1,_0x39de('0xc'));logger[_0x39de('0xd')](_0x39de('0xe'),_0x3ed6a1,_0x39de('0xc'),JSON[_0x39de('0xf')](_0x27e596));if(_0x27e596['error']){if(_0x27e596[_0x39de('0x10')]['code']===0x1f4){logger['error'](_0x39de('0xb'),_0x3ed6a1,_0x27e596[_0x39de('0x10')][_0x39de('0x11')]);return _0x59ce28(_0x27e596['error'][_0x39de('0x11')]);}logger[_0x39de('0x10')](_0x39de('0xb'),_0x3ed6a1,_0x27e596[_0x39de('0x10')][_0x39de('0x11')]);return _0x2604fa(_0x27e596[_0x39de('0x10')][_0x39de('0x11')]);}else{logger[_0x39de('0xa')](_0x39de('0xb'),_0x3ed6a1,_0x39de('0xc'));_0x2604fa(_0x27e596['result'][_0x39de('0x11')]);}})[_0x39de('0x12')](function(_0x20bd18){logger[_0x39de('0x10')]('Attachment,\x20%s,\x20%s',_0x3ed6a1,_0x20bd18);_0x59ce28(_0x20bd18);});});}exports['CreateAttachment']=function(_0x2d355b){var _0x5e9e37=this;return new Promise(function(_0x1fb6fa,_0x1d08a2){return db['Attachment'][_0x39de('0x13')](_0x2d355b['body'],{'raw':_0x2d355b[_0x39de('0x14')]?_0x2d355b[_0x39de('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xab6f89){logger['info']('CreateAttachment',_0x2d355b);logger[_0x39de('0xd')](_0x39de('0x15'),_0x2d355b,JSON[_0x39de('0xf')](_0xab6f89));_0x1fb6fa(_0xab6f89);})[_0x39de('0x12')](function(_0x400d62){logger[_0x39de('0x10')]('CreateAttachment',_0x400d62[_0x39de('0x11')],_0x2d355b);_0x1d08a2(_0x5e9e37[_0x39de('0x10')](0x1f4,_0x400d62[_0x39de('0x11')]));});});};
\ No newline at end of file
+var _0x7794=['http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0xa61fd1,_0x934c7b){var _0x82399b=function(_0x4c3878){while(--_0x4c3878){_0xa61fd1['push'](_0xa61fd1['shift']());}};_0x82399b(++_0x934c7b);}(_0x7794,0x7b));var _0x4779=function(_0x305093,_0x1826d0){_0x305093=_0x305093-0x0;var _0x8bc9cd=_0x7794[_0x305093];return _0x8bc9cd;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require(_0x4779('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4779('0x4'))['db'];var utils=require(_0x4779('0x5'));var logger=require('../../config/logger')(_0x4779('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4779('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x339512,_0x523c93,_0xb3fe18){return new BPromise(function(_0x13bb66,_0x270a5f){return client[_0x4779('0x8')](_0x339512,_0xb3fe18)[_0x4779('0x9')](function(_0x7179e1){logger[_0x4779('0xa')]('Attachment,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));logger[_0x4779('0xc')](_0x4779('0xd'),_0x523c93,_0x4779('0xb'),JSON[_0x4779('0xe')](_0x7179e1));if(_0x7179e1[_0x4779('0xf')]){if(_0x7179e1[_0x4779('0xf')][_0x4779('0x10')]===0x1f4){logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1['error']['message']);return _0x270a5f(_0x7179e1['error'][_0x4779('0x12')]);}logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1[_0x4779('0xf')]['message']);return _0x13bb66(_0x7179e1[_0x4779('0xf')][_0x4779('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));_0x13bb66(_0x7179e1[_0x4779('0x13')][_0x4779('0x12')]);}})[_0x4779('0x14')](function(_0x56ec51){logger['error'](_0x4779('0x11'),_0x523c93,_0x56ec51);_0x270a5f(_0x56ec51);});});}exports[_0x4779('0x15')]=function(_0x19fbb6){var _0x582e89=this;return new Promise(function(_0x3dbe70,_0x5d9a58){return db[_0x4779('0x16')][_0x4779('0x17')](_0x19fbb6['body'],{'raw':_0x19fbb6[_0x4779('0x18')]?_0x19fbb6['options'][_0x4779('0x19')]===undefined?!![]:![]:!![]})[_0x4779('0x9')](function(_0x143ef6){logger[_0x4779('0xa')](_0x4779('0x15'),_0x19fbb6);logger[_0x4779('0xc')]('CreateAttachment',_0x19fbb6,JSON[_0x4779('0xe')](_0x143ef6));_0x3dbe70(_0x143ef6);})['catch'](function(_0x4ad246){logger[_0x4779('0xf')](_0x4779('0x15'),_0x4ad246[_0x4779('0x12')],_0x19fbb6);_0x5d9a58(_0x582e89[_0x4779('0xf')](0x1f4,_0x4ad246['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 3c83bee..efd6272 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x0b0e[_0x1c1fba];return _0x37e346;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 3b87422..0539f41 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 _0xe1e7=['adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','role','disabled','blocked','user','name','then','blockedAt','add','getLicense','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','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','blockDuration'];(function(_0xf08c83,_0x4fd61d){var _0x139e49=function(_0xa03366){while(--_0xa03366){_0xf08c83['push'](_0xf08c83['shift']());}};_0x139e49(++_0x4fd61d);}(_0xe1e7,0xe5));var _0x7e1e=function(_0x5c2888,_0x435a80){_0x5c2888=_0x5c2888-0x0;var _0xfbdf00=_0xe1e7[_0x5c2888];return _0xfbdf00;};'use strict';var passport=require(_0x7e1e('0x0'));var LocalStrategy=require('passport-local')[_0x7e1e('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x7e1e('0x2'));var BPromise=require(_0x7e1e('0x3'));var util=require(_0x7e1e('0x4'));var db=require(_0x7e1e('0x5'))['db'];var authService=require(_0x7e1e('0x6'));var utils=require(_0x7e1e('0x7'));var config=require(_0x7e1e('0x8'));var logger=require(_0x7e1e('0x9'))(_0x7e1e('0xa'));function isActiveDirectoryConfigured(_0x1140fa){var _0xb94dc=![];if(typeof _0x1140fa[_0x7e1e('0xb')]!==_0x7e1e('0xc')){_0xb94dc=_0x1140fa[_0x7e1e('0xb')]['baseDN']&&_0x1140fa[_0x7e1e('0xb')][_0x7e1e('0xd')]&&_0x1140fa[_0x7e1e('0xb')][_0x7e1e('0xe')];}return _0xb94dc;}function adAuthenticate(_0x21b72e,_0x9b2260,_0x23f7e9){return new BPromise(function(_0x562cdb,_0x1dee70){try{var _0x20526a=new ActiveDirectory(_0x21b72e);_0x20526a[_0x7e1e('0xf')](_0x9b2260,_0x23f7e9,function(_0xb472cb,_0x5467f4){if(_0xb472cb){logger[_0x7e1e('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x9b2260,util[_0x7e1e('0x11')](_0xb472cb,{'showHidden':![],'depth':null}));_0x1dee70('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x5467f4){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x9b2260);_0x1dee70(_0x7e1e('0x12'));}else{_0x562cdb(_0x5467f4);}});}catch(_0xed2d76){_0x1dee70(_0xed2d76);}});}function ActiveDirectoryAuthenticate(_0x1b9e5f,_0x54a5a1,_0x584059,_0x50ffb7){var _0x4a92db,_0x5b07a0;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x7e1e('0x13'),_0x54a5a1);return _0x50ffb7(null,![],{'message':_0x7e1e('0x12')});}return db[_0x7e1e('0x14')][_0x7e1e('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x7e1e('0x16')],'raw':!![]})['then'](function(_0x5eee11){_0x4a92db=_0x5eee11;if(!_0x4a92db[_0x7e1e('0x17')]){logger['error'](_0x7e1e('0x18'),_0x54a5a1);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x1b9e5f[_0x7e1e('0x15')]({'attributes':['id','name','password','salt',_0x7e1e('0x19'),_0x7e1e('0x1a'),_0x7e1e('0x1b'),'blockedAt','online'],'where':{'name':_0x54a5a1,'role':{'$or':['admin',_0x7e1e('0x1c'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x4ebc10){if(!_0x4ebc10||_0x4ebc10&&_0x4ebc10[_0x7e1e('0x1d')]!==_0x54a5a1){throw new Error(_0x7e1e('0x12'));}_0x5b07a0=_0x4ebc10;var _0x5a684e=_0x5b07a0[_0x7e1e('0x1d')]+'@'+config[_0x7e1e('0xb')]['domain'];return adAuthenticate(config['activedirectory'],_0x5a684e,_0x584059);})[_0x7e1e('0x1e')](function(_0xb0574e){if(_0x5b07a0[_0x7e1e('0x1a')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4a92db[_0x7e1e('0x16')]>0x0){if(_0x5b07a0[_0x7e1e('0x1b')]){if(moment(_0x5b07a0[_0x7e1e('0x1f')])[_0x7e1e('0x20')](_0x4a92db[_0x7e1e('0x16')],'minutes')>moment()){throw new Error(_0x7e1e('0x12'));}return utils['clearBlockUser'](_0x5b07a0,0x0,![],null)['then'](function(){return utils[_0x7e1e('0x21')](_0x5b07a0);})[_0x7e1e('0x1e')](function(){return _0x50ffb7(null,_0x5b07a0);});}else{return utils[_0x7e1e('0x21')](_0x5b07a0)['then'](function(){return _0x50ffb7(null,_0x5b07a0);});}}else{return utils[_0x7e1e('0x21')](_0x5b07a0)[_0x7e1e('0x1e')](function(){return _0x50ffb7(null,_0x5b07a0);});}})['catch'](function(_0x184160){return _0x50ffb7(null,![],_0x184160);});}function handleError(_0x4ba40d,_0x5a5e07,_0x39c147){return _0x4ba40d[_0x7e1e('0x22')](_0x5a5e07||0x1f4)[_0x7e1e('0x23')]({'message':_0x39c147?_0x39c147['message']||_0x39c147:''});}exports[_0x7e1e('0x24')]=function(_0x168d63,_0x3a4287,_0x43977b){passport[_0x7e1e('0xf')](_0x7e1e('0x25'),function(_0x2c100e,_0x311b7e,_0x3442e9){var _0x3cbcbd=_0x2c100e||_0x3442e9;if(_0x3cbcbd){return handleError(_0x3a4287,0x191,_0x3cbcbd);}if(!_0x311b7e){return handleError(_0x3a4287,0x194,{'message':_0x7e1e('0x26')});}else{var _0xb8c240={'payload':{'id':_0x311b7e['id'],'role':_0x311b7e[_0x7e1e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xb8c240)[_0x7e1e('0x1e')](function(_0x507ecc){_0x3a4287[_0x7e1e('0x27')]({'id':_0x311b7e['id'],'token':_0x507ecc,'statusCall':'','isAlreadyLogged':_0x311b7e['online']});});}})(_0x168d63,_0x3a4287,_0x43977b);};passport[_0x7e1e('0x28')]('ad-login',new LocalStrategy({'usernameField':_0x7e1e('0x1d'),'passwordField':'password'},function(_0x106a47,_0x3158d8,_0x56f44b){return ActiveDirectoryAuthenticate(db[_0x7e1e('0x29')],_0x106a47,_0x3158d8,_0x56f44b);}));
\ No newline at end of file
+var _0x9eb7=['name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','add','clearBlockUser','getLicense','catch','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','ad-login','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled'];(function(_0x10488b,_0x3f8915){var _0x15a90a=function(_0x5f380e){while(--_0x5f380e){_0x10488b['push'](_0x10488b['shift']());}};_0x15a90a(++_0x3f8915);}(_0x9eb7,0x117));var _0x79eb=function(_0x3316a0,_0x12f083){_0x3316a0=_0x3316a0-0x0;var _0x30e148=_0x9eb7[_0x3316a0];return _0x30e148;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x79eb('0x0')];var moment=require(_0x79eb('0x1'));var ActiveDirectory=require(_0x79eb('0x2'));var BPromise=require(_0x79eb('0x3'));var util=require('util');var db=require(_0x79eb('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0x79eb('0x5'));var logger=require('../../config/logger')(_0x79eb('0x6'));function isActiveDirectoryConfigured(_0x492ad5){var _0x333b61=![];if(typeof _0x492ad5[_0x79eb('0x7')]!=='undefined'){_0x333b61=_0x492ad5[_0x79eb('0x7')][_0x79eb('0x8')]&&_0x492ad5[_0x79eb('0x7')][_0x79eb('0x9')]&&_0x492ad5[_0x79eb('0x7')][_0x79eb('0xa')];}return _0x333b61;}function adAuthenticate(_0x3d2c85,_0x20327f,_0x4c4bd1){return new BPromise(function(_0x39a4b0,_0x471aad){try{var _0x356675=new ActiveDirectory(_0x3d2c85);_0x356675[_0x79eb('0xb')](_0x20327f,_0x4c4bd1,function(_0x2a413b,_0x5cac28){if(_0x2a413b){logger[_0x79eb('0xc')](_0x79eb('0xd'),_0x20327f,util[_0x79eb('0xe')](_0x2a413b,{'showHidden':![],'depth':null}));_0x471aad(_0x79eb('0xf'));}else if(!_0x5cac28){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x20327f);_0x471aad(_0x79eb('0xf'));}else{_0x39a4b0(_0x5cac28);}});}catch(_0x173c35){_0x471aad(_0x173c35);}});}function ActiveDirectoryAuthenticate(_0x174134,_0x749dfc,_0x4a567a,_0x298829){var _0x30e8ee,_0x14c767;if(!isActiveDirectoryConfigured(config)){logger[_0x79eb('0xc')](_0x79eb('0x10'),_0x749dfc);return _0x298829(null,![],{'message':_0x79eb('0xf')});}return db[_0x79eb('0x11')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x79eb('0x12')],'raw':!![]})[_0x79eb('0x13')](function(_0x56b7cb){_0x30e8ee=_0x56b7cb;if(!_0x30e8ee[_0x79eb('0x14')]){logger['error'](_0x79eb('0x15'),_0x749dfc);throw new Error(_0x79eb('0xf'));}return _0x174134['findOne']({'attributes':['id',_0x79eb('0x16'),_0x79eb('0x17'),_0x79eb('0x18'),_0x79eb('0x19'),_0x79eb('0x1a'),_0x79eb('0x1b'),_0x79eb('0x1c'),_0x79eb('0x1d')],'where':{'name':_0x749dfc,'role':{'$or':[_0x79eb('0x1e'),'user',_0x79eb('0x1f')]},'adSsoEnabled':!![]}});})[_0x79eb('0x13')](function(_0x29d075){if(!_0x29d075||_0x29d075&&_0x29d075[_0x79eb('0x16')]!==_0x749dfc){throw new Error(_0x79eb('0xf'));}_0x14c767=_0x29d075;var _0x250490=_0x14c767[_0x79eb('0x16')]+'@'+config[_0x79eb('0x7')][_0x79eb('0xa')];return adAuthenticate(config[_0x79eb('0x7')],_0x250490,_0x4a567a);})['then'](function(_0x563f57){if(_0x14c767[_0x79eb('0x1a')]){throw new Error(_0x79eb('0xf'));}if(_0x30e8ee[_0x79eb('0x12')]>0x0){if(_0x14c767[_0x79eb('0x1b')]){if(moment(_0x14c767[_0x79eb('0x1c')])[_0x79eb('0x20')](_0x30e8ee[_0x79eb('0x12')],'minutes')>moment()){throw new Error(_0x79eb('0xf'));}return utils[_0x79eb('0x21')](_0x14c767,0x0,![],null)['then'](function(){return utils[_0x79eb('0x22')](_0x14c767);})['then'](function(){return _0x298829(null,_0x14c767);});}else{return utils[_0x79eb('0x22')](_0x14c767)[_0x79eb('0x13')](function(){return _0x298829(null,_0x14c767);});}}else{return utils[_0x79eb('0x22')](_0x14c767)['then'](function(){return _0x298829(null,_0x14c767);});}})[_0x79eb('0x23')](function(_0x4cdc6d){return _0x298829(null,![],_0x4cdc6d);});}function handleError(_0x1afc3a,_0xbad17d,_0x42326e){return _0x1afc3a[_0x79eb('0x24')](_0xbad17d||0x1f4)[_0x79eb('0x25')]({'message':_0x42326e?_0x42326e['message']||_0x42326e:''});}exports[_0x79eb('0x26')]=function(_0x132c63,_0x13c1c0,_0x27d022){passport[_0x79eb('0xb')]('ad-login',function(_0x11c99f,_0x22e85f,_0x33f98f){var _0x2fa2f5=_0x11c99f||_0x33f98f;if(_0x2fa2f5){return handleError(_0x13c1c0,0x191,_0x2fa2f5);}if(!_0x22e85f){return handleError(_0x13c1c0,0x194,{'message':_0x79eb('0x27')});}else{var _0x3701a5={'payload':{'id':_0x22e85f['id'],'role':_0x22e85f['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3701a5)[_0x79eb('0x13')](function(_0x6c34e5){_0x13c1c0[_0x79eb('0x28')]({'id':_0x22e85f['id'],'token':_0x6c34e5,'statusCall':'','isAlreadyLogged':_0x22e85f[_0x79eb('0x1d')]});});}})(_0x132c63,_0x13c1c0,_0x27d022);};passport[_0x79eb('0x29')](_0x79eb('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x79eb('0x17')},function(_0x571adb,_0x5d15bf,_0x103f27){return ActiveDirectoryAuthenticate(db['User'],_0x571adb,_0x5d15bf,_0x103f27);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 82f21f8..1bd11ce 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 _0xc76d=['express','Router','post','login','exports'];(function(_0x4ea590,_0x4dcd74){var _0x1151e7=function(_0x5bc2eb){while(--_0x5bc2eb){_0x4ea590['push'](_0x4ea590['shift']());}};_0x1151e7(++_0x4dcd74);}(_0xc76d,0xd7));var _0xdc76=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xc76d[_0x16de68];return _0x1c277e;};'use strict';var express=require(_0xdc76('0x0'));var router=express[_0xdc76('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xdc76('0x2')]('/',controller[_0xdc76('0x3')]);module[_0xdc76('0x4')]=router;
\ No newline at end of file
+var _0xbe7a=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xbe7a,0x11f));var _0xabe7=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xbe7a[_0x8a969d];return _0x1d8dc7;};'use strict';var express=require(_0xabe7('0x0'));var router=express[_0xabe7('0x1')]();var controller=require(_0xabe7('0x2'));router[_0xabe7('0x3')]('/',controller[_0xabe7('0x4')]);module[_0xabe7('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 5f7c665..890b6b6 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x7a54,0x106));var _0x47a5=function(_0x35c504,_0x574374){_0x35c504=_0x35c504-0x0;var _0x2ffd85=_0x7a54[_0x35c504];return _0x2ffd85;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x7a54,0x106));var _0x47a5=function(_0x5b1b95,_0x434da4){_0x5b1b95=_0x5b1b95-0x0;var _0x2347bf=_0x7a54[_0x5b1b95];return _0x2347bf;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 1e37d50..d286079 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 _0x1288=['isMiddleware','setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x1288,0x14c));var _0x8128=function(_0x28d54c,_0x53d9ba){_0x28d54c=_0x28d54c-0x0;var _0x32ab5c=_0x1288[_0x28d54c];return _0x32ab5c;};'use strict';var express=require(_0x8128('0x0'));var passport=require('passport');var router=express[_0x8128('0x1')]();var controller=require(_0x8128('0x2'));var userController=require(_0x8128('0x3'));var authService=require(_0x8128('0x4'));router[_0x8128('0x5')]('/',controller[_0x8128('0x6')]);router[_0x8128('0x5')](_0x8128('0x7'),controller[_0x8128('0x8')],authService[_0x8128('0x9')],userController[_0x8128('0x6')],authService[_0x8128('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0xa04c=['isMiddleware','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback'];(function(_0x176977,_0x597043){var _0x35f50d=function(_0x3db271){while(--_0x3db271){_0x176977['push'](_0x176977['shift']());}};_0x35f50d(++_0x597043);}(_0xa04c,0x151));var _0xca04=function(_0x520621,_0x26e013){_0x520621=_0x520621-0x0;var _0x3d9e0c=_0xa04c[_0x520621];return _0x3d9e0c;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0xca04('0x0'));var userController=require(_0xca04('0x1'));var authService=require('../../components/auth/service');router[_0xca04('0x2')]('/',controller[_0xca04('0x3')]);router[_0xca04('0x2')](_0xca04('0x4'),controller[_0xca04('0x5')],authService[_0xca04('0x6')],userController[_0xca04('0x3')],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 b537510..484e7d0 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 _0xd053=['body','trim','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','then','findOne','name','password','salt','role','disabled','blocked','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','message','stringify','status','send','login','local-login','signToken','online','forgot','Email\x20parameter\x20is\x20missing','generate'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xd053,0x1c7));var _0x3d05=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0xd053[_0x3d27ba];return _0xf01885;};'use strict';var util=require(_0x3d05('0x0'));var passport=require(_0x3d05('0x1'));var LocalStrategy=require(_0x3d05('0x2'))[_0x3d05('0x3')];var jayson=require(_0x3d05('0x4'));var _=require(_0x3d05('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x3d05('0x6'))['db'];var authService=require(_0x3d05('0x7'));var utils=require(_0x3d05('0x8'));var client=jayson[_0x3d05('0x9')][_0x3d05('0xa')]({'port':0x232b});function localAuthenticate(_0x165846,_0x35623c,_0x11bb10,_0x3d068c){var _0xd09f9d,_0x1701fd;return db[_0x3d05('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x3d05('0xc'),'blockDuration'],'raw':!![]})[_0x3d05('0xd')](function(_0x456157){_0xd09f9d=_0x456157;return _0x165846[_0x3d05('0xe')]({'attributes':['id',_0x3d05('0xf'),_0x3d05('0x10'),_0x3d05('0x11'),_0x3d05('0x12'),_0x3d05('0x13'),_0x3d05('0x14'),'blockedAt',_0x3d05('0x15')],'where':{'name':_0x35623c,'role':{'$or':['admin',_0x3d05('0x16'),_0x3d05('0x17')]}}});})['then'](function(_0x8c3f36){if(!_0x8c3f36||_0x8c3f36&&_0x8c3f36['name']!==_0x35623c){throw new Error(_0x3d05('0x18'));}else{_0x1701fd=_0x8c3f36;return _0x1701fd;}})[_0x3d05('0xd')](function(){_0x1701fd[_0x3d05('0x19')](_0x11bb10,function(_0x36fde5,_0x29c463){var _0x1f1bf3=_0x1701fd[_0x3d05('0x15')]+0x1;if(_0x36fde5){return _0x3d068c(_0x36fde5);}else if(!_0x29c463){if(_0x1701fd['disabled']){return _0x3d068c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xd09f9d['allowedLoginAttempts']>0x0){if(_0x1701fd['blocked']){if(_0xd09f9d[_0x3d05('0x1a')]>0x0){if(moment(_0x1701fd[_0x3d05('0x1b')])['add'](_0xd09f9d[_0x3d05('0x1a')],_0x3d05('0x1c'))>moment()){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}else{return utils[_0x3d05('0x1d')](_0x1701fd,_0x1f1bf3,![],null)[_0x3d05('0xd')](function(){return _0x3d068c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}}else{if(_0x1f1bf3>=_0xd09f9d[_0x3d05('0xc')]){return utils[_0x3d05('0x1d')](_0x1701fd,0x0,!![],moment())[_0x3d05('0xd')](function(){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});});}else{return utils[_0x3d05('0x1d')](_0x1701fd,_0x1f1bf3,![],null)['then'](function(){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});});}}}else{return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}}else{if(_0x1701fd[_0x3d05('0x13')]){return _0x3d068c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xd09f9d['allowedLoginAttempts']>0x0){if(_0x1701fd[_0x3d05('0x14')]){if(_0xd09f9d[_0x3d05('0x1a')]>0x0){if(moment(_0x1701fd[_0x3d05('0x1b')])['add'](_0xd09f9d['blockDuration'],_0x3d05('0x1c'))>moment()){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}else{return utils[_0x3d05('0x1d')](_0x1701fd,0x0,![],null)[_0x3d05('0xd')](function(){return utils[_0x3d05('0x1e')](_0x1701fd);})[_0x3d05('0xd')](function(){return _0x3d068c(null,_0x1701fd);});}}else{return _0x3d068c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3d05('0x1d')](_0x1701fd,0x0,![],null)[_0x3d05('0xd')](function(){return utils[_0x3d05('0x1e')](_0x1701fd);})[_0x3d05('0xd')](function(){return _0x3d068c(null,_0x1701fd);})[_0x3d05('0x1f')](function(_0x2be856){return _0x3d068c(null,![],_0x2be856);});}}else{if(_0x1701fd[_0x3d05('0x14')]){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}else{return utils['getLicense'](_0x1701fd)['then'](function(){return _0x3d068c(null,_0x1701fd);});}}}});})['catch'](function(_0xb420a6){return _0x3d068c(null,![],_0xb420a6);});}function sendServiceMail(_0x579faf){return db[_0x3d05('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x3d05('0xf'),_0x3d05('0x21')],'include':[{'model':db[_0x3d05('0x22')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x3d05('0x23')}]}]})[_0x3d05('0xd')](function(_0x5418ed){if(!_0x5418ed){throw new Error(_0x3d05('0x24'));}var _0x496e62=_0x5418ed['getSmtpOptions']();var _0x28715c={'account':_0x496e62,'message':_[_0x3d05('0x25')]({'from':util[_0x3d05('0x26')](_0x3d05('0x27'),_0x5418ed[_0x3d05('0xf')],_0x5418ed['email']||_0x5418ed[_0x3d05('0x28')][_0x3d05('0x16')])},_0x579faf)};return client[_0x3d05('0x29')](_0x3d05('0x2a'),_0x28715c);})[_0x3d05('0xd')](function(_0x1f78ca){if(_0x1f78ca[_0x3d05('0x2b')]){throw new Error(util[_0x3d05('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1f78ca[_0x3d05('0x2b')][_0x3d05('0x2c')]||JSON[_0x3d05('0x2d')](_0x1f78ca['error'])));}return!![];});}function handleError(_0x4cc02d,_0xd3d645,_0x5ba33b){return _0x4cc02d[_0x3d05('0x2e')](_0xd3d645||0x1f4)[_0x3d05('0x2f')]({'message':_0x5ba33b?_0x5ba33b[_0x3d05('0x2c')]||_0x5ba33b:''});}exports[_0x3d05('0x30')]=function(_0x37de9e,_0xdd8f4,_0x26a639){passport['authenticate'](_0x3d05('0x31'),function(_0x1c837c,_0x516100,_0x4e2b78){var _0x547a66=_0x1c837c||_0x4e2b78;if(_0x547a66){return handleError(_0xdd8f4,0x191,_0x547a66);}if(!_0x516100){return handleError(_0xdd8f4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x409abe={'payload':{'id':_0x516100['id'],'role':_0x516100[_0x3d05('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x3d05('0x32')](_0x409abe)[_0x3d05('0xd')](function(_0x4cb6e8){_0xdd8f4['json']({'id':_0x516100['id'],'token':_0x4cb6e8,'statusCall':'','isAlreadyLogged':_0x516100[_0x3d05('0x33')]});});}})(_0x37de9e,_0xdd8f4,_0x26a639);};exports[_0x3d05('0x34')]=function(_0x4db180,_0x44c1e5){if(!_0x4db180['body'][_0x3d05('0x21')]){return handleError(_0x44c1e5,0x1f4,{'message':_0x3d05('0x35')});}var _0x4b7fc7=rs[_0x3d05('0x36')]();_0x4db180[_0x3d05('0x37')]['email']=_0x4db180[_0x3d05('0x37')][_0x3d05('0x21')][_0x3d05('0x38')]()['toLowerCase']();var _0x1e6d8e;return db[_0x3d05('0xb')][_0x3d05('0xe')]({'where':{'id':0x1},'attributes':[_0x3d05('0xc'),_0x3d05('0x1a')],'raw':!![]})[_0x3d05('0xd')](function(_0x44206f){_0x1e6d8e=_0x44206f;return db[_0x3d05('0x39')][_0x3d05('0x3a')]({'where':{'email':_0x4db180[_0x3d05('0x37')][_0x3d05('0x21')]}});})[_0x3d05('0xd')](function(_0xcf5308){if(!_0xcf5308){throw new Error(_0x3d05('0x3b'));}if(_0xcf5308[_0x3d05('0x13')]){throw new Error(_0x3d05('0x3c'));}if(_0xcf5308[_0x3d05('0x14')]){if(moment(_0xcf5308[_0x3d05('0x1b')])[_0x3d05('0x3d')](_0x1e6d8e[_0x3d05('0x1a')],_0x3d05('0x1c'))>moment()){throw new Error(_0x3d05('0x3e'));}else{_0xcf5308[_0x3d05('0x14')]=![];_0xcf5308[_0x3d05('0x1b')]=null;}}_0xcf5308[_0x3d05('0x3f')]=_0x4b7fc7;_0xcf5308[_0x3d05('0x40')]=Date[_0x3d05('0x41')]()+0x36ee80;return _0xcf5308[_0x3d05('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x4db180[_0x3d05('0x37')][_0x3d05('0x21')],'subject':_0x3d05('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x3d05('0x44')+_0x3d05('0x45')+_0x4db180[_0x3d05('0x46')][_0x3d05('0x47')]+_0x3d05('0x48')+_0x4b7fc7+'\x0a\x0a'+_0x3d05('0x49')});})[_0x3d05('0xd')](function(){_0x44c1e5[_0x3d05('0x2e')](0xc8)[_0x3d05('0x2f')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x58288e){return handleError(_0x44c1e5,0x1f4,_0x58288e);});};exports[_0x3d05('0x4a')]=function(_0x127916,_0x595d9f){return db[_0x3d05('0x39')][_0x3d05('0x3a')]({'where':{'resetPasswordToken':_0x127916[_0x3d05('0x4b')][_0x3d05('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3d05('0xd')](function(_0x22de9a){if(!_0x22de9a){throw new Error(_0x3d05('0x4d'));}return db[_0x3d05('0xb')]['findOne']({'attributes':['id',_0x3d05('0x4e'),_0x3d05('0x4f'),'passwordHistoryLimit']})[_0x3d05('0xd')](function(_0xbf20bb){if(_0xbf20bb[_0x3d05('0x4e')])authService['validatePasswordPattern'](_0x127916[_0x3d05('0x37')][_0x3d05('0x10')]);if(!_0xbf20bb[_0x3d05('0x4f')]||!_0x22de9a[_0x3d05('0x50')])return _0x22de9a;authService[_0x3d05('0x51')](_0x127916[_0x3d05('0x37')][_0x3d05('0x10')],_0x22de9a[_0x3d05('0x50')],_0xbf20bb[_0x3d05('0x52')]);return _0x22de9a;})['then'](function(){_0x22de9a[_0x3d05('0x10')]=_0x127916['body'][_0x3d05('0x10')];_0x22de9a[_0x3d05('0x3f')]=null;_0x22de9a[_0x3d05('0x40')]=null;return _0x22de9a[_0x3d05('0x42')]();});})['then'](function(){_0x595d9f[_0x3d05('0x2e')](0xc8)['send']({'message':_0x3d05('0x53')});})[_0x3d05('0x1f')](function(_0x52433c){return handleError(_0x595d9f,0x1f4,_0x52433c);});};passport[_0x3d05('0x54')](_0x3d05('0x31'),new LocalStrategy({'usernameField':_0x3d05('0xf'),'passwordField':_0x3d05('0x10')},function(_0x173a58,_0x67b70e,_0xf195c9){return localAuthenticate(db[_0x3d05('0x39')],_0x173a58,_0x67b70e,_0xf195c9);}));
\ No newline at end of file
+var _0xf67e=['now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','blocked','loginAttempts','admin','user','agent','then','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf67e,0x171));var _0xef67=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xf67e[_0x1e4360];return _0x31e6b4;};'use strict';var util=require(_0xef67('0x0'));var passport=require(_0xef67('0x1'));var LocalStrategy=require(_0xef67('0x2'))[_0xef67('0x3')];var jayson=require(_0xef67('0x4'));var _=require('lodash');var rs=require(_0xef67('0x5'));var moment=require(_0xef67('0x6'));var db=require(_0xef67('0x7'))['db'];var authService=require(_0xef67('0x8'));var utils=require(_0xef67('0x9'));var client=jayson[_0xef67('0xa')][_0xef67('0xb')]({'port':0x232b});function localAuthenticate(_0x281532,_0x4b3adb,_0x1aed7c,_0x687c6e){var _0x3f849f,_0x212d4c;return db[_0xef67('0xc')][_0xef67('0xd')]({'where':{'id':0x1},'attributes':[_0xef67('0xe'),_0xef67('0xf')],'raw':!![]})['then'](function(_0xc88006){_0x3f849f=_0xc88006;return _0x281532['findOne']({'attributes':['id',_0xef67('0x10'),_0xef67('0x11'),'salt','role','disabled',_0xef67('0x12'),'blockedAt',_0xef67('0x13')],'where':{'name':_0x4b3adb,'role':{'$or':[_0xef67('0x14'),_0xef67('0x15'),_0xef67('0x16')]}}});})[_0xef67('0x17')](function(_0x5c6b7f){if(!_0x5c6b7f||_0x5c6b7f&&_0x5c6b7f[_0xef67('0x10')]!==_0x4b3adb){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x212d4c=_0x5c6b7f;return _0x212d4c;}})['then'](function(){_0x212d4c[_0xef67('0x18')](_0x1aed7c,function(_0x1556c6,_0x1df774){var _0xd4954a=_0x212d4c[_0xef67('0x13')]+0x1;if(_0x1556c6){return _0x687c6e(_0x1556c6);}else if(!_0x1df774){if(_0x212d4c[_0xef67('0x19')]){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else if(_0x3f849f[_0xef67('0xe')]>0x0){if(_0x212d4c[_0xef67('0x12')]){if(_0x3f849f[_0xef67('0xf')]>0x0){if(moment(_0x212d4c[_0xef67('0x1b')])[_0xef67('0x1c')](_0x3f849f['blockDuration'],_0xef67('0x1d'))>moment()){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else{return utils[_0xef67('0x1e')](_0x212d4c,_0xd4954a,![],null)[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}}else{if(_0xd4954a>=_0x3f849f[_0xef67('0xe')]){return utils[_0xef67('0x1e')](_0x212d4c,0x0,!![],moment())[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});});}else{return utils['clearBlockUser'](_0x212d4c,_0xd4954a,![],null)[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});});}}}else{return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x212d4c[_0xef67('0x19')]){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else if(_0x3f849f[_0xef67('0xe')]>0x0){if(_0x212d4c[_0xef67('0x12')]){if(_0x3f849f['blockDuration']>0x0){if(moment(_0x212d4c[_0xef67('0x1b')])[_0xef67('0x1c')](_0x3f849f['blockDuration'],_0xef67('0x1d'))>moment()){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x212d4c,0x0,![],null)[_0xef67('0x17')](function(){return utils[_0xef67('0x1f')](_0x212d4c);})['then'](function(){return _0x687c6e(null,_0x212d4c);});}}else{return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}}else{return utils['clearBlockUser'](_0x212d4c,0x0,![],null)[_0xef67('0x17')](function(){return utils[_0xef67('0x1f')](_0x212d4c);})[_0xef67('0x17')](function(){return _0x687c6e(null,_0x212d4c);})[_0xef67('0x20')](function(_0x34a333){return _0x687c6e(null,![],_0x34a333);});}}else{if(_0x212d4c['blocked']){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xef67('0x1f')](_0x212d4c)['then'](function(){return _0x687c6e(null,_0x212d4c);});}}}});})[_0xef67('0x20')](function(_0x4e2557){return _0x687c6e(null,![],_0x4e2557);});}function sendServiceMail(_0xebf68c){return db[_0xef67('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xef67('0x10'),_0xef67('0x22')],'include':[{'model':db[_0xef67('0x23')],'as':_0xef67('0x24'),'include':[{'model':db[_0xef67('0x25')],'as':_0xef67('0x25')}]}]})[_0xef67('0x17')](function(_0x1b0786){if(!_0x1b0786){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0xfee50b=_0x1b0786[_0xef67('0x26')]();var _0x57a091={'account':_0xfee50b,'message':_[_0xef67('0x27')]({'from':util['format'](_0xef67('0x28'),_0x1b0786['name'],_0x1b0786[_0xef67('0x22')]||_0x1b0786[_0xef67('0x24')][_0xef67('0x15')])},_0xebf68c)};return client[_0xef67('0x29')]('SendMail',_0x57a091);})[_0xef67('0x17')](function(_0x2ce879){if(_0x2ce879[_0xef67('0x2a')]){throw new Error(util[_0xef67('0x2b')](_0xef67('0x2c'),_0x2ce879['error'][_0xef67('0x2d')]||JSON[_0xef67('0x2e')](_0x2ce879[_0xef67('0x2a')])));}return!![];});}function handleError(_0x707d9,_0x45f4ca,_0x3103f6){return _0x707d9['status'](_0x45f4ca||0x1f4)[_0xef67('0x2f')]({'message':_0x3103f6?_0x3103f6['message']||_0x3103f6:''});}exports[_0xef67('0x30')]=function(_0x2d1b16,_0x44b700,_0x2faccc){passport['authenticate'](_0xef67('0x31'),function(_0x47c1b3,_0x37769c,_0x32ec64){var _0x2c6115=_0x47c1b3||_0x32ec64;if(_0x2c6115){return handleError(_0x44b700,0x191,_0x2c6115);}if(!_0x37769c){return handleError(_0x44b700,0x194,{'message':_0xef67('0x32')});}else{var _0x240166={'payload':{'id':_0x37769c['id'],'role':_0x37769c[_0xef67('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0xef67('0x34')](_0x240166)['then'](function(_0x30cd87){_0x44b700[_0xef67('0x35')]({'id':_0x37769c['id'],'token':_0x30cd87,'statusCall':'','isAlreadyLogged':_0x37769c[_0xef67('0x36')]});});}})(_0x2d1b16,_0x44b700,_0x2faccc);};exports[_0xef67('0x37')]=function(_0x78b690,_0x4f671f){if(!_0x78b690[_0xef67('0x38')][_0xef67('0x22')]){return handleError(_0x4f671f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x88f569=rs[_0xef67('0x39')]();_0x78b690[_0xef67('0x38')][_0xef67('0x22')]=_0x78b690[_0xef67('0x38')]['email'][_0xef67('0x3a')]()[_0xef67('0x3b')]();var _0x3aef62;return db['Setting'][_0xef67('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xef67('0xf')],'raw':!![]})[_0xef67('0x17')](function(_0x54696d){_0x3aef62=_0x54696d;return db[_0xef67('0x3c')][_0xef67('0x3d')]({'where':{'email':_0x78b690[_0xef67('0x38')]['email']}});})['then'](function(_0x50567f){if(!_0x50567f){throw new Error(_0xef67('0x3e'));}if(_0x50567f[_0xef67('0x19')]){throw new Error(_0xef67('0x3f'));}if(_0x50567f[_0xef67('0x12')]){if(moment(_0x50567f['blockedAt'])['add'](_0x3aef62['blockDuration'],_0xef67('0x1d'))>moment()){throw new Error(_0xef67('0x40'));}else{_0x50567f['blocked']=![];_0x50567f[_0xef67('0x1b')]=null;}}_0x50567f[_0xef67('0x41')]=_0x88f569;_0x50567f['resetPasswordExpires']=Date[_0xef67('0x42')]()+0x36ee80;return _0x50567f[_0xef67('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x78b690[_0xef67('0x38')][_0xef67('0x22')],'subject':_0xef67('0x44'),'text':'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'+_0xef67('0x45')+_0x78b690[_0xef67('0x46')][_0xef67('0x47')]+_0xef67('0x48')+_0x88f569+'\x0a\x0a'+_0xef67('0x49')});})['then'](function(){_0x4f671f[_0xef67('0x4a')](0xc8)[_0xef67('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0xef67('0x20')](function(_0x21fe4b){return handleError(_0x4f671f,0x1f4,_0x21fe4b);});};exports[_0xef67('0x4b')]=function(_0x2595fa,_0xeaea89){return db['User'][_0xef67('0x3d')]({'where':{'resetPasswordToken':_0x2595fa[_0xef67('0x4c')][_0xef67('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xef67('0x42')]()}}})['then'](function(_0x13d12e){if(!_0x13d12e){throw new Error(_0xef67('0x4e'));}return db[_0xef67('0xc')]['findOne']({'attributes':['id',_0xef67('0x4f'),_0xef67('0x50'),'passwordHistoryLimit']})[_0xef67('0x17')](function(_0xd1efb2){if(_0xd1efb2[_0xef67('0x4f')])authService['validatePasswordPattern'](_0x2595fa['body'][_0xef67('0x11')]);if(!_0xd1efb2[_0xef67('0x50')]||!_0x13d12e[_0xef67('0x51')])return _0x13d12e;authService[_0xef67('0x52')](_0x2595fa[_0xef67('0x38')][_0xef67('0x11')],_0x13d12e[_0xef67('0x51')],_0xd1efb2[_0xef67('0x53')]);return _0x13d12e;})[_0xef67('0x17')](function(){_0x13d12e[_0xef67('0x11')]=_0x2595fa[_0xef67('0x38')][_0xef67('0x11')];_0x13d12e[_0xef67('0x41')]=null;_0x13d12e[_0xef67('0x54')]=null;return _0x13d12e[_0xef67('0x43')]();});})[_0xef67('0x17')](function(){_0xeaea89[_0xef67('0x4a')](0xc8)[_0xef67('0x2f')]({'message':_0xef67('0x55')});})['catch'](function(_0x14117c){return handleError(_0xeaea89,0x1f4,_0x14117c);});};passport[_0xef67('0x56')](_0xef67('0x31'),new LocalStrategy({'usernameField':_0xef67('0x10'),'passwordField':'password'},function(_0x1a70c2,_0xaa3d08,_0x29ea8e){return localAuthenticate(db[_0xef67('0x3c')],_0x1a70c2,_0xaa3d08,_0x29ea8e);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 67ebcff..cb1d654 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 _0xffa1=['/forgot','reset','exports','express','Router','post'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xffa1,0x87));var _0x1ffa=function(_0xa21809,_0x3ac2ef){_0xa21809=_0xa21809-0x0;var _0x870ae1=_0xffa1[_0xa21809];return _0x870ae1;};'use strict';var express=require(_0x1ffa('0x0'));var router=express[_0x1ffa('0x1')]();var controller=require('./authLocal.controller');router[_0x1ffa('0x2')]('/',controller['login']);router[_0x1ffa('0x2')](_0x1ffa('0x3'),controller['forgot']);router['post']('/reset/:token',controller[_0x1ffa('0x4')]);module[_0x1ffa('0x5')]=router;
\ No newline at end of file
+var _0x6b86=['/reset/:token','reset','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x5ef3e5,_0x1df146){var _0x293362=function(_0x5a69ff){while(--_0x5a69ff){_0x5ef3e5['push'](_0x5ef3e5['shift']());}};_0x293362(++_0x1df146);}(_0x6b86,0x152));var _0x66b8=function(_0x576a26,_0x43c6){_0x576a26=_0x576a26-0x0;var _0x231d3a=_0x6b86[_0x576a26];return _0x231d3a;};'use strict';var express=require('express');var router=express[_0x66b8('0x0')]();var controller=require(_0x66b8('0x1'));router[_0x66b8('0x2')]('/',controller[_0x66b8('0x3')]);router[_0x66b8('0x2')](_0x66b8('0x4'),controller[_0x66b8('0x5')]);router[_0x66b8('0x2')](_0x66b8('0x6'),controller[_0x66b8('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 01db78c..aee71e0 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 _0x51fa=['BOOLEAN','sequelize','STRING'];(function(_0x3ca916,_0xee3579){var _0x1ec219=function(_0x33365b){while(--_0x33365b){_0x3ca916['push'](_0x3ca916['shift']());}};_0x1ec219(++_0xee3579);}(_0x51fa,0x73));var _0xa51f=function(_0x4c8acb,_0x1d3959){_0x4c8acb=_0x4c8acb-0x0;var _0x24b7b2=_0x51fa[_0x4c8acb];return _0x24b7b2;};'use strict';var Sequelize=require(_0xa51f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa51f('0x1')]},'status':{'type':Sequelize[_0xa51f('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x62f5=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x62f5,0x131));var _0x562f=function(_0x15c9ec,_0x3a5153){_0x15c9ec=_0x15c9ec-0x0;var _0x6369ee=_0x62f5[_0x15c9ec];return _0x6369ee;};'use strict';var Sequelize=require(_0x562f('0x0'));module[_0x562f('0x1')]={'name':{'type':Sequelize[_0x562f('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x562f('0x2')]},'status':{'type':Sequelize[_0x562f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x562f('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index c108c0f..9ffff87 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 _0xc461=['include','findAll','show','params','options','find','catch','create','body','destroy','Condition','addConditions','ids','omit','getConditions','findOne','filter','Action','addActions','getActions','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','Automation','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','includeAll'];(function(_0xc5c9ac,_0x57c492){var _0x3f4606=function(_0x2aa448){while(--_0x2aa448){_0xc5c9ac['push'](_0xc5c9ac['shift']());}};_0x3f4606(++_0x57c492);}(_0xc461,0x68));var _0x1c46=function(_0x2b8332,_0x18b4b8){_0x2b8332=_0x2b8332-0x0;var _0x46a4da=_0xc461[_0x2b8332];return _0x46a4da;};'use strict';var emlformat=require(_0x1c46('0x0'));var rimraf=require(_0x1c46('0x1'));var zipdir=require(_0x1c46('0x2'));var jsonpatch=require(_0x1c46('0x3'));var rp=require(_0x1c46('0x4'));var moment=require(_0x1c46('0x5'));var BPromise=require(_0x1c46('0x6'));var Mustache=require('mustache');var util=require(_0x1c46('0x7'));var path=require(_0x1c46('0x8'));var sox=require(_0x1c46('0x9'));var csv=require('to-csv');var ejs=require(_0x1c46('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1c46('0xb'));var deskjs=require(_0x1c46('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1c46('0xd'));var Redis=require(_0x1c46('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1c46('0xf'));var as=require(_0x1c46('0x10'));var hardwareService=require(_0x1c46('0x11'));var logger=require(_0x1c46('0x12'))(_0x1c46('0x13'));var utils=require('../../config/utils');var config=require(_0x1c46('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c46('0x15'))['db'];function respondWithStatusCode(_0x2ee0f9,_0x1654b1){_0x1654b1=_0x1654b1||0xcc;return function(_0x55b4a2){if(_0x55b4a2){return _0x2ee0f9[_0x1c46('0x16')](_0x1654b1);}return _0x2ee0f9[_0x1c46('0x17')](_0x1654b1)[_0x1c46('0x18')]();};}function respondWithResult(_0x56845d,_0x10e16e){_0x10e16e=_0x10e16e||0xc8;return function(_0x5e3f1a){if(_0x5e3f1a){return _0x56845d[_0x1c46('0x17')](_0x10e16e)[_0x1c46('0x19')](_0x5e3f1a);}};}function respondWithFilteredResult(_0x42cd15,_0xe9812b){return function(_0x3782cf){if(_0x3782cf){var _0x387217=typeof _0xe9812b[_0x1c46('0x1a')]===_0x1c46('0x1b')&&typeof _0xe9812b[_0x1c46('0x1c')]==='undefined';var _0x331cca=_0x3782cf[_0x1c46('0x1d')];var _0x1a772b=_0x387217?0x0:_0xe9812b[_0x1c46('0x1a')];var _0x1dfa67=_0x387217?_0x3782cf[_0x1c46('0x1d')]:_0xe9812b[_0x1c46('0x1a')]+_0xe9812b[_0x1c46('0x1c')];var _0x112d3d;if(_0x1dfa67>=_0x331cca){_0x1dfa67=_0x331cca;_0x112d3d=0xc8;}else{_0x112d3d=0xce;}_0x42cd15[_0x1c46('0x17')](_0x112d3d);return _0x42cd15[_0x1c46('0x1e')](_0x1c46('0x1f'),_0x1a772b+'-'+_0x1dfa67+'/'+_0x331cca)['json'](_0x3782cf);}return null;};}function patchUpdates(_0x5b7bb5){return function(_0x5df8e8){try{jsonpatch[_0x1c46('0x20')](_0x5df8e8,_0x5b7bb5,!![]);}catch(_0x40cc6c){return BPromise[_0x1c46('0x21')](_0x40cc6c);}return _0x5df8e8[_0x1c46('0x22')]();};}function saveUpdates(_0x149e9a,_0x3246bf){return function(_0x358fe6){if(_0x358fe6){return _0x358fe6[_0x1c46('0x23')](_0x149e9a)[_0x1c46('0x24')](function(_0x1deddc){return _0x1deddc;});}return null;};}function removeEntity(_0x30d766,_0x2b451e){return function(_0x4f6562){if(_0x4f6562){return _0x4f6562['destroy']()[_0x1c46('0x24')](function(){_0x30d766[_0x1c46('0x17')](0xcc)[_0x1c46('0x18')]();});}};}function handleEntityNotFound(_0x395801,_0x197bbd){return function(_0x481558){if(!_0x481558){_0x395801[_0x1c46('0x16')](0x194);}return _0x481558;};}function handleError(_0x2f2abe,_0x5a0ecf){_0x5a0ecf=_0x5a0ecf||0x1f4;return function(_0x3700fe){logger[_0x1c46('0x25')](_0x3700fe[_0x1c46('0x26')]);if(_0x3700fe['name']){delete _0x3700fe[_0x1c46('0x27')];}_0x2f2abe[_0x1c46('0x17')](_0x5a0ecf)[_0x1c46('0x28')](_0x3700fe);};}exports['index']=function(_0x11331d,_0x3eb679){var _0xddb15={},_0x355fc8={},_0x315d72={'count':0x0,'rows':[]};var _0x1c517c=_['map'](db[_0x1c46('0x29')][_0x1c46('0x2a')],function(_0x2e8e73){return{'name':_0x2e8e73[_0x1c46('0x2b')],'type':_0x2e8e73['type'][_0x1c46('0x2c')]};});_0x355fc8['model']=_[_0x1c46('0x2d')](_0x1c517c,'name');_0x355fc8[_0x1c46('0x2e')]=_[_0x1c46('0x2f')](_0x11331d[_0x1c46('0x2e')]);_0x355fc8['filters']=_[_0x1c46('0x30')](_0x355fc8[_0x1c46('0x31')],_0x355fc8[_0x1c46('0x2e')]);_0xddb15['attributes']=_[_0x1c46('0x30')](_0x355fc8[_0x1c46('0x31')],qs[_0x1c46('0x32')](_0x11331d[_0x1c46('0x2e')][_0x1c46('0x32')]));_0xddb15[_0x1c46('0x33')]=_0xddb15[_0x1c46('0x33')][_0x1c46('0x34')]?_0xddb15[_0x1c46('0x33')]:_0x355fc8[_0x1c46('0x31')];if(!_0x11331d[_0x1c46('0x2e')][_0x1c46('0x35')](_0x1c46('0x36'))){_0xddb15['limit']=qs[_0x1c46('0x1c')](_0x11331d[_0x1c46('0x2e')][_0x1c46('0x1c')]);_0xddb15[_0x1c46('0x1a')]=qs[_0x1c46('0x1a')](_0x11331d['query'][_0x1c46('0x1a')]);}_0xddb15['order']=qs[_0x1c46('0x37')](_0x11331d[_0x1c46('0x2e')][_0x1c46('0x37')]);_0xddb15[_0x1c46('0x38')]=qs[_0x1c46('0x39')](_[_0x1c46('0x3a')](_0x11331d[_0x1c46('0x2e')],_0x355fc8[_0x1c46('0x39')]),_0x1c517c);if(_0x11331d[_0x1c46('0x2e')]['filter']){_0xddb15[_0x1c46('0x38')]=_[_0x1c46('0x3b')](_0xddb15['where'],{'$or':_[_0x1c46('0x2d')](_0x1c517c,function(_0x30fb54){if(_0x30fb54[_0x1c46('0x3c')]!=='VIRTUAL'){var _0x3b6793={};_0x3b6793[_0x30fb54['name']]={'$like':'%'+_0x11331d[_0x1c46('0x2e')]['filter']+'%'};return _0x3b6793;}})});}_0xddb15=_['merge']({},_0xddb15,_0x11331d['options']);var _0x4b3951={'where':_0xddb15[_0x1c46('0x38')]};return db[_0x1c46('0x29')][_0x1c46('0x1d')](_0x4b3951)[_0x1c46('0x24')](function(_0x5022e5){_0x315d72[_0x1c46('0x1d')]=_0x5022e5;if(_0x11331d[_0x1c46('0x2e')][_0x1c46('0x3d')]){_0xddb15[_0x1c46('0x3e')]=[{'all':!![]}];}return db[_0x1c46('0x29')][_0x1c46('0x3f')](_0xddb15);})[_0x1c46('0x24')](function(_0x19da41){_0x315d72['rows']=_0x19da41;return _0x315d72;})[_0x1c46('0x24')](respondWithFilteredResult(_0x3eb679,_0xddb15))['catch'](handleError(_0x3eb679,null));};exports[_0x1c46('0x40')]=function(_0x388a1d,_0x2787dc){var _0x19f8b3={'raw':![],'where':{'id':_0x388a1d[_0x1c46('0x41')]['id']}},_0x255c7b={};_0x255c7b['model']=_[_0x1c46('0x2f')](db[_0x1c46('0x29')][_0x1c46('0x2a')]);_0x255c7b[_0x1c46('0x2e')]=_[_0x1c46('0x2f')](_0x388a1d['query']);_0x255c7b[_0x1c46('0x39')]=_[_0x1c46('0x30')](_0x255c7b['model'],_0x255c7b[_0x1c46('0x2e')]);_0x19f8b3[_0x1c46('0x33')]=_[_0x1c46('0x30')](_0x255c7b[_0x1c46('0x31')],qs[_0x1c46('0x32')](_0x388a1d[_0x1c46('0x2e')][_0x1c46('0x32')]));_0x19f8b3[_0x1c46('0x33')]=_0x19f8b3[_0x1c46('0x33')][_0x1c46('0x34')]?_0x19f8b3['attributes']:_0x255c7b['model'];if(_0x388a1d['query'][_0x1c46('0x3d')]){_0x19f8b3[_0x1c46('0x3e')]=[{'all':!![]}];}_0x19f8b3=_['merge']({},_0x19f8b3,_0x388a1d[_0x1c46('0x42')]);return db[_0x1c46('0x29')][_0x1c46('0x43')](_0x19f8b3)[_0x1c46('0x24')](handleEntityNotFound(_0x2787dc,null))[_0x1c46('0x24')](respondWithResult(_0x2787dc,null))[_0x1c46('0x44')](handleError(_0x2787dc,null));};exports[_0x1c46('0x45')]=function(_0x385baf,_0x2fabeb){return db[_0x1c46('0x29')][_0x1c46('0x45')](_0x385baf['body'],{})['then'](respondWithResult(_0x2fabeb,0xc9))[_0x1c46('0x44')](handleError(_0x2fabeb,null));};exports[_0x1c46('0x23')]=function(_0x30a52e,_0x4a7bfb){if(_0x30a52e[_0x1c46('0x46')]['id']){delete _0x30a52e[_0x1c46('0x46')]['id'];}return db[_0x1c46('0x29')][_0x1c46('0x43')]({'where':{'id':_0x30a52e[_0x1c46('0x41')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x4a7bfb,null))[_0x1c46('0x24')](saveUpdates(_0x30a52e[_0x1c46('0x46')],null))[_0x1c46('0x24')](respondWithResult(_0x4a7bfb,null))[_0x1c46('0x44')](handleError(_0x4a7bfb,null));};exports[_0x1c46('0x47')]=function(_0xacc9ec,_0x3e7c7f){return db['Automation'][_0x1c46('0x43')]({'where':{'id':_0xacc9ec[_0x1c46('0x41')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x3e7c7f,null))[_0x1c46('0x24')](removeEntity(_0x3e7c7f,null))[_0x1c46('0x44')](handleError(_0x3e7c7f,null));};exports['addConditions']=function(_0x3d7a5e,_0x2815fc,_0x553356){return db[_0x1c46('0x48')]['find']({'where':{'id':_0x3d7a5e['params']['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x2815fc,null))[_0x1c46('0x24')](function(_0x57ee07){if(_0x57ee07){return _0x57ee07[_0x1c46('0x49')](_0x3d7a5e[_0x1c46('0x46')][_0x1c46('0x4a')],_[_0x1c46('0x4b')](_0x3d7a5e[_0x1c46('0x46')],['ids','id'])||{});}})['then'](respondWithResult(_0x2815fc,null))[_0x1c46('0x44')](handleError(_0x2815fc,null));};exports[_0x1c46('0x4c')]=function(_0x455f55,_0x59d1c3,_0x26e454){var _0x50d99e={};var _0x2fe34f={};var _0x4d9f5f;var _0x4bacce;return db['Automation'][_0x1c46('0x4d')]({'where':{'id':_0x455f55[_0x1c46('0x41')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x59d1c3,null))[_0x1c46('0x24')](function(_0x14c4ae){if(_0x14c4ae){_0x4d9f5f=_0x14c4ae;_0x2fe34f[_0x1c46('0x31')]=_[_0x1c46('0x2f')](db[_0x1c46('0x48')][_0x1c46('0x2a')]);_0x2fe34f[_0x1c46('0x2e')]=_['keys'](_0x455f55[_0x1c46('0x2e')]);_0x2fe34f[_0x1c46('0x39')]=_[_0x1c46('0x30')](_0x2fe34f[_0x1c46('0x31')],_0x2fe34f[_0x1c46('0x2e')]);_0x50d99e['attributes']=_[_0x1c46('0x30')](_0x2fe34f[_0x1c46('0x31')],qs[_0x1c46('0x32')](_0x455f55[_0x1c46('0x2e')][_0x1c46('0x32')]));_0x50d99e['attributes']=_0x50d99e['attributes'][_0x1c46('0x34')]?_0x50d99e[_0x1c46('0x33')]:_0x2fe34f[_0x1c46('0x31')];_0x50d99e['order']=qs[_0x1c46('0x37')](_0x455f55[_0x1c46('0x2e')][_0x1c46('0x37')]);_0x50d99e['where']=qs[_0x1c46('0x39')](_[_0x1c46('0x3a')](_0x455f55[_0x1c46('0x2e')],_0x2fe34f['filters']));if(_0x455f55[_0x1c46('0x2e')][_0x1c46('0x4e')]){_0x50d99e['where']=_['merge'](_0x50d99e[_0x1c46('0x38')],{'$or':_['map'](_0x50d99e[_0x1c46('0x33')],function(_0x136539){var _0x389c1e={};_0x389c1e[_0x136539]={'$like':'%'+_0x455f55[_0x1c46('0x2e')][_0x1c46('0x4e')]+'%'};return _0x389c1e;})});}_0x50d99e=_['merge']({},_0x50d99e,_0x455f55[_0x1c46('0x42')]);return _0x4d9f5f[_0x1c46('0x4c')](_0x50d99e);}})['then'](function(_0x55098b){if(_0x55098b){_0x4bacce=_0x55098b[_0x1c46('0x34')];if(!_0x455f55['query'][_0x1c46('0x35')](_0x1c46('0x36'))){_0x50d99e[_0x1c46('0x1c')]=qs['limit'](_0x455f55['query'][_0x1c46('0x1c')]);_0x50d99e['offset']=qs[_0x1c46('0x1a')](_0x455f55[_0x1c46('0x2e')][_0x1c46('0x1a')]);}return _0x4d9f5f[_0x1c46('0x4c')](_0x50d99e);}})[_0x1c46('0x24')](function(_0x16b40b){if(_0x16b40b){return _0x16b40b?{'count':_0x4bacce,'rows':_0x16b40b}:null;}})[_0x1c46('0x24')](respondWithResult(_0x59d1c3,null))[_0x1c46('0x44')](handleError(_0x59d1c3,null));};exports['addActions']=function(_0x3ad3a5,_0x1a6fb0,_0xef5f20){return db[_0x1c46('0x4f')]['find']({'where':{'id':_0x3ad3a5[_0x1c46('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a6fb0,null))[_0x1c46('0x24')](function(_0xfbbfb1){if(_0xfbbfb1){return _0xfbbfb1[_0x1c46('0x50')](_0x3ad3a5[_0x1c46('0x46')][_0x1c46('0x4a')],_['omit'](_0x3ad3a5[_0x1c46('0x46')],[_0x1c46('0x4a'),'id'])||{});}})[_0x1c46('0x24')](respondWithResult(_0x1a6fb0,null))[_0x1c46('0x44')](handleError(_0x1a6fb0,null));};exports[_0x1c46('0x51')]=function(_0x61511d,_0x346d3e,_0x50e51f){var _0x459b2e={};var _0x4f2c8e={};var _0x39efa9;var _0x58c7c9;return db[_0x1c46('0x29')][_0x1c46('0x4d')]({'where':{'id':_0x61511d[_0x1c46('0x41')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x346d3e,null))[_0x1c46('0x24')](function(_0x40e929){if(_0x40e929){_0x39efa9=_0x40e929;_0x4f2c8e['model']=_[_0x1c46('0x2f')](db['Action']['rawAttributes']);_0x4f2c8e[_0x1c46('0x2e')]=_[_0x1c46('0x2f')](_0x61511d[_0x1c46('0x2e')]);_0x4f2c8e[_0x1c46('0x39')]=_[_0x1c46('0x30')](_0x4f2c8e['model'],_0x4f2c8e[_0x1c46('0x2e')]);_0x459b2e['attributes']=_[_0x1c46('0x30')](_0x4f2c8e[_0x1c46('0x31')],qs[_0x1c46('0x32')](_0x61511d[_0x1c46('0x2e')]['fields']));_0x459b2e[_0x1c46('0x33')]=_0x459b2e['attributes'][_0x1c46('0x34')]?_0x459b2e[_0x1c46('0x33')]:_0x4f2c8e['model'];_0x459b2e[_0x1c46('0x52')]=qs[_0x1c46('0x37')](_0x61511d[_0x1c46('0x2e')][_0x1c46('0x37')]);_0x459b2e['where']=qs[_0x1c46('0x39')](_[_0x1c46('0x3a')](_0x61511d[_0x1c46('0x2e')],_0x4f2c8e[_0x1c46('0x39')]));if(_0x61511d[_0x1c46('0x2e')][_0x1c46('0x4e')]){_0x459b2e[_0x1c46('0x38')]=_[_0x1c46('0x3b')](_0x459b2e[_0x1c46('0x38')],{'$or':_[_0x1c46('0x2d')](_0x459b2e[_0x1c46('0x33')],function(_0x199c2e){var _0x545df9={};_0x545df9[_0x199c2e]={'$like':'%'+_0x61511d[_0x1c46('0x2e')][_0x1c46('0x4e')]+'%'};return _0x545df9;})});}_0x459b2e=_[_0x1c46('0x3b')]({},_0x459b2e,_0x61511d['options']);return _0x39efa9[_0x1c46('0x51')](_0x459b2e);}})[_0x1c46('0x24')](function(_0x4846f9){if(_0x4846f9){_0x58c7c9=_0x4846f9[_0x1c46('0x34')];if(!_0x61511d['query'][_0x1c46('0x35')](_0x1c46('0x36'))){_0x459b2e[_0x1c46('0x1c')]=qs['limit'](_0x61511d[_0x1c46('0x2e')][_0x1c46('0x1c')]);_0x459b2e[_0x1c46('0x1a')]=qs[_0x1c46('0x1a')](_0x61511d['query'][_0x1c46('0x1a')]);}return _0x39efa9[_0x1c46('0x51')](_0x459b2e);}})[_0x1c46('0x24')](function(_0x2df8fb){if(_0x2df8fb){return _0x2df8fb?{'count':_0x58c7c9,'rows':_0x2df8fb}:null;}})[_0x1c46('0x24')](respondWithResult(_0x346d3e,null))[_0x1c46('0x44')](handleError(_0x346d3e,null));};
\ No newline at end of file
+var _0x632e=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Automation','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','hasOwnProperty','nolimit','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x21a286,_0x26db62){var _0x526809=function(_0x18f3b0){while(--_0x18f3b0){_0x21a286['push'](_0x21a286['shift']());}};_0x526809(++_0x26db62);}(_0x632e,0x1ef));var _0xe632=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x632e[_0x32b122];return _0x4ad25a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe632('0x0'));var jsonpatch=require(_0xe632('0x1'));var rp=require(_0xe632('0x2'));var moment=require(_0xe632('0x3'));var BPromise=require(_0xe632('0x4'));var Mustache=require('mustache');var util=require(_0xe632('0x5'));var path=require(_0xe632('0x6'));var sox=require(_0xe632('0x7'));var csv=require('to-csv');var ejs=require(_0xe632('0x8'));var fs=require('fs');var fs_extra=require(_0xe632('0x9'));var _=require(_0xe632('0xa'));var squel=require(_0xe632('0xb'));var crypto=require(_0xe632('0xc'));var jsforce=require(_0xe632('0xd'));var deskjs=require(_0xe632('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe632('0xf'));var Redis=require(_0xe632('0x10'));var authService=require(_0xe632('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe632('0x12'));var hardwareService=require(_0xe632('0x13'));var logger=require(_0xe632('0x14'))(_0xe632('0x15'));var utils=require(_0xe632('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe632('0x17'));var db=require(_0xe632('0x18'))['db'];function respondWithStatusCode(_0xc1f14a,_0xec6603){_0xec6603=_0xec6603||0xcc;return function(_0x304fbe){if(_0x304fbe){return _0xc1f14a[_0xe632('0x19')](_0xec6603);}return _0xc1f14a[_0xe632('0x1a')](_0xec6603)[_0xe632('0x1b')]();};}function respondWithResult(_0x539791,_0x4bc89f){_0x4bc89f=_0x4bc89f||0xc8;return function(_0xcc4e89){if(_0xcc4e89){return _0x539791[_0xe632('0x1a')](_0x4bc89f)[_0xe632('0x1c')](_0xcc4e89);}};}function respondWithFilteredResult(_0x2e7269,_0x2d67ba){return function(_0x18ded0){if(_0x18ded0){var _0x5ab7b6=typeof _0x2d67ba[_0xe632('0x1d')]===_0xe632('0x1e')&&typeof _0x2d67ba['limit']===_0xe632('0x1e');var _0x4f6634=_0x18ded0[_0xe632('0x1f')];var _0x4757e3=_0x5ab7b6?0x0:_0x2d67ba[_0xe632('0x1d')];var _0x365390=_0x5ab7b6?_0x18ded0[_0xe632('0x1f')]:_0x2d67ba['offset']+_0x2d67ba[_0xe632('0x20')];var _0x1d86d9;if(_0x365390>=_0x4f6634){_0x365390=_0x4f6634;_0x1d86d9=0xc8;}else{_0x1d86d9=0xce;}_0x2e7269[_0xe632('0x1a')](_0x1d86d9);return _0x2e7269[_0xe632('0x21')](_0xe632('0x22'),_0x4757e3+'-'+_0x365390+'/'+_0x4f6634)['json'](_0x18ded0);}return null;};}function patchUpdates(_0x475e96){return function(_0x2acf0b){try{jsonpatch[_0xe632('0x23')](_0x2acf0b,_0x475e96,!![]);}catch(_0x126fce){return BPromise[_0xe632('0x24')](_0x126fce);}return _0x2acf0b[_0xe632('0x25')]();};}function saveUpdates(_0x810713,_0xcb9468){return function(_0x2050e7){if(_0x2050e7){return _0x2050e7[_0xe632('0x26')](_0x810713)[_0xe632('0x27')](function(_0x18952e){return _0x18952e;});}return null;};}function removeEntity(_0x53549b,_0x3ff38e){return function(_0x466b75){if(_0x466b75){return _0x466b75[_0xe632('0x28')]()[_0xe632('0x27')](function(){_0x53549b[_0xe632('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e779f,_0x3af543){return function(_0x177ac6){if(!_0x177ac6){_0x3e779f[_0xe632('0x19')](0x194);}return _0x177ac6;};}function handleError(_0x49d724,_0x5422c5){_0x5422c5=_0x5422c5||0x1f4;return function(_0x5eea04){logger[_0xe632('0x29')](_0x5eea04[_0xe632('0x2a')]);if(_0x5eea04[_0xe632('0x2b')]){delete _0x5eea04[_0xe632('0x2b')];}_0x49d724[_0xe632('0x1a')](_0x5422c5)[_0xe632('0x2c')](_0x5eea04);};}exports['index']=function(_0x439149,_0x1ddc3f){var _0x2eb25d={},_0x3cf90c={},_0x40b26d={'count':0x0,'rows':[]};var _0xa48265=_['map'](db[_0xe632('0x2d')][_0xe632('0x2e')],function(_0x4102a8){return{'name':_0x4102a8[_0xe632('0x2f')],'type':_0x4102a8[_0xe632('0x30')][_0xe632('0x31')]};});_0x3cf90c[_0xe632('0x32')]=_[_0xe632('0x33')](_0xa48265,'name');_0x3cf90c['query']=_[_0xe632('0x34')](_0x439149[_0xe632('0x35')]);_0x3cf90c[_0xe632('0x36')]=_[_0xe632('0x37')](_0x3cf90c['model'],_0x3cf90c[_0xe632('0x35')]);_0x2eb25d['attributes']=_[_0xe632('0x37')](_0x3cf90c[_0xe632('0x32')],qs[_0xe632('0x38')](_0x439149[_0xe632('0x35')][_0xe632('0x38')]));_0x2eb25d[_0xe632('0x39')]=_0x2eb25d[_0xe632('0x39')]['length']?_0x2eb25d[_0xe632('0x39')]:_0x3cf90c[_0xe632('0x32')];if(!_0x439149[_0xe632('0x35')]['hasOwnProperty']('nolimit')){_0x2eb25d['limit']=qs[_0xe632('0x20')](_0x439149['query'][_0xe632('0x20')]);_0x2eb25d[_0xe632('0x1d')]=qs[_0xe632('0x1d')](_0x439149[_0xe632('0x35')]['offset']);}_0x2eb25d[_0xe632('0x3a')]=qs['sort'](_0x439149['query'][_0xe632('0x3b')]);_0x2eb25d[_0xe632('0x3c')]=qs['filters'](_[_0xe632('0x3d')](_0x439149[_0xe632('0x35')],_0x3cf90c['filters']),_0xa48265);if(_0x439149[_0xe632('0x35')][_0xe632('0x3e')]){_0x2eb25d[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x2eb25d['where'],{'$or':_['map'](_0xa48265,function(_0x367218){if(_0x367218[_0xe632('0x30')]!==_0xe632('0x40')){var _0x19d9ac={};_0x19d9ac[_0x367218['name']]={'$like':'%'+_0x439149[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0x19d9ac;}})});}_0x2eb25d=_[_0xe632('0x3f')]({},_0x2eb25d,_0x439149[_0xe632('0x41')]);var _0x4d8700={'where':_0x2eb25d['where']};return db[_0xe632('0x2d')][_0xe632('0x1f')](_0x4d8700)[_0xe632('0x27')](function(_0x516b9a){_0x40b26d['count']=_0x516b9a;if(_0x439149['query'][_0xe632('0x42')]){_0x2eb25d[_0xe632('0x43')]=[{'all':!![]}];}return db[_0xe632('0x2d')][_0xe632('0x44')](_0x2eb25d);})[_0xe632('0x27')](function(_0x34e754){_0x40b26d['rows']=_0x34e754;return _0x40b26d;})[_0xe632('0x27')](respondWithFilteredResult(_0x1ddc3f,_0x2eb25d))[_0xe632('0x45')](handleError(_0x1ddc3f,null));};exports[_0xe632('0x46')]=function(_0x4d9cc5,_0x50b1c2){var _0x4634ab={'raw':![],'where':{'id':_0x4d9cc5[_0xe632('0x47')]['id']}},_0x1dac46={};_0x1dac46[_0xe632('0x32')]=_[_0xe632('0x34')](db[_0xe632('0x2d')][_0xe632('0x2e')]);_0x1dac46[_0xe632('0x35')]=_[_0xe632('0x34')](_0x4d9cc5[_0xe632('0x35')]);_0x1dac46[_0xe632('0x36')]=_[_0xe632('0x37')](_0x1dac46[_0xe632('0x32')],_0x1dac46[_0xe632('0x35')]);_0x4634ab[_0xe632('0x39')]=_['intersection'](_0x1dac46[_0xe632('0x32')],qs['fields'](_0x4d9cc5[_0xe632('0x35')][_0xe632('0x38')]));_0x4634ab['attributes']=_0x4634ab[_0xe632('0x39')][_0xe632('0x48')]?_0x4634ab[_0xe632('0x39')]:_0x1dac46['model'];if(_0x4d9cc5[_0xe632('0x35')][_0xe632('0x42')]){_0x4634ab[_0xe632('0x43')]=[{'all':!![]}];}_0x4634ab=_[_0xe632('0x3f')]({},_0x4634ab,_0x4d9cc5['options']);return db['Automation'][_0xe632('0x49')](_0x4634ab)['then'](handleEntityNotFound(_0x50b1c2,null))[_0xe632('0x27')](respondWithResult(_0x50b1c2,null))[_0xe632('0x45')](handleError(_0x50b1c2,null));};exports[_0xe632('0x4a')]=function(_0xb96944,_0x396c4f){return db['Automation'][_0xe632('0x4a')](_0xb96944[_0xe632('0x4b')],{})[_0xe632('0x27')](respondWithResult(_0x396c4f,0xc9))[_0xe632('0x45')](handleError(_0x396c4f,null));};exports[_0xe632('0x26')]=function(_0xbb9146,_0x45968e){if(_0xbb9146[_0xe632('0x4b')]['id']){delete _0xbb9146[_0xe632('0x4b')]['id'];}return db[_0xe632('0x2d')]['find']({'where':{'id':_0xbb9146[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x45968e,null))[_0xe632('0x27')](saveUpdates(_0xbb9146['body'],null))['then'](respondWithResult(_0x45968e,null))[_0xe632('0x45')](handleError(_0x45968e,null));};exports[_0xe632('0x28')]=function(_0x11b2d0,_0x33d63c){return db['Automation'][_0xe632('0x49')]({'where':{'id':_0x11b2d0[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x33d63c,null))[_0xe632('0x27')](removeEntity(_0x33d63c,null))[_0xe632('0x45')](handleError(_0x33d63c,null));};exports[_0xe632('0x4c')]=function(_0x1be386,_0x14d320,_0xebdab0){return db[_0xe632('0x4d')][_0xe632('0x49')]({'where':{'id':_0x1be386[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x14d320,null))[_0xe632('0x27')](function(_0x5a7700){if(_0x5a7700){return _0x5a7700['addConditions'](_0x1be386[_0xe632('0x4b')][_0xe632('0x4e')],_[_0xe632('0x4f')](_0x1be386['body'],[_0xe632('0x4e'),'id'])||{});}})[_0xe632('0x27')](respondWithResult(_0x14d320,null))['catch'](handleError(_0x14d320,null));};exports['getConditions']=function(_0x464943,_0x39dd82,_0x3ddf7c){var _0x50c603={};var _0x5848f6={};var _0x5708d9;var _0x3124a5;return db['Automation'][_0xe632('0x50')]({'where':{'id':_0x464943[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x39dd82,null))['then'](function(_0x2cd0fc){if(_0x2cd0fc){_0x5708d9=_0x2cd0fc;_0x5848f6['model']=_[_0xe632('0x34')](db[_0xe632('0x4d')][_0xe632('0x2e')]);_0x5848f6['query']=_[_0xe632('0x34')](_0x464943[_0xe632('0x35')]);_0x5848f6[_0xe632('0x36')]=_[_0xe632('0x37')](_0x5848f6[_0xe632('0x32')],_0x5848f6[_0xe632('0x35')]);_0x50c603['attributes']=_[_0xe632('0x37')](_0x5848f6[_0xe632('0x32')],qs[_0xe632('0x38')](_0x464943[_0xe632('0x35')]['fields']));_0x50c603[_0xe632('0x39')]=_0x50c603[_0xe632('0x39')][_0xe632('0x48')]?_0x50c603['attributes']:_0x5848f6[_0xe632('0x32')];_0x50c603[_0xe632('0x3a')]=qs['sort'](_0x464943['query'][_0xe632('0x3b')]);_0x50c603['where']=qs[_0xe632('0x36')](_[_0xe632('0x3d')](_0x464943['query'],_0x5848f6[_0xe632('0x36')]));if(_0x464943[_0xe632('0x35')][_0xe632('0x3e')]){_0x50c603[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x50c603[_0xe632('0x3c')],{'$or':_[_0xe632('0x33')](_0x50c603['attributes'],function(_0x1f72b1){var _0x33741b={};_0x33741b[_0x1f72b1]={'$like':'%'+_0x464943[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0x33741b;})});}_0x50c603=_[_0xe632('0x3f')]({},_0x50c603,_0x464943[_0xe632('0x41')]);return _0x5708d9[_0xe632('0x51')](_0x50c603);}})[_0xe632('0x27')](function(_0x460f74){if(_0x460f74){_0x3124a5=_0x460f74['length'];if(!_0x464943['query'][_0xe632('0x52')](_0xe632('0x53'))){_0x50c603[_0xe632('0x20')]=qs[_0xe632('0x20')](_0x464943[_0xe632('0x35')][_0xe632('0x20')]);_0x50c603[_0xe632('0x1d')]=qs['offset'](_0x464943[_0xe632('0x35')][_0xe632('0x1d')]);}return _0x5708d9['getConditions'](_0x50c603);}})['then'](function(_0x374e11){if(_0x374e11){return _0x374e11?{'count':_0x3124a5,'rows':_0x374e11}:null;}})[_0xe632('0x27')](respondWithResult(_0x39dd82,null))[_0xe632('0x45')](handleError(_0x39dd82,null));};exports[_0xe632('0x54')]=function(_0x49693b,_0x247905,_0x362760){return db[_0xe632('0x55')][_0xe632('0x49')]({'where':{'id':_0x49693b[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x247905,null))['then'](function(_0x42fd20){if(_0x42fd20){return _0x42fd20['addActions'](_0x49693b['body'][_0xe632('0x4e')],_[_0xe632('0x4f')](_0x49693b[_0xe632('0x4b')],[_0xe632('0x4e'),'id'])||{});}})[_0xe632('0x27')](respondWithResult(_0x247905,null))[_0xe632('0x45')](handleError(_0x247905,null));};exports[_0xe632('0x56')]=function(_0x1d9513,_0x12fbe5,_0x1c85ac){var _0x317724={};var _0x44d522={};var _0xd863af;var _0x54b3c6;return db[_0xe632('0x2d')][_0xe632('0x50')]({'where':{'id':_0x1d9513[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x12fbe5,null))[_0xe632('0x27')](function(_0x11ab4b){if(_0x11ab4b){_0xd863af=_0x11ab4b;_0x44d522['model']=_[_0xe632('0x34')](db[_0xe632('0x55')]['rawAttributes']);_0x44d522[_0xe632('0x35')]=_[_0xe632('0x34')](_0x1d9513[_0xe632('0x35')]);_0x44d522[_0xe632('0x36')]=_[_0xe632('0x37')](_0x44d522[_0xe632('0x32')],_0x44d522[_0xe632('0x35')]);_0x317724[_0xe632('0x39')]=_[_0xe632('0x37')](_0x44d522[_0xe632('0x32')],qs[_0xe632('0x38')](_0x1d9513[_0xe632('0x35')][_0xe632('0x38')]));_0x317724[_0xe632('0x39')]=_0x317724[_0xe632('0x39')][_0xe632('0x48')]?_0x317724[_0xe632('0x39')]:_0x44d522[_0xe632('0x32')];_0x317724[_0xe632('0x3a')]=qs[_0xe632('0x3b')](_0x1d9513[_0xe632('0x35')][_0xe632('0x3b')]);_0x317724[_0xe632('0x3c')]=qs[_0xe632('0x36')](_['pick'](_0x1d9513[_0xe632('0x35')],_0x44d522[_0xe632('0x36')]));if(_0x1d9513[_0xe632('0x35')][_0xe632('0x3e')]){_0x317724[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x317724[_0xe632('0x3c')],{'$or':_[_0xe632('0x33')](_0x317724[_0xe632('0x39')],function(_0x39a344){var _0xf25480={};_0xf25480[_0x39a344]={'$like':'%'+_0x1d9513[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0xf25480;})});}_0x317724=_[_0xe632('0x3f')]({},_0x317724,_0x1d9513[_0xe632('0x41')]);return _0xd863af[_0xe632('0x56')](_0x317724);}})['then'](function(_0x4643fc){if(_0x4643fc){_0x54b3c6=_0x4643fc[_0xe632('0x48')];if(!_0x1d9513[_0xe632('0x35')][_0xe632('0x52')](_0xe632('0x53'))){_0x317724[_0xe632('0x20')]=qs['limit'](_0x1d9513[_0xe632('0x35')]['limit']);_0x317724['offset']=qs[_0xe632('0x1d')](_0x1d9513[_0xe632('0x35')]['offset']);}return _0xd863af[_0xe632('0x56')](_0x317724);}})[_0xe632('0x27')](function(_0x129654){if(_0x129654){return _0x129654?{'count':_0x54b3c6,'rows':_0x129654}:null;}})[_0xe632('0x27')](respondWithResult(_0x12fbe5,null))[_0xe632('0x45')](handleError(_0x12fbe5,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 39da091..13b68ac 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 _0x0b54=['define','Automation','tools_automations','lodash','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x11abe5,_0x2cc613){var _0x88fb48=function(_0x29fa80){while(--_0x29fa80){_0x11abe5['push'](_0x11abe5['shift']());}};_0x88fb48(++_0x2cc613);}(_0x0b54,0xc1));var _0x40b5=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x0b54[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0x40b5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40b5('0x1'));var moment=require(_0x40b5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x40b5('0x3'));var rimraf=require(_0x40b5('0x4'));var config=require(_0x40b5('0x5'));var attributes=require('./automation.attributes');module[_0x40b5('0x6')]=function(_0x12cfd6,_0x41a796){return _0x12cfd6[_0x40b5('0x7')](_0x40b5('0x8'),attributes,{'tableName':_0x40b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6dea=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash'];(function(_0x4cef57,_0x4da0e4){var _0x3bf7dd=function(_0xe01cb4){while(--_0xe01cb4){_0x4cef57['push'](_0x4cef57['shift']());}};_0x3bf7dd(++_0x4da0e4);}(_0x6dea,0xfb));var _0xa6de=function(_0x27f477,_0x5131b0){_0x27f477=_0x27f477-0x0;var _0x300a6f=_0x6dea[_0x27f477];return _0x300a6f;};'use strict';var _=require(_0xa6de('0x0'));var util=require(_0xa6de('0x1'));var logger=require(_0xa6de('0x2'))(_0xa6de('0x3'));var moment=require(_0xa6de('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6de('0x5'));var fs=require('fs');var path=require(_0xa6de('0x6'));var rimraf=require(_0xa6de('0x7'));var config=require(_0xa6de('0x8'));var attributes=require(_0xa6de('0x9'));module['exports']=function(_0x207318,_0x140d16){return _0x207318[_0xa6de('0xa')]('Automation',attributes,{'tableName':_0xa6de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 57e8394..2808e28 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 _0xd237=['client','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e7fbe,_0x49c047){var _0x3ec021=function(_0x2c149b){while(--_0x2c149b){_0x5e7fbe['push'](_0x5e7fbe['shift']());}};_0x3ec021(++_0x49c047);}(_0xd237,0x14f));var _0x7d23=function(_0x141a31,_0x3ab263){_0x141a31=_0x141a31-0x0;var _0x44b4e3=_0xd237[_0x141a31];return _0x44b4e3;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('Automation,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});}
\ No newline at end of file
+var _0x7b08=['code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x7b08,0x163));var _0x87b0=function(_0x13c8df,_0x102892){_0x13c8df=_0x13c8df-0x0;var _0xc33f48=_0x7b08[_0x13c8df];return _0xc33f48;};'use strict';var _=require(_0x87b0('0x0'));var util=require('util');var moment=require(_0x87b0('0x1'));var BPromise=require(_0x87b0('0x2'));var rs=require(_0x87b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87b0('0x4'))['db'];var utils=require(_0x87b0('0x5'));var logger=require(_0x87b0('0x6'))(_0x87b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x87b0('0x8'));var client=jayson[_0x87b0('0x9')][_0x87b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x419841,_0x130650,_0x41dcc8){return new BPromise(function(_0x1a7f35,_0x4015e2){return client[_0x87b0('0xb')](_0x419841,_0x41dcc8)[_0x87b0('0xc')](function(_0x52f596){logger[_0x87b0('0xd')](_0x87b0('0xe'),_0x130650,_0x87b0('0xf'));logger[_0x87b0('0x10')](_0x87b0('0x11'),_0x130650,_0x87b0('0xf'),JSON['stringify'](_0x52f596));if(_0x52f596['error']){if(_0x52f596[_0x87b0('0x12')][_0x87b0('0x13')]===0x1f4){logger[_0x87b0('0x12')](_0x87b0('0xe'),_0x130650,_0x52f596[_0x87b0('0x12')][_0x87b0('0x14')]);return _0x4015e2(_0x52f596['error'][_0x87b0('0x14')]);}logger[_0x87b0('0x12')]('Automation,\x20%s,\x20%s',_0x130650,_0x52f596['error'][_0x87b0('0x14')]);return _0x1a7f35(_0x52f596['error']['message']);}else{logger['info'](_0x87b0('0xe'),_0x130650,_0x87b0('0xf'));_0x1a7f35(_0x52f596['result'][_0x87b0('0x14')]);}})[_0x87b0('0x15')](function(_0x2b37d6){logger[_0x87b0('0x12')](_0x87b0('0xe'),_0x130650,_0x2b37d6);_0x4015e2(_0x2b37d6);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d5b6d1a..d830a1a 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 _0x5455=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./automation.controller','get','/:id','show','isAuthenticated','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','util'];(function(_0x5d1502,_0x4d4ba5){var _0x4ffad4=function(_0x2d4a19){while(--_0x2d4a19){_0x5d1502['push'](_0x5d1502['shift']());}};_0x4ffad4(++_0x4d4ba5);}(_0x5455,0x197));var _0x5545=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5455[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require(_0x5545('0x0'));var path=require(_0x5545('0x1'));var timeout=require(_0x5545('0x2'));var express=require(_0x5545('0x3'));var router=express[_0x5545('0x4')]();var fs_extra=require(_0x5545('0x5'));var auth=require(_0x5545('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5545('0x7'));router[_0x5545('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5545('0x8')](_0x5545('0x9'),auth['isAuthenticated'](),controller[_0x5545('0xa')]);router[_0x5545('0x8')]('/:id/conditions',auth[_0x5545('0xb')](),controller[_0x5545('0xc')]);router[_0x5545('0x8')](_0x5545('0xd'),auth[_0x5545('0xb')](),controller[_0x5545('0xe')]);router[_0x5545('0xf')]('/',auth[_0x5545('0xb')](),controller[_0x5545('0x10')]);router['post']('/:id/conditions',auth[_0x5545('0xb')](),controller[_0x5545('0x11')]);router[_0x5545('0xf')](_0x5545('0xd'),auth['isAuthenticated'](),controller[_0x5545('0x12')]);router[_0x5545('0x13')]('/:id',auth[_0x5545('0xb')](),controller[_0x5545('0x14')]);router[_0x5545('0x15')](_0x5545('0x9'),auth['isAuthenticated'](),controller[_0x5545('0x16')]);module[_0x5545('0x17')]=router;
\ No newline at end of file
+var _0x826a=['getActions','post','addConditions','put','update','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions'];(function(_0x6a1321,_0x579f93){var _0x5d84ed=function(_0x477e8d){while(--_0x477e8d){_0x6a1321['push'](_0x6a1321['shift']());}};_0x5d84ed(++_0x579f93);}(_0x826a,0x1aa));var _0xa826=function(_0x21b990,_0x13409d){_0x21b990=_0x21b990-0x0;var _0x42550f=_0x826a[_0x21b990];return _0x42550f;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),auth[_0xa826('0x8')](),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0x7')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);router['post']('/',auth[_0xa826('0x8')](),controller['create']);router[_0xa826('0x10')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0x11')]);router[_0xa826('0x10')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller['addActions']);router[_0xa826('0x12')]('/:id',auth[_0xa826('0x8')](),controller[_0xa826('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa826('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 6154e03..3fbe1b3 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 _0xeef7=['DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','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','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','STRING','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x5ed21f,_0x24e6c6){var _0x18a335=function(_0x29dd35){while(--_0x29dd35){_0x5ed21f['push'](_0x5ed21f['shift']());}};_0x18a335(++_0x24e6c6);}(_0xeef7,0x7d));var _0x7eef=function(_0x758841,_0x29e9df){_0x758841=_0x758841-0x0;var _0x24e623=_0xeef7[_0x758841];return _0x24e623;};'use strict';var Sequelize=require(_0x7eef('0x0'));module[_0x7eef('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7eef('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7eef('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7eef('0x4')],'defaultValue':0x0,'comment':_0x7eef('0x5')},'limitCalls':{'type':Sequelize[_0x7eef('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7eef('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'comment':_0x7eef('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7eef('0xe')},'dialTimezone':{'type':Sequelize[_0x7eef('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7eef('0x3')](_0x7eef('0xf'),_0x7eef('0x10'),_0x7eef('0x11')),'defaultValue':_0x7eef('0xf')},'dialAMDActive':{'type':Sequelize[_0x7eef('0x4')],'defaultValue':0x0,'comment':_0x7eef('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7eef('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x7eef('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7eef('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7eef('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7eef('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7eef('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7eef('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7eef('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7eef('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7eef('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x7eef('0x3')]('DESC','ASC'),'defaultValue':_0x7eef('0x1b')},'dialPrefix':{'type':Sequelize[_0x7eef('0x7')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7eef('0x1c')},'dialCutDigit':{'type':Sequelize[_0x7eef('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7eef('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0x25')}};
\ No newline at end of file
+var _0x94b8=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x94b8,0x111));var _0x894b=function(_0x2a4ea4,_0x5c6b7d){_0x2a4ea4=_0x2a4ea4-0x0;var _0x1d84b3=_0x94b8[_0x2a4ea4];return _0x1d84b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x894b('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x894b('0x1')](_0x894b('0x2')),'allowNull':![],'defaultValue':_0x894b('0x2')},'description':{'type':Sequelize[_0x894b('0x0')]},'active':{'type':Sequelize[_0x894b('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x894b('0x4')](0x4)[_0x894b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x6')},'dialCongestionMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x894b('0x9')},'dialTimezone':{'type':Sequelize[_0x894b('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x894b('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x894b('0xa'),_0x894b('0xb'),_0x894b('0xc')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x894b('0x3')],'defaultValue':0x0,'comment':_0x894b('0xd')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x894b('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x894b('0xe')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x894b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x894b('0xf')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x894b('0x10')},'dialAMDMinWordLength':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x894b('0x11')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x894b('0x12')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x894b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x894b('0x13')},'dialOrderByScheduledAt':{'type':Sequelize[_0x894b('0x1')](_0x894b('0x14'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x894b('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x894b('0x15')},'dialCutDigit':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x894b('0x16')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x17')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x18')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x19')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1a')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1b')},'dialMachineMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1c')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x1d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index d227e86..75925fc 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 _0xd3d3=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Campaign','includeAll','include','rows','catch','show','params','find','create','user','role','IvrCampaigns','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','NOW()','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','zip-dir','fast-json-patch','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x584b87,_0x3542b8){var _0x3e7b7e=function(_0xe8964d){while(--_0xe8964d){_0x584b87['push'](_0x584b87['shift']());}};_0x3e7b7e(++_0x3542b8);}(_0xd3d3,0x19a));var _0x3d3d=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xd3d3[_0x474bc0];return _0x4b24cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3d3d('0x0'));var jsonpatch=require(_0x3d3d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d3d('0x2'));var util=require(_0x3d3d('0x3'));var path=require(_0x3d3d('0x4'));var sox=require('sox');var csv=require(_0x3d3d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d3d('0x6'));var _=require(_0x3d3d('0x7'));var squel=require(_0x3d3d('0x8'));var crypto=require(_0x3d3d('0x9'));var jsforce=require(_0x3d3d('0xa'));var deskjs=require(_0x3d3d('0xb'));var toCsv=require(_0x3d3d('0x5'));var querystring=require('querystring');var Papa=require(_0x3d3d('0xc'));var Redis=require(_0x3d3d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3d3d('0xe'));var as=require(_0x3d3d('0xf'));var hardwareService=require(_0x3d3d('0x10'));var logger=require(_0x3d3d('0x11'))(_0x3d3d('0x12'));var utils=require(_0x3d3d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3d3d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cb5f3,_0xe37fe6){_0xe37fe6=_0xe37fe6||0xcc;return function(_0x12cef1){if(_0x12cef1){return _0x1cb5f3['sendStatus'](_0xe37fe6);}return _0x1cb5f3[_0x3d3d('0x15')](_0xe37fe6)[_0x3d3d('0x16')]();};}function respondWithResult(_0x25305d,_0x553f92){_0x553f92=_0x553f92||0xc8;return function(_0x32ca75){if(_0x32ca75){return _0x25305d[_0x3d3d('0x15')](_0x553f92)[_0x3d3d('0x17')](_0x32ca75);}};}function respondWithFilteredResult(_0x16274f,_0xb02393){return function(_0x22bb7d){if(_0x22bb7d){var _0x3840b8=typeof _0xb02393['offset']===_0x3d3d('0x18')&&typeof _0xb02393[_0x3d3d('0x19')]===_0x3d3d('0x18');var _0x5a3bcd=_0x22bb7d[_0x3d3d('0x1a')];var _0x4658b9=_0x3840b8?0x0:_0xb02393[_0x3d3d('0x1b')];var _0x94eba2=_0x3840b8?_0x22bb7d[_0x3d3d('0x1a')]:_0xb02393[_0x3d3d('0x1b')]+_0xb02393[_0x3d3d('0x19')];var _0x4eff34;if(_0x94eba2>=_0x5a3bcd){_0x94eba2=_0x5a3bcd;_0x4eff34=0xc8;}else{_0x4eff34=0xce;}_0x16274f[_0x3d3d('0x15')](_0x4eff34);return _0x16274f['set'](_0x3d3d('0x1c'),_0x4658b9+'-'+_0x94eba2+'/'+_0x5a3bcd)[_0x3d3d('0x17')](_0x22bb7d);}return null;};}function patchUpdates(_0x5691d9){return function(_0x5ede83){try{jsonpatch[_0x3d3d('0x1d')](_0x5ede83,_0x5691d9,!![]);}catch(_0x2cafd4){return BPromise[_0x3d3d('0x1e')](_0x2cafd4);}return _0x5ede83[_0x3d3d('0x1f')]();};}function saveUpdates(_0x49685a,_0x4291cb){return function(_0xf88a7e){if(_0xf88a7e){return _0xf88a7e[_0x3d3d('0x20')](_0x49685a)['then'](function(_0x388900){return _0x388900;});}return null;};}function removeEntity(_0x288002,_0x1dbb69){return function(_0x557bab){if(_0x557bab){return _0x557bab['destroy']()[_0x3d3d('0x21')](function(){var _0x38cd63=_0x557bab[_0x3d3d('0x22')]({'plain':!![]});var _0x25854e='IvrCampaigns';return db[_0x3d3d('0x23')][_0x3d3d('0x24')]({'where':{'type':_0x25854e,'resourceId':_0x38cd63['id']}})[_0x3d3d('0x21')](function(){return _0x557bab;});})[_0x3d3d('0x21')](function(){_0x288002[_0x3d3d('0x15')](0xcc)[_0x3d3d('0x16')]();});}};}function handleEntityNotFound(_0x158504,_0x50fbad){return function(_0x49a2b7){if(!_0x49a2b7){_0x158504['sendStatus'](0x194);}return _0x49a2b7;};}function handleError(_0x566dd8,_0x5bf25b){_0x5bf25b=_0x5bf25b||0x1f4;return function(_0x51c8fb){logger[_0x3d3d('0x25')](_0x51c8fb[_0x3d3d('0x26')]);if(_0x51c8fb[_0x3d3d('0x27')]){delete _0x51c8fb[_0x3d3d('0x27')];}_0x566dd8[_0x3d3d('0x15')](_0x5bf25b)[_0x3d3d('0x28')](_0x51c8fb);};}exports[_0x3d3d('0x29')]=function(_0x5c1e3c,_0xecbe5b){var _0x20f7b8={},_0x421152={},_0x413e80={'count':0x0,'rows':[]};var _0x237815=_[_0x3d3d('0x2a')](db['Campaign'][_0x3d3d('0x2b')],function(_0x366414){return{'name':_0x366414[_0x3d3d('0x2c')],'type':_0x366414[_0x3d3d('0x2d')][_0x3d3d('0x2e')]};});_0x421152['model']=_['map'](_0x237815,_0x3d3d('0x27'));_0x421152[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x5c1e3c[_0x3d3d('0x2f')]);_0x421152['filters']=_['intersection'](_0x421152[_0x3d3d('0x31')],_0x421152[_0x3d3d('0x2f')]);_0x20f7b8[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x421152[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x20f7b8[_0x3d3d('0x32')]=_0x20f7b8[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0x20f7b8['attributes']:_0x421152[_0x3d3d('0x31')];if(!_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x20f7b8[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x20f7b8[_0x3d3d('0x1b')]=qs['offset'](_0x5c1e3c['query'][_0x3d3d('0x1b')]);}_0x20f7b8[_0x3d3d('0x38')]=qs['sort'](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x20f7b8['where']=qs[_0x3d3d('0x3a')](_[_0x3d3d('0x3b')](_0x5c1e3c[_0x3d3d('0x2f')],_0x421152[_0x3d3d('0x3a')]),_0x237815);if(_0x5c1e3c['query'][_0x3d3d('0x3c')]){_0x20f7b8[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x20f7b8[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x237815,function(_0x54647b){if(_0x54647b[_0x3d3d('0x2d')]!==_0x3d3d('0x3f')){var _0x486fc4={};_0x486fc4[_0x54647b[_0x3d3d('0x27')]]={'$like':'%'+_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x486fc4;}})});}_0x20f7b8=_['merge']({},_0x20f7b8,_0x5c1e3c[_0x3d3d('0x40')]);var _0x49db65={'where':_0x20f7b8[_0x3d3d('0x3d')]};return db[_0x3d3d('0x41')]['count'](_0x49db65)[_0x3d3d('0x21')](function(_0x130686){_0x413e80[_0x3d3d('0x1a')]=_0x130686;if(_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x20f7b8[_0x3d3d('0x43')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x20f7b8);})['then'](function(_0xe5e1){_0x413e80[_0x3d3d('0x44')]=_0xe5e1;return _0x413e80;})[_0x3d3d('0x21')](respondWithFilteredResult(_0xecbe5b,_0x20f7b8))[_0x3d3d('0x45')](handleError(_0xecbe5b,null));};exports[_0x3d3d('0x46')]=function(_0x214357,_0x4fad9f){var _0x158b1d={'raw':![],'where':{'id':_0x214357[_0x3d3d('0x47')]['id']}},_0xde01a5={};_0xde01a5[_0x3d3d('0x31')]=_['keys'](db[_0x3d3d('0x41')]['rawAttributes']);_0xde01a5[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x214357[_0x3d3d('0x2f')]);_0xde01a5[_0x3d3d('0x3a')]=_['intersection'](_0xde01a5[_0x3d3d('0x31')],_0xde01a5[_0x3d3d('0x2f')]);_0x158b1d['attributes']=_[_0x3d3d('0x33')](_0xde01a5['model'],qs['fields'](_0x214357['query'][_0x3d3d('0x34')]));_0x158b1d['attributes']=_0x158b1d[_0x3d3d('0x32')]['length']?_0x158b1d['attributes']:_0xde01a5['model'];if(_0x214357[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x158b1d['include']=[{'all':!![]}];}_0x158b1d=_[_0x3d3d('0x3e')]({},_0x158b1d,_0x214357['options']);return db[_0x3d3d('0x41')][_0x3d3d('0x48')](_0x158b1d)[_0x3d3d('0x21')](handleEntityNotFound(_0x4fad9f,null))[_0x3d3d('0x21')](respondWithResult(_0x4fad9f,null))[_0x3d3d('0x45')](handleError(_0x4fad9f,null));};exports[_0x3d3d('0x49')]=function(_0x1825e8,_0x437782){return db[_0x3d3d('0x41')][_0x3d3d('0x49')](_0x1825e8['body'],{})[_0x3d3d('0x21')](function(_0x25f7a5){var _0x25d2f6=_0x1825e8[_0x3d3d('0x4a')][_0x3d3d('0x22')]({'plain':!![]});if(!_0x25d2f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25d2f6[_0x3d3d('0x4b')]===_0x3d3d('0x4a')){var _0xbad206=_0x25f7a5[_0x3d3d('0x22')]({'plain':!![]});var _0x1b22a9=_0x3d3d('0x4c');return db['UserProfileSection'][_0x3d3d('0x48')]({'where':{'name':_0x1b22a9,'userProfileId':_0x25d2f6['userProfileId']},'raw':!![]})[_0x3d3d('0x21')](function(_0x181c76){if(_0x181c76&&_0x181c76['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xbad206[_0x3d3d('0x27')],'resourceId':_0xbad206['id'],'type':_0x181c76[_0x3d3d('0x27')],'sectionId':_0x181c76['id']},{})['then'](function(){return _0x25f7a5;});}else{return _0x25f7a5;}})['catch'](function(_0x1a0c6d){logger[_0x3d3d('0x25')](_0x3d3d('0x4d'),_0x1a0c6d);throw _0x1a0c6d;});}return _0x25f7a5;})[_0x3d3d('0x21')](respondWithResult(_0x437782,0xc9))[_0x3d3d('0x45')](handleError(_0x437782,null));};exports[_0x3d3d('0x4e')]=function(_0x346b0c,_0x1a98a1){var _0x50c0b1={'where':{'id':_0x346b0c[_0x3d3d('0x47')]['id']}},_0x24418d={};_0x24418d['model']=_[_0x3d3d('0x30')](db[_0x3d3d('0x41')][_0x3d3d('0x2b')]);_0x50c0b1[_0x3d3d('0x32')]=_['intersection'](_0x24418d['model'],qs['fields'](_0x346b0c['query'][_0x3d3d('0x34')]));_0x50c0b1['attributes']=_0x50c0b1[_0x3d3d('0x32')]['length']?_0x50c0b1[_0x3d3d('0x32')]:_0x24418d[_0x3d3d('0x31')];if(_0x346b0c[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x50c0b1[_0x3d3d('0x43')]=[{'all':!![]}];}_0x50c0b1=_['merge']({},_0x50c0b1,_0x346b0c['options']);return db[_0x3d3d('0x41')][_0x3d3d('0x48')](_0x50c0b1)['then'](handleEntityNotFound(_0x1a98a1,null))[_0x3d3d('0x21')](function(_0x51be10){if(_0x51be10){var _0x419c4e=_0x51be10['get']({'plain':!![]});_0x419c4e=qs[_0x3d3d('0x4f')](_0x419c4e,['id',_0x3d3d('0x50'),_0x3d3d('0x51')]);_0x346b0c[_0x3d3d('0x52')]=_['omit'](_0x346b0c[_0x3d3d('0x52')],['id','createdAt',_0x3d3d('0x51')]);return db[_0x3d3d('0x41')]['create'](_[_0x3d3d('0x3e')](_0x419c4e,_0x346b0c[_0x3d3d('0x52')]),{'include':_0x346b0c[_0x3d3d('0x2f')][_0x3d3d('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x3c68fb){var _0x4d79ce=_0x346b0c[_0x3d3d('0x4a')][_0x3d3d('0x22')]({'plain':!![]});if(!_0x4d79ce)throw new Error(_0x3d3d('0x53'));if(_0x4d79ce[_0x3d3d('0x4b')]===_0x3d3d('0x4a')){var _0x5f0de4=_0x3c68fb['get']({'plain':!![]});var _0x130ee8=_0x3d3d('0x4c');return db['UserProfileSection'][_0x3d3d('0x48')]({'where':{'name':_0x130ee8,'userProfileId':_0x4d79ce[_0x3d3d('0x54')]},'raw':!![]})['then'](function(_0x46de23){if(_0x46de23&&_0x46de23['autoAssociation']===0x0){return db[_0x3d3d('0x23')][_0x3d3d('0x49')]({'name':_0x5f0de4['name'],'resourceId':_0x5f0de4['id'],'type':_0x46de23[_0x3d3d('0x27')],'sectionId':_0x46de23['id']},{})['then'](function(){return _0x3c68fb;});}else{return _0x3c68fb;}})['catch'](function(_0x4eb7da){logger[_0x3d3d('0x25')](_0x3d3d('0x4d'),_0x4eb7da);throw _0x4eb7da;});}return _0x3c68fb;});}})[_0x3d3d('0x21')](respondWithResult(_0x1a98a1,0xc9))[_0x3d3d('0x45')](handleError(_0x1a98a1,null));};exports[_0x3d3d('0x20')]=function(_0x4e7390,_0x57e663){if(_0x4e7390[_0x3d3d('0x52')]['id']){delete _0x4e7390[_0x3d3d('0x52')]['id'];}return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0x4e7390[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x57e663,null))[_0x3d3d('0x21')](saveUpdates(_0x4e7390[_0x3d3d('0x52')],null))[_0x3d3d('0x21')](respondWithResult(_0x57e663,null))[_0x3d3d('0x45')](handleError(_0x57e663,null));};exports[_0x3d3d('0x24')]=function(_0x391c12,_0xbe69c4){return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0x391c12[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0xbe69c4,null))[_0x3d3d('0x21')](removeEntity(_0xbe69c4,null))['catch'](handleError(_0xbe69c4,null));};exports['getHoppers']=function(_0x45d1d4,_0x16e672,_0x5b5554){var _0x19dae8={'raw':!![],'where':{}};var _0x158b51={};var _0x3fdd24={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x45d1d4[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x16e672,null))[_0x3d3d('0x21')](function(_0x2421a7){if(_0x2421a7){_0x158b51[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db['CmHopper'][_0x3d3d('0x2b')]);_0x158b51['query']=_[_0x3d3d('0x30')](_0x45d1d4[_0x3d3d('0x2f')]);_0x158b51[_0x3d3d('0x3a')]=_['intersection'](_0x158b51['model'],_0x158b51[_0x3d3d('0x2f')]);_0x19dae8['attributes']=_[_0x3d3d('0x33')](_0x158b51[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x19dae8[_0x3d3d('0x32')]=_0x19dae8[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0x19dae8['attributes']:_0x158b51['model'];if(!_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x19dae8[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x19dae8[_0x3d3d('0x1b')]=qs['offset'](_0x45d1d4[_0x3d3d('0x2f')]['offset']);}_0x19dae8[_0x3d3d('0x38')]=qs[_0x3d3d('0x39')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x19dae8['where']=qs[_0x3d3d('0x3a')](_[_0x3d3d('0x3b')](_0x45d1d4['query'],_0x158b51[_0x3d3d('0x3a')]));_0x19dae8[_0x3d3d('0x3d')][_0x3d3d('0x56')]=_0x2421a7['id'];if(_0x45d1d4['query']['filter']){_0x19dae8[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x19dae8[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x19dae8[_0x3d3d('0x32')],function(_0x1417b5){var _0x30de4e={};_0x30de4e[_0x1417b5]={'$like':'%'+_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x30de4e;})});}_0x19dae8=_['merge']({},_0x19dae8,_0x45d1d4['options']);return db[_0x3d3d('0x57')]['count']({'where':_0x19dae8['where']})[_0x3d3d('0x21')](function(_0x7d16f8){_0x3fdd24[_0x3d3d('0x1a')]=_0x7d16f8;if(_0x45d1d4[_0x3d3d('0x2f')]['includeAll']){_0x19dae8[_0x3d3d('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x19dae8);})[_0x3d3d('0x21')](function(_0x85ba84){_0x3fdd24[_0x3d3d('0x44')]=_0x85ba84;return _0x3fdd24;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x16e672,_0x19dae8))[_0x3d3d('0x45')](handleError(_0x16e672,null));};exports[_0x3d3d('0x58')]=function(_0x6557b8,_0x1f78d8,_0x31124f){var _0x352b53={'raw':!![],'where':{}};var _0x221832={};var _0x46b342={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x6557b8[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f78d8,null))[_0x3d3d('0x21')](function(_0x413607){if(_0x413607){_0x221832[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db['CmHopperHistory']['rawAttributes']);_0x221832[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x6557b8[_0x3d3d('0x2f')]);_0x221832[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x221832[_0x3d3d('0x31')],_0x221832[_0x3d3d('0x2f')]);_0x352b53[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x221832[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x352b53['attributes']=_0x352b53[_0x3d3d('0x32')]['length']?_0x352b53['attributes']:_0x221832[_0x3d3d('0x31')];if(!_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x352b53[_0x3d3d('0x19')]=qs['limit'](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x352b53['offset']=qs[_0x3d3d('0x1b')](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}_0x352b53[_0x3d3d('0x38')]=qs['sort'](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x352b53['where']=qs['filters'](_[_0x3d3d('0x3b')](_0x6557b8[_0x3d3d('0x2f')],_0x221832[_0x3d3d('0x3a')]));_0x352b53[_0x3d3d('0x3d')][_0x3d3d('0x56')]=_0x413607['id'];if(_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0x352b53[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x352b53[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x352b53['attributes'],function(_0x1f7fa8){var _0x34fa27={};_0x34fa27[_0x1f7fa8]={'$like':'%'+_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x34fa27;})});}_0x352b53=_[_0x3d3d('0x3e')]({},_0x352b53,_0x6557b8[_0x3d3d('0x40')]);return db[_0x3d3d('0x59')][_0x3d3d('0x1a')]({'where':_0x352b53[_0x3d3d('0x3d')]})[_0x3d3d('0x21')](function(_0x22f909){_0x46b342[_0x3d3d('0x1a')]=_0x22f909;if(_0x6557b8['query'][_0x3d3d('0x42')]){_0x352b53[_0x3d3d('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3d3d('0x5a')](_0x352b53);})[_0x3d3d('0x21')](function(_0x235d77){_0x46b342[_0x3d3d('0x44')]=_0x235d77;return _0x46b342;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x1f78d8,_0x352b53))[_0x3d3d('0x45')](handleError(_0x1f78d8,null));};exports[_0x3d3d('0x5b')]=function(_0x574ac5,_0x219b4f,_0x5643f6){var _0x31aa86={'raw':!![],'where':{}};var _0x35c479={};var _0x1acccf={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x574ac5[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x219b4f,null))[_0x3d3d('0x21')](function(_0x3682e5){if(_0x3682e5){_0x35c479[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db[_0x3d3d('0x5c')][_0x3d3d('0x2b')]);_0x35c479['query']=_['keys'](_0x574ac5['query']);_0x35c479[_0x3d3d('0x3a')]=_['intersection'](_0x35c479[_0x3d3d('0x31')],_0x35c479[_0x3d3d('0x2f')]);_0x31aa86[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x35c479[_0x3d3d('0x31')],qs['fields'](_0x574ac5[_0x3d3d('0x2f')]['fields']));_0x31aa86[_0x3d3d('0x32')]=_0x31aa86[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0x31aa86['attributes']:_0x35c479[_0x3d3d('0x31')];if(!_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x31aa86[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x31aa86[_0x3d3d('0x1b')]=qs[_0x3d3d('0x1b')](_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}_0x31aa86[_0x3d3d('0x38')]=qs[_0x3d3d('0x39')](_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x31aa86[_0x3d3d('0x3d')]=qs[_0x3d3d('0x3a')](_['pick'](_0x574ac5[_0x3d3d('0x2f')],_0x35c479['filters']));_0x31aa86[_0x3d3d('0x3d')][_0x3d3d('0x56')]=_0x3682e5['id'];if(_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0x31aa86[_0x3d3d('0x3d')]=_['merge'](_0x31aa86['where'],{'$or':_[_0x3d3d('0x2a')](_0x31aa86['attributes'],function(_0x1c6a86){var _0xbde49e={};_0xbde49e[_0x1c6a86]={'$like':'%'+_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0xbde49e;})});}_0x31aa86=_[_0x3d3d('0x3e')]({},_0x31aa86,_0x574ac5[_0x3d3d('0x40')]);return db[_0x3d3d('0x5c')][_0x3d3d('0x1a')]({'where':_0x31aa86[_0x3d3d('0x3d')]})[_0x3d3d('0x21')](function(_0x5ecd08){_0x1acccf[_0x3d3d('0x1a')]=_0x5ecd08;if(_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x31aa86[_0x3d3d('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3d3d('0x5a')](_0x31aa86);})['then'](function(_0x292bf5){_0x1acccf[_0x3d3d('0x44')]=_0x292bf5;return _0x1acccf;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x219b4f,_0x31aa86))[_0x3d3d('0x45')](handleError(_0x219b4f,null));};exports[_0x3d3d('0x5d')]=function(_0x347df4,_0x34f11d,_0x412aa7){var _0xcf6326={'raw':!![],'where':{}};var _0x112a70={};var _0x36734f={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')]['findOne']({'where':{'id':_0x347df4['params']['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x34f11d,null))['then'](function(_0x9e7fca){if(_0x9e7fca){_0x112a70['model']=_[_0x3d3d('0x30')](db[_0x3d3d('0x5e')][_0x3d3d('0x2b')]);_0x112a70[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x347df4[_0x3d3d('0x2f')]);_0x112a70[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x112a70[_0x3d3d('0x31')],_0x112a70[_0x3d3d('0x2f')]);_0xcf6326[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x112a70['model'],qs['fields'](_0x347df4['query'][_0x3d3d('0x34')]));_0xcf6326[_0x3d3d('0x32')]=_0xcf6326['attributes'][_0x3d3d('0x35')]?_0xcf6326[_0x3d3d('0x32')]:_0x112a70['model'];if(!_0x347df4[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0xcf6326[_0x3d3d('0x19')]=qs['limit'](_0x347df4['query'][_0x3d3d('0x19')]);_0xcf6326[_0x3d3d('0x1b')]=qs[_0x3d3d('0x1b')](_0x347df4[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}_0xcf6326['order']=qs[_0x3d3d('0x39')](_0x347df4['query'][_0x3d3d('0x39')]);_0xcf6326[_0x3d3d('0x3d')]=qs['filters'](_[_0x3d3d('0x3b')](_0x347df4[_0x3d3d('0x2f')],_0x112a70[_0x3d3d('0x3a')]));_0xcf6326[_0x3d3d('0x3d')]['CampaignId']=_0x9e7fca['id'];if(_0x347df4[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0xcf6326[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0xcf6326[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0xcf6326[_0x3d3d('0x32')],function(_0x28210f){var _0xce2318={};_0xce2318[_0x28210f]={'$like':'%'+_0x347df4['query'][_0x3d3d('0x3c')]+'%'};return _0xce2318;})});}_0xcf6326=_[_0x3d3d('0x3e')]({},_0xcf6326,_0x347df4[_0x3d3d('0x40')]);return db[_0x3d3d('0x5e')]['count']({'where':_0xcf6326[_0x3d3d('0x3d')]})[_0x3d3d('0x21')](function(_0x5d962e){_0x36734f[_0x3d3d('0x1a')]=_0x5d962e;if(_0x347df4[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0xcf6326[_0x3d3d('0x43')]=[{'all':!![]}];}return db[_0x3d3d('0x5e')][_0x3d3d('0x5a')](_0xcf6326);})[_0x3d3d('0x21')](function(_0x5234a){_0x36734f[_0x3d3d('0x44')]=_0x5234a;return _0x36734f;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x34f11d,_0xcf6326))['catch'](handleError(_0x34f11d,null));};exports[_0x3d3d('0x5f')]=function(_0x20a20f,_0x56e805,_0x3587f1){var _0x32eb44={};var _0x191ba1={};var _0x278afa;var _0x3fcfe8;return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x20a20f[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x56e805,null))[_0x3d3d('0x21')](function(_0x36a57c){if(_0x36a57c){_0x278afa=_0x36a57c;_0x191ba1['model']=_[_0x3d3d('0x30')](db[_0x3d3d('0x60')][_0x3d3d('0x2b')]);_0x191ba1[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x20a20f[_0x3d3d('0x2f')]);_0x191ba1[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x191ba1[_0x3d3d('0x31')],_0x191ba1[_0x3d3d('0x2f')]);_0x32eb44[_0x3d3d('0x32')]=_['intersection'](_0x191ba1[_0x3d3d('0x31')],qs['fields'](_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x32eb44[_0x3d3d('0x32')]=_0x32eb44[_0x3d3d('0x32')]['length']?_0x32eb44[_0x3d3d('0x32')]:_0x191ba1[_0x3d3d('0x31')];_0x32eb44[_0x3d3d('0x38')]=qs['sort'](_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x32eb44[_0x3d3d('0x3d')]=qs['filters'](_['pick'](_0x20a20f[_0x3d3d('0x2f')],_0x191ba1[_0x3d3d('0x3a')]));if(_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0x32eb44[_0x3d3d('0x3d')]=_['merge'](_0x32eb44['where'],{'$or':_[_0x3d3d('0x2a')](_0x32eb44['attributes'],function(_0x2f826f){var _0x1f7ff1={};_0x1f7ff1[_0x2f826f]={'$like':'%'+_0x20a20f['query'][_0x3d3d('0x3c')]+'%'};return _0x1f7ff1;})});}_0x32eb44=_[_0x3d3d('0x3e')]({},_0x32eb44,_0x20a20f[_0x3d3d('0x40')]);return _0x278afa[_0x3d3d('0x5f')](_0x32eb44);}})[_0x3d3d('0x21')](function(_0x5cea6d){if(_0x5cea6d){_0x3fcfe8=_0x5cea6d[_0x3d3d('0x35')];if(!_0x20a20f[_0x3d3d('0x2f')]['hasOwnProperty'](_0x3d3d('0x37'))){_0x32eb44[_0x3d3d('0x19')]=qs['limit'](_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x32eb44[_0x3d3d('0x1b')]=qs[_0x3d3d('0x1b')](_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}return _0x278afa[_0x3d3d('0x5f')](_0x32eb44);}})[_0x3d3d('0x21')](function(_0x5091c5){if(_0x5091c5){return _0x5091c5?{'count':_0x3fcfe8,'rows':_0x5091c5}:null;}})[_0x3d3d('0x21')](respondWithResult(_0x56e805,null))[_0x3d3d('0x45')](handleError(_0x56e805,null));};exports[_0x3d3d('0x61')]=function(_0x4e5209,_0x47392e,_0x1ee1cd){var _0x4dd81a,_0x5ef8bb;var _0x10808a=[];var _0xf9473d=moment()[_0x3d3d('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0x4e5209['params']['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x47392e,null))['then'](function(_0x35ddb9){if(_0x35ddb9){_0x5ef8bb=_0x35ddb9;return _0x35ddb9[_0x3d3d('0x61')](_0x4e5209[_0x3d3d('0x52')][_0x3d3d('0x63')],_[_0x3d3d('0x4f')](_0x4e5209['body'],['ids','id'])||{});}return null;})[_0x3d3d('0x64')](function(_0xbb1bfa){var _0x4f880c;var _0x19a6cf;_0x4dd81a=_0xbb1bfa||[];var _0x12e6cc=[];if(_0xbb1bfa){for(var _0x4aeba1=0x0;_0x4aeba1<_0xbb1bfa['length'];_0x4aeba1+=0x1){var _0x51d50f=_0xbb1bfa[_0x4aeba1][_0x3d3d('0x22')]({'plain':!![]});_0x5ef8bb[_0x3d3d('0x65')]=_0x4e5209[_0x3d3d('0x52')][_0x3d3d('0x65')]?_0x4e5209[_0x3d3d('0x52')][_0x3d3d('0x65')]:_0x5ef8bb[_0x3d3d('0x65')];switch(_0x5ef8bb[_0x3d3d('0x65')]){case _0x3d3d('0x66'):_0x4f880c=squel[_0x3d3d('0x67')]()[_0x3d3d('0x68')](_0x3d3d('0x69'))[_0x3d3d('0x6a')]([_0x3d3d('0x6b'),_0x3d3d('0x6c'),'ContactId',_0x3d3d('0x6d'),_0x3d3d('0x56'),_0x3d3d('0x50'),'updatedAt'],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x6b'),_0x3d3d('0x6b'))['field']('NOW()','scheduledAt')[_0x3d3d('0x6f')]('id',_0x3d3d('0x70'))['field'](_0x51d50f[_0x3d3d('0x71')]['toString'](),_0x3d3d('0x6d'))[_0x3d3d('0x6f')](_0x4e5209[_0x3d3d('0x47')]['id'][_0x3d3d('0x72')](),_0x3d3d('0x56'))[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27','createdAt')[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27',_0x3d3d('0x51'))[_0x3d3d('0x73')](_0x3d3d('0x74'))[_0x3d3d('0x3d')](_0x3d3d('0x75'))[_0x3d3d('0x3d')](_0x3d3d('0x76'),_0x51d50f[_0x3d3d('0x71')][_0x3d3d('0x72')]())[_0x3d3d('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x3d3d('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x77'))[_0x3d3d('0x73')](_0x3d3d('0x78'))[_0x3d3d('0x3d')](_0x3d3d('0x79'),_0x4e5209[_0x3d3d('0x47')]['id']['toString']()))['where'](_0x3d3d('0x7a'),squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x7b'))[_0x3d3d('0x73')]('cm_hopper')[_0x3d3d('0x3d')]('CampaignId\x20=\x20?',_0x4e5209[_0x3d3d('0x47')]['id']['toString']())))[_0x3d3d('0x72')]();break;case _0x3d3d('0x7c'):_0x4f880c=squel['insert']()[_0x3d3d('0x68')]('cm_hopper')[_0x3d3d('0x6a')]([_0x3d3d('0x6b'),_0x3d3d('0x6c'),_0x3d3d('0x70'),'ListId','CampaignId',_0x3d3d('0x50'),_0x3d3d('0x51')],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x6b'),_0x3d3d('0x6b'))[_0x3d3d('0x6f')](_0x3d3d('0x7d'),_0x3d3d('0x6c'))['field']('id',_0x3d3d('0x70'))[_0x3d3d('0x6f')](_0x51d50f[_0x3d3d('0x71')]['toString'](),_0x3d3d('0x6d'))[_0x3d3d('0x6f')](_0x4e5209[_0x3d3d('0x47')]['id']['toString'](),'CampaignId')[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27','createdAt')[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27',_0x3d3d('0x51'))[_0x3d3d('0x73')]('cm_contacts')[_0x3d3d('0x3d')]('deletedAt\x20IS\x20NULL')[_0x3d3d('0x3d')](_0x3d3d('0x76'),_0x51d50f[_0x3d3d('0x71')][_0x3d3d('0x72')]())[_0x3d3d('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x7b'))[_0x3d3d('0x73')](_0x3d3d('0x69'))['where']('CampaignId\x20=\x20?',_0x4e5209[_0x3d3d('0x47')]['id']['toString']())))[_0x3d3d('0x72')]();break;default:_0x4f880c=squel[_0x3d3d('0x67')]()[_0x3d3d('0x68')](_0x3d3d('0x69'))[_0x3d3d('0x6a')](['phone',_0x3d3d('0x6c'),_0x3d3d('0x70'),_0x3d3d('0x6d'),'CampaignId','createdAt','updatedAt'],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')]('phone',_0x3d3d('0x6b'))[_0x3d3d('0x6f')](_0x3d3d('0x7d'),_0x3d3d('0x6c'))[_0x3d3d('0x6f')]('id',_0x3d3d('0x70'))['field'](_0x51d50f['CmListId'][_0x3d3d('0x72')](),_0x3d3d('0x6d'))[_0x3d3d('0x6f')](_0x4e5209[_0x3d3d('0x47')]['id'][_0x3d3d('0x72')](),_0x3d3d('0x56'))[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27',_0x3d3d('0x50'))[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27','updatedAt')[_0x3d3d('0x73')]('cm_contacts')[_0x3d3d('0x3d')](_0x3d3d('0x75'))[_0x3d3d('0x3d')](_0x3d3d('0x76'),_0x51d50f[_0x3d3d('0x71')][_0x3d3d('0x72')]())[_0x3d3d('0x3d')](_0x3d3d('0x7e')))[_0x3d3d('0x72')]();}_0x19a6cf=squel[_0x3d3d('0x67')]()[_0x3d3d('0x68')](_0x3d3d('0x7f'))[_0x3d3d('0x6a')]([_0x3d3d('0x80'),_0x3d3d('0x6c'),_0x3d3d('0x6b'),_0x3d3d('0x81'),_0x3d3d('0x50'),'updatedAt'],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')]('h.id','id')[_0x3d3d('0x6f')](_0x3d3d('0x7d'),'scheduledAt')[_0x3d3d('0x6f')]('ci.item',_0x3d3d('0x6b'))[_0x3d3d('0x6f')](_0x3d3d('0x82'),_0x3d3d('0x81'))[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27',_0x3d3d('0x50'))['field']('\x27'+_0xf9473d+'\x27','updatedAt')[_0x3d3d('0x73')](_0x3d3d('0x83'),'ci')[_0x3d3d('0x84')](_0x3d3d('0x69'),'h',_0x3d3d('0x85'))[_0x3d3d('0x3d')](_0x3d3d('0x86'),_0x51d50f[_0x3d3d('0x71')][_0x3d3d('0x72')]())[_0x3d3d('0x3d')]('h.CampaignId=?',_0x4e5209[_0x3d3d('0x47')]['id']['toString']())[_0x3d3d('0x3d')]('h.createdAt\x20=\x20?',_0xf9473d))[_0x3d3d('0x72')]();_0x12e6cc[_0x3d3d('0x87')](db[_0x3d3d('0x88')]['query'](_0x4f880c));_0x10808a['push'](db['sequelize'][_0x3d3d('0x2f')](_0x19a6cf));}return BPromise[_0x3d3d('0x89')](_0x12e6cc);}})['then'](function(){return BPromise[_0x3d3d('0x89')](_0x10808a);})[_0x3d3d('0x21')](function(){return _0x4dd81a;})[_0x3d3d('0x21')](respondWithResult(_0x47392e,null))[_0x3d3d('0x45')](handleError(_0x47392e,null));};exports['removeLists']=function(_0xede95d,_0x3409f3,_0xa2a580){return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0xede95d[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x3409f3,null))[_0x3d3d('0x21')](function(_0x32b787){if(_0x32b787){return _0x32b787['removeLists'](_0xede95d[_0x3d3d('0x2f')][_0x3d3d('0x63')]);}})[_0x3d3d('0x21')](function(_0x1c246e){if(_0x1c246e){return db[_0x3d3d('0x57')][_0x3d3d('0x24')]({'where':{'ListId':_0xede95d['query'][_0x3d3d('0x63')],'CampaignId':_0xede95d[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](function(){return _0x1c246e;});}})[_0x3d3d('0x21')](respondWithStatusCode(_0x3409f3,null))[_0x3d3d('0x45')](handleError(_0x3409f3,null));};exports[_0x3d3d('0x8a')]=function(_0x2ce4d5,_0x46f091,_0x1b14e0){var _0xb39e95={};var _0x63d492={};var _0x2a73e6;var _0x5b97e7;return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x2ce4d5['params']['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x46f091,null))[_0x3d3d('0x21')](function(_0x1cc399){if(_0x1cc399){_0x2a73e6=_0x1cc399;_0x63d492[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db['CmList'][_0x3d3d('0x2b')]);_0x63d492[_0x3d3d('0x2f')]=_['keys'](_0x2ce4d5[_0x3d3d('0x2f')]);_0x63d492[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x63d492['model'],_0x63d492[_0x3d3d('0x2f')]);_0xb39e95['attributes']=_['intersection'](_0x63d492[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x2ce4d5['query'][_0x3d3d('0x34')]));_0xb39e95[_0x3d3d('0x32')]=_0xb39e95[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0xb39e95[_0x3d3d('0x32')]:_0x63d492[_0x3d3d('0x31')];_0xb39e95[_0x3d3d('0x38')]=qs[_0x3d3d('0x39')](_0x2ce4d5[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0xb39e95[_0x3d3d('0x3d')]=qs[_0x3d3d('0x3a')](_[_0x3d3d('0x3b')](_0x2ce4d5[_0x3d3d('0x2f')],_0x63d492[_0x3d3d('0x3a')]));if(_0x2ce4d5[_0x3d3d('0x2f')]['filter']){_0xb39e95[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0xb39e95[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0xb39e95['attributes'],function(_0x5a45a0){var _0x448054={};_0x448054[_0x5a45a0]={'$like':'%'+_0x2ce4d5[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x448054;})});}_0xb39e95=_['merge']({},_0xb39e95,_0x2ce4d5[_0x3d3d('0x40')]);return _0x2a73e6[_0x3d3d('0x8a')](_0xb39e95);}})['then'](function(_0x4eb054){if(_0x4eb054){_0x5b97e7=_0x4eb054[_0x3d3d('0x35')];if(!_0x2ce4d5[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0xb39e95[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x2ce4d5[_0x3d3d('0x2f')]['limit']);_0xb39e95[_0x3d3d('0x1b')]=qs['offset'](_0x2ce4d5[_0x3d3d('0x2f')]['offset']);}return _0x2a73e6[_0x3d3d('0x8a')](_0xb39e95);}})[_0x3d3d('0x21')](function(_0x86c019){if(_0x86c019){return _0x86c019?{'count':_0x5b97e7,'rows':_0x86c019}:null;}})['then'](respondWithResult(_0x46f091,null))[_0x3d3d('0x45')](handleError(_0x46f091,null));};exports[_0x3d3d('0x8b')]=function(_0x5a20f4,_0x5bc772,_0x5ee542){var _0x42e28e,_0x2aed8d;var _0xecc5d9=[];var _0x5d498f=moment()[_0x3d3d('0x62')](_0x3d3d('0x8c'));return db['Campaign'][_0x3d3d('0x48')]({'where':{'id':_0x5a20f4[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x5bc772,null))[_0x3d3d('0x21')](function(_0x92bf6b){if(_0x92bf6b){_0x2aed8d=_0x92bf6b;return _0x92bf6b[_0x3d3d('0x8b')](_0x5a20f4[_0x3d3d('0x52')][_0x3d3d('0x63')],_[_0x3d3d('0x4f')](_0x5a20f4[_0x3d3d('0x52')],['ids','id'])||{});}return null;})['spread'](function(_0x4cf2e7){var _0x1e15b4;var _0xdbfc9e;_0x42e28e=_0x4cf2e7||[];var _0x19438f=[];if(_0x4cf2e7){for(var _0x574b5e=0x0;_0x574b5e<_0x4cf2e7['length'];_0x574b5e+=0x1){var _0x376459=_0x4cf2e7[_0x574b5e][_0x3d3d('0x22')]({'plain':!![]});_0x1e15b4=squel[_0x3d3d('0x67')]()[_0x3d3d('0x68')](_0x3d3d('0x8d'))[_0x3d3d('0x6a')]([_0x3d3d('0x6b'),_0x3d3d('0x70'),_0x3d3d('0x6d'),'CampaignId',_0x3d3d('0x50'),_0x3d3d('0x51')],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x6b'),_0x3d3d('0x6b'))['field']('id',_0x3d3d('0x70'))[_0x3d3d('0x6f')](_0x376459['CmListId']['toString'](),_0x3d3d('0x6d'))[_0x3d3d('0x6f')](_0x5a20f4[_0x3d3d('0x47')]['id']['toString'](),_0x3d3d('0x56'))[_0x3d3d('0x6f')]('NOW()',_0x3d3d('0x50'))[_0x3d3d('0x6f')](_0x3d3d('0x7d'),_0x3d3d('0x51'))[_0x3d3d('0x73')](_0x3d3d('0x74'))[_0x3d3d('0x3d')](_0x3d3d('0x75'))['where']('ListId\x20=\x20?',_0x376459['CmListId']['toString']())[_0x3d3d('0x3d')](_0x3d3d('0x7e')))['toString']();_0x19438f[_0x3d3d('0x87')](db['sequelize'][_0x3d3d('0x2f')](_0x1e15b4));}return BPromise[_0x3d3d('0x89')](_0x19438f);}})['then'](function(){return _0x42e28e;})[_0x3d3d('0x21')](respondWithResult(_0x5bc772,null))[_0x3d3d('0x45')](handleError(_0x5bc772,null));};exports['removeBlackLists']=function(_0x5170a8,_0x1d3aa3,_0x7b8ed1){return db['Campaign']['find']({'where':{'id':_0x5170a8['params']['id']}})['then'](handleEntityNotFound(_0x1d3aa3,null))[_0x3d3d('0x21')](function(_0x7b66f6){if(_0x7b66f6){return _0x7b66f6['removeBlackLists'](_0x5170a8['query'][_0x3d3d('0x63')]);}})['then'](function(_0x323172){if(_0x323172){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5170a8[_0x3d3d('0x2f')]['ids'],'CampaignId':_0x5170a8['params']['id']}})[_0x3d3d('0x21')](function(){return _0x323172;});}})[_0x3d3d('0x21')](respondWithStatusCode(_0x1d3aa3,null))[_0x3d3d('0x45')](handleError(_0x1d3aa3,null));};
\ No newline at end of file
+var _0x6f33=['count','offset','Content-Range','apply','reject','update','destroy','get','IvrCampaigns','then','sendStatus','stack','send','index','map','Campaign','rawAttributes','fieldName','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','nolimit','sort','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','NOW()','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit'];(function(_0x1ac77b,_0x1cbdac){var _0x5c0165=function(_0x22cb2a){while(--_0x22cb2a){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x5c0165(++_0x1cbdac);}(_0x6f33,0x7a));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x36f3('0x0'));var rimraf=require(_0x36f3('0x1'));var zipdir=require(_0x36f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x36f3('0x3'));var BPromise=require(_0x36f3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x36f3('0x5'));var sox=require('sox');var csv=require(_0x36f3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36f3('0x7'));var squel=require('squel');var crypto=require(_0x36f3('0x8'));var jsforce=require(_0x36f3('0x9'));var deskjs=require(_0x36f3('0xa'));var toCsv=require(_0x36f3('0x6'));var querystring=require('querystring');var Papa=require(_0x36f3('0xb'));var Redis=require(_0x36f3('0xc'));var authService=require(_0x36f3('0xd'));var qs=require(_0x36f3('0xe'));var as=require(_0x36f3('0xf'));var hardwareService=require(_0x36f3('0x10'));var logger=require(_0x36f3('0x11'))(_0x36f3('0x12'));var utils=require(_0x36f3('0x13'));var config=require(_0x36f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x36f3('0x15'))['db'];function respondWithStatusCode(_0x47740d,_0x4dda9e){_0x4dda9e=_0x4dda9e||0xcc;return function(_0x424a2f){if(_0x424a2f){return _0x47740d['sendStatus'](_0x4dda9e);}return _0x47740d[_0x36f3('0x16')](_0x4dda9e)[_0x36f3('0x17')]();};}function respondWithResult(_0x112a9d,_0x12eb9b){_0x12eb9b=_0x12eb9b||0xc8;return function(_0x9da06a){if(_0x9da06a){return _0x112a9d['status'](_0x12eb9b)[_0x36f3('0x18')](_0x9da06a);}};}function respondWithFilteredResult(_0x25d29a,_0x2b108e){return function(_0x126414){if(_0x126414){var _0x116c49=typeof _0x2b108e['offset']===_0x36f3('0x19')&&typeof _0x2b108e[_0x36f3('0x1a')]===_0x36f3('0x19');var _0x376216=_0x126414[_0x36f3('0x1b')];var _0x2cc9ea=_0x116c49?0x0:_0x2b108e['offset'];var _0x232fd3=_0x116c49?_0x126414[_0x36f3('0x1b')]:_0x2b108e[_0x36f3('0x1c')]+_0x2b108e[_0x36f3('0x1a')];var _0x3cf8a2;if(_0x232fd3>=_0x376216){_0x232fd3=_0x376216;_0x3cf8a2=0xc8;}else{_0x3cf8a2=0xce;}_0x25d29a['status'](_0x3cf8a2);return _0x25d29a['set'](_0x36f3('0x1d'),_0x2cc9ea+'-'+_0x232fd3+'/'+_0x376216)[_0x36f3('0x18')](_0x126414);}return null;};}function patchUpdates(_0x402dc8){return function(_0x1930f4){try{jsonpatch[_0x36f3('0x1e')](_0x1930f4,_0x402dc8,!![]);}catch(_0xbf3556){return BPromise[_0x36f3('0x1f')](_0xbf3556);}return _0x1930f4['save']();};}function saveUpdates(_0x54f131,_0x57d1c2){return function(_0x496d70){if(_0x496d70){return _0x496d70[_0x36f3('0x20')](_0x54f131)['then'](function(_0x2cb42c){return _0x2cb42c;});}return null;};}function removeEntity(_0x292143,_0x481d99){return function(_0x4c45eb){if(_0x4c45eb){return _0x4c45eb[_0x36f3('0x21')]()['then'](function(){var _0x256f53=_0x4c45eb[_0x36f3('0x22')]({'plain':!![]});var _0x165633=_0x36f3('0x23');return db['UserProfileResource'][_0x36f3('0x21')]({'where':{'type':_0x165633,'resourceId':_0x256f53['id']}})['then'](function(){return _0x4c45eb;});})[_0x36f3('0x24')](function(){_0x292143[_0x36f3('0x16')](0xcc)[_0x36f3('0x17')]();});}};}function handleEntityNotFound(_0x4ba389,_0x58036d){return function(_0x405e24){if(!_0x405e24){_0x4ba389[_0x36f3('0x25')](0x194);}return _0x405e24;};}function handleError(_0x1dd545,_0x145edf){_0x145edf=_0x145edf||0x1f4;return function(_0x188080){logger['error'](_0x188080[_0x36f3('0x26')]);if(_0x188080['name']){delete _0x188080['name'];}_0x1dd545[_0x36f3('0x16')](_0x145edf)[_0x36f3('0x27')](_0x188080);};}exports[_0x36f3('0x28')]=function(_0x276b7c,_0x1809b6){var _0x596497={},_0x89d37a={},_0x26b25e={'count':0x0,'rows':[]};var _0x43e167=_[_0x36f3('0x29')](db[_0x36f3('0x2a')][_0x36f3('0x2b')],function(_0x59e157){return{'name':_0x59e157[_0x36f3('0x2c')],'type':_0x59e157['type'][_0x36f3('0x2d')]};});_0x89d37a[_0x36f3('0x2e')]=_[_0x36f3('0x29')](_0x43e167,_0x36f3('0x2f'));_0x89d37a['query']=_[_0x36f3('0x30')](_0x276b7c[_0x36f3('0x31')]);_0x89d37a['filters']=_[_0x36f3('0x32')](_0x89d37a[_0x36f3('0x2e')],_0x89d37a[_0x36f3('0x31')]);_0x596497[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x89d37a[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x34')]));_0x596497[_0x36f3('0x33')]=_0x596497[_0x36f3('0x33')][_0x36f3('0x35')]?_0x596497[_0x36f3('0x33')]:_0x89d37a[_0x36f3('0x2e')];if(!_0x276b7c[_0x36f3('0x31')][_0x36f3('0x36')]('nolimit')){_0x596497[_0x36f3('0x1a')]=qs['limit'](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x596497[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x596497[_0x36f3('0x37')]=qs['sort'](_0x276b7c['query']['sort']);_0x596497[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_['pick'](_0x276b7c[_0x36f3('0x31')],_0x89d37a[_0x36f3('0x39')]),_0x43e167);if(_0x276b7c[_0x36f3('0x31')]['filter']){_0x596497[_0x36f3('0x38')]=_['merge'](_0x596497[_0x36f3('0x38')],{'$or':_['map'](_0x43e167,function(_0x234f73){if(_0x234f73[_0x36f3('0x3a')]!==_0x36f3('0x3b')){var _0x51732b={};_0x51732b[_0x234f73[_0x36f3('0x2f')]]={'$like':'%'+_0x276b7c[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x51732b;}})});}_0x596497=_[_0x36f3('0x3d')]({},_0x596497,_0x276b7c[_0x36f3('0x3e')]);var _0x565c52={'where':_0x596497['where']};return db['Campaign'][_0x36f3('0x1b')](_0x565c52)[_0x36f3('0x24')](function(_0x1aabc0){_0x26b25e[_0x36f3('0x1b')]=_0x1aabc0;if(_0x276b7c['query'][_0x36f3('0x3f')]){_0x596497[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x2a')][_0x36f3('0x41')](_0x596497);})[_0x36f3('0x24')](function(_0xd63988){_0x26b25e[_0x36f3('0x42')]=_0xd63988;return _0x26b25e;})['then'](respondWithFilteredResult(_0x1809b6,_0x596497))['catch'](handleError(_0x1809b6,null));};exports['show']=function(_0x3f8011,_0x5721af){var _0x4255ff={'raw':![],'where':{'id':_0x3f8011[_0x36f3('0x43')]['id']}},_0x277b40={};_0x277b40['model']=_[_0x36f3('0x30')](db[_0x36f3('0x2a')][_0x36f3('0x2b')]);_0x277b40[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x3f8011[_0x36f3('0x31')]);_0x277b40[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x277b40[_0x36f3('0x2e')],_0x277b40[_0x36f3('0x31')]);_0x4255ff[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x277b40[_0x36f3('0x2e')],qs['fields'](_0x3f8011[_0x36f3('0x31')][_0x36f3('0x34')]));_0x4255ff[_0x36f3('0x33')]=_0x4255ff[_0x36f3('0x33')][_0x36f3('0x35')]?_0x4255ff[_0x36f3('0x33')]:_0x277b40[_0x36f3('0x2e')];if(_0x3f8011[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x4255ff['include']=[{'all':!![]}];}_0x4255ff=_[_0x36f3('0x3d')]({},_0x4255ff,_0x3f8011[_0x36f3('0x3e')]);return db[_0x36f3('0x2a')][_0x36f3('0x44')](_0x4255ff)[_0x36f3('0x24')](handleEntityNotFound(_0x5721af,null))[_0x36f3('0x24')](respondWithResult(_0x5721af,null))[_0x36f3('0x45')](handleError(_0x5721af,null));};exports[_0x36f3('0x46')]=function(_0x2be4e0,_0x477cf6){return db[_0x36f3('0x2a')][_0x36f3('0x46')](_0x2be4e0[_0x36f3('0x47')],{})[_0x36f3('0x24')](function(_0x24e2c8){var _0x39dad3=_0x2be4e0[_0x36f3('0x48')][_0x36f3('0x22')]({'plain':!![]});if(!_0x39dad3)throw new Error(_0x36f3('0x49'));if(_0x39dad3['role']===_0x36f3('0x48')){var _0x6f3400=_0x24e2c8[_0x36f3('0x22')]({'plain':!![]});var _0x36960c=_0x36f3('0x23');return db['UserProfileSection'][_0x36f3('0x44')]({'where':{'name':_0x36960c,'userProfileId':_0x39dad3['userProfileId']},'raw':!![]})[_0x36f3('0x24')](function(_0x29d7ac){if(_0x29d7ac&&_0x29d7ac['autoAssociation']===0x0){return db[_0x36f3('0x4a')][_0x36f3('0x46')]({'name':_0x6f3400[_0x36f3('0x2f')],'resourceId':_0x6f3400['id'],'type':_0x29d7ac[_0x36f3('0x2f')],'sectionId':_0x29d7ac['id']},{})['then'](function(){return _0x24e2c8;});}else{return _0x24e2c8;}})[_0x36f3('0x45')](function(_0x167170){logger[_0x36f3('0x4b')](_0x36f3('0x4c'),_0x167170);throw _0x167170;});}return _0x24e2c8;})[_0x36f3('0x24')](respondWithResult(_0x477cf6,0xc9))[_0x36f3('0x45')](handleError(_0x477cf6,null));};exports[_0x36f3('0x4d')]=function(_0x425bc3,_0x2c9fc4){var _0x58c0ec={'where':{'id':_0x425bc3[_0x36f3('0x43')]['id']}},_0x385acd={};_0x385acd[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db[_0x36f3('0x2a')][_0x36f3('0x2b')]);_0x58c0ec[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x385acd[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x425bc3['query'][_0x36f3('0x34')]));_0x58c0ec['attributes']=_0x58c0ec[_0x36f3('0x33')][_0x36f3('0x35')]?_0x58c0ec[_0x36f3('0x33')]:_0x385acd['model'];if(_0x425bc3[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x58c0ec[_0x36f3('0x40')]=[{'all':!![]}];}_0x58c0ec=_[_0x36f3('0x3d')]({},_0x58c0ec,_0x425bc3[_0x36f3('0x3e')]);return db['Campaign'][_0x36f3('0x44')](_0x58c0ec)['then'](handleEntityNotFound(_0x2c9fc4,null))[_0x36f3('0x24')](function(_0x3b14d6){if(_0x3b14d6){var _0x543f50=_0x3b14d6[_0x36f3('0x22')]({'plain':!![]});_0x543f50=qs[_0x36f3('0x4e')](_0x543f50,['id',_0x36f3('0x4f'),_0x36f3('0x50')]);_0x425bc3[_0x36f3('0x47')]=_[_0x36f3('0x4e')](_0x425bc3['body'],['id',_0x36f3('0x4f'),_0x36f3('0x50')]);return db[_0x36f3('0x2a')][_0x36f3('0x46')](_[_0x36f3('0x3d')](_0x543f50,_0x425bc3['body']),{'include':_0x425bc3[_0x36f3('0x31')][_0x36f3('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0xa51b26){var _0x49b0fe=_0x425bc3['user'][_0x36f3('0x22')]({'plain':!![]});if(!_0x49b0fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49b0fe[_0x36f3('0x51')]==='user'){var _0x5b2e50=_0xa51b26[_0x36f3('0x22')]({'plain':!![]});var _0x35303e=_0x36f3('0x23');return db['UserProfileSection'][_0x36f3('0x44')]({'where':{'name':_0x35303e,'userProfileId':_0x49b0fe[_0x36f3('0x52')]},'raw':!![]})[_0x36f3('0x24')](function(_0x42e06e){if(_0x42e06e&&_0x42e06e[_0x36f3('0x53')]===0x0){return db[_0x36f3('0x4a')]['create']({'name':_0x5b2e50[_0x36f3('0x2f')],'resourceId':_0x5b2e50['id'],'type':_0x42e06e[_0x36f3('0x2f')],'sectionId':_0x42e06e['id']},{})[_0x36f3('0x24')](function(){return _0xa51b26;});}else{return _0xa51b26;}})[_0x36f3('0x45')](function(_0x19bc69){logger['error'](_0x36f3('0x4c'),_0x19bc69);throw _0x19bc69;});}return _0xa51b26;});}})[_0x36f3('0x24')](respondWithResult(_0x2c9fc4,0xc9))[_0x36f3('0x45')](handleError(_0x2c9fc4,null));};exports[_0x36f3('0x20')]=function(_0x941d43,_0x5d0b0e){if(_0x941d43[_0x36f3('0x47')]['id']){delete _0x941d43['body']['id'];}return db['Campaign'][_0x36f3('0x44')]({'where':{'id':_0x941d43[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d0b0e,null))[_0x36f3('0x24')](saveUpdates(_0x941d43[_0x36f3('0x47')],null))[_0x36f3('0x24')](respondWithResult(_0x5d0b0e,null))['catch'](handleError(_0x5d0b0e,null));};exports[_0x36f3('0x21')]=function(_0x2ec6c2,_0x241835){return db['Campaign']['find']({'where':{'id':_0x2ec6c2[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x241835,null))[_0x36f3('0x24')](removeEntity(_0x241835,null))[_0x36f3('0x45')](handleError(_0x241835,null));};exports[_0x36f3('0x54')]=function(_0x33cc89,_0x34be3b,_0x4be9a5){var _0x174ae6={'raw':!![],'where':{}};var _0x4560e3={};var _0x5bc385={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x33cc89[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x34be3b,null))[_0x36f3('0x24')](function(_0x317add){if(_0x317add){_0x4560e3[_0x36f3('0x2e')]=_['keys'](db[_0x36f3('0x56')][_0x36f3('0x2b')]);_0x4560e3['query']=_[_0x36f3('0x30')](_0x33cc89[_0x36f3('0x31')]);_0x4560e3[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x4560e3[_0x36f3('0x2e')],_0x4560e3[_0x36f3('0x31')]);_0x174ae6[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x4560e3['model'],qs['fields'](_0x33cc89['query']['fields']));_0x174ae6[_0x36f3('0x33')]=_0x174ae6[_0x36f3('0x33')][_0x36f3('0x35')]?_0x174ae6[_0x36f3('0x33')]:_0x4560e3[_0x36f3('0x2e')];if(!_0x33cc89[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x174ae6[_0x36f3('0x1a')]=qs['limit'](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x174ae6['offset']=qs[_0x36f3('0x1c')](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x174ae6[_0x36f3('0x37')]=qs['sort'](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x58')]);_0x174ae6['where']=qs['filters'](_[_0x36f3('0x59')](_0x33cc89[_0x36f3('0x31')],_0x4560e3[_0x36f3('0x39')]));_0x174ae6[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x317add['id'];if(_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x174ae6[_0x36f3('0x38')]=_[_0x36f3('0x3d')](_0x174ae6[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x174ae6['attributes'],function(_0x4a6ea8){var _0x36d33c={};_0x36d33c[_0x4a6ea8]={'$like':'%'+_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x36d33c;})});}_0x174ae6=_[_0x36f3('0x3d')]({},_0x174ae6,_0x33cc89[_0x36f3('0x3e')]);return db[_0x36f3('0x56')][_0x36f3('0x1b')]({'where':_0x174ae6[_0x36f3('0x38')]})[_0x36f3('0x24')](function(_0x4d0f72){_0x5bc385['count']=_0x4d0f72;if(_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x174ae6['include']=[{'all':!![]}];}return db[_0x36f3('0x56')][_0x36f3('0x41')](_0x174ae6);})['then'](function(_0x3dfbdc){_0x5bc385[_0x36f3('0x42')]=_0x3dfbdc;return _0x5bc385;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x34be3b,_0x174ae6))[_0x36f3('0x45')](handleError(_0x34be3b,null));};exports[_0x36f3('0x5b')]=function(_0x39fabe,_0x1b8f5e,_0x8ef369){var _0x1474f5={'raw':!![],'where':{}};var _0x503b6d={};var _0x17fe21={'count':0x0,'rows':[]};return db['Campaign'][_0x36f3('0x55')]({'where':{'id':_0x39fabe['params']['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x1b8f5e,null))[_0x36f3('0x24')](function(_0x4694be){if(_0x4694be){_0x503b6d[_0x36f3('0x2e')]=_['keys'](db[_0x36f3('0x5c')][_0x36f3('0x2b')]);_0x503b6d[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x39fabe[_0x36f3('0x31')]);_0x503b6d[_0x36f3('0x39')]=_['intersection'](_0x503b6d[_0x36f3('0x2e')],_0x503b6d[_0x36f3('0x31')]);_0x1474f5['attributes']=_[_0x36f3('0x32')](_0x503b6d[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x39fabe[_0x36f3('0x31')]['fields']));_0x1474f5['attributes']=_0x1474f5[_0x36f3('0x33')]['length']?_0x1474f5[_0x36f3('0x33')]:_0x503b6d[_0x36f3('0x2e')];if(!_0x39fabe['query'][_0x36f3('0x36')](_0x36f3('0x57'))){_0x1474f5[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x1474f5[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x1474f5[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x58')]);_0x1474f5[_0x36f3('0x38')]=qs['filters'](_[_0x36f3('0x59')](_0x39fabe[_0x36f3('0x31')],_0x503b6d[_0x36f3('0x39')]));_0x1474f5[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x4694be['id'];if(_0x39fabe[_0x36f3('0x31')]['filter']){_0x1474f5['where']=_['merge'](_0x1474f5[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x1474f5[_0x36f3('0x33')],function(_0x36fd5b){var _0x5d23d3={};_0x5d23d3[_0x36fd5b]={'$like':'%'+_0x39fabe['query'][_0x36f3('0x3c')]+'%'};return _0x5d23d3;})});}_0x1474f5=_[_0x36f3('0x3d')]({},_0x1474f5,_0x39fabe[_0x36f3('0x3e')]);return db[_0x36f3('0x5c')][_0x36f3('0x1b')]({'where':_0x1474f5['where']})['then'](function(_0x4f45c9){_0x17fe21[_0x36f3('0x1b')]=_0x4f45c9;if(_0x39fabe[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x1474f5[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x5c')][_0x36f3('0x41')](_0x1474f5);})[_0x36f3('0x24')](function(_0x46e556){_0x17fe21[_0x36f3('0x42')]=_0x46e556;return _0x17fe21;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x1b8f5e,_0x1474f5))[_0x36f3('0x45')](handleError(_0x1b8f5e,null));};exports[_0x36f3('0x5d')]=function(_0x55d724,_0x5c255e,_0x5a44bd){var _0x39a41e={'raw':!![],'where':{}};var _0x2fcdae={};var _0x24ff28={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')]['findOne']({'where':{'id':_0x55d724[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c255e,null))['then'](function(_0x40bc98){if(_0x40bc98){_0x2fcdae[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db['CmHopperFinal'][_0x36f3('0x2b')]);_0x2fcdae[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x55d724[_0x36f3('0x31')]);_0x2fcdae['filters']=_[_0x36f3('0x32')](_0x2fcdae[_0x36f3('0x2e')],_0x2fcdae[_0x36f3('0x31')]);_0x39a41e[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x2fcdae[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x55d724[_0x36f3('0x31')][_0x36f3('0x34')]));_0x39a41e[_0x36f3('0x33')]=_0x39a41e['attributes']['length']?_0x39a41e['attributes']:_0x2fcdae['model'];if(!_0x55d724[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x39a41e[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x55d724[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x39a41e[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x55d724[_0x36f3('0x31')]['offset']);}_0x39a41e[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x55d724['query']['sort']);_0x39a41e[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x55d724[_0x36f3('0x31')],_0x2fcdae['filters']));_0x39a41e[_0x36f3('0x38')]['CampaignId']=_0x40bc98['id'];if(_0x55d724[_0x36f3('0x31')]['filter']){_0x39a41e[_0x36f3('0x38')]=_['merge'](_0x39a41e[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x39a41e[_0x36f3('0x33')],function(_0x54e90a){var _0x3f3fe7={};_0x3f3fe7[_0x54e90a]={'$like':'%'+_0x55d724[_0x36f3('0x31')]['filter']+'%'};return _0x3f3fe7;})});}_0x39a41e=_[_0x36f3('0x3d')]({},_0x39a41e,_0x55d724[_0x36f3('0x3e')]);return db[_0x36f3('0x5e')][_0x36f3('0x1b')]({'where':_0x39a41e[_0x36f3('0x38')]})[_0x36f3('0x24')](function(_0x2c819a){_0x24ff28[_0x36f3('0x1b')]=_0x2c819a;if(_0x55d724[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x39a41e[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x5e')]['findAll'](_0x39a41e);})[_0x36f3('0x24')](function(_0x49e7d3){_0x24ff28[_0x36f3('0x42')]=_0x49e7d3;return _0x24ff28;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x5c255e,_0x39a41e))[_0x36f3('0x45')](handleError(_0x5c255e,null));};exports[_0x36f3('0x5f')]=function(_0x4b3574,_0x517773,_0x2d8f99){var _0x2c5690={'raw':!![],'where':{}};var _0x81dad4={};var _0x1dd6fd={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x4b3574[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x517773,null))[_0x36f3('0x24')](function(_0x235ecb){if(_0x235ecb){_0x81dad4[_0x36f3('0x2e')]=_['keys'](db['CmHopperBlack'][_0x36f3('0x2b')]);_0x81dad4[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x4b3574['query']);_0x81dad4[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x81dad4['model'],_0x81dad4[_0x36f3('0x31')]);_0x2c5690['attributes']=_[_0x36f3('0x32')](_0x81dad4[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x34')]));_0x2c5690[_0x36f3('0x33')]=_0x2c5690[_0x36f3('0x33')]['length']?_0x2c5690[_0x36f3('0x33')]:_0x81dad4['model'];if(!_0x4b3574[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x2c5690[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x2c5690[_0x36f3('0x1c')]=qs['offset'](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x2c5690[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x4b3574[_0x36f3('0x31')]['sort']);_0x2c5690[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x4b3574[_0x36f3('0x31')],_0x81dad4[_0x36f3('0x39')]));_0x2c5690[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x235ecb['id'];if(_0x4b3574[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x2c5690['where']=_[_0x36f3('0x3d')](_0x2c5690[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x2c5690[_0x36f3('0x33')],function(_0x36e606){var _0x5e88ce={};_0x5e88ce[_0x36e606]={'$like':'%'+_0x4b3574['query'][_0x36f3('0x3c')]+'%'};return _0x5e88ce;})});}_0x2c5690=_[_0x36f3('0x3d')]({},_0x2c5690,_0x4b3574[_0x36f3('0x3e')]);return db[_0x36f3('0x60')]['count']({'where':_0x2c5690['where']})['then'](function(_0x3ff4c6){_0x1dd6fd[_0x36f3('0x1b')]=_0x3ff4c6;if(_0x4b3574[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x2c5690[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x60')][_0x36f3('0x41')](_0x2c5690);})[_0x36f3('0x24')](function(_0x3ea5d8){_0x1dd6fd['rows']=_0x3ea5d8;return _0x1dd6fd;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x517773,_0x2c5690))[_0x36f3('0x45')](handleError(_0x517773,null));};exports[_0x36f3('0x61')]=function(_0x3a5b6b,_0x484f8f,_0x4bc023){var _0x57b113={};var _0x6561e0={};var _0x23f36a;var _0x6d9551;return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x3a5b6b[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x484f8f,null))[_0x36f3('0x24')](function(_0x4af77b){if(_0x4af77b){_0x23f36a=_0x4af77b;_0x6561e0[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db[_0x36f3('0x62')][_0x36f3('0x2b')]);_0x6561e0[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x3a5b6b[_0x36f3('0x31')]);_0x6561e0['filters']=_[_0x36f3('0x32')](_0x6561e0[_0x36f3('0x2e')],_0x6561e0[_0x36f3('0x31')]);_0x57b113[_0x36f3('0x33')]=_['intersection'](_0x6561e0[_0x36f3('0x2e')],qs['fields'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x34')]));_0x57b113['attributes']=_0x57b113['attributes'][_0x36f3('0x35')]?_0x57b113[_0x36f3('0x33')]:_0x6561e0[_0x36f3('0x2e')];_0x57b113['order']=qs['sort'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x58')]);_0x57b113[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x3a5b6b[_0x36f3('0x31')],_0x6561e0[_0x36f3('0x39')]));if(_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x57b113['where']=_[_0x36f3('0x3d')](_0x57b113[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x57b113[_0x36f3('0x33')],function(_0x146f03){var _0x3a3704={};_0x3a3704[_0x146f03]={'$like':'%'+_0x3a5b6b[_0x36f3('0x31')]['filter']+'%'};return _0x3a3704;})});}_0x57b113=_[_0x36f3('0x3d')]({},_0x57b113,_0x3a5b6b[_0x36f3('0x3e')]);return _0x23f36a[_0x36f3('0x61')](_0x57b113);}})[_0x36f3('0x24')](function(_0xedb9e4){if(_0xedb9e4){_0x6d9551=_0xedb9e4[_0x36f3('0x35')];if(!_0x3a5b6b['query']['hasOwnProperty'](_0x36f3('0x57'))){_0x57b113[_0x36f3('0x1a')]=qs['limit'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x57b113[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x3a5b6b['query'][_0x36f3('0x1c')]);}return _0x23f36a[_0x36f3('0x61')](_0x57b113);}})[_0x36f3('0x24')](function(_0x1197bd){if(_0x1197bd){return _0x1197bd?{'count':_0x6d9551,'rows':_0x1197bd}:null;}})['then'](respondWithResult(_0x484f8f,null))[_0x36f3('0x45')](handleError(_0x484f8f,null));};exports[_0x36f3('0x63')]=function(_0x4954ad,_0x473210,_0x44f758){var _0x46c91b,_0x51e520;var _0xc2a3af=[];var _0x2b1ede=moment()[_0x36f3('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x4954ad[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x473210,null))[_0x36f3('0x24')](function(_0x44f7bf){if(_0x44f7bf){_0x51e520=_0x44f7bf;return _0x44f7bf['addLists'](_0x4954ad['body'][_0x36f3('0x65')],_[_0x36f3('0x4e')](_0x4954ad[_0x36f3('0x47')],[_0x36f3('0x65'),'id'])||{});}return null;})[_0x36f3('0x66')](function(_0x1bbef0){var _0xfc72b;var _0x15fe57;_0x46c91b=_0x1bbef0||[];var _0x5e2954=[];if(_0x1bbef0){for(var _0x91c233=0x0;_0x91c233<_0x1bbef0[_0x36f3('0x35')];_0x91c233+=0x1){var _0x59d425=_0x1bbef0[_0x91c233][_0x36f3('0x22')]({'plain':!![]});_0x51e520['dialCheckDuplicateType']=_0x4954ad[_0x36f3('0x47')][_0x36f3('0x67')]?_0x4954ad[_0x36f3('0x47')][_0x36f3('0x67')]:_0x51e520[_0x36f3('0x67')];switch(_0x51e520[_0x36f3('0x67')]){case _0x36f3('0x68'):_0xfc72b=squel['insert']()[_0x36f3('0x69')](_0x36f3('0x6a'))[_0x36f3('0x6b')]([_0x36f3('0x6c'),_0x36f3('0x6d'),_0x36f3('0x6e'),_0x36f3('0x6f'),'CampaignId',_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x6c'),_0x36f3('0x6c'))['field']('NOW()',_0x36f3('0x6d'))[_0x36f3('0x71')]('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425['CmListId'][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad['params']['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))['where'](_0x36f3('0x75'))[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')]['toString']())[_0x36f3('0x38')](_0x36f3('0x78'))[_0x36f3('0x38')](_0x36f3('0x79'),squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x7a'))[_0x36f3('0x73')]('cm_hopper_final')[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]()))['where'](_0x36f3('0x79'),squel[_0x36f3('0x70')]()[_0x36f3('0x71')]('COALESCE(phone,\x27\x27)')[_0x36f3('0x73')]('cm_hopper')[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]())))['toString']();break;case _0x36f3('0x7c'):_0xfc72b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')]('cm_hopper')[_0x36f3('0x6b')]([_0x36f3('0x6c'),_0x36f3('0x6d'),_0x36f3('0x6e'),_0x36f3('0x6f'),'CampaignId','createdAt',_0x36f3('0x50')],squel['select']()['field'](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')](_0x36f3('0x7e'),'scheduledAt')[_0x36f3('0x71')]('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad[_0x36f3('0x43')]['id']['toString'](),_0x36f3('0x5a'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27','updatedAt')['from'](_0x36f3('0x74'))[_0x36f3('0x38')](_0x36f3('0x75'))[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())[_0x36f3('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x36f3('0x38')](_0x36f3('0x79'),squel[_0x36f3('0x70')]()['field'](_0x36f3('0x7f'))[_0x36f3('0x73')](_0x36f3('0x6a'))[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad['params']['id'][_0x36f3('0x72')]())))['toString']();break;default:_0xfc72b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')]('cm_hopper')['fromQuery'](['phone',_0x36f3('0x6d'),'ContactId',_0x36f3('0x6f'),'CampaignId',_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')](_0x36f3('0x7e'),_0x36f3('0x6d'))['field']('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425['CmListId'][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))['field']('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))[_0x36f3('0x38')]('deletedAt\x20IS\x20NULL')[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())['where'](_0x36f3('0x78')))[_0x36f3('0x72')]();}_0x15fe57=squel['insert']()[_0x36f3('0x69')](_0x36f3('0x80'))['fromQuery']([_0x36f3('0x81'),_0x36f3('0x6d'),_0x36f3('0x6c'),_0x36f3('0x82'),_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()['field'](_0x36f3('0x83'),'id')[_0x36f3('0x71')]('NOW()',_0x36f3('0x6d'))['field'](_0x36f3('0x84'),_0x36f3('0x6c'))['field'](_0x36f3('0x85'),_0x36f3('0x82'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27','createdAt')[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x86'),'ci')[_0x36f3('0x87')](_0x36f3('0x6a'),'h',_0x36f3('0x88'))[_0x36f3('0x38')](_0x36f3('0x89'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())[_0x36f3('0x38')](_0x36f3('0x8a'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]())[_0x36f3('0x38')](_0x36f3('0x8b'),_0x2b1ede))[_0x36f3('0x72')]();_0x5e2954[_0x36f3('0x8c')](db[_0x36f3('0x8d')][_0x36f3('0x31')](_0xfc72b));_0xc2a3af['push'](db[_0x36f3('0x8d')]['query'](_0x15fe57));}return BPromise['all'](_0x5e2954);}})['then'](function(){return BPromise[_0x36f3('0x8e')](_0xc2a3af);})[_0x36f3('0x24')](function(){return _0x46c91b;})[_0x36f3('0x24')](respondWithResult(_0x473210,null))[_0x36f3('0x45')](handleError(_0x473210,null));};exports[_0x36f3('0x8f')]=function(_0x1bc0a0,_0x3892d0,_0x14e89c){return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x1bc0a0[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3892d0,null))[_0x36f3('0x24')](function(_0x351135){if(_0x351135){return _0x351135['removeLists'](_0x1bc0a0[_0x36f3('0x31')][_0x36f3('0x65')]);}})[_0x36f3('0x24')](function(_0x568d03){if(_0x568d03){return db[_0x36f3('0x56')][_0x36f3('0x21')]({'where':{'ListId':_0x1bc0a0[_0x36f3('0x31')][_0x36f3('0x65')],'CampaignId':_0x1bc0a0[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](function(){return _0x568d03;});}})[_0x36f3('0x24')](respondWithStatusCode(_0x3892d0,null))[_0x36f3('0x45')](handleError(_0x3892d0,null));};exports['getBlackLists']=function(_0x126c2b,_0x19df44,_0x268db3){var _0xb907ef={};var _0xd6df25={};var _0x2971e7;var _0x44b358;return db['Campaign'][_0x36f3('0x55')]({'where':{'id':_0x126c2b[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x19df44,null))[_0x36f3('0x24')](function(_0x511987){if(_0x511987){_0x2971e7=_0x511987;_0xd6df25['model']=_[_0x36f3('0x30')](db['CmList']['rawAttributes']);_0xd6df25['query']=_[_0x36f3('0x30')](_0x126c2b[_0x36f3('0x31')]);_0xd6df25[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0xd6df25[_0x36f3('0x2e')],_0xd6df25[_0x36f3('0x31')]);_0xb907ef[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0xd6df25[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x126c2b[_0x36f3('0x31')][_0x36f3('0x34')]));_0xb907ef['attributes']=_0xb907ef['attributes']['length']?_0xb907ef['attributes']:_0xd6df25['model'];_0xb907ef[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x126c2b['query'][_0x36f3('0x58')]);_0xb907ef['where']=qs['filters'](_['pick'](_0x126c2b[_0x36f3('0x31')],_0xd6df25['filters']));if(_0x126c2b[_0x36f3('0x31')][_0x36f3('0x3c')]){_0xb907ef[_0x36f3('0x38')]=_[_0x36f3('0x3d')](_0xb907ef['where'],{'$or':_[_0x36f3('0x29')](_0xb907ef[_0x36f3('0x33')],function(_0x3099bb){var _0x5cdad1={};_0x5cdad1[_0x3099bb]={'$like':'%'+_0x126c2b[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x5cdad1;})});}_0xb907ef=_['merge']({},_0xb907ef,_0x126c2b[_0x36f3('0x3e')]);return _0x2971e7['getBlackLists'](_0xb907ef);}})[_0x36f3('0x24')](function(_0x45b91c){if(_0x45b91c){_0x44b358=_0x45b91c[_0x36f3('0x35')];if(!_0x126c2b[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0xb907ef[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x126c2b['query'][_0x36f3('0x1a')]);_0xb907ef['offset']=qs[_0x36f3('0x1c')](_0x126c2b[_0x36f3('0x31')]['offset']);}return _0x2971e7[_0x36f3('0x90')](_0xb907ef);}})[_0x36f3('0x24')](function(_0x365b97){if(_0x365b97){return _0x365b97?{'count':_0x44b358,'rows':_0x365b97}:null;}})['then'](respondWithResult(_0x19df44,null))[_0x36f3('0x45')](handleError(_0x19df44,null));};exports[_0x36f3('0x91')]=function(_0x377efa,_0x59671a,_0x1f7cdb){var _0x240087,_0x5dadfc;var _0x399e66=[];var _0x229222=moment()['format'](_0x36f3('0x92'));return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x377efa['params']['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x59671a,null))['then'](function(_0xe7250b){if(_0xe7250b){_0x5dadfc=_0xe7250b;return _0xe7250b['addBlackLists'](_0x377efa[_0x36f3('0x47')]['ids'],_[_0x36f3('0x4e')](_0x377efa[_0x36f3('0x47')],[_0x36f3('0x65'),'id'])||{});}return null;})[_0x36f3('0x66')](function(_0x5aae79){var _0xd6f65b;var _0xcee22d;_0x240087=_0x5aae79||[];var _0x1c983c=[];if(_0x5aae79){for(var _0x2c81b9=0x0;_0x2c81b9<_0x5aae79[_0x36f3('0x35')];_0x2c81b9+=0x1){var _0xc31b5=_0x5aae79[_0x2c81b9][_0x36f3('0x22')]({'plain':!![]});_0xd6f65b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')](_0x36f3('0x93'))['fromQuery']([_0x36f3('0x6c'),'ContactId',_0x36f3('0x6f'),_0x36f3('0x5a'),_0x36f3('0x4f'),'updatedAt'],squel[_0x36f3('0x70')]()['field'](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')]('id','ContactId')[_0x36f3('0x71')](_0xc31b5[_0x36f3('0x77')][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x377efa[_0x36f3('0x43')]['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))[_0x36f3('0x71')]('NOW()',_0x36f3('0x4f'))[_0x36f3('0x71')](_0x36f3('0x7e'),_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))[_0x36f3('0x38')]('deletedAt\x20IS\x20NULL')[_0x36f3('0x38')](_0x36f3('0x76'),_0xc31b5[_0x36f3('0x77')][_0x36f3('0x72')]())['where'](_0x36f3('0x78')))[_0x36f3('0x72')]();_0x1c983c['push'](db['sequelize'][_0x36f3('0x31')](_0xd6f65b));}return BPromise[_0x36f3('0x8e')](_0x1c983c);}})['then'](function(){return _0x240087;})[_0x36f3('0x24')](respondWithResult(_0x59671a,null))[_0x36f3('0x45')](handleError(_0x59671a,null));};exports[_0x36f3('0x94')]=function(_0x18e14c,_0x12d654,_0xfdedbc){return db['Campaign'][_0x36f3('0x44')]({'where':{'id':_0x18e14c[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x12d654,null))['then'](function(_0x225fcf){if(_0x225fcf){return _0x225fcf[_0x36f3('0x94')](_0x18e14c[_0x36f3('0x31')][_0x36f3('0x65')]);}})[_0x36f3('0x24')](function(_0x5eb44d){if(_0x5eb44d){return db[_0x36f3('0x60')]['destroy']({'where':{'ListId':_0x18e14c[_0x36f3('0x31')][_0x36f3('0x65')],'CampaignId':_0x18e14c['params']['id']}})['then'](function(){return _0x5eb44d;});}})[_0x36f3('0x24')](respondWithStatusCode(_0x12d654,null))['catch'](handleError(_0x12d654,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 78f4839..ce3418d 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4d1f59,_0x4483ec){var _0x468441=function(_0x183185){while(--_0x183185){_0x4d1f59['push'](_0x4d1f59['shift']());}};_0x468441(++_0x4483ec);}(_0x7a54,0x106));var _0x47a5=function(_0x412a12,_0x430906){_0x412a12=_0x412a12-0x0;var _0x18946e=_0x7a54[_0x412a12];return _0x18946e;};'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 353969b..c8ed0f3 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 _0x37b4=['stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','options','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','request\x20sent'];(function(_0x3cf68c,_0x32feab){var _0x741a2c=function(_0x108349){while(--_0x108349){_0x3cf68c['push'](_0x3cf68c['shift']());}};_0x741a2c(++_0x32feab);}(_0x37b4,0xef));var _0x437b=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0x37b4[_0x12833b];return _0x3acad3;};'use strict';var _=require(_0x437b('0x0'));var util=require('util');var moment=require(_0x437b('0x1'));var BPromise=require(_0x437b('0x2'));var rs=require(_0x437b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x437b('0x4'))['db'];var utils=require(_0x437b('0x5'));var logger=require(_0x437b('0x6'))(_0x437b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x437b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c7dea,_0x4aada7,_0x226e3c){return new BPromise(function(_0x5df980,_0x432b63){return client['request'](_0x3c7dea,_0x226e3c)['then'](function(_0x44bf1d){logger[_0x437b('0x9')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'),JSON[_0x437b('0xb')](_0x44bf1d));if(_0x44bf1d[_0x437b('0xc')]){if(_0x44bf1d[_0x437b('0xc')]['code']===0x1f4){logger[_0x437b('0xc')](_0x437b('0xd'),_0x4aada7,_0x44bf1d[_0x437b('0xc')]['message']);return _0x432b63(_0x44bf1d[_0x437b('0xc')][_0x437b('0xe')]);}logger[_0x437b('0xc')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x44bf1d[_0x437b('0xc')]['message']);return _0x5df980(_0x44bf1d[_0x437b('0xc')][_0x437b('0xe')]);}else{logger[_0x437b('0x9')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'));_0x5df980(_0x44bf1d[_0x437b('0xf')][_0x437b('0xe')]);}})[_0x437b('0x10')](function(_0x1d31af){logger[_0x437b('0xc')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x1d31af);_0x432b63(_0x1d31af);});});}exports[_0x437b('0x11')]=function(_0x501d8c){var _0x2b3994=this;return new Promise(function(_0x107024,_0x1c91bc){return db[_0x437b('0x12')]['findAll']({'raw':_0x501d8c['options']?_0x501d8c['options']['raw']===undefined?!![]:![]:!![],'where':_0x501d8c[_0x437b('0x13')]?_0x501d8c[_0x437b('0x13')]['where']||null:null,'attributes':_0x501d8c[_0x437b('0x13')]?_0x501d8c['options'][_0x437b('0x14')]||null:null,'limit':_0x501d8c[_0x437b('0x13')]?_0x501d8c[_0x437b('0x13')]['limit']||null:null,'include':_0x501d8c['options']?_0x501d8c['options'][_0x437b('0x15')]?_[_0x437b('0x16')](_0x501d8c[_0x437b('0x13')][_0x437b('0x15')],function(_0x8c5852){return{'model':db[_0x8c5852[_0x437b('0x17')]],'as':_0x8c5852['as'],'attributes':_0x8c5852[_0x437b('0x14')],'include':_0x8c5852[_0x437b('0x15')]?_[_0x437b('0x16')](_0x8c5852[_0x437b('0x15')],function(_0x258198){return{'model':db[_0x258198['model']],'as':_0x258198['as'],'attributes':_0x258198[_0x437b('0x14')],'include':_0x258198[_0x437b('0x15')]?_[_0x437b('0x16')](_0x258198[_0x437b('0x15')],function(_0x17092c){return{'model':db[_0x17092c['model']],'as':_0x17092c['as'],'attributes':_0x17092c[_0x437b('0x14')]};}):[]};}):[]};}):[]:[]})[_0x437b('0x18')](function(_0x4a7d0b){logger[_0x437b('0x9')]('GetCampaign',_0x501d8c);logger['debug']('GetCampaign',_0x501d8c,JSON[_0x437b('0xb')](_0x4a7d0b));_0x107024(_0x4a7d0b);})['catch'](function(_0x37a3d7){logger[_0x437b('0xc')](_0x437b('0x11'),_0x37a3d7['message'],_0x501d8c);_0x1c91bc(_0x2b3994['error'](0x1f4,_0x37a3d7[_0x437b('0xe')]));});});};
\ No newline at end of file
+var _0x7119=['limit','include','model','map','GetCampaign','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Campaign','options','raw','attributes'];(function(_0x592007,_0x522e94){var _0x2c8434=function(_0x2e98c1){while(--_0x2e98c1){_0x592007['push'](_0x592007['shift']());}};_0x2c8434(++_0x522e94);}(_0x7119,0x1c7));var _0x9711=function(_0x64a51,_0x1c61b7){_0x64a51=_0x64a51-0x0;var _0x1eba45=_0x7119[_0x64a51];return _0x1eba45;};'use strict';var _=require('lodash');var util=require(_0x9711('0x0'));var moment=require('moment');var BPromise=require(_0x9711('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9711('0x2'));var db=require(_0x9711('0x3'))['db'];var utils=require(_0x9711('0x4'));var logger=require(_0x9711('0x5'))('rpc');var config=require(_0x9711('0x6'));var jayson=require(_0x9711('0x7'));var client=jayson[_0x9711('0x8')][_0x9711('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191701,_0x4c75dd,_0x31af88){return new BPromise(function(_0x3a5f79,_0x132b5b){return client['request'](_0x191701,_0x31af88)[_0x9711('0xa')](function(_0x4b13b9){logger[_0x9711('0xb')](_0x9711('0xc'),_0x4c75dd,_0x9711('0xd'));logger['debug'](_0x9711('0xe'),_0x4c75dd,_0x9711('0xd'),JSON[_0x9711('0xf')](_0x4b13b9));if(_0x4b13b9[_0x9711('0x10')]){if(_0x4b13b9[_0x9711('0x10')][_0x9711('0x11')]===0x1f4){logger[_0x9711('0x10')](_0x9711('0xc'),_0x4c75dd,_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);return _0x132b5b(_0x4b13b9[_0x9711('0x10')]['message']);}logger['error'](_0x9711('0xc'),_0x4c75dd,_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);return _0x3a5f79(_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);}else{logger['info'](_0x9711('0xc'),_0x4c75dd,'request\x20sent');_0x3a5f79(_0x4b13b9[_0x9711('0x13')][_0x9711('0x12')]);}})[_0x9711('0x14')](function(_0x640894){logger[_0x9711('0x10')]('Campaign,\x20%s,\x20%s',_0x4c75dd,_0x640894);_0x132b5b(_0x640894);});});}exports['GetCampaign']=function(_0x2ef16c){var _0x3615c9=this;return new Promise(function(_0x210f8b,_0x4629e2){return db[_0x9711('0x15')]['findAll']({'raw':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c[_0x9711('0x16')][_0x9711('0x17')]===undefined?!![]:![]:!![],'where':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options']['where']||null:null,'attributes':_0x2ef16c['options']?_0x2ef16c[_0x9711('0x16')][_0x9711('0x18')]||null:null,'limit':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options'][_0x9711('0x19')]||null:null,'include':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options'][_0x9711('0x1a')]?_['map'](_0x2ef16c[_0x9711('0x16')]['include'],function(_0x3023cf){return{'model':db[_0x3023cf[_0x9711('0x1b')]],'as':_0x3023cf['as'],'attributes':_0x3023cf['attributes'],'include':_0x3023cf[_0x9711('0x1a')]?_[_0x9711('0x1c')](_0x3023cf[_0x9711('0x1a')],function(_0x2db327){return{'model':db[_0x2db327['model']],'as':_0x2db327['as'],'attributes':_0x2db327['attributes'],'include':_0x2db327[_0x9711('0x1a')]?_[_0x9711('0x1c')](_0x2db327['include'],function(_0x4d16e5){return{'model':db[_0x4d16e5['model']],'as':_0x4d16e5['as'],'attributes':_0x4d16e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x9711('0xa')](function(_0x270da2){logger['info'](_0x9711('0x1d'),_0x2ef16c);logger['debug'](_0x9711('0x1d'),_0x2ef16c,JSON[_0x9711('0xf')](_0x270da2));_0x210f8b(_0x270da2);})['catch'](function(_0x3fc5bb){logger[_0x9711('0x10')](_0x9711('0x1d'),_0x3fc5bb[_0x9711('0x12')],_0x2ef16c);_0x4629e2(_0x3615c9['error'](0x1f4,_0x3fc5bb[_0x9711('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 370caae..080bc7a 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 _0x8f2e=['put','update','delete','destroy','removeLists','removeBlackLists','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists'];(function(_0x25b606,_0x25d3b2){var _0x148b67=function(_0x5b7d74){while(--_0x5b7d74){_0x25b606['push'](_0x25b606['shift']());}};_0x148b67(++_0x25d3b2);}(_0x8f2e,0xb0));var _0xe8f2=function(_0x46ba64,_0x55b3e7){_0x46ba64=_0x46ba64-0x0;var _0x2f6edb=_0x8f2e[_0x46ba64];return _0x2f6edb;};'use strict';var multer=require(_0xe8f2('0x0'));var util=require('util');var path=require(_0xe8f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8f2('0x2'));var router=express[_0xe8f2('0x3')]();var fs_extra=require(_0xe8f2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe8f2('0x5'));var config=require(_0xe8f2('0x6'));var controller=require(_0xe8f2('0x7'));router[_0xe8f2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe8f2('0x9'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0xb')]);router[_0xe8f2('0x8')](_0xe8f2('0xc'),auth['isAuthenticated'](),controller[_0xe8f2('0xd')]);router[_0xe8f2('0x8')](_0xe8f2('0xe'),auth['isAuthenticated'](),controller[_0xe8f2('0xf')]);router['get'](_0xe8f2('0x10'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x11')]);router['get'](_0xe8f2('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xe8f2('0x8')](_0xe8f2('0x13'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x14')]);router[_0xe8f2('0x8')](_0xe8f2('0x15'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x16')]);router[_0xe8f2('0x17')]('/',auth['isAuthenticated'](),controller[_0xe8f2('0x18')]);router[_0xe8f2('0x17')](_0xe8f2('0x19'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x1a')]);router['post']('/:id/lists',auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x1b')]);router[_0xe8f2('0x17')](_0xe8f2('0x15'),auth[_0xe8f2('0xa')](),controller['addBlackLists']);router[_0xe8f2('0x1c')](_0xe8f2('0x9'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x1d')]);router[_0xe8f2('0x1e')](_0xe8f2('0x9'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x1f')]);router[_0xe8f2('0x1e')](_0xe8f2('0x13'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x20')]);router[_0xe8f2('0x1e')]('/:id/blacklists',auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0xb7ef=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','post','create','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router'];(function(_0x157db1,_0x5652bf){var _0x169249=function(_0x463401){while(--_0x463401){_0x157db1['push'](_0x157db1['shift']());}};_0x169249(++_0x5652bf);}(_0xb7ef,0x1ac));var _0xfb7e=function(_0x3717a9,_0x17f9bc){_0x3717a9=_0x3717a9-0x0;var _0x485b85=_0xb7ef[_0x3717a9];return _0x485b85;};'use strict';var multer=require(_0xfb7e('0x0'));var util=require(_0xfb7e('0x1'));var path=require(_0xfb7e('0x2'));var timeout=require(_0xfb7e('0x3'));var express=require(_0xfb7e('0x4'));var router=express[_0xfb7e('0x5')]();var fs_extra=require(_0xfb7e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfb7e('0x7'));var config=require(_0xfb7e('0x8'));var controller=require('./campaign.controller');router[_0xfb7e('0x9')]('/',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0xb')]);router[_0xfb7e('0x9')](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller['show']);router[_0xfb7e('0x9')](_0xfb7e('0xd'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0xe')]);router[_0xfb7e('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xfb7e('0xf')]);router[_0xfb7e('0x9')](_0xfb7e('0x10'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x11')]);router['get']('/:id/hopper_black',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x12')]);router[_0xfb7e('0x9')]('/:id/lists',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x13')]);router[_0xfb7e('0x9')]('/:id/blacklists',auth[_0xfb7e('0xa')](),controller['getBlackLists']);router[_0xfb7e('0x14')]('/',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x15')]);router[_0xfb7e('0x14')](_0xfb7e('0x16'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x17')]);router[_0xfb7e('0x14')](_0xfb7e('0x18'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x19')]);router[_0xfb7e('0x14')](_0xfb7e('0x1a'),auth[_0xfb7e('0xa')](),controller['addBlackLists']);router['put'](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller['update']);router[_0xfb7e('0x1b')](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1c')]);router[_0xfb7e('0x1b')](_0xfb7e('0x18'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1d')]);router['delete'](_0xfb7e('0x1a'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1e')]);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 d0370e9..492a4bb 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 _0x422d=['key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0xc898bb,_0x51b13a){var _0x2b8ca6=function(_0x5b3ecf){while(--_0x5b3ecf){_0xc898bb['push'](_0xc898bb['shift']());}};_0x2b8ca6(++_0x51b13a);}(_0x422d,0x18d));var _0xd422=function(_0x18a0da,_0x8cb375){_0x18a0da=_0x18a0da-0x0;var _0x3cf6b8=_0x422d[_0x18a0da];return _0x3cf6b8;};'use strict';var Sequelize=require(_0xd422('0x0'));module[_0xd422('0x1')]={'key':{'type':Sequelize[_0xd422('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd422('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0xd422('0x2')]},'name':{'type':Sequelize[_0xd422('0x4')],'get':function(){return this['getDataValue'](_0xd422('0x5'));}}};
\ No newline at end of file
+var _0x6248=['STRING','VIRTUAL','key','sequelize','TEXT','medium'];(function(_0x598f75,_0x318fbe){var _0x2351c1=function(_0x12f0b0){while(--_0x12f0b0){_0x598f75['push'](_0x598f75['shift']());}};_0x2351c1(++_0x318fbe);}(_0x6248,0x10b));var _0x8624=function(_0x562eca,_0x3fa3b3){_0x562eca=_0x562eca-0x0;var _0x189dc3=_0x6248[_0x562eca];return _0x189dc3;};'use strict';var Sequelize=require(_0x8624('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8624('0x1')],'length':_0x8624('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8624('0x3')]},'name':{'type':Sequelize[_0x8624('0x4')],'get':function(){return this['getDataValue'](_0x8624('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 56cf2c3..9777d53 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 _0x2671=['filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','limit','undefined','offset','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','type','key','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2671,0x165));var _0x1267=function(_0x35b87c,_0x166a8c){_0x35b87c=_0x35b87c-0x0;var _0x24795b=_0x2671[_0x35b87c];return _0x24795b;};'use strict';var emlformat=require(_0x1267('0x0'));var rimraf=require(_0x1267('0x1'));var zipdir=require(_0x1267('0x2'));var jsonpatch=require(_0x1267('0x3'));var rp=require(_0x1267('0x4'));var moment=require(_0x1267('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1267('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1267('0x7'));var csv=require(_0x1267('0x8'));var ejs=require(_0x1267('0x9'));var fs=require('fs');var fs_extra=require(_0x1267('0xa'));var _=require('lodash');var squel=require(_0x1267('0xb'));var crypto=require(_0x1267('0xc'));var jsforce=require(_0x1267('0xd'));var deskjs=require(_0x1267('0xe'));var toCsv=require(_0x1267('0x8'));var querystring=require(_0x1267('0xf'));var Papa=require('papaparse');var Redis=require(_0x1267('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1267('0x11'));var hardwareService=require(_0x1267('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x1267('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68e727,_0x4936a9){_0x4936a9=_0x4936a9||0xcc;return function(_0x2a51b4){if(_0x2a51b4){return _0x68e727[_0x1267('0x14')](_0x4936a9);}return _0x68e727[_0x1267('0x15')](_0x4936a9)[_0x1267('0x16')]();};}function respondWithResult(_0x522cca,_0xf0b899){_0xf0b899=_0xf0b899||0xc8;return function(_0x36ccc1){if(_0x36ccc1){return _0x522cca[_0x1267('0x15')](_0xf0b899)[_0x1267('0x17')](_0x36ccc1);}};}function respondWithFilteredResult(_0x36d02e,_0x220815){return function(_0x366631){if(_0x366631){var _0x2b740f=typeof _0x220815['offset']==='undefined'&&typeof _0x220815[_0x1267('0x18')]===_0x1267('0x19');var _0x24bfb6=_0x366631['count'];var _0x2e33e9=_0x2b740f?0x0:_0x220815[_0x1267('0x1a')];var _0x20840f=_0x2b740f?_0x366631[_0x1267('0x1b')]:_0x220815['offset']+_0x220815[_0x1267('0x18')];var _0x1047ef;if(_0x20840f>=_0x24bfb6){_0x20840f=_0x24bfb6;_0x1047ef=0xc8;}else{_0x1047ef=0xce;}_0x36d02e['status'](_0x1047ef);return _0x36d02e[_0x1267('0x1c')]('Content-Range',_0x2e33e9+'-'+_0x20840f+'/'+_0x24bfb6)[_0x1267('0x17')](_0x366631);}return null;};}function patchUpdates(_0x27b4b7){return function(_0x520066){try{jsonpatch[_0x1267('0x1d')](_0x520066,_0x27b4b7,!![]);}catch(_0x3652dc){return BPromise[_0x1267('0x1e')](_0x3652dc);}return _0x520066[_0x1267('0x1f')]();};}function saveUpdates(_0x1928aa,_0x4862d4){return function(_0x5bf4cf){if(_0x5bf4cf){return _0x5bf4cf[_0x1267('0x20')](_0x1928aa)[_0x1267('0x21')](function(_0xcab624){return _0xcab624;});}return null;};}function removeEntity(_0x28f2e5,_0x51571f){return function(_0x4ff670){if(_0x4ff670){return _0x4ff670[_0x1267('0x22')]()[_0x1267('0x21')](function(){var _0x3f4729=_0x4ff670[_0x1267('0x23')]({'plain':!![]});var _0x502397='CannedAnswers';return db[_0x1267('0x24')]['destroy']({'where':{'type':_0x502397,'resourceId':_0x3f4729['id']}})[_0x1267('0x21')](function(){return _0x4ff670;});})[_0x1267('0x21')](function(){_0x28f2e5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4286,_0x2040d3){return function(_0x1ee27b){if(!_0x1ee27b){_0x4b4286['sendStatus'](0x194);}return _0x1ee27b;};}function handleError(_0x5707c1,_0x1665a1){_0x1665a1=_0x1665a1||0x1f4;return function(_0x364ac6){logger[_0x1267('0x25')](_0x364ac6[_0x1267('0x26')]);if(_0x364ac6[_0x1267('0x27')]){delete _0x364ac6[_0x1267('0x27')];}_0x5707c1[_0x1267('0x15')](_0x1665a1)['send'](_0x364ac6);};}exports[_0x1267('0x28')]=function(_0x598853,_0x50b7e3){var _0x3ae431={},_0x1561f9={},_0x52ec9c={'count':0x0,'rows':[]};var _0x5df264=_[_0x1267('0x29')](db['CannedAnswer']['rawAttributes'],function(_0xc6411c){return{'name':_0xc6411c['fieldName'],'type':_0xc6411c[_0x1267('0x2a')][_0x1267('0x2b')]};});_0x1561f9['model']=_[_0x1267('0x29')](_0x5df264,'name');_0x1561f9[_0x1267('0x2c')]=_[_0x1267('0x2d')](_0x598853[_0x1267('0x2c')]);_0x1561f9[_0x1267('0x2e')]=_['intersection'](_0x1561f9['model'],_0x1561f9[_0x1267('0x2c')]);_0x3ae431[_0x1267('0x2f')]=_[_0x1267('0x30')](_0x1561f9['model'],qs[_0x1267('0x31')](_0x598853['query']['fields']));_0x3ae431[_0x1267('0x2f')]=_0x3ae431['attributes'][_0x1267('0x32')]?_0x3ae431['attributes']:_0x1561f9[_0x1267('0x33')];if(!_0x598853[_0x1267('0x2c')][_0x1267('0x34')](_0x1267('0x35'))){_0x3ae431[_0x1267('0x18')]=qs['limit'](_0x598853[_0x1267('0x2c')][_0x1267('0x18')]);_0x3ae431['offset']=qs[_0x1267('0x1a')](_0x598853[_0x1267('0x2c')]['offset']);}_0x3ae431[_0x1267('0x36')]=qs[_0x1267('0x37')](_0x598853[_0x1267('0x2c')]['sort']);_0x3ae431[_0x1267('0x38')]=qs[_0x1267('0x2e')](_[_0x1267('0x39')](_0x598853[_0x1267('0x2c')],_0x1561f9[_0x1267('0x2e')]),_0x5df264);if(_0x598853[_0x1267('0x2c')][_0x1267('0x3a')]){_0x3ae431[_0x1267('0x38')]=_['merge'](_0x3ae431[_0x1267('0x38')],{'$or':[{'key':{'$like':'%'+_0x598853[_0x1267('0x2c')][_0x1267('0x3a')]+'%'}},{'value':{'$like':'%'+_0x598853[_0x1267('0x2c')][_0x1267('0x3a')]+'%'}}]});}_0x3ae431=_[_0x1267('0x3b')]({},_0x3ae431,_0x598853[_0x1267('0x3c')]);var _0x367ec1={'where':_0x3ae431[_0x1267('0x38')]};return db[_0x1267('0x3d')][_0x1267('0x1b')](_0x367ec1)[_0x1267('0x21')](function(_0x1e11c4){_0x52ec9c[_0x1267('0x1b')]=_0x1e11c4;if(_0x598853[_0x1267('0x2c')][_0x1267('0x3e')]){_0x3ae431[_0x1267('0x3f')]=[{'all':!![]}];}return db[_0x1267('0x3d')][_0x1267('0x40')](_0x3ae431);})['then'](function(_0x66e9c){_0x52ec9c[_0x1267('0x41')]=_0x66e9c;return _0x52ec9c;})[_0x1267('0x21')](respondWithFilteredResult(_0x50b7e3,_0x3ae431))[_0x1267('0x42')](handleError(_0x50b7e3,null));};exports[_0x1267('0x43')]=function(_0xef9a7a,_0x398f9d){var _0x363dcf={'raw':!![],'where':{'id':_0xef9a7a[_0x1267('0x44')]['id']}},_0x2076d9={};_0x2076d9[_0x1267('0x33')]=_[_0x1267('0x2d')](db['CannedAnswer'][_0x1267('0x45')]);_0x2076d9[_0x1267('0x2c')]=_[_0x1267('0x2d')](_0xef9a7a[_0x1267('0x2c')]);_0x2076d9[_0x1267('0x2e')]=_[_0x1267('0x30')](_0x2076d9[_0x1267('0x33')],_0x2076d9[_0x1267('0x2c')]);_0x363dcf[_0x1267('0x2f')]=_[_0x1267('0x30')](_0x2076d9[_0x1267('0x33')],qs[_0x1267('0x31')](_0xef9a7a['query'][_0x1267('0x31')]));_0x363dcf['attributes']=_0x363dcf[_0x1267('0x2f')]['length']?_0x363dcf[_0x1267('0x2f')]:_0x2076d9[_0x1267('0x33')];if(_0xef9a7a[_0x1267('0x2c')][_0x1267('0x3e')]){_0x363dcf['include']=[{'all':!![]}];}_0x363dcf=_[_0x1267('0x3b')]({},_0x363dcf,_0xef9a7a[_0x1267('0x3c')]);return db[_0x1267('0x3d')][_0x1267('0x46')](_0x363dcf)[_0x1267('0x21')](handleEntityNotFound(_0x398f9d,null))[_0x1267('0x21')](respondWithResult(_0x398f9d,null))[_0x1267('0x42')](handleError(_0x398f9d,null));};exports['update']=function(_0x298058,_0x28c0dc){if(_0x298058[_0x1267('0x47')]['id']){delete _0x298058[_0x1267('0x47')]['id'];}return db[_0x1267('0x3d')]['find']({'where':{'id':_0x298058['params']['id']}})[_0x1267('0x21')](handleEntityNotFound(_0x28c0dc,null))[_0x1267('0x21')](saveUpdates(_0x298058[_0x1267('0x47')],null))[_0x1267('0x21')](respondWithResult(_0x28c0dc,null))[_0x1267('0x42')](handleError(_0x28c0dc,null));};exports[_0x1267('0x22')]=function(_0x45896b,_0xcc05d3){return db[_0x1267('0x3d')]['find']({'where':{'id':_0x45896b[_0x1267('0x44')]['id']}})['then'](handleEntityNotFound(_0xcc05d3,null))[_0x1267('0x21')](removeEntity(_0xcc05d3,null))['catch'](handleError(_0xcc05d3,null));};exports[_0x1267('0x48')]=function(_0x25a580,_0xde7b88){var _0x24fb5b={'key':_0x25a580[_0x1267('0x47')][_0x1267('0x2b')]};if(_0x25a580[_0x1267('0x47')]['MailAccountId']){_0x24fb5b[_0x1267('0x49')]=_0x25a580['body'][_0x1267('0x49')];}else if(_0x25a580[_0x1267('0x47')][_0x1267('0x4a')]){_0x24fb5b['SmsAccountId']=_0x25a580[_0x1267('0x47')][_0x1267('0x4a')];}else if(_0x25a580[_0x1267('0x47')]['OpenchannelAccountId']){_0x24fb5b[_0x1267('0x4b')]=_0x25a580['body']['OpenchannelAccountId'];}else if(_0x25a580['body'][_0x1267('0x4c')]){_0x24fb5b[_0x1267('0x4c')]=_0x25a580['body']['ChatWebsiteId'];}return db[_0x1267('0x3d')][_0x1267('0x46')]({'where':_0x24fb5b})['then'](function(_0x36fb86){if(_0x36fb86){throw new db[(_0x1267('0x4d'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer']['create'](_0x25a580['body']);})[_0x1267('0x21')](function(_0x303e9f){var _0x32e390=_0x25a580[_0x1267('0x4e')]['get']({'plain':!![]});if(!_0x32e390)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32e390['role']===_0x1267('0x4e')){var _0x59982a=_0x303e9f[_0x1267('0x23')]({'plain':!![]});return db[_0x1267('0x4f')][_0x1267('0x46')]({'where':{'name':_0x1267('0x50'),'userProfileId':_0x32e390[_0x1267('0x51')]},'raw':!![]})[_0x1267('0x21')](function(_0x1b087e){if(_0x1b087e&&_0x1b087e['autoAssociation']===0x0){return db['UserProfileResource'][_0x1267('0x48')]({'name':_0x59982a['name'],'resourceId':_0x59982a['id'],'type':_0x1b087e[_0x1267('0x27')],'sectionId':_0x1b087e['id']},{})[_0x1267('0x21')](function(){return _0x303e9f;});}else{return _0x303e9f;}})['catch'](function(_0x2abc40){logger['error'](_0x1267('0x52'),_0x2abc40);throw _0x2abc40;});}return _0x303e9f;})[_0x1267('0x21')](respondWithResult(_0xde7b88,0xc9))[_0x1267('0x42')](handleError(_0xde7b88,null));};
\ No newline at end of file
+var _0xa7b4=['key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','options','find','body','params','create'];(function(_0x7179ba,_0x37504f){var _0x4ad820=function(_0x131107){while(--_0x131107){_0x7179ba['push'](_0x7179ba['shift']());}};_0x4ad820(++_0x37504f);}(_0xa7b4,0xc9));var _0x4a7b=function(_0x1716c1,_0x4f3a3b){_0x1716c1=_0x1716c1-0x0;var _0x1ca528=_0xa7b4[_0x1716c1];return _0x1ca528;};'use strict';var emlformat=require(_0x4a7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a7b('0x1'));var jsonpatch=require(_0x4a7b('0x2'));var rp=require(_0x4a7b('0x3'));var moment=require(_0x4a7b('0x4'));var BPromise=require(_0x4a7b('0x5'));var Mustache=require('mustache');var util=require(_0x4a7b('0x6'));var path=require(_0x4a7b('0x7'));var sox=require(_0x4a7b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a7b('0x9'));var squel=require(_0x4a7b('0xa'));var crypto=require('crypto');var jsforce=require(_0x4a7b('0xb'));var deskjs=require(_0x4a7b('0xc'));var toCsv=require(_0x4a7b('0xd'));var querystring=require(_0x4a7b('0xe'));var Papa=require(_0x4a7b('0xf'));var Redis=require(_0x4a7b('0x10'));var authService=require(_0x4a7b('0x11'));var qs=require(_0x4a7b('0x12'));var as=require(_0x4a7b('0x13'));var hardwareService=require(_0x4a7b('0x14'));var logger=require(_0x4a7b('0x15'))(_0x4a7b('0x16'));var utils=require(_0x4a7b('0x17'));var config=require(_0x4a7b('0x18'));var licenseUtil=require(_0x4a7b('0x19'));var db=require(_0x4a7b('0x1a'))['db'];function respondWithStatusCode(_0x1b172f,_0x3b33e1){_0x3b33e1=_0x3b33e1||0xcc;return function(_0x50ad78){if(_0x50ad78){return _0x1b172f[_0x4a7b('0x1b')](_0x3b33e1);}return _0x1b172f[_0x4a7b('0x1c')](_0x3b33e1)[_0x4a7b('0x1d')]();};}function respondWithResult(_0x5c7c08,_0x3b5361){_0x3b5361=_0x3b5361||0xc8;return function(_0x5ba39d){if(_0x5ba39d){return _0x5c7c08['status'](_0x3b5361)['json'](_0x5ba39d);}};}function respondWithFilteredResult(_0x4881f3,_0x204fe7){return function(_0x314285){if(_0x314285){var _0x153d70=typeof _0x204fe7[_0x4a7b('0x1e')]===_0x4a7b('0x1f')&&typeof _0x204fe7[_0x4a7b('0x20')]===_0x4a7b('0x1f');var _0x4a3130=_0x314285[_0x4a7b('0x21')];var _0x6d5a08=_0x153d70?0x0:_0x204fe7['offset'];var _0x25caac=_0x153d70?_0x314285[_0x4a7b('0x21')]:_0x204fe7[_0x4a7b('0x1e')]+_0x204fe7[_0x4a7b('0x20')];var _0x192b47;if(_0x25caac>=_0x4a3130){_0x25caac=_0x4a3130;_0x192b47=0xc8;}else{_0x192b47=0xce;}_0x4881f3['status'](_0x192b47);return _0x4881f3[_0x4a7b('0x22')](_0x4a7b('0x23'),_0x6d5a08+'-'+_0x25caac+'/'+_0x4a3130)[_0x4a7b('0x24')](_0x314285);}return null;};}function patchUpdates(_0x49b0fa){return function(_0x5331bb){try{jsonpatch[_0x4a7b('0x25')](_0x5331bb,_0x49b0fa,!![]);}catch(_0x513164){return BPromise['reject'](_0x513164);}return _0x5331bb[_0x4a7b('0x26')]();};}function saveUpdates(_0x2ab5fd,_0x38a81b){return function(_0x29d759){if(_0x29d759){return _0x29d759[_0x4a7b('0x27')](_0x2ab5fd)[_0x4a7b('0x28')](function(_0x4a4f6d){return _0x4a4f6d;});}return null;};}function removeEntity(_0x5c7d4d,_0x1cef0f){return function(_0x415792){if(_0x415792){return _0x415792[_0x4a7b('0x29')]()[_0x4a7b('0x28')](function(){var _0x3465e8=_0x415792[_0x4a7b('0x2a')]({'plain':!![]});var _0x10d99c=_0x4a7b('0x2b');return db['UserProfileResource'][_0x4a7b('0x29')]({'where':{'type':_0x10d99c,'resourceId':_0x3465e8['id']}})[_0x4a7b('0x28')](function(){return _0x415792;});})[_0x4a7b('0x28')](function(){_0x5c7d4d[_0x4a7b('0x1c')](0xcc)[_0x4a7b('0x1d')]();});}};}function handleEntityNotFound(_0x257f47,_0x3168e1){return function(_0x9572f6){if(!_0x9572f6){_0x257f47[_0x4a7b('0x1b')](0x194);}return _0x9572f6;};}function handleError(_0xb0f608,_0x41e82d){_0x41e82d=_0x41e82d||0x1f4;return function(_0x2748ae){logger[_0x4a7b('0x2c')](_0x2748ae[_0x4a7b('0x2d')]);if(_0x2748ae[_0x4a7b('0x2e')]){delete _0x2748ae[_0x4a7b('0x2e')];}_0xb0f608[_0x4a7b('0x1c')](_0x41e82d)[_0x4a7b('0x2f')](_0x2748ae);};}exports[_0x4a7b('0x30')]=function(_0xd41606,_0x424a39){var _0x33d10d={},_0xe6ca22={},_0x5062a1={'count':0x0,'rows':[]};var _0x51bde7=_[_0x4a7b('0x31')](db[_0x4a7b('0x32')]['rawAttributes'],function(_0x3745b6){return{'name':_0x3745b6['fieldName'],'type':_0x3745b6[_0x4a7b('0x33')]['key']};});_0xe6ca22[_0x4a7b('0x34')]=_['map'](_0x51bde7,_0x4a7b('0x2e'));_0xe6ca22['query']=_[_0x4a7b('0x35')](_0xd41606[_0x4a7b('0x36')]);_0xe6ca22['filters']=_[_0x4a7b('0x37')](_0xe6ca22[_0x4a7b('0x34')],_0xe6ca22[_0x4a7b('0x36')]);_0x33d10d[_0x4a7b('0x38')]=_[_0x4a7b('0x37')](_0xe6ca22[_0x4a7b('0x34')],qs['fields'](_0xd41606['query'][_0x4a7b('0x39')]));_0x33d10d[_0x4a7b('0x38')]=_0x33d10d[_0x4a7b('0x38')][_0x4a7b('0x3a')]?_0x33d10d['attributes']:_0xe6ca22[_0x4a7b('0x34')];if(!_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x3b')](_0x4a7b('0x3c'))){_0x33d10d[_0x4a7b('0x20')]=qs[_0x4a7b('0x20')](_0xd41606[_0x4a7b('0x36')]['limit']);_0x33d10d[_0x4a7b('0x1e')]=qs[_0x4a7b('0x1e')](_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x1e')]);}_0x33d10d[_0x4a7b('0x3d')]=qs['sort'](_0xd41606[_0x4a7b('0x36')]['sort']);_0x33d10d[_0x4a7b('0x3e')]=qs[_0x4a7b('0x3f')](_[_0x4a7b('0x40')](_0xd41606['query'],_0xe6ca22['filters']),_0x51bde7);if(_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x41')]){_0x33d10d[_0x4a7b('0x3e')]=_['merge'](_0x33d10d[_0x4a7b('0x3e')],{'$or':[{'key':{'$like':'%'+_0xd41606['query'][_0x4a7b('0x41')]+'%'}},{'value':{'$like':'%'+_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x41')]+'%'}}]});}_0x33d10d=_[_0x4a7b('0x42')]({},_0x33d10d,_0xd41606['options']);var _0x45f426={'where':_0x33d10d[_0x4a7b('0x3e')]};return db[_0x4a7b('0x32')][_0x4a7b('0x21')](_0x45f426)[_0x4a7b('0x28')](function(_0x131cf5){_0x5062a1[_0x4a7b('0x21')]=_0x131cf5;if(_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x43')]){_0x33d10d[_0x4a7b('0x44')]=[{'all':!![]}];}return db[_0x4a7b('0x32')]['findAll'](_0x33d10d);})['then'](function(_0x2b983d){_0x5062a1[_0x4a7b('0x45')]=_0x2b983d;return _0x5062a1;})[_0x4a7b('0x28')](respondWithFilteredResult(_0x424a39,_0x33d10d))[_0x4a7b('0x46')](handleError(_0x424a39,null));};exports[_0x4a7b('0x47')]=function(_0x461d4e,_0x18d947){var _0x364ba5={'raw':!![],'where':{'id':_0x461d4e['params']['id']}},_0xd7bb25={};_0xd7bb25[_0x4a7b('0x34')]=_[_0x4a7b('0x35')](db['CannedAnswer'][_0x4a7b('0x48')]);_0xd7bb25['query']=_['keys'](_0x461d4e[_0x4a7b('0x36')]);_0xd7bb25[_0x4a7b('0x3f')]=_[_0x4a7b('0x37')](_0xd7bb25[_0x4a7b('0x34')],_0xd7bb25[_0x4a7b('0x36')]);_0x364ba5[_0x4a7b('0x38')]=_[_0x4a7b('0x37')](_0xd7bb25['model'],qs['fields'](_0x461d4e[_0x4a7b('0x36')][_0x4a7b('0x39')]));_0x364ba5['attributes']=_0x364ba5[_0x4a7b('0x38')][_0x4a7b('0x3a')]?_0x364ba5[_0x4a7b('0x38')]:_0xd7bb25[_0x4a7b('0x34')];if(_0x461d4e[_0x4a7b('0x36')][_0x4a7b('0x43')]){_0x364ba5[_0x4a7b('0x44')]=[{'all':!![]}];}_0x364ba5=_[_0x4a7b('0x42')]({},_0x364ba5,_0x461d4e[_0x4a7b('0x49')]);return db[_0x4a7b('0x32')][_0x4a7b('0x4a')](_0x364ba5)[_0x4a7b('0x28')](handleEntityNotFound(_0x18d947,null))[_0x4a7b('0x28')](respondWithResult(_0x18d947,null))[_0x4a7b('0x46')](handleError(_0x18d947,null));};exports['update']=function(_0x208da2,_0x1d818e){if(_0x208da2[_0x4a7b('0x4b')]['id']){delete _0x208da2[_0x4a7b('0x4b')]['id'];}return db[_0x4a7b('0x32')]['find']({'where':{'id':_0x208da2[_0x4a7b('0x4c')]['id']}})[_0x4a7b('0x28')](handleEntityNotFound(_0x1d818e,null))[_0x4a7b('0x28')](saveUpdates(_0x208da2['body'],null))[_0x4a7b('0x28')](respondWithResult(_0x1d818e,null))[_0x4a7b('0x46')](handleError(_0x1d818e,null));};exports[_0x4a7b('0x29')]=function(_0x30bec3,_0x4c6f0e){return db[_0x4a7b('0x32')]['find']({'where':{'id':_0x30bec3[_0x4a7b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c6f0e,null))[_0x4a7b('0x28')](removeEntity(_0x4c6f0e,null))[_0x4a7b('0x46')](handleError(_0x4c6f0e,null));};exports[_0x4a7b('0x4d')]=function(_0x1b1550,_0x1f5b4e){var _0x52a45f={'key':_0x1b1550['body'][_0x4a7b('0x4e')]};if(_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x4f')]){_0x52a45f['MailAccountId']=_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x4f')];}else if(_0x1b1550[_0x4a7b('0x4b')]['SmsAccountId']){_0x52a45f['SmsAccountId']=_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x50')];}else if(_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x51')]){_0x52a45f[_0x4a7b('0x51')]=_0x1b1550[_0x4a7b('0x4b')]['OpenchannelAccountId'];}else if(_0x1b1550[_0x4a7b('0x4b')]['ChatWebsiteId']){_0x52a45f[_0x4a7b('0x52')]=_0x1b1550[_0x4a7b('0x4b')]['ChatWebsiteId'];}return db[_0x4a7b('0x32')][_0x4a7b('0x4a')]({'where':_0x52a45f})['then'](function(_0x1f3427){if(_0x1f3427){throw new db[(_0x4a7b('0x53'))][(_0x4a7b('0x54'))](_0x4a7b('0x55'));}return db[_0x4a7b('0x32')][_0x4a7b('0x4d')](_0x1b1550[_0x4a7b('0x4b')]);})[_0x4a7b('0x28')](function(_0x246e0f){var _0x39811c=_0x1b1550[_0x4a7b('0x56')][_0x4a7b('0x2a')]({'plain':!![]});if(!_0x39811c)throw new Error(_0x4a7b('0x57'));if(_0x39811c['role']===_0x4a7b('0x56')){var _0x32f0fc=_0x246e0f['get']({'plain':!![]});return db[_0x4a7b('0x58')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x39811c[_0x4a7b('0x59')]},'raw':!![]})['then'](function(_0x505b62){if(_0x505b62&&_0x505b62[_0x4a7b('0x5a')]===0x0){return db[_0x4a7b('0x5b')][_0x4a7b('0x4d')]({'name':_0x32f0fc[_0x4a7b('0x2e')],'resourceId':_0x32f0fc['id'],'type':_0x505b62['name'],'sectionId':_0x505b62['id']},{})['then'](function(){return _0x246e0f;});}else{return _0x246e0f;}})[_0x4a7b('0x46')](function(_0x4fa965){logger[_0x4a7b('0x2c')](_0x4a7b('0x5c'),_0x4fa965);throw _0x4fa965;});}return _0x246e0f;})[_0x4a7b('0x28')](respondWithResult(_0x1f5b4e,0xc9))[_0x4a7b('0x46')](handleError(_0x1f5b4e,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 7599e66..9a5b990 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 _0xd446=['./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0xd446,0x171));var _0x6d44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd446[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d44('0x0'));var util=require('util');var logger=require(_0x6d44('0x1'))('api');var moment=require(_0x6d44('0x2'));var BPromise=require(_0x6d44('0x3'));var rp=require(_0x6d44('0x4'));var fs=require('fs');var path=require(_0x6d44('0x5'));var rimraf=require(_0x6d44('0x6'));var config=require(_0x6d44('0x7'));var attributes=require(_0x6d44('0x8'));module[_0x6d44('0x9')]=function(_0x16b328,_0x3b75b2){return _0x16b328[_0x6d44('0xa')]('CannedAnswer',attributes,{'tableName':_0x6d44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d44('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xee69=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x149254,_0xafe8da){var _0x249023=function(_0x5d99fd){while(--_0x5d99fd){_0x149254['push'](_0x149254['shift']());}};_0x249023(++_0xafe8da);}(_0xee69,0x91));var _0x9ee6=function(_0x1395e7,_0x1138c2){_0x1395e7=_0x1395e7-0x0;var _0x5d5331=_0xee69[_0x1395e7];return _0x5d5331;};'use strict';var _=require('lodash');var util=require(_0x9ee6('0x0'));var logger=require(_0x9ee6('0x1'))(_0x9ee6('0x2'));var moment=require(_0x9ee6('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ee6('0x4'));var fs=require('fs');var path=require(_0x9ee6('0x5'));var rimraf=require(_0x9ee6('0x6'));var config=require(_0x9ee6('0x7'));var attributes=require(_0x9ee6('0x8'));module[_0x9ee6('0x9')]=function(_0x136381,_0x327327){return _0x136381[_0x9ee6('0xa')](_0x9ee6('0xb'),attributes,{'tableName':_0x9ee6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ee6('0xd'),'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 317f973..0e49142 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(_0x339e44,_0x361cea){var _0x3c1be2=function(_0x7a04ce){while(--_0x7a04ce){_0x339e44['push'](_0x339e44['shift']());}};_0x3c1be2(++_0x361cea);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x3ac366,_0x2d6458){var _0x195225=function(_0x4f4e74){while(--_0x4f4e74){_0x3ac366['push'](_0x3ac366['shift']());}};_0x195225(++_0x2d6458);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 ba187d3..7bbf6b9 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 _0x8473=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','post','create','put','update','delete','exports','util','path','express','fs-extra'];(function(_0x526b29,_0x3e9b10){var _0x1289b4=function(_0x5ec127){while(--_0x5ec127){_0x526b29['push'](_0x526b29['shift']());}};_0x1289b4(++_0x3e9b10);}(_0x8473,0xec));var _0x3847=function(_0x1f17db,_0x1b258e){_0x1f17db=_0x1f17db-0x0;var _0x68d72b=_0x8473[_0x1f17db];return _0x68d72b;};'use strict';var multer=require('multer');var util=require(_0x3847('0x0'));var path=require(_0x3847('0x1'));var timeout=require('connect-timeout');var express=require(_0x3847('0x2'));var router=express['Router']();var fs_extra=require(_0x3847('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3847('0x4'));var config=require(_0x3847('0x5'));var controller=require(_0x3847('0x6'));router['get']('/',auth[_0x3847('0x7')](),controller[_0x3847('0x8')]);router['get'](_0x3847('0x9'),auth[_0x3847('0x7')](),controller['show']);router[_0x3847('0xa')]('/',auth[_0x3847('0x7')](),controller[_0x3847('0xb')]);router[_0x3847('0xc')](_0x3847('0x9'),auth[_0x3847('0x7')](),controller[_0x3847('0xd')]);router[_0x3847('0xe')]('/:id',auth[_0x3847('0x7')](),controller['destroy']);module[_0x3847('0xf')]=router;
\ No newline at end of file
+var _0xbdb8=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0xbdb8,0xb3));var _0x8bdb=function(_0x137f1a,_0x2887df){_0x137f1a=_0x137f1a-0x0;var _0x439923=_0xbdb8[_0x137f1a];return _0x439923;};'use strict';var multer=require(_0x8bdb('0x0'));var util=require(_0x8bdb('0x1'));var path=require('path');var timeout=require(_0x8bdb('0x2'));var express=require(_0x8bdb('0x3'));var router=express[_0x8bdb('0x4')]();var fs_extra=require(_0x8bdb('0x5'));var auth=require(_0x8bdb('0x6'));var interaction=require(_0x8bdb('0x7'));var config=require(_0x8bdb('0x8'));var controller=require(_0x8bdb('0x9'));router[_0x8bdb('0xa')]('/',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0xc')]);router[_0x8bdb('0xa')](_0x8bdb('0xd'),auth['isAuthenticated'](),controller[_0x8bdb('0xe')]);router[_0x8bdb('0xf')]('/',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x10')]);router[_0x8bdb('0x11')]('/:id',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x12')]);router[_0x8bdb('0x13')](_0x8bdb('0xd'),auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x14')]);module[_0x8bdb('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 544ceff..ad6183b 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 _0x106b=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x52f3d5,_0x43cda9){var _0x51b27b=function(_0x1d3137){while(--_0x1d3137){_0x52f3d5['push'](_0x52f3d5['shift']());}};_0x51b27b(++_0x43cda9);}(_0x106b,0xa2));var _0xb106=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x106b[_0xd39959];return _0x1ff69c;};'use strict';var Sequelize=require(_0xb106('0x0'));module[_0xb106('0x1')]={'calldate':{'type':Sequelize[_0xb106('0x2')],'allowNull':![],'defaultValue':_0xb106('0x3')},'clid':{'type':Sequelize[_0xb106('0x4')]},'src':{'type':Sequelize[_0xb106('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xb106('0x4')]},'channel':{'type':Sequelize[_0xb106('0x4')]},'dstchannel':{'type':Sequelize[_0xb106('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb106('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb106('0x4')]},'amaflags':{'type':Sequelize[_0xb106('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb106('0x4')]},'userfield':{'type':Sequelize[_0xb106('0x4')]},'uniqueid':{'type':Sequelize[_0xb106('0x4')]},'linkedid':{'type':Sequelize[_0xb106('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xb106('0x4')]},'type':{'type':Sequelize[_0xb106('0x4')]},'tag':{'type':Sequelize[_0xb106('0x4')]}};
\ No newline at end of file
+var _0x225c=['STRING','INTEGER','sequelize','exports'];(function(_0xba5a61,_0x160004){var _0x4eaab4=function(_0x8ccfb7){while(--_0x8ccfb7){_0xba5a61['push'](_0xba5a61['shift']());}};_0x4eaab4(++_0x160004);}(_0x225c,0x106));var _0xc225=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x225c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc225('0x0'));module[_0xc225('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xc225('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xc225('0x2')]},'dcontext':{'type':Sequelize[_0xc225('0x2')]},'channel':{'type':Sequelize[_0xc225('0x2')]},'dstchannel':{'type':Sequelize[_0xc225('0x2')]},'lastapp':{'type':Sequelize[_0xc225('0x2')]},'lastdata':{'type':Sequelize[_0xc225('0x2')]},'duration':{'type':Sequelize[_0xc225('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc225('0x2')]},'amaflags':{'type':Sequelize[_0xc225('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc225('0x2')]},'userfield':{'type':Sequelize[_0xc225('0x2')]},'uniqueid':{'type':Sequelize[_0xc225('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xc225('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc225('0x2')]},'tag':{'type':Sequelize[_0xc225('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 96e63dd..10eacdd 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 _0x5162=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','intersection','find','create','body','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x173336,_0x3f98c4){_0x173336=_0x173336-0x0;var _0x12dc79=_0x5162[_0x173336];return _0x12dc79;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2516('0x1'));var BPromise=require(_0x2516('0x2'));var Mustache=require(_0x2516('0x3'));var util=require(_0x2516('0x4'));var path=require(_0x2516('0x5'));var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0x7'));var querystring=require(_0x2516('0xc'));var Papa=require(_0x2516('0xd'));var Redis=require('ioredis');var authService=require(_0x2516('0xe'));var qs=require(_0x2516('0xf'));var as=require(_0x2516('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x11'));var licenseUtil=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];function respondWithStatusCode(_0x3ef6ff,_0x56c69c){_0x56c69c=_0x56c69c||0xcc;return function(_0x33496b){if(_0x33496b){return _0x3ef6ff[_0x2516('0x14')](_0x56c69c);}return _0x3ef6ff[_0x2516('0x15')](_0x56c69c)[_0x2516('0x16')]();};}function respondWithResult(_0x42c771,_0x558d20){_0x558d20=_0x558d20||0xc8;return function(_0x3e5e0f){if(_0x3e5e0f){return _0x42c771[_0x2516('0x15')](_0x558d20)[_0x2516('0x17')](_0x3e5e0f);}};}function respondWithFilteredResult(_0x181a28,_0x2637e8){return function(_0x2ec31f){if(_0x2ec31f){var _0x19aacb=typeof _0x2637e8[_0x2516('0x18')]===_0x2516('0x19')&&typeof _0x2637e8['limit']===_0x2516('0x19');var _0x1ced29=_0x2ec31f[_0x2516('0x1a')];var _0x564d05=_0x19aacb?0x0:_0x2637e8[_0x2516('0x18')];var _0x5e96c7=_0x19aacb?_0x2ec31f['count']:_0x2637e8[_0x2516('0x18')]+_0x2637e8[_0x2516('0x1b')];var _0x151168;if(_0x5e96c7>=_0x1ced29){_0x5e96c7=_0x1ced29;_0x151168=0xc8;}else{_0x151168=0xce;}_0x181a28[_0x2516('0x15')](_0x151168);return _0x181a28[_0x2516('0x1c')](_0x2516('0x1d'),_0x564d05+'-'+_0x5e96c7+'/'+_0x1ced29)[_0x2516('0x17')](_0x2ec31f);}return null;};}function patchUpdates(_0x113616){return function(_0x248c5a){try{jsonpatch[_0x2516('0x1e')](_0x248c5a,_0x113616,!![]);}catch(_0x39ba5b){return BPromise[_0x2516('0x1f')](_0x39ba5b);}return _0x248c5a[_0x2516('0x20')]();};}function saveUpdates(_0x4fb7d9,_0x559a3e){return function(_0x12db4d){if(_0x12db4d){return _0x12db4d[_0x2516('0x21')](_0x4fb7d9)[_0x2516('0x22')](function(_0x2d5b1b){return _0x2d5b1b;});}return null;};}function removeEntity(_0x3ffb6d,_0x32de7a){return function(_0x3d906d){if(_0x3d906d){return _0x3d906d[_0x2516('0x23')]()['then'](function(){_0x3ffb6d[_0x2516('0x15')](0xcc)[_0x2516('0x16')]();});}};}function handleEntityNotFound(_0x774b60,_0x434d54){return function(_0x47f4fb){if(!_0x47f4fb){_0x774b60[_0x2516('0x14')](0x194);}return _0x47f4fb;};}function handleError(_0x30eeb9,_0x1f722c){_0x1f722c=_0x1f722c||0x1f4;return function(_0x3d728a){logger[_0x2516('0x24')](_0x3d728a['stack']);if(_0x3d728a[_0x2516('0x25')]){delete _0x3d728a[_0x2516('0x25')];}_0x30eeb9[_0x2516('0x15')](_0x1f722c)[_0x2516('0x26')](_0x3d728a);};}exports[_0x2516('0x27')]=function(_0x285e67,_0x556f01){var _0x136893={},_0x20dc9f={},_0x493a3e={'count':0x0,'rows':[]};var _0x19d90d=_[_0x2516('0x28')](db[_0x2516('0x29')][_0x2516('0x2a')],function(_0x539704){return{'name':_0x539704[_0x2516('0x2b')],'type':_0x539704[_0x2516('0x2c')][_0x2516('0x2d')]};});_0x20dc9f[_0x2516('0x2e')]=_[_0x2516('0x28')](_0x19d90d,_0x2516('0x25'));_0x20dc9f[_0x2516('0x2f')]=_[_0x2516('0x30')](_0x285e67[_0x2516('0x2f')]);_0x20dc9f[_0x2516('0x31')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],_0x20dc9f['query']);_0x136893[_0x2516('0x32')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],qs['fields'](_0x285e67[_0x2516('0x2f')][_0x2516('0x33')]));_0x136893[_0x2516('0x32')]=_0x136893[_0x2516('0x32')][_0x2516('0x34')]?_0x136893[_0x2516('0x32')]:_0x20dc9f[_0x2516('0x2e')];if(!_0x285e67[_0x2516('0x2f')][_0x2516('0x35')]('nolimit')){_0x136893[_0x2516('0x1b')]=qs[_0x2516('0x1b')](_0x285e67[_0x2516('0x2f')][_0x2516('0x1b')]);_0x136893['offset']=qs['offset'](_0x285e67[_0x2516('0x2f')][_0x2516('0x18')]);}_0x136893[_0x2516('0x36')]=qs[_0x2516('0x37')](_0x285e67[_0x2516('0x2f')][_0x2516('0x37')]);_0x136893[_0x2516('0x38')]=qs[_0x2516('0x31')](_[_0x2516('0x39')](_0x285e67[_0x2516('0x2f')],_0x20dc9f['filters']),_0x19d90d);if(_0x285e67['query'][_0x2516('0x3a')]){_0x136893[_0x2516('0x38')]=_['merge'](_0x136893['where'],{'$or':_[_0x2516('0x28')](_0x19d90d,function(_0x3b310f){if(_0x3b310f['type']!==_0x2516('0x3b')){var _0x52ef6b={};_0x52ef6b[_0x3b310f[_0x2516('0x25')]]={'$like':'%'+_0x285e67[_0x2516('0x2f')]['filter']+'%'};return _0x52ef6b;}})});}_0x136893=_[_0x2516('0x3c')]({},_0x136893,_0x285e67[_0x2516('0x3d')]);var _0x155cf7={'where':_0x136893[_0x2516('0x38')]};return db[_0x2516('0x29')][_0x2516('0x1a')](_0x155cf7)[_0x2516('0x22')](function(_0x2371a8){_0x493a3e[_0x2516('0x1a')]=_0x2371a8;if(_0x285e67[_0x2516('0x2f')][_0x2516('0x3e')]){_0x136893[_0x2516('0x3f')]=[{'all':!![]}];}return db[_0x2516('0x29')]['findAll'](_0x136893);})[_0x2516('0x22')](function(_0x1bc0e){_0x493a3e['rows']=_0x1bc0e;return _0x493a3e;})[_0x2516('0x22')](respondWithFilteredResult(_0x556f01,_0x136893))[_0x2516('0x40')](handleError(_0x556f01,null));};exports[_0x2516('0x41')]=function(_0x1afefb,_0x421c58){var _0x582cb6={'raw':!![],'where':{'id':_0x1afefb[_0x2516('0x42')]['id']}},_0x1a8d2d={};_0x1a8d2d[_0x2516('0x2e')]=_[_0x2516('0x30')](db[_0x2516('0x29')][_0x2516('0x2a')]);_0x1a8d2d['query']=_[_0x2516('0x30')](_0x1afefb[_0x2516('0x2f')]);_0x1a8d2d[_0x2516('0x31')]=_[_0x2516('0x43')](_0x1a8d2d[_0x2516('0x2e')],_0x1a8d2d[_0x2516('0x2f')]);_0x582cb6[_0x2516('0x32')]=_['intersection'](_0x1a8d2d[_0x2516('0x2e')],qs['fields'](_0x1afefb[_0x2516('0x2f')]['fields']));_0x582cb6[_0x2516('0x32')]=_0x582cb6[_0x2516('0x32')][_0x2516('0x34')]?_0x582cb6['attributes']:_0x1a8d2d['model'];if(_0x1afefb[_0x2516('0x2f')][_0x2516('0x3e')]){_0x582cb6['include']=[{'all':!![]}];}_0x582cb6=_['merge']({},_0x582cb6,_0x1afefb[_0x2516('0x3d')]);return db[_0x2516('0x29')][_0x2516('0x44')](_0x582cb6)['then'](handleEntityNotFound(_0x421c58,null))[_0x2516('0x22')](respondWithResult(_0x421c58,null))['catch'](handleError(_0x421c58,null));};exports[_0x2516('0x45')]=function(_0x39fd32,_0x318128){return db[_0x2516('0x29')]['create'](_0x39fd32[_0x2516('0x46')],{})[_0x2516('0x22')](respondWithResult(_0x318128,0xc9))[_0x2516('0x40')](handleError(_0x318128,null));};exports[_0x2516('0x21')]=function(_0x43874c,_0x482883){if(_0x43874c[_0x2516('0x46')]['id']){delete _0x43874c[_0x2516('0x46')]['id'];}return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x43874c['params']['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x482883,null))[_0x2516('0x22')](saveUpdates(_0x43874c[_0x2516('0x46')],null))[_0x2516('0x22')](respondWithResult(_0x482883,null))[_0x2516('0x40')](handleError(_0x482883,null));};exports['destroy']=function(_0x1c4be3,_0x1aa854){return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x1c4be3[_0x2516('0x42')]['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x1aa854,null))['then'](removeEntity(_0x1aa854,null))['catch'](handleError(_0x1aa854,null));};exports['describe']=function(_0x323590,_0x4f7eb4){return db['Cdr']['describe']()[_0x2516('0x22')](respondWithResult(_0x4f7eb4,null))[_0x2516('0x40')](handleError(_0x4f7eb4,null));};
\ No newline at end of file
+var _0xb647=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x437e8a,_0x44dfba){var _0x5e9910=function(_0x3b71e1){while(--_0x3b71e1){_0x437e8a['push'](_0x437e8a['shift']());}};_0x5e9910(++_0x44dfba);}(_0xb647,0xdb));var _0x7b64=function(_0x2014d7,_0x3668de){_0x2014d7=_0x2014d7-0x0;var _0x355af3=_0xb647[_0x2014d7];return _0x355af3;};'use strict';var emlformat=require(_0x7b64('0x0'));var rimraf=require(_0x7b64('0x1'));var zipdir=require(_0x7b64('0x2'));var jsonpatch=require(_0x7b64('0x3'));var rp=require(_0x7b64('0x4'));var moment=require(_0x7b64('0x5'));var BPromise=require(_0x7b64('0x6'));var Mustache=require(_0x7b64('0x7'));var util=require('util');var path=require(_0x7b64('0x8'));var sox=require('sox');var csv=require(_0x7b64('0x9'));var ejs=require(_0x7b64('0xa'));var fs=require('fs');var fs_extra=require(_0x7b64('0xb'));var _=require(_0x7b64('0xc'));var squel=require(_0x7b64('0xd'));var crypto=require(_0x7b64('0xe'));var jsforce=require(_0x7b64('0xf'));var deskjs=require(_0x7b64('0x10'));var toCsv=require(_0x7b64('0x9'));var querystring=require('querystring');var Papa=require(_0x7b64('0x11'));var Redis=require('ioredis');var authService=require(_0x7b64('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b64('0x13'));var logger=require(_0x7b64('0x14'))('api');var utils=require(_0x7b64('0x15'));var config=require(_0x7b64('0x16'));var licenseUtil=require(_0x7b64('0x17'));var db=require(_0x7b64('0x18'))['db'];function respondWithStatusCode(_0x25e135,_0x432626){_0x432626=_0x432626||0xcc;return function(_0x5ea1dd){if(_0x5ea1dd){return _0x25e135['sendStatus'](_0x432626);}return _0x25e135[_0x7b64('0x19')](_0x432626)['end']();};}function respondWithResult(_0x530938,_0x2f21d8){_0x2f21d8=_0x2f21d8||0xc8;return function(_0x29a596){if(_0x29a596){return _0x530938[_0x7b64('0x19')](_0x2f21d8)[_0x7b64('0x1a')](_0x29a596);}};}function respondWithFilteredResult(_0x33ebe7,_0x437ddc){return function(_0x306a4e){if(_0x306a4e){var _0x519316=typeof _0x437ddc[_0x7b64('0x1b')]===_0x7b64('0x1c')&&typeof _0x437ddc[_0x7b64('0x1d')]===_0x7b64('0x1c');var _0x157c03=_0x306a4e['count'];var _0x3935c3=_0x519316?0x0:_0x437ddc[_0x7b64('0x1b')];var _0x58517e=_0x519316?_0x306a4e[_0x7b64('0x1e')]:_0x437ddc[_0x7b64('0x1b')]+_0x437ddc['limit'];var _0x23845e;if(_0x58517e>=_0x157c03){_0x58517e=_0x157c03;_0x23845e=0xc8;}else{_0x23845e=0xce;}_0x33ebe7[_0x7b64('0x19')](_0x23845e);return _0x33ebe7[_0x7b64('0x1f')](_0x7b64('0x20'),_0x3935c3+'-'+_0x58517e+'/'+_0x157c03)['json'](_0x306a4e);}return null;};}function patchUpdates(_0x123a3b){return function(_0x5c4135){try{jsonpatch['apply'](_0x5c4135,_0x123a3b,!![]);}catch(_0x3f73cf){return BPromise['reject'](_0x3f73cf);}return _0x5c4135[_0x7b64('0x21')]();};}function saveUpdates(_0x587da6,_0x1bbd87){return function(_0x1ad95f){if(_0x1ad95f){return _0x1ad95f[_0x7b64('0x22')](_0x587da6)[_0x7b64('0x23')](function(_0x450b7e){return _0x450b7e;});}return null;};}function removeEntity(_0x3c0d97,_0x215ea9){return function(_0x3d4bef){if(_0x3d4bef){return _0x3d4bef[_0x7b64('0x24')]()[_0x7b64('0x23')](function(){_0x3c0d97[_0x7b64('0x19')](0xcc)[_0x7b64('0x25')]();});}};}function handleEntityNotFound(_0x24b68e,_0x42efa1){return function(_0x50d06c){if(!_0x50d06c){_0x24b68e[_0x7b64('0x26')](0x194);}return _0x50d06c;};}function handleError(_0x5d9586,_0x1580d0){_0x1580d0=_0x1580d0||0x1f4;return function(_0x21fbd3){logger['error'](_0x21fbd3['stack']);if(_0x21fbd3[_0x7b64('0x27')]){delete _0x21fbd3[_0x7b64('0x27')];}_0x5d9586[_0x7b64('0x19')](_0x1580d0)[_0x7b64('0x28')](_0x21fbd3);};}exports[_0x7b64('0x29')]=function(_0x3c9fad,_0x6740b2){var _0x2729f1={},_0x53e29b={},_0x1616c9={'count':0x0,'rows':[]};var _0x2c4619=_['map'](db[_0x7b64('0x2a')][_0x7b64('0x2b')],function(_0x369402){return{'name':_0x369402[_0x7b64('0x2c')],'type':_0x369402[_0x7b64('0x2d')][_0x7b64('0x2e')]};});_0x53e29b['model']=_['map'](_0x2c4619,_0x7b64('0x27'));_0x53e29b[_0x7b64('0x2f')]=_['keys'](_0x3c9fad['query']);_0x53e29b[_0x7b64('0x30')]=_['intersection'](_0x53e29b[_0x7b64('0x31')],_0x53e29b['query']);_0x2729f1['attributes']=_['intersection'](_0x53e29b[_0x7b64('0x31')],qs[_0x7b64('0x32')](_0x3c9fad[_0x7b64('0x2f')]['fields']));_0x2729f1[_0x7b64('0x33')]=_0x2729f1['attributes'][_0x7b64('0x34')]?_0x2729f1[_0x7b64('0x33')]:_0x53e29b[_0x7b64('0x31')];if(!_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x35')]('nolimit')){_0x2729f1[_0x7b64('0x1d')]=qs[_0x7b64('0x1d')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x1d')]);_0x2729f1['offset']=qs[_0x7b64('0x1b')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x1b')]);}_0x2729f1[_0x7b64('0x36')]=qs[_0x7b64('0x37')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x37')]);_0x2729f1['where']=qs['filters'](_[_0x7b64('0x38')](_0x3c9fad[_0x7b64('0x2f')],_0x53e29b[_0x7b64('0x30')]),_0x2c4619);if(_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x39')]){_0x2729f1[_0x7b64('0x3a')]=_[_0x7b64('0x3b')](_0x2729f1[_0x7b64('0x3a')],{'$or':_[_0x7b64('0x3c')](_0x2c4619,function(_0x5b1278){if(_0x5b1278[_0x7b64('0x2d')]!==_0x7b64('0x3d')){var _0x451f9b={};_0x451f9b[_0x5b1278[_0x7b64('0x27')]]={'$like':'%'+_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x39')]+'%'};return _0x451f9b;}})});}_0x2729f1=_[_0x7b64('0x3b')]({},_0x2729f1,_0x3c9fad[_0x7b64('0x3e')]);var _0x3c4467={'where':_0x2729f1[_0x7b64('0x3a')]};return db[_0x7b64('0x2a')][_0x7b64('0x1e')](_0x3c4467)[_0x7b64('0x23')](function(_0x36cfce){_0x1616c9[_0x7b64('0x1e')]=_0x36cfce;if(_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x3f')]){_0x2729f1[_0x7b64('0x40')]=[{'all':!![]}];}return db[_0x7b64('0x2a')][_0x7b64('0x41')](_0x2729f1);})['then'](function(_0x442d65){_0x1616c9[_0x7b64('0x42')]=_0x442d65;return _0x1616c9;})[_0x7b64('0x23')](respondWithFilteredResult(_0x6740b2,_0x2729f1))['catch'](handleError(_0x6740b2,null));};exports[_0x7b64('0x43')]=function(_0x2e4d0f,_0x55c889){var _0x216c58={'raw':!![],'where':{'id':_0x2e4d0f['params']['id']}},_0xf0d4a1={};_0xf0d4a1[_0x7b64('0x31')]=_['keys'](db[_0x7b64('0x2a')][_0x7b64('0x2b')]);_0xf0d4a1[_0x7b64('0x2f')]=_['keys'](_0x2e4d0f[_0x7b64('0x2f')]);_0xf0d4a1[_0x7b64('0x30')]=_[_0x7b64('0x44')](_0xf0d4a1[_0x7b64('0x31')],_0xf0d4a1[_0x7b64('0x2f')]);_0x216c58[_0x7b64('0x33')]=_['intersection'](_0xf0d4a1[_0x7b64('0x31')],qs[_0x7b64('0x32')](_0x2e4d0f[_0x7b64('0x2f')][_0x7b64('0x32')]));_0x216c58[_0x7b64('0x33')]=_0x216c58['attributes']['length']?_0x216c58['attributes']:_0xf0d4a1['model'];if(_0x2e4d0f[_0x7b64('0x2f')][_0x7b64('0x3f')]){_0x216c58[_0x7b64('0x40')]=[{'all':!![]}];}_0x216c58=_[_0x7b64('0x3b')]({},_0x216c58,_0x2e4d0f[_0x7b64('0x3e')]);return db[_0x7b64('0x2a')][_0x7b64('0x45')](_0x216c58)[_0x7b64('0x23')](handleEntityNotFound(_0x55c889,null))[_0x7b64('0x23')](respondWithResult(_0x55c889,null))[_0x7b64('0x46')](handleError(_0x55c889,null));};exports[_0x7b64('0x47')]=function(_0x38983a,_0x4add4d){return db['Cdr'][_0x7b64('0x47')](_0x38983a[_0x7b64('0x48')],{})[_0x7b64('0x23')](respondWithResult(_0x4add4d,0xc9))[_0x7b64('0x46')](handleError(_0x4add4d,null));};exports[_0x7b64('0x22')]=function(_0x5a8639,_0x3e5321){if(_0x5a8639[_0x7b64('0x48')]['id']){delete _0x5a8639[_0x7b64('0x48')]['id'];}return db['Cdr'][_0x7b64('0x45')]({'where':{'id':_0x5a8639[_0x7b64('0x49')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3e5321,null))[_0x7b64('0x23')](saveUpdates(_0x5a8639[_0x7b64('0x48')],null))['then'](respondWithResult(_0x3e5321,null))[_0x7b64('0x46')](handleError(_0x3e5321,null));};exports[_0x7b64('0x24')]=function(_0x52b04a,_0x3656b8){return db[_0x7b64('0x2a')]['find']({'where':{'id':_0x52b04a[_0x7b64('0x49')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3656b8,null))[_0x7b64('0x23')](removeEntity(_0x3656b8,null))[_0x7b64('0x46')](handleError(_0x3656b8,null));};exports[_0x7b64('0x4a')]=function(_0x79cbc9,_0x253b33){return db[_0x7b64('0x2a')][_0x7b64('0x4a')]()[_0x7b64('0x23')](respondWithResult(_0x253b33,null))[_0x7b64('0x46')](handleError(_0x253b33,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e455df5..ecda3b3 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(_0x2d8a02,_0x1f4e5d){var _0xe7aaf8=function(_0x1ba751){while(--_0x1ba751){_0x2d8a02['push'](_0x2d8a02['shift']());}};_0xe7aaf8(++_0x1f4e5d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x388113,_0x16cac1){var _0x5c3a72=function(_0x34c96a){while(--_0x34c96a){_0x388113['push'](_0x388113['shift']());}};_0x5c3a72(++_0x16cac1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 67babbe..b0737e9 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 _0x2421=['stringify','error','Cdr,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x395aaf,_0x48a467){var _0x1b39d3=function(_0x228248){while(--_0x228248){_0x395aaf['push'](_0x395aaf['shift']());}};_0x1b39d3(++_0x48a467);}(_0x2421,0x11a));var _0x1242=function(_0x46f6bd,_0xb41e){_0x46f6bd=_0x46f6bd-0x0;var _0x233b9e=_0x2421[_0x46f6bd];return _0x233b9e;};'use strict';var _=require('lodash');var util=require(_0x1242('0x0'));var moment=require(_0x1242('0x1'));var BPromise=require(_0x1242('0x2'));var rs=require(_0x1242('0x3'));var fs=require('fs');var Redis=require(_0x1242('0x4'));var db=require(_0x1242('0x5'))['db'];var utils=require(_0x1242('0x6'));var logger=require(_0x1242('0x7'))('rpc');var config=require(_0x1242('0x8'));var jayson=require(_0x1242('0x9'));var client=jayson[_0x1242('0xa')][_0x1242('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cf342,_0x1b1e59,_0x1881d1){return new BPromise(function(_0x43298b,_0x3898a5){return client[_0x1242('0xc')](_0x5cf342,_0x1881d1)[_0x1242('0xd')](function(_0x5aa53d){logger[_0x1242('0xe')]('Cdr,\x20%s,\x20%s',_0x1b1e59,'request\x20sent');logger['debug'](_0x1242('0xf'),_0x1b1e59,_0x1242('0x10'),JSON[_0x1242('0x11')](_0x5aa53d));if(_0x5aa53d[_0x1242('0x12')]){if(_0x5aa53d['error']['code']===0x1f4){logger[_0x1242('0x12')](_0x1242('0x13'),_0x1b1e59,_0x5aa53d[_0x1242('0x12')][_0x1242('0x14')]);return _0x3898a5(_0x5aa53d['error']['message']);}logger[_0x1242('0x12')](_0x1242('0x13'),_0x1b1e59,_0x5aa53d[_0x1242('0x12')]['message']);return _0x43298b(_0x5aa53d[_0x1242('0x12')]['message']);}else{logger[_0x1242('0xe')](_0x1242('0x13'),_0x1b1e59,_0x1242('0x10'));_0x43298b(_0x5aa53d[_0x1242('0x15')][_0x1242('0x14')]);}})[_0x1242('0x16')](function(_0x5d2dfb){logger[_0x1242('0x12')]('Cdr,\x20%s,\x20%s',_0x1b1e59,_0x5d2dfb);_0x3898a5(_0x5d2dfb);});});}
\ No newline at end of file
+var _0x2353=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3e6cfe,_0x1943c1){var _0x51799b=function(_0x2e8ac1){while(--_0x2e8ac1){_0x3e6cfe['push'](_0x3e6cfe['shift']());}};_0x51799b(++_0x1943c1);}(_0x2353,0x195));var _0x3235=function(_0x482b0b,_0x37ac86){_0x482b0b=_0x482b0b-0x0;var _0x5e5991=_0x2353[_0x482b0b];return _0x5e5991;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3235('0x0'));var BPromise=require(_0x3235('0x1'));var rs=require(_0x3235('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3235('0x3'))['db'];var utils=require(_0x3235('0x4'));var logger=require('../../config/logger')(_0x3235('0x5'));var config=require(_0x3235('0x6'));var jayson=require(_0x3235('0x7'));var client=jayson[_0x3235('0x8')][_0x3235('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x436c8f,_0x399e66,_0x36d16b){return new BPromise(function(_0x146796,_0x2e36fa){return client[_0x3235('0xa')](_0x436c8f,_0x36d16b)[_0x3235('0xb')](function(_0x3a04e9){logger[_0x3235('0xc')](_0x3235('0xd'),_0x399e66,_0x3235('0xe'));logger[_0x3235('0xf')](_0x3235('0x10'),_0x399e66,'request\x20sent',JSON[_0x3235('0x11')](_0x3a04e9));if(_0x3a04e9[_0x3235('0x12')]){if(_0x3a04e9[_0x3235('0x12')]['code']===0x1f4){logger['error'](_0x3235('0xd'),_0x399e66,_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);return _0x2e36fa(_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);}logger['error'](_0x3235('0xd'),_0x399e66,_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);return _0x146796(_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);}else{logger['info'](_0x3235('0xd'),_0x399e66,_0x3235('0xe'));_0x146796(_0x3a04e9[_0x3235('0x14')][_0x3235('0x13')]);}})[_0x3235('0x15')](function(_0x459b2b){logger['error'](_0x3235('0xd'),_0x399e66,_0x459b2b);_0x2e36fa(_0x459b2b);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3d39e90..757dad7 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 _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(_0x481342,_0x39c5b0){var _0x47e1ad=function(_0x35e7db){while(--_0x35e7db){_0x481342['push'](_0x481342['shift']());}};_0x47e1ad(++_0x39c5b0);}(_0xb10b,0x12a));var _0xbb10=function(_0x5426d0,_0x4a4f10){_0x5426d0=_0x5426d0-0x0;var _0x37be89=_0xb10b[_0x5426d0];return _0x37be89;};'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
+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(_0x1a4748,_0x40c46e){var _0x28ca99=function(_0x99232c){while(--_0x99232c){_0x1a4748['push'](_0x1a4748['shift']());}};_0x28ca99(++_0x40c46e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 8038650..97dda9a 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 _0x3f92=['STRING','sequelize','INTEGER','TEXT'];(function(_0x4a655c,_0x5054ee){var _0x987318=function(_0x4d3ef6){while(--_0x4d3ef6){_0x4a655c['push'](_0x4a655c['shift']());}};_0x987318(++_0x5054ee);}(_0x3f92,0x131));var _0x23f9=function(_0x25d3c8,_0x5dcdf0){_0x25d3c8=_0x25d3c8-0x0;var _0x35afa5=_0x3f92[_0x25d3c8];return _0x35afa5;};'use strict';var Sequelize=require(_0x23f9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x23f9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x23f9('0x2')]()},'description':{'type':Sequelize[_0x23f9('0x3')]},'interval':{'type':Sequelize[_0x23f9('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xadeb=['TEXT','sequelize','exports','STRING'];(function(_0xc2f824,_0x5521e4){var _0x2a601e=function(_0x25315e){while(--_0x25315e){_0xc2f824['push'](_0xc2f824['shift']());}};_0x2a601e(++_0x5521e4);}(_0xadeb,0xad));var _0xbade=function(_0x369cc7,_0x16abfc){_0x369cc7=_0x369cc7-0x0;var _0x53273c=_0xadeb[_0x369cc7];return _0x53273c;};'use strict';var Sequelize=require(_0xbade('0x0'));module[_0xbade('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbade('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbade('0x3')]()},'description':{'type':Sequelize[_0xbade('0x2')]},'interval':{'type':Sequelize[_0xbade('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c6deded..391de4d 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 _0x5d31=['then','destroy','error','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','ChatApplication','find','catch','body','params','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update'];(function(_0x3be8b2,_0x26c3b4){var _0x47672e=function(_0x1633b6){while(--_0x1633b6){_0x3be8b2['push'](_0x3be8b2['shift']());}};_0x47672e(++_0x26c3b4);}(_0x5d31,0xf7));var _0x15d3=function(_0x38c2b5,_0x4de8fa){_0x38c2b5=_0x38c2b5-0x0;var _0x46deb3=_0x5d31[_0x38c2b5];return _0x46deb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15d3('0x0'));var zipdir=require(_0x15d3('0x1'));var jsonpatch=require(_0x15d3('0x2'));var rp=require('request-promise');var moment=require(_0x15d3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15d3('0x4'));var path=require(_0x15d3('0x5'));var sox=require(_0x15d3('0x6'));var csv=require(_0x15d3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15d3('0x8'));var _=require(_0x15d3('0x9'));var squel=require(_0x15d3('0xa'));var crypto=require(_0x15d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15d3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x15d3('0xd'));var Redis=require('ioredis');var authService=require(_0x15d3('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d3('0xf'));var logger=require(_0x15d3('0x10'))(_0x15d3('0x11'));var utils=require(_0x15d3('0x12'));var config=require(_0x15d3('0x13'));var licenseUtil=require(_0x15d3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219867,_0x1397d8){_0x1397d8=_0x1397d8||0xcc;return function(_0x2811b5){if(_0x2811b5){return _0x219867[_0x15d3('0x15')](_0x1397d8);}return _0x219867[_0x15d3('0x16')](_0x1397d8)[_0x15d3('0x17')]();};}function respondWithResult(_0x24eb07,_0x1658cf){_0x1658cf=_0x1658cf||0xc8;return function(_0x44b5a4){if(_0x44b5a4){return _0x24eb07[_0x15d3('0x16')](_0x1658cf)[_0x15d3('0x18')](_0x44b5a4);}};}function respondWithFilteredResult(_0x4af3a7,_0x304a13){return function(_0x17401b){if(_0x17401b){var _0x5bbfef=typeof _0x304a13[_0x15d3('0x19')]===_0x15d3('0x1a')&&typeof _0x304a13[_0x15d3('0x1b')]===_0x15d3('0x1a');var _0x1b7b3f=_0x17401b[_0x15d3('0x1c')];var _0x46f9ce=_0x5bbfef?0x0:_0x304a13[_0x15d3('0x19')];var _0x46e18b=_0x5bbfef?_0x17401b[_0x15d3('0x1c')]:_0x304a13[_0x15d3('0x19')]+_0x304a13['limit'];var _0x41c358;if(_0x46e18b>=_0x1b7b3f){_0x46e18b=_0x1b7b3f;_0x41c358=0xc8;}else{_0x41c358=0xce;}_0x4af3a7[_0x15d3('0x16')](_0x41c358);return _0x4af3a7['set']('Content-Range',_0x46f9ce+'-'+_0x46e18b+'/'+_0x1b7b3f)['json'](_0x17401b);}return null;};}function patchUpdates(_0x4ebc97){return function(_0x39bb05){try{jsonpatch[_0x15d3('0x1d')](_0x39bb05,_0x4ebc97,!![]);}catch(_0x40a327){return BPromise[_0x15d3('0x1e')](_0x40a327);}return _0x39bb05[_0x15d3('0x1f')]();};}function saveUpdates(_0x2fa13c,_0x4da198){return function(_0x49eb89){if(_0x49eb89){return _0x49eb89[_0x15d3('0x20')](_0x2fa13c)[_0x15d3('0x21')](function(_0x444075){return _0x444075;});}return null;};}function removeEntity(_0x72852f,_0x5b06cc){return function(_0x232078){if(_0x232078){return _0x232078[_0x15d3('0x22')]()[_0x15d3('0x21')](function(){_0x72852f[_0x15d3('0x16')](0xcc)[_0x15d3('0x17')]();});}};}function handleEntityNotFound(_0x240cf4,_0x4a499a){return function(_0x514380){if(!_0x514380){_0x240cf4['sendStatus'](0x194);}return _0x514380;};}function handleError(_0x31706f,_0x1cd5bc){_0x1cd5bc=_0x1cd5bc||0x1f4;return function(_0x23e1f8){logger[_0x15d3('0x23')](_0x23e1f8[_0x15d3('0x24')]);if(_0x23e1f8[_0x15d3('0x25')]){delete _0x23e1f8[_0x15d3('0x25')];}_0x31706f[_0x15d3('0x16')](_0x1cd5bc)[_0x15d3('0x26')](_0x23e1f8);};}exports['show']=function(_0x5f445a,_0x164aa1){var _0x4e5840={'raw':!![],'where':{'id':_0x5f445a['params']['id']}},_0x6a9c0c={};_0x6a9c0c[_0x15d3('0x27')]=_[_0x15d3('0x28')](db['ChatApplication'][_0x15d3('0x29')]);_0x6a9c0c[_0x15d3('0x2a')]=_[_0x15d3('0x28')](_0x5f445a[_0x15d3('0x2a')]);_0x6a9c0c[_0x15d3('0x2b')]=_[_0x15d3('0x2c')](_0x6a9c0c[_0x15d3('0x27')],_0x6a9c0c[_0x15d3('0x2a')]);_0x4e5840[_0x15d3('0x2d')]=_[_0x15d3('0x2c')](_0x6a9c0c['model'],qs[_0x15d3('0x2e')](_0x5f445a[_0x15d3('0x2a')][_0x15d3('0x2e')]));_0x4e5840[_0x15d3('0x2d')]=_0x4e5840[_0x15d3('0x2d')][_0x15d3('0x2f')]?_0x4e5840[_0x15d3('0x2d')]:_0x6a9c0c[_0x15d3('0x27')];if(_0x5f445a['query'][_0x15d3('0x30')]){_0x4e5840['include']=[{'all':!![]}];}_0x4e5840=_[_0x15d3('0x31')]({},_0x4e5840,_0x5f445a[_0x15d3('0x32')]);return db[_0x15d3('0x33')][_0x15d3('0x34')](_0x4e5840)[_0x15d3('0x21')](handleEntityNotFound(_0x164aa1,null))[_0x15d3('0x21')](respondWithResult(_0x164aa1,null))[_0x15d3('0x35')](handleError(_0x164aa1,null));};exports[_0x15d3('0x20')]=function(_0x340d03,_0x20e680){if(_0x340d03[_0x15d3('0x36')]['id']){delete _0x340d03[_0x15d3('0x36')]['id'];}return db[_0x15d3('0x33')][_0x15d3('0x34')]({'where':{'id':_0x340d03[_0x15d3('0x37')]['id']}})['then'](handleEntityNotFound(_0x20e680,null))[_0x15d3('0x21')](saveUpdates(_0x340d03[_0x15d3('0x36')],null))['then'](respondWithResult(_0x20e680,null))[_0x15d3('0x35')](handleError(_0x20e680,null));};exports[_0x15d3('0x22')]=function(_0xd2708,_0x51963f){return db[_0x15d3('0x33')]['find']({'where':{'id':_0xd2708[_0x15d3('0x37')]['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x51963f,null))['then'](removeEntity(_0x51963f,null))[_0x15d3('0x35')](handleError(_0x51963f,null));};
\ No newline at end of file
+var _0xb676=['ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys'];(function(_0x3ba559,_0x131d7e){var _0x4d76fb=function(_0x504678){while(--_0x504678){_0x3ba559['push'](_0x3ba559['shift']());}};_0x4d76fb(++_0x131d7e);}(_0xb676,0xbc));var _0x6b67=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xb676[_0x2aecb2];return _0x3ebb80;};'use strict';var emlformat=require(_0x6b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b67('0x1'));var jsonpatch=require(_0x6b67('0x2'));var rp=require(_0x6b67('0x3'));var moment=require(_0x6b67('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b67('0x5'));var path=require(_0x6b67('0x6'));var sox=require('sox');var csv=require(_0x6b67('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b67('0x8'));var _=require(_0x6b67('0x9'));var squel=require(_0x6b67('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b67('0xb'));var deskjs=require(_0x6b67('0xc'));var toCsv=require(_0x6b67('0x7'));var querystring=require('querystring');var Papa=require(_0x6b67('0xd'));var Redis=require(_0x6b67('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6b67('0xf'));var as=require(_0x6b67('0x10'));var hardwareService=require(_0x6b67('0x11'));var logger=require(_0x6b67('0x12'))('api');var utils=require(_0x6b67('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b67('0x14'));var db=require(_0x6b67('0x15'))['db'];function respondWithStatusCode(_0x1ebceb,_0x2ab6c5){_0x2ab6c5=_0x2ab6c5||0xcc;return function(_0x3e1bc6){if(_0x3e1bc6){return _0x1ebceb[_0x6b67('0x16')](_0x2ab6c5);}return _0x1ebceb[_0x6b67('0x17')](_0x2ab6c5)[_0x6b67('0x18')]();};}function respondWithResult(_0x2de534,_0x5fb6b3){_0x5fb6b3=_0x5fb6b3||0xc8;return function(_0x8a29a2){if(_0x8a29a2){return _0x2de534['status'](_0x5fb6b3)[_0x6b67('0x19')](_0x8a29a2);}};}function respondWithFilteredResult(_0x2213f4,_0x51e798){return function(_0x187fd4){if(_0x187fd4){var _0x1b6c60=typeof _0x51e798[_0x6b67('0x1a')]===_0x6b67('0x1b')&&typeof _0x51e798['limit']===_0x6b67('0x1b');var _0x46c44e=_0x187fd4[_0x6b67('0x1c')];var _0x46d828=_0x1b6c60?0x0:_0x51e798[_0x6b67('0x1a')];var _0x37d964=_0x1b6c60?_0x187fd4['count']:_0x51e798[_0x6b67('0x1a')]+_0x51e798['limit'];var _0x37cf6d;if(_0x37d964>=_0x46c44e){_0x37d964=_0x46c44e;_0x37cf6d=0xc8;}else{_0x37cf6d=0xce;}_0x2213f4[_0x6b67('0x17')](_0x37cf6d);return _0x2213f4[_0x6b67('0x1d')](_0x6b67('0x1e'),_0x46d828+'-'+_0x37d964+'/'+_0x46c44e)['json'](_0x187fd4);}return null;};}function patchUpdates(_0xd36be3){return function(_0x360208){try{jsonpatch[_0x6b67('0x1f')](_0x360208,_0xd36be3,!![]);}catch(_0x50fdfc){return BPromise[_0x6b67('0x20')](_0x50fdfc);}return _0x360208[_0x6b67('0x21')]();};}function saveUpdates(_0x1fedd5,_0x4d48e1){return function(_0xd4fda5){if(_0xd4fda5){return _0xd4fda5[_0x6b67('0x22')](_0x1fedd5)[_0x6b67('0x23')](function(_0x3a0a3f){return _0x3a0a3f;});}return null;};}function removeEntity(_0x393b3d,_0x17d27b){return function(_0x3c89d2){if(_0x3c89d2){return _0x3c89d2[_0x6b67('0x24')]()[_0x6b67('0x23')](function(){_0x393b3d[_0x6b67('0x17')](0xcc)[_0x6b67('0x18')]();});}};}function handleEntityNotFound(_0x47c927,_0x265245){return function(_0x3cffdf){if(!_0x3cffdf){_0x47c927[_0x6b67('0x16')](0x194);}return _0x3cffdf;};}function handleError(_0x5dca55,_0x2b67f6){_0x2b67f6=_0x2b67f6||0x1f4;return function(_0x1c73b0){logger['error'](_0x1c73b0[_0x6b67('0x25')]);if(_0x1c73b0[_0x6b67('0x26')]){delete _0x1c73b0[_0x6b67('0x26')];}_0x5dca55[_0x6b67('0x17')](_0x2b67f6)[_0x6b67('0x27')](_0x1c73b0);};}exports[_0x6b67('0x28')]=function(_0x3b65af,_0x5d9f6d){var _0x320a70={'raw':!![],'where':{'id':_0x3b65af[_0x6b67('0x29')]['id']}},_0x433881={};_0x433881[_0x6b67('0x2a')]=_[_0x6b67('0x2b')](db[_0x6b67('0x2c')][_0x6b67('0x2d')]);_0x433881[_0x6b67('0x2e')]=_['keys'](_0x3b65af[_0x6b67('0x2e')]);_0x433881[_0x6b67('0x2f')]=_[_0x6b67('0x30')](_0x433881[_0x6b67('0x2a')],_0x433881[_0x6b67('0x2e')]);_0x320a70[_0x6b67('0x31')]=_['intersection'](_0x433881['model'],qs[_0x6b67('0x32')](_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x32')]));_0x320a70[_0x6b67('0x31')]=_0x320a70['attributes'][_0x6b67('0x33')]?_0x320a70['attributes']:_0x433881[_0x6b67('0x2a')];if(_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x34')]){_0x320a70['include']=[{'all':!![]}];}_0x320a70=_[_0x6b67('0x35')]({},_0x320a70,_0x3b65af[_0x6b67('0x36')]);return db[_0x6b67('0x2c')]['find'](_0x320a70)[_0x6b67('0x23')](handleEntityNotFound(_0x5d9f6d,null))[_0x6b67('0x23')](respondWithResult(_0x5d9f6d,null))[_0x6b67('0x37')](handleError(_0x5d9f6d,null));};exports[_0x6b67('0x22')]=function(_0x4c3a86,_0x2092f6){if(_0x4c3a86[_0x6b67('0x38')]['id']){delete _0x4c3a86[_0x6b67('0x38')]['id'];}return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4c3a86[_0x6b67('0x29')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x2092f6,null))[_0x6b67('0x23')](saveUpdates(_0x4c3a86['body'],null))[_0x6b67('0x23')](respondWithResult(_0x2092f6,null))[_0x6b67('0x37')](handleError(_0x2092f6,null));};exports[_0x6b67('0x24')]=function(_0x4d259f,_0x3889ef){return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4d259f[_0x6b67('0x29')]['id']}})['then'](handleEntityNotFound(_0x3889ef,null))['then'](removeEntity(_0x3889ef,null))[_0x6b67('0x37')](handleError(_0x3889ef,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index bd786fb..448132d 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 _0x8865=['../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf'];(function(_0x55a1ce,_0x3aba0e){var _0x20a711=function(_0x3642c7){while(--_0x3642c7){_0x55a1ce['push'](_0x55a1ce['shift']());}};_0x20a711(++_0x3aba0e);}(_0x8865,0x173));var _0x5886=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8865[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x5886('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5886('0x1'));var moment=require(_0x5886('0x2'));var BPromise=require('bluebird');var rp=require(_0x5886('0x3'));var fs=require('fs');var path=require(_0x5886('0x4'));var rimraf=require(_0x5886('0x5'));var config=require(_0x5886('0x6'));var attributes=require(_0x5886('0x7'));module[_0x5886('0x8')]=function(_0xd48fdd,_0x141d99){return _0xd48fdd[_0x5886('0x9')]('ChatApplication',attributes,{'tableName':_0x5886('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5886('0xb'),'collate':_0x5886('0xc')});};
\ No newline at end of file
+var _0x5e4a=['chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x1877a0,_0x5353f6){var _0x49b933=function(_0x288094){while(--_0x288094){_0x1877a0['push'](_0x1877a0['shift']());}};_0x49b933(++_0x5353f6);}(_0x5e4a,0x1b5));var _0xa5e4=function(_0x1e68ef,_0x4546e7){_0x1e68ef=_0x1e68ef-0x0;var _0x547bfa=_0x5e4a[_0x1e68ef];return _0x547bfa;};'use strict';var _=require(_0xa5e4('0x0'));var util=require(_0xa5e4('0x1'));var logger=require(_0xa5e4('0x2'))(_0xa5e4('0x3'));var moment=require(_0xa5e4('0x4'));var BPromise=require(_0xa5e4('0x5'));var rp=require(_0xa5e4('0x6'));var fs=require('fs');var path=require(_0xa5e4('0x7'));var rimraf=require(_0xa5e4('0x8'));var config=require(_0xa5e4('0x9'));var attributes=require(_0xa5e4('0xa'));module[_0xa5e4('0xb')]=function(_0x249dc9,_0x5ca551){return _0x249dc9[_0xa5e4('0xc')]('ChatApplication',attributes,{'tableName':_0xa5e4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5e4('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 103fc25..9f359ad 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 _0x88c0=['rpc','../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x2c856c,_0x1eeaa6){var _0xa9d840=function(_0x1576e3){while(--_0x1576e3){_0x2c856c['push'](_0x2c856c['shift']());}};_0xa9d840(++_0x1eeaa6);}(_0x88c0,0x13e));var _0x088c=function(_0x379d46,_0x590ea8){_0x379d46=_0x379d46-0x0;var _0x5f80c6=_0x88c0[_0x379d46];return _0x5f80c6;};'use strict';var _=require('lodash');var util=require(_0x088c('0x0'));var moment=require(_0x088c('0x1'));var BPromise=require('bluebird');var rs=require(_0x088c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x088c('0x3'));var logger=require(_0x088c('0x4'))(_0x088c('0x5'));var config=require(_0x088c('0x6'));var jayson=require(_0x088c('0x7'));var client=jayson[_0x088c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18a09a,_0x44f89b,_0x4e0d2d){return new BPromise(function(_0xa09013,_0x50f61c){return client[_0x088c('0x9')](_0x18a09a,_0x4e0d2d)['then'](function(_0x446e05){logger[_0x088c('0xa')](_0x088c('0xb'),_0x44f89b,_0x088c('0xc'));logger[_0x088c('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x44f89b,_0x088c('0xc'),JSON[_0x088c('0xe')](_0x446e05));if(_0x446e05['error']){if(_0x446e05[_0x088c('0xf')]['code']===0x1f4){logger[_0x088c('0xf')](_0x088c('0xb'),_0x44f89b,_0x446e05[_0x088c('0xf')]['message']);return _0x50f61c(_0x446e05[_0x088c('0xf')][_0x088c('0x10')]);}logger[_0x088c('0xf')](_0x088c('0xb'),_0x44f89b,_0x446e05['error']['message']);return _0xa09013(_0x446e05[_0x088c('0xf')][_0x088c('0x10')]);}else{logger['info'](_0x088c('0xb'),_0x44f89b,'request\x20sent');_0xa09013(_0x446e05[_0x088c('0x11')][_0x088c('0x10')]);}})[_0x088c('0x12')](function(_0x10a216){logger[_0x088c('0xf')](_0x088c('0xb'),_0x44f89b,_0x10a216);_0x50f61c(_0x10a216);});});}
\ No newline at end of file
+var _0x82df=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','bluebird','ioredis','../../mysqldb'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x82df,0xb1));var _0xf82d=function(_0xefd9a0,_0x663dcd){_0xefd9a0=_0xefd9a0-0x0;var _0x355f43=_0x82df[_0xefd9a0];return _0x355f43;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf82d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf82d('0x1'));var db=require(_0xf82d('0x2'))['db'];var utils=require(_0xf82d('0x3'));var logger=require('../../config/logger')(_0xf82d('0x4'));var config=require(_0xf82d('0x5'));var jayson=require(_0xf82d('0x6'));var client=jayson[_0xf82d('0x7')][_0xf82d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6853b5,_0x4878a0,_0x18ea7a){return new BPromise(function(_0x7d3cd0,_0x5a7bc4){return client[_0xf82d('0x9')](_0x6853b5,_0x18ea7a)[_0xf82d('0xa')](function(_0x300cad){logger['info'](_0xf82d('0xb'),_0x4878a0,_0xf82d('0xc'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4878a0,_0xf82d('0xc'),JSON['stringify'](_0x300cad));if(_0x300cad[_0xf82d('0xd')]){if(_0x300cad[_0xf82d('0xd')]['code']===0x1f4){logger[_0xf82d('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4878a0,_0x300cad['error']['message']);return _0x5a7bc4(_0x300cad[_0xf82d('0xd')][_0xf82d('0xe')]);}logger['error'](_0xf82d('0xb'),_0x4878a0,_0x300cad['error']['message']);return _0x7d3cd0(_0x300cad['error']['message']);}else{logger[_0xf82d('0xf')](_0xf82d('0xb'),_0x4878a0,_0xf82d('0xc'));_0x7d3cd0(_0x300cad[_0xf82d('0x10')][_0xf82d('0xe')]);}})[_0xf82d('0x11')](function(_0x1996b8){logger['error'](_0xf82d('0xb'),_0x4878a0,_0x1996b8);_0x5a7bc4(_0x1996b8);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3d18269..529ca3c 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 _0x4fb3=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','exports','multer'];(function(_0x33ca22,_0xbcc94){var _0x1790c3=function(_0x448b06){while(--_0x448b06){_0x33ca22['push'](_0x33ca22['shift']());}};_0x1790c3(++_0xbcc94);}(_0x4fb3,0xb5));var _0x34fb=function(_0x300e3a,_0x25164b){_0x300e3a=_0x300e3a-0x0;var _0xbdd812=_0x4fb3[_0x300e3a];return _0xbdd812;};'use strict';var multer=require(_0x34fb('0x0'));var util=require('util');var path=require(_0x34fb('0x1'));var timeout=require(_0x34fb('0x2'));var express=require(_0x34fb('0x3'));var router=express[_0x34fb('0x4')]();var fs_extra=require(_0x34fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x34fb('0x6'));var config=require(_0x34fb('0x7'));var controller=require(_0x34fb('0x8'));router['get'](_0x34fb('0x9'),auth[_0x34fb('0xa')](),controller[_0x34fb('0xb')]);router['put'](_0x34fb('0x9'),auth[_0x34fb('0xa')](),controller['update']);router['delete'](_0x34fb('0x9'),auth[_0x34fb('0xa')](),controller['destroy']);module[_0x34fb('0xc')]=router;
\ No newline at end of file
+var _0x42de=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x42de,0x9d));var _0xe42d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x42de[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xe42d('0x0'));var util=require(_0xe42d('0x1'));var path=require(_0xe42d('0x2'));var timeout=require(_0xe42d('0x3'));var express=require(_0xe42d('0x4'));var router=express[_0xe42d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe42d('0x6'));var interaction=require(_0xe42d('0x7'));var config=require(_0xe42d('0x8'));var controller=require(_0xe42d('0x9'));router[_0xe42d('0xa')](_0xe42d('0xb'),auth[_0xe42d('0xc')](),controller[_0xe42d('0xd')]);router[_0xe42d('0xe')](_0xe42d('0xb'),auth['isAuthenticated'](),controller[_0xe42d('0xf')]);router[_0xe42d('0x10')](_0xe42d('0xb'),auth['isAuthenticated'](),controller[_0xe42d('0x11')]);module[_0xe42d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 5b73301..de9bb02 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 _0x8b02=['STRING','BOOLEAN'];(function(_0x5452b9,_0x3e1158){var _0x218041=function(_0x566dd1){while(--_0x566dd1){_0x5452b9['push'](_0x5452b9['shift']());}};_0x218041(++_0x3e1158);}(_0x8b02,0x94));var _0x28b0=function(_0x1731bd,_0x4830f0){_0x1731bd=_0x1731bd-0x0;var _0x33e629=_0x8b02[_0x1731bd];return _0x33e629;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x28b0('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x28b0('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe0c1=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5c3c83,_0x4929ef){var _0x1713b9=function(_0x1fd80d){while(--_0x1fd80d){_0x5c3c83['push'](_0x5c3c83['shift']());}};_0x1713b9(++_0x4929ef);}(_0xe0c1,0x175));var _0x1e0c=function(_0xa40467,_0x97ce36){_0xa40467=_0xa40467-0x0;var _0x12f835=_0xe0c1[_0xa40467];return _0x12f835;};'use strict';var Sequelize=require(_0x1e0c('0x0'));module[_0x1e0c('0x1')]={'name':{'type':Sequelize[_0x1e0c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1e0c('0x2')]},'write':{'type':Sequelize[_0x1e0c('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 c75a874..acf327c 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 _0xc5d6=['order','sort','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','params','rawAttributes','intersection','options','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatGroup','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty'];(function(_0x588460,_0x54b426){var _0x144a23=function(_0x5b7892){while(--_0x5b7892){_0x588460['push'](_0x588460['shift']());}};_0x144a23(++_0x54b426);}(_0xc5d6,0x19c));var _0x6c5d=function(_0x3c6efc,_0x44841d){_0x3c6efc=_0x3c6efc-0x0;var _0x386160=_0xc5d6[_0x3c6efc];return _0x386160;};'use strict';var emlformat=require(_0x6c5d('0x0'));var rimraf=require(_0x6c5d('0x1'));var zipdir=require(_0x6c5d('0x2'));var jsonpatch=require(_0x6c5d('0x3'));var rp=require('request-promise');var moment=require(_0x6c5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c5d('0x5'));var util=require('util');var path=require(_0x6c5d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c5d('0x7'));var fs=require('fs');var fs_extra=require(_0x6c5d('0x8'));var _=require(_0x6c5d('0x9'));var squel=require(_0x6c5d('0xa'));var crypto=require(_0x6c5d('0xb'));var jsforce=require(_0x6c5d('0xc'));var deskjs=require(_0x6c5d('0xd'));var toCsv=require(_0x6c5d('0xe'));var querystring=require(_0x6c5d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c5d('0x10'));var qs=require(_0x6c5d('0x11'));var as=require(_0x6c5d('0x12'));var hardwareService=require(_0x6c5d('0x13'));var logger=require(_0x6c5d('0x14'))(_0x6c5d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6c5d('0x16')]=_[_0x6c5d('0x17')](config[_0x6c5d('0x16')],{'host':_0x6c5d('0x18'),'port':0x18eb});var socket=require(_0x6c5d('0x19'))(new Redis(config['redis']));require(_0x6c5d('0x1a'))['register'](socket);function respondWithStatusCode(_0x122fc6,_0x5786e6){_0x5786e6=_0x5786e6||0xcc;return function(_0x17e933){if(_0x17e933){return _0x122fc6[_0x6c5d('0x1b')](_0x5786e6);}return _0x122fc6[_0x6c5d('0x1c')](_0x5786e6)[_0x6c5d('0x1d')]();};}function respondWithResult(_0x3b0683,_0x582353){_0x582353=_0x582353||0xc8;return function(_0x5c86e2){if(_0x5c86e2){return _0x3b0683[_0x6c5d('0x1c')](_0x582353)[_0x6c5d('0x1e')](_0x5c86e2);}};}function respondWithFilteredResult(_0x102e9f,_0x3a15c5){return function(_0x1fc128){if(_0x1fc128){var _0x4a1a14=typeof _0x3a15c5[_0x6c5d('0x1f')]==='undefined'&&typeof _0x3a15c5[_0x6c5d('0x20')]==='undefined';var _0x468972=_0x1fc128[_0x6c5d('0x21')];var _0x3ca9e3=_0x4a1a14?0x0:_0x3a15c5[_0x6c5d('0x1f')];var _0x5546a1=_0x4a1a14?_0x1fc128[_0x6c5d('0x21')]:_0x3a15c5[_0x6c5d('0x1f')]+_0x3a15c5['limit'];var _0x1c1a16;if(_0x5546a1>=_0x468972){_0x5546a1=_0x468972;_0x1c1a16=0xc8;}else{_0x1c1a16=0xce;}_0x102e9f[_0x6c5d('0x1c')](_0x1c1a16);return _0x102e9f['set'](_0x6c5d('0x22'),_0x3ca9e3+'-'+_0x5546a1+'/'+_0x468972)[_0x6c5d('0x1e')](_0x1fc128);}return null;};}function patchUpdates(_0x55a896){return function(_0x5b7914){try{jsonpatch[_0x6c5d('0x23')](_0x5b7914,_0x55a896,!![]);}catch(_0x164ed0){return BPromise[_0x6c5d('0x24')](_0x164ed0);}return _0x5b7914[_0x6c5d('0x25')]();};}function saveUpdates(_0x2134b0,_0x465202){return function(_0x4735bf){if(_0x4735bf){return _0x4735bf[_0x6c5d('0x26')](_0x2134b0)[_0x6c5d('0x27')](function(_0x4b67ed){return _0x4b67ed;});}return null;};}function removeEntity(_0x1fb2e2,_0x201602){return function(_0x29cdba){if(_0x29cdba){return _0x29cdba[_0x6c5d('0x28')]()[_0x6c5d('0x27')](function(){_0x1fb2e2[_0x6c5d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x474443,_0x27ba8c){return function(_0x223229){if(!_0x223229){_0x474443['sendStatus'](0x194);}return _0x223229;};}function handleError(_0xb74692,_0x424fa2){_0x424fa2=_0x424fa2||0x1f4;return function(_0x922f2a){logger[_0x6c5d('0x29')](_0x922f2a[_0x6c5d('0x2a')]);if(_0x922f2a[_0x6c5d('0x2b')]){delete _0x922f2a[_0x6c5d('0x2b')];}_0xb74692[_0x6c5d('0x1c')](_0x424fa2)[_0x6c5d('0x2c')](_0x922f2a);};}exports[_0x6c5d('0x2d')]=function(_0xf7752c,_0x29f604){var _0x581824={},_0x4220da={},_0x3b0f03={'count':0x0,'rows':[]};var _0x44d7a7=_['map'](db[_0x6c5d('0x2e')]['rawAttributes'],function(_0xf8a441){return{'name':_0xf8a441[_0x6c5d('0x2f')],'type':_0xf8a441[_0x6c5d('0x30')][_0x6c5d('0x31')]};});_0x4220da[_0x6c5d('0x32')]=_[_0x6c5d('0x33')](_0x44d7a7,'name');_0x4220da['query']=_[_0x6c5d('0x34')](_0xf7752c[_0x6c5d('0x35')]);_0x4220da['filters']=_['intersection'](_0x4220da['model'],_0x4220da[_0x6c5d('0x35')]);_0x581824[_0x6c5d('0x36')]=_['intersection'](_0x4220da[_0x6c5d('0x32')],qs[_0x6c5d('0x37')](_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x37')]));_0x581824['attributes']=_0x581824['attributes'][_0x6c5d('0x38')]?_0x581824[_0x6c5d('0x36')]:_0x4220da['model'];if(!_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x39')]('nolimit')){_0x581824['limit']=qs[_0x6c5d('0x20')](_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x20')]);_0x581824['offset']=qs[_0x6c5d('0x1f')](_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x1f')]);}_0x581824[_0x6c5d('0x3a')]=qs[_0x6c5d('0x3b')](_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x3b')]);_0x581824[_0x6c5d('0x3c')]=qs[_0x6c5d('0x3d')](_[_0x6c5d('0x3e')](_0xf7752c[_0x6c5d('0x35')],_0x4220da['filters']),_0x44d7a7);if(_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x3f')]){_0x581824[_0x6c5d('0x3c')]=_[_0x6c5d('0x40')](_0x581824[_0x6c5d('0x3c')],{'$or':_[_0x6c5d('0x33')](_0x44d7a7,function(_0x23d0d7){if(_0x23d0d7[_0x6c5d('0x30')]!=='VIRTUAL'){var _0x4714fc={};_0x4714fc[_0x23d0d7[_0x6c5d('0x2b')]]={'$like':'%'+_0xf7752c['query'][_0x6c5d('0x3f')]+'%'};return _0x4714fc;}})});}_0x581824=_[_0x6c5d('0x40')]({},_0x581824,_0xf7752c['options']);var _0x37f300={'where':_0x581824['where']};return db[_0x6c5d('0x2e')][_0x6c5d('0x21')](_0x37f300)[_0x6c5d('0x27')](function(_0x1fbdb6){_0x3b0f03[_0x6c5d('0x21')]=_0x1fbdb6;if(_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x41')]){_0x581824[_0x6c5d('0x42')]=[{'all':!![]}];}return db[_0x6c5d('0x2e')]['findAll'](_0x581824);})[_0x6c5d('0x27')](function(_0x16b9f4){_0x3b0f03[_0x6c5d('0x43')]=_0x16b9f4;return _0x3b0f03;})[_0x6c5d('0x27')](respondWithFilteredResult(_0x29f604,_0x581824))[_0x6c5d('0x44')](handleError(_0x29f604,null));};exports[_0x6c5d('0x45')]=function(_0x217ec4,_0x1338b4){var _0x9dbfc2={'raw':!![],'where':{'id':_0x217ec4[_0x6c5d('0x46')]['id']}},_0xb9a0bb={};_0xb9a0bb['model']=_[_0x6c5d('0x34')](db[_0x6c5d('0x2e')][_0x6c5d('0x47')]);_0xb9a0bb['query']=_[_0x6c5d('0x34')](_0x217ec4[_0x6c5d('0x35')]);_0xb9a0bb[_0x6c5d('0x3d')]=_[_0x6c5d('0x48')](_0xb9a0bb[_0x6c5d('0x32')],_0xb9a0bb['query']);_0x9dbfc2[_0x6c5d('0x36')]=_[_0x6c5d('0x48')](_0xb9a0bb[_0x6c5d('0x32')],qs[_0x6c5d('0x37')](_0x217ec4[_0x6c5d('0x35')][_0x6c5d('0x37')]));_0x9dbfc2[_0x6c5d('0x36')]=_0x9dbfc2[_0x6c5d('0x36')][_0x6c5d('0x38')]?_0x9dbfc2['attributes']:_0xb9a0bb[_0x6c5d('0x32')];if(_0x217ec4[_0x6c5d('0x35')][_0x6c5d('0x41')]){_0x9dbfc2[_0x6c5d('0x42')]=[{'all':!![]}];}_0x9dbfc2=_[_0x6c5d('0x40')]({},_0x9dbfc2,_0x217ec4[_0x6c5d('0x49')]);return db[_0x6c5d('0x2e')][_0x6c5d('0x4a')](_0x9dbfc2)[_0x6c5d('0x27')](handleEntityNotFound(_0x1338b4,null))[_0x6c5d('0x27')](respondWithResult(_0x1338b4,null))[_0x6c5d('0x44')](handleError(_0x1338b4,null));};exports[_0x6c5d('0x4b')]=function(_0x871037,_0x10ef98){return db[_0x6c5d('0x2e')][_0x6c5d('0x4b')](_0x871037[_0x6c5d('0x4c')],{})[_0x6c5d('0x27')](respondWithResult(_0x10ef98,0xc9))['catch'](handleError(_0x10ef98,null));};exports[_0x6c5d('0x26')]=function(_0x491194,_0x3998da){if(_0x491194[_0x6c5d('0x4c')]['id']){delete _0x491194[_0x6c5d('0x4c')]['id'];}return db['ChatGroup'][_0x6c5d('0x4a')]({'where':{'id':_0x491194[_0x6c5d('0x46')]['id']}})[_0x6c5d('0x27')](handleEntityNotFound(_0x3998da,null))['then'](saveUpdates(_0x491194['body'],null))[_0x6c5d('0x27')](respondWithResult(_0x3998da,null))[_0x6c5d('0x44')](handleError(_0x3998da,null));};exports[_0x6c5d('0x28')]=function(_0x3f2fd3,_0x52365f){return db['ChatGroup'][_0x6c5d('0x4a')]({'where':{'id':_0x3f2fd3[_0x6c5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x52365f,null))[_0x6c5d('0x27')](removeEntity(_0x52365f,null))[_0x6c5d('0x44')](handleError(_0x52365f,null));};exports[_0x6c5d('0x4d')]=function(_0xb97c00,_0x2d731e){return db['ChatGroup'][_0x6c5d('0x4d')]()[_0x6c5d('0x27')](respondWithResult(_0x2d731e,null))[_0x6c5d('0x44')](handleError(_0x2d731e,null));};exports['getUnread']=function(_0xcf571e,_0x4c90ea,_0x39b014){return db[_0x6c5d('0x4e')][_0x6c5d('0x21')]({'where':{'ChatGroupId':_0xcf571e[_0x6c5d('0x46')]['id'],'ToId':_0xcf571e[_0x6c5d('0x4f')]['id'],'read':![]}})[_0x6c5d('0x27')](function(_0x35bf31){return{'id':_[_0x6c5d('0x50')](_0xcf571e['params']['id']),'count':_0x35bf31};})[_0x6c5d('0x27')](respondWithResult(_0x4c90ea,null))[_0x6c5d('0x44')](handleError(_0x4c90ea,null));};exports[_0x6c5d('0x51')]=function(_0x445a92,_0x258351,_0x28473d){return db['ChatGroup']['find']({'where':{'id':_0x445a92[_0x6c5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x258351,null))[_0x6c5d('0x27')](function(_0x11ccf8){if(_0x11ccf8){return _0x11ccf8[_0x6c5d('0x51')](_0x445a92[_0x6c5d('0x4c')][_0x6c5d('0x52')],_['omit'](_0x445a92[_0x6c5d('0x4c')],[_0x6c5d('0x52'),'id'])||{});}})[_0x6c5d('0x27')](respondWithResult(_0x258351,null))['catch'](handleError(_0x258351,null));};exports[_0x6c5d('0x53')]=function(_0x509a07,_0x4dd3d1,_0x3dd8ab){var _0x4785e5={};var _0x523c18={};var _0x343f03;var _0x4eedc4;return db['ChatGroup'][_0x6c5d('0x54')]({'where':{'id':_0x509a07[_0x6c5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x4dd3d1,null))['then'](function(_0x11189b){if(_0x11189b){_0x343f03=_0x11189b;_0x523c18[_0x6c5d('0x32')]=_[_0x6c5d('0x34')](db['User']['rawAttributes']);_0x523c18[_0x6c5d('0x35')]=_[_0x6c5d('0x34')](_0x509a07[_0x6c5d('0x35')]);_0x523c18[_0x6c5d('0x3d')]=_[_0x6c5d('0x48')](_0x523c18['model'],_0x523c18[_0x6c5d('0x35')]);_0x4785e5['attributes']=_['intersection'](_0x523c18['model'],qs['fields'](_0x509a07[_0x6c5d('0x35')][_0x6c5d('0x37')]));_0x4785e5[_0x6c5d('0x36')]=_0x4785e5[_0x6c5d('0x36')][_0x6c5d('0x38')]?_0x4785e5[_0x6c5d('0x36')]:_0x523c18[_0x6c5d('0x32')];_0x4785e5['order']=qs['sort'](_0x509a07[_0x6c5d('0x35')][_0x6c5d('0x3b')]);_0x4785e5['where']=qs[_0x6c5d('0x3d')](_[_0x6c5d('0x3e')](_0x509a07['query'],_0x523c18['filters']));if(_0x509a07[_0x6c5d('0x35')][_0x6c5d('0x3f')]){_0x4785e5['where']=_[_0x6c5d('0x40')](_0x4785e5[_0x6c5d('0x3c')],{'$or':_[_0x6c5d('0x33')](_0x4785e5[_0x6c5d('0x36')],function(_0x207b7d){var _0x1661ec={};_0x1661ec[_0x207b7d]={'$like':'%'+_0x509a07[_0x6c5d('0x35')]['filter']+'%'};return _0x1661ec;})});}_0x4785e5=_[_0x6c5d('0x40')]({},_0x4785e5,_0x509a07[_0x6c5d('0x49')]);return _0x343f03['getMembers'](_0x4785e5);}})[_0x6c5d('0x27')](function(_0x1638a9){if(_0x1638a9){_0x4eedc4=_0x1638a9[_0x6c5d('0x38')];if(!_0x509a07['query']['hasOwnProperty'](_0x6c5d('0x55'))){_0x4785e5[_0x6c5d('0x20')]=qs[_0x6c5d('0x20')](_0x509a07['query']['limit']);_0x4785e5['offset']=qs['offset'](_0x509a07[_0x6c5d('0x35')]['offset']);}return _0x343f03[_0x6c5d('0x53')](_0x4785e5);}})['then'](function(_0x3f5f44){if(_0x3f5f44){return _0x3f5f44?{'count':_0x4eedc4,'rows':_0x3f5f44}:null;}})[_0x6c5d('0x27')](respondWithResult(_0x4dd3d1,null))['catch'](handleError(_0x4dd3d1,null));};exports[_0x6c5d('0x56')]=function(_0x3a0d63,_0x4c6a39,_0x4e7c16){return db[_0x6c5d('0x2e')][_0x6c5d('0x4a')]({'where':{'id':_0x3a0d63[_0x6c5d('0x46')]['id']}})[_0x6c5d('0x27')](handleEntityNotFound(_0x4c6a39,null))['then'](function(_0xb1737){if(_0xb1737){return _0xb1737[_0x6c5d('0x56')](_0x3a0d63[_0x6c5d('0x35')][_0x6c5d('0x52')]);}})[_0x6c5d('0x27')](respondWithStatusCode(_0x4c6a39,null))[_0x6c5d('0x44')](handleError(_0x4c6a39,null));};exports[_0x6c5d('0x57')]=function(_0x33e9dd,_0x46be47,_0x36c566){if(_0x33e9dd[_0x6c5d('0x4c')]['id']){delete _0x33e9dd[_0x6c5d('0x4c')]['id'];}return db[_0x6c5d('0x2e')]['find']({'where':{'id':_0x33e9dd[_0x6c5d('0x46')]['id']}})[_0x6c5d('0x27')](handleEntityNotFound(_0x46be47,null))[_0x6c5d('0x27')](function(_0x149924){if(_0x149924){_0x33e9dd[_0x6c5d('0x4c')][_0x6c5d('0x58')]=_0x149924['id'];return db[_0x6c5d('0x4e')]['create'](_0x33e9dd[_0x6c5d('0x4c')]);}})[_0x6c5d('0x27')](respondWithResult(_0x46be47,null))[_0x6c5d('0x44')](handleError(_0x46be47,null));};exports[_0x6c5d('0x59')]=function(_0x4f90cd,_0x5e8d59,_0x2772e9){var _0x43347e={};var _0x36632e={};var _0x281849;var _0x831f5;return db[_0x6c5d('0x2e')]['findOne']({'where':{'id':_0x4f90cd[_0x6c5d('0x46')]['id']}})[_0x6c5d('0x27')](handleEntityNotFound(_0x5e8d59,null))[_0x6c5d('0x27')](function(_0x47c19d){if(_0x47c19d){_0x281849=_0x47c19d;_0x36632e[_0x6c5d('0x32')]=_[_0x6c5d('0x34')](db[_0x6c5d('0x4e')][_0x6c5d('0x47')]);_0x36632e[_0x6c5d('0x35')]=_[_0x6c5d('0x34')](_0x4f90cd[_0x6c5d('0x35')]);_0x36632e['filters']=_[_0x6c5d('0x48')](_0x36632e[_0x6c5d('0x32')],_0x36632e[_0x6c5d('0x35')]);_0x43347e[_0x6c5d('0x36')]=_[_0x6c5d('0x48')](_0x36632e[_0x6c5d('0x32')],qs[_0x6c5d('0x37')](_0x4f90cd[_0x6c5d('0x35')]['fields']));_0x43347e[_0x6c5d('0x36')]=_0x43347e[_0x6c5d('0x36')]['length']?_0x43347e['attributes']:_0x36632e[_0x6c5d('0x32')];_0x43347e[_0x6c5d('0x3a')]=qs[_0x6c5d('0x3b')](_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x3b')]);_0x43347e[_0x6c5d('0x3c')]=qs[_0x6c5d('0x3d')](_[_0x6c5d('0x3e')](_0x4f90cd['query'],_0x36632e[_0x6c5d('0x3d')]));if(_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x3f')]){_0x43347e['where']=_[_0x6c5d('0x40')](_0x43347e[_0x6c5d('0x3c')],{'$or':_[_0x6c5d('0x33')](_0x43347e[_0x6c5d('0x36')],function(_0x1c3e48){var _0xcc0b48={};_0xcc0b48[_0x1c3e48]={'$like':'%'+_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x3f')]+'%'};return _0xcc0b48;})});}if(_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x5a')]){var _0x1eca20=_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x5a')][_0x6c5d('0x5b')](',');var _0x3eb113={};_0x3eb113[_0x1eca20[0x0]]={'$gte':moment(_0x1eca20[0x1])[_0x6c5d('0x5c')](_0x6c5d('0x5d'))};_0x43347e[_0x6c5d('0x3c')]=_[_0x6c5d('0x40')](_0x43347e['where'],_0x3eb113);}_0x43347e=_[_0x6c5d('0x40')]({},_0x43347e,_0x4f90cd[_0x6c5d('0x49')]);return _0x281849[_0x6c5d('0x59')](_0x43347e);}})[_0x6c5d('0x27')](function(_0x1a92ca){if(_0x1a92ca){_0x831f5=_0x1a92ca['length'];if(!_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x39')]('nolimit')){_0x43347e[_0x6c5d('0x20')]=qs[_0x6c5d('0x20')](_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x20')]);_0x43347e[_0x6c5d('0x1f')]=qs[_0x6c5d('0x1f')](_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x1f')]);}return _0x281849[_0x6c5d('0x59')](_0x43347e);}})[_0x6c5d('0x27')](function(_0x3caf05){if(_0x3caf05){return _0x3caf05?{'count':_0x831f5,'rows':_0x3caf05}:null;}})[_0x6c5d('0x27')](respondWithResult(_0x5e8d59,null))[_0x6c5d('0x44')](handleError(_0x5e8d59,null));};
\ No newline at end of file
+var _0x40e2=['redis','./chatGroup.socket','register','offset','limit','undefined','count','status','Content-Range','json','apply','reject','save','update','then','end','stack','name','map','ChatGroup','rawAttributes','fieldName','type','key','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0x40e2,0x15d));var _0x240e=function(_0x42abd1,_0x7d92f2){_0x42abd1=_0x42abd1-0x0;var _0x115bc1=_0x40e2[_0x42abd1];return _0x115bc1;};'use strict';var emlformat=require(_0x240e('0x0'));var rimraf=require(_0x240e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x240e('0x2'));var moment=require(_0x240e('0x3'));var BPromise=require(_0x240e('0x4'));var Mustache=require(_0x240e('0x5'));var util=require('util');var path=require(_0x240e('0x6'));var sox=require(_0x240e('0x7'));var csv=require(_0x240e('0x8'));var ejs=require(_0x240e('0x9'));var fs=require('fs');var fs_extra=require(_0x240e('0xa'));var _=require(_0x240e('0xb'));var squel=require(_0x240e('0xc'));var crypto=require(_0x240e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x240e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x240e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x240e('0x10'));var qs=require(_0x240e('0x11'));var as=require(_0x240e('0x12'));var hardwareService=require(_0x240e('0x13'));var logger=require('../../config/logger')(_0x240e('0x14'));var utils=require(_0x240e('0x15'));var config=require(_0x240e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x240e('0x17'))['db'];config['redis']=_[_0x240e('0x18')](config['redis'],{'host':_0x240e('0x19'),'port':0x18eb});var socket=require(_0x240e('0x1a'))(new Redis(config[_0x240e('0x1b')]));require(_0x240e('0x1c'))[_0x240e('0x1d')](socket);function respondWithStatusCode(_0x4ea60b,_0x117244){_0x117244=_0x117244||0xcc;return function(_0x5db782){if(_0x5db782){return _0x4ea60b['sendStatus'](_0x117244);}return _0x4ea60b['status'](_0x117244)['end']();};}function respondWithResult(_0x189a08,_0x2966ac){_0x2966ac=_0x2966ac||0xc8;return function(_0x44c50c){if(_0x44c50c){return _0x189a08['status'](_0x2966ac)['json'](_0x44c50c);}};}function respondWithFilteredResult(_0x2dc614,_0x1572c8){return function(_0x2b80b4){if(_0x2b80b4){var _0x427c2f=typeof _0x1572c8[_0x240e('0x1e')]==='undefined'&&typeof _0x1572c8[_0x240e('0x1f')]===_0x240e('0x20');var _0x26a4de=_0x2b80b4['count'];var _0x174452=_0x427c2f?0x0:_0x1572c8[_0x240e('0x1e')];var _0x4517e5=_0x427c2f?_0x2b80b4[_0x240e('0x21')]:_0x1572c8[_0x240e('0x1e')]+_0x1572c8[_0x240e('0x1f')];var _0x441f6e;if(_0x4517e5>=_0x26a4de){_0x4517e5=_0x26a4de;_0x441f6e=0xc8;}else{_0x441f6e=0xce;}_0x2dc614[_0x240e('0x22')](_0x441f6e);return _0x2dc614['set'](_0x240e('0x23'),_0x174452+'-'+_0x4517e5+'/'+_0x26a4de)[_0x240e('0x24')](_0x2b80b4);}return null;};}function patchUpdates(_0x170a9c){return function(_0x233bcd){try{jsonpatch[_0x240e('0x25')](_0x233bcd,_0x170a9c,!![]);}catch(_0x38ad95){return BPromise[_0x240e('0x26')](_0x38ad95);}return _0x233bcd[_0x240e('0x27')]();};}function saveUpdates(_0x47fbd1,_0xf1f331){return function(_0x1b4e96){if(_0x1b4e96){return _0x1b4e96[_0x240e('0x28')](_0x47fbd1)[_0x240e('0x29')](function(_0x4fcb21){return _0x4fcb21;});}return null;};}function removeEntity(_0x3c6e9d,_0x14da96){return function(_0xaef70a){if(_0xaef70a){return _0xaef70a['destroy']()[_0x240e('0x29')](function(){_0x3c6e9d[_0x240e('0x22')](0xcc)[_0x240e('0x2a')]();});}};}function handleEntityNotFound(_0x390c98,_0x4953cc){return function(_0x4c8082){if(!_0x4c8082){_0x390c98['sendStatus'](0x194);}return _0x4c8082;};}function handleError(_0x47e1cf,_0x5a5060){_0x5a5060=_0x5a5060||0x1f4;return function(_0x4b9b57){logger['error'](_0x4b9b57[_0x240e('0x2b')]);if(_0x4b9b57[_0x240e('0x2c')]){delete _0x4b9b57[_0x240e('0x2c')];}_0x47e1cf[_0x240e('0x22')](_0x5a5060)['send'](_0x4b9b57);};}exports['index']=function(_0x45217,_0x291b49){var _0x4da16d={},_0x4f78d8={},_0x37a24a={'count':0x0,'rows':[]};var _0x492b4d=_[_0x240e('0x2d')](db[_0x240e('0x2e')][_0x240e('0x2f')],function(_0x172709){return{'name':_0x172709[_0x240e('0x30')],'type':_0x172709[_0x240e('0x31')][_0x240e('0x32')]};});_0x4f78d8['model']=_[_0x240e('0x2d')](_0x492b4d,_0x240e('0x2c'));_0x4f78d8['query']=_[_0x240e('0x33')](_0x45217[_0x240e('0x34')]);_0x4f78d8['filters']=_['intersection'](_0x4f78d8[_0x240e('0x35')],_0x4f78d8['query']);_0x4da16d['attributes']=_[_0x240e('0x36')](_0x4f78d8[_0x240e('0x35')],qs['fields'](_0x45217[_0x240e('0x34')][_0x240e('0x37')]));_0x4da16d[_0x240e('0x38')]=_0x4da16d[_0x240e('0x38')][_0x240e('0x39')]?_0x4da16d[_0x240e('0x38')]:_0x4f78d8[_0x240e('0x35')];if(!_0x45217[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x4da16d[_0x240e('0x1f')]=qs[_0x240e('0x1f')](_0x45217[_0x240e('0x34')][_0x240e('0x1f')]);_0x4da16d[_0x240e('0x1e')]=qs[_0x240e('0x1e')](_0x45217['query'][_0x240e('0x1e')]);}_0x4da16d[_0x240e('0x3c')]=qs[_0x240e('0x3d')](_0x45217['query'][_0x240e('0x3d')]);_0x4da16d[_0x240e('0x3e')]=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x45217['query'],_0x4f78d8[_0x240e('0x3f')]),_0x492b4d);if(_0x45217[_0x240e('0x34')][_0x240e('0x41')]){_0x4da16d['where']=_[_0x240e('0x42')](_0x4da16d['where'],{'$or':_[_0x240e('0x2d')](_0x492b4d,function(_0x5f0ad1){if(_0x5f0ad1['type']!==_0x240e('0x43')){var _0x4f3de5={};_0x4f3de5[_0x5f0ad1[_0x240e('0x2c')]]={'$like':'%'+_0x45217[_0x240e('0x34')][_0x240e('0x41')]+'%'};return _0x4f3de5;}})});}_0x4da16d=_[_0x240e('0x42')]({},_0x4da16d,_0x45217[_0x240e('0x44')]);var _0x45376c={'where':_0x4da16d['where']};return db[_0x240e('0x2e')][_0x240e('0x21')](_0x45376c)[_0x240e('0x29')](function(_0x406d82){_0x37a24a[_0x240e('0x21')]=_0x406d82;if(_0x45217['query'][_0x240e('0x45')]){_0x4da16d['include']=[{'all':!![]}];}return db['ChatGroup'][_0x240e('0x46')](_0x4da16d);})[_0x240e('0x29')](function(_0x394b5e){_0x37a24a['rows']=_0x394b5e;return _0x37a24a;})['then'](respondWithFilteredResult(_0x291b49,_0x4da16d))[_0x240e('0x47')](handleError(_0x291b49,null));};exports[_0x240e('0x48')]=function(_0x756b96,_0x5433e8){var _0x3b7bde={'raw':!![],'where':{'id':_0x756b96[_0x240e('0x49')]['id']}},_0x596658={};_0x596658['model']=_[_0x240e('0x33')](db[_0x240e('0x2e')][_0x240e('0x2f')]);_0x596658[_0x240e('0x34')]=_[_0x240e('0x33')](_0x756b96[_0x240e('0x34')]);_0x596658[_0x240e('0x3f')]=_[_0x240e('0x36')](_0x596658[_0x240e('0x35')],_0x596658['query']);_0x3b7bde[_0x240e('0x38')]=_['intersection'](_0x596658[_0x240e('0x35')],qs['fields'](_0x756b96['query'][_0x240e('0x37')]));_0x3b7bde['attributes']=_0x3b7bde[_0x240e('0x38')][_0x240e('0x39')]?_0x3b7bde[_0x240e('0x38')]:_0x596658[_0x240e('0x35')];if(_0x756b96[_0x240e('0x34')][_0x240e('0x45')]){_0x3b7bde[_0x240e('0x4a')]=[{'all':!![]}];}_0x3b7bde=_[_0x240e('0x42')]({},_0x3b7bde,_0x756b96[_0x240e('0x44')]);return db['ChatGroup'][_0x240e('0x4b')](_0x3b7bde)['then'](handleEntityNotFound(_0x5433e8,null))['then'](respondWithResult(_0x5433e8,null))['catch'](handleError(_0x5433e8,null));};exports[_0x240e('0x4c')]=function(_0x3ff153,_0x19f6e3){return db['ChatGroup'][_0x240e('0x4c')](_0x3ff153[_0x240e('0x4d')],{})[_0x240e('0x29')](respondWithResult(_0x19f6e3,0xc9))[_0x240e('0x47')](handleError(_0x19f6e3,null));};exports[_0x240e('0x28')]=function(_0x2638d1,_0x28e0c6){if(_0x2638d1['body']['id']){delete _0x2638d1[_0x240e('0x4d')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2638d1['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x28e0c6,null))[_0x240e('0x29')](saveUpdates(_0x2638d1['body'],null))['then'](respondWithResult(_0x28e0c6,null))[_0x240e('0x47')](handleError(_0x28e0c6,null));};exports[_0x240e('0x4e')]=function(_0x4e10c4,_0x3dd92e){return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x4e10c4['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x3dd92e,null))[_0x240e('0x29')](removeEntity(_0x3dd92e,null))[_0x240e('0x47')](handleError(_0x3dd92e,null));};exports[_0x240e('0x4f')]=function(_0x34893e,_0x4947da){return db[_0x240e('0x2e')][_0x240e('0x4f')]()['then'](respondWithResult(_0x4947da,null))[_0x240e('0x47')](handleError(_0x4947da,null));};exports['getUnread']=function(_0x5ef313,_0x1d2bae,_0x26aa2f){return db[_0x240e('0x50')]['count']({'where':{'ChatGroupId':_0x5ef313[_0x240e('0x49')]['id'],'ToId':_0x5ef313['user']['id'],'read':![]}})[_0x240e('0x29')](function(_0x316acd){return{'id':_[_0x240e('0x51')](_0x5ef313['params']['id']),'count':_0x316acd};})[_0x240e('0x29')](respondWithResult(_0x1d2bae,null))['catch'](handleError(_0x1d2bae,null));};exports[_0x240e('0x52')]=function(_0x1835a6,_0x409048,_0x48fe52){return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x1835a6[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x409048,null))[_0x240e('0x29')](function(_0x540c47){if(_0x540c47){return _0x540c47[_0x240e('0x52')](_0x1835a6[_0x240e('0x4d')][_0x240e('0x53')],_['omit'](_0x1835a6['body'],[_0x240e('0x53'),'id'])||{});}})[_0x240e('0x29')](respondWithResult(_0x409048,null))['catch'](handleError(_0x409048,null));};exports[_0x240e('0x54')]=function(_0x2376e8,_0x1e15f4,_0x596959){var _0x314776={};var _0x3a7c78={};var _0x414ae7;var _0x402fa8;return db['ChatGroup'][_0x240e('0x55')]({'where':{'id':_0x2376e8[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x1e15f4,null))['then'](function(_0x3c1659){if(_0x3c1659){_0x414ae7=_0x3c1659;_0x3a7c78[_0x240e('0x35')]=_[_0x240e('0x33')](db[_0x240e('0x56')][_0x240e('0x2f')]);_0x3a7c78[_0x240e('0x34')]=_[_0x240e('0x33')](_0x2376e8['query']);_0x3a7c78['filters']=_[_0x240e('0x36')](_0x3a7c78['model'],_0x3a7c78[_0x240e('0x34')]);_0x314776[_0x240e('0x38')]=_['intersection'](_0x3a7c78[_0x240e('0x35')],qs[_0x240e('0x37')](_0x2376e8[_0x240e('0x34')][_0x240e('0x37')]));_0x314776[_0x240e('0x38')]=_0x314776[_0x240e('0x38')][_0x240e('0x39')]?_0x314776[_0x240e('0x38')]:_0x3a7c78[_0x240e('0x35')];_0x314776['order']=qs[_0x240e('0x3d')](_0x2376e8['query'][_0x240e('0x3d')]);_0x314776['where']=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x2376e8[_0x240e('0x34')],_0x3a7c78[_0x240e('0x3f')]));if(_0x2376e8[_0x240e('0x34')][_0x240e('0x41')]){_0x314776[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x314776[_0x240e('0x3e')],{'$or':_[_0x240e('0x2d')](_0x314776[_0x240e('0x38')],function(_0x19f9e1){var _0x960955={};_0x960955[_0x19f9e1]={'$like':'%'+_0x2376e8[_0x240e('0x34')]['filter']+'%'};return _0x960955;})});}_0x314776=_['merge']({},_0x314776,_0x2376e8[_0x240e('0x44')]);return _0x414ae7[_0x240e('0x54')](_0x314776);}})['then'](function(_0x40353f){if(_0x40353f){_0x402fa8=_0x40353f[_0x240e('0x39')];if(!_0x2376e8[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x314776['limit']=qs[_0x240e('0x1f')](_0x2376e8['query'][_0x240e('0x1f')]);_0x314776['offset']=qs[_0x240e('0x1e')](_0x2376e8[_0x240e('0x34')][_0x240e('0x1e')]);}return _0x414ae7[_0x240e('0x54')](_0x314776);}})[_0x240e('0x29')](function(_0x1be30d){if(_0x1be30d){return _0x1be30d?{'count':_0x402fa8,'rows':_0x1be30d}:null;}})['then'](respondWithResult(_0x1e15f4,null))[_0x240e('0x47')](handleError(_0x1e15f4,null));};exports[_0x240e('0x57')]=function(_0x5ef2a8,_0x35736e,_0x163d49){return db[_0x240e('0x2e')]['find']({'where':{'id':_0x5ef2a8[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x35736e,null))[_0x240e('0x29')](function(_0x5f2004){if(_0x5f2004){return _0x5f2004[_0x240e('0x57')](_0x5ef2a8[_0x240e('0x34')][_0x240e('0x53')]);}})['then'](respondWithStatusCode(_0x35736e,null))['catch'](handleError(_0x35736e,null));};exports[_0x240e('0x58')]=function(_0x4bd5db,_0x5c5dba,_0x52e7e9){if(_0x4bd5db[_0x240e('0x4d')]['id']){delete _0x4bd5db['body']['id'];}return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x4bd5db[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x5c5dba,null))[_0x240e('0x29')](function(_0x9ecc39){if(_0x9ecc39){_0x4bd5db['body'][_0x240e('0x59')]=_0x9ecc39['id'];return db[_0x240e('0x50')][_0x240e('0x4c')](_0x4bd5db['body']);}})[_0x240e('0x29')](respondWithResult(_0x5c5dba,null))[_0x240e('0x47')](handleError(_0x5c5dba,null));};exports['getMessages']=function(_0x3841ec,_0x5e8e55,_0x15e8f6){var _0x322249={};var _0x37a370={};var _0x5a88d4;var _0x3c8773;return db[_0x240e('0x2e')]['findOne']({'where':{'id':_0x3841ec['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x5e8e55,null))[_0x240e('0x29')](function(_0x599b9d){if(_0x599b9d){_0x5a88d4=_0x599b9d;_0x37a370[_0x240e('0x35')]=_[_0x240e('0x33')](db[_0x240e('0x50')][_0x240e('0x2f')]);_0x37a370[_0x240e('0x34')]=_[_0x240e('0x33')](_0x3841ec['query']);_0x37a370[_0x240e('0x3f')]=_[_0x240e('0x36')](_0x37a370['model'],_0x37a370[_0x240e('0x34')]);_0x322249[_0x240e('0x38')]=_['intersection'](_0x37a370['model'],qs[_0x240e('0x37')](_0x3841ec[_0x240e('0x34')]['fields']));_0x322249[_0x240e('0x38')]=_0x322249[_0x240e('0x38')][_0x240e('0x39')]?_0x322249[_0x240e('0x38')]:_0x37a370[_0x240e('0x35')];_0x322249[_0x240e('0x3c')]=qs[_0x240e('0x3d')](_0x3841ec['query'][_0x240e('0x3d')]);_0x322249[_0x240e('0x3e')]=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x3841ec[_0x240e('0x34')],_0x37a370[_0x240e('0x3f')]));if(_0x3841ec['query'][_0x240e('0x41')]){_0x322249[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x322249[_0x240e('0x3e')],{'$or':_[_0x240e('0x2d')](_0x322249[_0x240e('0x38')],function(_0x21a7a8){var _0x12e549={};_0x12e549[_0x21a7a8]={'$like':'%'+_0x3841ec['query']['filter']+'%'};return _0x12e549;})});}if(_0x3841ec[_0x240e('0x34')]['$gte']){var _0x5683cf=_0x3841ec[_0x240e('0x34')][_0x240e('0x5a')][_0x240e('0x5b')](',');var _0x33136f={};_0x33136f[_0x5683cf[0x0]]={'$gte':moment(_0x5683cf[0x1])[_0x240e('0x5c')](_0x240e('0x5d'))};_0x322249[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x322249[_0x240e('0x3e')],_0x33136f);}_0x322249=_[_0x240e('0x42')]({},_0x322249,_0x3841ec[_0x240e('0x44')]);return _0x5a88d4['getMessages'](_0x322249);}})[_0x240e('0x29')](function(_0x268dfc){if(_0x268dfc){_0x3c8773=_0x268dfc[_0x240e('0x39')];if(!_0x3841ec[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x322249[_0x240e('0x1f')]=qs[_0x240e('0x1f')](_0x3841ec[_0x240e('0x34')][_0x240e('0x1f')]);_0x322249[_0x240e('0x1e')]=qs[_0x240e('0x1e')](_0x3841ec[_0x240e('0x34')][_0x240e('0x1e')]);}return _0x5a88d4['getMessages'](_0x322249);}})[_0x240e('0x29')](function(_0xed495c){if(_0xed495c){return _0xed495c?{'count':_0x3c8773,'rows':_0xed495c}:null;}})['then'](respondWithResult(_0x5e8e55,null))[_0x240e('0x47')](handleError(_0x5e8e55,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 0a0aad0..b7658ab 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 _0x0b36=['ChatGroup','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2f47a9,_0x4805d8){var _0x560aa3=function(_0x1df9e4){while(--_0x1df9e4){_0x2f47a9['push'](_0x2f47a9['shift']());}};_0x560aa3(++_0x4805d8);}(_0x0b36,0x10c));var _0x60b3=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x0b36[_0x419e17];return _0x1f2044;};'use strict';var EventEmitter=require(_0x60b3('0x0'));var ChatGroup=require(_0x60b3('0x1'))['db'][_0x60b3('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x60b3('0x3')};function emitEvent(_0x530d5b){return function(_0xa0e029,_0x19dbae,_0x3afbc7){ChatGroupEvents[_0x60b3('0x4')](_0x530d5b+':'+_0xa0e029['id'],_0xa0e029);ChatGroupEvents[_0x60b3('0x4')](_0x530d5b,_0xa0e029);_0x3afbc7(null);};}for(var e in events){if(events[_0x60b3('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x8786=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup'];(function(_0x48ac17,_0x1147b5){var _0x12c118=function(_0x1b9bdc){while(--_0x1b9bdc){_0x48ac17['push'](_0x48ac17['shift']());}};_0x12c118(++_0x1147b5);}(_0x8786,0x153));var _0x6878=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8786[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0x6878('0x0'));var ChatGroup=require(_0x6878('0x1'))['db'][_0x6878('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6878('0x3'),'afterUpdate':_0x6878('0x4'),'afterDestroy':_0x6878('0x5')};function emitEvent(_0x57ff21){return function(_0x347e06,_0x439475,_0x23647a){ChatGroupEvents[_0x6878('0x6')](_0x57ff21+':'+_0x347e06['id'],_0x347e06);ChatGroupEvents['emit'](_0x57ff21,_0x347e06);_0x23647a(null);};}for(var e in events){if(events[_0x6878('0x7')](e)){var event=events[e];ChatGroup[_0x6878('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 81bec29..c6bf1c5 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 _0x29f6=['api','moment','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x29f6,0xb9));var _0x629f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x629f('0x0'));var util=require('util');var logger=require(_0x629f('0x1'))(_0x629f('0x2'));var moment=require(_0x629f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x629f('0x4'));var rimraf=require(_0x629f('0x5'));var config=require('../../config/environment');var attributes=require(_0x629f('0x6'));module[_0x629f('0x7')]=function(_0x57554c,_0x1a92e2){return _0x57554c[_0x629f('0x8')](_0x629f('0x9'),attributes,{'tableName':_0x629f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1d5=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','ChatGroup'];(function(_0x2a3688,_0x3923aa){var _0x255227=function(_0x5d9443){while(--_0x5d9443){_0x2a3688['push'](_0x2a3688['shift']());}};_0x255227(++_0x3923aa);}(_0xf1d5,0x96));var _0x5f1d=function(_0x222240,_0x465d97){_0x222240=_0x222240-0x0;var _0xbe0206=_0xf1d5[_0x222240];return _0xbe0206;};'use strict';var _=require(_0x5f1d('0x0'));var util=require('util');var logger=require(_0x5f1d('0x1'))(_0x5f1d('0x2'));var moment=require('moment');var BPromise=require(_0x5f1d('0x3'));var rp=require(_0x5f1d('0x4'));var fs=require('fs');var path=require(_0x5f1d('0x5'));var rimraf=require('rimraf');var config=require(_0x5f1d('0x6'));var attributes=require('./chatGroup.attributes');module[_0x5f1d('0x7')]=function(_0x7f1525,_0x29b2f7){return _0x7f1525[_0x5f1d('0x8')](_0x5f1d('0x9'),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 392df3f..e4673d8 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 _0xad86=['ChatGroup,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatGroup.socket','register','request','then','request\x20sent','debug','error','message'];(function(_0x2f7d02,_0x21afa7){var _0x3969ec=function(_0x32aa8e){while(--_0x32aa8e){_0x2f7d02['push'](_0x2f7d02['shift']());}};_0x3969ec(++_0x21afa7);}(_0xad86,0x194));var _0x6ad8=function(_0x51793f,_0xeefc7e){_0x51793f=_0x51793f-0x0;var _0x14b589=_0xad86[_0x51793f];return _0x14b589;};'use strict';var _=require(_0x6ad8('0x0'));var util=require(_0x6ad8('0x1'));var moment=require(_0x6ad8('0x2'));var BPromise=require(_0x6ad8('0x3'));var rs=require(_0x6ad8('0x4'));var fs=require('fs');var Redis=require(_0x6ad8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ad8('0x6'))(_0x6ad8('0x7'));var config=require(_0x6ad8('0x8'));var jayson=require(_0x6ad8('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x6ad8('0xa')]=_[_0x6ad8('0xb')](config[_0x6ad8('0xa')],{'host':_0x6ad8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6ad8('0xd'))[_0x6ad8('0xe')](socket);function respondWithRpcPromise(_0x3a9cae,_0x1c04bc,_0x355abf){return new BPromise(function(_0x3a6b94,_0x41332f){return client[_0x6ad8('0xf')](_0x3a9cae,_0x355abf)[_0x6ad8('0x10')](function(_0x5ca991){logger['info']('ChatGroup,\x20%s,\x20%s',_0x1c04bc,_0x6ad8('0x11'));logger[_0x6ad8('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1c04bc,_0x6ad8('0x11'),JSON['stringify'](_0x5ca991));if(_0x5ca991[_0x6ad8('0x13')]){if(_0x5ca991[_0x6ad8('0x13')]['code']===0x1f4){logger[_0x6ad8('0x13')]('ChatGroup,\x20%s,\x20%s',_0x1c04bc,_0x5ca991[_0x6ad8('0x13')][_0x6ad8('0x14')]);return _0x41332f(_0x5ca991[_0x6ad8('0x13')][_0x6ad8('0x14')]);}logger['error'](_0x6ad8('0x15'),_0x1c04bc,_0x5ca991[_0x6ad8('0x13')][_0x6ad8('0x14')]);return _0x3a6b94(_0x5ca991[_0x6ad8('0x13')]['message']);}else{logger[_0x6ad8('0x16')](_0x6ad8('0x15'),_0x1c04bc,'request\x20sent');_0x3a6b94(_0x5ca991[_0x6ad8('0x17')]['message']);}})[_0x6ad8('0x18')](function(_0x157fa2){logger[_0x6ad8('0x13')](_0x6ad8('0x15'),_0x1c04bc,_0x157fa2);_0x41332f(_0x157fa2);});});}
\ No newline at end of file
+var _0x3148=['ChatGroup,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x6845ef,_0x3c578b){var _0x57bd16=function(_0x5c5591){while(--_0x5c5591){_0x6845ef['push'](_0x6845ef['shift']());}};_0x57bd16(++_0x3c578b);}(_0x3148,0x1d3));var _0x8314=function(_0x29f82c,_0x5a6380){_0x29f82c=_0x29f82c-0x0;var _0x58a330=_0x3148[_0x29f82c];return _0x58a330;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var moment=require('moment');var BPromise=require(_0x8314('0x2'));var rs=require(_0x8314('0x3'));var fs=require('fs');var Redis=require(_0x8314('0x4'));var db=require(_0x8314('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8314('0x6'))(_0x8314('0x7'));var config=require(_0x8314('0x8'));var jayson=require(_0x8314('0x9'));var client=jayson[_0x8314('0xa')][_0x8314('0xb')]({'port':0x232a});config[_0x8314('0xc')]=_['defaults'](config[_0x8314('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8314('0xd'))(new Redis(config[_0x8314('0xc')]));require(_0x8314('0xe'))[_0x8314('0xf')](socket);function respondWithRpcPromise(_0x118966,_0x5284ac,_0x5b5459){return new BPromise(function(_0xfaf56c,_0x34b949){return client[_0x8314('0x10')](_0x118966,_0x5b5459)[_0x8314('0x11')](function(_0x5cf1cf){logger[_0x8314('0x12')](_0x8314('0x13'),_0x5284ac,'request\x20sent');logger[_0x8314('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5284ac,'request\x20sent',JSON[_0x8314('0x15')](_0x5cf1cf));if(_0x5cf1cf[_0x8314('0x16')]){if(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x17')]===0x1f4){logger['error'](_0x8314('0x13'),_0x5284ac,_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);return _0x34b949(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);}logger[_0x8314('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5284ac,_0x5cf1cf['error'][_0x8314('0x18')]);return _0xfaf56c(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);}else{logger['info'](_0x8314('0x13'),_0x5284ac,_0x8314('0x19'));_0xfaf56c(_0x5cf1cf['result'][_0x8314('0x18')]);}})[_0x8314('0x1a')](function(_0x4ac7c8){logger[_0x8314('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5284ac,_0x4ac7c8);_0x34b949(_0x4ac7c8);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 7745d61..99a1a0c 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 _0x6ad9=['update','emit','removeListener','register','length','./chatGroup.events','save','remove'];(function(_0x51a415,_0xf9de36){var _0x16f409=function(_0x2f0dd9){while(--_0x2f0dd9){_0x51a415['push'](_0x51a415['shift']());}};_0x16f409(++_0xf9de36);}(_0x6ad9,0x1bd));var _0x96ad=function(_0x11d0a5,_0x4ecf1f){_0x11d0a5=_0x11d0a5-0x0;var _0x5b1ff4=_0x6ad9[_0x11d0a5];return _0x5b1ff4;};'use strict';var ChatGroupEvents=require(_0x96ad('0x0'));var events=[_0x96ad('0x1'),_0x96ad('0x2'),_0x96ad('0x3')];function createListener(_0x26a951,_0x5724b1){return function(_0xbd7176){_0x5724b1[_0x96ad('0x4')](_0x26a951,_0xbd7176);};}function removeListener(_0x5a4b01,_0x2b241b){return function(){ChatGroupEvents[_0x96ad('0x5')](_0x5a4b01,_0x2b241b);};}exports[_0x96ad('0x6')]=function(_0x5d0be9){for(var _0x10daff=0x0,_0x5c3970=events[_0x96ad('0x7')];_0x10daff<_0x5c3970;_0x10daff++){var _0x4db874=events[_0x10daff];var _0x15a9fe=createListener('chatGroup:'+_0x4db874,_0x5d0be9);ChatGroupEvents['on'](_0x4db874,_0x15a9fe);}};
\ No newline at end of file
+var _0x8e53=['length','chatGroup:','./chatGroup.events','update','register'];(function(_0x5f0c5f,_0x1a58ae){var _0x2112e3=function(_0x419017){while(--_0x419017){_0x5f0c5f['push'](_0x5f0c5f['shift']());}};_0x2112e3(++_0x1a58ae);}(_0x8e53,0x1d8));var _0x38e5=function(_0x8522bf,_0x5d0930){_0x8522bf=_0x8522bf-0x0;var _0x32a616=_0x8e53[_0x8522bf];return _0x32a616;};'use strict';var ChatGroupEvents=require(_0x38e5('0x0'));var events=['save','remove',_0x38e5('0x1')];function createListener(_0x20654c,_0x304fed){return function(_0x41c1de){_0x304fed['emit'](_0x20654c,_0x41c1de);};}function removeListener(_0x29c26e,_0x2f0de0){return function(){ChatGroupEvents['removeListener'](_0x29c26e,_0x2f0de0);};}exports[_0x38e5('0x2')]=function(_0x5c692f){for(var _0x132b26=0x0,_0x206e96=events[_0x38e5('0x3')];_0x132b26<_0x206e96;_0x132b26++){var _0xd7b1c5=events[_0x132b26];var _0x4bd88a=createListener(_0x38e5('0x4')+_0xd7b1c5,_0x5c692f);ChatGroupEvents['on'](_0xd7b1c5,_0x4bd88a);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e73af23..4da985b 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 _0x0283=['../../components/auth/service','./chatGroup.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/unread','getUnread','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage','update','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4ebd4b,_0x460f6b){var _0x40db91=function(_0x2d947c){while(--_0x2d947c){_0x4ebd4b['push'](_0x4ebd4b['shift']());}};_0x40db91(++_0x460f6b);}(_0x0283,0xa1));var _0x3028=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0x0283[_0x9b2bb0];return _0x2cdb3b;};'use strict';var multer=require(_0x3028('0x0'));var util=require(_0x3028('0x1'));var path=require(_0x3028('0x2'));var timeout=require(_0x3028('0x3'));var express=require(_0x3028('0x4'));var router=express[_0x3028('0x5')]();var fs_extra=require(_0x3028('0x6'));var auth=require(_0x3028('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3028('0x8'));router[_0x3028('0x9')]('/',auth['isAuthenticated'](),controller[_0x3028('0xa')]);router[_0x3028('0x9')](_0x3028('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3028('0x9')](_0x3028('0xc'),auth[_0x3028('0xd')](),controller[_0x3028('0xe')]);router['get'](_0x3028('0xf'),auth['isAuthenticated'](),controller[_0x3028('0x10')]);router[_0x3028('0x9')]('/:id/members',auth[_0x3028('0xd')](),controller['getMembers']);router[_0x3028('0x9')]('/:id/messages',auth[_0x3028('0xd')](),controller[_0x3028('0x11')]);router[_0x3028('0x12')]('/',auth[_0x3028('0xd')](),controller[_0x3028('0x13')]);router['post'](_0x3028('0x14'),auth[_0x3028('0xd')](),controller[_0x3028('0x15')]);router['post'](_0x3028('0x16'),auth['isAuthenticated'](),controller[_0x3028('0x17')]);router['put']('/:id',auth[_0x3028('0xd')](),controller[_0x3028('0x18')]);router[_0x3028('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3028('0x19')](_0x3028('0x14'),auth[_0x3028('0xd')](),controller[_0x3028('0x1a')]);module[_0x3028('0x1b')]=router;
\ No newline at end of file
+var _0x90cc=['../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','get','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMessage','put','update','delete','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x36b9ba,_0x1a935a){var _0x5ad6d3=function(_0x1b44ca){while(--_0x1b44ca){_0x36b9ba['push'](_0x36b9ba['shift']());}};_0x5ad6d3(++_0x1a935a);}(_0x90cc,0xd1));var _0xc90c=function(_0x169c54,_0x5d3841){_0x169c54=_0x169c54-0x0;var _0x928a9b=_0x90cc[_0x169c54];return _0x928a9b;};'use strict';var multer=require('multer');var util=require(_0xc90c('0x0'));var path=require(_0xc90c('0x1'));var timeout=require(_0xc90c('0x2'));var express=require(_0xc90c('0x3'));var router=express[_0xc90c('0x4')]();var fs_extra=require(_0xc90c('0x5'));var auth=require(_0xc90c('0x6'));var interaction=require(_0xc90c('0x7'));var config=require(_0xc90c('0x8'));var controller=require(_0xc90c('0x9'));router['get']('/',auth[_0xc90c('0xa')](),controller[_0xc90c('0xb')]);router['get'](_0xc90c('0xc'),auth[_0xc90c('0xa')](),controller[_0xc90c('0xd')]);router['get'](_0xc90c('0xe'),auth[_0xc90c('0xa')](),controller[_0xc90c('0xf')]);router['get'](_0xc90c('0x10'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x11')]);router[_0xc90c('0x12')](_0xc90c('0x13'),auth['isAuthenticated'](),controller[_0xc90c('0x14')]);router[_0xc90c('0x12')](_0xc90c('0x15'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x16')]);router['post']('/',auth[_0xc90c('0xa')](),controller[_0xc90c('0x17')]);router[_0xc90c('0x18')](_0xc90c('0x13'),auth[_0xc90c('0xa')](),controller['addMembers']);router['post'](_0xc90c('0x15'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x19')]);router[_0xc90c('0x1a')](_0xc90c('0xe'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x1b')]);router[_0xc90c('0x1c')]('/:id',auth[_0xc90c('0xa')](),controller['destroy']);router[_0xc90c('0x1c')](_0xc90c('0x13'),auth['isAuthenticated'](),controller[_0xc90c('0x1d')]);module[_0xc90c('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index ef83828..d35c8c1 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 _0x765d=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','DATE','STRING'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x765d,0xd2));var _0xd765=function(_0x18cbd6,_0x1633d2){_0x18cbd6=_0x18cbd6-0x0;var _0x441c99=_0x765d[_0x18cbd6];return _0x441c99;};'use strict';var Sequelize=require(_0xd765('0x0'));module[_0xd765('0x1')]={'closed':{'type':Sequelize[_0xd765('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd765('0x3')]},'ratingType':{'type':Sequelize[_0xd765('0x4')]('star',_0xd765('0x5')),'defaultValue':_0xd765('0x6')},'ratingMessage':{'type':Sequelize[_0xd765('0x7')]},'pathTranscript':{'type':Sequelize[_0xd765('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd765('0x8')]},'disposition':{'type':Sequelize[_0xd765('0x9')]},'secondDisposition':{'type':Sequelize[_0xd765('0x9')]},'thirdDisposition':{'type':Sequelize[_0xd765('0x9')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xd765('0x9')]},'browserVersion':{'type':Sequelize[_0xd765('0x9')]},'osName':{'type':Sequelize[_0xd765('0x9')]},'osVersion':{'type':Sequelize[_0xd765('0x9')]},'deviceModel':{'type':Sequelize[_0xd765('0x9')]},'deviceVendor':{'type':Sequelize[_0xd765('0x9')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xd765('0x7')]},'customerIp':{'type':Sequelize[_0xd765('0x9')]},'formData':{'type':Sequelize[_0xd765('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xd765('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd765('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd765('0x9')]},'customerPort':{'type':Sequelize[_0xd765('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xd765('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xd765('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd765('0x3')]}};
\ No newline at end of file
+var _0x1cdf=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','out'];(function(_0x4e9d27,_0x8f7f92){var _0x2b1a38=function(_0xae029d){while(--_0xae029d){_0x4e9d27['push'](_0x4e9d27['shift']());}};_0x2b1a38(++_0x8f7f92);}(_0x1cdf,0xf3));var _0xf1cd=function(_0x46939d,_0xc1b36d){_0x46939d=_0x46939d-0x0;var _0x5105e8=_0x1cdf[_0x46939d];return _0x5105e8;};'use strict';var Sequelize=require('sequelize');module[_0xf1cd('0x0')]={'closed':{'type':Sequelize[_0xf1cd('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf1cd('0x2')]},'ratingType':{'type':Sequelize[_0xf1cd('0x3')](_0xf1cd('0x4'),_0xf1cd('0x5')),'defaultValue':_0xf1cd('0x4')},'ratingMessage':{'type':Sequelize[_0xf1cd('0x6')]},'pathTranscript':{'type':Sequelize[_0xf1cd('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf1cd('0x7')]},'secondDisposition':{'type':Sequelize[_0xf1cd('0x7')]},'thirdDisposition':{'type':Sequelize[_0xf1cd('0x7')]},'note':{'type':Sequelize[_0xf1cd('0x7')]},'browserName':{'type':Sequelize[_0xf1cd('0x7')]},'browserVersion':{'type':Sequelize[_0xf1cd('0x7')]},'osName':{'type':Sequelize[_0xf1cd('0x7')]},'osVersion':{'type':Sequelize[_0xf1cd('0x7')]},'deviceModel':{'type':Sequelize[_0xf1cd('0x7')]},'deviceVendor':{'type':Sequelize[_0xf1cd('0x7')]},'deviceType':{'type':Sequelize[_0xf1cd('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf1cd('0x7')]},'formData':{'type':Sequelize[_0xf1cd('0x6')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf1cd('0x3')]('in',_0xf1cd('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf1cd('0x7')]},'customerPort':{'type':Sequelize[_0xf1cd('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xf1cd('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf1cd('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 33724f7..fe6b6bc 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 _0xfc64=['destroy','stack','name','send','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','params','keys','rawAttributes','query','filters','model','attributes','intersection','fields','length','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','user','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','root','join','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','User','ContactId','Messages','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','order','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','hasOwnProperty','includeAgent','addTags','setTags','omit','spread','emit','removeTags','unix','toString','server','tmp','push','firstName','lastName','attachments','read','Owner','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update'];(function(_0x1b1426,_0x5a45e9){var _0x44b0d5=function(_0x48317b){while(--_0x48317b){_0x1b1426['push'](_0x1b1426['shift']());}};_0x44b0d5(++_0x5a45e9);}(_0xfc64,0x9f));var _0x4fc6=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfc64[_0x6131cd];return _0x47e916;};'use strict';var rimraf=require(_0x4fc6('0x0'));var zipdir=require(_0x4fc6('0x1'));var rp=require('request-promise');var moment=require(_0x4fc6('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4fc6('0x3'));var Redis=require(_0x4fc6('0x4'));var interaction=require(_0x4fc6('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4fc6('0x6'));var logger=require(_0x4fc6('0x7'))(_0x4fc6('0x8'));var config=require('../../config/environment');var db=require(_0x4fc6('0x9'))['db'];config[_0x4fc6('0xa')]=_['defaults'](config[_0x4fc6('0xa')],{'host':_0x4fc6('0xb'),'port':0x18eb});var socket=require(_0x4fc6('0xc'))(new Redis(config[_0x4fc6('0xa')]));require(_0x4fc6('0xd'))[_0x4fc6('0xe')](socket);var jayson=require(_0x4fc6('0xf'));var client=jayson[_0x4fc6('0x10')][_0x4fc6('0x11')]({'port':0x232b});var client9004=jayson[_0x4fc6('0x10')][_0x4fc6('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x25dd95,_0x4fd544,_0x3f0c88,_0x4990ce){return new BPromise(function(_0x23120e,_0x5b7852){var _0x49c388=_0x4990ce||client;return _0x49c388['request'](_0x25dd95,_0x3f0c88)[_0x4fc6('0x12')](function(_0xab8d70){logger['info'](_0x4fc6('0x13'),_0x4fd544,_0x4fc6('0x14'));logger[_0x4fc6('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4fd544,'request\x20sent',JSON['stringify'](_0xab8d70));if(_0xab8d70['error']){if(_0xab8d70[_0x4fc6('0x16')][_0x4fc6('0x17')]===0x1f4){logger[_0x4fc6('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4fd544,_0xab8d70['error'][_0x4fc6('0x18')]);return _0x5b7852(_0xab8d70[_0x4fc6('0x16')]['message']);}logger[_0x4fc6('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4fd544,_0xab8d70[_0x4fc6('0x16')]['message']);return _0x23120e(_0xab8d70['error']['message']);}else{logger[_0x4fc6('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x4fd544,_0x4fc6('0x14'));_0x23120e(_0xab8d70[_0x4fc6('0x1a')][_0x4fc6('0x18')]);}})[_0x4fc6('0x1b')](function(_0x11f4f8){logger[_0x4fc6('0x16')](_0x4fc6('0x13'),_0x4fd544,_0x11f4f8);_0x5b7852(_0x11f4f8);});});}function respondWithStatusCode(_0x1cc4bd,_0x4c78a7){_0x4c78a7=_0x4c78a7||0xcc;return function(_0x1814e5){if(_0x1814e5){return _0x1cc4bd[_0x4fc6('0x1c')](_0x4c78a7);}return _0x1cc4bd[_0x4fc6('0x1d')](_0x4c78a7)[_0x4fc6('0x1e')]();};}function respondWithResult(_0x35eab1,_0x1d12b3){_0x1d12b3=_0x1d12b3||0xc8;return function(_0x47b570){if(_0x47b570){return _0x35eab1[_0x4fc6('0x1d')](_0x1d12b3)[_0x4fc6('0x1f')](_0x47b570);}};}function respondWithFilteredResult(_0x4de676,_0xcc1f2f){return function(_0x8cbf49){if(_0x8cbf49){var _0x4baabd=typeof _0xcc1f2f[_0x4fc6('0x20')]==='undefined'&&typeof _0xcc1f2f[_0x4fc6('0x21')]===_0x4fc6('0x22');var _0x156b7f=_0x8cbf49[_0x4fc6('0x23')];var _0x5eac17=_0x4baabd?0x0:_0xcc1f2f[_0x4fc6('0x20')];var _0x3af3c8=_0x4baabd?_0x8cbf49[_0x4fc6('0x23')]:_0xcc1f2f[_0x4fc6('0x20')]+_0xcc1f2f['limit'];var _0x36ca34;if(_0x3af3c8>=_0x156b7f){_0x3af3c8=_0x156b7f;_0x36ca34=0xc8;}else{_0x36ca34=0xce;}_0x4de676[_0x4fc6('0x1d')](_0x36ca34);return _0x4de676[_0x4fc6('0x24')](_0x4fc6('0x25'),_0x5eac17+'-'+_0x3af3c8+'/'+_0x156b7f)[_0x4fc6('0x1f')](_0x8cbf49);}return null;};}function saveUpdates(_0x1f8edc){return function(_0x1e189a){if(_0x1e189a){return _0x1e189a[_0x4fc6('0x26')](_0x1f8edc)[_0x4fc6('0x12')](function(_0x508108){return _0x508108;});}return null;};}function removeEntity(_0xa3947e){return function(_0x219ef9){if(_0x219ef9){return _0x219ef9[_0x4fc6('0x27')]()['then'](function(){_0xa3947e[_0x4fc6('0x1d')](0xcc)[_0x4fc6('0x1e')]();});}};}function handleEntityNotFound(_0x5ceef0){return function(_0x506fbb){if(!_0x506fbb){_0x5ceef0[_0x4fc6('0x1c')](0x194);}return _0x506fbb;};}function handleError(_0xf776a5,_0x461ba){_0x461ba=_0x461ba||0x1f4;return function(_0x3f5e78){logger['error'](_0x3f5e78[_0x4fc6('0x28')]);if(_0x3f5e78[_0x4fc6('0x29')]){delete _0x3f5e78[_0x4fc6('0x29')];}_0xf776a5[_0x4fc6('0x1d')](_0x461ba)[_0x4fc6('0x2a')](_0x3f5e78);};}function getMustacheRender(_0x2880b7,_0x3100ce){return Mustache['render'](_0x2880b7,_[_0x4fc6('0x2b')](_0x3100ce[_0x4fc6('0x2c')],{'contact':_0x3100ce[_0x4fc6('0x2d')],'message':_0x3100ce[_0x4fc6('0x18')],'agent':_0x3100ce[_0x4fc6('0x2e')],'interaction':_0x3100ce[_0x4fc6('0x2f')],'account':_0x3100ce[_0x4fc6('0x30')]}))||'';}exports[_0x4fc6('0x31')]=function(_0x1542bd,_0x9475f5){var _0x49218e={};var _0x13a217=_[_0x4fc6('0x32')](db[_0x4fc6('0x33')]['rawAttributes'],function(_0x151029){return{'name':_0x151029[_0x4fc6('0x34')],'type':_0x151029[_0x4fc6('0x35')][_0x4fc6('0x36')]};});_0x49218e=qs[_0x4fc6('0x37')](_0x13a217,_0x1542bd);return interaction[_0x4fc6('0x38')](_0x4fc6('0x39'),_0x1542bd['query'],_0x1542bd['user'],_0x49218e,_0x13a217)['then'](respondWithFilteredResult(_0x9475f5,_0x49218e))[_0x4fc6('0x1b')](handleError(_0x9475f5,null));};exports['show']=function(_0x148850,_0x8d2329){var _0x3d8053={'raw':![],'where':{'id':_0x148850[_0x4fc6('0x3a')]['id']}},_0xa792ed={};_0xa792ed['model']=_[_0x4fc6('0x3b')](db[_0x4fc6('0x33')][_0x4fc6('0x3c')]);_0xa792ed[_0x4fc6('0x3d')]=_[_0x4fc6('0x3b')](_0x148850[_0x4fc6('0x3d')]);_0xa792ed[_0x4fc6('0x3e')]=_['intersection'](_0xa792ed[_0x4fc6('0x3f')],_0xa792ed[_0x4fc6('0x3d')]);_0x3d8053[_0x4fc6('0x40')]=_[_0x4fc6('0x41')](_0xa792ed['model'],qs[_0x4fc6('0x42')](_0x148850[_0x4fc6('0x3d')][_0x4fc6('0x42')]));_0x3d8053[_0x4fc6('0x40')]=_0x3d8053['attributes'][_0x4fc6('0x43')]?_0x3d8053[_0x4fc6('0x40')]:_0xa792ed[_0x4fc6('0x3f')];if(_0x148850[_0x4fc6('0x3d')]['includeAll']){_0x3d8053[_0x4fc6('0x44')]=[{'all':!![]}];}_0x3d8053=_['merge']({},_0x3d8053,_0x148850[_0x4fc6('0x45')]);return db[_0x4fc6('0x33')][_0x4fc6('0x46')](_0x3d8053)[_0x4fc6('0x12')](handleEntityNotFound(_0x8d2329,null))['then'](respondWithResult(_0x8d2329,null))[_0x4fc6('0x1b')](handleError(_0x8d2329,null));};exports[_0x4fc6('0x47')]=function(_0x1d28c6,_0x19132d){return db[_0x4fc6('0x33')][_0x4fc6('0x47')](_0x1d28c6['body'],{})[_0x4fc6('0x12')](respondWithResult(_0x19132d,0xc9))[_0x4fc6('0x1b')](handleError(_0x19132d,null));};exports[_0x4fc6('0x26')]=function(_0x54b28b,_0x4abaab){if(_0x54b28b[_0x4fc6('0x2c')]['id']){delete _0x54b28b[_0x4fc6('0x2c')]['id'];}return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x54b28b[_0x4fc6('0x3a')]['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x4abaab,null))['then'](saveUpdates(_0x54b28b[_0x4fc6('0x2c')],null))[_0x4fc6('0x12')](respondWithResult(_0x4abaab,null))['catch'](handleError(_0x4abaab,null));};exports[_0x4fc6('0x27')]=function(_0x1f458b,_0x460eb2){return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x1f458b[_0x4fc6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x460eb2,null))[_0x4fc6('0x12')](removeEntity(_0x460eb2,null))[_0x4fc6('0x1b')](handleError(_0x460eb2,null));};exports[_0x4fc6('0x48')]=function(_0xb6c9da,_0x1cd548){return db['ChatInteraction'][_0x4fc6('0x48')]()[_0x4fc6('0x12')](respondWithResult(_0x1cd548,null))['catch'](handleError(_0x1cd548,null));};exports[_0x4fc6('0x49')]=function(_0x678a15,_0x542bd5){var _0xc6db2e=_0x678a15[_0x4fc6('0x3a')]['id'];var _0x200fe6;var _0x1d24db;var _0x498c6d;return db[_0x4fc6('0x33')][_0x4fc6('0x4a')]({'where':{'id':_0xc6db2e}})[_0x4fc6('0x12')](function(_0x5b45d6){_0x200fe6=_0x5b45d6;return db[_0x4fc6('0x4b')]['findOne']({'where':{'id':_0x5b45d6[_0x4fc6('0x4c')]},'attributes':['id',_0x4fc6('0x4d'),_0x4fc6('0x4e'),_0x4fc6('0x4f'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x4fc6('0x12')](function(_0x50ce8c){if(_0x50ce8c&&_0x50ce8c[_0x4fc6('0x4d')]&&_0x50ce8c[_0x4fc6('0x4e')]){_0x1d24db=_0x50ce8c;var _0x45c24b={'interaction':{'id':_0xc6db2e},'agent':{'id':_0x678a15[_0x4fc6('0x50')]['id'],'name':_0x678a15[_0x4fc6('0x50')]['name'],'fullname':_0x678a15['user'][_0x4fc6('0x51')],'email':_0x678a15[_0x4fc6('0x50')]['email']},'contact':_0x678a15[_0x4fc6('0x2c')][_0x4fc6('0x2d')],'account':_0x678a15[_0x4fc6('0x2c')][_0x4fc6('0x30')]};var _0x190a07={'rejectUnauthorized':![],'method':_0x4fc6('0x52'),'url':_0x4fc6('0x53'),'headers':{'X-APIKEY':_0x50ce8c['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x678a15[_0x4fc6('0x50')]['email']],'buttons':null,'topic':_0x1d24db[_0x4fc6('0x4f')],'note':_[_0x4fc6('0x54')](_0x1d24db['vidaooNote'])?null:getMustacheRender(_0x1d24db[_0x4fc6('0x55')],_0x45c24b),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x4fc6('0x54')](_0x1d24db[_0x4fc6('0x56')])){var _0x4832b7=getMustacheRender(_0x1d24db['vidaooMetadata'],_0x45c24b);var _0x588970=JSON['parse'](_0x4832b7);_0x190a07[_0x4fc6('0x2c')][_0x4fc6('0x57')]=_0x588970;}}catch(_0x43114c){throw new db[(_0x4fc6('0x58'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x190a07);}else{throw new db[(_0x4fc6('0x58'))][(_0x4fc6('0x59'))](_0x4fc6('0x5a'));}})[_0x4fc6('0x12')](function(_0x4a62fd){_0x498c6d=_0x4a62fd;if(_0x498c6d['id']){var _0x331a92={'body':_0x498c6d[_0x4fc6('0x5b')],'ChatWebsiteId':_0x1d24db['id'],'ChatInteractionId':_0x200fe6['id'],'direction':_0x4fc6('0x5c'),'UserId':_0x678a15['user']['id']};return db[_0x4fc6('0x5d')][_0x4fc6('0x47')](_0x331a92,{});}else{throw new db[(_0x4fc6('0x58'))][(_0x4fc6('0x59'))](_0x4fc6('0x5e'));}})['then'](function(){return _0x200fe6[_0x4fc6('0x5f')]({'vidaooSessionId':_0x498c6d['id']});})[_0x4fc6('0x12')](respondWithResult(_0x542bd5,null))['catch'](handleError(_0x542bd5,null));};exports[_0x4fc6('0x60')]=function(_0x3e4b17,_0xb94fbc){if(_0x3e4b17[_0x4fc6('0x2c')]['id']){delete _0x3e4b17['body']['id'];}return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x3e4b17['params']['id']},'include':[{'model':db[_0x4fc6('0x61')],'as':_0x4fc6('0x62')}]})[_0x4fc6('0x12')](handleEntityNotFound(_0xb94fbc,null))[_0x4fc6('0x12')](saveUpdates(_0x3e4b17[_0x4fc6('0x2c')],null))[_0x4fc6('0x12')](respondWithResult(_0xb94fbc,null))['catch'](handleError(_0xb94fbc,null));};exports[_0x4fc6('0x63')]=function(_0x445a04,_0x214439){if(_0x445a04[_0x4fc6('0x2c')]['id']){delete _0x445a04['body']['id'];}return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x445a04[_0x4fc6('0x3a')]['id']}})[_0x4fc6('0x12')](function(_0x566eb8){if(!_0x566eb8){logger[_0x4fc6('0x16')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x4fc6('0x63'),0x194,_0x4fc6('0x64'));_0x214439[_0x4fc6('0x1c')](0x194);}else{if(_0x566eb8[_0x4fc6('0x65')]){throw new db[(_0x4fc6('0x58'))][(_0x4fc6('0x59'))](_0x4fc6('0x66'));}}return _0x566eb8;})[_0x4fc6('0x12')](function(_0x298ea8){if(_0x298ea8){return _0x298ea8[_0x4fc6('0x26')]({'closed':_0x445a04[_0x4fc6('0x2c')][_0x4fc6('0x67')],'disposition':_0x445a04['body'][_0x4fc6('0x68')]})['then'](function(_0x218576){return _0x218576;});}})[_0x4fc6('0x12')](function(){return respondWithRpcPromise(_0x4fc6('0x69'),'abandon',_0x445a04[_0x4fc6('0x2c')],client9004);})['then'](respondWithResult(_0x214439,null))['catch'](handleError(_0x214439,null));};exports[_0x4fc6('0x6a')]=function(_0x1f7f8f,_0x881371){_0x1f7f8f['body'][_0x4fc6('0x29')]=_0x1f7f8f['file'][_0x4fc6('0x6b')];_0x1f7f8f[_0x4fc6('0x2c')][_0x4fc6('0x6c')]=_0x1f7f8f[_0x4fc6('0x6d')]['filename'];_0x1f7f8f[_0x4fc6('0x2c')]['type']=_0x1f7f8f['file'][_0x4fc6('0x6e')];return db[_0x4fc6('0x6f')]['create'](_0x1f7f8f[_0x4fc6('0x2c')])[_0x4fc6('0x12')](respondWithResult(_0x881371,0xc9))['catch'](handleError(_0x881371,null));};exports[_0x4fc6('0x70')]=function(_0x16ea78,_0x482fa6){return db[_0x4fc6('0x33')]['findOne']({'where':{'id':_0x16ea78['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x482fa6,null))[_0x4fc6('0x12')](function(_0x4e2f4f){if(_0x4e2f4f){if(_0x4e2f4f[_0x4fc6('0x67')]){return _0x482fa6['status'](0x193)[_0x4fc6('0x1f')]({'status':0x193,'message':_0x4fc6('0x71')});}return db[_0x4fc6('0x6f')]['findOne']({'where':{'id':_0x16ea78[_0x4fc6('0x3d')][_0x4fc6('0x72')]},'raw':!![]})[_0x4fc6('0x12')](handleEntityNotFound(_0x482fa6,null));}})[_0x4fc6('0x12')](function(_0x161c6b){if(_0x161c6b){var _0xd1278c=_0x161c6b['ChatOfflineMessageId']!==null;var _0x2c4159=path['join'](config[_0x4fc6('0x73')],'server/files/attachments/');if(_0xd1278c){_0x2c4159=path[_0x4fc6('0x74')](_0x2c4159,'offline-chat/');}var _0x56b389=path['join'](_0x2c4159,_0x161c6b[_0x4fc6('0x6c')]);return _0x482fa6[_0x4fc6('0x75')](_0x56b389);}})[_0x4fc6('0x1b')](handleError(_0x482fa6,null));};exports[_0x4fc6('0x76')]=function(_0x1eb4f2,_0x5f2297){var _0x4da04e=null;var _0x242141=null;var _0x4527da=null;if(_0x1eb4f2[_0x4fc6('0x2c')]['id']){delete _0x1eb4f2[_0x4fc6('0x2c')]['id'];}if(_0x1eb4f2[_0x4fc6('0x2c')][_0x4fc6('0x77')]){_0x4527da=path[_0x4fc6('0x74')](config[_0x4fc6('0x73')],_0x4fc6('0x78'),util[_0x4fc6('0x79')]('transcript-%s.txt',Date[_0x4fc6('0x7a')]()));_0x1eb4f2[_0x4fc6('0x2c')][_0x4fc6('0x7b')]=_0x4527da;}return db['ChatInteraction'][_0x4fc6('0x46')]({'where':{'id':_0x1eb4f2['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x4fc6('0x7c')],'as':_0x4fc6('0x7c')}]}]})['then'](handleEntityNotFound(_0x5f2297,null))[_0x4fc6('0x12')](saveUpdates(_0x1eb4f2[_0x4fc6('0x2c')],null))[_0x4fc6('0x12')](function(_0x373a97){if(_0x373a97){_0x4da04e=_0x373a97;return db[_0x4fc6('0x4b')][_0x4fc6('0x46')]({'where':{'id':_0x4da04e[_0x4fc6('0x4c')]}});}})[_0x4fc6('0x12')](function(_0x2bee20){if(_0x2bee20){_0x242141=_0x2bee20;return db[_0x4fc6('0x61')][_0x4fc6('0x46')]({'where':{'id':_0x4da04e[_0x4fc6('0x7d')]}});}})[_0x4fc6('0x12')](function(_0x4d3723){if(_0x4d3723){if(_0x4527da){var _0x1c8309=null;for(var _0xf6c2b4=0x1;_0xf6c2b4<_0x4da04e[_0x4fc6('0x7e')][_0x4fc6('0x43')];++_0xf6c2b4){_0x1c8309=_0x4da04e[_0x4fc6('0x7e')][_0xf6c2b4];var _0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?util['format']('%s%d',_0x242141[_0x4fc6('0x7f')],_0x1c8309[_0x4fc6('0x65')]):_0x4fc6('0x80');var _0x20a21c=_0x1eb4f2['body'][_0x4fc6('0x81')]||util[_0x4fc6('0x79')](_0x4fc6('0x82'),_0x4fc6('0x83'),_0x1c8309[_0x4fc6('0x7d')]);switch(_0x242141[_0x4fc6('0x84')]){case _0x4fc6('0x85'):_0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?util[_0x4fc6('0x79')](_0x4fc6('0x82'),_0x242141[_0x4fc6('0x7f')],_0x1c8309[_0x4fc6('0x65')]):_0x4fc6('0x80');break;case'agent_alias':_0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?_0x1c8309[_0x4fc6('0x7c')][_0x4fc6('0x86')]||_0x1c8309[_0x4fc6('0x7c')][_0x4fc6('0x51')]:_0x4fc6('0x80');break;case _0x4fc6('0x87'):_0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?_0x1c8309[_0x4fc6('0x7c')]['fullname']:_0x4fc6('0x80');break;default:_0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?util[_0x4fc6('0x79')](_0x4fc6('0x82'),_0x242141[_0x4fc6('0x7f')],_0x1c8309[_0x4fc6('0x65')]):_0x4fc6('0x80');}var _0xcc09d0=util[_0x4fc6('0x79')](_0x4fc6('0x88'),moment(_0x1c8309[_0x4fc6('0x89')])[_0x4fc6('0x79')](_0x4fc6('0x8a')),_0x1c8309[_0x4fc6('0x8b')]==='in'?_0x20a21c:_0x5e3bb4,_0x1c8309[_0x4fc6('0x2c')]);if(!_0x1c8309[_0x4fc6('0x8c')]){fs['appendFileSync'](_0x4527da,_0xcc09d0);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4fc6('0x8d')],'as':_0x4fc6('0x8e'),'raw':!![],'include':[{'model':db[_0x4fc6('0x8f')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x4fc6('0x12')](function(_0x49d9d8){if(!_0x49d9d8||!_0x49d9d8[_0x4fc6('0x8e')]||!_0x1eb4f2['body'])return _0x4da04e;var _0x3964c0=_0x49d9d8[_0x4fc6('0x90')]();return respondWithRpcPromise('SendMail',_0x4fc6('0x91'),{'account':_0x3964c0,'message':{'from':util[_0x4fc6('0x79')]('\x22%s\x22\x20<%s>',_0x49d9d8[_0x4fc6('0x29')],_0x49d9d8['email']||_0x49d9d8[_0x4fc6('0x8e')]['user']),'to':_0x1eb4f2[_0x4fc6('0x2c')][_0x4fc6('0x77')],'subject':'Mail\x20Transcript','text':util[_0x4fc6('0x79')](_0x4fc6('0x92'),_0x1eb4f2[_0x4fc6('0x2c')][_0x4fc6('0x77')]),'attachments':[{'path':_0x4527da}]}})[_0x4fc6('0x12')](function(){return _0x4da04e;})[_0x4fc6('0x1b')](function(_0x2409e6){logger['error'](_0x2409e6);});})[_0x4fc6('0x12')](respondWithStatusCode(_0x5f2297,0xc8))[_0x4fc6('0x1b')](handleError(_0x5f2297,null));};exports['addMessage']=function(_0x1b08da,_0x2820c6){return db[_0x4fc6('0x5d')][_0x4fc6('0x46')]({'where':{'id':_0x1b08da['params']['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x2820c6,null))[_0x4fc6('0x12')](function(_0x4b2ac2){if(_0x4b2ac2){return _0x4b2ac2[_0x4fc6('0x93')](_0x1b08da[_0x4fc6('0x2c')][_0x4fc6('0x94')],_['omit'](_0x1b08da[_0x4fc6('0x2c')],[_0x4fc6('0x94'),'id'])||{});}})[_0x4fc6('0x12')](respondWithResult(_0x2820c6,null))['catch'](handleError(_0x2820c6,null));};exports['getMessages']=function(_0xacf389,_0x54d3ed){var _0x318a5a={'raw':![],'where':{}};var _0x777f49={};var _0x33160f={'count':0x0,'rows':[]};return db[_0x4fc6('0x33')][_0x4fc6('0x4a')]({'where':{'id':_0xacf389[_0x4fc6('0x3a')]['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x54d3ed,null))[_0x4fc6('0x12')](function(_0x5a3a84){if(_0x5a3a84){_0x777f49['model']=_[_0x4fc6('0x3b')](db[_0x4fc6('0x5d')][_0x4fc6('0x3c')]);_0x777f49[_0x4fc6('0x3d')]=_[_0x4fc6('0x3b')](_0xacf389[_0x4fc6('0x3d')]);_0x777f49[_0x4fc6('0x3e')]=_[_0x4fc6('0x41')](_0x777f49['model'],_0x777f49[_0x4fc6('0x3d')]);_0x318a5a['attributes']=_[_0x4fc6('0x41')](_0x777f49[_0x4fc6('0x3f')],qs[_0x4fc6('0x42')](_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x42')]));_0x318a5a[_0x4fc6('0x40')]=_0x318a5a['attributes']['length']?_0x318a5a[_0x4fc6('0x40')]:_0x777f49[_0x4fc6('0x3f')];if(!_0xacf389['query']['hasOwnProperty']('nolimit')){_0x318a5a[_0x4fc6('0x21')]=qs[_0x4fc6('0x21')](_0xacf389['query'][_0x4fc6('0x21')]);_0x318a5a[_0x4fc6('0x20')]=qs[_0x4fc6('0x20')](_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x20')]);}_0x318a5a[_0x4fc6('0x95')]=qs['sort'](_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x96')]);_0x318a5a['where']=qs[_0x4fc6('0x3e')](_['pick'](_0xacf389[_0x4fc6('0x3d')],_0x777f49[_0x4fc6('0x3e')]));_0x318a5a[_0x4fc6('0x97')][_0x4fc6('0x98')]=_0x5a3a84['id'];if(_0xacf389[_0x4fc6('0x3d')]['filter']){_0x318a5a[_0x4fc6('0x97')]=_[_0x4fc6('0x2b')](_0x318a5a[_0x4fc6('0x97')],{'$or':_[_0x4fc6('0x32')](_0x318a5a[_0x4fc6('0x40')],function(_0x1d7b5a){var _0x13a47c={};_0x13a47c[_0x1d7b5a]={'$like':'%'+_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x99')]+'%'};return _0x13a47c;})});}if(_0xacf389[_0x4fc6('0x3d')]['$gte']){var _0xae8b3e=_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x9a')][_0x4fc6('0x9b')](',');var _0x2434d0={};_0x2434d0[_0xae8b3e[0x0]]={'$gte':moment(_0xae8b3e[0x1])[_0x4fc6('0x79')](_0x4fc6('0x9c'))};_0x318a5a[_0x4fc6('0x97')]=_[_0x4fc6('0x2b')](_0x318a5a[_0x4fc6('0x97')],_0x2434d0);}_0x318a5a=_[_0x4fc6('0x2b')]({},_0x318a5a,_0xacf389[_0x4fc6('0x45')]);return db[_0x4fc6('0x5d')][_0x4fc6('0x23')]({'where':_0x318a5a[_0x4fc6('0x97')]})[_0x4fc6('0x12')](function(_0x3c4a22){_0x33160f[_0x4fc6('0x23')]=_0x3c4a22;if(_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x9d')]){_0x318a5a[_0x4fc6('0x44')]=[{'all':!![]}];}return db[_0x4fc6('0x5d')][_0x4fc6('0x38')](_0x318a5a);})['then'](function(_0x52c6ba){_0x33160f[_0x4fc6('0x9e')]=_0x52c6ba;return _0x33160f;});}})[_0x4fc6('0x12')](respondWithFilteredResult(_0x54d3ed,_0x318a5a))[_0x4fc6('0x1b')](handleError(_0x54d3ed,null));};exports['getMyMessages']=function(_0x81b7ed,_0x540c02){var _0x496b2a={'where':{}},_0xf354bc={},_0x1ebc25={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4fc6('0x4a')]({'where':{'id':_0x81b7ed[_0x4fc6('0x3a')]['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x540c02,null))[_0x4fc6('0x12')](function(_0x4c1e22){if(_0x4c1e22){_0xf354bc['model']=_[_0x4fc6('0x3b')](db[_0x4fc6('0x5d')][_0x4fc6('0x3c')]);_0xf354bc[_0x4fc6('0x3d')]=_['keys'](_0x81b7ed[_0x4fc6('0x3d')]);_0xf354bc['filters']=_[_0x4fc6('0x41')](_0xf354bc['model'],_0xf354bc['query']);_0x496b2a['attributes']=_[_0x4fc6('0x41')](_0xf354bc[_0x4fc6('0x3f')],qs[_0x4fc6('0x42')](_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x42')]));_0x496b2a[_0x4fc6('0x40')]=_0x496b2a[_0x4fc6('0x40')][_0x4fc6('0x43')]?_0x496b2a['attributes']:_0xf354bc['model'];if(!_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x9f')]('nolimit')){_0x496b2a['limit']=qs[_0x4fc6('0x21')](_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x21')]);_0x496b2a[_0x4fc6('0x20')]=qs['offset'](_0x81b7ed['query'][_0x4fc6('0x20')]);}_0x496b2a['order']=qs[_0x4fc6('0x96')](_0x81b7ed['query'][_0x4fc6('0x96')]);_0x496b2a[_0x4fc6('0x97')]=qs[_0x4fc6('0x3e')](_['pick'](_0x81b7ed['query'],_0xf354bc[_0x4fc6('0x3e')]));_0x496b2a[_0x4fc6('0x97')]['ChatInteractionId']=_0x4c1e22['id'];if(_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x99')]){_0x496b2a['where']=_[_0x4fc6('0x2b')](_0x496b2a[_0x4fc6('0x97')],{'$or':_[_0x4fc6('0x32')](_0x496b2a['attributes'],function(_0x37ca7a){var _0x49ee3f={};_0x49ee3f[_0x37ca7a]={'$like':'%'+_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x99')]+'%'};return _0x49ee3f;})});}_0x496b2a[_0x4fc6('0x97')][_0x4fc6('0x8c')]=![];if(_0x81b7ed[_0x4fc6('0x3d')]['id']){_0x496b2a[_0x4fc6('0x97')]['id']={'$gt':_0x81b7ed[_0x4fc6('0x3d')]['id']};}_0x496b2a=_[_0x4fc6('0x2b')]({},_0x496b2a,_0x81b7ed['options']);return db['ChatMessage']['count']({'where':_0x496b2a[_0x4fc6('0x97')]})[_0x4fc6('0x12')](function(_0x12d291){_0x1ebc25['count']=_0x12d291;_0x496b2a[_0x4fc6('0x44')]=[];if(_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0xa0')]){_0x496b2a['include']['push']({'model':db[_0x4fc6('0x7c')],'as':_0x4fc6('0x7c'),'attributes':['id','fullname','alias']});}if(_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x9d')]){_0x496b2a[_0x4fc6('0x44')]=[{'all':!![]}];}return db[_0x4fc6('0x5d')][_0x4fc6('0x38')](_0x496b2a);})[_0x4fc6('0x12')](function(_0x27b030){_0x1ebc25['rows']=_0x27b030;return _0x1ebc25;});}})[_0x4fc6('0x12')](respondWithFilteredResult(_0x540c02,_0x496b2a))[_0x4fc6('0x1b')](handleError(_0x540c02,null));};exports[_0x4fc6('0xa1')]=function(_0xe15a,_0x525d39){return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0xe15a['params']['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x525d39,null))['then'](function(_0x224af2){if(_0x224af2){return _0x224af2[_0x4fc6('0xa2')](_0xe15a[_0x4fc6('0x2c')][_0x4fc6('0x94')],_[_0x4fc6('0xa3')](_0xe15a[_0x4fc6('0x2c')],['ids','id'])||{})[_0x4fc6('0xa4')](function(){return db['Tag'][_0x4fc6('0x38')]({'attributes':['id',_0x4fc6('0x29'),'color'],'where':{'id':_0xe15a[_0x4fc6('0x2c')][_0x4fc6('0x94')]}});})[_0x4fc6('0x12')](function(_0x1f5f6b){socket[_0x4fc6('0xa5')]('chatInteractionTags:save',{'id':Number(_0xe15a[_0x4fc6('0x3a')]['id']),'tags':_0x1f5f6b||[]});return{'id':Number(_0xe15a[_0x4fc6('0x3a')]['id']),'tags':_0x1f5f6b||[]};});}})[_0x4fc6('0x12')](respondWithResult(_0x525d39,null))[_0x4fc6('0x1b')](handleError(_0x525d39,null));};exports[_0x4fc6('0xa6')]=function(_0x541ab2,_0x3200cc){return db[_0x4fc6('0x33')]['find']({'where':{'id':_0x541ab2[_0x4fc6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3200cc,null))[_0x4fc6('0x12')](function(_0xfdbc0f){if(_0xfdbc0f){return _0xfdbc0f['removeTags'](_0x541ab2[_0x4fc6('0x3d')][_0x4fc6('0x94')]);}})[_0x4fc6('0x12')](respondWithStatusCode(_0x3200cc,null))[_0x4fc6('0x1b')](handleError(_0x3200cc,null));};exports[_0x4fc6('0x75')]=function(_0x4a9147,_0x3698f9){var _0xc8f65=moment()[_0x4fc6('0xa7')]()[_0x4fc6('0xa8')]();var _0x3ba9e3=path['join'](config[_0x4fc6('0x73')],_0x4fc6('0xa9'),'files',_0x4fc6('0xaa'));var _0x40f016=path['join'](config[_0x4fc6('0x73')],_0x4fc6('0xa9'),'files','attachments');var _0x4a4593=path['join'](_0x3ba9e3,_0xc8f65);var _0x30e85a=util[_0x4fc6('0x79')]('transcript-%d-%s.zip',_0x4a9147[_0x4fc6('0x3a')]['id'],_0xc8f65);var _0x39f2c5=path['join'](_0x3ba9e3,_0x30e85a);var _0x240a54=[];_0x240a54['push']({'model':db['User'],'as':_0x4fc6('0x7c'),'attributes':['id',_0x4fc6('0x51')],'raw':!![]});_0x240a54[_0x4fc6('0xab')]({'model':db[_0x4fc6('0x61')],'as':_0x4fc6('0x62'),'attributes':['id',_0x4fc6('0xac'),_0x4fc6('0xad')],'raw':!![]});if(_0x4a9147[_0x4fc6('0x3d')][_0x4fc6('0xae')]){_0x240a54[_0x4fc6('0xab')]({'model':db['Attachment'],'as':_0x4fc6('0x6f'),'raw':!![]});}var _0x18b2fc=[{'model':db['ChatMessage'],'as':_0x4fc6('0x7e'),'attributes':['id',_0x4fc6('0x2c'),_0x4fc6('0x89'),_0x4fc6('0x8b'),_0x4fc6('0x8c'),_0x4fc6('0xaf')],'include':_0x240a54}];_0x18b2fc['push']({'model':db[_0x4fc6('0x4b')],'as':'Account','attributes':['id',_0x4fc6('0x29')]});_0x18b2fc[_0x4fc6('0xab')]({'model':db['User'],'as':_0x4fc6('0xb0'),'attributes':['id','fullname']});return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x4a9147[_0x4fc6('0x3a')]['id']},'include':_0x18b2fc})['then'](handleEntityNotFound(_0x3698f9,null))[_0x4fc6('0x12')](function(_0x51a6d1){if(_0x51a6d1){var _0x4627af=_0x51a6d1['get']({'plain':!![]});fs[_0x4fc6('0xb1')](_0x4a4593);var _0x272bc8={'channel':_0x4fc6('0xb2'),'account':_0x4627af[_0x4fc6('0xb3')][_0x4fc6('0x29')],'agent':_0x4627af[_0x4fc6('0xb0')]?_0x4627af[_0x4fc6('0xb0')][_0x4fc6('0x51')]:_0x4fc6('0xb4'),'createdAt':moment(_0x4627af[_0x4fc6('0x89')])[_0x4fc6('0x79')](_0x4fc6('0x9c'))['toString'](),'closedAt':_0x4627af[_0x4fc6('0x67')]?moment(_0x4627af[_0x4fc6('0xb5')])[_0x4fc6('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4fc6('0xa8')]():'','disposition':_0x4627af[_0x4fc6('0x68')],'chatInfo':{'browser':_0x4627af[_0x4fc6('0xb6')],'os':_0x4627af[_0x4fc6('0xb7')],'referer':_0x4627af[_0x4fc6('0xb8')],'customerIp':_0x4627af[_0x4fc6('0xb9')],'customerPort':_0x4627af[_0x4fc6('0xba')]?_0x4627af[_0x4fc6('0xba')]:'N.A.'},'messages':_(_0x4627af['Messages'])['tail']()[_0x4fc6('0x99')]({'secret':![]})[_0x4fc6('0x32')](function(_0x53aaba){if(_0x53aaba[_0x4fc6('0x6f')]){var _0x4e6a6e=path['join'](_0x40f016,_0x53aaba[_0x4fc6('0x6f')][_0x4fc6('0x6c')]);if(fs[_0x4fc6('0xbb')](_0x4e6a6e)){fs['createReadStream'](_0x4e6a6e)[_0x4fc6('0xbc')](fs[_0x4fc6('0xbd')](path[_0x4fc6('0x74')](_0x4a4593,_0x53aaba['Attachment'][_0x4fc6('0x6c')])));}}return{'date':moment(_0x53aaba[_0x4fc6('0x89')])[_0x4fc6('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4fc6('0xa8')](),'sender':_0x53aaba['direction']===_0x4fc6('0x5c')?_0x53aaba[_0x4fc6('0x7c')]?_0x53aaba[_0x4fc6('0x7c')][_0x4fc6('0x51')]:_0x4fc6('0x80'):_0x53aaba[_0x4fc6('0x62')][_0x4fc6('0xac')]+(_0x53aaba['Contact']['lastName']?'\x20'+_0x53aaba[_0x4fc6('0x62')]['lastName']:''),'body':_0x53aaba[_0x4fc6('0x6f')]?_0x53aaba[_0x4fc6('0x6f')]['basename']:_0x53aaba['body'],'direction':_0x53aaba[_0x4fc6('0x8b')]===_0x4fc6('0x5c')?'A':'C','secret':_0x53aaba['secret'],'read':_0x53aaba['read'],'attachment':_0x53aaba[_0x4fc6('0x6f')]};})[_0x4fc6('0xbe')]()};return ejs[_0x4fc6('0xbf')](path[_0x4fc6('0x74')](config[_0x4fc6('0x73')],_0x4fc6('0xa9'),_0x4fc6('0xc0'),_0x4fc6('0xc1')),{'interaction':_0x272bc8})[_0x4fc6('0x12')](function(_0x2d2e8e){var _0x3638ee=path['join'](_0x4a4593,_0x4fc6('0xc2')+_0x4627af['id']+'-'+_0xc8f65+'.pdf');var _0x45e3b0={'path':_0x3638ee,'channel':_0x4fc6('0xb2'),'interactionId':_0x4627af['id']};return pdf[_0x4fc6('0xc3')](_0x2d2e8e,_0x45e3b0);})[_0x4fc6('0x12')](function(){return new Promise(function(_0x50d3da,_0x57156a){zipdir(_0x4a4593,{'saveTo':_0x39f2c5},function(_0x7cea3,_0x155c68){if(_0x7cea3)return _0x57156a(_0x7cea3);return _0x50d3da(_0x155c68);});})[_0x4fc6('0x12')](function(){return new BPromise(function(_0xfc4b5c,_0x3b9f48){rimraf(_0x4a4593,function(_0x57a028){if(_0x57a028)_0x3b9f48(_0x57a028);return _0xfc4b5c();});});})['then'](function(){return _0x3698f9['download'](_0x39f2c5,_0x30e85a,function(_0x59d344){if(_0x59d344){logger[_0x4fc6('0x16')](_0x4fc6('0xc4'),_0x59d344);}else{fs[_0x4fc6('0xc5')](_0x39f2c5);}});});});}else{return _0x3698f9[_0x4fc6('0x1c')](0xc8);}})[_0x4fc6('0x1b')](handleError(_0x3698f9,null));};
\ No newline at end of file
+var _0x5a45=['join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','nolimit','includeAgent','push','alias','rows','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','rimraf','bluebird','mustache','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','./chatInteraction.socket','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','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','end','stack','name','send','render','merge','body','contact','agent','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','options','create','find','params','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','user','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5a45,0x128));var _0x55a4=function(_0x58e8ff,_0x45af96){_0x58e8ff=_0x58e8ff-0x0;var _0x348be2=_0x5a45[_0x58e8ff];return _0x348be2;};'use strict';var rimraf=require(_0x55a4('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x55a4('0x1'));var Mustache=require(_0x55a4('0x2'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x55a4('0x3'));var Redis=require(_0x55a4('0x4'));var interaction=require(_0x55a4('0x5'));var qs=require(_0x55a4('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x55a4('0x7'))(_0x55a4('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x55a4('0x9')]=_['defaults'](config[_0x55a4('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x55a4('0xa'))[_0x55a4('0xb')](socket);var jayson=require(_0x55a4('0xc'));var client=jayson[_0x55a4('0xd')][_0x55a4('0xe')]({'port':0x232b});var client9004=jayson[_0x55a4('0xd')][_0x55a4('0xe')]({'port':0x232c});function respondWithRpcPromise(_0x5c3c05,_0xdd3d7d,_0xe311c1,_0x3c0a9e){return new BPromise(function(_0x562c24,_0x3248da){var _0x541ba0=_0x3c0a9e||client;return _0x541ba0[_0x55a4('0xf')](_0x5c3c05,_0xe311c1)[_0x55a4('0x10')](function(_0x5cca1b){logger[_0x55a4('0x11')](_0x55a4('0x12'),_0xdd3d7d,_0x55a4('0x13'));logger[_0x55a4('0x14')](_0x55a4('0x15'),_0xdd3d7d,'request\x20sent',JSON[_0x55a4('0x16')](_0x5cca1b));if(_0x5cca1b['error']){if(_0x5cca1b[_0x55a4('0x17')]['code']===0x1f4){logger[_0x55a4('0x17')](_0x55a4('0x12'),_0xdd3d7d,_0x5cca1b[_0x55a4('0x17')]['message']);return _0x3248da(_0x5cca1b[_0x55a4('0x17')][_0x55a4('0x18')]);}logger[_0x55a4('0x17')]('ChatInteraction,\x20%s,\x20%s',_0xdd3d7d,_0x5cca1b[_0x55a4('0x17')][_0x55a4('0x18')]);return _0x562c24(_0x5cca1b[_0x55a4('0x17')]['message']);}else{logger[_0x55a4('0x11')](_0x55a4('0x12'),_0xdd3d7d,_0x55a4('0x13'));_0x562c24(_0x5cca1b[_0x55a4('0x19')][_0x55a4('0x18')]);}})[_0x55a4('0x1a')](function(_0x4bd3ab){logger[_0x55a4('0x17')](_0x55a4('0x12'),_0xdd3d7d,_0x4bd3ab);_0x3248da(_0x4bd3ab);});});}function respondWithStatusCode(_0x32760e,_0x5ab941){_0x5ab941=_0x5ab941||0xcc;return function(_0x85b2db){if(_0x85b2db){return _0x32760e[_0x55a4('0x1b')](_0x5ab941);}return _0x32760e[_0x55a4('0x1c')](_0x5ab941)['end']();};}function respondWithResult(_0x58ea4c,_0x40527e){_0x40527e=_0x40527e||0xc8;return function(_0x27b8ba){if(_0x27b8ba){return _0x58ea4c[_0x55a4('0x1c')](_0x40527e)[_0x55a4('0x1d')](_0x27b8ba);}};}function respondWithFilteredResult(_0x2eaba6,_0x991d7e){return function(_0x2b4c1c){if(_0x2b4c1c){var _0x47a26f=typeof _0x991d7e['offset']===_0x55a4('0x1e')&&typeof _0x991d7e[_0x55a4('0x1f')]===_0x55a4('0x1e');var _0x5cb513=_0x2b4c1c[_0x55a4('0x20')];var _0x1b0aa9=_0x47a26f?0x0:_0x991d7e[_0x55a4('0x21')];var _0x1c1f2f=_0x47a26f?_0x2b4c1c['count']:_0x991d7e[_0x55a4('0x21')]+_0x991d7e[_0x55a4('0x1f')];var _0x8f5fde;if(_0x1c1f2f>=_0x5cb513){_0x1c1f2f=_0x5cb513;_0x8f5fde=0xc8;}else{_0x8f5fde=0xce;}_0x2eaba6[_0x55a4('0x1c')](_0x8f5fde);return _0x2eaba6[_0x55a4('0x22')](_0x55a4('0x23'),_0x1b0aa9+'-'+_0x1c1f2f+'/'+_0x5cb513)[_0x55a4('0x1d')](_0x2b4c1c);}return null;};}function saveUpdates(_0x1e846a){return function(_0x1a59de){if(_0x1a59de){return _0x1a59de[_0x55a4('0x24')](_0x1e846a)[_0x55a4('0x10')](function(_0x7f299b){return _0x7f299b;});}return null;};}function removeEntity(_0x2d2d13){return function(_0x5aac7a){if(_0x5aac7a){return _0x5aac7a['destroy']()['then'](function(){_0x2d2d13[_0x55a4('0x1c')](0xcc)[_0x55a4('0x25')]();});}};}function handleEntityNotFound(_0x252e81){return function(_0x214f61){if(!_0x214f61){_0x252e81[_0x55a4('0x1b')](0x194);}return _0x214f61;};}function handleError(_0x46d4aa,_0x3bc04e){_0x3bc04e=_0x3bc04e||0x1f4;return function(_0x24f4a0){logger[_0x55a4('0x17')](_0x24f4a0[_0x55a4('0x26')]);if(_0x24f4a0[_0x55a4('0x27')]){delete _0x24f4a0[_0x55a4('0x27')];}_0x46d4aa[_0x55a4('0x1c')](_0x3bc04e)[_0x55a4('0x28')](_0x24f4a0);};}function getMustacheRender(_0x260612,_0x227695){return Mustache[_0x55a4('0x29')](_0x260612,_[_0x55a4('0x2a')](_0x227695[_0x55a4('0x2b')],{'contact':_0x227695[_0x55a4('0x2c')],'message':_0x227695[_0x55a4('0x18')],'agent':_0x227695[_0x55a4('0x2d')],'interaction':_0x227695['interaction'],'account':_0x227695['account']}))||'';}exports['index']=function(_0x173ddc,_0x396367){var _0x555807={};var _0x4fa371=_[_0x55a4('0x2e')](db[_0x55a4('0x2f')][_0x55a4('0x30')],function(_0x224527){return{'name':_0x224527[_0x55a4('0x31')],'type':_0x224527[_0x55a4('0x32')][_0x55a4('0x33')]};});_0x555807=qs['getOptions'](_0x4fa371,_0x173ddc);return interaction[_0x55a4('0x34')]('chat',_0x173ddc['query'],_0x173ddc['user'],_0x555807,_0x4fa371)['then'](respondWithFilteredResult(_0x396367,_0x555807))[_0x55a4('0x1a')](handleError(_0x396367,null));};exports[_0x55a4('0x35')]=function(_0x1e9b2f,_0x52be91){var _0xe5b93={'raw':![],'where':{'id':_0x1e9b2f['params']['id']}},_0x331a42={};_0x331a42['model']=_[_0x55a4('0x36')](db[_0x55a4('0x2f')][_0x55a4('0x30')]);_0x331a42[_0x55a4('0x37')]=_[_0x55a4('0x36')](_0x1e9b2f[_0x55a4('0x37')]);_0x331a42[_0x55a4('0x38')]=_[_0x55a4('0x39')](_0x331a42[_0x55a4('0x3a')],_0x331a42[_0x55a4('0x37')]);_0xe5b93[_0x55a4('0x3b')]=_[_0x55a4('0x39')](_0x331a42['model'],qs[_0x55a4('0x3c')](_0x1e9b2f[_0x55a4('0x37')][_0x55a4('0x3c')]));_0xe5b93[_0x55a4('0x3b')]=_0xe5b93[_0x55a4('0x3b')][_0x55a4('0x3d')]?_0xe5b93[_0x55a4('0x3b')]:_0x331a42['model'];if(_0x1e9b2f[_0x55a4('0x37')][_0x55a4('0x3e')]){_0xe5b93[_0x55a4('0x3f')]=[{'all':!![]}];}_0xe5b93=_[_0x55a4('0x2a')]({},_0xe5b93,_0x1e9b2f[_0x55a4('0x40')]);return db['ChatInteraction']['find'](_0xe5b93)[_0x55a4('0x10')](handleEntityNotFound(_0x52be91,null))['then'](respondWithResult(_0x52be91,null))[_0x55a4('0x1a')](handleError(_0x52be91,null));};exports[_0x55a4('0x41')]=function(_0x48e915,_0x23c358){return db[_0x55a4('0x2f')]['create'](_0x48e915[_0x55a4('0x2b')],{})[_0x55a4('0x10')](respondWithResult(_0x23c358,0xc9))[_0x55a4('0x1a')](handleError(_0x23c358,null));};exports[_0x55a4('0x24')]=function(_0x2d5eb7,_0x5c2410){if(_0x2d5eb7[_0x55a4('0x2b')]['id']){delete _0x2d5eb7[_0x55a4('0x2b')]['id'];}return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2d5eb7[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x5c2410,null))[_0x55a4('0x10')](saveUpdates(_0x2d5eb7['body'],null))['then'](respondWithResult(_0x5c2410,null))['catch'](handleError(_0x5c2410,null));};exports['destroy']=function(_0x2c33e3,_0x30bbdc){return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2c33e3[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x30bbdc,null))[_0x55a4('0x10')](removeEntity(_0x30bbdc,null))['catch'](handleError(_0x30bbdc,null));};exports['describe']=function(_0x2457ee,_0x1754ba){return db[_0x55a4('0x2f')]['describe']()[_0x55a4('0x10')](respondWithResult(_0x1754ba,null))['catch'](handleError(_0x1754ba,null));};exports[_0x55a4('0x44')]=function(_0x57a4c9,_0x14e6bf){var _0x55d6f9=_0x57a4c9['params']['id'];var _0x330603;var _0x476347;var _0xff2c74;return db[_0x55a4('0x2f')]['findOne']({'where':{'id':_0x55d6f9}})['then'](function(_0x1110de){_0x330603=_0x1110de;return db[_0x55a4('0x45')][_0x55a4('0x46')]({'where':{'id':_0x1110de[_0x55a4('0x47')]},'attributes':['id',_0x55a4('0x48'),_0x55a4('0x49'),_0x55a4('0x4a'),'vidaooNote',_0x55a4('0x4b')],'raw':!![]});})[_0x55a4('0x10')](function(_0x3ca227){if(_0x3ca227&&_0x3ca227['vidaooApiKey']&&_0x3ca227[_0x55a4('0x49')]){_0x476347=_0x3ca227;var _0x461ff8={'interaction':{'id':_0x55d6f9},'agent':{'id':_0x57a4c9['user']['id'],'name':_0x57a4c9['user'][_0x55a4('0x27')],'fullname':_0x57a4c9['user'][_0x55a4('0x4c')],'email':_0x57a4c9[_0x55a4('0x4d')][_0x55a4('0x4e')]},'contact':_0x57a4c9[_0x55a4('0x2b')][_0x55a4('0x2c')],'account':_0x57a4c9[_0x55a4('0x2b')]['account']};var _0xafaebc={'rejectUnauthorized':![],'method':'POST','url':_0x55a4('0x4f'),'headers':{'X-APIKEY':_0x3ca227[_0x55a4('0x48')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57a4c9[_0x55a4('0x4d')][_0x55a4('0x4e')]],'buttons':null,'topic':_0x476347[_0x55a4('0x4a')],'note':_[_0x55a4('0x50')](_0x476347['vidaooNote'])?null:getMustacheRender(_0x476347[_0x55a4('0x51')],_0x461ff8),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x55a4('0x50')](_0x476347[_0x55a4('0x4b')])){var _0x34fc6d=getMustacheRender(_0x476347[_0x55a4('0x4b')],_0x461ff8);var _0x1f2997=JSON[_0x55a4('0x52')](_0x34fc6d);_0xafaebc[_0x55a4('0x2b')][_0x55a4('0x53')]=_0x1f2997;}}catch(_0x4c8e07){throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x56'));}return rp(_0xafaebc);}else{throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x57'));}})[_0x55a4('0x10')](function(_0x4540c6){_0xff2c74=_0x4540c6;if(_0xff2c74['id']){var _0x2b8b7f={'body':_0xff2c74['join_url'],'ChatWebsiteId':_0x476347['id'],'ChatInteractionId':_0x330603['id'],'direction':_0x55a4('0x58'),'UserId':_0x57a4c9[_0x55a4('0x4d')]['id']};return db[_0x55a4('0x59')][_0x55a4('0x41')](_0x2b8b7f,{});}else{throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x5a'));}})['then'](function(){return _0x330603[_0x55a4('0x5b')]({'vidaooSessionId':_0xff2c74['id']});})['then'](respondWithResult(_0x14e6bf,null))[_0x55a4('0x1a')](handleError(_0x14e6bf,null));};exports[_0x55a4('0x5c')]=function(_0xb38acb,_0x4f3c60){if(_0xb38acb[_0x55a4('0x2b')]['id']){delete _0xb38acb['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0xb38acb[_0x55a4('0x43')]['id']},'include':[{'model':db['CmContact'],'as':_0x55a4('0x5d')}]})[_0x55a4('0x10')](handleEntityNotFound(_0x4f3c60,null))[_0x55a4('0x10')](saveUpdates(_0xb38acb['body'],null))['then'](respondWithResult(_0x4f3c60,null))['catch'](handleError(_0x4f3c60,null));};exports[_0x55a4('0x5e')]=function(_0x144d80,_0x499a73){if(_0x144d80['body']['id']){delete _0x144d80[_0x55a4('0x2b')]['id'];}return db[_0x55a4('0x2f')]['find']({'where':{'id':_0x144d80['params']['id']}})[_0x55a4('0x10')](function(_0x4cd6ea){if(!_0x4cd6ea){logger[_0x55a4('0x17')](_0x55a4('0x5f'),_0x55a4('0x5e'),0x194,_0x55a4('0x60'));_0x499a73['sendStatus'](0x194);}else{if(_0x4cd6ea[_0x55a4('0x61')]){throw new db['Sequelize']['ValidationError'](_0x55a4('0x62'));}}return _0x4cd6ea;})[_0x55a4('0x10')](function(_0x57dc54){if(_0x57dc54){return _0x57dc54[_0x55a4('0x24')]({'closed':_0x144d80[_0x55a4('0x2b')]['closed'],'disposition':_0x144d80[_0x55a4('0x2b')]['disposition']})[_0x55a4('0x10')](function(_0x4a8d55){return _0x4a8d55;});}})[_0x55a4('0x10')](function(){return respondWithRpcPromise(_0x55a4('0x63'),_0x55a4('0x5e'),_0x144d80['body'],client9004);})['then'](respondWithResult(_0x499a73,null))[_0x55a4('0x1a')](handleError(_0x499a73,null));};exports[_0x55a4('0x64')]=function(_0x22484c,_0x811f6d){_0x22484c[_0x55a4('0x2b')]['name']=_0x22484c['file'][_0x55a4('0x65')];_0x22484c[_0x55a4('0x2b')][_0x55a4('0x66')]=_0x22484c[_0x55a4('0x67')][_0x55a4('0x68')];_0x22484c[_0x55a4('0x2b')]['type']=_0x22484c[_0x55a4('0x67')]['mimetype'];return db[_0x55a4('0x69')][_0x55a4('0x41')](_0x22484c[_0x55a4('0x2b')])[_0x55a4('0x10')](respondWithResult(_0x811f6d,0xc9))[_0x55a4('0x1a')](handleError(_0x811f6d,null));};exports[_0x55a4('0x6a')]=function(_0x203d6e,_0x41dbe7){return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x203d6e['params']['id']},'raw':!![]})[_0x55a4('0x10')](handleEntityNotFound(_0x41dbe7,null))[_0x55a4('0x10')](function(_0x1fdca8){if(_0x1fdca8){if(_0x1fdca8[_0x55a4('0x6b')]){return _0x41dbe7[_0x55a4('0x1c')](0x193)[_0x55a4('0x1d')]({'status':0x193,'message':_0x55a4('0x6c')});}return db[_0x55a4('0x69')][_0x55a4('0x46')]({'where':{'id':_0x203d6e[_0x55a4('0x37')][_0x55a4('0x6d')]},'raw':!![]})[_0x55a4('0x10')](handleEntityNotFound(_0x41dbe7,null));}})['then'](function(_0x540318){if(_0x540318){var _0x17387f=_0x540318['ChatOfflineMessageId']!==null;var _0x2d56f9=path[_0x55a4('0x6e')](config['root'],_0x55a4('0x6f'));if(_0x17387f){_0x2d56f9=path[_0x55a4('0x6e')](_0x2d56f9,_0x55a4('0x70'));}var _0x1b7d98=path['join'](_0x2d56f9,_0x540318['basename']);return _0x41dbe7[_0x55a4('0x71')](_0x1b7d98);}})[_0x55a4('0x1a')](handleError(_0x41dbe7,null));};exports[_0x55a4('0x72')]=function(_0x2b237f,_0x13e270){var _0x5bcdc7=null;var _0x4227f2=null;var _0x328dd9=null;if(_0x2b237f['body']['id']){delete _0x2b237f['body']['id'];}if(_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x73')]){_0x328dd9=path[_0x55a4('0x6e')](config[_0x55a4('0x74')],_0x55a4('0x75'),util[_0x55a4('0x76')]('transcript-%s.txt',Date[_0x55a4('0x77')]()));_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x78')]=_0x328dd9;}return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2b237f[_0x55a4('0x43')]['id']},'include':[{'model':db[_0x55a4('0x59')],'as':_0x55a4('0x79'),'include':[{'model':db[_0x55a4('0x7a')],'as':_0x55a4('0x7a')}]}]})[_0x55a4('0x10')](handleEntityNotFound(_0x13e270,null))['then'](saveUpdates(_0x2b237f['body'],null))['then'](function(_0x716346){if(_0x716346){_0x5bcdc7=_0x716346;return db[_0x55a4('0x45')][_0x55a4('0x42')]({'where':{'id':_0x5bcdc7['ChatWebsiteId']}});}})[_0x55a4('0x10')](function(_0x1aafc5){if(_0x1aafc5){_0x4227f2=_0x1aafc5;return db[_0x55a4('0x7b')][_0x55a4('0x42')]({'where':{'id':_0x5bcdc7[_0x55a4('0x7c')]}});}})[_0x55a4('0x10')](function(_0x50ad77){if(_0x50ad77){if(_0x328dd9){var _0x5eef13=null;for(var _0x3d62b6=0x1;_0x3d62b6<_0x5bcdc7[_0x55a4('0x79')][_0x55a4('0x3d')];++_0x3d62b6){_0x5eef13=_0x5bcdc7[_0x55a4('0x79')][_0x3d62b6];var _0x282fd3=_0x5eef13['UserId']?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2['agentAlias'],_0x5eef13['UserId']):_0x55a4('0x7e');var _0x3eefe5=_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x7f')]||util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x55a4('0x80'),_0x5eef13[_0x55a4('0x7c')]);switch(_0x4227f2[_0x55a4('0x81')]){case _0x55a4('0x82'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2[_0x55a4('0x83')],_0x5eef13[_0x55a4('0x61')]):_0x55a4('0x7e');break;case _0x55a4('0x84'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?_0x5eef13[_0x55a4('0x7a')]['alias']||_0x5eef13[_0x55a4('0x7a')][_0x55a4('0x4c')]:_0x55a4('0x7e');break;case _0x55a4('0x85'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?_0x5eef13[_0x55a4('0x7a')][_0x55a4('0x4c')]:'System';break;default:_0x282fd3=_0x5eef13[_0x55a4('0x61')]?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2['agentAlias'],_0x5eef13['UserId']):'System';}var _0x4f36b7=util[_0x55a4('0x76')](_0x55a4('0x86'),moment(_0x5eef13['createdAt'])[_0x55a4('0x76')](_0x55a4('0x87')),_0x5eef13[_0x55a4('0x88')]==='in'?_0x3eefe5:_0x282fd3,_0x5eef13[_0x55a4('0x2b')]);if(!_0x5eef13[_0x55a4('0x89')]){fs['appendFileSync'](_0x328dd9,_0x4f36b7);}}return db['MailAccount'][_0x55a4('0x46')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x55a4('0x8a'),'raw':!![],'include':[{'model':db[_0x55a4('0x8b')],'as':_0x55a4('0x8b'),'raw':!![]}]}]});}}})[_0x55a4('0x10')](function(_0x132a41){if(!_0x132a41||!_0x132a41['Smtp']||!_0x2b237f[_0x55a4('0x2b')])return _0x5bcdc7;var _0x5d8da3=_0x132a41[_0x55a4('0x8c')]();return respondWithRpcPromise(_0x55a4('0x8d'),_0x55a4('0x8e'),{'account':_0x5d8da3,'message':{'from':util[_0x55a4('0x76')](_0x55a4('0x8f'),_0x132a41[_0x55a4('0x27')],_0x132a41[_0x55a4('0x4e')]||_0x132a41[_0x55a4('0x8a')][_0x55a4('0x4d')]),'to':_0x2b237f[_0x55a4('0x2b')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x55a4('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2b237f[_0x55a4('0x2b')]['mailTranscript']),'attachments':[{'path':_0x328dd9}]}})[_0x55a4('0x10')](function(){return _0x5bcdc7;})[_0x55a4('0x1a')](function(_0x1d78ed){logger[_0x55a4('0x17')](_0x1d78ed);});})['then'](respondWithStatusCode(_0x13e270,0xc8))[_0x55a4('0x1a')](handleError(_0x13e270,null));};exports[_0x55a4('0x90')]=function(_0x57b88b,_0x3172b2){return db[_0x55a4('0x59')][_0x55a4('0x42')]({'where':{'id':_0x57b88b['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x3172b2,null))['then'](function(_0x580db2){if(_0x580db2){return _0x580db2[_0x55a4('0x90')](_0x57b88b[_0x55a4('0x2b')]['ids'],_[_0x55a4('0x91')](_0x57b88b[_0x55a4('0x2b')],[_0x55a4('0x92'),'id'])||{});}})[_0x55a4('0x10')](respondWithResult(_0x3172b2,null))[_0x55a4('0x1a')](handleError(_0x3172b2,null));};exports[_0x55a4('0x93')]=function(_0x26877f,_0x33447c){var _0x4a72d3={'raw':![],'where':{}};var _0x585084={};var _0x49d237={'count':0x0,'rows':[]};return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x26877f[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x33447c,null))[_0x55a4('0x10')](function(_0x41b7c8){if(_0x41b7c8){_0x585084[_0x55a4('0x3a')]=_[_0x55a4('0x36')](db[_0x55a4('0x59')]['rawAttributes']);_0x585084[_0x55a4('0x37')]=_['keys'](_0x26877f[_0x55a4('0x37')]);_0x585084[_0x55a4('0x38')]=_[_0x55a4('0x39')](_0x585084[_0x55a4('0x3a')],_0x585084[_0x55a4('0x37')]);_0x4a72d3[_0x55a4('0x3b')]=_[_0x55a4('0x39')](_0x585084[_0x55a4('0x3a')],qs[_0x55a4('0x3c')](_0x26877f[_0x55a4('0x37')]['fields']));_0x4a72d3[_0x55a4('0x3b')]=_0x4a72d3['attributes']['length']?_0x4a72d3[_0x55a4('0x3b')]:_0x585084['model'];if(!_0x26877f[_0x55a4('0x37')][_0x55a4('0x94')]('nolimit')){_0x4a72d3[_0x55a4('0x1f')]=qs[_0x55a4('0x1f')](_0x26877f[_0x55a4('0x37')]['limit']);_0x4a72d3[_0x55a4('0x21')]=qs['offset'](_0x26877f[_0x55a4('0x37')]['offset']);}_0x4a72d3[_0x55a4('0x95')]=qs[_0x55a4('0x96')](_0x26877f[_0x55a4('0x37')][_0x55a4('0x96')]);_0x4a72d3[_0x55a4('0x97')]=qs[_0x55a4('0x38')](_[_0x55a4('0x98')](_0x26877f[_0x55a4('0x37')],_0x585084[_0x55a4('0x38')]));_0x4a72d3[_0x55a4('0x97')][_0x55a4('0x99')]=_0x41b7c8['id'];if(_0x26877f[_0x55a4('0x37')][_0x55a4('0x9a')]){_0x4a72d3[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x4a72d3[_0x55a4('0x97')],{'$or':_[_0x55a4('0x2e')](_0x4a72d3[_0x55a4('0x3b')],function(_0x226d04){var _0x1c9ea5={};_0x1c9ea5[_0x226d04]={'$like':'%'+_0x26877f[_0x55a4('0x37')]['filter']+'%'};return _0x1c9ea5;})});}if(_0x26877f['query'][_0x55a4('0x9b')]){var _0x43b9de=_0x26877f[_0x55a4('0x37')][_0x55a4('0x9b')][_0x55a4('0x9c')](',');var _0x268997={};_0x268997[_0x43b9de[0x0]]={'$gte':moment(_0x43b9de[0x1])['format'](_0x55a4('0x9d'))};_0x4a72d3[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x4a72d3[_0x55a4('0x97')],_0x268997);}_0x4a72d3=_[_0x55a4('0x2a')]({},_0x4a72d3,_0x26877f['options']);return db['ChatMessage'][_0x55a4('0x20')]({'where':_0x4a72d3['where']})['then'](function(_0x2b2440){_0x49d237[_0x55a4('0x20')]=_0x2b2440;if(_0x26877f[_0x55a4('0x37')][_0x55a4('0x3e')]){_0x4a72d3[_0x55a4('0x3f')]=[{'all':!![]}];}return db[_0x55a4('0x59')][_0x55a4('0x34')](_0x4a72d3);})[_0x55a4('0x10')](function(_0x448cc2){_0x49d237['rows']=_0x448cc2;return _0x49d237;});}})[_0x55a4('0x10')](respondWithFilteredResult(_0x33447c,_0x4a72d3))[_0x55a4('0x1a')](handleError(_0x33447c,null));};exports[_0x55a4('0x9e')]=function(_0x2f727c,_0x5ab1bf){var _0x57ef7b={'where':{}},_0x4f7e71={},_0x341d47={'count':0x0,'rows':[]};return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x2f727c[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x5ab1bf,null))[_0x55a4('0x10')](function(_0x79d8b7){if(_0x79d8b7){_0x4f7e71[_0x55a4('0x3a')]=_[_0x55a4('0x36')](db['ChatMessage']['rawAttributes']);_0x4f7e71[_0x55a4('0x37')]=_['keys'](_0x2f727c[_0x55a4('0x37')]);_0x4f7e71[_0x55a4('0x38')]=_['intersection'](_0x4f7e71[_0x55a4('0x3a')],_0x4f7e71[_0x55a4('0x37')]);_0x57ef7b[_0x55a4('0x3b')]=_['intersection'](_0x4f7e71[_0x55a4('0x3a')],qs[_0x55a4('0x3c')](_0x2f727c[_0x55a4('0x37')]['fields']));_0x57ef7b[_0x55a4('0x3b')]=_0x57ef7b[_0x55a4('0x3b')]['length']?_0x57ef7b[_0x55a4('0x3b')]:_0x4f7e71[_0x55a4('0x3a')];if(!_0x2f727c[_0x55a4('0x37')]['hasOwnProperty'](_0x55a4('0x9f'))){_0x57ef7b['limit']=qs[_0x55a4('0x1f')](_0x2f727c['query']['limit']);_0x57ef7b[_0x55a4('0x21')]=qs[_0x55a4('0x21')](_0x2f727c['query'][_0x55a4('0x21')]);}_0x57ef7b[_0x55a4('0x95')]=qs['sort'](_0x2f727c[_0x55a4('0x37')][_0x55a4('0x96')]);_0x57ef7b['where']=qs['filters'](_[_0x55a4('0x98')](_0x2f727c['query'],_0x4f7e71[_0x55a4('0x38')]));_0x57ef7b[_0x55a4('0x97')][_0x55a4('0x99')]=_0x79d8b7['id'];if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0x9a')]){_0x57ef7b[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x57ef7b[_0x55a4('0x97')],{'$or':_[_0x55a4('0x2e')](_0x57ef7b[_0x55a4('0x3b')],function(_0x50a9ae){var _0x3c818e={};_0x3c818e[_0x50a9ae]={'$like':'%'+_0x2f727c[_0x55a4('0x37')]['filter']+'%'};return _0x3c818e;})});}_0x57ef7b['where']['secret']=![];if(_0x2f727c['query']['id']){_0x57ef7b[_0x55a4('0x97')]['id']={'$gt':_0x2f727c[_0x55a4('0x37')]['id']};}_0x57ef7b=_[_0x55a4('0x2a')]({},_0x57ef7b,_0x2f727c[_0x55a4('0x40')]);return db['ChatMessage'][_0x55a4('0x20')]({'where':_0x57ef7b[_0x55a4('0x97')]})[_0x55a4('0x10')](function(_0x406598){_0x341d47[_0x55a4('0x20')]=_0x406598;_0x57ef7b['include']=[];if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0xa0')]){_0x57ef7b['include'][_0x55a4('0xa1')]({'model':db['User'],'as':_0x55a4('0x7a'),'attributes':['id',_0x55a4('0x4c'),_0x55a4('0xa2')]});}if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0x3e')]){_0x57ef7b[_0x55a4('0x3f')]=[{'all':!![]}];}return db[_0x55a4('0x59')][_0x55a4('0x34')](_0x57ef7b);})[_0x55a4('0x10')](function(_0x2d97cc){_0x341d47[_0x55a4('0xa3')]=_0x2d97cc;return _0x341d47;});}})['then'](respondWithFilteredResult(_0x5ab1bf,_0x57ef7b))['catch'](handleError(_0x5ab1bf,null));};exports[_0x55a4('0xa4')]=function(_0x134bf9,_0x37fc77){return db[_0x55a4('0x2f')]['find']({'where':{'id':_0x134bf9['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x37fc77,null))[_0x55a4('0x10')](function(_0x4a8c8a){if(_0x4a8c8a){return _0x4a8c8a[_0x55a4('0xa5')](_0x134bf9[_0x55a4('0x2b')][_0x55a4('0x92')],_[_0x55a4('0x91')](_0x134bf9[_0x55a4('0x2b')],[_0x55a4('0x92'),'id'])||{})['spread'](function(){return db[_0x55a4('0xa6')][_0x55a4('0x34')]({'attributes':['id',_0x55a4('0x27'),_0x55a4('0xa7')],'where':{'id':_0x134bf9[_0x55a4('0x2b')][_0x55a4('0x92')]}});})[_0x55a4('0x10')](function(_0x49140a){socket[_0x55a4('0xa8')](_0x55a4('0xa9'),{'id':Number(_0x134bf9['params']['id']),'tags':_0x49140a||[]});return{'id':Number(_0x134bf9[_0x55a4('0x43')]['id']),'tags':_0x49140a||[]};});}})[_0x55a4('0x10')](respondWithResult(_0x37fc77,null))[_0x55a4('0x1a')](handleError(_0x37fc77,null));};exports[_0x55a4('0xaa')]=function(_0x4f9a77,_0x28d96a){return db['ChatInteraction'][_0x55a4('0x42')]({'where':{'id':_0x4f9a77['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x28d96a,null))[_0x55a4('0x10')](function(_0x4477ab){if(_0x4477ab){return _0x4477ab['removeTags'](_0x4f9a77[_0x55a4('0x37')]['ids']);}})[_0x55a4('0x10')](respondWithStatusCode(_0x28d96a,null))[_0x55a4('0x1a')](handleError(_0x28d96a,null));};exports[_0x55a4('0x71')]=function(_0x24d3b2,_0x27c53f){var _0x3f0351=moment()[_0x55a4('0xab')]()[_0x55a4('0xac')]();var _0x262bcf=path[_0x55a4('0x6e')](config['root'],_0x55a4('0xad'),_0x55a4('0xae'),'tmp');var _0x466a78=path[_0x55a4('0x6e')](config[_0x55a4('0x74')],'server',_0x55a4('0xae'),_0x55a4('0xaf'));var _0x234213=path[_0x55a4('0x6e')](_0x262bcf,_0x3f0351);var _0x1b88b6=util[_0x55a4('0x76')](_0x55a4('0xb0'),_0x24d3b2[_0x55a4('0x43')]['id'],_0x3f0351);var _0x25538d=path['join'](_0x262bcf,_0x1b88b6);var _0x52adc1=[];_0x52adc1[_0x55a4('0xa1')]({'model':db[_0x55a4('0x7a')],'as':_0x55a4('0x7a'),'attributes':['id',_0x55a4('0x4c')],'raw':!![]});_0x52adc1[_0x55a4('0xa1')]({'model':db['CmContact'],'as':_0x55a4('0x5d'),'attributes':['id',_0x55a4('0xb1'),_0x55a4('0xb2')],'raw':!![]});if(_0x24d3b2['query']['attachments']){_0x52adc1['push']({'model':db[_0x55a4('0x69')],'as':'Attachment','raw':!![]});}var _0x52c232=[{'model':db['ChatMessage'],'as':_0x55a4('0x79'),'attributes':['id',_0x55a4('0x2b'),_0x55a4('0xb3'),_0x55a4('0x88'),'secret','read'],'include':_0x52adc1}];_0x52c232[_0x55a4('0xa1')]({'model':db['ChatWebsite'],'as':_0x55a4('0xb4'),'attributes':['id',_0x55a4('0x27')]});_0x52c232['push']({'model':db[_0x55a4('0x7a')],'as':_0x55a4('0xb5'),'attributes':['id',_0x55a4('0x4c')]});return db['ChatInteraction']['find']({'where':{'id':_0x24d3b2[_0x55a4('0x43')]['id']},'include':_0x52c232})[_0x55a4('0x10')](handleEntityNotFound(_0x27c53f,null))[_0x55a4('0x10')](function(_0x3a1e6b){if(_0x3a1e6b){var _0x5e6fc4=_0x3a1e6b[_0x55a4('0xb6')]({'plain':!![]});fs[_0x55a4('0xb7')](_0x234213);var _0x27556d={'channel':'Chat','account':_0x5e6fc4[_0x55a4('0xb4')]['name'],'agent':_0x5e6fc4[_0x55a4('0xb5')]?_0x5e6fc4[_0x55a4('0xb5')]['fullname']:_0x55a4('0xb8'),'createdAt':moment(_0x5e6fc4[_0x55a4('0xb3')])[_0x55a4('0x76')](_0x55a4('0x9d'))[_0x55a4('0xac')](),'closedAt':_0x5e6fc4[_0x55a4('0x6b')]?moment(_0x5e6fc4[_0x55a4('0xb9')])[_0x55a4('0x76')](_0x55a4('0x9d'))['toString']():'','disposition':_0x5e6fc4[_0x55a4('0xba')],'chatInfo':{'browser':_0x5e6fc4['browserName'],'os':_0x5e6fc4[_0x55a4('0xbb')],'referer':_0x5e6fc4[_0x55a4('0xbc')],'customerIp':_0x5e6fc4[_0x55a4('0xbd')],'customerPort':_0x5e6fc4['customerPort']?_0x5e6fc4[_0x55a4('0xbe')]:_0x55a4('0xb8')},'messages':_(_0x5e6fc4['Messages'])[_0x55a4('0xbf')]()[_0x55a4('0x9a')]({'secret':![]})[_0x55a4('0x2e')](function(_0x251480){if(_0x251480['Attachment']){var _0x3184c7=path[_0x55a4('0x6e')](_0x466a78,_0x251480['Attachment']['basename']);if(fs[_0x55a4('0xc0')](_0x3184c7)){fs[_0x55a4('0xc1')](_0x3184c7)['pipe'](fs['createWriteStream'](path['join'](_0x234213,_0x251480[_0x55a4('0x69')][_0x55a4('0x66')])));}}return{'date':moment(_0x251480[_0x55a4('0xb3')])['format'](_0x55a4('0x9d'))[_0x55a4('0xac')](),'sender':_0x251480[_0x55a4('0x88')]===_0x55a4('0x58')?_0x251480[_0x55a4('0x7a')]?_0x251480[_0x55a4('0x7a')][_0x55a4('0x4c')]:_0x55a4('0x7e'):_0x251480[_0x55a4('0x5d')][_0x55a4('0xb1')]+(_0x251480['Contact'][_0x55a4('0xb2')]?'\x20'+_0x251480[_0x55a4('0x5d')][_0x55a4('0xb2')]:''),'body':_0x251480[_0x55a4('0x69')]?_0x251480[_0x55a4('0x69')][_0x55a4('0x66')]:_0x251480[_0x55a4('0x2b')],'direction':_0x251480[_0x55a4('0x88')]===_0x55a4('0x58')?'A':'C','secret':_0x251480[_0x55a4('0x89')],'read':_0x251480[_0x55a4('0xc2')],'attachment':_0x251480[_0x55a4('0x69')]};})[_0x55a4('0xc3')]()};return ejs[_0x55a4('0xc4')](path[_0x55a4('0x6e')](config[_0x55a4('0x74')],'server',_0x55a4('0xc5'),_0x55a4('0xc6')),{'interaction':_0x27556d})['then'](function(_0x4d387a){var _0x134c72=path[_0x55a4('0x6e')](_0x234213,_0x55a4('0xc7')+_0x5e6fc4['id']+'-'+_0x3f0351+_0x55a4('0xc8'));var _0x240241={'path':_0x134c72,'channel':_0x55a4('0xc9'),'interactionId':_0x5e6fc4['id']};return pdf['createPdfFromHTML'](_0x4d387a,_0x240241);})[_0x55a4('0x10')](function(){return new Promise(function(_0x1733ac,_0x5501cf){zipdir(_0x234213,{'saveTo':_0x25538d},function(_0x9a10ca,_0x3b17ac){if(_0x9a10ca)return _0x5501cf(_0x9a10ca);return _0x1733ac(_0x3b17ac);});})[_0x55a4('0x10')](function(){return new BPromise(function(_0x19da3e,_0x5c1266){rimraf(_0x234213,function(_0x47e12d){if(_0x47e12d)_0x5c1266(_0x47e12d);return _0x19da3e();});});})[_0x55a4('0x10')](function(){return _0x27c53f[_0x55a4('0x71')](_0x25538d,_0x1b88b6,function(_0x52ddc9){if(_0x52ddc9){logger[_0x55a4('0x17')](_0x55a4('0xca'),_0x52ddc9);}else{fs['unlinkSync'](_0x25538d);}});});});}else{return _0x27c53f[_0x55a4('0x1b')](0xc8);}})['catch'](handleError(_0x27c53f,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 902e324..186b344 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 _0x59a3=['length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x59a3,0x102));var _0x359a=function(_0x7a50a5,_0x19b21a){_0x7a50a5=_0x7a50a5-0x0;var _0x5acd1b=_0x59a3[_0x7a50a5];return _0x5acd1b;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x359a('0x0'))['db'][_0x359a('0x1')];var ChatMessage=require(_0x359a('0x0'))['db'][_0x359a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x359a('0x3')](0x0);var events={'afterCreate':_0x359a('0x4'),'afterUpdate':_0x359a('0x5'),'afterDestroy':_0x359a('0x6')};function emitEvent(_0x1f925c){return function(_0x224013,_0x5c6dd6,_0x4ba71b){_0x224013['getUsers']({'attributes':['id'],'raw':!![]})[_0x359a('0x7')](function(_0x11d97f){_0x224013[_0x359a('0x8')](_0x359a('0x9'),_0x11d97f[_0x359a('0xa')](function(_0x6cb691){return{'id':_0x6cb691['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x224013['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5f3ef0){_0x224013['setDataValue'](_0x359a('0xb'),_0x5f3ef0[_0x359a('0xc')]);ChatInteractionEvents[_0x359a('0xd')](_0x1f925c+':'+_0x224013['id'],_0x224013);ChatInteractionEvents['emit'](_0x1f925c,_0x224013);_0x4ba71b(null);})[_0x359a('0xe')](_0x4ba71b(null));};}for(var e in events){if(events[_0x359a('0xf')](e)){var event=events[e];ChatInteraction[_0x359a('0x10')](e,emitEvent(event));}}module[_0x359a('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x8c72=['map','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x1d1860,_0x55062b){var _0x19ddca=function(_0x2e2b62){while(--_0x2e2b62){_0x1d1860['push'](_0x1d1860['shift']());}};_0x19ddca(++_0x55062b);}(_0x8c72,0x19c));var _0x28c7=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x8c72[_0x119d5a];return _0x15bff4;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x28c7('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x28c7('0x0'))['db'][_0x28c7('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x28c7('0x2')](0x0);var events={'afterCreate':_0x28c7('0x3'),'afterUpdate':_0x28c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3318dd){return function(_0x249068,_0x9f7639,_0x2d7d54){_0x249068[_0x28c7('0x5')]({'attributes':['id'],'raw':!![]})[_0x28c7('0x6')](function(_0x2a1d8c){_0x249068[_0x28c7('0x7')]('Users',_0x2a1d8c[_0x28c7('0x8')](function(_0x1923b1){return{'id':_0x1923b1['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x249068['id'],'direction':'in','read':![]},'raw':!![]});})[_0x28c7('0x6')](function(_0x204754){_0x249068[_0x28c7('0x7')](_0x28c7('0x9'),_0x204754['length']);ChatInteractionEvents['emit'](_0x3318dd+':'+_0x249068['id'],_0x249068);ChatInteractionEvents[_0x28c7('0xa')](_0x3318dd,_0x249068);_0x2d7d54(null);})[_0x28c7('0xb')](_0x2d7d54(null));};}for(var e in events){if(events[_0x28c7('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x28c7('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 1461c8f..aa90c8d 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 _0x60e2=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions'];(function(_0x39503a,_0x3d959e){var _0x3110cc=function(_0x4090c3){while(--_0x4090c3){_0x39503a['push'](_0x39503a['shift']());}};_0x3110cc(++_0x3d959e);}(_0x60e2,0x1e5));var _0x260e=function(_0x152cb6,_0x10b962){_0x152cb6=_0x152cb6-0x0;var _0x22080a=_0x60e2[_0x152cb6];return _0x22080a;};'use strict';var _=require('lodash');var util=require(_0x260e('0x0'));var logger=require(_0x260e('0x1'))('api');var moment=require(_0x260e('0x2'));var BPromise=require(_0x260e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x260e('0x4'));var rimraf=require(_0x260e('0x5'));var config=require('../../config/environment');var attributes=require(_0x260e('0x6'));module[_0x260e('0x7')]=function(_0x2d2fcb,_0x385b20){return _0x2d2fcb[_0x260e('0x8')](_0x260e('0x9'),attributes,{'tableName':_0x260e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x315fdf,_0x4cdb66,_0x40aa75){if(_0x315fdf[_0x260e('0xb')](_0x260e('0xc'))){_0x315fdf[_0x260e('0xd')]=moment()['format'](_0x260e('0xe'));}_0x40aa75(null,_0x315fdf);}},'charset':'utf8mb4','collate':_0x260e('0xf')});};
\ No newline at end of file
+var _0x2154=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a0bc9,_0x33e977){var _0xea2e04=function(_0x48f2d9){while(--_0x48f2d9){_0x5a0bc9['push'](_0x5a0bc9['shift']());}};_0xea2e04(++_0x33e977);}(_0x2154,0xa0));var _0x4215=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x2154[_0x1abb09];return _0xea1c07;};'use strict';var _=require('lodash');var util=require(_0x4215('0x0'));var logger=require(_0x4215('0x1'))(_0x4215('0x2'));var moment=require(_0x4215('0x3'));var BPromise=require(_0x4215('0x4'));var rp=require(_0x4215('0x5'));var fs=require('fs');var path=require(_0x4215('0x6'));var rimraf=require(_0x4215('0x7'));var config=require(_0x4215('0x8'));var attributes=require(_0x4215('0x9'));module[_0x4215('0xa')]=function(_0x44fe7d,_0x18ea4f){return _0x44fe7d[_0x4215('0xb')](_0x4215('0xc'),attributes,{'tableName':_0x4215('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54bf6f,_0x29283f,_0x540479){if(_0x54bf6f[_0x4215('0xe')](_0x4215('0xf'))){_0x54bf6f[_0x4215('0x10')]=moment()[_0x4215('0x11')](_0x4215('0x12'));}_0x540479(null,_0x54bf6f);}},'charset':_0x4215('0x13'),'collate':_0x4215('0x14')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 7702aeb..c62c64d 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 _0x0009=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','raw','options','where','attributes','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4d1f8e,_0x1c9026){var _0x5020d7=function(_0x327227){while(--_0x327227){_0x4d1f8e['push'](_0x4d1f8e['shift']());}};_0x5020d7(++_0x1c9026);}(_0x0009,0x121));var _0x9000=function(_0x5706fb,_0xacfe3c){_0x5706fb=_0x5706fb-0x0;var _0x21799d=_0x0009[_0x5706fb];return _0x21799d;};'use strict';var _=require(_0x9000('0x0'));var util=require(_0x9000('0x1'));var moment=require('moment');var BPromise=require(_0x9000('0x2'));var rs=require(_0x9000('0x3'));var fs=require('fs');var Redis=require(_0x9000('0x4'));var db=require(_0x9000('0x5'))['db'];var utils=require(_0x9000('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9000('0x7'));var jayson=require(_0x9000('0x8'));var client=jayson[_0x9000('0x9')]['http']({'port':0x232a});config[_0x9000('0xa')]=_['defaults'](config[_0x9000('0xa')],{'host':_0x9000('0xb'),'port':0x18eb});var socket=require(_0x9000('0xc'))(new Redis(config[_0x9000('0xa')]));require(_0x9000('0xd'))['register'](socket);function respondWithRpcPromise(_0x49863d,_0x2addf9,_0x4952ec){return new BPromise(function(_0x4b9705,_0x20f63e){return client[_0x9000('0xe')](_0x49863d,_0x4952ec)[_0x9000('0xf')](function(_0x4caee6){logger[_0x9000('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2addf9,_0x9000('0x11'));logger[_0x9000('0x12')](_0x9000('0x13'),_0x2addf9,_0x9000('0x11'),JSON['stringify'](_0x4caee6));if(_0x4caee6[_0x9000('0x14')]){if(_0x4caee6[_0x9000('0x14')][_0x9000('0x15')]===0x1f4){logger[_0x9000('0x14')](_0x9000('0x16'),_0x2addf9,_0x4caee6[_0x9000('0x14')][_0x9000('0x17')]);return _0x20f63e(_0x4caee6[_0x9000('0x14')][_0x9000('0x17')]);}logger[_0x9000('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2addf9,_0x4caee6[_0x9000('0x14')][_0x9000('0x17')]);return _0x4b9705(_0x4caee6['error'][_0x9000('0x17')]);}else{logger[_0x9000('0x10')](_0x9000('0x16'),_0x2addf9,'request\x20sent');_0x4b9705(_0x4caee6[_0x9000('0x18')][_0x9000('0x17')]);}})[_0x9000('0x19')](function(_0x333259){logger['error'](_0x9000('0x16'),_0x2addf9,_0x333259);_0x20f63e(_0x333259);});});}exports['UpdateChatInteraction']=function(_0x2833f4){var _0x5b393c=this;return new Promise(function(_0x2d9d27,_0xd7afcd){return db[_0x9000('0x1a')]['update'](_0x2833f4['body'],{'raw':_0x2833f4['options']?_0x2833f4['options'][_0x9000('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2833f4[_0x9000('0x1c')]?_0x2833f4[_0x9000('0x1c')][_0x9000('0x1d')]||null:null,'attributes':_0x2833f4[_0x9000('0x1c')]?_0x2833f4[_0x9000('0x1c')][_0x9000('0x1e')]||null:null,'limit':_0x2833f4[_0x9000('0x1c')]?_0x2833f4[_0x9000('0x1c')][_0x9000('0x1f')]||null:null})[_0x9000('0xf')](function(_0x50b295){logger[_0x9000('0x10')](_0x9000('0x20'),_0x2833f4);logger['debug'](_0x9000('0x20'),_0x2833f4,JSON[_0x9000('0x21')](_0x50b295));_0x2d9d27(_0x50b295);})['catch'](function(_0x5cbeed){logger[_0x9000('0x14')](_0x9000('0x20'),_0x5cbeed['message'],_0x2833f4);_0xd7afcd(_0x5b393c[_0x9000('0x14')](0x1f4,_0x5cbeed[_0x9000('0x17')]));});});};exports[_0x9000('0x22')]=function(_0x442214){return new Promise(function(_0x298488,_0x16c8fa){return db['ChatInteraction'][_0x9000('0x23')]({'where':_0x442214[_0x9000('0x1c')]?_0x442214[_0x9000('0x1c')][_0x9000('0x1d')]||null:null})[_0x9000('0xf')](function(_0x9a2999){if(_0x9a2999){return _0x9a2999[_0x9000('0x24')](_0x442214['body'][_0x9000('0x25')],_[_0x9000('0x26')](_0x442214[_0x9000('0x27')],[_0x9000('0x25'),'id'])||{});}})[_0x9000('0x28')](function(_0x2e2334){logger[_0x9000('0x10')](_0x9000('0x29'),_0x442214);logger['debug'](_0x9000('0x29'),_0x442214,JSON['stringify'](_0x2e2334));_0x298488(_0x2e2334);})[_0x9000('0x19')](function(_0x36f10e){logger[_0x9000('0x14')](_0x9000('0x29'),_0x36f10e[_0x9000('0x17')],_0x442214);_0x16c8fa(_this[_0x9000('0x14')](0x1f4,_0x36f10e[_0x9000('0x17')]));});});};
\ No newline at end of file
+var _0x0f97=['request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','UpdateChatInteraction','ChatInteraction','body','options','raw','where','limit','stringify','catch','AddTagsToChatInteraction','addTags','omit','spread','debug','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x4ff81c,_0x5c0db3){var _0x175291=function(_0x3f14c3){while(--_0x3f14c3){_0x4ff81c['push'](_0x4ff81c['shift']());}};_0x175291(++_0x5c0db3);}(_0x0f97,0xaf));var _0x70f9=function(_0x2d6375,_0x149216){_0x2d6375=_0x2d6375-0x0;var _0x29186f=_0x0f97[_0x2d6375];return _0x29186f;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var moment=require(_0x70f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x70f9('0x3'));var fs=require('fs');var Redis=require(_0x70f9('0x4'));var db=require(_0x70f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x70f9('0x6'));var config=require(_0x70f9('0x7'));var jayson=require(_0x70f9('0x8'));var client=jayson['client'][_0x70f9('0x9')]({'port':0x232a});config[_0x70f9('0xa')]=_['defaults'](config[_0x70f9('0xa')],{'host':_0x70f9('0xb'),'port':0x18eb});var socket=require(_0x70f9('0xc'))(new Redis(config['redis']));require(_0x70f9('0xd'))[_0x70f9('0xe')](socket);function respondWithRpcPromise(_0xa9bf84,_0x1878bd,_0x108db2){return new BPromise(function(_0x53f04d,_0x229b21){return client[_0x70f9('0xf')](_0xa9bf84,_0x108db2)[_0x70f9('0x10')](function(_0x402489){logger[_0x70f9('0x11')](_0x70f9('0x12'),_0x1878bd,_0x70f9('0x13'));logger['debug'](_0x70f9('0x14'),_0x1878bd,_0x70f9('0x13'),JSON['stringify'](_0x402489));if(_0x402489[_0x70f9('0x15')]){if(_0x402489[_0x70f9('0x15')]['code']===0x1f4){logger['error'](_0x70f9('0x12'),_0x1878bd,_0x402489[_0x70f9('0x15')][_0x70f9('0x16')]);return _0x229b21(_0x402489['error']['message']);}logger[_0x70f9('0x15')](_0x70f9('0x12'),_0x1878bd,_0x402489[_0x70f9('0x15')][_0x70f9('0x16')]);return _0x53f04d(_0x402489[_0x70f9('0x15')]['message']);}else{logger['info'](_0x70f9('0x12'),_0x1878bd,_0x70f9('0x13'));_0x53f04d(_0x402489['result']['message']);}})['catch'](function(_0x3d7757){logger[_0x70f9('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x1878bd,_0x3d7757);_0x229b21(_0x3d7757);});});}exports[_0x70f9('0x17')]=function(_0x5ec653){var _0x33dde5=this;return new Promise(function(_0x50d0c4,_0x5e2276){return db[_0x70f9('0x18')]['update'](_0x5ec653[_0x70f9('0x19')],{'raw':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653['options'][_0x70f9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec653['options']?_0x5ec653['options'][_0x70f9('0x1c')]||null:null,'attributes':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653['options']['attributes']||null:null,'limit':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653[_0x70f9('0x1a')][_0x70f9('0x1d')]||null:null})[_0x70f9('0x10')](function(_0x163b5a){logger[_0x70f9('0x11')](_0x70f9('0x17'),_0x5ec653);logger['debug']('UpdateChatInteraction',_0x5ec653,JSON[_0x70f9('0x1e')](_0x163b5a));_0x50d0c4(_0x163b5a);})[_0x70f9('0x1f')](function(_0x1c474b){logger[_0x70f9('0x15')]('UpdateChatInteraction',_0x1c474b['message'],_0x5ec653);_0x5e2276(_0x33dde5[_0x70f9('0x15')](0x1f4,_0x1c474b[_0x70f9('0x16')]));});});};exports[_0x70f9('0x20')]=function(_0x83e7d0){return new Promise(function(_0xdeca2,_0x308c14){return db[_0x70f9('0x18')]['find']({'where':_0x83e7d0[_0x70f9('0x1a')]?_0x83e7d0[_0x70f9('0x1a')][_0x70f9('0x1c')]||null:null})[_0x70f9('0x10')](function(_0x5d5d6a){if(_0x5d5d6a){return _0x5d5d6a[_0x70f9('0x21')](_0x83e7d0['body']['ids'],_[_0x70f9('0x22')](_0x83e7d0['body'],['ids','id'])||{});}})[_0x70f9('0x23')](function(_0x29d3a4){logger['info']('AddTags',_0x83e7d0);logger[_0x70f9('0x24')](_0x70f9('0x25'),_0x83e7d0,JSON[_0x70f9('0x1e')](_0x29d3a4));_0xdeca2(_0x29d3a4);})[_0x70f9('0x1f')](function(_0x2aa59b){logger[_0x70f9('0x15')]('AddTags',_0x2aa59b['message'],_0x83e7d0);_0x308c14(_this[_0x70f9('0x15')](0x1f4,_0x2aa59b[_0x70f9('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 403551e..8927cf8 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 _0x8873=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x462545,_0x3c0f1b){var _0x680d51=function(_0x22727b){while(--_0x22727b){_0x462545['push'](_0x462545['shift']());}};_0x680d51(++_0x3c0f1b);}(_0x8873,0xad));var _0x3887=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0x8873[_0x2e0ffa];return _0x24d627;};'use strict';var ChatInteractionEvents=require(_0x3887('0x0'));var events=[_0x3887('0x1'),_0x3887('0x2'),'update'];function createListener(_0x24558e,_0x3dd931){return function(_0x1ce9b5){_0x3dd931[_0x3887('0x3')](_0x24558e,_0x1ce9b5);};}function removeListener(_0x5b4e43,_0x203e5d){return function(){ChatInteractionEvents[_0x3887('0x4')](_0x5b4e43,_0x203e5d);};}exports[_0x3887('0x5')]=function(_0x3eb246){for(var _0x5358ef=0x0,_0x5c651f=events[_0x3887('0x6')];_0x5358ef<_0x5c651f;_0x5358ef++){var _0x4a46ff=events[_0x5358ef];var _0x42e810=createListener(_0x3887('0x7')+_0x4a46ff,_0x3eb246);ChatInteractionEvents['on'](_0x4a46ff,_0x42e810);}};
\ No newline at end of file
+var _0x98ac=['remove','emit','register','length','chatInteraction:'];(function(_0x47f32a,_0x1dbe9b){var _0x22512d=function(_0x4874a0){while(--_0x4874a0){_0x47f32a['push'](_0x47f32a['shift']());}};_0x22512d(++_0x1dbe9b);}(_0x98ac,0x1d1));var _0xc98a=function(_0x14b1fa,_0x5aa6df){_0x14b1fa=_0x14b1fa-0x0;var _0x5cbea1=_0x98ac[_0x14b1fa];return _0x5cbea1;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xc98a('0x0'),'update'];function createListener(_0x54c55e,_0x402f8a){return function(_0x434f17){_0x402f8a[_0xc98a('0x1')](_0x54c55e,_0x434f17);};}function removeListener(_0x141041,_0xe44835){return function(){ChatInteractionEvents['removeListener'](_0x141041,_0xe44835);};}exports[_0xc98a('0x2')]=function(_0x3e95c6){for(var _0x531dba=0x0,_0x22a165=events[_0xc98a('0x3')];_0x531dba<_0x22a165;_0x531dba++){var _0x3d9c82=events[_0x531dba];var _0x17fcf8=createListener(_0xc98a('0x4')+_0x3d9c82,_0x3e95c6);ChatInteractionEvents['on'](_0x3d9c82,_0x17fcf8);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index e9d22c5..d0560c4 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 _0x075d=['attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','format','%s-%s','now','originalname','replace'];(function(_0x5ced7d,_0x20ce01){var _0x5ceaa6=function(_0xdc898f){while(--_0xdc898f){_0x5ced7d['push'](_0x5ced7d['shift']());}};_0x5ceaa6(++_0x20ce01);}(_0x075d,0xf8));var _0xd075=function(_0x20763f,_0x95bba){_0x20763f=_0x20763f-0x0;var _0x5462a3=_0x075d[_0x20763f];return _0x5462a3;};'use strict';var multer=require(_0xd075('0x0'));var util=require(_0xd075('0x1'));var path=require(_0xd075('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd075('0x3')]();var fs_extra=require(_0xd075('0x4'));var auth=require(_0xd075('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd075('0x6'));var controller=require('./chatInteraction.controller');router[_0xd075('0x7')]('/',auth[_0xd075('0x8')](),controller[_0xd075('0x9')]);router['get'](_0xd075('0xa'),auth[_0xd075('0x8')](),controller[_0xd075('0xb')]);router[_0xd075('0x7')]('/:id',auth[_0xd075('0xc')](),controller[_0xd075('0xd')]);router[_0xd075('0x7')](_0xd075('0xe'),auth[_0xd075('0xc')](),controller['attachmentDownload']);router[_0xd075('0x7')]('/:id/messages',auth[_0xd075('0x8')](),controller['getMessages']);router['get'](_0xd075('0xf'),auth[_0xd075('0xc')](),controller[_0xd075('0x10')]);router[_0xd075('0x7')](_0xd075('0x11'),auth[_0xd075('0x8')](),controller[_0xd075('0x12')]);router[_0xd075('0x13')]('/',auth[_0xd075('0x8')](),controller[_0xd075('0x14')]);router[_0xd075('0x13')]('/:id/vidaoo',auth[_0xd075('0x8')](),controller[_0xd075('0x15')]);var upload=multer({'storage':multer[_0xd075('0x16')]({'destination':function(_0x3c3c84,_0x1dd101,_0x40c45d){_0x40c45d(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x2e0d91,_0x22ef12,_0x1e1831){_0x1e1831(null,util[_0xd075('0x17')](_0xd075('0x18'),Date[_0xd075('0x19')](),_0x22ef12[_0xd075('0x1a')][_0xd075('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd075('0x13')]('/:id/attachment_upload',upload['single']('file'),controller[_0xd075('0x1c')]);router['post'](_0xd075('0x1d'),auth[_0xd075('0xc')](),controller[_0xd075('0x1e')]);router[_0xd075('0x13')]('/:id/tags',auth[_0xd075('0x8')](),interaction[_0xd075('0x1f')](_0xd075('0x20'),_0xd075('0x21')),controller['addTags']);router[_0xd075('0x22')]('/:id',auth[_0xd075('0x8')](),interaction[_0xd075('0x1f')]('chat',_0xd075('0x23')),controller['update']);router['put'](_0xd075('0x24'),controller[_0xd075('0x25')]);router[_0xd075('0x22')](_0xd075('0x26'),auth['isChatInteractionAuthorized'](),controller[_0xd075('0x27')]);router[_0xd075('0x22')](_0xd075('0x28'),controller['close']);router['delete']('/:id',auth[_0xd075('0x8')](),interaction['tracked']('chat',_0xd075('0x29')),controller[_0xd075('0x2a')]);router[_0xd075('0x2b')]('/:id/tags',auth['isAuthenticated'](),controller[_0xd075('0x2c')]);module[_0xd075('0x2d')]=router;
\ No newline at end of file
+var _0xcc17=['../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','format','now','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','/:id/abandon','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra'];(function(_0x1fe0d4,_0x3e9d58){var _0x49675a=function(_0x1c96e9){while(--_0x1c96e9){_0x1fe0d4['push'](_0x1fe0d4['shift']());}};_0x49675a(++_0x3e9d58);}(_0xcc17,0x10e));var _0x7cc1=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xcc17[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x7cc1('0x0'));var util=require(_0x7cc1('0x1'));var path=require(_0x7cc1('0x2'));var timeout=require('connect-timeout');var express=require(_0x7cc1('0x3'));var router=express[_0x7cc1('0x4')]();var fs_extra=require(_0x7cc1('0x5'));var auth=require(_0x7cc1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7cc1('0x7'));router[_0x7cc1('0x8')]('/',auth[_0x7cc1('0x9')](),controller['index']);router['get'](_0x7cc1('0xa'),auth[_0x7cc1('0x9')](),controller[_0x7cc1('0xb')]);router[_0x7cc1('0x8')](_0x7cc1('0xc'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0xe')]);router[_0x7cc1('0x8')](_0x7cc1('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0x7cc1('0x10'),auth[_0x7cc1('0x9')](),controller['getMessages']);router[_0x7cc1('0x8')](_0x7cc1('0x11'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0x12')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x7cc1('0x13')]);router[_0x7cc1('0x14')]('/',auth[_0x7cc1('0x9')](),controller[_0x7cc1('0x15')]);router[_0x7cc1('0x14')](_0x7cc1('0x16'),auth['isAuthenticated'](),controller[_0x7cc1('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb5148a,_0x537b2d,_0x37beb7){_0x37beb7(null,path[_0x7cc1('0x18')](config['root'],'server/files/attachments/'));},'filename':function(_0x3f7fc5,_0x219443,_0x46b275){_0x46b275(null,util[_0x7cc1('0x19')]('%s-%s',Date[_0x7cc1('0x1a')](),_0x219443['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x7cc1('0x1b'),upload[_0x7cc1('0x1c')](_0x7cc1('0x1d')),controller[_0x7cc1('0x1e')]);router['post'](_0x7cc1('0x10'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0x1f')]);router[_0x7cc1('0x14')]('/:id/tags',auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),_0x7cc1('0x22')),controller[_0x7cc1('0x23')]);router[_0x7cc1('0x24')](_0x7cc1('0xc'),auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),'chatinteraction:update'),controller[_0x7cc1('0x25')]);router[_0x7cc1('0x24')](_0x7cc1('0x26'),controller['customUpdate']);router[_0x7cc1('0x24')](_0x7cc1('0x27'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x7cc1('0x24')]('/:id/close',controller['close']);router[_0x7cc1('0x28')]('/:id',auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),_0x7cc1('0x29')),controller[_0x7cc1('0x2a')]);router['delete'](_0x7cc1('0x2b'),auth[_0x7cc1('0x9')](),controller[_0x7cc1('0x2c')]);module[_0x7cc1('0x2d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index f8dc066..e3eb276 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 _0x41c6=['sequelize','TEXT','INTEGER'];(function(_0x4332a5,_0xa5b7f5){var _0x41d367=function(_0xff6d4c){while(--_0xff6d4c){_0x4332a5['push'](_0x4332a5['shift']());}};_0x41d367(++_0xa5b7f5);}(_0x41c6,0x87));var _0x641c=function(_0x599d26,_0x48ef3f){_0x599d26=_0x599d26-0x0;var _0x2ebcfc=_0x41c6[_0x599d26];return _0x2ebcfc;};'use strict';var Sequelize=require(_0x641c('0x0'));module['exports']={'body':{'type':Sequelize[_0x641c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x641c('0x2')]}};
\ No newline at end of file
+var _0x2bc9=['TEXT','medium','sequelize','exports'];(function(_0x17590e,_0x426474){var _0x22884e=function(_0x1f9d5f){while(--_0x1f9d5f){_0x17590e['push'](_0x17590e['shift']());}};_0x22884e(++_0x426474);}(_0x2bc9,0x1d6));var _0x92bc=function(_0x2cdd4d,_0x394c2f){_0x2cdd4d=_0x2cdd4d-0x0;var _0x55cbc8=_0x2bc9[_0x2cdd4d];return _0x55cbc8;};'use strict';var Sequelize=require(_0x92bc('0x0'));module[_0x92bc('0x1')]={'body':{'type':Sequelize[_0x92bc('0x2')](_0x92bc('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index e6225bc..3627c8b 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 _0x2377=['include','findAll','rows','show','keys','fields','includeAll','find','catch','create','body','describe','get','messages','lastMessageAt','lastMessage','format','agent','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','role','Agents','userProfileId','autoAssociation','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','ChatInternalMessage'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x2377,0x93));var _0x7237=function(_0x4d8d65,_0x22a6bd){_0x4d8d65=_0x4d8d65-0x0;var _0x26c8b2=_0x2377[_0x4d8d65];return _0x26c8b2;};'use strict';var emlformat=require(_0x7237('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7237('0x1'));var jsonpatch=require(_0x7237('0x2'));var rp=require(_0x7237('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7237('0x4'));var util=require(_0x7237('0x5'));var path=require(_0x7237('0x6'));var sox=require(_0x7237('0x7'));var csv=require('to-csv');var ejs=require(_0x7237('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7237('0x9'));var squel=require(_0x7237('0xa'));var crypto=require(_0x7237('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7237('0xc'));var querystring=require(_0x7237('0xd'));var Papa=require(_0x7237('0xe'));var Redis=require(_0x7237('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7237('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7237('0x11'));var utils=require(_0x7237('0x12'));var config=require(_0x7237('0x13'));var licenseUtil=require(_0x7237('0x14'));var db=require(_0x7237('0x15'))['db'];config[_0x7237('0x16')]=_[_0x7237('0x17')](config[_0x7237('0x16')],{'host':_0x7237('0x18'),'port':0x18eb});var socket=require(_0x7237('0x19'))(new Redis(config[_0x7237('0x16')]));require('./chatInternalMessage.socket')[_0x7237('0x1a')](socket);function respondWithStatusCode(_0xcafef6,_0x168c82){_0x168c82=_0x168c82||0xcc;return function(_0x24da65){if(_0x24da65){return _0xcafef6['sendStatus'](_0x168c82);}return _0xcafef6['status'](_0x168c82)[_0x7237('0x1b')]();};}function respondWithResult(_0x3cb196,_0x3ab93e){_0x3ab93e=_0x3ab93e||0xc8;return function(_0x34878a){if(_0x34878a){return _0x3cb196[_0x7237('0x1c')](_0x3ab93e)[_0x7237('0x1d')](_0x34878a);}};}function respondWithFilteredResult(_0x52e388,_0x532f66){return function(_0x1abd2e){if(_0x1abd2e){var _0x172da1=typeof _0x532f66['offset']===_0x7237('0x1e')&&typeof _0x532f66[_0x7237('0x1f')]===_0x7237('0x1e');var _0xe7afc=_0x1abd2e[_0x7237('0x20')];var _0x4512af=_0x172da1?0x0:_0x532f66[_0x7237('0x21')];var _0x2478c3=_0x172da1?_0x1abd2e[_0x7237('0x20')]:_0x532f66[_0x7237('0x21')]+_0x532f66['limit'];var _0x2593ac;if(_0x2478c3>=_0xe7afc){_0x2478c3=_0xe7afc;_0x2593ac=0xc8;}else{_0x2593ac=0xce;}_0x52e388[_0x7237('0x1c')](_0x2593ac);return _0x52e388['set'](_0x7237('0x22'),_0x4512af+'-'+_0x2478c3+'/'+_0xe7afc)['json'](_0x1abd2e);}return null;};}function patchUpdates(_0x2e16af){return function(_0x44f9bd){try{jsonpatch['apply'](_0x44f9bd,_0x2e16af,!![]);}catch(_0xb30025){return BPromise[_0x7237('0x23')](_0xb30025);}return _0x44f9bd[_0x7237('0x24')]();};}function saveUpdates(_0x269fa8,_0x34d9f2){return function(_0x240f02){if(_0x240f02){return _0x240f02[_0x7237('0x25')](_0x269fa8)[_0x7237('0x26')](function(_0x1d6e2d){return _0x1d6e2d;});}return null;};}function removeEntity(_0x45ce73,_0x4bc4a2){return function(_0x4fc5fe){if(_0x4fc5fe){return _0x4fc5fe[_0x7237('0x27')]()[_0x7237('0x26')](function(){_0x45ce73['status'](0xcc)[_0x7237('0x1b')]();});}};}function handleEntityNotFound(_0x26b8f4,_0x3fa628){return function(_0xf903ba){if(!_0xf903ba){_0x26b8f4[_0x7237('0x28')](0x194);}return _0xf903ba;};}function handleError(_0x45f7f9,_0x528b16){_0x528b16=_0x528b16||0x1f4;return function(_0x48358a){logger['error'](_0x48358a[_0x7237('0x29')]);if(_0x48358a[_0x7237('0x2a')]){delete _0x48358a['name'];}_0x45f7f9[_0x7237('0x1c')](_0x528b16)[_0x7237('0x2b')](_0x48358a);};}exports[_0x7237('0x2c')]=function(_0x34e45b,_0x21152c){var _0x57f4ef={},_0x252a22={},_0x30bf6a={'count':0x0,'rows':[]};var _0x3f9958=_[_0x7237('0x2d')](db['ChatInternalMessage'][_0x7237('0x2e')],function(_0x3124e2){return{'name':_0x3124e2[_0x7237('0x2f')],'type':_0x3124e2[_0x7237('0x30')][_0x7237('0x31')]};});_0x252a22['model']=_[_0x7237('0x2d')](_0x3f9958,_0x7237('0x2a'));_0x252a22[_0x7237('0x32')]=_['keys'](_0x34e45b[_0x7237('0x32')]);_0x252a22[_0x7237('0x33')]=_[_0x7237('0x34')](_0x252a22['model'],_0x252a22[_0x7237('0x32')]);_0x57f4ef['attributes']=_[_0x7237('0x34')](_0x252a22[_0x7237('0x35')],qs['fields'](_0x34e45b['query']['fields']));_0x57f4ef[_0x7237('0x36')]=_0x57f4ef['attributes'][_0x7237('0x37')]?_0x57f4ef[_0x7237('0x36')]:_0x252a22[_0x7237('0x35')];if(!_0x34e45b[_0x7237('0x32')][_0x7237('0x38')](_0x7237('0x39'))){_0x57f4ef[_0x7237('0x1f')]=qs[_0x7237('0x1f')](_0x34e45b[_0x7237('0x32')]['limit']);_0x57f4ef[_0x7237('0x21')]=qs['offset'](_0x34e45b[_0x7237('0x32')][_0x7237('0x21')]);}_0x57f4ef[_0x7237('0x3a')]=qs[_0x7237('0x3b')](_0x34e45b['query'][_0x7237('0x3b')]);_0x57f4ef['where']=qs[_0x7237('0x33')](_[_0x7237('0x3c')](_0x34e45b[_0x7237('0x32')],_0x252a22[_0x7237('0x33')]),_0x3f9958);if(_0x34e45b[_0x7237('0x32')]['filter']){_0x57f4ef['where']=_[_0x7237('0x3d')](_0x57f4ef[_0x7237('0x3e')],{'$or':_[_0x7237('0x2d')](_0x3f9958,function(_0x587424){if(_0x587424[_0x7237('0x30')]!==_0x7237('0x3f')){var _0x202c13={};_0x202c13[_0x587424[_0x7237('0x2a')]]={'$like':'%'+_0x34e45b[_0x7237('0x32')][_0x7237('0x40')]+'%'};return _0x202c13;}})});}_0x57f4ef=_[_0x7237('0x3d')]({},_0x57f4ef,_0x34e45b[_0x7237('0x41')]);var _0x3065cd={'where':_0x57f4ef[_0x7237('0x3e')]};return db[_0x7237('0x42')][_0x7237('0x20')](_0x3065cd)[_0x7237('0x26')](function(_0x2c98e2){_0x30bf6a[_0x7237('0x20')]=_0x2c98e2;if(_0x34e45b[_0x7237('0x32')]['includeAll']){_0x57f4ef[_0x7237('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7237('0x44')](_0x57f4ef);})[_0x7237('0x26')](function(_0x4b9d3f){_0x30bf6a[_0x7237('0x45')]=_0x4b9d3f;return _0x30bf6a;})['then'](respondWithFilteredResult(_0x21152c,_0x57f4ef))['catch'](handleError(_0x21152c,null));};exports[_0x7237('0x46')]=function(_0x21ab9b,_0x55666d){var _0x314da1={'raw':!![],'where':{'id':_0x21ab9b['params']['id']}},_0x159ab1={};_0x159ab1[_0x7237('0x35')]=_['keys'](db[_0x7237('0x42')][_0x7237('0x2e')]);_0x159ab1[_0x7237('0x32')]=_[_0x7237('0x47')](_0x21ab9b['query']);_0x159ab1[_0x7237('0x33')]=_[_0x7237('0x34')](_0x159ab1[_0x7237('0x35')],_0x159ab1['query']);_0x314da1[_0x7237('0x36')]=_[_0x7237('0x34')](_0x159ab1[_0x7237('0x35')],qs[_0x7237('0x48')](_0x21ab9b[_0x7237('0x32')][_0x7237('0x48')]));_0x314da1['attributes']=_0x314da1['attributes'][_0x7237('0x37')]?_0x314da1['attributes']:_0x159ab1[_0x7237('0x35')];if(_0x21ab9b[_0x7237('0x32')][_0x7237('0x49')]){_0x314da1['include']=[{'all':!![]}];}_0x314da1=_['merge']({},_0x314da1,_0x21ab9b[_0x7237('0x41')]);return db[_0x7237('0x42')][_0x7237('0x4a')](_0x314da1)[_0x7237('0x26')](handleEntityNotFound(_0x55666d,null))[_0x7237('0x26')](respondWithResult(_0x55666d,null))[_0x7237('0x4b')](handleError(_0x55666d,null));};exports[_0x7237('0x4c')]=function(_0x192832,_0xdbdddb){return db['ChatInternalMessage'][_0x7237('0x4c')](_0x192832['body'],{})[_0x7237('0x26')](respondWithResult(_0xdbdddb,0xc9))[_0x7237('0x4b')](handleError(_0xdbdddb,null));};exports['update']=function(_0x1c3a6b,_0x2d323){if(_0x1c3a6b['body']['id']){delete _0x1c3a6b[_0x7237('0x4d')]['id'];}return db['ChatInternalMessage'][_0x7237('0x4a')]({'where':{'id':_0x1c3a6b['params']['id']}})[_0x7237('0x26')](handleEntityNotFound(_0x2d323,null))[_0x7237('0x26')](saveUpdates(_0x1c3a6b[_0x7237('0x4d')],null))[_0x7237('0x26')](respondWithResult(_0x2d323,null))[_0x7237('0x4b')](handleError(_0x2d323,null));};exports[_0x7237('0x27')]=function(_0x4ca215,_0xd9369b){return db[_0x7237('0x42')]['find']({'where':{'id':_0x4ca215['params']['id']}})[_0x7237('0x26')](handleEntityNotFound(_0xd9369b,null))[_0x7237('0x26')](removeEntity(_0xd9369b,null))['catch'](handleError(_0xd9369b,null));};exports['describe']=function(_0x514bd0,_0x47423e){return db[_0x7237('0x42')][_0x7237('0x4e')]()[_0x7237('0x26')](respondWithResult(_0x47423e,null))[_0x7237('0x4b')](handleError(_0x47423e,null));};function wrapUser(_0x5df70f){return function(_0x1cf28a){var _0xb39162=_0x5df70f[_0x7237('0x4f')]({'plain':!![]});_0xb39162[_0x7237('0x50')]=[];if(_0x1cf28a){_0xb39162[_0x7237('0x51')]=_0x1cf28a['createdAt'];_0xb39162[_0x7237('0x52')]=_0x1cf28a;}else{_0xb39162[_0x7237('0x51')]=moment(0x0)[_0x7237('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0xb39162[_0x7237('0x52')]={};}return _0xb39162;};}exports['getUsers']=function(_0x17cb09,_0x264b2e,_0x416eab){var _0x45e03c=[];return db['User']['findAll']({'where':{'role':[_0x7237('0x54'),'admin',_0x7237('0x55')]},'attributes':['id',_0x7237('0x56'),_0x7237('0x2a'),'role',_0x7237('0x57'),_0x7237('0x58'),_0x7237('0x59'),'lastLoginAt',_0x7237('0x5a'),_0x7237('0x5b')],'order':qs['sort'](_0x7237('0x5c')),'include':[{'model':db[_0x7237('0x5d')],'as':_0x7237('0x5e'),'attributes':['id',_0x7237('0x2a'),_0x7237('0x30')],'through':{'attributes':[]}}]})[_0x7237('0x26')](function(_0x3cb866){if(_0x3cb866){var _0x3ef253=_0x17cb09[_0x7237('0x55')][_0x7237('0x4f')]({'plain':!![]});if(!_0x3ef253)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ef253[_0x7237('0x5f')]===_0x7237('0x55')){return db['UserProfileSection'][_0x7237('0x4a')]({'where':{'name':_0x7237('0x60'),'userProfileId':_0x3ef253[_0x7237('0x61')]},'raw':!![]})[_0x7237('0x26')](function(_0xee2c23){if(_0xee2c23){if(_0xee2c23[_0x7237('0x62')]===0x0){return db['UserProfileResource'][_0x7237('0x44')]({'where':{'sectionId':_0xee2c23['id']},'raw':!![]})[_0x7237('0x26')](function(_0x3b83bb){var _0x43edf1=[];if(_['isEmpty'](_0x3b83bb)){_0x43edf1=_[_0x7237('0x40')](_0x3cb866,function(_0x5979c6){if(_0x5979c6['role']!==_0x7237('0x54')){return _0x5979c6;}});return _0x43edf1;}else{for(var _0x5f5a79=0x0;_0x5f5a79<_0x3cb866[_0x7237('0x37')];_0x5f5a79++){var _0x269eff=_0x3cb866[_0x5f5a79];if(_0x269eff[_0x7237('0x5f')]===_0x7237('0x54')){var _0xe01da4=_['find'](_0x3b83bb,function(_0x26f5a9){return _0x26f5a9[_0x7237('0x63')]===_0x269eff['id'];});if(_0xe01da4)_0x43edf1[_0x7237('0x64')](_0x269eff);}else{_0x43edf1['push'](_0x269eff);}}return _0x43edf1;}});}else{return _0x3cb866;}}else{var _0x46dffd=_[_0x7237('0x40')](_0x3cb866,function(_0x3c4ac0){if(_0x3c4ac0[_0x7237('0x5f')]!==_0x7237('0x54')){return _0x3c4ac0;}});return _0x46dffd;}});}else{return _0x3cb866;}}})[_0x7237('0x26')](function(_0x1ce085){var _0x83dcaf=[];if(_0x1ce085){_0x45e03c=_0x1ce085;for(var _0x6301f9=0x0;_0x6301f9<_0x1ce085['length'];_0x6301f9+=0x1){_0x45e03c[_0x6301f9][_0x7237('0x50')]=[];_0x83dcaf['push'](db['ChatInternalMessage'][_0x7237('0x4a')]({'where':{'FromId':[_0x17cb09[_0x7237('0x55')]['id'],_0x1ce085[_0x6301f9]['id']],'ToId':[_0x17cb09[_0x7237('0x55')]['id'],_0x1ce085[_0x6301f9]['id']],'ChatGroupId':null},'attributes':['id',_0x7237('0x65'),_0x7237('0x66'),_0x7237('0x67'),_0x7237('0x68'),'body'],'order':qs[_0x7237('0x3b')](_0x7237('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7237('0x26')](wrapUser(_0x1ce085[_0x6301f9])));}return BPromise[_0x7237('0x6a')](_0x83dcaf);}return[];})[_0x7237('0x26')](function(_0x506514){return{'rows':_0x506514,'count':_0x506514[_0x7237('0x37')]};})[_0x7237('0x26')](respondWithResult(_0x264b2e,null))['catch'](handleError(_0x264b2e,null));};
\ No newline at end of file
+var _0x70ff=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','set','save','update','then','end','error','stack','name','send','index','ChatInternalMessage','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','merge','find','catch','create','body','describe','get','lastMessageAt','createdAt','lastMessage','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','resourceId','push','messages','ToId','read','-createdAt','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x16c925,_0x16f4c3){var _0x54e4ca=function(_0x13597b){while(--_0x13597b){_0x16c925['push'](_0x16c925['shift']());}};_0x54e4ca(++_0x16f4c3);}(_0x70ff,0x12f));var _0xf70f=function(_0x8d8f23,_0x8c1961){_0x8d8f23=_0x8d8f23-0x0;var _0x22bf54=_0x70ff[_0x8d8f23];return _0x22bf54;};'use strict';var emlformat=require(_0xf70f('0x0'));var rimraf=require(_0xf70f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf70f('0x2'));var rp=require(_0xf70f('0x3'));var moment=require(_0xf70f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf70f('0x5'));var util=require(_0xf70f('0x6'));var path=require('path');var sox=require(_0xf70f('0x7'));var csv=require('to-csv');var ejs=require(_0xf70f('0x8'));var fs=require('fs');var fs_extra=require(_0xf70f('0x9'));var _=require(_0xf70f('0xa'));var squel=require(_0xf70f('0xb'));var crypto=require(_0xf70f('0xc'));var jsforce=require(_0xf70f('0xd'));var deskjs=require(_0xf70f('0xe'));var toCsv=require(_0xf70f('0xf'));var querystring=require(_0xf70f('0x10'));var Papa=require(_0xf70f('0x11'));var Redis=require(_0xf70f('0x12'));var authService=require(_0xf70f('0x13'));var qs=require(_0xf70f('0x14'));var as=require(_0xf70f('0x15'));var hardwareService=require(_0xf70f('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf70f('0x17'));var config=require(_0xf70f('0x18'));var licenseUtil=require(_0xf70f('0x19'));var db=require(_0xf70f('0x1a'))['db'];config[_0xf70f('0x1b')]=_[_0xf70f('0x1c')](config['redis'],{'host':_0xf70f('0x1d'),'port':0x18eb});var socket=require(_0xf70f('0x1e'))(new Redis(config[_0xf70f('0x1b')]));require(_0xf70f('0x1f'))[_0xf70f('0x20')](socket);function respondWithStatusCode(_0x36808b,_0x195827){_0x195827=_0x195827||0xcc;return function(_0x4257e9){if(_0x4257e9){return _0x36808b[_0xf70f('0x21')](_0x195827);}return _0x36808b[_0xf70f('0x22')](_0x195827)['end']();};}function respondWithResult(_0x159cdf,_0x38ba86){_0x38ba86=_0x38ba86||0xc8;return function(_0x3bfdb1){if(_0x3bfdb1){return _0x159cdf[_0xf70f('0x22')](_0x38ba86)[_0xf70f('0x23')](_0x3bfdb1);}};}function respondWithFilteredResult(_0x20177e,_0x1551a4){return function(_0x290314){if(_0x290314){var _0x516680=typeof _0x1551a4[_0xf70f('0x24')]===_0xf70f('0x25')&&typeof _0x1551a4['limit']==='undefined';var _0x41be77=_0x290314[_0xf70f('0x26')];var _0x378b57=_0x516680?0x0:_0x1551a4[_0xf70f('0x24')];var _0x2c1b3b=_0x516680?_0x290314[_0xf70f('0x26')]:_0x1551a4[_0xf70f('0x24')]+_0x1551a4['limit'];var _0x51f86d;if(_0x2c1b3b>=_0x41be77){_0x2c1b3b=_0x41be77;_0x51f86d=0xc8;}else{_0x51f86d=0xce;}_0x20177e['status'](_0x51f86d);return _0x20177e[_0xf70f('0x27')]('Content-Range',_0x378b57+'-'+_0x2c1b3b+'/'+_0x41be77)[_0xf70f('0x23')](_0x290314);}return null;};}function patchUpdates(_0x2189c2){return function(_0x7c71de){try{jsonpatch['apply'](_0x7c71de,_0x2189c2,!![]);}catch(_0x3afe13){return BPromise['reject'](_0x3afe13);}return _0x7c71de[_0xf70f('0x28')]();};}function saveUpdates(_0x4fd583,_0x553221){return function(_0x3e4bdc){if(_0x3e4bdc){return _0x3e4bdc[_0xf70f('0x29')](_0x4fd583)['then'](function(_0x3278c2){return _0x3278c2;});}return null;};}function removeEntity(_0x15949f,_0x2e6849){return function(_0x197d23){if(_0x197d23){return _0x197d23['destroy']()[_0xf70f('0x2a')](function(){_0x15949f[_0xf70f('0x22')](0xcc)[_0xf70f('0x2b')]();});}};}function handleEntityNotFound(_0xe88ba8,_0x17f8a3){return function(_0x3b0d31){if(!_0x3b0d31){_0xe88ba8['sendStatus'](0x194);}return _0x3b0d31;};}function handleError(_0x3e62cc,_0x43d1f5){_0x43d1f5=_0x43d1f5||0x1f4;return function(_0x5d9dcd){logger[_0xf70f('0x2c')](_0x5d9dcd[_0xf70f('0x2d')]);if(_0x5d9dcd['name']){delete _0x5d9dcd[_0xf70f('0x2e')];}_0x3e62cc[_0xf70f('0x22')](_0x43d1f5)[_0xf70f('0x2f')](_0x5d9dcd);};}exports[_0xf70f('0x30')]=function(_0x20e8fd,_0xb7eaa2){var _0x49732d={},_0x5b5e3c={},_0x424925={'count':0x0,'rows':[]};var _0x447b45=_['map'](db[_0xf70f('0x31')]['rawAttributes'],function(_0x5cfe54){return{'name':_0x5cfe54[_0xf70f('0x32')],'type':_0x5cfe54[_0xf70f('0x33')][_0xf70f('0x34')]};});_0x5b5e3c[_0xf70f('0x35')]=_[_0xf70f('0x36')](_0x447b45,_0xf70f('0x2e'));_0x5b5e3c[_0xf70f('0x37')]=_['keys'](_0x20e8fd['query']);_0x5b5e3c['filters']=_[_0xf70f('0x38')](_0x5b5e3c[_0xf70f('0x35')],_0x5b5e3c['query']);_0x49732d[_0xf70f('0x39')]=_['intersection'](_0x5b5e3c[_0xf70f('0x35')],qs[_0xf70f('0x3a')](_0x20e8fd['query'][_0xf70f('0x3a')]));_0x49732d[_0xf70f('0x39')]=_0x49732d[_0xf70f('0x39')][_0xf70f('0x3b')]?_0x49732d[_0xf70f('0x39')]:_0x5b5e3c[_0xf70f('0x35')];if(!_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x3c')](_0xf70f('0x3d'))){_0x49732d['limit']=qs['limit'](_0x20e8fd[_0xf70f('0x37')]['limit']);_0x49732d[_0xf70f('0x24')]=qs[_0xf70f('0x24')](_0x20e8fd['query'][_0xf70f('0x24')]);}_0x49732d['order']=qs[_0xf70f('0x3e')](_0x20e8fd['query']['sort']);_0x49732d['where']=qs[_0xf70f('0x3f')](_[_0xf70f('0x40')](_0x20e8fd[_0xf70f('0x37')],_0x5b5e3c[_0xf70f('0x3f')]),_0x447b45);if(_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x41')]){_0x49732d[_0xf70f('0x42')]=_['merge'](_0x49732d[_0xf70f('0x42')],{'$or':_[_0xf70f('0x36')](_0x447b45,function(_0x16f3bc){if(_0x16f3bc[_0xf70f('0x33')]!==_0xf70f('0x43')){var _0x330a54={};_0x330a54[_0x16f3bc['name']]={'$like':'%'+_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x41')]+'%'};return _0x330a54;}})});}_0x49732d=_['merge']({},_0x49732d,_0x20e8fd['options']);var _0x36f549={'where':_0x49732d['where']};return db['ChatInternalMessage'][_0xf70f('0x26')](_0x36f549)[_0xf70f('0x2a')](function(_0x37ec2c){_0x424925['count']=_0x37ec2c;if(_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x44')]){_0x49732d[_0xf70f('0x45')]=[{'all':!![]}];}return db[_0xf70f('0x31')][_0xf70f('0x46')](_0x49732d);})[_0xf70f('0x2a')](function(_0xbff51e){_0x424925[_0xf70f('0x47')]=_0xbff51e;return _0x424925;})['then'](respondWithFilteredResult(_0xb7eaa2,_0x49732d))['catch'](handleError(_0xb7eaa2,null));};exports[_0xf70f('0x48')]=function(_0x1cb4ce,_0x4088d9){var _0x73c4f6={'raw':!![],'where':{'id':_0x1cb4ce[_0xf70f('0x49')]['id']}},_0x597210={};_0x597210['model']=_[_0xf70f('0x4a')](db[_0xf70f('0x31')][_0xf70f('0x4b')]);_0x597210[_0xf70f('0x37')]=_[_0xf70f('0x4a')](_0x1cb4ce['query']);_0x597210[_0xf70f('0x3f')]=_[_0xf70f('0x38')](_0x597210[_0xf70f('0x35')],_0x597210['query']);_0x73c4f6[_0xf70f('0x39')]=_['intersection'](_0x597210[_0xf70f('0x35')],qs[_0xf70f('0x3a')](_0x1cb4ce[_0xf70f('0x37')][_0xf70f('0x3a')]));_0x73c4f6[_0xf70f('0x39')]=_0x73c4f6[_0xf70f('0x39')][_0xf70f('0x3b')]?_0x73c4f6[_0xf70f('0x39')]:_0x597210[_0xf70f('0x35')];if(_0x1cb4ce['query'][_0xf70f('0x44')]){_0x73c4f6[_0xf70f('0x45')]=[{'all':!![]}];}_0x73c4f6=_[_0xf70f('0x4c')]({},_0x73c4f6,_0x1cb4ce['options']);return db[_0xf70f('0x31')][_0xf70f('0x4d')](_0x73c4f6)[_0xf70f('0x2a')](handleEntityNotFound(_0x4088d9,null))[_0xf70f('0x2a')](respondWithResult(_0x4088d9,null))[_0xf70f('0x4e')](handleError(_0x4088d9,null));};exports[_0xf70f('0x4f')]=function(_0x3e5fce,_0x1873eb){return db[_0xf70f('0x31')][_0xf70f('0x4f')](_0x3e5fce[_0xf70f('0x50')],{})[_0xf70f('0x2a')](respondWithResult(_0x1873eb,0xc9))[_0xf70f('0x4e')](handleError(_0x1873eb,null));};exports[_0xf70f('0x29')]=function(_0x36e5bd,_0xe02d6b){if(_0x36e5bd[_0xf70f('0x50')]['id']){delete _0x36e5bd[_0xf70f('0x50')]['id'];}return db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'id':_0x36e5bd[_0xf70f('0x49')]['id']}})['then'](handleEntityNotFound(_0xe02d6b,null))['then'](saveUpdates(_0x36e5bd[_0xf70f('0x50')],null))[_0xf70f('0x2a')](respondWithResult(_0xe02d6b,null))[_0xf70f('0x4e')](handleError(_0xe02d6b,null));};exports['destroy']=function(_0xa792fe,_0x497144){return db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'id':_0xa792fe[_0xf70f('0x49')]['id']}})[_0xf70f('0x2a')](handleEntityNotFound(_0x497144,null))[_0xf70f('0x2a')](removeEntity(_0x497144,null))[_0xf70f('0x4e')](handleError(_0x497144,null));};exports['describe']=function(_0x2f8f2e,_0x4cc7c7){return db[_0xf70f('0x31')][_0xf70f('0x51')]()[_0xf70f('0x2a')](respondWithResult(_0x4cc7c7,null))[_0xf70f('0x4e')](handleError(_0x4cc7c7,null));};function wrapUser(_0x530998){return function(_0x58cdc5){var _0x4d167e=_0x530998[_0xf70f('0x52')]({'plain':!![]});_0x4d167e['messages']=[];if(_0x58cdc5){_0x4d167e[_0xf70f('0x53')]=_0x58cdc5[_0xf70f('0x54')];_0x4d167e[_0xf70f('0x55')]=_0x58cdc5;}else{_0x4d167e['lastMessageAt']=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4d167e[_0xf70f('0x55')]={};}return _0x4d167e;};}exports[_0xf70f('0x56')]=function(_0x4fc3d,_0x7e5976,_0x5bdac3){var _0x11cd5f=[];return db[_0xf70f('0x57')][_0xf70f('0x46')]({'where':{'role':[_0xf70f('0x58'),_0xf70f('0x59'),'user']},'attributes':['id',_0xf70f('0x5a'),_0xf70f('0x2e'),'role','userpic',_0xf70f('0x5b'),_0xf70f('0x5c'),_0xf70f('0x5d'),_0xf70f('0x5e'),_0xf70f('0x5f')],'order':qs['sort']('-online'),'include':[{'model':db[_0xf70f('0x60')],'as':_0xf70f('0x61'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xf70f('0x2a')](function(_0x3a582b){if(_0x3a582b){var _0x4f02ba=_0x4fc3d[_0xf70f('0x62')]['get']({'plain':!![]});if(!_0x4f02ba)throw new Error(_0xf70f('0x63'));if(_0x4f02ba[_0xf70f('0x64')]===_0xf70f('0x62')){return db[_0xf70f('0x65')]['find']({'where':{'name':'Agents','userProfileId':_0x4f02ba['userProfileId']},'raw':!![]})[_0xf70f('0x2a')](function(_0x316e5c){if(_0x316e5c){if(_0x316e5c[_0xf70f('0x66')]===0x0){return db['UserProfileResource'][_0xf70f('0x46')]({'where':{'sectionId':_0x316e5c['id']},'raw':!![]})[_0xf70f('0x2a')](function(_0x4bd7a7){var _0x279d93=[];if(_['isEmpty'](_0x4bd7a7)){_0x279d93=_['filter'](_0x3a582b,function(_0x19559a){if(_0x19559a[_0xf70f('0x64')]!==_0xf70f('0x58')){return _0x19559a;}});return _0x279d93;}else{for(var _0x2a6729=0x0;_0x2a6729<_0x3a582b[_0xf70f('0x3b')];_0x2a6729++){var _0x5c2683=_0x3a582b[_0x2a6729];if(_0x5c2683[_0xf70f('0x64')]===_0xf70f('0x58')){var _0x4ab6af=_[_0xf70f('0x4d')](_0x4bd7a7,function(_0x55ef53){return _0x55ef53[_0xf70f('0x67')]===_0x5c2683['id'];});if(_0x4ab6af)_0x279d93['push'](_0x5c2683);}else{_0x279d93[_0xf70f('0x68')](_0x5c2683);}}return _0x279d93;}});}else{return _0x3a582b;}}else{var _0x1b23cb=_['filter'](_0x3a582b,function(_0x27aa59){if(_0x27aa59[_0xf70f('0x64')]!==_0xf70f('0x58')){return _0x27aa59;}});return _0x1b23cb;}});}else{return _0x3a582b;}}})[_0xf70f('0x2a')](function(_0x40e4bf){var _0xea8cc1=[];if(_0x40e4bf){_0x11cd5f=_0x40e4bf;for(var _0x4af2b0=0x0;_0x4af2b0<_0x40e4bf[_0xf70f('0x3b')];_0x4af2b0+=0x1){_0x11cd5f[_0x4af2b0][_0xf70f('0x69')]=[];_0xea8cc1[_0xf70f('0x68')](db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'FromId':[_0x4fc3d[_0xf70f('0x62')]['id'],_0x40e4bf[_0x4af2b0]['id']],'ToId':[_0x4fc3d['user']['id'],_0x40e4bf[_0x4af2b0]['id']],'ChatGroupId':null},'attributes':['id',_0xf70f('0x54'),'FromId',_0xf70f('0x6a'),_0xf70f('0x6b'),_0xf70f('0x50')],'order':qs['sort'](_0xf70f('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf70f('0x2a')](wrapUser(_0x40e4bf[_0x4af2b0])));}return BPromise['all'](_0xea8cc1);}return[];})[_0xf70f('0x2a')](function(_0x523d0d){return{'rows':_0x523d0d,'count':_0x523d0d[_0xf70f('0x3b')]};})[_0xf70f('0x2a')](respondWithResult(_0x7e5976,null))[_0xf70f('0x4e')](handleError(_0x7e5976,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index fffad87..bb2c476 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 _0x8c8f=['exports','events','ChatInternalMessage','hasOwnProperty','hook'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x8c8f,0x1e6));var _0xf8c8=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x8c8f[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0xf8c8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xf8c8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ad7e8){return function(_0x5f25fe,_0x22f13f,_0x5f1880){ChatInternalMessageEvents['emit'](_0x4ad7e8+':'+_0x5f25fe['id'],_0x5f25fe);ChatInternalMessageEvents['emit'](_0x4ad7e8,_0x5f25fe);_0x5f1880(null);};}for(var e in events){if(events[_0xf8c8('0x2')](e)){var event=events[e];ChatInternalMessage[_0xf8c8('0x3')](e,emitEvent(event));}}module[_0xf8c8('0x4')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x6043=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x19006e,_0x554f02){var _0x2d8060=function(_0x30447d){while(--_0x30447d){_0x19006e['push'](_0x19006e['shift']());}};_0x2d8060(++_0x554f02);}(_0x6043,0x185));var _0x3604=function(_0x73f87f,_0x2eb5c5){_0x73f87f=_0x73f87f-0x0;var _0x11899b=_0x6043[_0x73f87f];return _0x11899b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3604('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3604('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3604('0x2'),'afterDestroy':_0x3604('0x3')};function emitEvent(_0x5364a8){return function(_0x506e20,_0x6735da,_0x46d3b3){ChatInternalMessageEvents[_0x3604('0x4')](_0x5364a8+':'+_0x506e20['id'],_0x506e20);ChatInternalMessageEvents[_0x3604('0x4')](_0x5364a8,_0x506e20);_0x46d3b3(null);};}for(var e in events){if(events[_0x3604('0x5')](e)){var event=events[e];ChatInternalMessage[_0x3604('0x6')](e,emitEvent(event));}}module[_0x3604('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index c5cccd5..53eab5f 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 _0xf706=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','../../config/environment','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf706,0xca));var _0x6f70=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf706[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f70('0x0'))(_0x6f70('0x1'));var moment=require('moment');var BPromise=require(_0x6f70('0x2'));var rp=require(_0x6f70('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f70('0x4'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x19e863,_0x51a409){return _0x19e863[_0x6f70('0x5')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f70('0x6'),'collate':_0x6f70('0x7')});};
\ No newline at end of file
+var _0x719f=['chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','./chatInternalMessage.attributes','exports','define'];(function(_0x14081a,_0x36ee7c){var _0x1313cf=function(_0x2fae2e){while(--_0x2fae2e){_0x14081a['push'](_0x14081a['shift']());}};_0x1313cf(++_0x36ee7c);}(_0x719f,0x70));var _0xf719=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0x719f[_0x512c83];return _0x1f7f25;};'use strict';var _=require(_0xf719('0x0'));var util=require(_0xf719('0x1'));var logger=require(_0xf719('0x2'))(_0xf719('0x3'));var moment=require('moment');var BPromise=require(_0xf719('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf719('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf719('0x6'));module[_0xf719('0x7')]=function(_0x4df7ac,_0x5e3ad0){return _0x4df7ac[_0xf719('0x8')]('ChatInternalMessage',attributes,{'tableName':_0xf719('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf719('0xa'),'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 1b4eb3e..a2a626d 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 _0x181d=['../../config/utils','rpc','../../config/environment','http','defaults','redis','localhost','./chatInternalMessage.socket','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb'];(function(_0xc1743c,_0x154fe5){var _0x3143ff=function(_0x4b9899){while(--_0x4b9899){_0xc1743c['push'](_0xc1743c['shift']());}};_0x3143ff(++_0x154fe5);}(_0x181d,0x10f));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd181('0x0'));var BPromise=require('bluebird');var rs=require(_0xd181('0x1'));var fs=require('fs');var Redis=require(_0xd181('0x2'));var db=require(_0xd181('0x3'))['db'];var utils=require(_0xd181('0x4'));var logger=require('../../config/logger')(_0xd181('0x5'));var config=require(_0xd181('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd181('0x7')]({'port':0x232a});config['redis']=_[_0xd181('0x8')](config[_0xd181('0x9')],{'host':_0xd181('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd181('0x9')]));require(_0xd181('0xb'))[_0xd181('0xc')](socket);function respondWithRpcPromise(_0x74ef22,_0x103eee,_0x589470){return new BPromise(function(_0x51d3ce,_0x549dd2){return client['request'](_0x74ef22,_0x589470)[_0xd181('0xd')](function(_0x4cb3f6){logger['info'](_0xd181('0xe'),_0x103eee,_0xd181('0xf'));logger[_0xd181('0x10')](_0xd181('0x11'),_0x103eee,_0xd181('0xf'),JSON[_0xd181('0x12')](_0x4cb3f6));if(_0x4cb3f6[_0xd181('0x13')]){if(_0x4cb3f6[_0xd181('0x13')][_0xd181('0x14')]===0x1f4){logger[_0xd181('0x13')](_0xd181('0xe'),_0x103eee,_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);return _0x549dd2(_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);}logger[_0xd181('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x103eee,_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);return _0x51d3ce(_0x4cb3f6[_0xd181('0x13')]['message']);}else{logger[_0xd181('0x16')](_0xd181('0xe'),_0x103eee,_0xd181('0xf'));_0x51d3ce(_0x4cb3f6[_0xd181('0x17')][_0xd181('0x15')]);}})[_0xd181('0x18')](function(_0x483615){logger[_0xd181('0x13')](_0xd181('0xe'),_0x103eee,_0x483615);_0x549dd2(_0x483615);});});}
\ No newline at end of file
+var _0xeb6a=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x482c19,_0x456e39){var _0x57dc03=function(_0x23ebed){while(--_0x23ebed){_0x482c19['push'](_0x482c19['shift']());}};_0x57dc03(++_0x456e39);}(_0xeb6a,0x1f4));var _0xaeb6=function(_0x52decf,_0x1bd6bc){_0x52decf=_0x52decf-0x0;var _0x43e3cd=_0xeb6a[_0x52decf];return _0x43e3cd;};'use strict';var _=require(_0xaeb6('0x0'));var util=require(_0xaeb6('0x1'));var moment=require(_0xaeb6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaeb6('0x3'));var db=require(_0xaeb6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeb6('0x5'))(_0xaeb6('0x6'));var config=require('../../config/environment');var jayson=require(_0xaeb6('0x7'));var client=jayson[_0xaeb6('0x8')][_0xaeb6('0x9')]({'port':0x232a});config[_0xaeb6('0xa')]=_[_0xaeb6('0xb')](config[_0xaeb6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaeb6('0xc'))(new Redis(config['redis']));require(_0xaeb6('0xd'))['register'](socket);function respondWithRpcPromise(_0x315ec7,_0x49f280,_0x5d996d){return new BPromise(function(_0x150386,_0x3048bf){return client[_0xaeb6('0xe')](_0x315ec7,_0x5d996d)[_0xaeb6('0xf')](function(_0x5efe69){logger[_0xaeb6('0x10')](_0xaeb6('0x11'),_0x49f280,_0xaeb6('0x12'));logger[_0xaeb6('0x13')](_0xaeb6('0x14'),_0x49f280,'request\x20sent',JSON[_0xaeb6('0x15')](_0x5efe69));if(_0x5efe69['error']){if(_0x5efe69['error'][_0xaeb6('0x16')]===0x1f4){logger[_0xaeb6('0x17')](_0xaeb6('0x11'),_0x49f280,_0x5efe69[_0xaeb6('0x17')]['message']);return _0x3048bf(_0x5efe69[_0xaeb6('0x17')]['message']);}logger[_0xaeb6('0x17')](_0xaeb6('0x11'),_0x49f280,_0x5efe69['error'][_0xaeb6('0x18')]);return _0x150386(_0x5efe69[_0xaeb6('0x17')]['message']);}else{logger[_0xaeb6('0x10')](_0xaeb6('0x11'),_0x49f280,_0xaeb6('0x12'));_0x150386(_0x5efe69['result'][_0xaeb6('0x18')]);}})[_0xaeb6('0x19')](function(_0x199017){logger[_0xaeb6('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x49f280,_0x199017);_0x3048bf(_0x199017);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 51f2619..288c956 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 _0x125d=['length','save','remove','emit','register'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x125d,0x182));var _0xd125=function(_0x2b9978,_0x4c5bc5){_0x2b9978=_0x2b9978-0x0;var _0x5dd096=_0x125d[_0x2b9978];return _0x5dd096;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xd125('0x0'),_0xd125('0x1'),'update'];function createListener(_0x10d34e,_0x5af449){return function(_0x1c546b){_0x5af449[_0xd125('0x2')](_0x10d34e,_0x1c546b);};}function removeListener(_0x5b9c86,_0x266995){return function(){ChatInternalMessageEvents['removeListener'](_0x5b9c86,_0x266995);};}exports[_0xd125('0x3')]=function(_0x3f65ef){for(var _0x4449d2=0x0,_0x566ca6=events[_0xd125('0x4')];_0x4449d2<_0x566ca6;_0x4449d2++){var _0x278cfa=events[_0x4449d2];var _0x216a4d=createListener('chatInternalMessage:'+_0x278cfa,_0x3f65ef);ChatInternalMessageEvents['on'](_0x278cfa,_0x216a4d);}};
\ No newline at end of file
+var _0x9a5b=['removeListener','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x4f51ca,_0x568e79){var _0x1c0d86=function(_0x5648ae){while(--_0x5648ae){_0x4f51ca['push'](_0x4f51ca['shift']());}};_0x1c0d86(++_0x568e79);}(_0x9a5b,0x1d0));var _0xb9a5=function(_0xdd5006,_0x178b90){_0xdd5006=_0xdd5006-0x0;var _0x3aecea=_0x9a5b[_0xdd5006];return _0x3aecea;};'use strict';var ChatInternalMessageEvents=require(_0xb9a5('0x0'));var events=[_0xb9a5('0x1'),_0xb9a5('0x2'),_0xb9a5('0x3')];function createListener(_0x3206f1,_0xdd6be){return function(_0x2790f6){_0xdd6be['emit'](_0x3206f1,_0x2790f6);};}function removeListener(_0x293e22,_0x562561){return function(){ChatInternalMessageEvents[_0xb9a5('0x4')](_0x293e22,_0x562561);};}exports['register']=function(_0x3af0e1){for(var _0x3a541e=0x0,_0x3e7508=events['length'];_0x3a541e<_0x3e7508;_0x3a541e++){var _0x1c2435=events[_0x3a541e];var _0x6143ea=createListener(_0xb9a5('0x5')+_0x1c2435,_0x3af0e1);ChatInternalMessageEvents['on'](_0x1c2435,_0x6143ea);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 59c163b..4d27862 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 _0x8406=['isAuthenticated','/describe','describe','/users','getUsers','/:id','show','create','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8406,0x162));var _0x6840=function(_0x4a55c4,_0x15a91d){_0x4a55c4=_0x4a55c4-0x0;var _0x175338=_0x8406[_0x4a55c4];return _0x175338;};'use strict';var multer=require('multer');var util=require(_0x6840('0x0'));var path=require(_0x6840('0x1'));var timeout=require('connect-timeout');var express=require(_0x6840('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6840('0x3'));var interaction=require(_0x6840('0x4'));var config=require('../../config/environment');var controller=require(_0x6840('0x5'));router[_0x6840('0x6')]('/',auth[_0x6840('0x7')](),controller['index']);router[_0x6840('0x6')](_0x6840('0x8'),auth[_0x6840('0x7')](),controller[_0x6840('0x9')]);router[_0x6840('0x6')](_0x6840('0xa'),auth[_0x6840('0x7')](),controller[_0x6840('0xb')]);router[_0x6840('0x6')](_0x6840('0xc'),auth[_0x6840('0x7')](),controller[_0x6840('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6840('0xe')]);router['put'](_0x6840('0xc'),controller[_0x6840('0xf')]);router[_0x6840('0x10')]('/:id',auth[_0x6840('0x7')](),controller[_0x6840('0x11')]);module[_0x6840('0x12')]=router;
\ No newline at end of file
+var _0xe2a6=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','getUsers','post','put','/:id','update','delete','destroy','exports','util'];(function(_0x1ed0e1,_0x45098f){var _0x12b97f=function(_0x1e06dd){while(--_0x1e06dd){_0x1ed0e1['push'](_0x1ed0e1['shift']());}};_0x12b97f(++_0x45098f);}(_0xe2a6,0x8b));var _0x6e2a=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xe2a6[_0x2c0dc0];return _0x4c0990;};'use strict';var multer=require('multer');var util=require(_0x6e2a('0x0'));var path=require(_0x6e2a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e2a('0x2'));var router=express[_0x6e2a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6e2a('0x4'));var interaction=require(_0x6e2a('0x5'));var config=require(_0x6e2a('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x6e2a('0x7')]('/',auth[_0x6e2a('0x8')](),controller[_0x6e2a('0x9')]);router[_0x6e2a('0x7')]('/describe',auth[_0x6e2a('0x8')](),controller[_0x6e2a('0xa')]);router[_0x6e2a('0x7')](_0x6e2a('0xb'),auth['isAuthenticated'](),controller[_0x6e2a('0xc')]);router[_0x6e2a('0x7')]('/:id',auth[_0x6e2a('0x8')](),controller['show']);router[_0x6e2a('0xd')]('/',auth[_0x6e2a('0x8')](),controller['create']);router[_0x6e2a('0xe')](_0x6e2a('0xf'),controller[_0x6e2a('0x10')]);router[_0x6e2a('0x11')](_0x6e2a('0xf'),auth[_0x6e2a('0x8')](),controller[_0x6e2a('0x12')]);module[_0x6e2a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 727e99c..cac2585 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 _0x720e=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x3a2797,_0x1f905c){var _0x5c2d96=function(_0x3c7bd7){while(--_0x3c7bd7){_0x3a2797['push'](_0x3a2797['shift']());}};_0x5c2d96(++_0x1f905c);}(_0x720e,0x1cb));var _0xe720=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0x720e[_0x5c18ef];return _0x33789d;};'use strict';var Sequelize=require(_0xe720('0x0'));module[_0xe720('0x1')]={'body':{'type':Sequelize[_0xe720('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xe720('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe720('0x4')),'defaultValue':_0xe720('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe720('0x5')]},'providerName':{'type':Sequelize[_0xe720('0x6')]},'providerResponse':{'type':Sequelize[_0xe720('0x2')]}};
\ No newline at end of file
+var _0x97e7=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x97e7,0x1a1));var _0x797e=function(_0x389342,_0x6658bc){_0x389342=_0x389342-0x0;var _0x5b33e5=_0x97e7[_0x389342];return _0x5b33e5;};'use strict';var Sequelize=require(_0x797e('0x0'));module[_0x797e('0x1')]={'body':{'type':Sequelize[_0x797e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x797e('0x4')]('in',_0x797e('0x5')),'defaultValue':_0x797e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x797e('0x6')]},'providerName':{'type':Sequelize[_0x797e('0x7')]},'providerResponse':{'type':Sequelize[_0x797e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 8f47a02..e68de63 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 _0xa2e0=['reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','ChatMessage','includeAll','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','ChatInteractionId','isNil','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','agent','fullname','email','internal','manual','interface','motionChannel','event','EventManager','acceptmessage','parse','formData','RejectMessage','contact','SIP/%s','channel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json'];(function(_0x3aa8b2,_0x5a11e3){var _0x6f394e=function(_0x254bb8){while(--_0x254bb8){_0x3aa8b2['push'](_0x3aa8b2['shift']());}};_0x6f394e(++_0x5a11e3);}(_0xa2e0,0x1e4));var _0x0a2e=function(_0x339798,_0x14d3b7){_0x339798=_0x339798-0x0;var _0x574b4e=_0xa2e0[_0x339798];return _0x574b4e;};'use strict';var emlformat=require(_0x0a2e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a2e('0x1'));var jsonpatch=require(_0x0a2e('0x2'));var rp=require(_0x0a2e('0x3'));var moment=require(_0x0a2e('0x4'));var BPromise=require(_0x0a2e('0x5'));var Mustache=require(_0x0a2e('0x6'));var util=require(_0x0a2e('0x7'));var path=require('path');var sox=require(_0x0a2e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0a2e('0xa'));var crypto=require(_0x0a2e('0xb'));var jsforce=require(_0x0a2e('0xc'));var deskjs=require(_0x0a2e('0xd'));var toCsv=require(_0x0a2e('0xe'));var querystring=require(_0x0a2e('0xf'));var Papa=require(_0x0a2e('0x10'));var Redis=require(_0x0a2e('0x11'));var authService=require(_0x0a2e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0a2e('0x13'));var hardwareService=require(_0x0a2e('0x14'));var logger=require(_0x0a2e('0x15'))(_0x0a2e('0x16'));var utils=require(_0x0a2e('0x17'));var config=require(_0x0a2e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a2e('0x19'))['db'];config[_0x0a2e('0x1a')]=_['defaults'](config[_0x0a2e('0x1a')],{'host':_0x0a2e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a2e('0x1a')]));require('./chatMessage.socket')[_0x0a2e('0x1c')](socket);var jayson=require(_0x0a2e('0x1d'));var client=jayson[_0x0a2e('0x1e')][_0x0a2e('0x1f')]({'port':0x232c});var client9002=jayson[_0x0a2e('0x1e')][_0x0a2e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2b1ed8,_0x4b6087,_0x537b12,_0x473326){return new BPromise(function(_0x119858,_0x514a13){var _0x3a262c=_0x473326||client;return _0x3a262c[_0x0a2e('0x20')](_0x2b1ed8,_0x537b12)[_0x0a2e('0x21')](function(_0xf58d){logger['info'](_0x0a2e('0x22'),_0x4b6087,_0x0a2e('0x23'));logger[_0x0a2e('0x24')](_0x0a2e('0x25'),_0x4b6087,_0x0a2e('0x23'),JSON[_0x0a2e('0x26')](_0xf58d));if(_0xf58d['error']){if(_0xf58d[_0x0a2e('0x27')]['code']===0x1f4){logger['error'](_0x0a2e('0x22'),_0x4b6087,_0xf58d[_0x0a2e('0x27')][_0x0a2e('0x28')]);return _0x514a13(_0xf58d[_0x0a2e('0x27')][_0x0a2e('0x28')]);}logger[_0x0a2e('0x27')](_0x0a2e('0x22'),_0x4b6087,_0xf58d[_0x0a2e('0x27')][_0x0a2e('0x28')]);return _0x119858(_0xf58d[_0x0a2e('0x27')][_0x0a2e('0x28')]);}else{logger['info'](_0x0a2e('0x22'),_0x4b6087,_0x0a2e('0x23'));_0x119858(_0xf58d[_0x0a2e('0x29')]['message']);}})[_0x0a2e('0x2a')](function(_0x11e0fa){logger[_0x0a2e('0x27')]('ChatMessage,\x20%s,\x20%s',_0x4b6087,_0x11e0fa);_0x514a13(_0x11e0fa);});});}function respondWithStatusCode(_0x643c05,_0x290d67){_0x290d67=_0x290d67||0xcc;return function(_0x23107c){if(_0x23107c){return _0x643c05[_0x0a2e('0x2b')](_0x290d67);}return _0x643c05[_0x0a2e('0x2c')](_0x290d67)[_0x0a2e('0x2d')]();};}function respondWithResult(_0xde2054,_0x55c766){_0x55c766=_0x55c766||0xc8;return function(_0x23732a){if(_0x23732a){return _0xde2054[_0x0a2e('0x2c')](_0x55c766)['json'](_0x23732a);}};}function respondWithFilteredResult(_0x5e3162,_0x146961){return function(_0x58e5b2){if(_0x58e5b2){var _0x5f3854=typeof _0x146961[_0x0a2e('0x2e')]==='undefined'&&typeof _0x146961[_0x0a2e('0x2f')]===_0x0a2e('0x30');var _0x2ecb7b=_0x58e5b2[_0x0a2e('0x31')];var _0x1fb83f=_0x5f3854?0x0:_0x146961[_0x0a2e('0x2e')];var _0x5b0b40=_0x5f3854?_0x58e5b2[_0x0a2e('0x31')]:_0x146961['offset']+_0x146961[_0x0a2e('0x2f')];var _0xf0d024;if(_0x5b0b40>=_0x2ecb7b){_0x5b0b40=_0x2ecb7b;_0xf0d024=0xc8;}else{_0xf0d024=0xce;}_0x5e3162['status'](_0xf0d024);return _0x5e3162['set'](_0x0a2e('0x32'),_0x1fb83f+'-'+_0x5b0b40+'/'+_0x2ecb7b)[_0x0a2e('0x33')](_0x58e5b2);}return null;};}function patchUpdates(_0x4eac0a){return function(_0x549810){try{jsonpatch['apply'](_0x549810,_0x4eac0a,!![]);}catch(_0x3212fe){return BPromise[_0x0a2e('0x34')](_0x3212fe);}return _0x549810[_0x0a2e('0x35')]();};}function saveUpdates(_0x576a19,_0x5ae69e){return function(_0x5d677a){if(_0x5d677a){return _0x5d677a[_0x0a2e('0x36')](_0x576a19)[_0x0a2e('0x21')](function(_0x156d1f){return _0x156d1f;});}return null;};}function removeEntity(_0x57b30b,_0x3def0a){return function(_0x4a5f40){if(_0x4a5f40){return _0x4a5f40[_0x0a2e('0x37')]()['then'](function(){_0x57b30b[_0x0a2e('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc97779,_0x577bf2){return function(_0x4929f4){if(!_0x4929f4){_0xc97779['sendStatus'](0x194);}return _0x4929f4;};}function handleError(_0x9294d8,_0x10c4f6){_0x10c4f6=_0x10c4f6||0x1f4;return function(_0x221b7f){logger[_0x0a2e('0x27')](_0x221b7f[_0x0a2e('0x38')]);if(_0x221b7f[_0x0a2e('0x39')]){delete _0x221b7f['name'];}_0x9294d8['status'](_0x10c4f6)[_0x0a2e('0x3a')](_0x221b7f);};}exports[_0x0a2e('0x3b')]=function(_0x5344b9,_0x2d121f){var _0x2c73a2={},_0x33118e={},_0x53953f={'count':0x0,'rows':[]};var _0x32454=_[_0x0a2e('0x3c')](db['ChatMessage'][_0x0a2e('0x3d')],function(_0x35b009){return{'name':_0x35b009[_0x0a2e('0x3e')],'type':_0x35b009[_0x0a2e('0x3f')]['key']};});_0x33118e[_0x0a2e('0x40')]=_[_0x0a2e('0x3c')](_0x32454,_0x0a2e('0x39'));_0x33118e[_0x0a2e('0x41')]=_[_0x0a2e('0x42')](_0x5344b9['query']);_0x33118e[_0x0a2e('0x43')]=_['intersection'](_0x33118e[_0x0a2e('0x40')],_0x33118e[_0x0a2e('0x41')]);_0x2c73a2[_0x0a2e('0x44')]=_[_0x0a2e('0x45')](_0x33118e[_0x0a2e('0x40')],qs[_0x0a2e('0x46')](_0x5344b9[_0x0a2e('0x41')][_0x0a2e('0x46')]));_0x2c73a2[_0x0a2e('0x44')]=_0x2c73a2[_0x0a2e('0x44')][_0x0a2e('0x47')]?_0x2c73a2[_0x0a2e('0x44')]:_0x33118e['model'];if(!_0x5344b9[_0x0a2e('0x41')]['hasOwnProperty'](_0x0a2e('0x48'))){_0x2c73a2[_0x0a2e('0x2f')]=qs[_0x0a2e('0x2f')](_0x5344b9['query'][_0x0a2e('0x2f')]);_0x2c73a2[_0x0a2e('0x2e')]=qs['offset'](_0x5344b9[_0x0a2e('0x41')][_0x0a2e('0x2e')]);}_0x2c73a2[_0x0a2e('0x49')]=qs[_0x0a2e('0x4a')](_0x5344b9['query']['sort']);_0x2c73a2[_0x0a2e('0x4b')]=qs[_0x0a2e('0x43')](_[_0x0a2e('0x4c')](_0x5344b9[_0x0a2e('0x41')],_0x33118e[_0x0a2e('0x43')]),_0x32454);if(_0x5344b9['query'][_0x0a2e('0x4d')]){_0x2c73a2[_0x0a2e('0x4b')]=_['merge'](_0x2c73a2[_0x0a2e('0x4b')],{'$or':_[_0x0a2e('0x3c')](_0x32454,function(_0x220680){if(_0x220680[_0x0a2e('0x3f')]!=='VIRTUAL'){var _0x2ff098={};_0x2ff098[_0x220680[_0x0a2e('0x39')]]={'$like':'%'+_0x5344b9['query'][_0x0a2e('0x4d')]+'%'};return _0x2ff098;}})});}_0x2c73a2=_[_0x0a2e('0x4e')]({},_0x2c73a2,_0x5344b9[_0x0a2e('0x4f')]);var _0x5843f3={'where':_0x2c73a2['where']};return db[_0x0a2e('0x50')][_0x0a2e('0x31')](_0x5843f3)['then'](function(_0x45e8c7){_0x53953f[_0x0a2e('0x31')]=_0x45e8c7;if(_0x5344b9[_0x0a2e('0x41')][_0x0a2e('0x51')]){_0x2c73a2[_0x0a2e('0x52')]=[{'all':!![]}];}return db[_0x0a2e('0x50')][_0x0a2e('0x53')](_0x2c73a2);})[_0x0a2e('0x21')](function(_0x3841e5){_0x53953f[_0x0a2e('0x54')]=_0x3841e5;return _0x53953f;})[_0x0a2e('0x21')](respondWithFilteredResult(_0x2d121f,_0x2c73a2))[_0x0a2e('0x2a')](handleError(_0x2d121f,null));};exports[_0x0a2e('0x55')]=function(_0x257203,_0x466834){var _0x1a246c={'raw':!![],'where':{'id':_0x257203[_0x0a2e('0x56')]['id']}},_0x4117bb={};_0x4117bb[_0x0a2e('0x40')]=_['keys'](db[_0x0a2e('0x50')]['rawAttributes']);_0x4117bb[_0x0a2e('0x41')]=_[_0x0a2e('0x42')](_0x257203[_0x0a2e('0x41')]);_0x4117bb[_0x0a2e('0x43')]=_['intersection'](_0x4117bb[_0x0a2e('0x40')],_0x4117bb[_0x0a2e('0x41')]);_0x1a246c[_0x0a2e('0x44')]=_[_0x0a2e('0x45')](_0x4117bb[_0x0a2e('0x40')],qs[_0x0a2e('0x46')](_0x257203[_0x0a2e('0x41')]['fields']));_0x1a246c[_0x0a2e('0x44')]=_0x1a246c[_0x0a2e('0x44')][_0x0a2e('0x47')]?_0x1a246c[_0x0a2e('0x44')]:_0x4117bb[_0x0a2e('0x40')];if(_0x257203[_0x0a2e('0x41')][_0x0a2e('0x51')]){_0x1a246c[_0x0a2e('0x52')]=[{'all':!![]}];}_0x1a246c=_[_0x0a2e('0x4e')]({},_0x1a246c,_0x257203['options']);return db[_0x0a2e('0x50')][_0x0a2e('0x57')](_0x1a246c)[_0x0a2e('0x21')](handleEntityNotFound(_0x466834,null))[_0x0a2e('0x21')](respondWithResult(_0x466834,null))[_0x0a2e('0x2a')](handleError(_0x466834,null));};exports[_0x0a2e('0x58')]=function(_0x4b9d48,_0x17e734){return db[_0x0a2e('0x50')][_0x0a2e('0x58')](_0x4b9d48[_0x0a2e('0x59')],{})[_0x0a2e('0x21')](respondWithResult(_0x17e734,0xc9))[_0x0a2e('0x2a')](handleError(_0x17e734,null));};exports[_0x0a2e('0x36')]=function(_0x4ffda3,_0x1b2296){if(_0x4ffda3['body']['id']){delete _0x4ffda3['body']['id'];}return db[_0x0a2e('0x50')][_0x0a2e('0x57')]({'where':{'id':_0x4ffda3[_0x0a2e('0x56')]['id']}})[_0x0a2e('0x21')](handleEntityNotFound(_0x1b2296,null))[_0x0a2e('0x21')](saveUpdates(_0x4ffda3[_0x0a2e('0x59')],null))[_0x0a2e('0x21')](respondWithResult(_0x1b2296,null))[_0x0a2e('0x2a')](handleError(_0x1b2296,null));};exports['destroy']=function(_0x7f04b8,_0x31b5f5){return db[_0x0a2e('0x50')][_0x0a2e('0x57')]({'where':{'id':_0x7f04b8[_0x0a2e('0x56')]['id']}})['then'](handleEntityNotFound(_0x31b5f5,null))[_0x0a2e('0x21')](removeEntity(_0x31b5f5,null))[_0x0a2e('0x2a')](handleError(_0x31b5f5,null));};exports[_0x0a2e('0x5a')]=function(_0x1f646d,_0x80bab1){return db[_0x0a2e('0x50')][_0x0a2e('0x5a')]()[_0x0a2e('0x21')](respondWithResult(_0x80bab1,null))[_0x0a2e('0x2a')](handleError(_0x80bab1,null));};var interaction_log=require(_0x0a2e('0x15'))(_0x0a2e('0x5b'));exports[_0x0a2e('0x5c')]=function(_0x29bd76,_0x49a7bc,_0x48ba7b){var _0xb74473={'agent':{},'channel':_0x0a2e('0x5d')};if(_0x29bd76[_0x0a2e('0x59')]['id']){delete _0x29bd76[_0x0a2e('0x59')]['id'];}_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x5e')]=!![];_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x5f')]=moment()[_0x0a2e('0x60')](_0x0a2e('0x61'));_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')]=_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')]||_0x29bd76['user']['id'];_0xb74473['agent']['id']=_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')];return db[_0x0a2e('0x50')][_0x0a2e('0x57')]({'where':{'id':_0x29bd76[_0x0a2e('0x56')]['id'],'UserId':null}})[_0x0a2e('0x21')](handleEntityNotFound(_0x49a7bc,null))[_0x0a2e('0x21')](saveUpdates(_0x29bd76[_0x0a2e('0x59')],null))[_0x0a2e('0x21')](function(_0x69bd4d){if(_0x69bd4d){_0xb74473['message']=_0x69bd4d[_0x0a2e('0x63')]({'plain':!![]});return db[_0x0a2e('0x64')][_0x0a2e('0x57')]({'where':{'id':_0x69bd4d[_0x0a2e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x49a7bc,null))['then'](function(_0x34247d){if(_0x34247d){return _0x34247d[_0x0a2e('0x36')]({'UserId':_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')],'read1stAt':_[_0x0a2e('0x66')](_0x34247d['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a2e('0x21')](function(_0x1832c7){if(_0x1832c7){_0xb74473[_0x0a2e('0x67')]=_0x1832c7[_0x0a2e('0x63')]({'plain':!![]});interaction_log[_0x0a2e('0x68')](_0x0a2e('0x69'),_0x29bd76['user']['id'],_0x29bd76[_0x0a2e('0x6a')][_0x0a2e('0x39')],_0x29bd76[_0x0a2e('0x6a')][_0x0a2e('0x6b')],_0xb74473['interaction']['id'],_0x29bd76[_0x0a2e('0x59')]?JSON[_0x0a2e('0x26')](_0x29bd76['body']):_0x0a2e('0x6c'));return respondWithRpcPromise(_0x0a2e('0x6d'),_0x0a2e('0x6e'),_0xb74473);}return null;})['then'](function(_0x23dbd1){var _0xe2d878=_0x0a2e('0x6f')+_0x23dbd1[_0x0a2e('0x28')][_0x0a2e('0x70')];return db[_0x0a2e('0x71')]['query'](_0xe2d878,{'type':db[_0x0a2e('0x72')]['QueryTypes'][_0x0a2e('0x73')],'raw':!![]})[_0x0a2e('0x21')](function(_0x149b53){return _0x149b53;});})[_0x0a2e('0x21')](function(_0x2e52d6){if(_0x2e52d6){_0xb74473[_0x0a2e('0x28')]['contact']=_0x2e52d6[0x0];if(!_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')])return;return db[_0x0a2e('0x74')][_0x0a2e('0x57')]({'where':{'id':_0x29bd76['body'][_0x0a2e('0x62')],'role':_0x0a2e('0x75')},'attributes':['id','name',_0x0a2e('0x76'),_0x0a2e('0x77'),_0x0a2e('0x78')],'raw':!![]});}return null;})['then'](function(_0x6fbd63){if(!_0x6fbd63)return null;_0xb74473[_0x0a2e('0x28')][_0x0a2e('0x75')]=_0x6fbd63;return _0xb74473;})[_0x0a2e('0x21')](function(_0x4eb8ad){if(_0x4eb8ad){if(_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x79')]){_0xb74473['message'][_0x0a2e('0x7a')]=util[_0x0a2e('0x60')]('SIP/%s',_0x29bd76['user']['name']);_0xb74473[_0x0a2e('0x28')]['channel']=_0xb74473['channel'];_0xb74473['message'][_0x0a2e('0x7b')]=_0xb74473['channel'];_0xb74473['message'][_0x0a2e('0x7c')]='accept';return respondWithRpcPromise(_0x0a2e('0x7d'),'EventManager',{'event':_0x0a2e('0x7e'),'message':_[_0x0a2e('0x4e')](_0xb74473[_0x0a2e('0x28')],JSON[_0x0a2e('0x7f')](_0xb74473['interaction'][_0x0a2e('0x80')]))},client9002)[_0x0a2e('0x21')](function(){return _0xb74473;});}return _0xb74473;}return null;})[_0x0a2e('0x21')](respondWithResult(_0x49a7bc,null))[_0x0a2e('0x2a')](handleError(_0x49a7bc,null));};var interaction_log=require(_0x0a2e('0x15'))(_0x0a2e('0x5b'));exports[_0x0a2e('0x34')]=function(_0x192580,_0x2ecb01,_0x10c6c9){var _0x44d5d2={'agent':{},'channel':'chat'};if(_0x192580[_0x0a2e('0x59')]['id']){delete _0x192580[_0x0a2e('0x59')]['id'];}_0x192580['body'][_0x0a2e('0x62')]=_0x192580[_0x0a2e('0x59')]['UserId']||_0x192580['user']['id'];_0x44d5d2['agent']['id']=_0x192580[_0x0a2e('0x59')][_0x0a2e('0x62')];return db[_0x0a2e('0x50')][_0x0a2e('0x57')]({'where':{'id':_0x192580[_0x0a2e('0x56')]['id'],'UserId':null}})[_0x0a2e('0x21')](handleEntityNotFound(_0x2ecb01,null))[_0x0a2e('0x21')](function(_0x57178c){if(_0x57178c){_0x44d5d2[_0x0a2e('0x28')]=_0x57178c[_0x0a2e('0x63')]({'plain':!![]});return db[_0x0a2e('0x64')]['find']({'where':{'id':_0x57178c[_0x0a2e('0x65')]}});}return null;})[_0x0a2e('0x21')](handleEntityNotFound(_0x2ecb01,null))['then'](function(_0x924b08){if(_0x924b08){_0x44d5d2[_0x0a2e('0x67')]=_0x924b08[_0x0a2e('0x63')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x192580['user']['id'],_0x192580[_0x0a2e('0x6a')][_0x0a2e('0x39')],_0x192580[_0x0a2e('0x6a')][_0x0a2e('0x6b')],_0x44d5d2[_0x0a2e('0x67')]['id'],_0x192580[_0x0a2e('0x59')]?JSON[_0x0a2e('0x26')](_0x192580[_0x0a2e('0x59')]):_0x0a2e('0x6c'));return respondWithRpcPromise(_0x0a2e('0x81'),'rejectMessage',_0x44d5d2);}return null;})[_0x0a2e('0x21')](function(_0x55a978){var _0x443b2e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x55a978[_0x0a2e('0x28')][_0x0a2e('0x70')];return db['sequelize'][_0x0a2e('0x41')](_0x443b2e,{'type':db['Sequelize']['QueryTypes'][_0x0a2e('0x73')],'raw':!![]})['then'](function(_0x335169){return _0x335169;});})[_0x0a2e('0x21')](function(_0x59d0b9){if(_0x59d0b9){_0x44d5d2[_0x0a2e('0x28')][_0x0a2e('0x82')]=_0x59d0b9[0x0];if(!_0x192580['body']['UserId'])return;return db[_0x0a2e('0x74')]['find']({'where':{'id':_0x192580[_0x0a2e('0x59')][_0x0a2e('0x62')],'role':_0x0a2e('0x75')},'attributes':['id','name',_0x0a2e('0x76'),'email',_0x0a2e('0x78')],'raw':!![]});}return null;})['then'](function(_0x5ce9bd){if(!_0x5ce9bd)return null;_0x44d5d2[_0x0a2e('0x28')]['agent']=_0x5ce9bd;return _0x44d5d2;})[_0x0a2e('0x21')](function(_0x26ed7d){if(_0x26ed7d){_0x26ed7d['message'][_0x0a2e('0x7a')]=util[_0x0a2e('0x60')](_0x0a2e('0x83'),_0x192580[_0x0a2e('0x6a')]['name']);_0x26ed7d[_0x0a2e('0x28')][_0x0a2e('0x84')]=_0x44d5d2['channel'];_0x26ed7d['message'][_0x0a2e('0x7b')]=_0x44d5d2[_0x0a2e('0x84')];_0x26ed7d[_0x0a2e('0x28')]['event']=_0x0a2e('0x34');respondWithRpcPromise(_0x0a2e('0x7d'),_0x0a2e('0x7d'),{'event':_0x0a2e('0x85'),'message':_[_0x0a2e('0x4e')](_0x44d5d2['message'],JSON[_0x0a2e('0x7f')](_0x44d5d2['interaction'][_0x0a2e('0x80')]))},client9002);return _0x44d5d2;}return null;})[_0x0a2e('0x21')](respondWithResult(_0x2ecb01,null))['catch'](handleError(_0x2ecb01,null));};
\ No newline at end of file
+var _0x216b=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','ChatMessage','findAll','rows','show','params','keys','length','includeAll','options','find','create','body','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','motionChannel','channel','event','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','email','SIP/%s','reject','EventManager','rejectmessage','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','end','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes'];(function(_0x568eef,_0x3494a2){var _0x549955=function(_0x8caa2f){while(--_0x8caa2f){_0x568eef['push'](_0x568eef['shift']());}};_0x549955(++_0x3494a2);}(_0x216b,0x1c8));var _0xb216=function(_0x113302,_0x50f3dd){_0x113302=_0x113302-0x0;var _0xa6343=_0x216b[_0x113302];return _0xa6343;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb216('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb216('0x1'));var rp=require('request-promise');var moment=require(_0xb216('0x2'));var BPromise=require(_0xb216('0x3'));var Mustache=require(_0xb216('0x4'));var util=require(_0xb216('0x5'));var path=require(_0xb216('0x6'));var sox=require(_0xb216('0x7'));var csv=require(_0xb216('0x8'));var ejs=require(_0xb216('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb216('0xa'));var squel=require(_0xb216('0xb'));var crypto=require(_0xb216('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb216('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb216('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb216('0xe'));var hardwareService=require(_0xb216('0xf'));var logger=require(_0xb216('0x10'))(_0xb216('0x11'));var utils=require('../../config/utils');var config=require(_0xb216('0x12'));var licenseUtil=require(_0xb216('0x13'));var db=require(_0xb216('0x14'))['db'];config[_0xb216('0x15')]=_[_0xb216('0x16')](config[_0xb216('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb216('0x15')]));require(_0xb216('0x17'))[_0xb216('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb216('0x19')][_0xb216('0x1a')]({'port':0x232c});var client9002=jayson[_0xb216('0x19')][_0xb216('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x8ea087,_0x51851b,_0x2fcdd6,_0xdd773b){return new BPromise(function(_0x106ccd,_0x3a6618){var _0x2fa920=_0xdd773b||client;return _0x2fa920[_0xb216('0x1b')](_0x8ea087,_0x2fcdd6)[_0xb216('0x1c')](function(_0x1198c3){logger[_0xb216('0x1d')](_0xb216('0x1e'),_0x51851b,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x51851b,'request\x20sent',JSON[_0xb216('0x1f')](_0x1198c3));if(_0x1198c3[_0xb216('0x20')]){if(_0x1198c3[_0xb216('0x20')][_0xb216('0x21')]===0x1f4){logger[_0xb216('0x20')](_0xb216('0x1e'),_0x51851b,_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);return _0x3a6618(_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);}logger[_0xb216('0x20')]('ChatMessage,\x20%s,\x20%s',_0x51851b,_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);return _0x106ccd(_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);}else{logger[_0xb216('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x51851b,_0xb216('0x23'));_0x106ccd(_0x1198c3[_0xb216('0x24')]['message']);}})[_0xb216('0x25')](function(_0x39c3a8){logger[_0xb216('0x20')](_0xb216('0x1e'),_0x51851b,_0x39c3a8);_0x3a6618(_0x39c3a8);});});}function respondWithStatusCode(_0x13d424,_0x2fa266){_0x2fa266=_0x2fa266||0xcc;return function(_0x459735){if(_0x459735){return _0x13d424[_0xb216('0x26')](_0x2fa266);}return _0x13d424[_0xb216('0x27')](_0x2fa266)['end']();};}function respondWithResult(_0x314988,_0x3da310){_0x3da310=_0x3da310||0xc8;return function(_0x1115a7){if(_0x1115a7){return _0x314988[_0xb216('0x27')](_0x3da310)[_0xb216('0x28')](_0x1115a7);}};}function respondWithFilteredResult(_0x4dfee0,_0x3ffa35){return function(_0x37b0ad){if(_0x37b0ad){var _0x45b89b=typeof _0x3ffa35[_0xb216('0x29')]===_0xb216('0x2a')&&typeof _0x3ffa35['limit']==='undefined';var _0x3385ad=_0x37b0ad[_0xb216('0x2b')];var _0xf31139=_0x45b89b?0x0:_0x3ffa35['offset'];var _0x5cfc62=_0x45b89b?_0x37b0ad[_0xb216('0x2b')]:_0x3ffa35['offset']+_0x3ffa35[_0xb216('0x2c')];var _0x1be53d;if(_0x5cfc62>=_0x3385ad){_0x5cfc62=_0x3385ad;_0x1be53d=0xc8;}else{_0x1be53d=0xce;}_0x4dfee0[_0xb216('0x27')](_0x1be53d);return _0x4dfee0[_0xb216('0x2d')](_0xb216('0x2e'),_0xf31139+'-'+_0x5cfc62+'/'+_0x3385ad)['json'](_0x37b0ad);}return null;};}function patchUpdates(_0x50222a){return function(_0x3e75bb){try{jsonpatch[_0xb216('0x2f')](_0x3e75bb,_0x50222a,!![]);}catch(_0x3d726b){return BPromise['reject'](_0x3d726b);}return _0x3e75bb[_0xb216('0x30')]();};}function saveUpdates(_0x8fdac8,_0x52d851){return function(_0x5a0d49){if(_0x5a0d49){return _0x5a0d49[_0xb216('0x31')](_0x8fdac8)[_0xb216('0x1c')](function(_0x56234d){return _0x56234d;});}return null;};}function removeEntity(_0x98820f,_0x3249d7){return function(_0x39f2fe){if(_0x39f2fe){return _0x39f2fe['destroy']()['then'](function(){_0x98820f['status'](0xcc)[_0xb216('0x32')]();});}};}function handleEntityNotFound(_0x3831aa,_0x5776a3){return function(_0xbf4cf8){if(!_0xbf4cf8){_0x3831aa['sendStatus'](0x194);}return _0xbf4cf8;};}function handleError(_0xe1605a,_0x3e5742){_0x3e5742=_0x3e5742||0x1f4;return function(_0x534720){logger[_0xb216('0x20')](_0x534720[_0xb216('0x33')]);if(_0x534720[_0xb216('0x34')]){delete _0x534720[_0xb216('0x34')];}_0xe1605a[_0xb216('0x27')](_0x3e5742)[_0xb216('0x35')](_0x534720);};}exports[_0xb216('0x36')]=function(_0x30fe71,_0x52c5cf){var _0x234de0={},_0x552590={},_0x3da660={'count':0x0,'rows':[]};var _0x3a9851=_[_0xb216('0x37')](db['ChatMessage'][_0xb216('0x38')],function(_0xc79639){return{'name':_0xc79639[_0xb216('0x39')],'type':_0xc79639['type'][_0xb216('0x3a')]};});_0x552590['model']=_[_0xb216('0x37')](_0x3a9851,'name');_0x552590[_0xb216('0x3b')]=_['keys'](_0x30fe71[_0xb216('0x3b')]);_0x552590[_0xb216('0x3c')]=_[_0xb216('0x3d')](_0x552590[_0xb216('0x3e')],_0x552590[_0xb216('0x3b')]);_0x234de0[_0xb216('0x3f')]=_['intersection'](_0x552590['model'],qs[_0xb216('0x40')](_0x30fe71['query'][_0xb216('0x40')]));_0x234de0[_0xb216('0x3f')]=_0x234de0[_0xb216('0x3f')]['length']?_0x234de0[_0xb216('0x3f')]:_0x552590[_0xb216('0x3e')];if(!_0x30fe71['query'][_0xb216('0x41')](_0xb216('0x42'))){_0x234de0['limit']=qs[_0xb216('0x2c')](_0x30fe71[_0xb216('0x3b')][_0xb216('0x2c')]);_0x234de0[_0xb216('0x29')]=qs[_0xb216('0x29')](_0x30fe71['query'][_0xb216('0x29')]);}_0x234de0[_0xb216('0x43')]=qs[_0xb216('0x44')](_0x30fe71[_0xb216('0x3b')]['sort']);_0x234de0[_0xb216('0x45')]=qs[_0xb216('0x3c')](_[_0xb216('0x46')](_0x30fe71[_0xb216('0x3b')],_0x552590[_0xb216('0x3c')]),_0x3a9851);if(_0x30fe71[_0xb216('0x3b')][_0xb216('0x47')]){_0x234de0['where']=_[_0xb216('0x48')](_0x234de0['where'],{'$or':_[_0xb216('0x37')](_0x3a9851,function(_0x199963){if(_0x199963[_0xb216('0x49')]!==_0xb216('0x4a')){var _0x1adf5a={};_0x1adf5a[_0x199963[_0xb216('0x34')]]={'$like':'%'+_0x30fe71[_0xb216('0x3b')][_0xb216('0x47')]+'%'};return _0x1adf5a;}})});}_0x234de0=_['merge']({},_0x234de0,_0x30fe71['options']);var _0x2be3ac={'where':_0x234de0['where']};return db['ChatMessage'][_0xb216('0x2b')](_0x2be3ac)[_0xb216('0x1c')](function(_0x1de60b){_0x3da660[_0xb216('0x2b')]=_0x1de60b;if(_0x30fe71['query']['includeAll']){_0x234de0[_0xb216('0x4b')]=[{'all':!![]}];}return db[_0xb216('0x4c')][_0xb216('0x4d')](_0x234de0);})[_0xb216('0x1c')](function(_0x2700f4){_0x3da660[_0xb216('0x4e')]=_0x2700f4;return _0x3da660;})[_0xb216('0x1c')](respondWithFilteredResult(_0x52c5cf,_0x234de0))['catch'](handleError(_0x52c5cf,null));};exports[_0xb216('0x4f')]=function(_0x47b6bc,_0x2209e3){var _0x1a01cc={'raw':!![],'where':{'id':_0x47b6bc[_0xb216('0x50')]['id']}},_0x5e8393={};_0x5e8393[_0xb216('0x3e')]=_['keys'](db[_0xb216('0x4c')][_0xb216('0x38')]);_0x5e8393['query']=_[_0xb216('0x51')](_0x47b6bc[_0xb216('0x3b')]);_0x5e8393[_0xb216('0x3c')]=_[_0xb216('0x3d')](_0x5e8393[_0xb216('0x3e')],_0x5e8393[_0xb216('0x3b')]);_0x1a01cc[_0xb216('0x3f')]=_[_0xb216('0x3d')](_0x5e8393[_0xb216('0x3e')],qs['fields'](_0x47b6bc['query'][_0xb216('0x40')]));_0x1a01cc['attributes']=_0x1a01cc[_0xb216('0x3f')][_0xb216('0x52')]?_0x1a01cc[_0xb216('0x3f')]:_0x5e8393[_0xb216('0x3e')];if(_0x47b6bc[_0xb216('0x3b')][_0xb216('0x53')]){_0x1a01cc[_0xb216('0x4b')]=[{'all':!![]}];}_0x1a01cc=_[_0xb216('0x48')]({},_0x1a01cc,_0x47b6bc[_0xb216('0x54')]);return db[_0xb216('0x4c')][_0xb216('0x55')](_0x1a01cc)[_0xb216('0x1c')](handleEntityNotFound(_0x2209e3,null))[_0xb216('0x1c')](respondWithResult(_0x2209e3,null))[_0xb216('0x25')](handleError(_0x2209e3,null));};exports[_0xb216('0x56')]=function(_0x2d2f37,_0x521323){return db['ChatMessage'][_0xb216('0x56')](_0x2d2f37[_0xb216('0x57')],{})[_0xb216('0x1c')](respondWithResult(_0x521323,0xc9))[_0xb216('0x25')](handleError(_0x521323,null));};exports[_0xb216('0x31')]=function(_0xb3bdcf,_0x282012){if(_0xb3bdcf[_0xb216('0x57')]['id']){delete _0xb3bdcf[_0xb216('0x57')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0xb3bdcf[_0xb216('0x50')]['id']}})['then'](handleEntityNotFound(_0x282012,null))['then'](saveUpdates(_0xb3bdcf[_0xb216('0x57')],null))['then'](respondWithResult(_0x282012,null))[_0xb216('0x25')](handleError(_0x282012,null));};exports['destroy']=function(_0x46cd5a,_0x34fcde){return db[_0xb216('0x4c')][_0xb216('0x55')]({'where':{'id':_0x46cd5a[_0xb216('0x50')]['id']}})[_0xb216('0x1c')](handleEntityNotFound(_0x34fcde,null))[_0xb216('0x1c')](removeEntity(_0x34fcde,null))['catch'](handleError(_0x34fcde,null));};exports[_0xb216('0x58')]=function(_0x24ccc0,_0x2023cd){return db['ChatMessage'][_0xb216('0x58')]()[_0xb216('0x1c')](respondWithResult(_0x2023cd,null))['catch'](handleError(_0x2023cd,null));};var interaction_log=require(_0xb216('0x10'))('chat-interactions');exports[_0xb216('0x59')]=function(_0x41067f,_0x5a78e0,_0x3466c9){var _0x58da9f={'agent':{},'channel':_0xb216('0x5a')};if(_0x41067f[_0xb216('0x57')]['id']){delete _0x41067f[_0xb216('0x57')]['id'];}_0x41067f['body'][_0xb216('0x5b')]=!![];_0x41067f[_0xb216('0x57')][_0xb216('0x5c')]=moment()[_0xb216('0x5d')](_0xb216('0x5e'));_0x41067f[_0xb216('0x57')][_0xb216('0x5f')]=_0x41067f['body'][_0xb216('0x5f')]||_0x41067f[_0xb216('0x60')]['id'];_0x58da9f[_0xb216('0x61')]['id']=_0x41067f[_0xb216('0x57')][_0xb216('0x5f')];return db[_0xb216('0x4c')]['find']({'where':{'id':_0x41067f[_0xb216('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5a78e0,null))[_0xb216('0x1c')](saveUpdates(_0x41067f['body'],null))[_0xb216('0x1c')](function(_0x268fa5){if(_0x268fa5){_0x58da9f[_0xb216('0x22')]=_0x268fa5[_0xb216('0x62')]({'plain':!![]});return db[_0xb216('0x63')][_0xb216('0x55')]({'where':{'id':_0x268fa5[_0xb216('0x64')]}});}return null;})[_0xb216('0x1c')](handleEntityNotFound(_0x5a78e0,null))[_0xb216('0x1c')](function(_0xc71487){if(_0xc71487){return _0xc71487[_0xb216('0x31')]({'UserId':_0x41067f[_0xb216('0x57')]['UserId'],'read1stAt':_[_0xb216('0x65')](_0xc71487['read1stAt'])?moment()[_0xb216('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb216('0x1c')](function(_0x34f02a){if(_0x34f02a){_0x58da9f[_0xb216('0x66')]=_0x34f02a[_0xb216('0x62')]({'plain':!![]});interaction_log[_0xb216('0x1d')](_0xb216('0x67'),_0x41067f[_0xb216('0x60')]['id'],_0x41067f[_0xb216('0x60')][_0xb216('0x34')],_0x41067f[_0xb216('0x60')]['role'],_0x58da9f[_0xb216('0x66')]['id'],_0x41067f['body']?JSON[_0xb216('0x1f')](_0x41067f['body']):_0xb216('0x68'));return respondWithRpcPromise('AcceptMessage',_0xb216('0x69'),_0x58da9f);}return null;})[_0xb216('0x1c')](function(_0xd994c4){var _0x49101a=_0xb216('0x6a')+_0xd994c4[_0xb216('0x22')][_0xb216('0x6b')];return db['sequelize'][_0xb216('0x3b')](_0x49101a,{'type':db[_0xb216('0x6c')][_0xb216('0x6d')][_0xb216('0x6e')],'raw':!![]})[_0xb216('0x1c')](function(_0x47c562){return _0x47c562;});})[_0xb216('0x1c')](function(_0x37aab4){if(_0x37aab4){_0x58da9f[_0xb216('0x22')][_0xb216('0x6f')]=_0x37aab4[0x0];if(!_0x41067f[_0xb216('0x57')][_0xb216('0x5f')])return;return db['User'][_0xb216('0x55')]({'where':{'id':_0x41067f['body']['UserId'],'role':_0xb216('0x61')},'attributes':['id',_0xb216('0x34'),_0xb216('0x70'),'email',_0xb216('0x71')],'raw':!![]});}return null;})['then'](function(_0x50e470){if(!_0x50e470)return null;_0x58da9f['message'][_0xb216('0x61')]=_0x50e470;return _0x58da9f;})['then'](function(_0x3197f9){if(_0x3197f9){if(_0x41067f[_0xb216('0x57')]['manual']){_0x58da9f[_0xb216('0x22')]['interface']=util['format']('SIP/%s',_0x41067f['user'][_0xb216('0x34')]);_0x58da9f[_0xb216('0x22')]['channel']=_0x58da9f['channel'];_0x58da9f[_0xb216('0x22')][_0xb216('0x72')]=_0x58da9f[_0xb216('0x73')];_0x58da9f[_0xb216('0x22')][_0xb216('0x74')]=_0xb216('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb216('0x75'),'message':_[_0xb216('0x48')](_0x58da9f[_0xb216('0x22')],JSON[_0xb216('0x76')](_0x58da9f['interaction'][_0xb216('0x77')]))},client9002)[_0xb216('0x1c')](function(){return _0x58da9f;});}return _0x58da9f;}return null;})['then'](respondWithResult(_0x5a78e0,null))['catch'](handleError(_0x5a78e0,null));};var interaction_log=require(_0xb216('0x10'))('chat-interactions');exports['reject']=function(_0x4992a7,_0x17f280,_0x363563){var _0x17fb1f={'agent':{},'channel':_0xb216('0x5a')};if(_0x4992a7[_0xb216('0x57')]['id']){delete _0x4992a7['body']['id'];}_0x4992a7['body']['UserId']=_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')]||_0x4992a7[_0xb216('0x60')]['id'];_0x17fb1f[_0xb216('0x61')]['id']=_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')];return db[_0xb216('0x4c')]['find']({'where':{'id':_0x4992a7['params']['id'],'UserId':null}})[_0xb216('0x1c')](handleEntityNotFound(_0x17f280,null))[_0xb216('0x1c')](function(_0x487cad){if(_0x487cad){_0x17fb1f[_0xb216('0x22')]=_0x487cad[_0xb216('0x62')]({'plain':!![]});return db[_0xb216('0x63')][_0xb216('0x55')]({'where':{'id':_0x487cad[_0xb216('0x64')]}});}return null;})[_0xb216('0x1c')](handleEntityNotFound(_0x17f280,null))[_0xb216('0x1c')](function(_0x3c510e){if(_0x3c510e){_0x17fb1f[_0xb216('0x66')]=_0x3c510e[_0xb216('0x62')]({'plain':!![]});interaction_log[_0xb216('0x1d')](_0xb216('0x78'),_0x4992a7[_0xb216('0x60')]['id'],_0x4992a7[_0xb216('0x60')][_0xb216('0x34')],_0x4992a7[_0xb216('0x60')][_0xb216('0x79')],_0x17fb1f['interaction']['id'],_0x4992a7[_0xb216('0x57')]?JSON[_0xb216('0x1f')](_0x4992a7[_0xb216('0x57')]):_0xb216('0x68'));return respondWithRpcPromise(_0xb216('0x7a'),_0xb216('0x7b'),_0x17fb1f);}return null;})[_0xb216('0x1c')](function(_0x22c127){var _0xbf927=_0xb216('0x6a')+_0x22c127[_0xb216('0x22')][_0xb216('0x6b')];return db[_0xb216('0x7c')]['query'](_0xbf927,{'type':db[_0xb216('0x6c')][_0xb216('0x6d')][_0xb216('0x6e')],'raw':!![]})['then'](function(_0x8b9a2f){return _0x8b9a2f;});})['then'](function(_0x5f5e0f){if(_0x5f5e0f){_0x17fb1f[_0xb216('0x22')][_0xb216('0x6f')]=_0x5f5e0f[0x0];if(!_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')])return;return db['User']['find']({'where':{'id':_0x4992a7['body'][_0xb216('0x5f')],'role':_0xb216('0x61')},'attributes':['id',_0xb216('0x34'),_0xb216('0x70'),_0xb216('0x7d'),'internal'],'raw':!![]});}return null;})[_0xb216('0x1c')](function(_0x277ec3){if(!_0x277ec3)return null;_0x17fb1f['message'][_0xb216('0x61')]=_0x277ec3;return _0x17fb1f;})[_0xb216('0x1c')](function(_0x50ee15){if(_0x50ee15){_0x50ee15[_0xb216('0x22')]['interface']=util[_0xb216('0x5d')](_0xb216('0x7e'),_0x4992a7[_0xb216('0x60')][_0xb216('0x34')]);_0x50ee15[_0xb216('0x22')][_0xb216('0x73')]=_0x17fb1f[_0xb216('0x73')];_0x50ee15[_0xb216('0x22')][_0xb216('0x72')]=_0x17fb1f[_0xb216('0x73')];_0x50ee15['message'][_0xb216('0x74')]=_0xb216('0x7f');respondWithRpcPromise('EventManager',_0xb216('0x80'),{'event':_0xb216('0x81'),'message':_[_0xb216('0x48')](_0x17fb1f['message'],JSON[_0xb216('0x76')](_0x17fb1f['interaction'][_0xb216('0x77')]))},client9002);return _0x17fb1f;}return null;})[_0xb216('0x1c')](respondWithResult(_0x17f280,null))['catch'](handleError(_0x17f280,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 15b4af6..187dd62 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 _0xab48=['save','remove','emit','hasOwnProperty','hook','exports','ChatMessage','setMaxListeners'];(function(_0x380667,_0x863bc8){var _0x114eed=function(_0x4127a4){while(--_0x4127a4){_0x380667['push'](_0x380667['shift']());}};_0x114eed(++_0x863bc8);}(_0xab48,0x156));var _0x8ab4=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xab48[_0x3dc538];return _0x72c2fd;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x8ab4('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8ab4('0x1')](0x0);var events={'afterCreate':_0x8ab4('0x2'),'afterUpdate':'update','afterDestroy':_0x8ab4('0x3')};function emitEvent(_0x5ad2a5){return function(_0x3e1ece,_0x5da763,_0x27355e){ChatMessageEvents['emit'](_0x5ad2a5+':'+_0x3e1ece['id'],_0x3e1ece);ChatMessageEvents[_0x8ab4('0x4')](_0x5ad2a5,_0x3e1ece);_0x27355e(null);};}for(var e in events){if(events[_0x8ab4('0x5')](e)){var event=events[e];ChatMessage[_0x8ab4('0x6')](e,emitEvent(event));}}module[_0x8ab4('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x1a83=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x511ee8,_0x1934be){var _0x4386d6=function(_0x3dfc6f){while(--_0x3dfc6f){_0x511ee8['push'](_0x511ee8['shift']());}};_0x4386d6(++_0x1934be);}(_0x1a83,0xfe));var _0x31a8=function(_0x5eb1a7,_0x4acae9){_0x5eb1a7=_0x5eb1a7-0x0;var _0x39fdf3=_0x1a83[_0x5eb1a7];return _0x39fdf3;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x31a8('0x0'))['db'][_0x31a8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x31a8('0x2')](0x0);var events={'afterCreate':_0x31a8('0x3'),'afterUpdate':_0x31a8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1bffcf){return function(_0x431887,_0xa903af,_0x449a3f){ChatMessageEvents[_0x31a8('0x5')](_0x1bffcf+':'+_0x431887['id'],_0x431887);ChatMessageEvents[_0x31a8('0x5')](_0x1bffcf,_0x431887);_0x449a3f(null);};}for(var e in events){if(events[_0x31a8('0x6')](e)){var event=events[e];ChatMessage[_0x31a8('0x7')](e,emitEvent(event));}}module[_0x31a8('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index e2f977c..5aec8ea 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 _0xb0ff=['bluebird','request-promise','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb0ff,0xb3));var _0xfb0f=function(_0x20c0d1,_0x1d76b5){_0x20c0d1=_0x20c0d1-0x0;var _0x2dc2f3=_0xb0ff[_0x20c0d1];return _0x2dc2f3;};'use strict';var _=require('lodash');var util=require(_0xfb0f('0x0'));var logger=require(_0xfb0f('0x1'))('api');var moment=require(_0xfb0f('0x2'));var BPromise=require(_0xfb0f('0x3'));var rp=require(_0xfb0f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb0f('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb0f('0x6'));module[_0xfb0f('0x7')]=function(_0x334b59,_0x2583f8){return _0x334b59[_0xfb0f('0x8')](_0xfb0f('0x9'),attributes,{'tableName':_0xfb0f('0xa'),'paranoid':![],'indexes':[{'name':_0xfb0f('0xb'),'fields':['body'],'type':_0xfb0f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a9323,_0x979445,_0xd17401){var _0x28907c=_0x334b59['models'];var _0xfe7436=_0x1a9323[_0xfb0f('0xd')]({'plain':!![]});if(_0xfe7436[_0xfb0f('0xe')]['toLowerCase']()==='in'||_0xfe7436[_0xfb0f('0xe')][_0xfb0f('0xf')]()===_0xfb0f('0x10')&&!_0xfe7436['secret']&&!_[_0xfb0f('0x11')](_0xfe7436[_0xfb0f('0x12')])){_0x28907c[_0xfb0f('0x13')]['findOne']({'where':{'id':_0xfe7436['ChatInteractionId']}})[_0xfb0f('0x14')](function(_0x45ea50){if(_0x45ea50){_0x45ea50[_0xfb0f('0x15')]({'lastMsgAt':_0xfe7436[_0xfb0f('0x16')],'lastMsgDirection':_0xfe7436[_0xfb0f('0xe')]['toLowerCase']()});}})['catch'](function(_0x34bf7b){console[_0xfb0f('0x17')](_0x34bf7b);});}_0xd17401();}},'charset':_0xfb0f('0x18'),'collate':_0xfb0f('0x19')});};
\ No newline at end of file
+var _0x3d7e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','../../config/logger'];(function(_0x2ecd91,_0x1f21e8){var _0x3bf737=function(_0x1563d7){while(--_0x1563d7){_0x2ecd91['push'](_0x2ecd91['shift']());}};_0x3bf737(++_0x1f21e8);}(_0x3d7e,0x1ae));var _0xe3d7=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x3d7e[_0x19a49f];return _0x5351ae;};'use strict';var _=require(_0xe3d7('0x0'));var util=require('util');var logger=require(_0xe3d7('0x1'))('api');var moment=require(_0xe3d7('0x2'));var BPromise=require(_0xe3d7('0x3'));var rp=require(_0xe3d7('0x4'));var fs=require('fs');var path=require(_0xe3d7('0x5'));var rimraf=require(_0xe3d7('0x6'));var config=require(_0xe3d7('0x7'));var attributes=require('./chatMessage.attributes');module[_0xe3d7('0x8')]=function(_0x35e1fc,_0x4498e3){return _0x35e1fc['define'](_0xe3d7('0x9'),attributes,{'tableName':_0xe3d7('0xa'),'paranoid':![],'indexes':[{'name':_0xe3d7('0xb'),'fields':['body'],'type':_0xe3d7('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d6604,_0x173287,_0x428316){var _0x37b6f9=_0x35e1fc[_0xe3d7('0xd')];var _0x5d7586=_0x2d6604[_0xe3d7('0xe')]({'plain':!![]});if(_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()==='in'||_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()==='out'&&!_0x5d7586[_0xe3d7('0x11')]&&!_['isNil'](_0x5d7586[_0xe3d7('0x12')])){_0x37b6f9[_0xe3d7('0x13')]['findOne']({'where':{'id':_0x5d7586[_0xe3d7('0x14')]}})[_0xe3d7('0x15')](function(_0xb258cc){if(_0xb258cc){_0xb258cc[_0xe3d7('0x16')]({'lastMsgAt':_0x5d7586[_0xe3d7('0x17')],'lastMsgDirection':_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()});}})[_0xe3d7('0x18')](function(_0x2efb98){console[_0xe3d7('0x19')](_0x2efb98);});}_0x428316();}},'charset':_0xe3d7('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 72e1e0f..2511603 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 _0x7d53=['defaults','localhost','./chatMessage.socket','register','request','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','then','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis'];(function(_0x129b99,_0x169e1a){var _0x3aaa57=function(_0x1673a2){while(--_0x1673a2){_0x129b99['push'](_0x129b99['shift']());}};_0x3aaa57(++_0x169e1a);}(_0x7d53,0x1b9));var _0x37d5=function(_0x12f80c,_0x56b096){_0x12f80c=_0x12f80c-0x0;var _0x3cb84d=_0x7d53[_0x12f80c];return _0x3cb84d;};'use strict';var _=require(_0x37d5('0x0'));var util=require(_0x37d5('0x1'));var moment=require(_0x37d5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d5('0x3'));var db=require(_0x37d5('0x4'))['db'];var utils=require(_0x37d5('0x5'));var logger=require('../../config/logger')(_0x37d5('0x6'));var config=require('../../config/environment');var jayson=require(_0x37d5('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x37d5('0x8')]=_[_0x37d5('0x9')](config['redis'],{'host':_0x37d5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37d5('0x8')]));require(_0x37d5('0xb'))[_0x37d5('0xc')](socket);function respondWithRpcPromise(_0x24451d,_0x5c3f83,_0x3defd8){return new BPromise(function(_0x183c63,_0x331cee){return client[_0x37d5('0xd')](_0x24451d,_0x3defd8)['then'](function(_0x29ddb0){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5c3f83,_0x37d5('0xe'));logger[_0x37d5('0xf')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5c3f83,_0x37d5('0xe'),JSON[_0x37d5('0x10')](_0x29ddb0));if(_0x29ddb0[_0x37d5('0x11')]){if(_0x29ddb0['error'][_0x37d5('0x12')]===0x1f4){logger[_0x37d5('0x11')](_0x37d5('0x13'),_0x5c3f83,_0x29ddb0[_0x37d5('0x11')]['message']);return _0x331cee(_0x29ddb0['error'][_0x37d5('0x14')]);}logger[_0x37d5('0x11')]('ChatMessage,\x20%s,\x20%s',_0x5c3f83,_0x29ddb0[_0x37d5('0x11')]['message']);return _0x183c63(_0x29ddb0[_0x37d5('0x11')]['message']);}else{logger[_0x37d5('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5c3f83,_0x37d5('0xe'));_0x183c63(_0x29ddb0[_0x37d5('0x16')][_0x37d5('0x14')]);}})[_0x37d5('0x17')](function(_0x324794){logger[_0x37d5('0x11')](_0x37d5('0x13'),_0x5c3f83,_0x324794);_0x331cee(_0x324794);});});}exports[_0x37d5('0x18')]=function(_0x536aeb){var _0x3efc36=this;return new Promise(function(_0x59fa49,_0x4b0ff4){return db[_0x37d5('0x19')][_0x37d5('0x1a')](_0x536aeb[_0x37d5('0x1b')],{'raw':_0x536aeb['options']?_0x536aeb[_0x37d5('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x37d5('0x1d')](function(_0x44715e){logger[_0x37d5('0x15')](_0x37d5('0x18'),_0x536aeb);logger[_0x37d5('0xf')](_0x37d5('0x18'),_0x536aeb,JSON[_0x37d5('0x10')](_0x44715e));_0x59fa49(_0x44715e);})['catch'](function(_0x224f26){logger[_0x37d5('0x11')](_0x37d5('0x18'),_0x224f26[_0x37d5('0x14')],_0x536aeb);_0x4b0ff4(_0x3efc36[_0x37d5('0x11')](0x1f4,_0x224f26[_0x37d5('0x14')]));});});};
\ No newline at end of file
+var _0xc5dc=['message','request\x20sent','result','catch','CreateChatMessage','ChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','stringify','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5dc,0x128));var _0xcc5d=function(_0x52826e,_0x3812c4){_0x52826e=_0x52826e-0x0;var _0x3fecd9=_0xc5dc[_0x52826e];return _0x3fecd9;};'use strict';var _=require(_0xcc5d('0x0'));var util=require(_0xcc5d('0x1'));var moment=require(_0xcc5d('0x2'));var BPromise=require(_0xcc5d('0x3'));var rs=require(_0xcc5d('0x4'));var fs=require('fs');var Redis=require(_0xcc5d('0x5'));var db=require(_0xcc5d('0x6'))['db'];var utils=require(_0xcc5d('0x7'));var logger=require(_0xcc5d('0x8'))(_0xcc5d('0x9'));var config=require(_0xcc5d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcc5d('0xb')][_0xcc5d('0xc')]({'port':0x232a});config[_0xcc5d('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcc5d('0xe'))(new Redis(config[_0xcc5d('0xd')]));require(_0xcc5d('0xf'))[_0xcc5d('0x10')](socket);function respondWithRpcPromise(_0x469175,_0x11998d,_0x1030e7){return new BPromise(function(_0x5b78e0,_0x532fc1){return client['request'](_0x469175,_0x1030e7)[_0xcc5d('0x11')](function(_0x7ded01){logger[_0xcc5d('0x12')](_0xcc5d('0x13'),_0x11998d,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x11998d,'request\x20sent',JSON[_0xcc5d('0x14')](_0x7ded01));if(_0x7ded01[_0xcc5d('0x15')]){if(_0x7ded01['error'][_0xcc5d('0x16')]===0x1f4){logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x7ded01['error'][_0xcc5d('0x17')]);return _0x532fc1(_0x7ded01[_0xcc5d('0x15')]['message']);}logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x7ded01[_0xcc5d('0x15')]['message']);return _0x5b78e0(_0x7ded01['error'][_0xcc5d('0x17')]);}else{logger['info'](_0xcc5d('0x13'),_0x11998d,_0xcc5d('0x18'));_0x5b78e0(_0x7ded01[_0xcc5d('0x19')][_0xcc5d('0x17')]);}})[_0xcc5d('0x1a')](function(_0x3f4eea){logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x3f4eea);_0x532fc1(_0x3f4eea);});});}exports[_0xcc5d('0x1b')]=function(_0x306aeb){var _0x302203=this;return new Promise(function(_0x4f2d54,_0x154fea){return db[_0xcc5d('0x1c')]['create'](_0x306aeb['body'],{'raw':_0x306aeb['options']?_0x306aeb['options']['raw']===undefined?!![]:![]:!![]})[_0xcc5d('0x11')](function(_0x2b0ae3){logger['info'](_0xcc5d('0x1b'),_0x306aeb);logger['debug'](_0xcc5d('0x1b'),_0x306aeb,JSON[_0xcc5d('0x14')](_0x2b0ae3));_0x4f2d54(_0x2b0ae3);})[_0xcc5d('0x1a')](function(_0x3c107d){logger[_0xcc5d('0x15')](_0xcc5d('0x1b'),_0x3c107d[_0xcc5d('0x17')],_0x306aeb);_0x154fea(_0x302203[_0xcc5d('0x15')](0x1f4,_0x3c107d[_0xcc5d('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 07c8951..9dff581 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 _0x8ef6=['length','chatMessage:','./chatMessage.events','save','remove','update','removeListener','register'];(function(_0x90f100,_0x20511d){var _0x2076da=function(_0x15aa9c){while(--_0x15aa9c){_0x90f100['push'](_0x90f100['shift']());}};_0x2076da(++_0x20511d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x588028,_0x34c872){_0x588028=_0x588028-0x0;var _0x551202=_0x8ef6[_0x588028];return _0x551202;};'use strict';var ChatMessageEvents=require(_0x68ef('0x0'));var events=[_0x68ef('0x1'),_0x68ef('0x2'),_0x68ef('0x3')];function createListener(_0x2cc97b,_0x44e0d3){return function(_0x3411a2){_0x44e0d3['emit'](_0x2cc97b,_0x3411a2);};}function removeListener(_0x27d0af,_0x129ce){return function(){ChatMessageEvents[_0x68ef('0x4')](_0x27d0af,_0x129ce);};}exports[_0x68ef('0x5')]=function(_0x4d26e3){for(var _0x4f77f3=0x0,_0x3c2ff3=events[_0x68ef('0x6')];_0x4f77f3<_0x3c2ff3;_0x4f77f3++){var _0x2de776=events[_0x4f77f3];var _0x4eb5eb=createListener(_0x68ef('0x7')+_0x2de776,_0x4d26e3);ChatMessageEvents['on'](_0x2de776,_0x4eb5eb);}};
\ No newline at end of file
+var _0x2caf=['removeListener','register','length','chatMessage:','update','emit'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0x2caf,0x6a));var _0xf2ca=function(_0x10c139,_0x356b39){_0x10c139=_0x10c139-0x0;var _0x4dfd12=_0x2caf[_0x10c139];return _0x4dfd12;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove',_0xf2ca('0x0')];function createListener(_0x53a64f,_0x3b2612){return function(_0x36e439){_0x3b2612[_0xf2ca('0x1')](_0x53a64f,_0x36e439);};}function removeListener(_0x375e8b,_0x137501){return function(){ChatMessageEvents[_0xf2ca('0x2')](_0x375e8b,_0x137501);};}exports[_0xf2ca('0x3')]=function(_0x51372a){for(var _0x8ce770=0x0,_0x4292b4=events[_0xf2ca('0x4')];_0x8ce770<_0x4292b4;_0x8ce770++){var _0x57e3e8=events[_0x8ce770];var _0x4ea38c=createListener(_0xf2ca('0x5')+_0x57e3e8,_0x51372a);ChatMessageEvents['on'](_0x57e3e8,_0x4ea38c);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 0255da4..fd34c22 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 _0x6e1d=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x195eb3,_0x59180c){var _0x36ea03=function(_0x5f583d){while(--_0x5f583d){_0x195eb3['push'](_0x195eb3['shift']());}};_0x36ea03(++_0x59180c);}(_0x6e1d,0x132));var _0xd6e1=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x6e1d[_0x355ce8];return _0x1db8b8;};'use strict';var multer=require(_0xd6e1('0x0'));var util=require(_0xd6e1('0x1'));var path=require('path');var timeout=require(_0xd6e1('0x2'));var express=require(_0xd6e1('0x3'));var router=express['Router']();var fs_extra=require(_0xd6e1('0x4'));var auth=require(_0xd6e1('0x5'));var interaction=require(_0xd6e1('0x6'));var config=require(_0xd6e1('0x7'));var controller=require('./chatMessage.controller');router[_0xd6e1('0x8')]('/',auth[_0xd6e1('0x9')](),controller['index']);router['get'](_0xd6e1('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xd6e1('0x8')](_0xd6e1('0xb'),auth['isAuthenticated'](),controller[_0xd6e1('0xc')]);router[_0xd6e1('0xd')]('/',auth[_0xd6e1('0x9')](),interaction[_0xd6e1('0xe')](_0xd6e1('0xf'),'chatmessage:create'),controller[_0xd6e1('0x10')]);router[_0xd6e1('0x11')](_0xd6e1('0xb'),controller[_0xd6e1('0x12')]);router[_0xd6e1('0x11')](_0xd6e1('0x13'),auth['isAuthenticated'](),controller[_0xd6e1('0x14')]);router[_0xd6e1('0x11')](_0xd6e1('0x15'),auth[_0xd6e1('0x9')](),controller[_0xd6e1('0x16')]);router[_0xd6e1('0x17')](_0xd6e1('0xb'),auth[_0xd6e1('0x9')](),controller[_0xd6e1('0x18')]);module[_0xd6e1('0x19')]=router;
\ No newline at end of file
+var _0x33e3=['fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','post','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x25abad,_0x19f0a3){var _0x3f8903=function(_0x439e08){while(--_0x439e08){_0x25abad['push'](_0x25abad['shift']());}};_0x3f8903(++_0x19f0a3);}(_0x33e3,0x194));var _0x333e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33e3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x333e('0x0'));var util=require('util');var path=require(_0x333e('0x1'));var timeout=require(_0x333e('0x2'));var express=require('express');var router=express[_0x333e('0x3')]();var fs_extra=require(_0x333e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x333e('0x5'));var config=require(_0x333e('0x6'));var controller=require(_0x333e('0x7'));router[_0x333e('0x8')]('/',auth[_0x333e('0x9')](),controller[_0x333e('0xa')]);router[_0x333e('0x8')]('/describe',auth[_0x333e('0x9')](),controller['describe']);router[_0x333e('0x8')](_0x333e('0xb'),auth[_0x333e('0x9')](),controller['show']);router[_0x333e('0xc')]('/',auth[_0x333e('0x9')](),interaction['tracked'](_0x333e('0xd'),_0x333e('0xe')),controller['create']);router['put'](_0x333e('0xb'),controller[_0x333e('0xf')]);router[_0x333e('0x10')](_0x333e('0x11'),auth[_0x333e('0x9')](),controller[_0x333e('0x12')]);router['put'](_0x333e('0x13'),auth[_0x333e('0x9')](),controller[_0x333e('0x14')]);router[_0x333e('0x15')](_0x333e('0xb'),auth['isAuthenticated'](),controller[_0x333e('0x16')]);module[_0x333e('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 7472de0..8ab366c 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 _0x2032=['medium','exports','TEXT'];(function(_0x3ece4e,_0x3585fb){var _0x52decd=function(_0x1f78d5){while(--_0x1f78d5){_0x3ece4e['push'](_0x3ece4e['shift']());}};_0x52decd(++_0x3585fb);}(_0x2032,0xd9));var _0x2203=function(_0x304340,_0x1f9cb6){_0x304340=_0x304340-0x0;var _0x379f25=_0x2032[_0x304340];return _0x379f25;};'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
+var _0x757a=['exports','TEXT'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x757a,0xde));var _0xa757=function(_0x1f6404,_0x37e8b6){_0x1f6404=_0x1f6404-0x0;var _0x235f56=_0x757a[_0x1f6404];return _0x235f56;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 731d384..57ae78f 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(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x1b322d,_0x1525dc){_0x1b322d=_0x1b322d-0x0;var _0x51ea67=_0x7a54[_0x1b322d];return _0x51ea67;};'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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x968120,_0x31a9ce){var _0x4925d0=function(_0x5d4834){while(--_0x5d4834){_0x968120['push'](_0x968120['shift']());}};_0x4925d0(++_0x31a9ce);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 59f4ff1..e4bf32d 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 _0x0618=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x38fa3f,_0x32e02d){var _0x351d29=function(_0x3bd49e){while(--_0x3bd49e){_0x38fa3f['push'](_0x38fa3f['shift']());}};_0x351d29(++_0x32e02d);}(_0x0618,0x1c6));var _0x8061=function(_0xa83097,_0x15f383){_0xa83097=_0xa83097-0x0;var _0x15fd69=_0x0618[_0xa83097];return _0x15fd69;};'use strict';var EventEmitter=require(_0x8061('0x0'));var ChatOfflineMessage=require(_0x8061('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8061('0x2')](0x0);var events={'afterCreate':_0x8061('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x32ff20){return function(_0x6aff35,_0x382b13,_0x2683db){ChatOfflineMessageEvents[_0x8061('0x4')](_0x32ff20+':'+_0x6aff35['id'],_0x6aff35);ChatOfflineMessageEvents[_0x8061('0x4')](_0x32ff20,_0x6aff35);_0x2683db(null);};}for(var e in events){if(events[_0x8061('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x8061('0x6')](e,emitEvent(event));}}module[_0x8061('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x39c7=['save','update','remove','hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x3e4a34,_0x452723){var _0x2d2d2e=function(_0x1378ec){while(--_0x1378ec){_0x3e4a34['push'](_0x3e4a34['shift']());}};_0x2d2d2e(++_0x452723);}(_0x39c7,0x85));var _0x739c=function(_0x14ec1f,_0x59ef2f){_0x14ec1f=_0x14ec1f-0x0;var _0x5cecb3=_0x39c7[_0x14ec1f];return _0x5cecb3;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x739c('0x0'))['db'][_0x739c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x739c('0x2')](0x0);var events={'afterCreate':_0x739c('0x3'),'afterUpdate':_0x739c('0x4'),'afterDestroy':_0x739c('0x5')};function emitEvent(_0x48c547){return function(_0x11c0a6,_0xff8215,_0x43dd74){ChatOfflineMessageEvents['emit'](_0x48c547+':'+_0x11c0a6['id'],_0x11c0a6);ChatOfflineMessageEvents['emit'](_0x48c547,_0x11c0a6);_0x43dd74(null);};}for(var e in events){if(events[_0x739c('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x739c('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 4965371..8a2d7db 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 _0x9756=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9756,0x1c0));var _0x6975=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x9756[_0x556927];return _0x5f1235;};'use strict';var attributes=require(_0x6975('0x0'));module[_0x6975('0x1')]=function(_0x2739be){return _0x2739be['define'](_0x6975('0x2'),attributes,{'tableName':_0x6975('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6975('0x4'),'collate':_0x6975('0x5')});};
\ No newline at end of file
+var _0x0360=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x504f4a,_0x523da1){var _0x1b029f=function(_0x3f18a4){while(--_0x3f18a4){_0x504f4a['push'](_0x504f4a['shift']());}};_0x1b029f(++_0x523da1);}(_0x0360,0x15e));var _0x0036=function(_0xd9d48b,_0x5389be){_0xd9d48b=_0xd9d48b-0x0;var _0x44973c=_0x0360[_0xd9d48b];return _0x44973c;};'use strict';var attributes=require(_0x0036('0x0'));module[_0x0036('0x1')]=function(_0x356a41){return _0x356a41['define'](_0x0036('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0036('0x3'),'collate':_0x0036('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 55b04a2..06c3aa7 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 _0xc023=['client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1cdf4e,_0x3ca200){var _0x223592=function(_0xe259e5){while(--_0xe259e5){_0x1cdf4e['push'](_0x1cdf4e['shift']());}};_0x223592(++_0x3ca200);}(_0xc023,0x162));var _0x3c02=function(_0x5bd431,_0x5bc0d0){_0x5bd431=_0x5bd431-0x0;var _0x263dd5=_0xc023[_0x5bd431];return _0x263dd5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c02('0x0'));var BPromise=require(_0x3c02('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c02('0x2'))['db'];var utils=require(_0x3c02('0x3'));var logger=require(_0x3c02('0x4'))(_0x3c02('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c02('0x6')][_0x3c02('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2675f2,_0x530fb5,_0x4cb4d5){return new BPromise(function(_0x3dd58f,_0x2dd82d){return client['request'](_0x2675f2,_0x4cb4d5)[_0x3c02('0x8')](function(_0x14f51e){logger[_0x3c02('0x9')](_0x3c02('0xa'),_0x530fb5,_0x3c02('0xb'));logger['debug'](_0x3c02('0xc'),_0x530fb5,_0x3c02('0xb'),JSON[_0x3c02('0xd')](_0x14f51e));if(_0x14f51e[_0x3c02('0xe')]){if(_0x14f51e[_0x3c02('0xe')][_0x3c02('0xf')]===0x1f4){logger[_0x3c02('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x530fb5,_0x14f51e['error'][_0x3c02('0x10')]);return _0x2dd82d(_0x14f51e['error'][_0x3c02('0x10')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x530fb5,_0x14f51e['error'][_0x3c02('0x10')]);return _0x3dd58f(_0x14f51e[_0x3c02('0xe')][_0x3c02('0x10')]);}else{logger['info'](_0x3c02('0xa'),_0x530fb5,_0x3c02('0xb'));_0x3dd58f(_0x14f51e['result'][_0x3c02('0x10')]);}})[_0x3c02('0x11')](function(_0x56f9b3){logger[_0x3c02('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x530fb5,_0x56f9b3);_0x2dd82d(_0x56f9b3);});});}
\ No newline at end of file
+var _0x55a8=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xab1898,_0x535f14){var _0x3a9c70=function(_0x57bb36){while(--_0x57bb36){_0xab1898['push'](_0xab1898['shift']());}};_0x3a9c70(++_0x535f14);}(_0x55a8,0x148));var _0x855a=function(_0x20af9d,_0x295b){_0x20af9d=_0x20af9d-0x0;var _0x292bf8=_0x55a8[_0x20af9d];return _0x292bf8;};'use strict';var _=require(_0x855a('0x0'));var util=require(_0x855a('0x1'));var moment=require(_0x855a('0x2'));var BPromise=require(_0x855a('0x3'));var rs=require(_0x855a('0x4'));var fs=require('fs');var Redis=require(_0x855a('0x5'));var db=require(_0x855a('0x6'))['db'];var utils=require(_0x855a('0x7'));var logger=require(_0x855a('0x8'))(_0x855a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x855a('0xa')][_0x855a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c579b,_0x5908d6,_0x336987){return new BPromise(function(_0xd30379,_0x3a038b){return client[_0x855a('0xc')](_0x5c579b,_0x336987)[_0x855a('0xd')](function(_0x2b26a6){logger[_0x855a('0xe')](_0x855a('0xf'),_0x5908d6,_0x855a('0x10'));logger[_0x855a('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5908d6,_0x855a('0x10'),JSON[_0x855a('0x12')](_0x2b26a6));if(_0x2b26a6['error']){if(_0x2b26a6[_0x855a('0x13')]['code']===0x1f4){logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);return _0x3a038b(_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);}logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);return _0xd30379(_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);}else{logger[_0x855a('0xe')](_0x855a('0xf'),_0x5908d6,_0x855a('0x10'));_0xd30379(_0x2b26a6[_0x855a('0x15')][_0x855a('0x14')]);}})[_0x855a('0x16')](function(_0x33d9cb){logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x33d9cb);_0x3a038b(_0x33d9cb);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index b960b98..32b777c 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 _0x7640=['describe','/:id','show','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x281ca5,_0x46f921){var _0x796a84=function(_0x50ebca){while(--_0x50ebca){_0x281ca5['push'](_0x281ca5['shift']());}};_0x796a84(++_0x46f921);}(_0x7640,0xe4));var _0x0764=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x7640[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x0764('0x0'));var util=require('util');var path=require(_0x0764('0x1'));var timeout=require(_0x0764('0x2'));var express=require(_0x0764('0x3'));var router=express[_0x0764('0x4')]();var fs_extra=require(_0x0764('0x5'));var auth=require(_0x0764('0x6'));var interaction=require(_0x0764('0x7'));var config=require(_0x0764('0x8'));var controller=require(_0x0764('0x9'));router['get']('/',auth[_0x0764('0xa')](),controller[_0x0764('0xb')]);router[_0x0764('0xc')](_0x0764('0xd'),auth['isAuthenticated'](),controller[_0x0764('0xe')]);router[_0x0764('0xc')](_0x0764('0xf'),auth[_0x0764('0xa')](),controller[_0x0764('0x10')]);router[_0x0764('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0764('0x12')](_0x0764('0xf'),auth[_0x0764('0xa')](),controller[_0x0764('0x13')]);router[_0x0764('0x14')](_0x0764('0xf'),auth[_0x0764('0xa')](),controller['destroy']);module[_0x0764('0x15')]=router;
\ No newline at end of file
+var _0x5bc7=['isAuthenticated','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x5bc7,0x125));var _0x75bc=function(_0x583aa4,_0x42ba7e){_0x583aa4=_0x583aa4-0x0;var _0x4f8b7e=_0x5bc7[_0x583aa4];return _0x4f8b7e;};'use strict';var multer=require(_0x75bc('0x0'));var util=require('util');var path=require(_0x75bc('0x1'));var timeout=require(_0x75bc('0x2'));var express=require(_0x75bc('0x3'));var router=express['Router']();var fs_extra=require(_0x75bc('0x4'));var auth=require(_0x75bc('0x5'));var interaction=require(_0x75bc('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x75bc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x75bc('0x7')](_0x75bc('0x8'),auth['isAuthenticated'](),controller[_0x75bc('0x9')]);router['get'](_0x75bc('0xa'),auth[_0x75bc('0xb')](),controller[_0x75bc('0xc')]);router[_0x75bc('0xd')]('/',auth[_0x75bc('0xb')](),controller[_0x75bc('0xe')]);router[_0x75bc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75bc('0x10')]);router[_0x75bc('0x11')](_0x75bc('0xa'),auth[_0x75bc('0xb')](),controller['destroy']);module[_0x75bc('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 2f37027..c14cb0d 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 _0xe973=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0xe973,0x73));var _0x3e97=function(_0x5a36df,_0x3b781f){_0x5a36df=_0x5a36df-0x0;var _0x504577=_0xe973[_0x5a36df];return _0x504577;};'use strict';var Sequelize=require(_0x3e97('0x0'));module[_0x3e97('0x1')]={'name':{'type':Sequelize[_0x3e97('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3e97('0x3')](_0x3e97('0x4'),'timeout'),'defaultValue':_0x3e97('0x4')},'selector':{'type':Sequelize[_0x3e97('0x2')]},'timeout':{'type':Sequelize[_0x3e97('0x5')]}};
\ No newline at end of file
+var _0xec46=['exports','STRING','ENUM','INTEGER','sequelize'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xec46,0xf4));var _0x6ec4=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xec46[_0x2f5a22];return _0x326b70;};'use strict';var Sequelize=require(_0x6ec4('0x0'));module[_0x6ec4('0x1')]={'name':{'type':Sequelize[_0x6ec4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6ec4('0x3')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6ec4('0x2')]},'timeout':{'type':Sequelize[_0x6ec4('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index adead08..4e358f1 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 _0x7da7=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','end','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','include','merge','options','find','create','catch','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x29655f,_0x35c443){var _0x253f8d=function(_0x2d3da0){while(--_0x2d3da0){_0x29655f['push'](_0x29655f['shift']());}};_0x253f8d(++_0x35c443);}(_0x7da7,0x10d));var _0x77da=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7da7[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){_0x27b6c7['status'](0xcc)[_0x77da('0x23')]();});}};}function handleEntityNotFound(_0x2d009f,_0x835167){return function(_0xbd06b7){if(!_0xbd06b7){_0x2d009f['sendStatus'](0x194);}return _0xbd06b7;};}function handleError(_0x42240b,_0x167240){_0x167240=_0x167240||0x1f4;return function(_0x470c9f){logger[_0x77da('0x24')](_0x470c9f[_0x77da('0x25')]);if(_0x470c9f['name']){delete _0x470c9f[_0x77da('0x26')];}_0x42240b[_0x77da('0x18')](_0x167240)[_0x77da('0x27')](_0x470c9f);};}exports[_0x77da('0x28')]=function(_0x496ecd,_0x5b4638){var _0x4d395a={'raw':!![],'where':{'id':_0x496ecd[_0x77da('0x29')]['id']}},_0x2258e9={};_0x2258e9[_0x77da('0x2a')]=_[_0x77da('0x2b')](db[_0x77da('0x2c')]['rawAttributes']);_0x2258e9[_0x77da('0x2d')]=_[_0x77da('0x2b')](_0x496ecd[_0x77da('0x2d')]);_0x2258e9[_0x77da('0x2e')]=_[_0x77da('0x2f')](_0x2258e9[_0x77da('0x2a')],_0x2258e9['query']);_0x4d395a[_0x77da('0x30')]=_[_0x77da('0x2f')](_0x2258e9[_0x77da('0x2a')],qs[_0x77da('0x31')](_0x496ecd[_0x77da('0x2d')][_0x77da('0x31')]));_0x4d395a[_0x77da('0x30')]=_0x4d395a[_0x77da('0x30')]['length']?_0x4d395a['attributes']:_0x2258e9[_0x77da('0x2a')];if(_0x496ecd[_0x77da('0x2d')]['includeAll']){_0x4d395a[_0x77da('0x32')]=[{'all':!![]}];}_0x4d395a=_[_0x77da('0x33')]({},_0x4d395a,_0x496ecd[_0x77da('0x34')]);return db[_0x77da('0x2c')][_0x77da('0x35')](_0x4d395a)[_0x77da('0x21')](handleEntityNotFound(_0x5b4638,null))[_0x77da('0x21')](respondWithResult(_0x5b4638,null))['catch'](handleError(_0x5b4638,null));};exports[_0x77da('0x36')]=function(_0x4df4b9,_0x54b7f2){return db['ChatProactiveAction'][_0x77da('0x36')](_0x4df4b9['body'],{})[_0x77da('0x21')](respondWithResult(_0x54b7f2,0xc9))[_0x77da('0x37')](handleError(_0x54b7f2,null));};exports[_0x77da('0x20')]=function(_0x3cc78b,_0x3c46d2){if(_0x3cc78b[_0x77da('0x38')]['id']){delete _0x3cc78b[_0x77da('0x38')]['id'];}return db['ChatProactiveAction'][_0x77da('0x35')]({'where':{'id':_0x3cc78b[_0x77da('0x29')]['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x3c46d2,null))[_0x77da('0x21')](saveUpdates(_0x3cc78b[_0x77da('0x38')],null))[_0x77da('0x21')](respondWithResult(_0x3c46d2,null))['catch'](handleError(_0x3c46d2,null));};exports[_0x77da('0x22')]=function(_0x16a0e0,_0x2cd190){return db['ChatProactiveAction'][_0x77da('0x35')]({'where':{'id':_0x16a0e0['params']['id']}})['then'](handleEntityNotFound(_0x2cd190,null))['then'](removeEntity(_0x2cd190,null))['catch'](handleError(_0x2cd190,null));};
\ No newline at end of file
+var _0x83d3=['bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','show','params','keys','query','intersection','model','attributes','fields','length','includeAll','merge','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x28c8cb,_0x5895e1){var _0x365af1=function(_0x12b9bd){while(--_0x12b9bd){_0x28c8cb['push'](_0x28c8cb['shift']());}};_0x365af1(++_0x5895e1);}(_0x83d3,0x17c));var _0x383d=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0x83d3[_0x36da00];return _0x4b72c5;};'use strict';var emlformat=require(_0x383d('0x0'));var rimraf=require(_0x383d('0x1'));var zipdir=require(_0x383d('0x2'));var jsonpatch=require(_0x383d('0x3'));var rp=require(_0x383d('0x4'));var moment=require('moment');var BPromise=require(_0x383d('0x5'));var Mustache=require(_0x383d('0x6'));var util=require(_0x383d('0x7'));var path=require(_0x383d('0x8'));var sox=require('sox');var csv=require(_0x383d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x383d('0xa'));var squel=require(_0x383d('0xb'));var crypto=require(_0x383d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x383d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x383d('0xe'));var Redis=require(_0x383d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x383d('0x10'));var as=require(_0x383d('0x11'));var hardwareService=require(_0x383d('0x12'));var logger=require(_0x383d('0x13'))(_0x383d('0x14'));var utils=require(_0x383d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e7cf,_0x538c32){_0x538c32=_0x538c32||0xcc;return function(_0x3d5b63){if(_0x3d5b63){return _0x15e7cf[_0x383d('0x16')](_0x538c32);}return _0x15e7cf[_0x383d('0x17')](_0x538c32)[_0x383d('0x18')]();};}function respondWithResult(_0x4c6d4f,_0x556fee){_0x556fee=_0x556fee||0xc8;return function(_0x3999d7){if(_0x3999d7){return _0x4c6d4f['status'](_0x556fee)[_0x383d('0x19')](_0x3999d7);}};}function respondWithFilteredResult(_0x5afc53,_0x531e18){return function(_0x294423){if(_0x294423){var _0x31abf5=typeof _0x531e18['offset']==='undefined'&&typeof _0x531e18[_0x383d('0x1a')]===_0x383d('0x1b');var _0x5be3d7=_0x294423[_0x383d('0x1c')];var _0x18dc97=_0x31abf5?0x0:_0x531e18[_0x383d('0x1d')];var _0xc7868=_0x31abf5?_0x294423[_0x383d('0x1c')]:_0x531e18[_0x383d('0x1d')]+_0x531e18[_0x383d('0x1a')];var _0x55fb74;if(_0xc7868>=_0x5be3d7){_0xc7868=_0x5be3d7;_0x55fb74=0xc8;}else{_0x55fb74=0xce;}_0x5afc53[_0x383d('0x17')](_0x55fb74);return _0x5afc53[_0x383d('0x1e')](_0x383d('0x1f'),_0x18dc97+'-'+_0xc7868+'/'+_0x5be3d7)[_0x383d('0x19')](_0x294423);}return null;};}function patchUpdates(_0x2043e5){return function(_0x45ee85){try{jsonpatch[_0x383d('0x20')](_0x45ee85,_0x2043e5,!![]);}catch(_0x562a28){return BPromise['reject'](_0x562a28);}return _0x45ee85[_0x383d('0x21')]();};}function saveUpdates(_0x28b880,_0x4e3d9e){return function(_0x17d883){if(_0x17d883){return _0x17d883[_0x383d('0x22')](_0x28b880)[_0x383d('0x23')](function(_0x45d1a1){return _0x45d1a1;});}return null;};}function removeEntity(_0x3e36a2,_0x376ea7){return function(_0xcbedc9){if(_0xcbedc9){return _0xcbedc9[_0x383d('0x24')]()[_0x383d('0x23')](function(){_0x3e36a2[_0x383d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x599756,_0x1d5a10){return function(_0x1e5a7f){if(!_0x1e5a7f){_0x599756[_0x383d('0x16')](0x194);}return _0x1e5a7f;};}function handleError(_0x70fdba,_0x267643){_0x267643=_0x267643||0x1f4;return function(_0x1d553b){logger[_0x383d('0x25')](_0x1d553b['stack']);if(_0x1d553b[_0x383d('0x26')]){delete _0x1d553b[_0x383d('0x26')];}_0x70fdba['status'](_0x267643)['send'](_0x1d553b);};}exports[_0x383d('0x27')]=function(_0x3f86e2,_0x13f872){var _0xbe4a1f={'raw':!![],'where':{'id':_0x3f86e2[_0x383d('0x28')]['id']}},_0x202853={};_0x202853['model']=_[_0x383d('0x29')](db['ChatProactiveAction']['rawAttributes']);_0x202853[_0x383d('0x2a')]=_[_0x383d('0x29')](_0x3f86e2[_0x383d('0x2a')]);_0x202853['filters']=_[_0x383d('0x2b')](_0x202853[_0x383d('0x2c')],_0x202853['query']);_0xbe4a1f[_0x383d('0x2d')]=_[_0x383d('0x2b')](_0x202853['model'],qs[_0x383d('0x2e')](_0x3f86e2['query'][_0x383d('0x2e')]));_0xbe4a1f[_0x383d('0x2d')]=_0xbe4a1f['attributes'][_0x383d('0x2f')]?_0xbe4a1f['attributes']:_0x202853[_0x383d('0x2c')];if(_0x3f86e2['query'][_0x383d('0x30')]){_0xbe4a1f['include']=[{'all':!![]}];}_0xbe4a1f=_[_0x383d('0x31')]({},_0xbe4a1f,_0x3f86e2['options']);return db[_0x383d('0x32')][_0x383d('0x33')](_0xbe4a1f)[_0x383d('0x23')](handleEntityNotFound(_0x13f872,null))[_0x383d('0x23')](respondWithResult(_0x13f872,null))['catch'](handleError(_0x13f872,null));};exports[_0x383d('0x34')]=function(_0x5379cc,_0x23aeb4){return db[_0x383d('0x32')][_0x383d('0x34')](_0x5379cc[_0x383d('0x35')],{})[_0x383d('0x23')](respondWithResult(_0x23aeb4,0xc9))[_0x383d('0x36')](handleError(_0x23aeb4,null));};exports['update']=function(_0x386f89,_0x5cc6c4){if(_0x386f89[_0x383d('0x35')]['id']){delete _0x386f89['body']['id'];}return db[_0x383d('0x32')][_0x383d('0x33')]({'where':{'id':_0x386f89[_0x383d('0x28')]['id']}})['then'](handleEntityNotFound(_0x5cc6c4,null))[_0x383d('0x23')](saveUpdates(_0x386f89[_0x383d('0x35')],null))[_0x383d('0x23')](respondWithResult(_0x5cc6c4,null))['catch'](handleError(_0x5cc6c4,null));};exports[_0x383d('0x24')]=function(_0x51aa4c,_0x38f783){return db[_0x383d('0x32')]['find']({'where':{'id':_0x51aa4c['params']['id']}})[_0x383d('0x23')](handleEntityNotFound(_0x38f783,null))[_0x383d('0x23')](removeEntity(_0x38f783,null))[_0x383d('0x36')](handleError(_0x38f783,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index dd72281..ce6a2d6 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 _0x3d52=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','request-promise','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3d52,0x16c));var _0x23d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23d5('0x0'));var util=require(_0x23d5('0x1'));var logger=require('../../config/logger')(_0x23d5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23d5('0x3'));var fs=require('fs');var path=require(_0x23d5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23d5('0x5'));module['exports']=function(_0x2adfce,_0x50bbf3){return _0x2adfce[_0x23d5('0x6')](_0x23d5('0x7'),attributes,{'tableName':_0x23d5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc491=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x95612a,_0x5e6fbc){var _0x38de09=function(_0xaaf990){while(--_0xaaf990){_0x95612a['push'](_0x95612a['shift']());}};_0x38de09(++_0x5e6fbc);}(_0xc491,0x1a8));var _0x1c49=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xc491[_0x2c6810];return _0x213881;};'use strict';var _=require(_0x1c49('0x0'));var util=require(_0x1c49('0x1'));var logger=require(_0x1c49('0x2'))(_0x1c49('0x3'));var moment=require(_0x1c49('0x4'));var BPromise=require(_0x1c49('0x5'));var rp=require(_0x1c49('0x6'));var fs=require('fs');var path=require(_0x1c49('0x7'));var rimraf=require(_0x1c49('0x8'));var config=require(_0x1c49('0x9'));var attributes=require(_0x1c49('0xa'));module['exports']=function(_0x4dde76,_0x308f17){return _0x4dde76[_0x1c49('0xb')](_0x1c49('0xc'),attributes,{'tableName':_0x1c49('0xd'),'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 af1cd1e..fbb4663 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 _0x4ca3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4ca3,0x150));var _0x34ca=function(_0x2f32ae,_0x84ea81){_0x2f32ae=_0x2f32ae-0x0;var _0x23374c=_0x4ca3[_0x2f32ae];return _0x23374c;};'use strict';var _=require(_0x34ca('0x0'));var util=require(_0x34ca('0x1'));var moment=require(_0x34ca('0x2'));var BPromise=require(_0x34ca('0x3'));var rs=require(_0x34ca('0x4'));var fs=require('fs');var Redis=require(_0x34ca('0x5'));var db=require(_0x34ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x34ca('0x7'));var config=require(_0x34ca('0x8'));var jayson=require(_0x34ca('0x9'));var client=jayson[_0x34ca('0xa')][_0x34ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16f55e,_0x340f9d,_0x1434a8){return new BPromise(function(_0x1656ea,_0x1daf41){return client[_0x34ca('0xc')](_0x16f55e,_0x1434a8)[_0x34ca('0xd')](function(_0x2036c1){logger['info'](_0x34ca('0xe'),_0x340f9d,_0x34ca('0xf'));logger[_0x34ca('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x340f9d,_0x34ca('0xf'),JSON[_0x34ca('0x11')](_0x2036c1));if(_0x2036c1[_0x34ca('0x12')]){if(_0x2036c1[_0x34ca('0x12')][_0x34ca('0x13')]===0x1f4){logger['error'](_0x34ca('0xe'),_0x340f9d,_0x2036c1[_0x34ca('0x12')][_0x34ca('0x14')]);return _0x1daf41(_0x2036c1['error'][_0x34ca('0x14')]);}logger['error'](_0x34ca('0xe'),_0x340f9d,_0x2036c1[_0x34ca('0x12')]['message']);return _0x1656ea(_0x2036c1['error'][_0x34ca('0x14')]);}else{logger[_0x34ca('0x15')](_0x34ca('0xe'),_0x340f9d,_0x34ca('0xf'));_0x1656ea(_0x2036c1[_0x34ca('0x16')][_0x34ca('0x14')]);}})[_0x34ca('0x17')](function(_0x29c1b3){logger[_0x34ca('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x340f9d,_0x29c1b3);_0x1daf41(_0x29c1b3);});});}
\ No newline at end of file
+var _0xf8d2=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x274d4b,_0x128681){var _0x1a1f03=function(_0x420675){while(--_0x420675){_0x274d4b['push'](_0x274d4b['shift']());}};_0x1a1f03(++_0x128681);}(_0xf8d2,0x162));var _0x2f8d=function(_0x3f0a7c,_0x16edda){_0x3f0a7c=_0x3f0a7c-0x0;var _0x2b3a28=_0xf8d2[_0x3f0a7c];return _0x2b3a28;};'use strict';var _=require(_0x2f8d('0x0'));var util=require(_0x2f8d('0x1'));var moment=require(_0x2f8d('0x2'));var BPromise=require(_0x2f8d('0x3'));var rs=require(_0x2f8d('0x4'));var fs=require('fs');var Redis=require(_0x2f8d('0x5'));var db=require(_0x2f8d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f8d('0x7'))(_0x2f8d('0x8'));var config=require(_0x2f8d('0x9'));var jayson=require(_0x2f8d('0xa'));var client=jayson['client'][_0x2f8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52f9fc,_0x4705b6,_0x2bd0b1){return new BPromise(function(_0x409128,_0x4108b1){return client[_0x2f8d('0xc')](_0x52f9fc,_0x2bd0b1)[_0x2f8d('0xd')](function(_0x10a487){logger[_0x2f8d('0xe')](_0x2f8d('0xf'),_0x4705b6,_0x2f8d('0x10'));logger[_0x2f8d('0x11')](_0x2f8d('0x12'),_0x4705b6,_0x2f8d('0x10'),JSON[_0x2f8d('0x13')](_0x10a487));if(_0x10a487[_0x2f8d('0x14')]){if(_0x10a487[_0x2f8d('0x14')][_0x2f8d('0x15')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x10a487[_0x2f8d('0x14')]['message']);return _0x4108b1(_0x10a487['error'][_0x2f8d('0x16')]);}logger[_0x2f8d('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x10a487[_0x2f8d('0x14')]['message']);return _0x409128(_0x10a487[_0x2f8d('0x14')]['message']);}else{logger['info'](_0x2f8d('0xf'),_0x4705b6,_0x2f8d('0x10'));_0x409128(_0x10a487[_0x2f8d('0x17')][_0x2f8d('0x16')]);}})[_0x2f8d('0x18')](function(_0x516dd5){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x516dd5);_0x4108b1(_0x516dd5);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 24332e3..c0a4b95 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 _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x37eed1,_0x2bf10d){_0x37eed1=_0x37eed1-0x0;var _0x5157e9=_0x8d0e[_0x37eed1];return _0x5157e9;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x52c30a,_0x40107d){var _0x33a05b=function(_0x404d55){while(--_0x404d55){_0x52c30a['push'](_0x52c30a['shift']());}};_0x33a05b(++_0x40107d);}(_0xf494,0x1c6));var _0x4f49=function(_0x326109,_0x2055e0){_0x326109=_0x326109-0x0;var _0x3302d4=_0xf494[_0x326109];return _0x3302d4;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index eabf02b..861ca7d 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 _0xe482=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xe482,0xa5));var _0x2e48=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xe482[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require(_0x2e48('0x0'));module[_0x2e48('0x1')]={'name':{'type':Sequelize[_0x2e48('0x2')],'unique':_0x2e48('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2e48('0x2')]},'timeout':{'type':Sequelize[_0x2e48('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e48('0x5')](_0x2e48('0x6'),'beepall',_0x2e48('0x7'))}};
\ No newline at end of file
+var _0x57a3=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x57a3,0xc0));var _0x357a=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x57a3[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x357a('0x0'));module[_0x357a('0x1')]={'name':{'type':Sequelize[_0x357a('0x2')],'unique':_0x357a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x357a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x357a('0x5')](_0x357a('0x6'),'beepall',_0x357a('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c5f9a17..c205ab0 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 _0xf92f=['defaults','localhost','./chatQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','update','then','destroy','get','ChatQueues','UserProfileResource','end','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','intersection','fields','attributes','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','filters','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','UserChatQueue','UserId','chatPause','updatedAt','%s/%s','createdAt','getTeams','Team','addTeams','ids','User','Agents','online','interface','flatMap','transaction','findOrCreate','forEach','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','removeAgents','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','bluebird','lodash','squel','ioredis','../../config/environment','../../mysqldb','redis'];(function(_0x44dc4c,_0x357e6a){var _0x4e644e=function(_0x2f033e){while(--_0x2f033e){_0x44dc4c['push'](_0x44dc4c['shift']());}};_0x4e644e(++_0x357e6a);}(_0xf92f,0xdf));var _0xff92=function(_0x11e1b2,_0x24d02c){_0x11e1b2=_0x11e1b2-0x0;var _0x2d6782=_0xf92f[_0x11e1b2];return _0x2d6782;};'use strict';var BPromise=require(_0xff92('0x0'));var util=require('util');var _=require(_0xff92('0x1'));var squel=require(_0xff92('0x2'));var Redis=require(_0xff92('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xff92('0x4'));var db=require(_0xff92('0x5'))['db'];config[_0xff92('0x6')]=_[_0xff92('0x7')](config['redis'],{'host':_0xff92('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff92('0x6')]));require(_0xff92('0x9'))[_0xff92('0xa')](socket);function respondWithStatusCode(_0x53b9df,_0x4fcbc9){_0x4fcbc9=_0x4fcbc9||0xcc;return function(_0x1dd006){if(_0x1dd006){return _0x53b9df[_0xff92('0xb')](_0x4fcbc9);}return _0x53b9df[_0xff92('0xc')](_0x4fcbc9)['end']();};}function respondWithResult(_0x46b0fc,_0x4ba40b){_0x4ba40b=_0x4ba40b||0xc8;return function(_0x54577b){if(_0x54577b){return _0x46b0fc['status'](_0x4ba40b)['json'](_0x54577b);}};}function respondWithFilteredResult(_0x660daf,_0x2ce5b4){return function(_0x1551ae){if(_0x1551ae){var _0x398cf6=typeof _0x2ce5b4[_0xff92('0xd')]===_0xff92('0xe')&&typeof _0x2ce5b4[_0xff92('0xf')]==='undefined';var _0x46b3f=_0x1551ae[_0xff92('0x10')];var _0x3d8006=_0x398cf6?0x0:_0x2ce5b4['offset'];var _0x269c68=_0x398cf6?_0x1551ae[_0xff92('0x10')]:_0x2ce5b4[_0xff92('0xd')]+_0x2ce5b4[_0xff92('0xf')];var _0xeafb2;if(_0x269c68>=_0x46b3f){_0x269c68=_0x46b3f;_0xeafb2=0xc8;}else{_0xeafb2=0xce;}_0x660daf[_0xff92('0xc')](_0xeafb2);return _0x660daf[_0xff92('0x11')]('Content-Range',_0x3d8006+'-'+_0x269c68+'/'+_0x46b3f)[_0xff92('0x12')](_0x1551ae);}return null;};}function saveUpdates(_0x58b21a){return function(_0x5da68f){if(_0x5da68f){return _0x5da68f[_0xff92('0x13')](_0x58b21a)[_0xff92('0x14')](function(_0x50b770){return _0x50b770;});}return null;};}function removeEntity(_0x35ad2a){return function(_0x32e45a){if(_0x32e45a){return _0x32e45a[_0xff92('0x15')]()['then'](function(){var _0x558427=_0x32e45a[_0xff92('0x16')]({'plain':!![]});var _0x285f69=_0xff92('0x17');return db[_0xff92('0x18')]['destroy']({'where':{'type':_0x285f69,'resourceId':_0x558427['id']}})[_0xff92('0x14')](function(){return _0x32e45a;});})['then'](function(){_0x35ad2a['status'](0xcc)[_0xff92('0x19')]();});}};}function handleEntityNotFound(_0x53d1d5){return function(_0x5c7487){if(!_0x5c7487){_0x53d1d5[_0xff92('0xb')](0x194);}return _0x5c7487;};}function handleError(_0x24f6d7,_0x2c53bb){_0x2c53bb=_0x2c53bb||0x1f4;return function(_0xbcd1f4){logger[_0xff92('0x1a')](_0xbcd1f4[_0xff92('0x1b')]);if(_0xbcd1f4[_0xff92('0x1c')]){delete _0xbcd1f4[_0xff92('0x1c')];}_0x24f6d7[_0xff92('0xc')](_0x2c53bb)[_0xff92('0x1d')](_0xbcd1f4);};}exports[_0xff92('0x1e')]=function(_0x49dc1f,_0x1fbd78){var _0x40d5ec={};var _0x38c7a2={'count':0x0,'rows':[]};var _0x599dd5=_[_0xff92('0x1f')](db[_0xff92('0x20')][_0xff92('0x21')],function(_0x4893fc){return{'name':_0x4893fc[_0xff92('0x22')],'type':_0x4893fc[_0xff92('0x23')][_0xff92('0x24')]};});_0x40d5ec=qs[_0xff92('0x25')](_0x599dd5,_0x49dc1f);var _0x1df3f7={'where':_0x40d5ec[_0xff92('0x26')]};return db[_0xff92('0x20')][_0xff92('0x10')](_0x1df3f7)['then'](function(_0x39c308){_0x38c7a2[_0xff92('0x10')]=_0x39c308;_0x40d5ec[_0xff92('0x27')]=qs['include'](_0x49dc1f[_0xff92('0x28')]);return db['ChatQueue'][_0xff92('0x29')](_0x40d5ec);})['then'](function(_0x2c1bfb){_0x38c7a2[_0xff92('0x2a')]=_0x2c1bfb;return _0x38c7a2;})[_0xff92('0x14')](respondWithFilteredResult(_0x1fbd78,_0x40d5ec))[_0xff92('0x2b')](handleError(_0x1fbd78,null));};exports[_0xff92('0x2c')]=function(_0x3b5953,_0x467f65){var _0xab4e18={'raw':!![],'where':{'id':_0x3b5953[_0xff92('0x2d')]['id']}},_0x42f7f3={};_0x42f7f3[_0xff92('0x2e')]=_[_0xff92('0x2f')](db[_0xff92('0x20')][_0xff92('0x21')]);_0x42f7f3[_0xff92('0x28')]=_[_0xff92('0x2f')](_0x3b5953[_0xff92('0x28')]);_0x42f7f3['filters']=_[_0xff92('0x30')](_0x42f7f3[_0xff92('0x2e')],_0x42f7f3['query']);_0xab4e18['attributes']=_[_0xff92('0x30')](_0x42f7f3[_0xff92('0x2e')],qs[_0xff92('0x31')](_0x3b5953[_0xff92('0x28')][_0xff92('0x31')]));_0xab4e18[_0xff92('0x32')]=_0xab4e18[_0xff92('0x32')][_0xff92('0x33')]?_0xab4e18[_0xff92('0x32')]:_0x42f7f3[_0xff92('0x2e')];if(_0x3b5953['query']['includeAll']){_0xab4e18[_0xff92('0x27')]=[{'all':!![]}];}_0xab4e18=_[_0xff92('0x34')]({},_0xab4e18,_0x3b5953[_0xff92('0x35')]);return db[_0xff92('0x20')][_0xff92('0x36')](_0xab4e18)[_0xff92('0x14')](handleEntityNotFound(_0x467f65,null))[_0xff92('0x14')](respondWithResult(_0x467f65,null))[_0xff92('0x2b')](handleError(_0x467f65,null));};exports['create']=function(_0x373cd3,_0x435aed){return db[_0xff92('0x20')][_0xff92('0x37')](_0x373cd3[_0xff92('0x38')],{})[_0xff92('0x14')](function(_0x1187a1){var _0x3c33f9=_0x373cd3[_0xff92('0x39')][_0xff92('0x16')]({'plain':!![]});if(!_0x3c33f9)throw new Error(_0xff92('0x3a'));if(_0x3c33f9['role']===_0xff92('0x39')){var _0x4fa64d=_0x1187a1[_0xff92('0x16')]({'plain':!![]});var _0xc25d4e=_0xff92('0x17');return db[_0xff92('0x3b')][_0xff92('0x36')]({'where':{'name':_0xc25d4e,'userProfileId':_0x3c33f9[_0xff92('0x3c')]},'raw':!![]})[_0xff92('0x14')](function(_0x25fb46){if(_0x25fb46&&_0x25fb46[_0xff92('0x3d')]===0x0){return db[_0xff92('0x18')]['create']({'name':_0x4fa64d[_0xff92('0x1c')],'resourceId':_0x4fa64d['id'],'type':_0x25fb46[_0xff92('0x1c')],'sectionId':_0x25fb46['id']},{})[_0xff92('0x14')](function(){return _0x1187a1;});}else{return _0x1187a1;}})[_0xff92('0x2b')](function(_0x54cebf){logger[_0xff92('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54cebf);throw _0x54cebf;});}return _0x1187a1;})[_0xff92('0x14')](respondWithResult(_0x435aed,0xc9))['catch'](handleError(_0x435aed,null));};exports[_0xff92('0x13')]=function(_0x509940,_0x45dbc5){if(_0x509940[_0xff92('0x38')]['id']){delete _0x509940[_0xff92('0x38')]['id'];}return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x509940[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x45dbc5,null))['then'](saveUpdates(_0x509940['body'],null))[_0xff92('0x14')](respondWithResult(_0x45dbc5,null))['catch'](handleError(_0x45dbc5,null));};exports['destroy']=function(_0x3eee9e,_0x595abd){return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x3eee9e[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x595abd,null))[_0xff92('0x14')](removeEntity(_0x595abd,null))['catch'](handleError(_0x595abd,null));};exports[_0xff92('0x3e')]=function(_0x4160b5,_0x7bcde6){return db[_0xff92('0x20')][_0xff92('0x3e')]()[_0xff92('0x14')](respondWithResult(_0x7bcde6,null))[_0xff92('0x2b')](handleError(_0x7bcde6,null));};exports[_0xff92('0x3f')]=function(_0x4780d0,_0x31f70b){var _0x26d292={'raw':!![],'where':{}},_0x446277={},_0x42800f;return db[_0xff92('0x20')][_0xff92('0x40')]({'where':{'id':_0x4780d0[_0xff92('0x2d')]['id']}})['then'](handleEntityNotFound(_0x31f70b,null))[_0xff92('0x14')](function(_0x8cd9c5){if(_0x8cd9c5){_0x42800f=_0x8cd9c5[_0xff92('0x16')]({'plain':!![]});_0x446277['model']=_[_0xff92('0x2f')](db['UserChatQueue'][_0xff92('0x21')]);_0x446277[_0xff92('0x28')]=_['keys'](_0x4780d0['query']);_0x446277[_0xff92('0x41')]=_[_0xff92('0x30')](_0x446277[_0xff92('0x2e')],_0x446277[_0xff92('0x28')]);_0x26d292[_0xff92('0x32')]=_['intersection'](_0x446277['model'],qs[_0xff92('0x31')](_0x4780d0['query'][_0xff92('0x31')]));_0x26d292[_0xff92('0x32')]=_0x26d292['attributes'][_0xff92('0x33')]?_0x26d292[_0xff92('0x32')]:_0x446277[_0xff92('0x2e')];if(!_0x4780d0['query'][_0xff92('0x42')](_0xff92('0x43'))){_0x26d292['limit']=qs[_0xff92('0xf')](_0x4780d0['query'][_0xff92('0xf')]);_0x26d292[_0xff92('0xd')]=qs[_0xff92('0xd')](_0x4780d0[_0xff92('0x28')][_0xff92('0xd')]);}_0x26d292[_0xff92('0x44')]=qs[_0xff92('0x45')](_0x4780d0[_0xff92('0x28')]['sort']);_0x26d292[_0xff92('0x26')]=qs['filters'](_[_0xff92('0x46')](_0x4780d0[_0xff92('0x28')],_0x446277[_0xff92('0x41')]));_0x26d292[_0xff92('0x26')][_0xff92('0x47')]=_0x8cd9c5['id'];if(_0x4780d0['query'][_0xff92('0x48')]){_0x26d292[_0xff92('0x26')]=_[_0xff92('0x34')](_0x26d292[_0xff92('0x26')],{'$or':_[_0xff92('0x1f')](_0x26d292[_0xff92('0x32')],function(_0x1510b3){var _0x59b4f0={};_0x59b4f0[_0x1510b3]={'$like':'%'+_0x4780d0[_0xff92('0x28')][_0xff92('0x48')]+'%'};return _0x59b4f0;})});}_0x26d292=_['merge']({},_0x26d292,_0x4780d0[_0xff92('0x35')]);return db[_0xff92('0x49')][_0xff92('0x29')](_0x26d292);}})[_0xff92('0x14')](function(_0x36e7ad){if(_0x36e7ad){return db['User']['findAndCountAll']({'where':{'id':_[_0xff92('0x1f')](_0x36e7ad,_0xff92('0x4a')),'role':'agent'},'attributes':['id',_0xff92('0x1c'),_0xff92('0x4b'),_0xff92('0x4c'),'createdAt']});}})[_0xff92('0x14')](function(_0x18a64a){if(_0x18a64a){return{'count':_0x18a64a[_0xff92('0x10')],'rows':_['map'](_0x18a64a[_0xff92('0x2a')],function(_0x1de085){return{'membername':_0x1de085['name'],'UserId':_0x1de085['id'],'queue_name':_0x42800f['name'],'ChatQueueId':_0x42800f['id'],'interface':util['format'](_0xff92('0x4d'),'SIP',_0x1de085[_0xff92('0x1c')]),'penalty':0x0,'paused':_0x1de085[_0xff92('0x4b')],'createdAt':_0x1de085[_0xff92('0x4e')],'updatedAt':_0x1de085[_0xff92('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xff92('0x14')](respondWithFilteredResult(_0x31f70b,_0x26d292))[_0xff92('0x2b')](handleError(_0x31f70b,null));};exports[_0xff92('0x4f')]=function(_0x23203a,_0x597489){var _0x2d3723={};var _0x2ae8f8={};var _0xb16e2;var _0x35e24c;return db[_0xff92('0x20')][_0xff92('0x40')]({'where':{'id':_0x23203a[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x597489,null))[_0xff92('0x14')](function(_0x987c52){if(_0x987c52){_0xb16e2=_0x987c52;_0x2ae8f8[_0xff92('0x2e')]=_[_0xff92('0x2f')](db[_0xff92('0x50')][_0xff92('0x21')]);_0x2ae8f8[_0xff92('0x28')]=_[_0xff92('0x2f')](_0x23203a[_0xff92('0x28')]);_0x2ae8f8[_0xff92('0x41')]=_[_0xff92('0x30')](_0x2ae8f8['model'],_0x2ae8f8[_0xff92('0x28')]);_0x2d3723[_0xff92('0x32')]=_[_0xff92('0x30')](_0x2ae8f8[_0xff92('0x2e')],qs['fields'](_0x23203a['query'][_0xff92('0x31')]));_0x2d3723[_0xff92('0x32')]=_0x2d3723[_0xff92('0x32')][_0xff92('0x33')]?_0x2d3723[_0xff92('0x32')]:_0x2ae8f8[_0xff92('0x2e')];_0x2d3723[_0xff92('0x44')]=qs[_0xff92('0x45')](_0x23203a[_0xff92('0x28')][_0xff92('0x45')]);_0x2d3723['where']=qs[_0xff92('0x41')](_[_0xff92('0x46')](_0x23203a[_0xff92('0x28')],_0x2ae8f8[_0xff92('0x41')]));if(_0x23203a['query'][_0xff92('0x48')]){_0x2d3723[_0xff92('0x26')]=_[_0xff92('0x34')](_0x2d3723[_0xff92('0x26')],{'$or':_[_0xff92('0x1f')](_0x2d3723[_0xff92('0x32')],function(_0x2cdc86){var _0x486de7={};_0x486de7[_0x2cdc86]={'$like':'%'+_0x23203a[_0xff92('0x28')]['filter']+'%'};return _0x486de7;})});}_0x2d3723=_[_0xff92('0x34')]({},_0x2d3723,_0x23203a[_0xff92('0x35')]);return _0xb16e2['getTeams'](_0x2d3723);}})['then'](function(_0x3f4b31){if(_0x3f4b31){_0x35e24c=_0x3f4b31['length'];if(!_0x23203a[_0xff92('0x28')][_0xff92('0x42')](_0xff92('0x43'))){_0x2d3723[_0xff92('0xf')]=qs['limit'](_0x23203a[_0xff92('0x28')][_0xff92('0xf')]);_0x2d3723[_0xff92('0xd')]=qs['offset'](_0x23203a[_0xff92('0x28')][_0xff92('0xd')]);}return _0xb16e2['getTeams'](_0x2d3723);}})[_0xff92('0x14')](function(_0x43a4a){if(_0x43a4a){return _0x43a4a?{'count':_0x35e24c,'rows':_0x43a4a}:null;}})[_0xff92('0x14')](respondWithResult(_0x597489,null))[_0xff92('0x2b')](handleError(_0x597489,null));};exports[_0xff92('0x51')]=function(_0xbd93a4,_0x153d60){var _0x41f718=_0xbd93a4[_0xff92('0x38')][_0xff92('0x52')];return db[_0xff92('0x50')]['findAll']({'where':{'id':_0x41f718},'attributes':['id'],'include':[{'model':db[_0xff92('0x53')],'as':_0xff92('0x54'),'attributes':['id',_0xff92('0x1c'),_0xff92('0x55'),'voicePause',_0xff92('0x56')],'raw':!![]}]})[_0xff92('0x14')](function(_0x3ba60a){if(_0x3ba60a){var _0x52fd2f=_[_0xff92('0x57')](_0x3ba60a,function(_0x1ab607){var _0x5d5727=_0x1ab607[_0xff92('0x16')]({'plain':!![]});return _0x5d5727['Agents'];});return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0xbd93a4[_0xff92('0x2d')]['id']}})['then'](function(_0x3da8cf){return db['sequelize'][_0xff92('0x58')](function(_0x410873){return _0x3da8cf[_0xff92('0x51')](_0x41f718,{'transaction':_0x410873})[_0xff92('0x14')](function(){return BPromise['each'](_0x52fd2f,function(_0x264730){return db[_0xff92('0x49')][_0xff92('0x59')]({'where':{'UserId':_0x264730['id'],'ChatQueueId':_0xbd93a4[_0xff92('0x2d')]['id']},'transaction':_0x410873});});})[_0xff92('0x14')](function(){_0x52fd2f[_0xff92('0x5a')](function(_0x543ade){socket['emit'](_0xff92('0x5b'),{'UserId':_0x543ade['id'],'ChatQueueId':_0x3da8cf['id']});});});});});}})[_0xff92('0x14')](respondWithStatusCode(_0x153d60,null))[_0xff92('0x2b')](handleError(_0x153d60,null));};exports['removeTeams']=function(_0x51d691,_0x91006){return db[_0xff92('0x50')][_0xff92('0x29')]({'where':{'id':_0x51d691['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xff92('0x53')],'as':_0xff92('0x54'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x91006,null))['then'](function(_0x4c52ed){var _0x5a3c60=_[_0xff92('0x1f')](_0x4c52ed,'id');var _0x5338c6=[];var _0x379f7e=[];var _0x2eb81a=squel['select']();_0x2eb81a[_0xff92('0x5c')](_0xff92('0x5d'))[_0xff92('0x5e')](_0xff92('0x5f'),'tq')[_0xff92('0x60')](_0xff92('0x61'),'ut',_0xff92('0x62'))[_0xff92('0x26')](_0xff92('0x63'),_0x51d691['params']['id']);for(var _0x1f2aaf=0x0;_0x1f2aaf<_0x4c52ed[_0xff92('0x33')];_0x1f2aaf+=0x1){let _0x227dd1=_0x4c52ed[_0x1f2aaf];for(var _0x8ae2e1=0x0;_0x8ae2e1<_0x227dd1[_0xff92('0x54')]['length'];_0x8ae2e1+=0x1){let _0x175a1e=_0x227dd1['Agents'][_0x8ae2e1];var _0xf6f2e=_0x2eb81a['clone']();_0xf6f2e[_0xff92('0x26')]('ut.UserId\x20=\x20?',_0x175a1e['id']);_0x379f7e['push'](db[_0xff92('0x64')][_0xff92('0x28')](_0xf6f2e['toString'](),{'type':db['sequelize'][_0xff92('0x65')]['SELECT']})['then'](function(_0xb394f2){if(_0xb394f2['length']===0x1){return _0x175a1e['id'];}else{var _0x4939cd=_[_0xff92('0x66')](_[_0xff92('0x1f')](_0xb394f2,_0xff92('0x67')),function(_0x12c776){return _[_0xff92('0x68')](_0x5a3c60,_0x12c776);});if(_0x4939cd){return _0x175a1e['id'];}}}));}}return BPromise[_0xff92('0x69')](_0x379f7e)[_0xff92('0x14')](function(_0x4db6f7){_0x5338c6=_(_0x5338c6)[_0xff92('0x6a')](_0x4db6f7)[_0xff92('0x6b')]()['value']();return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x51d691[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](function(_0x4963a1){return db[_0xff92('0x64')][_0xff92('0x58')](function(_0x1cfd4d){return _0x4963a1['removeTeams'](_0x51d691[_0xff92('0x28')][_0xff92('0x52')],{'transaction':_0x1cfd4d})['then'](function(){if(!_['isEmpty'](_0x5338c6)){return _0x4963a1[_0xff92('0x6c')](_0x5338c6,{'transaction':_0x1cfd4d});}})[_0xff92('0x14')](function(){_0x5338c6[_0xff92('0x5a')](function(_0x17bd78){socket[_0xff92('0x6d')](_0xff92('0x6e'),{'UserId':_0x17bd78,'ChatQueueId':_0x4963a1['id']});});});});});});})['then'](respondWithStatusCode(_0x91006,null))[_0xff92('0x2b')](handleError(_0x91006,null));};exports[_0xff92('0x6f')]=function(_0x25903e,_0x634f4f){return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x25903e[_0xff92('0x2d')]['id']}})['then'](handleEntityNotFound(_0x634f4f,null))['then'](function(_0x4a7870){if(_0x4a7870){return _0x4a7870[_0xff92('0x6f')](_0x25903e[_0xff92('0x38')][_0xff92('0x52')],_['omit'](_0x25903e[_0xff92('0x38')],[_0xff92('0x52'),'id'])||{})[_0xff92('0x70')](function(_0x3ec1e1){for(var _0x55d155=0x0;_0x55d155<_0x25903e[_0xff92('0x38')][_0xff92('0x52')][_0xff92('0x33')];_0x55d155+=0x1){socket[_0xff92('0x6d')](_0xff92('0x5b'),{'UserId':Number(_0x25903e[_0xff92('0x38')][_0xff92('0x52')][_0x55d155]),'ChatQueueId':Number(_0x25903e[_0xff92('0x2d')]['id'])});}return _0x3ec1e1;});}})[_0xff92('0x14')](respondWithResult(_0x634f4f,null))['catch'](handleError(_0x634f4f,null));};exports['removeAgents']=function(_0x68baac,_0x5d21ab){return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x68baac['params']['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x5d21ab,null))[_0xff92('0x14')](function(_0x5b297f){if(_0x5b297f){return _0x5b297f[_0xff92('0x6c')](_0x68baac[_0xff92('0x28')]['ids'])[_0xff92('0x14')](function(){if(_[_0xff92('0x71')](_0x68baac[_0xff92('0x28')]['ids'])){for(var _0x5a498c=0x0;_0x5a498c<_0x68baac['query'][_0xff92('0x52')]['length'];_0x5a498c+=0x1){socket[_0xff92('0x6d')](_0xff92('0x6e'),{'UserId':Number(_0x68baac[_0xff92('0x28')]['ids'][_0x5a498c]),'ChatQueueId':Number(_0x68baac[_0xff92('0x2d')]['id'])});}}else{socket[_0xff92('0x6d')](_0xff92('0x6e'),{'UserId':Number(_0x68baac[_0xff92('0x28')][_0xff92('0x52')]),'ChatQueueId':Number(_0x68baac['params']['id'])});}});}})[_0xff92('0x14')](respondWithStatusCode(_0x5d21ab,null))[_0xff92('0x2b')](handleError(_0x5d21ab,null));};exports[_0xff92('0x72')]=function(_0x2c6fbf,_0x3e853d){var _0x55c39f={};var _0xfd12e6={};var _0x2fbed2;var _0x1d5fcf;return db[_0xff92('0x20')][_0xff92('0x40')]({'where':{'id':_0x2c6fbf[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x3e853d,null))['then'](function(_0x35ca81){if(_0x35ca81){_0x2fbed2=_0x35ca81;_0xfd12e6[_0xff92('0x2e')]=_[_0xff92('0x2f')](db[_0xff92('0x53')][_0xff92('0x21')]);_0xfd12e6[_0xff92('0x28')]=_['keys'](_0x2c6fbf['query']);_0xfd12e6[_0xff92('0x41')]=_[_0xff92('0x30')](_0xfd12e6[_0xff92('0x2e')],_0xfd12e6[_0xff92('0x28')]);_0x55c39f[_0xff92('0x32')]=_['intersection'](_0xfd12e6['model'],qs[_0xff92('0x31')](_0x2c6fbf[_0xff92('0x28')][_0xff92('0x31')]));_0x55c39f[_0xff92('0x32')]=_0x55c39f[_0xff92('0x32')][_0xff92('0x33')]?_0x55c39f[_0xff92('0x32')]:_0xfd12e6[_0xff92('0x2e')];_0x55c39f['order']=qs['sort'](_0x2c6fbf[_0xff92('0x28')]['sort']);_0x55c39f[_0xff92('0x26')]=qs[_0xff92('0x41')](_[_0xff92('0x46')](_0x2c6fbf[_0xff92('0x28')],_0xfd12e6[_0xff92('0x41')]));if(_0x2c6fbf[_0xff92('0x28')][_0xff92('0x48')]){_0x55c39f[_0xff92('0x26')]=_[_0xff92('0x34')](_0x55c39f[_0xff92('0x26')],{'$or':_[_0xff92('0x1f')](_0x55c39f[_0xff92('0x32')],function(_0x4c1b5f){var _0x57ef54={};_0x57ef54[_0x4c1b5f]={'$like':'%'+_0x2c6fbf[_0xff92('0x28')][_0xff92('0x48')]+'%'};return _0x57ef54;})});}_0x55c39f=_['merge']({},_0x55c39f,_0x2c6fbf[_0xff92('0x35')]);return _0x2fbed2[_0xff92('0x72')](_0x55c39f);}})[_0xff92('0x14')](function(_0x543f13){if(_0x543f13){_0x1d5fcf=_0x543f13[_0xff92('0x33')];if(!_0x2c6fbf[_0xff92('0x28')][_0xff92('0x42')](_0xff92('0x43'))){_0x55c39f[_0xff92('0xf')]=qs['limit'](_0x2c6fbf[_0xff92('0x28')][_0xff92('0xf')]);_0x55c39f['offset']=qs[_0xff92('0xd')](_0x2c6fbf[_0xff92('0x28')][_0xff92('0xd')]);}return _0x2fbed2[_0xff92('0x72')](_0x55c39f);}})[_0xff92('0x14')](function(_0x2447dc){if(_0x2447dc){return _0x2447dc?{'count':_0x1d5fcf,'rows':_0x2447dc}:null;}})['then'](respondWithResult(_0x3e853d,null))[_0xff92('0x2b')](handleError(_0x3e853d,null));};
\ No newline at end of file
+var _0xa578=['chatPause','createdAt','getTeams','Team','length','sort','addTeams','User','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','value','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','rows','catch','show','model','keys','filters','intersection','attributes','fields','query','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','pick','ChatQueueId','filter','findAll','findAndCountAll','agent','updatedAt','SIP'];(function(_0x3a7f15,_0x48ac0d){var _0x3b7ec9=function(_0x356ad3){while(--_0x356ad3){_0x3a7f15['push'](_0x3a7f15['shift']());}};_0x3b7ec9(++_0x48ac0d);}(_0xa578,0x19d));var _0x8a57=function(_0x47df4c,_0x55115e){_0x47df4c=_0x47df4c-0x0;var _0x3e3610=_0xa578[_0x47df4c];return _0x3e3610;};'use strict';var BPromise=require(_0x8a57('0x0'));var util=require(_0x8a57('0x1'));var _=require(_0x8a57('0x2'));var squel=require(_0x8a57('0x3'));var Redis=require(_0x8a57('0x4'));var qs=require(_0x8a57('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x8a57('0x6'));var db=require(_0x8a57('0x7'))['db'];config[_0x8a57('0x8')]=_['defaults'](config['redis'],{'host':_0x8a57('0x9'),'port':0x18eb});var socket=require(_0x8a57('0xa'))(new Redis(config[_0x8a57('0x8')]));require('./chatQueue.socket')[_0x8a57('0xb')](socket);function respondWithStatusCode(_0x37d3ea,_0x123346){_0x123346=_0x123346||0xcc;return function(_0x4a7841){if(_0x4a7841){return _0x37d3ea[_0x8a57('0xc')](_0x123346);}return _0x37d3ea[_0x8a57('0xd')](_0x123346)[_0x8a57('0xe')]();};}function respondWithResult(_0xd8efb7,_0xe7623f){_0xe7623f=_0xe7623f||0xc8;return function(_0x1437d6){if(_0x1437d6){return _0xd8efb7[_0x8a57('0xd')](_0xe7623f)['json'](_0x1437d6);}};}function respondWithFilteredResult(_0x28d411,_0xe2b24f){return function(_0x326c7c){if(_0x326c7c){var _0x28c2e2=typeof _0xe2b24f[_0x8a57('0xf')]===_0x8a57('0x10')&&typeof _0xe2b24f[_0x8a57('0x11')]===_0x8a57('0x10');var _0x38ec1d=_0x326c7c[_0x8a57('0x12')];var _0x661cfb=_0x28c2e2?0x0:_0xe2b24f['offset'];var _0x31b5af=_0x28c2e2?_0x326c7c[_0x8a57('0x12')]:_0xe2b24f[_0x8a57('0xf')]+_0xe2b24f['limit'];var _0x3f91c9;if(_0x31b5af>=_0x38ec1d){_0x31b5af=_0x38ec1d;_0x3f91c9=0xc8;}else{_0x3f91c9=0xce;}_0x28d411[_0x8a57('0xd')](_0x3f91c9);return _0x28d411['set'](_0x8a57('0x13'),_0x661cfb+'-'+_0x31b5af+'/'+_0x38ec1d)[_0x8a57('0x14')](_0x326c7c);}return null;};}function saveUpdates(_0x13eb4f){return function(_0x1415f3){if(_0x1415f3){return _0x1415f3[_0x8a57('0x15')](_0x13eb4f)[_0x8a57('0x16')](function(_0x430191){return _0x430191;});}return null;};}function removeEntity(_0x4356a5){return function(_0x2a137c){if(_0x2a137c){return _0x2a137c[_0x8a57('0x17')]()[_0x8a57('0x16')](function(){var _0x52e899=_0x2a137c[_0x8a57('0x18')]({'plain':!![]});var _0xb409b4=_0x8a57('0x19');return db[_0x8a57('0x1a')]['destroy']({'where':{'type':_0xb409b4,'resourceId':_0x52e899['id']}})[_0x8a57('0x16')](function(){return _0x2a137c;});})[_0x8a57('0x16')](function(){_0x4356a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x75c993){return function(_0x2b9f92){if(!_0x2b9f92){_0x75c993[_0x8a57('0xc')](0x194);}return _0x2b9f92;};}function handleError(_0x395588,_0x61eecb){_0x61eecb=_0x61eecb||0x1f4;return function(_0x18d8d5){logger[_0x8a57('0x1b')](_0x18d8d5[_0x8a57('0x1c')]);if(_0x18d8d5['name']){delete _0x18d8d5[_0x8a57('0x1d')];}_0x395588[_0x8a57('0xd')](_0x61eecb)[_0x8a57('0x1e')](_0x18d8d5);};}exports[_0x8a57('0x1f')]=function(_0x3313fb,_0x3fe7b4){var _0x1d7c6e={};var _0x3c7a99={'count':0x0,'rows':[]};var _0x6c35de=_[_0x8a57('0x20')](db[_0x8a57('0x21')][_0x8a57('0x22')],function(_0x5b5b38){return{'name':_0x5b5b38[_0x8a57('0x23')],'type':_0x5b5b38['type'][_0x8a57('0x24')]};});_0x1d7c6e=qs[_0x8a57('0x25')](_0x6c35de,_0x3313fb);var _0x51a971={'where':_0x1d7c6e[_0x8a57('0x26')]};return db[_0x8a57('0x21')][_0x8a57('0x12')](_0x51a971)[_0x8a57('0x16')](function(_0x2750e1){_0x3c7a99[_0x8a57('0x12')]=_0x2750e1;_0x1d7c6e[_0x8a57('0x27')]=qs['include'](_0x3313fb['query']);return db[_0x8a57('0x21')]['findAll'](_0x1d7c6e);})[_0x8a57('0x16')](function(_0x4e63e8){_0x3c7a99[_0x8a57('0x28')]=_0x4e63e8;return _0x3c7a99;})[_0x8a57('0x16')](respondWithFilteredResult(_0x3fe7b4,_0x1d7c6e))[_0x8a57('0x29')](handleError(_0x3fe7b4,null));};exports[_0x8a57('0x2a')]=function(_0xab4948,_0x454f79){var _0x1d9f65={'raw':!![],'where':{'id':_0xab4948['params']['id']}},_0x38f081={};_0x38f081[_0x8a57('0x2b')]=_['keys'](db[_0x8a57('0x21')][_0x8a57('0x22')]);_0x38f081['query']=_[_0x8a57('0x2c')](_0xab4948['query']);_0x38f081[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x38f081['model'],_0x38f081['query']);_0x1d9f65[_0x8a57('0x2f')]=_['intersection'](_0x38f081[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0xab4948['query']['fields']));_0x1d9f65['attributes']=_0x1d9f65[_0x8a57('0x2f')]['length']?_0x1d9f65['attributes']:_0x38f081['model'];if(_0xab4948[_0x8a57('0x31')]['includeAll']){_0x1d9f65[_0x8a57('0x27')]=[{'all':!![]}];}_0x1d9f65=_[_0x8a57('0x32')]({},_0x1d9f65,_0xab4948[_0x8a57('0x33')]);return db[_0x8a57('0x21')][_0x8a57('0x34')](_0x1d9f65)[_0x8a57('0x16')](handleEntityNotFound(_0x454f79,null))[_0x8a57('0x16')](respondWithResult(_0x454f79,null))['catch'](handleError(_0x454f79,null));};exports[_0x8a57('0x35')]=function(_0x21d01b,_0x4fec2b){return db[_0x8a57('0x21')][_0x8a57('0x35')](_0x21d01b[_0x8a57('0x36')],{})[_0x8a57('0x16')](function(_0x5d2256){var _0x316d6a=_0x21d01b[_0x8a57('0x37')]['get']({'plain':!![]});if(!_0x316d6a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x316d6a[_0x8a57('0x38')]===_0x8a57('0x37')){var _0x17ad4d=_0x5d2256[_0x8a57('0x18')]({'plain':!![]});var _0x1b805e=_0x8a57('0x19');return db[_0x8a57('0x39')]['find']({'where':{'name':_0x1b805e,'userProfileId':_0x316d6a[_0x8a57('0x3a')]},'raw':!![]})[_0x8a57('0x16')](function(_0x52e9d1){if(_0x52e9d1&&_0x52e9d1[_0x8a57('0x3b')]===0x0){return db[_0x8a57('0x1a')]['create']({'name':_0x17ad4d[_0x8a57('0x1d')],'resourceId':_0x17ad4d['id'],'type':_0x52e9d1[_0x8a57('0x1d')],'sectionId':_0x52e9d1['id']},{})[_0x8a57('0x16')](function(){return _0x5d2256;});}else{return _0x5d2256;}})['catch'](function(_0x26e0f5){logger[_0x8a57('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26e0f5);throw _0x26e0f5;});}return _0x5d2256;})[_0x8a57('0x16')](respondWithResult(_0x4fec2b,0xc9))[_0x8a57('0x29')](handleError(_0x4fec2b,null));};exports[_0x8a57('0x15')]=function(_0x50ecfc,_0x24d555){if(_0x50ecfc[_0x8a57('0x36')]['id']){delete _0x50ecfc['body']['id'];}return db[_0x8a57('0x21')][_0x8a57('0x34')]({'where':{'id':_0x50ecfc[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x24d555,null))['then'](saveUpdates(_0x50ecfc[_0x8a57('0x36')],null))[_0x8a57('0x16')](respondWithResult(_0x24d555,null))[_0x8a57('0x29')](handleError(_0x24d555,null));};exports['destroy']=function(_0x34f799,_0x4b5004){return db[_0x8a57('0x21')][_0x8a57('0x34')]({'where':{'id':_0x34f799[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x4b5004,null))[_0x8a57('0x16')](removeEntity(_0x4b5004,null))[_0x8a57('0x29')](handleError(_0x4b5004,null));};exports['describe']=function(_0x2b95fc,_0x5c2805){return db[_0x8a57('0x21')]['describe']()[_0x8a57('0x16')](respondWithResult(_0x5c2805,null))[_0x8a57('0x29')](handleError(_0x5c2805,null));};exports[_0x8a57('0x3d')]=function(_0x332abc,_0x21d62c){var _0xe0d270={'raw':!![],'where':{}},_0x28b472={},_0x27e44d;return db['ChatQueue'][_0x8a57('0x3e')]({'where':{'id':_0x332abc[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x21d62c,null))[_0x8a57('0x16')](function(_0x5921c8){if(_0x5921c8){_0x27e44d=_0x5921c8['get']({'plain':!![]});_0x28b472[_0x8a57('0x2b')]=_['keys'](db[_0x8a57('0x3f')][_0x8a57('0x22')]);_0x28b472[_0x8a57('0x31')]=_[_0x8a57('0x2c')](_0x332abc['query']);_0x28b472[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x28b472['model'],_0x28b472['query']);_0xe0d270['attributes']=_[_0x8a57('0x2e')](_0x28b472[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0x332abc[_0x8a57('0x31')]['fields']));_0xe0d270['attributes']=_0xe0d270[_0x8a57('0x2f')]['length']?_0xe0d270['attributes']:_0x28b472[_0x8a57('0x2b')];if(!_0x332abc[_0x8a57('0x31')][_0x8a57('0x40')](_0x8a57('0x41'))){_0xe0d270[_0x8a57('0x11')]=qs[_0x8a57('0x11')](_0x332abc[_0x8a57('0x31')][_0x8a57('0x11')]);_0xe0d270[_0x8a57('0xf')]=qs[_0x8a57('0xf')](_0x332abc[_0x8a57('0x31')][_0x8a57('0xf')]);}_0xe0d270[_0x8a57('0x42')]=qs['sort'](_0x332abc[_0x8a57('0x31')]['sort']);_0xe0d270[_0x8a57('0x26')]=qs[_0x8a57('0x2d')](_[_0x8a57('0x43')](_0x332abc[_0x8a57('0x31')],_0x28b472[_0x8a57('0x2d')]));_0xe0d270[_0x8a57('0x26')][_0x8a57('0x44')]=_0x5921c8['id'];if(_0x332abc['query'][_0x8a57('0x45')]){_0xe0d270['where']=_[_0x8a57('0x32')](_0xe0d270[_0x8a57('0x26')],{'$or':_['map'](_0xe0d270[_0x8a57('0x2f')],function(_0x27689b){var _0x3eacc1={};_0x3eacc1[_0x27689b]={'$like':'%'+_0x332abc['query'][_0x8a57('0x45')]+'%'};return _0x3eacc1;})});}_0xe0d270=_['merge']({},_0xe0d270,_0x332abc[_0x8a57('0x33')]);return db[_0x8a57('0x3f')][_0x8a57('0x46')](_0xe0d270);}})[_0x8a57('0x16')](function(_0x24465f){if(_0x24465f){return db['User'][_0x8a57('0x47')]({'where':{'id':_[_0x8a57('0x20')](_0x24465f,'UserId'),'role':_0x8a57('0x48')},'attributes':['id',_0x8a57('0x1d'),'chatPause',_0x8a57('0x49'),'createdAt']});}})[_0x8a57('0x16')](function(_0x5ac7b7){if(_0x5ac7b7){return{'count':_0x5ac7b7[_0x8a57('0x12')],'rows':_[_0x8a57('0x20')](_0x5ac7b7['rows'],function(_0xcd4da5){return{'membername':_0xcd4da5['name'],'UserId':_0xcd4da5['id'],'queue_name':_0x27e44d[_0x8a57('0x1d')],'ChatQueueId':_0x27e44d['id'],'interface':util['format']('%s/%s',_0x8a57('0x4a'),_0xcd4da5[_0x8a57('0x1d')]),'penalty':0x0,'paused':_0xcd4da5[_0x8a57('0x4b')],'createdAt':_0xcd4da5[_0x8a57('0x4c')],'updatedAt':_0xcd4da5[_0x8a57('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8a57('0x16')](respondWithFilteredResult(_0x21d62c,_0xe0d270))['catch'](handleError(_0x21d62c,null));};exports[_0x8a57('0x4d')]=function(_0x49c0c7,_0x15bac){var _0x48b8e5={};var _0x15db5f={};var _0x37279b;var _0x513efc;return db[_0x8a57('0x21')]['findOne']({'where':{'id':_0x49c0c7['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x15bac,null))[_0x8a57('0x16')](function(_0x51bb88){if(_0x51bb88){_0x37279b=_0x51bb88;_0x15db5f[_0x8a57('0x2b')]=_[_0x8a57('0x2c')](db[_0x8a57('0x4e')]['rawAttributes']);_0x15db5f[_0x8a57('0x31')]=_[_0x8a57('0x2c')](_0x49c0c7[_0x8a57('0x31')]);_0x15db5f[_0x8a57('0x2d')]=_['intersection'](_0x15db5f['model'],_0x15db5f[_0x8a57('0x31')]);_0x48b8e5['attributes']=_[_0x8a57('0x2e')](_0x15db5f['model'],qs[_0x8a57('0x30')](_0x49c0c7['query'][_0x8a57('0x30')]));_0x48b8e5['attributes']=_0x48b8e5[_0x8a57('0x2f')][_0x8a57('0x4f')]?_0x48b8e5[_0x8a57('0x2f')]:_0x15db5f[_0x8a57('0x2b')];_0x48b8e5[_0x8a57('0x42')]=qs[_0x8a57('0x50')](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x50')]);_0x48b8e5[_0x8a57('0x26')]=qs[_0x8a57('0x2d')](_['pick'](_0x49c0c7[_0x8a57('0x31')],_0x15db5f[_0x8a57('0x2d')]));if(_0x49c0c7[_0x8a57('0x31')]['filter']){_0x48b8e5[_0x8a57('0x26')]=_[_0x8a57('0x32')](_0x48b8e5[_0x8a57('0x26')],{'$or':_[_0x8a57('0x20')](_0x48b8e5[_0x8a57('0x2f')],function(_0x1adf82){var _0x3e9507={};_0x3e9507[_0x1adf82]={'$like':'%'+_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x45')]+'%'};return _0x3e9507;})});}_0x48b8e5=_[_0x8a57('0x32')]({},_0x48b8e5,_0x49c0c7[_0x8a57('0x33')]);return _0x37279b[_0x8a57('0x4d')](_0x48b8e5);}})['then'](function(_0x2daffb){if(_0x2daffb){_0x513efc=_0x2daffb['length'];if(!_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x40')]('nolimit')){_0x48b8e5[_0x8a57('0x11')]=qs['limit'](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x11')]);_0x48b8e5[_0x8a57('0xf')]=qs['offset'](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0xf')]);}return _0x37279b['getTeams'](_0x48b8e5);}})[_0x8a57('0x16')](function(_0xec5a02){if(_0xec5a02){return _0xec5a02?{'count':_0x513efc,'rows':_0xec5a02}:null;}})[_0x8a57('0x16')](respondWithResult(_0x15bac,null))[_0x8a57('0x29')](handleError(_0x15bac,null));};exports[_0x8a57('0x51')]=function(_0x4424db,_0x4c488b){var _0x496a2a=_0x4424db[_0x8a57('0x36')]['ids'];return db['Team'][_0x8a57('0x46')]({'where':{'id':_0x496a2a},'attributes':['id'],'include':[{'model':db[_0x8a57('0x52')],'as':'Agents','attributes':['id',_0x8a57('0x1d'),_0x8a57('0x53'),_0x8a57('0x54'),_0x8a57('0x55')],'raw':!![]}]})['then'](function(_0x41ef34){if(_0x41ef34){var _0x3ceb9c=_[_0x8a57('0x56')](_0x41ef34,function(_0xe84a6b){var _0x22c6e8=_0xe84a6b[_0x8a57('0x18')]({'plain':!![]});return _0x22c6e8[_0x8a57('0x57')];});return db['ChatQueue'][_0x8a57('0x34')]({'where':{'id':_0x4424db[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](function(_0x22622a){return db['sequelize'][_0x8a57('0x58')](function(_0x5baa0b){return _0x22622a[_0x8a57('0x51')](_0x496a2a,{'transaction':_0x5baa0b})['then'](function(){return BPromise[_0x8a57('0x59')](_0x3ceb9c,function(_0x4de154){return db[_0x8a57('0x3f')][_0x8a57('0x5a')]({'where':{'UserId':_0x4de154['id'],'ChatQueueId':_0x4424db['params']['id']},'transaction':_0x5baa0b});});})['then'](function(){_0x3ceb9c[_0x8a57('0x5b')](function(_0x451d22){socket[_0x8a57('0x5c')](_0x8a57('0x5d'),{'UserId':_0x451d22['id'],'ChatQueueId':_0x22622a['id']});});});});});}})[_0x8a57('0x16')](respondWithStatusCode(_0x4c488b,null))['catch'](handleError(_0x4c488b,null));};exports[_0x8a57('0x5e')]=function(_0x3c520d,_0x232823){return db[_0x8a57('0x4e')]['findAll']({'where':{'id':_0x3c520d['query'][_0x8a57('0x5f')]},'attributes':['id'],'include':[{'model':db[_0x8a57('0x52')],'as':_0x8a57('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x232823,null))[_0x8a57('0x16')](function(_0x2e73ae){var _0x107f17=_[_0x8a57('0x20')](_0x2e73ae,'id');var _0x40b548=[];var _0x185dc6=[];var _0x20beed=squel[_0x8a57('0x60')]();_0x20beed[_0x8a57('0x61')](_0x8a57('0x62'))[_0x8a57('0x63')](_0x8a57('0x64'),'tq')[_0x8a57('0x65')]('user_has_teams','ut',_0x8a57('0x66'))[_0x8a57('0x26')](_0x8a57('0x67'),_0x3c520d['params']['id']);for(var _0x56a2ed=0x0;_0x56a2ed<_0x2e73ae[_0x8a57('0x4f')];_0x56a2ed+=0x1){let _0x21b9f4=_0x2e73ae[_0x56a2ed];for(var _0x1a2918=0x0;_0x1a2918<_0x21b9f4[_0x8a57('0x57')][_0x8a57('0x4f')];_0x1a2918+=0x1){let _0x12c3e3=_0x21b9f4['Agents'][_0x1a2918];var _0x37bc14=_0x20beed[_0x8a57('0x68')]();_0x37bc14['where'](_0x8a57('0x69'),_0x12c3e3['id']);_0x185dc6[_0x8a57('0x6a')](db['sequelize'][_0x8a57('0x31')](_0x37bc14[_0x8a57('0x6b')](),{'type':db[_0x8a57('0x6c')][_0x8a57('0x6d')][_0x8a57('0x6e')]})['then'](function(_0x3caecd){if(_0x3caecd[_0x8a57('0x4f')]===0x1){return _0x12c3e3['id'];}else{var _0x2387da=_[_0x8a57('0x6f')](_['map'](_0x3caecd,'TeamId'),function(_0x50671d){return _[_0x8a57('0x70')](_0x107f17,_0x50671d);});if(_0x2387da){return _0x12c3e3['id'];}}}));}}return BPromise[_0x8a57('0x71')](_0x185dc6)[_0x8a57('0x16')](function(_0xdb5ae){_0x40b548=_(_0x40b548)[_0x8a57('0x72')](_0xdb5ae)['compact']()[_0x8a57('0x73')]();return db[_0x8a57('0x21')]['find']({'where':{'id':_0x3c520d[_0x8a57('0x3c')]['id']}})['then'](function(_0x4703f3){return db[_0x8a57('0x6c')][_0x8a57('0x58')](function(_0x462bc6){return _0x4703f3['removeTeams'](_0x3c520d[_0x8a57('0x31')]['ids'],{'transaction':_0x462bc6})[_0x8a57('0x16')](function(){if(!_['isEmpty'](_0x40b548)){return _0x4703f3[_0x8a57('0x74')](_0x40b548,{'transaction':_0x462bc6});}})[_0x8a57('0x16')](function(){_0x40b548['forEach'](function(_0x36ebff){socket['emit']('userChatQueue:remove',{'UserId':_0x36ebff,'ChatQueueId':_0x4703f3['id']});});});});});});})[_0x8a57('0x16')](respondWithStatusCode(_0x232823,null))['catch'](handleError(_0x232823,null));};exports[_0x8a57('0x75')]=function(_0xc1d670,_0x42efe3){return db[_0x8a57('0x21')]['find']({'where':{'id':_0xc1d670['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x42efe3,null))[_0x8a57('0x16')](function(_0x5758f5){if(_0x5758f5){return _0x5758f5[_0x8a57('0x75')](_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')],_[_0x8a57('0x76')](_0xc1d670[_0x8a57('0x36')],[_0x8a57('0x5f'),'id'])||{})['spread'](function(_0x61d6a3){for(var _0xb40c58=0x0;_0xb40c58<_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')]['length'];_0xb40c58+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')][_0xb40c58]),'ChatQueueId':Number(_0xc1d670[_0x8a57('0x3c')]['id'])});}return _0x61d6a3;});}})[_0x8a57('0x16')](respondWithResult(_0x42efe3,null))[_0x8a57('0x29')](handleError(_0x42efe3,null));};exports['removeAgents']=function(_0x5619a6,_0xe89474){return db['ChatQueue']['find']({'where':{'id':_0x5619a6[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0xe89474,null))['then'](function(_0x395599){if(_0x395599){return _0x395599[_0x8a57('0x74')](_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')])[_0x8a57('0x16')](function(){if(_[_0x8a57('0x77')](_0x5619a6[_0x8a57('0x31')]['ids'])){for(var _0x7b99f4=0x0;_0x7b99f4<_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')][_0x8a57('0x4f')];_0x7b99f4+=0x1){socket[_0x8a57('0x5c')](_0x8a57('0x78'),{'UserId':Number(_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')][_0x7b99f4]),'ChatQueueId':Number(_0x5619a6['params']['id'])});}}else{socket[_0x8a57('0x5c')](_0x8a57('0x78'),{'UserId':Number(_0x5619a6['query'][_0x8a57('0x5f')]),'ChatQueueId':Number(_0x5619a6[_0x8a57('0x3c')]['id'])});}});}})[_0x8a57('0x16')](respondWithStatusCode(_0xe89474,null))[_0x8a57('0x29')](handleError(_0xe89474,null));};exports[_0x8a57('0x79')]=function(_0x444598,_0x402e37){var _0x1a87d6={};var _0x334309={};var _0x10073f;var _0x2b6071;return db[_0x8a57('0x21')][_0x8a57('0x3e')]({'where':{'id':_0x444598['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x402e37,null))[_0x8a57('0x16')](function(_0xdd34bb){if(_0xdd34bb){_0x10073f=_0xdd34bb;_0x334309[_0x8a57('0x2b')]=_[_0x8a57('0x2c')](db[_0x8a57('0x52')]['rawAttributes']);_0x334309[_0x8a57('0x31')]=_['keys'](_0x444598['query']);_0x334309[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x334309[_0x8a57('0x2b')],_0x334309[_0x8a57('0x31')]);_0x1a87d6[_0x8a57('0x2f')]=_[_0x8a57('0x2e')](_0x334309[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0x444598[_0x8a57('0x31')]['fields']));_0x1a87d6[_0x8a57('0x2f')]=_0x1a87d6['attributes'][_0x8a57('0x4f')]?_0x1a87d6['attributes']:_0x334309[_0x8a57('0x2b')];_0x1a87d6[_0x8a57('0x42')]=qs['sort'](_0x444598[_0x8a57('0x31')][_0x8a57('0x50')]);_0x1a87d6['where']=qs[_0x8a57('0x2d')](_[_0x8a57('0x43')](_0x444598[_0x8a57('0x31')],_0x334309[_0x8a57('0x2d')]));if(_0x444598[_0x8a57('0x31')][_0x8a57('0x45')]){_0x1a87d6['where']=_[_0x8a57('0x32')](_0x1a87d6[_0x8a57('0x26')],{'$or':_[_0x8a57('0x20')](_0x1a87d6[_0x8a57('0x2f')],function(_0x242792){var _0x2eadd8={};_0x2eadd8[_0x242792]={'$like':'%'+_0x444598[_0x8a57('0x31')]['filter']+'%'};return _0x2eadd8;})});}_0x1a87d6=_[_0x8a57('0x32')]({},_0x1a87d6,_0x444598['options']);return _0x10073f[_0x8a57('0x79')](_0x1a87d6);}})[_0x8a57('0x16')](function(_0x21af6b){if(_0x21af6b){_0x2b6071=_0x21af6b[_0x8a57('0x4f')];if(!_0x444598[_0x8a57('0x31')][_0x8a57('0x40')](_0x8a57('0x41'))){_0x1a87d6[_0x8a57('0x11')]=qs[_0x8a57('0x11')](_0x444598[_0x8a57('0x31')][_0x8a57('0x11')]);_0x1a87d6[_0x8a57('0xf')]=qs[_0x8a57('0xf')](_0x444598[_0x8a57('0x31')][_0x8a57('0xf')]);}return _0x10073f['getAgents'](_0x1a87d6);}})[_0x8a57('0x16')](function(_0x2a4c6b){if(_0x2a4c6b){return _0x2a4c6b?{'count':_0x2b6071,'rows':_0x2a4c6b}:null;}})[_0x8a57('0x16')](respondWithResult(_0x402e37,null))[_0x8a57('0x29')](handleError(_0x402e37,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e985419..6f9a340 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 _0xcf13=['exports','../../mysqldb','ChatQueue','save','emit','hook'];(function(_0x59e8ed,_0x3c82a1){var _0x3dd124=function(_0x3b9194){while(--_0x3b9194){_0x59e8ed['push'](_0x59e8ed['shift']());}};_0x3dd124(++_0x3c82a1);}(_0xcf13,0x1b7));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x3cf1('0x0'))['db'][_0x3cf1('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3cf1('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26d776){return function(_0x34cd84,_0x20c5cd,_0x59a857){ChatQueueEvents['emit'](_0x26d776+':'+_0x34cd84['id'],_0x34cd84);ChatQueueEvents[_0x3cf1('0x3')](_0x26d776,_0x34cd84);_0x59a857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x3cf1('0x4')](e,emitEvent(event));}}module[_0x3cf1('0x5')]=ChatQueueEvents;
\ No newline at end of file
+var _0xccfc=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5a3ed8,_0x4cf865){var _0x1a894c=function(_0x1d179c){while(--_0x1d179c){_0x5a3ed8['push'](_0x5a3ed8['shift']());}};_0x1a894c(++_0x4cf865);}(_0xccfc,0x19a));var _0xcccf=function(_0x15f0ae,_0x2c4264){_0x15f0ae=_0x15f0ae-0x0;var _0xf4842=_0xccfc[_0x15f0ae];return _0xf4842;};'use strict';var EventEmitter=require(_0xcccf('0x0'));var ChatQueue=require(_0xcccf('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcccf('0x2')](0x0);var events={'afterCreate':_0xcccf('0x3'),'afterUpdate':_0xcccf('0x4'),'afterDestroy':_0xcccf('0x5')};function emitEvent(_0x431940){return function(_0x7425b5,_0x56ca5b,_0x2685a8){ChatQueueEvents['emit'](_0x431940+':'+_0x7425b5['id'],_0x7425b5);ChatQueueEvents['emit'](_0x431940,_0x7425b5);_0x2685a8(null);};}for(var e in events){if(events[_0xcccf('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xcccf('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index d277a7e..628c77c 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 _0x91a6=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./chatQueue.attributes','exports','ChatQueue','chat_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x91a6,0x1ef));var _0x691a=function(_0x544d66,_0x1738b6){_0x544d66=_0x544d66-0x0;var _0x1b6800=_0x91a6[_0x544d66];return _0x1b6800;};'use strict';var _=require(_0x691a('0x0'));var util=require(_0x691a('0x1'));var logger=require(_0x691a('0x2'))(_0x691a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x691a('0x4'));var fs=require('fs');var path=require(_0x691a('0x5'));var rimraf=require(_0x691a('0x6'));var config=require('../../config/environment');var attributes=require(_0x691a('0x7'));module[_0x691a('0x8')]=function(_0x406f39,_0x4cb2a8){return _0x406f39['define'](_0x691a('0x9'),attributes,{'tableName':_0x691a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x237c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues'];(function(_0x1a91f0,_0x11e203){var _0x12f862=function(_0x48983c){while(--_0x48983c){_0x1a91f0['push'](_0x1a91f0['shift']());}};_0x12f862(++_0x11e203);}(_0x237c,0x179));var _0xc237=function(_0x3eeaa9,_0x18f2c1){_0x3eeaa9=_0x3eeaa9-0x0;var _0x40dfde=_0x237c[_0x3eeaa9];return _0x40dfde;};'use strict';var _=require(_0xc237('0x0'));var util=require(_0xc237('0x1'));var logger=require(_0xc237('0x2'))(_0xc237('0x3'));var moment=require('moment');var BPromise=require(_0xc237('0x4'));var rp=require(_0xc237('0x5'));var fs=require('fs');var path=require(_0xc237('0x6'));var rimraf=require(_0xc237('0x7'));var config=require(_0xc237('0x8'));var attributes=require('./chatQueue.attributes');module[_0xc237('0x9')]=function(_0x133f01,_0x17d044){return _0x133f01[_0xc237('0xa')](_0xc237('0xb'),attributes,{'tableName':_0xc237('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 162ebd2..33d75e8 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 _0x2cf5=['model','stringify','catch','find','ShowChatQueue','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map'];(function(_0x456bd3,_0x58161b){var _0x5c5ba1=function(_0x1efab2){while(--_0x1efab2){_0x456bd3['push'](_0x456bd3['shift']());}};_0x5c5ba1(++_0x58161b);}(_0x2cf5,0x19f));var _0x52cf=function(_0x44103b,_0xbfa4fb){_0x44103b=_0x44103b-0x0;var _0x5dba51=_0x2cf5[_0x44103b];return _0x5dba51;};'use strict';var _=require(_0x52cf('0x0'));var util=require(_0x52cf('0x1'));var moment=require('moment');var BPromise=require(_0x52cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52cf('0x3'));var db=require(_0x52cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x52cf('0x5'));var config=require(_0x52cf('0x6'));var jayson=require(_0x52cf('0x7'));var client=jayson[_0x52cf('0x8')][_0x52cf('0x9')]({'port':0x232a});config[_0x52cf('0xa')]=_[_0x52cf('0xb')](config[_0x52cf('0xa')],{'host':_0x52cf('0xc'),'port':0x18eb});var socket=require(_0x52cf('0xd'))(new Redis(config[_0x52cf('0xa')]));require('./chatQueue.socket')[_0x52cf('0xe')](socket);function respondWithRpcPromise(_0x201710,_0x2b9974,_0x120dab){return new BPromise(function(_0x4e5b19,_0xadb2a6){return client[_0x52cf('0xf')](_0x201710,_0x120dab)[_0x52cf('0x10')](function(_0x54806d){logger[_0x52cf('0x11')](_0x52cf('0x12'),_0x2b9974,_0x52cf('0x13'));logger[_0x52cf('0x14')](_0x52cf('0x15'),_0x2b9974,_0x52cf('0x13'),JSON['stringify'](_0x54806d));if(_0x54806d['error']){if(_0x54806d[_0x52cf('0x16')][_0x52cf('0x17')]===0x1f4){logger[_0x52cf('0x16')](_0x52cf('0x12'),_0x2b9974,_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);return _0xadb2a6(_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);}logger['error'](_0x52cf('0x12'),_0x2b9974,_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);return _0x4e5b19(_0x54806d['error'][_0x52cf('0x18')]);}else{logger['info'](_0x52cf('0x12'),_0x2b9974,_0x52cf('0x13'));_0x4e5b19(_0x54806d[_0x52cf('0x19')][_0x52cf('0x18')]);}})['catch'](function(_0x229595){logger[_0x52cf('0x16')](_0x52cf('0x12'),_0x2b9974,_0x229595);_0xadb2a6(_0x229595);});});}exports[_0x52cf('0x1a')]=function(_0x4ab08f){var _0x326311=this;return new Promise(function(_0x5f5200,_0x1d9fdd){return db[_0x52cf('0x1b')][_0x52cf('0x1c')]({'raw':_0x4ab08f['options']?_0x4ab08f['options'][_0x52cf('0x1d')]===undefined?!![]:![]:!![],'where':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x1f')]||null:null,'attributes':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x20')]||null:null,'limit':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x21')]||null:null,'include':_0x4ab08f['options']?_0x4ab08f['options'][_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x22')],function(_0x499ac7){return{'model':db[_0x499ac7['model']],'as':_0x499ac7['as'],'attributes':_0x499ac7[_0x52cf('0x20')],'include':_0x499ac7[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x499ac7[_0x52cf('0x22')],function(_0x42132c){return{'model':db[_0x42132c[_0x52cf('0x24')]],'as':_0x42132c['as'],'attributes':_0x42132c[_0x52cf('0x20')],'include':_0x42132c[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x42132c['include'],function(_0x4796b5){return{'model':db[_0x4796b5[_0x52cf('0x24')]],'as':_0x4796b5['as'],'attributes':_0x4796b5[_0x52cf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x52cf('0x10')](function(_0x1e1318){logger['info'](_0x52cf('0x1a'),_0x4ab08f);logger[_0x52cf('0x14')](_0x52cf('0x1a'),_0x4ab08f,JSON[_0x52cf('0x25')](_0x1e1318));_0x5f5200(_0x1e1318);})[_0x52cf('0x26')](function(_0x1ed92a){logger['error'](_0x52cf('0x1a'),_0x1ed92a[_0x52cf('0x18')],_0x4ab08f);_0x1d9fdd(_0x326311[_0x52cf('0x16')](0x1f4,_0x1ed92a[_0x52cf('0x18')]));});});};exports['ShowChatQueue']=function(_0x1c6bc2){var _0xcffed3=this;return new Promise(function(_0x46eca4,_0x141871){return db[_0x52cf('0x1b')][_0x52cf('0x27')]({'raw':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2['options']['where']||null:null,'attributes':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x20')]||null:null,'include':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2['options']['include']?_[_0x52cf('0x23')](_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x22')],function(_0xafd307){return{'model':db[_0xafd307[_0x52cf('0x24')]],'as':_0xafd307['as'],'attributes':_0xafd307[_0x52cf('0x20')],'include':_0xafd307[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0xafd307[_0x52cf('0x22')],function(_0x163181){return{'model':db[_0x163181[_0x52cf('0x24')]],'as':_0x163181['as'],'attributes':_0x163181[_0x52cf('0x20')],'include':_0x163181[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x163181[_0x52cf('0x22')],function(_0x50d881){return{'model':db[_0x50d881[_0x52cf('0x24')]],'as':_0x50d881['as'],'attributes':_0x50d881[_0x52cf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x52cf('0x10')](function(_0x2f9a0a){logger[_0x52cf('0x11')](_0x52cf('0x28'),_0x1c6bc2);logger[_0x52cf('0x14')]('ShowChatQueue',_0x1c6bc2,JSON[_0x52cf('0x25')](_0x2f9a0a));_0x46eca4(_0x2f9a0a);})[_0x52cf('0x26')](function(_0x5e56cc){logger['error'](_0x52cf('0x28'),_0x5e56cc['message'],_0x1c6bc2);_0x141871(_0xcffed3['error'](0x1f4,_0x5e56cc[_0x52cf('0x18')]));});});};
\ No newline at end of file
+var _0x6f54=['find','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowChatQueue','ChatQueue'];(function(_0x568e42,_0x1e6554){var _0x4f05be=function(_0x4447b6){while(--_0x4447b6){_0x568e42['push'](_0x568e42['shift']());}};_0x4f05be(++_0x1e6554);}(_0x6f54,0xcf));var _0x46f5=function(_0x4bdd47,_0x15f10e){_0x4bdd47=_0x4bdd47-0x0;var _0x2975df=_0x6f54[_0x4bdd47];return _0x2975df;};'use strict';var _=require(_0x46f5('0x0'));var util=require(_0x46f5('0x1'));var moment=require(_0x46f5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46f5('0x3'));var db=require(_0x46f5('0x4'))['db'];var utils=require(_0x46f5('0x5'));var logger=require(_0x46f5('0x6'))('rpc');var config=require(_0x46f5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x46f5('0x8')]({'port':0x232a});config['redis']=_[_0x46f5('0x9')](config[_0x46f5('0xa')],{'host':_0x46f5('0xb'),'port':0x18eb});var socket=require(_0x46f5('0xc'))(new Redis(config[_0x46f5('0xa')]));require(_0x46f5('0xd'))[_0x46f5('0xe')](socket);function respondWithRpcPromise(_0x22fe4e,_0x1a6660,_0x356a21){return new BPromise(function(_0x359b6e,_0x18fdc3){return client[_0x46f5('0xf')](_0x22fe4e,_0x356a21)[_0x46f5('0x10')](function(_0x4b946d){logger[_0x46f5('0x11')](_0x46f5('0x12'),_0x1a6660,_0x46f5('0x13'));logger['debug'](_0x46f5('0x14'),_0x1a6660,_0x46f5('0x13'),JSON['stringify'](_0x4b946d));if(_0x4b946d[_0x46f5('0x15')]){if(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x16')]===0x1f4){logger[_0x46f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1a6660,_0x4b946d['error'][_0x46f5('0x17')]);return _0x18fdc3(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);}logger[_0x46f5('0x15')](_0x46f5('0x12'),_0x1a6660,_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);return _0x359b6e(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);}else{logger[_0x46f5('0x11')](_0x46f5('0x12'),_0x1a6660,'request\x20sent');_0x359b6e(_0x4b946d[_0x46f5('0x18')][_0x46f5('0x17')]);}})[_0x46f5('0x19')](function(_0x9f9165){logger['error'](_0x46f5('0x12'),_0x1a6660,_0x9f9165);_0x18fdc3(_0x9f9165);});});}exports[_0x46f5('0x1a')]=function(_0x2511d8){var _0x2094b0=this;return new Promise(function(_0xf3a7e9,_0x425a2e){return db['ChatQueue'][_0x46f5('0x1b')]({'raw':_0x2511d8[_0x46f5('0x1c')]?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x2511d8['options']?_0x2511d8['options'][_0x46f5('0x1e')]||null:null,'attributes':_0x2511d8[_0x46f5('0x1c')]?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x1f')]||null:null,'limit':_0x2511d8['options']?_0x2511d8['options'][_0x46f5('0x20')]||null:null,'include':_0x2511d8['options']?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x21')]?_['map'](_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x21')],function(_0x21374d){return{'model':db[_0x21374d[_0x46f5('0x22')]],'as':_0x21374d['as'],'attributes':_0x21374d['attributes'],'include':_0x21374d['include']?_[_0x46f5('0x23')](_0x21374d[_0x46f5('0x21')],function(_0x4b2769){return{'model':db[_0x4b2769['model']],'as':_0x4b2769['as'],'attributes':_0x4b2769[_0x46f5('0x1f')],'include':_0x4b2769[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x4b2769['include'],function(_0x48b761){return{'model':db[_0x48b761['model']],'as':_0x48b761['as'],'attributes':_0x48b761[_0x46f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46f5('0x10')](function(_0x42837f){logger['info'](_0x46f5('0x1a'),_0x2511d8);logger[_0x46f5('0x24')]('GetChatQueue',_0x2511d8,JSON['stringify'](_0x42837f));_0xf3a7e9(_0x42837f);})[_0x46f5('0x19')](function(_0x456c02){logger[_0x46f5('0x15')](_0x46f5('0x1a'),_0x456c02[_0x46f5('0x17')],_0x2511d8);_0x425a2e(_0x2094b0['error'](0x1f4,_0x456c02[_0x46f5('0x17')]));});});};exports[_0x46f5('0x25')]=function(_0x131f15){var _0x503262=this;return new Promise(function(_0x491aff,_0x5d0c51){return db[_0x46f5('0x26')][_0x46f5('0x27')]({'raw':_0x131f15[_0x46f5('0x1c')]?_0x131f15['options'][_0x46f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x131f15[_0x46f5('0x1c')]?_0x131f15['options'][_0x46f5('0x1e')]||null:null,'attributes':_0x131f15[_0x46f5('0x1c')]?_0x131f15[_0x46f5('0x1c')][_0x46f5('0x1f')]||null:null,'include':_0x131f15['options']?_0x131f15[_0x46f5('0x1c')]['include']?_[_0x46f5('0x23')](_0x131f15['options'][_0x46f5('0x21')],function(_0x1dd293){return{'model':db[_0x1dd293[_0x46f5('0x22')]],'as':_0x1dd293['as'],'attributes':_0x1dd293['attributes'],'include':_0x1dd293[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x1dd293[_0x46f5('0x21')],function(_0x1ad90c){return{'model':db[_0x1ad90c[_0x46f5('0x22')]],'as':_0x1ad90c['as'],'attributes':_0x1ad90c['attributes'],'include':_0x1ad90c[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x1ad90c[_0x46f5('0x21')],function(_0x232e68){return{'model':db[_0x232e68['model']],'as':_0x232e68['as'],'attributes':_0x232e68[_0x46f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46f5('0x10')](function(_0xcb164c){logger['info'](_0x46f5('0x25'),_0x131f15);logger[_0x46f5('0x24')](_0x46f5('0x25'),_0x131f15,JSON[_0x46f5('0x28')](_0xcb164c));_0x491aff(_0xcb164c);})[_0x46f5('0x19')](function(_0x5257ce){logger[_0x46f5('0x15')](_0x46f5('0x25'),_0x5257ce[_0x46f5('0x17')],_0x131f15);_0x5d0c51(_0x503262[_0x46f5('0x15')](0x1f4,_0x5257ce[_0x46f5('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 2ad06bd..ba01ef5 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 _0x6737=['chatQueue:','save','remove','emit','removeListener'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6737,0xe2));var _0x7673=function(_0xf68acb,_0x46d773){_0xf68acb=_0xf68acb-0x0;var _0x26d4c1=_0x6737[_0xf68acb];return _0x26d4c1;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x7673('0x0'),_0x7673('0x1'),'update'];function createListener(_0x2f05d4,_0x2a9cd0){return function(_0x43ee27){_0x2a9cd0[_0x7673('0x2')](_0x2f05d4,_0x43ee27);};}function removeListener(_0x54002e,_0x32e6f2){return function(){ChatQueueEvents[_0x7673('0x3')](_0x54002e,_0x32e6f2);};}exports['register']=function(_0x2f5edc){for(var _0x15230f=0x0,_0x5af802=events['length'];_0x15230f<_0x5af802;_0x15230f++){var _0x53d67d=events[_0x15230f];var _0x5292f7=createListener(_0x7673('0x4')+_0x53d67d,_0x2f5edc);ChatQueueEvents['on'](_0x53d67d,_0x5292f7);}};
\ No newline at end of file
+var _0xb903=['update','emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0xb903,0x185));var _0x3b90=function(_0x29b37a,_0x5debfe){_0x29b37a=_0x29b37a-0x0;var _0x5d9d3f=_0xb903[_0x29b37a];return _0x5d9d3f;};'use strict';var ChatQueueEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){ChatQueueEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);ChatQueueEvents['on'](_0x153283,_0x2e4c06);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 573c316..b5766ab 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0xa015c9,_0x307fb8){var _0x4ef54c=function(_0xc82a6b){while(--_0xc82a6b){_0xa015c9['push'](_0xa015c9['shift']());}};_0x4ef54c(++_0x307fb8);}(_0x7217,0x19e));var _0x7721=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7217[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x5e60dd,_0x117397){var _0x2fd44e=function(_0x15f7a4){while(--_0x15f7a4){_0x5e60dd['push'](_0x5e60dd['shift']());}};_0x2fd44e(++_0x117397);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b1e79e4..8978c59 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 _0x1aea=['exports','STRING','DATE','moment','sequelize'];(function(_0x13679b,_0xabb2ad){var _0x4b8004=function(_0x54e362){while(--_0x54e362){_0x13679b['push'](_0x13679b['shift']());}};_0x4b8004(++_0xabb2ad);}(_0x1aea,0x1d4));var _0xa1ae=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0x1aea[_0x590851];return _0x3b0115;};'use strict';var moment=require(_0xa1ae('0x0'));var Sequelize=require(_0xa1ae('0x1'));module[_0xa1ae('0x2')]={'uniqueid':{'type':Sequelize[_0xa1ae('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa1ae('0x3')]},'joinAt':{'type':Sequelize[_0xa1ae('0x4')]},'leaveAt':{'type':Sequelize[_0xa1ae('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa1ae('0x3')]}};
\ No newline at end of file
+var _0x20ae=['moment','sequelize','STRING','DATE'];(function(_0x31e482,_0x183b9c){var _0x214aa8=function(_0x281c79){while(--_0x281c79){_0x31e482['push'](_0x31e482['shift']());}};_0x214aa8(++_0x183b9c);}(_0x20ae,0x120));var _0xe20a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x20ae[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require(_0xe20a('0x0'));var Sequelize=require(_0xe20a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe20a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe20a('0x3')]},'leaveAt':{'type':Sequelize[_0xe20a('0x3')]},'acceptAt':{'type':Sequelize[_0xe20a('0x3')]},'exitAt':{'type':Sequelize[_0xe20a('0x3')]},'reason':{'type':Sequelize[_0xe20a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index dbe4784..f6945d4 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 _0x8212=['order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','ChatQueueReport','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit'];(function(_0x39f36c,_0x15ac8e){var _0x42f49c=function(_0x4195c6){while(--_0x4195c6){_0x39f36c['push'](_0x39f36c['shift']());}};_0x42f49c(++_0x15ac8e);}(_0x8212,0xb3));var _0x2821=function(_0x4ce9b5,_0x465447){_0x4ce9b5=_0x4ce9b5-0x0;var _0x2c3b31=_0x8212[_0x4ce9b5];return _0x2c3b31;};'use strict';var emlformat=require(_0x2821('0x0'));var rimraf=require(_0x2821('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2821('0x2'));var rp=require(_0x2821('0x3'));var moment=require(_0x2821('0x4'));var BPromise=require(_0x2821('0x5'));var Mustache=require(_0x2821('0x6'));var util=require(_0x2821('0x7'));var path=require(_0x2821('0x8'));var sox=require(_0x2821('0x9'));var csv=require('to-csv');var ejs=require(_0x2821('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2821('0xb'));var squel=require(_0x2821('0xc'));var crypto=require('crypto');var jsforce=require(_0x2821('0xd'));var deskjs=require(_0x2821('0xe'));var toCsv=require(_0x2821('0xf'));var querystring=require(_0x2821('0x10'));var Papa=require(_0x2821('0x11'));var Redis=require(_0x2821('0x12'));var authService=require(_0x2821('0x13'));var qs=require(_0x2821('0x14'));var as=require(_0x2821('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2821('0x16'))(_0x2821('0x17'));var utils=require(_0x2821('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c81c1,_0x11d227){_0x11d227=_0x11d227||0xcc;return function(_0x18a2bb){if(_0x18a2bb){return _0x4c81c1[_0x2821('0x19')](_0x11d227);}return _0x4c81c1[_0x2821('0x1a')](_0x11d227)[_0x2821('0x1b')]();};}function respondWithResult(_0x2fbc96,_0x5d5ee5){_0x5d5ee5=_0x5d5ee5||0xc8;return function(_0x3ba091){if(_0x3ba091){return _0x2fbc96['status'](_0x5d5ee5)['json'](_0x3ba091);}};}function respondWithFilteredResult(_0x4142f1,_0xe30acf){return function(_0x243c46){if(_0x243c46){var _0x472238=typeof _0xe30acf['offset']===_0x2821('0x1c')&&typeof _0xe30acf['limit']===_0x2821('0x1c');var _0x2673d2=_0x243c46[_0x2821('0x1d')];var _0x3f1057=_0x472238?0x0:_0xe30acf[_0x2821('0x1e')];var _0x500357=_0x472238?_0x243c46[_0x2821('0x1d')]:_0xe30acf[_0x2821('0x1e')]+_0xe30acf['limit'];var _0x22990a;if(_0x500357>=_0x2673d2){_0x500357=_0x2673d2;_0x22990a=0xc8;}else{_0x22990a=0xce;}_0x4142f1['status'](_0x22990a);return _0x4142f1[_0x2821('0x1f')](_0x2821('0x20'),_0x3f1057+'-'+_0x500357+'/'+_0x2673d2)[_0x2821('0x21')](_0x243c46);}return null;};}function patchUpdates(_0x8ba96e){return function(_0x38d898){try{jsonpatch[_0x2821('0x22')](_0x38d898,_0x8ba96e,!![]);}catch(_0x1c0907){return BPromise[_0x2821('0x23')](_0x1c0907);}return _0x38d898[_0x2821('0x24')]();};}function saveUpdates(_0x1f4e4f,_0x275810){return function(_0x597d8b){if(_0x597d8b){return _0x597d8b['update'](_0x1f4e4f)[_0x2821('0x25')](function(_0x243ff2){return _0x243ff2;});}return null;};}function removeEntity(_0x2838d8,_0x279a46){return function(_0x37c669){if(_0x37c669){return _0x37c669[_0x2821('0x26')]()[_0x2821('0x25')](function(){_0x2838d8[_0x2821('0x1a')](0xcc)[_0x2821('0x1b')]();});}};}function handleEntityNotFound(_0x27cef1,_0x7a49da){return function(_0x1d2c8f){if(!_0x1d2c8f){_0x27cef1[_0x2821('0x19')](0x194);}return _0x1d2c8f;};}function handleError(_0x3ddbe7,_0x14fbd4){_0x14fbd4=_0x14fbd4||0x1f4;return function(_0x2ab3ab){logger[_0x2821('0x27')](_0x2ab3ab[_0x2821('0x28')]);if(_0x2ab3ab[_0x2821('0x29')]){delete _0x2ab3ab[_0x2821('0x29')];}_0x3ddbe7['status'](_0x14fbd4)[_0x2821('0x2a')](_0x2ab3ab);};}exports['index']=function(_0x109262,_0x4402ea){var _0x449e46={},_0x7dfdc3={},_0x5eba60={'count':0x0,'rows':[]};var _0x3ea1de=_[_0x2821('0x2b')](db['ChatQueueReport'][_0x2821('0x2c')],function(_0x2e4395){return{'name':_0x2e4395[_0x2821('0x2d')],'type':_0x2e4395['type'][_0x2821('0x2e')]};});_0x7dfdc3[_0x2821('0x2f')]=_[_0x2821('0x2b')](_0x3ea1de,_0x2821('0x29'));_0x7dfdc3[_0x2821('0x30')]=_[_0x2821('0x31')](_0x109262[_0x2821('0x30')]);_0x7dfdc3['filters']=_[_0x2821('0x32')](_0x7dfdc3[_0x2821('0x2f')],_0x7dfdc3[_0x2821('0x30')]);_0x449e46[_0x2821('0x33')]=_[_0x2821('0x32')](_0x7dfdc3[_0x2821('0x2f')],qs[_0x2821('0x34')](_0x109262[_0x2821('0x30')][_0x2821('0x34')]));_0x449e46[_0x2821('0x33')]=_0x449e46[_0x2821('0x33')]['length']?_0x449e46[_0x2821('0x33')]:_0x7dfdc3[_0x2821('0x2f')];if(!_0x109262[_0x2821('0x30')][_0x2821('0x35')]('nolimit')){_0x449e46[_0x2821('0x36')]=qs[_0x2821('0x36')](_0x109262[_0x2821('0x30')][_0x2821('0x36')]);_0x449e46[_0x2821('0x1e')]=qs[_0x2821('0x1e')](_0x109262[_0x2821('0x30')][_0x2821('0x1e')]);}_0x449e46[_0x2821('0x37')]=qs[_0x2821('0x38')](_0x109262['query'][_0x2821('0x38')]);_0x449e46[_0x2821('0x39')]=qs[_0x2821('0x3a')](_[_0x2821('0x3b')](_0x109262[_0x2821('0x30')],_0x7dfdc3['filters']),_0x3ea1de);if(_0x109262[_0x2821('0x30')]['filter']){_0x449e46['where']=_[_0x2821('0x3c')](_0x449e46[_0x2821('0x39')],{'$or':_[_0x2821('0x2b')](_0x3ea1de,function(_0x276edc){if(_0x276edc[_0x2821('0x3d')]!==_0x2821('0x3e')){var _0x210c60={};_0x210c60[_0x276edc['name']]={'$like':'%'+_0x109262['query'][_0x2821('0x3f')]+'%'};return _0x210c60;}})});}_0x449e46=_[_0x2821('0x3c')]({},_0x449e46,_0x109262[_0x2821('0x40')]);var _0x2737a7={'where':_0x449e46[_0x2821('0x39')]};return db['ChatQueueReport']['count'](_0x2737a7)[_0x2821('0x25')](function(_0x26d389){_0x5eba60[_0x2821('0x1d')]=_0x26d389;if(_0x109262[_0x2821('0x30')][_0x2821('0x41')]){_0x449e46[_0x2821('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x2821('0x43')](_0x449e46);})[_0x2821('0x25')](function(_0x4fe0cd){_0x5eba60[_0x2821('0x44')]=_0x4fe0cd;return _0x5eba60;})[_0x2821('0x25')](respondWithFilteredResult(_0x4402ea,_0x449e46))[_0x2821('0x45')](handleError(_0x4402ea,null));};exports[_0x2821('0x46')]=function(_0x20c8db,_0x4ffc43){var _0x2b2796={'raw':!![],'where':{'id':_0x20c8db[_0x2821('0x47')]['id']}},_0x8d988a={};_0x8d988a[_0x2821('0x2f')]=_['keys'](db['ChatQueueReport'][_0x2821('0x2c')]);_0x8d988a[_0x2821('0x30')]=_[_0x2821('0x31')](_0x20c8db[_0x2821('0x30')]);_0x8d988a[_0x2821('0x3a')]=_[_0x2821('0x32')](_0x8d988a[_0x2821('0x2f')],_0x8d988a['query']);_0x2b2796['attributes']=_[_0x2821('0x32')](_0x8d988a['model'],qs[_0x2821('0x34')](_0x20c8db[_0x2821('0x30')][_0x2821('0x34')]));_0x2b2796[_0x2821('0x33')]=_0x2b2796[_0x2821('0x33')][_0x2821('0x48')]?_0x2b2796[_0x2821('0x33')]:_0x8d988a['model'];if(_0x20c8db[_0x2821('0x30')][_0x2821('0x41')]){_0x2b2796[_0x2821('0x42')]=[{'all':!![]}];}_0x2b2796=_[_0x2821('0x3c')]({},_0x2b2796,_0x20c8db[_0x2821('0x40')]);return db[_0x2821('0x49')][_0x2821('0x4a')](_0x2b2796)[_0x2821('0x25')](handleEntityNotFound(_0x4ffc43,null))['then'](respondWithResult(_0x4ffc43,null))[_0x2821('0x45')](handleError(_0x4ffc43,null));};exports[_0x2821('0x4b')]=function(_0x175ef3,_0x3f370d){return db['ChatQueueReport'][_0x2821('0x4b')](_0x175ef3[_0x2821('0x4c')],{})[_0x2821('0x25')](respondWithResult(_0x3f370d,0xc9))['catch'](handleError(_0x3f370d,null));};exports['update']=function(_0x5162b3,_0x9721){if(_0x5162b3[_0x2821('0x4c')]['id']){delete _0x5162b3[_0x2821('0x4c')]['id'];}return db['ChatQueueReport'][_0x2821('0x4a')]({'where':{'id':_0x5162b3[_0x2821('0x47')]['id']}})[_0x2821('0x25')](handleEntityNotFound(_0x9721,null))[_0x2821('0x25')](saveUpdates(_0x5162b3[_0x2821('0x4c')],null))[_0x2821('0x25')](respondWithResult(_0x9721,null))['catch'](handleError(_0x9721,null));};exports['destroy']=function(_0x284b28,_0x39fcc9){return db['ChatQueueReport'][_0x2821('0x4a')]({'where':{'id':_0x284b28[_0x2821('0x47')]['id']}})[_0x2821('0x25')](handleEntityNotFound(_0x39fcc9,null))[_0x2821('0x25')](removeEntity(_0x39fcc9,null))[_0x2821('0x45')](handleError(_0x39fcc9,null));};exports[_0x2821('0x4d')]=function(_0x40fecc,_0x2e4a4d){return db[_0x2821('0x49')]['describe']()['then'](respondWithResult(_0x2e4a4d,null))['catch'](handleError(_0x2e4a4d,null));};
\ No newline at end of file
+var _0x7b84=['map','ChatQueueReport','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7b84,0x167));var _0x47b8=function(_0x49f3c3,_0x1c2be1){_0x49f3c3=_0x49f3c3-0x0;var _0x32e69b=_0x7b84[_0x49f3c3];return _0x32e69b;};'use strict';var emlformat=require(_0x47b8('0x0'));var rimraf=require(_0x47b8('0x1'));var zipdir=require(_0x47b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x47b8('0x3'));var BPromise=require(_0x47b8('0x4'));var Mustache=require(_0x47b8('0x5'));var util=require(_0x47b8('0x6'));var path=require(_0x47b8('0x7'));var sox=require(_0x47b8('0x8'));var csv=require(_0x47b8('0x9'));var ejs=require(_0x47b8('0xa'));var fs=require('fs');var fs_extra=require(_0x47b8('0xb'));var _=require(_0x47b8('0xc'));var squel=require(_0x47b8('0xd'));var crypto=require(_0x47b8('0xe'));var jsforce=require(_0x47b8('0xf'));var deskjs=require(_0x47b8('0x10'));var toCsv=require(_0x47b8('0x9'));var querystring=require(_0x47b8('0x11'));var Papa=require(_0x47b8('0x12'));var Redis=require(_0x47b8('0x13'));var authService=require(_0x47b8('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47b8('0x15'));var logger=require(_0x47b8('0x16'))(_0x47b8('0x17'));var utils=require(_0x47b8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x47b8('0x19'));var db=require(_0x47b8('0x1a'))['db'];function respondWithStatusCode(_0x50ff5e,_0x1c3cfd){_0x1c3cfd=_0x1c3cfd||0xcc;return function(_0x4e843f){if(_0x4e843f){return _0x50ff5e[_0x47b8('0x1b')](_0x1c3cfd);}return _0x50ff5e[_0x47b8('0x1c')](_0x1c3cfd)[_0x47b8('0x1d')]();};}function respondWithResult(_0x49834d,_0x59388e){_0x59388e=_0x59388e||0xc8;return function(_0x1b1bc4){if(_0x1b1bc4){return _0x49834d['status'](_0x59388e)[_0x47b8('0x1e')](_0x1b1bc4);}};}function respondWithFilteredResult(_0x30fc0b,_0x105e29){return function(_0x1db4de){if(_0x1db4de){var _0x67a4=typeof _0x105e29[_0x47b8('0x1f')]===_0x47b8('0x20')&&typeof _0x105e29[_0x47b8('0x21')]===_0x47b8('0x20');var _0x5dfacd=_0x1db4de[_0x47b8('0x22')];var _0x4c1c0b=_0x67a4?0x0:_0x105e29[_0x47b8('0x1f')];var _0x3da863=_0x67a4?_0x1db4de[_0x47b8('0x22')]:_0x105e29['offset']+_0x105e29[_0x47b8('0x21')];var _0x50f1ae;if(_0x3da863>=_0x5dfacd){_0x3da863=_0x5dfacd;_0x50f1ae=0xc8;}else{_0x50f1ae=0xce;}_0x30fc0b['status'](_0x50f1ae);return _0x30fc0b[_0x47b8('0x23')]('Content-Range',_0x4c1c0b+'-'+_0x3da863+'/'+_0x5dfacd)[_0x47b8('0x1e')](_0x1db4de);}return null;};}function patchUpdates(_0x227cd7){return function(_0x347306){try{jsonpatch[_0x47b8('0x24')](_0x347306,_0x227cd7,!![]);}catch(_0x3a764c){return BPromise[_0x47b8('0x25')](_0x3a764c);}return _0x347306[_0x47b8('0x26')]();};}function saveUpdates(_0x3a45c6,_0x51b6b9){return function(_0x153159){if(_0x153159){return _0x153159[_0x47b8('0x27')](_0x3a45c6)[_0x47b8('0x28')](function(_0x556a09){return _0x556a09;});}return null;};}function removeEntity(_0x3423e2,_0x1f1dd3){return function(_0x251756){if(_0x251756){return _0x251756['destroy']()[_0x47b8('0x28')](function(){_0x3423e2['status'](0xcc)[_0x47b8('0x1d')]();});}};}function handleEntityNotFound(_0x511dbd,_0x62c5db){return function(_0x3e40a1){if(!_0x3e40a1){_0x511dbd[_0x47b8('0x1b')](0x194);}return _0x3e40a1;};}function handleError(_0x177d5c,_0x287ce5){_0x287ce5=_0x287ce5||0x1f4;return function(_0x1dcd63){logger[_0x47b8('0x29')](_0x1dcd63[_0x47b8('0x2a')]);if(_0x1dcd63[_0x47b8('0x2b')]){delete _0x1dcd63[_0x47b8('0x2b')];}_0x177d5c[_0x47b8('0x1c')](_0x287ce5)[_0x47b8('0x2c')](_0x1dcd63);};}exports[_0x47b8('0x2d')]=function(_0x19a605,_0x573c69){var _0x541e0a={},_0x23a317={},_0x9edecd={'count':0x0,'rows':[]};var _0x3e7406=_[_0x47b8('0x2e')](db[_0x47b8('0x2f')]['rawAttributes'],function(_0x4ddef7){return{'name':_0x4ddef7[_0x47b8('0x30')],'type':_0x4ddef7['type'][_0x47b8('0x31')]};});_0x23a317[_0x47b8('0x32')]=_[_0x47b8('0x2e')](_0x3e7406,'name');_0x23a317[_0x47b8('0x33')]=_['keys'](_0x19a605[_0x47b8('0x33')]);_0x23a317['filters']=_[_0x47b8('0x34')](_0x23a317[_0x47b8('0x32')],_0x23a317['query']);_0x541e0a['attributes']=_[_0x47b8('0x34')](_0x23a317['model'],qs[_0x47b8('0x35')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x35')]));_0x541e0a[_0x47b8('0x36')]=_0x541e0a[_0x47b8('0x36')][_0x47b8('0x37')]?_0x541e0a['attributes']:_0x23a317[_0x47b8('0x32')];if(!_0x19a605[_0x47b8('0x33')][_0x47b8('0x38')](_0x47b8('0x39'))){_0x541e0a[_0x47b8('0x21')]=qs[_0x47b8('0x21')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x21')]);_0x541e0a['offset']=qs[_0x47b8('0x1f')](_0x19a605['query'][_0x47b8('0x1f')]);}_0x541e0a[_0x47b8('0x3a')]=qs[_0x47b8('0x3b')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x3b')]);_0x541e0a[_0x47b8('0x3c')]=qs[_0x47b8('0x3d')](_[_0x47b8('0x3e')](_0x19a605[_0x47b8('0x33')],_0x23a317['filters']),_0x3e7406);if(_0x19a605['query'][_0x47b8('0x3f')]){_0x541e0a[_0x47b8('0x3c')]=_['merge'](_0x541e0a[_0x47b8('0x3c')],{'$or':_[_0x47b8('0x2e')](_0x3e7406,function(_0x52155b){if(_0x52155b[_0x47b8('0x40')]!==_0x47b8('0x41')){var _0x290c0a={};_0x290c0a[_0x52155b[_0x47b8('0x2b')]]={'$like':'%'+_0x19a605[_0x47b8('0x33')]['filter']+'%'};return _0x290c0a;}})});}_0x541e0a=_['merge']({},_0x541e0a,_0x19a605[_0x47b8('0x42')]);var _0xe80645={'where':_0x541e0a[_0x47b8('0x3c')]};return db[_0x47b8('0x2f')][_0x47b8('0x22')](_0xe80645)[_0x47b8('0x28')](function(_0x98aadb){_0x9edecd['count']=_0x98aadb;if(_0x19a605[_0x47b8('0x33')][_0x47b8('0x43')]){_0x541e0a[_0x47b8('0x44')]=[{'all':!![]}];}return db[_0x47b8('0x2f')][_0x47b8('0x45')](_0x541e0a);})[_0x47b8('0x28')](function(_0x576f23){_0x9edecd[_0x47b8('0x46')]=_0x576f23;return _0x9edecd;})[_0x47b8('0x28')](respondWithFilteredResult(_0x573c69,_0x541e0a))[_0x47b8('0x47')](handleError(_0x573c69,null));};exports[_0x47b8('0x48')]=function(_0x331a1d,_0x4a85be){var _0x56c59d={'raw':!![],'where':{'id':_0x331a1d['params']['id']}},_0x99ded6={};_0x99ded6[_0x47b8('0x32')]=_[_0x47b8('0x49')](db['ChatQueueReport'][_0x47b8('0x4a')]);_0x99ded6['query']=_[_0x47b8('0x49')](_0x331a1d[_0x47b8('0x33')]);_0x99ded6[_0x47b8('0x3d')]=_[_0x47b8('0x34')](_0x99ded6[_0x47b8('0x32')],_0x99ded6['query']);_0x56c59d[_0x47b8('0x36')]=_[_0x47b8('0x34')](_0x99ded6['model'],qs[_0x47b8('0x35')](_0x331a1d[_0x47b8('0x33')][_0x47b8('0x35')]));_0x56c59d[_0x47b8('0x36')]=_0x56c59d[_0x47b8('0x36')][_0x47b8('0x37')]?_0x56c59d[_0x47b8('0x36')]:_0x99ded6[_0x47b8('0x32')];if(_0x331a1d[_0x47b8('0x33')][_0x47b8('0x43')]){_0x56c59d[_0x47b8('0x44')]=[{'all':!![]}];}_0x56c59d=_['merge']({},_0x56c59d,_0x331a1d[_0x47b8('0x42')]);return db[_0x47b8('0x2f')][_0x47b8('0x4b')](_0x56c59d)['then'](handleEntityNotFound(_0x4a85be,null))[_0x47b8('0x28')](respondWithResult(_0x4a85be,null))['catch'](handleError(_0x4a85be,null));};exports[_0x47b8('0x4c')]=function(_0x4aed88,_0x35f4db){return db[_0x47b8('0x2f')][_0x47b8('0x4c')](_0x4aed88[_0x47b8('0x4d')],{})['then'](respondWithResult(_0x35f4db,0xc9))[_0x47b8('0x47')](handleError(_0x35f4db,null));};exports[_0x47b8('0x27')]=function(_0x165a31,_0x140df1){if(_0x165a31['body']['id']){delete _0x165a31[_0x47b8('0x4d')]['id'];}return db[_0x47b8('0x2f')][_0x47b8('0x4b')]({'where':{'id':_0x165a31[_0x47b8('0x4e')]['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x140df1,null))[_0x47b8('0x28')](saveUpdates(_0x165a31['body'],null))[_0x47b8('0x28')](respondWithResult(_0x140df1,null))[_0x47b8('0x47')](handleError(_0x140df1,null));};exports[_0x47b8('0x4f')]=function(_0x562eff,_0x411b23){return db[_0x47b8('0x2f')][_0x47b8('0x4b')]({'where':{'id':_0x562eff[_0x47b8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x411b23,null))['then'](removeEntity(_0x411b23,null))[_0x47b8('0x47')](handleError(_0x411b23,null));};exports[_0x47b8('0x50')]=function(_0x814e6c,_0x9e4104){return db[_0x47b8('0x2f')][_0x47b8('0x50')]()[_0x47b8('0x28')](respondWithResult(_0x9e4104,null))[_0x47b8('0x47')](handleError(_0x9e4104,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 754ab97..336656a 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x2cc3e7,_0x62ffb6){var _0x20179e=function(_0x1f1ede){while(--_0x1f1ede){_0x2cc3e7['push'](_0x2cc3e7['shift']());}};_0x20179e(++_0x62ffb6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xcb91[_0x5f5cce];return _0x705ecf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5071d9,_0x2dcf15){var _0x4b92d1=function(_0x2dfdd7){while(--_0x2dfdd7){_0x5071d9['push'](_0x5071d9['shift']());}};_0x4b92d1(++_0x2dcf15);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 92ad761..f6966b8 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 _0xa832=['options','raw','UpdateChatQueueReport','update','body','where','attributes','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x3e864d,_0x43e000){var _0x24bd1b=function(_0x2e76f6){while(--_0x2e76f6){_0x3e864d['push'](_0x3e864d['shift']());}};_0x24bd1b(++_0x43e000);}(_0xa832,0x16f));var _0x2a83=function(_0x2bf67e,_0x16d378){_0x2bf67e=_0x2bf67e-0x0;var _0x5138d5=_0xa832[_0x2bf67e];return _0x5138d5;};'use strict';var _=require('lodash');var util=require(_0x2a83('0x0'));var moment=require(_0x2a83('0x1'));var BPromise=require(_0x2a83('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a83('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a83('0x4'));var logger=require(_0x2a83('0x5'))('rpc');var config=require(_0x2a83('0x6'));var jayson=require(_0x2a83('0x7'));var client=jayson['client'][_0x2a83('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5adb1a,_0x12733e,_0x1d296e){return new BPromise(function(_0x4512b2,_0x267f76){return client[_0x2a83('0x9')](_0x5adb1a,_0x1d296e)[_0x2a83('0xa')](function(_0x54ca5d){logger[_0x2a83('0xb')](_0x2a83('0xc'),_0x12733e,_0x2a83('0xd'));logger[_0x2a83('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x12733e,_0x2a83('0xd'),JSON[_0x2a83('0xf')](_0x54ca5d));if(_0x54ca5d[_0x2a83('0x10')]){if(_0x54ca5d[_0x2a83('0x10')][_0x2a83('0x11')]===0x1f4){logger[_0x2a83('0x10')](_0x2a83('0xc'),_0x12733e,_0x54ca5d['error']['message']);return _0x267f76(_0x54ca5d[_0x2a83('0x10')]['message']);}logger[_0x2a83('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x12733e,_0x54ca5d['error'][_0x2a83('0x12')]);return _0x4512b2(_0x54ca5d[_0x2a83('0x10')]['message']);}else{logger[_0x2a83('0xb')](_0x2a83('0xc'),_0x12733e,_0x2a83('0xd'));_0x4512b2(_0x54ca5d[_0x2a83('0x13')][_0x2a83('0x12')]);}})[_0x2a83('0x14')](function(_0xf838d6){logger[_0x2a83('0x10')](_0x2a83('0xc'),_0x12733e,_0xf838d6);_0x267f76(_0xf838d6);});});}exports[_0x2a83('0x15')]=function(_0x1a8849){var _0x16dff7=this;return new Promise(function(_0x4a1d1c,_0x260c32){return db[_0x2a83('0x16')]['create'](_0x1a8849['body'],{'raw':_0x1a8849['options']?_0x1a8849[_0x2a83('0x17')][_0x2a83('0x18')]===undefined?!![]:![]:!![]})[_0x2a83('0xa')](function(_0x4a3232){logger[_0x2a83('0xb')](_0x2a83('0x15'),_0x1a8849);logger[_0x2a83('0xe')](_0x2a83('0x15'),_0x1a8849,JSON[_0x2a83('0xf')](_0x4a3232));_0x4a1d1c(_0x4a3232);})[_0x2a83('0x14')](function(_0x6d3dc7){logger[_0x2a83('0x10')](_0x2a83('0x15'),_0x6d3dc7[_0x2a83('0x12')],_0x1a8849);_0x260c32(_0x16dff7['error'](0x1f4,_0x6d3dc7['message']));});});};exports[_0x2a83('0x19')]=function(_0x2234a6){var _0x8afcec=this;return new Promise(function(_0x439888,_0x17fb6f){return db['ChatQueueReport'][_0x2a83('0x1a')](_0x2234a6[_0x2a83('0x1b')],{'raw':_0x2234a6[_0x2a83('0x17')]?_0x2234a6['options'][_0x2a83('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2234a6[_0x2a83('0x17')]?_0x2234a6['options'][_0x2a83('0x1c')]||null:null,'attributes':_0x2234a6['options']?_0x2234a6[_0x2a83('0x17')][_0x2a83('0x1d')]||null:null,'limit':_0x2234a6['options']?_0x2234a6[_0x2a83('0x17')]['limit']||null:null})[_0x2a83('0xa')](function(_0x40d8ea){logger[_0x2a83('0xb')](_0x2a83('0x19'),_0x2234a6);logger[_0x2a83('0xe')](_0x2a83('0x19'),_0x2234a6,JSON[_0x2a83('0xf')](_0x40d8ea));_0x439888(_0x40d8ea);})[_0x2a83('0x14')](function(_0x1c4feb){logger[_0x2a83('0x10')](_0x2a83('0x19'),_0x1c4feb[_0x2a83('0x12')],_0x2234a6);_0x17fb6f(_0x8afcec[_0x2a83('0x10')](0x1f4,_0x1c4feb[_0x2a83('0x12')]));});});};
\ No newline at end of file
+var _0x2b88=['jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','body','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1a9d06,_0x4c70e3){var _0x7776b9=function(_0x37dfc0){while(--_0x37dfc0){_0x1a9d06['push'](_0x1a9d06['shift']());}};_0x7776b9(++_0x4c70e3);}(_0x2b88,0x1b1));var _0x82b8=function(_0x5d5c49,_0x528f94){_0x5d5c49=_0x5d5c49-0x0;var _0x41cb72=_0x2b88[_0x5d5c49];return _0x41cb72;};'use strict';var _=require(_0x82b8('0x0'));var util=require(_0x82b8('0x1'));var moment=require('moment');var BPromise=require(_0x82b8('0x2'));var rs=require(_0x82b8('0x3'));var fs=require('fs');var Redis=require(_0x82b8('0x4'));var db=require(_0x82b8('0x5'))['db'];var utils=require(_0x82b8('0x6'));var logger=require('../../config/logger')(_0x82b8('0x7'));var config=require(_0x82b8('0x8'));var jayson=require(_0x82b8('0x9'));var client=jayson['client'][_0x82b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13f2d0,_0x41f35f,_0xccf541){return new BPromise(function(_0x30231a,_0x531491){return client[_0x82b8('0xb')](_0x13f2d0,_0xccf541)[_0x82b8('0xc')](function(_0x33a04a){logger[_0x82b8('0xd')](_0x82b8('0xe'),_0x41f35f,_0x82b8('0xf'));logger[_0x82b8('0x10')](_0x82b8('0x11'),_0x41f35f,_0x82b8('0xf'),JSON[_0x82b8('0x12')](_0x33a04a));if(_0x33a04a[_0x82b8('0x13')]){if(_0x33a04a[_0x82b8('0x13')][_0x82b8('0x14')]===0x1f4){logger[_0x82b8('0x13')](_0x82b8('0xe'),_0x41f35f,_0x33a04a[_0x82b8('0x13')][_0x82b8('0x15')]);return _0x531491(_0x33a04a[_0x82b8('0x13')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x41f35f,_0x33a04a[_0x82b8('0x13')][_0x82b8('0x15')]);return _0x30231a(_0x33a04a[_0x82b8('0x13')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x41f35f,'request\x20sent');_0x30231a(_0x33a04a[_0x82b8('0x16')][_0x82b8('0x15')]);}})[_0x82b8('0x17')](function(_0x35b09c){logger['error'](_0x82b8('0xe'),_0x41f35f,_0x35b09c);_0x531491(_0x35b09c);});});}exports[_0x82b8('0x18')]=function(_0x49a755){var _0x35324c=this;return new Promise(function(_0x2161e1,_0x33e945){return db[_0x82b8('0x19')][_0x82b8('0x1a')](_0x49a755['body'],{'raw':_0x49a755[_0x82b8('0x1b')]?_0x49a755['options'][_0x82b8('0x1c')]===undefined?!![]:![]:!![]})[_0x82b8('0xc')](function(_0x2fce2f){logger['info'](_0x82b8('0x18'),_0x49a755);logger[_0x82b8('0x10')]('CreateChatQueueReport',_0x49a755,JSON[_0x82b8('0x12')](_0x2fce2f));_0x2161e1(_0x2fce2f);})[_0x82b8('0x17')](function(_0x1c54d8){logger[_0x82b8('0x13')](_0x82b8('0x18'),_0x1c54d8[_0x82b8('0x15')],_0x49a755);_0x33e945(_0x35324c['error'](0x1f4,_0x1c54d8[_0x82b8('0x15')]));});});};exports[_0x82b8('0x1d')]=function(_0x20b7cd){var _0x5831c3=this;return new Promise(function(_0x9aa23c,_0x3315d5){return db[_0x82b8('0x19')][_0x82b8('0x1e')](_0x20b7cd[_0x82b8('0x1f')],{'raw':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd['options'][_0x82b8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd['options'][_0x82b8('0x20')]||null:null,'attributes':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd[_0x82b8('0x1b')][_0x82b8('0x21')]||null:null,'limit':_0x20b7cd['options']?_0x20b7cd[_0x82b8('0x1b')]['limit']||null:null})[_0x82b8('0xc')](function(_0x9263aa){logger[_0x82b8('0xd')](_0x82b8('0x1d'),_0x20b7cd);logger[_0x82b8('0x10')]('UpdateChatQueueReport',_0x20b7cd,JSON[_0x82b8('0x12')](_0x9263aa));_0x9aa23c(_0x9263aa);})[_0x82b8('0x17')](function(_0x58b4b0){logger[_0x82b8('0x13')]('UpdateChatQueueReport',_0x58b4b0[_0x82b8('0x15')],_0x20b7cd);_0x3315d5(_0x5831c3[_0x82b8('0x13')](0x1f4,_0x58b4b0['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index f55bc6d..90df9ed 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 _0xa7bc=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path'];(function(_0x5ad555,_0x35e672){var _0x346bb9=function(_0x4ff069){while(--_0x4ff069){_0x5ad555['push'](_0x5ad555['shift']());}};_0x346bb9(++_0x35e672);}(_0xa7bc,0x173));var _0xca7b=function(_0x4965ac,_0x5dada2){_0x4965ac=_0x4965ac-0x0;var _0x5a35c2=_0xa7bc[_0x4965ac];return _0x5a35c2;};'use strict';var multer=require(_0xca7b('0x0'));var util=require(_0xca7b('0x1'));var path=require(_0xca7b('0x2'));var timeout=require(_0xca7b('0x3'));var express=require(_0xca7b('0x4'));var router=express[_0xca7b('0x5')]();var fs_extra=require(_0xca7b('0x6'));var auth=require(_0xca7b('0x7'));var interaction=require(_0xca7b('0x8'));var config=require(_0xca7b('0x9'));var controller=require(_0xca7b('0xa'));router['get']('/',auth[_0xca7b('0xb')](),controller[_0xca7b('0xc')]);router[_0xca7b('0xd')](_0xca7b('0xe'),auth[_0xca7b('0xb')](),controller['describe']);router['get'](_0xca7b('0xf'),auth['isAuthenticated'](),controller[_0xca7b('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xca7b('0x11')]);router[_0xca7b('0x12')](_0xca7b('0xf'),auth[_0xca7b('0xb')](),controller[_0xca7b('0x13')]);router['delete'](_0xca7b('0xf'),auth[_0xca7b('0xb')](),controller[_0xca7b('0x14')]);module[_0xca7b('0x15')]=router;
\ No newline at end of file
+var _0x7732=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x42b515,_0x30b55e){var _0x1de82b=function(_0x1c4e81){while(--_0x1c4e81){_0x42b515['push'](_0x42b515['shift']());}};_0x1de82b(++_0x30b55e);}(_0x7732,0xb1));var _0x2773=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x7732[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0x2773('0x0'));var util=require(_0x2773('0x1'));var path=require(_0x2773('0x2'));var timeout=require('connect-timeout');var express=require(_0x2773('0x3'));var router=express[_0x2773('0x4')]();var fs_extra=require(_0x2773('0x5'));var auth=require(_0x2773('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2773('0x7'));router[_0x2773('0x8')]('/',auth[_0x2773('0x9')](),controller['index']);router[_0x2773('0x8')](_0x2773('0xa'),auth[_0x2773('0x9')](),controller[_0x2773('0xb')]);router[_0x2773('0x8')](_0x2773('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2773('0x9')](),controller[_0x2773('0xd')]);router[_0x2773('0xe')]('/:id',auth[_0x2773('0x9')](),controller[_0x2773('0xf')]);router[_0x2773('0x10')](_0x2773('0xc'),auth[_0x2773('0x9')](),controller[_0x2773('0x11')]);module[_0x2773('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index b171b2c..7e97a76 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x45b892,_0x3f7e45){var _0x208a1d=function(_0x5cb604){while(--_0x5cb604){_0x45b892['push'](_0x45b892['shift']());}};_0x208a1d(++_0x3f7e45);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xcb91[_0x19159a];return _0xa677f4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4d04d6,_0x38ae19){var _0x2e937a=function(_0x4961c8){while(--_0x4961c8){_0x4d04d6['push'](_0x4d04d6['shift']());}};_0x2e937a(++_0x38ae19);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2b9af9e..369519f 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 _0x70a5=['undefined','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','ChatTransferReport','findAll','rows','catch','params','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end'];(function(_0x12a04a,_0x4e3d1a){var _0x6d5409=function(_0x2b3c9f){while(--_0x2b3c9f){_0x12a04a['push'](_0x12a04a['shift']());}};_0x6d5409(++_0x4e3d1a);}(_0x70a5,0x7b));var _0x570a=function(_0x4ab830,_0x47921f){_0x4ab830=_0x4ab830-0x0;var _0x49c499=_0x70a5[_0x4ab830];return _0x49c499;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x570a('0x0'));var zipdir=require(_0x570a('0x1'));var jsonpatch=require(_0x570a('0x2'));var rp=require(_0x570a('0x3'));var moment=require('moment');var BPromise=require(_0x570a('0x4'));var Mustache=require(_0x570a('0x5'));var util=require(_0x570a('0x6'));var path=require(_0x570a('0x7'));var sox=require(_0x570a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x570a('0x9'));var _=require(_0x570a('0xa'));var squel=require('squel');var crypto=require(_0x570a('0xb'));var jsforce=require(_0x570a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x570a('0xd'));var querystring=require(_0x570a('0xe'));var Papa=require(_0x570a('0xf'));var Redis=require(_0x570a('0x10'));var authService=require(_0x570a('0x11'));var qs=require(_0x570a('0x12'));var as=require(_0x570a('0x13'));var hardwareService=require(_0x570a('0x14'));var logger=require('../../config/logger')(_0x570a('0x15'));var utils=require(_0x570a('0x16'));var config=require(_0x570a('0x17'));var licenseUtil=require(_0x570a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcafb61,_0x1403d8){_0x1403d8=_0x1403d8||0xcc;return function(_0x1d02e8){if(_0x1d02e8){return _0xcafb61['sendStatus'](_0x1403d8);}return _0xcafb61[_0x570a('0x19')](_0x1403d8)[_0x570a('0x1a')]();};}function respondWithResult(_0x1ce01b,_0x164d2e){_0x164d2e=_0x164d2e||0xc8;return function(_0x34e875){if(_0x34e875){return _0x1ce01b[_0x570a('0x19')](_0x164d2e)['json'](_0x34e875);}};}function respondWithFilteredResult(_0x773978,_0xcc7610){return function(_0x2eaa1f){if(_0x2eaa1f){var _0x2dd5cd=typeof _0xcc7610['offset']===_0x570a('0x1b')&&typeof _0xcc7610['limit']===_0x570a('0x1b');var _0x1a3bc6=_0x2eaa1f[_0x570a('0x1c')];var _0x1d3d98=_0x2dd5cd?0x0:_0xcc7610[_0x570a('0x1d')];var _0x1a89f8=_0x2dd5cd?_0x2eaa1f[_0x570a('0x1c')]:_0xcc7610[_0x570a('0x1d')]+_0xcc7610['limit'];var _0x46a9ce;if(_0x1a89f8>=_0x1a3bc6){_0x1a89f8=_0x1a3bc6;_0x46a9ce=0xc8;}else{_0x46a9ce=0xce;}_0x773978[_0x570a('0x19')](_0x46a9ce);return _0x773978['set'](_0x570a('0x1e'),_0x1d3d98+'-'+_0x1a89f8+'/'+_0x1a3bc6)[_0x570a('0x1f')](_0x2eaa1f);}return null;};}function patchUpdates(_0x3761eb){return function(_0x3673ce){try{jsonpatch[_0x570a('0x20')](_0x3673ce,_0x3761eb,!![]);}catch(_0x2c5aa1){return BPromise[_0x570a('0x21')](_0x2c5aa1);}return _0x3673ce[_0x570a('0x22')]();};}function saveUpdates(_0x293544,_0x40e75b){return function(_0x7cb61e){if(_0x7cb61e){return _0x7cb61e[_0x570a('0x23')](_0x293544)[_0x570a('0x24')](function(_0x55a3d4){return _0x55a3d4;});}return null;};}function removeEntity(_0x525799,_0x594a25){return function(_0x5c90cf){if(_0x5c90cf){return _0x5c90cf[_0x570a('0x25')]()[_0x570a('0x24')](function(){_0x525799[_0x570a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x79aef3,_0x1e7750){return function(_0x11c1e5){if(!_0x11c1e5){_0x79aef3[_0x570a('0x26')](0x194);}return _0x11c1e5;};}function handleError(_0xf83502,_0xe66f2c){_0xe66f2c=_0xe66f2c||0x1f4;return function(_0x4e5f1a){logger['error'](_0x4e5f1a['stack']);if(_0x4e5f1a['name']){delete _0x4e5f1a[_0x570a('0x27')];}_0xf83502[_0x570a('0x19')](_0xe66f2c)[_0x570a('0x28')](_0x4e5f1a);};}exports[_0x570a('0x29')]=function(_0x49d087,_0x1248e0){var _0x32334a={},_0x340c80={},_0x42a866={'count':0x0,'rows':[]};var _0x925a2a=_[_0x570a('0x2a')](db['ChatTransferReport'][_0x570a('0x2b')],function(_0x1f0a76){return{'name':_0x1f0a76[_0x570a('0x2c')],'type':_0x1f0a76['type']['key']};});_0x340c80[_0x570a('0x2d')]=_[_0x570a('0x2a')](_0x925a2a,_0x570a('0x27'));_0x340c80['query']=_[_0x570a('0x2e')](_0x49d087[_0x570a('0x2f')]);_0x340c80[_0x570a('0x30')]=_[_0x570a('0x31')](_0x340c80['model'],_0x340c80[_0x570a('0x2f')]);_0x32334a[_0x570a('0x32')]=_[_0x570a('0x31')](_0x340c80[_0x570a('0x2d')],qs[_0x570a('0x33')](_0x49d087[_0x570a('0x2f')][_0x570a('0x33')]));_0x32334a[_0x570a('0x32')]=_0x32334a[_0x570a('0x32')][_0x570a('0x34')]?_0x32334a[_0x570a('0x32')]:_0x340c80[_0x570a('0x2d')];if(!_0x49d087[_0x570a('0x2f')]['hasOwnProperty'](_0x570a('0x35'))){_0x32334a[_0x570a('0x36')]=qs['limit'](_0x49d087[_0x570a('0x2f')][_0x570a('0x36')]);_0x32334a[_0x570a('0x1d')]=qs['offset'](_0x49d087[_0x570a('0x2f')][_0x570a('0x1d')]);}_0x32334a[_0x570a('0x37')]=qs[_0x570a('0x38')](_0x49d087[_0x570a('0x2f')]['sort']);_0x32334a[_0x570a('0x39')]=qs[_0x570a('0x30')](_[_0x570a('0x3a')](_0x49d087[_0x570a('0x2f')],_0x340c80[_0x570a('0x30')]),_0x925a2a);if(_0x49d087[_0x570a('0x2f')][_0x570a('0x3b')]){_0x32334a[_0x570a('0x39')]=_[_0x570a('0x3c')](_0x32334a['where'],{'$or':_['map'](_0x925a2a,function(_0x1da7c9){if(_0x1da7c9[_0x570a('0x3d')]!==_0x570a('0x3e')){var _0x459b30={};_0x459b30[_0x1da7c9[_0x570a('0x27')]]={'$like':'%'+_0x49d087[_0x570a('0x2f')][_0x570a('0x3b')]+'%'};return _0x459b30;}})});}_0x32334a=_[_0x570a('0x3c')]({},_0x32334a,_0x49d087[_0x570a('0x3f')]);var _0x15f05d={'where':_0x32334a['where']};return db['ChatTransferReport'][_0x570a('0x1c')](_0x15f05d)[_0x570a('0x24')](function(_0x1c45a8){_0x42a866[_0x570a('0x1c')]=_0x1c45a8;if(_0x49d087[_0x570a('0x2f')][_0x570a('0x40')]){_0x32334a[_0x570a('0x41')]=[{'all':!![]}];}return db[_0x570a('0x42')][_0x570a('0x43')](_0x32334a);})[_0x570a('0x24')](function(_0xc532e1){_0x42a866[_0x570a('0x44')]=_0xc532e1;return _0x42a866;})[_0x570a('0x24')](respondWithFilteredResult(_0x1248e0,_0x32334a))[_0x570a('0x45')](handleError(_0x1248e0,null));};exports['show']=function(_0x3605c2,_0x4de68f){var _0x1a5a22={'raw':!![],'where':{'id':_0x3605c2[_0x570a('0x46')]['id']}},_0x2c4717={};_0x2c4717[_0x570a('0x2d')]=_[_0x570a('0x2e')](db[_0x570a('0x42')][_0x570a('0x2b')]);_0x2c4717[_0x570a('0x2f')]=_['keys'](_0x3605c2['query']);_0x2c4717['filters']=_[_0x570a('0x31')](_0x2c4717[_0x570a('0x2d')],_0x2c4717[_0x570a('0x2f')]);_0x1a5a22[_0x570a('0x32')]=_['intersection'](_0x2c4717[_0x570a('0x2d')],qs[_0x570a('0x33')](_0x3605c2['query'][_0x570a('0x33')]));_0x1a5a22[_0x570a('0x32')]=_0x1a5a22[_0x570a('0x32')][_0x570a('0x34')]?_0x1a5a22[_0x570a('0x32')]:_0x2c4717[_0x570a('0x2d')];if(_0x3605c2[_0x570a('0x2f')][_0x570a('0x40')]){_0x1a5a22[_0x570a('0x41')]=[{'all':!![]}];}_0x1a5a22=_[_0x570a('0x3c')]({},_0x1a5a22,_0x3605c2[_0x570a('0x3f')]);return db['ChatTransferReport']['find'](_0x1a5a22)[_0x570a('0x24')](handleEntityNotFound(_0x4de68f,null))['then'](respondWithResult(_0x4de68f,null))[_0x570a('0x45')](handleError(_0x4de68f,null));};exports[_0x570a('0x47')]=function(_0x310210,_0x3f6e40){return db[_0x570a('0x42')][_0x570a('0x47')](_0x310210['body'],{})[_0x570a('0x24')](respondWithResult(_0x3f6e40,0xc9))[_0x570a('0x45')](handleError(_0x3f6e40,null));};exports[_0x570a('0x23')]=function(_0x132b4d,_0x4598df){if(_0x132b4d[_0x570a('0x48')]['id']){delete _0x132b4d['body']['id'];}return db['ChatTransferReport'][_0x570a('0x49')]({'where':{'id':_0x132b4d[_0x570a('0x46')]['id']}})[_0x570a('0x24')](handleEntityNotFound(_0x4598df,null))[_0x570a('0x24')](saveUpdates(_0x132b4d[_0x570a('0x48')],null))[_0x570a('0x24')](respondWithResult(_0x4598df,null))[_0x570a('0x45')](handleError(_0x4598df,null));};exports[_0x570a('0x25')]=function(_0x35749,_0x392711){return db[_0x570a('0x42')][_0x570a('0x49')]({'where':{'id':_0x35749[_0x570a('0x46')]['id']}})[_0x570a('0x24')](handleEntityNotFound(_0x392711,null))[_0x570a('0x24')](removeEntity(_0x392711,null))[_0x570a('0x45')](handleError(_0x392711,null));};exports['describe']=function(_0x3865fc,_0x115682){return db[_0x570a('0x42')][_0x570a('0x4a')]()[_0x570a('0x24')](respondWithResult(_0x115682,null))['catch'](handleError(_0x115682,null));};
\ No newline at end of file
+var _0x29c1=['length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys'];(function(_0x4e9dcb,_0xd1fb87){var _0x5105fc=function(_0x2df827){while(--_0x2df827){_0x4e9dcb['push'](_0x4e9dcb['shift']());}};_0x5105fc(++_0xd1fb87);}(_0x29c1,0x1c7));var _0x129c=function(_0x781647,_0x18edc0){_0x781647=_0x781647-0x0;var _0x56fcdb=_0x29c1[_0x781647];return _0x56fcdb;};'use strict';var emlformat=require(_0x129c('0x0'));var rimraf=require(_0x129c('0x1'));var zipdir=require(_0x129c('0x2'));var jsonpatch=require(_0x129c('0x3'));var rp=require(_0x129c('0x4'));var moment=require(_0x129c('0x5'));var BPromise=require(_0x129c('0x6'));var Mustache=require(_0x129c('0x7'));var util=require(_0x129c('0x8'));var path=require(_0x129c('0x9'));var sox=require(_0x129c('0xa'));var csv=require('to-csv');var ejs=require(_0x129c('0xb'));var fs=require('fs');var fs_extra=require(_0x129c('0xc'));var _=require(_0x129c('0xd'));var squel=require(_0x129c('0xe'));var crypto=require(_0x129c('0xf'));var jsforce=require(_0x129c('0x10'));var deskjs=require(_0x129c('0x11'));var toCsv=require(_0x129c('0x12'));var querystring=require('querystring');var Papa=require(_0x129c('0x13'));var Redis=require(_0x129c('0x14'));var authService=require(_0x129c('0x15'));var qs=require(_0x129c('0x16'));var as=require(_0x129c('0x17'));var hardwareService=require(_0x129c('0x18'));var logger=require(_0x129c('0x19'))(_0x129c('0x1a'));var utils=require('../../config/utils');var config=require(_0x129c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48f3b3,_0x56a63b){_0x56a63b=_0x56a63b||0xcc;return function(_0x24785a){if(_0x24785a){return _0x48f3b3['sendStatus'](_0x56a63b);}return _0x48f3b3[_0x129c('0x1c')](_0x56a63b)[_0x129c('0x1d')]();};}function respondWithResult(_0x14bd93,_0x51d514){_0x51d514=_0x51d514||0xc8;return function(_0x3d08b2){if(_0x3d08b2){return _0x14bd93[_0x129c('0x1c')](_0x51d514)[_0x129c('0x1e')](_0x3d08b2);}};}function respondWithFilteredResult(_0x326890,_0x400f8c){return function(_0x54f8ce){if(_0x54f8ce){var _0x4c4bce=typeof _0x400f8c['offset']===_0x129c('0x1f')&&typeof _0x400f8c[_0x129c('0x20')]===_0x129c('0x1f');var _0x2b7939=_0x54f8ce[_0x129c('0x21')];var _0x34ee0b=_0x4c4bce?0x0:_0x400f8c[_0x129c('0x22')];var _0x201359=_0x4c4bce?_0x54f8ce[_0x129c('0x21')]:_0x400f8c[_0x129c('0x22')]+_0x400f8c[_0x129c('0x20')];var _0x1309b8;if(_0x201359>=_0x2b7939){_0x201359=_0x2b7939;_0x1309b8=0xc8;}else{_0x1309b8=0xce;}_0x326890['status'](_0x1309b8);return _0x326890['set'](_0x129c('0x23'),_0x34ee0b+'-'+_0x201359+'/'+_0x2b7939)[_0x129c('0x1e')](_0x54f8ce);}return null;};}function patchUpdates(_0x4b1003){return function(_0x3cbffa){try{jsonpatch['apply'](_0x3cbffa,_0x4b1003,!![]);}catch(_0x116381){return BPromise[_0x129c('0x24')](_0x116381);}return _0x3cbffa[_0x129c('0x25')]();};}function saveUpdates(_0x3a7b40,_0x1e363b){return function(_0x3cab81){if(_0x3cab81){return _0x3cab81[_0x129c('0x26')](_0x3a7b40)[_0x129c('0x27')](function(_0xed5304){return _0xed5304;});}return null;};}function removeEntity(_0x5abf95,_0x17ba8c){return function(_0x22c772){if(_0x22c772){return _0x22c772[_0x129c('0x28')]()[_0x129c('0x27')](function(){_0x5abf95[_0x129c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x158bca,_0x5406d2){return function(_0xbf9fac){if(!_0xbf9fac){_0x158bca['sendStatus'](0x194);}return _0xbf9fac;};}function handleError(_0x12c650,_0x1d3b7c){_0x1d3b7c=_0x1d3b7c||0x1f4;return function(_0x1b4d59){logger[_0x129c('0x29')](_0x1b4d59[_0x129c('0x2a')]);if(_0x1b4d59['name']){delete _0x1b4d59[_0x129c('0x2b')];}_0x12c650[_0x129c('0x1c')](_0x1d3b7c)[_0x129c('0x2c')](_0x1b4d59);};}exports['index']=function(_0x383ad1,_0x2462b4){var _0x5259e6={},_0x4e8193={},_0x5d7110={'count':0x0,'rows':[]};var _0x16a0fe=_[_0x129c('0x2d')](db[_0x129c('0x2e')][_0x129c('0x2f')],function(_0xc6ad63){return{'name':_0xc6ad63[_0x129c('0x30')],'type':_0xc6ad63[_0x129c('0x31')][_0x129c('0x32')]};});_0x4e8193[_0x129c('0x33')]=_[_0x129c('0x2d')](_0x16a0fe,_0x129c('0x2b'));_0x4e8193[_0x129c('0x34')]=_['keys'](_0x383ad1['query']);_0x4e8193[_0x129c('0x35')]=_[_0x129c('0x36')](_0x4e8193['model'],_0x4e8193[_0x129c('0x34')]);_0x5259e6[_0x129c('0x37')]=_[_0x129c('0x36')](_0x4e8193[_0x129c('0x33')],qs[_0x129c('0x38')](_0x383ad1[_0x129c('0x34')][_0x129c('0x38')]));_0x5259e6[_0x129c('0x37')]=_0x5259e6[_0x129c('0x37')]['length']?_0x5259e6[_0x129c('0x37')]:_0x4e8193[_0x129c('0x33')];if(!_0x383ad1[_0x129c('0x34')][_0x129c('0x39')]('nolimit')){_0x5259e6[_0x129c('0x20')]=qs[_0x129c('0x20')](_0x383ad1['query'][_0x129c('0x20')]);_0x5259e6[_0x129c('0x22')]=qs['offset'](_0x383ad1[_0x129c('0x34')][_0x129c('0x22')]);}_0x5259e6['order']=qs[_0x129c('0x3a')](_0x383ad1[_0x129c('0x34')][_0x129c('0x3a')]);_0x5259e6[_0x129c('0x3b')]=qs['filters'](_[_0x129c('0x3c')](_0x383ad1[_0x129c('0x34')],_0x4e8193['filters']),_0x16a0fe);if(_0x383ad1[_0x129c('0x34')]['filter']){_0x5259e6[_0x129c('0x3b')]=_[_0x129c('0x3d')](_0x5259e6['where'],{'$or':_[_0x129c('0x2d')](_0x16a0fe,function(_0x3882b5){if(_0x3882b5[_0x129c('0x31')]!==_0x129c('0x3e')){var _0x82d237={};_0x82d237[_0x3882b5[_0x129c('0x2b')]]={'$like':'%'+_0x383ad1['query']['filter']+'%'};return _0x82d237;}})});}_0x5259e6=_[_0x129c('0x3d')]({},_0x5259e6,_0x383ad1[_0x129c('0x3f')]);var _0x59eb15={'where':_0x5259e6[_0x129c('0x3b')]};return db[_0x129c('0x2e')][_0x129c('0x21')](_0x59eb15)[_0x129c('0x27')](function(_0x21b957){_0x5d7110[_0x129c('0x21')]=_0x21b957;if(_0x383ad1[_0x129c('0x34')][_0x129c('0x40')]){_0x5259e6[_0x129c('0x41')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x5259e6);})[_0x129c('0x27')](function(_0x47e4ef){_0x5d7110[_0x129c('0x42')]=_0x47e4ef;return _0x5d7110;})[_0x129c('0x27')](respondWithFilteredResult(_0x2462b4,_0x5259e6))[_0x129c('0x43')](handleError(_0x2462b4,null));};exports['show']=function(_0x3fed51,_0x3e0b62){var _0x2e262a={'raw':!![],'where':{'id':_0x3fed51[_0x129c('0x44')]['id']}},_0x34a84d={};_0x34a84d[_0x129c('0x33')]=_[_0x129c('0x45')](db[_0x129c('0x2e')][_0x129c('0x2f')]);_0x34a84d[_0x129c('0x34')]=_['keys'](_0x3fed51[_0x129c('0x34')]);_0x34a84d[_0x129c('0x35')]=_[_0x129c('0x36')](_0x34a84d[_0x129c('0x33')],_0x34a84d[_0x129c('0x34')]);_0x2e262a[_0x129c('0x37')]=_[_0x129c('0x36')](_0x34a84d[_0x129c('0x33')],qs['fields'](_0x3fed51[_0x129c('0x34')][_0x129c('0x38')]));_0x2e262a[_0x129c('0x37')]=_0x2e262a[_0x129c('0x37')][_0x129c('0x46')]?_0x2e262a[_0x129c('0x37')]:_0x34a84d[_0x129c('0x33')];if(_0x3fed51['query'][_0x129c('0x40')]){_0x2e262a[_0x129c('0x41')]=[{'all':!![]}];}_0x2e262a=_[_0x129c('0x3d')]({},_0x2e262a,_0x3fed51[_0x129c('0x3f')]);return db[_0x129c('0x2e')][_0x129c('0x47')](_0x2e262a)[_0x129c('0x27')](handleEntityNotFound(_0x3e0b62,null))[_0x129c('0x27')](respondWithResult(_0x3e0b62,null))['catch'](handleError(_0x3e0b62,null));};exports[_0x129c('0x48')]=function(_0x5b28a7,_0x306f30){return db[_0x129c('0x2e')]['create'](_0x5b28a7[_0x129c('0x49')],{})['then'](respondWithResult(_0x306f30,0xc9))[_0x129c('0x43')](handleError(_0x306f30,null));};exports[_0x129c('0x26')]=function(_0x18aa0e,_0x4722f5){if(_0x18aa0e['body']['id']){delete _0x18aa0e[_0x129c('0x49')]['id'];}return db['ChatTransferReport'][_0x129c('0x47')]({'where':{'id':_0x18aa0e[_0x129c('0x44')]['id']}})[_0x129c('0x27')](handleEntityNotFound(_0x4722f5,null))[_0x129c('0x27')](saveUpdates(_0x18aa0e['body'],null))[_0x129c('0x27')](respondWithResult(_0x4722f5,null))[_0x129c('0x43')](handleError(_0x4722f5,null));};exports[_0x129c('0x28')]=function(_0x3bec16,_0x1750b7){return db[_0x129c('0x2e')][_0x129c('0x47')]({'where':{'id':_0x3bec16[_0x129c('0x44')]['id']}})[_0x129c('0x27')](handleEntityNotFound(_0x1750b7,null))[_0x129c('0x27')](removeEntity(_0x1750b7,null))[_0x129c('0x43')](handleError(_0x1750b7,null));};exports[_0x129c('0x4a')]=function(_0x446023,_0x202151){return db[_0x129c('0x2e')][_0x129c('0x4a')]()[_0x129c('0x27')](respondWithResult(_0x202151,null))['catch'](handleError(_0x202151,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index eea543f..61bef34 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 _0x0154=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','define'];(function(_0x3a13cf,_0x478c62){var _0x4817c=function(_0x3a2e75){while(--_0x3a2e75){_0x3a13cf['push'](_0x3a13cf['shift']());}};_0x4817c(++_0x478c62);}(_0x0154,0x71));var _0x4015=function(_0x14a4ff,_0x7fcb89){_0x14a4ff=_0x14a4ff-0x0;var _0x2bd22d=_0x0154[_0x14a4ff];return _0x2bd22d;};'use strict';var _=require(_0x4015('0x0'));var util=require(_0x4015('0x1'));var logger=require(_0x4015('0x2'))('api');var moment=require(_0x4015('0x3'));var BPromise=require(_0x4015('0x4'));var rp=require(_0x4015('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4015('0x6'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x11bdd0,_0x45b284){return _0x11bdd0[_0x4015('0x7')](_0x4015('0x8'),attributes,{'tableName':_0x4015('0x9'),'paranoid':![],'indexes':[{'name':_0x4015('0xa'),'fields':[_0x4015('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb3d=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','report_chat_transfer','uniqueid','util'];(function(_0x14a468,_0x63dcdf){var _0x4305c6=function(_0x5e1b0e){while(--_0x5e1b0e){_0x14a468['push'](_0x14a468['shift']());}};_0x4305c6(++_0x63dcdf);}(_0xcb3d,0x9f));var _0xdcb3=function(_0x55642e,_0x3f7ab6){_0x55642e=_0x55642e-0x0;var _0x3e5fc9=_0xcb3d[_0x55642e];return _0x3e5fc9;};'use strict';var _=require('lodash');var util=require(_0xdcb3('0x0'));var logger=require(_0xdcb3('0x1'))(_0xdcb3('0x2'));var moment=require('moment');var BPromise=require(_0xdcb3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcb3('0x4'));var rimraf=require(_0xdcb3('0x5'));var config=require(_0xdcb3('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0xdcb3('0x7')]=function(_0x26e449,_0x52a5a7){return _0x26e449['define']('ChatTransferReport',attributes,{'tableName':_0xdcb3('0x8'),'paranoid':![],'indexes':[{'name':_0xdcb3('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 9e46711..d04c985 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 _0x1c4a=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x32c3c2,_0x42a5bf){var _0x43070a=function(_0x12d21d){while(--_0x12d21d){_0x32c3c2['push'](_0x32c3c2['shift']());}};_0x43070a(++_0x42a5bf);}(_0x1c4a,0x71));var _0xa1c4=function(_0x17de86,_0x514d01){_0x17de86=_0x17de86-0x0;var _0xdc4ef4=_0x1c4a[_0x17de86];return _0xdc4ef4;};'use strict';var _=require('lodash');var util=require(_0xa1c4('0x0'));var moment=require(_0xa1c4('0x1'));var BPromise=require(_0xa1c4('0x2'));var rs=require(_0xa1c4('0x3'));var fs=require('fs');var Redis=require(_0xa1c4('0x4'));var db=require(_0xa1c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c4('0x6'))(_0xa1c4('0x7'));var config=require(_0xa1c4('0x8'));var jayson=require(_0xa1c4('0x9'));var client=jayson[_0xa1c4('0xa')][_0xa1c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8316b1,_0x491938,_0x395d77){return new BPromise(function(_0x5b7851,_0x45af8e){return client['request'](_0x8316b1,_0x395d77)['then'](function(_0x14d852){logger[_0xa1c4('0xc')](_0xa1c4('0xd'),_0x491938,'request\x20sent');logger[_0xa1c4('0xe')](_0xa1c4('0xf'),_0x491938,_0xa1c4('0x10'),JSON['stringify'](_0x14d852));if(_0x14d852[_0xa1c4('0x11')]){if(_0x14d852['error'][_0xa1c4('0x12')]===0x1f4){logger[_0xa1c4('0x11')](_0xa1c4('0xd'),_0x491938,_0x14d852['error'][_0xa1c4('0x13')]);return _0x45af8e(_0x14d852[_0xa1c4('0x11')][_0xa1c4('0x13')]);}logger[_0xa1c4('0x11')](_0xa1c4('0xd'),_0x491938,_0x14d852[_0xa1c4('0x11')][_0xa1c4('0x13')]);return _0x5b7851(_0x14d852['error'][_0xa1c4('0x13')]);}else{logger['info'](_0xa1c4('0xd'),_0x491938,_0xa1c4('0x10'));_0x5b7851(_0x14d852[_0xa1c4('0x14')][_0xa1c4('0x13')]);}})[_0xa1c4('0x15')](function(_0x1f0485){logger[_0xa1c4('0x11')](_0xa1c4('0xd'),_0x491938,_0x1f0485);_0x45af8e(_0x1f0485);});});}
\ No newline at end of file
+var _0xf51c=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1fe3c8,_0x2be277){var _0x5bdac=function(_0x24cdb0){while(--_0x24cdb0){_0x1fe3c8['push'](_0x1fe3c8['shift']());}};_0x5bdac(++_0x2be277);}(_0xf51c,0x1e8));var _0xcf51=function(_0x1e209e,_0x29d879){_0x1e209e=_0x1e209e-0x0;var _0x1a8e54=_0xf51c[_0x1e209e];return _0x1a8e54;};'use strict';var _=require(_0xcf51('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf51('0x1'));var rs=require(_0xcf51('0x2'));var fs=require('fs');var Redis=require(_0xcf51('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf51('0x4'));var logger=require(_0xcf51('0x5'))(_0xcf51('0x6'));var config=require(_0xcf51('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf51('0x8')][_0xcf51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7b8439,_0x1e6f2e,_0x54b8b4){return new BPromise(function(_0x1fc514,_0x37949f){return client[_0xcf51('0xa')](_0x7b8439,_0x54b8b4)[_0xcf51('0xb')](function(_0x4be8f0){logger[_0xcf51('0xc')](_0xcf51('0xd'),_0x1e6f2e,_0xcf51('0xe'));logger['debug'](_0xcf51('0xf'),_0x1e6f2e,'request\x20sent',JSON['stringify'](_0x4be8f0));if(_0x4be8f0[_0xcf51('0x10')]){if(_0x4be8f0[_0xcf51('0x10')]['code']===0x1f4){logger[_0xcf51('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x1e6f2e,_0x4be8f0['error'][_0xcf51('0x11')]);return _0x37949f(_0x4be8f0['error'][_0xcf51('0x11')]);}logger[_0xcf51('0x10')](_0xcf51('0xd'),_0x1e6f2e,_0x4be8f0[_0xcf51('0x10')][_0xcf51('0x11')]);return _0x1fc514(_0x4be8f0[_0xcf51('0x10')][_0xcf51('0x11')]);}else{logger[_0xcf51('0xc')](_0xcf51('0xd'),_0x1e6f2e,_0xcf51('0xe'));_0x1fc514(_0x4be8f0[_0xcf51('0x12')][_0xcf51('0x11')]);}})[_0xcf51('0x13')](function(_0x2823a3){logger[_0xcf51('0x10')](_0xcf51('0xd'),_0x1e6f2e,_0x2823a3);_0x37949f(_0x2823a3);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 56e28a6..4d9fb27 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 _0x23f2=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x23f2,0x193));var _0x223f=function(_0x47855d,_0x5e51b8){_0x47855d=_0x47855d-0x0;var _0x1133b6=_0x23f2[_0x47855d];return _0x1133b6;};'use strict';var multer=require(_0x223f('0x0'));var util=require('util');var path=require(_0x223f('0x1'));var timeout=require(_0x223f('0x2'));var express=require(_0x223f('0x3'));var router=express[_0x223f('0x4')]();var fs_extra=require(_0x223f('0x5'));var auth=require(_0x223f('0x6'));var interaction=require(_0x223f('0x7'));var config=require(_0x223f('0x8'));var controller=require(_0x223f('0x9'));router[_0x223f('0xa')]('/',auth[_0x223f('0xb')](),controller['index']);router[_0x223f('0xa')](_0x223f('0xc'),auth['isAuthenticated'](),controller[_0x223f('0xd')]);router[_0x223f('0xa')](_0x223f('0xe'),auth['isAuthenticated'](),controller[_0x223f('0xf')]);router[_0x223f('0x10')]('/',auth[_0x223f('0xb')](),controller[_0x223f('0x11')]);router[_0x223f('0x12')](_0x223f('0xe'),auth[_0x223f('0xb')](),controller[_0x223f('0x13')]);router[_0x223f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x223f('0x15')]);module[_0x223f('0x16')]=router;
\ No newline at end of file
+var _0x5c72=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','destroy'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x5c72,0x156));var _0x25c7=function(_0x595f10,_0x9ac872){_0x595f10=_0x595f10-0x0;var _0x53770b=_0x5c72[_0x595f10];return _0x53770b;};'use strict';var multer=require(_0x25c7('0x0'));var util=require(_0x25c7('0x1'));var path=require(_0x25c7('0x2'));var timeout=require(_0x25c7('0x3'));var express=require(_0x25c7('0x4'));var router=express['Router']();var fs_extra=require(_0x25c7('0x5'));var auth=require(_0x25c7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25c7('0x7'));router['get']('/',auth[_0x25c7('0x8')](),controller[_0x25c7('0x9')]);router[_0x25c7('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x25c7('0xb')]);router[_0x25c7('0xa')](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0xd')]);router[_0x25c7('0xe')]('/',auth[_0x25c7('0x8')](),controller[_0x25c7('0xf')]);router[_0x25c7('0x10')](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0x11')]);router['delete'](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index dd93020..789452e 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 _0x6534=['Leave\x20your\x20comments','parse','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','INTEGER','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x6534,0x14b));var _0x4653=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6534[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x4653('0x0'));var rs=require(_0x4653('0x1'));module['exports']={'name':{'type':Sequelize[_0x4653('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x3')},'mapKeyOffline':{'type':Sequelize[_0x4653('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x4653('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x4')},'customerAlias':{'type':Sequelize[_0x4653('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'defaultValue':_0x4653('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4653('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4653('0x2')]},'animation':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4653('0x8')](_0x4653('0x9'),_0x4653('0xa')),'defaultValue':_0x4653('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0xb')},'start_chat_button':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xc')},'offline_chat_button':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0xe')},'download_transcript':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4653('0x10')]},'closingQuestion':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x13')},'noteTitle':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x14')},'placeholderMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x15')},'closingMessageButton':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xd')},'skipMessageButton':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x16')},'conditionAgreement':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4653('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x4653('0x17'),'thumb'),'defaultValue':_0x4653('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x4653('0x18')]({'items':[{'type':_0x4653('0x19'),'variable':null,'config':{'placeholder':_0x4653('0x1a'),'type':_0x4653('0x1b'),'required':!![]},'props':{'title':_0x4653('0x1a'),'helpText':''}},{'type':_0x4653('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4653('0x3'),'type':_0x4653('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4653('0x1c')](_0x4653('0x1d'))?JSON['parse'](this[_0x4653('0x1c')](_0x4653('0x1d'))):{};},'set':function(_0x42923b){return this[_0x4653('0x1e')](_0x4653('0x1d'),JSON[_0x4653('0x18')](_0x42923b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x4653('0x18')]({'items':[{'type':_0x4653('0x19'),'props':{'title':_0x4653('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x4653('0x3')},'variable':null},{'type':_0x4653('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x4653('0x20'),'helpText':_0x4653('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x4653('0x1c')]('offlineForm')?JSON[_0x4653('0x22')](this[_0x4653('0x1c')](_0x4653('0x23'))):{};},'set':function(_0x4bb3a0){return this[_0x4653('0x1e')](_0x4653('0x23'),JSON[_0x4653('0x18')](_0x4bb3a0));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4653('0x24')]();}},'autoclose':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4653('0x2')]},'forwardOffline':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4653('0x2')]},'waitingTitle':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x25')},'waitingMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0x28')},'skipUnmanaged':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x16')},'sendUnmanaged':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4653('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4653('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4653('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x2a')},'verticalAlignment':{'type':Sequelize[_0x4653('0x2b')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0x2c')},'messagesAlignment':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x4653('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4653('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4653('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4653('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0x2f')},'systemAvatar':{'type':Sequelize[_0x4653('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4653('0x2b')],'comment':_0x4653('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![],'comment':_0x4653('0x31'),'set':function(_0x3d9d8f){if(!_0x3d9d8f)this[_0x4653('0x1e')](_0x4653('0x32'),null);this[_0x4653('0x1e')]('mandatoryDisposition',_0x3d9d8f);}},'vidaooEscalation':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4653('0x2')]},'vidaooTopic':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'defaultValue':_0x4653('0x33')},'vidaooNote':{'type':Sequelize[_0x4653('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x4653('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4653('0x10')]}};
\ No newline at end of file
+var _0x3e40=['Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','TEXT','input','name','getDataValue','parse','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x5b80ff,_0x38517e){var _0x3cb5f5=function(_0x5566dd){while(--_0x5566dd){_0x5b80ff['push'](_0x5b80ff['shift']());}};_0x3cb5f5(++_0x38517e);}(_0x3e40,0x131));var _0x03e4=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x3e40[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x03e4('0x0'));var rs=require(_0x03e4('0x1'));module[_0x03e4('0x2')]={'name':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x03e4('0x3')]},'mapKey':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x4')},'mapKeyOffline':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x4')},'key':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':_0x03e4('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x03e4('0x3')]},'animation':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x03e4('0x8')](_0x03e4('0x9'),'squared'),'defaultValue':_0x03e4('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xa')},'offline_chat_button':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xb')},'header_offline':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xc')},'download_transcript':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x03e4('0x11')},'placeholderMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x12')},'closingMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x13')},'closingMessageButton':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xb')},'skipMessageButton':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x14')},'conditionAgreement':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x03e4('0x15'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x03e4('0x17'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x03e4('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x03e4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x03e4('0x4'),'type':_0x03e4('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x03e4('0x19')]('onlineForm')?JSON[_0x03e4('0x1a')](this[_0x03e4('0x19')](_0x03e4('0x1b'))):{};},'set':function(_0x218201){return this[_0x03e4('0x1c')](_0x03e4('0x1b'),JSON[_0x03e4('0x1d')](_0x218201));}},'offlineForm':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return JSON[_0x03e4('0x1d')]({'items':[{'type':_0x03e4('0x17'),'props':{'title':_0x03e4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x03e4('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x03e4('0x1e')},'props':{'title':_0x03e4('0x1e'),'helpText':_0x03e4('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x03e4('0x19')]('offlineForm')?JSON[_0x03e4('0x1a')](this[_0x03e4('0x19')](_0x03e4('0x20'))):{};},'set':function(_0x14f51c){return this[_0x03e4('0x1c')]('offlineForm',JSON['stringify'](_0x14f51c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x03e4('0x21')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x03e4('0x3')]},'forwardOffline':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x03e4('0x3')]},'waitingTitle':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x22')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x03e4('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x24')},'offlineMessageBody':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x26')},'skipUnmanaged':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x03e4('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x03e4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x03e4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x28')},'verticalAlignment':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x03e4('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':_0x03e4('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x03e4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x2b')},'systemAvatar':{'type':Sequelize[_0x03e4('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x03e4('0x6')],'comment':_0x03e4('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![],'comment':_0x03e4('0x2d'),'set':function(_0x576549){if(!_0x576549)this[_0x03e4('0x1c')](_0x03e4('0x2e'),null);this['setDataValue'](_0x03e4('0x2f'),_0x576549);}},'vidaooEscalation':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x03e4('0x3')]},'vidaooTopic':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':function(){return _0x03e4('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x03e4('0x7')],'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 63a6c15..3ee4a82 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 _0x2cd1=['addLogo','sitepic','file','filename','addCustomerAvatar','systemAvatar','getLogo','join','getLicense','isNil','server/files/images/logos/','download','root','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','ChatApplication','Applications','spread','account','list','applications','Contacts','contact','headers','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queueId','unshift','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','ChatOfflineMessage','fromString','originalname','server','attachments','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','addInteraction','ids','omit','getInteractions','Contact','Owner','fullname','Tags','color','tag','custom','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','URL','address','3.5.0','remote','x-real-ip','connection','remoteAddress','virtual','replace','render','alignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','html-to-text','url','api','../../config/environment','../../errors/api','handleError','redis','defaults','localhost','socket.io-emitter','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','ChatWebsites','UserProfileResource','sendStatus','name','send','Command','getSnippet','format','timezone','iftime\x20%s','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','map','Interval','Intervals','get','all','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','version','%s\x20%s','unknown','browser','device','%s\x20%s\x20%s','model','vendor','type','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','options'];(function(_0xaeb431,_0x248d88){var _0x2aea8a=function(_0x2caf18){while(--_0x2caf18){_0xaeb431['push'](_0xaeb431['shift']());}};_0x2aea8a(++_0x248d88);}(_0x2cd1,0x1d5));var _0x12cd=function(_0x3edaf9,_0x940c3d){_0x3edaf9=_0x3edaf9-0x0;var _0x2dc4b8=_0x2cd1[_0x3edaf9];return _0x2dc4b8;};'use strict';var Mustache=require(_0x12cd('0x0'));var util=require(_0x12cd('0x1'));var path=require(_0x12cd('0x2'));var ejs=require(_0x12cd('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12cd('0x4'));var querystring=require(_0x12cd('0x5'));var htmlToText=require(_0x12cd('0x6'));var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0x12cd('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x12cd('0x8'));var config=require(_0x12cd('0x9'));var APIOutOfIntervalError=require(_0x12cd('0xa'))['APIOutOfIntervalError'];var APINotFoundError=require(_0x12cd('0xa'))['APINotFoundError'];var APIHandleError=require(_0x12cd('0xa'))[_0x12cd('0xb')];var db=require('../../mysqldb')['db'];config[_0x12cd('0xc')]=_[_0x12cd('0xd')](config['redis'],{'host':_0x12cd('0xe'),'port':0x18eb});var socket=require(_0x12cd('0xf'))(new Redis(config[_0x12cd('0xc')]));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0x12cd('0x10')][_0x12cd('0x11')]({'port':0x232c});var client9002=jayson[_0x12cd('0x10')][_0x12cd('0x11')]({'port':0x232a});var client9003=jayson[_0x12cd('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x12cd('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x52e095,_0x4fb183,_0x281292,_0x17fe3d){return new Promise(function(_0x3c8d00,_0x20e83e){var _0xf155f6=_0x17fe3d||client;return _0xf155f6[_0x12cd('0x12')](_0x52e095,_0x281292)[_0x12cd('0x13')](function(_0x22b69e){logger[_0x12cd('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4fb183,_0x12cd('0x15'));logger[_0x12cd('0x16')](_0x12cd('0x17'),_0x4fb183,'request\x20sent',JSON[_0x12cd('0x18')](_0x22b69e));if(_0x22b69e[_0x12cd('0x19')]){if(_0x22b69e['error'][_0x12cd('0x1a')]===0x1f4){logger[_0x12cd('0x19')](_0x12cd('0x1b'),_0x4fb183,_0x22b69e[_0x12cd('0x19')]['message']);return _0x20e83e(_0x22b69e['error'][_0x12cd('0x1c')]);}logger[_0x12cd('0x19')](_0x12cd('0x1b'),_0x4fb183,_0x22b69e['error'][_0x12cd('0x1c')]);return _0x3c8d00(_0x22b69e[_0x12cd('0x19')]['message']);}else{logger[_0x12cd('0x14')](_0x12cd('0x1b'),_0x4fb183,_0x12cd('0x15'));_0x3c8d00(_0x22b69e[_0x12cd('0x1d')][_0x12cd('0x1c')]);}})[_0x12cd('0x1e')](function(_0x3b136e){logger['error'](_0x12cd('0x1b'),_0x4fb183,_0x3b136e);_0x20e83e(_0x3b136e);});});}function respondWithStatusCode(_0x423234,_0x4cd3cd){_0x4cd3cd=_0x4cd3cd||0xcc;return function(_0x19dd3b){if(_0x19dd3b){return _0x423234['sendStatus'](_0x4cd3cd);}return _0x423234[_0x12cd('0x1f')](_0x4cd3cd)[_0x12cd('0x20')]();};}function respondWithResult(_0xbf1a94,_0x14b0ba){_0x14b0ba=_0x14b0ba||0xc8;return function(_0x4d4f5e){if(_0x4d4f5e){return _0xbf1a94[_0x12cd('0x1f')](_0x14b0ba)[_0x12cd('0x21')](_0x4d4f5e);}};}function respondWithFilteredResult(_0x3c4c82,_0x4412cf){return function(_0x1cb388){if(_0x1cb388){var _0xf42fee=typeof _0x4412cf[_0x12cd('0x22')]===_0x12cd('0x23')&&typeof _0x4412cf[_0x12cd('0x24')]==='undefined';var _0xa80225=_0x1cb388['count'];var _0x5dcc06=_0xf42fee?0x0:_0x4412cf[_0x12cd('0x22')];var _0x3e4a58=_0xf42fee?_0x1cb388[_0x12cd('0x25')]:_0x4412cf['offset']+_0x4412cf[_0x12cd('0x24')];var _0x27a9a3;if(_0x3e4a58>=_0xa80225){_0x3e4a58=_0xa80225;_0x27a9a3=0xc8;}else{_0x27a9a3=0xce;}_0x3c4c82[_0x12cd('0x1f')](_0x27a9a3);return _0x3c4c82[_0x12cd('0x26')](_0x12cd('0x27'),_0x5dcc06+'-'+_0x3e4a58+'/'+_0xa80225)[_0x12cd('0x21')](_0x1cb388);}return null;};}function saveUpdates(_0x4857dc){return function(_0x258b46){if(_0x258b46){return _0x258b46['update'](_0x4857dc)[_0x12cd('0x13')](function(_0xfa6e7b){return _0xfa6e7b;});}return null;};}function removeEntity(_0x432d22){return function(_0x274c60){if(_0x274c60){return _0x274c60[_0x12cd('0x28')]()[_0x12cd('0x13')](function(){var _0x386d3e=_0x274c60['get']({'plain':!![]});var _0x201940=_0x12cd('0x29');return db[_0x12cd('0x2a')][_0x12cd('0x28')]({'where':{'type':_0x201940,'resourceId':_0x386d3e['id']}})[_0x12cd('0x13')](function(){return _0x274c60;});})[_0x12cd('0x13')](function(){_0x432d22[_0x12cd('0x1f')](0xcc)[_0x12cd('0x20')]();});}};}function handleEntityNotFound(_0x4189ca){return function(_0x1a6d09){if(!_0x1a6d09){_0x4189ca[_0x12cd('0x2b')](0x194);}return _0x1a6d09;};}function handleError(_0x17ca6e,_0x4fe049){_0x4fe049=_0x4fe049||0x1f4;return function(_0x314f34){logger[_0x12cd('0x19')](_0x314f34['stack']);if(_0x314f34[_0x12cd('0x2c')]){delete _0x314f34[_0x12cd('0x2c')];}_0x17ca6e[_0x12cd('0x1f')](_0x4fe049)[_0x12cd('0x2d')](_0x314f34);};}function iftimePromise(_0x4a6984,_0x423a86){return respondWithRpcPromise(_0x12cd('0x2e'),_0x12cd('0x2f'),{'command':_0x423a86['timezone']?util[_0x12cd('0x30')]('iftime\x20%s,%s',_0x4a6984['interval'],_0x423a86[_0x12cd('0x31')]):util['format'](_0x12cd('0x32'),_0x4a6984[_0x12cd('0x33')])},client9002)['then'](function(_0x3a424e){var _0x105c2c=_0x3a424e&&_0x3a424e['indexOf']('true')>=0x0?!![]:![];logger[_0x12cd('0x14')](_0x12cd('0x34'),_0x423a86['id'],_0x4a6984['id'],_0x4a6984[_0x12cd('0x33')],_0x105c2c?_0x12cd('0x35'):_0x12cd('0x36'),_0x423a86[_0x12cd('0x31')]?_0x423a86[_0x12cd('0x31')]:'No\x20timezone');return _0x105c2c;})[_0x12cd('0x1e')](function(_0x242853){logger[_0x12cd('0x19')](_0x12cd('0x34'),_0x423a86['id'],_0x4a6984['id'],_0x4a6984['interval'],util['inspect'](_0x242853,{'showHidden':![],'depth':null}),_0x423a86[_0x12cd('0x31')]?_0x423a86['timezone']:_0x12cd('0x37'));return![];});}function checkWebsiteIntervals(_0x25fc35){var _0x3d54ed=_[_0x12cd('0x38')](_0x25fc35[_0x12cd('0x39')][_0x12cd('0x3a')],function(_0x39697a){var _0x21a6e0=_0x39697a[_0x12cd('0x3b')]({'plain':!![]});return iftimePromise(_0x21a6e0,_0x25fc35);});return Promise[_0x12cd('0x3c')](_0x3d54ed)['then'](function(_0x68ed4e){return _['some'](_0x68ed4e);});}function createInteractionObject(_0x4c9789,_0x28a673,_0x38020d,_0x5ebe5a){var _0x597ef0=require(_0x12cd('0x3d'));var _0x4a31ee=new _0x597ef0();var _0x144d4f=_0x4a31ee[_0x12cd('0x3e')](_0x38020d[_0x12cd('0x3f')])['getResult']();var _0x3a65f1=_0x28a673[_0x12cd('0x40')];if(_0x38020d[_0x12cd('0x41')]){_0x3a65f1=_0x38020d[_0x12cd('0x41')];}else if(_0x38020d[_0x12cd('0x42')]){_0x3a65f1=_['first'](_0x38020d['x-forwarded-for'][_0x12cd('0x43')](','));}return{'ContactId':_0x5ebe5a['id'],'ChatWebsiteId':_0x4c9789,'from':(_0x5ebe5a[_0x12cd('0x44')]||'')+'\x20'+(_0x5ebe5a[_0x12cd('0x45')]||''),'customerIp':_0x3a65f1,'customerPort':_0x38020d[_0x12cd('0x46')]?_0x38020d[_0x12cd('0x46')]:null,'referer':_0x28a673[_0x12cd('0x47')],'browserName':_0x144d4f['browser']['name']&&_0x144d4f['browser'][_0x12cd('0x48')]?util[_0x12cd('0x30')](_0x12cd('0x49'),_0x144d4f['browser']['name'],_0x144d4f['browser'][_0x12cd('0x48')]):_0x12cd('0x4a'),'browserVersion':_0x144d4f[_0x12cd('0x4b')][_0x12cd('0x48')]||_0x12cd('0x4a'),'osName':util[_0x12cd('0x30')](_0x12cd('0x49'),_0x144d4f['os'][_0x12cd('0x2c')],_0x144d4f['os'][_0x12cd('0x48')]),'osVersion':_0x144d4f['os']['version'],'deviceModel':_0x144d4f[_0x12cd('0x4c')]['model']&&_0x144d4f[_0x12cd('0x4c')]['vendor']?util[_0x12cd('0x30')](_0x12cd('0x4d'),_0x144d4f[_0x12cd('0x4c')][_0x12cd('0x4e')],_0x144d4f[_0x12cd('0x4c')][_0x12cd('0x4f')],_0x144d4f[_0x12cd('0x4c')][_0x12cd('0x50')]):null,'deviceVendor':_0x144d4f['device'][_0x12cd('0x4f')],'deviceType':_0x144d4f[_0x12cd('0x4c')][_0x12cd('0x50')],'formData':JSON['stringify'](_0x28a673)};}exports[_0x12cd('0x51')]=function(_0x5b8fdd,_0x10d5dd){var _0x36063b={'include':[{'model':db['Pause'],'as':_0x12cd('0x52')}]},_0x5f0047={},_0x438515={'count':0x0,'rows':[]};var _0x2e7bcc=_['map'](db[_0x12cd('0x53')][_0x12cd('0x54')],function(_0x520e7a){return{'name':_0x520e7a[_0x12cd('0x55')],'type':_0x520e7a[_0x12cd('0x50')][_0x12cd('0x56')]};});_0x5f0047['model']=_[_0x12cd('0x38')](_0x2e7bcc,_0x12cd('0x2c'));_0x5f0047[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x5b8fdd[_0x12cd('0x57')]);_0x5f0047[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x5f0047[_0x12cd('0x4e')],_0x5f0047['query']);_0x36063b[_0x12cd('0x5b')]=_[_0x12cd('0x5a')](_0x5f0047[_0x12cd('0x4e')],qs['fields'](_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x36063b['attributes']=_0x36063b['attributes'][_0x12cd('0x5d')]?_0x36063b['attributes']:_0x5f0047[_0x12cd('0x4e')];if(!_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x5e')](_0x12cd('0x5f'))){_0x36063b[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x24')]);_0x36063b[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x36063b[_0x12cd('0x60')]=qs[_0x12cd('0x61')](_0x5b8fdd[_0x12cd('0x57')]['sort']);_0x36063b['where']=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x5b8fdd[_0x12cd('0x57')],_0x5f0047[_0x12cd('0x59')]),_0x2e7bcc);if(_0x5b8fdd[_0x12cd('0x57')]['filter']){_0x36063b[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x36063b[_0x12cd('0x63')],{'$or':_['map'](_0x2e7bcc,function(_0x2d5af2){if(_0x2d5af2[_0x12cd('0x50')]!==_0x12cd('0x65')){var _0x2059e2={};_0x2059e2[_0x2d5af2[_0x12cd('0x2c')]]={'$like':'%'+_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x2059e2;}})});}_0x36063b=_[_0x12cd('0x64')]({},_0x36063b,_0x5b8fdd['options']);var _0x2ed0fa={'where':_0x36063b[_0x12cd('0x63')]};return db[_0x12cd('0x53')]['count'](_0x2ed0fa)['then'](function(_0x51da24){_0x438515[_0x12cd('0x25')]=_0x51da24;if(_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x67')]){_0x36063b[_0x12cd('0x68')]=[{'all':!![]}];}return db[_0x12cd('0x53')][_0x12cd('0x69')](_0x36063b);})[_0x12cd('0x13')](function(_0x2e611f){_0x438515[_0x12cd('0x6a')]=_0x2e611f;return _0x438515;})[_0x12cd('0x13')](respondWithFilteredResult(_0x10d5dd,_0x36063b))[_0x12cd('0x1e')](handleError(_0x10d5dd,null));};exports[_0x12cd('0x6b')]=function(_0x3dd292,_0x15e4ed){var _0x4f4e83={'raw':![],'where':{'id':_0x3dd292[_0x12cd('0x6c')]['id']},'include':[{'model':db[_0x12cd('0x6d')],'as':_0x12cd('0x52')}]},_0x1f99ec={};_0x1f99ec['model']=_[_0x12cd('0x58')](db[_0x12cd('0x53')][_0x12cd('0x54')]);_0x1f99ec[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x3dd292['query']);_0x1f99ec[_0x12cd('0x59')]=_['intersection'](_0x1f99ec['model'],_0x1f99ec[_0x12cd('0x57')]);_0x4f4e83[_0x12cd('0x5b')]=_['intersection'](_0x1f99ec['model'],qs[_0x12cd('0x5c')](_0x3dd292[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x4f4e83[_0x12cd('0x5b')]=_0x4f4e83[_0x12cd('0x5b')]['length']?_0x4f4e83[_0x12cd('0x5b')]:_0x1f99ec[_0x12cd('0x4e')];if(_0x3dd292['query'][_0x12cd('0x67')]){_0x4f4e83[_0x12cd('0x68')]=[{'all':!![]}];}_0x4f4e83=_[_0x12cd('0x64')]({},_0x4f4e83,_0x3dd292['options']);return db[_0x12cd('0x53')][_0x12cd('0x6e')](_0x4f4e83)[_0x12cd('0x13')](handleEntityNotFound(_0x15e4ed,null))[_0x12cd('0x13')](respondWithResult(_0x15e4ed,null))[_0x12cd('0x1e')](handleError(_0x15e4ed,null));};exports[_0x12cd('0x6f')]=function(_0x1bd3d9,_0x3b5fba){return db[_0x12cd('0x53')]['create'](_0x1bd3d9[_0x12cd('0x70')],{})[_0x12cd('0x13')](function(_0x525a6a){var _0x3732f0=_0x1bd3d9[_0x12cd('0x71')][_0x12cd('0x3b')]({'plain':!![]});if(!_0x3732f0)throw new Error(_0x12cd('0x72'));if(_0x3732f0['role']==='user'){var _0x2f4f66=_0x525a6a['get']({'plain':!![]});var _0x540fb3=_0x12cd('0x29');return db['UserProfileSection'][_0x12cd('0x6e')]({'where':{'name':_0x540fb3,'userProfileId':_0x3732f0[_0x12cd('0x73')]},'raw':!![]})[_0x12cd('0x13')](function(_0x52d112){if(_0x52d112&&_0x52d112[_0x12cd('0x74')]===0x0){return db[_0x12cd('0x2a')][_0x12cd('0x6f')]({'name':_0x2f4f66[_0x12cd('0x2c')],'resourceId':_0x2f4f66['id'],'type':_0x52d112[_0x12cd('0x2c')],'sectionId':_0x52d112['id']},{})[_0x12cd('0x13')](function(){return _0x525a6a;});}else{return _0x525a6a;}})[_0x12cd('0x1e')](function(_0x57c389){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57c389);throw _0x57c389;});}return _0x525a6a;})[_0x12cd('0x13')](respondWithResult(_0x3b5fba,0xc9))[_0x12cd('0x1e')](handleError(_0x3b5fba,null));};exports[_0x12cd('0x75')]=function(_0x1d545b,_0x2dc9c0){if(_0x1d545b[_0x12cd('0x70')]['id']){delete _0x1d545b[_0x12cd('0x70')]['id'];}return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x1d545b[_0x12cd('0x6c')]['id']},'include':[{'model':db[_0x12cd('0x6d')],'as':_0x12cd('0x52')}]})[_0x12cd('0x13')](handleEntityNotFound(_0x2dc9c0,null))[_0x12cd('0x13')](saveUpdates(_0x1d545b['body'],null))[_0x12cd('0x13')](respondWithResult(_0x2dc9c0,null))['catch'](handleError(_0x2dc9c0,null));};exports[_0x12cd('0x28')]=function(_0x1c6148,_0x666a4c){return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x1c6148[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x666a4c,null))[_0x12cd('0x13')](removeEntity(_0x666a4c,null))[_0x12cd('0x1e')](handleError(_0x666a4c,null));};exports['describe']=function(_0x36f014,_0x585a27){return db[_0x12cd('0x53')][_0x12cd('0x76')]()[_0x12cd('0x13')](respondWithResult(_0x585a27,null))[_0x12cd('0x1e')](handleError(_0x585a27,null));};exports[_0x12cd('0x77')]=function(_0x6a2772,_0x21f3f1){if(_0x6a2772[_0x12cd('0x70')]['id']){delete _0x6a2772['body']['id'];}return db[_0x12cd('0x53')]['find']({'where':{'id':_0x6a2772[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x21f3f1,null))[_0x12cd('0x13')](function(_0x495208){if(_0x495208){_0x6a2772[_0x12cd('0x70')][_0x12cd('0x78')]=_0x495208['id'];return db[_0x12cd('0x79')][_0x12cd('0x6f')](_0x6a2772[_0x12cd('0x70')]);}})[_0x12cd('0x13')](respondWithResult(_0x21f3f1,null))['catch'](handleError(_0x21f3f1,null));};exports[_0x12cd('0x7a')]=function(_0x1997b8,_0xb83847){var _0x36236d={'raw':![],'where':{}};var _0x533319={};var _0x1c5124={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x12cd('0x7b')]({'where':{'id':_0x1997b8[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0xb83847,null))[_0x12cd('0x13')](function(_0x38b1e8){if(_0x38b1e8){_0x533319[_0x12cd('0x4e')]=_[_0x12cd('0x58')](db[_0x12cd('0x79')][_0x12cd('0x54')]);_0x533319[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x1997b8['query']);_0x533319[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x533319[_0x12cd('0x4e')],_0x533319['query']);_0x36236d[_0x12cd('0x5b')]=_['intersection'](_0x533319['model'],qs['fields'](_0x1997b8[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x36236d[_0x12cd('0x5b')]=_0x36236d[_0x12cd('0x5b')][_0x12cd('0x5d')]?_0x36236d['attributes']:_0x533319['model'];if(!_0x1997b8[_0x12cd('0x57')][_0x12cd('0x5e')]('nolimit')){_0x36236d[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x1997b8[_0x12cd('0x57')][_0x12cd('0x24')]);_0x36236d[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x1997b8[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x36236d['order']=qs['sort'](_0x1997b8[_0x12cd('0x57')][_0x12cd('0x61')]);_0x36236d[_0x12cd('0x63')]=qs['filters'](_[_0x12cd('0x62')](_0x1997b8[_0x12cd('0x57')],_0x533319[_0x12cd('0x59')]));_0x36236d[_0x12cd('0x63')][_0x12cd('0x78')]=_0x38b1e8['id'];if(_0x1997b8[_0x12cd('0x57')][_0x12cd('0x66')]){_0x36236d[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x36236d['where'],{'$or':_[_0x12cd('0x38')](_0x36236d['attributes'],function(_0x27987e){var _0x39ce3f={};_0x39ce3f[_0x27987e]={'$like':'%'+_0x1997b8[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x39ce3f;})});}_0x36236d=_['merge']({},_0x36236d,_0x1997b8['options']);return db['Disposition'][_0x12cd('0x25')]({'where':_0x36236d[_0x12cd('0x63')]})[_0x12cd('0x13')](function(_0x472e30){_0x1c5124[_0x12cd('0x25')]=_0x472e30;if(_0x1997b8[_0x12cd('0x57')][_0x12cd('0x67')]){_0x36236d[_0x12cd('0x68')]=[{'all':!![]}];}return db[_0x12cd('0x79')]['findAll'](_0x36236d);})[_0x12cd('0x13')](function(_0x2306db){_0x1c5124[_0x12cd('0x6a')]=_0x2306db;return _0x1c5124;});}})['then'](respondWithFilteredResult(_0xb83847,_0x36236d))['catch'](handleError(_0xb83847,null));};exports['removeDispositions']=function(_0x3cfec7,_0x3ee441){return db[_0x12cd('0x53')]['find']({'where':{'id':_0x3cfec7[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x3ee441,null))[_0x12cd('0x13')](function(_0xc5fc6f){if(_0xc5fc6f){return _0xc5fc6f[_0x12cd('0x7c')](_0x3cfec7[_0x12cd('0x57')]['ids']);}})[_0x12cd('0x13')](respondWithStatusCode(_0x3ee441,null))[_0x12cd('0x1e')](handleError(_0x3ee441,null));};exports[_0x12cd('0x7d')]=function(_0x455d5d,_0x275cb9){if(_0x455d5d[_0x12cd('0x70')]['id']){delete _0x455d5d['body']['id'];}return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x455d5d[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x275cb9,null))['then'](function(_0x1903d0){if(_0x1903d0){_0x455d5d['body']['ChatWebsiteId']=_0x1903d0['id'];return db[_0x12cd('0x7e')][_0x12cd('0x6f')](_0x455d5d[_0x12cd('0x70')]);}})[_0x12cd('0x13')](respondWithResult(_0x275cb9,null))['catch'](handleError(_0x275cb9,null));};exports[_0x12cd('0x7f')]=function(_0x404219,_0x47e832){var _0x455019={'raw':![],'where':{}};var _0x391274={};var _0x5a4d2b={'count':0x0,'rows':[]};return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x404219[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x47e832,null))[_0x12cd('0x13')](function(_0x24851f){if(_0x24851f){_0x391274[_0x12cd('0x4e')]=_[_0x12cd('0x58')](db[_0x12cd('0x7e')]['rawAttributes']);_0x391274['query']=_[_0x12cd('0x58')](_0x404219[_0x12cd('0x57')]);_0x391274[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x391274[_0x12cd('0x4e')],_0x391274[_0x12cd('0x57')]);_0x455019[_0x12cd('0x5b')]=_['intersection'](_0x391274[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x404219['query']['fields']));_0x455019[_0x12cd('0x5b')]=_0x455019[_0x12cd('0x5b')][_0x12cd('0x5d')]?_0x455019['attributes']:_0x391274[_0x12cd('0x4e')];if(!_0x404219[_0x12cd('0x57')][_0x12cd('0x5e')]('nolimit')){_0x455019['limit']=qs[_0x12cd('0x24')](_0x404219[_0x12cd('0x57')][_0x12cd('0x24')]);_0x455019[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x404219[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x455019['order']=qs[_0x12cd('0x61')](_0x404219[_0x12cd('0x57')][_0x12cd('0x61')]);_0x455019[_0x12cd('0x63')]=qs['filters'](_[_0x12cd('0x62')](_0x404219[_0x12cd('0x57')],_0x391274[_0x12cd('0x59')]));_0x455019[_0x12cd('0x63')]['ChatWebsiteId']=_0x24851f['id'];if(_0x404219['query'][_0x12cd('0x66')]){_0x455019[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x455019[_0x12cd('0x63')],{'$or':_['map'](_0x455019[_0x12cd('0x5b')],function(_0x36fc5c){var _0x35d79e={};_0x35d79e[_0x36fc5c]={'$like':'%'+_0x404219['query'][_0x12cd('0x66')]+'%'};return _0x35d79e;})});}_0x455019=_['merge']({},_0x455019,_0x404219[_0x12cd('0x80')]);return db[_0x12cd('0x7e')][_0x12cd('0x25')]({'where':_0x455019[_0x12cd('0x63')]})[_0x12cd('0x13')](function(_0x2b27c5){_0x5a4d2b[_0x12cd('0x25')]=_0x2b27c5;if(_0x404219['query'][_0x12cd('0x67')]){_0x455019[_0x12cd('0x68')]=[{'all':!![]}];}return db[_0x12cd('0x7e')][_0x12cd('0x69')](_0x455019);})[_0x12cd('0x13')](function(_0x37ed5b){_0x5a4d2b[_0x12cd('0x6a')]=_0x37ed5b;return _0x5a4d2b;});}})['then'](respondWithFilteredResult(_0x47e832,_0x455019))['catch'](handleError(_0x47e832,null));};exports['removeAnswers']=function(_0x2805ab,_0x2ddd6f){return db['ChatWebsite'][_0x12cd('0x6e')]({'where':{'id':_0x2805ab[_0x12cd('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2ddd6f,null))[_0x12cd('0x13')](function(_0x1b56d3){if(_0x1b56d3){return _0x1b56d3['removeAnswers'](_0x2805ab[_0x12cd('0x57')]['ids']);}})['then'](respondWithStatusCode(_0x2ddd6f,null))[_0x12cd('0x1e')](handleError(_0x2ddd6f,null));};exports[_0x12cd('0x81')]=function(_0xc60783,_0x4f2bc8){_0xc60783['body'][_0x12cd('0x82')]=_0xc60783[_0x12cd('0x83')][_0x12cd('0x84')];return db['ChatWebsite']['find']({'where':{'id':_0xc60783[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x4f2bc8,null))[_0x12cd('0x13')](saveUpdates(_0xc60783[_0x12cd('0x70')],null))[_0x12cd('0x13')](respondWithResult(_0x4f2bc8,null))['catch'](handleError(_0x4f2bc8,null));};exports['addAvatar']=function(_0x2aa9f1,_0x5cbd05){_0x2aa9f1[_0x12cd('0x70')]['agentAvatar']=_0x2aa9f1['file']['filename'];return db[_0x12cd('0x53')]['find']({'where':{'id':_0x2aa9f1[_0x12cd('0x6c')]['id']}})['then'](handleEntityNotFound(_0x5cbd05,null))[_0x12cd('0x13')](saveUpdates(_0x2aa9f1['body'],null))[_0x12cd('0x13')](respondWithResult(_0x5cbd05,null))[_0x12cd('0x1e')](handleError(_0x5cbd05,null));};exports[_0x12cd('0x85')]=function(_0x10cb2f,_0x59cf4b){_0x10cb2f[_0x12cd('0x70')]['customerAvatar']=_0x10cb2f[_0x12cd('0x83')][_0x12cd('0x84')];return db[_0x12cd('0x53')]['find']({'where':{'id':_0x10cb2f[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x59cf4b,null))[_0x12cd('0x13')](saveUpdates(_0x10cb2f[_0x12cd('0x70')],null))[_0x12cd('0x13')](respondWithResult(_0x59cf4b,null))[_0x12cd('0x1e')](handleError(_0x59cf4b,null));};exports['addSystemAvatar']=function(_0x233dad,_0x170d4b){_0x233dad[_0x12cd('0x70')][_0x12cd('0x86')]=_0x233dad[_0x12cd('0x83')][_0x12cd('0x84')];return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x233dad['params']['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x170d4b,null))[_0x12cd('0x13')](saveUpdates(_0x233dad[_0x12cd('0x70')],null))['then'](respondWithResult(_0x170d4b,null))['catch'](handleError(_0x170d4b,null));};exports[_0x12cd('0x87')]=function(_0x31b809,_0x4a49b2){var _0x3be59f=path[_0x12cd('0x88')](config['root'],'server/files/images/logos/default_logo.svg');var _0x2a11f8={'where':{'id':_0x31b809[_0x12cd('0x6c')]['id']},'attributes':['id',_0x12cd('0x82')],'raw':!![]};var _0x2ffcfd=![];return require('../../config/license/util')[_0x12cd('0x89')]()[_0x12cd('0x13')](function(_0x1009b2){if(_0x1009b2){_0x2ffcfd=_0x1009b2['custom'];}})[_0x12cd('0x13')](function(){return db[_0x12cd('0x53')][_0x12cd('0x6e')](_0x2a11f8);})[_0x12cd('0x13')](handleEntityNotFound(_0x4a49b2,null))[_0x12cd('0x13')](function(_0x44291a){if(_0x44291a){if(!_[_0x12cd('0x8a')](_0x44291a['sitepic'])){if(fs['existsSync'](path[_0x12cd('0x88')](config['root'],_0x12cd('0x8b'),_0x44291a[_0x12cd('0x82')]))&&_0x2ffcfd){_0x3be59f=path[_0x12cd('0x88')](config['root'],'server/files/images/logos/',_0x44291a['sitepic']);}}return _0x4a49b2[_0x12cd('0x8c')](_0x3be59f);}})[_0x12cd('0x1e')](handleError(_0x4a49b2,null));};exports['getAvatar']=function(_0x4dbfac,_0x23b348){var _0x5758d9=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x8e'));var _0x290423={'where':{'id':_0x4dbfac[_0x12cd('0x6c')]['id']},'attributes':['id',_0x12cd('0x8f')],'raw':!![]};return db['ChatWebsite']['find'](_0x290423)[_0x12cd('0x13')](handleEntityNotFound(_0x23b348,null))['then'](function(_0x4d53b6){if(_0x4d53b6){if(!_[_0x12cd('0x8a')](_0x4d53b6[_0x12cd('0x8f')])){if(fs[_0x12cd('0x90')](path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x91'),_0x4d53b6[_0x12cd('0x8f')]))){_0x5758d9=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],'server/files/images/avatars/',_0x4d53b6[_0x12cd('0x8f')]);}}return _0x23b348['download'](_0x5758d9);}})[_0x12cd('0x1e')](handleError(_0x23b348,null));};exports[_0x12cd('0x92')]=function(_0x31daef,_0x359fcc){var _0x14ac22=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x93'));var _0x8e3d83={'where':{'id':_0x31daef[_0x12cd('0x6c')]['id']},'attributes':['id','customerAvatar',_0x12cd('0x94')],'raw':!![]};return db[_0x12cd('0x53')][_0x12cd('0x6e')](_0x8e3d83)[_0x12cd('0x13')](handleEntityNotFound(_0x359fcc,null))['then'](function(_0x4be70c){if(_0x4be70c){if(!_[_0x12cd('0x8a')](_0x4be70c[_0x12cd('0x95')])){if(fs['existsSync'](path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x91'),_0x4be70c[_0x12cd('0x95')]))&&_0x4be70c[_0x12cd('0x94')]){_0x14ac22=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x91'),_0x4be70c[_0x12cd('0x95')]);}}return _0x359fcc[_0x12cd('0x8c')](_0x14ac22);}})[_0x12cd('0x1e')](handleError(_0x359fcc,null));};exports[_0x12cd('0x96')]=function(_0x2efd7e,_0x14082b){var _0x52e0c6=path['join'](config['root'],_0x12cd('0x97'));var _0x318ade={'where':{'id':_0x2efd7e[_0x12cd('0x6c')]['id']},'attributes':['id',_0x12cd('0x86')],'raw':!![]};return db[_0x12cd('0x53')][_0x12cd('0x6e')](_0x318ade)[_0x12cd('0x13')](handleEntityNotFound(_0x14082b,null))[_0x12cd('0x13')](function(_0xd44765){if(_0xd44765){if(!_['isNil'](_0xd44765[_0x12cd('0x86')])){if(fs[_0x12cd('0x90')](path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x91'),_0xd44765[_0x12cd('0x86')]))){_0x52e0c6=path['join'](config[_0x12cd('0x8d')],'server/files/images/avatars/',_0xd44765['systemAvatar']);}}return _0x14082b[_0x12cd('0x8c')](_0x52e0c6);}})['catch'](handleError(_0x14082b,null));};exports[_0x12cd('0x98')]=function(_0x2a3ecb,_0x5ad450){var _0x14c513={'body':_0x2a3ecb[_0x12cd('0x70')],'channel':_0x12cd('0x99')};var _0x5a8390=[];var _0x335fe2=[];var _0x3d9991={};var _0x2c0079=![];return db[_0x12cd('0x9a')]['describe']()['then'](function(_0x3413d9){if(!_0x3413d9){throw new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))](_0x12cd('0x9d'));}_0x5a8390=_['difference'](_[_0x12cd('0x58')](_0x3413d9),[_0x12cd('0x9e'),_0x12cd('0x9f')]);_0x335fe2=_[_0x12cd('0xa0')](_[_0x12cd('0x58')](_0x3413d9),['createdAt',_0x12cd('0x9f'),_0x12cd('0xa1'),_0x12cd('0xa2')]);if(_0x2a3ecb[_0x12cd('0x70')]['id']){delete _0x2a3ecb[_0x12cd('0x70')]['id'];}if(_[_0x12cd('0x8a')](_0x2a3ecb[_0x12cd('0x70')]['from'])){throw new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))]('from\x20is\x20mandatory');}if(_[_0x12cd('0x8a')](_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0x70')])||_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0x70')]===''){throw new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2a3ecb['body'][_0x12cd('0xa3')])){throw new db[(_0x12cd('0x9b'))]['ValidationError'](_0x12cd('0xa4')+_0x335fe2);}if(!_[_0x12cd('0xa5')](_0x335fe2,_0x2a3ecb['body'][_0x12cd('0xa3')])){throw new db[(_0x12cd('0x9b'))]['ValidationError'](_0x12cd('0xa6')+_0x335fe2);}_0x3d9991[_0x2a3ecb['body'][_0x12cd('0xa3')]]=_0x2a3ecb['body'][_0x12cd('0xa7')];})[_0x12cd('0x13')](function(){return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x2a3ecb[_0x12cd('0x6c')]['id']},'include':[{'model':db[_0x12cd('0xa8')],'as':_0x12cd('0xa9'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3d9991,'limit':0x1,'order':[[_0x12cd('0x9f'),_0x12cd('0xaa')]]}]},{'model':db[_0x12cd('0xab')],'as':_0x12cd('0xac')},{'model':db[_0x12cd('0x39')],'as':'Interval','include':[{'model':db[_0x12cd('0x39')],'as':'Intervals','attributes':['id',_0x12cd('0x33')],'raw':!![]}]}]});})[_0x12cd('0x13')](function(_0x216353){if(!_0x216353)throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x2a3ecb[_0x12cd('0x6c')]['id']));if(!_0x216353[_0x12cd('0x39')]||!_0x216353['Interval'][_0x12cd('0x3a')])return[_0x216353,!![]];return[_0x216353,checkWebsiteIntervals(_0x216353)];})[_0x12cd('0xad')](function(_0x7734dd,_0xcc01c8){if(!_0xcc01c8)throw new APIOutOfIntervalError();if(!_0x7734dd['List'])return;_0x14c513[_0x12cd('0xae')]=_0x7734dd;_0x14c513[_0x12cd('0xaf')]=_0x7734dd[_0x12cd('0xa9')];_0x14c513[_0x12cd('0xb0')]=_['orderBy'](_0x7734dd[_0x12cd('0xac')],['priority'],['asc']);if(_0x14c513[_0x12cd('0xae')][_0x12cd('0xac')]){delete _0x14c513[_0x12cd('0xae')][_0x12cd('0xac')];}if(_0x14c513[_0x12cd('0xae')]['List']&&_0x14c513[_0x12cd('0xae')]['List']['Contacts'][_0x12cd('0x5d')]){return _0x14c513['account'][_0x12cd('0xa9')][_0x12cd('0xb1')][0x0];}var _0x459a57=_[_0x12cd('0xd')](_0x2a3ecb[_0x12cd('0x70')],{'firstName':_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xa7')],'ListId':_0x7734dd[_0x12cd('0xa2')]});_0x459a57[_0x2a3ecb['body'][_0x12cd('0xa3')]]=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xa7')];return db[_0x12cd('0x9a')]['create'](_0x459a57,{'fields':_0x5a8390,'raw':!![]});})[_0x12cd('0x13')](function(_0x3d24c3){_0x14c513[_0x12cd('0xb2')]=_0x3d24c3;var _0x31b9a9=createInteractionObject(_0x2a3ecb[_0x12cd('0x6c')]['id'],_0x2a3ecb[_0x12cd('0x70')],_0x2a3ecb[_0x12cd('0xb3')],_0x3d24c3);var _0x4bb76d={'ChatWebsiteId':_0x2a3ecb[_0x12cd('0x6c')]['id'],'closed':![]};if(_0x2a3ecb['body'][_0x12cd('0xb4')]){_0x4bb76d['threadId']=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb4')];return db[_0x12cd('0xb5')][_0x12cd('0x6e')]({'where':_0x4bb76d})[_0x12cd('0x13')](function(_0x25e08a){if(_0x25e08a){_0x2c0079=!![];return _0x25e08a;}_0x31b9a9['threadId']=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb4')];_0x31b9a9[_0x12cd('0xb6')]=_0x2a3ecb[_0x12cd('0x70')]['externalUrl'];return db[_0x12cd('0xb5')][_0x12cd('0x6f')](_0x31b9a9);});}_0x4bb76d['ContactId']=_0x3d24c3['id'];if(_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb7')]&&_0x2a3ecb[_0x12cd('0x70')]['interaction']['id']){_0x4bb76d['id']=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb7')]['id'];return db[_0x12cd('0xb5')]['find']({'where':_0x4bb76d})['then'](function(_0x3aff96){if(_0x3aff96){_0x2c0079=!![];return _0x3aff96;}return db[_0x12cd('0xb5')]['create'](_0x31b9a9);});}return db[_0x12cd('0xb5')][_0x12cd('0x6f')](_0x31b9a9);})[_0x12cd('0x13')](function(_0x2d8792){if(!_0x2c0079)return _0x2d8792;var _0x26c640={'from':(_0x14c513[_0x12cd('0xb2')][_0x12cd('0x44')]||'')+'\x20'+(_0x14c513[_0x12cd('0xb2')][_0x12cd('0x45')]||'')};if(_0x2a3ecb['body']['threadId']&&_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb8')]&&_0x2a3ecb[_0x12cd('0x70')]['threadId']!=_0x2a3ecb['body']['messageId']){_0x26c640['threadId']=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb8')];}return _0x2d8792[_0x12cd('0x75')](_0x26c640);})[_0x12cd('0x13')](function(_0x37738c){_0x14c513[_0x12cd('0xb7')]=_0x37738c[_0x12cd('0x3b')]({'plain':!![]});_0x14c513[_0x12cd('0xb7')]['created']=!_0x2c0079;if(_0x14c513[_0x12cd('0xb7')][_0x12cd('0xb9')]){if(_0x14c513[_0x12cd('0xae')][_0x12cd('0xba')]){_0x14c513[_0x12cd('0xb0')][_0x12cd('0xbb')]({'id':0x0,'priority':_0x14c513[_0x12cd('0xb0')][_0x12cd('0x5d')]+0x1,'app':_0x12cd('0xbc'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x12cd('0xbd')][_0x12cd('0x6f')]({'body':_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0x70')],'ChatWebsiteId':_0x2a3ecb[_0x12cd('0x6c')]['id'],'ChatInteractionId':_0x37738c['id'],'direction':'in','ContactId':_0x14c513['contact']['id'],'AttachmentId':_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xbe')]});})[_0x12cd('0x13')](function(_0x16103e){_0x14c513['message']=_0x16103e;if(!_0x14c513[_0x12cd('0xb7')][_0x12cd('0xbf')]){return;}return db[_0x12cd('0xc0')]['find']({'attributes':['id',_0x12cd('0x2c')],'where':{'id':_0x14c513[_0x12cd('0xb7')][_0x12cd('0xbf')]}});})[_0x12cd('0x13')](function(_0xc5479){if(_0xc5479){_0x14c513[_0x12cd('0xb0')]['unshift']({'id':0x0,'priority':0x0,'app':_0x12cd('0xc1'),'appdata':_0xc5479[_0x12cd('0x2c')]+','+(_0x14c513[_0x12cd('0xae')][_0x12cd('0xc2')]||0xa),'interval':_0x12cd('0xc3')});_0x14c513[_0x12cd('0xc4')]=!![];}if(!_0x14c513['interaction']['queueId']){return;}return db[_0x12cd('0xc5')]['find']({'attributes':['id','name'],'where':{'id':_0x14c513[_0x12cd('0xb7')][_0x12cd('0xc6')]}});})['then'](function(_0x1b81a8){if(_0x1b81a8){_0x14c513[_0x12cd('0xb0')][_0x12cd('0xc7')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1b81a8[_0x12cd('0x2c')]+','+(_0x14c513[_0x12cd('0xae')][_0x12cd('0xc8')]||0x12c),'interval':_0x12cd('0xc3')});}return respondWithRpcPromise(_0x12cd('0xc9'),_0x12cd('0xca'),_0x14c513);})['then'](function(_0xf4be09){respondWithRpcPromise(_0x12cd('0xcb'),_0x12cd('0xcb'),{'event':_0x12cd('0x98'),'message':_0xf4be09},client9002);return _0xf4be09;})[_0x12cd('0x13')](respondWithResult(_0x5ad450,null))[_0x12cd('0x1e')](APIHandleError(_0x5ad450));};exports[_0x12cd('0xcc')]=function(_0xdd12c,_0xbd5c34){var _0x1bb99b,_0x1120bb,_0x3bc6e3;var _0x16218e=[];var _0x354422={};var _0xa006a3=_0xdd12c[_0x12cd('0xcd')]||[];var _0x57e8a9=[];var _0x5b83d1;return db['CmContact'][_0x12cd('0x76')]()[_0x12cd('0x13')](function(_0x416409){if(!_0x416409){throw new db['Sequelize'][(_0x12cd('0x9c'))](_0x12cd('0x9d'));}_0x16218e=_[_0x12cd('0xa0')](_[_0x12cd('0x58')](_0x416409),['createdAt',_0x12cd('0x9f'),_0x12cd('0xa1'),_0x12cd('0xa2')]);if(_0xdd12c[_0x12cd('0x70')]['id']){delete _0xdd12c[_0x12cd('0x70')]['id'];}if(_[_0x12cd('0x8a')](_0xdd12c[_0x12cd('0x70')]['from'])){throw _0xbd5c34[_0x12cd('0x1f')](0x1f4)['send'](new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))](_0x12cd('0xce')));}if(_[_0x12cd('0x8a')](_0xdd12c[_0x12cd('0x70')][_0x12cd('0x70')])||_0xdd12c['body'][_0x12cd('0x70')]===''){throw _0xbd5c34[_0x12cd('0x1f')](0x1f4)['send'](new db[(_0x12cd('0x9b'))]['ValidationError'](_0x12cd('0xcf')));}if(_[_0x12cd('0x8a')](_0xdd12c[_0x12cd('0x70')][_0x12cd('0xd0')])){throw _0xbd5c34[_0x12cd('0x1f')](0x1f4)[_0x12cd('0x2d')](new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16218e));}if(!_[_0x12cd('0xa5')](_0x16218e,_0xdd12c[_0x12cd('0x70')][_0x12cd('0xd0')])){throw _0xbd5c34[_0x12cd('0x1f')](0x1f4)['send'](new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))](_0x12cd('0xd1')+_0x16218e));}_0x354422[_0xdd12c['body'][_0x12cd('0xd0')]]=_0xdd12c['body'][_0x12cd('0xa7')];})['then'](function(){return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0xdd12c['params']['id']},'include':[{'model':db[_0x12cd('0xa8')],'as':_0x12cd('0xa9')},{'model':db[_0x12cd('0xd2')],'as':_0x12cd('0xd2')}]});})['then'](handleEntityNotFound(_0xbd5c34,null))[_0x12cd('0x13')](function(_0x5ea350){if(_0x5ea350&&_0x5ea350[_0x12cd('0xa9')]){_0x1120bb=_0x5ea350;var _0x35a80a=_['defaults'](_0xdd12c[_0x12cd('0x70')],{'firstName':_0xdd12c[_0x12cd('0x70')][_0x12cd('0xa7')],'phone':_0xdd12c['body'][_0x12cd('0xa7')],'ListId':_0x5ea350[_0x12cd('0xa2')]});_0x35a80a[_0xdd12c[_0x12cd('0x70')]['mapKeyOffline']]=_0xdd12c[_0x12cd('0x70')][_0x12cd('0xa7')];return db[_0x12cd('0x9a')]['findOrCreate']({'where':_0x354422,'defaults':_0x35a80a});}})[_0x12cd('0xad')](function(_0x413cf0){if(_0x413cf0){_0x3bc6e3=_0x413cf0;var _0x2d7f8a=fs[_0x12cd('0xd3')](path[_0x12cd('0x88')](config['root'],_0x12cd('0xd4')),_0x12cd('0xd5'));var _0x2d92cf=ejs['render'](_0x2d7f8a,{'body':_['toPairs'](_0xdd12c[_0x12cd('0x70')][_0x12cd('0x70')]),'bodyTitle':_0x1120bb['offlineMessageBody']});return db[_0x12cd('0xd6')][_0x12cd('0x6f')]({'body':_0x2d92cf,'plainBody':htmlToText[_0x12cd('0xd7')](_0x2d92cf),'ContactId':_0x413cf0['id'],'ChatWebsiteId':_0x1120bb['id']});}})[_0x12cd('0x13')](function(_0x1fb1a2){_0x5b83d1=_0x1fb1a2;if(_0xa006a3[_0x12cd('0x5d')]){var _0x4a4107=_0xa006a3['map'](function(_0x456c93){return{'name':_0x456c93[_0x12cd('0xd8')],'basename':_0x456c93[_0x12cd('0x84')],'type':_0x456c93['mimetype'],'ChatOfflineMessageId':_0x1fb1a2['id']};});_0x57e8a9=_0x4a4107[_0x12cd('0x38')](_0x2c948b=>{var _0x3dd6f0={'filename':_0x2c948b[_0x12cd('0x2c')],'path':path[_0x12cd('0x88')](config['root'],_0x12cd('0xd9'),_0x12cd('0xcd'),_0x12cd('0xda'),'offline-chat',_0x2c948b[_0x12cd('0xdb')])};return _0x3dd6f0;});if(!_0x1120bb['openNewInteraction']){return db[_0x12cd('0xdc')][_0x12cd('0xdd')](function(_0xae8c3d){return db[_0x12cd('0xde')][_0x12cd('0xdf')](_0x4a4107,{'transaction':_0xae8c3d});});}}})[_0x12cd('0x13')](function(){if(_0x5b83d1){_0x1bb99b=_0x5b83d1;return db['MailAccount'][_0x12cd('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x12cd('0xe0')],'as':_0x12cd('0xe1'),'raw':!![],'include':[{'model':db[_0x12cd('0xe2')],'as':_0x12cd('0xe2'),'raw':!![]}]}]});}})[_0x12cd('0x13')](function(_0x520c42){if(_0x520c42&&_0x520c42['Smtp']&&_0x1120bb[_0x12cd('0xe3')]&&_0x1120bb[_0x12cd('0xe4')]){var _0x3fa0ad=_0x520c42['getSmtpOptions']();return respondWithRpcPromise(_0x12cd('0xe5'),'sendMail',{'account':_0x3fa0ad,'message':{'from':util[_0x12cd('0x30')](_0x12cd('0xe6'),_0x520c42[_0x12cd('0x2c')],_0x520c42[_0x12cd('0xe7')]||_0x520c42[_0x12cd('0xe1')][_0x12cd('0x71')]),'to':_0x1120bb[_0x12cd('0xe4')],'subject':_0x1120bb[_0x12cd('0xe8')],'html':_0x1bb99b[_0x12cd('0x70')],'attachments':_0x57e8a9}},client9003)[_0x12cd('0x13')](function(){return _0x1bb99b;})[_0x12cd('0x1e')](function(_0x35d51d){logger['error'](_0x35d51d);});}})[_0x12cd('0x13')](function(){if(_0x1120bb&&_0x1120bb['openNewInteraction']&&_0x1120bb[_0x12cd('0xe9')]){var _0xc884fb=[];if(_0xa006a3[_0x12cd('0x5d')]){_0xc884fb=_0xa006a3[_0x12cd('0x38')](function(_0x1798ad){return{'name':_0x1798ad[_0x12cd('0xd8')],'basename':_0x1798ad['filename'],'type':_0x1798ad[_0x12cd('0xea')],'ChatOfflineMessageId':_0x5b83d1['id']};});}var _0x532d18;if(!_[_0x12cd('0x8a')](_0x1120bb[_0x12cd('0xeb')])){var _0x2b1d79=_[_0x12cd('0x38')](_0xdd12c[_0x12cd('0x70')],function(_0x596a6e){return _0x596a6e;});var _0x277b03=_[_0x12cd('0xec')](_0x2b1d79)[0x0];var _0x2344cf=_[_0x12cd('0xed')](_0x277b03,function(_0x5854ea){return _0x5854ea;});_0x532d18=_0x2344cf[0x1][_0x1120bb[_0x12cd('0xeb')]];}var _0x528056={'from':_0x3bc6e3['email'],'firstName':_0x3bc6e3[_0x12cd('0x44')],'lastName':_0x3bc6e3['lastName'],'mapKey':_0x12cd('0xe7'),'message':{'from':_0x3bc6e3[_0x12cd('0xe7')],'to':_0x1120bb['MailAccount']['email'],'cc':'','subject':_[_0x12cd('0x8a')](_0x532d18)?_0x1120bb[_0x12cd('0xe8')]:_0x532d18,'messageId':'','sentAt':new Date(),'attach':_0xc884fb[_0x12cd('0x5d')],'attachments':_0xc884fb,'originChannel':_0x12cd('0xee'),'ChatWebsiteId':_0x1120bb['id'],'ChatOfflineMessageId':_0x1bb99b['id'],'originTo':_0x1120bb['MailAccount'][_0x12cd('0xe7')]},'body':_0x1bb99b[_0x12cd('0x70')]};var _0x1af560={'account':{'id':_0x1120bb[_0x12cd('0xe9')]},'body':_0x528056,'log':_0x12cd('0xef')};return respondWithRpcPromise(_0x12cd('0xef'),_0x12cd('0xf0'),_0x1af560,client9001)[_0x12cd('0x13')](function(){return _0x1bb99b;})[_0x12cd('0x1e')](function(_0x32b757){logger[_0x12cd('0x19')](_0x32b757);});}return;})[_0x12cd('0x13')](function(){if(_0x1bb99b){return _0x1bb99b;}})[_0x12cd('0x13')](respondWithResult(_0xbd5c34,null))[_0x12cd('0x1e')](function(){for(var _0x4c28c2 of _0xa006a3){var _0x5b9618=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0xd9'),_0x12cd('0xcd'),_0x12cd('0xda'),_0x12cd('0xf1'),_0x4c28c2['filename']);fs_extra['remove'](_0x5b9618)[_0x12cd('0x1e')](function(_0x5b76a1){logger[_0x12cd('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x5b9618,_0x5b76a1);});}});};exports[_0x12cd('0xf2')]=function(_0x5b95fc,_0x3f9562){return db[_0x12cd('0xb5')]['find']({'where':{'id':_0x5b95fc[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x3f9562,null))[_0x12cd('0x13')](function(_0x501354){if(_0x501354){return _0x501354['addInteraction'](_0x5b95fc[_0x12cd('0x70')][_0x12cd('0xf3')],_[_0x12cd('0xf4')](_0x5b95fc[_0x12cd('0x70')],[_0x12cd('0xf3'),'id'])||{});}})[_0x12cd('0x13')](respondWithResult(_0x3f9562,null))[_0x12cd('0x1e')](handleError(_0x3f9562,null));};exports[_0x12cd('0xf5')]=function(_0x442760,_0x55728a){var _0x5e882d={'raw':![],'where':{}};var _0x5f0eeb={};var _0x753532={'count':0x0,'rows':[]};return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x442760[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x55728a,null))[_0x12cd('0x13')](function(_0x29169e){if(_0x29169e){_0x5f0eeb[_0x12cd('0x4e')]=_['keys'](db['ChatInteraction'][_0x12cd('0x54')]);_0x5f0eeb[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x442760['query']);_0x5f0eeb[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x5f0eeb[_0x12cd('0x4e')],_0x5f0eeb['query']);_0x5e882d[_0x12cd('0x5b')]=_['intersection'](_0x5f0eeb[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x442760[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x5e882d[_0x12cd('0x5b')]=_0x5e882d[_0x12cd('0x5b')]['length']?_0x5e882d['attributes']:_0x5f0eeb[_0x12cd('0x4e')];if(!_0x442760[_0x12cd('0x57')][_0x12cd('0x5e')]('nolimit')){_0x5e882d[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x442760[_0x12cd('0x57')][_0x12cd('0x24')]);_0x5e882d[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x442760[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x5e882d[_0x12cd('0x60')]=qs[_0x12cd('0x61')](_0x442760[_0x12cd('0x57')][_0x12cd('0x61')]);_0x5e882d[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_['pick'](_0x442760[_0x12cd('0x57')],_0x5f0eeb[_0x12cd('0x59')]));_0x5e882d[_0x12cd('0x63')][_0x12cd('0x78')]=_0x29169e['id'];if(_0x442760[_0x12cd('0x57')][_0x12cd('0x66')]){_0x5e882d[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x5e882d[_0x12cd('0x63')],{'$or':_[_0x12cd('0x38')](_0x5e882d['attributes'],function(_0x3895ae){var _0xc3fe18={};_0xc3fe18[_0x3895ae]={'$like':'%'+_0x442760[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0xc3fe18;})});}_0x5e882d=_['merge']({},_0x5e882d,_0x442760[_0x12cd('0x80')]);return db['ChatInteraction'][_0x12cd('0x25')]({'where':_0x5e882d[_0x12cd('0x63')]})['then'](function(_0x56ca9f){_0x753532[_0x12cd('0x25')]=_0x56ca9f;if(_0x442760[_0x12cd('0x57')]['includeAll']){_0x5e882d[_0x12cd('0x68')]=[{'model':db['CmContact'],'as':_0x12cd('0xf6'),'required':![]},{'model':db['User'],'as':_0x12cd('0xf7'),'attributes':[_0x12cd('0x2c'),_0x12cd('0xf8'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x12cd('0xf9'),'attributes':['id',_0x12cd('0x2c'),_0x12cd('0xfa')],'where':_0x442760[_0x12cd('0x57')][_0x12cd('0xfb')]?{'id':_0x442760[_0x12cd('0x57')]['tag']}:undefined,'required':_0x442760['query']['tag']?!![]:![]}];}return db[_0x12cd('0xb5')][_0x12cd('0x69')](_0x5e882d);})['then'](function(_0x106c17){_0x753532[_0x12cd('0x6a')]=_0x106c17;return _0x753532;});}})['then'](respondWithFilteredResult(_0x55728a,_0x5e882d))['catch'](handleError(_0x55728a,null));};exports['getSnippet']=function(_0x52b360,_0x4d28e2){var _0x50f7d3=0x0;var _0x20b98a=0x0;var _0x24e44d=![];var _0x59ee60;var _0x2ef3b1;return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x52b360['params']['id']},'include':[{'model':db['Interval'],'as':_0x12cd('0x39'),'include':[{'model':db[_0x12cd('0x39')],'as':'Intervals','attributes':['id',_0x12cd('0x33')]}]}]})[_0x12cd('0x13')](handleEntityNotFound(_0x4d28e2,null))[_0x12cd('0x13')](function(_0x4c070c){if(_0x4c070c){_0x59ee60=_0x4c070c;return _0x4c070c['getProactiveActions']({'raw':!![]});}})[_0x12cd('0x13')](function(_0x59dd4f){if(_0x59ee60){if(_0x59dd4f){_0x2ef3b1=_0x59dd4f;}}return require('../../config/license/util')[_0x12cd('0x89')]();})['then'](function(_0x3a4b80){if(_0x3a4b80){_0x20b98a=_0x3a4b80['virtual'];_0x24e44d=_0x3a4b80[_0x12cd('0xfc')];}})[_0x12cd('0x13')](function(){return db['ChatInteraction'][_0x12cd('0x25')]({'where':{'closed':![]}});})[_0x12cd('0x13')](function(_0x2a25f5){_0x50f7d3=_0x2a25f5;if(_0x20b98a&&_0x2a25f5>_0x20b98a){return db[_0x12cd('0xfd')][_0x12cd('0x7b')]({'where':{'id':0x1}})[_0x12cd('0x13')](function(_0x241790){if(_0x241790){_0x241790[_0x12cd('0xfe')](_0x12cd('0xff'));}});}})[_0x12cd('0x13')](function(){if(!_0x59ee60[_0x12cd('0x39')]||!_0x59ee60[_0x12cd('0x39')][_0x12cd('0x3a')])return!![];return checkWebsiteIntervals(_0x59ee60);})[_0x12cd('0x13')](function(_0x5845bf){var _0x5213b0=fs['readFileSync'](path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x100')),_0x12cd('0xd5'));var _0x3a5c7b=new url[(_0x12cd('0x101'))](_0x59ee60[_0x12cd('0x102')])['origin'];var _0x3984af=_0x12cd('0x103');var _0x34684b=![];var _0x444bc3={'chatVersion':_0x3984af,'chatWebsiteAddressOrigin':_0x3a5c7b,'remote':_0x59ee60[_0x12cd('0x104')],'query':querystring[_0x12cd('0x18')](_[_0x12cd('0x64')](_0x59ee60[_0x12cd('0x3b')]({'plain':!![]}),{'customerIp':_0x52b360[_0x12cd('0xb3')][_0x12cd('0x42')]||_0x52b360[_0x12cd('0xb3')][_0x12cd('0x105')]||_0x52b360[_0x12cd('0x106')][_0x12cd('0x107')]||_0x52b360['ip'],'referer':_0x52b360[_0x12cd('0xb3')][_0x12cd('0x47')],'openedInteractions':_0x50f7d3,'maxInteractions':_0x20b98a,'virtual':_0x24e44d[_0x12cd('0x108')],'online':_0x5845bf,'custom':_0x24e44d}))[_0x12cd('0x109')](/'/g,'\x5c\x27')};_0x4d28e2[_0x12cd('0x2d')](ejs[_0x12cd('0x10a')](Mustache[_0x12cd('0x10a')](_0x5213b0,_0x444bc3),{'proactiveActions':_0x2ef3b1,'alignment':_0x59ee60[_0x12cd('0x10b')],'verticalAlignment':_0x59ee60['verticalAlignment'],'div_color':_0x59ee60[_0x12cd('0xfa')],'labelText':_0x59ee60['labelText'],'text_color':_0x59ee60[_0x12cd('0x10c')],'text_button_color':_0x59ee60[_0x12cd('0x10d')],'button_color':_0x59ee60[_0x12cd('0x10e')],'background_color':_0x59ee60[_0x12cd('0x10f')],'hideWhenOffline':_0x59ee60[_0x12cd('0x110')],'intervalId':_0x59ee60[_0x12cd('0x111')],'isDevelopment':_0x34684b,'chatVersion':_0x3984af}));})[_0x12cd('0x1e')](handleError(_0x4d28e2,null));};exports[_0x12cd('0x112')]=function(_0x4830f6,_0x345053){var _0x44ab3f=_0x4830f6[_0x12cd('0x6c')]['id'];var _0x4cb9f3=_0x4830f6[_0x12cd('0x70')];var _0x4e18eb=0xc8;var _0x50fd58=null;return db['sequelize'][_0x12cd('0xdd')]({'isolationLevel':db[_0x12cd('0xdc')][_0x12cd('0x113')]['ISOLATION_LEVELS'][_0x12cd('0x114')]},function(_0x155d3c){return db['ChatWebsite']['findOne']({'where':{'id':_0x44ab3f},'transaction':_0x155d3c})[_0x12cd('0x13')](function(_0x37d75a){if(_0x37d75a){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x44ab3f},'transaction':_0x155d3c})['then'](function(){var _0x5452ec=_[_0x12cd('0x38')](_0x4cb9f3,function(_0x54798a){_0x54798a[_0x12cd('0x78')]=_0x44ab3f;return _0x54798a;});return db[_0x12cd('0xab')][_0x12cd('0xdf')](_0x5452ec,{'transaction':_0x155d3c});});}else{_0x4e18eb=0x194;_0x50fd58=[];}});})[_0x12cd('0x13')](function(){if(_0x4e18eb!==0x194){return db[_0x12cd('0xab')][_0x12cd('0x115')]({'where':{'ChatWebsiteId':_0x44ab3f},'order':_0x12cd('0x116')})['then'](function(_0x258967){_0x50fd58=_0x258967;});}})['catch'](function(_0x54ea7e){_0x4e18eb=0x1f4;logger['error'](_0x54ea7e['stack']);if(_0x54ea7e['name']){delete _0x54ea7e[_0x12cd('0x2c')];}_0x50fd58=_0x54ea7e;})[_0x12cd('0x117')](function(){if(_0x50fd58===null){_0x345053[_0x12cd('0x2b')](_0x4e18eb);}else{if(_0x4e18eb===0x1f4){_0x345053['status'](_0x4e18eb)[_0x12cd('0x2d')](_0x50fd58);}else{_0x345053[_0x12cd('0x1f')](_0x4e18eb)[_0x12cd('0x21')](_0x50fd58);}}});};exports[_0x12cd('0x118')]=function(_0x1fef1d,_0x5909f2){var _0x927a45={};var _0x5e9936={};var _0x427dce;var _0x4cf473;return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x1fef1d[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x5909f2,null))[_0x12cd('0x13')](function(_0x5aa08b){if(_0x5aa08b){_0x427dce=_0x5aa08b;_0x5e9936[_0x12cd('0x4e')]=_[_0x12cd('0x58')](db[_0x12cd('0xab')][_0x12cd('0x54')]);_0x5e9936['query']=_[_0x12cd('0x58')](_0x1fef1d[_0x12cd('0x57')]);_0x5e9936['filters']=_['intersection'](_0x5e9936[_0x12cd('0x4e')],_0x5e9936['query']);_0x927a45[_0x12cd('0x5b')]=_[_0x12cd('0x5a')](_0x5e9936[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x927a45[_0x12cd('0x5b')]=_0x927a45[_0x12cd('0x5b')][_0x12cd('0x5d')]?_0x927a45[_0x12cd('0x5b')]:_0x5e9936['model'];_0x927a45[_0x12cd('0x60')]=qs[_0x12cd('0x61')](_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x61')]);_0x927a45[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x1fef1d[_0x12cd('0x57')],_0x5e9936[_0x12cd('0x59')]));if(_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x66')]){_0x927a45[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x927a45[_0x12cd('0x63')],{'$or':_[_0x12cd('0x38')](_0x927a45[_0x12cd('0x5b')],function(_0x5da4cf){var _0x1ff8fc={};_0x1ff8fc[_0x5da4cf]={'$like':'%'+_0x1fef1d['query']['filter']+'%'};return _0x1ff8fc;})});}_0x927a45=_['merge']({},_0x927a45,_0x1fef1d['options']);return _0x427dce[_0x12cd('0x118')](_0x927a45);}})['then'](function(_0xa77b36){if(_0xa77b36){_0x4cf473=_0xa77b36[_0x12cd('0x5d')];if(!_0x1fef1d[_0x12cd('0x57')]['hasOwnProperty'](_0x12cd('0x5f'))){_0x927a45[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x24')]);_0x927a45[_0x12cd('0x22')]=qs['offset'](_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x22')]);}return _0x427dce[_0x12cd('0x118')](_0x927a45);}})[_0x12cd('0x13')](function(_0x41619c){if(_0x41619c){return _0x41619c?{'count':_0x4cf473,'rows':_0x41619c}:null;}})[_0x12cd('0x13')](respondWithResult(_0x5909f2,null))[_0x12cd('0x1e')](handleError(_0x5909f2,null));};exports[_0x12cd('0x119')]=function(_0x135d8d,_0x274fb2){return db[_0x12cd('0x11a')]['find']({'where':{'id':_0x135d8d['params']['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x274fb2,null))[_0x12cd('0x13')](function(_0x445b9b){if(_0x445b9b){return _0x445b9b[_0x12cd('0x119')](_0x135d8d[_0x12cd('0x70')][_0x12cd('0xf3')],_['omit'](_0x135d8d['body'],[_0x12cd('0xf3'),'id'])||{});}})[_0x12cd('0x13')](respondWithResult(_0x274fb2,null))[_0x12cd('0x1e')](handleError(_0x274fb2,null));};exports[_0x12cd('0x11b')]=function(_0x559c6c,_0x138d75){var _0x37c833={};var _0x310a8d={};var _0x2d22fb;var _0xaffe48;return db[_0x12cd('0x53')]['findOne']({'where':{'id':_0x559c6c[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x138d75,null))['then'](function(_0x58ec37){if(_0x58ec37){_0x2d22fb=_0x58ec37;_0x310a8d[_0x12cd('0x4e')]=_[_0x12cd('0x58')](db[_0x12cd('0x11c')][_0x12cd('0x54')]);_0x310a8d['query']=_[_0x12cd('0x58')](_0x559c6c[_0x12cd('0x57')]);_0x310a8d[_0x12cd('0x59')]=_['intersection'](_0x310a8d[_0x12cd('0x4e')],_0x310a8d[_0x12cd('0x57')]);_0x37c833['attributes']=_[_0x12cd('0x5a')](_0x310a8d[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x559c6c[_0x12cd('0x57')]['fields']));_0x37c833[_0x12cd('0x5b')]=_0x37c833['attributes'][_0x12cd('0x5d')]?_0x37c833[_0x12cd('0x5b')]:_0x310a8d[_0x12cd('0x4e')];_0x37c833[_0x12cd('0x60')]=qs['sort'](_0x559c6c[_0x12cd('0x57')]['sort']);_0x37c833[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x559c6c['query'],_0x310a8d[_0x12cd('0x59')]));if(_0x559c6c[_0x12cd('0x57')]['filter']){_0x37c833['where']=_[_0x12cd('0x64')](_0x37c833['where'],{'$or':_['map'](_0x37c833[_0x12cd('0x5b')],function(_0x39fd3b){var _0x328192={};_0x328192[_0x39fd3b]={'$like':'%'+_0x559c6c[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x328192;})});}_0x37c833=_[_0x12cd('0x64')]({},_0x37c833,_0x559c6c[_0x12cd('0x80')]);return _0x2d22fb[_0x12cd('0x11b')](_0x37c833);}})[_0x12cd('0x13')](function(_0x3ee4f1){if(_0x3ee4f1){_0xaffe48=_0x3ee4f1['length'];if(!_0x559c6c[_0x12cd('0x57')]['hasOwnProperty'](_0x12cd('0x5f'))){_0x37c833[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x559c6c[_0x12cd('0x57')][_0x12cd('0x24')]);_0x37c833[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x559c6c[_0x12cd('0x57')][_0x12cd('0x22')]);}return _0x2d22fb['getProactiveActions'](_0x37c833);}})['then'](function(_0x988c01){if(_0x988c01){return _0x988c01?{'count':_0xaffe48,'rows':_0x988c01}:null;}})['then'](respondWithResult(_0x138d75,null))[_0x12cd('0x1e')](handleError(_0x138d75,null));};exports[_0x12cd('0x11d')]=function(_0x588f5e,_0x597a66){var _0x2ae8cf=_0x588f5e[_0x12cd('0x57')][_0x12cd('0x11e')]==='false'?_0x12cd('0x11f'):_0x12cd('0x120');return db['ChatWebsite'][_0x12cd('0x6e')]({'attributes':['id',_0x2ae8cf],'where':{'id':_0x588f5e[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x597a66,null))['then'](function(_0x141659){if(_0x141659){var _0x5c4204=_0x141659[_0x2ae8cf];var _0x118052=_0x5c4204&&_0x5c4204[_0x12cd('0x121')]?_0x5c4204[_0x12cd('0x121')]:[];_0x597a66[_0x12cd('0x2d')]({'fromKey':_[_0x12cd('0x8a')](_0x5c4204['fromKey'])?undefined:_0x5c4204[_0x12cd('0x122')],'count':_0x118052[_0x12cd('0x5d')],'rows':_0x118052});}})[_0x12cd('0x1e')](handleError(_0x597a66,null));};exports['getOfflineMessages']=function(_0x232d5a,_0xb0a2fe){var _0x10f4df={'raw':![],'where':{}};var _0x3925e0={};var _0x706fe7={'count':0x0,'rows':[]};return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x232d5a[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0xb0a2fe,null))[_0x12cd('0x13')](function(_0x32b4b2){if(_0x32b4b2){_0x3925e0['model']=_[_0x12cd('0x58')](db[_0x12cd('0xd6')][_0x12cd('0x54')]);_0x3925e0[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x232d5a['query']);_0x3925e0[_0x12cd('0x59')]=_['intersection'](_0x3925e0[_0x12cd('0x4e')],_0x3925e0[_0x12cd('0x57')]);_0x10f4df[_0x12cd('0x5b')]=_[_0x12cd('0x5a')](_0x3925e0[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x232d5a[_0x12cd('0x57')]['fields']));_0x10f4df[_0x12cd('0x5b')]=_0x10f4df[_0x12cd('0x5b')]['length']?_0x10f4df[_0x12cd('0x5b')]:_0x3925e0[_0x12cd('0x4e')];if(!_0x232d5a[_0x12cd('0x57')][_0x12cd('0x5e')](_0x12cd('0x5f'))){_0x10f4df[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x232d5a[_0x12cd('0x57')][_0x12cd('0x24')]);_0x10f4df[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x232d5a[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x10f4df[_0x12cd('0x60')]=qs[_0x12cd('0x61')](_0x232d5a[_0x12cd('0x57')][_0x12cd('0x61')]);_0x10f4df[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x232d5a[_0x12cd('0x57')],_0x3925e0['filters']));_0x10f4df[_0x12cd('0x63')][_0x12cd('0x78')]=_0x32b4b2['id'];if(_0x232d5a['query'][_0x12cd('0x66')]){_0x10f4df[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x10f4df[_0x12cd('0x63')],{'$or':_['map'](_0x10f4df[_0x12cd('0x5b')],function(_0x1a404d){var _0x4a34b2={};_0x4a34b2[_0x1a404d]={'$like':'%'+_0x232d5a[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x4a34b2;})});}_0x10f4df=_[_0x12cd('0x64')]({},_0x10f4df,_0x232d5a[_0x12cd('0x80')]);return db['ChatOfflineMessage'][_0x12cd('0x25')]({'where':_0x10f4df[_0x12cd('0x63')]})[_0x12cd('0x13')](function(_0x40a626){_0x706fe7['count']=_0x40a626;if(_0x232d5a[_0x12cd('0x57')][_0x12cd('0x67')]){_0x10f4df['include']=[{'all':!![]}];}else{_0x10f4df[_0x12cd('0x68')]=[{'model':db[_0x12cd('0x9a')],'as':'Contact','required':![]},{'model':db[_0x12cd('0xde')],'as':_0x12cd('0x123'),'required':![]}];}return db[_0x12cd('0xd6')][_0x12cd('0x69')](_0x10f4df);})[_0x12cd('0x13')](function(_0x73f51e){_0x706fe7[_0x12cd('0x6a')]=_0x73f51e;return _0x706fe7;});}})[_0x12cd('0x13')](respondWithFilteredResult(_0xb0a2fe,_0x10f4df))[_0x12cd('0x1e')](handleError(_0xb0a2fe,null));};exports[_0x12cd('0x124')]=function(_0x165029,_0x24308b){return db[_0x12cd('0x53')]['find']({'where':{'id':_0x165029[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x24308b,null))[_0x12cd('0x13')](function(_0x114bed){if(_0x114bed){return _0x114bed[_0x12cd('0x124')](_0x165029[_0x12cd('0x70')]['ids'],_[_0x12cd('0xf4')](_0x165029[_0x12cd('0x70')],[_0x12cd('0xf3'),'id'])||{})[_0x12cd('0xad')](function(_0x336f67){for(var _0x2501e1=0x0;_0x2501e1<_0x165029[_0x12cd('0x70')][_0x12cd('0xf3')][_0x12cd('0x5d')];_0x2501e1+=0x1){socket[_0x12cd('0x125')](_0x12cd('0x126'),{'UserId':Number(_0x165029[_0x12cd('0x70')][_0x12cd('0xf3')][_0x2501e1]),'ChatWebsiteId':Number(_0x165029['params']['id'])});}return _0x336f67;});}})[_0x12cd('0x13')](respondWithResult(_0x24308b,null))[_0x12cd('0x1e')](handleError(_0x24308b,null));};exports[_0x12cd('0x127')]=function(_0x1791fc,_0x3af55c){return db[_0x12cd('0x53')]['find']({'where':{'id':_0x1791fc[_0x12cd('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3af55c,null))[_0x12cd('0x13')](function(_0x12ad1c){if(_0x12ad1c){return _0x12ad1c[_0x12cd('0x127')](_0x1791fc[_0x12cd('0x57')][_0x12cd('0xf3')])[_0x12cd('0x13')](function(){if(_[_0x12cd('0x128')](_0x1791fc[_0x12cd('0x57')][_0x12cd('0xf3')])){for(var _0x2a869c=0x0;_0x2a869c<_0x1791fc[_0x12cd('0x57')][_0x12cd('0xf3')][_0x12cd('0x5d')];_0x2a869c+=0x1){socket[_0x12cd('0x125')](_0x12cd('0x129'),{'UserId':Number(_0x1791fc['query'][_0x12cd('0xf3')][_0x2a869c]),'ChatWebsiteId':Number(_0x1791fc[_0x12cd('0x6c')]['id'])});}}else{socket[_0x12cd('0x125')](_0x12cd('0x129'),{'UserId':Number(_0x1791fc[_0x12cd('0x57')][_0x12cd('0xf3')]),'ChatWebsiteId':Number(_0x1791fc['params']['id'])});}});}})[_0x12cd('0x13')](respondWithStatusCode(_0x3af55c,null))[_0x12cd('0x1e')](handleError(_0x3af55c,null));};exports[_0x12cd('0x12a')]=function(_0x9c4ca1,_0x3cbc6a){var _0x318e78={};var _0x4a4c49={};var _0x1e63c2;var _0x46fd04;return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x9c4ca1['params']['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x3cbc6a,null))[_0x12cd('0x13')](function(_0x32d3ec){if(_0x32d3ec){_0x1e63c2=_0x32d3ec;_0x4a4c49['model']=_['keys'](db[_0x12cd('0xc0')][_0x12cd('0x54')]);_0x4a4c49[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x9c4ca1['query']);_0x4a4c49[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x4a4c49['model'],_0x4a4c49[_0x12cd('0x57')]);_0x318e78[_0x12cd('0x5b')]=_[_0x12cd('0x5a')](_0x4a4c49[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x9c4ca1['query'][_0x12cd('0x5c')]));_0x318e78[_0x12cd('0x5b')]=_0x318e78['attributes'][_0x12cd('0x5d')]?_0x318e78[_0x12cd('0x5b')]:_0x4a4c49['model'];_0x318e78['order']=qs['sort'](_0x9c4ca1['query'][_0x12cd('0x61')]);_0x318e78[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x9c4ca1[_0x12cd('0x57')],_0x4a4c49[_0x12cd('0x59')]));if(_0x9c4ca1[_0x12cd('0x57')][_0x12cd('0x66')]){_0x318e78['where']=_[_0x12cd('0x64')](_0x318e78['where'],{'$or':_[_0x12cd('0x38')](_0x318e78[_0x12cd('0x5b')],function(_0x151e5f){var _0x45dde9={};_0x45dde9[_0x151e5f]={'$like':'%'+_0x9c4ca1[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x45dde9;})});}_0x318e78=_['merge']({},_0x318e78,_0x9c4ca1[_0x12cd('0x80')]);return _0x1e63c2[_0x12cd('0x12a')](_0x318e78);}})['then'](function(_0x99e510){if(_0x99e510){_0x46fd04=_0x99e510['length'];if(!_0x9c4ca1[_0x12cd('0x57')]['hasOwnProperty'](_0x12cd('0x5f'))){_0x318e78['limit']=qs[_0x12cd('0x24')](_0x9c4ca1[_0x12cd('0x57')]['limit']);_0x318e78[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x9c4ca1['query']['offset']);}return _0x1e63c2['getAgents'](_0x318e78);}})[_0x12cd('0x13')](function(_0x3c8420){if(_0x3c8420){return _0x3c8420?{'count':_0x46fd04,'rows':_0x3c8420}:null;}})[_0x12cd('0x13')](respondWithResult(_0x3cbc6a,null))[_0x12cd('0x1e')](handleError(_0x3cbc6a,null));};
\ No newline at end of file
+var _0x72c8=['timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','map','Interval','Intervals','all','some','user-agent-parser','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','model','type','vendor','index','Pause','mandatoryDispositionPause','rawAttributes','key','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','ChatWebsite','includeAll','include','findAll','rows','show','keys','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','custom','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','server/files/images/avatars/','download','getSystemAvatar','systemAvatar','notify','chat','CmContact','Sequelize','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','spread','priority','account','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','applications','close','unmanaged','AttachmentId','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','email','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','fullname','Tag','color','tag','getSnippet','../../config/license/util','License','server/files/chat/iframe.ejs','utf8','URL','address','origin','3.5.0','remote','x-real-ip','connection','virtual','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','end','sendStatus','name','send','Command','format','iftime\x20%s,%s'];(function(_0x5e7644,_0x560054){var _0x3cd663=function(_0x44687f){while(--_0x44687f){_0x5e7644['push'](_0x5e7644['shift']());}};_0x3cd663(++_0x560054);}(_0x72c8,0xf9));var _0x872c=function(_0x3e2849,_0x8d6597){_0x3e2849=_0x3e2849-0x0;var _0x392ef7=_0x72c8[_0x3e2849];return _0x392ef7;};'use strict';var Mustache=require('mustache');var util=require(_0x872c('0x0'));var path=require(_0x872c('0x1'));var ejs=require(_0x872c('0x2'));var fs=require('fs');var fs_extra=require(_0x872c('0x3'));var _=require('lodash');var querystring=require('querystring');var htmlToText=require(_0x872c('0x4'));var Redis=require(_0x872c('0x5'));var jayson=require(_0x872c('0x6'));var url=require('url');var qs=require(_0x872c('0x7'));var logger=require(_0x872c('0x8'))('api');var config=require(_0x872c('0x9'));var APIOutOfIntervalError=require(_0x872c('0xa'))[_0x872c('0xb')];var APINotFoundError=require(_0x872c('0xa'))['APINotFoundError'];var APIHandleError=require(_0x872c('0xa'))[_0x872c('0xc')];var db=require(_0x872c('0xd'))['db'];config[_0x872c('0xe')]=_[_0x872c('0xf')](config['redis'],{'host':_0x872c('0x10'),'port':0x18eb});var socket=require(_0x872c('0x11'))(new Redis(config[_0x872c('0xe')]));require(_0x872c('0x12'))[_0x872c('0x13')](socket);var client=jayson[_0x872c('0x14')][_0x872c('0x15')]({'port':0x232c});var client9002=jayson['client'][_0x872c('0x15')]({'port':0x232a});var client9003=jayson[_0x872c('0x14')]['http']({'port':0x232b});var client9001=jayson[_0x872c('0x14')][_0x872c('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x23d0f4,_0x5d6759,_0x27baf9,_0x437a26){return new Promise(function(_0x1a39f8,_0x251277){var _0x4e161c=_0x437a26||client;return _0x4e161c['request'](_0x23d0f4,_0x27baf9)[_0x872c('0x16')](function(_0x7b0f3f){logger[_0x872c('0x17')](_0x872c('0x18'),_0x5d6759,_0x872c('0x19'));logger[_0x872c('0x1a')](_0x872c('0x1b'),_0x5d6759,'request\x20sent',JSON[_0x872c('0x1c')](_0x7b0f3f));if(_0x7b0f3f['error']){if(_0x7b0f3f[_0x872c('0x1d')][_0x872c('0x1e')]===0x1f4){logger[_0x872c('0x1d')](_0x872c('0x18'),_0x5d6759,_0x7b0f3f['error'][_0x872c('0x1f')]);return _0x251277(_0x7b0f3f[_0x872c('0x1d')][_0x872c('0x1f')]);}logger[_0x872c('0x1d')](_0x872c('0x18'),_0x5d6759,_0x7b0f3f[_0x872c('0x1d')]['message']);return _0x1a39f8(_0x7b0f3f[_0x872c('0x1d')]['message']);}else{logger[_0x872c('0x17')](_0x872c('0x18'),_0x5d6759,'request\x20sent');_0x1a39f8(_0x7b0f3f['result']['message']);}})[_0x872c('0x20')](function(_0x4e8aaf){logger[_0x872c('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x5d6759,_0x4e8aaf);_0x251277(_0x4e8aaf);});});}function respondWithStatusCode(_0x3b1855,_0x315768){_0x315768=_0x315768||0xcc;return function(_0x540811){if(_0x540811){return _0x3b1855['sendStatus'](_0x315768);}return _0x3b1855[_0x872c('0x21')](_0x315768)['end']();};}function respondWithResult(_0x3afb7f,_0x2bc0e2){_0x2bc0e2=_0x2bc0e2||0xc8;return function(_0x15f1b0){if(_0x15f1b0){return _0x3afb7f['status'](_0x2bc0e2)[_0x872c('0x22')](_0x15f1b0);}};}function respondWithFilteredResult(_0x1651b9,_0x1290bc){return function(_0x300538){if(_0x300538){var _0x1db7ee=typeof _0x1290bc[_0x872c('0x23')]===_0x872c('0x24')&&typeof _0x1290bc[_0x872c('0x25')]==='undefined';var _0x483217=_0x300538[_0x872c('0x26')];var _0x194a16=_0x1db7ee?0x0:_0x1290bc[_0x872c('0x23')];var _0x5e088e=_0x1db7ee?_0x300538[_0x872c('0x26')]:_0x1290bc['offset']+_0x1290bc[_0x872c('0x25')];var _0xc5b701;if(_0x5e088e>=_0x483217){_0x5e088e=_0x483217;_0xc5b701=0xc8;}else{_0xc5b701=0xce;}_0x1651b9[_0x872c('0x21')](_0xc5b701);return _0x1651b9[_0x872c('0x27')]('Content-Range',_0x194a16+'-'+_0x5e088e+'/'+_0x483217)['json'](_0x300538);}return null;};}function saveUpdates(_0x2589b0){return function(_0x4223bb){if(_0x4223bb){return _0x4223bb[_0x872c('0x28')](_0x2589b0)[_0x872c('0x16')](function(_0x5ef16c){return _0x5ef16c;});}return null;};}function removeEntity(_0x55d9b0){return function(_0x1b3876){if(_0x1b3876){return _0x1b3876[_0x872c('0x29')]()['then'](function(){var _0x225673=_0x1b3876[_0x872c('0x2a')]({'plain':!![]});var _0x59a3af='ChatWebsites';return db[_0x872c('0x2b')][_0x872c('0x29')]({'where':{'type':_0x59a3af,'resourceId':_0x225673['id']}})[_0x872c('0x16')](function(){return _0x1b3876;});})[_0x872c('0x16')](function(){_0x55d9b0['status'](0xcc)[_0x872c('0x2c')]();});}};}function handleEntityNotFound(_0x4d828c){return function(_0x25bca8){if(!_0x25bca8){_0x4d828c[_0x872c('0x2d')](0x194);}return _0x25bca8;};}function handleError(_0x33cb11,_0x4dd56d){_0x4dd56d=_0x4dd56d||0x1f4;return function(_0x5a75b6){logger[_0x872c('0x1d')](_0x5a75b6['stack']);if(_0x5a75b6[_0x872c('0x2e')]){delete _0x5a75b6[_0x872c('0x2e')];}_0x33cb11[_0x872c('0x21')](_0x4dd56d)[_0x872c('0x2f')](_0x5a75b6);};}function iftimePromise(_0x462488,_0x49e929){return respondWithRpcPromise(_0x872c('0x30'),'getSnippet',{'command':_0x49e929['timezone']?util[_0x872c('0x31')](_0x872c('0x32'),_0x462488['interval'],_0x49e929[_0x872c('0x33')]):util[_0x872c('0x31')](_0x872c('0x34'),_0x462488['interval'])},client9002)['then'](function(_0x46fa00){var _0x277e0d=_0x46fa00&&_0x46fa00[_0x872c('0x35')]('true')>=0x0?!![]:![];logger[_0x872c('0x17')](_0x872c('0x36'),_0x49e929['id'],_0x462488['id'],_0x462488[_0x872c('0x37')],_0x277e0d?_0x872c('0x38'):_0x872c('0x39'),_0x49e929[_0x872c('0x33')]?_0x49e929[_0x872c('0x33')]:_0x872c('0x3a'));return _0x277e0d;})[_0x872c('0x20')](function(_0x319346){logger[_0x872c('0x1d')](_0x872c('0x36'),_0x49e929['id'],_0x462488['id'],_0x462488[_0x872c('0x37')],util['inspect'](_0x319346,{'showHidden':![],'depth':null}),_0x49e929['timezone']?_0x49e929[_0x872c('0x33')]:_0x872c('0x3a'));return![];});}function checkWebsiteIntervals(_0x56ad93){var _0xb0c839=_[_0x872c('0x3b')](_0x56ad93[_0x872c('0x3c')][_0x872c('0x3d')],function(_0x9b847b){var _0x43c684=_0x9b847b[_0x872c('0x2a')]({'plain':!![]});return iftimePromise(_0x43c684,_0x56ad93);});return Promise[_0x872c('0x3e')](_0xb0c839)[_0x872c('0x16')](function(_0x149252){return _[_0x872c('0x3f')](_0x149252);});}function createInteractionObject(_0x466845,_0x37bf1f,_0x12a1aa,_0x63fc4a){var _0x117b15=require(_0x872c('0x40'));var _0x337b42=new _0x117b15();var _0x2ec63b=_0x337b42['setUA'](_0x12a1aa['user-agent'])[_0x872c('0x41')]();var _0x3cba9e=_0x37bf1f[_0x872c('0x42')];if(_0x12a1aa[_0x872c('0x43')]){_0x3cba9e=_0x12a1aa[_0x872c('0x43')];}else if(_0x12a1aa[_0x872c('0x44')]){_0x3cba9e=_[_0x872c('0x45')](_0x12a1aa[_0x872c('0x44')][_0x872c('0x46')](','));}return{'ContactId':_0x63fc4a['id'],'ChatWebsiteId':_0x466845,'from':(_0x63fc4a[_0x872c('0x47')]||'')+'\x20'+(_0x63fc4a[_0x872c('0x48')]||''),'customerIp':_0x3cba9e,'customerPort':_0x12a1aa[_0x872c('0x49')]?_0x12a1aa[_0x872c('0x49')]:null,'referer':_0x37bf1f[_0x872c('0x4a')],'browserName':_0x2ec63b['browser'][_0x872c('0x2e')]&&_0x2ec63b[_0x872c('0x4b')][_0x872c('0x4c')]?util[_0x872c('0x31')]('%s\x20%s',_0x2ec63b[_0x872c('0x4b')][_0x872c('0x2e')],_0x2ec63b['browser'][_0x872c('0x4c')]):_0x872c('0x4d'),'browserVersion':_0x2ec63b[_0x872c('0x4b')]['version']||_0x872c('0x4d'),'osName':util[_0x872c('0x31')](_0x872c('0x4e'),_0x2ec63b['os'][_0x872c('0x2e')],_0x2ec63b['os'][_0x872c('0x4c')]),'osVersion':_0x2ec63b['os'][_0x872c('0x4c')],'deviceModel':_0x2ec63b[_0x872c('0x4f')][_0x872c('0x50')]&&_0x2ec63b[_0x872c('0x4f')]['vendor']?util['format']('%s\x20%s\x20%s',_0x2ec63b[_0x872c('0x4f')][_0x872c('0x50')],_0x2ec63b[_0x872c('0x4f')]['vendor'],_0x2ec63b[_0x872c('0x4f')][_0x872c('0x51')]):null,'deviceVendor':_0x2ec63b[_0x872c('0x4f')][_0x872c('0x52')],'deviceType':_0x2ec63b[_0x872c('0x4f')]['type'],'formData':JSON[_0x872c('0x1c')](_0x37bf1f)};}exports[_0x872c('0x53')]=function(_0x361539,_0x27fa07){var _0x4a180b={'include':[{'model':db[_0x872c('0x54')],'as':_0x872c('0x55')}]},_0x505519={},_0x5d3c38={'count':0x0,'rows':[]};var _0x4f162e=_[_0x872c('0x3b')](db['ChatWebsite'][_0x872c('0x56')],function(_0x22a3a8){return{'name':_0x22a3a8['fieldName'],'type':_0x22a3a8[_0x872c('0x51')][_0x872c('0x57')]};});_0x505519[_0x872c('0x50')]=_['map'](_0x4f162e,_0x872c('0x2e'));_0x505519[_0x872c('0x58')]=_['keys'](_0x361539[_0x872c('0x58')]);_0x505519[_0x872c('0x59')]=_['intersection'](_0x505519['model'],_0x505519['query']);_0x4a180b[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x505519[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x361539[_0x872c('0x58')][_0x872c('0x5c')]));_0x4a180b['attributes']=_0x4a180b[_0x872c('0x5a')][_0x872c('0x5d')]?_0x4a180b['attributes']:_0x505519[_0x872c('0x50')];if(!_0x361539[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x4a180b['limit']=qs[_0x872c('0x25')](_0x361539[_0x872c('0x58')][_0x872c('0x25')]);_0x4a180b[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x361539['query'][_0x872c('0x23')]);}_0x4a180b['order']=qs[_0x872c('0x60')](_0x361539[_0x872c('0x58')][_0x872c('0x60')]);_0x4a180b['where']=qs[_0x872c('0x59')](_['pick'](_0x361539[_0x872c('0x58')],_0x505519[_0x872c('0x59')]),_0x4f162e);if(_0x361539[_0x872c('0x58')][_0x872c('0x61')]){_0x4a180b[_0x872c('0x62')]=_['merge'](_0x4a180b[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x4f162e,function(_0x3025aa){if(_0x3025aa[_0x872c('0x51')]!==_0x872c('0x63')){var _0x10c0d9={};_0x10c0d9[_0x3025aa['name']]={'$like':'%'+_0x361539[_0x872c('0x58')]['filter']+'%'};return _0x10c0d9;}})});}_0x4a180b=_['merge']({},_0x4a180b,_0x361539['options']);var _0x3fe0d5={'where':_0x4a180b[_0x872c('0x62')]};return db[_0x872c('0x64')][_0x872c('0x26')](_0x3fe0d5)[_0x872c('0x16')](function(_0x557787){_0x5d3c38['count']=_0x557787;if(_0x361539['query'][_0x872c('0x65')]){_0x4a180b[_0x872c('0x66')]=[{'all':!![]}];}return db[_0x872c('0x64')][_0x872c('0x67')](_0x4a180b);})[_0x872c('0x16')](function(_0x4ad721){_0x5d3c38[_0x872c('0x68')]=_0x4ad721;return _0x5d3c38;})[_0x872c('0x16')](respondWithFilteredResult(_0x27fa07,_0x4a180b))[_0x872c('0x20')](handleError(_0x27fa07,null));};exports[_0x872c('0x69')]=function(_0x1ccc1b,_0xb82f4){var _0x1d1125={'raw':![],'where':{'id':_0x1ccc1b['params']['id']},'include':[{'model':db[_0x872c('0x54')],'as':'mandatoryDispositionPause'}]},_0xdb7266={};_0xdb7266[_0x872c('0x50')]=_[_0x872c('0x6a')](db['ChatWebsite'][_0x872c('0x56')]);_0xdb7266[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x1ccc1b[_0x872c('0x58')]);_0xdb7266[_0x872c('0x59')]=_[_0x872c('0x5b')](_0xdb7266[_0x872c('0x50')],_0xdb7266[_0x872c('0x58')]);_0x1d1125['attributes']=_[_0x872c('0x5b')](_0xdb7266[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x1ccc1b[_0x872c('0x58')]['fields']));_0x1d1125[_0x872c('0x5a')]=_0x1d1125[_0x872c('0x5a')][_0x872c('0x5d')]?_0x1d1125['attributes']:_0xdb7266[_0x872c('0x50')];if(_0x1ccc1b[_0x872c('0x58')][_0x872c('0x65')]){_0x1d1125['include']=[{'all':!![]}];}_0x1d1125=_[_0x872c('0x6b')]({},_0x1d1125,_0x1ccc1b[_0x872c('0x6c')]);return db['ChatWebsite']['find'](_0x1d1125)[_0x872c('0x16')](handleEntityNotFound(_0xb82f4,null))[_0x872c('0x16')](respondWithResult(_0xb82f4,null))['catch'](handleError(_0xb82f4,null));};exports[_0x872c('0x6d')]=function(_0x36412e,_0x31a52f){return db['ChatWebsite'][_0x872c('0x6d')](_0x36412e[_0x872c('0x6e')],{})[_0x872c('0x16')](function(_0x36a1e8){var _0x341c88=_0x36412e[_0x872c('0x6f')][_0x872c('0x2a')]({'plain':!![]});if(!_0x341c88)throw new Error(_0x872c('0x70'));if(_0x341c88[_0x872c('0x71')]==='user'){var _0xc92436=_0x36a1e8[_0x872c('0x2a')]({'plain':!![]});var _0x4c9aca=_0x872c('0x72');return db['UserProfileSection'][_0x872c('0x73')]({'where':{'name':_0x4c9aca,'userProfileId':_0x341c88['userProfileId']},'raw':!![]})['then'](function(_0x202195){if(_0x202195&&_0x202195[_0x872c('0x74')]===0x0){return db[_0x872c('0x2b')][_0x872c('0x6d')]({'name':_0xc92436[_0x872c('0x2e')],'resourceId':_0xc92436['id'],'type':_0x202195[_0x872c('0x2e')],'sectionId':_0x202195['id']},{})[_0x872c('0x16')](function(){return _0x36a1e8;});}else{return _0x36a1e8;}})[_0x872c('0x20')](function(_0x64460d){logger[_0x872c('0x1d')](_0x872c('0x75'),_0x64460d);throw _0x64460d;});}return _0x36a1e8;})['then'](respondWithResult(_0x31a52f,0xc9))[_0x872c('0x20')](handleError(_0x31a52f,null));};exports[_0x872c('0x28')]=function(_0x1652d7,_0x49e90a){if(_0x1652d7['body']['id']){delete _0x1652d7['body']['id'];}return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x1652d7[_0x872c('0x76')]['id']},'include':[{'model':db[_0x872c('0x54')],'as':'mandatoryDispositionPause'}]})[_0x872c('0x16')](handleEntityNotFound(_0x49e90a,null))[_0x872c('0x16')](saveUpdates(_0x1652d7[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x49e90a,null))[_0x872c('0x20')](handleError(_0x49e90a,null));};exports[_0x872c('0x29')]=function(_0x41106b,_0x57d018){return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x41106b[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x57d018,null))[_0x872c('0x16')](removeEntity(_0x57d018,null))[_0x872c('0x20')](handleError(_0x57d018,null));};exports['describe']=function(_0x4da7f9,_0x3d13a4){return db['ChatWebsite'][_0x872c('0x77')]()[_0x872c('0x16')](respondWithResult(_0x3d13a4,null))[_0x872c('0x20')](handleError(_0x3d13a4,null));};exports['addDisposition']=function(_0x25f969,_0x94f246){if(_0x25f969[_0x872c('0x6e')]['id']){delete _0x25f969[_0x872c('0x6e')]['id'];}return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x25f969[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x94f246,null))['then'](function(_0x56dc02){if(_0x56dc02){_0x25f969[_0x872c('0x6e')][_0x872c('0x78')]=_0x56dc02['id'];return db[_0x872c('0x79')]['create'](_0x25f969[_0x872c('0x6e')]);}})[_0x872c('0x16')](respondWithResult(_0x94f246,null))['catch'](handleError(_0x94f246,null));};exports[_0x872c('0x7a')]=function(_0x474849,_0x3d592c){var _0x1760f3={'raw':![],'where':{}};var _0x295ed3={};var _0x421c74={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x872c('0x7b')]({'where':{'id':_0x474849[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x3d592c,null))['then'](function(_0x74d79b){if(_0x74d79b){_0x295ed3[_0x872c('0x50')]=_[_0x872c('0x6a')](db['Disposition'][_0x872c('0x56')]);_0x295ed3['query']=_[_0x872c('0x6a')](_0x474849[_0x872c('0x58')]);_0x295ed3[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x295ed3[_0x872c('0x50')],_0x295ed3[_0x872c('0x58')]);_0x1760f3[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x295ed3[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x474849[_0x872c('0x58')][_0x872c('0x5c')]));_0x1760f3[_0x872c('0x5a')]=_0x1760f3['attributes'][_0x872c('0x5d')]?_0x1760f3[_0x872c('0x5a')]:_0x295ed3['model'];if(!_0x474849[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x1760f3[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x474849[_0x872c('0x58')]['limit']);_0x1760f3[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x474849['query']['offset']);}_0x1760f3['order']=qs[_0x872c('0x60')](_0x474849[_0x872c('0x58')][_0x872c('0x60')]);_0x1760f3['where']=qs['filters'](_[_0x872c('0x7c')](_0x474849[_0x872c('0x58')],_0x295ed3[_0x872c('0x59')]));_0x1760f3[_0x872c('0x62')][_0x872c('0x78')]=_0x74d79b['id'];if(_0x474849['query'][_0x872c('0x61')]){_0x1760f3['where']=_[_0x872c('0x6b')](_0x1760f3['where'],{'$or':_['map'](_0x1760f3[_0x872c('0x5a')],function(_0x95941e){var _0x187cfe={};_0x187cfe[_0x95941e]={'$like':'%'+_0x474849[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0x187cfe;})});}_0x1760f3=_[_0x872c('0x6b')]({},_0x1760f3,_0x474849[_0x872c('0x6c')]);return db[_0x872c('0x79')][_0x872c('0x26')]({'where':_0x1760f3[_0x872c('0x62')]})['then'](function(_0x52bf7f){_0x421c74['count']=_0x52bf7f;if(_0x474849['query'][_0x872c('0x65')]){_0x1760f3['include']=[{'all':!![]}];}return db[_0x872c('0x79')][_0x872c('0x67')](_0x1760f3);})['then'](function(_0x7db5f5){_0x421c74[_0x872c('0x68')]=_0x7db5f5;return _0x421c74;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x3d592c,_0x1760f3))[_0x872c('0x20')](handleError(_0x3d592c,null));};exports[_0x872c('0x7d')]=function(_0xe40925,_0x433772){return db[_0x872c('0x64')]['find']({'where':{'id':_0xe40925[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x433772,null))[_0x872c('0x16')](function(_0x362554){if(_0x362554){return _0x362554['removeDispositions'](_0xe40925['query'][_0x872c('0x7e')]);}})[_0x872c('0x16')](respondWithStatusCode(_0x433772,null))['catch'](handleError(_0x433772,null));};exports[_0x872c('0x7f')]=function(_0x3dc64f,_0xb6c2af){if(_0x3dc64f[_0x872c('0x6e')]['id']){delete _0x3dc64f[_0x872c('0x6e')]['id'];}return db[_0x872c('0x64')]['find']({'where':{'id':_0x3dc64f[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0xb6c2af,null))['then'](function(_0x4e9dca){if(_0x4e9dca){_0x3dc64f['body'][_0x872c('0x78')]=_0x4e9dca['id'];return db['CannedAnswer']['create'](_0x3dc64f['body']);}})['then'](respondWithResult(_0xb6c2af,null))[_0x872c('0x20')](handleError(_0xb6c2af,null));};exports[_0x872c('0x80')]=function(_0x61d42d,_0x4a1c8b){var _0x1fc281={'raw':![],'where':{}};var _0x1f26b8={};var _0x409ab3={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x61d42d[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x4a1c8b,null))[_0x872c('0x16')](function(_0x340006){if(_0x340006){_0x1f26b8[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0x81')][_0x872c('0x56')]);_0x1f26b8[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x61d42d['query']);_0x1f26b8['filters']=_[_0x872c('0x5b')](_0x1f26b8['model'],_0x1f26b8[_0x872c('0x58')]);_0x1fc281[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x1f26b8[_0x872c('0x50')],qs['fields'](_0x61d42d['query'][_0x872c('0x5c')]));_0x1fc281['attributes']=_0x1fc281[_0x872c('0x5a')]['length']?_0x1fc281[_0x872c('0x5a')]:_0x1f26b8['model'];if(!_0x61d42d[_0x872c('0x58')]['hasOwnProperty'](_0x872c('0x5f'))){_0x1fc281[_0x872c('0x25')]=qs['limit'](_0x61d42d[_0x872c('0x58')]['limit']);_0x1fc281[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x61d42d['query'][_0x872c('0x23')]);}_0x1fc281[_0x872c('0x82')]=qs['sort'](_0x61d42d[_0x872c('0x58')][_0x872c('0x60')]);_0x1fc281[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x61d42d['query'],_0x1f26b8['filters']));_0x1fc281['where']['ChatWebsiteId']=_0x340006['id'];if(_0x61d42d[_0x872c('0x58')][_0x872c('0x61')]){_0x1fc281['where']=_['merge'](_0x1fc281[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x1fc281['attributes'],function(_0x2df526){var _0x2b7f70={};_0x2b7f70[_0x2df526]={'$like':'%'+_0x61d42d[_0x872c('0x58')]['filter']+'%'};return _0x2b7f70;})});}_0x1fc281=_['merge']({},_0x1fc281,_0x61d42d[_0x872c('0x6c')]);return db[_0x872c('0x81')][_0x872c('0x26')]({'where':_0x1fc281[_0x872c('0x62')]})[_0x872c('0x16')](function(_0x443e9a){_0x409ab3[_0x872c('0x26')]=_0x443e9a;if(_0x61d42d[_0x872c('0x58')][_0x872c('0x65')]){_0x1fc281[_0x872c('0x66')]=[{'all':!![]}];}return db[_0x872c('0x81')][_0x872c('0x67')](_0x1fc281);})[_0x872c('0x16')](function(_0xfb5aad){_0x409ab3[_0x872c('0x68')]=_0xfb5aad;return _0x409ab3;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x4a1c8b,_0x1fc281))[_0x872c('0x20')](handleError(_0x4a1c8b,null));};exports[_0x872c('0x83')]=function(_0x2156bd,_0x26696d){return db[_0x872c('0x64')]['find']({'where':{'id':_0x2156bd[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x26696d,null))[_0x872c('0x16')](function(_0x38e7d6){if(_0x38e7d6){return _0x38e7d6[_0x872c('0x83')](_0x2156bd[_0x872c('0x58')][_0x872c('0x7e')]);}})[_0x872c('0x16')](respondWithStatusCode(_0x26696d,null))['catch'](handleError(_0x26696d,null));};exports[_0x872c('0x84')]=function(_0xe2fe12,_0x230c4f){_0xe2fe12[_0x872c('0x6e')]['sitepic']=_0xe2fe12['file'][_0x872c('0x85')];return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0xe2fe12[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x230c4f,null))[_0x872c('0x16')](saveUpdates(_0xe2fe12[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x230c4f,null))[_0x872c('0x20')](handleError(_0x230c4f,null));};exports[_0x872c('0x86')]=function(_0xd04d90,_0x144d63){_0xd04d90[_0x872c('0x6e')][_0x872c('0x87')]=_0xd04d90[_0x872c('0x88')][_0x872c('0x85')];return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0xd04d90[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x144d63,null))[_0x872c('0x16')](saveUpdates(_0xd04d90[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x144d63,null))[_0x872c('0x20')](handleError(_0x144d63,null));};exports[_0x872c('0x89')]=function(_0x2503ad,_0x32c603){_0x2503ad[_0x872c('0x6e')]['customerAvatar']=_0x2503ad[_0x872c('0x88')][_0x872c('0x85')];return db['ChatWebsite']['find']({'where':{'id':_0x2503ad[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x32c603,null))[_0x872c('0x16')](saveUpdates(_0x2503ad['body'],null))[_0x872c('0x16')](respondWithResult(_0x32c603,null))[_0x872c('0x20')](handleError(_0x32c603,null));};exports[_0x872c('0x8a')]=function(_0x48f97a,_0x5e0c3e){_0x48f97a[_0x872c('0x6e')]['systemAvatar']=_0x48f97a[_0x872c('0x88')][_0x872c('0x85')];return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x48f97a[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x5e0c3e,null))[_0x872c('0x16')](saveUpdates(_0x48f97a[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x5e0c3e,null))['catch'](handleError(_0x5e0c3e,null));};exports[_0x872c('0x8b')]=function(_0x21da88,_0x333639){var _0x5b08cc=path['join'](config[_0x872c('0x8c')],_0x872c('0x8d'));var _0x406639={'where':{'id':_0x21da88[_0x872c('0x76')]['id']},'attributes':['id',_0x872c('0x8e')],'raw':!![]};var _0x283a08=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x18b9bd){if(_0x18b9bd){_0x283a08=_0x18b9bd[_0x872c('0x8f')];}})[_0x872c('0x16')](function(){return db[_0x872c('0x64')][_0x872c('0x73')](_0x406639);})[_0x872c('0x16')](handleEntityNotFound(_0x333639,null))[_0x872c('0x16')](function(_0x78a629){if(_0x78a629){if(!_['isNil'](_0x78a629[_0x872c('0x8e')])){if(fs[_0x872c('0x90')](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x92'),_0x78a629[_0x872c('0x8e')]))&&_0x283a08){_0x5b08cc=path[_0x872c('0x91')](config['root'],_0x872c('0x92'),_0x78a629[_0x872c('0x8e')]);}}return _0x333639['download'](_0x5b08cc);}})[_0x872c('0x20')](handleError(_0x333639,null));};exports[_0x872c('0x93')]=function(_0xeae151,_0x4b168d){var _0x350f96=path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x94'));var _0x2d28ed={'where':{'id':_0xeae151[_0x872c('0x76')]['id']},'attributes':['id',_0x872c('0x87')],'raw':!![]};return db[_0x872c('0x64')][_0x872c('0x73')](_0x2d28ed)['then'](handleEntityNotFound(_0x4b168d,null))[_0x872c('0x16')](function(_0x316e8f){if(_0x316e8f){if(!_[_0x872c('0x95')](_0x316e8f[_0x872c('0x87')])){if(fs[_0x872c('0x90')](path['join'](config[_0x872c('0x8c')],'server/files/images/avatars/',_0x316e8f[_0x872c('0x87')]))){_0x350f96=path[_0x872c('0x91')](config[_0x872c('0x8c')],'server/files/images/avatars/',_0x316e8f[_0x872c('0x87')]);}}return _0x4b168d['download'](_0x350f96);}})[_0x872c('0x20')](handleError(_0x4b168d,null));};exports['getCustomerAvatar']=function(_0x4e5d10,_0x2e2c0b){var _0x44125a=path[_0x872c('0x91')](config['root'],_0x872c('0x96'));var _0x402c58={'where':{'id':_0x4e5d10[_0x872c('0x76')]['id']},'attributes':['id','customerAvatar',_0x872c('0x97')],'raw':!![]};return db['ChatWebsite']['find'](_0x402c58)[_0x872c('0x16')](handleEntityNotFound(_0x2e2c0b,null))[_0x872c('0x16')](function(_0x52f967){if(_0x52f967){if(!_[_0x872c('0x95')](_0x52f967[_0x872c('0x98')])){if(fs['existsSync'](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x99'),_0x52f967['customerAvatar']))&&_0x52f967['showCustomerAvatar']){_0x44125a=path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x52f967[_0x872c('0x98')]);}}return _0x2e2c0b[_0x872c('0x9a')](_0x44125a);}})[_0x872c('0x20')](handleError(_0x2e2c0b,null));};exports[_0x872c('0x9b')]=function(_0xd8c4e9,_0x291a82){var _0x2a735f=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0x4cb52c={'where':{'id':_0xd8c4e9['params']['id']},'attributes':['id',_0x872c('0x9c')],'raw':!![]};return db['ChatWebsite']['find'](_0x4cb52c)[_0x872c('0x16')](handleEntityNotFound(_0x291a82,null))[_0x872c('0x16')](function(_0x2242b7){if(_0x2242b7){if(!_['isNil'](_0x2242b7[_0x872c('0x9c')])){if(fs['existsSync'](path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x2242b7[_0x872c('0x9c')]))){_0x2a735f=path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x2242b7['systemAvatar']);}}return _0x291a82[_0x872c('0x9a')](_0x2a735f);}})[_0x872c('0x20')](handleError(_0x291a82,null));};exports[_0x872c('0x9d')]=function(_0x3137b5,_0x2344be){var _0x2c39bb={'body':_0x3137b5[_0x872c('0x6e')],'channel':_0x872c('0x9e')};var _0x210c08=[];var _0x4bf733=[];var _0xa5556e={};var _0x425f1c=![];return db[_0x872c('0x9f')]['describe']()['then'](function(_0x49e5e8){if(!_0x49e5e8){throw new db[(_0x872c('0xa0'))]['ValidationError'](_0x872c('0xa1'));}_0x210c08=_['difference'](_[_0x872c('0x6a')](_0x49e5e8),[_0x872c('0xa2'),'updatedAt']);_0x4bf733=_[_0x872c('0xa3')](_[_0x872c('0x6a')](_0x49e5e8),[_0x872c('0xa2'),_0x872c('0xa4'),'CompanyId',_0x872c('0xa5')]);if(_0x3137b5[_0x872c('0x6e')]['id']){delete _0x3137b5['body']['id'];}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')])){throw new db[(_0x872c('0xa0'))]['ValidationError'](_0x872c('0xa7'));}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')]['body'])||_0x3137b5[_0x872c('0x6e')]['body']===''){throw new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xa9'));}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')])){throw new db['Sequelize'][(_0x872c('0xa8'))](_0x872c('0xab')+_0x4bf733);}if(!_['includes'](_0x4bf733,_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')])){throw new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xac')+_0x4bf733);}_0xa5556e[_0x3137b5['body'][_0x872c('0xaa')]]=_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')];})[_0x872c('0x16')](function(){return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x3137b5[_0x872c('0x76')]['id']},'include':[{'model':db['CmList'],'as':_0x872c('0xad'),'include':[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xae'),'where':_0xa5556e,'limit':0x1,'order':[['updatedAt',_0x872c('0xaf')]]}]},{'model':db[_0x872c('0xb0')],'as':_0x872c('0xb1')},{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3d'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x872c('0x16')](function(_0x65d1a5){if(!_0x65d1a5)throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x3137b5['params']['id']));if(!_0x65d1a5['Interval']||!_0x65d1a5[_0x872c('0x3c')]['Intervals'])return[_0x65d1a5,!![]];return[_0x65d1a5,checkWebsiteIntervals(_0x65d1a5)];})[_0x872c('0xb2')](function(_0x2892d7,_0x1281bc){if(!_0x1281bc)throw new APIOutOfIntervalError();if(!_0x2892d7['List'])return;_0x2c39bb['account']=_0x2892d7;_0x2c39bb['list']=_0x2892d7[_0x872c('0xad')];_0x2c39bb['applications']=_['orderBy'](_0x2892d7[_0x872c('0xb1')],[_0x872c('0xb3')],['asc']);if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xb1')]){delete _0x2c39bb[_0x872c('0xb4')][_0x872c('0xb1')];}if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')]&&_0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')][_0x872c('0xae')][_0x872c('0x5d')]){return _0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')][_0x872c('0xae')][0x0];}var _0x10b0e4=_[_0x872c('0xf')](_0x3137b5[_0x872c('0x6e')],{'firstName':_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')],'ListId':_0x2892d7[_0x872c('0xa5')]});_0x10b0e4[_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')]]=_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')];return db[_0x872c('0x9f')][_0x872c('0x6d')](_0x10b0e4,{'fields':_0x210c08,'raw':!![]});})[_0x872c('0x16')](function(_0x4e235b){_0x2c39bb[_0x872c('0xb5')]=_0x4e235b;var _0x1a737a=createInteractionObject(_0x3137b5[_0x872c('0x76')]['id'],_0x3137b5['body'],_0x3137b5[_0x872c('0xb6')],_0x4e235b);var _0x502c78={'ChatWebsiteId':_0x3137b5[_0x872c('0x76')]['id'],'closed':![]};if(_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]){_0x502c78[_0x872c('0xb7')]=_0x3137b5['body'][_0x872c('0xb7')];return db[_0x872c('0xb8')][_0x872c('0x73')]({'where':_0x502c78})[_0x872c('0x16')](function(_0xfcce36){if(_0xfcce36){_0x425f1c=!![];return _0xfcce36;}_0x1a737a[_0x872c('0xb7')]=_0x3137b5[_0x872c('0x6e')]['threadId'];_0x1a737a['externalUrl']=_0x3137b5['body'][_0x872c('0xb9')];return db['ChatInteraction']['create'](_0x1a737a);});}_0x502c78[_0x872c('0xba')]=_0x4e235b['id'];if(_0x3137b5['body'][_0x872c('0xbb')]&&_0x3137b5[_0x872c('0x6e')]['interaction']['id']){_0x502c78['id']=_0x3137b5[_0x872c('0x6e')][_0x872c('0xbb')]['id'];return db[_0x872c('0xb8')][_0x872c('0x73')]({'where':_0x502c78})[_0x872c('0x16')](function(_0x575f53){if(_0x575f53){_0x425f1c=!![];return _0x575f53;}return db[_0x872c('0xb8')][_0x872c('0x6d')](_0x1a737a);});}return db[_0x872c('0xb8')]['create'](_0x1a737a);})[_0x872c('0x16')](function(_0x10ab74){if(!_0x425f1c)return _0x10ab74;var _0x46ad09={'from':(_0x2c39bb[_0x872c('0xb5')][_0x872c('0x47')]||'')+'\x20'+(_0x2c39bb[_0x872c('0xb5')][_0x872c('0x48')]||'')};if(_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]&&_0x3137b5[_0x872c('0x6e')][_0x872c('0xbc')]&&_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]!=_0x3137b5[_0x872c('0x6e')]['messageId']){_0x46ad09['threadId']=_0x3137b5['body'][_0x872c('0xbc')];}return _0x10ab74[_0x872c('0x28')](_0x46ad09);})[_0x872c('0x16')](function(_0xe18644){_0x2c39bb[_0x872c('0xbb')]=_0xe18644['get']({'plain':!![]});_0x2c39bb[_0x872c('0xbb')][_0x872c('0xbd')]=!_0x425f1c;if(_0x2c39bb[_0x872c('0xbb')][_0x872c('0xbd')]){if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xbe')]){_0x2c39bb['applications'][_0x872c('0xbf')]({'id':0x0,'priority':_0x2c39bb[_0x872c('0xc0')]['length']+0x1,'app':_0x872c('0xc1'),'appdata':_0x872c('0xc2'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x3137b5[_0x872c('0x6e')][_0x872c('0x6e')],'ChatWebsiteId':_0x3137b5[_0x872c('0x76')]['id'],'ChatInteractionId':_0xe18644['id'],'direction':'in','ContactId':_0x2c39bb[_0x872c('0xb5')]['id'],'AttachmentId':_0x3137b5[_0x872c('0x6e')][_0x872c('0xc3')]});})[_0x872c('0x16')](function(_0x30777b){_0x2c39bb[_0x872c('0x1f')]=_0x30777b;if(!_0x2c39bb[_0x872c('0xbb')]['UserId']){return;}return db['User'][_0x872c('0x73')]({'attributes':['id',_0x872c('0x2e')],'where':{'id':_0x2c39bb[_0x872c('0xbb')]['UserId']}});})[_0x872c('0x16')](function(_0x4e846f){if(_0x4e846f){_0x2c39bb[_0x872c('0xc0')][_0x872c('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4e846f[_0x872c('0x2e')]+','+(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xc5')]||0xa),'interval':_0x872c('0xc6')});_0x2c39bb[_0x872c('0xc7')]=!![];}if(!_0x2c39bb['interaction']['queueId']){return;}return db[_0x872c('0xc8')][_0x872c('0x73')]({'attributes':['id',_0x872c('0x2e')],'where':{'id':_0x2c39bb[_0x872c('0xbb')]['queueId']}});})[_0x872c('0x16')](function(_0x4dc75c){if(_0x4dc75c){_0x2c39bb[_0x872c('0xc0')]['unshift']({'id':0x0,'priority':0x1,'app':_0x872c('0xc9'),'appdata':_0x4dc75c[_0x872c('0x2e')]+','+(_0x2c39bb['account'][_0x872c('0xca')]||0x12c),'interval':_0x872c('0xc6')});}return respondWithRpcPromise(_0x872c('0xcb'),_0x872c('0xcc'),_0x2c39bb);})[_0x872c('0x16')](function(_0x1fa142){respondWithRpcPromise(_0x872c('0xcd'),_0x872c('0xcd'),{'event':_0x872c('0x9d'),'message':_0x1fa142},client9002);return _0x1fa142;})[_0x872c('0x16')](respondWithResult(_0x2344be,null))[_0x872c('0x20')](APIHandleError(_0x2344be));};exports['offline']=function(_0xec875b,_0x305247){var _0x24cbb6,_0x5a5906,_0x4a0eb1;var _0xd48f05=[];var _0x599044={};var _0x144373=_0xec875b[_0x872c('0xce')]||[];var _0x227098=[];var _0x519f53;return db[_0x872c('0x9f')]['describe']()[_0x872c('0x16')](function(_0x2a2183){if(!_0x2a2183){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0xd48f05=_['difference'](_[_0x872c('0x6a')](_0x2a2183),[_0x872c('0xa2'),_0x872c('0xa4'),_0x872c('0xcf'),_0x872c('0xa5')]);if(_0xec875b['body']['id']){delete _0xec875b['body']['id'];}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')]['from'])){throw _0x305247[_0x872c('0x21')](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xa7')));}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')]['body'])||_0xec875b[_0x872c('0x6e')][_0x872c('0x6e')]===''){throw _0x305247['status'](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')])){throw _0x305247['status'](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xd1')+_0xd48f05));}if(!_['includes'](_0xd48f05,_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')])){throw _0x305247[_0x872c('0x21')](0x1f4)[_0x872c('0x2f')](new db['Sequelize']['ValidationError'](_0x872c('0xd2')+_0xd48f05));}_0x599044[_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')]]=_0xec875b['body'][_0x872c('0xa6')];})['then'](function(){return db[_0x872c('0x64')]['find']({'where':{'id':_0xec875b['params']['id']},'include':[{'model':db[_0x872c('0xd3')],'as':_0x872c('0xad')},{'model':db[_0x872c('0xd4')],'as':_0x872c('0xd4')}]});})[_0x872c('0x16')](handleEntityNotFound(_0x305247,null))['then'](function(_0x16958e){if(_0x16958e&&_0x16958e[_0x872c('0xad')]){_0x5a5906=_0x16958e;var _0x3b71e7=_[_0x872c('0xf')](_0xec875b['body'],{'firstName':_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')],'phone':_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')],'ListId':_0x16958e['ListId']});_0x3b71e7[_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')]]=_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')];return db[_0x872c('0x9f')]['findOrCreate']({'where':_0x599044,'defaults':_0x3b71e7});}})[_0x872c('0xb2')](function(_0x39a920){if(_0x39a920){_0x4a0eb1=_0x39a920;var _0x376e0e=fs[_0x872c('0xd5')](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xd6')),'utf8');var _0x181c99=ejs[_0x872c('0xd7')](_0x376e0e,{'body':_[_0x872c('0xd8')](_0xec875b[_0x872c('0x6e')][_0x872c('0x6e')]),'bodyTitle':_0x5a5906[_0x872c('0xd9')]});return db[_0x872c('0xda')][_0x872c('0x6d')]({'body':_0x181c99,'plainBody':htmlToText[_0x872c('0xdb')](_0x181c99),'ContactId':_0x39a920['id'],'ChatWebsiteId':_0x5a5906['id']});}})['then'](function(_0x51c7e6){_0x519f53=_0x51c7e6;if(_0x144373[_0x872c('0x5d')]){var _0x1397d7=_0x144373['map'](function(_0x20a6a0){return{'name':_0x20a6a0[_0x872c('0xdc')],'basename':_0x20a6a0[_0x872c('0x85')],'type':_0x20a6a0['mimetype'],'ChatOfflineMessageId':_0x51c7e6['id']};});_0x227098=_0x1397d7[_0x872c('0x3b')](_0x263ce1=>{var _0x56e6f0={'filename':_0x263ce1[_0x872c('0x2e')],'path':path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xdd'),_0x872c('0xce'),_0x872c('0xde'),_0x872c('0xdf'),_0x263ce1['basename'])};return _0x56e6f0;});if(!_0x5a5906[_0x872c('0xe0')]){return db[_0x872c('0xe1')][_0x872c('0xe2')](function(_0x2133a9){return db[_0x872c('0xe3')][_0x872c('0xe4')](_0x1397d7,{'transaction':_0x2133a9});});}}})[_0x872c('0x16')](function(){if(_0x519f53){_0x24cbb6=_0x519f53;return db[_0x872c('0xd4')][_0x872c('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x872c('0xe5')],'as':_0x872c('0xe6'),'raw':!![],'include':[{'model':db[_0x872c('0xe7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x872c('0x16')](function(_0xf4331b){if(_0xf4331b&&_0xf4331b[_0x872c('0xe6')]&&_0x5a5906['forwardOffline']&&_0x5a5906['forwardOfflineAddress']){var _0x53436a=_0xf4331b[_0x872c('0xe8')]();return respondWithRpcPromise(_0x872c('0xe9'),_0x872c('0xea'),{'account':_0x53436a,'message':{'from':util[_0x872c('0x31')]('\x22%s\x22\x20<%s>',_0xf4331b[_0x872c('0x2e')],_0xf4331b[_0x872c('0xeb')]||_0xf4331b[_0x872c('0xe6')][_0x872c('0x6f')]),'to':_0x5a5906['forwardOfflineAddress'],'subject':_0x5a5906['offlineMessageSubject'],'html':_0x24cbb6[_0x872c('0x6e')],'attachments':_0x227098}},client9003)[_0x872c('0x16')](function(){return _0x24cbb6;})[_0x872c('0x20')](function(_0x360398){logger[_0x872c('0x1d')](_0x360398);});}})[_0x872c('0x16')](function(){if(_0x5a5906&&_0x5a5906['openNewInteraction']&&_0x5a5906[_0x872c('0xec')]){var _0x129deb=[];if(_0x144373[_0x872c('0x5d')]){_0x129deb=_0x144373['map'](function(_0x55ea70){return{'name':_0x55ea70[_0x872c('0xdc')],'basename':_0x55ea70[_0x872c('0x85')],'type':_0x55ea70[_0x872c('0xed')],'ChatOfflineMessageId':_0x519f53['id']};});}var _0x134d40;if(!_['isNil'](_0x5a5906[_0x872c('0xee')])){var _0x118b8a=_['map'](_0xec875b[_0x872c('0x6e')],function(_0x45dadc){return _0x45dadc;});var _0x5b0d06=_[_0x872c('0xef')](_0x118b8a)[0x0];var _0xa1cd9=_[_0x872c('0xf0')](_0x5b0d06,function(_0x502801){return _0x502801;});_0x134d40=_0xa1cd9[0x1][_0x5a5906[_0x872c('0xee')]];}var _0x2e77b7={'from':_0x4a0eb1['email'],'firstName':_0x4a0eb1[_0x872c('0x47')],'lastName':_0x4a0eb1[_0x872c('0x48')],'mapKey':'email','message':{'from':_0x4a0eb1[_0x872c('0xeb')],'to':_0x5a5906[_0x872c('0xd4')][_0x872c('0xeb')],'cc':'','subject':_[_0x872c('0x95')](_0x134d40)?_0x5a5906[_0x872c('0xf1')]:_0x134d40,'messageId':'','sentAt':new Date(),'attach':_0x129deb[_0x872c('0x5d')],'attachments':_0x129deb,'originChannel':_0x872c('0xf2'),'ChatWebsiteId':_0x5a5906['id'],'ChatOfflineMessageId':_0x24cbb6['id'],'originTo':_0x5a5906['MailAccount']['email']},'body':_0x24cbb6[_0x872c('0x6e')]};var _0x39d5af={'account':{'id':_0x5a5906[_0x872c('0xec')]},'body':_0x2e77b7,'log':_0x872c('0xf3')};return respondWithRpcPromise(_0x872c('0xf3'),'notifyMail',_0x39d5af,client9001)['then'](function(){return _0x24cbb6;})['catch'](function(_0x2e6e95){logger[_0x872c('0x1d')](_0x2e6e95);});}return;})[_0x872c('0x16')](function(){if(_0x24cbb6){return _0x24cbb6;}})[_0x872c('0x16')](respondWithResult(_0x305247,null))['catch'](function(){for(var _0x1b9832 of _0x144373){var _0x1c9151=path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xdd'),_0x872c('0xce'),'attachments','offline-chat',_0x1b9832['filename']);fs_extra['remove'](_0x1c9151)['catch'](function(_0x3348f5){logger[_0x872c('0x1d')](_0x872c('0xf4'),_0x1c9151,_0x3348f5);});}});};exports[_0x872c('0xf5')]=function(_0xf4f5ad,_0xcd2bca){return db['ChatInteraction']['find']({'where':{'id':_0xf4f5ad[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0xcd2bca,null))['then'](function(_0x7c9f59){if(_0x7c9f59){return _0x7c9f59[_0x872c('0xf5')](_0xf4f5ad[_0x872c('0x6e')][_0x872c('0x7e')],_[_0x872c('0xf6')](_0xf4f5ad[_0x872c('0x6e')],['ids','id'])||{});}})[_0x872c('0x16')](respondWithResult(_0xcd2bca,null))[_0x872c('0x20')](handleError(_0xcd2bca,null));};exports['getInteractions']=function(_0x1cf9bd,_0x1ff4d8){var _0x8b4fa1={'raw':![],'where':{}};var _0x271c89={};var _0x348740={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x1cf9bd[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x1ff4d8,null))[_0x872c('0x16')](function(_0x488169){if(_0x488169){_0x271c89[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xb8')][_0x872c('0x56')]);_0x271c89['query']=_[_0x872c('0x6a')](_0x1cf9bd[_0x872c('0x58')]);_0x271c89[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x271c89[_0x872c('0x50')],_0x271c89['query']);_0x8b4fa1[_0x872c('0x5a')]=_['intersection'](_0x271c89[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x1cf9bd['query']['fields']));_0x8b4fa1['attributes']=_0x8b4fa1[_0x872c('0x5a')][_0x872c('0x5d')]?_0x8b4fa1[_0x872c('0x5a')]:_0x271c89[_0x872c('0x50')];if(!_0x1cf9bd[_0x872c('0x58')]['hasOwnProperty']('nolimit')){_0x8b4fa1[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x1cf9bd[_0x872c('0x58')][_0x872c('0x25')]);_0x8b4fa1['offset']=qs[_0x872c('0x23')](_0x1cf9bd[_0x872c('0x58')]['offset']);}_0x8b4fa1[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x1cf9bd[_0x872c('0x58')][_0x872c('0x60')]);_0x8b4fa1[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x1cf9bd[_0x872c('0x58')],_0x271c89[_0x872c('0x59')]));_0x8b4fa1[_0x872c('0x62')]['ChatWebsiteId']=_0x488169['id'];if(_0x1cf9bd[_0x872c('0x58')]['filter']){_0x8b4fa1[_0x872c('0x62')]=_['merge'](_0x8b4fa1[_0x872c('0x62')],{'$or':_['map'](_0x8b4fa1[_0x872c('0x5a')],function(_0x49f8ea){var _0x31138a={};_0x31138a[_0x49f8ea]={'$like':'%'+_0x1cf9bd[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0x31138a;})});}_0x8b4fa1=_[_0x872c('0x6b')]({},_0x8b4fa1,_0x1cf9bd['options']);return db[_0x872c('0xb8')]['count']({'where':_0x8b4fa1[_0x872c('0x62')]})[_0x872c('0x16')](function(_0x3c0d91){_0x348740['count']=_0x3c0d91;if(_0x1cf9bd['query'][_0x872c('0x65')]){_0x8b4fa1[_0x872c('0x66')]=[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xf7'),'required':![]},{'model':db[_0x872c('0xf8')],'as':_0x872c('0xf9'),'attributes':[_0x872c('0x2e'),_0x872c('0xfa'),'internal'],'required':![]},{'model':db[_0x872c('0xfb')],'as':'Tags','attributes':['id',_0x872c('0x2e'),_0x872c('0xfc')],'where':_0x1cf9bd[_0x872c('0x58')][_0x872c('0xfd')]?{'id':_0x1cf9bd[_0x872c('0x58')]['tag']}:undefined,'required':_0x1cf9bd[_0x872c('0x58')]['tag']?!![]:![]}];}return db[_0x872c('0xb8')][_0x872c('0x67')](_0x8b4fa1);})[_0x872c('0x16')](function(_0x15f4b7){_0x348740[_0x872c('0x68')]=_0x15f4b7;return _0x348740;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x1ff4d8,_0x8b4fa1))[_0x872c('0x20')](handleError(_0x1ff4d8,null));};exports[_0x872c('0xfe')]=function(_0x33ad57,_0x2a2fac){var _0x1e7cb6=0x0;var _0x1454a8=0x0;var _0x509c3b=![];var _0x123d10;var _0x4ff137;return db[_0x872c('0x64')]['find']({'where':{'id':_0x33ad57[_0x872c('0x76')]['id']},'include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3c'),'include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3d'),'attributes':['id',_0x872c('0x37')]}]}]})[_0x872c('0x16')](handleEntityNotFound(_0x2a2fac,null))[_0x872c('0x16')](function(_0x1c7195){if(_0x1c7195){_0x123d10=_0x1c7195;return _0x1c7195['getProactiveActions']({'raw':!![]});}})['then'](function(_0x59c0d4){if(_0x123d10){if(_0x59c0d4){_0x4ff137=_0x59c0d4;}}return require(_0x872c('0xff'))['getLicense']();})['then'](function(_0x301eb1){if(_0x301eb1){_0x1454a8=_0x301eb1['virtual'];_0x509c3b=_0x301eb1['custom'];}})['then'](function(){return db[_0x872c('0xb8')][_0x872c('0x26')]({'where':{'closed':![]}});})[_0x872c('0x16')](function(_0x575cfe){_0x1e7cb6=_0x575cfe;if(_0x1454a8&&_0x575cfe>_0x1454a8){return db[_0x872c('0x100')][_0x872c('0x7b')]({'where':{'id':0x1}})[_0x872c('0x16')](function(_0x1f11bc){if(_0x1f11bc){_0x1f11bc['increment']('chatLicenseExceeded');}});}})[_0x872c('0x16')](function(){if(!_0x123d10[_0x872c('0x3c')]||!_0x123d10[_0x872c('0x3c')][_0x872c('0x3d')])return!![];return checkWebsiteIntervals(_0x123d10);})[_0x872c('0x16')](function(_0x1276bf){var _0x2cd27b=fs[_0x872c('0xd5')](path[_0x872c('0x91')](config['root'],_0x872c('0x101')),_0x872c('0x102'));var _0x4182ff=new url[(_0x872c('0x103'))](_0x123d10[_0x872c('0x104')])[_0x872c('0x105')];var _0x334bd3=_0x872c('0x106');var _0x12ea20=![];var _0x24a032={'chatVersion':_0x334bd3,'chatWebsiteAddressOrigin':_0x4182ff,'remote':_0x123d10[_0x872c('0x107')],'query':querystring[_0x872c('0x1c')](_[_0x872c('0x6b')](_0x123d10[_0x872c('0x2a')]({'plain':!![]}),{'customerIp':_0x33ad57[_0x872c('0xb6')][_0x872c('0x44')]||_0x33ad57[_0x872c('0xb6')][_0x872c('0x108')]||_0x33ad57[_0x872c('0x109')]['remoteAddress']||_0x33ad57['ip'],'referer':_0x33ad57[_0x872c('0xb6')][_0x872c('0x4a')],'openedInteractions':_0x1e7cb6,'maxInteractions':_0x1454a8,'virtual':_0x509c3b[_0x872c('0x10a')],'online':_0x1276bf,'custom':_0x509c3b}))['replace'](/'/g,'\x5c\x27')};_0x2a2fac[_0x872c('0x2f')](ejs[_0x872c('0xd7')](Mustache[_0x872c('0xd7')](_0x2cd27b,_0x24a032),{'proactiveActions':_0x4ff137,'alignment':_0x123d10[_0x872c('0x10b')],'verticalAlignment':_0x123d10[_0x872c('0x10c')],'div_color':_0x123d10[_0x872c('0xfc')],'labelText':_0x123d10[_0x872c('0x10d')],'text_color':_0x123d10[_0x872c('0x10e')],'text_button_color':_0x123d10[_0x872c('0x10f')],'button_color':_0x123d10[_0x872c('0x110')],'background_color':_0x123d10['backgroundColor'],'hideWhenOffline':_0x123d10[_0x872c('0x111')],'intervalId':_0x123d10[_0x872c('0x112')],'isDevelopment':_0x12ea20,'chatVersion':_0x334bd3}));})[_0x872c('0x20')](handleError(_0x2a2fac,null));};exports[_0x872c('0x113')]=function(_0x136729,_0x148551){var _0x1645e4=_0x136729[_0x872c('0x76')]['id'];var _0x4d3d6d=_0x136729[_0x872c('0x6e')];var _0xb3bf6c=0xc8;var _0x5ccb5d=null;return db[_0x872c('0xe1')][_0x872c('0xe2')]({'isolationLevel':db['sequelize'][_0x872c('0x114')][_0x872c('0x115')][_0x872c('0x116')]},function(_0x4439be){return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x1645e4},'transaction':_0x4439be})['then'](function(_0x19e050){if(_0x19e050){return db[_0x872c('0xb0')][_0x872c('0x29')]({'where':{'ChatWebsiteId':_0x1645e4},'transaction':_0x4439be})[_0x872c('0x16')](function(){var _0x6aaec6=_[_0x872c('0x3b')](_0x4d3d6d,function(_0x5e7186){_0x5e7186[_0x872c('0x78')]=_0x1645e4;return _0x5e7186;});return db[_0x872c('0xb0')][_0x872c('0xe4')](_0x6aaec6,{'transaction':_0x4439be});});}else{_0xb3bf6c=0x194;_0x5ccb5d=[];}});})['then'](function(){if(_0xb3bf6c!==0x194){return db[_0x872c('0xb0')][_0x872c('0x117')]({'where':{'ChatWebsiteId':_0x1645e4},'order':_0x872c('0xb3')})[_0x872c('0x16')](function(_0x2d0a1c){_0x5ccb5d=_0x2d0a1c;});}})['catch'](function(_0x20e6db){_0xb3bf6c=0x1f4;logger[_0x872c('0x1d')](_0x20e6db['stack']);if(_0x20e6db['name']){delete _0x20e6db[_0x872c('0x2e')];}_0x5ccb5d=_0x20e6db;})[_0x872c('0x118')](function(){if(_0x5ccb5d===null){_0x148551[_0x872c('0x2d')](_0xb3bf6c);}else{if(_0xb3bf6c===0x1f4){_0x148551[_0x872c('0x21')](_0xb3bf6c)[_0x872c('0x2f')](_0x5ccb5d);}else{_0x148551[_0x872c('0x21')](_0xb3bf6c)[_0x872c('0x22')](_0x5ccb5d);}}});};exports[_0x872c('0x119')]=function(_0x20f6c1,_0x118ff9){var _0x178ee7={};var _0x8dac6b={};var _0x26a035;var _0x56ab33;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x20f6c1[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x118ff9,null))['then'](function(_0x505f63){if(_0x505f63){_0x26a035=_0x505f63;_0x8dac6b[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xb0')][_0x872c('0x56')]);_0x8dac6b['query']=_[_0x872c('0x6a')](_0x20f6c1[_0x872c('0x58')]);_0x8dac6b[_0x872c('0x59')]=_['intersection'](_0x8dac6b[_0x872c('0x50')],_0x8dac6b[_0x872c('0x58')]);_0x178ee7[_0x872c('0x5a')]=_['intersection'](_0x8dac6b[_0x872c('0x50')],qs['fields'](_0x20f6c1[_0x872c('0x58')][_0x872c('0x5c')]));_0x178ee7['attributes']=_0x178ee7[_0x872c('0x5a')][_0x872c('0x5d')]?_0x178ee7[_0x872c('0x5a')]:_0x8dac6b[_0x872c('0x50')];_0x178ee7[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x20f6c1[_0x872c('0x58')][_0x872c('0x60')]);_0x178ee7[_0x872c('0x62')]=qs['filters'](_['pick'](_0x20f6c1[_0x872c('0x58')],_0x8dac6b[_0x872c('0x59')]));if(_0x20f6c1[_0x872c('0x58')]['filter']){_0x178ee7[_0x872c('0x62')]=_[_0x872c('0x6b')](_0x178ee7['where'],{'$or':_[_0x872c('0x3b')](_0x178ee7[_0x872c('0x5a')],function(_0x653260){var _0x944729={};_0x944729[_0x653260]={'$like':'%'+_0x20f6c1[_0x872c('0x58')]['filter']+'%'};return _0x944729;})});}_0x178ee7=_[_0x872c('0x6b')]({},_0x178ee7,_0x20f6c1['options']);return _0x26a035[_0x872c('0x119')](_0x178ee7);}})[_0x872c('0x16')](function(_0x3b475b){if(_0x3b475b){_0x56ab33=_0x3b475b[_0x872c('0x5d')];if(!_0x20f6c1[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x178ee7['limit']=qs[_0x872c('0x25')](_0x20f6c1[_0x872c('0x58')][_0x872c('0x25')]);_0x178ee7[_0x872c('0x23')]=qs['offset'](_0x20f6c1[_0x872c('0x58')][_0x872c('0x23')]);}return _0x26a035[_0x872c('0x119')](_0x178ee7);}})['then'](function(_0x2615af){if(_0x2615af){return _0x2615af?{'count':_0x56ab33,'rows':_0x2615af}:null;}})[_0x872c('0x16')](respondWithResult(_0x118ff9,null))['catch'](handleError(_0x118ff9,null));};exports[_0x872c('0x11a')]=function(_0x5b4604,_0x54c7a1){return db['chatProactiveAction'][_0x872c('0x73')]({'where':{'id':_0x5b4604[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x54c7a1,null))[_0x872c('0x16')](function(_0x404c13){if(_0x404c13){return _0x404c13['addProactiveActions'](_0x5b4604[_0x872c('0x6e')]['ids'],_[_0x872c('0xf6')](_0x5b4604['body'],[_0x872c('0x7e'),'id'])||{});}})[_0x872c('0x16')](respondWithResult(_0x54c7a1,null))[_0x872c('0x20')](handleError(_0x54c7a1,null));};exports[_0x872c('0x11b')]=function(_0x2b71fa,_0x269b3c){var _0xb06672={};var _0x255886={};var _0x5cefce;var _0x5d21dd;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x2b71fa['params']['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x269b3c,null))[_0x872c('0x16')](function(_0x4bdd93){if(_0x4bdd93){_0x5cefce=_0x4bdd93;_0x255886[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0x11c')]['rawAttributes']);_0x255886[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x2b71fa[_0x872c('0x58')]);_0x255886[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x255886['model'],_0x255886[_0x872c('0x58')]);_0xb06672['attributes']=_[_0x872c('0x5b')](_0x255886[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x5c')]));_0xb06672['attributes']=_0xb06672[_0x872c('0x5a')][_0x872c('0x5d')]?_0xb06672[_0x872c('0x5a')]:_0x255886[_0x872c('0x50')];_0xb06672['order']=qs[_0x872c('0x60')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x60')]);_0xb06672[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x2b71fa['query'],_0x255886[_0x872c('0x59')]));if(_0x2b71fa[_0x872c('0x58')]['filter']){_0xb06672['where']=_['merge'](_0xb06672[_0x872c('0x62')],{'$or':_['map'](_0xb06672['attributes'],function(_0x25f2fc){var _0x3163b5={};_0x3163b5[_0x25f2fc]={'$like':'%'+_0x2b71fa['query'][_0x872c('0x61')]+'%'};return _0x3163b5;})});}_0xb06672=_['merge']({},_0xb06672,_0x2b71fa[_0x872c('0x6c')]);return _0x5cefce[_0x872c('0x11b')](_0xb06672);}})['then'](function(_0x212a38){if(_0x212a38){_0x5d21dd=_0x212a38['length'];if(!_0x2b71fa[_0x872c('0x58')][_0x872c('0x5e')]('nolimit')){_0xb06672[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x25')]);_0xb06672[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x2b71fa[_0x872c('0x58')]['offset']);}return _0x5cefce['getProactiveActions'](_0xb06672);}})['then'](function(_0x395211){if(_0x395211){return _0x395211?{'count':_0x5d21dd,'rows':_0x395211}:null;}})['then'](respondWithResult(_0x269b3c,null))[_0x872c('0x20')](handleError(_0x269b3c,null));};exports[_0x872c('0x11d')]=function(_0x3f3a49,_0x129037){var _0x4e6d0e=_0x3f3a49[_0x872c('0x58')][_0x872c('0x11e')]===_0x872c('0x11f')?_0x872c('0x120'):_0x872c('0x121');return db[_0x872c('0x64')][_0x872c('0x73')]({'attributes':['id',_0x4e6d0e],'where':{'id':_0x3f3a49[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x129037,null))[_0x872c('0x16')](function(_0xa6333a){if(_0xa6333a){var _0x1ec9ac=_0xa6333a[_0x4e6d0e];var _0x1eae07=_0x1ec9ac&&_0x1ec9ac['items']?_0x1ec9ac[_0x872c('0x122')]:[];_0x129037[_0x872c('0x2f')]({'fromKey':_[_0x872c('0x95')](_0x1ec9ac[_0x872c('0x123')])?undefined:_0x1ec9ac['fromKey'],'count':_0x1eae07[_0x872c('0x5d')],'rows':_0x1eae07});}})['catch'](handleError(_0x129037,null));};exports[_0x872c('0x124')]=function(_0x2328a4,_0x5135d8){var _0x1c8e31={'raw':![],'where':{}};var _0x3a7d2e={};var _0x67a052={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x2328a4[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x5135d8,null))[_0x872c('0x16')](function(_0x5aae44){if(_0x5aae44){_0x3a7d2e[_0x872c('0x50')]=_[_0x872c('0x6a')](db['ChatOfflineMessage']['rawAttributes']);_0x3a7d2e[_0x872c('0x58')]=_['keys'](_0x2328a4[_0x872c('0x58')]);_0x3a7d2e[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x3a7d2e[_0x872c('0x50')],_0x3a7d2e[_0x872c('0x58')]);_0x1c8e31[_0x872c('0x5a')]=_['intersection'](_0x3a7d2e['model'],qs['fields'](_0x2328a4[_0x872c('0x58')][_0x872c('0x5c')]));_0x1c8e31['attributes']=_0x1c8e31[_0x872c('0x5a')]['length']?_0x1c8e31[_0x872c('0x5a')]:_0x3a7d2e[_0x872c('0x50')];if(!_0x2328a4['query']['hasOwnProperty'](_0x872c('0x5f'))){_0x1c8e31[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x2328a4[_0x872c('0x58')][_0x872c('0x25')]);_0x1c8e31[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x2328a4[_0x872c('0x58')][_0x872c('0x23')]);}_0x1c8e31[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x2328a4[_0x872c('0x58')][_0x872c('0x60')]);_0x1c8e31[_0x872c('0x62')]=qs['filters'](_['pick'](_0x2328a4['query'],_0x3a7d2e[_0x872c('0x59')]));_0x1c8e31[_0x872c('0x62')][_0x872c('0x78')]=_0x5aae44['id'];if(_0x2328a4['query'][_0x872c('0x61')]){_0x1c8e31[_0x872c('0x62')]=_[_0x872c('0x6b')](_0x1c8e31[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x1c8e31[_0x872c('0x5a')],function(_0x2c2053){var _0xf24e18={};_0xf24e18[_0x2c2053]={'$like':'%'+_0x2328a4[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0xf24e18;})});}_0x1c8e31=_[_0x872c('0x6b')]({},_0x1c8e31,_0x2328a4[_0x872c('0x6c')]);return db[_0x872c('0xda')][_0x872c('0x26')]({'where':_0x1c8e31[_0x872c('0x62')]})['then'](function(_0x3f7c67){_0x67a052[_0x872c('0x26')]=_0x3f7c67;if(_0x2328a4['query'][_0x872c('0x65')]){_0x1c8e31[_0x872c('0x66')]=[{'all':!![]}];}else{_0x1c8e31[_0x872c('0x66')]=[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xf7'),'required':![]},{'model':db[_0x872c('0xe3')],'as':_0x872c('0x125'),'required':![]}];}return db[_0x872c('0xda')][_0x872c('0x67')](_0x1c8e31);})['then'](function(_0x2ec01c){_0x67a052[_0x872c('0x68')]=_0x2ec01c;return _0x67a052;});}})['then'](respondWithFilteredResult(_0x5135d8,_0x1c8e31))['catch'](handleError(_0x5135d8,null));};exports[_0x872c('0x126')]=function(_0x1f88d8,_0x19ce18){return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x1f88d8[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x19ce18,null))[_0x872c('0x16')](function(_0x46c2bb){if(_0x46c2bb){return _0x46c2bb[_0x872c('0x126')](_0x1f88d8[_0x872c('0x6e')][_0x872c('0x7e')],_[_0x872c('0xf6')](_0x1f88d8[_0x872c('0x6e')],[_0x872c('0x7e'),'id'])||{})[_0x872c('0xb2')](function(_0x4e43b3){for(var _0x2bba36=0x0;_0x2bba36<_0x1f88d8[_0x872c('0x6e')]['ids'][_0x872c('0x5d')];_0x2bba36+=0x1){socket[_0x872c('0x127')]('userChatWebsite:save',{'UserId':Number(_0x1f88d8[_0x872c('0x6e')][_0x872c('0x7e')][_0x2bba36]),'ChatWebsiteId':Number(_0x1f88d8[_0x872c('0x76')]['id'])});}return _0x4e43b3;});}})[_0x872c('0x16')](respondWithResult(_0x19ce18,null))[_0x872c('0x20')](handleError(_0x19ce18,null));};exports[_0x872c('0x128')]=function(_0x2b8fa9,_0x36b00b){return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x2b8fa9['params']['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x36b00b,null))[_0x872c('0x16')](function(_0x5ccd77){if(_0x5ccd77){return _0x5ccd77[_0x872c('0x128')](_0x2b8fa9['query'][_0x872c('0x7e')])['then'](function(){if(_[_0x872c('0x129')](_0x2b8fa9['query']['ids'])){for(var _0x2ad92c=0x0;_0x2ad92c<_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')][_0x872c('0x5d')];_0x2ad92c+=0x1){socket[_0x872c('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')][_0x2ad92c]),'ChatWebsiteId':Number(_0x2b8fa9[_0x872c('0x76')]['id'])});}}else{socket[_0x872c('0x127')](_0x872c('0x12a'),{'UserId':Number(_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')]),'ChatWebsiteId':Number(_0x2b8fa9['params']['id'])});}});}})[_0x872c('0x16')](respondWithStatusCode(_0x36b00b,null))[_0x872c('0x20')](handleError(_0x36b00b,null));};exports[_0x872c('0x12b')]=function(_0x491f86,_0x369225){var _0x4ffc14={};var _0x43ef84={};var _0x3d5689;var _0x6c55eb;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x491f86['params']['id']}})['then'](handleEntityNotFound(_0x369225,null))['then'](function(_0x2fd5e8){if(_0x2fd5e8){_0x3d5689=_0x2fd5e8;_0x43ef84[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xf8')][_0x872c('0x56')]);_0x43ef84[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x491f86[_0x872c('0x58')]);_0x43ef84[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x43ef84[_0x872c('0x50')],_0x43ef84[_0x872c('0x58')]);_0x4ffc14['attributes']=_['intersection'](_0x43ef84['model'],qs['fields'](_0x491f86[_0x872c('0x58')][_0x872c('0x5c')]));_0x4ffc14[_0x872c('0x5a')]=_0x4ffc14[_0x872c('0x5a')][_0x872c('0x5d')]?_0x4ffc14[_0x872c('0x5a')]:_0x43ef84[_0x872c('0x50')];_0x4ffc14['order']=qs['sort'](_0x491f86[_0x872c('0x58')][_0x872c('0x60')]);_0x4ffc14[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x491f86[_0x872c('0x58')],_0x43ef84[_0x872c('0x59')]));if(_0x491f86['query']['filter']){_0x4ffc14['where']=_[_0x872c('0x6b')](_0x4ffc14['where'],{'$or':_[_0x872c('0x3b')](_0x4ffc14[_0x872c('0x5a')],function(_0x21b156){var _0x560d62={};_0x560d62[_0x21b156]={'$like':'%'+_0x491f86['query'][_0x872c('0x61')]+'%'};return _0x560d62;})});}_0x4ffc14=_[_0x872c('0x6b')]({},_0x4ffc14,_0x491f86['options']);return _0x3d5689[_0x872c('0x12b')](_0x4ffc14);}})['then'](function(_0x352b0b){if(_0x352b0b){_0x6c55eb=_0x352b0b['length'];if(!_0x491f86[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x4ffc14[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x491f86[_0x872c('0x58')][_0x872c('0x25')]);_0x4ffc14['offset']=qs[_0x872c('0x23')](_0x491f86['query']['offset']);}return _0x3d5689['getAgents'](_0x4ffc14);}})['then'](function(_0x3f0134){if(_0x3f0134){return _0x3f0134?{'count':_0x6c55eb,'rows':_0x3f0134}:null;}})[_0x872c('0x16')](respondWithResult(_0x369225,null))[_0x872c('0x20')](handleError(_0x369225,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index d908614..17af6d9 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 _0x98d3=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x5ca9bb,_0x2ce05c){var _0x1b2a34=function(_0x2e5426){while(--_0x2e5426){_0x5ca9bb['push'](_0x5ca9bb['shift']());}};_0x1b2a34(++_0x2ce05c);}(_0x98d3,0x173));var _0x398d=function(_0x2cd8b0,_0x20b66a){_0x2cd8b0=_0x2cd8b0-0x0;var _0xd5fbcf=_0x98d3[_0x2cd8b0];return _0xd5fbcf;};'use strict';var EventEmitter=require(_0x398d('0x0'));var ChatWebsite=require(_0x398d('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x398d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x398d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x465d4a){return function(_0x41f57c,_0x4f7a58,_0x547cbc){ChatWebsiteEvents[_0x398d('0x4')](_0x465d4a+':'+_0x41f57c['id'],_0x41f57c);ChatWebsiteEvents[_0x398d('0x4')](_0x465d4a,_0x41f57c);_0x547cbc(null);};}for(var e in events){if(events[_0x398d('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x398d('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xe198=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x17de8e,_0x41ad4c){var _0x39aba5=function(_0x255320){while(--_0x255320){_0x17de8e['push'](_0x17de8e['shift']());}};_0x39aba5(++_0x41ad4c);}(_0xe198,0x6f));var _0x8e19=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe198[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x8e19('0x0'));var ChatWebsite=require(_0x8e19('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e19('0x2'),'afterUpdate':_0x8e19('0x3'),'afterDestroy':_0x8e19('0x4')};function emitEvent(_0x529200){return function(_0x32f52f,_0x4e3f58,_0x23383d){ChatWebsiteEvents[_0x8e19('0x5')](_0x529200+':'+_0x32f52f['id'],_0x32f52f);ChatWebsiteEvents[_0x8e19('0x5')](_0x529200,_0x32f52f);_0x23383d(null);};}for(var e in events){if(events[_0x8e19('0x6')](e)){var event=events[e];ChatWebsite[_0x8e19('0x7')](e,emitEvent(event));}}module[_0x8e19('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 0811bd3..ee42be4 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 _0x505c=['exports','ChatWebsite','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x505c,0x10a));var _0xc505=function(_0x3441bb,_0x11052c){_0x3441bb=_0x3441bb-0x0;var _0xd94568=_0x505c[_0x3441bb];return _0xd94568;};'use strict';var _=require(_0xc505('0x0'));var util=require(_0xc505('0x1'));var logger=require(_0xc505('0x2'))('api');var moment=require(_0xc505('0x3'));var BPromise=require(_0xc505('0x4'));var rp=require(_0xc505('0x5'));var fs=require('fs');var path=require(_0xc505('0x6'));var rimraf=require(_0xc505('0x7'));var config=require('../../config/environment');var attributes=require(_0xc505('0x8'));module[_0xc505('0x9')]=function(_0x2ba66b,_0x4d0e53){return _0x2ba66b['define'](_0xc505('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc80e=['moment','bluebird','path','rimraf','../../config/environment','exports','define','chat_websites','lodash','util','api'];(function(_0x3fa569,_0xf425fe){var _0x44ed1d=function(_0x5801c3){while(--_0x5801c3){_0x3fa569['push'](_0x3fa569['shift']());}};_0x44ed1d(++_0xf425fe);}(_0xc80e,0x152));var _0xec80=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0xc80e[_0x5a2299];return _0xedff0f;};'use strict';var _=require(_0xec80('0x0'));var util=require(_0xec80('0x1'));var logger=require('../../config/logger')(_0xec80('0x2'));var moment=require(_0xec80('0x3'));var BPromise=require(_0xec80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec80('0x5'));var rimraf=require(_0xec80('0x6'));var config=require(_0xec80('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xec80('0x8')]=function(_0x1448b9,_0x1742e3){return _0x1448b9[_0xec80('0x9')]('ChatWebsite',attributes,{'tableName':_0xec80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index d6a9a4f..1707400 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 _0x6835=['request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatWebsite.socket'];(function(_0x132fd3,_0x4352e8){var _0x5ce659=function(_0x17c5a4){while(--_0x17c5a4){_0x132fd3['push'](_0x132fd3['shift']());}};_0x5ce659(++_0x4352e8);}(_0x6835,0xc1));var _0x5683=function(_0x3cba89,_0x5a2845){_0x3cba89=_0x3cba89-0x0;var _0x25c1c5=_0x6835[_0x3cba89];return _0x25c1c5;};'use strict';var _=require(_0x5683('0x0'));var util=require(_0x5683('0x1'));var moment=require(_0x5683('0x2'));var BPromise=require(_0x5683('0x3'));var rs=require(_0x5683('0x4'));var fs=require('fs');var Redis=require(_0x5683('0x5'));var db=require(_0x5683('0x6'))['db'];var utils=require(_0x5683('0x7'));var logger=require(_0x5683('0x8'))(_0x5683('0x9'));var config=require(_0x5683('0xa'));var jayson=require(_0x5683('0xb'));var client=jayson[_0x5683('0xc')]['http']({'port':0x232a});config[_0x5683('0xd')]=_[_0x5683('0xe')](config[_0x5683('0xd')],{'host':_0x5683('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5683('0x10'))['register'](socket);function respondWithRpcPromise(_0x45ea00,_0x1da7ad,_0x2fa270){return new BPromise(function(_0x944285,_0x3a42c2){return client[_0x5683('0x11')](_0x45ea00,_0x2fa270)[_0x5683('0x12')](function(_0x2b31bc){logger[_0x5683('0x13')](_0x5683('0x14'),_0x1da7ad,_0x5683('0x15'));logger[_0x5683('0x16')](_0x5683('0x17'),_0x1da7ad,_0x5683('0x15'),JSON[_0x5683('0x18')](_0x2b31bc));if(_0x2b31bc[_0x5683('0x19')]){if(_0x2b31bc[_0x5683('0x19')][_0x5683('0x1a')]===0x1f4){logger['error'](_0x5683('0x14'),_0x1da7ad,_0x2b31bc[_0x5683('0x19')][_0x5683('0x1b')]);return _0x3a42c2(_0x2b31bc[_0x5683('0x19')]['message']);}logger[_0x5683('0x19')](_0x5683('0x14'),_0x1da7ad,_0x2b31bc[_0x5683('0x19')][_0x5683('0x1b')]);return _0x944285(_0x2b31bc['error']['message']);}else{logger[_0x5683('0x13')](_0x5683('0x14'),_0x1da7ad,_0x5683('0x15'));_0x944285(_0x2b31bc[_0x5683('0x1c')][_0x5683('0x1b')]);}})[_0x5683('0x1d')](function(_0x535f10){logger[_0x5683('0x19')](_0x5683('0x14'),_0x1da7ad,_0x535f10);_0x3a42c2(_0x535f10);});});}
\ No newline at end of file
+var _0x89ee=['stringify','code','error','message','result','catch','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x23f2a7,_0x3bc14f){var _0x547933=function(_0x4137e0){while(--_0x4137e0){_0x23f2a7['push'](_0x23f2a7['shift']());}};_0x547933(++_0x3bc14f);}(_0x89ee,0x14b));var _0xe89e=function(_0x9b2e01,_0x13c214){_0x9b2e01=_0x9b2e01-0x0;var _0x141a4d=_0x89ee[_0x9b2e01];return _0x141a4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe89e('0x0'));var BPromise=require(_0xe89e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe89e('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe89e('0x3'))('rpc');var config=require(_0xe89e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe89e('0x5')][_0xe89e('0x6')]({'port':0x232a});config[_0xe89e('0x7')]=_[_0xe89e('0x8')](config['redis'],{'host':_0xe89e('0x9'),'port':0x18eb});var socket=require(_0xe89e('0xa'))(new Redis(config[_0xe89e('0x7')]));require(_0xe89e('0xb'))[_0xe89e('0xc')](socket);function respondWithRpcPromise(_0x564978,_0xfc5150,_0x8a9762){return new BPromise(function(_0x58faf5,_0x24e107){return client[_0xe89e('0xd')](_0x564978,_0x8a9762)[_0xe89e('0xe')](function(_0x57de9d){logger[_0xe89e('0xf')](_0xe89e('0x10'),_0xfc5150,_0xe89e('0x11'));logger['debug'](_0xe89e('0x12'),_0xfc5150,_0xe89e('0x11'),JSON[_0xe89e('0x13')](_0x57de9d));if(_0x57de9d['error']){if(_0x57de9d['error'][_0xe89e('0x14')]===0x1f4){logger[_0xe89e('0x15')](_0xe89e('0x10'),_0xfc5150,_0x57de9d['error'][_0xe89e('0x16')]);return _0x24e107(_0x57de9d[_0xe89e('0x15')][_0xe89e('0x16')]);}logger[_0xe89e('0x15')](_0xe89e('0x10'),_0xfc5150,_0x57de9d[_0xe89e('0x15')]['message']);return _0x58faf5(_0x57de9d['error']['message']);}else{logger['info'](_0xe89e('0x10'),_0xfc5150,_0xe89e('0x11'));_0x58faf5(_0x57de9d[_0xe89e('0x17')][_0xe89e('0x16')]);}})[_0xe89e('0x18')](function(_0x37596f){logger[_0xe89e('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xfc5150,_0x37596f);_0x24e107(_0x37596f);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 34b9500..cd9257f 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 _0xcfa5=['./chatWebsite.events','save','update','emit','removeListener','chatWebsite:'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xcfa5,0xc6));var _0x5cfa=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcfa5[_0x2641f9];return _0x585741;};'use strict';var ChatWebsiteEvents=require(_0x5cfa('0x0'));var events=[_0x5cfa('0x1'),'remove',_0x5cfa('0x2')];function createListener(_0xaca869,_0x172bde){return function(_0x176b06){_0x172bde[_0x5cfa('0x3')](_0xaca869,_0x176b06);};}function removeListener(_0x3ff5e1,_0x453ff0){return function(){ChatWebsiteEvents[_0x5cfa('0x4')](_0x3ff5e1,_0x453ff0);};}exports['register']=function(_0x9f649f){for(var _0x15448c=0x0,_0x278774=events['length'];_0x15448c<_0x278774;_0x15448c++){var _0x372666=events[_0x15448c];var _0x14e777=createListener(_0x5cfa('0x5')+_0x372666,_0x9f649f);ChatWebsiteEvents['on'](_0x372666,_0x14e777);}};
\ No newline at end of file
+var _0x6188=['chatWebsite:','remove','update','emit','removeListener','register','length'];(function(_0x114e69,_0x48ee4b){var _0x481772=function(_0x5b2a60){while(--_0x5b2a60){_0x114e69['push'](_0x114e69['shift']());}};_0x481772(++_0x48ee4b);}(_0x6188,0x1b3));var _0x8618=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x6188[_0x525c7b];return _0x27b33e;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x8618('0x0'),_0x8618('0x1')];function createListener(_0x28d4c5,_0x73b45e){return function(_0x1ff4cf){_0x73b45e[_0x8618('0x2')](_0x28d4c5,_0x1ff4cf);};}function removeListener(_0x216b6d,_0xd93a0e){return function(){ChatWebsiteEvents[_0x8618('0x3')](_0x216b6d,_0xd93a0e);};}exports[_0x8618('0x4')]=function(_0x471ec1){for(var _0xbfce31=0x0,_0xa220c3=events[_0x8618('0x5')];_0xbfce31<_0xa220c3;_0xbfce31++){var _0x1b8fa8=events[_0xbfce31];var _0x47a640=createListener(_0x8618('0x6')+_0x1b8fa8,_0x471ec1);ChatWebsiteEvents['on'](_0x1b8fa8,_0x47a640);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7e7d53a..849e147 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 _0x2f55=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','addLogo','server/files/images/avatars/','single','addAvatar','diskStorage','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','destroy','delete','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get'];(function(_0x5fff96,_0x49b8c8){var _0x5532bc=function(_0x283752){while(--_0x283752){_0x5fff96['push'](_0x5fff96['shift']());}};_0x5532bc(++_0x49b8c8);}(_0x2f55,0x11f));var _0x52f5=function(_0x4254d5,_0x3d3ce9){_0x4254d5=_0x4254d5-0x0;var _0x858b3d=_0x2f55[_0x4254d5];return _0x858b3d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x52f5('0x0'));var timeout=require(_0x52f5('0x1'));var express=require(_0x52f5('0x2'));var router=express[_0x52f5('0x3')]();var fs_extra=require(_0x52f5('0x4'));var auth=require(_0x52f5('0x5'));var interaction=require(_0x52f5('0x6'));var config=require('../../config/environment');var controller=require(_0x52f5('0x7'));router[_0x52f5('0x8')]('/',auth[_0x52f5('0x9')](),controller[_0x52f5('0xa')]);router[_0x52f5('0x8')](_0x52f5('0xb'),auth[_0x52f5('0x9')](),controller[_0x52f5('0xc')]);router[_0x52f5('0x8')](_0x52f5('0xd'),auth[_0x52f5('0x9')](),controller[_0x52f5('0xe')]);router[_0x52f5('0x8')](_0x52f5('0xf'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x10')]);router[_0x52f5('0x8')](_0x52f5('0x11'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x12')]);router[_0x52f5('0x8')](_0x52f5('0x13'),controller[_0x52f5('0x14')]);router[_0x52f5('0x8')](_0x52f5('0x15'),controller['getAvatar']);router['get'](_0x52f5('0x16'),controller[_0x52f5('0x17')]);router[_0x52f5('0x8')](_0x52f5('0x18'),controller[_0x52f5('0x19')]);router[_0x52f5('0x8')](_0x52f5('0x1a'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x52f5('0x8')](_0x52f5('0x1b'),controller[_0x52f5('0x1c')]);router[_0x52f5('0x8')](_0x52f5('0x1d'),auth['isAuthenticated'](),controller[_0x52f5('0x1e')]);router['get'](_0x52f5('0x1f'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x20')]);router[_0x52f5('0x8')](_0x52f5('0x21'),controller['getFields']);router[_0x52f5('0x8')](_0x52f5('0x22'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x23')]);router['get'](_0x52f5('0x24'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x25')]);router[_0x52f5('0x26')]('/',auth['isAuthenticated'](),controller['create']);router[_0x52f5('0x26')](_0x52f5('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x52f5('0x11'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48c66d,_0x2faaf7,_0x53bef1){_0x53bef1(null,path[_0x52f5('0x28')](config[_0x52f5('0x29')],_0x52f5('0x2a')));},'filename':function(_0x3aa4da,_0x4e7557,_0x2772ee){_0x2772ee(null,util[_0x52f5('0x2b')](_0x52f5('0x2c'),Date[_0x52f5('0x2d')](),_0x4e7557[_0x52f5('0x2e')]));}})});router[_0x52f5('0x26')](_0x52f5('0x13'),upload['single']('file'),controller[_0x52f5('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3db6f2,_0x55605e,_0x5e613c){_0x5e613c(null,path[_0x52f5('0x28')](config['root'],_0x52f5('0x30')));},'filename':function(_0x4f1533,_0x4fbbd0,_0x4a102a){_0x4a102a(null,util[_0x52f5('0x2b')](_0x52f5('0x2c'),Date[_0x52f5('0x2d')](),_0x4fbbd0['originalname']));}})});router[_0x52f5('0x26')](_0x52f5('0x15'),upload[_0x52f5('0x31')]('file'),controller[_0x52f5('0x32')]);var upload=multer({'storage':multer[_0x52f5('0x33')]({'destination':function(_0x58ac90,_0x294cff,_0x138901){_0x138901(null,path[_0x52f5('0x28')](config[_0x52f5('0x29')],_0x52f5('0x30')));},'filename':function(_0x3eb9f7,_0x5b7c62,_0x4c15b0){_0x4c15b0(null,util['format']('%s-%s',Date[_0x52f5('0x2d')](),_0x5b7c62[_0x52f5('0x2e')]));}})});router[_0x52f5('0x26')](_0x52f5('0x16'),upload['single'](_0x52f5('0x34')),controller[_0x52f5('0x35')]);var upload=multer({'storage':multer[_0x52f5('0x33')]({'destination':function(_0x9e78f5,_0x552b87,_0x52d0ba){_0x52d0ba(null,path[_0x52f5('0x28')](config[_0x52f5('0x29')],_0x52f5('0x30')));},'filename':function(_0x2fa4d1,_0x49af2d,_0x51ea35){_0x51ea35(null,util[_0x52f5('0x2b')](_0x52f5('0x2c'),Date[_0x52f5('0x2d')](),_0x49af2d['originalname']));}})});router[_0x52f5('0x26')](_0x52f5('0x18'),upload[_0x52f5('0x31')](_0x52f5('0x34')),controller[_0x52f5('0x36')]);router[_0x52f5('0x26')](_0x52f5('0x37'),controller[_0x52f5('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x52f5('0x33')]({'destination':function(_0x243780,_0x24da18,_0x397dad){const _0x1e90b6=path[_0x52f5('0x28')](config[_0x52f5('0x29')],_0x52f5('0x39'),_0x52f5('0x3a'),'offline-chat');fs_extra[_0x52f5('0x3b')](_0x1e90b6,function(){_0x397dad(null,_0x1e90b6);});},'filename':function(_0x3d1e33,_0x56619f,_0x334804){const _0x56981d=_0x56619f['originalname'][_0x52f5('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3592e5=path[_0x52f5('0x3d')](_0x56981d);const _0x4fe950=Date[_0x52f5('0x2d')]()+'-'+_0x56981d[_0x52f5('0x3c')](_0x3592e5,'')+_0x3592e5;_0x334804(null,_0x4fe950);}})});router[_0x52f5('0x26')](_0x52f5('0x3e'),offlineUploadMulter[_0x52f5('0x3f')](),controller[_0x52f5('0x40')]);router[_0x52f5('0x26')](_0x52f5('0x1a'),auth[_0x52f5('0x9')](),controller['addInteraction']);router[_0x52f5('0x26')](_0x52f5('0x1d'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x41')]);router[_0x52f5('0x26')](_0x52f5('0x1f'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x42')]);router[_0x52f5('0x26')]('/:id/users',auth[_0x52f5('0x9')](),controller[_0x52f5('0x43')]);router[_0x52f5('0x44')](_0x52f5('0xd'),auth[_0x52f5('0x9')](),controller['update']);router['delete'](_0x52f5('0xd'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x45')]);router[_0x52f5('0x46')](_0x52f5('0xf'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x47')]);router[_0x52f5('0x46')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x52f5('0x46')](_0x52f5('0x24'),auth['isAuthenticated'](),controller[_0x52f5('0x48')]);module[_0x52f5('0x49')]=router;
\ No newline at end of file
+var _0x8368=['/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','addCustomerAvatar','format','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','/:id','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar'];(function(_0x6352a6,_0xdbe9b9){var _0x2b473c=function(_0x330739){while(--_0x330739){_0x6352a6['push'](_0x6352a6['shift']());}};_0x2b473c(++_0xdbe9b9);}(_0x8368,0x186));var _0x8836=function(_0x1ec626,_0x22bba4){_0x1ec626=_0x1ec626-0x0;var _0x128ba3=_0x8368[_0x1ec626];return _0x128ba3;};'use strict';var multer=require(_0x8836('0x0'));var util=require(_0x8836('0x1'));var path=require(_0x8836('0x2'));var timeout=require(_0x8836('0x3'));var express=require(_0x8836('0x4'));var router=express[_0x8836('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8836('0x6'));var config=require(_0x8836('0x7'));var controller=require(_0x8836('0x8'));router['get']('/',auth[_0x8836('0x9')](),controller['index']);router[_0x8836('0xa')](_0x8836('0xb'),auth[_0x8836('0x9')](),controller[_0x8836('0xc')]);router[_0x8836('0xa')]('/:id',auth[_0x8836('0x9')](),controller[_0x8836('0xd')]);router[_0x8836('0xa')](_0x8836('0xe'),auth[_0x8836('0x9')](),controller[_0x8836('0xf')]);router[_0x8836('0xa')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller['getAnswers']);router[_0x8836('0xa')](_0x8836('0x10'),controller[_0x8836('0x11')]);router[_0x8836('0xa')](_0x8836('0x12'),controller[_0x8836('0x13')]);router[_0x8836('0xa')](_0x8836('0x14'),controller[_0x8836('0x15')]);router[_0x8836('0xa')](_0x8836('0x16'),controller[_0x8836('0x17')]);router['get'](_0x8836('0x18'),auth[_0x8836('0x9')](),controller[_0x8836('0x19')]);router[_0x8836('0xa')](_0x8836('0x1a'),controller['getSnippet']);router[_0x8836('0xa')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8836('0x1b')]);router[_0x8836('0xa')](_0x8836('0x1c'),auth[_0x8836('0x9')](),controller[_0x8836('0x1d')]);router[_0x8836('0xa')](_0x8836('0x1e'),controller[_0x8836('0x1f')]);router['get']('/:id/offline_messages',auth[_0x8836('0x9')](),controller[_0x8836('0x20')]);router['get'](_0x8836('0x21'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8836('0x22')]('/',auth[_0x8836('0x9')](),controller[_0x8836('0x23')]);router[_0x8836('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8836('0x24')]);router[_0x8836('0x22')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller[_0x8836('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4807b9,_0x54852b,_0x5ee6a0){_0x5ee6a0(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x28')));},'filename':function(_0x3d29e8,_0xc435ec,_0x1acb0f){_0x1acb0f(null,util['format'](_0x8836('0x29'),Date[_0x8836('0x2a')](),_0xc435ec[_0x8836('0x2b')]));}})});router['post']('/:id/logo',upload[_0x8836('0x2c')](_0x8836('0x2d')),controller[_0x8836('0x2e')]);var upload=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x9c0ba,_0x552e8f,_0x5943a6){_0x5943a6(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x47aa75,_0x11b1f0,_0xf9dd54){_0xf9dd54(null,util['format'](_0x8836('0x29'),Date[_0x8836('0x2a')](),_0x11b1f0[_0x8836('0x2b')]));}})});router[_0x8836('0x22')](_0x8836('0x12'),upload[_0x8836('0x2c')](_0x8836('0x2d')),controller[_0x8836('0x31')]);var upload=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x11d7c6,_0x642f13,_0x211c33){_0x211c33(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x5a55c9,_0x206c9a,_0x37dc2a){_0x37dc2a(null,util['format']('%s-%s',Date[_0x8836('0x2a')](),_0x206c9a['originalname']));}})});router[_0x8836('0x22')](_0x8836('0x14'),upload['single'](_0x8836('0x2d')),controller[_0x8836('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45f488,_0xfefdc6,_0x1aa25f){_0x1aa25f(null,path['join'](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x5034ae,_0xddce44,_0x26e064){_0x26e064(null,util[_0x8836('0x33')]('%s-%s',Date[_0x8836('0x2a')](),_0xddce44['originalname']));}})});router['post'](_0x8836('0x16'),upload['single'](_0x8836('0x2d')),controller[_0x8836('0x34')]);router[_0x8836('0x22')](_0x8836('0x35'),controller[_0x8836('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x773826,_0x380111,_0x5c6184){const _0x7d9bfa=path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x37'),_0x8836('0x38'),'offline-chat');fs_extra[_0x8836('0x39')](_0x7d9bfa,function(){_0x5c6184(null,_0x7d9bfa);});},'filename':function(_0x1c22ee,_0x8059fc,_0x37c0a2){const _0x348db9=_0x8059fc[_0x8836('0x2b')][_0x8836('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xff5c97=path['extname'](_0x348db9);const _0x1dfa7e=Date[_0x8836('0x2a')]()+'-'+_0x348db9[_0x8836('0x3a')](_0xff5c97,'')+_0xff5c97;_0x37c0a2(null,_0x1dfa7e);}})});router[_0x8836('0x22')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x8836('0x3b')]);router[_0x8836('0x22')](_0x8836('0x18'),auth['isAuthenticated'](),controller[_0x8836('0x3c')]);router[_0x8836('0x22')]('/:id/applications',auth[_0x8836('0x9')](),controller[_0x8836('0x3d')]);router[_0x8836('0x22')]('/:id/proactive_actions',auth[_0x8836('0x9')](),controller[_0x8836('0x3e')]);router[_0x8836('0x22')]('/:id/users',auth[_0x8836('0x9')](),controller[_0x8836('0x3f')]);router['put']('/:id',auth[_0x8836('0x9')](),controller[_0x8836('0x40')]);router[_0x8836('0x41')](_0x8836('0x42'),auth[_0x8836('0x9')](),controller['destroy']);router[_0x8836('0x41')]('/:id/dispositions',auth[_0x8836('0x9')](),controller['removeDispositions']);router[_0x8836('0x41')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller[_0x8836('0x43')]);router[_0x8836('0x41')](_0x8836('0x21'),auth[_0x8836('0x9')](),controller['removeAgents']);module[_0x8836('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index a335853..bf97744 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 _0xa7fe=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','app','get','client-side-logger'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xa7fe,0x102));var _0xea7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7fe[_0x3dd15e];return _0x231fd0;};var beaverLogger=require(_0xea7f('0x0'));var express=require('express');var auth=require(_0xea7f('0x1'));var config=require(_0xea7f('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x3f4c68,_0x2e3d87,_0x5bb30f){var _0xd423f7=_0x3f4c68[_0xea7f('0x3')][_0xea7f('0x4')](_0xea7f('0x5'));if(!_0xd423f7){throw new Error(_0xea7f('0x6'));}return beaverLogger[_0xea7f('0x7')]({'uri':'/client-logs','logger':_0xd423f7,'enableCors':!isProduction})(_0x3f4c68,_0x2e3d87,_0x5bb30f);}router[_0xea7f('0x8')](auth[_0xea7f('0x9')](),clientSideLogs);module[_0xea7f('0xa')]=router;
\ No newline at end of file
+var _0xf016=['production','get','client-side-logger','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env'];(function(_0x2caf3a,_0x1d65d6){var _0x34f044=function(_0x31410c){while(--_0x31410c){_0x2caf3a['push'](_0x2caf3a['shift']());}};_0x34f044(++_0x1d65d6);}(_0xf016,0xdf));var _0x6f01=function(_0x36980d,_0x266c7f){_0x36980d=_0x36980d-0x0;var _0x18555d=_0xf016[_0x36980d];return _0x18555d;};var beaverLogger=require('beaver-logger/server');var express=require(_0x6f01('0x0'));var auth=require(_0x6f01('0x1'));var config=require(_0x6f01('0x2'));var router=express[_0x6f01('0x3')]();var isProduction=config[_0x6f01('0x4')]===_0x6f01('0x5')||![];function clientSideLogs(_0x4212de,_0x1aa1b1,_0xada4d2){var _0x4ce592=_0x4212de['app'][_0x6f01('0x6')](_0x6f01('0x7'));if(!_0x4ce592){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0x6f01('0x8'),'logger':_0x4ce592,'enableCors':!isProduction})(_0x4212de,_0x1aa1b1,_0xada4d2);}router[_0x6f01('0x9')](auth[_0x6f01('0xa')](),clientSideLogs);module[_0x6f01('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 5eaa0c1..0aa6b89 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 _0x7e5c=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x7e5c,0x7e));var _0xc7e5=function(_0x2e18a9,_0x2ae8c2){_0x2e18a9=_0x2e18a9-0x0;var _0x39d8d7=_0x7e5c[_0x2e18a9];return _0x39d8d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc7e5('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc7e5('0x1')](_0xc7e5('0x2'),_0xc7e5('0x3'),_0xc7e5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc7e5('0x1')](_0xc7e5('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xc7e5('0x0')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xc7e5('0x0')],'comment':_0xc7e5('0x6')},'data4':{'type':Sequelize['STRING'],'comment':_0xc7e5('0x7')},'data5':{'type':Sequelize[_0xc7e5('0x8')],'comment':_0xc7e5('0x9')},'data6':{'type':Sequelize[_0xc7e5('0x8')],'comment':_0xc7e5('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':_0xc7e5('0xb')}};
\ No newline at end of file
+var _0xba9f=['MicrosoftAzure\x20=>\x20access_token','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x5d8f86,_0x238cd9){var _0xfece95=function(_0x196473){while(--_0x196473){_0x5d8f86['push'](_0x5d8f86['shift']());}};_0xfece95(++_0x238cd9);}(_0xba9f,0x143));var _0xfba9=function(_0x59af48,_0x54de5c){_0x59af48=_0x59af48-0x0;var _0x386bc6=_0xba9f[_0x59af48];return _0x386bc6;};'use strict';var Sequelize=require(_0xfba9('0x0'));module[_0xfba9('0x1')]={'name':{'type':Sequelize[_0xfba9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfba9('0x3')](_0xfba9('0x4'),_0xfba9('0x5'),_0xfba9('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xfba9('0x3')](_0xfba9('0x7'),_0xfba9('0x8'))},'data1':{'type':Sequelize[_0xfba9('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0x9')},'data3':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0xa')},'data4':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0xb')},'data5':{'type':Sequelize[_0xfba9('0xc')],'comment':_0xfba9('0xd')},'data6':{'type':Sequelize[_0xfba9('0xc')],'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 0bb2a45..189e0a7 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 _0x4e89=['generateMicrosoftAuthorizationUrl','user','error','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','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','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','stack','name','send','slice','map','CloudProvider','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','service','MicrosoftAzure','decryptString','data3','show','params','rawAttributes','fields','length','include','find','catch','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','findOne'];(function(_0x542503,_0x3074d1){var _0x3b1d94=function(_0x1cbbe9){while(--_0x1cbbe9){_0x542503['push'](_0x542503['shift']());}};_0x3b1d94(++_0x3074d1);}(_0x4e89,0x81));var _0x94e8=function(_0x28b07c,_0x162ebe){_0x28b07c=_0x28b07c-0x0;var _0x25eda7=_0x4e89[_0x28b07c];return _0x25eda7;};'use strict';var _=require('lodash');var Redis=require(_0x94e8('0x0'));var qs=require(_0x94e8('0x1'));var encryptor=require(_0x94e8('0x2'));var config=require(_0x94e8('0x3'));var logger=require(_0x94e8('0x4'))(_0x94e8('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x94e8('0x6'));config[_0x94e8('0x7')]=_[_0x94e8('0x8')](config[_0x94e8('0x7')],{'host':_0x94e8('0x9'),'port':0x18eb});var socket=require(_0x94e8('0xa'))(new Redis(config[_0x94e8('0x7')]));var redis=new Redis(config[_0x94e8('0x7')]);function respondWithStatusCode(_0x40359e,_0x5e92f5){_0x5e92f5=_0x5e92f5||0xcc;return function(_0xf1bdc0){if(_0xf1bdc0){return _0x40359e[_0x94e8('0xb')](_0x5e92f5);}return _0x40359e[_0x94e8('0xc')](_0x5e92f5)[_0x94e8('0xd')]();};}function respondWithResult(_0x1a5743,_0x863cc){_0x863cc=_0x863cc||0xc8;return function(_0x2a3a5d){if(_0x2a3a5d){return _0x1a5743[_0x94e8('0xc')](_0x863cc)[_0x94e8('0xe')](_0x2a3a5d);}};}function respondWithFilteredResult(_0x87a5a8,_0x47653a){return function(_0x42e25f){if(_0x42e25f){var _0x517a1a=typeof _0x47653a[_0x94e8('0xf')]==='undefined'&&typeof _0x47653a[_0x94e8('0x10')]===_0x94e8('0x11');var _0x511bff=_0x42e25f[_0x94e8('0x12')];var _0x24a63d=_0x517a1a?0x0:_0x47653a[_0x94e8('0xf')];var _0x2941c6=_0x517a1a?_0x42e25f[_0x94e8('0x12')]:_0x47653a[_0x94e8('0xf')]+_0x47653a['limit'];var _0x15ba6a;if(_0x2941c6>=_0x511bff){_0x2941c6=_0x511bff;_0x15ba6a=0xc8;}else{_0x15ba6a=0xce;}_0x87a5a8[_0x94e8('0xc')](_0x15ba6a);return _0x87a5a8[_0x94e8('0x13')](_0x94e8('0x14'),_0x24a63d+'-'+_0x2941c6+'/'+_0x511bff)['json'](_0x42e25f);}return null;};}function saveUpdates(_0x566e1f){return function(_0x321698){if(_0x321698){return _0x321698[_0x94e8('0x15')](_0x566e1f)[_0x94e8('0x16')](function(_0x53e11c){return _0x53e11c;});}return null;};}function removeEntity(_0x27ccdd){return function(_0x838ca1){if(_0x838ca1){return _0x838ca1[_0x94e8('0x17')]()[_0x94e8('0x16')](function(){_0x27ccdd[_0x94e8('0xc')](0xcc)[_0x94e8('0xd')]();});}};}function handleEntityNotFound(_0x18077b){return function(_0x434517){if(!_0x434517){_0x18077b[_0x94e8('0xb')](0x194);}return _0x434517;};}function handleError(_0x20d86e,_0x25f928){_0x25f928=_0x25f928||0x1f4;return function(_0x3c2230){logger['error'](_0x3c2230[_0x94e8('0x18')]);if(_0x3c2230['name']){delete _0x3c2230[_0x94e8('0x19')];}_0x20d86e['status'](_0x25f928)[_0x94e8('0x1a')](_0x3c2230);};}function maskClientSecret(_0x35b4d2){return _['padEnd'](_0x35b4d2[_0x94e8('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x58bceb,_0x3e3ce3){var _0x2fec76={},_0x4665b3={},_0x2c614f={'count':0x0,'rows':[]};var _0x1be93d=_[_0x94e8('0x1c')](db[_0x94e8('0x1d')]['rawAttributes'],function(_0x9ba625){return{'name':_0x9ba625[_0x94e8('0x1e')],'type':_0x9ba625[_0x94e8('0x1f')][_0x94e8('0x20')]};});_0x4665b3[_0x94e8('0x21')]=_[_0x94e8('0x1c')](_0x1be93d,_0x94e8('0x19'));_0x4665b3['query']=_[_0x94e8('0x22')](_0x58bceb[_0x94e8('0x23')]);_0x4665b3[_0x94e8('0x24')]=_[_0x94e8('0x25')](_0x4665b3[_0x94e8('0x21')],_0x4665b3[_0x94e8('0x23')]);_0x2fec76[_0x94e8('0x26')]=_[_0x94e8('0x25')](_0x4665b3[_0x94e8('0x21')],qs['fields'](_0x58bceb[_0x94e8('0x23')]['fields']));_0x2fec76[_0x94e8('0x26')]=_0x2fec76[_0x94e8('0x26')]['length']?_0x2fec76[_0x94e8('0x26')]:_0x4665b3['model'];if(!_0x58bceb[_0x94e8('0x23')][_0x94e8('0x27')](_0x94e8('0x28'))){_0x2fec76[_0x94e8('0x10')]=qs[_0x94e8('0x10')](_0x58bceb[_0x94e8('0x23')][_0x94e8('0x10')]);_0x2fec76[_0x94e8('0xf')]=qs[_0x94e8('0xf')](_0x58bceb['query']['offset']);}_0x2fec76['order']=qs[_0x94e8('0x29')](_0x58bceb[_0x94e8('0x23')][_0x94e8('0x29')]);_0x2fec76[_0x94e8('0x2a')]=qs['filters'](_[_0x94e8('0x2b')](_0x58bceb['query'],_0x4665b3[_0x94e8('0x24')]),_0x1be93d);if(_0x58bceb['query'][_0x94e8('0x2c')]){_0x2fec76['where']=_[_0x94e8('0x2d')](_0x2fec76[_0x94e8('0x2a')],{'$or':_[_0x94e8('0x1c')](_0x1be93d,function(_0x38c719){if(_0x38c719[_0x94e8('0x1f')]!==_0x94e8('0x2e')){var _0x1d724f={};_0x1d724f[_0x38c719[_0x94e8('0x19')]]={'$like':'%'+_0x58bceb['query']['filter']+'%'};return _0x1d724f;}})});}_0x2fec76=_['merge']({},_0x2fec76,_0x58bceb[_0x94e8('0x2f')]);var _0x42cbf4={'where':_0x2fec76[_0x94e8('0x2a')]};return db['CloudProvider'][_0x94e8('0x12')](_0x42cbf4)[_0x94e8('0x16')](function(_0x1e31db){_0x2c614f[_0x94e8('0x12')]=_0x1e31db;if(_0x58bceb[_0x94e8('0x23')]['includeAll']){_0x2fec76['include']=[{'all':!![]}];}return db[_0x94e8('0x1d')][_0x94e8('0x30')](_0x2fec76);})[_0x94e8('0x16')](function(_0x21bd6c){_0x2c614f['rows']=_[_0x94e8('0x1c')](_0x21bd6c,function(_0x452dbf){if(_0x452dbf[_0x94e8('0x31')]===_0x94e8('0x32')){var _0x2e95f9=encryptor[_0x94e8('0x33')](_0x452dbf[_0x94e8('0x34')]);_0x452dbf[_0x94e8('0x34')]=maskClientSecret(_0x2e95f9);}return _0x452dbf;});return _0x2c614f;})['then'](respondWithFilteredResult(_0x3e3ce3,_0x2fec76))['catch'](handleError(_0x3e3ce3,null));};exports[_0x94e8('0x35')]=function(_0x28c8ca,_0x44b5f5){var _0x107fe7={'raw':!![],'where':{'id':_0x28c8ca[_0x94e8('0x36')]['id']}},_0x371426={};_0x371426[_0x94e8('0x21')]=_[_0x94e8('0x22')](db[_0x94e8('0x1d')][_0x94e8('0x37')]);_0x371426['query']=_[_0x94e8('0x22')](_0x28c8ca['query']);_0x371426[_0x94e8('0x24')]=_[_0x94e8('0x25')](_0x371426[_0x94e8('0x21')],_0x371426[_0x94e8('0x23')]);_0x107fe7['attributes']=_[_0x94e8('0x25')](_0x371426[_0x94e8('0x21')],qs['fields'](_0x28c8ca[_0x94e8('0x23')][_0x94e8('0x38')]));_0x107fe7[_0x94e8('0x26')]=_0x107fe7[_0x94e8('0x26')][_0x94e8('0x39')]?_0x107fe7[_0x94e8('0x26')]:_0x371426['model'];if(_0x28c8ca['query']['includeAll']){_0x107fe7[_0x94e8('0x3a')]=[{'all':!![]}];}_0x107fe7=_['merge']({},_0x107fe7,_0x28c8ca[_0x94e8('0x2f')]);return db['CloudProvider'][_0x94e8('0x3b')](_0x107fe7)[_0x94e8('0x16')](handleEntityNotFound(_0x44b5f5,null))['then'](function(_0x11e514){if(_0x11e514[_0x94e8('0x31')]===_0x94e8('0x32')){var _0x295821=encryptor[_0x94e8('0x33')](_0x11e514['data3']);_0x11e514['data3']=maskClientSecret(_0x295821);}return _0x11e514;})[_0x94e8('0x16')](respondWithResult(_0x44b5f5,null))[_0x94e8('0x3c')](handleError(_0x44b5f5,null));};exports['create']=function(_0x409d6b,_0xc0d208){if(!_0x409d6b[_0x94e8('0x3d')]['name'])throw new Error(_0x94e8('0x3e'));if(!_0x409d6b[_0x94e8('0x3d')][_0x94e8('0x31')])throw new Error(_0x94e8('0x3f'));var _0x55de39=db['CloudProvider']['rawAttributes'][_0x94e8('0x31')][_0x94e8('0x40')];if(!_0x55de39[_0x94e8('0x41')](_0x409d6b['body']['service']))throw new Error(_0x94e8('0x42')+_0x55de39[_0x94e8('0x43')](',\x20'));if(_0x409d6b[_0x94e8('0x3d')][_0x94e8('0x31')]===_0x94e8('0x32')&&_0x409d6b[_0x94e8('0x3d')][_0x94e8('0x34')]){_0x409d6b[_0x94e8('0x3d')]['data3']=encryptor[_0x94e8('0x44')](_0x409d6b[_0x94e8('0x3d')][_0x94e8('0x34')]);}return db[_0x94e8('0x1d')][_0x94e8('0x45')](_0x409d6b[_0x94e8('0x3d')],{})[_0x94e8('0x16')](respondWithResult(_0xc0d208,0xc9))[_0x94e8('0x3c')](handleError(_0xc0d208,null));};exports[_0x94e8('0x15')]=function(_0x10df82,_0x42f57d){if(_0x10df82[_0x94e8('0x3d')]['id']){delete _0x10df82[_0x94e8('0x3d')]['id'];}return db[_0x94e8('0x1d')]['find']({'where':{'id':_0x10df82[_0x94e8('0x36')]['id']}})[_0x94e8('0x16')](handleEntityNotFound(_0x42f57d,null))[_0x94e8('0x16')](function(_0x5668a8){if(_0x5668a8['service']===_0x94e8('0x32')&&_0x10df82[_0x94e8('0x3d')][_0x94e8('0x34')]){_0x10df82[_0x94e8('0x3d')][_0x94e8('0x34')]=encryptor['encryptString'](_0x10df82['body']['data3']);}return _0x5668a8;})[_0x94e8('0x16')](saveUpdates(_0x10df82[_0x94e8('0x3d')],null))[_0x94e8('0x16')](respondWithResult(_0x42f57d,null))['catch'](handleError(_0x42f57d,null));};exports[_0x94e8('0x17')]=function(_0x1919ce,_0x4fe895){return db[_0x94e8('0x1d')][_0x94e8('0x3b')]({'where':{'id':_0x1919ce[_0x94e8('0x36')]['id']}})[_0x94e8('0x16')](handleEntityNotFound(_0x4fe895,null))[_0x94e8('0x16')](removeEntity(_0x4fe895,null))[_0x94e8('0x3c')](handleError(_0x4fe895,null));};exports['oauth2MicrosoftAuthorize']=function(_0x213732,_0x30f319){return db[_0x94e8('0x1d')][_0x94e8('0x46')]({'where':{'id':_0x213732[_0x94e8('0x36')]['id']},'raw':!![]})[_0x94e8('0x16')](function(_0x16d987){if(!_0x16d987)return _0x30f319['sendStatus'](0x194);return{'url':oauth[_0x94e8('0x47')](_0x16d987,_0x213732[_0x94e8('0x48')]['id'])};})[_0x94e8('0x16')](respondWithResult(_0x30f319,null))[_0x94e8('0x3c')](handleError(_0x30f319,null));};exports['oauth2MicrosoftCallback']=function(_0x3fba08,_0x19145e){var _0x47da11=_0x3fba08[_0x94e8('0x3d')];var _0x50542d;var _0x149c71;if(_0x47da11[_0x94e8('0x49')])throw _0x47da11;redis[_0x94e8('0x4a')](_0x47da11[_0x94e8('0x4b')])[_0x94e8('0x16')](function(_0x508592){if(!_0x508592)throw new Error(_0x94e8('0x4c'));_0x50542d=JSON['parse'](_0x508592);var _0x59b8aa=Buffer[_0x94e8('0x4d')](_0x47da11[_0x94e8('0x4b')],_0x94e8('0x4e'))[_0x94e8('0x4f')](_0x94e8('0x50'));_0x149c71=JSON[_0x94e8('0x51')](_0x59b8aa);if(!oauth[_0x94e8('0x52')](_0x47da11[_0x94e8('0x53')],_0x50542d[_0x94e8('0x54')]))throw new Error(_0x94e8('0x55'));redis[_0x94e8('0x56')](_0x47da11['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x47da11[_0x94e8('0x57')],_0x50542d);})['then'](function(_0x9658a8){_0x50542d[_0x94e8('0x58')]=_0x9658a8[_0x94e8('0x59')];_0x50542d[_0x94e8('0x5a')]=_0x9658a8[_0x94e8('0x5b')];return db[_0x94e8('0x1d')][_0x94e8('0x15')]({'data5':_0x50542d['data5'],'data6':_0x50542d[_0x94e8('0x5a')]},{'where':{'id':_0x50542d['id']}});})[_0x94e8('0x16')](function(){oauth[_0x94e8('0x5c')](_0x50542d);socket[_0x94e8('0x5d')](_0x94e8('0x5e'),{'id':_0x149c71['id']});return;})[_0x94e8('0x16')](respondWithStatusCode(_0x19145e,null))[_0x94e8('0x3c')](function(_0x2a2b90){if(_0x149c71){socket[_0x94e8('0x5d')](_0x94e8('0x5f'),{'id':_0x149c71['id']});}if(!_0x50542d){logger[_0x94e8('0x49')](_0x94e8('0x60'),_0x2a2b90);return _0x19145e[_0x94e8('0xc')](0x1f4)[_0x94e8('0x1a')](_0x2a2b90[_0x94e8('0x61')]);}logger[_0x94e8('0x49')](_0x94e8('0x62'),_0x50542d['id'],JSON[_0x94e8('0x63')](_0x2a2b90));});};
\ No newline at end of file
+var _0x7586=['Invalid\x20state\x20parameter','from','state','base64','toString','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','service','decryptString','data3','catch','params','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get'];(function(_0x5b3c61,_0x3eb2aa){var _0x153389=function(_0x2a1a99){while(--_0x2a1a99){_0x5b3c61['push'](_0x5b3c61['shift']());}};_0x153389(++_0x3eb2aa);}(_0x7586,0xcc));var _0x6758=function(_0x5168e3,_0x4b9c51){_0x5168e3=_0x5168e3-0x0;var _0x3112c3=_0x7586[_0x5168e3];return _0x3112c3;};'use strict';var _=require(_0x6758('0x0'));var Redis=require('ioredis');var qs=require(_0x6758('0x1'));var encryptor=require(_0x6758('0x2'));var config=require(_0x6758('0x3'));var logger=require(_0x6758('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x6758('0x5'));config['redis']=_[_0x6758('0x6')](config[_0x6758('0x7')],{'host':_0x6758('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6758('0x7')]));var redis=new Redis(config[_0x6758('0x7')]);function respondWithStatusCode(_0x2f9c03,_0x20e32b){_0x20e32b=_0x20e32b||0xcc;return function(_0xe9817c){if(_0xe9817c){return _0x2f9c03[_0x6758('0x9')](_0x20e32b);}return _0x2f9c03[_0x6758('0xa')](_0x20e32b)[_0x6758('0xb')]();};}function respondWithResult(_0x454b04,_0x261774){_0x261774=_0x261774||0xc8;return function(_0x577929){if(_0x577929){return _0x454b04['status'](_0x261774)[_0x6758('0xc')](_0x577929);}};}function respondWithFilteredResult(_0x7c5652,_0x13a6f7){return function(_0xdc858b){if(_0xdc858b){var _0x260583=typeof _0x13a6f7[_0x6758('0xd')]===_0x6758('0xe')&&typeof _0x13a6f7[_0x6758('0xf')]==='undefined';var _0x21a6f0=_0xdc858b[_0x6758('0x10')];var _0x196b66=_0x260583?0x0:_0x13a6f7[_0x6758('0xd')];var _0x5c0fcf=_0x260583?_0xdc858b[_0x6758('0x10')]:_0x13a6f7[_0x6758('0xd')]+_0x13a6f7[_0x6758('0xf')];var _0x8c885c;if(_0x5c0fcf>=_0x21a6f0){_0x5c0fcf=_0x21a6f0;_0x8c885c=0xc8;}else{_0x8c885c=0xce;}_0x7c5652[_0x6758('0xa')](_0x8c885c);return _0x7c5652['set'](_0x6758('0x11'),_0x196b66+'-'+_0x5c0fcf+'/'+_0x21a6f0)[_0x6758('0xc')](_0xdc858b);}return null;};}function saveUpdates(_0x34f05e){return function(_0xd1b264){if(_0xd1b264){return _0xd1b264['update'](_0x34f05e)[_0x6758('0x12')](function(_0x51f2b3){return _0x51f2b3;});}return null;};}function removeEntity(_0x374534){return function(_0x4d329b){if(_0x4d329b){return _0x4d329b['destroy']()['then'](function(){_0x374534['status'](0xcc)[_0x6758('0xb')]();});}};}function handleEntityNotFound(_0x4035c3){return function(_0x2e9308){if(!_0x2e9308){_0x4035c3['sendStatus'](0x194);}return _0x2e9308;};}function handleError(_0x236c25,_0x218a89){_0x218a89=_0x218a89||0x1f4;return function(_0x3dcfe8){logger['error'](_0x3dcfe8['stack']);if(_0x3dcfe8['name']){delete _0x3dcfe8[_0x6758('0x13')];}_0x236c25[_0x6758('0xa')](_0x218a89)[_0x6758('0x14')](_0x3dcfe8);};}function maskClientSecret(_0xb1bc03){return _[_0x6758('0x15')](_0xb1bc03[_0x6758('0x16')](0x0,0x3),0x14,'*');}exports[_0x6758('0x17')]=function(_0x962d0c,_0x1e9d70){var _0x2134e7={},_0x215983={},_0x31cad2={'count':0x0,'rows':[]};var _0x4ec5b4=_[_0x6758('0x18')](db[_0x6758('0x19')][_0x6758('0x1a')],function(_0x41bc7d){return{'name':_0x41bc7d['fieldName'],'type':_0x41bc7d[_0x6758('0x1b')]['key']};});_0x215983[_0x6758('0x1c')]=_[_0x6758('0x18')](_0x4ec5b4,_0x6758('0x13'));_0x215983[_0x6758('0x1d')]=_[_0x6758('0x1e')](_0x962d0c['query']);_0x215983[_0x6758('0x1f')]=_[_0x6758('0x20')](_0x215983['model'],_0x215983[_0x6758('0x1d')]);_0x2134e7['attributes']=_[_0x6758('0x20')](_0x215983[_0x6758('0x1c')],qs[_0x6758('0x21')](_0x962d0c[_0x6758('0x1d')]['fields']));_0x2134e7[_0x6758('0x22')]=_0x2134e7[_0x6758('0x22')][_0x6758('0x23')]?_0x2134e7['attributes']:_0x215983[_0x6758('0x1c')];if(!_0x962d0c[_0x6758('0x1d')][_0x6758('0x24')](_0x6758('0x25'))){_0x2134e7[_0x6758('0xf')]=qs[_0x6758('0xf')](_0x962d0c[_0x6758('0x1d')][_0x6758('0xf')]);_0x2134e7[_0x6758('0xd')]=qs[_0x6758('0xd')](_0x962d0c['query']['offset']);}_0x2134e7[_0x6758('0x26')]=qs[_0x6758('0x27')](_0x962d0c[_0x6758('0x1d')][_0x6758('0x27')]);_0x2134e7[_0x6758('0x28')]=qs['filters'](_[_0x6758('0x29')](_0x962d0c['query'],_0x215983['filters']),_0x4ec5b4);if(_0x962d0c[_0x6758('0x1d')][_0x6758('0x2a')]){_0x2134e7['where']=_['merge'](_0x2134e7[_0x6758('0x28')],{'$or':_[_0x6758('0x18')](_0x4ec5b4,function(_0x26e07a){if(_0x26e07a[_0x6758('0x1b')]!==_0x6758('0x2b')){var _0x49327a={};_0x49327a[_0x26e07a[_0x6758('0x13')]]={'$like':'%'+_0x962d0c[_0x6758('0x1d')][_0x6758('0x2a')]+'%'};return _0x49327a;}})});}_0x2134e7=_[_0x6758('0x2c')]({},_0x2134e7,_0x962d0c[_0x6758('0x2d')]);var _0x9270cf={'where':_0x2134e7['where']};return db[_0x6758('0x19')][_0x6758('0x10')](_0x9270cf)[_0x6758('0x12')](function(_0x14fd97){_0x31cad2[_0x6758('0x10')]=_0x14fd97;if(_0x962d0c[_0x6758('0x1d')]['includeAll']){_0x2134e7[_0x6758('0x2e')]=[{'all':!![]}];}return db[_0x6758('0x19')][_0x6758('0x2f')](_0x2134e7);})[_0x6758('0x12')](function(_0x547863){_0x31cad2[_0x6758('0x30')]=_[_0x6758('0x18')](_0x547863,function(_0x47207c){if(_0x47207c[_0x6758('0x31')]==='MicrosoftAzure'){var _0x2ec7b9=encryptor[_0x6758('0x32')](_0x47207c[_0x6758('0x33')]);_0x47207c[_0x6758('0x33')]=maskClientSecret(_0x2ec7b9);}return _0x47207c;});return _0x31cad2;})[_0x6758('0x12')](respondWithFilteredResult(_0x1e9d70,_0x2134e7))[_0x6758('0x34')](handleError(_0x1e9d70,null));};exports['show']=function(_0x57eb7d,_0x368eb7){var _0x4499de={'raw':!![],'where':{'id':_0x57eb7d[_0x6758('0x35')]['id']}},_0x405ca5={};_0x405ca5['model']=_[_0x6758('0x1e')](db['CloudProvider'][_0x6758('0x1a')]);_0x405ca5[_0x6758('0x1d')]=_[_0x6758('0x1e')](_0x57eb7d[_0x6758('0x1d')]);_0x405ca5[_0x6758('0x1f')]=_[_0x6758('0x20')](_0x405ca5[_0x6758('0x1c')],_0x405ca5['query']);_0x4499de['attributes']=_[_0x6758('0x20')](_0x405ca5[_0x6758('0x1c')],qs[_0x6758('0x21')](_0x57eb7d[_0x6758('0x1d')]['fields']));_0x4499de[_0x6758('0x22')]=_0x4499de[_0x6758('0x22')]['length']?_0x4499de['attributes']:_0x405ca5[_0x6758('0x1c')];if(_0x57eb7d[_0x6758('0x1d')]['includeAll']){_0x4499de['include']=[{'all':!![]}];}_0x4499de=_['merge']({},_0x4499de,_0x57eb7d['options']);return db[_0x6758('0x19')][_0x6758('0x36')](_0x4499de)[_0x6758('0x12')](handleEntityNotFound(_0x368eb7,null))[_0x6758('0x12')](function(_0x2afbd4){if(_0x2afbd4[_0x6758('0x31')]===_0x6758('0x37')){var _0x46cc7a=encryptor[_0x6758('0x32')](_0x2afbd4[_0x6758('0x33')]);_0x2afbd4['data3']=maskClientSecret(_0x46cc7a);}return _0x2afbd4;})['then'](respondWithResult(_0x368eb7,null))['catch'](handleError(_0x368eb7,null));};exports[_0x6758('0x38')]=function(_0x1a5760,_0x4dea1f){if(!_0x1a5760[_0x6758('0x39')][_0x6758('0x13')])throw new Error(_0x6758('0x3a'));if(!_0x1a5760[_0x6758('0x39')][_0x6758('0x31')])throw new Error(_0x6758('0x3b'));var _0x41c0d6=db[_0x6758('0x19')][_0x6758('0x1a')]['service']['values'];if(!_0x41c0d6[_0x6758('0x3c')](_0x1a5760[_0x6758('0x39')][_0x6758('0x31')]))throw new Error(_0x6758('0x3d')+_0x41c0d6[_0x6758('0x3e')](',\x20'));if(_0x1a5760['body'][_0x6758('0x31')]==='MicrosoftAzure'&&_0x1a5760[_0x6758('0x39')]['data3']){_0x1a5760[_0x6758('0x39')]['data3']=encryptor['encryptString'](_0x1a5760[_0x6758('0x39')]['data3']);}return db[_0x6758('0x19')][_0x6758('0x38')](_0x1a5760['body'],{})[_0x6758('0x12')](respondWithResult(_0x4dea1f,0xc9))[_0x6758('0x34')](handleError(_0x4dea1f,null));};exports[_0x6758('0x3f')]=function(_0x252937,_0x3b5850){if(_0x252937[_0x6758('0x39')]['id']){delete _0x252937[_0x6758('0x39')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x252937[_0x6758('0x35')]['id']}})[_0x6758('0x12')](handleEntityNotFound(_0x3b5850,null))['then'](function(_0x4cdd76){if(_0x4cdd76[_0x6758('0x31')]===_0x6758('0x37')&&_0x252937[_0x6758('0x39')][_0x6758('0x33')]){_0x252937[_0x6758('0x39')][_0x6758('0x33')]=encryptor['encryptString'](_0x252937[_0x6758('0x39')]['data3']);}return _0x4cdd76;})[_0x6758('0x12')](saveUpdates(_0x252937['body'],null))['then'](respondWithResult(_0x3b5850,null))[_0x6758('0x34')](handleError(_0x3b5850,null));};exports[_0x6758('0x40')]=function(_0x41ac59,_0x1c66bc){return db['CloudProvider'][_0x6758('0x36')]({'where':{'id':_0x41ac59[_0x6758('0x35')]['id']}})['then'](handleEntityNotFound(_0x1c66bc,null))[_0x6758('0x12')](removeEntity(_0x1c66bc,null))[_0x6758('0x34')](handleError(_0x1c66bc,null));};exports[_0x6758('0x41')]=function(_0x25fbc6,_0x548ec6){return db[_0x6758('0x19')][_0x6758('0x42')]({'where':{'id':_0x25fbc6[_0x6758('0x35')]['id']},'raw':!![]})[_0x6758('0x12')](function(_0x3f3bac){if(!_0x3f3bac)return _0x548ec6[_0x6758('0x9')](0x194);return{'url':oauth[_0x6758('0x43')](_0x3f3bac,_0x25fbc6[_0x6758('0x44')]['id'])};})['then'](respondWithResult(_0x548ec6,null))[_0x6758('0x34')](handleError(_0x548ec6,null));};exports[_0x6758('0x45')]=function(_0x4dbece,_0xd9dbfd){var _0x560e16=_0x4dbece[_0x6758('0x39')];var _0x14c2f3;var _0x6a412e;if(_0x560e16[_0x6758('0x46')])throw _0x560e16;redis[_0x6758('0x47')](_0x560e16['state'])[_0x6758('0x12')](function(_0x1f451c){if(!_0x1f451c)throw new Error(_0x6758('0x48'));_0x14c2f3=JSON['parse'](_0x1f451c);var _0x3c6885=Buffer[_0x6758('0x49')](_0x560e16[_0x6758('0x4a')],_0x6758('0x4b'))[_0x6758('0x4c')]('ascii');_0x6a412e=JSON['parse'](_0x3c6885);if(!oauth[_0x6758('0x4d')](_0x560e16['id_token'],_0x14c2f3[_0x6758('0x4e')]))throw new Error(_0x6758('0x4f'));redis['del'](_0x560e16[_0x6758('0x4a')]);return oauth[_0x6758('0x50')](_0x560e16[_0x6758('0x51')],_0x14c2f3);})[_0x6758('0x12')](function(_0x29f9bc){_0x14c2f3[_0x6758('0x52')]=_0x29f9bc['access_token'];_0x14c2f3[_0x6758('0x53')]=_0x29f9bc[_0x6758('0x54')];return db[_0x6758('0x19')][_0x6758('0x3f')]({'data5':_0x14c2f3[_0x6758('0x52')],'data6':_0x14c2f3[_0x6758('0x53')]},{'where':{'id':_0x14c2f3['id']}});})[_0x6758('0x12')](function(){oauth[_0x6758('0x55')](_0x14c2f3);socket[_0x6758('0x56')](_0x6758('0x57'),{'id':_0x6a412e['id']});return;})['then'](respondWithStatusCode(_0xd9dbfd,null))[_0x6758('0x34')](function(_0x13d5e6){if(_0x6a412e){socket[_0x6758('0x56')](_0x6758('0x58'),{'id':_0x6a412e['id']});}if(!_0x14c2f3){logger[_0x6758('0x46')](_0x6758('0x59'),_0x13d5e6);return _0xd9dbfd[_0x6758('0xa')](0x1f4)['send'](_0x13d5e6[_0x6758('0x5a')]);}logger[_0x6758('0x46')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x14c2f3['id'],JSON[_0x6758('0x5b')](_0x13d5e6));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 55ff2f3..84f2a3a 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 _0xe93a=['rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5aebca,_0x47182f){var _0xe24952=function(_0x10a551){while(--_0x10a551){_0x5aebca['push'](_0x5aebca['shift']());}};_0xe24952(++_0x47182f);}(_0xe93a,0x1bf));var _0xae93=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xe93a[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xae93('0x0'));var util=require(_0xae93('0x1'));var logger=require(_0xae93('0x2'))(_0xae93('0x3'));var moment=require(_0xae93('0x4'));var BPromise=require(_0xae93('0x5'));var rp=require(_0xae93('0x6'));var fs=require('fs');var path=require(_0xae93('0x7'));var rimraf=require(_0xae93('0x8'));var config=require(_0xae93('0x9'));var attributes=require(_0xae93('0xa'));module['exports']=function(_0x3da3fa,_0x140903){return _0x3da3fa[_0xae93('0xb')]('CloudProvider',attributes,{'tableName':_0xae93('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x62ab=['exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes'];(function(_0x3d38ae,_0x51102b){var _0x3757ee=function(_0x22bac8){while(--_0x22bac8){_0x3d38ae['push'](_0x3d38ae['shift']());}};_0x3757ee(++_0x51102b);}(_0x62ab,0xd6));var _0xb62a=function(_0x2c8ab8,_0xb3663e){_0x2c8ab8=_0x2c8ab8-0x0;var _0x1bcbe3=_0x62ab[_0x2c8ab8];return _0x1bcbe3;};'use strict';var _=require(_0xb62a('0x0'));var util=require(_0xb62a('0x1'));var logger=require(_0xb62a('0x2'))(_0xb62a('0x3'));var moment=require(_0xb62a('0x4'));var BPromise=require(_0xb62a('0x5'));var rp=require(_0xb62a('0x6'));var fs=require('fs');var path=require(_0xb62a('0x7'));var rimraf=require(_0xb62a('0x8'));var config=require('../../config/environment');var attributes=require(_0xb62a('0x9'));module[_0xb62a('0xa')]=function(_0x48d711,_0x61ed74){return _0x48d711[_0xb62a('0xb')](_0xb62a('0xc'),attributes,{'tableName':_0xb62a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index b277adb..489848f 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 _0x6eed=['access_token','data6','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','exports','lodash','crypto','jsonwebtoken','request-promise','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','push','data7','/.default','join','Dynamics365','replace','data2','from','stringify','base64','hex','client_id','data1','response_type','response_mode','form_post','scope','prompt','login','key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','{TENANT_ID}'];(function(_0x5d7cc3,_0x4e5550){var _0xf00bb0=function(_0x4ac4ab){while(--_0x4ac4ab){_0x5d7cc3['push'](_0x5d7cc3['shift']());}};_0xf00bb0(++_0x4e5550);}(_0x6eed,0x17e));var _0xd6ee=function(_0x3fbca8,_0x2e2902){_0x3fbca8=_0x3fbca8-0x0;var _0x47e565=_0x6eed[_0x3fbca8];return _0x47e565;};'use strict';var _=require(_0xd6ee('0x0'));var crypto=require(_0xd6ee('0x1'));var jwt=require(_0xd6ee('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xd6ee('0x3'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0xd6ee('0x4'));var logger=require(_0xd6ee('0x5'))(_0xd6ee('0x6'));var schedule=require(_0xd6ee('0x7'));var db=require(_0xd6ee('0x8'))['db'];config[_0xd6ee('0x9')]=_['defaults'](config['redis'],{'host':_0xd6ee('0xa'),'port':0x18eb});var redis=new Redis(config[_0xd6ee('0x9')]);var MICROSOFT_AUTH_URL=_0xd6ee('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd6ee('0xc'),_0xd6ee('0xd'),'email',_0xd6ee('0xe'),_0xd6ee('0xf'),_0xd6ee('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xd6ee('0xc'),_0xd6ee('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xd6ee('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xd6ee('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x460702){var _0x2b4c60=_[_0xd6ee('0x13')](AZURE_AUTH_SCOPES[_0x460702[_0xd6ee('0x14')]]);if(_0x460702[_0xd6ee('0x14')]==='Dynamics365')_0x2b4c60[_0xd6ee('0x15')](_0x460702[_0xd6ee('0x16')]+_0xd6ee('0x17'));return _0x2b4c60[_0xd6ee('0x18')]('\x20');}function getAccessTokenScope(_0x35e0f1){if(_0x35e0f1[_0xd6ee('0x14')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x35e0f1[_0xd6ee('0x14')]===_0xd6ee('0x19'))return _0x35e0f1[_0xd6ee('0x16')]+_0xd6ee('0x17');}function generateMicrosoftAuthorizationUrl(_0x582fb4,_0x412e20){var _0x587e2f=MICROSOFT_AUTH_URL[_0xd6ee('0x1a')]('{TENANT_ID}',_0x582fb4[_0xd6ee('0x1b')]);var _0x2ed29c=['code','id_token'];var _0x4be323=Buffer[_0xd6ee('0x1c')](JSON[_0xd6ee('0x1d')]({'id':_0x412e20}))['toString'](_0xd6ee('0x1e'));var _0x2fd597=crypto['randomBytes'](0x10)['toString'](_0xd6ee('0x1f'));var _0x4760b3=getAuthorizationScopes(_0x582fb4);var _0x142d38=[{'key':_0xd6ee('0x20'),'value':_0x582fb4[_0xd6ee('0x21')]},{'key':_0xd6ee('0x22'),'value':encodeURIComponent(_0x2ed29c[_0xd6ee('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x582fb4['data4']},{'key':_0xd6ee('0x23'),'value':_0xd6ee('0x24')},{'key':_0xd6ee('0x25'),'value':encodeURIComponent(_0x4760b3)},{'key':'state','value':_0x4be323},{'key':'nonce','value':_0x2fd597},{'key':_0xd6ee('0x26'),'value':_0xd6ee('0x27')}];var _0x1db60f=_0x587e2f+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x142d38,function(_0x6b3175){return _0x6b3175[_0xd6ee('0x28')]+'='+_0x6b3175[_0xd6ee('0x29')];})[_0xd6ee('0x18')]('&');_0x582fb4[_0xd6ee('0x2a')]={'issuer':_0x587e2f[_0xd6ee('0x1a')](_0xd6ee('0x2b'),''),'audience':_0x582fb4[_0xd6ee('0x21')],'state':_0x4be323,'nonce':_0x2fd597};redis[_0xd6ee('0x2c')](_0x4be323,JSON[_0xd6ee('0x1d')](_0x582fb4));return _0x1db60f;}function isValidIdToken(_0xc3ac1,_0x48c522){try{var _0x1ffa1c=jwt['decode'](_0xc3ac1,{'complete':!![]});var _0x170b68=_0x1ffa1c[_0xd6ee('0x2d')];if(_0x170b68[_0xd6ee('0x2e')]!==_0x48c522[_0xd6ee('0x2f')])return![];if(_0x170b68[_0xd6ee('0x30')]!==_0x48c522[_0xd6ee('0x31')])return![];if(_0x170b68[_0xd6ee('0x32')]!==_0x48c522[_0xd6ee('0x32')])return![];if(moment()[_0xd6ee('0x33')](moment[_0xd6ee('0x34')](_0x170b68[_0xd6ee('0x35')])))return![];return!![];}catch(_0x121a08){throw _0x121a08;}}function refreshOauth2MicrosoftAccessToken(_0x2a2944){return Promise['resolve']()[_0xd6ee('0x36')](function(){if(_0x2a2944[_0xd6ee('0x37')])return _0x2a2944;return db[_0xd6ee('0x38')][_0xd6ee('0x39')]({'where':{'id':_0x2a2944['id']},'raw':!![]});})['then'](function(_0x542f55){var _0x5ab2a3={'grant_type':_0xd6ee('0x3a'),'refresh_token':_0x542f55['data6'],'scope':getAccessTokenScope(_0x542f55),'redirect_uri':_0x542f55['data4'],'client_id':_0x542f55[_0xd6ee('0x21')],'client_secret':encryptor[_0xd6ee('0x3b')](_0x542f55[_0xd6ee('0x37')])};var _0x563ac5={'method':_0xd6ee('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd6ee('0x3d'),_0x542f55[_0xd6ee('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5ab2a3,'json':!![]};return rp(_0x563ac5);})[_0xd6ee('0x36')](function(_0x4f0f65){_0x2a2944['data5']=_0x4f0f65[_0xd6ee('0x3e')];_0x2a2944[_0xd6ee('0x3f')]=_0x4f0f65['refresh_token'];return db['CloudProvider'][_0xd6ee('0x40')]({'data5':_0x2a2944[_0xd6ee('0x41')],'data6':_0x2a2944[_0xd6ee('0x3f')]},{'where':{'id':_0x2a2944['id']}});})['then'](function(){return _0x2a2944;})[_0xd6ee('0x42')](function(_0x56ab07){logger[_0xd6ee('0x43')](_0xd6ee('0x44'),_0x2a2944['id'],_0x56ab07);});}function getOauth2MicrosoftAccessToken(_0x3d4772,_0x20480c){var _0x1e7d6f={'grant_type':_0xd6ee('0x45'),'code':_0x3d4772,'scope':getAccessTokenScope(_0x20480c),'redirect_uri':_0x20480c['data4'],'client_id':_0x20480c[_0xd6ee('0x21')],'client_secret':encryptor[_0xd6ee('0x3b')](_0x20480c[_0xd6ee('0x37')])};var _0x28d969={'method':_0xd6ee('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xd6ee('0x1a')]('{TENANT_ID}',_0x20480c['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1e7d6f,'json':!![]};return rp(_0x28d969);}function startRefreshInterval(_0x2470f5){var _0x1a8551=schedule[_0xd6ee('0x46')];if(_0x1a8551[_0x2470f5['id']])clearInterval(_0x1a8551[_0x2470f5['id']]);_0x1a8551[_0x2470f5['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xd6ee('0x47')](this,{'id':_0x2470f5['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x1a8551;}function startAllRefreshIntervals(){return db[_0xd6ee('0x38')][_0xd6ee('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd6ee('0x36')](function(_0x4907f9){var _0x5e7372=_0x4907f9[_0xd6ee('0x13')](function(_0x3b7a3a){return refreshOauth2MicrosoftAccessToken(_0x3b7a3a)[_0xd6ee('0x36')](function(_0x2c7e50){startRefreshInterval(_0x2c7e50);});});return Promise['all'](_0x5e7372);})[_0xd6ee('0x42')](function(_0x1a07b4){var _0x98bf78=_0x1a07b4?util['inspect'](_0x1a07b4,{'showHidden':![],'depth':null}):'';logger[_0xd6ee('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x98bf78);});}module[_0xd6ee('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x8d6b=['https://outlook.office.com/POP.AccessAsUser.All','/authorize','type','Dynamics365','data7','/.default','join','Outlook365','{TENANT_ID}','data2','id_token','stringify','toString','hex','client_id','data1','response_type','redirect_uri','form_post','state','nonce','prompt','map','key','value','replace','set','iss','issuer','aud','audience','isAfter','unix','exp','data3','CloudProvider','findOne','then','data6','data4','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','bind','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All'];(function(_0x739bf5,_0x50002d){var _0x36510b=function(_0x210c62){while(--_0x210c62){_0x739bf5['push'](_0x739bf5['shift']());}};_0x36510b(++_0x50002d);}(_0x8d6b,0x1a4));var _0xb8d6=function(_0x3f9e3a,_0x524ef1){_0x3f9e3a=_0x3f9e3a-0x0;var _0xd1c420=_0x8d6b[_0x3f9e3a];return _0xd1c420;};'use strict';var _=require(_0xb8d6('0x0'));var crypto=require('crypto');var jwt=require(_0xb8d6('0x1'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0xb8d6('0x2'));var encryptor=require(_0xb8d6('0x3'));var config=require(_0xb8d6('0x4'));var logger=require(_0xb8d6('0x5'))(_0xb8d6('0x6'));var schedule=require(_0xb8d6('0x7'));var db=require(_0xb8d6('0x8'))['db'];config[_0xb8d6('0x9')]=_[_0xb8d6('0xa')](config[_0xb8d6('0x9')],{'host':_0xb8d6('0xb'),'port':0x18eb});var redis=new Redis(config[_0xb8d6('0x9')]);var MICROSOFT_AUTH_URL=_0xb8d6('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb8d6('0xd'),_0xb8d6('0xe'),_0xb8d6('0xf'),_0xb8d6('0x10'),_0xb8d6('0x11'),_0xb8d6('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xb8d6('0xd'),_0xb8d6('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xb8d6('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x431463){var _0x380cd5=_['map'](AZURE_AUTH_SCOPES[_0x431463[_0xb8d6('0x14')]]);if(_0x431463[_0xb8d6('0x14')]===_0xb8d6('0x15'))_0x380cd5['push'](_0x431463[_0xb8d6('0x16')]+_0xb8d6('0x17'));return _0x380cd5[_0xb8d6('0x18')]('\x20');}function getAccessTokenScope(_0x172434){if(_0x172434[_0xb8d6('0x14')]===_0xb8d6('0x19'))return _0xb8d6('0x11');if(_0x172434[_0xb8d6('0x14')]===_0xb8d6('0x15'))return _0x172434[_0xb8d6('0x16')]+_0xb8d6('0x17');}function generateMicrosoftAuthorizationUrl(_0x3bf2ec,_0x2963f1){var _0x42e286=MICROSOFT_AUTH_URL['replace'](_0xb8d6('0x1a'),_0x3bf2ec[_0xb8d6('0x1b')]);var _0x1f8739=['code',_0xb8d6('0x1c')];var _0x48e7e2=Buffer['from'](JSON[_0xb8d6('0x1d')]({'id':_0x2963f1}))['toString']('base64');var _0x4b38c7=crypto['randomBytes'](0x10)[_0xb8d6('0x1e')](_0xb8d6('0x1f'));var _0x278dd5=getAuthorizationScopes(_0x3bf2ec);var _0x1c643c=[{'key':_0xb8d6('0x20'),'value':_0x3bf2ec[_0xb8d6('0x21')]},{'key':_0xb8d6('0x22'),'value':encodeURIComponent(_0x1f8739[_0xb8d6('0x18')]('\x20'))},{'key':_0xb8d6('0x23'),'value':_0x3bf2ec['data4']},{'key':'response_mode','value':_0xb8d6('0x24')},{'key':'scope','value':encodeURIComponent(_0x278dd5)},{'key':_0xb8d6('0x25'),'value':_0x48e7e2},{'key':_0xb8d6('0x26'),'value':_0x4b38c7},{'key':_0xb8d6('0x27'),'value':'login'}];var _0x4bea7b=_0x42e286+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb8d6('0x28')](_0x1c643c,function(_0x17d751){return _0x17d751[_0xb8d6('0x29')]+'='+_0x17d751[_0xb8d6('0x2a')];})[_0xb8d6('0x18')]('&');_0x3bf2ec['oauth2Claims']={'issuer':_0x42e286[_0xb8d6('0x2b')]('oauth2/',''),'audience':_0x3bf2ec[_0xb8d6('0x21')],'state':_0x48e7e2,'nonce':_0x4b38c7};redis[_0xb8d6('0x2c')](_0x48e7e2,JSON[_0xb8d6('0x1d')](_0x3bf2ec));return _0x4bea7b;}function isValidIdToken(_0x88c3a1,_0x3080dc){try{var _0x56f77a=jwt['decode'](_0x88c3a1,{'complete':!![]});var _0x40e12b=_0x56f77a['payload'];if(_0x40e12b[_0xb8d6('0x2d')]!==_0x3080dc[_0xb8d6('0x2e')])return![];if(_0x40e12b[_0xb8d6('0x2f')]!==_0x3080dc[_0xb8d6('0x30')])return![];if(_0x40e12b['nonce']!==_0x3080dc[_0xb8d6('0x26')])return![];if(moment()[_0xb8d6('0x31')](moment[_0xb8d6('0x32')](_0x40e12b[_0xb8d6('0x33')])))return![];return!![];}catch(_0x51d7cb){throw _0x51d7cb;}}function refreshOauth2MicrosoftAccessToken(_0x3f3ee0){return Promise['resolve']()['then'](function(){if(_0x3f3ee0[_0xb8d6('0x34')])return _0x3f3ee0;return db[_0xb8d6('0x35')][_0xb8d6('0x36')]({'where':{'id':_0x3f3ee0['id']},'raw':!![]});})[_0xb8d6('0x37')](function(_0x2f16fc){var _0x5bebc1={'grant_type':'refresh_token','refresh_token':_0x2f16fc[_0xb8d6('0x38')],'scope':getAccessTokenScope(_0x2f16fc),'redirect_uri':_0x2f16fc[_0xb8d6('0x39')],'client_id':_0x2f16fc[_0xb8d6('0x21')],'client_secret':encryptor['decryptString'](_0x2f16fc[_0xb8d6('0x34')])};var _0x167dca={'method':_0xb8d6('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xb8d6('0x2b')](_0xb8d6('0x1a'),_0x2f16fc['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5bebc1,'json':!![]};return rp(_0x167dca);})[_0xb8d6('0x37')](function(_0x47e367){_0x3f3ee0[_0xb8d6('0x3b')]=_0x47e367[_0xb8d6('0x3c')];_0x3f3ee0[_0xb8d6('0x38')]=_0x47e367['refresh_token'];return db['CloudProvider'][_0xb8d6('0x3d')]({'data5':_0x3f3ee0['data5'],'data6':_0x3f3ee0[_0xb8d6('0x38')]},{'where':{'id':_0x3f3ee0['id']}});})[_0xb8d6('0x37')](function(){return _0x3f3ee0;})[_0xb8d6('0x3e')](function(_0x3e0e6e){logger[_0xb8d6('0x3f')](_0xb8d6('0x40'),_0x3f3ee0['id'],_0x3e0e6e);});}function getOauth2MicrosoftAccessToken(_0xd17c4,_0x199fd8){var _0x2e8dc2={'grant_type':_0xb8d6('0x41'),'code':_0xd17c4,'scope':getAccessTokenScope(_0x199fd8),'redirect_uri':_0x199fd8[_0xb8d6('0x39')],'client_id':_0x199fd8[_0xb8d6('0x21')],'client_secret':encryptor[_0xb8d6('0x42')](_0x199fd8[_0xb8d6('0x34')])};var _0xf341bc={'method':_0xb8d6('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xb8d6('0x2b')](_0xb8d6('0x1a'),_0x199fd8[_0xb8d6('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e8dc2,'json':!![]};return rp(_0xf341bc);}function startRefreshInterval(_0x56f827){var _0x310758=schedule['intervals'];if(_0x310758[_0x56f827['id']])clearInterval(_0x310758[_0x56f827['id']]);_0x310758[_0x56f827['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb8d6('0x43')](this,{'id':_0x56f827['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb8d6('0x44')]=_0x310758;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xb8d6('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x18aa20){var _0x4cb686=_0x18aa20[_0xb8d6('0x28')](function(_0x19f94d){return refreshOauth2MicrosoftAccessToken(_0x19f94d)[_0xb8d6('0x37')](function(_0x462641){startRefreshInterval(_0x462641);});});return Promise[_0xb8d6('0x46')](_0x4cb686);})[_0xb8d6('0x3e')](function(_0x3e6a1c){var _0x333195=_0x3e6a1c?util['inspect'](_0x3e6a1c,{'showHidden':![],'depth':null}):'';logger[_0xb8d6('0x3f')](_0xb8d6('0x47'),_0x333195);});}module[_0xb8d6('0x48')]={'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 21eda5c..6d4668a 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 _0xb4f8=['client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x45da0f,_0x370d35){var _0x3ac5ca=function(_0xd9b600){while(--_0xd9b600){_0x45da0f['push'](_0x45da0f['shift']());}};_0x3ac5ca(++_0x370d35);}(_0xb4f8,0x83));var _0x8b4f=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0xb4f8[_0x2962d5];return _0x273406;};'use strict';var _=require('lodash');var util=require(_0x8b4f('0x0'));var moment=require(_0x8b4f('0x1'));var BPromise=require(_0x8b4f('0x2'));var rs=require(_0x8b4f('0x3'));var fs=require('fs');var Redis=require(_0x8b4f('0x4'));var db=require(_0x8b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b4f('0x6'))('rpc');var config=require(_0x8b4f('0x7'));var jayson=require(_0x8b4f('0x8'));var client=jayson[_0x8b4f('0x9')][_0x8b4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eefde,_0x557bc0,_0x2dfe1c){return new BPromise(function(_0xa91c09,_0x40042b){return client['request'](_0x2eefde,_0x2dfe1c)[_0x8b4f('0xb')](function(_0x13d37a){logger[_0x8b4f('0xc')](_0x8b4f('0xd'),_0x557bc0,_0x8b4f('0xe'));logger['debug'](_0x8b4f('0xf'),_0x557bc0,_0x8b4f('0xe'),JSON['stringify'](_0x13d37a));if(_0x13d37a[_0x8b4f('0x10')]){if(_0x13d37a[_0x8b4f('0x10')]['code']===0x1f4){logger[_0x8b4f('0x10')](_0x8b4f('0xd'),_0x557bc0,_0x13d37a['error'][_0x8b4f('0x11')]);return _0x40042b(_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);}logger[_0x8b4f('0x10')]('CloudProvider,\x20%s,\x20%s',_0x557bc0,_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);return _0xa91c09(_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);}else{logger[_0x8b4f('0xc')](_0x8b4f('0xd'),_0x557bc0,'request\x20sent');_0xa91c09(_0x13d37a[_0x8b4f('0x12')][_0x8b4f('0x11')]);}})[_0x8b4f('0x13')](function(_0x1b4b9f){logger[_0x8b4f('0x10')](_0x8b4f('0xd'),_0x557bc0,_0x1b4b9f);_0x40042b(_0x1b4b9f);});});}
\ No newline at end of file
+var _0x6ac2=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6ac2,0x184));var _0x26ac=function(_0x34d0e2,_0x5af29d){_0x34d0e2=_0x34d0e2-0x0;var _0x47004f=_0x6ac2[_0x34d0e2];return _0x47004f;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 2f0fd77..7a07dc0 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x1261,0x144));var _0x1126=function(_0x32b79a,_0xd2538a){_0x32b79a=_0x32b79a-0x0;var _0x483450=_0x1261[_0x32b79a];return _0x483450;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x271fe0,_0x2b0c22){var _0x318b44=function(_0x7c8214){while(--_0x7c8214){_0x271fe0['push'](_0x271fe0['shift']());}};_0x318b44(++_0x2b0c22);}(_0xadb5,0xad));var _0x5adb=function(_0x4e17a8,_0x204391){_0x4e17a8=_0x4e17a8-0x0;var _0x4a53c2=_0xadb5[_0x4e17a8];return _0x4a53c2;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 0bc7d4b..0901a09 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 _0xab99=['STRING','sequelize'];(function(_0x5e27c9,_0x1fffd2){var _0x529849=function(_0x13a2f7){while(--_0x13a2f7){_0x5e27c9['push'](_0x5e27c9['shift']());}};_0x529849(++_0x1fffd2);}(_0xab99,0x1a7));var _0x9ab9=function(_0x228895,_0x16f857){_0x228895=_0x228895-0x0;var _0x40c252=_0xab99[_0x228895];return _0x40c252;};'use strict';var Sequelize=require(_0x9ab9('0x0'));module['exports']={'name':{'type':Sequelize[_0x9ab9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9ab9('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x9ab9('0x1')]},'phone':{'type':Sequelize[_0x9ab9('0x1')]},'fax':{'type':Sequelize[_0x9ab9('0x1')]},'type':{'type':Sequelize[_0x9ab9('0x1')]},'street':{'type':Sequelize[_0x9ab9('0x1')]},'postalCode':{'type':Sequelize[_0x9ab9('0x1')]},'city':{'type':Sequelize[_0x9ab9('0x1')]},'country':{'type':Sequelize[_0x9ab9('0x1')]},'email':{'type':Sequelize[_0x9ab9('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9ab9('0x1')]},'sStreet':{'type':Sequelize[_0x9ab9('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x9ab9('0x1')]},'sCountry':{'type':Sequelize[_0x9ab9('0x1')]},'description':{'type':Sequelize[_0x9ab9('0x1')]}};
\ No newline at end of file
+var _0x2aff=['STRING','name','exports'];(function(_0x265b59,_0x42b00e){var _0x5d81b9=function(_0x17445f){while(--_0x17445f){_0x265b59['push'](_0x265b59['shift']());}};_0x5d81b9(++_0x42b00e);}(_0x2aff,0x6b));var _0xf2af=function(_0x14adfc,_0x2f05fa){_0x14adfc=_0x14adfc-0x0;var _0x384191=_0x2aff[_0x14adfc];return _0x384191;};'use strict';var Sequelize=require('sequelize');module[_0xf2af('0x0')]={'name':{'type':Sequelize[_0xf2af('0x1')],'unique':_0xf2af('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf2af('0x1')]},'companyId':{'type':Sequelize[_0xf2af('0x1')]},'website':{'type':Sequelize[_0xf2af('0x1')]},'phone':{'type':Sequelize[_0xf2af('0x1')]},'fax':{'type':Sequelize[_0xf2af('0x1')]},'type':{'type':Sequelize[_0xf2af('0x1')]},'street':{'type':Sequelize[_0xf2af('0x1')]},'postalCode':{'type':Sequelize[_0xf2af('0x1')]},'city':{'type':Sequelize[_0xf2af('0x1')]},'country':{'type':Sequelize[_0xf2af('0x1')]},'email':{'type':Sequelize[_0xf2af('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf2af('0x1')]},'sStreet':{'type':Sequelize[_0xf2af('0x1')]},'sPostalCode':{'type':Sequelize[_0xf2af('0x1')]},'sCity':{'type':Sequelize[_0xf2af('0x1')]},'sCountry':{'type':Sequelize[_0xf2af('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 a81aef0..e0fe10f 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 _0x4697=['find','create','body','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','findOne','CmContact','rimraf','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','Companies','UserProfileResource','then','sendStatus','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x4697,0x1ed));var _0x7469=function(_0x24114d,_0x4606fc){_0x24114d=_0x24114d-0x0;var _0x21f1c7=_0x4697[_0x24114d];return _0x21f1c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7469('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7469('0x1'));var moment=require(_0x7469('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7469('0x3'));var util=require('util');var path=require(_0x7469('0x4'));var sox=require(_0x7469('0x5'));var csv=require('to-csv');var ejs=require(_0x7469('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7469('0x7'));var crypto=require(_0x7469('0x8'));var jsforce=require(_0x7469('0x9'));var deskjs=require(_0x7469('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7469('0xb'));var Redis=require(_0x7469('0xc'));var authService=require(_0x7469('0xd'));var qs=require(_0x7469('0xe'));var as=require(_0x7469('0xf'));var hardwareService=require(_0x7469('0x10'));var logger=require(_0x7469('0x11'))('api');var utils=require(_0x7469('0x12'));var config=require(_0x7469('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7469('0x14'))['db'];function respondWithStatusCode(_0xb72c09,_0x233fd0){_0x233fd0=_0x233fd0||0xcc;return function(_0x3fdd3f){if(_0x3fdd3f){return _0xb72c09['sendStatus'](_0x233fd0);}return _0xb72c09['status'](_0x233fd0)[_0x7469('0x15')]();};}function respondWithResult(_0x414513,_0x10e166){_0x10e166=_0x10e166||0xc8;return function(_0x27a9c8){if(_0x27a9c8){return _0x414513[_0x7469('0x16')](_0x10e166)[_0x7469('0x17')](_0x27a9c8);}};}function respondWithFilteredResult(_0x34050a,_0x542864){return function(_0x40ae7f){if(_0x40ae7f){var _0x1842f0=typeof _0x542864[_0x7469('0x18')]===_0x7469('0x19')&&typeof _0x542864['limit']==='undefined';var _0x5dd80b=_0x40ae7f[_0x7469('0x1a')];var _0x4b2fb1=_0x1842f0?0x0:_0x542864[_0x7469('0x18')];var _0x25549f=_0x1842f0?_0x40ae7f['count']:_0x542864[_0x7469('0x18')]+_0x542864[_0x7469('0x1b')];var _0x225c24;if(_0x25549f>=_0x5dd80b){_0x25549f=_0x5dd80b;_0x225c24=0xc8;}else{_0x225c24=0xce;}_0x34050a['status'](_0x225c24);return _0x34050a[_0x7469('0x1c')](_0x7469('0x1d'),_0x4b2fb1+'-'+_0x25549f+'/'+_0x5dd80b)[_0x7469('0x17')](_0x40ae7f);}return null;};}function patchUpdates(_0x44f813){return function(_0x3ad0fe){try{jsonpatch['apply'](_0x3ad0fe,_0x44f813,!![]);}catch(_0x51ba20){return BPromise[_0x7469('0x1e')](_0x51ba20);}return _0x3ad0fe[_0x7469('0x1f')]();};}function saveUpdates(_0x1a7058,_0x4d44ae){return function(_0x456b00){if(_0x456b00){return _0x456b00[_0x7469('0x20')](_0x1a7058)['then'](function(_0x55aefd){return _0x55aefd;});}return null;};}function removeEntity(_0x5add64,_0x3a0474){return function(_0x2bc8b1){if(_0x2bc8b1){return _0x2bc8b1[_0x7469('0x21')]()['then'](function(){var _0xeab407=_0x2bc8b1['get']({'plain':!![]});var _0x407777=_0x7469('0x22');return db[_0x7469('0x23')][_0x7469('0x21')]({'where':{'type':_0x407777,'resourceId':_0xeab407['id']}})[_0x7469('0x24')](function(){return _0x2bc8b1;});})[_0x7469('0x24')](function(){_0x5add64[_0x7469('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x361336,_0x1cff15){return function(_0x3222e0){if(!_0x3222e0){_0x361336[_0x7469('0x25')](0x194);}return _0x3222e0;};}function handleError(_0x3c7f37,_0x22c2c3){_0x22c2c3=_0x22c2c3||0x1f4;return function(_0x246799){logger['error'](_0x246799['stack']);if(_0x246799[_0x7469('0x26')]){delete _0x246799[_0x7469('0x26')];}_0x3c7f37[_0x7469('0x16')](_0x22c2c3)[_0x7469('0x27')](_0x246799);};}exports[_0x7469('0x28')]=function(_0x26cf9b,_0x3ecbc8){var _0x2ed1f5={},_0x2685be={},_0x377675={'count':0x0,'rows':[]};return db[_0x7469('0x29')][_0x7469('0x2a')]()[_0x7469('0x24')](function(_0x29eef6){_0x2685be[_0x7469('0x2b')]=_[_0x7469('0x2c')](_0x29eef6);_0x2685be['query']=_['keys'](_0x26cf9b[_0x7469('0x2d')]);_0x2685be[_0x7469('0x2e')]=_[_0x7469('0x2f')](_0x2685be['model'],_0x2685be[_0x7469('0x2d')]);_0x2ed1f5[_0x7469('0x30')]=_[_0x7469('0x2f')](_0x2685be[_0x7469('0x2b')],qs[_0x7469('0x31')](_0x26cf9b[_0x7469('0x2d')]['fields']));_0x2ed1f5[_0x7469('0x30')]=_0x2ed1f5[_0x7469('0x30')]['length']?_0x2ed1f5[_0x7469('0x30')]:_0x2685be[_0x7469('0x2b')];if(!_0x26cf9b[_0x7469('0x2d')][_0x7469('0x32')](_0x7469('0x33'))){_0x2ed1f5[_0x7469('0x1b')]=qs['limit'](_0x26cf9b[_0x7469('0x2d')][_0x7469('0x1b')]);_0x2ed1f5[_0x7469('0x18')]=qs['offset'](_0x26cf9b[_0x7469('0x2d')]['offset']);}_0x2ed1f5[_0x7469('0x34')]=qs[_0x7469('0x35')](_0x26cf9b['query'][_0x7469('0x35')]);_0x2ed1f5[_0x7469('0x36')]=qs[_0x7469('0x2e')](_['pick'](_0x26cf9b[_0x7469('0x2d')],_0x2685be[_0x7469('0x2e')]),_0x29eef6);if(_0x26cf9b[_0x7469('0x2d')]['filter']){_0x2ed1f5[_0x7469('0x36')]=_[_0x7469('0x37')](_0x2ed1f5[_0x7469('0x36')],{'$or':_[_0x7469('0x38')](_0x2ed1f5[_0x7469('0x30')],function(_0x2df343){var _0x852db0={};_0x852db0[_0x2df343]={'$like':'%'+_0x26cf9b[_0x7469('0x2d')][_0x7469('0x39')]+'%'};return _0x852db0;})});}_0x2ed1f5=_['merge']({},_0x2ed1f5,_0x26cf9b[_0x7469('0x3a')]);var _0x5f314f={'where':_0x2ed1f5[_0x7469('0x36')]};return db[_0x7469('0x29')]['count'](_0x5f314f)['then'](function(_0x343dfa){_0x377675[_0x7469('0x1a')]=_0x343dfa;if(_0x26cf9b['query'][_0x7469('0x3b')]){_0x2ed1f5[_0x7469('0x3c')]=[{'all':!![]}];}return db[_0x7469('0x29')][_0x7469('0x3d')](_0x2ed1f5);})[_0x7469('0x24')](function(_0x56a31c){_0x377675[_0x7469('0x3e')]=_0x56a31c;return _0x377675;})[_0x7469('0x24')](respondWithFilteredResult(_0x3ecbc8,_0x2ed1f5))[_0x7469('0x3f')](handleError(_0x3ecbc8,null));})['catch'](handleError(_0x3ecbc8,null));};exports['show']=function(_0x2240cf,_0x411671){var _0x367534={'raw':![],'where':{'id':_0x2240cf[_0x7469('0x40')]['id']}},_0x1aaeef={};_0x1aaeef[_0x7469('0x2b')]=_['keys'](db[_0x7469('0x29')][_0x7469('0x41')]);_0x1aaeef[_0x7469('0x2d')]=_[_0x7469('0x2c')](_0x2240cf[_0x7469('0x2d')]);_0x1aaeef[_0x7469('0x2e')]=_[_0x7469('0x2f')](_0x1aaeef['model'],_0x1aaeef['query']);_0x367534[_0x7469('0x30')]=_[_0x7469('0x2f')](_0x1aaeef[_0x7469('0x2b')],qs[_0x7469('0x31')](_0x2240cf['query'][_0x7469('0x31')]));_0x367534['attributes']=_0x367534[_0x7469('0x30')][_0x7469('0x42')]?_0x367534['attributes']:_0x1aaeef[_0x7469('0x2b')];if(_0x2240cf[_0x7469('0x2d')][_0x7469('0x3b')]){_0x367534[_0x7469('0x3c')]=[{'all':!![]}];}_0x367534=_[_0x7469('0x37')]({},_0x367534,_0x2240cf[_0x7469('0x3a')]);return db[_0x7469('0x29')][_0x7469('0x43')](_0x367534)[_0x7469('0x24')](handleEntityNotFound(_0x411671,null))[_0x7469('0x24')](respondWithResult(_0x411671,null))[_0x7469('0x3f')](handleError(_0x411671,null));};exports[_0x7469('0x44')]=function(_0x24b567,_0x192747){return db['CmCompany'][_0x7469('0x44')](_0x24b567[_0x7469('0x45')],{})[_0x7469('0x24')](function(_0x2b9b54){var _0xbde0ea=_0x24b567[_0x7469('0x46')]['get']({'plain':!![]});if(!_0xbde0ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbde0ea['role']===_0x7469('0x46')){var _0x369bcd=_0x2b9b54['get']({'plain':!![]});var _0x2a4d37=_0x7469('0x22');return db['UserProfileSection'][_0x7469('0x43')]({'where':{'name':_0x2a4d37,'userProfileId':_0xbde0ea[_0x7469('0x47')]},'raw':!![]})[_0x7469('0x24')](function(_0x5c1c35){if(_0x5c1c35&&_0x5c1c35[_0x7469('0x48')]===0x0){return db[_0x7469('0x23')]['create']({'name':_0x369bcd[_0x7469('0x26')],'resourceId':_0x369bcd['id'],'type':_0x5c1c35[_0x7469('0x26')],'sectionId':_0x5c1c35['id']},{})[_0x7469('0x24')](function(){return _0x2b9b54;});}else{return _0x2b9b54;}})['catch'](function(_0x640b06){logger[_0x7469('0x49')](_0x7469('0x4a'),_0x640b06);throw _0x640b06;});}return _0x2b9b54;})[_0x7469('0x24')](respondWithResult(_0x192747,0xc9))['catch'](handleError(_0x192747,null));};exports[_0x7469('0x20')]=function(_0x4d0804,_0x3e88ae){if(_0x4d0804['body']['id']){delete _0x4d0804[_0x7469('0x45')]['id'];}return db[_0x7469('0x29')][_0x7469('0x43')]({'where':{'id':_0x4d0804[_0x7469('0x40')]['id']}})[_0x7469('0x24')](handleEntityNotFound(_0x3e88ae,null))[_0x7469('0x24')](saveUpdates(_0x4d0804[_0x7469('0x45')],null))[_0x7469('0x24')](respondWithResult(_0x3e88ae,null))[_0x7469('0x3f')](handleError(_0x3e88ae,null));};exports['destroy']=function(_0x7b418,_0x552778){return db[_0x7469('0x29')][_0x7469('0x43')]({'where':{'id':_0x7b418[_0x7469('0x40')]['id']}})[_0x7469('0x24')](handleEntityNotFound(_0x552778,null))[_0x7469('0x24')](removeEntity(_0x552778,null))[_0x7469('0x3f')](handleError(_0x552778,null));};exports['describe']=function(_0x47e497,_0x6f9778){return db['CmCompany'][_0x7469('0x2a')]()[_0x7469('0x24')](respondWithResult(_0x6f9778,null))[_0x7469('0x3f')](handleError(_0x6f9778,null));};exports[_0x7469('0x4b')]=function(_0x28653e,_0x3a8be9,_0x5777cb){return db['CmContact'][_0x7469('0x43')]({'where':{'id':_0x28653e['params']['id']}})[_0x7469('0x24')](handleEntityNotFound(_0x3a8be9,null))[_0x7469('0x24')](function(_0x1157e0){if(_0x1157e0){return _0x1157e0['addContacts'](_0x28653e[_0x7469('0x45')][_0x7469('0x4c')],_['omit'](_0x28653e[_0x7469('0x45')],[_0x7469('0x4c'),'id'])||{});}})[_0x7469('0x24')](respondWithResult(_0x3a8be9,null))[_0x7469('0x3f')](handleError(_0x3a8be9,null));};exports[_0x7469('0x4d')]=function(_0x13d103,_0x583d48,_0x5f08a1){var _0x2caa6c={};var _0x3e98b7={};var _0x585631;var _0x1e71b7;return db[_0x7469('0x29')][_0x7469('0x4e')]({'where':{'id':_0x13d103[_0x7469('0x40')]['id']}})['then'](handleEntityNotFound(_0x583d48,null))['then'](function(_0x565a8d){if(_0x565a8d){_0x585631=_0x565a8d;_0x3e98b7[_0x7469('0x2b')]=_[_0x7469('0x2c')](db[_0x7469('0x4f')]['rawAttributes']);_0x3e98b7['query']=_[_0x7469('0x2c')](_0x13d103['query']);_0x3e98b7[_0x7469('0x2e')]=_[_0x7469('0x2f')](_0x3e98b7[_0x7469('0x2b')],_0x3e98b7[_0x7469('0x2d')]);_0x2caa6c['attributes']=_[_0x7469('0x2f')](_0x3e98b7[_0x7469('0x2b')],qs[_0x7469('0x31')](_0x13d103[_0x7469('0x2d')][_0x7469('0x31')]));_0x2caa6c['attributes']=_0x2caa6c[_0x7469('0x30')][_0x7469('0x42')]?_0x2caa6c['attributes']:_0x3e98b7[_0x7469('0x2b')];_0x2caa6c[_0x7469('0x34')]=qs[_0x7469('0x35')](_0x13d103[_0x7469('0x2d')][_0x7469('0x35')]);_0x2caa6c[_0x7469('0x36')]=qs[_0x7469('0x2e')](_['pick'](_0x13d103[_0x7469('0x2d')],_0x3e98b7['filters']));if(_0x13d103[_0x7469('0x2d')][_0x7469('0x39')]){_0x2caa6c[_0x7469('0x36')]=_[_0x7469('0x37')](_0x2caa6c[_0x7469('0x36')],{'$or':_[_0x7469('0x38')](_0x2caa6c['attributes'],function(_0x3f2ef8){var _0xdbb423={};_0xdbb423[_0x3f2ef8]={'$like':'%'+_0x13d103[_0x7469('0x2d')][_0x7469('0x39')]+'%'};return _0xdbb423;})});}_0x2caa6c=_[_0x7469('0x37')]({},_0x2caa6c,_0x13d103[_0x7469('0x3a')]);return _0x585631[_0x7469('0x4d')](_0x2caa6c);}})[_0x7469('0x24')](function(_0x58bb3c){if(_0x58bb3c){_0x1e71b7=_0x58bb3c[_0x7469('0x42')];if(!_0x13d103[_0x7469('0x2d')]['hasOwnProperty'](_0x7469('0x33'))){_0x2caa6c[_0x7469('0x1b')]=qs['limit'](_0x13d103[_0x7469('0x2d')][_0x7469('0x1b')]);_0x2caa6c[_0x7469('0x18')]=qs[_0x7469('0x18')](_0x13d103[_0x7469('0x2d')][_0x7469('0x18')]);}return _0x585631[_0x7469('0x4d')](_0x2caa6c);}})['then'](function(_0x2d7519){if(_0x2d7519){return _0x2d7519?{'count':_0x1e71b7,'rows':_0x2d7519}:null;}})[_0x7469('0x24')](respondWithResult(_0x583d48,null))[_0x7469('0x3f')](handleError(_0x583d48,null));};
\ No newline at end of file
+var _0xd245=['length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields'];(function(_0x3de6ad,_0x56ddd2){var _0x5c7ff3=function(_0x2591c5){while(--_0x2591c5){_0x3de6ad['push'](_0x3de6ad['shift']());}};_0x5c7ff3(++_0x56ddd2);}(_0xd245,0x77));var _0x5d24=function(_0x1709e7,_0x2ced21){_0x1709e7=_0x1709e7-0x0;var _0x402819=_0xd245[_0x1709e7];return _0x402819;};'use strict';var emlformat=require(_0x5d24('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5d24('0x1'));var rp=require(_0x5d24('0x2'));var moment=require('moment');var BPromise=require(_0x5d24('0x3'));var Mustache=require('mustache');var util=require(_0x5d24('0x4'));var path=require(_0x5d24('0x5'));var sox=require('sox');var csv=require(_0x5d24('0x6'));var ejs=require(_0x5d24('0x7'));var fs=require('fs');var fs_extra=require(_0x5d24('0x8'));var _=require(_0x5d24('0x9'));var squel=require(_0x5d24('0xa'));var crypto=require(_0x5d24('0xb'));var jsforce=require(_0x5d24('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d24('0xd'));var Papa=require('papaparse');var Redis=require(_0x5d24('0xe'));var authService=require(_0x5d24('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5d24('0x10'));var hardwareService=require(_0x5d24('0x11'));var logger=require(_0x5d24('0x12'))(_0x5d24('0x13'));var utils=require(_0x5d24('0x14'));var config=require(_0x5d24('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d24('0x16'))['db'];function respondWithStatusCode(_0x3da550,_0x2dc999){_0x2dc999=_0x2dc999||0xcc;return function(_0x5c272e){if(_0x5c272e){return _0x3da550['sendStatus'](_0x2dc999);}return _0x3da550['status'](_0x2dc999)[_0x5d24('0x17')]();};}function respondWithResult(_0xb0ee71,_0x94fbde){_0x94fbde=_0x94fbde||0xc8;return function(_0x2b4dde){if(_0x2b4dde){return _0xb0ee71[_0x5d24('0x18')](_0x94fbde)[_0x5d24('0x19')](_0x2b4dde);}};}function respondWithFilteredResult(_0x39109b,_0x2cf044){return function(_0x54a18c){if(_0x54a18c){var _0x64fd1e=typeof _0x2cf044['offset']===_0x5d24('0x1a')&&typeof _0x2cf044['limit']===_0x5d24('0x1a');var _0x44cb4a=_0x54a18c[_0x5d24('0x1b')];var _0x5cf1e8=_0x64fd1e?0x0:_0x2cf044[_0x5d24('0x1c')];var _0x10a9ae=_0x64fd1e?_0x54a18c[_0x5d24('0x1b')]:_0x2cf044[_0x5d24('0x1c')]+_0x2cf044['limit'];var _0x448569;if(_0x10a9ae>=_0x44cb4a){_0x10a9ae=_0x44cb4a;_0x448569=0xc8;}else{_0x448569=0xce;}_0x39109b[_0x5d24('0x18')](_0x448569);return _0x39109b['set'](_0x5d24('0x1d'),_0x5cf1e8+'-'+_0x10a9ae+'/'+_0x44cb4a)['json'](_0x54a18c);}return null;};}function patchUpdates(_0x52605a){return function(_0x2d6b1f){try{jsonpatch[_0x5d24('0x1e')](_0x2d6b1f,_0x52605a,!![]);}catch(_0x4d1690){return BPromise[_0x5d24('0x1f')](_0x4d1690);}return _0x2d6b1f[_0x5d24('0x20')]();};}function saveUpdates(_0x2388aa,_0x5e41ea){return function(_0x40e116){if(_0x40e116){return _0x40e116[_0x5d24('0x21')](_0x2388aa)[_0x5d24('0x22')](function(_0x2eb778){return _0x2eb778;});}return null;};}function removeEntity(_0x3d9c4d,_0x139d35){return function(_0x5873e2){if(_0x5873e2){return _0x5873e2['destroy']()['then'](function(){var _0x889391=_0x5873e2['get']({'plain':!![]});var _0x4b5964='Companies';return db[_0x5d24('0x23')][_0x5d24('0x24')]({'where':{'type':_0x4b5964,'resourceId':_0x889391['id']}})[_0x5d24('0x22')](function(){return _0x5873e2;});})[_0x5d24('0x22')](function(){_0x3d9c4d[_0x5d24('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcf3fc1,_0x1652cd){return function(_0x9c4f2b){if(!_0x9c4f2b){_0xcf3fc1[_0x5d24('0x25')](0x194);}return _0x9c4f2b;};}function handleError(_0x2b8b20,_0x2488bd){_0x2488bd=_0x2488bd||0x1f4;return function(_0x134c95){logger[_0x5d24('0x26')](_0x134c95['stack']);if(_0x134c95[_0x5d24('0x27')]){delete _0x134c95[_0x5d24('0x27')];}_0x2b8b20[_0x5d24('0x18')](_0x2488bd)[_0x5d24('0x28')](_0x134c95);};}exports[_0x5d24('0x29')]=function(_0x38b722,_0x4190eb){var _0x48d6fc={},_0x116eaa={},_0x28f80a={'count':0x0,'rows':[]};return db[_0x5d24('0x2a')][_0x5d24('0x2b')]()[_0x5d24('0x22')](function(_0x505918){_0x116eaa[_0x5d24('0x2c')]=_[_0x5d24('0x2d')](_0x505918);_0x116eaa['query']=_['keys'](_0x38b722[_0x5d24('0x2e')]);_0x116eaa[_0x5d24('0x2f')]=_[_0x5d24('0x30')](_0x116eaa['model'],_0x116eaa[_0x5d24('0x2e')]);_0x48d6fc[_0x5d24('0x31')]=_[_0x5d24('0x30')](_0x116eaa['model'],qs[_0x5d24('0x32')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x48d6fc['attributes']=_0x48d6fc[_0x5d24('0x31')][_0x5d24('0x33')]?_0x48d6fc[_0x5d24('0x31')]:_0x116eaa[_0x5d24('0x2c')];if(!_0x38b722[_0x5d24('0x2e')][_0x5d24('0x34')](_0x5d24('0x35'))){_0x48d6fc['limit']=qs[_0x5d24('0x36')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x36')]);_0x48d6fc[_0x5d24('0x1c')]=qs[_0x5d24('0x1c')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x1c')]);}_0x48d6fc[_0x5d24('0x37')]=qs[_0x5d24('0x38')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x38')]);_0x48d6fc[_0x5d24('0x39')]=qs[_0x5d24('0x2f')](_['pick'](_0x38b722[_0x5d24('0x2e')],_0x116eaa[_0x5d24('0x2f')]),_0x505918);if(_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3a')]){_0x48d6fc[_0x5d24('0x39')]=_['merge'](_0x48d6fc[_0x5d24('0x39')],{'$or':_[_0x5d24('0x3b')](_0x48d6fc[_0x5d24('0x31')],function(_0x15ca3b){var _0x149938={};_0x149938[_0x15ca3b]={'$like':'%'+_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3a')]+'%'};return _0x149938;})});}_0x48d6fc=_[_0x5d24('0x3c')]({},_0x48d6fc,_0x38b722[_0x5d24('0x3d')]);var _0x56bc01={'where':_0x48d6fc[_0x5d24('0x39')]};return db[_0x5d24('0x2a')][_0x5d24('0x1b')](_0x56bc01)['then'](function(_0x39ca5c){_0x28f80a['count']=_0x39ca5c;if(_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3e')]){_0x48d6fc[_0x5d24('0x3f')]=[{'all':!![]}];}return db[_0x5d24('0x2a')][_0x5d24('0x40')](_0x48d6fc);})[_0x5d24('0x22')](function(_0x35b446){_0x28f80a['rows']=_0x35b446;return _0x28f80a;})[_0x5d24('0x22')](respondWithFilteredResult(_0x4190eb,_0x48d6fc))['catch'](handleError(_0x4190eb,null));})[_0x5d24('0x41')](handleError(_0x4190eb,null));};exports[_0x5d24('0x42')]=function(_0x382e75,_0x461c23){var _0x1905ee={'raw':![],'where':{'id':_0x382e75[_0x5d24('0x43')]['id']}},_0x1fc4fd={};_0x1fc4fd[_0x5d24('0x2c')]=_[_0x5d24('0x2d')](db[_0x5d24('0x2a')][_0x5d24('0x44')]);_0x1fc4fd['query']=_[_0x5d24('0x2d')](_0x382e75[_0x5d24('0x2e')]);_0x1fc4fd['filters']=_[_0x5d24('0x30')](_0x1fc4fd[_0x5d24('0x2c')],_0x1fc4fd[_0x5d24('0x2e')]);_0x1905ee[_0x5d24('0x31')]=_['intersection'](_0x1fc4fd[_0x5d24('0x2c')],qs[_0x5d24('0x32')](_0x382e75[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x1905ee['attributes']=_0x1905ee[_0x5d24('0x31')][_0x5d24('0x33')]?_0x1905ee[_0x5d24('0x31')]:_0x1fc4fd[_0x5d24('0x2c')];if(_0x382e75[_0x5d24('0x2e')]['includeAll']){_0x1905ee['include']=[{'all':!![]}];}_0x1905ee=_[_0x5d24('0x3c')]({},_0x1905ee,_0x382e75[_0x5d24('0x3d')]);return db['CmCompany'][_0x5d24('0x45')](_0x1905ee)[_0x5d24('0x22')](handleEntityNotFound(_0x461c23,null))[_0x5d24('0x22')](respondWithResult(_0x461c23,null))['catch'](handleError(_0x461c23,null));};exports[_0x5d24('0x46')]=function(_0x5a4740,_0x44bf85){return db[_0x5d24('0x2a')]['create'](_0x5a4740[_0x5d24('0x47')],{})['then'](function(_0x21f322){var _0x226913=_0x5a4740['user'][_0x5d24('0x48')]({'plain':!![]});if(!_0x226913)throw new Error(_0x5d24('0x49'));if(_0x226913[_0x5d24('0x4a')]===_0x5d24('0x4b')){var _0x3e4eab=_0x21f322[_0x5d24('0x48')]({'plain':!![]});var _0x58e987='Companies';return db[_0x5d24('0x4c')][_0x5d24('0x45')]({'where':{'name':_0x58e987,'userProfileId':_0x226913['userProfileId']},'raw':!![]})[_0x5d24('0x22')](function(_0x5c368b){if(_0x5c368b&&_0x5c368b[_0x5d24('0x4d')]===0x0){return db[_0x5d24('0x23')][_0x5d24('0x46')]({'name':_0x3e4eab[_0x5d24('0x27')],'resourceId':_0x3e4eab['id'],'type':_0x5c368b[_0x5d24('0x27')],'sectionId':_0x5c368b['id']},{})['then'](function(){return _0x21f322;});}else{return _0x21f322;}})[_0x5d24('0x41')](function(_0x3b1c77){logger[_0x5d24('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b1c77);throw _0x3b1c77;});}return _0x21f322;})[_0x5d24('0x22')](respondWithResult(_0x44bf85,0xc9))[_0x5d24('0x41')](handleError(_0x44bf85,null));};exports['update']=function(_0x82aa80,_0x1d0501){if(_0x82aa80[_0x5d24('0x47')]['id']){delete _0x82aa80[_0x5d24('0x47')]['id'];}return db['CmCompany'][_0x5d24('0x45')]({'where':{'id':_0x82aa80[_0x5d24('0x43')]['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x1d0501,null))[_0x5d24('0x22')](saveUpdates(_0x82aa80[_0x5d24('0x47')],null))[_0x5d24('0x22')](respondWithResult(_0x1d0501,null))[_0x5d24('0x41')](handleError(_0x1d0501,null));};exports['destroy']=function(_0x2e5444,_0x229a4d){return db['CmCompany'][_0x5d24('0x45')]({'where':{'id':_0x2e5444['params']['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x229a4d,null))[_0x5d24('0x22')](removeEntity(_0x229a4d,null))[_0x5d24('0x41')](handleError(_0x229a4d,null));};exports[_0x5d24('0x2b')]=function(_0x2f7d73,_0x23dedc){return db['CmCompany'][_0x5d24('0x2b')]()[_0x5d24('0x22')](respondWithResult(_0x23dedc,null))[_0x5d24('0x41')](handleError(_0x23dedc,null));};exports[_0x5d24('0x4e')]=function(_0x129e6a,_0x1ad52f,_0x4b283f){return db[_0x5d24('0x4f')][_0x5d24('0x45')]({'where':{'id':_0x129e6a['params']['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x1ad52f,null))[_0x5d24('0x22')](function(_0x102a30){if(_0x102a30){return _0x102a30['addContacts'](_0x129e6a[_0x5d24('0x47')][_0x5d24('0x50')],_[_0x5d24('0x51')](_0x129e6a[_0x5d24('0x47')],[_0x5d24('0x50'),'id'])||{});}})[_0x5d24('0x22')](respondWithResult(_0x1ad52f,null))[_0x5d24('0x41')](handleError(_0x1ad52f,null));};exports[_0x5d24('0x52')]=function(_0x17e55b,_0x268b22,_0xf57e1d){var _0x582034={};var _0x55e221={};var _0x41bdbd;var _0x1a5a94;return db[_0x5d24('0x2a')][_0x5d24('0x53')]({'where':{'id':_0x17e55b[_0x5d24('0x43')]['id']}})['then'](handleEntityNotFound(_0x268b22,null))[_0x5d24('0x22')](function(_0x246304){if(_0x246304){_0x41bdbd=_0x246304;_0x55e221[_0x5d24('0x2c')]=_['keys'](db['CmContact'][_0x5d24('0x44')]);_0x55e221[_0x5d24('0x2e')]=_[_0x5d24('0x2d')](_0x17e55b[_0x5d24('0x2e')]);_0x55e221['filters']=_[_0x5d24('0x30')](_0x55e221[_0x5d24('0x2c')],_0x55e221[_0x5d24('0x2e')]);_0x582034[_0x5d24('0x31')]=_[_0x5d24('0x30')](_0x55e221['model'],qs[_0x5d24('0x32')](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x582034[_0x5d24('0x31')]=_0x582034[_0x5d24('0x31')][_0x5d24('0x33')]?_0x582034[_0x5d24('0x31')]:_0x55e221[_0x5d24('0x2c')];_0x582034[_0x5d24('0x37')]=qs[_0x5d24('0x38')](_0x17e55b[_0x5d24('0x2e')]['sort']);_0x582034['where']=qs[_0x5d24('0x2f')](_[_0x5d24('0x54')](_0x17e55b['query'],_0x55e221['filters']));if(_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x3a')]){_0x582034[_0x5d24('0x39')]=_[_0x5d24('0x3c')](_0x582034[_0x5d24('0x39')],{'$or':_['map'](_0x582034[_0x5d24('0x31')],function(_0x4f90fd){var _0x2d8dfd={};_0x2d8dfd[_0x4f90fd]={'$like':'%'+_0x17e55b['query']['filter']+'%'};return _0x2d8dfd;})});}_0x582034=_[_0x5d24('0x3c')]({},_0x582034,_0x17e55b[_0x5d24('0x3d')]);return _0x41bdbd[_0x5d24('0x52')](_0x582034);}})['then'](function(_0x2617e4){if(_0x2617e4){_0x1a5a94=_0x2617e4[_0x5d24('0x33')];if(!_0x17e55b[_0x5d24('0x2e')]['hasOwnProperty'](_0x5d24('0x35'))){_0x582034[_0x5d24('0x36')]=qs['limit'](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x36')]);_0x582034[_0x5d24('0x1c')]=qs['offset'](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x1c')]);}return _0x41bdbd[_0x5d24('0x52')](_0x582034);}})['then'](function(_0x2afe8f){if(_0x2afe8f){return _0x2afe8f?{'count':_0x1a5a94,'rows':_0x2afe8f}:null;}})[_0x5d24('0x22')](respondWithResult(_0x268b22,null))[_0x5d24('0x41')](handleError(_0x268b22,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index b207ecc..5ef59f5 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 _0xe238=['../../config/logger','moment','path','rimraf','./cmCompany.attributes','define','cm_companies'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe238,0xbd));var _0x8e23=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe238[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8e23('0x0'))('api');var moment=require(_0x8e23('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e23('0x2'));var rimraf=require(_0x8e23('0x3'));var config=require('../../config/environment');var attributes=require(_0x8e23('0x4'));module['exports']=function(_0x3104f6,_0x29b312){return _0x3104f6[_0x8e23('0x5')]('CmCompany',attributes,{'tableName':_0x8e23('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1db5=['cm_companies','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x5f2ece,_0x54639e){var _0x3a4986=function(_0xcfbff0){while(--_0xcfbff0){_0x5f2ece['push'](_0x5f2ece['shift']());}};_0x3a4986(++_0x54639e);}(_0x1db5,0x91));var _0x51db=function(_0x9bbc39,_0x19d669){_0x9bbc39=_0x9bbc39-0x0;var _0xdbc706=_0x1db5[_0x9bbc39];return _0xdbc706;};'use strict';var _=require(_0x51db('0x0'));var util=require('util');var logger=require(_0x51db('0x1'))('api');var moment=require(_0x51db('0x2'));var BPromise=require(_0x51db('0x3'));var rp=require(_0x51db('0x4'));var fs=require('fs');var path=require(_0x51db('0x5'));var rimraf=require('rimraf');var config=require(_0x51db('0x6'));var attributes=require(_0x51db('0x7'));module[_0x51db('0x8')]=function(_0x16d5d1,_0xd7ac2){return _0x16d5d1[_0x51db('0x9')](_0x51db('0xa'),attributes,{'tableName':_0x51db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index a77053f..d78acec 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 _0x4a00=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','then','info'];(function(_0x3576c0,_0x196351){var _0x310e7d=function(_0x41c25e){while(--_0x41c25e){_0x3576c0['push'](_0x3576c0['shift']());}};_0x310e7d(++_0x196351);}(_0x4a00,0x1c3));var _0x04a0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4a00[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x04a0('0x0'));var moment=require(_0x04a0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04a0('0x2'))['db'];var utils=require(_0x04a0('0x3'));var logger=require(_0x04a0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x04a0('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39c87b,_0xacae57,_0x53ef10){return new BPromise(function(_0x43ac8a,_0xc1c197){return client['request'](_0x39c87b,_0x53ef10)[_0x04a0('0x6')](function(_0x294d8e){logger[_0x04a0('0x7')](_0x04a0('0x8'),_0xacae57,_0x04a0('0x9'));logger[_0x04a0('0xa')]('CmCompany,\x20%s,\x20%s,\x20%s',_0xacae57,_0x04a0('0x9'),JSON[_0x04a0('0xb')](_0x294d8e));if(_0x294d8e[_0x04a0('0xc')]){if(_0x294d8e['error'][_0x04a0('0xd')]===0x1f4){logger[_0x04a0('0xc')](_0x04a0('0x8'),_0xacae57,_0x294d8e['error'][_0x04a0('0xe')]);return _0xc1c197(_0x294d8e[_0x04a0('0xc')][_0x04a0('0xe')]);}logger[_0x04a0('0xc')](_0x04a0('0x8'),_0xacae57,_0x294d8e[_0x04a0('0xc')][_0x04a0('0xe')]);return _0x43ac8a(_0x294d8e[_0x04a0('0xc')][_0x04a0('0xe')]);}else{logger[_0x04a0('0x7')](_0x04a0('0x8'),_0xacae57,_0x04a0('0x9'));_0x43ac8a(_0x294d8e[_0x04a0('0xf')][_0x04a0('0xe')]);}})[_0x04a0('0x10')](function(_0x1a4b0e){logger[_0x04a0('0xc')](_0x04a0('0x8'),_0xacae57,_0x1a4b0e);_0xc1c197(_0x1a4b0e);});});}
\ No newline at end of file
+var _0xd37d=['../../config/utils','rpc','jayson/promise','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x564242,_0x4159f7){var _0x2906fb=function(_0xed2acc){while(--_0xed2acc){_0x564242['push'](_0x564242['shift']());}};_0x2906fb(++_0x4159f7);}(_0xd37d,0xb6));var _0xdd37=function(_0x33e864,_0x2d8439){_0x33e864=_0x33e864-0x0;var _0x1787d7=_0xd37d[_0x33e864];return _0x1787d7;};'use strict';var _=require(_0xdd37('0x0'));var util=require(_0xdd37('0x1'));var moment=require(_0xdd37('0x2'));var BPromise=require(_0xdd37('0x3'));var rs=require(_0xdd37('0x4'));var fs=require('fs');var Redis=require(_0xdd37('0x5'));var db=require(_0xdd37('0x6'))['db'];var utils=require(_0xdd37('0x7'));var logger=require('../../config/logger')(_0xdd37('0x8'));var config=require('../../config/environment');var jayson=require(_0xdd37('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47c6d1,_0x1ff1de,_0x538515){return new BPromise(function(_0x252a38,_0x385641){return client['request'](_0x47c6d1,_0x538515)[_0xdd37('0xa')](function(_0x27c481){logger[_0xdd37('0xb')](_0xdd37('0xc'),_0x1ff1de,_0xdd37('0xd'));logger['debug'](_0xdd37('0xe'),_0x1ff1de,_0xdd37('0xd'),JSON[_0xdd37('0xf')](_0x27c481));if(_0x27c481['error']){if(_0x27c481[_0xdd37('0x10')][_0xdd37('0x11')]===0x1f4){logger[_0xdd37('0x10')](_0xdd37('0xc'),_0x1ff1de,_0x27c481[_0xdd37('0x10')][_0xdd37('0x12')]);return _0x385641(_0x27c481[_0xdd37('0x10')]['message']);}logger[_0xdd37('0x10')](_0xdd37('0xc'),_0x1ff1de,_0x27c481[_0xdd37('0x10')][_0xdd37('0x12')]);return _0x252a38(_0x27c481[_0xdd37('0x10')]['message']);}else{logger[_0xdd37('0xb')](_0xdd37('0xc'),_0x1ff1de,_0xdd37('0xd'));_0x252a38(_0x27c481[_0xdd37('0x13')]['message']);}})[_0xdd37('0x14')](function(_0x58c586){logger['error'](_0xdd37('0xc'),_0x1ff1de,_0x58c586);_0x385641(_0x58c586);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index e08b721..d7b650f 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 _0x7ffc=['../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x29b34c,_0x3aebc8){var _0x595b12=function(_0x58d9bc){while(--_0x58d9bc){_0x29b34c['push'](_0x29b34c['shift']());}};_0x595b12(++_0x3aebc8);}(_0x7ffc,0x144));var _0xc7ff=function(_0xcdd749,_0x19f007){_0xcdd749=_0xcdd749-0x0;var _0xa16c06=_0x7ffc[_0xcdd749];return _0xa16c06;};'use strict';var multer=require(_0xc7ff('0x0'));var util=require(_0xc7ff('0x1'));var path=require(_0xc7ff('0x2'));var timeout=require(_0xc7ff('0x3'));var express=require(_0xc7ff('0x4'));var router=express[_0xc7ff('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc7ff('0x6'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0xc7ff('0x7')](),controller[_0xc7ff('0x8')]);router[_0xc7ff('0x9')](_0xc7ff('0xa'),auth[_0xc7ff('0x7')](),controller[_0xc7ff('0xb')]);router[_0xc7ff('0x9')](_0xc7ff('0xc'),auth['isAuthenticated'](),controller[_0xc7ff('0xd')]);router[_0xc7ff('0x9')](_0xc7ff('0xe'),auth[_0xc7ff('0x7')](),controller[_0xc7ff('0xf')]);router['post']('/',auth[_0xc7ff('0x7')](),controller[_0xc7ff('0x10')]);router[_0xc7ff('0x11')](_0xc7ff('0xe'),auth['isAuthenticated'](),controller['addContacts']);router[_0xc7ff('0x12')](_0xc7ff('0xc'),auth['isAuthenticated'](),controller[_0xc7ff('0x13')]);router[_0xc7ff('0x14')](_0xc7ff('0xc'),auth[_0xc7ff('0x7')](),controller['destroy']);module[_0xc7ff('0x15')]=router;
\ No newline at end of file
+var _0x6829=['describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6829,0xf3));var _0x9682=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6829[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var path=require(_0x9682('0x2'));var timeout=require(_0x9682('0x3'));var express=require(_0x9682('0x4'));var router=express[_0x9682('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9682('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x9682('0x7')]('/',auth[_0x9682('0x8')](),controller['index']);router[_0x9682('0x7')]('/describe',auth[_0x9682('0x8')](),controller[_0x9682('0x9')]);router[_0x9682('0x7')]('/:id',auth[_0x9682('0x8')](),controller[_0x9682('0xa')]);router[_0x9682('0x7')](_0x9682('0xb'),auth[_0x9682('0x8')](),controller[_0x9682('0xc')]);router[_0x9682('0xd')]('/',auth[_0x9682('0x8')](),controller[_0x9682('0xe')]);router['post'](_0x9682('0xb'),auth[_0x9682('0x8')](),controller[_0x9682('0xf')]);router[_0x9682('0x10')](_0x9682('0x11'),auth[_0x9682('0x8')](),controller[_0x9682('0x12')]);router[_0x9682('0x13')]('/:id',auth[_0x9682('0x8')](),controller[_0x9682('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index fd1c6e9..4c2a9db 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 _0x3fde=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3fde,0xcc));var _0xe3fd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3fde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe3fd('0x0'));var Sequelize=require(_0xe3fd('0x1'));module[_0xe3fd('0x2')]={'firstName':{'type':Sequelize[_0xe3fd('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xe3fd('0x3')]},'street':{'type':Sequelize[_0xe3fd('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe3fd('0x3')]},'country':{'type':Sequelize[_0xe3fd('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe3fd('0x4')]},'phone':{'type':Sequelize[_0xe3fd('0x3')]},'mobile':{'type':Sequelize[_0xe3fd('0x3')]},'fax':{'type':Sequelize[_0xe3fd('0x3')]},'email':{'type':Sequelize[_0xe3fd('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe3fd('0x3')]},'twitter':{'type':Sequelize[_0xe3fd('0x3')]},'skype':{'type':Sequelize[_0xe3fd('0x3')]},'teams':{'type':Sequelize[_0xe3fd('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe3fd('0x3')]},'wechat':{'type':Sequelize[_0xe3fd('0x3')]},'telegram':{'type':Sequelize[_0xe3fd('0x3')]},'UserId':{'type':Sequelize[_0xe3fd('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xe3fd('0x3')]},'priority':{'type':Sequelize[_0xe3fd('0x5')](0x2)[_0xe3fd('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe3fd('0x7')],'defaultValue':Sequelize[_0xe3fd('0x8')]},'dialTimezone':{'type':Sequelize[_0xe3fd('0x3')]},'utcOffset':{'type':Sequelize[_0xe3fd('0x5')]}};
\ No newline at end of file
+var _0xb0d1=['DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x42f981,_0x3a8798){var _0x55b62a=function(_0x39ce44){while(--_0x39ce44){_0x42f981['push'](_0x42f981['shift']());}};_0x55b62a(++_0x3a8798);}(_0xb0d1,0x159));var _0x1b0d=function(_0x2d04cf,_0x5706ff){_0x2d04cf=_0x2d04cf-0x0;var _0xc2f0e=_0xb0d1[_0x2d04cf];return _0xc2f0e;};'use strict';var _=require(_0x1b0d('0x0'));var Sequelize=require(_0x1b0d('0x1'));module[_0x1b0d('0x2')]={'firstName':{'type':Sequelize[_0x1b0d('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1b0d('0x3')]},'street':{'type':Sequelize[_0x1b0d('0x3')]},'postalCode':{'type':Sequelize[_0x1b0d('0x3')]},'city':{'type':Sequelize[_0x1b0d('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1b0d('0x3')]},'description':{'type':Sequelize[_0x1b0d('0x4')]},'phone':{'type':Sequelize[_0x1b0d('0x3')]},'mobile':{'type':Sequelize[_0x1b0d('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1b0d('0x3')]},'url':{'type':Sequelize[_0x1b0d('0x3')]},'facebook':{'type':Sequelize[_0x1b0d('0x3')]},'fb_data':{'type':Sequelize[_0x1b0d('0x3')]},'twitter':{'type':Sequelize[_0x1b0d('0x3')]},'skype':{'type':Sequelize[_0x1b0d('0x3')]},'teams':{'type':Sequelize[_0x1b0d('0x3')]},'viber':{'type':Sequelize[_0x1b0d('0x3')]},'line':{'type':Sequelize[_0x1b0d('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1b0d('0x3')]},'UserId':{'type':Sequelize[_0x1b0d('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x1b0d('0x3')]},'priority':{'type':Sequelize[_0x1b0d('0x5')](0x2)[_0x1b0d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1b0d('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x1b0d('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index b768b77..75362fa 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 _0xea05=['order','pick','filter','nolimit','findOne','ids','setAdditionalPhones','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','intersection','ContactId','options','includeAll','getHopperHistories','sort','include','rows','getHopperFinals','rawAttributes','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','upload','createReadStream','parse','file','meta','import','agent','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','User','message','chat','sms','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','destination','callerid','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','DESC','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','key','Owner','browserName','customerPort','deviceModel','ratingMessage','ratingType','referer','mail','subject','substatus','externalUrl','flatten','sortBy','reverse','value','slice','moment','util','path','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','undefined','limit','count','offset','set','update','then','destroy','end','sendStatus','name','send','describe','getOptions','findAll','user','CmContact','find','keys','length','startsWith','columnName','analytics','query','CmCustomField','cf_','displayName','alias','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','catch','merge','body','from','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','spread','all','show','params','Tag','Tags','color','CmContactHasItem','Phones','ContactItemType','ItemType','sequelize','literal','$and','omit','map','format','cf_%d','dialTimezone','isEmpty','table','cm_contacts','setFields','toParam','phone','getTags','model','filters','attributes','fields'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xea05,0x7b));var _0x5ea0=function(_0x380165,_0x4df1cf){_0x380165=_0x380165-0x0;var _0x2183c7=_0xea05[_0x380165];return _0x2183c7;};'use strict';var moment=require(_0x5ea0('0x0'));var BPromise=require('bluebird');var util=require(_0x5ea0('0x1'));var path=require(_0x5ea0('0x2'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x5ea0('0x3'));var contacts=require(_0x5ea0('0x4'));var qs=require(_0x5ea0('0x5'));var logger=require(_0x5ea0('0x6'))(_0x5ea0('0x7'));var config=require(_0x5ea0('0x8'));var shared=require(_0x5ea0('0x9'));var db=require(_0x5ea0('0xa'))['db'];config[_0x5ea0('0xb')]=_[_0x5ea0('0xc')](config[_0x5ea0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ea0('0xd'))(new Redis(config['redis']));require(_0x5ea0('0xe'))[_0x5ea0('0xf')](socket);function respondWithResult(_0x1b1ee7,_0x4a8042){_0x4a8042=_0x4a8042||0xc8;return function(_0x373b72){if(_0x373b72){return _0x1b1ee7[_0x5ea0('0x10')](_0x4a8042)['json'](_0x373b72);}};}function respondWithFilteredResult(_0x1f9e20,_0x1762ac){return function(_0x16ed71){if(_0x16ed71){var _0xcf5b48=typeof _0x1762ac['offset']===_0x5ea0('0x11')&&typeof _0x1762ac[_0x5ea0('0x12')]===_0x5ea0('0x11');var _0x35e3ae=_0x16ed71[_0x5ea0('0x13')];var _0x312edc=_0xcf5b48?0x0:_0x1762ac[_0x5ea0('0x14')];var _0x57ff29=_0xcf5b48?_0x16ed71[_0x5ea0('0x13')]:_0x1762ac[_0x5ea0('0x14')]+_0x1762ac[_0x5ea0('0x12')];var _0x3e6b15;if(_0x57ff29>=_0x35e3ae){_0x57ff29=_0x35e3ae;_0x3e6b15=0xc8;}else{_0x3e6b15=0xce;}_0x1f9e20[_0x5ea0('0x10')](_0x3e6b15);return _0x1f9e20[_0x5ea0('0x15')]('Content-Range',_0x312edc+'-'+_0x57ff29+'/'+_0x35e3ae)['json'](_0x16ed71);}return null;};}function saveUpdates(_0x3d0b7c){return function(_0x1091d1){if(_0x1091d1){return _0x1091d1[_0x5ea0('0x16')](_0x3d0b7c)[_0x5ea0('0x17')](function(_0x598c71){return _0x598c71;});}return null;};}function removeEntity(_0x53a49f){return function(_0x35284d){if(_0x35284d){return _0x35284d[_0x5ea0('0x18')]()[_0x5ea0('0x17')](function(){_0x53a49f['status'](0xcc)[_0x5ea0('0x19')]();});}};}function handleEntityNotFound(_0x56aba3){return function(_0x119d67){if(!_0x119d67){_0x56aba3[_0x5ea0('0x1a')](0x194);}return _0x119d67;};}function handleError(_0x4485d7,_0x3dc778){_0x3dc778=_0x3dc778||0x1f4;return function(_0x2004ec){logger['error'](_0x2004ec['stack']);if(_0x2004ec[_0x5ea0('0x1b')]){delete _0x2004ec[_0x5ea0('0x1b')];}_0x4485d7[_0x5ea0('0x10')](_0x3dc778)[_0x5ea0('0x1c')](_0x2004ec);};}exports['index']=function(_0x46a8fa,_0x18658d){var _0x307299={};return contacts[_0x5ea0('0x1d')]()[_0x5ea0('0x17')](function(_0x2daecb){_0x307299=qs[_0x5ea0('0x1e')](_0x2daecb,_0x46a8fa);return contacts[_0x5ea0('0x1f')](_0x46a8fa['query'],_0x46a8fa[_0x5ea0('0x20')],_0x307299,_0x2daecb);})[_0x5ea0('0x17')](respondWithFilteredResult(_0x18658d,_0x307299))['catch'](handleError(_0x18658d,null));};exports['destroy']=function(_0x52ab96,_0xb42a63){return db[_0x5ea0('0x21')][_0x5ea0('0x22')]({'where':{'id':_0x52ab96['params']['id']}})[_0x5ea0('0x17')](handleEntityNotFound(_0xb42a63,null))[_0x5ea0('0x17')](removeEntity(_0xb42a63,null))['catch'](handleError(_0xb42a63,null));};exports[_0x5ea0('0x1d')]=function(_0x4ed0b6,_0x5c97f6){return db[_0x5ea0('0x21')]['describe']()[_0x5ea0('0x17')](function(_0x10d0e0){delete _0x10d0e0['tags'];for(var _0x11555f=0x0;_0x11555f
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous'];(function(_0x5cd23e,_0x20777b){var _0x216550=function(_0x2935bb){while(--_0x2935bb){_0x5cd23e['push'](_0x5cd23e['shift']());}};_0x216550(++_0x20777b);}(_0x0800,0x171));var _0x0080=function(_0x5ba28b,_0xa00021){_0x5ba28b=_0x5ba28b-0x0;var _0x16581a=_0x0800[_0x5ba28b];return _0x16581a;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x0080('0x0'));var fs=require('fs');var path=require(_0x0080('0x1'));var util=require(_0x0080('0x2'));var tnef=require(_0x0080('0x3'));var logger=require(_0x0080('0x4'))(_0x0080('0x5'));var config=require(_0x0080('0x6'));function getAddress(_0x2ee274){var _0x3f8039=_[_0x0080('0x7')](_0x2ee274[_0x0080('0x8')]);return _0x3f8039&&_0x3f8039['address']?_0x3f8039[_0x0080('0x9')]:_0x0080('0xa')+random[_0x0080('0xb')](0x6)+_0x0080('0xc');}function getFirstName(_0x1717e6){var _0x20bb8d=_['head'](_0x1717e6[_0x0080('0x8')]);if(_0x20bb8d&&_0x20bb8d['name']){if(_0x20bb8d[_0x0080('0xd')]==_0x20bb8d[_0x0080('0x9')]){return _0x20bb8d[_0x0080('0xd')][_0x0080('0xe')](0x0,_0x20bb8d[_0x0080('0xd')][_0x0080('0xf')]('@'));}var _0xaea98e=_0x20bb8d[_0x0080('0xd')]['split'](/\s+/);return _0xaea98e[_0x0080('0x10')]>0x1?_0xaea98e[_0x0080('0x11')](0x0,-0x1)[_0x0080('0x12')]('\x20'):_0x20bb8d[_0x0080('0xd')];}return'Anonymous';}function getLastName(_0x46bcbf){var _0xb714ce=_[_0x0080('0x7')](_0x46bcbf[_0x0080('0x8')]);if(_0xb714ce&&_0xb714ce[_0x0080('0xd')]){var _0x2ba215=_0xb714ce[_0x0080('0xd')][_0x0080('0x13')](/\s+/);return _0x2ba215[_0x0080('0x10')]>0x1?_0x2ba215[_0x0080('0x14')]():'';}return'';}function getMails(_0x1f87cb,_0x218619){var _0x515d28='';for(var _0x379c18=0x0;_0x379c18<_0x218619[_0x0080('0x8')][_0x0080('0x10')];_0x379c18+=0x1){if(_0x218619[_0x0080('0x8')][_0x379c18]['address']!==_0x1f87cb){if(!_['isEmpty'](_0x515d28)){_0x515d28+=',';}_0x515d28+=_0x218619[_0x0080('0x8')][_0x379c18][_0x0080('0xd')]||_0x218619[_0x0080('0x8')][_0x379c18][_0x0080('0x9')]||'';_0x515d28+='\x20<';_0x515d28+=_0x218619[_0x0080('0x8')][_0x379c18][_0x0080('0x9')]?_0x218619['value'][_0x379c18]['address']:'anonymous'+random['generate'](0x6)+'@xcally.com';_0x515d28+='>';}}return _0x515d28;}function parseEmail(_0x414e13,_0x59ce3c,_0x46e9cc){if(_0x59ce3c[_0x0080('0x15')]){var _0x397071=/